Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Alex D
GHC
Commits
08c5b670
Commit
08c5b670
authored
Apr 19, 2011
by
simonpj
Browse files
Simplify treatement of pragmas slightly
parent
b801454d
Changes
1
Hide whitespace changes
Inline
Side-by-side
compiler/typecheck/TcBinds.lhs
View file @
08c5b670
...
...
@@ -25,7 +25,6 @@ import TcHsType
import TcPat
import TcMType
import TcType
import RnBinds( misplacedSigErr )
import Coercion
import TysPrim
import Id
...
...
@@ -44,7 +43,6 @@ import BasicTypes
import Outputable
import FastString
import Data.List( partition )
import Control.Monad
#include "HsVersions.h"
...
...
@@ -559,24 +557,16 @@ tcSpec _ prag = pprPanic "tcSpec" (ppr prag)
tcImpPrags :: [LSig Name] -> TcM [LTcSpecPrag]
tcImpPrags prags
= do { this_mod <- getModule
; let is_imp prag
= case sigName prag of
Nothing -> False
Just name -> not (nameIsLocalOrFrom this_mod name)
(spec_prags, others) = partition isSpecLSig $
filter is_imp prags
; mapM_ misplacedSigErr others
-- Messy that this misplaced-sig error comes here
-- but the others come from the renamer
; mapAndRecoverM (wrapLocM tcImpSpec) spec_prags }
tcImpSpec :: Sig Name -> TcM TcSpecPrag
tcImpSpec prag@(SpecSig (L _ name) _ _)
; mapAndRecoverM (wrapLocM tcImpSpec)
[L loc (name,prag) | (L loc prag@(SpecSig (L _ name) _ _)) <- prags
, not (nameIsLocalOrFrom this_mod name) ] }
tcImpSpec :: (Name, Sig Name) -> TcM TcSpecPrag
tcImpSpec (name, prag)
= do { id <- tcLookupId name
; checkTc (isAnyInlinePragma (idInlinePragma id))
(impSpecErr name)
; tcSpec id prag }
tcImpSpec p = pprPanic "tcImpSpec" (ppr p)
impSpecErr :: Name -> SDoc
impSpecErr name
...
...
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