diff options
| author | Yong He <yonghe@outlook.com> | 2023-10-06 14:03:18 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-10-06 14:03:18 -0700 |
| commit | 17c7163c2ae8fc290e70b43d8700b68ef18b1ee1 (patch) | |
| tree | 09df040039fb1221810f956bb83871430cbac47f /tests | |
| parent | 4547125ce945140dc10542e9606b225dd06159b8 (diff) | |
Small type system fixes. (#3265)
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/diagnostics/property-readonly-lvalue.slang | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/diagnostics/property-readonly-lvalue.slang b/tests/diagnostics/property-readonly-lvalue.slang new file mode 100644 index 000000000..ec7263f17 --- /dev/null +++ b/tests/diagnostics/property-readonly-lvalue.slang @@ -0,0 +1,14 @@ +//DIAGNOSTIC_TEST:SIMPLE(filecheck=CHECK): +// use read-only property as l-value + +struct MyType +{ + property float3 prop { get { return float3(1, 2, 3);}} +} + +void test() +{ + MyType t; + // CHECK: {{.*}}error 30047: argument passed to parameter '0' must be l-value. + t.prop.x += 1.0; +} |
