aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/dotty/tools/dotc/typer/Typer.scala4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/dotty/tools/dotc/typer/Typer.scala b/src/dotty/tools/dotc/typer/Typer.scala
index 5dc0452d1..331657e12 100644
--- a/src/dotty/tools/dotc/typer/Typer.scala
+++ b/src/dotty/tools/dotc/typer/Typer.scala
@@ -801,6 +801,10 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit
typr.println(s"adding refinement $refinement")
checkRefinementNonCyclic(refinement, refineCls, seen)
val rsym = refinement.symbol
+ if ((rsym.is(Method) || rsym.isType) && rsym.allOverriddenSymbols.isEmpty) {
+ println(refineCls.baseClasses)
+ ctx.error(i"refinement $rsym without matching type in parent $parent", refinement.pos)
+ }
val rinfo = if (rsym is Accessor) rsym.info.resultType else rsym.info
RefinedType(parent, rsym.name, rt => rinfo.substThis(refineCls, SkolemType(rt)))
// todo later: check that refinement is within bounds