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

Side by Side Diff: pkg/front_end/lib/src/fasta/kernel/kernel_shadow_ast.dart

Issue 2992263002: Implement type inference for super initializers. (Closed)
Patch Set: Created 3 years, 4 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
OLDNEW
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2017, 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 /// This file declares a "shadow hierarchy" of concrete classes which extend 5 /// This file declares a "shadow hierarchy" of concrete classes which extend
6 /// the kernel class hierarchy, adding methods and fields needed by the 6 /// the kernel class hierarchy, adding methods and fields needed by the
7 /// BodyBuilder. 7 /// BodyBuilder.
8 /// 8 ///
9 /// Instances of these classes may be created using the factory methods in 9 /// Instances of these classes may be created using the factory methods in
10 /// `ast_factory.dart`. 10 /// `ast_factory.dart`.
(...skipping 1788 matching lines...) Expand 10 before | Expand all | Expand 10 after
1799 KernelTypeInferrer inferrer, DartType typeContext, bool typeNeeded) { 1799 KernelTypeInferrer inferrer, DartType typeContext, bool typeNeeded) {
1800 typeNeeded = 1800 typeNeeded =
1801 inferrer.listener.stringLiteralEnter(this, typeContext) || typeNeeded; 1801 inferrer.listener.stringLiteralEnter(this, typeContext) || typeNeeded;
1802 var inferredType = 1802 var inferredType =
1803 typeNeeded ? inferrer.coreTypes.stringClass.rawType : null; 1803 typeNeeded ? inferrer.coreTypes.stringClass.rawType : null;
1804 inferrer.listener.stringLiteralExit(this, inferredType); 1804 inferrer.listener.stringLiteralExit(this, inferredType);
1805 return inferredType; 1805 return inferredType;
1806 } 1806 }
1807 } 1807 }
1808 1808
1809 /// Concrete shadow object representing a super initializer in kernel form.
1810 class KernelSuperInitializer extends SuperInitializer
1811 implements KernelInitializer {
1812 KernelSuperInitializer(Constructor target, Arguments arguments)
1813 : super(target, arguments);
1814
1815 @override
1816 void _inferInitializer(KernelTypeInferrer inferrer) {
1817 inferrer.listener.superInitializerEnter(this);
1818 inferrer.inferInvocation(null, false, fileOffset,
1819 target.function.functionType, target.enclosingClass.thisType, arguments,
1820 skipTypeArgumentInference: true);
1821 inferrer.listener.superInitializerExit(this);
1822 }
1823 }
1824
1809 /// Shadow object for [SuperMethodInvocation]. 1825 /// Shadow object for [SuperMethodInvocation].
1810 class KernelSuperMethodInvocation extends SuperMethodInvocation 1826 class KernelSuperMethodInvocation extends SuperMethodInvocation
1811 implements KernelExpression { 1827 implements KernelExpression {
1812 KernelSuperMethodInvocation(Name name, Arguments arguments, 1828 KernelSuperMethodInvocation(Name name, Arguments arguments,
1813 [Procedure interfaceTarget]) 1829 [Procedure interfaceTarget])
1814 : super(name, arguments, interfaceTarget); 1830 : super(name, arguments, interfaceTarget);
1815 1831
1816 @override 1832 @override
1817 void _collectDependencies(KernelDependencyCollector collector) { 1833 void _collectDependencies(KernelDependencyCollector collector) {
1818 // Super expressions should never occur in top level type inference. 1834 // Super expressions should never occur in top level type inference.
(...skipping 609 matching lines...) Expand 10 before | Expand all | Expand 10 after
2428 accept(v) => unsupported("accept", -1, null); 2444 accept(v) => unsupported("accept", -1, null);
2429 2445
2430 accept1(v, arg) => unsupported("accept1", -1, null); 2446 accept1(v, arg) => unsupported("accept1", -1, null);
2431 2447
2432 getStaticType(types) => unsupported("getStaticType", -1, null); 2448 getStaticType(types) => unsupported("getStaticType", -1, null);
2433 2449
2434 transformChildren(v) => unsupported("transformChildren", -1, null); 2450 transformChildren(v) => unsupported("transformChildren", -1, null);
2435 2451
2436 visitChildren(v) => unsupported("visitChildren", -1, null); 2452 visitChildren(v) => unsupported("visitChildren", -1, null);
2437 } 2453 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698