Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect range position for immutable.this.List.apply #5064

Closed
scabug opened this issue Oct 7, 2011 · 16 comments
Closed

Incorrect range position for immutable.this.List.apply #5064

scabug opened this issue Oct 7, 2011 · 16 comments

Comments

@scabug
Copy link

scabug commented Oct 7, 2011

Since yesterday (Oct. 6), I'm getting test failures in my scala-refactoring project with Scala 2.10-SNAPSHOT. I tracked them down to a wrong position; the following code:

bq. List(1)

is represented as

bq. immutable.this.List.applyInt

but the This tree has exactly the same RangePosition as the List Select, which is clearly incorrect.

@scabug
Copy link
Author

scabug commented Oct 7, 2011

Imported From: https://issues.scala-lang.org/browse/SI-5064?orig=1
Reporter: Mirko Stocker (misto)
Other Milestones: 2.10.0

@scabug
Copy link
Author

scabug commented Oct 7, 2011

@hubertp said:
Looks like an exact copy of #4494? From the Range positions point of view, this is correct (previously it had NoPosition so I don't know how that worked for you). This is the result of r25784. That was committed on 4th so I don't know why it started to fail on 6th for you (publish delay?)

@scabug
Copy link
Author

scabug commented Oct 7, 2011

Mirko Stocker (misto) said:
Oh, yes, I didn't see that, sorry for the duplicate. It used to work because NoPosition trees are ignored, I can certainly handle it in my library if this is the expected behavior. But why isn't it an offset position? That's what I would have expected.

@scabug
Copy link
Author

scabug commented Oct 7, 2011

@hubertp said:
Sure, offset is also fine I think.

@scabug
Copy link
Author

scabug commented Oct 7, 2011

@hubertp said:
btw NoPosition is generally wrong I think (at least all NoPosition until typer) so feel free to submit bugs related to that as well.

@scabug
Copy link
Author

scabug commented Oct 7, 2011

Mirko Stocker (misto) said:
Oh, that would be perfect :-) Can I bribe you to change it to an OffsetPosition?

@scabug
Copy link
Author

scabug commented Oct 7, 2011

Mirko Stocker (misto) said:
Ok, I'll report them if I find more. It seems (from #4494) that you found the Serializable parent already.

@scabug
Copy link
Author

scabug commented Oct 18, 2011

@hubertp said:
Yes, Martin committed only partial fix. I will try to handle your problem shortly, sorry for the delay.

@scabug
Copy link
Author

scabug commented Nov 29, 2011

Mirko Stocker (misto) said:
Ping :-)

@scabug
Copy link
Author

scabug commented Aug 28, 2012

@dragos said:
I'd like to raise the priority of this one. Not having hyperlinking for List in 2.10.0 is something that will for sure turn off some new users. Old users will just note that it's a regression from 2.9.

@scabug
Copy link
Author

scabug commented Sep 3, 2012

@paulp said:
scala/scala#1240

@scabug
Copy link
Author

scabug commented Sep 10, 2012

@hubertp said:
Correct fix: scala/scala#1251

@scabug
Copy link
Author

scabug commented Sep 10, 2012

Mirko Stocker (misto) said:
Sorry for being so late, but I'm not happy with the fix. For List(1), the List select now has a transparent position, and the apply has the range position, but it should be the other way round.

@scabug
Copy link
Author

scabug commented Sep 11, 2012

Mirko Stocker (misto) said:
Please see my comment here: https://github.com/scala/scala/pull/1251/files#r1573933

@scabug
Copy link
Author

scabug commented Dec 8, 2012

@retronym said:
Mirko:

I'm not sure what to do, in my understanding of positions, both apply and unapply should be transparent positions and their underlying Ident or Select trees should have a range position. But if that prevents the IDE from hyperlinking directly to the definition of apply, then maybe we should just leave this as it is now.

Are you happy to close this ticket?

@scabug
Copy link
Author

scabug commented Dec 8, 2012

Mirko Stocker (misto) said:
I wouldn't say that I'm happy, but I can work around it :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants