-
Notifications
You must be signed in to change notification settings - Fork 37
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 #304 that went unnoticed due to a lack of a (failing) test case
- Loading branch information
1 parent
060270e
commit 001f845
Showing
5 changed files
with
38 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 #-} |
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 @@ | ||
test/Fail/NonCanonicalSuperclass.agda:28,3-15 | ||
illegal instance: record { foo = id } |