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
RootPackage symbols gets LATEMETHOD flag
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  23 messages - Collapse all  -  Translate all to Translated (View all originals)
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
 
Eugene Burmako  
View profile  
 More options Aug 10 2012, 3:16 pm
From: Eugene Burmako <eugene.burm...@epfl.ch>
Date: Fri, 10 Aug 2012 12:16:13 -0700 (PDT)
Local: Fri, Aug 10 2012 3:16 pm
Subject: RootPackage symbols gets LATEMETHOD flag
What's going on? Is this intended?

 
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.
Paul Phillips  
View profile  
 More options Aug 10 2012, 3:40 pm
From: Paul Phillips <pa...@improving.org>
Date: Fri, 10 Aug 2012 12:40:13 -0700
Local: Fri, Aug 10 2012 3:40 pm
Subject: Re: [scala-internals] RootPackage symbols gets LATEMETHOD flag

On Fri, Aug 10, 2012 at 12:16 PM, Eugene Burmako <eugene.burm...@epfl.ch>wrote:

> What's going on? Is this intended?

Which symbols specifically?

 
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.
Eugene Burmako  
View profile  
 More options Aug 10 2012, 3:48 pm
From: Eugene Burmako <eugene.burm...@epfl.ch>
Date: Fri, 10 Aug 2012 21:48:12 +0200
Local: Fri, Aug 10 2012 3:48 pm
Subject: Re: [scala-internals] RootPackage symbols gets LATEMETHOD flag

Sorry, that was a typo. I meant the RootPackage symbol.

This one: final object RootPackage extends ModuleSymbol(rootOwner,
NoPosition, nme.ROOTPKG)

On 10 August 2012 21:40, Paul Phillips <pa...@improving.org> wrote:


 
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.
Paul Phillips  
View profile  
 More options Aug 10 2012, 4:18 pm
From: Paul Phillips <pa...@improving.org>
Date: Fri, 10 Aug 2012 13:18:14 -0700
Local: Fri, Aug 10 2012 4:18 pm
Subject: Re: [scala-internals] RootPackage symbols gets LATEMETHOD flag

On Fri, Aug 10, 2012 at 12:48 PM, Eugene Burmako <eugene.burm...@epfl.ch>wrote:

> Sorry, that was a typo. I meant the RootPackage symbol.

> This one: final object RootPackage extends ModuleSymbol(rootOwner,
> NoPosition, nme.ROOTPKG)

What makes you think it's getting lateMETHOD? I don't see it.

 
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.
Eugene Burmako  
View profile  
 More options Aug 10 2012, 4:23 pm
From: Eugene Burmako <eugene.burm...@epfl.ch>
Date: Fri, 10 Aug 2012 22:23:19 +0200
Local: Fri, Aug 10 2012 4:23 pm
Subject: Re: [scala-internals] RootPackage symbols gets LATEMETHOD flag

At lambdalift it has the following flags:

scala> ru.show(9024791446044960L.asInstanceOf[FlagSet])
res0 @ 44157e43: String = FINAL | MODULE | PACKAGE | JAVA | STABLE |
TRIEDCOOKING | LATEMETHOD

From a quick experiment with -Xprint, it seems that it becomes a "method"
in uncurry. Before that it's printed as _root_, but with -Xprint:uncurry
it's printed as _root_() [1]

[1] https://gist.github.com/3317557

On 10 August 2012 22:18, Paul Phillips <pa...@improving.org> wrote:


 
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.
Paul Phillips  
View profile  
 More options Aug 10 2012, 4:26 pm
From: Paul Phillips <pa...@improving.org>
Date: Fri, 10 Aug 2012 13:26:43 -0700
Local: Fri, Aug 10 2012 4:26 pm
Subject: Re: [scala-internals] RootPackage symbols gets LATEMETHOD flag

On Fri, Aug 10, 2012 at 1:23 PM, Eugene Burmako <eugene.burm...@epfl.ch>wrote:

Where is the source code?

 
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.
Eugene Burmako  
View profile  
 More options Aug 10 2012, 4:27 pm
From: Eugene Burmako <eugene.burm...@epfl.ch>
Date: Fri, 10 Aug 2012 22:27:27 +0200
Local: Fri, Aug 10 2012 4:27 pm
Subject: Re: [scala-internals] RootPackage symbols gets LATEMETHOD flag

https://gist.github.com/3317596

On 10 August 2012 22:26, Paul Phillips <pa...@improving.org> wrote:


 
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.
Paul Phillips  
View profile  
 More options Aug 10 2012, 4:29 pm
