@@ -11,6 +11,7 @@ import scala.internal.Chars.isIdentifierStart
11
11
import collection .immutable
12
12
import config .Config
13
13
import java .util .HashMap
14
+ import Contexts .Context
14
15
15
16
import scala .annotation .internal .sharable
16
17
@@ -638,13 +639,8 @@ object Names {
638
639
def typeName (bs : Array [Byte ], offset : Int , len : Int ): TypeName =
639
640
termName(bs, offset, len).toTypeName
640
641
641
- /** Create a term name from a string, without encoding operators */
642
- def termName (s : String ): SimpleName = termName(s.toCharArray, 0 , s.length)
643
-
644
- /** Create a type name from a string, without encoding operators */
645
- def typeName (s : String ): TypeName = typeName(s.toCharArray, 0 , s.length)
646
-
647
- def termName (s : String , from : Int , len : Int )(using ctx : Contexts .Context ): TermName = {
642
+ /** Create a term name from a string slice */
643
+ def termName (s : String , from : Int , len : Int )(using Context ): SimpleName = {
648
644
val base = ctx.base
649
645
650
646
while (len > base.nameCharBuffer.length)
@@ -654,9 +650,16 @@ object Names {
654
650
termName(base.nameCharBuffer, 0 , len)
655
651
}
656
652
657
- def typeName (s : String , from : Int , len : Int )(using ctx : Contexts .Context ): TypeName =
653
+ /** Create a type name from a string slice */
654
+ def typeName (s : String , from : Int , len : Int )(using Context ): TypeName =
658
655
termName(s, from, len).toTypeName
659
656
657
+ /** Create a term name from a string, */
658
+ def termName (s : String ): SimpleName = termName(s, 0 , s.length)
659
+
660
+ /** Create a type name from a string */
661
+ def typeName (s : String ): TypeName = typeName(s, 0 , s.length)
662
+
660
663
table(0 ) = new SimpleName (- 1 , 0 , null )
661
664
662
665
/** The term name represented by the empty string */
0 commit comments