GenericConstructorFactory typedef

GenericConstructorFactory = Object? Function(InterpreterVisitor visitor, List<Object?> positionalArgs, Map<String, Object?> namedArgs, List<RuntimeType>? typeArguments)

RC-2: Factory for constructing generic bridged classes with type arguments.

When a D4rt script calls GlobalKey<NavigatorState>(), the type argument is evaluated at runtime but Dart requires compile-time generic types. This factory receives the evaluated RuntimeType list and dispatches to the correct statically-typed constructor.

The visitor is the current interpreter context. positionalArgs and namedArgs are the converted arguments. typeArguments are the evaluated type arguments from the script, or null when called without type arguments (constructor override).

Implementation

typedef GenericConstructorFactory =
    Object? Function(
      InterpreterVisitor visitor,
      List<Object?> positionalArgs,
      Map<String, Object?> namedArgs,
      List<RuntimeType>? typeArguments,
    );