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

Unified Diff: pkg/compiler/lib/src/kernel/element_map_impl.dart

Issue 2983483002: Check function type equivalence (Closed)
Patch Set: Created 3 years, 5 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
« no previous file with comments | « pkg/compiler/lib/src/elements/types.dart ('k') | pkg/compiler/lib/src/resolution/resolution_strategy.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/kernel/element_map_impl.dart
diff --git a/pkg/compiler/lib/src/kernel/element_map_impl.dart b/pkg/compiler/lib/src/kernel/element_map_impl.dart
index d553e1666f50de4b98d1b128c8aeeb77d7483520..a24d94fcc0e7cb5a9d7c85285aec31c7fe229c9b 100644
--- a/pkg/compiler/lib/src/kernel/element_map_impl.dart
+++ b/pkg/compiler/lib/src/kernel/element_map_impl.dart
@@ -419,7 +419,14 @@ abstract class KernelToElementMapBase extends KernelToElementMapBaseMixin {
@override
FunctionType getFunctionType(ir.FunctionNode node) {
- DartType returnType = getDartType(node.returnType);
+ DartType returnType;
+ if (node.parent is ir.Constructor) {
+ // The return type on generative constructors is `void`, but we need
+ // `dynamic` type to match the element model.
+ returnType = const DynamicType();
+ } else {
+ returnType = getDartType(node.returnType);
+ }
List<DartType> parameterTypes = /*<DartType>*/ [];
List<DartType> optionalParameterTypes = /*<DartType>*/ [];
for (ir.VariableDeclaration variable in node.positionalParameters) {
« no previous file with comments | « pkg/compiler/lib/src/elements/types.dart ('k') | pkg/compiler/lib/src/resolution/resolution_strategy.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698