File tree Expand file tree Collapse file tree 1 file changed +14
-4
lines changed
library/src/scala/tasty/reflect Expand file tree Collapse file tree 1 file changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -241,12 +241,22 @@ trait TreeOps extends Core {
241241
242242 object Ref {
243243
244- /** Create a reference tree */
244+ /** Create a reference tree from a symbol
245+ *
246+ * If `sym` refers to a class member `foo` in class `C`,
247+ * returns a tree representing `C.this.foo`.
248+ *
249+ * If `sym` refers to a local definition `foo`, returns
250+ * a tree representing `foo`.
251+ *
252+ * @note In both cases, the constructed tree should only
253+ * be spliced into the places where such accesses make sense.
254+ * For example, it is incorrect to have `C.this.foo` outside
255+ * the class body of `C`, or have `foo` outside the lexical
256+ * scope for the definition of `foo`.
257+ */
245258 def apply (sym : Symbol )(given ctx : Context ): Ref =
246259 internal.Ref_apply (sym)
247-
248- // TODO def copy(original: Tree)(name: String)(given ctx: Context): Ref
249-
250260 }
251261
252262 given (given Context ): IsInstanceOf [Ident ] = internal.isInstanceOfIdent
You can’t perform that action at this time.
0 commit comments