Skip to content

Commit 05a3fbd

Browse files
committed
More from Claude Code.
1 parent 8afa926 commit 05a3fbd

2 files changed

Lines changed: 8 additions & 6 deletions

File tree

src/MicroHs/TypeCheck.hs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -335,9 +335,10 @@ mkTCState mdlName globs mdls =
335335
mergeDefaults :: Defaults -> Defaults -> Defaults
336336
mergeDefaults ds = foldr (uncurry $ M.insertWith mrg) ds . M.toList
337337
where mrg :: [EType] -> [EType] -> [EType]
338-
mrg ts ts' | not (any (\ t -> not (elemBy eqEType t ts)) ts') = ts
339-
| not (any (\ t -> not (elemBy eqEType t ts')) ts) = ts'
340-
| otherwise = []
338+
mrg ts ts' | all (\ t -> elemBy eqEType t ts) ts' = ts
339+
| any (\ t -> elemBy eqEType t ts') ts = ts'
340+
| otherwise = [] -- If neither module's default subsumes the other
341+
-- then use empty defaults, as per spec.
341342

342343
mergeInstInfo :: InstInfo -> InstInfo -> InstInfo
343344
mergeInstInfo (InstInfo m1 l1 fds) (InstInfo m2 l2 _) =
@@ -3499,7 +3500,7 @@ getSuperClasses ais = do
34993500
case M.lookup i ct of
35003501
Nothing -> error $ "getSuperClasses: " ++ show i
35013502
Just (ClassInfo _ supers _ _ _) ->
3502-
loop done (concatMap flatten supers ++ is)
3503+
loop (i:done) (concatMap flatten supers ++ is)
35033504
flatten a =
35043505
case getApp a of
35053506
(c, ts) ->

src/runtime/eval.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3632,7 +3632,7 @@ parse(BFILE *f)
36323632
if (!gobble(f, '"'))
36333633
ERR("parse !");
36343634
r = alloc_node(T_TICK);
3635-
SETVALUE(r, (value_t)add_tick_table(parse_string(f)););
3635+
SETVALUE(r, (value_t)add_tick_table(parse_string(f)));
36363636
PUSH(r);
36373637
break;
36383638
#endif
@@ -3977,6 +3977,7 @@ case T_DBL: putb('&', f); putdblb(GETDBLVALUE(n), f); break;
39773977
} else {
39783978
ERR("cannot serialize ThreadId yet");
39793979
}
3980+
break;
39803981
case T_FORPTR:
39813982
if (n == comb_stdin)
39823983
putsb("IO.stdin", f);
@@ -6029,7 +6030,7 @@ evali(NODEPTR an)
60296030
case T_SUBR64:SUB_OVERFLOW(int64_t, r64u, y64u, x64u); break;
60306031
case T_QUOT64:if (y64u == 0)
60316032
raise_rts(exn_dividebyzero);
6032-
else if ((int64_t)xu == INT64_MIN && (int64_t)yu == -1)
6033+
else if ((int64_t)x64u == INT64_MIN && (int64_t)y64u == -1)
60336034
raise_rts(exn_overflow);
60346035
else
60356036
r64u = (uint64_t)((int64_t)x64u / (int64_t)y64u);

0 commit comments

Comments
 (0)