From: simonpj Date: Mon, 14 Jun 1999 09:29:07 +0000 (+0000) Subject: [project @ 1999-06-14 09:29:01 by simonpj] X-Git-Tag: Approximately_9120_patches~6131 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=3dabbed3985a1a3ece25780e6d2da2626756c523;p=ghc-hetmet.git [project @ 1999-06-14 09:29:01 by simonpj] Accept some test changes; add tcfail082, read021 --- diff --git a/ghc/tests/ccall/should_fail/cc004.stderr b/ghc/tests/ccall/should_fail/cc004.stderr index 11f5d85..314eca0 100644 --- a/ghc/tests/ccall/should_fail/cc004.stderr +++ b/ghc/tests/ccall/should_fail/cc004.stderr @@ -1,11 +1,11 @@ cc004.hs:2: Cannot generalise these overloadings (in a _ccall_): - `CReturnable b' arising from the result of the _ccall_ to `f' at cc004.hs:15 + `CReturnable b' arising from the result of the _ccall_ to `f' at cc004.hs:8 cc004.hs:2: Cannot generalise these overloadings (in a _ccall_): - `CReturnable b' arising from the result of the _ccall_ to `f' at cc004.hs:8 + `CReturnable b' arising from the result of the _ccall_ to `f' at cc004.hs:15 Compilation had errors diff --git a/ghc/tests/deSugar/should_compile/ds045.hs b/ghc/tests/deSugar/should_compile/ds045.hs new file mode 100644 index 0000000..df25912 --- /dev/null +++ b/ghc/tests/deSugar/should_compile/ds045.hs @@ -0,0 +1,15 @@ +!! N-plus-K pattern in binding + +-- From: Andreas Marth +-- Sent: Monday, June 07, 1999 5:02 PM +-- To: glasgow-haskell-bugs@majordomo.haskell.org +-- Subject: compiler-bug + +module Test where + +erroR :: Int +erroR = n where + (n+1,_) = (5,2) + +-- Produced a -dcore-lint error in the desugarer output +-- (Was a missing case in DsHsSyn.collectTypedPatBinders) diff --git a/ghc/tests/reader/should_compile/read014.stderr b/ghc/tests/reader/should_compile/read014.stderr index b7fb1c9..c14fb40 100644 --- a/ghc/tests/reader/should_compile/read014.stderr +++ b/ghc/tests/reader/should_compile/read014.stderr @@ -5,22 +5,22 @@ read014.hs:4: Warning: Defined but not used: x read014.hs:8: Warning: Defined but not used: x -read014.hs:8: - Warning: No explicit method nor default method for `fromInteger' +read014.hs:6: + Warning: No explicit method nor default method for `+' in an instance declaration for `Num' -read014.hs:8: - Warning: No explicit method nor default method for `signum' +read014.hs:6: + Warning: No explicit method nor default method for `*' in an instance declaration for `Num' -read014.hs:8: +read014.hs:6: Warning: No explicit method nor default method for `abs' in an instance declaration for `Num' -read014.hs:8: - Warning: No explicit method nor default method for `*' +read014.hs:6: + Warning: No explicit method nor default method for `signum' in an instance declaration for `Num' -read014.hs:8: - Warning: No explicit method nor default method for `+' +read014.hs:6: + Warning: No explicit method nor default method for `fromInteger' in an instance declaration for `Num' diff --git a/ghc/tests/reader/should_compile/read021.hs b/ghc/tests/reader/should_compile/read021.hs new file mode 100644 index 0000000..b515df2 --- /dev/null +++ b/ghc/tests/reader/should_compile/read021.hs @@ -0,0 +1,6 @@ +-- !!! Empty export list + +module Reader() where + +instance Show (a->b) where + show f = "<>" diff --git a/ghc/tests/reader/should_fail/read004.stderr b/ghc/tests/reader/should_fail/read004.stderr index e4c1f75..a7896b7 100644 --- a/ghc/tests/reader/should_fail/read004.stderr +++ b/ghc/tests/reader/should_fail/read004.stderr @@ -1,2 +1,4 @@ -read004.hs:19:1: Illegal character: `.' in a string gap -read004.hs:19:1: on input: "." +read004.hs:14: error in character literal + +Compilation had errors + diff --git a/ghc/tests/rename/should_compile/Rn016.hi b/ghc/tests/rename/should_compile/Rn016.hi index 30dca25..2405244 100644 --- a/ghc/tests/rename/should_compile/Rn016.hi +++ b/ghc/tests/rename/should_compile/Rn016.hi @@ -5,5 +5,5 @@ instance {K PrelBase.Bool} = _f2; instance __forall [a] => {K [a]} = _f3; 1 _f1 :: {K PrelBase.Int} ; 1 _f2 :: {K PrelBase.Bool} ; -1 _f3 :: __forall [a] => {K PrelList.[a]} ; +1 _f3 :: __forall [a] => {K [a]} ; 1 class K a :: (* -> *) where { op1 :: a -> a ; op2 :: a -> a } ; diff --git a/ghc/tests/rename/should_fail/rnfail004.stderr b/ghc/tests/rename/should_fail/rnfail004.stderr index 5019773..3db6dd2 100644 --- a/ghc/tests/rename/should_fail/rnfail004.stderr +++ b/ghc/tests/rename/should_fail/rnfail004.stderr @@ -1,9 +1,9 @@ -rnfail004.hs:6: +rnfail004.hs:7: Conflicting definitions for `a' in a binding group -rnfail004.hs:7: +rnfail004.hs:8: Conflicting definitions for `b' in a binding group diff --git a/ghc/tests/rename/should_fail/rnfail012.stderr b/ghc/tests/rename/should_fail/rnfail012.stderr index cd668c8..d893c65 100644 --- a/ghc/tests/rename/should_fail/rnfail012.stderr +++ b/ghc/tests/rename/should_fail/rnfail012.stderr @@ -1,8 +1,8 @@ rnfail012.hs:2: Multiple declarations of `A' - defined at rnfail012.hs:3 - defined at rnfail012.hs:9 + defined at rnfail012.hs:2 + defined at rnfail012.hs:8 Compilation had errors diff --git a/ghc/tests/rename/should_fail/rnfail013.stderr b/ghc/tests/rename/should_fail/rnfail013.stderr index f3079f5..4536981 100644 --- a/ghc/tests/rename/should_fail/rnfail013.stderr +++ b/ghc/tests/rename/should_fail/rnfail013.stderr @@ -1,8 +1,8 @@ rnfail013.hs:3: Multiple declarations of `MkT' + defined at rnfail013.hs:5 defined at rnfail013.hs:7 - defined at rnfail013.hs:9 Compilation had errors diff --git a/ghc/tests/rename/should_fail/rnfail014.stderr b/ghc/tests/rename/should_fail/rnfail014.stderr index 30d68e9..f21404e 100644 --- a/ghc/tests/rename/should_fail/rnfail014.stderr +++ b/ghc/tests/rename/should_fail/rnfail014.stderr @@ -1,5 +1,5 @@ -rnfail014.hs:9: +rnfail014.hs:8: None of the type variable(s) in the constraint `Eq a' appears in the type `Eq Bool' In the type signature for an instance decl diff --git a/ghc/tests/rename/should_fail/rnfail015.stderr b/ghc/tests/rename/should_fail/rnfail015.stderr index 1cb559f..6760dd0 100644 --- a/ghc/tests/rename/should_fail/rnfail015.stderr +++ b/ghc/tests/rename/should_fail/rnfail015.stderr @@ -1,5 +1,5 @@ -rnfail015.hs:9: +rnfail015.hs:8: Conflicting definitions for `TokLiteral' in the data type declaration for `Token' diff --git a/ghc/tests/typecheck/should_fail/Data82.hs b/ghc/tests/typecheck/should_fail/Data82.hs new file mode 100644 index 0000000..cac9540 --- /dev/null +++ b/ghc/tests/typecheck/should_fail/Data82.hs @@ -0,0 +1,3 @@ +module Data82 where + +data FooData = FooData diff --git a/ghc/tests/typecheck/should_fail/Digraph.stderr b/ghc/tests/typecheck/should_fail/Digraph.stderr index e9b7774..d3ef0ca 100644 --- a/ghc/tests/typecheck/should_fail/Digraph.stderr +++ b/ghc/tests/typecheck/should_fail/Digraph.stderr @@ -14,21 +14,21 @@ Digraph.hs:19: ([], []) (snd (dfs (new_range es) ([], []) vs))) where - span_tree r (vs, ns) [] = (vs, ns) - span_tree r (vs, ns) (x : xs) - | x `elem` vs = span_tree r (vs, ns) xs - | otherwise = span_tree r (vs', (x : ns') : ns) xs - where - (vs', ns') = dfs r (x : vs, []) (r x) + swap (x, y) = (y, x) + reversed_edges :: forall v. (Eq v) => [Edge v] + reversed_edges = map swap es new_range [] w = [] new_range ((x, y) : xys) w = if x == w then (y : (new_range xys w)) else (new_range xys w) - swap (x, y) = (y, x) - reversed_edges :: forall v. (Eq v) => [Edge v] - reversed_edges = map swap es + span_tree r (vs, ns) [] = (vs, ns) + span_tree r (vs, ns) (x : xs) + | x `elem` vs = span_tree r (vs, ns) xs + | otherwise = span_tree r (vs', (x : ns') : ns) xs + where + (vs', ns') = dfs r (x : vs, []) (r x) Compilation had errors diff --git a/ghc/tests/typecheck/should_fail/Inst82_1.hs b/ghc/tests/typecheck/should_fail/Inst82_1.hs new file mode 100644 index 0000000..142c75b --- /dev/null +++ b/ghc/tests/typecheck/should_fail/Inst82_1.hs @@ -0,0 +1,5 @@ +module Inst82_1 where +import Data82 + +instance Read FooData where + readsPrec _ _ = [(FooData,"")] diff --git a/ghc/tests/typecheck/should_fail/Inst82_2.hs b/ghc/tests/typecheck/should_fail/Inst82_2.hs new file mode 100644 index 0000000..8c7dc41 --- /dev/null +++ b/ghc/tests/typecheck/should_fail/Inst82_2.hs @@ -0,0 +1,5 @@ +module Inst82_2 where +import Data82 + +instance Read FooData where + readsPrec _ _ = [(FooData,"")] diff --git a/ghc/tests/typecheck/should_fail/Makefile b/ghc/tests/typecheck/should_fail/Makefile index 882ec0f..f61c7c3 100644 --- a/ghc/tests/typecheck/should_fail/Makefile +++ b/ghc/tests/typecheck/should_fail/Makefile @@ -2,12 +2,22 @@ TOP = ../.. include $(TOP)/mk/boilerplate.mk include $(TOP)/mk/should_fail.mk -SRC_HC_OPTS += -noC +HS_SRCS = $(wildcard *.hs) + +# The -noC messes up the Data82 compilation +# SRC_HC_OPTS += -noC tcfail045_HC_OPTS = -fglasgow-exts tcfail068_HC_OPTS = -fglasgow-exts tcfail080_HC_OPTS = -fglasgow-exts +Inst82_1.o : Inst82_1.hs Data82.hi + $(HC) $(HC_OPTS) -c $< -o $@ +Inst82_2.o : Inst82_2.hs Data82.hi + $(HC) $(HC_OPTS) -c $< -o $@ +Data82.o : Data82.hs + $(HC) $(HC_OPTS) -c $< -o $@ + # mkdependHS doesn't understand OPTIONS pragmas... SRC_MKDEPENDHS_OPTS += -fglasgow-exts diff --git a/ghc/tests/typecheck/should_fail/tcfail001.stderr b/ghc/tests/typecheck/should_fail/tcfail001.stderr index 46a704b..aa1bc11 100644 --- a/ghc/tests/typecheck/should_fail/tcfail001.stderr +++ b/ghc/tests/typecheck/should_fail/tcfail001.stderr @@ -1,5 +1,5 @@ -tcfail001.hs:9: +tcfail001.hs:8: Warning: Duplicate class assertion `A a' in the context: (A a, A a) => ... diff --git a/ghc/tests/typecheck/should_fail/tcfail017.stderr b/ghc/tests/typecheck/should_fail/tcfail017.stderr index 7ab93fd..c7a3d24 100644 --- a/ghc/tests/typecheck/should_fail/tcfail017.stderr +++ b/ghc/tests/typecheck/should_fail/tcfail017.stderr @@ -1,7 +1,7 @@ -tcfail017.hs:11: +tcfail017.hs:10: Could not deduce `C [a]' - (arising from an instance declaration at tcfail017.hs:11) + (arising from an instance declaration at tcfail017.hs:10) from the context: (B a) Probable cause: missing `C [a]' in instance declaration context or missing instance declaration for `C [a]' diff --git a/ghc/tests/typecheck/should_fail/tcfail019.stderr b/ghc/tests/typecheck/should_fail/tcfail019.stderr index 00a227f..055b3e8 100644 --- a/ghc/tests/typecheck/should_fail/tcfail019.stderr +++ b/ghc/tests/typecheck/should_fail/tcfail019.stderr @@ -1,15 +1,15 @@ -tcfail019.hs:19: +tcfail019.hs:18: Could not deduce `C [a]' - (arising from an instance declaration at tcfail019.hs:19) + (arising from an instance declaration at tcfail019.hs:18) from the context: () Probable cause: missing `C [a]' in instance declaration context or missing instance declaration for `C [a]' When checking the superclasses of an instance declaration -tcfail019.hs:19: +tcfail019.hs:18: Could not deduce `B [a]' - (arising from an instance declaration at tcfail019.hs:19) + (arising from an instance declaration at tcfail019.hs:18) from the context: () Probable cause: missing `B [a]' in instance declaration context or missing instance declaration for `B [a]' diff --git a/ghc/tests/typecheck/should_fail/tcfail020.stderr b/ghc/tests/typecheck/should_fail/tcfail020.stderr index c009750..0dbc191 100644 --- a/ghc/tests/typecheck/should_fail/tcfail020.stderr +++ b/ghc/tests/typecheck/should_fail/tcfail020.stderr @@ -1,7 +1,7 @@ -tcfail020.hs:11: +tcfail020.hs:10: Could not deduce `A [a]' - (arising from an instance declaration at tcfail020.hs:11) + (arising from an instance declaration at tcfail020.hs:10) from the context: (A a) Probable cause: missing `A [a]' in instance declaration context or missing instance declaration for `A [a]' diff --git a/ghc/tests/typecheck/should_fail/tcfail023.stderr b/ghc/tests/typecheck/should_fail/tcfail023.stderr index 3e1dc47..241484f 100644 --- a/ghc/tests/typecheck/should_fail/tcfail023.stderr +++ b/ghc/tests/typecheck/should_fail/tcfail023.stderr @@ -1,7 +1,7 @@ tcfail023.hs:1: Duplicate or overlapping instance declarations - for `A B' at tcfail023.hs:11 and tcfail023.hs:14 + for `A B' at tcfail023.hs:13 and tcfail023.hs:10 tcfail023.hs:11: Couldn't match `B' against `Bool' diff --git a/ghc/tests/typecheck/should_fail/tcfail027.stderr b/ghc/tests/typecheck/should_fail/tcfail027.stderr index cc1e5b1..c1415ee 100644 --- a/ghc/tests/typecheck/should_fail/tcfail027.stderr +++ b/ghc/tests/typecheck/should_fail/tcfail027.stderr @@ -1,8 +1,8 @@ tcfail027.hs:2: Cycle in class declarations: - `B' at tcfail027.hs:8 - `A' at tcfail027.hs:5 + `A' at tcfail027.hs:4 + `B' at tcfail027.hs:7 Compilation had errors diff --git a/ghc/tests/typecheck/should_fail/tcfail028.stderr b/ghc/tests/typecheck/should_fail/tcfail028.stderr index 6393495..8856630 100644 --- a/ghc/tests/typecheck/should_fail/tcfail028.stderr +++ b/ghc/tests/typecheck/should_fail/tcfail028.stderr @@ -1,5 +1,5 @@ -tcfail028.hs:5: +tcfail028.hs:4: Couldn't match `Type t' against `k -> *' Expected kind: Type t Inferred kind: k -> * diff --git a/ghc/tests/typecheck/should_fail/tcfail030.stderr b/ghc/tests/typecheck/should_fail/tcfail030.stderr index f49ad59..040dde3 100644 --- a/ghc/tests/typecheck/should_fail/tcfail030.stderr +++ b/ghc/tests/typecheck/should_fail/tcfail030.stderr @@ -1,5 +1,5 @@ -tcfail030.hs:0: Variable not in scope: `Main.main' +tcfail030.hs:2: Variable not in scope: `Main.main' Compilation had errors diff --git a/ghc/tests/typecheck/should_fail/tcfail035.stderr b/ghc/tests/typecheck/should_fail/tcfail035.stderr index 0e090bd..894d84e 100644 --- a/ghc/tests/typecheck/should_fail/tcfail035.stderr +++ b/ghc/tests/typecheck/should_fail/tcfail035.stderr @@ -1,10 +1,10 @@ tcfail035.hs:6: - Warning: No explicit method nor default method for `fromInteger' + Warning: No explicit method nor default method for `+' in an instance declaration for `Num' tcfail035.hs:6: - Warning: No explicit method nor default method for `signum' + Warning: No explicit method nor default method for `*' in an instance declaration for `Num' tcfail035.hs:6: @@ -12,19 +12,19 @@ tcfail035.hs:6: in an instance declaration for `Num' tcfail035.hs:6: - Warning: No explicit method nor default method for `*' + Warning: No explicit method nor default method for `signum' in an instance declaration for `Num' tcfail035.hs:6: - Warning: No explicit method nor default method for `+' + Warning: No explicit method nor default method for `fromInteger' in an instance declaration for `Num' tcfail035.hs:7: - Warning: No explicit method nor default method for `fromInteger' + Warning: No explicit method nor default method for `+' in an instance declaration for `Num' tcfail035.hs:7: - Warning: No explicit method nor default method for `signum' + Warning: No explicit method nor default method for `*' in an instance declaration for `Num' tcfail035.hs:7: @@ -32,16 +32,16 @@ tcfail035.hs:7: in an instance declaration for `Num' tcfail035.hs:7: - Warning: No explicit method nor default method for `*' + Warning: No explicit method nor default method for `signum' in an instance declaration for `Num' tcfail035.hs:7: - Warning: No explicit method nor default method for `+' + Warning: No explicit method nor default method for `fromInteger' in an instance declaration for `Num' tcfail035.hs:3: Duplicate or overlapping instance declarations - for `Num NUM' at tcfail035.hs:6 and tcfail035.hs:7 + for `Num NUM' at tcfail035.hs:7 and tcfail035.hs:6 Compilation had errors diff --git a/ghc/tests/typecheck/should_fail/tcfail036.stderr b/ghc/tests/typecheck/should_fail/tcfail036.stderr index 91b23df..e6fed85 100644 --- a/ghc/tests/typecheck/should_fail/tcfail036.stderr +++ b/ghc/tests/typecheck/should_fail/tcfail036.stderr @@ -1,26 +1,26 @@ -tcfail036.hs:7: - Warning: No explicit method nor default method for `fromInteger' +tcfail036.hs:6: + Warning: No explicit method nor default method for `*' in an instance declaration for `Num' -tcfail036.hs:7: - Warning: No explicit method nor default method for `signum' +tcfail036.hs:6: + Warning: No explicit method nor default method for `abs' in an instance declaration for `Num' -tcfail036.hs:7: - Warning: No explicit method nor default method for `abs' +tcfail036.hs:6: + Warning: No explicit method nor default method for `signum' in an instance declaration for `Num' -tcfail036.hs:7: - Warning: No explicit method nor default method for `*' +tcfail036.hs:6: + Warning: No explicit method nor default method for `fromInteger' in an instance declaration for `Num' tcfail036.hs:8: - Warning: No explicit method nor default method for `fromInteger' + Warning: No explicit method nor default method for `+' in an instance declaration for `Num' tcfail036.hs:8: - Warning: No explicit method nor default method for `signum' + Warning: No explicit method nor default method for `*' in an instance declaration for `Num' tcfail036.hs:8: @@ -28,24 +28,24 @@ tcfail036.hs:8: in an instance declaration for `Num' tcfail036.hs:8: - Warning: No explicit method nor default method for `*' + Warning: No explicit method nor default method for `signum' in an instance declaration for `Num' tcfail036.hs:8: - Warning: No explicit method nor default method for `+' + Warning: No explicit method nor default method for `fromInteger' in an instance declaration for `Num' tcfail036.hs:3: Duplicate or overlapping instance declarations - for `Num NUM' at tcfail036.hs:7 and tcfail036.hs:8 + for `Num NUM' at tcfail036.hs:8 and tcfail036.hs:6 -tcfail036.hs:7: +tcfail036.hs:8: No instance for `Show NUM' - arising from an instance declaration at tcfail036.hs:7 + arising from an instance declaration at tcfail036.hs:8 -tcfail036.hs:7: +tcfail036.hs:8: No instance for `Eq NUM' - arising from an instance declaration at tcfail036.hs:7 + arising from an instance declaration at tcfail036.hs:8 tcfail036.hs:9: Class used as a type constructor: Num diff --git a/ghc/tests/typecheck/should_fail/tcfail082.hs b/ghc/tests/typecheck/should_fail/tcfail082.hs new file mode 100644 index 0000000..2d4307a --- /dev/null +++ b/ghc/tests/typecheck/should_fail/tcfail082.hs @@ -0,0 +1,9 @@ +module Main(main) where +import Data82 +import Inst82_1 +import Inst82_2 + +data Baz = Baz deriving Read + +main = print ((read "FooData")::FooData) +