-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1067 from utwente-fmt/issue-463
fix #463: consider whether the context is static
- Loading branch information
Showing
5 changed files
with
96 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
test/main/vct/test/integration/features/ResolutionSpec.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package vct.test.integration.features | ||
|
||
import vct.test.integration.helper.VercorsSpec | ||
|
||
class ResolutionSpec extends VercorsSpec { | ||
vercors should error withCode "noSuchName" in "example with incorrect usage from static context: single name invocation" java """ | ||
class Test { | ||
//@ resource x() = true; | ||
//@ requires x(); | ||
static void bar() {} | ||
} | ||
""" | ||
|
||
vercors should error withCode "noSuchName" in "example with incorrect usage from static context: qualified invocation" java """ | ||
class Test { | ||
//@ resource x() = true; | ||
//@ requires Test.x(); | ||
static void bar() {} | ||
} | ||
""" | ||
|
||
vercors should error withCode "noSuchName" in "example with incorrect usage from static context: single name" java """ | ||
class Test { | ||
int x; | ||
//@ requires x == 5; | ||
static void bar() {} | ||
} | ||
""" | ||
|
||
vercors should error withCode "noSuchName" in "example with incorrect usage from static context: qualified name" java """ | ||
class Test { | ||
int x; | ||
//@ requires Test.x == 5; | ||
static void bar() {} | ||
} | ||
""" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters