Skip to content

Commit 128b9fe

Browse files
committed
Make encode and decode have more precise types
The return type is now ThisName instead of Name.
1 parent 9810bc5 commit 128b9fe

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

compiler/src/dotty/tools/dotc/core/Names.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,10 +102,10 @@ object Names {
102102
def toText(printer: Printer): Text = printer.toText(this)
103103

104104
/** Replace \$op_name's by corresponding operator symbols. */
105-
def decode: Name
105+
def decode: ThisName
106106

107107
/** Replace operator symbols by corresponding \$op_name's. */
108-
def encode: Name
108+
def encode: ThisName
109109

110110
def firstPart: SimpleTermName
111111
def lastPart: SimpleTermName
@@ -355,8 +355,8 @@ object Names {
355355
case class DerivedTermName(override val underlying: TermName, override val info: NameInfo)
356356
extends TermName {
357357
def isEmpty = false
358-
def encode: Name = underlying.encode.derived(info.map(_.encode))
359-
def decode: Name = underlying.decode.derived(info.map(_.decode))
358+
def encode: ThisName = underlying.encode.derived(info.map(_.encode))
359+
def decode: ThisName = underlying.decode.derived(info.map(_.decode))
360360
def firstPart = underlying.firstPart
361361
def lastPart = info match {
362362
case qual: QualifiedInfo => qual.name

0 commit comments

Comments
 (0)