[BLUEJ-213] can't call a subclass's methods as expressions, from CodePad
Okay, this is bizarre:
{noformat} public class Lala { public String toString() { return "haha"; } public String foo() { return "mama"; } } public class Nana extends Lala { int bar() { return 99; } } {noformat}
From CodePad, I can't call any of a Nana's inherited methods as an expression; it gives the ol' "missing semicolon" error. However I can call them as statements, and I can call them fine from the parent class Nana. Here's a cut-n-paste from CodePad:
{noformat} (new Lala()).toString() "haha" (String) (new Lala()).foo() "mama" (String) (new Nana()).toString() Error: ';' expected (new Nana()).foo() Error: ';' expected (new Nana()).bar() 99 (int) String s = (new Nana()).foo(); s "mama" (String) s = (new Nana()).toString(); s "haha" (String) {noformat}
===========
It gets a bit weirder: repeating this for the bug report, I was getting inconsistent results; sometimes (new Nana()).bar() would fail, and sometimes (new Lala()).foo() would fail [when called as expressions; I think they always worked as statements|always].
I don't know, but perhaps it is a related to this error, that I get upon starting 3.0.0-preview:
{noformat} 2010-03-24 22:21:57.001 java[7380:903] Error loading /Library/ScriptingAdditions/Adobe Unit Types.osax/Contents/MacOS/Adobe Unit Types: dlopen(/Library/ScriptingAdditions/Adobe Unit Types.osax/Contents/MacOS/Adobe Unit Types, 262): no suitable image found. Did find: /Library/ScriptingAdditions/Adobe Unit Types.osax/Contents/MacOS/Adobe Unit Types: no matching architecture in universal wrapper java: OpenScripting.framework - scripting addition "/Library/ScriptingAdditions/Adobe Unit Types.osax" declares no loadable handlers. {noformat}
Issue metadata
- Issue type: Bug
- Priority: High
- Fix versions: 3.0.0