| [#397] | project: compiler | priority: medium | category: bug | |
|---|---|---|---|---|
| submitter | assigned to | status | date submitted | |
| Vincent | Martin | fixed | 2005-02-01 14:28:01.0 | |
| subject | Types like C.this.T escaping the context of class C | |||
| code |
abstract class Root {
abstract class Edge {
type V;
def source: V;
}
abstract class Graph {
type W;
type E <: Edge{type V = W};
def edge: E;
}
val g: Graph{type W = Int};
val x: Int = g.edge.source;
}
|
|||
| what happened | bug1.scala:15: type mismatch;
found : Graph.this.W
required: scala.Int
val x: Int = g.edge.source;
^
one error found
|
|||
| what expected | Silent compilation.
The type found for g.edge.source is "Graph.this.W". It should be "g.W". Anyway "Graph.this.W" makes no sense (is ill-formed) outside of the context of the class Graph. |
|||
| [back to overview] | ||||
| Martin edited on 2006-10-30 14:02:39.0 |