Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix for issue #18, faulty defaulting inside instance decl
- Loading branch information
1 parent
b30abe9
commit aade7de
Showing
3 changed files
with
79 additions
and
16 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
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,30 @@ | |||
{- ---------------------------------------------------------------------------------------- | |||
what : correct defaulting to Integer in instance decl, due to bug not doing so | |||
expected: ok | |||
---------------------------------------------------------------------------------------- -} | |||
|
|||
module Defaulting1 where | |||
|
|||
f :: Num a => a -> () | |||
f _ = () | |||
|
|||
class C a where | |||
it :: a | |||
|
|||
|
|||
-- fix of previous bug: | |||
-- Here I get a type error: | |||
-- Test.hs:14-15: | |||
-- Predicates remain unproven: | |||
-- preds: UHC.Base.Num v_3_190_2 | |||
-- at : | |||
-- trace: (UHC.Base.Num v_3_190_2,<4,0>,Test.hs:15:8): FAIL | |||
-- (UHC.Base.Num v_3_190_2,<4,0>,Test.hs:15:8): FAIL | |||
instance C () where | |||
it = f 0 | |||
|
|||
-- This one compiles fine. | |||
it' :: () | |||
it' = f 0 | |||
|
|||
main = print (it :: ()) |