Problem with package objects in Eclipse

View: New views
12 Messages — Rating Filter:   Alert me  

Problem with package objects in Eclipse

by Nils Kilden-Pedersen :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I'm running the latest 2.8 trunk build in Eclipse and using a package object that defines a type Decimal like this:

type Decimal = scala.BigDecimal

This has been added to an existing Scala project that used BigDecimal. However when I change the BigDecimal references in the same package to Decimal I get compile errors: type not found: Decimal

Unfortunately I cannot reproduce this in a new project. It seems to work in anything but my old project.

I've tried cleaning, I've tried manually deleting everything in bin. I've checked that JDT weaving in enabled. Not sure why my old project behaves differently than a new project with regards to types defined in a package object.

Re: Problem with package objects in Eclipse

by Paul Phillips-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Mon, Nov 09, 2009 at 09:14:49AM -0600, Nils Kilden-Pedersen wrote:
> I'm running the latest 2.8 trunk build in Eclipse and using a package
> object that defines a type Decimal like this:
>
> type Decimal = scala.BigDecimal
>
> This has been added to an existing Scala project that used BigDecimal.
> However when I change the BigDecimal references in the same package to
> Decimal I get compile errors: type not found: Decimal

You know there's no scala.BigDecimal class anymore, yes? You didn't
mention it so I'm guessing you don't.  Not sure what you're seeing but
that seems like a pretty plausible contributing issue.

--
Paul Phillips      | Giving every man a vote has no more made men wise
Analgesic          | and free than Christianity has made them good.
Empiricist         |     -- H. L. Mencken
pal, i pill push   |----------* http://www.improving.org/paulp/ *----------

Re: Problem with package objects in Eclipse

by Nils Kilden-Pedersen :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Mon, Nov 9, 2009 at 9:20 AM, Paul Phillips <paulp@...> wrote:

You know there's no scala.BigDecimal class anymore, yes? You didn't
mention it so I'm guessing you don't.  Not sure what you're seeing but
that seems like a pretty plausible contributing issue.

Whaaat??!?

Hmm, no I didn't know that :-)

Where did it go, and why didn't I get the memo?

Re: Problem with package objects in Eclipse

by Nils Kilden-Pedersen :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Mon, Nov 9, 2009 at 9:44 AM, Nils Kilden-Pedersen <nilskp@...> wrote:
On Mon, Nov 9, 2009 at 9:20 AM, Paul Phillips <paulp@...> wrote:

You know there's no scala.BigDecimal class anymore, yes? You didn't
mention it so I'm guessing you don't.  Not sure what you're seeing but
that seems like a pretty plausible contributing issue.

Whaaat??!?

Hmm, no I didn't know that :-)

Where did it go, and why didn't I get the memo?

And why do I get no error in the package object?

Re: Problem with package objects in Eclipse

by Nils Kilden-Pedersen :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Mon, Nov 9, 2009 at 9:20 AM, Paul Phillips <paulp@...> wrote:
You know there's no scala.BigDecimal class anymore, yes?

Paul, you've got me confused. I got around to checking the Scala lib, and behold it still has BigDecimal. From source:

// $Id: BigDecimal.scala 19398 2009-11-04 18:25:19Z rytz $

package scala

Re: Problem with package objects in Eclipse

by Paul Phillips-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Mon, Nov 09, 2009 at 10:40:30AM -0600, Nils Kilden-Pedersen wrote:
> Paul, you've got me confused. I got around to checking the Scala lib,
> and behold it still has BigDecimal. From source:

