@Peter von der Ahé
Not want to argue with you. Oh, my bad knowledge of English.
Just sample code.
1. Scenario when the type has no arguments. "List" is type literal.
a. Compilation
// var type = core_patch.runtimeTypes[const Symbol("dart.core.List")]
var type = List;
b. VM runtime
// core_patch.runtimeTypes[const const Symbol("dart.core.List")] = core_patch.runtimeTypes[const const Symbol("dart.core.List")]
new List().runtimeType == List // must be true
2. Scenario when type has arguments. "List<String, int>" is type literal.
a. Compilation
// var type = core_patch.runtimeTypes[const Symbol("dart.core.List<dart.core.String,
dart.core.int>")]
var type = typeof(List<String, int>);
b. VM runtime
// var type = runtimeTypes[const const Symbol("dart.core.List<dart.core.String,
dart.core.int>")]
var type = typeof(List<String, int>);
// runtimeTypes[const Symbol("dart.core.List<dart.core.String,
dart.core.int>")] = runtimeTypes[const Symbol("dart.core.List<dart.core.String,
dart.core.int>")]
new List<String, int>().runtimeType == typeof(List<String, int>) // must be true
P.S.
The "reflectType" can reflect only types without arguments because it just a method invocation and thus it cannot take as the parameter type with an arguments because this code cannot be compiled.
reflectType(Foo<String, int>); // Won't compile
The "typeof" operator is a language construction and it intended to work with type literals.
typeof: 'typeof' '(' typeLiteral ')'
No parsing problem (annoying) to parse "typeof" operator.
Waht is "new TypeArgument<Foo<String, int>>()" I not understand.