summaryrefslogtreecommitdiffstats
path: root/tests/bugs/extended-type-in-param.slang
blob: b3631d36e8b2465b98605b485b65b755a6f9d121 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
//TEST:SIMPLE(filecheck=CHECK): -target spirv
struct ArrayLike<T>
{
}
__generic<T : IDifferentiable>
extension ArrayLike<T> : IDifferentiable
{
}

struct ExpectsDiff<T : IDifferentiable>
{
}

// test that using `ExpectsDiff<ArrayLike<T>>` is fine to the type system.
// this means that we must have checked the extension for `ArrayLike<T>` before
// we check the `t3` parameter for `test`.
void test<T : IDifferentiable>(ExpectsDiff<ArrayLike<T>> t3)
{
}

// CHECK: OpEntryPoint

[numthreads(1, 1, 1)]
void main()
{
    ExpectsDiff<ArrayLike<float>> v = {};
    test<float>(v);
}