File tree 1 file changed +14
-4
lines changed
library/src/scala/tasty/reflect
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 {
241
241
242
242
object Ref {
243
243
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
+ */
245
258
def apply (sym : Symbol )(given ctx : Context ): Ref =
246
259
internal.Ref_apply (sym)
247
-
248
- // TODO def copy(original: Tree)(name: String)(given ctx: Context): Ref
249
-
250
260
}
251
261
252
262
given (given Context ): IsInstanceOf [Ident ] = internal.isInstanceOfIdent
You can’t perform that action at this time.
0 commit comments