@@ -487,15 +487,12 @@ inferBinder val (NamedBinder name binder) = do
487487 return $ M.insert name val m
488488inferBinder val (PositionedBinder pos _ binder) =
489489 warnAndRethrowWithPositionTC pos $ inferBinder val binder
490−-- TODO: When adding support for polymorphic types, check subsumption here,
491−-- change the definition of `binderRequiresMonotype`,
492−-- and use `kindOfWithScopedVars`.
493490inferBinder val (TypedBinder ty binder) = do
494491 kind <- kindOf ty
495492 checkTypeKind ty kind
496− ty1 <- replaceAllTypeSynonyms <=< replaceTypeWildcards $ ty
493+ ty1 <- introduceSkolemScope <=< replaceAllTypeSynonyms <=< replaceTypeWildcards $ ty
497494 unifyTypes val ty1
498− inferBinder val binder
495+ inferBinder ty1 binder
499496inferBinder _ OpBinder{} =
500497 internalError "OpBinder should have been desugared before inferBinder"
501498inferBinder _ BinaryNoParensBinder{} =
@@ -510,6 +507,7 @@ binderRequiresMonotype NullBinder = False
510507binderRequiresMonotype (VarBinder _) = False
511508binderRequiresMonotype (NamedBinder _ b) = binderRequiresMonotype b
512509binderRequiresMonotype (PositionedBinder _ _ b) = binderRequiresMonotype b
510+binderRequiresMonotype (TypedBinder ty b) = isMonoType ty || binderRequiresMonotype b
513511binderRequiresMonotype _ = True
514512
515513-- | Instantiate polytypes only when necessitated by a binder.