Skip to content

Commit

Permalink
[ #308 ] Already fixed by new canonicity check, adding test case
Browse files Browse the repository at this point in the history
  • Loading branch information
jespercockx committed Sep 25, 2024
1 parent 770f209 commit a5552b6
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 0 deletions.
2 changes: 2 additions & 0 deletions test/AllTests.agda
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ import ErasedPatternLambda
import CustomTuples
import ProjectionLike
import FunCon
import Issue308

{-# FOREIGN AGDA2HS
import Issue14
Expand Down Expand Up @@ -179,4 +180,5 @@ import ErasedPatternLambda
import CustomTuples
import ProjectionLike
import FunCon
import Issue308
#-}
22 changes: 22 additions & 0 deletions test/Issue308.agda
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
open import Haskell.Prelude

record Class (a : Set) : Set where
field
foo : a a
open Class {{...}} public
{-# COMPILE AGDA2HS Class class #-}

module M1 (@0 X : Set) where

instance
ClassInt : Class Int
ClassInt .foo = _+ 1
{-# COMPILE AGDA2HS ClassInt #-}

module M2 (@0 X : Set) where

open M1 X

tester : Int
tester = foo 41
{-# COMPILE AGDA2HS tester #-}
1 change: 1 addition & 0 deletions test/golden/AllTests.hs
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,5 @@ import ErasedPatternLambda
import CustomTuples
import ProjectionLike
import FunCon
import Issue308

11 changes: 11 additions & 0 deletions test/golden/Issue308.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module Issue308 where

class Class a where
foo :: a -> a

instance Class Int where
foo = (+ 1)

tester :: Int
tester = foo 41

0 comments on commit a5552b6

Please sign in to comment.