yum-mirror/slang

Making it easier to work with shaders

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

CopilotFix internal error when a generic in an extension is unused (#7665)e40ddc6ef

master
620 B26 linesraw
1//TEST:SIMPLE(filecheck=CHECK): -target spirv
2// Test unreferenced generic parameters in extensions
3
4// Error case 1: Simple unreferenced generic parameter
5// CHECK: ([[# @LINE+1]]): error 30855:
6extension<T> int
7{
8    void foo() {}
9}
10
11// Error case 2: Multiple generic parameters, some unused
12// CHECK: ([[# @LINE+1]]): error 30855:
13extension<T, U> vector<T, 3>
14{
15    void bar() {}
16}
17
18// Error case 3: Parameters only used in inheritance declaration should be errors
19interface IFooGeneric<S> {}
20struct MyType {}
21
22// CHECK: ([[# @LINE+1]]): error 30855:
23extension<S> MyType : IFooGeneric<S>
24{
25    void shouldFail() {}
26}