Dotty Documentation

0.14.0-bin-SNAPSHOT

abstract class Positioned
extends Object with Product with Cloneable

A base class for things that have positions (currently: modifiers and trees)

[-] Constructors

Positioned ( )
Positioned ( implicit src: SourceFile )

[-] Members

[+] private var mySpan : Span
[+] private var myUniqueId : Int
[+] @constructorOnly private implicit val src : SourceFile
[+] def checkPos ( nonOverlapping: Boolean ) ( implicit ctx: Context ) : Unit

Check that all positioned items in this tree satisfy the following conditions: - Parent spans contain child spans - If item is a non-empty tree, it has a position

[+] def cloneIn ( src: SourceFile ) : Positioned

Clone this node but assign it a fresh id which marks it as a node in file.

[+] def contains ( that: Positioned ) : Boolean
[+] def envelope ( src: SourceFile , startSpan: Span ) : Span

The union of startSpan and the spans of all positioned children that have the same source as this node, except that Inlined nodes only consider their call child.

Side effect: Any descendants without spans have but with the same source as this node have their span set to the end position of the envelope of all children to the left, or, if that one does not exist, to the start position of the envelope of all children to the right.

[+] def envelope$default$2 : Span

The union of startSpan and the spans of all positioned children that have the same source as this node, except that Inlined nodes only consider their call child.

Side effect: Any descendants without spans have but with the same source as this node have their span set to the end position of the envelope of all children to the left, or, if that one does not exist, to the start position of the envelope of all children to the right.

[+] def source : SourceFile
[+] def sourcePos ( implicit ctx: Context ) : SourcePosition
[+] def span : Span

The span part of the item's position

[+] def span_= ( span: Span ) : Unit
[+] def uniqueId : Int

A unique identifier. Among other things, used for determining the source file component of the position.

[+] def uniqueId_= ( id: Int ) : Unit
[+] def withSpan ( span: Span ) : Positioned

A positioned item like this one with given span. If the positioned item is source-derived, a clone is returned. If the positioned item is synthetic, the position is updated destructively and the item itself is returned.