yum-mirror/slang

Making it easier to work with shaders

git clone https://git.yummers.dev/yum-mirror/slang

sricker-nvidiaAdd error for forward references in generic constraints (#7615)2c4bfce49

master
560 B16 linesraw
1//DIAGNOSTIC_TEST:SIMPLE:
2// Test forward references in generic constraints
3
4interface IFloat {}
5interface IFoo<T : IFloat> {}
6interface IBar<T, U> {}
7
8// Test case 1: Simple forward reference in interface constraint
9void test1<Foo : IFoo<T>, T : IFloat>() {}
10
11// Test case 2: Multiple forward references in a single constraint
12void test2<A : IBar<B, C>, B : IFloat, C : IFloat>() {}
13
14// Valid case that should NOT produce our error:
15// Test case 3: Correct order - type parameter declared before use
16void test3<T : IFloat, Foo : IFoo<T>>() {}