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

Imported type not in scope in a type refinement in particular syntactic context (regression) #5305

Closed
scabug opened this issue Dec 14, 2011 · 4 comments
Assignees
Milestone

Comments

@scabug
Copy link

@scabug scabug commented Dec 14, 2011

Used to work in 2.8.1. Broken in 2.9.1 and 2.10-SNAPSHOT.

object Bug {
  def in(a: Any) = {}

  object O {
    type F = Int
  }

  in {
    import O.F
    type x = {type l = F} // not found: type F
  }

  //
  // All of the below work.
  //

  in {
    import O.F
    type x1 = F
    type x2 = {type l = O.F}
  }

  def locally[T](x: T): T  = x

  locally {
    import O.F
    type x3 = {type l = F}
  }

  {
    import O.F
    type x3 = {type l = F}
  }
}
@scabug

This comment has been minimized.

Copy link
Author

@scabug scabug commented Dec 14, 2011

Imported From: https://issues.scala-lang.org/browse/SI-5305?orig=1
Reporter: @retronym
Affected Versions: 2.9.1, 2.10.0

@scabug

This comment has been minimized.

Copy link
Author

@scabug scabug commented May 5, 2012

@retronym said:
I believe that this was introduced:

scala/scala@e5cfe47#L1R2097

The refinement is typed with an outer context that doesn't include the import of O.F.

@scabug

This comment has been minimized.

Copy link
Author

@scabug scabug commented May 6, 2012

@retronym said (edited on May 6, 2012 10:03:18 AM UTC):
I've prototyped a fix, but it warrants review before merging, as I don't trust the test coverage.

retronym/scala@master...ticket/5305

@scabug

This comment has been minimized.

Copy link
Author

@scabug scabug commented May 6, 2012

@retronym said:
Martin included you on the review list for the commit he made that I've partially reverted here. So I'll volley this ticket in your direction.

See:

https://issues.scala-lang.org/browse/SI-3614?focusedCommentId=50477&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-50477

And the comments in:

retronym/scala@f5df207

@scabug scabug closed this May 23, 2012
@scabug scabug added this to the 2.10.0 milestone Apr 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.