Why can () be converted to number?

18 views
Skip to first unread message

chrisichris

unread,
Oct 28, 2014, 2:55:58 PM10/28/14
to yeti...@googlegroups.com
Shouldn't the compiler complain when () is casted using 'as' to a number?

java -jar yeti.jar -e "(() as number) + 1"
java.lang.NullPointerException
        at code.apply(<>:1)
        at yeti.lang.compiler.eval._1(eval.yeti:98)
        at yeti.lang.compiler.eval.execClass(eval.yeti:76)
        at yeti.lang.compiler.eval$evaluateYetiCode$._0(eval.yeti:484)
        at yeti.lang.compiler.eval$evaluateYetiCode$.apply(eval.yeti:460)
        at yeti.lang.Fun2_.apply(Unknown Source)
        at yeti.lang.compiler.yeti.main(yeti.yeti:198)
Reply all
Reply to author
Forward
0 new messages