#2130 java.lang.IllegalStateException: Register 3 V

SlimerDude Sat 6 Apr 2013

Hiya, while messing with evening callbacks via Actors I came across this natty little error:

class Register3V {
  Void receive(|Obj| func) {
    try {
      // works fine if not in try / catch or if 'return' is not used
      return func.call(this)
    } catch (Err e) { }
  }  

  static Void main(Str[] args) {
    err := Register3V()
  }
}

Gives:

java.lang.IllegalStateException: Register 3 V
  at fanx.emit.FCodeEmit.storeVar(FCodeEmit.java:569)
  at fanx.emit.FCodeEmit.storeVar(FCodeEmit.java:538)
  at fanx.emit.FCodeEmit.emitInstructions(FCodeEmit.java:89)
  at fanx.emit.FCodeEmit.emit(FCodeEmit.java:59)
  at fanx.emit.FMethodEmit.doEmit(FMethodEmit.java:400)
  at fanx.emit.FMethodEmit.emitStandard(FMethodEmit.java:66)
  at fanx.emit.FTypeEmit.emit(FTypeEmit.java:184)
  at fanx.emit.FTypeEmit.emit(FTypeEmit.java:78)
  at fanx.emit.FTypeEmit.emit(FTypeEmit.java:47)
  at fan.sys.BootEnv.loadTypeClasses(BootEnv.java:260)
  at fan.sys.Env.loadTypeClasses(Env.java:206)
  at fan.sys.ClassType.emit(ClassType.java:490)
  at fan.sys.ClassType.finish(ClassType.java:544)
  at fan.sys.Method$MethodFunc.isStatic(Method.java:475)
  at fan.sys.Method$MethodFunc.callList(Method.java:191)
  at fan.sys.Method.callList(Method.java:138)
  at fanx.tools.Fan.callMain(Fan.java:173)
  at fanx.tools.Fan.executeType(Fan.java:140)
  at fanx.tools.Fan.execute(Fan.java:41)
  at fanx.tools.Fan.run(Fan.java:298)
  at fanx.tools.Fan.main(Fan.java:336)

Running Fantom 1.0.63.

But is all runs okay if not in try / catch or if return is not used

brian Sat 6 Apr 2013

Promoted to ticket #2130 and assigned to brian

brian Mon 20 May 2013

Are you double check that snippet of code actually compiles? I get:

Cannot return a value from Void method

SlimerDude Mon 20 May 2013

Yep, just tried it again. It compiles and bombs out. Both in F4 and from the cmd line.

It is Fantom 1.0.63 though. Being one of the annoying Win64 users, I can't use Fantom 1.0.64.

brian Mon 20 May 2013

Ticket cancelled

Ok, I don't think this problem exists anymore.

Why can't you use win64? You just can't run using fan.exe, but you can use java launcher directly. I have a patch for switching to batch files, but it still needs work to figure out bootstrap builds

SlimerDude Mon 20 May 2013

I use cmd files even for Fantom 1.0.63. I switch out fan.exe with fan.cmd:

@java -cp %FAN_HOME%\lib\java\sys.jar fanx.tools.Fan %*

I can't remember the exact semantics of why didn't work for 1.0.64, it was a while ago now. But I do recall getting similar errors to the ERROR: Cannot Read Registry topic.

I may try it again, for it's all just java right!

KevinKelley Mon 20 May 2013

@slimer - Works for me; but you'll need to download the 64-bit swt.jar into a lib/java/ext/win32-x86_64 directory; same for any other ext libs you may be using -- anything that uses native code, you have to match up the correct bit-ness all the way through. 64-bit exe can't load 32-bit dll, or vice versa.

SlimerDude Mon 20 May 2013

Hmm... everything seems to just work this time round... Sweet!

While playing with Fancom I did mess around installing different 32 / 64 bit JDKs and consolidating the various java.exes they leave behind - that may have changed something.

@KevinKelly - cheers, I already have the 64 bit SWT. Gundam wouldn't work without it!

<edit>: Oh, it seems Fantom 1.0.65 already ships with it!

Login or Signup to reply.