summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/compiler/scala/tools/nsc/symtab/Types.scala4
-rw-r--r--test/files/pos/ticket0137.scala8
2 files changed, 11 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/symtab/Types.scala b/src/compiler/scala/tools/nsc/symtab/Types.scala
index af9d7550ad..73172102a7 100644
--- a/src/compiler/scala/tools/nsc/symtab/Types.scala
+++ b/src/compiler/scala/tools/nsc/symtab/Types.scala
@@ -1401,7 +1401,8 @@ A type's typeSymbol should never be inspected directly.
// @M TODO: should not use PolyType, as that's the type of a polymorphic value -- we really want a type *function*
} else if (isHigherKinded) {
// @M TODO: should not use PolyType, as that's the type of a polymorphic value -- we really want a type *function*
- PolyType(typeParams, typeRef(pre, sym, higherKindedArgs))
+ // @M: initialize needed (see test/files/pos/ticket0137.scala)
+ PolyType(typeParams, typeRef(pre, sym.initialize, higherKindedArgs))
} else if (sym.isRefinementClass) {
sym.info
} else {
@@ -2839,6 +2840,7 @@ A type's typeSymbol should never be inspected directly.
private def undoTo(limit: UndoLog) {
while (undoLog ne limit)/* && !undoLog.isEmpty*/ { // @M added `&& !undoLog.isEmpty`
// Martin: I don't think the addition is necessary?
+// @M TODO: I had an example, but seem to have misplaced it :-)
val (tv, constr) = undoLog.head
undoLog = undoLog.tail
tv.constr = constr
diff --git a/test/files/pos/ticket0137.scala b/test/files/pos/ticket0137.scala
new file mode 100644
index 0000000000..4ee92ae8a7
--- /dev/null
+++ b/test/files/pos/ticket0137.scala
@@ -0,0 +1,8 @@
+trait AbsM {
+ abstract class MonadCompanion[M[_]]
+ abstract class AbsMonadCompanion extends MonadCompanion[AM] {
+ def newTag: Int
+ }
+
+ type AM[_] // to trigger the bug, this must be an abstract type member that comes after the reference to it
+} \ No newline at end of file