Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ deadcode ] local private things are not in scope at top-level but i…
…mported things should be The previous restriction of the top level scope (7f47d51) was a bit draconian and removed not only local private definitions but all imported things from the scope. This is fixed by this commit.
- Loading branch information
Showing
5 changed files
with
61 additions
and
17 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,14 @@ | ||
-- Check that F is in not in scope at the top-level (but in the hole). | ||
|
||
module _ where | ||
|
||
open import Common.Bool | ||
|
||
private | ||
unused = true | ||
used = true | ||
|
||
private | ||
postulate F : Set → Set | ||
module Private where | ||
not-in-scope = true | ||
|
||
Hole : Set | ||
Hole = {!!} | ||
in-scope = used |
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 |
---|---|---|
@@ -1,3 +1,9 @@ | ||
top_command (cmd_load currentFile []) | ||
goal_command 0 (cmd_infer Normalised) "F" | ||
top_command (cmd_infer_toplevel Normalised "F") | ||
top_command (cmd_load currentFile ["-i.", "-i.."]) | ||
top_command (cmd_load currentFile ["-i.", "-i.."]) | ||
-- These should give not in scope errors: | ||
top_command (cmd_infer_toplevel Normalised "unused") | ||
top_command (cmd_infer_toplevel Normalised "used") | ||
top_command (cmd_infer_toplevel Normalised "Private.not-in-scope") | ||
-- These should return "Bool" | ||
top_command (cmd_infer_toplevel Normalised "true") | ||
top_command (cmd_infer_toplevel Normalised "in-scope") |
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