Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(263)

Unified Diff: pkg/compiler/lib/src/ssa/kernel_ast_adapter.dart

Issue 2908253003: Handle null literal in compile_from_dill (Closed)
Patch Set: Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: pkg/compiler/lib/src/ssa/kernel_ast_adapter.dart
diff --git a/pkg/compiler/lib/src/ssa/kernel_ast_adapter.dart b/pkg/compiler/lib/src/ssa/kernel_ast_adapter.dart
index fc47021cd798faef63f692f913f16019d529f557..49b44a7a7bf5fd56cfbfda6bb8808a94e490f07d 100644
--- a/pkg/compiler/lib/src/ssa/kernel_ast_adapter.dart
+++ b/pkg/compiler/lib/src/ssa/kernel_ast_adapter.dart
@@ -364,14 +364,9 @@ class KernelAstAdapter extends KernelToElementMapMixin {
.mapType(getDartType(literal.keyType), getDartType(literal.valueType));
}
- ResolutionDartType getFunctionReturnType(ir.FunctionNode node) {
- if (node.returnType is ir.InvalidType) return const ResolutionDynamicType();
- return getDartType(node.returnType);
- }
-
/// Computes the function type corresponding the signature of [node].
ResolutionFunctionType getFunctionType(ir.FunctionNode node) {
- ResolutionDartType returnType = getFunctionReturnType(node);
+ ResolutionDartType returnType = getDartType(node.returnType);
List<ResolutionDartType> parameterTypes = <ResolutionDartType>[];
List<ResolutionDartType> optionalParameterTypes = <ResolutionDartType>[];
for (ir.VariableDeclaration variable in node.positionalParameters) {
@@ -494,11 +489,8 @@ class DartTypeConverter extends ir.DartTypeVisitor<ResolutionDartType> {
@override
ResolutionDartType visitInvalidType(ir.InvalidType node) {
- if (topLevel) {
- throw new UnimplementedError(
- "Outermost invalid types not currently supported");
- }
- // Nested invalid types are treated as `dynamic`.
+ // Root uses such a `o is Unresolved` and `o as Unresolved` must be special
+ // cased in the builder, nested invalid types are treated as `dynamic`.
return const ResolutionDynamicType();
}
}

Powered by Google App Engine
This is Rietveld 408576698