From: Paul Phillips <pa...@improving.org>
Date: Fri, 10 Aug 2012 13:29:31 -0700
Local: Fri, Aug 10 2012 4:29 pm
Subject: Re: [scala-internals] RootPackage symbols gets LATEMETHOD flag

Can you incur "_root_()" without any xml? I think it's a bug in the xml
parser.

On Fri, Aug 10, 2012 at 1:27 PM, Eugene Burmako <eugene.burm...@epfl.ch>wrote:


 
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.
Eugene Burmako  
View profile  
 More options Aug 10 2012, 4:33 pm
From: Eugene Burmako <eugene.burm...@epfl.ch>
Date: Fri, 10 Aug 2012 22:33:17 +0200
Local: Fri, Aug 10 2012 4:33 pm
Subject: Re: [scala-internals] RootPackage symbols gets LATEMETHOD flag

Also see Hubert's comments to https://issues.scala-lang.org/browse/SI-6201

The problem is that root package qualifier from root.scala.xml.Null somehow
gets past Typer and later we crash.
adaptToMemberWithArgs is a bit at fault but the underlying cause may be
somewhere else.

On 10 August 2012 22:29, Paul Phillips <pa...@improving.org> wrote:


 
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.
Hubert Plociniczak  
View profile  
 More options Aug 10 2012, 4:42 pm
From: Hubert Plociniczak <hubert.plocinic...@epfl.ch>
Date: Fri, 10 Aug 2012 22:42:13 +0200
Local: Fri, Aug 10 2012 4:42 pm
Subject: Re: [scala-internals] RootPackage symbols gets LATEMETHOD flag

On Aug 10, 2012, at 10:33 PM, Eugene Burmako <eugene.burm...@epfl.ch> wrote:

> Also see Hubert's comments to https://issues.scala-lang.org/browse/SI-6201

