Skip to content

Fix regression in import name comparison#8052

Merged
lrytz merged 1 commit intoscala:2.13.xfrom
retronym:topic/sameName-2.13.x
May 13, 2019
Merged

Fix regression in import name comparison#8052
lrytz merged 1 commit intoscala:2.13.xfrom
retronym:topic/sameName-2.13.x

Conversation

@retronym
Copy link
Member

No description provided.

@scala-jenkins scala-jenkins added this to the 2.13.1 milestone May 11, 2019
@retronym retronym modified the milestones: 2.13.1, 2.13.0-RC2 May 11, 2019
@retronym retronym added bug fix prio:blocker release blocker (used only by core team, only near release time) labels May 11, 2019
@som-snytt
Copy link
Contributor

I was curious if I'd broken something, since it sounds like something I woulda broke.

This may be old-fashioned, but it would nice to have a test to show before and after.

In the crossword, TIL "status quo" is actually https://en.wikipedia.org/wiki/Status_quo_ante_bellum

That is, "status quo" means you're rewinding not just past the last commit, but past the last war.

I understand the change to mean you must compare both start and len because of prefixes. I feel like I just commented about prefixes, but I don't remember if that was at my day job or my happy place. Is that a hazard of FOSS?

@retronym
Copy link
Member Author

I don't think the potential bug could be reproduced in partest in a straightforward manner.

object C {
  def foo = 1
  def fo = 2
}

class Test {
  import C.foo
  fo
}

If something in the compiler (or a macro) had called TermName("foo").subName, 0, 2) prior to parsing that file, this might incorrectly typecheck.

@lrytz lrytz merged commit 1ae9f82 into scala:2.13.x May 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

prio:blocker release blocker (used only by core team, only near release time)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants