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

Unified 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: Change handling of incompatible redirecting factories. Created 5 years, 7 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
Index: pkg/compiler/lib/src/resolution/semantic_visitor.dart
diff --git a/pkg/compiler/lib/src/resolution/semantic_visitor.dart b/pkg/compiler/lib/src/resolution/semantic_visitor.dart
index 3cc1c22ba338bc49caaac886b1a351d6c3284a93..791a25931cc9318dcb64843b00efcbdfe89f3f9c 100644
--- a/pkg/compiler/lib/src/resolution/semantic_visitor.dart
+++ b/pkg/compiler/lib/src/resolution/semantic_visitor.dart
@@ -3813,7 +3813,7 @@ abstract class SemanticSendVisitor<R, A> {
Node right,
A arg);
- /// Const invocation of a [constructor].
+ /// Const invocation of a [constant] constructor.
///
/// For instance
/// class C<T> {
@@ -3826,6 +3826,36 @@ abstract class SemanticSendVisitor<R, A> {
ConstructedConstantExpression constant,
A arg);
+ /// Const invocation of the `bool.fromEnvironment` constructor.
+ ///
+ /// For instance
+ /// m() => const bool.fromEnvironment('foo', defaultValue: false);
+ ///
+ R visitBoolFromEnvironmentConstructorInvoke(
+ NewExpression node,
+ BoolFromEnvironmentConstantExpression constant,
+ A arg);
+
+ /// Const invocation of the `int.fromEnvironment` constructor.
+ ///
+ /// For instance
+ /// m() => const int.fromEnvironment('foo', defaultValue: 42);
+ ///
+ R visitIntFromEnvironmentConstructorInvoke(
+ NewExpression node,
+ IntFromEnvironmentConstantExpression constant,
+ A arg);
+
+ /// Const invocation of the `String.fromEnvironment` constructor.
+ ///
+ /// For instance
+ /// m() => const String.fromEnvironment('foo', defaultValue: 'bar');
+ ///
+ R visitStringFromEnvironmentConstructorInvoke(
+ NewExpression node,
+ StringFromEnvironmentConstantExpression constant,
+ A arg);
+
/// Invocation of a generative [constructor] on [type] with [arguments].
///
/// For instance
@@ -3995,6 +4025,22 @@ abstract class SemanticSendVisitor<R, A> {
NodeList arguments,
CallStructure callStructure,
A arg);
+
+ /// Invocation of [constructor] on [type] with incompatible [arguments].
+ ///
+ /// For instance
+ /// class C {
+ /// C(a);
+ /// }
+ /// m() => C(true, 42);
+ ///
+ R visitConstructorIncompatibleInvoke(
+ NewExpression node,
+ ConstructorElement constructor,
+ InterfaceType type,
+ NodeList arguments,
+ CallStructure callStructure,
+ A arg);
}
abstract class SemanticDeclarationVisitor<R, A> {
« no previous file with comments | « pkg/compiler/lib/src/resolution/access_semantics.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