Skip to content

Commit fade319

Browse files
committed
Make encode and decode have more precise types
The return type is now ThisName instead of Name.
1 parent 5c48d3e commit fade319

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
@@ -354,8 +354,8 @@ object Names {
354354
case class DerivedTermName(override val underlying: TermName, override val info: NameInfo)
355355
extends TermName {
356356
def isEmpty = false
357-
def encode: Name = underlying.encode.derived(info.map(_.encode))
358-
def decode: Name = underlying.decode.derived(info.map(_.decode))
357+
def encode: ThisName = underlying.encode.derived(info.map(_.encode))
358+
def decode: ThisName = underlying.decode.derived(info.map(_.decode))
359359
def firstPart = underlying.firstPart
360360
def lastPart = info match {
361361
case qual: QualifiedInfo => qual.name

0 commit comments

Comments
 (0)