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

Side by Side Diff: pkg/analyzer/lib/src/dart/constant/evaluation.dart

Issue 2837743002: Issue 29432. Instantiate the redirect constructor with the in-scope type arguments. (Closed)
Patch Set: Created 3 years, 8 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 unified diff | Download patch
« no previous file with comments | « no previous file | pkg/analyzer/test/generated/compile_time_error_code_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library analyzer.src.dart.constant.evaluation; 5 library analyzer.src.dart.constant.evaluation;
6 6
7 import 'dart:collection'; 7 import 'dart:collection';
8 8
9 import 'package:analyzer/context/declared_variables.dart'; 9 import 'package:analyzer/context/declared_variables.dart';
10 import 'package:analyzer/dart/ast/ast.dart'; 10 import 'package:analyzer/dart/ast/ast.dart';
(...skipping 722 matching lines...) Expand 10 before | Expand all | Expand 10 after
733 SimpleIdentifier name = initializer.constructorName; 733 SimpleIdentifier name = initializer.constructorName;
734 if (name != null) { 734 if (name != null) {
735 superName = name.name; 735 superName = name.name;
736 } 736 }
737 superArguments = initializer.argumentList.arguments; 737 superArguments = initializer.argumentList.arguments;
738 } else if (initializer is RedirectingConstructorInvocation) { 738 } else if (initializer is RedirectingConstructorInvocation) {
739 // This is a redirecting constructor, so just evaluate the constructor 739 // This is a redirecting constructor, so just evaluate the constructor
740 // it redirects to. 740 // it redirects to.
741 ConstructorElement constructor = initializer.staticElement; 741 ConstructorElement constructor = initializer.staticElement;
742 if (constructor != null && constructor.isConst) { 742 if (constructor != null && constructor.isConst) {
743 // Instantiate the constructor with the in-scope type arguments.
744 constructor = ConstructorMember.from(constructor, definingClass);
745
743 DartObjectImpl result = evaluateConstructorCall( 746 DartObjectImpl result = evaluateConstructorCall(
744 node, 747 node,
745 initializer.argumentList.arguments, 748 initializer.argumentList.arguments,
746 constructor, 749 constructor,
747 initializerVisitor, 750 initializerVisitor,
748 externalErrorReporter, 751 externalErrorReporter,
749 invocation: invocation); 752 invocation: invocation);
750 reportLocalErrorForRecordedExternalErrors(); 753 reportLocalErrorForRecordedExternalErrors();
751 return result; 754 return result;
752 } 755 }
(...skipping 1374 matching lines...) Expand 10 before | Expand all | Expand 10 after
2127 } 2130 }
2128 2131
2129 @override 2132 @override
2130 String toString() { 2133 String toString() {
2131 if (value == null) { 2134 if (value == null) {
2132 return "error"; 2135 return "error";
2133 } 2136 }
2134 return value.toString(); 2137 return value.toString();
2135 } 2138 }
2136 } 2139 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer/test/generated/compile_time_error_code_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698