Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Tobias Decking
GHC
Commits
fa13c136
Commit
fa13c136
authored
Mar 16, 2017
by
Richard Eisenberg
Browse files
Fix #13202 by failing more eagerly in tcRnStmt
test cases: ghci/scripts/T13202{,a}
parent
dca44adb
Changes
6
Hide whitespace changes
Inline
Side-by-side
compiler/typecheck/TcRnDriver.hs
View file @
fa13c136
...
...
@@ -1877,6 +1877,9 @@ tcRnStmt hsc_env rdr_stmt
zonked_expr
<-
zonkTopLExpr
tc_expr
;
zonked_ids
<-
zonkTopBndrs
bound_ids
;
failIfErrsM
;
-- we can't do the next step if there are levity polymorphism errors
-- test case: ghci/scripts/T13202{,a}
-- None of the Ids should be of unboxed type, because we
-- cast them all to HValues in the end!
mapM_
bad_unboxed
(
filter
(
isUnliftedType
.
idType
)
zonked_ids
)
;
...
...
testsuite/tests/ghci/scripts/T13202.script
0 → 100644
View file @
fa13c136
import GHC.Exts
:set -XTypeApplications -XMagicHash -XTypeInType
data TypeRep (a :: k) = TypeRep
let typeRepKind = undefined :: TypeRep (a :: k) -> TypeRep k
let typeRep = undefined :: TypeRep (a :: k)
let x = typeRepKind (typeRep @(Maybe Int#))
testsuite/tests/ghci/scripts/T13202.stderr
0 → 100644
View file @
fa13c136
<interactive>:6:22: error:
• Cannot apply expression of type ‘TypeRep a0’
to a visible type argument ‘(Maybe Int#)’
• In the first argument of ‘typeRepKind’, namely
‘(typeRep @(Maybe Int#))’
In the expression: typeRepKind (typeRep @(Maybe Int#))
In an equation for ‘x’: x = typeRepKind (typeRep @(Maybe Int#))
testsuite/tests/ghci/scripts/T13202a.script
0 → 100644
View file @
fa13c136
import GHC.Records
:set -XTypeApplications -XDataKinds
let foo = getField @"name"
testsuite/tests/ghci/scripts/T13202a.stderr
0 → 100644
View file @
fa13c136
<interactive>:3:5: error:
• Non type-variable argument in the constraint: HasField "name" r a
(Use FlexibleContexts to permit this)
• When checking the inferred type
foo :: forall r a. HasField "name" r a => r -> a
testsuite/tests/ghci/scripts/all.T
View file @
fa13c136
...
...
@@ -248,3 +248,5 @@ test('T12447', expect_broken(12447), ghci_script, ['T12447.script'])
test
('
T10249
',
normal
,
ghci_script
,
['
T10249.script
'])
test
('
T12550
',
normal
,
ghci_script
,
['
T12550.script
'])
test
('
StaticPtr
',
normal
,
ghci_script
,
['
StaticPtr.script
'])
test
('
T13202
',
normal
,
ghci_script
,
['
T13202.script
'])
test
('
T13202a
',
normal
,
ghci_script
,
['
T13202a.script
'])
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment