Skip to content

Commit 5a1255f

Browse files
authored
Merge pull request #417 from vekatze/add-stage-checks
fix: add missing stage checks
2 parents 9a6e7a8 + f50a168 commit 5a1255f

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/Kernel/Parse/Internal/Discern.hs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -912,15 +912,18 @@ discernMagic h m magic =
912912
typeExpr2' <- discernType h typeExpr2
913913
return $ M.WeakMagic $ M.EqType coreModuleID typeExpr1' typeExpr2'
914914
RT.ShowType _ (_, (typeExpr, _)) -> do
915+
ensureCompileStage m h "inline magic (`show-type`)"
915916
stringType <- liftEither (locatorToTypeVar m coreString) >>= discernType h
916917
typeExpr' <- discernType h typeExpr
917918
return $ M.WeakMagic $ M.ShowType stringType typeExpr'
918919
RT.StringCons _ (_, (rune, _)) (_, (text, _)) -> do
920+
ensureCompileStage m h "inline magic (`string-cons`)"
919921
stringType <- liftEither (locatorToTypeVar m coreString) >>= discernType h
920922
rune' <- discern h rune
921923
text' <- discern h text
922924
return $ M.WeakMagic $ M.StringCons stringType rune' text'
923925
RT.StringUncons _ (_, (text, _)) -> do
926+
ensureCompileStage m h "inline magic (`string-uncons`)"
924927
moduleID <- Alias.resolveModuleAlias (H.aliasHandle h) m coreModuleAlias
925928
text' <- discern h text
926929
return $ M.WeakMagic $ M.StringUncons moduleID text'
@@ -1366,7 +1369,8 @@ discernPattern h layer stage (m, pat) = do
13661369
return ((m, PAT.Literal (LI.Int i)), [])
13671370
InvalidNumericLiteral numericClass ->
13681371
raiseInvalidNumericLiteral m numericClass x
1369-
_ | isConsName x && k == VK.Normal -> do
1372+
_
1373+
| isConsName x && k == VK.Normal -> do
13701374
(consDD, dataArgNum, consArgNum, disc, isConstLike, _) <- resolveConstructor h m $ Var x
13711375
unless isConstLike $ do
13721376
let mainModule = Env.getMainModule (H.envHandle h)

0 commit comments

Comments
 (0)