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

Error when incremental compiler encounter a value defined in inherited class as protected[scope]. #5013

Closed
scabug opened this issue Sep 20, 2011 · 4 comments
Assignees

Comments

@scabug
Copy link

scabug commented Sep 20, 2011

A compilation error is returned when trying to compile a scala file containing a value defined in inherited class as protected:

// a/Foo.scala
package a

class Foo {
  protected[Foo] var x = 0
}
// b/Bar.scala
package b

class Bar extends a.Foo {
  println(x)
}
$ fsc a/Foo.scala
$ fsc b/Bar.scala 
b/Bar.scala:4: error: not found: value x
  println(x)
          ^
one error found
$

If the 2 scala files are compile at the same time, the compilation goes fine.

$ fsc a/Foo.scala b/Bar.scala 
$ 

This problem has originally been reported against scala-ide: http://www.assembla.com/spaces/scala-ide/tickets/1000567

@scabug
Copy link
Author

scabug commented Sep 20, 2011

Imported From: https://issues.scala-lang.org/browse/SI-5013?orig=1
Reporter: @skyluc
Affected Versions: 2.9.2

@scabug
Copy link
Author

scabug commented Oct 31, 2011

@paulp said:
Note for future me: protected[a] is visible, protected[Foo] is not.

@scabug scabug closed this as completed Nov 7, 2011
@scabug
Copy link
Author

scabug commented Nov 7, 2011

@odersky said:
Fixed in r25959

@scabug
Copy link
Author

scabug commented Feb 19, 2013

@JamesIry said:
Additional test at scala/scala#2137

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

No branches or pull requests

2 participants