Skip to content

Commit

Permalink
compiler: fix #47
Browse files Browse the repository at this point in the history
  • Loading branch information
Zilin Chen authored and Zilin Chen committed Mar 6, 2018
1 parent e9d6d9d commit 25e068a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion cogent/src/Cogent/PrettyPrint.hs
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ instance (Pretty t, TypeType t) => Pretty (Type t) where
typename n <+> hsep (map prettyT' as)
where prettyT' e | not $ isAtomic e = parens (pretty e)
| otherwise = pretty e
pretty (TVar n b) = typevar n
pretty (TVar n b) = typevar n <> (if b then typesymbol "!" else empty)
pretty (TTuple ts) = tupled (map pretty ts)
pretty (TUnit) = typesymbol "()" & (if __cogent_fdisambiguate_pp then (<+> comment "{- unit -}") else id)
pretty (TRecord ts s)
Expand Down
6 changes: 4 additions & 2 deletions cogent/src/Cogent/TypeCheck/Solver.hs
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,10 @@ rule Unsat {} = return Nothing
rule SemiSat {} = return Nothing
rule Sat {} = return Nothing

rule (Share (T TVar {}) _) = return Nothing
rule (Drop (T TVar {}) _) = return Nothing
rule (Share (T (TVar _ s)) _) | s = return $ Just Sat
| otherwise = return $ Nothing
rule (Drop (T (TVar _ s)) _) | s = return $ Just Sat
| otherwise = return $ Nothing
rule (Escape (T TVar {}) _) = return Nothing

rule (Share (T (TTuple xs)) m) = return . Just . mconcat $ map (flip Share m) xs
Expand Down
2 changes: 1 addition & 1 deletion cogent/tests/pass_unknown-underscore-type.cogent
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ check_dirent_empty #{obj = new_dirent, acc = maybe_prev_dirent} =
| Some prev_dirent ->
let ex = destroy_Ext2DirEnt prev_dirent
in check_dirent_empty2 (new_dirent, offset)
| None _ ->
| None ->
check_dirent_empty2 (new_dirent, offset)


Expand Down

0 comments on commit 25e068a

Please sign in to comment.