Skip to content

Commit 9a4da9d

Browse files
authored
Fix code sample in reflection overview
The code as is (`ru.typeOf[Person].decls(ru.nme.CONSTRUCTOR).asMethod`) gives an error: "reflect.runtime.universe.MemberScope does not take parameters"
1 parent 0cf9f94 commit 9a4da9d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

_overviews/reflection/overview.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ The second step involves obtaining a `ClassMirror` for class `Person` using
132132
the `reflectClass` method. The `ClassMirror` provides access to the
133133
constructor of class `Person`.
134134

135-
scala> val ctor = ru.typeOf[Person].decls(ru.nme.CONSTRUCTOR).asMethod
135+
scala> val ctor = ru.typeOf[Person].declaration(ru.nme.CONSTRUCTOR).asMethod
136136
ctor: scala.reflect.runtime.universe.MethodSymbol = constructor Person
137137

138138
The symbol for `Person`s constructor can be obtained using only the runtime

0 commit comments

Comments
 (0)