[dart2js] Add support for Never as a type literal.

Change-Id: Ia543f33619ce46e42a6ac5d0b2d19f44b32525b2
Bug: https://github.com/dart-lang/sdk/issues/42344
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151461
Commit-Queue: Mayank Patke <fishythefish@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
This commit is contained in:
Mayank Patke 2020-06-19 23:17:47 +00:00 committed by commit-bot@chromium.org
parent 6c593ac117
commit f2f3a256b4
2 changed files with 2 additions and 0 deletions

View file

@ -1614,6 +1614,7 @@ class Namer extends ModularNamer {
String getTypeRepresentationForTypeConstant(DartType type) {
type = type.withoutNullability;
if (type is DynamicType) return "dynamic";
if (type is NeverType) return "Never";
if (type is FutureOrType) {
return "FutureOr<dynamic>";
}

View file

@ -3251,6 +3251,7 @@ class KernelSsaGraphBuilder extends ir.Visitor {
ir.DartType type = node.type;
if (type is ir.InterfaceType ||
type is ir.DynamicType ||
type is ir.NeverType ||
type is ir.TypedefType ||
type is ir.FunctionType ||
type is ir.FutureOrType) {