-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed #1077 confusing error when declarations before the toplevel module
- Loading branch information
1 parent
1300a78
commit 11fed58
Showing
7 changed files
with
102 additions
and
1 deletion.
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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
-- Andreas, 2017-07-28, issue #1077 | ||
-- Agda's reconstruction of the top-level module can be confusing | ||
-- in case the user puts some illegal declarations before the | ||
-- top level module in error. | ||
|
||
foo = Set | ||
|
||
module Issue1077 where | ||
|
||
bar = Set | ||
|
||
-- WAS: accepted, creating modules Issue1077 and Issue1077.Issue1077 | ||
-- with Issue1077.foo and Issue1077.Issue1077.bar | ||
|
||
-- NOW: Error | ||
-- Illegal declarations before top-level module |
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,2 @@ | ||
Issue1077.agda:6,1-10 | ||
Illegal declaration(s) before top-level module |
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,10 @@ | ||
-- Andreas, 2017-07-28, issue 1077 | ||
|
||
open import Issue1077 | ||
|
||
foz = foo | ||
baz = bar | ||
|
||
-- WAS: bar not in scope | ||
|
||
-- NOW: import fails because module Issue1077 is rejected |
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,4 @@ | ||
Issue1077.agda:6,1-10 | ||
Illegal declaration(s) before top-level module | ||
when scope checking the declaration | ||
open import Issue1077 |
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,19 @@ | ||
-- Andreas, 2017-07-28, issue #1077 | ||
|
||
-- Agda's reconstruction of the top-level module can be confusing | ||
-- in case the user puts some illegal declarations before the | ||
-- top level module in error. | ||
|
||
-- Thus, Agda now rejects the following if the anon. module is omitted. | ||
-- If the user writes the anon. module, it should be accepted, | ||
-- (even if it looks stupid in this case). | ||
|
||
module _ where | ||
|
||
foo = Set | ||
|
||
module Issue1077 where | ||
|
||
bar = Set | ||
|
||
-- Should be accepted. |