|
[#1050] |
project: compiler |
priority: low |
category: bug |
|
submitter |
assigned to |
status |
date submitted |
|
Nikolay |
Martin |
fixed |
2007-04-17 13:34:52.0 |
subject |
[contrib #434] apparent self-type inconsistency |
code |
abstract class A {
type T <: scala.ScalaObject
class A requires T {
def b = 3
def c = b
b
}
}
|
what happened |
Compiler complains:
break.scala:6: error: not found: value b
|
what expected |
Commenting the line "b" allows compilation. It seems inconsistent that the line "def c = b" is accepted but the line "b" doesn't.
Notes: easy workaround - replace "requires T" with "requires (T with A)". Perhaps it would be helpful if the compiler did this automatically.
|
[back to overview] |