operator [] method

dynamic operator [](
  1. Type type
)

Gets a replica object for type.

Callers typically invoke this method, passing their runtimeType in order to retrieve their replica object.

It is important to note that a replica object must exist for every class that extends a class that has a replica. Use MirrorContext.getSubclassesOf when compiling.

In other words, if the type Base has a replica and the type Subclass extends Base, Subclass must also have a replica. The replica objects for both Subclass and Base must be the same type.

Implementation

dynamic operator [](Type type) => replicas![type];