Some typing issues

2 views
Skip to first unread message

Michal Hantl

unread,
Oct 25, 2010, 7:19:34 AM10/25/10
to mi...@googlegroups.com
This is simplified version of what I was doing this morning:

  def testy; returns String
    if true
      orders = ArrayList.new()
      null
    else
      orders = Order.all.run()
      null
    end
    orders.each { |o| 
      print_order Order(o).id
    }
  end


The exception is not very helpful for someone who doesn't have much experience with Java like myself. Also it doesn't contain any clues about where the error is (what line).

java.lang.VerifyError: (class: controllers/AdminOffersController, method: testy signature: ()Ljava/lang/String;) Incompatible object argument for function call

java.lang.VerifyError: (class: controllers/AdminOffersController, method: testy signature: ()Ljava/lang/String;) Incompatible object argument for function call
	at controllers.AdminController.offers(admin_controller.duby:20)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at com.google.appengine.tools.development.agent.runtime.Runtime.invoke(Runtime.java:100)
	at dubious.Controller.execute(controller.duby:100)

I realize i'm being just a Java newb here, but I hope we can get a lot of new folks switch to mirah on appengine from say.. PHP land :) and stuff like this is going to be a major suckup for them. 

Also I'm struggling whole morning with this simple problem (I wasn't able to find the problem for a long time).


--
S pozdravem, Regards
Michal Hantl

gtalk/jabber: mic...@hantl.cz
icq: 241813215

Rib Rdb

unread,
Oct 25, 2010, 12:00:51 PM10/25/10
to mi...@googlegroups.com
Any time you get a java.lang.VerifyError you've found a bug in mirah. Unfortunately as you found the JVM isn't very helpful in explaining what that bug is.
If you set the environment variable BS_CHECK_CLASSES=true and recompile the file you should hopefully get a better description of the problem.  Or if you compile to a .java file and compile it with javac, you might get a better message (but only if the .java backend has the same bug).

v6ak

unread,
Oct 26, 2010, 1:56:20 AM10/26/10
to The Mirah Programming Language
Although JVM is not very helpful, there are some better tools that can
perform static bytecode analysis. I've good experience with the tool
that comes with ASM bytecode library. I've debugged many problems with
it :)
I think I've used this tool: http://asm.ow2.org/doc/faq.html#Q4 .
Vít Šesták AKA v6ak

On Oct 25, 6:00 pm, Rib Rdb <rib...@gmail.com> wrote:
> Any time you get a java.lang.VerifyError you've found a bug in mirah.
> Unfortunately as you found the JVM isn't very helpful in explaining what
> that bug is.
> If you set the environment variable BS_CHECK_CLASSES=true and recompile the
> file you should hopefully get a better description of the problem.  Or if
> you compile to a .java file and compile it with javac, you might get a
> better message (but only if the .java backend has the same bug).
>

Michal Hantl

unread,
Oct 26, 2010, 2:07:17 AM10/26/10
to mi...@googlegroups.com
I was trying to point out there are some cases when a regular folks like me have problem with Mirah.

We need to make the language easier to learn and better error messages is IMO where we can improve.

Rib Rdb

unread,
Oct 26, 2010, 11:09:11 AM10/26/10
to mi...@googlegroups.com
Yes i definitely agree.  If you find bad error messages, please file a bug for them.  I was just suggesting ways to try and debug it yourself before we get mirah fixed.

Michal Hantl

unread,
Oct 26, 2010, 11:13:19 AM10/26/10
to mi...@googlegroups.com
Should I file this one then? 
Will the description I provided here be sufficient for filing an issue?

Rib Rdb

unread,
Oct 26, 2010, 11:36:56 AM10/26/10
to mi...@googlegroups.com

Sure, if you file an issue it will help make sure we don't forget about this. The description here is perfect.

Reply all
Reply to author
Forward
0 new messages