Skip to content
Snippets Groups Projects
Commit 140a000d authored by Artin Ghasivand's avatar Artin Ghasivand
Browse files

Fix the tcI case where there are left over arguments

parent a01e04cd
No related branches found
No related tags found
No related merge requests found
Pipeline #108204 passed
......@@ -136,13 +136,15 @@ tcHeadExpr gamma (HVar var)
Left err | isNamedWC var -> tauToSigma . metaTyVarT <$>
newMetaVarOfKindType
| otherwise -> throwError err
-- | Rule: Head-Ann
tcHeadExpr gamma (HAnn expr ttype) = do
(_,sigma) <- tcInfer (tcType gamma ttype)
tcArg gamma expr sigma
pure sigma
-- | Rule: Head-Con and Head-PatSyn
-- | Rule: Head-Con
-- | Rule: Head-PatSyn
tcHeadExpr gamma (HConLike kp) = do
res <- lookupGammaTc gamma (GKP kp)
pure (case res of
......
......@@ -188,9 +188,11 @@ tcI _ (RhoSg rhor) leftovers
pure (emptySubst, [], [], rhor)
| otherwise
= pprPanic "tcI - shouldn't be here" $
vsep [pprArgs leftovers
,pretty "rhor:" <+> pprRho rhor]
= throwError (ExpectedLessArguments $
vsep [pretty "Expected no more arguments:"
,indent 2 $
vsep [pretty "Instantiated type of application head:" <+> pprRho rhor
,pretty "Left over arguments:" <+> pprArgs leftovers]])
-- TODO: Rename this note
{- Note [I-VarD and IVar-M]
......
constFail = const True "blah" 'c'
[ExpectedLessArguments]
Expected no more arguments:
Instantiated type of application head: Bool
Left over arguments: [VisArg (TLit LitChar)]
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment