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
Scalac crash on erroneous code #5687
Comments
Imported From: https://issues.scala-lang.org/browse/SI-5687?orig=1
|
Edmondo Porcu (edmondo1984) said: If the abstract type is replaced by an extra generic parameter, everything works fine and compile |
@som-snytt said: /*
porcu.scala:5: error: type arguments [T] do not conform to class Template's type parameter bounds [T <: Object]
type Repr[T]<:Template[T]
^
porcu.scala:42: error: overriding type Repr in class Template with bounds[T] <: gist2427426.Template[T];
type Repr has incompatible type
type Repr = CurveTemplate[T]
^
two errors found
*/
// in the attached code
object Example {
def main(args:Array[String]) ={
/*
val template = new CurveTemplate(new Curve).withTimeout(2000L).withReadModifiers(ReadModifiers.DIRTY_READ).resolve
println(template)
*/
/*
val a = new CurveTemplate(new Curve)
val b = a.withTimeout(2000L)
// This is not yet germane
//error: value withReadModifiers is not a member of a.Repr[gist2427426.Curve]
val c = b.withReadModifiers(ReadModifiers.DIRTY_READ)
val d = c.resolve
println(d)
*/
val a: CurveTemplate[Curve] = new CurveTemplate(new Curve)
val b: CurveTemplate[Curve] = a.withTimeout(2000L)
val c: CurveTemplate[Curve] = b.withReadModifiers(ReadModifiers.DIRTY_READ)
val d = c.resolve
println(d)
}
} |
Edmondo Porcu (edmondo1984) said: |
@hubertp said: new CurveTemplate(new Curve).withTimeout(2000L) will need to perform dealiasing in order to get the type of withTimeout (again before Refchecks) and that will simply have ErrorType as a result type, which already gives you pretty uninformative error message. ... .withReadModifiers(...) it is just getting lost and crashes after typers. So either we will be checking the bounds earlier or basically we defer this check until refchecks. |
@adriaanm said: |
[minimized from the original report]
The text was updated successfully, but these errors were encountered: