Should also make sure ~ only applies to types

This commit is contained in:
Sasha Koshka 2024-02-16 13:09:48 -05:00
parent e38c185042
commit 3ef9f404b1
1 changed files with 13 additions and 0 deletions

View File

@ -141,3 +141,16 @@ testUnits (test,
"layer1.fspl",
`+ X:layer0::X`,
)}
func TestFunctionRestrictedErr (test *testing.T) {
testStringErr (test,
"cannot mark function as restricted", 0, 0,
`~ [f]`,
)}
func TestMethodRestrictedErr (test *testing.T) {
testStringErr (test,
"cannot mark method as restricted", 0, 0,
`T:Int
~ T.[f]`,
)}