summaryrefslogtreecommitdiffstats
path: root/tests/diagnostics/invalid-constraint.slang
blob: 667077ffb80767b94954a9fd1bc35dfe9cb78a33 (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
//DIAGNOSTIC_TEST:SIMPLE(filecheck=CHECK):

interface IFoo
{
    This foo();
}

struct Foo : IFoo
{
    float x;
    This foo()
    {
        This f;
        f.x = 0.0;
        return f;
    }
}

RWStructuredBuffer<float> output;

// CHECK: ([[# @LINE+1]]): error 30401
float compute<T:Foo>(T f) // error, should be IFoo here.
{
}

void main()
{}