#2540 Edge cases and java.lang.VerifyError

SlimerDude Mon 23 May 2016

I'm able to cause a java.lang.VerifyErrors though some edgy Fantom code. It's probably not worth fixing, but I thought I'd report it for completeness:

fansh> [,].findAll |f| { false }

fansh> [,].findAll |f| { false {echo(f)} }

sys::Err: java.lang.VerifyError: 
(class: fan/sh104/FanshEval$_eval$0, method: doCall signature: (Ljava/lang/Object;)Z) 
Expecting to find object/array on stack

Note the addition of { echo(it) } is fine when returning from normal functions:

fansh> |->Obj| { "wot" {echo(it)} }()

brian Tue 24 May 2016

Ticket promoted to #2540 and assigned to brian

brian Wed 4 Oct 2017

Ticket resolved in 1.0.70

The fundamental issue looks to be using a Obj.with it-block on a value type. I added a check to disallow that since it doesn't ever really make sense.

Login or Signup to reply.