summaryrefslogtreecommitdiff
path: root/test/files/pos
diff options
context:
space:
mode:
authorAdriaan Moors <adriaan.moors@typesafe.com>2014-02-06 17:59:14 -0800
committerAdriaan Moors <adriaan.moors@typesafe.com>2014-02-12 10:25:12 -0800
commit7ea7a3b89b2a597f7aa22eefe39e3bae7244882f (patch)
tree3f56600fac2ca94000969f383b45d1e4d88e9b52 /test/files/pos
parent668966be53da2b9b8602098625180192438345b1 (diff)
downloadscala-7ea7a3b89b2a597f7aa22eefe39e3bae7244882f.tar.gz
scala-7ea7a3b89b2a597f7aa22eefe39e3bae7244882f.tar.bz2
scala-7ea7a3b89b2a597f7aa22eefe39e3bae7244882f.zip
SI-8177 co-evolve more than just RefinedTypes
`asSeenFrom` produced a typeref of the shape `T'#A` where `A` referred to a symbol defined in a `T` of times past. More precisely, the `TypeRef` case of `TypeMap`'s `mapOver` correctly modified a prefix from having an underlying type of `{ type A = AIn }` to `{ type A = Int }`, with a new symbol for `A` (now with info `Int`), but the symbol in the outer `TypeRef` wasn't co-evolved (so it still referred to the `A` in `{ type A = AIn }` underlying the old prefix). `coEvolveSym` used to only look at prefixes that were directly `RefinedType`s, but this bug shows they could also be `SingleType`s with an underlying `RefinedType`.
Diffstat (limited to 'test/files/pos')
-rw-r--r--test/files/pos/t8177.scala11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/files/pos/t8177.scala b/test/files/pos/t8177.scala
new file mode 100644
index 0000000000..9bdf80b1bb
--- /dev/null
+++ b/test/files/pos/t8177.scala
@@ -0,0 +1,11 @@
+trait Thing { type A }
+object IntThing extends Thing { type A = Int }
+
+// The following erroneously failed with error: method f overrides nothing.
+// because asSeenFrom produced a typeref of the shape T'#A where A referred to a symbol defined in a T of times past
+// More precisely, the TypeRef case of TypeMap's mapOver correctly modified prefix
+// from having an underlying type of { type A = Ain } to { type A = Int }, with a new symbol for A (now with info Int),
+// but the symbol in the outer type ref wasn't co-evolved (so it still referred to the { type A = AIn } underlying the old prefix)
+// coEvolveSym used to only look at prefixes that were directly RefinedTypes, but they could also be SingleTypes with an underlying RefinedType
+class View[AIn](val in: Thing { type A = AIn }) { def f(p: in.A): in.A = p }
+class SubView extends View[Int](IntThing) { override def f(p: in.A): in.A = p }