#2662 Default Param Error

go4 Sun 3 Dec 2017

The case of complex default param:

static Int defParam(Int a, Int s := p, Int p := 1) { s }
echo(defParam(0))

java.lang.VerifyError: (class: fan/testlib/DefParamTest, method: defParam signature: (J)J) Accessing value from uninitialized register pair


static Int defParam(Int a, Int s := a > 0 ? 2:3) { s }
echo(defParam(0))

java.lang.ArrayIndexOutOfBoundsException: 23 at fanx.emit.FCodeEmit.backpatch(FCodeEmit.java:155)

brian Sun 3 Dec 2017

Ticket promoted to #2662 and assigned to brian

Login or Signup to reply.