Added test for namespace shadowing

This commit is contained in:
Mattia Giambirtone 2022-11-27 14:34:09 +01:00
parent 582d29d149
commit de981a2ec6
1 changed files with 7 additions and 0 deletions

7
tests/namespaces.pn Normal file
View File

@ -0,0 +1,7 @@
import std; # Defines a public "version" variable
print(std.version == 1);
print(version == std.version); # If there's no duplicates, the fully qualified name is optional
var version = 2; # Raises warning
print(std.version == 1);
print(version == 2); # We shadowed the name, but we can still access it as std.version