more precise

This commit is contained in:
Irmen de Jong 2021-05-01 13:39:02 +02:00
parent 19fe58dbac
commit 7bac7bdc3e

View File

@ -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