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 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
Copy link
Author

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
Copy link
Author

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
Copy link
Author

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
Copy link
Author

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@f5df207f

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