Merge pull request #196 from max/no-type

Make `Expr.getType()` robust against incomplete `type_of` table.
This commit is contained in:
Sauyon Lee
2019-12-05 14:31:48 -08:00
committed by GitHub Enterprise

View File

@@ -102,7 +102,12 @@ class Expr extends @expr, ExprParent {
predicate isPlatformIndependentConstant() { none() }
/** Gets the type of this expression. */
Type getType() { type_of(this, result) }
Type getType() {
type_of(this, result)
or
not type_of(this, _) and
result instanceof InvalidType
}
/**
* Gets the global value number of this expression.