Check harder.  (And I didn't say it doesn't have BigDecimal, I said it
doesn't have scala.BigDecimal.)

--
Paul Phillips      | Christ died for our sins.  Dare we make his martyrdom
In Theory          | meaningless by not committing them?
Empiricist         |     -- Jules Feiffer
i pull his palp!   |----------* http://www.improving.org/paulp/ *----------

Re: Problem with package objects in Eclipse

by Nils Kilden-Pedersen :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Mon, Nov 9, 2009 at 10:58 AM, Paul Phillips <paulp@...> wrote:
On Mon, Nov 09, 2009 at 10:40:30AM -0600, Nils Kilden-Pedersen wrote:
> Paul, you've got me confused. I got around to checking the Scala lib,
> and behold it still has BigDecimal. From source:

Check harder.  (And I didn't say it doesn't have BigDecimal, I said it
doesn't have scala.BigDecimal.)

Ok, now I think you're being cryptic on purpose (or I've had too little sleep (or both)).

 In 2.8.0.r19410-b20091106023416, package scala contains a class named BigDecimal. Maybe I'm being really dense today, but is that not scala.BigDecimal?
BTW, if this is a puzzle, I give up.

Re: Problem with package objects in Eclipse

by Paul Phillips-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Mon, Nov 09, 2009 at 11:53:20AM -0600, Nils Kilden-Pedersen wrote:
>  In 2.8.0.r19410-b20091106023416, package scala contains a class named
> BigDecimal. Maybe I'm being really dense today, but is that not
> scala.BigDecimal?
> BTW, if this is a puzzle, I give up.

It's 20% puzzle, and 80% subtle encouragement that you could probably
figure this stuff out yourself.  Hint booklet now says: look here and
see if you can reconcile the data.

  http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk/src/library/scala/

--
Paul Phillips      | The most dangerous man to any government is the man who
Stickler           | is able to think things out [...] Almost inevitably he
Empiricist         | comes to the conclusion that the government he lives under
i'll ship a pulp   | is dishonest, insane, intolerable.   -- H. L. Mencken

Re: Problem with package objects in Eclipse

by Nils Kilden-Pedersen :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Mon, Nov 9, 2009 at 12:19 PM, Paul Phillips <paulp@...> wrote:
On Mon, Nov 09, 2009 at 11:53:20AM -0600, Nils Kilden-Pedersen wrote:
>  In 2.8.0.r19410-b20091106023416, package scala contains a class named
> BigDecimal. Maybe I'm being really dense today, but is that not
> scala.BigDecimal?
> BTW, if this is a puzzle, I give up.

It's 20% puzzle, and 80% subtle encouragement that you could probably
figure this stuff out yourself.  Hint booklet now says: look here and
see if you can reconcile the data.

 http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk/src/library/scala/

I'm too busy with a Java project to think straight about this. But I offer you this:

http://www.scala-lang.org/archives/downloads/distrib/files/nightly/docs/library/scala/BigDecimal.html

which, when clicking the source link fails, which matches the link you provided. Not sure when the scaladocs are updated, but apparently not as part of the continuous build.

Ok, whatever, it's gone. Anybody care to elaborate on why it's gone? Did I miss some thread explaining this?

RE: Problem with package objects in Eclipse

by christopher marshall-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.
It's in the scala.math package:

http://lampsvn.epfl.ch/trac/scala/browser/scala/trunk/src/library/scala/math/BigDecimal.scala




From: nilskp@...
Date: Mon, 9 Nov 2009 12:34:44 -0600
Subject: Re: [scala-user] Problem with package objects in Eclipse
To: paulp@...
CC: scala-user@...

On Mon, Nov 9, 2009 at 12:19 PM, Paul Phillips <paulp@...> wrote:
On Mon, Nov 09, 2009 at 11:53:20AM -0600, Nils Kilden-Pedersen wrote:
>  In 2.8.0.r19410-b20091106023416, package scala contains a class named
> BigDecimal. Maybe I'm being really dense today, but is that not
> scala.BigDecimal?
> BTW, if this is a puzzle, I give up.

It's 20% puzzle, and 80% subtle encouragement that you could probably
figure this stuff out yourself.  Hint booklet now says: look here and
see if you can reconcile the data.

 http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk/src/library/scala/

I'm too busy with a Java project to think straight about this. But I offer you this:

http://www.scala-lang.org/archives/downloads/distrib/files/nightly/docs/library/scala/BigDecimal.html

which, when clicking the source link fails, which matches the link you provided. Not sure when the scaladocs are updated, but apparently not as part of the continuous build.

Ok, whatever, it's gone. Anybody care to elaborate on why it's gone? Did I miss some thread explaining this?


New Windows 7: Find the right PC for you. Learn more.

Re: Problem with package objects in Eclipse

by Nils Kilden-Pedersen :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Mon, Nov 9, 2009 at 12:42 PM, christopher marshall <oxbow_lakes@...> wrote:

See, that wasn't so hard. Thanks.


Re: Problem with package objects in Eclipse

by Nils Kilden-Pedersen :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Mon, Nov 9, 2009 at 9:20 AM, Paul Phillips <paulp@...> wrote:
On Mon, Nov 09, 2009 at 09:14:49AM -0600, Nils Kilden-Pedersen wrote:
> I'm running the latest 2.8 trunk build in Eclipse and using a package
> object that defines a type Decimal like this:
>
> type Decimal = scala.BigDecimal
>
> This has been added to an existing Scala project that used BigDecimal.
> However when I change the BigDecimal references in the same package to
> Decimal I get compile errors: type not found: Decimal

You know there's no scala.BigDecimal class anymore, yes? You didn't
mention it so I'm guessing you don't.  Not sure what you're seeing but
that seems like a pretty plausible contributing issue.


So now that we've established that BigDecimal has moved to scala.math, I can rule out that that's the problem here. Apparently the move of BigDecimal is recent, very recent. So recent that it hasn't yet made it into the Eclipse plugin build. Just did another update check, and I'm told there are no updates and I'm running 2.8.0.r19410-b20091106023416. That version has no scala.math package and it has a scala.BigDecimal.

So, back to square one: Why is this happening?