summaryrefslogtreecommitdiff
path: root/test/files/pos/t8177b.scala
diff options
context:
space:
mode:
authorAdriaan Moors <adriaan.moors@typesafe.com>2014-02-10 13:43:30 -0800
committerAdriaan Moors <adriaan.moors@typesafe.com>2014-02-12 15:36:31 -0800
commit427b82648422e4118c68f34e81c94deca3755deb (patch)
treeeff3dbe39b6d04feabfc44ba07aa3cada5a7a2ae /test/files/pos/t8177b.scala
parent7ea7a3b89b2a597f7aa22eefe39e3bae7244882f (diff)
downloadscala-427b82648422e4118c68f34e81c94deca3755deb.tar.gz
scala-427b82648422e4118c68f34e81c94deca3755deb.tar.bz2
scala-427b82648422e4118c68f34e81c94deca3755deb.zip
SI-8177 refine embeddedSymbols
We look for any prefix that has a refinement class for a type symbol. This includes ThisTypes, which were not considered before. pos/t8177g.scala, neg/t0764*scala now compile, as they should Additional test cases contributed by Jason & Paul.
Diffstat (limited to 'test/files/pos/t8177b.scala')
-rw-r--r--test/files/pos/t8177b.scala13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/files/pos/t8177b.scala b/test/files/pos/t8177b.scala
new file mode 100644
index 0000000000..b7ed9342a3
--- /dev/null
+++ b/test/files/pos/t8177b.scala
@@ -0,0 +1,13 @@
+// exercise coevolveSym: SingleType with an underlying RefinedType, via a type alias
+trait Thing { type A }
+object IntThing extends Thing { type A = Int }
+object ThingHolder { type Alias[AIn] = Thing { type A = AIn } }
+
+// 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: ThingHolder.Alias[AIn]) { def f(p: in.A): in.A = p }
+class SubView extends View[Int](IntThing) { override def f(p: in.A): in.A = p } \ No newline at end of file