diff options
Diffstat (limited to 'src/compiler/scala/tools/nsc/util/Position.scala')
-rw-r--r-- | src/compiler/scala/tools/nsc/util/Position.scala | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/util/Position.scala b/src/compiler/scala/tools/nsc/util/Position.scala index 573f7bc7b2..208cd5703a 100644 --- a/src/compiler/scala/tools/nsc/util/Position.scala +++ b/src/compiler/scala/tools/nsc/util/Position.scala @@ -40,7 +40,15 @@ trait Position extends scala.reflect.api.Position with scala.reflect.api.Attachm /** A bit weird method that is necessary to safely update positions without destroying custom attachments */ // necessary for conformance with Attachment - def withPos(pos: scala.reflect.api.Position) = pos + def withPos(newPos: scala.reflect.api.Position): scala.reflect.api.Attachment = newPos + + /** Exposes itself as payload of Attachment */ + // necessary for conformance with Attachment + def payload: Position = this + + /** A bit weird method that is necessary to safely update positions without destroying custom attachments */ + // necessary for conformance with Attachment + def withPayload(newPos: Any): scala.reflect.api.Attachment = newPos.asInstanceOf[Position] /** Java file corresponding to the source file of this position. */ |