Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Scala object-nested classes in Eclipse Java
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Andrius Velykis  
View profile  
 More options Apr 29 2012, 2:32 pm
From: Andrius Velykis <andr...@velykis.lt>
Date: Sun, 29 Apr 2012 11:32:12 -0700 (PDT)
Local: Sun, Apr 29 2012 2:32 pm
Subject: Re: [scala-user] Scala object-nested classes in Eclipse Java

Hello,

On my question at StackOverflow
(http://stackoverflow.com/questions/10207149/scala-object-nested-class...)
I got a reply from Iulian Dragos that deep nesting information gets lost in
bytecode translation. Such structures should be avoided if Java interop is
important.

Posting this to wrap up the thread if someone else searches for a similar
answer here.

Thanks,
~Andrius

On Saturday, 21 April 2012 20:09:20 UTC+1, Andrius Velykis wrote:

> Hello,

> > What Scala version are you using? Also, did you try:
> > new mypackage.Outer$.Middle$.Inner();

> I am using Scala 2.9.1 (tried both Scala-IDE and command-line official
> Scala distribution) with Eclipse Indigo. The suggested approach does not
> help - I am getting the following error from Eclipse: mypackage.Outer$.Middle$
> cannot be resolved to a type.

> Note that the problem is not in the initialisation - I cannot reference
> the class. E.g. neither of the following work in Eclipse:
> mypackage.Outer$Middle$Inner inner = null;
> mypackage.Outer$.Middle$.Inner inner = null;
> mypackage.Outer.Middle$.Inner inner = null;
> mypackage.Outer.Middle.Inner inner = null;

> Thanks,
> ~Andrius Velykis

> On Friday, 20 April 2012 01:21:41 UTC+1, Grzegorz Kossakowski wrote:

>> On 19 April 2012 08:25, Andrius Velykis wrote:

>>> To use the class Inner in Java code, I use the following code:

>>> mypackage.Outer$Middle$Inner inner = new mypackage.Outer$Middle$Inner();
>>> inner.msg();

>>> However, Eclipse (Indigo) compiler complains with the following message
>>> at the first line:

>>>> The nested type mypackage.Outer$Middle$Inner cannot be referenced using
>>>> its binary name

>>> Interestingly, the Java code above works when used with NetBeans 6.9.1.

>>> Is this an issue with Eclipse compiler when using Scala classes? Or am I
>>> referencing the class incorrectly?

>> What Scala version are you using? Also, did you try:

>> new mypackage.Outer$.Middle$.Inner();

>> --
>> Grzegorz Kossakowski


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.