//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK): -shaderobj -output-using-type //TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK): -vk -shaderobj -output-using-type // Test that an associated type can be constrained to a generic interface. interface IB { int bar(); } interface IA { associatedtype B : IB; B getB(); } struct BImpl : IB { int bar() { return x; } } struct AImpl : IA { typealias B = BImpl; B getB() { BImpl b = {}; return b; } } int test>(T t) { T.B bb = t.getB(); return bb.bar(); } //TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):out,name=outputBuffer RWStructuredBuffer outputBuffer; [numthreads(1,1,1)] void computeMain() { AImpl<5> a; // CHECK: 5 outputBuffer[0] = test(a); }