Skip to content

Commit 8afd9b3

Browse files
committed
Change check logic to address reviewer's comments
1 parent baade1c commit 8afd9b3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

compiler/src/dotty/tools/dotc/ast/Trees.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,9 @@ object Trees {
112112
* type. (Overridden by empty trees)
113113
*/
114114
def withType(tpe: Type)(implicit ctx: Context): ThisTree[Type] = {
115-
if (Config.checkUnreportedErrors)
116-
if (tpe.isInstanceOf[ErrorType]) assert(ctx.reporter.errorsReported)
117-
if (Config.checkTreesConsistent)
115+
if (tpe.isInstanceOf[ErrorType])
116+
assert(!Config.checkUnreportedErrors || ctx.reporter.errorsReported)
117+
else if (Config.checkTreesConsistent)
118118
checkChildrenTyped(productIterator)
119119
withTypeUnchecked(tpe)
120120
}

0 commit comments

Comments
 (0)