aboutsummaryrefslogtreecommitdiff
path: root/compiler
diff options
context:
space:
mode:
Diffstat (limited to 'compiler')
-rw-r--r--compiler/src/dotty/tools/dotc/ast/Desugar.scala12
1 files changed, 3 insertions, 9 deletions
diff --git a/compiler/src/dotty/tools/dotc/ast/Desugar.scala b/compiler/src/dotty/tools/dotc/ast/Desugar.scala
index 1531e67b3..10b522eaa 100644
--- a/compiler/src/dotty/tools/dotc/ast/Desugar.scala
+++ b/compiler/src/dotty/tools/dotc/ast/Desugar.scala
@@ -242,20 +242,14 @@ object desugar {
* class C { type v C$T; type v T = C$T }
*/
def typeDef(tdef: TypeDef)(implicit ctx: Context): Tree = {
- val checkedName =
- if (tdef.name.hasVariance && tdef.mods.is(Param)) {
- ctx.error(em"type parameter name may not start with `+' or `-'", tdef.pos)
- ("$" + tdef.name).toTypeName
- }
- else tdef.name
if (tdef.mods is PrivateLocalParam) {
- val tparam = cpy.TypeDef(tdef)(name = checkedName.expandedName(ctx.owner))
+ val tparam = cpy.TypeDef(tdef)(name = tdef.name.expandedName(ctx.owner))
.withMods(tdef.mods &~ PrivateLocal | ExpandedName)
- val alias = cpy.TypeDef(tdef)(name = checkedName, rhs = refOfDef(tparam))
+ val alias = cpy.TypeDef(tdef)(name = tdef.name, rhs = refOfDef(tparam))
.withMods(tdef.mods & VarianceFlags | PrivateLocalParamAccessor | Synthetic)
Thicket(tparam, alias)
}
- else cpy.TypeDef(tdef)(name = checkedName)
+ else tdef
}
@sharable private val synthetic = Modifiers(Synthetic)