diff options
Diffstat (limited to 'src/reflect/scala/reflect/internal/StdAttachments.scala')
-rw-r--r-- | src/reflect/scala/reflect/internal/StdAttachments.scala | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/reflect/scala/reflect/internal/StdAttachments.scala b/src/reflect/scala/reflect/internal/StdAttachments.scala index 139a79ffe1..614e71b597 100644 --- a/src/reflect/scala/reflect/internal/StdAttachments.scala +++ b/src/reflect/scala/reflect/internal/StdAttachments.scala @@ -22,6 +22,16 @@ trait StdAttachments { def setPos(newpos: Position): this.type = { pos = newpos; this } } + /** Attachment that knows how to import itself into another universe. */ + trait ImportableAttachment { + def importAttachment(importer: Importer): this.type + } + + /** Attachment that doesn't contain any reflection artificats and can be imported as-is. */ + trait PlainAttachment extends ImportableAttachment { + def importAttachment(importer: Importer): this.type = this + } + /** Stores the trees that give rise to a refined type to be used in reification. * Unfortunately typed `CompoundTypeTree` is lacking essential info, and the reifier cannot use `CompoundTypeTree.tpe`. * Therefore we need this hack (see `Reshape.toPreTyperTypeTree` for a detailed explanation). |