//TEST:SIMPLE(filecheck=CHECK_FAIL): -target spirv -entry computeMain -stage compute -DFAIL //TEST:SIMPLE(filecheck=CHECK_PASS): -target spirv -entry computeMain -stage compute //TEST(compute):COMPARE_COMPUTE_EX(filecheck-buffer=CHECK): -slang -compute -shaderobj -output-using-type struct Foo { int val = 0; int getVal() { return val; } } extension Foo where A == int { [mutating] void setVal1(int dataIn) { val += dataIn; } } //TEST_INPUT: set outBuffer = out ubuffer(data=[0 0 0 0], stride=4) RWStructuredBuffer outBuffer; void computeMain() { //CHECK_FAIL: error 30027: 'setVal1'{{.*}}'Foo' //CHECK_PASS: OpEntryPoint //CHECK: 3 #ifdef FAIL // fails since while expanding A and applying `where`, // we will find a `float`, not a `int` Foo x = Foo(); #else Foo x = Foo(); #endif x.setVal1(3); outBuffer[0] = x.getVal(); }