aboutsummaryrefslogtreecommitdiff
path: root/compiler/src/dotty/tools/dotc/typer/Typer.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2017-01-05 16:02:09 +0700
committerMartin Odersky <odersky@gmail.com>2017-01-05 18:00:06 +0700
commitaa6ebe938639f07dd6f5612e645f1449f37a86eb (patch)
tree24d257c1f12d0f5cb9b76102043046e3a904d98a /compiler/src/dotty/tools/dotc/typer/Typer.scala
parent42eb864dc752254fc3b8b0428570fe94aa1dafc7 (diff)
downloaddotty-aa6ebe938639f07dd6f5612e645f1449f37a86eb.tar.gz
dotty-aa6ebe938639f07dd6f5612e645f1449f37a86eb.tar.bz2
dotty-aa6ebe938639f07dd6f5612e645f1449f37a86eb.zip
Implement structural type member access
New scheme for implementing structural type member access.
Diffstat (limited to 'compiler/src/dotty/tools/dotc/typer/Typer.scala')
-rw-r--r--compiler/src/dotty/tools/dotc/typer/Typer.scala7
1 files changed, 3 insertions, 4 deletions
diff --git a/compiler/src/dotty/tools/dotc/typer/Typer.scala b/compiler/src/dotty/tools/dotc/typer/Typer.scala
index 6dd3f45fc..4c238518e 100644
--- a/compiler/src/dotty/tools/dotc/typer/Typer.scala
+++ b/compiler/src/dotty/tools/dotc/typer/Typer.scala
@@ -1039,9 +1039,6 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit
for (refinement <- refinements1) { // TODO: get clarity whether we want to enforce these conditions
typr.println(s"adding refinement $refinement")
checkRefinementNonCyclic(refinement, refineCls, seen)
- val rsym = refinement.symbol
- if (rsym.is(Method) && rsym.allOverriddenSymbols.isEmpty)
- ctx.error(i"refinement $rsym without matching type in parent $tpt1", refinement.pos)
}
assignType(cpy.RefinedTypeTree(tree)(tpt1, refinements1), tpt1, refinements1, refineCls)
}
@@ -1808,6 +1805,7 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit
case Apply(_, _) => " more"
case _ => ""
}
+ println(i"tree = $tree, pt = $pt")
errorTree(tree, em"$methodStr does not take$more parameters")
}
}
@@ -2045,7 +2043,8 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit
adaptInterpolated(tree.appliedToTypeTrees(typeArgs), pt, original))
}
case wtp =>
- pt match {
+ if (isStructuralTermSelect(tree)) adapt(handleStructural(tree), pt)
+ else pt match {
case pt: FunProto =>
adaptToArgs(wtp, pt)
case pt: PolyProto =>