Commit eb0ed403 authored by Edward Z. Yang's avatar Edward Z. Yang

RnSplice's staging test should be applied for quotes in stage1.

Signed-off-by: default avatarEdward Z. Yang <ezyang@cs.stanford.edu>

Test Plan: validate

Reviewers: simonpj, austin

Subscribers: bgamari, thomie

Differential Revision: https://phabricator.haskell.org/D878

GHC Trac Issues: #10382
parent 21c72e7d
......@@ -35,11 +35,14 @@ import Control.Monad ( unless, when )
import {-# SOURCE #-} RnExpr ( rnLExpr )
import PrelNames ( isUnboundName )
import TcEnv ( checkWellStaged )
import DsMeta ( liftName )
#ifdef GHCI
import ErrUtils ( dumpIfSet_dyn_printer )
import DsMeta ( decsQTyConName, expQTyConName, patQTyConName, typeQTyConName, liftName )
import PrelNames ( isUnboundName )
import TcEnv ( checkWellStaged, tcMetaTy )
import DsMeta ( decsQTyConName, expQTyConName, patQTyConName, typeQTyConName, )
import TcEnv ( tcMetaTy )
import Hooks
import Var ( Id )
import DsMeta ( quoteExpName, quotePatName, quoteDecName, quoteTypeName )
......@@ -565,13 +568,6 @@ illegalUntypedSplice = ptext (sLit "Untyped splices may not appear in typed brac
#endif
checkThLocalName :: Name -> RnM ()
#ifndef GHCI /* GHCI and TH is off */
--------------------------------------
-- Check for cross-stage lifting
checkThLocalName _name
= return ()
#else /* GHCI and TH is on */
checkThLocalName name
| isUnboundName name -- Do not report two errors for
= return () -- $(not_in_scope args)
......@@ -637,7 +633,6 @@ check_cross_stage_lifting top_lvl name ps_var
-- Update the pending splices
; ps <- readMutVar ps_var
; writeMutVar ps_var (pend_splice : ps) }
#endif /* GHCI */
{-
Note [Keeping things alive for Template Haskell]
......
module TH_localname where
x = \y -> [| y |]
TH_localname.hs:3:11: error:
No instance for (Lift t0) arising from a use of ‘lift’
The type variable ‘t0’ is ambiguous
Relevant bindings include
y :: t0 (bound at TH_localname.hs:3:6)
x :: t0 -> ExpQ (bound at TH_localname.hs:3:1)
Note: there are several potential instances:
instance (Lift a, Lift b) => Lift (Either a b)
-- Defined in ‘Language.Haskell.TH.Syntax’
instance Lift a => Lift (Maybe a)
-- Defined in ‘Language.Haskell.TH.Syntax’
instance Lift Int16 -- Defined in ‘Language.Haskell.TH.Syntax’
...plus 24 others
In the expression: lift y
In the expression:
[| y |]
pending(rn) [<y, lift y>]
In the expression:
\ y
-> [| y |]
pending(rn) [<y, lift y>]
......@@ -27,3 +27,4 @@ test('TH_reifyType2', normal, compile, [''])
test('TH_repE1', normal, compile, [''])
test('TH_repE3', normal, compile, [''])
test('TH_abstractFamily', normal, compile_fail, [''])
test('TH_localname', normal, compile_fail, [''])
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment