mirror of
https://github.com/irmen/prog8.git
synced 2024-11-26 11:49:22 +00:00
compiler error for missing return value
This commit is contained in:
parent
506ac8014c
commit
a0ec37b35b
@ -879,6 +879,10 @@ internal class AstChecker(private val program: Program,
|
||||
override fun visit(typecast: TypecastExpression) {
|
||||
if(typecast.type in IterableDatatypes)
|
||||
errors.err("cannot type cast to string or array type", typecast.position)
|
||||
|
||||
if(!typecast.expression.inferType(program).isKnown)
|
||||
errors.err("this expression doesn't return a value", typecast.expression.position)
|
||||
|
||||
super.visit(typecast)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user