mirror of
https://github.com/irmen/prog8.git
synced 2024-12-24 16:29:21 +00:00
more precise
This commit is contained in:
parent
19fe58dbac
commit
7bac7bdc3e
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user