@@ -677,23 +677,41 @@ object Trees {
677
677
override def isType = expansion.isType
678
678
}
679
679
680
- /** A tree representing a quote `'{ expr }
680
+ /** A tree representing a quote `'{ expr }`
681
+ * `Quote`s are created by the `Parser` with an empty `tpt`. In typer
682
+ * they can be typed as a `Quote` with a known `tpt` or desugared and
683
+ * typed as a quote pattern.
684
+ *
685
+ * `Quotes` are checked transformed in the `staging`, `splicing` and `pickleQuotes`
686
+ * phases. After `pickleQuotes` phase, the only quotes that exist are in `inline`
687
+ * methods. These are dropped when we remove the inline method implementations.
688
+ *
689
+ * The `tpt` will be transformed in `staging` and used in `pickleQuotes` to create the
690
+ * pickled representation of the quote.
681
691
*
682
692
* @param expr The tree that was quoted
683
- * @param tpt The type of the tree that was quoted,
684
- * EmptyTree if this tree comes from the parser.
693
+ * @param tpt The type of the tree that was quoted
685
694
*/
686
695
case class Quote [+ T <: Untyped ] private [ast] (expr : Tree [T ], tpt : Tree [T ])(implicit @ constructorOnly src : SourceFile )
687
696
extends TermTree [T ] {
688
697
type ThisTree [+ T <: Untyped ] = Quote [T ]
689
698
}
690
699
691
700
/** A tree representing a splice `${ expr }`
692
- *
693
- * @param expr The tree that was spliced
694
- * @param tpt The type of the tree that was spliced,
695
- * EmptyTree if this tree comes from the parser.
696
- */
701
+ *
702
+ * `Splice`s are created by the `Parser` with an empty `tpt`. In typer
703
+ * they can be typed as a `Splice` with a known `tpt` or desugared and
704
+ * typed as a quote pattern holes.
705
+ *
706
+ * `Splice` are checked transformed in the `staging` and `splicing` phases.
707
+ * After `splicing` phase, the only quotes that exist are in `inline`
708
+ * methods. These are dropped when we remove the inline method implementations.
709
+ *
710
+ * The `tpt` will be transformed in `staging` and used in `splicing` to create `Hole`s.
711
+ *
712
+ * @param expr The tree that was spliced
713
+ * @param tpt The type of the spliced tree
714
+ */
697
715
case class Splice [+ T <: Untyped ] private [ast] (expr : Tree [T ], tpt : Tree [T ])(implicit @ constructorOnly src : SourceFile )
698
716
extends TermTree [T ] {
699
717
type ThisTree [+ T <: Untyped ] = Splice [T ]
0 commit comments