yum-mirror/slang

Making it easier to work with shaders

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

Yong HeSupport visibility control and default to `internal`. (#3380)11111e573

master
651 B26 linesraw
1//DIAGNOSTIC_TEST:SIMPLE(filecheck=CHECK):
2
3module "this-module";
4
5import "that-module";
6
7void test()
8{
9    PublicStruct s;
10    // CHECK:{{.*}}(11): error 30600:
11    s.x = 1; // Error.
12    // CHECK-NOT:{{.*}}error
13    s.y = 2; // OK.
14    publicMethod(); // OK.
15    publicFunc2();  // OK.
16    Namespace.publicVar = 1; // OK.
17    Namespace.publicVar2 = 1; // OK.
18    // CHECK:{{.*}}(19): error 30600:
19    Namespace.internalVar = 1; // error.
20    // CHECK:{{.*}}(21): error 30600:
21    InternalEnum e; // Error.
22    // CHECK:{{.*}}(23): error 30600:
23    InternalStruct s1; // Error.
24    // CHECK:{{.*}}(25): error 30600:
25    internalMethod(); // Error.
26}