yum-mirror/slang

Making it easier to work with shaders

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

Yong HeRequire `override` keyword for overriding default interface methods. (#7458)a4345725a

master
461 B20 linesraw
1//DIAGNOSTIC_TEST:SIMPLE(filecheck=CHECK):
2
3interface IFoo
4{
5    int getVal() { return 0; }
6}
7
8struct Impl : IFoo
9{
10    // Missing override for getVal, which should trigger a diagnostic.
11    // CHECK: ([[# @LINE+1]]): error 30853
12    int getVal() { return 1; }
13}
14
15struct Impl2 : IFoo
16{
17    // Overriding getVal with a different signature should also trigger a diagnostic.
18    // CHECK: ([[# @LINE+1]]): error 30854
19    override int getVal(int x) { return x; }
20}