Skip to content

Fix Typo: decls to decl + Upgrad from deprecated API usage #934

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions _overviews/reflection/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ The second step involves obtaining a `ClassMirror` for class `Person` using
the `reflectClass` method. The `ClassMirror` provides access to the
constructor of class `Person`.

scala> val ctor = ru.typeOf[Person].decls(ru.nme.CONSTRUCTOR).asMethod
scala> val ctor = ru.typeOf[Person].decl(ru.termNames.CONSTRUCTOR).asMethod
ctor: scala.reflect.runtime.universe.MethodSymbol = constructor Person

The symbol for `Person`s constructor can be obtained using only the runtime
Expand Down Expand Up @@ -171,7 +171,7 @@ which makes all classes and types available that are loaded by the classloader
that also loaded the class of `p` (`Purchase`), which we need in order to
access member `shipped`.

scala> val shippingTermSymb = ru.typeOf[Purchase].decls(ru.TermName("shipped")).asTerm
scala> val shippingTermSymb = ru.typeOf[Purchase].decl(ru.TermName("shipped")).asTerm
shippingTermSymb: scala.reflect.runtime.universe.TermSymbol = method shipped

We now look up the declaration of the `shipped` field, which gives us a
Expand Down