aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/printing
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2014-01-15 16:41:23 +0100
committerMartin Odersky <odersky@gmail.com>2014-01-15 16:41:23 +0100
commitf1cfe733d9d02dff975d2bde222db890ca6d15e6 (patch)
tree4dbc29905abb71c3b8a2228d49d432e52a4e0242 /src/dotty/tools/dotc/printing
parent2112492ec908019d1515128c68f1c737518cac3c (diff)
downloaddotty-f1cfe733d9d02dff975d2bde222db890ca6d15e6.tar.gz
dotty-f1cfe733d9d02dff975d2bde222db890ca6d15e6.tar.bz2
dotty-f1cfe733d9d02dff975d2bde222db890ca6d15e6.zip
Allow views when matching the result type of a selection prototype.
More generally, a refactoring of the Compatibility trait to use value passing instead of inheritance.
Diffstat (limited to 'src/dotty/tools/dotc/printing')
-rw-r--r--src/dotty/tools/dotc/printing/Disambiguation.scala6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/dotty/tools/dotc/printing/Disambiguation.scala b/src/dotty/tools/dotc/printing/Disambiguation.scala
index 196b8f1ae..b830b353a 100644
--- a/src/dotty/tools/dotc/printing/Disambiguation.scala
+++ b/src/dotty/tools/dotc/printing/Disambiguation.scala
@@ -31,7 +31,11 @@ object Disambiguation {
private def recordedNameString(sym: Symbol): String = {
val str = rawNameString(sym)
- val existing = variants.getOrElse(str, new mutable.ListBuffer)
+ val existing = variants.getOrElse(str, new mutable.ListBuffer[Symbol])
+ // Dotty deviation: without a type parameter on ListBuffer, inference
+ // will compute ListBuffer[Symbol] | ListBuffer[Nothing] as the type of "existing"
+ // and then the assignment to variants below will fail.
+ // We need to find a way to avoid such useless inferred types.
if (!(existing contains sym)) {
hasConflicts |= existing.nonEmpty
variants(str) = (existing += sym)