summaryrefslogtreecommitdiff
path: root/source/Checking/Exact/Global.hs
diff options
context:
space:
mode:
Diffstat (limited to 'source/Checking/Exact/Global.hs')
-rw-r--r--source/Checking/Exact/Global.hs10
1 files changed, 7 insertions, 3 deletions
diff --git a/source/Checking/Exact/Global.hs b/source/Checking/Exact/Global.hs
index 848b600..094255e 100644
--- a/source/Checking/Exact/Global.hs
+++ b/source/Checking/Exact/Global.hs
@@ -33,6 +33,7 @@ data ExactGlobalResolutionError
= ExactGlobalNotVisible !Internal.Symbol
| ExactGlobalAmbiguous !Internal.Symbol
| ExactGlobalUnsupported !Internal.Symbol
+ | ExactGlobalContextualUnsupported !Internal.Symbol
| ExactGlobalContentInvalid !CoreCheckError
deriving stock (Show, Eq)
@@ -71,7 +72,7 @@ resolveExactSourceGlobals symbols =
throwError (ExactGlobalNotVisible symbol)
[match] -> do
(source, sourceTypes) <-
- liftEither (prepareSourceGlobal match)
+ liftEither (prepareSourceGlobal symbol match)
pure
( Map.insert symbol source resolved
, Map.union sourceTypes types
@@ -80,14 +81,15 @@ resolveExactSourceGlobals symbols =
throwError (ExactGlobalAmbiguous symbol)
prepareSourceGlobal
- :: ( SemanticGlobalTarget
+ :: Internal.Symbol
+ -> ( SemanticGlobalTarget
, ObjectContent
, Map.Map ObjectId CoreType
)
-> Either
ExactGlobalResolutionError
(Typed.SourceGlobal ObjectId, Map.Map ObjectId CoreType)
-prepareSourceGlobal (target, content, dependencies) = do
+prepareSourceGlobal symbol (target, content, dependencies) = do
body <-
case target of
GlobalReference _identity ->
@@ -103,6 +105,8 @@ prepareSourceGlobal (target, content, dependencies) = do
_ ->
impossible
"validated transparent expansion has opaque content"
+ ContextualTransparentExpansion _identity _requirements ->
+ Left (ExactGlobalContextualUnsupported symbol)
let identity = semanticGlobalTargetObject target
types =
Map.insert