Skip to content

Commit c219d45

Browse files
committed
Add module name to constraint dict var names
1 parent 9c138ac commit c219d45

File tree

1 file changed

+2
-2
lines changed
  • src/Language/PureScript/TypeChecker

1 file changed

+2
-2
lines changed

src/Language/PureScript/TypeChecker/Types.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -440,9 +440,9 @@ check' val (ForAll ident ty _) = do
440440
val' <- check skVal sk
441441
return $ TypedValue True val' (ForAll ident ty (Just scope))
442442
check' val t@(ConstrainedType constraints ty) = do
443-
dictNames <- forM constraints $ \(Qualified _ (ProperName className), _) -> do
443+
dictNames <- forM constraints $ \(Qualified mn' (ProperName className), _) -> do
444444
n <- liftCheck freshDictionaryName
445-
return $ Ident $ "__dict_" ++ className ++ "_" ++ show n
445+
return $ Ident $ "__dict_" ++ (maybe "" ((++ ".") . runModuleName) mn') ++ className ++ "_" ++ show n
446446
val' <- withBindingGroupVisible $ withTypeClassDictionaries (zipWith (\name (className, instanceTy) ->
447447
TypeClassDictionaryInScope name className instanceTy Nothing TCDRegular False) (map (Qualified Nothing) dictNames)
448448
constraints) $ check val ty

0 commit comments

Comments
 (0)