Nested interfaces broken

Skip to first unread message

Brendan Ribera

Jan 20, 2011, 4:12:29 PM1/20/11
I'm trying to implement a nested interface from the Android codebase. There are several, but GpsStatus.Listener ( will do for this example.

Here's an example class:

import android.util.Log
import android.location.GpsStatus
class Example
  implements GpsStatus.Listener
  def onGpsStatusChanged(event:int)
    Log.v("test", "event: " + event)

This fails to compile:
    [javac] Compiling 2 source files to /home/brendan/code/git/trunk/droid/urbandroid/bin/classes
     [exec] Inference Error:
     [exec] ./com/urbanspoon/Example.mirah:7: undefined method `declared_intrinsics' for nil:NilClass
     [exec]   def onGpsStatusChanged(event:int)
     [exec] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     [exec]     Log.v("test", "event: " + event)
     [exec] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     [exec]   end
     [exec] ^^^^^
     [exec] Result: 1

I see the same behavior with a similar Listener interface declared inside a class in the Java portion of our codebase. Interfaces that aren't nested work just fine. Anyone know why, or have a workaround?


Brendan Ribera

Jan 20, 2011, 4:42:44 PM1/20/11
I can make it work with by doing this:

import android.location.GpsStatus.Listener
  implements Listener

This breaks in 0.0.5:
     [exec] Inference Error:
     [exec] ./com/urbanspoon/NearbyActivity.mirah:10: Class 'android.location.GpsStatus.Listener' not found.

It'd be nice if one didn't have to bring interfaces with generic names like 'Listener' into the current namespace in order to implement them (what if I want to implement multiple Listeners?), but I think I can move on with what I'm trying to do now :)

Reply all
Reply to author
0 new messages