diff --git a/compilerAst/src/prog8/ast/expressions/InferredTypes.kt b/compilerAst/src/prog8/ast/expressions/InferredTypes.kt index c55c5ef54..2fe386ac5 100644 --- a/compilerAst/src/prog8/ast/expressions/InferredTypes.kt +++ b/compilerAst/src/prog8/ast/expressions/InferredTypes.kt @@ -10,7 +10,7 @@ object InferredTypes { require(!(datatype!=null && (isUnknown || isVoid))) { "invalid combination of args" } } - val isKnown = datatype!=null + val isKnown = datatype!=null && datatype!=DataType.UNDEFINED fun typeOrElse(alternative: DataType) = if(isUnknown || isVoid) alternative else datatype!! infix fun istype(type: DataType): Boolean = if(isUnknown || isVoid) false else this.datatype==type