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

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

Issue 2603263002: Prefix resolution_types with Resolution. (Closed)
Patch Set: Rebased Created 3 years, 11 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 '../common.dart'; 7 import '../common.dart';
8 import '../constants/expressions.dart'; 8 import '../constants/expressions.dart';
9 import '../elements/resolution_types.dart'; 9 import '../elements/resolution_types.dart';
10 import '../elements/elements.dart'; 10 import '../elements/elements.dart';
(...skipping 1413 matching lines...) Expand 10 before | Expand all | Expand 10 after
1424 /// 1424 ///
1425 R visitLogicalOr(Send node, Node left, Node right, A arg); 1425 R visitLogicalOr(Send node, Node left, Node right, A arg);
1426 1426
1427 /// Is test of [expression] against [type]. 1427 /// Is test of [expression] against [type].
1428 /// 1428 ///
1429 /// For instance: 1429 /// For instance:
1430 /// 1430 ///
1431 /// class C {} 1431 /// class C {}
1432 /// m() => expression is C; 1432 /// m() => expression is C;
1433 /// 1433 ///
1434 R visitIs(Send node, Node expression, DartType type, A arg); 1434 R visitIs(Send node, Node expression, ResolutionDartType type, A arg);
1435 1435
1436 /// Is not test of [expression] against [type]. 1436 /// Is not test of [expression] against [type].
1437 /// 1437 ///
1438 /// For instance: 1438 /// For instance:
1439 /// 1439 ///
1440 /// class C {} 1440 /// class C {}
1441 /// m() => expression is! C; 1441 /// m() => expression is! C;
1442 /// 1442 ///
1443 R visitIsNot(Send node, Node expression, DartType type, A arg); 1443 R visitIsNot(Send node, Node expression, ResolutionDartType type, A arg);
1444 1444
1445 /// As cast of [expression] to [type]. 1445 /// As cast of [expression] to [type].
1446 /// 1446 ///
1447 /// For instance: 1447 /// For instance:
1448 /// 1448 ///
1449 /// class C {} 1449 /// class C {}
1450 /// m() => expression as C; 1450 /// m() => expression as C;
1451 /// 1451 ///
1452 R visitAs(Send node, Node expression, DartType type, A arg); 1452 R visitAs(Send node, Node expression, ResolutionDartType type, A arg);
1453 1453
1454 /// Compound assignment expression of [rhs] with [operator] of the property on 1454 /// Compound assignment expression of [rhs] with [operator] of the property on
1455 /// [receiver] whose getter and setter are defined by [getterSelector] and 1455 /// [receiver] whose getter and setter are defined by [getterSelector] and
1456 /// [setterSelector], respectively. 1456 /// [setterSelector], respectively.
1457 /// 1457 ///
1458 /// For instance: 1458 /// For instance:
1459 /// 1459 ///
1460 /// m(receiver, rhs) => receiver.foo += rhs; 1460 /// m(receiver, rhs) => receiver.foo += rhs;
1461 /// 1461 ///
1462 R visitDynamicPropertyCompound(Send node, Node receiver, Name name, 1462 R visitDynamicPropertyCompound(Send node, Node receiver, Name name,
(...skipping 758 matching lines...) Expand 10 before | Expand all | Expand 10 after
2221 /// For instance: 2221 /// For instance:
2222 /// 2222 ///
2223 /// typedef F(); 2223 /// typedef F();
2224 /// m(rhs) => F ??= rhs; 2224 /// m(rhs) => F ??= rhs;
2225 /// 2225 ///
2226 R visitTypedefTypeLiteralSetIfNull( 2226 R visitTypedefTypeLiteralSetIfNull(
2227 Send node, ConstantExpression constant, Node rhs, A arg); 2227 Send node, ConstantExpression constant, Node rhs, A arg);
2228 2228
2229 /// If-null assignment expression of [rhs] to the type literal for the type 2229 /// If-null assignment expression of [rhs] to the type literal for the type
2230 /// variable [element]. That is, [rhs] is only evaluated and assigned, if 2230 /// variable [element]. That is, [rhs] is only evaluated and assigned, if
2231 /// the value is of the [element] is `null`. The behavior is thus equivalent t o 2231 /// the value is of the [element] is `null`. The behavior is thus equivalent
2232 /// a type literal access. 2232 /// to a type literal access.
2233 /// 2233 ///
2234 /// For instance: 2234 /// For instance:
2235 /// 2235 ///
2236 /// class C<T> { 2236 /// class C<T> {
2237 /// m(rhs) => T ??= rhs; 2237 /// m(rhs) => T ??= rhs;
2238 /// } 2238 /// }
2239 /// 2239 ///
2240 R visitTypeVariableTypeLiteralSetIfNull( 2240 R visitTypeVariableTypeLiteralSetIfNull(
2241 Send node, TypeVariableElement element, Node rhs, A arg); 2241 Send node, TypeVariableElement element, Node rhs, A arg);
2242 2242
(...skipping 1617 matching lines...) Expand 10 before | Expand all | Expand 10 after
3860 /// class C<T> { 3860 /// class C<T> {
3861 /// C(a, b); 3861 /// C(a, b);
3862 /// } 3862 /// }
3863 /// m() => new C<int>(true, 42); 3863 /// m() => new C<int>(true, 42);
3864 /// 3864 ///
3865 /// where [type] is `C<int>`. 3865 /// where [type] is `C<int>`.
3866 /// 3866 ///
3867 R visitGenerativeConstructorInvoke( 3867 R visitGenerativeConstructorInvoke(
3868 NewExpression node, 3868 NewExpression node,
3869 ConstructorElement constructor, 3869 ConstructorElement constructor,
3870 InterfaceType type, 3870 ResolutionInterfaceType type,
3871 NodeList arguments, 3871 NodeList arguments,
3872 CallStructure callStructure, 3872 CallStructure callStructure,
3873 A arg); 3873 A arg);
3874 3874
3875 /// Invocation of a redirecting generative [constructor] on [type] with 3875 /// Invocation of a redirecting generative [constructor] on [type] with
3876 /// [arguments]. 3876 /// [arguments].
3877 /// 3877 ///
3878 /// For instance: 3878 /// For instance:
3879 /// 3879 ///
3880 /// class C<T> { 3880 /// class C<T> {
3881 /// C(a, b) : this._(b, a); 3881 /// C(a, b) : this._(b, a);
3882 /// C._(b, a); 3882 /// C._(b, a);
3883 /// } 3883 /// }
3884 /// m() => new C<int>(true, 42); 3884 /// m() => new C<int>(true, 42);
3885 /// 3885 ///
3886 /// where [type] is `C<int>`. 3886 /// where [type] is `C<int>`.
3887 /// 3887 ///
3888 R visitRedirectingGenerativeConstructorInvoke( 3888 R visitRedirectingGenerativeConstructorInvoke(
3889 NewExpression node, 3889 NewExpression node,
3890 ConstructorElement constructor, 3890 ConstructorElement constructor,
3891 InterfaceType type, 3891 ResolutionInterfaceType type,
3892 NodeList arguments, 3892 NodeList arguments,
3893 CallStructure callStructure, 3893 CallStructure callStructure,
3894 A arg); 3894 A arg);
3895 3895
3896 /// Invocation of a factory [constructor] on [type] with [arguments]. 3896 /// Invocation of a factory [constructor] on [type] with [arguments].
3897 /// 3897 ///
3898 /// For instance: 3898 /// For instance:
3899 /// 3899 ///
3900 /// class C<T> { 3900 /// class C<T> {
3901 /// factory C(a, b) => new C<T>._(b, a); 3901 /// factory C(a, b) => new C<T>._(b, a);
3902 /// C._(b, a); 3902 /// C._(b, a);
3903 /// } 3903 /// }
3904 /// m() => new C<int>(true, 42); 3904 /// m() => new C<int>(true, 42);
3905 /// 3905 ///
3906 /// where [type] is `C<int>`. 3906 /// where [type] is `C<int>`.
3907 /// 3907 ///
3908 R visitFactoryConstructorInvoke( 3908 R visitFactoryConstructorInvoke(
3909 NewExpression node, 3909 NewExpression node,
3910 ConstructorElement constructor, 3910 ConstructorElement constructor,
3911 InterfaceType type, 3911 ResolutionInterfaceType type,
3912 NodeList arguments, 3912 NodeList arguments,
3913 CallStructure callStructure, 3913 CallStructure callStructure,
3914 A arg); 3914 A arg);
3915 3915
3916 /// Invocation of a factory [constructor] on [type] with [arguments] where 3916 /// Invocation of a factory [constructor] on [type] with [arguments] where
3917 /// [effectiveTarget] and [effectiveTargetType] are the constructor effective 3917 /// [effectiveTarget] and [effectiveTargetType] are the constructor effective
3918 /// invoked and its type, respectively. 3918 /// invoked and its type, respectively.
3919 /// 3919 ///
3920 /// For instance: 3920 /// For instance:
3921 /// 3921 ///
3922 /// class C<T> { 3922 /// class C<T> {
3923 /// factory C(a, b) = C<int>.a; 3923 /// factory C(a, b) = C<int>.a;
3924 /// factory C.a(a, b) = C<C<T>>.b; 3924 /// factory C.a(a, b) = C<C<T>>.b;
3925 /// C.b(a, b); 3925 /// C.b(a, b);
3926 /// } 3926 /// }
3927 /// m() => new C<double>(true, 42); 3927 /// m() => new C<double>(true, 42);
3928 /// 3928 ///
3929 /// where [type] is `C<double>`, [effectiveTarget] is `C.b` and 3929 /// where [type] is `C<double>`, [effectiveTarget] is `C.b` and
3930 /// [effectiveTargetType] is `C<C<int>>`. 3930 /// [effectiveTargetType] is `C<C<int>>`.
3931 /// 3931 ///
3932 R visitRedirectingFactoryConstructorInvoke( 3932 R visitRedirectingFactoryConstructorInvoke(
3933 NewExpression node, 3933 NewExpression node,
3934 ConstructorElement constructor, 3934 ConstructorElement constructor,
3935 InterfaceType type, 3935 ResolutionInterfaceType type,
3936 ConstructorElement effectiveTarget, 3936 ConstructorElement effectiveTarget,
3937 InterfaceType effectiveTargetType, 3937 ResolutionInterfaceType effectiveTargetType,
3938 NodeList arguments, 3938 NodeList arguments,
3939 CallStructure callStructure, 3939 CallStructure callStructure,
3940 A arg); 3940 A arg);
3941 3941
3942 /// Invocation of an unresolved [constructor] on [type] with [arguments]. 3942 /// Invocation of an unresolved [constructor] on [type] with [arguments].
3943 /// 3943 ///
3944 /// For instance: 3944 /// For instance:
3945 /// 3945 ///
3946 /// class C<T> { 3946 /// class C<T> {
3947 /// C(); 3947 /// C();
3948 /// } 3948 /// }
3949 /// m() => new C<int>.unresolved(true, 42); 3949 /// m() => new C<int>.unresolved(true, 42);
3950 /// 3950 ///
3951 /// where [type] is `C<int>`. 3951 /// where [type] is `C<int>`.
3952 /// 3952 ///
3953 // TODO(johnniwinther): Change [type] to [InterfaceType] when is it not 3953 // TODO(johnniwinther): Change [type] to [InterfaceType] when is it not
3954 // `dynamic`. 3954 // `dynamic`.
3955 R visitUnresolvedConstructorInvoke(NewExpression node, Element constructor, 3955 R visitUnresolvedConstructorInvoke(NewExpression node, Element constructor,
3956 DartType type, NodeList arguments, Selector selector, A arg); 3956 ResolutionDartType type, NodeList arguments, Selector selector, A arg);
3957 3957
3958 /// Invocation of a constructor on an unresolved [type] with [arguments]. 3958 /// Invocation of a constructor on an unresolved [type] with [arguments].
3959 /// 3959 ///
3960 /// For instance: 3960 /// For instance:
3961 /// 3961 ///
3962 /// m() => new Unresolved(true, 42); 3962 /// m() => new Unresolved(true, 42);
3963 /// 3963 ///
3964 /// where [type] is the malformed type `Unresolved`. 3964 /// where [type] is the malformed type `Unresolved`.
3965 /// 3965 ///
3966 // TODO(johnniwinther): Change [type] to [MalformedType] when is it not 3966 // TODO(johnniwinther): Change [type] to [MalformedType] when is it not
3967 // `dynamic`. 3967 // `dynamic`.
3968 R visitUnresolvedClassConstructorInvoke(NewExpression node, Element element, 3968 R visitUnresolvedClassConstructorInvoke(NewExpression node, Element element,
3969 DartType type, NodeList arguments, Selector selector, A arg); 3969 ResolutionDartType type, NodeList arguments, Selector selector, A arg);
3970 3970
3971 /// Constant invocation of a non-constant constructor. 3971 /// Constant invocation of a non-constant constructor.
3972 /// 3972 ///
3973 /// For instance: 3973 /// For instance:
3974 /// 3974 ///
3975 /// class C { 3975 /// class C {
3976 /// C(a, b); 3976 /// C(a, b);
3977 /// } 3977 /// }
3978 /// m() => const C(true, 42); 3978 /// m() => const C(true, 42);
3979 /// 3979 ///
3980 R errorNonConstantConstructorInvoke(NewExpression node, Element element, 3980 R errorNonConstantConstructorInvoke(
3981 DartType type, NodeList arguments, CallStructure callStructure, A arg); 3981 NewExpression node,
3982 Element element,
3983 ResolutionDartType type,
3984 NodeList arguments,
3985 CallStructure callStructure,
3986 A arg);
3982 3987
3983 /// Invocation of a constructor on an abstract [type] with [arguments]. 3988 /// Invocation of a constructor on an abstract [type] with [arguments].
3984 /// 3989 ///
3985 /// For instance: 3990 /// For instance:
3986 /// 3991 ///
3987 /// m() => new Unresolved(true, 42); 3992 /// m() => new Unresolved(true, 42);
3988 /// 3993 ///
3989 /// where [type] is the malformed type `Unresolved`. 3994 /// where [type] is the malformed type `Unresolved`.
3990 /// 3995 ///
3991 R visitAbstractClassConstructorInvoke( 3996 R visitAbstractClassConstructorInvoke(
3992 NewExpression node, 3997 NewExpression node,
3993 ConstructorElement element, 3998 ConstructorElement element,
3994 InterfaceType type, 3999 ResolutionInterfaceType type,
3995 NodeList arguments, 4000 NodeList arguments,
3996 CallStructure callStructure, 4001 CallStructure callStructure,
3997 A arg); 4002 A arg);
3998 4003
3999 /// Invocation of a factory [constructor] on [type] with [arguments] where 4004 /// Invocation of a factory [constructor] on [type] with [arguments] where
4000 /// [effectiveTarget] and [effectiveTargetType] are the constructor effective 4005 /// [effectiveTarget] and [effectiveTargetType] are the constructor effective
4001 /// invoked and its type, respectively. 4006 /// invoked and its type, respectively.
4002 /// 4007 ///
4003 /// For instance: 4008 /// For instance:
4004 /// 4009 ///
4005 /// class C { 4010 /// class C {
4006 /// factory C(a, b) = Unresolved; 4011 /// factory C(a, b) = Unresolved;
4007 /// factory C.a(a, b) = C.unresolved; 4012 /// factory C.a(a, b) = C.unresolved;
4008 /// } 4013 /// }
4009 /// m1() => new C(true, 42); 4014 /// m1() => new C(true, 42);
4010 /// m2() => new C.a(true, 42); 4015 /// m2() => new C.a(true, 42);
4011 /// 4016 ///
4012 R visitUnresolvedRedirectingFactoryConstructorInvoke( 4017 R visitUnresolvedRedirectingFactoryConstructorInvoke(
4013 NewExpression node, 4018 NewExpression node,
4014 ConstructorElement constructor, 4019 ConstructorElement constructor,
4015 InterfaceType type, 4020 ResolutionInterfaceType type,
4016 NodeList arguments, 4021 NodeList arguments,
4017 CallStructure callStructure, 4022 CallStructure callStructure,
4018 A arg); 4023 A arg);
4019 4024
4020 /// Invocation of [constructor] on [type] with incompatible [arguments]. 4025 /// Invocation of [constructor] on [type] with incompatible [arguments].
4021 /// 4026 ///
4022 /// For instance: 4027 /// For instance:
4023 /// 4028 ///
4024 /// class C { 4029 /// class C {
4025 /// C(a); 4030 /// C(a);
4026 /// } 4031 /// }
4027 /// m() => C(true, 42); 4032 /// m() => C(true, 42);
4028 /// 4033 ///
4029 R visitConstructorIncompatibleInvoke( 4034 R visitConstructorIncompatibleInvoke(
4030 NewExpression node, 4035 NewExpression node,
4031 ConstructorElement constructor, 4036 ConstructorElement constructor,
4032 InterfaceType type, 4037 ResolutionInterfaceType type,
4033 NodeList arguments, 4038 NodeList arguments,
4034 CallStructure callStructure, 4039 CallStructure callStructure,
4035 A arg); 4040 A arg);
4036 4041
4037 /// Read access of an invalid expression. 4042 /// Read access of an invalid expression.
4038 /// 4043 ///
4039 /// For instance: 4044 /// For instance:
4040 /// 4045 ///
4041 /// import 'foo.dart' as p; 4046 /// import 'foo.dart' as p;
4042 /// 4047 ///
(...skipping 559 matching lines...) Expand 10 before | Expand all | Expand 10 after
4602 /// factory C.a() = C<C<T>>.b; 4607 /// factory C.a() = C<C<T>>.b;
4603 /// C.b(); 4608 /// C.b();
4604 /// } 4609 /// }
4605 /// where `C` has the redirection target `C.a` of type `C<int>` and `C.a` has 4610 /// where `C` has the redirection target `C.a` of type `C<int>` and `C.a` has
4606 /// the redirection target `C.b` of type `C<C<T>>`. 4611 /// the redirection target `C.b` of type `C<C<T>>`.
4607 /// 4612 ///
4608 R visitRedirectingFactoryConstructorDeclaration( 4613 R visitRedirectingFactoryConstructorDeclaration(
4609 FunctionExpression node, 4614 FunctionExpression node,
4610 ConstructorElement constructor, 4615 ConstructorElement constructor,
4611 NodeList parameters, 4616 NodeList parameters,
4612 InterfaceType redirectionType, 4617 ResolutionInterfaceType redirectionType,
4613 ConstructorElement redirectionTarget, 4618 ConstructorElement redirectionTarget,
4614 A arg); 4619 A arg);
4615 4620
4616 /// An initializer of [field] with [initializer] as found in constructor 4621 /// An initializer of [field] with [initializer] as found in constructor
4617 /// initializers. 4622 /// initializers.
4618 /// 4623 ///
4619 /// For instance `this.a = 42` in: 4624 /// For instance `this.a = 42` in:
4620 /// 4625 ///
4621 /// class C { 4626 /// class C {
4622 /// var a; 4627 /// var a;
(...skipping 23 matching lines...) Expand all
4646 /// class B { 4651 /// class B {
4647 /// B(a); 4652 /// B(a);
4648 /// } 4653 /// }
4649 /// class C extends B { 4654 /// class C extends B {
4650 /// C() : super(42); 4655 /// C() : super(42);
4651 /// } 4656 /// }
4652 /// 4657 ///
4653 R visitSuperConstructorInvoke( 4658 R visitSuperConstructorInvoke(
4654 Send node, 4659 Send node,
4655 ConstructorElement superConstructor, 4660 ConstructorElement superConstructor,
4656 InterfaceType type, 4661 ResolutionInterfaceType type,
4657 NodeList arguments, 4662 NodeList arguments,
4658 CallStructure callStructure, 4663 CallStructure callStructure,
4659 A arg); 4664 A arg);
4660 4665
4661 /// An implicit super constructor invocation of [superConstructor] from 4666 /// An implicit super constructor invocation of [superConstructor] from
4662 /// generative constructor initializers. 4667 /// generative constructor initializers.
4663 /// 4668 ///
4664 /// For instance `super(42)` in: 4669 /// For instance `super(42)` in:
4665 /// 4670 ///
4666 /// class B { 4671 /// class B {
4667 /// B(); 4672 /// B();
4668 /// } 4673 /// }
4669 /// class C extends B { 4674 /// class C extends B {
4670 /// C(); // Implicit super call of B(). 4675 /// C(); // Implicit super call of B().
4671 /// } 4676 /// }
4672 /// 4677 ///
4673 R visitImplicitSuperConstructorInvoke(FunctionExpression node, 4678 R visitImplicitSuperConstructorInvoke(FunctionExpression node,
4674 ConstructorElement superConstructor, InterfaceType type, A arg); 4679 ConstructorElement superConstructor, ResolutionInterfaceType type, A arg);
4675 4680
4676 /// An super constructor invocation of an unresolved with [arguments] as 4681 /// An super constructor invocation of an unresolved with [arguments] as
4677 /// found in generative constructor initializers. 4682 /// found in generative constructor initializers.
4678 /// 4683 ///
4679 /// For instance `super(42)` in: 4684 /// For instance `super(42)` in:
4680 /// 4685 ///
4681 /// class B { 4686 /// class B {
4682 /// B(a); 4687 /// B(a);
4683 /// } 4688 /// }
4684 /// class C extends B { 4689 /// class C extends B {
(...skipping 21 matching lines...) Expand all
4706 /// 4711 ///
4707 /// For instance `this._(42)` in: 4712 /// For instance `this._(42)` in:
4708 /// 4713 ///
4709 /// class C { 4714 /// class C {
4710 /// C() : this._(42); 4715 /// C() : this._(42);
4711 /// } 4716 /// }
4712 /// 4717 ///
4713 R errorUnresolvedThisConstructorInvoke( 4718 R errorUnresolvedThisConstructorInvoke(
4714 Send node, Element element, NodeList arguments, Selector selector, A arg); 4719 Send node, Element element, NodeList arguments, Selector selector, A arg);
4715 } 4720 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/resolution/scope.dart ('k') | pkg/compiler/lib/src/resolution/semantic_visitor_mixins.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698