Skip to content

Commit

Permalink
unify: guard error terms
Browse files Browse the repository at this point in the history
  • Loading branch information
ice1000 committed Jan 6, 2023
1 parent 0a999f8 commit e20b911
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions base/src/main/java/org/aya/tyck/unify/Unifier.java
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,8 @@ public Unifier(
reporter, false, false, traceBuilder, state, pos, ctx.deriveMap()), lr, rl);
// Check the expected type.
var needUnify = true;
switch (meta.info) {
if (preRhs instanceof ErrorTerm) needUnify = false;
else switch (meta.info) {
case MetaInfo.AnyType()when preRhs instanceof Formation -> needUnify = false;
case MetaInfo.AnyType()when preRhs instanceof MetaTerm rhsMeta -> {
if (!rhsMeta.ref().info.isType(checker.synthesizer())) {
Expand Down Expand Up @@ -141,7 +142,7 @@ public Unifier(
}
}
}
if (!needUnify) providedType = SortTerm.Type0;
if (!needUnify && providedType == null) providedType = SortTerm.Type0;
// Pattern unification: buildSubst(lhs.args.invert(), meta.telescope)
var subst = DeltaExpander.buildSubst(meta.contextTele, lhs.contextArgs());
var overlap = invertSpine(subst, lhs, meta);
Expand Down

0 comments on commit e20b911

Please sign in to comment.