summaryrefslogtreecommitdiffstats
path: root/tests/diagnostics/setter-method.slang
blob: c1e6019d03675de073b11bf60d5738d01d532f71 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// setter-method.slang

//DIAGNOSTIC_TEST:SIMPLE:

// Make sure we provide a user a diagnostic if they
// try to declare a setter method without `mutating`
// (even if we don't support `mutating` yet).

struct Sphere
{
    float3 center;
    float radius;

    void setCenter(float3 value)
    {
        center = value;
    }

    void setRadius(float value)
    {
        this.radius = value;
    }
};