summaryrefslogtreecommitdiffstats
path: root/tests/diagnostics/generic-constraint-equality-right-hand-side.slang
blob: c49fe20353855ad7b040a194a6a43f645f158bc7 (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
29
30
31
32
33
34
35
36
//TEST:SIMPLE(filecheck=CHECK):
interface IGen<A>
{
    associatedtype TB;
    int getVal();
}

interface Wrapper<A>
{}

struct Foo1<A> : IGen<A>
{
    typealias TB = Wrapper<A>; // `Wrapper<int>` also fails.
    int val = 0;
    int getVal()
    {
       return val;
    }
}

struct Logic<A1, C1 : IGen<A1>>
{
    int val = 0;
}

extension<A, C1> Logic<A, C1>
    where C1 : IGen<A>
    //CHECK: ([[# @LINE+1]]): error 30404: 
    where C1.TB == Wrapper<int>
{
    [mutating]
    void setVal(int dataIn)
    {
        val = dataIn;
    }
}