> The problem is that root package qualifier from root.scala.xml.Null somehow gets past Typer and later we crash.

 That's only partially the reason. I only later noticed that we don't (or least weren't in the past) removing the qualifier consistently. It's somewhere in Typers ( not on my laptop atm so cannot give you the location).
Since I never really touched that part I don't know if it is intended or not.


 
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.
Eugene Burmako  
View profile  
 More options Aug 10 2012, 5:15 pm
From: Eugene Burmako <eugene.burm...@epfl.ch>
Date: Fri, 10 Aug 2012 23:15:30 +0200
Local: Fri, Aug 10 2012 5:15 pm
Subject: Re: [scala-internals] RootPackage symbols gets LATEMETHOD flag

Okay, RootPackage gets its lateMETHOD flag because of this code in
refchecks:

override def transformInfo(sym: Symbol, tp: Type): Type = {
  if (sym.isModule && !sym.isStatic) sym setFlag (lateMETHOD | STABLE)
  super.transformInfo(sym, tp)

}

On 10 August 2012 21:48, Eugene Burmako <eugene.burm...@epfl.ch> wrote:


 
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.
Paul Phillips  
View profile  
 More options Aug 10 2012, 5:16 pm
From: Paul Phillips <pa...@improving.org>
Date: Fri, 10 Aug 2012 14:16:07 -0700
Local: Fri, Aug 10 2012 5:16 pm
Subject: Re: [scala-internals] RootPackage symbols gets LATEMETHOD flag

On Fri, Aug 10, 2012 at 2:15 PM, Eugene Burmako <eugene.burm...@epfl.ch>wrote:

> Okay, RootPackage gets its lateMETHOD flag because of this code in
> refchecks:

> override def transformInfo(sym: Symbol, tp: Type): Type = {
>   if (sym.isModule && !sym.isStatic) sym setFlag (lateMETHOD | STABLE)
>   super.transformInfo(sym, tp)
> }

Yes, that is the only place anything gets its lateMETHOD flag.

 
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.
Paul Phillips  
View profile  
 More options Aug 10 2012, 5:31 pm
From: Paul Phillips <pa...@improving.org>
Date: Fri, 10 Aug 2012 14:31:38 -0700
Local: Fri, Aug 10 2012 5:31 pm
Subject: Re: [scala-internals] RootPackage symbols gets LATEMETHOD flag

I don't know what changed, but the simple solution here is to fix isStatic
so it is not willing to claim that packages are not static.

 - def isStatic = (this hasFlag STATIC) || owner.isStaticOwner
 + def isStatic = (this hasFlag STATIC | PACKAGE) || owner.isStaticOwner


 
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.
Eugene Burmako  
View profile  
 More options Aug 10 2012, 5:39 pm
From: Eugene Burmako <eugene.burm...@epfl.ch>
Date: Fri, 10 Aug 2012 23:39:53 +0200
Local: Fri, Aug 10 2012 5:39 pm
Subject: Re: [scala-internals] RootPackage symbols gets LATEMETHOD flag

Right. Or we could alternatively override isStatic in root symbols (which I
think would be a good idea anyways).

But I want to get to the bottom of it. It seems that typer after
refactoring doesn't strip off RootPackage qualifiers as in "if
(qual1.symbol == RootPackage) treeCopy.Ident(tree1, name) else tree1".
Weird.

On 10 August 2012 23:31, Paul Phillips <pa...@improving.org> wrote:


 
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.
Hubert Plociniczak  
View profile  
 More options Aug 10 2012, 5:49 pm
From: Hubert Plociniczak <hubert.plocinic...@epfl.ch>
Date: Fri, 10 Aug 2012 23:49:38 +0200
Local: Fri, Aug 10 2012 5:49 pm
Subject: Re: [scala-internals] RootPackage symbols gets LATEMETHOD flag

On Aug 10, 2012, at 11:39 PM, Eugene Burmako <eugene.burm...@epfl.ch> wrote:

> Right. Or we could alternatively override isStatic in root symbols (which I think would be a good idea anyways).

> But I want to get to the bottom of it. It seems that typer after refactoring doesn't strip off RootPackage qualifiers as in "if (qual1.symbol == RootPackage) treeCopy.Ident(tree1, name) else tree1". Weird.

It's because of context.tree in adaptToMember...


 
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.
Eugene Burmako  
View profile  
 More options Aug 10 2012, 5:51 pm
From: Eugene Burmako <eugene.burm...@epfl.ch>
Date: Fri, 10 Aug 2012 23:51:11 +0200
Local: Fri, Aug 10 2012 5:51 pm
Subject: Re: [scala-internals] RootPackage symbols gets LATEMETHOD flag

Okay found it. `Tree.hasSymbolWhich` is implemented incorrectly. The
offending patch adds a check for this.hasSymbol, which is false for Apply
nodes. Hence _root_ qualifier doesn't get stripped off, and bad things
happen.

On 10 August 2012 23:39, Eugene Burmako <eugene.burm...@epfl.ch> wrote:


 
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.
Eugene Burmako  
View profile  
 More options Aug 10 2012, 5:54 pm
From: Eugene Burmako <eugene.burm...@epfl.ch>
Date: Fri, 10 Aug 2012 23:54:20 +0200
Local: Fri, Aug 10 2012 5:54 pm
Subject: Re: [scala-internals] RootPackage symbols gets LATEMETHOD flag

Funny! It took a superposition of three oversights (adaptToMember not
removing _root_, _root_ having isStatic set to false and broken
hasSymbolWhich) to blow up. The first two oversights alone were not enough
:)

On 10 August 2012 23:49, Hubert Plociniczak <hubert.plocinic...@epfl.ch>wrote:


 
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.
Paul Phillips  
View profile  
 More options Aug 10 2012, 6:07 pm
From: Paul Phillips <pa...@improving.org>
Date: Fri, 10 Aug 2012 15:07:08 -0700
Local: Fri, Aug 10 2012 6:07 pm
Subject: Re: [scala-internals] RootPackage symbols gets LATEMETHOD flag

On Fri, Aug 10, 2012 at 2:51 PM, Eugene Burmako <eugene.burm...@epfl.ch>wrote:

> Okay found it. `Tree.hasSymbolWhich` is implemented incorrectly. The
> offending patch adds a check for this.hasSymbol, which is false for Apply
> nodes. Hence _root_ qualifier doesn't get stripped off, and bad things
> happen.

I'm glad I could provide the critical third leg of the bug platform.

I see hasSymbol can just be tossed from hasSymbolWhich entirely.  It exists
primarily to avoid all the NPEs one enjoys when depending on everyone to
check .symbol != null every time.


 
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.
Eugene Burmako  
View profile  
 More options Aug 10 2012, 6:10 pm
From: Eugene Burmako <eugene.burm...@epfl.ch>
Date: Sat, 11 Aug 2012 00:10:10 +0200
Local: Fri, Aug 10 2012 6:10 pm
Subject: Re: [scala-internals] RootPackage symbols gets LATEMETHOD flag

Here's the patch: https://github.com/scala/scala/pull/1118.

