forked from agda/agda2hs
-
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.
Do not drop instance clauses but instead check canonicity
This was a regression introduced by agda#304 that went unnoticed due to a lack of a (failing) test case
- Loading branch information
1 parent
778f5f5
commit ecf59e3
Showing
4 changed files
with
36 additions
and
3 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
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,32 @@ | ||
|
||
module Fail.NonCanonicalSuperclass where | ||
|
||
open import Haskell.Prelude | ||
|
||
record Class (a : Set) : Set where | ||
field | ||
foo : a → a | ||
open Class {{...}} public | ||
|
||
{-# COMPILE AGDA2HS Class class #-} | ||
|
||
instance | ||
ClassBool : Class Bool | ||
ClassBool .foo = not | ||
|
||
{-# COMPILE AGDA2HS ClassBool #-} | ||
|
||
record Subclass (a : Set) : Set where | ||
field | ||
overlap {{super}} : Class a | ||
bar : a | ||
open Subclass {{...}} public | ||
|
||
{-# COMPILE AGDA2HS Subclass class #-} | ||
|
||
instance | ||
SubclassBool : Subclass Bool | ||
SubclassBool .super = record { foo = id } | ||
SubclassBool .bar = False | ||
|
||
{-# COMPILE AGDA2HS SubclassBool #-} |