identityType<T> function

Type identityType<T>()

Identity function for a Type.

This can be used in situations where a type literal is syntactically invalid.

Example:

x.runtimeType == int?; // Compile-time error due to invalid syntax.
x.runtimeType == identityType<int?>();

Implementation

Type identityType<T>() => T;