-
Notifications
You must be signed in to change notification settings - Fork 46
[ fix #306 ] Correctly error on dot patterns corresponding to module arguments #439
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 2 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
003d0df
[ agda#306 ] Error on module param dot pat
NathanielB123 51bb9e4
Make golden
NathanielB123 c66a5bc
Rename checkForced
NathanielB123 b26e677
Remove redundant forced pattern check
NathanielB123 8125ca2
Allow dot patterns on non-dependent args
NathanielB123 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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,7 +1,7 @@ | ||
| module Agda2Hs.Compile.Function where | ||
|
|
||
| import qualified Agda2Hs.Language.Haskell as Hs ( Match, Name ) | ||
| import Agda.Syntax.Internal ( Clause, ModuleName, QName, Type ) | ||
| import Agda.Syntax.Internal ( Clause, ModuleName, QName, Type, Args ) | ||
| import Agda2Hs.Compile.Types ( C ) | ||
|
|
||
| compileClause' :: ModuleName -> Maybe QName -> Hs.Name () -> Type -> Clause -> C (Maybe (Hs.Match ())) | ||
| compileClause' :: ModuleName -> Args -> Maybe QName -> Hs.Name () -> Type -> Clause -> C (Maybe (Hs.Match ())) |
This file contains hidden or 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 hidden or 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 hidden or 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
2 changes: 2 additions & 0 deletions
2
test/ErasedPatternLambda.agda → test/Fail/ErasedPatternLambda.agda
This file contains hidden or 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,5 @@ | ||
| module Fail.ErasedPatternLambda where | ||
|
|
||
| open import Haskell.Prelude | ||
|
|
||
| Scope = List Bool | ||
|
|
||
This file contains hidden or 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,11 @@ | ||
| open import Haskell.Prelude | ||
|
|
||
| module Fail.Issue306a where | ||
|
|
||
| cast : {a b : Set} → @0 a ≡ b → a → b | ||
| cast {a} {b} = cast' | ||
| where | ||
| cast' : @0 a ≡ b → a → b | ||
| cast' refl x = x | ||
|
|
||
| {-# COMPILE AGDA2HS cast #-} |
This file contains hidden or 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 @@ | ||
| open import Haskell.Prelude | ||
|
|
||
| module Fail.Issue306b where | ||
|
|
||
| record Foo (a b : Set) : Set where | ||
| no-eta-equality | ||
| field | ||
| coe : a → b | ||
| open Foo public | ||
|
|
||
| instance | ||
| foo : ∀ {a b : Set} → {{@0 _ : a ≡ b}} → Foo a b | ||
| foo {{refl}} .coe x = x | ||
|
|
||
| {-# COMPILE AGDA2HS Foo class #-} | ||
| {-# COMPILE AGDA2HS foo #-} |
This file contains hidden or 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,17 @@ | ||
| open import Haskell.Prelude | ||
|
|
||
| module Fail.Issue306c where | ||
|
|
||
| record Foo (a b : Set) : Set where | ||
| no-eta-equality | ||
| field | ||
| coe : a → b | ||
| open Foo public | ||
|
|
||
| module _ {a b : Set} where | ||
| instance | ||
| foo : {{@0 _ : a ≡ b}} → Foo a b | ||
| foo {{refl}} .coe x = x | ||
|
|
||
| {-# COMPILE AGDA2HS Foo class #-} | ||
| {-# COMPILE AGDA2HS foo #-} |
This file contains hidden or 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,20 @@ | ||
| open import Haskell.Prelude | ||
|
|
||
| -- Unlike the tests in Fail/ related to issue #306, here we check that | ||
| -- instances in modules WITHOUT dot patterns can actually work (previously | ||
| -- threw __IMPOSSIBLE__) | ||
| module Issue306 where | ||
|
|
||
| record Foo (a b : Set) : Set where | ||
| no-eta-equality | ||
| field | ||
| coe : a → b | ||
| open Foo public | ||
|
|
||
| module _ {a : Set} where | ||
| instance | ||
| foo : Foo a a | ||
| foo .coe x = x | ||
|
|
||
| {-# COMPILE AGDA2HS Foo class #-} | ||
| {-# COMPILE AGDA2HS foo #-} |
This file contains hidden or 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 hidden or 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,3 @@ | ||
| test/Fail/ErasedPatternLambda.agda:19.42-61: error: [CustomBackendError] | ||
| agda2hs: | ||
| not supported: forced (dot) patterns in non-erased positions |
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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,9 @@ | ||
| {-# LANGUAGE MultiParamTypeClasses, ScopedTypeVariables #-} | ||
| module Issue306 where | ||
|
|
||
| class Foo a b where | ||
| coe :: a -> b | ||
|
|
||
| instance forall a . Foo a a where | ||
| coe x = x | ||
|
|
This file contains hidden or 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,3 @@ | ||
| test/Fail/Issue306a.agda:5.1-5: error: [CustomBackendError] | ||
| agda2hs: | ||
| not supported: forced (dot) patterns in non-erased positions |
This file contains hidden or 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,3 @@ | ||
| test/Fail/Issue306b.agda:12.3-6: error: [CustomBackendError] | ||
| agda2hs: | ||
| not supported: forced (dot) patterns in non-erased positions |
This file contains hidden or 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,3 @@ | ||
| test/Fail/Issue306c.agda:13.5-8: error: [CustomBackendError] | ||
| agda2hs: | ||
| not supported: forced (dot) patterns in non-erased positions |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.