diff options
| author | Yong He <yonghe@outlook.com> | 2023-12-06 12:05:07 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-12-06 12:05:07 -0800 |
| commit | 11111e5733b189127dc2c4934d67693b9bc6e764 (patch) | |
| tree | 0ba84df3e856eb104abec2ecac47242bc70a7b7d /tests/diagnostics/internal-visibility/this-module.slang | |
| parent | fa6d8717d02912697c09f2d7de802723ac6d6e47 (diff) | |
Support visibility control and default to `internal`. (#3380)
* Support visibility control and default to `internal`.
* Fix wip.
* Fixes.
* Fix.
* Fix test.
* Add legacy language detection and compatibility for existing code.
* Add doc.
---------
Co-authored-by: Yong He <yhe@nvidia.com>
Diffstat (limited to 'tests/diagnostics/internal-visibility/this-module.slang')
| -rw-r--r-- | tests/diagnostics/internal-visibility/this-module.slang | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/diagnostics/internal-visibility/this-module.slang b/tests/diagnostics/internal-visibility/this-module.slang new file mode 100644 index 000000000..98e0f3d08 --- /dev/null +++ b/tests/diagnostics/internal-visibility/this-module.slang @@ -0,0 +1,26 @@ +//DIAGNOSTIC_TEST:SIMPLE(filecheck=CHECK): + +module "this-module"; + +import "that-module"; + +void test() +{ + PublicStruct s; + // CHECK:{{.*}}(11): error 30600: + s.x = 1; // Error. + // CHECK-NOT:{{.*}}error + s.y = 2; // OK. + publicMethod(); // OK. + publicFunc2(); // OK. + Namespace.publicVar = 1; // OK. + Namespace.publicVar2 = 1; // OK. + // CHECK:{{.*}}(19): error 30600: + Namespace.internalVar = 1; // error. + // CHECK:{{.*}}(21): error 30600: + InternalEnum e; // Error. + // CHECK:{{.*}}(23): error 30600: + InternalStruct s1; // Error. + // CHECK:{{.*}}(25): error 30600: + internalMethod(); // Error. +} |
