#1246 NonNullable check for dynamic invoke

go4 Sun 3 Oct 2010

class Main{
  Void say(Str s){
    echo(s)
  }

  static Void main(){
    Main()->say(null)
  }
}

It's not very safe. Could do check of Nullable on runtime.

brian Tue 5 Oct 2010

It would be extremely expensive to do null checking on parameters before a dynamic call. I think it is better to leave it the JVM to do type checking on reflection or let the NPE happen on its own.

Login or Signup to reply.