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

Side by Side Diff: pkg/compiler/lib/src/resolution/semantic_visitor.dart

Issue 1161823004: Handle .fromEnvironment and incompatible constructor invocations (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 6 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) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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 dart2js.semantics_visitor; 5 library dart2js.semantics_visitor;
6 6
7 import '../constants/expressions.dart'; 7 import '../constants/expressions.dart';
8 import '../dart2jslib.dart' show invariant, MessageKind; 8 import '../dart2jslib.dart' show invariant, MessageKind;
9 import '../dart_types.dart'; 9 import '../dart_types.dart';
10 import '../elements/elements.dart'; 10 import '../elements/elements.dart';
(...skipping 3795 matching lines...) Expand 10 before | Expand all | Expand 10 after
3806 3806
3807 /// Invocation of an undefined unary [operator] with operands 3807 /// Invocation of an undefined unary [operator] with operands
3808 /// [left] and [right]. 3808 /// [left] and [right].
3809 R errorUndefinedBinaryExpression( 3809 R errorUndefinedBinaryExpression(
3810 Send node, 3810 Send node,
3811 Node left, 3811 Node left,
3812 Operator operator, 3812 Operator operator,
3813 Node right, 3813 Node right,
3814 A arg); 3814 A arg);
3815 3815
3816 /// Const invocation of a [constructor]. 3816 /// Const invocation of a [constant] constructor.
3817 /// 3817 ///
3818 /// For instance 3818 /// For instance
3819 /// class C<T> { 3819 /// class C<T> {
3820 /// const C(a, b); 3820 /// const C(a, b);
3821 /// } 3821 /// }
3822 /// m() => const C<int>(true, 42); 3822 /// m() => const C<int>(true, 42);
3823 /// 3823 ///
3824 R visitConstConstructorInvoke( 3824 R visitConstConstructorInvoke(
3825 NewExpression node, 3825 NewExpression node,
3826 ConstructedConstantExpression constant, 3826 ConstructedConstantExpression constant,
3827 A arg); 3827 A arg);
3828 3828
3829 /// Const invocation of the `bool.fromEnvironment` constructor.
3830 ///
3831 /// For instance
3832 /// m() => const bool.fromEnvironment('foo', defaultValue: false);
3833 ///
3834 R visitBoolFromEnvironmentConstructorInvoke(
3835 NewExpression node,
3836 BoolFromEnvironmentConstantExpression constant,
3837 A arg);
3838
3839 /// Const invocation of the `int.fromEnvironment` constructor.
3840 ///
3841 /// For instance
3842 /// m() => const int.fromEnvironment('foo', defaultValue: 42);
3843 ///
3844 R visitIntFromEnvironmentConstructorInvoke(
3845 NewExpression node,
3846 IntFromEnvironmentConstantExpression constant,
3847 A arg);
3848
3849 /// Const invocation of the `String.fromEnvironment` constructor.
3850 ///
3851 /// For instance
3852 /// m() => const String.fromEnvironment('foo', defaultValue: 'bar');
3853 ///
3854 R visitStringFromEnvironmentConstructorInvoke(
3855 NewExpression node,
3856 StringFromEnvironmentConstantExpression constant,
3857 A arg);
3858
3829 /// Invocation of a generative [constructor] on [type] with [arguments]. 3859 /// Invocation of a generative [constructor] on [type] with [arguments].
3830 /// 3860 ///
3831 /// For instance 3861 /// For instance
3832 /// class C<T> { 3862 /// class C<T> {
3833 /// C(a, b); 3863 /// C(a, b);
3834 /// } 3864 /// }
3835 /// m() => new C<int>(true, 42); 3865 /// m() => new C<int>(true, 42);
3836 /// 3866 ///
3837 /// where [type] is `C<int>`. 3867 /// where [type] is `C<int>`.
3838 /// 3868 ///
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
3988 /// m1() => new C(true, 42); 4018 /// m1() => new C(true, 42);
3989 /// m2() => new C.a(true, 42); 4019 /// m2() => new C.a(true, 42);
3990 /// 4020 ///
3991 R visitUnresolvedRedirectingFactoryConstructorInvoke( 4021 R visitUnresolvedRedirectingFactoryConstructorInvoke(
3992 NewExpression node, 4022 NewExpression node,
3993 ConstructorElement constructor, 4023 ConstructorElement constructor,
3994 InterfaceType type, 4024 InterfaceType type,
3995 NodeList arguments, 4025 NodeList arguments,
3996 CallStructure callStructure, 4026 CallStructure callStructure,
3997 A arg); 4027 A arg);
4028
4029 /// Invocation of [constructor] on [type] with incompatible [arguments].
4030 ///
4031 /// For instance
4032 /// class C {
4033 /// C(a);
4034 /// }
4035 /// m() => C(true, 42);
4036 ///
4037 R visitConstructorIncompatibleInvoke(
4038 NewExpression node,
4039 ConstructorElement constructor,
4040 InterfaceType type,
4041 NodeList arguments,
4042 CallStructure callStructure,
4043 A arg);
3998 } 4044 }
3999 4045
4000 abstract class SemanticDeclarationVisitor<R, A> { 4046 abstract class SemanticDeclarationVisitor<R, A> {
4001 R apply(Node node, A arg); 4047 R apply(Node node, A arg);
4002 4048
4003 /// Apply this visitor to the [parameters]. 4049 /// Apply this visitor to the [parameters].
4004 applyParameters(NodeList parameters, A arg); 4050 applyParameters(NodeList parameters, A arg);
4005 4051
4006 /// Apply this visitor to the initializers of [constructor]. 4052 /// Apply this visitor to the initializers of [constructor].
4007 applyInitializers(FunctionExpression constructor, A arg); 4053 applyInitializers(FunctionExpression constructor, A arg);
(...skipping 551 matching lines...) Expand 10 before | Expand all | Expand 10 after
4559 /// C() : this._(42); 4605 /// C() : this._(42);
4560 /// } 4606 /// }
4561 /// 4607 ///
4562 R errorUnresolvedThisConstructorInvoke( 4608 R errorUnresolvedThisConstructorInvoke(
4563 Send node, 4609 Send node,
4564 Element element, 4610 Element element,
4565 NodeList arguments, 4611 NodeList arguments,
4566 Selector selector, 4612 Selector selector,
4567 A arg); 4613 A arg);
4568 } 4614 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698