Must dynamically construct a symbol to access a named constructor with mirrors #13248
Labels
area-core-library
SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries.
library-mirrors
type-bug
Incorrect behavior (everything from a crash to more subtle misbehavior)
The [ClassMirror.constructors] map indexes named constructors with symbols like "Foo" and "Foo.named". This means that if you statically know the name of the constructor you want but not the name of the class itself, you need to dynamically construct a symbol to reflect on that constructor (e.g.
new Symbol("${MirrorSystem.getName(mirror.simpleName)}.named")
).Contrast this with [ClassMirror.newInstance], which refers to constructors using symbols that don't include the class name.
The text was updated successfully, but these errors were encountered: