From 353a4d9f17b91d09dea3c9090c7a21e267372abe Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Sat, 4 Mar 2017 17:27:10 +0100 Subject: Drop named type parameters in classes Drop the [type T] syntax, and what's associated to make it work. Motivation: It's an alternative way of doing things for which there seems to be little need. The implementation was provisional and bitrotted during the various iterations to introduce higher-kinded types. So in the end the complxity-cost for language and compiler was not worth the added benefit that [type T] parameters provide. Noe that we still accept _named arguments_ [A = T] in expressions; these are useful for specifying some parameters and letting others be inferred. --- compiler/src/dotty/tools/dotc/typer/RefChecks.scala | 5 ----- 1 file changed, 5 deletions(-) (limited to 'compiler/src/dotty/tools/dotc/typer/RefChecks.scala') diff --git a/compiler/src/dotty/tools/dotc/typer/RefChecks.scala b/compiler/src/dotty/tools/dotc/typer/RefChecks.scala index 7c573d23c..23d05e087 100644 --- a/compiler/src/dotty/tools/dotc/typer/RefChecks.scala +++ b/compiler/src/dotty/tools/dotc/typer/RefChecks.scala @@ -241,8 +241,6 @@ object RefChecks { isDefaultGetter(member.name) || // default getters are not checked for compatibility memberTp.overrides(otherTp) - def domain(sym: Symbol): Set[Name] = sym.info.namedTypeParams.map(_.name) - //Console.println(infoString(member) + " overrides " + infoString(other) + " in " + clazz);//DEBUG // return if we already checked this combination elsewhere @@ -344,9 +342,6 @@ object RefChecks { overrideError("cannot be used here - only term macros can override term macros") } else if (!compatibleTypes) { overrideError("has incompatible type" + err.whyNoMatchStr(memberTp, otherTp)) - } else if (member.isType && domain(member) != domain(other)) { - overrideError("has different named type parameters: "+ - i"[${domain(member).toList}%, %] instead of [${domain(other).toList}%, %]") } else { checkOverrideDeprecated() } -- cgit v1.2.3