summaryrefslogtreecommitdiffstats
path: root/tests/language-feature/generics/where-optional-1.slang
blob: da4bdaacb1d2c72648a138cc3d20463da0d655f0 (plain)
1
2
3
4
5
6
7
8
9
10
11
//DIAGNOSTIC_TEST:SIMPLE(filecheck=CHECK):
interface IThing
{
    void thing();
}

void f<T>(T t) where optional T: IThing
{
    // Unchecked optional constraint is an error.
    t.thing(); // CHECK: error 30403
}