I know next to nothing about adaptToMember, so I only fixed two legs of
three.

On 11 August 2012 00:07, Paul Phillips <pa...@improving.org> wrote:


 
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.
martin odersky  
View profile  
 More options Aug 12 2012, 7:09 am
From: martin odersky <martin.oder...@epfl.ch>
Date: Sun, 12 Aug 2012 13:09:38 +0200
Local: Sun, Aug 12 2012 7:09 am
Subject: Re: [scala-internals] RootPackage symbols gets LATEMETHOD flag

On Fri, Aug 10, 2012 at 11:15 PM, Eugene Burmako <eugene.burm...@epfl.ch>wrote:

> Okay, RootPackage gets its lateMETHOD flag because of this code in
> refchecks:

> override def transformInfo(sym: Symbol, tp: Type): Type = {
>   if (sym.isModule && !sym.isStatic) sym setFlag (lateMETHOD | STABLE)
>   super.transformInfo(sym, tp)
> }

Clearly, root package needs to be static, so that's a bug. I am less sure
about hasSymbolWhich. I think it is correct as defined. If a tree does not
have a symbol (ie hasSymbol is false) then clearly hasSymbolWhich should
also be false. Clients need to take that into account.

Cheers

 - Martin

--
Martin Odersky
Prof., EPFL <http://www.epfl.ch> and Chairman, Typesafe<http://www.typesafe.com>
PSED, 1015 Lausanne, Switzerland
Tel. EPFL: +41 21 693 6863
Tel. Typesafe: +41 21 691 4967

 
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.
Eugene Burmako  
View profile  
 More options Aug 12 2012, 7:14 am
From: Eugene Burmako <eugene.burm...@epfl.ch>
Date: Sun, 12 Aug 2012 13:14:37 +0200
Local: Sun, Aug 12 2012 7:14 am
Subject: Re: [scala-internals] RootPackage symbols gets LATEMETHOD flag

Apply.hasSymbol is false, but it does have a symbol, because it overrides
the symbol getter with fun.symbol.

So either Apply.hasSymbol is incorrect, or we should allow for Apply as it
has been done before.

On 12 August 2012 13:09, martin odersky <martin.oder...@epfl.ch> wrote:


 
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.
Paul Phillips  
View profile  
 More options Aug 12 2012, 10:51 am
From: Paul Phillips <pa...@improving.org>
Date: Sun, 12 Aug 2012 07:51:20 -0700
Local: Sun, Aug 12 2012 10:51 am
Subject: Re: [scala-internals] RootPackage symbols gets LATEMETHOD flag

On Sun, Aug 12, 2012 at 4:09 AM, martin odersky <martin.oder...@epfl.ch>wrote:

> If a tree does not have a symbol (ie hasSymbol is false) then clearly
> hasSymbolWhich should also be false. Clients need to take that into account.

The problem is that what it means to "have a symbol" is ill-defined.
 "hasSymbol" would be better called "hasSymbolField" because that's what
the implementation is really testing.  However "hasSymbolWhich" is intended
for the generally far more useful question of what happens when you call
.symbol on that tree (but avoiding NPEs.) The difference arises in the
trees which forward the symbol call to some underlying tree, as
Apply/TypeApply do to their first children.

 
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.
martin odersky  
View profile  
 More options Aug 13 2012, 3:40 am
From: martin odersky <martin.oder...@epfl.ch>
Date: Mon, 13 Aug 2012 09:40:19 +0200
Local: Mon, Aug 13 2012 3:40 am
Subject: Re: [scala-internals] RootPackage symbols gets LATEMETHOD flag

On Sun, Aug 12, 2012 at 1:14 PM, Eugene Burmako <eugene.burm...@epfl.ch>wrote:

> Apply.hasSymbol is false, but it does have a symbol, because it overrides
> the symbol getter with fun.symbol.

> So either Apply.hasSymbol is incorrect, or we should allow for Apply as it
> has been done before.

> You should allow for Apply. It's not just Apply but also TypeApply.

Essentillay, hasSymbol means: Tree defines a Symbol. Apply, and TypeApply
don't; they just forward.

Cheers

 - Martin

--
Martin Odersky
Prof., EPFL <http://www.epfl.ch> and Chairman, Typesafe<http://www.typesafe.com>
PSED, 1015 Lausanne, Switzerland
Tel. EPFL: +41 21 693 6863
Tel. Typesafe: +41 21 691 4967

 
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.
End of messages
« Back to Discussions « Newer topic     Older topic »