@@ -37,7 +37,7 @@ object TastyImpl extends scala.tasty.Tasty {
37
37
type Id = untpd.Ident
38
38
39
39
implicit def IdDeco (x : Id ): AbstractId = new AbstractId {
40
- def pos (implicit ctx : Context ): Position = new TastyPosition ( x.pos)
40
+ def pos (implicit ctx : Context ): Position = x.pos
41
41
}
42
42
43
43
def idClassTag : ClassTag [Id ] = implicitly[ClassTag [Id ]]
@@ -54,7 +54,7 @@ object TastyImpl extends scala.tasty.Tasty {
54
54
type Tree = tpd.Tree
55
55
56
56
implicit def TreeDeco (t : Tree ): AbstractTree = new AbstractTree {
57
- def pos (implicit ctx : Context ): Position = new TastyPosition ( t.pos)
57
+ def pos (implicit ctx : Context ): Position = t.pos
58
58
}
59
59
60
60
type PackageClause = tpd.PackageDef
@@ -218,7 +218,7 @@ object TastyImpl extends scala.tasty.Tasty {
218
218
type Term = tpd.Tree
219
219
220
220
implicit def TermDeco (t : Term ): AbstractTerm = new AbstractTerm {
221
- def pos (implicit ctx : Context ): Position = new TastyPosition ( t.pos)
221
+ def pos (implicit ctx : Context ): Position = t.pos
222
222
def tpe (implicit ctx : Context ): Types .Type = t.tpe
223
223
}
224
224
@@ -398,7 +398,7 @@ object TastyImpl extends scala.tasty.Tasty {
398
398
type Pattern = tpd.Tree
399
399
400
400
implicit def PatternDeco (x : Pattern ): AbstractPattern = new AbstractPattern {
401
- def pos (implicit ctx : Context ): Position = new TastyPosition ( x.pos)
401
+ def pos (implicit ctx : Context ): Position = x.pos
402
402
def tpe (implicit ctx : Context ): Types .Type = x.tpe.stripTypeVar
403
403
}
404
404
@@ -458,7 +458,7 @@ object TastyImpl extends scala.tasty.Tasty {
458
458
type TypeTree = tpd.Tree
459
459
460
460
implicit def TypeTreeDeco (x : TypeTree ): AbstractTypeTree = new AbstractTypeTree {
461
- def pos (implicit ctx : Context ): Position = new TastyPosition ( x.pos)
461
+ def pos (implicit ctx : Context ): Position = x.pos
462
462
def tpe (implicit ctx : Context ): Types .Type = x.tpe.stripTypeVar
463
463
}
464
464
@@ -901,9 +901,11 @@ object TastyImpl extends scala.tasty.Tasty {
901
901
}
902
902
903
903
904
- // ===== Private Methods ==========================================
904
+ // ===== Positions ====== ==========================================
905
905
906
- private class TastyPosition (val pos : SourcePosition ) extends Position {
906
+ type Position = SourcePosition
907
+
908
+ def PositionDeco (pos : Position ): AbstractPosition = new AbstractPosition {
907
909
def start = pos.start
908
910
def end = pos.end
909
911
@@ -914,7 +916,6 @@ object TastyImpl extends scala.tasty.Tasty {
914
916
915
917
def startColumn = pos.startColumn
916
918
def endColumn = pos.endColumn
917
-
918
- override def toString : String = s " Position( ${pos.line}, ${pos.column}) "
919
919
}
920
+
920
921
}
0 commit comments