Version 2.0.0-dev.67.0
Merge commit '0ccdc3ec388d44a1763f66b1be1207fc6b26f527' into dev
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 4fa15f1..4552410 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,48 @@
+## 2.0.0-dev.XX.0
+(Add new changes here, and they will be copied to the
+ change section for the next dev version)
+
+### Language
+
+#### Strong Mode
+
+### Dart VM
+
+### Tool Changes
+
+#### dartfmt
+
+#### Pub
+
+#### Dart2js
+
+#### Other Tools
+
+### Core library changes
+
+## 2.0.0-dev.67.0
+
+### Language
+
+* New member conflict rules have been implemented. Most cases of conflicting
+ members with the same name are now static errors. Issue [33235][issue 33235].
+
+[issue 33235]: https://github.com/dart-lang/sdk/issues/33235
+
+### Tool Changes
+
+#### dartfmt
+
+ * Format expressions inside string interpolation.
+
+### Core library changes
+
+ * `dart:io`
+ * Adds `HttpClient.connectionTimeout`.
+ * Adds `{Socket,RawSocket,SecureSocket}.startConnect`. These return a
+ `ConnectionTask`, which can be used to cancel an in-flight connection
+ attempt.
+
## 2.0.0-dev.66.0
## 2.0.0-dev.65.0
diff --git a/DEPS b/DEPS
index d785eeb..ba08f05 100644
--- a/DEPS
+++ b/DEPS
@@ -8,6 +8,7 @@
allowed_hosts = [
'boringssl.googlesource.com',
+ 'chrome-infra-packages.appspot.com',
'chromium.googlesource.com',
'dart.googlesource.com',
'fuchsia.googlesource.com',
@@ -67,7 +68,7 @@
# Note: updates to dart_style have to be coordinated carefully with
# the infrastructure-team so that the internal formatter in
- # `sdk/tools/sdks/*/dart-sdk/bin/dartfmt` matches the version here.
+ # `sdk/tools/sdks/dart-sdk/bin/dartfmt` matches the version here.
#
# Please follow this process to make updates:
# * file an issue with area-infrastructure requesting a roll for this
@@ -77,14 +78,14 @@
# minutes later.
#
# For more details, see https://github.com/dart-lang/sdk/issues/30164
- "dart_style_tag": "1.1.0", # Please see the note above before updating.
+ "dart_style_tag": "1.1.1", # Please see the note above before updating.
"dartdoc_tag" : "v0.20.1",
"fixnum_tag": "0.10.5",
"func_rev": "25eec48146a58967d75330075ab376b3838b18a8",
"glob_tag": "1.1.5",
"html_tag" : "0.13.3",
- "http_io_tag": "35dc43c9144cf7ed4236843dacd62ebaf89df21a",
+ "http_io_tag": "265e90afbffacb7b2988385d4a6aa2f14e970d44",
"http_multi_server_tag" : "2.0.4",
"http_parser_tag" : "3.1.1",
"http_retry_tag": "0.1.1",
@@ -94,10 +95,10 @@
"intl_tag": "0.15.2",
"jinja2_rev": "2222b31554f03e62600cd7e383376a7c187967a1",
"json_rpc_2_tag": "2.0.6",
- "linter_tag": "0.1.54",
+ "linter_tag": "0.1.56",
"logging_tag": "0.11.3+1",
"markdown_tag": "2.0.0",
- "matcher_tag": "0.12.1+4",
+ "matcher_tag": "0.12.3",
"mime_tag": "0.9.6",
"mockito_tag": "d39ac507483b9891165e422ec98d9fb480037c8b",
"mustache4dart_tag" : "v2.1.2",
@@ -131,10 +132,10 @@
"test_process_tag": "1.0.1",
"term_glyph_tag": "1.0.0",
"test_reflective_loader_tag": "0.1.4",
- "test_tag": "0.12.38",
+ "test_tag": "1.0.0",
"tuple_tag": "v1.0.1",
"typed_data_tag": "1.1.3",
- "usage_tag": "3.3.0",
+ "usage_tag": "3.4.0",
"utf_tag": "0.9.0+4",
"watcher_tag": "0.9.7+8",
"web_components_rev": "8f57dac273412a7172c8ade6f361b407e2e4ed02",
@@ -152,10 +153,20 @@
Var("chromium_git") + "/chromium/llvm-project/cfe/tools/clang-format.git" +
"@" + Var("clang_format_scripts_rev"),
+ Var("dart_root") + "/tools/sdks": {
+ "packages": [
+ {
+ "package": "dart/dart-sdk/${{platform}}",
+ "version": "version:2.0.0-dev.65.0",
+ },
+ ],
+ "dep_type": "cipd",
+ },
+
Var("dart_root") + "/tests/co19/src":
Var("dart_git") + "co19.git" + "@" + Var("co19_rev"),
-Var("dart_root") + "/tests/co19_2/src":
+ Var("dart_root") + "/tests/co19_2/src":
Var("chromium_git") + "/external/github.com/dart-lang/co19.git" +
"@" + Var("co19_2_rev"),
@@ -374,22 +385,6 @@
],
},
{
- "name": "checked_in_dart_sdks",
- "pattern": ".",
- "action": [
- "download_from_google_storage",
- "--no_auth",
- "--no_resume",
- "--bucket",
- "dart-dependencies",
- "--recursive",
- "--auto_platform",
- "--extract",
- "--directory",
- Var('dart_root') + "/tools/sdks",
- ],
- },
- {
"name": "firefox_jsshell",
"pattern": ".",
"action": [
diff --git a/build/config/BUILDCONFIG.gn b/build/config/BUILDCONFIG.gn
index 3ad0c96..0334944 100644
--- a/build/config/BUILDCONFIG.gn
+++ b/build/config/BUILDCONFIG.gn
@@ -233,7 +233,10 @@
]
}
if (is_posix) {
- _native_compiler_configs += [ "//build/config/gcc:no_exceptions" ]
+ _native_compiler_configs += [
+ "//build/config/gcc:no_exceptions",
+ "//build/config/gcc:relative_paths",
+ ]
if (is_product) {
_native_compiler_configs +=
[ "//build/config/gcc:symbol_visibility_hidden" ]
diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn
index 8154e4e..e29aa03 100644
--- a/build/config/compiler/BUILD.gn
+++ b/build/config/compiler/BUILD.gn
@@ -315,12 +315,6 @@
"-Wl,--exclude-libs=libgcc.a",
"-Wl,--exclude-libs=libc++_static.a",
]
- if (current_cpu == "arm") {
- ldflags += [
- # Enable identical code folding to reduce size.
- "-Wl,--icf=safe",
- ]
- }
if (is_clang) {
if (current_cpu == "arm") {
@@ -662,7 +656,10 @@
"/Gw",
]
}
- common_optimize_on_ldflags = [ "/OPT:REF" ]
+ common_optimize_on_ldflags = [
+ "/OPT:REF",
+ "/OPT:ICF",
+ ]
} else {
common_optimize_on_cflags = [
# Don't emit the GCC version ident directives, they just end up in the
@@ -693,6 +690,10 @@
# See http://lwn.net/Articles/192624/ .
"-Wl,-O1",
"-Wl,--gc-sections",
+
+ # Identical code folding to reduce size.
+ # Warning: This changes C/C++ semantics of function pointer comparison.
+ "-Wl,--icf=all",
]
if (!using_sanitizer) {
diff --git a/build/config/gcc/BUILD.gn b/build/config/gcc/BUILD.gn
index 110f1cc..6b941f0 100644
--- a/build/config/gcc/BUILD.gn
+++ b/build/config/gcc/BUILD.gn
@@ -45,3 +45,36 @@
cflags_cc = no_exceptions_flags
cflags_objcc = no_exceptions_flags
}
+
+config("relative_paths") {
+ # Make builds independent of absolute file path. The file names
+ # embedded in debugging information will be expressed as relative to
+ # the build directory, e.g. "../.." for an "out/subdir" under //.
+ # This is consistent with the file names in __FILE__ expansions
+ # (e.g. in assertion messages), which the compiler doesn't provide a
+ # way to remap. That way source file names in logging and
+ # symbolization can all be treated the same way. This won't go well
+ # if root_build_dir is not a subdirectory //, but there isn't a better
+ # option to keep all source file name references uniformly relative to
+ # a single root.
+ absolute_path = rebase_path("//.")
+ relative_path = rebase_path("//.", root_build_dir)
+ cflags = [
+ # This makes sure that the DW_AT_comp_dir string (the current
+ # directory while running the compiler, which is the basis for all
+ # relative source file names in the DWARF info) is represented as
+ # relative to //.
+ "-fdebug-prefix-map=$absolute_path=$relative_path",
+
+ # This makes sure that include directories in the toolchain are
+ # represented as relative to the build directory (because that's how
+ # we invoke the compiler), rather than absolute. This can affect
+ # __FILE__ expansions (e.g. assertions in system headers). We
+ # normally run a compiler that's someplace within the source tree
+ # (//buildtools/...), so its absolute installation path will have a
+ # prefix matching absolute_path and hence be mapped to relative_path
+ # in the debugging information, so this should actually be
+ # superfluous for purposes of the debugging information.
+ "-no-canonical-prefixes",
+ ]
+}
diff --git a/build/dart/dart_action.gni b/build/dart/dart_action.gni
index 91f5e293..ee5e6e6 100644
--- a/build/dart/dart_action.gni
+++ b/build/dart/dart_action.gni
@@ -227,9 +227,9 @@
dfe = "$prebuilt_dart_sdk/bin/snapshots/kernel-service.dart.snapshot"
} else {
binary =
- "$_dart_root/tools/sdks/$host_os/dart-sdk/bin/dart$executable_suffix"
+ "$_dart_root/tools/sdks/dart-sdk/bin/dart$executable_suffix"
dfe =
- "$_dart_root/tools/sdks/$host_os/dart-sdk/bin/snapshots/kernel-service.dart.snapshot"
+ "$_dart_root/tools/sdks/dart-sdk/bin/snapshots/kernel-service.dart.snapshot"
}
target = "$_dart_root/runtime/bin:dart_bootstrap"
}
diff --git a/build/dart/prebuilt_dart_sdk.gni b/build/dart/prebuilt_dart_sdk.gni
index 2a5be7b..bdb9ebf 100644
--- a/build/dart/prebuilt_dart_sdk.gni
+++ b/build/dart/prebuilt_dart_sdk.gni
@@ -7,7 +7,7 @@
_dart_root = rebase_path("../..")
_prebuilt_dart_exe =
- "$_dart_root/tools/sdks/$host_os/dart-sdk/bin/dart$executable_suffix"
+ "$_dart_root/tools/sdks/dart-sdk/bin/dart$executable_suffix"
# When the first argument is "exec_script", gn_run_binary.py always exits with
# status 0, but gives non-empty output when the command it is given fails.
diff --git a/docs/language/dartLangSpec.tex b/docs/language/dartLangSpec.tex
index ce1ff45..fa6c427c 100644
--- a/docs/language/dartLangSpec.tex
+++ b/docs/language/dartLangSpec.tex
@@ -62,6 +62,9 @@
% and JavaScript integers.
% - Remove appendix on naming conventions.
% - Make it explicit that "dynamic" is exported from dart:core.
+% - Remove "boolean conversion". It's just an error to not be a bool.
+% - Adjust cyclic subtype prevention rule for type variables.
+% - Clarify that it is an error to use FutureOr<T> as a superinterface etc.
%
% 1.15
% - Change how language specification describes control flow.
@@ -2270,8 +2273,11 @@
The scope of the \EXTENDS{} and \WITH{} clauses of a class $C$ is the type-parameter scope of $C$.
\LMHash{}
-It is a compile-time error if the \EXTENDS{} clause of a class $C$ specifies a type variable (\ref{generics}), a type alias (\ref{typedef}), an enumerated type (\ref{enums}), a malformed type, or a deferred type (\ref{staticTypes}) as a superclass.
-It is a compile-time error if the \EXTENDS{} clause of a class $C$ specifies type \DYNAMIC{} as a superinterface.
+It is a compile-time error if the type in the \EXTENDS{} clause of a class $C$ is
+a type variable (\ref{generics}), a type alias (\ref{typedef}),
+an enumerated type (\ref{enums}), a malformed type (\ref{staticTypes}),
+a deferred type (\ref{staticTypes}), type \DYNAMIC{} (\ref{typeDynamic}),
+or type \code{FutureOr<$T$>} for any $T$ (\ref{typeFutureOr}).
\commentary{
The type parameters of a generic class are available in the lexical scope of the superclass clause, potentially shadowing classes in the surrounding scope.
@@ -2426,11 +2432,15 @@
The scope of the \IMPLEMENTS{} clause of a class $C$ is the type-parameter scope of $C$.
\LMHash{}
-It is a compile-time error if the \IMPLEMENTS{} clause of a class $C$ specifies a type variable (\ref{generics}), a type alias (\ref{typedef}), an enumerated type (\ref{enums}), a malformed type, or a deferred type (\ref{staticTypes}) as a superinterface.
-It is a compile-time error if the \IMPLEMENTS{} clause of a class $C$ specifies type \DYNAMIC{} as a superinterface.
-It is a compile-time error if the \IMPLEMENTS{} clause of a class $C$ specifies a type $T$ as a superinterface more than once.
-It is a compile-time error if the superclass of a class $C$ is specified as a superinterface of $C$.
-It is a compile-time error if a class $C$ has two superinterfaces that are different instantiations of the same generic class. \commentary{For example, a class may not have both `List<int>` and `List<num>` as superinterfaces.}
+It is a compile-time error if an element in the type list of the \IMPLEMENTS{} clause of a class $C$ is
+a type variable (\ref{generics}), a type alias (\ref{typedef}),
+an enumerated type (\ref{enums}), a malformed type (\ref{staticTypes}),
+a deferred type (\ref{staticTypes}), type \DYNAMIC{} (\ref{typeDynamic}),
+or type \code{FutureOr<$T$>} for any $T$ (\ref{typeFutureOr}).
+It is a compile-time error if two elements in the type list of the \IMPLEMENTS{} clause of a class $C$ specifies the same type $T$.
+It is a compile-time error if the superclass of a class $C$ is one of the elements of the type list of the \IMPLEMENTS{} clause of $C$.
+It is a compile-time error if a class $C$ has two superinterfaces that are different instantiations of the same generic class.
+\commentary{For example, a class may not have both `List<int>` and `List<num>` as superinterfaces.}
% If we need to allow multiple instantiations, they'll need to have a most
% specific one, and then we can add the following clause
%, unless it implements one that is a subtype of all the other. \commentary{This ensures that each class implements one {\em most specific} version of a generic class' interface.}
@@ -2623,8 +2633,13 @@
\LMHash{}
A mixin may be applied to a superclass, yielding a new class.
Mixin application occurs when one or more mixins are mixed into a class declaration via its \WITH{} clause.
-The mixin application may be used to extend a class per section (\ref{classes}); alternatively, a class may be defined as a mixin application as described in this section.
-It is a compile-time error if the \WITH{} clause of a mixin application $C$ includes a type variable (\ref{generics}), a type alias (\ref{typedef}), an enumerated type (\ref{enums}), a malformed type, or a deferred type (\ref{staticTypes}).
+The mixin application may be used to extend a class per section \ref{classes};
+alternatively, a class may be defined as a mixin application as described in this section.
+It is a compile-time error if an element in the type list of the \WITH{} clause of a mixin application is
+a type variable (\ref{generics}), a type alias (\ref{typedef}),
+an enumerated type (\ref{enums}), a malformed type (\ref{staticTypes}),
+a deferred type (\ref{staticTypes}), type \DYNAMIC{} (\ref{typeDynamic}),
+or type \code{FutureOr<$T$>} for any $T$ (\ref{typeFutureOr}).
\begin{grammar}
{\bf mixinApplicationClass:}identifier typeParameters? `=' mixinApplication `{\escapegrammar ;}'
@@ -2925,8 +2940,15 @@
\LMHash{}
A type parameter $T$ may be suffixed with an \EXTENDS{} clause that specifies the {\em upper bound} for $T$.
If no \EXTENDS{} clause is present, the upper bound is \code{Object}.
-It is a static type warning if a type parameter is a supertype of its upper bound.
-The bounds of type variables are a form of type annotation and have no effect on execution in production mode.
+It is a static type warning if a type parameter is a supertype of its upper bound
+when that upper bound is itself a type variable.
+
+\commentary{
+This prevents circular declarations like
+\code{X \EXTENDS{} X}
+and
+\code{X \EXTENDS{} Y, Y \EXTENDS{} X}.
+}
\LMHash{}
Type parameters are declared in the type parameter scope of a class or function.
@@ -3784,45 +3806,6 @@
The static type of a boolean literal is \code{bool}.
-\subsubsection{Boolean Conversion}
-\LMLabel{booleanConversion}
-
-\LMHash{}
-{\em Boolean conversion} maps any object $o$ into a boolean.
-Boolean conversion is defined by the function application
-
-\begin{dartCode}
-(bool v)\{
- \ASSERT{}(v != \NULL{});
-% \IF{} (\NULL{} == v) \{ \THROW{} \NEW{} AssertionError('null is not a bool')\};
- \RETURN{} identical(v, \TRUE{});
-\}(o)
-\end{dartCode}
-
-\rationale{
-Boolean conversion is used as part of control-flow constructs and boolean expressions.
-Ideally, one would simply insist that control-flow decisions be based exclusively on booleans.
-This is straightforward in a statically typed setting.
-In a dynamically typed language, it requires a dynamic check.
-Sophisticated virtual machines can minimize the penalty involved.
-Alas, Dart must be compiled into Javascript.
-Boolean conversion allows this to be done efficiently.
-
-At the same time, this formulation differs radically from Javascript, where most numbers and objects are interpreted as \TRUE{}.
-Dart's approach prevents usages such \code{\IF{} (a-b) ... ; }because it does not agree with the low level conventions whereby non-null objects or non-zero numbers are treated as \TRUE{}.
-Indeed, there is no way to derive \TRUE{} from a non-boolean object via boolean conversion, so this kind of low level hackery is nipped in the bud.
-
-Dart also avoids the strange behaviors that can arise due to the interaction of boolean conversion with autoboxing in Javascript.
-A notorious example is the situation where \FALSE{} can be interpreted as \TRUE{}.
-In Javascript, booleans are not objects, and instead are autoboxed into objects where ``needed''.
-If \FALSE{} gets autoboxed into an object, that object can be coerced into \TRUE{} (as it is a non-null object).
-}
-
-\commentary{
-Because boolean conversion requires its parameter to be a boolean, any construct that makes use of boolean conversion will cause a dynamic type error in checked mode if the value to be converted is not a boolean.
-}
-
-
\subsection{Strings}
\LMLabel{strings}
@@ -4091,7 +4074,7 @@
\LMHash{}
A symbol literal \code{\#\_$id$}, evaluates to an instance of \code{Symbol}
-representing the private identifier \code{_$id} of the containing library.
+representing the private identifier \code{\_\id} of the containing library.
All occurences of \code{\#\_$id$} {\em in the same library} evaluate to the same instance,
and no other symbol literals evaluate to that \code{Symbol} instance
or to a \code{Symbol} instance that is \code{==} to that instance.
@@ -6654,7 +6637,7 @@
\LMHash{}
First, $e_1$ is evaluated to an object $o_1$.
-Then, $o_1$ is subjected to boolean conversion (\ref{booleanConversion}) producing an object $r$.
+It is a run-time error if the run-time type of $o_1$ is not \code{bool}.
If $r$ is \TRUE, then the value of $c$ is the result of evaluating the expression $e_2$.
Otherwise the value of $c$ is the result of evaluating the expression $e_3$.
@@ -6716,10 +6699,18 @@
A {\em logical boolean expression} is either an equality expression (\ref{equality}), or an invocation of a logical boolean operator on an expression $e_1$ with argument $e_2$.
\LMHash{}
-Evaluation of a logical boolean expression $b$ of the form $e_1 || e_2$ causes the evaluation of $e_1$ which is then subjected to boolean conversion, producing an object $o_1$; if $o_1$ is \TRUE, the result of evaluating $b$ is \TRUE, otherwise $e_2$ is evaluated to an object $o_2$, which is then subjected to boolean conversion (\ref{booleanConversion}) producing an object $r$, which is the value of $b$.
+Evaluation of a logical boolean expression $b$ of the form $e_1 || e_2$ causes the evaluation of $e_1$ to a value $o_1$.
+It is a run-time error if the run-time type of $o_1$ is not \code{bool}.
+If $o_1$ is \TRUE, the result of evaluating $b$ is \TRUE, otherwise $e_2$ is evaluated to an object $o_2$.
+It is a run-time error if the run-time type of $o_2$ is not \code{bool}.
+Otherwise the result of evaluating $b$ is $o_2$.
\LMHash{}
-Evaluation of a logical boolean expression $b$ of the form $e_1 \&\& e_2$ causes the evaluation of $e_1$ which is then subjected to boolean conversion, producing an object $o_1$; if $o_1$ is not \TRUE, the result of evaluating $b$ is \FALSE, otherwise $e_2$ is evaluated to an object $o_2$, which is then subjected to boolean conversion evaluating to an object $r$, which is the value of $b$.
+Evaluation of a logical boolean expression $b$ of the form $e_1 \&\& e_2$ causes the evaluation of $e_1$ producing an object $o_1$.
+It is a run-time error if the run-time type of $o_1$ is not \code{bool}.
+If $o_1$ is \FALSE, the result of evaluating $b$ is \FALSE, otherwise $e_2$ is evaluated to an object $o_2$.
+It is a run-time error if the run-time type of $o_2$ is not \code{bool}.
+Otherwise the result of evaluating $b$ is $o_2$.
\LMHash{}
A logical boolean expression $b$ of the form $e_1 \&\& e_2$ shows that a variable $v$ has type
@@ -7773,8 +7764,8 @@
\LMHash{}
First, the expression $b$ is evaluated to an object $o$.
-Then, $o$ is subjected to boolean conversion (\ref{booleanConversion}), producing an object $r$.
-If $r$ is \TRUE{}, then the block statement $s_1$ is executed, otherwise the block statement $s_2$ is executed.
+It is a run-time error if the run-time type of $o$ is not \code{bool}.
+If $o$ is \TRUE{}, then the block statement $s_1$ is executed, otherwise the block statement $s_2$ is executed.
\LMHash{}
It is a static type warning if the type of the expression $b$ may not be assigned to \code{bool}.
@@ -7834,8 +7825,9 @@
If this is the first iteration of the for loop, let $v'$ be $v$.
Otherwise, let $v'$ be the variable $v''$ created in the previous execution of step \ref{allocateFreshVar}.
\item
-The expression $[v'/v]c$ is evaluated and subjected to boolean conversion (\ref{booleans}).
-If the result is \FALSE{}, the for loop completes normally.
+The expression $[v'/v]c$ is evaluated to a value $o$.
+It is a run-time error if the run-time type of $o$ is not \code{bool}.
+If $o$ is \FALSE{}, the for loop completes normally.
Otherwise, execution continues at step \ref{beginIteration}.
\item
\label{beginIteration}
@@ -8007,13 +7999,13 @@
\LMHash{}
The expression $e$ is evaluated to an object $o$.
-Then, $o$ is subjected to boolean conversion (\ref{booleanConversion}), producing an object $r$.
+It is a run-time error if the run-time type of $o$ is not \code{bool}.
\LMHash{}
-If $r$ is \FALSE{}, then execution of the while statement completes normally (\ref{completion}).
+If $o$ is \FALSE{}, then execution of the while statement completes normally (\ref{completion}).
\LMHash{}
-Otherwise $r$ is \TRUE{} and then the statement $\{s\}$ is executed.
+Otherwise $o$ is \TRUE{} and then the statement $\{s\}$ is executed.
If that execution completes normally or it continues with no label or to a label (\ref{labels}) that prefixes the \WHILE{} statement (\ref{completion}), then the while statement is re-executed.
If the execution breaks without a label, execution of the while statement completes normally.
\commentary{
@@ -8045,9 +8037,9 @@
\LMHash{}
Then, the expression $e$ is evaluated to an object $o$.
-Then, $o$ is subjected to boolean conversion (\ref{booleanConversion}), producing an object $r$.
-If $r$ is \FALSE{}, execution of the do statement completes normally (\ref{completion}).
-If $r$ is \TRUE{}, then the do statement is re-executed.
+It is a run-time error if the run-time type of $o$ is not \code{bool}.
+If $o$ is \FALSE{}, execution of the do statement completes normally (\ref{completion}).
+If $o$ is \TRUE{}, then the do statement is re-executed.
\LMHash{}
It is a static type warning if the static type of $e$ may not be assigned to \code{bool}.
@@ -8169,10 +8161,10 @@
against the value of a variable \id{} proceeds as follows:
\LMHash{}
-The expression \code{$e_k$ == \id} is evaluated to an object $o$ which is then subjected to boolean conversion evaluating to a value $v$.
-If $v$ is not \TRUE{} the following case, \CASE{} $e_{k+1}: s_{k+1}$ is matched against \id{} if $k < n$.
-If $k = n$, then the \DEFAULT{} clause's statements are executed (\ref{case-execute}).
-If $v$ is \TRUE{}, let $h$ be the smallest number such that $h \ge k$ and $s_h$ is non-empty.
+The expression \code{$e_k$ == \id} is evaluated to an object $o$.
+It is a run-time error if the run-time type of $o$ is not \code{bool}.
+If $o$ is \FALSE{} the following case, \CASE{} $e_{k+1}: s_{k+1}$ is matched against \id{} if $k < n$, and if $k = n$, then the \DEFAULT{} clause's statements are executed (\ref{case-execute}).
+If $o$ is \TRUE{}, let $h$ be the smallest number such that $h \ge k$ and $s_h$ is non-empty.
If no such $h$ exists, let $h = n + 1$.
The case statements $s_h$ are then executed (\ref{case-execute}).
@@ -8190,9 +8182,10 @@
against the value of a variable \id{} proceeds as follows:
\LMHash{}
-The expression \code{$e_k$ == \id} is evaluated to an object $o$ which is then subjected to boolean conversion evaluating to a value $v$.
-If $v$ is not \TRUE{} the following case, \CASE{} $e_{k+1}: s_{k+1}$ is matched against \id{} if $k < n$.
-If $v$ is \TRUE{}, let $h$ be the smallest integer such that $h \ge k$ and $s_h$ is non-empty.
+The expression \code{$e_k$ == \id} is evaluated to an object $o$.
+It is a run-time error if the run-time type of $o$ is not \code{bool}.
+If $o$ is \FALSE{} the following case, \CASE{} $e_{k+1}: s_{k+1}$ is matched against \id{} if $k < n$.
+If $o$ is \TRUE{}, let $h$ be the smallest integer such that $h \ge k$ and $s_h$ is non-empty.
If such a $h$ exists, the case statements $s_h$ are executed (\ref{case-execute}).
Otherwise the switch statement completes normally (\ref{completion}).
@@ -10070,7 +10063,13 @@
The built-in type declaration \code{dynamic},
which is declared in the library \code{dart:core},
denotes the \DYNAMIC{} type.
-When the name \DYNAMIC{} exported by \code{dart:core} is evaluated as an expression, it evaluates to a \code{Type} object representing the \DYNAMIC{} type, even though \DYNAMIC{} is not a class.
+When the name \DYNAMIC{} exported by \code{dart:core} is evaluated as an expression,
+it evaluates to a \code{Type} object representing the \DYNAMIC{} type,
+even though \DYNAMIC{} is not a class.
+
+
+\subsection{Type FutureOr}
+\LMLabel{typeFutureOr}
\LMHash{}
The built-in type declaration \code{FutureOr},
@@ -10108,9 +10107,12 @@
\LMHash{}
The type \code{FutureOr<$T$>} has an interface that is identical to that
of \code{Object}.
-\commentary{The only members that can be invoked on a value with static type
-\code{FutureOr<$T$>} are members that are also on \code{Object}.}
-\rationale{We only want to allow invocations of members that are inherited from
+\commentary{
+The only members that can be invoked on a value with static type
+\code{FutureOr<$T$>} are members that are also on \code{Object}.
+}
+\rationale{
+We only want to allow invocations of members that are inherited from
a common supertype of both $T$ and \code{Future<$T$>}.
In most cases the only common supertype is \code{Object}. The exceptions, like
\code{FutureOr<Future<Object>>} which has \code{Future<Object>} as common
diff --git a/pkg/analysis_server/analysis_options.yaml b/pkg/analysis_server/analysis_options.yaml
index 9bacf2b..e36185e 100644
--- a/pkg/analysis_server/analysis_options.yaml
+++ b/pkg/analysis_server/analysis_options.yaml
@@ -1,5 +1,3 @@
-analyzer:
- strong-mode: true
linter:
rules:
- empty_constructor_bodies
diff --git a/pkg/analysis_server/benchmark/benchmarks.dart b/pkg/analysis_server/benchmark/benchmarks.dart
index 274571d..d1c7d6d 100644
--- a/pkg/analysis_server/benchmark/benchmarks.dart
+++ b/pkg/analysis_server/benchmark/benchmarks.dart
@@ -48,7 +48,7 @@
String get invocation => '${runner.executableName} $name';
void run() {
- if (argResults['machine']) {
+ if (argResults['machine'] as bool) {
final Map map = {
'benchmarks': benchmarks.map((b) => b.toJson()).toList()
};
@@ -96,7 +96,7 @@
}
final String benchmarkId = argResults.rest.first;
- final int repeatCount = int.parse(argResults['repeat']);
+ final int repeatCount = int.parse(argResults['repeat'] as String);
final bool quick = argResults['quick'];
final bool useCFE = argResults['use-cfe'];
final bool verbose = argResults['verbose'];
diff --git a/pkg/analysis_server/lib/src/analysis_server.dart b/pkg/analysis_server/lib/src/analysis_server.dart
index 2163483..bd45c00 100644
--- a/pkg/analysis_server/lib/src/analysis_server.dart
+++ b/pkg/analysis_server/lib/src/analysis_server.dart
@@ -340,6 +340,11 @@
DiagnosticServer diagnosticServer;
/**
+ * The analytics instance; note, this object can be `null`.
+ */
+ telemetry.Analytics get analytics => options.analytics;
+
+ /**
* Initialize a newly created server to receive requests from and send
* responses to the given [channel].
*
@@ -829,8 +834,12 @@
/**
* Sends a `server.error` notification.
*/
- void sendServerErrorNotification(String message, exception, stackTrace,
- {bool fatal: false}) {
+ void sendServerErrorNotification(
+ String message,
+ dynamic exception,
+ /*StackTrace*/ stackTrace, {
+ bool fatal: false,
+ }) {
StringBuffer buffer = new StringBuffer();
buffer.write(exception ?? 'null exception');
if (stackTrace != null) {
@@ -849,18 +858,25 @@
// send to crash reporting
if (options.crashReportSender != null) {
- // Catch and ignore any exceptions when reporting exceptions (network
- // errors or other).
options.crashReportSender
- .sendReport(exception, stackTrace: stackTrace)
- .catchError((_) {});
+ .sendReport(exception,
+ stackTrace: stackTrace is StackTrace ? stackTrace : null)
+ .catchError((_) {
+ // Catch and ignore any exceptions when reporting exceptions (network
+ // errors or other).
+ });
}
// remember the last few exceptions
if (exception is CaughtException) {
stackTrace ??= exception.stackTrace;
}
- exceptions.add(new ServerException(message, exception, stackTrace, fatal));
+ exceptions.add(new ServerException(
+ message,
+ exception,
+ stackTrace is StackTrace ? stackTrace : null,
+ fatal,
+ ));
}
/**
@@ -1000,13 +1016,15 @@
}
Future<Null> shutdown() async {
- // TODO(brianwilkerson) Determine whether this await is necessary.
- await null;
running = false;
- await options.analytics
- ?.waitForLastPing(timeout: new Duration(milliseconds: 200));
- options.analytics?.close();
+ if (options.analytics != null) {
+ options.analytics
+ .waitForLastPing(timeout: new Duration(milliseconds: 200))
+ .then((_) {
+ options.analytics.close();
+ });
+ }
// Defer closing the channel and shutting down the instrumentation server so
// that the shutdown response can be sent and logged.
diff --git a/pkg/analysis_server/lib/src/computer/computer_hover.dart b/pkg/analysis_server/lib/src/computer/computer_hover.dart
index eebfb33..f3633e3 100644
--- a/pkg/analysis_server/lib/src/computer/computer_hover.dart
+++ b/pkg/analysis_server/lib/src/computer/computer_hover.dart
@@ -140,5 +140,5 @@
return null;
}
- static _safeToString(obj) => obj?.toString();
+ static String _safeToString(obj) => obj?.toString();
}
diff --git a/pkg/analysis_server/lib/src/domain_analytics.dart b/pkg/analysis_server/lib/src/domain_analytics.dart
index f6ad37e..220fe27 100644
--- a/pkg/analysis_server/lib/src/domain_analytics.dart
+++ b/pkg/analysis_server/lib/src/domain_analytics.dart
@@ -8,33 +8,35 @@
import 'package:analysis_server/protocol/protocol_constants.dart';
import 'package:analysis_server/protocol/protocol_generated.dart';
import 'package:analysis_server/src/analysis_server.dart';
+import 'package:telemetry/telemetry.dart';
/// Instances of the class [AnalyticsDomainHandler] implement a [RequestHandler]
/// that handles requests in the `analytics` domain.
class AnalyticsDomainHandler implements RequestHandler {
final AnalysisServer server;
- bool enabled = false;
+ Analytics get analytics => server.analytics;
AnalyticsDomainHandler(this.server);
- // TODO(devoncarew): This implementation is currently mocked out.
Response handleEnable(Request request) {
- // TODO(devoncarew): Implement.
AnalyticsEnableParams params =
new AnalyticsEnableParams.fromRequest(request);
- enabled = params.value;
+ if (analytics != null) {
+ analytics.enabled = params.value;
+ }
return new AnalyticsEnableResult().toResponse(request.id);
}
Response handleIsEnabled(Request request) {
- // TODO(devoncarew): Implement.
- return new AnalyticsIsEnabledResult(enabled).toResponse(request.id);
+ return new AnalyticsIsEnabledResult(analytics?.enabled ?? false)
+ .toResponse(request.id);
}
@override
Response handleRequest(Request request) {
String requestName = request.method;
+
if (requestName == ANALYTICS_REQUEST_IS_ENABLED) {
return handleIsEnabled(request);
} else if (requestName == ANALYTICS_REQUEST_ENABLE) {
@@ -49,12 +51,26 @@
}
Response handleSendEvent(Request request) {
- // TODO(devoncarew): Implement.
+ if (analytics == null) {
+ return new AnalyticsSendEventResult().toResponse(request.id);
+ }
+
+ AnalyticsSendEventParams params =
+ new AnalyticsSendEventParams.fromRequest(request);
+ analytics.sendEvent(_clientId, params.action);
return new AnalyticsSendEventResult().toResponse(request.id);
}
Response handleSendTiming(Request request) {
- // TODO(devoncarew): Implement.
+ if (analytics == null) {
+ return new AnalyticsSendTimingResult().toResponse(request.id);
+ }
+
+ AnalyticsSendTimingParams params =
+ new AnalyticsSendTimingParams.fromRequest(request);
+ analytics.sendTiming(params.event, params.millis, category: _clientId);
return new AnalyticsSendTimingResult().toResponse(request.id);
}
+
+ String get _clientId => server.options.clientId ?? 'client';
}
diff --git a/pkg/analysis_server/lib/src/domain_server.dart b/pkg/analysis_server/lib/src/domain_server.dart
index 1f205bb..ccd12bc 100644
--- a/pkg/analysis_server/lib/src/domain_server.dart
+++ b/pkg/analysis_server/lib/src/domain_server.dart
@@ -67,8 +67,6 @@
* Cleanly shutdown the analysis server.
*/
Future<Null> shutdown(Request request) async {
- // TODO(brianwilkerson) Determine whether this await is necessary.
- await null;
await server.shutdown();
Response response = new ServerShutdownResult().toResponse(request.id);
server.sendResponse(response);
diff --git a/pkg/analysis_server/lib/src/server/driver.dart b/pkg/analysis_server/lib/src/server/driver.dart
index d452c44..1d11ede 100644
--- a/pkg/analysis_server/lib/src/server/driver.dart
+++ b/pkg/analysis_server/lib/src/server/driver.dart
@@ -151,7 +151,7 @@
}
}
- _getNextFlagIndex(args, i) {
+ int _getNextFlagIndex(List<String> args, int i) {
for (; i < args.length; ++i) {
if (args[i].startsWith('--')) {
return i;
@@ -382,8 +382,8 @@
} else {
// No path to the SDK was provided.
// Use FolderBasedDartSdk.defaultSdkDirectory, which will make a guess.
- defaultSdkPath = FolderBasedDartSdk
- .defaultSdkDirectory(PhysicalResourceProvider.INSTANCE)
+ defaultSdkPath = FolderBasedDartSdk.defaultSdkDirectory(
+ PhysicalResourceProvider.INSTANCE)
.path;
}
// TODO(brianwilkerson) It would be nice to avoid creating an SDK that
@@ -513,12 +513,13 @@
negatable: false);
parser.addOption(NEW_ANALYSIS_DRIVER_LOG,
help: "set a destination for the new analysis driver's log");
- if (telemetry.SHOW_ANALYTICS_UI) {
- parser.addFlag(ANALYTICS_FLAG,
- help: 'enable or disable sending analytics information to Google');
- }
+ parser.addFlag(ANALYTICS_FLAG,
+ help: 'enable or disable sending analytics information to Google',
+ hide: !telemetry.SHOW_ANALYTICS_UI);
parser.addFlag(SUPPRESS_ANALYTICS_FLAG,
- negatable: false, help: 'suppress analytics for this session');
+ negatable: false,
+ help: 'suppress analytics for this session',
+ hide: !telemetry.SHOW_ANALYTICS_UI);
parser.addOption(PORT_OPTION,
help: "the http diagnostic port on which the server provides"
" status and performance information");
diff --git a/pkg/analysis_server/lib/src/services/kythe/kythe_visitors.dart b/pkg/analysis_server/lib/src/services/kythe/kythe_visitors.dart
index 98bd43a..496d8cf 100644
--- a/pkg/analysis_server/lib/src/services/kythe/kythe_visitors.dart
+++ b/pkg/analysis_server/lib/src/services/kythe/kythe_visitors.dart
@@ -83,6 +83,7 @@
class CodedBufferWriter {
CodedBufferWriter(var v);
+
toBuffer() {}
}
@@ -894,8 +895,8 @@
_handleRefCallEdge(
Element element, {
SyntacticEntity syntacticEntity: null,
- start: _notFound,
- end: _notFound,
+ int start: _notFound,
+ int end: _notFound,
KytheVName enclosingTarget: null,
}) {
if (element is ExecutableElement &&
@@ -931,8 +932,8 @@
Element element,
List<String> refEdgeTypes, {
SyntacticEntity syntacticEntity: null,
- start: _notFound,
- end: _notFound,
+ int start: _notFound,
+ int end: _notFound,
KytheVName enclosingTarget: null,
KytheVName enclosingAnchor: null,
}) {
diff --git a/pkg/analysis_server/test/analysis/update_content_test.dart b/pkg/analysis_server/test/analysis/update_content_test.dart
index b6dfc25..44161349 100644
--- a/pkg/analysis_server/test/analysis/update_content_test.dart
+++ b/pkg/analysis_server/test/analysis/update_content_test.dart
@@ -212,7 +212,7 @@
Map<String, dynamic> files = params.files;
expect(files, hasLength(1));
Object overlay = files[filePath];
- expect(overlay, new isInstanceOf<plugin.AddContentOverlay>());
+ expect(overlay, const TypeMatcher<plugin.AddContentOverlay>());
plugin.AddContentOverlay addOverlay = overlay;
expect(addOverlay.content, fileContent);
//
@@ -228,7 +228,7 @@
files = params.files;
expect(files, hasLength(1));
overlay = files[filePath];
- expect(overlay, new isInstanceOf<plugin.ChangeContentOverlay>());
+ expect(overlay, const TypeMatcher<plugin.ChangeContentOverlay>());
plugin.ChangeContentOverlay changeOverlay = overlay;
expect(changeOverlay.edits, hasLength(2));
//
@@ -243,7 +243,7 @@
files = params.files;
expect(files, hasLength(1));
overlay = files[filePath];
- expect(overlay, new isInstanceOf<plugin.RemoveContentOverlay>());
+ expect(overlay, const TypeMatcher<plugin.RemoveContentOverlay>());
}
// CompilationUnit _getTestUnit() {
diff --git a/pkg/analysis_server/test/context_manager_test.dart b/pkg/analysis_server/test/context_manager_test.dart
index 431bf6a..bd3ac38 100644
--- a/pkg/analysis_server/test/context_manager_test.dart
+++ b/pkg/analysis_server/test/context_manager_test.dart
@@ -1918,7 +1918,7 @@
// Verify defaults restored.
expect(analysisOptions.enableSuperMixins, isFalse);
expect(lints, hasLength(1));
- expect(lints.first, new isInstanceOf<AvoidAs>());
+ expect(lints.first, const TypeMatcher<AvoidAs>());
expect(errorProcessors, hasLength(1));
expect(getProcessor(missing_return).severity, isNull);
}
diff --git a/pkg/analysis_server/test/integration/analysis/get_hover_test.dart b/pkg/analysis_server/test/integration/analysis/get_hover_test.dart
index 487a4ac..8a8df89 100644
--- a/pkg/analysis_server/test/integration/analysis/get_hover_test.dart
+++ b/pkg/analysis_server/test/integration/analysis/get_hover_test.dart
@@ -62,14 +62,19 @@
* match the hover parameters. [propagatedType], if specified, is the
* expected propagated type of the element.
*/
- checkHover(String target, int length, List<String> descriptionRegexps,
- String kind, List<String> staticTypeRegexps,
- {bool isLocal: false,
- bool isCore: false,
- String docRegexp: null,
- bool isLiteral: false,
- List<String> parameterRegexps: null,
- propagatedType: null}) {
+ Future<AnalysisGetHoverResult> checkHover(
+ String target,
+ int length,
+ List<String> descriptionRegexps,
+ String kind,
+ List<String> staticTypeRegexps, {
+ bool isLocal: false,
+ bool isCore: false,
+ String docRegexp: null,
+ bool isLiteral: false,
+ List<String> parameterRegexps: null,
+ propagatedType: null,
+ }) {
int offset = text.indexOf(target);
return sendAnalysisGetHover(pathname, offset).then((result) {
expect(result.hovers, hasLength(1));
diff --git a/pkg/analysis_server/test/integration/analysis/highlights_test.dart b/pkg/analysis_server/test/integration/analysis/highlights_test.dart
index e143a15..5fb8afa 100644
--- a/pkg/analysis_server/test/integration/analysis/highlights_test.dart
+++ b/pkg/analysis_server/test/integration/analysis/highlights_test.dart
@@ -150,8 +150,4 @@
class AnalysisHighlightsTest_UseCFE extends AnalysisHighlightsTest {
@override
bool get useCFE => true;
-
- @override
- @failingTest
- test_highlights() => super.test_highlights();
}
diff --git a/pkg/analysis_server/test/integration/analytics/enable_test.dart b/pkg/analysis_server/test/integration/analytics/enable_test.dart
index d04e9ee..0c1dbc0a 100644
--- a/pkg/analysis_server/test/integration/analytics/enable_test.dart
+++ b/pkg/analysis_server/test/integration/analytics/enable_test.dart
@@ -20,16 +20,17 @@
test_call_enable() async {
standardAnalysisSetup();
- // Toggle the value twice, and verify the changes.
+ // Toggle the value twice; do light verification of the changes, as the
+ // analysis server - when running on our CI bots - deliberately does not
+ // send analytics info.
AnalyticsIsEnabledResult result1 = await sendAnalyticsIsEnabled();
- await sendAnalyticsEnable(!result1.enabled);
+ expect(result1.enabled, isNotNull);
+ await sendAnalyticsEnable(!result1.enabled);
AnalyticsIsEnabledResult result2 = await sendAnalyticsIsEnabled();
- expect(result2.enabled, !result1.enabled);
+ expect(result2.enabled, isNotNull);
await sendAnalyticsEnable(result1.enabled);
- result2 = await sendAnalyticsIsEnabled();
- expect(result2.enabled, result1.enabled);
}
}
diff --git a/pkg/analysis_server/test/integration/completion/get_suggestions_test.dart b/pkg/analysis_server/test/integration/completion/get_suggestions_test.dart
index 75dad25..27d3996 100644
--- a/pkg/analysis_server/test/integration/completion/get_suggestions_test.dart
+++ b/pkg/analysis_server/test/integration/completion/get_suggestions_test.dart
@@ -112,7 +112,7 @@
// Exception expected
return null;
}).then((result) {
- expect(result, new isInstanceOf<CompletionGetSuggestionsResult>());
+ expect(result, const TypeMatcher<CompletionGetSuggestionsResult>());
});
}
}
diff --git a/pkg/analysis_server/test/integration/edit/get_fixes_test.dart b/pkg/analysis_server/test/integration/edit/get_fixes_test.dart
index c0e52b7..e251f77 100644
--- a/pkg/analysis_server/test/integration/edit/get_fixes_test.dart
+++ b/pkg/analysis_server/test/integration/edit/get_fixes_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-import 'dart:async';
-
import 'package:analysis_server/protocol/protocol_generated.dart';
import 'package:analyzer_plugin/protocol/protocol_common.dart';
import 'package:test/test.dart';
@@ -69,5 +67,5 @@
@override
@failingTest
- Future test_has_fixes() => super.test_has_fixes();
+ test_has_fixes() => super.test_has_fixes();
}
diff --git a/pkg/analysis_server/test/integration/support/integration_tests.dart b/pkg/analysis_server/test/integration/support/integration_tests.dart
index 418189d..9e2ab21 100644
--- a/pkg/analysis_server/test/integration/support/integration_tests.dart
+++ b/pkg/analysis_server/test/integration/support/integration_tests.dart
@@ -16,9 +16,9 @@
import 'integration_test_methods.dart';
import 'protocol_matchers.dart';
-const Matcher isBool = const isInstanceOf<bool>();
+const Matcher isBool = const TypeMatcher<bool>();
-const Matcher isInt = const isInstanceOf<int>();
+const Matcher isInt = const TypeMatcher<int>();
const Matcher isNotification = const MatchesJsonObject(
'notification', const {'event': isString},
@@ -26,7 +26,7 @@
const Matcher isObject = isMap;
-const Matcher isString = const isInstanceOf<String>();
+const Matcher isString = const TypeMatcher<String>();
final Matcher isResponse = new MatchesJsonObject('response', {'id': isString},
optionalFields: {'result': anything, 'error': isRequestError});
@@ -41,7 +41,7 @@
/**
* Assert that [actual] matches [matcher].
*/
-void outOfTestExpect(actual, matcher,
+void outOfTestExpect(actual, Matcher matcher,
{String reason, skip, bool verbose: false}) {
var matchState = {};
try {
@@ -413,7 +413,7 @@
}
if (requiredFields != null) {
requiredFields.forEach((String key, Matcher valueMatcher) {
- if (!item.containsKey(key)) {
+ if (!(item as Map).containsKey(key)) {
mismatches.add((Description mismatchDescription) =>
mismatchDescription
.add('is missing field ')
diff --git a/pkg/analysis_server/test/protocol_server_test.dart b/pkg/analysis_server/test/protocol_server_test.dart
index 421000a..7ac554b 100644
--- a/pkg/analysis_server/test/protocol_server_test.dart
+++ b/pkg/analysis_server/test/protocol_server_test.dart
@@ -169,7 +169,7 @@
String enumName = MirrorSystem.getName(symbol);
EngineEnum engineValue =
engineClass.getField(symbol).reflectee as EngineEnum;
- expect(engineValue, new isInstanceOf<EngineEnum>());
+ expect(engineValue, new TypeMatcher<EngineEnum>());
if (exceptions.containsKey(engineValue)) {
ApiEnum expectedResult = exceptions[engineValue];
if (expectedResult == null) {
diff --git a/pkg/analysis_server/test/search/top_level_declarations_test.dart b/pkg/analysis_server/test/search/top_level_declarations_test.dart
index e383ca6..5e46628 100644
--- a/pkg/analysis_server/test/search/top_level_declarations_test.dart
+++ b/pkg/analysis_server/test/search/top_level_declarations_test.dart
@@ -59,7 +59,7 @@
test_invalidRegex() async {
var result = await findTopLevelDeclarations('[A');
- expect(result, new isInstanceOf<RequestError>());
+ expect(result, const TypeMatcher<RequestError>());
}
test_startEndPattern() async {
diff --git a/pkg/analysis_server/test/services/completion/statement/statement_completion_test.dart b/pkg/analysis_server/test/services/completion/statement/statement_completion_test.dart
index 07a231e..4a4a0aa 100644
--- a/pkg/analysis_server/test/services/completion/statement/statement_completion_test.dart
+++ b/pkg/analysis_server/test/services/completion/statement/statement_completion_test.dart
@@ -35,7 +35,11 @@
int _afterLast(String source, String match) =>
source.lastIndexOf(match) + match.length;
- void _assertHasChange(String message, String expectedCode, [Function cmp]) {
+ void _assertHasChange(
+ String message,
+ String expectedCode, [
+ int Function(String) cmp,
+ ]) {
if (change.message == message) {
if (!change.edits.isEmpty) {
String resultCode =
diff --git a/pkg/analysis_server/test/src/plugin/plugin_manager_test.dart b/pkg/analysis_server/test/src/plugin/plugin_manager_test.dart
index f5cb609..d4757ed 100644
--- a/pkg/analysis_server/test/src/plugin/plugin_manager_test.dart
+++ b/pkg/analysis_server/test/src/plugin/plugin_manager_test.dart
@@ -363,6 +363,7 @@
pkg1Dir.deleteSync(recursive: true);
}
+ @TestTimeout(const Timeout.factor(4))
test_restartPlugins() async {
io.Directory pkg1Dir = io.Directory.systemTemp.createTempSync('pkg1');
String pkg1Path = pkg1Dir.resolveSymbolicLinksSync();
diff --git a/pkg/analysis_server/test/src/plugin/request_converter_test.dart b/pkg/analysis_server/test/src/plugin/request_converter_test.dart
index f306b92..527623b 100644
--- a/pkg/analysis_server/test/src/plugin/request_converter_test.dart
+++ b/pkg/analysis_server/test/src/plugin/request_converter_test.dart
@@ -76,7 +76,7 @@
expect(result, isNotNull);
Map<String, dynamic> pluginFiles = result.files;
expect(pluginFiles, hasLength(2));
- expect(pluginFiles['file1'], new isInstanceOf<AddContentOverlay>());
- expect(pluginFiles['file2'], new isInstanceOf<AddContentOverlay>());
+ expect(pluginFiles['file1'], const TypeMatcher<AddContentOverlay>());
+ expect(pluginFiles['file2'], const TypeMatcher<AddContentOverlay>());
}
}
diff --git a/pkg/analysis_server/test/stress/utilities/git.dart b/pkg/analysis_server/test/stress/utilities/git.dart
index 6a1ff4f..1be2307 100644
--- a/pkg/analysis_server/test/stress/utilities/git.dart
+++ b/pkg/analysis_server/test/stress/utilities/git.dart
@@ -423,7 +423,8 @@
*/
BlobDiff getBlobDiff(String srcBlob, String dstBlob) {
ProcessResult result = _run(['diff', '-U0', srcBlob, dstBlob]);
- List<String> diffResults = LineSplitter.split(result.stdout).toList();
+ List<String> diffResults =
+ LineSplitter.split(result.stdout as String).toList();
return new BlobDiff._(diffResults);
}
@@ -444,7 +445,7 @@
srcCommit,
dstCommit
]);
- return new CommitDelta._(this, result.stdout);
+ return new CommitDelta._(this, result.stdout as String);
}
/**
@@ -453,7 +454,8 @@
*/
LinearCommitHistory getCommitHistory() {
ProcessResult result = _run(['rev-list', '--first-parent', 'HEAD']);
- List<String> commitIds = LineSplitter.split(result.stdout).toList();
+ List<String> commitIds =
+ LineSplitter.split(result.stdout as String).toList();
return new LinearCommitHistory(this, commitIds);
}
diff --git a/pkg/analysis_server/tool/spec/from_html.dart b/pkg/analysis_server/tool/spec/from_html.dart
index 26c6eb9..79f5882 100644
--- a/pkg/analysis_server/tool/spec/from_html.dart
+++ b/pkg/analysis_server/tool/spec/from_html.dart
@@ -214,7 +214,7 @@
checkAttributes(html, ['event'], context,
optionalAttributes: ['experimental']);
bool experimental = html.attributes['experimental'] == 'true';
- TypeDecl params;
+ TypeObject params;
recurse(html, context, {
'params': (dom.Element child) {
params = typeObjectFromHtml(child, '$context.params');
@@ -368,8 +368,8 @@
String kind = html.attributes['kind'];
String context = kind != null ? kind : 'refactoring';
checkAttributes(html, ['kind'], context);
- TypeDecl feedback;
- TypeDecl options;
+ TypeObject feedback;
+ TypeObject options;
recurse(html, context, {
'feedback': (dom.Element child) {
feedback = typeObjectFromHtml(child, '$context.feedback');
@@ -425,8 +425,8 @@
optionalAttributes: ['experimental', 'deprecated']);
bool experimental = html.attributes['experimental'] == 'true';
bool deprecated = html.attributes['deprecated'] == 'true';
- TypeDecl params;
- TypeDecl result;
+ TypeObject params;
+ TypeObject result;
recurse(html, context, {
'params': (dom.Element child) {
params = typeObjectFromHtml(child, '$context.params');
diff --git a/pkg/analyzer/analysis_options.yaml b/pkg/analyzer/analysis_options.yaml
index 9bacf2b..e36185e 100644
--- a/pkg/analyzer/analysis_options.yaml
+++ b/pkg/analyzer/analysis_options.yaml
@@ -1,5 +1,3 @@
-analyzer:
- strong-mode: true
linter:
rules:
- empty_constructor_bodies
diff --git a/pkg/analyzer/lib/error/error.dart b/pkg/analyzer/lib/error/error.dart
index 2b24f8c..7a74867 100644
--- a/pkg/analyzer/lib/error/error.dart
+++ b/pkg/analyzer/lib/error/error.dart
@@ -43,14 +43,17 @@
//
AnalysisOptionsErrorCode.PARSE_ERROR,
AnalysisOptionsErrorCode.INCLUDED_FILE_PARSE_ERROR,
+ AnalysisOptionsWarningCode.ANALYSIS_OPTION_DEPRECATED,
AnalysisOptionsWarningCode.INCLUDE_FILE_NOT_FOUND,
AnalysisOptionsWarningCode.INCLUDED_FILE_WARNING,
+ AnalysisOptionsWarningCode.INVALID_SECTION_FORMAT,
AnalysisOptionsWarningCode.UNRECOGNIZED_ERROR_CODE,
AnalysisOptionsWarningCode.UNSUPPORTED_OPTION_WITH_LEGAL_VALUE,
AnalysisOptionsWarningCode.UNSUPPORTED_OPTION_WITH_LEGAL_VALUES,
AnalysisOptionsWarningCode.UNSUPPORTED_VALUE,
+ AnalysisOptionsWarningCode.SPEC_MODE_REMOVED,
AnalysisOptionsHintCode.DEPRECATED_ANALYSIS_OPTIONS_FILE_NAME,
- AnalysisOptionsHintCode.SPEC_MODE_DEPRECATED,
+ AnalysisOptionsHintCode.STRONG_MODE_SETTING_DEPRECATED,
CheckedModeCompileTimeErrorCode.CONST_CONSTRUCTOR_FIELD_TYPE_MISMATCH,
CheckedModeCompileTimeErrorCode.CONST_CONSTRUCTOR_PARAM_TYPE_MISMATCH,
CheckedModeCompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION,
@@ -139,6 +142,7 @@
CompileTimeErrorCode.IMPLEMENTS_NON_CLASS,
CompileTimeErrorCode.IMPLEMENTS_REPEATED,
CompileTimeErrorCode.IMPLEMENTS_SUPER_CLASS,
+ CompileTimeErrorCode.IMPLICIT_CALL_OF_NON_METHOD,
CompileTimeErrorCode.IMPLICIT_THIS_REFERENCE_IN_INITIALIZER,
CompileTimeErrorCode.IMPORT_INTERNAL_LIBRARY,
CompileTimeErrorCode.IMPORT_OF_NON_LIBRARY,
@@ -201,6 +205,8 @@
CompileTimeErrorCode.NON_CONSTANT_VALUE_IN_INITIALIZER_FROM_DEFERRED_LIBRARY,
CompileTimeErrorCode.NON_CONST_MAP_AS_EXPRESSION_STATEMENT,
CompileTimeErrorCode.NON_GENERATIVE_CONSTRUCTOR,
+ CompileTimeErrorCode.NON_SYNC_ABSTRACT_METHOD,
+ CompileTimeErrorCode.NON_SYNC_FACTORY_METHOD,
CompileTimeErrorCode.NOT_ENOUGH_REQUIRED_ARGUMENTS,
CompileTimeErrorCode.NO_ANNOTATION_CONSTRUCTOR_ARGUMENTS,
CompileTimeErrorCode.NO_DEFAULT_SUPER_CONSTRUCTOR_EXPLICIT,
@@ -234,6 +240,7 @@
CompileTimeErrorCode.SUPER_IN_REDIRECTING_CONSTRUCTOR,
CompileTimeErrorCode.TYPE_ALIAS_CANNOT_REFERENCE_ITSELF,
CompileTimeErrorCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS,
+ CompileTimeErrorCode.TYPE_PARAMETER_ON_CONSTRUCTOR,
CompileTimeErrorCode.UNDEFINED_ANNOTATION,
CompileTimeErrorCode.UNDEFINED_CLASS,
CompileTimeErrorCode.UNDEFINED_CONSTRUCTOR_IN_INITIALIZER,
diff --git a/pkg/analyzer/lib/src/analysis_options/error/option_codes.dart b/pkg/analyzer/lib/src/analysis_options/error/option_codes.dart
index 00b8201..2e2258c 100644
--- a/pkg/analyzer/lib/src/analysis_options/error/option_codes.dart
+++ b/pkg/analyzer/lib/src/analysis_options/error/option_codes.dart
@@ -58,6 +58,13 @@
*/
class AnalysisOptionsWarningCode extends ErrorCode {
/**
+ * An error code indicating that the given option is deprecated.
+ */
+ static const AnalysisOptionsWarningCode ANALYSIS_OPTION_DEPRECATED =
+ const AnalysisOptionsWarningCode('ANALYSIS_OPTION_DEPRECATED',
+ "The option '{0}' is no longer supported.");
+
+ /**
* An error code indicating a specified include file could not be found.
*
* Parameters:
@@ -136,6 +143,26 @@
correction: "Try using one of the supported options: {2}.");
/**
+ * An error code indicating an invalid format for an options file section.
+ *
+ * Parameters:
+ * 0: the section name
+ */
+ static const AnalysisOptionsWarningCode INVALID_SECTION_FORMAT =
+ const AnalysisOptionsWarningCode(
+ 'INVALID_SECTION_FORMAT', "Invalid format for the '{0}' section.");
+
+ /**
+ * An error code indicating that strong-mode: false is has been removed.
+ */
+ static const AnalysisOptionsWarningCode SPEC_MODE_REMOVED =
+ const AnalysisOptionsWarningCode('SPEC_MODE_REMOVED',
+ "The option 'strong-mode: false' is no longer supported.",
+ correction:
+ "It's recommended to remove the 'strong-mode:' setting (and make "
+ "your code Dart 2 compliant).");
+
+ /**
* Initialize a newly created warning code to have the given [name].
*/
const AnalysisOptionsWarningCode(String name, String message,
@@ -157,21 +184,20 @@
* Parameters:
* 0: the uri of the file which should be renamed
*/
- static const ErrorCode DEPRECATED_ANALYSIS_OPTIONS_FILE_NAME =
+ static const AnalysisOptionsHintCode DEPRECATED_ANALYSIS_OPTIONS_FILE_NAME =
const AnalysisOptionsHintCode(
'DEPRECATED_ANALYSIS_OPTIONS_FILE_NAME',
"The name of the analysis options file {0} is deprecated;"
" consider renaming it to analysis_options.yaml.");
/**
- * An error code indicating that strong-mode: false is being deprecated.
+ * An error code indicating that strong-mode: true is deprecated.
*/
- static const AnalysisOptionsHintCode SPEC_MODE_DEPRECATED =
- const AnalysisOptionsHintCode('SPEC_MODE_DEPRECATED',
- "The option 'strong-mode: false' is being deprecated.",
+ static const AnalysisOptionsHintCode STRONG_MODE_SETTING_DEPRECATED =
+ const AnalysisOptionsHintCode('STRONG_MODE_SETTING_DEPRECATED',
+ "The 'strong-mode: true' setting is deprecated.",
correction:
- "It's recommended to use 'strong-mode: true' and make your code "
- "strong mode clean.");
+ "It is no longer necessary to explicitly enable strong mode.");
/**
* Initialize a newly created hint code to have the given [name].
diff --git a/pkg/analyzer/lib/src/dart/analysis/frontend_resolution.dart b/pkg/analyzer/lib/src/dart/analysis/frontend_resolution.dart
index eb7f1d8..5d1c2b2 100644
--- a/pkg/analyzer/lib/src/dart/analysis/frontend_resolution.dart
+++ b/pkg/analyzer/lib/src/dart/analysis/frontend_resolution.dart
@@ -61,13 +61,13 @@
/// The wrapper around FrontEnd compiler that can be used incrementally.
///
/// When the client needs the kernel, resolution information, and errors for
-/// a library, it should call [getResolution]. The compiler will compile the library
+/// a library, it should call [compile]. The compiler will compile the library
/// and the transitive closure of its dependencies. The results are cached,
/// so the next invocation for a dependency will be served from the cache.
///
/// If a file is changed, [invalidate] should be invoked. This will invalidate
/// the file, its library, and the transitive closure of dependencies. So, the
-/// next invocation of [getResolution] will recompile libraries required for the
+/// next invocation of [compile] will recompile libraries required for the
/// requested library.
class FrontEndCompiler {
static const MSG_PENDING_COMPILE =
@@ -88,6 +88,10 @@
/// The listener / recorder for compilation errors produced by the compiler.
final _ErrorListener _errorListener;
+ /// Each key is the absolute URI of a library.
+ /// Each value is the compilation result of the key library.
+ final Map<Uri, LibraryCompilationResult> _results = {};
+
/// The [Component] with currently valid libraries. When a file is invalidated,
/// we remove the file, its library, and everything affected from [_component].
Component _component = new Component();
@@ -104,7 +108,7 @@
/// Each value is the file system URI of the library that sources the part.
final Map<Uri, Uri> _partToLibrary = {};
- /// Whether [getResolution] is executing.
+ /// Whether [compile] is executing.
bool _isCompileExecuting = false;
factory FrontEndCompiler(
@@ -175,125 +179,38 @@
: _logger = _options.logger,
_fileSystem = _options.fileSystem;
- /// Return the outline of the library with the given absolute [uri], and
- /// everything it depends on.
+ /// Compile the library with the given absolute [uri], and everything it
+ /// depends on. Return the result of the requested library compilation.
///
- /// If there is the cached outline for the library (computed directly, or as
- /// a result of computing the outline of another library), it will be
- /// returned quickly.
+ /// If there is the cached result for the library (compiled directly, or as
+ /// a result of compilation of another library), it will be returned quickly.
///
/// Throw [StateError] if another compilation is pending.
- Future<LibraryOutlineResult> getOutline(Uri uri) {
+ Future<LibraryCompilationResult> compile(Uri uri) {
if (_isCompileExecuting) {
throw new StateError(MSG_PENDING_COMPILE);
}
_isCompileExecuting = true;
- // TODO(scheglov) Do we need a map?
- if (_component.root.hasChild('$uri')) {
- _isCompileExecuting = false;
- // TODO(scheglov) Can we keep the same instance?
- var types = new TypeEnvironment(
- new CoreTypes(_component), new ClassHierarchy(_component));
- var result = new LibraryOutlineResult(_component, types);
- return new Future.value(result);
- }
-
- return _runWithFrontEndContext('Compute outline', () async {
- try {
- var dillTarget =
- new DillTarget(_options.ticker, uriTranslator, _options.target);
-
- // Append all libraries what we still have in the current component.
- await _logger.runAsync('Load dill libraries', () async {
- dillTarget.loader.appendLibraries(_component);
- await dillTarget.buildOutlines();
- });
-
- // Create the target for computing the outline of the library.
- var kernelTarget = new KernelTarget(
- _fileSystem, true, dillTarget, uriTranslator,
- metadataCollector: new AnalyzerMetadataCollector());
- kernelTarget.read(uri);
-
- // Compute new outlines.
- var newComponent = await _logger.runAsync('Compile', () async {
- await kernelTarget.buildOutlines(nameRoot: _component.root);
- return await kernelTarget.buildComponent();
- });
-
- // Add new libraries to the current component.
- if (newComponent != null) {
- // When a file is used in a `part` directive of a library, but does
- // not have a `part of` itself, we get this file both as a part,
- // and as a library. This causes an exception later in resolution.
- var partFileUris = new Set<Uri>();
- for (var library in newComponent.libraries) {
- var libraryFileUri = library.fileUri;
- for (var part in library.parts) {
- var partFileUri = libraryFileUri.resolve(part.partUri);
- if (partFileUri != libraryFileUri) {
- partFileUris.add(partFileUri);
- }
- }
- }
- // Do add new libraries.
- for (var library in newComponent.libraries) {
- if (!partFileUris.contains(library.fileUri)) {
- Uri uri = library.importUri;
- if (!_component.root.hasChild('$uri')) {
- _component.root.getChildFromUri(uri).bindTo(library.reference);
- library.computeCanonicalNames();
- _component.libraries.add(library);
- }
- }
- }
- }
-
- _logger.run('Compute dependencies', _computeDependencies);
-
- // TODO(scheglov) Can we keep the same instance?
- var types = new TypeEnvironment(
- new CoreTypes(_component), new ClassHierarchy(_component));
- return new LibraryOutlineResult(_component, types);
- } finally {
+ {
+ LibraryCompilationResult result = _results[uri];
+ if (result != null) {
_isCompileExecuting = false;
+ return new Future.value(result);
}
- });
- }
-
- /// Compute resolution for the library with the given absolute [uri] and
- /// all its parts.
- ///
- /// Throw [StateError] if another compilation is pending.
- Future<LibraryCompilationResult> getResolution(Uri uri) {
- if (_isCompileExecuting) {
- throw new StateError(MSG_PENDING_COMPILE);
}
- _isCompileExecuting = true;
return _runWithFrontEndContext('Compile', () async {
+ // TODO(brianwilkerson) Determine whether this await is necessary.
+ await null;
try {
- // Remove the requested library outline from the component.
- Library libraryOutline;
- for (var library in _component.libraries) {
- if (library.importUri == uri) {
- libraryOutline = library;
- _component.libraries.remove(library);
- _component.root.removeChild('$uri');
- break;
- }
- }
- if (libraryOutline == null) {
- throw new StateError('Expected to find $uri in the component.');
- }
- libraryOutline.canonicalName.getChild('IntWrapper');
-
var dillTarget =
new DillTarget(_options.ticker, uriTranslator, _options.target);
// Append all libraries what we still have in the current component.
await _logger.runAsync('Load dill libraries', () async {
+ // TODO(brianwilkerson) Determine whether this await is necessary.
+ await null;
dillTarget.loader.appendLibraries(_component);
await dillTarget.buildOutlines();
});
@@ -303,54 +220,54 @@
uriTranslator, new AnalyzerMetadataCollector());
kernelTarget.read(uri);
- // Resolve the requested library.
- Component newComponent = await _logger.runAsync('Compile', () async {
+ // Compile the entry point into the new component.
+ _component = await _logger.runAsync('Compile', () async {
+ // TODO(brianwilkerson) Determine whether this await is necessary.
+ await null;
await kernelTarget.buildOutlines(nameRoot: _component.root);
- return await kernelTarget.buildComponent();
+ return await kernelTarget.buildComponent() ?? _component;
});
- // Put the library outline back into the current component.
- _component.root.adoptChild(libraryOutline.canonicalName);
- _component.libraries.add(libraryOutline);
+ // TODO(scheglov) Only for new libraries?
+ _component.computeCanonicalNames();
- // Compute canonical names for the resolved library.
- for (var library in newComponent.libraries) {
- if (library.importUri == uri) {
- library.reference.canonicalName = _component.root.getChild('$uri');
- library.computeCanonicalNames();
- break;
- }
- }
+ _logger.run('Compute dependencies', _computeDependencies);
// TODO(scheglov) Can we keep the same instance?
var types = new TypeEnvironment(
new CoreTypes(_component), new ClassHierarchy(_component));
- Uri libraryFileUri = libraryOutline.fileUri;
- var libraryResolutions = kernelTarget.resolutions[libraryFileUri];
- if (libraryResolutions == null) {
- throw new StateError('Expected to find $uri in resolutions.');
- }
- // TODO(scheglov) Check that we have exactly one resolution?
- var files = <Uri, FileCompilationResult>{};
+ // Add results for new libraries.
+ for (var library in _component.libraries) {
+ if (!_results.containsKey(library.importUri)) {
+ Map<Uri, List<CollectedResolution>> libraryResolutions =
+ kernelTarget.resolutions[library.fileUri];
- void addFileResult(Uri fileUri) {
- if (libraryResolutions != null) {
- files[fileUri] = new FileCompilationResult(
- fileUri,
- libraryResolutions[fileUri] ?? [],
- _errorListener.fileUriToErrors[fileUri] ?? []);
+ var files = <Uri, FileCompilationResult>{};
+
+ void addFileResult(Uri fileUri) {
+ if (libraryResolutions != null) {
+ files[fileUri] = new FileCompilationResult(
+ fileUri,
+ libraryResolutions[fileUri] ?? [],
+ _errorListener.fileUriToErrors[fileUri] ?? []);
+ }
+ }
+
+ addFileResult(library.fileUri);
+ for (var part in library.parts) {
+ addFileResult(library.fileUri.resolve(part.partUri));
+ }
+
+ var libraryResult = new LibraryCompilationResult(
+ _component, types, library.importUri, library, files);
+ _results[library.importUri] = libraryResult;
}
}
-
- addFileResult(libraryFileUri);
- for (var part in libraryOutline.parts) {
- addFileResult(libraryFileUri.resolve(part.partUri));
- }
_errorListener.fileUriToErrors.clear();
- return new LibraryCompilationResult(
- _component, types, libraryOutline.importUri, libraryOutline, files);
+ // The result must have been computed.
+ return _results[uri];
} finally {
_isCompileExecuting = false;
}
@@ -359,7 +276,7 @@
/// Invalidate the file with the given file [uri], its library and the
/// transitive the of libraries that use it. The next time when any of these
- /// libraries is be requested in [getResolution], it will be recompiled again.
+ /// libraries is be requested in [compile], it will be recompiled again.
void invalidate(Uri uri) {
void invalidateLibrary(Uri libraryUri) {
Library library = _uriToLibrary.remove(libraryUri);
@@ -369,6 +286,7 @@
_component.libraries.remove(library);
_component.root.removeChild('${library.importUri}');
_component.uriToSource.remove(libraryUri);
+ _results.remove(library.importUri);
// Recursively invalidate dependencies.
Set<Uri> directDependencies =
@@ -445,20 +363,6 @@
this.component, this.types, this.uri, this.kernel, this.files);
}
-/// The outline result for a single library.
-class LibraryOutlineResult {
- /// The full current [Component]. It has all libraries that are required by
- /// this library, but might also have other libraries, that are not required.
- ///
- /// The object is mutable, and is changed when files are invalidated.
- final Component component;
-
- /// The [TypeEnvironment] for the [component].
- final TypeEnvironment types;
-
- LibraryOutlineResult(this.component, this.types);
-}
-
/// The [DietListener] that record resolution information.
class _AnalyzerDietListener extends DietListener {
final Map<Uri, List<CollectedResolution>> _resolutions;
@@ -474,7 +378,7 @@
StackListener createListener(
ModifierBuilder builder, Scope memberScope, bool isInstanceMember,
[Scope formalParameterScope,
- TypeInferenceListener<int, int, Node, int> listener]) {
+ TypeInferenceListener<int, Node, int> listener]) {
ResolutionStorer storer;
var fileResolutions = _resolutions[builder.fileUri];
if (fileResolutions == null) {
diff --git a/pkg/analyzer/lib/src/dart/analysis/kernel_context.dart b/pkg/analyzer/lib/src/dart/analysis/kernel_context.dart
index 4a9b2c5..d24f96f 100644
--- a/pkg/analyzer/lib/src/dart/analysis/kernel_context.dart
+++ b/pkg/analyzer/lib/src/dart/analysis/kernel_context.dart
@@ -84,19 +84,27 @@
// TODO(brianwilkerson) Determine whether this await is necessary.
await null;
Uri targetUri = targetLibrary.uri;
- LibraryOutlineResult outlineResult = await compiler.getOutline(targetUri);
+ LibraryCompilationResult compilationResult =
+ await compiler.compile(targetUri);
// Remember Kernel libraries produced by the compiler.
// There might be more libraries than we actually need.
// This is probably OK, because we consume them lazily.
var libraryMap = <String, kernel.Library>{};
var libraryExistMap = <String, bool>{};
- for (var library in outlineResult.component.libraries) {
+ bool coreFound = false;
+ for (var library in compilationResult.component.libraries) {
String uriStr = library.importUri.toString();
+ if (uriStr == 'dart:core') {
+ coreFound = true;
+ }
libraryMap[uriStr] = library;
FileState file = fsState.getFileForUri(library.importUri);
libraryExistMap[uriStr] = file?.exists ?? false;
}
+ if (!coreFound) {
+ throw new StateError('No dart:core library found (dartbug.com/33686)');
+ }
if (DEBUG) {
print('----------- ${targetLibrary.uriStr}');
@@ -115,8 +123,8 @@
analysisContext.contentCache = new _ContentCacheWrapper(fsState);
// Create the resynthesizer bound to the analysis context.
- var resynthesizer = new KernelResynthesizer(
- analysisContext, outlineResult.types, libraryMap, libraryExistMap);
+ var resynthesizer = new KernelResynthesizer(analysisContext,
+ compilationResult.types, libraryMap, libraryExistMap);
return new KernelContext._(analysisContext, resynthesizer);
});
diff --git a/pkg/analyzer/lib/src/dart/analysis/library_analyzer.dart b/pkg/analyzer/lib/src/dart/analysis/library_analyzer.dart
index a7510b0..c486315 100644
--- a/pkg/analyzer/lib/src/dart/analysis/library_analyzer.dart
+++ b/pkg/analyzer/lib/src/dart/analysis/library_analyzer.dart
@@ -205,7 +205,7 @@
_resolveDirectives(units);
var libraryResult = await _logger.runAsync('Compile library', () {
- return _frontEndCompiler.getResolution(_library.uri);
+ return _frontEndCompiler.compile(_library.uri);
});
_logger.run('Apply resolution', () {
@@ -549,6 +549,14 @@
}
ErrorReporter libraryErrorReporter = _getErrorReporter(_library);
+
+ void reportErrorReportedByFrontEnd(
+ ErrorCode errorCode, AstNode node, List<Object> arguments) {
+ if (!_enableKernelDriver) {
+ libraryErrorReporter.reportErrorForNode(errorCode, node, arguments);
+ }
+ }
+
LibraryIdentifier libraryNameNode = null;
var seenPartSources = new Set<Source>();
var directivesToResolve = <Directive>[];
@@ -604,7 +612,7 @@
// Validate that the part source is unique in the library.
//
if (!seenPartSources.add(partSource)) {
- libraryErrorReporter.reportErrorForNode(
+ reportErrorReportedByFrontEnd(
CompileTimeErrorCode.DUPLICATE_PART, partUri, [partSource.uri]);
}
@@ -616,18 +624,16 @@
_NameOrSource nameOrSource = _getPartLibraryNameOrUri(
partSource, partUnit, directivesToResolve);
if (nameOrSource == null) {
- libraryErrorReporter.reportErrorForNode(
- CompileTimeErrorCode.PART_OF_NON_PART,
- partUri,
- [partUri.toSource()]);
+ reportErrorReportedByFrontEnd(CompileTimeErrorCode.PART_OF_NON_PART,
+ partUri, [partUri.toSource()]);
} else {
String name = nameOrSource.name;
if (name != null) {
if (libraryNameNode == null) {
- libraryErrorReporter.reportErrorForNode(
+ reportErrorReportedByFrontEnd(
ResolverErrorCode.PART_OF_UNNAMED_LIBRARY, partUri, [name]);
} else if (libraryNameNode.name != name) {
- libraryErrorReporter.reportErrorForNode(
+ reportErrorReportedByFrontEnd(
StaticWarningCode.PART_OF_DIFFERENT_LIBRARY,
partUri,
[libraryNameNode.name, name]);
@@ -635,7 +641,7 @@
} else {
Source source = nameOrSource.source;
if (source != _library.source) {
- libraryErrorReporter.reportErrorForNode(
+ reportErrorReportedByFrontEnd(
StaticWarningCode.PART_OF_DIFFERENT_LIBRARY,
partUri,
[_library.uriStr, source.uri]);
@@ -778,7 +784,7 @@
}
} else if (member is FieldDeclaration) {
List<VariableDeclaration> fields = member.fields.variables;
- var context = fields[0].element as ElementImpl;
+ var context = fields[0].element.initializer as ElementImpl;
var resolution = resolutions.next();
var applier = _createResolutionApplier(
context, resolution, unit.localDeclarations);
@@ -816,7 +822,7 @@
// No bodies to resolve.
} else if (declaration is TopLevelVariableDeclaration) {
List<VariableDeclaration> variables = declaration.variables.variables;
- var context = variables[0].element as ElementImpl;
+ var context = variables[0].element.initializer as ElementImpl;
var resolution = resolutions.next();
var applier = _createResolutionApplier(
context, resolution, unit.localDeclarations);
@@ -1112,6 +1118,23 @@
context = contextStack.removeLast();
}
+ @override
+ DartType translateType(kernel.DartType kernelType) {
+ if (kernelType == null) {
+ return null;
+ } else if (kernelType is kernel.TypeArgumentsDartType) {
+ // TODO(paulberry): get rid of this case
+ List<kernel.DartType> kernelTypes = kernelType.types;
+ var types = new List<DartType>(kernelTypes.length);
+ for (var i = 0; i < kernelTypes.length; i++) {
+ types[i] = translateType(kernelTypes[i]);
+ }
+ return new TypeArgumentsDartType(types);
+ } else {
+ return resynthesizer.getType(context, kernelType);
+ }
+ }
+
Element _translateDeclaration(int declarationOffset) {
if (declarationOffset == null) return null;
var declaration = localDeclarations[declarationOffset];
@@ -1151,6 +1174,10 @@
element = resynthesizer
.getElementFromCanonicalName(referencedNode.classNode.canonicalName);
assert(element != null);
+ } else if (referencedNode is kernel.TypeParameterType) {
+ element =
+ resynthesizer.getTypeParameter(context, referencedNode.parameter);
+ assert(element != null);
} else if (referencedNode is kernel.DynamicType) {
element = DynamicElementImpl.instance;
} else {
@@ -1163,23 +1190,6 @@
return element;
}
}
-
- @override
- DartType translateType(kernel.DartType kernelType) {
- if (kernelType == null) {
- return null;
- } else if (kernelType is kernel.TypeArgumentsDartType) {
- // TODO(paulberry): get rid of this case
- List<kernel.DartType> kernelTypes = kernelType.types;
- var types = new List<DartType>(kernelTypes.length);
- for (var i = 0; i < kernelTypes.length; i++) {
- types[i] = translateType(kernelTypes[i]);
- }
- return new TypeArgumentsDartType(types);
- } else {
- return resynthesizer.getType(context, kernelType);
- }
- }
}
/// [Iterator] like object that provides [CollectedResolution]s.
diff --git a/pkg/analyzer/lib/src/dart/analysis/search.dart b/pkg/analyzer/lib/src/dart/analysis/search.dart
index b5417e9..6ab014f 100644
--- a/pkg/analyzer/lib/src/dart/analysis/search.dart
+++ b/pkg/analyzer/lib/src/dart/analysis/search.dart
@@ -767,16 +767,19 @@
* Container that keeps track of file owners.
*/
class SearchedFiles {
- final Map<Uri, Search> owners = {};
+ final Map<String, Search> pathOwners = {};
+ final Map<Uri, Search> uriOwners = {};
bool add(String path, Search search) {
var file = search._driver.fsState.getFileForPath(path);
- var owner = owners[file.uri];
- if (owner == null) {
- owners[file.uri] = search;
+ var pathOwner = pathOwners[path];
+ var uriOwner = uriOwners[file.uri];
+ if (pathOwner == null && uriOwner == null) {
+ pathOwners[path] = search;
+ uriOwners[file.uri] = search;
return true;
}
- return identical(owner, search);
+ return identical(pathOwner, search) && identical(uriOwner, search);
}
void ownAdded(Search search) {
diff --git a/pkg/analyzer/lib/src/dart/constant/evaluation.dart b/pkg/analyzer/lib/src/dart/constant/evaluation.dart
index eb2e46b..05dc928 100644
--- a/pkg/analyzer/lib/src/dart/constant/evaluation.dart
+++ b/pkg/analyzer/lib/src/dart/constant/evaluation.dart
@@ -74,9 +74,6 @@
*/
final ConstantEvaluationValidator validator;
- /** Whether we are running in strong mode. */
- final bool strongMode;
-
/**
* Initialize a newly created [ConstantEvaluationEngine]. The [typeProvider]
* is used to access known types. [_declaredVariables] is the set of
@@ -87,8 +84,6 @@
ConstantEvaluationEngine(TypeProvider typeProvider, this._declaredVariables,
{ConstantEvaluationValidator validator, TypeSystem typeSystem})
: typeProvider = typeProvider,
- strongMode =
- typeProvider.objectType.element.context.analysisOptions.strongMode,
validator =
validator ?? new ConstantEvaluationValidator_ForProduction(),
typeSystem = typeSystem ?? new TypeSystemImpl(typeProvider);
@@ -532,21 +527,6 @@
return new DartObjectImpl.validWithUnknownValue(definingClass);
}
- // In strong mode, we allow constants to have type arguments.
- //
- // They will be added to the lexical environment when evaluating
- // subexpressions.
- Map<String, DartObjectImpl> typeArgumentMap;
- if (strongMode) {
- // Instantiate the constructor with the in-scope type arguments.
- definingClass = constantVisitor.evaluateType(definingClass);
- constructor = ConstructorMember.from(constructorBase, definingClass);
-
- typeArgumentMap = new HashMap<String, DartObjectImpl>.fromIterables(
- definingClass.typeParameters.map((t) => t.name),
- definingClass.typeArguments.map(constantVisitor.typeConstant));
- }
-
var fieldMap = new HashMap<String, DartObjectImpl>();
// The errors reported while computing values for field initializers, or
@@ -576,8 +556,6 @@
}
}
- var fieldInitVisitor = new ConstantVisitor(this, externalErrorReporter,
- lexicalEnvironment: typeArgumentMap);
// Start with final fields that are initialized at their declaration site.
List<FieldElement> fields = constructor.enclosingElement.fields;
for (int i = 0; i < fields.length; i++) {
@@ -587,12 +565,8 @@
field is ConstFieldElementImpl) {
validator.beforeGetFieldEvaluationResult(field);
- DartObjectImpl fieldValue;
- if (strongMode) {
- fieldValue = field.constantInitializer?.accept(fieldInitVisitor);
- } else {
- fieldValue = field.evaluationResult?.value;
- }
+ DartObjectImpl fieldValue = field.evaluationResult?.value;
+
// It is possible that the evaluation result is null.
// This happens for example when we have duplicate fields.
// class Test {final x = 1; final x = 2; const Test();}
@@ -643,23 +617,13 @@
// The parameter is an optional positional parameter for which no value
// was provided, so use the default value.
validator.beforeGetParameterDefault(baseParameter);
- if (strongMode && baseParameter is ConstVariableElement) {
- var defaultValue =
- (baseParameter as ConstVariableElement).constantInitializer;
- if (defaultValue == null) {
- argumentValue = typeProvider.nullObject;
- } else {
- argumentValue = defaultValue.accept(fieldInitVisitor);
- }
- } else {
- EvaluationResultImpl evaluationResult =
- baseParameter.evaluationResult;
- if (evaluationResult == null) {
- // No default was provided, so the default value is null.
- argumentValue = typeProvider.nullObject;
- } else if (evaluationResult.value != null) {
- argumentValue = evaluationResult.value;
- }
+
+ EvaluationResultImpl evaluationResult = baseParameter.evaluationResult;
+ if (evaluationResult == null) {
+ // No default was provided, so the default value is null.
+ argumentValue = typeProvider.nullObject;
+ } else if (evaluationResult.value != null) {
+ argumentValue = evaluationResult.value;
}
}
if (argumentValue != null) {
@@ -1207,16 +1171,7 @@
*/
DartType evaluateType(DartType type) {
if (type is TypeParameterType) {
- // Constants may only refer to type parameters in strong mode.
- if (!evaluationEngine.strongMode) {
- return null;
- }
-
- String name = type.name;
- if (_lexicalEnvironment != null) {
- return _lexicalEnvironment[name]?.toTypeValue() ?? type;
- }
- return type;
+ return null;
}
if (type is ParameterizedType) {
List<DartType> typeArguments;
@@ -1645,9 +1600,8 @@
return new DartObjectImpl(functionType, new FunctionState(function));
}
} else if (variableElement is TypeDefiningElement) {
- // Constants may only refer to type parameters in strong mode.
- if (evaluationEngine.strongMode ||
- variableElement is! TypeParameterElement) {
+ // Constants may not refer to type parameters.
+ if (variableElement is! TypeParameterElement) {
return new DartObjectImpl(
_typeProvider.typeType, new TypeState(variableElement.type));
}
diff --git a/pkg/analyzer/lib/src/dart/element/element.dart b/pkg/analyzer/lib/src/dart/element/element.dart
index 50fa260..d38993a 100644
--- a/pkg/analyzer/lib/src/dart/element/element.dart
+++ b/pkg/analyzer/lib/src/dart/element/element.dart
@@ -2482,7 +2482,7 @@
if (_redirectedConstructor == null) {
if (_kernelConstructor != null || _kernelFactory != null) {
_redirectedConstructor = enclosingUnit._kernelContext
- .getRedirectedConstructor(_kernelConstructor, _kernelFactory);
+ .getRedirectedConstructor(this, _kernelConstructor, _kernelFactory);
}
if (serializedExecutable != null) {
if (serializedExecutable.isRedirectedConstructor) {
@@ -2810,6 +2810,8 @@
@override
DynamicTypeImpl type;
+ LibraryElement _library;
+
/**
* Initialize a newly created instance of this class. Instances of this class
* should <b>not</b> be created except as part of creating the type associated
@@ -2824,6 +2826,13 @@
ElementKind get kind => ElementKind.DYNAMIC;
@override
+ LibraryElement get library => _library;
+ set library(LibraryElement library) {
+ assert(library.name == 'dart.core');
+ _library = library;
+ }
+
+ @override
T accept<T>(ElementVisitor<T> visitor) => null;
}
@@ -6225,7 +6234,7 @@
* Return the [ConstructorElementImpl] to which the given [kernelConstructor]
* or [kernelFactory] redirects.
*/
- ConstructorElementImpl getRedirectedConstructor(
+ ConstructorElement getRedirectedConstructor(ElementImpl context,
kernel.Constructor kernelConstructor, kernel.Procedure kernelFactory);
/**
@@ -8400,6 +8409,10 @@
@override
List<ElementAnnotation> get metadata {
+ if (_kernel != null) {
+ _metadata ??=
+ enclosingUnit._kernelContext.buildAnnotations(_kernel.annotations);
+ }
if (unlinkedParam != null) {
return _metadata ??=
_buildAnnotations(enclosingUnit, unlinkedParam.annotations);
diff --git a/pkg/analyzer/lib/src/dart/resolver/scope.dart b/pkg/analyzer/lib/src/dart/resolver/scope.dart
index a5533a8..87a6197 100644
--- a/pkg/analyzer/lib/src/dart/resolver/scope.dart
+++ b/pkg/analyzer/lib/src/dart/resolver/scope.dart
@@ -585,6 +585,14 @@
LibraryScope(LibraryElement definingLibrary)
: super(new LibraryImportScope(definingLibrary)) {
_defineTopLevelNames(definingLibrary);
+
+ // For `dart:core` to be able to pass analysis, it has to have `dynamic`
+ // added to its library scope. Note that this is not true of, for instance,
+ // `Object`, because `Object` has a source definition which is not possible
+ // for `dynamic`.
+ if (definingLibrary.isDartCore) {
+ define(DynamicElementImpl.instance);
+ }
}
@override
@@ -749,6 +757,16 @@
for (CompilationUnitElement compilationUnit in library.parts) {
_addPublicNames(definedNames, compilationUnit);
}
+
+ // For libraries that import `dart:core` with a prefix, we have to add
+ // `dynamic` to the `dart:core` [Namespace] specially. Note that this is not
+ // true of, for instance, `Object`, because `Object` has a source definition
+ // which is not possible for `dynamic`.
+ if (library.isDartCore) {
+ DynamicElementImpl.instance.library = library;
+ definedNames['dynamic'] = DynamicElementImpl.instance;
+ }
+
return new Namespace(definedNames);
}
diff --git a/pkg/analyzer/lib/src/error/codes.dart b/pkg/analyzer/lib/src/error/codes.dart
index e7ec4ad..f52e45d 100644
--- a/pkg/analyzer/lib/src/error/codes.dart
+++ b/pkg/analyzer/lib/src/error/codes.dart
@@ -1227,6 +1227,9 @@
"'{0}' can't be used in both 'extends' and 'implements' clauses.",
correction: "Try removing one of the occurances.");
+ static const CompileTimeErrorCode IMPLICIT_CALL_OF_NON_METHOD =
+ const CompileTimeErrorCode.fromFasta('IMPLICIT_CALL_OF_NON_METHOD');
+
/**
* 7.6.1 Generative Constructors: Note that <b>this</b> is not in scope on the
* right hand side of an initializer.
@@ -2031,6 +2034,12 @@
"initializers.",
correction: "Try changing the import to not be deferred.");
+ static const CompileTimeErrorCode NON_SYNC_ABSTRACT_METHOD =
+ const CompileTimeErrorCode.fromFasta('NON_SYNC_ABSTRACT_METHOD');
+
+ static const CompileTimeErrorCode NON_SYNC_FACTORY_METHOD =
+ const CompileTimeErrorCode.fromFasta('NON_SYNC_FACTORY_METHOD');
+
/**
* 12.14.2 Binding Actuals to Formals: It is a static warning if <i>m < h</i>
* or if <i>m > n</i>.
@@ -2436,6 +2445,9 @@
"Typedefs can't reference themselves directly or recursively via "
"another typedef.");
+ static const CompileTimeErrorCode TYPE_PARAMETER_ON_CONSTRUCTOR =
+ const CompileTimeErrorCode.fromFasta('TYPE_PARAMETER_ON_CONSTRUCTOR');
+
/**
* 15 Metadata: Metadata consists of a series of annotations, each of which
* begin with the character @, followed by a constant expression that must be
@@ -2637,6 +2649,14 @@
correction: correction,
isUnresolvedIdentifier: isUnresolvedIdentifier);
+ /**
+ * Initialize a newly created error code to have the given [name]. No message
+ * or correction are necessary because the error code is only used when
+ * translating an error produced by fasta, and both will be taken from the
+ * error being translated.
+ */
+ const CompileTimeErrorCode.fromFasta(String name) : this(name, '');
+
@override
ErrorSeverity get errorSeverity => ErrorType.COMPILE_TIME_ERROR.severity;
diff --git a/pkg/analyzer/lib/src/fasta/ast_builder.dart b/pkg/analyzer/lib/src/fasta/ast_builder.dart
index 097764a..20e611f 100644
--- a/pkg/analyzer/lib/src/fasta/ast_builder.dart
+++ b/pkg/analyzer/lib/src/fasta/ast_builder.dart
@@ -922,7 +922,7 @@
}
}
- void handleAsOperator(Token asOperator, Token endToken) {
+ void handleAsOperator(Token asOperator) {
assert(optional('as', asOperator));
debugEvent("AsOperator");
@@ -964,7 +964,7 @@
push(ast.continueStatement(continueKeyword, label, semicolon));
}
- void handleIsOperator(Token isOperator, Token not, Token endToken) {
+ void handleIsOperator(Token isOperator, Token not) {
assert(optional('is', isOperator));
assert(optionalOrNull('!', not));
debugEvent("IsOperator");
diff --git a/pkg/analyzer/lib/src/fasta/error_converter.dart b/pkg/analyzer/lib/src/fasta/error_converter.dart
index 17763f1..d988e9e 100644
--- a/pkg/analyzer/lib/src/fasta/error_converter.dart
+++ b/pkg/analyzer/lib/src/fasta/error_converter.dart
@@ -5,6 +5,7 @@
import 'package:analyzer/analyzer.dart';
import 'package:analyzer/dart/ast/token.dart' show Token;
import 'package:analyzer/src/dart/error/syntactic_errors.dart';
+import 'package:analyzer/src/generated/resolver.dart' show ResolverErrorCode;
import 'package:front_end/src/api_prototype/compilation_message.dart';
import 'package:front_end/src/fasta/messages.dart' show Code, Message;
@@ -509,6 +510,12 @@
errorReporter?.reportErrorForOffset(
ParserErrorCode.PREFIX_AFTER_COMBINATOR, offset, length);
return;
+ case "RECURSIVE_CONSTRUCTOR_REDIRECT":
+ errorReporter?.reportErrorForOffset(
+ CompileTimeErrorCode.RECURSIVE_CONSTRUCTOR_REDIRECT,
+ offset,
+ length);
+ return;
case "REDIRECTING_CONSTRUCTOR_WITH_BODY":
errorReporter?.reportErrorForOffset(
ParserErrorCode.REDIRECTING_CONSTRUCTOR_WITH_BODY, offset, length);
@@ -635,6 +642,11 @@
}
void reportCompilationMessage(CompilationMessage message) {
+ // TODO(scheglov) https://github.com/dart-lang/sdk/issues/33680
+ if (message.code == 'MissingImplementationCause') {
+ return;
+ }
+
String errorCodeStr = message.analyzerCode;
ErrorCode errorCode = _getErrorCode(errorCodeStr);
if (errorCode != null) {
@@ -645,8 +657,13 @@
errorCode,
message.message,
message.tip));
- } else {
- // TODO(mfairhurst) throw here, and fail all tests that trip this.
+ } else if (message.severity != Severity.context) {
+ // Messages with [Severity.context] are supposed to give extra information
+ // to messages of other kinds, and it should be possible to ignore them
+ // without affecting the discoverability of compile-time errors. See also
+ // https://github.com/dart-lang/sdk/issues/33730.
+ throw new StateError('Unable to convert (${message.code}, $errorCodeStr, '
+ '@${message.span.start.offset}, $message)');
}
}
@@ -681,13 +698,16 @@
/// Return the [ErrorCode] for the given [shortName], or `null` if not found.
static ErrorCode _getErrorCode(String shortName) {
const prefixes = const {
- CompileTimeErrorCode: 'CompileTimeErrorCode',
- ParserErrorCode: 'ParserErrorCode',
- StaticTypeWarningCode: 'StaticTypeWarningCode',
- StaticWarningCode: 'StaticWarningCode'
+ CompileTimeErrorCode: 'CompileTimeErrorCode.',
+ StrongModeCode: 'StrongModeCode.STRONG_MODE_',
+ ResolverErrorCode: 'ResolverErrorCode.',
+ ParserErrorCode: 'ParserErrorCode.',
+ ScannerErrorCode: 'ScannerErrorCode.',
+ StaticTypeWarningCode: 'StaticTypeWarningCode.',
+ StaticWarningCode: 'StaticWarningCode.'
};
for (var prefix in prefixes.values) {
- var uniqueName = '$prefix.$shortName';
+ var uniqueName = '$prefix$shortName';
var errorCode = errorCodeByUniqueName(uniqueName);
if (errorCode != null) {
return errorCode;
diff --git a/pkg/analyzer/lib/src/fasta/resolution_applier.dart b/pkg/analyzer/lib/src/fasta/resolution_applier.dart
index 5471ac5..08e71d0 100644
--- a/pkg/analyzer/lib/src/fasta/resolution_applier.dart
+++ b/pkg/analyzer/lib/src/fasta/resolution_applier.dart
@@ -11,6 +11,7 @@
import 'package:analyzer/src/dart/element/element.dart';
import 'package:analyzer/src/dart/element/member.dart';
import 'package:analyzer/src/fasta/resolution_storer.dart';
+import 'package:analyzer/src/generated/declaration_resolver.dart';
import 'package:front_end/src/base/syntactic_entity.dart';
import 'package:front_end/src/scanner/token.dart';
import 'package:kernel/kernel.dart' as kernel;
@@ -44,7 +45,10 @@
@override
void visitAnnotation(Annotation node) {
Identifier name = node.name;
- SimpleIdentifier constructorName = node.constructorName;
+ ArgumentList argumentList = node.arguments;
+
+ SimpleIdentifier fieldName;
+ SimpleIdentifier constructorName;
var data = _get(name);
if (name is SimpleIdentifier) {
@@ -58,14 +62,31 @@
data = _get(name.identifier);
name.identifier.staticElement = data.reference;
name.identifier.staticType = data.inferredType;
+
+ if (argumentList == null) {
+ fieldName = node.constructorName;
+ } else {
+ constructorName = node.constructorName;
+ }
} else {
name.prefix.staticElement = data.reference;
name.prefix.staticType = data.inferredType;
- constructorName = name.identifier;
+
+ if (argumentList == null) {
+ fieldName = name.identifier;
+ } else {
+ constructorName = name.identifier;
+ }
}
}
- ArgumentList argumentList = node.arguments;
+ if (fieldName != null) {
+ data = _get(fieldName);
+ node.element = data.reference;
+ fieldName.staticElement = data.reference;
+ fieldName.staticType = data.inferredType;
+ }
+
if (argumentList != null) {
var data = _get(argumentList);
ConstructorElement element = data.reference;
@@ -234,10 +255,9 @@
@override
void visitFormalParameterList(FormalParameterList parameterList) {
for (var parameter in parameterList.parameters) {
+ parameter.metadata?.accept(this);
if (parameter is DefaultFormalParameter) {
- if (parameter.defaultValue != null) {
- parameter.defaultValue.accept(this);
- }
+ parameter.defaultValue?.accept(this);
}
}
}
@@ -268,7 +288,6 @@
List<TypeParameter> typeParameters = typeParameterList.typeParameters;
for (var i = 0; i < typeParameters.length; i++) {
TypeParameter typeParameter = typeParameters[i];
- assert(typeParameter.bound == null);
typeParameter.name.staticElement = element.typeParameters[i];
typeParameter.name.staticType = _typeContext.typeType;
}
@@ -294,7 +313,7 @@
parameterList.accept(this);
node.body.accept(this);
- _storeFunctionType(_get(node).inferredType, element);
+ _storeFunctionType(_get(node.parameters).inferredType, element);
// Associate the elements with the nodes.
if (element != null) {
@@ -331,9 +350,9 @@
@override
void visitIndexExpression(IndexExpression node) {
- node.target.accept(this);
+ node.target?.accept(this);
- DartType targetType = node.target.staticType;
+ DartType targetType = node.realTarget.staticType;
var data = _get(node.leftBracket);
MethodElement element = data.reference;
@@ -350,20 +369,58 @@
@override
void visitInstanceCreationExpression(InstanceCreationExpression node) {
- var data = _get(node.argumentList);
+ ConstructorName constructorName = node.constructorName;
+ Identifier typeIdentifier = constructorName.type.name;
+ SimpleIdentifier classIdentifier;
+ SimpleIdentifier constructorIdentifier;
- PrefixElement prefix = data.prefixInfo;
+ var data = _get(typeIdentifier);
+ TypeName newTypeName;
+ if (typeIdentifier is SimpleIdentifier) {
+ classIdentifier = typeIdentifier;
+ constructorIdentifier = constructorName.name;
+ } else if (typeIdentifier is PrefixedIdentifier) {
+ if (data.prefixInfo != null) {
+ typeIdentifier.prefix.staticElement = data.prefixInfo;
+
+ classIdentifier = typeIdentifier.identifier;
+ constructorIdentifier = node.constructorName.name;
+
+ data = _get(classIdentifier);
+ } else {
+ classIdentifier = typeIdentifier.prefix;
+ constructorIdentifier = typeIdentifier.identifier;
+
+ TypeArgumentList typeArguments = constructorName.type.typeArguments;
+ newTypeName = astFactory.typeName(classIdentifier, typeArguments);
+ constructorName.type = newTypeName;
+ constructorName.period = typeIdentifier.period;
+ constructorName.name = constructorIdentifier;
+ }
+ }
+ classIdentifier.staticElement = data.reference;
+
+ data = _get(node.argumentList);
ConstructorElement constructor = data.reference;
DartType type = data.inferredType;
- ConstructorName constructorName = node.constructorName;
- applyConstructorElement(
- _enclosingLibraryElement, prefix, constructor, type, constructorName);
+ TypeArgumentList typeArguments = constructorName.type.typeArguments;
+ if (typeArguments != null) {
+ _applyTypeArgumentsToList(
+ _enclosingLibraryElement, type, typeArguments.arguments);
+ }
node.staticElement = constructor;
node.staticType = type;
+ node.constructorName.staticElement = constructor;
+ node.constructorName.type.type = constructor.returnType;
+
+ typeIdentifier.staticType = type;
+ classIdentifier.staticType = type;
+ constructorIdentifier?.staticElement = constructor;
+
ArgumentList argumentList = node.argumentList;
_applyResolutionToArguments(argumentList);
_resolveNamedArguments(argumentList, constructor?.parameters);
@@ -623,10 +680,7 @@
if (node.parent is TopLevelVariableDeclaration) {
node.variables.accept(this);
} else {
- if (node.metadata.isNotEmpty) {
- // TODO(paulberry): handle this case
- throw new UnimplementedError('Metadata on a variable declaration list');
- }
+ node.metadata.accept(this);
node.variables.accept(this);
if (node.type != null) {
DartType type = node.variables[0].name.staticType;
@@ -655,7 +709,8 @@
int entityOffset = entity.offset;
var data = _data[entityOffset];
if (failIfAbsent && data == null) {
- throw new StateError('No data for $entity at $entityOffset');
+ String fileName = _enclosingLibraryElement.source.fullName;
+ throw new StateError('No data for $entity at $entityOffset in $fileName');
}
return data;
}
@@ -697,18 +752,36 @@
void _storeFunctionType(DartType type, FunctionElementImpl element) {
if (type is FunctionType && element != null) {
- element.returnType = type.returnType;
+ DartType Function(DartType) substituteConstituentType;
+ if (type.typeFormals.length == element.typeParameters.length &&
+ type.typeFormals.length != 0) {
+ var argumentTypes = element.typeParameters.map((e) => e.type).toList();
+ var parameterTypes = type.typeFormals.map((e) => e.type).toList();
+ substituteConstituentType =
+ (DartType t) => t.substitute2(argumentTypes, parameterTypes);
+ for (int i = 0; i < type.typeFormals.length; i++) {
+ (element.typeParameters[i] as TypeParameterElementImpl).bound =
+ type.typeFormals[i].bound == null
+ ? null
+ : substituteConstituentType(type.typeFormals[i].bound);
+ }
+ } else {
+ substituteConstituentType = (DartType t) => t;
+ }
+ element.returnType = substituteConstituentType(type.returnType);
int normalParameterIndex = 0;
int optionalParameterIndex = 0;
for (ParameterElementImpl parameter in element.parameters) {
if (parameter.isNamed) {
- parameter.type = type.namedParameterTypes[parameter.name];
+ parameter.type = substituteConstituentType(
+ type.namedParameterTypes[parameter.name]);
} else if (normalParameterIndex < type.normalParameterTypes.length) {
- parameter.type = type.normalParameterTypes[normalParameterIndex++];
+ parameter.type = substituteConstituentType(
+ type.normalParameterTypes[normalParameterIndex++]);
} else if (optionalParameterIndex <
type.optionalParameterTypes.length) {
- parameter.type =
- type.optionalParameterTypes[optionalParameterIndex++];
+ parameter.type = substituteConstituentType(
+ type.optionalParameterTypes[optionalParameterIndex++]);
}
}
}
@@ -768,6 +841,9 @@
ParameterElementImpl element = parameterElements[i];
FormalParameter parameter = parameters[i];
+ DeclarationResolver.resolveMetadata(
+ parameter, parameter.metadata, element);
+
NormalFormalParameter normalParameter;
if (parameter is NormalFormalParameter) {
normalParameter = parameter;
diff --git a/pkg/analyzer/lib/src/fasta/resolution_storer.dart b/pkg/analyzer/lib/src/fasta/resolution_storer.dart
index e0b2de8..01d758e 100644
--- a/pkg/analyzer/lib/src/fasta/resolution_storer.dart
+++ b/pkg/analyzer/lib/src/fasta/resolution_storer.dart
@@ -41,28 +41,35 @@
/// Type inference listener that records inferred types for later use by
/// [ResolutionApplier].
-class ResolutionStorer extends _ResolutionStorer<int, int, Node, int>
+class ResolutionStorer extends _ResolutionStorer<int, Node, int>
implements
- TypeInferenceListener<int, int, Node, int>,
+ TypeInferenceListener<int, Node, int>,
Factory<void, void, void, void> {
ResolutionStorer(Map<int, ResolutionData<DartType, int, Node, int>> data)
: super(data);
+
+ @override
+ void _validateLocation(int location) {
+ if (location < 0) {
+ throw new StateError('Invalid location: $location');
+ }
+ }
}
/// Implementation of [ResolutionStorer], with types parameterized to avoid
/// accidentally peeking into kernel internals.
///
/// TODO(paulberry): when the time is right, fuse this with [ResolutionStorer].
-class _ResolutionStorer<Location, Declaration, Reference, PrefixInfo> {
- final Map<Location,
- ResolutionData<DartType, Declaration, Reference, PrefixInfo>> _data;
+class _ResolutionStorer<Location, Reference, PrefixInfo> {
+ final Map<Location, ResolutionData<DartType, int, Reference, PrefixInfo>>
+ _data;
_ResolutionStorer(this._data);
void _store(Location location,
{List<DartType> argumentTypes,
Reference combiner,
- Declaration declaration,
+ int declaration,
DartType inferredType,
DartType invokeType,
bool isExplicitCall = false,
@@ -73,6 +80,7 @@
Reference reference,
bool replace = false,
DartType writeContext}) {
+ _validateLocation(location);
if (!replace && _data.containsKey(location)) {
throw new StateError('Data already stored for offset $location');
}
@@ -95,6 +103,8 @@
_data.remove(location) == null;
}
+ void _validateLocation(Location location) {}
+
void asExpression(
ExpressionJudgment judgment,
Location location,
@@ -219,9 +229,10 @@
Token semicolon,
covariant Object labelBinder) {}
- void deferredCheck(ExpressionJudgment judgment, Location location,
- DartType inferredType) =>
- genericExpression("deferredCheck", location, inferredType);
+ void deferredCheck(
+ ExpressionJudgment judgment, Location location, DartType inferredType) {
+ // This judgment has no semantic value for Analyzer.
+ }
void doStatement(
StatementJudgment judgment,
@@ -271,15 +282,16 @@
DartType loopVariableType,
Location writeLocation,
DartType writeType,
- Declaration writeVariable,
+ covariant VariableDeclarationBinder writeVariableBinder,
Reference writeTarget) {
if (loopVariableBinder != null) {
_store(loopVariableBinder.fileOffset as Location,
inferredType: loopVariableType);
} else {
- if (writeVariable != null) {
+ if (writeVariableBinder != null) {
_store(writeLocation,
- declaration: writeVariable, inferredType: writeType);
+ declaration: writeVariableBinder.fileOffset,
+ inferredType: writeType);
} else {
_store(writeLocation,
reference: writeTarget,
@@ -549,7 +561,7 @@
? calleeType
: substitution.substituteType(calleeType.withoutTypeParameters);
_store(location,
- invokeType: invokeType,
+ invokeType: invokeType ?? const DynamicType(),
argumentTypes: expressionArgumentsTypes,
reference: expressionTarget,
inferredType: inferredType);
@@ -628,11 +640,11 @@
ExpressionJudgment judgment,
Location location,
DartType writeContext,
- Declaration writeVariable,
+ covariant VariableDeclarationBinder writeVariableBinder,
Reference combiner,
DartType inferredType) {
_store(location,
- declaration: writeVariable,
+ declaration: writeVariableBinder?.fileOffset,
isWriteReference: true,
writeContext: writeContext,
combiner: combiner,
@@ -660,8 +672,7 @@
return;
}
_store(location,
- declaration: variableBinder.fileOffset as Declaration,
- inferredType: inferredType);
+ declaration: variableBinder?.fileOffset, inferredType: inferredType);
}
void whileStatement(
diff --git a/pkg/analyzer/lib/src/generated/declaration_resolver.dart b/pkg/analyzer/lib/src/generated/declaration_resolver.dart
index ba1885e..f25218f 100644
--- a/pkg/analyzer/lib/src/generated/declaration_resolver.dart
+++ b/pkg/analyzer/lib/src/generated/declaration_resolver.dart
@@ -122,7 +122,7 @@
_walk(new ElementWalker.forClass(element), () {
super.visitClassDeclaration(node);
});
- _resolveMetadata(node, node.metadata, element);
+ resolveMetadata(node, node.metadata, element);
return null;
}
@@ -142,7 +142,7 @@
_walk(new ElementWalker.forClass(element), () {
super.visitClassTypeAlias(node);
});
- _resolveMetadata(node, node.metadata, element);
+ resolveMetadata(node, node.metadata, element);
return null;
}
@@ -154,7 +154,7 @@
node.element = element;
super.visitConstructorDeclaration(node);
});
- _resolveMetadata(node, node.metadata, element);
+ resolveMetadata(node, node.metadata, element);
if (_applyKernelTypes) {
_applyTypeToIdentifier(node.returnType, element.returnType);
node.name?.staticType = element.type;
@@ -204,7 +204,7 @@
normalParameter.accept(this);
});
- _resolveMetadata(node, node.metadata, element);
+ resolveMetadata(node, node.metadata, element);
return null;
}
@@ -224,12 +224,12 @@
_walk(new ElementWalker.forClass(element), () {
for (EnumConstantDeclaration constant in node.constants) {
VariableElement element = _match(constant.name, _walker.getVariable());
- _resolveMetadata(node, constant.metadata, element);
+ resolveMetadata(node, constant.metadata, element);
}
_walker.getFunction(); // toString()
super.visitEnumDeclaration(node);
});
- _resolveMetadata(node, node.metadata, element);
+ resolveMetadata(node, node.metadata, element);
return null;
}
@@ -246,7 +246,7 @@
.indexOf(node);
annotations = _walker.element.library.exports[index].metadata;
}
- _resolveAnnotations(node, node.metadata, annotations);
+ resolveAnnotations(node, node.metadata, annotations);
return null;
}
@@ -270,7 +270,7 @@
_applyType(firstFieldElement.type, node.fields.type);
}
}
- _resolveMetadata(node, node.metadata, firstFieldElement);
+ resolveMetadata(node, node.metadata, firstFieldElement);
return null;
}
@@ -283,7 +283,7 @@
_walk(new ElementWalker.forParameter(element, isFunctionTyped), () {
super.visitFieldFormalParameter(node);
});
- _resolveMetadata(node, node.metadata, element);
+ resolveMetadata(node, node.metadata, element);
_setGenericFunctionType(node.type, element.type);
return null;
} else {
@@ -339,7 +339,7 @@
_walk(new ElementWalker.forExecutable(element, _enclosingUnit), () {
super.visitFunctionDeclaration(node);
});
- _resolveMetadata(node, node.metadata, element);
+ resolveMetadata(node, node.metadata, element);
return null;
}
@@ -364,7 +364,7 @@
_walk(new ElementWalker.forTypedef(element), () {
super.visitFunctionTypeAlias(node);
});
- _resolveMetadata(node, node.metadata, element);
+ resolveMetadata(node, node.metadata, element);
return null;
}
@@ -376,7 +376,7 @@
_walk(new ElementWalker.forParameter(element, true), () {
super.visitFunctionTypedFormalParameter(node);
});
- _resolveMetadata(node, node.metadata, element);
+ resolveMetadata(node, node.metadata, element);
return null;
} else {
return super.visitFunctionTypedFormalParameter(node);
@@ -415,7 +415,7 @@
_walk(new ElementWalker.forGenericTypeAlias(element), () {
super.visitGenericTypeAlias(node);
});
- _resolveMetadata(node, node.metadata, element);
+ resolveMetadata(node, node.metadata, element);
return null;
}
@@ -432,7 +432,7 @@
.indexOf(node);
annotations = _walker.element.library.imports[index].metadata;
}
- _resolveAnnotations(node, node.metadata, annotations);
+ resolveAnnotations(node, node.metadata, annotations);
return null;
}
@@ -452,7 +452,7 @@
if (annotations.isEmpty && node.metadata.isNotEmpty) {
annotations = _walker.element.library.metadata;
}
- _resolveAnnotations(node, node.metadata, annotations);
+ resolveAnnotations(node, node.metadata, annotations);
return null;
}
@@ -495,7 +495,7 @@
_walk(new ElementWalker.forExecutable(element, _enclosingUnit), () {
super.visitMethodDeclaration(node);
});
- _resolveMetadata(node, node.metadata, element);
+ resolveMetadata(node, node.metadata, element);
return null;
}
@@ -512,7 +512,7 @@
.indexOf(node);
annotations = _walker.element.library.parts[index].metadata;
}
- _resolveAnnotations(node, node.metadata, annotations);
+ resolveAnnotations(node, node.metadata, annotations);
return null;
}
@@ -538,7 +538,7 @@
_walk(new ElementWalker.forParameter(element, false), () {
super.visitSimpleFormalParameter(node);
});
- _resolveMetadata(node, node.metadata, element);
+ resolveMetadata(node, node.metadata, element);
return null;
} else {
return super.visitSimpleFormalParameter(node);
@@ -567,7 +567,7 @@
_applyType(firstElement.type, type);
}
}
- _resolveMetadata(node, node.metadata, firstElement);
+ resolveMetadata(node, node.metadata, firstElement);
return null;
}
@@ -591,7 +591,7 @@
}
_setGenericFunctionType(node.bound, element.bound);
super.visitTypeParameter(node);
- _resolveMetadata(node, node.metadata, element);
+ resolveMetadata(node, node.metadata, element);
return null;
}
@@ -600,17 +600,16 @@
VariableElement element = _match(node.name, _walker.getVariable());
if (_applyKernelTypes) {
node.name.staticType = element.type;
- } else {
- Expression initializer = node.initializer;
- if (initializer != null) {
- _walk(
- new ElementWalker.forExecutable(
- element.initializer, _enclosingUnit), () {
- super.visitVariableDeclaration(node);
- });
- } else {
+ }
+ Expression initializer = node.initializer;
+ if (initializer != null) {
+ _walk(
+ new ElementWalker.forExecutable(element.initializer, _enclosingUnit),
+ () {
super.visitVariableDeclaration(node);
- }
+ });
+ } else {
+ super.visitVariableDeclaration(node);
}
return null;
}
@@ -626,7 +625,7 @@
node.type?.accept(this);
if (node.parent is! FieldDeclaration &&
node.parent is! TopLevelVariableDeclaration) {
- _resolveMetadata(node, node.metadata, firstVariable);
+ resolveMetadata(node, node.metadata, firstVariable);
}
return null;
}
@@ -698,39 +697,6 @@
}
/**
- * Associate each of the annotation [nodes] with the corresponding
- * [ElementAnnotation] in [annotations]. If there is a problem, report it
- * against the given [parent] node.
- */
- void _resolveAnnotations(AstNode parent, NodeList<Annotation> nodes,
- List<ElementAnnotation> annotations) {
- int nodeCount = nodes.length;
- if (nodeCount != annotations.length) {
- throw new StateError('Found $nodeCount annotation nodes and '
- '${annotations.length} element annotations');
- }
- for (int i = 0; i < nodeCount; i++) {
- nodes[i].elementAnnotation = annotations[i];
- }
- }
-
- /**
- * If [element] is not `null`, associate each of the annotation [nodes] with
- * the corresponding [ElementAnnotation] in [element.metadata]. If there is a
- * problem, report it against the given [parent] node.
- *
- * If [element] is `null`, do nothing--this allows us to be robust in the
- * case where we are operating on an element model that hasn't been fully
- * built.
- */
- void _resolveMetadata(
- AstNode parent, NodeList<Annotation> nodes, Element element) {
- if (element != null) {
- _resolveAnnotations(parent, nodes, element.metadata);
- }
- }
-
- /**
* If the given [typeNode] is a [GenericFunctionType], set its [type].
*/
void _setGenericFunctionType(TypeAnnotation typeNode, DartType type) {
@@ -768,6 +734,39 @@
_walker = outerWalker;
}
+ /**
+ * Associate each of the annotation [nodes] with the corresponding
+ * [ElementAnnotation] in [annotations]. If there is a problem, report it
+ * against the given [parent] node.
+ */
+ static void resolveAnnotations(AstNode parent, NodeList<Annotation> nodes,
+ List<ElementAnnotation> annotations) {
+ int nodeCount = nodes.length;
+ if (nodeCount != annotations.length) {
+ throw new StateError('Found $nodeCount annotation nodes and '
+ '${annotations.length} element annotations');
+ }
+ for (int i = 0; i < nodeCount; i++) {
+ nodes[i].elementAnnotation = annotations[i];
+ }
+ }
+
+ /**
+ * If [element] is not `null`, associate each of the annotation [nodes] with
+ * the corresponding [ElementAnnotation] in [element.metadata]. If there is a
+ * problem, report it against the given [parent] node.
+ *
+ * If [element] is `null`, do nothing--this allows us to be robust in the
+ * case where we are operating on an element model that hasn't been fully
+ * built.
+ */
+ static void resolveMetadata(
+ AstNode parent, NodeList<Annotation> nodes, Element element) {
+ if (element != null) {
+ resolveAnnotations(parent, nodes, element.metadata);
+ }
+ }
+
static bool _isBodyToCreateElementsFor(FunctionBody node) {
AstNode parent = node.parent;
return parent is ConstructorDeclaration ||
diff --git a/pkg/analyzer/lib/src/generated/error_verifier.dart b/pkg/analyzer/lib/src/generated/error_verifier.dart
index 8cb4b47..41ee8bb 100644
--- a/pkg/analyzer/lib/src/generated/error_verifier.dart
+++ b/pkg/analyzer/lib/src/generated/error_verifier.dart
@@ -929,9 +929,7 @@
_checkForConstWithNonConst(node);
_checkForConstWithUndefinedConstructor(
node, constructorName, typeName);
- if (!_options.strongMode) {
- _checkForConstWithTypeParameters(typeName);
- }
+ _checkForConstWithTypeParameters(typeName);
_checkForConstDeferredClass(node, constructorName, typeName);
} else {
_checkForNewWithUndefinedConstructor(node, constructorName, typeName);
@@ -961,7 +959,7 @@
Object visitListLiteral(ListLiteral node) {
TypeArgumentList typeArguments = node.typeArguments;
if (typeArguments != null) {
- if (!_options.strongMode && node.isConst) {
+ if (node.isConst) {
NodeList<TypeAnnotation> arguments = typeArguments.arguments;
if (arguments.isNotEmpty) {
_checkForInvalidTypeArgumentInConstTypedLiteral(arguments,
@@ -981,7 +979,7 @@
TypeArgumentList typeArguments = node.typeArguments;
if (typeArguments != null) {
NodeList<TypeAnnotation> arguments = typeArguments.arguments;
- if (!_options.strongMode && arguments.isNotEmpty) {
+ if (arguments.isNotEmpty) {
if (node.isConst) {
_checkForInvalidTypeArgumentInConstTypedLiteral(arguments,
CompileTimeErrorCode.INVALID_TYPE_ARGUMENT_IN_CONST_MAP);
diff --git a/pkg/analyzer/lib/src/generated/resolver.dart b/pkg/analyzer/lib/src/generated/resolver.dart
index 685704b..1371020 100644
--- a/pkg/analyzer/lib/src/generated/resolver.dart
+++ b/pkg/analyzer/lib/src/generated/resolver.dart
@@ -8284,16 +8284,6 @@
// neither of which are in the name scope and hence will not be found by
// normal means.
//
- if (typeName.name == dynamicType.name) {
- _setElement(typeName, dynamicType.element);
-// if (argumentList != null) {
-// // TODO(brianwilkerson) Report this error
-// reporter.reportError(StaticTypeWarningCode.WRONG_NUMBER_OF_TYPE_ARGUMENTS, node, dynamicType.getName(), 0, argumentList.getArguments().size());
-// }
- typeName.staticType = dynamicType;
- node.type = dynamicType;
- return;
- }
VoidTypeImpl voidType = VoidTypeImpl.instance;
if (typeName.name == voidType.name) {
// There is no element for 'void'.
@@ -8464,6 +8454,17 @@
return;
}
_setElement(typeName, element);
+ } else if (element is TypeDefiningElement &&
+ element.kind == ElementKind.DYNAMIC) {
+// if (argumentList != null) {
+// // Type parameters cannot have type arguments.
+// // TODO(mfairhurst) Report this error.
+// resolver.reportError(ResolverErrorCode.?, keyType);
+// }
+ _setElement(typeName, element);
+ typeName.staticType = element.type;
+ node.type = element.type;
+ return;
} else if (element is FunctionTypeAliasElement) {
_setElement(typeName, element);
type = element.type;
@@ -8615,21 +8616,6 @@
DartType type = annotation.type;
if (type == null) {
return undefinedType;
- } else if (type is FunctionType) {
- Element element = type.element;
- if (annotation is TypeName && element is GenericTypeAliasElementImpl) {
- TypeArgumentList argumentList = annotation.typeArguments;
- List<DartType> typeArguments = null;
- if (argumentList != null) {
- List<TypeAnnotation> arguments = argumentList.arguments;
- int argumentCount = arguments.length;
- typeArguments = new List<DartType>(argumentCount);
- for (int i = 0; i < argumentCount; i++) {
- typeArguments[i] = _getType(arguments[i]);
- }
- }
- return element.typeAfterSubstitution(typeArguments) ?? dynamicType;
- }
}
return type;
}
@@ -10536,6 +10522,10 @@
// If the type is not an InterfaceType, then visitTypeName() sets the type
// to be a DynamicTypeImpl
Identifier name = typeName.name;
+ // TODO(mfairhurst) differentiate between dynamic via clean path, and error
+ // types, and then check `type.isDynamic`. However, if we do that now, then
+ // [nonTypeError] will never be reported because non types are resolved to
+ // dynamic.
if (name.name == Keyword.DYNAMIC.lexeme) {
errorReporter.reportErrorForNode(dynamicTypeError, name, [name.name]);
} else if (!nameScope.shouldIgnoreUndefined(name)) {
diff --git a/pkg/analyzer/lib/src/kernel/resynthesize.dart b/pkg/analyzer/lib/src/kernel/resynthesize.dart
index a370739..d3bf1e4 100644
--- a/pkg/analyzer/lib/src/kernel/resynthesize.dart
+++ b/pkg/analyzer/lib/src/kernel/resynthesize.dart
@@ -10,6 +10,7 @@
import 'package:analyzer/src/context/context.dart' show AnalysisContextImpl;
import 'package:analyzer/src/dart/element/element.dart';
import 'package:analyzer/src/dart/element/handle.dart';
+import 'package:analyzer/src/dart/element/member.dart';
import 'package:analyzer/src/dart/element/type.dart';
import 'package:analyzer/src/dart/resolver/scope.dart';
import 'package:analyzer/src/generated/engine.dart' show AnalysisContext;
@@ -234,7 +235,7 @@
if (kernelType is kernel.TypeParameterType) {
kernel.TypeParameter kTypeParameter = kernelType.parameter;
- return _getTypeParameter(context, kTypeParameter).type;
+ return getTypeParameter(context, kTypeParameter).type;
}
if (kernelType is kernel.FunctionType) {
@@ -245,6 +246,22 @@
throw new UnimplementedError('For ${kernelType.runtimeType}');
}
+ /// Return the [TypeParameterElement] for the given [kernelTypeParameter].
+ TypeParameterElement getTypeParameter(
+ ElementImpl context, kernel.TypeParameter kernelTypeParameter) {
+ String name = kernelTypeParameter.name;
+ for (var ctx = context; ctx != null; ctx = ctx.enclosingElement) {
+ if (ctx is TypeParameterizedElementMixin) {
+ for (var typeParameter in ctx.typeParameters) {
+ if (typeParameter.name == name) {
+ return typeParameter;
+ }
+ }
+ }
+ }
+ throw new StateError('Not found $kernelTypeParameter in $context');
+ }
+
void _buildTypeProvider() {
var coreLibrary = getLibrary('dart:core');
var asyncLibrary = getLibrary('dart:async');
@@ -361,22 +378,6 @@
return typedefElement.instantiate(typeArguments);
}
- /// Return the [TypeParameterElement] for the given [kernelTypeParameter].
- TypeParameterElement _getTypeParameter(
- ElementImpl context, kernel.TypeParameter kernelTypeParameter) {
- String name = kernelTypeParameter.name;
- for (var ctx = context; ctx != null; ctx = ctx.enclosingElement) {
- if (ctx is TypeParameterizedElementMixin) {
- for (var typeParameter in ctx.typeParameters) {
- if (typeParameter.name == name) {
- return typeParameter;
- }
- }
- }
- }
- throw new StateError('Not found $kernelTypeParameter in $context');
- }
-
LibraryElementImpl _newSyntheticLibrary(String uriStr) {
Source librarySource = _getSource(uriStr);
if (librarySource == null) return null;
@@ -446,8 +447,9 @@
ConstructorInitializer buildInitializer(kernel.Initializer k) {
if (k is kernel.FieldInitializer) {
Expression value = build(k.value);
- ConstructorFieldInitializer initializer = AstTestFactory
- .constructorFieldInitializer(false, k.field.name.name, value);
+ ConstructorFieldInitializer initializer =
+ AstTestFactory.constructorFieldInitializer(
+ false, k.field.name.name, value);
initializer.fieldName.staticElement = _getElement(k.fieldReference);
return initializer;
}
@@ -554,12 +556,14 @@
return AstTestFactory.mapLiteral(keyword, typeArguments, entries);
}
- // Invalid annotations are represented as Let.
+ // Invalid initializers and annotations are represented as Let.
if (expr is kernel.Let) {
- kernel.Let let = expr;
- if (_isStaticError(let.variable.initializer) ||
- _isStaticError(let.body)) {
- throw const _CompilationErrorFound();
+ var body = expr.body;
+ if (body is kernel.Let) {
+ var initializer = body.variable.initializer;
+ if (initializer is kernel.Let && _isStaticError(initializer.body)) {
+ throw const _CompilationErrorFound();
+ }
}
}
@@ -716,8 +720,8 @@
..staticElement = element;
Element enclosingElement = element.enclosingElement;
if (enclosingElement is ClassElement) {
- SimpleIdentifier classRef = AstTestFactory
- .identifier3(enclosingElement.name)
+ SimpleIdentifier classRef =
+ AstTestFactory.identifier3(enclosingElement.name)
..staticElement = enclosingElement;
return AstTestFactory.identifier(classRef, property);
} else {
@@ -1140,7 +1144,7 @@
}
@override
- ConstructorElementImpl getRedirectedConstructor(
+ ConstructorElement getRedirectedConstructor(ElementImpl context,
kernel.Constructor kernelConstructor, kernel.Procedure kernelFactory) {
if (kernelConstructor != null) {
for (var initializer in kernelConstructor.initializers) {
@@ -1156,9 +1160,25 @@
if (body is RedirectingFactoryBody) {
kernel.Member target = body.target;
if (target != null) {
- return libraryContext.resynthesizer
- .getElementFromCanonicalName(target.reference.canonicalName)
- as ConstructorElementImpl;
+ ConstructorElementImpl constructorElement = libraryContext
+ .resynthesizer
+ .getElementFromCanonicalName(target.reference.canonicalName);
+ var typeArguments = body.typeArguments;
+ if (typeArguments != null) {
+ var classElement = constructorElement.enclosingElement;
+
+ var instantiatedType = new InterfaceTypeImpl.elementWithNameAndArgs(
+ classElement, classElement.name, () {
+ List<DartType> arguments = typeArguments
+ .map((kernel.DartType k) => getType(context, k))
+ .toList(growable: false);
+ return arguments;
+ });
+
+ return ConstructorMember.from(constructorElement, instantiatedType);
+ } else {
+ return constructorElement;
+ }
}
}
}
diff --git a/pkg/analyzer/lib/src/task/options.dart b/pkg/analyzer/lib/src/task/options.dart
index dcc5210..207cd29 100644
--- a/pkg/analyzer/lib/src/task/options.dart
+++ b/pkg/analyzer/lib/src/task/options.dart
@@ -39,10 +39,6 @@
/// `analyzer` analysis options constants.
class AnalyzerOptions {
static const String analyzer = 'analyzer';
- static const String enableAsync = 'enableAsync';
- static const String enableGenericMethods = 'enableGenericMethods';
- static const String enableInitializingFormalAccess =
- 'enableInitializingFormalAccess';
static const String enableSuperMixins = 'enableSuperMixins';
static const String enablePreviewDart2 = 'enablePreviewDart2';
@@ -53,7 +49,7 @@
static const String plugins = 'plugins';
static const String strong_mode = 'strong-mode';
- // Strong mode options, see AnalysisOptionsImpl for documentation.
+ // Strong mode options (see AnalysisOptionsImpl for documentation).
static const String declarationCasts = 'declaration-casts';
static const String implicitCasts = 'implicit-casts';
static const String implicitDynamic = 'implicit-dynamic';
@@ -80,12 +76,17 @@
strong_mode
];
- /// Supported `analyzer` language configuration options.
+ /// Supported `analyzer` strong-mode options.
+ static const List<String> strongModeOptions = const [
+ declarationCasts, // deprecated
+ implicitCasts,
+ implicitDynamic
+ ];
+
+ /// Supported `analyzer` language options.
static const List<String> languageOptions = const [
- enableAsync,
- enableGenericMethods,
enableSuperMixins,
- enablePreviewDart2
+ enablePreviewDart2,
];
}
@@ -391,6 +392,16 @@
}
}
});
+ } else if (language is YamlScalar && language.value != null) {
+ reporter.reportErrorForSpan(
+ AnalysisOptionsWarningCode.INVALID_SECTION_FORMAT,
+ language.span,
+ [AnalyzerOptions.language]);
+ } else if (language is YamlList) {
+ reporter.reportErrorForSpan(
+ AnalysisOptionsWarningCode.INVALID_SECTION_FORMAT,
+ language.span,
+ [AnalyzerOptions.language]);
}
}
}
@@ -433,6 +444,7 @@
/// Validates `analyzer` strong-mode value configuration options.
class StrongModeOptionValueValidator extends OptionsValidator {
+ ErrorBuilder builder = new ErrorBuilder(AnalyzerOptions.strongModeOptions);
ErrorBuilder trueOrFalseBuilder = new TrueOrFalseValueErrorBuilder();
@override
@@ -447,8 +459,36 @@
reporter, AnalyzerOptions.strong_mode, v);
} else if (value == 'false') {
reporter.reportErrorForSpan(
- AnalysisOptionsHintCode.SPEC_MODE_DEPRECATED, v.span);
+ AnalysisOptionsWarningCode.SPEC_MODE_REMOVED, v.span);
+ } else if (value == 'true') {
+ reporter.reportErrorForSpan(
+ AnalysisOptionsHintCode.STRONG_MODE_SETTING_DEPRECATED, v.span);
}
+ } else if (v is YamlMap) {
+ v.nodes.forEach((k, v) {
+ String key, value;
+ bool validKey = false;
+ if (k is YamlScalar) {
+ key = k.value?.toString();
+ if (!AnalyzerOptions.strongModeOptions.contains(key)) {
+ builder.reportError(reporter, AnalyzerOptions.strong_mode, k);
+ } else if (key == AnalyzerOptions.declarationCasts) {
+ reporter.reportErrorForSpan(
+ AnalysisOptionsWarningCode.ANALYSIS_OPTION_DEPRECATED,
+ k.span,
+ [key]);
+ } else {
+ // If we have a valid key, go on and check the value.
+ validKey = true;
+ }
+ }
+ if (validKey && v is YamlScalar) {
+ value = toLowerCase(v.value);
+ if (!AnalyzerOptions.trueOrFalse.contains(value)) {
+ trueOrFalseBuilder.reportError(reporter, key, v);
+ }
+ }
+ });
}
}
}
@@ -631,11 +671,6 @@
_applyStrongModeOption(options, k.value?.toString(), v.value);
}
});
- } else {
- bool value = toBool(config);
- if (value != null) {
- options.strongMode = value;
- }
}
}
diff --git a/pkg/analyzer/lib/src/util/yaml.dart b/pkg/analyzer/lib/src/util/yaml.dart
index cb0175b..1950bdd 100644
--- a/pkg/analyzer/lib/src/util/yaml.dart
+++ b/pkg/analyzer/lib/src/util/yaml.dart
@@ -7,6 +7,17 @@
import 'package:yaml/src/event.dart';
import 'package:yaml/yaml.dart';
+/// Given a [map], return the [YamlNode] associated with the given [key], or
+/// `null` if there is no matching key.
+YamlNode getKey(YamlMap map, String key) {
+ for (YamlNode k in map.nodes.keys) {
+ if (k is YamlScalar && k.value == key) {
+ return k;
+ }
+ }
+ return null;
+}
+
/// Given a [map], return the value associated with the key whose value matches
/// the given [key], or `null` if there is no matching key.
YamlNode getValue(YamlMap map, String key) {
diff --git a/pkg/analyzer/test/cancelable_future_test.dart b/pkg/analyzer/test/cancelable_future_test.dart
index 2f63cac..1fec016 100644
--- a/pkg/analyzer/test/cancelable_future_test.dart
+++ b/pkg/analyzer/test/cancelable_future_test.dart
@@ -41,7 +41,7 @@
.then((_) {
fail('Expected error completion');
}, onError: (error) {
- expect(error, new isInstanceOf<FutureCanceledError>());
+ expect(error, new TypeMatcher<FutureCanceledError>());
// And make sure nothing else happens.
})
.then((_) => pumpEventQueue())
@@ -57,7 +57,7 @@
fail('Expected error completion');
}, onError: (error) {
expect(callbackInvoked, isFalse);
- expect(error, new isInstanceOf<FutureCanceledError>());
+ expect(error, new TypeMatcher<FutureCanceledError>());
callbackInvoked = true;
});
expect(cancelCount, 0);
@@ -106,7 +106,7 @@
fail('Expected error completion');
}, onError: (error) {
expect(callbackInvoked, isFalse);
- expect(error, new isInstanceOf<FutureCanceledError>());
+ expect(error, new TypeMatcher<FutureCanceledError>());
callbackInvoked = true;
});
// The callback should be deferred to a microtask.
@@ -134,7 +134,7 @@
.then((_) {
fail('Expected error completion');
}, onError: (error) {
- expect(error, new isInstanceOf<FutureCanceledError>());
+ expect(error, new TypeMatcher<FutureCanceledError>());
// And make sure nothing else happens.
})
.then((_) => pumpEventQueue())
@@ -235,7 +235,7 @@
.then((_) {
fail('Expected error completion');
}, onError: (error) {
- expect(error, new isInstanceOf<FutureCanceledError>());
+ expect(error, new TypeMatcher<FutureCanceledError>());
// And make sure nothing else happens.
})
.then((_) => pumpEventQueue())
diff --git a/pkg/analyzer/test/dart/element/builder_test.dart b/pkg/analyzer/test/dart/element/builder_test.dart
index 6d748aa..26e60b1 100644
--- a/pkg/analyzer/test/dart/element/builder_test.dart
+++ b/pkg/analyzer/test/dart/element/builder_test.dart
@@ -871,7 +871,7 @@
FunctionElement initializerElement = fieldElement.initializer;
expect(initializerElement, isNotNull);
expect(initializerElement.hasImplicitReturnType, isTrue);
- expect(initializer.element, new isInstanceOf<FunctionElement>());
+ expect(initializer.element, new TypeMatcher<FunctionElement>());
LocalVariableElement variableElement = variable.element;
expect(variableElement.hasImplicitType, isTrue);
expect(variableElement.isConst, isFalse);
@@ -946,7 +946,7 @@
List<TopLevelVariableElement> variables = holder.topLevelVariables;
expect(variables, hasLength(1));
TopLevelVariableElement variable = variables[0];
- expect(variable, new isInstanceOf<ConstTopLevelVariableElementImpl>());
+ expect(variable, new TypeMatcher<ConstTopLevelVariableElementImpl>());
expect(variable.initializer, isNotNull);
expect(variable.initializer.type, isNotNull);
expect(variable.initializer.hasImplicitReturnType, isTrue);
@@ -1308,7 +1308,7 @@
void test_metadata_visitExportDirective() {
buildElementsForText('@a export "foo.dart";');
- expect(compilationUnit.directives[0], new isInstanceOf<ExportDirective>());
+ expect(compilationUnit.directives[0], new TypeMatcher<ExportDirective>());
ExportDirective exportDirective = compilationUnit.directives[0];
checkAnnotation(exportDirective.metadata);
}
@@ -1354,14 +1354,14 @@
void test_metadata_visitImportDirective() {
buildElementsForText('@a import "foo.dart";');
- expect(compilationUnit.directives[0], new isInstanceOf<ImportDirective>());
+ expect(compilationUnit.directives[0], new TypeMatcher<ImportDirective>());
ImportDirective importDirective = compilationUnit.directives[0];
checkAnnotation(importDirective.metadata);
}
void test_metadata_visitLibraryDirective() {
buildElementsForText('@a library L;');
- expect(compilationUnit.directives[0], new isInstanceOf<LibraryDirective>());
+ expect(compilationUnit.directives[0], new TypeMatcher<LibraryDirective>());
LibraryDirective libraryDirective = compilationUnit.directives[0];
checkAnnotation(libraryDirective.metadata);
}
@@ -1390,7 +1390,7 @@
void test_metadata_visitPartDirective() {
buildElementsForText('@a part "foo.dart";');
- expect(compilationUnit.directives[0], new isInstanceOf<PartDirective>());
+ expect(compilationUnit.directives[0], new TypeMatcher<PartDirective>());
PartDirective partDirective = compilationUnit.directives[0];
checkAnnotation(partDirective.metadata);
}
@@ -1399,7 +1399,7 @@
// We don't build ElementAnnotation objects for `part of` directives, since
// analyzer ignores them in favor of annotations on the library directive.
buildElementsForText('@a part of L;');
- expect(compilationUnit.directives[0], new isInstanceOf<PartOfDirective>());
+ expect(compilationUnit.directives[0], new TypeMatcher<PartOfDirective>());
PartOfDirective partOfDirective = compilationUnit.directives[0];
expect(partOfDirective.metadata, hasLength(1));
expect(partOfDirective.metadata[0].elementAnnotation, isNull);
@@ -2586,10 +2586,10 @@
*/
void checkAnnotation(NodeList<Annotation> metadata) {
expect(metadata, hasLength(1));
- expect(metadata[0], new isInstanceOf<AnnotationImpl>());
+ expect(metadata[0], new TypeMatcher<AnnotationImpl>());
AnnotationImpl annotation = metadata[0];
expect(annotation.elementAnnotation,
- new isInstanceOf<ElementAnnotationImpl>());
+ new TypeMatcher<ElementAnnotationImpl>());
ElementAnnotationImpl elementAnnotation = annotation.elementAnnotation;
expect(elementAnnotation.element, isNull); // Not yet resolved
expect(elementAnnotation.compilationUnit, isNotNull);
@@ -2602,7 +2602,7 @@
*/
void checkMetadata(Element element) {
expect(element.metadata, hasLength(1));
- expect(element.metadata[0], new isInstanceOf<ElementAnnotationImpl>());
+ expect(element.metadata[0], new TypeMatcher<ElementAnnotationImpl>());
ElementAnnotationImpl elementAnnotation = element.metadata[0];
expect(elementAnnotation.element, isNull); // Not yet resolved
expect(elementAnnotation.compilationUnit, isNotNull);
diff --git a/pkg/analyzer/test/file_system/memory_file_system_test.dart b/pkg/analyzer/test/file_system/memory_file_system_test.dart
index ceca3d4..5daa3ad 100644
--- a/pkg/analyzer/test/file_system/memory_file_system_test.dart
+++ b/pkg/analyzer/test/file_system/memory_file_system_test.dart
@@ -28,9 +28,9 @@
});
}
-var _isFile = new isInstanceOf<File>();
-var _isFileSystemException = new isInstanceOf<FileSystemException>();
-var _isFolder = new isInstanceOf<Folder>();
+final _isFile = new TypeMatcher<File>();
+final _isFileSystemException = new TypeMatcher<FileSystemException>();
+final _isFolder = new TypeMatcher<Folder>();
@reflectiveTest
class FileSystemExceptionTest {
@@ -158,7 +158,7 @@
provider.newFile(path, 'content');
File file = provider.getResource(path);
Resource parent = file.parent;
- expect(parent, new isInstanceOf<Folder>());
+ expect(parent, _isFolder);
expect(parent.path, equals(provider.convertPath('/foo/bar')));
}
@@ -473,10 +473,10 @@
void test_parent() {
Resource parent1 = folder.parent;
- expect(parent1, new isInstanceOf<Folder>());
+ expect(parent1, _isFolder);
expect(parent1.path, equals(provider.convertPath('/foo')));
Resource parent2 = parent1.parent;
- expect(parent2, new isInstanceOf<Folder>());
+ expect(parent2, _isFolder);
expect(parent2.path, equals(provider.convertPath('/')));
expect(parent2.parent, isNull);
}
@@ -682,7 +682,7 @@
expect(() {
provider.deleteFile(path);
}, throwsArgumentError);
- expect(provider.getResource(path), new isInstanceOf<Folder>());
+ expect(provider.getResource(path), _isFolder);
}
void test_deleteFile_notExistent() {
@@ -699,7 +699,7 @@
String path = provider.convertPath('/my/file');
provider.newFile(path, 'contents');
Resource file = provider.getResource(path);
- expect(file, new isInstanceOf<File>());
+ expect(file, _isFile);
expect(file.exists, isTrue);
provider.deleteFile(path);
expect(file.exists, isFalse);
@@ -746,7 +746,7 @@
expect(() {
provider.modifyFile(path, 'contents');
}, throwsArgumentError);
- expect(provider.getResource(path), new isInstanceOf<Folder>());
+ expect(provider.getResource(path), _isFolder);
}
void test_modifyFile_notExistent() {
@@ -763,7 +763,7 @@
String path = provider.convertPath('/my/file');
provider.newFile(path, 'contents 1');
Resource file = provider.getResource(path);
- expect(file, new isInstanceOf<File>());
+ expect(file, _isFile);
Source source = (file as File).createSource();
expect(source.contents.data, equals('contents 1'));
provider.modifyFile(path, 'contents 2');
diff --git a/pkg/analyzer/test/file_system/overlay_file_system_test.dart b/pkg/analyzer/test/file_system/overlay_file_system_test.dart
index e06fafd..3460d9a 100644
--- a/pkg/analyzer/test/file_system/overlay_file_system_test.dart
+++ b/pkg/analyzer/test/file_system/overlay_file_system_test.dart
@@ -20,9 +20,9 @@
});
}
-var _isFile = new isInstanceOf<File>();
-var _isFileSystemException = new isInstanceOf<FileSystemException>();
-var _isFolder = new isInstanceOf<Folder>();
+final _isFile = new TypeMatcher<File>();
+final _isFileSystemException = new TypeMatcher<FileSystemException>();
+final _isFolder = new TypeMatcher<Folder>();
@reflectiveTest
class FileTest extends OverlayTestSupport {
@@ -462,7 +462,7 @@
test_delete_notExisting() {
Folder folder = _folder(exists: false);
expect(folder.exists, isFalse);
- expect(() => folder.delete(), throwsA(new isInstanceOf<ArgumentError>()));
+ expect(() => folder.delete(), throwsA(new TypeMatcher<ArgumentError>()));
}
test_exists_false() {
diff --git a/pkg/analyzer/test/file_system/physical_resource_provider_test.dart b/pkg/analyzer/test/file_system/physical_resource_provider_test.dart
index 63554c8..9b3adbc 100644
--- a/pkg/analyzer/test/file_system/physical_resource_provider_test.dart
+++ b/pkg/analyzer/test/file_system/physical_resource_provider_test.dart
@@ -26,9 +26,9 @@
}
}
-var _isFile = new isInstanceOf<File>();
-var _isFileSystemException = new isInstanceOf<FileSystemException>();
-var _isFolder = new isInstanceOf<Folder>();
+final _isFile = new TypeMatcher<File>();
+final _isFileSystemException = new TypeMatcher<FileSystemException>();
+final _isFolder = new TypeMatcher<Folder>();
String join(String part1, [String part2, String part3]) =>
pathos.join(part1, part2, part3);
@@ -137,7 +137,7 @@
void test_parent() {
Resource parent = file.parent;
- expect(parent, new isInstanceOf<Folder>());
+ expect(parent, _isFolder);
expect(parent.path, equals(tempPath));
}
@@ -457,7 +457,7 @@
void test_parent() {
Resource parent = folder.parent;
- expect(parent, new isInstanceOf<Folder>());
+ expect(parent, _isFolder);
expect(parent.path, equals(tempPath));
// Since the OS is in control of where tempPath is, we don't know how
@@ -469,7 +469,7 @@
if (grandParent == null) {
break;
}
- expect(grandParent, new isInstanceOf<Folder>());
+ expect(grandParent, _isFolder);
expect(grandParent.path.length, lessThan(parent.path.length));
parent = grandParent;
}
diff --git a/pkg/analyzer/test/generated/checked_mode_compile_time_error_code_kernel_test.dart b/pkg/analyzer/test/generated/checked_mode_compile_time_error_code_kernel_test.dart
index 171376f..6cd4ceb 100644
--- a/pkg/analyzer/test/generated/checked_mode_compile_time_error_code_kernel_test.dart
+++ b/pkg/analyzer/test/generated/checked_mode_compile_time_error_code_kernel_test.dart
@@ -149,13 +149,6 @@
@failingTest
@override
- test_fieldTypeOk_generic() async {
- // UnimplementedError: kernel: (Let) let final dynamic #t4 = #lib2::y in let ...
- await super.test_fieldTypeOk_generic();
- }
-
- @failingTest
- @override
test_fieldTypeOk_unresolved_null() async {
// UnimplementedError: kernel: (AsExpression) x as{TypeError} invalid-type
await super.test_fieldTypeOk_unresolved_null();
diff --git a/pkg/analyzer/test/generated/compile_time_error_code_kernel_test.dart b/pkg/analyzer/test/generated/compile_time_error_code_kernel_test.dart
index f2a68eb..8ac0d6c 100644
--- a/pkg/analyzer/test/generated/compile_time_error_code_kernel_test.dart
+++ b/pkg/analyzer/test/generated/compile_time_error_code_kernel_test.dart
@@ -52,13 +52,6 @@
@override
@failingTest
- test_async_used_as_identifier_in_annotation() async {
- // 'package:analyzer/src/dart/constant/utilities.dart': Failed assertion: line 184 pos 14: 'node.parent is PartOfDirective ||
- await super.test_async_used_as_identifier_in_annotation();
- }
-
- @override
- @failingTest
test_async_used_as_identifier_in_break_statement() async {
// Bad state: No type information for true at 21
await super.test_async_used_as_identifier_in_break_statement();
@@ -73,13 +66,6 @@
@override
@failingTest
- test_async_used_as_identifier_in_prefix() {
- // NoSuchMethodError: The getter 'element' was called on null.
- return super.test_async_used_as_identifier_in_prefix();
- }
-
- @override
- @failingTest
test_bug_23176() async {
// This test fails because the kernel driver element model produces a
// different element model result than the regular parser produces. Once these
@@ -90,6 +76,14 @@
@override
@failingTest
+ @potentialAnalyzerProblem
+ test_builtInIdentifierAsType_dynamicMissingPrefix() async {
+ // Kernel and analyzer report different errors. Which is the correct one?
+ await super.test_builtInIdentifierAsType_dynamicMissingPrefix();
+ }
+
+ @override
+ @failingTest
test_builtInIdentifierAsType_formalParameter_field() async {
// Expected 1 errors of type CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_TYPE, found 0;
// 0 errors of type ParserErrorCode.EXTRANEOUS_MODIFIER, found 1 (23)
@@ -283,28 +277,6 @@
@override
@failingTest
- test_constConstructorWithNonFinalField_this() async {
- // Expected 1 errors of type CompileTimeErrorCode.CONST_CONSTRUCTOR_WITH_NON_FINAL_FIELD, found 0
- await super.test_constConstructorWithNonFinalField_this();
- }
-
- @override
- @failingTest
- test_constDeferredClass() async {
- // Expected 1 errors of type CompileTimeErrorCode.CONST_DEFERRED_CLASS, found 0;
- // 0 errors of type HintCode.UNUSED_IMPORT, found 1 (21)
- await super.test_constDeferredClass();
- }
-
- @override
- @failingTest
- test_constDeferredClass_namedConstructor() async {
- // 'package:analyzer/src/fasta/resolution_applier.dart': Failed assertion: line 632 pos 14: 'constructorName.name == null': is not true.
- await super.test_constDeferredClass_namedConstructor();
- }
-
- @override
- @failingTest
test_constEval_newInstance_constConstructor() async {
// Expected 1 errors of type CompileTimeErrorCode.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE, found 0
await super.test_constEval_newInstance_constConstructor();
@@ -706,48 +678,6 @@
@override
@failingTest
- test_duplicateDefinition_locals_inCase() async {
- // Bad state: No type information for a at 58
- await super.test_duplicateDefinition_locals_inCase();
- }
-
- @override
- @failingTest
- test_duplicateDefinition_locals_inFunctionBlock() async {
- // Bad state: No declaration information for m(a) {} at 24
- await super.test_duplicateDefinition_locals_inFunctionBlock();
- }
-
- @override
- @failingTest
- test_duplicateDefinition_locals_inIf() async {
- // Bad state: No type information for a at 49
- await super.test_duplicateDefinition_locals_inIf();
- }
-
- @override
- @failingTest
- test_duplicateDefinition_locals_inMethodBlock() async {
- // Bad state: No type information for a at 37
- await super.test_duplicateDefinition_locals_inMethodBlock();
- }
-
- @override
- @failingTest
- test_duplicateDefinition_parameters_inConstructor() async {
- // Expected 1 errors of type CompileTimeErrorCode.DUPLICATE_DEFINITION, found 0
- await super.test_duplicateDefinition_parameters_inConstructor();
- }
-
- @override
- @failingTest
- test_duplicateDefinition_parameters_inFunctionTypeAlias() async {
- // Expected 1 errors of type CompileTimeErrorCode.DUPLICATE_DEFINITION, found 0
- await super.test_duplicateDefinition_parameters_inFunctionTypeAlias();
- }
-
- @override
- @failingTest
test_duplicateDefinition_parameters_inLocalFunction() async {
// Expected 1 errors of type CompileTimeErrorCode.DUPLICATE_DEFINITION, found 0
await super.test_duplicateDefinition_parameters_inLocalFunction();
@@ -755,20 +685,6 @@
@override
@failingTest
- test_duplicateDefinition_parameters_inMethod() async {
- // Expected 1 errors of type CompileTimeErrorCode.DUPLICATE_DEFINITION, found 0
- await super.test_duplicateDefinition_parameters_inMethod();
- }
-
- @override
- @failingTest
- test_duplicateDefinition_parameters_inTopLevelFunction() async {
- // Expected 1 errors of type CompileTimeErrorCode.DUPLICATE_DEFINITION, found 0
- await super.test_duplicateDefinition_parameters_inTopLevelFunction();
- }
-
- @override
- @failingTest
test_duplicateDefinition_typeParameters() async {
// Expected 1 errors of type CompileTimeErrorCode.DUPLICATE_DEFINITION, found 0
await super.test_duplicateDefinition_typeParameters();
@@ -838,7 +754,7 @@
@override
@failingTest
- @FastaProblem('https://github.com/dart-lang/sdk/issues/30960')
+ @FastaProblem('https://github.com/dart-lang/sdk/issues/30959')
test_exportOfNonLibrary() async {
return super.test_exportOfNonLibrary();
}
@@ -1041,6 +957,69 @@
@override
@failingTest
+ @potentialAnalyzerProblem
+ test_genericFunctionTypeArgument_class() async {
+ await super.test_genericFunctionTypeArgument_class();
+ }
+
+ @override
+ @failingTest
+ @potentialAnalyzerProblem
+ test_genericFunctionTypeArgument_function() async {
+ await super.test_genericFunctionTypeArgument_function();
+ }
+
+ @override
+ @failingTest
+ @potentialAnalyzerProblem
+ test_genericFunctionTypeArgument_functionType() async {
+ await super.test_genericFunctionTypeArgument_functionType();
+ }
+
+ @override
+ @failingTest
+ @potentialAnalyzerProblem
+ test_genericFunctionTypeArgument_method() async {
+ await super.test_genericFunctionTypeArgument_method();
+ }
+
+ @override
+ @failingTest
+ @potentialAnalyzerProblem
+ test_genericFunctionTypeAsBound_class() async {
+ await super.test_genericFunctionTypeAsBound_class();
+ }
+
+ @override
+ @failingTest
+ @potentialAnalyzerProblem
+ test_genericFunctionTypeAsBound_genericFunction() async {
+ await super.test_genericFunctionTypeAsBound_genericFunction();
+ }
+
+ @override
+ @failingTest
+ @potentialAnalyzerProblem
+ test_genericFunctionTypeAsBound_genericFunctionTypedef() async {
+ await super.test_genericFunctionTypeAsBound_genericFunctionTypedef();
+ }
+
+ @override
+ @failingTest
+ @potentialAnalyzerProblem
+ test_genericFunctionTypeAsBound_parameterOfFunction() async {
+ await super.test_genericFunctionTypeAsBound_parameterOfFunction();
+ }
+
+ @override
+ @failingTest
+ @potentialAnalyzerProblem
+ test_genericFunctionTypeAsBound_typedef() async {
+ await super.test_genericFunctionTypeAsBound_typedef();
+ }
+
+ @override
+ @failingTest
test_genericFunctionTypedParameter() async {
// Expected 1 errors of type CompileTimeErrorCode.GENERIC_FUNCTION_TYPED_PARAM_UNSUPPORTED, found 0
await super.test_genericFunctionTypedParameter();
@@ -2242,13 +2221,6 @@
@override
@failingTest
- test_notEnoughRequiredArguments_const_super() async {
- // UnimplementedError: For ShadowInvalidInitializer
- await super.test_notEnoughRequiredArguments_const_super();
- }
-
- @override
- @failingTest
test_optionalParameterInOperator_named() async {
// Expected 1 errors of type CompileTimeErrorCode.OPTIONAL_PARAMETER_IN_OPERATOR, found 0
await super.test_optionalParameterInOperator_named();
@@ -2263,34 +2235,6 @@
@override
@failingTest
- test_prefix_assignment_compound_in_method() async {
- // Bad state: No reference information for p at 46
- await super.test_prefix_assignment_compound_in_method();
- }
-
- @override
- @failingTest
- test_prefix_assignment_compound_not_in_method() async {
- // Bad state: No reference information for p at 32
- await super.test_prefix_assignment_compound_not_in_method();
- }
-
- @override
- @failingTest
- test_prefix_assignment_in_method() async {
- // Bad state: No reference information for p at 46
- await super.test_prefix_assignment_in_method();
- }
-
- @override
- @failingTest
- test_prefix_assignment_not_in_method() async {
- // Bad state: No reference information for p at 32
- await super.test_prefix_assignment_not_in_method();
- }
-
- @override
- @failingTest
test_prefix_conditionalPropertyAccess_call() async {
// Bad state: Expected element reference for analyzer offset 32; got one for kernel offset 35
await super.test_prefix_conditionalPropertyAccess_call();
@@ -2375,20 +2319,6 @@
@override
@failingTest
- test_prefixNotFollowedByDot() async {
- // Bad state: No reference information for p at 39
- await super.test_prefixNotFollowedByDot();
- }
-
- @override
- @failingTest
- test_prefixNotFollowedByDot_compoundAssignment() async {
- // Bad state: No reference information for p at 32
- await super.test_prefixNotFollowedByDot_compoundAssignment();
- }
-
- @override
- @failingTest
test_prefixNotFollowedByDot_conditionalMethodInvocation() async {
// Bad state: Expected element reference for analyzer offset 32; got one for kernel offset 35
await super.test_prefixNotFollowedByDot_conditionalMethodInvocation();
@@ -2482,13 +2412,6 @@
@override
@failingTest
- test_recursiveCompileTimeConstant_cycle() async {
- // UnimplementedError: kernel: (ShadowMethodInvocation) #lib4::y.+(1)
- await super.test_recursiveCompileTimeConstant_cycle();
- }
-
- @override
- @failingTest
test_recursiveCompileTimeConstant_initializer_after_toplevel_var() async {
// Expected 1 errors of type CompileTimeErrorCode.RECURSIVE_COMPILE_TIME_CONSTANT, found 0
await super
@@ -2496,28 +2419,14 @@
}
@override
- @failingTest
- test_recursiveCompileTimeConstant_singleVariable() async {
- // Expected 1 errors of type CompileTimeErrorCode.RECURSIVE_COMPILE_TIME_CONSTANT, found 0
- await super.test_recursiveCompileTimeConstant_singleVariable();
- }
-
- @override
- @failingTest
+ @failingTest // Fasta deliberately only reports this error once.
test_recursiveConstructorRedirect() async {
- // Expected 2 errors of type CompileTimeErrorCode.RECURSIVE_CONSTRUCTOR_REDIRECT, found 0
+ // Expected 2 errors of type CompileTimeErrorCode.RECURSIVE_CONSTRUCTOR_REDIRECT, found 1
await super.test_recursiveConstructorRedirect();
}
@override
@failingTest
- test_recursiveConstructorRedirect_directSelfReference() async {
- // Expected 1 errors of type CompileTimeErrorCode.RECURSIVE_CONSTRUCTOR_REDIRECT, found 0
- await super.test_recursiveConstructorRedirect_directSelfReference();
- }
-
- @override
- @failingTest
test_recursiveFactoryRedirect() async {
// AnalysisException: Element mismatch in /test.dart at /test.dart
await super.test_recursiveFactoryRedirect();
@@ -2703,6 +2612,13 @@
@override
@failingTest
+ test_referencedBeforeDeclaration_hideInBlock_function() async {
+ // Expected 1 errors of type CompileTimeErrorCode.REFERENCED_BEFORE_DECLARATION, found 2
+ await super.test_referencedBeforeDeclaration_hideInBlock_function();
+ }
+
+ @override
+ @failingTest
test_referencedBeforeDeclaration_hideInBlock_local() async {
// Bad state: No type information for v at 38
await super.test_referencedBeforeDeclaration_hideInBlock_local();
@@ -2731,6 +2647,13 @@
@override
@failingTest
+ test_referencedBeforeDeclaration_type_localFunction() async {
+ // Expected 1 errors of type CompileTimeErrorCode.REFERENCED_BEFORE_DECLARATION, found 2
+ await super.test_referencedBeforeDeclaration_type_localFunction();
+ }
+
+ @override
+ @failingTest
test_referencedBeforeDeclaration_type_localVariable() async {
// Bad state: No type information for String at 44
await super.test_referencedBeforeDeclaration_type_localVariable();
@@ -2773,13 +2696,6 @@
@override
@failingTest
- test_sharedDeferredPrefix() async {
- // Bad state: Expected element reference for analyzer offset 86; got one for kernel offset 90
- await super.test_sharedDeferredPrefix();
- }
-
- @override
- @failingTest
test_superInInvalidContext_binaryExpression() async {
// Expected 1 errors of type CompileTimeErrorCode.SUPER_IN_INVALID_CONTEXT, found 0
await super.test_superInInvalidContext_binaryExpression();
@@ -2872,14 +2788,6 @@
@override
@failingTest
- test_typeAliasCannotReferenceItself_functionTypedParameter_returnType() async {
- // Expected 1 errors of type CompileTimeErrorCode.TYPE_ALIAS_CANNOT_REFERENCE_ITSELF, found 0
- await super
- .test_typeAliasCannotReferenceItself_functionTypedParameter_returnType();
- }
-
- @override
- @failingTest
@FastaProblem('https://github.com/dart-lang/sdk/issues/31007')
test_typeAliasCannotReferenceItself_generic() async {
return super.test_typeAliasCannotReferenceItself_generic();
@@ -2887,42 +2795,6 @@
@override
@failingTest
- @FastaProblem('https://github.com/dart-lang/sdk/issues/31007')
- test_typeAliasCannotReferenceItself_parameterType_named() async {
- return super.test_typeAliasCannotReferenceItself_parameterType_named();
- }
-
- @override
- @failingTest
- @FastaProblem('https://github.com/dart-lang/sdk/issues/31007')
- test_typeAliasCannotReferenceItself_parameterType_positional() async {
- return super.test_typeAliasCannotReferenceItself_parameterType_positional();
- }
-
- @override
- @failingTest
- @FastaProblem('https://github.com/dart-lang/sdk/issues/31007')
- test_typeAliasCannotReferenceItself_parameterType_required() async {
- return super.test_typeAliasCannotReferenceItself_parameterType_required();
- }
-
- @override
- @failingTest
- @FastaProblem('https://github.com/dart-lang/sdk/issues/31007')
- test_typeAliasCannotReferenceItself_parameterType_typeArgument() async {
- return super
- .test_typeAliasCannotReferenceItself_parameterType_typeArgument();
- }
-
- @override
- @failingTest
- test_typeAliasCannotReferenceItself_returnType() async {
- // Expected 1 errors of type CompileTimeErrorCode.TYPE_ALIAS_CANNOT_REFERENCE_ITSELF, found 0
- await super.test_typeAliasCannotReferenceItself_returnType();
- }
-
- @override
- @failingTest
test_typeAliasCannotReferenceItself_returnType_indirect() async {
// Expected 2 errors of type CompileTimeErrorCode.TYPE_ALIAS_CANNOT_REFERENCE_ITSELF, found 0
await super.test_typeAliasCannotReferenceItself_returnType_indirect();
@@ -2930,13 +2802,6 @@
@override
@failingTest
- @FastaProblem('https://github.com/dart-lang/sdk/issues/31007')
- test_typeAliasCannotReferenceItself_typeVariableBounds() async {
- return super.test_typeAliasCannotReferenceItself_typeVariableBounds();
- }
-
- @override
- @failingTest
test_typeArgumentNotMatchingBounds_const() async {
// Expected 1 errors of type CompileTimeErrorCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS, found 0
await super.test_typeArgumentNotMatchingBounds_const();
@@ -3053,20 +2918,6 @@
@override
@failingTest
- test_wrongNumberOfParametersForOperator1() async {
- // Expected 1 errors of type CompileTimeErrorCode.WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR, found 0
- await super.test_wrongNumberOfParametersForOperator1();
- }
-
- @override
- @failingTest
- test_wrongNumberOfParametersForOperator_minus() async {
- // Expected 1 errors of type CompileTimeErrorCode.WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR_MINUS, found 0
- await super.test_wrongNumberOfParametersForOperator_minus();
- }
-
- @override
- @failingTest
test_wrongNumberOfParametersForOperator_tilde() async {
// Expected 1 errors of type CompileTimeErrorCode.WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR, found 0
await super.test_wrongNumberOfParametersForOperator_tilde();
@@ -3105,69 +2956,6 @@
// Test passes, even though if fails in the superclass
await super.test_yieldInNonGenerator_async();
}
-
- @override
- @failingTest
- @potentialAnalyzerProblem
- test_genericFunctionTypeAsBound_class() async {
- await super.test_genericFunctionTypeAsBound_class();
- }
-
- @override
- @failingTest
- @potentialAnalyzerProblem
- test_genericFunctionTypeAsBound_genericFunction() async {
- await super.test_genericFunctionTypeAsBound_genericFunction();
- }
-
- @override
- @failingTest
- @potentialAnalyzerProblem
- test_genericFunctionTypeAsBound_genericFunctionTypedef() async {
- await super.test_genericFunctionTypeAsBound_genericFunctionTypedef();
- }
-
- @override
- @failingTest
- @potentialAnalyzerProblem
- test_genericFunctionTypeAsBound_parameterOfFunction() async {
- await super.test_genericFunctionTypeAsBound_parameterOfFunction();
- }
-
- @override
- @failingTest
- @potentialAnalyzerProblem
- test_genericFunctionTypeAsBound_typedef() async {
- await super.test_genericFunctionTypeAsBound_typedef();
- }
-
- @override
- @failingTest
- @potentialAnalyzerProblem
- test_genericFunctionTypeArgument_class() async {
- await super.test_genericFunctionTypeArgument_class();
- }
-
- @override
- @failingTest
- @potentialAnalyzerProblem
- test_genericFunctionTypeArgument_functionType() async {
- await super.test_genericFunctionTypeArgument_functionType();
- }
-
- @override
- @failingTest
- @potentialAnalyzerProblem
- test_genericFunctionTypeArgument_function() async {
- await super.test_genericFunctionTypeArgument_function();
- }
-
- @override
- @failingTest
- @potentialAnalyzerProblem
- test_genericFunctionTypeArgument_method() async {
- await super.test_genericFunctionTypeArgument_method();
- }
}
/// Tests marked with this annotation fail because of a Fasta problem.
diff --git a/pkg/analyzer/test/generated/compile_time_error_code_test.dart b/pkg/analyzer/test/generated/compile_time_error_code_test.dart
index 0e0fd58..3edfff2 100644
--- a/pkg/analyzer/test/generated/compile_time_error_code_test.dart
+++ b/pkg/analyzer/test/generated/compile_time_error_code_test.dart
@@ -34,15 +34,10 @@
const A();
}''');
await computeAnalysisResult(source);
- if (previewDart2) {
- assertErrors(
- source, [StaticWarningCode.TYPE_PARAMETER_REFERENCED_BY_STATIC]);
- } else {
- assertErrors(source, [
- CompileTimeErrorCode.CONST_WITH_TYPE_PARAMETERS,
- StaticWarningCode.TYPE_PARAMETER_REFERENCED_BY_STATIC
- ]);
- }
+ assertErrors(source, [
+ CompileTimeErrorCode.CONST_WITH_TYPE_PARAMETERS,
+ StaticWarningCode.TYPE_PARAMETER_REFERENCED_BY_STATIC
+ ]);
verify([source]);
}
@@ -53,15 +48,10 @@
const A();
}''');
await computeAnalysisResult(source);
- if (previewDart2) {
- assertErrors(
- source, [StaticWarningCode.TYPE_PARAMETER_REFERENCED_BY_STATIC]);
- } else {
- assertErrors(source, [
- CompileTimeErrorCode.CONST_WITH_TYPE_PARAMETERS,
- StaticWarningCode.TYPE_PARAMETER_REFERENCED_BY_STATIC
- ]);
- }
+ assertErrors(source, [
+ CompileTimeErrorCode.CONST_WITH_TYPE_PARAMETERS,
+ StaticWarningCode.TYPE_PARAMETER_REFERENCED_BY_STATIC
+ ]);
verify([source]);
}
@@ -73,12 +63,8 @@
}
}''');
await computeAnalysisResult(source);
- if (previewDart2) {
- assertNoErrors(source);
- } else {
- assertErrors(
- source, [CompileTimeErrorCode.INVALID_TYPE_ARGUMENT_IN_CONST_LIST]);
- }
+ assertErrors(
+ source, [CompileTimeErrorCode.INVALID_TYPE_ARGUMENT_IN_CONST_LIST]);
verify([source]);
}
@@ -90,12 +76,8 @@
}
}''');
await computeAnalysisResult(source);
- if (previewDart2) {
- assertNoErrors(source);
- } else {
- assertErrors(
- source, [CompileTimeErrorCode.INVALID_TYPE_ARGUMENT_IN_CONST_MAP]);
- }
+ assertErrors(
+ source, [CompileTimeErrorCode.INVALID_TYPE_ARGUMENT_IN_CONST_MAP]);
verify([source]);
}
@@ -573,7 +555,7 @@
yield await x;
}''');
await computeAnalysisResult(source);
- if (usingFastaParser) {
+ if (usingFastaParser || useCFE) {
assertErrors(source, [CompileTimeErrorCode.AWAIT_IN_WRONG_CONTEXT]);
}
verify([source]);
@@ -604,6 +586,16 @@
verify([source]);
}
+ test_builtInIdentifierAsType_dynamicMissingPrefix() async {
+ Source source = addSource(r"""
+import 'dart:core' as core;
+
+dynamic x;
+""");
+ await computeAnalysisResult(source);
+ assertErrors(source, [CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_TYPE]);
+ }
+
test_builtInIdentifierAsMixinName_classTypeAlias() async {
Source source = addSource(r'''
class A {}
@@ -3911,7 +3903,7 @@
// using fasta parser.
assertErrors(
source,
- usingFastaParser
+ usingFastaParser && !useCFE
? [
CompileTimeErrorCode.INVALID_MODIFIER_ON_SETTER,
CompileTimeErrorCode.INVALID_MODIFIER_ON_SETTER
@@ -3928,7 +3920,7 @@
await computeAnalysisResult(source);
assertErrors(
source,
- usingFastaParser
+ usingFastaParser && !useCFE
? [
CompileTimeErrorCode.INVALID_MODIFIER_ON_SETTER,
CompileTimeErrorCode.INVALID_MODIFIER_ON_SETTER
@@ -3945,7 +3937,7 @@
await computeAnalysisResult(source);
assertErrors(
source,
- usingFastaParser
+ usingFastaParser && !useCFE
? [
CompileTimeErrorCode.INVALID_MODIFIER_ON_SETTER,
CompileTimeErrorCode.INVALID_MODIFIER_ON_SETTER
@@ -3959,7 +3951,7 @@
await computeAnalysisResult(source);
assertErrors(
source,
- usingFastaParser
+ usingFastaParser && !useCFE
? [
CompileTimeErrorCode.INVALID_MODIFIER_ON_SETTER,
CompileTimeErrorCode.INVALID_MODIFIER_ON_SETTER
@@ -3973,7 +3965,7 @@
await computeAnalysisResult(source);
assertErrors(
source,
- usingFastaParser
+ usingFastaParser && !useCFE
? [
CompileTimeErrorCode.INVALID_MODIFIER_ON_SETTER,
CompileTimeErrorCode.INVALID_MODIFIER_ON_SETTER
@@ -3987,7 +3979,7 @@
await computeAnalysisResult(source);
assertErrors(
source,
- usingFastaParser
+ usingFastaParser && !useCFE
? [
CompileTimeErrorCode.INVALID_MODIFIER_ON_SETTER,
CompileTimeErrorCode.INVALID_MODIFIER_ON_SETTER
@@ -5643,17 +5635,22 @@
test_nonConstValueInInitializer_instanceCreation_inDifferentFile() async {
resetWith(options: new AnalysisOptionsImpl()..strongMode = true);
- Source source = addNamedSource('/a.dart', r'''
+ Source sourceA = addNamedSource('/a.dart', r'''
import 'b.dart';
const v = const MyClass();
''');
- addNamedSource('/b.dart', r'''
+ Source sourceB = addNamedSource('/b.dart', r'''
class MyClass {
const MyClass([p = foo]);
}
''');
- await computeAnalysisResult(source);
- assertErrors(source, [CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION]);
+ await computeAnalysisResult(sourceA);
+ assertNoErrors(sourceA);
+ await computeAnalysisResult(sourceB);
+ assertErrors(sourceB, [
+ CompileTimeErrorCode.NON_CONSTANT_DEFAULT_VALUE,
+ StaticWarningCode.UNDEFINED_IDENTIFIER
+ ]);
}
test_nonConstValueInInitializer_redirecting() async {
diff --git a/pkg/analyzer/test/generated/declaration_resolver_test.dart b/pkg/analyzer/test/generated/declaration_resolver_test.dart
index e93560a3..807155e 100644
--- a/pkg/analyzer/test/generated/declaration_resolver_test.dart
+++ b/pkg/analyzer/test/generated/declaration_resolver_test.dart
@@ -600,7 +600,7 @@
CompilationUnit unit2 = _cloneResolveUnit(unit);
SimpleIdentifier getterName = _findSimpleIdentifier(unit2, code, 'zzz =>');
// Local getters are not allowed, so a FunctionElement is created.
- expect(getterName.staticElement, new isInstanceOf<FunctionElement>());
+ expect(getterName.staticElement, new TypeMatcher<FunctionElement>());
}
test_invalid_functionDeclaration_setter_inFunction() async {
@@ -616,7 +616,7 @@
CompilationUnit unit2 = _cloneResolveUnit(unit);
SimpleIdentifier setterName = _findSimpleIdentifier(unit2, code, 'zzz(x)');
// Local getters are not allowed, so a FunctionElement is created.
- expect(setterName.staticElement, new isInstanceOf<FunctionElement>());
+ expect(setterName.staticElement, new TypeMatcher<FunctionElement>());
}
test_visitExportDirective_notExistingSource() async {
diff --git a/pkg/analyzer/test/generated/element_resolver_test.dart b/pkg/analyzer/test/generated/element_resolver_test.dart
index 61b34e6..9d55238 100644
--- a/pkg/analyzer/test/generated/element_resolver_test.dart
+++ b/pkg/analyzer/test/generated/element_resolver_test.dart
@@ -38,9 +38,9 @@
});
}
-const _isClassElement = const isInstanceOf<ClassElement>();
+const _isClassElement = const TypeMatcher<ClassElement>();
-const _isConstructorElement = const isInstanceOf<ConstructorElement>();
+const _isConstructorElement = const TypeMatcher<ConstructorElement>();
/// Wrapper around the test package's `fail` function.
///
@@ -64,10 +64,10 @@
SimpleIdentifier name3,
Element annotationElement) {
expect(name1, isNotNull);
- expect(name1.staticElement, new isInstanceOf<ClassElement>());
+ expect(name1.staticElement, new TypeMatcher<ClassElement>());
expect(resolutionMap.staticElementForIdentifier(name1).displayName, 'A');
expect(name2, isNotNull);
- expect(name2.staticElement, new isInstanceOf<ConstructorElement>());
+ expect(name2.staticElement, new TypeMatcher<ConstructorElement>());
expect(
resolutionMap.staticElementForIdentifier(name2).displayName, 'named');
expect(name3, isNull);
@@ -94,13 +94,13 @@
SimpleIdentifier name3,
Element annotationElement) {
expect(name1, isNotNull);
- expect(name1.staticElement, new isInstanceOf<PrefixElement>());
+ expect(name1.staticElement, new TypeMatcher<PrefixElement>());
expect(resolutionMap.staticElementForIdentifier(name1).displayName, 'p');
expect(name2, isNotNull);
- expect(name2.staticElement, new isInstanceOf<ClassElement>());
+ expect(name2.staticElement, new TypeMatcher<ClassElement>());
expect(resolutionMap.staticElementForIdentifier(name2).displayName, 'A');
expect(name3, isNotNull);
- expect(name3.staticElement, new isInstanceOf<ConstructorElement>());
+ expect(name3.staticElement, new TypeMatcher<ConstructorElement>());
expect(
resolutionMap.staticElementForIdentifier(name3).displayName, 'named');
if (annotationElement is ConstructorElement) {
@@ -126,13 +126,13 @@
SimpleIdentifier name3,
Element annotationElement) {
expect(name1, isNotNull);
- expect(name1.staticElement, new isInstanceOf<PrefixElement>());
+ expect(name1.staticElement, new TypeMatcher<PrefixElement>());
expect(resolutionMap.staticElementForIdentifier(name1).displayName, 'p');
expect(name2, isNotNull);
- expect(name2.staticElement, new isInstanceOf<ClassElement>());
+ expect(name2.staticElement, new TypeMatcher<ClassElement>());
expect(resolutionMap.staticElementForIdentifier(name2).displayName, 'A');
expect(name3, isNotNull);
- expect(name3.staticElement, new isInstanceOf<PropertyAccessorElement>());
+ expect(name3.staticElement, new TypeMatcher<PropertyAccessorElement>());
expect(resolutionMap.staticElementForIdentifier(name3).displayName, 'V');
if (annotationElement is PropertyAccessorElement) {
expect(annotationElement, same(name3.staticElement));
@@ -156,10 +156,10 @@
SimpleIdentifier name3,
Element annotationElement) {
expect(name1, isNotNull);
- expect(name1.staticElement, new isInstanceOf<PrefixElement>());
+ expect(name1.staticElement, new TypeMatcher<PrefixElement>());
expect(resolutionMap.staticElementForIdentifier(name1).displayName, 'p');
expect(name2, isNotNull);
- expect(name2.staticElement, new isInstanceOf<ClassElement>());
+ expect(name2.staticElement, new TypeMatcher<ClassElement>());
expect(resolutionMap.staticElementForIdentifier(name2).displayName, 'A');
expect(name3, isNull);
if (annotationElement is ConstructorElement) {
@@ -184,10 +184,10 @@
SimpleIdentifier name3,
Element annotationElement) {
expect(name1, isNotNull);
- expect(name1.staticElement, new isInstanceOf<ClassElement>());
+ expect(name1.staticElement, new TypeMatcher<ClassElement>());
expect(resolutionMap.staticElementForIdentifier(name1).displayName, 'A');
expect(name2, isNotNull);
- expect(name2.staticElement, new isInstanceOf<PropertyAccessorElement>());
+ expect(name2.staticElement, new TypeMatcher<PropertyAccessorElement>());
expect(resolutionMap.staticElementForIdentifier(name2).displayName, 'V');
expect(name3, isNull);
if (annotationElement is PropertyAccessorElement) {
@@ -212,7 +212,7 @@
SimpleIdentifier name3,
Element annotationElement) {
expect(name1, isNotNull);
- expect(name1.staticElement, new isInstanceOf<ClassElement>());
+ expect(name1.staticElement, new TypeMatcher<ClassElement>());
expect(resolutionMap.staticElementForIdentifier(name1).displayName, 'A');
expect(name2, isNull);
expect(name3, isNull);
@@ -236,14 +236,14 @@
SimpleIdentifier name3,
Element annotationElement) {
expect(name1, isNotNull);
- expect(name1.staticElement, new isInstanceOf<PropertyAccessorElement>());
+ expect(name1.staticElement, new TypeMatcher<PropertyAccessorElement>());
expect(resolutionMap.staticElementForIdentifier(name1).displayName, 'V');
expect(name2, isNull);
expect(name3, isNull);
if (annotationElement is PropertyAccessorElement) {
expect(annotationElement, same(name1.staticElement));
expect(annotationElement.enclosingElement,
- new isInstanceOf<CompilationUnitElement>());
+ new TypeMatcher<CompilationUnitElement>());
expect(annotationElement.displayName, 'V');
} else {
fail('Expected "annotationElement" is PropertyAccessorElement, '
@@ -261,16 +261,16 @@
SimpleIdentifier name3,
Element annotationElement) {
expect(name1, isNotNull);
- expect(name1.staticElement, new isInstanceOf<PrefixElement>());
+ expect(name1.staticElement, new TypeMatcher<PrefixElement>());
expect(resolutionMap.staticElementForIdentifier(name1).displayName, 'p');
expect(name2, isNotNull);
- expect(name2.staticElement, new isInstanceOf<PropertyAccessorElement>());
+ expect(name2.staticElement, new TypeMatcher<PropertyAccessorElement>());
expect(resolutionMap.staticElementForIdentifier(name2).displayName, 'V');
expect(name3, isNull);
if (annotationElement is PropertyAccessorElement) {
expect(annotationElement, same(name2.staticElement));
expect(annotationElement.enclosingElement,
- new isInstanceOf<CompilationUnitElement>());
+ new TypeMatcher<CompilationUnitElement>());
expect(annotationElement.displayName, 'V');
} else {
fail('Expected "annotationElement" is PropertyAccessorElement, '
@@ -1623,7 +1623,7 @@
MethodInvocation invocation = statement.expression;
SimpleIdentifier prefix = invocation.target;
- expect(prefix.staticElement, new isInstanceOf<PrefixElement>());
+ expect(prefix.staticElement, new TypeMatcher<PrefixElement>());
expect(invocation.methodName.name, 'max');
}
diff --git a/pkg/analyzer/test/generated/error_suppression_kernel_test.dart b/pkg/analyzer/test/generated/error_suppression_kernel_test.dart
index 410dd7e..45043fd 100644
--- a/pkg/analyzer/test/generated/error_suppression_kernel_test.dart
+++ b/pkg/analyzer/test/generated/error_suppression_kernel_test.dart
@@ -51,6 +51,30 @@
@override
@failingTest
+ @FastaProblem('https://github.com/dart-lang/sdk/issues/33676')
+ test_ignore_for_file_whitespace_variant() async {
+ // Bad state: Unable to convert (null, @xyz, Not a constant expression.)
+ await super.test_ignore_for_file_whitespace_variant();
+ }
+
+ @override
+ @failingTest
+ @FastaProblem('https://github.com/dart-lang/sdk/issues/33676')
+ test_ignore_second() async {
+ // Bad state: Unable to convert (null, @xyz, Not a constant expression.)
+ await super.test_ignore_second();
+ }
+
+ @override
+ @failingTest
+ @FastaProblem('https://github.com/dart-lang/sdk/issues/33676')
+ test_ignore_second_trailing() async {
+ // Bad state: Unable to convert (null, @xyz, Not a constant expression.)
+ await super.test_ignore_second_trailing();
+ }
+
+ @override
+ @failingTest
test_invalid_error_code() async {
// Expected 1 errors of type StaticTypeWarningCode.INVALID_ASSIGNMENT, found 0;
// 1 errors of type CompileTimeErrorCode.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE, found 0
@@ -66,6 +90,22 @@
@override
@failingTest
+ @FastaProblem('https://github.com/dart-lang/sdk/issues/33676')
+ test_multiple_comments() async {
+ // Bad state: Unable to convert (null, @xyz, Not a constant expression.)
+ await super.test_multiple_comments();
+ }
+
+ @override
+ @failingTest
+ @FastaProblem('https://github.com/dart-lang/sdk/issues/33676')
+ test_multiple_ignore_for_files() async {
+ // Bad state: Unable to convert (null, @xyz, Not a constant expression.)
+ await super.test_multiple_ignore_for_files();
+ }
+
+ @override
+ @failingTest
test_multiple_ignores() async {
// UnimplementedError: kernel: (Let) let final dynamic #t2 = #lib2::x in let ...
await super.test_multiple_ignores();
@@ -107,3 +147,8 @@
await super.test_no_ignores();
}
}
+
+/// Tests marked with this annotation fail because of a Fasta problem.
+class FastaProblem {
+ const FastaProblem(String issueUri);
+}
diff --git a/pkg/analyzer/test/generated/hint_code_kernel_test.dart b/pkg/analyzer/test/generated/hint_code_kernel_test.dart
index ad843c2..b99033d 100644
--- a/pkg/analyzer/test/generated/hint_code_kernel_test.dart
+++ b/pkg/analyzer/test/generated/hint_code_kernel_test.dart
@@ -41,6 +41,13 @@
return super.test_abstractSuperMemberReference_method_reference();
}
+ @override
+ @failingTest
+ test_abstractSuperMemberReference_setter() async {
+ // Bad state: Unable to convert (ABSTRACT_SUPER_MEMBER_REFERENCE, @99, Superclass has no setter named 'test'.)
+ return super.test_abstractSuperMemberReference_setter();
+ }
+
@failingTest
@override
test_abstractSuperMemberReference_superHasNoSuchMethod() async {
@@ -64,13 +71,6 @@
@failingTest
@override
- test_deadCode_deadFinalStatementInCase() async {
- // Expected 1 errors of type StaticWarningCode.CASE_BLOCK_NOT_TERMINATED, found 0
- return super.test_deadCode_deadFinalStatementInCase();
- }
-
- @failingTest
- @override
test_deprecatedAnnotationUse_call() async {
// Expected 1 errors of type HintCode.DEPRECATED_MEMBER_USE, found 0
return super.test_deprecatedAnnotationUse_call();
@@ -83,12 +83,6 @@
return super.test_deprecatedAnnotationUse_Deprecated();
}
- @override
- @failingTest
- test_deprecatedAnnotationUse_named() async {
- return super.test_deprecatedAnnotationUse_named();
- }
-
@failingTest
@override
test_deprecatedAnnotationUse_positional() async {
@@ -154,38 +148,6 @@
return super.test_invalidRequiredParam_on_named_parameter_with_default();
}
- @override
- @failingTest
- test_invalidRequiredParam_on_positional_parameter() async {
- return super.test_invalidRequiredParam_on_positional_parameter();
- }
-
- @override
- @failingTest
- test_invalidRequiredParam_on_positional_parameter_with_default() async {
- return super
- .test_invalidRequiredParam_on_positional_parameter_with_default();
- }
-
- @override
- @failingTest
- test_invalidRequiredParam_on_required_parameter() async {
- return super.test_invalidRequiredParam_on_required_parameter();
- }
-
- @override
- @failingTest
- test_invalidRequiredParam_valid() async {
- return super.test_invalidRequiredParam_valid();
- }
-
- @override
- @failingTest
- test_isNotDouble() {
- // Bad state: No data for is at 10
- return super.test_isNotDouble();
- }
-
@failingTest
@override
test_js_lib_OK() async {
@@ -249,13 +211,6 @@
return super.test_mustCallSuper_indirect();
}
- @failingTest
- @override
- test_nullAwareBeforeOperator_ok_is_not() {
- // Bad state: No data for is at 14
- return super.test_nullAwareBeforeOperator_ok_is_not();
- }
-
@override
@failingTest
test_required_constructor_param() async {
@@ -264,30 +219,12 @@
@override
@failingTest
- test_required_constructor_param_no_reason() async {
- return super.test_required_constructor_param_no_reason();
- }
-
- @override
- @failingTest
test_required_constructor_param_null_reason() async {
return super.test_required_constructor_param_null_reason();
}
@override
@failingTest
- test_required_constructor_param_OK() async {
- return super.test_required_constructor_param_OK();
- }
-
- @override
- @failingTest
- test_required_constructor_param_redirecting_cons_call() async {
- return super.test_required_constructor_param_redirecting_cons_call();
- }
-
- @override
- @failingTest
test_required_constructor_param_super_call() async {
return super.test_required_constructor_param_super_call();
}
@@ -332,67 +269,6 @@
@failingTest
@override
- test_strongMode_topLevelInstanceGetter_implicitlyTyped_field_call() {
- // NoSuchMethodError: The setter 'enclosingElement=' was called on null.
- return super
- .test_strongMode_topLevelInstanceGetter_implicitlyTyped_field_call();
- }
-
- @override
- @failingTest
- test_strongMode_topLevelInstanceGetter_implicitlyTyped_invoke() {
- return super
- .test_strongMode_topLevelInstanceGetter_implicitlyTyped_invoke();
- }
-
- @override
- @failingTest
- test_strongMode_topLevelInstanceGetter_implicitlyTyped_invoke_explicit_type_params() {
- return super
- .test_strongMode_topLevelInstanceGetter_implicitlyTyped_invoke_explicit_type_params();
- }
-
- @failingTest
- @override
- test_strongMode_topLevelInstanceGetter_implicitlyTyped_invoke_not_generic() {
- // NoSuchMethodError: The setter 'enclosingElement=' was called on null.
- return super
- .test_strongMode_topLevelInstanceGetter_implicitlyTyped_invoke_not_generic();
- }
-
- @failingTest
- @override
- test_strongMode_topLevelInstanceGetter_implicitlyTyped_new_explicit_type_params_prefixed() {
- // NoSuchMethodError: The setter 'enclosingElement=' was called on null.
- return super
- .test_strongMode_topLevelInstanceGetter_implicitlyTyped_new_explicit_type_params_prefixed();
- }
-
- @failingTest
- @override
- test_strongMode_topLevelInstanceGetter_implicitlyTyped_new_not_generic_prefixed() {
- // NoSuchMethodError: The getter 'element' was called on null.
- return super
- .test_strongMode_topLevelInstanceGetter_implicitlyTyped_new_not_generic_prefixed();
- }
-
- @failingTest
- @override
- test_strongMode_topLevelInstanceGetter_implicitlyTyped_new_prefixed() {
- // NoSuchMethodError: The getter 'element' was called on null.
- return super
- .test_strongMode_topLevelInstanceGetter_implicitlyTyped_new_prefixed();
- }
-
- @failingTest
- @override
- test_typeCheck_type_not_Null() {
- // Bad state: No data for is at 20
- return super.test_typeCheck_type_not_Null();
- }
-
- @failingTest
- @override
test_undefinedOperator_binaryExpression() async {
// Expected 1 errors of type HintCode.UNDEFINED_OPERATOR, found 0
return super.test_undefinedOperator_binaryExpression();
@@ -421,27 +297,6 @@
@failingTest
@override
- test_unnecessaryTypeCheck_null_not_Null() {
- // Bad state: No data for is at 14
- return super.test_unnecessaryTypeCheck_null_not_Null();
- }
-
- @failingTest
- @override
- test_unnecessaryTypeCheck_type_not_dynamic() {
- // Bad state: No data for is at 20
- return super.test_unnecessaryTypeCheck_type_not_dynamic();
- }
-
- @failingTest
- @override
- test_unnecessaryTypeCheck_type_not_object() {
- // Bad state: No data for is at 20
- return super.test_unnecessaryTypeCheck_type_not_object();
- }
-
- @failingTest
- @override
test_unusedImport_inComment_libraryDirective() async {
// Expected 0 errors of type HintCode.UNUSED_IMPORT, found 1 (42)
return super.test_unusedImport_inComment_libraryDirective();
diff --git a/pkg/analyzer/test/generated/invalid_code_kernel_test.dart b/pkg/analyzer/test/generated/invalid_code_kernel_test.dart
index 70278fd..267c8ea 100644
--- a/pkg/analyzer/test/generated/invalid_code_kernel_test.dart
+++ b/pkg/analyzer/test/generated/invalid_code_kernel_test.dart
@@ -25,12 +25,6 @@
@failingTest
@override
- test_constructorAndMethodNameCollision() async {
- return super.test_constructorAndMethodNameCollision();
- }
-
- @failingTest
- @override
test_genericFunction_asTypeArgument_ofUnresolvedClass() async {
return super.test_genericFunction_asTypeArgument_ofUnresolvedClass();
}
diff --git a/pkg/analyzer/test/generated/non_error_resolver_kernel_test.dart b/pkg/analyzer/test/generated/non_error_resolver_kernel_test.dart
index 0195c61..cbecf0a 100644
--- a/pkg/analyzer/test/generated/non_error_resolver_kernel_test.dart
+++ b/pkg/analyzer/test/generated/non_error_resolver_kernel_test.dart
@@ -21,16 +21,16 @@
/// them, or know that this is an analyzer problem.
const potentialAnalyzerProblem = const Object();
-/// Tests marked with this annotation fail because of a Fasta problem.
-class FastaProblem {
- const FastaProblem(String issueUri);
-}
-
/// Tests marked with this annotation fail because of an Analyzer problem.
class AnalyzerProblem {
const AnalyzerProblem(String issueUri);
}
+/// Tests marked with this annotation fail because of a Fasta problem.
+class FastaProblem {
+ const FastaProblem(String issueUri);
+}
+
@reflectiveTest
class NonErrorResolverTest_Kernel extends NonErrorResolverTest_Driver {
@override
@@ -119,29 +119,25 @@
@override
@failingTest
@potentialAnalyzerProblem
- test_constConstructorWithNonConstSuper_unresolved() async {
- return super.test_constConstructorWithNonConstSuper_unresolved();
+ test_conflictingStaticSetterAndInstanceMember_thisClass_method() async {
+ // Bad state: Unable to convert (null, @39, Conflicts with member 'x'.)
+ return super
+ .test_conflictingStaticSetterAndInstanceMember_thisClass_method();
+ }
+
+ @override
+ @failingTest
+ @FastaProblem('https://github.com/dart-lang/sdk/issues/33676')
+ test_constConstructorWithMixinWithField() {
+ // Bad state: Unable to convert (Unspecified, null, @52, Can't extend a mixin application and be 'const'.)
+ return super.test_constConstructorWithMixinWithField();
}
@override
@failingTest
@potentialAnalyzerProblem
- test_constDeferredClass_new() async {
- return super.test_constDeferredClass_new();
- }
-
- @override
- @failingTest
- @FastaProblem('https://github.com/dart-lang/sdk/issues/28434')
- test_constructorDeclaration_scope_signature() async {
- return super.test_constructorDeclaration_scope_signature();
- }
-
- @override
- @failingTest
- test_duplicateDefinition_emptyName() {
- // NoSuchMethodError: The setter 'enclosingElement=' was called on null.
- return super.test_duplicateDefinition_emptyName();
+ test_constConstructorWithNonConstSuper_unresolved() async {
+ return super.test_constConstructorWithNonConstSuper_unresolved();
}
@override
@@ -174,15 +170,9 @@
@override
@failingTest
- @FastaProblem('https://github.com/dart-lang/sdk/issues/28434')
- test_functionDeclaration_scope_signature() async {
- return super.test_functionDeclaration_scope_signature();
- }
-
- @override
- @failingTest
- @FastaProblem('https://github.com/dart-lang/sdk/issues/28434')
+ @potentialAnalyzerProblem
test_functionTypeAlias_scope_signature() async {
+ // Caused by Bad state: Found 1 annotation nodes and 0 element annotations
return super.test_functionTypeAlias_scope_signature();
}
@@ -195,22 +185,6 @@
@override
@failingTest
- @FastaProblem('https://github.com/dart-lang/sdk/issues/31641')
- test_invalidAnnotation_constantVariable_field() async {
- return super.test_invalidAnnotation_constantVariable_field();
- }
-
- @override
- @failingTest
- test_invalidAnnotation_constantVariable_field_importWithPrefix() {
- // type 'PrefixedIdentifierImpl' is not a subtype of type 'SimpleIdentifier'
- // of 'topEntity'
- return super
- .test_invalidAnnotation_constantVariable_field_importWithPrefix();
- }
-
- @override
- @failingTest
@FastaProblem('https://github.com/dart-lang/sdk/issues/31758')
test_invocationOfNonFunction_Object() async {
return super.test_invocationOfNonFunction_Object();
@@ -218,13 +192,6 @@
@override
@failingTest
- test_issue_32394() {
- // Failed assertion: line 1133 pos 12: 'element != null': is not true.
- return super.test_issue_32394();
- }
-
- @override
- @failingTest
@potentialAnalyzerProblem
test_loadLibraryDefined() async {
return super.test_loadLibraryDefined();
@@ -240,13 +207,6 @@
@override
@failingTest
- @FastaProblem('https://github.com/dart-lang/sdk/issues/28434')
- test_methodDeclaration_scope_signature() async {
- return super.test_methodDeclaration_scope_signature();
- }
-
- @override
- @failingTest
test_nativeConstConstructor() {
// Expected 0 errors of type ParserErrorCode.CONST_CONSTRUCTOR_WITH_BODY, found 1 (35)
return super.test_nativeConstConstructor();
@@ -289,16 +249,10 @@
@override
@failingTest
- @potentialAnalyzerProblem
- test_returnOfInvalidType_typeParameter_18468() async {
- return super.test_returnOfInvalidType_typeParameter_18468();
- }
-
- @override
- @failingTest
- test_undefinedGetter_static_conditionalAccess() {
- // Bad state: No data for A at 36
- return super.test_undefinedGetter_static_conditionalAccess();
+ @FastaProblem('https://github.com/dart-lang/sdk/issues/33677')
+ test_undefinedIdentifier_synthetic_whenExpression() {
+ // Expected 0 errors of type StaticTypeWarningCode.UNDEFINED_GETTER, found 1 (29)
+ return super.test_undefinedIdentifier_synthetic_whenExpression();
}
@override
@@ -307,18 +261,4 @@
test_undefinedIdentifier_synthetic_whenMethodName() async {
return super.test_undefinedIdentifier_synthetic_whenMethodName();
}
-
- @override
- @failingTest
- test_undefinedMethod_static_conditionalAccess() {
- // Bad state: No data for A at 39
- return super.test_undefinedMethod_static_conditionalAccess();
- }
-
- @override
- @failingTest
- test_undefinedSetter_static_conditionalAccess() {
- // Bad state: No data for A at 34
- return super.test_undefinedSetter_static_conditionalAccess();
- }
}
diff --git a/pkg/analyzer/test/generated/non_error_resolver_test.dart b/pkg/analyzer/test/generated/non_error_resolver_test.dart
index efa9d7a..679a8d5 100644
--- a/pkg/analyzer/test/generated/non_error_resolver_test.dart
+++ b/pkg/analyzer/test/generated/non_error_resolver_test.dart
@@ -1003,7 +1003,7 @@
{
SimpleIdentifier ref =
EngineTestCase.findSimpleIdentifier(unit, code, "p]");
- expect(ref.staticElement, new isInstanceOf<ParameterElement>());
+ expect(ref.staticElement, new TypeMatcher<ParameterElement>());
}
}
@@ -1056,7 +1056,7 @@
CompilationUnit unit = analysisResult.unit;
SimpleIdentifier ref =
EngineTestCase.findSimpleIdentifier(unit, code, 'p]');
- expect(ref.staticElement, new isInstanceOf<ParameterElement>());
+ expect(ref.staticElement, new TypeMatcher<ParameterElement>());
}
test_commentReference_beforeFunction_expressionBody() async {
@@ -1070,7 +1070,7 @@
CompilationUnit unit = analysisResult.unit;
SimpleIdentifier ref =
EngineTestCase.findSimpleIdentifier(unit, code, 'p]');
- expect(ref.staticElement, new isInstanceOf<ParameterElement>());
+ expect(ref.staticElement, new TypeMatcher<ParameterElement>());
}
test_commentReference_beforeFunctionTypeAlias() async {
@@ -1085,7 +1085,7 @@
CompilationUnit unit = analysisResult.unit;
SimpleIdentifier ref =
EngineTestCase.findSimpleIdentifier(unit, code, 'p]');
- expect(ref.staticElement, new isInstanceOf<ParameterElement>());
+ expect(ref.staticElement, new TypeMatcher<ParameterElement>());
}
test_commentReference_beforeGenericTypeAlias() async {
@@ -1105,9 +1105,9 @@
.staticElement;
}
- expect(getElement('T]'), new isInstanceOf<TypeParameterElement>());
- expect(getElement('S]'), new isInstanceOf<TypeParameterElement>());
- expect(getElement('p]'), new isInstanceOf<ParameterElement>());
+ expect(getElement('T]'), new TypeMatcher<TypeParameterElement>());
+ expect(getElement('S]'), new TypeMatcher<TypeParameterElement>());
+ expect(getElement('p]'), new TypeMatcher<ParameterElement>());
}
test_commentReference_beforeGetter() async {
@@ -1148,7 +1148,7 @@
assertIsParameter(String search) {
SimpleIdentifier ref =
EngineTestCase.findSimpleIdentifier(unit, code, search);
- expect(ref.staticElement, new isInstanceOf<ParameterElement>());
+ expect(ref.staticElement, new TypeMatcher<ParameterElement>());
}
assertIsParameter('p1');
@@ -1172,7 +1172,7 @@
CompilationUnit unit = analysisResult.unit;
SimpleIdentifier ref =
EngineTestCase.findSimpleIdentifier(unit, code, 'foo]');
- expect(ref.staticElement, new isInstanceOf<MethodElement>());
+ expect(ref.staticElement, new TypeMatcher<MethodElement>());
}
test_commentReference_setter() async {
@@ -1195,12 +1195,12 @@
{
SimpleIdentifier ref =
EngineTestCase.findSimpleIdentifier(unit, code, "x] in A");
- expect(ref.staticElement, new isInstanceOf<PropertyAccessorElement>());
+ expect(ref.staticElement, new TypeMatcher<PropertyAccessorElement>());
}
{
SimpleIdentifier ref =
EngineTestCase.findSimpleIdentifier(unit, code, 'x] in B');
- expect(ref.staticElement, new isInstanceOf<PropertyAccessorElement>());
+ expect(ref.staticElement, new TypeMatcher<PropertyAccessorElement>());
}
}
@@ -6383,6 +6383,43 @@
verify([source]);
}
+ Future test_issue32114() async {
+ addNamedSource('/a.dart', '''
+class O {}
+
+typedef T Func<T extends O>(T e);
+''');
+ addNamedSource('/b.dart', '''
+import 'a.dart';
+export 'a.dart' show Func;
+
+abstract class A<T extends O> {
+ Func<T> get func;
+}
+''');
+ final Source source = addSource('''
+import 'b.dart';
+
+class B extends A {
+ Func get func => (x) => x;
+}
+''');
+ await computeAnalysisResult(source);
+ assertNoErrors(source);
+ verify([source]);
+ }
+
+ Future test_useDynamicWithPrefix() async {
+ final Source source = addSource('''
+import 'dart:core' as core;
+
+core.dynamic dynamicVariable;
+''');
+ await computeAnalysisResult(source);
+ assertNoErrors(source);
+ verify([source]);
+ }
+
Future<Null> _check_wrongNumberOfParametersForOperator(
String name, String parameters) async {
Source source = addSource("""
diff --git a/pkg/analyzer/test/generated/non_hint_code_kernel_test.dart b/pkg/analyzer/test/generated/non_hint_code_kernel_test.dart
index f8e4ba4..d0b41db 100644
--- a/pkg/analyzer/test/generated/non_hint_code_kernel_test.dart
+++ b/pkg/analyzer/test/generated/non_hint_code_kernel_test.dart
@@ -4,7 +4,6 @@
import 'package:analyzer/src/dart/error/hint_codes.dart';
import 'package:analyzer/src/generated/source.dart';
-import 'package:test/test.dart';
import 'package:test_reflective_loader/test_reflective_loader.dart';
import 'non_hint_code_driver_test.dart';
@@ -37,40 +36,6 @@
@override
bool get useCFE => true;
- @override
- @failingTest
- test_deprecatedAnnotationUse_namedParameter_inDefiningFunction() {
- // Failed assertion: line 215 pos 14: 'node.parent is PartOfDirective ||
- // node.parent is EnumConstantDeclaration': is not true.
- return super
- .test_deprecatedAnnotationUse_namedParameter_inDefiningFunction();
- }
-
- @override
- @failingTest
- test_deprecatedAnnotationUse_namedParameter_inDefiningLocalFunction() {
- // Failed to resolve 1 nodes
- return super
- .test_deprecatedAnnotationUse_namedParameter_inDefiningLocalFunction();
- }
-
- @override
- @failingTest
- test_deprecatedAnnotationUse_namedParameter_inDefiningMethod() {
- // Failed assertion: line 215 pos 14: 'node.parent is PartOfDirective ||
- // node.parent is EnumConstantDeclaration': is not true.
- return super.test_deprecatedAnnotationUse_namedParameter_inDefiningMethod();
- }
-
- @override
- @failingTest
- test_deprecatedAnnotationUse_namedParameter_inNestedLocalFunction() {
- // Failed assertion: line 215 pos 14: 'node.parent is PartOfDirective ||
- // node.parent is EnumConstantDeclaration': is not true.
- return super
- .test_deprecatedAnnotationUse_namedParameter_inNestedLocalFunction();
- }
-
@failingTest
@override
@potentialAnalyzerProblem
@@ -142,11 +107,10 @@
@override
@failingTest
- @FastaProblem('https://github.com/dart-lang/sdk/issues/28434')
+ @potentialAnalyzerProblem
test_unusedImport_annotationOnDirective() async {
- // TODO(scheglov) We don't yet parse annotations on import directives.
- fail('This test fails in checked mode (indirectly)');
-// await super.test_unusedImport_annotationOnDirective();
+ // Expected 0 errors of type HintCode.UNUSED_IMPORT, found 1 (23)
+ await super.test_unusedImport_annotationOnDirective();
}
@failingTest
@@ -155,4 +119,12 @@
test_unusedImport_metadata() async {
await super.test_unusedImport_metadata();
}
+
+ @override
+ @failingTest
+ @FastaProblem('https://github.com/dart-lang/sdk/issues/33678')
+ test_withSuperMixin() async {
+ // Expected 0 errors of type StaticTypeWarningCode.UNDEFINED_SUPER_GETTER, found 1 (82)
+ await super.test_withSuperMixin();
+ }
}
diff --git a/pkg/analyzer/test/generated/package_test.dart b/pkg/analyzer/test/generated/package_test.dart
index e80e868..0fbf4fb 100644
--- a/pkg/analyzer/test/generated/package_test.dart
+++ b/pkg/analyzer/test/generated/package_test.dart
@@ -68,7 +68,7 @@
DependencyFinder finder = new DependencyFinder(resourceProvider);
expect(() => finder.transitiveDependenciesFor(packageMap, packagePath),
- throwsA(new isInstanceOf<AnalysisException>()));
+ throwsA(new TypeMatcher<AnalysisException>()));
}
void test_transitiveDependenciesFor_noDependencies() {
diff --git a/pkg/analyzer/test/generated/parser_fasta_test.dart b/pkg/analyzer/test/generated/parser_fasta_test.dart
index 6999dfb..7381d85 100644
--- a/pkg/analyzer/test/generated/parser_fasta_test.dart
+++ b/pkg/analyzer/test/generated/parser_fasta_test.dart
@@ -1060,7 +1060,7 @@
ParserErrorCode.NATIVE_CLAUSE_SHOULD_BE_ANNOTATION,
]);
}
- expect(member, new isInstanceOf<ClassDeclaration>());
+ expect(member, new TypeMatcher<ClassDeclaration>());
ClassDeclaration declaration = member;
expect(declaration.nativeClause, isNotNull);
expect(declaration.nativeClause.nativeKeyword, isNotNull);
diff --git a/pkg/analyzer/test/generated/parser_test.dart b/pkg/analyzer/test/generated/parser_test.dart
index 18d1d5a..f7003ec 100644
--- a/pkg/analyzer/test/generated/parser_test.dart
+++ b/pkg/analyzer/test/generated/parser_test.dart
@@ -342,7 +342,7 @@
ClassMember member = parser.parseClassMember('C');
expect(member, isNotNull);
assertNoErrors();
- expect(member, new isInstanceOf<MethodDeclaration>());
+ expect(member, new TypeMatcher<MethodDeclaration>());
MethodDeclaration method = member;
FunctionBody body = method.body;
EngineTestCase.assertInstanceOf(
@@ -362,7 +362,7 @@
ClassMember member = parser.parseClassMember('C');
expect(member, isNotNull);
assertNoErrors();
- expect(member, new isInstanceOf<MethodDeclaration>());
+ expect(member, new TypeMatcher<MethodDeclaration>());
MethodDeclaration method = member;
FunctionBody body = method.body;
EngineTestCase.assertInstanceOf(
@@ -422,7 +422,7 @@
ClassMember member = parser.parseClassMember('C');
expect(member, isNotNull);
assertNoErrors();
- expect(member, new isInstanceOf<ConstructorDeclaration>());
+ expect(member, new TypeMatcher<ConstructorDeclaration>());
ConstructorDeclaration constructor = member;
expect(constructor.body, isNotNull);
expect(constructor.separator, isNotNull);
@@ -441,7 +441,7 @@
ClassMember member = parser.parseClassMember('C');
expect(member, isNotNull);
assertNoErrors();
- expect(member, new isInstanceOf<FieldDeclaration>());
+ expect(member, new TypeMatcher<FieldDeclaration>());
FieldDeclaration field = member;
expect(field.covariantKeyword, isNotNull);
expect(field.documentationComment, isNull);
@@ -460,7 +460,7 @@
ClassMember member = parser.parseClassMember('C');
expect(member, isNotNull);
assertNoErrors();
- expect(member, new isInstanceOf<FieldDeclaration>());
+ expect(member, new TypeMatcher<FieldDeclaration>());
FieldDeclaration field = member;
expect(field.covariantKeyword, isNull);
expect(field.documentationComment, isNull);
@@ -490,9 +490,9 @@
''');
ClassMember member = parser.parseClassMember('C');
assertNoErrors();
- expect(member, new isInstanceOf<FieldDeclaration>());
+ expect(member, new TypeMatcher<FieldDeclaration>());
VariableDeclarationList fields = (member as FieldDeclaration).fields;
- expect(fields.type, new isInstanceOf<GenericFunctionType>());
+ expect(fields.type, new TypeMatcher<GenericFunctionType>());
}
void test_parseClassMember_field_gftType_noReturnType() {
@@ -501,9 +501,9 @@
''');
ClassMember member = parser.parseClassMember('C');
assertNoErrors();
- expect(member, new isInstanceOf<FieldDeclaration>());
+ expect(member, new TypeMatcher<FieldDeclaration>());
VariableDeclarationList fields = (member as FieldDeclaration).fields;
- expect(fields.type, new isInstanceOf<GenericFunctionType>());
+ expect(fields.type, new TypeMatcher<GenericFunctionType>());
}
void test_parseClassMember_field_instance_prefixedType() {
@@ -511,7 +511,7 @@
ClassMember member = parser.parseClassMember('C');
expect(member, isNotNull);
assertNoErrors();
- expect(member, new isInstanceOf<FieldDeclaration>());
+ expect(member, new TypeMatcher<FieldDeclaration>());
FieldDeclaration field = member;
expect(field.covariantKeyword, isNull);
expect(field.documentationComment, isNull);
@@ -531,7 +531,7 @@
ClassMember member = parser.parseClassMember('C');
expect(member, isNotNull);
assertNoErrors();
- expect(member, new isInstanceOf<FieldDeclaration>());
+ expect(member, new TypeMatcher<FieldDeclaration>());
FieldDeclaration field = member;
expect(field.covariantKeyword, isNull);
expect(field.documentationComment, isNull);
@@ -550,7 +550,7 @@
ClassMember member = parser.parseClassMember('C');
expect(member, isNotNull);
assertNoErrors();
- expect(member, new isInstanceOf<FieldDeclaration>());
+ expect(member, new TypeMatcher<FieldDeclaration>());
FieldDeclaration field = member;
expect(field.covariantKeyword, isNull);
expect(field.documentationComment, isNull);
@@ -569,7 +569,7 @@
ClassMember member = parser.parseClassMember('C');
expect(member, isNotNull);
assertNoErrors();
- expect(member, new isInstanceOf<FieldDeclaration>());
+ expect(member, new TypeMatcher<FieldDeclaration>());
FieldDeclaration field = member;
expect(field.covariantKeyword, isNull);
expect(field.documentationComment, isNull);
@@ -589,7 +589,7 @@
ClassMember member = parser.parseClassMember('C');
expect(member, isNotNull);
assertNoErrors();
- expect(member, new isInstanceOf<FieldDeclaration>());
+ expect(member, new TypeMatcher<FieldDeclaration>());
FieldDeclaration field = member;
expect(field.covariantKeyword, isNull);
expect(field.documentationComment, isNull);
@@ -640,7 +640,7 @@
ClassMember member = parser.parseClassMember('C');
expect(member, isNotNull);
assertNoErrors();
- expect(member, new isInstanceOf<FieldDeclaration>());
+ expect(member, new TypeMatcher<FieldDeclaration>());
FieldDeclaration field = member;
expect(field.covariantKeyword, isNull);
expect(field.documentationComment, isNull);
@@ -659,7 +659,7 @@
ClassMember member = parser.parseClassMember('C');
expect(member, isNotNull);
assertNoErrors();
- expect(member, new isInstanceOf<MethodDeclaration>());
+ expect(member, new TypeMatcher<MethodDeclaration>());
MethodDeclaration method = member;
expect(method.documentationComment, isNull);
expect(method.externalKeyword, isNull);
@@ -677,7 +677,7 @@
ClassMember member = parser.parseClassMember('C');
expect(member, isNotNull);
assertNoErrors();
- expect(member, new isInstanceOf<MethodDeclaration>());
+ expect(member, new TypeMatcher<MethodDeclaration>());
MethodDeclaration method = member;
expect(method.documentationComment, isNull);
expect(method.externalKeyword, isNull);
@@ -696,7 +696,7 @@
ClassMember member = parser.parseClassMember('C');
expect(member, isNotNull);
assertNoErrors();
- expect(member, new isInstanceOf<MethodDeclaration>());
+ expect(member, new TypeMatcher<MethodDeclaration>());
MethodDeclaration method = member;
expect(method.documentationComment, isNull);
expect(method.externalKeyword, isNotNull);
@@ -720,7 +720,7 @@
ClassMember member = parser.parseClassMember('C');
expect(member, isNotNull);
assertNoErrors();
- expect(member, new isInstanceOf<MethodDeclaration>());
+ expect(member, new TypeMatcher<MethodDeclaration>());
MethodDeclaration method = member;
expect(method.body, isNotNull);
expect(method.documentationComment, isNull);
@@ -744,7 +744,7 @@
} else {
assertErrorsWithCodes([HintCode.GENERIC_METHOD_COMMENT]);
}
- expect(member, new isInstanceOf<MethodDeclaration>());
+ expect(member, new TypeMatcher<MethodDeclaration>());
MethodDeclaration method = member;
expect(method.documentationComment, isNull);
expect(method.externalKeyword, isNull);
@@ -769,7 +769,7 @@
assertErrorsWithCodes(
[HintCode.GENERIC_METHOD_COMMENT, HintCode.GENERIC_METHOD_COMMENT]);
}
- expect(member, new isInstanceOf<MethodDeclaration>());
+ expect(member, new TypeMatcher<MethodDeclaration>());
MethodDeclaration method = member;
expect(method.documentationComment, isNull);
expect(method.externalKeyword, isNull);
@@ -801,7 +801,7 @@
assertErrorsWithCodes(
[HintCode.GENERIC_METHOD_COMMENT, HintCode.GENERIC_METHOD_COMMENT]);
}
- expect(member, new isInstanceOf<MethodDeclaration>());
+ expect(member, new TypeMatcher<MethodDeclaration>());
MethodDeclaration method = member;
expect(method.documentationComment, isNull);
expect(method.externalKeyword, isNull);
@@ -827,7 +827,7 @@
assertErrorsWithCodes(
[HintCode.GENERIC_METHOD_COMMENT, HintCode.GENERIC_METHOD_COMMENT]);
}
- expect(member, new isInstanceOf<MethodDeclaration>());
+ expect(member, new TypeMatcher<MethodDeclaration>());
MethodDeclaration method = member;
expect(method.documentationComment, isNull);
expect(method.externalKeyword, isNull);
@@ -856,7 +856,7 @@
assertErrorsWithCodes(
[HintCode.GENERIC_METHOD_COMMENT, HintCode.GENERIC_METHOD_COMMENT]);
}
- expect(member, new isInstanceOf<MethodDeclaration>());
+ expect(member, new TypeMatcher<MethodDeclaration>());
MethodDeclaration method = member;
expect(method.documentationComment, isNull);
expect(method.externalKeyword, isNull);
@@ -891,7 +891,7 @@
} else {
assertErrorsWithCodes([HintCode.GENERIC_METHOD_COMMENT]);
}
- expect(member, new isInstanceOf<MethodDeclaration>());
+ expect(member, new TypeMatcher<MethodDeclaration>());
MethodDeclaration method = member;
expect(method.documentationComment, isNull);
expect(method.externalKeyword, isNull);
@@ -910,7 +910,7 @@
ClassMember member = parser.parseClassMember('C');
expect(member, isNotNull);
assertNoErrors();
- expect(member, new isInstanceOf<MethodDeclaration>());
+ expect(member, new TypeMatcher<MethodDeclaration>());
MethodDeclaration method = member;
expect(method.documentationComment, isNull);
expect(method.externalKeyword, isNull);
@@ -929,7 +929,7 @@
ClassMember member = parser.parseClassMember('C');
expect(member, isNotNull);
assertNoErrors();
- expect(member, new isInstanceOf<MethodDeclaration>());
+ expect(member, new TypeMatcher<MethodDeclaration>());
MethodDeclaration method = member;
expect(method.documentationComment, isNull);
expect(method.externalKeyword, isNull);
@@ -955,7 +955,7 @@
ClassMember member = parser.parseClassMember('C');
expect(member, isNotNull);
assertNoErrors();
- expect(member, new isInstanceOf<MethodDeclaration>());
+ expect(member, new TypeMatcher<MethodDeclaration>());
MethodDeclaration method = member;
expect(method.documentationComment, isNull);
expect(method.externalKeyword, isNull);
@@ -974,7 +974,7 @@
ClassMember member = parser.parseClassMember('C');
expect(member, isNotNull);
assertNoErrors();
- expect(member, new isInstanceOf<MethodDeclaration>());
+ expect(member, new TypeMatcher<MethodDeclaration>());
MethodDeclaration method = member;
expect(method.documentationComment, isNull);
expect(method.externalKeyword, isNull);
@@ -997,7 +997,7 @@
ClassMember member = parser.parseClassMember('C');
expect(member, isNotNull);
assertNoErrors();
- expect(member, new isInstanceOf<MethodDeclaration>());
+ expect(member, new TypeMatcher<MethodDeclaration>());
MethodDeclaration method = member;
expect(method.documentationComment, isNull);
expect(method.externalKeyword, isNull);
@@ -1027,7 +1027,7 @@
ClassMember member = parser.parseClassMember('C');
expect(member, isNotNull);
assertNoErrors();
- expect(member, new isInstanceOf<MethodDeclaration>());
+ expect(member, new TypeMatcher<MethodDeclaration>());
MethodDeclaration method = member;
expect(method.documentationComment, isNull);
expect(method.externalKeyword, isNull);
@@ -1047,7 +1047,7 @@
ClassMember member = parser.parseClassMember('C');
expect(member, isNotNull);
assertNoErrors();
- expect(member, new isInstanceOf<MethodDeclaration>());
+ expect(member, new TypeMatcher<MethodDeclaration>());
MethodDeclaration method = member;
expect(method.documentationComment, isNull);
expect(method.externalKeyword, isNull);
@@ -1066,7 +1066,7 @@
ClassMember member = parser.parseClassMember('C');
expect(member, isNotNull);
assertNoErrors();
- expect(member, new isInstanceOf<MethodDeclaration>());
+ expect(member, new TypeMatcher<MethodDeclaration>());
MethodDeclaration method = member;
expect(method.documentationComment, isNull);
expect(method.externalKeyword, isNull);
@@ -1085,7 +1085,7 @@
ClassMember member = parser.parseClassMember('C');
expect(member, isNotNull);
assertNoErrors();
- expect(member, new isInstanceOf<MethodDeclaration>());
+ expect(member, new TypeMatcher<MethodDeclaration>());
MethodDeclaration method = member;
expect(method.documentationComment, isNull);
expect(method.externalKeyword, isNull);
@@ -1104,7 +1104,7 @@
ClassMember member = parser.parseClassMember('C');
expect(member, isNotNull);
assertNoErrors();
- expect(member, new isInstanceOf<MethodDeclaration>());
+ expect(member, new TypeMatcher<MethodDeclaration>());
MethodDeclaration method = member;
expect(method.documentationComment, isNull);
expect(method.externalKeyword, isNull);
@@ -1124,9 +1124,9 @@
''');
ClassMember member = parser.parseClassMember('C');
assertNoErrors();
- expect(member, new isInstanceOf<MethodDeclaration>());
+ expect(member, new TypeMatcher<MethodDeclaration>());
expect((member as MethodDeclaration).body,
- new isInstanceOf<ExpressionFunctionBody>());
+ new TypeMatcher<ExpressionFunctionBody>());
}
void test_parseClassMember_method_gftReturnType_voidReturnType() {
@@ -1135,9 +1135,9 @@
''');
ClassMember member = parser.parseClassMember('C');
assertNoErrors();
- expect(member, new isInstanceOf<MethodDeclaration>());
+ expect(member, new TypeMatcher<MethodDeclaration>());
expect((member as MethodDeclaration).body,
- new isInstanceOf<ExpressionFunctionBody>());
+ new TypeMatcher<ExpressionFunctionBody>());
}
void test_parseClassMember_method_native_allowed() {
@@ -1219,7 +1219,7 @@
ClassMember member = parser.parseClassMember('C');
expect(member, isNotNull);
assertNoErrors();
- expect(member, new isInstanceOf<MethodDeclaration>());
+ expect(member, new TypeMatcher<MethodDeclaration>());
MethodDeclaration method = member;
expect(method.documentationComment, isNull);
expect(method.externalKeyword, isNull);
@@ -1238,7 +1238,7 @@
ClassMember member = parser.parseClassMember('C');
expect(member, isNotNull);
assertNoErrors();
- expect(member, new isInstanceOf<MethodDeclaration>());
+ expect(member, new TypeMatcher<MethodDeclaration>());
MethodDeclaration method = member;
expect(method.documentationComment, isNull);
expect(method.externalKeyword, isNull);
@@ -1257,7 +1257,7 @@
ClassMember member = parser.parseClassMember('C');
expect(member, isNotNull);
assertNoErrors();
- expect(member, new isInstanceOf<MethodDeclaration>());
+ expect(member, new TypeMatcher<MethodDeclaration>());
MethodDeclaration method = member;
expect(method.documentationComment, isNull);
expect(method.externalKeyword, isNull);
@@ -1276,7 +1276,7 @@
ClassMember member = parser.parseClassMember('C');
expect(member, isNotNull);
assertNoErrors();
- expect(member, new isInstanceOf<MethodDeclaration>());
+ expect(member, new TypeMatcher<MethodDeclaration>());
MethodDeclaration method = member;
expect(method.documentationComment, isNull);
expect(method.externalKeyword, isNull);
@@ -1296,7 +1296,7 @@
ClassMember member = parser.parseClassMember('C');
expect(member, isNotNull);
assertNoErrors();
- expect(member, new isInstanceOf<MethodDeclaration>());
+ expect(member, new TypeMatcher<MethodDeclaration>());
MethodDeclaration method = member;
expect(method.documentationComment, isNull);
expect(method.externalKeyword, isNull);
@@ -1315,7 +1315,7 @@
ClassMember member = parser.parseClassMember('C');
expect(member, isNotNull);
assertNoErrors();
- expect(member, new isInstanceOf<MethodDeclaration>());
+ expect(member, new TypeMatcher<MethodDeclaration>());
MethodDeclaration method = member;
expect(method.documentationComment, isNull);
expect(method.externalKeyword, isNull);
@@ -1334,7 +1334,7 @@
ClassMember member = parser.parseClassMember('C');
expect(member, isNotNull);
assertNoErrors();
- expect(member, new isInstanceOf<MethodDeclaration>());
+ expect(member, new TypeMatcher<MethodDeclaration>());
MethodDeclaration method = member;
expect(method.documentationComment, isNull);
expect(method.externalKeyword, isNull);
@@ -1353,7 +1353,7 @@
ClassMember member = parser.parseClassMember('C');
expect(member, isNotNull);
assertNoErrors();
- expect(member, new isInstanceOf<MethodDeclaration>());
+ expect(member, new TypeMatcher<MethodDeclaration>());
MethodDeclaration method = member;
expect(method.documentationComment, isNull);
expect(method.externalKeyword, isNull);
@@ -1378,7 +1378,7 @@
assertErrorsWithCodes(
[HintCode.GENERIC_METHOD_COMMENT, HintCode.GENERIC_METHOD_COMMENT]);
}
- expect(member, new isInstanceOf<MethodDeclaration>());
+ expect(member, new TypeMatcher<MethodDeclaration>());
MethodDeclaration method = member;
expect(method.documentationComment, isNull);
expect(method.externalKeyword, isNull);
@@ -1398,7 +1398,7 @@
ClassMember member = parser.parseClassMember('C');
expect(member, isNotNull);
assertNoErrors();
- expect(member, new isInstanceOf<MethodDeclaration>());
+ expect(member, new TypeMatcher<MethodDeclaration>());
MethodDeclaration method = member;
expect(method.documentationComment, isNull);
expect(method.externalKeyword, isNull);
@@ -1417,13 +1417,13 @@
ClassMember member = parser.parseClassMember('C');
expect(member, isNotNull);
assertNoErrors();
- expect(member, new isInstanceOf<MethodDeclaration>());
+ expect(member, new TypeMatcher<MethodDeclaration>());
MethodDeclaration method = member;
expect(method.documentationComment, isNull);
expect(method.externalKeyword, isNull);
expect(method.modifierKeyword, isNull);
expect(method.propertyKeyword, isNull);
- expect(method.returnType, new isInstanceOf<GenericFunctionType>());
+ expect(method.returnType, new TypeMatcher<GenericFunctionType>());
expect(method.name, isNotNull);
expect(method.operatorKeyword, isNotNull);
expect(method.typeParameters, isNull);
@@ -1431,7 +1431,7 @@
NodeList<FormalParameter> parameters = method.parameters.parameters;
expect(parameters, hasLength(1));
expect((parameters[0] as SimpleFormalParameter).type,
- new isInstanceOf<GenericFunctionType>());
+ new TypeMatcher<GenericFunctionType>());
expect(method.body, isNotNull);
}
@@ -1440,7 +1440,7 @@
ClassMember member = parser.parseClassMember('C');
expect(member, isNotNull);
assertNoErrors();
- expect(member, new isInstanceOf<MethodDeclaration>());
+ expect(member, new TypeMatcher<MethodDeclaration>());
MethodDeclaration method = member;
expect(method.documentationComment, isNull);
expect(method.externalKeyword, isNull);
@@ -1459,7 +1459,7 @@
ClassMember member = parser.parseClassMember('C');
expect(member, isNotNull);
assertNoErrors();
- expect(member, new isInstanceOf<MethodDeclaration>());
+ expect(member, new TypeMatcher<MethodDeclaration>());
MethodDeclaration method = member;
expect(method.documentationComment, isNull);
expect(method.externalKeyword, isNull);
@@ -1478,7 +1478,7 @@
ClassMember member = parser.parseClassMember('C');
expect(member, isNotNull);
assertNoErrors();
- expect(member, new isInstanceOf<MethodDeclaration>());
+ expect(member, new TypeMatcher<MethodDeclaration>());
MethodDeclaration method = member;
expect(method.documentationComment, isNull);
expect(method.externalKeyword, isNull);
@@ -1512,7 +1512,7 @@
expect(constructor.redirectedConstructor.type.name.name, 'prefix.B');
expect(constructor.redirectedConstructor.period.type, TokenType.PERIOD);
expect(constructor.redirectedConstructor.name.name, 'foo');
- expect(constructor.body, new isInstanceOf<EmptyFunctionBody>());
+ expect(constructor.body, new TypeMatcher<EmptyFunctionBody>());
}
void test_parseClassMember_redirectingFactory_expressionBody() {
@@ -1545,7 +1545,7 @@
ClassMember member = parser.parseClassMember('C');
expect(member, isNotNull);
assertNoErrors();
- expect(member, new isInstanceOf<ConstructorDeclaration>());
+ expect(member, new TypeMatcher<ConstructorDeclaration>());
ConstructorDeclaration constructor = member;
expect(constructor.externalKeyword, isNull);
expect(constructor.constKeyword, isNull);
@@ -1562,7 +1562,7 @@
expect(constructor.redirectedConstructor.type.name.name, 'B');
expect(constructor.redirectedConstructor.period, isNull);
expect(constructor.redirectedConstructor.name, isNull);
- expect(constructor.body, new isInstanceOf<EmptyFunctionBody>());
+ expect(constructor.body, new TypeMatcher<EmptyFunctionBody>());
}
void test_parseConstructor_assert() {
@@ -1570,12 +1570,12 @@
ClassMember member = parser.parseClassMember('C');
expect(member, isNotNull);
assertNoErrors();
- expect(member, new isInstanceOf<ConstructorDeclaration>());
+ expect(member, new TypeMatcher<ConstructorDeclaration>());
ConstructorDeclaration constructor = member as ConstructorDeclaration;
NodeList<ConstructorInitializer> initializers = constructor.initializers;
expect(initializers, hasLength(3));
ConstructorInitializer initializer = initializers[1];
- expect(initializer, new isInstanceOf<AssertInitializer>());
+ expect(initializer, new TypeMatcher<AssertInitializer>());
AssertInitializer assertInitializer = initializer;
expect(assertInitializer.condition, isNotNull);
expect(assertInitializer.message, isNull);
@@ -1609,7 +1609,7 @@
expect(constructor.separator, isNull);
expect(constructor.initializers, isEmpty);
expect(constructor.redirectedConstructor, isNull);
- expect(constructor.body, new isInstanceOf<ExpressionFunctionBody>());
+ expect(constructor.body, new TypeMatcher<ExpressionFunctionBody>());
}
void test_parseConstructor_initializers_field() {
@@ -1617,7 +1617,7 @@
ClassMember member = parser.parseClassMember('C');
expect(member, isNotNull);
assertNoErrors();
- expect(member, new isInstanceOf<ConstructorDeclaration>());
+ expect(member, new TypeMatcher<ConstructorDeclaration>());
ConstructorDeclaration constructor = member as ConstructorDeclaration;
NodeList<ConstructorInitializer> initializers = constructor.initializers;
expect(initializers, hasLength(2));
@@ -1657,7 +1657,7 @@
expect(constructor.separator, isNull);
expect(constructor.initializers, isEmpty);
expect(constructor.redirectedConstructor, isNull);
- expect(constructor.body, new isInstanceOf<EmptyFunctionBody>());
+ expect(constructor.body, new TypeMatcher<EmptyFunctionBody>());
}
void test_parseConstructor_unnamed() {
@@ -1677,7 +1677,7 @@
expect(constructor.separator, isNull);
expect(constructor.initializers, isEmpty);
expect(constructor.redirectedConstructor, isNull);
- expect(constructor.body, new isInstanceOf<EmptyFunctionBody>());
+ expect(constructor.body, new TypeMatcher<EmptyFunctionBody>());
}
void test_parseConstructor_with_pseudo_function_literal() {
@@ -1687,7 +1687,7 @@
ClassMember member = parser.parseClassMember('C');
expect(member, isNotNull);
assertNoErrors();
- expect(member, new isInstanceOf<ConstructorDeclaration>());
+ expect(member, new TypeMatcher<ConstructorDeclaration>());
ConstructorDeclaration constructor = member as ConstructorDeclaration;
NodeList<ConstructorInitializer> initializers = constructor.initializers;
expect(initializers, hasLength(1));
@@ -1892,18 +1892,17 @@
void test_logicalAndExpression_precedence_nullableType() {
enableNnbd = true;
BinaryExpression expression = parseExpression("x is C? && y is D");
- expect(expression.leftOperand, new isInstanceOf<IsExpression>());
- expect(expression.rightOperand, new isInstanceOf<IsExpression>());
+ expect(expression.leftOperand, new TypeMatcher<IsExpression>());
+ expect(expression.rightOperand, new TypeMatcher<IsExpression>());
}
void test_logicalOrExpression_precedence_nullableType() {
enableNnbd = true;
BinaryExpression expression = parseExpression("a is X? || (b ? c : d)");
- expect(expression.leftOperand, new isInstanceOf<IsExpression>());
- expect(
- expression.rightOperand, new isInstanceOf<ParenthesizedExpression>());
+ expect(expression.leftOperand, new TypeMatcher<IsExpression>());
+ expect(expression.rightOperand, new TypeMatcher<ParenthesizedExpression>());
expect((expression.rightOperand as ParenthesizedExpression).expression,
- new isInstanceOf<ConditionalExpression>());
+ new TypeMatcher<ConditionalExpression>());
}
}
@@ -2146,27 +2145,27 @@
void test_conditionalExpression_precedence_nullableType_as() {
Expression expression = parseExpression('x as String ? (x + y) : z');
expect(expression, isNotNull);
- expect(expression, new isInstanceOf<ConditionalExpression>());
+ expect(expression, new TypeMatcher<ConditionalExpression>());
ConditionalExpression conditional = expression;
Expression condition = conditional.condition;
- expect(condition, new isInstanceOf<AsExpression>());
+ expect(condition, new TypeMatcher<AsExpression>());
Expression thenExpression = conditional.thenExpression;
- expect(thenExpression, new isInstanceOf<ParenthesizedExpression>());
+ expect(thenExpression, new TypeMatcher<ParenthesizedExpression>());
Expression elseExpression = conditional.elseExpression;
- expect(elseExpression, new isInstanceOf<SimpleIdentifier>());
+ expect(elseExpression, new TypeMatcher<SimpleIdentifier>());
}
void test_conditionalExpression_precedence_nullableType_is() {
Expression expression = parseExpression('x is String ? (x + y) : z');
expect(expression, isNotNull);
- expect(expression, new isInstanceOf<ConditionalExpression>());
+ expect(expression, new TypeMatcher<ConditionalExpression>());
ConditionalExpression conditional = expression;
Expression condition = conditional.condition;
- expect(condition, new isInstanceOf<IsExpression>());
+ expect(condition, new TypeMatcher<IsExpression>());
Expression thenExpression = conditional.thenExpression;
- expect(thenExpression, new isInstanceOf<ParenthesizedExpression>());
+ expect(thenExpression, new TypeMatcher<ParenthesizedExpression>());
Expression elseExpression = conditional.elseExpression;
- expect(elseExpression, new isInstanceOf<SimpleIdentifier>());
+ expect(elseExpression, new TypeMatcher<SimpleIdentifier>());
}
void test_constructor_initializer_withParenthesizedExpression() {
@@ -2226,34 +2225,34 @@
void test_logicalAndExpression() {
BinaryExpression expression = parseExpression("x && y && z");
- expect(expression.leftOperand, new isInstanceOf<BinaryExpression>());
+ expect(expression.leftOperand, new TypeMatcher<BinaryExpression>());
}
void test_logicalAndExpression_precedence_bitwiseOr_left() {
BinaryExpression expression = parseExpression("x | y < z");
- expect(expression.leftOperand, new isInstanceOf<BinaryExpression>());
+ expect(expression.leftOperand, new TypeMatcher<BinaryExpression>());
}
void test_logicalAndExpression_precedence_bitwiseOr_right() {
BinaryExpression expression = parseExpression("x < y | z");
- expect(expression.rightOperand, new isInstanceOf<BinaryExpression>());
+ expect(expression.rightOperand, new TypeMatcher<BinaryExpression>());
}
void test_logicalAndExpressionStatement() {
// Assert that `<` and `>` are not interpreted as type arguments.
ExpressionStatement statement = parseStatement("C<T && T>U;");
BinaryExpression expression = statement.expression;
- expect(expression.leftOperand, new isInstanceOf<BinaryExpression>());
+ expect(expression.leftOperand, new TypeMatcher<BinaryExpression>());
}
void test_logicalOrExpression() {
BinaryExpression expression = parseExpression("x || y || z");
- expect(expression.leftOperand, new isInstanceOf<BinaryExpression>());
+ expect(expression.leftOperand, new TypeMatcher<BinaryExpression>());
}
void test_logicalOrExpression_precedence_logicalAnd_left() {
BinaryExpression expression = parseExpression("x && y || z");
- expect(expression.leftOperand, new isInstanceOf<BinaryExpression>());
+ expect(expression.leftOperand, new TypeMatcher<BinaryExpression>());
}
void test_logicalOrExpression_precedence_logicalAnd_right() {
@@ -4378,7 +4377,7 @@
HintCode.GENERIC_METHOD_COMMENT
]);
}
- expect(member, new isInstanceOf<MethodDeclaration>());
+ expect(member, new TypeMatcher<MethodDeclaration>());
MethodDeclaration method = member;
expect(method.typeParameters.toString(), '<E, hello>',
reason: 'parser recovers what it can');
@@ -4400,7 +4399,7 @@
expectedError(ParserErrorCode.EXPECTED_TOKEN, 0, 0), // close paren
expectedError(ParserErrorCode.MISSING_FUNCTION_BODY, 0, 0)
]);
- expect(member, new isInstanceOf<MethodDeclaration>());
+ expect(member, new TypeMatcher<MethodDeclaration>());
MethodDeclaration method = member;
expect(
method.parameters.toString(), usingFastaParser ? '(E)' : '(E, extends)',
@@ -4440,7 +4439,7 @@
HintCode.GENERIC_METHOD_COMMENT
]);
}
- expect(member, new isInstanceOf<MethodDeclaration>());
+ expect(member, new TypeMatcher<MethodDeclaration>());
MethodDeclaration method = member;
expect(method.parameters.toString(), '(E extends, extends)',
reason: 'parser recovers what it can');
@@ -4463,7 +4462,7 @@
expectedError(ParserErrorCode.EXPECTED_TOKEN, 0, 0) /*)*/,
expectedError(ParserErrorCode.MISSING_FUNCTION_BODY, 0, 0)
]);
- expect(member, new isInstanceOf<MethodDeclaration>());
+ expect(member, new TypeMatcher<MethodDeclaration>());
MethodDeclaration method = member;
expect(method.typeParameters.toString(), '<E, hello>',
reason: 'parser recovers what it can');
@@ -4497,7 +4496,7 @@
BlockFunctionBody blockBody = declaration.functionExpression.body;
ExpressionStatement statement = (blockBody).block.statements.first;
Expression expression = (statement).expression;
- expect(expression, new isInstanceOf<SuperExpression>());
+ expect(expression, new TypeMatcher<SuperExpression>());
SuperExpression superExpression = expression;
expect(superExpression.superKeyword, isNotNull);
}
@@ -4770,7 +4769,7 @@
expectedError(ParserErrorCode.MISSING_METHOD_PARAMETERS,
usingFastaParser ? 5 : 7, 1)
]);
- expect(member, new isInstanceOf<MethodDeclaration>());
+ expect(member, new TypeMatcher<MethodDeclaration>());
MethodDeclaration method = member;
expect(method.parameters, hasLength(0));
}
@@ -5035,14 +5034,14 @@
expression = parser.parsePrimaryExpression();
listener.assertErrors(
[expectedError(ParserErrorCode.NAMED_FUNCTION_EXPRESSION, 0, 1)]);
- expect(expression, new isInstanceOf<FunctionExpression>());
+ expect(expression, new TypeMatcher<FunctionExpression>());
} else {
expression = parsePrimaryExpression('f() {}');
expectNotNullIfNoErrors(expression);
// Should generate an error.
//listener.assertErrors(
// [expectedError(ParserErrorCode.NAMED_FUNCTION_EXPRESSION, 0, 1)]);
- //expect(expression, new isInstanceOf<FunctionExpression>());
+ //expect(expression, new TypeMatcher<FunctionExpression>());
}
}
@@ -5476,7 +5475,7 @@
CompilationUnitMember member = parseFullCompilationUnitMember();
expectNotNullIfNoErrors(member);
assertNoErrors();
- expect(member, new isInstanceOf<FunctionDeclaration>());
+ expect(member, new TypeMatcher<FunctionDeclaration>());
FunctionDeclaration function = member;
expect(function.functionExpression.parameters, isNull);
}
@@ -5991,7 +5990,7 @@
var asExpression = expression as AsExpression;
expect(asExpression.expression, isNotNull);
expect(asExpression.asOperator, isNotNull);
- expect(asExpression.type, new isInstanceOf<TypeName>());
+ expect(asExpression.type, new TypeMatcher<TypeName>());
}
void test_parseRelationalExpression_is_nullable() {
@@ -6037,7 +6036,7 @@
expect(expression, isNotNull);
assertNoErrors();
var binaryExpression = expression as BinaryExpression;
- expect(binaryExpression.leftOperand, new isInstanceOf<SuperExpression>());
+ expect(binaryExpression.leftOperand, new TypeMatcher<SuperExpression>());
expect(binaryExpression.operator, isNotNull);
expect(binaryExpression.operator.type, TokenType.PLUS);
expect(binaryExpression.rightOperand, isNotNull);
@@ -6235,7 +6234,7 @@
expect(expression, isNotNull);
assertNoErrors();
var indexExpression = expression as IndexExpression;
- expect(indexExpression.target, new isInstanceOf<SuperExpression>());
+ expect(indexExpression.target, new TypeMatcher<SuperExpression>());
expect(indexExpression.leftBracket, isNotNull);
expect(indexExpression.index, isNotNull);
expect(indexExpression.rightBracket, isNotNull);
@@ -6301,7 +6300,7 @@
expect(expression, isNotNull);
assertNoErrors();
var binaryExpression = expression as BinaryExpression;
- expect(binaryExpression.leftOperand, new isInstanceOf<SuperExpression>());
+ expect(binaryExpression.leftOperand, new TypeMatcher<SuperExpression>());
expect(binaryExpression.operator, isNotNull);
expect(binaryExpression.operator.type, TokenType.AMPERSAND);
expect(binaryExpression.rightOperand, isNotNull);
@@ -6323,7 +6322,7 @@
expect(expression, isNotNull);
assertNoErrors();
var binaryExpression = expression as BinaryExpression;
- expect(binaryExpression.leftOperand, new isInstanceOf<SuperExpression>());
+ expect(binaryExpression.leftOperand, new TypeMatcher<SuperExpression>());
expect(binaryExpression.operator, isNotNull);
expect(binaryExpression.operator.type, TokenType.BAR);
expect(binaryExpression.rightOperand, isNotNull);
@@ -6345,7 +6344,7 @@
expect(expression, isNotNull);
assertNoErrors();
var binaryExpression = expression as BinaryExpression;
- expect(binaryExpression.leftOperand, new isInstanceOf<SuperExpression>());
+ expect(binaryExpression.leftOperand, new TypeMatcher<SuperExpression>());
expect(binaryExpression.operator, isNotNull);
expect(binaryExpression.operator.type, TokenType.CARET);
expect(binaryExpression.rightOperand, isNotNull);
@@ -6367,7 +6366,7 @@
expect(expression, isNotNull);
assertNoErrors();
var section = expression as FunctionExpressionInvocation;
- expect(section.function, new isInstanceOf<IndexExpression>());
+ expect(section.function, new TypeMatcher<IndexExpression>());
expect(section.typeArguments, isNull);
expect(section.argumentList, isNotNull);
}
@@ -6382,7 +6381,7 @@
assertErrorsWithCodes([HintCode.GENERIC_METHOD_COMMENT]);
}
var section = expression as FunctionExpressionInvocation;
- expect(section.function, new isInstanceOf<IndexExpression>());
+ expect(section.function, new TypeMatcher<IndexExpression>());
expect(section.typeArguments, isNotNull);
expect(section.argumentList, isNotNull);
}
@@ -6392,7 +6391,7 @@
expect(expression, isNotNull);
assertNoErrors();
var section = expression as FunctionExpressionInvocation;
- expect(section.function, new isInstanceOf<IndexExpression>());
+ expect(section.function, new TypeMatcher<IndexExpression>());
expect(section.typeArguments, isNotNull);
expect(section.argumentList, isNotNull);
}
@@ -6402,7 +6401,7 @@
expect(expression, isNotNull);
assertNoErrors();
var section = expression as MethodInvocation;
- expect(section.target, new isInstanceOf<MethodInvocation>());
+ expect(section.target, new TypeMatcher<MethodInvocation>());
expect(section.operator, isNotNull);
expect(section.methodName, isNotNull);
expect(section.typeArguments, isNull);
@@ -6421,7 +6420,7 @@
[HintCode.GENERIC_METHOD_COMMENT, HintCode.GENERIC_METHOD_COMMENT]);
}
var section = expression as MethodInvocation;
- expect(section.target, new isInstanceOf<MethodInvocation>());
+ expect(section.target, new TypeMatcher<MethodInvocation>());
expect(section.operator, isNotNull);
expect(section.methodName, isNotNull);
expect(section.typeArguments, isNotNull);
@@ -6434,7 +6433,7 @@
expect(expression, isNotNull);
assertNoErrors();
var section = expression as MethodInvocation;
- expect(section.target, new isInstanceOf<MethodInvocation>());
+ expect(section.target, new TypeMatcher<MethodInvocation>());
expect(section.operator, isNotNull);
expect(section.methodName, isNotNull);
expect(section.typeArguments, isNotNull);
@@ -6559,7 +6558,7 @@
expect(expression, isNotNull);
assertNoErrors();
var section = expression as FunctionExpressionInvocation;
- expect(section.function, new isInstanceOf<MethodInvocation>());
+ expect(section.function, new TypeMatcher<MethodInvocation>());
expect(section.typeArguments, isNull);
expect(section.argumentList, isNotNull);
expect(section.argumentList.arguments, hasLength(1));
@@ -6576,7 +6575,7 @@
[HintCode.GENERIC_METHOD_COMMENT, HintCode.GENERIC_METHOD_COMMENT]);
}
var section = expression as FunctionExpressionInvocation;
- expect(section.function, new isInstanceOf<MethodInvocation>());
+ expect(section.function, new TypeMatcher<MethodInvocation>());
expect(section.typeArguments, isNotNull);
expect(section.argumentList, isNotNull);
expect(section.argumentList.arguments, hasLength(1));
@@ -6587,7 +6586,7 @@
expect(expression, isNotNull);
assertNoErrors();
var section = expression as FunctionExpressionInvocation;
- expect(section.function, new isInstanceOf<MethodInvocation>());
+ expect(section.function, new TypeMatcher<MethodInvocation>());
expect(section.typeArguments, isNotNull);
expect(section.argumentList, isNotNull);
expect(section.argumentList.arguments, hasLength(1));
@@ -6598,7 +6597,7 @@
expect(expression, isNotNull);
assertNoErrors();
var section = expression as FunctionExpressionInvocation;
- expect(section.function, new isInstanceOf<MethodInvocation>());
+ expect(section.function, new TypeMatcher<MethodInvocation>());
expect(section.typeArguments, isNull);
expect(section.argumentList, isNotNull);
expect(section.argumentList.arguments, hasLength(1));
@@ -6620,7 +6619,7 @@
]);
}
var section = expression as FunctionExpressionInvocation;
- expect(section.function, new isInstanceOf<MethodInvocation>());
+ expect(section.function, new TypeMatcher<MethodInvocation>());
expect(section.typeArguments, isNotNull);
expect(section.argumentList, isNotNull);
expect(section.argumentList.arguments, hasLength(1));
@@ -6632,7 +6631,7 @@
expect(expression, isNotNull);
assertNoErrors();
var section = expression as FunctionExpressionInvocation;
- expect(section.function, new isInstanceOf<MethodInvocation>());
+ expect(section.function, new TypeMatcher<MethodInvocation>());
expect(section.typeArguments, isNotNull);
expect(section.argumentList, isNotNull);
expect(section.argumentList.arguments, hasLength(1));
@@ -6688,7 +6687,7 @@
Expression expression = parseConstExpression('const A()');
expect(expression, isNotNull);
assertNoErrors();
- expect(expression, new isInstanceOf<InstanceCreationExpression>());
+ expect(expression, new TypeMatcher<InstanceCreationExpression>());
InstanceCreationExpression instanceCreation = expression;
expect(instanceCreation.keyword, isNotNull);
ConstructorName name = instanceCreation.constructorName;
@@ -6803,7 +6802,7 @@
BinaryExpression expression = parseEqualityExpression('super == y');
expect(expression, isNotNull);
assertNoErrors();
- expect(expression.leftOperand, new isInstanceOf<SuperExpression>());
+ expect(expression.leftOperand, new TypeMatcher<SuperExpression>());
expect(expression.operator, isNotNull);
expect(expression.operator.type, TokenType.EQ_EQ);
expect(expression.rightOperand, isNotNull);
@@ -6890,7 +6889,7 @@
void test_parseExpression_invokeFunctionExpression() {
Expression expression = parseExpression('(a) {return a + a;} (3)');
var invocation = expression as FunctionExpressionInvocation;
- expect(invocation.function, new isInstanceOf<FunctionExpression>());
+ expect(invocation.function, new TypeMatcher<FunctionExpression>());
FunctionExpression functionExpression =
invocation.function as FunctionExpression;
expect(functionExpression.parameters, isNotNull);
@@ -6943,7 +6942,7 @@
Expression expression = parseExpression('super.b.c<D>()');
MethodInvocation invocation = expression as MethodInvocation;
Expression target = invocation.target;
- expect(target, new isInstanceOf<PropertyAccess>());
+ expect(target, new TypeMatcher<PropertyAccess>());
expect(invocation.methodName, isNotNull);
expect(invocation.methodName.name, 'c');
expect(invocation.typeArguments, isNotNull);
@@ -7548,7 +7547,7 @@
expect(expression, isNotNull);
assertNoErrors();
var binaryExpression = expression as BinaryExpression;
- expect(binaryExpression.leftOperand, new isInstanceOf<SuperExpression>());
+ expect(binaryExpression.leftOperand, new TypeMatcher<SuperExpression>());
expect(binaryExpression.operator, isNotNull);
expect(binaryExpression.operator.type, TokenType.STAR);
expect(binaryExpression.rightOperand, isNotNull);
@@ -7875,7 +7874,7 @@
Expression expression = parsePrimaryExpression('null');
expect(expression, isNotNull);
assertNoErrors();
- expect(expression, new isInstanceOf<NullLiteral>());
+ expect(expression, new TypeMatcher<NullLiteral>());
NullLiteral literal = expression;
expect(literal.literal, isNotNull);
}
@@ -7973,7 +7972,7 @@
var asExpression = expression as AsExpression;
expect(asExpression.expression, isNotNull);
expect(asExpression.asOperator, isNotNull);
- expect(asExpression.type, new isInstanceOf<GenericFunctionType>());
+ expect(asExpression.type, new TypeMatcher<GenericFunctionType>());
}
void test_parseRelationalExpression_as_functionType_returnType() {
@@ -7984,7 +7983,7 @@
var asExpression = expression as AsExpression;
expect(asExpression.expression, isNotNull);
expect(asExpression.asOperator, isNotNull);
- expect(asExpression.type, new isInstanceOf<GenericFunctionType>());
+ expect(asExpression.type, new TypeMatcher<GenericFunctionType>());
}
void test_parseRelationalExpression_as_generic() {
@@ -7994,7 +7993,7 @@
var asExpression = expression as AsExpression;
expect(asExpression.expression, isNotNull);
expect(asExpression.asOperator, isNotNull);
- expect(asExpression.type, new isInstanceOf<TypeName>());
+ expect(asExpression.type, new TypeMatcher<TypeName>());
}
void test_parseRelationalExpression_as_simple() {
@@ -8004,7 +8003,20 @@
var asExpression = expression as AsExpression;
expect(asExpression.expression, isNotNull);
expect(asExpression.asOperator, isNotNull);
- expect(asExpression.type, new isInstanceOf<TypeName>());
+ expect(asExpression.type, new TypeMatcher<TypeName>());
+ }
+
+ void test_parseRelationalExpression_as_chained() {
+ AsExpression asExpression = parseExpression('x as Y as Z',
+ errors: usingFastaParser
+ ? [expectedError(ParserErrorCode.UNEXPECTED_TOKEN, 7, 2)]
+ : []);
+ expect(asExpression, isNotNull);
+ SimpleIdentifier identifier = asExpression.expression;
+ expect(identifier.name, 'x');
+ expect(asExpression.asOperator, isNotNull);
+ TypeName typeName = asExpression.type;
+ expect(typeName.name.name, 'Y');
}
void test_parseRelationalExpression_as_simple_function() {
@@ -8014,7 +8026,7 @@
var asExpression = expression as AsExpression;
expect(asExpression.expression, isNotNull);
expect(asExpression.asOperator, isNotNull);
- expect(asExpression.type, new isInstanceOf<TypeName>());
+ expect(asExpression.type, new TypeMatcher<TypeName>());
}
void test_parseRelationalExpression_is() {
@@ -8028,6 +8040,19 @@
expect(isExpression.type, isNotNull);
}
+ void test_parseRelationalExpression_is_chained() {
+ IsExpression isExpression = parseExpression('x is Y is! Z',
+ errors: usingFastaParser
+ ? [expectedError(ParserErrorCode.UNEXPECTED_TOKEN, 7, 2)]
+ : []);
+ expect(isExpression, isNotNull);
+ SimpleIdentifier identifier = isExpression.expression;
+ expect(identifier.name, 'x');
+ expect(isExpression.isOperator, isNotNull);
+ TypeName typeName = isExpression.type;
+ expect(typeName.name.name, 'Y');
+ }
+
void test_parseRelationalExpression_isNot() {
Expression expression = parseRelationalExpression('x is! y');
expect(expression, isNotNull);
@@ -8129,16 +8154,16 @@
assertNoErrors();
var interpolation = expression as StringInterpolation;
expect(interpolation.elements, hasLength(3));
- expect(interpolation.elements[0], new isInstanceOf<InterpolationString>());
+ expect(interpolation.elements[0], new TypeMatcher<InterpolationString>());
InterpolationString element0 = interpolation.elements[0];
expect(element0.value, 'x');
expect(
- interpolation.elements[1], new isInstanceOf<InterpolationExpression>());
+ interpolation.elements[1], new TypeMatcher<InterpolationExpression>());
InterpolationExpression element1 = interpolation.elements[1];
expect(element1.leftBracket.lexeme, '\$');
- expect(element1.expression, new isInstanceOf<SimpleIdentifier>());
+ expect(element1.expression, new TypeMatcher<SimpleIdentifier>());
expect(element1.rightBracket, isNull);
- expect(interpolation.elements[2], new isInstanceOf<InterpolationString>());
+ expect(interpolation.elements[2], new TypeMatcher<InterpolationString>());
InterpolationString element2 = interpolation.elements[2];
expect(element2.value, '');
}
@@ -8147,7 +8172,7 @@
Expression expression = parseStringLiteral("'a \${b} c \$this d'");
expect(expression, isNotNull);
assertNoErrors();
- expect(expression, new isInstanceOf<StringInterpolation>());
+ expect(expression, new TypeMatcher<StringInterpolation>());
StringInterpolation literal = expression;
NodeList<InterpolationElement> elements = literal.elements;
expect(elements, hasLength(5));
@@ -8177,14 +8202,14 @@
assertNoErrors();
var interpolation = expression as StringInterpolation;
expect(interpolation.elements, hasLength(3));
- expect(interpolation.elements[0], new isInstanceOf<InterpolationString>());
+ expect(interpolation.elements[0], new TypeMatcher<InterpolationString>());
InterpolationString element0 = interpolation.elements[0];
expect(element0.value, 'x');
expect(
- interpolation.elements[1], new isInstanceOf<InterpolationExpression>());
+ interpolation.elements[1], new TypeMatcher<InterpolationExpression>());
InterpolationExpression element1 = interpolation.elements[1];
- expect(element1.expression, new isInstanceOf<SimpleIdentifier>());
- expect(interpolation.elements[2], new isInstanceOf<InterpolationString>());
+ expect(element1.expression, new TypeMatcher<SimpleIdentifier>());
+ expect(interpolation.elements[2], new TypeMatcher<InterpolationString>());
InterpolationString element2 = interpolation.elements[2];
expect(element2.value, '');
}
@@ -8267,14 +8292,14 @@
assertNoErrors();
var interpolation = expression as StringInterpolation;
expect(interpolation.elements, hasLength(3));
- expect(interpolation.elements[0], new isInstanceOf<InterpolationString>());
+ expect(interpolation.elements[0], new TypeMatcher<InterpolationString>());
InterpolationString element0 = interpolation.elements[0];
expect(element0.value, '');
expect(
- interpolation.elements[1], new isInstanceOf<InterpolationExpression>());
+ interpolation.elements[1], new TypeMatcher<InterpolationExpression>());
InterpolationExpression element1 = interpolation.elements[1];
- expect(element1.expression, new isInstanceOf<SimpleIdentifier>());
- expect(interpolation.elements[2], new isInstanceOf<InterpolationString>());
+ expect(element1.expression, new TypeMatcher<SimpleIdentifier>());
+ expect(interpolation.elements[2], new TypeMatcher<InterpolationString>());
InterpolationString element2 = interpolation.elements[2];
expect(element2.value, "'y");
}
@@ -8285,14 +8310,14 @@
assertNoErrors();
var interpolation = expression as StringInterpolation;
expect(interpolation.elements, hasLength(3));
- expect(interpolation.elements[0], new isInstanceOf<InterpolationString>());
+ expect(interpolation.elements[0], new TypeMatcher<InterpolationString>());
InterpolationString element0 = interpolation.elements[0];
expect(element0.value, '');
expect(
- interpolation.elements[1], new isInstanceOf<InterpolationExpression>());
+ interpolation.elements[1], new TypeMatcher<InterpolationExpression>());
InterpolationExpression element1 = interpolation.elements[1];
- expect(element1.expression, new isInstanceOf<SimpleIdentifier>());
- expect(interpolation.elements[2], new isInstanceOf<InterpolationString>());
+ expect(element1.expression, new TypeMatcher<SimpleIdentifier>());
+ expect(interpolation.elements[2], new TypeMatcher<InterpolationString>());
InterpolationString element2 = interpolation.elements[2];
expect(element2.value, 'y');
}
@@ -8330,14 +8355,14 @@
assertNoErrors();
var interpolation = expression as StringInterpolation;
expect(interpolation.elements, hasLength(3));
- expect(interpolation.elements[0], new isInstanceOf<InterpolationString>());
+ expect(interpolation.elements[0], new TypeMatcher<InterpolationString>());
InterpolationString element0 = interpolation.elements[0];
expect(element0.value, '');
expect(
- interpolation.elements[1], new isInstanceOf<InterpolationExpression>());
+ interpolation.elements[1], new TypeMatcher<InterpolationExpression>());
InterpolationExpression element1 = interpolation.elements[1];
- expect(element1.expression, new isInstanceOf<SimpleIdentifier>());
- expect(interpolation.elements[2], new isInstanceOf<InterpolationString>());
+ expect(element1.expression, new TypeMatcher<SimpleIdentifier>());
+ expect(interpolation.elements[2], new TypeMatcher<InterpolationString>());
InterpolationString element2 = interpolation.elements[2];
expect(element2.value, '"');
}
@@ -8357,14 +8382,14 @@
assertNoErrors();
var interpolation = expression as StringInterpolation;
expect(interpolation.elements, hasLength(3));
- expect(interpolation.elements[0], new isInstanceOf<InterpolationString>());
+ expect(interpolation.elements[0], new TypeMatcher<InterpolationString>());
InterpolationString element0 = interpolation.elements[0];
expect(element0.value, '');
expect(
- interpolation.elements[1], new isInstanceOf<InterpolationExpression>());
+ interpolation.elements[1], new TypeMatcher<InterpolationExpression>());
InterpolationExpression element1 = interpolation.elements[1];
- expect(element1.expression, new isInstanceOf<SimpleIdentifier>());
- expect(interpolation.elements[2], new isInstanceOf<InterpolationString>());
+ expect(element1.expression, new TypeMatcher<SimpleIdentifier>());
+ expect(interpolation.elements[2], new TypeMatcher<InterpolationString>());
InterpolationString element2 = interpolation.elements[2];
expect(element2.value, 'y');
}
@@ -8613,7 +8638,7 @@
NormalFormalParameter parameter = parseNormalFormalParameter('a()?');
expect(parameter, isNotNull);
assertNoErrors();
- expect(parameter, new isInstanceOf<FunctionTypedFormalParameter>());
+ expect(parameter, new TypeMatcher<FunctionTypedFormalParameter>());
FunctionTypedFormalParameter functionParameter = parameter;
expect(functionParameter.returnType, isNull);
expect(functionParameter.identifier, isNotNull);
@@ -8628,7 +8653,7 @@
NormalFormalParameter parameter = parseNormalFormalParameter('a<E>()?');
expect(parameter, isNotNull);
assertNoErrors();
- expect(parameter, new isInstanceOf<FunctionTypedFormalParameter>());
+ expect(parameter, new TypeMatcher<FunctionTypedFormalParameter>());
FunctionTypedFormalParameter functionParameter = parameter;
expect(functionParameter.returnType, isNull);
expect(functionParameter.identifier, isNotNull);
@@ -8642,7 +8667,7 @@
NormalFormalParameter parameter = parseNormalFormalParameter('A a()?');
expect(parameter, isNotNull);
assertNoErrors();
- expect(parameter, new isInstanceOf<FunctionTypedFormalParameter>());
+ expect(parameter, new TypeMatcher<FunctionTypedFormalParameter>());
FunctionTypedFormalParameter functionParameter = parameter;
expect(functionParameter.returnType, isNotNull);
expect(functionParameter.identifier, isNotNull);
@@ -8656,7 +8681,7 @@
NormalFormalParameter parameter = parseNormalFormalParameter('A a<E>()?');
expect(parameter, isNotNull);
assertNoErrors();
- expect(parameter, new isInstanceOf<FunctionTypedFormalParameter>());
+ expect(parameter, new TypeMatcher<FunctionTypedFormalParameter>());
FunctionTypedFormalParameter functionParameter = parameter;
expect(functionParameter.returnType, isNotNull);
expect(functionParameter.identifier, isNotNull);
@@ -8670,7 +8695,7 @@
NormalFormalParameter parameter = parseNormalFormalParameter('void a()?');
expect(parameter, isNotNull);
assertNoErrors();
- expect(parameter, new isInstanceOf<FunctionTypedFormalParameter>());
+ expect(parameter, new TypeMatcher<FunctionTypedFormalParameter>());
FunctionTypedFormalParameter functionParameter = parameter;
expect(functionParameter.returnType, isNotNull);
expect(functionParameter.identifier, isNotNull);
@@ -8685,7 +8710,7 @@
parseNormalFormalParameter('void a<E>()?');
expect(parameter, isNotNull);
assertNoErrors();
- expect(parameter, new isInstanceOf<FunctionTypedFormalParameter>());
+ expect(parameter, new TypeMatcher<FunctionTypedFormalParameter>());
FunctionTypedFormalParameter functionParameter = parameter;
expect(functionParameter.returnType, isNotNull);
expect(functionParameter.identifier, isNotNull);
@@ -8707,7 +8732,7 @@
parseFormalParameter('covariant final a : null', kind);
expect(parameter, isNotNull);
assertNoErrors();
- expect(parameter, new isInstanceOf<DefaultFormalParameter>());
+ expect(parameter, new TypeMatcher<DefaultFormalParameter>());
DefaultFormalParameter defaultParameter = parameter;
SimpleFormalParameter simpleParameter =
defaultParameter.parameter as SimpleFormalParameter;
@@ -8726,7 +8751,7 @@
FormalParameter parameter = parseFormalParameter('covariant final a', kind);
expect(parameter, isNotNull);
assertNoErrors();
- expect(parameter, new isInstanceOf<SimpleFormalParameter>());
+ expect(parameter, new TypeMatcher<SimpleFormalParameter>());
SimpleFormalParameter simpleParameter = parameter;
expect(simpleParameter.covariantKeyword, isNotNull);
expect(simpleParameter.identifier, isNotNull);
@@ -8741,7 +8766,7 @@
parseFormalParameter('covariant final a = null', kind);
expect(parameter, isNotNull);
assertNoErrors();
- expect(parameter, new isInstanceOf<DefaultFormalParameter>());
+ expect(parameter, new TypeMatcher<DefaultFormalParameter>());
DefaultFormalParameter defaultParameter = parameter;
SimpleFormalParameter simpleParameter =
defaultParameter.parameter as SimpleFormalParameter;
@@ -8761,7 +8786,7 @@
parseFormalParameter('covariant final A a : null', kind);
expect(parameter, isNotNull);
assertNoErrors();
- expect(parameter, new isInstanceOf<DefaultFormalParameter>());
+ expect(parameter, new TypeMatcher<DefaultFormalParameter>());
DefaultFormalParameter defaultParameter = parameter;
SimpleFormalParameter simpleParameter =
defaultParameter.parameter as SimpleFormalParameter;
@@ -8781,7 +8806,7 @@
parseFormalParameter('covariant final A a', kind);
expect(parameter, isNotNull);
assertNoErrors();
- expect(parameter, new isInstanceOf<SimpleFormalParameter>());
+ expect(parameter, new TypeMatcher<SimpleFormalParameter>());
SimpleFormalParameter simpleParameter = parameter;
expect(simpleParameter.covariantKeyword, isNotNull);
expect(simpleParameter.identifier, isNotNull);
@@ -8796,7 +8821,7 @@
parseFormalParameter('covariant final A a = null', kind);
expect(parameter, isNotNull);
assertNoErrors();
- expect(parameter, new isInstanceOf<DefaultFormalParameter>());
+ expect(parameter, new TypeMatcher<DefaultFormalParameter>());
DefaultFormalParameter defaultParameter = parameter;
SimpleFormalParameter simpleParameter =
defaultParameter.parameter as SimpleFormalParameter;
@@ -8816,12 +8841,12 @@
parseFormalParameter('covariant String Function(int) a', kind);
expect(parameter, isNotNull);
assertNoErrors();
- expect(parameter, new isInstanceOf<SimpleFormalParameter>());
+ expect(parameter, new TypeMatcher<SimpleFormalParameter>());
SimpleFormalParameter simpleParameter = parameter;
expect(simpleParameter.covariantKeyword, isNotNull);
expect(simpleParameter.identifier, isNotNull);
expect(simpleParameter.keyword, isNull);
- expect(simpleParameter.type, new isInstanceOf<GenericFunctionType>());
+ expect(simpleParameter.type, new TypeMatcher<GenericFunctionType>());
expect(simpleParameter.isRequired, isTrue);
}
@@ -8831,7 +8856,7 @@
parseFormalParameter('covariant A a : null', kind);
expect(parameter, isNotNull);
assertNoErrors();
- expect(parameter, new isInstanceOf<DefaultFormalParameter>());
+ expect(parameter, new TypeMatcher<DefaultFormalParameter>());
DefaultFormalParameter defaultParameter = parameter;
SimpleFormalParameter simpleParameter =
defaultParameter.parameter as SimpleFormalParameter;
@@ -8851,7 +8876,7 @@
parseFormalParameter('covariant A<B<C>> a', kind);
expect(parameter, isNotNull);
assertNoErrors();
- expect(parameter, new isInstanceOf<SimpleFormalParameter>());
+ expect(parameter, new TypeMatcher<SimpleFormalParameter>());
SimpleFormalParameter simpleParameter = parameter;
expect(simpleParameter.covariantKeyword, isNotNull);
expect(simpleParameter.identifier, isNotNull);
@@ -8866,7 +8891,7 @@
parseFormalParameter('covariant A a = null', kind);
expect(parameter, isNotNull);
assertNoErrors();
- expect(parameter, new isInstanceOf<DefaultFormalParameter>());
+ expect(parameter, new TypeMatcher<DefaultFormalParameter>());
DefaultFormalParameter defaultParameter = parameter;
SimpleFormalParameter simpleParameter =
defaultParameter.parameter as SimpleFormalParameter;
@@ -8886,7 +8911,7 @@
parseFormalParameter('covariant var a : null', kind);
expect(parameter, isNotNull);
assertNoErrors();
- expect(parameter, new isInstanceOf<DefaultFormalParameter>());
+ expect(parameter, new TypeMatcher<DefaultFormalParameter>());
DefaultFormalParameter defaultParameter = parameter;
SimpleFormalParameter simpleParameter =
defaultParameter.parameter as SimpleFormalParameter;
@@ -8905,7 +8930,7 @@
FormalParameter parameter = parseFormalParameter('covariant var a', kind);
expect(parameter, isNotNull);
assertNoErrors();
- expect(parameter, new isInstanceOf<SimpleFormalParameter>());
+ expect(parameter, new TypeMatcher<SimpleFormalParameter>());
SimpleFormalParameter simpleParameter = parameter;
expect(simpleParameter.covariantKeyword, isNotNull);
expect(simpleParameter.identifier, isNotNull);
@@ -8920,7 +8945,7 @@
parseFormalParameter('covariant var a = null', kind);
expect(parameter, isNotNull);
assertNoErrors();
- expect(parameter, new isInstanceOf<DefaultFormalParameter>());
+ expect(parameter, new TypeMatcher<DefaultFormalParameter>());
DefaultFormalParameter defaultParameter = parameter;
SimpleFormalParameter simpleParameter =
defaultParameter.parameter as SimpleFormalParameter;
@@ -8939,7 +8964,7 @@
FormalParameter parameter = parseFormalParameter('final a : null', kind);
expect(parameter, isNotNull);
assertNoErrors();
- expect(parameter, new isInstanceOf<DefaultFormalParameter>());
+ expect(parameter, new TypeMatcher<DefaultFormalParameter>());
DefaultFormalParameter defaultParameter = parameter;
SimpleFormalParameter simpleParameter =
defaultParameter.parameter as SimpleFormalParameter;
@@ -8958,7 +8983,7 @@
FormalParameter parameter = parseFormalParameter('final a', kind);
expect(parameter, isNotNull);
assertNoErrors();
- expect(parameter, new isInstanceOf<SimpleFormalParameter>());
+ expect(parameter, new TypeMatcher<SimpleFormalParameter>());
SimpleFormalParameter simpleParameter = parameter;
expect(simpleParameter.covariantKeyword, isNull);
expect(simpleParameter.identifier, isNotNull);
@@ -8972,7 +8997,7 @@
FormalParameter parameter = parseFormalParameter('final a = null', kind);
expect(parameter, isNotNull);
assertNoErrors();
- expect(parameter, new isInstanceOf<DefaultFormalParameter>());
+ expect(parameter, new TypeMatcher<DefaultFormalParameter>());
DefaultFormalParameter defaultParameter = parameter;
SimpleFormalParameter simpleParameter =
defaultParameter.parameter as SimpleFormalParameter;
@@ -8991,7 +9016,7 @@
FormalParameter parameter = parseFormalParameter('final A a : null', kind);
expect(parameter, isNotNull);
assertNoErrors();
- expect(parameter, new isInstanceOf<DefaultFormalParameter>());
+ expect(parameter, new TypeMatcher<DefaultFormalParameter>());
DefaultFormalParameter defaultParameter = parameter;
SimpleFormalParameter simpleParameter =
defaultParameter.parameter as SimpleFormalParameter;
@@ -9010,7 +9035,7 @@
FormalParameter parameter = parseFormalParameter('final A a', kind);
expect(parameter, isNotNull);
assertNoErrors();
- expect(parameter, new isInstanceOf<SimpleFormalParameter>());
+ expect(parameter, new TypeMatcher<SimpleFormalParameter>());
SimpleFormalParameter simpleParameter = parameter;
expect(simpleParameter.covariantKeyword, isNull);
expect(simpleParameter.identifier, isNotNull);
@@ -9024,7 +9049,7 @@
FormalParameter parameter = parseFormalParameter('final A a = null', kind);
expect(parameter, isNotNull);
assertNoErrors();
- expect(parameter, new isInstanceOf<DefaultFormalParameter>());
+ expect(parameter, new TypeMatcher<DefaultFormalParameter>());
DefaultFormalParameter defaultParameter = parameter;
SimpleFormalParameter simpleParameter =
defaultParameter.parameter as SimpleFormalParameter;
@@ -9044,12 +9069,12 @@
parseFormalParameter('String Function(int) a', kind);
expect(parameter, isNotNull);
assertNoErrors();
- expect(parameter, new isInstanceOf<SimpleFormalParameter>());
+ expect(parameter, new TypeMatcher<SimpleFormalParameter>());
SimpleFormalParameter simpleParameter = parameter;
expect(simpleParameter.covariantKeyword, isNull);
expect(simpleParameter.identifier, isNotNull);
expect(simpleParameter.keyword, isNull);
- expect(simpleParameter.type, new isInstanceOf<GenericFunctionType>());
+ expect(simpleParameter.type, new TypeMatcher<GenericFunctionType>());
expect(simpleParameter.isRequired, isTrue);
}
@@ -9058,7 +9083,7 @@
FormalParameter parameter = parseFormalParameter('A a : null', kind);
expect(parameter, isNotNull);
assertNoErrors();
- expect(parameter, new isInstanceOf<DefaultFormalParameter>());
+ expect(parameter, new TypeMatcher<DefaultFormalParameter>());
DefaultFormalParameter defaultParameter = parameter;
SimpleFormalParameter simpleParameter =
defaultParameter.parameter as SimpleFormalParameter;
@@ -9077,7 +9102,7 @@
FormalParameter parameter = parseFormalParameter('A a', kind);
expect(parameter, isNotNull);
assertNoErrors();
- expect(parameter, new isInstanceOf<DefaultFormalParameter>());
+ expect(parameter, new TypeMatcher<DefaultFormalParameter>());
DefaultFormalParameter defaultParameter = parameter;
SimpleFormalParameter simpleParameter =
defaultParameter.parameter as SimpleFormalParameter;
@@ -9096,7 +9121,7 @@
FormalParameter parameter = parseFormalParameter('A a', kind);
expect(parameter, isNotNull);
assertNoErrors();
- expect(parameter, new isInstanceOf<SimpleFormalParameter>());
+ expect(parameter, new TypeMatcher<SimpleFormalParameter>());
SimpleFormalParameter simpleParameter = parameter;
expect(simpleParameter.covariantKeyword, isNull);
expect(simpleParameter.identifier, isNotNull);
@@ -9110,7 +9135,7 @@
FormalParameter parameter = parseFormalParameter('A a = null', kind);
expect(parameter, isNotNull);
assertNoErrors();
- expect(parameter, new isInstanceOf<DefaultFormalParameter>());
+ expect(parameter, new TypeMatcher<DefaultFormalParameter>());
DefaultFormalParameter defaultParameter = parameter;
SimpleFormalParameter simpleParameter =
defaultParameter.parameter as SimpleFormalParameter;
@@ -9129,7 +9154,7 @@
FormalParameter parameter = parseFormalParameter('A a', kind);
expect(parameter, isNotNull);
assertNoErrors();
- expect(parameter, new isInstanceOf<DefaultFormalParameter>());
+ expect(parameter, new TypeMatcher<DefaultFormalParameter>());
DefaultFormalParameter defaultParameter = parameter;
SimpleFormalParameter simpleParameter =
defaultParameter.parameter as SimpleFormalParameter;
@@ -9148,7 +9173,7 @@
FormalParameter parameter = parseFormalParameter('var a : null', kind);
expect(parameter, isNotNull);
assertNoErrors();
- expect(parameter, new isInstanceOf<DefaultFormalParameter>());
+ expect(parameter, new TypeMatcher<DefaultFormalParameter>());
DefaultFormalParameter defaultParameter = parameter;
SimpleFormalParameter simpleParameter =
defaultParameter.parameter as SimpleFormalParameter;
@@ -9167,7 +9192,7 @@
FormalParameter parameter = parseFormalParameter('var a', kind);
expect(parameter, isNotNull);
assertNoErrors();
- expect(parameter, new isInstanceOf<SimpleFormalParameter>());
+ expect(parameter, new TypeMatcher<SimpleFormalParameter>());
SimpleFormalParameter simpleParameter = parameter;
expect(simpleParameter.covariantKeyword, isNull);
expect(simpleParameter.identifier, isNotNull);
@@ -9181,7 +9206,7 @@
FormalParameter parameter = parseFormalParameter('var a = null', kind);
expect(parameter, isNotNull);
assertNoErrors();
- expect(parameter, new isInstanceOf<DefaultFormalParameter>());
+ expect(parameter, new TypeMatcher<DefaultFormalParameter>());
DefaultFormalParameter defaultParameter = parameter;
SimpleFormalParameter simpleParameter =
defaultParameter.parameter as SimpleFormalParameter;
@@ -9274,18 +9299,18 @@
NodeList<FormalParameter> parameters = list.parameters;
expect(parameters, hasLength(2));
- expect(parameters[0], new isInstanceOf<SimpleFormalParameter>());
+ expect(parameters[0], new TypeMatcher<SimpleFormalParameter>());
SimpleFormalParameter required = parameters[0];
expect(required.identifier, isNull);
- expect(required.type, new isInstanceOf<TypeName>());
+ expect(required.type, new TypeMatcher<TypeName>());
expect((required.type as TypeName).name.name, 'A');
- expect(parameters[1], new isInstanceOf<DefaultFormalParameter>());
+ expect(parameters[1], new TypeMatcher<DefaultFormalParameter>());
DefaultFormalParameter named = parameters[1];
expect(named.identifier, isNotNull);
- expect(named.parameter, new isInstanceOf<SimpleFormalParameter>());
+ expect(named.parameter, new TypeMatcher<SimpleFormalParameter>());
SimpleFormalParameter simple = named.parameter;
- expect(simple.type, new isInstanceOf<TypeName>());
+ expect(simple.type, new TypeMatcher<TypeName>());
expect((simple.type as TypeName).name.name, 'B');
}
@@ -9449,7 +9474,7 @@
errorCodes:
usingFastaParser ? [ParserErrorCode.EXTRANEOUS_MODIFIER] : []);
expect(parameter, isNotNull);
- expect(parameter, new isInstanceOf<FieldFormalParameter>());
+ expect(parameter, new TypeMatcher<FieldFormalParameter>());
FieldFormalParameter fieldParameter = parameter;
expect(fieldParameter.keyword, isNotNull);
expect(fieldParameter.type, isNull);
@@ -9463,7 +9488,7 @@
errorCodes:
usingFastaParser ? [ParserErrorCode.EXTRANEOUS_MODIFIER] : []);
expect(parameter, isNotNull);
- expect(parameter, new isInstanceOf<FieldFormalParameter>());
+ expect(parameter, new TypeMatcher<FieldFormalParameter>());
FieldFormalParameter fieldParameter = parameter;
expect(fieldParameter.keyword, isNotNull);
expect(fieldParameter.type, isNotNull);
@@ -9476,7 +9501,7 @@
parseNormalFormalParameter('final this.a');
expect(parameter, isNotNull);
assertNoErrors();
- expect(parameter, new isInstanceOf<FieldFormalParameter>());
+ expect(parameter, new TypeMatcher<FieldFormalParameter>());
FieldFormalParameter fieldParameter = parameter;
expect(fieldParameter.keyword, isNotNull);
expect(fieldParameter.type, isNull);
@@ -9489,7 +9514,7 @@
parseNormalFormalParameter('final A this.a');
expect(parameter, isNotNull);
assertNoErrors();
- expect(parameter, new isInstanceOf<FieldFormalParameter>());
+ expect(parameter, new TypeMatcher<FieldFormalParameter>());
FieldFormalParameter fieldParameter = parameter;
expect(fieldParameter.keyword, isNotNull);
expect(fieldParameter.type, isNotNull);
@@ -9501,7 +9526,7 @@
NormalFormalParameter parameter = parseNormalFormalParameter('this.a(B b)');
expect(parameter, isNotNull);
assertNoErrors();
- expect(parameter, new isInstanceOf<FieldFormalParameter>());
+ expect(parameter, new TypeMatcher<FieldFormalParameter>());
FieldFormalParameter fieldParameter = parameter;
expect(fieldParameter.keyword, isNull);
expect(fieldParameter.type, isNull);
@@ -9515,7 +9540,7 @@
NormalFormalParameter parameter = parseNormalFormalParameter('this.a()');
expect(parameter, isNotNull);
assertNoErrors();
- expect(parameter, new isInstanceOf<FieldFormalParameter>());
+ expect(parameter, new TypeMatcher<FieldFormalParameter>());
FieldFormalParameter fieldParameter = parameter;
expect(fieldParameter.keyword, isNull);
expect(fieldParameter.type, isNull);
@@ -9534,7 +9559,7 @@
NormalFormalParameter parameter = parseNormalFormalParameter('this.a');
expect(parameter, isNotNull);
assertNoErrors();
- expect(parameter, new isInstanceOf<FieldFormalParameter>());
+ expect(parameter, new TypeMatcher<FieldFormalParameter>());
FieldFormalParameter fieldParameter = parameter;
expect(fieldParameter.keyword, isNull);
expect(fieldParameter.type, isNull);
@@ -9546,7 +9571,7 @@
NormalFormalParameter parameter = parseNormalFormalParameter('A this.a');
expect(parameter, isNotNull);
assertNoErrors();
- expect(parameter, new isInstanceOf<FieldFormalParameter>());
+ expect(parameter, new TypeMatcher<FieldFormalParameter>());
FieldFormalParameter fieldParameter = parameter;
expect(fieldParameter.keyword, isNull);
expect(fieldParameter.type, isNotNull);
@@ -9558,7 +9583,7 @@
NormalFormalParameter parameter = parseNormalFormalParameter('var this.a');
expect(parameter, isNotNull);
assertNoErrors();
- expect(parameter, new isInstanceOf<FieldFormalParameter>());
+ expect(parameter, new TypeMatcher<FieldFormalParameter>());
FieldFormalParameter fieldParameter = parameter;
expect(fieldParameter.keyword, isNotNull);
expect(fieldParameter.type, isNull);
@@ -9592,7 +9617,7 @@
NormalFormalParameter parameter = parseNormalFormalParameter('a()');
expect(parameter, isNotNull);
assertNoErrors();
- expect(parameter, new isInstanceOf<FunctionTypedFormalParameter>());
+ expect(parameter, new TypeMatcher<FunctionTypedFormalParameter>());
FunctionTypedFormalParameter functionParameter = parameter;
expect(functionParameter.returnType, isNull);
expect(functionParameter.identifier, isNotNull);
@@ -9605,7 +9630,7 @@
parseNormalFormalParameter('covariant a()');
expect(parameter, isNotNull);
assertNoErrors();
- expect(parameter, new isInstanceOf<FunctionTypedFormalParameter>());
+ expect(parameter, new TypeMatcher<FunctionTypedFormalParameter>());
FunctionTypedFormalParameter functionParameter = parameter;
expect(functionParameter.covariantKeyword, isNotNull);
expect(functionParameter.returnType, isNull);
@@ -9619,7 +9644,7 @@
NormalFormalParameter parameter = parseNormalFormalParameter('a/*<E>*/()',
errorCodes: usingFastaParser ? [] : [HintCode.GENERIC_METHOD_COMMENT]);
expect(parameter, isNotNull);
- expect(parameter, new isInstanceOf<FunctionTypedFormalParameter>());
+ expect(parameter, new TypeMatcher<FunctionTypedFormalParameter>());
FunctionTypedFormalParameter functionParameter = parameter;
expect(functionParameter.returnType, isNull);
expect(functionParameter.identifier, isNotNull);
@@ -9631,7 +9656,7 @@
NormalFormalParameter parameter = parseNormalFormalParameter('a<E>()');
expect(parameter, isNotNull);
assertNoErrors();
- expect(parameter, new isInstanceOf<FunctionTypedFormalParameter>());
+ expect(parameter, new TypeMatcher<FunctionTypedFormalParameter>());
FunctionTypedFormalParameter functionParameter = parameter;
expect(functionParameter.returnType, isNull);
expect(functionParameter.identifier, isNotNull);
@@ -9645,7 +9670,7 @@
NormalFormalParameter parameter = parseNormalFormalParameter('A a()');
expect(parameter, isNotNull);
assertNoErrors();
- expect(parameter, new isInstanceOf<FunctionTypedFormalParameter>());
+ expect(parameter, new TypeMatcher<FunctionTypedFormalParameter>());
FunctionTypedFormalParameter functionParameter = parameter;
expect(functionParameter.returnType, isNotNull);
expect(functionParameter.identifier, isNotNull);
@@ -9659,7 +9684,7 @@
NormalFormalParameter parameter = parseNormalFormalParameter('A a/*<E>*/()',
errorCodes: usingFastaParser ? [] : [HintCode.GENERIC_METHOD_COMMENT]);
expect(parameter, isNotNull);
- expect(parameter, new isInstanceOf<FunctionTypedFormalParameter>());
+ expect(parameter, new TypeMatcher<FunctionTypedFormalParameter>());
FunctionTypedFormalParameter functionParameter = parameter;
expect(functionParameter.returnType, isNotNull);
expect(functionParameter.identifier, isNotNull);
@@ -9672,7 +9697,7 @@
NormalFormalParameter parameter = parseNormalFormalParameter('A a<E>()');
expect(parameter, isNotNull);
assertNoErrors();
- expect(parameter, new isInstanceOf<FunctionTypedFormalParameter>());
+ expect(parameter, new TypeMatcher<FunctionTypedFormalParameter>());
FunctionTypedFormalParameter functionParameter = parameter;
expect(functionParameter.returnType, isNotNull);
expect(functionParameter.identifier, isNotNull);
@@ -9686,7 +9711,7 @@
parseNormalFormalParameter('covariant void a()');
expect(parameter, isNotNull);
assertNoErrors();
- expect(parameter, new isInstanceOf<FunctionTypedFormalParameter>());
+ expect(parameter, new TypeMatcher<FunctionTypedFormalParameter>());
FunctionTypedFormalParameter functionParameter = parameter;
expect(functionParameter.covariantKeyword, isNotNull);
expect(functionParameter.returnType, isNotNull);
@@ -9699,7 +9724,7 @@
NormalFormalParameter parameter = parseNormalFormalParameter('void a()');
expect(parameter, isNotNull);
assertNoErrors();
- expect(parameter, new isInstanceOf<FunctionTypedFormalParameter>());
+ expect(parameter, new TypeMatcher<FunctionTypedFormalParameter>());
FunctionTypedFormalParameter functionParameter = parameter;
expect(functionParameter.returnType, isNotNull);
expect(functionParameter.identifier, isNotNull);
@@ -9714,7 +9739,7 @@
'void a/*<E>*/()',
errorCodes: usingFastaParser ? [] : [HintCode.GENERIC_METHOD_COMMENT]);
expect(parameter, isNotNull);
- expect(parameter, new isInstanceOf<FunctionTypedFormalParameter>());
+ expect(parameter, new TypeMatcher<FunctionTypedFormalParameter>());
FunctionTypedFormalParameter functionParameter = parameter;
expect(functionParameter.returnType, isNotNull);
expect(functionParameter.identifier, isNotNull);
@@ -9727,7 +9752,7 @@
NormalFormalParameter parameter = parseNormalFormalParameter('void a<E>()');
expect(parameter, isNotNull);
assertNoErrors();
- expect(parameter, new isInstanceOf<FunctionTypedFormalParameter>());
+ expect(parameter, new TypeMatcher<FunctionTypedFormalParameter>());
FunctionTypedFormalParameter functionParameter = parameter;
expect(functionParameter.returnType, isNotNull);
expect(functionParameter.identifier, isNotNull);
@@ -9747,7 +9772,7 @@
errorCodes:
usingFastaParser ? [ParserErrorCode.EXTRANEOUS_MODIFIER] : []);
expect(parameter, isNotNull);
- expect(parameter, new isInstanceOf<SimpleFormalParameter>());
+ expect(parameter, new TypeMatcher<SimpleFormalParameter>());
SimpleFormalParameter simpleParameter = parameter;
expect(simpleParameter.keyword, isNotNull);
expect(simpleParameter.type, isNull);
@@ -9759,7 +9784,7 @@
errorCodes:
usingFastaParser ? [ParserErrorCode.EXTRANEOUS_MODIFIER] : []);
expect(parameter, isNotNull);
- expect(parameter, new isInstanceOf<SimpleFormalParameter>());
+ expect(parameter, new TypeMatcher<SimpleFormalParameter>());
SimpleFormalParameter simpleParameter = parameter;
expect(simpleParameter.keyword, isNotNull);
expect(simpleParameter.type, isNotNull);
@@ -9770,7 +9795,7 @@
NormalFormalParameter parameter = parseNormalFormalParameter('final a');
expect(parameter, isNotNull);
assertNoErrors();
- expect(parameter, new isInstanceOf<SimpleFormalParameter>());
+ expect(parameter, new TypeMatcher<SimpleFormalParameter>());
SimpleFormalParameter simpleParameter = parameter;
expect(simpleParameter.keyword, isNotNull);
expect(simpleParameter.type, isNull);
@@ -9781,7 +9806,7 @@
NormalFormalParameter parameter = parseNormalFormalParameter('final A a');
expect(parameter, isNotNull);
assertNoErrors();
- expect(parameter, new isInstanceOf<SimpleFormalParameter>());
+ expect(parameter, new TypeMatcher<SimpleFormalParameter>());
SimpleFormalParameter simpleParameter = parameter;
expect(simpleParameter.keyword, isNotNull);
expect(simpleParameter.type, isNotNull);
@@ -9793,7 +9818,7 @@
parseNormalFormalParameter('a', inFunctionType: true);
expect(parameter, isNotNull);
assertNoErrors();
- expect(parameter, new isInstanceOf<SimpleFormalParameter>());
+ expect(parameter, new TypeMatcher<SimpleFormalParameter>());
SimpleFormalParameter simpleParameter = parameter;
expect(simpleParameter.keyword, isNull);
expect(simpleParameter.type, isNotNull);
@@ -9804,7 +9829,7 @@
NormalFormalParameter parameter = parseNormalFormalParameter('a');
expect(parameter, isNotNull);
assertNoErrors();
- expect(parameter, new isInstanceOf<SimpleFormalParameter>());
+ expect(parameter, new TypeMatcher<SimpleFormalParameter>());
SimpleFormalParameter simpleParameter = parameter;
expect(simpleParameter.keyword, isNull);
expect(simpleParameter.type, isNull);
@@ -9815,7 +9840,7 @@
NormalFormalParameter parameter = parseNormalFormalParameter('covariant');
expect(parameter, isNotNull);
assertNoErrors();
- expect(parameter, new isInstanceOf<SimpleFormalParameter>());
+ expect(parameter, new TypeMatcher<SimpleFormalParameter>());
SimpleFormalParameter simpleParameter = parameter;
expect(simpleParameter.covariantKeyword, isNull);
expect(simpleParameter.keyword, isNull);
@@ -9827,7 +9852,7 @@
NormalFormalParameter parameter = parseNormalFormalParameter('A a');
expect(parameter, isNotNull);
assertNoErrors();
- expect(parameter, new isInstanceOf<SimpleFormalParameter>());
+ expect(parameter, new TypeMatcher<SimpleFormalParameter>());
SimpleFormalParameter simpleParameter = parameter;
expect(simpleParameter.keyword, isNull);
expect(simpleParameter.type, isNotNull);
@@ -10618,7 +10643,7 @@
IndexExpression expression =
parseExpression("a.b[]", codes: [ParserErrorCode.MISSING_IDENTIFIER]);
Expression index = expression.index;
- expect(index, new isInstanceOf<SimpleIdentifier>());
+ expect(index, new TypeMatcher<SimpleIdentifier>());
expect(index.isSynthetic, isTrue);
}
@@ -10908,10 +10933,10 @@
Expression expression =
parseExpression('x ? y :', codes: [ParserErrorCode.MISSING_IDENTIFIER]);
expectNotNullIfNoErrors(expression);
- expect(expression, new isInstanceOf<ConditionalExpression>());
+ expect(expression, new TypeMatcher<ConditionalExpression>());
ConditionalExpression conditionalExpression = expression;
expect(conditionalExpression.elseExpression,
- new isInstanceOf<SimpleIdentifier>());
+ new TypeMatcher<SimpleIdentifier>());
expect(conditionalExpression.elseExpression.isSynthetic, isTrue);
}
@@ -10919,10 +10944,10 @@
Expression expression =
parseExpression('x ? : z', codes: [ParserErrorCode.MISSING_IDENTIFIER]);
expectNotNullIfNoErrors(expression);
- expect(expression, new isInstanceOf<ConditionalExpression>());
+ expect(expression, new TypeMatcher<ConditionalExpression>());
ConditionalExpression conditionalExpression = expression;
expect(conditionalExpression.thenExpression,
- new isInstanceOf<SimpleIdentifier>());
+ new TypeMatcher<SimpleIdentifier>());
expect(conditionalExpression.thenExpression.isSynthetic, isTrue);
}
@@ -11141,20 +11166,20 @@
listener.assertErrors([
expectedError(ParserErrorCode.MISSING_ASSIGNMENT_IN_INITIALIZER, 6, 1)
]);
- expect(member, new isInstanceOf<ConstructorDeclaration>());
+ expect(member, new TypeMatcher<ConstructorDeclaration>());
NodeList<ConstructorInitializer> initializers =
(member as ConstructorDeclaration).initializers;
expect(initializers, hasLength(1));
ConstructorInitializer initializer = initializers[0];
- expect(initializer, new isInstanceOf<ConstructorFieldInitializer>());
+ expect(initializer, new TypeMatcher<ConstructorFieldInitializer>());
Expression expression =
(initializer as ConstructorFieldInitializer).expression;
expect(expression, isNotNull);
expect(
expression,
usingFastaParser
- ? new isInstanceOf<MethodInvocation>()
- : new isInstanceOf<ParenthesizedExpression>());
+ ? new TypeMatcher<MethodInvocation>()
+ : new TypeMatcher<ParenthesizedExpression>());
}
void test_incomplete_constructorInitializers_this() {
@@ -11500,7 +11525,7 @@
expectedError(
ParserErrorCode.EXPECTED_TOKEN, usingFastaParser ? 18 : 17, 1)
]);
- expect(statement, new isInstanceOf<ForStatement>());
+ expect(statement, new TypeMatcher<ForStatement>());
expect(statement.toSource(), 'for (String item; i;) {}');
expect(statement.leftSeparator, isNotNull);
expect(statement.leftSeparator.type, TokenType.SEMICOLON);
@@ -11512,7 +11537,7 @@
Statement statement = parseStatement('String v }', expectedEndOffset: 9);
listener
.assertErrors([expectedError(ParserErrorCode.EXPECTED_TOKEN, 9, 1)]);
- expect(statement, new isInstanceOf<VariableDeclarationStatement>());
+ expect(statement, new TypeMatcher<VariableDeclarationStatement>());
expect(statement.toSource(), 'String v;');
}
@@ -11522,7 +11547,7 @@
expectedError(ParserErrorCode.MISSING_IDENTIFIER, 6, 1),
expectedError(ParserErrorCode.EXPECTED_TOKEN, 6, 1)
]);
- expect(statement, new isInstanceOf<VariableDeclarationStatement>());
+ expect(statement, new TypeMatcher<VariableDeclarationStatement>());
expect(statement.toSource(), 'final ;');
}
@@ -11531,7 +11556,7 @@
parseStatement('String v String v2;', expectedEndOffset: 9);
listener
.assertErrors([expectedError(ParserErrorCode.EXPECTED_TOKEN, 9, 6)]);
- expect(statement, new isInstanceOf<VariableDeclarationStatement>());
+ expect(statement, new TypeMatcher<VariableDeclarationStatement>());
expect(statement.toSource(), 'String v;');
}
@@ -11540,7 +11565,7 @@
parseStatement('String v if (true) {}', expectedEndOffset: 9);
listener
.assertErrors([expectedError(ParserErrorCode.EXPECTED_TOKEN, 9, 2)]);
- expect(statement, new isInstanceOf<VariableDeclarationStatement>());
+ expect(statement, new TypeMatcher<VariableDeclarationStatement>());
expect(statement.toSource(), 'String v;');
}
@@ -11548,7 +11573,7 @@
Statement statement = parseStatement('String v {}', expectedEndOffset: 9);
listener
.assertErrors([expectedError(ParserErrorCode.EXPECTED_TOKEN, 9, 1)]);
- expect(statement, new isInstanceOf<VariableDeclarationStatement>());
+ expect(statement, new TypeMatcher<VariableDeclarationStatement>());
expect(statement.toSource(), 'String v;');
}
@@ -11557,7 +11582,7 @@
parseStatement('List<String> v {}', expectedEndOffset: 15);
listener
.assertErrors([expectedError(ParserErrorCode.EXPECTED_TOKEN, 15, 1)]);
- expect(statement, new isInstanceOf<VariableDeclarationStatement>());
+ expect(statement, new TypeMatcher<VariableDeclarationStatement>());
expect(statement.toSource(), 'List<String> v;');
}
@@ -11883,7 +11908,7 @@
// existing annotation can be associated with a class member.
expect(member, isNull);
} else {
- expect(member, new isInstanceOf<MethodDeclaration>());
+ expect(member, new TypeMatcher<MethodDeclaration>());
MethodDeclaration method = member;
expect(method.documentationComment, isNull);
NodeList<Annotation> metadata = method.metadata;
@@ -11895,7 +11920,7 @@
void test_missingSemicolon_varialeDeclarationList() {
void verify(CompilationUnitMember member, String expectedTypeName,
String expectedName, String expectedSemicolon) {
- expect(member, new isInstanceOf<TopLevelVariableDeclaration>());
+ expect(member, new TypeMatcher<TopLevelVariableDeclaration>());
TopLevelVariableDeclaration declaration = member;
VariableDeclarationList variableList = declaration.variables;
expect(variableList, isNotNull);
@@ -12478,7 +12503,7 @@
CommentReference reference = parser.parseCommentReference('new a.b', 7);
expectNotNullIfNoErrors(reference);
assertNoErrors();
- expect(reference.identifier, new isInstanceOf<PrefixedIdentifier>());
+ expect(reference.identifier, new TypeMatcher<PrefixedIdentifier>());
PrefixedIdentifier prefixedIdentifier = reference.identifier;
SimpleIdentifier prefix = prefixedIdentifier.prefix;
expect(prefix.token, isNotNull);
@@ -12496,7 +12521,7 @@
CommentReference reference = parser.parseCommentReference('new a', 5);
expectNotNullIfNoErrors(reference);
assertNoErrors();
- expect(reference.identifier, new isInstanceOf<SimpleIdentifier>());
+ expect(reference.identifier, new TypeMatcher<SimpleIdentifier>());
SimpleIdentifier identifier = reference.identifier;
expect(identifier.token, isNotNull);
expect(identifier.name, "a");
@@ -12508,7 +12533,7 @@
CommentReference reference = parser.parseCommentReference('operator ==', 5);
expectNotNullIfNoErrors(reference);
assertNoErrors();
- expect(reference.identifier, new isInstanceOf<SimpleIdentifier>());
+ expect(reference.identifier, new TypeMatcher<SimpleIdentifier>());
SimpleIdentifier identifier = reference.identifier;
expect(identifier.token, isNotNull);
expect(identifier.name, "==");
@@ -12521,7 +12546,7 @@
parser.parseCommentReference('Object.operator==', 7);
expectNotNullIfNoErrors(reference);
assertNoErrors();
- expect(reference.identifier, new isInstanceOf<PrefixedIdentifier>());
+ expect(reference.identifier, new TypeMatcher<PrefixedIdentifier>());
PrefixedIdentifier prefixedIdentifier = reference.identifier;
SimpleIdentifier prefix = prefixedIdentifier.prefix;
expect(prefix.token, isNotNull);
@@ -12539,7 +12564,7 @@
CommentReference reference = parser.parseCommentReference('==', 5);
expectNotNullIfNoErrors(reference);
assertNoErrors();
- expect(reference.identifier, new isInstanceOf<SimpleIdentifier>());
+ expect(reference.identifier, new TypeMatcher<SimpleIdentifier>());
SimpleIdentifier identifier = reference.identifier;
expect(identifier.token, isNotNull);
expect(identifier.name, "==");
@@ -12551,7 +12576,7 @@
CommentReference reference = parser.parseCommentReference('Object.==', 7);
expectNotNullIfNoErrors(reference);
assertNoErrors();
- expect(reference.identifier, new isInstanceOf<PrefixedIdentifier>());
+ expect(reference.identifier, new TypeMatcher<PrefixedIdentifier>());
PrefixedIdentifier prefixedIdentifier = reference.identifier;
SimpleIdentifier prefix = prefixedIdentifier.prefix;
expect(prefix.token, isNotNull);
@@ -12569,7 +12594,7 @@
CommentReference reference = parser.parseCommentReference('a.b', 7);
expectNotNullIfNoErrors(reference);
assertNoErrors();
- expect(reference.identifier, new isInstanceOf<PrefixedIdentifier>());
+ expect(reference.identifier, new TypeMatcher<PrefixedIdentifier>());
PrefixedIdentifier prefixedIdentifier = reference.identifier;
SimpleIdentifier prefix = prefixedIdentifier.prefix;
expect(prefix.token, isNotNull);
@@ -12587,7 +12612,7 @@
CommentReference reference = parser.parseCommentReference('a', 5);
expectNotNullIfNoErrors(reference);
assertNoErrors();
- expect(reference.identifier, new isInstanceOf<SimpleIdentifier>());
+ expect(reference.identifier, new TypeMatcher<SimpleIdentifier>());
SimpleIdentifier identifier = reference.identifier;
expect(identifier.token, isNotNull);
expect(identifier.name, "a");
@@ -12599,7 +12624,7 @@
CommentReference reference = parser.parseCommentReference('', 5);
expectNotNullIfNoErrors(reference);
assertNoErrors();
- expect(reference.identifier, new isInstanceOf<SimpleIdentifier>());
+ expect(reference.identifier, new TypeMatcher<SimpleIdentifier>());
SimpleIdentifier identifier = reference.identifier;
expect(identifier, isNotNull);
expect(identifier.isSynthetic, isTrue);
@@ -13118,7 +13143,7 @@
FunctionBody functionBody = parser.parseFunctionBody(false, null, false);
expectNotNullIfNoErrors(functionBody);
assertNoErrors();
- expect(functionBody, new isInstanceOf<EmptyFunctionBody>());
+ expect(functionBody, new TypeMatcher<EmptyFunctionBody>());
}
void test_parseFunctionBody_skip_block_invalid() {
@@ -13131,7 +13156,7 @@
? ScannerErrorCode.EXPECTED_TOKEN
: ParserErrorCode.EXPECTED_TOKEN
]);
- expect(functionBody, new isInstanceOf<EmptyFunctionBody>());
+ expect(functionBody, new TypeMatcher<EmptyFunctionBody>());
}
void test_parseFunctionBody_skip_blocks() {
@@ -13140,7 +13165,7 @@
FunctionBody functionBody = parser.parseFunctionBody(false, null, false);
expectNotNullIfNoErrors(functionBody);
assertNoErrors();
- expect(functionBody, new isInstanceOf<EmptyFunctionBody>());
+ expect(functionBody, new TypeMatcher<EmptyFunctionBody>());
}
void test_parseFunctionBody_skip_expression() {
@@ -13149,7 +13174,7 @@
FunctionBody functionBody = parser.parseFunctionBody(false, null, false);
expectNotNullIfNoErrors(functionBody);
assertNoErrors();
- expect(functionBody, new isInstanceOf<EmptyFunctionBody>());
+ expect(functionBody, new TypeMatcher<EmptyFunctionBody>());
}
void test_parseModifiers_abstract() {
@@ -13248,7 +13273,7 @@
TypeParameter parameter = parser.parseTypeParameter();
expectNotNullIfNoErrors(parameter);
assertNoErrors();
- expect(parameter.bound, new isInstanceOf<TypeName>());
+ expect(parameter.bound, new TypeMatcher<TypeName>());
expect(parameter.extendsKeyword, isNotNull);
expect(parameter.name, isNotNull);
TypeName bound = parameter.bound;
@@ -13472,9 +13497,9 @@
ConstructorName parseConstructorName(String name) {
createParser('new $name();');
Statement statement = parser.parseStatement2();
- expect(statement, new isInstanceOf<ExpressionStatement>());
+ expect(statement, new TypeMatcher<ExpressionStatement>());
Expression expression = (statement as ExpressionStatement).expression;
- expect(expression, new isInstanceOf<InstanceCreationExpression>());
+ expect(expression, new TypeMatcher<InstanceCreationExpression>());
return (expression as InstanceCreationExpression).constructorName;
}
@@ -13522,7 +13547,7 @@
*/
void parseStatementList(String content, int expectedCount) {
Statement statement = parseStatement('{$content}');
- expect(statement, new isInstanceOf<Block>());
+ expect(statement, new TypeMatcher<Block>());
Block block = statement;
expect(block.statements, hasLength(expectedCount));
}
@@ -13994,7 +14019,7 @@
assertNoErrors();
expect(clause.extendsKeyword, isNotNull);
expect(clause.superclass, isNotNull);
- expect(clause.superclass, new isInstanceOf<TypeName>());
+ expect(clause.superclass, new TypeMatcher<TypeName>());
}
void test_parseFunctionBody_block() {
@@ -14002,7 +14027,7 @@
FunctionBody functionBody = parser.parseFunctionBody(false, null, false);
expectNotNullIfNoErrors(functionBody);
assertNoErrors();
- expect(functionBody, new isInstanceOf<BlockFunctionBody>());
+ expect(functionBody, new TypeMatcher<BlockFunctionBody>());
BlockFunctionBody body = functionBody;
expect(body.keyword, isNull);
expect(body.star, isNull);
@@ -14017,7 +14042,7 @@
FunctionBody functionBody = parser.parseFunctionBody(false, null, false);
expectNotNullIfNoErrors(functionBody);
assertNoErrors();
- expect(functionBody, new isInstanceOf<BlockFunctionBody>());
+ expect(functionBody, new TypeMatcher<BlockFunctionBody>());
BlockFunctionBody body = functionBody;
expect(body.keyword, isNotNull);
expect(body.keyword.lexeme, Parser.ASYNC);
@@ -14033,7 +14058,7 @@
FunctionBody functionBody = parser.parseFunctionBody(false, null, false);
expectNotNullIfNoErrors(functionBody);
assertNoErrors();
- expect(functionBody, new isInstanceOf<BlockFunctionBody>());
+ expect(functionBody, new TypeMatcher<BlockFunctionBody>());
BlockFunctionBody body = functionBody;
expect(body.keyword, isNotNull);
expect(body.keyword.lexeme, Parser.ASYNC);
@@ -14049,7 +14074,7 @@
FunctionBody functionBody = parser.parseFunctionBody(false, null, false);
expectNotNullIfNoErrors(functionBody);
assertNoErrors();
- expect(functionBody, new isInstanceOf<BlockFunctionBody>());
+ expect(functionBody, new TypeMatcher<BlockFunctionBody>());
BlockFunctionBody body = functionBody;
expect(body.keyword, isNotNull);
expect(body.keyword.lexeme, Parser.SYNC);
@@ -14065,7 +14090,7 @@
FunctionBody functionBody = parser.parseFunctionBody(true, null, false);
expectNotNullIfNoErrors(functionBody);
assertNoErrors();
- expect(functionBody, new isInstanceOf<EmptyFunctionBody>());
+ expect(functionBody, new TypeMatcher<EmptyFunctionBody>());
EmptyFunctionBody body = functionBody;
expect(body.semicolon, isNotNull);
}
@@ -14075,7 +14100,7 @@
FunctionBody functionBody = parser.parseFunctionBody(false, null, false);
expectNotNullIfNoErrors(functionBody);
assertNoErrors();
- expect(functionBody, new isInstanceOf<ExpressionFunctionBody>());
+ expect(functionBody, new TypeMatcher<ExpressionFunctionBody>());
ExpressionFunctionBody body = functionBody;
expect(body.keyword, isNull);
expect(body.functionDefinition, isNotNull);
@@ -14091,7 +14116,7 @@
FunctionBody functionBody = parser.parseFunctionBody(false, null, false);
expectNotNullIfNoErrors(functionBody);
assertNoErrors();
- expect(functionBody, new isInstanceOf<ExpressionFunctionBody>());
+ expect(functionBody, new TypeMatcher<ExpressionFunctionBody>());
ExpressionFunctionBody body = functionBody;
expect(body.keyword, isNotNull);
expect(body.keyword.lexeme, Parser.ASYNC);
@@ -14140,7 +14165,7 @@
expect(unit, isNotNull);
FunctionDeclaration f = unit.declarations[0];
ExpressionFunctionBody body = f.functionExpression.body;
- expect(body.expression, new isInstanceOf<InstanceCreationExpression>());
+ expect(body.expression, new TypeMatcher<InstanceCreationExpression>());
InstanceCreationExpression creation = body.expression;
expect(creation.keyword, isNull);
ConstructorName constructorName = creation.constructorName;
@@ -14157,7 +14182,7 @@
expect(unit, isNotNull);
FunctionDeclaration f = unit.declarations[0];
ExpressionFunctionBody body = f.functionExpression.body;
- expect(body.expression, new isInstanceOf<InstanceCreationExpression>());
+ expect(body.expression, new TypeMatcher<InstanceCreationExpression>());
InstanceCreationExpression creation = body.expression;
expect(creation.keyword, isNull);
ConstructorName constructorName = creation.constructorName;
@@ -14256,13 +14281,13 @@
Function<A>(core.List<core.int> x) m() => null;
''');
Statement statement = parser.parseStatement2();
- expect(statement, new isInstanceOf<FunctionDeclarationStatement>());
+ expect(statement, new TypeMatcher<FunctionDeclarationStatement>());
expect(
(statement as FunctionDeclarationStatement)
.functionDeclaration
.functionExpression
.body,
- new isInstanceOf<ExpressionFunctionBody>());
+ new TypeMatcher<ExpressionFunctionBody>());
}
void test_parseStatements_multiple() {
@@ -14299,16 +14324,16 @@
NodeList<FormalParameter> parameters = parameterList.parameters;
expect(parameters, hasLength(2));
- expect(parameters[0], new isInstanceOf<SimpleFormalParameter>());
+ expect(parameters[0], new TypeMatcher<SimpleFormalParameter>());
SimpleFormalParameter parameter = parameters[0];
expect(parameter.identifier, isNull);
- expect(parameter.type, new isInstanceOf<TypeName>());
+ expect(parameter.type, new TypeMatcher<TypeName>());
expect((parameter.type as TypeName).name.name, 'int');
- expect(parameters[1], new isInstanceOf<SimpleFormalParameter>());
+ expect(parameters[1], new TypeMatcher<SimpleFormalParameter>());
parameter = parameters[1];
expect(parameter.identifier, isNull);
- expect(parameter.type, new isInstanceOf<TypeName>());
+ expect(parameter.type, new TypeMatcher<TypeName>());
expect((parameter.type as TypeName).name.name, 'int');
}
@@ -14384,18 +14409,18 @@
NodeList<FormalParameter> parameters = parameterList.parameters;
expect(parameters, hasLength(2));
- expect(parameters[0], new isInstanceOf<SimpleFormalParameter>());
+ expect(parameters[0], new TypeMatcher<SimpleFormalParameter>());
SimpleFormalParameter parameter = parameters[0];
expect(parameter.identifier, isNotNull);
expect(parameter.identifier.name, 's');
- expect(parameter.type, new isInstanceOf<TypeName>());
+ expect(parameter.type, new TypeMatcher<TypeName>());
expect((parameter.type as TypeName).name.name, 'String');
- expect(parameters[1], new isInstanceOf<SimpleFormalParameter>());
+ expect(parameters[1], new TypeMatcher<SimpleFormalParameter>());
parameter = parameters[1];
expect(parameter.identifier, isNotNull);
expect(parameter.identifier.name, 'i');
- expect(parameter.type, new isInstanceOf<TypeName>());
+ expect(parameter.type, new TypeMatcher<TypeName>());
expect((parameter.type as TypeName).name.name, 'int');
}
@@ -14572,7 +14597,7 @@
TypeParameter parameter = parser.parseTypeParameter();
expectNotNullIfNoErrors(parameter);
assertNoErrors();
- expect(parameter.bound, new isInstanceOf<GenericFunctionType>());
+ expect(parameter.bound, new TypeMatcher<GenericFunctionType>());
expect(parameter.extendsKeyword, isNotNull);
expect(parameter.name, isNotNull);
}
@@ -14582,7 +14607,7 @@
TypeParameter parameter = parser.parseTypeParameter();
expectNotNullIfNoErrors(parameter);
assertNoErrors();
- expect(parameter.bound, new isInstanceOf<GenericFunctionType>());
+ expect(parameter.bound, new TypeMatcher<GenericFunctionType>());
expect(parameter.extendsKeyword, isNotNull);
expect(parameter.name, isNotNull);
}
@@ -14592,7 +14617,7 @@
TypeParameter parameter = parser.parseTypeParameter();
expectNotNullIfNoErrors(parameter);
assertNoErrors();
- expect(parameter.bound, new isInstanceOf<TypeName>());
+ expect(parameter.bound, new TypeMatcher<TypeName>());
expect(parameter.extendsKeyword, isNotNull);
expect(parameter.name, isNotNull);
}
@@ -14602,7 +14627,7 @@
TypeParameter parameter = parser.parseTypeParameter();
expectNotNullIfNoErrors(parameter);
assertNoErrors();
- expect(parameter.bound, new isInstanceOf<TypeName>());
+ expect(parameter.bound, new TypeMatcher<TypeName>());
expect(parameter.extendsKeyword, isNotNull);
expect(parameter.name, isNotNull);
}
@@ -15376,7 +15401,7 @@
as FunctionDeclarationStatement;
assertNoErrors();
FunctionDeclaration function = statement.functionDeclaration;
- expect(function.returnType, new isInstanceOf<GenericFunctionType>());
+ expect(function.returnType, new TypeMatcher<GenericFunctionType>());
}
void test_parseNonLabeledStatement_null() {
@@ -15420,7 +15445,7 @@
List<VariableDeclaration> variables = variableList.variables;
expect(variables, hasLength(1));
expect(variables[0].name.name, 'v');
- expect(variableList.type, new isInstanceOf<GenericFunctionType>());
+ expect(variableList.type, new TypeMatcher<GenericFunctionType>());
}
void
@@ -15433,7 +15458,7 @@
List<VariableDeclaration> variables = variableList.variables;
expect(variables, hasLength(1));
expect(variables[0].name.name, 'v');
- expect(variableList.type, new isInstanceOf<GenericFunctionType>());
+ expect(variableList.type, new TypeMatcher<GenericFunctionType>());
}
void
@@ -15445,7 +15470,7 @@
List<VariableDeclaration> variables = variableList.variables;
expect(variables, hasLength(1));
expect(variables[0].name.name, 'v');
- expect(variableList.type, new isInstanceOf<GenericFunctionType>());
+ expect(variableList.type, new TypeMatcher<GenericFunctionType>());
}
void
@@ -15457,7 +15482,7 @@
List<VariableDeclaration> variables = variableList.variables;
expect(variables, hasLength(1));
expect(variables[0].name.name, 'v');
- expect(variableList.type, new isInstanceOf<GenericFunctionType>());
+ expect(variableList.type, new TypeMatcher<GenericFunctionType>());
}
void
@@ -15469,7 +15494,7 @@
List<VariableDeclaration> variables = variableList.variables;
expect(variables, hasLength(1));
expect(variables[0].name.name, 'v');
- expect(variableList.type, new isInstanceOf<GenericFunctionType>());
+ expect(variableList.type, new TypeMatcher<GenericFunctionType>());
}
void test_parseNonLabeledStatement_variableDeclaration_gftType_returnType() {
@@ -15480,7 +15505,7 @@
List<VariableDeclaration> variables = variableList.variables;
expect(variables, hasLength(1));
expect(variables[0].name.name, 'v');
- expect(variableList.type, new isInstanceOf<GenericFunctionType>());
+ expect(variableList.type, new TypeMatcher<GenericFunctionType>());
}
void
@@ -15492,7 +15517,7 @@
List<VariableDeclaration> variables = variableList.variables;
expect(variables, hasLength(1));
expect(variables[0].name.name, 'v');
- expect(variableList.type, new isInstanceOf<GenericFunctionType>());
+ expect(variableList.type, new TypeMatcher<GenericFunctionType>());
}
void test_parseNonLabeledStatement_variableDeclaration_typeParam() {
@@ -15536,7 +15561,7 @@
expect(typeName.name.name, 'C');
expect(typeName.typeArguments.arguments, hasLength(1));
expect(typeName.typeArguments.arguments[0],
- new isInstanceOf<GenericFunctionType>());
+ new TypeMatcher<GenericFunctionType>());
}
void test_parseStatement_emptyTypeArgumentList() {
@@ -15556,7 +15581,7 @@
parseStatement('void Function<A>(core.List<core.int> x) m() => null;')
as FunctionDeclarationStatement;
expect(statement.functionDeclaration.functionExpression.body,
- new isInstanceOf<ExpressionFunctionBody>());
+ new TypeMatcher<ExpressionFunctionBody>());
}
void test_parseStatement_functionDeclaration_noReturnType() {
@@ -16146,7 +16171,7 @@
CompilationUnitMember member = parseFullCompilationUnitMember();
expect(member, isNotNull);
assertNoErrors();
- expect(member, new isInstanceOf<ClassDeclaration>());
+ expect(member, new TypeMatcher<ClassDeclaration>());
ClassDeclaration declaration = member;
expect(declaration.documentationComment, isNull);
expect(declaration.abstractKeyword, isNotNull);
@@ -16165,7 +16190,7 @@
CompilationUnitMember member = parseFullCompilationUnitMember();
expect(member, isNotNull);
assertNoErrors();
- expect(member, new isInstanceOf<ClassDeclaration>());
+ expect(member, new TypeMatcher<ClassDeclaration>());
ClassDeclaration declaration = member;
expect(declaration.documentationComment, isNull);
expect(declaration.abstractKeyword, isNull);
@@ -16185,7 +16210,7 @@
CompilationUnitMember member = parseFullCompilationUnitMember();
expect(member, isNotNull);
assertNoErrors();
- expect(member, new isInstanceOf<ClassDeclaration>());
+ expect(member, new TypeMatcher<ClassDeclaration>());
ClassDeclaration declaration = member;
expect(declaration.documentationComment, isNull);
expect(declaration.abstractKeyword, isNull);
@@ -16204,7 +16229,7 @@
CompilationUnitMember member = parseFullCompilationUnitMember();
expect(member, isNotNull);
assertNoErrors();
- expect(member, new isInstanceOf<ClassDeclaration>());
+ expect(member, new TypeMatcher<ClassDeclaration>());
ClassDeclaration declaration = member;
expect(declaration.documentationComment, isNull);
expect(declaration.abstractKeyword, isNull);
@@ -16223,7 +16248,7 @@
CompilationUnitMember member = parseFullCompilationUnitMember();
expect(member, isNotNull);
assertNoErrors();
- expect(member, new isInstanceOf<ClassDeclaration>());
+ expect(member, new TypeMatcher<ClassDeclaration>());
ClassDeclaration declaration = member;
expect(declaration.documentationComment, isNull);
expect(declaration.abstractKeyword, isNull);
@@ -16243,7 +16268,7 @@
CompilationUnitMember member = parseFullCompilationUnitMember();
expect(member, isNotNull);
assertNoErrors();
- expect(member, new isInstanceOf<ClassDeclaration>());
+ expect(member, new TypeMatcher<ClassDeclaration>());
ClassDeclaration declaration = member;
expect(declaration.documentationComment, isNull);
expect(declaration.abstractKeyword, isNull);
@@ -16263,7 +16288,7 @@
CompilationUnitMember member = parseFullCompilationUnitMember();
expect(member, isNotNull);
assertNoErrors();
- expect(member, new isInstanceOf<ClassDeclaration>());
+ expect(member, new TypeMatcher<ClassDeclaration>());
ClassDeclaration declaration = member;
expect(declaration.documentationComment, isNull);
expect(declaration.abstractKeyword, isNull);
@@ -16285,7 +16310,7 @@
{
var annotation = declaration.metadata[0];
expect(annotation.atSign, isNotNull);
- expect(annotation.name, new isInstanceOf<SimpleIdentifier>());
+ expect(annotation.name, new TypeMatcher<SimpleIdentifier>());
expect(annotation.name.name, 'A');
expect(annotation.period, isNull);
expect(annotation.constructorName, isNull);
@@ -16295,7 +16320,7 @@
{
var annotation = declaration.metadata[1];
expect(annotation.atSign, isNotNull);
- expect(annotation.name, new isInstanceOf<SimpleIdentifier>());
+ expect(annotation.name, new TypeMatcher<SimpleIdentifier>());
expect(annotation.name.name, 'B');
expect(annotation.period, isNull);
expect(annotation.constructorName, isNull);
@@ -16306,7 +16331,7 @@
{
var annotation = declaration.metadata[2];
expect(annotation.atSign, isNotNull);
- expect(annotation.name, new isInstanceOf<PrefixedIdentifier>());
+ expect(annotation.name, new TypeMatcher<PrefixedIdentifier>());
expect(annotation.name.name, 'C.foo');
expect(annotation.period, isNull);
expect(annotation.constructorName, isNull);
@@ -16317,7 +16342,7 @@
{
var annotation = declaration.metadata[3];
expect(annotation.atSign, isNotNull);
- expect(annotation.name, new isInstanceOf<PrefixedIdentifier>());
+ expect(annotation.name, new TypeMatcher<PrefixedIdentifier>());
expect(annotation.name.name, 'd.E');
expect(annotation.period, isNotNull);
expect(annotation.constructorName, isNotNull);
@@ -16338,7 +16363,7 @@
} else {
assertNoErrors();
}
- expect(member, new isInstanceOf<ClassDeclaration>());
+ expect(member, new TypeMatcher<ClassDeclaration>());
ClassDeclaration declaration = member;
NativeClause nativeClause = declaration.nativeClause;
expect(nativeClause, isNotNull);
@@ -16353,7 +16378,7 @@
CompilationUnitMember member = parseFullCompilationUnitMember();
expect(member, isNotNull);
assertNoErrors();
- expect(member, new isInstanceOf<ClassDeclaration>());
+ expect(member, new TypeMatcher<ClassDeclaration>());
ClassDeclaration declaration = member;
expect(declaration.documentationComment, isNull);
expect(declaration.abstractKeyword, isNull);
@@ -16372,7 +16397,7 @@
CompilationUnitMember member = parseFullCompilationUnitMember();
expect(member, isNotNull);
assertNoErrors();
- expect(member, new isInstanceOf<ClassTypeAlias>());
+ expect(member, new TypeMatcher<ClassTypeAlias>());
ClassTypeAlias typeAlias = member;
expect(typeAlias.typedefKeyword, isNotNull);
expect(typeAlias.name, isNotNull);
@@ -16390,7 +16415,7 @@
CompilationUnitMember member = parseFullCompilationUnitMember();
expect(member, isNotNull);
assertNoErrors();
- expect(member, new isInstanceOf<ClassTypeAlias>());
+ expect(member, new TypeMatcher<ClassTypeAlias>());
ClassTypeAlias typeAlias = member;
expect(typeAlias.typedefKeyword, isNotNull);
expect(typeAlias.name, isNotNull);
@@ -16407,7 +16432,7 @@
CompilationUnitMember member = parseFullCompilationUnitMember();
expect(member, isNotNull);
assertNoErrors();
- expect(member, new isInstanceOf<ClassDeclaration>());
+ expect(member, new TypeMatcher<ClassDeclaration>());
ClassDeclaration declaration = member;
expect(declaration.documentationComment, isNull);
expect(declaration.abstractKeyword, isNull);
@@ -16621,7 +16646,7 @@
CompilationUnitMember member = parseFullCompilationUnitMember();
expect(member, isNotNull);
assertNoErrors();
- expect(member, new isInstanceOf<TopLevelVariableDeclaration>());
+ expect(member, new TypeMatcher<TopLevelVariableDeclaration>());
TopLevelVariableDeclaration declaration = member;
expect(declaration.semicolon, isNotNull);
expect(declaration.variables, isNotNull);
@@ -16632,7 +16657,7 @@
CompilationUnitMember member = parseFullCompilationUnitMember();
expect(member, isNotNull);
assertNoErrors();
- expect(member, new isInstanceOf<ClassDeclaration>());
+ expect(member, new TypeMatcher<ClassDeclaration>());
ClassDeclaration declaration = member;
expect(declaration.name.name, "A");
expect(declaration.members, hasLength(0));
@@ -16643,7 +16668,7 @@
CompilationUnitMember member = parseFullCompilationUnitMember();
expect(member, isNotNull);
assertNoErrors();
- expect(member, new isInstanceOf<ClassTypeAlias>());
+ expect(member, new TypeMatcher<ClassTypeAlias>());
ClassTypeAlias declaration = member;
expect(declaration.name.name, "A");
expect(declaration.abstractKeyword, isNotNull);
@@ -16654,7 +16679,7 @@
CompilationUnitMember member = parseFullCompilationUnitMember();
expect(member, isNotNull);
assertNoErrors();
- expect(member, new isInstanceOf<TopLevelVariableDeclaration>());
+ expect(member, new TypeMatcher<TopLevelVariableDeclaration>());
TopLevelVariableDeclaration declaration = member;
expect(declaration.semicolon, isNotNull);
expect(declaration.variables, isNotNull);
@@ -16676,7 +16701,7 @@
CompilationUnitMember member = parseFullCompilationUnitMember();
expect(member, isNotNull);
assertNoErrors();
- expect(member, new isInstanceOf<TopLevelVariableDeclaration>());
+ expect(member, new TypeMatcher<TopLevelVariableDeclaration>());
TopLevelVariableDeclaration declaration = member;
expect(declaration.semicolon, isNotNull);
expect(declaration.variables, isNotNull);
@@ -16688,7 +16713,7 @@
CompilationUnitMember member = parseFullCompilationUnitMember();
expect(member, isNotNull);
assertNoErrors();
- expect(member, new isInstanceOf<FunctionDeclaration>());
+ expect(member, new TypeMatcher<FunctionDeclaration>());
FunctionDeclaration declaration = member;
expect(declaration.externalKeyword, isNotNull);
expect(declaration.functionExpression, isNotNull);
@@ -16700,7 +16725,7 @@
CompilationUnitMember member = parseFullCompilationUnitMember();
expect(member, isNotNull);
assertNoErrors();
- expect(member, new isInstanceOf<FunctionDeclaration>());
+ expect(member, new TypeMatcher<FunctionDeclaration>());
FunctionDeclaration declaration = member;
expect(declaration.externalKeyword, isNotNull);
expect(declaration.functionExpression, isNotNull);
@@ -16712,7 +16737,7 @@
CompilationUnitMember member = parseFullCompilationUnitMember();
expect(member, isNotNull);
assertNoErrors();
- expect(member, new isInstanceOf<FunctionDeclaration>());
+ expect(member, new TypeMatcher<FunctionDeclaration>());
FunctionDeclaration declaration = member;
expect(declaration.returnType, isNull);
expect(declaration.functionExpression.typeParameters, isNotNull);
@@ -16724,7 +16749,7 @@
CompilationUnitMember member = parseFullCompilationUnitMember();
expect(member, isNotNull);
assertNoErrors();
- expect(member, new isInstanceOf<FunctionDeclaration>());
+ expect(member, new TypeMatcher<FunctionDeclaration>());
FunctionDeclaration declaration = member;
expect(declaration.returnType, isNull);
expect(declaration.functionExpression.typeParameters, isNotNull);
@@ -16735,7 +16760,7 @@
CompilationUnitMember member = parseFullCompilationUnitMember();
expect(member, isNotNull);
assertNoErrors();
- expect(member, new isInstanceOf<FunctionDeclaration>());
+ expect(member, new TypeMatcher<FunctionDeclaration>());
FunctionDeclaration declaration = member;
expect(declaration.returnType, isNotNull);
expect(declaration.functionExpression.typeParameters, isNotNull);
@@ -16746,7 +16771,7 @@
CompilationUnitMember member = parseFullCompilationUnitMember();
expect(member, isNotNull);
assertNoErrors();
- expect(member, new isInstanceOf<FunctionDeclaration>());
+ expect(member, new TypeMatcher<FunctionDeclaration>());
FunctionDeclaration declaration = member;
expect(declaration.functionExpression, isNotNull);
expect(declaration.propertyKeyword, isNull);
@@ -16777,7 +16802,7 @@
CompilationUnitMember member = parseFullCompilationUnitMember();
expect(member, isNotNull);
assertNoErrors();
- expect(member, new isInstanceOf<FunctionDeclaration>());
+ expect(member, new TypeMatcher<FunctionDeclaration>());
FunctionDeclaration declaration = member;
expect(declaration.functionExpression, isNotNull);
expect(declaration.propertyKeyword, isNull);
@@ -16788,7 +16813,7 @@
CompilationUnitMember member = parseFullCompilationUnitMember();
expect(member, isNotNull);
assertNoErrors();
- expect(member, new isInstanceOf<FunctionDeclaration>());
+ expect(member, new TypeMatcher<FunctionDeclaration>());
FunctionDeclaration declaration = member;
expect(declaration.functionExpression, isNotNull);
expect(declaration.propertyKeyword, isNull);
@@ -16799,7 +16824,7 @@
CompilationUnitMember member = parseFullCompilationUnitMember();
expect(member, isNotNull);
assertNoErrors();
- expect(member, new isInstanceOf<FunctionDeclaration>());
+ expect(member, new TypeMatcher<FunctionDeclaration>());
FunctionDeclaration declaration = member;
expect(declaration.returnType, isNotNull);
}
@@ -16809,7 +16834,7 @@
CompilationUnitMember member = parseFullCompilationUnitMember();
expect(member, isNotNull);
assertNoErrors();
- expect(member, new isInstanceOf<FunctionDeclaration>());
+ expect(member, new TypeMatcher<FunctionDeclaration>());
FunctionDeclaration declaration = member;
expect(declaration.externalKeyword, isNotNull);
expect(declaration.functionExpression, isNotNull);
@@ -16822,7 +16847,7 @@
CompilationUnitMember member = parseFullCompilationUnitMember();
expect(member, isNotNull);
assertNoErrors();
- expect(member, new isInstanceOf<FunctionDeclaration>());
+ expect(member, new TypeMatcher<FunctionDeclaration>());
FunctionDeclaration declaration = member;
expect(declaration.externalKeyword, isNotNull);
expect(declaration.functionExpression, isNotNull);
@@ -16834,7 +16859,7 @@
CompilationUnitMember member = parseFullCompilationUnitMember();
expect(member, isNotNull);
assertNoErrors();
- expect(member, new isInstanceOf<FunctionDeclaration>());
+ expect(member, new TypeMatcher<FunctionDeclaration>());
FunctionDeclaration declaration = member;
expect(declaration.functionExpression, isNotNull);
expect(declaration.propertyKeyword, isNotNull);
@@ -16845,7 +16870,7 @@
CompilationUnitMember member = parseFullCompilationUnitMember();
expect(member, isNotNull);
assertNoErrors();
- expect(member, new isInstanceOf<FunctionDeclaration>());
+ expect(member, new TypeMatcher<FunctionDeclaration>());
FunctionDeclaration declaration = member;
expect(declaration.functionExpression, isNotNull);
expect(declaration.propertyKeyword, isNotNull);
@@ -16856,7 +16881,7 @@
CompilationUnitMember member = parseFullCompilationUnitMember();
expect(member, isNotNull);
assertNoErrors();
- expect(member, new isInstanceOf<FunctionDeclaration>());
+ expect(member, new TypeMatcher<FunctionDeclaration>());
FunctionDeclaration declaration = member;
expect(declaration.externalKeyword, isNotNull);
expect(declaration.functionExpression, isNotNull);
@@ -16868,7 +16893,7 @@
CompilationUnitMember member = parseFullCompilationUnitMember();
expect(member, isNotNull);
assertNoErrors();
- expect(member, new isInstanceOf<FunctionDeclaration>());
+ expect(member, new TypeMatcher<FunctionDeclaration>());
FunctionDeclaration declaration = member;
expect(declaration.externalKeyword, isNotNull);
expect(declaration.functionExpression, isNotNull);
@@ -16880,7 +16905,7 @@
CompilationUnitMember member = parseFullCompilationUnitMember();
expect(member, isNotNull);
assertNoErrors();
- expect(member, new isInstanceOf<FunctionDeclaration>());
+ expect(member, new TypeMatcher<FunctionDeclaration>());
FunctionDeclaration declaration = member;
expect(declaration.functionExpression, isNotNull);
expect(declaration.propertyKeyword, isNotNull);
@@ -16892,7 +16917,7 @@
CompilationUnitMember member = parseFullCompilationUnitMember();
expect(member, isNotNull);
assertNoErrors();
- expect(member, new isInstanceOf<FunctionDeclaration>());
+ expect(member, new TypeMatcher<FunctionDeclaration>());
FunctionDeclaration declaration = member;
expect(declaration.functionExpression, isNotNull);
expect(declaration.propertyKeyword, isNotNull);
@@ -16904,7 +16929,7 @@
CompilationUnitMember member = parseFullCompilationUnitMember();
expect(member, isNotNull);
assertNoErrors();
- expect(member, new isInstanceOf<ClassTypeAlias>());
+ expect(member, new TypeMatcher<ClassTypeAlias>());
ClassTypeAlias typeAlias = member;
expect(typeAlias.typedefKeyword, isNotNull);
expect(typeAlias.name.name, "C");
@@ -16923,7 +16948,7 @@
CompilationUnitMember member = parseFullCompilationUnitMember();
expect(member, isNotNull);
assertNoErrors();
- expect(member, new isInstanceOf<ClassTypeAlias>());
+ expect(member, new TypeMatcher<ClassTypeAlias>());
ClassTypeAlias typeAlias = member;
expect(typeAlias.typedefKeyword, isNotNull);
expect(typeAlias.name.name, "C");
@@ -16941,7 +16966,7 @@
CompilationUnitMember member = parseFullCompilationUnitMember();
expect(member, isNotNull);
assertNoErrors();
- expect(member, new isInstanceOf<ClassTypeAlias>());
+ expect(member, new TypeMatcher<ClassTypeAlias>());
ClassTypeAlias typeAlias = member;
expect(typeAlias.typedefKeyword, isNotNull);
expect(typeAlias.name.name, "C");
@@ -16959,7 +16984,7 @@
CompilationUnitMember member = parseFullCompilationUnitMember();
expect(member, isNotNull);
assertNoErrors();
- expect(member, new isInstanceOf<ClassTypeAlias>());
+ expect(member, new TypeMatcher<ClassTypeAlias>());
ClassTypeAlias typeAlias = member;
expect(typeAlias.typedefKeyword, isNotNull);
expect(typeAlias.name.name, "C");
@@ -16977,7 +17002,7 @@
CompilationUnitMember member = parseFullCompilationUnitMember();
expect(member, isNotNull);
assertNoErrors();
- expect(member, new isInstanceOf<FunctionTypeAlias>());
+ expect(member, new TypeMatcher<FunctionTypeAlias>());
FunctionTypeAlias typeAlias = member;
expect(typeAlias.name.name, "F");
expect(typeAlias.parameters.parameters, hasLength(0));
@@ -16995,7 +17020,7 @@
CompilationUnitMember member = parseFullCompilationUnitMember();
expect(member, isNotNull);
assertNoErrors();
- expect(member, new isInstanceOf<TopLevelVariableDeclaration>());
+ expect(member, new TypeMatcher<TopLevelVariableDeclaration>());
TopLevelVariableDeclaration declaration = member;
expect(declaration.semicolon, isNotNull);
expect(declaration.variables, isNotNull);
@@ -17009,7 +17034,7 @@
CompilationUnitMember member = parseFullCompilationUnitMember();
expect(member, isNotNull);
assertNoErrors();
- expect(member, new isInstanceOf<TopLevelVariableDeclaration>());
+ expect(member, new TypeMatcher<TopLevelVariableDeclaration>());
TopLevelVariableDeclaration declaration = member;
expect(declaration.semicolon, isNotNull);
expect(declaration.variables, isNotNull);
@@ -17026,7 +17051,7 @@
expect(unit.declarations, hasLength(1));
TopLevelVariableDeclaration declaration =
unit.declarations[0] as TopLevelVariableDeclaration;
- expect(declaration.variables.type, new isInstanceOf<GenericFunctionType>());
+ expect(declaration.variables.type, new TypeMatcher<GenericFunctionType>());
}
void test_parseCompilationUnitMember_variable_gftType_noReturnType() {
@@ -17051,7 +17076,7 @@
CompilationUnitMember member = parseFullCompilationUnitMember();
expect(member, isNotNull);
assertNoErrors();
- expect(member, new isInstanceOf<TopLevelVariableDeclaration>());
+ expect(member, new TypeMatcher<TopLevelVariableDeclaration>());
TopLevelVariableDeclaration declaration = member;
expect(declaration.semicolon, isNotNull);
expect(declaration.variables, isNotNull);
@@ -17062,7 +17087,7 @@
CompilationUnitMember member = parseFullCompilationUnitMember();
expect(member, isNotNull);
assertNoErrors();
- expect(member, new isInstanceOf<TopLevelVariableDeclaration>());
+ expect(member, new TypeMatcher<TopLevelVariableDeclaration>());
TopLevelVariableDeclaration declaration = member;
expect(declaration.semicolon, isNotNull);
expect(declaration.variables, isNotNull);
@@ -17073,7 +17098,7 @@
Directive directive = parseFullDirective();
expect(directive, isNotNull);
assertNoErrors();
- expect(directive, new isInstanceOf<ExportDirective>());
+ expect(directive, new TypeMatcher<ExportDirective>());
ExportDirective exportDirective = directive;
expect(exportDirective.keyword, isNotNull);
expect(exportDirective.uri, isNotNull);
@@ -17092,7 +17117,7 @@
Directive directive = parseFullDirective();
expect(directive, isNotNull);
assertNoErrors();
- expect(directive, new isInstanceOf<ImportDirective>());
+ expect(directive, new TypeMatcher<ImportDirective>());
ImportDirective importDirective = directive;
expect(importDirective.keyword, isNotNull);
expect(importDirective.uri, isNotNull);
@@ -17107,7 +17132,7 @@
Directive directive = parseFullDirective();
expect(directive, isNotNull);
assertNoErrors();
- expect(directive, new isInstanceOf<LibraryDirective>());
+ expect(directive, new TypeMatcher<LibraryDirective>());
LibraryDirective libraryDirective = directive;
expect(libraryDirective.libraryKeyword, isNotNull);
expect(libraryDirective.name, isNotNull);
@@ -17149,7 +17174,7 @@
Directive directive = parseFullDirective();
expect(directive, isNotNull);
assertNoErrors();
- expect(directive, new isInstanceOf<PartDirective>());
+ expect(directive, new TypeMatcher<PartDirective>());
PartDirective partDirective = directive;
expect(partDirective.partKeyword, isNotNull);
expect(partDirective.uri, isNotNull);
@@ -17197,7 +17222,7 @@
Directive directive = parseFullDirective();
expect(directive, isNotNull);
assertNoErrors();
- expect(directive, new isInstanceOf<PartOfDirective>());
+ expect(directive, new TypeMatcher<PartOfDirective>());
PartOfDirective partOfDirective = directive;
expect(partOfDirective.partKeyword, isNotNull);
expect(partOfDirective.ofKeyword, isNotNull);
@@ -17511,7 +17536,7 @@
{
var annotation = parameters[0].metadata[0];
expect(annotation.atSign, isNotNull);
- expect(annotation.name, new isInstanceOf<SimpleIdentifier>());
+ expect(annotation.name, new TypeMatcher<SimpleIdentifier>());
expect(annotation.name.name, 'A');
expect(annotation.period, isNull);
expect(annotation.constructorName, isNull);
@@ -17521,7 +17546,7 @@
{
var annotation = parameters[1].metadata[0];
expect(annotation.atSign, isNotNull);
- expect(annotation.name, new isInstanceOf<SimpleIdentifier>());
+ expect(annotation.name, new TypeMatcher<SimpleIdentifier>());
expect(annotation.name.name, 'B');
expect(annotation.period, isNull);
expect(annotation.constructorName, isNull);
@@ -17532,7 +17557,7 @@
{
var annotation = parameters[2].metadata[0];
expect(annotation.atSign, isNotNull);
- expect(annotation.name, new isInstanceOf<PrefixedIdentifier>());
+ expect(annotation.name, new TypeMatcher<PrefixedIdentifier>());
expect(annotation.name.name, 'C.foo');
expect(annotation.period, isNull);
expect(annotation.constructorName, isNull);
@@ -17543,7 +17568,7 @@
{
var annotation = parameters[3].metadata[0];
expect(annotation.atSign, isNotNull);
- expect(annotation.name, new isInstanceOf<PrefixedIdentifier>());
+ expect(annotation.name, new TypeMatcher<PrefixedIdentifier>());
expect(annotation.name.name, 'd.E');
expect(annotation.period, isNotNull);
expect(annotation.constructorName, isNotNull);
diff --git a/pkg/analyzer/test/generated/simple_resolver_test.dart b/pkg/analyzer/test/generated/simple_resolver_test.dart
index 43a50ee..d26399e 100644
--- a/pkg/analyzer/test/generated/simple_resolver_test.dart
+++ b/pkg/analyzer/test/generated/simple_resolver_test.dart
@@ -654,7 +654,7 @@
ConstructorDeclaration constructor = classA.members[2];
ParameterElement paramElement =
constructor.parameters.parameters[0].element;
- expect(paramElement, new isInstanceOf<FieldFormalParameterElement>());
+ expect(paramElement, new TypeMatcher<FieldFormalParameterElement>());
expect((paramElement as FieldFormalParameterElement).field,
field.fields.variables[0].element);
ConstructorFieldInitializer initializer = constructor.initializers[0];
diff --git a/pkg/analyzer/test/generated/source_factory_test.dart b/pkg/analyzer/test/generated/source_factory_test.dart
index d5dbae9..91338f9 100644
--- a/pkg/analyzer/test/generated/source_factory_test.dart
+++ b/pkg/analyzer/test/generated/source_factory_test.dart
@@ -133,7 +133,7 @@
expect(
() => resolvePackageUri(
config: 'foo:<:&%>', uri: 'package:foo/bar.dart'),
- throwsA(new isInstanceOf<FormatException>()));
+ throwsA(new TypeMatcher<FormatException>()));
});
test('Valid URI that cannot be further resolved', () {
String uri = resolvePackageUri(
diff --git a/pkg/analyzer/test/generated/static_type_analyzer_kernel_test.dart b/pkg/analyzer/test/generated/static_type_analyzer_kernel_test.dart
index bdee524..a11639e 100644
--- a/pkg/analyzer/test/generated/static_type_analyzer_kernel_test.dart
+++ b/pkg/analyzer/test/generated/static_type_analyzer_kernel_test.dart
@@ -19,11 +19,4 @@
@override
bool get useCFE => true;
-
- @override
- @failingTest
- test_staticMethods_classTypeParameters_genericMethod() async {
- // Expected: '(dynamic) → void'
- await super.test_staticMethods_classTypeParameters_genericMethod();
- }
}
diff --git a/pkg/analyzer/test/generated/static_type_analyzer_test.dart b/pkg/analyzer/test/generated/static_type_analyzer_test.dart
index 7ee2030..d98e6c1 100644
--- a/pkg/analyzer/test/generated/static_type_analyzer_test.dart
+++ b/pkg/analyzer/test/generated/static_type_analyzer_test.dart
@@ -92,7 +92,7 @@
""";
await resolveTestUnit(code);
// "foo" should be resolved to the "Foo" type
- expectIdentifierType("foo();", new isInstanceOf<FunctionType>());
+ expectIdentifierType("foo();", new TypeMatcher<FunctionType>());
}
test_MethodInvocation_nameType_parameter_FunctionTypeAlias() async {
@@ -104,7 +104,7 @@
""";
await resolveTestUnit(code);
// "foo" should be resolved to the "Foo" type
- expectIdentifierType("foo();", new isInstanceOf<FunctionType>());
+ expectIdentifierType("foo();", new TypeMatcher<FunctionType>());
}
test_MethodInvocation_nameType_parameter_propagatedType() async {
diff --git a/pkg/analyzer/test/generated/static_type_warning_code_kernel_test.dart b/pkg/analyzer/test/generated/static_type_warning_code_kernel_test.dart
index a493d63..92509f6 100644
--- a/pkg/analyzer/test/generated/static_type_warning_code_kernel_test.dart
+++ b/pkg/analyzer/test/generated/static_type_warning_code_kernel_test.dart
@@ -254,20 +254,6 @@
@override
@failingTest
- test_invalidAssignment_defaultValue_named() async {
- // UnimplementedError: kernel: (Let) let final dynamic #t1 = 0 in let ...
- await super.test_invalidAssignment_defaultValue_named();
- }
-
- @override
- @failingTest
- test_invalidAssignment_defaultValue_optional() async {
- // UnimplementedError: kernel: (Let) let final dynamic #t2 = 0 in let ...
- await super.test_invalidAssignment_defaultValue_optional();
- }
-
- @override
- @failingTest
test_invalidAssignment_dynamic() async {
// Bad state: No reference information for dynamic at 11
await super.test_invalidAssignment_dynamic();
@@ -705,20 +691,6 @@
@override
@failingTest
- test_undefinedGetter_static() async {
- // Bad state: No reference information for A at 19
- await super.test_undefinedGetter_static();
- }
-
- @override
- @failingTest
- test_undefinedGetter_typeLiteral_conditionalAccess() async {
- // Bad state: No reference information for A at 18
- await super.test_undefinedGetter_typeLiteral_conditionalAccess();
- }
-
- @override
- @failingTest
test_undefinedGetter_wrongNumberOfTypeArguments_tooLittle() async {
// AnalysisException: Element mismatch in /test.dart at main(A<dynamic, dynamic> a) → dynamic
await super.test_undefinedGetter_wrongNumberOfTypeArguments_tooLittle();
@@ -740,6 +712,14 @@
@override
@failingTest
+ @FastaProblem('https://github.com/dart-lang/sdk/issues/33679')
+ test_undefinedMethod() async {
+ // Expected 1 errors of type StaticTypeWarningCode.UNDEFINED_METHOD, found 2
+ await super.test_undefinedMethod();
+ }
+
+ @override
+ @failingTest
test_undefinedMethod_generic_function_call() async {
// Expected 1 errors of type StaticTypeWarningCode.UNDEFINED_METHOD, found 0
await super.test_undefinedMethod_generic_function_call();
@@ -775,6 +755,14 @@
@override
@failingTest
+ @FastaProblem('https://github.com/dart-lang/sdk/issues/33679')
+ test_undefinedMethod_private() async {
+ // Expected 1 errors of type StaticTypeWarningCode.UNDEFINED_METHOD, found 2
+ await super.test_undefinedMethod_private();
+ }
+
+ @override
+ @failingTest
test_undefinedMethod_proxy_annotation_fakeProxy() async {
// Expected 1 errors of type StaticTypeWarningCode.UNDEFINED_METHOD, found 0
await super.test_undefinedMethod_proxy_annotation_fakeProxy();
@@ -789,13 +777,6 @@
@override
@failingTest
- test_undefinedMethod_typeLiteral_conditionalAccess() async {
- // Bad state: No reference information for A at 18
- await super.test_undefinedMethod_typeLiteral_conditionalAccess();
- }
-
- @override
- @failingTest
test_undefinedOperator_indexBoth() async {
// Expected 1 errors of type StaticTypeWarningCode.UNDEFINED_OPERATOR, found 0
await super.test_undefinedOperator_indexBoth();
@@ -838,20 +819,6 @@
@override
@failingTest
- test_undefinedSetter_static() async {
- // Bad state: No reference information for A at 17
- await super.test_undefinedSetter_static();
- }
-
- @override
- @failingTest
- test_undefinedSuperGetter() async {
- // Expected 1 errors of type StaticTypeWarningCode.UNDEFINED_SUPER_GETTER, found 0
- await super.test_undefinedSuperGetter();
- }
-
- @override
- @failingTest
test_undefinedSuperMethod() async {
// Expected 1 errors of type StaticTypeWarningCode.UNDEFINED_SUPER_METHOD, found 0
await super.test_undefinedSuperMethod();
@@ -930,20 +897,6 @@
@override
@failingTest
- test_wrongNumberOfTypeArguments_tooFew() async {
- // AnalysisException: Element mismatch in /test.dart at /test.dart
- await super.test_wrongNumberOfTypeArguments_tooFew();
- }
-
- @override
- @failingTest
- test_wrongNumberOfTypeArguments_tooMany() async {
- // AnalysisException: Element mismatch in /test.dart at /test.dart
- await super.test_wrongNumberOfTypeArguments_tooMany();
- }
-
- @override
- @failingTest
test_wrongNumberOfTypeArguments_typeTest_tooFew() async {
// Bad state: Found 2 argument types for 1 type arguments
await super.test_wrongNumberOfTypeArguments_typeTest_tooFew();
diff --git a/pkg/analyzer/test/generated/static_warning_code_kernel_test.dart b/pkg/analyzer/test/generated/static_warning_code_kernel_test.dart
index ff7880f..5c1b8df 100644
--- a/pkg/analyzer/test/generated/static_warning_code_kernel_test.dart
+++ b/pkg/analyzer/test/generated/static_warning_code_kernel_test.dart
@@ -14,6 +14,11 @@
const potentialAnalyzerProblem = const Object();
+/// Tests marked with this annotation fail because of an Analyzer problem.
+class AnalyzerProblem {
+ const AnalyzerProblem(String issueUri);
+}
+
/// Tests marked with this annotation fail because of a Fasta problem.
class FastaProblem {
const FastaProblem(String issueUri);
@@ -221,14 +226,6 @@
@override
@failingTest
@potentialAnalyzerProblem
- test_argumentTypeNotAssignable_invocation_functionTypes_optional() async {
- return super
- .test_argumentTypeNotAssignable_invocation_functionTypes_optional();
- }
-
- @override
- @failingTest
- @potentialAnalyzerProblem
test_argumentTypeNotAssignable_invocation_generic() async {
return super.test_argumentTypeNotAssignable_invocation_generic();
}
@@ -467,13 +464,6 @@
@override
@failingTest
@potentialAnalyzerProblem
- test_caseBlockNotTerminated() async {
- return super.test_caseBlockNotTerminated();
- }
-
- @override
- @failingTest
- @potentialAnalyzerProblem
test_castToNonType() async {
return super.test_castToNonType();
}
@@ -958,13 +948,6 @@
@override
@failingTest
@potentialAnalyzerProblem
- test_invalidGetterOverrideReturnType() async {
- return super.test_invalidGetterOverrideReturnType();
- }
-
- @override
- @failingTest
- @potentialAnalyzerProblem
test_invalidGetterOverrideReturnType_implicit() async {
return super.test_invalidGetterOverrideReturnType_implicit();
}
@@ -987,42 +970,6 @@
@override
@failingTest
@potentialAnalyzerProblem
- test_invalidMethodOverrideNamedParamType() async {
- return super.test_invalidMethodOverrideNamedParamType();
- }
-
- @override
- @failingTest
- @potentialAnalyzerProblem
- test_invalidMethodOverrideNormalParamType_interface() async {
- return super.test_invalidMethodOverrideNormalParamType_interface();
- }
-
- @override
- @failingTest
- @potentialAnalyzerProblem
- test_invalidMethodOverrideNormalParamType_superclass() async {
- return super.test_invalidMethodOverrideNormalParamType_superclass();
- }
-
- @override
- @failingTest
- @potentialAnalyzerProblem
- test_invalidMethodOverrideNormalParamType_superclass_interface() async {
- return super
- .test_invalidMethodOverrideNormalParamType_superclass_interface();
- }
-
- @override
- @failingTest
- @potentialAnalyzerProblem
- test_invalidMethodOverrideNormalParamType_twoInterfaces() async {
- return super.test_invalidMethodOverrideNormalParamType_twoInterfaces();
- }
-
- @override
- @failingTest
- @potentialAnalyzerProblem
test_invalidMethodOverrideNormalParamType_twoInterfaces_conflicting() async {
return super
.test_invalidMethodOverrideNormalParamType_twoInterfaces_conflicting();
@@ -1031,55 +978,6 @@
@override
@failingTest
@potentialAnalyzerProblem
- test_invalidMethodOverrideOptionalParamType() async {
- return super.test_invalidMethodOverrideOptionalParamType();
- }
-
- @override
- @failingTest
- @potentialAnalyzerProblem
- test_invalidMethodOverrideOptionalParamType_twoInterfaces() async {
- return super.test_invalidMethodOverrideOptionalParamType_twoInterfaces();
- }
-
- @override
- @failingTest
- @potentialAnalyzerProblem
- test_invalidMethodOverrideReturnType_interface() async {
- return super.test_invalidMethodOverrideReturnType_interface();
- }
-
- @override
- @failingTest
- @potentialAnalyzerProblem
- test_invalidMethodOverrideReturnType_interface_grandparent() async {
- return super.test_invalidMethodOverrideReturnType_interface_grandparent();
- }
-
- @override
- @failingTest
- @potentialAnalyzerProblem
- test_invalidMethodOverrideReturnType_mixin() async {
- return super.test_invalidMethodOverrideReturnType_mixin();
- }
-
- @override
- @failingTest
- @potentialAnalyzerProblem
- test_invalidMethodOverrideReturnType_superclass() async {
- return super.test_invalidMethodOverrideReturnType_superclass();
- }
-
- @override
- @failingTest
- @potentialAnalyzerProblem
- test_invalidMethodOverrideReturnType_superclass_grandparent() async {
- return super.test_invalidMethodOverrideReturnType_superclass_grandparent();
- }
-
- @override
- @failingTest
- @potentialAnalyzerProblem
test_invalidMethodOverrideReturnType_twoInterfaces() async {
return super.test_invalidMethodOverrideReturnType_twoInterfaces();
}
@@ -1087,13 +985,6 @@
@override
@failingTest
@potentialAnalyzerProblem
- test_invalidMethodOverrideReturnType_void() async {
- return super.test_invalidMethodOverrideReturnType_void();
- }
-
- @override
- @failingTest
- @potentialAnalyzerProblem
test_invalidOverrideNamed_fewerNamedParameters() async {
return super.test_invalidOverrideNamed_fewerNamedParameters();
}
@@ -1136,13 +1027,6 @@
@override
@failingTest
@potentialAnalyzerProblem
- test_invalidSetterOverrideNormalParamType() async {
- return super.test_invalidSetterOverrideNormalParamType();
- }
-
- @override
- @failingTest
- @potentialAnalyzerProblem
test_invalidSetterOverrideNormalParamType_superclass_interface() async {
return super
.test_invalidSetterOverrideNormalParamType_superclass_interface();
@@ -1151,13 +1035,6 @@
@override
@failingTest
@potentialAnalyzerProblem
- test_invalidSetterOverrideNormalParamType_twoInterfaces() async {
- return super.test_invalidSetterOverrideNormalParamType_twoInterfaces();
- }
-
- @override
- @failingTest
- @potentialAnalyzerProblem
test_invalidSetterOverrideNormalParamType_twoInterfaces_conflicting() async {
return super
.test_invalidSetterOverrideNormalParamType_twoInterfaces_conflicting();
@@ -1865,41 +1742,6 @@
return super.test_undefinedSetter();
}
- @override
- @failingTest
- @potentialAnalyzerProblem
- test_undefinedStaticMethodOrGetter_getter() async {
- return super.test_undefinedStaticMethodOrGetter_getter();
- }
-
- @override
- @failingTest
- @potentialAnalyzerProblem
- test_undefinedStaticMethodOrGetter_getter_inSuperclass() async {
- return super.test_undefinedStaticMethodOrGetter_getter_inSuperclass();
- }
-
- @override
- @failingTest
- @potentialAnalyzerProblem
- test_undefinedStaticMethodOrGetter_method() async {
- return super.test_undefinedStaticMethodOrGetter_method();
- }
-
- @override
- @failingTest
- @potentialAnalyzerProblem
- test_undefinedStaticMethodOrGetter_method_inSuperclass() async {
- return super.test_undefinedStaticMethodOrGetter_method_inSuperclass();
- }
-
- @override
- @failingTest
- @potentialAnalyzerProblem
- test_undefinedStaticMethodOrGetter_setter_inSuperclass() async {
- return super.test_undefinedStaticMethodOrGetter_setter_inSuperclass();
- }
-
@failingTest
@override
test_useOfVoidResult_assignmentExpression_function() async {
diff --git a/pkg/analyzer/test/generated/strong_mode_kernel_test.dart b/pkg/analyzer/test/generated/strong_mode_kernel_test.dart
index 8f9548d..411efa9 100644
--- a/pkg/analyzer/test/generated/strong_mode_kernel_test.dart
+++ b/pkg/analyzer/test/generated/strong_mode_kernel_test.dart
@@ -382,20 +382,6 @@
@override
@failingTest
- test_genericMethod_nestedFunctions() {
- // Expected: '<S>(S) → <S>(S) → S'; Actual: '<Sâ‚€>(S) → <S>(S) → S'
- return super.test_genericMethod_nestedFunctions();
- }
-
- @override
- @failingTest
- test_genericMethod_override_differentContextsSameBounds() {
- // UnimplementedError: TODO(paulberry): TypeParameterType
- return super.test_genericMethod_override_differentContextsSameBounds();
- }
-
- @override
- @failingTest
test_genericMethod_override_invalidContravariantTypeParamBounds() async {
// Expected 1 errors of type StrongModeCode.STRONG_MODE_INVALID_METHOD_OVERRIDE, found 0
await super
@@ -412,13 +398,6 @@
@override
@failingTest
- test_genericMethod_override_invalidReturnType() async {
- // Expected 1 errors of type StrongModeCode.STRONG_MODE_INVALID_METHOD_OVERRIDE, found 0
- await super.test_genericMethod_override_invalidReturnType();
- }
-
- @override
- @failingTest
test_genericMethod_override_invalidTypeParamCount() async {
// Expected 1 errors of type StrongModeCode.STRONG_MODE_INVALID_METHOD_OVERRIDE, found 0
await super.test_genericMethod_override_invalidTypeParamCount();
@@ -446,6 +425,11 @@
}
@override
+ test_notInstantiatedBound_class_error_recursion_less_direct() async {
+ return super.test_notInstantiatedBound_class_error_recursion_less_direct();
+ }
+
+ @override
@failingTest
test_notInstantiatedBound_class_error_recursion_typedef() {
// Expected 2 errors of type
diff --git a/pkg/analyzer/test/generated/utilities_test.dart b/pkg/analyzer/test/generated/utilities_test.dart
index 010ae47..05a13c0 100644
--- a/pkg/analyzer/test/generated/utilities_test.dart
+++ b/pkg/analyzer/test/generated/utilities_test.dart
@@ -1236,7 +1236,7 @@
}
// next tokens
if (original is CommentToken) {
- expect(clone, new isInstanceOf<CommentToken>());
+ expect(clone, new TypeMatcher<CommentToken>());
skipOriginalComment = original;
skipCloneComment = clone;
original = (original as CommentToken).parent;
diff --git a/pkg/analyzer/test/source/analysis_options_provider_test.dart b/pkg/analyzer/test/source/analysis_options_provider_test.dart
index 4d376e4..d271900 100644
--- a/pkg/analyzer/test/source/analysis_options_provider_test.dart
+++ b/pkg/analyzer/test/source/analysis_options_provider_test.dart
@@ -82,7 +82,7 @@
var optionsProvider = new AnalysisOptionsProvider();
expect(() => optionsProvider.getOptionsFromString(src),
- throwsA(new isInstanceOf<OptionsFormatException>()));
+ throwsA(new TypeMatcher<OptionsFormatException>()));
});
test('test_bad_yaml (2)', () {
diff --git a/pkg/analyzer/test/source/package_map_provider_test.dart b/pkg/analyzer/test/source/package_map_provider_test.dart
index 7d78522..944203c 100644
--- a/pkg/analyzer/test/source/package_map_provider_test.dart
+++ b/pkg/analyzer/test/source/package_map_provider_test.dart
@@ -61,7 +61,7 @@
expect(result, hasLength(1));
expect(result.keys, contains(packageName));
expect(result[packageName], hasLength(1));
- expect(result[packageName][0], new isInstanceOf<Folder>());
+ expect(result[packageName][0], new TypeMatcher<Folder>());
expect(result[packageName][0].path, equals(folderPath));
}
@@ -91,7 +91,7 @@
expect(result, hasLength(1));
expect(result.keys, contains(packageName));
expect(result[packageName], hasLength(1));
- expect(result[packageName][0], new isInstanceOf<Folder>());
+ expect(result[packageName][0], new TypeMatcher<Folder>());
expect(result[packageName][0].path, equals(folderPath));
}
@@ -110,7 +110,7 @@
expect(result.keys, contains(packageName));
expect(result[packageName], hasLength(2));
for (int i = 0; i < 2; i++) {
- expect(result[packageName][i], new isInstanceOf<Folder>());
+ expect(result[packageName][i], new TypeMatcher<Folder>());
expect(result[packageName][i].path, isIn([folderPath1, folderPath2]));
}
}
diff --git a/pkg/analyzer/test/src/context/abstract_context.dart b/pkg/analyzer/test/src/context/abstract_context.dart
index 6c184b3..eb77d7e 100644
--- a/pkg/analyzer/test/src/context/abstract_context.dart
+++ b/pkg/analyzer/test/src/context/abstract_context.dart
@@ -103,7 +103,7 @@
* Compute the given [result] for the given [target].
*/
void computeResult(AnalysisTarget target, ResultDescriptor result,
- {isInstanceOf matcher: null}) {
+ {Matcher matcher: null}) {
oldOutputs = outputs;
task = analysisDriver.computeResult(target, result);
if (matcher == null) {
diff --git a/pkg/analyzer/test/src/context/context_test.dart b/pkg/analyzer/test/src/context/context_test.dart
index a4e112b..206fbf9 100644
--- a/pkg/analyzer/test/src/context/context_test.dart
+++ b/pkg/analyzer/test/src/context/context_test.dart
@@ -880,7 +880,7 @@
future.then((CompilationUnit unit) {
fail('Future should have completed with error');
}, onError: (error) {
- expect(error, new isInstanceOf<AnalysisNotScheduledError>());
+ expect(error, new TypeMatcher<AnalysisNotScheduledError>());
completed = true;
});
return pumpEventQueue().then((_) {
@@ -900,7 +900,7 @@
future.then((CompilationUnit unit) {
fail('Future should have been canceled');
}, onError: (error) {
- expect(error, new isInstanceOf<FutureCanceledError>());
+ expect(error, new TypeMatcher<FutureCanceledError>());
completed = true;
});
expect(completed, isFalse);
@@ -925,7 +925,7 @@
future.then((CompilationUnit unit) {
fail('Future should have completed with error');
}, onError: (error) {
- expect(error, new isInstanceOf<AnalysisNotScheduledError>());
+ expect(error, new TypeMatcher<AnalysisNotScheduledError>());
completed = true;
});
expect(completed, isFalse);
diff --git a/pkg/analyzer/test/src/context/mock_sdk.dart b/pkg/analyzer/test/src/context/mock_sdk.dart
index e49e2fb..ed684ec 100644
--- a/pkg/analyzer/test/src/context/mock_sdk.dart
+++ b/pkg/analyzer/test/src/context/mock_sdk.dart
@@ -285,7 +285,7 @@
}
class List<E> implements Iterable<E> {
- List();
+ List([int length]);
factory List.from(Iterable elements, {bool growable: true}) => null;
void add(E value) {}
void addAll(Iterable<E> iterable) {}
diff --git a/pkg/analyzer/test/src/dart/analysis/base.dart b/pkg/analyzer/test/src/dart/analysis/base.dart
index 373fd4b..917a0cf6 100644
--- a/pkg/analyzer/test/src/dart/analysis/base.dart
+++ b/pkg/analyzer/test/src/dart/analysis/base.dart
@@ -82,7 +82,14 @@
}
}
- AnalysisDriver createAnalysisDriver({SummaryDataStore externalSummaries}) {
+ AnalysisDriver createAnalysisDriver(
+ {Map<String, List<Folder>> packageMap,
+ SummaryDataStore externalSummaries}) {
+ packageMap ??= <String, List<Folder>>{
+ 'test': [provider.getFolder(testProject)],
+ 'aaa': [provider.getFolder(_p('/aaa/lib'))],
+ 'bbb': [provider.getFolder(_p('/bbb/lib'))],
+ };
return new AnalysisDriver(
scheduler,
logger,
@@ -93,11 +100,7 @@
new SourceFactory([
new DartUriResolver(sdk),
generatedUriResolver,
- new PackageMapUriResolver(provider, <String, List<Folder>>{
- 'test': [provider.getFolder(testProject)],
- 'aaa': [provider.getFolder(_p('/aaa/lib'))],
- 'bbb': [provider.getFolder(_p('/bbb/lib'))],
- }),
+ new PackageMapUriResolver(provider, packageMap),
new ResourceUriResolver(provider)
], null, provider),
createAnalysisOptions(),
diff --git a/pkg/analyzer/test/src/dart/analysis/driver_kernel_test.dart b/pkg/analyzer/test/src/dart/analysis/driver_kernel_test.dart
index 5494d3e..a78089a 100644
--- a/pkg/analyzer/test/src/dart/analysis/driver_kernel_test.dart
+++ b/pkg/analyzer/test/src/dart/analysis/driver_kernel_test.dart
@@ -31,8 +31,6 @@
@override
bool get useCFE => true;
-// @failingTest
-// @potentialAnalyzerProblem
@override
test_asyncChangesDuringAnalysis_getErrors() async {
// TODO(brianwilkerson) Re-enable this test. It was disabled because it
@@ -251,6 +249,11 @@
}
}
+/// Tests marked with this annotation fail because of an Analyzer problem.
+class AnalyzerProblem {
+ const AnalyzerProblem(String issueUri);
+}
+
/// Tests marked with this annotation fail because of a Fasta problem.
class FastaProblem {
const FastaProblem(String issueUri);
diff --git a/pkg/analyzer/test/src/dart/analysis/driver_resolution_kernel_test.dart b/pkg/analyzer/test/src/dart/analysis/driver_resolution_kernel_test.dart
index c912d36..d6fef73 100644
--- a/pkg/analyzer/test/src/dart/analysis/driver_resolution_kernel_test.dart
+++ b/pkg/analyzer/test/src/dart/analysis/driver_resolution_kernel_test.dart
@@ -21,45 +21,144 @@
@override
bool get useCFE => true;
- @override
@failingTest
- @potentialAnalyzerProblem
- test_annotation_prefixed_classField() {
- // TODO(paulberry): broken because prefixes are not working properly
- return super.test_annotation_prefixed_classField();
- }
+ @override
+ test_annotation_onVariableList_topLevelVariable() =>
+ super.test_annotation_onVariableList_topLevelVariable();
@override
@failingTest
- @FastaProblem('https://github.com/dart-lang/sdk/issues/31605')
- test_constructor_redirected_generic() async {
- await super.test_constructor_redirected_generic();
+ @potentialAnalyzerProblem
+ test_closure_generic() async {
+ // Bad state: Not found T in main() → dynamic
+ // https://github.com/dart-lang/sdk/issues/33722
+ await super.test_closure_generic();
}
@override
@failingTest
@potentialAnalyzerProblem
- test_instanceCreation_prefixed() {
- // TODO(paulberry): broken because prefixes are not working properly
- return super.test_instanceCreation_prefixed();
+ test_local_function_generic() async {
+ // Bad state: Not found T in main() → void
+ // https://github.com/dart-lang/sdk/issues/33722
+ await super.test_local_function_generic();
}
@override
@failingTest
@potentialAnalyzerProblem
- test_isExpression_not() {
- // TODO(paulberry): I suspect that the special case for is! has bit rotted
- return super.test_isExpression_not();
+ test_unresolved_assignment_left_indexed1_simple() async {
+ await super.test_unresolved_assignment_left_indexed1_simple();
}
@override
@failingTest
@potentialAnalyzerProblem
- test_local_function_generic() {
- // TODO(paulberry): I suspect this is broken due to the function type's
- // generic parameters not being properly associated with the generic
- // parameters from the kernel representation.
- return super.test_local_function_generic();
+ test_unresolved_assignment_left_indexed2_simple() async {
+ await super.test_unresolved_assignment_left_indexed2_simple();
+ }
+
+ @override
+ @failingTest
+ @potentialAnalyzerProblem
+ test_unresolved_assignment_left_indexed3_simple() async {
+ await super.test_unresolved_assignment_left_indexed3_simple();
+ }
+
+ @override
+ @failingTest
+ @potentialAnalyzerProblem
+ test_unresolved_assignment_left_indexed4_simple() async {
+ await super.test_unresolved_assignment_left_indexed4_simple();
+ }
+
+ @override
+ @failingTest
+ @potentialAnalyzerProblem
+ test_unresolved_instanceCreation_name_11() async {
+ await super.test_unresolved_instanceCreation_name_11();
+ }
+
+ @override
+ @failingTest
+ @potentialAnalyzerProblem
+ test_unresolved_instanceCreation_name_21() async {
+ await super.test_unresolved_instanceCreation_name_21();
+ }
+
+ @override
+ @failingTest
+ @potentialAnalyzerProblem
+ test_unresolved_instanceCreation_name_22() async {
+ await super.test_unresolved_instanceCreation_name_22();
+ }
+
+ @override
+ @failingTest
+ @potentialAnalyzerProblem
+ test_unresolved_instanceCreation_name_31() async {
+ await super.test_unresolved_instanceCreation_name_31();
+ }
+
+ @override
+ @failingTest
+ @potentialAnalyzerProblem
+ test_unresolved_instanceCreation_name_32() async {
+ await super.test_unresolved_instanceCreation_name_32();
+ }
+
+ @override
+ @failingTest
+ @potentialAnalyzerProblem
+ test_unresolved_instanceCreation_name_33() async {
+ await super.test_unresolved_instanceCreation_name_33();
+ }
+
+ @override
+ @failingTest
+ @potentialAnalyzerProblem
+ test_unresolved_methodInvocation_noTarget() async {
+ await super.test_unresolved_methodInvocation_noTarget();
+ }
+
+ @override
+ @failingTest
+ @potentialAnalyzerProblem
+ test_unresolved_methodInvocation_target_resolved() async {
+ await super.test_unresolved_methodInvocation_target_resolved();
+ }
+
+ @override
+ @failingTest
+ @potentialAnalyzerProblem
+ test_unresolved_methodInvocation_target_unresolved() async {
+ await super.test_unresolved_methodInvocation_target_unresolved();
+ }
+
+ @override
+ @failingTest
+ @potentialAnalyzerProblem
+ test_unresolved_postfix_operand() async {
+ // Bad state: No data for a at 11
+ await super.test_unresolved_postfix_operand();
+ }
+
+ @override
+ @failingTest
+ @potentialAnalyzerProblem
+ test_unresolved_postfix_operator() async {
+// Actual: 'dynamic'
+// Which: is different.
+// Expected: A
+ await super.test_unresolved_postfix_operator();
+ }
+
+ @override
+ @failingTest
+ @potentialAnalyzerProblem
+ test_unresolved_prefix_operand() async {
+ // Bad state: No data for a at 13
+ await super.test_unresolved_prefix_operand();
}
}
diff --git a/pkg/analyzer/test/src/dart/analysis/driver_resolution_test.dart b/pkg/analyzer/test/src/dart/analysis/driver_resolution_test.dart
index 033035c..c4c8cbd 100644
--- a/pkg/analyzer/test/src/dart/analysis/driver_resolution_test.dart
+++ b/pkg/analyzer/test/src/dart/analysis/driver_resolution_test.dart
@@ -2,14 +2,18 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
+import 'dart:async';
+
import 'package:analyzer/dart/ast/ast.dart';
import 'package:analyzer/dart/ast/token.dart';
import 'package:analyzer/dart/element/element.dart';
import 'package:analyzer/dart/element/type.dart';
import 'package:analyzer/src/dart/analysis/driver.dart';
+import 'package:analyzer/src/dart/ast/utilities.dart';
import 'package:analyzer/src/dart/element/element.dart';
import 'package:analyzer/src/dart/element/member.dart';
import 'package:analyzer/src/dart/element/type.dart';
+import 'package:analyzer/src/generated/resolver.dart';
import 'package:analyzer/src/generated/utilities_dart.dart';
import 'package:test/test.dart';
import 'package:test_reflective_loader/test_reflective_loader.dart';
@@ -23,13 +27,119 @@
});
}
-Matcher isUndefinedType = new isInstanceOf<UndefinedTypeImpl>();
+final isDynamicType = new TypeMatcher<DynamicTypeImpl>();
+
+final isUndefinedType = new TypeMatcher<UndefinedTypeImpl>();
/**
* Integration tests for resolution.
*/
@reflectiveTest
class AnalysisDriverResolutionTest extends BaseAnalysisDriverTest {
+ AnalysisResult result;
+ FindNode findNode;
+ FindElement findElement;
+
+ InterfaceType get doubleType => typeProvider.doubleType;
+
+ InterfaceType get intType => typeProvider.intType;
+
+ ClassElement get mapElement => typeProvider.mapType.element;
+
+ InterfaceType get mapType => typeProvider.mapType;
+
+ TypeProvider get typeProvider => result.unit.element.context.typeProvider;
+
+ void assertElement(Expression node, Element expected) {
+ Element actual = getNodeElement(node);
+ expect(actual, same(expected));
+ }
+
+ void assertElementNull(Expression node) {
+ Element actual = getNodeElement(node);
+ expect(actual, isNull);
+ }
+
+ void assertMember(
+ Expression node, String expectedDefiningType, Element expectedBase) {
+ Member actual = getNodeElement(node);
+ expect(actual.definingType.toString(), expectedDefiningType);
+ expect(actual.baseElement, same(expectedBase));
+ }
+
+ void assertType(Expression expression, String expected) {
+ DartType actual = expression.staticType;
+ expect(actual?.toString(), expected);
+ }
+
+ /// Test that [argumentList] has exactly two type items `int` and `double`.
+ void assertTypeArguments(
+ TypeArgumentList argumentList, List<DartType> expectedTypes) {
+ expect(argumentList.arguments, hasLength(expectedTypes.length));
+ for (int i = 0; i < expectedTypes.length; i++) {
+ _assertTypeNameSimple(argumentList.arguments[i], expectedTypes[i]);
+ }
+ }
+
+ void assertTypeDynamic(Expression expression) {
+ DartType actual = expression.staticType;
+ expect(actual, isDynamicType);
+ }
+
+ /// Creates a function that checks that an expression is a reference to a top
+ /// level variable with the given [name].
+ void Function(Expression) checkTopVarRef(String name) {
+ return (Expression e) {
+ TopLevelVariableElement variable = _getTopLevelVariable(result, name);
+ SimpleIdentifier node = e as SimpleIdentifier;
+ expect(node.staticElement, same(variable.getter));
+ expect(node.staticType, variable.type);
+ };
+ }
+
+ /// Creates a function that checks that an expression is a named argument
+ /// that references a top level variable with the given [name], where the
+ /// name of the named argument is undefined.
+ void Function(Expression) checkTopVarUndefinedNamedRef(String name) {
+ return (Expression e) {
+ TopLevelVariableElement variable = _getTopLevelVariable(result, name);
+ NamedExpression named = e as NamedExpression;
+ expect(named.staticType, variable.type);
+
+ SimpleIdentifier nameIdentifier = named.name.label;
+ expect(nameIdentifier.staticElement, isNull);
+ if (useCFE) {
+ expect(nameIdentifier.staticType, isDynamicType);
+ }
+
+ SimpleIdentifier arg2Node = named.expression;
+ expect(arg2Node.staticElement, same(variable.getter));
+ expect(arg2Node.staticType, variable.type);
+ };
+ }
+
+ Element getNodeElement(Expression node) {
+ if (node is AssignmentExpression) {
+ return node.staticElement;
+ } else if (node is Identifier) {
+ return node.staticElement;
+ } else if (node is IndexExpression) {
+ return node.staticElement;
+ } else if (node is PostfixExpression) {
+ return node.staticElement;
+ } else if (node is PrefixExpression) {
+ return node.staticElement;
+ } else {
+ fail('Unsupported node: (${node.runtimeType}) $node');
+ }
+ }
+
+ Future resolveTestFile() async {
+ result = await driver.getResult(testFile);
+ findNode = new FindNode(result);
+ findElement = new FindElement(result);
+ }
+
test_adjacentStrings() async {
String content = r'''
void main() {
@@ -37,8 +147,7 @@
}
''';
addTestFile(content);
- AnalysisResult result = await driver.getResult(testFile);
- var typeProvider = result.unit.element.context.typeProvider;
+ await resolveTestFile();
List<Statement> statements = _getMainStatements(result);
@@ -81,8 +190,7 @@
''';
addTestFile(content);
- AnalysisResult result = await driver.getResult(testFile);
- var typeProvider = result.unit.element.context.typeProvider;
+ await resolveTestFile();
TopLevelVariableDeclaration myDeclaration = result.unit.declarations[0];
VariableDeclaration myVariable = myDeclaration.variables.variables[0];
@@ -128,6 +236,66 @@
}
}
+ test_annotation_onVariableList_constructor() async {
+ String content = r'''
+class C {
+ final Object x;
+ const C(this.x);
+}
+main() {
+ @C(C(42))
+ var foo = null;
+}
+''';
+ addTestFile(content);
+
+ await resolveTestFile();
+
+ ClassDeclaration c = result.unit.declarations[0];
+ ConstructorDeclaration constructor = c.members[1];
+ ConstructorElement element = constructor.element;
+
+ FunctionDeclaration main = result.unit.declarations[1];
+ VariableDeclarationStatement statement =
+ (main.functionExpression.body as BlockFunctionBody).block.statements[0];
+ Annotation annotation = statement.variables.metadata[0];
+ expect(annotation.element, same(element));
+
+ SimpleIdentifier identifier_1 = annotation.name;
+ expect(identifier_1.staticElement, same(c.element));
+ }
+
+ test_annotation_onVariableList_topLevelVariable() async {
+ String content = r'''
+const myAnnotation = 1;
+
+class C {
+ void method() {
+ @myAnnotation
+ int var1 = 4, var2 = 5;
+ }
+}
+''';
+ addTestFile(content);
+
+ await resolveTestFile();
+
+ TopLevelVariableDeclaration myDeclaration = result.unit.declarations[0];
+ VariableDeclaration myVariable = myDeclaration.variables.variables[0];
+ TopLevelVariableElement myElement = myVariable.element;
+
+ ClassDeclaration classNode = result.unit.declarations[1];
+ MethodDeclaration node = classNode.members[0];
+ VariableDeclarationStatement statement =
+ (node.body as BlockFunctionBody).block.statements[0];
+ Annotation annotation = statement.variables.metadata[0];
+ expect(annotation.element, same(myElement.getter));
+
+ SimpleIdentifier identifier_1 = annotation.name;
+ expect(identifier_1.staticElement, same(myElement.getter));
+ expect(identifier_1.staticType, typeProvider.intType);
+ }
+
test_annotation_prefixed_classField() async {
var a = _p('/test/lib/a.dart');
provider.newFile(a, r'''
@@ -141,7 +309,7 @@
@p.A.a
main() {}
''');
- AnalysisResult result = await driver.getResult(testFile);
+ await resolveTestFile();
CompilationUnit unit = result.unit;
var typeProvider = unit.element.context.typeProvider;
@@ -182,7 +350,7 @@
@p.A(1, b: 2)
main() {}
''');
- AnalysisResult result = await driver.getResult(testFile);
+ await resolveTestFile();
CompilationUnit unit = result.unit;
ImportElement aImport = unit.element.library.imports[0];
@@ -224,7 +392,7 @@
@p.A.named(1, b: 2)
main() {}
''');
- AnalysisResult result = await driver.getResult(testFile);
+ await resolveTestFile();
CompilationUnit unit = result.unit;
ImportElement aImport = unit.element.library.imports[0];
@@ -266,7 +434,7 @@
@p.topAnnotation
main() {}
''');
- AnalysisResult result = await driver.getResult(testFile);
+ await resolveTestFile();
CompilationUnit unit = result.unit;
ImportElement aImport = unit.element.library.imports[0];
@@ -290,6 +458,37 @@
expect(annotation.arguments, isNull);
}
+ test_annotation_unprefixed_classField() async {
+ addTestFile(r'''
+@A.a
+main() {}
+
+class A {
+ static const a = 1;
+}
+''');
+ await resolveTestFile();
+ CompilationUnit unit = result.unit;
+ CompilationUnitElement unitElement = unit.element;
+ var typeProvider = unitElement.context.typeProvider;
+
+ ClassElement aClass = unitElement.getType('A');
+ var aGetter = aClass.getField('a').getter;
+
+ Annotation annotation = unit.declarations[0].metadata.single;
+ expect(annotation.element, same(aGetter));
+ PrefixedIdentifier prefixed = annotation.name;
+
+ expect(prefixed.prefix.staticElement, same(aClass));
+ expect(prefixed.prefix.staticType, aClass.type);
+
+ expect(prefixed.identifier.staticElement, same(aGetter));
+ expect(prefixed.identifier.staticType, typeProvider.intType);
+
+ expect(annotation.constructorName, isNull);
+ expect(annotation.arguments, isNull);
+ }
+
test_annotation_unprefixed_constructor() async {
addTestFile(r'''
@A(1, b: 2)
@@ -299,7 +498,7 @@
const A(int a, {int b});
}
''');
- AnalysisResult result = await driver.getResult(testFile);
+ await resolveTestFile();
CompilationUnit unit = result.unit;
CompilationUnitElement unitElement = unit.element;
@@ -329,7 +528,7 @@
const A.named(int a, {int b});
}
''');
- AnalysisResult result = await driver.getResult(testFile);
+ await resolveTestFile();
CompilationUnit unit = result.unit;
CompilationUnitElement unitElement = unit.element;
@@ -366,7 +565,7 @@
@D(const C())
f() {}
''');
- var result = await driver.getResult(testFile);
+ await resolveTestFile();
var elementC = AstFinder.getClass(result.unit, 'C').element;
var constructorC = elementC.constructors[0];
var elementD = AstFinder.getClass(result.unit, 'D').element;
@@ -396,8 +595,7 @@
''';
addTestFile(content);
- AnalysisResult result = await driver.getResult(testFile);
- var typeProvider = result.unit.element.context.typeProvider;
+ await resolveTestFile();
TopLevelVariableDeclaration declaration_1 = result.unit.declarations[0];
VariableDeclaration variable_1 = declaration_1.variables.variables[0];
@@ -433,11 +631,10 @@
''';
addTestFile(content);
- AnalysisResult result = await driver.getResult(testFile);
+ await resolveTestFile();
expect(result.path, testFile);
expect(result.errors, isEmpty);
- var typeProvider = result.unit.element.context.typeProvider;
NodeList<Statement> statements = _getMainStatements(result);
// num v = 42;
@@ -464,6 +661,153 @@
}
}
+ test_assignment_to_final_parameter() async {
+ addTestFile('''
+f(final int x) {
+ x += 2;
+}
+''');
+ await resolveTestFile();
+ expect(result.errors, isNotEmpty);
+
+ var xElement = findNode.simple('x)').staticElement;
+ expect(xElement, isNotNull);
+ var xReference = findNode.simple('x +=');
+ expect(xReference.staticElement, same(xElement));
+ expect(xReference.staticType.toString(), 'int');
+ }
+
+ test_assignment_to_final_variable_local() async {
+ addTestFile('''
+main() {
+ final x = 1;
+ x += 2;
+}
+''');
+ await resolveTestFile();
+ expect(result.errors, isNotEmpty);
+
+ var xElement = findNode.simple('x =').staticElement;
+ expect(xElement, isNotNull);
+ var xReference = findNode.simple('x +=');
+ expect(xReference.staticElement, same(xElement));
+ expect(xReference.staticType.toString(), 'int');
+ }
+
+ test_assignment_to_getter_instance_direct() async {
+ addTestFile('''
+class C {
+ int get x => 0;
+}
+f(C c) {
+ c.x += 2;
+}
+''');
+ await resolveTestFile();
+ expect(result.errors, isNotEmpty);
+
+ var xElement = findElement.getter('x');
+ expect(xElement, isNotNull);
+ var xReference = findNode.simple('x +=');
+ expect(xReference.staticElement, useCFE ? isNull : same(xElement));
+ expect(xReference.staticType.toString(), useCFE ? 'dynamic' : 'int');
+ }
+
+ test_assignment_to_getter_instance_via_implicit_this() async {
+ addTestFile('''
+class C {
+ int get x => 0;
+ f() {
+ x += 2;
+ }
+}
+''');
+ await resolveTestFile();
+ expect(result.errors, isNotEmpty);
+
+ var xElement = findElement.getter('x');
+ expect(xElement, isNotNull);
+ var xReference = findNode.simple('x +=');
+ expect(xReference.staticElement, useCFE ? isNull : same(xElement));
+ expect(xReference.staticType.toString(), useCFE ? 'dynamic' : 'int');
+ }
+
+ test_assignment_to_getter_static_direct() async {
+ addTestFile('''
+class C {
+ static int get x => 0;
+}
+main() {
+ C.x += 2;
+}
+''');
+ await resolveTestFile();
+ expect(result.errors, isNotEmpty);
+
+ var xElement = findElement.getter('x');
+ expect(xElement, isNotNull);
+ var xReference = findNode.simple('x +=');
+ expect(xReference.staticElement, useCFE ? isNull : same(xElement));
+ expect(xReference.staticType.toString(), useCFE ? 'dynamic' : 'int');
+ }
+
+ test_assignment_to_getter_static_via_scope() async {
+ addTestFile('''
+class C {
+ static int get x => 0;
+ f() {
+ x += 2;
+ }
+}
+''');
+ await resolveTestFile();
+ expect(result.errors, isNotEmpty);
+
+ var xElement = findElement.getter('x');
+ expect(xElement, isNotNull);
+ var xReference = findNode.simple('x +=');
+ expect(xReference.staticElement, useCFE ? isNull : same(xElement));
+ expect(xReference.staticType.toString(), useCFE ? 'dynamic' : 'int');
+ }
+
+ test_assignment_to_getter_top_level() async {
+ addTestFile('''
+int get x => 0;
+main() {
+ x += 2;
+}
+''');
+ await resolveTestFile();
+ expect(result.errors, isNotEmpty);
+
+ var xElement = findElement.topGet('x');
+ expect(xElement, isNotNull);
+ var xReference = findNode.simple('x +=');
+ expect(xReference.staticElement, useCFE ? isNull : same(xElement));
+ expect(xReference.staticType.toString(), useCFE ? 'dynamic' : 'int');
+ }
+
+ test_assignment_to_prefix() async {
+ var a = _p('/test/lib/a.dart');
+ provider.newFile(a, '''
+var x = 0;
+''');
+ addTestFile('''
+import 'a.dart' as p;
+main() {
+ p += 2;
+}
+''');
+ await resolveTestFile();
+ expect(result.errors, isNotEmpty);
+
+ var pElement = findElement.prefix('p');
+ expect(pElement, isNotNull);
+ var pReference = findNode.simple('p +=');
+ expect(pReference.staticElement, same(pElement));
+ expect(pReference.staticType, isNull);
+ }
+
test_assignmentExpression_compound_indexExpression() async {
String content = r'''
main() {
@@ -473,7 +817,7 @@
''';
addTestFile(content);
- AnalysisResult result = await driver.getResult(testFile);
+ await resolveTestFile();
CompilationUnit unit = result.unit;
var typeProvider = unit.element.context.typeProvider;
@@ -526,7 +870,7 @@
''';
addTestFile(content);
- AnalysisResult result = await driver.getResult(testFile);
+ await resolveTestFile();
CompilationUnit unit = result.unit;
var typeProvider = unit.element.context.typeProvider;
@@ -569,7 +913,7 @@
''';
addTestFile(content);
- AnalysisResult result = await driver.getResult(testFile);
+ await resolveTestFile();
CompilationUnit unit = result.unit;
var typeProvider = unit.element.context.typeProvider;
@@ -621,7 +965,7 @@
''';
addTestFile(content);
- AnalysisResult result = await driver.getResult(testFile);
+ await resolveTestFile();
CompilationUnit unit = result.unit;
var typeProvider = unit.element.context.typeProvider;
@@ -663,7 +1007,7 @@
''';
addTestFile(content);
- AnalysisResult result = await driver.getResult(testFile);
+ await resolveTestFile();
CompilationUnit unit = result.unit;
var typeProvider = unit.element.context.typeProvider;
@@ -707,7 +1051,7 @@
''';
addTestFile(content);
- AnalysisResult result = await driver.getResult(testFile);
+ await resolveTestFile();
CompilationUnit unit = result.unit;
var typeProvider = unit.element.context.typeProvider;
@@ -746,7 +1090,7 @@
''';
addTestFile(content);
- AnalysisResult result = await driver.getResult(testFile);
+ await resolveTestFile();
CompilationUnit unit = result.unit;
var typeProvider = unit.element.context.typeProvider;
@@ -799,7 +1143,7 @@
''';
addTestFile(content);
- AnalysisResult result = await driver.getResult(testFile);
+ await resolveTestFile();
CompilationUnit unit = result.unit;
var typeProvider = unit.element.context.typeProvider;
@@ -835,7 +1179,7 @@
''';
addTestFile(content);
- AnalysisResult result = await driver.getResult(testFile);
+ await resolveTestFile();
CompilationUnit unit = result.unit;
var typeProvider = unit.element.context.typeProvider;
@@ -877,7 +1221,7 @@
''';
addTestFile(content);
- AnalysisResult result = await driver.getResult(testFile);
+ await resolveTestFile();
CompilationUnit unit = result.unit;
var typeProvider = unit.element.context.typeProvider;
@@ -926,7 +1270,7 @@
''';
addTestFile(content);
- AnalysisResult result = await driver.getResult(testFile);
+ await resolveTestFile();
CompilationUnit unit = result.unit;
var typeProvider = unit.element.context.typeProvider;
@@ -968,7 +1312,7 @@
''';
addTestFile(content);
- AnalysisResult result = await driver.getResult(testFile);
+ await resolveTestFile();
CompilationUnit unit = result.unit;
var typeProvider = unit.element.context.typeProvider;
@@ -1013,7 +1357,7 @@
''';
addTestFile(content);
- AnalysisResult result = await driver.getResult(testFile);
+ await resolveTestFile();
CompilationUnit unit = result.unit;
var typeProvider = unit.element.context.typeProvider;
@@ -1071,7 +1415,7 @@
''';
addTestFile(content);
- AnalysisResult result = await driver.getResult(testFile);
+ await resolveTestFile();
CompilationUnit unit = result.unit;
var typeProvider = unit.element.context.typeProvider;
@@ -1112,7 +1456,7 @@
''';
addTestFile(content);
- AnalysisResult result = await driver.getResult(testFile);
+ await resolveTestFile();
CompilationUnit unit = result.unit;
var typeProvider = unit.element.context.typeProvider;
@@ -1148,7 +1492,7 @@
''';
addTestFile(content);
- AnalysisResult result = await driver.getResult(testFile);
+ await resolveTestFile();
CompilationUnit unit = result.unit;
var typeProvider = unit.element.context.typeProvider;
@@ -1185,7 +1529,7 @@
''';
addTestFile(content);
- AnalysisResult result = await driver.getResult(testFile);
+ await resolveTestFile();
CompilationUnit unit = result.unit;
var typeProvider = unit.element.context.typeProvider;
@@ -1211,7 +1555,7 @@
''';
addTestFile(content);
- AnalysisResult result = await driver.getResult(testFile);
+ await resolveTestFile();
CompilationUnit unit = result.unit;
var typeProvider = unit.element.context.typeProvider;
@@ -1234,8 +1578,7 @@
true || true;
}
''');
- AnalysisResult result = await driver.getResult(testFile);
- var typeProvider = result.unit.element.context.typeProvider;
+ await resolveTestFile();
List<Statement> statements = _getMainStatements(result);
@@ -1262,7 +1605,7 @@
''';
addTestFile(content);
- AnalysisResult result = await driver.getResult(testFile);
+ await resolveTestFile();
CompilationUnit unit = result.unit;
var typeProvider = unit.element.context.typeProvider;
@@ -1287,7 +1630,7 @@
}
''';
addTestFile(content);
- AnalysisResult result = await driver.getResult(testFile);
+ await resolveTestFile();
List<Statement> statements = _getMainStatements(result);
@@ -1317,8 +1660,7 @@
});
}
''');
- AnalysisResult result = await driver.getResult(testFile);
- var typeProvider = result.unit.element.context.typeProvider;
+ await resolveTestFile();
FunctionDeclaration mainDeclaration = result.unit.declarations[0];
FunctionElement mainElement = mainDeclaration.element;
@@ -1412,6 +1754,76 @@
}
}
+ test_closure_generic() async {
+ addTestFile(r'''
+main() {
+ foo(<T>() => new List<T>(4));
+}
+
+void foo(List<T> Function<T>() createList) {}
+''');
+ await resolveTestFile();
+
+ var closure = findNode.functionExpression('<T>() =>');
+ assertType(closure, '<T>() → List<T>');
+
+ FunctionElementImpl closureElement = closure.element;
+ expect(closureElement.enclosingElement, findElement.function('main'));
+ expect(closureElement.returnType.toString(), 'List<T>');
+ expect(closureElement.parameters, isEmpty);
+
+ var typeParameters = closureElement.typeParameters;
+ expect(typeParameters, hasLength(1));
+
+ TypeParameterElement tElement = typeParameters[0];
+ expect(tElement.name, 'T');
+ expect(tElement.nameOffset, 16);
+
+ var creation = findNode.instanceCreation('new List');
+ assertType(creation, 'List<T>');
+
+ var tRef = findNode.simple('T>(4)');
+ assertElement(tRef, tElement);
+ }
+
+ test_closure_inField() async {
+ addTestFile(r'''
+class C {
+ var v = (() => 42)();
+}
+''');
+ await resolveTestFile();
+ CompilationUnit unit = result.unit;
+
+ ClassDeclaration c = unit.declarations[0];
+ FieldDeclaration declaration = c.members[0];
+ VariableDeclaration field = declaration.fields.variables[0];
+ FunctionElement fieldInitializer = field.element.initializer;
+
+ FunctionExpressionInvocation invocation = field.initializer;
+ FunctionExpression closure = invocation.function.unParenthesized;
+ FunctionElementImpl closureElement = closure.element;
+ expect(closureElement.enclosingElement, same(fieldInitializer));
+ }
+
+ test_closure_inTopLevelVariable() async {
+ addTestFile(r'''
+var v = (() => 42)();
+''');
+ await resolveTestFile();
+ CompilationUnit unit = result.unit;
+
+ TopLevelVariableDeclaration declaration = unit.declarations[0];
+ VariableDeclaration variable = declaration.variables.variables[0];
+ TopLevelVariableElement variableElement = variable.element;
+ FunctionElement variableInitializer = variableElement.initializer;
+
+ FunctionExpressionInvocation invocation = variable.initializer;
+ FunctionExpression closure = invocation.function.unParenthesized;
+ FunctionElementImpl closureElement = closure.element;
+ expect(closureElement.enclosingElement, same(variableInitializer));
+ }
+
test_conditionalExpression() async {
String content = r'''
void main() {
@@ -1419,8 +1831,7 @@
}
''';
addTestFile(content);
- AnalysisResult result = await driver.getResult(testFile);
- var typeProvider = result.unit.element.context.typeProvider;
+ await resolveTestFile();
List<Statement> statements = _getMainStatements(result);
@@ -1440,8 +1851,7 @@
}
}
''');
- AnalysisResult result = await driver.getResult(testFile);
- var typeProvider = result.unit.element.context.typeProvider;
+ await resolveTestFile();
ClassDeclaration cNode = result.unit.declarations[0];
@@ -1465,7 +1875,7 @@
}
}
''');
- AnalysisResult result = await driver.getResult(testFile);
+ await resolveTestFile();
ClassDeclaration cNode = result.unit.declarations[0];
ClassElement cElement = cNode.element;
@@ -1494,7 +1904,7 @@
B.two(int p) : super.named(p + 1, b: p + 2);
}
''');
- AnalysisResult result = await driver.getResult(testFile);
+ await resolveTestFile();
ClassDeclaration aNode = result.unit.declarations[0];
ClassElement aElement = aNode.element;
@@ -1534,7 +1944,7 @@
C.two(int p) : this.named(3, b: 4);
}
''');
- AnalysisResult result = await driver.getResult(testFile);
+ await resolveTestFile();
ClassDeclaration cNode = result.unit.declarations[0];
ClassElement cElement = cNode.element;
@@ -1584,7 +1994,7 @@
factory B.two(double b) = A.named;
}
''');
- AnalysisResult result = await driver.getResult(testFile);
+ await resolveTestFile();
expect(result.errors, isEmpty);
ClassDeclaration aNode = result.unit.declarations[0];
@@ -1645,7 +2055,7 @@
factory B.two(double b) = A<U>.named;
}
''');
- AnalysisResult result = await driver.getResult(testFile);
+ await resolveTestFile();
expect(result.errors, isEmpty);
ClassDeclaration aNode = result.unit.declarations[0];
@@ -1710,7 +2120,7 @@
e.toString();
}
''');
- AnalysisResult result = await driver.getResult(testFile);
+ await resolveTestFile();
EnumDeclaration enumNode = result.unit.declarations[0];
ClassElement enumElement = enumNode.element;
@@ -1733,8 +2143,7 @@
}
''';
addTestFile(content);
- AnalysisResult result = await driver.getResult(testFile);
- var typeProvider = result.unit.element.context.typeProvider;
+ await resolveTestFile();
var statements = _getMainStatements(result);
@@ -1759,8 +2168,7 @@
var f = <T>[];
}
''');
- AnalysisResult result = await driver.getResult(testFile);
- var typeProvider = result.unit.element.context.typeProvider;
+ await resolveTestFile();
ClassDeclaration cNode = result.unit.declarations[0];
var tElement = cNode.element.typeParameters[0];
@@ -1777,8 +2185,7 @@
A(String p(int a));
}
''');
- AnalysisResult result = await driver.getResult(testFile);
- var typeProvider = result.unit.element.context.typeProvider;
+ await resolveTestFile();
ClassDeclaration clazz = result.unit.declarations[0];
ConstructorDeclaration constructor = clazz.members[0];
@@ -1812,8 +2219,7 @@
A(String this.f(int a));
}
''');
- AnalysisResult result = await driver.getResult(testFile);
- var typeProvider = result.unit.element.context.typeProvider;
+ await resolveTestFile();
ClassDeclaration clazz = result.unit.declarations[0];
@@ -1857,8 +2263,7 @@
A(this.f);
}
''');
- AnalysisResult result = await driver.getResult(testFile);
- var typeProvider = result.unit.element.context.typeProvider;
+ await resolveTestFile();
ClassDeclaration clazz = result.unit.declarations[0];
@@ -1888,8 +2293,7 @@
A(int this.f);
}
''');
- AnalysisResult result = await driver.getResult(testFile);
- var typeProvider = result.unit.element.context.typeProvider;
+ await resolveTestFile();
ClassDeclaration clazz = result.unit.declarations[0];
@@ -1922,7 +2326,7 @@
b.m(1);
}
''');
- AnalysisResult result = await driver.getResult(testFile);
+ await resolveTestFile();
ClassDeclaration aNode = result.unit.declarations[0];
ClassElement eElement = aNode.element;
@@ -1945,8 +2349,7 @@
(f as Foo<int>)<String>('hello');
}
''');
- AnalysisResult result = await driver.getResult(testFile);
- var typeProvider = result.unit.element.context.typeProvider;
+ await resolveTestFile();
List<Statement> statements = _getMainStatements(result);
@@ -1971,7 +2374,7 @@
''';
addTestFile(content);
- AnalysisResult result = await driver.getResult(testFile);
+ await resolveTestFile();
CompilationUnit unit = result.unit;
var typeProvider = unit.element.context.typeProvider;
@@ -2001,6 +2404,30 @@
expect(actualElement.parameters[0].type, intType);
}
+ test_indexExpression_cascade_assign() async {
+ addTestFile(r'''
+main() {
+ <int, int>{}..[1] = 10;
+}
+''');
+ await resolveTestFile();
+
+ var cascade = findNode.cascade('<int, int>');
+ assertType(cascade, 'Map<int, int>');
+
+ MapLiteral map = cascade.target;
+ assertType(map, 'Map<int, int>');
+ assertTypeArguments(map.typeArguments, [intType, intType]);
+
+ AssignmentExpression assignment = cascade.cascadeSections[0];
+ assertElementNull(assignment);
+ assertType(assignment, 'int');
+
+ IndexExpression indexed = assignment.leftHandSide;
+ assertMember(indexed, 'Map<int, int>', mapElement.getMethod('[]='));
+ assertType(indexed, 'int');
+ }
+
test_instanceCreation_factory() async {
String content = r'''
class C {
@@ -2012,7 +2439,7 @@
''';
addTestFile(content);
- AnalysisResult result = await driver.getResult(testFile);
+ await resolveTestFile();
CompilationUnit unit = result.unit;
ClassDeclaration cNode = unit.declarations[0];
@@ -2065,7 +2492,7 @@
var v = new X(1, b: true, c: 3.0);
''');
- AnalysisResult result = await driver.getResult(testFile);
+ await resolveTestFile();
CompilationUnit unit = result.unit;
ClassDeclaration xNode = unit.declarations[0];
@@ -2105,7 +2532,7 @@
''';
addTestFile(content);
- AnalysisResult result = await driver.getResult(testFile);
+ await resolveTestFile();
CompilationUnit unit = result.unit;
ClassDeclaration cNode = unit.declarations[0];
@@ -2172,7 +2599,7 @@
new p.C<bool>.named(false);
}
''');
- AnalysisResult result = await driver.getResult(testFile);
+ await resolveTestFile();
CompilationUnit unit = result.unit;
var typeProvider = unit.element.context.typeProvider;
@@ -2276,6 +2703,123 @@
}
}
+ test_instanceCreation_unprefixed() async {
+ addTestFile(r'''
+main() {
+ new C(0);
+ new C<bool>(false);
+ new C.named(1.2);
+ new C<bool>.named(false);
+}
+
+class C<T> {
+ C(T p);
+ C.named(T p);
+}
+''');
+ await resolveTestFile();
+ CompilationUnit unit = result.unit;
+ CompilationUnitElement unitElement = unit.element;
+ var typeProvider = unitElement.context.typeProvider;
+
+ ClassElement cElement = unitElement.getType('C');
+ ConstructorElement defaultConstructor = cElement.constructors[0];
+ ConstructorElement namedConstructor = cElement.constructors[1];
+ InterfaceType cType = cElement.type;
+ var cTypeDynamic = cType.instantiate([DynamicTypeImpl.instance]);
+
+ var statements = _getMainStatements(result);
+ {
+ var cTypeInt = cType.instantiate([typeProvider.intType]);
+
+ ExpressionStatement statement = statements[0];
+ InstanceCreationExpression creation = statement.expression;
+ expect(creation.staticElement, defaultConstructor);
+ expect(creation.staticType, cTypeInt);
+
+ TypeName typeName = creation.constructorName.type;
+ expect(typeName.typeArguments, isNull);
+
+ SimpleIdentifier typeIdentifier = typeName.name;
+ expect(typeIdentifier.staticElement, same(cElement));
+ if (useCFE) {
+ expect(typeIdentifier.staticType, cTypeInt);
+ } else {
+ expect(typeIdentifier.staticType, cTypeDynamic);
+ }
+
+ expect(creation.constructorName.name, isNull);
+ }
+
+ {
+ var cTypeBool = cType.instantiate([typeProvider.boolType]);
+
+ ExpressionStatement statement = statements[1];
+ InstanceCreationExpression creation = statement.expression;
+ expect(creation.staticElement, defaultConstructor);
+ expect(creation.staticType, cTypeBool);
+
+ TypeName typeName = creation.constructorName.type;
+ expect(typeName.typeArguments.arguments, hasLength(1));
+ _assertTypeNameSimple(
+ typeName.typeArguments.arguments[0], typeProvider.boolType);
+
+ SimpleIdentifier typeIdentifier = typeName.name;
+ expect(typeIdentifier.staticElement, same(cElement));
+ expect(typeIdentifier.staticType, cTypeBool);
+
+ expect(creation.constructorName.name, isNull);
+ }
+
+ {
+ var cTypeDouble = cType.instantiate([typeProvider.doubleType]);
+
+ ExpressionStatement statement = statements[2];
+ InstanceCreationExpression creation = statement.expression;
+ expect(creation.staticElement, namedConstructor);
+ expect(creation.staticType, cTypeDouble);
+
+ TypeName typeName = creation.constructorName.type;
+ expect(typeName.typeArguments, isNull);
+
+ SimpleIdentifier typeIdentifier = typeName.name;
+ expect(typeIdentifier.staticElement, cElement);
+ if (useCFE) {
+ expect(typeIdentifier.staticType, cTypeDouble);
+ } else {
+ expect(typeIdentifier.staticType, cTypeDynamic);
+ }
+
+ expect(typeIdentifier.staticElement, same(cElement));
+
+ SimpleIdentifier constructorName = creation.constructorName.name;
+ expect(constructorName.staticElement, namedConstructor);
+ expect(constructorName.staticType, isNull);
+ }
+
+ {
+ var cTypeBool = cType.instantiate([typeProvider.boolType]);
+
+ ExpressionStatement statement = statements[3];
+ InstanceCreationExpression creation = statement.expression;
+ expect(creation.staticElement, namedConstructor);
+ expect(creation.staticType, cTypeBool);
+
+ TypeName typeName = creation.constructorName.type;
+ expect(typeName.typeArguments.arguments, hasLength(1));
+ _assertTypeNameSimple(
+ typeName.typeArguments.arguments[0], typeProvider.boolType);
+
+ SimpleIdentifier typeIdentifier = typeName.name;
+ expect(typeIdentifier.staticElement, cElement);
+ expect(typeIdentifier.staticType, cTypeBool);
+
+ SimpleIdentifier constructorName = creation.constructorName.name;
+ expect(constructorName.staticElement, namedConstructor);
+ expect(constructorName.staticType, isNull);
+ }
+ }
+
test_instanceCreation_withTypeArguments() async {
String content = r'''
class C<K, V> {
@@ -2287,7 +2831,7 @@
''';
addTestFile(content);
- AnalysisResult result = await driver.getResult(testFile);
+ await resolveTestFile();
CompilationUnit unit = result.unit;
var typeProvider = unit.element.context.typeProvider;
@@ -2365,6 +2909,97 @@
}
}
+ test_invalid_assignment_types_local() async {
+ addTestFile(r'''
+int a;
+bool b;
+main() {
+ a = b;
+}
+''');
+ await resolveTestFile();
+ expect(result.errors, isNotEmpty);
+
+ var assignment = findNode.assignment('a = b');
+ assertElementNull(assignment);
+ assertType(assignment, 'bool');
+
+ SimpleIdentifier aRef = assignment.leftHandSide;
+ assertElement(aRef, findElement.topVar('a').setter);
+ assertType(aRef, 'int');
+
+ SimpleIdentifier bRef = assignment.rightHandSide;
+ assertElement(bRef, findElement.topVar('b').getter);
+ assertType(bRef, 'bool');
+ }
+
+ test_invalid_assignment_types_top() async {
+ addTestFile(r'''
+int a = 0;
+bool b = a;
+''');
+ await resolveTestFile();
+ expect(result.errors, isNotEmpty);
+
+ var bDeclaration = findNode.variableDeclaration('b =');
+ TopLevelVariableElement bElement = bDeclaration.element;
+ assertElement(bDeclaration.name, bElement);
+ assertType(bDeclaration.name, 'bool');
+ expect(bElement.type.toString(), 'bool');
+
+ SimpleIdentifier aRef = bDeclaration.initializer;
+ assertElement(aRef, findElement.topGet('a'));
+ assertType(aRef, 'int');
+ }
+
+ test_invalid_assignment_types_top_const() async {
+ addTestFile(r'''
+const int a = 0;
+const bool b = a;
+''');
+ await resolveTestFile();
+ expect(result.errors, isNotEmpty);
+
+ var bDeclaration = findNode.variableDeclaration('b =');
+ TopLevelVariableElement bElement = bDeclaration.element;
+ assertElement(bDeclaration.name, bElement);
+ assertType(bDeclaration.name, 'bool');
+ expect(bElement.type.toString(), 'bool');
+
+ SimpleIdentifier aRef = bDeclaration.initializer;
+ assertElement(aRef, findElement.topGet('a'));
+ assertType(aRef, 'int');
+ }
+
+ test_invalid_methodInvocation_simpleIdentifier() async {
+ addTestFile(r'''
+int foo = 0;
+main() {
+ foo(1);
+}
+''');
+ await resolveTestFile();
+ expect(result.errors, isNotEmpty);
+
+ TopLevelVariableElement foo = _getTopLevelVariable(result, 'foo');
+
+ List<Statement> statements = _getMainStatements(result);
+ ExpressionStatement statement = statements[0];
+
+ MethodInvocation invocation = statement.expression;
+ expect(invocation.staticType, isDynamicType);
+ if (useCFE) {
+ // TODO(scheglov) https://github.com/dart-lang/sdk/issues/33682
+ expect(invocation.staticInvokeType.toString(), '() → dynamic');
+ } else {
+ expect(invocation.staticInvokeType, typeProvider.intType);
+ }
+
+ SimpleIdentifier name = invocation.methodName;
+ expect(name.staticElement, same(foo.getter));
+ expect(name.staticType, typeProvider.intType);
+ }
+
test_isExpression() async {
String content = r'''
void main() {
@@ -2374,11 +3009,10 @@
''';
addTestFile(content);
- AnalysisResult result = await driver.getResult(testFile);
+ await resolveTestFile();
expect(result.path, testFile);
expect(result.errors, isEmpty);
- var typeProvider = result.unit.element.context.typeProvider;
NodeList<Statement> statements = _getMainStatements(result);
// var v = 42;
@@ -2414,11 +3048,10 @@
''';
addTestFile(content);
- AnalysisResult result = await driver.getResult(testFile);
+ await resolveTestFile();
expect(result.path, testFile);
expect(result.errors, isEmpty);
- var typeProvider = result.unit.element.context.typeProvider;
NodeList<Statement> statements = _getMainStatements(result);
// var v = 42;
@@ -2455,7 +3088,7 @@
}
}
''');
- AnalysisResult result = await driver.getResult(testFile);
+ await resolveTestFile();
List<Statement> statements = _getMainStatements(result);
LabeledStatement statement = statements[0];
@@ -2484,10 +3117,9 @@
''');
String fTypeString = '(int, String) → double';
- AnalysisResult result = await driver.getResult(testFile);
+ await resolveTestFile();
List<Statement> mainStatements = _getMainStatements(result);
- var typeProvider = result.unit.element.context.typeProvider;
InterfaceType doubleType = typeProvider.doubleType;
FunctionDeclarationStatement fStatement = mainStatements[0];
@@ -2540,12 +3172,15 @@
test_local_function_generic() async {
addTestFile(r'''
void main() {
- T f<T, U>(T a, U b) {}
+ T f<T, U>(T a, U b) {
+ a;
+ b;
+ }
var v = f(1, '2');
}
''');
- AnalysisResult result = await driver.getResult(testFile);
- var typeProvider = result.unit.element.context.typeProvider;
+ await resolveTestFile();
+
List<Statement> mainStatements = _getMainStatements(result);
FunctionDeclarationStatement fStatement = mainStatements[0];
@@ -2584,23 +3219,31 @@
expect(fExpression.element, same(fElement));
{
- List<ParameterElement> elements = fElement.parameters;
- expect(elements, hasLength(2));
+ List<ParameterElement> parameters = fElement.parameters;
+ expect(parameters, hasLength(2));
List<FormalParameter> nodes = fExpression.parameters.parameters;
expect(nodes, hasLength(2));
- _assertSimpleParameter(nodes[0], elements[0],
+ _assertSimpleParameter(nodes[0], parameters[0],
name: 'a',
offset: 28,
kind: ParameterKind.REQUIRED,
type: tElement.type);
- _assertSimpleParameter(nodes[1], elements[1],
+ _assertSimpleParameter(nodes[1], parameters[1],
name: 'b',
offset: 33,
kind: ParameterKind.REQUIRED,
type: uElement.type);
+
+ var aRef = findNode.simple('a;');
+ assertElement(aRef, parameters[0]);
+ assertType(aRef, 'T');
+
+ var bRef = findNode.simple('b;');
+ assertElement(bRef, parameters[1]);
+ assertType(bRef, 'U');
}
VariableDeclarationStatement vStatement = mainStatements[1];
@@ -2618,6 +3261,68 @@
// }
}
+ test_local_function_generic_f_bounded() async {
+ addTestFile('''
+void main() {
+ void F<T extends U, U, V extends U>(T x, U y, V z) {}
+}
+''');
+ await resolveTestFile();
+ List<Statement> mainStatements = _getMainStatements(result);
+
+ FunctionDeclarationStatement fStatement = mainStatements[0];
+ FunctionDeclaration fNode = fStatement.functionDeclaration;
+ FunctionElement fElement = fNode.element;
+
+ expect(fElement.type.toString(),
+ '<T extends U,U,V extends U>(T, U, V) → void');
+ var tElement = fElement.typeParameters[0];
+ var uElement = fElement.typeParameters[1];
+ var vElement = fElement.typeParameters[2];
+ expect((tElement.bound as TypeParameterType).element, same(uElement));
+ expect((vElement.bound as TypeParameterType).element, same(uElement));
+ }
+
+ test_local_function_generic_with_named_parameter() async {
+ addTestFile('''
+void main() {
+ void F<T>({T x}) {}
+}
+''');
+ await resolveTestFile();
+ List<Statement> mainStatements = _getMainStatements(result);
+
+ FunctionDeclarationStatement fStatement = mainStatements[0];
+ FunctionDeclaration fNode = fStatement.functionDeclaration;
+ FunctionElement fElement = fNode.element;
+
+ expect(fElement.type.toString(), '<T>({x: T}) → void');
+ var tElement = fElement.typeParameters[0];
+ expect(fElement.type.typeFormals[0], same(tElement));
+ expect((fElement.type.parameters[0].type as TypeParameterType).element,
+ same(tElement));
+ }
+
+ test_local_function_generic_with_optional_parameter() async {
+ addTestFile('''
+void main() {
+ void F<T>([T x]) {}
+}
+''');
+ await resolveTestFile();
+ List<Statement> mainStatements = _getMainStatements(result);
+
+ FunctionDeclarationStatement fStatement = mainStatements[0];
+ FunctionDeclaration fNode = fStatement.functionDeclaration;
+ FunctionElement fElement = fNode.element;
+
+ expect(fElement.type.toString(), '<T>([T]) → void');
+ var tElement = fElement.typeParameters[0];
+ expect(fElement.type.typeFormals[0], same(tElement));
+ expect((fElement.type.parameters[0].type as TypeParameterType).element,
+ same(tElement));
+ }
+
test_local_function_namedParameters() async {
addTestFile(r'''
void main() {
@@ -2627,10 +3332,9 @@
''');
String fTypeString = '(int, {b: String, c: bool}) → double';
- AnalysisResult result = await driver.getResult(testFile);
+ await resolveTestFile();
List<Statement> mainStatements = _getMainStatements(result);
- var typeProvider = result.unit.element.context.typeProvider;
InterfaceType doubleType = typeProvider.doubleType;
FunctionDeclarationStatement fStatement = mainStatements[0];
@@ -2693,7 +3397,7 @@
}
''');
- AnalysisResult result = await driver.getResult(testFile);
+ await resolveTestFile();
List<Statement> mainStatements = _getMainStatements(result);
FunctionDeclarationStatement fStatement = mainStatements[0];
@@ -2720,10 +3424,9 @@
''');
String fTypeString = '(int, [String, bool]) → double';
- AnalysisResult result = await driver.getResult(testFile);
+ await resolveTestFile();
List<Statement> mainStatements = _getMainStatements(result);
- var typeProvider = result.unit.element.context.typeProvider;
InterfaceType doubleType = typeProvider.doubleType;
FunctionDeclarationStatement fStatement = mainStatements[0];
@@ -2794,11 +3497,10 @@
''';
addTestFile(content);
- AnalysisResult result = await driver.getResult(testFile);
+ await resolveTestFile();
expect(result.path, testFile);
expect(result.errors, isEmpty);
- var typeProvider = result.unit.element.context.typeProvider;
InterfaceType intType = typeProvider.intType;
FunctionDeclaration main = result.unit.declarations[0];
@@ -2828,9 +3530,7 @@
}
}
''');
- AnalysisResult result = await driver.getResult(testFile);
-
- var typeProvider = result.unit.element.context.typeProvider;
+ await resolveTestFile();
List<Statement> mainStatements = _getMainStatements(result);
@@ -2884,11 +3584,10 @@
v;
}
''');
- AnalysisResult result = await driver.getResult(testFile);
+ await resolveTestFile();
expect(result.path, testFile);
expect(result.errors, isEmpty);
- var typeProvider = result.unit.element.context.typeProvider;
InterfaceType intType = typeProvider.intType;
FunctionDeclaration main = result.unit.declarations[0];
@@ -2933,7 +3632,7 @@
}
}
''');
- AnalysisResult result = await driver.getResult(testFile);
+ await resolveTestFile();
CompilationUnit unit = result.unit;
var typeProvider = unit.element.context.typeProvider;
@@ -2972,7 +3671,7 @@
}
}
''');
- AnalysisResult result = await driver.getResult(testFile);
+ await resolveTestFile();
CompilationUnit unit = result.unit;
var typeProvider = unit.element.context.typeProvider;
@@ -3007,7 +3706,7 @@
}
num v;
''');
- AnalysisResult result = await driver.getResult(testFile);
+ await resolveTestFile();
CompilationUnit unit = result.unit;
var typeProvider = unit.element.context.typeProvider;
@@ -3041,7 +3740,7 @@
}
}
''');
- AnalysisResult result = await driver.getResult(testFile);
+ await resolveTestFile();
CompilationUnit unit = result.unit;
var typeProvider = unit.element.context.typeProvider;
@@ -3071,7 +3770,7 @@
}
}
''');
- AnalysisResult result = await driver.getResult(testFile);
+ await resolveTestFile();
CompilationUnit unit = result.unit;
var typeProvider = unit.element.context.typeProvider;
@@ -3106,8 +3805,7 @@
var a = 1, b = 2.3;
}
''');
- AnalysisResult result = await driver.getResult(testFile);
- var typeProvider = result.unit.element.context.typeProvider;
+ await resolveTestFile();
List<Statement> statements = _getMainStatements(result);
@@ -3136,9 +3834,7 @@
}
}
''');
- AnalysisResult result = await driver.getResult(testFile);
-
- var typeProvider = result.unit.element.context.typeProvider;
+ await resolveTestFile();
List<Statement> mainStatements = _getMainStatements(result);
@@ -3194,8 +3890,7 @@
const <bool, String>{};
}
''');
- AnalysisResult result = await driver.getResult(testFile);
- var typeProvider = result.unit.element.context.typeProvider;
+ await resolveTestFile();
var statements = _getMainStatements(result);
@@ -3229,12 +3924,11 @@
''');
String fTypeString = '(int, {b: String, c: bool}) → double';
- AnalysisResult result = await driver.getResult(testFile);
+ await resolveTestFile();
ClassDeclaration classDeclaration = result.unit.declarations[0];
MethodDeclaration methodDeclaration = classDeclaration.members[0];
MethodElement methodElement = methodDeclaration.element;
- var typeProvider = result.unit.element.context.typeProvider;
InterfaceType doubleType = typeProvider.doubleType;
expect(methodElement, isNotNull);
@@ -3295,9 +3989,8 @@
new C().call(0);
}
''');
- AnalysisResult result = await driver.getResult(testFile);
+ await resolveTestFile();
expect(result.errors, isEmpty);
- var typeProvider = result.unit.element.context.typeProvider;
ClassDeclaration cNode = result.unit.declarations[0];
ClassElement cElement = cNode.element;
@@ -3322,9 +4015,8 @@
computation.call(1);
}
''');
- AnalysisResult result = await driver.getResult(testFile);
+ await resolveTestFile();
expect(result.errors, isEmpty);
- var typeProvider = result.unit.element.context.typeProvider;
FunctionDeclaration main = result.unit.declarations[0];
FunctionElement mainElement = main.element;
@@ -3366,7 +4058,7 @@
b.foo(1);
}
''');
- AnalysisResult result = await driver.getResult(testFile);
+ await resolveTestFile();
ClassDeclaration aNode = result.unit.declarations[0];
MethodDeclaration fooNode = aNode.members[0];
@@ -3391,7 +4083,7 @@
void m(T p) {}
}
''');
- AnalysisResult result = await driver.getResult(testFile);
+ await resolveTestFile();
List<Statement> mainStatements = _getMainStatements(result);
ClassDeclaration cNode = result.unit.declarations[1];
@@ -3426,8 +4118,8 @@
Map<T, U> m<U>(T a, U b) => null;
}
''');
- AnalysisResult result = await driver.getResult(testFile);
- var typeProvider = result.unit.element.context.typeProvider;
+ await resolveTestFile();
+
List<Statement> mainStatements = _getMainStatements(result);
ClassDeclaration cNode = result.unit.declarations[1];
@@ -3471,7 +4163,7 @@
}
void foo(int a, {bool b, double c}) {}
''');
- AnalysisResult result = await driver.getResult(testFile);
+ await resolveTestFile();
List<Statement> mainStatements = _getMainStatements(result);
FunctionDeclaration foo = result.unit.declarations[1];
@@ -3495,7 +4187,7 @@
}
}
''');
- AnalysisResult result = await driver.getResult(testFile);
+ await resolveTestFile();
ClassDeclaration cDeclaration = result.unit.declarations[0];
@@ -3530,7 +4222,7 @@
}
}
''');
- AnalysisResult result = await driver.getResult(testFile);
+ await resolveTestFile();
ClassDeclaration cDeclaration = result.unit.declarations[0];
@@ -3567,8 +4259,7 @@
}
}
''');
- AnalysisResult result = await driver.getResult(testFile);
- var typeProvider = result.unit.element.context.typeProvider;
+ await resolveTestFile();
FunctionTypeAlias funDeclaration = result.unit.declarations[0];
FunctionTypeAliasElement funElement = funDeclaration.element;
@@ -3599,7 +4290,7 @@
f(1);
}
''');
- AnalysisResult result = await driver.getResult(testFile);
+ await resolveTestFile();
FunctionDeclaration mainDeclaration = result.unit.declarations[0];
FunctionExpression mainFunction = mainDeclaration.functionExpression;
@@ -3626,8 +4317,7 @@
f(1);
}
''');
- AnalysisResult result = await driver.getResult(testFile);
- var typeProvider = result.unit.element.context.typeProvider;
+ await resolveTestFile();
FunctionDeclaration mainDeclaration = result.unit.declarations[0];
FunctionExpression mainFunction = mainDeclaration.functionExpression;
@@ -3654,7 +4344,7 @@
f(1);
}
''');
- AnalysisResult result = await driver.getResult(testFile);
+ await resolveTestFile();
TopLevelVariableDeclaration fDeclaration = result.unit.declarations[0];
VariableDeclaration fNode = fDeclaration.variables.variables[0];
@@ -3686,7 +4376,7 @@
}
}
''');
- AnalysisResult result = await driver.getResult(testFile);
+ await resolveTestFile();
List<Statement> mainStatements = _getMainStatements(result);
ClassDeclaration cNode = result.unit.declarations[1];
@@ -3750,7 +4440,7 @@
}
}
''');
- AnalysisResult result = await driver.getResult(testFile);
+ await resolveTestFile();
ClassDeclaration cNode = result.unit.declarations[0];
TypeParameterElement tElement = cNode.element.typeParameters[0];
@@ -3773,10 +4463,9 @@
''');
String fTypeString = '(int, String) → double';
- AnalysisResult result = await driver.getResult(testFile);
+ await resolveTestFile();
List<Statement> mainStatements = _getMainStatements(result);
- var typeProvider = result.unit.element.context.typeProvider;
InterfaceType doubleType = typeProvider.doubleType;
FunctionDeclaration fNode = result.unit.declarations[1];
@@ -3803,8 +4492,8 @@
}
void f<T, U>(T a, U b) {}
''');
- AnalysisResult result = await driver.getResult(testFile);
- var typeProvider = result.unit.element.context.typeProvider;
+ await resolveTestFile();
+
List<Statement> mainStatements = _getMainStatements(result);
FunctionDeclaration fNode = result.unit.declarations[1];
@@ -3878,7 +4567,7 @@
''';
addTestFile(content);
- AnalysisResult result = await driver.getResult(testFile);
+ await resolveTestFile();
CompilationUnit unit = result.unit;
var typeProvider = unit.element.context.typeProvider;
@@ -3916,7 +4605,7 @@
''';
addTestFile(content);
- AnalysisResult result = await driver.getResult(testFile);
+ await resolveTestFile();
CompilationUnit unit = result.unit;
var typeProvider = unit.element.context.typeProvider;
@@ -3955,8 +4644,7 @@
''';
addTestFile(content);
- AnalysisResult result = await driver.getResult(testFile);
- var typeProvider = result.unit.element.context.typeProvider;
+ await resolveTestFile();
List<Statement> statements = _getMainStatements(result);
@@ -3990,8 +4678,7 @@
''';
addTestFile(content);
- AnalysisResult result = await driver.getResult(testFile);
- var typeProvider = result.unit.element.context.typeProvider;
+ await resolveTestFile();
List<Statement> statements = _getMainStatements(result);
@@ -4017,9 +4704,8 @@
computation.call;
}
''');
- AnalysisResult result = await driver.getResult(testFile);
+ await resolveTestFile();
expect(result.errors, isEmpty);
- var typeProvider = result.unit.element.context.typeProvider;
FunctionDeclaration main = result.unit.declarations[0];
FunctionElement mainElement = main.element;
@@ -4065,7 +4751,7 @@
my.mySetter = 0;
}
''');
- AnalysisResult result = await driver.getResult(testFile);
+ await resolveTestFile();
// TODO(scheglov) Uncomment and fix "unused imports" hint.
// expect(result.errors, isEmpty);
@@ -4148,7 +4834,7 @@
''';
addTestFile(content);
- AnalysisResult result = await driver.getResult(testFile);
+ await resolveTestFile();
CompilationUnit unit = result.unit;
var typeProvider = unit.element.context.typeProvider;
@@ -4197,7 +4883,7 @@
''';
addTestFile(content);
- AnalysisResult result = await driver.getResult(testFile);
+ await resolveTestFile();
CompilationUnit unit = result.unit;
var typeProvider = unit.element.context.typeProvider;
@@ -4236,7 +4922,7 @@
''';
addTestFile(content);
- AnalysisResult result = await driver.getResult(testFile);
+ await resolveTestFile();
CompilationUnit unit = result.unit;
var typeProvider = unit.element.context.typeProvider;
@@ -4290,7 +4976,7 @@
''';
addTestFile(content);
- AnalysisResult result = await driver.getResult(testFile);
+ await resolveTestFile();
CompilationUnit unit = result.unit;
var typeProvider = unit.element.context.typeProvider;
@@ -4325,7 +5011,7 @@
''';
addTestFile(content);
- AnalysisResult result = await driver.getResult(testFile);
+ await resolveTestFile();
CompilationUnit unit = result.unit;
var typeProvider = unit.element.context.typeProvider;
@@ -4359,12 +5045,10 @@
''';
addTestFile(content);
- AnalysisResult result = await driver.getResult(testFile);
+ await resolveTestFile();
expect(result.path, testFile);
expect(result.errors, isEmpty);
- var typeProvider = result.unit.element.context.typeProvider;
-
FunctionDeclaration main = result.unit.declarations[0];
expect(main.element, isNotNull);
expect(main.name.staticElement, isNotNull);
@@ -4421,7 +5105,7 @@
'''$v''';
}
""");
- AnalysisResult result = await driver.getResult(testFile);
+ await resolveTestFile();
expect(result.errors, isEmpty);
}
@@ -4446,8 +5130,7 @@
}
''';
addTestFile(content);
- AnalysisResult result = await driver.getResult(testFile);
- var typeProvider = result.unit.element.context.typeProvider;
+ await resolveTestFile();
ClassDeclaration aNode = result.unit.declarations[0];
ClassDeclaration bNode = result.unit.declarations[1];
@@ -4562,8 +5245,7 @@
}
''';
addTestFile(content);
- AnalysisResult result = await driver.getResult(testFile);
- var typeProvider = result.unit.element.context.typeProvider;
+ await resolveTestFile();
ClassDeclaration aNode = result.unit.declarations[0];
@@ -4664,8 +5346,7 @@
class D extends A<bool> with B<int> implements C<double> {}
''';
addTestFile(content);
- AnalysisResult result = await driver.getResult(testFile);
- var typeProvider = result.unit.element.context.typeProvider;
+ await resolveTestFile();
ClassDeclaration aNode = result.unit.declarations[0];
ClassElement aElement = aNode.element;
@@ -4728,8 +5409,7 @@
}
''';
addTestFile(content);
- AnalysisResult result = await driver.getResult(testFile);
- var typeProvider = result.unit.element.context.typeProvider;
+ await resolveTestFile();
ClassDeclaration cNode = result.unit.declarations[0];
ClassElement cElement = cNode.element;
@@ -4758,8 +5438,7 @@
class D = A<bool> with B<int> implements C<double>;
''';
addTestFile(content);
- AnalysisResult result = await driver.getResult(testFile);
- var typeProvider = result.unit.element.context.typeProvider;
+ await resolveTestFile();
ClassDeclaration aNode = result.unit.declarations[0];
ClassElement aElement = aNode.element;
@@ -4821,8 +5500,7 @@
}
''';
addTestFile(content);
- AnalysisResult result = await driver.getResult(testFile);
- var typeProvider = result.unit.element.context.typeProvider;
+ await resolveTestFile();
EnumDeclaration enumNode = result.unit.declarations[0];
ClassElement enumElement = enumNode.element;
@@ -4863,10 +5541,9 @@
''';
addTestFile(content);
- AnalysisResult result = await driver.getResult(testFile);
+ await resolveTestFile();
expect(result.path, testFile);
- var typeProvider = result.unit.element.context.typeProvider;
InterfaceType typeType = typeProvider.typeType;
InterfaceType doubleType = typeProvider.doubleType;
InterfaceType intType = typeProvider.intType;
@@ -4992,10 +5669,9 @@
''';
addTestFile(content);
- AnalysisResult result = await driver.getResult(testFile);
+ await resolveTestFile();
expect(result.path, testFile);
- var typeProvider = result.unit.element.context.typeProvider;
InterfaceType doubleType = typeProvider.doubleType;
InterfaceType intType = typeProvider.intType;
ClassElement doubleElement = doubleType.element;
@@ -5095,7 +5771,7 @@
''';
addTestFile(content);
- AnalysisResult result = await driver.getResult(testFile);
+ await resolveTestFile();
CompilationUnit unit = result.unit;
CompilationUnitElement unitElement = unit.element;
var typeProvider = unitElement.context.typeProvider;
@@ -5143,7 +5819,7 @@
''';
addTestFile(content);
- AnalysisResult result = await driver.getResult(testFile);
+ await resolveTestFile();
CompilationUnit unit = result.unit;
CompilationUnitElement unitElement = unit.element;
var typeProvider = unitElement.context.typeProvider;
@@ -5189,7 +5865,7 @@
''';
addTestFile(content);
- AnalysisResult result = await driver.getResult(testFile);
+ await resolveTestFile();
CompilationUnit unit = result.unit;
CompilationUnitElement unitElement = unit.element;
var typeProvider = unitElement.context.typeProvider;
@@ -5232,7 +5908,7 @@
''';
addTestFile(content);
- AnalysisResult result = await driver.getResult(testFile);
+ await resolveTestFile();
CompilationUnit unit = result.unit;
CompilationUnitElement unitElement = unit.element;
var typeProvider = unitElement.context.typeProvider;
@@ -5276,11 +5952,10 @@
''');
String fTypeString = '(int, {b: String, c: bool}) → double';
- AnalysisResult result = await driver.getResult(testFile);
+ await resolveTestFile();
FunctionDeclaration fDeclaration = result.unit.declarations[0];
FunctionElement fElement = fDeclaration.element;
- var typeProvider = result.unit.element.context.typeProvider;
InterfaceType doubleType = typeProvider.doubleType;
expect(fElement, isNotNull);
@@ -5348,7 +6023,7 @@
''';
addTestFile(content);
- AnalysisResult result = await driver.getResult(testFile);
+ await resolveTestFile();
CompilationUnit unit = result.unit;
CompilationUnitElement unitElement = unit.element;
var typeProvider = unitElement.context.typeProvider;
@@ -5381,7 +6056,7 @@
class C<T extends A, U extends List<A>, V> {}
''';
addTestFile(content);
- AnalysisResult result = await driver.getResult(testFile);
+ await resolveTestFile();
CompilationUnit unit = result.unit;
CompilationUnitElement unitElement = unit.element;
var typeProvider = unitElement.context.typeProvider;
@@ -5455,7 +6130,7 @@
try {} on int {}
}
''');
- AnalysisResult result = await driver.getResult(testFile);
+ await resolveTestFile();
CompilationUnit unit = result.unit;
var typeProvider = unit.element.context.typeProvider;
@@ -5557,7 +6232,7 @@
}
''');
- AnalysisResult result = await driver.getResult(testFile);
+ await resolveTestFile();
CompilationUnit unit = result.unit;
CompilationUnitElement unitElement = unit.element;
var typeProvider = unitElement.context.typeProvider;
@@ -5597,7 +6272,7 @@
b.A a1;
c.A a2;
''');
- AnalysisResult result = await driver.getResult(testFile);
+ await resolveTestFile();
CompilationUnit unit = result.unit;
ImportElement bImport = unit.element.library.imports[0];
@@ -5642,7 +6317,7 @@
}
typedef void F(int p);
''');
- AnalysisResult result = await driver.getResult(testFile);
+ await resolveTestFile();
CompilationUnit unit = result.unit;
var typeProvider = unit.element.context.typeProvider;
@@ -5666,6 +6341,1050 @@
}
}
+ test_typeParameter() async {
+ addTestFile(r'''
+class C<T> {
+ get t => T;
+}
+''');
+ await resolveTestFile();
+
+ var identifier = findNode.simple('T;');
+ assertElement(identifier, findElement.typeParameter('T'));
+ assertType(identifier, 'Type');
+ }
+
+ test_unresolved_assignment_left_identifier_compound() async {
+ addTestFile(r'''
+int b;
+main() {
+ a += b;
+}
+''');
+ await resolveTestFile();
+ expect(result.errors, isNotEmpty);
+
+ var assignment = findNode.assignment('a += b');
+ assertElementNull(assignment);
+ assertTypeDynamic(assignment);
+
+ assertElementNull(assignment.leftHandSide);
+ assertTypeDynamic(assignment.leftHandSide);
+
+ assertElement(assignment.rightHandSide, findElement.topGet('b'));
+ assertType(assignment.rightHandSide, 'int');
+ }
+
+ test_unresolved_assignment_left_identifier_simple() async {
+ addTestFile(r'''
+int b;
+main() {
+ a = b;
+}
+''');
+ await resolveTestFile();
+ expect(result.errors, isNotEmpty);
+
+ var assignment = findNode.assignment('a = b');
+ assertElementNull(assignment);
+ if (useCFE) {
+ assertType(assignment, 'int');
+ }
+
+ assertElementNull(assignment.leftHandSide);
+ assertTypeDynamic(assignment.leftHandSide);
+
+ assertElement(assignment.rightHandSide, findElement.topGet('b'));
+ assertType(assignment.rightHandSide, 'int');
+ }
+
+ test_unresolved_assignment_left_indexed1_simple() async {
+ addTestFile(r'''
+int c;
+main() {
+ a[b] = c;
+}
+''');
+ await resolveTestFile();
+ expect(result.errors, isNotEmpty);
+
+ var assignment = findNode.assignment('a[b] = c');
+ assertElementNull(assignment);
+ if (useCFE) {
+ assertType(assignment, 'int');
+ }
+
+ IndexExpression indexed = assignment.leftHandSide;
+ assertElementNull(indexed);
+ assertTypeDynamic(indexed);
+
+ assertElementNull(indexed.target);
+ assertTypeDynamic(indexed.target);
+
+ assertElementNull(indexed.index);
+ assertTypeDynamic(indexed.index);
+
+ assertElement(assignment.rightHandSide, findElement.topGet('c'));
+ assertType(assignment.rightHandSide, 'int');
+ }
+
+ test_unresolved_assignment_left_indexed2_simple() async {
+ addTestFile(r'''
+A a;
+int c;
+main() {
+ a[b] = c;
+}
+class A {}
+''');
+ await resolveTestFile();
+ expect(result.errors, isNotEmpty);
+
+ var assignment = findNode.assignment('a[b] = c');
+ assertElementNull(assignment);
+ if (useCFE) {
+ assertType(assignment, 'int');
+ }
+
+ IndexExpression indexed = assignment.leftHandSide;
+ assertElementNull(indexed);
+ assertTypeDynamic(indexed);
+
+ assertElement(indexed.target, findElement.topGet('a'));
+ assertType(indexed.target, 'A');
+
+ assertElementNull(indexed.index);
+ assertTypeDynamic(indexed.index);
+
+ assertElement(assignment.rightHandSide, findElement.topGet('c'));
+ assertType(assignment.rightHandSide, 'int');
+ }
+
+ test_unresolved_assignment_left_indexed3_simple() async {
+ addTestFile(r'''
+A a;
+int c;
+main() {
+ a[b] = c;
+}
+class A {
+ operator[]=(double b) {}
+}
+''');
+ await resolveTestFile();
+ expect(result.errors, isNotEmpty);
+
+ var assignment = findNode.assignment('a[b] = c');
+ assertElementNull(assignment);
+ if (useCFE) {
+ assertType(assignment, 'int');
+ }
+
+ IndexExpression indexed = assignment.leftHandSide;
+ assertElement(indexed, findElement.method('[]='));
+ assertTypeDynamic(indexed);
+
+ assertElement(indexed.target, findElement.topGet('a'));
+ assertType(indexed.target, 'A');
+
+ assertElementNull(indexed.index);
+ assertTypeDynamic(indexed.index);
+
+ assertElement(assignment.rightHandSide, findElement.topGet('c'));
+ assertType(assignment.rightHandSide, 'int');
+ }
+
+ test_unresolved_assignment_left_indexed4_simple() async {
+ addTestFile(r'''
+double b;
+int c;
+main() {
+ a[b] = c;
+}
+''');
+ await resolveTestFile();
+ expect(result.errors, isNotEmpty);
+
+ var assignment = findNode.assignment('a[b] = c');
+ assertElementNull(assignment);
+ if (useCFE) {
+ assertType(assignment, 'int');
+ }
+
+ IndexExpression indexed = assignment.leftHandSide;
+ assertElementNull(indexed);
+ assertTypeDynamic(indexed);
+
+ assertElementNull(indexed.target);
+ assertTypeDynamic(indexed.target);
+
+ assertElement(indexed.index, findElement.topGet('b'));
+ assertType(indexed.index, 'double');
+
+ assertElement(assignment.rightHandSide, findElement.topGet('c'));
+ assertType(assignment.rightHandSide, 'int');
+ }
+
+ test_unresolved_assignment_left_prefixed1_simple() async {
+ addTestFile(r'''
+int c;
+main() {
+ a.b = c;
+}
+''');
+ await resolveTestFile();
+ expect(result.errors, isNotEmpty);
+
+ var assignment = findNode.assignment('a.b = c');
+ assertElementNull(assignment);
+ if (useCFE) {
+ assertType(assignment, 'int');
+ }
+
+ PrefixedIdentifier prefixed = assignment.leftHandSide;
+ assertElementNull(prefixed);
+ assertTypeDynamic(prefixed);
+
+ assertElementNull(prefixed.prefix);
+ assertTypeDynamic(prefixed.prefix);
+
+ assertElementNull(prefixed.identifier);
+ assertTypeDynamic(prefixed.identifier);
+
+ assertElement(assignment.rightHandSide, findElement.topGet('c'));
+ assertType(assignment.rightHandSide, 'int');
+ }
+
+ test_unresolved_assignment_left_prefixed2_simple() async {
+ addTestFile(r'''
+class A {}
+A a;
+int c;
+main() {
+ a.b = c;
+}
+''');
+ await resolveTestFile();
+ expect(result.errors, isNotEmpty);
+
+ var assignment = findNode.assignment('a.b = c');
+ assertElementNull(assignment);
+ if (useCFE) {
+ assertType(assignment, 'int');
+ }
+
+ PrefixedIdentifier prefixed = assignment.leftHandSide;
+ assertElementNull(prefixed);
+ assertTypeDynamic(prefixed);
+
+ assertElement(prefixed.prefix, findElement.topGet('a'));
+ assertType(prefixed.prefix, 'A');
+
+ assertElementNull(prefixed.identifier);
+ assertTypeDynamic(prefixed.identifier);
+
+ assertElement(assignment.rightHandSide, findElement.topGet('c'));
+ assertType(assignment.rightHandSide, 'int');
+ }
+
+ test_unresolved_assignment_left_property1_simple() async {
+ addTestFile(r'''
+int d;
+main() {
+ a.b.c = d;
+}
+''');
+ await resolveTestFile();
+ expect(result.errors, isNotEmpty);
+
+ var assignment = findNode.assignment('a.b.c = d');
+ assertElementNull(assignment);
+ if (useCFE) {
+ assertType(assignment, 'int');
+ }
+
+ PropertyAccess access = assignment.leftHandSide;
+ assertTypeDynamic(access);
+
+ PrefixedIdentifier prefixed = access.target;
+ assertElementNull(prefixed);
+ assertTypeDynamic(prefixed);
+
+ assertElementNull(prefixed.prefix);
+ assertTypeDynamic(prefixed.prefix);
+
+ assertElementNull(prefixed.identifier);
+ assertTypeDynamic(prefixed.identifier);
+
+ assertElementNull(access.propertyName);
+ assertTypeDynamic(access.propertyName);
+
+ assertElement(assignment.rightHandSide, findElement.topGet('d'));
+ assertType(assignment.rightHandSide, 'int');
+ }
+
+ test_unresolved_assignment_left_property2_simple() async {
+ addTestFile(r'''
+A a;
+int d;
+main() {
+ a.b.c = d;
+}
+class A {}
+''');
+ await resolveTestFile();
+ expect(result.errors, isNotEmpty);
+
+ var assignment = findNode.assignment('a.b.c = d');
+ assertElementNull(assignment);
+ if (useCFE) {
+ assertType(assignment, 'int');
+ }
+
+ PropertyAccess access = assignment.leftHandSide;
+ assertTypeDynamic(access);
+
+ PrefixedIdentifier prefixed = access.target;
+ assertElementNull(prefixed);
+ assertTypeDynamic(prefixed);
+
+ assertElement(prefixed.prefix, findElement.topGet('a'));
+ assertType(prefixed.prefix, 'A');
+
+ assertElementNull(prefixed.identifier);
+ assertTypeDynamic(prefixed.identifier);
+
+ assertElementNull(access.propertyName);
+ assertTypeDynamic(access.propertyName);
+
+ assertElement(assignment.rightHandSide, findElement.topGet('d'));
+ assertType(assignment.rightHandSide, 'int');
+ }
+
+ test_unresolved_assignment_left_property3_simple() async {
+ addTestFile(r'''
+A a;
+int d;
+main() {
+ a.b.c = d;
+}
+class A { B b; }
+class B {}
+''');
+ await resolveTestFile();
+ expect(result.errors, isNotEmpty);
+ var bElement = findElement.field('b');
+
+ var assignment = findNode.assignment('a.b.c = d');
+ assertElementNull(assignment);
+ if (useCFE) {
+ assertType(assignment, 'int');
+ }
+
+ PropertyAccess access = assignment.leftHandSide;
+ assertTypeDynamic(access);
+
+ PrefixedIdentifier prefixed = access.target;
+ assertElement(prefixed, bElement.getter);
+ assertType(prefixed, 'B');
+
+ assertElement(prefixed.prefix, findElement.topGet('a'));
+ assertType(prefixed.prefix, 'A');
+
+ assertElement(prefixed.identifier, bElement.getter);
+ assertType(prefixed.identifier, 'B');
+
+ assertElementNull(access.propertyName);
+ assertTypeDynamic(access.propertyName);
+
+ assertElement(assignment.rightHandSide, findElement.topGet('d'));
+ assertType(assignment.rightHandSide, 'int');
+ }
+
+ test_unresolved_instanceCreation_name_11() async {
+ addTestFile(r'''
+int arg1, arg2;
+main() {
+ new Foo<int, double>(arg1, p2: arg2);
+}
+''');
+ await resolveTestFile();
+ expect(result.errors, isNotEmpty);
+
+ List<Statement> statements = _getMainStatements(result);
+ ExpressionStatement statement = statements[0];
+
+ InstanceCreationExpression creation = statement.expression;
+ if (useCFE) {
+ expect(creation.staticType, isDynamicType);
+ }
+
+ ConstructorName constructorName = creation.constructorName;
+ expect(constructorName.name, isNull);
+
+ TypeName typeName = constructorName.type;
+ if (useCFE) {
+ expect(typeName.type, isDynamicType);
+ }
+
+ SimpleIdentifier typeIdentifier = typeName.name;
+ expect(typeIdentifier.staticElement, isNull);
+ if (useCFE) {
+ expect(typeIdentifier.staticType, isDynamicType);
+ }
+
+ assertTypeArguments(typeName.typeArguments, [intType, doubleType]);
+ _assertInvocationArguments(creation.argumentList,
+ [checkTopVarRef('arg1'), checkTopVarUndefinedNamedRef('arg2')]);
+ }
+
+ test_unresolved_instanceCreation_name_21() async {
+ addTestFile(r'''
+int arg1, arg2;
+main() {
+ new foo.Bar<int, double>(arg1, p2: arg2);
+}
+''');
+ await resolveTestFile();
+ expect(result.errors, isNotEmpty);
+
+ List<Statement> statements = _getMainStatements(result);
+ ExpressionStatement statement = statements[0];
+
+ InstanceCreationExpression creation = statement.expression;
+ if (useCFE) {
+ expect(creation.staticType, isDynamicType);
+ }
+
+ ConstructorName constructorName = creation.constructorName;
+ expect(constructorName.name, isNull);
+
+ TypeName typeName = constructorName.type;
+ if (useCFE) {
+ expect(typeName.type, isDynamicType);
+ }
+
+ PrefixedIdentifier typePrefixed = typeName.name;
+ expect(typePrefixed.staticElement, isNull);
+ if (useCFE) {
+ expect(typePrefixed.staticType, isDynamicType);
+ }
+
+ SimpleIdentifier typePrefix = typePrefixed.prefix;
+ expect(typePrefix.staticElement, isNull);
+ if (useCFE) {
+ expect(typePrefix.staticType, isDynamicType);
+ }
+
+ SimpleIdentifier typeIdentifier = typePrefixed.identifier;
+ expect(typeIdentifier.staticElement, isNull);
+ if (useCFE) {
+ expect(typePrefix.staticType, isDynamicType);
+ }
+
+ assertTypeArguments(typeName.typeArguments, [intType, doubleType]);
+ _assertInvocationArguments(creation.argumentList,
+ [checkTopVarRef('arg1'), checkTopVarUndefinedNamedRef('arg2')]);
+ }
+
+ test_unresolved_instanceCreation_name_22() async {
+ addTestFile(r'''
+import 'dart:math' as foo;
+int arg1, arg2;
+main() {
+ new foo.Bar<int, double>(arg1, p2: arg2);
+}
+''');
+ await resolveTestFile();
+ expect(result.errors, isNotEmpty);
+
+ var unitElement = result.unit.element;
+ var foo = unitElement.library.imports[0].prefix;
+
+ List<Statement> statements = _getMainStatements(result);
+ ExpressionStatement statement = statements[0];
+
+ InstanceCreationExpression creation = statement.expression;
+ if (useCFE) {
+ expect(creation.staticType, isDynamicType);
+ }
+
+ ConstructorName constructorName = creation.constructorName;
+ expect(constructorName.name, isNull);
+
+ TypeName typeName = constructorName.type;
+ if (useCFE) {
+ expect(typeName.type, isDynamicType);
+ }
+
+ PrefixedIdentifier typePrefixed = typeName.name;
+ expect(typePrefixed.staticElement, isNull);
+ if (useCFE) {
+ expect(typePrefixed.staticType, isDynamicType);
+ }
+
+ SimpleIdentifier typePrefix = typePrefixed.prefix;
+ expect(typePrefix.staticElement, same(foo));
+ expect(typePrefix.staticType, isNull);
+
+ SimpleIdentifier typeIdentifier = typePrefixed.identifier;
+ expect(typeIdentifier.staticElement, isNull);
+ if (useCFE) {
+ expect(typePrefix.staticType, isDynamicType);
+ }
+
+ assertTypeArguments(typeName.typeArguments, [intType, doubleType]);
+ _assertInvocationArguments(creation.argumentList,
+ [checkTopVarRef('arg1'), checkTopVarUndefinedNamedRef('arg2')]);
+ }
+
+ test_unresolved_instanceCreation_name_31() async {
+ addTestFile(r'''
+int arg1, arg2;
+main() {
+ new foo.Bar<int, double>.baz(arg1, p2: arg2);
+}
+''');
+ await resolveTestFile();
+ expect(result.errors, isNotEmpty);
+
+ List<Statement> statements = _getMainStatements(result);
+ ExpressionStatement statement = statements[0];
+
+ InstanceCreationExpression creation = statement.expression;
+ if (useCFE) {
+ expect(creation.staticType, isDynamicType);
+ }
+
+ ConstructorName constructorName = creation.constructorName;
+
+ TypeName typeName = constructorName.type;
+ if (useCFE) {
+ expect(typeName.type, isDynamicType);
+ }
+
+ PrefixedIdentifier typePrefixed = typeName.name;
+ expect(typePrefixed.staticElement, isNull);
+ if (useCFE) {
+ expect(typePrefixed.staticType, isDynamicType);
+ }
+
+ SimpleIdentifier typePrefix = typePrefixed.prefix;
+ expect(typePrefix.staticElement, isNull);
+ if (useCFE) {
+ expect(typePrefix.staticType, isDynamicType);
+ }
+
+ SimpleIdentifier typeIdentifier = typePrefixed.identifier;
+ expect(typeIdentifier.staticElement, isNull);
+ if (useCFE) {
+ expect(typePrefix.staticType, isDynamicType);
+ }
+
+ expect(constructorName.name.staticElement, isNull);
+ if (useCFE) {
+ expect(constructorName.name.staticType, isDynamicType);
+ }
+
+ assertTypeArguments(typeName.typeArguments, [intType, doubleType]);
+ _assertInvocationArguments(creation.argumentList,
+ [checkTopVarRef('arg1'), checkTopVarUndefinedNamedRef('arg2')]);
+ }
+
+ test_unresolved_instanceCreation_name_32() async {
+ addTestFile(r'''
+import 'dart:math' as foo;
+int arg1, arg2;
+main() {
+ new foo.Bar<int, double>.baz(arg1, p2: arg2);
+}
+''');
+ await resolveTestFile();
+ expect(result.errors, isNotEmpty);
+
+ var unitElement = result.unit.element;
+ var mathImport = unitElement.library.imports[0];
+ var foo = mathImport.prefix;
+
+ List<Statement> statements = _getMainStatements(result);
+ ExpressionStatement statement = statements[0];
+
+ InstanceCreationExpression creation = statement.expression;
+ if (useCFE) {
+ expect(creation.staticType, isDynamicType);
+ }
+
+ ConstructorName constructorName = creation.constructorName;
+
+ TypeName typeName = constructorName.type;
+ if (useCFE) {
+ expect(typeName.type, isDynamicType);
+ }
+
+ PrefixedIdentifier typePrefixed = typeName.name;
+ expect(typePrefixed.staticElement, isNull);
+ if (useCFE) {
+ expect(typePrefixed.staticType, isDynamicType);
+ }
+
+ SimpleIdentifier typePrefix = typePrefixed.prefix;
+ expect(typePrefix.staticElement, same(foo));
+ expect(typePrefix.staticType, isNull);
+
+ SimpleIdentifier typeIdentifier = typePrefixed.identifier;
+ expect(typeIdentifier.staticElement, isNull);
+ if (useCFE) {
+ expect(typePrefix.staticType, isNull);
+ }
+
+ expect(constructorName.name.staticElement, isNull);
+ expect(constructorName.name.staticType, isNull);
+
+ assertTypeArguments(typeName.typeArguments, [intType, doubleType]);
+ _assertInvocationArguments(creation.argumentList,
+ [checkTopVarRef('arg1'), checkTopVarUndefinedNamedRef('arg2')]);
+ }
+
+ test_unresolved_instanceCreation_name_33() async {
+ addTestFile(r'''
+import 'dart:math' as foo;
+int arg1, arg2;
+main() {
+ new foo.Random<int, double>.baz(arg1, p2: arg2);
+}
+''');
+ await resolveTestFile();
+ expect(result.errors, isNotEmpty);
+
+ var unitElement = result.unit.element;
+ var mathImport = unitElement.library.imports[0];
+ var foo = mathImport.prefix;
+ var randomElement = mathImport.importedLibrary.getType('Random');
+
+ List<Statement> statements = _getMainStatements(result);
+ ExpressionStatement statement = statements[0];
+
+ InstanceCreationExpression creation = statement.expression;
+ if (useCFE) {
+ expect(creation.staticType, isDynamicType);
+ }
+
+ ConstructorName constructorName = creation.constructorName;
+
+ TypeName typeName = constructorName.type;
+ if (useCFE) {
+ expect(typeName.type, isDynamicType);
+ }
+
+ PrefixedIdentifier typePrefixed = typeName.name;
+ expect(typePrefixed.staticElement, same(randomElement));
+ expect(typePrefixed.staticType, randomElement.type);
+
+ SimpleIdentifier typePrefix = typePrefixed.prefix;
+ expect(typePrefix.staticElement, same(foo));
+ expect(typePrefix.staticType, isNull);
+
+ SimpleIdentifier typeIdentifier = typePrefixed.identifier;
+ expect(typeIdentifier.staticElement, same(randomElement));
+ expect(typePrefix.staticType, isNull);
+
+ expect(constructorName.name.staticElement, isNull);
+ expect(constructorName.name.staticType, isNull);
+
+ assertTypeArguments(typeName.typeArguments, [intType, doubleType]);
+ _assertInvocationArguments(creation.argumentList,
+ [checkTopVarRef('arg1'), checkTopVarUndefinedNamedRef('arg2')]);
+ }
+
+ test_unresolved_methodInvocation_noTarget() async {
+ addTestFile(r'''
+int arg1, arg2;
+main() {
+ bar<int, double>(arg1, p2: arg2);
+}
+''');
+ await resolveTestFile();
+ expect(result.errors, isNotEmpty);
+
+ List<Statement> statements = _getMainStatements(result);
+ ExpressionStatement statement = statements[0];
+
+ MethodInvocation invocation = statement.expression;
+ expect(invocation.target, isNull);
+ expect(invocation.staticType, isDynamicType);
+ expect(invocation.staticInvokeType, isDynamicType);
+
+ SimpleIdentifier name = invocation.methodName;
+ expect(name.staticElement, isNull);
+ expect(name.staticType, isDynamicType);
+
+ assertTypeArguments(invocation.typeArguments, [intType, doubleType]);
+ _assertInvocationArguments(invocation.argumentList,
+ [checkTopVarRef('arg1'), checkTopVarUndefinedNamedRef('arg2')]);
+ }
+
+ test_unresolved_methodInvocation_target_resolved() async {
+ addTestFile(r'''
+Object foo;
+int arg1, arg2;
+main() {
+ foo.bar<int, double>(arg1, p2: arg2);
+}
+''');
+ await resolveTestFile();
+ expect(result.errors, isNotEmpty);
+
+ TopLevelVariableElement foo = _getTopLevelVariable(result, 'foo');
+
+ List<Statement> statements = _getMainStatements(result);
+ ExpressionStatement statement = statements[0];
+
+ MethodInvocation invocation = statement.expression;
+ expect(invocation.staticType, isDynamicType);
+ if (useCFE) {
+ // TODO(scheglov) https://github.com/dart-lang/sdk/issues/33682
+ expect(invocation.staticInvokeType.toString(), '() → dynamic');
+ } else {
+ expect(invocation.staticInvokeType, isDynamicType);
+ }
+
+ SimpleIdentifier target = invocation.target;
+ expect(target.staticElement, same(foo.getter));
+ expect(target.staticType, typeProvider.objectType);
+
+ SimpleIdentifier name = invocation.methodName;
+ expect(name.staticElement, isNull);
+ if (useCFE) {
+ // TODO(scheglov) https://github.com/dart-lang/sdk/issues/33682
+ expect(name.staticType.toString(), '() → dynamic');
+ } else {
+ expect(name.staticType, isDynamicType);
+ }
+
+ assertTypeArguments(invocation.typeArguments, [intType, doubleType]);
+ _assertInvocationArguments(invocation.argumentList,
+ [checkTopVarRef('arg1'), checkTopVarUndefinedNamedRef('arg2')]);
+ }
+
+ test_unresolved_methodInvocation_target_unresolved() async {
+ addTestFile(r'''
+int arg1, arg2;
+main() {
+ foo.bar<int, double>(arg1, p2: arg2);
+}
+''');
+ await resolveTestFile();
+ expect(result.errors, isNotEmpty);
+
+ List<Statement> statements = _getMainStatements(result);
+ ExpressionStatement statement = statements[0];
+
+ MethodInvocation invocation = statement.expression;
+ expect(invocation.staticType, isDynamicType);
+ expect(invocation.staticInvokeType, isDynamicType);
+
+ SimpleIdentifier target = invocation.target;
+ expect(target.staticElement, isNull);
+ expect(target.staticType, isDynamicType);
+
+ SimpleIdentifier name = invocation.methodName;
+ expect(name.staticElement, isNull);
+ expect(name.staticType, isDynamicType);
+
+ assertTypeArguments(invocation.typeArguments, [intType, doubleType]);
+ _assertInvocationArguments(invocation.argumentList,
+ [checkTopVarRef('arg1'), checkTopVarUndefinedNamedRef('arg2')]);
+ }
+
+ test_unresolved_postfix_operand() async {
+ addTestFile(r'''
+main() {
+ a++;
+}
+''');
+ await resolveTestFile();
+ expect(result.errors, isNotEmpty);
+
+ var postfix = findNode.postfix('a++');
+ assertElementNull(postfix);
+ assertTypeDynamic(postfix);
+
+ SimpleIdentifier aRef = postfix.operand;
+ assertElementNull(aRef);
+ assertTypeDynamic(aRef);
+ }
+
+ test_unresolved_postfix_operator() async {
+ addTestFile(r'''
+A a;
+main() {
+ a++;
+}
+class A {}
+''');
+ await resolveTestFile();
+ expect(result.errors, isNotEmpty);
+
+ var postfix = findNode.postfix('a++');
+ assertElementNull(postfix);
+ assertType(postfix, 'A');
+
+ SimpleIdentifier aRef = postfix.operand;
+ assertElement(aRef, findElement.topSet('a'));
+ assertType(aRef, 'A');
+ }
+
+ test_unresolved_prefix_operand() async {
+ addTestFile(r'''
+main() {
+ ++a;
+}
+''');
+ await resolveTestFile();
+ expect(result.errors, isNotEmpty);
+
+ var prefix = findNode.prefix('++a');
+ assertElementNull(prefix);
+ assertTypeDynamic(prefix);
+
+ SimpleIdentifier aRef = prefix.operand;
+ assertElementNull(aRef);
+ assertTypeDynamic(aRef);
+ }
+
+ test_unresolved_prefix_operator() async {
+ addTestFile(r'''
+A a;
+main() {
+ ++a;
+}
+class A {}
+''');
+ await resolveTestFile();
+ expect(result.errors, isNotEmpty);
+
+ var prefix = findNode.prefix('++a');
+ assertElementNull(prefix);
+ assertTypeDynamic(prefix);
+
+ SimpleIdentifier aRef = prefix.operand;
+ assertElement(aRef, findElement.topSet('a'));
+ assertType(aRef, 'A');
+ }
+
+ test_unresolved_prefixedIdentifier_identifier() async {
+ addTestFile(r'''
+Object foo;
+main() {
+ foo.bar;
+}
+''');
+ await resolveTestFile();
+ expect(result.errors, isNotEmpty);
+
+ TopLevelVariableElement foo = _getTopLevelVariable(result, 'foo');
+
+ List<Statement> statements = _getMainStatements(result);
+ ExpressionStatement statement = statements[0];
+
+ PrefixedIdentifier prefixed = statement.expression;
+ expect(prefixed.staticElement, isNull);
+ expect(prefixed.staticType, isDynamicType);
+
+ SimpleIdentifier prefix = prefixed.prefix;
+ expect(prefix.staticElement, same(foo.getter));
+ expect(prefix.staticType, typeProvider.objectType);
+
+ SimpleIdentifier identifier = prefixed.identifier;
+ expect(identifier.staticElement, isNull);
+ expect(identifier.staticType, isDynamicType);
+ }
+
+ test_unresolved_prefixedIdentifier_prefix() async {
+ addTestFile(r'''
+main() {
+ foo.bar;
+}
+''');
+ await resolveTestFile();
+ expect(result.errors, isNotEmpty);
+
+ List<Statement> statements = _getMainStatements(result);
+ ExpressionStatement statement = statements[0];
+
+ PrefixedIdentifier prefixed = statement.expression;
+ expect(prefixed.staticElement, isNull);
+ expect(prefixed.staticType, isDynamicType);
+
+ SimpleIdentifier prefix = prefixed.prefix;
+ expect(prefix.staticElement, isNull);
+ expect(prefix.staticType, isDynamicType);
+
+ SimpleIdentifier identifier = prefixed.identifier;
+ expect(identifier.staticElement, isNull);
+ expect(identifier.staticType, isDynamicType);
+ }
+
+ test_unresolved_propertyAccess_1() async {
+ addTestFile(r'''
+main() {
+ foo.bar.baz;
+}
+''');
+ await resolveTestFile();
+ expect(result.errors, isNotEmpty);
+
+ List<Statement> statements = _getMainStatements(result);
+ ExpressionStatement statement = statements[0];
+
+ PropertyAccess propertyAccess = statement.expression;
+ expect(propertyAccess.staticType, isDynamicType);
+
+ {
+ PrefixedIdentifier prefixed = propertyAccess.target;
+ expect(prefixed.staticElement, isNull);
+ expect(prefixed.staticType, isDynamicType);
+
+ SimpleIdentifier prefix = prefixed.prefix;
+ expect(prefix.staticElement, isNull);
+ expect(prefix.staticType, isDynamicType);
+
+ SimpleIdentifier identifier = prefixed.identifier;
+ expect(identifier.staticElement, isNull);
+ expect(identifier.staticType, isDynamicType);
+ }
+
+ SimpleIdentifier property = propertyAccess.propertyName;
+ expect(property.staticElement, isNull);
+ expect(property.staticType, isDynamicType);
+ }
+
+ test_unresolved_propertyAccess_2() async {
+ addTestFile(r'''
+Object foo;
+main() {
+ foo.bar.baz;
+}
+''');
+ await resolveTestFile();
+ expect(result.errors, isNotEmpty);
+
+ TopLevelVariableElement foo = _getTopLevelVariable(result, 'foo');
+
+ List<Statement> statements = _getMainStatements(result);
+ ExpressionStatement statement = statements[0];
+
+ PropertyAccess propertyAccess = statement.expression;
+ expect(propertyAccess.staticType, isDynamicType);
+
+ {
+ PrefixedIdentifier prefixed = propertyAccess.target;
+ expect(prefixed.staticElement, isNull);
+ expect(prefixed.staticType, isDynamicType);
+
+ SimpleIdentifier prefix = prefixed.prefix;
+ expect(prefix.staticElement, same(foo.getter));
+ expect(prefix.staticType, typeProvider.objectType);
+
+ SimpleIdentifier identifier = prefixed.identifier;
+ expect(identifier.staticElement, isNull);
+ expect(identifier.staticType, isDynamicType);
+ }
+
+ SimpleIdentifier property = propertyAccess.propertyName;
+ expect(property.staticElement, isNull);
+ expect(property.staticType, isDynamicType);
+ }
+
+ test_unresolved_propertyAccess_3() async {
+ addTestFile(r'''
+Object foo;
+main() {
+ foo.hashCode.baz;
+}
+''');
+ await resolveTestFile();
+ expect(result.errors, isNotEmpty);
+
+ PropertyAccessorElement objectHashCode =
+ typeProvider.objectType.getGetter('hashCode');
+ TopLevelVariableElement foo = _getTopLevelVariable(result, 'foo');
+
+ List<Statement> statements = _getMainStatements(result);
+ ExpressionStatement statement = statements[0];
+
+ PropertyAccess propertyAccess = statement.expression;
+ expect(propertyAccess.staticType, isDynamicType);
+
+ {
+ PrefixedIdentifier prefixed = propertyAccess.target;
+ expect(prefixed.staticElement, same(objectHashCode));
+ expect(prefixed.staticType, typeProvider.intType);
+
+ SimpleIdentifier prefix = prefixed.prefix;
+ expect(prefix.staticElement, same(foo.getter));
+ expect(prefix.staticType, typeProvider.objectType);
+
+ SimpleIdentifier identifier = prefixed.identifier;
+ expect(identifier.staticElement, same(objectHashCode));
+ expect(identifier.staticType, typeProvider.intType);
+ }
+
+ SimpleIdentifier property = propertyAccess.propertyName;
+ expect(property.staticElement, isNull);
+ expect(property.staticType, isDynamicType);
+ }
+
+ test_unresolved_simpleIdentifier() async {
+ addTestFile(r'''
+main() {
+ foo;
+}
+''');
+ await resolveTestFile();
+ expect(result.errors, isNotEmpty);
+
+ List<Statement> statements = _getMainStatements(result);
+ ExpressionStatement statement = statements[0];
+ SimpleIdentifier identifier = statement.expression;
+ expect(identifier.staticElement, isNull);
+ expect(identifier.staticType, isDynamicType);
+ }
+
+ test_unresolved_static_call() async {
+ addTestFile('''
+class C {
+ static f() => C.g();
+}
+''');
+ await resolveTestFile();
+ expect(result.errors, isNotEmpty);
+
+ var g = findNode.simple('g()');
+ assertElementNull(g);
+ assertTypeDynamic(g);
+ var invocation = g.parent as MethodInvocation;
+ assertTypeDynamic(invocation);
+ expect(invocation.staticInvokeType, isDynamicType);
+ }
+
+ test_unresolved_static_call_same_name_as_type_param() async {
+ addTestFile('''
+class C<T> {
+ static f() => C.T();
+}
+''');
+ await resolveTestFile();
+ expect(result.errors, isNotEmpty);
+
+ var t = findNode.simple('T()');
+ assertElementNull(t);
+ assertTypeDynamic(t);
+ var invocation = t.parent as MethodInvocation;
+ assertTypeDynamic(invocation);
+ expect(invocation.staticInvokeType, isDynamicType);
+ }
+
/// Assert that the [argument] is associated with the [expectedParameter],
/// if [useCFE] is `null`. If the [argument] is a [NamedExpression],
/// the name must be resolved to the parameter in both cases.
@@ -5721,6 +7440,16 @@
}
}
+ /// Test that [argumentList] has exactly two arguments - required `arg1`, and
+ /// unresolved named `arg2`, both are the reference to top-level variables.
+ void _assertInvocationArguments(ArgumentList argumentList,
+ List<void Function(Expression)> argumentCheckers) {
+ expect(argumentList.arguments, hasLength(argumentCheckers.length));
+ for (int i = 0; i < argumentCheckers.length; i++) {
+ argumentCheckers[i](argumentList.arguments[i]);
+ }
+ }
+
void _assertParameterElement(ParameterElement element,
{String name, int offset, ParameterKind kind, DartType type}) {
expect(element, isNotNull);
@@ -5771,8 +7500,158 @@
fail('Not found main() in ${result.unit}');
}
+ TopLevelVariableElement _getTopLevelVariable(
+ AnalysisResult result, String name) {
+ for (var variable in result.unit.element.topLevelVariables) {
+ if (variable.name == name) {
+ return variable;
+ }
+ }
+ fail('Not found $name');
+ }
+
/**
* Return the [provider] specific path for the given Posix [path].
*/
String _p(String path) => provider.convertPath(path);
}
+
+class FindElement {
+ final AnalysisResult result;
+
+ FindElement(this.result);
+
+ CompilationUnitElement get unitElement => result.unit.element;
+
+ FieldElement field(String name) {
+ for (var type in unitElement.types) {
+ for (var field in type.fields) {
+ if (field.name == name) {
+ return field;
+ }
+ }
+ }
+ fail('Not found class field: $name');
+ }
+
+ FunctionElement function(String name) {
+ for (var function in unitElement.functions) {
+ if (function.name == name) {
+ return function;
+ }
+ }
+ fail('Not found top-level function: $name');
+ }
+
+ PropertyAccessorElement getter(String name) {
+ for (var class_ in unitElement.types) {
+ for (var accessor in class_.accessors) {
+ if (accessor.isGetter && accessor.name == name) {
+ return accessor;
+ }
+ }
+ }
+ fail('Not found class accessor: $name');
+ }
+
+ MethodElement method(String name) {
+ for (var type in unitElement.types) {
+ for (var method in type.methods) {
+ if (method.name == name) {
+ return method;
+ }
+ }
+ }
+ fail('Not found class method: $name');
+ }
+
+ PrefixElement prefix(String name) {
+ for (var import_ in unitElement.library.imports) {
+ var prefix = import_.prefix;
+ if (prefix != null && prefix.name == name) {
+ return prefix;
+ }
+ }
+ fail('Prefix not found: $name');
+ }
+
+ PropertyAccessorElement topGet(String name) {
+ return topVar(name).getter;
+ }
+
+ PropertyAccessorElement topSet(String name) {
+ return topVar(name).setter;
+ }
+
+ TopLevelVariableElement topVar(String name) {
+ for (var variable in unitElement.topLevelVariables) {
+ if (variable.name == name) {
+ return variable;
+ }
+ }
+ fail('Not found top-level variable: $name');
+ }
+
+ TypeParameterElement typeParameter(String name) {
+ for (var type in unitElement.types) {
+ for (var parameter in type.typeParameters) {
+ if (parameter.name == name) {
+ return parameter;
+ }
+ }
+ }
+ fail('Not found type parameter: $name');
+ }
+}
+
+class FindNode {
+ final AnalysisResult result;
+
+ FindNode(this.result);
+
+ AssignmentExpression assignment(String search) {
+ return _node(search).getAncestor((n) => n is AssignmentExpression);
+ }
+
+ CascadeExpression cascade(String search) {
+ return _node(search).getAncestor((n) => n is CascadeExpression);
+ }
+
+ FunctionExpression functionExpression(String search) {
+ return _node(search).getAncestor((n) => n is FunctionExpression);
+ }
+
+ InstanceCreationExpression instanceCreation(String search) {
+ return _node(search).getAncestor((n) => n is InstanceCreationExpression);
+ }
+
+ MethodInvocation methodInvocation(String search) {
+ return _node(search).getAncestor((n) => n is MethodInvocation);
+ }
+
+ PostfixExpression postfix(String search) {
+ return _node(search).getAncestor((n) => n is PostfixExpression);
+ }
+
+ PrefixExpression prefix(String search) {
+ return _node(search).getAncestor((n) => n is PrefixExpression);
+ }
+
+ SimpleIdentifier simple(String search) {
+ return _node(search);
+ }
+
+ VariableDeclaration variableDeclaration(String search) {
+ return _node(search).getAncestor((n) => n is VariableDeclaration);
+ }
+
+ AstNode _node(String search) {
+ var content = result.content;
+ var index = content.indexOf(search);
+ if (content.indexOf(search, index + 1) != -1) {
+ fail('The pattern |$search| is not unique in:\n$content');
+ }
+ expect(index, greaterThanOrEqualTo(0));
+ return new NodeLocator2(index).searchWithin(result.unit);
+ }
+}
diff --git a/pkg/analyzer/test/src/dart/analysis/driver_test.dart b/pkg/analyzer/test/src/dart/analysis/driver_test.dart
index 30d31dd..5212d5e 100644
--- a/pkg/analyzer/test/src/dart/analysis/driver_test.dart
+++ b/pkg/analyzer/test/src/dart/analysis/driver_test.dart
@@ -1739,7 +1739,7 @@
ClassDeclaration c = result.unit.declarations[1] as ClassDeclaration;
Annotation a = c.metadata[0];
expect(a.name.name, 'fff');
- expect(a.name.staticElement, new isInstanceOf<FunctionElement>());
+ expect(a.name.staticElement, new TypeMatcher<FunctionElement>());
}
test_getResult_invalidUri() async {
diff --git a/pkg/analyzer/test/src/dart/analysis/search_test.dart b/pkg/analyzer/test/src/dart/analysis/search_test.dart
index d3573f1..9ee10f7 100644
--- a/pkg/analyzer/test/src/dart/analysis/search_test.dart
+++ b/pkg/analyzer/test/src/dart/analysis/search_test.dart
@@ -448,6 +448,55 @@
assertHasResult(b, 'b', not: true);
}
+ test_references_discover_onlyOwned_samePath() async {
+ var p = _p('/test/lib/t.dart');
+ provider.newFile(p, 'int t;');
+
+ var driver1 = createAnalysisDriver(packageMap: {
+ 'test': [provider.newFolder(_p('/test/lib'))]
+ });
+ var driver2 = createAnalysisDriver(packageMap: {});
+
+ var searchedFiles = new SearchedFiles();
+ searchedFiles.ownAdded(driver1.search);
+ searchedFiles.ownAdded(driver2.search); // does not own any file, but...
+
+ // driver1 owns both path and URI.
+ expect(searchedFiles.add(p, driver1.search), isTrue);
+
+ // The path is already owned by driver1, so cannot be handled in driver2.
+ expect(searchedFiles.add(p, driver2.search), isFalse);
+ }
+
+ test_references_discover_onlyOwned_sameUri() async {
+ var a = _p('/aaa/lib/t.dart');
+ var b = _p('/bbb/lib/t.dart');
+
+ provider.newFile(a, 'int t;');
+ provider.newFile(b, 'double t;');
+
+ var driver1 = createAnalysisDriver(packageMap: {
+ 'ttt': [provider.newFolder(_p('/aaa/lib'))]
+ });
+ var driver2 = createAnalysisDriver(packageMap: {
+ 'ttt': [provider.newFolder(_p('/bbb/lib'))]
+ });
+
+ // driver1 owns `/aaa/lib/t.dart` with `package:ttt/t.dart`.
+ driver1.addFile(a);
+
+ var searchedFiles = new SearchedFiles();
+
+ searchedFiles.ownAdded(driver1.search);
+ searchedFiles.ownAdded(driver2.search); // does not own any file, but...
+
+ // driver1 owns both path and URI.
+ expect(searchedFiles.add(a, driver1.search), isTrue);
+
+ // The URI is already owned by driver1, so cannot be handled in driver2.
+ expect(searchedFiles.add(b, driver2.search), isFalse);
+ }
+
test_searchMemberReferences_qualified_resolved() async {
await _resolveTestUnit('''
class C {
@@ -1646,23 +1695,6 @@
}
}
- test_subtypes_partWithoutLibrary() async {
- await _resolveTestUnit('''
-part of lib;
-
-class A {}
-class B extends A {}
-''');
- ClassElement a = _findElement('A');
-
- List<SubtypeResult> subtypes = await driver.search.subtypes(type: a);
- expect(subtypes, hasLength(1));
-
- SubtypeResult b = subtypes.singleWhere((r) => r.name == 'B');
- expect(b.libraryUri, testUri);
- expect(b.id, '$testUri;$testUri;B');
- }
-
test_subtypes_discover() async {
var pathT = _p('/test/lib/t.dart');
var pathA = _p('/aaa/lib/a.dart');
@@ -1790,6 +1822,23 @@
expect(c.id, endsWith('c.dart;C'));
}
+ test_subtypes_partWithoutLibrary() async {
+ await _resolveTestUnit('''
+part of lib;
+
+class A {}
+class B extends A {}
+''');
+ ClassElement a = _findElement('A');
+
+ List<SubtypeResult> subtypes = await driver.search.subtypes(type: a);
+ expect(subtypes, hasLength(1));
+
+ SubtypeResult b = subtypes.singleWhere((r) => r.name == 'B');
+ expect(b.libraryUri, testUri);
+ expect(b.id, '$testUri;$testUri;B');
+ }
+
test_topLevelElements() async {
await _resolveTestUnit('''
class A {} // A
diff --git a/pkg/analyzer/test/src/dart/ast/ast_test.dart b/pkg/analyzer/test/src/dart/ast/ast_test.dart
index dd7bbaa..d3d9642 100644
--- a/pkg/analyzer/test/src/dart/ast/ast_test.dart
+++ b/pkg/analyzer/test/src/dart/ast/ast_test.dart
@@ -30,7 +30,7 @@
expect(index >= 0, isTrue);
NodeLocator visitor = new NodeLocator(index);
AstNodeImpl node = visitor.searchWithin(testUnit);
- expect(node, new isInstanceOf<ExpressionImpl>());
+ expect(node, new TypeMatcher<ExpressionImpl>());
expect((node as ExpressionImpl).inConstantContext,
isInContext ? isTrue : isFalse);
}
diff --git a/pkg/analyzer/test/src/dart/constant/value_test.dart b/pkg/analyzer/test/src/dart/constant/value_test.dart
index be13b52..ccce9b5 100644
--- a/pkg/analyzer/test/src/dart/constant/value_test.dart
+++ b/pkg/analyzer/test/src/dart/constant/value_test.dart
@@ -21,7 +21,7 @@
const int LONG_MAX_VALUE = 0x7fffffffffffffff;
final Matcher throwsEvaluationException =
- throwsA(new isInstanceOf<EvaluationException>());
+ throwsA(new TypeMatcher<EvaluationException>());
@reflectiveTest
class DartObjectImplTest extends EngineTestCase {
diff --git a/pkg/analyzer/test/src/dart/element/element_test.dart b/pkg/analyzer/test/src/dart/element/element_test.dart
index 3100d6f..4ff2187 100644
--- a/pkg/analyzer/test/src/dart/element/element_test.dart
+++ b/pkg/analyzer/test/src/dart/element/element_test.dart
@@ -1264,7 +1264,7 @@
v.function.returnType = u.type;
// We don't care whether the types compare equal or not. We just need the
// computation to terminate.
- expect(s.type == u.type, new isInstanceOf<bool>());
+ expect(s.type == u.type, new TypeMatcher<bool>());
}
void test_getElement() {
@@ -1413,7 +1413,7 @@
t.function.returnType = s.type;
// We don't care what the hash code is. We just need its computation to
// terminate.
- expect(t.type.hashCode, new isInstanceOf<int>());
+ expect(t.type.hashCode, new TypeMatcher<int>());
}
void test_isAssignableTo_normalAndPositionalArgs() {
diff --git a/pkg/analyzer/test/src/dart/element/function_type_test.dart b/pkg/analyzer/test/src/dart/element/function_type_test.dart
index 5535b55..0a1e31b 100644
--- a/pkg/analyzer/test/src/dart/element/function_type_test.dart
+++ b/pkg/analyzer/test/src/dart/element/function_type_test.dart
@@ -260,7 +260,7 @@
var fReturnArgReturn = (fReturnArg as FunctionType).returnType;
expect(fReturnArgReturn.element, same(listType.element));
expect((fReturnArgReturn as InterfaceType).typeArguments[0],
- new isInstanceOf<CircularFunctionTypeImpl>());
+ new TypeMatcher<CircularFunctionTypeImpl>());
basicChecks(f.function.type,
element: same(f.function), displayName: isNotNull, returnType: fReturn);
if (bug_33302_fixed) {
@@ -282,7 +282,7 @@
var gReturnArgReturn = (gReturnArg as FunctionType).returnType;
expect(gReturnArgReturn.element, same(listType.element));
expect((gReturnArgReturn as InterfaceType).typeArguments[0],
- new isInstanceOf<CircularFunctionTypeImpl>());
+ new TypeMatcher<CircularFunctionTypeImpl>());
basicChecks(g.function.type,
element: same(g.function), displayName: isNotNull, returnType: gReturn);
if (bug_33302_fixed) {
@@ -310,7 +310,7 @@
var fParamType = f.type.normalParameterTypes[0];
expect(fParamType.element, same(g.function));
expect((fParamType as FunctionType).normalParameterTypes[0],
- new isInstanceOf<CircularFunctionTypeImpl>());
+ new TypeMatcher<CircularFunctionTypeImpl>());
basicChecks(f.function.type,
element: same(f.function),
displayName: isNotNull,
@@ -334,7 +334,7 @@
var gParamType = g.type.normalParameterTypes[0];
expect(gParamType.element, same(f.function));
expect((gParamType as FunctionType).normalParameterTypes[0],
- new isInstanceOf<CircularFunctionTypeImpl>());
+ new TypeMatcher<CircularFunctionTypeImpl>());
basicChecks(g.function.type,
element: same(g.function),
displayName: isNotNull,
@@ -361,7 +361,7 @@
var fReturn = f.type.returnType;
expect(fReturn.element, same(g.function));
expect((fReturn as FunctionType).returnType,
- new isInstanceOf<CircularFunctionTypeImpl>());
+ new TypeMatcher<CircularFunctionTypeImpl>());
basicChecks(f.function.type,
element: same(f.function), displayName: isNotNull, returnType: fReturn);
if (bug_33302_fixed) {
@@ -374,7 +374,7 @@
var gReturn = g.type.returnType;
expect(gReturn.element, same(f.function));
expect((gReturn as FunctionType).returnType,
- new isInstanceOf<CircularFunctionTypeImpl>());
+ new TypeMatcher<CircularFunctionTypeImpl>());
basicChecks(g.function.type,
element: same(g.function), displayName: isNotNull, returnType: gReturn);
if (bug_33302_fixed) {
@@ -444,7 +444,7 @@
// dynamic Function<T>()
var t = new MockTypeParameterElement('T');
FunctionType f = new FunctionTypeImpl.synthetic(dynamicType, [t], []);
- expect(() => f.instantiate([]), throwsA(new isInstanceOf<ArgumentError>()));
+ expect(() => f.instantiate([]), throwsA(new TypeMatcher<ArgumentError>()));
}
test_synthetic_instantiate_no_type_formals() {
@@ -543,7 +543,7 @@
var t = new MockTypeParameterElement('T');
FunctionType f = new FunctionTypeImpl.synthetic(dynamicType, [], []);
expect(() => f.substitute2([], [t.type]),
- throwsA(new isInstanceOf<ArgumentError>()));
+ throwsA(new TypeMatcher<ArgumentError>()));
}
test_synthetic_substitute_share_returnType_and_parameters() {
@@ -630,7 +630,7 @@
var t = new MockTypeParameterElement('T');
var e = new MockFunctionTypedElement(typeParameters: [t]);
FunctionType f = new FunctionTypeImpl(e);
- expect(() => f.instantiate([]), throwsA(new isInstanceOf<ArgumentError>()));
+ expect(() => f.instantiate([]), throwsA(new TypeMatcher<ArgumentError>()));
}
test_unnamedConstructor_instantiate_noop() {
@@ -817,7 +817,7 @@
var e = new MockFunctionTypedElement(enclosingElement: c);
FunctionType f = new FunctionTypeImpl(e);
expect(() => f.substitute2([], [t.type]),
- throwsA(new isInstanceOf<ArgumentError>()));
+ throwsA(new TypeMatcher<ArgumentError>()));
}
test_unnamedConstructor_substitute_bound_recursive() {
diff --git a/pkg/analyzer/test/src/dart/sdk/patch_test.dart b/pkg/analyzer/test/src/dart/sdk/patch_test.dart
index 12fc72e..f45c9fd 100644
--- a/pkg/analyzer/test/src/dart/sdk/patch_test.dart
+++ b/pkg/analyzer/test/src/dart/sdk/patch_test.dart
@@ -627,7 +627,7 @@
ClassDeclaration cls = unit.declarations[0];
MethodDeclaration method = cls.members[0];
FormalParameter parameter = method.parameters.parameters[0];
- expect(parameter, new isInstanceOf<DefaultFormalParameter>());
+ expect(parameter, new TypeMatcher<DefaultFormalParameter>());
}
test_class_method_patch_success_implicitReturnType() {
diff --git a/pkg/analyzer/test/src/fasta/recovery/partial_code/parameter_test.dart b/pkg/analyzer/test/src/fasta/recovery/partial_code/parameter_test.dart
new file mode 100644
index 0000000..ba995b5
--- /dev/null
+++ b/pkg/analyzer/test/src/fasta/recovery/partial_code/parameter_test.dart
@@ -0,0 +1,31 @@
+// Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'package:analyzer/src/dart/error/syntactic_errors.dart';
+
+import 'partial_code_support.dart';
+
+main() {
+ new ParameterTest().buildAll();
+}
+
+class ParameterTest extends PartialCodeTest {
+ buildAll() {
+ buildTests(
+ 'required',
+ [
+ new TestDescriptor(
+ 'functionType_noIdentifier',
+ 'f(Function(void)) {}',
+ [
+ ScannerErrorCode.EXPECTED_TOKEN,
+ ],
+ 'f(Function(void) _s_) {}',
+ failing: ['eof'],
+ ),
+ ],
+ [],
+ );
+ }
+}
diff --git a/pkg/analyzer/test/src/fasta/recovery/partial_code/test_all.dart b/pkg/analyzer/test/src/fasta/recovery/partial_code/test_all.dart
index b7269e7..56d8b47 100644
--- a/pkg/analyzer/test/src/fasta/recovery/partial_code/test_all.dart
+++ b/pkg/analyzer/test/src/fasta/recovery/partial_code/test_all.dart
@@ -21,6 +21,7 @@
import 'library_directive_test.dart' as library_directive;
import 'local_variable_test.dart' as local_variable;
import 'method_declaration_test.dart' as method_declaration;
+import 'parameter_test.dart' as parameter;
import 'part_directive_test.dart' as part_directive;
import 'part_of_directive_test.dart' as part_of_directive;
import 'return_statement_test.dart' as return_statement;
@@ -50,6 +51,7 @@
library_directive.main();
local_variable.main();
method_declaration.main();
+ parameter.main();
part_directive.main();
part_of_directive.main();
return_statement.main();
diff --git a/pkg/analyzer/test/src/summary/element_text.dart b/pkg/analyzer/test/src/summary/element_text.dart
index e60f932..fcf092e 100644
--- a/pkg/analyzer/test/src/summary/element_text.dart
+++ b/pkg/analyzer/test/src/summary/element_text.dart
@@ -837,7 +837,7 @@
void writeTypeParameterElement(TypeParameterElement e) {
writeName(e);
- if (e.bound != null) {
+ if (e.bound != null && !e.bound.isObject) {
buffer.write(' extends ');
writeType(e.bound);
}
diff --git a/pkg/analyzer/test/src/summary/linker_test.dart b/pkg/analyzer/test/src/summary/linker_test.dart
index c2d48fe..acc5ae6 100644
--- a/pkg/analyzer/test/src/summary/linker_test.dart
+++ b/pkg/analyzer/test/src/summary/linker_test.dart
@@ -27,7 +27,7 @@
@override
bool get allowMissingFiles => false;
- Matcher get isUndefined => new isInstanceOf<UndefinedElementForLink>();
+ Matcher get isUndefined => const TypeMatcher<UndefinedElementForLink>();
LibraryElementInBuildUnit get testLibrary => _testLibrary ??=
linker.getLibrary(linkerInputs.testDartUri) as LibraryElementInBuildUnit;
diff --git a/pkg/analyzer/test/src/summary/package_bundle_reader_test.dart b/pkg/analyzer/test/src/summary/package_bundle_reader_test.dart
index fde9bac..0709a95 100644
--- a/pkg/analyzer/test/src/summary/package_bundle_reader_test.dart
+++ b/pkg/analyzer/test/src/summary/package_bundle_reader_test.dart
@@ -21,8 +21,8 @@
}
/// A matcher for ConflictingSummaryException.
-const Matcher isConflictingSummaryException =
- const _ConflictingSummaryException();
+const isConflictingSummaryException =
+ const TypeMatcher<ConflictingSummaryException>();
UnlinkedPublicNamespace _namespaceWithParts(List<String> parts) {
_UnlinkedPublicNamespaceMock namespace = new _UnlinkedPublicNamespaceMock();
@@ -289,11 +289,6 @@
}
}
-class _ConflictingSummaryException extends TypeMatcher {
- const _ConflictingSummaryException() : super("ConflictingSummaryException");
- bool matches(item, Map matchState) => item is ConflictingSummaryException;
-}
-
class _InternalAnalysisContextMock implements InternalAnalysisContext {
@override
SourceFactory sourceFactory;
diff --git a/pkg/analyzer/test/src/summary/resynthesize_common.dart b/pkg/analyzer/test/src/summary/resynthesize_common.dart
index 88a7e76..251e729 100644
--- a/pkg/analyzer/test/src/summary/resynthesize_common.dart
+++ b/pkg/analyzer/test/src/summary/resynthesize_common.dart
@@ -207,7 +207,7 @@
? resynthesized.actualElement
: resynthesized;
if (original is Member) {
- expect(resynthesizedNonHandle, new isInstanceOf<Member>(), reason: desc);
+ expect(resynthesizedNonHandle, new TypeMatcher<Member>(), reason: desc);
if (resynthesizedNonHandle is Member) {
List<DartType> resynthesizedTypeArguments =
resynthesizedNonHandle.definingType.typeArguments;
@@ -223,7 +223,7 @@
}
} else {
expect(
- resynthesizedNonHandle, isNot(new isInstanceOf<ConstructorMember>()),
+ resynthesizedNonHandle, isNot(new TypeMatcher<ConstructorMember>()),
reason: desc);
}
}
@@ -477,7 +477,7 @@
} else if (o is ThisExpression && r is ThisExpression) {
// Nothing to compare.
} else if (o is NullLiteral) {
- expect(r, new isInstanceOf<NullLiteral>(), reason: desc);
+ expect(r, new TypeMatcher<NullLiteral>(), reason: desc);
} else if (o is BooleanLiteral && r is BooleanLiteral) {
expect(r.value, o.value, reason: desc);
} else if (o is IntegerLiteral && r is IntegerLiteral) {
@@ -764,9 +764,9 @@
// Validate members.
if (oImpl is Member) {
- expect(rImpl, new isInstanceOf<Member>(), reason: desc);
+ expect(rImpl, new TypeMatcher<Member>(), reason: desc);
} else {
- expect(rImpl, isNot(new isInstanceOf<Member>()), reason: desc);
+ expect(rImpl, isNot(new TypeMatcher<Member>()), reason: desc);
}
}
@@ -1091,7 +1091,7 @@
reason: desc);
if (original.element.enclosingElement == null &&
original.element is FunctionElement) {
- expect(resynthesized.element, new isInstanceOf<FunctionElement>());
+ expect(resynthesized.element, new TypeMatcher<FunctionElement>());
expect(resynthesized.element.enclosingElement, isNull, reason: desc);
compareFunctionElements(
resynthesized.element, original.element, '$desc.element',
@@ -1197,7 +1197,7 @@
Element actualElement = element.actualElement;
// A handle should never point to a member, because if it did, then
// "is Member" checks on the handle would produce the wrong result.
- expect(actualElement, isNot(new isInstanceOf<Member>()), reason: desc);
+ expect(actualElement, isNot(new TypeMatcher<Member>()), reason: desc);
return getActualElement(actualElement, desc);
} else if (element is Member) {
return getActualElement(element.baseElement, desc);
@@ -2389,7 +2389,7 @@
class D {}
''');
checkElementText(library, r'''
-class C<T extends Object, U extends D> {
+class C<T, U extends D> {
}
class D {
}
@@ -2624,6 +2624,25 @@
}
}
+ test_const_invalid_typeMismatch() async {
+ var library = await checkLibrary(r'''
+const int a = 0;
+const bool b = a + 5;
+''', allowErrors: true);
+ if (isSharedFrontEnd) {
+ checkElementText(library, r'''
+const int a = 0;
+const bool b = #invalidConst;
+''');
+ } else {
+ checkElementText(library, r'''
+const int a = 0;
+const bool b =
+ a/*location: test.dart;a?*/ + 5;
+''');
+ }
+ }
+
test_const_invokeConstructor_generic_named() async {
var library = await checkLibrary(r'''
class C<K, V> {
@@ -7503,6 +7522,37 @@
}
}
+ test_instantiateToBounds_functionTypeAlias_reexported() async {
+ addLibrarySource('/a.dart', r'''
+class O {}
+typedef T F<T extends O>(T p);
+''');
+ addLibrarySource('/b.dart', r'''
+export 'a.dart' show F;
+''');
+ var library = await checkLibrary('''
+import 'b.dart';
+class C {
+ F f() => null;
+}
+''');
+ if (isStrongMode) {
+ checkElementText(library, r'''
+import 'b.dart';
+class C {
+ (O) → O f() {}
+}
+''');
+ } else {
+ checkElementText(library, r'''
+import 'b.dart';
+class C {
+ (dynamic) → dynamic f() {}
+}
+''');
+ }
+ }
+
test_instantiateToBounds_functionTypeAlias_simple() async {
var library = await checkLibrary('''
typedef F<T extends num>(T p);
@@ -10050,7 +10100,7 @@
var library = await checkLibrary(
'typedef U F<T extends Object, U extends D>(T t); class D {}');
checkElementText(library, r'''
-typedef F<T extends Object, U extends D> = U Function(T t);
+typedef F<T, U extends D> = U Function(T t);
class D {
}
''');
diff --git a/pkg/analyzer/test/src/summary/resynthesize_kernel_test.dart b/pkg/analyzer/test/src/summary/resynthesize_kernel_test.dart
index 359b16c..86116af 100644
--- a/pkg/analyzer/test/src/summary/resynthesize_kernel_test.dart
+++ b/pkg/analyzer/test/src/summary/resynthesize_kernel_test.dart
@@ -134,56 +134,11 @@
''');
}
- @failingTest
- @potentialAnalyzerProblem
- @override
- test_class_type_parameters_bound() async {
- // https://github.com/dart-lang/sdk/issues/29561
- // Fasta does not provide a flag for explicit vs. implicit Object bound.
- await super.test_class_type_parameters_bound();
- }
-
@failingTest // See dartbug.com/32290
test_const_constructor_inferred_args() =>
super.test_const_constructor_inferred_args();
@failingTest
- @FastaProblem('https://github.com/dart-lang/sdk/issues/30258')
- test_constructor_redirected_factory_named_generic() async {
- await super.test_constructor_redirected_factory_named_generic();
- }
-
- @failingTest
- @FastaProblem('https://github.com/dart-lang/sdk/issues/30258')
- test_constructor_redirected_factory_named_imported_generic() async {
- await super.test_constructor_redirected_factory_named_imported_generic();
- }
-
- @failingTest
- @FastaProblem('https://github.com/dart-lang/sdk/issues/30258')
- test_constructor_redirected_factory_named_prefixed_generic() async {
- await super.test_constructor_redirected_factory_named_prefixed_generic();
- }
-
- @failingTest
- @FastaProblem('https://github.com/dart-lang/sdk/issues/30258')
- test_constructor_redirected_factory_unnamed_generic() async {
- await super.test_constructor_redirected_factory_unnamed_generic();
- }
-
- @failingTest
- @FastaProblem('https://github.com/dart-lang/sdk/issues/30258')
- test_constructor_redirected_factory_unnamed_imported_generic() async {
- await super.test_constructor_redirected_factory_unnamed_imported_generic();
- }
-
- @failingTest
- @FastaProblem('https://github.com/dart-lang/sdk/issues/30258')
- test_constructor_redirected_factory_unnamed_prefixed_generic() async {
- await super.test_constructor_redirected_factory_unnamed_prefixed_generic();
- }
-
- @failingTest
@notForDart2
test_export_configurations_useFirst() async {
await super.test_export_configurations_useFirst();
@@ -201,27 +156,6 @@
await super.test_exportImport_configurations_useFirst();
}
- @failingTest
- @override
- test_futureOr() async {
- // TODO(brianwilkerson) Triage this failure.
- fail('Inconsistent results');
- }
-
- @failingTest
- @override
- test_futureOr_const() async {
- // TODO(brianwilkerson) Triage this failure.
- fail('Inconsistent results');
- }
-
- @failingTest
- @override
- test_futureOr_inferred() async {
- // TODO(brianwilkerson) Triage this failure.
- fail('Inconsistent results');
- }
-
test_getElement_unit() async {
String text = 'class C {}';
Source source = addLibrarySource('/test.dart', text);
@@ -251,18 +185,6 @@
await super.test_import_invalidUri_metadata();
}
- @override
- @failingTest
- test_invalid_annotation_prefixed_constructor() {
- return super.test_invalid_annotation_prefixed_constructor();
- }
-
- @override
- @failingTest
- test_invalid_annotation_unprefixed_constructor() {
- return super.test_invalid_annotation_unprefixed_constructor();
- }
-
@failingTest
@FastaProblem('https://github.com/dart-lang/sdk/issues/30267')
test_invalid_nameConflict_imported() async {
@@ -300,49 +222,6 @@
}
@failingTest
- @FastaProblem('https://github.com/dart-lang/sdk/issues/28434')
- test_metadata_fieldFormalParameter() async {
- await super.test_metadata_fieldFormalParameter();
- }
-
- @failingTest
- @FastaProblem('https://github.com/dart-lang/sdk/issues/28434')
- test_metadata_fieldFormalParameter_withDefault() async {
- await super.test_metadata_fieldFormalParameter_withDefault();
- }
-
- @failingTest
- @FastaProblem('https://github.com/dart-lang/sdk/issues/28434')
- test_metadata_functionTypedFormalParameter() async {
- await super.test_metadata_functionTypedFormalParameter();
- }
-
- @failingTest
- @FastaProblem('https://github.com/dart-lang/sdk/issues/28434')
- test_metadata_functionTypedFormalParameter_withDefault() async {
- await super.test_metadata_functionTypedFormalParameter_withDefault();
- }
-
- @failingTest
- @FastaProblem('https://github.com/dart-lang/sdk/issues/28434')
- test_metadata_simpleFormalParameter() async {
- await super.test_metadata_simpleFormalParameter();
- }
-
- @failingTest
- @FastaProblem('https://github.com/dart-lang/sdk/issues/28434')
- test_metadata_simpleFormalParameter_withDefault() async {
- await super.test_metadata_simpleFormalParameter_withDefault();
- }
-
- @failingTest
- @notForDart2
- test_parameter_checked() async {
- // @checked is deprecated, use `covariant` instead.
- await super.test_parameter_checked();
- }
-
- @failingTest
@notForDart2
test_parameter_checked_inherited() async {
// @checked is deprecated, use `covariant` instead.
@@ -362,36 +241,11 @@
}
@failingTest
- @potentialAnalyzerProblem
- test_typedef_type_parameters_bound() async {
- // https://github.com/dart-lang/sdk/issues/29561
- await super.test_typedef_type_parameters_bound();
- }
-
- @failingTest
@FastaProblem('https://github.com/dart-lang/sdk/issues/30267')
test_unresolved_annotation_instanceCreation_argument_super() async {
await super.test_unresolved_annotation_instanceCreation_argument_super();
}
- @override
- @failingTest
- test_unresolved_annotation_prefixedIdentifier_badPrefix() {
- return super.test_unresolved_annotation_prefixedIdentifier_badPrefix();
- }
-
- @override
- @failingTest
- test_unresolved_annotation_prefixedIdentifier_noDeclaration() {
- return super.test_unresolved_annotation_prefixedIdentifier_noDeclaration();
- }
-
- @override
- @failingTest
- test_unresolved_annotation_simpleIdentifier() {
- return super.test_unresolved_annotation_simpleIdentifier();
- }
-
Future<KernelResynthesizer> _createResynthesizer(Uri testUri) async {
var logger = new PerformanceLog(null);
var byteStore = new MemoryByteStore();
@@ -415,7 +269,7 @@
fsState,
resourceProvider.pathContext);
- LibraryOutlineResult libraryResult = await compiler.getOutline(testUri);
+ LibraryCompilationResult libraryResult = await compiler.compile(testUri);
// Remember Kernel libraries produced by the compiler.
var libraryMap = <String, kernel.Library>{};
diff --git a/pkg/analyzer/test/src/summary/summary_common.dart b/pkg/analyzer/test/src/summary/summary_common.dart
index 952ede8..7d93651 100644
--- a/pkg/analyzer/test/src/summary/summary_common.dart
+++ b/pkg/analyzer/test/src/summary/summary_common.dart
@@ -241,7 +241,7 @@
* a file reachable via the given [absoluteUri].
*/
void checkDependency(int dependency, String absoluteUri) {
- expect(dependency, new isInstanceOf<int>());
+ expect(dependency, new TypeMatcher<int>());
expect(linked.dependencies[dependency].uri, absoluteUri);
}
@@ -293,7 +293,7 @@
void checkExportName(LinkedExportName exportName, String absoluteUri,
String expectedName, ReferenceKind expectedKind,
{int expectedTargetUnit: 0}) {
- expect(exportName, new isInstanceOf<LinkedExportName>());
+ expect(exportName, new TypeMatcher<LinkedExportName>());
// Exported names must come from other libraries.
expect(exportName.dependency, isNot(0));
checkDependency(exportName.dependency, absoluteUri);
@@ -455,7 +455,7 @@
* having the given [deBruijnIndex].
*/
void checkParamTypeRef(EntityRef typeRef, int deBruijnIndex) {
- expect(typeRef, new isInstanceOf<EntityRef>());
+ expect(typeRef, new TypeMatcher<EntityRef>());
expect(typeRef.reference, 0);
expect(typeRef.typeArguments, isEmpty);
expect(typeRef.paramReference, deBruijnIndex);
@@ -555,7 +555,7 @@
int numTypeParameters: 0,
bool unresolvedHasName: false}) {
linkedSourceUnit ??= definingUnit;
- expect(typeRef, new isInstanceOf<EntityRef>());
+ expect(typeRef, new TypeMatcher<EntityRef>());
expect(typeRef.paramReference, 0);
int index = typeRef.reference;
expect(typeRef.typeArguments, hasLength(numTypeArguments));
@@ -2652,7 +2652,7 @@
0 // Size of the list
], referenceValidators: [
(EntityRef reference) {
- expect(reference, new isInstanceOf<EntityRef>());
+ expect(reference, new TypeMatcher<EntityRef>());
expect(reference.entityKind, EntityRefKind.genericFunctionType);
expect(reference.syntheticParams, hasLength(1));
{
@@ -2678,24 +2678,24 @@
0 // Size of the list
], referenceValidators: [
(EntityRef reference) {
- expect(reference, new isInstanceOf<EntityRef>());
+ expect(reference, new TypeMatcher<EntityRef>());
expect(reference.entityKind, EntityRefKind.genericFunctionType);
expect(reference.syntheticParams, hasLength(1));
{
final param = reference.syntheticParams[0];
- expect(param.type, new isInstanceOf<EntityRef>());
+ expect(param.type, new TypeMatcher<EntityRef>());
expect(param.type.entityKind, EntityRefKind.genericFunctionType);
expect(param.type.syntheticParams, hasLength(2));
{
final subparam = param.type.syntheticParams[0];
expect(subparam.name, ''); // no name for generic type parameters
- expect(subparam.type, new isInstanceOf<EntityRef>());
+ expect(subparam.type, new TypeMatcher<EntityRef>());
expect(subparam.type.paramReference, 2);
}
{
final subparam = param.type.syntheticParams[1];
expect(subparam.name, ''); // no name for generic type parameters
- expect(subparam.type, new isInstanceOf<EntityRef>());
+ expect(subparam.type, new TypeMatcher<EntityRef>());
expect(subparam.type.paramReference, 1);
}
}
diff --git a/pkg/analyzer/test/src/task/dart_test.dart b/pkg/analyzer/test/src/task/dart_test.dart
index 51d6bb6..d86e01e 100644
--- a/pkg/analyzer/test/src/task/dart_test.dart
+++ b/pkg/analyzer/test/src/task/dart_test.dart
@@ -77,70 +77,70 @@
});
}
-isInstanceOf isBuildCompilationUnitElementTask =
- new isInstanceOf<BuildCompilationUnitElementTask>();
-isInstanceOf isBuildDirectiveElementsTask =
- new isInstanceOf<BuildDirectiveElementsTask>();
-isInstanceOf isBuildEnumMemberElementsTask =
- new isInstanceOf<BuildEnumMemberElementsTask>();
-isInstanceOf isBuildExportNamespaceTask =
- new isInstanceOf<BuildExportNamespaceTask>();
-isInstanceOf isBuildLibraryElementTask =
- new isInstanceOf<BuildLibraryElementTask>();
-isInstanceOf isBuildPublicNamespaceTask =
- new isInstanceOf<BuildPublicNamespaceTask>();
-isInstanceOf isBuildSourceExportClosureTask =
- new isInstanceOf<BuildSourceExportClosureTask>();
-isInstanceOf isBuildTypeProviderTask =
- new isInstanceOf<BuildTypeProviderTask>();
-isInstanceOf isComputeConstantDependenciesTask =
- new isInstanceOf<ComputeConstantDependenciesTask>();
-isInstanceOf isComputeConstantValueTask =
- new isInstanceOf<ComputeConstantValueTask>();
-isInstanceOf isComputeInferableStaticVariableDependenciesTask =
- new isInstanceOf<ComputeInferableStaticVariableDependenciesTask>();
-isInstanceOf isContainingLibrariesTask =
- new isInstanceOf<ContainingLibrariesTask>();
-isInstanceOf isDartErrorsTask = new isInstanceOf<DartErrorsTask>();
-isInstanceOf isEvaluateUnitConstantsTask =
- new isInstanceOf<EvaluateUnitConstantsTask>();
-isInstanceOf isGatherUsedImportedElementsTask =
- new isInstanceOf<GatherUsedImportedElementsTask>();
-isInstanceOf isGatherUsedLocalElementsTask =
- new isInstanceOf<GatherUsedLocalElementsTask>();
-isInstanceOf isGenerateHintsTask = new isInstanceOf<GenerateHintsTask>();
-isInstanceOf isGenerateLintsTask = new isInstanceOf<GenerateLintsTask>();
-isInstanceOf isInferInstanceMembersInUnitTask =
- new isInstanceOf<InferInstanceMembersInUnitTask>();
-isInstanceOf isInferStaticVariableTypesInUnitTask =
- new isInstanceOf<InferStaticVariableTypesInUnitTask>();
-isInstanceOf isInferStaticVariableTypeTask =
- new isInstanceOf<InferStaticVariableTypeTask>();
-isInstanceOf isLibraryErrorsReadyTask =
- new isInstanceOf<LibraryErrorsReadyTask>();
-isInstanceOf isLibraryUnitErrorsTask =
- new isInstanceOf<LibraryUnitErrorsTask>();
-isInstanceOf isParseDartTask = new isInstanceOf<ParseDartTask>();
-isInstanceOf isPartiallyResolveUnitReferencesTask =
- new isInstanceOf<PartiallyResolveUnitReferencesTask>();
-isInstanceOf isResolveDirectiveElementsTask =
- new isInstanceOf<ResolveDirectiveElementsTask>();
-isInstanceOf isResolveLibraryReferencesTask =
- new isInstanceOf<ResolveLibraryReferencesTask>();
-isInstanceOf isResolveLibraryTask = new isInstanceOf<ResolveLibraryTask>();
-isInstanceOf isResolveLibraryTypeNamesTask =
- new isInstanceOf<ResolveLibraryTypeNamesTask>();
-isInstanceOf isResolveTopLevelUnitTypeBoundsTask =
- new isInstanceOf<ResolveTopLevelUnitTypeBoundsTask>();
-isInstanceOf isResolveUnitTask = new isInstanceOf<ResolveUnitTask>();
-isInstanceOf isResolveUnitTypeNamesTask =
- new isInstanceOf<ResolveUnitTypeNamesTask>();
-isInstanceOf isResolveVariableReferencesTask =
- new isInstanceOf<ResolveVariableReferencesTask>();
-isInstanceOf isScanDartTask = new isInstanceOf<ScanDartTask>();
-isInstanceOf isStrongModeVerifyUnitTask =
- new isInstanceOf<StrongModeVerifyUnitTask>();
-isInstanceOf isVerifyUnitTask = new isInstanceOf<VerifyUnitTask>();
+final isBuildCompilationUnitElementTask =
+ new TypeMatcher<BuildCompilationUnitElementTask>();
+final isBuildDirectiveElementsTask =
+ new TypeMatcher<BuildDirectiveElementsTask>();
+final isBuildEnumMemberElementsTask =
+ new TypeMatcher<BuildEnumMemberElementsTask>();
+final isBuildExportNamespaceTask =
+ new TypeMatcher<BuildExportNamespaceTask>();
+final isBuildLibraryElementTask =
+ new TypeMatcher<BuildLibraryElementTask>();
+final isBuildPublicNamespaceTask =
+ new TypeMatcher<BuildPublicNamespaceTask>();
+final isBuildSourceExportClosureTask =
+ new TypeMatcher<BuildSourceExportClosureTask>();
+final isBuildTypeProviderTask =
+ new TypeMatcher<BuildTypeProviderTask>();
+final isComputeConstantDependenciesTask =
+ new TypeMatcher<ComputeConstantDependenciesTask>();
+final isComputeConstantValueTask =
+ new TypeMatcher<ComputeConstantValueTask>();
+final isComputeInferableStaticVariableDependenciesTask =
+ new TypeMatcher<ComputeInferableStaticVariableDependenciesTask>();
+final isContainingLibrariesTask =
+ new TypeMatcher<ContainingLibrariesTask>();
+final isDartErrorsTask = new TypeMatcher<DartErrorsTask>();
+final isEvaluateUnitConstantsTask =
+ new TypeMatcher<EvaluateUnitConstantsTask>();
+final isGatherUsedImportedElementsTask =
+ new TypeMatcher<GatherUsedImportedElementsTask>();
+final isGatherUsedLocalElementsTask =
+ new TypeMatcher<GatherUsedLocalElementsTask>();
+final isGenerateHintsTask = new TypeMatcher<GenerateHintsTask>();
+final isGenerateLintsTask = new TypeMatcher<GenerateLintsTask>();
+final isInferInstanceMembersInUnitTask =
+ new TypeMatcher<InferInstanceMembersInUnitTask>();
+final isInferStaticVariableTypesInUnitTask =
+ new TypeMatcher<InferStaticVariableTypesInUnitTask>();
+final isInferStaticVariableTypeTask =
+ new TypeMatcher<InferStaticVariableTypeTask>();
+final isLibraryErrorsReadyTask =
+ new TypeMatcher<LibraryErrorsReadyTask>();
+final isLibraryUnitErrorsTask =
+ new TypeMatcher<LibraryUnitErrorsTask>();
+final isParseDartTask = new TypeMatcher<ParseDartTask>();
+final isPartiallyResolveUnitReferencesTask =
+ new TypeMatcher<PartiallyResolveUnitReferencesTask>();
+final isResolveDirectiveElementsTask =
+ new TypeMatcher<ResolveDirectiveElementsTask>();
+final isResolveLibraryReferencesTask =
+ new TypeMatcher<ResolveLibraryReferencesTask>();
+final isResolveLibraryTask = new TypeMatcher<ResolveLibraryTask>();
+final isResolveLibraryTypeNamesTask =
+ new TypeMatcher<ResolveLibraryTypeNamesTask>();
+final isResolveTopLevelUnitTypeBoundsTask =
+ new TypeMatcher<ResolveTopLevelUnitTypeBoundsTask>();
+final isResolveUnitTask = new TypeMatcher<ResolveUnitTask>();
+final isResolveUnitTypeNamesTask =
+ new TypeMatcher<ResolveUnitTypeNamesTask>();
+final isResolveVariableReferencesTask =
+ new TypeMatcher<ResolveVariableReferencesTask>();
+final isScanDartTask = new TypeMatcher<ScanDartTask>();
+final isStrongModeVerifyUnitTask =
+ new TypeMatcher<StrongModeVerifyUnitTask>();
+final isVerifyUnitTask = new TypeMatcher<VerifyUnitTask>();
final LintCode _testLintCode = new LintCode('test lint', 'test lint code');
@@ -248,7 +248,7 @@
*/
void checkMetadata(Element element, CompilationUnitElement compilationUnit) {
expect(element.metadata, hasLength(1));
- expect(element.metadata[0], new isInstanceOf<ElementAnnotationImpl>());
+ expect(element.metadata[0], new TypeMatcher<ElementAnnotationImpl>());
ElementAnnotationImpl elementAnnotation = element.metadata[0];
expect(elementAnnotation.element, isNull); // Not yet resolved
expect(elementAnnotation.compilationUnit, isNotNull);
@@ -565,7 +565,7 @@
.getCacheEntry(new LibrarySpecificUnit(sourceA, sourcePart))
.getValue(RESOLVED_UNIT1);
// Validate metadata
- expect(part.directives[0], new isInstanceOf<PartOfDirective>());
+ expect(part.directives[0], new TypeMatcher<PartOfDirective>());
expect(part.directives[0].element, same(libraryA));
expect(
resolutionMap.elementDeclaredByDirective(part.directives[0]).metadata,
@@ -3830,7 +3830,7 @@
String expectedBoundTypeString, String expectedBoundElementName) {
TypeAnnotation bound = typeParameter.bound;
// TODO(brianwilkerson) Extend this to support function types as bounds.
- expect(bound, new isInstanceOf<TypeName>());
+ expect(bound, new TypeMatcher<TypeName>());
TypeName boundNode = bound;
Identifier boundName = boundNode.name;
expect(boundNode.type.toString(), expectedBoundTypeString);
@@ -4910,7 +4910,7 @@
List<dynamic> computeLibraryResults(
List<Source> sources, ResultDescriptor result,
- {isInstanceOf matcher: null}) {
+ {Matcher matcher: null}) {
dynamic compute(Source source) {
computeResult(new LibrarySpecificUnit(source, source), result,
matcher: matcher);
@@ -4922,7 +4922,7 @@
List<Map<ResultDescriptor, dynamic>> computeLibraryResultsMap(
List<Source> sources, ResultDescriptor result,
- {isInstanceOf matcher: null}) {
+ {Matcher matcher: null}) {
Map<ResultDescriptor, dynamic> compute(Source source) {
computeResult(source, result, matcher: matcher);
return outputs;
diff --git a/pkg/analyzer/test/src/task/driver_test.dart b/pkg/analyzer/test/src/task/driver_test.dart
index 5834950..76c3312 100644
--- a/pkg/analyzer/test/src/task/driver_test.dart
+++ b/pkg/analyzer/test/src/task/driver_test.dart
@@ -304,7 +304,7 @@
expect(analysisDriver.performAnalysisTask(), true);
CaughtException exception = context.getCacheEntry(target).exception;
expect(exception, isNotNull);
- expect(exception.exception, new isInstanceOf<InfiniteTaskLoopException>());
+ expect(exception.exception, new TypeMatcher<InfiniteTaskLoopException>());
}
test_performAnalysisTask_inputsFirst() {
diff --git a/pkg/analyzer/test/src/task/html_test.dart b/pkg/analyzer/test/src/task/html_test.dart
index eb1b24d..27a6dfb 100644
--- a/pkg/analyzer/test/src/task/html_test.dart
+++ b/pkg/analyzer/test/src/task/html_test.dart
@@ -22,9 +22,9 @@
});
}
-isInstanceOf isDartScriptsTask = new isInstanceOf<DartScriptsTask>();
-isInstanceOf isHtmlErrorsTask = new isInstanceOf<HtmlErrorsTask>();
-isInstanceOf isParseHtmlTask = new isInstanceOf<ParseHtmlTask>();
+final isDartScriptsTask = new TypeMatcher<DartScriptsTask>();
+final isHtmlErrorsTask = new TypeMatcher<HtmlErrorsTask>();
+final isParseHtmlTask = new TypeMatcher<ParseHtmlTask>();
@reflectiveTest
class DartScriptsTaskTest extends AbstractContextTest {
diff --git a/pkg/analyzer/test/src/task/inputs_test.dart b/pkg/analyzer/test/src/task/inputs_test.dart
index 7bde7f7..23d82e0 100644
--- a/pkg/analyzer/test/src/task/inputs_test.dart
+++ b/pkg/analyzer/test/src/task/inputs_test.dart
@@ -114,7 +114,7 @@
test_createBuilder() {
ConstantTaskInput<int> input = new ConstantTaskInput<int>(5);
- expect(input.createBuilder(), new isInstanceOf<ConstantTaskInputBuilder>());
+ expect(input.createBuilder(), new TypeMatcher<ConstantTaskInputBuilder>());
}
}
@@ -134,22 +134,21 @@
test_createBuilder() {
var input = new ListTaskInputImpl<AnalysisTarget>(target, result1);
- expect(input.createBuilder(), new isInstanceOf<SimpleTaskInputBuilder>());
+ expect(input.createBuilder(), new TypeMatcher<SimpleTaskInputBuilder>());
}
test_toList() {
var input = new ListTaskInputImpl<AnalysisTarget>(target, result1);
ListTaskInput<String> input2 =
input.toList((target) => new SimpleTaskInput<String>(target, null));
- expect(input2,
- new isInstanceOf<ListToListTaskInput<AnalysisTarget, String>>());
+ expect(
+ input2, new TypeMatcher<ListToListTaskInput<AnalysisTarget, String>>());
}
test_toListOf() {
var input = new ListTaskInputImpl<AnalysisTarget>(target, result1);
ListTaskInput<int> input2 = input.toListOf(result2);
- expect(
- input2, new isInstanceOf<ListToListTaskInput<AnalysisTarget, int>>());
+ expect(input2, new TypeMatcher<ListToListTaskInput<AnalysisTarget, int>>());
}
test_toMap() {
@@ -157,13 +156,13 @@
MapTaskInput<AnalysisTarget, String> input2 =
input.toMap((target) => new SimpleTaskInput<String>(target, null));
expect(
- input2, new isInstanceOf<ListToMapTaskInput<AnalysisTarget, String>>());
+ input2, new TypeMatcher<ListToMapTaskInput<AnalysisTarget, String>>());
}
test_toMapOf() {
var input = new ListTaskInputImpl<AnalysisTarget>(target, result1);
MapTaskInput<AnalysisTarget, int> input2 = input.toMapOf(result2);
- expect(input2, new isInstanceOf<ListToMapTaskInput<AnalysisTarget, int>>());
+ expect(input2, new TypeMatcher<ListToMapTaskInput<AnalysisTarget, int>>());
}
}
@@ -277,7 +276,7 @@
builder.currentValue = value3;
builder.moveNext(); // Advance to the end
var inputValue = builder.inputValue;
- expect(inputValue, new isInstanceOf<List>());
+ expect(inputValue, new TypeMatcher<List>());
List list = inputValue;
expect(list.length, 2);
expect(list[0], value2);
@@ -297,7 +296,7 @@
builder.currentValue = value3;
builder.moveNext(); // Advance to the end
var inputValue = builder.inputValue;
- expect(inputValue, new isInstanceOf<List>());
+ expect(inputValue, new TypeMatcher<List>());
List list = inputValue;
expect(list, orderedEquals([value3]));
}
@@ -308,7 +307,7 @@
builder.currentValueNotAvailable();
builder.moveNext(); // Advance to the end
var inputValue = builder.inputValue;
- expect(inputValue, new isInstanceOf<List>());
+ expect(inputValue, new TypeMatcher<List>());
List list = inputValue;
expect(list, isEmpty);
}
@@ -472,7 +471,7 @@
builder.currentValue = value3;
builder.moveNext(); // Advance to the end
var inputValue = builder.inputValue;
- expect(inputValue, new isInstanceOf<Map>());
+ expect(inputValue, new TypeMatcher<Map>());
expect(inputValue.length, 2);
expect(inputValue, containsPair(target2, value2));
expect(inputValue, containsPair(target3, value3));
@@ -491,7 +490,7 @@
builder.currentValue = value3;
builder.moveNext(); // Advance to the end
var inputValue = builder.inputValue;
- expect(inputValue, new isInstanceOf<Map>());
+ expect(inputValue, new TypeMatcher<Map>());
expect(inputValue, hasLength(1));
expect(inputValue, containsPair(target3, value3));
}
@@ -502,7 +501,7 @@
builder.currentValueNotAvailable();
builder.moveNext(); // Advance to the end
var inputValue = builder.inputValue;
- expect(inputValue, new isInstanceOf<Map>());
+ expect(inputValue, new TypeMatcher<Map>());
expect(inputValue, isEmpty);
}
@@ -700,8 +699,8 @@
SimpleTaskInput baseInput = new SimpleTaskInput(target, result);
var mapper = (Object x) => [x];
ObjectToListTaskInput input = new ObjectToListTaskInput(baseInput, mapper);
- expect(input.createBuilder(),
- new isInstanceOf<ObjectToListTaskInputBuilder>());
+ expect(
+ input.createBuilder(), new TypeMatcher<ObjectToListTaskInputBuilder>());
}
}
@@ -843,7 +842,7 @@
test_createBuilder() {
SimpleTaskInput input = new SimpleTaskInput(target, result);
- expect(input.createBuilder(), new isInstanceOf<SimpleTaskInputBuilder>());
+ expect(input.createBuilder(), new TypeMatcher<SimpleTaskInputBuilder>());
}
}
@@ -1013,7 +1012,7 @@
builder.currentValue = value2;
builder.moveNext(); // Advance to the end
var inputValue = builder.inputValue;
- expect(inputValue, new isInstanceOf<Map>());
+ expect(inputValue, new TypeMatcher<Map>());
Map inputs = inputValue;
expect(inputs.length, 2);
expect(inputs, containsPair(key1, value1));
@@ -1041,7 +1040,7 @@
builder.currentValue = value2;
builder.moveNext(); // Advance to the end
var inputValue = builder.inputValue;
- expect(inputValue, new isInstanceOf<Map>());
+ expect(inputValue, new TypeMatcher<Map>());
Map inputs = inputValue;
expect(inputs, hasLength(1));
expect(inputs, containsPair(key2, value2));
diff --git a/pkg/analyzer/test/src/task/manager_test.dart b/pkg/analyzer/test/src/task/manager_test.dart
index 662e940..b91e829 100644
--- a/pkg/analyzer/test/src/task/manager_test.dart
+++ b/pkg/analyzer/test/src/task/manager_test.dart
@@ -63,7 +63,7 @@
TaskManager manager = new TaskManager();
AnalysisTarget target = new TestSource();
expect(() => manager.findTask(target, result1),
- throwsA(new isInstanceOf<AnalysisException>()));
+ throwsA(new TypeMatcher<AnalysisException>()));
}
test_findTask_multiple() {
@@ -90,7 +90,7 @@
manager.addTaskDescriptor(descriptor);
AnalysisTarget target = new TestSource();
expect(() => manager.findTask(target, result2),
- throwsA(new isInstanceOf<AnalysisException>()));
+ throwsA(new TypeMatcher<AnalysisException>()));
}
test_removeGeneralResult_absent() {
diff --git a/pkg/analyzer/test/src/task/model_test.dart b/pkg/analyzer/test/src/task/model_test.dart
index e364dc3..b0366bd 100644
--- a/pkg/analyzer/test/src/task/model_test.dart
+++ b/pkg/analyzer/test/src/task/model_test.dart
@@ -28,14 +28,14 @@
AnalysisTask task = new TestAnalysisTask(null, target);
task.inputs = {'a': 'b'};
expect(() => task.getRequiredInput('c'),
- throwsA(new isInstanceOf<AnalysisException>()));
+ throwsA(new TypeMatcher<AnalysisException>()));
}
test_getRequiredInput_noInputs() {
AnalysisTarget target = new TestSource();
AnalysisTask task = new TestAnalysisTask(null, target);
expect(() => task.getRequiredInput('x'),
- throwsA(new isInstanceOf<AnalysisException>()));
+ throwsA(new TypeMatcher<AnalysisException>()));
}
test_getRequiredInput_valid() {
diff --git a/pkg/analyzer/test/src/task/options_test.dart b/pkg/analyzer/test/src/task/options_test.dart
index bd2a25f..21b6a46 100644
--- a/pkg/analyzer/test/src/task/options_test.dart
+++ b/pkg/analyzer/test/src/task/options_test.dart
@@ -36,8 +36,8 @@
});
}
-isInstanceOf isGenerateOptionsErrorsTask =
- new isInstanceOf<GenerateOptionsErrorsTask>();
+final isGenerateOptionsErrorsTask =
+ new TypeMatcher<GenerateOptionsErrorsTask>();
@reflectiveTest
class ContextConfigurationTest extends AbstractContextTest {
@@ -203,6 +203,8 @@
.remove(AnalysisOptionsWarningCode.INCLUDE_FILE_NOT_FOUND.name);
declaredNames
.remove(AnalysisOptionsWarningCode.INCLUDED_FILE_WARNING.name);
+ declaredNames
+ .remove(AnalysisOptionsWarningCode.INVALID_SECTION_FORMAT.name);
} else if (errorType == StaticWarningCode) {
declaredNames.remove(
StaticWarningCode.FINAL_NOT_INITIALIZED_CONSTRUCTOR_3_PLUS.name +
@@ -290,8 +292,9 @@
ErrorProcessorMatcher(this.required);
@override
- Description describe(Description desc) => desc
- ..add("an ErrorProcessor setting ${required.code} to ${required.severity}");
+ Description describe(Description desc) =>
+ desc..add("an ErrorProcessor setting ${required.code} to ${required
+ .severity}");
@override
bool matches(dynamic o, Map<dynamic, dynamic> options) {
@@ -459,7 +462,10 @@
AnalysisTarget target = newSource(optionsFilePath, code);
computeResult(target, ANALYSIS_OPTIONS_ERRORS);
expect(task, isGenerateOptionsErrorsTask);
- expect(outputs[ANALYSIS_OPTIONS_ERRORS], isEmpty);
+ expect(outputs[ANALYSIS_OPTIONS_ERRORS], hasLength(1));
+ expect(outputs[ANALYSIS_OPTIONS_ERRORS].first.errorCode,
+ AnalysisOptionsHintCode.STRONG_MODE_SETTING_DEPRECATED);
+
LineInfo lineInfo = outputs[LINE_INFO];
expect(lineInfo, isNotNull);
expect(lineInfo.getLocation(1).lineNumber, 1);
@@ -492,7 +498,10 @@
validate('''
analyzer:
strong-mode: true
- ''', [AnalysisOptionsHintCode.DEPRECATED_ANALYSIS_OPTIONS_FILE_NAME]);
+ ''', [
+ AnalysisOptionsHintCode.DEPRECATED_ANALYSIS_OPTIONS_FILE_NAME,
+ AnalysisOptionsHintCode.STRONG_MODE_SETTING_DEPRECATED
+ ]);
}
test_finds_issues_in_old_options_files() {
@@ -572,6 +581,28 @@
''', [AnalysisOptionsWarningCode.UNSUPPORTED_VALUE]);
}
+ test_analyzer_language_supports_empty() {
+ validate('''
+analyzer:
+ language:
+''', []);
+ }
+
+ test_analyzer_language_bad_format_scalar() {
+ validate('''
+analyzer:
+ language: true
+''', [AnalysisOptionsWarningCode.INVALID_SECTION_FORMAT]);
+ }
+
+ test_analyzer_language_bad_format_list() {
+ validate('''
+analyzer:
+ language:
+ - enableSuperMixins: true
+''', [AnalysisOptionsWarningCode.INVALID_SECTION_FORMAT]);
+ }
+
test_analyzer_lint_codes_recognized() {
Registry.ruleRegistry.register(new TestRule());
validate('''
@@ -589,11 +620,11 @@
''', []);
}
- test_analyzer_strong_mode_false_deprecated() {
+ test_analyzer_strong_mode_false_removed() {
validate('''
analyzer:
strong-mode: false
- ''', [AnalysisOptionsHintCode.SPEC_MODE_DEPRECATED]);
+ ''', [AnalysisOptionsWarningCode.SPEC_MODE_REMOVED]);
}
test_analyzer_supported_exclude() {
@@ -604,11 +635,27 @@
''', []);
}
- test_analyzer_supported_strong_mode() {
+ test_analyzer_strong_mode_deprecated() {
validate('''
analyzer:
strong-mode: true
- ''', []);
+ ''', [AnalysisOptionsHintCode.STRONG_MODE_SETTING_DEPRECATED]);
+ }
+
+ test_analyzer_strong_mode_unsupported_key() {
+ validate('''
+analyzer:
+ strong-mode:
+ unsupported: true
+''', [AnalysisOptionsWarningCode.UNSUPPORTED_OPTION_WITH_LEGAL_VALUES]);
+ }
+
+ test_analyzer_strong_mode_deprecated_key() {
+ validate('''
+analyzer:
+ strong-mode:
+ declaration-casts: false
+''', [AnalysisOptionsWarningCode.ANALYSIS_OPTION_DEPRECATED]);
}
test_analyzer_supported_strong_mode_supported_bad_value() {
@@ -733,5 +780,6 @@
class TestRule extends LintRule {
TestRule() : super(name: 'fantastic_test_rule');
+
TestRule.withName(String name) : super(name: name);
}
diff --git a/pkg/analyzer/test/src/task/yaml_test.dart b/pkg/analyzer/test/src/task/yaml_test.dart
index e8f8352..aa3391b 100644
--- a/pkg/analyzer/test/src/task/yaml_test.dart
+++ b/pkg/analyzer/test/src/task/yaml_test.dart
@@ -18,7 +18,7 @@
});
}
-isInstanceOf isParseYamlTask = new isInstanceOf<ParseYamlTask>();
+final isParseYamlTask = new TypeMatcher<ParseYamlTask>();
@reflectiveTest
class ParseYamlTaskTest extends AbstractContextTest {
@@ -34,7 +34,7 @@
YamlDocument document = outputs[YAML_DOCUMENT];
expect(document, isNotNull);
var value = document.contents.value;
- expect(value, new isInstanceOf<Map>());
+ expect(value, new TypeMatcher<Map>());
expect(value['rules']['style_guide']['camel_case_types'], isFalse);
expect(outputs[YAML_ERRORS], hasLength(0));
LineInfo lineInfo = outputs[LINE_INFO];
diff --git a/pkg/analyzer/test/src/util/yaml_test.dart b/pkg/analyzer/test/src/util/yaml_test.dart
index ca6054f..d184a38 100644
--- a/pkg/analyzer/test/src/util/yaml_test.dart
+++ b/pkg/analyzer/test/src/util/yaml_test.dart
@@ -104,7 +104,7 @@
void expectEquals(YamlNode actual, YamlNode expected) {
if (expected is YamlScalar) {
- expect(actual, new isInstanceOf<YamlScalar>());
+ expect(actual, new TypeMatcher<YamlScalar>());
expect(expected.value, actual.value);
} else if (expected is YamlList) {
if (actual is YamlList) {
diff --git a/pkg/analyzer/tool/summary/mini_ast.dart b/pkg/analyzer/tool/summary/mini_ast.dart
index d715e53..2b15da7 100644
--- a/pkg/analyzer/tool/summary/mini_ast.dart
+++ b/pkg/analyzer/tool/summary/mini_ast.dart
@@ -2,10 +2,10 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-import 'package:front_end/src/fasta/problems.dart'
- show internalProblem, unsupported;
import 'package:front_end/src/fasta/messages.dart' show Message;
import 'package:front_end/src/fasta/parser.dart';
+import 'package:front_end/src/fasta/problems.dart'
+ show internalProblem, unsupported;
import 'package:front_end/src/fasta/source/stack_listener.dart';
import 'package:front_end/src/scanner/token.dart';
@@ -176,7 +176,7 @@
void endClassBody(int memberCount, Token beginToken, Token endToken) {
debugEvent("ClassBody");
push(popList(memberCount,
- new List<dynamic>.filled(memberCount, null, growable: true)));
+ new List<ClassMember>.filled(memberCount, null, growable: true)));
}
@override
@@ -331,9 +331,9 @@
@override
void endMetadataStar(int count) {
debugEvent("MetadataStar");
- push(
- popList(count, new List<dynamic>.filled(count, null, growable: true)) ??
- NullValue.Metadata);
+ push(popList(
+ count, new List<Annotation>.filled(count, null, growable: true)) ??
+ NullValue.Metadata);
}
void endMethod(
@@ -382,7 +382,8 @@
@override
void endTypeArguments(int count, Token beginToken, Token endToken) {
debugEvent("TypeArguments");
- push(popList(count, new List<dynamic>.filled(count, null, growable: true)));
+ push(
+ popList(count, new List<TypeName>.filled(count, null, growable: true)));
}
@override
diff --git a/pkg/analyzer/tool/test_log_parser/test_log_parser.dart b/pkg/analyzer/tool/test_log_parser/test_log_parser.dart
new file mode 100644
index 0000000..18a5cc9
--- /dev/null
+++ b/pkg/analyzer/tool/test_log_parser/test_log_parser.dart
@@ -0,0 +1,107 @@
+// Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'dart:io';
+
+/// A simple command-line app that reads the content of a file containing the
+/// output from `test.py` and performs some simple analysis of it.
+main(List<String> args) async {
+ if (args.length != 1) {
+ print('Usage: dart test_log_parser logFilePath');
+ return;
+ }
+ String filePath = args[0];
+ List<String> output = new File(filePath).readAsLinesSync();
+ int failureCount = 0;
+ int index = 0;
+ final int expectedPrefixLength = 'Expected: '.length;
+ final int actualPrefixLength = 'Actual: '.length;
+ TestResult currentResult;
+ Map<String, List<TestResult>> testsByExpectedAndActual =
+ <String, List<TestResult>>{};
+ while (index < output.length) {
+ String currentLine = output[index];
+ if (currentLine.startsWith('FAILED:')) {
+ failureCount++;
+ String testName = currentLine.substring(currentLine.lastIndexOf(' ') + 1);
+ String expected = output[index + 1].substring(expectedPrefixLength);
+ String actual = output[index + 2].substring(actualPrefixLength);
+ String key = '$expected-$actual';
+ currentResult = new TestResult(testName, expected, actual);
+ testsByExpectedAndActual
+ .putIfAbsent(key, () => <TestResult>[])
+ .add(currentResult);
+ index += 3;
+ } else if (currentLine.startsWith('stderr:')) {
+ if (currentResult != null) {
+ currentResult.message = output[index + 1];
+ bool hasStackTrace = false;
+ int endIndex = index + 1;
+ while (endIndex < output.length) {
+ String endLine = output[endIndex];
+ if (endLine.startsWith('--- ')) {
+ break;
+ } else if (endLine.startsWith('#0')) {
+ hasStackTrace = true;
+ }
+ endIndex++;
+ }
+ if (hasStackTrace) {
+ currentResult.stackTrace = output.sublist(index + 1, endIndex - 2);
+ }
+ index = endIndex;
+ }
+ } else {
+ index += 1;
+ }
+ }
+
+ List<String> missingCodes = <String>[];
+ for (List<TestResult> results in testsByExpectedAndActual.values) {
+ for (TestResult result in results) {
+ String message = result.message;
+ if (message != null) {
+ if (message.startsWith('Bad state: Unable to convert (')) {
+ missingCodes.add(message);
+ }
+ }
+ }
+ }
+
+ print('$failureCount failing tests:');
+ print('');
+ List<String> keys = testsByExpectedAndActual.keys.toList();
+ keys.sort();
+ for (String key in keys) {
+ print(key);
+ List<TestResult> results = testsByExpectedAndActual[key];
+ results.sort((first, second) => first.testName.compareTo(second.testName));
+ for (TestResult result in results) {
+ if (result.message == null) {
+ print(' ${result.testName}');
+ } else {
+ print(' ${result.testName} (${result.message})');
+ }
+ }
+ }
+ if (missingCodes.isNotEmpty) {
+ missingCodes.sort();
+ print('');
+ print('Missing error codes (${missingCodes.length}):');
+ for (String message in missingCodes) {
+ print(' $message');
+ }
+ }
+}
+
+/// A representation of the result of a single test.
+class TestResult {
+ String testName;
+ String expected;
+ String actual;
+ String message;
+ List<String> stackTrace;
+
+ TestResult(this.testName, this.expected, this.actual);
+}
diff --git a/pkg/analyzer_cli/analysis_options.yaml b/pkg/analyzer_cli/analysis_options.yaml
index 1af681c..301f0e6 100644
--- a/pkg/analyzer_cli/analysis_options.yaml
+++ b/pkg/analyzer_cli/analysis_options.yaml
@@ -1,11 +1,11 @@
analyzer:
- strong-mode: true
exclude:
- 'test/data'
linter:
rules:
+ #- annotate_overrides
- empty_constructor_bodies
- empty_statements
+ #- unawaited_futures
- unnecessary_brace_in_string_interps
- valid_regexps
-
diff --git a/pkg/analyzer_cli/lib/src/options.dart b/pkg/analyzer_cli/lib/src/options.dart
index 80450e8..d0521d3 100644
--- a/pkg/analyzer_cli/lib/src/options.dart
+++ b/pkg/analyzer_cli/lib/src/options.dart
@@ -363,10 +363,9 @@
help: 'Verbose output.',
negatable: false);
- if (telemetry.SHOW_ANALYTICS_UI) {
- parser.addFlag('analytics',
- help: 'Enable or disable sending analytics information to Google.');
- }
+ parser.addFlag('analytics',
+ help: 'Enable or disable sending analytics information to Google.',
+ hide: !telemetry.SHOW_ANALYTICS_UI);
// Build mode options.
if (!hide) {
diff --git a/pkg/analyzer_cli/test/driver_test.dart b/pkg/analyzer_cli/test/driver_test.dart
index fa3df1e..6619bc3 100644
--- a/pkg/analyzer_cli/test/driver_test.dart
+++ b/pkg/analyzer_cli/test/driver_test.dart
@@ -39,6 +39,35 @@
}, name: 'Driver');
}
+/**
+ * Call a test that we think will fail.
+ *
+ * Ensure that we return any thrown exception correctly (avoiding the
+ * package:test zone error handler).
+ */
+callFailingTest(NoArgFunction expectedFailingTestFn) {
+ final Completer completer = new Completer();
+
+ try {
+ runZoned(
+ () async => await expectedFailingTestFn(),
+ onError: (error) {
+ completer.completeError(error);
+ },
+ ).then((result) {
+ completer.complete(result);
+ }).catchError((error) {
+ completer.completeError(error);
+ });
+ } catch (error) {
+ completer.completeError(error);
+ }
+
+ return completer.future;
+}
+
+typedef dynamic NoArgFunction();
+
class BaseTest {
static const emptyOptionsFile = 'data/empty_options.yaml';
@@ -669,6 +698,10 @@
@override
@failingTest
test_fatalWarnings() => callFailingTest(super.test_fatalWarnings);
+
+ @override
+ @failingTest
+ test_notFatalWarnings() => callFailingTest(super.test_notFatalWarnings);
}
@reflectiveTest
@@ -1040,32 +1073,3 @@
@override
noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation);
}
-
-typedef dynamic NoArgFunction();
-
-/**
- * Call a test that we think will fail.
- *
- * Ensure that we return any thrown exception correctly (avoiding the
- * package:test zone error handler).
- */
-callFailingTest(NoArgFunction expectedFailingTestFn) {
- final Completer completer = new Completer();
-
- try {
- runZoned(
- () async => await expectedFailingTestFn(),
- onError: (error) {
- completer.completeError(error);
- },
- ).then((result) {
- completer.complete(result);
- }).catchError((error) {
- completer.completeError(error);
- });
- } catch (error) {
- completer.completeError(error);
- }
-
- return completer.future;
-}
diff --git a/pkg/analyzer_cli/test/embedder_test.dart b/pkg/analyzer_cli/test/embedder_test.dart
index 7f010e7..95285ba 100644
--- a/pkg/analyzer_cli/test/embedder_test.dart
+++ b/pkg/analyzer_cli/test/embedder_test.dart
@@ -53,7 +53,7 @@
]);
DartSdk sdk = driver.sdk;
- expect(sdk, new isInstanceOf<FolderBasedDartSdk>());
+ expect(sdk, const TypeMatcher<FolderBasedDartSdk>());
expect((sdk as FolderBasedDartSdk).useSummary, isFalse);
}));
});
diff --git a/pkg/analyzer_cli/test/sdk_ext_test.dart b/pkg/analyzer_cli/test/sdk_ext_test.dart
index 2863222..0559b3a 100644
--- a/pkg/analyzer_cli/test/sdk_ext_test.dart
+++ b/pkg/analyzer_cli/test/sdk_ext_test.dart
@@ -48,7 +48,7 @@
]);
DartSdk sdk = driver.sdk;
- expect(sdk, new isInstanceOf<FolderBasedDartSdk>());
+ expect(sdk, const TypeMatcher<FolderBasedDartSdk>());
expect((sdk as FolderBasedDartSdk).useSummary, isFalse);
expect(exitCode, 0);
diff --git a/pkg/analyzer_plugin/analysis_options.yaml b/pkg/analyzer_plugin/analysis_options.yaml
index 90f4492..447862b 100644
--- a/pkg/analyzer_plugin/analysis_options.yaml
+++ b/pkg/analyzer_plugin/analysis_options.yaml
@@ -1,11 +1,9 @@
-analyzer:
- strong-mode: true
linter:
rules:
- annotate_overrides
- empty_constructor_bodies
- empty_statements
-# - prefer_single_quotes
+ #- prefer_single_quotes
- unawaited_futures
- unnecessary_brace_in_string_interps
- valid_regexps
diff --git a/pkg/analyzer_plugin/lib/protocol/protocol_common.dart b/pkg/analyzer_plugin/lib/protocol/protocol_common.dart
index a6b6812..91f17fc0 100644
--- a/pkg/analyzer_plugin/lib/protocol/protocol_common.dart
+++ b/pkg/analyzer_plugin/lib/protocol/protocol_common.dart
@@ -1480,12 +1480,12 @@
static const int FLAG_DEPRECATED = 0x20;
static int makeFlags(
- {isAbstract: false,
- isConst: false,
- isFinal: false,
- isStatic: false,
- isPrivate: false,
- isDeprecated: false}) {
+ {bool isAbstract: false,
+ bool isConst: false,
+ bool isFinal: false,
+ bool isStatic: false,
+ bool isPrivate: false,
+ bool isDeprecated: false}) {
int flags = 0;
if (isAbstract) flags |= FLAG_ABSTRACT;
if (isConst) flags |= FLAG_CONST;
@@ -1697,10 +1697,15 @@
}
bool get isAbstract => (flags & FLAG_ABSTRACT) != 0;
+
bool get isConst => (flags & FLAG_CONST) != 0;
+
bool get isFinal => (flags & FLAG_FINAL) != 0;
+
bool get isStatic => (flags & FLAG_STATIC) != 0;
+
bool get isPrivate => (flags & FLAG_PRIVATE) != 0;
+
bool get isDeprecated => (flags & FLAG_DEPRECATED) != 0;
@override
diff --git a/pkg/analyzer_plugin/test/integration/support/integration_tests.dart b/pkg/analyzer_plugin/test/integration/support/integration_tests.dart
index fbeae0c..1756d72 100644
--- a/pkg/analyzer_plugin/test/integration/support/integration_tests.dart
+++ b/pkg/analyzer_plugin/test/integration/support/integration_tests.dart
@@ -15,9 +15,9 @@
import 'integration_test_methods.dart';
import 'protocol_matchers.dart';
-const Matcher isBool = const isInstanceOf<bool>();
+const Matcher isBool = const TypeMatcher<bool>();
-const Matcher isInt = const isInstanceOf<int>();
+const Matcher isInt = const TypeMatcher<int>();
const Matcher isNotification = const MatchesJsonObject(
'notification', const {'event': isString},
@@ -25,7 +25,7 @@
const Matcher isObject = isMap;
-const Matcher isString = const isInstanceOf<String>();
+const Matcher isString = const TypeMatcher<String>();
final Matcher isResponse = new MatchesJsonObject('response', {'id': isString},
optionalFields: {'result': anything, 'error': isRequestError});
@@ -40,7 +40,7 @@
/**
* Assert that [actual] matches [matcher].
*/
-void outOfTestExpect(actual, matcher,
+void outOfTestExpect(actual, Matcher matcher,
{String reason, skip, bool verbose: false}) {
var matchState = {};
try {
@@ -374,7 +374,7 @@
}
if (requiredFields != null) {
requiredFields.forEach((String key, Matcher valueMatcher) {
- if (!item.containsKey(key)) {
+ if (!(item as Map).containsKey(key)) {
mismatches.add((Description mismatchDescription) =>
mismatchDescription
.add('is missing field ')
diff --git a/pkg/analyzer_plugin/test/plugin/mocks.dart b/pkg/analyzer_plugin/test/plugin/mocks.dart
index 3fffc76..a8478b7 100644
--- a/pkg/analyzer_plugin/test/plugin/mocks.dart
+++ b/pkg/analyzer_plugin/test/plugin/mocks.dart
@@ -93,7 +93,9 @@
@override
void listen(void onRequest(Request request),
- {void onDone(), Function onError, Function onNotification}) {
+ {void onDone(),
+ Function onError,
+ Function(Notification) onNotification}) {
_onDone = onDone;
_onError = onError;
_onNotification = onNotification;
diff --git a/pkg/analyzer_plugin/test/src/utilities/change_builder/change_builder_core_test.dart b/pkg/analyzer_plugin/test/src/utilities/change_builder/change_builder_core_test.dart
index e662d11..8da2f7a 100644
--- a/pkg/analyzer_plugin/test/src/utilities/change_builder/change_builder_core_test.dart
+++ b/pkg/analyzer_plugin/test/src/utilities/change_builder/change_builder_core_test.dart
@@ -25,7 +25,7 @@
String path = '/test.dart';
FileEditBuilderImpl fileEditBuilder =
await builder.createFileEditBuilder(path);
- expect(fileEditBuilder, new isInstanceOf<FileEditBuilder>());
+ expect(fileEditBuilder, const TypeMatcher<FileEditBuilder>());
SourceFileEdit fileEdit = fileEditBuilder.fileEdit;
expect(fileEdit.file, path);
}
@@ -126,7 +126,7 @@
builder.addInsertion(10, (EditBuilder builder) {
LinkedEditBuilderImpl linkBuilder =
(builder as EditBuilderImpl).createLinkedEditBuilder();
- expect(linkBuilder, new isInstanceOf<LinkedEditBuilder>());
+ expect(linkBuilder, const TypeMatcher<LinkedEditBuilder>());
});
});
}
@@ -318,7 +318,7 @@
int length = 5;
EditBuilderImpl editBuilder =
(builder as FileEditBuilderImpl).createEditBuilder(offset, length);
- expect(editBuilder, new isInstanceOf<EditBuilder>());
+ expect(editBuilder, const TypeMatcher<EditBuilder>());
SourceEdit sourceEdit = editBuilder.sourceEdit;
expect(sourceEdit.length, length);
expect(sourceEdit.offset, offset);
diff --git a/pkg/analyzer_plugin/test/src/utilities/change_builder/change_builder_dart_test.dart b/pkg/analyzer_plugin/test/src/utilities/change_builder/change_builder_dart_test.dart
index c7d2f7b..117e69d 100644
--- a/pkg/analyzer_plugin/test/src/utilities/change_builder/change_builder_dart_test.dart
+++ b/pkg/analyzer_plugin/test/src/utilities/change_builder/change_builder_dart_test.dart
@@ -64,7 +64,7 @@
DartChangeBuilderImpl builder = new DartChangeBuilder(session);
DartFileEditBuilderImpl fileEditBuilder =
await builder.createFileEditBuilder(path);
- expect(fileEditBuilder, new isInstanceOf<DartFileEditBuilder>());
+ expect(fileEditBuilder, const TypeMatcher<DartFileEditBuilder>());
SourceFileEdit fileEdit = fileEditBuilder.fileEdit;
expect(fileEdit.file, path);
}
@@ -2246,7 +2246,7 @@
int length = 5;
DartEditBuilderImpl editBuilder = (builder as DartFileEditBuilderImpl)
.createEditBuilder(offset, length);
- expect(editBuilder, new isInstanceOf<DartEditBuilder>());
+ expect(editBuilder, const TypeMatcher<DartEditBuilder>());
SourceEdit sourceEdit = editBuilder.sourceEdit;
expect(sourceEdit.length, length);
expect(sourceEdit.offset, offset);
diff --git a/pkg/analyzer_plugin/test/src/utilities/visitors/local_declaration_visitor_test.dart b/pkg/analyzer_plugin/test/src/utilities/visitors/local_declaration_visitor_test.dart
index 6329940..b14b1c9 100644
--- a/pkg/analyzer_plugin/test/src/utilities/visitors/local_declaration_visitor_test.dart
+++ b/pkg/analyzer_plugin/test/src/utilities/visitors/local_declaration_visitor_test.dart
@@ -44,7 +44,7 @@
expect(f, isNotNull);
BlockFunctionBody body = f.functionExpression.body;
Statement statement = body.block.statements[0];
- expect(statement, new isInstanceOf<ForEachStatement>());
+ expect(statement, const TypeMatcher<ForEachStatement>());
statement.accept(new TestVisitor(statement.offset));
}
}
diff --git a/pkg/analyzer_plugin/tool/spec/from_html.dart b/pkg/analyzer_plugin/tool/spec/from_html.dart
index 3a108d0..d940d8e 100644
--- a/pkg/analyzer_plugin/tool/spec/from_html.dart
+++ b/pkg/analyzer_plugin/tool/spec/from_html.dart
@@ -212,7 +212,7 @@
String event = html.attributes['event'];
context = '$context.${event != null ? event : 'event'}';
checkAttributes(html, ['event'], context);
- TypeDecl params;
+ TypeObject params;
recurse(html, context, {
'params': (dom.Element child) {
params = typeObjectFromHtml(child, '$context.params');
@@ -365,8 +365,8 @@
String kind = html.attributes['kind'];
String context = kind != null ? kind : 'refactoring';
checkAttributes(html, ['kind'], context);
- TypeDecl feedback;
- TypeDecl options;
+ TypeObject feedback;
+ TypeObject options;
recurse(html, context, {
'feedback': (dom.Element child) {
feedback = typeObjectFromHtml(child, '$context.feedback');
@@ -422,8 +422,8 @@
optionalAttributes: ['experimental', 'deprecated']);
bool experimental = html.attributes['experimental'] == 'true';
bool deprecated = html.attributes['deprecated'] == 'true';
- TypeDecl params;
- TypeDecl result;
+ TypeObject params;
+ TypeObject result;
recurse(html, context, {
'params': (dom.Element child) {
params = typeObjectFromHtml(child, '$context.params');
diff --git a/pkg/compiler/lib/src/js_emitter/native_emitter.dart b/pkg/compiler/lib/src/js_emitter/native_emitter.dart
index b931c3b..42dcf2f 100644
--- a/pkg/compiler/lib/src/js_emitter/native_emitter.dart
+++ b/pkg/compiler/lib/src/js_emitter/native_emitter.dart
@@ -76,8 +76,10 @@
* [classesModifiedByEmitRTISupport] contains the list of classes that must
* exist, because runtime-type support adds information to the class.
*/
- Set<Class> prepareNativeClasses(List<Class> classes,
- Set<ClassEntity> interceptorClassesNeededByConstants) {
+ Set<Class> prepareNativeClasses(
+ List<Class> classes,
+ Set<ClassEntity> interceptorClassesNeededByConstants,
+ Iterable<ClassEntity> classesNeededForRti) {
assert(classes.every((Class cls) => cls != null));
hasNativeClasses = classes.isNotEmpty;
@@ -134,6 +136,8 @@
needed = true;
} else if (interceptorClassesNeededByConstants.contains(classElement)) {
needed = true;
+ } else if (classesNeededForRti.contains(classElement)) {
+ needed = true;
} else if (extensionPoints.containsKey(cls)) {
needed = true;
}
diff --git a/pkg/compiler/lib/src/js_emitter/program_builder/program_builder.dart b/pkg/compiler/lib/src/js_emitter/program_builder/program_builder.dart
index 051d3e7..31545bb 100644
--- a/pkg/compiler/lib/src/js_emitter/program_builder/program_builder.dart
+++ b/pkg/compiler/lib/src/js_emitter/program_builder/program_builder.dart
@@ -102,6 +102,7 @@
final Registry _registry;
final FunctionEntity _mainFunction;
+ final Iterable<ClassEntity> _rtiNeededClasses;
/// True if the program should store function types in the metadata.
bool _storeFunctionTypesInMetadata = false;
@@ -136,7 +137,7 @@
this._inferredData,
this._sourceInformationStrategy,
this._sorter,
- Set<ClassEntity> rtiNeededClasses,
+ this._rtiNeededClasses,
this._mainFunction)
: this.collector = new Collector(
_options,
@@ -151,7 +152,7 @@
_interceptorData,
_oneShotInterceptorData,
_closedWorld,
- rtiNeededClasses,
+ _rtiNeededClasses,
_generatedCode,
_sorter),
this._registry = new Registry(_outputUnitData.mainOutputUnit, _sorter);
@@ -236,7 +237,7 @@
collector.computeInterceptorsReferencedFromConstants();
_unneededNativeClasses = _task.nativeEmitter.prepareNativeClasses(
- nativeClasses, interceptorClassesNeededByConstants);
+ nativeClasses, interceptorClassesNeededByConstants, _rtiNeededClasses);
_addJsInteropStubs(_registry.mainLibrariesMap);
diff --git a/pkg/compiler/lib/src/kernel/env.dart b/pkg/compiler/lib/src/kernel/env.dart
index ec0511b..e907171 100644
--- a/pkg/compiler/lib/src/kernel/env.dart
+++ b/pkg/compiler/lib/src/kernel/env.dart
@@ -392,8 +392,14 @@
continue;
}
if (!includeStatic && member.isStatic) continue;
- if (!includeNoSuchMethodForwarders && member.isNoSuchMethodForwarder) {
- continue;
+ if (member.isNoSuchMethodForwarder) {
+ // TODO(sigmund): remove once #33665 is fixed.
+ if (!includeNoSuchMethodForwarders ||
+ member.name.isPrivate &&
+ member.name.libraryName !=
+ member.enclosingLibrary.reference) {
+ continue;
+ }
}
var name = member.name.name;
assert(!name.contains('#'));
diff --git a/pkg/compiler/lib/src/ssa/builder_kernel.dart b/pkg/compiler/lib/src/ssa/builder_kernel.dart
index 795ed34..40d863f 100644
--- a/pkg/compiler/lib/src/ssa/builder_kernel.dart
+++ b/pkg/compiler/lib/src/ssa/builder_kernel.dart
@@ -3047,6 +3047,11 @@
if (node.initializer == null) {
HInstruction initialValue = graph.addConstantNull(closedWorld);
localsHandler.updateLocal(local, initialValue);
+ } else if (node.isConst) {
+ ConstantValue constant = _elementMap.getConstantValue(node.initializer);
+ assert(constant != null, failedAt(CURRENT_ELEMENT_SPANNABLE));
+ HInstruction initialValue = graph.addConstant(constant, closedWorld);
+ localsHandler.updateLocal(local, initialValue);
} else {
node.initializer.accept(this);
HInstruction initialValue = pop();
diff --git a/pkg/dev_compiler/tool/input_sdk/patch/async_patch.dart b/pkg/dev_compiler/tool/input_sdk/patch/async_patch.dart
index 0c5a8a6..ae23c11 100644
--- a/pkg/dev_compiler/tool/input_sdk/patch/async_patch.dart
+++ b/pkg/dev_compiler/tool/input_sdk/patch/async_patch.dart
@@ -67,54 +67,68 @@
};
var zone = Zone.current;
- if (zone != Zone.root) {
+ if (!identical(zone, _rootZone)) {
onValue = zone.registerUnaryCallback(onValue);
onError = zone.registerUnaryCallback(onError);
}
+
var asyncFuture = _Future<T>();
- var body = () {
+
+ // This will be set to true once we've yielded to the event loop.
+ //
+ // Before we've done that, we need to complete the future asynchronously to
+ // match dart2js/VM. See https://github.com/dart-lang/sdk/issues/33330
+ //
+ // Once we've yielded to the event loop we can complete synchronously.
+ // Other implementations call this `isSync` to indicate that.
+ bool isRunningAsEvent = false;
+ runBody() {
try {
iter = JS('', '#[Symbol.iterator]()', initGenerator());
var iteratorValue = JS('', '#.next(null)', iter);
var value = JS('', '#.value', iteratorValue);
if (JS('bool', '#.done', iteratorValue)) {
- // TODO(jmesserly): this is needed to work around unsoundness in our
- // allowed cast failures. We have async methods that return a raw Future
- // where a Future<T> is expected. If we call:
+ // TODO(jmesserly): this is a workaround for ignored cast failures.
+ // Remove it once we've fixed those. We should be able to call:
//
- // asyncFuture._complete(value);
+ // if (isRunningAsEvent) {
+ // asyncFuture._complete(value);
+ // } else {
+ // asyncFuture._asyncComplete(value);
+ // }
//
- // Then it ends up interpreting these invalid Future<dynamic> as values
- // rather than as futures (because complete checks `is Future<T>`).
- //
- // For now we inline `_Future._complete` and handle the unsoundness by
- // checking against raw future types instead of the Fuutre<T> types.
+ // But if the user code returns `Future<dynamic>` instead of
+ // `Future<T>`, that function won't recognize it as a future and will
+ // instead treat it as a completed value.
if (value is Future) {
if (value is _Future) {
_Future._chainCoreFuture(value, asyncFuture);
} else {
_Future._chainForeignFuture(value, asyncFuture);
}
- } else {
+ } else if (isRunningAsEvent) {
asyncFuture._completeWithValue(JS('', '#', value));
+ } else {
+ asyncFuture._asyncComplete(JS('', '#', value));
}
} else {
_Future._chainCoreFuture(onAwait(value), asyncFuture);
}
} catch (e, s) {
- if (dart.startAsyncSynchronously) {
- scheduleMicrotask(() {
- _completeWithErrorCallback(asyncFuture, e, s);
- });
- } else {
+ if (isRunningAsEvent) {
_completeWithErrorCallback(asyncFuture, e, s);
+ } else {
+ _asyncCompleteWithErrorCallback(asyncFuture, e, s);
}
}
- };
+ }
+
if (dart.startAsyncSynchronously) {
- body();
+ runBody();
+ isRunningAsEvent = true;
} else {
- scheduleMicrotask(body);
+ isRunningAsEvent = true;
+ scheduleMicrotask(runBody);
}
return asyncFuture;
}
diff --git a/pkg/dev_compiler/tool/input_sdk/patch/io_patch.dart b/pkg/dev_compiler/tool/input_sdk/patch/io_patch.dart
index 20cb5ff..b05a024 100644
--- a/pkg/dev_compiler/tool/input_sdk/patch/io_patch.dart
+++ b/pkg/dev_compiler/tool/input_sdk/patch/io_patch.dart
@@ -461,6 +461,12 @@
{sourceAddress, Duration timeout}) {
throw UnsupportedError("RawSocket constructor");
}
+
+ @patch
+ static Future<ConnectionTask<RawSocket>> startConnect(host, int port,
+ {sourceAddress}) {
+ throw UnsupportedError("RawSocket constructor");
+ }
}
@patch
@@ -470,6 +476,12 @@
{sourceAddress, Duration timeout}) {
throw UnsupportedError("Socket constructor");
}
+
+ @patch
+ static Future<ConnectionTask<Socket>> _startConnect(host, int port,
+ {sourceAddress}) {
+ throw UnsupportedError("Socket constructor");
+ }
}
@patch
diff --git a/pkg/front_end/analysis_options.yaml b/pkg/front_end/analysis_options.yaml
index 8460b24..b120034 100644
--- a/pkg/front_end/analysis_options.yaml
+++ b/pkg/front_end/analysis_options.yaml
@@ -3,7 +3,6 @@
# BSD-style license that can be found in the LICENSE file.
analyzer:
- strong-mode: true
language:
enableSuperMixins: false
exclude:
diff --git a/pkg/front_end/lib/src/api_unstable/dart2js.dart b/pkg/front_end/lib/src/api_unstable/dart2js.dart
index 943eacf..3ce7148 100644
--- a/pkg/front_end/lib/src/api_unstable/dart2js.dart
+++ b/pkg/front_end/lib/src/api_unstable/dart2js.dart
@@ -78,5 +78,9 @@
return compilerResult;
});
+ // Remove these parameters from [options] - they are no longer needed and
+ // retain state from the previous compile. (http://dartbug.com/33708)
+ options.onError = null;
+ options.fileSystem = null;
return compilerResult?.component;
}
diff --git a/pkg/front_end/lib/src/base/processed_options.dart b/pkg/front_end/lib/src/base/processed_options.dart
index 550d686..fcd9d47 100644
--- a/pkg/front_end/lib/src/base/processed_options.dart
+++ b/pkg/front_end/lib/src/base/processed_options.dart
@@ -33,8 +33,6 @@
import '../fasta/command_line_reporting.dart' as command_line_reporting;
-import '../fasta/deprecated_problems.dart' show deprecated_InputError;
-
import '../fasta/fasta_codes.dart'
show
FormattedMessage,
@@ -55,7 +53,7 @@
import '../fasta/messages.dart' show getLocation;
-import '../fasta/problems.dart' show unimplemented;
+import '../fasta/problems.dart' show DebugAbort, unimplemented;
import '../fasta/severity.dart' show Severity;
@@ -210,17 +208,17 @@
void report(LocatedMessage message, Severity severity,
{List<LocatedMessage> context}) {
- context ??= [];
+ context ??= const <LocatedMessage>[];
if (_raw.onProblem != null) {
- _raw.onProblem(format(message, severity), severity,
- context.map((message) => format(message, Severity.context)).toList());
+ List<FormattedMessage> formattedContext =
+ new List<FormattedMessage>(context.length);
+ for (int i = 0; i < context.length; i++) {
+ formattedContext[i] = format(context[i], severity);
+ }
+ _raw.onProblem(format(message, severity), severity, formattedContext);
if (command_line_reporting.shouldThrowOn(severity)) {
- if (verbose) print(StackTrace.current);
- throw new deprecated_InputError(
- message.uri,
- message.charOffset,
- "Compilation aborted due to fatal "
- "${command_line_reporting.severityName(severity)}.");
+ throw new DebugAbort(
+ message.uri, message.charOffset, severity, StackTrace.current);
}
return;
}
@@ -348,8 +346,8 @@
var uris = _raw.inputSummaries;
if (uris == null || uris.isEmpty) return const <Component>[];
// TODO(sigmund): throttle # of concurrent opreations.
- var allBytes = await Future
- .wait(uris.map((uri) => fileSystem.entityForUri(uri).readAsBytes()));
+ var allBytes = await Future.wait(
+ uris.map((uri) => fileSystem.entityForUri(uri).readAsBytes()));
_inputSummariesComponents =
allBytes.map((bytes) => loadComponent(bytes, nameRoot)).toList();
}
@@ -363,8 +361,8 @@
var uris = _raw.linkedDependencies;
if (uris == null || uris.isEmpty) return const <Component>[];
// TODO(sigmund): throttle # of concurrent opreations.
- var allBytes = await Future
- .wait(uris.map((uri) => fileSystem.entityForUri(uri).readAsBytes()));
+ var allBytes = await Future.wait(
+ uris.map((uri) => fileSystem.entityForUri(uri).readAsBytes()));
_linkedDependencies =
allBytes.map((bytes) => loadComponent(bytes, nameRoot)).toList();
}
diff --git a/pkg/front_end/lib/src/fasta/builder/class_builder.dart b/pkg/front_end/lib/src/fasta/builder/class_builder.dart
index a0d314c..4f95542 100644
--- a/pkg/front_end/lib/src/fasta/builder/class_builder.dart
+++ b/pkg/front_end/lib/src/fasta/builder/class_builder.dart
@@ -44,6 +44,8 @@
final ScopeBuilder constructorScopeBuilder;
+ Map<String, ConstructorRedirection> redirectingConstructors;
+
ClassBuilder(
List<MetadataBuilder> metadata,
int modifiers,
@@ -80,6 +82,23 @@
return library.partOfLibrary ?? library;
}
+ /// Registers a constructor redirection for this class and returns true if
+ /// this redirection gives rise to a cycle that has not been reported before.
+ bool checkConstructorCyclic(String source, String target) {
+ ConstructorRedirection redirect = new ConstructorRedirection(target);
+ redirectingConstructors ??= <String, ConstructorRedirection>{};
+ redirectingConstructors[source] = redirect;
+ while (redirect != null) {
+ if (redirect.cycleReported) return false;
+ if (redirect.target == source) {
+ redirect.cycleReported = true;
+ return true;
+ }
+ redirect = redirectingConstructors[redirect.target];
+ }
+ return false;
+ }
+
@override
int resolveConstructors(LibraryBuilder library) {
if (constructorReferences == null) return 0;
@@ -227,3 +246,10 @@
void prepareTopLevelInference() {}
}
+
+class ConstructorRedirection {
+ String target;
+ bool cycleReported;
+
+ ConstructorRedirection(this.target) : cycleReported = false;
+}
diff --git a/pkg/front_end/lib/src/fasta/builder/library_builder.dart b/pkg/front_end/lib/src/fasta/builder/library_builder.dart
index 7e81d10..dcd6413 100644
--- a/pkg/front_end/lib/src/fasta/builder/library_builder.dart
+++ b/pkg/front_end/lib/src/fasta/builder/library_builder.dart
@@ -126,6 +126,8 @@
int finishDeferredLoadTearoffs() => 0;
+ int finishNoSuchMethodForwarders() => 0;
+
int finishNativeMethods() => 0;
int finishPatchMethods() => 0;
diff --git a/pkg/front_end/lib/src/fasta/command_line_reporting.dart b/pkg/front_end/lib/src/fasta/command_line_reporting.dart
index e682431..e54dad5 100644
--- a/pkg/front_end/lib/src/fasta/command_line_reporting.dart
+++ b/pkg/front_end/lib/src/fasta/command_line_reporting.dart
@@ -20,16 +20,15 @@
import 'compiler_context.dart' show CompilerContext;
-import 'deprecated_problems.dart'
- show Crash, deprecated_InputError, safeToString;
+import 'crash.dart' show Crash, safeToString;
import 'fasta_codes.dart' show LocatedMessage;
-import 'messages.dart' show getLocation, getSourceLine, isVerbose;
+import 'messages.dart' show getLocation, getSourceLine;
-import 'problems.dart' show unhandled;
+import 'problems.dart' show DebugAbort, unhandled;
-import 'severity.dart' show Severity;
+import 'severity.dart' show Severity, severityPrefixes;
import 'scanner/characters.dart' show $CARET, $SPACE, $TAB;
@@ -48,8 +47,9 @@
// empty names.
length = 1;
}
+ String prefix = severityPrefixes[severity];
String text =
- "${severityName(severity, capitalized: true)}: ${message.message}";
+ prefix == null ? message.message : "$prefix: ${message.message}";
if (message.tip != null) {
text += "\n${message.tip}";
}
@@ -161,26 +161,6 @@
}
}
-/// Convert [severity] to a name that can be used to prefix a message.
-String severityName(Severity severity, {bool capitalized: false}) {
- switch (severity) {
- case Severity.error:
- return capitalized ? "Error" : "error";
-
- case Severity.internalProblem:
- return capitalized ? "Internal problem" : "internal problem";
-
- case Severity.warning:
- return capitalized ? "Warning" : "warning";
-
- case Severity.context:
- return capitalized ? "Context" : "context";
-
- default:
- return unhandled("$severity", "severityName", -1, null);
- }
-}
-
/// Print a formatted message and throw when errors are treated as fatal.
/// Also set [exitCode] depending on the value of
/// `CompilerContext.current.options.setExitCodeOnProblem`.
@@ -197,11 +177,7 @@
}
print(text);
if (shouldThrowOn(severity)) {
- if (isVerbose) print(StackTrace.current);
- // TODO(sigmund,ahe): ensure there is no circularity when InputError is
- // handled.
- throw new deprecated_InputError(uri, charOffset,
- "Compilation aborted due to fatal ${severityName(severity)}.");
+ throw new DebugAbort(uri, charOffset, severity, StackTrace.current);
}
}
diff --git a/pkg/front_end/lib/src/fasta/compiler_context.dart b/pkg/front_end/lib/src/fasta/compiler_context.dart
index e979f14..eca094e 100644
--- a/pkg/front_end/lib/src/fasta/compiler_context.dart
+++ b/pkg/front_end/lib/src/fasta/compiler_context.dart
@@ -111,6 +111,8 @@
return context;
}
+ static bool get isActive => Zone.current[compilerContextKey] != null;
+
/// Perform [action] in a [Zone] where [this] will be available as
/// `CompilerContext.current`.
Future<T> runInContext<T>(Future<T> action(CompilerContext c)) {
diff --git a/pkg/front_end/lib/src/fasta/crash.dart b/pkg/front_end/lib/src/fasta/crash.dart
new file mode 100644
index 0000000..b587fbc
--- /dev/null
+++ b/pkg/front_end/lib/src/fasta/crash.dart
@@ -0,0 +1,116 @@
+// Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+library fasta.crash;
+
+import 'dart:async' show Future;
+
+import 'dart:convert' show jsonEncode;
+
+import 'dart:io'
+ show ContentType, HttpClient, HttpClientRequest, SocketException, stderr;
+
+export 'deprecated_problems.dart' show withCrashReporting;
+
+const String defaultServerAddress = "http://127.0.0.1:59410/";
+
+/// Tracks if there has been a crash reported through [reportCrash]. Should be
+/// reset between each compilation by calling [resetCrashReporting].
+bool hasCrashed = false;
+
+/// Tracks the first source URI that has been read and is used as a fall-back
+/// for [reportCrash]. Should be reset between each compilation by calling
+/// [resetCrashReporting].
+Uri firstSourceUri;
+
+class Crash {
+ final Uri uri;
+
+ final int charOffset;
+
+ final Object error;
+
+ final StackTrace trace;
+
+ Crash(this.uri, this.charOffset, this.error, this.trace);
+
+ String toString() {
+ return """
+Crash when compiling $uri,
+at character offset $charOffset:
+$error${trace == null ? '' : '\n$trace'}
+""";
+ }
+}
+
+void resetCrashReporting() {
+ firstSourceUri = null;
+ hasCrashed = false;
+}
+
+Future<T> reportCrash<T>(error, StackTrace trace,
+ [Uri uri, int charOffset]) async {
+ note(String note) async {
+ stderr.write(note);
+ await stderr.flush();
+ }
+
+ if (hasCrashed) return new Future<T>.error(error, trace);
+ if (error is Crash) {
+ trace = error.trace ?? trace;
+ uri = error.uri ?? uri;
+ charOffset = error.charOffset ?? charOffset;
+ error = error.error;
+ }
+ uri ??= firstSourceUri;
+ hasCrashed = true;
+ Map<String, dynamic> data = <String, dynamic>{};
+ data["type"] = "crash";
+ data["client"] = "package:fasta";
+ if (uri != null) data["uri"] = "$uri";
+ if (charOffset != null) data["offset"] = charOffset;
+ data["error"] = safeToString(error);
+ data["trace"] = "$trace";
+ String json = jsonEncode(data);
+ HttpClient client = new HttpClient();
+ try {
+ Uri serverUri = Uri.parse(defaultServerAddress);
+ HttpClientRequest request;
+ try {
+ request = await client.postUrl(serverUri);
+ } on SocketException {
+ // Assume the crash logger isn't running.
+ client.close(force: true);
+ return new Future<T>.error(
+ new Crash(uri, charOffset, error, trace), trace);
+ }
+ if (request != null) {
+ await note("\nSending crash report data");
+ request.persistentConnection = false;
+ request.bufferOutput = false;
+ String host = request?.connectionInfo?.remoteAddress?.host;
+ int port = request?.connectionInfo?.remotePort;
+ await note(" to $host:$port");
+ await request
+ ..headers.contentType = ContentType.JSON
+ ..write(json);
+ await request.close();
+ await note(".");
+ }
+ } catch (e, s) {
+ await note("\n${safeToString(e)}\n$s\n");
+ await note("\n\n\nFE::ERROR::$json\n\n\n");
+ }
+ client.close(force: true);
+ await note("\n");
+ return new Future<T>.error(error, trace);
+}
+
+String safeToString(Object object) {
+ try {
+ return "$object";
+ } catch (e) {
+ return "Error when converting ${object.runtimeType} to string.";
+ }
+}
diff --git a/pkg/front_end/lib/src/fasta/deprecated_problems.dart b/pkg/front_end/lib/src/fasta/deprecated_problems.dart
index e197801..1d0c9fa 100644
--- a/pkg/front_end/lib/src/fasta/deprecated_problems.dart
+++ b/pkg/front_end/lib/src/fasta/deprecated_problems.dart
@@ -6,28 +6,21 @@
import 'dart:async' show Future;
-import 'dart:convert' show jsonEncode;
-
-import 'dart:io'
- show ContentType, HttpClient, HttpClientRequest, SocketException, stderr;
-
import 'command_line_reporting.dart' show shouldThrowOn;
+import 'crash.dart' show safeToString;
+
import 'messages.dart'
- show LocatedMessage, noLength, isVerbose, templateUnspecified;
+ show
+ LocatedMessage,
+ isVerbose,
+ noLength,
+ templateInternalProblemDebugAbort,
+ templateUnspecified;
-import 'severity.dart' show Severity;
+import 'severity.dart' show Severity, severityTexts;
-const String defaultServerAddress = "http://127.0.0.1:59410/";
-
-/// Tracks if there has been a crash reported through [reportCrash]. Should be
-/// reset between each compilation by calling [resetCrashReporting].
-bool hasCrashed = false;
-
-/// Tracks the first source URI that has been read and is used as a fall-back
-/// for [reportCrash]. Should be reset between each compilation by calling
-/// [resetCrashReporting].
-Uri firstSourceUri;
+import 'crash.dart' show Crash, reportCrash, resetCrashReporting;
/// Used to report an error in input.
///
@@ -39,123 +32,52 @@
/// handled correctly, the user will never see a stack trace that says "user
/// error".
dynamic deprecated_inputError(Uri uri, int charOffset, Object error) {
+ return deprecated_inputErrorFromMessage(templateUnspecified
+ .withArguments(safeToString(error))
+ .withLocation(uri, charOffset, noLength));
+}
+
+dynamic deprecated_inputErrorFromMessage(LocatedMessage message) {
if (shouldThrowOn(Severity.error) && isVerbose) {
print(StackTrace.current);
}
- throw new deprecated_InputError(uri, charOffset, error);
+ throw new deprecated_InputError(message);
}
class deprecated_InputError {
- final Uri uri;
+ final LocatedMessage message;
- final int charOffset;
+ deprecated_InputError(this.message);
- final Object error;
-
- deprecated_InputError(this.uri, int charOffset, this.error)
- : this.charOffset = charOffset ?? -1;
-
- toString() => "deprecated_InputError: $error";
-
- /// Converts [error] to a [LocatedMessage] using [templateUnspecified]. Using
- /// [templateUnspecified] is deprecated behavior.
- ///
- /// Static method to discourage use and requiring call-sites to include the
- /// text `deprecated_`.
- static LocatedMessage toMessage(deprecated_InputError error) {
- return templateUnspecified
- .withArguments(safeToString(error.error))
- .withLocation(error.uri, error.charOffset, noLength);
- }
+ toString() => "deprecated_InputError: ${message.message}";
}
-class Crash {
- final Uri uri;
-
- final int charOffset;
-
- final Object error;
-
- final StackTrace trace;
-
- Crash(this.uri, this.charOffset, this.error, this.trace);
-
- String toString() {
- return """
-Crash when compiling $uri,
-at character offset $charOffset:
-$error${trace == null ? '' : '\n$trace'}
-""";
- }
+class DebugAbort extends deprecated_InputError {
+ DebugAbort(Uri uri, int charOffset, Severity severity, StackTrace trace)
+ : super(templateInternalProblemDebugAbort
+ .withArguments(severityTexts[severity], "$trace")
+ .withLocation(uri, charOffset, noLength));
}
-void resetCrashReporting() {
- firstSourceUri = null;
- hasCrashed = false;
-}
-
-Future<T> reportCrash<T>(error, StackTrace trace,
- [Uri uri, int charOffset]) async {
- note(String note) async {
- stderr.write(note);
- await stderr.flush();
- }
-
- if (hasCrashed) return new Future<T>.error(error, trace);
- if (error is Crash) {
- trace = error.trace ?? trace;
- uri = error.uri ?? uri;
- charOffset = error.charOffset ?? charOffset;
- error = error.error;
- }
- uri ??= firstSourceUri;
- hasCrashed = true;
- Map<String, dynamic> data = <String, dynamic>{};
- data["type"] = "crash";
- data["client"] = "package:fasta";
- if (uri != null) data["uri"] = "$uri";
- if (charOffset != null) data["offset"] = charOffset;
- data["error"] = safeToString(error);
- data["trace"] = "$trace";
- String json = jsonEncode(data);
- HttpClient client = new HttpClient();
+// TODO(ahe): Move this method to crash.dart when it's no longer using
+// [deprecated_InputError].
+Future<T> withCrashReporting<T>(
+ Future<T> Function() action, Uri Function() currentUri,
+ {T Function(LocatedMessage) onInputError}) async {
+ resetCrashReporting();
try {
- Uri serverUri = Uri.parse(defaultServerAddress);
- HttpClientRequest request;
- try {
- request = await client.postUrl(serverUri);
- } on SocketException {
- // Assume the crash logger isn't running.
- client.close(force: true);
- return new Future<T>.error(
- new Crash(uri, charOffset, error, trace), trace);
- }
- if (request != null) {
- await note("\nSending crash report data");
- request.persistentConnection = false;
- request.bufferOutput = false;
- String host = request?.connectionInfo?.remoteAddress?.host;
- int port = request?.connectionInfo?.remotePort;
- await note(" to $host:$port");
- await request
- ..headers.contentType = ContentType.JSON
- ..write(json);
- await request.close();
- await note(".");
+ return await action();
+ } on Crash {
+ rethrow;
+ } on DebugAbort {
+ rethrow;
+ } on deprecated_InputError catch (e, s) {
+ if (onInputError != null) {
+ return onInputError(e.message);
+ } else {
+ return reportCrash(e, s, currentUri());
}
} catch (e, s) {
- await note("\n${safeToString(e)}\n$s\n");
- await note("\n\n\nFE::ERROR::$json\n\n\n");
- }
- client.close(force: true);
- await note("\n");
- return new Future<T>.error(error, trace);
-}
-
-String safeToString(Object object) {
- try {
- return "$object";
- } catch (e) {
- return "Error when converting ${object.runtimeType} to string.";
+ return reportCrash(e, s, currentUri());
}
}
diff --git a/pkg/front_end/lib/src/fasta/fasta_codes_generated.dart b/pkg/front_end/lib/src/fasta/fasta_codes_generated.dart
index 17e0074..166a2ef 100644
--- a/pkg/front_end/lib/src/fasta/fasta_codes_generated.dart
+++ b/pkg/front_end/lib/src/fasta/fasta_codes_generated.dart
@@ -47,6 +47,7 @@
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
const MessageCode messageAbstractNotSync = const MessageCode("AbstractNotSync",
+ analyzerCode: "NON_SYNC_ABSTRACT_METHOD",
dart2jsCode: "*ignored*",
message: r"""Abstract methods can't use 'async', 'async*', or 'sync*'.""");
@@ -211,6 +212,7 @@
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
const MessageCode messageAwaitNotAsync = const MessageCode("AwaitNotAsync",
+ analyzerCode: "AWAIT_IN_WRONG_CONTEXT",
dart2jsCode: "*ignored*",
message: r"""'await' can only be used in 'async' or 'async*' methods.""");
@@ -234,7 +236,7 @@
const Code<Message Function(String name, String name2)>(
"BoundIssueViaCycleNonSimplicity",
templateBoundIssueViaCycleNonSimplicity,
- analyzerCode: "STRONG_MODE_NOT_INSTANTIATED_BOUND",
+ analyzerCode: "NOT_INSTANTIATED_BOUND",
dart2jsCode: "*fatal*",
severity: Severity.error);
@@ -263,7 +265,7 @@
const Code<Message Function(String name)> codeBoundIssueViaLoopNonSimplicity =
const Code<Message Function(String name)>("BoundIssueViaLoopNonSimplicity",
templateBoundIssueViaLoopNonSimplicity,
- analyzerCode: "STRONG_MODE_NOT_INSTANTIATED_BOUND",
+ analyzerCode: "NOT_INSTANTIATED_BOUND",
dart2jsCode: "*fatal*",
severity: Severity.error);
@@ -291,7 +293,7 @@
const Code<Message Function(String name)>(
"BoundIssueViaRawTypeWithNonSimpleBounds",
templateBoundIssueViaRawTypeWithNonSimpleBounds,
- analyzerCode: "STRONG_MODE_NOT_INSTANTIATED_BOUND",
+ analyzerCode: "SNOT_INSTANTIATED_BOUND",
dart2jsCode: "*fatal*",
severity: Severity.error);
@@ -474,6 +476,7 @@
const Code<Message Function(String string)> codeCantInferTypeDueToCircularity =
const Code<Message Function(String string)>(
"CantInferTypeDueToCircularity", templateCantInferTypeDueToCircularity,
+ analyzerCode: "RECURSIVE_COMPILE_TIME_CONSTANT",
severity: Severity.error);
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
@@ -498,9 +501,11 @@
const Code<Message Function(String string)>
codeCantInferTypeDueToInconsistentOverrides =
const Code<Message Function(String string)>(
- "CantInferTypeDueToInconsistentOverrides",
- templateCantInferTypeDueToInconsistentOverrides,
-);
+ "CantInferTypeDueToInconsistentOverrides",
+ templateCantInferTypeDueToInconsistentOverrides,
+ analyzerCode: "INVALID_METHOD_OVERRIDE",
+ dart2jsCode: "*fatal*",
+ severity: Severity.error);
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
Message _withArgumentsCantInferTypeDueToInconsistentOverrides(String string) {
@@ -512,6 +517,63 @@
}
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
+const Template<
+ Message Function(
+ Token
+ token)> templateCantUseDeferredPrefixAsConstant = const Template<
+ Message Function(Token token)>(
+ messageTemplate:
+ r"""'#lexeme' can't be used in a constant expression because it's marked as 'deferred' which means it isn't available until loaded.""",
+ tipTemplate:
+ r"""Try moving the constant from the deferred library, or removing 'deferred' from the import.
+""",
+ withArguments: _withArgumentsCantUseDeferredPrefixAsConstant);
+
+// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
+const Code<Message Function(Token token)> codeCantUseDeferredPrefixAsConstant =
+ const Code<Message Function(Token token)>("CantUseDeferredPrefixAsConstant",
+ templateCantUseDeferredPrefixAsConstant,
+ analyzerCode: "CONST_DEFERRED_CLASS",
+ dart2jsCode: "*fatal*",
+ severity: Severity.error);
+
+// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
+Message _withArgumentsCantUseDeferredPrefixAsConstant(Token token) {
+ String lexeme = token.lexeme;
+ return new Message(codeCantUseDeferredPrefixAsConstant,
+ message:
+ """'${lexeme}' can't be used in a constant expression because it's marked as 'deferred' which means it isn't available until loaded.""",
+ tip: """Try moving the constant from the deferred library, or removing 'deferred' from the import.
+""",
+ arguments: {'token': token});
+}
+
+// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
+const Code<Null> codeCantUsePrefixAsExpression =
+ messageCantUsePrefixAsExpression;
+
+// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
+const MessageCode messageCantUsePrefixAsExpression = const MessageCode(
+ "CantUsePrefixAsExpression",
+ analyzerCode: "PREFIX_IDENTIFIER_NOT_FOLLOWED_BY_DOT",
+ dart2jsCode: "*fatal*",
+ severity: Severity.error,
+ message: r"""A prefix can't be used as an expression.""");
+
+// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
+const Code<Null> codeCantUsePrefixWithNullAware =
+ messageCantUsePrefixWithNullAware;
+
+// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
+const MessageCode messageCantUsePrefixWithNullAware = const MessageCode(
+ "CantUsePrefixWithNullAware",
+ analyzerCode: "PREFIX_IDENTIFIER_NOT_FOLLOWED_BY_DOT",
+ dart2jsCode: "*fatal*",
+ severity: Severity.error,
+ message: r"""A prefix can't be used with null-aware operators.""",
+ tip: r"""It should be safe to remove the '?' as a prefix is never null.""");
+
+// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
const Template<Message Function(DartType _type)>
templateCantUseSuperBoundedTypeForInstanceCreation =
const Template<Message Function(DartType _type)>(
@@ -786,6 +848,8 @@
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
const MessageCode messageConstConstructorNonFinalField = const MessageCode(
"ConstConstructorNonFinalField",
+ analyzerCode: "CONST_CONSTRUCTOR_WITH_NON_FINAL_FIELD",
+ dart2jsCode: "*fatal*",
message: r"""Constructor is marked 'const' so all fields must be final.""");
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
@@ -1191,6 +1255,19 @@
tip: r"""Try removing the 'const' keyword.""");
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
+const Code<Null> codeConstructorCyclic = messageConstructorCyclic;
+
+// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
+const MessageCode messageConstructorCyclic = const MessageCode(
+ "ConstructorCyclic",
+ analyzerCode: "RECURSIVE_CONSTRUCTOR_REDIRECT",
+ dart2jsCode: "*fatal*",
+ severity: Severity.error,
+ message: r"""Redirecting constructers can't be cyclic.""",
+ tip:
+ r"""Try to have all constructors eventually redirect to a non-redirecting constructor.""");
+
+// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
const Template<Message Function(String name)> templateConstructorNotFound =
const Template<Message Function(String name)>(
messageTemplate: r"""Couldn't find constructor '#name'.""",
@@ -1228,6 +1305,8 @@
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
const MessageCode messageConstructorWithTypeParameters = const MessageCode(
"ConstructorWithTypeParameters",
+ analyzerCode: "TYPE_PARAMETER_ON_CONSTRUCTOR",
+ dart2jsCode: "*fatal*",
severity: Severity.error,
message: r"""Constructors can't have type parameters.""");
@@ -1389,9 +1468,9 @@
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
const Code<Message Function(String name)> codeCyclicTypedef =
const Code<Message Function(String name)>(
- "CyclicTypedef",
- templateCyclicTypedef,
-);
+ "CyclicTypedef", templateCyclicTypedef,
+ analyzerCode: "TYPE_ALIAS_CANNOT_REFERENCE_ITSELF",
+ dart2jsCode: "*fatal*");
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
Message _withArgumentsCyclicTypedef(String name) {
@@ -1446,9 +1525,8 @@
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
const Code<Message Function(String name)> codeDeferredPrefixDuplicated =
const Code<Message Function(String name)>(
- "DeferredPrefixDuplicated",
- templateDeferredPrefixDuplicated,
-);
+ "DeferredPrefixDuplicated", templateDeferredPrefixDuplicated,
+ analyzerCode: "SHARED_DEFERRED_PREFIX", dart2jsCode: "*fatal*");
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
Message _withArgumentsDeferredPrefixDuplicated(String name) {
@@ -1720,6 +1798,8 @@
codeDuplicatedImportInType =
const Code<Message Function(String name, Uri uri_, Uri uri2_)>(
"DuplicatedImportInType", templateDuplicatedImportInType,
+ analyzerCode: "AMBIGUOUS_IMPORT",
+ dart2jsCode: "*fatal*",
severity: Severity.errorLegacyWarning);
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
@@ -1764,6 +1844,8 @@
const Code<Message Function(String name)> codeDuplicatedName =
const Code<Message Function(String name)>(
"DuplicatedName", templateDuplicatedName,
+ analyzerCode: "DUPLICATE_DEFINITION",
+ dart2jsCode: "*fatal*",
severity: Severity.error);
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
@@ -1831,6 +1913,7 @@
const Code<Message Function(String name)>(
"DuplicatedNamePreviouslyUsedCause",
templateDuplicatedNamePreviouslyUsedCause,
+ analyzerCode: "REFERENCED_BEFORE_DECLARATION",
severity: Severity.context);
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
@@ -1848,9 +1931,8 @@
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
const Code<Message Function(String name)> codeDuplicatedParameterName =
const Code<Message Function(String name)>(
- "DuplicatedParameterName",
- templateDuplicatedParameterName,
-);
+ "DuplicatedParameterName", templateDuplicatedParameterName,
+ analyzerCode: "DUPLICATE_DEFINITION", dart2jsCode: "*fatal*");
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
Message _withArgumentsDuplicatedParameterName(String name) {
@@ -2518,6 +2600,7 @@
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
const MessageCode messageFactoryNotSync = const MessageCode("FactoryNotSync",
+ analyzerCode: "NON_SYNC_FACTORY_METHOD",
dart2jsCode: "*ignored*",
message: r"""Factories can't use 'async', 'async*', or 'sync*'.""");
@@ -2790,6 +2873,7 @@
const Code<Message Function(String name)> codeGetterNotFound =
const Code<Message Function(String name)>(
"GetterNotFound", templateGetterNotFound,
+ analyzerCode: "UNDEFINED_GETTER",
severity: Severity.errorLegacyWarning);
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
@@ -2915,14 +2999,17 @@
_type)> templateImplicitCallOfNonMethod = const Template<
Message Function(DartType _type)>(
messageTemplate:
- r"""Can't invoke the type '#type' because its declaration of `.call` is not a method.""",
- tipTemplate: r"""Change .call to a method or explicitly invoke .call.""",
+ r"""Cannot invoke an instance of '#type' because it declares 'call' to be something other than a method.""",
+ tipTemplate:
+ r"""Try changing 'call' to a method or explicitly invoke 'call'.""",
withArguments: _withArgumentsImplicitCallOfNonMethod);
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
const Code<Message Function(DartType _type)> codeImplicitCallOfNonMethod =
const Code<Message Function(DartType _type)>(
"ImplicitCallOfNonMethod", templateImplicitCallOfNonMethod,
+ analyzerCode: "IMPLICIT_CALL_OF_NON_METHOD",
+ dart2jsCode: "*fatal*",
severity: Severity.error);
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
@@ -2934,8 +3021,8 @@
return new Message(codeImplicitCallOfNonMethod,
message:
- """Can't invoke the type '${type}' because its declaration of `.call` is not a method.""",
- tip: """Change .call to a method or explicitly invoke .call.""",
+ """Cannot invoke an instance of '${type}' because it declares 'call' to be something other than a method.""",
+ tip: """Try changing 'call' to a method or explicitly invoke 'call'.""",
arguments: {'type': _type});
}
@@ -3239,6 +3326,27 @@
}
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
+const Template<Message Function(String name, String string)>
+ templateInternalProblemDebugAbort =
+ const Template<Message Function(String name, String string)>(
+ messageTemplate: r"""Compilation aborted due to fatal '#name' at:
+#string""", withArguments: _withArgumentsInternalProblemDebugAbort);
+
+// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
+const Code<Message Function(String name, String string)>
+ codeInternalProblemDebugAbort =
+ const Code<Message Function(String name, String string)>(
+ "InternalProblemDebugAbort", templateInternalProblemDebugAbort,
+ severity: Severity.internalProblem);
+
+// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
+Message _withArgumentsInternalProblemDebugAbort(String name, String string) {
+ return new Message(codeInternalProblemDebugAbort,
+ message: """Compilation aborted due to fatal '${name}' at:
+${string}""", arguments: {'name': name, 'string': string});
+}
+
+// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
const Code<Null> codeInternalProblemExtendingUnmodifiableScope =
messageInternalProblemExtendingUnmodifiableScope;
@@ -3509,52 +3617,24 @@
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
const Template<Message Function(String string)>
- templateInternalVerificationError =
+ templateInternalProblemVerificationError =
const Template<Message Function(String string)>(
messageTemplate: r"""Verification of the generated program failed:
-#string""", withArguments: _withArgumentsInternalVerificationError);
-
-// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
-const Code<Message Function(String string)> codeInternalVerificationError =
- const Code<Message Function(String string)>(
- "InternalVerificationError",
- templateInternalVerificationError,
-);
-
-// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
-Message _withArgumentsInternalVerificationError(String string) {
- return new Message(codeInternalVerificationError,
- message: """Verification of the generated program failed:
-${string}""", arguments: {'string': string});
-}
-
-// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
-const Template<
- Message Function(
- String
- string)> templateInternalVisitorUnsupportedDefault = const Template<
- Message Function(String string)>(
- messageTemplate:
- r"""Trying to invoke a default visiting method of a visitor on a node #string.""",
- tipTemplate:
- r"""Try invoking one of the specialized 'visit' methods instead.""",
- withArguments: _withArgumentsInternalVisitorUnsupportedDefault);
+#string""", withArguments: _withArgumentsInternalProblemVerificationError);
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
const Code<Message Function(String string)>
- codeInternalVisitorUnsupportedDefault =
+ codeInternalProblemVerificationError =
const Code<Message Function(String string)>(
- "InternalVisitorUnsupportedDefault",
- templateInternalVisitorUnsupportedDefault,
+ "InternalProblemVerificationError",
+ templateInternalProblemVerificationError,
severity: Severity.internalProblem);
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
-Message _withArgumentsInternalVisitorUnsupportedDefault(String string) {
- return new Message(codeInternalVisitorUnsupportedDefault,
- message:
- """Trying to invoke a default visiting method of a visitor on a node ${string}.""",
- tip: """Try invoking one of the specialized 'visit' methods instead.""",
- arguments: {'string': string});
+Message _withArgumentsInternalProblemVerificationError(String string) {
+ return new Message(codeInternalProblemVerificationError,
+ message: """Verification of the generated program failed:
+${string}""", arguments: {'string': string});
}
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
@@ -4169,6 +4249,7 @@
const Code<Message Function(String name)> codeMethodNotFound =
const Code<Message Function(String name)>(
"MethodNotFound", templateMethodNotFound,
+ analyzerCode: "UNDEFINED_METHOD",
severity: Severity.errorLegacyWarning);
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
@@ -4385,9 +4466,8 @@
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
const Code<Message Function(Uri uri_)> codeMissingPartOf =
const Code<Message Function(Uri uri_)>(
- "MissingPartOf",
- templateMissingPartOf,
-);
+ "MissingPartOf", templateMissingPartOf,
+ analyzerCode: "PART_OF_NON_PART");
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
Message _withArgumentsMissingPartOf(Uri uri_) {
@@ -4559,6 +4639,8 @@
const Code<Message Function(String name)> codeNoSuchNamedParameter =
const Code<Message Function(String name)>(
"NoSuchNamedParameter", templateNoSuchNamedParameter,
+ analyzerCode: "UNDEFINED_NAMED_PARAMETER",
+ dart2jsCode: "*fatal*",
severity: Severity.errorLegacyWarning);
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
@@ -4704,29 +4786,31 @@
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
const Template<
Message Function(
- String name,
- String
- name2)> templateNotAPrefixInTypeAnnotation = const Template<
- Message Function(String name, String name2)>(
+ Token token,
+ Token
+ token2)> templateNotAPrefixInTypeAnnotation = const Template<
+ Message Function(Token token, Token token2)>(
messageTemplate:
- r"""'#name.#name2' can't be used as a type because '#name' doesn't refer to an import prefix.""",
+ r"""'#lexeme.#lexeme2' can't be used as a type because '#lexeme' doesn't refer to an import prefix.""",
withArguments: _withArgumentsNotAPrefixInTypeAnnotation);
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
-const Code<Message Function(String name, String name2)>
+const Code<Message Function(Token token, Token token2)>
codeNotAPrefixInTypeAnnotation =
- const Code<Message Function(String name, String name2)>(
+ const Code<Message Function(Token token, Token token2)>(
"NotAPrefixInTypeAnnotation", templateNotAPrefixInTypeAnnotation,
analyzerCode: "NOT_A_TYPE",
dart2jsCode: "*ignored*",
severity: Severity.errorLegacyWarning);
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
-Message _withArgumentsNotAPrefixInTypeAnnotation(String name, String name2) {
+Message _withArgumentsNotAPrefixInTypeAnnotation(Token token, Token token2) {
+ String lexeme = token.lexeme;
+ String lexeme2 = token2.lexeme;
return new Message(codeNotAPrefixInTypeAnnotation,
message:
- """'${name}.${name2}' can't be used as a type because '${name}' doesn't refer to an import prefix.""",
- arguments: {'name': name, 'name2': name2});
+ """'${lexeme}.${lexeme2}' can't be used as a type because '${lexeme}' doesn't refer to an import prefix.""",
+ arguments: {'token': token, 'token2': token2});
}
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
@@ -4779,10 +4863,10 @@
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
const Code<Message Function(String name)> codeOperatorMinusParameterMismatch =
- const Code<Message Function(String name)>(
- "OperatorMinusParameterMismatch",
- templateOperatorMinusParameterMismatch,
-);
+ const Code<Message Function(String name)>("OperatorMinusParameterMismatch",
+ templateOperatorMinusParameterMismatch,
+ analyzerCode: "WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR_MINUS",
+ dart2jsCode: "*fatal*");
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
Message _withArgumentsOperatorMinusParameterMismatch(String name) {
@@ -4825,9 +4909,9 @@
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
const Code<Message Function(String name)> codeOperatorParameterMismatch1 =
const Code<Message Function(String name)>(
- "OperatorParameterMismatch1",
- templateOperatorParameterMismatch1,
-);
+ "OperatorParameterMismatch1", templateOperatorParameterMismatch1,
+ analyzerCode: "WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR",
+ dart2jsCode: "*fatal*");
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
Message _withArgumentsOperatorParameterMismatch1(String name) {
@@ -4847,9 +4931,9 @@
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
const Code<Message Function(String name)> codeOperatorParameterMismatch2 =
const Code<Message Function(String name)>(
- "OperatorParameterMismatch2",
- templateOperatorParameterMismatch2,
-);
+ "OperatorParameterMismatch2", templateOperatorParameterMismatch2,
+ analyzerCode: "WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR",
+ dart2jsCode: "*fatal*");
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
Message _withArgumentsOperatorParameterMismatch2(String name) {
@@ -4929,6 +5013,8 @@
const Code<Message Function(String name, String name2)>(
"OverrideFewerPositionalArguments",
templateOverrideFewerPositionalArguments,
+ analyzerCode: "INVALID_OVERRIDE_POSITIONAL",
+ dart2jsCode: "*fatal*",
severity: Severity.errorLegacyWarning);
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
@@ -4985,6 +5071,8 @@
codeOverrideMoreRequiredArguments =
const Code<Message Function(String name, String name2)>(
"OverrideMoreRequiredArguments", templateOverrideMoreRequiredArguments,
+ analyzerCode: "INVALID_OVERRIDE_REQUIRED",
+ dart2jsCode: "*fatal*",
severity: Severity.errorLegacyWarning);
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
@@ -5152,6 +5240,7 @@
codePartOfLibraryNameMismatch =
const Code<Message Function(Uri uri_, String name, String name2)>(
"PartOfLibraryNameMismatch", templatePartOfLibraryNameMismatch,
+ analyzerCode: "PART_OF_DIFFERENT_LIBRARY",
severity: Severity.errorLegacyWarning);
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
@@ -5169,6 +5258,7 @@
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
const MessageCode messagePartOfSelf = const MessageCode("PartOfSelf",
+ analyzerCode: "PART_OF_NON_PART",
message: r"""A file can't be a part of itself.""");
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
@@ -5219,6 +5309,7 @@
codePartOfUriMismatch =
const Code<Message Function(Uri uri_, Uri uri2_, Uri uri3_)>(
"PartOfUriMismatch", templatePartOfUriMismatch,
+ analyzerCode: "PART_OF_DIFFERENT_LIBRARY",
severity: Severity.errorLegacyWarning);
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
@@ -5251,6 +5342,7 @@
codePartOfUseUri =
const Code<Message Function(Uri uri_, Uri uri2_, String name)>(
"PartOfUseUri", templatePartOfUseUri,
+ analyzerCode: "PART_OF_UNNAMED_LIBRARY",
severity: Severity.errorLegacyWarning);
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
@@ -5272,10 +5364,8 @@
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
const Code<Message Function(Uri uri_)> codePartTwice =
- const Code<Message Function(Uri uri_)>(
- "PartTwice",
- templatePartTwice,
-);
+ const Code<Message Function(Uri uri_)>("PartTwice", templatePartTwice,
+ analyzerCode: "DUPLICATE_PART");
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
Message _withArgumentsPartTwice(Uri uri_) {
@@ -5560,6 +5650,7 @@
const Code<Message Function(String name)> codeSetterNotFound =
const Code<Message Function(String name)>(
"SetterNotFound", templateSetterNotFound,
+ analyzerCode: "UNDEFINED_SETTER",
severity: Severity.errorLegacyWarning);
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
@@ -5809,6 +5900,7 @@
const Code<Message Function(String name)> codeSuperclassHasNoGetter =
const Code<Message Function(String name)>(
"SuperclassHasNoGetter", templateSuperclassHasNoGetter,
+ analyzerCode: "UNDEFINED_SUPER_GETTER",
severity: Severity.errorLegacyWarning);
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
@@ -5849,6 +5941,7 @@
const Code<Message Function(String name)> codeSuperclassHasNoSetter =
const Code<Message Function(String name)>(
"SuperclassHasNoSetter", templateSuperclassHasNoSetter,
+ analyzerCode: "ABSTRACT_SUPER_MEMBER_REFERENCE",
severity: Severity.errorLegacyWarning);
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
@@ -5938,6 +6031,8 @@
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
const MessageCode messageSwitchCaseFallThrough = const MessageCode(
"SwitchCaseFallThrough",
+ analyzerCode: "CASE_BLOCK_NOT_TERMINATED",
+ dart2jsCode: "*fatal*",
severity: Severity.errorLegacyWarning,
message: r"""Switch case may fall through to the next case.""");
@@ -6012,6 +6107,8 @@
const Code<Message Function(int count, int count2)> codeTooFewArguments =
const Code<Message Function(int count, int count2)>(
"TooFewArguments", templateTooFewArguments,
+ analyzerCode: "NOT_ENOUGH_REQUIRED_ARGUMENTS",
+ dart2jsCode: "*fatal*",
severity: Severity.errorLegacyWarning);
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
@@ -6037,6 +6134,8 @@
const Code<Message Function(int count, int count2)> codeTooManyArguments =
const Code<Message Function(int count, int count2)>(
"TooManyArguments", templateTooManyArguments,
+ analyzerCode: "EXTRA_POSITIONAL_ARGUMENTS",
+ dart2jsCode: "*fatal*",
severity: Severity.errorLegacyWarning);
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
@@ -6080,6 +6179,8 @@
const Code<Message Function(String name, int count)> codeTypeArgumentMismatch =
const Code<Message Function(String name, int count)>(
"TypeArgumentMismatch", templateTypeArgumentMismatch,
+ analyzerCode: "WRONG_NUMBER_OF_TYPE_ARGUMENTS",
+ dart2jsCode: "*fatal*",
severity: Severity.errorLegacyWarning);
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
@@ -6358,18 +6459,18 @@
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
const Template<
Message Function(
- String name,
- String
- name2)> templateUnresolvedPrefixInTypeAnnotation = const Template<
- Message Function(String name, String name2)>(
+ Token token,
+ Token
+ token2)> templateUnresolvedPrefixInTypeAnnotation = const Template<
+ Message Function(Token token, Token token2)>(
messageTemplate:
- r"""'#name.#name2' can't be used as a type because '#name' isn't defined.""",
+ r"""'#lexeme.#lexeme2' can't be used as a type because '#lexeme' isn't defined.""",
withArguments: _withArgumentsUnresolvedPrefixInTypeAnnotation);
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
-const Code<Message Function(String name, String name2)>
+const Code<Message Function(Token token, Token token2)>
codeUnresolvedPrefixInTypeAnnotation =
- const Code<Message Function(String name, String name2)>(
+ const Code<Message Function(Token token, Token token2)>(
"UnresolvedPrefixInTypeAnnotation",
templateUnresolvedPrefixInTypeAnnotation,
analyzerCode: "NOT_A_TYPE",
@@ -6378,11 +6479,13 @@
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
Message _withArgumentsUnresolvedPrefixInTypeAnnotation(
- String name, String name2) {
+ Token token, Token token2) {
+ String lexeme = token.lexeme;
+ String lexeme2 = token2.lexeme;
return new Message(codeUnresolvedPrefixInTypeAnnotation,
message:
- """'${name}.${name2}' can't be used as a type because '${name}' isn't defined.""",
- arguments: {'name': name, 'name2': name2});
+ """'${lexeme}.${lexeme2}' can't be used as a type because '${lexeme}' isn't defined.""",
+ arguments: {'token': token, 'token2': token2});
}
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
diff --git a/pkg/front_end/lib/src/fasta/io.dart b/pkg/front_end/lib/src/fasta/io.dart
deleted file mode 100644
index 80e5287..0000000
--- a/pkg/front_end/lib/src/fasta/io.dart
+++ /dev/null
@@ -1,28 +0,0 @@
-// Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-library fasta.io;
-
-import 'dart:async' show Future;
-
-import 'dart:io' show FileSystemException;
-
-import 'deprecated_problems.dart' show deprecated_inputError;
-
-import 'scanner/io.dart' as scanner_io show readBytesFromFile;
-
-Future<List<int>> readBytesFromFile(Uri uri,
- {bool ensureZeroTermination: true}) async {
- try {
- return await scanner_io.readBytesFromFile(uri,
- ensureZeroTermination: ensureZeroTermination);
- } on FileSystemException catch (e) {
- String message = e.message;
- String osMessage = e.osError?.message;
- if (osMessage != null && osMessage.isNotEmpty) {
- message = osMessage;
- }
- return deprecated_inputError(uri, -1, message);
- }
-}
diff --git a/pkg/front_end/lib/src/fasta/kernel/body_builder.dart b/pkg/front_end/lib/src/fasta/kernel/body_builder.dart
index 7065b1b..beaac23 100644
--- a/pkg/front_end/lib/src/fasta/kernel/body_builder.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/body_builder.dart
@@ -70,10 +70,8 @@
import 'expression_generator.dart'
show
- DeferredAccessGenerator,
DelayedAssignment,
DelayedPostfixIncrement,
- ErroneousExpressionGenerator,
Generator,
IncompleteErrorGenerator,
IncompletePropertyAccessGenerator,
@@ -82,6 +80,7 @@
LargeIntAccessGenerator,
LoadLibraryGenerator,
ParenthesizedExpressionGenerator,
+ PrefixUseGenerator,
ReadOnlyAccessGenerator,
SendAccessGenerator,
StaticAccessGenerator,
@@ -269,8 +268,6 @@
field.parent is KernelClassBuilder ? field.parent : null,
typeInferrer);
- bool get hasParserError => recoverableErrors.isNotEmpty;
-
bool get inConstructor {
return functionNestingLevel == 0 && member is KernelConstructorBuilder;
}
@@ -299,12 +296,9 @@
return node.buildSimpleRead();
} else if (node is Expression) {
return node;
- } else if (node is PrefixBuilder) {
- return deprecated_buildCompileTimeError(
- "A library can't be used as an expression.");
} else if (node is SuperInitializer) {
- return buildCompileTimeError(
- fasta.messageSuperAsExpression, node.fileOffset, noLength);
+ return new SyntheticExpressionJudgment(buildCompileTimeError(
+ fasta.messageSuperAsExpression, node.fileOffset, noLength));
} else if (node is ProblemBuilder) {
return buildProblemExpression(node, -1, noLength);
} else {
@@ -382,9 +376,9 @@
int offset = variable.fileOffset;
Message message = template.withArguments(name);
if (variable.initializer == null) {
- variable.initializer =
- buildCompileTimeError(message, offset, name.length, context: context)
- ..parent = variable;
+ variable.initializer = new SyntheticExpressionJudgment(
+ buildCompileTimeError(message, offset, name.length, context: context))
+ ..parent = variable;
} else {
variable.initializer = wrapInLocatedCompileTimeError(
variable.initializer, message.withLocation(uri, offset, name.length),
@@ -456,7 +450,7 @@
this, identifier.token, new Name(identifier.name, library.library));
}
if (name?.isNotEmpty ?? false) {
- Token period = periodBeforeName ?? beginToken.next;
+ Token period = periodBeforeName ?? beginToken.next.next;
Generator generator = expression;
expression = generator.buildPropertyAccess(
new IncompletePropertyAccessGenerator(
@@ -1061,7 +1055,7 @@
// evaluating [a] and [b].
isConstantExpression: !isSuper,
isSuper: isSuper);
- return negate ? forest.notExpression(result, null) : result;
+ return negate ? forest.notExpression(result, null, true) : result;
}
}
@@ -1100,8 +1094,8 @@
pop();
token = token.next;
Message message = fasta.templateExpectedIdentifier.withArguments(token);
- push(buildCompileTimeError(
- message, offsetForToken(token), lengthForToken(token)));
+ push(new SyntheticExpressionJudgment(buildCompileTimeError(
+ message, offsetForToken(token), lengthForToken(token))));
}
}
@@ -1109,16 +1103,13 @@
Object send = pop();
if (send is IncompleteSendGenerator) {
Object receiver = optional(".", token) ? pop() : popForValue();
- if (receiver is TypeUseGenerator) {
- _typeInferrer.storeTypeUse(receiver);
- }
push(send.withReceiver(receiver, token.charOffset));
} else {
pop();
token = token.next;
Message message = fasta.templateExpectedIdentifier.withArguments(token);
- push(buildCompileTimeError(
- message, offsetForToken(token), lengthForToken(token)));
+ push(new SyntheticExpressionJudgment(buildCompileTimeError(
+ message, offsetForToken(token), lengthForToken(token))));
}
}
@@ -1192,7 +1183,7 @@
isSetter: isSetter,
isStatic: isStatic,
isTopLevel: !isStatic && !isSuper);
- return new SyntheticExpressionJudgment(new Throw(error));
+ return new Throw(error);
}
}
@@ -1350,7 +1341,10 @@
void handleIdentifier(Token token, IdentifierContext context) {
debugEvent("handleIdentifier");
String name = token.lexeme;
- if (name.startsWith("deprecated_")) {
+ if (name.startsWith("deprecated") &&
+ // Note that the previous check is redundant, but faster in the common
+ // case (when [name] isn't deprecated).
+ (name == "deprecated" || name.startsWith("deprecated_"))) {
addProblem(fasta.templateUseOfDeprecatedIdentifier.withArguments(name),
offsetForToken(token), lengthForToken(token));
}
@@ -1424,11 +1418,7 @@
deprecated_addCompileTimeError(
charOffset, "Not a constant expression.");
}
- TypeUseGenerator generator = new TypeUseGenerator(
- this, token, prefix, charOffset, declaration, name);
- return (prefix?.deferred == true)
- ? new DeferredAccessGenerator(this, token, prefix, generator)
- : generator;
+ return new TypeUseGenerator(this, token, declaration, name);
} else if (declaration.isLocal) {
if (constantContext != ConstantContext.none &&
!declaration.isConst &&
@@ -1477,23 +1467,11 @@
return new ThisPropertyAccessGenerator(this, token, n, getter, setter);
} else if (declaration.isRegularMethod) {
assert(declaration.isStatic || declaration.isTopLevel);
- StaticAccessGenerator generator =
- new StaticAccessGenerator(this, token, declaration.target, null);
- return (prefix?.deferred == true)
- ? new DeferredAccessGenerator(this, token, prefix, generator)
- : generator;
+ return new StaticAccessGenerator(this, token, declaration.target, null);
} else if (declaration is PrefixBuilder) {
- if (constantContext != ConstantContext.none && declaration.deferred) {
- deprecated_addCompileTimeError(
- charOffset,
- "'$name' can't be used in a constant expression because it's "
- "marked as 'deferred' which means it isn't available until "
- "loaded.\n"
- "You might try moving the constant to the deferred library, "
- "or removing 'deferred' from the import.");
- }
+ assert(prefix == null);
_typeInferrer.storePrefix(token, declaration);
- return declaration;
+ return new PrefixUseGenerator(this, token, declaration);
} else if (declaration is LoadLibraryBuilder) {
return new LoadLibraryGenerator(this, token, declaration);
} else {
@@ -1518,9 +1496,7 @@
charOffset, "Not a constant expression.");
}
}
- return (prefix?.deferred == true)
- ? new DeferredAccessGenerator(this, token, prefix, generator)
- : generator;
+ return generator;
}
}
@@ -1827,8 +1803,10 @@
Expression value = popForValue();
Object generator = pop();
if (generator is! Generator) {
- push(buildCompileTimeError(fasta.messageNotAnLvalue,
- offsetForToken(token), lengthForToken(token)));
+ push(new SyntheticExpressionJudgment(buildCompileTimeError(
+ fasta.messageNotAnLvalue,
+ offsetForToken(token),
+ lengthForToken(token))));
} else {
push(new DelayedAssignment(
this, token, generator, value, token.stringValue));
@@ -2083,12 +2061,8 @@
}
Object prefix = list[0];
Identifier suffix = list[1];
- if (prefix is PrefixBuilder) {
- name = scopeLookup(prefix.exportScope, suffix.name, beginToken,
- isQualified: true, prefix: prefix);
- } else if (prefix is ErroneousExpressionGenerator) {
- push(prefix.buildErroneousTypeNotAPrefix(suffix));
- return;
+ if (prefix is Generator) {
+ name = prefix.prefixedLookup(suffix.token);
} else {
String displayName = debugName(getNodeName(prefix), suffix.name);
addProblem(fasta.templateNotAType.withArguments(displayName),
@@ -2101,15 +2075,10 @@
push(name.buildTypeWithBuiltArguments(arguments));
} else if (name is TypeBuilder) {
push(name.build(library));
- } else if (name is PrefixBuilder) {
- addProblem(fasta.templateNotAType.withArguments(name.name),
- offsetForToken(beginToken), lengthForToken(beginToken));
- push(const InvalidType());
} else {
unhandled(
"${name.runtimeType}", "handleType", beginToken.charOffset, uri);
}
- // TODO(ahe): Unused code fasta.messageNonInstanceTypeVariableUse.
}
@override
@@ -2156,7 +2125,7 @@
}
@override
- void handleAsOperator(Token operator, Token endToken) {
+ void handleAsOperator(Token operator) {
debugEvent("AsOperator");
DartType type = pop();
Expression expression = popForValue();
@@ -2169,19 +2138,20 @@
}
@override
- void handleIsOperator(Token operator, Token not, Token endToken) {
+ void handleIsOperator(Token isOperator, Token not) {
debugEvent("IsOperator");
DartType type = pop();
Expression operand = popForValue();
bool isInverted = not != null;
- Expression isExpression = forest.isExpression(operand, operator, not, type);
+ Expression isExpression =
+ forest.isExpression(operand, isOperator, not, type);
if (operand is VariableGet) {
typePromoter.handleIsCheck(isExpression, isInverted, operand.variable,
type, functionNestingLevel);
}
if (constantContext != ConstantContext.none) {
push(deprecated_buildCompileTimeError(
- "Not a constant expression.", operator.charOffset));
+ "Not a constant expression.", isOperator.charOffset));
} else {
push(isExpression);
}
@@ -2485,7 +2455,7 @@
debugEvent("UnaryPrefixExpression");
Object receiver = pop();
if (optional("!", token)) {
- push(forest.notExpression(toValue(receiver), token));
+ push(forest.notExpression(toValue(receiver), token, false));
} else {
String operator = token.stringValue;
Expression receiverValue;
@@ -2601,19 +2571,11 @@
List<Object> list = type;
Object prefix = list[0];
identifier = list[1];
- if (prefix is PrefixBuilder) {
- type = scopeLookup(
- prefix.exportScope, identifier.name, identifier.token,
- isQualified: true, prefix: prefix);
- identifier = null;
- } else if (prefix is TypeUseGenerator) {
+ if (prefix is TypeUseGenerator) {
type = prefix;
} else if (prefix is Generator) {
- String name = suffix == null
- ? "${prefix.plainNameForRead}.${identifier.name}"
- : "${prefix.plainNameForRead}.${identifier.name}.$suffix";
- type = new UnresolvedNameGenerator(
- this, prefix.token, new Name(name, library.library));
+ type = prefix.prefixedLookup(identifier.token);
+ identifier = null;
} else {
unhandled("${prefix.runtimeType}", "pushQualifiedReference",
start.charOffset, uri);
@@ -2650,13 +2612,13 @@
LocatedMessage argMessage = checkArgumentsForFunction(
target.function, arguments, charOffset, typeParameters);
if (argMessage != null) {
- return throwNoSuchMethodError(
+ return new SyntheticExpressionJudgment(throwNoSuchMethodError(
forest.literalNull(null)..fileOffset = charOffset,
target.name.name,
arguments,
charOffset,
candidate: target,
- argMessage: argMessage);
+ argMessage: argMessage));
}
if (target is Constructor) {
isConst =
@@ -2822,36 +2784,17 @@
List<DartType> typeArguments = pop();
Object type = pop();
- PrefixBuilder deferredPrefix;
- int checkOffset;
- if (type is DeferredAccessGenerator) {
- DeferredAccessGenerator generator = type;
- type = generator.generator;
- deferredPrefix = generator.builder;
- checkOffset = generator.token.charOffset;
- }
-
- if (type is TypeUseGenerator) {
- TypeUseGenerator generator = type;
- _typeInferrer.storeTypeUse(generator);
- if (generator.prefix != null) {
- nameToken = nameToken.next.next;
- }
- type = generator.declaration;
- }
ConstantContext savedConstantContext = pop();
- if (type is TypeDeclarationBuilder<TypeBuilder, Object>) {
- Expression expression = buildConstructorInvocation(
- type, nameToken, arguments, name, typeArguments, offset, constness);
- push(deferredPrefix != null
- ? wrapInDeferredCheck(expression, deferredPrefix, checkOffset)
- : expression);
- } else if (type is ErroneousExpressionGenerator) {
- push(type.buildError(arguments));
+ if (type is Generator) {
+ push(type.invokeConstructor(
+ typeArguments, name, arguments, nameToken, constness));
} else {
- push(throwNoSuchMethodError(forest.literalNull(null)..fileOffset = offset,
- debugName(getNodeName(type), name), arguments, nameToken.charOffset));
+ push(new SyntheticExpressionJudgment(throwNoSuchMethodError(
+ forest.literalNull(null)..fileOffset = offset,
+ debugName(getNodeName(type), name),
+ arguments,
+ nameToken.charOffset)));
}
constantContext = savedConstantContext;
}
@@ -2956,11 +2899,12 @@
nameToken = nameToken.next.next;
}
- return throwNoSuchMethodError(
+ return new UnresolvedTargetInvocationJudgment(throwNoSuchMethodError(
forest.literalNull(null)..fileOffset = charOffset,
errorName,
arguments,
- nameToken.charOffset);
+ nameToken.charOffset))
+ ..fileOffset = arguments.fileOffset;
}
@override
@@ -3268,8 +3212,9 @@
? fasta.messageForInLoopExactlyOneVariable
: fasta.messageForInLoopNotAssignable;
Token token = forToken.next.next;
- variable = new VariableDeclaration.forValue(buildCompileTimeError(
- message, offsetForToken(token), lengthForToken(token)));
+ variable = new VariableDeclaration.forValue(
+ new SyntheticExpressionJudgment(buildCompileTimeError(
+ message, offsetForToken(token), lengthForToken(token))));
}
Statement result = new ForInJudgment(
awaitToken,
@@ -3699,7 +3644,6 @@
KernelTypeVariableBuilder variable;
Object inScope = scopeLookup(scope, name.name, token);
if (inScope is TypeUseGenerator) {
- _typeInferrer.storeTypeUse(inScope);
variable = inScope.declaration;
} else {
// Something went wrong when pre-parsing the type variables.
@@ -3707,6 +3651,7 @@
variable = new KernelTypeVariableBuilder(
name.name, library, offsetForToken(name.token), null);
}
+ storeTypeUse(offsetForToken(token), variable.target);
if (annotations != null) {
_typeInferrer.inferMetadata(this, factory, annotations);
for (Expression annotation in annotations) {
@@ -3793,17 +3738,6 @@
}
@override
- void handleRecoverableError(
- Message message, Token startToken, Token endToken) {
- if (message == fasta.messageNativeClauseShouldBeAnnotation) {
- // TODO(danrubel): Ignore this error until we deprecate `native` support.
- return;
- }
- addCompileTimeError(message, offsetForToken(startToken),
- lengthOfSpan(startToken, endToken));
- }
-
- @override
Token handleUnrecoverableError(Token token, Message message) {
if (message.code == fasta.codeExpectedButGot) {
String expected = message.arguments["string"];
@@ -3825,8 +3759,8 @@
@override
Expression deprecated_buildCompileTimeError(String error,
[int charOffset = -1]) {
- return buildCompileTimeError(
- fasta.templateUnspecified.withArguments(error), charOffset, noLength);
+ return new SyntheticExpressionJudgment(buildCompileTimeError(
+ fasta.templateUnspecified.withArguments(error), charOffset, noLength));
}
@override
@@ -3834,9 +3768,8 @@
{List<LocatedMessage> context}) {
library.addCompileTimeError(message, charOffset, length, uri,
wasHandled: true, context: context);
- return new SyntheticExpressionJudgment(library.loader
- .throwCompileConstantError(library.loader
- .buildCompileTimeError(message, charOffset, length, uri)));
+ return library.loader.throwCompileConstantError(
+ library.loader.buildCompileTimeError(message, charOffset, length, uri));
}
Expression wrapInCompileTimeError(Expression expression, Message message,
@@ -3846,15 +3779,17 @@
context: context);
}
+ @override
Expression wrapInLocatedCompileTimeError(
Expression expression, LocatedMessage message,
{List<LocatedMessage> context}) {
// TODO(askesc): Produce explicit error expression wrapping the original.
// See [issue 29717](https://github.com/dart-lang/sdk/issues/29717)
return new SyntheticExpressionJudgment(new Let(
- new VariableDeclaration.forValue(buildCompileTimeError(
- message.messageObject, message.charOffset, message.length,
- context: context))
+ new VariableDeclaration.forValue(new SyntheticExpressionJudgment(
+ buildCompileTimeError(
+ message.messageObject, message.charOffset, message.length,
+ context: context)))
..fileOffset = forest.readOffset(expression),
new Let(
new VariableDeclaration.forValue(expression)
@@ -3907,7 +3842,9 @@
Statement buildCompileTimeErrorStatement(Message message, int charOffset,
{List<LocatedMessage> context}) {
return new ExpressionStatementJudgment(
- buildCompileTimeError(message, charOffset, noLength, context: context),
+ new SyntheticExpressionJudgment(buildCompileTimeError(
+ message, charOffset, noLength,
+ context: context)),
null);
}
@@ -4034,6 +3971,13 @@
Initializer buildRedirectingInitializer(
Constructor constructor, Arguments arguments,
[int charOffset = -1]) {
+ if (classBuilder.checkConstructorCyclic(
+ member.name, constructor.name.name)) {
+ int length = constructor.name.name.length;
+ if (length == 0) length = "this".length;
+ addProblem(fasta.messageConstructorCyclic, charOffset, length);
+ // TODO(askesc): Produce invalid initializer.
+ }
needsImplicitSuperInitializer = false;
return new RedirectingInitializerJudgment(
constructor, forest.castArguments(arguments))
@@ -4043,7 +3987,8 @@
@override
Expression buildProblemExpression(
ProblemBuilder builder, int charOffset, int length) {
- return buildCompileTimeError(builder.message, charOffset, length);
+ return new SyntheticExpressionJudgment(
+ buildCompileTimeError(builder.message, charOffset, length));
}
@override
@@ -4107,6 +4052,7 @@
return type;
}
+ @override
Expression evaluateArgumentsBefore(
Arguments arguments, Expression expression) {
if (arguments == null) return expression;
@@ -4263,6 +4209,11 @@
wasHandled: true);
}
}
+
+ @override
+ void storeTypeUse(int offset, Node node) {
+ _typeInferrer.storeTypeUse(offset, node);
+ }
}
class Identifier {
diff --git a/pkg/front_end/lib/src/fasta/kernel/expression_generator.dart b/pkg/front_end/lib/src/fasta/kernel/expression_generator.dart
index e24dd18..104f94f 100644
--- a/pkg/front_end/lib/src/fasta/kernel/expression_generator.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/expression_generator.dart
@@ -11,11 +11,16 @@
import '../fasta_codes.dart'
show
- LocatedMessage,
+ Message,
+ Template,
+ messageCantUsePrefixAsExpression,
+ messageCantUsePrefixWithNullAware,
messageInvalidInitializer,
+ templateCantUseDeferredPrefixAsConstant,
templateDeferredTypeAnnotation,
templateIntegerLiteralIsOutOfRange,
templateMissingExplicitTypeArguments,
+ templateNotAPrefixInTypeAnnotation,
templateNotAType,
templateUnresolvedPrefixInTypeAnnotation;
@@ -38,12 +43,13 @@
import '../problems.dart' show unhandled, unsupported;
+import 'constness.dart' show Constness;
+
import 'expression_generator_helper.dart' show ExpressionGeneratorHelper;
import 'forest.dart'
show
Forest,
- Identifier,
LoadLibraryBuilder,
PrefixBuilder,
TypeDeclarationBuilder,
@@ -62,6 +68,7 @@
Member,
Name,
Procedure,
+ SyntheticExpressionJudgment,
TypeParameterType,
VariableDeclaration;
@@ -138,16 +145,6 @@
///
/// At runtime, [value] will be evaluated before throwing an exception.
Expression makeInvalidWrite(Expression value);
-
- /* Expression | Generator */ buildThrowNoSuchMethodError(
- Expression receiver, Arguments arguments,
- {bool isSuper,
- bool isGetter,
- bool isSetter,
- bool isStatic,
- String name,
- int offset,
- LocatedMessage argMessage});
}
/// A generator represents a subexpression for which we can't yet build an
@@ -185,8 +182,8 @@
Initializer buildFieldInitializer(Map<String, int> initializedFields) {
int offset = offsetForToken(token);
return helper.buildInvalidInitializer(
- helper.buildCompileTimeError(
- messageInvalidInitializer, offset, lengthForToken(token)),
+ new SyntheticExpressionJudgment(helper.buildCompileTimeError(
+ messageInvalidInitializer, offset, lengthForToken(token))),
offset);
}
@@ -220,23 +217,21 @@
return const InvalidType();
}
- @override
- /* Expression | Generator */ buildThrowNoSuchMethodError(
- Expression receiver, Arguments arguments,
- {bool isSuper: false,
- bool isGetter: false,
- bool isSetter: false,
- bool isStatic: false,
- String name,
- int offset,
- LocatedMessage argMessage}) {
- return helper.throwNoSuchMethodError(receiver, name ?? plainNameForWrite,
- arguments, offset ?? offsetForToken(this.token),
- isGetter: isGetter,
- isSetter: isSetter,
- isSuper: isSuper,
- isStatic: isStatic,
- argMessage: argMessage);
+ /* Expression | Generator */ Object prefixedLookup(Token name) {
+ return new UnexpectedQualifiedUseGenerator(helper, name, this, false);
+ }
+
+ Expression invokeConstructor(List<DartType> typeArguments, String name,
+ Arguments arguments, Token nameToken, Constness constness) {
+ if (typeArguments != null) {
+ assert(forest.argumentsTypeArguments(arguments).isEmpty);
+ forest.argumentsSetTypeArguments(arguments, typeArguments);
+ }
+ return new SyntheticExpressionJudgment(helper.throwNoSuchMethodError(
+ forest.literalNull(token),
+ name == "" ? plainNameForRead : "${plainNameForRead}.$name",
+ arguments,
+ nameToken.charOffset));
}
bool get isThisPropertyAccess => false;
@@ -472,26 +467,27 @@
abstract class DeferredAccessGenerator implements Generator {
factory DeferredAccessGenerator(ExpressionGeneratorHelper helper, Token token,
- PrefixBuilder builder, Generator generator) {
- return helper.forest
- .deferredAccessGenerator(helper, token, builder, generator);
+ PrefixUseGenerator prefixGenerator, Generator suffixGenerator) {
+ return helper.forest.deferredAccessGenerator(
+ helper, token, prefixGenerator, suffixGenerator);
}
- PrefixBuilder get builder;
+ PrefixUseGenerator get prefixGenerator;
- Generator get generator;
+ Generator get suffixGenerator;
@override
buildPropertyAccess(
IncompleteSendGenerator send, int operatorOffset, bool isNullAware) {
var propertyAccess =
- generator.buildPropertyAccess(send, operatorOffset, isNullAware);
+ suffixGenerator.buildPropertyAccess(send, operatorOffset, isNullAware);
if (propertyAccess is Generator) {
return new DeferredAccessGenerator(
- helper, token, builder, propertyAccess);
+ helper, token, prefixGenerator, propertyAccess);
} else {
Expression expression = propertyAccess;
- return helper.wrapInDeferredCheck(expression, builder, token.charOffset);
+ return helper.wrapInDeferredCheck(
+ expression, prefixGenerator.prefix, token.charOffset);
}
}
@@ -509,49 +505,50 @@
{bool nonInstanceAccessIsError: false}) {
helper.addProblem(
templateDeferredTypeAnnotation.withArguments(
- generator.buildTypeWithBuiltArguments(arguments,
+ suffixGenerator.buildTypeWithBuiltArguments(arguments,
nonInstanceAccessIsError: nonInstanceAccessIsError),
- builder.name),
- offsetForToken(token),
- lengthForToken(token));
+ prefixGenerator.plainNameForRead),
+ offsetForToken(prefixGenerator.token),
+ lengthOfSpan(prefixGenerator.token, token));
return const InvalidType();
}
@override
Expression doInvocation(int offset, Arguments arguments) {
return helper.wrapInDeferredCheck(
- generator.doInvocation(offset, arguments), builder, token.charOffset);
+ suffixGenerator.doInvocation(offset, arguments),
+ prefixGenerator.prefix,
+ token.charOffset);
+ }
+
+ @override
+ Expression invokeConstructor(List<DartType> typeArguments, String name,
+ Arguments arguments, Token nameToken, Constness constness) {
+ return helper.wrapInDeferredCheck(
+ suffixGenerator.invokeConstructor(
+ typeArguments, name, arguments, nameToken, constness),
+ prefixGenerator.prefix,
+ offsetForToken(suffixGenerator.token));
}
@override
void printOn(StringSink sink) {
- sink.write(", builder: ");
- sink.write(builder);
- sink.write(", generator: ");
- sink.write(generator);
+ sink.write(", prefixGenerator: ");
+ sink.write(prefixGenerator);
+ sink.write(", suffixGenerator: ");
+ sink.write(suffixGenerator);
}
}
abstract class TypeUseGenerator implements Generator {
- factory TypeUseGenerator(
- ExpressionGeneratorHelper helper,
- Token token,
- PrefixBuilder prefix,
- int declarationReferenceOffset,
- TypeDeclarationBuilder declaration,
- String plainNameForRead) {
- return helper.forest.typeUseGenerator(helper, token, prefix,
- declarationReferenceOffset, declaration, plainNameForRead);
+ factory TypeUseGenerator(ExpressionGeneratorHelper helper, Token token,
+ TypeDeclarationBuilder declaration, String plainNameForRead) {
+ return helper.forest
+ .typeUseGenerator(helper, token, declaration, plainNameForRead);
}
- PrefixBuilder get prefix;
-
TypeDeclarationBuilder get declaration;
- /// The offset at which the [declaration] is referenced by this generator,
- /// or `-1` if the reference is implicit.
- int get declarationReferenceOffset;
-
@override
String get debugName => "TypeUseGenerator";
@@ -609,6 +606,14 @@
}
return type;
}
+
+ @override
+ Expression invokeConstructor(List<DartType> typeArguments, String name,
+ Arguments arguments, Token nameToken, Constness constness) {
+ helper.storeTypeUse(offsetForToken(token), declaration.target);
+ return helper.buildConstructorInvocation(declaration, nameToken, arguments,
+ name, typeArguments, offsetForToken(nameToken ?? token), constness);
+ }
}
abstract class ReadOnlyAccessGenerator implements Generator {
@@ -644,7 +649,7 @@
@override
Expression doInvocation(int offset, Arguments arguments) {
- return buildError();
+ return new SyntheticExpressionJudgment(buildError());
}
@override
@@ -657,12 +662,10 @@
abstract class ErroneousExpressionGenerator implements Generator {
/// Pass [arguments] that must be evaluated before throwing an error. At
/// most one of [isGetter] and [isSetter] should be true and they're passed
- /// to [ExpressionGeneratorHelper.buildThrowNoSuchMethodError] if it is used.
+ /// to [ExpressionGeneratorHelper.throwNoSuchMethodError] if it is used.
Expression buildError(Arguments arguments,
{bool isGetter: false, bool isSetter: false, int offset});
- DartType buildErroneousTypeNotAPrefix(Identifier suffix);
-
Name get name => unsupported("name", offsetForToken(token), uri);
@override
@@ -672,13 +675,14 @@
@override
Initializer buildFieldInitializer(Map<String, int> initializedFields) {
- return helper.buildInvalidInitializer(
- buildError(forest.argumentsEmpty(token), isSetter: true));
+ return helper.buildInvalidInitializer(new SyntheticExpressionJudgment(
+ buildError(forest.argumentsEmpty(token), isSetter: true)));
}
@override
doInvocation(int offset, Arguments arguments) {
- return buildError(arguments, offset: offset);
+ return new SyntheticExpressionJudgment(
+ buildError(arguments, offset: offset));
}
@override
@@ -689,21 +693,10 @@
}
@override
- buildThrowNoSuchMethodError(Expression receiver, Arguments arguments,
- {bool isSuper: false,
- bool isGetter: false,
- bool isSetter: false,
- bool isStatic: false,
- String name,
- int offset,
- LocatedMessage argMessage}) {
- return this;
- }
-
- @override
Expression buildAssignment(Expression value, {bool voidContext: false}) {
- return buildError(forest.arguments(<Expression>[value], token),
- isSetter: true);
+ return new SyntheticExpressionJudgment(buildError(
+ forest.arguments(<Expression>[value], token),
+ isSetter: true));
}
@override
@@ -712,8 +705,9 @@
bool voidContext: false,
Procedure interfaceTarget,
bool isPreIncDec: false}) {
- return buildError(forest.arguments(<Expression>[value], token),
- isGetter: true);
+ return new SyntheticExpressionJudgment(buildError(
+ forest.arguments(<Expression>[value], token),
+ isGetter: true));
}
@override
@@ -721,11 +715,11 @@
{int offset: -1, bool voidContext: false, Procedure interfaceTarget}) {
// TODO(ahe): For the Analyzer, we probably need to build a prefix
// increment node that wraps an error.
- return buildError(
+ return new SyntheticExpressionJudgment(buildError(
forest.arguments(
<Expression>[forest.literalInt(1, null)..fileOffset = offset],
token),
- isGetter: true);
+ isGetter: true));
}
@override
@@ -733,33 +727,45 @@
{int offset: -1, bool voidContext: false, Procedure interfaceTarget}) {
// TODO(ahe): For the Analyzer, we probably need to build a post increment
// node that wraps an error.
- return buildError(
+ return new SyntheticExpressionJudgment(buildError(
forest.arguments(
<Expression>[forest.literalInt(1, null)..fileOffset = offset],
token),
- isGetter: true);
+ isGetter: true));
}
@override
Expression buildNullAwareAssignment(
Expression value, DartType type, int offset,
{bool voidContext: false}) {
- return buildError(forest.arguments(<Expression>[value], token),
- isSetter: true);
+ return new SyntheticExpressionJudgment(buildError(
+ forest.arguments(<Expression>[value], token),
+ isSetter: true));
}
@override
- Expression buildSimpleRead() =>
- buildError(forest.argumentsEmpty(token), isGetter: true);
+ Expression buildSimpleRead() => new SyntheticExpressionJudgment(
+ buildError(forest.argumentsEmpty(token), isGetter: true));
@override
- Expression makeInvalidRead() =>
- buildError(forest.argumentsEmpty(token), isGetter: true);
+ Expression makeInvalidRead() => new SyntheticExpressionJudgment(
+ buildError(forest.argumentsEmpty(token), isGetter: true));
@override
Expression makeInvalidWrite(Expression value) {
- return buildError(forest.arguments(<Expression>[value], token),
- isSetter: true);
+ return new SyntheticExpressionJudgment(buildError(
+ forest.arguments(<Expression>[value], token),
+ isSetter: true));
+ }
+
+ @override
+ Expression invokeConstructor(List<DartType> typeArguments, String name,
+ Arguments arguments, Token nameToken, Constness constness) {
+ if (typeArguments != null) {
+ assert(forest.argumentsTypeArguments(arguments).isEmpty);
+ forest.argumentsSetTypeArguments(arguments, typeArguments);
+ }
+ return new SyntheticExpressionJudgment(buildError(arguments));
}
}
@@ -769,20 +775,13 @@
return helper.forest.unresolvedNameGenerator(helper, token, name);
}
+ @override
String get debugName => "UnresolvedNameGenerator";
- Expression doInvocation(int charOffset, Arguments arguments) {
- return buildError(arguments, offset: charOffset);
- }
-
@override
- DartType buildErroneousTypeNotAPrefix(Identifier suffix) {
- helper.addProblem(
- templateUnresolvedPrefixInTypeAnnotation.withArguments(
- name.name, suffix.name),
- offsetForToken(token),
- lengthOfSpan(token, suffix.token));
- return const InvalidType();
+ Expression doInvocation(int charOffset, Arguments arguments) {
+ return new SyntheticExpressionJudgment(
+ buildError(arguments, offset: charOffset));
}
@override
@@ -797,6 +796,11 @@
isGetter: isGetter,
isSetter: isSetter);
}
+
+ @override
+ /* Expression | Generator */ Object prefixedLookup(Token name) {
+ return new UnexpectedQualifiedUseGenerator(helper, name, this, true);
+ }
}
abstract class UnlinkedGenerator implements Generator {
@@ -1002,3 +1006,147 @@
printQualifiedNameOn(interfaceTarget, sink);
}
}
+
+abstract class PrefixUseGenerator implements Generator {
+ factory PrefixUseGenerator(
+ ExpressionGeneratorHelper helper, Token token, PrefixBuilder prefix) {
+ return helper.forest.prefixUseGenerator(helper, token, prefix);
+ }
+
+ PrefixBuilder get prefix;
+
+ @override
+ String get plainNameForRead => prefix.name;
+
+ @override
+ String get debugName => "PrefixUseGenerator";
+
+ @override
+ Expression buildSimpleRead() => makeInvalidRead();
+
+ @override
+ /* Expression | Generator */ Object prefixedLookup(Token name) {
+ if (helper.constantContext != ConstantContext.none && prefix.deferred) {
+ helper.addProblem(
+ templateCantUseDeferredPrefixAsConstant.withArguments(token),
+ offsetForToken(token),
+ lengthForToken(token));
+ }
+ Object result = helper.scopeLookup(prefix.exportScope, name.lexeme, name,
+ isQualified: true, prefix: prefix);
+ if (prefix.deferred) {
+ if (result is Generator) {
+ if (result is! LoadLibraryGenerator) {
+ result = new DeferredAccessGenerator(helper, name, this, result);
+ }
+ } else {
+ helper.wrapInDeferredCheck(result, prefix, offsetForToken(token));
+ }
+ }
+ return result;
+ }
+
+ @override
+ /* Expression | Generator | Initializer */ doInvocation(
+ int offset, Arguments arguments) {
+ return helper.wrapInLocatedCompileTimeError(
+ helper.evaluateArgumentsBefore(arguments, forest.literalNull(token)),
+ messageCantUsePrefixAsExpression.withLocation(
+ helper.uri, offsetForToken(token), lengthForToken(token)));
+ }
+
+ @override
+ /* Expression | Generator */ buildPropertyAccess(
+ IncompleteSendGenerator send, int operatorOffset, bool isNullAware) {
+ if (send is IncompleteSendGenerator) {
+ assert(send.name.name == send.token.lexeme,
+ "'${send.name.name}' != ${send.token.lexeme}");
+ Object result = prefixedLookup(send.token);
+ if (send is SendAccessGenerator) {
+ result = helper.finishSend(
+ result,
+ send.arguments as dynamic /* TODO(ahe): Remove this cast. */,
+ offsetForToken(token));
+ }
+ if (isNullAware) {
+ result = helper.wrapInLocatedCompileTimeError(
+ helper.toValue(result),
+ messageCantUsePrefixWithNullAware.withLocation(
+ helper.uri, offsetForToken(token), lengthForToken(token)));
+ }
+ return result;
+ } else {
+ return buildSimpleRead();
+ }
+ }
+
+ @override
+ Expression makeInvalidRead() {
+ return new SyntheticExpressionJudgment(helper.buildCompileTimeError(
+ messageCantUsePrefixAsExpression,
+ offsetForToken(token),
+ lengthForToken(token)));
+ }
+
+ @override
+ Expression makeInvalidWrite(Expression value) => makeInvalidRead();
+
+ @override
+ void printOn(StringSink sink) {
+ sink.write(", prefix: ");
+ sink.write(prefix.name);
+ sink.write(", deferred: ");
+ sink.write(prefix.deferred);
+ }
+}
+
+abstract class UnexpectedQualifiedUseGenerator implements Generator {
+ factory UnexpectedQualifiedUseGenerator(ExpressionGeneratorHelper helper,
+ Token token, Generator prefixGenerator, bool isUnresolved) {
+ return helper.forest.unexpectedQualifiedUseGenerator(
+ helper, token, prefixGenerator, isUnresolved);
+ }
+
+ Generator get prefixGenerator;
+
+ bool get isUnresolved;
+
+ @override
+ String get plainNameForRead {
+ return "${prefixGenerator.plainNameForRead}.${token.lexeme}";
+ }
+
+ @override
+ String get debugName => "UnexpectedQualifiedUseGenerator";
+
+ @override
+ Expression buildSimpleRead() => makeInvalidRead();
+
+ @override
+ Expression doInvocation(int offset, Arguments arguments) {
+ return new SyntheticExpressionJudgment(helper.throwNoSuchMethodError(
+ forest.literalNull(null)..fileOffset = offset,
+ plainNameForRead,
+ arguments,
+ offsetForToken(token)));
+ }
+
+ @override
+ DartType buildTypeWithBuiltArguments(List<DartType> arguments,
+ {bool nonInstanceAccessIsError: false}) {
+ Template<Message Function(Token, Token)> template = isUnresolved
+ ? templateUnresolvedPrefixInTypeAnnotation
+ : templateNotAPrefixInTypeAnnotation;
+ helper.addProblem(
+ template.withArguments(prefixGenerator.token, token),
+ offsetForToken(prefixGenerator.token),
+ lengthOfSpan(prefixGenerator.token, token));
+ return const InvalidType();
+ }
+
+ @override
+ void printOn(StringSink sink) {
+ sink.write(", prefixGenerator: ");
+ prefixGenerator.printOn(sink);
+ }
+}
diff --git a/pkg/front_end/lib/src/fasta/kernel/expression_generator_helper.dart b/pkg/front_end/lib/src/fasta/kernel/expression_generator_helper.dart
index 57df1bb..0e246b4 100644
--- a/pkg/front_end/lib/src/fasta/kernel/expression_generator_helper.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/expression_generator_helper.dart
@@ -35,6 +35,7 @@
Initializer,
Member,
Name,
+ Node,
Procedure,
StaticGet,
TypeParameter,
@@ -153,4 +154,13 @@
Message warnUnresolvedMethod(Name name, int charOffset, {bool isSuper});
void warnTypeArgumentsMismatch(String name, int expected, int charOffset);
+
+ Expression wrapInLocatedCompileTimeError(
+ Expression expression, LocatedMessage message,
+ {List<LocatedMessage> context});
+
+ Expression evaluateArgumentsBefore(
+ Arguments arguments, Expression expression);
+
+ void storeTypeUse(int offset, Node node);
}
diff --git a/pkg/front_end/lib/src/fasta/kernel/factory.dart b/pkg/front_end/lib/src/fasta/kernel/factory.dart
index 9995d68..7018d22 100644
--- a/pkg/front_end/lib/src/fasta/kernel/factory.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/factory.dart
@@ -163,7 +163,7 @@
DartType loopVariableType,
int writeOffset,
DartType writeVariableType,
- int writeVariableDeclarationOffset,
+ covariant Object writeVariableBinder,
Node writeTarget);
Statement forStatement(
@@ -423,7 +423,7 @@
ExpressionJudgment judgment,
int fileOffset,
DartType writeContext,
- int writeVariableDeclarationOffset,
+ covariant Object writeVariableBinder,
Node combiner,
DartType inferredType);
diff --git a/pkg/front_end/lib/src/fasta/kernel/fangorn.dart b/pkg/front_end/lib/src/fasta/kernel/fangorn.dart
index b091616..85c163a 100644
--- a/pkg/front_end/lib/src/fasta/kernel/fangorn.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/fangorn.dart
@@ -52,6 +52,7 @@
KernelLargeIntAccessGenerator,
KernelLoadLibraryGenerator,
KernelNullAwarePropertyAccessGenerator,
+ KernelPrefixUseGenerator,
KernelPropertyAccessGenerator,
KernelReadOnlyAccessGenerator,
KernelStaticAccessGenerator,
@@ -60,6 +61,7 @@
KernelThisIndexedAccessGenerator,
KernelThisPropertyAccessGenerator,
KernelTypeUseGenerator,
+ KernelUnexpectedQualifiedUseGenerator,
KernelUnlinkedGenerator,
KernelUnresolvedNameGenerator,
KernelVariableUseGenerator;
@@ -116,6 +118,7 @@
Generator,
LoadLibraryBuilder,
PrefixBuilder,
+ PrefixUseGenerator,
TypeDeclarationBuilder,
UnlinkedDeclaration;
@@ -448,7 +451,8 @@
Expression operand, isOperator, Token notOperator, covariant type) {
int offset = offsetForToken(isOperator);
if (notOperator != null) {
- return new IsNotJudgment(operand, isOperator, notOperator, type, offset);
+ return new IsNotJudgment(operand, isOperator, notOperator, type, offset)
+ ..fileOffset = offset;
}
return new IsJudgment(operand, isOperator, type)..fileOffset = offset;
}
@@ -470,8 +474,9 @@
}
@override
- Expression notExpression(Expression operand, Token token) {
- return new NotJudgment(token, operand)..fileOffset = offsetForToken(token);
+ Expression notExpression(Expression operand, Token token, bool isSynthetic) {
+ return new NotJudgment(isSynthetic, token, operand)
+ ..fileOffset = offsetForToken(token);
}
@override
@@ -757,21 +762,20 @@
KernelDeferredAccessGenerator deferredAccessGenerator(
ExpressionGeneratorHelper helper,
Token token,
- PrefixBuilder builder,
- Generator generator) {
- return new KernelDeferredAccessGenerator(helper, token, builder, generator);
+ PrefixUseGenerator prefixGenerator,
+ Generator suffixGenerator) {
+ return new KernelDeferredAccessGenerator(
+ helper, token, prefixGenerator, suffixGenerator);
}
@override
KernelTypeUseGenerator typeUseGenerator(
ExpressionGeneratorHelper helper,
Token token,
- PrefixBuilder prefix,
- int declarationReferenceOffset,
TypeDeclarationBuilder declaration,
String plainNameForRead) {
- return new KernelTypeUseGenerator(helper, token, prefix,
- declarationReferenceOffset, declaration, plainNameForRead);
+ return new KernelTypeUseGenerator(
+ helper, token, declaration, plainNameForRead);
}
@override
@@ -823,6 +827,22 @@
return new KernelDelayedPostfixIncrement(
helper, token, generator, binaryOperator, interfaceTarget);
}
+
+ @override
+ KernelPrefixUseGenerator prefixUseGenerator(
+ ExpressionGeneratorHelper helper, Token token, PrefixBuilder prefix) {
+ return new KernelPrefixUseGenerator(helper, token, prefix);
+ }
+
+ @override
+ KernelUnexpectedQualifiedUseGenerator unexpectedQualifiedUseGenerator(
+ ExpressionGeneratorHelper helper,
+ Token token,
+ Generator prefixGenerator,
+ bool isUnresolved) {
+ return new KernelUnexpectedQualifiedUseGenerator(
+ helper, token, prefixGenerator, isUnresolved);
+ }
}
class _VariablesDeclaration extends Statement {
diff --git a/pkg/front_end/lib/src/fasta/kernel/forest.dart b/pkg/front_end/lib/src/fasta/kernel/forest.dart
index 0325d02..19f4b7d 100644
--- a/pkg/front_end/lib/src/fasta/kernel/forest.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/forest.dart
@@ -16,7 +16,7 @@
import 'body_builder.dart' show Identifier, LabelTarget;
-import 'expression_generator.dart' show Generator;
+import 'expression_generator.dart' show Generator, PrefixUseGenerator;
import 'expression_generator_helper.dart' show ExpressionGeneratorHelper;
@@ -31,7 +31,9 @@
export 'body_builder.dart' show Identifier, Operator;
-export 'expression_generator.dart' show Generator;
+export 'constness.dart' show Constness;
+
+export 'expression_generator.dart' show Generator, PrefixUseGenerator;
export 'expression_generator_helper.dart' show ExpressionGeneratorHelper;
@@ -254,7 +256,8 @@
Expression logicalExpression(
Expression leftOperand, Token operator, Expression rightOperand);
- Expression notExpression(Expression operand, Token location);
+ Expression notExpression(
+ Expression operand, Token location, bool isSynthetic);
/// Return a representation of a parenthesized condition consisting of the
/// given [expression] between the [leftParenthesis] and [rightParenthesis].
@@ -405,16 +408,14 @@
Generator loadLibraryGenerator(ExpressionGeneratorHelper helper,
Token location, LoadLibraryBuilder builder);
- Generator deferredAccessGenerator(ExpressionGeneratorHelper helper,
- Token location, PrefixBuilder builder, Generator generator);
-
- Generator typeUseGenerator(
+ Generator deferredAccessGenerator(
ExpressionGeneratorHelper helper,
Token location,
- PrefixBuilder prefix,
- int declarationReferenceOffset,
- TypeDeclarationBuilder declaration,
- String plainNameForRead);
+ PrefixUseGenerator prefixGenerator,
+ Generator suffixGenerator);
+
+ Generator typeUseGenerator(ExpressionGeneratorHelper helper, Token location,
+ TypeDeclarationBuilder declaration, String plainNameForRead);
Generator readOnlyAccessGenerator(ExpressionGeneratorHelper helper,
Token location, Expression expression, String plainNameForRead);
@@ -438,6 +439,12 @@
Name binaryOperator,
Procedure interfaceTarget);
+ Generator prefixUseGenerator(
+ ExpressionGeneratorHelper helper, Token location, PrefixBuilder prefix);
+
+ Generator unexpectedQualifiedUseGenerator(ExpressionGeneratorHelper helper,
+ Token token, Generator prefixGenerator, bool isUnresolved);
+
// TODO(ahe): Remove this method when all users are moved here.
Arguments castArguments(Arguments arguments) {
return arguments;
diff --git a/pkg/front_end/lib/src/fasta/kernel/kernel_ast_api.dart b/pkg/front_end/lib/src/fasta/kernel/kernel_ast_api.dart
index 40e1263..48ec723 100644
--- a/pkg/front_end/lib/src/fasta/kernel/kernel_ast_api.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/kernel_ast_api.dart
@@ -86,6 +86,7 @@
IfJudgment,
IllegalAssignmentJudgment,
IndexAssignmentJudgment,
+ InvalidVariableWriteJudgment,
ShadowInvalidInitializer,
LabeledStatementJudgment,
LogicalJudgment,
@@ -106,6 +107,9 @@
SwitchCaseJudgment,
SwitchStatementJudgment,
SyntheticExpressionJudgment,
+ UnresolvedTargetInvocationJudgment,
+ UnresolvedVariableGetJudgment,
+ UnresolvedVariableAssignmentJudgment,
VariableAssignmentJudgment,
VariableDeclarationJudgment,
VariableGetJudgment,
diff --git a/pkg/front_end/lib/src/fasta/kernel/kernel_class_builder.dart b/pkg/front_end/lib/src/fasta/kernel/kernel_class_builder.dart
index ebb64ec..e30260e 100644
--- a/pkg/front_end/lib/src/fasta/kernel/kernel_class_builder.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/kernel_class_builder.dart
@@ -430,6 +430,10 @@
transformProcedureToNoSuchMethodForwarder(noSuchMethod, target, cloned);
cls.procedures.add(cloned);
cloned.parent = cls;
+
+ KernelLibraryBuilder library = this.library;
+ library.noSuchMethodForwardersOrigins.add(cloned);
+ library.noSuchMethodForwardersOrigins.add(procedure);
}
void addNoSuchMethodForwarderGetterForField(Member noSuchMethod,
diff --git a/pkg/front_end/lib/src/fasta/kernel/kernel_expression_generator.dart b/pkg/front_end/lib/src/fasta/kernel/kernel_expression_generator.dart
index 1343555..4e5426b 100644
--- a/pkg/front_end/lib/src/fasta/kernel/kernel_expression_generator.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/kernel_expression_generator.dart
@@ -13,18 +13,17 @@
show
LocatedMessage,
messageLoadLibraryTakesNoArguments,
- messageSuperAsExpression,
- templateNotAPrefixInTypeAnnotation;
+ messageSuperAsExpression;
import '../messages.dart' show Message, noLength;
import '../names.dart' show callName, equalsName, indexGetName, indexSetName;
-import '../parser.dart' show lengthForToken, lengthOfSpan, offsetForToken;
+import '../parser.dart' show lengthForToken, offsetForToken;
import '../problems.dart' show unhandled, unsupported;
-import 'body_builder.dart' show Identifier, noLocation;
+import 'body_builder.dart' show noLocation;
import 'constness.dart' show Constness;
@@ -41,6 +40,7 @@
LargeIntAccessGenerator,
LoadLibraryGenerator,
NullAwarePropertyAccessGenerator,
+ PrefixUseGenerator,
PropertyAccessGenerator,
ReadOnlyAccessGenerator,
StaticAccessGenerator,
@@ -49,6 +49,7 @@
ThisIndexedAccessGenerator,
ThisPropertyAccessGenerator,
TypeUseGenerator,
+ UnexpectedQualifiedUseGenerator,
UnlinkedGenerator,
UnresolvedNameGenerator,
VariableUseGenerator;
@@ -68,7 +69,6 @@
DartType,
Field,
Initializer,
- InvalidType,
Let,
Member,
Name,
@@ -77,6 +77,7 @@
ComplexAssignmentJudgment,
IllegalAssignmentJudgment,
IndexAssignmentJudgment,
+ InvalidVariableWriteJudgment,
MethodInvocationJudgment,
NullAwarePropertyGetJudgment,
PropertyAssignmentJudgment,
@@ -94,6 +95,8 @@
Throw,
TreeNode,
TypeParameter,
+ UnresolvedVariableGetJudgment,
+ UnresolvedVariableAssignmentJudgment,
VariableDeclaration,
VariableGet,
VariableSet;
@@ -116,6 +119,8 @@
Forest get forest;
+ String get plainNameForRead;
+
@override
Expression buildSimpleRead() {
return _finish(_makeSimpleRead(), null);
@@ -212,16 +217,26 @@
@override
Expression makeInvalidRead() {
- return buildThrowNoSuchMethodError(
- forest.literalNull(token), forest.argumentsEmpty(noLocation),
- isGetter: true);
+ return new SyntheticExpressionJudgment(helper.throwNoSuchMethodError(
+ forest.literalNull(token),
+ plainNameForRead,
+ forest.argumentsEmpty(noLocation),
+ offsetForToken(token),
+ isGetter: true));
}
@override
Expression makeInvalidWrite(Expression value) {
- return buildThrowNoSuchMethodError(forest.literalNull(token),
+ return buildInvalidWriteJudgment(helper.throwNoSuchMethodError(
+ forest.literalNull(token),
+ plainNameForRead,
forest.arguments(<Expression>[value], noLocation),
- isSetter: true);
+ offsetForToken(token),
+ isSetter: true));
+ }
+
+ Expression buildInvalidWriteJudgment(Expression desugared) {
+ return new SyntheticExpressionJudgment(desugared);
}
Expression _makeSimpleRead() => _makeRead(null);
@@ -231,10 +246,18 @@
return _makeWrite(value, voidContext, complexAssignment);
}
- Expression _makeRead(ComplexAssignmentJudgment complexAssignment);
+ Expression _makeRead(ComplexAssignmentJudgment complexAssignment) {
+ Expression read = makeInvalidRead();
+ complexAssignment?.read = read;
+ return read;
+ }
Expression _makeWrite(Expression value, bool voidContext,
- ComplexAssignmentJudgment complexAssignment);
+ ComplexAssignmentJudgment complexAssignment) {
+ Expression write = makeInvalidWrite(value);
+ complexAssignment?.write = write;
+ return write;
+ }
Expression _finish(
Expression body, ComplexAssignmentJudgment complexAssignment) {
@@ -1075,8 +1098,8 @@
write = makeInvalidWrite(value);
} else {
write = new StaticSet(writeTarget, value);
- complexAssignment?.write = write;
}
+ complexAssignment?.write = write;
write.fileOffset = offsetForToken(token);
return write;
}
@@ -1132,14 +1155,6 @@
}
@override
- Expression _makeWrite(Expression value, bool voidContext,
- ComplexAssignmentJudgment complexAssignment) {
- Expression write = makeInvalidWrite(value);
- write.fileOffset = offsetForToken(token);
- return write;
- }
-
- @override
Expression doInvocation(int offset, Arguments arguments) {
if (forest.argumentsPositional(arguments).length > 0 ||
forest.argumentsNamed(arguments).length > 0) {
@@ -1159,59 +1174,46 @@
class KernelDeferredAccessGenerator extends KernelGenerator
with DeferredAccessGenerator {
@override
- final PrefixBuilder builder;
+ final KernelPrefixUseGenerator prefixGenerator;
@override
- final KernelGenerator generator;
+ final KernelGenerator suffixGenerator;
KernelDeferredAccessGenerator(ExpressionGeneratorHelper helper, Token token,
- this.builder, this.generator)
+ this.prefixGenerator, this.suffixGenerator)
: super(helper, token);
@override
Expression _makeSimpleRead() {
- return helper.wrapInDeferredCheck(
- generator._makeSimpleRead(), builder, token.charOffset);
+ return helper.wrapInDeferredCheck(suffixGenerator._makeSimpleRead(),
+ prefixGenerator.prefix, token.charOffset);
}
@override
Expression _makeRead(ComplexAssignmentJudgment complexAssignment) {
return helper.wrapInDeferredCheck(
- generator._makeRead(complexAssignment), builder, token.charOffset);
+ suffixGenerator._makeRead(complexAssignment),
+ prefixGenerator.prefix,
+ token.charOffset);
}
@override
Expression _makeWrite(Expression value, bool voidContext,
ComplexAssignmentJudgment complexAssignment) {
return helper.wrapInDeferredCheck(
- generator._makeWrite(value, voidContext, complexAssignment),
- builder,
+ suffixGenerator._makeWrite(value, voidContext, complexAssignment),
+ prefixGenerator.prefix,
token.charOffset);
}
}
class KernelTypeUseGenerator extends KernelReadOnlyAccessGenerator
with TypeUseGenerator {
- /// The import prefix preceding the [declaration] reference, or `null` if
- /// the reference is not prefixed.
- @override
- final PrefixBuilder prefix;
-
- /// The offset at which the [declaration] is referenced by this generator,
- /// or `-1` if the reference is implicit.
- @override
- final int declarationReferenceOffset;
-
@override
final TypeDeclarationBuilder declaration;
- KernelTypeUseGenerator(
- ExpressionGeneratorHelper helper,
- Token token,
- this.prefix,
- this.declarationReferenceOffset,
- this.declaration,
- String plainNameForRead)
+ KernelTypeUseGenerator(ExpressionGeneratorHelper helper, Token token,
+ this.declaration, String plainNameForRead)
: super(helper, token, null, plainNameForRead);
@override
@@ -1236,16 +1238,20 @@
@override
Expression makeInvalidWrite(Expression value) {
- return buildThrowNoSuchMethodError(
+ return new SyntheticExpressionJudgment(helper.throwNoSuchMethodError(
forest.literalNull(token),
+ plainNameForRead,
forest.arguments(<Expression>[value], null)
..fileOffset = value.fileOffset,
- isSetter: true);
+ offsetForToken(token),
+ isSetter: true));
}
@override
buildPropertyAccess(
IncompleteSendGenerator send, int operatorOffset, bool isNullAware) {
+ helper.storeTypeUse(offsetForToken(token), declaration.target);
+
// `SomeType?.toString` is the same as `SomeType.toString`, not
// `(SomeType).toString`.
isNullAware = false;
@@ -1320,19 +1326,23 @@
}
@override
- Expression _makeWrite(Expression value, bool voidContext,
- ComplexAssignmentJudgment complexAssignment) {
- var write = makeInvalidWrite(value);
- complexAssignment?.write = write;
- return write;
- }
-
- @override
Expression _finish(
Expression body, ComplexAssignmentJudgment complexAssignment) =>
super._finish(makeLet(value, body), complexAssignment);
@override
+ Expression buildInvalidWriteJudgment(Expression desugared) {
+ var expression = this.expression;
+ if (expression is VariableGet) {
+ return new InvalidVariableWriteJudgment(desugared, expression.variable)
+ ..fileOffset = token.charOffset;
+ } else {
+ // TODO(paulberry): handle other cases
+ return super.buildInvalidWriteJudgment(desugared);
+ }
+ }
+
+ @override
Expression doInvocation(int offset, Arguments arguments) {
return helper.buildMethodInvocation(buildSimpleRead(), callName, arguments,
adjustForImplicitCall(plainNameForRead, offset),
@@ -1357,23 +1367,23 @@
: super(helper, token);
@override
- Expression _makeSimpleRead() => buildError();
+ Expression _makeSimpleRead() => new SyntheticExpressionJudgment(buildError());
@override
Expression _makeSimpleWrite(Expression value, bool voidContext,
ComplexAssignmentJudgment complexAssignment) {
- return buildError();
+ return new SyntheticExpressionJudgment(buildError());
}
@override
Expression _makeRead(ComplexAssignmentJudgment complexAssignment) {
- return buildError();
+ return new SyntheticExpressionJudgment(buildError());
}
@override
Expression _makeWrite(Expression value, bool voidContext,
ComplexAssignmentJudgment complexAssignment) {
- return buildError();
+ return new SyntheticExpressionJudgment(buildError());
}
}
@@ -1387,14 +1397,24 @@
: super(helper, token);
@override
- Expression _makeRead(ComplexAssignmentJudgment complexAssignment) {
- return unsupported("_makeRead", offsetForToken(token), uri);
+ Expression buildAssignment(Expression value, {bool voidContext: false}) {
+ return _buildUnresolvedVariableAssignment(false, value);
}
@override
- Expression _makeWrite(Expression value, bool voidContext,
- ComplexAssignmentJudgment complexAssignment) {
- return unsupported("_makeWrite", offsetForToken(token), uri);
+ Expression buildCompoundAssignment(Name binaryOperator, Expression value,
+ {int offset: TreeNode.noOffset,
+ bool voidContext: false,
+ Procedure interfaceTarget,
+ bool isPreIncDec: false}) {
+ return _buildUnresolvedVariableAssignment(true, value);
+ }
+
+ @override
+ Expression buildSimpleRead() {
+ Expression error = buildError(forest.argumentsEmpty(token), isGetter: true);
+ return new UnresolvedVariableGetJudgment(error)
+ ..fileOffset = token.charOffset;
}
@override
@@ -1402,6 +1422,15 @@
sink.write(", name: ");
sink.write(name.name);
}
+
+ UnresolvedVariableAssignmentJudgment _buildUnresolvedVariableAssignment(
+ bool isCompound, Expression value) {
+ return new UnresolvedVariableAssignmentJudgment(
+ buildError(forest.arguments(<Expression>[value], token), isSetter: true),
+ isCompound,
+ value,
+ )..fileOffset = token.charOffset;
+ }
}
class KernelUnlinkedGenerator extends KernelGenerator with UnlinkedGenerator {
@@ -1420,17 +1449,6 @@
super(helper, token);
@override
- Expression _makeRead(ComplexAssignmentJudgment complexAssignment) {
- return unsupported("_makeRead", offsetForToken(token), uri);
- }
-
- @override
- Expression _makeWrite(Expression value, bool voidContext,
- ComplexAssignmentJudgment complexAssignment) {
- return unsupported("_makeWrite", offsetForToken(token), uri);
- }
-
- @override
Expression buildAssignment(Expression value, {bool voidContext}) {
return new PropertySet(receiver, name, value)
..fileOffset = offsetForToken(token);
@@ -1456,17 +1474,6 @@
KernelContextAwareGenerator(
ExpressionGeneratorHelper helper, Token token, this.generator)
: super(helper, token);
-
- @override
- Expression _makeRead(ComplexAssignmentJudgment complexAssignment) {
- return unsupported("_makeRead", offsetForToken(token), uri);
- }
-
- @override
- Expression _makeWrite(Expression value, bool voidContext,
- ComplexAssignmentJudgment complexAssignment) {
- return unsupported("_makeWrite", offsetForToken(token), uri);
- }
}
class KernelDelayedAssignment extends KernelContextAwareGenerator
@@ -1503,6 +1510,27 @@
: super(helper, token, generator);
}
+class KernelPrefixUseGenerator extends KernelGenerator with PrefixUseGenerator {
+ final PrefixBuilder prefix;
+
+ KernelPrefixUseGenerator(
+ ExpressionGeneratorHelper helper, Token token, this.prefix)
+ : super(helper, token);
+}
+
+class KernelUnexpectedQualifiedUseGenerator extends KernelGenerator
+ with UnexpectedQualifiedUseGenerator {
+ @override
+ final KernelGenerator prefixGenerator;
+
+ @override
+ final bool isUnresolved;
+
+ KernelUnexpectedQualifiedUseGenerator(ExpressionGeneratorHelper helper,
+ Token token, this.prefixGenerator, this.isUnresolved)
+ : super(helper, token);
+}
+
Expression makeLet(VariableDeclaration variable, Expression body) {
if (variable == null) return body;
return new Let(variable, body);
diff --git a/pkg/front_end/lib/src/fasta/kernel/kernel_expression_generator_impl.dart b/pkg/front_end/lib/src/fasta/kernel/kernel_expression_generator_impl.dart
index ea1c5b0..e08ca25 100644
--- a/pkg/front_end/lib/src/fasta/kernel/kernel_expression_generator_impl.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/kernel_expression_generator_impl.dart
@@ -36,8 +36,10 @@
if (!isSuper) {
return forest.thisExpression(token);
} else {
- return helper.buildCompileTimeError(messageSuperAsExpression,
- offsetForToken(token), lengthForToken(token));
+ return new SyntheticExpressionJudgment(helper.buildCompileTimeError(
+ messageSuperAsExpression,
+ offsetForToken(token),
+ lengthForToken(token)));
}
}
@@ -91,8 +93,8 @@
if (isInitializer) {
return buildConstructorInitializer(offset, new Name(""), arguments);
} else if (isSuper) {
- return helper.buildCompileTimeError(
- messageSuperAsExpression, offset, noLength);
+ return new SyntheticExpressionJudgment(helper.buildCompileTimeError(
+ messageSuperAsExpression, offset, noLength));
} else {
return helper.buildMethodInvocation(
forest.thisExpression(null), callName, arguments, offset,
@@ -109,12 +111,14 @@
constructor.function, arguments, offset, <TypeParameter>[]);
}
if (constructor == null || argMessage != null) {
- return helper.buildInvalidInitializer(buildThrowNoSuchMethodError(
- forest.literalNull(null)..fileOffset = offset, arguments,
- isSuper: isSuper,
- name: name.name,
- offset: offset,
- argMessage: argMessage));
+ return helper.buildInvalidInitializer(new SyntheticExpressionJudgment(
+ helper.throwNoSuchMethodError(
+ forest.literalNull(null)..fileOffset = offset,
+ name.name,
+ arguments,
+ offset,
+ isSuper: isSuper,
+ argMessage: argMessage)));
} else if (isSuper) {
return helper.buildSuperInitializer(
false, constructor, arguments, offset);
@@ -163,17 +167,6 @@
}
@override
- Expression _makeRead(ComplexAssignmentJudgment complexAssignment) {
- return unsupported("_makeRead", offsetForToken(token), uri);
- }
-
- @override
- Expression _makeWrite(Expression value, bool voidContext,
- ComplexAssignmentJudgment complexAssignment) {
- return unsupported("_makeWrite", offsetForToken(token), uri);
- }
-
- @override
void printOn(StringSink sink) {
sink.write(", isInitializer: ");
sink.write(isInitializer);
@@ -194,17 +187,6 @@
Arguments get arguments => null;
@override
- Expression _makeRead(ComplexAssignmentJudgment complexAssignment) {
- return unsupported("_makeRead", offsetForToken(token), uri);
- }
-
- @override
- Expression _makeWrite(Expression value, bool voidContext,
- ComplexAssignmentJudgment complexAssignment) {
- return unsupported("_makeWrite", offsetForToken(token), uri);
- }
-
- @override
void printOn(StringSink sink) {
sink.write(", name: ");
sink.write(name.name);
@@ -233,16 +215,6 @@
}
@override
- DartType buildErroneousTypeNotAPrefix(Identifier suffix) {
- helper.addProblem(
- templateNotAPrefixInTypeAnnotation.withArguments(
- token.lexeme, suffix.name),
- offsetForToken(token),
- lengthOfSpan(token, suffix.token));
- return const InvalidType();
- }
-
- @override
doInvocation(int offset, Arguments arguments) => this;
@override
@@ -279,18 +251,6 @@
if (receiver is Generator) {
return receiver.buildPropertyAccess(this, operatorOffset, isNullAware);
}
- if (receiver is PrefixBuilder) {
- PrefixBuilder prefix = receiver;
- if (isNullAware) {
- helper.deprecated_addCompileTimeError(
- offsetForToken(token),
- "Library prefix '${prefix.name}' can't be used with null-aware "
- "operator.\nTry removing '?'.");
- }
- receiver = helper.scopeLookup(prefix.exportScope, name.name, token,
- isQualified: true, prefix: prefix);
- return helper.finishSend(receiver, arguments, offsetForToken(token));
- }
return helper.buildMethodInvocation(
helper.toValue(receiver), name, arguments, offsetForToken(token),
isNullAware: isNullAware);
@@ -361,18 +321,6 @@
if (receiver is Generator) {
return receiver.buildPropertyAccess(this, operatorOffset, isNullAware);
}
- if (receiver is PrefixBuilder) {
- PrefixBuilder prefix = receiver;
- if (isNullAware) {
- helper.deprecated_addCompileTimeError(
- offsetForToken(token),
- "Library prefix '${prefix.name}' can't be used with null-aware "
- "operator.\nTry removing '?'.");
- }
- return helper.scopeLookup(prefix.exportScope, name.name, token,
- isQualified: true, prefix: prefix);
- }
-
return PropertyAccessGenerator.make(
helper, token, helper.toValue(receiver), name, null, null, isNullAware);
}
diff --git a/pkg/front_end/lib/src/fasta/kernel/kernel_factory.dart b/pkg/front_end/lib/src/fasta/kernel/kernel_factory.dart
index 33c6f13..070f006 100644
--- a/pkg/front_end/lib/src/fasta/kernel/kernel_factory.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/kernel_factory.dart
@@ -234,7 +234,7 @@
DartType loopVariableType,
int writeOffset,
DartType writeVariableType,
- int writeVariableDeclarationOffset,
+ covariant Object writeVariableBinder,
Node writeTarget) {
return judgment;
}
@@ -639,7 +639,7 @@
ExpressionJudgment judgment,
int fileOffset,
DartType writeContext,
- int writeVariableDeclarationOffset,
+ covariant VariableDeclaration writeVariableBinder,
Node combiner,
DartType inferredType) {
return judgment;
diff --git a/pkg/front_end/lib/src/fasta/kernel/kernel_invalid_type_builder.dart b/pkg/front_end/lib/src/fasta/kernel/kernel_invalid_type_builder.dart
index 5d8004a..f2297e5 100644
--- a/pkg/front_end/lib/src/fasta/kernel/kernel_invalid_type_builder.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/kernel_invalid_type_builder.dart
@@ -23,6 +23,9 @@
.withLocation(fileUri, charOffset, noLength),
super(name, charOffset, fileUri);
+ @override
+ InvalidType get target => const InvalidType();
+
DartType buildType(
LibraryBuilder library, List<KernelTypeBuilder> arguments) {
return buildTypesWithBuiltArguments(library, null);
diff --git a/pkg/front_end/lib/src/fasta/kernel/kernel_library_builder.dart b/pkg/front_end/lib/src/fasta/kernel/kernel_library_builder.dart
index cc5a316..009fd3a 100644
--- a/pkg/front_end/lib/src/fasta/kernel/kernel_library_builder.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/kernel_library_builder.dart
@@ -25,8 +25,11 @@
StringLiteral,
TreeNode,
Typedef,
+ VariableDeclaration,
VoidType;
+import 'package:kernel/clone.dart' show CloneVisitor;
+
import '../../scanner/token.dart' show Token;
import '../export.dart' show Export;
@@ -59,7 +62,7 @@
import '../modifier.dart'
show abstractMask, namedMixinApplicationMask, staticMask;
-import '../problems.dart' show unhandled;
+import '../problems.dart' show unexpected, unhandled;
import '../source/source_class_builder.dart' show SourceClassBuilder;
@@ -126,6 +129,12 @@
final List<KernelTypeVariableBuilder> boundlessTypeVariables =
<KernelTypeVariableBuilder>[];
+ // A list of alternating noSuchMethod forwarders and the abstract procedures
+ // they were generated for. Note that it may not include a forwarder-origin
+ // pair in cases when the former does not need to be updated after the body of
+ // the latter was built.
+ final List<Procedure> noSuchMethodForwardersOrigins = <Procedure>[];
+
/// Exports that can't be serialized.
///
/// The key is the name of the exported member.
@@ -1003,6 +1012,55 @@
return total;
}
+ int finishNoSuchMethodForwarders() {
+ int count = 0;
+ CloneVisitor cloner = new CloneVisitor();
+ for (int i = 0; i < noSuchMethodForwardersOrigins.length; i += 2) {
+ Procedure forwarder = noSuchMethodForwardersOrigins[i];
+ Procedure origin = noSuchMethodForwardersOrigins[i + 1];
+
+ int positionalCount = origin.function.positionalParameters.length;
+ if (forwarder.function.positionalParameters.length != positionalCount) {
+ return unexpected(
+ "$positionalCount",
+ "${forwarder.function.positionalParameters.length}",
+ origin.fileOffset,
+ origin.fileUri);
+ }
+ for (int j = 0; j < positionalCount; ++j) {
+ VariableDeclaration forwarderParameter =
+ forwarder.function.positionalParameters[j];
+ VariableDeclaration originParameter =
+ origin.function.positionalParameters[j];
+ if (originParameter.initializer != null) {
+ forwarderParameter.initializer =
+ cloner.clone(originParameter.initializer);
+ forwarderParameter.initializer.parent = forwarderParameter;
+ }
+ }
+
+ Map<String, VariableDeclaration> originNamedMap =
+ <String, VariableDeclaration>{};
+ for (VariableDeclaration originNamed in origin.function.namedParameters) {
+ originNamedMap[originNamed.name] = originNamed;
+ }
+ for (VariableDeclaration forwarderNamed
+ in forwarder.function.namedParameters) {
+ VariableDeclaration originNamed = originNamedMap[forwarderNamed.name];
+ if (originNamed == null) {
+ return unhandled(
+ "null", forwarder.name.name, origin.fileOffset, origin.fileUri);
+ }
+ forwarderNamed.initializer = cloner.clone(originNamed.initializer);
+ forwarderNamed.initializer.parent = forwarderNamed;
+ }
+
+ ++count;
+ }
+ noSuchMethodForwardersOrigins.clear();
+ return count;
+ }
+
void addNativeMethod(KernelFunctionBuilder method) {
nativeMethods.add(method);
}
diff --git a/pkg/front_end/lib/src/fasta/kernel/kernel_shadow_ast.dart b/pkg/front_end/lib/src/fasta/kernel/kernel_shadow_ast.dart
index a842348..bdbcd09 100644
--- a/pkg/front_end/lib/src/fasta/kernel/kernel_shadow_ast.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/kernel_shadow_ast.dart
@@ -1300,7 +1300,8 @@
variable?.type,
syntheticWrite.fileOffset,
syntheticWrite.variable.type,
- syntheticWrite.variable.fileOffset,
+ (syntheticWrite.variable as VariableDeclarationJudgment)
+ .createBinder(inferrer),
null);
} else if (syntheticWrite is PropertySet) {
inferrer.listener.forInStatement(
@@ -1637,7 +1638,9 @@
/// Concrete shadow object representing an assignment to a target for which
/// assignment is not allowed.
class IllegalAssignmentJudgment extends ComplexAssignmentJudgment {
- IllegalAssignmentJudgment(ExpressionJudgment rhs) : super(rhs);
+ IllegalAssignmentJudgment(ExpressionJudgment rhs) : super(rhs) {
+ rhs.parent = this;
+ }
@override
DartType _getWriteType(ShadowTypeInferrer inferrer) {
@@ -1652,6 +1655,7 @@
if (write != null) {
inferrer.inferExpression(factory, write, const UnknownType(), false);
}
+ inferrer.inferExpression(factory, rhs, const UnknownType(), false);
_replaceWithDesugared();
inferredType = const DynamicType();
return null;
@@ -2222,11 +2226,13 @@
/// Shadow object for [Not].
class NotJudgment extends Not implements ExpressionJudgment {
+ final bool isSynthetic;
final Token operator;
DartType inferredType;
- NotJudgment(this.operator, ExpressionJudgment operand) : super(operand);
+ NotJudgment(this.isSynthetic, this.operator, ExpressionJudgment operand)
+ : super(operand);
ExpressionJudgment get judgment => operand;
@@ -2242,7 +2248,10 @@
inferrer.ensureAssignable(
boolType, judgment.inferredType, operand, fileOffset);
inferredType = boolType;
- inferrer.listener.not(this, fileOffset, operator, null, inferredType);
+ // TODO(scheglov) Temporary: https://github.com/dart-lang/sdk/issues/33666
+ if (!isSynthetic) {
+ inferrer.listener.not(this, fileOffset, operator, null, inferredType);
+ }
return null;
}
}
@@ -2597,8 +2606,13 @@
}
}
var inferredResult = _inferRhs(inferrer, factory, readType, writeContext);
- inferrer.listener.staticAssign(this, write?.fileOffset, writeMember,
- writeContext, inferredResult.combiner, inferredType);
+ inferrer.listener.staticAssign(
+ this,
+ write?.fileOffset,
+ writeMember,
+ writeContext is UnknownType ? const DynamicType() : writeContext,
+ inferredResult.combiner,
+ inferredType);
_replaceWithDesugared();
return null;
}
@@ -2901,6 +2915,26 @@
}
}
+/// Synthetic judgment class representing an attempt to write to a read-only
+/// local variable.
+class InvalidVariableWriteJudgment extends SyntheticExpressionJudgment {
+ /// Note: private to avoid colliding with Let.variable.
+ final VariableDeclarationJudgment _variable;
+
+ InvalidVariableWriteJudgment(kernel.Expression desugared, this._variable)
+ : super(desugared);
+
+ @override
+ Expression infer<Expression, Statement, Initializer, Type>(
+ ShadowTypeInferrer inferrer,
+ Factory<Expression, Statement, Initializer, Type> factory,
+ DartType typeContext) {
+ inferrer.listener.variableAssign(this, fileOffset, _variable.type,
+ _variable.createBinder(inferrer), null, _variable.type);
+ return super.infer(inferrer, factory, typeContext);
+ }
+}
+
/// Shadow object for expressions that are introduced by the front end as part
/// of desugaring or the handling of error conditions.
///
@@ -3125,7 +3159,7 @@
@override
ShadowTypeInferrer createLocalTypeInferrer(
Uri uri,
- TypeInferenceListener<int, int, Node, int> listener,
+ TypeInferenceListener<int, Node, int> listener,
InterfaceType thisType,
SourceLibraryBuilder library) {
return new ShadowTypeInferrer._(
@@ -3134,7 +3168,7 @@
@override
ShadowTypeInferrer createTopLevelTypeInferrer(
- TypeInferenceListener<int, int, Node, int> listener,
+ TypeInferenceListener<int, Node, int> listener,
InterfaceType thisType,
ShadowField field) {
return field._typeInferrer = new ShadowTypeInferrer._(
@@ -3156,7 +3190,7 @@
ShadowTypeInferrer._(
ShadowTypeInferenceEngine engine,
Uri uri,
- TypeInferenceListener<int, int, Node, int> listener,
+ TypeInferenceListener<int, Node, int> listener,
bool topLevel,
InterfaceType thisType,
SourceLibraryBuilder library)
@@ -3377,7 +3411,10 @@
this,
write.fileOffset,
writeContext,
- write is VariableSet ? write.variable.fileOffset : null,
+ write is VariableSet
+ ? (write.variable as VariableDeclarationJudgment)
+ .createBinder(inferrer)
+ : null,
inferredResult.combiner,
inferredType);
_replaceWithDesugared();
@@ -3512,6 +3549,63 @@
variable._isLocalFunction;
}
+/// Synthetic judgment class representing an attempt to invoke an unresolved
+/// target.
+class UnresolvedTargetInvocationJudgment extends SyntheticExpressionJudgment {
+ UnresolvedTargetInvocationJudgment(kernel.Expression desugared)
+ : super(desugared);
+
+ @override
+ Expression infer<Expression, Statement, Initializer, Type>(
+ ShadowTypeInferrer inferrer,
+ Factory<Expression, Statement, Initializer, Type> factory,
+ DartType typeContext) {
+ var result = super.infer(inferrer, factory, typeContext);
+ inferrer.listener.staticInvocation(
+ this, fileOffset, null, null, null, null, inferredType);
+ return result;
+ }
+}
+
+/// Synthetic judgment class representing an attempt to assign to an unresolved
+/// variable.
+class UnresolvedVariableAssignmentJudgment extends SyntheticExpressionJudgment {
+ final bool isCompound;
+ final ExpressionJudgment rhs;
+
+ UnresolvedVariableAssignmentJudgment(
+ kernel.Expression desugared, this.isCompound, this.rhs)
+ : super(desugared);
+
+ @override
+ Expression infer<Expression, Statement, Initializer, Type>(
+ ShadowTypeInferrer inferrer,
+ Factory<Expression, Statement, Initializer, Type> factory,
+ DartType typeContext) {
+ inferrer.inferExpression(factory, rhs, const UnknownType(), true);
+ inferredType = isCompound ? const DynamicType() : rhs.inferredType;
+ inferrer.listener.variableAssign(
+ this, fileOffset, const DynamicType(), null, null, inferredType);
+ return super.infer(inferrer, factory, typeContext);
+ }
+}
+
+/// Synthetic judgment class representing an attempt to read an unresolved
+/// variable.
+class UnresolvedVariableGetJudgment extends SyntheticExpressionJudgment {
+ UnresolvedVariableGetJudgment(kernel.Expression desugared) : super(desugared);
+
+ @override
+ Expression infer<Expression, Statement, Initializer, Type>(
+ ShadowTypeInferrer inferrer,
+ Factory<Expression, Statement, Initializer, Type> factory,
+ DartType typeContext) {
+ inferrer.listener
+ .variableGet(this, fileOffset, false, null, const DynamicType());
+ return super.infer(inferrer, factory, typeContext);
+ }
+}
+
/// Concrete shadow object representing a read from a variable in kernel form.
class VariableGetJudgment extends VariableGet implements ExpressionJudgment {
DartType inferredType;
diff --git a/pkg/front_end/lib/src/fasta/kernel/kernel_target.dart b/pkg/front_end/lib/src/fasta/kernel/kernel_target.dart
index 2608d35..d83a48b 100644
--- a/pkg/front_end/lib/src/fasta/kernel/kernel_target.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/kernel_target.dart
@@ -47,8 +47,7 @@
import '../compiler_context.dart' show CompilerContext;
-import '../deprecated_problems.dart'
- show deprecated_InputError, reportCrash, resetCrashReporting;
+import '../crash.dart' show withCrashReporting;
import '../dill/dill_target.dart' show DillTarget;
@@ -135,7 +134,6 @@
uriToSource = uriToSource ?? CompilerContext.current.uriToSource,
metadataCollector = metadataCollector,
super(dillTarget.ticker, uriTranslator, dillTarget.backendTarget) {
- resetCrashReporting();
loader = createLoader();
}
@@ -220,9 +218,8 @@
builder.mixedInType = null;
}
- void handleInputError(deprecated_InputError error, {bool isFullComponent}) {
- if (error != null) {
- LocatedMessage message = deprecated_InputError.toMessage(error);
+ void handleInputError(LocatedMessage message, {bool isFullComponent}) {
+ if (message != null) {
context.report(message, Severity.error);
errors.add(message);
}
@@ -232,39 +229,42 @@
@override
Future<Component> buildOutlines({CanonicalName nameRoot}) async {
if (loader.first == null) return null;
- try {
- loader.createTypeInferenceEngine();
- await loader.buildOutlines();
- loader.coreLibrary.becomeCoreLibrary(const DynamicType());
- dynamicType.bind(loader.coreLibrary["dynamic"]);
- loader.resolveParts();
- loader.computeLibraryScopes();
- objectType.bind(loader.coreLibrary["Object"]);
- bottomType.bind(loader.coreLibrary["Null"]);
- loader.resolveTypes();
- loader.computeDefaultTypes(dynamicType, bottomType, objectClassBuilder);
- List<SourceClassBuilder> myClasses = collectMyClasses();
- loader.checkSemantics(myClasses);
- loader.finishTypeVariables(objectClassBuilder, dynamicType);
- loader.buildComponent();
- installDefaultSupertypes();
- installDefaultConstructors(myClasses);
- loader.resolveConstructors();
- component =
- link(new List<Library>.from(loader.libraries), nameRoot: nameRoot);
- computeCoreTypes();
- loader.computeHierarchy();
- loader.performTopLevelInference(myClasses);
- loader.checkOverrides(myClasses);
- loader.checkAbstractMembers(myClasses);
- loader.addNoSuchMethodForwarders(myClasses);
- } on deprecated_InputError catch (e) {
- ticker.logMs("Got deprecated_InputError");
- handleInputError(e, isFullComponent: false);
- } catch (e, s) {
- return reportCrash(e, s, loader?.currentUriForCrashReporting);
- }
- return component;
+ return withCrashReporting<Component>(
+ () async {
+ loader.createTypeInferenceEngine();
+ await loader.buildOutlines();
+ loader.coreLibrary.becomeCoreLibrary(const DynamicType());
+ dynamicType.bind(loader.coreLibrary["dynamic"]);
+ loader.resolveParts();
+ loader.computeLibraryScopes();
+ objectType.bind(loader.coreLibrary["Object"]);
+ bottomType.bind(loader.coreLibrary["Null"]);
+ loader.resolveTypes();
+ loader.computeDefaultTypes(
+ dynamicType, bottomType, objectClassBuilder);
+ List<SourceClassBuilder> myClasses = collectMyClasses();
+ loader.checkSemantics(myClasses);
+ loader.finishTypeVariables(objectClassBuilder, dynamicType);
+ loader.buildComponent();
+ installDefaultSupertypes();
+ installDefaultConstructors(myClasses);
+ loader.resolveConstructors();
+ component = link(new List<Library>.from(loader.libraries),
+ nameRoot: nameRoot);
+ computeCoreTypes();
+ loader.computeHierarchy();
+ loader.performTopLevelInference(myClasses);
+ loader.checkOverrides(myClasses);
+ loader.checkAbstractMembers(myClasses);
+ loader.addNoSuchMethodForwarders(myClasses);
+ return component;
+ },
+ () => loader?.currentUriForCrashReporting,
+ onInputError: (LocatedMessage message) {
+ ticker.logMs("Got unrecoverable error");
+ handleInputError(message, isFullComponent: false);
+ return component;
+ });
}
/// Build the kernel representation of the component loaded by this
@@ -283,28 +283,31 @@
return component;
}
- try {
- ticker.logMs("Building component");
- await loader.buildBodies();
- loader.finishDeferredLoadTearoffs();
- List<SourceClassBuilder> myClasses = collectMyClasses();
- finishAllConstructors(myClasses);
- loader.finishNativeMethods();
- loader.finishPatchMethods();
- runBuildTransformations();
+ return withCrashReporting<Component>(
+ () async {
+ ticker.logMs("Building component");
+ await loader.buildBodies();
+ loader.finishDeferredLoadTearoffs();
+ loader.finishNoSuchMethodForwarders();
+ List<SourceClassBuilder> myClasses = collectMyClasses();
+ finishAllConstructors(myClasses);
+ loader.finishNativeMethods();
+ loader.finishPatchMethods();
+ runBuildTransformations();
- if (verify) this.verify();
- if (errors.isNotEmpty) {
- handleInputError(null, isFullComponent: true);
- }
- handleRecoverableErrors(loader.unhandledErrors);
- } on deprecated_InputError catch (e) {
- ticker.logMs("Got deprecated_InputError");
- handleInputError(e, isFullComponent: true);
- } catch (e, s) {
- return reportCrash(e, s, loader?.currentUriForCrashReporting);
- }
- return component;
+ if (verify) this.verify();
+ if (errors.isNotEmpty) {
+ handleInputError(null, isFullComponent: true);
+ }
+ handleRecoverableErrors(loader.unhandledErrors);
+ return component;
+ },
+ () => loader?.currentUriForCrashReporting,
+ onInputError: (LocatedMessage message) {
+ ticker.logMs("Got unrecoverable error");
+ handleInputError(message, isFullComponent: true);
+ return component;
+ });
}
/// Adds a synthetic field named `#errors` to the main library that contains
diff --git a/pkg/front_end/lib/src/fasta/kernel/toplevel_inference_factory.dart b/pkg/front_end/lib/src/fasta/kernel/toplevel_inference_factory.dart
index ee0bbb2..62f7c16 100644
--- a/pkg/front_end/lib/src/fasta/kernel/toplevel_inference_factory.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/toplevel_inference_factory.dart
@@ -189,7 +189,7 @@
DartType loopVariableType,
int writeOffset,
DartType writeVariableType,
- int writeVariableDeclarationOffset,
+ covariant void writeVariableBinder,
Node writeTarget) {}
@override
@@ -485,7 +485,7 @@
ExpressionJudgment judgment,
int fileOffset,
DartType writeContext,
- int writeVariableDeclarationOffset,
+ covariant void writeVariableBinder,
Node combiner,
DartType inferredType) {}
diff --git a/pkg/front_end/lib/src/fasta/kernel/verifier.dart b/pkg/front_end/lib/src/fasta/kernel/verifier.dart
index 86aaafd..fc9e817 100644
--- a/pkg/front_end/lib/src/fasta/kernel/verifier.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/verifier.dart
@@ -28,7 +28,7 @@
import '../compiler_context.dart' show CompilerContext;
import '../fasta_codes.dart'
- show LocatedMessage, noLength, templateInternalVerificationError;
+ show LocatedMessage, noLength, templateInternalProblemVerificationError;
import '../severity.dart' show Severity;
@@ -106,7 +106,7 @@
int offset = node?.fileOffset ?? -1;
Uri file = node?.location?.file ?? fileUri;
Uri uri = file == null ? null : file;
- LocatedMessage message = templateInternalVerificationError
+ LocatedMessage message = templateInternalProblemVerificationError
.withArguments(details)
.withLocation(uri, offset, noLength);
CompilerContext.current.report(message, Severity.error);
diff --git a/pkg/front_end/lib/src/fasta/loader.dart b/pkg/front_end/lib/src/fasta/loader.dart
index b86ce27..9c6044c 100644
--- a/pkg/front_end/lib/src/fasta/loader.dart
+++ b/pkg/front_end/lib/src/fasta/loader.dart
@@ -10,7 +10,7 @@
import 'builder/builder.dart' show Declaration, LibraryBuilder;
-import 'deprecated_problems.dart' show firstSourceUri;
+import 'crash.dart' show firstSourceUri;
import 'messages.dart'
show
diff --git a/pkg/front_end/lib/src/fasta/parser.dart b/pkg/front_end/lib/src/fasta/parser.dart
index 13713da..54082f1 100644
--- a/pkg/front_end/lib/src/fasta/parser.dart
+++ b/pkg/front_end/lib/src/fasta/parser.dart
@@ -12,6 +12,8 @@
import 'parser/parser_error.dart' show ParserError;
+import 'fasta_codes.dart' show Message, messageNativeClauseShouldBeAnnotation;
+
export 'parser/assert.dart' show Assert;
export 'parser/class_member_parser.dart' show ClassMemberParser;
@@ -33,8 +35,22 @@
export 'parser/util.dart'
show lengthForToken, lengthOfSpan, offsetForToken, optional;
+class ErrorCollectingListener extends Listener {
+ final List<ParserError> recoverableErrors = <ParserError>[];
+
+ void handleRecoverableError(
+ Message message, Token startToken, Token endToken) {
+ /// TODO(danrubel): Ignore this error until we deprecate `native` support.
+ if (message == messageNativeClauseShouldBeAnnotation) {
+ return;
+ }
+ recoverableErrors
+ .add(new ParserError.fromTokens(startToken, endToken, message));
+ }
+}
+
List<ParserError> parse(Token tokens) {
- Listener listener = new Listener();
+ ErrorCollectingListener listener = new ErrorCollectingListener();
Parser parser = new Parser(listener);
parser.parseUnit(tokens);
return listener.recoverableErrors;
diff --git a/pkg/front_end/lib/src/fasta/parser/forwarding_listener.dart b/pkg/front_end/lib/src/fasta/parser/forwarding_listener.dart
index a9d32fe..f289459 100644
--- a/pkg/front_end/lib/src/fasta/parser/forwarding_listener.dart
+++ b/pkg/front_end/lib/src/fasta/parser/forwarding_listener.dart
@@ -877,8 +877,8 @@
}
@override
- void handleAsOperator(Token operator, Token endToken) {
- listener?.handleAsOperator(operator, endToken);
+ void handleAsOperator(Token operator) {
+ listener?.handleAsOperator(operator);
}
@override
@@ -1059,8 +1059,8 @@
}
@override
- void handleIsOperator(Token operator, Token not, Token endToken) {
- listener?.handleIsOperator(operator, not, endToken);
+ void handleIsOperator(Token isOperator, Token not) {
+ listener?.handleIsOperator(isOperator, not);
}
@override
@@ -1340,9 +1340,6 @@
}
@override
- List<ParserError> get recoverableErrors => listener?.recoverableErrors;
-
- @override
set suppressParseErrors(bool value) {
listener?.suppressParseErrors = value;
}
diff --git a/pkg/front_end/lib/src/fasta/parser/listener.dart b/pkg/front_end/lib/src/fasta/parser/listener.dart
index 40995c9..3fb1f3d 100644
--- a/pkg/front_end/lib/src/fasta/parser/listener.dart
+++ b/pkg/front_end/lib/src/fasta/parser/listener.dart
@@ -6,8 +6,7 @@
import '../../scanner/token.dart' show Token, TokenType;
-import '../fasta_codes.dart'
- show Message, messageNativeClauseShouldBeAnnotation;
+import '../fasta_codes.dart' show Message;
import '../quote.dart' show UnescapeErrorListener;
@@ -33,8 +32,6 @@
/// Events starting with `handle` are used when isn't possible to have a begin
/// event.
class Listener implements UnescapeErrorListener {
- final List<ParserError> recoverableErrors = <ParserError>[];
-
Uri get uri => null;
void logEvent(String name) {}
@@ -956,7 +953,7 @@
logEvent("WhileStatement");
}
- void handleAsOperator(Token operator, Token endToken) {
+ void handleAsOperator(Token operator) {
logEvent("AsOperator");
}
@@ -1017,7 +1014,7 @@
logEvent("IndexedExpression");
}
- void handleIsOperator(Token operator, Token not, Token endToken) {
+ void handleIsOperator(Token isOperator, Token not) {
logEvent("IsOperator");
}
@@ -1234,14 +1231,7 @@
/// beginning of the [startToken] and the end of the [endToken] should be
/// highlighted. The [startToken] and [endToken] can be the same token.
void handleRecoverableError(
- Message message, Token startToken, Token endToken) {
- /// TODO(danrubel): Ignore this error until we deprecate `native` support.
- if (message == messageNativeClauseShouldBeAnnotation) {
- return;
- }
- recoverableErrors
- .add(new ParserError.fromTokens(startToken, endToken, message));
- }
+ Message message, Token startToken, Token endToken) {}
@override
void handleUnescapeError(
diff --git a/pkg/front_end/lib/src/fasta/parser/parser.dart b/pkg/front_end/lib/src/fasta/parser/parser.dart
index 3b8f651..73e2ff4 100644
--- a/pkg/front_end/lib/src/fasta/parser/parser.dart
+++ b/pkg/front_end/lib/src/fasta/parser/parser.dart
@@ -10,8 +10,6 @@
import '../scanner.dart' show ErrorToken, Token;
-import '../scanner/recover.dart' show skipToEof;
-
import '../../scanner/token.dart'
show
ASSIGNMENT_PRECEDENCE,
@@ -1109,20 +1107,12 @@
}
Token skipFormalParameters(Token token, MemberKind kind) {
- Token lastConsumed = token;
token = token.next;
+ assert(optional('(', token));
// TODO(ahe): Shouldn't this be `beginFormalParameters`?
listener.beginOptionalFormalParameters(token);
- if (!optional('(', token)) {
- if (optional(';', token)) {
- reportRecoverableError(token, fasta.messageExpectedOpenParens);
- listener.endFormalParameters(0, token, token, kind);
- return lastConsumed;
- }
- listener.endFormalParameters(0, token, token, kind);
- return reportUnexpectedToken(token);
- }
Token closeBrace = token.endGroup;
+ assert(optional(')', closeBrace));
listener.endFormalParameters(0, token, closeBrace, kind);
return closeBrace;
}
@@ -1851,18 +1841,27 @@
}
Token parseStringPart(Token token) {
- token = token.next;
- while (token.kind != STRING_TOKEN) {
- if (token is ErrorToken) {
- reportErrorToken(token, true);
- } else {
- token = reportUnrecoverableErrorWithToken(
- token, fasta.templateExpectedString);
+ Token next = token.next;
+ if (next.kind != STRING_TOKEN) {
+ bool errorReported = false;
+ while (next is ErrorToken) {
+ errorReported = true;
+ reportErrorToken(next);
+ token = next;
+ next = token.next;
}
- token = token.next;
+ if (next.kind != STRING_TOKEN) {
+ if (!errorReported) {
+ reportRecoverableErrorWithToken(next, fasta.templateExpectedString);
+ }
+ next = rewriter
+ .insertTokenAfter(token,
+ new SyntheticStringToken(TokenType.STRING, '', next.charOffset))
+ .next;
+ }
}
- listener.handleStringPart(token);
- return token;
+ listener.handleStringPart(next);
+ return next;
}
/// Insert a synthetic identifier after the given [token] and create an error
@@ -1873,15 +1872,8 @@
Token next = token.next;
reportRecoverableError(messageOnToken ?? next,
message ?? context.recoveryTemplate.withArguments(next));
- Token identifier = new SyntheticStringToken(
- TokenType.IDENTIFIER,
- context == IdentifierContext.methodDeclaration ||
- context == IdentifierContext.topLevelVariableDeclaration ||
- context == IdentifierContext.fieldDeclaration
- ? '#synthetic_identifier_${next.offset}'
- : '',
- next.charOffset,
- 0);
+ Token identifier =
+ new SyntheticStringToken(TokenType.IDENTIFIER, '', next.charOffset, 0);
rewriter.insertTokenAfter(token, identifier);
return token.next;
}
@@ -1904,17 +1896,6 @@
return identifier;
}
- Token expect(String string, Token token) {
- // TODO(danrubel): update all uses of expect(';'...) to ensureSemicolon
- // then add assert(!identical(';', string));
- if (!identical(string, token.stringValue)) {
- return reportUnrecoverableError(
- token, fasta.templateExpectedButGot.withArguments(string))
- .next;
- }
- return token.next;
- }
-
bool notEofOrValue(String value, Token token) {
return !identical(token.kind, EOF_TOKEN) &&
!identical(value, token.stringValue);
@@ -3216,8 +3197,8 @@
++statementCount;
}
token = token.next;
+ assert(optional('}', token));
listener.endBlockFunctionBody(statementCount, begin, token);
- expect('}', token);
loopState = savedLoopState;
return token;
}
@@ -3298,7 +3279,7 @@
// This happens for degenerate programs, for example, a lot of nested
// if-statements. The language test deep_nesting2_negative_test, for
// example, provokes this.
- return recoverFromStackOverflow(token.next);
+ return recoverFromStackOverflow(token);
}
Token result = parseStatementX(token);
statementDepth--;
@@ -3599,7 +3580,9 @@
replacement.endToken = replacement.next;
token = parseArgumentOrIndexStar(token, null);
} else {
- token = reportUnexpectedToken(token.next);
+ // Recovery
+ reportRecoverableErrorWithToken(
+ token.next, fasta.templateUnexpectedToken);
}
} else if (identical(type, TokenType.IS)) {
token = parseIsOperatorRest(token);
@@ -3839,7 +3822,8 @@
// Report the error in the error token, skip the error token, and try
// again.
previous = token;
- token = reportErrorTokenAndAdvance(token);
+ reportErrorToken(token);
+ token = token.next;
} while (token is ErrorToken);
return parsePrimary(previous, context);
} else {
@@ -4506,15 +4490,8 @@
not = token = token.next;
}
token = computeType(token, true).ensureTypeNotVoid(token, this);
- Token next = token.next;
- listener.handleIsOperator(operator, not, next);
- String value = next.stringValue;
- if (identical(value, 'is') || identical(value, 'as')) {
- // The is- and as-operators cannot be chained, but they can take part of
- // expressions like: foo is Foo || foo is Bar.
- reportUnexpectedToken(next);
- }
- return token;
+ listener.handleIsOperator(operator, not);
+ return skipChainedAsIsOperators(token);
}
/// ```
@@ -4526,14 +4503,27 @@
Token operator = token = token.next;
assert(optional('as', operator));
token = computeType(token, true).ensureTypeNotVoid(token, this);
- Token next = token.next;
- listener.handleAsOperator(operator, next);
- String value = next.stringValue;
- if (identical(value, 'is') || identical(value, 'as')) {
+ listener.handleAsOperator(operator);
+ return skipChainedAsIsOperators(token);
+ }
+
+ Token skipChainedAsIsOperators(Token token) {
+ while (true) {
+ Token next = token.next;
+ String value = next.stringValue;
+ if (!identical(value, 'is') && !identical(value, 'as')) {
+ return token;
+ }
// The is- and as-operators cannot be chained.
- reportUnexpectedToken(next);
+ // TODO(danrubel): Consider a better error message.
+ reportRecoverableErrorWithToken(next, fasta.templateUnexpectedToken);
+ if (optional('!', next.next)) {
+ next = next.next;
+ }
+ token = computeType(next, true).skipType(next);
+ next = token.next;
+ value = next.stringValue;
}
- return token;
}
/// Returns true if [token] could be the start of a function declaration
@@ -5053,8 +5043,8 @@
Token begin = token = ensureBlock(token, null);
listener.beginBlock(begin);
int statementCount = 0;
- while (notEofOrValue('}', token.next)) {
- Token startToken = token.next;
+ Token startToken = token.next;
+ while (notEofOrValue('}', startToken)) {
token = parseStatement(token);
if (identical(token.next, startToken)) {
// No progress was made, so we report the current token as being invalid
@@ -5064,10 +5054,11 @@
token, fasta.templateUnexpectedToken.withArguments(token));
}
++statementCount;
+ startToken = token.next;
}
token = token.next;
+ assert(optional('}', token));
listener.endBlock(statementCount, begin, token);
- expect('}', token);
return token;
}
@@ -5665,30 +5656,25 @@
}
/// Report that the nesting depth of the code being parsed is too large for
- /// the parser to safely handle. Return the EOF token in order to cause the
- /// parser to unwind and exit.
+ /// the parser to safely handle. Return the next `}` or EOF.
Token recoverFromStackOverflow(Token token) {
- listener.handleRecoverableError(fasta.messageStackOverflow, token, token);
- Token semicolon = new SyntheticToken(TokenType.SEMICOLON, token.offset);
- listener.handleEmptyStatement(semicolon);
- return skipToEof(token);
- }
+ Token next = token.next;
+ reportRecoverableError(next, fasta.messageStackOverflow);
- /// Don't call this method. Should only be used as a last resort when there
- /// is no feasible way to recover from a parser error.
- Token reportUnrecoverableError(Token token, Message message) {
- Token next;
- if (token is ErrorToken) {
- next = reportErrorToken(token, false);
- } else {
- next = listener.handleUnrecoverableError(token, message);
+ next = new SyntheticToken(TokenType.SEMICOLON, token.offset);
+ rewriter.insertTokenAfter(token, next);
+ listener.handleEmptyStatement(next);
+
+ while (notEofOrValue('}', next)) {
+ token = next;
+ next = token.next;
}
- return next ?? skipToEof(token);
+ return token;
}
void reportRecoverableError(Token token, Message message) {
if (token is ErrorToken) {
- reportErrorToken(token, true);
+ reportErrorToken(token);
} else {
// Find a non-synthetic token on which to report the error.
token = findNonSyntheticToken(token);
@@ -5696,22 +5682,10 @@
}
}
- Token reportUnrecoverableErrorWithToken(
- Token token, Template<_MessageWithArgument<Token>> template) {
- Token next;
- if (token is ErrorToken) {
- next = reportErrorToken(token, false);
- } else {
- next = listener.handleUnrecoverableError(
- token, template.withArguments(token));
- }
- return next ?? skipToEof(token);
- }
-
void reportRecoverableErrorWithToken(
Token token, Template<_MessageWithArgument<Token>> template) {
if (token is ErrorToken) {
- reportErrorToken(token, true);
+ reportErrorToken(token);
} else {
// Find a non-synthetic token on which to report the error.
token = findNonSyntheticToken(token);
@@ -5720,29 +5694,8 @@
}
}
- Token reportErrorToken(ErrorToken token, bool isRecoverable) {
- Message message = token.assertionMessage;
- // TODO(brianwilkerson): Error recovery belongs in the parser, not the
- // listeners. As a result, the following code needs to be re-worked. While
- // listeners still need to handle errors, there should not be a distinction
- // between recoverable and non-recoverable errors.
- if (isRecoverable) {
- listener.handleRecoverableError(message, token, token);
- return null;
- } else {
- Token next = listener.handleUnrecoverableError(token, message);
- return next ?? skipToEof(token);
- }
- }
-
- /// Report the given error [token] as an unrecoverable error and return the
- /// next token to be processed.
- Token reportErrorTokenAndAdvance(ErrorToken token) {
- Token nextToken = reportErrorToken(token, false);
- if (nextToken == token) {
- return token.next;
- }
- return nextToken;
+ void reportErrorToken(ErrorToken token) {
+ listener.handleRecoverableError(token.assertionMessage, token, token);
}
Token parseInvalidTopLevelDeclaration(Token token) {
@@ -5759,11 +5712,6 @@
return next;
}
- Token reportUnexpectedToken(Token token) {
- return reportUnrecoverableErrorWithToken(
- token, fasta.templateUnexpectedToken);
- }
-
Token reportAndSkipClassInClass(Token token) {
assert(optional('class', token));
reportRecoverableError(token, fasta.messageClassInClass);
diff --git a/pkg/front_end/lib/src/fasta/problems.dart b/pkg/front_end/lib/src/fasta/problems.dart
index d16e520..d0c8cc8 100644
--- a/pkg/front_end/lib/src/fasta/problems.dart
+++ b/pkg/front_end/lib/src/fasta/problems.dart
@@ -17,6 +17,8 @@
import 'severity.dart' show Severity;
+export 'deprecated_problems.dart' show DebugAbort;
+
/// Used to report an internal error.
///
/// Internal errors should be avoided as best as possible, but are preferred
diff --git a/pkg/front_end/lib/src/fasta/rewrite_severity.dart b/pkg/front_end/lib/src/fasta/rewrite_severity.dart
index 0455195..3961294 100644
--- a/pkg/front_end/lib/src/fasta/rewrite_severity.dart
+++ b/pkg/front_end/lib/src/fasta/rewrite_severity.dart
@@ -10,9 +10,13 @@
Severity severity, msg.Code<Object> code, Uri fileUri) {
if (severity != Severity.ignored) return severity;
String path = fileUri.path;
- const String fastaPath = "/pkg/front_end/lib/src/fasta/";
+ String fastaPath = "/pkg/front_end/lib/src/fasta/";
int index = path.indexOf(fastaPath);
- if (index == -1) return severity;
+ if (index == -1) {
+ fastaPath = "/pkg/front_end/tool/_fasta/";
+ index = path.indexOf(fastaPath);
+ if (index == -1) return severity;
+ }
if (code == msg.codeUseOfDeprecatedIdentifier) {
// TODO(ahe): Remove the exceptions below.
// We plan to remove all uses of deprecated identifiers from Fasta. The
@@ -21,16 +25,16 @@
// below and compile Fasta with itself to get a list of remaining call
// sites.
switch (path.substring(fastaPath.length + index)) {
+ case "command_line.dart":
case "command_line_reporting.dart":
case "deprecated_problems.dart":
+ case "entry_points.dart":
case "kernel/body_builder.dart":
case "kernel/expression_generator.dart":
case "kernel/kernel_expression_generator.dart":
case "kernel/kernel_expression_generator_impl.dart":
case "kernel/kernel_procedure_builder.dart":
- case "kernel/kernel_target.dart":
case "kernel/kernel_type_variable_builder.dart":
- case "quote.dart":
case "source/diet_listener.dart":
case "source/source_library_builder.dart":
case "source/source_loader.dart":
@@ -72,6 +76,7 @@
case "dill/dill_loader.dart":
case "dill/dill_target.dart":
case "dill/dill_typedef_builder.dart":
+ case "entry_points.dart":
case "export.dart":
case "fasta_codes.dart":
case "import.dart":
diff --git a/pkg/front_end/lib/src/fasta/scope.dart b/pkg/front_end/lib/src/fasta/scope.dart
index aae07ff..a03b174 100644
--- a/pkg/front_end/lib/src/fasta/scope.dart
+++ b/pkg/front_end/lib/src/fasta/scope.dart
@@ -63,7 +63,8 @@
isModifiable: false);
Scope.nested(Scope parent, String debugName, {bool isModifiable: true})
- : this(<String, Declaration>{}, null, parent, debugName,
+ : this(
+ <String, Declaration>{}, <String, Declaration>{}, parent, debugName,
isModifiable: isModifiable);
Scope copyWithParent(Scope parent, String debugName) {
diff --git a/pkg/front_end/lib/src/fasta/severity.dart b/pkg/front_end/lib/src/fasta/severity.dart
index 9a29a74..d3eb763 100644
--- a/pkg/front_end/lib/src/fasta/severity.dart
+++ b/pkg/front_end/lib/src/fasta/severity.dart
@@ -30,3 +30,17 @@
'INTERNAL_PROBLEM': Severity.internalProblem,
'WARNING': Severity.warning,
};
+
+const Map<Severity, String> severityPrefixes = const <Severity, String>{
+ Severity.error: "Error",
+ Severity.internalProblem: "Internal problem",
+ Severity.warning: "Warning",
+ Severity.context: "Context",
+};
+
+const Map<Severity, String> severityTexts = const <Severity, String>{
+ Severity.error: "error",
+ Severity.internalProblem: "internal problem",
+ Severity.warning: "warning",
+ Severity.context: "context",
+};
diff --git a/pkg/front_end/lib/src/fasta/source/diet_listener.dart b/pkg/front_end/lib/src/fasta/source/diet_listener.dart
index 722435f..a180656 100644
--- a/pkg/front_end/lib/src/fasta/source/diet_listener.dart
+++ b/pkg/front_end/lib/src/fasta/source/diet_listener.dart
@@ -27,8 +27,10 @@
import '../constant_context.dart' show ConstantContext;
+import '../crash.dart' show Crash;
+
import '../deprecated_problems.dart'
- show Crash, deprecated_InputError, deprecated_inputError;
+ show deprecated_InputError, deprecated_inputError;
import '../fasta_codes.dart'
show Message, messageExpectedBlockToSkip, templateInternalProblemNotFound;
@@ -37,7 +39,7 @@
import '../parser.dart' show Assert, MemberKind, Parser, optional;
-import '../problems.dart' show internalProblem, unexpected;
+import '../problems.dart' show DebugAbort, internalProblem, unexpected;
import '../type_inference/type_inference_engine.dart' show TypeInferenceEngine;
@@ -538,7 +540,7 @@
StackListener createListener(
ModifierBuilder builder, Scope memberScope, bool isInstanceMember,
[Scope formalParameterScope,
- TypeInferenceListener<int, int, Node, int> listener]) {
+ TypeInferenceListener<int, Node, int> listener]) {
listener ??= new KernelTypeInferenceListener();
// Note: we set thisType regardless of whether we are building a static
// member, since that provides better error recovery.
@@ -750,6 +752,8 @@
listener.checkEmpty(token.charOffset);
listenerFinishFunction(listener, startToken, metadata, kind,
metadataConstants, formals, asyncModifier, body);
+ } on DebugAbort {
+ rethrow;
} on deprecated_InputError {
rethrow;
} catch (e, s) {
diff --git a/pkg/front_end/lib/src/fasta/source/source_class_builder.dart b/pkg/front_end/lib/src/fasta/source/source_class_builder.dart
index 041c161..6e1045b 100644
--- a/pkg/front_end/lib/src/fasta/source/source_class_builder.dart
+++ b/pkg/front_end/lib/src/fasta/source/source_class_builder.dart
@@ -178,7 +178,10 @@
scope.setters.forEach((String name, Declaration setter) {
Declaration member = scopeBuilder[name];
- if (member == null || !member.isField || member.isFinal) return;
+ if (member == null ||
+ !(member.isField && !member.isFinal ||
+ member.isRegularMethod && member.isStatic && setter.isStatic))
+ return;
if (member.isInstanceMember == setter.isInstanceMember) {
addProblem(templateConflictsWithMember.withArguments(name),
setter.charOffset, noLength);
@@ -194,6 +197,15 @@
}
});
+ scope.setters.forEach((String name, Declaration setter) {
+ Declaration constructor = constructorScopeBuilder[name];
+ if (constructor == null || !setter.isStatic) return;
+ addProblem(templateConflictsWithConstructor.withArguments(name),
+ setter.charOffset, noLength);
+ addProblem(templateConflictsWithSetter.withArguments(name),
+ constructor.charOffset, noLength);
+ });
+
cls.procedures.sort(compareProcedures);
return cls;
}
diff --git a/pkg/front_end/lib/src/fasta/source/source_library_builder.dart b/pkg/front_end/lib/src/fasta/source/source_library_builder.dart
index 355804a..7342f1c 100644
--- a/pkg/front_end/lib/src/fasta/source/source_library_builder.dart
+++ b/pkg/front_end/lib/src/fasta/source/source_library_builder.dart
@@ -785,8 +785,8 @@
}
DeclarationBuilder.library()
- : this(<String, Declaration>{}, <String, Declaration>{}, null, "library",
- -1, null);
+ : this(<String, Declaration>{}, <String, Declaration>{}, null,
+ "<library>", -1, null);
DeclarationBuilder createNested(String name, bool hasMembers) {
return new DeclarationBuilder<T>(
diff --git a/pkg/front_end/lib/src/fasta/source/source_loader.dart b/pkg/front_end/lib/src/fasta/source/source_loader.dart
index 5398291..3304efc 100644
--- a/pkg/front_end/lib/src/fasta/source/source_loader.dart
+++ b/pkg/front_end/lib/src/fasta/source/source_loader.dart
@@ -383,6 +383,16 @@
ticker.logMs("Finished deferred load tearoffs $count");
}
+ void finishNoSuchMethodForwarders() {
+ int count = 0;
+ builders.forEach((Uri uri, LibraryBuilder library) {
+ if (library.loader == this) {
+ count += library.finishNoSuchMethodForwarders();
+ }
+ });
+ ticker.logMs("Finished noSuchMethod forwarders for $count procedures");
+ }
+
void resolveConstructors() {
int count = 0;
builders.forEach((Uri uri, LibraryBuilder library) {
diff --git a/pkg/front_end/lib/src/fasta/source/stack_listener.dart b/pkg/front_end/lib/src/fasta/source/stack_listener.dart
index 262dfe2..22658b6 100644
--- a/pkg/front_end/lib/src/fasta/source/stack_listener.dart
+++ b/pkg/front_end/lib/src/fasta/source/stack_listener.dart
@@ -6,7 +6,7 @@
import 'package:kernel/ast.dart' show AsyncMarker, Expression, FunctionNode;
-import '../deprecated_problems.dart' show deprecated_inputError;
+import '../deprecated_problems.dart' show deprecated_inputErrorFromMessage;
import '../fasta_codes.dart'
show
@@ -14,7 +14,14 @@
messageNativeClauseShouldBeAnnotation,
templateInternalProblemStackNotEmpty;
-import '../parser.dart' show Listener, MemberKind, Parser;
+import '../parser.dart'
+ show
+ Listener,
+ MemberKind,
+ Parser,
+ lengthForToken,
+ lengthOfSpan,
+ offsetForToken;
import '../parser/identifier_context.dart' show IdentifierContext;
@@ -174,11 +181,6 @@
charOffset,
uri);
}
- if (recoverableErrors.isNotEmpty) {
- // TODO(ahe): Handle recoverable errors better.
- deprecated_inputError(
- uri, recoverableErrors.first.beginOffset, recoverableErrors);
- }
}
@override
@@ -342,18 +344,19 @@
@override
void handleRecoverableError(
Message message, Token startToken, Token endToken) {
- /// TODO(danrubel): Ignore this error until we deprecate `native` support.
if (message == messageNativeClauseShouldBeAnnotation) {
+ // TODO(danrubel): Ignore this error until we deprecate `native` support.
return;
}
debugEvent("Error: ${message.message}");
- int offset = startToken.offset;
- addCompileTimeError(message, offset, endToken.end - offset);
+ addCompileTimeError(message, offsetForToken(startToken),
+ lengthOfSpan(startToken, endToken));
}
@override
Token handleUnrecoverableError(Token token, Message message) {
- throw deprecated_inputError(uri, token.charOffset, message.message);
+ return deprecated_inputErrorFromMessage(message.withLocation(
+ uri, offsetForToken(token), lengthForToken(token)));
}
@override
diff --git a/pkg/front_end/lib/src/fasta/testing/environment_variable.dart b/pkg/front_end/lib/src/fasta/testing/environment_variable.dart
deleted file mode 100644
index 8aa3dbd8..0000000
--- a/pkg/front_end/lib/src/fasta/testing/environment_variable.dart
+++ /dev/null
@@ -1,72 +0,0 @@
-// Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-library fasta.testing.environment_variable;
-
-import 'dart:async' show Future;
-
-import 'dart:io' show Directory, File, Platform;
-
-import '../deprecated_problems.dart' show deprecated_inputError;
-
-class EnvironmentVariable {
- final String name;
-
- final String what;
-
- const EnvironmentVariable(this.name, this.what);
-
- Future<String> get value async {
- String value = Platform.environment[name];
- if (value == null) return variableNotDefined();
- await validate(value);
- return value;
- }
-
- Future<Null> validate(String value) => new Future<Null>.value();
-
- variableNotDefined() {
- deprecated_inputError(
- null, null, "The environment variable '$name' isn't defined. $what");
- }
-}
-
-class EnvironmentVariableFile extends EnvironmentVariable {
- const EnvironmentVariableFile(String name, String what) : super(name, what);
-
- Future<Null> validate(String value) async {
- if (!await new File(value).exists()) notFound(value);
- return null;
- }
-
- notFound(String value) {
- deprecated_inputError(
- null,
- null,
- "The environment variable '$name' has the value "
- "'$value', that isn't a file. $what");
- }
-}
-
-class EnvironmentVariableDirectory extends EnvironmentVariable {
- const EnvironmentVariableDirectory(String name, String what)
- : super(name, what);
-
- Future<Null> validate(String value) async {
- if (!await new Directory(value).exists()) notFound(value);
- return null;
- }
-
- notFound(String value) {
- deprecated_inputError(
- null,
- null,
- "The environment variable '$name' has the value "
- "'$value', that isn't a directory. $what");
- }
-}
-
-Future<bool> fileExists(Uri base, String path) async {
- return await new File.fromUri(base.resolve(path)).exists();
-}
diff --git a/pkg/front_end/lib/src/fasta/type_inference/interface_resolver.dart b/pkg/front_end/lib/src/fasta/type_inference/interface_resolver.dart
index 9805fbf..bf2284c 100644
--- a/pkg/front_end/lib/src/fasta/type_inference/interface_resolver.dart
+++ b/pkg/front_end/lib/src/fasta/type_inference/interface_resolver.dart
@@ -1112,6 +1112,9 @@
procedure._field.initializer != null) {
node = new FieldInitializerInferenceNode(
_typeInferenceEngine, procedure._field, library);
+ }
+
+ if (node != null && procedure is SyntheticAccessor) {
ShadowField.setInferenceNode(procedure._field, node);
}
}
diff --git a/pkg/front_end/lib/src/fasta/type_inference/type_inference_engine.dart b/pkg/front_end/lib/src/fasta/type_inference/type_inference_engine.dart
index 8338668..969223e 100644
--- a/pkg/front_end/lib/src/fasta/type_inference/type_inference_engine.dart
+++ b/pkg/front_end/lib/src/fasta/type_inference/type_inference_engine.dart
@@ -242,14 +242,14 @@
/// with the given [uri].
TypeInferrer createLocalTypeInferrer(
Uri uri,
- TypeInferenceListener<int, int, Node, int> listener,
+ TypeInferenceListener<int, Node, int> listener,
InterfaceType thisType,
SourceLibraryBuilder library);
/// Creates a [TypeInferrer] object which is ready to perform type inference
/// on the given [field].
TypeInferrer createTopLevelTypeInferrer(
- TypeInferenceListener<int, int, Node, int> listener,
+ TypeInferenceListener<int, Node, int> listener,
InterfaceType thisType,
ShadowField field);
diff --git a/pkg/front_end/lib/src/fasta/type_inference/type_inference_listener.dart b/pkg/front_end/lib/src/fasta/type_inference/type_inference_listener.dart
index 2440504..579af3f 100644
--- a/pkg/front_end/lib/src/fasta/type_inference/type_inference_listener.dart
+++ b/pkg/front_end/lib/src/fasta/type_inference/type_inference_listener.dart
@@ -27,8 +27,7 @@
/// The default implementation (in this base class) does nothing, however it can
/// be used to debug type inference by uncommenting the
/// "with TypeInferenceDebugging" clause below.
-abstract class TypeInferenceListener<Location, Declaration, Reference,
- PrefixInfo> {
+abstract class TypeInferenceListener<Location, Reference, PrefixInfo> {
void asExpression(
ExpressionJudgment judgment,
Location location,
@@ -173,7 +172,7 @@
DartType loopVariableType,
Location writeLocation,
DartType writeVariableType,
- Declaration writeVariable,
+ covariant Object writeVariableBinder,
Reference writeTarget);
void forStatement(
@@ -422,7 +421,7 @@
ExpressionJudgment judgment,
Location location,
DartType writeContext,
- Declaration writeVariable,
+ covariant Object writeVariableBinder,
Reference combiner,
DartType inferredType);
@@ -457,7 +456,7 @@
///
/// TODO(paulberry): fuse this with KernelFactory.
class KernelTypeInferenceListener
- implements TypeInferenceListener<int, int, Node, int> {
+ implements TypeInferenceListener<int, Node, int> {
@override
void asExpression(ExpressionJudgment judgment, location, void expression,
Token asOperator, void literalType, DartType inferredType) {}
@@ -612,7 +611,7 @@
DartType loopVariableType,
writeLocation,
DartType writeVariableType,
- writeVariable,
+ covariant void writeVariableBinder,
writeTarget) {}
@override
@@ -888,8 +887,13 @@
DartType inferredType) {}
@override
- void variableAssign(ExpressionJudgment judgment, location,
- DartType writeContext, writeVariable, combiner, DartType inferredType) {}
+ void variableAssign(
+ ExpressionJudgment judgment,
+ location,
+ DartType writeContext,
+ covariant void writeVariableBinder,
+ combiner,
+ DartType inferredType) {}
@override
void variableDeclaration(
diff --git a/pkg/front_end/lib/src/fasta/type_inference/type_inferrer.dart b/pkg/front_end/lib/src/fasta/type_inference/type_inferrer.dart
index 962d38a..58b47b5 100644
--- a/pkg/front_end/lib/src/fasta/type_inference/type_inferrer.dart
+++ b/pkg/front_end/lib/src/fasta/type_inference/type_inferrer.dart
@@ -22,6 +22,7 @@
FunctionType,
Instantiation,
InterfaceType,
+ InvalidType,
InvocationExpression,
Let,
ListLiteral,
@@ -43,6 +44,7 @@
ThisExpression,
TypeParameter,
TypeParameterType,
+ Typedef,
VariableDeclaration,
VariableGet,
VoidType;
@@ -63,23 +65,10 @@
import '../../scanner/token.dart' show Token;
-import '../builder/class_builder.dart' show ClassBuilder;
-
-import '../builder/function_type_alias_builder.dart'
- show FunctionTypeAliasBuilder;
-
-import '../builder/invalid_type_builder.dart' show InvalidTypeBuilder;
-
-import '../builder/prefix_builder.dart' show PrefixBuilder;
-
-import '../builder/type_builder.dart' show TypeBuilder;
-
-import '../builder/type_variable_builder.dart' show TypeVariableBuilder;
+import '../builder/builder.dart' show PrefixBuilder;
import '../fasta_codes.dart';
-import '../kernel/expression_generator.dart' show TypeUseGenerator;
-
import '../kernel/factory.dart' show Factory;
import '../kernel/kernel_expression_generator.dart' show buildIsNull;
@@ -87,12 +76,13 @@
import '../kernel/kernel_shadow_ast.dart'
show
ArgumentsJudgment,
+ ConstructorInvocationJudgment,
ExpressionJudgment,
NullJudgment,
ShadowClass,
- ConstructorInvocationJudgment,
ShadowField,
ShadowMember,
+ SyntheticExpressionJudgment,
VariableDeclarationJudgment,
getExplicitTypeArguments;
@@ -389,7 +379,7 @@
void storePrefix(Token token, PrefixBuilder prefix);
- void storeTypeUse(TypeUseGenerator generator);
+ void storeTypeUse(int offset, Node node);
}
/// Implementation of [TypeInferrer] which doesn't do any type inference.
@@ -451,7 +441,7 @@
void storePrefix(Token token, PrefixBuilder prefix) {}
@override
- void storeTypeUse(TypeUseGenerator generator) {}
+ void storeTypeUse(int offset, Node node) {}
}
/// Derived class containing generic implementations of [TypeInferrer].
@@ -485,7 +475,7 @@
final TypeSchemaEnvironment typeSchemaEnvironment;
- final TypeInferenceListener<int, int, Node, int> listener;
+ final TypeInferenceListener<int, Node, int> listener;
final InterfaceType thisType;
@@ -668,10 +658,10 @@
new Let(
new VariableDeclaration.forValue(receiver)
..fileOffset = receiver.fileOffset,
- helper.buildCompileTimeError(
+ new SyntheticExpressionJudgment(helper.buildCompileTimeError(
errorTemplate.withArguments(name.name, receiverType),
fileOffset,
- noLength))
+ noLength)))
..fileOffset = fileOffset);
}
return interfaceMember;
@@ -844,8 +834,7 @@
if (receiverType is InterfaceType) {
var castedType =
classHierarchy.getTypeAsInstanceOf(receiverType, memberClass);
- calleeType = Substitution
- .fromInterfaceType(castedType)
+ calleeType = Substitution.fromInterfaceType(castedType)
.substituteType(calleeType);
}
}
@@ -905,8 +894,7 @@
if (receiverType is InterfaceType) {
var castedType =
classHierarchy.getTypeAsInstanceOf(receiverType, memberClass);
- setterType = Substitution
- .fromInterfaceType(castedType)
+ setterType = Substitution.fromInterfaceType(castedType)
.substituteType(setterType);
}
}
@@ -1708,21 +1696,20 @@
}
@override
- void storeTypeUse(TypeUseGenerator generator) {
- var declaration = generator.declaration;
- if (declaration is ClassBuilder<TypeBuilder, InterfaceType>) {
- Class class_ = declaration.target;
- listener.storeClassReference(
- generator.declarationReferenceOffset, class_, class_.rawType);
- } else if (declaration is TypeVariableBuilder<TypeBuilder, DartType>) {
+ void storeTypeUse(int offset, Node node) {
+ if (node is Class) {
+ listener.storeClassReference(offset, node, node.rawType);
+ } else if (node is TypeParameter) {
// TODO(paulberry): handle this case.
- } else if (declaration is FunctionTypeAliasBuilder<TypeBuilder, DartType>) {
+ } else if (node is FunctionType) {
// TODO(paulberry): handle this case.
- } else if (declaration is InvalidTypeBuilder<TypeBuilder, DartType>) {
+ } else if (node is Typedef) {
+ // TODO(paulberry): handle this case.
+ } else if (node is InvalidType) {
// TODO(paulberry): handle this case.
} else {
- throw new UnimplementedError(
- 'TODO(paulberry): ${declaration.runtimeType}');
+ // TODO(paulberry): handle this case.
+ return unhandled("${node.runtimeType}", "storeTypeUse", offset, uri);
}
}
@@ -1910,8 +1897,7 @@
mixinClass.fileUri);
return;
}
- InterfaceType u0 = Substitution
- .fromSupertype(baseType)
+ InterfaceType u0 = Substitution.fromSupertype(baseType)
.substituteSupertype(supertype)
.asInterfaceType;
// We want to solve U0 = S0 where S0 is mixinSupertype, but we only have
diff --git a/pkg/front_end/lib/src/fasta/uri_translator.dart b/pkg/front_end/lib/src/fasta/uri_translator.dart
index 7a0c8ff..4c98305 100644
--- a/pkg/front_end/lib/src/fasta/uri_translator.dart
+++ b/pkg/front_end/lib/src/fasta/uri_translator.dart
@@ -4,8 +4,6 @@
library fasta.uri_translator;
-import 'package:front_end/src/api_prototype/file_system.dart' show FileSystem;
-
/// Instances of [UriTranslator] translate absolute URIs into corresponding
/// file URIs in a [FileSystem]. Translated URIs are typically `file:` URIs,
/// but may use a different scheme depending on the used custom file system.
diff --git a/pkg/front_end/lib/src/kernel_generator_impl.dart b/pkg/front_end/lib/src/kernel_generator_impl.dart
index b699884..b745675 100644
--- a/pkg/front_end/lib/src/kernel_generator_impl.dart
+++ b/pkg/front_end/lib/src/kernel_generator_impl.dart
@@ -6,18 +6,29 @@
library front_end.kernel_generator_impl;
import 'dart:async' show Future;
-import 'dart:async';
import 'package:kernel/kernel.dart' show Component, CanonicalName;
-import 'base/processed_options.dart';
-import 'fasta/severity.dart' show Severity;
+import 'base/processed_options.dart' show ProcessedOptions;
+
import 'fasta/compiler_context.dart' show CompilerContext;
-import 'fasta/deprecated_problems.dart' show deprecated_InputError, reportCrash;
+
+import 'fasta/crash.dart' show withCrashReporting;
+
import 'fasta/dill/dill_target.dart' show DillTarget;
+
+import 'fasta/fasta_codes.dart' show LocatedMessage;
+
import 'fasta/kernel/kernel_target.dart' show KernelTarget;
-import 'fasta/kernel/utils.dart';
-import 'fasta/kernel/verifier.dart';
+
+import 'fasta/kernel/utils.dart' show printComponentText, serializeComponent;
+
+import 'fasta/kernel/verifier.dart' show verifyComponent;
+
+import 'fasta/loader.dart' show Loader;
+
+import 'fasta/severity.dart' show Severity;
+
import 'fasta/uri_translator.dart' show UriTranslator;
/// Implementation for the
@@ -44,114 +55,118 @@
if (!await options.validateOptions()) return null;
options.ticker.logMs("Validated arguments");
- try {
- UriTranslator uriTranslator = await options.getUriTranslator();
+ Loader sourceLoader;
+ return withCrashReporting<CompilerResult>(
+ () async {
+ UriTranslator uriTranslator = await options.getUriTranslator();
- var dillTarget =
- new DillTarget(options.ticker, uriTranslator, options.target);
+ var dillTarget =
+ new DillTarget(options.ticker, uriTranslator, options.target);
- Set<Uri> externalLibs(Component component) {
- return component.libraries
- .where((lib) => lib.isExternal)
- .map((lib) => lib.importUri)
- .toSet();
- }
-
- var sdkSummary = await options.loadSdkSummary(null);
- // By using the nameRoot of the the summary, we enable sharing the
- // sdkSummary between multiple invocations.
- CanonicalName nameRoot = sdkSummary?.root ?? new CanonicalName.root();
- if (sdkSummary != null) {
- var excluded = externalLibs(sdkSummary);
- dillTarget.loader.appendLibraries(sdkSummary,
- filter: (uri) => !excluded.contains(uri));
- }
-
- // TODO(sigmund): provide better error reporting if input summaries or
- // linked dependencies were listed out of order (or provide mechanism to
- // sort them).
- for (var inputSummary in await options.loadInputSummaries(nameRoot)) {
- var excluded = externalLibs(inputSummary);
- dillTarget.loader.appendLibraries(inputSummary,
- filter: (uri) => !excluded.contains(uri));
- }
-
- // All summaries are considered external and shouldn't include source-info.
- dillTarget.loader.libraries.forEach((lib) {
- // TODO(ahe): Don't do this, and remove [external_state_snapshot.dart].
- lib.isExternal = true;
- });
-
- // Linked dependencies are meant to be part of the component so they are not
- // marked external.
- for (var dependency in await options.loadLinkDependencies(nameRoot)) {
- var excluded = externalLibs(dependency);
- dillTarget.loader.appendLibraries(dependency,
- filter: (uri) => !excluded.contains(uri));
- }
-
- await dillTarget.buildOutlines();
-
- var kernelTarget = new KernelTarget(fs, false, dillTarget, uriTranslator);
- options.inputs.forEach(kernelTarget.read);
- Component summaryComponent =
- await kernelTarget.buildOutlines(nameRoot: nameRoot);
- List<int> summary = null;
- if (buildSummary) {
- if (options.verify) {
- for (var error in verifyComponent(summaryComponent)) {
- options.report(error, Severity.error);
+ Set<Uri> externalLibs(Component component) {
+ return component.libraries
+ .where((lib) => lib.isExternal)
+ .map((lib) => lib.importUri)
+ .toSet();
}
- }
- if (options.debugDump) {
- printComponentText(summaryComponent,
- libraryFilter: kernelTarget.isSourceLibrary);
- }
- // Copy the component to exclude the uriToSource map from the summary.
- //
- // Note: we don't pass the library argument to the constructor to
- // preserve the the libraries parent pointer (it should continue to point
- // to the component within KernelTarget).
- var trimmedSummaryComponent =
- new Component(nameRoot: summaryComponent.root)
- ..libraries.addAll(truncateSummary
- ? kernelTarget.loader.libraries
- : summaryComponent.libraries);
- trimmedSummaryComponent.metadata.addAll(summaryComponent.metadata);
+ var sdkSummary = await options.loadSdkSummary(null);
+ // By using the nameRoot of the the summary, we enable sharing the
+ // sdkSummary between multiple invocations.
+ CanonicalName nameRoot = sdkSummary?.root ?? new CanonicalName.root();
+ if (sdkSummary != null) {
+ var excluded = externalLibs(sdkSummary);
+ dillTarget.loader.appendLibraries(sdkSummary,
+ filter: (uri) => !excluded.contains(uri));
+ }
- // As documented, we only run outline transformations when we are building
- // summaries without building a full component (at this time, that's
- // the only need we have for these transformations).
- if (!buildComponent) {
- options.target.performOutlineTransformations(trimmedSummaryComponent);
- options.ticker.logMs("Transformed outline");
- }
- summary = serializeComponent(trimmedSummaryComponent);
- options.ticker.logMs("Generated outline");
- }
+ // TODO(sigmund): provide better error reporting if input summaries or
+ // linked dependencies were listed out of order (or provide mechanism to
+ // sort them).
+ for (var inputSummary in await options.loadInputSummaries(nameRoot)) {
+ var excluded = externalLibs(inputSummary);
+ dillTarget.loader.appendLibraries(inputSummary,
+ filter: (uri) => !excluded.contains(uri));
+ }
- Component component;
- if (buildComponent && kernelTarget.errors.isEmpty) {
- component = await kernelTarget.buildComponent(verify: options.verify);
- if (options.debugDump) {
- printComponentText(component,
- libraryFilter: kernelTarget.isSourceLibrary);
- }
- options.ticker.logMs("Generated component");
- }
+ // All summaries are considered external and shouldn't include source-info.
+ dillTarget.loader.libraries.forEach((lib) {
+ // TODO(ahe): Don't do this, and remove [external_state_snapshot.dart].
+ lib.isExternal = true;
+ });
- return new CompilerResult(
- summary: summary,
- component: component,
- deps: new List<Uri>.from(CompilerContext.current.dependencies));
- } on deprecated_InputError catch (e) {
- options.report(
- deprecated_InputError.toMessage(e), Severity.internalProblem);
- return null;
- } catch (e, t) {
- return reportCrash(e, t);
- }
+ // Linked dependencies are meant to be part of the component so they are not
+ // marked external.
+ for (var dependency in await options.loadLinkDependencies(nameRoot)) {
+ var excluded = externalLibs(dependency);
+ dillTarget.loader.appendLibraries(dependency,
+ filter: (uri) => !excluded.contains(uri));
+ }
+
+ await dillTarget.buildOutlines();
+
+ var kernelTarget =
+ new KernelTarget(fs, false, dillTarget, uriTranslator);
+ sourceLoader = kernelTarget.loader;
+ options.inputs.forEach(kernelTarget.read);
+ Component summaryComponent =
+ await kernelTarget.buildOutlines(nameRoot: nameRoot);
+ List<int> summary = null;
+ if (buildSummary) {
+ if (options.verify) {
+ for (var error in verifyComponent(summaryComponent)) {
+ options.report(error, Severity.error);
+ }
+ }
+ if (options.debugDump) {
+ printComponentText(summaryComponent,
+ libraryFilter: kernelTarget.isSourceLibrary);
+ }
+
+ // Copy the component to exclude the uriToSource map from the summary.
+ //
+ // Note: we don't pass the library argument to the constructor to
+ // preserve the the libraries parent pointer (it should continue to point
+ // to the component within KernelTarget).
+ var trimmedSummaryComponent =
+ new Component(nameRoot: summaryComponent.root)
+ ..libraries.addAll(truncateSummary
+ ? kernelTarget.loader.libraries
+ : summaryComponent.libraries);
+ trimmedSummaryComponent.metadata.addAll(summaryComponent.metadata);
+
+ // As documented, we only run outline transformations when we are building
+ // summaries without building a full component (at this time, that's
+ // the only need we have for these transformations).
+ if (!buildComponent) {
+ options.target
+ .performOutlineTransformations(trimmedSummaryComponent);
+ options.ticker.logMs("Transformed outline");
+ }
+ summary = serializeComponent(trimmedSummaryComponent);
+ options.ticker.logMs("Generated outline");
+ }
+
+ Component component;
+ if (buildComponent && kernelTarget.errors.isEmpty) {
+ component = await kernelTarget.buildComponent(verify: options.verify);
+ if (options.debugDump) {
+ printComponentText(component,
+ libraryFilter: kernelTarget.isSourceLibrary);
+ }
+ options.ticker.logMs("Generated component");
+ }
+
+ return new CompilerResult(
+ summary: summary,
+ component: component,
+ deps: new List<Uri>.from(CompilerContext.current.dependencies));
+ },
+ () => sourceLoader?.currentUriForCrashReporting ?? options.inputs.first,
+ onInputError: (LocatedMessage message) {
+ options.report(message, Severity.error);
+ return null;
+ });
}
/// Result object of [generateKernel].
diff --git a/pkg/front_end/messages.status b/pkg/front_end/messages.status
index c811a73..fca60694 100644
--- a/pkg/front_end/messages.status
+++ b/pkg/front_end/messages.status
@@ -6,7 +6,6 @@
AbstractClassInstantiation/example: Fail
AbstractClassMember/script5: Fail
AbstractClassMember/script6: Fail
-AbstractNotSync/analyzerCode: Fail
AbstractNotSync/example: Fail
AbstractRedirectedClassInstantiation/analyzerCode: Fail
AbstractRedirectedClassInstantiation/example: Fail
@@ -21,7 +20,6 @@
AssertExtraneousArgument/example: Fail
AsyncAsIdentifier/example: Fail
AwaitAsIdentifier/example: Fail
-AwaitNotAsync/analyzerCode: Fail
AwaitNotAsync/example: Fail
BreakOutsideOfLoop/script1: Fail
BuiltInIdentifierAsType/example: Fail
@@ -35,9 +33,8 @@
CantInferPackagesFromManyInputs/example: Fail
CantInferPackagesFromPackageUri/analyzerCode: Fail
CantInferPackagesFromPackageUri/example: Fail
-CantInferTypeDueToCircularity/analyzerCode: Fail
+CantInferTypeDueToCircularity/dart2jsCode: Fail
CantInferTypeDueToCircularity/example: Fail
-CantInferTypeDueToInconsistentOverrides/analyzerCode: Fail
CantInferTypeDueToInconsistentOverrides/example: Fail
CantUseSuperBoundedTypeForInstanceCreation/analyzerCode: Fail
CantUseSuperBoundedTypeForInstanceCreation/example: Fail
@@ -60,7 +57,6 @@
ConstAndCovariant/script2: Fail
ConstAndFinal/script1: Fail
ConstAndVar/script1: Fail
-ConstConstructorNonFinalField/analyzerCode: Fail
ConstConstructorNonFinalField/example: Fail
ConstEvalContext/analyzerCode: Fail # This is just used for displaying the context.
ConstEvalContext/example: Fail # This is just used for displaying the context.
@@ -90,7 +86,6 @@
ConstFieldWithoutInitializer/example: Fail
ConstructorNotFound/analyzerCode: Fail
ConstructorNotFound/example: Fail
-ConstructorWithTypeParameters/analyzerCode: Fail # No corresponding analyzer message
ContinueOutsideOfLoop/script1: Fail
ContinueWithoutLabelInCase/script1: Fail
CouldNotParseUri/analyzerCode: Fail
@@ -103,11 +98,9 @@
CovariantMember/script2: Fail
CyclicClassHierarchy/analyzerCode: Fail
CyclicClassHierarchy/example: Fail
-CyclicTypedef/analyzerCode: Fail
CyclicTypedef/example: Fail
DeclaredMemberConflictsWithInheritedMember/analyzerCode: Fail
DeferredAfterPrefix/example: Fail
-DeferredPrefixDuplicated/analyzerCode: Fail
DeferredPrefixDuplicated/example: Fail
DeferredTypeAnnotation/example: Fail
DillOutlineSummary/analyzerCode: Fail
@@ -120,11 +113,8 @@
DuplicatedDefinition/example: Fail
DuplicatedExportInType/analyzerCode: Fail
DuplicatedExportInType/example: Fail
-DuplicatedImportInType/analyzerCode: Fail
DuplicatedModifier/script1: Fail
-DuplicatedName/analyzerCode: Fail
DuplicatedName/example: Fail
-DuplicatedParameterName/analyzerCode: Fail
DuplicatedParameterName/example: Fail
Encoding/analyzerCode: Fail
EnumConstantSameNameAsEnclosing/analyzerCode: Fail
@@ -176,7 +166,6 @@
ExtraneousModifier/script7: Fail
ExtraneousModifier/script8: Fail
ExtraneousModifier/script9: Fail
-FactoryNotSync/analyzerCode: Fail
FactoryNotSync/example: Fail
FastaCLIArgumentRequired/analyzerCode: Fail
FastaCLIArgumentRequired/example: Fail
@@ -196,7 +185,7 @@
FunctionTypeDefaultValue/example: Fail
FunctionTypedParameterVar/script1: Fail
GeneratorReturnsValue/example: Fail
-GetterNotFound/analyzerCode: Fail
+GetterNotFound/dart2jsCode: Fail
GetterNotFound/example: Fail
GetterWithFormals/example: Fail
IllegalAssignmentToNonAssignable/script1: Fail
@@ -206,15 +195,12 @@
IllegalMixinDueToConstructors/example: Fail
ImplementsBeforeExtends/script: Fail
ImplementsBeforeWith/script: Fail
-ImplicitCallOfNonMethod/analyzerCode: Fail
ImplicitCallOfNonMethod/example: Fail
ImportAfterPart/script1: Fail
InheritedMembersConflict/analyzerCode: Fail
InputFileNotFound/analyzerCode: Fail
InputFileNotFound/example: Fail
IntegerLiteralIsOutOfRange/example: Fail
-InternalVerificationError/analyzerCode: Fail
-InternalVerificationError/example: Fail
InterpolationInUri/example: Fail
InvalidCastFunctionExpr/example: Fail
InvalidCastLiteralList/example: Fail
@@ -243,7 +229,7 @@
MemberWithSameNameAsClass/example: Fail
MetadataTypeArguments/analyzerCode: Fail
MetadataTypeArguments/example: Fail
-MethodNotFound/analyzerCode: Fail
+MethodNotFound/dart2jsCode: Fail
MethodNotFound/example: Fail
MissingAssignableSelector/script1: Fail
MissingAssignmentInInitializer/script1: Fail
@@ -251,7 +237,7 @@
MissingInput/example: Fail
MissingMain/analyzerCode: Fail
MissingMain/example: Fail
-MissingPartOf/analyzerCode: Fail
+MissingPartOf/dart2jsCode: Fail
MissingPrefixInDeferredImport/example: Fail
MixinInferenceNoMatchingClass/analyzerCode: Fail
MixinInferenceNoMatchingClass/example: Fail
@@ -262,7 +248,6 @@
NamedFunctionExpression/example: Fail
NativeClauseShouldBeAnnotation/example: Fail
NoFormals/example: Fail
-NoSuchNamedParameter/analyzerCode: Fail
NoSuchNamedParameter/example: Fail
NoUnnamedConstructorInObject/analyzerCode: Fail
NoUnnamedConstructorInObject/example: Fail
@@ -274,23 +259,18 @@
NotAType/example: Fail
NotAnLvalue/analyzerCode: Fail
NotAnLvalue/example: Fail
-OperatorMinusParameterMismatch/analyzerCode: Fail
OperatorMinusParameterMismatch/example: Fail
OperatorParameterMismatch0/analyzerCode: Fail
OperatorParameterMismatch0/example: Fail
-OperatorParameterMismatch1/analyzerCode: Fail
OperatorParameterMismatch1/example: Fail
-OperatorParameterMismatch2/analyzerCode: Fail
OperatorParameterMismatch2/example: Fail
OperatorWithOptionalFormals/analyzerCode: Fail
OperatorWithOptionalFormals/example: Fail
OverrideFewerNamedArguments/analyzerCode: Fail
OverrideFewerNamedArguments/example: Fail
-OverrideFewerPositionalArguments/analyzerCode: Fail
OverrideFewerPositionalArguments/example: Fail
OverrideMismatchNamedParameter/analyzerCode: Fail
OverrideMismatchNamedParameter/example: Fail
-OverrideMoreRequiredArguments/analyzerCode: Fail
OverrideMoreRequiredArguments/example: Fail
OverrideTypeMismatchParameter/example: Fail
OverrideTypeMismatchReturnType/example: Fail
@@ -298,15 +278,15 @@
OverrideTypeVariablesMismatch/example: Fail
PackageNotFound/analyzerCode: Fail
PackageNotFound/example: Fail
-PartOfLibraryNameMismatch/analyzerCode: Fail
+PartOfLibraryNameMismatch/dart2jsCode: Fail
PartOfLibraryNameMismatch/example: Fail
-PartOfSelf/analyzerCode: Fail
+PartOfSelf/dart2jsCode: Fail
PartOfTwoLibraries/analyzerCode: Fail # Issue 33227
-PartOfUriMismatch/analyzerCode: Fail
+PartOfUriMismatch/dart2jsCode: Fail
PartOfUriMismatch/example: Fail
-PartOfUseUri/analyzerCode: Fail
+PartOfUseUri/dart2jsCode: Fail
PartOfUseUri/example: Fail
-PartTwice/analyzerCode: Fail
+PartTwice/dart2jsCode: Fail
PatchClassTypeVariablesMismatch/analyzerCode: Fail
PatchClassTypeVariablesMismatch/example: Fail
PatchDeclarationMismatch/analyzerCode: Fail
@@ -335,7 +315,7 @@
SdkSpecificationNotFound/example: Fail
SdkSummaryNotFound/analyzerCode: Fail
SdkSummaryNotFound/example: Fail
-SetterNotFound/analyzerCode: Fail
+SetterNotFound/dart2jsCode: Fail
SetterNotFound/example: Fail
SetterNotSync/example: Fail
SetterWithWrongNumberOfFormals/example: Fail
@@ -351,10 +331,10 @@
SuperAsIdentifier/example: Fail
SuperNullAware/example: Fail
SuperclassHasNoDefaultConstructor/example: Fail
-SuperclassHasNoGetter/analyzerCode: Fail
+SuperclassHasNoGetter/dart2jsCode: Fail
SuperclassHasNoGetter/example: Fail
SuperclassHasNoMethod/example: Fail
-SuperclassHasNoSetter/analyzerCode: Fail
+SuperclassHasNoSetter/dart2jsCode: Fail
SuperclassHasNoSetter/example: Fail
SuperclassMethodArgumentMismatch/analyzerCode: Fail
SuperclassMethodArgumentMismatch/example: Fail
@@ -364,21 +344,17 @@
SupertypeIsIllegal/example: Fail
SupertypeIsTypeVariable/analyzerCode: Fail
SupertypeIsTypeVariable/example: Fail
-SwitchCaseFallThrough/analyzerCode: Fail
SwitchCaseFallThrough/example: Fail
ThisAccessInFieldInitializer/analyzerCode: Fail
ThisAccessInFieldInitializer/example: Fail
ThisAsIdentifier/analyzerCode: Fail
ThisAsIdentifier/example: Fail
-TooFewArguments/analyzerCode: Fail
TooFewArguments/example: Fail
-TooManyArguments/analyzerCode: Fail
TooManyArguments/example: Fail
TopLevelOperator/script1: Fail
TopLevelOperator/script2: Fail
TopLevelOperator/script3: Fail
TypeAfterVar/example: Fail
-TypeArgumentMismatch/analyzerCode: Fail
TypeArgumentMismatch/example: Fail
TypeArgumentsOnTypeVariable/script1: Fail
TypeNotFound/analyzerCode: Fail
diff --git a/pkg/front_end/messages.yaml b/pkg/front_end/messages.yaml
index e51c39a..fd44372 100644
--- a/pkg/front_end/messages.yaml
+++ b/pkg/front_end/messages.yaml
@@ -909,6 +909,7 @@
AbstractNotSync:
template: "Abstract methods can't use 'async', 'async*', or 'sync*'."
+ analyzerCode: NON_SYNC_ABSTRACT_METHOD
dart2jsCode: "*ignored*"
AsyncAsIdentifier:
@@ -923,6 +924,7 @@
AwaitNotAsync:
template: "'await' can only be used in 'async' or 'async*' methods."
+ analyzerCode: AWAIT_IN_WRONG_CONTEXT
dart2jsCode: "*ignored*"
BuiltInIdentifierAsType:
@@ -948,6 +950,7 @@
FactoryNotSync:
template: "Factories can't use 'async', 'async*', or 'sync*'."
+ analyzerCode: NON_SYNC_FACTORY_METHOD
dart2jsCode: "*ignored*"
GeneratorReturnsValue:
@@ -1076,6 +1079,8 @@
ConstructorWithTypeParameters:
template: "Constructors can't have type parameters."
severity: ERROR
+ analyzerCode: TYPE_PARAMETER_ON_CONSTRUCTOR
+ dart2jsCode: "*fatal*"
script:
- "class C { C<T>() {} }"
- "class C { C.foo<T>() {} }"
@@ -1096,6 +1101,15 @@
template: "The name of the enclosing class is '#name'."
severity: CONTEXT
+ConstructorCyclic:
+ template: "Redirecting constructers can't be cyclic."
+ tip: "Try to have all constructors eventually redirect to a non-redirecting constructor."
+ severity: ERROR
+ analyzerCode: RECURSIVE_CONSTRUCTOR_REDIRECT
+ dart2jsCode: "*fatal*"
+ script:
+ - "class C { C.foo() : this.bar(); C.bar() : this.foo(); }"
+
FieldInitializerOutsideConstructor:
template: "Field formal parameters can only be used in a constructor."
tip: "Try removing 'this.'."
@@ -1110,6 +1124,8 @@
CyclicTypedef:
template: "The typedef '#name' has a reference to itself."
+ analyzerCode: TYPE_ALIAS_CANNOT_REFERENCE_ITSELF
+ dart2jsCode: "*fatal*"
TypeNotFound:
template: "Type '#name' not found."
@@ -1121,14 +1137,17 @@
GetterNotFound:
template: "Getter not found: '#name'."
+ analyzerCode: UNDEFINED_GETTER
severity: ERROR_LEGACY_WARNING
SetterNotFound:
template: "Setter not found: '#name'."
+ analyzerCode: UNDEFINED_SETTER
severity: ERROR_LEGACY_WARNING
MethodNotFound:
template: "Method not found: '#name'."
+ analyzerCode: UNDEFINED_METHOD
severity: ERROR_LEGACY_WARNING
CandidateFound:
@@ -1142,14 +1161,20 @@
TooFewArguments:
template: "Too few positional arguments: #count required, #count2 given."
severity: ERROR_LEGACY_WARNING
+ analyzerCode: NOT_ENOUGH_REQUIRED_ARGUMENTS
+ dart2jsCode: "*fatal*"
TooManyArguments:
template: "Too many positional arguments: #count allowed, #count2 given."
severity: ERROR_LEGACY_WARNING
+ analyzerCode: EXTRA_POSITIONAL_ARGUMENTS
+ dart2jsCode: "*fatal*"
NoSuchNamedParameter:
template: "No named parameter with the name '#name'."
severity: ERROR_LEGACY_WARNING
+ analyzerCode: UNDEFINED_NAMED_PARAMETER
+ dart2jsCode: "*fatal*"
AbstractClassInstantiation:
template: "The class '#name' is abstract and can't be instantiated."
@@ -1199,6 +1224,8 @@
TypeArgumentMismatch:
template: "'#name' expects #count type arguments."
severity: ERROR_LEGACY_WARNING
+ analyzerCode: WRONG_NUMBER_OF_TYPE_ARGUMENTS
+ dart2jsCode: "*fatal*"
NotAType:
template: "'#name' isn't a type."
@@ -1207,13 +1234,13 @@
dart2jsCode: "*ignored*"
NotAPrefixInTypeAnnotation:
- template: "'#name.#name2' can't be used as a type because '#name' doesn't refer to an import prefix."
+ template: "'#lexeme.#lexeme2' can't be used as a type because '#lexeme' doesn't refer to an import prefix."
severity: ERROR_LEGACY_WARNING
analyzerCode: NOT_A_TYPE
dart2jsCode: "*ignored*"
UnresolvedPrefixInTypeAnnotation:
- template: "'#name.#name2' can't be used as a type because '#name' isn't defined."
+ template: "'#lexeme.#lexeme2' can't be used as a type because '#lexeme' isn't defined."
severity: ERROR_LEGACY_WARNING
analyzerCode: NOT_A_TYPE
dart2jsCode: "*ignored*"
@@ -1375,14 +1402,14 @@
template: "Non-context message has context severity: #string"
severity: INTERNAL_PROBLEM
-InternalVerificationError:
+InternalProblemVerificationError:
template: |
Verification of the generated program failed:
#string
+ severity: INTERNAL_PROBLEM
-InternalVisitorUnsupportedDefault:
- template: "Trying to invoke a default visiting method of a visitor on a node #string."
- tip: "Try invoking one of the specialized 'visit' methods instead."
+InternalProblemDebugAbort:
+ template: "Compilation aborted due to fatal '#name' at:\n#string"
severity: INTERNAL_PROBLEM
LocalDefinitionHidesExport:
@@ -1455,6 +1482,8 @@
DuplicatedImportInType:
template: "'#name' is imported from both '#uri' and '#uri2'."
severity: ERROR_LEGACY_WARNING
+ analyzerCode: AMBIGUOUS_IMPORT
+ dart2jsCode: "*fatal*"
script:
lib1.dart: "class A {}"
lib2.dart: "class A {}"
@@ -1609,10 +1638,14 @@
OverrideFewerPositionalArguments:
template: "The method '#name' has fewer positional arguments than those of overridden method '#name2'."
severity: ERROR_LEGACY_WARNING
+ analyzerCode: INVALID_OVERRIDE_POSITIONAL
+ dart2jsCode: "*fatal*"
OverrideMoreRequiredArguments:
template: "The method '#name' has more required arguments than those of overridden method '#name2'."
severity: ERROR_LEGACY_WARNING
+ analyzerCode: INVALID_OVERRIDE_REQUIRED
+ dart2jsCode: "*fatal*"
OverrideTypeMismatchParameter:
template: "The parameter '#name' of the method '#name2' has type #type, which does not match the corresponding type in the overridden method (#type2)."
@@ -1628,6 +1661,7 @@
PartOfSelf:
template: "A file can't be a part of itself."
+ analyzerCode: PART_OF_NON_PART
script:
main.dart: "part 'main.dart';"
@@ -1754,6 +1788,7 @@
PartTwice:
template: "Can't use '#uri' as a part more than once."
+ analyzerCode: DUPLICATE_PART
script:
part.dart: "part of 'main.dart';"
main.dart: "part 'part.dart'; part 'part.dart';"
@@ -1823,6 +1858,7 @@
MissingPartOf:
template: "Can't use '#uri' as a part, because it has no 'part of' declaration."
+ analyzerCode: PART_OF_NON_PART
script:
part.dart: ""
main.dart: "part 'part.dart';"
@@ -1832,6 +1868,8 @@
DeferredPrefixDuplicated:
template: "Can't use the name '#name' for a deferred library, as the name is used elsewhere."
+ analyzerCode: SHARED_DEFERRED_PREFIX
+ dart2jsCode: "*fatal*"
DeferredPrefixDuplicatedCause:
template: "'#name' is used here."
@@ -1852,6 +1890,8 @@
DuplicatedName:
template: "'#name' is already declared in this scope."
severity: ERROR
+ analyzerCode: DUPLICATE_DEFINITION
+ dart2jsCode: "*fatal*"
DuplicatedNameCause:
template: "Previous declaration of '#name'."
@@ -1867,10 +1907,13 @@
DuplicatedNamePreviouslyUsedCause:
template: "Previous use of '#name'."
+ analyzerCode: REFERENCED_BEFORE_DECLARATION
severity: CONTEXT
DuplicatedParameterName:
template: "Duplicated parameter name '#name'."
+ analyzerCode: DUPLICATE_DEFINITION
+ dart2jsCode: "*fatal*"
DuplicatedParameterNameCause:
template: "Other parameter named '#name'."
@@ -1902,15 +1945,21 @@
OperatorParameterMismatch1:
template: "Operator '#name' should have exactly one parameter."
+ analyzerCode: WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR
+ dart2jsCode: "*fatal*"
OperatorParameterMismatch2:
template: "Operator '#name' should have exactly two parameters."
+ analyzerCode: WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR
+ dart2jsCode: "*fatal*"
OperatorMinusParameterMismatch:
template: "Operator '#name' should have zero or one parameter."
tip: >-
With zero parameters, it has the syntactic form '-a', formally known as 'unary-'.
With one parameter, it has the syntactic form 'a - b', formally known as '-'.
+ analyzerCode: WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR_MINUS
+ dart2jsCode: "*fatal*"
SupertypeIsIllegal:
template: "The type '#name' can't be used as supertype."
@@ -1920,15 +1969,18 @@
PartOfLibraryNameMismatch:
template: "Using '#uri' as part of '#name' but its 'part of' declaration says '#name2'."
+ analyzerCode: PART_OF_DIFFERENT_LIBRARY
severity: ERROR_LEGACY_WARNING
PartOfUseUri:
template: "Using '#uri' as part of '#uri2' but its 'part of' declaration says '#name'."
tip: "Try changing the 'part of' declaration to use a relative file name."
+ analyzerCode: PART_OF_UNNAMED_LIBRARY
severity: ERROR_LEGACY_WARNING
PartOfUriMismatch:
template: "Using '#uri' as part of '#uri2' but its 'part of' declaration says '#uri3'."
+ analyzerCode: PART_OF_DIFFERENT_LIBRARY
severity: ERROR_LEGACY_WARNING
MissingMain:
@@ -1984,6 +2036,8 @@
SwitchCaseFallThrough:
template: "Switch case may fall through to the next case."
severity: ERROR_LEGACY_WARNING
+ analyzerCode: CASE_BLOCK_NOT_TERMINATED
+ dart2jsCode: "*fatal*"
FinalInstanceVariableAlreadyInitialized:
template: "'#name' is a final instance variable that has already been initialized."
@@ -2003,10 +2057,12 @@
SuperclassHasNoGetter:
template: "Superclass has no getter named '#name'."
+ analyzerCode: UNDEFINED_SUPER_GETTER
severity: ERROR_LEGACY_WARNING
SuperclassHasNoSetter:
template: "Superclass has no setter named '#name'."
+ analyzerCode: ABSTRACT_SUPER_MEMBER_REFERENCE
severity: ERROR_LEGACY_WARNING
SuperclassHasNoMethod:
@@ -2022,6 +2078,8 @@
ConstConstructorNonFinalField:
template: "Constructor is marked 'const' so all fields must be final."
+ analyzerCode: CONST_CONSTRUCTOR_WITH_NON_FINAL_FIELD
+ dart2jsCode: "*fatal*"
ConstConstructorNonFinalFieldCause:
template: "Field isn't final, but constructor is 'const'."
@@ -2255,10 +2313,14 @@
CantInferTypeDueToInconsistentOverrides:
template: "Can't infer the type of '#string': overridden members must all have the same type."
tip: "Specify the type explicitly."
+ severity: ERROR
+ analyzerCode: INVALID_METHOD_OVERRIDE
+ dart2jsCode: "*fatal*"
CantInferTypeDueToCircularity:
template: "Can't infer the type of '#string': circularity found during type inference."
tip: "Specify the type explicitly."
+ analyzerCode: RECURSIVE_COMPILE_TIME_CONSTANT
severity: ERROR
AmbiguousSupertypes:
@@ -2277,9 +2339,11 @@
severity: ERROR
ImplicitCallOfNonMethod:
- template: "Can't invoke the type '#type' because its declaration of `.call` is not a method."
- tip: "Change .call to a method or explicitly invoke .call."
+ template: "Cannot invoke an instance of '#type' because it declares 'call' to be something other than a method."
+ tip: "Try changing 'call' to a method or explicitly invoke 'call'."
severity: ERROR
+ analyzerCode: IMPLICIT_CALL_OF_NON_METHOD
+ dart2jsCode: "*fatal*"
ExpectedOneExpression:
template: "Expected one expression, but found additional input."
@@ -2289,12 +2353,6 @@
template: "Can't assign to this, so it can't be used in a for-in loop."
severity: ERROR
statement: "for (1 in []) {}"
- script: |
- import "dart:core" as prefix;
-
- main() {
- for (prefix in []) {}
- }
ForInLoopExactlyOneVariable:
template: "A for-in loop can't have more than one loop variable."
@@ -2347,7 +2405,7 @@
template: "Generic type '#name' can't be used without type arguments in a type variable bound."
tip: "Try providing type arguments to '#name' here."
severity: ERROR
- analyzerCode: STRONG_MODE_NOT_INSTANTIATED_BOUND
+ analyzerCode: SNOT_INSTANTIATED_BOUND
dart2jsCode: "*fatal*"
script: >
class Hest<X extends Hest<X>> {}
@@ -2361,7 +2419,7 @@
template: "Generic type '#name' can't be used without type arguments in the bounds of its own type variables."
tip: "Try providing type arguments to '#name' here."
severity: ERROR
- analyzerCode: STRONG_MODE_NOT_INSTANTIATED_BOUND
+ analyzerCode: NOT_INSTANTIATED_BOUND
dart2jsCode: "*fatal*"
script: >
class Hest<X extends Hest> {}
@@ -2370,7 +2428,7 @@
template: "Generic type '#name' can't be used without type arguments in the bounds of its own type variables. It is referenced indirectly through '#name2'."
tip: "Try providing type arguments to '#name2' here or to some other raw types in the bounds along the reference chain."
severity: ERROR
- analyzerCode: STRONG_MODE_NOT_INSTANTIATED_BOUND
+ analyzerCode: NOT_INSTANTIATED_BOUND
dart2jsCode: "*fatal*"
script: >
class Hest<X extends Fisk> {}
@@ -2379,3 +2437,45 @@
NonSimpleBoundViaReference:
template: "Bound of this variable references raw type '#name'."
severity: CONTEXT
+
+CantUsePrefixAsExpression:
+ template: "A prefix can't be used as an expression."
+ severity: ERROR
+ analyzerCode: PREFIX_IDENTIFIER_NOT_FOLLOWED_BY_DOT
+ dart2jsCode: "*fatal*"
+ script: |
+ import "dart:core" as prefix;
+
+ main() {
+ for (prefix in []) {}
+ }
+
+CantUsePrefixWithNullAware:
+ template: "A prefix can't be used with null-aware operators."
+ tip: "It should be safe to remove the '?' as a prefix is never null."
+ severity: ERROR
+ analyzerCode: PREFIX_IDENTIFIER_NOT_FOLLOWED_BY_DOT
+ dart2jsCode: "*fatal*"
+ script: |
+ import "dart:core" as prefix;
+
+ main() {
+ prefix?.Object;
+ }
+
+CantUseDeferredPrefixAsConstant:
+ template: >
+ '#lexeme' can't be used in a constant expression because it's marked as
+ 'deferred' which means it isn't available until loaded.
+ tip: >
+ Try moving the constant from the deferred library, or removing 'deferred'
+ from the import.
+ analyzerCode: CONST_DEFERRED_CLASS
+ dart2jsCode: "*fatal*"
+ severity: ERROR
+ script: |
+ import "dart:core" deferred as prefix;
+
+ main() {
+ const prefix.Object();
+ }
diff --git a/pkg/front_end/test/fasta/generator_to_string_test.dart b/pkg/front_end/test/fasta/generator_to_string_test.dart
index 84af3a4..3ba613b 100644
--- a/pkg/front_end/test/fasta/generator_to_string_test.dart
+++ b/pkg/front_end/test/fasta/generator_to_string_test.dart
@@ -62,6 +62,7 @@
KernelLargeIntAccessGenerator,
KernelLoadLibraryGenerator,
KernelNullAwarePropertyAccessGenerator,
+ KernelPrefixUseGenerator,
KernelPropertyAccessGenerator,
KernelReadOnlyAccessGenerator,
KernelStaticAccessGenerator,
@@ -70,6 +71,7 @@
KernelThisIndexedAccessGenerator,
KernelThisPropertyAccessGenerator,
KernelTypeUseGenerator,
+ KernelUnexpectedQualifiedUseGenerator,
KernelUnlinkedGenerator,
KernelUnresolvedNameGenerator,
KernelVariableUseGenerator,
@@ -135,6 +137,9 @@
library.addProcedure(setter);
cls.addMember(interfaceTarget);
+ KernelPrefixUseGenerator prefixUseGenerator =
+ new KernelPrefixUseGenerator(helper, token, prefixBuilder);
+
check(
"DelayedAssignment(offset: 4, value: expression,"
" assignmentOperator: +=)",
@@ -207,11 +212,12 @@
new IncompletePropertyAccessGenerator(helper, token, name));
check(
"DeferredAccessGenerator(offset: 4,"
- " builder: Instance of 'PrefixBuilder',"
- " generator: ThisAccessGenerator(offset: 4, isInitializer: false,"
+ " prefixGenerator: PrefixUseGenerator("
+ "offset: 4, prefix: myPrefix, deferred: false),"
+ " suffixGenerator: ThisAccessGenerator(offset: 4, isInitializer: false,"
" isSuper: false))",
new KernelDeferredAccessGenerator(
- helper, token, prefixBuilder, generator));
+ helper, token, prefixUseGenerator, generator));
check(
"ReadOnlyAccessGenerator(offset: 4, expression: expression,"
" plainNameForRead: foo, value: null)",
@@ -225,13 +231,19 @@
check(
"TypeUseGenerator(offset: 4, expression: T,"
" plainNameForRead: foo, value: null)",
- new KernelTypeUseGenerator(
- helper, token, prefixBuilder, -1, declaration, "foo"));
+ new KernelTypeUseGenerator(helper, token, declaration, "foo"));
check("UnresolvedNameGenerator(offset: 4, name: bar)",
new KernelUnresolvedNameGenerator(helper, token, name));
check(
"UnlinkedGenerator(offset: 4, name: foo)",
new KernelUnlinkedGenerator(
helper, token, new UnlinkedDeclaration("foo", false, -1, null)));
+ check("PrefixUseGenerator(offset: 4, prefix: myPrefix, deferred: false)",
+ prefixUseGenerator);
+ check(
+ "UnexpectedQualifiedUseGenerator("
+ "offset: 4, prefixGenerator: , isInitializer: false, isSuper: false)",
+ new KernelUnexpectedQualifiedUseGenerator(
+ helper, token, generator, false));
});
}
diff --git a/pkg/front_end/test/fasta/testing/suite.dart b/pkg/front_end/test/fasta/testing/suite.dart
index b18da2a..23d0dba 100644
--- a/pkg/front_end/test/fasta/testing/suite.dart
+++ b/pkg/front_end/test/fasta/testing/suite.dart
@@ -304,7 +304,7 @@
}
}
} on deprecated_InputError catch (e, s) {
- return fail(null, e.error, s);
+ return fail(null, e.message.message, s);
}
context.componentToTarget.clear();
context.componentToTarget[p] = sourceTarget;
diff --git a/pkg/front_end/test/kernel_generator_test.dart b/pkg/front_end/test/kernel_generator_test.dart
index 2ad6012..083c293 100644
--- a/pkg/front_end/test/kernel_generator_test.dart
+++ b/pkg/front_end/test/kernel_generator_test.dart
@@ -7,7 +7,6 @@
import 'package:test/test.dart'
show
- contains,
expect,
greaterThan,
group,
@@ -23,9 +22,6 @@
import 'package:front_end/src/api_prototype/front_end.dart'
show CompilerOptions;
-import 'package:front_end/src/fasta/deprecated_problems.dart'
- show deprecated_InputError;
-
import 'package:front_end/src/fasta/fasta_codes.dart' show messageMissingMain;
import 'package:front_end/src/fasta/kernel/utils.dart' show serializeComponent;
@@ -91,22 +87,6 @@
expect(errors.first.message, messageMissingMain.message);
});
- // TODO(ahe): This test is wrong at least with respect to expecting that
- // [deprecated_InputError] leaks through the API. Furthermore, the default
- // behavior should be to recover from errors, as this is the most important
- // use case we have.
- test('default error handler throws on errors', () async {
- var options = new CompilerOptions();
- var exceptionThrown = false;
- try {
- await compileScript('a() => print("hi");', options: options);
- } on deprecated_InputError catch (e) {
- exceptionThrown = true;
- expect('${e.error}', contains("Compilation aborted"));
- }
- expect(exceptionThrown, isTrue);
- }, skip: true /* Issue 30194 */);
-
test('generated program contains source-info', () async {
var component = await compileScript('a() => print("hi"); main() {}',
fileName: 'a.dart');
diff --git a/pkg/front_end/testcases/async_function.dart.direct.transformed.expect b/pkg/front_end/testcases/async_function.dart.direct.transformed.expect
index 86b5197..84eea28 100644
--- a/pkg/front_end/testcases/async_function.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/async_function.dart.direct.transformed.expect
@@ -19,7 +19,7 @@
:return_value = "foo";
break #L1;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
@@ -46,7 +46,7 @@
:return_value = self::asyncString();
break #L2;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
@@ -185,7 +185,7 @@
[yield] let dynamic #t2 = asy::_awaitHelper(self::asyncString(), :async_op_then, :async_op_error, :async_op) in null;
core::String str = :result;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
diff --git a/pkg/front_end/testcases/await.dart.direct.transformed.expect b/pkg/front_end/testcases/await.dart.direct.transformed.expect
index c0f0f71..7693f8c 100644
--- a/pkg/front_end/testcases/await.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/await.dart.direct.transformed.expect
@@ -19,7 +19,7 @@
[yield] let dynamic #t1 = asy::_awaitHelper("Hello, World!", :async_op_then, :async_op_error, :async_op) in null;
core::print(:result);
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
diff --git a/pkg/front_end/testcases/bug32866.dart b/pkg/front_end/testcases/bug32866.dart
new file mode 100644
index 0000000..4c97c86
--- /dev/null
+++ b/pkg/front_end/testcases/bug32866.dart
@@ -0,0 +1,18 @@
+// Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+// Regression test that top-level inference correctly handles dependencies from
+// top-level field -> initializing formal -> field that overrides a getter.
+
+abstract class B {
+ String get f;
+}
+
+class A implements B {
+ final f;
+ A(this.f);
+}
+
+var a = new A("foo");
+main() => print(a);
diff --git a/pkg/front_end/testcases/bug32866.dart.direct.expect b/pkg/front_end/testcases/bug32866.dart.direct.expect
new file mode 100644
index 0000000..0e88c2a
--- /dev/null
+++ b/pkg/front_end/testcases/bug32866.dart.direct.expect
@@ -0,0 +1,19 @@
+library;
+import self as self;
+import "dart:core" as core;
+
+abstract class B extends core::Object {
+ synthetic constructor •() → void
+ : super core::Object::•()
+ ;
+ abstract get f() → core::String;
+}
+class A extends core::Object implements self::B {
+ final field dynamic f;
+ constructor •(dynamic f) → void
+ : self::A::f = f, super core::Object::•()
+ ;
+}
+static field dynamic a = new self::A::•("foo");
+static method main() → dynamic
+ return core::print(self::a);
diff --git a/pkg/front_end/testcases/bug32866.dart.direct.transformed.expect b/pkg/front_end/testcases/bug32866.dart.direct.transformed.expect
new file mode 100644
index 0000000..0e88c2a
--- /dev/null
+++ b/pkg/front_end/testcases/bug32866.dart.direct.transformed.expect
@@ -0,0 +1,19 @@
+library;
+import self as self;
+import "dart:core" as core;
+
+abstract class B extends core::Object {
+ synthetic constructor •() → void
+ : super core::Object::•()
+ ;
+ abstract get f() → core::String;
+}
+class A extends core::Object implements self::B {
+ final field dynamic f;
+ constructor •(dynamic f) → void
+ : self::A::f = f, super core::Object::•()
+ ;
+}
+static field dynamic a = new self::A::•("foo");
+static method main() → dynamic
+ return core::print(self::a);
diff --git a/pkg/front_end/testcases/bug32866.dart.outline.expect b/pkg/front_end/testcases/bug32866.dart.outline.expect
new file mode 100644
index 0000000..f524935
--- /dev/null
+++ b/pkg/front_end/testcases/bug32866.dart.outline.expect
@@ -0,0 +1,17 @@
+library;
+import self as self;
+import "dart:core" as core;
+
+abstract class B extends core::Object {
+ synthetic constructor •() → void
+ ;
+ abstract get f() → core::String;
+}
+class A extends core::Object implements self::B {
+ final field dynamic f;
+ constructor •(dynamic f) → void
+ ;
+}
+static field dynamic a;
+static method main() → dynamic
+ ;
diff --git a/pkg/front_end/testcases/bug32866.dart.strong.expect b/pkg/front_end/testcases/bug32866.dart.strong.expect
new file mode 100644
index 0000000..a8afb38
--- /dev/null
+++ b/pkg/front_end/testcases/bug32866.dart.strong.expect
@@ -0,0 +1,19 @@
+library;
+import self as self;
+import "dart:core" as core;
+
+abstract class B extends core::Object {
+ synthetic constructor •() → void
+ : super core::Object::•()
+ ;
+ abstract get f() → core::String;
+}
+class A extends core::Object implements self::B {
+ final field core::String f;
+ constructor •(core::String f) → void
+ : self::A::f = f, super core::Object::•()
+ ;
+}
+static field self::A a = new self::A::•("foo");
+static method main() → dynamic
+ return core::print(self::a);
diff --git a/pkg/front_end/testcases/bug32866.dart.strong.transformed.expect b/pkg/front_end/testcases/bug32866.dart.strong.transformed.expect
new file mode 100644
index 0000000..a8afb38
--- /dev/null
+++ b/pkg/front_end/testcases/bug32866.dart.strong.transformed.expect
@@ -0,0 +1,19 @@
+library;
+import self as self;
+import "dart:core" as core;
+
+abstract class B extends core::Object {
+ synthetic constructor •() → void
+ : super core::Object::•()
+ ;
+ abstract get f() → core::String;
+}
+class A extends core::Object implements self::B {
+ final field core::String f;
+ constructor •(core::String f) → void
+ : self::A::f = f, super core::Object::•()
+ ;
+}
+static field self::A a = new self::A::•("foo");
+static method main() → dynamic
+ return core::print(self::a);
diff --git a/pkg/front_end/testcases/bug33196.dart.direct.transformed.expect b/pkg/front_end/testcases/bug33196.dart.direct.transformed.expect
index 4fbc43e..cc0de23 100644
--- a/pkg/front_end/testcases/bug33196.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/bug33196.dart.direct.transformed.expect
@@ -22,7 +22,7 @@
:return_value = "oh no";
break #L1;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
diff --git a/pkg/front_end/testcases/bug33196.dart.strong.transformed.expect b/pkg/front_end/testcases/bug33196.dart.strong.transformed.expect
index 2a550b1..94661f3 100644
--- a/pkg/front_end/testcases/bug33196.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/bug33196.dart.strong.transformed.expect
@@ -22,7 +22,7 @@
:return_value = "oh no";
break #L1;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
diff --git a/pkg/front_end/testcases/bug33206.dart.direct.transformed.expect b/pkg/front_end/testcases/bug33206.dart.direct.transformed.expect
index 9d44bff..b5f9c88 100644
--- a/pkg/front_end/testcases/bug33206.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/bug33206.dart.direct.transformed.expect
@@ -33,7 +33,7 @@
:return_value = <dynamic>[1];
break #L1;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
@@ -62,7 +62,7 @@
:return_value = 3;
break #L2;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
@@ -95,7 +95,7 @@
:return_value = new self::X::•(#t1, :result);
break #L3;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
@@ -123,7 +123,7 @@
[yield] let dynamic #t6 = asy::_awaitHelper(self::foo(), :async_op_then, :async_op_error, :async_op) in null;
core::print(:result);
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
diff --git a/pkg/front_end/testcases/bug33206.dart.strong.transformed.expect b/pkg/front_end/testcases/bug33206.dart.strong.transformed.expect
index cf29898..072c2fe 100644
--- a/pkg/front_end/testcases/bug33206.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/bug33206.dart.strong.transformed.expect
@@ -33,7 +33,7 @@
:return_value = <core::Object>[1];
break #L1;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
@@ -62,7 +62,7 @@
:return_value = 3;
break #L2;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
@@ -95,7 +95,7 @@
:return_value = new self::X::•(#t1, :result);
break #L3;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
@@ -123,7 +123,7 @@
[yield] let dynamic #t6 = asy::_awaitHelper(self::foo(), :async_op_then, :async_op_error, :async_op) in null;
core::print(:result);
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
diff --git a/pkg/front_end/testcases/check_deferred_as_check.dart.strong.expect b/pkg/front_end/testcases/check_deferred_as_check.dart.strong.expect
index 142e594..00f87e5 100644
--- a/pkg/front_end/testcases/check_deferred_as_check.dart.strong.expect
+++ b/pkg/front_end/testcases/check_deferred_as_check.dart.strong.expect
@@ -4,7 +4,7 @@
static const field dynamic #errors = const <dynamic>["pkg/front_end/testcases/check_deferred_as_check.dart:9:8: Error: The type '#lib1::C' is deferred loaded via prefix 'lib' and can't be used as a type annotation.
Try removing 'deferred' from the import of 'lib' or use a supertype of '#lib1::C' that isn't deferred.
x as lib.C;
- ^^^"]/* from null */;
+ ^^^^^"]/* from null */;
static method main() → dynamic {}
static method test(dynamic x) → dynamic {
x as invalid-type;
diff --git a/pkg/front_end/testcases/check_deferred_as_check.dart.strong.transformed.expect b/pkg/front_end/testcases/check_deferred_as_check.dart.strong.transformed.expect
index 142e594..00f87e5 100644
--- a/pkg/front_end/testcases/check_deferred_as_check.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/check_deferred_as_check.dart.strong.transformed.expect
@@ -4,7 +4,7 @@
static const field dynamic #errors = const <dynamic>["pkg/front_end/testcases/check_deferred_as_check.dart:9:8: Error: The type '#lib1::C' is deferred loaded via prefix 'lib' and can't be used as a type annotation.
Try removing 'deferred' from the import of 'lib' or use a supertype of '#lib1::C' that isn't deferred.
x as lib.C;
- ^^^"]/* from null */;
+ ^^^^^"]/* from null */;
static method main() → dynamic {}
static method test(dynamic x) → dynamic {
x as invalid-type;
diff --git a/pkg/front_end/testcases/check_deferred_before_args2.dart.direct.transformed.expect b/pkg/front_end/testcases/check_deferred_before_args2.dart.direct.transformed.expect
index b8cd3f73..c4b209d 100644
--- a/pkg/front_end/testcases/check_deferred_before_args2.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/check_deferred_before_args2.dart.direct.transformed.expect
@@ -21,7 +21,7 @@
[yield] let dynamic #t2 = asy::_awaitHelper(LoadLibrary(lib), :async_op_then, :async_op_error, :async_op) in null;
def::m(:result);
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
diff --git a/pkg/front_end/testcases/check_deferred_before_args2.dart.strong.transformed.expect b/pkg/front_end/testcases/check_deferred_before_args2.dart.strong.transformed.expect
index 57fd263..8155d6a 100644
--- a/pkg/front_end/testcases/check_deferred_before_args2.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/check_deferred_before_args2.dart.strong.transformed.expect
@@ -22,7 +22,7 @@
[yield] let dynamic #t2 = asy::_awaitHelper(LoadLibrary(lib), :async_op_then, :async_op_error, :async_op) in null;
def::m(:result);
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
diff --git a/pkg/front_end/testcases/check_deferred_is_check.dart.strong.expect b/pkg/front_end/testcases/check_deferred_is_check.dart.strong.expect
index ef6d460..f8aa323 100644
--- a/pkg/front_end/testcases/check_deferred_is_check.dart.strong.expect
+++ b/pkg/front_end/testcases/check_deferred_is_check.dart.strong.expect
@@ -5,7 +5,7 @@
static const field dynamic #errors = const <dynamic>["pkg/front_end/testcases/check_deferred_is_check.dart:9:14: Error: The type '#lib1::C' is deferred loaded via prefix 'lib' and can't be used as a type annotation.
Try removing 'deferred' from the import of 'lib' or use a supertype of '#lib1::C' that isn't deferred.
print(x is lib.C);
- ^^^"]/* from null */;
+ ^^^^^"]/* from null */;
static method main() → dynamic {}
static method test(dynamic x) → dynamic {
core::print(x is invalid-type);
diff --git a/pkg/front_end/testcases/check_deferred_is_check.dart.strong.transformed.expect b/pkg/front_end/testcases/check_deferred_is_check.dart.strong.transformed.expect
index ef6d460..f8aa323 100644
--- a/pkg/front_end/testcases/check_deferred_is_check.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/check_deferred_is_check.dart.strong.transformed.expect
@@ -5,7 +5,7 @@
static const field dynamic #errors = const <dynamic>["pkg/front_end/testcases/check_deferred_is_check.dart:9:14: Error: The type '#lib1::C' is deferred loaded via prefix 'lib' and can't be used as a type annotation.
Try removing 'deferred' from the import of 'lib' or use a supertype of '#lib1::C' that isn't deferred.
print(x is lib.C);
- ^^^"]/* from null */;
+ ^^^^^"]/* from null */;
static method main() → dynamic {}
static method test(dynamic x) → dynamic {
core::print(x is invalid-type);
diff --git a/pkg/front_end/testcases/check_deferred_type_declaration.dart.strong.expect b/pkg/front_end/testcases/check_deferred_type_declaration.dart.strong.expect
index 4d6d46d..9bdb2e8 100644
--- a/pkg/front_end/testcases/check_deferred_type_declaration.dart.strong.expect
+++ b/pkg/front_end/testcases/check_deferred_type_declaration.dart.strong.expect
@@ -4,7 +4,7 @@
static const field dynamic #errors = const <dynamic>["pkg/front_end/testcases/check_deferred_type_declaration.dart:9:3: Error: The type '#lib1::C' is deferred loaded via prefix 'lib' and can't be used as a type annotation.
Try removing 'deferred' from the import of 'lib' or use a supertype of '#lib1::C' that isn't deferred.
lib.C x = null;
- ^^^"]/* from null */;
+ ^^^^^"]/* from null */;
static method main() → dynamic
return self::test();
static method test() → dynamic {
diff --git a/pkg/front_end/testcases/check_deferred_type_declaration.dart.strong.transformed.expect b/pkg/front_end/testcases/check_deferred_type_declaration.dart.strong.transformed.expect
index 4d6d46d..9bdb2e8 100644
--- a/pkg/front_end/testcases/check_deferred_type_declaration.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/check_deferred_type_declaration.dart.strong.transformed.expect
@@ -4,7 +4,7 @@
static const field dynamic #errors = const <dynamic>["pkg/front_end/testcases/check_deferred_type_declaration.dart:9:3: Error: The type '#lib1::C' is deferred loaded via prefix 'lib' and can't be used as a type annotation.
Try removing 'deferred' from the import of 'lib' or use a supertype of '#lib1::C' that isn't deferred.
lib.C x = null;
- ^^^"]/* from null */;
+ ^^^^^"]/* from null */;
static method main() → dynamic
return self::test();
static method test() → dynamic {
diff --git a/pkg/front_end/testcases/constructor_cycle.dart b/pkg/front_end/testcases/constructor_cycle.dart
new file mode 100644
index 0000000..85f38e4
--- /dev/null
+++ b/pkg/front_end/testcases/constructor_cycle.dart
@@ -0,0 +1,12 @@
+// Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+class A {
+ A.foo() : this.bar();
+ A.bar() : this.foo();
+ A.baz() : this.foo();
+ A() : this();
+}
+
+main() {}
diff --git a/pkg/front_end/testcases/constructor_cycle.dart.direct.expect b/pkg/front_end/testcases/constructor_cycle.dart.direct.expect
new file mode 100644
index 0000000..b89128b
--- /dev/null
+++ b/pkg/front_end/testcases/constructor_cycle.dart.direct.expect
@@ -0,0 +1,26 @@
+library;
+import self as self;
+import "dart:core" as core;
+
+class A extends core::Object {
+ constructor foo() → void
+ : this self::A::bar()
+ ;
+ constructor bar() → void
+ : this self::A::foo()
+ ;
+ constructor baz() → void
+ : this self::A::foo()
+ ;
+ constructor •() → void
+ : this self::A::•()
+ ;
+}
+static const field dynamic #errors = const <dynamic>["pkg/front_end/testcases/constructor_cycle.dart:7:18: Error: Redirecting constructers can't be cyclic.
+Try to have all constructors eventually redirect to a non-redirecting constructor.
+ A.bar() : this.foo();
+ ^^^", "pkg/front_end/testcases/constructor_cycle.dart:9:9: Error: Redirecting constructers can't be cyclic.
+Try to have all constructors eventually redirect to a non-redirecting constructor.
+ A() : this();
+ ^^^^"]/* from null */;
+static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/constructor_cycle.dart.direct.transformed.expect b/pkg/front_end/testcases/constructor_cycle.dart.direct.transformed.expect
new file mode 100644
index 0000000..b89128b
--- /dev/null
+++ b/pkg/front_end/testcases/constructor_cycle.dart.direct.transformed.expect
@@ -0,0 +1,26 @@
+library;
+import self as self;
+import "dart:core" as core;
+
+class A extends core::Object {
+ constructor foo() → void
+ : this self::A::bar()
+ ;
+ constructor bar() → void
+ : this self::A::foo()
+ ;
+ constructor baz() → void
+ : this self::A::foo()
+ ;
+ constructor •() → void
+ : this self::A::•()
+ ;
+}
+static const field dynamic #errors = const <dynamic>["pkg/front_end/testcases/constructor_cycle.dart:7:18: Error: Redirecting constructers can't be cyclic.
+Try to have all constructors eventually redirect to a non-redirecting constructor.
+ A.bar() : this.foo();
+ ^^^", "pkg/front_end/testcases/constructor_cycle.dart:9:9: Error: Redirecting constructers can't be cyclic.
+Try to have all constructors eventually redirect to a non-redirecting constructor.
+ A() : this();
+ ^^^^"]/* from null */;
+static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/constructor_cycle.dart.outline.expect b/pkg/front_end/testcases/constructor_cycle.dart.outline.expect
new file mode 100644
index 0000000..7e53021
--- /dev/null
+++ b/pkg/front_end/testcases/constructor_cycle.dart.outline.expect
@@ -0,0 +1,16 @@
+library;
+import self as self;
+import "dart:core" as core;
+
+class A extends core::Object {
+ constructor foo() → void
+ ;
+ constructor bar() → void
+ ;
+ constructor baz() → void
+ ;
+ constructor •() → void
+ ;
+}
+static method main() → dynamic
+ ;
diff --git a/pkg/front_end/testcases/constructor_cycle.dart.strong.expect b/pkg/front_end/testcases/constructor_cycle.dart.strong.expect
new file mode 100644
index 0000000..b89128b
--- /dev/null
+++ b/pkg/front_end/testcases/constructor_cycle.dart.strong.expect
@@ -0,0 +1,26 @@
+library;
+import self as self;
+import "dart:core" as core;
+
+class A extends core::Object {
+ constructor foo() → void
+ : this self::A::bar()
+ ;
+ constructor bar() → void
+ : this self::A::foo()
+ ;
+ constructor baz() → void
+ : this self::A::foo()
+ ;
+ constructor •() → void
+ : this self::A::•()
+ ;
+}
+static const field dynamic #errors = const <dynamic>["pkg/front_end/testcases/constructor_cycle.dart:7:18: Error: Redirecting constructers can't be cyclic.
+Try to have all constructors eventually redirect to a non-redirecting constructor.
+ A.bar() : this.foo();
+ ^^^", "pkg/front_end/testcases/constructor_cycle.dart:9:9: Error: Redirecting constructers can't be cyclic.
+Try to have all constructors eventually redirect to a non-redirecting constructor.
+ A() : this();
+ ^^^^"]/* from null */;
+static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/constructor_cycle.dart.strong.transformed.expect b/pkg/front_end/testcases/constructor_cycle.dart.strong.transformed.expect
new file mode 100644
index 0000000..b89128b
--- /dev/null
+++ b/pkg/front_end/testcases/constructor_cycle.dart.strong.transformed.expect
@@ -0,0 +1,26 @@
+library;
+import self as self;
+import "dart:core" as core;
+
+class A extends core::Object {
+ constructor foo() → void
+ : this self::A::bar()
+ ;
+ constructor bar() → void
+ : this self::A::foo()
+ ;
+ constructor baz() → void
+ : this self::A::foo()
+ ;
+ constructor •() → void
+ : this self::A::•()
+ ;
+}
+static const field dynamic #errors = const <dynamic>["pkg/front_end/testcases/constructor_cycle.dart:7:18: Error: Redirecting constructers can't be cyclic.
+Try to have all constructors eventually redirect to a non-redirecting constructor.
+ A.bar() : this.foo();
+ ^^^", "pkg/front_end/testcases/constructor_cycle.dart:9:9: Error: Redirecting constructers can't be cyclic.
+Try to have all constructors eventually redirect to a non-redirecting constructor.
+ A() : this();
+ ^^^^"]/* from null */;
+static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/future_or_test.dart.direct.transformed.expect b/pkg/front_end/testcases/future_or_test.dart.direct.transformed.expect
index 359d991..0d5c28b 100644
--- a/pkg/front_end/testcases/future_or_test.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/future_or_test.dart.direct.transformed.expect
@@ -30,7 +30,7 @@
:return_value = this.{self::B::a}.foo();
break #L1;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
@@ -63,7 +63,7 @@
:return_value = this.{self::C::b}.bar();
break #L2;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
diff --git a/pkg/front_end/testcases/future_or_test.dart.strong.transformed.expect b/pkg/front_end/testcases/future_or_test.dart.strong.transformed.expect
index fa7b7ac..1618bf5 100644
--- a/pkg/front_end/testcases/future_or_test.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/future_or_test.dart.strong.transformed.expect
@@ -30,7 +30,7 @@
:return_value = this.{self::B::a}.{self::A::foo}();
break #L1;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
@@ -63,7 +63,7 @@
:return_value = this.{self::C::b}.{self::B::bar}() as{TypeError} asy::FutureOr<core::int>;
break #L2;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
diff --git a/pkg/front_end/testcases/inference/async_await.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/async_await.dart.direct.transformed.expect
index 839f1dd..d797b5d 100644
--- a/pkg/front_end/testcases/inference/async_await.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/async_await.dart.direct.transformed.expect
@@ -46,7 +46,7 @@
:return_value = x0;
break #L2;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
@@ -73,7 +73,7 @@
:return_value = x1;
break #L3;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
@@ -100,7 +100,7 @@
:return_value = x2;
break #L4;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
@@ -127,7 +127,7 @@
:return_value = x3;
break #L5;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
@@ -154,7 +154,7 @@
:return_value = x4;
break #L6;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
@@ -181,7 +181,7 @@
:return_value = x5;
break #L7;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
@@ -208,7 +208,7 @@
:return_value = x6;
break #L8;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
@@ -235,7 +235,7 @@
:return_value = x7;
break #L9;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
@@ -262,7 +262,7 @@
:return_value = x8;
break #L10;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
@@ -289,7 +289,7 @@
:return_value = x9;
break #L11;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
@@ -322,7 +322,7 @@
[yield] let dynamic #t10 = asy::_awaitHelper(x9, :async_op_then, :async_op_error, :async_op) in null;
dynamic y9 = :result;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
diff --git a/pkg/front_end/testcases/inference/async_await.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/async_await.dart.strong.transformed.expect
index d0c0e68..e437f50 100644
--- a/pkg/front_end/testcases/inference/async_await.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/async_await.dart.strong.transformed.expect
@@ -46,7 +46,7 @@
:return_value = x0;
break #L2;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
@@ -73,7 +73,7 @@
:return_value = x1;
break #L3;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
@@ -100,7 +100,7 @@
:return_value = x2;
break #L4;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
@@ -127,7 +127,7 @@
:return_value = x3;
break #L5;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
@@ -154,7 +154,7 @@
:return_value = x4;
break #L6;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
@@ -181,7 +181,7 @@
:return_value = x5;
break #L7;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
@@ -208,7 +208,7 @@
:return_value = x6;
break #L8;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
@@ -235,7 +235,7 @@
:return_value = x7;
break #L9;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
@@ -262,7 +262,7 @@
:return_value = x8;
break #L10;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
@@ -289,7 +289,7 @@
:return_value = x9;
break #L11;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
@@ -322,7 +322,7 @@
[yield] let dynamic #t10 = asy::_awaitHelper(x9, :async_op_then, :async_op_error, :async_op) in null;
core::int y9 = :result;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
diff --git a/pkg/front_end/testcases/inference/async_closure_return_type_flatten.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/async_closure_return_type_flatten.dart.direct.transformed.expect
index cdfa0e5..0f3c9ac 100644
--- a/pkg/front_end/testcases/inference/async_closure_return_type_flatten.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/async_closure_return_type_flatten.dart.direct.transformed.expect
@@ -20,7 +20,7 @@
:return_value = self::futureInt;
break #L1;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
diff --git a/pkg/front_end/testcases/inference/async_closure_return_type_flatten.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/async_closure_return_type_flatten.dart.strong.transformed.expect
index e35517f..1959108 100644
--- a/pkg/front_end/testcases/inference/async_closure_return_type_flatten.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/async_closure_return_type_flatten.dart.strong.transformed.expect
@@ -20,7 +20,7 @@
:return_value = self::futureInt;
break #L1;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
diff --git a/pkg/front_end/testcases/inference/async_closure_return_type_future.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/async_closure_return_type_future.dart.direct.transformed.expect
index 92ac896..a45113d 100644
--- a/pkg/front_end/testcases/inference/async_closure_return_type_future.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/async_closure_return_type_future.dart.direct.transformed.expect
@@ -17,7 +17,7 @@
:return_value = 0;
break #L1;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
diff --git a/pkg/front_end/testcases/inference/async_closure_return_type_future.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/async_closure_return_type_future.dart.strong.transformed.expect
index d7fa5b6..2c350bc 100644
--- a/pkg/front_end/testcases/inference/async_closure_return_type_future.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/async_closure_return_type_future.dart.strong.transformed.expect
@@ -18,7 +18,7 @@
:return_value = 0;
break #L1;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
diff --git a/pkg/front_end/testcases/inference/async_closure_return_type_future_or.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/async_closure_return_type_future_or.dart.direct.transformed.expect
index 0483a9f..1c04583 100644
--- a/pkg/front_end/testcases/inference/async_closure_return_type_future_or.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/async_closure_return_type_future_or.dart.direct.transformed.expect
@@ -20,7 +20,7 @@
:return_value = self::futureOrInt;
break #L1;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
diff --git a/pkg/front_end/testcases/inference/async_closure_return_type_future_or.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/async_closure_return_type_future_or.dart.strong.transformed.expect
index 5910611..5cc8ee5 100644
--- a/pkg/front_end/testcases/inference/async_closure_return_type_future_or.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/async_closure_return_type_future_or.dart.strong.transformed.expect
@@ -20,7 +20,7 @@
:return_value = self::futureOrInt;
break #L1;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
diff --git a/pkg/front_end/testcases/inference/block_bodied_lambdas_async_all_returns_are_futures.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/block_bodied_lambdas_async_all_returns_are_futures.dart.direct.transformed.expect
index cc66edb..eeada89 100644
--- a/pkg/front_end/testcases/inference/block_bodied_lambdas_async_all_returns_are_futures.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/block_bodied_lambdas_async_all_returns_are_futures.dart.direct.transformed.expect
@@ -26,7 +26,7 @@
break #L1;
}
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
diff --git a/pkg/front_end/testcases/inference/block_bodied_lambdas_async_all_returns_are_futures.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/block_bodied_lambdas_async_all_returns_are_futures.dart.strong.transformed.expect
index af00522..1325622 100644
--- a/pkg/front_end/testcases/inference/block_bodied_lambdas_async_all_returns_are_futures.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/block_bodied_lambdas_async_all_returns_are_futures.dart.strong.transformed.expect
@@ -26,7 +26,7 @@
break #L1;
}
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
diff --git a/pkg/front_end/testcases/inference/block_bodied_lambdas_async_all_returns_are_values.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/block_bodied_lambdas_async_all_returns_are_values.dart.direct.transformed.expect
index b16d670..e651a4a 100644
--- a/pkg/front_end/testcases/inference/block_bodied_lambdas_async_all_returns_are_values.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/block_bodied_lambdas_async_all_returns_are_values.dart.direct.transformed.expect
@@ -26,7 +26,7 @@
break #L1;
}
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
diff --git a/pkg/front_end/testcases/inference/block_bodied_lambdas_async_all_returns_are_values.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/block_bodied_lambdas_async_all_returns_are_values.dart.strong.transformed.expect
index 2087333..4d101fa 100644
--- a/pkg/front_end/testcases/inference/block_bodied_lambdas_async_all_returns_are_values.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/block_bodied_lambdas_async_all_returns_are_values.dart.strong.transformed.expect
@@ -26,7 +26,7 @@
break #L1;
}
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
diff --git a/pkg/front_end/testcases/inference/block_bodied_lambdas_async_mix_of_values_and_futures.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/block_bodied_lambdas_async_mix_of_values_and_futures.dart.direct.transformed.expect
index 7c5e12b..d306ab4 100644
--- a/pkg/front_end/testcases/inference/block_bodied_lambdas_async_mix_of_values_and_futures.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/block_bodied_lambdas_async_mix_of_values_and_futures.dart.direct.transformed.expect
@@ -26,7 +26,7 @@
break #L1;
}
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
diff --git a/pkg/front_end/testcases/inference/block_bodied_lambdas_async_mix_of_values_and_futures.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/block_bodied_lambdas_async_mix_of_values_and_futures.dart.strong.transformed.expect
index 08a88b2..be516f9 100644
--- a/pkg/front_end/testcases/inference/block_bodied_lambdas_async_mix_of_values_and_futures.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/block_bodied_lambdas_async_mix_of_values_and_futures.dart.strong.transformed.expect
@@ -26,7 +26,7 @@
break #L1;
}
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
diff --git a/pkg/front_end/testcases/inference/block_bodied_lambdas_infer_bottom_async.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/block_bodied_lambdas_infer_bottom_async.dart.direct.transformed.expect
index 642c44a..7eafe2e 100644
--- a/pkg/front_end/testcases/inference/block_bodied_lambdas_infer_bottom_async.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/block_bodied_lambdas_infer_bottom_async.dart.direct.transformed.expect
@@ -31,7 +31,7 @@
:return_value = null;
break #L2;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
@@ -48,7 +48,7 @@
[yield] let dynamic #t1 = asy::_awaitHelper(f.call(), :async_op_then, :async_op_error, :async_op) in null;
core::String s = :result;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
diff --git a/pkg/front_end/testcases/inference/block_bodied_lambdas_infer_bottom_async.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/block_bodied_lambdas_infer_bottom_async.dart.strong.transformed.expect
index da3ad50..510f5e8 100644
--- a/pkg/front_end/testcases/inference/block_bodied_lambdas_infer_bottom_async.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/block_bodied_lambdas_infer_bottom_async.dart.strong.transformed.expect
@@ -31,7 +31,7 @@
:return_value = null;
break #L2;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
@@ -48,7 +48,7 @@
[yield] let dynamic #t1 = asy::_awaitHelper(f.call(), :async_op_then, :async_op_error, :async_op) in null;
core::String s = :result;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
diff --git a/pkg/front_end/testcases/inference/block_bodied_lambdas_infer_bottom_async_star.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/block_bodied_lambdas_infer_bottom_async_star.dart.direct.transformed.expect
index 3254b80..eec269b 100644
--- a/pkg/front_end/testcases/inference/block_bodied_lambdas_infer_bottom_async_star.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/block_bodied_lambdas_infer_bottom_async_star.dart.direct.transformed.expect
@@ -54,7 +54,7 @@
[yield] let dynamic #t1 = asy::_awaitHelper(f.call().first, :async_op_then, :async_op_error, :async_op) in null;
core::String s = :result;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
diff --git a/pkg/front_end/testcases/inference/block_bodied_lambdas_infer_bottom_async_star.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/block_bodied_lambdas_infer_bottom_async_star.dart.strong.transformed.expect
index 20fe1a2..5336002 100644
--- a/pkg/front_end/testcases/inference/block_bodied_lambdas_infer_bottom_async_star.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/block_bodied_lambdas_infer_bottom_async_star.dart.strong.transformed.expect
@@ -54,7 +54,7 @@
[yield] let dynamic #t1 = asy::_awaitHelper(f.call().{asy::Stream::first}, :async_op_then, :async_op_error, :async_op) in null;
core::String s = :result;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
diff --git a/pkg/front_end/testcases/inference/downwards_inference_async_await.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/downwards_inference_async_await.dart.direct.transformed.expect
index 48cd5f2..af02e87 100644
--- a/pkg/front_end/testcases/inference/downwards_inference_async_await.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/downwards_inference_async_await.dart.direct.transformed.expect
@@ -22,7 +22,7 @@
[yield] let dynamic #t2 = asy::_awaitHelper(asy::Future::value<dynamic>(<dynamic>[d]), :async_op_then, :async_op_error, :async_op) in null;
core::List<core::int> l1 = :result;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
diff --git a/pkg/front_end/testcases/inference/downwards_inference_async_await.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/downwards_inference_async_await.dart.strong.transformed.expect
index 498dfc2..fdda593 100644
--- a/pkg/front_end/testcases/inference/downwards_inference_async_await.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/downwards_inference_async_await.dart.strong.transformed.expect
@@ -22,7 +22,7 @@
[yield] let dynamic #t2 = asy::_awaitHelper(asy::Future::value<core::List<core::int>>(<core::int>[d as{TypeError} core::int]), :async_op_then, :async_op_error, :async_op) in null;
core::List<core::int> l1 = :result;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
diff --git a/pkg/front_end/testcases/inference/downwards_inference_for_each.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/downwards_inference_for_each.dart.direct.transformed.expect
index 8a0ba8a..3fe8d61 100644
--- a/pkg/front_end/testcases/inference/downwards_inference_for_each.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/downwards_inference_for_each.dart.direct.transformed.expect
@@ -139,7 +139,7 @@
}
}
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
@@ -212,7 +212,7 @@
}
}
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
diff --git a/pkg/front_end/testcases/inference/downwards_inference_for_each.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/downwards_inference_for_each.dart.strong.transformed.expect
index 49348b8..f1be6dc 100644
--- a/pkg/front_end/testcases/inference/downwards_inference_for_each.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/downwards_inference_for_each.dart.strong.transformed.expect
@@ -139,7 +139,7 @@
}
}
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
@@ -212,7 +212,7 @@
}
}
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
diff --git a/pkg/front_end/testcases/inference/for_each_downcast_iterable.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/for_each_downcast_iterable.dart.direct.transformed.expect
index c86a42f..fb28aab 100644
--- a/pkg/front_end/testcases/inference/for_each_downcast_iterable.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/for_each_downcast_iterable.dart.direct.transformed.expect
@@ -67,7 +67,7 @@
}
}
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
diff --git a/pkg/front_end/testcases/inference/for_each_downcast_iterable.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/for_each_downcast_iterable.dart.strong.transformed.expect
index ab6f7a7..abe79b3 100644
--- a/pkg/front_end/testcases/inference/for_each_downcast_iterable.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/for_each_downcast_iterable.dart.strong.transformed.expect
@@ -67,7 +67,7 @@
}
}
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
diff --git a/pkg/front_end/testcases/inference/future_then.dart.direct.expect b/pkg/front_end/testcases/inference/future_then.dart.direct.expect
index 98124f7..44f0631 100644
--- a/pkg/front_end/testcases/inference/future_then.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/future_then.dart.direct.expect
@@ -12,13 +12,13 @@
return null;
method then<S extends core::Object = dynamic>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
return null;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("catchError", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#test: test}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("whenComplete", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {() → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {() → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("timeout", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#onTimeout: onTimeout}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("asStream", const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Stream<self::MyFuture::T>;
}
static method test() → void {
diff --git a/pkg/front_end/testcases/inference/future_then.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/future_then.dart.direct.transformed.expect
index 39bf766..f27ed38 100644
--- a/pkg/front_end/testcases/inference/future_then.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/future_then.dart.direct.transformed.expect
@@ -12,13 +12,13 @@
return null;
method then<S extends core::Object = dynamic>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
return null;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("catchError", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#test: test}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("whenComplete", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {() → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {() → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("timeout", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#onTimeout: onTimeout}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("asStream", const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Stream<self::MyFuture::T>;
}
static method test() → void {
@@ -40,7 +40,7 @@
:return_value = :result;
break #L1;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
@@ -69,7 +69,7 @@
:return_value = :result;
break #L2;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
@@ -96,7 +96,7 @@
:return_value = 3;
break #L3;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
@@ -123,7 +123,7 @@
:return_value = 3;
break #L4;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
@@ -154,7 +154,7 @@
:return_value = asy::Future::value<core::int>(3);
break #L5;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
@@ -181,7 +181,7 @@
:return_value = asy::Future::value<core::int>(3);
break #L6;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
diff --git a/pkg/front_end/testcases/inference/future_then.dart.outline.expect b/pkg/front_end/testcases/inference/future_then.dart.outline.expect
index 638eb19..b0fa0d6 100644
--- a/pkg/front_end/testcases/inference/future_then.dart.outline.expect
+++ b/pkg/front_end/testcases/inference/future_then.dart.outline.expect
@@ -12,13 +12,13 @@
;
method then<S extends core::Object = dynamic>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError}) → self::MyFuture<self::MyFuture::then::S>
;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("catchError", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#test: test}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("whenComplete", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {() → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {() → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("timeout", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#onTimeout: onTimeout}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("asStream", const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Stream<self::MyFuture::T>;
}
static method test() → void
diff --git a/pkg/front_end/testcases/inference/future_then.dart.strong.expect b/pkg/front_end/testcases/inference/future_then.dart.strong.expect
index b0f41cc..3865b48 100644
--- a/pkg/front_end/testcases/inference/future_then.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/future_then.dart.strong.expect
@@ -12,13 +12,13 @@
return null;
method then<S extends core::Object = dynamic>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
return null;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("catchError", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#test: test}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("whenComplete", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {generic-covariant-impl () → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {generic-covariant-impl () → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("timeout", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#onTimeout: onTimeout}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("asStream", const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Stream<self::MyFuture::T>;
}
static method test() → void {
diff --git a/pkg/front_end/testcases/inference/future_then.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/future_then.dart.strong.transformed.expect
index 7eaed28..8b41d75 100644
--- a/pkg/front_end/testcases/inference/future_then.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/future_then.dart.strong.transformed.expect
@@ -12,13 +12,13 @@
return null;
method then<S extends core::Object = dynamic>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
return null;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("catchError", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#test: test}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("whenComplete", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {generic-covariant-impl () → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {generic-covariant-impl () → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("timeout", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#onTimeout: onTimeout}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("asStream", const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Stream<self::MyFuture::T>;
}
static method test() → void {
@@ -40,7 +40,7 @@
:return_value = :result;
break #L1;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
@@ -69,7 +69,7 @@
:return_value = :result;
break #L2;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
@@ -96,7 +96,7 @@
:return_value = 3;
break #L3;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
@@ -123,7 +123,7 @@
:return_value = 3;
break #L4;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
@@ -154,7 +154,7 @@
:return_value = asy::Future::value<core::int>(3);
break #L5;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
@@ -181,7 +181,7 @@
:return_value = asy::Future::value<core::int>(3);
break #L6;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
diff --git a/pkg/front_end/testcases/inference/future_then_2.dart.direct.expect b/pkg/front_end/testcases/inference/future_then_2.dart.direct.expect
index 5f0821f..f756aa6 100644
--- a/pkg/front_end/testcases/inference/future_then_2.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/future_then_2.dart.direct.expect
@@ -12,13 +12,13 @@
return null;
method then<S extends core::Object = dynamic>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
return null;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("catchError", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#test: test}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("whenComplete", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {() → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {() → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("timeout", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#onTimeout: onTimeout}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("asStream", const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Stream<self::MyFuture::T>;
}
static method test() → void {
diff --git a/pkg/front_end/testcases/inference/future_then_2.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/future_then_2.dart.direct.transformed.expect
index 4b7549d..20ee8d1 100644
--- a/pkg/front_end/testcases/inference/future_then_2.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/future_then_2.dart.direct.transformed.expect
@@ -12,13 +12,13 @@
return null;
method then<S extends core::Object = dynamic>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
return null;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("catchError", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#test: test}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("whenComplete", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {() → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {() → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("timeout", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#onTimeout: onTimeout}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("asStream", const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Stream<self::MyFuture::T>;
}
static method test() → void {
@@ -40,7 +40,7 @@
:return_value = :result;
break #L1;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
@@ -69,7 +69,7 @@
:return_value = :result;
break #L2;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
@@ -96,7 +96,7 @@
:return_value = 3;
break #L3;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
@@ -123,7 +123,7 @@
:return_value = 3;
break #L4;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
@@ -154,7 +154,7 @@
:return_value = new self::MyFuture::value<core::int>(3);
break #L5;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
@@ -181,7 +181,7 @@
:return_value = new self::MyFuture::value<core::int>(3);
break #L6;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
diff --git a/pkg/front_end/testcases/inference/future_then_2.dart.outline.expect b/pkg/front_end/testcases/inference/future_then_2.dart.outline.expect
index 638eb19..b0fa0d6 100644
--- a/pkg/front_end/testcases/inference/future_then_2.dart.outline.expect
+++ b/pkg/front_end/testcases/inference/future_then_2.dart.outline.expect
@@ -12,13 +12,13 @@
;
method then<S extends core::Object = dynamic>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError}) → self::MyFuture<self::MyFuture::then::S>
;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("catchError", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#test: test}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("whenComplete", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {() → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {() → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("timeout", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#onTimeout: onTimeout}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("asStream", const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Stream<self::MyFuture::T>;
}
static method test() → void
diff --git a/pkg/front_end/testcases/inference/future_then_2.dart.strong.expect b/pkg/front_end/testcases/inference/future_then_2.dart.strong.expect
index 2c71d0b..e596eb7 100644
--- a/pkg/front_end/testcases/inference/future_then_2.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/future_then_2.dart.strong.expect
@@ -12,13 +12,13 @@
return null;
method then<S extends core::Object = dynamic>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
return null;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("catchError", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#test: test}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("whenComplete", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {generic-covariant-impl () → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {generic-covariant-impl () → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("timeout", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#onTimeout: onTimeout}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("asStream", const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Stream<self::MyFuture::T>;
}
static method test() → void {
diff --git a/pkg/front_end/testcases/inference/future_then_2.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/future_then_2.dart.strong.transformed.expect
index 90bcbbb..7927f17 100644
--- a/pkg/front_end/testcases/inference/future_then_2.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/future_then_2.dart.strong.transformed.expect
@@ -12,13 +12,13 @@
return null;
method then<S extends core::Object = dynamic>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
return null;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("catchError", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#test: test}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("whenComplete", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {generic-covariant-impl () → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {generic-covariant-impl () → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("timeout", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#onTimeout: onTimeout}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("asStream", const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Stream<self::MyFuture::T>;
}
static method test() → void {
@@ -40,7 +40,7 @@
:return_value = :result;
break #L1;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
@@ -69,7 +69,7 @@
:return_value = :result;
break #L2;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
@@ -96,7 +96,7 @@
:return_value = 3;
break #L3;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
@@ -123,7 +123,7 @@
:return_value = 3;
break #L4;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
@@ -154,7 +154,7 @@
:return_value = new self::MyFuture::value<core::int>(3);
break #L5;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
@@ -181,7 +181,7 @@
:return_value = new self::MyFuture::value<core::int>(3);
break #L6;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
diff --git a/pkg/front_end/testcases/inference/future_then_3.dart.direct.expect b/pkg/front_end/testcases/inference/future_then_3.dart.direct.expect
index aea52b3..3055eeb 100644
--- a/pkg/front_end/testcases/inference/future_then_3.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/future_then_3.dart.direct.expect
@@ -12,13 +12,13 @@
return null;
method then<S extends core::Object = dynamic>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
return null;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("catchError", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#test: test}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("whenComplete", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {() → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {() → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("timeout", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#onTimeout: onTimeout}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("asStream", const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Stream<self::MyFuture::T>;
}
static method test() → void {
diff --git a/pkg/front_end/testcases/inference/future_then_3.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/future_then_3.dart.direct.transformed.expect
index 7c89606..c6d3766 100644
--- a/pkg/front_end/testcases/inference/future_then_3.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/future_then_3.dart.direct.transformed.expect
@@ -12,13 +12,13 @@
return null;
method then<S extends core::Object = dynamic>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
return null;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("catchError", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#test: test}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("whenComplete", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {() → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {() → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("timeout", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#onTimeout: onTimeout}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("asStream", const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Stream<self::MyFuture::T>;
}
static method test() → void {
@@ -40,7 +40,7 @@
:return_value = :result;
break #L1;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
@@ -69,7 +69,7 @@
:return_value = :result;
break #L2;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
@@ -96,7 +96,7 @@
:return_value = 3;
break #L3;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
@@ -123,7 +123,7 @@
:return_value = 3;
break #L4;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
@@ -154,7 +154,7 @@
:return_value = asy::Future::value<core::int>(3);
break #L5;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
@@ -181,7 +181,7 @@
:return_value = asy::Future::value<core::int>(3);
break #L6;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
diff --git a/pkg/front_end/testcases/inference/future_then_3.dart.outline.expect b/pkg/front_end/testcases/inference/future_then_3.dart.outline.expect
index 638eb19..b0fa0d6 100644
--- a/pkg/front_end/testcases/inference/future_then_3.dart.outline.expect
+++ b/pkg/front_end/testcases/inference/future_then_3.dart.outline.expect
@@ -12,13 +12,13 @@
;
method then<S extends core::Object = dynamic>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError}) → self::MyFuture<self::MyFuture::then::S>
;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("catchError", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#test: test}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("whenComplete", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {() → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {() → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("timeout", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#onTimeout: onTimeout}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("asStream", const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Stream<self::MyFuture::T>;
}
static method test() → void
diff --git a/pkg/front_end/testcases/inference/future_then_3.dart.strong.expect b/pkg/front_end/testcases/inference/future_then_3.dart.strong.expect
index 14bbd85..8ccd2b2 100644
--- a/pkg/front_end/testcases/inference/future_then_3.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/future_then_3.dart.strong.expect
@@ -12,13 +12,13 @@
return null;
method then<S extends core::Object = dynamic>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
return null;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("catchError", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#test: test}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("whenComplete", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {generic-covariant-impl () → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {generic-covariant-impl () → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("timeout", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#onTimeout: onTimeout}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("asStream", const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Stream<self::MyFuture::T>;
}
static method test() → void {
diff --git a/pkg/front_end/testcases/inference/future_then_3.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/future_then_3.dart.strong.transformed.expect
index ca483a5..775141b 100644
--- a/pkg/front_end/testcases/inference/future_then_3.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/future_then_3.dart.strong.transformed.expect
@@ -12,13 +12,13 @@
return null;
method then<S extends core::Object = dynamic>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
return null;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("catchError", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#test: test}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("whenComplete", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {generic-covariant-impl () → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {generic-covariant-impl () → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("timeout", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#onTimeout: onTimeout}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("asStream", const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Stream<self::MyFuture::T>;
}
static method test() → void {
@@ -40,7 +40,7 @@
:return_value = :result;
break #L1;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
@@ -69,7 +69,7 @@
:return_value = :result;
break #L2;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
@@ -96,7 +96,7 @@
:return_value = 3;
break #L3;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
@@ -123,7 +123,7 @@
:return_value = 3;
break #L4;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
@@ -154,7 +154,7 @@
:return_value = asy::Future::value<core::int>(3);
break #L5;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
@@ -181,7 +181,7 @@
:return_value = asy::Future::value<core::int>(3);
break #L6;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
diff --git a/pkg/front_end/testcases/inference/future_then_4.dart.direct.expect b/pkg/front_end/testcases/inference/future_then_4.dart.direct.expect
index 7260212..ea9288e 100644
--- a/pkg/front_end/testcases/inference/future_then_4.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/future_then_4.dart.direct.expect
@@ -12,13 +12,13 @@
return null;
method then<S extends core::Object = dynamic>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
return null;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("catchError", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#test: test}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("whenComplete", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {() → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {() → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("timeout", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#onTimeout: onTimeout}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("asStream", const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Stream<self::MyFuture::T>;
}
static method test() → void {
diff --git a/pkg/front_end/testcases/inference/future_then_4.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/future_then_4.dart.direct.transformed.expect
index 746d72c..8f4e8ca 100644
--- a/pkg/front_end/testcases/inference/future_then_4.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/future_then_4.dart.direct.transformed.expect
@@ -12,13 +12,13 @@
return null;
method then<S extends core::Object = dynamic>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
return null;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("catchError", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#test: test}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("whenComplete", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {() → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {() → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("timeout", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#onTimeout: onTimeout}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("asStream", const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Stream<self::MyFuture::T>;
}
static method test() → void {
@@ -40,7 +40,7 @@
:return_value = :result;
break #L1;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
@@ -69,7 +69,7 @@
:return_value = :result;
break #L2;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
@@ -96,7 +96,7 @@
:return_value = 3;
break #L3;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
@@ -123,7 +123,7 @@
:return_value = 3;
break #L4;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
@@ -154,7 +154,7 @@
:return_value = new self::MyFuture::value<core::int>(3);
break #L5;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
@@ -181,7 +181,7 @@
:return_value = new self::MyFuture::value<core::int>(3);
break #L6;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
diff --git a/pkg/front_end/testcases/inference/future_then_4.dart.outline.expect b/pkg/front_end/testcases/inference/future_then_4.dart.outline.expect
index 638eb19..b0fa0d6 100644
--- a/pkg/front_end/testcases/inference/future_then_4.dart.outline.expect
+++ b/pkg/front_end/testcases/inference/future_then_4.dart.outline.expect
@@ -12,13 +12,13 @@
;
method then<S extends core::Object = dynamic>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError}) → self::MyFuture<self::MyFuture::then::S>
;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("catchError", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#test: test}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("whenComplete", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {() → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {() → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("timeout", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#onTimeout: onTimeout}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("asStream", const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Stream<self::MyFuture::T>;
}
static method test() → void
diff --git a/pkg/front_end/testcases/inference/future_then_4.dart.strong.expect b/pkg/front_end/testcases/inference/future_then_4.dart.strong.expect
index 79ba4a3..51169ac 100644
--- a/pkg/front_end/testcases/inference/future_then_4.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/future_then_4.dart.strong.expect
@@ -12,13 +12,13 @@
return null;
method then<S extends core::Object = dynamic>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
return null;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("catchError", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#test: test}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("whenComplete", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {generic-covariant-impl () → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {generic-covariant-impl () → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("timeout", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#onTimeout: onTimeout}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("asStream", const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Stream<self::MyFuture::T>;
}
static method test() → void {
diff --git a/pkg/front_end/testcases/inference/future_then_4.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/future_then_4.dart.strong.transformed.expect
index 21ecf5e..dacc8a3 100644
--- a/pkg/front_end/testcases/inference/future_then_4.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/future_then_4.dart.strong.transformed.expect
@@ -12,13 +12,13 @@
return null;
method then<S extends core::Object = dynamic>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
return null;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("catchError", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#test: test}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("whenComplete", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {generic-covariant-impl () → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {generic-covariant-impl () → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("timeout", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#onTimeout: onTimeout}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("asStream", const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Stream<self::MyFuture::T>;
}
static method test() → void {
@@ -40,7 +40,7 @@
:return_value = :result;
break #L1;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
@@ -69,7 +69,7 @@
:return_value = :result;
break #L2;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
@@ -96,7 +96,7 @@
:return_value = 3;
break #L3;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
@@ -123,7 +123,7 @@
:return_value = 3;
break #L4;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
@@ -154,7 +154,7 @@
:return_value = new self::MyFuture::value<core::int>(3);
break #L5;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
@@ -181,7 +181,7 @@
:return_value = new self::MyFuture::value<core::int>(3);
break #L6;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
diff --git a/pkg/front_end/testcases/inference/future_then_5.dart.direct.expect b/pkg/front_end/testcases/inference/future_then_5.dart.direct.expect
index c2e1984..c36c9cb 100644
--- a/pkg/front_end/testcases/inference/future_then_5.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/future_then_5.dart.direct.expect
@@ -12,13 +12,13 @@
return null;
method then<S extends core::Object = dynamic>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
return null;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("catchError", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#test: test}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("whenComplete", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {() → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {() → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("timeout", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#onTimeout: onTimeout}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("asStream", const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Stream<self::MyFuture::T>;
}
static method test() → void {
diff --git a/pkg/front_end/testcases/inference/future_then_5.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/future_then_5.dart.direct.transformed.expect
index f996ff9..a617678 100644
--- a/pkg/front_end/testcases/inference/future_then_5.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/future_then_5.dart.direct.transformed.expect
@@ -12,13 +12,13 @@
return null;
method then<S extends core::Object = dynamic>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
return null;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("catchError", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#test: test}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("whenComplete", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {() → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {() → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("timeout", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#onTimeout: onTimeout}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("asStream", const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Stream<self::MyFuture::T>;
}
static method test() → void {
@@ -40,7 +40,7 @@
:return_value = :result;
break #L1;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
@@ -69,7 +69,7 @@
:return_value = :result;
break #L2;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
@@ -96,7 +96,7 @@
:return_value = 3;
break #L3;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
@@ -123,7 +123,7 @@
:return_value = 3;
break #L4;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
@@ -154,7 +154,7 @@
:return_value = new self::MyFuture::value<core::int>(3);
break #L5;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
@@ -181,7 +181,7 @@
:return_value = new self::MyFuture::value<core::int>(3);
break #L6;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
diff --git a/pkg/front_end/testcases/inference/future_then_5.dart.outline.expect b/pkg/front_end/testcases/inference/future_then_5.dart.outline.expect
index 638eb19..b0fa0d6 100644
--- a/pkg/front_end/testcases/inference/future_then_5.dart.outline.expect
+++ b/pkg/front_end/testcases/inference/future_then_5.dart.outline.expect
@@ -12,13 +12,13 @@
;
method then<S extends core::Object = dynamic>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError}) → self::MyFuture<self::MyFuture::then::S>
;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("catchError", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#test: test}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("whenComplete", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {() → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {() → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("timeout", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#onTimeout: onTimeout}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("asStream", const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Stream<self::MyFuture::T>;
}
static method test() → void
diff --git a/pkg/front_end/testcases/inference/future_then_5.dart.strong.expect b/pkg/front_end/testcases/inference/future_then_5.dart.strong.expect
index 4a8eee5..4da5a6e 100644
--- a/pkg/front_end/testcases/inference/future_then_5.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/future_then_5.dart.strong.expect
@@ -12,13 +12,13 @@
return null;
method then<S extends core::Object = dynamic>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
return null;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("catchError", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#test: test}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("whenComplete", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {generic-covariant-impl () → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {generic-covariant-impl () → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("timeout", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#onTimeout: onTimeout}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("asStream", const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Stream<self::MyFuture::T>;
}
static method test() → void {
diff --git a/pkg/front_end/testcases/inference/future_then_5.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/future_then_5.dart.strong.transformed.expect
index b19d080..b1614ca 100644
--- a/pkg/front_end/testcases/inference/future_then_5.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/future_then_5.dart.strong.transformed.expect
@@ -12,13 +12,13 @@
return null;
method then<S extends core::Object = dynamic>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
return null;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("catchError", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#test: test}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("whenComplete", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {generic-covariant-impl () → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {generic-covariant-impl () → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("timeout", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#onTimeout: onTimeout}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("asStream", const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Stream<self::MyFuture::T>;
}
static method test() → void {
@@ -40,7 +40,7 @@
:return_value = :result;
break #L1;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
@@ -69,7 +69,7 @@
:return_value = :result;
break #L2;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
@@ -96,7 +96,7 @@
:return_value = 3;
break #L3;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
@@ -123,7 +123,7 @@
:return_value = 3;
break #L4;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
@@ -154,7 +154,7 @@
:return_value = new self::MyFuture::value<core::int>(3);
break #L5;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
@@ -181,7 +181,7 @@
:return_value = new self::MyFuture::value<core::int>(3);
break #L6;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
diff --git a/pkg/front_end/testcases/inference/future_then_6.dart.direct.expect b/pkg/front_end/testcases/inference/future_then_6.dart.direct.expect
index c74cdc3..5bf638a 100644
--- a/pkg/front_end/testcases/inference/future_then_6.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/future_then_6.dart.direct.expect
@@ -12,13 +12,13 @@
return null;
method then<S extends core::Object = dynamic>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
return null;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("catchError", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#test: test}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("whenComplete", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {() → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {() → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("timeout", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#onTimeout: onTimeout}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("asStream", const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Stream<self::MyFuture::T>;
}
static method test() → void {
diff --git a/pkg/front_end/testcases/inference/future_then_6.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/future_then_6.dart.direct.transformed.expect
index dda0a4f..925090f 100644
--- a/pkg/front_end/testcases/inference/future_then_6.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/future_then_6.dart.direct.transformed.expect
@@ -12,13 +12,13 @@
return null;
method then<S extends core::Object = dynamic>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
return null;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("catchError", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#test: test}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("whenComplete", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {() → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {() → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("timeout", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#onTimeout: onTimeout}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("asStream", const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Stream<self::MyFuture::T>;
}
static method test() → void {
@@ -40,7 +40,7 @@
:return_value = :result;
break #L1;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
@@ -69,7 +69,7 @@
:return_value = :result;
break #L2;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
@@ -96,7 +96,7 @@
:return_value = 3;
break #L3;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
@@ -123,7 +123,7 @@
:return_value = 3;
break #L4;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
@@ -154,7 +154,7 @@
:return_value = asy::Future::value<core::int>(3);
break #L5;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
@@ -181,7 +181,7 @@
:return_value = asy::Future::value<core::int>(3);
break #L6;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
diff --git a/pkg/front_end/testcases/inference/future_then_6.dart.outline.expect b/pkg/front_end/testcases/inference/future_then_6.dart.outline.expect
index 638eb19..b0fa0d6 100644
--- a/pkg/front_end/testcases/inference/future_then_6.dart.outline.expect
+++ b/pkg/front_end/testcases/inference/future_then_6.dart.outline.expect
@@ -12,13 +12,13 @@
;
method then<S extends core::Object = dynamic>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError}) → self::MyFuture<self::MyFuture::then::S>
;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("catchError", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#test: test}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("whenComplete", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {() → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {() → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("timeout", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#onTimeout: onTimeout}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("asStream", const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Stream<self::MyFuture::T>;
}
static method test() → void
diff --git a/pkg/front_end/testcases/inference/future_then_6.dart.strong.expect b/pkg/front_end/testcases/inference/future_then_6.dart.strong.expect
index 98b7e61..51ead0d 100644
--- a/pkg/front_end/testcases/inference/future_then_6.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/future_then_6.dart.strong.expect
@@ -12,13 +12,13 @@
return null;
method then<S extends core::Object = dynamic>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
return null;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("catchError", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#test: test}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("whenComplete", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {generic-covariant-impl () → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {generic-covariant-impl () → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("timeout", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#onTimeout: onTimeout}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("asStream", const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Stream<self::MyFuture::T>;
}
static method test() → void {
diff --git a/pkg/front_end/testcases/inference/future_then_6.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/future_then_6.dart.strong.transformed.expect
index 8214748..a13a479 100644
--- a/pkg/front_end/testcases/inference/future_then_6.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/future_then_6.dart.strong.transformed.expect
@@ -12,13 +12,13 @@
return null;
method then<S extends core::Object = dynamic>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
return null;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("catchError", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#test: test}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("whenComplete", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {generic-covariant-impl () → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {generic-covariant-impl () → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("timeout", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#onTimeout: onTimeout}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("asStream", const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Stream<self::MyFuture::T>;
}
static method test() → void {
@@ -40,7 +40,7 @@
:return_value = :result;
break #L1;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
@@ -69,7 +69,7 @@
:return_value = :result;
break #L2;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
@@ -96,7 +96,7 @@
:return_value = 3;
break #L3;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
@@ -123,7 +123,7 @@
:return_value = 3;
break #L4;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
@@ -154,7 +154,7 @@
:return_value = asy::Future::value<core::int>(3);
break #L5;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
@@ -181,7 +181,7 @@
:return_value = asy::Future::value<core::int>(3);
break #L6;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
diff --git a/pkg/front_end/testcases/inference/future_then_conditional.dart.direct.expect b/pkg/front_end/testcases/inference/future_then_conditional.dart.direct.expect
index c81cc0b..acb4972 100644
--- a/pkg/front_end/testcases/inference/future_then_conditional.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/future_then_conditional.dart.direct.expect
@@ -12,13 +12,13 @@
return null;
method then<S extends core::Object = dynamic>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
return null;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("catchError", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#test: test}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("whenComplete", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {() → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {() → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("timeout", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#onTimeout: onTimeout}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("asStream", const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Stream<self::MyFuture::T>;
}
static method test() → void {
diff --git a/pkg/front_end/testcases/inference/future_then_conditional.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/future_then_conditional.dart.direct.transformed.expect
index ee8635c..d719f9c 100644
--- a/pkg/front_end/testcases/inference/future_then_conditional.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/future_then_conditional.dart.direct.transformed.expect
@@ -12,13 +12,13 @@
return null;
method then<S extends core::Object = dynamic>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
return null;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("catchError", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#test: test}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("whenComplete", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {() → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {() → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("timeout", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#onTimeout: onTimeout}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("asStream", const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Stream<self::MyFuture::T>;
}
static method test() → void {
@@ -47,7 +47,7 @@
:return_value = :async_temporary_0;
break #L1;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
@@ -76,7 +76,7 @@
:return_value = :result ? 2 : asy::Future::value<core::int>(3);
break #L2;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
diff --git a/pkg/front_end/testcases/inference/future_then_conditional.dart.outline.expect b/pkg/front_end/testcases/inference/future_then_conditional.dart.outline.expect
index 638eb19..b0fa0d6 100644
--- a/pkg/front_end/testcases/inference/future_then_conditional.dart.outline.expect
+++ b/pkg/front_end/testcases/inference/future_then_conditional.dart.outline.expect
@@ -12,13 +12,13 @@
;
method then<S extends core::Object = dynamic>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError}) → self::MyFuture<self::MyFuture::then::S>
;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("catchError", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#test: test}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("whenComplete", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {() → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {() → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("timeout", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#onTimeout: onTimeout}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("asStream", const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Stream<self::MyFuture::T>;
}
static method test() → void
diff --git a/pkg/front_end/testcases/inference/future_then_conditional.dart.strong.expect b/pkg/front_end/testcases/inference/future_then_conditional.dart.strong.expect
index cd172d7..00aa8c3 100644
--- a/pkg/front_end/testcases/inference/future_then_conditional.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/future_then_conditional.dart.strong.expect
@@ -12,13 +12,13 @@
return null;
method then<S extends core::Object = dynamic>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
return null;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("catchError", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#test: test}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("whenComplete", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {generic-covariant-impl () → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {generic-covariant-impl () → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("timeout", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#onTimeout: onTimeout}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("asStream", const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Stream<self::MyFuture::T>;
}
static method test() → void {
diff --git a/pkg/front_end/testcases/inference/future_then_conditional.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/future_then_conditional.dart.strong.transformed.expect
index 4edac72..b5a19f3 100644
--- a/pkg/front_end/testcases/inference/future_then_conditional.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/future_then_conditional.dart.strong.transformed.expect
@@ -12,13 +12,13 @@
return null;
method then<S extends core::Object = dynamic>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
return null;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("catchError", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#test: test}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("whenComplete", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {generic-covariant-impl () → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {generic-covariant-impl () → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("timeout", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#onTimeout: onTimeout}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("asStream", const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Stream<self::MyFuture::T>;
}
static method test() → void {
@@ -47,7 +47,7 @@
:return_value = :async_temporary_0;
break #L1;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
@@ -76,7 +76,7 @@
:return_value = (:result ?{core::Object} 2 : asy::Future::value<core::int>(3)) as{TypeError} asy::FutureOr<core::int>;
break #L2;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
diff --git a/pkg/front_end/testcases/inference/future_then_conditional_2.dart.direct.expect b/pkg/front_end/testcases/inference/future_then_conditional_2.dart.direct.expect
index 63e39eb..183c863 100644
--- a/pkg/front_end/testcases/inference/future_then_conditional_2.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/future_then_conditional_2.dart.direct.expect
@@ -12,13 +12,13 @@
return null;
method then<S extends core::Object = dynamic>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
return null;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("catchError", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#test: test}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("whenComplete", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {() → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {() → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("timeout", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#onTimeout: onTimeout}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("asStream", const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Stream<self::MyFuture::T>;
}
static method test() → void {
diff --git a/pkg/front_end/testcases/inference/future_then_conditional_2.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/future_then_conditional_2.dart.direct.transformed.expect
index 0d47534..083fe97 100644
--- a/pkg/front_end/testcases/inference/future_then_conditional_2.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/future_then_conditional_2.dart.direct.transformed.expect
@@ -12,13 +12,13 @@
return null;
method then<S extends core::Object = dynamic>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
return null;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("catchError", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#test: test}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("whenComplete", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {() → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {() → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("timeout", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#onTimeout: onTimeout}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("asStream", const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Stream<self::MyFuture::T>;
}
static method test() → void {
@@ -47,7 +47,7 @@
:return_value = :async_temporary_0;
break #L1;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
@@ -76,7 +76,7 @@
:return_value = :result ? 2 : new self::MyFuture::value<core::int>(3);
break #L2;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
diff --git a/pkg/front_end/testcases/inference/future_then_conditional_2.dart.outline.expect b/pkg/front_end/testcases/inference/future_then_conditional_2.dart.outline.expect
index 638eb19..b0fa0d6 100644
--- a/pkg/front_end/testcases/inference/future_then_conditional_2.dart.outline.expect
+++ b/pkg/front_end/testcases/inference/future_then_conditional_2.dart.outline.expect
@@ -12,13 +12,13 @@
;
method then<S extends core::Object = dynamic>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError}) → self::MyFuture<self::MyFuture::then::S>
;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("catchError", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#test: test}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("whenComplete", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {() → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {() → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("timeout", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#onTimeout: onTimeout}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("asStream", const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Stream<self::MyFuture::T>;
}
static method test() → void
diff --git a/pkg/front_end/testcases/inference/future_then_conditional_2.dart.strong.expect b/pkg/front_end/testcases/inference/future_then_conditional_2.dart.strong.expect
index 58fc7dc..dc09b6ed 100644
--- a/pkg/front_end/testcases/inference/future_then_conditional_2.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/future_then_conditional_2.dart.strong.expect
@@ -12,13 +12,13 @@
return null;
method then<S extends core::Object = dynamic>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
return null;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("catchError", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#test: test}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("whenComplete", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {generic-covariant-impl () → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {generic-covariant-impl () → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("timeout", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#onTimeout: onTimeout}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("asStream", const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Stream<self::MyFuture::T>;
}
static method test() → void {
diff --git a/pkg/front_end/testcases/inference/future_then_conditional_2.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/future_then_conditional_2.dart.strong.transformed.expect
index f44cce1..b0dbd8f 100644
--- a/pkg/front_end/testcases/inference/future_then_conditional_2.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/future_then_conditional_2.dart.strong.transformed.expect
@@ -12,13 +12,13 @@
return null;
method then<S extends core::Object = dynamic>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
return null;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("catchError", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#test: test}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("whenComplete", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {generic-covariant-impl () → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {generic-covariant-impl () → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("timeout", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#onTimeout: onTimeout}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("asStream", const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Stream<self::MyFuture::T>;
}
static method test() → void {
@@ -47,7 +47,7 @@
:return_value = :async_temporary_0;
break #L1;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
@@ -76,7 +76,7 @@
:return_value = (:result ?{core::Object} 2 : new self::MyFuture::value<core::int>(3)) as{TypeError} asy::FutureOr<core::int>;
break #L2;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
diff --git a/pkg/front_end/testcases/inference/future_then_conditional_3.dart.direct.expect b/pkg/front_end/testcases/inference/future_then_conditional_3.dart.direct.expect
index 4d5d177..a07382c 100644
--- a/pkg/front_end/testcases/inference/future_then_conditional_3.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/future_then_conditional_3.dart.direct.expect
@@ -12,13 +12,13 @@
return null;
method then<S extends core::Object = dynamic>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
return null;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("catchError", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#test: test}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("whenComplete", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {() → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {() → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("timeout", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#onTimeout: onTimeout}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("asStream", const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Stream<self::MyFuture::T>;
}
static method test() → void {
diff --git a/pkg/front_end/testcases/inference/future_then_conditional_3.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/future_then_conditional_3.dart.direct.transformed.expect
index 1373697..b30a646 100644
--- a/pkg/front_end/testcases/inference/future_then_conditional_3.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/future_then_conditional_3.dart.direct.transformed.expect
@@ -12,13 +12,13 @@
return null;
method then<S extends core::Object = dynamic>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
return null;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("catchError", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#test: test}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("whenComplete", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {() → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {() → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("timeout", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#onTimeout: onTimeout}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("asStream", const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Stream<self::MyFuture::T>;
}
static method test() → void {
@@ -47,7 +47,7 @@
:return_value = :async_temporary_0;
break #L1;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
@@ -76,7 +76,7 @@
:return_value = :result ? 2 : asy::Future::value<core::int>(3);
break #L2;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
diff --git a/pkg/front_end/testcases/inference/future_then_conditional_3.dart.outline.expect b/pkg/front_end/testcases/inference/future_then_conditional_3.dart.outline.expect
index 638eb19..b0fa0d6 100644
--- a/pkg/front_end/testcases/inference/future_then_conditional_3.dart.outline.expect
+++ b/pkg/front_end/testcases/inference/future_then_conditional_3.dart.outline.expect
@@ -12,13 +12,13 @@
;
method then<S extends core::Object = dynamic>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError}) → self::MyFuture<self::MyFuture::then::S>
;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("catchError", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#test: test}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("whenComplete", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {() → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {() → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("timeout", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#onTimeout: onTimeout}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("asStream", const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Stream<self::MyFuture::T>;
}
static method test() → void
diff --git a/pkg/front_end/testcases/inference/future_then_conditional_3.dart.strong.expect b/pkg/front_end/testcases/inference/future_then_conditional_3.dart.strong.expect
index 60b455d..ee71917 100644
--- a/pkg/front_end/testcases/inference/future_then_conditional_3.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/future_then_conditional_3.dart.strong.expect
@@ -12,13 +12,13 @@
return null;
method then<S extends core::Object = dynamic>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
return null;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("catchError", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#test: test}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("whenComplete", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {generic-covariant-impl () → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {generic-covariant-impl () → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("timeout", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#onTimeout: onTimeout}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("asStream", const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Stream<self::MyFuture::T>;
}
static method test() → void {
diff --git a/pkg/front_end/testcases/inference/future_then_conditional_3.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/future_then_conditional_3.dart.strong.transformed.expect
index 15d1ad2..e855e8b 100644
--- a/pkg/front_end/testcases/inference/future_then_conditional_3.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/future_then_conditional_3.dart.strong.transformed.expect
@@ -12,13 +12,13 @@
return null;
method then<S extends core::Object = dynamic>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
return null;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("catchError", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#test: test}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("whenComplete", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {generic-covariant-impl () → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {generic-covariant-impl () → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("timeout", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#onTimeout: onTimeout}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("asStream", const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Stream<self::MyFuture::T>;
}
static method test() → void {
@@ -47,7 +47,7 @@
:return_value = :async_temporary_0;
break #L1;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
@@ -76,7 +76,7 @@
:return_value = (:result ?{core::Object} 2 : asy::Future::value<core::int>(3)) as{TypeError} asy::FutureOr<core::int>;
break #L2;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
diff --git a/pkg/front_end/testcases/inference/future_then_conditional_4.dart.direct.expect b/pkg/front_end/testcases/inference/future_then_conditional_4.dart.direct.expect
index 0e1c731..7e64461 100644
--- a/pkg/front_end/testcases/inference/future_then_conditional_4.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/future_then_conditional_4.dart.direct.expect
@@ -12,13 +12,13 @@
return null;
method then<S extends core::Object = dynamic>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
return null;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("catchError", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#test: test}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("whenComplete", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {() → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {() → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("timeout", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#onTimeout: onTimeout}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("asStream", const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Stream<self::MyFuture::T>;
}
static method test() → void {
diff --git a/pkg/front_end/testcases/inference/future_then_conditional_4.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/future_then_conditional_4.dart.direct.transformed.expect
index f91e051..17b81d3 100644
--- a/pkg/front_end/testcases/inference/future_then_conditional_4.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/future_then_conditional_4.dart.direct.transformed.expect
@@ -12,13 +12,13 @@
return null;
method then<S extends core::Object = dynamic>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
return null;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("catchError", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#test: test}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("whenComplete", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {() → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {() → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("timeout", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#onTimeout: onTimeout}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("asStream", const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Stream<self::MyFuture::T>;
}
static method test() → void {
@@ -47,7 +47,7 @@
:return_value = :async_temporary_0;
break #L1;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
@@ -76,7 +76,7 @@
:return_value = :result ? 2 : new self::MyFuture::value<core::int>(3);
break #L2;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
diff --git a/pkg/front_end/testcases/inference/future_then_conditional_4.dart.outline.expect b/pkg/front_end/testcases/inference/future_then_conditional_4.dart.outline.expect
index 638eb19..b0fa0d6 100644
--- a/pkg/front_end/testcases/inference/future_then_conditional_4.dart.outline.expect
+++ b/pkg/front_end/testcases/inference/future_then_conditional_4.dart.outline.expect
@@ -12,13 +12,13 @@
;
method then<S extends core::Object = dynamic>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError}) → self::MyFuture<self::MyFuture::then::S>
;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("catchError", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#test: test}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("whenComplete", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {() → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {() → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("timeout", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#onTimeout: onTimeout}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("asStream", const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Stream<self::MyFuture::T>;
}
static method test() → void
diff --git a/pkg/front_end/testcases/inference/future_then_conditional_4.dart.strong.expect b/pkg/front_end/testcases/inference/future_then_conditional_4.dart.strong.expect
index 9207e2c..2a51ccc 100644
--- a/pkg/front_end/testcases/inference/future_then_conditional_4.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/future_then_conditional_4.dart.strong.expect
@@ -12,13 +12,13 @@
return null;
method then<S extends core::Object = dynamic>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
return null;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("catchError", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#test: test}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("whenComplete", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {generic-covariant-impl () → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {generic-covariant-impl () → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("timeout", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#onTimeout: onTimeout}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("asStream", const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Stream<self::MyFuture::T>;
}
static method test() → void {
diff --git a/pkg/front_end/testcases/inference/future_then_conditional_4.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/future_then_conditional_4.dart.strong.transformed.expect
index ea24809..b567ae6 100644
--- a/pkg/front_end/testcases/inference/future_then_conditional_4.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/future_then_conditional_4.dart.strong.transformed.expect
@@ -12,13 +12,13 @@
return null;
method then<S extends core::Object = dynamic>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
return null;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("catchError", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#test: test}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("whenComplete", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {generic-covariant-impl () → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {generic-covariant-impl () → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("timeout", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#onTimeout: onTimeout}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("asStream", const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Stream<self::MyFuture::T>;
}
static method test() → void {
@@ -47,7 +47,7 @@
:return_value = :async_temporary_0;
break #L1;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
@@ -76,7 +76,7 @@
:return_value = (:result ?{core::Object} 2 : new self::MyFuture::value<core::int>(3)) as{TypeError} asy::FutureOr<core::int>;
break #L2;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
diff --git a/pkg/front_end/testcases/inference/future_then_conditional_5.dart.direct.expect b/pkg/front_end/testcases/inference/future_then_conditional_5.dart.direct.expect
index 5efa1a5..c6a744d 100644
--- a/pkg/front_end/testcases/inference/future_then_conditional_5.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/future_then_conditional_5.dart.direct.expect
@@ -12,13 +12,13 @@
return null;
method then<S extends core::Object = dynamic>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
return null;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("catchError", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#test: test}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("whenComplete", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {() → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {() → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("timeout", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#onTimeout: onTimeout}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("asStream", const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Stream<self::MyFuture::T>;
}
static method test() → void {
diff --git a/pkg/front_end/testcases/inference/future_then_conditional_5.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/future_then_conditional_5.dart.direct.transformed.expect
index 21cf312..ab4a584 100644
--- a/pkg/front_end/testcases/inference/future_then_conditional_5.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/future_then_conditional_5.dart.direct.transformed.expect
@@ -12,13 +12,13 @@
return null;
method then<S extends core::Object = dynamic>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
return null;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("catchError", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#test: test}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("whenComplete", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {() → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {() → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("timeout", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#onTimeout: onTimeout}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("asStream", const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Stream<self::MyFuture::T>;
}
static method test() → void {
@@ -47,7 +47,7 @@
:return_value = :async_temporary_0;
break #L1;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
@@ -76,7 +76,7 @@
:return_value = :result ? 2 : new self::MyFuture::value<core::int>(3);
break #L2;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
diff --git a/pkg/front_end/testcases/inference/future_then_conditional_5.dart.outline.expect b/pkg/front_end/testcases/inference/future_then_conditional_5.dart.outline.expect
index 638eb19..b0fa0d6 100644
--- a/pkg/front_end/testcases/inference/future_then_conditional_5.dart.outline.expect
+++ b/pkg/front_end/testcases/inference/future_then_conditional_5.dart.outline.expect
@@ -12,13 +12,13 @@
;
method then<S extends core::Object = dynamic>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError}) → self::MyFuture<self::MyFuture::then::S>
;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("catchError", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#test: test}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("whenComplete", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {() → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {() → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("timeout", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#onTimeout: onTimeout}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("asStream", const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Stream<self::MyFuture::T>;
}
static method test() → void
diff --git a/pkg/front_end/testcases/inference/future_then_conditional_5.dart.strong.expect b/pkg/front_end/testcases/inference/future_then_conditional_5.dart.strong.expect
index 4375997..e9f502a 100644
--- a/pkg/front_end/testcases/inference/future_then_conditional_5.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/future_then_conditional_5.dart.strong.expect
@@ -12,13 +12,13 @@
return null;
method then<S extends core::Object = dynamic>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
return null;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("catchError", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#test: test}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("whenComplete", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {generic-covariant-impl () → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {generic-covariant-impl () → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("timeout", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#onTimeout: onTimeout}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("asStream", const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Stream<self::MyFuture::T>;
}
static method test() → void {
diff --git a/pkg/front_end/testcases/inference/future_then_conditional_5.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/future_then_conditional_5.dart.strong.transformed.expect
index e258784..5bd9628 100644
--- a/pkg/front_end/testcases/inference/future_then_conditional_5.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/future_then_conditional_5.dart.strong.transformed.expect
@@ -12,13 +12,13 @@
return null;
method then<S extends core::Object = dynamic>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
return null;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("catchError", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#test: test}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("whenComplete", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {generic-covariant-impl () → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {generic-covariant-impl () → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("timeout", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#onTimeout: onTimeout}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("asStream", const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Stream<self::MyFuture::T>;
}
static method test() → void {
@@ -47,7 +47,7 @@
:return_value = :async_temporary_0;
break #L1;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
@@ -76,7 +76,7 @@
:return_value = (:result ?{core::Object} 2 : new self::MyFuture::value<core::int>(3)) as{TypeError} asy::FutureOr<core::int>;
break #L2;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
diff --git a/pkg/front_end/testcases/inference/future_then_conditional_6.dart.direct.expect b/pkg/front_end/testcases/inference/future_then_conditional_6.dart.direct.expect
index 66fd5b3..0615459 100644
--- a/pkg/front_end/testcases/inference/future_then_conditional_6.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/future_then_conditional_6.dart.direct.expect
@@ -12,13 +12,13 @@
return null;
method then<S extends core::Object = dynamic>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
return null;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("catchError", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#test: test}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("whenComplete", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {() → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {() → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("timeout", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#onTimeout: onTimeout}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("asStream", const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Stream<self::MyFuture::T>;
}
static method test() → void {
diff --git a/pkg/front_end/testcases/inference/future_then_conditional_6.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/future_then_conditional_6.dart.direct.transformed.expect
index 1a49a72..70cb5cb 100644
--- a/pkg/front_end/testcases/inference/future_then_conditional_6.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/future_then_conditional_6.dart.direct.transformed.expect
@@ -12,13 +12,13 @@
return null;
method then<S extends core::Object = dynamic>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
return null;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("catchError", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#test: test}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("whenComplete", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {() → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {() → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("timeout", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#onTimeout: onTimeout}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("asStream", const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Stream<self::MyFuture::T>;
}
static method test() → void {
@@ -47,7 +47,7 @@
:return_value = :async_temporary_0;
break #L1;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
@@ -76,7 +76,7 @@
:return_value = :result ? 2 : asy::Future::value<core::int>(3);
break #L2;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
diff --git a/pkg/front_end/testcases/inference/future_then_conditional_6.dart.outline.expect b/pkg/front_end/testcases/inference/future_then_conditional_6.dart.outline.expect
index 638eb19..b0fa0d6 100644
--- a/pkg/front_end/testcases/inference/future_then_conditional_6.dart.outline.expect
+++ b/pkg/front_end/testcases/inference/future_then_conditional_6.dart.outline.expect
@@ -12,13 +12,13 @@
;
method then<S extends core::Object = dynamic>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError}) → self::MyFuture<self::MyFuture::then::S>
;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("catchError", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#test: test}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("whenComplete", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {() → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {() → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("timeout", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#onTimeout: onTimeout}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("asStream", const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Stream<self::MyFuture::T>;
}
static method test() → void
diff --git a/pkg/front_end/testcases/inference/future_then_conditional_6.dart.strong.expect b/pkg/front_end/testcases/inference/future_then_conditional_6.dart.strong.expect
index af3fa30..4a1b6d5 100644
--- a/pkg/front_end/testcases/inference/future_then_conditional_6.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/future_then_conditional_6.dart.strong.expect
@@ -12,13 +12,13 @@
return null;
method then<S extends core::Object = dynamic>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
return null;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("catchError", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#test: test}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("whenComplete", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {generic-covariant-impl () → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {generic-covariant-impl () → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("timeout", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#onTimeout: onTimeout}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("asStream", const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Stream<self::MyFuture::T>;
}
static method test() → void {
diff --git a/pkg/front_end/testcases/inference/future_then_conditional_6.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/future_then_conditional_6.dart.strong.transformed.expect
index a172c81..03e6d37 100644
--- a/pkg/front_end/testcases/inference/future_then_conditional_6.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/future_then_conditional_6.dart.strong.transformed.expect
@@ -12,13 +12,13 @@
return null;
method then<S extends core::Object = dynamic>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
return null;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("catchError", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#test: test}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("whenComplete", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {generic-covariant-impl () → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {generic-covariant-impl () → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("timeout", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#onTimeout: onTimeout}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("asStream", const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Stream<self::MyFuture::T>;
}
static method test() → void {
@@ -47,7 +47,7 @@
:return_value = :async_temporary_0;
break #L1;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
@@ -76,7 +76,7 @@
:return_value = (:result ?{core::Object} 2 : asy::Future::value<core::int>(3)) as{TypeError} asy::FutureOr<core::int>;
break #L2;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
diff --git a/pkg/front_end/testcases/inference/future_then_ifNull.dart.direct.expect b/pkg/front_end/testcases/inference/future_then_ifNull.dart.direct.expect
index 5d21b4b..86006fe 100644
--- a/pkg/front_end/testcases/inference/future_then_ifNull.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/future_then_ifNull.dart.direct.expect
@@ -12,13 +12,13 @@
return null;
method then<S extends core::Object = dynamic>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
return null;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("catchError", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#test: test}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("whenComplete", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {() → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {() → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("timeout", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#onTimeout: onTimeout}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("asStream", const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Stream<self::MyFuture::T>;
}
static method test() → void {
diff --git a/pkg/front_end/testcases/inference/future_then_ifNull.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/future_then_ifNull.dart.direct.transformed.expect
index e67586a..35c1205 100644
--- a/pkg/front_end/testcases/inference/future_then_ifNull.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/future_then_ifNull.dart.direct.transformed.expect
@@ -12,13 +12,13 @@
return null;
method then<S extends core::Object = dynamic>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
return null;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("catchError", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#test: test}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("whenComplete", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {() → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {() → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("timeout", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#onTimeout: onTimeout}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("asStream", const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Stream<self::MyFuture::T>;
}
static method test() → void {
@@ -48,7 +48,7 @@
:return_value = :async_temporary_0;
break #L1;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
@@ -77,7 +77,7 @@
:return_value = let final dynamic #t4 = :result in #t4.==(null) ? asy::Future::value<core::int>(3) : #t4;
break #L2;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
diff --git a/pkg/front_end/testcases/inference/future_then_ifNull.dart.outline.expect b/pkg/front_end/testcases/inference/future_then_ifNull.dart.outline.expect
index 638eb19..b0fa0d6 100644
--- a/pkg/front_end/testcases/inference/future_then_ifNull.dart.outline.expect
+++ b/pkg/front_end/testcases/inference/future_then_ifNull.dart.outline.expect
@@ -12,13 +12,13 @@
;
method then<S extends core::Object = dynamic>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError}) → self::MyFuture<self::MyFuture::then::S>
;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("catchError", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#test: test}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("whenComplete", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {() → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {() → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("timeout", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#onTimeout: onTimeout}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("asStream", const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Stream<self::MyFuture::T>;
}
static method test() → void
diff --git a/pkg/front_end/testcases/inference/future_then_ifNull.dart.strong.expect b/pkg/front_end/testcases/inference/future_then_ifNull.dart.strong.expect
index 1eddb4a..7b7ff73 100644
--- a/pkg/front_end/testcases/inference/future_then_ifNull.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/future_then_ifNull.dart.strong.expect
@@ -12,13 +12,13 @@
return null;
method then<S extends core::Object = dynamic>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
return null;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("catchError", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#test: test}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("whenComplete", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {generic-covariant-impl () → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {generic-covariant-impl () → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("timeout", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#onTimeout: onTimeout}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("asStream", const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Stream<self::MyFuture::T>;
}
static method test() → void {
diff --git a/pkg/front_end/testcases/inference/future_then_ifNull.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/future_then_ifNull.dart.strong.transformed.expect
index 871bcf6..c1cd7d1 100644
--- a/pkg/front_end/testcases/inference/future_then_ifNull.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/future_then_ifNull.dart.strong.transformed.expect
@@ -12,13 +12,13 @@
return null;
method then<S extends core::Object = dynamic>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
return null;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("catchError", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#test: test}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("whenComplete", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {generic-covariant-impl () → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {generic-covariant-impl () → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("timeout", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#onTimeout: onTimeout}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("asStream", const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Stream<self::MyFuture::T>;
}
static method test() → void {
@@ -48,7 +48,7 @@
:return_value = :async_temporary_0;
break #L1;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
@@ -77,7 +77,7 @@
:return_value = (let final core::int #t4 = :result in #t4.==(null) ?{core::Object} asy::Future::value<core::int>(3) : #t4) as{TypeError} asy::FutureOr<core::int>;
break #L2;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
diff --git a/pkg/front_end/testcases/inference/future_then_upwards.dart.direct.expect b/pkg/front_end/testcases/inference/future_then_upwards.dart.direct.expect
index 4d6cabd7..408a87b 100644
--- a/pkg/front_end/testcases/inference/future_then_upwards.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/future_then_upwards.dart.direct.expect
@@ -12,13 +12,13 @@
return null;
method then<S extends core::Object = dynamic>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
return null;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("catchError", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#test: test}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("whenComplete", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {() → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {() → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("timeout", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#onTimeout: onTimeout}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("asStream", const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Stream<self::MyFuture::T>;
}
static method main() → void {
diff --git a/pkg/front_end/testcases/inference/future_then_upwards.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/future_then_upwards.dart.direct.transformed.expect
index 4d6cabd7..408a87b 100644
--- a/pkg/front_end/testcases/inference/future_then_upwards.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/future_then_upwards.dart.direct.transformed.expect
@@ -12,13 +12,13 @@
return null;
method then<S extends core::Object = dynamic>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
return null;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("catchError", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#test: test}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("whenComplete", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {() → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {() → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("timeout", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#onTimeout: onTimeout}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("asStream", const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Stream<self::MyFuture::T>;
}
static method main() → void {
diff --git a/pkg/front_end/testcases/inference/future_then_upwards.dart.outline.expect b/pkg/front_end/testcases/inference/future_then_upwards.dart.outline.expect
index c63fbb8..2b9a12e 100644
--- a/pkg/front_end/testcases/inference/future_then_upwards.dart.outline.expect
+++ b/pkg/front_end/testcases/inference/future_then_upwards.dart.outline.expect
@@ -12,13 +12,13 @@
;
method then<S extends core::Object = dynamic>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError}) → self::MyFuture<self::MyFuture::then::S>
;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("catchError", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#test: test}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("whenComplete", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {() → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {() → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("timeout", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#onTimeout: onTimeout}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("asStream", const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Stream<self::MyFuture::T>;
}
static method main() → void
diff --git a/pkg/front_end/testcases/inference/future_then_upwards.dart.strong.expect b/pkg/front_end/testcases/inference/future_then_upwards.dart.strong.expect
index f7bfb3c..8c13443 100644
--- a/pkg/front_end/testcases/inference/future_then_upwards.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/future_then_upwards.dart.strong.expect
@@ -12,13 +12,13 @@
return null;
method then<S extends core::Object = dynamic>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
return null;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("catchError", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#test: test}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("whenComplete", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {generic-covariant-impl () → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {generic-covariant-impl () → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("timeout", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#onTimeout: onTimeout}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("asStream", const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Stream<self::MyFuture::T>;
}
static method main() → void {
diff --git a/pkg/front_end/testcases/inference/future_then_upwards.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/future_then_upwards.dart.strong.transformed.expect
index 4a8c037..cb35f21 100644
--- a/pkg/front_end/testcases/inference/future_then_upwards.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/future_then_upwards.dart.strong.transformed.expect
@@ -12,13 +12,13 @@
return null;
method then<S extends core::Object = dynamic>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
return null;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("catchError", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#test: test}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("whenComplete", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {generic-covariant-impl () → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {generic-covariant-impl () → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("timeout", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#onTimeout: onTimeout}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("asStream", const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Stream<self::MyFuture::T>;
}
static method main() → void {
diff --git a/pkg/front_end/testcases/inference/future_then_upwards_2.dart.direct.expect b/pkg/front_end/testcases/inference/future_then_upwards_2.dart.direct.expect
index dcb5ae3..6d6d090 100644
--- a/pkg/front_end/testcases/inference/future_then_upwards_2.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/future_then_upwards_2.dart.direct.expect
@@ -12,13 +12,13 @@
return null;
method then<S extends core::Object = dynamic>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
return null;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("catchError", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#test: test}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("whenComplete", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {() → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {() → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("timeout", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#onTimeout: onTimeout}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("asStream", const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Stream<self::MyFuture::T>;
}
static method main() → void {
diff --git a/pkg/front_end/testcases/inference/future_then_upwards_2.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/future_then_upwards_2.dart.direct.transformed.expect
index dcb5ae3..6d6d090 100644
--- a/pkg/front_end/testcases/inference/future_then_upwards_2.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/future_then_upwards_2.dart.direct.transformed.expect
@@ -12,13 +12,13 @@
return null;
method then<S extends core::Object = dynamic>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
return null;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("catchError", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#test: test}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("whenComplete", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {() → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {() → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("timeout", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#onTimeout: onTimeout}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("asStream", const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Stream<self::MyFuture::T>;
}
static method main() → void {
diff --git a/pkg/front_end/testcases/inference/future_then_upwards_2.dart.outline.expect b/pkg/front_end/testcases/inference/future_then_upwards_2.dart.outline.expect
index c63fbb8..2b9a12e 100644
--- a/pkg/front_end/testcases/inference/future_then_upwards_2.dart.outline.expect
+++ b/pkg/front_end/testcases/inference/future_then_upwards_2.dart.outline.expect
@@ -12,13 +12,13 @@
;
method then<S extends core::Object = dynamic>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError}) → self::MyFuture<self::MyFuture::then::S>
;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("catchError", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#test: test}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("whenComplete", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {() → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {() → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("timeout", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#onTimeout: onTimeout}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("asStream", const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Stream<self::MyFuture::T>;
}
static method main() → void
diff --git a/pkg/front_end/testcases/inference/future_then_upwards_2.dart.strong.expect b/pkg/front_end/testcases/inference/future_then_upwards_2.dart.strong.expect
index cb171bf..5983869 100644
--- a/pkg/front_end/testcases/inference/future_then_upwards_2.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/future_then_upwards_2.dart.strong.expect
@@ -12,13 +12,13 @@
return null;
method then<S extends core::Object = dynamic>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
return null;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("catchError", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#test: test}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("whenComplete", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {generic-covariant-impl () → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {generic-covariant-impl () → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("timeout", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#onTimeout: onTimeout}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("asStream", const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Stream<self::MyFuture::T>;
}
static method main() → void {
diff --git a/pkg/front_end/testcases/inference/future_then_upwards_2.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/future_then_upwards_2.dart.strong.transformed.expect
index b432115..9f06517 100644
--- a/pkg/front_end/testcases/inference/future_then_upwards_2.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/future_then_upwards_2.dart.strong.transformed.expect
@@ -12,13 +12,13 @@
return null;
method then<S extends core::Object = dynamic>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
return null;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("catchError", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#test: test}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("whenComplete", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {generic-covariant-impl () → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {generic-covariant-impl () → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("timeout", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#onTimeout: onTimeout}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("asStream", const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Stream<self::MyFuture::T>;
}
static method main() → void {
diff --git a/pkg/front_end/testcases/inference/future_then_upwards_3.dart.direct.expect b/pkg/front_end/testcases/inference/future_then_upwards_3.dart.direct.expect
index 994012f..fab1bd1 100644
--- a/pkg/front_end/testcases/inference/future_then_upwards_3.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/future_then_upwards_3.dart.direct.expect
@@ -12,13 +12,13 @@
return null;
method then<S extends core::Object = dynamic>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
return null;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("catchError", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#test: test}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("whenComplete", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {() → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {() → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("timeout", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#onTimeout: onTimeout}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("asStream", const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Stream<self::MyFuture::T>;
}
static method test() → void {
diff --git a/pkg/front_end/testcases/inference/future_then_upwards_3.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/future_then_upwards_3.dart.direct.transformed.expect
index 994012f..fab1bd1 100644
--- a/pkg/front_end/testcases/inference/future_then_upwards_3.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/future_then_upwards_3.dart.direct.transformed.expect
@@ -12,13 +12,13 @@
return null;
method then<S extends core::Object = dynamic>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
return null;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("catchError", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#test: test}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("whenComplete", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {() → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {() → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("timeout", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#onTimeout: onTimeout}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("asStream", const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Stream<self::MyFuture::T>;
}
static method test() → void {
diff --git a/pkg/front_end/testcases/inference/future_then_upwards_3.dart.outline.expect b/pkg/front_end/testcases/inference/future_then_upwards_3.dart.outline.expect
index cfcba8d..b369931 100644
--- a/pkg/front_end/testcases/inference/future_then_upwards_3.dart.outline.expect
+++ b/pkg/front_end/testcases/inference/future_then_upwards_3.dart.outline.expect
@@ -12,13 +12,13 @@
;
method then<S extends core::Object = dynamic>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError}) → self::MyFuture<self::MyFuture::then::S>
;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("catchError", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#test: test}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("whenComplete", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {() → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {() → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("timeout", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#onTimeout: onTimeout}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("asStream", const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Stream<self::MyFuture::T>;
}
static method test() → void
diff --git a/pkg/front_end/testcases/inference/future_then_upwards_3.dart.strong.expect b/pkg/front_end/testcases/inference/future_then_upwards_3.dart.strong.expect
index deb54c1..a6d1069 100644
--- a/pkg/front_end/testcases/inference/future_then_upwards_3.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/future_then_upwards_3.dart.strong.expect
@@ -12,13 +12,13 @@
return null;
method then<S extends core::Object = dynamic>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
return null;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("catchError", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#test: test}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("whenComplete", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {generic-covariant-impl () → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {generic-covariant-impl () → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("timeout", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#onTimeout: onTimeout}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("asStream", const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Stream<self::MyFuture::T>;
}
static method test() → void {
diff --git a/pkg/front_end/testcases/inference/future_then_upwards_3.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/future_then_upwards_3.dart.strong.transformed.expect
index 94a7c5e..dbc1f64 100644
--- a/pkg/front_end/testcases/inference/future_then_upwards_3.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/future_then_upwards_3.dart.strong.transformed.expect
@@ -12,13 +12,13 @@
return null;
method then<S extends core::Object = dynamic>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
return null;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("catchError", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#test: test}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("whenComplete", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {generic-covariant-impl () → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {generic-covariant-impl () → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("timeout", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#onTimeout: onTimeout}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("asStream", const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Stream<self::MyFuture::T>;
}
static method test() → void {
diff --git a/pkg/front_end/testcases/inference/future_union_async_conditional.dart.direct.expect b/pkg/front_end/testcases/inference/future_union_async_conditional.dart.direct.expect
index 81cd117..73eda84 100644
--- a/pkg/front_end/testcases/inference/future_union_async_conditional.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/future_union_async_conditional.dart.direct.expect
@@ -12,13 +12,13 @@
return null;
method then<S extends core::Object = dynamic>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
return null;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("catchError", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#test: test}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("whenComplete", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {() → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {() → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("timeout", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#onTimeout: onTimeout}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("asStream", const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Stream<self::MyFuture::T>;
}
static method g1(core::bool x) → asy::Future<core::int> async {
diff --git a/pkg/front_end/testcases/inference/future_union_async_conditional.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/future_union_async_conditional.dart.direct.transformed.expect
index 41c4879..d241179 100644
--- a/pkg/front_end/testcases/inference/future_union_async_conditional.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/future_union_async_conditional.dart.direct.transformed.expect
@@ -12,13 +12,13 @@
return null;
method then<S extends core::Object = dynamic>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
return null;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("catchError", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#test: test}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("whenComplete", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {() → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {() → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("timeout", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#onTimeout: onTimeout}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("asStream", const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Stream<self::MyFuture::T>;
}
static method g1(core::bool x) → asy::Future<core::int> /* originally async */ {
@@ -36,7 +36,7 @@
:return_value = x ? 42 : asy::Future::value<dynamic>(42);
break #L1;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
@@ -63,7 +63,7 @@
:return_value = x ? 42 : asy::Future::value<dynamic>(42);
break #L2;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
@@ -91,7 +91,7 @@
:return_value = y;
break #L3;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
diff --git a/pkg/front_end/testcases/inference/future_union_async_conditional.dart.outline.expect b/pkg/front_end/testcases/inference/future_union_async_conditional.dart.outline.expect
index d6eb3cf..67eb302 100644
--- a/pkg/front_end/testcases/inference/future_union_async_conditional.dart.outline.expect
+++ b/pkg/front_end/testcases/inference/future_union_async_conditional.dart.outline.expect
@@ -12,13 +12,13 @@
;
method then<S extends core::Object = dynamic>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError}) → self::MyFuture<self::MyFuture::then::S>
;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("catchError", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#test: test}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("whenComplete", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {() → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {() → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("timeout", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#onTimeout: onTimeout}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("asStream", const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Stream<self::MyFuture::T>;
}
static method g1(core::bool x) → asy::Future<core::int>
diff --git a/pkg/front_end/testcases/inference/future_union_async_conditional.dart.strong.expect b/pkg/front_end/testcases/inference/future_union_async_conditional.dart.strong.expect
index 360051f..9c411e0 100644
--- a/pkg/front_end/testcases/inference/future_union_async_conditional.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/future_union_async_conditional.dart.strong.expect
@@ -12,13 +12,13 @@
return null;
method then<S extends core::Object = dynamic>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
return null;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("catchError", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#test: test}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("whenComplete", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {generic-covariant-impl () → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {generic-covariant-impl () → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("timeout", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#onTimeout: onTimeout}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("asStream", const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Stream<self::MyFuture::T>;
}
static method g1(core::bool x) → asy::Future<core::int> async {
diff --git a/pkg/front_end/testcases/inference/future_union_async_conditional.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/future_union_async_conditional.dart.strong.transformed.expect
index c5b890a..7e67e3e 100644
--- a/pkg/front_end/testcases/inference/future_union_async_conditional.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/future_union_async_conditional.dart.strong.transformed.expect
@@ -12,13 +12,13 @@
return null;
method then<S extends core::Object = dynamic>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
return null;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("catchError", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#test: test}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("whenComplete", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {generic-covariant-impl () → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {generic-covariant-impl () → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("timeout", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#onTimeout: onTimeout}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("asStream", const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Stream<self::MyFuture::T>;
}
static method g1(core::bool x) → asy::Future<core::int> /* originally async */ {
@@ -36,7 +36,7 @@
:return_value = (x ?{core::Object} 42 : asy::Future::value<core::int>(42)) as{TypeError} asy::FutureOr<core::int>;
break #L1;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
@@ -63,7 +63,7 @@
:return_value = (x ?{core::Object} 42 : asy::Future::value<core::int>(42)) as{TypeError} asy::FutureOr<core::int>;
break #L2;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
@@ -91,7 +91,7 @@
:return_value = y as{TypeError} asy::FutureOr<core::int>;
break #L3;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
diff --git a/pkg/front_end/testcases/inference/future_union_async_conditional_2.dart.direct.expect b/pkg/front_end/testcases/inference/future_union_async_conditional_2.dart.direct.expect
index 696d941..5813341 100644
--- a/pkg/front_end/testcases/inference/future_union_async_conditional_2.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/future_union_async_conditional_2.dart.direct.expect
@@ -12,13 +12,13 @@
return null;
method then<S extends core::Object = dynamic>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
return null;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("catchError", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#test: test}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("whenComplete", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {() → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {() → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("timeout", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#onTimeout: onTimeout}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("asStream", const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Stream<self::MyFuture::T>;
}
static method g1(core::bool x) → asy::Future<core::int> async {
diff --git a/pkg/front_end/testcases/inference/future_union_async_conditional_2.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/future_union_async_conditional_2.dart.direct.transformed.expect
index 4d30bd8..22664e5 100644
--- a/pkg/front_end/testcases/inference/future_union_async_conditional_2.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/future_union_async_conditional_2.dart.direct.transformed.expect
@@ -12,13 +12,13 @@
return null;
method then<S extends core::Object = dynamic>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
return null;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("catchError", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#test: test}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("whenComplete", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {() → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {() → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("timeout", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#onTimeout: onTimeout}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("asStream", const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Stream<self::MyFuture::T>;
}
static method g1(core::bool x) → asy::Future<core::int> /* originally async */ {
@@ -36,7 +36,7 @@
:return_value = x ? 42 : new self::MyFuture::value<dynamic>(42);
break #L1;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
@@ -63,7 +63,7 @@
:return_value = x ? 42 : new self::MyFuture::value<dynamic>(42);
break #L2;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
@@ -91,7 +91,7 @@
:return_value = y;
break #L3;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
diff --git a/pkg/front_end/testcases/inference/future_union_async_conditional_2.dart.outline.expect b/pkg/front_end/testcases/inference/future_union_async_conditional_2.dart.outline.expect
index d6eb3cf..67eb302 100644
--- a/pkg/front_end/testcases/inference/future_union_async_conditional_2.dart.outline.expect
+++ b/pkg/front_end/testcases/inference/future_union_async_conditional_2.dart.outline.expect
@@ -12,13 +12,13 @@
;
method then<S extends core::Object = dynamic>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError}) → self::MyFuture<self::MyFuture::then::S>
;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("catchError", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#test: test}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("whenComplete", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {() → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {() → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("timeout", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#onTimeout: onTimeout}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("asStream", const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Stream<self::MyFuture::T>;
}
static method g1(core::bool x) → asy::Future<core::int>
diff --git a/pkg/front_end/testcases/inference/future_union_async_conditional_2.dart.strong.expect b/pkg/front_end/testcases/inference/future_union_async_conditional_2.dart.strong.expect
index 27f64bd..009b806 100644
--- a/pkg/front_end/testcases/inference/future_union_async_conditional_2.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/future_union_async_conditional_2.dart.strong.expect
@@ -12,13 +12,13 @@
return null;
method then<S extends core::Object = dynamic>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
return null;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("catchError", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#test: test}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("whenComplete", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {generic-covariant-impl () → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {generic-covariant-impl () → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("timeout", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#onTimeout: onTimeout}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("asStream", const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Stream<self::MyFuture::T>;
}
static method g1(core::bool x) → asy::Future<core::int> async {
diff --git a/pkg/front_end/testcases/inference/future_union_async_conditional_2.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/future_union_async_conditional_2.dart.strong.transformed.expect
index 3e881c5..2364ba5 100644
--- a/pkg/front_end/testcases/inference/future_union_async_conditional_2.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/future_union_async_conditional_2.dart.strong.transformed.expect
@@ -12,13 +12,13 @@
return null;
method then<S extends core::Object = dynamic>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
return null;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("catchError", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#test: test}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("whenComplete", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {generic-covariant-impl () → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {generic-covariant-impl () → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("timeout", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#onTimeout: onTimeout}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("asStream", const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Stream<self::MyFuture::T>;
}
static method g1(core::bool x) → asy::Future<core::int> /* originally async */ {
@@ -36,7 +36,7 @@
:return_value = (x ?{core::Object} 42 : new self::MyFuture::value<core::int>(42)) as{TypeError} asy::FutureOr<core::int>;
break #L1;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
@@ -63,7 +63,7 @@
:return_value = (x ?{core::Object} 42 : new self::MyFuture::value<core::int>(42)) as{TypeError} asy::FutureOr<core::int>;
break #L2;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
@@ -91,7 +91,7 @@
:return_value = y as{TypeError} asy::FutureOr<core::int>;
break #L3;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
diff --git a/pkg/front_end/testcases/inference/future_union_downwards.dart.direct.expect b/pkg/front_end/testcases/inference/future_union_downwards.dart.direct.expect
index eb9e275..06bf63e 100644
--- a/pkg/front_end/testcases/inference/future_union_downwards.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/future_union_downwards.dart.direct.expect
@@ -12,13 +12,13 @@
return null;
method then<S extends core::Object = dynamic>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
return null;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("catchError", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#test: test}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("whenComplete", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {() → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {() → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("timeout", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#onTimeout: onTimeout}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("asStream", const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Stream<self::MyFuture::T>;
}
static field self::MyFuture<dynamic> f;
diff --git a/pkg/front_end/testcases/inference/future_union_downwards.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/future_union_downwards.dart.direct.transformed.expect
index 9c55b25..4679555 100644
--- a/pkg/front_end/testcases/inference/future_union_downwards.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/future_union_downwards.dart.direct.transformed.expect
@@ -12,13 +12,13 @@
return null;
method then<S extends core::Object = dynamic>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
return null;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("catchError", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#test: test}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("whenComplete", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {() → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {() → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("timeout", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#onTimeout: onTimeout}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("asStream", const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Stream<self::MyFuture::T>;
}
static field self::MyFuture<dynamic> f;
@@ -39,7 +39,7 @@
:return_value = <dynamic>[3];
break #L1;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
@@ -66,7 +66,7 @@
:return_value = asy::Future::value<dynamic>(<dynamic>[3]);
break #L2;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
diff --git a/pkg/front_end/testcases/inference/future_union_downwards.dart.outline.expect b/pkg/front_end/testcases/inference/future_union_downwards.dart.outline.expect
index 8fbf742..e0c10ee 100644
--- a/pkg/front_end/testcases/inference/future_union_downwards.dart.outline.expect
+++ b/pkg/front_end/testcases/inference/future_union_downwards.dart.outline.expect
@@ -12,13 +12,13 @@
;
method then<S extends core::Object = dynamic>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError}) → self::MyFuture<self::MyFuture::then::S>
;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("catchError", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#test: test}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("whenComplete", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {() → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {() → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("timeout", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#onTimeout: onTimeout}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("asStream", const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Stream<self::MyFuture::T>;
}
static field self::MyFuture<dynamic> f;
diff --git a/pkg/front_end/testcases/inference/future_union_downwards.dart.strong.expect b/pkg/front_end/testcases/inference/future_union_downwards.dart.strong.expect
index be2d944..908b887 100644
--- a/pkg/front_end/testcases/inference/future_union_downwards.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/future_union_downwards.dart.strong.expect
@@ -12,13 +12,13 @@
return null;
method then<S extends core::Object = dynamic>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
return null;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("catchError", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#test: test}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("whenComplete", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {generic-covariant-impl () → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {generic-covariant-impl () → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("timeout", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#onTimeout: onTimeout}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("asStream", const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Stream<self::MyFuture::T>;
}
static field self::MyFuture<dynamic> f;
diff --git a/pkg/front_end/testcases/inference/future_union_downwards.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/future_union_downwards.dart.strong.transformed.expect
index f8b69c0..0e3d51c 100644
--- a/pkg/front_end/testcases/inference/future_union_downwards.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/future_union_downwards.dart.strong.transformed.expect
@@ -12,13 +12,13 @@
return null;
method then<S extends core::Object = dynamic>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
return null;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("catchError", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#test: test}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("whenComplete", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {generic-covariant-impl () → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {generic-covariant-impl () → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("timeout", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#onTimeout: onTimeout}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("asStream", const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Stream<self::MyFuture::T>;
}
static field self::MyFuture<dynamic> f;
@@ -42,7 +42,7 @@
:return_value = <core::int>[3];
break #L1;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
@@ -69,7 +69,7 @@
:return_value = asy::Future::value<core::List<core::int>>(<core::int>[3]);
break #L2;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
diff --git a/pkg/front_end/testcases/inference/future_union_downwards_2.dart.direct.expect b/pkg/front_end/testcases/inference/future_union_downwards_2.dart.direct.expect
index 88065da..df02c93 100644
--- a/pkg/front_end/testcases/inference/future_union_downwards_2.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/future_union_downwards_2.dart.direct.expect
@@ -12,13 +12,13 @@
return null;
method then<S extends core::Object = dynamic>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
return null;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("catchError", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#test: test}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("whenComplete", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {() → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {() → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("timeout", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#onTimeout: onTimeout}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("asStream", const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Stream<self::MyFuture::T>;
}
static field self::MyFuture<dynamic> f;
diff --git a/pkg/front_end/testcases/inference/future_union_downwards_2.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/future_union_downwards_2.dart.direct.transformed.expect
index 8311768..ffc06b6 100644
--- a/pkg/front_end/testcases/inference/future_union_downwards_2.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/future_union_downwards_2.dart.direct.transformed.expect
@@ -12,13 +12,13 @@
return null;
method then<S extends core::Object = dynamic>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
return null;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("catchError", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#test: test}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("whenComplete", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {() → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {() → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("timeout", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#onTimeout: onTimeout}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("asStream", const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Stream<self::MyFuture::T>;
}
static field self::MyFuture<dynamic> f;
@@ -39,7 +39,7 @@
:return_value = <dynamic>[3];
break #L1;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
@@ -66,7 +66,7 @@
:return_value = new self::MyFuture::value<dynamic>(<dynamic>[3]);
break #L2;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
diff --git a/pkg/front_end/testcases/inference/future_union_downwards_2.dart.outline.expect b/pkg/front_end/testcases/inference/future_union_downwards_2.dart.outline.expect
index 8fbf742..e0c10ee 100644
--- a/pkg/front_end/testcases/inference/future_union_downwards_2.dart.outline.expect
+++ b/pkg/front_end/testcases/inference/future_union_downwards_2.dart.outline.expect
@@ -12,13 +12,13 @@
;
method then<S extends core::Object = dynamic>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError}) → self::MyFuture<self::MyFuture::then::S>
;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("catchError", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#test: test}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("whenComplete", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {() → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {() → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("timeout", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#onTimeout: onTimeout}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("asStream", const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Stream<self::MyFuture::T>;
}
static field self::MyFuture<dynamic> f;
diff --git a/pkg/front_end/testcases/inference/future_union_downwards_2.dart.strong.expect b/pkg/front_end/testcases/inference/future_union_downwards_2.dart.strong.expect
index bf7763d..f004a8c 100644
--- a/pkg/front_end/testcases/inference/future_union_downwards_2.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/future_union_downwards_2.dart.strong.expect
@@ -12,13 +12,13 @@
return null;
method then<S extends core::Object = dynamic>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
return null;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("catchError", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#test: test}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("whenComplete", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {generic-covariant-impl () → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {generic-covariant-impl () → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("timeout", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#onTimeout: onTimeout}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("asStream", const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Stream<self::MyFuture::T>;
}
static field self::MyFuture<dynamic> f;
diff --git a/pkg/front_end/testcases/inference/future_union_downwards_2.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/future_union_downwards_2.dart.strong.transformed.expect
index c6eedda..a28d6f1 100644
--- a/pkg/front_end/testcases/inference/future_union_downwards_2.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/future_union_downwards_2.dart.strong.transformed.expect
@@ -12,13 +12,13 @@
return null;
method then<S extends core::Object = dynamic>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
return null;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("catchError", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#test: test}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("whenComplete", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {generic-covariant-impl () → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {generic-covariant-impl () → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("timeout", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#onTimeout: onTimeout}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("asStream", const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Stream<self::MyFuture::T>;
}
static field self::MyFuture<dynamic> f;
@@ -39,7 +39,7 @@
:return_value = <core::int>[3];
break #L1;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
@@ -66,7 +66,7 @@
:return_value = new self::MyFuture::value<core::List<core::int>>(<core::int>[3]);
break #L2;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
diff --git a/pkg/front_end/testcases/inference/future_union_downwards_3.dart.direct.expect b/pkg/front_end/testcases/inference/future_union_downwards_3.dart.direct.expect
index 55b480f..02133a2 100644
--- a/pkg/front_end/testcases/inference/future_union_downwards_3.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/future_union_downwards_3.dart.direct.expect
@@ -12,13 +12,13 @@
return null;
method then<S extends core::Object = dynamic>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
return null;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("catchError", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#test: test}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("whenComplete", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {() → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {() → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("timeout", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#onTimeout: onTimeout}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("asStream", const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Stream<self::MyFuture::T>;
}
static field asy::Future<dynamic> f;
diff --git a/pkg/front_end/testcases/inference/future_union_downwards_3.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/future_union_downwards_3.dart.direct.transformed.expect
index d310fa8..79133de 100644
--- a/pkg/front_end/testcases/inference/future_union_downwards_3.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/future_union_downwards_3.dart.direct.transformed.expect
@@ -12,13 +12,13 @@
return null;
method then<S extends core::Object = dynamic>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
return null;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("catchError", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#test: test}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("whenComplete", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {() → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {() → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("timeout", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#onTimeout: onTimeout}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("asStream", const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Stream<self::MyFuture::T>;
}
static field asy::Future<dynamic> f;
@@ -39,7 +39,7 @@
:return_value = <dynamic>[3];
break #L1;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
@@ -66,7 +66,7 @@
:return_value = asy::Future::value<dynamic>(<dynamic>[3]);
break #L2;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
diff --git a/pkg/front_end/testcases/inference/future_union_downwards_3.dart.outline.expect b/pkg/front_end/testcases/inference/future_union_downwards_3.dart.outline.expect
index 08527e8..46b6924 100644
--- a/pkg/front_end/testcases/inference/future_union_downwards_3.dart.outline.expect
+++ b/pkg/front_end/testcases/inference/future_union_downwards_3.dart.outline.expect
@@ -12,13 +12,13 @@
;
method then<S extends core::Object = dynamic>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError}) → self::MyFuture<self::MyFuture::then::S>
;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("catchError", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#test: test}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("whenComplete", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {() → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {() → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("timeout", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#onTimeout: onTimeout}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("asStream", const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Stream<self::MyFuture::T>;
}
static field asy::Future<dynamic> f;
diff --git a/pkg/front_end/testcases/inference/future_union_downwards_3.dart.strong.expect b/pkg/front_end/testcases/inference/future_union_downwards_3.dart.strong.expect
index 15b6f24..4c8b6d0 100644
--- a/pkg/front_end/testcases/inference/future_union_downwards_3.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/future_union_downwards_3.dart.strong.expect
@@ -12,13 +12,13 @@
return null;
method then<S extends core::Object = dynamic>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
return null;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("catchError", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#test: test}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("whenComplete", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {generic-covariant-impl () → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {generic-covariant-impl () → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("timeout", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#onTimeout: onTimeout}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("asStream", const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Stream<self::MyFuture::T>;
}
static field asy::Future<dynamic> f;
diff --git a/pkg/front_end/testcases/inference/future_union_downwards_3.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/future_union_downwards_3.dart.strong.transformed.expect
index 3d87abf..6e2fe1d 100644
--- a/pkg/front_end/testcases/inference/future_union_downwards_3.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/future_union_downwards_3.dart.strong.transformed.expect
@@ -12,13 +12,13 @@
return null;
method then<S extends core::Object = dynamic>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
return null;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("catchError", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#test: test}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("whenComplete", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {generic-covariant-impl () → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {generic-covariant-impl () → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("timeout", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#onTimeout: onTimeout}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("asStream", const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Stream<self::MyFuture::T>;
}
static field asy::Future<dynamic> f;
@@ -42,7 +42,7 @@
:return_value = <core::int>[3];
break #L1;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
@@ -69,7 +69,7 @@
:return_value = asy::Future::value<core::List<core::int>>(<core::int>[3]);
break #L2;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
diff --git a/pkg/front_end/testcases/inference/future_union_downwards_4.dart.direct.expect b/pkg/front_end/testcases/inference/future_union_downwards_4.dart.direct.expect
index 5ec4bdd..4959b52 100644
--- a/pkg/front_end/testcases/inference/future_union_downwards_4.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/future_union_downwards_4.dart.direct.expect
@@ -12,13 +12,13 @@
return null;
method then<S extends core::Object = dynamic>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
return null;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("catchError", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#test: test}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("whenComplete", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {() → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {() → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("timeout", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#onTimeout: onTimeout}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("asStream", const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Stream<self::MyFuture::T>;
}
static field asy::Future<dynamic> f;
diff --git a/pkg/front_end/testcases/inference/future_union_downwards_4.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/future_union_downwards_4.dart.direct.transformed.expect
index 5b25967..46d0456 100644
--- a/pkg/front_end/testcases/inference/future_union_downwards_4.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/future_union_downwards_4.dart.direct.transformed.expect
@@ -12,13 +12,13 @@
return null;
method then<S extends core::Object = dynamic>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
return null;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("catchError", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#test: test}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("whenComplete", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {() → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {() → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("timeout", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#onTimeout: onTimeout}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("asStream", const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Stream<self::MyFuture::T>;
}
static field asy::Future<dynamic> f;
@@ -39,7 +39,7 @@
:return_value = <dynamic>[3];
break #L1;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
@@ -66,7 +66,7 @@
:return_value = new self::MyFuture::value<dynamic>(<dynamic>[3]);
break #L2;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
diff --git a/pkg/front_end/testcases/inference/future_union_downwards_4.dart.outline.expect b/pkg/front_end/testcases/inference/future_union_downwards_4.dart.outline.expect
index 08527e8..46b6924 100644
--- a/pkg/front_end/testcases/inference/future_union_downwards_4.dart.outline.expect
+++ b/pkg/front_end/testcases/inference/future_union_downwards_4.dart.outline.expect
@@ -12,13 +12,13 @@
;
method then<S extends core::Object = dynamic>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError}) → self::MyFuture<self::MyFuture::then::S>
;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("catchError", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#test: test}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("whenComplete", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {() → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {() → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("timeout", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#onTimeout: onTimeout}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("asStream", const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Stream<self::MyFuture::T>;
}
static field asy::Future<dynamic> f;
diff --git a/pkg/front_end/testcases/inference/future_union_downwards_4.dart.strong.expect b/pkg/front_end/testcases/inference/future_union_downwards_4.dart.strong.expect
index d06ad27..79238fb 100644
--- a/pkg/front_end/testcases/inference/future_union_downwards_4.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/future_union_downwards_4.dart.strong.expect
@@ -12,13 +12,13 @@
return null;
method then<S extends core::Object = dynamic>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
return null;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("catchError", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#test: test}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("whenComplete", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {generic-covariant-impl () → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {generic-covariant-impl () → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("timeout", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#onTimeout: onTimeout}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("asStream", const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Stream<self::MyFuture::T>;
}
static field asy::Future<dynamic> f;
diff --git a/pkg/front_end/testcases/inference/future_union_downwards_4.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/future_union_downwards_4.dart.strong.transformed.expect
index 39403ea..df0ef2e 100644
--- a/pkg/front_end/testcases/inference/future_union_downwards_4.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/future_union_downwards_4.dart.strong.transformed.expect
@@ -12,13 +12,13 @@
return null;
method then<S extends core::Object = dynamic>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
return null;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ catchError(core::Function onError, {(core::Object) → core::bool test = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("catchError", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[onError]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#test: test}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ whenComplete(() → asy::FutureOr<dynamic> action) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("whenComplete", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[action]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {generic-covariant-impl () → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ timeout(core::Duration timeLimit, {generic-covariant-impl () → asy::FutureOr<self::MyFuture::T> onTimeout = null}) → asy::Future<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("timeout", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[timeLimit]), core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#onTimeout: onTimeout}), false)) as{TypeError} asy::Future<self::MyFuture::T>;
- no-such-method-forwarder method /* from org-dartlang-testcase-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
+ no-such-method-forwarder method /* from org-dartlang-sdk:///sdk/lib/async/future.dart */ asStream() → asy::Stream<self::MyFuture::T>
return this.{self::MyFuture::noSuchMethod}(new core::_InvocationMirror::_withoutType("asStream", const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} asy::Stream<self::MyFuture::T>;
}
static field asy::Future<dynamic> f;
@@ -39,7 +39,7 @@
:return_value = <core::int>[3];
break #L1;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
@@ -66,7 +66,7 @@
:return_value = new self::MyFuture::value<core::List<core::int>>(<core::int>[3]);
break #L2;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
diff --git a/pkg/front_end/testcases/inference/future_union_downwards_generic_method_with_future_return.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/future_union_downwards_generic_method_with_future_return.dart.direct.transformed.expect
index a702c69..89b8af9 100644
--- a/pkg/front_end/testcases/inference/future_union_downwards_generic_method_with_future_return.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/future_union_downwards_generic_method_with_future_return.dart.direct.transformed.expect
@@ -26,7 +26,7 @@
[yield] let dynamic #t1 = asy::_awaitHelper(asy::Future::wait<dynamic>(<dynamic>[f1, f2]), :async_op_then, :async_op_error, :async_op) in null;
core::List<core::List<self::A>> merged = :result;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
diff --git a/pkg/front_end/testcases/inference/future_union_downwards_generic_method_with_future_return.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/future_union_downwards_generic_method_with_future_return.dart.strong.transformed.expect
index 5491836..1bc6ed6 100644
--- a/pkg/front_end/testcases/inference/future_union_downwards_generic_method_with_future_return.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/future_union_downwards_generic_method_with_future_return.dart.strong.transformed.expect
@@ -26,7 +26,7 @@
[yield] let dynamic #t1 = asy::_awaitHelper(asy::Future::wait<core::List<self::A>>(<asy::Future<core::List<self::A>>>[f1, f2]), :async_op_then, :async_op_error, :async_op) in null;
core::List<core::List<self::A>> merged = :result;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
diff --git a/pkg/front_end/testcases/inference/future_union_downwards_generic_method_with_generic_return.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/future_union_downwards_generic_method_with_generic_return.dart.direct.transformed.expect
index 767567e..6b4820f 100644
--- a/pkg/front_end/testcases/inference/future_union_downwards_generic_method_with_generic_return.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/future_union_downwards_generic_method_with_generic_return.dart.direct.transformed.expect
@@ -22,7 +22,7 @@
[yield] let dynamic #t1 = asy::_awaitHelper(self::id<dynamic>(f), :async_op_then, :async_op_error, :async_op) in null;
core::String s = :result;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
diff --git a/pkg/front_end/testcases/inference/future_union_downwards_generic_method_with_generic_return.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/future_union_downwards_generic_method_with_generic_return.dart.strong.transformed.expect
index 96f60cf..8a4ec7e 100644
--- a/pkg/front_end/testcases/inference/future_union_downwards_generic_method_with_generic_return.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/future_union_downwards_generic_method_with_generic_return.dart.strong.transformed.expect
@@ -22,7 +22,7 @@
[yield] let dynamic #t1 = asy::_awaitHelper(self::id<asy::FutureOr<core::String>>(f), :async_op_then, :async_op_error, :async_op) in null;
core::String s = :result;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
diff --git a/pkg/front_end/testcases/inference/future_union_upwards_generic_methods.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/future_union_upwards_generic_methods.dart.direct.transformed.expect
index 9be5e89..7bc149c 100644
--- a/pkg/front_end/testcases/inference/future_union_upwards_generic_methods.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/future_union_upwards_generic_methods.dart.direct.transformed.expect
@@ -41,7 +41,7 @@
core::List<self::A> list = result;
list = result2;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
diff --git a/pkg/front_end/testcases/inference/future_union_upwards_generic_methods.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/future_union_upwards_generic_methods.dart.strong.transformed.expect
index bb72272..e202cf1 100644
--- a/pkg/front_end/testcases/inference/future_union_upwards_generic_methods.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/future_union_upwards_generic_methods.dart.strong.transformed.expect
@@ -41,7 +41,7 @@
core::List<self::A> list = result;
list = result2;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
diff --git a/pkg/front_end/testcases/inference/infer_local_function_return_type.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/infer_local_function_return_type.dart.direct.transformed.expect
index 7a13cb2..8f11c53 100644
--- a/pkg/front_end/testcases/inference/infer_local_function_return_type.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/infer_local_function_return_type.dart.direct.transformed.expect
@@ -21,7 +21,7 @@
:return_value = 42;
break #L1;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
@@ -51,7 +51,7 @@
:return_value = 42;
break #L2;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
diff --git a/pkg/front_end/testcases/inference/infer_local_function_return_type.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/infer_local_function_return_type.dart.strong.transformed.expect
index a090131..a71e197 100644
--- a/pkg/front_end/testcases/inference/infer_local_function_return_type.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/infer_local_function_return_type.dart.strong.transformed.expect
@@ -21,7 +21,7 @@
:return_value = 42;
break #L1;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
@@ -51,7 +51,7 @@
:return_value = 42;
break #L2;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
diff --git a/pkg/front_end/testcases/inference/infer_types_on_loop_indices_for_each_loop_async.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/infer_types_on_loop_indices_for_each_loop_async.dart.direct.transformed.expect
index 9b911b8..9bc5243 100644
--- a/pkg/front_end/testcases/inference/infer_types_on_loop_indices_for_each_loop_async.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/infer_types_on_loop_indices_for_each_loop_async.dart.direct.transformed.expect
@@ -51,7 +51,7 @@
}
}
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
@@ -107,7 +107,7 @@
}
}
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
@@ -294,7 +294,7 @@
}
}
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
diff --git a/pkg/front_end/testcases/inference/infer_types_on_loop_indices_for_each_loop_async.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/infer_types_on_loop_indices_for_each_loop_async.dart.strong.transformed.expect
index 616b08d..f191019 100644
--- a/pkg/front_end/testcases/inference/infer_types_on_loop_indices_for_each_loop_async.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/infer_types_on_loop_indices_for_each_loop_async.dart.strong.transformed.expect
@@ -54,7 +54,7 @@
}
}
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
@@ -113,7 +113,7 @@
}
}
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
@@ -312,7 +312,7 @@
}
}
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
diff --git a/pkg/front_end/testcases/inference/local_return_and_yield.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/local_return_and_yield.dart.direct.transformed.expect
index f151285..cac84f7 100644
--- a/pkg/front_end/testcases/inference/local_return_and_yield.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/local_return_and_yield.dart.direct.transformed.expect
@@ -23,7 +23,7 @@
:return_value = (dynamic x) → dynamic => x;
break #L1;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
diff --git a/pkg/front_end/testcases/inference/local_return_and_yield.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/local_return_and_yield.dart.strong.transformed.expect
index 2155171..35ec8f6 100644
--- a/pkg/front_end/testcases/inference/local_return_and_yield.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/local_return_and_yield.dart.strong.transformed.expect
@@ -26,7 +26,7 @@
^" in let final (dynamic) → dynamic #t2 = (dynamic x) → dynamic => x in null;
break #L1;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
diff --git a/pkg/front_end/testcases/inference/top_level_return_and_yield.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/top_level_return_and_yield.dart.direct.transformed.expect
index 129d552..c5d9f81 100644
--- a/pkg/front_end/testcases/inference/top_level_return_and_yield.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/top_level_return_and_yield.dart.direct.transformed.expect
@@ -22,7 +22,7 @@
:return_value = (dynamic x) → dynamic => x;
break #L1;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
diff --git a/pkg/front_end/testcases/inference/top_level_return_and_yield.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/top_level_return_and_yield.dart.strong.transformed.expect
index 684b488..1fd4183 100644
--- a/pkg/front_end/testcases/inference/top_level_return_and_yield.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/top_level_return_and_yield.dart.strong.transformed.expect
@@ -25,7 +25,7 @@
^" in let final (dynamic) → dynamic #t2 = (dynamic x) → dynamic => x in null;
break #L1;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
diff --git a/pkg/front_end/testcases/inference_new/for_each_invalid_iterable.dart.direct.transformed.expect b/pkg/front_end/testcases/inference_new/for_each_invalid_iterable.dart.direct.transformed.expect
index 2b3bdf6..a4cbada 100644
--- a/pkg/front_end/testcases/inference_new/for_each_invalid_iterable.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference_new/for_each_invalid_iterable.dart.direct.transformed.expect
@@ -67,7 +67,7 @@
}
}
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
diff --git a/pkg/front_end/testcases/inference_new/for_each_invalid_iterable.dart.strong.transformed.expect b/pkg/front_end/testcases/inference_new/for_each_invalid_iterable.dart.strong.transformed.expect
index 3357d37..475b64a 100644
--- a/pkg/front_end/testcases/inference_new/for_each_invalid_iterable.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference_new/for_each_invalid_iterable.dart.strong.transformed.expect
@@ -82,7 +82,7 @@
}
}
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
diff --git a/pkg/front_end/testcases/inference_new/for_each_outer_var_type.dart.direct.transformed.expect b/pkg/front_end/testcases/inference_new/for_each_outer_var_type.dart.direct.transformed.expect
index b82a06f..e2faaa8 100644
--- a/pkg/front_end/testcases/inference_new/for_each_outer_var_type.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference_new/for_each_outer_var_type.dart.direct.transformed.expect
@@ -133,7 +133,7 @@
}
}
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
diff --git a/pkg/front_end/testcases/inference_new/for_each_outer_var_type.dart.strong.transformed.expect b/pkg/front_end/testcases/inference_new/for_each_outer_var_type.dart.strong.transformed.expect
index 24cf8c0..399a9d4 100644
--- a/pkg/front_end/testcases/inference_new/for_each_outer_var_type.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference_new/for_each_outer_var_type.dart.strong.transformed.expect
@@ -139,7 +139,7 @@
}
}
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
diff --git a/pkg/front_end/testcases/no_such_method_forwarders/default_argument_values.dart b/pkg/front_end/testcases/no_such_method_forwarders/default_argument_values.dart
new file mode 100644
index 0000000..a4fb653
--- /dev/null
+++ b/pkg/front_end/testcases/no_such_method_forwarders/default_argument_values.dart
@@ -0,0 +1,40 @@
+// Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+// This test checks that the default argument values of noSuchMethod forwarder
+// parameters are passed to noSuchMethod when the corresponding arguments aren't
+// specified at the call site.
+
+abstract class A {
+ noSuchMethod(Invocation i) {
+ if (i.memberName == #foo) {
+ return i.namedArguments[#bar];
+ } else if (i.memberName == #hest) {
+ return i.positionalArguments[0];
+ }
+ return null;
+ }
+
+ // These shouldn't be turned into a noSuchMethod forwarder, because the
+ // enclosing class is abstract.
+ String foo({String bar = "baz"});
+ int hest([int fisk = 42]);
+}
+
+class B extends A {
+ // [B] should receive the noSuchMethod forwarders for [A.foo] and [A.hest],
+ // and the default argument values in them should be passed into the
+ // constructor of [Invocation].
+}
+
+main() {
+ B b = new B();
+ dynamic value;
+ if ((value = b.foo()) != "baz") {
+ throw "Unexpected value: '$value'; expected 'baz'.";
+ }
+ if ((value = b.hest()) != 42) {
+ throw "Unexpected value: '$value'; expected '42'.";
+ }
+}
diff --git a/pkg/front_end/testcases/no_such_method_forwarders/default_argument_values.dart.direct.expect b/pkg/front_end/testcases/no_such_method_forwarders/default_argument_values.dart.direct.expect
new file mode 100644
index 0000000..2be3542
--- /dev/null
+++ b/pkg/front_end/testcases/no_such_method_forwarders/default_argument_values.dart.direct.expect
@@ -0,0 +1,40 @@
+library;
+import self as self;
+import "dart:core" as core;
+
+abstract class A extends core::Object {
+ synthetic constructor •() → void
+ : super core::Object::•()
+ ;
+ method noSuchMethod(core::Invocation i) → dynamic {
+ if(i.memberName.==(#foo)) {
+ return i.namedArguments.[](#bar);
+ }
+ else
+ if(i.memberName.==(#hest)) {
+ return i.positionalArguments.[](0);
+ }
+ return null;
+ }
+ abstract method foo({core::String bar = "baz"}) → core::String;
+ abstract method hest([core::int fisk = 42]) → core::int;
+}
+class B extends self::A {
+ synthetic constructor •() → void
+ : super self::A::•()
+ ;
+ no-such-method-forwarder method foo({core::String bar = "baz"}) → core::String
+ return this.{self::A::noSuchMethod}(new core::_InvocationMirror::_withoutType("foo", const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#bar: bar}), false)) as{TypeError} core::String;
+ no-such-method-forwarder method hest([core::int fisk = 42]) → core::int
+ return this.{self::A::noSuchMethod}(new core::_InvocationMirror::_withoutType("hest", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[fisk]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} core::int;
+}
+static method main() → dynamic {
+ self::B b = new self::B::•();
+ dynamic value;
+ if(!(value = b.foo()).==("baz")) {
+ throw "Unexpected value: '${value}'; expected 'baz'.";
+ }
+ if(!(value = b.hest()).==(42)) {
+ throw "Unexpected value: '${value}'; expected '42'.";
+ }
+}
diff --git a/pkg/front_end/testcases/no_such_method_forwarders/default_argument_values.dart.direct.transformed.expect b/pkg/front_end/testcases/no_such_method_forwarders/default_argument_values.dart.direct.transformed.expect
new file mode 100644
index 0000000..2be3542
--- /dev/null
+++ b/pkg/front_end/testcases/no_such_method_forwarders/default_argument_values.dart.direct.transformed.expect
@@ -0,0 +1,40 @@
+library;
+import self as self;
+import "dart:core" as core;
+
+abstract class A extends core::Object {
+ synthetic constructor •() → void
+ : super core::Object::•()
+ ;
+ method noSuchMethod(core::Invocation i) → dynamic {
+ if(i.memberName.==(#foo)) {
+ return i.namedArguments.[](#bar);
+ }
+ else
+ if(i.memberName.==(#hest)) {
+ return i.positionalArguments.[](0);
+ }
+ return null;
+ }
+ abstract method foo({core::String bar = "baz"}) → core::String;
+ abstract method hest([core::int fisk = 42]) → core::int;
+}
+class B extends self::A {
+ synthetic constructor •() → void
+ : super self::A::•()
+ ;
+ no-such-method-forwarder method foo({core::String bar = "baz"}) → core::String
+ return this.{self::A::noSuchMethod}(new core::_InvocationMirror::_withoutType("foo", const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#bar: bar}), false)) as{TypeError} core::String;
+ no-such-method-forwarder method hest([core::int fisk = 42]) → core::int
+ return this.{self::A::noSuchMethod}(new core::_InvocationMirror::_withoutType("hest", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[fisk]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} core::int;
+}
+static method main() → dynamic {
+ self::B b = new self::B::•();
+ dynamic value;
+ if(!(value = b.foo()).==("baz")) {
+ throw "Unexpected value: '${value}'; expected 'baz'.";
+ }
+ if(!(value = b.hest()).==(42)) {
+ throw "Unexpected value: '${value}'; expected '42'.";
+ }
+}
diff --git a/pkg/front_end/testcases/no_such_method_forwarders/default_argument_values.dart.outline.expect b/pkg/front_end/testcases/no_such_method_forwarders/default_argument_values.dart.outline.expect
new file mode 100644
index 0000000..ff0e80e
--- /dev/null
+++ b/pkg/front_end/testcases/no_such_method_forwarders/default_argument_values.dart.outline.expect
@@ -0,0 +1,22 @@
+library;
+import self as self;
+import "dart:core" as core;
+
+abstract class A extends core::Object {
+ synthetic constructor •() → void
+ ;
+ method noSuchMethod(core::Invocation i) → dynamic
+ ;
+ abstract method foo({core::String bar}) → core::String;
+ abstract method hest([core::int fisk]) → core::int;
+}
+class B extends self::A {
+ synthetic constructor •() → void
+ ;
+ no-such-method-forwarder method foo({core::String bar}) → core::String
+ return this.{self::A::noSuchMethod}(new core::_InvocationMirror::_withoutType("foo", const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#bar: bar}), false)) as{TypeError} core::String;
+ no-such-method-forwarder method hest([core::int fisk]) → core::int
+ return this.{self::A::noSuchMethod}(new core::_InvocationMirror::_withoutType("hest", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[fisk]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} core::int;
+}
+static method main() → dynamic
+ ;
diff --git a/pkg/front_end/testcases/no_such_method_forwarders/default_argument_values.dart.strong.expect b/pkg/front_end/testcases/no_such_method_forwarders/default_argument_values.dart.strong.expect
new file mode 100644
index 0000000..13822b5
--- /dev/null
+++ b/pkg/front_end/testcases/no_such_method_forwarders/default_argument_values.dart.strong.expect
@@ -0,0 +1,40 @@
+library;
+import self as self;
+import "dart:core" as core;
+
+abstract class A extends core::Object {
+ synthetic constructor •() → void
+ : super core::Object::•()
+ ;
+ method noSuchMethod(core::Invocation i) → dynamic {
+ if(i.{core::Invocation::memberName}.{core::Symbol::==}(#foo)) {
+ return i.{core::Invocation::namedArguments}.{core::Map::[]}(#bar);
+ }
+ else
+ if(i.{core::Invocation::memberName}.{core::Symbol::==}(#hest)) {
+ return i.{core::Invocation::positionalArguments}.{core::List::[]}(0);
+ }
+ return null;
+ }
+ abstract method foo({core::String bar = "baz"}) → core::String;
+ abstract method hest([core::int fisk = 42]) → core::int;
+}
+class B extends self::A {
+ synthetic constructor •() → void
+ : super self::A::•()
+ ;
+ no-such-method-forwarder method foo({core::String bar = "baz"}) → core::String
+ return this.{self::A::noSuchMethod}(new core::_InvocationMirror::_withoutType("foo", const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#bar: bar}), false)) as{TypeError} core::String;
+ no-such-method-forwarder method hest([core::int fisk = 42]) → core::int
+ return this.{self::A::noSuchMethod}(new core::_InvocationMirror::_withoutType("hest", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[fisk]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} core::int;
+}
+static method main() → dynamic {
+ self::B b = new self::B::•();
+ dynamic value;
+ if(!(value = b.{self::B::foo}()).{core::String::==}("baz")) {
+ throw "Unexpected value: '${value}'; expected 'baz'.";
+ }
+ if(!(value = b.{self::B::hest}()).{core::num::==}(42)) {
+ throw "Unexpected value: '${value}'; expected '42'.";
+ }
+}
diff --git a/pkg/front_end/testcases/no_such_method_forwarders/default_argument_values.dart.strong.transformed.expect b/pkg/front_end/testcases/no_such_method_forwarders/default_argument_values.dart.strong.transformed.expect
new file mode 100644
index 0000000..13822b5
--- /dev/null
+++ b/pkg/front_end/testcases/no_such_method_forwarders/default_argument_values.dart.strong.transformed.expect
@@ -0,0 +1,40 @@
+library;
+import self as self;
+import "dart:core" as core;
+
+abstract class A extends core::Object {
+ synthetic constructor •() → void
+ : super core::Object::•()
+ ;
+ method noSuchMethod(core::Invocation i) → dynamic {
+ if(i.{core::Invocation::memberName}.{core::Symbol::==}(#foo)) {
+ return i.{core::Invocation::namedArguments}.{core::Map::[]}(#bar);
+ }
+ else
+ if(i.{core::Invocation::memberName}.{core::Symbol::==}(#hest)) {
+ return i.{core::Invocation::positionalArguments}.{core::List::[]}(0);
+ }
+ return null;
+ }
+ abstract method foo({core::String bar = "baz"}) → core::String;
+ abstract method hest([core::int fisk = 42]) → core::int;
+}
+class B extends self::A {
+ synthetic constructor •() → void
+ : super self::A::•()
+ ;
+ no-such-method-forwarder method foo({core::String bar = "baz"}) → core::String
+ return this.{self::A::noSuchMethod}(new core::_InvocationMirror::_withoutType("foo", const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(<core::Symbol, dynamic>{#bar: bar}), false)) as{TypeError} core::String;
+ no-such-method-forwarder method hest([core::int fisk = 42]) → core::int
+ return this.{self::A::noSuchMethod}(new core::_InvocationMirror::_withoutType("hest", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[fisk]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} core::int;
+}
+static method main() → dynamic {
+ self::B b = new self::B::•();
+ dynamic value;
+ if(!(value = b.{self::B::foo}()).{core::String::==}("baz")) {
+ throw "Unexpected value: '${value}'; expected 'baz'.";
+ }
+ if(!(value = b.{self::B::hest}()).{core::num::==}(42)) {
+ throw "Unexpected value: '${value}'; expected '42'.";
+ }
+}
diff --git a/pkg/front_end/testcases/no_such_method_forwarders/duplicated_abstract_method.dart b/pkg/front_end/testcases/no_such_method_forwarders/duplicated_abstract_method.dart
new file mode 100644
index 0000000..615578d
--- /dev/null
+++ b/pkg/front_end/testcases/no_such_method_forwarders/duplicated_abstract_method.dart
@@ -0,0 +1,21 @@
+// Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+// This test checks that only one noSuchMethod forwarder is generated in case of
+// multiple abstract methods with the same signature being declared in the
+// implemented interfaces.
+
+abstract class I1 {
+ void foo();
+}
+
+abstract class I2 {
+ void foo();
+}
+
+class M implements I1, I2 {
+ dynamic noSuchMethod(Invocation i) => null;
+}
+
+main() {}
diff --git a/pkg/front_end/testcases/no_such_method_forwarders/duplicated_abstract_method.dart.direct.expect b/pkg/front_end/testcases/no_such_method_forwarders/duplicated_abstract_method.dart.direct.expect
new file mode 100644
index 0000000..5243e2d
--- /dev/null
+++ b/pkg/front_end/testcases/no_such_method_forwarders/duplicated_abstract_method.dart.direct.expect
@@ -0,0 +1,26 @@
+library;
+import self as self;
+import "dart:core" as core;
+
+abstract class I1 extends core::Object {
+ synthetic constructor •() → void
+ : super core::Object::•()
+ ;
+ abstract method foo() → void;
+}
+abstract class I2 extends core::Object {
+ synthetic constructor •() → void
+ : super core::Object::•()
+ ;
+ abstract method foo() → void;
+}
+class M extends core::Object implements self::I1, self::I2 {
+ synthetic constructor •() → void
+ : super core::Object::•()
+ ;
+ method noSuchMethod(core::Invocation i) → dynamic
+ return null;
+ no-such-method-forwarder method foo() → void
+ return this.{self::M::noSuchMethod}(new core::_InvocationMirror::_withoutType("foo", const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false));
+}
+static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/no_such_method_forwarders/duplicated_abstract_method.dart.direct.transformed.expect b/pkg/front_end/testcases/no_such_method_forwarders/duplicated_abstract_method.dart.direct.transformed.expect
new file mode 100644
index 0000000..5243e2d
--- /dev/null
+++ b/pkg/front_end/testcases/no_such_method_forwarders/duplicated_abstract_method.dart.direct.transformed.expect
@@ -0,0 +1,26 @@
+library;
+import self as self;
+import "dart:core" as core;
+
+abstract class I1 extends core::Object {
+ synthetic constructor •() → void
+ : super core::Object::•()
+ ;
+ abstract method foo() → void;
+}
+abstract class I2 extends core::Object {
+ synthetic constructor •() → void
+ : super core::Object::•()
+ ;
+ abstract method foo() → void;
+}
+class M extends core::Object implements self::I1, self::I2 {
+ synthetic constructor •() → void
+ : super core::Object::•()
+ ;
+ method noSuchMethod(core::Invocation i) → dynamic
+ return null;
+ no-such-method-forwarder method foo() → void
+ return this.{self::M::noSuchMethod}(new core::_InvocationMirror::_withoutType("foo", const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false));
+}
+static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/no_such_method_forwarders/duplicated_abstract_method.dart.outline.expect b/pkg/front_end/testcases/no_such_method_forwarders/duplicated_abstract_method.dart.outline.expect
new file mode 100644
index 0000000..c95a42f
--- /dev/null
+++ b/pkg/front_end/testcases/no_such_method_forwarders/duplicated_abstract_method.dart.outline.expect
@@ -0,0 +1,24 @@
+library;
+import self as self;
+import "dart:core" as core;
+
+abstract class I1 extends core::Object {
+ synthetic constructor •() → void
+ ;
+ abstract method foo() → void;
+}
+abstract class I2 extends core::Object {
+ synthetic constructor •() → void
+ ;
+ abstract method foo() → void;
+}
+class M extends core::Object implements self::I1, self::I2 {
+ synthetic constructor •() → void
+ ;
+ method noSuchMethod(core::Invocation i) → dynamic
+ ;
+ no-such-method-forwarder method foo() → void
+ return this.{self::M::noSuchMethod}(new core::_InvocationMirror::_withoutType("foo", const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false));
+}
+static method main() → dynamic
+ ;
diff --git a/pkg/front_end/testcases/no_such_method_forwarders/duplicated_abstract_method.dart.strong.expect b/pkg/front_end/testcases/no_such_method_forwarders/duplicated_abstract_method.dart.strong.expect
new file mode 100644
index 0000000..5243e2d
--- /dev/null
+++ b/pkg/front_end/testcases/no_such_method_forwarders/duplicated_abstract_method.dart.strong.expect
@@ -0,0 +1,26 @@
+library;
+import self as self;
+import "dart:core" as core;
+
+abstract class I1 extends core::Object {
+ synthetic constructor •() → void
+ : super core::Object::•()
+ ;
+ abstract method foo() → void;
+}
+abstract class I2 extends core::Object {
+ synthetic constructor •() → void
+ : super core::Object::•()
+ ;
+ abstract method foo() → void;
+}
+class M extends core::Object implements self::I1, self::I2 {
+ synthetic constructor •() → void
+ : super core::Object::•()
+ ;
+ method noSuchMethod(core::Invocation i) → dynamic
+ return null;
+ no-such-method-forwarder method foo() → void
+ return this.{self::M::noSuchMethod}(new core::_InvocationMirror::_withoutType("foo", const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false));
+}
+static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/no_such_method_forwarders/duplicated_abstract_method.dart.strong.transformed.expect b/pkg/front_end/testcases/no_such_method_forwarders/duplicated_abstract_method.dart.strong.transformed.expect
new file mode 100644
index 0000000..5243e2d
--- /dev/null
+++ b/pkg/front_end/testcases/no_such_method_forwarders/duplicated_abstract_method.dart.strong.transformed.expect
@@ -0,0 +1,26 @@
+library;
+import self as self;
+import "dart:core" as core;
+
+abstract class I1 extends core::Object {
+ synthetic constructor •() → void
+ : super core::Object::•()
+ ;
+ abstract method foo() → void;
+}
+abstract class I2 extends core::Object {
+ synthetic constructor •() → void
+ : super core::Object::•()
+ ;
+ abstract method foo() → void;
+}
+class M extends core::Object implements self::I1, self::I2 {
+ synthetic constructor •() → void
+ : super core::Object::•()
+ ;
+ method noSuchMethod(core::Invocation i) → dynamic
+ return null;
+ no-such-method-forwarder method foo() → void
+ return this.{self::M::noSuchMethod}(new core::_InvocationMirror::_withoutType("foo", const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false));
+}
+static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/no_such_method_forwarders/setter_not_shadowed_by_method.dart b/pkg/front_end/testcases/no_such_method_forwarders/setter_not_shadowed_by_method.dart
new file mode 100644
index 0000000..66cd4cf
--- /dev/null
+++ b/pkg/front_end/testcases/no_such_method_forwarders/setter_not_shadowed_by_method.dart
@@ -0,0 +1,17 @@
+// Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+// The test checks that the abstract setter is not shadowed by a method with the
+// same name when generating the noSuchMethod forwarder for the setter.
+
+class A {
+ // This method is not abstract.
+ void foo(int x) {}
+
+ void set foo(int x);
+
+ dynamic noSuchMethod(Invocation i) => null;
+}
+
+main() {}
diff --git a/pkg/front_end/testcases/no_such_method_forwarders/setter_not_shadowed_by_method.dart.direct.expect b/pkg/front_end/testcases/no_such_method_forwarders/setter_not_shadowed_by_method.dart.direct.expect
new file mode 100644
index 0000000..081ba63
--- /dev/null
+++ b/pkg/front_end/testcases/no_such_method_forwarders/setter_not_shadowed_by_method.dart.direct.expect
@@ -0,0 +1,15 @@
+library;
+import self as self;
+import "dart:core" as core;
+
+class A extends core::Object {
+ synthetic constructor •() → void
+ : super core::Object::•()
+ ;
+ method foo(core::int x) → void {}
+ no-such-method-forwarder set foo(core::int x) → void
+ return this.{self::A::noSuchMethod}(new core::_InvocationMirror::_withoutType("set:foo", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[x]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false));
+ method noSuchMethod(core::Invocation i) → dynamic
+ return null;
+}
+static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/no_such_method_forwarders/setter_not_shadowed_by_method.dart.direct.transformed.expect b/pkg/front_end/testcases/no_such_method_forwarders/setter_not_shadowed_by_method.dart.direct.transformed.expect
new file mode 100644
index 0000000..081ba63
--- /dev/null
+++ b/pkg/front_end/testcases/no_such_method_forwarders/setter_not_shadowed_by_method.dart.direct.transformed.expect
@@ -0,0 +1,15 @@
+library;
+import self as self;
+import "dart:core" as core;
+
+class A extends core::Object {
+ synthetic constructor •() → void
+ : super core::Object::•()
+ ;
+ method foo(core::int x) → void {}
+ no-such-method-forwarder set foo(core::int x) → void
+ return this.{self::A::noSuchMethod}(new core::_InvocationMirror::_withoutType("set:foo", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[x]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false));
+ method noSuchMethod(core::Invocation i) → dynamic
+ return null;
+}
+static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/no_such_method_forwarders/setter_not_shadowed_by_method.dart.outline.expect b/pkg/front_end/testcases/no_such_method_forwarders/setter_not_shadowed_by_method.dart.outline.expect
new file mode 100644
index 0000000..f4edc47
--- /dev/null
+++ b/pkg/front_end/testcases/no_such_method_forwarders/setter_not_shadowed_by_method.dart.outline.expect
@@ -0,0 +1,16 @@
+library;
+import self as self;
+import "dart:core" as core;
+
+class A extends core::Object {
+ synthetic constructor •() → void
+ ;
+ method foo(core::int x) → void
+ ;
+ no-such-method-forwarder set foo(core::int x) → void
+ return this.{self::A::noSuchMethod}(new core::_InvocationMirror::_withoutType("set:foo", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[x]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false));
+ method noSuchMethod(core::Invocation i) → dynamic
+ ;
+}
+static method main() → dynamic
+ ;
diff --git a/pkg/front_end/testcases/no_such_method_forwarders/setter_not_shadowed_by_method.dart.strong.expect b/pkg/front_end/testcases/no_such_method_forwarders/setter_not_shadowed_by_method.dart.strong.expect
new file mode 100644
index 0000000..081ba63
--- /dev/null
+++ b/pkg/front_end/testcases/no_such_method_forwarders/setter_not_shadowed_by_method.dart.strong.expect
@@ -0,0 +1,15 @@
+library;
+import self as self;
+import "dart:core" as core;
+
+class A extends core::Object {
+ synthetic constructor •() → void
+ : super core::Object::•()
+ ;
+ method foo(core::int x) → void {}
+ no-such-method-forwarder set foo(core::int x) → void
+ return this.{self::A::noSuchMethod}(new core::_InvocationMirror::_withoutType("set:foo", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[x]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false));
+ method noSuchMethod(core::Invocation i) → dynamic
+ return null;
+}
+static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/no_such_method_forwarders/setter_not_shadowed_by_method.dart.strong.transformed.expect b/pkg/front_end/testcases/no_such_method_forwarders/setter_not_shadowed_by_method.dart.strong.transformed.expect
new file mode 100644
index 0000000..081ba63
--- /dev/null
+++ b/pkg/front_end/testcases/no_such_method_forwarders/setter_not_shadowed_by_method.dart.strong.transformed.expect
@@ -0,0 +1,15 @@
+library;
+import self as self;
+import "dart:core" as core;
+
+class A extends core::Object {
+ synthetic constructor •() → void
+ : super core::Object::•()
+ ;
+ method foo(core::int x) → void {}
+ no-such-method-forwarder set foo(core::int x) → void
+ return this.{self::A::noSuchMethod}(new core::_InvocationMirror::_withoutType("set:foo", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[x]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false));
+ method noSuchMethod(core::Invocation i) → dynamic
+ return null;
+}
+static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/rasta/unresolved_for_in.dart.direct.expect b/pkg/front_end/testcases/rasta/unresolved_for_in.dart.direct.expect
index e72d620..ed6b3f9 100644
--- a/pkg/front_end/testcases/rasta/unresolved_for_in.dart.direct.expect
+++ b/pkg/front_end/testcases/rasta/unresolved_for_in.dart.direct.expect
@@ -16,10 +16,13 @@
let dynamic _ = null in throw new core::NoSuchMethodError::withInvocation(null, new core::_InvocationMirror::_withType(#Fisk, 34, const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[#t2]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{})));
core::print(self::Fisk);
}
- for (final dynamic #t3 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/rasta/unresolved_for_in.dart:17:10: Error: Can't assign to this, so it can't be used in a for-in loop.
+ for (final dynamic #t3 in x) {
+ let dynamic _ = null in invalid-expression "pkg/front_end/testcases/rasta/unresolved_for_in.dart:17:10: Error: A prefix can't be used as an expression.
for (collection in x) {
- ^^^^^^^^^^" in x) {
- core::print(invalid-expression "pkg/front_end/testcases/rasta/unresolved_for_in.dart:1: Error: A library can't be used as an expression.");
+ ^^^^^^^^^^";
+ core::print(invalid-expression "pkg/front_end/testcases/rasta/unresolved_for_in.dart:18:13: Error: A prefix can't be used as an expression.
+ print(collection);
+ ^^^^^^^^^^");
}
for (final dynamic #t4 in x) {
let dynamic _ = null in throw new core::NoSuchMethodError::withInvocation(null, new core::_InvocationMirror::_withType(#VoidFunction, 34, const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[#t4]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{})));
@@ -47,10 +50,13 @@
let dynamic _ = null in throw new core::NoSuchMethodError::withInvocation(null, new core::_InvocationMirror::_withType(#Fisk, 34, const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[#t7]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{})));
core::print(self::Fisk);
}
- for (final dynamic #t8 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/rasta/unresolved_for_in.dart:37:8: Error: Can't assign to this, so it can't be used in a for-in loop.
+ for (final dynamic #t8 in arguments) {
+ let dynamic _ = null in invalid-expression "pkg/front_end/testcases/rasta/unresolved_for_in.dart:37:8: Error: A prefix can't be used as an expression.
for (collection in arguments) {
- ^^^^^^^^^^" in arguments) {
- core::print(invalid-expression "pkg/front_end/testcases/rasta/unresolved_for_in.dart:1: Error: A library can't be used as an expression.");
+ ^^^^^^^^^^";
+ core::print(invalid-expression "pkg/front_end/testcases/rasta/unresolved_for_in.dart:38:11: Error: A prefix can't be used as an expression.
+ print(collection);
+ ^^^^^^^^^^");
}
for (final dynamic #t9 in arguments) {
let dynamic _ = null in throw new core::NoSuchMethodError::withInvocation(null, new core::_InvocationMirror::_withType(#VoidFunction, 34, const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[#t9]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{})));
diff --git a/pkg/front_end/testcases/rasta/unresolved_for_in.dart.direct.transformed.expect b/pkg/front_end/testcases/rasta/unresolved_for_in.dart.direct.transformed.expect
index e72d620..ed6b3f9 100644
--- a/pkg/front_end/testcases/rasta/unresolved_for_in.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/rasta/unresolved_for_in.dart.direct.transformed.expect
@@ -16,10 +16,13 @@
let dynamic _ = null in throw new core::NoSuchMethodError::withInvocation(null, new core::_InvocationMirror::_withType(#Fisk, 34, const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[#t2]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{})));
core::print(self::Fisk);
}
- for (final dynamic #t3 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/rasta/unresolved_for_in.dart:17:10: Error: Can't assign to this, so it can't be used in a for-in loop.
+ for (final dynamic #t3 in x) {
+ let dynamic _ = null in invalid-expression "pkg/front_end/testcases/rasta/unresolved_for_in.dart:17:10: Error: A prefix can't be used as an expression.
for (collection in x) {
- ^^^^^^^^^^" in x) {
- core::print(invalid-expression "pkg/front_end/testcases/rasta/unresolved_for_in.dart:1: Error: A library can't be used as an expression.");
+ ^^^^^^^^^^";
+ core::print(invalid-expression "pkg/front_end/testcases/rasta/unresolved_for_in.dart:18:13: Error: A prefix can't be used as an expression.
+ print(collection);
+ ^^^^^^^^^^");
}
for (final dynamic #t4 in x) {
let dynamic _ = null in throw new core::NoSuchMethodError::withInvocation(null, new core::_InvocationMirror::_withType(#VoidFunction, 34, const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[#t4]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{})));
@@ -47,10 +50,13 @@
let dynamic _ = null in throw new core::NoSuchMethodError::withInvocation(null, new core::_InvocationMirror::_withType(#Fisk, 34, const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[#t7]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{})));
core::print(self::Fisk);
}
- for (final dynamic #t8 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/rasta/unresolved_for_in.dart:37:8: Error: Can't assign to this, so it can't be used in a for-in loop.
+ for (final dynamic #t8 in arguments) {
+ let dynamic _ = null in invalid-expression "pkg/front_end/testcases/rasta/unresolved_for_in.dart:37:8: Error: A prefix can't be used as an expression.
for (collection in arguments) {
- ^^^^^^^^^^" in arguments) {
- core::print(invalid-expression "pkg/front_end/testcases/rasta/unresolved_for_in.dart:1: Error: A library can't be used as an expression.");
+ ^^^^^^^^^^";
+ core::print(invalid-expression "pkg/front_end/testcases/rasta/unresolved_for_in.dart:38:11: Error: A prefix can't be used as an expression.
+ print(collection);
+ ^^^^^^^^^^");
}
for (final dynamic #t9 in arguments) {
let dynamic _ = null in throw new core::NoSuchMethodError::withInvocation(null, new core::_InvocationMirror::_withType(#VoidFunction, 34, const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[#t9]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{})));
diff --git a/pkg/front_end/testcases/regress/issue_29940.dart.strong.expect b/pkg/front_end/testcases/regress/issue_29940.dart.strong.expect
index 678b455..54e7b47 100644
--- a/pkg/front_end/testcases/regress/issue_29940.dart.strong.expect
+++ b/pkg/front_end/testcases/regress/issue_29940.dart.strong.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-static const field dynamic #errors = const <dynamic>["pkg/front_end/testcases/regress/issue_29940.dart:7:3: Error: 'a.b' isn't a type.
+static const field dynamic #errors = const <dynamic>["pkg/front_end/testcases/regress/issue_29940.dart:7:3: Error: 'a.b' can't be used as a type because 'a' doesn't refer to an import prefix.
a.b c = null;
^^^"]/* from null */;
static method main() → dynamic {
diff --git a/pkg/front_end/testcases/regress/issue_29940.dart.strong.transformed.expect b/pkg/front_end/testcases/regress/issue_29940.dart.strong.transformed.expect
index 678b455..54e7b47 100644
--- a/pkg/front_end/testcases/regress/issue_29940.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/regress/issue_29940.dart.strong.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-static const field dynamic #errors = const <dynamic>["pkg/front_end/testcases/regress/issue_29940.dart:7:3: Error: 'a.b' isn't a type.
+static const field dynamic #errors = const <dynamic>["pkg/front_end/testcases/regress/issue_29940.dart:7:3: Error: 'a.b' can't be used as a type because 'a' doesn't refer to an import prefix.
a.b c = null;
^^^"]/* from null */;
static method main() → dynamic {
diff --git a/pkg/front_end/testcases/regress/issue_29976.dart.direct.expect b/pkg/front_end/testcases/regress/issue_29976.dart.direct.expect
index d2f376d..3c4327b 100644
--- a/pkg/front_end/testcases/regress/issue_29976.dart.direct.expect
+++ b/pkg/front_end/testcases/regress/issue_29976.dart.direct.expect
@@ -1,8 +1,21 @@
library;
import self as self;
+import "dart:core" as core;
-static method #main() → dynamic {
- throw "pkg/front_end/testcases/regress/issue_29976.dart:8:3: Error: Expected a String, but got ')'.
+static const field dynamic #errors = const <dynamic>["pkg/front_end/testcases/regress/issue_29976.dart:7:14: Error: The non-ASCII character '\u0233' (U+00E9) can't be used in identifiers, only in strings and comments.
+Try using an US-ASCII letter, a digit, '_' (an underscore), or '\$' (a dollar sign).
+ \"x\${x*\"'\"\u0233'}x
+ ^", "pkg/front_end/testcases/regress/issue_29976.dart:7:15: Error: String starting with ' must end with '.
+ \"x\${x*\"'\"\u0233'}x
+ ^", "pkg/front_end/testcases/regress/issue_29976.dart:7:7: Error: Can't find '}' to match '\${'.
+ \"x\${x*\"'\"\u0233'}x
+ ^", "pkg/front_end/testcases/regress/issue_29976.dart:10:1: Error: String starting with \" must end with \".", "pkg/front_end/testcases/regress/issue_29976.dart:10:1: Error: Expected a declaration, but got ''.", "pkg/front_end/testcases/regress/issue_29976.dart:7:14: Error: Expected '}' before this.
+ \"x\${x*\"'\"\u0233'}x
+ ^", "pkg/front_end/testcases/regress/issue_29976.dart:8:3: Error: Expected a String, but got ')'.
)
- ^";
+ ^", "pkg/front_end/testcases/regress/issue_29976.dart:9:1: Error: Expected ';' before this.
+}
+^"]/* from null */;
+static method main() → void {
+ throw new core::NoSuchMethodError::withInvocation(null, new core::_InvocationMirror::_withType(#f, 32, const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>["x${(let dynamic _ = null in throw new core::NoSuchMethodError::withInvocation(null, new core::_InvocationMirror::_withType(#x, 33, const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{})))).*("'")}"]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{})));
}
diff --git a/pkg/front_end/testcases/regress/issue_29976.dart.direct.transformed.expect b/pkg/front_end/testcases/regress/issue_29976.dart.direct.transformed.expect
index d2f376d..3c4327b 100644
--- a/pkg/front_end/testcases/regress/issue_29976.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/regress/issue_29976.dart.direct.transformed.expect
@@ -1,8 +1,21 @@
library;
import self as self;
+import "dart:core" as core;
-static method #main() → dynamic {
- throw "pkg/front_end/testcases/regress/issue_29976.dart:8:3: Error: Expected a String, but got ')'.
+static const field dynamic #errors = const <dynamic>["pkg/front_end/testcases/regress/issue_29976.dart:7:14: Error: The non-ASCII character '\u0233' (U+00E9) can't be used in identifiers, only in strings and comments.
+Try using an US-ASCII letter, a digit, '_' (an underscore), or '\$' (a dollar sign).
+ \"x\${x*\"'\"\u0233'}x
+ ^", "pkg/front_end/testcases/regress/issue_29976.dart:7:15: Error: String starting with ' must end with '.
+ \"x\${x*\"'\"\u0233'}x
+ ^", "pkg/front_end/testcases/regress/issue_29976.dart:7:7: Error: Can't find '}' to match '\${'.
+ \"x\${x*\"'\"\u0233'}x
+ ^", "pkg/front_end/testcases/regress/issue_29976.dart:10:1: Error: String starting with \" must end with \".", "pkg/front_end/testcases/regress/issue_29976.dart:10:1: Error: Expected a declaration, but got ''.", "pkg/front_end/testcases/regress/issue_29976.dart:7:14: Error: Expected '}' before this.
+ \"x\${x*\"'\"\u0233'}x
+ ^", "pkg/front_end/testcases/regress/issue_29976.dart:8:3: Error: Expected a String, but got ')'.
)
- ^";
+ ^", "pkg/front_end/testcases/regress/issue_29976.dart:9:1: Error: Expected ';' before this.
+}
+^"]/* from null */;
+static method main() → void {
+ throw new core::NoSuchMethodError::withInvocation(null, new core::_InvocationMirror::_withType(#f, 32, const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>["x${(let dynamic _ = null in throw new core::NoSuchMethodError::withInvocation(null, new core::_InvocationMirror::_withType(#x, 33, const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{})))).*("'")}"]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{})));
}
diff --git a/pkg/front_end/testcases/regress/issue_29976.dart.strong.expect b/pkg/front_end/testcases/regress/issue_29976.dart.strong.expect
index d2f376d..75e88e2 100644
--- a/pkg/front_end/testcases/regress/issue_29976.dart.strong.expect
+++ b/pkg/front_end/testcases/regress/issue_29976.dart.strong.expect
@@ -1,8 +1,25 @@
library;
import self as self;
+import "dart:core" as core;
-static method #main() → dynamic {
- throw "pkg/front_end/testcases/regress/issue_29976.dart:8:3: Error: Expected a String, but got ')'.
+static const field dynamic #errors = const <dynamic>["pkg/front_end/testcases/regress/issue_29976.dart:7:14: Error: The non-ASCII character '\u0233' (U+00E9) can't be used in identifiers, only in strings and comments.
+Try using an US-ASCII letter, a digit, '_' (an underscore), or '\$' (a dollar sign).
+ \"x\${x*\"'\"\u0233'}x
+ ^", "pkg/front_end/testcases/regress/issue_29976.dart:7:15: Error: String starting with ' must end with '.
+ \"x\${x*\"'\"\u0233'}x
+ ^", "pkg/front_end/testcases/regress/issue_29976.dart:7:7: Error: Can't find '}' to match '\${'.
+ \"x\${x*\"'\"\u0233'}x
+ ^", "pkg/front_end/testcases/regress/issue_29976.dart:10:1: Error: String starting with \" must end with \".", "pkg/front_end/testcases/regress/issue_29976.dart:10:1: Error: Expected a declaration, but got ''.", "pkg/front_end/testcases/regress/issue_29976.dart:7:9: Error: Getter not found: 'x'.
+ \"x\${x*\"'\"\u0233'}x
+ ^", "pkg/front_end/testcases/regress/issue_29976.dart:7:14: Error: Expected '}' before this.
+ \"x\${x*\"'\"\u0233'}x
+ ^", "pkg/front_end/testcases/regress/issue_29976.dart:8:3: Error: Expected a String, but got ')'.
)
- ^";
+ ^", "pkg/front_end/testcases/regress/issue_29976.dart:6:3: Error: Method not found: 'f'.
+ f(
+ ^", "pkg/front_end/testcases/regress/issue_29976.dart:9:1: Error: Expected ';' before this.
+}
+^"]/* from null */;
+static method main() → void {
+ throw new core::NoSuchMethodError::withInvocation(null, new core::_InvocationMirror::_withType(#f, 32, const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>["x${(let dynamic _ = null in throw new core::NoSuchMethodError::withInvocation(null, new core::_InvocationMirror::_withType(#x, 33, const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{})))).*("'")}"]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{})));
}
diff --git a/pkg/front_end/testcases/strong.status b/pkg/front_end/testcases/strong.status
index d0d42f8..6c44f09 100644
--- a/pkg/front_end/testcases/strong.status
+++ b/pkg/front_end/testcases/strong.status
@@ -196,7 +196,7 @@
rasta/unsupported_platform_library: Fail
regress/issue_29975: Fail # Issue 29975.
-regress/issue_29976: RuntimeError # Issue 29976.
+regress/issue_29976: TypeCheckError # Issue 29976.
regress/issue_29982: Fail # Issue 29982.
regress/issue_30836: RuntimeError # Issue 30836.
regress/issue_31184: TypeCheckError
diff --git a/pkg/front_end/testcases/top_level_library_method.dart b/pkg/front_end/testcases/top_level_library_method.dart
new file mode 100644
index 0000000..65a7e03
--- /dev/null
+++ b/pkg/front_end/testcases/top_level_library_method.dart
@@ -0,0 +1,9 @@
+// Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+library() {
+ print("Hello, World!");
+}
+
+main() => library();
diff --git a/pkg/front_end/testcases/top_level_library_method.dart.direct.expect b/pkg/front_end/testcases/top_level_library_method.dart.direct.expect
new file mode 100644
index 0000000..f23119a
--- /dev/null
+++ b/pkg/front_end/testcases/top_level_library_method.dart.direct.expect
@@ -0,0 +1,9 @@
+library;
+import self as self;
+import "dart:core" as core;
+
+static method library() → dynamic {
+ core::print("Hello, World!");
+}
+static method main() → dynamic
+ return self::library();
diff --git a/pkg/front_end/testcases/top_level_library_method.dart.direct.transformed.expect b/pkg/front_end/testcases/top_level_library_method.dart.direct.transformed.expect
new file mode 100644
index 0000000..f23119a
--- /dev/null
+++ b/pkg/front_end/testcases/top_level_library_method.dart.direct.transformed.expect
@@ -0,0 +1,9 @@
+library;
+import self as self;
+import "dart:core" as core;
+
+static method library() → dynamic {
+ core::print("Hello, World!");
+}
+static method main() → dynamic
+ return self::library();
diff --git a/pkg/front_end/testcases/top_level_library_method.dart.outline.expect b/pkg/front_end/testcases/top_level_library_method.dart.outline.expect
new file mode 100644
index 0000000..f51ba5a0
--- /dev/null
+++ b/pkg/front_end/testcases/top_level_library_method.dart.outline.expect
@@ -0,0 +1,7 @@
+library;
+import self as self;
+
+static method library() → dynamic
+ ;
+static method main() → dynamic
+ ;
diff --git a/pkg/front_end/testcases/top_level_library_method.dart.strong.expect b/pkg/front_end/testcases/top_level_library_method.dart.strong.expect
new file mode 100644
index 0000000..f23119a
--- /dev/null
+++ b/pkg/front_end/testcases/top_level_library_method.dart.strong.expect
@@ -0,0 +1,9 @@
+library;
+import self as self;
+import "dart:core" as core;
+
+static method library() → dynamic {
+ core::print("Hello, World!");
+}
+static method main() → dynamic
+ return self::library();
diff --git a/pkg/front_end/testcases/top_level_library_method.dart.strong.transformed.expect b/pkg/front_end/testcases/top_level_library_method.dart.strong.transformed.expect
new file mode 100644
index 0000000..f23119a
--- /dev/null
+++ b/pkg/front_end/testcases/top_level_library_method.dart.strong.transformed.expect
@@ -0,0 +1,9 @@
+library;
+import self as self;
+import "dart:core" as core;
+
+static method library() → dynamic {
+ core::print("Hello, World!");
+}
+static method main() → dynamic
+ return self::library();
diff --git a/pkg/front_end/tool/_fasta/command_line.dart b/pkg/front_end/tool/_fasta/command_line.dart
index 258e081..717083a 100644
--- a/pkg/front_end/tool/_fasta/command_line.dart
+++ b/pkg/front_end/tool/_fasta/command_line.dart
@@ -4,7 +4,9 @@
library fasta.tool.command_line;
-import 'dart:io' show exit;
+import 'dart:async' show Future;
+
+import 'dart:io' show exit, exitCode;
import 'package:build_integration/file_system/single_root.dart'
show SingleRootFileSystem;
@@ -25,6 +27,9 @@
import 'package:front_end/src/fasta/compiler_context.dart' show CompilerContext;
+import 'package:front_end/src/fasta/deprecated_problems.dart'
+ show deprecated_InputError;
+
import 'package:front_end/src/fasta/fasta_codes.dart'
show
Message,
@@ -33,7 +38,7 @@
messageFastaUsageShort,
templateUnspecified;
-import 'package:front_end/src/fasta/problems.dart' show unhandled;
+import 'package:front_end/src/fasta/problems.dart' show DebugAbort, unhandled;
import 'package:front_end/src/fasta/severity.dart' show Severity;
@@ -458,3 +463,25 @@
// TODO(ahe): Don't use [templateUnspecified].
return templateUnspecified.withArguments("$sb");
}
+
+Future<T> runProtectedFromAbort<T>(Future<T> Function() action,
+ [T failingValue]) async {
+ if (CompilerContext.isActive) {
+ throw "runProtectedFromAbort should be called from 'main',"
+ " that is, outside a compiler context.";
+ }
+ try {
+ return await action();
+ } on DebugAbort catch (e) {
+ print(e.message.message);
+
+ // DebugAbort should never happen in production code, so we want test.py to
+ // treat this as a crash which is signalled by exiting with 255.
+ exit(255);
+ } on deprecated_InputError catch (e) {
+ exitCode = 1;
+ await CompilerContext.runWithDefaultOptions((c) =>
+ new Future<void>.sync(() => c.report(e.message, Severity.error)));
+ }
+ return failingValue;
+}
diff --git a/pkg/front_end/tool/_fasta/compile_platform.dart b/pkg/front_end/tool/_fasta/compile_platform.dart
index d824723..c9791fb 100644
--- a/pkg/front_end/tool/_fasta/compile_platform.dart
+++ b/pkg/front_end/tool/_fasta/compile_platform.dart
@@ -2,162 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-library fasta.compile_platform;
+import 'entry_points.dart' show compilePlatformEntryPoint;
-import 'dart:async' show Future;
-
-import 'dart:io' show File, Platform, exitCode;
-
-import 'package:kernel/target/targets.dart' show Target, TargetFlags, getTarget;
-
-import 'package:vm/bytecode/gen_bytecode.dart'
- show generateBytecode, isKernelBytecodeEnabledForPlatform;
-
-import 'package:front_end/src/fasta/compiler_context.dart' show CompilerContext;
-
-import 'package:front_end/src/fasta/deprecated_problems.dart'
- show deprecated_InputError;
-
-import 'package:front_end/src/fasta/get_dependencies.dart' show getDependencies;
-
-import 'package:front_end/src/fasta/kernel/utils.dart'
- show writeComponentToFile;
-
-import 'package:front_end/src/fasta/severity.dart' show Severity;
-
-import 'package:front_end/src/fasta/util/relativize.dart' show relativizeUri;
-
-import 'package:front_end/src/kernel_generator_impl.dart'
- show generateKernelInternal;
-
-import 'additional_targets.dart' show installAdditionalTargets;
-
-import 'command_line.dart' show withGlobalOptions;
-
-const int iterations = const int.fromEnvironment("iterations", defaultValue: 1);
-
-Future main(List<String> arguments) async {
- installAdditionalTargets();
- for (int i = 0; i < iterations; i++) {
- if (i > 0) {
- print("\n");
- }
- try {
- await compilePlatform(arguments);
- } on deprecated_InputError catch (e) {
- exitCode = 1;
- await CompilerContext.runWithDefaultOptions((c) => new Future<void>.sync(
- () => c.report(deprecated_InputError.toMessage(e), Severity.error)));
- return null;
- }
- }
-}
-
-Future compilePlatform(List<String> arguments) async {
- await withGlobalOptions("compile_platform", arguments, false,
- (CompilerContext c, List<String> restArguments) {
- Uri hostPlatform = Uri.base.resolveUri(new Uri.file(restArguments[2]));
- Uri outlineOutput = Uri.base.resolveUri(new Uri.file(restArguments[4]));
- return compilePlatformInternal(
- c, c.options.output, outlineOutput, hostPlatform);
- });
-}
-
-Future compilePlatformInternal(CompilerContext c, Uri fullOutput,
- Uri outlineOutput, Uri hostPlatform) async {
- if (c.options.verbose) {
- print("Generating outline of ${c.options.sdkRoot} into $outlineOutput");
- print("Compiling ${c.options.sdkRoot} to $fullOutput");
- }
-
- var result =
- await generateKernelInternal(buildSummary: true, buildComponent: true);
- if (result == null) {
- exitCode = 1;
- // Note: an error should have been reported by now.
- print('The platform .dill files were not created.');
- return;
- }
- new File.fromUri(outlineOutput).writeAsBytesSync(result.summary);
- c.options.ticker.logMs("Wrote outline to ${outlineOutput.toFilePath()}");
-
- if (isKernelBytecodeEnabledForPlatform) {
- generateBytecode(result.component, strongMode: c.options.strongMode);
- }
-
- await writeComponentToFile(result.component, fullOutput,
- filter: (lib) => !lib.isExternal);
-
- c.options.ticker.logMs("Wrote component to ${fullOutput.toFilePath()}");
-
- List<Uri> deps = result.deps.toList();
- for (Uri dependency in await computeHostDependencies(hostPlatform)) {
- // Add the dependencies of the compiler's own sources.
- if (dependency != outlineOutput) {
- // We're computing the dependencies for [outlineOutput], so we shouldn't
- // include it in the deps file.
- deps.add(dependency);
- }
- }
- await writeDepsFile(
- fullOutput, new File(new File.fromUri(fullOutput).path + ".d").uri, deps);
-}
-
-Future<List<Uri>> computeHostDependencies(Uri hostPlatform) async {
- // Returns a list of source files that make up the Fasta compiler (the files
- // the Dart VM reads to run Fasta). Until Fasta is self-hosting (in strong
- // mode), this is only an approximation, albeit accurate. Once Fasta is
- // self-hosting, this isn't an approximation. Regardless, strong mode
- // shouldn't affect which files are read.
- Target hostTarget = getTarget("vm", new TargetFlags(strongMode: true));
- return getDependencies(Platform.script,
- platform: hostPlatform, target: hostTarget);
-}
-
-Future writeDepsFile(
- Uri output, Uri depsFile, List<Uri> allDependencies) async {
- if (allDependencies.isEmpty) return;
- String toRelativeFilePath(Uri uri) {
- // Ninja expects to find file names relative to the current working
- // directory. We've tried making them relative to the deps file, but that
- // doesn't work for downstream projects. Making them absolute also
- // doesn't work.
- //
- // We can test if it works by running ninja twice, for example:
- //
- // ninja -C xcodebuild/ReleaseX64 -d explain compile_platform
- // ninja -C xcodebuild/ReleaseX64 -d explain compile_platform
- //
- // The second time, ninja should say:
- //
- // ninja: Entering directory `xcodebuild/ReleaseX64'
- // ninja: no work to do.
- //
- // It's broken if it says something like this:
- //
- // ninja explain: expected depfile 'vm_platform.dill.d' to mention \
- // 'vm_platform.dill', got '/.../xcodebuild/ReleaseX64/vm_platform.dill'
- return Uri.parse(relativizeUri(uri, base: Uri.base)).toFilePath();
- }
-
- StringBuffer sb = new StringBuffer();
- sb.write(toRelativeFilePath(output));
- sb.write(":");
- List<String> paths = new List<String>(allDependencies.length);
- for (int i = 0; i < allDependencies.length; i++) {
- paths[i] = toRelativeFilePath(allDependencies[i]);
- }
- // Sort the relative paths to ease analyzing future changes to this code.
- paths.sort();
- String previous;
- for (String path in paths) {
- // Check for and omit duplicates.
- if (path != previous) {
- previous = path;
- sb.write(" \\\n ");
- sb.write(path);
- }
- }
- sb.writeln();
- await new File.fromUri(depsFile).writeAsString("$sb");
-}
+main(List<String> arguments) => compilePlatformEntryPoint(arguments);
diff --git a/pkg/front_end/tool/_fasta/entry_points.dart b/pkg/front_end/tool/_fasta/entry_points.dart
index 2c27df0..7635437 100644
--- a/pkg/front_end/tool/_fasta/entry_points.dart
+++ b/pkg/front_end/tool/_fasta/entry_points.dart
@@ -8,11 +8,16 @@
import 'dart:convert' show jsonDecode, jsonEncode, LineSplitter, utf8;
-import 'dart:io' show File, exitCode, stderr, stdin, stdout;
+import 'dart:io' show File, Platform, exitCode, stderr, stdin, stdout;
import 'package:kernel/kernel.dart'
show CanonicalName, Library, Component, Source, loadComponentFromBytes;
+import 'package:kernel/target/targets.dart' show Target, TargetFlags, getTarget;
+
+import 'package:vm/bytecode/gen_bytecode.dart'
+ show generateBytecode, isKernelBytecodeEnabledForPlatform;
+
import 'package:front_end/src/api_prototype/compiler_options.dart'
show CompilerOptions;
@@ -22,10 +27,12 @@
import 'package:front_end/src/fasta/compiler_context.dart' show CompilerContext;
import 'package:front_end/src/fasta/deprecated_problems.dart'
- show deprecated_InputError, deprecated_inputError;
+ show deprecated_inputError;
import 'package:front_end/src/fasta/dill/dill_target.dart' show DillTarget;
+import 'package:front_end/src/fasta/get_dependencies.dart' show getDependencies;
+
import 'package:front_end/src/fasta/incremental_compiler.dart'
show IncrementalCompiler;
@@ -35,15 +42,18 @@
import 'package:front_end/src/fasta/kernel/utils.dart'
show printComponentText, writeComponentToFile;
-import 'package:front_end/src/fasta/severity.dart' show Severity;
-
import 'package:front_end/src/fasta/ticker.dart' show Ticker;
import 'package:front_end/src/fasta/uri_translator.dart' show UriTranslator;
+import 'package:front_end/src/fasta/util/relativize.dart' show relativizeUri;
+
+import 'package:front_end/src/kernel_generator_impl.dart'
+ show generateKernelInternal;
+
import 'additional_targets.dart' show installAdditionalTargets;
-import 'command_line.dart' show withGlobalOptions;
+import 'command_line.dart' show runProtectedFromAbort, withGlobalOptions;
const bool summary = const bool.fromEnvironment("summary", defaultValue: false);
@@ -83,9 +93,18 @@
}
}
+compilePlatformEntryPoint(List<String> arguments) async {
+ installAdditionalTargets();
+ for (int i = 0; i < iterations; i++) {
+ if (i > 0) {
+ print("\n");
+ }
+ await runProtectedFromAbort<void>(() => compilePlatform(arguments));
+ }
+}
+
batchEntryPoint(List<String> arguments) {
installAdditionalTargets();
-
return new BatchCompiler(
stdin.transform(utf8.decoder).transform(new LineSplitter()))
.run();
@@ -121,14 +140,10 @@
}
Future<bool> batchCompileArguments(List<String> arguments) async {
- try {
- return await withGlobalOptions("compile", arguments, true,
- (CompilerContext c, _) => batchCompileImpl(c));
- } on deprecated_InputError catch (e) {
- await CompilerContext.runWithDefaultOptions((c) => new Future<void>.sync(
- () => c.report(deprecated_InputError.toMessage(e), Severity.error)));
- return false;
- }
+ return runProtectedFromAbort<bool>(
+ () => withGlobalOptions("compile", arguments, true,
+ (CompilerContext c, _) => batchCompileImpl(c)),
+ false);
}
Future<bool> batchCompile(CompilerOptions options, Uri input, Uri output) {
@@ -175,7 +190,7 @@
}
Future<KernelTarget> outline(List<String> arguments) async {
- try {
+ return await runProtectedFromAbort<KernelTarget>(() async {
return await withGlobalOptions("outline", arguments, true,
(CompilerContext c, _) async {
if (c.options.verbose) {
@@ -185,16 +200,11 @@
new CompileTask(c, new Ticker(isVerbose: c.options.verbose));
return await task.buildOutline(c.options.output);
});
- } on deprecated_InputError catch (e) {
- exitCode = 1;
- await CompilerContext.runWithDefaultOptions((c) => new Future<void>.sync(
- () => c.report(deprecated_InputError.toMessage(e), Severity.error)));
- return null;
- }
+ });
}
Future<Uri> compile(List<String> arguments) async {
- try {
+ return await runProtectedFromAbort<Uri>(() async {
return await withGlobalOptions("compile", arguments, true,
(CompilerContext c, _) async {
if (c.options.verbose) {
@@ -204,12 +214,7 @@
new CompileTask(c, new Ticker(isVerbose: c.options.verbose));
return await task.compile();
});
- } on deprecated_InputError catch (e) {
- exitCode = 1;
- await CompilerContext.runWithDefaultOptions((c) => new Future<void>.sync(
- () => c.report(deprecated_InputError.toMessage(e), Severity.error)));
- return null;
- }
+ });
}
class CompileTask {
@@ -294,3 +299,112 @@
var platformComponent = loadComponentFromBytes(bytes);
dillTarget.loader.appendLibraries(platformComponent, byteCount: bytes.length);
}
+
+Future compilePlatform(List<String> arguments) async {
+ await withGlobalOptions("compile_platform", arguments, false,
+ (CompilerContext c, List<String> restArguments) {
+ Uri hostPlatform = Uri.base.resolveUri(new Uri.file(restArguments[2]));
+ Uri outlineOutput = Uri.base.resolveUri(new Uri.file(restArguments[4]));
+ return compilePlatformInternal(
+ c, c.options.output, outlineOutput, hostPlatform);
+ });
+}
+
+Future compilePlatformInternal(CompilerContext c, Uri fullOutput,
+ Uri outlineOutput, Uri hostPlatform) async {
+ if (c.options.verbose) {
+ print("Generating outline of ${c.options.sdkRoot} into $outlineOutput");
+ print("Compiling ${c.options.sdkRoot} to $fullOutput");
+ }
+
+ var result =
+ await generateKernelInternal(buildSummary: true, buildComponent: true);
+ if (result == null) {
+ exitCode = 1;
+ // Note: an error should have been reported by now.
+ print('The platform .dill files were not created.');
+ return;
+ }
+ new File.fromUri(outlineOutput).writeAsBytesSync(result.summary);
+ c.options.ticker.logMs("Wrote outline to ${outlineOutput.toFilePath()}");
+
+ if (isKernelBytecodeEnabledForPlatform) {
+ generateBytecode(result.component, strongMode: c.options.strongMode);
+ }
+
+ await writeComponentToFile(result.component, fullOutput,
+ filter: (lib) => !lib.isExternal);
+
+ c.options.ticker.logMs("Wrote component to ${fullOutput.toFilePath()}");
+
+ List<Uri> deps = result.deps.toList();
+ for (Uri dependency in await computeHostDependencies(hostPlatform)) {
+ // Add the dependencies of the compiler's own sources.
+ if (dependency != outlineOutput) {
+ // We're computing the dependencies for [outlineOutput], so we shouldn't
+ // include it in the deps file.
+ deps.add(dependency);
+ }
+ }
+ await writeDepsFile(
+ fullOutput, new File(new File.fromUri(fullOutput).path + ".d").uri, deps);
+}
+
+Future<List<Uri>> computeHostDependencies(Uri hostPlatform) async {
+ // Returns a list of source files that make up the Fasta compiler (the files
+ // the Dart VM reads to run Fasta). Until Fasta is self-hosting (in strong
+ // mode), this is only an approximation, albeit accurate. Once Fasta is
+ // self-hosting, this isn't an approximation. Regardless, strong mode
+ // shouldn't affect which files are read.
+ Target hostTarget = getTarget("vm", new TargetFlags(strongMode: true));
+ return getDependencies(Platform.script,
+ platform: hostPlatform, target: hostTarget);
+}
+
+Future writeDepsFile(
+ Uri output, Uri depsFile, List<Uri> allDependencies) async {
+ if (allDependencies.isEmpty) return;
+ String toRelativeFilePath(Uri uri) {
+ // Ninja expects to find file names relative to the current working
+ // directory. We've tried making them relative to the deps file, but that
+ // doesn't work for downstream projects. Making them absolute also
+ // doesn't work.
+ //
+ // We can test if it works by running ninja twice, for example:
+ //
+ // ninja -C xcodebuild/ReleaseX64 -d explain compile_platform
+ // ninja -C xcodebuild/ReleaseX64 -d explain compile_platform
+ //
+ // The second time, ninja should say:
+ //
+ // ninja: Entering directory `xcodebuild/ReleaseX64'
+ // ninja: no work to do.
+ //
+ // It's broken if it says something like this:
+ //
+ // ninja explain: expected depfile 'vm_platform.dill.d' to mention \
+ // 'vm_platform.dill', got '/.../xcodebuild/ReleaseX64/vm_platform.dill'
+ return Uri.parse(relativizeUri(uri, base: Uri.base)).toFilePath();
+ }
+
+ StringBuffer sb = new StringBuffer();
+ sb.write(toRelativeFilePath(output));
+ sb.write(":");
+ List<String> paths = new List<String>(allDependencies.length);
+ for (int i = 0; i < allDependencies.length; i++) {
+ paths[i] = toRelativeFilePath(allDependencies[i]);
+ }
+ // Sort the relative paths to ease analyzing future changes to this code.
+ paths.sort();
+ String previous;
+ for (String path in paths) {
+ // Check for and omit duplicates.
+ if (path != previous) {
+ previous = path;
+ sb.write(" \\\n ");
+ sb.write(path);
+ }
+ }
+ sb.writeln();
+ await new File.fromUri(depsFile).writeAsString("$sb");
+}
diff --git a/pkg/front_end/tool/_fasta/generate_messages.dart b/pkg/front_end/tool/_fasta/generate_messages.dart
index 5b2e15c..5ae69a3 100644
--- a/pkg/front_end/tool/_fasta/generate_messages.dart
+++ b/pkg/front_end/tool/_fasta/generate_messages.dart
@@ -44,7 +44,7 @@
part of fasta.codes;
""");
- List<String> keys = yaml.keys.toList()..sort();
+ List<String> keys = yaml.keys.cast<String>().toList()..sort();
for (String name in keys) {
var description = yaml[name];
while (description is String) {
@@ -137,6 +137,12 @@
arguments.add("'token': token");
break;
+ case "lexeme2":
+ parameters.add("Token token2");
+ conversions.add("String lexeme2 = token2.lexeme;");
+ arguments.add("'token2': token2");
+ break;
+
case "string":
parameters.add("String string");
arguments.add("'string': string");
diff --git a/pkg/front_end/tool/_fasta/log_collector.dart b/pkg/front_end/tool/_fasta/log_collector.dart
index 971cbfe..5f3e184 100644
--- a/pkg/front_end/tool/_fasta/log_collector.dart
+++ b/pkg/front_end/tool/_fasta/log_collector.dart
@@ -8,8 +8,7 @@
import 'dart:io';
-import 'package:front_end/src/fasta/deprecated_problems.dart'
- show defaultServerAddress;
+import 'package:front_end/src/fasta/crash.dart' show defaultServerAddress;
badRequest(HttpRequest request, int status, String message) {
request.response.statusCode = status;
diff --git a/pkg/front_end/tool/perf_common.dart b/pkg/front_end/tool/perf_common.dart
index 5599fc0..c866f13 100644
--- a/pkg/front_end/tool/perf_common.dart
+++ b/pkg/front_end/tool/perf_common.dart
@@ -5,15 +5,22 @@
/// Shared code used by fasta_perf and incremental_perf.
library front_end.tool.perf_common;
-import 'dart:io';
+import 'dart:io' show exitCode, stderr;
-import 'package:front_end/src/api_prototype/front_end.dart';
-import 'package:front_end/src/fasta/command_line_reporting.dart';
-import 'package:front_end/src/fasta/fasta_codes.dart';
import 'package:kernel/target/flutter.dart' show FlutterTarget;
+
import 'package:kernel/target/targets.dart' show Target, TargetFlags;
+
import 'package:kernel/target/vm.dart' show VmTarget;
+import 'package:front_end/src/api_prototype/front_end.dart'
+ show CompilationMessage;
+
+import 'package:front_end/src/fasta/fasta_codes.dart' as fastaCodes;
+
+import 'package:front_end/src/fasta/severity.dart'
+ show Severity, severityPrefixes;
+
/// Error messages that we temporarily allow when compiling benchmarks in strong
/// mode.
///
@@ -26,17 +33,17 @@
/// from this set.
final whitelistMessageCode = new Set<String>.from(<String>[
// Code names in this list should match the key used in messages.yaml
- codeInvalidAssignment.name,
- codeOverrideTypeMismatchParameter.name,
- codeOverriddenMethodCause.name,
+ fastaCodes.codeInvalidAssignment.name,
+ fastaCodes.codeOverrideTypeMismatchParameter.name,
+ fastaCodes.codeOverriddenMethodCause.name,
// The following errors are not covered by unit tests in the SDK repo because
// they are only seen today in the flutter-gallery benchmark (external to
// this repo).
- codeInvalidCastFunctionExpr.name,
- codeInvalidCastTopLevelFunction.name,
- codeUndefinedGetter.name,
- codeUndefinedMethod.name,
+ fastaCodes.codeInvalidCastFunctionExpr.name,
+ fastaCodes.codeInvalidCastTopLevelFunction.name,
+ fastaCodes.codeUndefinedGetter.name,
+ fastaCodes.codeUndefinedMethod.name,
]);
onErrorHandler(bool isStrong) {
@@ -48,7 +55,7 @@
var uri = m.span.start.sourceUrl;
var offset = m.span.start.offset;
stderr.writeln('$uri:$offset: '
- '${severityName(m.severity, capitalized: true)}: ${m.message}');
+ '${severityPrefixes[m.severity]}: ${m.message}');
exitCode = 1;
} else if (!messageReported) {
messageReported = true;
diff --git a/pkg/kernel/analysis_options.yaml b/pkg/kernel/analysis_options.yaml
index 1d1ce6a..79a0819 100644
--- a/pkg/kernel/analysis_options.yaml
+++ b/pkg/kernel/analysis_options.yaml
@@ -1,5 +1,4 @@
analyzer:
- strong-mode: true
language:
enableSuperMixins: false
exclude:
diff --git a/pkg/kernel/lib/core_types.dart b/pkg/kernel/lib/core_types.dart
index de05b25..5e072b4 100644
--- a/pkg/kernel/lib/core_types.dart
+++ b/pkg/kernel/lib/core_types.dart
@@ -83,6 +83,7 @@
Class _asyncAwaitCompleterClass;
Class _futureOrClass;
Constructor _asyncAwaitCompleterConstructor;
+ Procedure _completeOnAsyncReturnProcedure;
Procedure _completerSyncConstructor;
Procedure _completerComplete;
Procedure _completerCompleteError;
@@ -184,6 +185,11 @@
index.getMember('dart:async', '_AsyncAwaitCompleter', '');
}
+ Member get completeOnAsyncReturn {
+ return _completeOnAsyncReturnProcedure ??=
+ index.getTopLevelMember('dart:async', '_completeOnAsyncReturn');
+ }
+
Procedure get completerComplete {
return _completerComplete ??=
index.getMember('dart:async', 'Completer', 'complete');
diff --git a/pkg/kernel/lib/transformations/continuation.dart b/pkg/kernel/lib/transformations/continuation.dart
index d3d2c0c..8771e34 100644
--- a/pkg/kernel/lib/transformations/continuation.dart
+++ b/pkg/kernel/lib/transformations/continuation.dart
@@ -1056,11 +1056,12 @@
// return value variable followed by a break from the labeled body.
return new Block(<Statement>[
body,
- new ExpressionStatement(new MethodInvocation(
- new VariableGet(completerVariable),
- new Name("complete"),
- new Arguments([new VariableGet(returnVariable)]),
- helper.completerComplete)),
+ new ExpressionStatement(new StaticInvocation(
+ helper.completeOnAsyncReturn,
+ new Arguments([
+ new VariableGet(completerVariable),
+ new VariableGet(returnVariable)
+ ]))),
new ReturnStatement()..fileOffset = enclosingFunction.fileEndOffset
]);
}
@@ -1095,6 +1096,7 @@
final Member completerCompleteError;
final Member completerConstructor;
final Member asyncAwaitCompleterConstructor;
+ final Member completeOnAsyncReturn;
final Member completerFuture;
final Library coreLibrary;
final CoreTypes coreTypes;
@@ -1134,6 +1136,7 @@
this.completerCompleteError,
this.completerConstructor,
this.asyncAwaitCompleterConstructor,
+ this.completeOnAsyncReturn,
this.completerFuture,
this.coreLibrary,
this.coreTypes,
@@ -1174,6 +1177,7 @@
coreTypes.completerCompleteError,
coreTypes.completerSyncConstructor,
coreTypes.asyncAwaitCompleterConstructor,
+ coreTypes.completeOnAsyncReturn,
coreTypes.completerFuture,
coreTypes.coreLibrary,
coreTypes,
diff --git a/pkg/meta/analysis_options.yaml b/pkg/meta/analysis_options.yaml
deleted file mode 100644
index a10d4c5..0000000
--- a/pkg/meta/analysis_options.yaml
+++ /dev/null
@@ -1,2 +0,0 @@
-analyzer:
- strong-mode: true
diff --git a/pkg/pkg.status b/pkg/pkg.status
index 5e11bee..c64d77b 100644
--- a/pkg/pkg.status
+++ b/pkg/pkg.status
@@ -23,7 +23,6 @@
analyzer/test/src/dart/analysis/driver_kernel_test: Slow, Pass
analyzer/test/src/summary/resynthesize_kernel_test: Slow, Pass
analyzer/test/src/task/strong/checker_test: Slow, Pass
-analyzer2dart/test/*: Skip # Analyzer2dart is not maintained anymore.
analyzer_plugin/test/plugin/folding_mixin_test: Slow, Pass
analyzer_plugin/tool/spec/check_all_test: Skip # Issue 29133
dart_messages/test/dart_messages_test: Skip # Requires a package root.
@@ -74,6 +73,7 @@
compiler/tool/*: SkipByDesign # Only meant to run on vm
front_end/test/*: SkipByDesign # Only meant to run on vm, most use dart:mirrors and dart:io
front_end/tool/*: SkipByDesign # Only meant to run on vm
+smith/test/*: SkipByDesign # Only meant to run on vm
status_file/test/normalize_test: SkipByDesign # Uses dart:io
status_file/test/parse_and_normalize_test: SkipByDesign # Uses dart:io
status_file/test/repo_status_files_test: SkipByDesign # Uses dart:io
@@ -133,7 +133,6 @@
analyzer/test/*: SkipByDesign # Uses dart:io.
analyzer/tool/summary/check_test: SkipByDesign # Uses dart:io.
analyzer/tool/task_dependency_graph/check_test: SkipByDesign # Uses dart:io.
-analyzer2dart/*: SkipByDesign # Uses dart:io.
analyzer_cli/*: SkipByDesign # Uses dart:io.
compiler/tool/*: SkipByDesign # Only meant to run on vm
dart_messages/test/dart_messages_test: Skip # Uses dart:io.
@@ -167,8 +166,9 @@
analysis_server/test/services/completion/dart/keyword_contributor_test: Fail
analysis_server/test/services/completion/dart/override_contributor_test: Fail
analysis_server/test/services/completion/statement/statement_completion_test: Fail
-analysis_server/test/services/correction/fix_test: Fail
+analysis_server/test/services/correction/fix_test: Fail, Timeout
analysis_server/test/services/refactoring/extract_local_test: Fail
+analysis_server/test/src/plugin/plugin_manager_test: Pass, Slow
analyzer/test/generated/compile_time_error_code_driver_test: Fail
analyzer/test/generated/compile_time_error_code_kernel_test: Fail
analyzer/test/generated/compile_time_error_code_kernel_test.dart: Fail
@@ -232,6 +232,9 @@
[ $compiler == dart2js && $csp ]
mutation_observer: Skip # This test cannot run under CSP because it is injecting a JavaScript polyfill
+[ $compiler == dart2js && $strong ]
+status_file/test/status_expression_dnf_test: RuntimeError # not strong-clean
+
[ $compiler == dart2js && ($runtime == chrome || $runtime == ff) ]
async/test/stream_zip_test: SkipSlow # Times out. Issue 22050
collection/test/unmodifiable_collection_test: SkipSlow # Times out. Issue 22050
diff --git a/pkg/telemetry/analysis_options.yaml b/pkg/telemetry/analysis_options.yaml
index 85f01f0..250980e 100644
--- a/pkg/telemetry/analysis_options.yaml
+++ b/pkg/telemetry/analysis_options.yaml
@@ -1,5 +1,6 @@
analyzer:
- strong-mode: true
+ strong-mode:
+ implicit-casts: false
linter:
rules:
- annotate_overrides
diff --git a/pkg/telemetry/lib/crash_reporting.dart b/pkg/telemetry/lib/crash_reporting.dart
index c34766e..ef43e3a 100644
--- a/pkg/telemetry/lib/crash_reporting.dart
+++ b/pkg/telemetry/lib/crash_reporting.dart
@@ -9,6 +9,9 @@
import 'package:stack_trace/stack_trace.dart';
import 'package:usage/usage.dart';
+// Reporting disabled until we're set up on the backend.
+const bool CRASH_REPORTING_DISABLED = true;
+
/// Crash backend host.
const String _crashServerHost = 'clients2.google.com';
@@ -46,7 +49,7 @@
///
/// The report is populated from data in [error] and [stackTrace].
Future sendReport(dynamic error, {StackTrace stackTrace}) async {
- if (!analytics.enabled) {
+ if (!analytics.enabled || CRASH_REPORTING_DISABLED) {
return;
}
@@ -63,8 +66,7 @@
req.fields['product'] = crashProductId;
req.fields['version'] = analytics.applicationVersion;
req.fields['osName'] = Platform.operatingSystem;
- // TODO(devoncarew): Report the operating system version when we're able.
- //req.fields['osVersion'] = Platform.operatingSystemVersion;
+ req.fields['osVersion'] = Platform.operatingSystemVersion;
req.fields['type'] = 'DartError';
req.fields['error_runtime_type'] = '${error.runtimeType}';
diff --git a/pkg/telemetry/lib/telemetry.dart b/pkg/telemetry/lib/telemetry.dart
index 7b05ec1..6340cd2 100644
--- a/pkg/telemetry/lib/telemetry.dart
+++ b/pkg/telemetry/lib/telemetry.dart
@@ -13,9 +13,6 @@
export 'package:usage/usage.dart' show Analytics;
-// TODO(devoncarew): Hard-coded to off for now. Remove when we're ready to ship.
-final bool _HARD_CODE_OFF = true;
-
// TODO(devoncarew): Don't show the UI until we're ready to ship.
final bool SHOW_ANALYTICS_UI = false;
@@ -38,8 +35,10 @@
///
/// An example return value might be `'Analytics are currently enabled (and can
/// be disabled with --no-analytics).'`
-String createAnalyticsStatusMessage(bool enabled,
- {String command: 'analytics'}) {
+String createAnalyticsStatusMessage(
+ bool enabled, {
+ String command: 'analytics',
+}) {
String currentState = enabled ? 'enabled' : 'disabled';
String toggleState = enabled ? 'disabled' : 'enabled';
String commandToggle = enabled ? 'no-$command' : command;
@@ -53,17 +52,16 @@
///
/// This analytics instance will share a common enablement state with the rest
/// of the Dart SDK tools.
-Analytics createAnalyticsInstance(String trackingId, String applicationName,
- {bool disableForSession: false}) {
+_TelemetryAnalytics createAnalyticsInstance(
+ String trackingId,
+ String applicationName, {
+ bool disableForSession: false,
+}) {
Directory dir = getDartStorageDirectory();
if (!dir.existsSync()) {
dir.createSync();
}
- if (_HARD_CODE_OFF) {
- disableForSession = true;
- }
-
File file = new File(path.join(dir.path, _settingsFileName));
return new _TelemetryAnalytics(
trackingId, applicationName, getDartVersion(), file, disableForSession);
@@ -73,8 +71,9 @@
///
/// Typically, the directory is `~/.dart/` (and the settings file is
/// `analytics.json`).
-Directory getDartStorageDirectory() =>
- new Directory(path.join(userHomeDir(), _dartDirectoryName));
+Directory getDartStorageDirectory() {
+ return new Directory(path.join(userHomeDir(), _dartDirectoryName));
+}
/// Return the version of the Dart SDK.
String getDartVersion() => usage_io.getDartVersion();
@@ -88,8 +87,7 @@
String applicationVersion,
File file,
this.disableForSession,
- )
- : super(
+ ) : super(
trackingId,
new IOPersistentProperties.fromFile(file),
new IOPostHandler(),
@@ -107,20 +105,38 @@
if (disableForSession || isRunningOnBot()) {
return false;
}
- return super.enabled;
+
+ // If there's no explicit setting (enabled or disabled) then we don't send.
+ return (properties['enabled'] as bool) ?? false;
}
}
bool isRunningOnBot() {
- // - https://docs.travis-ci.com/user/environment-variables/
- // - https://www.appveyor.com/docs/environment-variables/
- // - CHROME_HEADLESS and BUILDBOT_BUILDERNAME are properties on Chrome infra
- // bots.
- return Platform.environment['TRAVIS'] == 'true' ||
- Platform.environment['BOT'] == 'true' ||
- Platform.environment['CONTINUOUS_INTEGRATION'] == 'true' ||
- Platform.environment['CHROME_HEADLESS'] == '1' ||
- Platform.environment.containsKey('BUILDBOT_BUILDERNAME') ||
- Platform.environment.containsKey('APPVEYOR') ||
- Platform.environment.containsKey('CI');
+ final Map<String, String> env = Platform.environment;
+
+ return env['BOT'] != 'false' &&
+ (env['BOT'] == 'true'
+ // https://docs.travis-ci.com/user/environment-variables/#Default-Environment-Variables
+ ||
+ env['TRAVIS'] == 'true' ||
+ env['CONTINUOUS_INTEGRATION'] == 'true' ||
+ env.containsKey('CI') // Travis and AppVeyor
+
+ // https://www.appveyor.com/docs/environment-variables/
+ ||
+ env.containsKey('APPVEYOR')
+
+ // https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-env-vars.html
+ ||
+ (env.containsKey('AWS_REGION') &&
+ env.containsKey('CODEBUILD_INITIATOR'))
+
+ // https://wiki.jenkins.io/display/JENKINS/Building+a+software+project#Buildingasoftwareproject-belowJenkinsSetEnvironmentVariables
+ ||
+ env.containsKey('JENKINS_URL')
+
+ // Properties on Flutter's Chrome Infra bots.
+ ||
+ env['CHROME_HEADLESS'] == '1' ||
+ env.containsKey('BUILDBOT_BUILDERNAME'));
}
diff --git a/pkg/telemetry/test/crash_reporting_test.dart b/pkg/telemetry/test/crash_reporting_test.dart
index a61e1b4..466e31e 100644
--- a/pkg/telemetry/test/crash_reporting_test.dart
+++ b/pkg/telemetry/test/crash_reporting_test.dart
@@ -36,6 +36,6 @@
expect(body, contains(analytics.trackingId));
expect(body, contains('1.0.0'));
expect(body, contains(analytics.clientId));
- });
+ }, skip: CRASH_REPORTING_DISABLED);
});
}
diff --git a/pkg/testing/lib/src/test_dart.dart b/pkg/testing/lib/src/test_dart.dart
index 8ac8457..bba559b 100644
--- a/pkg/testing/lib/src/test_dart.dart
+++ b/pkg/testing/lib/src/test_dart.dart
@@ -43,12 +43,10 @@
void writeRunCommandOn(StringSink sink) {
Uri dartVm;
- if (Platform.isMacOS) {
- dartVm = Uri.base.resolve("tools/sdks/mac/dart-sdk/bin/dart");
+ if (Platform.isMacOS || Platform.isLinux) {
+ dartVm = Uri.base.resolve("tools/sdks/dart-sdk/bin/dart");
} else if (Platform.isWindows) {
- dartVm = Uri.base.resolve("tools/sdks/win/dart-sdk/bin/dart.exe");
- } else if (Platform.isLinux) {
- dartVm = Uri.base.resolve("tools/sdks/linux/dart-sdk/bin/dart");
+ dartVm = Uri.base.resolve("tools/sdks/dart-sdk/bin/dart.exe");
} else {
throw "Operating system not supported: ${Platform.operatingSystem}";
}
diff --git a/pkg/vm/lib/bytecode/gen_bytecode.dart b/pkg/vm/lib/bytecode/gen_bytecode.dart
index c3c76cf..0e7872b 100644
--- a/pkg/vm/lib/bytecode/gen_bytecode.dart
+++ b/pkg/vm/lib/bytecode/gen_bytecode.dart
@@ -31,7 +31,9 @@
const bool isKernelBytecodeEnabledForPlatform = isKernelBytecodeEnabled;
void generateBytecode(Component component,
- {bool strongMode: true, bool dropAST: false}) {
+ {bool strongMode: true,
+ bool dropAST: false,
+ bool omitSourcePositions: false}) {
final coreTypes = new CoreTypes(component);
void ignoreAmbiguousSupertypes(Class cls, Supertype a, Supertype b) {}
final hierarchy = new ClassHierarchy(component,
@@ -40,7 +42,7 @@
new TypeEnvironment(coreTypes, hierarchy, strongMode: strongMode);
final constantsBackend = new VmConstantsBackend(null, coreTypes);
new BytecodeGenerator(component, coreTypes, hierarchy, typeEnvironment,
- constantsBackend, strongMode)
+ constantsBackend, strongMode, omitSourcePositions)
.visitComponent(component);
if (dropAST) {
new DropAST().visitComponent(component);
@@ -54,6 +56,7 @@
final TypeEnvironment typeEnvironment;
final ConstantsBackend constantsBackend;
final bool strongMode;
+ final bool omitSourcePositions;
final BytecodeMetadataRepository metadata = new BytecodeMetadataRepository();
Class enclosingClass;
@@ -75,8 +78,14 @@
BytecodeAssembler asm;
List<BytecodeAssembler> savedAssemblers;
- BytecodeGenerator(this.component, this.coreTypes, this.hierarchy,
- this.typeEnvironment, this.constantsBackend, this.strongMode) {
+ BytecodeGenerator(
+ this.component,
+ this.coreTypes,
+ this.hierarchy,
+ this.typeEnvironment,
+ this.constantsBackend,
+ this.strongMode,
+ this.omitSourcePositions) {
component.addMetadataRepository(metadata);
}
@@ -596,6 +605,9 @@
_genPrologue(node, node.function);
_setupInitialContext(node.function);
+ if (node is Procedure && node.isInstanceMember) {
+ _checkArguments(node.function);
+ }
_genEqualsOperatorNullHandling(node);
}
@@ -686,27 +698,31 @@
asm.emitPopLocal(locals.contextVarIndexInFrame);
}
- if (locals.hasFunctionTypeArgsVar && isClosure) {
+ if (locals.hasFunctionTypeArgsVar) {
if (function.typeParameters.isNotEmpty) {
- final int numParentTypeArgs = locals.numParentTypeArguments;
- asm.emitPush(locals.functionTypeArgsVarIndexInFrame);
- asm.emitPush(locals.closureVarIndexInFrame);
- asm.emitLoadFieldTOS(
- cp.add(new ConstantFieldOffset(closureFunctionTypeArguments)));
- _genPushInt(numParentTypeArgs);
- _genPushInt(numParentTypeArgs + function.typeParameters.length);
- _genStaticCall(prependTypeArguments, new ConstantArgDesc(4), 4);
- asm.emitPopLocal(locals.functionTypeArgsVarIndexInFrame);
- } else {
- asm.emitPush(locals.closureVarIndexInFrame);
- asm.emitLoadFieldTOS(
- cp.add(new ConstantFieldOffset(closureFunctionTypeArguments)));
- asm.emitPopLocal(locals.functionTypeArgsVarIndexInFrame);
+ assert(!(node is Procedure && node.isFactory));
+ asm.emitCheckFunctionTypeArgs(function.typeParameters.length,
+ locals.functionTypeArgsVarIndexInFrame);
}
- }
- if (isClosure || (node is Procedure && node.isInstanceMember)) {
- _checkArguments(function);
+ if (isClosure) {
+ if (function.typeParameters.isNotEmpty) {
+ final int numParentTypeArgs = locals.numParentTypeArguments;
+ asm.emitPush(locals.functionTypeArgsVarIndexInFrame);
+ asm.emitPush(locals.closureVarIndexInFrame);
+ asm.emitLoadFieldTOS(
+ cp.add(new ConstantFieldOffset(closureFunctionTypeArguments)));
+ _genPushInt(numParentTypeArgs);
+ _genPushInt(numParentTypeArgs + function.typeParameters.length);
+ _genStaticCall(prependTypeArguments, new ConstantArgDesc(4), 4);
+ asm.emitPopLocal(locals.functionTypeArgsVarIndexInFrame);
+ } else {
+ asm.emitPush(locals.closureVarIndexInFrame);
+ asm.emitLoadFieldTOS(
+ cp.add(new ConstantFieldOffset(closureFunctionTypeArguments)));
+ asm.emitPopLocal(locals.functionTypeArgsVarIndexInFrame);
+ }
+ }
}
}
@@ -811,6 +827,7 @@
}
_setupInitialContext(function);
+ _checkArguments(function);
// TODO(alexmarkov): support --causal_async_stacks.
@@ -929,9 +946,11 @@
if (contextSize > 0) {
asm.emitAllocateContext(contextSize);
- _genDupTOS(locals.scratchVarIndexInFrame);
- asm.emitPush(locals.contextVarIndexInFrame);
- asm.emitStoreFieldTOS(cp.add(new ConstantContextOffset.parent()));
+ if (locals.currentContextLevel > 0) {
+ _genDupTOS(locals.scratchVarIndexInFrame);
+ asm.emitPush(locals.contextVarIndexInFrame);
+ asm.emitStoreFieldTOS(cp.add(new ConstantContextOffset.parent()));
+ }
asm.emitPopLocal(locals.contextVarIndexInFrame);
}
@@ -1014,6 +1033,16 @@
continuation();
}
+ // For certain expressions wrapped into ExpressionStatement we can
+ // omit pushing result on the stack.
+ bool isExpressionWithoutResult(Expression expr) =>
+ expr.parent is ExpressionStatement &&
+ (expr is VariableSet ||
+ expr is PropertySet ||
+ expr is StaticSet ||
+ expr is SuperPropertySet ||
+ expr is DirectPropertySet);
+
@override
defaultTreeNode(Node node) => throw new UnsupportedOperationError(
'Unsupported node ${node.runtimeType}');
@@ -1135,15 +1164,28 @@
@override
visitDirectPropertySet(DirectPropertySet node) {
+ final int temp = locals.tempIndexInFrame(node);
+ final bool hasResult = !isExpressionWithoutResult(node);
+
node.receiver.accept(this);
node.value.accept(this);
+
+ if (hasResult) {
+ asm.emitStoreLocal(temp);
+ }
+
final target = node.target;
if (target is Field || (target is Procedure && target.isSetter)) {
_genStaticCall(target, new ConstantArgDesc(2), 2, isSet: true);
+ asm.emitDrop1();
} else {
throw new UnsupportedOperationError(
'Unsupported DirectPropertySet with target ${target.runtimeType} $target');
}
+
+ if (hasResult) {
+ asm.emitPush(temp);
+ }
}
@override
@@ -1334,15 +1376,24 @@
@override
visitPropertySet(PropertySet node) {
final int temp = locals.tempIndexInFrame(node);
+ final bool hasResult = !isExpressionWithoutResult(node);
+
node.receiver.accept(this);
node.value.accept(this);
- asm.emitStoreLocal(temp);
+
+ if (hasResult) {
+ asm.emitStoreLocal(temp);
+ }
+
final argDescIndex = cp.add(new ConstantArgDesc(2));
final icdataIndex = cp.add(
new ConstantICData(InvocationKind.setter, node.name, argDescIndex));
asm.emitInstanceCall1(2, icdataIndex);
asm.emitDrop1();
- asm.emitPush(temp);
+
+ if (hasResult) {
+ asm.emitPush(temp);
+ }
}
@override
@@ -1382,8 +1433,16 @@
@override
visitSuperPropertySet(SuperPropertySet node) {
+ final int temp = locals.tempIndexInFrame(node);
+ final bool hasResult = !isExpressionWithoutResult(node);
+
_genPushReceiver();
node.value.accept(this);
+
+ if (hasResult) {
+ asm.emitStoreLocal(temp);
+ }
+
final Member target = hierarchy
.getDispatchTarget(enclosingClass.superclass, node.name, setter: true);
if (target == null) {
@@ -1392,10 +1451,15 @@
}
if (target is Field || (target is Procedure && target.isSetter)) {
_genStaticCall(target, new ConstantArgDesc(2), 2, isSet: true);
+ asm.emitDrop1();
} else {
throw new UnsupportedOperationError(
'Unsupported SuperPropertySet with target ${target.runtimeType} $target');
}
+
+ if (hasResult) {
+ asm.emitPush(temp);
+ }
}
@override
@@ -1484,8 +1548,14 @@
@override
visitStaticSet(StaticSet node) {
+ final bool hasResult = !isExpressionWithoutResult(node);
+
node.value.accept(this);
- _genDupTOS(locals.tempIndexInFrame(node));
+
+ if (hasResult) {
+ _genDupTOS(locals.tempIndexInFrame(node));
+ }
+
final target = node.target;
if (target is Field) {
int cpIndex = cp.add(new ConstantField(target));
@@ -1568,21 +1638,32 @@
@override
visitVariableSet(VariableSet node) {
final v = node.variable;
+ final bool hasResult = !isExpressionWithoutResult(node);
+
if (locals.isCaptured(v)) {
_genPushContextForVariable(v);
node.value.accept(this);
- // Preserve value.
final int temp = locals.tempIndexInFrame(node);
- asm.emitStoreLocal(temp);
+ if (hasResult) {
+ asm.emitStoreLocal(temp);
+ }
_genStoreVar(v);
- asm.emitPush(temp);
+ if (hasResult) {
+ asm.emitPush(temp);
+ }
} else {
node.value.accept(this);
- asm.emitStoreLocal(locals.getVarIndexInFrame(v));
+
+ final int localIndex = locals.getVarIndexInFrame(v);
+ if (hasResult) {
+ asm.emitStoreLocal(localIndex);
+ } else {
+ asm.emitPopLocal(localIndex);
+ }
}
}
@@ -1609,8 +1690,8 @@
final bool negated = _genCondition(node.condition);
_genJumpIfTrue(negated, done);
- _genPushInt(node.conditionStartOffset);
- _genPushInt(node.conditionEndOffset);
+ _genPushInt(omitSourcePositions ? 0 : node.conditionStartOffset);
+ _genPushInt(omitSourcePositions ? 0 : node.conditionEndOffset);
if (node.message != null) {
node.message.accept(this);
@@ -1687,8 +1768,11 @@
@override
visitExpressionStatement(ExpressionStatement node) {
- node.expression.accept(this);
- asm.emitDrop1();
+ final expr = node.expression;
+ expr.accept(this);
+ if (!isExpressionWithoutResult(expr)) {
+ asm.emitDrop1();
+ }
}
@override
diff --git a/pkg/vm/lib/bytecode/local_vars.dart b/pkg/vm/lib/bytecode/local_vars.dart
index 1c4edcd..6a19caa 100644
--- a/pkg/vm/lib/bytecode/local_vars.dart
+++ b/pkg/vm/lib/bytecode/local_vars.dart
@@ -751,7 +751,6 @@
}
void _allocateParameters(TreeNode node, FunctionNode function) {
- final bool hasTypeArgs = function.typeParameters.isNotEmpty;
final bool isFactory = node is Procedure && node.isFactory;
final bool hasReceiver =
node is Constructor || (node is Procedure && !node.isStatic);
@@ -760,7 +759,7 @@
_currentFrame.numParameters = function.positionalParameters.length +
function.namedParameters.length +
- (hasTypeArgs || isFactory ? 1 : 0) +
+ (isFactory ? 1 : 0) +
(hasReceiver ? 1 : 0) +
(hasClosureArg ? 1 : 0);
@@ -776,9 +775,6 @@
int count = 0;
if (isFactory) {
_allocateParameter(_currentFrame.factoryTypeArgsVar, count++);
- } else if (hasTypeArgs) {
- assert(!locals.isCaptured(_currentFrame.functionTypeArgsVar));
- _allocateParameter(_currentFrame.functionTypeArgsVar, count++);
}
if (hasReceiver) {
_allocateParameter(_currentFrame.receiverVar, count++);
@@ -970,6 +966,16 @@
}
@override
+ visitDirectPropertySet(DirectPropertySet node) {
+ _visit(node, temps: 1);
+ }
+
+ @override
+ visitSuperPropertySet(SuperPropertySet node) {
+ _visit(node, temps: 1);
+ }
+
+ @override
visitSwitchStatement(SwitchStatement node) {
_visit(node, temps: 1);
}
diff --git a/pkg/vm/test/bytecode/gen_bytecode_test.dart b/pkg/vm/test/bytecode/gen_bytecode_test.dart
index 3ee9d45..c430a97 100644
--- a/pkg/vm/test/bytecode/gen_bytecode_test.dart
+++ b/pkg/vm/test/bytecode/gen_bytecode_test.dart
@@ -16,7 +16,9 @@
runTestCase(Uri source) async {
Component component = await compileTestCaseToKernelProgram(source);
- generateBytecode(component, strongMode: true);
+ // Need to omit source positions from bytecode as they are different on
+ // Linux and Windows (due to differences in newline characters).
+ generateBytecode(component, strongMode: true, omitSourcePositions: true);
final actual = kernelLibraryToString(component.mainMethod.enclosingLibrary);
compareResultWithExpectationsFile(source, actual);
diff --git a/pkg/vm/test/incremental_compiler_test.dart b/pkg/vm/test/incremental_compiler_test.dart
index 3eaa3a3..221871c 100644
--- a/pkg/vm/test/incremental_compiler_test.dart
+++ b/pkg/vm/test/incremental_compiler_test.dart
@@ -103,6 +103,10 @@
}
});
+ vm.stderr.transform(utf8.decoder).transform(splitter).listen((String s) {
+ print("vm stderr: $s");
+ });
+
String portLine = await portLineCompleter.future;
final RegExp observatoryPortRegExp =
diff --git a/pkg/vm/testcases/bytecode/asserts.dart.expect b/pkg/vm/testcases/bytecode/asserts.dart.expect
index 6d2946c..3eb0000 100644
--- a/pkg/vm/testcases/bytecode/asserts.dart.expect
+++ b/pkg/vm/testcases/bytecode/asserts.dart.expect
@@ -13,21 +13,20 @@
IfEqStrictTOS
Jump L1
PushConstant CP#1
+ PushConstant CP#1
PushConstant CP#2
- PushConstant CP#3
- PushConstant CP#5
- IndirectStaticCall 3, CP#4
+ PushConstant CP#4
+ IndirectStaticCall 3, CP#3
L1:
- PushConstant CP#3
+ PushConstant CP#2
ReturnTOS
}
ConstantPool {
[0] = Bool true
- [1] = Int 255
- [2] = Int 264
- [3] = Null
- [4] = ArgDesc num-args 3, num-type-args 0, names []
- [5] = StaticICData target 'dart.core::_AssertionError::_throwNew', arg-desc CP#4
+ [1] = Int 0
+ [2] = Null
+ [3] = ArgDesc num-args 3, num-type-args 0, names []
+ [4] = StaticICData target 'dart.core::_AssertionError::_throwNew', arg-desc CP#3
}
]static method test1(core::bool condition) → void {
assert(condition);
@@ -44,25 +43,24 @@
IfEqStrictTOS
Jump L1
PushConstant CP#3
- PushConstant CP#4
+ PushConstant CP#3
Push FP[-5]
- InstanceCall1 1, CP#5
- PushConstant CP#7
- IndirectStaticCall 3, CP#6
+ InstanceCall1 1, CP#4
+ PushConstant CP#6
+ IndirectStaticCall 3, CP#5
L1:
- PushConstant CP#8
+ PushConstant CP#7
ReturnTOS
}
ConstantPool {
[0] = ArgDesc num-args 1, num-type-args 0, names []
[1] = ICData target-name 'call', arg-desc CP#0
[2] = Bool true
- [3] = Int 328
- [4] = Int 339
- [5] = ICData target-name 'call', arg-desc CP#0
- [6] = ArgDesc num-args 3, num-type-args 0, names []
- [7] = StaticICData target 'dart.core::_AssertionError::_throwNew', arg-desc CP#6
- [8] = Null
+ [3] = Int 0
+ [4] = ICData target-name 'call', arg-desc CP#0
+ [5] = ArgDesc num-args 3, num-type-args 0, names []
+ [6] = StaticICData target 'dart.core::_AssertionError::_throwNew', arg-desc CP#5
+ [7] = Null
}
]static method test2(() → core::bool condition, () → core::String message) → void {
assert(condition.call(), message.call());
diff --git a/pkg/vm/testcases/bytecode/async.dart.expect b/pkg/vm/testcases/bytecode/async.dart.expect
index 981b101..d6cd5ec 100644
--- a/pkg/vm/testcases/bytecode/async.dart.expect
+++ b/pkg/vm/testcases/bytecode/async.dart.expect
@@ -51,18 +51,15 @@
Push r5
PushConstant CP#23
IndirectStaticCall 1, CP#2
- StoreLocal r2
- Drop1
+ PopLocal r2
Push r5
PushConstant CP#24
IndirectStaticCall 1, CP#2
- StoreLocal r3
- Drop1
+ PopLocal r3
Push r5
PushConstant CP#25
IndirectStaticCall 1, CP#2
- StoreLocal r4
- Drop1
+ PopLocal r4
PushConstant CP#26
Push r5
PushConstant CP#27
@@ -93,7 +90,7 @@
[11] = FieldOffset dart.core::_Closure::_context
[12] = Int 42
[13] = ArgDesc num-args 2, num-type-args 0, names []
- [14] = ICData target-name 'complete', arg-desc CP#13
+ [14] = StaticICData target 'dart.async::_completeOnAsyncReturn', arg-desc CP#13
[15] = Type dynamic
[16] = ArgDesc num-args 3, num-type-args 0, names []
[17] = ICData target-name 'completeError', arg-desc CP#16
@@ -130,17 +127,15 @@
Try #0 start:
Push r4
PushConstant CP#12
- StoreLocal r8
StoreFieldTOS CP#6
- Push r8
- Drop1
Jump L2
L2:
Push r4
LoadFieldTOS CP#4
Push r4
LoadFieldTOS CP#6
- InstanceCall1 2, CP#14
+ PushConstant CP#14
+ IndirectStaticCall 2, CP#13
Drop1
PushConstant CP#5
ReturnTOS
@@ -184,7 +179,7 @@
:return_value = 42;
break #L1;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
@@ -201,22 +196,18 @@
Entry 4
CheckStack
AllocateContext 2
- StoreLocal r1
- Push r1
- Push r0
- StoreFieldTOS CP#0
PopLocal r0
Push r0
Push FP[-6]
- StoreFieldTOS CP#1
+ StoreFieldTOS CP#0
Push r0
Push FP[-5]
- StoreFieldTOS CP#2
+ StoreFieldTOS CP#1
AllocateContext 9
StoreLocal r1
Push r1
Push r0
- StoreFieldTOS CP#0
+ StoreFieldTOS CP#2
PopLocal r0
Push r0
PushConstant CP#3
@@ -236,10 +227,10 @@
StoreFieldTOS CP#10
Push r0
PushConstant CP#11
- StoreFieldTOS CP#1
+ StoreFieldTOS CP#0
Push r0
PushConstant CP#7
- StoreFieldTOS CP#2
+ StoreFieldTOS CP#1
Push r0
PushConstant CP#7
StoreFieldTOS CP#12
@@ -266,26 +257,19 @@
LoadFieldTOS CP#17
PushConstant CP#33
IndirectStaticCall 1, CP#4
- StoreLocal r2
- Drop1
+ PopLocal r2
Push r0
Push r0
LoadFieldTOS CP#17
PushConstant CP#34
IndirectStaticCall 1, CP#4
- StoreLocal r3
StoreFieldTOS CP#9
- Push r3
- Drop1
Push r0
Push r0
LoadFieldTOS CP#17
PushConstant CP#35
IndirectStaticCall 1, CP#4
- StoreLocal r3
StoreFieldTOS CP#10
- Push r3
- Drop1
PushConstant CP#36
Push r0
LoadFieldTOS CP#17
@@ -297,15 +281,15 @@
InstanceCall1 1, CP#38
ReturnTOS
Push r0
- LoadFieldTOS CP#0
+ LoadFieldTOS CP#2
PopLocal r0
PushConstant CP#7
ReturnTOS
}
ConstantPool {
- [0] = ContextOffset parent
- [1] = ContextOffset var [0]
- [2] = ContextOffset var [1]
+ [0] = ContextOffset var [0]
+ [1] = ContextOffset var [1]
+ [2] = ContextOffset parent
[3] = TypeArgumentsForInstanceAllocation dart.async::Completer [dart.core::int]
[4] = ArgDesc num-args 1, num-type-args 0, names []
[5] = StaticICData target 'dart.async::Completer::sync', arg-desc CP#4
@@ -327,7 +311,7 @@
[21] = StaticICData target 'dart.async::_awaitHelper', arg-desc CP#18
[22] = ArgDesc num-args 2, num-type-args 0, names []
[23] = ICData target-name '+', arg-desc CP#22
- [24] = ICData target-name 'complete', arg-desc CP#22
+ [24] = StaticICData target 'dart.async::_completeOnAsyncReturn', arg-desc CP#22
[25] = Type dynamic
[26] = ArgDesc num-args 3, num-type-args 0, names []
[27] = ICData target-name 'completeError', arg-desc CP#26
@@ -354,7 +338,7 @@
LoadFieldTOS CP#15
PopLocal r4
Push r4
- LoadFieldTOS CP#1
+ LoadFieldTOS CP#0
StoreLocal r5
PushConstant CP#11
IfNeStrictNumTOS
@@ -365,13 +349,13 @@
Try #0 start:
Push r4
PushConstant CP#16
+ StoreFieldTOS CP#0
+ Push r4
+ Push r4
StoreFieldTOS CP#1
Push r4
- Push r4
- StoreFieldTOS CP#2
- Push r4
+ LoadFieldTOS CP#2
LoadFieldTOS CP#0
- LoadFieldTOS CP#1
Push r4
LoadFieldTOS CP#9
Push r4
@@ -392,19 +376,16 @@
L2:
Push r4
Push r1
- StoreLocal r8
StoreFieldTOS CP#13
- Push r8
- Drop1
Push r4
PushConstant CP#20
+ StoreFieldTOS CP#0
+ Push r4
+ Push r4
StoreFieldTOS CP#1
Push r4
- Push r4
- StoreFieldTOS CP#2
- Push r4
- LoadFieldTOS CP#0
LoadFieldTOS CP#2
+ LoadFieldTOS CP#1
Push r4
LoadFieldTOS CP#9
Push r4
@@ -428,17 +409,15 @@
LoadFieldTOS CP#13
Push r1
InstanceCall1 2, CP#23
- StoreLocal r8
StoreFieldTOS CP#8
- Push r8
- Drop1
Jump L4
L4:
Push r4
LoadFieldTOS CP#6
Push r4
LoadFieldTOS CP#8
- InstanceCall1 2, CP#24
+ PushConstant CP#24
+ IndirectStaticCall 2, CP#22
Drop1
PushConstant CP#7
ReturnTOS
@@ -469,7 +448,7 @@
ReturnTOS
L1:
Push r4
- LoadFieldTOS CP#2
+ LoadFieldTOS CP#1
PopLocal r4
Push r5
PushConstant CP#16
@@ -498,7 +477,7 @@
:return_value = :async_temporary_0.{core::num::+}(:result);
break #L2;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
@@ -515,19 +494,15 @@
Entry 4
CheckStack
AllocateContext 1
- StoreLocal r1
- Push r1
- Push r0
- StoreFieldTOS CP#0
PopLocal r0
Push r0
Push FP[-5]
- StoreFieldTOS CP#1
+ StoreFieldTOS CP#0
AllocateContext 10
StoreLocal r1
Push r1
Push r0
- StoreFieldTOS CP#0
+ StoreFieldTOS CP#1
PopLocal r0
Push r0
PushConstant CP#2
@@ -547,7 +522,7 @@
StoreFieldTOS CP#9
Push r0
PushConstant CP#10
- StoreFieldTOS CP#1
+ StoreFieldTOS CP#0
Push r0
PushConstant CP#6
StoreFieldTOS CP#11
@@ -580,26 +555,19 @@
LoadFieldTOS CP#28
PushConstant CP#46
IndirectStaticCall 1, CP#3
- StoreLocal r2
- Drop1
+ PopLocal r2
Push r0
Push r0
LoadFieldTOS CP#28
PushConstant CP#47
IndirectStaticCall 1, CP#3
- StoreLocal r3
StoreFieldTOS CP#8
- Push r3
- Drop1
Push r0
Push r0
LoadFieldTOS CP#28
PushConstant CP#48
IndirectStaticCall 1, CP#3
- StoreLocal r3
StoreFieldTOS CP#9
- Push r3
- Drop1
PushConstant CP#49
Push r0
LoadFieldTOS CP#28
@@ -611,14 +579,14 @@
InstanceCall1 1, CP#51
ReturnTOS
Push r0
- LoadFieldTOS CP#0
+ LoadFieldTOS CP#1
PopLocal r0
PushConstant CP#6
ReturnTOS
}
ConstantPool {
- [0] = ContextOffset parent
- [1] = ContextOffset var [0]
+ [0] = ContextOffset var [0]
+ [1] = ContextOffset parent
[2] = TypeArgumentsForInstanceAllocation dart.async::Completer [dart.core::int]
[3] = ArgDesc num-args 1, num-type-args 0, names []
[4] = StaticICData target 'dart.async::Completer::sync', arg-desc CP#3
@@ -654,7 +622,7 @@
[34] = ICData target-name '<', arg-desc CP#18
[35] = ICData target-name '+', arg-desc CP#18
[36] = ICData target-name '+', arg-desc CP#18
- [37] = ICData target-name 'complete', arg-desc CP#18
+ [37] = StaticICData target 'dart.async::_completeOnAsyncReturn', arg-desc CP#18
[38] = Type dynamic
[39] = ArgDesc num-args 3, num-type-args 0, names []
[40] = ICData target-name 'completeError', arg-desc CP#39
@@ -681,7 +649,7 @@
LoadFieldTOS CP#16
PopLocal r4
Push r4
- LoadFieldTOS CP#1
+ LoadFieldTOS CP#0
StoreLocal r5
PushConstant CP#10
IfNeStrictNumTOS
@@ -694,24 +662,24 @@
StoreLocal r5
Push r5
Push r4
- StoreFieldTOS CP#0
+ StoreFieldTOS CP#1
PopLocal r4
Push r4
PushConstant CP#10
- StoreFieldTOS CP#1
+ StoreFieldTOS CP#0
AllocateContext 1
StoreLocal r5
Push r5
Push r4
- StoreFieldTOS CP#0
+ StoreFieldTOS CP#1
PopLocal r4
Push r4
PushConstant CP#10
- StoreFieldTOS CP#1
+ StoreFieldTOS CP#0
L6:
CheckStack
Push r4
- LoadFieldTOS CP#1
+ LoadFieldTOS CP#0
PushConstant CP#17
InstanceCall1 2, CP#19
AssertBoolean 0
@@ -722,23 +690,23 @@
StoreLocal r5
Push r5
Push r4
- StoreFieldTOS CP#0
+ StoreFieldTOS CP#1
PopLocal r4
Push r4
- LoadFieldTOS CP#0
- LoadFieldTOS CP#0
- LoadFieldTOS CP#0
- LoadFieldTOS CP#0
LoadFieldTOS CP#1
+ LoadFieldTOS CP#1
+ LoadFieldTOS CP#1
+ LoadFieldTOS CP#1
+ LoadFieldTOS CP#0
InstanceCall1 1, CP#21
PopLocal r8
Push r4
Push r8
- StoreFieldTOS CP#1
+ StoreFieldTOS CP#0
L5:
CheckStack
Push r4
- LoadFieldTOS CP#1
+ LoadFieldTOS CP#0
StoreLocal r8
InstanceCall1 1, CP#22
PushConstant CP#20
@@ -748,75 +716,69 @@
StoreLocal r5
Push r5
Push r4
- StoreFieldTOS CP#0
+ StoreFieldTOS CP#1
PopLocal r4
Push r4
Push r8
InstanceCall1 1, CP#23
- StoreFieldTOS CP#1
+ StoreFieldTOS CP#0
Push r4
- LoadFieldTOS CP#0
- LoadFieldTOS CP#0
- LoadFieldTOS CP#0
- LoadFieldTOS CP#0
- Push r4
- LoadFieldTOS CP#0
- LoadFieldTOS CP#0
- LoadFieldTOS CP#0
LoadFieldTOS CP#1
- StoreLocal r9
+ LoadFieldTOS CP#1
+ LoadFieldTOS CP#1
+ LoadFieldTOS CP#1
+ Push r4
+ LoadFieldTOS CP#1
+ LoadFieldTOS CP#1
+ LoadFieldTOS CP#1
+ LoadFieldTOS CP#0
StoreFieldTOS CP#14
- Push r9
- Drop1
Push r4
- LoadFieldTOS CP#0
- LoadFieldTOS CP#0
- LoadFieldTOS CP#0
- LoadFieldTOS CP#0
- Push r4
- LoadFieldTOS CP#0
- LoadFieldTOS CP#0
+ LoadFieldTOS CP#1
+ LoadFieldTOS CP#1
+ LoadFieldTOS CP#1
LoadFieldTOS CP#1
Push r4
LoadFieldTOS CP#1
+ LoadFieldTOS CP#1
+ LoadFieldTOS CP#0
+ Push r4
+ LoadFieldTOS CP#0
InstanceCall1 2, CP#24
- StoreLocal r9
StoreFieldTOS CP#13
- Push r9
- Drop1
Push r4
- LoadFieldTOS CP#0
- LoadFieldTOS CP#0
- LoadFieldTOS CP#0
- LoadFieldTOS CP#0
+ LoadFieldTOS CP#1
+ LoadFieldTOS CP#1
+ LoadFieldTOS CP#1
+ LoadFieldTOS CP#1
PushConstant CP#25
- StoreFieldTOS CP#1
+ StoreFieldTOS CP#0
Push r4
- LoadFieldTOS CP#0
- LoadFieldTOS CP#0
- LoadFieldTOS CP#0
- LoadFieldTOS CP#0
+ LoadFieldTOS CP#1
+ LoadFieldTOS CP#1
+ LoadFieldTOS CP#1
+ LoadFieldTOS CP#1
Push r4
StoreFieldTOS CP#11
PushConstant CP#27
IndirectStaticCall 0, CP#26
Push r4
- LoadFieldTOS CP#0
- LoadFieldTOS CP#0
- LoadFieldTOS CP#0
- LoadFieldTOS CP#0
+ LoadFieldTOS CP#1
+ LoadFieldTOS CP#1
+ LoadFieldTOS CP#1
+ LoadFieldTOS CP#1
LoadFieldTOS CP#8
Push r4
- LoadFieldTOS CP#0
- LoadFieldTOS CP#0
- LoadFieldTOS CP#0
- LoadFieldTOS CP#0
+ LoadFieldTOS CP#1
+ LoadFieldTOS CP#1
+ LoadFieldTOS CP#1
+ LoadFieldTOS CP#1
LoadFieldTOS CP#9
Push r4
- LoadFieldTOS CP#0
- LoadFieldTOS CP#0
- LoadFieldTOS CP#0
- LoadFieldTOS CP#0
+ LoadFieldTOS CP#1
+ LoadFieldTOS CP#1
+ LoadFieldTOS CP#1
+ LoadFieldTOS CP#1
LoadFieldTOS CP#28
PushConstant CP#30
IndirectStaticCall 4, CP#29
@@ -831,52 +793,49 @@
Throw 1
L4:
Push r4
- LoadFieldTOS CP#0
- LoadFieldTOS CP#0
- LoadFieldTOS CP#0
+ LoadFieldTOS CP#1
+ LoadFieldTOS CP#1
+ LoadFieldTOS CP#1
Push r4
- LoadFieldTOS CP#0
- LoadFieldTOS CP#0
- LoadFieldTOS CP#0
- LoadFieldTOS CP#0
+ LoadFieldTOS CP#1
+ LoadFieldTOS CP#1
+ LoadFieldTOS CP#1
+ LoadFieldTOS CP#1
LoadFieldTOS CP#14
Push r4
- LoadFieldTOS CP#0
- LoadFieldTOS CP#0
- LoadFieldTOS CP#0
- LoadFieldTOS CP#0
+ LoadFieldTOS CP#1
+ LoadFieldTOS CP#1
+ LoadFieldTOS CP#1
+ LoadFieldTOS CP#1
LoadFieldTOS CP#13
Push r1
InstanceCall1 2, CP#31
InstanceCall1 2, CP#32
- StoreLocal r9
- StoreFieldTOS CP#1
- Push r9
- Drop1
+ StoreFieldTOS CP#0
Push r4
- LoadFieldTOS CP#0
+ LoadFieldTOS CP#1
PopLocal r4
Jump L5
L3:
Push r4
- LoadFieldTOS CP#0
+ LoadFieldTOS CP#1
PopLocal r4
Push r4
CloneContext
PopLocal r4
Push r4
Push r4
- LoadFieldTOS CP#1
+ LoadFieldTOS CP#0
PushConstant CP#25
InstanceCall1 2, CP#33
StoreLocal r8
- StoreFieldTOS CP#1
+ StoreFieldTOS CP#0
Push r8
Drop1
Jump L6
L2:
Push r4
- LoadFieldTOS CP#0
+ LoadFieldTOS CP#1
PopLocal r4
PushConstant CP#10
PopLocal r8
@@ -891,13 +850,10 @@
Jump L7
Push r4
Push r4
- LoadFieldTOS CP#1
+ LoadFieldTOS CP#0
Push r8
InstanceCall1 2, CP#35
- StoreLocal r9
- StoreFieldTOS CP#1
- Push r9
- Drop1
+ StoreFieldTOS CP#0
Push r8
PushConstant CP#25
InstanceCall1 2, CP#36
@@ -906,26 +862,24 @@
Jump L8
L7:
Push r4
+ LoadFieldTOS CP#1
+ Push r4
LoadFieldTOS CP#0
+ StoreFieldTOS CP#7
Push r4
LoadFieldTOS CP#1
- StoreLocal r8
- StoreFieldTOS CP#7
- Push r8
- Drop1
- Push r4
- LoadFieldTOS CP#0
PopLocal r4
Jump L9
Push r4
- LoadFieldTOS CP#0
+ LoadFieldTOS CP#1
PopLocal r4
L9:
Push r4
LoadFieldTOS CP#5
Push r4
LoadFieldTOS CP#7
- InstanceCall1 2, CP#37
+ PushConstant CP#37
+ IndirectStaticCall 2, CP#18
Drop1
PushConstant CP#6
ReturnTOS
@@ -991,7 +945,7 @@
:return_value = sum;
break #L3;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
@@ -1008,25 +962,21 @@
Entry 4
CheckStack
AllocateContext 3
- StoreLocal r1
- Push r1
- Push r0
- StoreFieldTOS CP#0
PopLocal r0
Push r0
Push FP[-7]
- StoreFieldTOS CP#1
+ StoreFieldTOS CP#0
Push r0
Push FP[-6]
- StoreFieldTOS CP#2
+ StoreFieldTOS CP#1
Push r0
Push FP[-5]
- StoreFieldTOS CP#3
+ StoreFieldTOS CP#2
AllocateContext 13
StoreLocal r1
Push r1
Push r0
- StoreFieldTOS CP#0
+ StoreFieldTOS CP#3
PopLocal r0
Push r0
PushConstant CP#4
@@ -1046,10 +996,10 @@
StoreFieldTOS CP#11
Push r0
PushConstant CP#12
- StoreFieldTOS CP#1
+ StoreFieldTOS CP#0
Push r0
PushConstant CP#8
- StoreFieldTOS CP#2
+ StoreFieldTOS CP#1
Push r0
PushConstant CP#8
StoreFieldTOS CP#13
@@ -1067,7 +1017,7 @@
StoreFieldTOS CP#17
Push r0
PushConstant CP#8
- StoreFieldTOS CP#3
+ StoreFieldTOS CP#2
Push r0
Allocate CP#51
StoreLocal r3
@@ -1088,26 +1038,19 @@
LoadFieldTOS CP#21
PushConstant CP#55
IndirectStaticCall 1, CP#5
- StoreLocal r2
- Drop1
+ PopLocal r2
Push r0
Push r0
LoadFieldTOS CP#21
PushConstant CP#56
IndirectStaticCall 1, CP#5
- StoreLocal r3
StoreFieldTOS CP#10
- Push r3
- Drop1
Push r0
Push r0
LoadFieldTOS CP#21
PushConstant CP#57
IndirectStaticCall 1, CP#5
- StoreLocal r3
StoreFieldTOS CP#11
- Push r3
- Drop1
PushConstant CP#58
Push r0
LoadFieldTOS CP#21
@@ -1119,16 +1062,16 @@
InstanceCall1 1, CP#60
ReturnTOS
Push r0
- LoadFieldTOS CP#0
+ LoadFieldTOS CP#3
PopLocal r0
PushConstant CP#8
ReturnTOS
}
ConstantPool {
- [0] = ContextOffset parent
- [1] = ContextOffset var [0]
- [2] = ContextOffset var [1]
- [3] = ContextOffset var [2]
+ [0] = ContextOffset var [0]
+ [1] = ContextOffset var [1]
+ [2] = ContextOffset var [2]
+ [3] = ContextOffset parent
[4] = TypeArgumentsForInstanceAllocation dart.async::Completer [dart.core::int]
[5] = ArgDesc num-args 1, num-type-args 0, names []
[6] = StaticICData target 'dart.async::Completer::sync', arg-desc CP#5
@@ -1172,7 +1115,7 @@
[44] = Int 5
[45] = StaticICData target 'dart.async::_awaitHelper', arg-desc CP#22
[46] = ICData target-name '+', arg-desc CP#24
- [47] = ICData target-name 'complete', arg-desc CP#24
+ [47] = StaticICData target 'dart.async::_completeOnAsyncReturn', arg-desc CP#24
[48] = ArgDesc num-args 3, num-type-args 0, names []
[49] = ICData target-name 'completeError', arg-desc CP#48
[50] = EndClosureFunctionScope
@@ -1198,7 +1141,7 @@
LoadFieldTOS CP#19
PopLocal r4
Push r4
- LoadFieldTOS CP#1
+ LoadFieldTOS CP#0
StoreLocal r5
PushConstant CP#12
IfNeStrictNumTOS
@@ -1211,49 +1154,46 @@
StoreLocal r5
Push r5
Push r4
- StoreFieldTOS CP#0
+ StoreFieldTOS CP#3
PopLocal r4
Push r4
PushConstant CP#20
- StoreFieldTOS CP#1
+ StoreFieldTOS CP#0
Push r4
- LoadFieldTOS CP#0
+ LoadFieldTOS CP#3
Push r4
StoreFieldTOS CP#14
Try #1 start:
Push r4
- LoadFieldTOS CP#0
+ LoadFieldTOS CP#3
Push r4
StoreFieldTOS CP#15
Try #2 start:
Push r4
- LoadFieldTOS CP#0
- Push r4
- LoadFieldTOS CP#1
- StoreLocal r12
- StoreFieldTOS CP#3
- Push r12
- Drop1
+ LoadFieldTOS CP#3
Push r4
LoadFieldTOS CP#0
- PushConstant CP#20
- StoreFieldTOS CP#1
- Push r4
- LoadFieldTOS CP#0
- Push r4
StoreFieldTOS CP#2
Push r4
- LoadFieldTOS CP#0
- LoadFieldTOS CP#0
- LoadFieldTOS CP#1
+ LoadFieldTOS CP#3
+ PushConstant CP#20
+ StoreFieldTOS CP#0
Push r4
+ LoadFieldTOS CP#3
+ Push r4
+ StoreFieldTOS CP#1
+ Push r4
+ LoadFieldTOS CP#3
+ LoadFieldTOS CP#3
LoadFieldTOS CP#0
+ Push r4
+ LoadFieldTOS CP#3
LoadFieldTOS CP#10
Push r4
- LoadFieldTOS CP#0
+ LoadFieldTOS CP#3
LoadFieldTOS CP#11
Push r4
- LoadFieldTOS CP#0
+ LoadFieldTOS CP#3
LoadFieldTOS CP#21
PushConstant CP#23
IndirectStaticCall 4, CP#22
@@ -1269,14 +1209,11 @@
L2:
Push r4
Push r4
- LoadFieldTOS CP#0
LoadFieldTOS CP#3
+ LoadFieldTOS CP#2
Push r1
InstanceCall1 2, CP#25
- StoreLocal r12
- StoreFieldTOS CP#1
- Push r12
- Drop1
+ StoreFieldTOS CP#0
Jump L3
Try #2 end:
Try #2 handler:
@@ -1289,24 +1226,24 @@
MoveSpecial r10, exception
MoveSpecial r11, stackTrace
Push r4
- LoadFieldTOS CP#0
+ LoadFieldTOS CP#3
Push r10
StoreFieldTOS CP#16
Push r4
- LoadFieldTOS CP#0
+ LoadFieldTOS CP#3
Push r11
StoreFieldTOS CP#17
AllocateContext 1
StoreLocal r5
Push r5
Push r4
- StoreFieldTOS CP#0
+ StoreFieldTOS CP#3
PopLocal r4
Push r4
Push r10
- StoreFieldTOS CP#1
+ StoreFieldTOS CP#0
Push r4
- LoadFieldTOS CP#1
+ LoadFieldTOS CP#0
PushConstant CP#8
PushConstant CP#8
PushConstant CP#27
@@ -1316,51 +1253,45 @@
IfNeStrictTOS
Jump L4
Push r4
- LoadFieldTOS CP#0
- LoadFieldTOS CP#0
+ LoadFieldTOS CP#3
+ LoadFieldTOS CP#3
PushConstant CP#30
- StoreLocal r12
StoreFieldTOS CP#9
- Push r12
- Drop1
Jump L5
L4:
Push r4
- LoadFieldTOS CP#0
- LoadFieldTOS CP#0
+ LoadFieldTOS CP#3
+ LoadFieldTOS CP#3
Push r4
+ LoadFieldTOS CP#3
LoadFieldTOS CP#0
- LoadFieldTOS CP#1
- StoreLocal r12
- StoreFieldTOS CP#3
- Push r12
- Drop1
- Push r4
- LoadFieldTOS CP#0
- LoadFieldTOS CP#0
- PushConstant CP#31
- StoreFieldTOS CP#1
- Push r4
- LoadFieldTOS CP#0
- LoadFieldTOS CP#0
- Push r4
StoreFieldTOS CP#2
Push r4
- LoadFieldTOS CP#0
- LoadFieldTOS CP#0
- LoadFieldTOS CP#0
- LoadFieldTOS CP#2
+ LoadFieldTOS CP#3
+ LoadFieldTOS CP#3
+ PushConstant CP#31
+ StoreFieldTOS CP#0
Push r4
- LoadFieldTOS CP#0
- LoadFieldTOS CP#0
+ LoadFieldTOS CP#3
+ LoadFieldTOS CP#3
+ Push r4
+ StoreFieldTOS CP#1
+ Push r4
+ LoadFieldTOS CP#3
+ LoadFieldTOS CP#3
+ LoadFieldTOS CP#3
+ LoadFieldTOS CP#1
+ Push r4
+ LoadFieldTOS CP#3
+ LoadFieldTOS CP#3
LoadFieldTOS CP#10
Push r4
- LoadFieldTOS CP#0
- LoadFieldTOS CP#0
+ LoadFieldTOS CP#3
+ LoadFieldTOS CP#3
LoadFieldTOS CP#11
Push r4
- LoadFieldTOS CP#0
- LoadFieldTOS CP#0
+ LoadFieldTOS CP#3
+ LoadFieldTOS CP#3
LoadFieldTOS CP#21
PushConstant CP#32
IndirectStaticCall 4, CP#22
@@ -1375,29 +1306,26 @@
Throw 1
L6:
Push r4
- LoadFieldTOS CP#0
- Push r4
- LoadFieldTOS CP#0
- LoadFieldTOS CP#0
LoadFieldTOS CP#3
+ Push r4
+ LoadFieldTOS CP#3
+ LoadFieldTOS CP#3
+ LoadFieldTOS CP#2
Push r1
InstanceCall1 2, CP#33
- StoreLocal r12
- StoreFieldTOS CP#1
- Push r12
- Drop1
+ StoreFieldTOS CP#0
Push r4
- LoadFieldTOS CP#0
- LoadFieldTOS CP#0
+ LoadFieldTOS CP#3
+ LoadFieldTOS CP#3
LoadFieldTOS CP#16
Push r4
- LoadFieldTOS CP#0
- LoadFieldTOS CP#0
+ LoadFieldTOS CP#3
+ LoadFieldTOS CP#3
LoadFieldTOS CP#17
Throw 1
Drop1
Push r4
- LoadFieldTOS CP#0
+ LoadFieldTOS CP#3
PopLocal r4
Jump L3
L3:
@@ -1413,11 +1341,11 @@
MoveSpecial r8, exception
MoveSpecial r9, stackTrace
Push r4
- LoadFieldTOS CP#0
+ LoadFieldTOS CP#3
Push r8
StoreFieldTOS CP#16
Push r4
- LoadFieldTOS CP#0
+ LoadFieldTOS CP#3
Push r9
StoreFieldTOS CP#17
PushConstant CP#34
@@ -1425,33 +1353,30 @@
IndirectStaticCall 1, CP#5
Drop1
Push r4
- LoadFieldTOS CP#0
- Push r4
- LoadFieldTOS CP#1
- StoreLocal r10
- StoreFieldTOS CP#3
- Push r10
- Drop1
- Push r4
- LoadFieldTOS CP#0
- PushConstant CP#36
- StoreFieldTOS CP#1
- Push r4
- LoadFieldTOS CP#0
- Push r4
- StoreFieldTOS CP#2
- Push r4
- LoadFieldTOS CP#0
- LoadFieldTOS CP#0
LoadFieldTOS CP#3
Push r4
LoadFieldTOS CP#0
+ StoreFieldTOS CP#2
+ Push r4
+ LoadFieldTOS CP#3
+ PushConstant CP#36
+ StoreFieldTOS CP#0
+ Push r4
+ LoadFieldTOS CP#3
+ Push r4
+ StoreFieldTOS CP#1
+ Push r4
+ LoadFieldTOS CP#3
+ LoadFieldTOS CP#3
+ LoadFieldTOS CP#2
+ Push r4
+ LoadFieldTOS CP#3
LoadFieldTOS CP#10
Push r4
- LoadFieldTOS CP#0
+ LoadFieldTOS CP#3
LoadFieldTOS CP#11
Push r4
- LoadFieldTOS CP#0
+ LoadFieldTOS CP#3
LoadFieldTOS CP#21
PushConstant CP#37
IndirectStaticCall 4, CP#22
@@ -1467,31 +1392,25 @@
L8:
Push r4
Push r4
- LoadFieldTOS CP#0
LoadFieldTOS CP#3
+ LoadFieldTOS CP#2
Push r1
InstanceCall1 2, CP#38
- StoreLocal r10
- StoreFieldTOS CP#1
- Push r10
- Drop1
+ StoreFieldTOS CP#0
+ Push r4
+ LoadFieldTOS CP#3
Push r4
LoadFieldTOS CP#0
- Push r4
- LoadFieldTOS CP#1
- StoreLocal r10
StoreFieldTOS CP#9
- Push r10
- Drop1
Push r4
- LoadFieldTOS CP#0
+ LoadFieldTOS CP#3
PopLocal r4
Jump L9
Push r4
- LoadFieldTOS CP#0
+ LoadFieldTOS CP#3
LoadFieldTOS CP#16
Push r4
- LoadFieldTOS CP#0
+ LoadFieldTOS CP#3
LoadFieldTOS CP#17
Throw 1
L5:
@@ -1506,33 +1425,30 @@
IndirectStaticCall 1, CP#5
Drop1
Push r4
- LoadFieldTOS CP#0
- Push r4
- LoadFieldTOS CP#1
- StoreLocal r10
- StoreFieldTOS CP#3
- Push r10
- Drop1
- Push r4
- LoadFieldTOS CP#0
- PushConstant CP#40
- StoreFieldTOS CP#1
- Push r4
- LoadFieldTOS CP#0
- Push r4
- StoreFieldTOS CP#2
- Push r4
- LoadFieldTOS CP#0
- LoadFieldTOS CP#0
LoadFieldTOS CP#3
Push r4
LoadFieldTOS CP#0
+ StoreFieldTOS CP#2
+ Push r4
+ LoadFieldTOS CP#3
+ PushConstant CP#40
+ StoreFieldTOS CP#0
+ Push r4
+ LoadFieldTOS CP#3
+ Push r4
+ StoreFieldTOS CP#1
+ Push r4
+ LoadFieldTOS CP#3
+ LoadFieldTOS CP#3
+ LoadFieldTOS CP#2
+ Push r4
+ LoadFieldTOS CP#3
LoadFieldTOS CP#10
Push r4
- LoadFieldTOS CP#0
+ LoadFieldTOS CP#3
LoadFieldTOS CP#11
Push r4
- LoadFieldTOS CP#0
+ LoadFieldTOS CP#3
LoadFieldTOS CP#21
PushConstant CP#41
IndirectStaticCall 4, CP#22
@@ -1548,28 +1464,22 @@
L10:
Push r4
Push r4
- LoadFieldTOS CP#0
LoadFieldTOS CP#3
+ LoadFieldTOS CP#2
Push r1
InstanceCall1 2, CP#42
- StoreLocal r10
- StoreFieldTOS CP#1
- Push r10
- Drop1
+ StoreFieldTOS CP#0
+ Push r4
+ LoadFieldTOS CP#3
Push r4
LoadFieldTOS CP#0
- Push r4
- LoadFieldTOS CP#1
- StoreLocal r10
StoreFieldTOS CP#9
- Push r10
- Drop1
Push r4
- LoadFieldTOS CP#0
+ LoadFieldTOS CP#3
PopLocal r4
Jump L9
Push r4
- LoadFieldTOS CP#0
+ LoadFieldTOS CP#3
PopLocal r4
Jump L9
L7:
@@ -1584,33 +1494,30 @@
IndirectStaticCall 1, CP#5
Drop1
Push r4
- LoadFieldTOS CP#0
- Push r4
- LoadFieldTOS CP#1
- StoreLocal r10
- StoreFieldTOS CP#3
- Push r10
- Drop1
- Push r4
- LoadFieldTOS CP#0
- PushConstant CP#44
- StoreFieldTOS CP#1
- Push r4
- LoadFieldTOS CP#0
- Push r4
- StoreFieldTOS CP#2
- Push r4
- LoadFieldTOS CP#0
- LoadFieldTOS CP#0
LoadFieldTOS CP#3
Push r4
LoadFieldTOS CP#0
+ StoreFieldTOS CP#2
+ Push r4
+ LoadFieldTOS CP#3
+ PushConstant CP#44
+ StoreFieldTOS CP#0
+ Push r4
+ LoadFieldTOS CP#3
+ Push r4
+ StoreFieldTOS CP#1
+ Push r4
+ LoadFieldTOS CP#3
+ LoadFieldTOS CP#3
+ LoadFieldTOS CP#2
+ Push r4
+ LoadFieldTOS CP#3
LoadFieldTOS CP#10
Push r4
- LoadFieldTOS CP#0
+ LoadFieldTOS CP#3
LoadFieldTOS CP#11
Push r4
- LoadFieldTOS CP#0
+ LoadFieldTOS CP#3
LoadFieldTOS CP#21
PushConstant CP#45
IndirectStaticCall 4, CP#22
@@ -1626,35 +1533,30 @@
L11:
Push r4
Push r4
- LoadFieldTOS CP#0
LoadFieldTOS CP#3
+ LoadFieldTOS CP#2
Push r1
InstanceCall1 2, CP#46
- StoreLocal r10
- StoreFieldTOS CP#1
- Push r10
- Drop1
+ StoreFieldTOS CP#0
+ Push r4
+ LoadFieldTOS CP#3
Push r4
LoadFieldTOS CP#0
- Push r4
- LoadFieldTOS CP#1
- StoreLocal r10
StoreFieldTOS CP#9
- Push r10
- Drop1
Push r4
- LoadFieldTOS CP#0
+ LoadFieldTOS CP#3
PopLocal r4
Jump L9
Push r4
- LoadFieldTOS CP#0
+ LoadFieldTOS CP#3
PopLocal r4
L9:
Push r4
LoadFieldTOS CP#7
Push r4
LoadFieldTOS CP#9
- InstanceCall1 2, CP#47
+ PushConstant CP#47
+ IndirectStaticCall 2, CP#24
Drop1
PushConstant CP#8
ReturnTOS
@@ -1685,7 +1587,7 @@
ReturnTOS
L1:
Push r4
- LoadFieldTOS CP#2
+ LoadFieldTOS CP#1
PopLocal r4
Push r5
PushConstant CP#20
@@ -1750,7 +1652,7 @@
break #L4;
}
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
@@ -1767,23 +1669,19 @@
Entry 4
CheckStack
AllocateContext 1
- StoreLocal r1
- Push r1
- Push r0
- StoreFieldTOS CP#0
PopLocal r0
Push r0
Push FP[-5]
- StoreFieldTOS CP#1
+ StoreFieldTOS CP#0
AllocateContext 1
StoreLocal r1
Push r1
Push r0
- StoreFieldTOS CP#0
+ StoreFieldTOS CP#1
PopLocal r0
Push r0
PushConstant CP#2
- StoreFieldTOS CP#1
+ StoreFieldTOS CP#0
Allocate CP#35
StoreLocal r3
Push r3
@@ -1802,14 +1700,14 @@
Push r2
ReturnTOS
Push r0
- LoadFieldTOS CP#0
+ LoadFieldTOS CP#1
PopLocal r0
PushConstant CP#9
ReturnTOS
}
ConstantPool {
- [0] = ContextOffset parent
- [1] = ContextOffset var [0]
+ [0] = ContextOffset var [0]
+ [1] = ContextOffset parent
[2] = Int 3
[3] = ClosureFunction nested () → dart.async::Future<dart.core::int> /* originally async */ ;
[4] = FieldOffset dart.core::_Closure::_context
@@ -1839,7 +1737,7 @@
[28] = StaticICData target 'dart.core::print', arg-desc CP#6
[29] = StaticICData target 'dart.core::print', arg-desc CP#6
[30] = StaticICData target 'dart.core::print', arg-desc CP#6
- [31] = ICData target-name 'complete', arg-desc CP#24
+ [31] = StaticICData target 'dart.async::_completeOnAsyncReturn', arg-desc CP#24
[32] = ArgDesc num-args 3, num-type-args 0, names []
[33] = ICData target-name 'completeError', arg-desc CP#32
[34] = EndClosureFunctionScope
@@ -1866,7 +1764,7 @@
LoadFieldTOS CP#4
PopLocal r4
Push r4
- LoadFieldTOS CP#1
+ LoadFieldTOS CP#0
StoreLocal r5
PushConstant CP#13
IfNeStrictNumTOS
@@ -1879,45 +1777,42 @@
StoreLocal r5
Push r5
Push r4
- StoreFieldTOS CP#0
+ StoreFieldTOS CP#1
PopLocal r4
Push r4
PushConstant CP#18
- StoreFieldTOS CP#1
+ StoreFieldTOS CP#0
Push r4
- LoadFieldTOS CP#0
+ LoadFieldTOS CP#1
Push r4
StoreFieldTOS CP#16
Try #1 start:
Push r4
- LoadFieldTOS CP#0
- LoadFieldTOS CP#0
+ LoadFieldTOS CP#1
+ LoadFieldTOS CP#1
PushConstant CP#19
- StoreLocal r10
- StoreFieldTOS CP#1
- Push r10
- Drop1
+ StoreFieldTOS CP#0
Push r4
- LoadFieldTOS CP#0
+ LoadFieldTOS CP#1
PushConstant CP#20
- StoreFieldTOS CP#1
+ StoreFieldTOS CP#0
Push r4
- LoadFieldTOS CP#0
+ LoadFieldTOS CP#1
Push r4
StoreFieldTOS CP#14
Push r4
- LoadFieldTOS CP#0
- LoadFieldTOS CP#0
- LoadFieldTOS CP#0
LoadFieldTOS CP#1
- Push r4
+ LoadFieldTOS CP#1
+ LoadFieldTOS CP#1
LoadFieldTOS CP#0
+ Push r4
+ LoadFieldTOS CP#1
LoadFieldTOS CP#11
Push r4
- LoadFieldTOS CP#0
+ LoadFieldTOS CP#1
LoadFieldTOS CP#12
Push r4
- LoadFieldTOS CP#0
+ LoadFieldTOS CP#1
LoadFieldTOS CP#21
PushConstant CP#23
IndirectStaticCall 4, CP#22
@@ -1927,23 +1822,17 @@
L6:
Push r4
Push r1
- StoreLocal r10
- StoreFieldTOS CP#1
- Push r10
- Drop1
+ StoreFieldTOS CP#0
Push r4
- LoadFieldTOS CP#0
- Push r4
- LoadFieldTOS CP#0
- LoadFieldTOS CP#0
LoadFieldTOS CP#1
Push r4
LoadFieldTOS CP#1
+ LoadFieldTOS CP#1
+ LoadFieldTOS CP#0
+ Push r4
+ LoadFieldTOS CP#0
InstanceCall1 2, CP#25
- StoreLocal r10
StoreFieldTOS CP#10
- Push r10
- Drop1
Jump L2
Jump L3
Try #1 end:
@@ -1975,7 +1864,7 @@
IndirectStaticCall 1, CP#6
Drop1
Push r4
- LoadFieldTOS CP#0
+ LoadFieldTOS CP#1
PopLocal r4
Jump L4
L3:
@@ -1990,14 +1879,15 @@
IndirectStaticCall 1, CP#6
Drop1
Push r4
- LoadFieldTOS CP#0
+ LoadFieldTOS CP#1
PopLocal r4
L4:
Push r4
LoadFieldTOS CP#8
Push r4
LoadFieldTOS CP#10
- InstanceCall1 2, CP#31
+ PushConstant CP#31
+ IndirectStaticCall 2, CP#24
Drop1
PushConstant CP#9
ReturnTOS
@@ -2044,7 +1934,7 @@
StoreLocal r1
Push r1
Push r0
- StoreFieldTOS CP#0
+ StoreFieldTOS CP#1
PopLocal r0
Push r0
PushConstant CP#5
@@ -2064,7 +1954,7 @@
StoreFieldTOS CP#12
Push r0
PushConstant CP#13
- StoreFieldTOS CP#1
+ StoreFieldTOS CP#0
Push r0
PushConstant CP#9
StoreFieldTOS CP#14
@@ -2094,26 +1984,19 @@
LoadFieldTOS CP#21
PushConstant CP#39
IndirectStaticCall 1, CP#6
- StoreLocal r2
- Drop1
+ PopLocal r2
Push r0
Push r0
LoadFieldTOS CP#21
PushConstant CP#40
IndirectStaticCall 1, CP#6
- StoreLocal r3
StoreFieldTOS CP#11
- Push r3
- Drop1
Push r0
Push r0
LoadFieldTOS CP#21
PushConstant CP#41
IndirectStaticCall 1, CP#6
- StoreLocal r3
StoreFieldTOS CP#12
- Push r3
- Drop1
PushConstant CP#42
Push r0
LoadFieldTOS CP#21
@@ -2125,7 +2008,7 @@
InstanceCall1 1, CP#44
ReturnTOS
Push r0
- LoadFieldTOS CP#0
+ LoadFieldTOS CP#1
PopLocal r0
PushConstant CP#9
ReturnTOS
@@ -2159,7 +2042,7 @@
core::print("fin");
}
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
@@ -2178,19 +2061,15 @@
Entry 4
CheckStack
AllocateContext 1
- StoreLocal r1
- Push r1
- Push r0
- StoreFieldTOS CP#0
PopLocal r0
Push r0
Push FP[-5]
- StoreFieldTOS CP#1
+ StoreFieldTOS CP#0
AllocateContext 8
StoreLocal r1
Push r1
Push r0
- StoreFieldTOS CP#0
+ StoreFieldTOS CP#1
PopLocal r0
Push r0
PushConstant CP#2
@@ -2210,7 +2089,7 @@
StoreFieldTOS CP#9
Push r0
PushConstant CP#10
- StoreFieldTOS CP#1
+ StoreFieldTOS CP#0
Push r0
PushConstant CP#6
StoreFieldTOS CP#11
@@ -2218,64 +2097,57 @@
PushConstant CP#6
StoreFieldTOS CP#12
Push r0
- Allocate CP#32
+ Allocate CP#30
StoreLocal r3
Push r3
PushConstant CP#6
- StoreFieldTOS CP#33
+ StoreFieldTOS CP#31
Push r3
PushConstant CP#6
- StoreFieldTOS CP#34
+ StoreFieldTOS CP#32
Push r3
PushConstant CP#13
- StoreFieldTOS CP#35
+ StoreFieldTOS CP#33
Push r3
Push r0
StoreFieldTOS CP#14
StoreFieldTOS CP#16
Push r0
LoadFieldTOS CP#16
- PushConstant CP#36
+ PushConstant CP#34
IndirectStaticCall 1, CP#3
- StoreLocal r2
- Drop1
+ PopLocal r2
Push r0
Push r0
LoadFieldTOS CP#16
- PushConstant CP#37
+ PushConstant CP#35
IndirectStaticCall 1, CP#3
- StoreLocal r3
StoreFieldTOS CP#8
- Push r3
- Drop1
Push r0
Push r0
LoadFieldTOS CP#16
+ PushConstant CP#36
+ IndirectStaticCall 1, CP#3
+ StoreFieldTOS CP#9
+ PushConstant CP#37
+ Push r0
+ LoadFieldTOS CP#16
PushConstant CP#38
- IndirectStaticCall 1, CP#3
- StoreLocal r3
- StoreFieldTOS CP#9
- Push r3
- Drop1
- PushConstant CP#39
- Push r0
- LoadFieldTOS CP#16
- PushConstant CP#40
IndirectStaticCall 2, CP#20
Drop1
Push r0
LoadFieldTOS CP#5
- InstanceCall1 1, CP#41
+ InstanceCall1 1, CP#39
ReturnTOS
Push r0
- LoadFieldTOS CP#0
+ LoadFieldTOS CP#1
PopLocal r0
PushConstant CP#6
ReturnTOS
}
ConstantPool {
- [0] = ContextOffset parent
- [1] = ContextOffset var [0]
+ [0] = ContextOffset var [0]
+ [1] = ContextOffset parent
[2] = TypeArgumentsForInstanceAllocation dart.async::Completer [dart.core::int]
[3] = ArgDesc num-args 1, num-type-args 0, names []
[4] = StaticICData target 'dart.async::Completer::sync', arg-desc CP#3
@@ -2297,25 +2169,23 @@
[20] = ArgDesc num-args 2, num-type-args 0, names []
[21] = ICData target-name '==', arg-desc CP#20
[22] = Bool true
- [23] = Int 1161
- [24] = Int 1176
- [25] = ArgDesc num-args 3, num-type-args 0, names []
- [26] = StaticICData target 'dart.core::_AssertionError::_throwNew', arg-desc CP#25
- [27] = Int 7
- [28] = ICData target-name 'complete', arg-desc CP#20
- [29] = Type dynamic
- [30] = ICData target-name 'completeError', arg-desc CP#25
- [31] = EndClosureFunctionScope
- [32] = Class dart.core::_Closure
- [33] = FieldOffset dart.core::_Closure::_instantiator_type_arguments
- [34] = FieldOffset dart.core::_Closure::_function_type_arguments
- [35] = FieldOffset dart.core::_Closure::_function
- [36] = StaticICData target 'dart.async::_asyncStackTraceHelper', arg-desc CP#3
- [37] = StaticICData target 'dart.async::_asyncThenWrapperHelper', arg-desc CP#3
- [38] = StaticICData target 'dart.async::_asyncErrorWrapperHelper', arg-desc CP#3
- [39] = TypeArgumentsForInstanceAllocation dart.async::Future [dynamic]
- [40] = StaticICData target 'dart.async::Future::microtask', arg-desc CP#20
- [41] = ICData get target-name 'future', arg-desc CP#3
+ [23] = ArgDesc num-args 3, num-type-args 0, names []
+ [24] = StaticICData target 'dart.core::_AssertionError::_throwNew', arg-desc CP#23
+ [25] = Int 7
+ [26] = StaticICData target 'dart.async::_completeOnAsyncReturn', arg-desc CP#20
+ [27] = Type dynamic
+ [28] = ICData target-name 'completeError', arg-desc CP#23
+ [29] = EndClosureFunctionScope
+ [30] = Class dart.core::_Closure
+ [31] = FieldOffset dart.core::_Closure::_instantiator_type_arguments
+ [32] = FieldOffset dart.core::_Closure::_function_type_arguments
+ [33] = FieldOffset dart.core::_Closure::_function
+ [34] = StaticICData target 'dart.async::_asyncStackTraceHelper', arg-desc CP#3
+ [35] = StaticICData target 'dart.async::_asyncThenWrapperHelper', arg-desc CP#3
+ [36] = StaticICData target 'dart.async::_asyncErrorWrapperHelper', arg-desc CP#3
+ [37] = TypeArgumentsForInstanceAllocation dart.async::Future [dynamic]
+ [38] = StaticICData target 'dart.async::Future::microtask', arg-desc CP#20
+ [39] = ICData get target-name 'future', arg-desc CP#3
}
Closure CP#13 {
EntryOptional 1, 3, 0
@@ -2328,7 +2198,7 @@
LoadFieldTOS CP#14
PopLocal r4
Push r4
- LoadFieldTOS CP#1
+ LoadFieldTOS CP#0
StoreLocal r5
PushConstant CP#10
IfNeStrictNumTOS
@@ -2340,13 +2210,13 @@
JumpIfNoAsserts L2
Push r4
PushConstant CP#15
- StoreFieldTOS CP#1
+ StoreFieldTOS CP#0
Push r4
Push r4
StoreFieldTOS CP#11
Push r4
- LoadFieldTOS CP#0
LoadFieldTOS CP#1
+ LoadFieldTOS CP#0
Push r4
LoadFieldTOS CP#8
Push r4
@@ -2373,25 +2243,23 @@
PushConstant CP#22
IfEqStrictTOS
Jump L2
- PushConstant CP#23
- PushConstant CP#24
+ PushConstant CP#10
+ PushConstant CP#10
PushConstant CP#6
- PushConstant CP#26
- IndirectStaticCall 3, CP#25
+ PushConstant CP#24
+ IndirectStaticCall 3, CP#23
L2:
Push r4
- PushConstant CP#27
- StoreLocal r8
+ PushConstant CP#25
StoreFieldTOS CP#7
- Push r8
- Drop1
Jump L4
L4:
Push r4
LoadFieldTOS CP#5
Push r4
LoadFieldTOS CP#7
- InstanceCall1 2, CP#28
+ PushConstant CP#26
+ IndirectStaticCall 2, CP#20
Drop1
PushConstant CP#6
ReturnTOS
@@ -2414,7 +2282,7 @@
LoadFieldTOS CP#5
Push r8
Push r9
- InstanceCall1 3, CP#30
+ InstanceCall1 3, CP#28
Drop1
Jump L5
L5:
@@ -2447,7 +2315,7 @@
:return_value = 7;
break #L6;
}
- :async_completer.{asy::Completer::complete}(:return_value);
+ asy::_completeOnAsyncReturn(:async_completer, :return_value);
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
diff --git a/pkg/vm/testcases/bytecode/bootstrapping.dart.expect b/pkg/vm/testcases/bytecode/bootstrapping.dart.expect
index d135ff4..44fbe90 100644
--- a/pkg/vm/testcases/bytecode/bootstrapping.dart.expect
+++ b/pkg/vm/testcases/bytecode/bootstrapping.dart.expect
@@ -119,10 +119,7 @@
Push FP[-5]
PushConstant CP#4
IndirectStaticCall 2, CP#3
- StoreLocal r0
- Push r0
StoreStaticTOS CP#5
- Drop1
PushConstant CP#6
ReturnTOS
}
@@ -160,10 +157,7 @@
IndirectStaticCall 0, CP#8
PushConstant CP#10
IndirectStaticCall 2, CP#2
- StoreLocal r0
- Push r0
StoreStaticTOS CP#0
- Drop1
L1:
PushConstant CP#0
PushStatic CP#0
@@ -432,15 +426,9 @@
Entry 2
CheckStack
Push FP[-5]
- StoreLocal r0
- Push r0
StoreStaticTOS CP#0
- Drop1
PushConstant CP#1
- StoreLocal r1
- Push r1
StoreStaticTOS CP#2
- Drop1
PushConstant CP#1
ReturnTOS
}
@@ -485,10 +473,7 @@
PushConstant CP#5
PushStatic CP#5
InstanceCall1 1, CP#9
- StoreLocal r0
- Push r0
StoreStaticTOS CP#0
- Drop1
L3:
PushConstant CP#0
PushStatic CP#0
@@ -603,10 +588,7 @@
Entry 1
CheckStack
Push FP[-5]
- StoreLocal r0
- Push r0
StoreStaticTOS CP#0
- Drop1
PushConstant CP#1
ReturnTOS
}
@@ -622,20 +604,11 @@
Entry 3
CheckStack
Push FP[-7]
- StoreLocal r0
- Push r0
StoreStaticTOS CP#0
- Drop1
Push FP[-6]
- StoreLocal r1
- Push r1
StoreStaticTOS CP#1
- Drop1
Push FP[-5]
- StoreLocal r2
- Push r2
StoreStaticTOS CP#2
- Drop1
PushConstant CP#3
ReturnTOS
}
@@ -745,12 +718,9 @@
Entry 1
CheckStack
PushConstant CP#0
- StoreLocal r0
- Push r0
PushConstant CP#2
IndirectStaticCall 1, CP#1
Drop1
- Drop1
PushConstant CP#3
ReturnTOS
}
diff --git a/pkg/vm/testcases/bytecode/closures.dart b/pkg/vm/testcases/bytecode/closures.dart
index ff1c650..5e6359f 100644
--- a/pkg/vm/testcases/bytecode/closures.dart
+++ b/pkg/vm/testcases/bytecode/closures.dart
@@ -139,4 +139,10 @@
return intFunc;
}
+class D<T> {
+ foo(T t) {
+ return () => t;
+ }
+}
+
main() {}
diff --git a/pkg/vm/testcases/bytecode/closures.dart.expect b/pkg/vm/testcases/bytecode/closures.dart.expect
index af1ed56..ee760ea 100644
--- a/pkg/vm/testcases/bytecode/closures.dart.expect
+++ b/pkg/vm/testcases/bytecode/closures.dart.expect
@@ -193,264 +193,262 @@
;
[@vm.bytecode=
Bytecode {
- Entry 4
+ Entry 5
CheckStack
+ CheckFunctionTypeArgs 2, 0
AllocateContext 1
- StoreLocal r1
+ PopLocal r1
Push r1
- Push r0
- StoreFieldTOS CP#0
- PopLocal r0
- Push r0
Push FP[-5]
- StoreFieldTOS CP#1
- Allocate CP#38
- StoreLocal r3
- Push r3
- Push r0
- LoadFieldTOS CP#1
- LoadFieldTOS CP#17
- StoreFieldTOS CP#39
- Push r3
- Push FP[-6]
- StoreFieldTOS CP#4
- Push r3
- PushConstant CP#2
- StoreFieldTOS CP#40
- Push r3
+ StoreFieldTOS CP#0
+ Allocate CP#37
+ StoreLocal r4
+ Push r4
+ Push r1
+ LoadFieldTOS CP#0
+ LoadFieldTOS CP#16
+ StoreFieldTOS CP#38
+ Push r4
Push r0
StoreFieldTOS CP#3
- PopLocal r2
- PushConstant CP#49
- Push r2
- InstanceCall1 2, CP#50
+ Push r4
+ PushConstant CP#1
+ StoreFieldTOS CP#39
+ Push r4
+ Push r1
+ StoreFieldTOS CP#2
+ PopLocal r3
+ PushConstant CP#48
+ Push r3
+ InstanceCall1 2, CP#49
Drop1
- PushConstant CP#51
- Push r2
- InstanceCall1 2, CP#52
+ PushConstant CP#50
+ Push r3
+ InstanceCall1 2, CP#51
Drop1
- PushConstant CP#18
+ PushConstant CP#17
ReturnTOS
}
ConstantPool {
- [0] = ContextOffset parent
- [1] = ContextOffset var [0]
- [2] = ClosureFunction nested1 <T5 extends dart.core::Object = dynamic, T6 extends dart.core::Object = dynamic>() → void;
- [3] = FieldOffset dart.core::_Closure::_context
- [4] = FieldOffset dart.core::_Closure::_function_type_arguments
- [5] = Int 2
- [6] = Int 4
- [7] = ArgDesc num-args 4, num-type-args 0, names []
- [8] = StaticICData target 'dart._internal::_prependTypeArguments', arg-desc CP#7
- [9] = ClosureFunction nested2 <T7 extends dart.core::Object = dynamic, T8 extends dart.core::Object = dynamic>() → void;
- [10] = Int 6
- [11] = StaticICData target 'dart._internal::_prependTypeArguments', arg-desc CP#7
- [12] = ClosureFunction <anonymous closure> () → dart.core::Null;
- [13] = TypeArgs [dart.core::Type]
- [14] = Int 8
- [15] = Int 0
- [16] = Type #lib::A::T1
- [17] = TypeArgumentsFieldOffset #lib::A
- [18] = Null
- [19] = Int 1
- [20] = Type #lib::A::T2
- [21] = Type #lib::A::foo::T3
- [22] = Int 3
- [23] = Type #lib::A::foo::T4
- [24] = Type T5
- [25] = Int 5
- [26] = Type T6
- [27] = Type T7
- [28] = Int 7
- [29] = Type T8
- [30] = ArgDesc num-args 1, num-type-args 1, names []
- [31] = StaticICData target 'dart.core::List::_fromLiteral', arg-desc CP#30
- [32] = ArgDesc num-args 1, num-type-args 0, names []
- [33] = StaticICData target 'dart.core::print', arg-desc CP#32
- [34] = TypeArgs [#lib::A::T1, #lib::A::T2, #lib::A::foo::T3, #lib::A::foo::T4, T5, T6, T7, T8]
- [35] = ArgDesc num-args 0, num-type-args 8, names []
- [36] = StaticICData target '#lib::callWithArgs', arg-desc CP#35
- [37] = EndClosureFunctionScope
- [38] = Class dart.core::_Closure
- [39] = FieldOffset dart.core::_Closure::_instantiator_type_arguments
- [40] = FieldOffset dart.core::_Closure::_function
- [41] = ICData target-name 'call', arg-desc CP#32
- [42] = EndClosureFunctionScope
- [43] = TypeArgs [#lib::C7, #lib::C8]
- [44] = ArgDesc num-args 1, num-type-args 2, names []
- [45] = ICData target-name 'call', arg-desc CP#44
- [46] = TypeArgs [dart.core::List<#lib::C7>, dart.core::List<#lib::C8>]
- [47] = ICData target-name 'call', arg-desc CP#44
- [48] = EndClosureFunctionScope
- [49] = TypeArgs [#lib::C5, #lib::C6]
- [50] = ICData target-name 'call', arg-desc CP#44
- [51] = TypeArgs [dart.core::List<#lib::C5>, dart.core::List<#lib::C6>]
- [52] = ICData target-name 'call', arg-desc CP#44
+ [0] = ContextOffset var [0]
+ [1] = ClosureFunction nested1 <T5 extends dart.core::Object = dynamic, T6 extends dart.core::Object = dynamic>() → void;
+ [2] = FieldOffset dart.core::_Closure::_context
+ [3] = FieldOffset dart.core::_Closure::_function_type_arguments
+ [4] = Int 2
+ [5] = Int 4
+ [6] = ArgDesc num-args 4, num-type-args 0, names []
+ [7] = StaticICData target 'dart._internal::_prependTypeArguments', arg-desc CP#6
+ [8] = ClosureFunction nested2 <T7 extends dart.core::Object = dynamic, T8 extends dart.core::Object = dynamic>() → void;
+ [9] = Int 6
+ [10] = StaticICData target 'dart._internal::_prependTypeArguments', arg-desc CP#6
+ [11] = ClosureFunction <anonymous closure> () → dart.core::Null;
+ [12] = TypeArgs [dart.core::Type]
+ [13] = Int 8
+ [14] = Int 0
+ [15] = Type #lib::A::T1
+ [16] = TypeArgumentsFieldOffset #lib::A
+ [17] = Null
+ [18] = Int 1
+ [19] = Type #lib::A::T2
+ [20] = Type #lib::A::foo::T3
+ [21] = Int 3
+ [22] = Type #lib::A::foo::T4
+ [23] = Type T5
+ [24] = Int 5
+ [25] = Type T6
+ [26] = Type T7
+ [27] = Int 7
+ [28] = Type T8
+ [29] = ArgDesc num-args 1, num-type-args 1, names []
+ [30] = StaticICData target 'dart.core::List::_fromLiteral', arg-desc CP#29
+ [31] = ArgDesc num-args 1, num-type-args 0, names []
+ [32] = StaticICData target 'dart.core::print', arg-desc CP#31
+ [33] = TypeArgs [#lib::A::T1, #lib::A::T2, #lib::A::foo::T3, #lib::A::foo::T4, T5, T6, T7, T8]
+ [34] = ArgDesc num-args 0, num-type-args 8, names []
+ [35] = StaticICData target '#lib::callWithArgs', arg-desc CP#34
+ [36] = EndClosureFunctionScope
+ [37] = Class dart.core::_Closure
+ [38] = FieldOffset dart.core::_Closure::_instantiator_type_arguments
+ [39] = FieldOffset dart.core::_Closure::_function
+ [40] = ICData target-name 'call', arg-desc CP#31
+ [41] = EndClosureFunctionScope
+ [42] = TypeArgs [#lib::C7, #lib::C8]
+ [43] = ArgDesc num-args 1, num-type-args 2, names []
+ [44] = ICData target-name 'call', arg-desc CP#43
+ [45] = TypeArgs [dart.core::List<#lib::C7>, dart.core::List<#lib::C8>]
+ [46] = ICData target-name 'call', arg-desc CP#43
+ [47] = EndClosureFunctionScope
+ [48] = TypeArgs [#lib::C5, #lib::C6]
+ [49] = ICData target-name 'call', arg-desc CP#43
+ [50] = TypeArgs [dart.core::List<#lib::C5>, dart.core::List<#lib::C6>]
+ [51] = ICData target-name 'call', arg-desc CP#43
}
-Closure CP#12 {
+Closure CP#11 {
Entry 4
CheckStack
Push FP[-5]
- LoadFieldTOS CP#3
+ LoadFieldTOS CP#2
PopLocal r1
Push FP[-5]
- LoadFieldTOS CP#4
+ LoadFieldTOS CP#3
PopLocal r0
- PushConstant CP#13
+ PushConstant CP#12
StoreLocal r3
Push r3
- PushConstant CP#14
+ PushConstant CP#13
CreateArrayTOS
StoreLocal r3
Push r3
- PushConstant CP#15
+ PushConstant CP#14
Push r1
- LoadFieldTOS CP#1
- LoadFieldTOS CP#17
- PushConstant CP#18
- InstantiateType CP#16
+ LoadFieldTOS CP#0
+ LoadFieldTOS CP#16
+ PushConstant CP#17
+ InstantiateType CP#15
StoreIndexedTOS
Push r3
- PushConstant CP#19
- Push r1
- LoadFieldTOS CP#1
- LoadFieldTOS CP#17
PushConstant CP#18
+ Push r1
+ LoadFieldTOS CP#0
+ LoadFieldTOS CP#16
+ PushConstant CP#17
+ InstantiateType CP#19
+ StoreIndexedTOS
+ Push r3
+ PushConstant CP#4
+ PushConstant CP#17
+ Push r0
InstantiateType CP#20
StoreIndexedTOS
Push r3
- PushConstant CP#5
- PushConstant CP#18
+ PushConstant CP#21
+ PushConstant CP#17
Push r0
- InstantiateType CP#21
+ InstantiateType CP#22
StoreIndexedTOS
Push r3
- PushConstant CP#22
- PushConstant CP#18
+ PushConstant CP#5
+ PushConstant CP#17
Push r0
InstantiateType CP#23
StoreIndexedTOS
Push r3
- PushConstant CP#6
- PushConstant CP#18
+ PushConstant CP#24
+ PushConstant CP#17
Push r0
- InstantiateType CP#24
+ InstantiateType CP#25
StoreIndexedTOS
Push r3
- PushConstant CP#25
- PushConstant CP#18
+ PushConstant CP#9
+ PushConstant CP#17
Push r0
InstantiateType CP#26
StoreIndexedTOS
Push r3
- PushConstant CP#10
- PushConstant CP#18
+ PushConstant CP#27
+ PushConstant CP#17
Push r0
- InstantiateType CP#27
+ InstantiateType CP#28
StoreIndexedTOS
- Push r3
- PushConstant CP#28
- PushConstant CP#18
- Push r0
- InstantiateType CP#29
- StoreIndexedTOS
- PushConstant CP#31
- IndirectStaticCall 2, CP#30
- PushConstant CP#33
- IndirectStaticCall 1, CP#32
+ PushConstant CP#30
+ IndirectStaticCall 2, CP#29
+ PushConstant CP#32
+ IndirectStaticCall 1, CP#31
Drop1
Push r1
- LoadFieldTOS CP#1
- LoadFieldTOS CP#17
+ LoadFieldTOS CP#0
+ LoadFieldTOS CP#16
Push r0
- InstantiateTypeArgumentsTOS 0, CP#34
- PushConstant CP#36
- IndirectStaticCall 1, CP#35
+ InstantiateTypeArgumentsTOS 0, CP#33
+ PushConstant CP#35
+ IndirectStaticCall 1, CP#34
Drop1
- PushConstant CP#18
+ PushConstant CP#17
ReturnTOS
}
-Closure CP#9 {
- Entry 4
+Closure CP#8 {
+ Entry 5
CheckStack
Push FP[-5]
- LoadFieldTOS CP#3
- PopLocal r0
- Push FP[-6]
- Push FP[-5]
- LoadFieldTOS CP#4
- PushConstant CP#6
- PushConstant CP#10
- PushConstant CP#11
- IndirectStaticCall 4, CP#7
- PopLocal FP[-6]
- Allocate CP#38
- StoreLocal r3
- Push r3
+ LoadFieldTOS CP#2
+ PopLocal r1
+ CheckFunctionTypeArgs 2, 0
Push r0
- LoadFieldTOS CP#1
- LoadFieldTOS CP#17
- StoreFieldTOS CP#39
- Push r3
- Push FP[-6]
- StoreFieldTOS CP#4
- Push r3
- PushConstant CP#12
- StoreFieldTOS CP#40
- Push r3
- Push r0
- StoreFieldTOS CP#3
- PopLocal r2
- Push r2
- InstanceCall1 1, CP#41
- Drop1
- PushConstant CP#18
- ReturnTOS
-
-}
-
-Closure CP#2 {
- Entry 4
- CheckStack
Push FP[-5]
LoadFieldTOS CP#3
- PopLocal r0
- Push FP[-6]
- Push FP[-5]
- LoadFieldTOS CP#4
PushConstant CP#5
- PushConstant CP#6
- PushConstant CP#8
- IndirectStaticCall 4, CP#7
- PopLocal FP[-6]
- Allocate CP#38
- StoreLocal r3
- Push r3
- Push r0
- LoadFieldTOS CP#1
- LoadFieldTOS CP#17
- StoreFieldTOS CP#39
- Push r3
- Push FP[-6]
- StoreFieldTOS CP#4
- Push r3
PushConstant CP#9
- StoreFieldTOS CP#40
- Push r3
+ PushConstant CP#10
+ IndirectStaticCall 4, CP#6
+ PopLocal r0
+ Allocate CP#37
+ StoreLocal r4
+ Push r4
+ Push r1
+ LoadFieldTOS CP#0
+ LoadFieldTOS CP#16
+ StoreFieldTOS CP#38
+ Push r4
Push r0
StoreFieldTOS CP#3
- PopLocal r2
- PushConstant CP#43
- Push r2
- InstanceCall1 2, CP#45
+ Push r4
+ PushConstant CP#11
+ StoreFieldTOS CP#39
+ Push r4
+ Push r1
+ StoreFieldTOS CP#2
+ PopLocal r3
+ Push r3
+ InstanceCall1 1, CP#40
Drop1
- PushConstant CP#46
- Push r2
- InstanceCall1 2, CP#47
+ PushConstant CP#17
+ ReturnTOS
+
+}
+
+Closure CP#1 {
+ Entry 5
+ CheckStack
+ Push FP[-5]
+ LoadFieldTOS CP#2
+ PopLocal r1
+ CheckFunctionTypeArgs 2, 0
+ Push r0
+ Push FP[-5]
+ LoadFieldTOS CP#3
+ PushConstant CP#4
+ PushConstant CP#5
+ PushConstant CP#7
+ IndirectStaticCall 4, CP#6
+ PopLocal r0
+ Allocate CP#37
+ StoreLocal r4
+ Push r4
+ Push r1
+ LoadFieldTOS CP#0
+ LoadFieldTOS CP#16
+ StoreFieldTOS CP#38
+ Push r4
+ Push r0
+ StoreFieldTOS CP#3
+ Push r4
+ PushConstant CP#8
+ StoreFieldTOS CP#39
+ Push r4
+ Push r1
+ StoreFieldTOS CP#2
+ PopLocal r3
+ PushConstant CP#42
+ Push r3
+ InstanceCall1 2, CP#44
Drop1
- PushConstant CP#18
+ PushConstant CP#45
+ Push r3
+ InstanceCall1 2, CP#46
+ Drop1
+ PushConstant CP#17
ReturnTOS
}
@@ -496,34 +494,30 @@
Entry 5
CheckStack
AllocateContext 1
- StoreLocal r1
- Push r1
- Push r0
- StoreFieldTOS CP#0
PopLocal r0
Push r0
Push FP[-5]
- StoreFieldTOS CP#1
+ StoreFieldTOS CP#0
AllocateContext 1
StoreLocal r1
Push r1
Push r0
- StoreFieldTOS CP#0
+ StoreFieldTOS CP#1
PopLocal r0
Push r0
PushConstant CP#2
- StoreFieldTOS CP#1
+ StoreFieldTOS CP#0
AllocateContext 1
StoreLocal r1
Push r1
Push r0
- StoreFieldTOS CP#0
+ StoreFieldTOS CP#1
PopLocal r0
PushConstant CP#3
PopLocal r2
Push r0
PushConstant CP#4
- StoreFieldTOS CP#1
+ StoreFieldTOS CP#0
Allocate CP#23
StoreLocal r4
Push r4
@@ -552,30 +546,30 @@
IndirectStaticCall 1, CP#19
Drop1
Push r0
- LoadFieldTOS CP#1
+ LoadFieldTOS CP#0
PushConstant CP#35
IndirectStaticCall 1, CP#19
Drop1
Push r0
- LoadFieldTOS CP#0
+ LoadFieldTOS CP#1
PopLocal r0
Push r0
- LoadFieldTOS CP#1
+ LoadFieldTOS CP#0
PushConstant CP#36
IndirectStaticCall 1, CP#19
Drop1
Push r0
- LoadFieldTOS CP#0
+ LoadFieldTOS CP#1
PopLocal r0
AllocateContext 1
StoreLocal r1
Push r1
Push r0
- StoreFieldTOS CP#0
+ StoreFieldTOS CP#1
PopLocal r0
Push r0
PushConstant CP#37
- StoreFieldTOS CP#1
+ StoreFieldTOS CP#0
Allocate CP#23
StoreLocal r3
Push r3
@@ -595,14 +589,14 @@
InstanceCall1 1, CP#41
Drop1
Push r0
- LoadFieldTOS CP#0
+ LoadFieldTOS CP#1
PopLocal r0
PushConstant CP#7
ReturnTOS
}
ConstantPool {
- [0] = ContextOffset parent
- [1] = ContextOffset var [0]
+ [0] = ContextOffset var [0]
+ [1] = ContextOffset parent
[2] = Int 1
[3] = Int 2
[4] = Int 3
@@ -651,35 +645,29 @@
LoadFieldTOS CP#6
PopLocal r0
Push r0
- LoadFieldTOS CP#0
- LoadFieldTOS CP#0
- Push r0
- LoadFieldTOS CP#0
- LoadFieldTOS CP#0
- LoadFieldTOS CP#0
LoadFieldTOS CP#1
+ LoadFieldTOS CP#1
+ Push r0
+ LoadFieldTOS CP#1
+ LoadFieldTOS CP#1
+ LoadFieldTOS CP#1
+ LoadFieldTOS CP#0
PushConstant CP#3
InstanceCall1 2, CP#18
- StoreLocal r2
- StoreFieldTOS CP#1
- Push r2
- Drop1
+ StoreFieldTOS CP#0
Push r0
Push r0
- LoadFieldTOS CP#0
- LoadFieldTOS CP#0
- LoadFieldTOS CP#0
- LoadFieldTOS CP#0
LoadFieldTOS CP#1
+ LoadFieldTOS CP#1
+ LoadFieldTOS CP#1
+ LoadFieldTOS CP#1
+ LoadFieldTOS CP#0
InstanceCall1 1, CP#20
Push r0
- LoadFieldTOS CP#0
LoadFieldTOS CP#1
+ LoadFieldTOS CP#0
InstanceCall1 2, CP#21
- StoreLocal r2
- StoreFieldTOS CP#1
- Push r2
- Drop1
+ StoreFieldTOS CP#0
PushConstant CP#7
ReturnTOS
@@ -691,6 +679,21 @@
Push FP[-6]
LoadFieldTOS CP#6
PopLocal r0
+ AllocateContext 1
+ StoreLocal r1
+ Push r1
+ Push r0
+ StoreFieldTOS CP#1
+ PopLocal r0
+ Push r0
+ LoadFieldTOS CP#1
+ LoadFieldTOS CP#1
+ LoadFieldTOS CP#1
+ Push FP[-5]
+ StoreFieldTOS CP#0
+ Push r0
+ Push FP[-5]
+ StoreFieldTOS CP#0
Push FP[-5]
PushConstant CP#7
PushConstant CP#7
@@ -698,36 +701,18 @@
PushConstant CP#9
AssertAssignable 1, CP#10
Drop1
- AllocateContext 1
- StoreLocal r1
- Push r1
- Push r0
- StoreFieldTOS CP#0
- PopLocal r0
- Push r0
- LoadFieldTOS CP#0
- LoadFieldTOS CP#0
- LoadFieldTOS CP#0
- Push FP[-5]
- StoreFieldTOS CP#1
- Push r0
- Push FP[-5]
- StoreFieldTOS CP#1
- Push r0
- LoadFieldTOS CP#0
- LoadFieldTOS CP#0
Push r0
LoadFieldTOS CP#1
+ LoadFieldTOS CP#1
+ Push r0
+ LoadFieldTOS CP#0
PushConstant CP#2
InstanceCall1 2, CP#12
- StoreLocal r2
- StoreFieldTOS CP#1
- Push r2
- Drop1
+ StoreFieldTOS CP#0
Push r0
- LoadFieldTOS CP#0
- LoadFieldTOS CP#0
LoadFieldTOS CP#1
+ LoadFieldTOS CP#1
+ LoadFieldTOS CP#0
PushConstant CP#13
InstanceCall1 2, CP#14
AssertBoolean 0
@@ -738,11 +723,11 @@
StoreLocal r1
Push r1
Push r0
- StoreFieldTOS CP#0
+ StoreFieldTOS CP#1
PopLocal r0
Push r0
PushConstant CP#16
- StoreFieldTOS CP#1
+ StoreFieldTOS CP#0
Allocate CP#23
StoreLocal r2
Push r2
@@ -762,12 +747,12 @@
InstanceCall1 1, CP#27
Drop1
Push r0
- LoadFieldTOS CP#1
+ LoadFieldTOS CP#0
PushConstant CP#28
IndirectStaticCall 1, CP#19
Drop1
Push r0
- LoadFieldTOS CP#0
+ LoadFieldTOS CP#1
PopLocal r0
L1:
PushConstant CP#7
@@ -782,15 +767,12 @@
LoadFieldTOS CP#6
PopLocal r0
Push r0
+ LoadFieldTOS CP#1
LoadFieldTOS CP#0
- LoadFieldTOS CP#1
Push r0
- LoadFieldTOS CP#1
- StoreLocal r2
+ LoadFieldTOS CP#0
InstanceCall1 2, CP#39
Drop1
- Push r2
- Drop1
PushConstant CP#7
ReturnTOS
@@ -1025,10 +1007,7 @@
LoadFieldTOS CP#0
LoadFieldTOS CP#2
InstanceCall1 2, CP#25
- StoreLocal r2
StoreFieldTOS CP#2
- Push r2
- Drop1
PushConstant CP#14
ReturnTOS
@@ -1142,10 +1121,7 @@
LoadFieldTOS CP#10
PushConstant CP#13
InstanceCall1 2, CP#15
- StoreLocal r2
StoreFieldTOS CP#10
- Push r2
- Drop1
PushConstant CP#0
ReturnTOS
@@ -1160,6 +1136,94 @@
}
}
}
+class D<T extends core::Object = dynamic> extends core::Object {
+[@vm.bytecode=
+Bytecode {
+ Entry 0
+ CheckStack
+ Push FP[-5]
+ PushConstant CP#1
+ IndirectStaticCall 1, CP#0
+ Drop1
+ PushConstant CP#2
+ ReturnTOS
+}
+ConstantPool {
+ [0] = ArgDesc num-args 1, num-type-args 0, names []
+ [1] = StaticICData target 'dart.core::Object::', arg-desc CP#0
+ [2] = Null
+}
+] synthetic constructor •() → void
+ : super core::Object::•()
+ ;
+[@vm.bytecode=
+Bytecode {
+ Entry 3
+ CheckStack
+ AllocateContext 1
+ PopLocal r0
+ Push r0
+ Push FP[-5]
+ StoreFieldTOS CP#0
+ Push FP[-5]
+ Push FP[-6]
+ LoadFieldTOS CP#1
+ PushConstant CP#2
+ PushConstant CP#3
+ PushConstant CP#4
+ AssertAssignable 0, CP#5
+ Drop1
+ Allocate CP#9
+ StoreLocal r2
+ Push r2
+ Push FP[-6]
+ LoadFieldTOS CP#1
+ StoreFieldTOS CP#10
+ Push r2
+ PushConstant CP#2
+ StoreFieldTOS CP#11
+ Push r2
+ PushConstant CP#6
+ StoreFieldTOS CP#12
+ Push r2
+ Push r0
+ StoreFieldTOS CP#7
+ ReturnTOS
+ PushConstant CP#2
+ ReturnTOS
+}
+ConstantPool {
+ [0] = ContextOffset var [0]
+ [1] = TypeArgumentsFieldOffset #lib::D
+ [2] = Null
+ [3] = Type #lib::D::T
+ [4] = String 't'
+ [5] = SubtypeTestCache
+ [6] = ClosureFunction <anonymous closure> () → #lib::D::T;
+ [7] = FieldOffset dart.core::_Closure::_context
+ [8] = EndClosureFunctionScope
+ [9] = Class dart.core::_Closure
+ [10] = FieldOffset dart.core::_Closure::_instantiator_type_arguments
+ [11] = FieldOffset dart.core::_Closure::_function_type_arguments
+ [12] = FieldOffset dart.core::_Closure::_function
+}
+Closure CP#6 {
+ Entry 2
+ CheckStack
+ Push FP[-5]
+ LoadFieldTOS CP#7
+ PopLocal r0
+ Push r0
+ LoadFieldTOS CP#0
+ ReturnTOS
+ PushConstant CP#2
+ ReturnTOS
+
+}
+] method foo(generic-covariant-impl self::D::T t) → dynamic {
+ return () → self::D::T => t;
+ }
+}
[@vm.bytecode=
Bytecode {
Entry 4
@@ -1239,10 +1303,7 @@
LoadFieldTOS CP#2
Push FP[-5]
InstanceCall1 2, CP#10
- StoreLocal r2
StoreFieldTOS CP#2
- Push r2
- Drop1
PushConstant CP#5
ReturnTOS
@@ -1257,60 +1318,61 @@
}
[@vm.bytecode=
Bytecode {
- Entry 1
+ Entry 2
CheckStack
+ CheckFunctionTypeArgs 8, 0
PushConstant CP#0
- StoreLocal r0
- Push r0
+ StoreLocal r1
+ Push r1
PushConstant CP#1
CreateArrayTOS
- StoreLocal r0
- Push r0
+ StoreLocal r1
+ Push r1
PushConstant CP#2
PushConstant CP#4
- Push FP[-5]
+ Push r0
InstantiateType CP#3
StoreIndexedTOS
- Push r0
+ Push r1
PushConstant CP#5
PushConstant CP#4
- Push FP[-5]
+ Push r0
InstantiateType CP#6
StoreIndexedTOS
- Push r0
+ Push r1
PushConstant CP#7
PushConstant CP#4
- Push FP[-5]
+ Push r0
InstantiateType CP#8
StoreIndexedTOS
- Push r0
+ Push r1
PushConstant CP#9
PushConstant CP#4
- Push FP[-5]
+ Push r0
InstantiateType CP#10
StoreIndexedTOS
- Push r0
+ Push r1
PushConstant CP#11
PushConstant CP#4
- Push FP[-5]
+ Push r0
InstantiateType CP#12
StoreIndexedTOS
- Push r0
+ Push r1
PushConstant CP#13
PushConstant CP#4
- Push FP[-5]
+ Push r0
InstantiateType CP#14
StoreIndexedTOS
- Push r0
+ Push r1
PushConstant CP#15
PushConstant CP#4
- Push FP[-5]
+ Push r0
InstantiateType CP#16
StoreIndexedTOS
- Push r0
+ Push r1
PushConstant CP#17
PushConstant CP#4
- Push FP[-5]
+ Push r0
InstantiateType CP#18
StoreIndexedTOS
PushConstant CP#20
@@ -1478,22 +1540,23 @@
[16] = FieldOffset dart.core::_Closure::_delayed_type_arguments
}
Closure CP#0 {
- Entry 2
+ Entry 3
CheckStack
Push FP[-6]
LoadFieldTOS CP#1
- PopLocal r0
- Push FP[-7]
+ PopLocal r1
+ CheckFunctionTypeArgs 1, 0
+ Push r0
Push FP[-6]
LoadFieldTOS CP#2
PushConstant CP#3
PushConstant CP#4
PushConstant CP#6
IndirectStaticCall 4, CP#5
- PopLocal FP[-7]
+ PopLocal r0
Push FP[-5]
PushConstant CP#7
- Push FP[-7]
+ Push r0
PushConstant CP#8
PushConstant CP#9
AssertAssignable 0, CP#10
diff --git a/pkg/vm/testcases/bytecode/instance_creation.dart.expect b/pkg/vm/testcases/bytecode/instance_creation.dart.expect
index 2ba4d37..aa8109a 100644
--- a/pkg/vm/testcases/bytecode/instance_creation.dart.expect
+++ b/pkg/vm/testcases/bytecode/instance_creation.dart.expect
@@ -468,15 +468,16 @@
}
[@vm.bytecode=
Bytecode {
- Entry 1
+ Entry 2
CheckStack
+ CheckFunctionTypeArgs 1, 0
PushConstant CP#1
- Push FP[-5]
+ Push r0
InstantiateTypeArgumentsTOS 0, CP#2
PushConstant CP#0
AllocateT
- StoreLocal r0
- Push r0
+ StoreLocal r1
+ Push r1
PushConstant CP#4
IndirectStaticCall 1, CP#3
Drop1
diff --git a/pkg/vm/testcases/bytecode/literals.dart.expect b/pkg/vm/testcases/bytecode/literals.dart.expect
index 7d6702f..2f2e512 100644
--- a/pkg/vm/testcases/bytecode/literals.dart.expect
+++ b/pkg/vm/testcases/bytecode/literals.dart.expect
@@ -497,26 +497,27 @@
}
[@vm.bytecode=
Bytecode {
- Entry 1
+ Entry 2
CheckStack
+ CheckFunctionTypeArgs 1, 0
PushConstant CP#0
PushConstant CP#1
PushConstant CP#2
CreateArrayTOS
- StoreLocal r0
- Push r0
+ StoreLocal r1
+ Push r1
PushConstant CP#3
PushConstant CP#4
StoreIndexedTOS
- Push r0
+ Push r1
PushConstant CP#4
Push FP[-7]
StoreIndexedTOS
- Push r0
+ Push r1
PushConstant CP#5
Push FP[-6]
StoreIndexedTOS
- Push r0
+ Push r1
PushConstant CP#6
PushConstant CP#5
StoreIndexedTOS
@@ -529,21 +530,21 @@
PushConstant CP#1
PushConstant CP#2
CreateArrayTOS
- StoreLocal r0
- Push r0
+ StoreLocal r1
+ Push r1
PushConstant CP#3
PushConstant CP#12
StoreIndexedTOS
- Push r0
+ Push r1
PushConstant CP#4
Push FP[-7]
StoreIndexedTOS
- Push r0
+ Push r1
PushConstant CP#5
Push FP[-6]
InstanceCall1 1, CP#13
StoreIndexedTOS
- Push r0
+ Push r1
PushConstant CP#6
PushConstant CP#6
StoreIndexedTOS
@@ -553,7 +554,7 @@
IndirectStaticCall 1, CP#9
Drop1
PushConstant CP#16
- Push FP[-8]
+ Push r0
InstantiateTypeArgumentsTOS 0, CP#17
PushConstant CP#18
PushConstant CP#19
@@ -562,17 +563,17 @@
IndirectStaticCall 1, CP#9
Drop1
PushConstant CP#16
- Push FP[-8]
+ Push r0
InstantiateTypeArgumentsTOS 0, CP#21
PushConstant CP#1
PushConstant CP#5
CreateArrayTOS
- StoreLocal r0
- Push r0
+ StoreLocal r1
+ Push r1
PushConstant CP#3
Push FP[-5]
StoreIndexedTOS
- Push r0
+ Push r1
PushConstant CP#4
PushConstant CP#2
StoreIndexedTOS
@@ -638,14 +639,15 @@
}
[@vm.bytecode=
Bytecode {
- Entry 0
+ Entry 1
CheckStack
+ CheckFunctionTypeArgs 1, 0
PushConstant CP#0
PushConstant CP#2
IndirectStaticCall 1, CP#1
Drop1
PushConstant CP#4
- Push FP[-5]
+ Push r0
InstantiateType CP#3
PushConstant CP#5
IndirectStaticCall 1, CP#1
diff --git a/pkg/vm/testcases/bytecode/loops.dart.expect b/pkg/vm/testcases/bytecode/loops.dart.expect
index fe91f5f..17a68e1 100644
--- a/pkg/vm/testcases/bytecode/loops.dart.expect
+++ b/pkg/vm/testcases/bytecode/loops.dart.expect
@@ -25,8 +25,7 @@
Push r1
InstanceCall1 2, CP#6
InstanceCall1 2, CP#7
- StoreLocal r0
- Drop1
+ PopLocal r0
Push r1
PushConstant CP#8
InstanceCall1 2, CP#9
@@ -91,8 +90,7 @@
Push r1
InstanceCall1 2, CP#7
InstanceCall1 2, CP#8
- StoreLocal r0
- Drop1
+ PopLocal r0
Push r1
PushConstant CP#9
InstanceCall1 2, CP#10
@@ -163,8 +161,7 @@
Push r1
InstanceCall1 2, CP#9
InstanceCall1 2, CP#10
- StoreLocal r0
- Drop1
+ PopLocal r0
L3:
Push r1
PushConstant CP#11
@@ -236,8 +233,7 @@
Push r2
InstanceCall1 2, CP#8
InstanceCall1 2, CP#9
- StoreLocal r0
- Drop1
+ PopLocal r0
Jump L2
L1:
Push r0
@@ -281,13 +277,11 @@
Push r1
InstanceCall1 2, CP#2
InstanceCall1 2, CP#3
- StoreLocal r0
- Drop1
+ PopLocal r0
Push r1
PushConstant CP#4
InstanceCall1 2, CP#5
- StoreLocal r1
- Drop1
+ PopLocal r1
Push r1
Push FP[-5]
InstanceCall1 1, CP#7
@@ -346,8 +340,7 @@
Push r0
Push r2
InstanceCall1 2, CP#7
- StoreLocal r0
- Drop1
+ PopLocal r0
Jump L2
L1:
Push r0
@@ -395,13 +388,11 @@
InstanceCall1 1, CP#6
PopLocal r3
Push r3
- StoreLocal r1
- Drop1
+ PopLocal r1
Push r0
Push r1
InstanceCall1 2, CP#8
- StoreLocal r0
- Drop1
+ PopLocal r0
Jump L2
L1:
Push r0
diff --git a/pkg/vm/testcases/bytecode/optional_params.dart b/pkg/vm/testcases/bytecode/optional_params.dart
index b41298a..908f596 100644
--- a/pkg/vm/testcases/bytecode/optional_params.dart
+++ b/pkg/vm/testcases/bytecode/optional_params.dart
@@ -16,6 +16,12 @@
print('c = $c');
}
+void foo3<P, Q>(z, y, {bool a: false, Map<P, Q> b}) {
+ print(P);
+ print(y);
+ print(b);
+}
+
main() {
foo1('fixed_x', 'concrete_a');
foo2('fixed_y', 'fixed_z', a: 'concrete_a');
diff --git a/pkg/vm/testcases/bytecode/optional_params.dart.expect b/pkg/vm/testcases/bytecode/optional_params.dart.expect
index c85a618..a8ae7f0 100644
--- a/pkg/vm/testcases/bytecode/optional_params.dart.expect
+++ b/pkg/vm/testcases/bytecode/optional_params.dart.expect
@@ -223,6 +223,49 @@
}
[@vm.bytecode=
Bytecode {
+ EntryOptional 2, 0, 2
+ LoadConstant r2, CP#0
+ LoadConstant r2, CP#1
+ LoadConstant r3, CP#2
+ LoadConstant r3, CP#3
+ Frame 1
+ CheckStack
+ CheckFunctionTypeArgs 2, 4
+ PushConstant CP#3
+ Push r4
+ InstantiateType CP#4
+ PushConstant CP#6
+ IndirectStaticCall 1, CP#5
+ Drop1
+ Push r1
+ PushConstant CP#7
+ IndirectStaticCall 1, CP#5
+ Drop1
+ Push r3
+ PushConstant CP#8
+ IndirectStaticCall 1, CP#5
+ Drop1
+ PushConstant CP#3
+ ReturnTOS
+}
+ConstantPool {
+ [0] = String 'a'
+ [1] = Bool false
+ [2] = String 'b'
+ [3] = Null
+ [4] = Type #lib::foo3::P
+ [5] = ArgDesc num-args 1, num-type-args 0, names []
+ [6] = StaticICData target 'dart.core::print', arg-desc CP#5
+ [7] = StaticICData target 'dart.core::print', arg-desc CP#5
+ [8] = StaticICData target 'dart.core::print', arg-desc CP#5
+}
+]static method foo3<P extends core::Object = dynamic, Q extends core::Object = dynamic>(dynamic z, dynamic y, {core::bool a = false, core::Map<self::foo3::P, self::foo3::Q> b = null}) → void {
+ core::print(self::foo3::P);
+ core::print(y);
+ core::print(b);
+}
+[@vm.bytecode=
+Bytecode {
Entry 0
CheckStack
PushConstant CP#0
diff --git a/pkg/vm/testcases/bytecode/switch.dart.expect b/pkg/vm/testcases/bytecode/switch.dart.expect
index c82563b..a7d303b 100644
--- a/pkg/vm/testcases/bytecode/switch.dart.expect
+++ b/pkg/vm/testcases/bytecode/switch.dart.expect
@@ -31,18 +31,15 @@
Jump L4
L1:
PushConstant CP#9
- StoreLocal r0
- Drop1
+ PopLocal r0
Jump L4
L2:
PushConstant CP#10
- StoreLocal r0
- Drop1
+ PopLocal r0
Jump L4
L3:
PushConstant CP#11
- StoreLocal r0
- Drop1
+ PopLocal r0
Jump L4
L4:
Push r0
@@ -136,18 +133,15 @@
Jump L3
L1:
PushConstant CP#15
- StoreLocal r0
- Drop1
+ PopLocal r0
Jump L4
L2:
PushConstant CP#16
- StoreLocal r0
- Drop1
+ PopLocal r0
Jump L4
L3:
PushConstant CP#17
- StoreLocal r0
- Drop1
+ PopLocal r0
L4:
Push r0
ReturnTOS
@@ -249,19 +243,16 @@
Jump L3
L1:
PushConstant CP#15
- StoreLocal r0
- Drop1
+ PopLocal r0
Jump L2
L2:
PushConstant CP#16
- StoreLocal r0
- Drop1
+ PopLocal r0
PushConstant CP#17
ReturnTOS
L3:
PushConstant CP#18
- StoreLocal r0
- Drop1
+ PopLocal r0
Push r0
ReturnTOS
PushConstant CP#0
diff --git a/pkg/vm/testcases/bytecode/try_blocks.dart.expect b/pkg/vm/testcases/bytecode/try_blocks.dart.expect
index bf677f1..baa0ac2 100644
--- a/pkg/vm/testcases/bytecode/try_blocks.dart.expect
+++ b/pkg/vm/testcases/bytecode/try_blocks.dart.expect
@@ -442,10 +442,7 @@
Drop1
Push r0
PushConstant CP#11
- StoreLocal r5
StoreFieldTOS CP#2
- Push r5
- Drop1
Jump L1
L1:
PushConstant CP#12
@@ -755,27 +752,23 @@
Entry 9
CheckStack
AllocateContext 1
- StoreLocal r1
- Push r1
- Push r0
- StoreFieldTOS CP#0
PopLocal r0
Push r0
Push FP[-5]
- StoreFieldTOS CP#1
+ StoreFieldTOS CP#0
Push r0
- LoadFieldTOS CP#1
+ LoadFieldTOS CP#0
PopLocal r2
Push r2
- PushConstant CP#3
- InstanceCall1 2, CP#4
- PushConstant CP#5
+ PushConstant CP#2
+ InstanceCall1 2, CP#3
+ PushConstant CP#4
IfEqStrictTOS
Jump L1
Push r2
- PushConstant CP#6
- InstanceCall1 2, CP#7
PushConstant CP#5
+ InstanceCall1 2, CP#6
+ PushConstant CP#4
IfEqStrictTOS
Jump L2
Jump L3
@@ -787,7 +780,7 @@
StoreLocal r1
Push r1
Push r0
- StoreFieldTOS CP#0
+ StoreFieldTOS CP#7
PopLocal r0
PushConstant CP#8
PushConstant CP#10
@@ -795,7 +788,7 @@
Drop1
Push r0
PushConstant CP#11
- StoreFieldTOS CP#1
+ StoreFieldTOS CP#0
Push r0
PopLocal r5
Try #1 start:
@@ -856,7 +849,7 @@
IndirectStaticCall 1, CP#9
Drop1
Push r0
- LoadFieldTOS CP#0
+ LoadFieldTOS CP#7
PopLocal r0
Jump L7
Try #0 end:
@@ -899,18 +892,18 @@
ReturnTOS
}
ExceptionsTable {
- try-index 0, outer -1, start 29, end 100, handler 100, needs-stack-trace, types [CP#25]
- try-index 1, outer 0, start 44, end 68, handler 68, needs-stack-trace, types [CP#25]
+ try-index 0, outer -1, start 25, end 96, handler 96, needs-stack-trace, types [CP#25]
+ try-index 1, outer 0, start 40, end 64, handler 64, needs-stack-trace, types [CP#25]
}
ConstantPool {
- [0] = ContextOffset parent
- [1] = ContextOffset var [0]
- [2] = ArgDesc num-args 2, num-type-args 0, names []
- [3] = Int 1
- [4] = ICData target-name '==', arg-desc CP#2
- [5] = Bool true
- [6] = Int 2
- [7] = ICData target-name '==', arg-desc CP#2
+ [0] = ContextOffset var [0]
+ [1] = ArgDesc num-args 2, num-type-args 0, names []
+ [2] = Int 1
+ [3] = ICData target-name '==', arg-desc CP#1
+ [4] = Bool true
+ [5] = Int 2
+ [6] = ICData target-name '==', arg-desc CP#1
+ [7] = ContextOffset parent
[8] = String 'before try 1'
[9] = ArgDesc num-args 1, num-type-args 0, names []
[10] = StaticICData target 'dart.core::print', arg-desc CP#9
@@ -949,13 +942,13 @@
LoadFieldTOS CP#15
PopLocal r0
Push r0
+ LoadFieldTOS CP#7
LoadFieldTOS CP#0
- LoadFieldTOS CP#1
PushConstant CP#16
IndirectStaticCall 1, CP#9
Drop1
Push r0
- LoadFieldTOS CP#1
+ LoadFieldTOS CP#0
PushConstant CP#17
IndirectStaticCall 1, CP#9
Drop1
@@ -1031,8 +1024,7 @@
Push r5
Push r0
StoreFieldTOS CP#5
- StoreLocal r2
- Drop1
+ PopLocal r2
Jump L1
Try #0 end:
Try #0 handler:
@@ -1069,7 +1061,7 @@
ReturnTOS
}
ExceptionsTable {
- try-index 0, outer -1, start 15, end 32, handler 32, needs-stack-trace, types [CP#11]
+ try-index 0, outer -1, start 15, end 31, handler 31, needs-stack-trace, types [CP#11]
}
ConstantPool {
[0] = ContextOffset parent
diff --git a/pkg/vm/testcases/bytecode/type_ops.dart.expect b/pkg/vm/testcases/bytecode/type_ops.dart.expect
index 9a60881..618b5b4 100644
--- a/pkg/vm/testcases/bytecode/type_ops.dart.expect
+++ b/pkg/vm/testcases/bytecode/type_ops.dart.expect
@@ -142,11 +142,8 @@
PushConstant CP#13
PushConstant CP#14
AssertAssignable 0, CP#15
- StoreLocal r0
InstanceCall1 2, CP#17
Drop1
- Push r0
- Drop1
PushConstant CP#1
ReturnTOS
}
@@ -181,11 +178,12 @@
}
[@vm.bytecode=
Bytecode {
- Entry 0
+ Entry 1
CheckStack
+ CheckFunctionTypeArgs 2, 0
Push FP[-5]
PushConstant CP#0
- Push FP[-7]
+ Push r0
PushConstant CP#1
InstanceCall1 4, CP#3
AssertBoolean 0
@@ -200,7 +198,7 @@
Push FP[-5]
Push FP[-6]
LoadFieldTOS CP#8
- Push FP[-7]
+ Push r0
PushConstant CP#9
InstanceCall1 4, CP#10
AssertBoolean 0
@@ -215,7 +213,7 @@
Push FP[-5]
Push FP[-6]
LoadFieldTOS CP#8
- Push FP[-7]
+ Push r0
PushConstant CP#13
InstanceCall1 4, CP#14
InstanceCall1 1, CP#15
@@ -322,24 +320,25 @@
return null;
[@vm.bytecode=
Bytecode {
- Entry 0
+ Entry 1
CheckStack
+ CheckFunctionTypeArgs 2, 0
Push FP[-6]
LoadFieldTOS CP#0
- Push FP[-7]
+ Push r0
PushConstant CP#1
PushConstant CP#2
PushConstant CP#3
AssertSubtype
PushConstant CP#4
- Push FP[-7]
+ Push r0
PushConstant CP#5
PushConstant CP#6
PushConstant CP#7
AssertSubtype
Push FP[-5]
PushConstant CP#4
- Push FP[-7]
+ Push r0
PushConstant CP#8
PushConstant CP#9
AssertAssignable 0, CP#10
@@ -439,10 +438,7 @@
PushConstant CP#1
PushConstant CP#2
AssertAssignable 0, CP#3
- StoreLocal r0
- Push r0
StoreStaticTOS CP#4
- Drop1
PushConstant CP#0
ReturnTOS
}
diff --git a/pkg/vm/testcases/transformations/type_flow/transformer/no_such_method.dart.expect b/pkg/vm/testcases/transformations/type_flow/transformer/no_such_method.dart.expect
index 79d7fdc..01c1009 100644
--- a/pkg/vm/testcases/transformations/type_flow/transformer/no_such_method.dart.expect
+++ b/pkg/vm/testcases/transformations/type_flow/transformer/no_such_method.dart.expect
@@ -51,7 +51,7 @@
return [@vm.direct-call.metadata=#lib::B::noSuchMethod] [@vm.inferred-type.metadata=#lib::T1] this.{self::B::noSuchMethod}(new core::_InvocationMirror::_withoutType("get:bar", const <core::Type>[], const <dynamic>[], [@vm.inferred-type.metadata=dart.collection::UnmodifiableMapView] core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} dynamic;
no-such-method-forwarder method foo() → dynamic
return [@vm.direct-call.metadata=#lib::B::noSuchMethod] [@vm.inferred-type.metadata=#lib::T1] this.{self::B::noSuchMethod}(new core::_InvocationMirror::_withoutType("foo", const <core::Type>[], const <dynamic>[], [@vm.inferred-type.metadata=dart.collection::UnmodifiableMapView] core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} dynamic;
- no-such-method-forwarder method bazz([@vm.inferred-type.metadata=!] dynamic a1, [@vm.inferred-type.metadata=!] dynamic a2, [@vm.inferred-type.metadata=!] dynamic a3, [[@vm.inferred-type.metadata=!] dynamic a4, [@vm.inferred-type.metadata=dart.core::Null?] dynamic a5]) → dynamic
+ no-such-method-forwarder method bazz([@vm.inferred-type.metadata=!] dynamic a1, [@vm.inferred-type.metadata=!] dynamic a2, [@vm.inferred-type.metadata=!] dynamic a3, [[@vm.inferred-type.metadata=!] dynamic a4 = null, [@vm.inferred-type.metadata=dart.core::Null?] dynamic a5 = null]) → dynamic
return [@vm.direct-call.metadata=#lib::B::noSuchMethod] [@vm.inferred-type.metadata=#lib::T1] this.{self::B::noSuchMethod}(new core::_InvocationMirror::_withoutType("bazz", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[a1, a2, a3, a4, a5]), [@vm.inferred-type.metadata=dart.collection::UnmodifiableMapView] core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} dynamic;
}
abstract class C extends core::Object {
@@ -70,7 +70,7 @@
return [@vm.direct-call.metadata=#lib::C::noSuchMethod] [@vm.inferred-type.metadata=#lib::T2] this.{self::C::noSuchMethod}(new core::_InvocationMirror::_withoutType("get:bar", const <core::Type>[], const <dynamic>[], [@vm.inferred-type.metadata=dart.collection::UnmodifiableMapView] core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} dynamic;
no-such-method-forwarder method foo() → dynamic
return [@vm.direct-call.metadata=#lib::C::noSuchMethod] [@vm.inferred-type.metadata=#lib::T2] this.{self::C::noSuchMethod}(new core::_InvocationMirror::_withoutType("foo", const <core::Type>[], const <dynamic>[], [@vm.inferred-type.metadata=dart.collection::UnmodifiableMapView] core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} dynamic;
- no-such-method-forwarder method bazz([@vm.inferred-type.metadata=!] dynamic a1, [@vm.inferred-type.metadata=!] dynamic a2, [@vm.inferred-type.metadata=!] dynamic a3, [[@vm.inferred-type.metadata=!] dynamic a4, [@vm.inferred-type.metadata=dart.core::Null?] dynamic a5]) → dynamic
+ no-such-method-forwarder method bazz([@vm.inferred-type.metadata=!] dynamic a1, [@vm.inferred-type.metadata=!] dynamic a2, [@vm.inferred-type.metadata=!] dynamic a3, [[@vm.inferred-type.metadata=!] dynamic a4 = null, [@vm.inferred-type.metadata=dart.core::Null?] dynamic a5 = null]) → dynamic
return [@vm.direct-call.metadata=#lib::C::noSuchMethod] [@vm.inferred-type.metadata=#lib::T2] this.{self::C::noSuchMethod}(new core::_InvocationMirror::_withoutType("bazz", const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[a1, a2, a3, a4, a5]), [@vm.inferred-type.metadata=dart.collection::UnmodifiableMapView] core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}), false)) as{TypeError} dynamic;
}
class E extends core::Object implements self::A {
diff --git a/pkg/vm/tool/gen_kernel b/pkg/vm/tool/gen_kernel
index 63130b2..d0494c7 100755
--- a/pkg/vm/tool/gen_kernel
+++ b/pkg/vm/tool/gen_kernel
@@ -28,10 +28,10 @@
# TODO(kustermann): For windows as well as for hosts running on arm, our
# checked-in dart binaries must be adjusted.
if [[ `uname` == 'Darwin' ]]; then
- DART="$SDK_DIR/tools/sdks/mac/dart-sdk/bin/dart"
+ DART="$SDK_DIR/tools/sdks/dart-sdk/bin/dart"
OUT_DIR="$SDK_DIR/xcodebuild"
else
- DART="$SDK_DIR/tools/sdks/linux/dart-sdk/bin/dart"
+ DART="$SDK_DIR/tools/sdks/dart-sdk/bin/dart"
OUT_DIR="$SDK_DIR/out"
fi
diff --git a/pkg/vm/tool/gen_kernel.bat b/pkg/vm/tool/gen_kernel.bat
index 17af350..8f0ca3b 100644
--- a/pkg/vm/tool/gen_kernel.bat
+++ b/pkg/vm/tool/gen_kernel.bat
@@ -13,6 +13,6 @@
set SDK_DIR=%SCRIPTPATH%/../../../
-set DART=%SDK_DIR%/tools/sdks/win/dart-sdk/bin/dart.exe
+set DART=%SDK_DIR%/tools/sdks/dart-sdk/bin/dart.exe
"%DART%" %DART_VM_OPTIONS% "%SDK_DIR%/pkg/vm/bin/gen_kernel.dart" %*
diff --git a/runtime/bin/directory_fuchsia.cc b/runtime/bin/directory_fuchsia.cc
index 999a6d4..d1f89ea 100644
--- a/runtime/bin/directory_fuchsia.cc
+++ b/runtime/bin/directory_fuchsia.cc
@@ -82,7 +82,7 @@
// These are scanned to detect loops while doing a recursive directory listing.
struct LinkList {
dev_t dev;
- ino64_t ino;
+ ino_t ino;
LinkList* next;
};
@@ -95,7 +95,7 @@
ASSERT(lister_ == 0);
NamespaceScope ns(listing->namespc(), listing->path_buffer().AsString());
const int listingfd =
- TEMP_FAILURE_RETRY(openat64(ns.fd(), ns.path(), O_DIRECTORY));
+ TEMP_FAILURE_RETRY(openat(ns.fd(), ns.path(), O_DIRECTORY));
if (listingfd < 0) {
done_ = true;
return kListError;
@@ -157,10 +157,10 @@
// the file pointed to.
NamespaceScope ns(listing->namespc(),
listing->path_buffer().AsString());
- struct stat64 entry_info;
+ struct stat entry_info;
int stat_success;
stat_success = TEMP_FAILURE_RETRY(
- fstatat64(ns.fd(), ns.path(), &entry_info, AT_SYMLINK_NOFOLLOW));
+ fstatat(ns.fd(), ns.path(), &entry_info, AT_SYMLINK_NOFOLLOW));
if (stat_success == -1) {
return kListError;
}
@@ -177,7 +177,7 @@
previous = previous->next;
}
stat_success =
- TEMP_FAILURE_RETRY(fstatat64(ns.fd(), ns.path(), &entry_info, 0));
+ TEMP_FAILURE_RETRY(fstatat(ns.fd(), ns.path(), &entry_info, 0));
if (stat_success == -1) {
// Report a broken link as a link, even if follow_links is true.
return kListLink;
@@ -248,9 +248,9 @@
Directory::ExistsResult Directory::Exists(Namespace* namespc,
const char* dir_name) {
NamespaceScope ns(namespc, dir_name);
- struct stat64 entry_info;
+ struct stat entry_info;
const int success =
- TEMP_FAILURE_RETRY(fstatat64(ns.fd(), ns.path(), &entry_info, 0));
+ TEMP_FAILURE_RETRY(fstatat(ns.fd(), ns.path(), &entry_info, 0));
if (success == 0) {
if (S_ISDIR(entry_info.st_mode)) {
return EXISTS;
@@ -366,9 +366,9 @@
static bool DeleteRecursively(int dirfd, PathBuffer* path) {
// Do not recurse into links for deletion. Instead delete the link.
// If it's a file, delete it.
- struct stat64 st;
+ struct stat st;
if (TEMP_FAILURE_RETRY(
- fstatat64(dirfd, path->AsString(), &st, AT_SYMLINK_NOFOLLOW)) == -1) {
+ fstatat(dirfd, path->AsString(), &st, AT_SYMLINK_NOFOLLOW)) == -1) {
return false;
} else if (!S_ISDIR(st.st_mode)) {
return (NO_RETRY_EXPECTED(unlinkat(dirfd, path->AsString(), 0)) == 0);
@@ -381,7 +381,7 @@
// Not a link. Attempt to open as a directory and recurse into the
// directory.
const int fd =
- TEMP_FAILURE_RETRY(openat64(dirfd, path->AsString(), O_DIRECTORY));
+ TEMP_FAILURE_RETRY(openat(dirfd, path->AsString(), O_DIRECTORY));
if (fd < 0) {
return false;
}
@@ -443,9 +443,9 @@
// On some file systems the entry type is not determined by
// readdir. For those we use lstat to determine the entry
// type.
- struct stat64 entry_info;
- if (TEMP_FAILURE_RETRY(fstatat64(dirfd, path->AsString(), &entry_info,
- AT_SYMLINK_NOFOLLOW)) == -1) {
+ struct stat entry_info;
+ if (TEMP_FAILURE_RETRY(fstatat(dirfd, path->AsString(), &entry_info,
+ AT_SYMLINK_NOFOLLOW)) == -1) {
break;
}
path->Reset(path_length);
diff --git a/runtime/bin/eventhandler_android.cc b/runtime/bin/eventhandler_android.cc
index d4d49aa..07e6c04 100644
--- a/runtime/bin/eventhandler_android.cc
+++ b/runtime/bin/eventhandler_android.cc
@@ -214,7 +214,9 @@
// message.
intptr_t old_mask = di->Mask();
Dart_Port port = msg[i].dart_port;
- di->RemovePort(port);
+ if (port != ILLEGAL_PORT) {
+ di->RemovePort(port);
+ }
intptr_t new_mask = di->Mask();
UpdateEpollInstance(old_mask, di);
diff --git a/runtime/bin/eventhandler_fuchsia.cc b/runtime/bin/eventhandler_fuchsia.cc
index b2dd6e2..6a7ae35 100644
--- a/runtime/bin/eventhandler_fuchsia.cc
+++ b/runtime/bin/eventhandler_fuchsia.cc
@@ -385,7 +385,9 @@
// message.
const intptr_t old_mask = di->Mask();
Dart_Port port = msg->dart_port;
- di->RemovePort(port);
+ if (port != ILLEGAL_PORT) {
+ di->RemovePort(port);
+ }
const intptr_t new_mask = di->Mask();
UpdatePort(old_mask, di);
diff --git a/runtime/bin/eventhandler_linux.cc b/runtime/bin/eventhandler_linux.cc
index 9f2760b..2b20572 100644
--- a/runtime/bin/eventhandler_linux.cc
+++ b/runtime/bin/eventhandler_linux.cc
@@ -223,11 +223,14 @@
// message.
intptr_t old_mask = di->Mask();
Dart_Port port = msg[i].dart_port;
- di->RemovePort(port);
+ if (port != ILLEGAL_PORT) {
+ di->RemovePort(port);
+ }
intptr_t new_mask = di->Mask();
UpdateEpollInstance(old_mask, di);
intptr_t fd = di->fd();
+ ASSERT(fd == socket->fd());
if (di->IsListeningSocket()) {
// We only close the socket file descriptor from the operating
// system if there are no other dart socket objects which
diff --git a/runtime/bin/eventhandler_macos.cc b/runtime/bin/eventhandler_macos.cc
index f271969..974ab8a 100644
--- a/runtime/bin/eventhandler_macos.cc
+++ b/runtime/bin/eventhandler_macos.cc
@@ -230,7 +230,9 @@
// message.
intptr_t old_mask = di->Mask();
Dart_Port port = msg[i].dart_port;
- di->RemovePort(port);
+ if (port != ILLEGAL_PORT) {
+ di->RemovePort(port);
+ }
intptr_t new_mask = di->Mask();
UpdateKQueueInstance(old_mask, di);
diff --git a/runtime/bin/eventhandler_win.cc b/runtime/bin/eventhandler_win.cc
index 7388863..7dc6561 100644
--- a/runtime/bin/eventhandler_win.cc
+++ b/runtime/bin/eventhandler_win.cc
@@ -1056,7 +1056,9 @@
listen_socket->SetPortAndMask(msg->dart_port, events);
TryDispatchingPendingAccepts(listen_socket);
} else if (IS_COMMAND(msg->data, kCloseCommand)) {
- listen_socket->RemovePort(msg->dart_port);
+ if (msg->dart_port != ILLEGAL_PORT) {
+ listen_socket->RemovePort(msg->dart_port);
+ }
// We only close the socket file descriptor from the operating
// system if there are no other dart socket objects which
diff --git a/runtime/bin/file_fuchsia.cc b/runtime/bin/file_fuchsia.cc
index 5d3dffb..3c2741d 100644
--- a/runtime/bin/file_fuchsia.cc
+++ b/runtime/bin/file_fuchsia.cc
@@ -181,8 +181,8 @@
File* File::Open(Namespace* namespc, const char* name, FileOpenMode mode) {
NamespaceScope ns(namespc, name);
// Report errors for non-regular files.
- struct stat64 st;
- if (NO_RETRY_EXPECTED(fstatat64(ns.fd(), ns.path(), &st, 0)) == 0) {
+ struct stat st;
+ if (NO_RETRY_EXPECTED(fstatat(ns.fd(), ns.path(), &st, 0)) == 0) {
if (S_ISDIR(st.st_mode)) {
errno = EISDIR;
return NULL;
@@ -201,7 +201,7 @@
flags = flags | O_TRUNC;
}
flags |= O_CLOEXEC;
- int fd = NO_RETRY_EXPECTED(openat64(ns.fd(), ns.path(), flags, 0666));
+ int fd = NO_RETRY_EXPECTED(openat(ns.fd(), ns.path(), flags, 0666));
if (fd < 0) {
return NULL;
}
@@ -227,8 +227,8 @@
bool File::Exists(Namespace* namespc, const char* name) {
NamespaceScope ns(namespc, name);
- struct stat64 st;
- if (NO_RETRY_EXPECTED(fstatat64(ns.fd(), ns.path(), &st, 0)) == 0) {
+ struct stat st;
+ if (NO_RETRY_EXPECTED(fstatat(ns.fd(), ns.path(), &st, 0)) == 0) {
// Everything but a directory and a link is a file to Dart.
return !S_ISDIR(st.st_mode) && !S_ISLNK(st.st_mode);
} else {
@@ -239,7 +239,7 @@
bool File::Create(Namespace* namespc, const char* name) {
NamespaceScope ns(namespc, name);
const int fd = NO_RETRY_EXPECTED(
- openat64(ns.fd(), ns.path(), O_RDONLY | O_CREAT | O_CLOEXEC, 0666));
+ openat(ns.fd(), ns.path(), O_RDONLY | O_CREAT | O_CLOEXEC, 0666));
if (fd < 0) {
return false;
}
@@ -247,8 +247,8 @@
// call has created a file or that a file already exists if there is already
// an entity at the same path that is a directory or a link.
bool is_file = true;
- struct stat64 st;
- if (NO_RETRY_EXPECTED(fstat64(fd, &st)) == 0) {
+ struct stat st;
+ if (NO_RETRY_EXPECTED(fstat(fd, &st)) == 0) {
if (S_ISDIR(st.st_mode)) {
errno = EISDIR;
is_file = false;
@@ -272,14 +272,14 @@
const char* name,
bool follow_links) {
NamespaceScope ns(namespc, name);
- struct stat64 entry_info;
+ struct stat entry_info;
int stat_success;
if (follow_links) {
stat_success =
- TEMP_FAILURE_RETRY(fstatat64(ns.fd(), ns.path(), &entry_info, 0));
+ TEMP_FAILURE_RETRY(fstatat(ns.fd(), ns.path(), &entry_info, 0));
} else {
stat_success = TEMP_FAILURE_RETRY(
- fstatat64(ns.fd(), ns.path(), &entry_info, AT_SYMLINK_NOFOLLOW));
+ fstatat(ns.fd(), ns.path(), &entry_info, AT_SYMLINK_NOFOLLOW));
}
if (stat_success == -1) {
return File::kDoesNotExist;
@@ -357,19 +357,19 @@
return false;
}
NamespaceScope oldns(namespc, old_path);
- struct stat64 st;
- if (NO_RETRY_EXPECTED(fstatat64(oldns.fd(), oldns.path(), &st, 0)) != 0) {
+ struct stat st;
+ if (NO_RETRY_EXPECTED(fstatat(oldns.fd(), oldns.path(), &st, 0)) != 0) {
return false;
}
const int old_fd = NO_RETRY_EXPECTED(
- openat64(oldns.fd(), oldns.path(), O_RDONLY | O_CLOEXEC));
+ openat(oldns.fd(), oldns.path(), O_RDONLY | O_CLOEXEC));
if (old_fd < 0) {
return false;
}
NamespaceScope newns(namespc, new_path);
const int new_fd = NO_RETRY_EXPECTED(
- openat64(newns.fd(), newns.path(),
- O_WRONLY | O_TRUNC | O_CREAT | O_CLOEXEC, st.st_mode));
+ openat(newns.fd(), newns.path(),
+ O_WRONLY | O_TRUNC | O_CREAT | O_CLOEXEC, st.st_mode));
if (new_fd < 0) {
VOID_TEMP_FAILURE_RETRY(close(old_fd));
return false;
@@ -398,9 +398,9 @@
static bool StatHelper(Namespace* namespc,
const char* name,
- struct stat64* st) {
+ struct stat* st) {
NamespaceScope ns(namespc, name);
- if (NO_RETRY_EXPECTED(fstatat64(ns.fd(), ns.path(), st, 0)) != 0) {
+ if (NO_RETRY_EXPECTED(fstatat(ns.fd(), ns.path(), st, 0)) != 0) {
return false;
}
// Signal an error if it's a directory.
@@ -413,7 +413,7 @@
}
int64_t File::LengthFromPath(Namespace* namespc, const char* name) {
- struct stat64 st;
+ struct stat st;
if (!StatHelper(namespc, name, &st)) {
return -1;
}
@@ -433,8 +433,8 @@
void File::Stat(Namespace* namespc, const char* name, int64_t* data) {
NamespaceScope ns(namespc, name);
- struct stat64 st;
- if (TEMP_FAILURE_RETRY(fstatat64(ns.fd(), ns.path(), &st, 0)) == 0) {
+ struct stat st;
+ if (TEMP_FAILURE_RETRY(fstatat(ns.fd(), ns.path(), &st, 0)) == 0) {
if (S_ISREG(st.st_mode)) {
data[kType] = kIsFile;
} else if (S_ISDIR(st.st_mode)) {
@@ -455,7 +455,7 @@
}
time_t File::LastModified(Namespace* namespc, const char* name) {
- struct stat64 st;
+ struct stat st;
if (!StatHelper(namespc, name, &st)) {
return -1;
}
@@ -463,7 +463,7 @@
}
time_t File::LastAccessed(Namespace* namespc, const char* name) {
- struct stat64 st;
+ struct stat st;
if (!StatHelper(namespc, name, &st)) {
return -1;
}
@@ -474,7 +474,7 @@
const char* name,
int64_t millis) {
// First get the current times.
- struct stat64 st;
+ struct stat st;
if (!StatHelper(namespc, name, &st)) {
return false;
}
@@ -491,7 +491,7 @@
const char* name,
int64_t millis) {
// First get the current times.
- struct stat64 st;
+ struct stat st;
if (!StatHelper(namespc, name, &st)) {
return false;
}
@@ -506,9 +506,9 @@
const char* File::LinkTarget(Namespace* namespc, const char* name) {
NamespaceScope ns(namespc, name);
- struct stat64 link_stats;
+ struct stat link_stats;
const int status = TEMP_FAILURE_RETRY(
- fstatat64(ns.fd(), ns.path(), &link_stats, AT_SYMLINK_NOFOLLOW));
+ fstatat(ns.fd(), ns.path(), &link_stats, AT_SYMLINK_NOFOLLOW));
if (status != 0) {
return NULL;
}
@@ -567,8 +567,8 @@
}
File::StdioHandleType File::GetStdioHandleType(int fd) {
- struct stat64 buf;
- int result = TEMP_FAILURE_RETRY(fstat64(fd, &buf));
+ struct stat buf;
+ int result = TEMP_FAILURE_RETRY(fstat(fd, &buf));
if (result == -1) {
return kOther;
}
@@ -592,15 +592,15 @@
const char* file_2) {
NamespaceScope ns1(namespc, file_1);
NamespaceScope ns2(namespc, file_2);
- struct stat64 file_1_info;
- struct stat64 file_2_info;
+ struct stat file_1_info;
+ struct stat file_2_info;
int status = TEMP_FAILURE_RETRY(
- fstatat64(ns1.fd(), ns1.path(), &file_1_info, AT_SYMLINK_NOFOLLOW));
+ fstatat(ns1.fd(), ns1.path(), &file_1_info, AT_SYMLINK_NOFOLLOW));
if (status == -1) {
return File::kError;
}
status = TEMP_FAILURE_RETRY(
- fstatat64(ns2.fd(), ns2.path(), &file_2_info, AT_SYMLINK_NOFOLLOW));
+ fstatat(ns2.fd(), ns2.path(), &file_2_info, AT_SYMLINK_NOFOLLOW));
if (status == -1) {
return File::kError;
}
diff --git a/runtime/bin/namespace_fuchsia.cc b/runtime/bin/namespace_fuchsia.cc
index ff8ea79..aa375dc 100644
--- a/runtime/bin/namespace_fuchsia.cc
+++ b/runtime/bin/namespace_fuchsia.cc
@@ -33,7 +33,7 @@
explicit NamespaceImpl(const char* path)
: fdio_ns_(NULL),
- rootfd_(TEMP_FAILURE_RETRY(open64(path, O_DIRECTORY))),
+ rootfd_(TEMP_FAILURE_RETRY(open(path, O_DIRECTORY))),
cwd_(strdup("/")) {
ASSERT(rootfd_ > 0);
cwdfd_ = dup(rootfd_);
@@ -59,7 +59,7 @@
bool SetCwd(Namespace* namespc, const char* new_path) {
NamespaceScope ns(namespc, new_path);
const intptr_t new_cwdfd =
- TEMP_FAILURE_RETRY(openat64(ns.fd(), ns.path(), O_DIRECTORY));
+ TEMP_FAILURE_RETRY(openat(ns.fd(), ns.path(), O_DIRECTORY));
if (new_cwdfd != 0) {
return false;
}
diff --git a/runtime/bin/process_fuchsia.cc b/runtime/bin/process_fuchsia.cc
index 615d32a..d8bdd8b 100644
--- a/runtime/bin/process_fuchsia.cc
+++ b/runtime/bin/process_fuchsia.cc
@@ -586,7 +586,7 @@
NamespaceScope ns(namespc_, path_);
const int pathfd =
- TEMP_FAILURE_RETRY(openat64(ns.fd(), ns.path(), O_RDONLY));
+ TEMP_FAILURE_RETRY(openat(ns.fd(), ns.path(), O_RDONLY));
zx_handle_t vmo = ZX_HANDLE_INVALID;
zx_status_t status = fdio_get_vmo_clone(pathfd, &vmo);
VOID_TEMP_FAILURE_RETRY(close(pathfd));
diff --git a/runtime/bin/run_vm_tests.cc b/runtime/bin/run_vm_tests.cc
index 9f54ee1..e2f792d 100644
--- a/runtime/bin/run_vm_tests.cc
+++ b/runtime/bin/run_vm_tests.cc
@@ -58,7 +58,7 @@
}
void RawTestCase::Run() {
- bin::Log::Print("Running test: %s\n", name());
+ bin::Log::Print("Running raw test: %s\n", name());
(*run_)();
bin::Log::Print("Done: %s\n", name());
}
diff --git a/runtime/bin/socket_patch.dart b/runtime/bin/socket_patch.dart
index 5f5d220..0d66baf 100644
--- a/runtime/bin/socket_patch.dart
+++ b/runtime/bin/socket_patch.dart
@@ -20,6 +20,12 @@
{sourceAddress, Duration timeout}) {
return _RawSocket.connect(host, port, sourceAddress, timeout);
}
+
+ @patch
+ static Future<ConnectionTask<RawSocket>> startConnect(host, int port,
+ {sourceAddress}) {
+ return _RawSocket.startConnect(host, port, sourceAddress);
+ }
}
@patch
@@ -350,8 +356,8 @@
static Future<List<InternetAddress>> lookup(String host,
{InternetAddressType type: InternetAddressType.any}) {
- return _IOService._dispatch(
- _IOService.socketLookup, [host, type._value]).then((response) {
+ return _IOService._dispatch(_IOService.socketLookup, [host, type._value])
+ .then((response) {
if (isErrorResponse(response)) {
throw createError(response, "Failed host lookup: '$host'");
} else {
@@ -378,8 +384,8 @@
{bool includeLoopback: false,
bool includeLinkLocal: false,
InternetAddressType type: InternetAddressType.any}) {
- return _IOService._dispatch(
- _IOService.socketListInterfaces, [type._value]).then((response) {
+ return _IOService._dispatch(_IOService.socketListInterfaces, [type._value])
+ .then((response) {
if (isErrorResponse(response)) {
throw createError(response, "Failed listing interfaces");
} else {
@@ -400,8 +406,8 @@
});
}
- static Future<_NativeSocket> connect(
- host, int port, sourceAddress, Duration timeout) {
+ static Future<ConnectionTask<_NativeSocket>> startConnect(
+ host, int port, sourceAddress) {
_throwOnBadPort(port);
if (sourceAddress != null && sourceAddress is! _InternetAddress) {
if (sourceAddress is String) {
@@ -421,29 +427,11 @@
var it = (addresses as List<InternetAddress>).iterator;
var error = null;
var connecting = new HashMap();
- Timer timeoutTimer = null;
- void timeoutHandler() {
- connecting.forEach((s, t) {
- t.cancel();
- s.close();
- s.setHandlers();
- s.setListening(read: false, write: false);
- error = createError(
- null, "Connection timed out, host: ${host}, port: ${port}");
- completer.completeError(error);
- });
- }
void connectNext() {
- if ((timeout != null) && (timeoutTimer == null)) {
- timeoutTimer = new Timer(timeout, timeoutHandler);
- }
if (!it.moveNext()) {
if (connecting.isEmpty) {
assert(error != null);
- if (timeoutTimer != null) {
- timeoutTimer.cancel();
- }
completer.completeError(error);
}
return;
@@ -471,11 +459,13 @@
}
connectNext();
} else {
- // Query the local port, for error messages.
+ // Query the local port for error messages.
try {
socket.port;
} catch (e) {
- error = createError(e, "Connection failed", address, port);
+ if (error == null) {
+ error = createError(e, "Connection failed", address, port);
+ }
connectNext();
}
// Set up timer for when we should retry the next address
@@ -490,9 +480,6 @@
// indicate that the socket is fully connected.
socket.setHandlers(write: () {
timer.cancel();
- if (timeoutTimer != null) {
- timeoutTimer.cancel();
- }
socket.setListening(read: false, write: false);
completer.complete(socket);
connecting.remove(socket);
@@ -502,6 +489,7 @@
s.setHandlers();
s.setListening(read: false, write: false);
});
+ connecting.clear();
}, error: (e) {
timer.cancel();
socket.close();
@@ -514,8 +502,42 @@
}
}
+ void onCancel() {
+ connecting.forEach((s, t) {
+ t.cancel();
+ s.close();
+ s.setHandlers();
+ s.setListening(read: false, write: false);
+ if (error == null) {
+ error = createError(null,
+ "Connection attempt cancelled, host: ${host}, port: ${port}");
+ }
+ });
+ connecting.clear();
+ if (!completer.isCompleted) {
+ completer.completeError(error);
+ }
+ }
+
connectNext();
- return completer.future;
+ return new ConnectionTask<_NativeSocket>._(
+ socket: completer.future, onCancel: onCancel);
+ });
+ }
+
+ static Future<_NativeSocket> connect(
+ host, int port, sourceAddress, Duration timeout) {
+ return startConnect(host, port, sourceAddress)
+ .then((ConnectionTask<_NativeSocket> task) {
+ Future<_NativeSocket> socketFuture = task.socket;
+ if (timeout != null) {
+ socketFuture = socketFuture.timeout(timeout, onTimeout: () {
+ task.cancel();
+ throw createError(
+ null, "Connection timed out, host: ${host}, port: ${port}");
+ });
+ }
+ return socketFuture;
});
}
@@ -1134,8 +1156,7 @@
address, int port, int backlog, bool v6Only, bool shared) {
_throwOnBadPort(port);
if (backlog < 0) throw new ArgumentError("Invalid backlog $backlog");
- return _NativeSocket
- .bind(address, port, backlog, v6Only, shared)
+ return _NativeSocket.bind(address, port, backlog, v6Only, shared)
.then((socket) => new _RawServerSocket(socket, v6Only));
}
@@ -1228,11 +1249,21 @@
static Future<RawSocket> connect(
host, int port, sourceAddress, Duration timeout) {
- return _NativeSocket
- .connect(host, port, sourceAddress, timeout)
+ return _NativeSocket.connect(host, port, sourceAddress, timeout)
.then((socket) => new _RawSocket(socket));
}
+ static Future<ConnectionTask<_RawSocket>> startConnect(
+ host, int port, sourceAddress) {
+ return _NativeSocket.startConnect(host, port, sourceAddress)
+ .then((ConnectionTask<_NativeSocket> nativeTask) {
+ final Future<_RawSocket> raw = nativeTask.socket
+ .then((_NativeSocket nativeSocket) => new _RawSocket(nativeSocket));
+ return new ConnectionTask<_RawSocket>._(
+ socket: raw, onCancel: nativeTask._onCancel);
+ });
+ }
+
_RawSocket(this._socket) {
var zone = Zone.current;
_controller = new StreamController(
@@ -1381,8 +1412,7 @@
static Future<_ServerSocket> bind(
address, int port, int backlog, bool v6Only, bool shared) {
- return _RawServerSocket
- .bind(address, port, backlog, v6Only, shared)
+ return _RawServerSocket.bind(address, port, backlog, v6Only, shared)
.then((socket) => new _ServerSocket(socket));
}
@@ -1414,10 +1444,22 @@
@patch
static Future<Socket> _connect(host, int port,
{sourceAddress, Duration timeout}) {
- return RawSocket
- .connect(host, port, sourceAddress: sourceAddress, timeout: timeout)
+ return RawSocket.connect(host, port,
+ sourceAddress: sourceAddress, timeout: timeout)
.then((socket) => new _Socket(socket));
}
+
+ @patch
+ static Future<ConnectionTask<Socket>> _startConnect(host, int port,
+ {sourceAddress}) {
+ return RawSocket.startConnect(host, port, sourceAddress: sourceAddress)
+ .then((rawTask) {
+ Future<Socket> socket =
+ rawTask.socket.then((rawSocket) => new _Socket(rawSocket));
+ return new ConnectionTask<Socket>._(
+ socket: socket, onCancel: rawTask._onCancel);
+ });
+ }
}
class _SocketStreamConsumer extends StreamConsumer<List<int>> {
@@ -1774,8 +1816,7 @@
static Future<RawDatagramSocket> bind(host, int port, bool reuseAddress) {
_throwOnBadPort(port);
- return _NativeSocket
- .bindDatagram(host, port, reuseAddress)
+ return _NativeSocket.bindDatagram(host, port, reuseAddress)
.then((socket) => new _RawDatagramSocket(socket));
}
diff --git a/runtime/lib/compact_hash.dart b/runtime/lib/compact_hash.dart
index 21179eb..e9df2c8 100644
--- a/runtime/lib/compact_hash.dart
+++ b/runtime/lib/compact_hash.dart
@@ -169,7 +169,7 @@
void clear() {
if (!isEmpty) {
- _init(_data.length, _hashMask, null, 0);
+ _init(_HashBase._INITIAL_INDEX_SIZE, _hashMask, null, 0);
}
}
@@ -493,7 +493,7 @@
void clear() {
if (!isEmpty) {
- _init(_index.length, _hashMask, null, 0);
+ _init(_HashBase._INITIAL_INDEX_SIZE, _hashMask, null, 0);
}
}
diff --git a/runtime/observatory/lib/src/app/application.dart b/runtime/observatory/lib/src/app/application.dart
index 79e85ef..5949455 100644
--- a/runtime/observatory/lib/src/app/application.dart
+++ b/runtime/observatory/lib/src/app/application.dart
@@ -200,7 +200,7 @@
return;
}
}
- throw new FallThroughError();
+ throw new ArgumentError.value(uri, 'uri');
}
/// Set the Observatory application page.
diff --git a/runtime/observatory/lib/src/service/object.dart b/runtime/observatory/lib/src/service/object.dart
index 768262c..df03ab5 100644
--- a/runtime/observatory/lib/src/service/object.dart
+++ b/runtime/observatory/lib/src/service/object.dart
@@ -2114,8 +2114,9 @@
case 'TerminationError':
return M.ErrorKind.terminationError;
}
- Logger.root.severe('Unrecognized error kind: $value');
- throw new FallThroughError();
+ var message = 'Unrecognized error kind: $value';
+ Logger.root.severe(message);
+ throw new ArgumentError(message);
}
/// A [DartError] is peered to a Dart Error object.
@@ -2747,8 +2748,9 @@
case 'BoundedType':
return M.InstanceKind.boundedType;
}
- Logger.root.severe("Unrecognized InstanceKind: '$s'");
- throw new FallThroughError();
+ var message = 'Unrecognized instance kind: $s';
+ Logger.root.severe(message);
+ throw new ArgumentError(message);
}
class Guarded<T extends ServiceObject> implements M.Guarded<T> {
@@ -3115,8 +3117,9 @@
case 'DynamicInvocationForwarder':
return M.FunctionKind.dynamicInvocationForwarder;
}
- Logger.root.severe('Unrecognized function kind: $value');
- throw new FallThroughError();
+ var message = 'Unrecognized function kind: $value';
+ Logger.root.severe(message);
+ throw new ArgumentError(message);
}
class ServiceFunction extends HeapObject implements M.ServiceFunction {
@@ -3220,8 +3223,9 @@
case 'Free':
return M.SentinelKind.free;
}
- Logger.root.severe("Unrecognized SentinelKind: '$s'");
- throw new FallThroughError();
+ var message = 'Unrecognized sentinel kind: $s';
+ Logger.root.severe(message);
+ throw new ArgumentError(message);
}
class Sentinel extends ServiceObject implements M.Sentinel {
@@ -4234,8 +4238,9 @@
} else if (s == 'Stub') {
return M.CodeKind.stub;
}
- Logger.root.severe("Unrecognized code kind: '$s'");
- throw new FallThroughError();
+ var message = 'Unrecognized code kind: $s';
+ Logger.root.severe(message);
+ throw new ArgumentError(message);
}
class CodeInlineInterval {
@@ -4475,8 +4480,9 @@
} else if (s == 'Internal') {
return Internal;
}
- Logger.root.warning('Unknown socket kind $s');
- throw new FallThroughError();
+ var message = 'Unrecognized socket kind: $s';
+ Logger.root.warning(message);
+ throw new ArgumentError(message);
}
static const Listening = const SocketKind._internal('Listening');
diff --git a/runtime/observatory/tests/observatory_ui/observatory_ui.status b/runtime/observatory/tests/observatory_ui/observatory_ui.status
index 793f0ac..22bbc6d 100644
--- a/runtime/observatory/tests/observatory_ui/observatory_ui.status
+++ b/runtime/observatory/tests/observatory_ui/observatory_ui.status
@@ -2,6 +2,45 @@
# for details. All rights reserved. Use of this source code is governed by a
# BSD-style license that can be found in the LICENSE file.
+[ $strong ]
+allocation_profile/element_test: CompileTimeError # observatory is not strong clean (Issue 32503)
+class_tree/element_test: RuntimeError # observatory is not strong clean (Issue 32503)
+context_view/element_test: RuntimeError # observatory is not strong clean (Issue 32503)
+cpu_profile/element_test: RuntimeError # observatory is not strong clean (Issue 32503)
+cpu_profile_table/element_test: RuntimeError # observatory is not strong clean (Issue 32503)
+curly_block/element_test: RuntimeError # observatory is not strong clean (Issue 32503)
+error_view/element_test: RuntimeError # observatory is not strong clean (Issue 32503)
+flag_list/element_test: RuntimeError # observatory is not strong clean (Issue 32503)
+general_error/element_test: RuntimeError # observatory is not strong clean (Issue 32503)
+icdata_view/element_test: RuntimeError # observatory is not strong clean (Issue 32503)
+inbound_references/element_test: RuntimeError # observatory is not strong clean (Issue 32503)
+isolate/counter_chart/element_test: CompileTimeError # observatory is not strong clean (Issue 32503)
+isolate/isolate-shared-summary/element_test: CompileTimeError # observatory is not strong clean (Issue 32503)
+isolate_reconnect/element_test: RuntimeError # observatory is not strong clean (Issue 32503)
+megamorphiccache_view/element_test: RuntimeError # observatory is not strong clean (Issue 32503)
+nav/class-menu/element_test: RuntimeError # observatory is not strong clean (Issue 32503)
+nav/isolate-menu/element_test: RuntimeError # observatory is not strong clean (Issue 32503)
+nav/library-menu/element_test: RuntimeError # observatory is not strong clean (Issue 32503)
+nav/menu-item/element_test: RuntimeError # observatory is not strong clean (Issue 32503)
+nav/notify/element_test: RuntimeError # observatory is not strong clean (Issue 32503)
+nav/notify_event/element_test: RuntimeError # observatory is not strong clean (Issue 32503)
+nav/notify_exception/connection_exception_test: RuntimeError # observatory is not strong clean (Issue 32503)
+nav/notify_exception/exception_test: RuntimeError # observatory is not strong clean (Issue 32503)
+nav/refresh/element_test: RuntimeError # observatory is not strong clean (Issue 32503)
+nav/top_menu/element_test: RuntimeError # observatory is not strong clean (Issue 32503)
+nav/vm_menu/element_test: RuntimeError # observatory is not strong clean (Issue 32503)
+object_common/element_test: RuntimeError # observatory is not strong clean (Issue 32503)
+objectpool_view/element_test: RuntimeError # observatory is not strong clean (Issue 32503)
+objectstore_view/element_test: RuntimeError # observatory is not strong clean (Issue 32503)
+persistent_handles_page/element_test: RuntimeError # observatory is not strong clean (Issue 32503)
+ports/element_test: RuntimeError # observatory is not strong clean (Issue 32503)
+retaining_path/element_test: RuntimeError # observatory is not strong clean (Issue 32503)
+script_ref/element_test: RuntimeError # observatory is not strong clean (Issue 32503)
+source_link/element_test: RuntimeError # observatory is not strong clean (Issue 32503)
+view_footer/element_test: RuntimeError # observatory is not strong clean (Issue 32503)
+vm_connect/element_test: RuntimeError # observatory is not strong clean (Issue 32503)
+vm_connect_target/element_test: RuntimeError # observatory is not strong clean (Issue 32503)
+
[ $runtime == chrome || $runtime == ff || $runtime == safari ]
heap_snapshot/element_test: RuntimeError # Issue 27925
diff --git a/runtime/observatory/tests/service/service.status b/runtime/observatory/tests/service/service.status
index 63598af..d961110 100644
--- a/runtime/observatory/tests/service/service.status
+++ b/runtime/observatory/tests/service/service.status
@@ -15,6 +15,9 @@
[ $arch == arm ]
process_service_test: Pass, Fail # Issue 24344
+[ $arch == arm64 ]
+get_object_rpc_test: RuntimeError
+
[ $compiler == app_jit ]
bad_reload_test: RuntimeError # Issue 27806
complex_reload_test: RuntimeError # Issue 27806
diff --git a/runtime/observatory/tests/service/service_kernel.status b/runtime/observatory/tests/service/service_kernel.status
index 87f2e7f..dc5a2e0 100644
--- a/runtime/observatory/tests/service/service_kernel.status
+++ b/runtime/observatory/tests/service/service_kernel.status
@@ -114,7 +114,6 @@
# These are the non-kernel specific versions so skip tests and allow errors.
[ $compiler == dartk ]
add_breakpoint_rpc_test: SkipByDesign # non-kernel specific version of add_breakpoint_rpc_kernel_test.
-async_single_step_out_test: RuntimeError # Issue 29158, Async debugging
async_star_single_step_into_test: RuntimeError # Issue 29158, Async debugging
async_star_step_out_test: RuntimeError # Issue 29158, Async debugging
async_step_out_test: RuntimeError # Issue 29158, Async debugging
@@ -226,6 +225,7 @@
[ $compiler == dartk && ($arch == simarm || $arch == simarm64 || $arch == simdbc64) ]
add_breakpoint_rpc_kernel_test: RuntimeError # Issue #33087
async_generator_breakpoint_test: Pass, RuntimeError, Crash # dartbug.com/33175 for the crash
+async_single_step_out_test: RuntimeError
bad_reload_test: Skip # Times out on sim architectures, also RuntimeError.
break_on_activation_test: RuntimeError # Issue #33087
complex_reload_test: Skip # Times out on sim architectures, also RuntimeError.
diff --git a/runtime/tests/vm/dart/stack_overflow_shared_test.dart b/runtime/tests/vm/dart/stack_overflow_shared_test.dart
new file mode 100644
index 0000000..56fa08c
--- /dev/null
+++ b/runtime/tests/vm/dart/stack_overflow_shared_test.dart
@@ -0,0 +1,36 @@
+// Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+// VMOptions=--optimization_counter_threshold=10 --no-background-compilation --shared-slow-path-triggers-gc --stacktrace_filter=filter_me
+
+// This tests the stackmaps and environments for safepoints corresponding to
+// slow-path stack overflow checks which uses shared runtime stubs.
+
+import 'package:expect/expect.dart';
+import 'dart:math';
+
+filter_me() {
+ int s = 0;
+ for (int i = 0; i < 100; ++i) {
+ if (i % 2 == 0) {
+ s += i;
+ } else {
+ s -= i;
+ }
+ }
+ Expect.equals(s, -50);
+ double x = 0.0;
+ for (int i = 0; i < 100; ++i) {
+ if (i % 2 == 0) {
+ x = x / 3;
+ } else {
+ x = x * 2 + 1;
+ }
+ }
+ Expect.isTrue(x - 0.00001 < 3 && x + 0.00001 > 3);
+}
+
+main() {
+ filter_me();
+}
diff --git a/runtime/tests/vm/vm.status b/runtime/tests/vm/vm.status
index d52b4c8..4dd7760 100644
--- a/runtime/tests/vm/vm.status
+++ b/runtime/tests/vm/vm.status
@@ -360,5 +360,7 @@
[ $hot_reload || $hot_reload_rollback ]
dart/appjit_determinism_test: Skip # Reload affects determinisim
dart/script_determinism_test: Skip # We can shutdown an isolate before it reloads.
+dart/slow_path_shared_stub_test: Skip # Too slow with --slow-path-triggers-gc flag and not relevant outside precompiled.
dart/spawn_infinite_loop_test: Skip # We can shutdown an isolate before it reloads.
dart/spawn_shutdown_test: Skip # We can shutdown an isolate before it reloads.
+dart/stack_overflow_shared_test: Skip # Too slow with --slow-path-triggers-gc flag and not relevant outside precompiled.
diff --git a/runtime/tools/dartfuzz/README.md b/runtime/tools/dartfuzz/README.md
new file mode 100644
index 0000000..000f75d
--- /dev/null
+++ b/runtime/tools/dartfuzz/README.md
@@ -0,0 +1,72 @@
+DartFuzz
+========
+
+DartFuzz is a tool for generating random programs with the objective
+of fuzz testing the Dart project. Each randomly generated program
+can be run under various modes of execution, such as using JIT,
+using AOT, using JavaScript after dart2js, and using various target
+architectures (x86, arm, etc.). Any difference between the outputs
+(**divergence**) may indicate a bug in one of the execution modes.
+
+How to run DartFuzz
+===================
+
+ dartfuzz.py [--help] [--seed SEED]
+
+where
+
+ --help : prints help and exits
+ --seed : defines random seed (system-set by default)
+
+DartFuzz sends all output to stdout, and provides
+a runnable main isolate. A typical test run looks as:
+
+ dartfuzz.py > fuzz.dart
+ dart fuzz.dart
+
+How to start DartFuzz testing
+=============================
+
+ run_dartfuzz_test.py [--help]
+ [--repeat REPEAT]
+ [--true_divergence]
+ [--mode1 MODE]
+ [--mode2 MODE]
+
+where
+
+ --help : prints help and exits
+ --repeat : number of tests to run (1000 by default)
+ --true_divergence : only report true divergences
+ --mode1 : m1
+ --mode2 : m2, and values one of
+ jit = Dart JIT
+ aot = Dart AOT
+ js = dart2js + JS
+
+Background
+==========
+
+Although test suites are extremely useful to validate the correctness of a
+system and to ensure that no regressions occur, any test suite is necessarily
+finite in size and scope. Tests typically focus on validating particular
+features by means of code sequences most programmers would expect. Regression
+tests often use slightly less idiomatic code sequences, since they reflect
+problems that were not anticipated originally, but occurred “in the field”.
+Still, any test suite leaves the developer wondering whether undetected bugs
+and flaws still linger in the system.
+
+Over the years, fuzz testing has gained popularity as a testing technique for
+discovering such lingering bugs, including bugs that can bring down a system
+in an unexpected way. Fuzzing refers to feeding a large amount of random data
+as input to a system in an attempt to find bugs or make it crash. Generation-
+based fuzz testing constructs random, but properly formatted input data.
+Mutation-based fuzz testing applies small random changes to existing inputs
+in order to detect shortcomings in a system. Profile-guided or coverage-guided
+fuzzing adds a direction to the way these random changes are applied. Multi-
+layered approaches generate random inputs that are subsequently mutated at
+various stages of execution.
+
+The randomness of fuzz testing implies that the size and scope of testing is
+no longer bounded. Every new run can potentially discover bugs and crashes
+that were hereto undetected.
diff --git a/runtime/tools/dartfuzz/dartfuzz.py b/runtime/tools/dartfuzz/dartfuzz.py
new file mode 100755
index 0000000..fb96a11
--- /dev/null
+++ b/runtime/tools/dartfuzz/dartfuzz.py
@@ -0,0 +1,411 @@
+#!/usr/bin/env python3
+#
+# Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file
+# for details. All rights reserved. Use of this source code is governed by a
+# BSD-style license that can be found in the LICENSE file.
+
+import argparse
+import random
+import time
+
+from enum import IntEnum
+from enum import unique
+
+# Version of DartFuzz. Increase this each time changes are made
+# to preserve the property that a given version of DartFuzz yields
+# the same fuzzed program for a deterministic random seed.
+
+VERSION='1.0'
+
+#
+# Dart operators and types.
+#
+
+NUM_UNARY_OPS = [ '-' ]
+INT_UNARY_OPS = NUM_UNARY_OPS + [ '~' ]
+
+BOOL_BIN_OPS = [ ' && ', ' || ' ]
+NUM_BIN_OPS = [ ' + ', ' - ', ' * ' ]
+INT_BIN_OPS = NUM_BIN_OPS + [ ' & ', ' | ', ' ^ ', ' % ', ' ~/ ', ' >> ', ' << ' ]
+FP_BIN_OPS = NUM_BIN_OPS + [ ' / ' ]
+
+NUM_ASSIGN_OPS = [ ' = ', ' += ', ' -= ', ' *= ' ]
+INT_ASSIGN_OPS = NUM_ASSIGN_OPS + [ ' &= ', ' |= ', ' ^= ', ' %= ', ' ~/= ', ' >>= ', ' <<= ' ]
+FP_ASSIGN_OPS = NUM_ASSIGN_OPS + [ ' /= ' ]
+
+NUM_INC_OPS = [ '++', '--' ]
+
+REL_OPS = [ ' == ', ' != ' ]
+NUM_REL_OPS = REL_OPS + [ ' > ', ' >= ', ' < ', ' <= ' ]
+
+@unique
+class Type(IntEnum):
+ """Enum representing Dart types."""
+ BOOL = 0,
+ INT = 1,
+ DOUBLE = 2,
+ STRING = 3,
+ INT_LIST = 4,
+ INT_STRING_MAP = 5
+
+Types = {
+ Type.BOOL : 'bool',
+ Type.INT : 'int',
+ Type.DOUBLE : 'double',
+ Type.STRING : 'String',
+ Type.INT_LIST : 'List<int>',
+ Type.INT_STRING_MAP : 'Map<int, String>'
+}
+
+TypeList = list(Types.keys())
+
+#
+# DartFuzz generator class.
+#
+
+class DartFuzz(object):
+ """Generates a random, but runnable Dart program for fuzz testing."""
+
+ def __init__(self, seed):
+ """Constructor.
+
+ Args:
+ seed: int, random seed from which randomness is obtained.
+ """
+ self._seed = seed
+
+ def Run(self):
+ # Setup
+ self._rand = random.Random()
+ self._rand.seed(self._seed)
+ self._indent = 0
+ self._num_classes = self._rand.randint(1, 4)
+ # Header.
+ self.EmitHeader()
+ # Top level.
+ for v in range(0, len(TypeList)):
+ self.EmitTopVarDecl(v)
+ self.EmitTopLevelMethod()
+ # Classes.
+ for c in range(0, self._num_classes):
+ self.EmitClass(c)
+ # Main.
+ self.EmitMain()
+
+ #
+ # Program components.
+ #
+
+ def EmitHeader(self):
+ self.EmitLn('')
+ self.EmitLn('// The Dart Project Fuzz Tester (' + VERSION + ').')
+ self.EmitLn('// Program generated as:')
+ self.EmitLn('// dartfuzz.py --seed ' + str(self._seed))
+ self.EmitLn('')
+
+ def EmitTopLevelMethod(self):
+ self.EmitLn('')
+ self.EmitLn('void top() {')
+ self._indent += 2
+ self.EmitStmtList(0)
+ self._indent -= 2
+ self.EmitLn('}')
+
+ def EmitTopVarDecl(self, v):
+ tp = v # int as type
+ self.EmitType(tp)
+ self.Emit(' var' + str(v) + ' = ')
+ self.EmitLiteral(tp)
+ self.Emit(';', end='\n')
+
+ def EmitClass(self, class_id):
+ self.EmitLn('')
+ self.EmitLn('class X' + str(class_id), end='')
+ if class_id > 0:
+ self.Emit(' extends X' + str(class_id - 1))
+ self.Emit(' {', end='\n')
+ self._indent += 2
+ self.EmitFieldDecls()
+ self.EmitMethod(class_id)
+ self._indent -= 2
+ self.EmitLn('}')
+
+ def EmitFieldDecls(self):
+ pass
+
+ def EmitMethod(self, class_id):
+ self.EmitLn('void run() {')
+ self._indent += 2
+ if class_id > 0:
+ self.EmitLn('super.run();')
+ else:
+ self.EmitLn('top();')
+ self.EmitStmtList(0)
+ self._indent -= 2
+ self.EmitLn('}')
+
+ def EmitMain(self):
+ self.EmitLn('')
+ self.EmitLn('main() {')
+ self._indent += 2
+ self.EmitLn('try {')
+ self._indent += 2
+ self.EmitLn('new X' + str(self._num_classes - 1) + '().run();')
+ self._indent -= 2
+ self.EmitLn('} catch (e) {')
+ self._indent += 2
+ self.EmitLn('print("exception");')
+ self._indent -= 2
+ self.EmitLn('} finally {')
+ self._indent += 2
+ for v in range(0, len(TypeList)):
+ self.EmitLn("print(var" + str(v) + ");");
+ self.EmitLn('print("done");')
+ self._indent -= 2
+ self.EmitLn('}')
+ self._indent -= 2
+ self.EmitLn('}')
+
+ #
+ # Statements.
+ #
+
+ def EmitStmtList(self, depth):
+ num_stmts = self._rand.randint(1, 4)
+ for s in range(0, num_stmts):
+ if not self.EmitStmt(depth):
+ return False # rest would be dead code
+ return True
+
+ def EmitStmt(self, depth):
+ self.EmitLn('', end='')
+ r = self._rand.randint(1, 8) # favors assignment
+ if r == 1 and depth <= 2:
+ return self.EmitIf(depth)
+ elif r == 2:
+ return self.EmitPrint(depth)
+ else:
+ return self.EmitAssign(depth)
+
+ def EmitIf(self, depth):
+ self.Emit('if (')
+ self.EmitExpr(Type.BOOL, 0)
+ self.Emit(') {', end='\n')
+ self._indent += 2
+ self.EmitStmtList(depth + 1)
+ self._indent -= 2
+ self.EmitLn('} else {')
+ self._indent += 2
+ self.EmitStmtList(depth + 1)
+ self._indent -= 2
+ self.EmitLn('}')
+ return True
+
+ def EmitPrint(self, depth):
+ self.Emit('print(')
+ tp = self.RandomType()
+ self.EmitExpr(tp, 0)
+ self.Emit(');', end='\n')
+ return True
+
+ def EmitAssign(self, depth):
+ tp = self.RandomType()
+ self.EmitVar(tp)
+ self.EmitAssignOp(tp)
+ self.EmitExpr(tp, 0)
+ self.Emit(';', end='\n')
+ return True
+
+ #
+ # Expressions.
+ #
+
+ def RandLen(self, x):
+ return self._rand.randint(0, len(x) - 1)
+
+ def EmitAssignOp(self, tp):
+ if tp == Type.INT:
+ self.Emit(INT_ASSIGN_OPS[self.RandLen(INT_ASSIGN_OPS)])
+ elif tp == Type.DOUBLE:
+ self.Emit(FP_ASSIGN_OPS[self.RandLen(FP_ASSIGN_OPS)])
+ else:
+ self.Emit(' = ')
+
+ def EmitUnaryOp(self, tp):
+ """Emit same type in-out binary operator."""
+ if tp == Type.INT:
+ self.Emit(INT_UNARY_OPS[self.RandLen(INT_UNARY_OPS)])
+ elif tp == Type.DOUBLE:
+ self.Emit(NUM_UNARY_OPS[self.RandLen(NUM_UNARY_OPS)])
+ else:
+ self.Emit(' !')
+
+ def EmitBinOp(self, tp):
+ """Emit same type in-out binary operator."""
+ if tp == Type.BOOL:
+ self.Emit(BOOL_BIN_OPS[self.RandLen(BOOL_BIN_OPS)])
+ elif tp == Type.INT:
+ self.Emit(INT_BIN_OPS[self.RandLen(INT_BIN_OPS)])
+ elif tp == Type.DOUBLE:
+ self.Emit(FP_BIN_OPS[self.RandLen(FP_BIN_OPS)])
+ else:
+ self.Emit(' + ')
+
+ def EmitRelOp(self, tp):
+ """Emit one type in, boolean out operator."""
+ if tp == Type.INT or tp == Type.DOUBLE:
+ self.Emit(NUM_REL_OPS[self.RandLen(NUM_REL_OPS)])
+ else:
+ self.Emit(REL_OPS[self.RandLen(REL_OPS)])
+
+ def EmitExpr(self, tp, depth):
+ if (depth > 2):
+ self.EmitTerm(tp)
+ return
+ r = self._rand.randint(1, 5)
+ if r == 1 and tp <= Type.DOUBLE:
+ # Unary operator: (~(x))
+ self.Emit('(')
+ self.EmitUnaryOp(tp)
+ self.Emit('(')
+ self.EmitExpr(tp, depth + 1)
+ self.Emit('))')
+ elif r == 2 and tp <= Type.STRING:
+ # Binary operator: (x + y)
+ self.Emit('(')
+ self.EmitExpr(tp, depth + 1)
+ self.EmitBinOp(tp)
+ self.EmitExpr(tp, depth + 1)
+ self.Emit(')')
+ elif r == 3 and Type.INT <= tp and tp <= Type.DOUBLE:
+ # Pre- or post-increment/decrement: (++x) or (x++)
+ self.Emit('(')
+ pre = self._rand.randint(1, 1)
+ if pre == 1:
+ self.Emit(NUM_INC_OPS[self.RandLen(NUM_INC_OPS)])
+ self.EmitVar(tp);
+ if pre == 2:
+ self.Emit(NUM_INC_OPS[self.RandLen(NUM_INC_OPS)])
+ self.Emit(')')
+ elif r == 4:
+ # Type conversion: x.toInt()
+ self.EmitTypeConv(tp, depth)
+ else:
+ # Terminal expression: x or 1
+ self.EmitTerm(tp)
+
+ def EmitTypeConv(self, tp, depth):
+ if tp == Type.BOOL:
+ new_tp = self.RandomType()
+ self.Emit('(')
+ self.EmitExpr(new_tp, depth + 1)
+ self.EmitRelOp(new_tp)
+ self.EmitExpr(new_tp, depth + 1)
+ self.Emit(')')
+ elif tp == Type.INT:
+ self.Emit('(')
+ self.EmitExpr(Type.DOUBLE, depth + 1)
+ self.Emit(').toInt()')
+ elif tp == Type.DOUBLE:
+ self.Emit('(')
+ self.EmitExpr(Type.INT, depth + 1)
+ self.Emit(').toDouble()')
+ else:
+ self.EmitTerm(tp)
+
+ def EmitTerm(self, tp):
+ r = self._rand.randint(1, 2)
+ if r == 1:
+ self.EmitVar(tp)
+ else:
+ self.EmitLiteral(tp)
+
+ def EmitVar(self, tp):
+ v = int(tp) # type as int
+ self.Emit('var' + str(v))
+
+ def EmitLiteral(self, tp):
+ if tp == Type.BOOL:
+ self.Emit('true' if self._rand.randint(0, 1) == 0 else 'false')
+ elif tp == Type.INT:
+ self.Emit(str(self._rand.randint(-1000, 1000)))
+ elif tp == Type.DOUBLE:
+ self.Emit(str(self._rand.uniform(-1000.0, +1000.0)))
+ elif tp == Type.STRING:
+ len = self._rand.randint(1, 5)
+ self.Emit('"' + ''.join(self._rand.choice('AaBbCcDdEeFfGgHh')
+ for _ in range(len)) + '"')
+ elif tp == Type.INT_LIST:
+ len = self._rand.randint(1, 5)
+ self.Emit('[')
+ self.EmitLiteral(Type.INT)
+ for i in range(1, len):
+ self.Emit(', ')
+ self.EmitLiteral(Type.INT)
+ self.Emit(']')
+ elif tp == Type.INT_STRING_MAP:
+ len = self._rand.randint(1, 5)
+ self.Emit('{ 0 : ')
+ self.EmitLiteral(Type.STRING)
+ for i in range(1, len):
+ self.Emit(', ' + str(i) + ' : ')
+ self.EmitLiteral(Type.STRING)
+ self.Emit('}')
+
+ #
+ # Types.
+ #
+
+ def RandomType(self):
+ return TypeList[self._rand.randint(0, len(TypeList) - 1)]
+
+ def EmitType(self, tp):
+ self.Emit(Types[tp])
+
+ #
+ # Output.
+ #
+
+ def EmitLn(self, line, end='\n'):
+ """Emits indented line to append to program (stdout).
+
+ Args:
+ line: string, line to append to program.
+ """
+ print(self._indent * ' ', end='')
+ print(line, end=end)
+
+ def Emit(self, txt, end=''):
+ """Emits string to append to program (stdout).
+
+ Args:
+ txt: string, text to append to program.
+ """
+ print(txt, end=end)
+
+#
+# Main driver.
+#
+
+def main():
+ # Handle arguments.
+ parser = argparse.ArgumentParser()
+ parser.add_argument('--seed', default=0, type=int,
+ help='random seed (0 forces time-based seed)')
+ args = parser.parse_args()
+
+ # By default (zero seed), select a random seed.
+ seed = args.seed
+ if seed == 0:
+ # Pick system's best way of seeding randomness.
+ # Then pick a user visible nonzero seed.
+ random.seed()
+ while seed == 0:
+ seed = random.getrandbits(64)
+
+ # Run DartFuzz.
+ fuzzer = DartFuzz(seed)
+ fuzzer.Run()
+
+if __name__ == '__main__':
+ main()
diff --git a/runtime/tools/dartfuzz/run_dartfuzz_test.py b/runtime/tools/dartfuzz/run_dartfuzz_test.py
new file mode 100755
index 0000000..943622b
--- /dev/null
+++ b/runtime/tools/dartfuzz/run_dartfuzz_test.py
@@ -0,0 +1,369 @@
+#!/usr/bin/env python3
+#
+# Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file
+# for details. All rights reserved. Use of this source code == governed by a
+# BSD-style license that can be found in the LICENSE file.
+
+import abc
+import argparse
+import os
+import shutil
+import subprocess
+import sys
+
+from enum import Enum
+from enum import unique
+
+from subprocess import DEVNULL
+from subprocess import PIPE
+from subprocess import Popen
+from subprocess import STDOUT
+from subprocess import TimeoutExpired
+
+from tempfile import mkdtemp
+
+#
+# Helper methods to run commands.
+#
+
+@unique
+class RetCode(Enum):
+ """Enum representing return codes."""
+ SUCCESS = 0
+ TIMEOUT = 1
+ ERROR = 2
+
+class FatalError(Exception):
+ """Fatal error in script."""
+
+def RunCommandWithOutput(cmd, env, stdout, stderr, timeout=30):
+ """Runs command piping output to files, stderr, or stdout.
+
+ Args:
+ cmd: list of strings, command to run.
+ env: shell environment for command.
+ stdout: file handle for stdout.
+ stderr: file handle for stderr.
+ timeout: int, timeout in seconds.
+
+ Returns:
+ tuple (string, string, RetCode) out, err, return code.
+ """
+ proc = Popen(cmd, stdout=stdout, stderr=stderr, env=env,
+ universal_newlines=True, start_new_session=True)
+ try:
+ (out, err) = proc.communicate(timeout=timeout)
+ if proc.returncode == 0:
+ retcode = RetCode.SUCCESS
+ else:
+ retcode = RetCode.ERROR
+ except TimeoutExpired:
+ os.killpg(os.getpgid(proc.pid), signal.SIGTERM)
+ (out, err) = proc.communicate()
+ retcode = RetCode.TIMEOUT
+ return (out, err, retcode)
+
+def RunCommand(cmd, out=None, err=None, timeout=30):
+ """Executes a command, and returns its return code.
+
+ Args:
+ cmd: list of strings, a command to execute.
+ out: string, file name to open for stdout (or None).
+ err: string, file name to open for stderr (or None).
+ timeout: int, time out in seconds.
+ Returns:
+ RetCode, return code of running command.
+ """
+ if out is not None:
+ outf = open(out, mode='w')
+ else:
+ outf = DEVNULL
+ if err is not None:
+ errf = open(err, mode='w')
+ else:
+ errf = DEVNULL
+ (_, _, retcode) = RunCommandWithOutput(cmd, None, outf, errf, timeout)
+ if outf != DEVNULL:
+ outf.close()
+ if errf != DEVNULL:
+ errf.close()
+ return retcode
+
+#
+# Execution modes.
+#
+
+class TestRunner(object):
+ """Abstraction for running a test in a particular execution mode."""
+ __meta_class__ = abc.ABCMeta
+
+ @abc.abstractproperty
+ def description(self):
+ """Returns a description string of the execution mode."""
+
+ @abc.abstractmethod
+ def RunTest(self):
+ """Run the generated test.
+
+ Ensures that the current fuzz.dart in the temporary directory is executed
+ under the current execution mode.
+
+ Most nonzero return codes are assumed non-divergent, since systems may
+ exit in different ways. This is enforced by normalizing return codes.
+
+ Returns:
+ tuple (string, string, RetCode) stdout-output, stderr-output, return code.
+ """
+
+class TestRunnerDartJIT(TestRunner):
+ """Concrete test runner of Dart JIT."""
+
+ @property
+ def description(self):
+ return 'Dart JIT'
+
+ def RunTest(self):
+ return RunCommandWithOutput(['dart', 'fuzz.dart'], None, PIPE, STDOUT)
+
+class TestRunnerDartAOT(TestRunner):
+ """Concrete test runner of Dart AOT."""
+
+ @property
+ def description(self):
+ return 'Dart AOT'
+
+ def RunTest(self):
+ (out, err, retcode) = RunCommandWithOutput(
+ ['precompiler2', 'fuzz.dart', 'snap'], None, PIPE, STDOUT)
+ if retcode != RetCode.SUCCESS:
+ return (out, err, retcode)
+ return RunCommandWithOutput(['dart_precompiled_runtime2', 'snap'], None, PIPE, STDOUT)
+
+class TestRunnerDart2JS(TestRunner):
+ """Concrete test runner of Dart through dart2js and JS."""
+
+ @property
+ def description(self):
+ return 'Dart as JS'
+
+ def RunTest(self):
+ (out, err, retcode) = RunCommandWithOutput(['dart2js', 'fuzz.dart'], None, PIPE, STDOUT)
+ if retcode != RetCode.SUCCESS:
+ return (out, err, retcode)
+ return RunCommandWithOutput(['nodejs', 'out.js'], None, PIPE, STDOUT)
+
+def GetExecutionModeRunner(mode):
+ """Returns a runner for the given execution mode.
+
+ Args:
+ mode: string, execution mode
+ Returns:
+ TestRunner with given execution mode
+ Raises:
+ FatalError: error for unknown execution mode
+ """
+ if mode == 'jit':
+ return TestRunnerDartJIT()
+ if mode == 'aot':
+ return TestRunnerDartAOT()
+ if mode == 'js':
+ return TestRunnerDart2JS()
+ raise FatalError('Unknown execution mode')
+
+#
+# DartFuzzTester class.
+#
+
+class DartFuzzTester(object):
+ """Tester that runs DartFuzz many times and report divergences."""
+
+ def __init__(self, repeat, true_divergence, mode1, mode2):
+ """Constructor for the tester.
+
+ Args:
+ repeat: int, number of tests to run.
+ true_divergence: boolean, report true divergences only.
+ mode1: string, execution mode for first runner.
+ mode2: string, execution mode for second runner.
+ """
+ self._repeat = repeat
+ self._true_divergence = true_divergence
+ self._runner1 = GetExecutionModeRunner(mode1)
+ self._runner2 = GetExecutionModeRunner(mode2)
+
+ def __enter__(self):
+ """On entry, enters new temp directory after saving current directory.
+
+ Raises:
+ FatalError: error when temp directory cannot be constructed.
+ """
+ self._save_dir = os.getcwd()
+ self._tmp_dir = mkdtemp(dir='/tmp/')
+ if self._tmp_dir == None:
+ raise FatalError('Cannot obtain temp directory')
+ os.chdir(self._tmp_dir)
+ return self
+
+ def __exit__(self, etype, evalue, etraceback):
+ """On exit, re-enters previously saved current directory and cleans up."""
+ os.chdir(self._save_dir)
+ if self._num_divergences == 0:
+ shutil.rmtree(self._tmp_dir)
+ print('\n\nsuccess (no divergences)\n')
+ else:
+ print('\n\nfailure (divergences):', self._tmp_dir, '\n')
+
+ def Run(self):
+ """Runs DartFuzz many times and report divergences."""
+ self.Setup()
+ print()
+ print('**\n**** Dart Fuzz Testing\n**')
+ print()
+ print('#Tests :', self._repeat)
+ print('Exec-Mode 1 :', self._runner1.description)
+ print('Exec-Mode 2 :', self._runner2.description)
+ print()
+ self.ShowStats() # show all zeros on start
+ for self._test in range(1, self._repeat + 1):
+ self.RunTest()
+ self.ShowStats()
+
+ def Setup(self):
+ """Initial setup of the testing environment."""
+ # Fuzzer command.
+ self._dartfuzz = self._save_dir + '/dartfuzz.py'
+ # Statistics.
+ self._test = 0
+ self._num_success = 0
+ self._num_not_run = 0
+ self._num_timed_out = 0
+ self._num_divergences = 0
+
+ def ShowStats(self):
+ """Shows current statistics (on same line) while tester is running."""
+ print('\rTests:', self._test,
+ 'Success:', self._num_success,
+ 'Not-run:', self._num_not_run,
+ 'Timed-out:', self._num_timed_out,
+ 'Divergences:', self._num_divergences,
+ end='')
+ sys.stdout.flush()
+
+ def RunTest(self):
+ """Runs a single fuzz test, comparing two execution modes."""
+ self.ConstructTest()
+ (out1, _, retcode1) = self._runner1.RunTest()
+ (out2, _, retcode2) = self._runner2.RunTest()
+ self.CheckForDivergence(out1, retcode1, out2, retcode2)
+ self.CleanupTest()
+
+ def ConstructTest(self):
+ """Use DartFuzz to generate next fuzz.dart test.
+
+ Raises:
+ FatalError: error when DartFuzz fails.
+ """
+ # Invoke dartfuzz script on command line rather than calling py code.
+ if (RunCommand([self._dartfuzz], out='fuzz.dart') != RetCode.SUCCESS):
+ raise FatalError('Unexpected error while running DartFuzz')
+
+ def CheckForDivergence(self, out1, retcode1, out2, retcode2):
+ """Checks for divergences and updates statistics.
+
+ Args:
+ out1: string, output for first runner.
+ retcode1: int, normalized return code of first runner.
+ out2: string, output for second runner.
+ retcode2: int, normalized return code of second runner.
+ """
+ if retcode1 == retcode2:
+ # No divergence in return code.
+ if retcode1 == RetCode.SUCCESS:
+ # Both compilations and runs were successful, inspect generated output.
+ if out1 == out2:
+ # No divergence in output.
+ self._num_success += 1
+ else:
+ # Divergence in output.
+ self.ReportDivergence(out1, retcode1, out2, retcode2, True)
+ elif retcode1 == RetCode.ERROR:
+ # Both did not run.
+ self._num_not_run += 1
+ elif retcode1 == RetCode.TIMEOUT:
+ # Both timed out.
+ self._num_timed_out += 1
+ else:
+ raise FatalError('Unknown return code')
+ else:
+ # Divergence in return code.
+ if self._true_divergence:
+ # When only true divergences are requested, any divergence in return
+ # code where one is a time out is treated as a regular time out.
+ if RetCode.TIMEOUT in (retcode1, retcode2):
+ self._num_timed_out += 1
+ return
+ self.ReportDivergence(out1, retcode1, out2, retcode2, False)
+
+ def ReportDivergence(self, out1, retcode1, out2, retcode2, is_output_divergence):
+ """Reports and saves a divergence.
+
+ Args:
+ out1: string, output for first runner.
+ retcode1: int, normalized return code of first runner.
+ out2: string, output for second runner.
+ retcode2: int, normalized return code of second runner.
+ is_output_divergence, boolean, denotes output divergence.
+ """
+ self._num_divergences += 1
+ print('\n#' + str(self._num_divergences), end='')
+ if is_output_divergence:
+ print(' divergence in output')
+ else:
+ print(' divergence in return code: '
+ + retcode1.name + ' vs. ' + retcode2.name)
+ print('->')
+ print(out1, end='')
+ print('<-')
+ print(out2, end='')
+ print('--')
+ # Save.
+ ddir = self._tmp_dir + '/divergence' + str(self._num_divergences)
+ os.mkdir(ddir)
+ shutil.copy('fuzz.dart', ddir)
+ # TODO: file bug report
+
+ def CleanupTest(self):
+ """Cleans up after a single test run."""
+ for file_name in os.listdir(self._tmp_dir):
+ file_path = os.path.join(self._tmp_dir, file_name)
+ if os.path.isfile(file_path):
+ os.unlink(file_path)
+ elif os.path.isdir(file_path):
+ pass # keep the divergences directories
+
+#
+# Main driver.
+#
+
+def main():
+ # Handle arguments.
+ parser = argparse.ArgumentParser()
+ parser.add_argument('--repeat', default=1000, type=int,
+ help='number of tests to run (default: 1000)')
+ parser.add_argument('--true_divergence', default=False, action='store_true',
+ help='only report true divergences')
+ parser.add_argument('--mode1', default='jit',
+ help='execution mode 1 (default: jit)')
+ parser.add_argument('--mode2', default='aot',
+ help='execution mode 2 (default: aot)')
+ args = parser.parse_args()
+
+ # Run DartFuzz tester.
+ with DartFuzzTester(args.repeat,
+ args.true_divergence,
+ args.mode1,
+ args.mode2) as fuzzer:
+ fuzzer.Run()
+
+if __name__ == '__main__':
+ main()
diff --git a/runtime/vm/BUILD.gn b/runtime/vm/BUILD.gn
index 33bd09d..4bbd984 100644
--- a/runtime/vm/BUILD.gn
+++ b/runtime/vm/BUILD.gn
@@ -304,7 +304,9 @@
}
compile_platform("vm_legacy_platform") {
- libraries_specification_uri = "../../sdk/lib/libraries.json"
+ single_root_scheme = "org-dartlang-sdk"
+ single_root_base = rebase_path("../../")
+ libraries_specification_uri = "org-dartlang-sdk:///sdk/lib/libraries.json"
outputs = [
"$root_out_dir/vm_platform.dill",
@@ -317,7 +319,9 @@
compile_platform("vm_platform") {
add_implicit_vm_platform_dependency = false
- libraries_specification_uri = "../../sdk/lib/libraries.json"
+ single_root_scheme = "org-dartlang-sdk"
+ single_root_base = rebase_path("../../")
+ libraries_specification_uri = "org-dartlang-sdk:///sdk/lib/libraries.json"
outputs = [
"$root_out_dir/vm_platform_strong.dill",
diff --git a/runtime/vm/class_finalizer.cc b/runtime/vm/class_finalizer.cc
index 7577fb7..072d5a3 100644
--- a/runtime/vm/class_finalizer.cc
+++ b/runtime/vm/class_finalizer.cc
@@ -1172,7 +1172,9 @@
// malformed.
if ((finalization >= kCanonicalize) && !type.IsMalformed() &&
!type.IsCanonical() && type.IsType()) {
- CheckTypeBounds(cls, type);
+ if (!Isolate::Current()->strong()) {
+ CheckTypeBounds(cls, type);
+ }
return type.Canonicalize();
}
return type.raw();
@@ -1314,7 +1316,7 @@
// If we are done finalizing a graph of mutually recursive types, check their
// bounds.
- if (is_root_type) {
+ if (is_root_type && !Isolate::Current()->strong()) {
for (intptr_t i = pending_types->length() - 1; i >= 0; i--) {
const AbstractType& type = pending_types->At(i);
if (!type.IsMalformed() && !type.IsCanonical()) {
diff --git a/runtime/vm/compiler/assembler/assembler_arm.cc b/runtime/vm/compiler/assembler/assembler_arm.cc
index 49bded1..70bee17 100644
--- a/runtime/vm/compiler/assembler/assembler_arm.cc
+++ b/runtime/vm/compiler/assembler/assembler_arm.cc
@@ -6,6 +6,7 @@
#if defined(TARGET_ARCH_ARM) && !defined(DART_PRECOMPILED_RUNTIME)
#include "vm/compiler/assembler/assembler.h"
+#include "vm/compiler/backend/locations.h"
#include "vm/cpu.h"
#include "vm/longjump.h"
#include "vm/runtime_entry.h"
@@ -2225,6 +2226,70 @@
ldm(IA_W, SP, regs, cond);
}
+void Assembler::PushRegisters(const RegisterSet& regs) {
+ const intptr_t fpu_regs_count = regs.FpuRegisterCount();
+ if (fpu_regs_count > 0) {
+ AddImmediate(SP, -(fpu_regs_count * kFpuRegisterSize));
+ // Store fpu registers with the lowest register number at the lowest
+ // address.
+ intptr_t offset = 0;
+ mov(TMP, Operand(SP));
+ for (intptr_t i = 0; i < kNumberOfFpuRegisters; ++i) {
+ QRegister fpu_reg = static_cast<QRegister>(i);
+ if (regs.ContainsFpuRegister(fpu_reg)) {
+ DRegister d = EvenDRegisterOf(fpu_reg);
+ ASSERT(d + 1 == OddDRegisterOf(fpu_reg));
+ vstmd(IA_W, IP, d, 2);
+ offset += kFpuRegisterSize;
+ }
+ }
+ ASSERT(offset == (fpu_regs_count * kFpuRegisterSize));
+ }
+
+ // The order in which the registers are pushed must match the order
+ // in which the registers are encoded in the safe point's stack map.
+ // NOTE: This matches the order of ARM's multi-register push.
+ RegList reg_list = 0;
+ for (intptr_t i = kNumberOfCpuRegisters - 1; i >= 0; --i) {
+ Register reg = static_cast<Register>(i);
+ if (regs.ContainsRegister(reg)) {
+ reg_list |= (1 << reg);
+ }
+ }
+ if (reg_list != 0) {
+ PushList(reg_list);
+ }
+}
+
+void Assembler::PopRegisters(const RegisterSet& regs) {
+ RegList reg_list = 0;
+ for (intptr_t i = kNumberOfCpuRegisters - 1; i >= 0; --i) {
+ Register reg = static_cast<Register>(i);
+ if (regs.ContainsRegister(reg)) {
+ reg_list |= (1 << reg);
+ }
+ }
+ if (reg_list != 0) {
+ PopList(reg_list);
+ }
+
+ const intptr_t fpu_regs_count = regs.FpuRegisterCount();
+ if (fpu_regs_count > 0) {
+ // Fpu registers have the lowest register number at the lowest address.
+ intptr_t offset = 0;
+ for (intptr_t i = 0; i < kNumberOfFpuRegisters; ++i) {
+ QRegister fpu_reg = static_cast<QRegister>(i);
+ if (regs.ContainsFpuRegister(fpu_reg)) {
+ DRegister d = EvenDRegisterOf(fpu_reg);
+ ASSERT(d + 1 == OddDRegisterOf(fpu_reg));
+ vldmd(IA_W, SP, d, 2);
+ offset += kFpuRegisterSize;
+ }
+ }
+ ASSERT(offset == (fpu_regs_count * kFpuRegisterSize));
+ }
+}
+
void Assembler::MoveRegister(Register rd, Register rm, Condition cond) {
if (rd != rm) {
mov(rd, Operand(rm), cond);
@@ -2406,6 +2471,15 @@
blx(IP);
}
+void Assembler::CallNullErrorShared(bool save_fpu_registers) {
+ uword entry_point_offset =
+ save_fpu_registers
+ ? Thread::null_error_shared_with_fpu_regs_entry_point_offset()
+ : Thread::null_error_shared_without_fpu_regs_entry_point_offset();
+ ldr(LR, Address(THR, entry_point_offset));
+ blx(LR);
+}
+
void Assembler::BranchLinkWithEquivalence(const StubEntry& stub_entry,
const Object& equivalence) {
const Code& target = Code::ZoneHandle(stub_entry.code());
diff --git a/runtime/vm/compiler/assembler/assembler_arm.h b/runtime/vm/compiler/assembler/assembler_arm.h
index 1916d62..4de25ee 100644
--- a/runtime/vm/compiler/assembler/assembler_arm.h
+++ b/runtime/vm/compiler/assembler/assembler_arm.h
@@ -22,6 +22,7 @@
// Forward declarations.
class RuntimeEntry;
class StubEntry;
+class RegisterSet;
// Instruction encoding bits.
enum {
@@ -698,7 +699,7 @@
void BranchLink(const Code& code, Patchability patchable);
void BranchLinkToRuntime();
- void CallNullErrorShared(bool save_fpu_registers) { UNREACHABLE(); }
+ void CallNullErrorShared(bool save_fpu_registers);
// Branch and link to an entry address. Call sequence can be patched.
void BranchLinkPatchable(const StubEntry& stub_entry);
@@ -910,6 +911,9 @@
void PushList(RegList regs, Condition cond = AL);
void PopList(RegList regs, Condition cond = AL);
+ void PushRegisters(const RegisterSet& regs);
+ void PopRegisters(const RegisterSet& regs);
+
void CompareRegisters(Register rn, Register rm) { cmp(rn, Operand(rm)); }
void BranchIf(Condition condition, Label* label) { b(label, condition); }
diff --git a/runtime/vm/compiler/assembler/assembler_arm64.cc b/runtime/vm/compiler/assembler/assembler_arm64.cc
index dee219c..cc16da2 100644
--- a/runtime/vm/compiler/assembler/assembler_arm64.cc
+++ b/runtime/vm/compiler/assembler/assembler_arm64.cc
@@ -6,6 +6,7 @@
#if defined(TARGET_ARCH_ARM64) && !defined(DART_PRECOMPILED_RUNTIME)
#include "vm/compiler/assembler/assembler.h"
+#include "vm/compiler/backend/locations.h"
#include "vm/cpu.h"
#include "vm/longjump.h"
#include "vm/runtime_entry.h"
@@ -655,6 +656,15 @@
blr(TMP);
}
+void Assembler::CallNullErrorShared(bool save_fpu_registers) {
+ uword entry_point_offset =
+ save_fpu_registers
+ ? Thread::null_error_shared_with_fpu_regs_entry_point_offset()
+ : Thread::null_error_shared_without_fpu_regs_entry_point_offset();
+ ldr(LR, Address(THR, entry_point_offset));
+ blr(LR);
+}
+
void Assembler::AddImmediate(Register dest, Register rn, int64_t imm) {
Operand op;
if (imm == 0) {
@@ -1580,6 +1590,49 @@
UNIMPLEMENTED();
}
+void Assembler::PushRegisters(const RegisterSet& regs) {
+ const intptr_t fpu_regs_count = regs.FpuRegisterCount();
+ if (fpu_regs_count > 0) {
+ // Store fpu registers with the lowest register number at the lowest
+ // address.
+ for (intptr_t i = kNumberOfVRegisters - 1; i >= 0; --i) {
+ VRegister fpu_reg = static_cast<VRegister>(i);
+ if (regs.ContainsFpuRegister(fpu_reg)) {
+ PushQuad(fpu_reg);
+ }
+ }
+ }
+
+ // The order in which the registers are pushed must match the order
+ // in which the registers are encoded in the safe point's stack map.
+ for (intptr_t i = kNumberOfCpuRegisters - 1; i >= 0; --i) {
+ Register reg = static_cast<Register>(i);
+ if (regs.ContainsRegister(reg)) {
+ Push(reg);
+ }
+ }
+}
+
+void Assembler::PopRegisters(const RegisterSet& regs) {
+ for (intptr_t i = 0; i < kNumberOfCpuRegisters; ++i) {
+ Register reg = static_cast<Register>(i);
+ if (regs.ContainsRegister(reg)) {
+ Pop(reg);
+ }
+ }
+
+ const intptr_t fpu_regs_count = regs.FpuRegisterCount();
+ if (fpu_regs_count > 0) {
+ // Fpu registers have the lowest register number at the lowest address.
+ for (intptr_t i = 0; i < kNumberOfVRegisters; ++i) {
+ VRegister fpu_reg = static_cast<VRegister>(i);
+ if (regs.ContainsFpuRegister(fpu_reg)) {
+ PopQuad(fpu_reg);
+ }
+ }
+ }
+}
+
} // namespace dart
#endif // defined(TARGET_ARCH_ARM64) && !defined(DART_PRECOMPILED_RUNTIME)
diff --git a/runtime/vm/compiler/assembler/assembler_arm64.h b/runtime/vm/compiler/assembler/assembler_arm64.h
index ba5897e..2bcfb14 100644
--- a/runtime/vm/compiler/assembler/assembler_arm64.h
+++ b/runtime/vm/compiler/assembler/assembler_arm64.h
@@ -22,6 +22,7 @@
// Forward declarations.
class RuntimeEntry;
class StubEntry;
+class RegisterSet;
class Immediate : public ValueObject {
public:
@@ -430,6 +431,9 @@
void PushRegister(Register r) { Push(r); }
void PopRegister(Register r) { Pop(r); }
+ void PushRegisters(const RegisterSet& registers);
+ void PopRegisters(const RegisterSet& registers);
+
void Drop(intptr_t stack_elements) {
add(SP, SP, Operand(stack_elements * kWordSize));
}
@@ -1379,7 +1383,7 @@
void BranchLinkPatchable(const StubEntry& stub_entry);
void BranchLinkToRuntime();
- void CallNullErrorShared(bool save_fpu_registers) { UNREACHABLE(); }
+ void CallNullErrorShared(bool save_fpu_registers);
// Emit a call that shares its object pool entries with other calls
// that have the same equivalence marker.
diff --git a/runtime/vm/compiler/backend/constant_propagator.cc b/runtime/vm/compiler/backend/constant_propagator.cc
index ab5b854..e7db5aa 100644
--- a/runtime/vm/compiler/backend/constant_propagator.cc
+++ b/runtime/vm/compiler/backend/constant_propagator.cc
@@ -706,8 +706,10 @@
void ConstantPropagator::VisitInstanceOf(InstanceOfInstr* instr) {
Definition* def = instr->value()->definition();
const Object& value = def->constant_value();
- if (IsNonConstant(value)) {
- const AbstractType& checked_type = instr->type();
+ const AbstractType& checked_type = instr->type();
+ if (checked_type.IsTopType()) {
+ SetValue(instr, Bool::True());
+ } else if (IsNonConstant(value)) {
intptr_t value_cid = instr->value()->definition()->Type()->ToCid();
Representation rep = def->representation();
if ((checked_type.IsFloat32x4Type() && (rep == kUnboxedFloat32x4)) ||
@@ -728,7 +730,6 @@
} else if (IsConstant(value)) {
if (value.IsInstance()) {
const Instance& instance = Instance::Cast(value);
- const AbstractType& checked_type = instr->type();
if (instr->instantiator_type_arguments()->BindsToConstantNull() &&
instr->function_type_arguments()->BindsToConstantNull()) {
Error& bound_error = Error::Handle();
@@ -775,7 +776,8 @@
void ConstantPropagator::VisitLoadField(LoadFieldInstr* instr) {
Value* instance = instr->instance();
- if ((instr->recognized_kind() == MethodRecognizer::kObjectArrayLength) &&
+ if ((instr->native_field() != nullptr) &&
+ (instr->native_field()->kind() == NativeFieldDesc::kArray_length) &&
instance->definition()->OriginalDefinition()->IsCreateArray()) {
Value* num_elements = instance->definition()
->OriginalDefinition()
diff --git a/runtime/vm/compiler/backend/flow_graph_compiler.cc b/runtime/vm/compiler/backend/flow_graph_compiler.cc
index 4f48c7b..5b941df 100644
--- a/runtime/vm/compiler/backend/flow_graph_compiler.cc
+++ b/runtime/vm/compiler/backend/flow_graph_compiler.cc
@@ -779,7 +779,8 @@
if ((kReservedCpuRegisters & (1 << i)) != 0) continue;
const Register reg = static_cast<Register>(i);
bitmap->Set(bitmap->Length(),
- locs->live_registers()->ContainsRegister(reg));
+ locs->live_registers()->ContainsRegister(reg) &&
+ locs->live_registers()->IsTagged(reg));
}
}
@@ -2192,7 +2193,9 @@
compiler->SlowPathEnvironmentFor(instruction(), num_args_);
compiler->EmitCatchEntryState(env, try_index_);
}
- __ Breakpoint();
+ if (!use_shared_stub) {
+ __ Breakpoint();
+ }
}
#undef __
diff --git a/runtime/vm/compiler/backend/flow_graph_compiler_arm.cc b/runtime/vm/compiler/backend/flow_graph_compiler_arm.cc
index 6233ee3..c536e9c 100644
--- a/runtime/vm/compiler/backend/flow_graph_compiler_arm.cc
+++ b/runtime/vm/compiler/backend/flow_graph_compiler_arm.cc
@@ -1137,69 +1137,12 @@
locs->CheckWritableInputs();
ClobberDeadTempRegisters(locs);
#endif
-
// TODO(vegorov): consider saving only caller save (volatile) registers.
- const intptr_t fpu_regs_count = locs->live_registers()->FpuRegisterCount();
- if (fpu_regs_count > 0) {
- __ AddImmediate(SP, -(fpu_regs_count * kFpuRegisterSize));
- // Store fpu registers with the lowest register number at the lowest
- // address.
- intptr_t offset = 0;
- __ mov(IP, Operand(SP));
- for (intptr_t i = 0; i < kNumberOfFpuRegisters; ++i) {
- QRegister fpu_reg = static_cast<QRegister>(i);
- if (locs->live_registers()->ContainsFpuRegister(fpu_reg)) {
- DRegister d = EvenDRegisterOf(fpu_reg);
- ASSERT(d + 1 == OddDRegisterOf(fpu_reg));
- __ vstmd(IA_W, IP, d, 2);
- offset += kFpuRegisterSize;
- }
- }
- ASSERT(offset == (fpu_regs_count * kFpuRegisterSize));
- }
-
- // The order in which the registers are pushed must match the order
- // in which the registers are encoded in the safe point's stack map.
- // NOTE: This matches the order of ARM's multi-register push.
- RegList reg_list = 0;
- for (intptr_t i = kNumberOfCpuRegisters - 1; i >= 0; --i) {
- Register reg = static_cast<Register>(i);
- if (locs->live_registers()->ContainsRegister(reg)) {
- reg_list |= (1 << reg);
- }
- }
- if (reg_list != 0) {
- __ PushList(reg_list);
- }
+ __ PushRegisters(*locs->live_registers());
}
void FlowGraphCompiler::RestoreLiveRegisters(LocationSummary* locs) {
- RegList reg_list = 0;
- for (intptr_t i = kNumberOfCpuRegisters - 1; i >= 0; --i) {
- Register reg = static_cast<Register>(i);
- if (locs->live_registers()->ContainsRegister(reg)) {
- reg_list |= (1 << reg);
- }
- }
- if (reg_list != 0) {
- __ PopList(reg_list);
- }
-
- const intptr_t fpu_regs_count = locs->live_registers()->FpuRegisterCount();
- if (fpu_regs_count > 0) {
- // Fpu registers have the lowest register number at the lowest address.
- intptr_t offset = 0;
- for (intptr_t i = 0; i < kNumberOfFpuRegisters; ++i) {
- QRegister fpu_reg = static_cast<QRegister>(i);
- if (locs->live_registers()->ContainsFpuRegister(fpu_reg)) {
- DRegister d = EvenDRegisterOf(fpu_reg);
- ASSERT(d + 1 == OddDRegisterOf(fpu_reg));
- __ vldmd(IA_W, SP, d, 2);
- offset += kFpuRegisterSize;
- }
- }
- ASSERT(offset == (fpu_regs_count * kFpuRegisterSize));
- }
+ __ PopRegisters(*locs->live_registers());
}
#if defined(DEBUG)
diff --git a/runtime/vm/compiler/backend/flow_graph_compiler_arm64.cc b/runtime/vm/compiler/backend/flow_graph_compiler_arm64.cc
index d46f351..15e28ee 100644
--- a/runtime/vm/compiler/backend/flow_graph_compiler_arm64.cc
+++ b/runtime/vm/compiler/backend/flow_graph_compiler_arm64.cc
@@ -1111,48 +1111,12 @@
locs->CheckWritableInputs();
ClobberDeadTempRegisters(locs);
#endif
-
// TODO(vegorov): consider saving only caller save (volatile) registers.
- const intptr_t fpu_regs_count = locs->live_registers()->FpuRegisterCount();
- if (fpu_regs_count > 0) {
- // Store fpu registers with the lowest register number at the lowest
- // address.
- for (intptr_t i = kNumberOfVRegisters - 1; i >= 0; --i) {
- VRegister fpu_reg = static_cast<VRegister>(i);
- if (locs->live_registers()->ContainsFpuRegister(fpu_reg)) {
- __ PushQuad(fpu_reg);
- }
- }
- }
-
- // The order in which the registers are pushed must match the order
- // in which the registers are encoded in the safe point's stack map.
- for (intptr_t i = kNumberOfCpuRegisters - 1; i >= 0; --i) {
- Register reg = static_cast<Register>(i);
- if (locs->live_registers()->ContainsRegister(reg)) {
- __ Push(reg);
- }
- }
+ __ PushRegisters(*locs->live_registers());
}
void FlowGraphCompiler::RestoreLiveRegisters(LocationSummary* locs) {
- for (intptr_t i = 0; i < kNumberOfCpuRegisters; ++i) {
- Register reg = static_cast<Register>(i);
- if (locs->live_registers()->ContainsRegister(reg)) {
- __ Pop(reg);
- }
- }
-
- const intptr_t fpu_regs_count = locs->live_registers()->FpuRegisterCount();
- if (fpu_regs_count > 0) {
- // Fpu registers have the lowest register number at the lowest address.
- for (intptr_t i = 0; i < kNumberOfVRegisters; ++i) {
- VRegister fpu_reg = static_cast<VRegister>(i);
- if (locs->live_registers()->ContainsFpuRegister(fpu_reg)) {
- __ PopQuad(fpu_reg);
- }
- }
- }
+ __ PopRegisters(*locs->live_registers());
}
#if defined(DEBUG)
diff --git a/runtime/vm/compiler/backend/il.cc b/runtime/vm/compiler/backend/il.cc
index 81e98f8..b1ed153 100644
--- a/runtime/vm/compiler/backend/il.cc
+++ b/runtime/vm/compiler/backend/il.cc
@@ -562,6 +562,86 @@
return mask;
}
+const NativeFieldDesc* NativeFieldDesc::Get(Kind kind) {
+ static const NativeFieldDesc fields[] = {
+#define IMMUTABLE true
+#define MUTABLE false
+#define DEFINE_NATIVE_FIELD(ClassName, FieldName, cid, mutability) \
+ NativeFieldDesc(k##ClassName##_##FieldName, ClassName::FieldName##_offset(), \
+ k##cid##Cid, mutability),
+
+ NATIVE_FIELDS_LIST(DEFINE_NATIVE_FIELD)
+
+#undef DEFINE_FIELD
+#undef MUTABLE
+#undef IMMUTABLE
+ };
+
+ return &fields[kind];
+}
+
+const NativeFieldDesc* NativeFieldDesc::GetLengthFieldForArrayCid(
+ intptr_t array_cid) {
+ if (RawObject::IsExternalTypedDataClassId(array_cid) ||
+ RawObject::IsTypedDataClassId(array_cid)) {
+ return Get(kTypedData_length);
+ }
+
+ switch (array_cid) {
+ case kGrowableObjectArrayCid:
+ return Get(kGrowableObjectArray_length);
+
+ case kOneByteStringCid:
+ case kTwoByteStringCid:
+ case kExternalOneByteStringCid:
+ case kExternalTwoByteStringCid:
+ return Get(kString_length);
+
+ case kArrayCid:
+ case kImmutableArrayCid:
+ return Get(kArray_length);
+
+ default:
+ UNREACHABLE();
+ return nullptr;
+ }
+}
+
+const NativeFieldDesc* NativeFieldDesc::GetTypeArgumentsFieldFor(
+ Zone* zone,
+ const Class& cls) {
+ // TODO(vegorov) consider caching type arguments fields for specific classes
+ // in some sort of a flow-graph specific cache.
+ const intptr_t offset = cls.type_arguments_field_offset();
+ ASSERT(offset != Class::kNoTypeArguments);
+ return new (zone) NativeFieldDesc(kTypeArguments, offset, kDynamicCid,
+ /*immutable=*/true);
+}
+
+RawAbstractType* NativeFieldDesc::type() const {
+ if (cid() == kSmiCid) {
+ return Type::SmiType();
+ }
+
+ return Type::DynamicType();
+}
+
+const char* NativeFieldDesc::name() const {
+ switch (kind()) {
+#define HANDLE_CASE(ClassName, FieldName, cid, mutability) \
+ case k##ClassName##_##FieldName: \
+ return #ClassName "." #FieldName;
+
+ NATIVE_FIELDS_LIST(HANDLE_CASE)
+
+#undef HANDLE_CASE
+ case kTypeArguments:
+ return ":type_arguments";
+ }
+ UNREACHABLE();
+ return nullptr;
+}
+
bool LoadFieldInstr::IsUnboxedLoad() const {
return FLAG_unbox_numeric_fields && (field() != NULL) &&
FlowGraphCompiler::IsUnboxedField(*field());
@@ -2240,34 +2320,27 @@
}
bool LoadFieldInstr::IsImmutableLengthLoad() const {
- switch (recognized_kind()) {
- case MethodRecognizer::kObjectArrayLength:
- case MethodRecognizer::kImmutableArrayLength:
- case MethodRecognizer::kTypedDataLength:
- case MethodRecognizer::kStringBaseLength:
- return true;
- default:
- return false;
- }
-}
+ if (native_field() != nullptr) {
+ switch (native_field()->kind()) {
+ case NativeFieldDesc::kArray_length:
+ case NativeFieldDesc::kTypedData_length:
+ case NativeFieldDesc::kString_length:
+ return true;
+ case NativeFieldDesc::kGrowableObjectArray_length:
+ return false;
-MethodRecognizer::Kind LoadFieldInstr::RecognizedKindFromArrayCid(
- intptr_t cid) {
- if (RawObject::IsTypedDataClassId(cid) ||
- RawObject::IsExternalTypedDataClassId(cid)) {
- return MethodRecognizer::kTypedDataLength;
+ // Not length loads.
+ case NativeFieldDesc::kLinkedHashMap_index:
+ case NativeFieldDesc::kLinkedHashMap_data:
+ case NativeFieldDesc::kLinkedHashMap_hash_mask:
+ case NativeFieldDesc::kLinkedHashMap_used_data:
+ case NativeFieldDesc::kLinkedHashMap_deleted_keys:
+ case NativeFieldDesc::kArgumentsDescriptor_type_args_len:
+ case NativeFieldDesc::kTypeArguments:
+ return false;
+ }
}
- switch (cid) {
- case kArrayCid:
- return MethodRecognizer::kObjectArrayLength;
- case kImmutableArrayCid:
- return MethodRecognizer::kImmutableArrayLength;
- case kGrowableObjectArrayCid:
- return MethodRecognizer::kGrowableArrayLength;
- default:
- UNREACHABLE();
- return MethodRecognizer::kUnknown;
- }
+ return false;
}
bool LoadFieldInstr::IsFixedLengthArrayCid(intptr_t cid) {
@@ -2297,7 +2370,22 @@
}
bool LoadFieldInstr::Evaluate(const Object& instance, Object* result) {
- if (field() == NULL || !field()->is_final() || !instance.IsInstance()) {
+ if (native_field() != nullptr) {
+ switch (native_field()->kind()) {
+ case NativeFieldDesc::kArgumentsDescriptor_type_args_len:
+ if (instance.IsArray() && Array::Cast(instance).IsImmutable()) {
+ ArgumentsDescriptor desc(Array::Cast(instance));
+ *result = Smi::New(desc.TypeArgsLen());
+ return true;
+ }
+ return false;
+
+ default:
+ break;
+ }
+ }
+
+ if (field() == nullptr || !field()->is_final() || !instance.IsInstance()) {
return false;
}
@@ -2318,39 +2406,41 @@
}
Definition* LoadFieldInstr::Canonicalize(FlowGraph* flow_graph) {
- if (!HasUses()) return NULL;
+ if (!HasUses()) return nullptr;
if (IsImmutableLengthLoad()) {
- // For fixed length arrays if the array is the result of a known constructor
- // call we can replace the length load with the length argument passed to
- // the constructor.
- StaticCallInstr* call =
- instance()->definition()->OriginalDefinition()->AsStaticCall();
- if (call != NULL) {
+ Definition* array = instance()->definition()->OriginalDefinition();
+ if (StaticCallInstr* call = array->AsStaticCall()) {
+ // For fixed length arrays if the array is the result of a known
+ // constructor call we can replace the length load with the length
+ // argument passed to the constructor.
if (call->is_known_list_constructor() &&
IsFixedLengthArrayCid(call->Type()->ToCid())) {
return call->ArgumentAt(1);
}
- }
-
- CreateArrayInstr* create_array =
- instance()->definition()->OriginalDefinition()->AsCreateArray();
- if ((create_array != NULL) &&
- (recognized_kind() == MethodRecognizer::kObjectArrayLength)) {
- return create_array->num_elements()->definition();
- }
-
- // For arrays with guarded lengths, replace the length load
- // with a constant.
- LoadFieldInstr* load_array =
- instance()->definition()->OriginalDefinition()->AsLoadField();
- if (load_array != NULL) {
+ } else if (CreateArrayInstr* create_array = array->AsCreateArray()) {
+ if (native_field() == NativeFieldDesc::Array_length()) {
+ return create_array->num_elements()->definition();
+ }
+ } else if (LoadFieldInstr* load_array = array->AsLoadField()) {
+ // For arrays with guarded lengths, replace the length load
+ // with a constant.
const Field* field = load_array->field();
- if ((field != NULL) && (field->guarded_list_length() >= 0)) {
+ if ((field != nullptr) && (field->guarded_list_length() >= 0)) {
return flow_graph->GetConstant(
Smi::Handle(Smi::New(field->guarded_list_length())));
}
}
+ } else if (native_field() != nullptr &&
+ native_field()->kind() == NativeFieldDesc::kTypeArguments) {
+ Definition* array = instance()->definition()->OriginalDefinition();
+ if (StaticCallInstr* call = array->AsStaticCall()) {
+ if (call->is_known_list_constructor()) {
+ return call->ArgumentAt(0);
+ }
+ } else if (CreateArrayInstr* create_array = array->AsCreateArray()) {
+ return create_array->element_type()->definition();
+ }
}
// Try folding away loads from constant objects.
diff --git a/runtime/vm/compiler/backend/il.h b/runtime/vm/compiler/backend/il.h
index 656e856..9ebff20 100644
--- a/runtime/vm/compiler/backend/il.h
+++ b/runtime/vm/compiler/backend/il.h
@@ -1010,6 +1010,16 @@
void Unsupported(FlowGraphCompiler* compiler);
+ static bool SlowPathSharingSupported(bool is_optimizing) {
+#if defined(TARGET_ARCH_X64) || defined(TARGET_ARCH_ARM) || \
+ defined(TARGET_ARCH_ARM64)
+ return FLAG_enable_slow_path_sharing && FLAG_precompiled_mode &&
+ is_optimizing;
+#else
+ return false;
+#endif
+ }
+
virtual bool UseSharedSlowPathStub(bool is_optimizing) const { return false; }
protected:
@@ -4895,6 +4905,78 @@
DISALLOW_COPY_AND_ASSIGN(LoadClassIdInstr);
};
+#define NATIVE_FIELDS_LIST(V) \
+ V(Array, length, Smi, IMMUTABLE) \
+ V(GrowableObjectArray, length, Smi, MUTABLE) \
+ V(TypedData, length, Smi, IMMUTABLE) \
+ V(String, length, Smi, IMMUTABLE) \
+ V(LinkedHashMap, index, TypedDataUint32Array, MUTABLE) \
+ V(LinkedHashMap, data, Array, MUTABLE) \
+ V(LinkedHashMap, hash_mask, Smi, MUTABLE) \
+ V(LinkedHashMap, used_data, Smi, MUTABLE) \
+ V(LinkedHashMap, deleted_keys, Smi, MUTABLE) \
+ V(ArgumentsDescriptor, type_args_len, Smi, IMMUTABLE)
+
+class NativeFieldDesc : public ZoneAllocated {
+ public:
+ // clang-format off
+ enum Kind {
+#define DECLARE_KIND(ClassName, FieldName, cid, mutability) \
+ k##ClassName##_##FieldName,
+ NATIVE_FIELDS_LIST(DECLARE_KIND)
+#undef DECLARE_KIND
+ kTypeArguments,
+ };
+ // clang-format on
+
+#define DEFINE_GETTER(ClassName, FieldName, cid, mutability) \
+ static const NativeFieldDesc* ClassName##_##FieldName() { \
+ return Get(k##ClassName##_##FieldName); \
+ }
+
+ NATIVE_FIELDS_LIST(DEFINE_GETTER)
+#undef DEFINE_GETTER
+
+ static const NativeFieldDesc* Get(Kind kind);
+ static const NativeFieldDesc* GetLengthFieldForArrayCid(intptr_t array_cid);
+ static const NativeFieldDesc* GetTypeArgumentsFieldFor(Zone* zone,
+ const Class& cls);
+
+ const char* name() const;
+
+ Kind kind() const { return kind_; }
+
+ intptr_t offset_in_bytes() const { return offset_in_bytes_; }
+
+ bool is_immutable() const { return immutable_; }
+
+ intptr_t cid() const { return cid_; }
+
+ RawAbstractType* type() const;
+
+ private:
+ NativeFieldDesc(Kind kind,
+ intptr_t offset_in_bytes,
+ intptr_t cid,
+ bool immutable)
+ : kind_(kind),
+ offset_in_bytes_(offset_in_bytes),
+ immutable_(immutable),
+ cid_(cid) {}
+
+ NativeFieldDesc(const NativeFieldDesc& other)
+ : NativeFieldDesc(other.kind_,
+ other.offset_in_bytes_,
+ other.immutable_,
+ other.cid_) {}
+
+ const Kind kind_;
+ const intptr_t offset_in_bytes_;
+ const bool immutable_;
+
+ const intptr_t cid_;
+};
+
class LoadFieldInstr : public TemplateDefinition<1, NoThrow> {
public:
LoadFieldInstr(Value* instance,
@@ -4905,12 +4987,28 @@
type_(type),
result_cid_(kDynamicCid),
immutable_(false),
- recognized_kind_(MethodRecognizer::kUnknown),
- field_(NULL),
+ native_field_(nullptr),
+ field_(nullptr),
token_pos_(token_pos) {
ASSERT(offset_in_bytes >= 0);
// May be null if field is not an instance.
- ASSERT(type.IsZoneHandle() || type.IsReadOnlyHandle());
+ ASSERT(type_.IsZoneHandle() || type_.IsReadOnlyHandle());
+ SetInputAt(0, instance);
+ }
+
+ LoadFieldInstr(Value* instance,
+ const NativeFieldDesc* native_field,
+ TokenPosition token_pos)
+ : offset_in_bytes_(native_field->offset_in_bytes()),
+ type_(AbstractType::ZoneHandle(native_field->type())),
+ result_cid_(native_field->cid()),
+ immutable_(native_field->is_immutable()),
+ native_field_(native_field),
+ field_(nullptr),
+ token_pos_(token_pos) {
+ ASSERT(offset_in_bytes_ >= 0);
+ // May be null if field is not an instance.
+ ASSERT(type_.IsZoneHandle() || type_.IsReadOnlyHandle());
SetInputAt(0, instance);
}
@@ -4923,7 +5021,7 @@
type_(type),
result_cid_(kDynamicCid),
immutable_(false),
- recognized_kind_(MethodRecognizer::kUnknown),
+ native_field_(nullptr),
field_(field),
token_pos_(token_pos) {
ASSERT(field->IsZoneHandle());
@@ -4931,7 +5029,7 @@
ASSERT(type.IsZoneHandle() || type.IsReadOnlyHandle());
SetInputAt(0, instance);
- if (parsed_function != NULL && field->guarded_cid() != kIllegalCid) {
+ if (parsed_function != nullptr && field->guarded_cid() != kIllegalCid) {
if (!field->is_nullable() || (field->guarded_cid() == kNullCid)) {
set_result_cid(field->guarded_cid());
}
@@ -4956,11 +5054,7 @@
bool IsPotentialUnboxedLoad() const;
- void set_recognized_kind(MethodRecognizer::Kind kind) {
- recognized_kind_ = kind;
- }
-
- MethodRecognizer::Kind recognized_kind() const { return recognized_kind_; }
+ const NativeFieldDesc* native_field() const { return native_field_; }
DECLARE_INSTRUCTION(LoadField)
virtual CompileType ComputeType() const;
@@ -4980,8 +5074,6 @@
virtual Definition* Canonicalize(FlowGraph* flow_graph);
- static MethodRecognizer::Kind RecognizedKindFromArrayCid(intptr_t cid);
-
static bool IsFixedLengthArrayCid(intptr_t cid);
virtual bool AllowsCSE() const { return immutable_; }
@@ -4997,7 +5089,7 @@
intptr_t result_cid_;
bool immutable_;
- MethodRecognizer::Kind recognized_kind_;
+ const NativeFieldDesc* native_field_;
const Field* field_;
const TokenPosition token_pos_;
@@ -6470,6 +6562,10 @@
virtual bool HasUnknownSideEffects() const { return false; }
+ virtual bool UseSharedSlowPathStub(bool is_optimizing) const {
+ return SlowPathSharingSupported(is_optimizing);
+ }
+
PRINT_OPERANDS_TO_SUPPORT
private:
@@ -6993,12 +7089,7 @@
const String& function_name() const { return function_name_; }
bool UseSharedSlowPathStub(bool is_optimizing) const {
-#if defined(TARGET_ARCH_X64)
- return FLAG_enable_slow_path_sharing && FLAG_precompiled_mode &&
- is_optimizing;
-#else
- return false;
-#endif
+ return SlowPathSharingSupported(is_optimizing);
}
DECLARE_INSTRUCTION(CheckNull)
diff --git a/runtime/vm/compiler/backend/il_arm.cc b/runtime/vm/compiler/backend/il_arm.cc
index 8d16db6..694f8f2 100644
--- a/runtime/vm/compiler/backend/il_arm.cc
+++ b/runtime/vm/compiler/backend/il_arm.cc
@@ -2949,16 +2949,39 @@
}
__ Comment("CheckStackOverflowSlowPath");
__ Bind(entry_label());
- compiler->SaveLiveRegisters(instruction()->locs());
+ const bool using_shared_stub =
+ instruction()->locs()->call_on_shared_slow_path();
+ if (!using_shared_stub) {
+ compiler->SaveLiveRegisters(instruction()->locs());
+ }
// pending_deoptimization_env_ is needed to generate a runtime call that
// may throw an exception.
ASSERT(compiler->pending_deoptimization_env_ == NULL);
Environment* env =
compiler->SlowPathEnvironmentFor(instruction(), kNumSlowPathArgs);
compiler->pending_deoptimization_env_ = env;
- compiler->GenerateRuntimeCall(
- instruction()->token_pos(), instruction()->deopt_id(),
- kStackOverflowRuntimeEntry, kNumSlowPathArgs, instruction()->locs());
+
+ if (using_shared_stub) {
+ uword entry_point_offset =
+ instruction()->locs()->live_registers()->FpuRegisterCount() > 0
+ ? Thread::stack_overflow_shared_with_fpu_regs_entry_point_offset()
+ : Thread::
+ stack_overflow_shared_without_fpu_regs_entry_point_offset();
+ ASSERT(instruction()->locs()->temp(1).IsRegister() &&
+ instruction()->locs()->temp(1).reg() == LR);
+ __ ldr(LR, Address(THR, entry_point_offset));
+ __ blx(LR);
+ compiler->RecordSafepoint(instruction()->locs(), kNumSlowPathArgs);
+ compiler->EmitCatchEntryState();
+ compiler->AddDescriptor(
+ RawPcDescriptors::kOther, compiler->assembler()->CodeSize(),
+ instruction()->deopt_id(), instruction()->token_pos(),
+ compiler->CurrentTryIndex());
+ } else {
+ compiler->GenerateRuntimeCall(
+ instruction()->token_pos(), instruction()->deopt_id(),
+ kStackOverflowRuntimeEntry, kNumSlowPathArgs, instruction()->locs());
+ }
if (compiler->isolate()->use_osr() && !compiler->is_optimizing() &&
instruction()->in_loop()) {
@@ -2968,7 +2991,9 @@
TokenPosition::kNoSource);
}
compiler->pending_deoptimization_env_ = NULL;
- compiler->RestoreLiveRegisters(instruction()->locs());
+ if (!using_shared_stub) {
+ compiler->RestoreLiveRegisters(instruction()->locs());
+ }
__ b(exit_label());
}
diff --git a/runtime/vm/compiler/backend/il_arm64.cc b/runtime/vm/compiler/backend/il_arm64.cc
index c6c8498..6049bb7 100644
--- a/runtime/vm/compiler/backend/il_arm64.cc
+++ b/runtime/vm/compiler/backend/il_arm64.cc
@@ -1019,6 +1019,9 @@
case kTypedDataInt32ArrayCid:
case kTypedDataUint32ArrayCid:
return CompileType::FromCid(kSmiCid);
+ case kTypedDataInt64ArrayCid:
+ case kTypedDataUint64ArrayCid:
+ return CompileType::Int();
default:
UNIMPLEMENTED();
@@ -2711,16 +2714,39 @@
}
__ Comment("CheckStackOverflowSlowPath");
__ Bind(entry_label());
- compiler->SaveLiveRegisters(instruction()->locs());
+ const bool using_shared_stub =
+ instruction()->locs()->call_on_shared_slow_path();
+ if (!using_shared_stub) {
+ compiler->SaveLiveRegisters(instruction()->locs());
+ }
// pending_deoptimization_env_ is needed to generate a runtime call that
// may throw an exception.
ASSERT(compiler->pending_deoptimization_env_ == NULL);
Environment* env =
compiler->SlowPathEnvironmentFor(instruction(), kNumSlowPathArgs);
compiler->pending_deoptimization_env_ = env;
- compiler->GenerateRuntimeCall(
- instruction()->token_pos(), instruction()->deopt_id(),
- kStackOverflowRuntimeEntry, kNumSlowPathArgs, instruction()->locs());
+
+ if (using_shared_stub) {
+ uword entry_point_offset =
+ instruction()->locs()->live_registers()->FpuRegisterCount() > 0
+ ? Thread::stack_overflow_shared_with_fpu_regs_entry_point_offset()
+ : Thread::
+ stack_overflow_shared_without_fpu_regs_entry_point_offset();
+ ASSERT(instruction()->locs()->temp(1).IsRegister() &&
+ instruction()->locs()->temp(1).reg() == LR);
+ __ ldr(LR, Address(THR, entry_point_offset));
+ __ blr(LR);
+ compiler->RecordSafepoint(instruction()->locs(), kNumSlowPathArgs);
+ compiler->EmitCatchEntryState();
+ compiler->AddDescriptor(
+ RawPcDescriptors::kOther, compiler->assembler()->CodeSize(),
+ instruction()->deopt_id(), instruction()->token_pos(),
+ compiler->CurrentTryIndex());
+ } else {
+ compiler->GenerateRuntimeCall(
+ instruction()->token_pos(), instruction()->deopt_id(),
+ kStackOverflowRuntimeEntry, kNumSlowPathArgs, instruction()->locs());
+ }
if (compiler->isolate()->use_osr() && !compiler->is_optimizing() &&
instruction()->in_loop()) {
@@ -2730,7 +2756,9 @@
TokenPosition::kNoSource);
}
compiler->pending_deoptimization_env_ = NULL;
- compiler->RestoreLiveRegisters(instruction()->locs());
+ if (!using_shared_stub) {
+ compiler->RestoreLiveRegisters(instruction()->locs());
+ }
__ b(exit_label());
}
diff --git a/runtime/vm/compiler/backend/il_printer.cc b/runtime/vm/compiler/backend/il_printer.cc
index 44e1b37..2493b68 100644
--- a/runtime/vm/compiler/backend/il_printer.cc
+++ b/runtime/vm/compiler/backend/il_printer.cc
@@ -649,7 +649,7 @@
instance()->PrintTo(f);
f->Print(", %" Pd, offset_in_bytes());
- if (field() != NULL) {
+ if (field() != nullptr) {
f->Print(" {%s}", String::Handle(field()->name()).ToCString());
const char* expected = "?";
if (field()->guarded_cid() != kIllegalCid) {
@@ -662,7 +662,13 @@
expected);
}
- f->Print(", immutable=%d", immutable_);
+ if (native_field() != nullptr) {
+ f->Print(" {%s}", native_field()->name());
+ }
+
+ if (immutable_) {
+ f->Print(", immutable");
+ }
}
void InstantiateTypeInstr::PrintOperandsTo(BufferFormatter* f) const {
diff --git a/runtime/vm/compiler/backend/il_x64.cc b/runtime/vm/compiler/backend/il_x64.cc
index c520bfc..5c5658f 100644
--- a/runtime/vm/compiler/backend/il_x64.cc
+++ b/runtime/vm/compiler/backend/il_x64.cc
@@ -2608,8 +2608,11 @@
bool opt) const {
const intptr_t kNumInputs = 0;
const intptr_t kNumTemps = 1;
- LocationSummary* summary = new (zone) LocationSummary(
- zone, kNumInputs, kNumTemps, LocationSummary::kCallOnSlowPath);
+ const bool using_shared_stub = UseSharedSlowPathStub(opt);
+ LocationSummary* summary = new (zone)
+ LocationSummary(zone, kNumInputs, kNumTemps,
+ using_shared_stub ? LocationSummary::kCallOnSharedSlowPath
+ : LocationSummary::kCallOnSlowPath);
summary->set_temp(0, Location::RequiresRegister());
return summary;
}
@@ -2631,16 +2634,36 @@
}
__ Comment("CheckStackOverflowSlowPath");
__ Bind(entry_label());
- compiler->SaveLiveRegisters(instruction()->locs());
+ const bool using_shared_stub =
+ instruction()->locs()->call_on_shared_slow_path();
+ if (!using_shared_stub) {
+ compiler->SaveLiveRegisters(instruction()->locs());
+ }
// pending_deoptimization_env_ is needed to generate a runtime call that
// may throw an exception.
ASSERT(compiler->pending_deoptimization_env_ == NULL);
Environment* env =
compiler->SlowPathEnvironmentFor(instruction(), kNumSlowPathArgs);
compiler->pending_deoptimization_env_ = env;
- compiler->GenerateRuntimeCall(
- instruction()->token_pos(), instruction()->deopt_id(),
- kStackOverflowRuntimeEntry, kNumSlowPathArgs, instruction()->locs());
+
+ if (using_shared_stub) {
+ uword entry_point_offset =
+ instruction()->locs()->live_registers()->FpuRegisterCount() > 0
+ ? Thread::stack_overflow_shared_with_fpu_regs_entry_point_offset()
+ : Thread::
+ stack_overflow_shared_without_fpu_regs_entry_point_offset();
+ __ call(Address(THR, entry_point_offset));
+ compiler->RecordSafepoint(instruction()->locs(), kNumSlowPathArgs);
+ compiler->EmitCatchEntryState();
+ compiler->AddDescriptor(
+ RawPcDescriptors::kOther, compiler->assembler()->CodeSize(),
+ instruction()->deopt_id(), instruction()->token_pos(),
+ compiler->CurrentTryIndex());
+ } else {
+ compiler->GenerateRuntimeCall(
+ instruction()->token_pos(), instruction()->deopt_id(),
+ kStackOverflowRuntimeEntry, kNumSlowPathArgs, instruction()->locs());
+ }
if (compiler->isolate()->use_osr() && !compiler->is_optimizing() &&
instruction()->in_loop()) {
@@ -2650,7 +2673,9 @@
TokenPosition::kNoSource);
}
compiler->pending_deoptimization_env_ = NULL;
- compiler->RestoreLiveRegisters(instruction()->locs());
+ if (!using_shared_stub) {
+ compiler->RestoreLiveRegisters(instruction()->locs());
+ }
__ jmp(exit_label());
}
diff --git a/runtime/vm/compiler/backend/inliner.cc b/runtime/vm/compiler/backend/inliner.cc
index 4ef1a33..5acad65 100644
--- a/runtime/vm/compiler/backend/inliner.cc
+++ b/runtime/vm/compiler/backend/inliner.cc
@@ -116,6 +116,11 @@
} \
} while (false)
+// Is compilation and isolate in strong mode?
+static bool CanUseStrongModeTypes(FlowGraph* flow_graph) {
+ return FLAG_use_strong_mode_types && flow_graph->isolate()->strong();
+}
+
// Test if a call is recursive by looking in the deoptimization environment.
static bool IsCallRecursive(const Function& function, Definition* call) {
Environment* env = call->env();
@@ -2253,11 +2258,8 @@
}
static bool ShouldInlineInt64ArrayOps() {
-#if defined(TARGET_ARCH_X64)
- return true;
-#else
- return false;
-#endif
+ // TODO(ajcbik): look into doing this even for 32-bit targets.
+ return (kBitsPerWord == 64) && FlowGraphCompiler::SupportsUnboxedInt64();
}
static bool CanUnboxInt32() {
@@ -2279,13 +2281,8 @@
bool can_speculate) {
// Insert array length load and bounds check.
LoadFieldInstr* length = new (Z) LoadFieldInstr(
- new (Z) Value(*array), CheckArrayBoundInstr::LengthOffsetFor(array_cid),
- Type::ZoneHandle(Z, Type::SmiType()), call->token_pos());
- length->set_is_immutable(
- CheckArrayBoundInstr::IsFixedLengthArrayType(array_cid));
- length->set_result_cid(kSmiCid);
- length->set_recognized_kind(
- LoadFieldInstr::RecognizedKindFromArrayCid(array_cid));
+ new (Z) Value(*array),
+ NativeFieldDesc::GetLengthFieldForArrayCid(array_cid), call->token_pos());
*cursor = flow_graph->AppendTo(*cursor, length, NULL, FlowGraph::kValue);
Instruction* bounds_check = NULL;
@@ -2397,15 +2394,12 @@
case kArrayCid:
case kGrowableObjectArrayCid: {
const Class& instantiator_class = Class::Handle(Z, target.Owner());
- intptr_t type_arguments_field_offset =
- instantiator_class.type_arguments_field_offset();
- LoadFieldInstr* load_type_args = new (Z)
- LoadFieldInstr(new (Z) Value(array), type_arguments_field_offset,
- Type::ZoneHandle(Z), // No type.
- call->token_pos());
+ LoadFieldInstr* load_type_args = new (Z) LoadFieldInstr(
+ new (Z) Value(array),
+ NativeFieldDesc::GetTypeArgumentsFieldFor(Z, instantiator_class),
+ call->token_pos());
cursor = flow_graph->AppendTo(cursor, load_type_args, NULL,
FlowGraph::kValue);
-
type_args = load_type_args;
break;
}
@@ -2419,6 +2413,7 @@
case kTypedDataInt32ArrayCid:
case kTypedDataUint32ArrayCid:
case kTypedDataInt64ArrayCid:
+ case kTypedDataUint64ArrayCid:
ASSERT(value_type.IsIntType());
// Fall through.
case kTypedDataFloat32ArrayCid:
@@ -2614,12 +2609,8 @@
ASSERT(array_cid != kDynamicCid);
LoadFieldInstr* length = new (Z) LoadFieldInstr(
- new (Z) Value(array), CheckArrayBoundInstr::LengthOffsetFor(array_cid),
- Type::ZoneHandle(Z, Type::SmiType()), call->token_pos());
- length->set_is_immutable(true);
- length->set_result_cid(kSmiCid);
- length->set_recognized_kind(
- LoadFieldInstr::RecognizedKindFromArrayCid(array_cid));
+ new (Z) Value(array),
+ NativeFieldDesc::GetLengthFieldForArrayCid(array_cid), call->token_pos());
*cursor = flow_graph->AppendTo(*cursor, length, NULL, FlowGraph::kValue);
intptr_t element_size = Instance::ElementSizeFor(array_cid);
@@ -2744,7 +2735,7 @@
// For Dart2, both issues are resolved in the inlined code.
if (array_cid == kDynamicCid) {
ASSERT(call->IsStaticCall());
- if (!FLAG_strong) {
+ if (!CanUseStrongModeTypes(flow_graph)) {
return false;
}
}
@@ -2760,7 +2751,7 @@
// All getters that go through InlineByteArrayBaseLoad() have explicit
// bounds checks in all their clients in the library, so we can omit yet
// another inlined bounds check when compiling for Dart2 (resolves (A)).
- const bool needs_bounds_check = !FLAG_strong;
+ const bool needs_bounds_check = !CanUseStrongModeTypes(flow_graph);
if (needs_bounds_check) {
PrepareInlineTypedArrayBoundsCheck(flow_graph, call, array_cid, view_cid,
array, index, &cursor);
@@ -2841,7 +2832,7 @@
// For Dart2, both issues are resolved in the inlined code.
if (array_cid == kDynamicCid) {
ASSERT(call->IsStaticCall());
- if (!FLAG_strong) {
+ if (!CanUseStrongModeTypes(flow_graph)) {
return false;
}
}
@@ -2857,13 +2848,15 @@
// All setters that go through InlineByteArrayBaseLoad() have explicit
// bounds checks in all their clients in the library, so we can omit yet
// another inlined bounds check when compiling for Dart2 (resolves (A)).
- const bool needs_bounds_check = !FLAG_strong;
+ const bool needs_bounds_check = !CanUseStrongModeTypes(flow_graph);
if (needs_bounds_check) {
PrepareInlineTypedArrayBoundsCheck(flow_graph, call, array_cid, view_cid,
array, index, &cursor);
}
+ // Prepare additional checks.
Cids* value_check = nullptr;
+ bool needs_null_check = false;
switch (view_cid) {
case kTypedDataInt8ArrayCid:
case kTypedDataUint8ArrayCid:
@@ -2885,8 +2878,13 @@
break;
case kTypedDataFloat32ArrayCid:
case kTypedDataFloat64ArrayCid: {
- // Check that value is always double.
- value_check = Cids::CreateMonomorphic(Z, kDoubleCid);
+ // Check that value is always double. In AOT Dart2, we use
+ // an explicit null check and non-speculative unboxing.
+ if (FLAG_precompiled_mode && CanUseStrongModeTypes(flow_graph)) {
+ needs_null_check = true;
+ } else {
+ value_check = Cids::CreateMonomorphic(Z, kDoubleCid);
+ }
break;
}
case kTypedDataInt32x4ArrayCid: {
@@ -2900,8 +2898,12 @@
break;
}
case kTypedDataInt64ArrayCid:
- // StoreIndexedInstr takes unboxed int64, so value
- // is checked when unboxing.
+ case kTypedDataUint64ArrayCid:
+ // StoreIndexedInstr takes unboxed int64, so value is
+ // checked when unboxing. In AOT Dart2, we use an
+ // explicit null check and non-speculative unboxing.
+ needs_null_check =
+ FLAG_precompiled_mode && CanUseStrongModeTypes(flow_graph);
break;
default:
// Array cids are already checked in the caller.
@@ -2909,6 +2911,8 @@
}
Definition* stored_value = call->ArgumentAt(2);
+
+ // Handle value check.
if (value_check != nullptr) {
Instruction* check = flow_graph->CreateCheckClass(
stored_value, *value_check, call->deopt_id(), call->token_pos());
@@ -2916,6 +2920,36 @@
flow_graph->AppendTo(cursor, check, call->env(), FlowGraph::kEffect);
}
+ // Handle null check.
+ if (needs_null_check) {
+ String& name = String::ZoneHandle(Z, target.name());
+ Instruction* check = new (Z) CheckNullInstr(
+ new (Z) Value(stored_value), name, call->deopt_id(), call->token_pos());
+ cursor =
+ flow_graph->AppendTo(cursor, check, call->env(), FlowGraph::kEffect);
+ // With an explicit null check, a non-speculative unbox suffices.
+ ASSERT(FLAG_strong);
+ switch (view_cid) {
+ case kTypedDataFloat32ArrayCid:
+ case kTypedDataFloat64ArrayCid:
+ stored_value =
+ UnboxInstr::Create(kUnboxedDouble, new (Z) Value(stored_value),
+ call->deopt_id(), Instruction::kNotSpeculative);
+ cursor = flow_graph->AppendTo(cursor, stored_value, call->env(),
+ FlowGraph::kValue);
+ break;
+ case kTypedDataInt64ArrayCid:
+ case kTypedDataUint64ArrayCid:
+ stored_value = new (Z)
+ UnboxInt64Instr(new (Z) Value(stored_value), call->deopt_id(),
+ Instruction::kNotSpeculative);
+ cursor = flow_graph->AppendTo(cursor, stored_value, call->env(),
+ FlowGraph::kValue);
+ break;
+ }
+ }
+
+ // Handle conversions and special unboxing.
if (view_cid == kTypedDataFloat32ArrayCid) {
stored_value = new (Z)
DoubleToFloatInstr(new (Z) Value(stored_value), call->deopt_id());
@@ -2982,14 +3016,11 @@
Definition* str,
Definition* index,
Instruction* cursor) {
- LoadFieldInstr* length = new (Z)
- LoadFieldInstr(new (Z) Value(str), String::length_offset(),
- Type::ZoneHandle(Z, Type::SmiType()), str->token_pos());
- length->set_result_cid(kSmiCid);
- length->set_is_immutable(true);
- length->set_recognized_kind(MethodRecognizer::kStringBaseLength);
-
+ LoadFieldInstr* length = new (Z) LoadFieldInstr(
+ new (Z) Value(str), NativeFieldDesc::GetLengthFieldForArrayCid(cid),
+ str->token_pos());
cursor = flow_graph->AppendTo(cursor, length, NULL, FlowGraph::kValue);
+
// Bounds check.
cursor = flow_graph->AppendTo(
cursor,
@@ -3330,6 +3361,7 @@
const bool can_speculate = policy->IsAllowedForInlining(call->deopt_id());
const MethodRecognizer::Kind kind = MethodRecognizer::RecognizeKind(target);
+
switch (kind) {
// Recognized [] operators.
case MethodRecognizer::kImmutableArrayGetIndexed:
@@ -3366,13 +3398,12 @@
return InlineGetIndexed(flow_graph, kind, call, receiver, entry, last,
can_speculate);
case MethodRecognizer::kInt64ArrayGetIndexed:
+ case MethodRecognizer::kUint64ArrayGetIndexed:
if (!ShouldInlineInt64ArrayOps()) {
return false;
}
return InlineGetIndexed(flow_graph, kind, call, receiver, entry, last,
can_speculate);
- case MethodRecognizer::kUint64ArrayGetIndexed:
- break; // TODO(ajcbik): do this too?
default:
break;
}
@@ -3414,13 +3445,12 @@
token_pos, /* value_check = */ NULL, entry, last);
}
case MethodRecognizer::kInt64ArraySetIndexed:
+ case MethodRecognizer::kUint64ArraySetIndexed:
if (!ShouldInlineInt64ArrayOps()) {
return false;
}
return InlineSetIndexed(flow_graph, kind, target, call, receiver,
token_pos, /* value_check = */ NULL, entry, last);
- case MethodRecognizer::kUint64ArraySetIndexed:
- return false; // TODO(ajcbik): do this too?
case MethodRecognizer::kFloat32ArraySetIndexed:
case MethodRecognizer::kFloat64ArraySetIndexed: {
if (!CanUnboxDouble()) {
@@ -3470,6 +3500,18 @@
}
return InlineByteArrayBaseLoad(flow_graph, call, receiver, receiver_cid,
kTypedDataUint32ArrayCid, entry, last);
+ case MethodRecognizer::kByteArrayBaseGetInt64:
+ if (!ShouldInlineInt64ArrayOps()) {
+ return false;
+ }
+ return InlineByteArrayBaseLoad(flow_graph, call, receiver, receiver_cid,
+ kTypedDataInt64ArrayCid, entry, last);
+ case MethodRecognizer::kByteArrayBaseGetUint64:
+ if (!ShouldInlineInt64ArrayOps()) {
+ return false;
+ }
+ return InlineByteArrayBaseLoad(flow_graph, call, receiver, receiver_cid,
+ kTypedDataUint64ArrayCid, entry, last);
case MethodRecognizer::kByteArrayBaseGetFloat32:
if (!CanUnboxDouble()) {
return false;
@@ -3525,6 +3567,13 @@
return InlineByteArrayBaseStore(flow_graph, target, call, receiver,
receiver_cid, kTypedDataInt64ArrayCid,
entry, last);
+ case MethodRecognizer::kByteArrayBaseSetUint64:
+ if (!ShouldInlineInt64ArrayOps()) {
+ return false;
+ }
+ return InlineByteArrayBaseStore(flow_graph, target, call, receiver,
+ receiver_cid, kTypedDataUint64ArrayCid,
+ entry, last);
case MethodRecognizer::kByteArrayBaseSetFloat32:
if (!CanUnboxDouble()) {
return false;
diff --git a/runtime/vm/compiler/backend/locations.cc b/runtime/vm/compiler/backend/locations.cc
index f1435e5..76fb649 100644
--- a/runtime/vm/compiler/backend/locations.cc
+++ b/runtime/vm/compiler/backend/locations.cc
@@ -28,7 +28,11 @@
intptr_t temp_count,
LocationSummary::ContainsCall contains_call)
: num_inputs_(input_count),
+#if defined(TARGET_ARCH_ARM)
+ num_temps_(temp_count + (contains_call == kCallOnSharedSlowPath ? 1 : 0)),
+#else
num_temps_(temp_count),
+#endif
stack_bitmap_(NULL),
contains_call_(contains_call),
live_registers_() {
@@ -37,6 +41,14 @@
#endif
input_locations_ = zone->Alloc<Location>(num_inputs_);
temp_locations_ = zone->Alloc<Location>(num_temps_);
+
+#if defined(TARGET_ARCH_ARM)
+ if (contains_call == kCallOnSharedSlowPath) {
+ // TODO(sjindel): Mitigate the negative effect on the fast-path of blocking
+ // LR.
+ set_temp(temp_count, Location::RegisterLocation(LR));
+ }
+#endif
}
LocationSummary* LocationSummary::Make(
diff --git a/runtime/vm/compiler/backend/locations.h b/runtime/vm/compiler/backend/locations.h
index 2d66b54..0c12d62 100644
--- a/runtime/vm/compiler/backend/locations.h
+++ b/runtime/vm/compiler/backend/locations.h
@@ -516,15 +516,17 @@
ASSERT(kNumberOfFpuRegisters <= (kWordSize * kBitsPerByte));
}
- void AddAllNonReservedRegisters() {
- for (intptr_t i = kNumberOfFpuRegisters - 1; i >= 0; --i) {
- Add(Location::FpuRegisterLocation(static_cast<FpuRegister>(i)));
- }
-
+ void AddAllNonReservedRegisters(bool include_fpu_registers) {
for (intptr_t i = kNumberOfCpuRegisters - 1; i >= 0; --i) {
if (kReservedCpuRegisters & (1 << i)) continue;
Add(Location::RegisterLocation(static_cast<Register>(i)));
}
+
+ if (include_fpu_registers) {
+ for (intptr_t i = kNumberOfFpuRegisters - 1; i >= 0; --i) {
+ Add(Location::FpuRegisterLocation(static_cast<FpuRegister>(i)));
+ }
+ }
}
void Add(Location loc, Representation rep = kTagged) {
diff --git a/runtime/vm/compiler/backend/range_analysis.cc b/runtime/vm/compiler/backend/range_analysis.cc
index fd08f03..95e5a72 100644
--- a/runtime/vm/compiler/backend/range_analysis.cc
+++ b/runtime/vm/compiler/backend/range_analysis.cc
@@ -2683,25 +2683,43 @@
}
void LoadFieldInstr::InferRange(RangeAnalysis* analysis, Range* range) {
- switch (recognized_kind()) {
- case MethodRecognizer::kObjectArrayLength:
- case MethodRecognizer::kImmutableArrayLength:
- *range = Range(RangeBoundary::FromConstant(0),
- RangeBoundary::FromConstant(Array::kMaxElements));
- break;
+ if (native_field() != nullptr) {
+ switch (native_field()->kind()) {
+ case NativeFieldDesc::kArray_length:
+ case NativeFieldDesc::kGrowableObjectArray_length:
+ *range = Range(RangeBoundary::FromConstant(0),
+ RangeBoundary::FromConstant(Array::kMaxElements));
+ break;
- case MethodRecognizer::kTypedDataLength:
- *range = Range(RangeBoundary::FromConstant(0), RangeBoundary::MaxSmi());
- break;
+ case NativeFieldDesc::kTypedData_length:
+ *range = Range(RangeBoundary::FromConstant(0), RangeBoundary::MaxSmi());
+ break;
- case MethodRecognizer::kStringBaseLength:
- *range = Range(RangeBoundary::FromConstant(0),
- RangeBoundary::FromConstant(String::kMaxElements));
- break;
+ case NativeFieldDesc::kString_length:
+ *range = Range(RangeBoundary::FromConstant(0),
+ RangeBoundary::FromConstant(String::kMaxElements));
+ break;
- default:
- Definition::InferRange(analysis, range);
+ case NativeFieldDesc::kLinkedHashMap_index:
+ case NativeFieldDesc::kLinkedHashMap_data:
+ case NativeFieldDesc::kTypeArguments:
+ // Not an integer valued field.
+ UNREACHABLE();
+ break;
+
+ case NativeFieldDesc::kLinkedHashMap_hash_mask:
+ case NativeFieldDesc::kLinkedHashMap_used_data:
+ case NativeFieldDesc::kLinkedHashMap_deleted_keys:
+ *range = Range(RangeBoundary::FromConstant(0), RangeBoundary::MaxSmi());
+ break;
+
+ case NativeFieldDesc::kArgumentsDescriptor_type_args_len:
+ *range = Range(RangeBoundary::FromConstant(0), RangeBoundary::MaxSmi());
+ break;
+ }
+ return;
}
+ Definition::InferRange(analysis, range);
}
void LoadIndexedInstr::InferRange(RangeAnalysis* analysis, Range* range) {
diff --git a/runtime/vm/compiler/call_specializer.h b/runtime/vm/compiler/call_specializer.h
index 04bf617..12fd3e7 100644
--- a/runtime/vm/compiler/call_specializer.h
+++ b/runtime/vm/compiler/call_specializer.h
@@ -88,7 +88,8 @@
// Add a class check for the call's first argument (receiver).
void AddReceiverCheck(InstanceCallInstr* call) {
- AddChecksForArgNr(call, call->ArgumentAt(0), /* argument_number = */ 0);
+ AddChecksForArgNr(call, call->Receiver()->definition(),
+ /* argument_number = */ 0);
}
// Insert a null check if needed.
diff --git a/runtime/vm/compiler/compiler_sources.gni b/runtime/vm/compiler/compiler_sources.gni
index 376f43b..09118db 100644
--- a/runtime/vm/compiler/compiler_sources.gni
+++ b/runtime/vm/compiler/compiler_sources.gni
@@ -81,6 +81,8 @@
"frontend/kernel_binary_flowgraph.h",
"frontend/kernel_to_il.cc",
"frontend/kernel_to_il.h",
+ "frontend/kernel_translation_helper.cc",
+ "frontend/kernel_translation_helper.h",
"frontend/prologue_builder.cc",
"frontend/prologue_builder.h",
"intrinsifier.cc",
diff --git a/runtime/vm/compiler/frontend/flow_graph_builder.cc b/runtime/vm/compiler/frontend/flow_graph_builder.cc
index 6ab263e..4d93fdf 100644
--- a/runtime/vm/compiler/frontend/flow_graph_builder.cc
+++ b/runtime/vm/compiler/frontend/flow_graph_builder.cc
@@ -3126,18 +3126,22 @@
BuildStaticSetter(node, true); // Result needed.
}
-static intptr_t OffsetForLengthGetter(MethodRecognizer::Kind kind) {
+static const NativeFieldDesc* NativeFieldForLengthGetter(
+ MethodRecognizer::Kind kind) {
switch (kind) {
case MethodRecognizer::kObjectArrayLength:
case MethodRecognizer::kImmutableArrayLength:
- return Array::length_offset();
+ return NativeFieldDesc::Array_length();
+
case MethodRecognizer::kTypedDataLength:
// .length is defined in _TypedList which is the base class for internal
// and external typed data.
ASSERT(TypedData::length_offset() == ExternalTypedData::length_offset());
- return TypedData::length_offset();
+ return NativeFieldDesc::TypedData_length();
+
case MethodRecognizer::kGrowableArrayLength:
- return GrowableObjectArray::length_offset();
+ return NativeFieldDesc::GrowableObjectArray_length();
+
default:
UNREACHABLE();
return 0;
@@ -3153,15 +3157,10 @@
LoadFieldInstr* EffectGraphVisitor::BuildNativeGetter(
NativeBodyNode* node,
- MethodRecognizer::Kind kind,
- intptr_t offset,
- const Type& type,
- intptr_t class_id) {
+ const NativeFieldDesc* native_field) {
Value* receiver = Bind(BuildLoadThisVar(node->scope(), node->token_pos()));
LoadFieldInstr* load =
- new (Z) LoadFieldInstr(receiver, offset, type, node->token_pos());
- load->set_result_cid(class_id);
- load->set_recognized_kind(kind);
+ new (Z) LoadFieldInstr(receiver, native_field, node->token_pos());
return load;
}
@@ -3200,10 +3199,8 @@
}
case MethodRecognizer::kStringBaseLength:
case MethodRecognizer::kStringBaseIsEmpty: {
- LoadFieldInstr* load = BuildNativeGetter(
- node, MethodRecognizer::kStringBaseLength, String::length_offset(),
- Type::ZoneHandle(Z, Type::SmiType()), kSmiCid);
- load->set_is_immutable(true);
+ LoadFieldInstr* load =
+ BuildNativeGetter(node, NativeFieldDesc::String_length());
if (kind == MethodRecognizer::kStringBaseLength) {
return ReturnDefinition(load);
}
@@ -3221,9 +3218,7 @@
case MethodRecognizer::kImmutableArrayLength:
case MethodRecognizer::kTypedDataLength: {
LoadFieldInstr* load =
- BuildNativeGetter(node, kind, OffsetForLengthGetter(kind),
- Type::ZoneHandle(Z, Type::SmiType()), kSmiCid);
- load->set_is_immutable(kind != MethodRecognizer::kGrowableArrayLength);
+ BuildNativeGetter(node, NativeFieldForLengthGetter(kind));
return ReturnDefinition(load);
}
case MethodRecognizer::kClassIDgetID: {
@@ -3241,10 +3236,7 @@
data_load->set_result_cid(kArrayCid);
Value* data = Bind(data_load);
LoadFieldInstr* length_load = new (Z) LoadFieldInstr(
- data, Array::length_offset(), Type::ZoneHandle(Z, Type::SmiType()),
- node->token_pos());
- length_load->set_result_cid(kSmiCid);
- length_load->set_recognized_kind(MethodRecognizer::kObjectArrayLength);
+ data, NativeFieldDesc::Array_length(), node->token_pos());
return ReturnDefinition(length_load);
}
case MethodRecognizer::kListFactory: {
@@ -3342,9 +3334,8 @@
return ReturnDefinition(create_array);
}
case MethodRecognizer::kLinkedHashMap_getIndex: {
- return ReturnDefinition(BuildNativeGetter(
- node, kind, LinkedHashMap::index_offset(), Object::dynamic_type(),
- kTypedDataUint32ArrayCid));
+ return ReturnDefinition(
+ BuildNativeGetter(node, NativeFieldDesc::LinkedHashMap_index()));
}
case MethodRecognizer::kLinkedHashMap_setIndex: {
return ReturnDefinition(DoNativeSetterStoreValue(
@@ -3352,17 +3343,15 @@
}
case MethodRecognizer::kLinkedHashMap_getData: {
return ReturnDefinition(
- BuildNativeGetter(node, kind, LinkedHashMap::data_offset(),
- Object::dynamic_type(), kArrayCid));
+ BuildNativeGetter(node, NativeFieldDesc::LinkedHashMap_data()));
}
case MethodRecognizer::kLinkedHashMap_setData: {
return ReturnDefinition(DoNativeSetterStoreValue(
node, LinkedHashMap::data_offset(), kEmitStoreBarrier));
}
case MethodRecognizer::kLinkedHashMap_getHashMask: {
- return ReturnDefinition(
- BuildNativeGetter(node, kind, LinkedHashMap::hash_mask_offset(),
- Type::ZoneHandle(Z, Type::SmiType()), kSmiCid));
+ return ReturnDefinition(BuildNativeGetter(
+ node, NativeFieldDesc::LinkedHashMap_hash_mask()));
}
case MethodRecognizer::kLinkedHashMap_setHashMask: {
// Smi field; no barrier needed.
@@ -3370,9 +3359,8 @@
node, LinkedHashMap::hash_mask_offset(), kNoStoreBarrier));
}
case MethodRecognizer::kLinkedHashMap_getUsedData: {
- return ReturnDefinition(
- BuildNativeGetter(node, kind, LinkedHashMap::used_data_offset(),
- Type::ZoneHandle(Z, Type::SmiType()), kSmiCid));
+ return ReturnDefinition(BuildNativeGetter(
+ node, NativeFieldDesc::LinkedHashMap_used_data()));
}
case MethodRecognizer::kLinkedHashMap_setUsedData: {
// Smi field; no barrier needed.
@@ -3380,9 +3368,9 @@
node, LinkedHashMap::used_data_offset(), kNoStoreBarrier));
}
case MethodRecognizer::kLinkedHashMap_getDeletedKeys: {
- return ReturnDefinition(
- BuildNativeGetter(node, kind, LinkedHashMap::deleted_keys_offset(),
- Type::ZoneHandle(Z, Type::SmiType()), kSmiCid));
+ return ReturnDefinition(BuildNativeGetter(
+ node, NativeFieldDesc::Get(
+ NativeFieldDesc::kLinkedHashMap_deleted_keys)));
}
case MethodRecognizer::kLinkedHashMap_setDeletedKeys: {
// Smi field; no barrier needed.
diff --git a/runtime/vm/compiler/frontend/flow_graph_builder.h b/runtime/vm/compiler/frontend/flow_graph_builder.h
index 057cf56..94dc758 100644
--- a/runtime/vm/compiler/frontend/flow_graph_builder.h
+++ b/runtime/vm/compiler/frontend/flow_graph_builder.h
@@ -302,10 +302,7 @@
TokenPosition token_pos);
LoadLocalInstr* BuildLoadThisVar(LocalScope* scope, TokenPosition token_pos);
LoadFieldInstr* BuildNativeGetter(NativeBodyNode* node,
- MethodRecognizer::Kind kind,
- intptr_t offset,
- const Type& type,
- intptr_t class_id);
+ const NativeFieldDesc* native_field);
// Assumes setter parameter is named 'value'. Returns null constant.
ConstantInstr* DoNativeSetterStoreValue(NativeBodyNode* node,
intptr_t offset,
diff --git a/runtime/vm/compiler/frontend/kernel_binary_flowgraph.cc b/runtime/vm/compiler/frontend/kernel_binary_flowgraph.cc
index 86b3e06..3a8f5cb 100644
--- a/runtime/vm/compiler/frontend/kernel_binary_flowgraph.cc
+++ b/runtime/vm/compiler/frontend/kernel_binary_flowgraph.cc
@@ -63,759 +63,8 @@
return !FLAG_precompiled_mode || !attrs.has_dynamic_invocations;
}
-void FunctionNodeHelper::ReadUntilExcluding(Field field) {
- if (field <= next_read_) return;
-
- // Ordered with fall-through.
- switch (next_read_) {
- case kStart: {
- Tag tag = helper_->ReadTag(); // read tag.
- ASSERT(tag == kFunctionNode);
- if (++next_read_ == field) return;
- }
- /* Falls through */
- case kPosition:
- position_ = helper_->ReadPosition(); // read position.
- if (++next_read_ == field) return;
- /* Falls through */
- case kEndPosition:
- end_position_ = helper_->ReadPosition(); // read end position.
- if (++next_read_ == field) return;
- /* Falls through */
- case kAsyncMarker:
- async_marker_ = static_cast<AsyncMarker>(helper_->ReadByte());
- if (++next_read_ == field) return;
- /* Falls through */
- case kDartAsyncMarker:
- dart_async_marker_ = static_cast<AsyncMarker>(
- helper_->ReadByte()); // read dart async marker.
- if (++next_read_ == field) return;
- /* Falls through */
- case kTypeParameters:
- helper_->SkipTypeParametersList(); // read type parameters.
- if (++next_read_ == field) return;
- /* Falls through */
- case kTotalParameterCount:
- total_parameter_count_ =
- helper_->ReadUInt(); // read total parameter count.
- if (++next_read_ == field) return;
- /* Falls through */
- case kRequiredParameterCount:
- required_parameter_count_ =
- helper_->ReadUInt(); // read required parameter count.
- if (++next_read_ == field) return;
- /* Falls through */
- case kPositionalParameters:
- helper_->SkipListOfVariableDeclarations(); // read positionals.
- if (++next_read_ == field) return;
- /* Falls through */
- case kNamedParameters:
- helper_->SkipListOfVariableDeclarations(); // read named.
- if (++next_read_ == field) return;
- /* Falls through */
- case kReturnType:
- helper_->SkipDartType(); // read return type.
- if (++next_read_ == field) return;
- /* Falls through */
- case kBody:
- if (helper_->ReadTag() == kSomething)
- helper_->SkipStatement(); // read body.
- if (++next_read_ == field) return;
- /* Falls through */
- case kEnd:
- return;
- }
-}
-
-void TypeParameterHelper::ReadUntilExcluding(Field field) {
- for (; next_read_ < field; ++next_read_) {
- switch (next_read_) {
- case kFlags:
- flags_ = helper_->ReadFlags();
- break;
- case kAnnotations:
- helper_->SkipListOfExpressions(); // read annotations.
- break;
- case kName:
- name_index_ = helper_->ReadStringReference(); // read name index.
- break;
- case kBound:
- helper_->SkipDartType();
- break;
- case kDefaultType:
- if (helper_->ReadTag() == kSomething) {
- helper_->SkipDartType();
- }
- break;
- case kEnd:
- return;
- }
- }
-}
-
-void VariableDeclarationHelper::ReadUntilExcluding(Field field) {
- if (field <= next_read_) return;
-
- // Ordered with fall-through.
- switch (next_read_) {
- case kPosition:
- position_ = helper_->ReadPosition(); // read position.
- if (++next_read_ == field) return;
- /* Falls through */
- case kEqualPosition:
- equals_position_ = helper_->ReadPosition(); // read equals position.
- if (++next_read_ == field) return;
- /* Falls through */
- case kAnnotations:
- helper_->SkipListOfExpressions(); // read annotations.
- if (++next_read_ == field) return;
- /* Falls through */
- case kFlags:
- flags_ = helper_->ReadFlags();
- if (++next_read_ == field) return;
- /* Falls through */
- case kNameIndex:
- name_index_ = helper_->ReadStringReference(); // read name index.
- if (++next_read_ == field) return;
- /* Falls through */
- case kType:
- helper_->SkipDartType(); // read type.
- if (++next_read_ == field) return;
- /* Falls through */
- case kInitializer:
- if (helper_->ReadTag() == kSomething)
- helper_->SkipExpression(); // read initializer.
- if (++next_read_ == field) return;
- /* Falls through */
- case kEnd:
- return;
- }
-}
-
-FieldHelper::FieldHelper(KernelReaderHelper* helper, intptr_t offset)
- : helper_(helper),
- next_read_(kStart),
- has_function_literal_initializer_(false) {
- helper_->SetOffset(offset);
-}
-
-void FieldHelper::ReadUntilExcluding(Field field,
- bool detect_function_literal_initializer) {
- if (field <= next_read_) return;
-
- // Ordered with fall-through.
- switch (next_read_) {
- case kStart: {
- Tag tag = helper_->ReadTag(); // read tag.
- ASSERT(tag == kField);
- if (++next_read_ == field) return;
- }
- /* Falls through */
- case kCanonicalName:
- canonical_name_ =
- helper_->ReadCanonicalNameReference(); // read canonical_name.
- if (++next_read_ == field) return;
- /* Falls through */
- case kSourceUriIndex:
- source_uri_index_ = helper_->ReadUInt(); // read source_uri_index.
- helper_->set_current_script_id(source_uri_index_);
- if (++next_read_ == field) return;
- /* Falls through */
- case kPosition:
- position_ = helper_->ReadPosition(false); // read position.
- helper_->RecordTokenPosition(position_);
- if (++next_read_ == field) return;
- /* Falls through */
- case kEndPosition:
- end_position_ = helper_->ReadPosition(false); // read end position.
- helper_->RecordTokenPosition(end_position_);
- if (++next_read_ == field) return;
- /* Falls through */
- case kFlags:
- flags_ = helper_->ReadFlags();
- if (++next_read_ == field) return;
- /* Falls through */
- case kName:
- helper_->SkipName(); // read name.
- if (++next_read_ == field) return;
- /* Falls through */
- case kAnnotations: {
- annotation_count_ = helper_->ReadListLength(); // read list length.
- for (intptr_t i = 0; i < annotation_count_; ++i) {
- helper_->SkipExpression(); // read ith expression.
- }
- if (++next_read_ == field) return;
- }
- /* Falls through */
- case kType:
- helper_->SkipDartType(); // read type.
- if (++next_read_ == field) return;
- /* Falls through */
- case kInitializer:
- if (helper_->ReadTag() == kSomething) {
- if (detect_function_literal_initializer &&
- helper_->PeekTag() == kFunctionExpression) {
- AlternativeReadingScope alt(&helper_->reader_);
- Tag tag = helper_->ReadTag();
- ASSERT(tag == kFunctionExpression);
- helper_->ReadPosition(); // read position.
-
- FunctionNodeHelper helper(helper_);
- helper.ReadUntilIncluding(FunctionNodeHelper::kEndPosition);
-
- has_function_literal_initializer_ = true;
- function_literal_start_ = helper.position_;
- function_literal_end_ = helper.end_position_;
- }
- helper_->SkipExpression(); // read initializer.
- }
- if (++next_read_ == field) return;
- /* Falls through */
- case kEnd:
- return;
- }
-}
-
-void ProcedureHelper::ReadUntilExcluding(Field field) {
- if (field <= next_read_) return;
-
- // Ordered with fall-through.
- switch (next_read_) {
- case kStart: {
- Tag tag = helper_->ReadTag(); // read tag.
- ASSERT(tag == kProcedure);
- if (++next_read_ == field) return;
- }
- /* Falls through */
- case kCanonicalName:
- canonical_name_ =
- helper_->ReadCanonicalNameReference(); // read canonical_name.
- if (++next_read_ == field) return;
- /* Falls through */
- case kSourceUriIndex:
- source_uri_index_ = helper_->ReadUInt(); // read source_uri_index.
- helper_->set_current_script_id(source_uri_index_);
- if (++next_read_ == field) return;
- /* Falls through */
- case kStartPosition:
- start_position_ = helper_->ReadPosition(false); // read position.
- helper_->RecordTokenPosition(start_position_);
- if (++next_read_ == field) return;
- /* Falls through */
- case kPosition:
- position_ = helper_->ReadPosition(false); // read position.
- helper_->RecordTokenPosition(position_);
- if (++next_read_ == field) return;
- /* Falls through */
- case kEndPosition:
- end_position_ = helper_->ReadPosition(false); // read end position.
- helper_->RecordTokenPosition(end_position_);
- if (++next_read_ == field) return;
- /* Falls through */
- case kKind:
- kind_ = static_cast<Kind>(helper_->ReadByte());
- if (++next_read_ == field) return;
- /* Falls through */
- case kFlags:
- flags_ = helper_->ReadFlags();
- if (++next_read_ == field) return;
- /* Falls through */
- case kName:
- helper_->SkipName(); // read name.
- if (++next_read_ == field) return;
- /* Falls through */
- case kAnnotations: {
- annotation_count_ = helper_->ReadListLength(); // read list length.
- for (intptr_t i = 0; i < annotation_count_; ++i) {
- helper_->SkipExpression(); // read ith expression.
- }
- if (++next_read_ == field) return;
- }
- /* Falls through */
- case kForwardingStubSuperTarget:
- if (helper_->ReadTag() == kSomething) {
- forwarding_stub_super_target_ = helper_->ReadCanonicalNameReference();
- }
- if (++next_read_ == field) return;
- /* Falls through */
- case kForwardingStubInterfaceTarget:
- if (helper_->ReadTag() == kSomething) {
- helper_->ReadCanonicalNameReference();
- }
- if (++next_read_ == field) return;
- /* Falls through */
- case kFunction:
- if (helper_->ReadTag() == kSomething)
- helper_->SkipFunctionNode(); // read function node.
- if (++next_read_ == field) return;
- /* Falls through */
- case kEnd:
- return;
- }
-}
-
-void ConstructorHelper::ReadUntilExcluding(Field field) {
- if (field <= next_read_) return;
-
- // Ordered with fall-through.
- switch (next_read_) {
- case kStart: {
- Tag tag = helper_->ReadTag(); // read tag.
- ASSERT(tag == kConstructor);
- if (++next_read_ == field) return;
- }
- /* Falls through */
- case kCanonicalName:
- canonical_name_ =
- helper_->ReadCanonicalNameReference(); // read canonical_name.
- if (++next_read_ == field) return;
- /* Falls through */
- case kSourceUriIndex:
- source_uri_index_ = helper_->ReadUInt(); // read source_uri_index.
- helper_->set_current_script_id(source_uri_index_);
- if (++next_read_ == field) return;
- /* Falls through */
- case kStartPosition:
- start_position_ = helper_->ReadPosition(); // read position.
- helper_->RecordTokenPosition(start_position_);
- if (++next_read_ == field) return;
- /* Falls through */
- case kPosition:
- position_ = helper_->ReadPosition(); // read position.
- helper_->RecordTokenPosition(position_);
- if (++next_read_ == field) return;
- /* Falls through */
- case kEndPosition:
- end_position_ = helper_->ReadPosition(); // read end position.
- helper_->RecordTokenPosition(end_position_);
- if (++next_read_ == field) return;
- /* Falls through */
- case kFlags:
- flags_ = helper_->ReadFlags();
- if (++next_read_ == field) return;
- /* Falls through */
- case kName:
- helper_->SkipName(); // read name.
- if (++next_read_ == field) return;
- /* Falls through */
- case kAnnotations: {
- annotation_count_ = helper_->ReadListLength(); // read list length.
- for (intptr_t i = 0; i < annotation_count_; ++i) {
- helper_->SkipExpression(); // read ith expression.
- }
- if (++next_read_ == field) return;
- }
- /* Falls through */
- case kFunction:
- helper_->SkipFunctionNode(); // read function.
- if (++next_read_ == field) return;
- /* Falls through */
- case kInitializers: {
- intptr_t list_length =
- helper_->ReadListLength(); // read initializers list length.
- for (intptr_t i = 0; i < list_length; i++) {
- helper_->SkipInitializer();
- }
- if (++next_read_ == field) return;
- }
- /* Falls through */
- case kEnd:
- return;
- }
-}
-
-void ClassHelper::ReadUntilExcluding(Field field) {
- if (field <= next_read_) return;
-
- // Ordered with fall-through.
- switch (next_read_) {
- case kStart: {
- Tag tag = helper_->ReadTag(); // read tag.
- ASSERT(tag == kClass);
- if (++next_read_ == field) return;
- }
- /* Falls through */
- case kCanonicalName:
- canonical_name_ =
- helper_->ReadCanonicalNameReference(); // read canonical_name.
- if (++next_read_ == field) return;
- /* Falls through */
- case kSourceUriIndex:
- source_uri_index_ = helper_->ReadUInt(); // read source_uri_index.
- helper_->set_current_script_id(source_uri_index_);
- if (++next_read_ == field) return;
- /* Falls through */
- case kStartPosition:
- start_position_ = helper_->ReadPosition(false); // read position.
- helper_->RecordTokenPosition(start_position_);
- if (++next_read_ == field) return;
- /* Falls through */
- case kPosition:
- position_ = helper_->ReadPosition(false); // read position.
- helper_->RecordTokenPosition(position_);
- if (++next_read_ == field) return;
- /* Falls through */
- case kEndPosition:
- end_position_ = helper_->ReadPosition(); // read end position.
- helper_->RecordTokenPosition(end_position_);
- if (++next_read_ == field) return;
- /* Falls through */
- case kFlags:
- flags_ = helper_->ReadFlags(); // read flags.
- if (++next_read_ == field) return;
- /* Falls through */
- case kNameIndex:
- name_index_ = helper_->ReadStringReference(); // read name index.
- if (++next_read_ == field) return;
- /* Falls through */
- case kAnnotations: {
- annotation_count_ = helper_->ReadListLength(); // read list length.
- for (intptr_t i = 0; i < annotation_count_; ++i) {
- helper_->SkipExpression(); // read ith expression.
- }
- if (++next_read_ == field) return;
- }
- /* Falls through */
- case kTypeParameters:
- helper_->SkipTypeParametersList(); // read type parameters.
- if (++next_read_ == field) return;
- /* Falls through */
- case kSuperClass: {
- Tag type_tag = helper_->ReadTag(); // read super class type (part 1).
- if (type_tag == kSomething) {
- helper_->SkipDartType(); // read super class type (part 2).
- }
- if (++next_read_ == field) return;
- }
- /* Falls through */
- case kMixinType: {
- Tag type_tag = helper_->ReadTag(); // read mixin type (part 1).
- if (type_tag == kSomething) {
- helper_->SkipDartType(); // read mixin type (part 2).
- }
- if (++next_read_ == field) return;
- }
- /* Falls through */
- case kImplementedClasses:
- helper_->SkipListOfDartTypes(); // read implemented_classes.
- if (++next_read_ == field) return;
- /* Falls through */
- case kFields: {
- intptr_t list_length =
- helper_->ReadListLength(); // read fields list length.
- for (intptr_t i = 0; i < list_length; i++) {
- FieldHelper field_helper(helper_);
- field_helper.ReadUntilExcluding(FieldHelper::kEnd); // read field.
- }
- if (++next_read_ == field) return;
- }
- /* Falls through */
- case kConstructors: {
- intptr_t list_length =
- helper_->ReadListLength(); // read constructors list length.
- for (intptr_t i = 0; i < list_length; i++) {
- ConstructorHelper constructor_helper(helper_);
- constructor_helper.ReadUntilExcluding(
- ConstructorHelper::kEnd); // read constructor.
- }
- if (++next_read_ == field) return;
- }
- /* Falls through */
- case kProcedures: {
- procedure_count_ = helper_->ReadListLength(); // read procedures #.
- for (intptr_t i = 0; i < procedure_count_; i++) {
- ProcedureHelper procedure_helper(helper_);
- procedure_helper.ReadUntilExcluding(
- ProcedureHelper::kEnd); // read procedure.
- }
- if (++next_read_ == field) return;
- }
- /* Falls through */
- case kClassIndex:
- // Read class index.
- for (intptr_t i = 0; i < procedure_count_; ++i) {
- helper_->reader_.ReadUInt32();
- }
- helper_->reader_.ReadUInt32();
- helper_->reader_.ReadUInt32();
- if (++next_read_ == field) return;
- /* Falls through */
- case kEnd:
- return;
- }
-}
-
-void LibraryHelper::ReadUntilExcluding(Field field) {
- if (field <= next_read_) return;
-
- // Ordered with fall-through.
- switch (next_read_) {
- case kFlags: {
- flags_ = helper_->ReadFlags();
- if (++next_read_ == field) return;
- }
- /* Falls through */
- case kCanonicalName:
- canonical_name_ =
- helper_->ReadCanonicalNameReference(); // read canonical_name.
- if (++next_read_ == field) return;
- /* Falls through */
- case kName:
- name_index_ = helper_->ReadStringReference(); // read name index.
- if (++next_read_ == field) return;
- /* Falls through */
- case kSourceUriIndex:
- source_uri_index_ = helper_->ReadUInt(); // read source_uri_index.
- helper_->set_current_script_id(source_uri_index_);
- if (++next_read_ == field) return;
- /* Falls through */
- case kAnnotations:
- helper_->SkipListOfExpressions(); // read annotations.
- if (++next_read_ == field) return;
- /* Falls through */
- case kDependencies: {
- intptr_t dependency_count = helper_->ReadUInt(); // read list length.
- for (intptr_t i = 0; i < dependency_count; ++i) {
- helper_->SkipLibraryDependency();
- }
- if (++next_read_ == field) return;
- }
- /* Falls through */
- case kAdditionalExports: {
- intptr_t name_count = helper_->ReadUInt();
- for (intptr_t i = 0; i < name_count; ++i) {
- helper_->SkipCanonicalNameReference();
- }
- if (++next_read_ == field) return;
- }
- /* Falls through */
- case kParts: {
- intptr_t part_count = helper_->ReadUInt(); // read list length.
- for (intptr_t i = 0; i < part_count; ++i) {
- helper_->SkipLibraryPart();
- }
- if (++next_read_ == field) return;
- }
- /* Falls through */
- case kTypedefs: {
- intptr_t typedef_count = helper_->ReadListLength(); // read list length.
- for (intptr_t i = 0; i < typedef_count; i++) {
- helper_->SkipLibraryTypedef();
- }
- if (++next_read_ == field) return;
- }
- /* Falls through */
- case kClasses: {
- class_count_ = helper_->ReadListLength(); // read list length.
- for (intptr_t i = 0; i < class_count_; ++i) {
- ClassHelper class_helper(helper_);
- class_helper.ReadUntilExcluding(ClassHelper::kEnd);
- }
- if (++next_read_ == field) return;
- }
- /* Falls through */
- case kToplevelField: {
- intptr_t field_count = helper_->ReadListLength(); // read list length.
- for (intptr_t i = 0; i < field_count; ++i) {
- FieldHelper field_helper(helper_);
- field_helper.ReadUntilExcluding(FieldHelper::kEnd);
- }
- if (++next_read_ == field) return;
- }
- /* Falls through */
- case kToplevelProcedures: {
- procedure_count_ = helper_->ReadListLength(); // read list length.
- for (intptr_t i = 0; i < procedure_count_; ++i) {
- ProcedureHelper procedure_helper(helper_);
- procedure_helper.ReadUntilExcluding(ProcedureHelper::kEnd);
- }
- if (++next_read_ == field) return;
- }
- /* Falls through */
- case kLibraryIndex:
- // Read library index.
- for (intptr_t i = 0; i < class_count_; ++i) {
- helper_->reader_.ReadUInt32();
- }
- helper_->reader_.ReadUInt32();
- helper_->reader_.ReadUInt32();
- for (intptr_t i = 0; i < procedure_count_; ++i) {
- helper_->reader_.ReadUInt32();
- }
- helper_->reader_.ReadUInt32();
- helper_->reader_.ReadUInt32();
- if (++next_read_ == field) return;
- /* Falls through */
- case kEnd:
- return;
- }
-}
-
-void LibraryDependencyHelper::ReadUntilExcluding(Field field) {
- if (field <= next_read_) return;
-
- // Ordered with fall-through.
- switch (next_read_) {
- case kFileOffset: {
- helper_->ReadPosition();
- if (++next_read_ == field) return;
- }
- /* Falls through */
- case kFlags: {
- flags_ = helper_->ReadFlags();
- if (++next_read_ == field) return;
- }
- /* Falls through */
- case kAnnotations: {
- helper_->SkipListOfExpressions();
- if (++next_read_ == field) return;
- }
- /* Falls through */
- case kTargetLibrary: {
- target_library_canonical_name_ = helper_->ReadCanonicalNameReference();
- if (++next_read_ == field) return;
- }
- /* Falls through */
- case kName: {
- name_index_ = helper_->ReadStringReference();
- if (++next_read_ == field) return;
- }
- /* Falls through */
- case kCombinators: {
- intptr_t count = helper_->ReadListLength();
- for (intptr_t i = 0; i < count; ++i) {
- // Skip flags
- helper_->SkipBytes(1);
- // Skip list of names.
- helper_->SkipListOfStrings();
- }
- if (++next_read_ == field) return;
- }
- /* Falls through */
- case kEnd:
- return;
- }
-}
-
-MetadataHelper::MetadataHelper(StreamingFlowGraphBuilder* builder)
- : builder_(builder),
- translation_helper_(builder->translation_helper_),
- mappings_offset_(0),
- mappings_num_(0),
- last_node_offset_(0),
- last_mapping_index_(0) {}
-
-void MetadataHelper::SetMetadataMappings(intptr_t mappings_offset,
- intptr_t mappings_num) {
- ASSERT((mappings_offset_ == 0) && (mappings_num_ == 0));
- ASSERT((mappings_offset != 0) && (mappings_num != 0));
- mappings_offset_ = mappings_offset;
- mappings_num_ = mappings_num;
-
-#ifdef DEBUG
- // Verify that node offsets are sorted.
- {
- Reader reader(H.metadata_mappings());
- reader.set_offset(mappings_offset);
-
- intptr_t prev_node_offset = 0;
- for (intptr_t i = 0; i < mappings_num; ++i) {
- intptr_t node_offset = reader.ReadUInt32();
- intptr_t md_offset = reader.ReadUInt32();
-
- ASSERT((node_offset > 0) && (md_offset >= 0));
- ASSERT(node_offset > prev_node_offset);
- prev_node_offset = node_offset;
- }
- }
-#endif // DEBUG
-
- last_node_offset_ = kIntptrMax;
- last_mapping_index_ = 0;
-}
-
-intptr_t MetadataHelper::FindMetadataMapping(intptr_t node_offset) {
- const intptr_t kUInt32Size = 4;
- ASSERT(mappings_num_ > 0);
-
- Reader reader(H.metadata_mappings());
-
- intptr_t left = 0;
- intptr_t right = mappings_num_ - 1;
- while (left < right) {
- intptr_t mid = ((right - left) / 2) + left;
- intptr_t mid_node_offset =
- reader.ReadUInt32At(mappings_offset_ + mid * 2 * kUInt32Size);
-
- if (node_offset < mid_node_offset) {
- right = mid - 1;
- } else if (node_offset > mid_node_offset) {
- left = mid + 1;
- } else {
- return mid; // Exact match found.
- }
- }
- ASSERT((0 <= left) && (left <= mappings_num_));
-
- // Approximate match is found. Make sure it has an offset greater or equal
- // to the given node offset.
- if (left < mappings_num_) {
- intptr_t found_node_offset =
- reader.ReadUInt32At(mappings_offset_ + left * 2 * kUInt32Size);
-
- if (found_node_offset < node_offset) {
- ++left;
- }
- }
- ASSERT((left == mappings_num_) ||
- static_cast<intptr_t>(reader.ReadUInt32At(
- mappings_offset_ + left * 2 * kUInt32Size)) >= node_offset);
-
- return left;
-}
-
-intptr_t MetadataHelper::GetNextMetadataPayloadOffset(intptr_t node_offset) {
- builder_->EnsureMetadataIsScanned();
-
- if (mappings_num_ == 0) {
- return -1; // No metadata.
- }
-
- node_offset += builder_->data_program_offset_;
-
- // Nodes are parsed in linear order most of the time, so do the search
- // only if looking back.
- if (node_offset < last_node_offset_) {
- last_mapping_index_ = FindMetadataMapping(node_offset);
- }
-
- intptr_t index = last_mapping_index_;
- intptr_t mapping_node_offset = 0;
- intptr_t mapping_md_offset = -1;
-
- Reader reader(H.metadata_mappings());
- const intptr_t kUInt32Size = 4;
- reader.set_offset(mappings_offset_ + index * 2 * kUInt32Size);
-
- for (; index < mappings_num_; ++index) {
- mapping_node_offset = reader.ReadUInt32();
- mapping_md_offset = reader.ReadUInt32();
-
- if (mapping_node_offset >= node_offset) {
- break;
- }
- }
-
- last_mapping_index_ = index;
- last_node_offset_ = node_offset;
-
- if ((index < mappings_num_) && (mapping_node_offset == node_offset)) {
- ASSERT(mapping_md_offset >= 0);
- return mapping_md_offset;
- } else {
- return -1;
- }
-}
+DirectCallMetadataHelper::DirectCallMetadataHelper(KernelReaderHelper* helper)
+ : MetadataHelper(helper, tag(), /* precompiler_only = */ true) {}
bool DirectCallMetadataHelper::ReadMetadata(intptr_t node_offset,
NameIndex* target_name,
@@ -825,11 +74,11 @@
return false;
}
- AlternativeReadingScope alt(&builder_->reader_, &H.metadata_payloads(),
+ AlternativeReadingScope alt(&helper_->reader_, &H.metadata_payloads(),
md_offset);
- *target_name = builder_->ReadCanonicalNameReference();
- *check_receiver_for_null = builder_->ReadBool();
+ *target_name = helper_->ReadCanonicalNameReference();
+ *check_receiver_for_null = helper_->ReadBool();
return true;
}
@@ -845,18 +94,16 @@
// Tear-off. Use method extractor as direct call target.
const String& method_name = H.DartMethodName(kernel_name);
const Function& target_method = Function::ZoneHandle(
- builder_->zone_,
- builder_->LookupMethodByMember(kernel_name, method_name));
+ helper_->zone_, H.LookupMethodByMember(kernel_name, method_name));
const String& getter_name = H.DartGetterName(kernel_name);
return DirectCallMetadata(
- Function::ZoneHandle(builder_->zone_,
+ Function::ZoneHandle(helper_->zone_,
target_method.GetMethodExtractor(getter_name)),
check_receiver_for_null);
} else {
const String& getter_name = H.DartGetterName(kernel_name);
const Function& target = Function::ZoneHandle(
- builder_->zone_,
- builder_->LookupMethodByMember(kernel_name, getter_name));
+ helper_->zone_, H.LookupMethodByMember(kernel_name, getter_name));
ASSERT(target.IsGetterFunction() || target.IsImplicitGetterFunction());
return DirectCallMetadata(target, check_receiver_for_null);
}
@@ -872,8 +119,7 @@
const String& method_name = H.DartSetterName(kernel_name);
const Function& target = Function::ZoneHandle(
- builder_->zone_,
- builder_->LookupMethodByMember(kernel_name, method_name));
+ helper_->zone_, H.LookupMethodByMember(kernel_name, method_name));
ASSERT(target.IsSetterFunction() || target.IsImplicitSetterFunction());
return DirectCallMetadata(target, check_receiver_for_null);
@@ -889,8 +135,7 @@
const String& method_name = H.DartProcedureName(kernel_name);
const Function& target = Function::ZoneHandle(
- builder_->zone_,
- builder_->LookupMethodByMember(kernel_name, method_name));
+ helper_->zone_, H.LookupMethodByMember(kernel_name, method_name));
return DirectCallMetadata(target, check_receiver_for_null);
}
@@ -903,14 +148,14 @@
return false;
}
- AlternativeReadingScope alt(&builder_->reader_, &H.metadata_payloads(),
+ AlternativeReadingScope alt(&helper_->reader_, &H.metadata_payloads(),
md_offset);
const int kDynamicUsesBit = 1 << 0;
const int kNonThisUsesBit = 1 << 1;
const int kTearOffUsesBit = 1 << 2;
- const uint8_t flags = builder_->ReadByte();
+ const uint8_t flags = helper_->ReadByte();
metadata->has_dynamic_invocations =
(flags & kDynamicUsesBit) == kDynamicUsesBit;
metadata->has_non_this_uses = (flags & kNonThisUsesBit) == kNonThisUsesBit;
@@ -918,6 +163,10 @@
return true;
}
+ProcedureAttributesMetadataHelper::ProcedureAttributesMetadataHelper(
+ KernelReaderHelper* helper)
+ : MetadataHelper(helper, tag(), /* precompiler_only = */ true) {}
+
ProcedureAttributesMetadata
ProcedureAttributesMetadataHelper::GetProcedureAttributes(
intptr_t node_offset) {
@@ -926,6 +175,10 @@
return metadata;
}
+InferredTypeMetadataHelper::InferredTypeMetadataHelper(
+ KernelReaderHelper* helper)
+ : MetadataHelper(helper, tag(), /* precompiler_only = */ true) {}
+
InferredTypeMetadata InferredTypeMetadataHelper::GetInferredType(
intptr_t node_offset) {
const intptr_t md_offset = GetNextMetadataPayloadOffset(node_offset);
@@ -933,18 +186,18 @@
return InferredTypeMetadata(kDynamicCid, true);
}
- AlternativeReadingScope alt(&builder_->reader_, &H.metadata_payloads(),
+ AlternativeReadingScope alt(&helper_->reader_, &H.metadata_payloads(),
md_offset);
- const NameIndex kernel_name = builder_->ReadCanonicalNameReference();
- const bool nullable = builder_->ReadBool();
+ const NameIndex kernel_name = helper_->ReadCanonicalNameReference();
+ const bool nullable = helper_->ReadBool();
if (H.IsRoot(kernel_name)) {
return InferredTypeMetadata(kDynamicCid, nullable);
}
const Class& klass =
- Class::Handle(builder_->zone_, H.LookupClassByKernelClass(kernel_name));
+ Class::Handle(helper_->zone_, H.LookupClassByKernelClass(kernel_name));
ASSERT(!klass.IsNull());
intptr_t cid = klass.id();
@@ -958,6 +211,14 @@
}
#if defined(DART_USE_INTERPRETER)
+
+BytecodeMetadataHelper::BytecodeMetadataHelper(KernelReaderHelper* helper,
+ TypeTranslator* type_translator,
+ ActiveClass* active_class)
+ : MetadataHelper(helper, tag(), /* precompiler_only = */ false),
+ type_translator_(*type_translator),
+ active_class_(active_class) {}
+
void BytecodeMetadataHelper::ReadMetadata(const Function& function) {
const intptr_t node_offset = function.kernel_offset();
const intptr_t md_offset = GetNextMetadataPayloadOffset(node_offset);
@@ -965,17 +226,17 @@
return;
}
- AlternativeReadingScope alt(&builder_->reader_, &H.metadata_payloads(),
+ AlternativeReadingScope alt(&helper_->reader_, &H.metadata_payloads(),
md_offset);
// Create object pool and read pool entries.
- const intptr_t obj_count = builder_->reader_.ReadListLength();
+ const intptr_t obj_count = helper_->reader_.ReadListLength();
const ObjectPool& pool =
- ObjectPool::Handle(builder_->zone_, ObjectPool::New(obj_count));
+ ObjectPool::Handle(helper_->zone_, ObjectPool::New(obj_count));
ReadPoolEntries(function, function, pool, 0);
// Read bytecode and attach to function.
- const Code& bytecode = Code::Handle(builder_->zone_, ReadBytecode(pool));
+ const Code& bytecode = Code::Handle(helper_->zone_, ReadBytecode(pool));
function.AttachBytecode(bytecode);
// Read exceptions table.
@@ -986,11 +247,11 @@
}
// Read closures.
- Function& closure = Function::Handle(builder_->zone_);
- Code& closure_bytecode = Code::Handle(builder_->zone_);
- intptr_t num_closures = builder_->ReadListLength();
+ Function& closure = Function::Handle(helper_->zone_);
+ Code& closure_bytecode = Code::Handle(helper_->zone_);
+ intptr_t num_closures = helper_->ReadListLength();
for (intptr_t i = 0; i < num_closures; i++) {
- intptr_t closure_index = builder_->ReadUInt();
+ intptr_t closure_index = helper_->ReadUInt();
ASSERT(closure_index < obj_count);
closure ^= pool.ObjectAt(closure_index);
@@ -1047,16 +308,16 @@
setter // x.foo = ...
};
- Object& obj = Object::Handle(builder_->zone_);
- Object& elem = Object::Handle(builder_->zone_);
- Array& array = Array::Handle(builder_->zone_);
- Field& field = Field::Handle(builder_->zone_);
- Class& cls = Class::Handle(builder_->zone_);
- String& name = String::Handle(builder_->zone_);
- TypeArguments& type_args = TypeArguments::Handle(builder_->zone_);
+ Object& obj = Object::Handle(helper_->zone_);
+ Object& elem = Object::Handle(helper_->zone_);
+ Array& array = Array::Handle(helper_->zone_);
+ Field& field = Field::Handle(helper_->zone_);
+ Class& cls = Class::Handle(helper_->zone_);
+ String& name = String::Handle(helper_->zone_);
+ TypeArguments& type_args = TypeArguments::Handle(helper_->zone_);
const intptr_t obj_count = pool.Length();
for (intptr_t i = from_index; i < obj_count; ++i) {
- const intptr_t tag = builder_->ReadTag();
+ const intptr_t tag = helper_->ReadTag();
switch (tag) {
case ConstantPoolTag::kInvalid:
UNREACHABLE();
@@ -1064,55 +325,55 @@
obj = Object::null();
break;
case ConstantPoolTag::kString:
- obj = H.DartString(builder_->ReadStringReference()).raw();
+ obj = H.DartString(helper_->ReadStringReference()).raw();
ASSERT(obj.IsString());
obj = H.Canonicalize(String::Cast(obj));
break;
case ConstantPoolTag::kInt: {
- uint32_t low_bits = builder_->ReadUInt32();
- int64_t value = builder_->ReadUInt32();
+ uint32_t low_bits = helper_->ReadUInt32();
+ int64_t value = helper_->ReadUInt32();
value = (value << 32) | low_bits;
obj = Integer::New(value);
} break;
case ConstantPoolTag::kDouble: {
- uint32_t low_bits = builder_->ReadUInt32();
- uint64_t bits = builder_->ReadUInt32();
+ uint32_t low_bits = helper_->ReadUInt32();
+ uint64_t bits = helper_->ReadUInt32();
bits = (bits << 32) | low_bits;
double value = bit_cast<double, uint64_t>(bits);
obj = Double::New(value);
} break;
case ConstantPoolTag::kBool:
- if (builder_->ReadUInt() == 1) {
+ if (helper_->ReadUInt() == 1) {
obj = Bool::True().raw();
} else {
obj = Bool::False().raw();
}
break;
case ConstantPoolTag::kArgDesc: {
- intptr_t num_arguments = builder_->ReadUInt();
- intptr_t num_type_args = builder_->ReadUInt();
- intptr_t num_arg_names = builder_->ReadListLength();
+ intptr_t num_arguments = helper_->ReadUInt();
+ intptr_t num_type_args = helper_->ReadUInt();
+ intptr_t num_arg_names = helper_->ReadListLength();
if (num_arg_names == 0) {
obj = ArgumentsDescriptor::New(num_type_args, num_arguments);
} else {
array = Array::New(num_arg_names);
for (intptr_t j = 0; j < num_arg_names; j++) {
- array.SetAt(j, H.DartSymbolPlain(builder_->ReadStringReference()));
+ array.SetAt(j, H.DartSymbolPlain(helper_->ReadStringReference()));
}
obj = ArgumentsDescriptor::New(num_type_args, num_arguments, array);
}
} break;
case ConstantPoolTag::kICData: {
- InvocationKind kind = static_cast<InvocationKind>(builder_->ReadByte());
+ InvocationKind kind = static_cast<InvocationKind>(helper_->ReadByte());
if (kind == InvocationKind::getter) {
- name = builder_->ReadNameAsGetterName().raw();
+ name = helper_->ReadNameAsGetterName().raw();
} else if (kind == InvocationKind::setter) {
- name = builder_->ReadNameAsSetterName().raw();
+ name = helper_->ReadNameAsSetterName().raw();
} else {
ASSERT(kind == InvocationKind::method);
- name = builder_->ReadNameAsMethodName().raw();
+ name = helper_->ReadNameAsMethodName().raw();
}
- intptr_t arg_desc_index = builder_->ReadUInt();
+ intptr_t arg_desc_index = helper_->ReadUInt();
ASSERT(arg_desc_index < i);
array ^= pool.ObjectAt(arg_desc_index);
// TODO(regis): Should num_args_tested be explicitly provided?
@@ -1125,8 +386,8 @@
#endif
} break;
case ConstantPoolTag::kStaticICData: {
- InvocationKind kind = static_cast<InvocationKind>(builder_->ReadByte());
- NameIndex target = builder_->ReadCanonicalNameReference();
+ InvocationKind kind = static_cast<InvocationKind>(helper_->ReadByte());
+ NameIndex target = helper_->ReadCanonicalNameReference();
if (H.IsConstructor(target)) {
name = H.DartConstructorName(target).raw();
elem = H.LookupConstructorByKernelConstructor(target);
@@ -1150,7 +411,7 @@
elem = H.LookupStaticMethodByKernelProcedure(target);
}
ASSERT(elem.IsFunction());
- intptr_t arg_desc_index = builder_->ReadUInt();
+ intptr_t arg_desc_index = helper_->ReadUInt();
ASSERT(arg_desc_index < i);
array ^= pool.ObjectAt(arg_desc_index);
obj = ICData::New(function, name,
@@ -1163,29 +424,25 @@
#endif
} break;
case ConstantPoolTag::kField:
- obj =
- H.LookupFieldByKernelField(builder_->ReadCanonicalNameReference());
+ obj = H.LookupFieldByKernelField(helper_->ReadCanonicalNameReference());
ASSERT(obj.IsField());
break;
case ConstantPoolTag::kFieldOffset:
- obj =
- H.LookupFieldByKernelField(builder_->ReadCanonicalNameReference());
+ obj = H.LookupFieldByKernelField(helper_->ReadCanonicalNameReference());
ASSERT(obj.IsField());
obj = Smi::New(Field::Cast(obj).Offset() / kWordSize);
break;
case ConstantPoolTag::kClass:
- obj =
- H.LookupClassByKernelClass(builder_->ReadCanonicalNameReference());
+ obj = H.LookupClassByKernelClass(helper_->ReadCanonicalNameReference());
ASSERT(obj.IsClass());
break;
case ConstantPoolTag::kTypeArgumentsFieldOffset:
- cls =
- H.LookupClassByKernelClass(builder_->ReadCanonicalNameReference());
+ cls = H.LookupClassByKernelClass(helper_->ReadCanonicalNameReference());
obj = Smi::New(cls.type_arguments_field_offset() / kWordSize);
break;
case ConstantPoolTag::kTearOff:
obj = H.LookupStaticMethodByKernelProcedure(
- builder_->ReadCanonicalNameReference());
+ helper_->ReadCanonicalNameReference());
ASSERT(obj.IsFunction());
obj = Function::Cast(obj).ImplicitClosureFunction();
ASSERT(obj.IsFunction());
@@ -1194,22 +451,21 @@
obj = H.Canonicalize(Instance::Cast(obj));
break;
case ConstantPoolTag::kType:
- obj = builder_->type_translator_.BuildType().raw();
+ obj = type_translator_.BuildType().raw();
ASSERT(obj.IsAbstractType());
break;
case ConstantPoolTag::kTypeArguments:
- obj = builder_->type_translator_
- .BuildTypeArguments(builder_->ReadListLength())
+ obj = type_translator_.BuildTypeArguments(helper_->ReadListLength())
.raw();
ASSERT(obj.IsNull() || obj.IsTypeArguments());
break;
case ConstantPoolTag::kList: {
- obj = builder_->type_translator_.BuildType().raw();
+ obj = type_translator_.BuildType().raw();
ASSERT(obj.IsAbstractType());
- const intptr_t length = builder_->ReadListLength();
+ const intptr_t length = helper_->ReadListLength();
array = Array::New(length, AbstractType::Cast(obj));
for (intptr_t j = 0; j < length; j++) {
- intptr_t elem_index = builder_->ReadUInt();
+ intptr_t elem_index = helper_->ReadUInt();
ASSERT(elem_index < i);
elem = pool.ObjectAt(elem_index);
array.SetAt(j, elem);
@@ -1218,21 +474,20 @@
ASSERT(!obj.IsNull());
} break;
case ConstantPoolTag::kInstance: {
- cls =
- H.LookupClassByKernelClass(builder_->ReadCanonicalNameReference());
+ cls = H.LookupClassByKernelClass(helper_->ReadCanonicalNameReference());
obj = Instance::New(cls, Heap::kOld);
- intptr_t type_args_index = builder_->ReadUInt();
+ intptr_t type_args_index = helper_->ReadUInt();
ASSERT(type_args_index < i);
type_args ^= pool.ObjectAt(type_args_index);
if (!type_args.IsNull()) {
Instance::Cast(obj).SetTypeArguments(type_args);
}
- intptr_t num_fields = builder_->ReadUInt();
+ intptr_t num_fields = helper_->ReadUInt();
for (intptr_t j = 0; j < num_fields; j++) {
- NameIndex field_name = builder_->ReadCanonicalNameReference();
+ NameIndex field_name = helper_->ReadCanonicalNameReference();
ASSERT(H.IsField(field_name));
field = H.LookupFieldByKernelField(field_name);
- intptr_t elem_index = builder_->ReadUInt();
+ intptr_t elem_index = helper_->ReadUInt();
ASSERT(elem_index < i);
elem = pool.ObjectAt(elem_index);
Instance::Cast(obj).SetField(field, elem);
@@ -1240,46 +495,44 @@
obj = H.Canonicalize(Instance::Cast(obj));
} break;
case ConstantPoolTag::kSymbol:
- obj = H.DartSymbolPlain(builder_->ReadStringReference()).raw();
+ obj = H.DartSymbolPlain(helper_->ReadStringReference()).raw();
ASSERT(String::Cast(obj).IsSymbol());
break;
case ConstantPoolTag::kTypeArgumentsForInstanceAllocation: {
- cls =
- H.LookupClassByKernelClass(builder_->ReadCanonicalNameReference());
+ cls = H.LookupClassByKernelClass(helper_->ReadCanonicalNameReference());
obj =
- builder_->type_translator_
- .BuildInstantiatedTypeArguments(cls, builder_->ReadListLength())
+ type_translator_
+ .BuildInstantiatedTypeArguments(cls, helper_->ReadListLength())
.raw();
ASSERT(obj.IsNull() || obj.IsTypeArguments());
} break;
case ConstantPoolTag::kContextOffset: {
- intptr_t index = builder_->ReadUInt();
- if (i == 0) {
+ intptr_t index = helper_->ReadUInt();
+ if (index == 0) {
obj = Smi::New(Context::parent_offset() / kWordSize);
} else {
obj = Smi::New(Context::variable_offset(index - 1) / kWordSize);
}
} break;
case ConstantPoolTag::kClosureFunction: {
- name = H.DartSymbolPlain(builder_->ReadStringReference()).raw();
+ name = H.DartSymbolPlain(helper_->ReadStringReference()).raw();
const Function& closure = Function::Handle(
- builder_->zone_,
+ helper_->zone_,
Function::NewClosureFunction(name, inner_function,
TokenPosition::kNoSource));
- FunctionNodeHelper function_node_helper(builder_);
+ FunctionNodeHelper function_node_helper(helper_);
function_node_helper.ReadUntilExcluding(
FunctionNodeHelper::kTypeParameters);
- builder_->LoadAndSetupTypeParameters(builder_->active_class(), closure,
- builder_->ReadListLength(),
- closure);
+ type_translator_.LoadAndSetupTypeParameters(
+ active_class_, closure, helper_->ReadListLength(), closure);
function_node_helper.SetJustRead(FunctionNodeHelper::kTypeParameters);
// Scope remains opened until ConstantPoolTag::kEndClosureFunctionScope.
ActiveTypeParametersScope scope(
- builder_->active_class(), &closure,
- TypeArguments::Handle(builder_->zone_, closure.type_parameters()),
- builder_->zone_);
+ active_class_, &closure,
+ TypeArguments::Handle(helper_->zone_, closure.type_parameters()),
+ helper_->zone_);
function_node_helper.ReadUntilExcluding(
FunctionNodeHelper::kPositionalParameters);
@@ -1289,7 +542,7 @@
intptr_t total_parameter_count =
function_node_helper.total_parameter_count_;
- intptr_t positional_parameter_count = builder_->ReadListLength();
+ intptr_t positional_parameter_count = helper_->ReadListLength();
intptr_t named_parameter_count =
total_parameter_count - positional_parameter_count;
@@ -1305,25 +558,24 @@
}
intptr_t parameter_count = extra_parameters + total_parameter_count;
closure.set_parameter_types(Array::Handle(
- builder_->zone_, Array::New(parameter_count, Heap::kOld)));
+ helper_->zone_, Array::New(parameter_count, Heap::kOld)));
closure.set_parameter_names(Array::Handle(
- builder_->zone_, Array::New(parameter_count, Heap::kOld)));
+ helper_->zone_, Array::New(parameter_count, Heap::kOld)));
intptr_t pos = 0;
closure.SetParameterTypeAt(pos, AbstractType::dynamic_type());
closure.SetParameterNameAt(pos, Symbols::ClosureParameter());
pos++;
- const Library& lib = Library::Handle(
- builder_->zone_, builder_->active_class()->klass->library());
+ const Library& lib =
+ Library::Handle(helper_->zone_, active_class_->klass->library());
for (intptr_t j = 0; j < positional_parameter_count; ++j, ++pos) {
- VariableDeclarationHelper helper(builder_);
+ VariableDeclarationHelper helper(helper_);
helper.ReadUntilExcluding(VariableDeclarationHelper::kType);
- const AbstractType& type =
- builder_->type_translator_.BuildVariableType();
- Tag tag = builder_->ReadTag(); // read (first part of) initializer.
+ const AbstractType& type = type_translator_.BuildVariableType();
+ Tag tag = helper_->ReadTag(); // read (first part of) initializer.
if (tag == kSomething) {
- builder_->SkipExpression(); // read (actual) initializer.
+ helper_->SkipExpression(); // read (actual) initializer.
}
closure.SetParameterTypeAt(pos, type);
@@ -1331,16 +583,15 @@
H.DartIdentifier(lib, helper.name_index_));
}
- intptr_t named_parameter_count_check = builder_->ReadListLength();
+ intptr_t named_parameter_count_check = helper_->ReadListLength();
ASSERT(named_parameter_count_check == named_parameter_count);
for (intptr_t j = 0; j < named_parameter_count; ++j, ++pos) {
- VariableDeclarationHelper helper(builder_);
+ VariableDeclarationHelper helper(helper_);
helper.ReadUntilExcluding(VariableDeclarationHelper::kType);
- const AbstractType& type =
- builder_->type_translator_.BuildVariableType();
- Tag tag = builder_->ReadTag(); // read (first part of) initializer.
+ const AbstractType& type = type_translator_.BuildVariableType();
+ Tag tag = helper_->ReadTag(); // read (first part of) initializer.
if (tag == kSomething) {
- builder_->SkipExpression(); // read (actual) initializer.
+ helper_->SkipExpression(); // read (actual) initializer.
}
closure.SetParameterTypeAt(pos, type);
@@ -1350,8 +601,7 @@
function_node_helper.SetJustRead(FunctionNodeHelper::kNamedParameters);
- const AbstractType& return_type =
- builder_->type_translator_.BuildVariableType();
+ const AbstractType& return_type = type_translator_.BuildVariableType();
closure.set_result_type(return_type);
function_node_helper.SetJustRead(FunctionNodeHelper::kReturnType);
// The closure has no body.
@@ -1377,7 +627,7 @@
return i; // The caller will close the scope.
} break;
case ConstantPoolTag::kNativeEntry: {
- name = H.DartString(builder_->ReadStringReference()).raw();
+ name = H.DartString(helper_->ReadStringReference()).raw();
obj = NativeEntry(function, name);
} break;
case ConstantPoolTag::kSubtypeTestCache: {
@@ -1394,10 +644,10 @@
}
RawCode* BytecodeMetadataHelper::ReadBytecode(const ObjectPool& pool) {
- intptr_t size = builder_->reader_.ReadUInt();
- intptr_t offset = builder_->reader_.offset();
- const uint8_t* data = builder_->reader_.BufferAt(offset);
- builder_->reader_.set_offset(offset + size);
+ intptr_t size = helper_->reader_.ReadUInt();
+ intptr_t offset = helper_->reader_.offset();
+ const uint8_t* data = helper_->reader_.BufferAt(offset);
+ helper_->reader_.set_offset(offset + size);
// Create and return code object.
return Code::FinalizeBytecode(reinterpret_cast<const void*>(data), size,
@@ -1405,35 +655,35 @@
}
void BytecodeMetadataHelper::ReadExceptionsTable(const Code& bytecode) {
- const intptr_t try_block_count = builder_->reader_.ReadListLength();
+ const intptr_t try_block_count = helper_->reader_.ReadListLength();
if (try_block_count > 0) {
const ObjectPool& pool =
- ObjectPool::Handle(builder_->zone_, bytecode.object_pool());
- AbstractType& handler_type = AbstractType::Handle(builder_->zone_);
- Array& handler_types = Array::Handle(builder_->zone_);
+ ObjectPool::Handle(helper_->zone_, bytecode.object_pool());
+ AbstractType& handler_type = AbstractType::Handle(helper_->zone_);
+ Array& handler_types = Array::ZoneHandle(helper_->zone_);
DescriptorList* pc_descriptors_list =
- new (builder_->zone_) DescriptorList(64);
+ new (helper_->zone_) DescriptorList(64);
ExceptionHandlerList* exception_handlers_list =
- new (builder_->zone_) ExceptionHandlerList();
+ new (helper_->zone_) ExceptionHandlerList();
// Encoding of ExceptionsTable is described in
// pkg/vm/lib/bytecode/exceptions.dart.
for (intptr_t try_index = 0; try_index < try_block_count; try_index++) {
- intptr_t outer_try_index_plus1 = builder_->reader_.ReadUInt();
+ intptr_t outer_try_index_plus1 = helper_->reader_.ReadUInt();
intptr_t outer_try_index = outer_try_index_plus1 - 1;
- intptr_t start_pc = builder_->reader_.ReadUInt();
- intptr_t end_pc = builder_->reader_.ReadUInt();
- intptr_t handler_pc = builder_->reader_.ReadUInt();
- uint8_t flags = builder_->reader_.ReadByte();
+ intptr_t start_pc = helper_->reader_.ReadUInt();
+ intptr_t end_pc = helper_->reader_.ReadUInt();
+ intptr_t handler_pc = helper_->reader_.ReadUInt();
+ uint8_t flags = helper_->reader_.ReadByte();
const uint8_t kFlagNeedsStackTrace = 1 << 0;
const uint8_t kFlagIsSynthetic = 1 << 1;
const bool needs_stacktrace = (flags & kFlagNeedsStackTrace) != 0;
const bool is_generated = (flags & kFlagIsSynthetic) != 0;
- intptr_t type_count = builder_->reader_.ReadListLength();
+ intptr_t type_count = helper_->reader_.ReadListLength();
ASSERT(type_count > 0);
handler_types = Array::New(type_count, Heap::kOld);
for (intptr_t i = 0; i < type_count; i++) {
- intptr_t type_index = builder_->reader_.ReadUInt();
+ intptr_t type_index = helper_->reader_.ReadUInt();
ASSERT(type_index < pool.Length());
handler_type ^= pool.ObjectAt(type_index);
handler_types.SetAt(i, handler_type);
@@ -1450,12 +700,12 @@
is_generated, handler_types, needs_stacktrace);
}
const PcDescriptors& descriptors = PcDescriptors::Handle(
- builder_->zone_,
+ helper_->zone_,
pc_descriptors_list->FinalizePcDescriptors(bytecode.PayloadStart()));
bytecode.set_pc_descriptors(descriptors);
const ExceptionHandlers& handlers = ExceptionHandlers::Handle(
- builder_->zone_, exception_handlers_list->FinalizeExceptionHandlers(
- bytecode.PayloadStart()));
+ helper_->zone_, exception_handlers_list->FinalizeExceptionHandlers(
+ bytecode.PayloadStart()));
bytecode.set_exception_handlers(handlers);
} else {
bytecode.set_pc_descriptors(Object::empty_descriptors());
@@ -1465,7 +715,7 @@
RawTypedData* BytecodeMetadataHelper::NativeEntry(const Function& function,
const String& external_name) {
- Zone* zone = builder_->zone_;
+ Zone* zone = helper_->zone_;
MethodRecognizer::Kind kind = MethodRecognizer::RecognizeKind(function);
// This list of recognized methods must be kept in sync with the list of
// methods handled specially by the NativeCall bytecode in the interpreter.
@@ -1563,7 +813,7 @@
parsed_function->function().KernelData()),
parsed_function->function().KernelDataProgramOffset(),
&active_class_)),
- type_translator_(builder_, /*finalize=*/true) {
+ type_translator_(builder_, &active_class_, /*finalize=*/true) {
H.InitFromScript(builder_->script());
ASSERT(type_translator_.active_class_ == &active_class_);
ASSERT(builder_->type_translator_.active_class_ == &active_class_);
@@ -2859,8 +2109,7 @@
// this function are now in scope, although they are not defined and will be
// filled in with dynamic. This is OK, since their definitions are not needed
// for scope building of the enclosing function.
- StreamingDartTypeTranslator::TypeParameterScope scope(&type_translator_,
- num_type_params);
+ TypeTranslator::TypeParameterScope scope(&type_translator_, num_type_params);
// read positional_parameters and named_parameters.
function_node_helper.ReadUntilExcluding(
@@ -3179,18 +2428,18 @@
}
}
-StreamingDartTypeTranslator::StreamingDartTypeTranslator(
- StreamingFlowGraphBuilder* builder,
- bool finalize)
- : builder_(builder),
- translation_helper_(builder->translation_helper_),
- active_class_(builder->active_class()),
+TypeTranslator::TypeTranslator(KernelReaderHelper* helper,
+ ActiveClass* active_class,
+ bool finalize)
+ : helper_(helper),
+ translation_helper_(helper->translation_helper_),
+ active_class_(active_class),
type_parameter_scope_(NULL),
zone_(translation_helper_.zone()),
result_(AbstractType::Handle(translation_helper_.zone())),
finalize_(finalize) {}
-AbstractType& StreamingDartTypeTranslator::BuildType() {
+AbstractType& TypeTranslator::BuildType() {
BuildTypeInternal();
// We return a new `ZoneHandle` here on purpose: The intermediate language
@@ -3198,7 +2447,7 @@
return AbstractType::ZoneHandle(Z, result_.raw());
}
-AbstractType& StreamingDartTypeTranslator::BuildTypeWithoutFinalization() {
+AbstractType& TypeTranslator::BuildTypeWithoutFinalization() {
bool saved_finalize = finalize_;
finalize_ = false;
BuildTypeInternal();
@@ -3209,7 +2458,7 @@
return AbstractType::ZoneHandle(Z, result_.raw());
}
-AbstractType& StreamingDartTypeTranslator::BuildVariableType() {
+AbstractType& TypeTranslator::BuildVariableType() {
AbstractType& abstract_type = BuildType();
// We return a new `ZoneHandle` here on purpose: The intermediate language
@@ -3225,8 +2474,8 @@
return type;
}
-void StreamingDartTypeTranslator::BuildTypeInternal(bool invalid_as_dynamic) {
- Tag tag = builder_->ReadTag();
+void TypeTranslator::BuildTypeInternal(bool invalid_as_dynamic) {
+ Tag tag = helper_->ReadTag();
switch (tag) {
case kInvalidType:
if (invalid_as_dynamic) {
@@ -3264,24 +2513,24 @@
BuildTypeParameterType();
break;
default:
- builder_->ReportUnexpectedTag("type", tag);
+ helper_->ReportUnexpectedTag("type", tag);
UNREACHABLE();
}
}
-void StreamingDartTypeTranslator::BuildInterfaceType(bool simple) {
+void TypeTranslator::BuildInterfaceType(bool simple) {
// NOTE: That an interface type like `T<A, B>` is considered to be
// malformed iff `T` is malformed.
// => We therefore ignore errors in `A` or `B`.
NameIndex klass_name =
- builder_->ReadCanonicalNameReference(); // read klass_name.
+ helper_->ReadCanonicalNameReference(); // read klass_name.
intptr_t length;
if (simple) {
length = 0;
} else {
- length = builder_->ReadListLength(); // read type_arguments list length.
+ length = helper_->ReadListLength(); // read type_arguments list length.
}
const TypeArguments& type_arguments =
BuildTypeArguments(length); // read type arguments.
@@ -3294,7 +2543,7 @@
}
}
-void StreamingDartTypeTranslator::BuildFunctionType(bool simple) {
+void TypeTranslator::BuildFunctionType(bool simple) {
Function& signature_function = Function::ZoneHandle(
Z, Function::NewSignatureFunction(*active_class_->klass,
active_class_->enclosing != NULL
@@ -3311,9 +2560,8 @@
finalize_ = false;
if (!simple) {
- builder_->LoadAndSetupTypeParameters(active_class_, signature_function,
- builder_->ReadListLength(),
- signature_function);
+ LoadAndSetupTypeParameters(active_class_, signature_function,
+ helper_->ReadListLength(), signature_function);
}
ActiveTypeParametersScope scope(
@@ -3324,13 +2572,13 @@
intptr_t all_count;
intptr_t positional_count;
if (!simple) {
- required_count = builder_->ReadUInt(); // read required parameter count.
- all_count = builder_->ReadUInt(); // read total parameter count.
+ required_count = helper_->ReadUInt(); // read required parameter count.
+ all_count = helper_->ReadUInt(); // read total parameter count.
positional_count =
- builder_->ReadListLength(); // read positional_parameters list length.
+ helper_->ReadListLength(); // read positional_parameters list length.
} else {
positional_count =
- builder_->ReadListLength(); // read positional_parameters list length.
+ helper_->ReadListLength(); // read positional_parameters list length.
required_count = positional_count;
all_count = positional_count;
}
@@ -3362,10 +2610,10 @@
if (!simple) {
const intptr_t named_count =
- builder_->ReadListLength(); // read named_parameters list length.
+ helper_->ReadListLength(); // read named_parameters list length.
for (intptr_t i = 0; i < named_count; ++i, ++pos) {
// read string reference (i.e. named_parameters[i].name).
- String& name = H.DartSymbolObfuscate(builder_->ReadStringReference());
+ String& name = H.DartSymbolObfuscate(helper_->ReadStringReference());
BuildTypeInternal(); // read named_parameters[i].type.
if (result_.IsMalformed()) {
result_ = AbstractType::dynamic_type().raw();
@@ -3375,10 +2623,10 @@
}
}
- builder_->SkipListOfStrings(); // read positional parameter names.
+ helper_->SkipListOfStrings(); // read positional parameter names.
if (!simple) {
- builder_->SkipCanonicalNameReference(); // read typedef reference.
+ helper_->SkipCanonicalNameReference(); // read typedef reference.
}
BuildTypeInternal(); // read return type.
@@ -3403,9 +2651,9 @@
result_ = signature_type.raw();
}
-void StreamingDartTypeTranslator::BuildTypeParameterType() {
- intptr_t parameter_index = builder_->ReadUInt(); // read parameter index.
- builder_->SkipOptionalDartType(); // read bound.
+void TypeTranslator::BuildTypeParameterType() {
+ intptr_t parameter_index = helper_->ReadUInt(); // read parameter index.
+ helper_->SkipOptionalDartType(); // read bound.
const TypeArguments& class_types =
TypeArguments::Handle(Z, active_class_->klass->type_parameters());
@@ -3483,19 +2731,18 @@
}
H.ReportError(
- builder_->script(), TokenPosition::kNoSource,
+ helper_->script(), TokenPosition::kNoSource,
"Unbound type parameter found in %s. Please report this at dartbug.com.",
active_class_->ToCString());
}
-const TypeArguments& StreamingDartTypeTranslator::BuildTypeArguments(
- intptr_t length) {
+const TypeArguments& TypeTranslator::BuildTypeArguments(intptr_t length) {
bool only_dynamic = true;
- intptr_t offset = builder_->ReaderOffset();
+ intptr_t offset = helper_->ReaderOffset();
for (intptr_t i = 0; i < length; ++i) {
- if (builder_->ReadTag() != kDynamicType) { // Read the ith types tag.
+ if (helper_->ReadTag() != kDynamicType) { // Read the ith types tag.
only_dynamic = false;
- builder_->SetOffset(offset);
+ helper_->SetOffset(offset);
break;
}
}
@@ -3514,8 +2761,7 @@
return type_arguments;
}
-const TypeArguments&
-StreamingDartTypeTranslator::BuildInstantiatedTypeArguments(
+const TypeArguments& TypeTranslator::BuildInstantiatedTypeArguments(
const Class& receiver_class,
intptr_t length) {
const TypeArguments& type_arguments = BuildTypeArguments(length);
@@ -3542,7 +2788,79 @@
return instantiated_type_arguments;
}
-const Type& StreamingDartTypeTranslator::ReceiverType(const Class& klass) {
+void TypeTranslator::LoadAndSetupTypeParameters(
+ ActiveClass* active_class,
+ const Object& set_on,
+ intptr_t type_parameter_count,
+ const Function& parameterized_function) {
+ ASSERT(type_parameter_count >= 0);
+ if (type_parameter_count == 0) {
+ return;
+ }
+ ASSERT(set_on.IsClass() || set_on.IsFunction());
+ bool set_on_class = set_on.IsClass();
+ ASSERT(set_on_class == parameterized_function.IsNull());
+
+ // First setup the type parameters, so if any of the following code uses it
+ // (in a recursive way) we're fine.
+ TypeArguments& type_parameters = TypeArguments::Handle(Z);
+ TypeParameter& parameter = TypeParameter::Handle(Z);
+ const Type& null_bound = Type::Handle(Z);
+
+ // Step a) Create array of [TypeParameter] objects (without bound).
+ type_parameters = TypeArguments::New(type_parameter_count);
+ const Library& lib = Library::Handle(Z, active_class->klass->library());
+ {
+ AlternativeReadingScope alt(&helper_->reader_);
+ for (intptr_t i = 0; i < type_parameter_count; i++) {
+ TypeParameterHelper helper(helper_);
+ helper.Finish();
+ parameter = TypeParameter::New(
+ set_on_class ? *active_class->klass : Class::Handle(Z),
+ parameterized_function, i,
+ H.DartIdentifier(lib, helper.name_index_), // read ith name index.
+ null_bound, TokenPosition::kNoSource);
+ type_parameters.SetTypeAt(i, parameter);
+ }
+ }
+
+ if (set_on.IsClass()) {
+ Class::Cast(set_on).set_type_parameters(type_parameters);
+ } else {
+ Function::Cast(set_on).set_type_parameters(type_parameters);
+ }
+
+ const Function* enclosing = NULL;
+ if (!parameterized_function.IsNull()) {
+ enclosing = ¶meterized_function;
+ }
+ ActiveTypeParametersScope scope(active_class, enclosing, type_parameters, Z);
+
+ // Step b) Fill in the bounds of all [TypeParameter]s.
+ for (intptr_t i = 0; i < type_parameter_count; i++) {
+ TypeParameterHelper helper(helper_);
+ helper.ReadUntilExcludingAndSetJustRead(TypeParameterHelper::kBound);
+
+ // TODO(github.com/dart-lang/kernel/issues/42): This should be handled
+ // by the frontend.
+ parameter ^= type_parameters.TypeAt(i);
+ const Tag tag = helper_->PeekTag(); // peek ith bound type.
+ if (tag == kDynamicType) {
+ helper_->SkipDartType(); // read ith bound.
+ parameter.set_bound(Type::Handle(Z, I->object_store()->object_type()));
+ } else {
+ AbstractType& bound = BuildTypeWithoutFinalization(); // read ith bound.
+ if (bound.IsMalformedOrMalbounded()) {
+ bound = I->object_store()->object_type();
+ }
+ parameter.set_bound(bound);
+ }
+
+ helper.Finish();
+ }
+}
+
+const Type& TypeTranslator::ReceiverType(const Class& klass) {
ASSERT(!klass.IsNull());
ASSERT(!klass.IsTypedefClass());
// Note that if klass is _Closure, the returned type will be _Closure,
@@ -3933,8 +3251,7 @@
builder_->ReadCanonicalNameReference(); // read target_reference.
const Function& function = Function::ZoneHandle(
- Z, builder_->LookupMethodByMember(kernel_name,
- H.DartProcedureName(kernel_name)));
+ Z, H.LookupMethodByMember(kernel_name, H.DartProcedureName(kernel_name)));
// Read arguments, run the method and canonicalize the result.
const Object& result = RunMethodCall(function, &receiver);
@@ -6231,7 +5548,7 @@
? H.DartSetterName(target_name)
: H.DartProcedureName(target_name);
forwarding_target =
- &Function::ZoneHandle(Z, LookupMethodByMember(target_name, name));
+ &Function::ZoneHandle(Z, H.LookupMethodByMember(target_name, name));
ASSERT(!forwarding_target->IsNull());
}
@@ -6872,9 +6189,24 @@
// TODO(regis): Clean up this logic of when to compile.
// If the bytecode was previously loaded, we really want to compile.
if (!function.HasBytecode()) {
- bytecode_metadata_helper_.ReadMetadata(function);
- if (function.HasBytecode()) {
- return NULL;
+ // TODO(regis): For now, we skip bytecode loading for functions that were
+ // synthesized and that do not have bytecode. Since they inherited the
+ // kernel offset of a concrete function, the wrong bytecode would be loaded.
+ switch (function.kind()) {
+ case RawFunction::kImplicitGetter:
+ case RawFunction::kImplicitSetter:
+ case RawFunction::kMethodExtractor:
+ case RawFunction::kNoSuchMethodDispatcher:
+ case RawFunction::kInvokeFieldDispatcher:
+ case RawFunction::kDynamicInvocationForwarder:
+ case RawFunction::kImplicitClosureFunction:
+ break;
+ default: {
+ bytecode_metadata_helper_.ReadMetadata(function);
+ if (function.HasBytecode()) {
+ return NULL;
+ }
+ }
}
}
#endif
@@ -7115,134 +6447,6 @@
return Fragment();
}
-intptr_t KernelReaderHelper::ReaderOffset() const {
- return reader_.offset();
-}
-
-void KernelReaderHelper::SetOffset(intptr_t offset) {
- reader_.set_offset(offset);
-}
-
-void KernelReaderHelper::SkipBytes(intptr_t bytes) {
- reader_.set_offset(ReaderOffset() + bytes);
-}
-
-bool KernelReaderHelper::ReadBool() {
- return reader_.ReadBool();
-}
-
-uint8_t KernelReaderHelper::ReadByte() {
- return reader_.ReadByte();
-}
-
-uint32_t KernelReaderHelper::ReadUInt() {
- return reader_.ReadUInt();
-}
-
-uint32_t KernelReaderHelper::ReadUInt32() {
- return reader_.ReadUInt32();
-}
-
-uint32_t KernelReaderHelper::PeekUInt() {
- AlternativeReadingScope alt(&reader_);
- return reader_.ReadUInt();
-}
-
-double KernelReaderHelper::ReadDouble() {
- return reader_.ReadDouble();
-}
-
-uint32_t KernelReaderHelper::PeekListLength() {
- AlternativeReadingScope alt(&reader_);
- return reader_.ReadListLength();
-}
-
-intptr_t KernelReaderHelper::ReadListLength() {
- return reader_.ReadListLength();
-}
-
-StringIndex KernelReaderHelper::ReadStringReference() {
- return StringIndex(ReadUInt());
-}
-
-NameIndex KernelReaderHelper::ReadCanonicalNameReference() {
- return reader_.ReadCanonicalNameReference();
-}
-
-StringIndex KernelReaderHelper::ReadNameAsStringIndex() {
- StringIndex name_index = ReadStringReference(); // read name index.
- if ((H.StringSize(name_index) >= 1) && H.CharacterAt(name_index, 0) == '_') {
- ReadUInt(); // read library index.
- }
- return name_index;
-}
-
-const String& KernelReaderHelper::ReadNameAsMethodName() {
- StringIndex name_index = ReadStringReference(); // read name index.
- if ((H.StringSize(name_index) >= 1) && H.CharacterAt(name_index, 0) == '_') {
- NameIndex library_reference =
- ReadCanonicalNameReference(); // read library index.
- return H.DartMethodName(library_reference, name_index);
- } else {
- return H.DartMethodName(NameIndex(), name_index);
- }
-}
-
-const String& KernelReaderHelper::ReadNameAsSetterName() {
- StringIndex name_index = ReadStringReference(); // read name index.
- if ((H.StringSize(name_index) >= 1) && H.CharacterAt(name_index, 0) == '_') {
- NameIndex library_reference =
- ReadCanonicalNameReference(); // read library index.
- return H.DartSetterName(library_reference, name_index);
- } else {
- return H.DartSetterName(NameIndex(), name_index);
- }
-}
-
-const String& KernelReaderHelper::ReadNameAsGetterName() {
- StringIndex name_index = ReadStringReference(); // read name index.
- if ((H.StringSize(name_index) >= 1) && H.CharacterAt(name_index, 0) == '_') {
- NameIndex library_reference =
- ReadCanonicalNameReference(); // read library index.
- return H.DartGetterName(library_reference, name_index);
- } else {
- return H.DartGetterName(NameIndex(), name_index);
- }
-}
-
-const String& KernelReaderHelper::ReadNameAsFieldName() {
- StringIndex name_index = ReadStringReference(); // read name index.
- if ((H.StringSize(name_index) >= 1) && H.CharacterAt(name_index, 0) == '_') {
- NameIndex library_reference =
- ReadCanonicalNameReference(); // read library index.
- return H.DartFieldName(library_reference, name_index);
- } else {
- return H.DartFieldName(NameIndex(), name_index);
- }
-}
-
-void KernelReaderHelper::SkipFlags() {
- ReadFlags();
-}
-
-void KernelReaderHelper::SkipStringReference() {
- ReadUInt();
-}
-
-void KernelReaderHelper::SkipConstantReference() {
- ReadUInt();
-}
-
-void KernelReaderHelper::SkipCanonicalNameReference() {
- ReadUInt();
-}
-
-void KernelReaderHelper::ReportUnexpectedTag(const char* variant, Tag tag) {
- H.ReportError(script_, TokenPosition::kNoSource,
- "Unexpected tag %d (%s) in ?, expected %s", tag,
- Reader::TagName(tag), variant);
-}
-
void StreamingFlowGraphBuilder::ReportUnexpectedTag(const char* variant,
Tag tag) {
if ((flow_graph_builder_ == NULL) || (parsed_function() == NULL)) {
@@ -7255,578 +6459,6 @@
}
}
-void KernelReaderHelper::SkipDartType() {
- Tag tag = ReadTag();
- switch (tag) {
- case kInvalidType:
- case kDynamicType:
- case kVoidType:
- case kBottomType:
- // those contain nothing.
- return;
- case kInterfaceType:
- SkipInterfaceType(false);
- return;
- case kSimpleInterfaceType:
- SkipInterfaceType(true);
- return;
- case kFunctionType:
- SkipFunctionType(false);
- return;
- case kSimpleFunctionType:
- SkipFunctionType(true);
- return;
- case kTypeParameterType:
- ReadUInt(); // read index for parameter.
- SkipOptionalDartType(); // read bound bound.
- return;
- default:
- ReportUnexpectedTag("type", tag);
- UNREACHABLE();
- }
-}
-
-void KernelReaderHelper::SkipOptionalDartType() {
- Tag tag = ReadTag(); // read tag.
- if (tag == kNothing) {
- return;
- }
- ASSERT(tag == kSomething);
-
- SkipDartType(); // read type.
-}
-
-void KernelReaderHelper::SkipInterfaceType(bool simple) {
- ReadUInt(); // read klass_name.
- if (!simple) {
- SkipListOfDartTypes(); // read list of types.
- }
-}
-
-void KernelReaderHelper::SkipFunctionType(bool simple) {
- if (!simple) {
- SkipTypeParametersList(); // read type_parameters.
- ReadUInt(); // read required parameter count.
- ReadUInt(); // read total parameter count.
- }
-
- SkipListOfDartTypes(); // read positional_parameters types.
-
- if (!simple) {
- const intptr_t named_count =
- ReadListLength(); // read named_parameters list length.
- for (intptr_t i = 0; i < named_count; ++i) {
- // read string reference (i.e. named_parameters[i].name).
- SkipStringReference();
- SkipDartType(); // read named_parameters[i].type.
- }
- }
-
- SkipListOfStrings(); // read positional parameter names.
-
- if (!simple) {
- SkipCanonicalNameReference(); // read typedef reference.
- }
-
- SkipDartType(); // read return type.
-}
-
-void KernelReaderHelper::SkipStatementList() {
- intptr_t list_length = ReadListLength(); // read list length.
- for (intptr_t i = 0; i < list_length; ++i) {
- SkipStatement(); // read ith expression.
- }
-}
-
-void KernelReaderHelper::SkipListOfExpressions() {
- intptr_t list_length = ReadListLength(); // read list length.
- for (intptr_t i = 0; i < list_length; ++i) {
- SkipExpression(); // read ith expression.
- }
-}
-
-void KernelReaderHelper::SkipListOfDartTypes() {
- intptr_t list_length = ReadListLength(); // read list length.
- for (intptr_t i = 0; i < list_length; ++i) {
- SkipDartType(); // read ith type.
- }
-}
-
-void KernelReaderHelper::SkipListOfStrings() {
- intptr_t list_length = ReadListLength(); // read list length.
- for (intptr_t i = 0; i < list_length; ++i) {
- SkipStringReference(); // read ith string index.
- }
-}
-
-void KernelReaderHelper::SkipListOfVariableDeclarations() {
- intptr_t list_length = ReadListLength(); // read list length.
- for (intptr_t i = 0; i < list_length; ++i) {
- SkipVariableDeclaration(); // read ith variable declaration.
- }
-}
-
-void KernelReaderHelper::SkipTypeParametersList() {
- intptr_t list_length = ReadListLength(); // read list length.
- for (intptr_t i = 0; i < list_length; ++i) {
- TypeParameterHelper helper(this);
- helper.Finish();
- }
-}
-
-void KernelReaderHelper::SkipInitializer() {
- Tag tag = ReadTag();
- ReadByte(); // read isSynthetic flag.
- switch (tag) {
- case kInvalidInitializer:
- return;
- case kFieldInitializer:
- SkipCanonicalNameReference(); // read field_reference.
- SkipExpression(); // read value.
- return;
- case kSuperInitializer:
- SkipCanonicalNameReference(); // read target_reference.
- SkipArguments(); // read arguments.
- return;
- case kRedirectingInitializer:
- SkipCanonicalNameReference(); // read target_reference.
- SkipArguments(); // read arguments.
- return;
- case kLocalInitializer:
- SkipVariableDeclaration(); // read variable.
- return;
- case kAssertInitializer:
- SkipStatement();
- return;
- default:
- ReportUnexpectedTag("initializer", tag);
- UNREACHABLE();
- }
-}
-
-void KernelReaderHelper::SkipExpression() {
- uint8_t payload = 0;
- Tag tag = ReadTag(&payload);
- switch (tag) {
- case kInvalidExpression:
- ReadPosition();
- SkipStringReference();
- return;
- case kVariableGet:
- ReadPosition(); // read position.
- ReadUInt(); // read kernel position.
- ReadUInt(); // read relative variable index.
- SkipOptionalDartType(); // read promoted type.
- return;
- case kSpecializedVariableGet:
- ReadPosition(); // read position.
- ReadUInt(); // read kernel position.
- return;
- case kVariableSet:
- ReadPosition(); // read position.
- ReadUInt(); // read kernel position.
- ReadUInt(); // read relative variable index.
- SkipExpression(); // read expression.
- return;
- case kSpecializedVariableSet:
- ReadPosition(); // read position.
- ReadUInt(); // read kernel position.
- SkipExpression(); // read expression.
- return;
- case kPropertyGet:
- ReadPosition(); // read position.
- SkipExpression(); // read receiver.
- SkipName(); // read name.
- SkipCanonicalNameReference(); // read interface_target_reference.
- return;
- case kPropertySet:
- ReadPosition(); // read position.
- SkipExpression(); // read receiver.
- SkipName(); // read name.
- SkipExpression(); // read value.
- SkipCanonicalNameReference(); // read interface_target_reference.
- return;
- case kSuperPropertyGet:
- ReadPosition(); // read position.
- SkipName(); // read name.
- SkipCanonicalNameReference(); // read interface_target_reference.
- return;
- case kSuperPropertySet:
- ReadPosition(); // read position.
- SkipName(); // read name.
- SkipExpression(); // read value.
- SkipCanonicalNameReference(); // read interface_target_reference.
- return;
- case kDirectPropertyGet:
- ReadPosition(); // read position.
- SkipExpression(); // read receiver.
- SkipCanonicalNameReference(); // read target_reference.
- return;
- case kDirectPropertySet:
- ReadPosition(); // read position.
- SkipExpression(); // read receiver.
- SkipCanonicalNameReference(); // read target_reference.
- SkipExpression(); // read value·
- return;
- case kStaticGet:
- ReadPosition(); // read position.
- SkipCanonicalNameReference(); // read target_reference.
- return;
- case kStaticSet:
- ReadPosition(); // read position.
- SkipCanonicalNameReference(); // read target_reference.
- SkipExpression(); // read expression.
- return;
- case kMethodInvocation:
- ReadPosition(); // read position.
- SkipExpression(); // read receiver.
- SkipName(); // read name.
- SkipArguments(); // read arguments.
- SkipCanonicalNameReference(); // read interface_target_reference.
- return;
- case kSuperMethodInvocation:
- ReadPosition(); // read position.
- SkipName(); // read name.
- SkipArguments(); // read arguments.
- SkipCanonicalNameReference(); // read interface_target_reference.
- return;
- case kDirectMethodInvocation:
- ReadPosition(); // read position.
- SkipExpression(); // read receiver.
- SkipCanonicalNameReference(); // read target_reference.
- SkipArguments(); // read arguments.
- return;
- case kStaticInvocation:
- case kConstStaticInvocation:
- ReadPosition(); // read position.
- SkipCanonicalNameReference(); // read procedure_reference.
- SkipArguments(); // read arguments.
- return;
- case kConstructorInvocation:
- case kConstConstructorInvocation:
- ReadPosition(); // read position.
- SkipCanonicalNameReference(); // read target_reference.
- SkipArguments(); // read arguments.
- return;
- case kNot:
- SkipExpression(); // read expression.
- return;
- case kLogicalExpression:
- SkipExpression(); // read left.
- SkipBytes(1); // read operator.
- SkipExpression(); // read right.
- return;
- case kConditionalExpression:
- SkipExpression(); // read condition.
- SkipExpression(); // read then.
- SkipExpression(); // read otherwise.
- SkipOptionalDartType(); // read unused static type.
- return;
- case kStringConcatenation:
- ReadPosition(); // read position.
- SkipListOfExpressions(); // read list of expressions.
- return;
- case kIsExpression:
- ReadPosition(); // read position.
- SkipExpression(); // read operand.
- SkipDartType(); // read type.
- return;
- case kAsExpression:
- ReadPosition(); // read position.
- SkipFlags(); // read flags.
- SkipExpression(); // read operand.
- SkipDartType(); // read type.
- return;
- case kSymbolLiteral:
- SkipStringReference(); // read index into string table.
- return;
- case kTypeLiteral:
- SkipDartType(); // read type.
- return;
- case kThisExpression:
- return;
- case kRethrow:
- ReadPosition(); // read position.
- return;
- case kThrow:
- ReadPosition(); // read position.
- SkipExpression(); // read expression.
- return;
- case kListLiteral:
- case kConstListLiteral:
- ReadPosition(); // read position.
- SkipDartType(); // read type.
- SkipListOfExpressions(); // read list of expressions.
- return;
- case kMapLiteral:
- case kConstMapLiteral: {
- ReadPosition(); // read position.
- SkipDartType(); // read key type.
- SkipDartType(); // read value type.
- intptr_t list_length = ReadListLength(); // read list length.
- for (intptr_t i = 0; i < list_length; ++i) {
- SkipExpression(); // read ith key.
- SkipExpression(); // read ith value.
- }
- return;
- }
- case kFunctionExpression:
- ReadPosition(); // read position.
- SkipFunctionNode(); // read function node.
- return;
- case kLet:
- SkipVariableDeclaration(); // read variable declaration.
- SkipExpression(); // read expression.
- return;
- case kInstantiation:
- SkipExpression(); // read expression.
- SkipListOfDartTypes(); // read type arguments.
- return;
- case kBigIntLiteral:
- SkipStringReference(); // read string reference.
- return;
- case kStringLiteral:
- SkipStringReference(); // read string reference.
- return;
- case kSpecializedIntLiteral:
- return;
- case kNegativeIntLiteral:
- ReadUInt(); // read value.
- return;
- case kPositiveIntLiteral:
- ReadUInt(); // read value.
- return;
- case kDoubleLiteral:
- ReadDouble(); // read value.
- return;
- case kTrueLiteral:
- return;
- case kFalseLiteral:
- return;
- case kNullLiteral:
- return;
- case kConstantExpression:
- SkipConstantReference();
- return;
- case kLoadLibrary:
- case kCheckLibraryIsLoaded:
- ReadUInt(); // skip library index
- return;
- default:
- ReportUnexpectedTag("expression", tag);
- UNREACHABLE();
- }
-}
-
-void KernelReaderHelper::SkipStatement() {
- Tag tag = ReadTag(); // read tag.
- switch (tag) {
- case kExpressionStatement:
- SkipExpression(); // read expression.
- return;
- case kBlock:
- SkipStatementList();
- return;
- case kEmptyStatement:
- return;
- case kAssertBlock:
- SkipStatementList();
- return;
- case kAssertStatement:
- SkipExpression(); // Read condition.
- ReadPosition(); // read condition start offset.
- ReadPosition(); // read condition end offset.
- if (ReadTag() == kSomething) {
- SkipExpression(); // read (rest of) message.
- }
- return;
- case kLabeledStatement:
- SkipStatement(); // read body.
- return;
- case kBreakStatement:
- ReadPosition(); // read position.
- ReadUInt(); // read target_index.
- return;
- case kWhileStatement:
- ReadPosition(); // read position.
- SkipExpression(); // read condition.
- SkipStatement(); // read body.
- return;
- case kDoStatement:
- ReadPosition(); // read position.
- SkipStatement(); // read body.
- SkipExpression(); // read condition.
- return;
- case kForStatement: {
- ReadPosition(); // read position.
- SkipListOfVariableDeclarations(); // read variables.
- Tag tag = ReadTag(); // Read first part of condition.
- if (tag == kSomething) {
- SkipExpression(); // read rest of condition.
- }
- SkipListOfExpressions(); // read updates.
- SkipStatement(); // read body.
- return;
- }
- case kForInStatement:
- case kAsyncForInStatement:
- ReadPosition(); // read position.
- ReadPosition(); // read body position.
- SkipVariableDeclaration(); // read variable.
- SkipExpression(); // read iterable.
- SkipStatement(); // read body.
- return;
- case kSwitchStatement: {
- ReadPosition(); // read position.
- SkipExpression(); // read condition.
- int case_count = ReadListLength(); // read number of cases.
- for (intptr_t i = 0; i < case_count; ++i) {
- int expression_count = ReadListLength(); // read number of expressions.
- for (intptr_t j = 0; j < expression_count; ++j) {
- ReadPosition(); // read jth position.
- SkipExpression(); // read jth expression.
- }
- ReadBool(); // read is_default.
- SkipStatement(); // read body.
- }
- return;
- }
- case kContinueSwitchStatement:
- ReadPosition(); // read position.
- ReadUInt(); // read target_index.
- return;
- case kIfStatement:
- ReadPosition(); // read position.
- SkipExpression(); // read condition.
- SkipStatement(); // read then.
- SkipStatement(); // read otherwise.
- return;
- case kReturnStatement: {
- ReadPosition(); // read position
- Tag tag = ReadTag(); // read (first part of) expression.
- if (tag == kSomething) {
- SkipExpression(); // read (rest of) expression.
- }
- return;
- }
- case kTryCatch: {
- SkipStatement(); // read body.
- ReadByte(); // read flags
- intptr_t catch_count = ReadListLength(); // read number of catches.
- for (intptr_t i = 0; i < catch_count; ++i) {
- ReadPosition(); // read position.
- SkipDartType(); // read guard.
- tag = ReadTag(); // read first part of exception.
- if (tag == kSomething) {
- SkipVariableDeclaration(); // read exception.
- }
- tag = ReadTag(); // read first part of stack trace.
- if (tag == kSomething) {
- SkipVariableDeclaration(); // read stack trace.
- }
- SkipStatement(); // read body.
- }
- return;
- }
- case kTryFinally:
- SkipStatement(); // read body.
- SkipStatement(); // read finalizer.
- return;
- case kYieldStatement: {
- TokenPosition position = ReadPosition(); // read position.
- RecordYieldPosition(position);
- ReadByte(); // read flags.
- SkipExpression(); // read expression.
- return;
- }
- case kVariableDeclaration:
- SkipVariableDeclaration(); // read variable declaration.
- return;
- case kFunctionDeclaration:
- ReadPosition(); // read position.
- SkipVariableDeclaration(); // read variable.
- SkipFunctionNode(); // read function node.
- return;
- default:
- ReportUnexpectedTag("statement", tag);
- UNREACHABLE();
- }
-}
-
-void KernelReaderHelper::SkipFunctionNode() {
- FunctionNodeHelper function_node_helper(this);
- function_node_helper.ReadUntilExcluding(FunctionNodeHelper::kEnd);
-}
-
-void KernelReaderHelper::SkipName() {
- StringIndex name_index = ReadStringReference(); // read name index.
- if ((H.StringSize(name_index) >= 1) && H.CharacterAt(name_index, 0) == '_') {
- SkipCanonicalNameReference(); // read library index.
- }
-}
-
-void KernelReaderHelper::SkipArguments() {
- ReadUInt(); // read argument count.
-
- SkipListOfDartTypes(); // read list of types.
- SkipListOfExpressions(); // read positionals.
-
- // List of named.
- intptr_t list_length = ReadListLength(); // read list length.
- for (intptr_t i = 0; i < list_length; ++i) {
- SkipStringReference(); // read ith name index.
- SkipExpression(); // read ith expression.
- }
-}
-
-void KernelReaderHelper::SkipVariableDeclaration() {
- VariableDeclarationHelper helper(this);
- helper.ReadUntilExcluding(VariableDeclarationHelper::kEnd);
-}
-
-void KernelReaderHelper::SkipLibraryCombinator() {
- ReadBool(); // read is_show.
- intptr_t name_count = ReadUInt(); // read list length.
- for (intptr_t j = 0; j < name_count; ++j) {
- ReadUInt(); // read ith entry of name_indices.
- }
-}
-
-void KernelReaderHelper::SkipLibraryDependency() {
- ReadPosition(); // read file offset.
- ReadFlags();
- SkipListOfExpressions(); // Annotations.
- ReadCanonicalNameReference();
- ReadStringReference(); // Name.
- intptr_t combinator_count = ReadListLength();
- for (intptr_t i = 0; i < combinator_count; ++i) {
- SkipLibraryCombinator();
- }
-}
-
-void KernelReaderHelper::SkipLibraryPart() {
- SkipListOfExpressions(); // Read annotations.
- SkipStringReference(); // Read part URI index.
-}
-
-void KernelReaderHelper::SkipLibraryTypedef() {
- SkipCanonicalNameReference(); // read canonical name.
- ReadUInt(); // read source_uri_index.
- ReadPosition(); // read position.
- SkipStringReference(); // read name index.
- SkipListOfExpressions(); // read annotations.
- SkipTypeParametersList(); // read type parameters.
- SkipDartType(); // read type.
-}
-
-TokenPosition KernelReaderHelper::ReadPosition(bool record) {
- TokenPosition position = reader_.ReadPosition();
- if (record) {
- RecordTokenPosition(position);
- }
- return position;
-}
-
void StreamingFlowGraphBuilder::RecordTokenPosition(TokenPosition position) {
if (record_for_script_id_ == current_script_id_ &&
record_token_positions_into_ != NULL && position.IsReal()) {
@@ -7989,12 +6621,6 @@
return flow_graph_builder_->MakeTemporary();
}
-RawFunction* StreamingFlowGraphBuilder::LookupMethodByMember(
- NameIndex target,
- const String& method_name) {
- return flow_graph_builder_->LookupMethodByMember(target, method_name);
-}
-
Function& StreamingFlowGraphBuilder::FindMatchingFunctionAnyArgs(
const Class& klass,
const String& name) {
@@ -8532,7 +7158,8 @@
if (I->strong() && !H.IsRoot(itarget_name) &&
(H.IsGetter(itarget_name) || H.IsField(itarget_name))) {
interface_target = &Function::ZoneHandle(
- Z, LookupMethodByMember(itarget_name, H.DartGetterName(itarget_name)));
+ Z,
+ H.LookupMethodByMember(itarget_name, H.DartGetterName(itarget_name)));
ASSERT(getter_name.raw() == interface_target->name());
}
@@ -8594,7 +7221,8 @@
ReadCanonicalNameReference(); // read interface_target_reference.
if (I->strong() && !H.IsRoot(itarget_name)) {
interface_target = &Function::ZoneHandle(
- Z, LookupMethodByMember(itarget_name, H.DartSetterName(itarget_name)));
+ Z,
+ H.LookupMethodByMember(itarget_name, H.DartSetterName(itarget_name)));
ASSERT(setter_name.raw() == interface_target->name());
}
@@ -8860,12 +7488,14 @@
Function& target = Function::ZoneHandle(Z);
if (H.IsProcedure(kernel_name)) {
if (H.IsGetter(kernel_name)) {
- target = LookupMethodByMember(kernel_name, H.DartGetterName(kernel_name));
+ target =
+ H.LookupMethodByMember(kernel_name, H.DartGetterName(kernel_name));
} else if (receiver_tag == kThisExpression) {
// Undo stack change for the BuildExpression.
Pop();
- target = LookupMethodByMember(kernel_name, H.DartMethodName(kernel_name));
+ target =
+ H.LookupMethodByMember(kernel_name, H.DartMethodName(kernel_name));
target = target.ImplicitClosureFunction();
ASSERT(!target.IsNull());
@@ -8876,14 +7506,15 @@
// Need to create implicit closure (tear-off), receiver != this.
// Ensure method extractor exists and call it directly.
const Function& target_method = Function::ZoneHandle(
- Z, LookupMethodByMember(kernel_name, H.DartMethodName(kernel_name)));
+ Z,
+ H.LookupMethodByMember(kernel_name, H.DartMethodName(kernel_name)));
const String& getter_name = H.DartGetterName(kernel_name);
target = target_method.GetMethodExtractor(getter_name);
}
} else {
ASSERT(H.IsField(kernel_name));
const String& getter_name = H.DartGetterName(kernel_name);
- target = LookupMethodByMember(kernel_name, getter_name);
+ target = H.LookupMethodByMember(kernel_name, getter_name);
ASSERT(target.IsGetterFunction() || target.IsImplicitGetterFunction());
}
@@ -8911,7 +7542,7 @@
ReadCanonicalNameReference(); // read target_reference.
const String& method_name = H.DartSetterName(target_reference);
const Function& target = Function::ZoneHandle(
- Z, LookupMethodByMember(target_reference, method_name));
+ Z, H.LookupMethodByMember(target_reference, method_name));
ASSERT(target.IsSetterFunction() || target.IsImplicitSetterFunction());
instructions += BuildExpression(); // read value.
@@ -9158,8 +7789,8 @@
ReadCanonicalNameReference(); // read interface_target_reference.
if (I->strong() && !H.IsRoot(itarget_name) && !H.IsField(itarget_name)) {
interface_target = &Function::ZoneHandle(
- Z,
- LookupMethodByMember(itarget_name, H.DartProcedureName(itarget_name)));
+ Z, H.LookupMethodByMember(itarget_name,
+ H.DartProcedureName(itarget_name)));
ASSERT((name.raw() == interface_target->name()) ||
(interface_target->IsGetterFunction() &&
Field::GetterSymbol(name) == interface_target->name()));
@@ -9268,7 +7899,7 @@
instructions += PushArgument(); // push receiver as argument.
const Function& target =
- Function::ZoneHandle(Z, LookupMethodByMember(kernel_name, method_name));
+ Function::ZoneHandle(Z, H.LookupMethodByMember(kernel_name, method_name));
Array& argument_names = Array::ZoneHandle(Z);
intptr_t argument_count, positional_argument_count;
@@ -11354,79 +9985,6 @@
return instructions;
}
-void StreamingFlowGraphBuilder::LoadAndSetupTypeParameters(
- ActiveClass* active_class,
- const Object& set_on,
- intptr_t type_parameter_count,
- const Function& parameterized_function) {
- ASSERT(type_parameter_count >= 0);
- if (type_parameter_count == 0) {
- return;
- }
- ASSERT(set_on.IsClass() || set_on.IsFunction());
- bool set_on_class = set_on.IsClass();
- ASSERT(set_on_class == parameterized_function.IsNull());
-
- // First setup the type parameters, so if any of the following code uses it
- // (in a recursive way) we're fine.
- TypeArguments& type_parameters = TypeArguments::Handle(Z);
- TypeParameter& parameter = TypeParameter::Handle(Z);
- const Type& null_bound = Type::Handle(Z);
-
- // Step a) Create array of [TypeParameter] objects (without bound).
- type_parameters = TypeArguments::New(type_parameter_count);
- const Library& lib = Library::Handle(Z, active_class->klass->library());
- {
- AlternativeReadingScope alt(&reader_);
- for (intptr_t i = 0; i < type_parameter_count; i++) {
- TypeParameterHelper helper(this);
- helper.Finish();
- parameter = TypeParameter::New(
- set_on_class ? *active_class->klass : Class::Handle(Z),
- parameterized_function, i,
- H.DartIdentifier(lib, helper.name_index_), // read ith name index.
- null_bound, TokenPosition::kNoSource);
- type_parameters.SetTypeAt(i, parameter);
- }
- }
-
- if (set_on.IsClass()) {
- Class::Cast(set_on).set_type_parameters(type_parameters);
- } else {
- Function::Cast(set_on).set_type_parameters(type_parameters);
- }
-
- const Function* enclosing = NULL;
- if (!parameterized_function.IsNull()) {
- enclosing = ¶meterized_function;
- }
- ActiveTypeParametersScope scope(active_class, enclosing, type_parameters, Z);
-
- // Step b) Fill in the bounds of all [TypeParameter]s.
- for (intptr_t i = 0; i < type_parameter_count; i++) {
- TypeParameterHelper helper(this);
- helper.ReadUntilExcludingAndSetJustRead(TypeParameterHelper::kBound);
-
- // TODO(github.com/dart-lang/kernel/issues/42): This should be handled
- // by the frontend.
- parameter ^= type_parameters.TypeAt(i);
- const Tag tag = PeekTag(); // peek ith bound type.
- if (tag == kDynamicType) {
- SkipDartType(); // read ith bound.
- parameter.set_bound(Type::Handle(Z, I->object_store()->object_type()));
- } else {
- AbstractType& bound =
- T.BuildTypeWithoutFinalization(); // read ith bound.
- if (bound.IsMalformedOrMalbounded()) {
- bound = I->object_store()->object_type();
- }
- parameter.set_bound(bound);
- }
-
- helper.Finish();
- }
-}
-
void StreamingFlowGraphBuilder::SetupFunctionParameters(
ActiveClass* active_class,
const Class& klass,
@@ -11439,8 +9997,8 @@
intptr_t extra_parameters = (is_method || is_closure || is_factory) ? 1 : 0;
if (!is_factory) {
- LoadAndSetupTypeParameters(active_class, function, ReadListLength(),
- function);
+ T.LoadAndSetupTypeParameters(active_class, function, ReadListLength(),
+ function);
function_node_helper->SetJustRead(FunctionNodeHelper::kTypeParameters);
}
@@ -11751,72 +10309,6 @@
return line_starts_data.raw();
}
-void StreamingFlowGraphBuilder::EnsureMetadataIsScanned() {
- // Scan metadata mappings only once.
- if (metadata_scanned_) {
- return;
- }
- metadata_scanned_ = true;
-
- const intptr_t kUInt32Size = 4;
- Reader reader(H.metadata_mappings());
- if (reader.size() == 0) {
- return;
- }
-
- // Scan through metadata mappings in reverse direction.
-
- // Read metadataMappings length.
- intptr_t offset = reader.size() - kUInt32Size;
- uint32_t metadata_num = reader.ReadUInt32At(offset);
-
- if (metadata_num == 0) {
- ASSERT(H.metadata_mappings().LengthInBytes() == kUInt32Size);
- return;
- }
-
- // Read metadataMappings elements.
- for (uint32_t i = 0; i < metadata_num; ++i) {
- // Read nodeOffsetToMetadataOffset length.
- offset -= kUInt32Size;
- uint32_t mappings_num = reader.ReadUInt32At(offset);
-
- // Skip nodeOffsetToMetadataOffset and read tag.
- offset -= mappings_num * 2 * kUInt32Size + kUInt32Size;
- StringIndex tag = StringIndex(reader.ReadUInt32At(offset));
-
- if (mappings_num == 0) {
- continue;
- }
-
- // Check recognized metadata
- if (H.StringEquals(tag, DirectCallMetadataHelper::tag())) {
- if (!FLAG_precompiled_mode) {
- FATAL("DirectCallMetadata is allowed in precompiled mode only");
- }
- direct_call_metadata_helper_.SetMetadataMappings(offset + kUInt32Size,
- mappings_num);
- } else if (H.StringEquals(tag, InferredTypeMetadataHelper::tag())) {
- if (!FLAG_precompiled_mode) {
- FATAL("InferredTypeMetadata is allowed in precompiled mode only");
- }
- inferred_type_metadata_helper_.SetMetadataMappings(offset + kUInt32Size,
- mappings_num);
- } else if (H.StringEquals(tag, ProcedureAttributesMetadataHelper::tag())) {
- if (!FLAG_precompiled_mode) {
- FATAL(
- "ProcedureAttributesMetadata is allowed in precompiled mode "
- "only");
- }
- procedure_attributes_metadata_helper_.SetMetadataMappings(
- offset + kUInt32Size, mappings_num);
- } else if (H.StringEquals(tag, BytecodeMetadataHelper::tag())) {
- bytecode_metadata_helper_.SetMetadataMappings(offset + kUInt32Size,
- mappings_num);
- }
- }
-}
-
const Array& ConstantHelper::ReadConstantTable() {
const intptr_t number_of_constants = builder_.ReadUInt();
if (number_of_constants == 0) {
diff --git a/runtime/vm/compiler/frontend/kernel_binary_flowgraph.h b/runtime/vm/compiler/frontend/kernel_binary_flowgraph.h
index 2636f59..35f905c 100644
--- a/runtime/vm/compiler/frontend/kernel_binary_flowgraph.h
+++ b/runtime/vm/compiler/frontend/kernel_binary_flowgraph.h
@@ -7,9 +7,8 @@
#if !defined(DART_PRECOMPILED_RUNTIME)
-#include <map>
-
#include "vm/compiler/frontend/kernel_to_il.h"
+#include "vm/compiler/frontend/kernel_translation_helper.h"
#include "vm/kernel.h"
#include "vm/kernel_binary.h"
#include "vm/object.h"
@@ -17,591 +16,7 @@
namespace dart {
namespace kernel {
-class KernelReaderHelper;
-
-// Helper class that reads a kernel FunctionNode from binary.
-//
-// Use ReadUntilExcluding to read up to but not including a field.
-// One can then for instance read the field from the call-site (and remember to
-// call SetAt to inform this helper class), and then use this to read more.
-// Simple fields are stored (e.g. integers) and can be fetched from this class.
-// If asked to read a compound field (e.g. an expression) it will be skipped.
-class FunctionNodeHelper {
- public:
- enum Field {
- kStart, // tag.
- kPosition,
- kEndPosition,
- kAsyncMarker,
- kDartAsyncMarker,
- kTypeParameters,
- kTotalParameterCount,
- kRequiredParameterCount,
- kPositionalParameters,
- kNamedParameters,
- kReturnType,
- kBody,
- kEnd,
- };
-
- enum AsyncMarker {
- kSync = 0,
- kSyncStar = 1,
- kAsync = 2,
- kAsyncStar = 3,
- kSyncYielding = 4,
- };
-
- explicit FunctionNodeHelper(KernelReaderHelper* helper) {
- helper_ = helper;
- next_read_ = kStart;
- }
-
- void ReadUntilIncluding(Field field) {
- ReadUntilExcluding(static_cast<Field>(static_cast<int>(field) + 1));
- }
-
- void ReadUntilExcluding(Field field);
-
- void SetNext(Field field) { next_read_ = field; }
- void SetJustRead(Field field) { next_read_ = field + 1; }
-
- TokenPosition position_;
- TokenPosition end_position_;
- AsyncMarker async_marker_;
- AsyncMarker dart_async_marker_;
- intptr_t total_parameter_count_;
- intptr_t required_parameter_count_;
-
- private:
- KernelReaderHelper* helper_;
- intptr_t next_read_;
-};
-
-class TypeParameterHelper {
- public:
- enum Field {
- kStart, // tag.
- kFlags,
- kAnnotations,
- kName,
- kBound,
- kDefaultType,
- kEnd,
- };
-
- enum Flag {
- kIsGenericCovariantImpl = 1 << 0,
- };
-
- explicit TypeParameterHelper(KernelReaderHelper* helper) {
- helper_ = helper;
- next_read_ = kStart;
- }
-
- void ReadUntilIncluding(Field field) {
- ReadUntilExcluding(static_cast<Field>(static_cast<int>(field) + 1));
- }
-
- void ReadUntilExcluding(Field field);
-
- void SetNext(Field field) { next_read_ = field; }
- void SetJustRead(Field field) { next_read_ = field + 1; }
-
- void ReadUntilExcludingAndSetJustRead(Field field) {
- ReadUntilExcluding(field);
- SetJustRead(field);
- }
-
- void Finish() { ReadUntilExcluding(kEnd); }
-
- bool IsGenericCovariantImpl() {
- return (flags_ & kIsGenericCovariantImpl) != 0;
- }
-
- TokenPosition position_;
- uint8_t flags_;
- StringIndex name_index_;
-
- private:
- KernelReaderHelper* helper_;
- intptr_t next_read_;
-};
-
-// Helper class that reads a kernel VariableDeclaration from binary.
-//
-// Use ReadUntilExcluding to read up to but not including a field.
-// One can then for instance read the field from the call-site (and remember to
-// call SetAt to inform this helper class), and then use this to read more.
-// Simple fields are stored (e.g. integers) and can be fetched from this class.
-// If asked to read a compound field (e.g. an expression) it will be skipped.
-class VariableDeclarationHelper {
- public:
- enum Field {
- kPosition,
- kEqualPosition,
- kAnnotations,
- kFlags,
- kNameIndex,
- kType,
- kInitializer,
- kEnd,
- };
-
- enum Flag {
- kFinal = 1 << 0,
- kConst = 1 << 1,
- kCovariant = 1 << 3,
- kIsGenericCovariantImpl = 1 << 5,
- };
-
- explicit VariableDeclarationHelper(KernelReaderHelper* helper)
- : helper_(helper), next_read_(kPosition) {}
-
- void ReadUntilIncluding(Field field) {
- ReadUntilExcluding(static_cast<Field>(static_cast<int>(field) + 1));
- }
-
- void ReadUntilExcluding(Field field);
-
- void SetNext(Field field) { next_read_ = field; }
- void SetJustRead(Field field) { next_read_ = field + 1; }
-
- bool IsConst() { return (flags_ & kConst) != 0; }
- bool IsFinal() { return (flags_ & kFinal) != 0; }
- bool IsCovariant() { return (flags_ & kCovariant) != 0; }
-
- bool IsGenericCovariantImpl() {
- return (flags_ & kIsGenericCovariantImpl) != 0;
- }
-
- TokenPosition position_;
- TokenPosition equals_position_;
- uint8_t flags_;
- StringIndex name_index_;
-
- private:
- KernelReaderHelper* helper_;
- intptr_t next_read_;
-};
-
-// Helper class that reads a kernel Field from binary.
-//
-// Use ReadUntilExcluding to read up to but not including a field.
-// One can then for instance read the field from the call-site (and remember to
-// call SetAt to inform this helper class), and then use this to read more.
-// Simple fields are stored (e.g. integers) and can be fetched from this class.
-// If asked to read a compound field (e.g. an expression) it will be skipped.
-class FieldHelper {
- public:
- enum Field {
- kStart, // tag.
- kCanonicalName,
- kSourceUriIndex,
- kPosition,
- kEndPosition,
- kFlags,
- kName,
- kAnnotations,
- kType,
- kInitializer,
- kEnd,
- };
-
- enum Flag {
- kFinal = 1 << 0,
- kConst = 1 << 1,
- kStatic = 1 << 2,
- kIsCovariant = 1 << 5,
- kIsGenericCovariantImpl = 1 << 6,
- };
-
- explicit FieldHelper(KernelReaderHelper* helper)
- : helper_(helper),
- next_read_(kStart),
- has_function_literal_initializer_(false) {}
-
- FieldHelper(KernelReaderHelper* helper, intptr_t offset);
-
- void ReadUntilIncluding(Field field) {
- ReadUntilExcluding(static_cast<Field>(static_cast<int>(field) + 1));
- }
-
- void ReadUntilExcluding(Field field,
- bool detect_function_literal_initializer = false);
-
- void SetNext(Field field) { next_read_ = field; }
- void SetJustRead(Field field) { next_read_ = field + 1; }
-
- bool IsConst() { return (flags_ & kConst) != 0; }
- bool IsFinal() { return (flags_ & kFinal) != 0; }
- bool IsStatic() { return (flags_ & kStatic) != 0; }
- bool IsCovariant() const { return (flags_ & kIsCovariant) != 0; }
- bool IsGenericCovariantImpl() {
- return (flags_ & kIsGenericCovariantImpl) != 0;
- }
-
- bool FieldHasFunctionLiteralInitializer(TokenPosition* start,
- TokenPosition* end) {
- if (has_function_literal_initializer_) {
- *start = function_literal_start_;
- *end = function_literal_end_;
- }
- return has_function_literal_initializer_;
- }
-
- NameIndex canonical_name_;
- TokenPosition position_;
- TokenPosition end_position_;
- uint8_t flags_;
- intptr_t source_uri_index_;
- intptr_t annotation_count_;
-
- private:
- KernelReaderHelper* helper_;
- intptr_t next_read_;
-
- bool has_function_literal_initializer_;
- TokenPosition function_literal_start_;
- TokenPosition function_literal_end_;
-};
-
-// Helper class that reads a kernel Procedure from binary.
-//
-// Use ReadUntilExcluding to read up to but not including a field.
-// One can then for instance read the field from the call-site (and remember to
-// call SetAt to inform this helper class), and then use this to read more.
-// Simple fields are stored (e.g. integers) and can be fetched from this class.
-// If asked to read a compound field (e.g. an expression) it will be skipped.
-class ProcedureHelper {
- public:
- enum Field {
- kStart, // tag.
- kCanonicalName,
- kSourceUriIndex,
- kStartPosition,
- kPosition,
- kEndPosition,
- kKind,
- kFlags,
- kName,
- kAnnotations,
- kForwardingStubSuperTarget,
- kForwardingStubInterfaceTarget,
- kFunction,
- kEnd,
- };
-
- enum Kind {
- kMethod,
- kGetter,
- kSetter,
- kOperator,
- kFactory,
- };
-
- enum Flag {
- kStatic = 1 << 0,
- kAbstract = 1 << 1,
- kExternal = 1 << 2,
- kConst = 1 << 3, // Only for external const factories.
- kForwardingStub = 1 << 4,
-
- // TODO(29841): Remove this line after the issue is resolved.
- kRedirectingFactoryConstructor = 1 << 6,
- kNoSuchMethodForwarder = 1 << 7,
- };
-
- explicit ProcedureHelper(KernelReaderHelper* helper)
- : helper_(helper), next_read_(kStart) {}
-
- void ReadUntilIncluding(Field field) {
- ReadUntilExcluding(static_cast<Field>(static_cast<int>(field) + 1));
- }
-
- void ReadUntilExcluding(Field field);
-
- void SetNext(Field field) { next_read_ = field; }
- void SetJustRead(Field field) { next_read_ = field + 1; }
-
- bool IsStatic() { return (flags_ & kStatic) != 0; }
- bool IsAbstract() { return (flags_ & kAbstract) != 0; }
- bool IsExternal() { return (flags_ & kExternal) != 0; }
- bool IsConst() { return (flags_ & kConst) != 0; }
- bool IsForwardingStub() { return (flags_ & kForwardingStub) != 0; }
- bool IsRedirectingFactoryConstructor() {
- return (flags_ & kRedirectingFactoryConstructor) != 0;
- }
-
- NameIndex canonical_name_;
- TokenPosition start_position_;
- TokenPosition position_;
- TokenPosition end_position_;
- Kind kind_;
- uint8_t flags_;
- intptr_t source_uri_index_;
- intptr_t annotation_count_;
-
- // Only valid if the 'isForwardingStub' flag is set.
- NameIndex forwarding_stub_super_target_;
-
- private:
- KernelReaderHelper* helper_;
- intptr_t next_read_;
-};
-
-// Helper class that reads a kernel Constructor from binary.
-//
-// Use ReadUntilExcluding to read up to but not including a field.
-// One can then for instance read the field from the call-site (and remember to
-// call SetAt to inform this helper class), and then use this to read more.
-// Simple fields are stored (e.g. integers) and can be fetched from this class.
-// If asked to read a compound field (e.g. an expression) it will be skipped.
-class ConstructorHelper {
- public:
- enum Field {
- kStart, // tag.
- kCanonicalName,
- kSourceUriIndex,
- kStartPosition,
- kPosition,
- kEndPosition,
- kFlags,
- kName,
- kAnnotations,
- kFunction,
- kInitializers,
- kEnd,
- };
-
- enum Flag {
- kConst = 1 << 0,
- kExternal = 1 << 1,
- kSynthetic = 1 << 2,
- };
-
- explicit ConstructorHelper(KernelReaderHelper* helper)
- : helper_(helper), next_read_(kStart) {}
-
- void ReadUntilIncluding(Field field) {
- ReadUntilExcluding(static_cast<Field>(static_cast<int>(field) + 1));
- }
-
- void ReadUntilExcluding(Field field);
-
- void SetNext(Field field) { next_read_ = field; }
- void SetJustRead(Field field) { next_read_ = field + 1; }
-
- bool IsExternal() { return (flags_ & kExternal) != 0; }
- bool IsConst() { return (flags_ & kConst) != 0; }
- bool IsSynthetic() { return (flags_ & kSynthetic) != 0; }
-
- NameIndex canonical_name_;
- TokenPosition start_position_;
- TokenPosition position_;
- TokenPosition end_position_;
- uint8_t flags_;
- intptr_t source_uri_index_;
- intptr_t annotation_count_;
-
- private:
- KernelReaderHelper* helper_;
- intptr_t next_read_;
-};
-
-// Helper class that reads a kernel Class from binary.
-//
-// Use ReadUntilExcluding to read up to but not including a field.
-// One can then for instance read the field from the call-site (and remember to
-// call SetAt to inform this helper class), and then use this to read more.
-// Simple fields are stored (e.g. integers) and can be fetched from this class.
-// If asked to read a compound field (e.g. an expression) it will be skipped.
-class ClassHelper {
- public:
- enum Field {
- kStart, // tag.
- kCanonicalName,
- kSourceUriIndex,
- kStartPosition,
- kPosition,
- kEndPosition,
- kFlags,
- kNameIndex,
- kAnnotations,
- kTypeParameters,
- kSuperClass,
- kMixinType,
- kImplementedClasses,
- kFields,
- kConstructors,
- kProcedures,
- kClassIndex,
- kEnd,
- };
-
- enum Flag {
- kIsAbstract = 1 << 2,
- kIsEnumClass = 1 << 3,
- kIsAnonymousMixin = 1 << 4,
- kIsEliminatedMixin = 1 << 5,
- };
-
- explicit ClassHelper(KernelReaderHelper* helper)
- : helper_(helper), next_read_(kStart) {}
-
- void ReadUntilIncluding(Field field) {
- ReadUntilExcluding(static_cast<Field>(static_cast<int>(field) + 1));
- }
-
- void ReadUntilExcluding(Field field);
-
- void SetNext(Field field) { next_read_ = field; }
- void SetJustRead(Field field) { next_read_ = field + 1; }
-
- bool is_abstract() const { return flags_ & Flag::kIsAbstract; }
-
- bool is_enum_class() const { return flags_ & Flag::kIsEnumClass; }
-
- bool is_transformed_mixin_application() const {
- return flags_ & Flag::kIsEliminatedMixin;
- }
-
- NameIndex canonical_name_;
- TokenPosition start_position_;
- TokenPosition position_;
- TokenPosition end_position_;
- StringIndex name_index_;
- intptr_t source_uri_index_;
- intptr_t annotation_count_;
- intptr_t procedure_count_;
- uint8_t flags_;
-
- private:
- KernelReaderHelper* helper_;
- intptr_t next_read_;
-};
-
-// Helper class that reads a kernel Library from binary.
-//
-// Use ReadUntilExcluding to read up to but not including a field.
-// One can then for instance read the field from the call-site (and remember to
-// call SetAt to inform this helper class), and then use this to read more.
-// Simple fields are stored (e.g. integers) and can be fetched from this class.
-// If asked to read a compound field (e.g. an expression) it will be skipped.
-class LibraryHelper {
- public:
- enum Field {
- kFlags,
- kCanonicalName,
- kName,
- kSourceUriIndex,
- kAnnotations,
- kDependencies,
- kAdditionalExports,
- kParts,
- kTypedefs,
- kClasses,
- kToplevelField,
- kToplevelProcedures,
- kLibraryIndex,
- kEnd,
- };
-
- enum Flag {
- kExternal = 1,
- };
-
- explicit LibraryHelper(KernelReaderHelper* helper)
- : helper_(helper), next_read_(kFlags) {}
-
- void ReadUntilIncluding(Field field) {
- ReadUntilExcluding(static_cast<Field>(static_cast<int>(field) + 1));
- }
-
- void ReadUntilExcluding(Field field);
-
- void SetNext(Field field) { next_read_ = field; }
- void SetJustRead(Field field) { next_read_ = field + 1; }
-
- bool IsExternal() const { return (flags_ & kExternal) != 0; }
-
- uint8_t flags_;
- NameIndex canonical_name_;
- StringIndex name_index_;
- intptr_t source_uri_index_;
- intptr_t class_count_;
- intptr_t procedure_count_;
-
- private:
- KernelReaderHelper* helper_;
- intptr_t next_read_;
-};
-
-class LibraryDependencyHelper {
- public:
- enum Field {
- kFileOffset,
- kFlags,
- kAnnotations,
- kTargetLibrary,
- kName,
- kCombinators,
- kEnd,
- };
-
- enum Flag {
- Export = 1 << 0,
- Deferred = 1 << 1,
- };
-
- enum CombinatorFlag {
- Show = 1 << 0,
- };
-
- explicit LibraryDependencyHelper(KernelReaderHelper* helper)
- : helper_(helper), next_read_(kFileOffset) {}
-
- void ReadUntilIncluding(Field field) {
- ReadUntilExcluding(static_cast<Field>(static_cast<int>(field) + 1));
- }
-
- void ReadUntilExcluding(Field field);
-
- uint8_t flags_;
- StringIndex name_index_;
- NameIndex target_library_canonical_name_;
-
- private:
- KernelReaderHelper* helper_;
- intptr_t next_read_;
-};
-
-// Base class for helpers accessing metadata of a certain kind.
-// Assumes that metadata is accessed in linear order.
-class MetadataHelper {
- public:
- explicit MetadataHelper(StreamingFlowGraphBuilder* builder);
-
- void SetMetadataMappings(intptr_t mappings_offset, intptr_t mappings_num);
-
- protected:
- // Look for metadata mapping with node offset greater or equal than the given.
- intptr_t FindMetadataMapping(intptr_t node_offset);
-
- // Return offset of the metadata payload corresponding to the given node,
- // or -1 if there is no metadata.
- // Assumes metadata is accesses for nodes in linear order most of the time.
- intptr_t GetNextMetadataPayloadOffset(intptr_t node_offset);
-
- StreamingFlowGraphBuilder* builder_;
- TranslationHelper& translation_helper_;
-
- private:
- intptr_t mappings_offset_;
- intptr_t mappings_num_;
- intptr_t last_node_offset_;
- intptr_t last_mapping_index_;
-};
+class TypeTranslator;
struct DirectCallMetadata {
DirectCallMetadata(const Function& target, bool check_receiver_for_null)
@@ -616,8 +31,7 @@
public:
static const char* tag() { return "vm.direct-call.metadata"; }
- explicit DirectCallMetadataHelper(StreamingFlowGraphBuilder* builder)
- : MetadataHelper(builder) {}
+ explicit DirectCallMetadataHelper(KernelReaderHelper* helper);
DirectCallMetadata GetDirectTargetForPropertyGet(intptr_t node_offset);
DirectCallMetadata GetDirectTargetForPropertySet(intptr_t node_offset);
@@ -644,8 +58,7 @@
public:
static const char* tag() { return "vm.inferred-type.metadata"; }
- explicit InferredTypeMetadataHelper(StreamingFlowGraphBuilder* builder)
- : MetadataHelper(builder) {}
+ explicit InferredTypeMetadataHelper(KernelReaderHelper* helper);
InferredTypeMetadata GetInferredType(intptr_t node_offset);
};
@@ -667,8 +80,7 @@
public:
static const char* tag() { return "vm.procedure-attributes.metadata"; }
- explicit ProcedureAttributesMetadataHelper(StreamingFlowGraphBuilder* builder)
- : MetadataHelper(builder) {}
+ explicit ProcedureAttributesMetadataHelper(KernelReaderHelper* helper);
ProcedureAttributesMetadata GetProcedureAttributes(intptr_t node_offset);
@@ -677,15 +89,17 @@
ProcedureAttributesMetadata* metadata);
};
+#if defined(DART_USE_INTERPRETER)
+
// Helper class which provides access to bytecode metadata.
class BytecodeMetadataHelper : public MetadataHelper {
public:
static const char* tag() { return "vm.bytecode"; }
- explicit BytecodeMetadataHelper(StreamingFlowGraphBuilder* builder)
- : MetadataHelper(builder) {}
+ explicit BytecodeMetadataHelper(KernelReaderHelper* helper,
+ TypeTranslator* type_translator,
+ ActiveClass* active_class);
-#if defined(DART_USE_INTERPRETER)
void ReadMetadata(const Function& function);
private:
@@ -698,13 +112,18 @@
void ReadExceptionsTable(const Code& bytecode);
RawTypedData* NativeEntry(const Function& function,
const String& external_name);
-#endif
+
+ TypeTranslator& type_translator_;
+ ActiveClass* const active_class_;
};
-class StreamingDartTypeTranslator {
+#endif // defined(DART_USE_INTERPRETER)
+
+class TypeTranslator {
public:
- StreamingDartTypeTranslator(StreamingFlowGraphBuilder* builder,
- bool finalize = false);
+ TypeTranslator(KernelReaderHelper* helper,
+ ActiveClass* active_class,
+ bool finalize = false);
// Can return a malformed type.
AbstractType& BuildType();
@@ -723,6 +142,11 @@
const Class& receiver_class,
intptr_t length);
+ void LoadAndSetupTypeParameters(ActiveClass* active_class,
+ const Object& set_on,
+ intptr_t type_parameter_count,
+ const Function& parameterized_function);
+
const Type& ReceiverType(const Class& klass);
private:
@@ -734,8 +158,7 @@
class TypeParameterScope {
public:
- TypeParameterScope(StreamingDartTypeTranslator* translator,
- intptr_t parameter_count)
+ TypeParameterScope(TypeTranslator* translator, intptr_t parameter_count)
: parameter_count_(parameter_count),
outer_(translator->type_parameter_scope_),
translator_(translator) {
@@ -756,10 +179,10 @@
intptr_t parameter_count_;
intptr_t outer_parameter_count_;
TypeParameterScope* outer_;
- StreamingDartTypeTranslator* translator_;
+ TypeTranslator* translator_;
};
- StreamingFlowGraphBuilder* builder_;
+ KernelReaderHelper* helper_;
TranslationHelper& translation_helper_;
ActiveClass* const active_class_;
TypeParameterScope* type_parameter_scope_;
@@ -907,7 +330,7 @@
TokenPosition first_body_token_position_;
StreamingFlowGraphBuilder* builder_;
- StreamingDartTypeTranslator type_translator_;
+ TypeTranslator type_translator_;
};
// There are several cases when we are compiling constant expressions:
@@ -1013,140 +436,12 @@
Isolate* isolate_;
Zone* zone_;
TranslationHelper& translation_helper_;
- StreamingDartTypeTranslator& type_translator_;
+ TypeTranslator& type_translator_;
const Script& script_;
Instance& result_;
};
-class KernelReaderHelper {
- public:
- KernelReaderHelper(Zone* zone,
- TranslationHelper* translation_helper,
- const Script& script,
- const ExternalTypedData& data,
- intptr_t data_program_offset)
- : zone_(zone),
- translation_helper_(*translation_helper),
- reader_(data),
- script_(script),
- data_program_offset_(data_program_offset) {}
-
- KernelReaderHelper(Zone* zone,
- TranslationHelper* translation_helper,
- const uint8_t* data_buffer,
- intptr_t buffer_length,
- intptr_t data_program_offset)
- : zone_(zone),
- translation_helper_(*translation_helper),
- reader_(data_buffer, buffer_length),
- script_(Script::Handle(zone_)),
- data_program_offset_(data_program_offset) {}
-
- virtual ~KernelReaderHelper() {}
-
- void SetOffset(intptr_t offset);
-
- intptr_t ReadListLength();
- virtual void ReportUnexpectedTag(const char* variant, Tag tag);
-
- protected:
- const Script& script() const { return script_; }
-
- virtual void set_current_script_id(intptr_t id) {
- // Do nothing by default. This is overridden in StreamingFlowGraphBuilder.
- USE(id);
- }
-
- virtual void RecordYieldPosition(TokenPosition position) {
- // Do nothing by default. This is overridden in StreamingFlowGraphBuilder.
- USE(position);
- }
-
- virtual void RecordTokenPosition(TokenPosition position) {
- // Do nothing by default. This is overridden in StreamingFlowGraphBuilder.
- USE(position);
- }
-
- intptr_t ReaderOffset() const;
- void SkipBytes(intptr_t skip);
- bool ReadBool();
- uint8_t ReadByte();
- uint32_t ReadUInt();
- uint32_t ReadUInt32();
- uint32_t PeekUInt();
- double ReadDouble();
- uint32_t PeekListLength();
- StringIndex ReadStringReference();
- NameIndex ReadCanonicalNameReference();
- StringIndex ReadNameAsStringIndex();
- const String& ReadNameAsMethodName();
- const String& ReadNameAsGetterName();
- const String& ReadNameAsSetterName();
- const String& ReadNameAsFieldName();
- void SkipFlags();
- void SkipStringReference();
- void SkipConstantReference();
- void SkipCanonicalNameReference();
- void SkipDartType();
- void SkipOptionalDartType();
- void SkipInterfaceType(bool simple);
- void SkipFunctionType(bool simple);
- void SkipStatementList();
- void SkipListOfExpressions();
- void SkipListOfDartTypes();
- void SkipListOfStrings();
- void SkipListOfVariableDeclarations();
- void SkipTypeParametersList();
- void SkipInitializer();
- void SkipExpression();
- void SkipStatement();
- void SkipFunctionNode();
- void SkipName();
- void SkipArguments();
- void SkipVariableDeclaration();
- void SkipLibraryCombinator();
- void SkipLibraryDependency();
- void SkipLibraryPart();
- void SkipLibraryTypedef();
- TokenPosition ReadPosition(bool record = true);
- Tag ReadTag(uint8_t* payload = NULL);
- Tag PeekTag(uint8_t* payload = NULL);
- uint8_t ReadFlags() { return reader_.ReadFlags(); }
-
- Zone* zone_;
- TranslationHelper& translation_helper_;
- Reader reader_;
- const Script& script_;
- // Some items like variables are specified in the kernel binary as
- // absolute offsets (as in, offsets within the whole kernel program)
- // of their declaration nodes. Hence, to cache and/or access them
- // uniquely from within a function's kernel data, we need to
- // add/subtract the offset of the kernel data in the over all
- // kernel program.
- intptr_t data_program_offset_;
-
- friend class ClassHelper;
- friend class ConstantHelper;
- friend class ConstructorHelper;
- friend class DirectCallMetadataHelper;
- friend class ProcedureAttributesMetadataHelper;
- friend class FieldHelper;
- friend class FunctionNodeHelper;
- friend class InferredTypeMetadataHelper;
- friend class KernelLoader;
- friend class LibraryDependencyHelper;
- friend class LibraryHelper;
- friend class MetadataHelper;
- friend class ProcedureHelper;
- friend class SimpleExpressionConverter;
- friend class StreamingConstantEvaluator;
- friend class StreamingDartTypeTranslator;
- friend class StreamingScopeBuilder;
- friend class VariableDeclarationHelper;
- friend class TypeParameterHelper;
-};
-
class KernelFingerprintHelper : public KernelReaderHelper {
public:
KernelFingerprintHelper(Zone* zone,
@@ -1214,16 +509,18 @@
flow_graph_builder_(flow_graph_builder),
active_class_(&flow_graph_builder->active_class_),
constant_evaluator_(this),
- type_translator_(this, /* finalize= */ true),
+ type_translator_(this, active_class_, /* finalize= */ true),
current_script_id_(-1),
record_for_script_id_(-1),
record_token_positions_into_(NULL),
record_yield_positions_into_(NULL),
+#if defined(DART_USE_INTERPRETER)
+ bytecode_metadata_helper_(this, &type_translator_, active_class_),
+#endif // defined(DART_USE_INTERPRETER)
direct_call_metadata_helper_(this),
inferred_type_metadata_helper_(this),
- procedure_attributes_metadata_helper_(this),
- bytecode_metadata_helper_(this),
- metadata_scanned_(false) {}
+ procedure_attributes_metadata_helper_(this) {
+ }
StreamingFlowGraphBuilder(TranslationHelper* translation_helper,
Zone* zone,
@@ -1239,16 +536,18 @@
flow_graph_builder_(NULL),
active_class_(active_class),
constant_evaluator_(this),
- type_translator_(this, /* finalize= */ true),
+ type_translator_(this, active_class_, /* finalize= */ true),
current_script_id_(-1),
record_for_script_id_(-1),
record_token_positions_into_(NULL),
record_yield_positions_into_(NULL),
+#if defined(DART_USE_INTERPRETER)
+ bytecode_metadata_helper_(this, &type_translator_, active_class_),
+#endif // defined(DART_USE_INTERPRETER)
direct_call_metadata_helper_(this),
inferred_type_metadata_helper_(this),
- procedure_attributes_metadata_helper_(this),
- bytecode_metadata_helper_(this),
- metadata_scanned_(false) {}
+ procedure_attributes_metadata_helper_(this) {
+ }
StreamingFlowGraphBuilder(TranslationHelper* translation_helper,
const Script& script,
@@ -1264,16 +563,18 @@
flow_graph_builder_(NULL),
active_class_(active_class),
constant_evaluator_(this),
- type_translator_(this, /* finalize= */ true),
+ type_translator_(this, active_class_, /* finalize= */ true),
current_script_id_(-1),
record_for_script_id_(-1),
record_token_positions_into_(NULL),
record_yield_positions_into_(NULL),
+#if defined(DART_USE_INTERPRETER)
+ bytecode_metadata_helper_(this, &type_translator_, active_class_),
+#endif // defined(DART_USE_INTERPRETER)
direct_call_metadata_helper_(this),
inferred_type_metadata_helper_(this),
- procedure_attributes_metadata_helper_(this),
- bytecode_metadata_helper_(this),
- metadata_scanned_(false) {}
+ procedure_attributes_metadata_helper_(this) {
+ }
virtual ~StreamingFlowGraphBuilder() {}
@@ -1303,11 +604,6 @@
void ReadUntilFunctionNode(ParsedFunction* set_forwarding_stub = NULL);
private:
- void LoadAndSetupTypeParameters(ActiveClass* active_class,
- const Object& set_on,
- intptr_t type_parameter_count,
- const Function& parameterized_function);
-
void DiscoverEnclosingElements(Zone* zone,
const Function& function,
Function* outermost_function);
@@ -1370,8 +666,6 @@
LocalVariable* MakeTemporary();
LocalVariable* LookupVariable(intptr_t kernel_offset);
- RawFunction* LookupMethodByMember(NameIndex target,
- const String& method_name);
Function& FindMatchingFunctionAnyArgs(const Class& klass, const String& name);
Function& FindMatchingFunction(const Class& klass,
const String& name,
@@ -1602,45 +896,27 @@
void RecordTokenPosition(TokenPosition position) override;
void RecordYieldPosition(TokenPosition position) override;
- // Scan through metadata mappings section and cache offsets for recognized
- // metadata kinds.
- void EnsureMetadataIsScanned();
-
FlowGraphBuilder* flow_graph_builder_;
ActiveClass* const active_class_;
StreamingConstantEvaluator constant_evaluator_;
- StreamingDartTypeTranslator type_translator_;
+ TypeTranslator type_translator_;
intptr_t current_script_id_;
intptr_t record_for_script_id_;
GrowableArray<intptr_t>* record_token_positions_into_;
GrowableArray<intptr_t>* record_yield_positions_into_;
+#if defined(DART_USE_INTERPRETER)
+ BytecodeMetadataHelper bytecode_metadata_helper_;
+#endif // defined(DART_USE_INTERPRETER)
DirectCallMetadataHelper direct_call_metadata_helper_;
InferredTypeMetadataHelper inferred_type_metadata_helper_;
ProcedureAttributesMetadataHelper procedure_attributes_metadata_helper_;
- BytecodeMetadataHelper bytecode_metadata_helper_;
- bool metadata_scanned_;
friend class ClassHelper;
friend class ConstantHelper;
- friend class ConstructorHelper;
- friend class DirectCallMetadataHelper;
- friend class ProcedureAttributesMetadataHelper;
- friend class BytecodeMetadataHelper;
- friend class FieldHelper;
- friend class FunctionNodeHelper;
- friend class InferredTypeMetadataHelper;
friend class KernelLoader;
- friend class KernelReaderHelper;
- friend class LibraryDependencyHelper;
- friend class LibraryHelper;
- friend class MetadataHelper;
- friend class ProcedureHelper;
friend class SimpleExpressionConverter;
friend class StreamingConstantEvaluator;
- friend class StreamingDartTypeTranslator;
friend class StreamingScopeBuilder;
- friend class VariableDeclarationHelper;
- friend class TypeParameterHelper;
};
class AlternativeScriptScope {
@@ -1661,63 +937,12 @@
const Script& old_script_;
};
-// A helper class that saves the current reader position, goes to another reader
-// position, and upon destruction, resets to the original reader position.
-class AlternativeReadingScope {
- public:
- AlternativeReadingScope(Reader* reader, intptr_t new_position)
- : reader_(reader),
- saved_size_(reader_->size()),
- saved_raw_buffer_(reader_->raw_buffer()),
- saved_typed_data_(reader_->typed_data()),
- saved_offset_(reader_->offset()) {
- reader_->set_offset(new_position);
- }
-
- AlternativeReadingScope(Reader* reader,
- const ExternalTypedData* new_typed_data,
- intptr_t new_position)
- : reader_(reader),
- saved_size_(reader_->size()),
- saved_raw_buffer_(reader_->raw_buffer()),
- saved_typed_data_(reader_->typed_data()),
- saved_offset_(reader_->offset()) {
- reader_->set_raw_buffer(NULL);
- reader_->set_typed_data(new_typed_data);
- reader_->set_size(new_typed_data->Length());
- reader_->set_offset(new_position);
- }
-
- explicit AlternativeReadingScope(Reader* reader)
- : reader_(reader),
- saved_size_(reader_->size()),
- saved_raw_buffer_(reader_->raw_buffer()),
- saved_typed_data_(reader_->typed_data()),
- saved_offset_(reader_->offset()) {}
-
- ~AlternativeReadingScope() {
- reader_->set_raw_buffer(saved_raw_buffer_);
- reader_->set_typed_data(saved_typed_data_);
- reader_->set_size(saved_size_);
- reader_->set_offset(saved_offset_);
- }
-
- intptr_t saved_offset() { return saved_offset_; }
-
- private:
- Reader* reader_;
- intptr_t saved_size_;
- const uint8_t* saved_raw_buffer_;
- const ExternalTypedData* saved_typed_data_;
- intptr_t saved_offset_;
-};
-
// Helper class that reads a kernel Constant from binary.
class ConstantHelper {
public:
ConstantHelper(ActiveClass* active_class,
StreamingFlowGraphBuilder* builder,
- StreamingDartTypeTranslator* type_translator,
+ TypeTranslator* type_translator,
TranslationHelper* translation_helper,
Zone* zone,
NameIndex skip_vmservice_library)
@@ -1759,7 +984,7 @@
NameIndex skip_vmservice_library_;
ActiveClass* const active_class_;
StreamingFlowGraphBuilder& builder_;
- StreamingDartTypeTranslator& type_translator_;
+ TypeTranslator& type_translator_;
StreamingConstantEvaluator const_evaluator_;
TranslationHelper translation_helper_;
Zone* zone_;
diff --git a/runtime/vm/compiler/frontend/kernel_to_il.cc b/runtime/vm/compiler/frontend/kernel_to_il.cc
index 7d677b5..38bfda8 100644
--- a/runtime/vm/compiler/frontend/kernel_to_il.cc
+++ b/runtime/vm/compiler/frontend/kernel_to_il.cc
@@ -2,14 +2,13 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-#include <set>
-
#include "vm/compiler/aot/precompiler.h"
#include "vm/compiler/frontend/kernel_to_il.h"
#include "vm/compiler/backend/il.h"
#include "vm/compiler/backend/il_printer.h"
#include "vm/compiler/frontend/kernel_binary_flowgraph.h"
+#include "vm/compiler/frontend/kernel_translation_helper.h"
#include "vm/compiler/frontend/prologue_builder.h"
#include "vm/compiler/jit/compiler.h"
#include "vm/kernel_loader.h"
@@ -156,665 +155,6 @@
}
}
-TranslationHelper::TranslationHelper(Thread* thread)
- : thread_(thread),
- zone_(thread->zone()),
- isolate_(thread->isolate()),
- allocation_space_(thread->IsMutatorThread() ? Heap::kNew : Heap::kOld),
- string_offsets_(TypedData::Handle(Z)),
- string_data_(ExternalTypedData::Handle(Z)),
- canonical_names_(TypedData::Handle(Z)),
- metadata_payloads_(ExternalTypedData::Handle(Z)),
- metadata_mappings_(ExternalTypedData::Handle(Z)),
- constants_(Array::Handle(Z)) {}
-
-void TranslationHelper::Reset() {
- string_offsets_ = TypedData::null();
- string_data_ = ExternalTypedData::null();
- canonical_names_ = TypedData::null();
- metadata_payloads_ = ExternalTypedData::null();
- metadata_mappings_ = ExternalTypedData::null();
- constants_ = Array::null();
-}
-
-void TranslationHelper::InitFromScript(const Script& script) {
- const KernelProgramInfo& info =
- KernelProgramInfo::Handle(Z, script.kernel_program_info());
- if (info.IsNull()) {
- // If there is no kernel data associated with the script, then
- // do not bother initializing!.
- // This can happen with few special functions like
- // NoSuchMethodDispatcher and InvokeFieldDispatcher.
- return;
- }
- InitFromKernelProgramInfo(info);
-}
-
-void TranslationHelper::InitFromKernelProgramInfo(
- const KernelProgramInfo& info) {
- SetStringOffsets(TypedData::Handle(Z, info.string_offsets()));
- SetStringData(ExternalTypedData::Handle(Z, info.string_data()));
- SetCanonicalNames(TypedData::Handle(Z, info.canonical_names()));
- SetMetadataPayloads(ExternalTypedData::Handle(Z, info.metadata_payloads()));
- SetMetadataMappings(ExternalTypedData::Handle(Z, info.metadata_mappings()));
- SetConstants(Array::Handle(Z, info.constants()));
-}
-
-void TranslationHelper::SetStringOffsets(const TypedData& string_offsets) {
- ASSERT(string_offsets_.IsNull());
- string_offsets_ = string_offsets.raw();
-}
-
-void TranslationHelper::SetStringData(const ExternalTypedData& string_data) {
- ASSERT(string_data_.IsNull());
- string_data_ = string_data.raw();
-}
-
-void TranslationHelper::SetCanonicalNames(const TypedData& canonical_names) {
- ASSERT(canonical_names_.IsNull());
- canonical_names_ = canonical_names.raw();
-}
-
-void TranslationHelper::SetMetadataPayloads(
- const ExternalTypedData& metadata_payloads) {
- ASSERT(metadata_payloads_.IsNull());
- metadata_payloads_ = metadata_payloads.raw();
-}
-
-void TranslationHelper::SetMetadataMappings(
- const ExternalTypedData& metadata_mappings) {
- ASSERT(metadata_mappings_.IsNull());
- metadata_mappings_ = metadata_mappings.raw();
-}
-
-void TranslationHelper::SetConstants(const Array& constants) {
- ASSERT(constants_.IsNull());
- constants_ = constants.raw();
-}
-
-intptr_t TranslationHelper::StringOffset(StringIndex index) const {
- return string_offsets_.GetUint32(index << 2);
-}
-
-intptr_t TranslationHelper::StringSize(StringIndex index) const {
- return StringOffset(StringIndex(index + 1)) - StringOffset(index);
-}
-
-uint8_t TranslationHelper::CharacterAt(StringIndex string_index,
- intptr_t index) {
- ASSERT(index < StringSize(string_index));
- return string_data_.GetUint8(StringOffset(string_index) + index);
-}
-
-uint8_t* TranslationHelper::StringBuffer(StringIndex string_index) const {
- // Though this implementation appears like it could be replaced by
- // string_data_.DataAddr(StringOffset(string_index)), it can't quite. If the
- // last string in the string table is a zero length string, then the latter
- // expression will try to return the address that is one past the backing
- // store of the string_data_ table. Though this is safe in C++ as long as the
- // address is not dereferenced, it will trigger the assert in
- // ExternalTypedData::DataAddr.
- ASSERT(Thread::Current()->no_safepoint_scope_depth() > 0);
- return reinterpret_cast<uint8_t*>(string_data_.DataAddr(0)) +
- StringOffset(string_index);
-}
-
-bool TranslationHelper::StringEquals(StringIndex string_index,
- const char* other) {
- intptr_t length = strlen(other);
- if (length != StringSize(string_index)) return false;
-
- NoSafepointScope no_safepoint;
- return memcmp(StringBuffer(string_index), other, length) == 0;
-}
-
-NameIndex TranslationHelper::CanonicalNameParent(NameIndex name) {
- // Canonical names are pairs of 4-byte parent and string indexes, so the size
- // of an entry is 8 bytes. The parent is biased: 0 represents the root name
- // and N+1 represents the name with index N.
- return NameIndex(static_cast<intptr_t>(canonical_names_.GetUint32(8 * name)) -
- 1);
-}
-
-StringIndex TranslationHelper::CanonicalNameString(NameIndex name) {
- return StringIndex(canonical_names_.GetUint32((8 * name) + 4));
-}
-
-bool TranslationHelper::IsAdministrative(NameIndex name) {
- // Administrative names start with '@'.
- StringIndex name_string = CanonicalNameString(name);
- return (StringSize(name_string) > 0) && (CharacterAt(name_string, 0) == '@');
-}
-
-bool TranslationHelper::IsPrivate(NameIndex name) {
- // Private names start with '_'.
- StringIndex name_string = CanonicalNameString(name);
- return (StringSize(name_string) > 0) && (CharacterAt(name_string, 0) == '_');
-}
-
-bool TranslationHelper::IsRoot(NameIndex name) {
- return name == -1;
-}
-
-bool TranslationHelper::IsLibrary(NameIndex name) {
- // Libraries are the only canonical names with the root as their parent.
- return !IsRoot(name) && IsRoot(CanonicalNameParent(name));
-}
-
-bool TranslationHelper::IsClass(NameIndex name) {
- // Classes have the library as their parent and are not an administrative
- // name starting with @.
- return !IsAdministrative(name) && !IsRoot(name) &&
- IsLibrary(CanonicalNameParent(name));
-}
-
-bool TranslationHelper::IsMember(NameIndex name) {
- return IsConstructor(name) || IsField(name) || IsProcedure(name);
-}
-
-bool TranslationHelper::IsField(NameIndex name) {
- // Fields with private names have the import URI of the library where they are
- // visible as the parent and the string "@fields" as the parent's parent.
- // Fields with non-private names have the string "@fields' as the parent.
- if (IsRoot(name)) {
- return false;
- }
- NameIndex kind = CanonicalNameParent(name);
- if (IsPrivate(name)) {
- kind = CanonicalNameParent(kind);
- }
- return StringEquals(CanonicalNameString(kind), "@fields");
-}
-
-bool TranslationHelper::IsConstructor(NameIndex name) {
- // Constructors with private names have the import URI of the library where
- // they are visible as the parent and the string "@constructors" as the
- // parent's parent. Constructors with non-private names have the string
- // "@constructors" as the parent.
- if (IsRoot(name)) {
- return false;
- }
- NameIndex kind = CanonicalNameParent(name);
- if (IsPrivate(name)) {
- kind = CanonicalNameParent(kind);
- }
- return StringEquals(CanonicalNameString(kind), "@constructors");
-}
-
-bool TranslationHelper::IsProcedure(NameIndex name) {
- return IsMethod(name) || IsGetter(name) || IsSetter(name) || IsFactory(name);
-}
-
-bool TranslationHelper::IsMethod(NameIndex name) {
- // Methods with private names have the import URI of the library where they
- // are visible as the parent and the string "@methods" as the parent's parent.
- // Methods with non-private names have the string "@methods" as the parent.
- if (IsRoot(name)) {
- return false;
- }
- NameIndex kind = CanonicalNameParent(name);
- if (IsPrivate(name)) {
- kind = CanonicalNameParent(kind);
- }
- return StringEquals(CanonicalNameString(kind), "@methods");
-}
-
-bool TranslationHelper::IsGetter(NameIndex name) {
- // Getters with private names have the import URI of the library where they
- // are visible as the parent and the string "@getters" as the parent's parent.
- // Getters with non-private names have the string "@getters" as the parent.
- if (IsRoot(name)) {
- return false;
- }
- NameIndex kind = CanonicalNameParent(name);
- if (IsPrivate(name)) {
- kind = CanonicalNameParent(kind);
- }
- return StringEquals(CanonicalNameString(kind), "@getters");
-}
-
-bool TranslationHelper::IsSetter(NameIndex name) {
- // Setters with private names have the import URI of the library where they
- // are visible as the parent and the string "@setters" as the parent's parent.
- // Setters with non-private names have the string "@setters" as the parent.
- if (IsRoot(name)) {
- return false;
- }
- NameIndex kind = CanonicalNameParent(name);
- if (IsPrivate(name)) {
- kind = CanonicalNameParent(kind);
- }
- return StringEquals(CanonicalNameString(kind), "@setters");
-}
-
-bool TranslationHelper::IsFactory(NameIndex name) {
- // Factories with private names have the import URI of the library where they
- // are visible as the parent and the string "@factories" as the parent's
- // parent. Factories with non-private names have the string "@factories" as
- // the parent.
- if (IsRoot(name)) {
- return false;
- }
- NameIndex kind = CanonicalNameParent(name);
- if (IsPrivate(name)) {
- kind = CanonicalNameParent(kind);
- }
- return StringEquals(CanonicalNameString(kind), "@factories");
-}
-
-NameIndex TranslationHelper::EnclosingName(NameIndex name) {
- ASSERT(IsField(name) || IsConstructor(name) || IsProcedure(name));
- NameIndex enclosing = CanonicalNameParent(CanonicalNameParent(name));
- if (IsPrivate(name)) {
- enclosing = CanonicalNameParent(enclosing);
- }
- ASSERT(IsLibrary(enclosing) || IsClass(enclosing));
- return enclosing;
-}
-
-RawInstance* TranslationHelper::Canonicalize(const Instance& instance) {
- if (instance.IsNull()) return instance.raw();
-
- const char* error_str = NULL;
- RawInstance* result = instance.CheckAndCanonicalize(thread(), &error_str);
- if (result == Object::null()) {
- ReportError("Invalid const object %s", error_str);
- }
- return result;
-}
-
-const String& TranslationHelper::DartString(const char* content,
- Heap::Space space) {
- return String::ZoneHandle(Z, String::New(content, space));
-}
-
-String& TranslationHelper::DartString(StringIndex string_index,
- Heap::Space space) {
- intptr_t length = StringSize(string_index);
- uint8_t* buffer = Z->Alloc<uint8_t>(length);
- {
- NoSafepointScope no_safepoint;
- memmove(buffer, StringBuffer(string_index), length);
- }
- return String::ZoneHandle(Z, String::FromUTF8(buffer, length, space));
-}
-
-String& TranslationHelper::DartString(const uint8_t* utf8_array,
- intptr_t len,
- Heap::Space space) {
- return String::ZoneHandle(Z, String::FromUTF8(utf8_array, len, space));
-}
-
-const String& TranslationHelper::DartSymbolPlain(const char* content) const {
- return String::ZoneHandle(Z, Symbols::New(thread_, content));
-}
-
-String& TranslationHelper::DartSymbolPlain(StringIndex string_index) const {
- intptr_t length = StringSize(string_index);
- uint8_t* buffer = Z->Alloc<uint8_t>(length);
- {
- NoSafepointScope no_safepoint;
- memmove(buffer, StringBuffer(string_index), length);
- }
- String& result =
- String::ZoneHandle(Z, Symbols::FromUTF8(thread_, buffer, length));
- return result;
-}
-
-const String& TranslationHelper::DartSymbolObfuscate(
- const char* content) const {
- String& result = String::ZoneHandle(Z, Symbols::New(thread_, content));
- if (I->obfuscate()) {
- Obfuscator obfuscator(thread_, String::Handle(Z));
- result = obfuscator.Rename(result, true);
- }
- return result;
-}
-
-String& TranslationHelper::DartSymbolObfuscate(StringIndex string_index) const {
- intptr_t length = StringSize(string_index);
- uint8_t* buffer = Z->Alloc<uint8_t>(length);
- {
- NoSafepointScope no_safepoint;
- memmove(buffer, StringBuffer(string_index), length);
- }
- String& result =
- String::ZoneHandle(Z, Symbols::FromUTF8(thread_, buffer, length));
- if (I->obfuscate()) {
- Obfuscator obfuscator(thread_, String::Handle(Z));
- result = obfuscator.Rename(result, true);
- }
- return result;
-}
-
-String& TranslationHelper::DartIdentifier(const Library& lib,
- StringIndex string_index) {
- String& name = DartString(string_index);
- ManglePrivateName(lib, &name);
- return name;
-}
-
-const String& TranslationHelper::DartClassName(NameIndex kernel_class) {
- ASSERT(IsClass(kernel_class));
- String& name = DartString(CanonicalNameString(kernel_class));
- return ManglePrivateName(CanonicalNameParent(kernel_class), &name);
-}
-
-const String& TranslationHelper::DartConstructorName(NameIndex constructor) {
- ASSERT(IsConstructor(constructor));
- return DartFactoryName(constructor);
-}
-
-const String& TranslationHelper::DartProcedureName(NameIndex procedure) {
- ASSERT(IsProcedure(procedure));
- if (IsSetter(procedure)) {
- return DartSetterName(procedure);
- } else if (IsGetter(procedure)) {
- return DartGetterName(procedure);
- } else if (IsFactory(procedure)) {
- return DartFactoryName(procedure);
- } else {
- return DartMethodName(procedure);
- }
-}
-
-const String& TranslationHelper::DartSetterName(NameIndex setter) {
- return DartSetterName(CanonicalNameParent(setter),
- CanonicalNameString(setter));
-}
-
-const String& TranslationHelper::DartSetterName(NameIndex parent,
- StringIndex setter) {
- // The names flowing into [setter] are coming from the Kernel file:
- // * user-defined setters: `fieldname=`
- // * property-set expressions: `fieldname`
- //
- // The VM uses `get:fieldname` and `set:fieldname`.
- //
- // => In order to be consistent, we remove the `=` always and adopt the VM
- // conventions.
- intptr_t size = StringSize(setter);
- ASSERT(size > 0);
- if (CharacterAt(setter, size - 1) == '=') {
- --size;
- }
- uint8_t* buffer = Z->Alloc<uint8_t>(size);
- {
- NoSafepointScope no_safepoint;
- memmove(buffer, StringBuffer(setter), size);
- }
- String& name =
- String::ZoneHandle(Z, String::FromUTF8(buffer, size, allocation_space_));
- ManglePrivateName(parent, &name);
- name = Field::SetterSymbol(name);
- return name;
-}
-
-const String& TranslationHelper::DartGetterName(NameIndex getter) {
- return DartGetterName(CanonicalNameParent(getter),
- CanonicalNameString(getter));
-}
-
-const String& TranslationHelper::DartGetterName(NameIndex parent,
- StringIndex getter) {
- String& name = DartString(getter);
- ManglePrivateName(parent, &name);
- name = Field::GetterSymbol(name);
- return name;
-}
-
-const String& TranslationHelper::DartFieldName(NameIndex field) {
- return DartFieldName(CanonicalNameParent(field), CanonicalNameString(field));
-}
-
-const String& TranslationHelper::DartFieldName(NameIndex parent,
- StringIndex field) {
- String& name = DartString(field);
- return ManglePrivateName(parent, &name);
-}
-
-const String& TranslationHelper::DartMethodName(NameIndex method) {
- return DartMethodName(CanonicalNameParent(method),
- CanonicalNameString(method));
-}
-
-const String& TranslationHelper::DartMethodName(NameIndex parent,
- StringIndex method) {
- String& name = DartString(method);
- return ManglePrivateName(parent, &name);
-}
-
-const String& TranslationHelper::DartFactoryName(NameIndex factory) {
- ASSERT(IsConstructor(factory) || IsFactory(factory));
- GrowableHandlePtrArray<const String> pieces(Z, 3);
- pieces.Add(DartClassName(EnclosingName(factory)));
- pieces.Add(Symbols::Dot());
- // [DartMethodName] will mangle the name.
- pieces.Add(DartMethodName(factory));
- return String::ZoneHandle(Z, Symbols::FromConcatAll(thread_, pieces));
-}
-
-RawLibrary* TranslationHelper::LookupLibraryByKernelLibrary(
- NameIndex kernel_library) {
- // We only use the string and don't rely on having any particular parent.
- // This ASSERT is just a sanity check.
- ASSERT(IsLibrary(kernel_library) ||
- IsAdministrative(CanonicalNameParent(kernel_library)));
- const String& library_name =
- DartSymbolPlain(CanonicalNameString(kernel_library));
- ASSERT(!library_name.IsNull());
- RawLibrary* library = Library::LookupLibrary(thread_, library_name);
- ASSERT(library != Object::null());
- return library;
-}
-
-RawClass* TranslationHelper::LookupClassByKernelClass(NameIndex kernel_class) {
- ASSERT(IsClass(kernel_class));
- const String& class_name = DartClassName(kernel_class);
- NameIndex kernel_library = CanonicalNameParent(kernel_class);
- Library& library =
- Library::Handle(Z, LookupLibraryByKernelLibrary(kernel_library));
- RawClass* klass = library.LookupClassAllowPrivate(class_name);
-
- ASSERT(klass != Object::null());
- return klass;
-}
-
-RawField* TranslationHelper::LookupFieldByKernelField(NameIndex kernel_field) {
- ASSERT(IsField(kernel_field));
- NameIndex enclosing = EnclosingName(kernel_field);
-
- Class& klass = Class::Handle(Z);
- if (IsLibrary(enclosing)) {
- Library& library =
- Library::Handle(Z, LookupLibraryByKernelLibrary(enclosing));
- klass = library.toplevel_class();
- } else {
- ASSERT(IsClass(enclosing));
- klass = LookupClassByKernelClass(enclosing);
- }
- RawField* field = klass.LookupFieldAllowPrivate(
- DartSymbolObfuscate(CanonicalNameString(kernel_field)));
- ASSERT(field != Object::null());
- return field;
-}
-
-RawFunction* TranslationHelper::LookupStaticMethodByKernelProcedure(
- NameIndex procedure) {
- const String& procedure_name = DartProcedureName(procedure);
-
- // The parent is either a library or a class (in which case the procedure is a
- // static method).
- NameIndex enclosing = EnclosingName(procedure);
- if (IsLibrary(enclosing)) {
- Library& library =
- Library::Handle(Z, LookupLibraryByKernelLibrary(enclosing));
- RawFunction* function = library.LookupFunctionAllowPrivate(procedure_name);
- ASSERT(function != Object::null());
- return function;
- } else {
- ASSERT(IsClass(enclosing));
- Class& klass = Class::Handle(Z, LookupClassByKernelClass(enclosing));
- Function& function = Function::ZoneHandle(
- Z, klass.LookupFunctionAllowPrivate(procedure_name));
- ASSERT(!function.IsNull());
-
- // TODO(27590): We can probably get rid of this after no longer using
- // core libraries from the source.
- if (function.IsRedirectingFactory()) {
- ClassFinalizer::ResolveRedirectingFactory(klass, function);
- function = function.RedirectionTarget();
- }
- return function.raw();
- }
-}
-
-RawFunction* TranslationHelper::LookupConstructorByKernelConstructor(
- NameIndex constructor) {
- ASSERT(IsConstructor(constructor));
- Class& klass =
- Class::Handle(Z, LookupClassByKernelClass(EnclosingName(constructor)));
- return LookupConstructorByKernelConstructor(klass, constructor);
-}
-
-RawFunction* TranslationHelper::LookupConstructorByKernelConstructor(
- const Class& owner,
- NameIndex constructor) {
- ASSERT(IsConstructor(constructor));
- RawFunction* function =
- owner.LookupConstructorAllowPrivate(DartConstructorName(constructor));
- ASSERT(function != Object::null());
- return function;
-}
-
-RawFunction* TranslationHelper::LookupConstructorByKernelConstructor(
- const Class& owner,
- StringIndex constructor_name) {
- GrowableHandlePtrArray<const String> pieces(Z, 3);
- pieces.Add(DartString(String::Handle(owner.Name()).ToCString(), Heap::kOld));
- pieces.Add(Symbols::Dot());
- String& name = DartString(constructor_name);
- pieces.Add(ManglePrivateName(Library::Handle(owner.library()), &name));
-
- String& new_name =
- String::ZoneHandle(Z, Symbols::FromConcatAll(thread_, pieces));
- RawFunction* function = owner.LookupConstructorAllowPrivate(new_name);
- ASSERT(function != Object::null());
- return function;
-}
-
-Type& TranslationHelper::GetCanonicalType(const Class& klass) {
- ASSERT(!klass.IsNull());
- // Note that if cls is _Closure, the returned type will be _Closure,
- // and not the signature type.
- Type& type = Type::ZoneHandle(Z, klass.CanonicalType());
- if (!type.IsNull()) {
- return type;
- }
- type = Type::New(klass, TypeArguments::Handle(Z, klass.type_parameters()),
- klass.token_pos());
- if (klass.is_type_finalized()) {
- type ^= ClassFinalizer::FinalizeType(klass, type);
- // Note that the receiver type may now be a malbounded type.
- klass.SetCanonicalType(type);
- }
- return type;
-}
-
-void TranslationHelper::ReportError(const char* format, ...) {
- const Script& null_script = Script::Handle(Z);
-
- va_list args;
- va_start(args, format);
- Report::MessageV(Report::kError, null_script, TokenPosition::kNoSource,
- Report::AtLocation, format, args);
- va_end(args);
- UNREACHABLE();
-}
-
-void TranslationHelper::ReportError(const Script& script,
- const TokenPosition position,
- const char* format,
- ...) {
- va_list args;
- va_start(args, format);
- Report::MessageV(Report::kError, script, position, Report::AtLocation, format,
- args);
- va_end(args);
- UNREACHABLE();
-}
-
-void TranslationHelper::ReportError(const Error& prev_error,
- const char* format,
- ...) {
- const Script& null_script = Script::Handle(Z);
-
- va_list args;
- va_start(args, format);
- Report::LongJumpV(prev_error, null_script, TokenPosition::kNoSource, format,
- args);
- va_end(args);
- UNREACHABLE();
-}
-
-void TranslationHelper::ReportError(const Error& prev_error,
- const Script& script,
- const TokenPosition position,
- const char* format,
- ...) {
- va_list args;
- va_start(args, format);
- Report::LongJumpV(prev_error, script, position, format, args);
- va_end(args);
- UNREACHABLE();
-}
-
-String& TranslationHelper::ManglePrivateName(NameIndex parent,
- String* name_to_modify,
- bool symbolize,
- bool obfuscate) {
- if (name_to_modify->Length() >= 1 && name_to_modify->CharAt(0) == '_') {
- const Library& library =
- Library::Handle(Z, LookupLibraryByKernelLibrary(parent));
- *name_to_modify = library.PrivateName(*name_to_modify);
- if (obfuscate && I->obfuscate()) {
- const String& library_key = String::Handle(library.private_key());
- Obfuscator obfuscator(thread_, library_key);
- *name_to_modify = obfuscator.Rename(*name_to_modify);
- }
- } else if (symbolize) {
- *name_to_modify = Symbols::New(thread_, *name_to_modify);
- if (obfuscate && I->obfuscate()) {
- const String& library_key = String::Handle();
- Obfuscator obfuscator(thread_, library_key);
- *name_to_modify = obfuscator.Rename(*name_to_modify);
- }
- }
- return *name_to_modify;
-}
-
-String& TranslationHelper::ManglePrivateName(const Library& library,
- String* name_to_modify,
- bool symbolize,
- bool obfuscate) {
- if (name_to_modify->Length() >= 1 && name_to_modify->CharAt(0) == '_') {
- *name_to_modify = library.PrivateName(*name_to_modify);
- if (obfuscate && I->obfuscate()) {
- const String& library_key = String::Handle(library.private_key());
- Obfuscator obfuscator(thread_, library_key);
- *name_to_modify = obfuscator.Rename(*name_to_modify);
- }
- } else if (symbolize) {
- *name_to_modify = Symbols::New(thread_, *name_to_modify);
- if (obfuscate && I->obfuscate()) {
- const String& library_key = String::Handle();
- Obfuscator obfuscator(thread_, library_key);
- *name_to_modify = obfuscator.Rename(*name_to_modify);
- }
- }
- return *name_to_modify;
-}
-
FlowGraphBuilder::FlowGraphBuilder(
intptr_t kernel_offset,
ParsedFunction* parsed_function,
@@ -997,12 +337,9 @@
} else if (scopes_->this_variable != NULL &&
active_class_.ClassNumTypeArguments() > 0) {
ASSERT(!parsed_function_->function().IsFactory());
- intptr_t type_arguments_field_offset =
- active_class_.klass->type_arguments_field_offset();
- ASSERT(type_arguments_field_offset != Class::kNoTypeArguments);
-
instructions += LoadLocal(scopes_->this_variable);
- instructions += LoadField(type_arguments_field_offset);
+ instructions += LoadNativeField(
+ NativeFieldDesc::GetTypeArgumentsFieldFor(Z, *active_class_.klass));
} else {
instructions += NullConstant();
}
@@ -1390,7 +727,7 @@
TargetEntryInstr* neq_entry;
test += LoadArgDescriptor();
- test += LoadField(ArgumentsDescriptor::type_args_len_offset());
+ test += LoadNativeField(NativeFieldDesc::ArgumentsDescriptor_type_args_len());
test += IntConstant(num_type_args);
test += BranchIfEqual(&eq_entry, &neq_entry);
@@ -1514,16 +851,10 @@
return Fragment(instr);
}
-Fragment FlowGraphBuilder::LoadNativeField(MethodRecognizer::Kind kind,
- intptr_t offset,
- const Type& type,
- intptr_t class_id,
- bool is_immutable) {
+Fragment BaseFlowGraphBuilder::LoadNativeField(
+ const NativeFieldDesc* native_field) {
LoadFieldInstr* load =
- new (Z) LoadFieldInstr(Pop(), offset, type, TokenPosition::kNoSource);
- load->set_recognized_kind(kind);
- load->set_result_cid(class_id);
- load->set_is_immutable(is_immutable);
+ new (Z) LoadFieldInstr(Pop(), native_field, TokenPosition::kNoSource);
Push(load);
return Fragment(load);
}
@@ -1943,22 +1274,6 @@
return instructions;
}
-RawFunction* FlowGraphBuilder::LookupMethodByMember(NameIndex target,
- const String& method_name) {
- NameIndex kernel_class = H.EnclosingName(target);
- Class& klass = Class::Handle(Z, H.LookupClassByKernelClass(kernel_class));
-
- RawFunction* function = klass.LookupFunctionAllowPrivate(method_name);
-#ifdef DEBUG
- if (function == Object::null()) {
- THR_Print("Unable to find \'%s\' in %s\n", method_name.ToCString(),
- klass.ToCString());
- }
-#endif
- ASSERT(function != Object::null());
- return function;
-}
-
LocalVariable* BaseFlowGraphBuilder::MakeTemporary() {
char name[64];
intptr_t index = stack_->definition()->temp_index();
@@ -2125,10 +1440,7 @@
case MethodRecognizer::kStringBaseLength:
case MethodRecognizer::kStringBaseIsEmpty:
body += LoadLocal(scopes_->this_variable);
- body += LoadNativeField(MethodRecognizer::kStringBaseLength,
- String::length_offset(),
- Type::ZoneHandle(Z, Type::SmiType()), kSmiCid,
- /* is_immutable = */ true);
+ body += LoadNativeField(NativeFieldDesc::String_length());
if (kind == MethodRecognizer::kStringBaseIsEmpty) {
body += IntConstant(0);
body += StrictCompare(Token::kEQ_STRICT);
@@ -2136,21 +1448,16 @@
break;
case MethodRecognizer::kGrowableArrayLength:
body += LoadLocal(scopes_->this_variable);
- body += LoadNativeField(kind, GrowableObjectArray::length_offset(),
- Type::ZoneHandle(Z, Type::SmiType()), kSmiCid);
+ body += LoadNativeField(NativeFieldDesc::GrowableObjectArray_length());
break;
case MethodRecognizer::kObjectArrayLength:
case MethodRecognizer::kImmutableArrayLength:
body += LoadLocal(scopes_->this_variable);
- body +=
- LoadNativeField(kind, Array::length_offset(),
- Type::ZoneHandle(Z, Type::SmiType()), kSmiCid, true);
+ body += LoadNativeField(NativeFieldDesc::Array_length());
break;
case MethodRecognizer::kTypedDataLength:
body += LoadLocal(scopes_->this_variable);
- body +=
- LoadNativeField(kind, TypedData::length_offset(),
- Type::ZoneHandle(Z, Type::SmiType()), kSmiCid, true);
+ body += LoadNativeField(NativeFieldDesc::TypedData_length());
break;
case MethodRecognizer::kClassIDgetID:
body += LoadLocal(LookupVariable(first_positional_offset));
@@ -2159,9 +1466,7 @@
case MethodRecognizer::kGrowableArrayCapacity:
body += LoadLocal(scopes_->this_variable);
body += LoadField(GrowableObjectArray::data_offset(), kArrayCid);
- body += LoadNativeField(MethodRecognizer::kObjectArrayLength,
- Array::length_offset(),
- Type::ZoneHandle(Z, Type::SmiType()), kSmiCid);
+ body += LoadNativeField(NativeFieldDesc::Array_length());
break;
case MethodRecognizer::kListFactory: {
// factory List<E>([int length]) {
@@ -2235,8 +1540,7 @@
break;
case MethodRecognizer::kLinkedHashMap_getIndex:
body += LoadLocal(scopes_->this_variable);
- body += LoadNativeField(kind, LinkedHashMap::index_offset(),
- Object::dynamic_type(), kTypedDataUint32ArrayCid);
+ body += LoadNativeField(NativeFieldDesc::LinkedHashMap_index());
break;
case MethodRecognizer::kLinkedHashMap_setIndex:
body += LoadLocal(scopes_->this_variable);
@@ -2247,8 +1551,7 @@
break;
case MethodRecognizer::kLinkedHashMap_getData:
body += LoadLocal(scopes_->this_variable);
- body += LoadNativeField(kind, LinkedHashMap::data_offset(),
- Object::dynamic_type(), kArrayCid);
+ body += LoadNativeField(NativeFieldDesc::LinkedHashMap_data());
break;
case MethodRecognizer::kLinkedHashMap_setData:
body += LoadLocal(scopes_->this_variable);
@@ -2259,8 +1562,7 @@
break;
case MethodRecognizer::kLinkedHashMap_getHashMask:
body += LoadLocal(scopes_->this_variable);
- body += LoadNativeField(kind, LinkedHashMap::hash_mask_offset(),
- Type::ZoneHandle(Z, Type::SmiType()), kSmiCid);
+ body += LoadNativeField(NativeFieldDesc::LinkedHashMap_hash_mask());
break;
case MethodRecognizer::kLinkedHashMap_setHashMask:
body += LoadLocal(scopes_->this_variable);
@@ -2272,8 +1574,7 @@
break;
case MethodRecognizer::kLinkedHashMap_getUsedData:
body += LoadLocal(scopes_->this_variable);
- body += LoadNativeField(kind, LinkedHashMap::used_data_offset(),
- Type::ZoneHandle(Z, Type::SmiType()), kSmiCid);
+ body += LoadNativeField(NativeFieldDesc::LinkedHashMap_used_data());
break;
case MethodRecognizer::kLinkedHashMap_setUsedData:
body += LoadLocal(scopes_->this_variable);
@@ -2285,8 +1586,7 @@
break;
case MethodRecognizer::kLinkedHashMap_getDeletedKeys:
body += LoadLocal(scopes_->this_variable);
- body += LoadNativeField(kind, LinkedHashMap::deleted_keys_offset(),
- Type::ZoneHandle(Z, Type::SmiType()), kSmiCid);
+ body += LoadNativeField(NativeFieldDesc::LinkedHashMap_deleted_keys());
break;
case MethodRecognizer::kLinkedHashMap_setDeletedKeys:
body += LoadLocal(scopes_->this_variable);
diff --git a/runtime/vm/compiler/frontend/kernel_to_il.h b/runtime/vm/compiler/frontend/kernel_to_il.h
index 3ef59b2..a305b30 100644
--- a/runtime/vm/compiler/frontend/kernel_to_il.h
+++ b/runtime/vm/compiler/frontend/kernel_to_il.h
@@ -16,6 +16,7 @@
#include "vm/compiler/backend/flow_graph.h"
#include "vm/compiler/backend/il.h"
#include "vm/compiler/frontend/flow_graph_builder.h"
+#include "vm/compiler/frontend/kernel_translation_helper.h"
namespace dart {
namespace kernel {
@@ -304,176 +305,6 @@
ActiveClass saved_;
};
-class TranslationHelper {
- public:
- explicit TranslationHelper(Thread* thread);
-
- virtual ~TranslationHelper() {}
-
- void Reset();
-
- void InitFromScript(const Script& script);
-
- void InitFromKernelProgramInfo(const KernelProgramInfo& info);
-
- Thread* thread() { return thread_; }
-
- Zone* zone() { return zone_; }
-
- Isolate* isolate() { return isolate_; }
-
- Heap::Space allocation_space() { return allocation_space_; }
-
- // Access to strings.
- const TypedData& string_offsets() { return string_offsets_; }
- void SetStringOffsets(const TypedData& string_offsets);
-
- const ExternalTypedData& string_data() { return string_data_; }
- void SetStringData(const ExternalTypedData& string_data);
-
- const TypedData& canonical_names() { return canonical_names_; }
- void SetCanonicalNames(const TypedData& canonical_names);
-
- const ExternalTypedData& metadata_payloads() { return metadata_payloads_; }
- void SetMetadataPayloads(const ExternalTypedData& metadata_payloads);
-
- const ExternalTypedData& metadata_mappings() { return metadata_mappings_; }
- void SetMetadataMappings(const ExternalTypedData& metadata_mappings);
-
- const Array& constants() { return constants_; }
- void SetConstants(const Array& constants);
-
- intptr_t StringOffset(StringIndex index) const;
- intptr_t StringSize(StringIndex index) const;
-
- // The address of the backing store of the string with a given index. If the
- // backing store is in the VM's heap this address is not safe for GC (call the
- // function and use the result within a NoSafepointScope).
- uint8_t* StringBuffer(StringIndex index) const;
-
- uint8_t CharacterAt(StringIndex string_index, intptr_t index);
- bool StringEquals(StringIndex string_index, const char* other);
-
- // Accessors and predicates for canonical names.
- NameIndex CanonicalNameParent(NameIndex name);
- StringIndex CanonicalNameString(NameIndex name);
- bool IsAdministrative(NameIndex name);
- bool IsPrivate(NameIndex name);
- bool IsRoot(NameIndex name);
- bool IsLibrary(NameIndex name);
- bool IsClass(NameIndex name);
- bool IsMember(NameIndex name);
- bool IsField(NameIndex name);
- bool IsConstructor(NameIndex name);
- bool IsProcedure(NameIndex name);
- bool IsMethod(NameIndex name);
- bool IsGetter(NameIndex name);
- bool IsSetter(NameIndex name);
- bool IsFactory(NameIndex name);
-
- // For a member (field, constructor, or procedure) return the canonical name
- // of the enclosing class or library.
- NameIndex EnclosingName(NameIndex name);
-
- RawInstance* Canonicalize(const Instance& instance);
-
- const String& DartString(const char* content) {
- return DartString(content, allocation_space_);
- }
- const String& DartString(const char* content, Heap::Space space);
-
- String& DartString(StringIndex index) {
- return DartString(index, allocation_space_);
- }
- String& DartString(StringIndex string_index, Heap::Space space);
-
- String& DartString(const uint8_t* utf8_array,
- intptr_t len,
- Heap::Space space);
-
- const String& DartSymbolPlain(const char* content) const;
- String& DartSymbolPlain(StringIndex string_index) const;
- const String& DartSymbolObfuscate(const char* content) const;
- String& DartSymbolObfuscate(StringIndex string_index) const;
-
- String& DartIdentifier(const Library& lib, StringIndex string_index);
-
- const String& DartClassName(NameIndex kernel_class);
-
- const String& DartConstructorName(NameIndex constructor);
-
- const String& DartProcedureName(NameIndex procedure);
-
- const String& DartSetterName(NameIndex setter);
- const String& DartSetterName(NameIndex parent, StringIndex setter);
-
- const String& DartGetterName(NameIndex getter);
- const String& DartGetterName(NameIndex parent, StringIndex getter);
-
- const String& DartFieldName(NameIndex field);
- const String& DartFieldName(NameIndex parent, StringIndex field);
-
- const String& DartMethodName(NameIndex method);
- const String& DartMethodName(NameIndex parent, StringIndex method);
-
- const String& DartFactoryName(NameIndex factory);
-
- // A subclass overrides these when reading in the Kernel program in order to
- // support recursive type expressions (e.g. for "implements X" ...
- // annotations).
- virtual RawLibrary* LookupLibraryByKernelLibrary(NameIndex library);
- virtual RawClass* LookupClassByKernelClass(NameIndex klass);
-
- RawField* LookupFieldByKernelField(NameIndex field);
- RawFunction* LookupStaticMethodByKernelProcedure(NameIndex procedure);
- RawFunction* LookupConstructorByKernelConstructor(NameIndex constructor);
- RawFunction* LookupConstructorByKernelConstructor(const Class& owner,
- NameIndex constructor);
- RawFunction* LookupConstructorByKernelConstructor(
- const Class& owner,
- StringIndex constructor_name);
-
- Type& GetCanonicalType(const Class& klass);
-
- void ReportError(const char* format, ...);
- void ReportError(const Script& script,
- const TokenPosition position,
- const char* format,
- ...);
- void ReportError(const Error& prev_error, const char* format, ...);
- void ReportError(const Error& prev_error,
- const Script& script,
- const TokenPosition position,
- const char* format,
- ...);
-
- private:
- // This will mangle [name_to_modify] if necessary and make the result a symbol
- // if asked. The result will be available in [name_to_modify] and it is also
- // returned. If the name is private, the canonical name [parent] will be used
- // to get the import URI of the library where the name is visible.
- String& ManglePrivateName(NameIndex parent,
- String* name_to_modify,
- bool symbolize = true,
- bool obfuscate = true);
- String& ManglePrivateName(const Library& library,
- String* name_to_modify,
- bool symbolize = true,
- bool obfuscate = true);
-
- Thread* thread_;
- Zone* zone_;
- Isolate* isolate_;
- Heap::Space allocation_space_;
-
- TypedData& string_offsets_;
- ExternalTypedData& string_data_;
- TypedData& canonical_names_;
- ExternalTypedData& metadata_payloads_;
- ExternalTypedData& metadata_mappings_;
- Array& constants_;
-};
-
struct FunctionScope {
intptr_t kernel_offset;
LocalScope* scope;
@@ -565,6 +396,7 @@
pending_argument_count_(0) {}
Fragment LoadField(intptr_t offset, intptr_t class_id = kDynamicCid);
+ Fragment LoadNativeField(const NativeFieldDesc* native_field);
Fragment LoadIndexed(intptr_t index_scale);
void SetTempIndex(Definition* definition);
@@ -773,11 +605,6 @@
Fragment LoadClassId();
Fragment LoadField(intptr_t offset, intptr_t class_id = kDynamicCid);
Fragment LoadField(const Field& field);
- Fragment LoadNativeField(MethodRecognizer::Kind kind,
- intptr_t offset,
- const Type& type,
- intptr_t class_id,
- bool is_immutable = false);
Fragment LoadLocal(LocalVariable* variable);
Fragment InitStaticField(const Field& field);
Fragment LoadStaticField();
@@ -845,9 +672,6 @@
bool NeedsDebugStepCheck(Value* value, TokenPosition position);
Fragment DebugStepCheck(TokenPosition position);
- RawFunction* LookupMethodByMember(NameIndex target,
- const String& method_name);
-
LocalVariable* LookupVariable(intptr_t kernel_offset);
bool IsInlining() { return exit_collector_ != NULL; }
diff --git a/runtime/vm/compiler/frontend/kernel_translation_helper.cc b/runtime/vm/compiler/frontend/kernel_translation_helper.cc
new file mode 100644
index 0000000..2c963ac
--- /dev/null
+++ b/runtime/vm/compiler/frontend/kernel_translation_helper.cc
@@ -0,0 +1,2205 @@
+// Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+#include "vm/compiler/frontend/kernel_translation_helper.h"
+
+#include "vm/class_finalizer.h"
+#include "vm/compiler/aot/precompiler.h"
+#include "vm/log.h"
+#include "vm/symbols.h"
+
+#if !defined(DART_PRECOMPILED_RUNTIME)
+
+#define Z (zone_)
+#define H (translation_helper_)
+#define T (type_translator_)
+#define I Isolate::Current()
+
+namespace dart {
+namespace kernel {
+
+TranslationHelper::TranslationHelper(Thread* thread)
+ : thread_(thread),
+ zone_(thread->zone()),
+ isolate_(thread->isolate()),
+ allocation_space_(thread->IsMutatorThread() ? Heap::kNew : Heap::kOld),
+ string_offsets_(TypedData::Handle(Z)),
+ string_data_(ExternalTypedData::Handle(Z)),
+ canonical_names_(TypedData::Handle(Z)),
+ metadata_payloads_(ExternalTypedData::Handle(Z)),
+ metadata_mappings_(ExternalTypedData::Handle(Z)),
+ constants_(Array::Handle(Z)) {}
+
+void TranslationHelper::Reset() {
+ string_offsets_ = TypedData::null();
+ string_data_ = ExternalTypedData::null();
+ canonical_names_ = TypedData::null();
+ metadata_payloads_ = ExternalTypedData::null();
+ metadata_mappings_ = ExternalTypedData::null();
+ constants_ = Array::null();
+}
+
+void TranslationHelper::InitFromScript(const Script& script) {
+ const KernelProgramInfo& info =
+ KernelProgramInfo::Handle(Z, script.kernel_program_info());
+ if (info.IsNull()) {
+ // If there is no kernel data associated with the script, then
+ // do not bother initializing!.
+ // This can happen with few special functions like
+ // NoSuchMethodDispatcher and InvokeFieldDispatcher.
+ return;
+ }
+ InitFromKernelProgramInfo(info);
+}
+
+void TranslationHelper::InitFromKernelProgramInfo(
+ const KernelProgramInfo& info) {
+ SetStringOffsets(TypedData::Handle(Z, info.string_offsets()));
+ SetStringData(ExternalTypedData::Handle(Z, info.string_data()));
+ SetCanonicalNames(TypedData::Handle(Z, info.canonical_names()));
+ SetMetadataPayloads(ExternalTypedData::Handle(Z, info.metadata_payloads()));
+ SetMetadataMappings(ExternalTypedData::Handle(Z, info.metadata_mappings()));
+ SetConstants(Array::Handle(Z, info.constants()));
+}
+
+void TranslationHelper::SetStringOffsets(const TypedData& string_offsets) {
+ ASSERT(string_offsets_.IsNull());
+ string_offsets_ = string_offsets.raw();
+}
+
+void TranslationHelper::SetStringData(const ExternalTypedData& string_data) {
+ ASSERT(string_data_.IsNull());
+ string_data_ = string_data.raw();
+}
+
+void TranslationHelper::SetCanonicalNames(const TypedData& canonical_names) {
+ ASSERT(canonical_names_.IsNull());
+ canonical_names_ = canonical_names.raw();
+}
+
+void TranslationHelper::SetMetadataPayloads(
+ const ExternalTypedData& metadata_payloads) {
+ ASSERT(metadata_payloads_.IsNull());
+ metadata_payloads_ = metadata_payloads.raw();
+}
+
+void TranslationHelper::SetMetadataMappings(
+ const ExternalTypedData& metadata_mappings) {
+ ASSERT(metadata_mappings_.IsNull());
+ metadata_mappings_ = metadata_mappings.raw();
+}
+
+void TranslationHelper::SetConstants(const Array& constants) {
+ ASSERT(constants_.IsNull());
+ constants_ = constants.raw();
+}
+
+intptr_t TranslationHelper::StringOffset(StringIndex index) const {
+ return string_offsets_.GetUint32(index << 2);
+}
+
+intptr_t TranslationHelper::StringSize(StringIndex index) const {
+ return StringOffset(StringIndex(index + 1)) - StringOffset(index);
+}
+
+uint8_t TranslationHelper::CharacterAt(StringIndex string_index,
+ intptr_t index) {
+ ASSERT(index < StringSize(string_index));
+ return string_data_.GetUint8(StringOffset(string_index) + index);
+}
+
+uint8_t* TranslationHelper::StringBuffer(StringIndex string_index) const {
+ // Though this implementation appears like it could be replaced by
+ // string_data_.DataAddr(StringOffset(string_index)), it can't quite. If the
+ // last string in the string table is a zero length string, then the latter
+ // expression will try to return the address that is one past the backing
+ // store of the string_data_ table. Though this is safe in C++ as long as the
+ // address is not dereferenced, it will trigger the assert in
+ // ExternalTypedData::DataAddr.
+ ASSERT(Thread::Current()->no_safepoint_scope_depth() > 0);
+ return reinterpret_cast<uint8_t*>(string_data_.DataAddr(0)) +
+ StringOffset(string_index);
+}
+
+bool TranslationHelper::StringEquals(StringIndex string_index,
+ const char* other) {
+ intptr_t length = strlen(other);
+ if (length != StringSize(string_index)) return false;
+
+ NoSafepointScope no_safepoint;
+ return memcmp(StringBuffer(string_index), other, length) == 0;
+}
+
+NameIndex TranslationHelper::CanonicalNameParent(NameIndex name) {
+ // Canonical names are pairs of 4-byte parent and string indexes, so the size
+ // of an entry is 8 bytes. The parent is biased: 0 represents the root name
+ // and N+1 represents the name with index N.
+ return NameIndex(static_cast<intptr_t>(canonical_names_.GetUint32(8 * name)) -
+ 1);
+}
+
+StringIndex TranslationHelper::CanonicalNameString(NameIndex name) {
+ return StringIndex(canonical_names_.GetUint32((8 * name) + 4));
+}
+
+bool TranslationHelper::IsAdministrative(NameIndex name) {
+ // Administrative names start with '@'.
+ StringIndex name_string = CanonicalNameString(name);
+ return (StringSize(name_string) > 0) && (CharacterAt(name_string, 0) == '@');
+}
+
+bool TranslationHelper::IsPrivate(NameIndex name) {
+ // Private names start with '_'.
+ StringIndex name_string = CanonicalNameString(name);
+ return (StringSize(name_string) > 0) && (CharacterAt(name_string, 0) == '_');
+}
+
+bool TranslationHelper::IsRoot(NameIndex name) {
+ return name == -1;
+}
+
+bool TranslationHelper::IsLibrary(NameIndex name) {
+ // Libraries are the only canonical names with the root as their parent.
+ return !IsRoot(name) && IsRoot(CanonicalNameParent(name));
+}
+
+bool TranslationHelper::IsClass(NameIndex name) {
+ // Classes have the library as their parent and are not an administrative
+ // name starting with @.
+ return !IsAdministrative(name) && !IsRoot(name) &&
+ IsLibrary(CanonicalNameParent(name));
+}
+
+bool TranslationHelper::IsMember(NameIndex name) {
+ return IsConstructor(name) || IsField(name) || IsProcedure(name);
+}
+
+bool TranslationHelper::IsField(NameIndex name) {
+ // Fields with private names have the import URI of the library where they are
+ // visible as the parent and the string "@fields" as the parent's parent.
+ // Fields with non-private names have the string "@fields' as the parent.
+ if (IsRoot(name)) {
+ return false;
+ }
+ NameIndex kind = CanonicalNameParent(name);
+ if (IsPrivate(name)) {
+ kind = CanonicalNameParent(kind);
+ }
+ return StringEquals(CanonicalNameString(kind), "@fields");
+}
+
+bool TranslationHelper::IsConstructor(NameIndex name) {
+ // Constructors with private names have the import URI of the library where
+ // they are visible as the parent and the string "@constructors" as the
+ // parent's parent. Constructors with non-private names have the string
+ // "@constructors" as the parent.
+ if (IsRoot(name)) {
+ return false;
+ }
+ NameIndex kind = CanonicalNameParent(name);
+ if (IsPrivate(name)) {
+ kind = CanonicalNameParent(kind);
+ }
+ return StringEquals(CanonicalNameString(kind), "@constructors");
+}
+
+bool TranslationHelper::IsProcedure(NameIndex name) {
+ return IsMethod(name) || IsGetter(name) || IsSetter(name) || IsFactory(name);
+}
+
+bool TranslationHelper::IsMethod(NameIndex name) {
+ // Methods with private names have the import URI of the library where they
+ // are visible as the parent and the string "@methods" as the parent's parent.
+ // Methods with non-private names have the string "@methods" as the parent.
+ if (IsRoot(name)) {
+ return false;
+ }
+ NameIndex kind = CanonicalNameParent(name);
+ if (IsPrivate(name)) {
+ kind = CanonicalNameParent(kind);
+ }
+ return StringEquals(CanonicalNameString(kind), "@methods");
+}
+
+bool TranslationHelper::IsGetter(NameIndex name) {
+ // Getters with private names have the import URI of the library where they
+ // are visible as the parent and the string "@getters" as the parent's parent.
+ // Getters with non-private names have the string "@getters" as the parent.
+ if (IsRoot(name)) {
+ return false;
+ }
+ NameIndex kind = CanonicalNameParent(name);
+ if (IsPrivate(name)) {
+ kind = CanonicalNameParent(kind);
+ }
+ return StringEquals(CanonicalNameString(kind), "@getters");
+}
+
+bool TranslationHelper::IsSetter(NameIndex name) {
+ // Setters with private names have the import URI of the library where they
+ // are visible as the parent and the string "@setters" as the parent's parent.
+ // Setters with non-private names have the string "@setters" as the parent.
+ if (IsRoot(name)) {
+ return false;
+ }
+ NameIndex kind = CanonicalNameParent(name);
+ if (IsPrivate(name)) {
+ kind = CanonicalNameParent(kind);
+ }
+ return StringEquals(CanonicalNameString(kind), "@setters");
+}
+
+bool TranslationHelper::IsFactory(NameIndex name) {
+ // Factories with private names have the import URI of the library where they
+ // are visible as the parent and the string "@factories" as the parent's
+ // parent. Factories with non-private names have the string "@factories" as
+ // the parent.
+ if (IsRoot(name)) {
+ return false;
+ }
+ NameIndex kind = CanonicalNameParent(name);
+ if (IsPrivate(name)) {
+ kind = CanonicalNameParent(kind);
+ }
+ return StringEquals(CanonicalNameString(kind), "@factories");
+}
+
+NameIndex TranslationHelper::EnclosingName(NameIndex name) {
+ ASSERT(IsField(name) || IsConstructor(name) || IsProcedure(name));
+ NameIndex enclosing = CanonicalNameParent(CanonicalNameParent(name));
+ if (IsPrivate(name)) {
+ enclosing = CanonicalNameParent(enclosing);
+ }
+ ASSERT(IsLibrary(enclosing) || IsClass(enclosing));
+ return enclosing;
+}
+
+RawInstance* TranslationHelper::Canonicalize(const Instance& instance) {
+ if (instance.IsNull()) return instance.raw();
+
+ const char* error_str = NULL;
+ RawInstance* result = instance.CheckAndCanonicalize(thread(), &error_str);
+ if (result == Object::null()) {
+ ReportError("Invalid const object %s", error_str);
+ }
+ return result;
+}
+
+const String& TranslationHelper::DartString(const char* content,
+ Heap::Space space) {
+ return String::ZoneHandle(Z, String::New(content, space));
+}
+
+String& TranslationHelper::DartString(StringIndex string_index,
+ Heap::Space space) {
+ intptr_t length = StringSize(string_index);
+ uint8_t* buffer = Z->Alloc<uint8_t>(length);
+ {
+ NoSafepointScope no_safepoint;
+ memmove(buffer, StringBuffer(string_index), length);
+ }
+ return String::ZoneHandle(Z, String::FromUTF8(buffer, length, space));
+}
+
+String& TranslationHelper::DartString(const uint8_t* utf8_array,
+ intptr_t len,
+ Heap::Space space) {
+ return String::ZoneHandle(Z, String::FromUTF8(utf8_array, len, space));
+}
+
+const String& TranslationHelper::DartSymbolPlain(const char* content) const {
+ return String::ZoneHandle(Z, Symbols::New(thread_, content));
+}
+
+String& TranslationHelper::DartSymbolPlain(StringIndex string_index) const {
+ intptr_t length = StringSize(string_index);
+ uint8_t* buffer = Z->Alloc<uint8_t>(length);
+ {
+ NoSafepointScope no_safepoint;
+ memmove(buffer, StringBuffer(string_index), length);
+ }
+ String& result =
+ String::ZoneHandle(Z, Symbols::FromUTF8(thread_, buffer, length));
+ return result;
+}
+
+const String& TranslationHelper::DartSymbolObfuscate(
+ const char* content) const {
+ String& result = String::ZoneHandle(Z, Symbols::New(thread_, content));
+ if (I->obfuscate()) {
+ Obfuscator obfuscator(thread_, String::Handle(Z));
+ result = obfuscator.Rename(result, true);
+ }
+ return result;
+}
+
+String& TranslationHelper::DartSymbolObfuscate(StringIndex string_index) const {
+ intptr_t length = StringSize(string_index);
+ uint8_t* buffer = Z->Alloc<uint8_t>(length);
+ {
+ NoSafepointScope no_safepoint;
+ memmove(buffer, StringBuffer(string_index), length);
+ }
+ String& result =
+ String::ZoneHandle(Z, Symbols::FromUTF8(thread_, buffer, length));
+ if (I->obfuscate()) {
+ Obfuscator obfuscator(thread_, String::Handle(Z));
+ result = obfuscator.Rename(result, true);
+ }
+ return result;
+}
+
+String& TranslationHelper::DartIdentifier(const Library& lib,
+ StringIndex string_index) {
+ String& name = DartString(string_index);
+ ManglePrivateName(lib, &name);
+ return name;
+}
+
+const String& TranslationHelper::DartClassName(NameIndex kernel_class) {
+ ASSERT(IsClass(kernel_class));
+ String& name = DartString(CanonicalNameString(kernel_class));
+ return ManglePrivateName(CanonicalNameParent(kernel_class), &name);
+}
+
+const String& TranslationHelper::DartConstructorName(NameIndex constructor) {
+ ASSERT(IsConstructor(constructor));
+ return DartFactoryName(constructor);
+}
+
+const String& TranslationHelper::DartProcedureName(NameIndex procedure) {
+ ASSERT(IsProcedure(procedure));
+ if (IsSetter(procedure)) {
+ return DartSetterName(procedure);
+ } else if (IsGetter(procedure)) {
+ return DartGetterName(procedure);
+ } else if (IsFactory(procedure)) {
+ return DartFactoryName(procedure);
+ } else {
+ return DartMethodName(procedure);
+ }
+}
+
+const String& TranslationHelper::DartSetterName(NameIndex setter) {
+ return DartSetterName(CanonicalNameParent(setter),
+ CanonicalNameString(setter));
+}
+
+const String& TranslationHelper::DartSetterName(NameIndex parent,
+ StringIndex setter) {
+ // The names flowing into [setter] are coming from the Kernel file:
+ // * user-defined setters: `fieldname=`
+ // * property-set expressions: `fieldname`
+ //
+ // The VM uses `get:fieldname` and `set:fieldname`.
+ //
+ // => In order to be consistent, we remove the `=` always and adopt the VM
+ // conventions.
+ intptr_t size = StringSize(setter);
+ ASSERT(size > 0);
+ if (CharacterAt(setter, size - 1) == '=') {
+ --size;
+ }
+ uint8_t* buffer = Z->Alloc<uint8_t>(size);
+ {
+ NoSafepointScope no_safepoint;
+ memmove(buffer, StringBuffer(setter), size);
+ }
+ String& name =
+ String::ZoneHandle(Z, String::FromUTF8(buffer, size, allocation_space_));
+ ManglePrivateName(parent, &name);
+ name = Field::SetterSymbol(name);
+ return name;
+}
+
+const String& TranslationHelper::DartGetterName(NameIndex getter) {
+ return DartGetterName(CanonicalNameParent(getter),
+ CanonicalNameString(getter));
+}
+
+const String& TranslationHelper::DartGetterName(NameIndex parent,
+ StringIndex getter) {
+ String& name = DartString(getter);
+ ManglePrivateName(parent, &name);
+ name = Field::GetterSymbol(name);
+ return name;
+}
+
+const String& TranslationHelper::DartFieldName(NameIndex field) {
+ return DartFieldName(CanonicalNameParent(field), CanonicalNameString(field));
+}
+
+const String& TranslationHelper::DartFieldName(NameIndex parent,
+ StringIndex field) {
+ String& name = DartString(field);
+ return ManglePrivateName(parent, &name);
+}
+
+const String& TranslationHelper::DartMethodName(NameIndex method) {
+ return DartMethodName(CanonicalNameParent(method),
+ CanonicalNameString(method));
+}
+
+const String& TranslationHelper::DartMethodName(NameIndex parent,
+ StringIndex method) {
+ String& name = DartString(method);
+ return ManglePrivateName(parent, &name);
+}
+
+const String& TranslationHelper::DartFactoryName(NameIndex factory) {
+ ASSERT(IsConstructor(factory) || IsFactory(factory));
+ GrowableHandlePtrArray<const String> pieces(Z, 3);
+ pieces.Add(DartClassName(EnclosingName(factory)));
+ pieces.Add(Symbols::Dot());
+ // [DartMethodName] will mangle the name.
+ pieces.Add(DartMethodName(factory));
+ return String::ZoneHandle(Z, Symbols::FromConcatAll(thread_, pieces));
+}
+
+RawLibrary* TranslationHelper::LookupLibraryByKernelLibrary(
+ NameIndex kernel_library) {
+ // We only use the string and don't rely on having any particular parent.
+ // This ASSERT is just a sanity check.
+ ASSERT(IsLibrary(kernel_library) ||
+ IsAdministrative(CanonicalNameParent(kernel_library)));
+ const String& library_name =
+ DartSymbolPlain(CanonicalNameString(kernel_library));
+ ASSERT(!library_name.IsNull());
+ RawLibrary* library = Library::LookupLibrary(thread_, library_name);
+ ASSERT(library != Object::null());
+ return library;
+}
+
+RawClass* TranslationHelper::LookupClassByKernelClass(NameIndex kernel_class) {
+ ASSERT(IsClass(kernel_class));
+ const String& class_name = DartClassName(kernel_class);
+ NameIndex kernel_library = CanonicalNameParent(kernel_class);
+ Library& library =
+ Library::Handle(Z, LookupLibraryByKernelLibrary(kernel_library));
+ RawClass* klass = library.LookupClassAllowPrivate(class_name);
+
+ ASSERT(klass != Object::null());
+ return klass;
+}
+
+RawField* TranslationHelper::LookupFieldByKernelField(NameIndex kernel_field) {
+ ASSERT(IsField(kernel_field));
+ NameIndex enclosing = EnclosingName(kernel_field);
+
+ Class& klass = Class::Handle(Z);
+ if (IsLibrary(enclosing)) {
+ Library& library =
+ Library::Handle(Z, LookupLibraryByKernelLibrary(enclosing));
+ klass = library.toplevel_class();
+ } else {
+ ASSERT(IsClass(enclosing));
+ klass = LookupClassByKernelClass(enclosing);
+ }
+ RawField* field = klass.LookupFieldAllowPrivate(
+ DartSymbolObfuscate(CanonicalNameString(kernel_field)));
+ ASSERT(field != Object::null());
+ return field;
+}
+
+RawFunction* TranslationHelper::LookupStaticMethodByKernelProcedure(
+ NameIndex procedure) {
+ const String& procedure_name = DartProcedureName(procedure);
+
+ // The parent is either a library or a class (in which case the procedure is a
+ // static method).
+ NameIndex enclosing = EnclosingName(procedure);
+ if (IsLibrary(enclosing)) {
+ Library& library =
+ Library::Handle(Z, LookupLibraryByKernelLibrary(enclosing));
+ RawFunction* function = library.LookupFunctionAllowPrivate(procedure_name);
+ ASSERT(function != Object::null());
+ return function;
+ } else {
+ ASSERT(IsClass(enclosing));
+ Class& klass = Class::Handle(Z, LookupClassByKernelClass(enclosing));
+ Function& function = Function::ZoneHandle(
+ Z, klass.LookupFunctionAllowPrivate(procedure_name));
+ ASSERT(!function.IsNull());
+
+ // TODO(27590): We can probably get rid of this after no longer using
+ // core libraries from the source.
+ if (function.IsRedirectingFactory()) {
+ ClassFinalizer::ResolveRedirectingFactory(klass, function);
+ function = function.RedirectionTarget();
+ }
+ return function.raw();
+ }
+}
+
+RawFunction* TranslationHelper::LookupConstructorByKernelConstructor(
+ NameIndex constructor) {
+ ASSERT(IsConstructor(constructor));
+ Class& klass =
+ Class::Handle(Z, LookupClassByKernelClass(EnclosingName(constructor)));
+ return LookupConstructorByKernelConstructor(klass, constructor);
+}
+
+RawFunction* TranslationHelper::LookupConstructorByKernelConstructor(
+ const Class& owner,
+ NameIndex constructor) {
+ ASSERT(IsConstructor(constructor));
+ RawFunction* function =
+ owner.LookupConstructorAllowPrivate(DartConstructorName(constructor));
+ ASSERT(function != Object::null());
+ return function;
+}
+
+RawFunction* TranslationHelper::LookupConstructorByKernelConstructor(
+ const Class& owner,
+ StringIndex constructor_name) {
+ GrowableHandlePtrArray<const String> pieces(Z, 3);
+ pieces.Add(DartString(String::Handle(owner.Name()).ToCString(), Heap::kOld));
+ pieces.Add(Symbols::Dot());
+ String& name = DartString(constructor_name);
+ pieces.Add(ManglePrivateName(Library::Handle(owner.library()), &name));
+
+ String& new_name =
+ String::ZoneHandle(Z, Symbols::FromConcatAll(thread_, pieces));
+ RawFunction* function = owner.LookupConstructorAllowPrivate(new_name);
+ ASSERT(function != Object::null());
+ return function;
+}
+
+RawFunction* TranslationHelper::LookupMethodByMember(
+ NameIndex target,
+ const String& method_name) {
+ NameIndex kernel_class = EnclosingName(target);
+ Class& klass = Class::Handle(Z, LookupClassByKernelClass(kernel_class));
+
+ RawFunction* function = klass.LookupFunctionAllowPrivate(method_name);
+#ifdef DEBUG
+ if (function == Object::null()) {
+ THR_Print("Unable to find \'%s\' in %s\n", method_name.ToCString(),
+ klass.ToCString());
+ }
+#endif
+ ASSERT(function != Object::null());
+ return function;
+}
+
+Type& TranslationHelper::GetCanonicalType(const Class& klass) {
+ ASSERT(!klass.IsNull());
+ // Note that if cls is _Closure, the returned type will be _Closure,
+ // and not the signature type.
+ Type& type = Type::ZoneHandle(Z, klass.CanonicalType());
+ if (!type.IsNull()) {
+ return type;
+ }
+ type = Type::New(klass, TypeArguments::Handle(Z, klass.type_parameters()),
+ klass.token_pos());
+ if (klass.is_type_finalized()) {
+ type ^= ClassFinalizer::FinalizeType(klass, type);
+ // Note that the receiver type may now be a malbounded type.
+ klass.SetCanonicalType(type);
+ }
+ return type;
+}
+
+void TranslationHelper::ReportError(const char* format, ...) {
+ const Script& null_script = Script::Handle(Z);
+
+ va_list args;
+ va_start(args, format);
+ Report::MessageV(Report::kError, null_script, TokenPosition::kNoSource,
+ Report::AtLocation, format, args);
+ va_end(args);
+ UNREACHABLE();
+}
+
+void TranslationHelper::ReportError(const Script& script,
+ const TokenPosition position,
+ const char* format,
+ ...) {
+ va_list args;
+ va_start(args, format);
+ Report::MessageV(Report::kError, script, position, Report::AtLocation, format,
+ args);
+ va_end(args);
+ UNREACHABLE();
+}
+
+void TranslationHelper::ReportError(const Error& prev_error,
+ const char* format,
+ ...) {
+ const Script& null_script = Script::Handle(Z);
+
+ va_list args;
+ va_start(args, format);
+ Report::LongJumpV(prev_error, null_script, TokenPosition::kNoSource, format,
+ args);
+ va_end(args);
+ UNREACHABLE();
+}
+
+void TranslationHelper::ReportError(const Error& prev_error,
+ const Script& script,
+ const TokenPosition position,
+ const char* format,
+ ...) {
+ va_list args;
+ va_start(args, format);
+ Report::LongJumpV(prev_error, script, position, format, args);
+ va_end(args);
+ UNREACHABLE();
+}
+
+String& TranslationHelper::ManglePrivateName(NameIndex parent,
+ String* name_to_modify,
+ bool symbolize,
+ bool obfuscate) {
+ if (name_to_modify->Length() >= 1 && name_to_modify->CharAt(0) == '_') {
+ const Library& library =
+ Library::Handle(Z, LookupLibraryByKernelLibrary(parent));
+ *name_to_modify = library.PrivateName(*name_to_modify);
+ if (obfuscate && I->obfuscate()) {
+ const String& library_key = String::Handle(library.private_key());
+ Obfuscator obfuscator(thread_, library_key);
+ *name_to_modify = obfuscator.Rename(*name_to_modify);
+ }
+ } else if (symbolize) {
+ *name_to_modify = Symbols::New(thread_, *name_to_modify);
+ if (obfuscate && I->obfuscate()) {
+ const String& library_key = String::Handle();
+ Obfuscator obfuscator(thread_, library_key);
+ *name_to_modify = obfuscator.Rename(*name_to_modify);
+ }
+ }
+ return *name_to_modify;
+}
+
+String& TranslationHelper::ManglePrivateName(const Library& library,
+ String* name_to_modify,
+ bool symbolize,
+ bool obfuscate) {
+ if (name_to_modify->Length() >= 1 && name_to_modify->CharAt(0) == '_') {
+ *name_to_modify = library.PrivateName(*name_to_modify);
+ if (obfuscate && I->obfuscate()) {
+ const String& library_key = String::Handle(library.private_key());
+ Obfuscator obfuscator(thread_, library_key);
+ *name_to_modify = obfuscator.Rename(*name_to_modify);
+ }
+ } else if (symbolize) {
+ *name_to_modify = Symbols::New(thread_, *name_to_modify);
+ if (obfuscate && I->obfuscate()) {
+ const String& library_key = String::Handle();
+ Obfuscator obfuscator(thread_, library_key);
+ *name_to_modify = obfuscator.Rename(*name_to_modify);
+ }
+ }
+ return *name_to_modify;
+}
+
+void FunctionNodeHelper::ReadUntilExcluding(Field field) {
+ if (field <= next_read_) return;
+
+ // Ordered with fall-through.
+ switch (next_read_) {
+ case kStart: {
+ Tag tag = helper_->ReadTag(); // read tag.
+ ASSERT(tag == kFunctionNode);
+ if (++next_read_ == field) return;
+ }
+ /* Falls through */
+ case kPosition:
+ position_ = helper_->ReadPosition(); // read position.
+ if (++next_read_ == field) return;
+ /* Falls through */
+ case kEndPosition:
+ end_position_ = helper_->ReadPosition(); // read end position.
+ if (++next_read_ == field) return;
+ /* Falls through */
+ case kAsyncMarker:
+ async_marker_ = static_cast<AsyncMarker>(helper_->ReadByte());
+ if (++next_read_ == field) return;
+ /* Falls through */
+ case kDartAsyncMarker:
+ dart_async_marker_ = static_cast<AsyncMarker>(
+ helper_->ReadByte()); // read dart async marker.
+ if (++next_read_ == field) return;
+ /* Falls through */
+ case kTypeParameters:
+ helper_->SkipTypeParametersList(); // read type parameters.
+ if (++next_read_ == field) return;
+ /* Falls through */
+ case kTotalParameterCount:
+ total_parameter_count_ =
+ helper_->ReadUInt(); // read total parameter count.
+ if (++next_read_ == field) return;
+ /* Falls through */
+ case kRequiredParameterCount:
+ required_parameter_count_ =
+ helper_->ReadUInt(); // read required parameter count.
+ if (++next_read_ == field) return;
+ /* Falls through */
+ case kPositionalParameters:
+ helper_->SkipListOfVariableDeclarations(); // read positionals.
+ if (++next_read_ == field) return;
+ /* Falls through */
+ case kNamedParameters:
+ helper_->SkipListOfVariableDeclarations(); // read named.
+ if (++next_read_ == field) return;
+ /* Falls through */
+ case kReturnType:
+ helper_->SkipDartType(); // read return type.
+ if (++next_read_ == field) return;
+ /* Falls through */
+ case kBody:
+ if (helper_->ReadTag() == kSomething)
+ helper_->SkipStatement(); // read body.
+ if (++next_read_ == field) return;
+ /* Falls through */
+ case kEnd:
+ return;
+ }
+}
+
+void TypeParameterHelper::ReadUntilExcluding(Field field) {
+ for (; next_read_ < field; ++next_read_) {
+ switch (next_read_) {
+ case kFlags:
+ flags_ = helper_->ReadFlags();
+ break;
+ case kAnnotations:
+ helper_->SkipListOfExpressions(); // read annotations.
+ break;
+ case kName:
+ name_index_ = helper_->ReadStringReference(); // read name index.
+ break;
+ case kBound:
+ helper_->SkipDartType();
+ break;
+ case kDefaultType:
+ if (helper_->ReadTag() == kSomething) {
+ helper_->SkipDartType();
+ }
+ break;
+ case kEnd:
+ return;
+ }
+ }
+}
+
+void VariableDeclarationHelper::ReadUntilExcluding(Field field) {
+ if (field <= next_read_) return;
+
+ // Ordered with fall-through.
+ switch (next_read_) {
+ case kPosition:
+ position_ = helper_->ReadPosition(); // read position.
+ if (++next_read_ == field) return;
+ /* Falls through */
+ case kEqualPosition:
+ equals_position_ = helper_->ReadPosition(); // read equals position.
+ if (++next_read_ == field) return;
+ /* Falls through */
+ case kAnnotations:
+ helper_->SkipListOfExpressions(); // read annotations.
+ if (++next_read_ == field) return;
+ /* Falls through */
+ case kFlags:
+ flags_ = helper_->ReadFlags();
+ if (++next_read_ == field) return;
+ /* Falls through */
+ case kNameIndex:
+ name_index_ = helper_->ReadStringReference(); // read name index.
+ if (++next_read_ == field) return;
+ /* Falls through */
+ case kType:
+ helper_->SkipDartType(); // read type.
+ if (++next_read_ == field) return;
+ /* Falls through */
+ case kInitializer:
+ if (helper_->ReadTag() == kSomething)
+ helper_->SkipExpression(); // read initializer.
+ if (++next_read_ == field) return;
+ /* Falls through */
+ case kEnd:
+ return;
+ }
+}
+
+FieldHelper::FieldHelper(KernelReaderHelper* helper, intptr_t offset)
+ : helper_(helper),
+ next_read_(kStart),
+ has_function_literal_initializer_(false) {
+ helper_->SetOffset(offset);
+}
+
+void FieldHelper::ReadUntilExcluding(Field field,
+ bool detect_function_literal_initializer) {
+ if (field <= next_read_) return;
+
+ // Ordered with fall-through.
+ switch (next_read_) {
+ case kStart: {
+ Tag tag = helper_->ReadTag(); // read tag.
+ ASSERT(tag == kField);
+ if (++next_read_ == field) return;
+ }
+ /* Falls through */
+ case kCanonicalName:
+ canonical_name_ =
+ helper_->ReadCanonicalNameReference(); // read canonical_name.
+ if (++next_read_ == field) return;
+ /* Falls through */
+ case kSourceUriIndex:
+ source_uri_index_ = helper_->ReadUInt(); // read source_uri_index.
+ helper_->set_current_script_id(source_uri_index_);
+ if (++next_read_ == field) return;
+ /* Falls through */
+ case kPosition:
+ position_ = helper_->ReadPosition(false); // read position.
+ helper_->RecordTokenPosition(position_);
+ if (++next_read_ == field) return;
+ /* Falls through */
+ case kEndPosition:
+ end_position_ = helper_->ReadPosition(false); // read end position.
+ helper_->RecordTokenPosition(end_position_);
+ if (++next_read_ == field) return;
+ /* Falls through */
+ case kFlags:
+ flags_ = helper_->ReadFlags();
+ if (++next_read_ == field) return;
+ /* Falls through */
+ case kName:
+ helper_->SkipName(); // read name.
+ if (++next_read_ == field) return;
+ /* Falls through */
+ case kAnnotations: {
+ annotation_count_ = helper_->ReadListLength(); // read list length.
+ for (intptr_t i = 0; i < annotation_count_; ++i) {
+ helper_->SkipExpression(); // read ith expression.
+ }
+ if (++next_read_ == field) return;
+ }
+ /* Falls through */
+ case kType:
+ helper_->SkipDartType(); // read type.
+ if (++next_read_ == field) return;
+ /* Falls through */
+ case kInitializer:
+ if (helper_->ReadTag() == kSomething) {
+ if (detect_function_literal_initializer &&
+ helper_->PeekTag() == kFunctionExpression) {
+ AlternativeReadingScope alt(&helper_->reader_);
+ Tag tag = helper_->ReadTag();
+ ASSERT(tag == kFunctionExpression);
+ helper_->ReadPosition(); // read position.
+
+ FunctionNodeHelper helper(helper_);
+ helper.ReadUntilIncluding(FunctionNodeHelper::kEndPosition);
+
+ has_function_literal_initializer_ = true;
+ function_literal_start_ = helper.position_;
+ function_literal_end_ = helper.end_position_;
+ }
+ helper_->SkipExpression(); // read initializer.
+ }
+ if (++next_read_ == field) return;
+ /* Falls through */
+ case kEnd:
+ return;
+ }
+}
+
+void ProcedureHelper::ReadUntilExcluding(Field field) {
+ if (field <= next_read_) return;
+
+ // Ordered with fall-through.
+ switch (next_read_) {
+ case kStart: {
+ Tag tag = helper_->ReadTag(); // read tag.
+ ASSERT(tag == kProcedure);
+ if (++next_read_ == field) return;
+ }
+ /* Falls through */
+ case kCanonicalName:
+ canonical_name_ =
+ helper_->ReadCanonicalNameReference(); // read canonical_name.
+ if (++next_read_ == field) return;
+ /* Falls through */
+ case kSourceUriIndex:
+ source_uri_index_ = helper_->ReadUInt(); // read source_uri_index.
+ helper_->set_current_script_id(source_uri_index_);
+ if (++next_read_ == field) return;
+ /* Falls through */
+ case kStartPosition:
+ start_position_ = helper_->ReadPosition(false); // read position.
+ helper_->RecordTokenPosition(start_position_);
+ if (++next_read_ == field) return;
+ /* Falls through */
+ case kPosition:
+ position_ = helper_->ReadPosition(false); // read position.
+ helper_->RecordTokenPosition(position_);
+ if (++next_read_ == field) return;
+ /* Falls through */
+ case kEndPosition:
+ end_position_ = helper_->ReadPosition(false); // read end position.
+ helper_->RecordTokenPosition(end_position_);
+ if (++next_read_ == field) return;
+ /* Falls through */
+ case kKind:
+ kind_ = static_cast<Kind>(helper_->ReadByte());
+ if (++next_read_ == field) return;
+ /* Falls through */
+ case kFlags:
+ flags_ = helper_->ReadFlags();
+ if (++next_read_ == field) return;
+ /* Falls through */
+ case kName:
+ helper_->SkipName(); // read name.
+ if (++next_read_ == field) return;
+ /* Falls through */
+ case kAnnotations: {
+ annotation_count_ = helper_->ReadListLength(); // read list length.
+ for (intptr_t i = 0; i < annotation_count_; ++i) {
+ helper_->SkipExpression(); // read ith expression.
+ }
+ if (++next_read_ == field) return;
+ }
+ /* Falls through */
+ case kForwardingStubSuperTarget:
+ if (helper_->ReadTag() == kSomething) {
+ forwarding_stub_super_target_ = helper_->ReadCanonicalNameReference();
+ }
+ if (++next_read_ == field) return;
+ /* Falls through */
+ case kForwardingStubInterfaceTarget:
+ if (helper_->ReadTag() == kSomething) {
+ helper_->ReadCanonicalNameReference();
+ }
+ if (++next_read_ == field) return;
+ /* Falls through */
+ case kFunction:
+ if (helper_->ReadTag() == kSomething)
+ helper_->SkipFunctionNode(); // read function node.
+ if (++next_read_ == field) return;
+ /* Falls through */
+ case kEnd:
+ return;
+ }
+}
+
+void ConstructorHelper::ReadUntilExcluding(Field field) {
+ if (field <= next_read_) return;
+
+ // Ordered with fall-through.
+ switch (next_read_) {
+ case kStart: {
+ Tag tag = helper_->ReadTag(); // read tag.
+ ASSERT(tag == kConstructor);
+ if (++next_read_ == field) return;
+ }
+ /* Falls through */
+ case kCanonicalName:
+ canonical_name_ =
+ helper_->ReadCanonicalNameReference(); // read canonical_name.
+ if (++next_read_ == field) return;
+ /* Falls through */
+ case kSourceUriIndex:
+ source_uri_index_ = helper_->ReadUInt(); // read source_uri_index.
+ helper_->set_current_script_id(source_uri_index_);
+ if (++next_read_ == field) return;
+ /* Falls through */
+ case kStartPosition:
+ start_position_ = helper_->ReadPosition(); // read position.
+ helper_->RecordTokenPosition(start_position_);
+ if (++next_read_ == field) return;
+ /* Falls through */
+ case kPosition:
+ position_ = helper_->ReadPosition(); // read position.
+ helper_->RecordTokenPosition(position_);
+ if (++next_read_ == field) return;
+ /* Falls through */
+ case kEndPosition:
+ end_position_ = helper_->ReadPosition(); // read end position.
+ helper_->RecordTokenPosition(end_position_);
+ if (++next_read_ == field) return;
+ /* Falls through */
+ case kFlags:
+ flags_ = helper_->ReadFlags();
+ if (++next_read_ == field) return;
+ /* Falls through */
+ case kName:
+ helper_->SkipName(); // read name.
+ if (++next_read_ == field) return;
+ /* Falls through */
+ case kAnnotations: {
+ annotation_count_ = helper_->ReadListLength(); // read list length.
+ for (intptr_t i = 0; i < annotation_count_; ++i) {
+ helper_->SkipExpression(); // read ith expression.
+ }
+ if (++next_read_ == field) return;
+ }
+ /* Falls through */
+ case kFunction:
+ helper_->SkipFunctionNode(); // read function.
+ if (++next_read_ == field) return;
+ /* Falls through */
+ case kInitializers: {
+ intptr_t list_length =
+ helper_->ReadListLength(); // read initializers list length.
+ for (intptr_t i = 0; i < list_length; i++) {
+ helper_->SkipInitializer();
+ }
+ if (++next_read_ == field) return;
+ }
+ /* Falls through */
+ case kEnd:
+ return;
+ }
+}
+
+void ClassHelper::ReadUntilExcluding(Field field) {
+ if (field <= next_read_) return;
+
+ // Ordered with fall-through.
+ switch (next_read_) {
+ case kStart: {
+ Tag tag = helper_->ReadTag(); // read tag.
+ ASSERT(tag == kClass);
+ if (++next_read_ == field) return;
+ }
+ /* Falls through */
+ case kCanonicalName:
+ canonical_name_ =
+ helper_->ReadCanonicalNameReference(); // read canonical_name.
+ if (++next_read_ == field) return;
+ /* Falls through */
+ case kSourceUriIndex:
+ source_uri_index_ = helper_->ReadUInt(); // read source_uri_index.
+ helper_->set_current_script_id(source_uri_index_);
+ if (++next_read_ == field) return;
+ /* Falls through */
+ case kStartPosition:
+ start_position_ = helper_->ReadPosition(false); // read position.
+ helper_->RecordTokenPosition(start_position_);
+ if (++next_read_ == field) return;
+ /* Falls through */
+ case kPosition:
+ position_ = helper_->ReadPosition(false); // read position.
+ helper_->RecordTokenPosition(position_);
+ if (++next_read_ == field) return;
+ /* Falls through */
+ case kEndPosition:
+ end_position_ = helper_->ReadPosition(); // read end position.
+ helper_->RecordTokenPosition(end_position_);
+ if (++next_read_ == field) return;
+ /* Falls through */
+ case kFlags:
+ flags_ = helper_->ReadFlags(); // read flags.
+ if (++next_read_ == field) return;
+ /* Falls through */
+ case kNameIndex:
+ name_index_ = helper_->ReadStringReference(); // read name index.
+ if (++next_read_ == field) return;
+ /* Falls through */
+ case kAnnotations: {
+ annotation_count_ = helper_->ReadListLength(); // read list length.
+ for (intptr_t i = 0; i < annotation_count_; ++i) {
+ helper_->SkipExpression(); // read ith expression.
+ }
+ if (++next_read_ == field) return;
+ }
+ /* Falls through */
+ case kTypeParameters:
+ helper_->SkipTypeParametersList(); // read type parameters.
+ if (++next_read_ == field) return;
+ /* Falls through */
+ case kSuperClass: {
+ Tag type_tag = helper_->ReadTag(); // read super class type (part 1).
+ if (type_tag == kSomething) {
+ helper_->SkipDartType(); // read super class type (part 2).
+ }
+ if (++next_read_ == field) return;
+ }
+ /* Falls through */
+ case kMixinType: {
+ Tag type_tag = helper_->ReadTag(); // read mixin type (part 1).
+ if (type_tag == kSomething) {
+ helper_->SkipDartType(); // read mixin type (part 2).
+ }
+ if (++next_read_ == field) return;
+ }
+ /* Falls through */
+ case kImplementedClasses:
+ helper_->SkipListOfDartTypes(); // read implemented_classes.
+ if (++next_read_ == field) return;
+ /* Falls through */
+ case kFields: {
+ intptr_t list_length =
+ helper_->ReadListLength(); // read fields list length.
+ for (intptr_t i = 0; i < list_length; i++) {
+ FieldHelper field_helper(helper_);
+ field_helper.ReadUntilExcluding(FieldHelper::kEnd); // read field.
+ }
+ if (++next_read_ == field) return;
+ }
+ /* Falls through */
+ case kConstructors: {
+ intptr_t list_length =
+ helper_->ReadListLength(); // read constructors list length.
+ for (intptr_t i = 0; i < list_length; i++) {
+ ConstructorHelper constructor_helper(helper_);
+ constructor_helper.ReadUntilExcluding(
+ ConstructorHelper::kEnd); // read constructor.
+ }
+ if (++next_read_ == field) return;
+ }
+ /* Falls through */
+ case kProcedures: {
+ procedure_count_ = helper_->ReadListLength(); // read procedures #.
+ for (intptr_t i = 0; i < procedure_count_; i++) {
+ ProcedureHelper procedure_helper(helper_);
+ procedure_helper.ReadUntilExcluding(
+ ProcedureHelper::kEnd); // read procedure.
+ }
+ if (++next_read_ == field) return;
+ }
+ /* Falls through */
+ case kClassIndex:
+ // Read class index.
+ for (intptr_t i = 0; i < procedure_count_; ++i) {
+ helper_->reader_.ReadUInt32();
+ }
+ helper_->reader_.ReadUInt32();
+ helper_->reader_.ReadUInt32();
+ if (++next_read_ == field) return;
+ /* Falls through */
+ case kEnd:
+ return;
+ }
+}
+
+void LibraryHelper::ReadUntilExcluding(Field field) {
+ if (field <= next_read_) return;
+
+ // Ordered with fall-through.
+ switch (next_read_) {
+ case kFlags: {
+ flags_ = helper_->ReadFlags();
+ if (++next_read_ == field) return;
+ }
+ /* Falls through */
+ case kCanonicalName:
+ canonical_name_ =
+ helper_->ReadCanonicalNameReference(); // read canonical_name.
+ if (++next_read_ == field) return;
+ /* Falls through */
+ case kName:
+ name_index_ = helper_->ReadStringReference(); // read name index.
+ if (++next_read_ == field) return;
+ /* Falls through */
+ case kSourceUriIndex:
+ source_uri_index_ = helper_->ReadUInt(); // read source_uri_index.
+ helper_->set_current_script_id(source_uri_index_);
+ if (++next_read_ == field) return;
+ /* Falls through */
+ case kAnnotations:
+ helper_->SkipListOfExpressions(); // read annotations.
+ if (++next_read_ == field) return;
+ /* Falls through */
+ case kDependencies: {
+ intptr_t dependency_count = helper_->ReadUInt(); // read list length.
+ for (intptr_t i = 0; i < dependency_count; ++i) {
+ helper_->SkipLibraryDependency();
+ }
+ if (++next_read_ == field) return;
+ }
+ /* Falls through */
+ case kAdditionalExports: {
+ intptr_t name_count = helper_->ReadUInt();
+ for (intptr_t i = 0; i < name_count; ++i) {
+ helper_->SkipCanonicalNameReference();
+ }
+ if (++next_read_ == field) return;
+ }
+ /* Falls through */
+ case kParts: {
+ intptr_t part_count = helper_->ReadUInt(); // read list length.
+ for (intptr_t i = 0; i < part_count; ++i) {
+ helper_->SkipLibraryPart();
+ }
+ if (++next_read_ == field) return;
+ }
+ /* Falls through */
+ case kTypedefs: {
+ intptr_t typedef_count = helper_->ReadListLength(); // read list length.
+ for (intptr_t i = 0; i < typedef_count; i++) {
+ helper_->SkipLibraryTypedef();
+ }
+ if (++next_read_ == field) return;
+ }
+ /* Falls through */
+ case kClasses: {
+ class_count_ = helper_->ReadListLength(); // read list length.
+ for (intptr_t i = 0; i < class_count_; ++i) {
+ ClassHelper class_helper(helper_);
+ class_helper.ReadUntilExcluding(ClassHelper::kEnd);
+ }
+ if (++next_read_ == field) return;
+ }
+ /* Falls through */
+ case kToplevelField: {
+ intptr_t field_count = helper_->ReadListLength(); // read list length.
+ for (intptr_t i = 0; i < field_count; ++i) {
+ FieldHelper field_helper(helper_);
+ field_helper.ReadUntilExcluding(FieldHelper::kEnd);
+ }
+ if (++next_read_ == field) return;
+ }
+ /* Falls through */
+ case kToplevelProcedures: {
+ procedure_count_ = helper_->ReadListLength(); // read list length.
+ for (intptr_t i = 0; i < procedure_count_; ++i) {
+ ProcedureHelper procedure_helper(helper_);
+ procedure_helper.ReadUntilExcluding(ProcedureHelper::kEnd);
+ }
+ if (++next_read_ == field) return;
+ }
+ /* Falls through */
+ case kLibraryIndex:
+ // Read library index.
+ for (intptr_t i = 0; i < class_count_; ++i) {
+ helper_->reader_.ReadUInt32();
+ }
+ helper_->reader_.ReadUInt32();
+ helper_->reader_.ReadUInt32();
+ for (intptr_t i = 0; i < procedure_count_; ++i) {
+ helper_->reader_.ReadUInt32();
+ }
+ helper_->reader_.ReadUInt32();
+ helper_->reader_.ReadUInt32();
+ if (++next_read_ == field) return;
+ /* Falls through */
+ case kEnd:
+ return;
+ }
+}
+
+void LibraryDependencyHelper::ReadUntilExcluding(Field field) {
+ if (field <= next_read_) return;
+
+ // Ordered with fall-through.
+ switch (next_read_) {
+ case kFileOffset: {
+ helper_->ReadPosition();
+ if (++next_read_ == field) return;
+ }
+ /* Falls through */
+ case kFlags: {
+ flags_ = helper_->ReadFlags();
+ if (++next_read_ == field) return;
+ }
+ /* Falls through */
+ case kAnnotations: {
+ helper_->SkipListOfExpressions();
+ if (++next_read_ == field) return;
+ }
+ /* Falls through */
+ case kTargetLibrary: {
+ target_library_canonical_name_ = helper_->ReadCanonicalNameReference();
+ if (++next_read_ == field) return;
+ }
+ /* Falls through */
+ case kName: {
+ name_index_ = helper_->ReadStringReference();
+ if (++next_read_ == field) return;
+ }
+ /* Falls through */
+ case kCombinators: {
+ intptr_t count = helper_->ReadListLength();
+ for (intptr_t i = 0; i < count; ++i) {
+ // Skip flags
+ helper_->SkipBytes(1);
+ // Skip list of names.
+ helper_->SkipListOfStrings();
+ }
+ if (++next_read_ == field) return;
+ }
+ /* Falls through */
+ case kEnd:
+ return;
+ }
+}
+
+MetadataHelper::MetadataHelper(KernelReaderHelper* helper,
+ const char* tag,
+ bool precompiler_only)
+ : helper_(helper),
+ translation_helper_(helper->translation_helper_),
+ tag_(tag),
+ mappings_scanned_(false),
+ precompiler_only_(precompiler_only),
+ mappings_offset_(0),
+ mappings_num_(0),
+ last_node_offset_(0),
+ last_mapping_index_(0) {}
+
+void MetadataHelper::SetMetadataMappings(intptr_t mappings_offset,
+ intptr_t mappings_num) {
+ ASSERT((mappings_offset_ == 0) && (mappings_num_ == 0));
+ ASSERT((mappings_offset != 0) && (mappings_num != 0));
+ mappings_offset_ = mappings_offset;
+ mappings_num_ = mappings_num;
+
+#ifdef DEBUG
+ // Verify that node offsets are sorted.
+ {
+ Reader reader(H.metadata_mappings());
+ reader.set_offset(mappings_offset);
+
+ intptr_t prev_node_offset = 0;
+ for (intptr_t i = 0; i < mappings_num; ++i) {
+ intptr_t node_offset = reader.ReadUInt32();
+ intptr_t md_offset = reader.ReadUInt32();
+
+ ASSERT((node_offset > 0) && (md_offset >= 0));
+ ASSERT(node_offset > prev_node_offset);
+ prev_node_offset = node_offset;
+ }
+ }
+#endif // DEBUG
+
+ last_node_offset_ = kIntptrMax;
+ last_mapping_index_ = 0;
+}
+
+void MetadataHelper::ScanMetadataMappings() {
+ const intptr_t kUInt32Size = 4;
+ Reader reader(H.metadata_mappings());
+ if (reader.size() == 0) {
+ return;
+ }
+
+ // Scan through metadata mappings in reverse direction.
+
+ // Read metadataMappings length.
+ intptr_t offset = reader.size() - kUInt32Size;
+ uint32_t metadata_num = reader.ReadUInt32At(offset);
+
+ if (metadata_num == 0) {
+ ASSERT(H.metadata_mappings().LengthInBytes() == kUInt32Size);
+ return;
+ }
+
+ // Read metadataMappings elements.
+ for (uint32_t i = 0; i < metadata_num; ++i) {
+ // Read nodeOffsetToMetadataOffset length.
+ offset -= kUInt32Size;
+ uint32_t mappings_num = reader.ReadUInt32At(offset);
+
+ // Skip nodeOffsetToMetadataOffset and read tag.
+ offset -= mappings_num * 2 * kUInt32Size + kUInt32Size;
+ StringIndex tag = StringIndex(reader.ReadUInt32At(offset));
+
+ if (mappings_num == 0) {
+ continue;
+ }
+
+ if (H.StringEquals(tag, tag_)) {
+ if ((!FLAG_precompiled_mode) && precompiler_only_) {
+ FATAL1("%s metadata is allowed in precompiled mode only", tag_);
+ }
+ SetMetadataMappings(offset + kUInt32Size, mappings_num);
+ return;
+ }
+ }
+}
+
+intptr_t MetadataHelper::FindMetadataMapping(intptr_t node_offset) {
+ const intptr_t kUInt32Size = 4;
+ ASSERT(mappings_num_ > 0);
+
+ Reader reader(H.metadata_mappings());
+
+ intptr_t left = 0;
+ intptr_t right = mappings_num_ - 1;
+ while (left < right) {
+ intptr_t mid = ((right - left) / 2) + left;
+ intptr_t mid_node_offset =
+ reader.ReadUInt32At(mappings_offset_ + mid * 2 * kUInt32Size);
+
+ if (node_offset < mid_node_offset) {
+ right = mid - 1;
+ } else if (node_offset > mid_node_offset) {
+ left = mid + 1;
+ } else {
+ return mid; // Exact match found.
+ }
+ }
+ ASSERT((0 <= left) && (left <= mappings_num_));
+
+ // Approximate match is found. Make sure it has an offset greater or equal
+ // to the given node offset.
+ if (left < mappings_num_) {
+ intptr_t found_node_offset =
+ reader.ReadUInt32At(mappings_offset_ + left * 2 * kUInt32Size);
+
+ if (found_node_offset < node_offset) {
+ ++left;
+ }
+ }
+ ASSERT((left == mappings_num_) ||
+ static_cast<intptr_t>(reader.ReadUInt32At(
+ mappings_offset_ + left * 2 * kUInt32Size)) >= node_offset);
+
+ return left;
+}
+
+intptr_t MetadataHelper::GetNextMetadataPayloadOffset(intptr_t node_offset) {
+ if (!mappings_scanned_) {
+ ScanMetadataMappings();
+ mappings_scanned_ = true;
+ }
+
+ if (mappings_num_ == 0) {
+ return -1; // No metadata.
+ }
+
+ node_offset += helper_->data_program_offset_;
+
+ // Nodes are parsed in linear order most of the time, so do the search
+ // only if looking back.
+ if (node_offset < last_node_offset_) {
+ last_mapping_index_ = FindMetadataMapping(node_offset);
+ }
+
+ intptr_t index = last_mapping_index_;
+ intptr_t mapping_node_offset = 0;
+ intptr_t mapping_md_offset = -1;
+
+ Reader reader(H.metadata_mappings());
+ const intptr_t kUInt32Size = 4;
+ reader.set_offset(mappings_offset_ + index * 2 * kUInt32Size);
+
+ for (; index < mappings_num_; ++index) {
+ mapping_node_offset = reader.ReadUInt32();
+ mapping_md_offset = reader.ReadUInt32();
+
+ if (mapping_node_offset >= node_offset) {
+ break;
+ }
+ }
+
+ last_mapping_index_ = index;
+ last_node_offset_ = node_offset;
+
+ if ((index < mappings_num_) && (mapping_node_offset == node_offset)) {
+ ASSERT(mapping_md_offset >= 0);
+ return mapping_md_offset;
+ } else {
+ return -1;
+ }
+}
+
+intptr_t KernelReaderHelper::ReaderOffset() const {
+ return reader_.offset();
+}
+
+void KernelReaderHelper::SetOffset(intptr_t offset) {
+ reader_.set_offset(offset);
+}
+
+void KernelReaderHelper::SkipBytes(intptr_t bytes) {
+ reader_.set_offset(ReaderOffset() + bytes);
+}
+
+bool KernelReaderHelper::ReadBool() {
+ return reader_.ReadBool();
+}
+
+uint8_t KernelReaderHelper::ReadByte() {
+ return reader_.ReadByte();
+}
+
+uint32_t KernelReaderHelper::ReadUInt() {
+ return reader_.ReadUInt();
+}
+
+uint32_t KernelReaderHelper::ReadUInt32() {
+ return reader_.ReadUInt32();
+}
+
+uint32_t KernelReaderHelper::PeekUInt() {
+ AlternativeReadingScope alt(&reader_);
+ return reader_.ReadUInt();
+}
+
+double KernelReaderHelper::ReadDouble() {
+ return reader_.ReadDouble();
+}
+
+uint32_t KernelReaderHelper::PeekListLength() {
+ AlternativeReadingScope alt(&reader_);
+ return reader_.ReadListLength();
+}
+
+intptr_t KernelReaderHelper::ReadListLength() {
+ return reader_.ReadListLength();
+}
+
+StringIndex KernelReaderHelper::ReadStringReference() {
+ return StringIndex(ReadUInt());
+}
+
+NameIndex KernelReaderHelper::ReadCanonicalNameReference() {
+ return reader_.ReadCanonicalNameReference();
+}
+
+StringIndex KernelReaderHelper::ReadNameAsStringIndex() {
+ StringIndex name_index = ReadStringReference(); // read name index.
+ if ((H.StringSize(name_index) >= 1) && H.CharacterAt(name_index, 0) == '_') {
+ ReadUInt(); // read library index.
+ }
+ return name_index;
+}
+
+const String& KernelReaderHelper::ReadNameAsMethodName() {
+ StringIndex name_index = ReadStringReference(); // read name index.
+ if ((H.StringSize(name_index) >= 1) && H.CharacterAt(name_index, 0) == '_') {
+ NameIndex library_reference =
+ ReadCanonicalNameReference(); // read library index.
+ return H.DartMethodName(library_reference, name_index);
+ } else {
+ return H.DartMethodName(NameIndex(), name_index);
+ }
+}
+
+const String& KernelReaderHelper::ReadNameAsSetterName() {
+ StringIndex name_index = ReadStringReference(); // read name index.
+ if ((H.StringSize(name_index) >= 1) && H.CharacterAt(name_index, 0) == '_') {
+ NameIndex library_reference =
+ ReadCanonicalNameReference(); // read library index.
+ return H.DartSetterName(library_reference, name_index);
+ } else {
+ return H.DartSetterName(NameIndex(), name_index);
+ }
+}
+
+const String& KernelReaderHelper::ReadNameAsGetterName() {
+ StringIndex name_index = ReadStringReference(); // read name index.
+ if ((H.StringSize(name_index) >= 1) && H.CharacterAt(name_index, 0) == '_') {
+ NameIndex library_reference =
+ ReadCanonicalNameReference(); // read library index.
+ return H.DartGetterName(library_reference, name_index);
+ } else {
+ return H.DartGetterName(NameIndex(), name_index);
+ }
+}
+
+const String& KernelReaderHelper::ReadNameAsFieldName() {
+ StringIndex name_index = ReadStringReference(); // read name index.
+ if ((H.StringSize(name_index) >= 1) && H.CharacterAt(name_index, 0) == '_') {
+ NameIndex library_reference =
+ ReadCanonicalNameReference(); // read library index.
+ return H.DartFieldName(library_reference, name_index);
+ } else {
+ return H.DartFieldName(NameIndex(), name_index);
+ }
+}
+
+void KernelReaderHelper::SkipFlags() {
+ ReadFlags();
+}
+
+void KernelReaderHelper::SkipStringReference() {
+ ReadUInt();
+}
+
+void KernelReaderHelper::SkipConstantReference() {
+ ReadUInt();
+}
+
+void KernelReaderHelper::SkipCanonicalNameReference() {
+ ReadUInt();
+}
+
+void KernelReaderHelper::ReportUnexpectedTag(const char* variant, Tag tag) {
+ H.ReportError(script_, TokenPosition::kNoSource,
+ "Unexpected tag %d (%s) in ?, expected %s", tag,
+ Reader::TagName(tag), variant);
+}
+
+void KernelReaderHelper::SkipDartType() {
+ Tag tag = ReadTag();
+ switch (tag) {
+ case kInvalidType:
+ case kDynamicType:
+ case kVoidType:
+ case kBottomType:
+ // those contain nothing.
+ return;
+ case kInterfaceType:
+ SkipInterfaceType(false);
+ return;
+ case kSimpleInterfaceType:
+ SkipInterfaceType(true);
+ return;
+ case kFunctionType:
+ SkipFunctionType(false);
+ return;
+ case kSimpleFunctionType:
+ SkipFunctionType(true);
+ return;
+ case kTypeParameterType:
+ ReadUInt(); // read index for parameter.
+ SkipOptionalDartType(); // read bound bound.
+ return;
+ default:
+ ReportUnexpectedTag("type", tag);
+ UNREACHABLE();
+ }
+}
+
+void KernelReaderHelper::SkipOptionalDartType() {
+ Tag tag = ReadTag(); // read tag.
+ if (tag == kNothing) {
+ return;
+ }
+ ASSERT(tag == kSomething);
+
+ SkipDartType(); // read type.
+}
+
+void KernelReaderHelper::SkipInterfaceType(bool simple) {
+ ReadUInt(); // read klass_name.
+ if (!simple) {
+ SkipListOfDartTypes(); // read list of types.
+ }
+}
+
+void KernelReaderHelper::SkipFunctionType(bool simple) {
+ if (!simple) {
+ SkipTypeParametersList(); // read type_parameters.
+ ReadUInt(); // read required parameter count.
+ ReadUInt(); // read total parameter count.
+ }
+
+ SkipListOfDartTypes(); // read positional_parameters types.
+
+ if (!simple) {
+ const intptr_t named_count =
+ ReadListLength(); // read named_parameters list length.
+ for (intptr_t i = 0; i < named_count; ++i) {
+ // read string reference (i.e. named_parameters[i].name).
+ SkipStringReference();
+ SkipDartType(); // read named_parameters[i].type.
+ }
+ }
+
+ SkipListOfStrings(); // read positional parameter names.
+
+ if (!simple) {
+ SkipCanonicalNameReference(); // read typedef reference.
+ }
+
+ SkipDartType(); // read return type.
+}
+
+void KernelReaderHelper::SkipStatementList() {
+ intptr_t list_length = ReadListLength(); // read list length.
+ for (intptr_t i = 0; i < list_length; ++i) {
+ SkipStatement(); // read ith expression.
+ }
+}
+
+void KernelReaderHelper::SkipListOfExpressions() {
+ intptr_t list_length = ReadListLength(); // read list length.
+ for (intptr_t i = 0; i < list_length; ++i) {
+ SkipExpression(); // read ith expression.
+ }
+}
+
+void KernelReaderHelper::SkipListOfDartTypes() {
+ intptr_t list_length = ReadListLength(); // read list length.
+ for (intptr_t i = 0; i < list_length; ++i) {
+ SkipDartType(); // read ith type.
+ }
+}
+
+void KernelReaderHelper::SkipListOfStrings() {
+ intptr_t list_length = ReadListLength(); // read list length.
+ for (intptr_t i = 0; i < list_length; ++i) {
+ SkipStringReference(); // read ith string index.
+ }
+}
+
+void KernelReaderHelper::SkipListOfVariableDeclarations() {
+ intptr_t list_length = ReadListLength(); // read list length.
+ for (intptr_t i = 0; i < list_length; ++i) {
+ SkipVariableDeclaration(); // read ith variable declaration.
+ }
+}
+
+void KernelReaderHelper::SkipTypeParametersList() {
+ intptr_t list_length = ReadListLength(); // read list length.
+ for (intptr_t i = 0; i < list_length; ++i) {
+ TypeParameterHelper helper(this);
+ helper.Finish();
+ }
+}
+
+void KernelReaderHelper::SkipInitializer() {
+ Tag tag = ReadTag();
+ ReadByte(); // read isSynthetic flag.
+ switch (tag) {
+ case kInvalidInitializer:
+ return;
+ case kFieldInitializer:
+ SkipCanonicalNameReference(); // read field_reference.
+ SkipExpression(); // read value.
+ return;
+ case kSuperInitializer:
+ SkipCanonicalNameReference(); // read target_reference.
+ SkipArguments(); // read arguments.
+ return;
+ case kRedirectingInitializer:
+ SkipCanonicalNameReference(); // read target_reference.
+ SkipArguments(); // read arguments.
+ return;
+ case kLocalInitializer:
+ SkipVariableDeclaration(); // read variable.
+ return;
+ case kAssertInitializer:
+ SkipStatement();
+ return;
+ default:
+ ReportUnexpectedTag("initializer", tag);
+ UNREACHABLE();
+ }
+}
+
+void KernelReaderHelper::SkipExpression() {
+ uint8_t payload = 0;
+ Tag tag = ReadTag(&payload);
+ switch (tag) {
+ case kInvalidExpression:
+ ReadPosition();
+ SkipStringReference();
+ return;
+ case kVariableGet:
+ ReadPosition(); // read position.
+ ReadUInt(); // read kernel position.
+ ReadUInt(); // read relative variable index.
+ SkipOptionalDartType(); // read promoted type.
+ return;
+ case kSpecializedVariableGet:
+ ReadPosition(); // read position.
+ ReadUInt(); // read kernel position.
+ return;
+ case kVariableSet:
+ ReadPosition(); // read position.
+ ReadUInt(); // read kernel position.
+ ReadUInt(); // read relative variable index.
+ SkipExpression(); // read expression.
+ return;
+ case kSpecializedVariableSet:
+ ReadPosition(); // read position.
+ ReadUInt(); // read kernel position.
+ SkipExpression(); // read expression.
+ return;
+ case kPropertyGet:
+ ReadPosition(); // read position.
+ SkipExpression(); // read receiver.
+ SkipName(); // read name.
+ SkipCanonicalNameReference(); // read interface_target_reference.
+ return;
+ case kPropertySet:
+ ReadPosition(); // read position.
+ SkipExpression(); // read receiver.
+ SkipName(); // read name.
+ SkipExpression(); // read value.
+ SkipCanonicalNameReference(); // read interface_target_reference.
+ return;
+ case kSuperPropertyGet:
+ ReadPosition(); // read position.
+ SkipName(); // read name.
+ SkipCanonicalNameReference(); // read interface_target_reference.
+ return;
+ case kSuperPropertySet:
+ ReadPosition(); // read position.
+ SkipName(); // read name.
+ SkipExpression(); // read value.
+ SkipCanonicalNameReference(); // read interface_target_reference.
+ return;
+ case kDirectPropertyGet:
+ ReadPosition(); // read position.
+ SkipExpression(); // read receiver.
+ SkipCanonicalNameReference(); // read target_reference.
+ return;
+ case kDirectPropertySet:
+ ReadPosition(); // read position.
+ SkipExpression(); // read receiver.
+ SkipCanonicalNameReference(); // read target_reference.
+ SkipExpression(); // read value·
+ return;
+ case kStaticGet:
+ ReadPosition(); // read position.
+ SkipCanonicalNameReference(); // read target_reference.
+ return;
+ case kStaticSet:
+ ReadPosition(); // read position.
+ SkipCanonicalNameReference(); // read target_reference.
+ SkipExpression(); // read expression.
+ return;
+ case kMethodInvocation:
+ ReadPosition(); // read position.
+ SkipExpression(); // read receiver.
+ SkipName(); // read name.
+ SkipArguments(); // read arguments.
+ SkipCanonicalNameReference(); // read interface_target_reference.
+ return;
+ case kSuperMethodInvocation:
+ ReadPosition(); // read position.
+ SkipName(); // read name.
+ SkipArguments(); // read arguments.
+ SkipCanonicalNameReference(); // read interface_target_reference.
+ return;
+ case kDirectMethodInvocation:
+ ReadPosition(); // read position.
+ SkipExpression(); // read receiver.
+ SkipCanonicalNameReference(); // read target_reference.
+ SkipArguments(); // read arguments.
+ return;
+ case kStaticInvocation:
+ case kConstStaticInvocation:
+ ReadPosition(); // read position.
+ SkipCanonicalNameReference(); // read procedure_reference.
+ SkipArguments(); // read arguments.
+ return;
+ case kConstructorInvocation:
+ case kConstConstructorInvocation:
+ ReadPosition(); // read position.
+ SkipCanonicalNameReference(); // read target_reference.
+ SkipArguments(); // read arguments.
+ return;
+ case kNot:
+ SkipExpression(); // read expression.
+ return;
+ case kLogicalExpression:
+ SkipExpression(); // read left.
+ SkipBytes(1); // read operator.
+ SkipExpression(); // read right.
+ return;
+ case kConditionalExpression:
+ SkipExpression(); // read condition.
+ SkipExpression(); // read then.
+ SkipExpression(); // read otherwise.
+ SkipOptionalDartType(); // read unused static type.
+ return;
+ case kStringConcatenation:
+ ReadPosition(); // read position.
+ SkipListOfExpressions(); // read list of expressions.
+ return;
+ case kIsExpression:
+ ReadPosition(); // read position.
+ SkipExpression(); // read operand.
+ SkipDartType(); // read type.
+ return;
+ case kAsExpression:
+ ReadPosition(); // read position.
+ SkipFlags(); // read flags.
+ SkipExpression(); // read operand.
+ SkipDartType(); // read type.
+ return;
+ case kSymbolLiteral:
+ SkipStringReference(); // read index into string table.
+ return;
+ case kTypeLiteral:
+ SkipDartType(); // read type.
+ return;
+ case kThisExpression:
+ return;
+ case kRethrow:
+ ReadPosition(); // read position.
+ return;
+ case kThrow:
+ ReadPosition(); // read position.
+ SkipExpression(); // read expression.
+ return;
+ case kListLiteral:
+ case kConstListLiteral:
+ ReadPosition(); // read position.
+ SkipDartType(); // read type.
+ SkipListOfExpressions(); // read list of expressions.
+ return;
+ case kMapLiteral:
+ case kConstMapLiteral: {
+ ReadPosition(); // read position.
+ SkipDartType(); // read key type.
+ SkipDartType(); // read value type.
+ intptr_t list_length = ReadListLength(); // read list length.
+ for (intptr_t i = 0; i < list_length; ++i) {
+ SkipExpression(); // read ith key.
+ SkipExpression(); // read ith value.
+ }
+ return;
+ }
+ case kFunctionExpression:
+ ReadPosition(); // read position.
+ SkipFunctionNode(); // read function node.
+ return;
+ case kLet:
+ SkipVariableDeclaration(); // read variable declaration.
+ SkipExpression(); // read expression.
+ return;
+ case kInstantiation:
+ SkipExpression(); // read expression.
+ SkipListOfDartTypes(); // read type arguments.
+ return;
+ case kBigIntLiteral:
+ SkipStringReference(); // read string reference.
+ return;
+ case kStringLiteral:
+ SkipStringReference(); // read string reference.
+ return;
+ case kSpecializedIntLiteral:
+ return;
+ case kNegativeIntLiteral:
+ ReadUInt(); // read value.
+ return;
+ case kPositiveIntLiteral:
+ ReadUInt(); // read value.
+ return;
+ case kDoubleLiteral:
+ ReadDouble(); // read value.
+ return;
+ case kTrueLiteral:
+ return;
+ case kFalseLiteral:
+ return;
+ case kNullLiteral:
+ return;
+ case kConstantExpression:
+ SkipConstantReference();
+ return;
+ case kLoadLibrary:
+ case kCheckLibraryIsLoaded:
+ ReadUInt(); // skip library index
+ return;
+ default:
+ ReportUnexpectedTag("expression", tag);
+ UNREACHABLE();
+ }
+}
+
+void KernelReaderHelper::SkipStatement() {
+ Tag tag = ReadTag(); // read tag.
+ switch (tag) {
+ case kExpressionStatement:
+ SkipExpression(); // read expression.
+ return;
+ case kBlock:
+ SkipStatementList();
+ return;
+ case kEmptyStatement:
+ return;
+ case kAssertBlock:
+ SkipStatementList();
+ return;
+ case kAssertStatement:
+ SkipExpression(); // Read condition.
+ ReadPosition(); // read condition start offset.
+ ReadPosition(); // read condition end offset.
+ if (ReadTag() == kSomething) {
+ SkipExpression(); // read (rest of) message.
+ }
+ return;
+ case kLabeledStatement:
+ SkipStatement(); // read body.
+ return;
+ case kBreakStatement:
+ ReadPosition(); // read position.
+ ReadUInt(); // read target_index.
+ return;
+ case kWhileStatement:
+ ReadPosition(); // read position.
+ SkipExpression(); // read condition.
+ SkipStatement(); // read body.
+ return;
+ case kDoStatement:
+ ReadPosition(); // read position.
+ SkipStatement(); // read body.
+ SkipExpression(); // read condition.
+ return;
+ case kForStatement: {
+ ReadPosition(); // read position.
+ SkipListOfVariableDeclarations(); // read variables.
+ Tag tag = ReadTag(); // Read first part of condition.
+ if (tag == kSomething) {
+ SkipExpression(); // read rest of condition.
+ }
+ SkipListOfExpressions(); // read updates.
+ SkipStatement(); // read body.
+ return;
+ }
+ case kForInStatement:
+ case kAsyncForInStatement:
+ ReadPosition(); // read position.
+ ReadPosition(); // read body position.
+ SkipVariableDeclaration(); // read variable.
+ SkipExpression(); // read iterable.
+ SkipStatement(); // read body.
+ return;
+ case kSwitchStatement: {
+ ReadPosition(); // read position.
+ SkipExpression(); // read condition.
+ int case_count = ReadListLength(); // read number of cases.
+ for (intptr_t i = 0; i < case_count; ++i) {
+ int expression_count = ReadListLength(); // read number of expressions.
+ for (intptr_t j = 0; j < expression_count; ++j) {
+ ReadPosition(); // read jth position.
+ SkipExpression(); // read jth expression.
+ }
+ ReadBool(); // read is_default.
+ SkipStatement(); // read body.
+ }
+ return;
+ }
+ case kContinueSwitchStatement:
+ ReadPosition(); // read position.
+ ReadUInt(); // read target_index.
+ return;
+ case kIfStatement:
+ ReadPosition(); // read position.
+ SkipExpression(); // read condition.
+ SkipStatement(); // read then.
+ SkipStatement(); // read otherwise.
+ return;
+ case kReturnStatement: {
+ ReadPosition(); // read position
+ Tag tag = ReadTag(); // read (first part of) expression.
+ if (tag == kSomething) {
+ SkipExpression(); // read (rest of) expression.
+ }
+ return;
+ }
+ case kTryCatch: {
+ SkipStatement(); // read body.
+ ReadByte(); // read flags
+ intptr_t catch_count = ReadListLength(); // read number of catches.
+ for (intptr_t i = 0; i < catch_count; ++i) {
+ ReadPosition(); // read position.
+ SkipDartType(); // read guard.
+ tag = ReadTag(); // read first part of exception.
+ if (tag == kSomething) {
+ SkipVariableDeclaration(); // read exception.
+ }
+ tag = ReadTag(); // read first part of stack trace.
+ if (tag == kSomething) {
+ SkipVariableDeclaration(); // read stack trace.
+ }
+ SkipStatement(); // read body.
+ }
+ return;
+ }
+ case kTryFinally:
+ SkipStatement(); // read body.
+ SkipStatement(); // read finalizer.
+ return;
+ case kYieldStatement: {
+ TokenPosition position = ReadPosition(); // read position.
+ RecordYieldPosition(position);
+ ReadByte(); // read flags.
+ SkipExpression(); // read expression.
+ return;
+ }
+ case kVariableDeclaration:
+ SkipVariableDeclaration(); // read variable declaration.
+ return;
+ case kFunctionDeclaration:
+ ReadPosition(); // read position.
+ SkipVariableDeclaration(); // read variable.
+ SkipFunctionNode(); // read function node.
+ return;
+ default:
+ ReportUnexpectedTag("statement", tag);
+ UNREACHABLE();
+ }
+}
+
+void KernelReaderHelper::SkipFunctionNode() {
+ FunctionNodeHelper function_node_helper(this);
+ function_node_helper.ReadUntilExcluding(FunctionNodeHelper::kEnd);
+}
+
+void KernelReaderHelper::SkipName() {
+ StringIndex name_index = ReadStringReference(); // read name index.
+ if ((H.StringSize(name_index) >= 1) && H.CharacterAt(name_index, 0) == '_') {
+ SkipCanonicalNameReference(); // read library index.
+ }
+}
+
+void KernelReaderHelper::SkipArguments() {
+ ReadUInt(); // read argument count.
+
+ SkipListOfDartTypes(); // read list of types.
+ SkipListOfExpressions(); // read positionals.
+
+ // List of named.
+ intptr_t list_length = ReadListLength(); // read list length.
+ for (intptr_t i = 0; i < list_length; ++i) {
+ SkipStringReference(); // read ith name index.
+ SkipExpression(); // read ith expression.
+ }
+}
+
+void KernelReaderHelper::SkipVariableDeclaration() {
+ VariableDeclarationHelper helper(this);
+ helper.ReadUntilExcluding(VariableDeclarationHelper::kEnd);
+}
+
+void KernelReaderHelper::SkipLibraryCombinator() {
+ ReadBool(); // read is_show.
+ intptr_t name_count = ReadUInt(); // read list length.
+ for (intptr_t j = 0; j < name_count; ++j) {
+ ReadUInt(); // read ith entry of name_indices.
+ }
+}
+
+void KernelReaderHelper::SkipLibraryDependency() {
+ ReadPosition(); // read file offset.
+ ReadFlags();
+ SkipListOfExpressions(); // Annotations.
+ ReadCanonicalNameReference();
+ ReadStringReference(); // Name.
+ intptr_t combinator_count = ReadListLength();
+ for (intptr_t i = 0; i < combinator_count; ++i) {
+ SkipLibraryCombinator();
+ }
+}
+
+void KernelReaderHelper::SkipLibraryPart() {
+ SkipListOfExpressions(); // Read annotations.
+ SkipStringReference(); // Read part URI index.
+}
+
+void KernelReaderHelper::SkipLibraryTypedef() {
+ SkipCanonicalNameReference(); // read canonical name.
+ ReadUInt(); // read source_uri_index.
+ ReadPosition(); // read position.
+ SkipStringReference(); // read name index.
+ SkipListOfExpressions(); // read annotations.
+ SkipTypeParametersList(); // read type parameters.
+ SkipDartType(); // read type.
+}
+
+TokenPosition KernelReaderHelper::ReadPosition(bool record) {
+ TokenPosition position = reader_.ReadPosition();
+ if (record) {
+ RecordTokenPosition(position);
+ }
+ return position;
+}
+
+} // namespace kernel
+} // namespace dart
+
+#endif // !defined(DART_PRECOMPILED_RUNTIME)
diff --git a/runtime/vm/compiler/frontend/kernel_translation_helper.h b/runtime/vm/compiler/frontend/kernel_translation_helper.h
new file mode 100644
index 0000000..75d4566
--- /dev/null
+++ b/runtime/vm/compiler/frontend/kernel_translation_helper.h
@@ -0,0 +1,917 @@
+// Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+#ifndef RUNTIME_VM_COMPILER_FRONTEND_KERNEL_TRANSLATION_HELPER_H_
+#define RUNTIME_VM_COMPILER_FRONTEND_KERNEL_TRANSLATION_HELPER_H_
+
+#include "vm/kernel.h"
+#include "vm/kernel_binary.h"
+#include "vm/object.h"
+
+#if !defined(DART_PRECOMPILED_RUNTIME)
+
+namespace dart {
+namespace kernel {
+
+class KernelReaderHelper;
+
+class TranslationHelper {
+ public:
+ explicit TranslationHelper(Thread* thread);
+
+ virtual ~TranslationHelper() {}
+
+ void Reset();
+
+ void InitFromScript(const Script& script);
+
+ void InitFromKernelProgramInfo(const KernelProgramInfo& info);
+
+ Thread* thread() { return thread_; }
+
+ Zone* zone() { return zone_; }
+
+ Isolate* isolate() { return isolate_; }
+
+ Heap::Space allocation_space() { return allocation_space_; }
+
+ // Access to strings.
+ const TypedData& string_offsets() { return string_offsets_; }
+ void SetStringOffsets(const TypedData& string_offsets);
+
+ const ExternalTypedData& string_data() { return string_data_; }
+ void SetStringData(const ExternalTypedData& string_data);
+
+ const TypedData& canonical_names() { return canonical_names_; }
+ void SetCanonicalNames(const TypedData& canonical_names);
+
+ const ExternalTypedData& metadata_payloads() { return metadata_payloads_; }
+ void SetMetadataPayloads(const ExternalTypedData& metadata_payloads);
+
+ const ExternalTypedData& metadata_mappings() { return metadata_mappings_; }
+ void SetMetadataMappings(const ExternalTypedData& metadata_mappings);
+
+ const Array& constants() { return constants_; }
+ void SetConstants(const Array& constants);
+
+ intptr_t StringOffset(StringIndex index) const;
+ intptr_t StringSize(StringIndex index) const;
+
+ // The address of the backing store of the string with a given index. If the
+ // backing store is in the VM's heap this address is not safe for GC (call the
+ // function and use the result within a NoSafepointScope).
+ uint8_t* StringBuffer(StringIndex index) const;
+
+ uint8_t CharacterAt(StringIndex string_index, intptr_t index);
+ bool StringEquals(StringIndex string_index, const char* other);
+
+ // Accessors and predicates for canonical names.
+ NameIndex CanonicalNameParent(NameIndex name);
+ StringIndex CanonicalNameString(NameIndex name);
+ bool IsAdministrative(NameIndex name);
+ bool IsPrivate(NameIndex name);
+ bool IsRoot(NameIndex name);
+ bool IsLibrary(NameIndex name);
+ bool IsClass(NameIndex name);
+ bool IsMember(NameIndex name);
+ bool IsField(NameIndex name);
+ bool IsConstructor(NameIndex name);
+ bool IsProcedure(NameIndex name);
+ bool IsMethod(NameIndex name);
+ bool IsGetter(NameIndex name);
+ bool IsSetter(NameIndex name);
+ bool IsFactory(NameIndex name);
+
+ // For a member (field, constructor, or procedure) return the canonical name
+ // of the enclosing class or library.
+ NameIndex EnclosingName(NameIndex name);
+
+ RawInstance* Canonicalize(const Instance& instance);
+
+ const String& DartString(const char* content) {
+ return DartString(content, allocation_space_);
+ }
+ const String& DartString(const char* content, Heap::Space space);
+
+ String& DartString(StringIndex index) {
+ return DartString(index, allocation_space_);
+ }
+ String& DartString(StringIndex string_index, Heap::Space space);
+
+ String& DartString(const uint8_t* utf8_array,
+ intptr_t len,
+ Heap::Space space);
+
+ const String& DartSymbolPlain(const char* content) const;
+ String& DartSymbolPlain(StringIndex string_index) const;
+ const String& DartSymbolObfuscate(const char* content) const;
+ String& DartSymbolObfuscate(StringIndex string_index) const;
+
+ String& DartIdentifier(const Library& lib, StringIndex string_index);
+
+ const String& DartClassName(NameIndex kernel_class);
+
+ const String& DartConstructorName(NameIndex constructor);
+
+ const String& DartProcedureName(NameIndex procedure);
+
+ const String& DartSetterName(NameIndex setter);
+ const String& DartSetterName(NameIndex parent, StringIndex setter);
+
+ const String& DartGetterName(NameIndex getter);
+ const String& DartGetterName(NameIndex parent, StringIndex getter);
+
+ const String& DartFieldName(NameIndex field);
+ const String& DartFieldName(NameIndex parent, StringIndex field);
+
+ const String& DartMethodName(NameIndex method);
+ const String& DartMethodName(NameIndex parent, StringIndex method);
+
+ const String& DartFactoryName(NameIndex factory);
+
+ // A subclass overrides these when reading in the Kernel program in order to
+ // support recursive type expressions (e.g. for "implements X" ...
+ // annotations).
+ virtual RawLibrary* LookupLibraryByKernelLibrary(NameIndex library);
+ virtual RawClass* LookupClassByKernelClass(NameIndex klass);
+
+ RawField* LookupFieldByKernelField(NameIndex field);
+ RawFunction* LookupStaticMethodByKernelProcedure(NameIndex procedure);
+ RawFunction* LookupConstructorByKernelConstructor(NameIndex constructor);
+ RawFunction* LookupConstructorByKernelConstructor(const Class& owner,
+ NameIndex constructor);
+ RawFunction* LookupConstructorByKernelConstructor(
+ const Class& owner,
+ StringIndex constructor_name);
+ RawFunction* LookupMethodByMember(NameIndex target,
+ const String& method_name);
+
+ Type& GetCanonicalType(const Class& klass);
+
+ void ReportError(const char* format, ...);
+ void ReportError(const Script& script,
+ const TokenPosition position,
+ const char* format,
+ ...);
+ void ReportError(const Error& prev_error, const char* format, ...);
+ void ReportError(const Error& prev_error,
+ const Script& script,
+ const TokenPosition position,
+ const char* format,
+ ...);
+
+ private:
+ // This will mangle [name_to_modify] if necessary and make the result a symbol
+ // if asked. The result will be available in [name_to_modify] and it is also
+ // returned. If the name is private, the canonical name [parent] will be used
+ // to get the import URI of the library where the name is visible.
+ String& ManglePrivateName(NameIndex parent,
+ String* name_to_modify,
+ bool symbolize = true,
+ bool obfuscate = true);
+ String& ManglePrivateName(const Library& library,
+ String* name_to_modify,
+ bool symbolize = true,
+ bool obfuscate = true);
+
+ Thread* thread_;
+ Zone* zone_;
+ Isolate* isolate_;
+ Heap::Space allocation_space_;
+
+ TypedData& string_offsets_;
+ ExternalTypedData& string_data_;
+ TypedData& canonical_names_;
+ ExternalTypedData& metadata_payloads_;
+ ExternalTypedData& metadata_mappings_;
+ Array& constants_;
+};
+
+// Helper class that reads a kernel FunctionNode from binary.
+//
+// Use ReadUntilExcluding to read up to but not including a field.
+// One can then for instance read the field from the call-site (and remember to
+// call SetAt to inform this helper class), and then use this to read more.
+// Simple fields are stored (e.g. integers) and can be fetched from this class.
+// If asked to read a compound field (e.g. an expression) it will be skipped.
+class FunctionNodeHelper {
+ public:
+ enum Field {
+ kStart, // tag.
+ kPosition,
+ kEndPosition,
+ kAsyncMarker,
+ kDartAsyncMarker,
+ kTypeParameters,
+ kTotalParameterCount,
+ kRequiredParameterCount,
+ kPositionalParameters,
+ kNamedParameters,
+ kReturnType,
+ kBody,
+ kEnd,
+ };
+
+ enum AsyncMarker {
+ kSync = 0,
+ kSyncStar = 1,
+ kAsync = 2,
+ kAsyncStar = 3,
+ kSyncYielding = 4,
+ };
+
+ explicit FunctionNodeHelper(KernelReaderHelper* helper) {
+ helper_ = helper;
+ next_read_ = kStart;
+ }
+
+ void ReadUntilIncluding(Field field) {
+ ReadUntilExcluding(static_cast<Field>(static_cast<int>(field) + 1));
+ }
+
+ void ReadUntilExcluding(Field field);
+
+ void SetNext(Field field) { next_read_ = field; }
+ void SetJustRead(Field field) { next_read_ = field + 1; }
+
+ TokenPosition position_;
+ TokenPosition end_position_;
+ AsyncMarker async_marker_;
+ AsyncMarker dart_async_marker_;
+ intptr_t total_parameter_count_;
+ intptr_t required_parameter_count_;
+
+ private:
+ KernelReaderHelper* helper_;
+ intptr_t next_read_;
+};
+
+class TypeParameterHelper {
+ public:
+ enum Field {
+ kStart, // tag.
+ kFlags,
+ kAnnotations,
+ kName,
+ kBound,
+ kDefaultType,
+ kEnd,
+ };
+
+ enum Flag {
+ kIsGenericCovariantImpl = 1 << 0,
+ };
+
+ explicit TypeParameterHelper(KernelReaderHelper* helper) {
+ helper_ = helper;
+ next_read_ = kStart;
+ }
+
+ void ReadUntilIncluding(Field field) {
+ ReadUntilExcluding(static_cast<Field>(static_cast<int>(field) + 1));
+ }
+
+ void ReadUntilExcluding(Field field);
+
+ void SetNext(Field field) { next_read_ = field; }
+ void SetJustRead(Field field) { next_read_ = field + 1; }
+
+ void ReadUntilExcludingAndSetJustRead(Field field) {
+ ReadUntilExcluding(field);
+ SetJustRead(field);
+ }
+
+ void Finish() { ReadUntilExcluding(kEnd); }
+
+ bool IsGenericCovariantImpl() {
+ return (flags_ & kIsGenericCovariantImpl) != 0;
+ }
+
+ TokenPosition position_;
+ uint8_t flags_;
+ StringIndex name_index_;
+
+ private:
+ KernelReaderHelper* helper_;
+ intptr_t next_read_;
+};
+
+// Helper class that reads a kernel VariableDeclaration from binary.
+//
+// Use ReadUntilExcluding to read up to but not including a field.
+// One can then for instance read the field from the call-site (and remember to
+// call SetAt to inform this helper class), and then use this to read more.
+// Simple fields are stored (e.g. integers) and can be fetched from this class.
+// If asked to read a compound field (e.g. an expression) it will be skipped.
+class VariableDeclarationHelper {
+ public:
+ enum Field {
+ kPosition,
+ kEqualPosition,
+ kAnnotations,
+ kFlags,
+ kNameIndex,
+ kType,
+ kInitializer,
+ kEnd,
+ };
+
+ enum Flag {
+ kFinal = 1 << 0,
+ kConst = 1 << 1,
+ kCovariant = 1 << 3,
+ kIsGenericCovariantImpl = 1 << 5,
+ };
+
+ explicit VariableDeclarationHelper(KernelReaderHelper* helper)
+ : helper_(helper), next_read_(kPosition) {}
+
+ void ReadUntilIncluding(Field field) {
+ ReadUntilExcluding(static_cast<Field>(static_cast<int>(field) + 1));
+ }
+
+ void ReadUntilExcluding(Field field);
+
+ void SetNext(Field field) { next_read_ = field; }
+ void SetJustRead(Field field) { next_read_ = field + 1; }
+
+ bool IsConst() { return (flags_ & kConst) != 0; }
+ bool IsFinal() { return (flags_ & kFinal) != 0; }
+ bool IsCovariant() { return (flags_ & kCovariant) != 0; }
+
+ bool IsGenericCovariantImpl() {
+ return (flags_ & kIsGenericCovariantImpl) != 0;
+ }
+
+ TokenPosition position_;
+ TokenPosition equals_position_;
+ uint8_t flags_;
+ StringIndex name_index_;
+
+ private:
+ KernelReaderHelper* helper_;
+ intptr_t next_read_;
+};
+
+// Helper class that reads a kernel Field from binary.
+//
+// Use ReadUntilExcluding to read up to but not including a field.
+// One can then for instance read the field from the call-site (and remember to
+// call SetAt to inform this helper class), and then use this to read more.
+// Simple fields are stored (e.g. integers) and can be fetched from this class.
+// If asked to read a compound field (e.g. an expression) it will be skipped.
+class FieldHelper {
+ public:
+ enum Field {
+ kStart, // tag.
+ kCanonicalName,
+ kSourceUriIndex,
+ kPosition,
+ kEndPosition,
+ kFlags,
+ kName,
+ kAnnotations,
+ kType,
+ kInitializer,
+ kEnd,
+ };
+
+ enum Flag {
+ kFinal = 1 << 0,
+ kConst = 1 << 1,
+ kStatic = 1 << 2,
+ kIsCovariant = 1 << 5,
+ kIsGenericCovariantImpl = 1 << 6,
+ };
+
+ explicit FieldHelper(KernelReaderHelper* helper)
+ : helper_(helper),
+ next_read_(kStart),
+ has_function_literal_initializer_(false) {}
+
+ FieldHelper(KernelReaderHelper* helper, intptr_t offset);
+
+ void ReadUntilIncluding(Field field) {
+ ReadUntilExcluding(static_cast<Field>(static_cast<int>(field) + 1));
+ }
+
+ void ReadUntilExcluding(Field field,
+ bool detect_function_literal_initializer = false);
+
+ void SetNext(Field field) { next_read_ = field; }
+ void SetJustRead(Field field) { next_read_ = field + 1; }
+
+ bool IsConst() { return (flags_ & kConst) != 0; }
+ bool IsFinal() { return (flags_ & kFinal) != 0; }
+ bool IsStatic() { return (flags_ & kStatic) != 0; }
+ bool IsCovariant() const { return (flags_ & kIsCovariant) != 0; }
+ bool IsGenericCovariantImpl() {
+ return (flags_ & kIsGenericCovariantImpl) != 0;
+ }
+
+ bool FieldHasFunctionLiteralInitializer(TokenPosition* start,
+ TokenPosition* end) {
+ if (has_function_literal_initializer_) {
+ *start = function_literal_start_;
+ *end = function_literal_end_;
+ }
+ return has_function_literal_initializer_;
+ }
+
+ NameIndex canonical_name_;
+ TokenPosition position_;
+ TokenPosition end_position_;
+ uint8_t flags_;
+ intptr_t source_uri_index_;
+ intptr_t annotation_count_;
+
+ private:
+ KernelReaderHelper* helper_;
+ intptr_t next_read_;
+
+ bool has_function_literal_initializer_;
+ TokenPosition function_literal_start_;
+ TokenPosition function_literal_end_;
+};
+
+// Helper class that reads a kernel Procedure from binary.
+//
+// Use ReadUntilExcluding to read up to but not including a field.
+// One can then for instance read the field from the call-site (and remember to
+// call SetAt to inform this helper class), and then use this to read more.
+// Simple fields are stored (e.g. integers) and can be fetched from this class.
+// If asked to read a compound field (e.g. an expression) it will be skipped.
+class ProcedureHelper {
+ public:
+ enum Field {
+ kStart, // tag.
+ kCanonicalName,
+ kSourceUriIndex,
+ kStartPosition,
+ kPosition,
+ kEndPosition,
+ kKind,
+ kFlags,
+ kName,
+ kAnnotations,
+ kForwardingStubSuperTarget,
+ kForwardingStubInterfaceTarget,
+ kFunction,
+ kEnd,
+ };
+
+ enum Kind {
+ kMethod,
+ kGetter,
+ kSetter,
+ kOperator,
+ kFactory,
+ };
+
+ enum Flag {
+ kStatic = 1 << 0,
+ kAbstract = 1 << 1,
+ kExternal = 1 << 2,
+ kConst = 1 << 3, // Only for external const factories.
+ kForwardingStub = 1 << 4,
+
+ // TODO(29841): Remove this line after the issue is resolved.
+ kRedirectingFactoryConstructor = 1 << 6,
+ kNoSuchMethodForwarder = 1 << 7,
+ };
+
+ explicit ProcedureHelper(KernelReaderHelper* helper)
+ : helper_(helper), next_read_(kStart) {}
+
+ void ReadUntilIncluding(Field field) {
+ ReadUntilExcluding(static_cast<Field>(static_cast<int>(field) + 1));
+ }
+
+ void ReadUntilExcluding(Field field);
+
+ void SetNext(Field field) { next_read_ = field; }
+ void SetJustRead(Field field) { next_read_ = field + 1; }
+
+ bool IsStatic() { return (flags_ & kStatic) != 0; }
+ bool IsAbstract() { return (flags_ & kAbstract) != 0; }
+ bool IsExternal() { return (flags_ & kExternal) != 0; }
+ bool IsConst() { return (flags_ & kConst) != 0; }
+ bool IsForwardingStub() { return (flags_ & kForwardingStub) != 0; }
+ bool IsRedirectingFactoryConstructor() {
+ return (flags_ & kRedirectingFactoryConstructor) != 0;
+ }
+
+ NameIndex canonical_name_;
+ TokenPosition start_position_;
+ TokenPosition position_;
+ TokenPosition end_position_;
+ Kind kind_;
+ uint8_t flags_;
+ intptr_t source_uri_index_;
+ intptr_t annotation_count_;
+
+ // Only valid if the 'isForwardingStub' flag is set.
+ NameIndex forwarding_stub_super_target_;
+
+ private:
+ KernelReaderHelper* helper_;
+ intptr_t next_read_;
+};
+
+// Helper class that reads a kernel Constructor from binary.
+//
+// Use ReadUntilExcluding to read up to but not including a field.
+// One can then for instance read the field from the call-site (and remember to
+// call SetAt to inform this helper class), and then use this to read more.
+// Simple fields are stored (e.g. integers) and can be fetched from this class.
+// If asked to read a compound field (e.g. an expression) it will be skipped.
+class ConstructorHelper {
+ public:
+ enum Field {
+ kStart, // tag.
+ kCanonicalName,
+ kSourceUriIndex,
+ kStartPosition,
+ kPosition,
+ kEndPosition,
+ kFlags,
+ kName,
+ kAnnotations,
+ kFunction,
+ kInitializers,
+ kEnd,
+ };
+
+ enum Flag {
+ kConst = 1 << 0,
+ kExternal = 1 << 1,
+ kSynthetic = 1 << 2,
+ };
+
+ explicit ConstructorHelper(KernelReaderHelper* helper)
+ : helper_(helper), next_read_(kStart) {}
+
+ void ReadUntilIncluding(Field field) {
+ ReadUntilExcluding(static_cast<Field>(static_cast<int>(field) + 1));
+ }
+
+ void ReadUntilExcluding(Field field);
+
+ void SetNext(Field field) { next_read_ = field; }
+ void SetJustRead(Field field) { next_read_ = field + 1; }
+
+ bool IsExternal() { return (flags_ & kExternal) != 0; }
+ bool IsConst() { return (flags_ & kConst) != 0; }
+ bool IsSynthetic() { return (flags_ & kSynthetic) != 0; }
+
+ NameIndex canonical_name_;
+ TokenPosition start_position_;
+ TokenPosition position_;
+ TokenPosition end_position_;
+ uint8_t flags_;
+ intptr_t source_uri_index_;
+ intptr_t annotation_count_;
+
+ private:
+ KernelReaderHelper* helper_;
+ intptr_t next_read_;
+};
+
+// Helper class that reads a kernel Class from binary.
+//
+// Use ReadUntilExcluding to read up to but not including a field.
+// One can then for instance read the field from the call-site (and remember to
+// call SetAt to inform this helper class), and then use this to read more.
+// Simple fields are stored (e.g. integers) and can be fetched from this class.
+// If asked to read a compound field (e.g. an expression) it will be skipped.
+class ClassHelper {
+ public:
+ enum Field {
+ kStart, // tag.
+ kCanonicalName,
+ kSourceUriIndex,
+ kStartPosition,
+ kPosition,
+ kEndPosition,
+ kFlags,
+ kNameIndex,
+ kAnnotations,
+ kTypeParameters,
+ kSuperClass,
+ kMixinType,
+ kImplementedClasses,
+ kFields,
+ kConstructors,
+ kProcedures,
+ kClassIndex,
+ kEnd,
+ };
+
+ enum Flag {
+ kIsAbstract = 1 << 2,
+ kIsEnumClass = 1 << 3,
+ kIsAnonymousMixin = 1 << 4,
+ kIsEliminatedMixin = 1 << 5,
+ };
+
+ explicit ClassHelper(KernelReaderHelper* helper)
+ : helper_(helper), next_read_(kStart) {}
+
+ void ReadUntilIncluding(Field field) {
+ ReadUntilExcluding(static_cast<Field>(static_cast<int>(field) + 1));
+ }
+
+ void ReadUntilExcluding(Field field);
+
+ void SetNext(Field field) { next_read_ = field; }
+ void SetJustRead(Field field) { next_read_ = field + 1; }
+
+ bool is_abstract() const { return flags_ & Flag::kIsAbstract; }
+
+ bool is_enum_class() const { return flags_ & Flag::kIsEnumClass; }
+
+ bool is_transformed_mixin_application() const {
+ return flags_ & Flag::kIsEliminatedMixin;
+ }
+
+ NameIndex canonical_name_;
+ TokenPosition start_position_;
+ TokenPosition position_;
+ TokenPosition end_position_;
+ StringIndex name_index_;
+ intptr_t source_uri_index_;
+ intptr_t annotation_count_;
+ intptr_t procedure_count_;
+ uint8_t flags_;
+
+ private:
+ KernelReaderHelper* helper_;
+ intptr_t next_read_;
+};
+
+// Helper class that reads a kernel Library from binary.
+//
+// Use ReadUntilExcluding to read up to but not including a field.
+// One can then for instance read the field from the call-site (and remember to
+// call SetAt to inform this helper class), and then use this to read more.
+// Simple fields are stored (e.g. integers) and can be fetched from this class.
+// If asked to read a compound field (e.g. an expression) it will be skipped.
+class LibraryHelper {
+ public:
+ enum Field {
+ kFlags,
+ kCanonicalName,
+ kName,
+ kSourceUriIndex,
+ kAnnotations,
+ kDependencies,
+ kAdditionalExports,
+ kParts,
+ kTypedefs,
+ kClasses,
+ kToplevelField,
+ kToplevelProcedures,
+ kLibraryIndex,
+ kEnd,
+ };
+
+ enum Flag {
+ kExternal = 1,
+ };
+
+ explicit LibraryHelper(KernelReaderHelper* helper)
+ : helper_(helper), next_read_(kFlags) {}
+
+ void ReadUntilIncluding(Field field) {
+ ReadUntilExcluding(static_cast<Field>(static_cast<int>(field) + 1));
+ }
+
+ void ReadUntilExcluding(Field field);
+
+ void SetNext(Field field) { next_read_ = field; }
+ void SetJustRead(Field field) { next_read_ = field + 1; }
+
+ bool IsExternal() const { return (flags_ & kExternal) != 0; }
+
+ uint8_t flags_;
+ NameIndex canonical_name_;
+ StringIndex name_index_;
+ intptr_t source_uri_index_;
+ intptr_t class_count_;
+ intptr_t procedure_count_;
+
+ private:
+ KernelReaderHelper* helper_;
+ intptr_t next_read_;
+};
+
+class LibraryDependencyHelper {
+ public:
+ enum Field {
+ kFileOffset,
+ kFlags,
+ kAnnotations,
+ kTargetLibrary,
+ kName,
+ kCombinators,
+ kEnd,
+ };
+
+ enum Flag {
+ Export = 1 << 0,
+ Deferred = 1 << 1,
+ };
+
+ enum CombinatorFlag {
+ Show = 1 << 0,
+ };
+
+ explicit LibraryDependencyHelper(KernelReaderHelper* helper)
+ : helper_(helper), next_read_(kFileOffset) {}
+
+ void ReadUntilIncluding(Field field) {
+ ReadUntilExcluding(static_cast<Field>(static_cast<int>(field) + 1));
+ }
+
+ void ReadUntilExcluding(Field field);
+
+ uint8_t flags_;
+ StringIndex name_index_;
+ NameIndex target_library_canonical_name_;
+
+ private:
+ KernelReaderHelper* helper_;
+ intptr_t next_read_;
+};
+
+// Base class for helpers accessing metadata of a certain kind.
+// Assumes that metadata is accessed in linear order.
+class MetadataHelper {
+ public:
+ MetadataHelper(KernelReaderHelper* helper,
+ const char* tag,
+ bool precompiler_only);
+
+ protected:
+ // Look for metadata mapping with node offset greater or equal than the given.
+ intptr_t FindMetadataMapping(intptr_t node_offset);
+
+ // Return offset of the metadata payload corresponding to the given node,
+ // or -1 if there is no metadata.
+ // Assumes metadata is accesses for nodes in linear order most of the time.
+ intptr_t GetNextMetadataPayloadOffset(intptr_t node_offset);
+
+ KernelReaderHelper* helper_;
+ TranslationHelper& translation_helper_;
+
+ private:
+ void SetMetadataMappings(intptr_t mappings_offset, intptr_t mappings_num);
+ void ScanMetadataMappings();
+
+ const char* tag_;
+ bool mappings_scanned_;
+ bool precompiler_only_;
+ intptr_t mappings_offset_;
+ intptr_t mappings_num_;
+ intptr_t last_node_offset_;
+ intptr_t last_mapping_index_;
+};
+
+class KernelReaderHelper {
+ public:
+ KernelReaderHelper(Zone* zone,
+ TranslationHelper* translation_helper,
+ const Script& script,
+ const ExternalTypedData& data,
+ intptr_t data_program_offset)
+ : zone_(zone),
+ translation_helper_(*translation_helper),
+ reader_(data),
+ script_(script),
+ data_program_offset_(data_program_offset) {}
+
+ KernelReaderHelper(Zone* zone,
+ TranslationHelper* translation_helper,
+ const uint8_t* data_buffer,
+ intptr_t buffer_length,
+ intptr_t data_program_offset)
+ : zone_(zone),
+ translation_helper_(*translation_helper),
+ reader_(data_buffer, buffer_length),
+ script_(Script::Handle(zone_)),
+ data_program_offset_(data_program_offset) {}
+
+ virtual ~KernelReaderHelper() = default;
+
+ void SetOffset(intptr_t offset);
+
+ intptr_t ReadListLength();
+ virtual void ReportUnexpectedTag(const char* variant, Tag tag);
+
+ protected:
+ const Script& script() const { return script_; }
+
+ virtual void set_current_script_id(intptr_t id) {
+ // Do nothing by default. This is overridden in StreamingFlowGraphBuilder.
+ USE(id);
+ }
+
+ virtual void RecordYieldPosition(TokenPosition position) {
+ // Do nothing by default. This is overridden in StreamingFlowGraphBuilder.
+ USE(position);
+ }
+
+ virtual void RecordTokenPosition(TokenPosition position) {
+ // Do nothing by default. This is overridden in StreamingFlowGraphBuilder.
+ USE(position);
+ }
+
+ intptr_t ReaderOffset() const;
+ void SkipBytes(intptr_t skip);
+ bool ReadBool();
+ uint8_t ReadByte();
+ uint32_t ReadUInt();
+ uint32_t ReadUInt32();
+ uint32_t PeekUInt();
+ double ReadDouble();
+ uint32_t PeekListLength();
+ StringIndex ReadStringReference();
+ NameIndex ReadCanonicalNameReference();
+ StringIndex ReadNameAsStringIndex();
+ const String& ReadNameAsMethodName();
+ const String& ReadNameAsGetterName();
+ const String& ReadNameAsSetterName();
+ const String& ReadNameAsFieldName();
+ void SkipFlags();
+ void SkipStringReference();
+ void SkipConstantReference();
+ void SkipCanonicalNameReference();
+ void SkipDartType();
+ void SkipOptionalDartType();
+ void SkipInterfaceType(bool simple);
+ void SkipFunctionType(bool simple);
+ void SkipStatementList();
+ void SkipListOfExpressions();
+ void SkipListOfDartTypes();
+ void SkipListOfStrings();
+ void SkipListOfVariableDeclarations();
+ void SkipTypeParametersList();
+ void SkipInitializer();
+ void SkipExpression();
+ void SkipStatement();
+ void SkipFunctionNode();
+ void SkipName();
+ void SkipArguments();
+ void SkipVariableDeclaration();
+ void SkipLibraryCombinator();
+ void SkipLibraryDependency();
+ void SkipLibraryPart();
+ void SkipLibraryTypedef();
+ TokenPosition ReadPosition(bool record = true);
+ Tag ReadTag(uint8_t* payload = NULL);
+ Tag PeekTag(uint8_t* payload = NULL);
+ uint8_t ReadFlags() { return reader_.ReadFlags(); }
+
+ Zone* zone_;
+ TranslationHelper& translation_helper_;
+ Reader reader_;
+ const Script& script_;
+ // Some items like variables are specified in the kernel binary as
+ // absolute offsets (as in, offsets within the whole kernel program)
+ // of their declaration nodes. Hence, to cache and/or access them
+ // uniquely from within a function's kernel data, we need to
+ // add/subtract the offset of the kernel data in the over all
+ // kernel program.
+ intptr_t data_program_offset_;
+
+ friend class ClassHelper;
+ friend class ConstantHelper;
+ friend class ConstructorHelper;
+ friend class DirectCallMetadataHelper;
+ friend class FieldHelper;
+ friend class FunctionNodeHelper;
+ friend class InferredTypeMetadataHelper;
+ friend class KernelLoader;
+ friend class LibraryDependencyHelper;
+ friend class LibraryHelper;
+ friend class MetadataHelper;
+ friend class ProcedureAttributesMetadataHelper;
+ friend class ProcedureHelper;
+ friend class SimpleExpressionConverter;
+ friend class StreamingConstantEvaluator;
+ friend class StreamingScopeBuilder;
+ friend class TypeParameterHelper;
+ friend class TypeTranslator;
+ friend class VariableDeclarationHelper;
+
+#if defined(DART_USE_INTERPRETER)
+ friend class BytecodeMetadataHelper;
+#endif // defined(DART_USE_INTERPRETER)
+};
+
+} // namespace kernel
+} // namespace dart
+
+#endif // !defined(DART_PRECOMPILED_RUNTIME)
+#endif // RUNTIME_VM_COMPILER_FRONTEND_KERNEL_TRANSLATION_HELPER_H_
diff --git a/runtime/vm/compiler/frontend/prologue_builder.cc b/runtime/vm/compiler/frontend/prologue_builder.cc
index 3e32dbc..117f76c 100644
--- a/runtime/vm/compiler/frontend/prologue_builder.cc
+++ b/runtime/vm/compiler/frontend/prologue_builder.cc
@@ -87,7 +87,8 @@
// If expect_type_args, a non-zero length must match the declaration length.
TargetEntryInstr *then, *fail;
check_type_args += LoadArgDescriptor();
- check_type_args += LoadField(ArgumentsDescriptor::type_args_len_offset());
+ check_type_args += LoadNativeField(NativeFieldDesc::Get(
+ NativeFieldDesc::kArgumentsDescriptor_type_args_len));
if (expect_type_args) {
JoinEntryInstr* join2 = BuildJoinEntry();
diff --git a/runtime/vm/compiler/method_recognizer.h b/runtime/vm/compiler/method_recognizer.h
index a29f9b4..d8239ea 100644
--- a/runtime/vm/compiler/method_recognizer.h
+++ b/runtime/vm/compiler/method_recognizer.h
@@ -28,6 +28,7 @@
V(_TypedList, _getInt32, ByteArrayBaseGetInt32, Dynamic, 0x65ab3a20) \
V(_TypedList, _getUint32, ByteArrayBaseGetUint32, Dynamic, 0x0cb0fcf6) \
V(_TypedList, _getInt64, ByteArrayBaseGetInt64, Dynamic, 0x7db75d78) \
+ V(_TypedList, _getUint64, ByteArrayBaseGetUint64, Dynamic, 0x1487cfc6) \
V(_TypedList, _getFloat32, ByteArrayBaseGetFloat32, Double, 0x6674ea6f) \
V(_TypedList, _getFloat64, ByteArrayBaseGetFloat64, Double, 0x236c6e7a) \
V(_TypedList, _getFloat32x4, ByteArrayBaseGetFloat32x4, Float32x4, \
@@ -40,6 +41,7 @@
V(_TypedList, _setInt32, ByteArrayBaseSetInt32, Dynamic, 0x7ddb9f87) \
V(_TypedList, _setUint32, ByteArrayBaseSetUint32, Dynamic, 0x74094f8d) \
V(_TypedList, _setInt64, ByteArrayBaseSetInt64, Dynamic, 0x4741396e) \
+ V(_TypedList, _setUint64, ByteArrayBaseSetUint64, Dynamic, 0x3b398ae4) \
V(_TypedList, _setFloat32, ByteArrayBaseSetFloat32, Dynamic, 0x03db087b) \
V(_TypedList, _setFloat64, ByteArrayBaseSetFloat64, Dynamic, 0x38a80b0d) \
V(_TypedList, _setFloat32x4, ByteArrayBaseSetFloat32x4, Dynamic, 0x40052c4e) \
@@ -509,6 +511,8 @@
V(_TypedList, _getUint16, ByteArrayBaseGetUint16, 0x0371785f) \
V(_TypedList, _getInt32, ByteArrayBaseGetInt32, 0x65ab3a20) \
V(_TypedList, _getUint32, ByteArrayBaseGetUint32, 0x0cb0fcf6) \
+ V(_TypedList, _getInt64, ByteArrayBaseGetInt64, 0x7db75d78) \
+ V(_TypedList, _getUint64, ByteArrayBaseGetUint64, 0x1487cfc6) \
V(_TypedList, _getFloat32, ByteArrayBaseGetFloat32, 0x6674ea6f) \
V(_TypedList, _getFloat64, ByteArrayBaseGetFloat64, 0x236c6e7a) \
V(_TypedList, _getFloat32x4, ByteArrayBaseGetFloat32x4, 0x5c367ffb) \
@@ -519,6 +523,8 @@
V(_TypedList, _setUint16, ByteArrayBaseSetInt16, 0x181e5d16) \
V(_TypedList, _setInt32, ByteArrayBaseSetInt32, 0x7ddb9f87) \
V(_TypedList, _setUint32, ByteArrayBaseSetUint32, 0x74094f8d) \
+ V(_TypedList, _setInt64, ByteArrayBaseSetInt64, 0x4741396e) \
+ V(_TypedList, _setUint64, ByteArrayBaseSetUint64, 0x3b398ae4) \
V(_TypedList, _setFloat32, ByteArrayBaseSetFloat32, 0x03db087b) \
V(_TypedList, _setFloat64, ByteArrayBaseSetFloat64, 0x38a80b0d) \
V(_TypedList, _setFloat32x4, ByteArrayBaseSetFloat32x4, 0x40052c4e) \
diff --git a/runtime/vm/constants_kbc.h b/runtime/vm/constants_kbc.h
index 4b8e028..e6250b5 100644
--- a/runtime/vm/constants_kbc.h
+++ b/runtime/vm/constants_kbc.h
@@ -1079,7 +1079,14 @@
}
}
+ static const uint8_t kNativeCallToGrowableListArgc = 2;
+
DART_FORCE_INLINE static uint8_t DecodeArgc(KBCInstr call) {
+ if (DecodeOpcode(call) == KernelBytecode::kNativeCall) {
+ // The only NativeCall redirecting to a bytecode function is the call
+ // to new _GrowableList<E>(0).
+ return kNativeCallToGrowableListArgc;
+ }
ASSERT(IsCallOpcode(call));
return (call >> 8) & 0xFF;
}
diff --git a/runtime/vm/heap/heap.cc b/runtime/vm/heap/heap.cc
index 376f9b7..9a281b0 100644
--- a/runtime/vm/heap/heap.cc
+++ b/runtime/vm/heap/heap.cc
@@ -135,16 +135,17 @@
// Attempt to free some external allocation by a scavenge. (If the total
// remains above the limit, next external alloc will trigger another.)
CollectGarbage(kScavenge, kExternal);
+ // Promotion may have pushed old space over its limit.
+ if (old_space_.NeedsGarbageCollection()) {
+ CollectGarbage(kMarkSweep, kExternal);
+ }
}
} else {
ASSERT(space == kOld);
old_space_.AllocateExternal(cid, size);
- }
- // Idle GC does not check whether promotions should trigger a full GC.
- // As a workaround, we check here on every external allocation. See issue
- // dartbug.com/33314.
- if (old_space_.NeedsGarbageCollection()) {
- CollectAllGarbage(kExternal);
+ if (old_space_.NeedsGarbageCollection()) {
+ CollectAllGarbage(kExternal);
+ }
}
}
diff --git a/runtime/vm/heap/heap_test.cc b/runtime/vm/heap/heap_test.cc
index 1281e13..e2f2379 100644
--- a/runtime/vm/heap/heap_test.cc
+++ b/runtime/vm/heap/heap_test.cc
@@ -576,4 +576,39 @@
EXPECT(size_before < size_after);
}
+static void NoopFinalizer(void* isolate_callback_data,
+ Dart_WeakPersistentHandle handle,
+ void* peer) {}
+
+ISOLATE_UNIT_TEST_CASE(ExternalPromotion) {
+ Isolate* isolate = Isolate::Current();
+ Heap* heap = isolate->heap();
+
+ heap->CollectAllGarbage();
+ intptr_t size_before = kWordSize * (heap->new_space()->ExternalInWords() +
+ heap->old_space()->ExternalInWords());
+
+ Array& old = Array::Handle(Array::New(100, Heap::kOld));
+ Array& neu = Array::Handle();
+ for (intptr_t i = 0; i < 100; i++) {
+ neu = Array::New(1, Heap::kNew);
+ FinalizablePersistentHandle::New(isolate, neu, NULL, NoopFinalizer, 1 * MB);
+ old.SetAt(i, neu);
+ }
+
+ intptr_t size_middle = kWordSize * (heap->new_space()->ExternalInWords() +
+ heap->old_space()->ExternalInWords());
+ EXPECT_EQ(size_before + 100 * MB, size_middle);
+
+ old = Array::null();
+ neu = Array::null();
+
+ heap->CollectAllGarbage();
+
+ intptr_t size_after = kWordSize * (heap->new_space()->ExternalInWords() +
+ heap->old_space()->ExternalInWords());
+
+ EXPECT_EQ(size_before, size_after);
+}
+
} // namespace dart
diff --git a/runtime/vm/heap/pages.cc b/runtime/vm/heap/pages.cc
index 344932e..fe335e4 100644
--- a/runtime/vm/heap/pages.cc
+++ b/runtime/vm/heap/pages.cc
@@ -1268,7 +1268,8 @@
if (heap_growth_ratio_ == 100) {
return false;
}
- return current.capacity_in_words > idle_gc_threshold_in_words_;
+ return (current.capacity_in_words > idle_gc_threshold_in_words_) ||
+ NeedsExternalCollection(current);
}
void PageSpaceController::EvaluateGarbageCollection(SpaceUsage before,
diff --git a/runtime/vm/interpreter.cc b/runtime/vm/interpreter.cc
index f320a65..12b87ef 100644
--- a/runtime/vm/interpreter.cc
+++ b/runtime/vm/interpreter.cc
@@ -961,26 +961,27 @@
RawFunction::Kind kind = Function::kind(function);
switch (kind) {
case RawFunction::kImplicitGetter: {
- // Field offset in words is cached as a Smi in function's data_.
- RawInstance* instance = reinterpret_cast<RawInstance*>((*SP)[0]);
+ // Field object is cached in function's data_.
+ RawInstance* instance = reinterpret_cast<RawInstance*>(*call_base);
RawField* field = reinterpret_cast<RawField*>(function->ptr()->data_);
intptr_t offset_in_words = Smi::Value(field->ptr()->value_.offset_);
- (*SP)[0] =
- reinterpret_cast<RawObject**>(instance->ptr())[offset_in_words];
+ *SP = call_base;
+ **SP = reinterpret_cast<RawObject**>(instance->ptr())[offset_in_words];
*invoked = true;
return true;
}
case RawFunction::kImplicitSetter: {
- // Field offset in words is cached as a Smi in function's data_.
+ // Field object is cached in function's data_.
// TODO(regis): We currently ignore field.guarded_cid() and the type
// test of the setter value. Either execute these tests here or fall
// back to compiling the setter when required.
- RawInstance* instance = reinterpret_cast<RawInstance*>((*SP)[-1]);
+ RawInstance* instance = reinterpret_cast<RawInstance*>(*call_base);
RawField* field = reinterpret_cast<RawField*>(function->ptr()->data_);
intptr_t offset_in_words = Smi::Value(field->ptr()->value_.offset_);
reinterpret_cast<RawObject**>(instance->ptr())[offset_in_words] =
- (*SP)[0];
- *--(*SP) = Object::null();
+ *(call_base + 1);
+ *SP = call_base;
+ **SP = Object::null();
*invoked = true;
return true;
}
@@ -990,10 +991,10 @@
RawInstance* value = field->ptr()->value_.static_value_;
if (value == Object::sentinel().raw() ||
value == Object::transition_sentinel().raw()) {
- (*SP)[1] = 0; // Result of invoking the initializer.
- (*SP)[2] = field;
- Exit(thread, *FP, *SP + 3, *pc);
- NativeArguments native_args(thread, 1, *SP + 2, *SP + 1);
+ call_top[1] = 0; // Unused result of invoking the initializer.
+ call_top[2] = field;
+ Exit(thread, *FP, call_top + 3, *pc);
+ NativeArguments native_args(thread, 1, call_top + 2, call_top + 1);
if (!InvokeRuntime(thread, this, DRT_InitStaticField, native_args)) {
return false;
}
@@ -1002,12 +1003,14 @@
value = field->ptr()->value_.static_value_;
}
// Field was initialized. Return its value.
- *++(*SP) = value;
+ *SP = call_base;
+ **SP = value;
*invoked = true;
return true;
}
case RawFunction::kNoSuchMethodDispatcher:
case RawFunction::kInvokeFieldDispatcher:
+ case RawFunction::kMethodExtractor:
// TODO(regis): Implement. For now, use jitted version.
break;
default:
@@ -2284,7 +2287,10 @@
// SP[0] is type.
*++SP = Smi::New(0); // len
*++SP = thread->isolate()->object_store()->growable_list_factory();
- argdesc_ = ArgumentsDescriptor::New(0, 2); // Returns a cached desc.
+ // Change the ArgumentsDescriptor of the call with a new cached one.
+ argdesc_ = ArgumentsDescriptor::New(
+ 0, KernelBytecode::kNativeCallToGrowableListArgc);
+ // Note the special handling of the return of this call in DecodeArgc.
if (!Invoke(thread, SP - 2, SP, &pc, &FP, &SP)) {
HANDLE_EXCEPTION;
}
diff --git a/runtime/vm/kernel_binary.h b/runtime/vm/kernel_binary.h
index 68f3715..c0a6799 100644
--- a/runtime/vm/kernel_binary.h
+++ b/runtime/vm/kernel_binary.h
@@ -7,9 +7,6 @@
#if !defined(DART_PRECOMPILED_RUNTIME)
-#include <map>
-
-#include "vm/compiler/frontend/kernel_to_il.h"
#include "vm/kernel.h"
#include "vm/object.h"
@@ -371,6 +368,57 @@
friend class Program;
};
+// A helper class that saves the current reader position, goes to another reader
+// position, and upon destruction, resets to the original reader position.
+class AlternativeReadingScope {
+ public:
+ AlternativeReadingScope(Reader* reader, intptr_t new_position)
+ : reader_(reader),
+ saved_size_(reader_->size()),
+ saved_raw_buffer_(reader_->raw_buffer()),
+ saved_typed_data_(reader_->typed_data()),
+ saved_offset_(reader_->offset()) {
+ reader_->set_offset(new_position);
+ }
+
+ AlternativeReadingScope(Reader* reader,
+ const ExternalTypedData* new_typed_data,
+ intptr_t new_position)
+ : reader_(reader),
+ saved_size_(reader_->size()),
+ saved_raw_buffer_(reader_->raw_buffer()),
+ saved_typed_data_(reader_->typed_data()),
+ saved_offset_(reader_->offset()) {
+ reader_->set_raw_buffer(NULL);
+ reader_->set_typed_data(new_typed_data);
+ reader_->set_size(new_typed_data->Length());
+ reader_->set_offset(new_position);
+ }
+
+ explicit AlternativeReadingScope(Reader* reader)
+ : reader_(reader),
+ saved_size_(reader_->size()),
+ saved_raw_buffer_(reader_->raw_buffer()),
+ saved_typed_data_(reader_->typed_data()),
+ saved_offset_(reader_->offset()) {}
+
+ ~AlternativeReadingScope() {
+ reader_->set_raw_buffer(saved_raw_buffer_);
+ reader_->set_typed_data(saved_typed_data_);
+ reader_->set_size(saved_size_);
+ reader_->set_offset(saved_offset_);
+ }
+
+ intptr_t saved_offset() { return saved_offset_; }
+
+ private:
+ Reader* reader_;
+ intptr_t saved_size_;
+ const uint8_t* saved_raw_buffer_;
+ const ExternalTypedData* saved_typed_data_;
+ intptr_t saved_offset_;
+};
+
// A helper class that resets the readers min and max positions both upon
// initialization and upon destruction, i.e. when created the min an max
// positions will be reset to "noSource", when destructing the min and max will
diff --git a/runtime/vm/kernel_loader.cc b/runtime/vm/kernel_loader.cc
index 3a554f4..114ae9a 100644
--- a/runtime/vm/kernel_loader.cc
+++ b/runtime/vm/kernel_loader.cc
@@ -364,7 +364,8 @@
ActiveClassScope active_class_scope(&active_class_, &toplevel_class);
builder_.SetOffset(program_->constant_table_offset());
- StreamingDartTypeTranslator type_translator_(&builder_, true /* finalize */);
+ TypeTranslator type_translator_(&builder_, &active_class_,
+ true /* finalize */);
ASSERT(type_translator_.active_class_ == &active_class_);
ConstantHelper helper(&active_class_, &builder_, &type_translator_,
@@ -948,7 +949,7 @@
// kImplementedClasses, [...].
// Set type parameters.
- builder_.LoadAndSetupTypeParameters(
+ builder_.type_translator_.LoadAndSetupTypeParameters(
&active_class_, *klass, type_parameter_count, Function::Handle(Z));
// Set super type. Some classes (e.g., Object) do not have one.
diff --git a/runtime/vm/malloc_hooks_test.cc b/runtime/vm/malloc_hooks_test.cc
index 4ff709a..7facea6 100644
--- a/runtime/vm/malloc_hooks_test.cc
+++ b/runtime/vm/malloc_hooks_test.cc
@@ -187,6 +187,8 @@
// present in the profile. This is just a simple sanity check to make sure
// that the ProfileTrie has a representation of the stack trace collected when
// var is allocated. More intense testing is already done in profiler_test.cc.
+ // This is brittle: inlining and ICF in the C compiler and linker will affect
+ // the frames we see.
EXPECT_SUBSTRING("\"dart::Dart_TestStackTraceMallocHookSimpleJSONTest()\"",
json);
EXPECT_SUBSTRING("\"dart::TestCase::Run()\"", json);
diff --git a/runtime/vm/runtime_entry.cc b/runtime/vm/runtime_entry.cc
index bcbb625..b298c05 100644
--- a/runtime/vm/runtime_entry.cc
+++ b/runtime/vm/runtime_entry.cc
@@ -181,7 +181,7 @@
const uword pc_offset = caller_frame->pc() - code.PayloadStart();
if (FLAG_shared_slow_path_triggers_gc) {
- Isolate::Current()->heap()->CollectAllGarbage();
+ isolate->heap()->CollectAllGarbage();
}
const CodeSourceMap& map =
@@ -1976,6 +1976,10 @@
// persist.
uword stack_overflow_flags = thread->GetAndClearStackOverflowFlags();
+ if (FLAG_shared_slow_path_triggers_gc) {
+ isolate->heap()->CollectAllGarbage();
+ }
+
bool interpreter_stack_overflow = false;
#if defined(DART_USE_INTERPRETER)
// Do not allocate an interpreter, if none is allocated yet.
diff --git a/runtime/vm/stub_code.h b/runtime/vm/stub_code.h
index 99dd71b..90567b6 100644
--- a/runtime/vm/stub_code.h
+++ b/runtime/vm/stub_code.h
@@ -79,7 +79,9 @@
V(FrameAwaitingMaterialization) \
V(AsynchronousGapMarker) \
V(NullErrorSharedWithFPURegs) \
- V(NullErrorSharedWithoutFPURegs)
+ V(NullErrorSharedWithoutFPURegs) \
+ V(StackOverflowSharedWithFPURegs) \
+ V(StackOverflowSharedWithoutFPURegs)
#else
#define VM_STUB_CODE_LIST(V) \
@@ -202,8 +204,11 @@
static RawCode* Generate(const char* name,
void (*GenerateStub)(Assembler* assembler));
- static void GenerateNullErrorShared(Assembler* assembler,
- bool save_fpu_registers);
+ static void GenerateSharedStub(Assembler* assembler,
+ bool save_fpu_registers,
+ const RuntimeEntry* target,
+ intptr_t self_code_stub_offset_from_thread,
+ bool allow_return);
static void GenerateMegamorphicMissStub(Assembler* assembler);
static void GenerateAllocationStubForClass(Assembler* assembler,
diff --git a/runtime/vm/stub_code_arm.cc b/runtime/vm/stub_code_arm.cc
index 493329f..555fb3a 100644
--- a/runtime/vm/stub_code_arm.cc
+++ b/runtime/vm/stub_code_arm.cc
@@ -112,14 +112,92 @@
__ Ret();
}
+void StubCode::GenerateSharedStub(Assembler* assembler,
+ bool save_fpu_registers,
+ const RuntimeEntry* target,
+ intptr_t self_code_stub_offset_from_thread,
+ bool allow_return) {
+ __ Push(LR);
+
+ // We want the saved registers to appear like part of the caller's frame, so
+ // we push them before calling EnterStubFrame.
+ //
+ // TODO(sjindel): We could skip saving LR (and thus remove one bit from the
+ // stackmap of the callsite), but this would add ARM-specific complexity to
+ // FlowGraphCompiler::RecordSafepoint and
+ // FlowGraphCompiler::SlowPathEnvironmentFor.
+ RegisterSet all_registers;
+ all_registers.AddAllNonReservedRegisters(save_fpu_registers);
+ __ PushRegisters(all_registers);
+
+ const intptr_t kSavedCpuRegisterSlots =
+ Utils::CountOneBitsWord(kDartAvailableCpuRegs);
+
+ const intptr_t kSavedFpuRegisterSlots =
+ save_fpu_registers ? kNumberOfFpuRegisters * kFpuRegisterSize / kWordSize
+ : 0;
+
+ const intptr_t kAllSavedRegistersSlots =
+ kSavedCpuRegisterSlots + kSavedFpuRegisterSlots;
+
+ // Copy down the return address so the stack layout is correct.
+ __ ldr(TMP, Address(SPREG, kAllSavedRegistersSlots * kWordSize));
+ __ Push(TMP);
+
+ __ ldr(CODE_REG, Address(THR, self_code_stub_offset_from_thread));
+
+ __ EnterStubFrame();
+
+ __ ldr(CODE_REG, Address(THR, Thread::call_to_runtime_stub_offset()));
+ __ ldr(R9, Address(THR, Thread::OffsetFromThread(target)));
+ __ mov(R4, Operand(/*argument_count=*/0));
+ __ ldr(TMP, Address(THR, Thread::call_to_runtime_entry_point_offset()));
+ __ blx(TMP);
+
+ if (!allow_return) {
+ __ Breakpoint();
+ return;
+ }
+ __ LeaveStubFrame();
+
+ // Drop "official" return address -- we can just use the one stored above the
+ // saved registers.
+ __ Drop(1);
+
+ __ PopRegisters(all_registers);
+
+ __ Pop(LR);
+ __ bx(LR);
+}
+
void StubCode::GenerateNullErrorSharedWithoutFPURegsStub(Assembler* assembler) {
- // TODO(sjindel): implement.
- __ Breakpoint();
+ GenerateSharedStub(assembler, /*save_fpu_registers=*/false,
+ &kNullErrorRuntimeEntry,
+ Thread::null_error_shared_without_fpu_regs_stub_offset(),
+ /*allow_return=*/false);
}
void StubCode::GenerateNullErrorSharedWithFPURegsStub(Assembler* assembler) {
- // TODO(sjindel): implement.
- __ Breakpoint();
+ GenerateSharedStub(assembler, /*save_fpu_registers=*/true,
+ &kNullErrorRuntimeEntry,
+ Thread::null_error_shared_with_fpu_regs_stub_offset(),
+ /*allow_return=*/false);
+}
+
+void StubCode::GenerateStackOverflowSharedWithoutFPURegsStub(
+ Assembler* assembler) {
+ GenerateSharedStub(
+ assembler, /*save_fpu_registers=*/false, &kStackOverflowRuntimeEntry,
+ Thread::stack_overflow_shared_without_fpu_regs_stub_offset(),
+ /*allow_return=*/true);
+}
+
+void StubCode::GenerateStackOverflowSharedWithFPURegsStub(
+ Assembler* assembler) {
+ GenerateSharedStub(assembler, /*save_fpu_registers=*/true,
+ &kStackOverflowRuntimeEntry,
+ Thread::stack_overflow_shared_with_fpu_regs_stub_offset(),
+ /*allow_return=*/true);
}
// Input parameters:
diff --git a/runtime/vm/stub_code_arm64.cc b/runtime/vm/stub_code_arm64.cc
index c38de9a..fceea40 100644
--- a/runtime/vm/stub_code_arm64.cc
+++ b/runtime/vm/stub_code_arm64.cc
@@ -131,12 +131,87 @@
__ ret();
}
+void StubCode::GenerateSharedStub(Assembler* assembler,
+ bool save_fpu_registers,
+ const RuntimeEntry* target,
+ intptr_t self_code_stub_offset_from_thread,
+ bool allow_return) {
+ __ Push(LR);
+
+ // We want the saved registers to appear like part of the caller's frame, so
+ // we push them before calling EnterStubFrame.
+ RegisterSet all_registers;
+ all_registers.AddAllNonReservedRegisters(save_fpu_registers);
+ __ PushRegisters(all_registers);
+
+ const intptr_t kSavedCpuRegisterSlots =
+ Utils::CountOneBitsWord(kDartAvailableCpuRegs);
+
+ const intptr_t kSavedFpuRegisterSlots =
+ save_fpu_registers ? kNumberOfFpuRegisters * kFpuRegisterSize / kWordSize
+ : 0;
+
+ const intptr_t kAllSavedRegistersSlots =
+ kSavedCpuRegisterSlots + kSavedFpuRegisterSlots;
+
+ // Copy down the return address so the stack layout is correct.
+ __ ldr(TMP, Address(SPREG, kAllSavedRegistersSlots * kWordSize));
+ __ Push(TMP);
+
+ __ ldr(CODE_REG, Address(THR, self_code_stub_offset_from_thread));
+
+ __ EnterStubFrame();
+
+ __ ldr(CODE_REG, Address(THR, Thread::call_to_runtime_stub_offset()));
+ __ ldr(R5, Address(THR, Thread::OffsetFromThread(target)));
+ __ LoadImmediate(R4, /*argument_count=*/0);
+ __ ldr(TMP, Address(THR, Thread::call_to_runtime_entry_point_offset()));
+ __ blr(TMP);
+
+ if (!allow_return) {
+ __ Breakpoint();
+ return;
+ }
+ __ LeaveStubFrame();
+
+ // Drop "official" return address -- we can just use the one stored above the
+ // saved registers.
+ __ Drop(1);
+
+ __ PopRegisters(all_registers);
+
+ __ Pop(LR);
+ __ ret(LR);
+}
+
void StubCode::GenerateNullErrorSharedWithoutFPURegsStub(Assembler* assembler) {
- __ Breakpoint();
+ GenerateSharedStub(assembler, /*save_fpu_registers=*/false,
+ &kNullErrorRuntimeEntry,
+ Thread::null_error_shared_without_fpu_regs_stub_offset(),
+ /*allow_return=*/false);
}
void StubCode::GenerateNullErrorSharedWithFPURegsStub(Assembler* assembler) {
- __ Breakpoint();
+ GenerateSharedStub(assembler, /*save_fpu_registers=*/true,
+ &kNullErrorRuntimeEntry,
+ Thread::null_error_shared_with_fpu_regs_stub_offset(),
+ /*allow_return=*/false);
+}
+
+void StubCode::GenerateStackOverflowSharedWithoutFPURegsStub(
+ Assembler* assembler) {
+ GenerateSharedStub(
+ assembler, /*save_fpu_registers=*/false, &kStackOverflowRuntimeEntry,
+ Thread::stack_overflow_shared_without_fpu_regs_stub_offset(),
+ /*allow_return=*/true);
+}
+
+void StubCode::GenerateStackOverflowSharedWithFPURegsStub(
+ Assembler* assembler) {
+ GenerateSharedStub(assembler, /*save_fpu_registers=*/true,
+ &kStackOverflowRuntimeEntry,
+ Thread::stack_overflow_shared_with_fpu_regs_stub_offset(),
+ /*allow_return=*/true);
}
void StubCode::GeneratePrintStopMessageStub(Assembler* assembler) {
@@ -1891,10 +1966,6 @@
__ SetPrologueOffset();
__ EnterStubFrame();
- // Save exit frame information to enable stack walking as we are about
- // to transition to Dart VM C++ code.
- __ StoreToOffset(FP, THR, Thread::top_exit_frame_info_offset());
-
#if defined(DEBUG)
{
Label ok;
@@ -1907,9 +1978,6 @@
}
#endif
- // Mark that the thread is executing VM code.
- __ StoreToOffset(R5, THR, Thread::vm_tag_offset());
-
// Setup space on stack for result of the interpreted function call.
__ Push(ZR);
@@ -1929,7 +1997,7 @@
// Push 4th Dart argument of the interpreted function call.
// R2: Smi-tagged arguments array length.
- PushArrayOfArguments(assembler);
+ PushArrayOfArguments(assembler); // May call into the runtime.
const intptr_t kNumArgs = 4;
// Reserve space for arguments and align frame before entering C++ world.
@@ -1958,13 +2026,20 @@
__ StoreToOffset(R3, SP, retval_offset);
__ mov(R0, SP); // Pass the pointer to the NativeArguments.
+ // Save exit frame information to enable stack walking as we are about
+ // to transition to Dart VM C++ code.
+ __ StoreToOffset(FP, THR, Thread::top_exit_frame_info_offset());
+
+ // Mark that the thread is executing VM code.
+ __ LoadImmediate(R5, kInterpretCallRuntimeEntry.GetEntryPoint());
+ __ StoreToOffset(R5, THR, Thread::vm_tag_offset());
+
// We are entering runtime code, so the C stack pointer must be restored from
// the stack limit to the top of the stack. We cache the stack limit address
// in a callee-saved register.
__ mov(R25, CSP);
__ mov(CSP, SP);
- __ LoadImmediate(R5, kInterpretCallRuntimeEntry.GetEntryPoint());
__ blr(R5);
// Restore SP and CSP.
diff --git a/runtime/vm/stub_code_ia32.cc b/runtime/vm/stub_code_ia32.cc
index 60a107b..6b91241 100644
--- a/runtime/vm/stub_code_ia32.cc
+++ b/runtime/vm/stub_code_ia32.cc
@@ -107,6 +107,18 @@
__ Breakpoint();
}
+void StubCode::GenerateStackOverflowSharedWithoutFPURegsStub(
+ Assembler* assembler) {
+ // TODO(sjindel): implement.
+ __ Breakpoint();
+}
+
+void StubCode::GenerateStackOverflowSharedWithFPURegsStub(
+ Assembler* assembler) {
+ // TODO(sjindel): implement.
+ __ Breakpoint();
+}
+
// Input parameters:
// ESP : points to return address.
// EAX : stop message (const char*).
diff --git a/runtime/vm/stub_code_x64.cc b/runtime/vm/stub_code_x64.cc
index 22da3fe..a16794a 100644
--- a/runtime/vm/stub_code_x64.cc
+++ b/runtime/vm/stub_code_x64.cc
@@ -108,8 +108,11 @@
__ ret();
}
-void StubCode::GenerateNullErrorShared(Assembler* assembler,
- bool save_fpu_registers) {
+void StubCode::GenerateSharedStub(Assembler* assembler,
+ bool save_fpu_registers,
+ const RuntimeEntry* target,
+ intptr_t self_code_stub_offset_from_thread,
+ bool allow_return) {
// We want the saved registers to appear like part of the caller's frame, so
// we push them before calling EnterStubFrame.
__ PushRegisters(kDartAvailableCpuRegs,
@@ -128,27 +131,59 @@
// Copy down the return address so the stack layout is correct.
__ pushq(Address(RSP, kAllSavedRegistersSlots * kWordSize));
- const intptr_t stub_offset =
- save_fpu_registers
- ? Thread::null_error_shared_with_fpu_regs_stub_offset()
- : Thread::null_error_shared_without_fpu_regs_stub_offset();
- __ movq(CODE_REG, Address(THR, stub_offset));
+ __ movq(CODE_REG, Address(THR, self_code_stub_offset_from_thread));
__ EnterStubFrame();
__ movq(CODE_REG, Address(THR, Thread::call_to_runtime_stub_offset()));
- __ movq(RBX, Address(THR, Thread::OffsetFromThread(&kNullErrorRuntimeEntry)));
+ __ movq(RBX, Address(THR, Thread::OffsetFromThread(target)));
__ movq(R10, Immediate(/*argument_count=*/0));
__ call(Address(THR, Thread::call_to_runtime_entry_point_offset()));
- __ Breakpoint();
+
+ if (!allow_return) {
+ __ Breakpoint();
+ return;
+ }
+ __ LeaveStubFrame();
+
+ // Drop "official" return address -- we can just use the one stored above the
+ // saved registers.
+ __ Drop(1);
+
+ __ PopRegisters(kDartAvailableCpuRegs,
+ save_fpu_registers ? kAllFpuRegistersList : 0);
+
+ __ ret();
}
void StubCode::GenerateNullErrorSharedWithoutFPURegsStub(Assembler* assembler) {
- GenerateNullErrorShared(assembler, false);
+ GenerateSharedStub(assembler, /*save_fpu_registers=*/false,
+ &kNullErrorRuntimeEntry,
+ Thread::null_error_shared_without_fpu_regs_stub_offset(),
+ /*allow_return=*/false);
}
void StubCode::GenerateNullErrorSharedWithFPURegsStub(Assembler* assembler) {
- GenerateNullErrorShared(assembler, true);
+ GenerateSharedStub(assembler, /*save_fpu_registers=*/true,
+ &kNullErrorRuntimeEntry,
+ Thread::null_error_shared_with_fpu_regs_stub_offset(),
+ /*allow_return=*/false);
+}
+
+void StubCode::GenerateStackOverflowSharedWithoutFPURegsStub(
+ Assembler* assembler) {
+ GenerateSharedStub(
+ assembler, /*save_fpu_registers=*/false, &kStackOverflowRuntimeEntry,
+ Thread::stack_overflow_shared_without_fpu_regs_stub_offset(),
+ /*allow_return=*/true);
+}
+
+void StubCode::GenerateStackOverflowSharedWithFPURegsStub(
+ Assembler* assembler) {
+ GenerateSharedStub(assembler, /*save_fpu_registers=*/true,
+ &kStackOverflowRuntimeEntry,
+ Thread::stack_overflow_shared_with_fpu_regs_stub_offset(),
+ /*allow_return=*/true);
}
// Input parameters:
@@ -1871,10 +1906,6 @@
__ EnterStubFrame();
- // Save exit frame information to enable stack walking as we are about
- // to transition to Dart VM C++ code.
- __ movq(Address(THR, Thread::top_exit_frame_info_offset()), RBP);
-
#if defined(DEBUG)
{
Label ok;
@@ -1887,10 +1918,6 @@
}
#endif
- // Mark that the thread is executing VM code.
- __ movq(RCX, Immediate(kInterpretCallRuntimeEntry.GetEntryPoint()));
- __ movq(Assembler::VMTagAddress(), RCX);
-
// Push result and first 3 arguments of the interpreted function call.
__ pushq(Immediate(0)); // Setup space on stack for result.
__ pushq(RAX); // Function.
@@ -1909,7 +1936,7 @@
// Push 4th Dart argument of the interpreted function call.
// R10: Smi-tagged arguments array length.
- PushArrayOfArguments(assembler);
+ PushArrayOfArguments(assembler); // May call into the runtime.
const intptr_t kNumArgs = 4;
// Set callee-saved RBX to point to first one of the 4 Dart arguments.
@@ -1932,7 +1959,14 @@
ASSERT(sizeof(NativeArguments) > CallingConventions::kRegisterTransferLimit);
__ movq(CallingConventions::kArg1Reg, RSP);
#endif
+ // Save exit frame information to enable stack walking as we are about
+ // to transition to Dart VM C++ code.
+ __ movq(Address(THR, Thread::top_exit_frame_info_offset()), RBP);
+
+ // Mark that the thread is executing VM code.
__ movq(RCX, Immediate(kInterpretCallRuntimeEntry.GetEntryPoint()));
+ __ movq(Assembler::VMTagAddress(), RCX);
+
__ CallCFunction(RCX);
// Mark that the thread is executing Dart code.
diff --git a/runtime/vm/thread.h b/runtime/vm/thread.h
index d8f2792..8864071 100644
--- a/runtime/vm/thread.h
+++ b/runtime/vm/thread.h
@@ -98,6 +98,10 @@
StubCode::NullErrorSharedWithoutFPURegs_entry()->code(), NULL) \
V(RawCode*, null_error_shared_with_fpu_regs_stub_, \
StubCode::NullErrorSharedWithFPURegs_entry()->code(), NULL) \
+ V(RawCode*, stack_overflow_shared_without_fpu_regs_stub_, \
+ StubCode::StackOverflowSharedWithoutFPURegs_entry()->code(), NULL) \
+ V(RawCode*, stack_overflow_shared_with_fpu_regs_stub_, \
+ StubCode::StackOverflowSharedWithFPURegs_entry()->code(), NULL) \
V(RawCode*, monomorphic_miss_stub_, \
StubCode::MonomorphicMiss_entry()->code(), NULL) \
V(RawCode*, ic_lookup_through_code_stub_, \
@@ -142,6 +146,10 @@
StubCode::NullErrorSharedWithoutFPURegs_entry()->EntryPoint(), 0) \
V(uword, null_error_shared_with_fpu_regs_entry_point_, \
StubCode::NullErrorSharedWithFPURegs_entry()->EntryPoint(), 0) \
+ V(uword, stack_overflow_shared_without_fpu_regs_entry_point_, \
+ StubCode::StackOverflowSharedWithoutFPURegs_entry()->EntryPoint(), 0) \
+ V(uword, stack_overflow_shared_with_fpu_regs_entry_point_, \
+ StubCode::StackOverflowSharedWithFPURegs_entry()->EntryPoint(), 0) \
V(uword, megamorphic_call_checked_entry_, \
StubCode::MegamorphicCall_entry()->EntryPoint(), 0) \
V(uword, monomorphic_miss_entry_, \
diff --git a/sdk/BUILD.gn b/sdk/BUILD.gn
index 226f959..a0f23ed 100644
--- a/sdk/BUILD.gn
+++ b/sdk/BUILD.gn
@@ -130,6 +130,10 @@
"../utils/dartfmt",
],
[
+ "kernel-service",
+ "../utils/kernel-service",
+ ],
+ [
"pub",
"../utils/pub",
],
@@ -169,13 +173,13 @@
"../utils/bazel:kernel_worker",
],
[
- "pub",
- "../utils/pub",
- ],
- [
"kernel-service",
"../utils/kernel-service",
],
+ [
+ "pub",
+ "../utils/pub",
+ ],
]
# Libraries that go under lib/
diff --git a/sdk/lib/_http/http.dart b/sdk/lib/_http/http.dart
index fa90619..691f152 100644
--- a/sdk/lib/_http/http.dart
+++ b/sdk/lib/_http/http.dart
@@ -1527,6 +1527,16 @@
/// The default value is 15 seconds.
Duration idleTimeout;
+ /// Gets and sets the connection timeout.
+ ///
+ /// When connecting to a new host exceeds this timeout, a [SocketException]
+ /// is thrown. The timeout applies only to connections initiated after the
+ /// timeout is set.
+ ///
+ /// When this is `null`, the OS default timeout is used. The default is
+ /// `null`.
+ Duration connectionTimeout;
+
/**
* Gets and sets the maximum number of live connections, to a single host.
*
diff --git a/sdk/lib/_http/http_impl.dart b/sdk/lib/_http/http_impl.dart
index 3a1ec29..983a4fb 100644
--- a/sdk/lib/_http/http_impl.dart
+++ b/sdk/lib/_http/http_impl.dart
@@ -1039,8 +1039,9 @@
Future<HttpClientResponse> get done {
if (_response == null) {
- _response = Future.wait([_responseCompleter.future, super.done],
- eagerError: true).then((list) => list[0]);
+ _response =
+ Future.wait([_responseCompleter.future, super.done], eagerError: true)
+ .then((list) => list[0]);
}
return _response;
}
@@ -1254,7 +1255,8 @@
outbound.headers.chunkedTransferEncoding) {
List acceptEncodings =
response._httpRequest.headers[HttpHeaders.acceptEncodingHeader];
- List contentEncoding = outbound.headers[HttpHeaders.contentEncodingHeader];
+ List contentEncoding =
+ outbound.headers[HttpHeaders.contentEncodingHeader];
if (acceptEncodings != null &&
acceptEncodings
.expand((list) => list.split(","))
@@ -1657,8 +1659,8 @@
if (proxy.isAuthenticated) {
// If the proxy configuration contains user information use that
// for proxy basic authorization.
- String auth = _CryptoUtils
- .bytesToBase64(utf8.encode("${proxy.username}:${proxy.password}"));
+ String auth = _CryptoUtils.bytesToBase64(
+ utf8.encode("${proxy.username}:${proxy.password}"));
request.headers.set(HttpHeaders.proxyAuthorizationHeader, "Basic $auth");
} else if (!proxy.isDirect && _httpClient._proxyCredentials.length > 0) {
proxyCreds = _httpClient._findProxyCredentials(proxy);
@@ -1766,7 +1768,8 @@
void close() {
closed = true;
_httpClient._connectionClosed(this);
- _streamFuture.timeout(_httpClient.idleTimeout)
+ _streamFuture
+ .timeout(_httpClient.idleTimeout)
.then((_) => _socket.destroy());
}
@@ -1777,8 +1780,8 @@
if (proxy.isAuthenticated) {
// If the proxy configuration contains user information use that
// for proxy basic authorization.
- String auth = _CryptoUtils
- .bytesToBase64(utf8.encode("${proxy.username}:${proxy.password}"));
+ String auth = _CryptoUtils.bytesToBase64(
+ utf8.encode("${proxy.username}:${proxy.password}"));
request.headers.set(HttpHeaders.proxyAuthorizationHeader, "Basic $auth");
}
return request.close().then((response) {
@@ -1837,6 +1840,7 @@
final SecurityContext context;
final Set<_HttpClientConnection> _idle = new HashSet();
final Set<_HttpClientConnection> _active = new HashSet();
+ final Set<ConnectionTask> _socketTasks = new HashSet();
final Queue _pending = new ListQueue();
int _connecting = 0;
@@ -1884,6 +1888,14 @@
}
void close(bool force) {
+ // Always cancel pending socket connections.
+ for (var t in _socketTasks.toList()) {
+ // Make sure the socket is destroyed if the ConnectionTask is cancelled.
+ t.socket.then((s) {
+ s.destroy();
+ }, onError: (e) {});
+ t.cancel();
+ }
if (force) {
for (var c in _idle.toList()) {
c.destroy();
@@ -1920,34 +1932,48 @@
return currentBadCertificateCallback(certificate, uriHost, uriPort);
}
- Future socketFuture = (isSecure && proxy.isDirect
- ? SecureSocket.connect(host, port,
+ Future<ConnectionTask> connectionTask = (isSecure && proxy.isDirect
+ ? SecureSocket.startConnect(host, port,
context: context, onBadCertificate: callback)
- : Socket.connect(host, port));
+ : Socket.startConnect(host, port));
_connecting++;
- return socketFuture.then((socket) {
- _connecting--;
- socket.setOption(SocketOption.tcpNoDelay, true);
- var connection =
- new _HttpClientConnection(key, socket, client, false, context);
- if (isSecure && !proxy.isDirect) {
- connection._dispose = true;
- return connection
- .createProxyTunnel(uriHost, uriPort, proxy, callback)
- .then((tunnel) {
- client
- ._getConnectionTarget(uriHost, uriPort, true)
- .addNewActive(tunnel);
- return new _ConnectionInfo(tunnel, proxy);
+ return connectionTask.then((ConnectionTask task) {
+ _socketTasks.add(task);
+ Future socketFuture = task.socket;
+ if (client.connectionTimeout != null) {
+ socketFuture =
+ socketFuture.timeout(client.connectionTimeout, onTimeout: () {
+ _socketTasks.remove(task);
+ task.cancel();
});
- } else {
- addNewActive(connection);
- return new _ConnectionInfo(connection, proxy);
}
- }, onError: (error) {
- _connecting--;
- _checkPending();
- throw error;
+ return socketFuture.then((socket) {
+ _connecting--;
+ socket.setOption(SocketOption.tcpNoDelay, true);
+ var connection =
+ new _HttpClientConnection(key, socket, client, false, context);
+ if (isSecure && !proxy.isDirect) {
+ connection._dispose = true;
+ return connection
+ .createProxyTunnel(uriHost, uriPort, proxy, callback)
+ .then((tunnel) {
+ client
+ ._getConnectionTarget(uriHost, uriPort, true)
+ .addNewActive(tunnel);
+ _socketTasks.remove(task);
+ return new _ConnectionInfo(tunnel, proxy);
+ });
+ } else {
+ addNewActive(connection);
+ _socketTasks.remove(task);
+ return new _ConnectionInfo(connection, proxy);
+ }
+ }, onError: (error) {
+ _connecting--;
+ _socketTasks.remove(task);
+ _checkPending();
+ throw error;
+ });
});
}
}
@@ -1970,6 +1996,8 @@
Duration get idleTimeout => _idleTimeout;
+ Duration connectionTimeout;
+
int maxConnectionsPerHost;
bool autoUncompress = true;
@@ -2100,9 +2128,8 @@
bool isSecure = (uri.scheme == "https");
int port = uri.port;
if (port == 0) {
- port = isSecure
- ? HttpClient.defaultHttpsPort
- : HttpClient.defaultHttpPort;
+ port =
+ isSecure ? HttpClient.defaultHttpsPort : HttpClient.defaultHttpPort;
}
// Check to see if a proxy server should be used for this connection.
var proxyConf = const _ProxyConfiguration.direct();
@@ -2499,8 +2526,8 @@
static Future<HttpServer> bind(
address, int port, int backlog, bool v6Only, bool shared) {
- return ServerSocket
- .bind(address, port, backlog: backlog, v6Only: v6Only, shared: shared)
+ return ServerSocket.bind(address, port,
+ backlog: backlog, v6Only: v6Only, shared: shared)
.then<HttpServer>((socket) {
return new _HttpServer._(socket, true);
});
@@ -2514,8 +2541,7 @@
bool v6Only,
bool requestClientCertificate,
bool shared) {
- return SecureServerSocket
- .bind(address, port, context,
+ return SecureServerSocket.bind(address, port, context,
backlog: backlog,
v6Only: v6Only,
requestClientCertificate: requestClientCertificate,
@@ -2974,8 +3000,8 @@
if (scheme != null && credentials.scheme != scheme) return false;
if (uri.host != this.uri.host) return false;
int thisPort =
- this.uri.port == 0 ? HttpClient.defaultHttpPort: this.uri.port;
- int otherPort = uri.port == 0 ? HttpClient.defaultHttpPort: uri.port;
+ this.uri.port == 0 ? HttpClient.defaultHttpPort : this.uri.port;
+ int otherPort = uri.port == 0 ? HttpClient.defaultHttpPort : uri.port;
if (otherPort != thisPort) return false;
return uri.path.startsWith(this.uri.path);
}
@@ -3113,14 +3139,14 @@
}
void authorize(_Credentials credentials, HttpClientRequest request) {
- request.headers
- .set(HttpHeaders.authorizationHeader, authorization(credentials, request));
+ request.headers.set(
+ HttpHeaders.authorizationHeader, authorization(credentials, request));
}
void authorizeProxy(
_ProxyCredentials credentials, HttpClientRequest request) {
- request.headers.set(
- HttpHeaders.proxyAuthorizationHeader, authorization(credentials, request));
+ request.headers.set(HttpHeaders.proxyAuthorizationHeader,
+ authorization(credentials, request));
}
}
diff --git a/sdk/lib/_internal/js_runtime/lib/io_patch.dart b/sdk/lib/_internal/js_runtime/lib/io_patch.dart
index 9cfb7ef..8a4c7bb 100644
--- a/sdk/lib/_internal/js_runtime/lib/io_patch.dart
+++ b/sdk/lib/_internal/js_runtime/lib/io_patch.dart
@@ -461,6 +461,12 @@
{sourceAddress, Duration timeout}) {
throw new UnsupportedError("RawSocket constructor");
}
+
+ @patch
+ static Future<ConnectionTask<RawSocket>> startConnect(host, int port,
+ {sourceAddress}) {
+ throw new UnsupportedError("RawSocket constructor");
+ }
}
@patch
@@ -470,6 +476,12 @@
{sourceAddress, Duration timeout}) {
throw new UnsupportedError("Socket constructor");
}
+
+ @patch
+ static Future<ConnectionTask<Socket>> _startConnect(host, int port,
+ {sourceAddress}) {
+ throw new UnsupportedError("Socket constructor");
+ }
}
@patch
diff --git a/sdk/lib/html/dart2js/html_dart2js.dart b/sdk/lib/html/dart2js/html_dart2js.dart
index 97735c9..b046d1b 100644
--- a/sdk/lib/html/dart2js/html_dart2js.dart
+++ b/sdk/lib/html/dart2js/html_dart2js.dart
@@ -8,6 +8,8 @@
* check out the [Element] class, the base class for many of the HTML
* DOM types.
*
+ * For information on writing web apps with Dart, see https://webdev.dartlang.org.
+ *
* {@category Web}
*/
library dart.dom.html;
@@ -9929,7 +9931,7 @@
* last child of this document fragment.
*/
void appendHtml(String text,
- {NodeValidator validator, NodeTreeSanitizer, treeSanitizer}) {
+ {NodeValidator validator, NodeTreeSanitizer treeSanitizer}) {
this.append(new DocumentFragment.html(text,
validator: validator, treeSanitizer: treeSanitizer));
}
@@ -25475,6 +25477,23 @@
return completer.future;
}
+ /**
+ * Temporarily exposes _getStats and old getStats as getLegacyStats until Chrome fully supports
+ * new getStats API.
+ */
+ @JSName('getStats')
+ Future<RtcStatsResponse> getLegacyStats([MediaStreamTrack selector]) {
+ var completer = new Completer<RtcStatsResponse>();
+ _getStats((value) {
+ completer.complete(value);
+ }, selector);
+ return completer.future;
+ }
+
+ @JSName('getStats')
+ Future _getStats(
+ [RtcStatsCallback successCallback, MediaStreamTrack selector]) native;
+
static Future generateCertificate(/*AlgorithmIdentifier*/ keygenAlgorithm) =>
JS('dynamic', 'generateCertificate(#)', keygenAlgorithm);
@@ -30670,11 +30689,12 @@
Console get console => Console._safeConsole;
/**
- * Access a sandboxed file system of the specified `size`. If `persistent` is
- * true, the application will request permission from the user to create
- * lasting storage. This storage cannot be freed without the user's
- * permission. Returns a [Future] whose value stores a reference to the
- * sandboxed file system for use. Because the file system is sandboxed,
+ * Access a sandboxed file system of `size` bytes.
+ *
+ * If `persistent` is true, the application will request permission from the
+ * user to create lasting storage. This storage cannot be freed without the
+ * user's permission. Returns a [Future] whose value stores a reference to
+ * the sandboxed file system for use. Because the file system is sandboxed,
* applications cannot access file systems created in other web pages.
*/
Future<FileSystem> requestFileSystem(int size, {bool persistent: false}) {
@@ -38622,7 +38642,11 @@
Element upgrade(Element element) {
// Only exact type matches are supported- cannot be a subclass.
if (element.runtimeType != _nativeType) {
- throw new ArgumentError('element is not subclass of $_nativeType');
+ // Some browsers may represent non-upgraded elements <x-foo> as
+ // UnknownElement and not a plain HtmlElement.
+ if (_nativeType != HtmlElement || element.runtimeType != UnknownElement) {
+ throw new ArgumentError('element is not subclass of $_nativeType');
+ }
}
setNativeSubclassDispatchRecord(element, _interceptor);
diff --git a/sdk/lib/io/overrides.dart b/sdk/lib/io/overrides.dart
index f68d417..1a71881 100644
--- a/sdk/lib/io/overrides.dart
+++ b/sdk/lib/io/overrides.dart
@@ -83,6 +83,9 @@
Future<Socket> Function(dynamic, int,
{dynamic sourceAddress, Duration timeout})
socketConnect,
+ Future<ConnectionTask<Socket>> Function(dynamic, int,
+ {dynamic sourceAddress})
+ socketStartConnect,
// Optional Zone parameters
ZoneSpecification zoneSpecification,
@@ -116,6 +119,7 @@
// Socket
socketConnect,
+ socketStartConnect,
);
return _asyncRunZoned<R>(body,
zoneValues: {_ioOverridesToken: overrides},
@@ -254,12 +258,22 @@
/// Asynchronously returns a [Socket] connected to the given host and port.
///
/// When this override is installed, this functions overrides the behavior of
- /// `Socet.connect(...)`.
+ /// `Socket.connect(...)`.
Future<Socket> socketConnect(host, int port,
{sourceAddress, Duration timeout}) {
return Socket._connect(host, port,
sourceAddress: sourceAddress, timeout: timeout);
}
+
+ /// Asynchronously returns a [ConnectionTask] that connects to the given host
+ /// and port when successful.
+ ///
+ /// When this override is installed, this functions overrides the behavior of
+ /// `Socket.startConnect(...)`.
+ Future<ConnectionTask<Socket>> socketStartConnect(host, int port,
+ {sourceAddress}) {
+ return Socket._startConnect(host, port, sourceAddress: sourceAddress);
+ }
}
class _IOOverridesScope extends IOOverrides {
@@ -294,6 +308,8 @@
// Socket
Future<Socket> Function(dynamic, int,
{dynamic sourceAddress, Duration timeout}) _socketConnect;
+ Future<ConnectionTask<Socket>> Function(dynamic, int, {dynamic sourceAddress})
+ _socketStartConnect;
_IOOverridesScope(
// Directory
@@ -324,6 +340,7 @@
// Socket
this._socketConnect,
+ this._socketStartConnect,
);
// Directory
@@ -448,4 +465,17 @@
return super.socketConnect(host, port,
sourceAddress: sourceAddress, timeout: timeout);
}
+
+ @override
+ Future<ConnectionTask<Socket>> socketStartConnect(host, int port,
+ {sourceAddress}) {
+ if (_socketStartConnect != null) {
+ return _socketStartConnect(host, port, sourceAddress: sourceAddress);
+ }
+ if (_previous != null) {
+ return _previous.socketStartConnect(host, port,
+ sourceAddress: sourceAddress);
+ }
+ return super.socketStartConnect(host, port, sourceAddress: sourceAddress);
+ }
}
diff --git a/sdk/lib/io/secure_socket.dart b/sdk/lib/io/secure_socket.dart
index 52e41d5..4b3f28f 100644
--- a/sdk/lib/io/secure_socket.dart
+++ b/sdk/lib/io/secure_socket.dart
@@ -46,8 +46,7 @@
bool onBadCertificate(X509Certificate certificate),
List<String> supportedProtocols,
Duration timeout}) {
- return RawSecureSocket
- .connect(host, port,
+ return RawSecureSocket.connect(host, port,
context: context,
onBadCertificate: onBadCertificate,
supportedProtocols: supportedProtocols,
@@ -55,6 +54,25 @@
.then((rawSocket) => new SecureSocket._(rawSocket));
}
+ /// Like [connect], but returns a [Future] that completes with a
+ /// [ConnectionTask] that can be cancelled if the [SecureSocket] is no
+ /// longer needed.
+ static Future<ConnectionTask<SecureSocket>> startConnect(host, int port,
+ {SecurityContext context,
+ bool onBadCertificate(X509Certificate certificate),
+ List<String> supportedProtocols}) {
+ return RawSecureSocket.startConnect(host, port,
+ context: context,
+ onBadCertificate: onBadCertificate,
+ supportedProtocols: supportedProtocols)
+ .then((rawState) {
+ Future<SecureSocket> socket =
+ rawState.socket.then((rawSocket) => new SecureSocket._(rawSocket));
+ return new ConnectionTask<SecureSocket>._(
+ socket: socket, onCancel: rawState._onCancel);
+ });
+ }
+
/**
* Takes an already connected [socket] and starts client side TLS
* handshake to make the communication secure. When the returned
@@ -215,6 +233,26 @@
});
}
+ /// Like [connect], but returns a [Future] that completes with a
+ /// [ConnectionTask] that can be cancelled if the [RawSecureSocket] is no
+ /// longer needed.
+ static Future<ConnectionTask<RawSecureSocket>> startConnect(host, int port,
+ {SecurityContext context,
+ bool onBadCertificate(X509Certificate certificate),
+ List<String> supportedProtocols}) {
+ return RawSocket.startConnect(host, port)
+ .then((ConnectionTask<RawSocket> rawState) {
+ Future<RawSecureSocket> socket = rawState.socket.then((rawSocket) {
+ return secure(rawSocket,
+ context: context,
+ onBadCertificate: onBadCertificate,
+ supportedProtocols: supportedProtocols);
+ });
+ return new ConnectionTask<RawSecureSocket>._(
+ socket: socket, onCancel: rawState._onCancel);
+ });
+ }
+
/**
* Takes an already connected [socket] and starts client side TLS
* handshake to make the communication secure. When the returned
@@ -990,8 +1028,7 @@
args[2 * i + 3] = bufs[i].end;
}
- return _IOService
- ._dispatch(_IOService.sslProcessFilter, args)
+ return _IOService._dispatch(_IOService.sslProcessFilter, args)
.then((response) {
if (response.length == 2) {
if (wasInHandshake) {
diff --git a/sdk/lib/io/socket.dart b/sdk/lib/io/socket.dart
index 0ab315e..1d8a263 100644
--- a/sdk/lib/io/socket.dart
+++ b/sdk/lib/io/socket.dart
@@ -426,6 +426,32 @@
}
}
+/// Returned by the `startConnect` methods on client-side socket types `S`,
+/// `ConnectionTask<S>` allows cancelling an attempt to connect to a host.
+class ConnectionTask<S> {
+ /// A `Future` that completes with value that `S.connect()` would return
+ /// unless [cancel] is called on this [ConnectionTask].
+ ///
+ /// If [cancel] is called, the `Future` completes with a [SocketException]
+ /// error whose message indicates that the connection attempt was cancelled.
+ final Future<S> socket;
+ final void Function() _onCancel;
+
+ ConnectionTask._({Future<S> socket, void Function() onCancel})
+ : assert(socket != null),
+ assert(onCancel != null),
+ this.socket = socket,
+ this._onCancel = onCancel;
+
+ /// Cancels the connection attempt.
+ ///
+ /// This also causes the [socket] `Future` to complete with a
+ /// [SocketException] error.
+ void cancel() {
+ _onCancel();
+ }
+}
+
/**
* The [RawSocket] is a low-level interface to a socket, exposing the raw
* events signaled by the system. It's a [Stream] of [RawSocketEvent]s.
@@ -470,6 +496,12 @@
external static Future<RawSocket> connect(host, int port,
{sourceAddress, Duration timeout});
+ /// Like [connect], but returns a [Future] that completes with a
+ /// [ConnectionTask] that can be cancelled if the [RawSocket] is no
+ /// longer needed.
+ external static Future<ConnectionTask<RawSocket>> startConnect(host, int port,
+ {sourceAddress});
+
/**
* Returns the number of received and non-read bytes in the socket that
* can be read.
@@ -583,9 +615,25 @@
sourceAddress: sourceAddress, timeout: timeout);
}
+ /// Like [connect], but returns a [Future] that completes with a
+ /// [ConnectionTask] that can be cancelled if the [Socket] is no
+ /// longer needed.
+ static Future<ConnectionTask<Socket>> startConnect(host, int port,
+ {sourceAddress}) {
+ final IOOverrides overrides = IOOverrides.current;
+ if (overrides == null) {
+ return Socket._startConnect(host, port, sourceAddress: sourceAddress);
+ }
+ return overrides.socketStartConnect(host, port,
+ sourceAddress: sourceAddress);
+ }
+
external static Future<Socket> _connect(host, int port,
{sourceAddress, Duration timeout});
+ external static Future<ConnectionTask<Socket>> _startConnect(host, int port,
+ {sourceAddress});
+
/**
* Destroy the socket in both directions. Calling [destroy] will make the
* send a close event on the stream and will no longer react on data being
diff --git a/tests/co19/co19-dart2js.status b/tests/co19/co19-dart2js.status
index 8dca3dfa..4c34ac7 100644
--- a/tests/co19/co19-dart2js.status
+++ b/tests/co19/co19-dart2js.status
@@ -607,7 +607,6 @@
LayoutTests/fast/dom/MutationObserver/weak-callback-gc-crash_t01: RuntimeError # Please triage this failure
LayoutTests/fast/dom/Node/fragment-mutation_t01: RuntimeError # Please triage this failure
LayoutTests/fast/dom/Node/initial-values_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/dom/NodeIterator/NodeIterator-basic_t01: RuntimeError # Please triage this failure
LayoutTests/fast/dom/Range/bug-19527_t01: RuntimeError # Please triage this failure
LayoutTests/fast/dom/Range/insertNode-empty-fragment-crash_t01: RuntimeError # Please triage this failure
LayoutTests/fast/dom/Range/mutation_t01: RuntimeError # Please triage this failure
@@ -618,13 +617,11 @@
LayoutTests/fast/dom/Range/range-insertNode-separate-endContainer_t01: RuntimeError # Please triage this failure
LayoutTests/fast/dom/Range/range-insertNode-splittext_t01: RuntimeError # Please triage this failure
LayoutTests/fast/dom/SelectorAPI/dumpNodeList-2_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/dom/SelectorAPI/dumpNodeList_t01: RuntimeError # Please triage this failure
LayoutTests/fast/dom/StyleSheet/css-medialist-item_t01: RuntimeError # Please triage this failure
LayoutTests/fast/dom/StyleSheet/detached-parent-rule-without-wrapper_t01: RuntimeError # Please triage this failure
LayoutTests/fast/dom/StyleSheet/detached-stylesheet-without-wrapper_t01: RuntimeError # Please triage this failure
LayoutTests/fast/dom/StyleSheet/removed-media-rule-deleted-parent-crash_t01: RuntimeError
LayoutTests/fast/dom/StyleSheet/removed-stylesheet-rule-deleted-parent-crash_t01: RuntimeError
-LayoutTests/fast/dom/TreeWalker/TreeWalker-basic_t01: RuntimeError # Please triage this failure
LayoutTests/fast/dom/Window/getMatchedCSSRules-nested-rules_t01: Pass, RuntimeError # Please triage this failure
LayoutTests/fast/dom/Window/getMatchedCSSRules-null-crash_t01: RuntimeError
LayoutTests/fast/dom/Window/getMatchedCSSRules-parent-stylesheets_t01: RuntimeError
@@ -651,7 +648,6 @@
LayoutTests/fast/dom/fragment-activation-focuses-target_t01: Pass, RuntimeError # Please triage this failure
LayoutTests/fast/dom/getElementsByClassName/010_t01: Pass, RuntimeError # Please triage this failure
LayoutTests/fast/dom/getElementsByClassName/011_t01: Pass, RuntimeError # Please triage this failure
-LayoutTests/fast/dom/getElementsByClassName/dumpNodeList_t01: RuntimeError # Please triage this failure
LayoutTests/fast/dom/horizontal-scrollbar-in-rtl-doesnt-fire-onscroll_t01: Pass, RuntimeError # Please triage this failure
LayoutTests/fast/dom/horizontal-scrollbar-in-rtl_t01: RuntimeError # Please triage this failure
LayoutTests/fast/dom/horizontal-scrollbar-when-dir-change_t01: RuntimeError # Please triage this failure
@@ -710,7 +706,6 @@
LayoutTests/fast/events/event-attributes-after-exception_t01: RuntimeError # Please triage this failure
LayoutTests/fast/events/event-creation_t01: RuntimeError # Please triage this failure
LayoutTests/fast/events/event-listener-html-non-html-confusion_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/events/event-trace_t01: RuntimeError # Please triage this failure
LayoutTests/fast/events/fire-scroll-event-element_t01: Skip # Times out. Please triage this failure
LayoutTests/fast/events/fire-scroll-event_t01: Skip # Times out. Please triage this failure
LayoutTests/fast/events/init-message-event_t01: RuntimeError # Please triage this failure
@@ -1373,6 +1368,7 @@
LayoutTests/fast/dom/HTMLScriptElement/script-reexecution_t01: RuntimeError # Please triage this failure
LayoutTests/fast/dom/HTMLTemplateElement/inertContents_t01: RuntimeError # Please triage this failure
LayoutTests/fast/dom/Range/create-contextual-fragment-script-unmark-already-started_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/events/event-trace_t01: RuntimeError # runtimeType.toString() returns minified names
LayoutTests/fast/files/workers/inline-worker-via-blob-url_t01: SkipByDesign # inlined script
LayoutTests/fast/loader/scroll-position-restored-on-back_t01: Skip # Timeout. Please triage this failure
WebPlatformTest/webstorage/event_local_key_t01: Skip # Timeout. Please triage this failure.
@@ -1741,7 +1737,6 @@
LayoutTests/fast/dom/MutationObserver/weak-callback-gc-crash_t01: RuntimeError # Please triage this failure
LayoutTests/fast/dom/Node/fragment-mutation_t01: RuntimeError # Please triage this failure
LayoutTests/fast/dom/Node/initial-values_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/dom/NodeIterator/NodeIterator-basic_t01: RuntimeError # Please triage this failure
LayoutTests/fast/dom/Range/bug-19527_t01: RuntimeError # Please triage this failure
LayoutTests/fast/dom/Range/insertNode-empty-fragment-crash_t01: RuntimeError # Please triage this failure
LayoutTests/fast/dom/Range/mutation_t01: RuntimeError # Please triage this failure
@@ -1750,10 +1745,8 @@
LayoutTests/fast/dom/Range/range-insertNode-separate-endContainer_t01: RuntimeError # Please triage this failure
LayoutTests/fast/dom/Range/range-insertNode-splittext_t01: RuntimeError # Please triage this failure
LayoutTests/fast/dom/SelectorAPI/dumpNodeList-2_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/dom/SelectorAPI/dumpNodeList_t01: RuntimeError # Please triage this failure
LayoutTests/fast/dom/StyleSheet/css-medialist-item_t01: RuntimeError # Please triage this failure
LayoutTests/fast/dom/StyleSheet/detached-stylesheet-without-wrapper_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/dom/TreeWalker/TreeWalker-basic_t01: RuntimeError # Please triage this failure
LayoutTests/fast/dom/Window/getMatchedCSSRules-with-pseudo-elements-complex_t01: Pass, RuntimeError # Issue 29634
LayoutTests/fast/dom/Window/window-resize-contents_t01: RuntimeError # Please triage this failure
LayoutTests/fast/dom/Window/window-scroll-arguments_t01: RuntimeError # Please triage this failure
@@ -1769,7 +1762,6 @@
LayoutTests/fast/dom/document-importNode-arguments_t01: RuntimeError # Please triage this failure
LayoutTests/fast/dom/domparser-parsefromstring-mimetype-support_t01: RuntimeError # Please triage this failure
LayoutTests/fast/dom/getElementsByClassName/011_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/dom/getElementsByClassName/dumpNodeList_t01: RuntimeError # Please triage this failure
LayoutTests/fast/dom/horizontal-scrollbar-in-rtl_t01: RuntimeError # Please triage this failure
LayoutTests/fast/dom/horizontal-scrollbar-when-dir-change_t01: RuntimeError # Please triage this failure
LayoutTests/fast/dom/navigatorcontentutils/is-protocol-handler-registered_t01: RuntimeError # Please triage this failure
@@ -1792,7 +1784,6 @@
LayoutTests/fast/events/change-overflow-on-overflow-change_t01: Skip # Times out.
LayoutTests/fast/events/document-elementFromPoint_t01: RuntimeError # Please triage this failure
LayoutTests/fast/events/event-creation_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/events/event-trace_t01: RuntimeError # Please triage this failure
LayoutTests/fast/events/fire-scroll-event_t01: Pass, RuntimeError # Issue 29634
LayoutTests/fast/events/initkeyboardevent-crash_t01: RuntimeError # Please triage this failure
LayoutTests/fast/events/invalid-003_t01: RuntimeError # Please triage this failure
@@ -2476,10 +2467,8 @@
LayoutTests/fast/css/content/content-normal_t01: RuntimeError # Please triage this failure
LayoutTests/fast/css/content/content-quotes-06_t01: RuntimeError # Please triage this failure
LayoutTests/fast/css/counters/complex-before_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/css/counters/counter-cssText_t01: RuntimeError # Please triage this failure
LayoutTests/fast/css/counters/counter-reset-subtree-insert-crash_t01: RuntimeError # Please triage this failure
LayoutTests/fast/css/css-escaped-identifier_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/css/css-properties-case-insensitive_t01: RuntimeError # Please triage this failure
LayoutTests/fast/css/css3-nth-tokens-style_t01: RuntimeError # Please triage this failure
LayoutTests/fast/css/cursor-parsing-image-set_t01: RuntimeError # Please triage this failure
LayoutTests/fast/css/cursor-parsing_t01: RuntimeError # Please triage this failure
@@ -2543,7 +2532,6 @@
LayoutTests/fast/css/parsing-css-allowed-string-characters_t01: RuntimeError # Please triage this failure
LayoutTests/fast/css/parsing-page-rule_t01: RuntimeError # Please triage this failure
LayoutTests/fast/css/parsing-selector-error-recovery_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/css/parsing-unexpected-eof_t01: RuntimeError # Please triage this failure
LayoutTests/fast/css/parsing-webkit-font-smoothing_t01: RuntimeError # Please triage this failure
LayoutTests/fast/css/position-absolute-float_t01: Pass, RuntimeError # Please triage this failure
LayoutTests/fast/css/pseudo-any_t01: RuntimeError # Please triage this failure
@@ -2713,7 +2701,6 @@
LayoutTests/fast/dom/MutationObserver/weak-callback-gc-crash_t01: RuntimeError # Please triage this failure
LayoutTests/fast/dom/Node/fragment-mutation_t01: RuntimeError # Please triage this failure
LayoutTests/fast/dom/Node/initial-values_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/dom/NodeIterator/NodeIterator-basic_t01: RuntimeError # Please triage this failure
LayoutTests/fast/dom/Range/bug-19527_t01: RuntimeError # Please triage this failure
LayoutTests/fast/dom/Range/getClientRects-character_t01: RuntimeError # Please triage this failure
LayoutTests/fast/dom/Range/insertNode-empty-fragment-crash_t01: RuntimeError # Please triage this failure
@@ -2727,7 +2714,6 @@
LayoutTests/fast/dom/Range/range-insertNode-splittext_t01: RuntimeError # Please triage this failure
LayoutTests/fast/dom/SelectorAPI/caseTagX_t01: RuntimeError # Please triage this failure
LayoutTests/fast/dom/SelectorAPI/dumpNodeList-2_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/dom/SelectorAPI/dumpNodeList_t01: RuntimeError # Please triage this failure
LayoutTests/fast/dom/StyleSheet/css-insert-import-rule-to-shadow-stylesheets_t01: RuntimeError # Please triage this failure
LayoutTests/fast/dom/StyleSheet/css-medialist-item_t01: RuntimeError # Please triage this failure
LayoutTests/fast/dom/StyleSheet/detached-parent-rule-without-wrapper_t01: RuntimeError # Please triage this failure
@@ -2735,7 +2721,6 @@
LayoutTests/fast/dom/StyleSheet/empty-shadow-style_t01: RuntimeError # Please triage this failure
LayoutTests/fast/dom/StyleSheet/removed-media-rule-deleted-parent-crash_t01: RuntimeError # Please triage this failure
LayoutTests/fast/dom/StyleSheet/removed-stylesheet-rule-deleted-parent-crash_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/dom/TreeWalker/TreeWalker-basic_t01: RuntimeError # Please triage this failure
LayoutTests/fast/dom/Window/getMatchedCSSRules-nested-rules_t01: RuntimeError # Please triage this failure
LayoutTests/fast/dom/Window/getMatchedCSSRules-null-crash_t01: RuntimeError # Please triage this failure
LayoutTests/fast/dom/Window/getMatchedCSSRules-parent-stylesheets_t01: RuntimeError # Please triage this failure
@@ -2788,7 +2773,6 @@
LayoutTests/fast/dom/fragment-activation-focuses-target_t01: RuntimeError # Please triage this failure
LayoutTests/fast/dom/getElementsByClassName/010_t01: RuntimeError # Please triage this failure
LayoutTests/fast/dom/getElementsByClassName/011_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/dom/getElementsByClassName/dumpNodeList_t01: RuntimeError # Please triage this failure
LayoutTests/fast/dom/horizontal-scrollbar-in-rtl-doesnt-fire-onscroll_t01: RuntimeError # Please triage this failure
LayoutTests/fast/dom/horizontal-scrollbar-in-rtl_t01: RuntimeError # Please triage this failure
LayoutTests/fast/dom/horizontal-scrollbar-when-dir-change_t01: RuntimeError # Please triage this failure
@@ -2901,7 +2885,6 @@
LayoutTests/fast/events/event-creation_t01: RuntimeError # Please triage this failure
LayoutTests/fast/events/event-fire-order_t01: RuntimeError # Please triage this failure
LayoutTests/fast/events/event-listener-html-non-html-confusion_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/events/event-trace_t01: RuntimeError # Please triage this failure
LayoutTests/fast/events/fire-scroll-event_t01: RuntimeError # Please triage this failure
LayoutTests/fast/events/form-onchange_t01: RuntimeError # Please triage this failure
LayoutTests/fast/events/init-message-event_t01: RuntimeError # Issue 28983
@@ -3195,7 +3178,6 @@
LayoutTests/fast/speechsynthesis/speech-synthesis-voices_t01: RuntimeError # Please triage this failure
LayoutTests/fast/storage/disallowed-storage_t01: RuntimeError # Please triage this failure
LayoutTests/fast/storage/storage-disallowed-in-data-url_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/sub-pixel/computedstylemargin_t01: RuntimeError # Please triage this failure
LayoutTests/fast/sub-pixel/cssom-subpixel-precision_t01: RuntimeError # Please triage this failure
LayoutTests/fast/svg/getbbox_t01: Pass, RuntimeError # Please triage this failure
LayoutTests/fast/svg/tabindex-focus_t01: RuntimeError # Please triage this failure
@@ -3641,7 +3623,10 @@
LayoutTests/fast/canvas/webgl/tex-sub-image-2d-bad-args_t01: RuntimeError # Please triage this failure
LayoutTests/fast/canvas/webgl/texture-complete_t01: Skip # Times out sometimes
LayoutTests/fast/canvas/webgl/texture-npot_t01: Skip # Times out sometimes
+LayoutTests/fast/css/counters/counter-cssText_t01: RuntimeError
+LayoutTests/fast/css/parsing-unexpected-eof_t01: RuntimeError
LayoutTests/fast/forms/submit-form-attributes_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/sub-pixel/computedstylemargin_t01: RuntimeError
LayoutTests/fast/text/whitespace/nowrap-line-break-after-white-space_t01: Pass, RuntimeError # Please triage this failure
LayoutTests/fast/xpath/4XPath/Core/test_parser_t01: RuntimeError # Dartium JSInterop failure
LayoutTests/fast/xpath/py-dom-xpath/abbreviations_t01: RuntimeError # Dartium JSInterop failure
@@ -3657,6 +3642,8 @@
LayoutTests/fast/forms/submit-form-attributes_t01: RuntimeError # Please triage this failure
LayoutTests/fast/media/color-does-not-include-alpha_t01: RuntimeError # Issue 31161
LayoutTests/fast/media/media-query-list_t01: Pass, RuntimeError # Issue 32257
+LibTest/core/Uri/Uri_A06_t03: Pass, Slow
+LibTest/core/Uri/encodeQueryComponent_A01_t02: Pass, Slow
[ $compiler == dart2js && $runtime == ff && $checked ]
LayoutTests/fast/canvas/webgl/framebuffer-object-attachment_t01: RuntimeError # Please triage this failure
@@ -3969,7 +3956,6 @@
LayoutTests/fast/css/css-escaped-identifier_t01: RuntimeError # Please triage this failure
LayoutTests/fast/css/css-keyframe-style-crash_t01: RuntimeError # Please triage this failure
LayoutTests/fast/css/css-keyframe-unexpected-end_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/css/css-properties-case-insensitive_t01: RuntimeError # Please triage this failure
LayoutTests/fast/css/css-selector-text_t01: RuntimeError # Please triage this failure
LayoutTests/fast/css/css3-nth-tokens-script_t01: Skip # Times out. Please triage this failure
LayoutTests/fast/css/css3-nth-tokens-style_t01: RuntimeError # Please triage this failure
@@ -4054,7 +4040,6 @@
LayoutTests/fast/css/nested-at-rules_t01: RuntimeError # Please triage this failure
LayoutTests/fast/css/nested-rule-parent-sheet_t01: RuntimeError # Please triage this failure
LayoutTests/fast/css/overflow-property_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/css/padding-no-renderer_t01: RuntimeError # Please triage this failure
LayoutTests/fast/css/padding-start-end_t01: RuntimeError # Please triage this failure
LayoutTests/fast/css/parse-color-int-or-percent-crash_t01: RuntimeError # Please triage this failure
LayoutTests/fast/css/parsing-at-rule-recovery_t01: RuntimeError # Please triage this failure
@@ -4301,7 +4286,7 @@
LayoutTests/fast/dom/Node/contains-method_t01: RuntimeError # Please triage this failure
LayoutTests/fast/dom/Node/fragment-mutation_t01: RuntimeError # Please triage this failure
LayoutTests/fast/dom/Node/initial-values_t01: Skip # Times out. Please triage this failure
-LayoutTests/fast/dom/NodeIterator/NodeIterator-basic_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/NodeIterator/NodeIterator-basic_t01: RuntimeError
LayoutTests/fast/dom/NodeList/nodelist-moved-to-fragment-2_t01: RuntimeError # Please triage this failure
LayoutTests/fast/dom/NodeList/nodelist-reachable_t01: RuntimeError # Please triage this failure
LayoutTests/fast/dom/Range/13000_t01: RuntimeError # Please triage this failure
@@ -4327,7 +4312,6 @@
LayoutTests/fast/dom/SelectorAPI/caseID_t01: RuntimeError # Please triage this failure
LayoutTests/fast/dom/SelectorAPI/caseTagX_t01: RuntimeError # Please triage this failure
LayoutTests/fast/dom/SelectorAPI/dumpNodeList-2_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/dom/SelectorAPI/dumpNodeList_t01: RuntimeError # Please triage this failure
LayoutTests/fast/dom/StyleSheet/css-insert-import-rule-to-shadow-stylesheets_t01: RuntimeError # Please triage this failure
LayoutTests/fast/dom/StyleSheet/css-medialist-item_t01: RuntimeError # Please triage this failure
LayoutTests/fast/dom/StyleSheet/detached-parent-rule-without-wrapper_t01: RuntimeError # Please triage this failure
@@ -4340,7 +4324,7 @@
LayoutTests/fast/dom/Text/next-element-sibling_t01: RuntimeError # Please triage this failure
LayoutTests/fast/dom/Text/normalize-crash-in-spell-checker_t01: RuntimeError # Please triage this failure
LayoutTests/fast/dom/Text/previous-element-sibling_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/dom/TreeWalker/TreeWalker-basic_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/TreeWalker/TreeWalker-basic_t01: RuntimeError
LayoutTests/fast/dom/Window/atob-btoa_t01: RuntimeError # Please triage this failure
LayoutTests/fast/dom/Window/getMatchedCSSRules-nested-rules_t01: RuntimeError # Please triage this failure
LayoutTests/fast/dom/Window/getMatchedCSSRules-null-crash_t01: RuntimeError # Please triage this failure
@@ -4411,7 +4395,6 @@
LayoutTests/fast/dom/getElementsByClassName/010_t01: RuntimeError # Please triage this failure
LayoutTests/fast/dom/getElementsByClassName/011_t01: RuntimeError # Please triage this failure
LayoutTests/fast/dom/getElementsByClassName/014_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/dom/getElementsByClassName/dumpNodeList_t01: RuntimeError # Please triage this failure
LayoutTests/fast/dom/getelementsbyname-invalidation-cache_t01: RuntimeError # Please triage this failure
LayoutTests/fast/dom/horizontal-scrollbar-in-rtl-doesnt-fire-onscroll_t01: RuntimeError # Please triage this failure
LayoutTests/fast/dom/horizontal-scrollbar-in-rtl_t01: RuntimeError # Please triage this failure
@@ -4539,7 +4522,6 @@
LayoutTests/fast/events/event-listener-sharing_t01: RuntimeError # Please triage this failure
LayoutTests/fast/events/event-on-created-document_t01: RuntimeError # Please triage this failure
LayoutTests/fast/events/event-on-xhr-document_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/events/event-trace_t01: RuntimeError # Please triage this failure
LayoutTests/fast/events/fire-scroll-event_t01: RuntimeError # Please triage this failure
LayoutTests/fast/events/form-onchange_t01: RuntimeError # Please triage this failure
LayoutTests/fast/events/init-message-event_t01: RuntimeError # Please triage this failure
@@ -5890,7 +5872,6 @@
LayoutTests/fast/dom/MutationObserver/observe-options-character-data_t01: RuntimeError # Please triage this failure
LayoutTests/fast/dom/MutationObserver/weak-callback-gc-crash_t01: RuntimeError # Please triage this failure
LayoutTests/fast/dom/Node/initial-values_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/dom/NodeIterator/NodeIterator-basic_t01: RuntimeError # Please triage this failure
LayoutTests/fast/dom/Range/bug-19527_t01: RuntimeError # Please triage this failure
LayoutTests/fast/dom/Range/insertNode-empty-fragment-crash_t01: RuntimeError # Please triage this failure
LayoutTests/fast/dom/Range/mutation_t01: RuntimeError # Please triage this failure
@@ -5905,12 +5886,11 @@
LayoutTests/fast/dom/Range/range-on-detached-node_t01: RuntimeError # Please triage this failure
LayoutTests/fast/dom/Range/surroundContents-for-detached-node_t01: RuntimeError # Please triage this failure
LayoutTests/fast/dom/SelectorAPI/dumpNodeList-2_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/dom/SelectorAPI/dumpNodeList_t01: RuntimeError # Please triage this failure
LayoutTests/fast/dom/StyleSheet/css-insert-import-rule-to-shadow-stylesheets_t01: RuntimeError # Please triage this failure
LayoutTests/fast/dom/StyleSheet/css-medialist-item_t01: RuntimeError # Please triage this failure
LayoutTests/fast/dom/StyleSheet/detached-shadow-style_t01: RuntimeError # Please triage this failure
LayoutTests/fast/dom/StyleSheet/empty-shadow-style_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/dom/TreeWalker/TreeWalker-basic_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/TreeWalker/TreeWalker-basic_t01: RuntimeError
LayoutTests/fast/dom/Window/atob-btoa_t01: RuntimeError # Please triage this failure
LayoutTests/fast/dom/Window/getMatchedCSSRules-parent-stylesheets_t01: RuntimeError # Please triage this failure
LayoutTests/fast/dom/Window/window-resize-contents_t01: RuntimeError # Please triage this failure
@@ -5945,7 +5925,6 @@
LayoutTests/fast/dom/document-set-title-no-reuse_t01: RuntimeError # Please triage this failure
LayoutTests/fast/dom/domparser-parsefromstring-mimetype-support_t01: RuntimeError # Please triage this failure
LayoutTests/fast/dom/fragment-activation-focuses-target_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/dom/getElementsByClassName/dumpNodeList_t01: RuntimeError # Please triage this failure
LayoutTests/fast/dom/horizontal-scrollbar-in-rtl-doesnt-fire-onscroll_t01: RuntimeError # Please triage this failure
LayoutTests/fast/dom/horizontal-scrollbar-in-rtl_t01: RuntimeError # Please triage this failure
LayoutTests/fast/dom/horizontal-scrollbar-when-dir-change_t01: RuntimeError # Please triage this failure
@@ -6054,7 +6033,6 @@
LayoutTests/fast/events/event-listener-html-non-html-confusion_t01: RuntimeError # Please triage this failure
LayoutTests/fast/events/event-on-created-document_t01: RuntimeError # Please triage this failure
LayoutTests/fast/events/event-on-xhr-document_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/events/event-trace_t01: RuntimeError # Please triage this failure
LayoutTests/fast/events/initkeyboardevent-crash_t01: RuntimeError # Please triage this failure
LayoutTests/fast/events/invalid-003_t01: RuntimeError # Please triage this failure
LayoutTests/fast/events/invalid-004_t01: RuntimeError # Please triage this failure
@@ -6176,8 +6154,6 @@
LayoutTests/fast/forms/textarea-paste-newline_t01: RuntimeError # Please triage this failure
LayoutTests/fast/forms/textarea-selection-preservation_t01: RuntimeError # Please triage this failure
LayoutTests/fast/forms/validationMessage_t01: RuntimeError # Issue 32567
-LayoutTests/fast/forms/validity-property_t01: RuntimeError # co19 issue 140
-LayoutTests/fast/forms/willvalidate_t01: RuntimeError # co19 issue 142
LayoutTests/fast/html/hidden-attr_t01: RuntimeError # Please triage this failure
LayoutTests/fast/html/imports/import-element-removed-flag_t01: Skip # Times out. Please triage this failure
LayoutTests/fast/html/imports/import-events_t01: RuntimeError # Please triage this failure
@@ -6967,9 +6943,6 @@
Language/Classes/Constructors/Generative_Constructors/execution_t07: Crash
Language/Classes/Constructors/Generative_Constructors/execution_t12: Crash
Language/Classes/Constructors/Generative_Constructors/initializing_formals_execution_t02: MissingCompileTimeError
-Language/Classes/Constructors/Generative_Constructors/redirection_t03: Crash
-Language/Classes/Constructors/Generative_Constructors/redirection_t07: Crash
-Language/Classes/Constructors/Generative_Constructors/redirection_t08: Crash
Language/Classes/Getters/same_name_method_t03: MissingCompileTimeError
Language/Classes/Getters/same_name_method_t04: MissingCompileTimeError
Language/Classes/Getters/same_name_method_t05: MissingCompileTimeError
@@ -7084,7 +7057,6 @@
LibTest/html/HttpRequest/getAllResponseHeaders_A01_t01: Crash
LibTest/html/HttpRequest/getResponseHeader_A01_t01: Crash
LibTest/html/HttpRequest/getString_A01_t01: Crash
-LibTest/html/HttpRequest/overrideMimeType_A01_t01: Crash
LibTest/html/HttpRequest/request_A01_t01: Crash
LibTest/html/HttpRequest/setRequestHeader_A01_t01: Crash
LibTest/html/HttpRequest/statusText_A01_t01: Crash
@@ -7098,25 +7070,11 @@
WebPlatformTest/html/semantics/embedded-content/the-audio-element/audio_constructor_t01: RuntimeError
[ $compiler == dart2js && $fasta && $host_checked ]
-Language/Classes/Constructors/Factories/redirecting_constructor_t03: Crash
Language/Classes/Constructors/Generative_Constructors/execution_t04: Crash
Language/Classes/Constructors/Generative_Constructors/execution_t05: Crash
Language/Classes/Constructors/Generative_Constructors/execution_t06: Crash
Language/Classes/Constructors/Generative_Constructors/execution_t07: Crash
Language/Classes/Constructors/Generative_Constructors/execution_t12: Crash
-Language/Classes/Constructors/Generative_Constructors/initializers_t12: Crash # Issue 33157
-Language/Classes/Constructors/Generative_Constructors/redirection_t03: Crash
-Language/Classes/Constructors/Generative_Constructors/redirection_t07: Crash
-Language/Classes/Constructors/Generative_Constructors/redirection_t08: Crash
-Language/Classes/Instance_Methods/Operators/allowed_names_t20: Crash
-Language/Classes/member_definition_t04: Crash
-Language/Classes/member_definition_t06: Crash
-Language/Classes/member_definition_t07: Crash
-Language/Classes/member_definition_t08: Crash
-Language/Classes/member_definition_t09: Crash
-Language/Classes/member_definition_t10: Crash
-Language/Classes/member_definition_t11: Crash
-Language/Classes/member_definition_t12: Crash
Language/Expressions/Constants/depending_on_itself_t03: Crash
Language/Expressions/Function_Invocation/Unqualified_Invocation/instance_context_invocation_t04: Crash
Language/Expressions/Method_Invocation/Super_Invocation/accessible_instance_member_t02: Crash
@@ -7136,7 +7094,6 @@
LibTest/html/HttpRequest/getResponseHeader_A01_t01: Crash
LibTest/html/HttpRequest/getString_A01_t01: Crash
LibTest/html/HttpRequest/onError_A01_t02: Crash
-LibTest/html/HttpRequest/overrideMimeType_A01_t01: Crash
LibTest/html/HttpRequest/request_A01_t01: Crash
LibTest/html/HttpRequest/responseText_A01_t02: Crash
LibTest/html/HttpRequest/setRequestHeader_A01_t01: Crash
@@ -7245,6 +7202,9 @@
LibTest/typed_data/Uint8ClampedList/runtimeType_A01_t01: Fail # co19-roll r559: Please triage this failure
LibTest/typed_data/Uint8List/runtimeType_A01_t01: Fail # co19-roll r559: Please triage this failure
+[ $compiler == dart2js && $strong ]
+*: SkipByDesign # co19 suite is not for strong-mode
+
[ $compiler == dart2js && !$strong ]
LibTest/typed_data/Float32x4List/first_A01_t02: Pass # co19 issue 130 + type error
LibTest/typed_data/Float32x4List/last_A01_t02: Pass # co19 issue 130 + type error
diff --git a/tests/co19/co19-kernel.status b/tests/co19/co19-kernel.status
index 1953746..c28c644 100644
--- a/tests/co19/co19-kernel.status
+++ b/tests/co19/co19-kernel.status
@@ -172,9 +172,6 @@
Language/Classes/Constructors/Generative_Constructors/explicit_type_t02: CompileTimeError
Language/Classes/Constructors/Generative_Constructors/initializers_t15: CompileTimeError
Language/Classes/Constructors/Generative_Constructors/initializing_this_t03: CompileTimeError
-Language/Classes/Constructors/Generative_Constructors/redirection_t03: MissingCompileTimeError
-Language/Classes/Constructors/Generative_Constructors/redirection_t07: MissingCompileTimeError
-Language/Classes/Constructors/Generative_Constructors/redirection_t08: MissingCompileTimeError
Language/Classes/Constructors/implicit_constructor_t03: CompileTimeError
Language/Classes/Getters/override_t01: CompileTimeError
Language/Classes/Getters/override_t04: CompileTimeError
@@ -206,6 +203,7 @@
Language/Classes/Setters/type_object_t01: CompileTimeError
Language/Classes/Setters/type_object_t02: CompileTimeError
Language/Classes/Static_Methods/declaration_t03: CompileTimeError
+Language/Classes/Static_Methods/same_name_method_and_setter_t01: CompileTimeError # Invalid test, see #33237
Language/Classes/Static_Methods/type_object_t01: CompileTimeError
Language/Classes/Static_Methods/type_object_t02: CompileTimeError
Language/Classes/Static_Variables/inheritance_t01: CompileTimeError
@@ -1689,15 +1687,13 @@
Language/Classes/Constructors/Generative_Constructors/execution_t06: MissingCompileTimeError
Language/Classes/Constructors/Generative_Constructors/execution_t07: MissingCompileTimeError
Language/Classes/Constructors/Generative_Constructors/execution_t12: MissingCompileTimeError
-Language/Classes/Constructors/Generative_Constructors/redirection_t03: MissingCompileTimeError
-Language/Classes/Constructors/Generative_Constructors/redirection_t07: MissingCompileTimeError
-Language/Classes/Constructors/Generative_Constructors/redirection_t08: MissingCompileTimeError
Language/Classes/Constructors/Generative_Constructors/superclass_constructor_t02: MissingCompileTimeError
Language/Classes/Constructors/Generative_Constructors/superclass_constructor_t03: MissingCompileTimeError
Language/Classes/Constructors/Generative_Constructors/superclass_constructor_t05: MissingCompileTimeError
Language/Classes/Constructors/Generative_Constructors/superclass_constructor_t06: MissingCompileTimeError
Language/Classes/Instance_Variables/constant_t01: MissingCompileTimeError
Language/Classes/Static_Methods/declaration_t01: MissingCompileTimeError
+Language/Classes/Static_Methods/same_name_method_and_setter_t01: CompileTimeError # Invalid test, see #33237
Language/Classes/Superclasses/wrong_superclass_t08: MissingCompileTimeError
Language/Classes/Superinterfaces/wrong_type_t05: MissingCompileTimeError
Language/Classes/same_name_instance_and_static_members_t01: MissingCompileTimeError
diff --git a/tests/co19_2/co19_2-kernel.status b/tests/co19_2/co19_2-kernel.status
index 6378421..a32e005 100644
--- a/tests/co19_2/co19_2-kernel.status
+++ b/tests/co19_2/co19_2-kernel.status
@@ -41,9 +41,6 @@
Language/Classes/Constructors/Generative_Constructors/explicit_type_t01: MissingCompileTimeError
Language/Classes/Constructors/Generative_Constructors/initializers_t15: CompileTimeError
Language/Classes/Constructors/Generative_Constructors/redirection_t02: MissingCompileTimeError
-Language/Classes/Constructors/Generative_Constructors/redirection_t03: MissingCompileTimeError
-Language/Classes/Constructors/Generative_Constructors/redirection_t07: MissingCompileTimeError
-Language/Classes/Constructors/Generative_Constructors/redirection_t08: MissingCompileTimeError
Language/Classes/Constructors/Generative_Constructors/static_type_t01: MissingCompileTimeError
Language/Classes/Getters/instance_getter_t01: MissingCompileTimeError
Language/Classes/Getters/instance_getter_t02: MissingCompileTimeError
diff --git a/tests/compiler/dart2js/equivalence/id_equivalence_helper.dart b/tests/compiler/dart2js/equivalence/id_equivalence_helper.dart
index 15dd004..e634291 100644
--- a/tests/compiler/dart2js/equivalence/id_equivalence_helper.dart
+++ b/tests/compiler/dart2js/equivalence/id_equivalence_helper.dart
@@ -236,6 +236,12 @@
commonElements.asyncLibrary,
];
+ LibraryEntity htmlLibrary =
+ elementEnvironment.lookupLibrary(Uri.parse('dart:html'), required: false);
+ if (htmlLibrary != null) {
+ globalLibraries.add(htmlLibrary);
+ }
+
ClassEntity getGlobalClass(String className) {
ClassEntity cls;
for (LibraryEntity library in globalLibraries) {
diff --git a/tests/compiler/dart2js/model/constant_expression_evaluate_test.dart b/tests/compiler/dart2js/model/constant_expression_evaluate_test.dart
index d5af387..7d8c5ac 100644
--- a/tests/compiler/dart2js/model/constant_expression_evaluate_test.dart
+++ b/tests/compiler/dart2js/model/constant_expression_evaluate_test.dart
@@ -374,6 +374,9 @@
class Class6 extends Class5 {
const Class6(a) : super(a - 1);
}
+ class Class7 {
+ const Class7();
+ }
''', const [
const ConstantData(
r'"$integer $string $boolean"', 'StringConstant("5 baz false")'),
@@ -522,6 +525,12 @@
const ConstantData('const Class6(1)', 'NonConstant',
expectedErrors: MessageKind.INVALID_ASSERT_VALUE_MESSAGE),
const ConstantData('const Class6(2)', 'ConstructedConstant(Class6())'),
+ const ConstantData('const Class7()', 'ConstructedConstant(Class7())'),
+ const ConstantData('const Class7() == const Class7()', 'NonConstant',
+ expectedErrors: const [
+ MessageKind.INVALID_CONSTANT_BINARY_PRIMITIVE_TYPE,
+ MessageKind.INVALID_CONSTANT_BINARY_PRIMITIVE_TYPE
+ ]),
]),
const TestData('assert', '''
class A {
diff --git a/tests/compiler/dart2js/rti/emission/event_callback.dart b/tests/compiler/dart2js/rti/emission/event_callback.dart
new file mode 100644
index 0000000..a0c84dd
--- /dev/null
+++ b/tests/compiler/dart2js/rti/emission/event_callback.dart
@@ -0,0 +1,31 @@
+// Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'dart:html';
+
+/*kernel.class: global#Event:checkedTypeArgument,checks=[$isEvent],instance,typeArgument*/
+/*strong.class: global#Event:checkedInstance,checkedTypeArgument,checks=[$isEvent],instance,typeArgument*/
+
+/*class: global#MouseEvent:checks=[],instance*/
+/*class: global#KeyboardEvent:checks=[],instance*/
+
+void main() {
+ print('InputElement');
+ var i = new InputElement();
+ print('> onKeyPress');
+ i.onKeyPress.listen(onEvent);
+ print('> onClick');
+ i.onClick.listen(onEvent);
+ print('TextAreaElement');
+ var e = new TextAreaElement();
+ print('> onKeyPress');
+ e.onKeyPress.listen(onEvent);
+ print('> onClick');
+ e.onClick.listen(onEvent);
+ print('Done!');
+}
+
+void onEvent(Event e) {
+ print(e);
+}
diff --git a/tests/compiler/dart2js/rti/rti_emission_test.dart b/tests/compiler/dart2js/rti/rti_emission_test.dart
index 3878ea1..416fabe 100644
--- a/tests/compiler/dart2js/rti/rti_emission_test.dart
+++ b/tests/compiler/dart2js/rti/rti_emission_test.dart
@@ -38,6 +38,8 @@
'map_literal_checked.dart',
// TODO(johnniwinther): Optimize local function type signature need.
'subtype_named_args.dart',
+ // TODO(33690):
+ 'native.dart',
],
);
});
diff --git a/tests/compiler/dart2js/sourcemaps/data/invokes.dart b/tests/compiler/dart2js/sourcemaps/data/invokes.dart
index 53e84d3..a48a4ae 100644
--- a/tests/compiler/dart2js/sourcemaps/data/invokes.dart
+++ b/tests/compiler/dart2js/sourcemaps/data/invokes.dart
@@ -124,7 +124,7 @@
invalidInvokes() {
// ignore: not_enough_required_arguments
C();
- // ignore: undefined_method
+ // ignore: invocation_of_non_function
dynamic();
// ignore: invocation_of_non_function
F();
diff --git a/tests/compiler/dart2js_extra/11673_test.dart b/tests/compiler/dart2js_extra/11673_test.dart
index 1d7e667..47aa416 100644
--- a/tests/compiler/dart2js_extra/11673_test.dart
+++ b/tests/compiler/dart2js_extra/11673_test.dart
@@ -20,7 +20,7 @@
use(x) {
if (x is JSIB) {
// Should be able to find M.foo since I8 is a subtype of both JSIB and M.
- Expect.equals(123, x.foo());
+ Expect.equals(123, (x as dynamic).foo());
}
}
diff --git a/tests/compiler/dart2js_extra/19191_test.dart b/tests/compiler/dart2js_extra/19191_test.dart
index 7e628fd..cf2bd24 100644
--- a/tests/compiler/dart2js_extra/19191_test.dart
+++ b/tests/compiler/dart2js_extra/19191_test.dart
@@ -21,20 +21,12 @@
invocation.positionalArguments, invocation.namedArguments);
}
}
-
- init() {
- closure_fails = (String str) {
- return str.toUpperCase();
- };
- }
-
- run() {
- print(closure_fails("Hello World"));
- }
}
void main() {
- var a = new A();
- a.init();
- a.run();
+ dynamic a = new A();
+ a.closure_fails = (String str) {
+ return str.toUpperCase();
+ };
+ print(a.closure_fails("Hello World"));
}
diff --git a/tests/compiler/dart2js_extra/21166_test.dart b/tests/compiler/dart2js_extra/21166_test.dart
deleted file mode 100644
index b060c1f..0000000
--- a/tests/compiler/dart2js_extra/21166_test.dart
+++ /dev/null
@@ -1,24 +0,0 @@
-// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-// Regression test for http://dartbug.com/21166/
-// Fails when compiling with --checked.
-
-var a = [];
-
-void doStuff() {
- if (a.length) {
- // This triggers a TypeConversion to bool in checked mode.
- var element = a[0]; // This triggers a bounds check but a.length will have
- a.remove(element); // type [empty].
- }
-}
-
-main() {
- a.add(1);
- a.add(2);
- try {
- doStuff(); // This is expected to fail but not crash the compiler.
- } catch (_) {}
-}
diff --git a/tests/compiler/dart2js_extra/21666_test.dart b/tests/compiler/dart2js_extra/21666_test.dart
deleted file mode 100644
index 857b0e3..0000000
--- a/tests/compiler/dart2js_extra/21666_test.dart
+++ /dev/null
@@ -1,90 +0,0 @@
-// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-// Regression test for issue 21666 - problems with method that has super calls.
-//
-// Use a method and getter with super calls in various ways.
-
-import 'package:expect/expect.dart';
-
-@MirrorsUsed(targets: const [A, B, Object])
-import 'dart:mirrors';
-
-class X {
- const X();
-}
-
-class Y {
- const Y();
-}
-
-typedef fInt(int x);
-typedef fString(String x);
-
-class A {
- @X()
- foo(int x) => x + 1;
- int get bar => A.g;
-
- static int g = 0;
-}
-
-class B extends A {
- @Y()
- foo(int x) => 100 * super.foo(x);
- int get bar => 1000 * super.bar;
-}
-
-String dump(ClassMirror cm) {
- var sb = new StringBuffer();
- sb.write('$cm\n');
- for (var mm in cm.declarations.values) {
- sb.write(' $mm\n');
- // Walking declaration metadata triggers issue 21666.
- for (var a in mm.metadata) {
- sb.write(' $a\n');
- }
- }
- print(sb);
- return '$sb';
-}
-
-main() {
- var cmB = reflectClass(B);
- var cmBdump = dump(cmB);
- var cmAdump = dump(cmB.superclass);
-
- Expect.equals(dump(reflectClass(A)), cmAdump);
- Expect.isTrue(cmAdump.contains("'foo'"));
- Expect.isTrue(cmAdump.contains("'bar'"));
- Expect.isTrue(cmBdump.contains("'foo'"));
- Expect.isTrue(cmBdump.contains("'bar'"));
-
- A.g = 123;
- var a = new A();
- var am = reflect(a);
- var agfoo = am.getField(#foo);
- var agbar = am.getField(#bar);
-
- Expect.equals(3, agfoo.reflectee(2));
- Expect.equals(4, am.invoke(#foo, [3]).reflectee);
- Expect.equals(123, agbar.reflectee);
- Expect.isTrue(a.foo is fInt);
- Expect.isTrue(a.foo is! fString);
- Expect.isTrue(agfoo.reflectee is fInt);
- Expect.isTrue(agfoo.reflectee is! fString);
-
- var b = new B();
- var bm = reflect(b);
- var bgfoo = bm.getField(#foo);
- var bgbar = bm.getField(#bar);
-
- Expect.equals(300, bgfoo.reflectee(2));
- Expect.equals(400, bm.invoke(#foo, [3]).reflectee);
- Expect.equals(123000, bgbar.reflectee);
- Expect.isTrue(b.foo is fInt);
- Expect.isTrue(b.foo is! fString);
- Expect.isTrue(bgfoo.reflectee is fInt);
- Expect.isTrue(bgfoo.reflectee is! fString);
-}
diff --git a/tests/compiler/dart2js_extra/21724_test.dart b/tests/compiler/dart2js_extra/21724_test.dart
deleted file mode 100644
index eff9690..0000000
--- a/tests/compiler/dart2js_extra/21724_test.dart
+++ /dev/null
@@ -1,12 +0,0 @@
-// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-// Regression test for issue 21724 - invalid call to local closure
-
-main() {
- foo(x) {}
- try {
- foo();
- } catch (_) {}
-}
diff --git a/tests/compiler/dart2js_extra/23056_test.dart b/tests/compiler/dart2js_extra/23056_test.dart
deleted file mode 100644
index a30e4ee..0000000
--- a/tests/compiler/dart2js_extra/23056_test.dart
+++ /dev/null
@@ -1,30 +0,0 @@
-// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-// Regression test for http://dartbug.com/23056/
-// Ensure that Mixin prototypes are initialized before first use.
-
-// Mirrors is the only way to have a getter be equipped with metadata.
-@MirrorsUsed(targets: 'M', override: '*')
-import 'dart:mirrors';
-
-import 'package:expect/expect.dart';
-
-class M {
- @NoInline()
- bool get foo => true;
-}
-
-class A extends Object with M {
- @NoInline()
- bool get foo => super.foo;
-}
-
-@AssumeDynamic()
-@NoInline()
-bool hide(bool x) => x;
-
-main() {
- Expect.isTrue((hide(true) ? new A() : new M()).foo);
-}
diff --git a/tests/compiler/dart2js_extra/23432_test.dart b/tests/compiler/dart2js_extra/23432_test.dart
index b0fc3d9..2333edb 100644
--- a/tests/compiler/dart2js_extra/23432_test.dart
+++ b/tests/compiler/dart2js_extra/23432_test.dart
@@ -20,7 +20,7 @@
get NEVER => false;
main() {
- var c = 12345;
+ dynamic c = 12345;
if (NEVER) c = new N();
var e;
try {
diff --git a/tests/compiler/dart2js_extra/23804_test.dart b/tests/compiler/dart2js_extra/23804_test.dart
index 2fad1d5..fbcf965 100644
--- a/tests/compiler/dart2js_extra/23804_test.dart
+++ b/tests/compiler/dart2js_extra/23804_test.dart
@@ -9,7 +9,7 @@
import 'package:expect/expect.dart';
test(n) => n == 1;
-run(f) => f(1);
+bool run(f(dynamic)) => f(1);
main() {
Expect.equals([test].any(run), true);
}
diff --git a/tests/compiler/dart2js_extra/27199_test.dart b/tests/compiler/dart2js_extra/27199_test.dart
index 485bf3a..2c477fd 100644
--- a/tests/compiler/dart2js_extra/27199_test.dart
+++ b/tests/compiler/dart2js_extra/27199_test.dart
@@ -21,8 +21,8 @@
confuse(x) => x;
main() {
- var c = new C();
- var a = 12;
+ dynamic c = new C();
+ dynamic a = 12;
if (confuse(true)) a = {};
c.f = a;
}
diff --git a/tests/compiler/dart2js_extra/28749_test.dart b/tests/compiler/dart2js_extra/28749_test.dart
index b75dd27..ca4d3bf 100644
--- a/tests/compiler/dart2js_extra/28749_test.dart
+++ b/tests/compiler/dart2js_extra/28749_test.dart
@@ -2,6 +2,8 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
+// dart2jsOptions=--strong
+
// Regression test for http://dartbug.com/28749.
//
// This would crash at compile time because inner typedefs remain after calling
@@ -47,11 +49,11 @@
);
Expect.equals(
- 'Wrap<(int) => ((dynamic) => void) => (dynamic) => void>',
+ 'Wrap<(int) => ((int) => void) => (int) => void>',
'${foo<int>(0)}',
);
Expect.equals(
- 'Wrap<(int) => ((dynamic) => void) => (dynamic) => void>',
+ 'Wrap<(int) => ((String) => void) => (String) => void>',
'${foo<String>(1)}',
);
}
diff --git a/tests/compiler/dart2js_extra/assert_with_message_test.dart b/tests/compiler/dart2js_extra/assert_with_message_test.dart
index 9d2fa14..e860713 100644
--- a/tests/compiler/dart2js_extra/assert_with_message_test.dart
+++ b/tests/compiler/dart2js_extra/assert_with_message_test.dart
@@ -26,23 +26,11 @@
}
test2() {
- testFalse('constant function', () {
- assert(() => false, 'Mumble');
- });
-}
-
-test3() {
testFalse('variable false', () {
assert(confuse(false), 'Mumble');
});
}
-test4() {
- testFalse('variable function', () {
- assert(confuse(() => false), 'Mumble');
- });
-}
-
testTypeErrors() {
check(name, fault) {
try {
@@ -101,19 +89,17 @@
Expect.fail('Expected assert to throw');
}
-bool get checkedMode {
+bool get assertionsEnabled {
bool b = false;
assert((b = true));
return b;
}
main() {
- if (!checkedMode) return;
+ if (!assertionsEnabled) return;
test1();
test2();
- test3();
- test4();
testTypeErrors();
testMessageEffect1();
testMessageEffect2();
diff --git a/tests/compiler/dart2js_extra/async_stacktrace_test.dart b/tests/compiler/dart2js_extra/async_stacktrace_test.dart
index 687222f..947e2d6 100644
--- a/tests/compiler/dart2js_extra/async_stacktrace_test.dart
+++ b/tests/compiler/dart2js_extra/async_stacktrace_test.dart
@@ -26,7 +26,7 @@
}
}
-test1(Tracer tracer) {
+Future test1(Tracer tracer) {
foo() async*
/// asyncStar: ok
@@ -56,7 +56,7 @@
;
}
-test2(Tracer tracer) {
+Future test2(Tracer tracer) {
var savedStackTrace;
foo() async*
@@ -83,7 +83,7 @@
});
}
-test3(Tracer tracer) {
+Future test3(Tracer tracer) {
var savedStackTrace;
foo() async*
diff --git a/tests/compiler/dart2js_extra/basic_class_test.dart b/tests/compiler/dart2js_extra/basic_class_test.dart
deleted file mode 100644
index bd6804a..0000000
--- a/tests/compiler/dart2js_extra/basic_class_test.dart
+++ /dev/null
@@ -1,24 +0,0 @@
-// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-class A {}
-
-class SubA extends A {}
-
-class B {}
-
-void main() {
- A a;
- SubA subA;
- B b;
- a = a;
- a = subA;
- a = b; //# 01: static type warning
- subA = a;
- subA = subA;
- subA = b; //# 02: static type warning
- b = a; //# 03: static type warning
- b = subA; //# 04: static type warning
- b = b;
-}
diff --git a/tests/compiler/dart2js_extra/checked_accessor_test.dart b/tests/compiler/dart2js_extra/checked_accessor_test.dart
deleted file mode 100644
index b67f17a..0000000
--- a/tests/compiler/dart2js_extra/checked_accessor_test.dart
+++ /dev/null
@@ -1,25 +0,0 @@
-// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-import "package:expect/expect.dart";
-
-class E {
- missingType field;
-}
-
-class WithGetter {
- String field;
-}
-
-void main() {
- f(x) {
- x.field = true;
- }
-
- Expect.throws(() {
- [new E(), new WithGetter()].forEach(f);
- new missingType();
- new E().field = 'a string';
- });
-}
diff --git a/tests/compiler/dart2js_extra/closure_type_reflection2_test.dart b/tests/compiler/dart2js_extra/closure_type_reflection2_test.dart
deleted file mode 100644
index 398dab5..0000000
--- a/tests/compiler/dart2js_extra/closure_type_reflection2_test.dart
+++ /dev/null
@@ -1,22 +0,0 @@
-// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-// Test that classes referenced from a signature of a tear-off closure
-// are emitted.
-
-@MirrorsUsed(targets: 'C')
-import 'dart:mirrors';
-
-import 'package:expect/expect.dart';
-
-class A {}
-
-class C {
- A foo() {}
-}
-
-main() {
- Expect.isFalse(
- reflect(new C().foo).function.returnType.toString().contains('dynamic'));
-}
diff --git a/tests/compiler/dart2js_extra/closure_type_reflection_test.dart b/tests/compiler/dart2js_extra/closure_type_reflection_test.dart
deleted file mode 100644
index 8acb4c0..0000000
--- a/tests/compiler/dart2js_extra/closure_type_reflection_test.dart
+++ /dev/null
@@ -1,22 +0,0 @@
-// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-// Test that classes referenced from a signature of a tear-off closure
-// are emitted.
-
-@MirrorsUsed(targets: 'C', symbols: 'A')
-import 'dart:mirrors';
-
-import 'package:expect/expect.dart';
-
-class A {}
-
-class C {
- A foo() {}
-}
-
-main() {
- Expect.equals("ClassMirror on 'A'",
- reflect(new C().foo).function.returnType.toString());
-}
diff --git a/tests/compiler/dart2js_extra/consistent_add_error_test.dart b/tests/compiler/dart2js_extra/consistent_add_error_test.dart
index 0796085..79f18f9 100644
--- a/tests/compiler/dart2js_extra/consistent_add_error_test.dart
+++ b/tests/compiler/dart2js_extra/consistent_add_error_test.dart
@@ -126,21 +126,8 @@
return (confuse(1) as int) + confuse('a');
}
- static f5() {
- return (confuse(1) as int) + 'a';
- }
-
- static f6() {
- var a = confuse(true) ? 1 : 2; // Small int with unknown value.
- return a + 'a';
- }
-
- static f7() {
- return 1 + 'a';
- }
-
static test() {
- check('IntPlusString', f1, f2, f3, f4, f5, f6, f7);
+ check('IntPlusString', f1, f2, f3, f4);
}
}
@@ -158,25 +145,12 @@
}
static f4() {
- return (confuse('a') as String) + 1;
- }
-
- static f5() {
var a = confuse(true) ? 'a' : 'bc';
return a + confuse(1);
}
- static f6() {
- var a = confuse(true) ? 'a' : 'bc';
- return a + 1;
- }
-
- static f7() {
- return 'a' + 1;
- }
-
static test() {
- check('StringPlusInt', f1, f2, f3, f4, f5, f6, f7);
+ check('StringPlusInt', f1, f2, f3, f4);
}
}
diff --git a/tests/compiler/dart2js_extra/consistent_codeUnitAt_error_test.dart b/tests/compiler/dart2js_extra/consistent_codeUnitAt_error_test.dart
index 0787ab3..d76bd71 100644
--- a/tests/compiler/dart2js_extra/consistent_codeUnitAt_error_test.dart
+++ b/tests/compiler/dart2js_extra/consistent_codeUnitAt_error_test.dart
@@ -116,7 +116,7 @@
static f3() {
var a = confuse(true) ? 'AB' : 'ABCDE'; // String with unknown length.
- return a.codeUnitAt('a');
+ return a.codeUnitAt(('a' as dynamic));
}
static test() {
diff --git a/tests/compiler/dart2js_extra/consistent_subtract_error_test.dart b/tests/compiler/dart2js_extra/consistent_subtract_error_test.dart
index ed39691..2c839f7 100644
--- a/tests/compiler/dart2js_extra/consistent_subtract_error_test.dart
+++ b/tests/compiler/dart2js_extra/consistent_subtract_error_test.dart
@@ -2,6 +2,8 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
+/// dart2jsOptions=--omit-implicit-checks
+
import "package:expect/expect.dart";
// Test that optimized '-' and slow path '-' produce the same error.
@@ -90,21 +92,8 @@
return (confuse(1) as int) - confuse('a');
}
- static f5() {
- return (confuse(1) as int) - 'a';
- }
-
- static f6() {
- var a = confuse(true) ? 1 : 2; // Small int with unknown value.
- return a - 'a';
- }
-
- static f7() {
- return 1 - 'a';
- }
-
static test() {
- check('IntMinusString', f1, f2, f3, f4, f5, f6, f7);
+ check('IntMinusString', f1, f2, f3, f4);
}
}
diff --git a/tests/compiler/dart2js_extra/dart2js_extra.status b/tests/compiler/dart2js_extra/dart2js_extra.status
index 0328d9e..9887001 100644
--- a/tests/compiler/dart2js_extra/dart2js_extra.status
+++ b/tests/compiler/dart2js_extra/dart2js_extra.status
@@ -8,8 +8,6 @@
class_test: Fail
constant_javascript_semantics4_test: Fail, OK
generic_class_is_test: Fail # Issue 32004
-mirror_printer_test: Pass, Slow # Issue 25940, 16473
-mirrors_used_closure_test: Fail # Issue 17939
no_such_method_test: Fail # Wrong Invocation.memberName.
statements_test: Fail
typed_locals_test: Pass, Fail
@@ -40,9 +38,6 @@
[ $compiler == dart2js && $runtime == chrome && $csp ]
deferred/load_in_correct_order_test: SkipByDesign # Purposely uses `eval`
-[ $compiler == dart2js && $runtime == chromeOnAndroid ]
-no_such_method_mirrors_test: Pass, Slow # TODO(kasperl): Please triage.
-
[ $compiler == dart2js && $runtime == d8 && $fasta ]
deferred_fail_and_retry_test: RuntimeError # Uses XHR in dart:html
deferred_with_csp_nonce_test: RuntimeError # Uses dart:html
@@ -54,21 +49,10 @@
[ $compiler == dart2js && $runtime == none ]
*: Fail, Pass # TODO(ahe): Triage these tests.
-[ $compiler == dart2js && $checked ]
-variable_type_test/01: Fail, OK
-variable_type_test/03: Fail, OK
-
[ $compiler == dart2js && $checked && $fasta ]
-deferred/deferred_mirrors1_test: Crash # Unsupported operation: KernelDeferredLoadTask.addMirrorElementsForLibrary
-deferred/deferred_mirrors2_test: Crash # Unsupported operation: KernelDeferredLoadTask.addMirrorElementsForLibrary
-deferred/reflect_multiple_annotations_test: Crash # Unsupported operation: KernelDeferredLoadTask.addMirrorElementsForLibrary
-deferred/reflect_multiple_default_arg_test: Crash # Unsupported operation: KernelDeferredLoadTask.addMirrorElementsForLibrary
dummy_compiler_test: Crash
local_signature_test: Crash
minus_zero_test/01: MissingCompileTimeError
-mirrors_used_warning2_test: Crash
-mirrors_used_warning_test/minif: Crash
-mirrors_used_warning_test/none: Crash
[ $compiler == dart2js && $csp ]
deferred_custom_loader_test: SkipByDesign # Issue 25683
@@ -76,94 +60,18 @@
js_interop_optional_arg_test: RuntimeError # Issue 31082
js_interop_test: RuntimeError # Issue 31082
-[ $compiler == dart2js && $fast_startup ]
-21666_test: Fail # mirrors not supported
-23056_test: Fail # mirrors not supported
-closure_type_reflection2_test: Fail # mirrors not supported
-closure_type_reflection_test: Fail # mirrors not supported
-deferred/deferred_mirrors1_lib: Fail # mirrors not supported
-deferred/deferred_mirrors1_test: Fail # mirrors not supported
-deferred/deferred_mirrors2_lazy: Fail # mirrors not supported
-deferred/deferred_mirrors2_lib3: Fail # mirrors not supported
-deferred/deferred_mirrors2_test: Fail # mirrors not supported
-deferred/reflect_multiple_annotations_test: CompileTimeError # mirrors not supported
-deferred/reflect_multiple_default_arg_test: CompileTimeError # mirrors not supported
-inference_nsm_mirrors_test: Fail # mirrors not supported
-invalid_annotation2_test/01: Pass # mirrors not supported, passes for the wrong reason
-invalid_annotation2_test/none: Fail # mirrors not supported
-mirror_enqueuer_regression_test: Fail # mirrors not supported
-mirror_invalid_field_access2_test: Fail # mirrors not supported
-mirror_invalid_field_access3_test: Fail # mirrors not supported
-mirror_invalid_field_access4_test: Fail # mirrors not supported
-mirror_invalid_field_access_test: Fail # mirrors not supported
-mirror_invalid_invoke2_test: Fail # mirrors not supported
-mirror_invalid_invoke3_test: Fail # mirrors not supported
-mirror_invalid_invoke_test: Fail # mirrors not supported
-mirror_printer_test: Fail # mirrors not supported
-mirror_test: Fail # mirrors not supported
-mirror_type_inference_field2_test: Fail # mirrors not supported
-mirror_type_inference_field_test: Fail # mirrors not supported
-mirror_type_inference_function_test: Fail # mirrors not supported
-mirrors_declarations_filtering_test: Fail # mirrors not supported
-mirrors_used_closure_test: SkipByDesign
-mirrors_used_metatargets_test: Fail # mirrors not supported
-mirrors_used_native_test: Fail # mirrors not supported
-mirrors_used_warning2_test: Fail # mirrors not supported
-mirrors_used_warning_test: Fail # mirrors not supported
-no_such_method_mirrors_test: Fail # mirrors not supported
-reflect_native_types_test: Fail # mirrors not supported
-
-[ $compiler == dart2js && $fast_startup && $fasta ]
-23056_test: Pass
-deferred/deferred_mirrors1_test: Crash # Unsupported operation: KernelDeferredLoadTask.addMirrorElementsForLibrary
-deferred/deferred_mirrors2_test: Crash # Unsupported operation: KernelDeferredLoadTask.addMirrorElementsForLibrary
-deferred/reflect_multiple_annotations_test: Crash # Unsupported operation: KernelDeferredLoadTask.addMirrorElementsForLibrary
-deferred/reflect_multiple_default_arg_test: Crash # Unsupported operation: KernelDeferredLoadTask.addMirrorElementsForLibrary
-mirror_enqueuer_regression_test: Pass
-
[ $compiler == dart2js && $fasta ]
-21666_test: RuntimeError
23264_test: RuntimeError
closure_capture2_test: RuntimeError
-closure_type_reflection2_test: RuntimeError
-closure_type_reflection_test: RuntimeError
constant_javascript_semantics_test/03: CompileTimeError
constant_javascript_semantics_test/04: CompileTimeError
constant_javascript_semantics_test/none: CompileTimeError
-deferred/deferred_mirrors1_test: SkipByDesign
-deferred/deferred_mirrors2_test: RuntimeError
-deferred/reflect_multiple_annotations_test: RuntimeError
-deferred/reflect_multiple_default_arg_test: RuntimeError
-inference_nsm_mirrors_test: SkipByDesign
-invalid_annotation2_test/none: RuntimeError
-mirror_invalid_field_access2_test: RuntimeError
-mirror_invalid_field_access3_test: RuntimeError
-mirror_invalid_field_access4_test: RuntimeError
-mirror_invalid_field_access_test: RuntimeError
-mirror_invalid_invoke2_test: RuntimeError
-mirror_invalid_invoke3_test: RuntimeError
-mirror_invalid_invoke_test: RuntimeError
-mirror_printer_test/01: RuntimeError
-mirror_printer_test/none: RuntimeError
-mirror_test: RuntimeError
-mirror_type_inference_field2_test: RuntimeError
-mirror_type_inference_field_test: RuntimeError
-mirror_type_inference_function_test: RuntimeError
-mirrors_declarations_filtering_test: RuntimeError
-mirrors_used_closure_test: SkipByDesign
-mirrors_used_metatargets_test: RuntimeError
-mirrors_used_native_test: RuntimeError
-mirrors_used_warning2_test: RuntimeError
-mirrors_used_warning_test/minif: RuntimeError
-mirrors_used_warning_test/none: RuntimeError
-no_such_method_mirrors_test: SkipByDesign
private_symbol_literal_test/01: MissingCompileTimeError
private_symbol_literal_test/02: MissingCompileTimeError
private_symbol_literal_test/03: MissingCompileTimeError
private_symbol_literal_test/04: MissingCompileTimeError
private_symbol_literal_test/05: MissingCompileTimeError
private_symbol_literal_test/06: MissingCompileTimeError
-reflect_native_types_test: RuntimeError
regress/4562_test/none: CompileTimeError
round_constant_folding_test: CompileTimeError
type_constant_switch_test/01: MissingCompileTimeError
@@ -186,6 +94,7 @@
code_motion_exception_test: Skip # Requires unminified operator names.
deferred/reflect_multiple_annotations_test: Fail
deferred/reflect_multiple_default_arg_test: Fail
+generic_method_dynamic_type_test: Fail, OK # Tests expected output of Type.toString().
mirrors_used_warning_test/minif: Fail, OK # Tests warning that minified code will be broken.
runtime_type_test: Fail, OK # Tests extected output of Type.toString().
to_string_test: Fail # Issue 7179.
@@ -198,7 +107,10 @@
generic_method_dynamic_is_test: RuntimeError # Test against function type variables is only supported in strong mode.
generic_method_dynamic_type_test: SkipByDesign # Requires strong mode support for function type variables.
generic_method_static_is_test: RuntimeError # Test against function type variables is only supported in strong mode.
+int_index_test/01: MissingCompileTimeError
+int_index_test/02: MissingCompileTimeError
local_signature_test: RuntimeError # Test against function type variables is only supported in strong mode.
+switch_test/00: MissingCompileTimeError
[ $compiler == dart2js && ($runtime == chrome || $runtime == chromeOnAndroid || $runtime == drt || $runtime == ff || $runtime == safari) ]
isolate2_test/01: Fail # Issue 14458.
diff --git a/tests/compiler/dart2js_extra/deferred/deferred_class_test.dart b/tests/compiler/dart2js_extra/deferred/deferred_class_test.dart
index 22ab8ba..eb6c836 100644
--- a/tests/compiler/dart2js_extra/deferred/deferred_class_test.dart
+++ b/tests/compiler/dart2js_extra/deferred/deferred_class_test.dart
@@ -9,7 +9,7 @@
import 'deferred_class_library.dart' deferred as lib;
-isError(e) => e is Error;
+bool isError(e) => e is Error;
main() {
var x;
diff --git a/tests/compiler/dart2js_extra/deferred/deferred_function_test.dart b/tests/compiler/dart2js_extra/deferred/deferred_function_test.dart
index 27d780a..88fcbaf 100644
--- a/tests/compiler/dart2js_extra/deferred/deferred_function_test.dart
+++ b/tests/compiler/dart2js_extra/deferred/deferred_function_test.dart
@@ -10,7 +10,7 @@
import 'deferred_function_library.dart' deferred as lib;
-isError(e) => e is Error;
+bool isError(e) => e is Error;
readFoo() {
return lib.foo;
diff --git a/tests/compiler/dart2js_extra/deferred/deferred_mirrors1_lib.dart b/tests/compiler/dart2js_extra/deferred/deferred_mirrors1_lib.dart
deleted file mode 100644
index 92b9ede..0000000
--- a/tests/compiler/dart2js_extra/deferred/deferred_mirrors1_lib.dart
+++ /dev/null
@@ -1,11 +0,0 @@
-// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-import 'dart:typed_data';
-import 'dart:mirrors';
-
-foo() {
- var m = reflect(499);
- return m.reflectee;
-}
diff --git a/tests/compiler/dart2js_extra/deferred/deferred_mirrors1_test.dart b/tests/compiler/dart2js_extra/deferred/deferred_mirrors1_test.dart
deleted file mode 100644
index 10ed593..0000000
--- a/tests/compiler/dart2js_extra/deferred/deferred_mirrors1_test.dart
+++ /dev/null
@@ -1,28 +0,0 @@
-// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-import 'package:async_helper/async_helper.dart';
-import 'package:expect/expect.dart';
-
-@MirrorsUsed(override: '*')
-import 'dart:mirrors';
-
-import 'deferred_mirrors1_lib.dart' deferred as lazy;
-
-main() {
- asyncStart();
-
- // The deferred library uses mirrors and has an unused import of typed_data.
- // Dart2js must not crash on this test.
- //
- // Dart2js used to crash because:
- // - the NativeInt8List was dragged in.
- // - but not its constructors and the constructors' dependencies.
- // - one of the dependencies (a local function "_ensureNativeList") was
- // not handled by the deferred-loader.
- lazy.loadLibrary().then((_) {
- Expect.equals(499, lazy.foo());
- asyncEnd();
- });
-}
diff --git a/tests/compiler/dart2js_extra/deferred/deferred_mirrors2_lazy.dart b/tests/compiler/dart2js_extra/deferred/deferred_mirrors2_lazy.dart
deleted file mode 100644
index 9bfdee8..0000000
--- a/tests/compiler/dart2js_extra/deferred/deferred_mirrors2_lazy.dart
+++ /dev/null
@@ -1,14 +0,0 @@
-// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-library lazy;
-
-import 'deferred_mirrors2_lib3.dart';
-
-@MirrorsUsed(metaTargets: const [Reflectable], override: 'lazy')
-import 'dart:mirrors';
-
-class Reflectable {
- const Reflectable();
-}
diff --git a/tests/compiler/dart2js_extra/deferred/deferred_mirrors2_lib3.dart b/tests/compiler/dart2js_extra/deferred/deferred_mirrors2_lib3.dart
deleted file mode 100644
index abbd6d0..0000000
--- a/tests/compiler/dart2js_extra/deferred/deferred_mirrors2_lib3.dart
+++ /dev/null
@@ -1,19 +0,0 @@
-// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-library lib3;
-
-import 'deferred_mirrors2_lib4.dart';
-
-@MirrorsUsed(targets: const ['lib3'])
-import 'dart:mirrors';
-
-class R {
- void bind(Type type) {
- ClassMirror classMirror = _reflectClass(type);
- MethodMirror ctor = classMirror.declarations[classMirror.simpleName];
- int length = ctor.parameters.length;
- Function create = classMirror.newInstance;
- }
-}
diff --git a/tests/compiler/dart2js_extra/deferred/deferred_mirrors2_test.dart b/tests/compiler/dart2js_extra/deferred/deferred_mirrors2_test.dart
deleted file mode 100644
index 195c826..0000000
--- a/tests/compiler/dart2js_extra/deferred/deferred_mirrors2_test.dart
+++ /dev/null
@@ -1,21 +0,0 @@
-// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-import 'package:async_helper/async_helper.dart';
-import 'package:expect/expect.dart';
-
-@MirrorsUsed(override: '*')
-import 'dart:mirrors';
-
-import 'deferred_mirrors2_lib2.dart';
-
-foo() {
- ClassMirror classMirror = reflectType(int);
- Expect.isTrue(classMirror.isTopLevel);
-}
-
-// This is a minimal test extracted from a bug-report we got.
-main() {
- foo();
-}
diff --git a/tests/compiler/dart2js_extra/deferred/multiple_default_arg_test.dart b/tests/compiler/dart2js_extra/deferred/multiple_default_arg_test.dart
index 8d60600..37681b9 100644
--- a/tests/compiler/dart2js_extra/deferred/multiple_default_arg_test.dart
+++ b/tests/compiler/dart2js_extra/deferred/multiple_default_arg_test.dart
@@ -7,12 +7,8 @@
/// fragments is kept separate, but that when they are loaded (and the metadata
/// array is merged) all accesses to the metadata array is done correctly.
///
-/// This kind of metadata is generated either when using Function.apply (to
-/// store default values and parameter names) or when using dart:mirrors
-/// (annotations and unmangled names also need to be stored).
-///
-/// This test covers uses of default values and parameter names via
-/// Function.apply.
+/// This kind of metadata is generated when using Function.apply to
+/// store default values and parameter names.
import 'multiple_default_arg_lib1.dart' deferred as lib1;
import 'multiple_default_arg_lib2.dart' deferred as lib2;
import 'multiple_default_arg_lib3.dart' deferred as lib3;
@@ -35,8 +31,8 @@
await lib3.loadLibrary();
Expect.equals(
- Function
- .apply(lib3.myFunction3, ["x", "y"], {#argumentName4: () => "C"}),
+ Function.apply(
+ lib3.myFunction3, ["x", "y"], {#argumentName4: () => "C"}),
"x y 3b - C");
Expect.equals(
@@ -48,8 +44,8 @@
lib3.myFunction4, ["x", "y"], {#argumentName5: new lib3.X(4)}),
4);
Expect.equals(
- Function
- .apply(lib3.myFunction4, ["x", "y"], {#argumentName5: lib3.value3}),
+ Function.apply(
+ lib3.myFunction4, ["x", "y"], {#argumentName5: lib3.value3}),
3);
});
}
diff --git a/tests/compiler/dart2js_extra/deferred/reflect_multiple_annotations_test.dart b/tests/compiler/dart2js_extra/deferred/reflect_multiple_annotations_test.dart
deleted file mode 100644
index 8a832d5..0000000
--- a/tests/compiler/dart2js_extra/deferred/reflect_multiple_annotations_test.dart
+++ /dev/null
@@ -1,81 +0,0 @@
-// Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-/// This test is indirectly testing invariants of the generated code of dart2js.
-/// It ensures that indices to metadata information from **multiple** deferred
-/// fragments is kept separate, but that when they are loaded (and the metadata
-/// array is merged) all accesses to the metadata array is done correctly.
-///
-/// This kind of metadata is generated either when using Function.apply (to
-/// store default values and parameter names) or when using dart:mirrors
-/// (annotations and unmangled names also need to be stored).
-///
-/// This test file covers uses of annotations through dart:mirrors.
-@MirrorsUsed(override: '*')
-import 'dart:mirrors';
-import 'reflect_multiple_annotations_lib1.dart' deferred as lib1;
-import 'reflect_multiple_annotations_lib2.dart' deferred as lib2;
-import 'package:expect/expect.dart';
-import 'package:async_helper/async_helper.dart';
-
-main() {
- asyncTest(() async {
- await lib1.loadLibrary();
- await lib2.loadLibrary();
-
- MethodMirror m1 =
- findTopLevel('multiple_annotations_lib1.dart', #myFunction1);
- Expect.equals(m1.metadata.length, 2);
-
- Expect.equals(m1.parameters.length, 1);
- Expect.equals(m1.parameters[0].simpleName, #f1);
- Expect.isFalse(m1.parameters[0].hasDefaultValue);
- Expect.equals(m1.parameters[0].metadata.length, 1);
-
- // Note: currently m1.metadata[*].reflectee is null, even though this works
- // when not using deferred libraries.
- // TODO(sigmund): fix if we do not move forward with Issue #30538.
- //Expect.isTrue(lib1.MetaA.isCheck(m1.metadata[0].reflectee));
- //Expect.isTrue(lib1.MetaA.isCheck(m1.metadata[1].reflectee));
- //Expect.equals(m1.metadata[0].reflectee.value, "one");
- //Expect.equals(m1.metadata[1].reflectee.value, lib1.topLevelF);
- //Expect.isTrue(lib1.MetaA.isCheck(m1.parameters[0].metadata[0].reflectee));
- //Expect.equals(m1.parameters[0].metadata[0].reflectee.value, "param");
-
- LibraryMirror l2 = findLibrary('multiple_annotations_lib2.dart');
- Expect.equals(l2.metadata.length, 1);
- print(l2.metadata[0].reflectee);
- Expect.equals(l2.metadata[0].reflectee.value, "lib");
-
- ClassMirror c2 = findClass('multiple_annotations_lib2.dart', #A);
- Expect.equals(c2.simpleName, #A);
- Expect.equals(c2.metadata.length, 1);
- print(c2.metadata[0].reflectee);
- Expect.equals(c2.metadata[0].reflectee.value, "class");
- });
-}
-
-MethodMirror findTopLevel(String uriSuffix, Symbol name) {
- MethodMirror method;
- currentMirrorSystem().libraries.forEach((uri, lib) {
- if (uri.path.endsWith(uriSuffix)) method = lib.declarations[name];
- });
- return method;
-}
-
-ClassMirror findClass(String uriSuffix, Symbol name) {
- ClassMirror cls;
- currentMirrorSystem().libraries.forEach((uri, lib) {
- if (uri.path.endsWith(uriSuffix)) cls = lib.declarations[name];
- });
- return cls;
-}
-
-LibraryMirror findLibrary(String uriSuffix) {
- LibraryMirror lib;
- currentMirrorSystem().libraries.forEach((uri, l) {
- if (uri.path.endsWith(uriSuffix)) lib = l;
- });
- return lib;
-}
diff --git a/tests/compiler/dart2js_extra/deferred/reflect_multiple_default_arg_test.dart b/tests/compiler/dart2js_extra/deferred/reflect_multiple_default_arg_test.dart
deleted file mode 100644
index d82a02b..0000000
--- a/tests/compiler/dart2js_extra/deferred/reflect_multiple_default_arg_test.dart
+++ /dev/null
@@ -1,54 +0,0 @@
-// Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-/// This test is indirectly testing invariants of the generated code of dart2js.
-/// It ensures that indices to metadata information from **multiple** deferred
-/// fragments is kept separate, but that when they are loaded (and the metadata
-/// array is merged) all accesses to the metadata array is done correctly.
-///
-/// This kind of metadata is generated either when using Function.apply (to
-/// store default values and parameter names) or when using dart:mirrors
-/// (annotations and unmangled names also need to be stored).
-///
-/// This test file covers uses of parameter names and default values through
-/// dart:mirrors.
-@MirrorsUsed(override: '*')
-import 'dart:mirrors';
-import 'reflect_multiple_default_arg_lib1.dart' deferred as lib1;
-import 'reflect_multiple_default_arg_lib2.dart' deferred as lib2;
-import 'package:expect/expect.dart';
-import 'package:async_helper/async_helper.dart';
-
-main() {
- asyncTest(() async {
- await lib1.loadLibrary();
- await lib2.loadLibrary();
-
- Expect.equals(Function.apply(lib1.myFunction1, []), 1);
- Expect.equals(Function.apply(lib2.myFunction2, []), 2);
-
- MethodMirror m1 =
- findTopLevel('multiple_default_arg_lib1.dart', #myFunction1);
- Expect.equals(m1.parameters.length, 1);
- Expect.equals(m1.parameters[0].simpleName, #argumentName1);
- Expect.isTrue(m1.parameters[0].hasDefaultValue);
- Expect.equals((m1.parameters[0].defaultValue.reflectee)(), 1);
-
- MethodMirror m2 =
- findTopLevel('multiple_default_arg_lib2.dart', #myFunction2);
- Expect.equals(m2.parameters.length, 1);
- Expect.equals(m2.parameters[0].simpleName, #argumentName2);
- Expect.isTrue(m2.parameters[0].hasDefaultValue);
- Expect.equals((m2.parameters[0].defaultValue.reflectee)(), 2);
- });
-}
-
-MethodMirror findTopLevel(String uriSuffix, Symbol name) {
- MethodMirror method;
- currentMirrorSystem().libraries.forEach((uri, lib) {
- if (uri.path.endsWith(uriSuffix)) method = lib.declarations[name];
- });
- print(method);
- return method;
-}
diff --git a/tests/compiler/dart2js_extra/equals_test.dart b/tests/compiler/dart2js_extra/equals_test.dart
index 55cbc75..c4a5309 100644
--- a/tests/compiler/dart2js_extra/equals_test.dart
+++ b/tests/compiler/dart2js_extra/equals_test.dart
@@ -9,7 +9,7 @@
} else {
throw "x != x with x == 3";
}
- var y = x;
+ dynamic y = x;
if (true) {
y = 10;
}
diff --git a/tests/compiler/dart2js_extra/expression_loop_call_test.dart b/tests/compiler/dart2js_extra/expression_loop_call_test.dart
deleted file mode 100644
index 2c33b97..0000000
--- a/tests/compiler/dart2js_extra/expression_loop_call_test.dart
+++ /dev/null
@@ -1,20 +0,0 @@
-// Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-/// Regression test for [ClosureCallSiteTypeInformation] in loops.
-
-class Class<T> {
- method() {
- for (var a in []) {
- (T)(); //# 01: ok
- (Object)(); //# 02: ok
- (this)(); //# 03: ok
- (1)(); //# 04: ok
- }
- }
-}
-
-main() {
- new Class().method();
-}
diff --git a/tests/compiler/dart2js_extra/for_in_test.dart b/tests/compiler/dart2js_extra/for_in_test.dart
index 46093d8..8f0eb15 100644
--- a/tests/compiler/dart2js_extra/for_in_test.dart
+++ b/tests/compiler/dart2js_extra/for_in_test.dart
@@ -29,8 +29,8 @@
class MyIterable<T> extends IterableBase<T> {
final List<T> values;
MyIterable(List<T> values) : this.values = values;
- Iterator get iterator {
- return new MyListIterator(values);
+ Iterator<T> get iterator {
+ return new MyListIterator<T>(values);
}
}
diff --git a/tests/compiler/dart2js_extra/if_null_test.dart b/tests/compiler/dart2js_extra/if_null_test.dart
index 2b25f43..ed3f23a5 100644
--- a/tests/compiler/dart2js_extra/if_null_test.dart
+++ b/tests/compiler/dart2js_extra/if_null_test.dart
@@ -9,12 +9,12 @@
confuse(x) => x;
main(args) {
- var x = new A();
+ dynamic x = new A();
var y;
// Checks that inference doesn't incorrectly treat this as a normal
// assignment (where only B is a possible value after the assignment).
- var c = x ??= new B();
+ dynamic c = x ??= new B();
var z = x;
Expect.equals('a', x.m());
Expect.equals('a', z.m());
diff --git a/tests/compiler/dart2js_extra/inference_nsm_mirrors_test.dart b/tests/compiler/dart2js_extra/inference_nsm_mirrors_test.dart
deleted file mode 100644
index 424f7ca..0000000
--- a/tests/compiler/dart2js_extra/inference_nsm_mirrors_test.dart
+++ /dev/null
@@ -1,29 +0,0 @@
-// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-// Regression test for dart2js that did type inferencing on parameters
-// whose type may change at runtime due to an invocation through
-// [InstanceMirror.delegate].
-
-@MirrorsUsed(targets: 'A')
-import 'dart:mirrors';
-import 'package:expect/expect.dart';
-
-class A {
- noSuchMethod(im) {
- reflect(new B()).delegate(im);
- }
-}
-
-class B {
- foo(a) => a + 42;
-}
-
-main() {
- Expect.equals(42, new B().foo(0));
- // In checked mode we should get a type error. In unchecked mode it should be
- // an argument error.
- Expect.throws(
- () => new A().foo('foo'), (e) => e is ArgumentError || e is TypeError);
-}
diff --git a/tests/compiler/dart2js_extra/inference_super_set_call_test.dart b/tests/compiler/dart2js_extra/inference_super_set_call_test.dart
index 5038ad7..4258546 100644
--- a/tests/compiler/dart2js_extra/inference_super_set_call_test.dart
+++ b/tests/compiler/dart2js_extra/inference_super_set_call_test.dart
@@ -17,7 +17,7 @@
class S extends A {
var _x; // was bad: inferred as null, than [null | int]
- var _y = ''; // was bad: inferred as String, rather than [String | int]
+ dynamic _y = ''; // was bad: inferred as String, rather than [String | int]
var _z; // was ok : inferred as [null | int]
set x(v) {
diff --git a/tests/compiler/dart2js_extra/int_index_test.dart b/tests/compiler/dart2js_extra/int_index_test.dart
index 269124ce..629338b 100644
--- a/tests/compiler/dart2js_extra/int_index_test.dart
+++ b/tests/compiler/dart2js_extra/int_index_test.dart
@@ -4,9 +4,9 @@
main() {
var a = [0, 1];
- a[1.2]; // //# 01: runtime error
- a[1.2] = 4; // //# 02: runtime error
- checkIndex(a, 1.4); //# 03: runtime error
+ a[1.2]; // //# 01: compile-time error
+ a[1.2] = 4; // //# 02: compile-time error
+ checkIndex(a, 1.4); //# 03: runtime error
checkIndexedAssignment(a, 1.4); //# 04: runtime error
checkIndex(a, 0);
checkIndexedAssignment(a, 0);
diff --git a/tests/compiler/dart2js_extra/invalid_annotation2_test.dart b/tests/compiler/dart2js_extra/invalid_annotation2_test.dart
deleted file mode 100644
index f8238c3..0000000
--- a/tests/compiler/dart2js_extra/invalid_annotation2_test.dart
+++ /dev/null
@@ -1,23 +0,0 @@
-// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-// Regression test for http://dartbug.com/23893/
-//
-// Because annotations are parsed lazily, dart2js used to crash when an
-// annotation had a syntax error.
-// This checks the same behavior as invalid_annotation_test.dart, except that we
-// use mirrors to trigger the error in the vm. This also triggers the error in
-// dart2js differently.
-
-@MirrorsUsed(targets: const [A])
-import 'dart:mirrors';
-
-@Deprecated("m"
-,, // //# 01: compile-time error
- )
-class A {}
-
-main() {
- reflectClass(A).metadata;
-}
diff --git a/tests/compiler/dart2js_extra/locals_test.dart b/tests/compiler/dart2js_extra/locals_test.dart
index 36fd7ca..3169124 100644
--- a/tests/compiler/dart2js_extra/locals_test.dart
+++ b/tests/compiler/dart2js_extra/locals_test.dart
@@ -3,9 +3,9 @@
// BSD-style license that can be found in the LICENSE file.
void main() {
- var hello = 'Hello';
- var world = 'world';
- var s = 0;
+ dynamic hello = 'Hello';
+ dynamic world = 'world';
+ dynamic s = 0;
s = world;
hello = 'Greetings';
print("$hello, $world!");
diff --git a/tests/compiler/dart2js_extra/locate_single_element_1_test.dart b/tests/compiler/dart2js_extra/locate_single_element_1_test.dart
deleted file mode 100644
index 4291fe0..0000000
--- a/tests/compiler/dart2js_extra/locate_single_element_1_test.dart
+++ /dev/null
@@ -1,39 +0,0 @@
-// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-// Test for locateSingleElement bug.
-
-import 'package:expect/expect.dart';
-
-class T {
- foo() => 'T.foo'; // This is the single element.
-}
-
-class C implements T {
- // There is a warning that C does not implement 'foo'.
-}
-
-@NoInline()
-@AssumeDynamic()
-assumeT(x) {
- // returns inferred subtype(T).
- if (x is T) return x;
- throw "Not T";
-}
-
-var log = [];
-demo() {
- log.add(new T()); // T is created.
- var a = assumeT(new C()); // C is created.
-
- // The call "a.foo()" should be a NoSuchMethodError, but a bug in
- // locateSingleElement used to lead to T.foo being inlined. There is a single
- // method. T.foo, that matches subtype(T), but it should be rejected because
- // not all instantiated classes that are subtype(T) have that method.
- log.add(a.foo());
-}
-
-main() {
- Expect.throws(demo);
-}
diff --git a/tests/compiler/dart2js_extra/many_constants_test.dart b/tests/compiler/dart2js_extra/many_constants_test.dart
index 3c8a663..f28e2ff 100644
--- a/tests/compiler/dart2js_extra/many_constants_test.dart
+++ b/tests/compiler/dart2js_extra/many_constants_test.dart
@@ -29,14 +29,14 @@
const ll3 = const [1, 2, 8, 4, 5, 6, 7];
const ll4 = const [1, 2, 3, 4, 8, 6, 7];
-const m1 = const {1: 1, 2: 2};
-const m2 = const {1: 2, 2: 1};
-const m3 = const {1: 1, 2: 1};
-const m4 = const {1: 2, 2: 2};
-const m5 = const {2: 1, 1: 2};
-const m6 = const {2: 2, 1: 1};
-const m7 = const {2: 1, 1: 1};
-const m8 = const {2: 2, 1: 2};
+const m1 = const <dynamic, dynamic>{1: 1, 2: 2};
+const m2 = const <dynamic, dynamic>{1: 2, 2: 1};
+const m3 = const <dynamic, dynamic>{1: 1, 2: 1};
+const m4 = const <dynamic, dynamic>{1: 2, 2: 2};
+const m5 = const <dynamic, dynamic>{2: 1, 1: 2};
+const m6 = const <dynamic, dynamic>{2: 2, 1: 1};
+const m7 = const <dynamic, dynamic>{2: 1, 1: 1};
+const m8 = const <dynamic, dynamic>{2: 2, 1: 2};
const m9 = const <int, int>{1: 1, 2: 2};
const mA = const <int, int>{1: 2, 2: 1};
const mB = const <int, int>{1: 1, 2: 1};
diff --git a/tests/compiler/dart2js_extra/minus_zero2_test.dart b/tests/compiler/dart2js_extra/minus_zero2_test.dart
index 622678a..02cf9f0 100644
--- a/tests/compiler/dart2js_extra/minus_zero2_test.dart
+++ b/tests/compiler/dart2js_extra/minus_zero2_test.dart
@@ -12,7 +12,7 @@
var list = [1, 2, 3];
if (new DateTime.now().millisecondsSinceEpoch == 42) list[1] = 4;
int sum = 0;
- for (int i = -0.0; i < list.length; i++) {
+ for (num i = -0.0; i < list.length; i++) {
sum += list[i];
}
Expect.equals(6, sum);
diff --git a/tests/compiler/dart2js_extra/minus_zero_test.dart b/tests/compiler/dart2js_extra/minus_zero_test.dart
index 987d7a2..3b52434 100644
--- a/tests/compiler/dart2js_extra/minus_zero_test.dart
+++ b/tests/compiler/dart2js_extra/minus_zero_test.dart
@@ -6,13 +6,14 @@
import "package:expect/expect.dart";
-const double MINUS_ZERO = -0; //# 01: static type warning, checked mode compile-time error
+@NoInline()
+num minusZero() => -0;
void main() {
// Dart2js must not infer that the type-intersection of int and -0.0 is empty.
// It must get an interceptor for the addition (`i += 3`), or use the native
// JS + operation.
- int i = MINUS_ZERO; // //# 01: continued
- i += 3; // //# 01: continued
- Expect.equals(3, i); // //# 01: continued
+ int i = minusZero();
+ i += 3;
+ Expect.equals(3, i);
}
diff --git a/tests/compiler/dart2js_extra/mirror_enqueuer_regression_test.dart b/tests/compiler/dart2js_extra/mirror_enqueuer_regression_test.dart
deleted file mode 100644
index 5fd7b42..0000000
--- a/tests/compiler/dart2js_extra/mirror_enqueuer_regression_test.dart
+++ /dev/null
@@ -1,14 +0,0 @@
-// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-// Regression test for 'staged' reflection. MirrorsUsed pulls in static
-// functions, that pulls in more reflection. This used to trigger a bug in
-// Enqueuer where the second set of pulled in definitions were unresolved.
-
-@MirrorsUsed(targets: const ["foo"])
-import 'dart:mirrors';
-
-final foo = reflect(reflect(9)).getField(#getField);
-
-void main() {}
diff --git a/tests/compiler/dart2js_extra/mirror_invalid_field_access2_test.dart b/tests/compiler/dart2js_extra/mirror_invalid_field_access2_test.dart
deleted file mode 100644
index 0110cfb..0000000
--- a/tests/compiler/dart2js_extra/mirror_invalid_field_access2_test.dart
+++ /dev/null
@@ -1,33 +0,0 @@
-// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-// Test that we cannot reflect on elements not covered by the `MirrorsUsed`
-// annotation.
-
-library test;
-
-@MirrorsUsed(targets: 'C.foo')
-import 'dart:mirrors';
-
-import 'package:expect/expect.dart';
-
-class C {
- var foo;
- var bar;
-}
-
-main() {
- var c = new C();
-
- c.bar = 1;
- var local = c.bar;
-
- var mirror = reflect(c);
- Expect.equals(1, mirror.setField(const Symbol('foo'), 1).reflectee);
- Expect.equals(1, mirror.getField(const Symbol('foo')).reflectee);
- Expect.throws(() => mirror.setField(const Symbol('bar'), 2),
- (e) => e is NoSuchMethodError);
- Expect.throws(() => mirror.getField(const Symbol('bar')),
- (e) => e is NoSuchMethodError);
-}
diff --git a/tests/compiler/dart2js_extra/mirror_invalid_field_access3_test.dart b/tests/compiler/dart2js_extra/mirror_invalid_field_access3_test.dart
deleted file mode 100644
index 40d235f..0000000
--- a/tests/compiler/dart2js_extra/mirror_invalid_field_access3_test.dart
+++ /dev/null
@@ -1,30 +0,0 @@
-// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-// Test that we cannot reflect on elements not covered by the `MirrorsUsed`
-// annotation.
-
-library test;
-
-@MirrorsUsed(targets: 'C.foo')
-import 'dart:mirrors';
-
-import 'package:expect/expect.dart';
-
-class C {
- static var foo;
- static var bar;
-}
-
-main() {
- C.bar = 1;
- var local = C.bar;
- var mirror = reflect(new C()).type; // Workaround bug 12799.
- Expect.equals(1, mirror.setField(const Symbol('foo'), 1).reflectee);
- Expect.equals(1, mirror.getField(const Symbol('foo')).reflectee);
- Expect.throws(() => mirror.setField(const Symbol('bar'), 2),
- (e) => e is NoSuchMethodError);
- Expect.throws(() => mirror.getField(const Symbol('bar')),
- (e) => e is NoSuchMethodError);
-}
diff --git a/tests/compiler/dart2js_extra/mirror_invalid_field_access4_test.dart b/tests/compiler/dart2js_extra/mirror_invalid_field_access4_test.dart
deleted file mode 100644
index ba3b1904..0000000
--- a/tests/compiler/dart2js_extra/mirror_invalid_field_access4_test.dart
+++ /dev/null
@@ -1,40 +0,0 @@
-// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-// Test that we cannot reflect on elements not covered by the `MirrorsUsed`
-// annotation.
-
-library test;
-
-@MirrorsUsed(targets: 'C.foo')
-import 'dart:mirrors';
-
-import 'package:expect/expect.dart';
-
-class C {
- var foo;
- var bar;
-}
-
-class D {
- get bar {}
- set bar(x) {}
-}
-
-int inscrutable(int x) => x == 0 ? 0 : x | inscrutable(x & (x - 1));
-
-main() {
- var c = inscrutable(1) == 1 ? new C() : new D();
-
- c.bar = 1;
- var local = c.bar;
-
- var mirror = reflect(c);
- Expect.equals(1, mirror.setField(const Symbol('foo'), 1).reflectee);
- Expect.equals(1, mirror.getField(const Symbol('foo')).reflectee);
- Expect.throws(() => mirror.setField(const Symbol('bar'), 2),
- (e) => e is NoSuchMethodError);
- Expect.throws(() => mirror.getField(const Symbol('bar')),
- (e) => e is NoSuchMethodError);
-}
diff --git a/tests/compiler/dart2js_extra/mirror_invalid_field_access_test.dart b/tests/compiler/dart2js_extra/mirror_invalid_field_access_test.dart
deleted file mode 100644
index 15e7099..0000000
--- a/tests/compiler/dart2js_extra/mirror_invalid_field_access_test.dart
+++ /dev/null
@@ -1,29 +0,0 @@
-// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-// Test that we cannot reflect on elements not covered by the `MirrorsUsed`
-// annotation.
-
-library test;
-
-@MirrorsUsed(targets: 'foo')
-import 'dart:mirrors';
-
-import 'package:expect/expect.dart';
-
-var foo;
-var bar;
-
-main() {
- bar = 1;
- var local = bar;
-
- var mirror = currentMirrorSystem().findLibrary(const Symbol('test'));
- Expect.equals(1, mirror.setField(const Symbol('foo'), 1).reflectee);
- Expect.equals(1, mirror.getField(const Symbol('foo')).reflectee);
- Expect.throws(() => mirror.setField(const Symbol('bar'), 2),
- (e) => e is NoSuchMethodError);
- Expect.throws(() => mirror.getField(const Symbol('bar')),
- (e) => e is NoSuchMethodError);
-}
diff --git a/tests/compiler/dart2js_extra/mirror_invalid_invoke2_test.dart b/tests/compiler/dart2js_extra/mirror_invalid_invoke2_test.dart
deleted file mode 100644
index 774c7280..0000000
--- a/tests/compiler/dart2js_extra/mirror_invalid_invoke2_test.dart
+++ /dev/null
@@ -1,33 +0,0 @@
-// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-// Test that we cannot reflect on elements not covered by the `MirrorsUsed`
-// annotation.
-
-library test;
-
-@MirrorsUsed(targets: 'C.foo')
-import 'dart:mirrors';
-
-import 'package:expect/expect.dart';
-
-import '../../language/compiler_annotations.dart';
-
-class C {
- foo() => 1;
-
- @NoInline()
- // Use a closure to prevent inlining until the annotation is implemented.
- bar() => () => 2;
-}
-
-main() {
- var c = new C();
- c.bar(); // Call bar, so it is included in the program.
-
- var mirror = reflect(c);
- Expect.equals(1, mirror.invoke(const Symbol('foo'), []).reflectee);
- Expect.throws(() => mirror.invoke(const Symbol('bar'), []),
- (e) => e is NoSuchMethodError);
-}
diff --git a/tests/compiler/dart2js_extra/mirror_invalid_invoke3_test.dart b/tests/compiler/dart2js_extra/mirror_invalid_invoke3_test.dart
deleted file mode 100644
index 9ddd4e5..0000000
--- a/tests/compiler/dart2js_extra/mirror_invalid_invoke3_test.dart
+++ /dev/null
@@ -1,32 +0,0 @@
-// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-// Test that we cannot reflect on elements not covered by the `MirrorsUsed`
-// annotation.
-
-library test;
-
-@MirrorsUsed(targets: 'C.foo')
-import 'dart:mirrors';
-
-import 'package:expect/expect.dart';
-
-import '../../language/compiler_annotations.dart';
-
-class C {
- static foo() => 1;
-
- @NoInline()
- // Use a closure to prevent inlining until the annotation is implemented.
- static bar() => () => 2;
-}
-
-main() {
- C.bar(); // Call bar, so it is included in the program.
-
- var mirror = reflect(new C()).type; // Workaround bug 12799.
- Expect.equals(1, mirror.invoke(const Symbol('foo'), []).reflectee);
- Expect.throws(() => mirror.invoke(const Symbol('bar'), []),
- (e) => e is NoSuchMethodError);
-}
diff --git a/tests/compiler/dart2js_extra/mirror_invalid_invoke_test.dart b/tests/compiler/dart2js_extra/mirror_invalid_invoke_test.dart
deleted file mode 100644
index ea65a1e..0000000
--- a/tests/compiler/dart2js_extra/mirror_invalid_invoke_test.dart
+++ /dev/null
@@ -1,29 +0,0 @@
-// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-// Test that we cannot reflect on elements not covered by the `MirrorsUsed`
-// annotation.
-
-library test;
-
-@MirrorsUsed(targets: 'foo')
-import 'dart:mirrors';
-
-import 'package:expect/expect.dart';
-
-import '../../language/compiler_annotations.dart';
-
-foo() => 1;
-
-@NoInline()
-// Use a closure to prevent inlining until the annotation is implemented.
-bar() => () => 2;
-
-main() {
- bar(); // Call bar, so it is included in the program.
-
- var lm = currentMirrorSystem().findLibrary(const Symbol('test'));
- Expect.equals(1, lm.invoke(const Symbol('foo'), []).reflectee);
- Expect.throws(() => lm.invoke(const Symbol('bar'), []));
-}
diff --git a/tests/compiler/dart2js_extra/mirror_printer_test.dart b/tests/compiler/dart2js_extra/mirror_printer_test.dart
deleted file mode 100644
index 9f5d5b7..0000000
--- a/tests/compiler/dart2js_extra/mirror_printer_test.dart
+++ /dev/null
@@ -1,189 +0,0 @@
-// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-/// Prints all information about all mirrors. This tests that it is possible to
-/// enumerate all reflective information without crashing.
-
-// Note: Adding imports below is fine for regression tests. For example,
-// 'crash_library_metadata.dart' is imported to ensure the compiler doesn't
-// crash.
-
-// TODO(ahe): This test should be extended until we are sure all data is
-// printed.
-
-library test.mirror_printer_test;
-
-@MirrorsUsed(targets: '*')
-import 'dart:mirrors';
-
-import 'crash_library_metadata.dart'; // This would crash dart2js.
-
-// Importing dart:html to make things interesting.
-import 'dart:html'; //# 01: ok
-
-class MirrorPrinter {
- final StringBuffer buffer;
- final TypeMirror dynamicType = currentMirrorSystem().dynamicType;
-
- int indentationLevel = 0;
-
- MirrorPrinter(this.buffer);
-
- void w(object) {
- buffer.write(object);
- }
-
- n(Symbol symbol) => MirrorSystem.getName(symbol);
-
- void indented(action) {
- indentationLevel++;
- action();
- indentationLevel--;
- }
-
- get indent {
- for (int i = 0; i < indentationLevel; i++) {
- w(' ');
- }
- }
-
- String stringifyInstance(InstanceMirror mirror) {
- var reflectee = mirror.reflectee;
- if (reflectee is String) return '"${reflectee}"';
- if (reflectee is Null ||
- reflectee is bool ||
- reflectee is num ||
- reflectee is List ||
- reflectee is Map) {
- return '$reflectee';
- }
- StringBuffer buffer = new StringBuffer();
- Map<Symbol, DeclarationMirror> declarations = mirror.type.declarations;
- buffer..write(n(mirror.type.simpleName))..write('(');
- bool first = true;
- declarations.forEach((Symbol name, DeclarationMirror declaration) {
- if (declaration is! VariableMirror) return;
- VariableMirror variable = declaration;
- if (variable.isStatic) return;
- // TODO(ahe): Include superclasses.
- if (first) {
- first = false;
- } else {
- buffer.write(', ');
- }
- buffer
- ..write(n(name))
- ..write(': ')
- ..write(stringifyInstance(mirror.getField(name)));
- });
- buffer.write(')');
- return buffer.toString();
- }
-
- String stringifyMetadata(InstanceMirror mirror) {
- return '@${stringifyInstance(mirror)}';
- }
-
- bool writeType(TypeMirror mirror) {
- if (mirror == null || mirror == dynamicType) return false;
- w('${n(mirror.simpleName)} ');
- return true;
- }
-
- writeVariable(VariableMirror mirror) {
- bool needsVar = true;
- if (mirror.isStatic) w('static ');
- // TODO(ahe): What about const?
- if (mirror.isFinal) {
- w('final ');
- needsVar = false;
- }
-
- if (writeType(mirror.type)) needsVar = false;
-
- if (needsVar) {
- w('var ');
- }
- w('${n(mirror.simpleName)};');
- }
-
- writeMethod(MethodMirror mirror) {
- writeType(mirror.returnType);
- if (mirror.isOperator) {
- w('operator ');
- }
- if (mirror.isGetter) {
- w('get ');
- }
- if (mirror.isSetter) {
- w('set ');
- }
- w('${n(mirror.simpleName)}');
- if (!mirror.isGetter) {
- w('()');
- }
- w(';');
- }
-
- writeClass(ClassMirror mirror) {
- // TODO(ahe): Write 'abstract' if [mirror] is abstract.
- w('class ${n(mirror.simpleName)}');
- // TODO(ahe): Write superclass and interfaces.
- w(' {');
- bool first = true;
- indented(() {
- for (DeclarationMirror declaration in mirror.declarations.values) {
- if (first) {
- first = false;
- } else {
- w('\n');
- }
- writeDeclaration(declaration);
- }
- });
- w('\n}\n');
- }
-
- writeDeclaration(DeclarationMirror declaration) {
- w('\n');
- var metadata = declaration.metadata;
- if (!metadata.isEmpty) {
- indent;
- buffer.writeAll(metadata.map(stringifyMetadata), ' ');
- w('\n');
- }
- indent;
- if (declaration is ClassMirror) {
- writeClass(declaration);
- } else if (declaration is VariableMirror) {
- writeVariable(declaration);
- } else if (declaration is MethodMirror) {
- writeMethod(declaration);
- } else {
- // TODO(ahe): Test other subclasses of DeclarationMirror.
- w('$declaration');
- }
- }
-
- writeLibrary(LibraryMirror library) {
- w('library ${n(library.simpleName)};\n\n');
- library.declarations.values
- .where((d) => d is! TypeMirror)
- .forEach(writeDeclaration);
- w('\n');
- }
-
- static StringBuffer stringify(Map<Uri, LibraryMirror> libraries) {
- StringBuffer buffer = new StringBuffer();
- libraries.values.forEach(new MirrorPrinter(buffer).writeLibrary);
- return buffer;
- }
-}
-
-main() {
- print(MirrorPrinter.stringify(currentMirrorSystem().libraries));
- // Clear the nodes to avoid confusing the fine test framework (by "fine" I
- // mean something else) -- ahe.
- document.body.nodes.clear(); //# 01: continued
-}
diff --git a/tests/compiler/dart2js_extra/mirror_test.dart b/tests/compiler/dart2js_extra/mirror_test.dart
deleted file mode 100644
index 5c4e452..0000000
--- a/tests/compiler/dart2js_extra/mirror_test.dart
+++ /dev/null
@@ -1,19 +0,0 @@
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-import "package:expect/expect.dart";
-import 'dart:mirrors';
-
-void main() {
- var now = new DateTime.now();
- InstanceMirror mirror = reflect(now);
- print('now: ${now}');
- print('mirror.type: ${mirror.type}');
- print('now.toUtc(): ${now.toUtc()}');
-
- var value = mirror.invoke(const Symbol("toUtc"), []);
- print('mirror.invoke("toUtc", []): $value');
- Expect.isTrue(value.hasReflectee);
- Expect.equals(now.toUtc(), value.reflectee);
-}
diff --git a/tests/compiler/dart2js_extra/mirror_type_inference_field2_test.dart b/tests/compiler/dart2js_extra/mirror_type_inference_field2_test.dart
deleted file mode 100644
index ee6b26f..0000000
--- a/tests/compiler/dart2js_extra/mirror_type_inference_field2_test.dart
+++ /dev/null
@@ -1,23 +0,0 @@
-// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-// Test that type inference sees the possible modification of `fisk` from
-// the mirror system and not infers the value to be an integer, or any
-// other elements that use `fisk` like `otherFisk` to be of type integer.
-library test;
-
-@MirrorsUsed(targets: 'fisk', override: '*')
-import 'dart:mirrors';
-
-import 'package:expect/expect.dart';
-
-var fisk = 1;
-var otherFisk = 42;
-
-main() {
- var lm = currentMirrorSystem().findLibrary(const Symbol('test'));
- lm.setField(const Symbol('fisk'), 'hest');
- otherFisk = fisk;
- Expect.isTrue(otherFisk is String);
-}
diff --git a/tests/compiler/dart2js_extra/mirror_type_inference_field_test.dart b/tests/compiler/dart2js_extra/mirror_type_inference_field_test.dart
deleted file mode 100644
index fcf0641..0000000
--- a/tests/compiler/dart2js_extra/mirror_type_inference_field_test.dart
+++ /dev/null
@@ -1,20 +0,0 @@
-// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-// Test that type inference sees the possible modification of `fisk` from
-// the mirror system and not infers the value to be an integer.
-library test;
-
-@MirrorsUsed(targets: 'fisk', override: '*')
-import 'dart:mirrors';
-
-import 'package:expect/expect.dart';
-
-var fisk = 1;
-
-main() {
- var lm = currentMirrorSystem().findLibrary(const Symbol('test'));
- lm.setField(const Symbol('fisk'), 'hest');
- Expect.isTrue(fisk is String);
-}
diff --git a/tests/compiler/dart2js_extra/mirror_type_inference_function_test.dart b/tests/compiler/dart2js_extra/mirror_type_inference_function_test.dart
deleted file mode 100644
index c7488f4..0000000
--- a/tests/compiler/dart2js_extra/mirror_type_inference_function_test.dart
+++ /dev/null
@@ -1,20 +0,0 @@
-// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-// Test that type inference sees the call to `fisk` from the mirror system
-// and not infers the argument to be an integer.
-library test;
-
-@MirrorsUsed(targets: 'fisk', override: '*')
-import 'dart:mirrors';
-
-import 'package:expect/expect.dart';
-
-bool fisk(a) => a is int;
-
-main() {
- Expect.isTrue(fisk(1));
- var lm = currentMirrorSystem().findLibrary(const Symbol('test'));
- Expect.isFalse(lm.invoke(const Symbol('fisk'), ['hest']).reflectee);
-}
diff --git a/tests/compiler/dart2js_extra/mirrors_declarations_filtering_test.dart b/tests/compiler/dart2js_extra/mirrors_declarations_filtering_test.dart
deleted file mode 100644
index 08ec7a2..0000000
--- a/tests/compiler/dart2js_extra/mirrors_declarations_filtering_test.dart
+++ /dev/null
@@ -1,52 +0,0 @@
-// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-// Regression test for the dart2js mirrors implementation that triggers the
-// generation of the declarations of a class in the presence of call stubs
-// and non-reflectable methods. For neither of the latter an instance mirror
-// should be constructed and they should not be contained in declarations.
-@MirrorsUsed(metaTargets: "Meta")
-import "dart:mirrors";
-import "package:expect/expect.dart";
-
-class Meta {
- const Meta();
-}
-
-class A {
- @Meta()
- reflectableThing(int a, [int b = 9, int c = 42]) => a + b + c;
- nonReflectableThing(int a, [int b = 4, int c = 21]) => a + b + c;
-}
-
-tryCall(object, symbol, values, expected) {
- var mirror = reflect(object);
- var result = mirror.invoke(symbol, values).reflectee;
- Expect.equals(result, expected);
-}
-
-@NoInline()
-@AssumeDynamic()
-hide(x) => x;
-
-main() {
- var a = hide(new A());
- // Make sure we statically have some calls to reflectableThing with 1, 2 and
- // 3 arguments so that stubs are generated.
- Expect.equals(1 + 9 + 42, a.reflectableThing(1));
- Expect.equals(1 + 5 + 42, a.reflectableThing(1, 5));
- Expect.equals(1 + 22 + 3, a.reflectableThing(1, 22, 3));
- // Try calling methods through reflection.
- tryCall(a, #reflectableThing, [1], 1 + 9 + 42);
- tryCall(a, #reflectableThing, [1, 5], 1 + 5 + 42);
- tryCall(a, #reflectableThing, [1, 22, 3], 1 + 22 + 3);
- Expect.throws(() => tryCall(a, #nonReflectableThing, [1], 1 + 4 + 21));
- Expect.throws(() => tryCall(a, #nonReflectableThing, [1, 5], 1 + 5 + 21));
- Expect.throws(() => tryCall(a, #nonReflectableThing, [1, 13, 7], 1 + 13 + 7));
- // Trigger generation of all declarations and check they only contain a
- // a single entry.
- var declarations = reflect(a).type.declarations;
- Expect.equals(1, declarations.keys.length);
- Expect.equals(#reflectableThing, declarations.keys.first);
-}
diff --git a/tests/compiler/dart2js_extra/mirrors_used_closure_test.dart b/tests/compiler/dart2js_extra/mirrors_used_closure_test.dart
deleted file mode 100644
index 8f5dc8e..0000000
--- a/tests/compiler/dart2js_extra/mirrors_used_closure_test.dart
+++ /dev/null
@@ -1,29 +0,0 @@
-// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-library MirrorsTest;
-
-import 'package:expect/expect.dart';
-
-@MirrorsUsed(targets: const ['A.foo', 'B.bar'])
-import 'dart:mirrors';
-
-class A {
- foo() => 42;
- bar() => 499;
-}
-
-class B {
- bar() => 33;
-}
-
-@NoInline()
-@AssumeDynamic()
-confuse(x) => x;
-
-main() {
- var f = [new A(), new B()][confuse(0)].bar;
- Expect.throws(
- () => reflect(f).invoke(#call, [], {}), (e) => e is UnsupportedError);
-}
diff --git a/tests/compiler/dart2js_extra/mirrors_used_metatargets_test.dart b/tests/compiler/dart2js_extra/mirrors_used_metatargets_test.dart
deleted file mode 100644
index 54513d9..0000000
--- a/tests/compiler/dart2js_extra/mirrors_used_metatargets_test.dart
+++ /dev/null
@@ -1,40 +0,0 @@
-// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-@MirrorsUsed(metaTargets: 'X')
-import 'dart:mirrors';
-
-const x = const X();
-
-class X {
- const X();
-}
-
-@x
-class Y {
- foo() => 42;
-}
-
-class Z {
- foo() => 99;
-
- @X()
- bar() => 87;
-}
-
-main() {
- var y = new Y();
- var z = new Z();
-
- if (reflect(y).invoke(#foo, []).reflectee != 42) throw 'Wrong Y.foo';
- if (reflect(z).invoke(#bar, []).reflectee != 87) throw 'Wrong Z.bar';
-
- bool caught = false;
- try {
- reflect(z).invoke(#foo, []);
- } on UnsupportedError catch (e) {
- caught = true;
- }
- if (!caught) throw 'Wrong Z.foo';
-}
diff --git a/tests/compiler/dart2js_extra/mirrors_used_native_test.dart b/tests/compiler/dart2js_extra/mirrors_used_native_test.dart
deleted file mode 100644
index 85dbb35..0000000
--- a/tests/compiler/dart2js_extra/mirrors_used_native_test.dart
+++ /dev/null
@@ -1,14 +0,0 @@
-// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-@MirrorsUsed(targets: 'List')
-import 'dart:mirrors';
-
-import 'package:expect/expect.dart';
-
-main() {
- Expect.equals(3, reflect([1, 2, 3]).getField(#length).reflectee);
- Expect.throws(() => reflect({"hest": 42}).getField(#length),
- (e) => e is UnsupportedError);
-}
diff --git a/tests/compiler/dart2js_extra/mirrors_used_warning2_test.dart b/tests/compiler/dart2js_extra/mirrors_used_warning2_test.dart
deleted file mode 100644
index 699595a..0000000
--- a/tests/compiler/dart2js_extra/mirrors_used_warning2_test.dart
+++ /dev/null
@@ -1,34 +0,0 @@
-// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-import 'dart:mirrors';
-import 'dart:async';
-
-import 'package:expect/expect.dart';
-
-class A {
- noSuchMethod(Invocation invocation) {
- return MirrorSystem.getName(invocation.memberName);
- }
-}
-
-var lines = [];
-capturePrint(Zone self, ZoneDelegate parent, Zone origin, line) {
- lines.add(line);
-}
-
-runTests() {
- // No MirrorsUsed annotation anywhere.
- // Dart2js should retain all symbols.
- Expect.equals("foo", new A().foo);
- Expect.isTrue(lines.isEmpty);
- var barResult = new A().bar;
- Expect.equals("bar", barResult);
- Expect.isTrue(lines.isEmpty);
-}
-
-main() {
- runZoned(runTests,
- zoneSpecification: new ZoneSpecification(print: capturePrint));
-}
diff --git a/tests/compiler/dart2js_extra/mirrors_used_warning_test.dart b/tests/compiler/dart2js_extra/mirrors_used_warning_test.dart
deleted file mode 100644
index 626c0df..0000000
--- a/tests/compiler/dart2js_extra/mirrors_used_warning_test.dart
+++ /dev/null
@@ -1,39 +0,0 @@
-// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-@MirrorsUsed(symbols: 'foo')
-import 'dart:mirrors';
-import 'dart:async';
-
-import 'package:expect/expect.dart';
-
-class A {
- noSuchMethod(Invocation invocation) {
- return MirrorSystem.getName(invocation.memberName);
- }
-}
-
-var lines = [];
-capturePrint(Zone self, ZoneDelegate parent, Zone origin, line) {
- lines.add(line);
-}
-
-runTests() {
- // "foo" is in MirrorsUsed and should therefore always work.
- Expect.equals("foo", new A().foo);
- Expect.isTrue(lines.isEmpty);
- var barResult = new A().bar;
- Expect.equals("bar", barResult); // //# minif: ok
-
- Expect.isTrue(lines.length == 1);
- var line = lines.first;
- Expect.isTrue(line.contains("Warning") &&
- line.contains("bar") && // //# minif: continued
- line.contains("minif"));
-}
-
-main() {
- runZoned(runTests,
- zoneSpecification: new ZoneSpecification(print: capturePrint));
-}
diff --git a/tests/compiler/dart2js_extra/no_such_method_mirrors_test.dart b/tests/compiler/dart2js_extra/no_such_method_mirrors_test.dart
deleted file mode 100644
index 7719974..0000000
--- a/tests/compiler/dart2js_extra/no_such_method_mirrors_test.dart
+++ /dev/null
@@ -1,21 +0,0 @@
-// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-import 'dart:mirrors';
-import 'package:expect/expect.dart';
-
-class A {
- noSuchMethod(im) {
- reflect(new B()).delegate(im);
- }
-}
-
-class B {}
-
-main() {
- // Test with an intercepted selector.
- Expect.throws(() => new A().startsWith(42), (e) => e is NoSuchMethodError);
- // Test with a non-intercepted selector.
- Expect.throws(() => new A().foobar(), (e) => e is NoSuchMethodError);
-}
diff --git a/tests/compiler/dart2js_extra/no_such_method_strong11_lib.dart b/tests/compiler/dart2js_extra/no_such_method_strong11_lib.dart
new file mode 100644
index 0000000..a1f1e15
--- /dev/null
+++ b/tests/compiler/dart2js_extra/no_such_method_strong11_lib.dart
@@ -0,0 +1,11 @@
+// Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+abstract class I {
+ // ignore: unused_element
+ int _m1();
+
+ // ignore: unused_element
+ int _m2();
+}
diff --git a/tests/compiler/dart2js_extra/no_such_method_strong11_test.dart b/tests/compiler/dart2js_extra/no_such_method_strong11_test.dart
new file mode 100644
index 0000000..bc0a85c
--- /dev/null
+++ b/tests/compiler/dart2js_extra/no_such_method_strong11_test.dart
@@ -0,0 +1,41 @@
+// Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+// dart2jsOptions=--strong
+
+// Regression test checking that nsm-forwarders do not get installed for private
+// members of other libraries. See https://dartbug.com/33665
+
+import 'package:expect/expect.dart';
+import 'no_such_method_strong11_lib.dart';
+
+abstract class J {
+ int _m3();
+ int _m4();
+}
+
+class A implements I, J {
+ int _m1() => 1;
+ int _m3() => 3;
+ noSuchMethod(Invocation m) => -1;
+}
+
+main() {
+ dynamic a = confuse(new A());
+ Expect.equals(1, a._m1());
+ Expect.equals(3, a._m3());
+ Expect.equals(1, (a._m1)());
+ Expect.equals(3, (a._m3)());
+
+ Expect.equals(-1, a._m2());
+ Expect.equals(-1, a._m4());
+ Expect.isFalse(a._m2 is Function);
+ Expect.equals(-1, a._m2);
+ Expect.isTrue(a._m4 is Function);
+ Expect.equals(-1, (a._m4)());
+}
+
+@NoInline()
+@AssumeDynamic()
+confuse(x) => x;
diff --git a/tests/compiler/dart2js_extra/operator2_test.dart b/tests/compiler/dart2js_extra/operator2_test.dart
index 4adff2d..7d43fb0 100644
--- a/tests/compiler/dart2js_extra/operator2_test.dart
+++ b/tests/compiler/dart2js_extra/operator2_test.dart
@@ -93,7 +93,7 @@
void divTest() {
var m1 = 0.0 - 1.0;
var m2 = 0 - 2;
- var x = two();
+ num x = two();
x /= 2;
Expect.equals(1.0, x);
x /= 2;
diff --git a/tests/compiler/dart2js_extra/operator_equals_test.dart b/tests/compiler/dart2js_extra/operator_equals_test.dart
index becbdd3..6d73309 100644
--- a/tests/compiler/dart2js_extra/operator_equals_test.dart
+++ b/tests/compiler/dart2js_extra/operator_equals_test.dart
@@ -13,7 +13,7 @@
}
main() {
- var a = new AlwaysTrue();
+ dynamic a = new AlwaysTrue();
Expect.isTrue(a == 2);
Expect.isFalse(a == null);
Expect.isFalse(a != 2);
diff --git a/tests/compiler/dart2js_extra/optional_parameter_test.dart b/tests/compiler/dart2js_extra/optional_parameter_test.dart
index bb9ac6f..48418fb 100644
--- a/tests/compiler/dart2js_extra/optional_parameter_test.dart
+++ b/tests/compiler/dart2js_extra/optional_parameter_test.dart
@@ -24,7 +24,7 @@
Expect.equals(null, a.foo());
Expect.equals(null, a.bar(42));
Expect.equals(42, a.bar(null, 42));
- Expect.equals(0, a.foo(1, 2));
- Expect.equals(0, a.bar());
- Expect.equals(0, a.bar(1, 2, 3));
+ Expect.equals(0, (a as dynamic).foo(1, 2));
+ Expect.equals(0, (a as dynamic).bar());
+ Expect.equals(0, (a as dynamic).bar(1, 2, 3));
}
diff --git a/tests/compiler/dart2js_extra/reflect_native_types_test.dart b/tests/compiler/dart2js_extra/reflect_native_types_test.dart
deleted file mode 100644
index eb2cb35..0000000
--- a/tests/compiler/dart2js_extra/reflect_native_types_test.dart
+++ /dev/null
@@ -1,22 +0,0 @@
-// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-// Test that reflection works on intercepted types.
-
-import 'dart:mirrors';
-import 'package:expect/expect.dart';
-
-main() {
- // Make sure that reflecting on values of intercepted/native classes does
- // not crash.
- var intMembers = reflect(123).type.instanceMembers;
- Expect.isTrue(intMembers.containsKey(#compareTo));
- Expect.isTrue(intMembers.length > 15);
- var listMembers = reflect([]).type.instanceMembers;
- Expect.isTrue(listMembers.containsKey(#join));
- Expect.isTrue(listMembers.length > 15);
- var stringMembers = reflect('hest').type.instanceMembers;
- Expect.isTrue(stringMembers.containsKey(#contains));
- Expect.isTrue(stringMembers.length > 15);
-}
diff --git a/tests/compiler/dart2js_extra/regress/4740_library.dart b/tests/compiler/dart2js_extra/regress/4740_library.dart
deleted file mode 100644
index 709991f..0000000
--- a/tests/compiler/dart2js_extra/regress/4740_library.dart
+++ /dev/null
@@ -1,9 +0,0 @@
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-library _4740_library;
-
-class Foo {
- Foo._internal();
-}
diff --git a/tests/compiler/dart2js_extra/regress/4740_test.dart b/tests/compiler/dart2js_extra/regress/4740_test.dart
deleted file mode 100644
index a32a7b9..0000000
--- a/tests/compiler/dart2js_extra/regress/4740_test.dart
+++ /dev/null
@@ -1,11 +0,0 @@
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-import "package:expect/expect.dart";
-
-import '4740_library.dart';
-
-main() {
- Expect.throws(() => new Foo._internal(), (e) => e is NoSuchMethodError);
-}
diff --git a/tests/compiler/dart2js_extra/regress_32069_test.dart b/tests/compiler/dart2js_extra/regress_32069_test.dart
index 4f13dfc..23a0aff 100644
--- a/tests/compiler/dart2js_extra/regress_32069_test.dart
+++ b/tests/compiler/dart2js_extra/regress_32069_test.dart
@@ -6,8 +6,8 @@
main() {
var m1 = {
- 'hello': ['hi', 'howdy'],
- 'bye': []
+ 'hello': <String>['hi', 'howdy'],
+ 'bye': <String>[]
};
var m = new Map<String, List<String>>.unmodifiable(m1);
print(m);
diff --git a/tests/compiler/dart2js_extra/switch_test.dart b/tests/compiler/dart2js_extra/switch_test.dart
index 03a55e1..7fbc9d0 100644
--- a/tests/compiler/dart2js_extra/switch_test.dart
+++ b/tests/compiler/dart2js_extra/switch_test.dart
@@ -75,8 +75,10 @@
switch (val) {
case 1:
return 100;
- case 2:
+ case 2: _throw(); //# 00: compile-time error
+ case 3:
_throw();
+ break;
default:
return 300;
}
diff --git a/tests/compiler/dart2js_extra/type_error_message_test.dart b/tests/compiler/dart2js_extra/type_error_message_test.dart
index e3f3f90..d097577 100644
--- a/tests/compiler/dart2js_extra/type_error_message_test.dart
+++ b/tests/compiler/dart2js_extra/type_error_message_test.dart
@@ -9,9 +9,9 @@
class C<T, S> {}
-bool inCheckedMode() {
+bool inComplianceMode() {
try {
- int i = 'hest';
+ int i = ('hest' as dynamic);
} catch (e) {
return true;
}
@@ -19,10 +19,10 @@
}
main() {
- if (inCheckedMode()) {
+ if (inComplianceMode()) {
bool caught = false;
try {
- C<String, String> x = new C<C<int, String>, String>();
+ C<String, String> x = (new C<C<int, String>, String>()) as dynamic;
} catch (e) {
String nameOfC = (C).toString();
String nameOfInt = (int).toString();
diff --git a/tests/compiler/dart2js_extra/variable_type_test.dart b/tests/compiler/dart2js_extra/variable_type_test.dart
deleted file mode 100644
index 500a70b..0000000
--- a/tests/compiler/dart2js_extra/variable_type_test.dart
+++ /dev/null
@@ -1,13 +0,0 @@
-// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-int foo(int i) {
- i = 'fisk'; // //# 01: static type warning
- return 'kat'; // //# 02: static type warning, dynamic type error
-}
-
-main() {
- foo(42);
- foo('hest'); // //# 03: static type warning
-}
diff --git a/tests/compiler/dart2js_native/compute_this_script_test.dart b/tests/compiler/dart2js_native/compute_this_script_test.dart
index fcf4539..8519bc4 100644
--- a/tests/compiler/dart2js_native/compute_this_script_test.dart
+++ b/tests/compiler/dart2js_native/compute_this_script_test.dart
@@ -11,6 +11,6 @@
// of our test runner, but I can think of no other way to test this.
// -- ahe
if (!thisScript.endsWith('/out.js')) {
- throw 'Unexpected script: "$thiscript"';
+ throw 'Unexpected script: "$thisScript"';
}
}
diff --git a/tests/compiler/dart2js_native/core_type_check_native_test.dart b/tests/compiler/dart2js_native/core_type_check_native_test.dart
index c1411b6..6356192 100644
--- a/tests/compiler/dart2js_native/core_type_check_native_test.dart
+++ b/tests/compiler/dart2js_native/core_type_check_native_test.dart
@@ -8,13 +8,19 @@
class A {}
@Native("B")
-class B implements Comparable {}
+class B implements Comparable {
+ noSuchMethod(m) => super.noSuchMethod(m);
+}
@Native("C")
-class C implements Pattern {}
+class C implements Pattern {
+ noSuchMethod(m) => super.noSuchMethod(m);
+}
@Native("D")
-class D implements Pattern, Comparable {}
+class D implements Pattern, Comparable {
+ noSuchMethod(m) => super.noSuchMethod(m);
+}
makeA() native;
makeB() native;
diff --git a/tests/compiler/dart2js_native/dart2js_native.status b/tests/compiler/dart2js_native/dart2js_native.status
index 45d07d3..8ad400d 100644
--- a/tests/compiler/dart2js_native/dart2js_native.status
+++ b/tests/compiler/dart2js_native/dart2js_native.status
@@ -5,15 +5,14 @@
[ $compiler == dart2js ]
bound_closure_super_test: RuntimeError
fake_thing_test: RuntimeError # Issue 13010
-mirror_intercepted_field_test: SkipByDesign # mirrors not supported
-native_mirror_test: SkipByDesign # mirrors not supported
-native_no_such_method_exception3_frog_test: SkipByDesign # mirrors not supported
-native_no_such_method_exception4_frog_test: SkipByDesign # mirrors not supported
-native_no_such_method_exception5_frog_test: SkipByDesign # mirrors not supported
[ $browser ]
*: Skip
+[ $compiler == dart2js && $checked && !$strong ]
+error_safeToString_test: RuntimeError # Fix for Issue 33627 disabled native class sharing
+native_method_inlining_test: RuntimeError
+
[ $compiler == dart2js && $fasta ]
native_library_same_name_used_frog_test: CompileTimeError
subclassing_constructor_1_test: RuntimeError
@@ -23,3 +22,7 @@
[ $compiler == dart2js && $minified ]
optimization_hints_test: RuntimeError, OK # Test relies on unminified names.
+
+[ $compiler == dart2js && $strong ]
+error_safeToString_test: RuntimeError # Fix for Issue 33627 disabled native class sharing
+native_checked_fields_frog_test: RuntimeError
diff --git a/tests/compiler/dart2js_native/downcast_test.dart b/tests/compiler/dart2js_native/downcast_test.dart
index 0727b1b..ab74f5f 100644
--- a/tests/compiler/dart2js_native/downcast_test.dart
+++ b/tests/compiler/dart2js_native/downcast_test.dart
@@ -10,7 +10,7 @@
abstract class I extends J {
I read();
- write(I x);
+ write(covariant I x);
}
// Native implementation.
diff --git a/tests/compiler/dart2js_native/fake_thing_test.dart b/tests/compiler/dart2js_native/fake_thing_test.dart
index 2761a90..0131821 100644
--- a/tests/compiler/dart2js_native/fake_thing_test.dart
+++ b/tests/compiler/dart2js_native/fake_thing_test.dart
@@ -3,6 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
import "package:expect/expect.dart";
+import "dart:_foreign_helper" show JS;
// Test that native objects cannot accidentally or maliciously be mistaken for
// Dart objects.
@@ -20,7 +21,7 @@
(function(){
function A() {}
A.prototype.$isThing = true;
- make1 = function(){return new A;};
+ make1 = function(){return new A();};
make2 = function(){return {$isThing: true}};
})()""");
}
diff --git a/tests/compiler/dart2js_native/inference_of_helper_methods_test.dart b/tests/compiler/dart2js_native/inference_of_helper_methods_test.dart
index ef29951..3185f05 100644
--- a/tests/compiler/dart2js_native/inference_of_helper_methods_test.dart
+++ b/tests/compiler/dart2js_native/inference_of_helper_methods_test.dart
@@ -5,9 +5,9 @@
import 'native_testing.dart';
import 'dart:_js_helper' show intTypeCheck;
-bool get inCheckedMode {
+bool get inComplianceMode {
try {
- String a = 42;
+ String a = (42 as dynamic);
} on TypeError catch (e) {
return true;
}
@@ -25,7 +25,7 @@
// implementing checked mode semantics (like in the check below),
// the check won't fail at runtime.
intTypeCheck(42);
- if (inCheckedMode) {
+ if (inComplianceMode) {
int value;
Expect.throws(() => value = a[1], (e) => e is TypeError);
}
diff --git a/tests/compiler/dart2js_native/mirror_intercepted_field_test.dart b/tests/compiler/dart2js_native/mirror_intercepted_field_test.dart
deleted file mode 100644
index 4a3b337..0000000
--- a/tests/compiler/dart2js_native/mirror_intercepted_field_test.dart
+++ /dev/null
@@ -1,31 +0,0 @@
-// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-import 'dart:mirrors';
-import 'native_testing.dart';
-
-@Native("B")
-class B {
- // Having this field in a native class will generate accessors with
- // the interceptor calling convention.
- var f;
-}
-
-class A {
- int f;
-}
-
-const symF = const Symbol('f');
-
-main() {
- JS('B', '(null)'); // B appears to be created.
- var a = new A();
-
- InstanceMirror mirror = reflect(a);
- mirror.setField(symF, 42);
- Expect.equals(42, a.f);
-
- mirror = mirror.getField(symF);
- Expect.equals(42, mirror.reflectee);
-}
diff --git a/tests/compiler/dart2js_native/native_call_arity1_frog_test.dart b/tests/compiler/dart2js_native/native_call_arity1_frog_test.dart
index 09db0f2..f590001 100644
--- a/tests/compiler/dart2js_native/native_call_arity1_frog_test.dart
+++ b/tests/compiler/dart2js_native/native_call_arity1_frog_test.dart
@@ -66,17 +66,17 @@
A a = makeA();
B b = makeB();
- Expect.throws(() => a.foo());
+ Expect.throws(() => (a as dynamic).foo());
Expect.equals(1, a.foo(10));
- Expect.throws(() => a.foo(10, 20));
- Expect.throws(() => a.foo(10, 20, 30));
+ Expect.throws(() => (a as dynamic).foo(10, 20));
+ Expect.throws(() => (a as dynamic).foo(10, 20, 30));
Expect.equals(0, b.foo());
Expect.equals(1, b.foo(10));
Expect.equals(2, b.foo(10, 20));
Expect.equals(3, b.foo(10, 20, 30));
- Expect.throws(() => b.foo(10, 20, 30, 40));
+ Expect.throws(() => (b as dynamic).foo(10, 20, 30, 40));
}
main() {
diff --git a/tests/compiler/dart2js_native/native_call_arity2_frog_test.dart b/tests/compiler/dart2js_native/native_call_arity2_frog_test.dart
index f1289ff..1646809 100644
--- a/tests/compiler/dart2js_native/native_call_arity2_frog_test.dart
+++ b/tests/compiler/dart2js_native/native_call_arity2_frog_test.dart
@@ -78,20 +78,16 @@
Expect.equals(0, a.foo());
Expect.equals(1, a.foo(10));
Expect.equals(2, a.foo(10, 20));
- Expect.throws(() => a.foo(10, 20, 30));
Expect.equals(1, a.foo(10));
Expect.equals(2, a.foo(null, 20));
- Expect.throws(() => a.foo(10, 20, 30));
Expect.equals(0, b.foo());
Expect.equals(1, b.foo(10));
Expect.equals(2, b.foo(10, 20));
- Expect.throws(() => b.foo(10, 20, 30));
Expect.equals(1, b.foo(10));
Expect.equals(2, b.foo(null, 20));
- Expect.throws(() => b.foo(10, 20, 30));
}
main() {
diff --git a/tests/compiler/dart2js_native/native_call_arity3_frog_test.dart b/tests/compiler/dart2js_native/native_call_arity3_frog_test.dart
index cd7996b..3be4585 100644
--- a/tests/compiler/dart2js_native/native_call_arity3_frog_test.dart
+++ b/tests/compiler/dart2js_native/native_call_arity3_frog_test.dart
@@ -65,10 +65,7 @@
A a = makeA();
B b = makeB();
- Expect.throws(() => a.foo());
Expect.equals(1, a.foo(10));
- Expect.throws(() => a.foo(10, 20));
- Expect.throws(() => a.foo(10, 20, 30));
Expect.equals(0, b.foo());
Expect.equals(1, b.foo(10));
@@ -78,7 +75,6 @@
Expect.equals(1, b.foo(10));
Expect.equals(2, b.foo(null, 20));
Expect.equals(3, b.foo(null, null, 30));
- Expect.throws(() => b.foo(10, 20, 30, 40));
}
main() {
diff --git a/tests/compiler/dart2js_native/native_checked_arguments1_frog_test.dart b/tests/compiler/dart2js_native/native_checked_arguments1_frog_test.dart
index ef2d077..ddce60e 100644
--- a/tests/compiler/dart2js_native/native_checked_arguments1_frog_test.dart
+++ b/tests/compiler/dart2js_native/native_checked_arguments1_frog_test.dart
@@ -50,8 +50,8 @@
Expect.isTrue(threw);
}
-checkedModeTest() {
- var things = [makeA(), makeB()];
+complianceModeTest() {
+ var things = <dynamic>[makeA(), makeB()];
var a = things[0];
var b = things[1];
@@ -68,28 +68,10 @@
Expect.equals(1, b.cmp(b));
expectThrows(() => b.cmp(a));
expectThrows(() => b.cmp(5));
-
- // Check that we throw the same errors when the locals are typed.
- A aa = things[0];
- B bb = things[1];
-
- Expect.equals(124, aa.foo(123));
- expectThrows(() => aa.foo('xxx'));
-
- Expect.equals('helloha!', bb.foo('hello'));
- expectThrows(() => bb.foo(123));
-
- Expect.equals(0, aa.cmp(aa));
- expectThrows(() => aa.cmp(bb));
- expectThrows(() => aa.cmp(5));
-
- Expect.equals(1, bb.cmp(bb));
- expectThrows(() => bb.cmp(aa));
- expectThrows(() => bb.cmp(5));
}
-uncheckedModeTest() {
- var things = [makeA(), makeB()];
+omitImplicitChecksModeTest() {
+ var things = <dynamic>[makeA(), makeB()];
var a = things[0];
var b = things[1];
@@ -106,30 +88,12 @@
Expect.equals(1, b.cmp(b));
Expect.equals(1, b.cmp(a));
Expect.equals(1, b.cmp(5));
-
- // Check that we do not throw errors when the locals are typed.
- A aa = things[0];
- B bb = things[1];
-
- Expect.equals(124, aa.foo(123));
- Expect.equals('xxx1', aa.foo('xxx'));
-
- Expect.equals('helloha!', bb.foo('hello'));
- Expect.equals('123ha!', bb.foo(123));
-
- Expect.equals(0, aa.cmp(aa));
- Expect.equals(0, aa.cmp(bb));
- Expect.equals(0, aa.cmp(5));
-
- Expect.equals(1, bb.cmp(bb));
- Expect.equals(1, bb.cmp(aa));
- Expect.equals(1, bb.cmp(5));
}
-bool isCheckedMode() {
- var stuff = [1, 'string'];
- var a = stuff[0];
- // Checked-mode detection.
+bool isComplianceMode() {
+ var stuff = <dynamic>[1, 'string'];
+ dynamic a = stuff[0];
+ // compliance-mode detection.
try {
String s = a;
return false;
@@ -143,9 +107,9 @@
nativeTesting();
setup();
- if (isCheckedMode()) {
- checkedModeTest();
+ if (isComplianceMode()) {
+ complianceModeTest();
} else {
- uncheckedModeTest();
+ omitImplicitChecksModeTest();
}
}
diff --git a/tests/compiler/dart2js_native/native_checked_fields_frog_test.dart b/tests/compiler/dart2js_native/native_checked_fields_frog_test.dart
index ffc9d387..f9fdece 100644
--- a/tests/compiler/dart2js_native/native_checked_fields_frog_test.dart
+++ b/tests/compiler/dart2js_native/native_checked_fields_frog_test.dart
@@ -44,8 +44,8 @@
Expect.isTrue(threw);
}
-checkedModeTest() {
- var things = [makeA(), makeB()];
+complianceModeTest() {
+ var things = <dynamic>[makeA(), makeB()];
var a = things[0];
var b = things[1];
@@ -56,22 +56,10 @@
b.foo = 'hello';
expectThrows(() => b.foo = 123);
Expect.equals('hello', b.foo);
-
- // Check that we throw the same errors when the locals are typed.
- A aa = things[0];
- B bb = things[1];
-
- aa.foo = 124;
- expectThrows(() => aa.foo = 'xxx');
- Expect.equals(124, aa.foo);
-
- bb.foo = 'hello';
- expectThrows(() => bb.foo = 124);
- Expect.equals('hello', bb.foo);
}
-uncheckedModeTest() {
- var things = [makeA(), makeB()];
+omitImplicitChecksTest() {
+ var things = <dynamic>[makeA(), makeB()];
var a = things[0];
var b = things[1];
@@ -84,26 +72,12 @@
Expect.equals('hello', b.foo);
b.foo = 123;
Expect.equals(b.foo, 123);
-
- // Check that we do not throw errors when the locals are typed.
- A aa = things[0];
- B bb = things[1];
-
- aa.foo = 124;
- Expect.equals(124, aa.foo);
- a.foo = 'yyy';
- Expect.equals('yyy', a.foo);
-
- b.foo = 'hello';
- Expect.equals('hello', b.foo);
- b.foo = 124;
- Expect.equals(b.foo, 124);
}
-bool isCheckedMode() {
+bool isComplianceMode() {
var stuff = [1, 'string'];
var a = stuff[0];
- // Checked-mode detection.
+ // Detect whether we are using --omit-implicit-checks.
try {
String s = a;
return false;
@@ -117,9 +91,9 @@
nativeTesting();
setup();
- if (isCheckedMode()) {
- checkedModeTest();
+ if (isComplianceMode()) {
+ complianceModeTest();
} else {
- uncheckedModeTest();
+ omitImplicitChecksTest();
}
}
diff --git a/tests/compiler/dart2js_native/native_class_inheritance1_frog_test.dart b/tests/compiler/dart2js_native/native_class_inheritance1_frog_test.dart
index 3691959..322dcba 100644
--- a/tests/compiler/dart2js_native/native_class_inheritance1_frog_test.dart
+++ b/tests/compiler/dart2js_native/native_class_inheritance1_frog_test.dart
@@ -104,7 +104,7 @@
caught = false;
try {
- var x = 123;
+ dynamic x = 123;
x.foo(20);
} catch (ex) {
caught = true;
diff --git a/tests/compiler/dart2js_native/native_class_inheritance4_frog_test.dart b/tests/compiler/dart2js_native/native_class_inheritance4_frog_test.dart
index 6a2fff5..25f8fcd 100644
--- a/tests/compiler/dart2js_native/native_class_inheritance4_frog_test.dart
+++ b/tests/compiler/dart2js_native/native_class_inheritance4_frog_test.dart
@@ -111,7 +111,7 @@
testAB_dynamic() {
setup(); // Fresh constructors.
- var things = [makeA(), makeB()];
+ var things = <dynamic>[makeA(), makeB()];
var a = things[0];
var b = things[1];
diff --git a/tests/compiler/dart2js_native/native_class_is_check1_frog_test.dart b/tests/compiler/dart2js_native/native_class_is_check1_frog_test.dart
index 5034e0e..6b8bb37 100644
--- a/tests/compiler/dart2js_native/native_class_is_check1_frog_test.dart
+++ b/tests/compiler/dart2js_native/native_class_is_check1_frog_test.dart
@@ -8,7 +8,7 @@
abstract class I {
I read();
- write(I x);
+ write(covariant I x);
}
// Native implementation.
diff --git a/tests/compiler/dart2js_native/native_class_is_check3_frog_test.dart b/tests/compiler/dart2js_native/native_class_is_check3_frog_test.dart
index 850f25d..98cbf91 100644
--- a/tests/compiler/dart2js_native/native_class_is_check3_frog_test.dart
+++ b/tests/compiler/dart2js_native/native_class_is_check3_frog_test.dart
@@ -10,7 +10,7 @@
abstract class I extends J {
I read();
- write(I x);
+ write(covariant I x);
}
// Native implementation.
diff --git a/tests/compiler/dart2js_native/native_constructor_name_test.dart b/tests/compiler/dart2js_native/native_constructor_name_test.dart
index dbe9984..9d60a40 100644
--- a/tests/compiler/dart2js_native/native_constructor_name_test.dart
+++ b/tests/compiler/dart2js_native/native_constructor_name_test.dart
@@ -32,7 +32,7 @@
nativeTesting();
setup();
- var a = new A();
+ dynamic a = new A();
var z = makeZ();
Expect.equals(100, z.foo());
diff --git a/tests/compiler/dart2js_native/native_method_inlining_test.dart b/tests/compiler/dart2js_native/native_method_inlining_test.dart
index ac3be95..ec5e1ad 100644
--- a/tests/compiler/dart2js_native/native_method_inlining_test.dart
+++ b/tests/compiler/dart2js_native/native_method_inlining_test.dart
@@ -77,16 +77,6 @@
})()""");
}
-bool get isCheckedMode {
- int i = 0;
- try {
- i = 'a';
- } catch (e) {
- return true;
- }
- return false;
-}
-
void match(String s, String pattern1) {
var pattern2 = pattern1.replaceAll(' ', '');
Expect.isTrue(s.contains(pattern1) || s.contains(pattern2),
@@ -103,19 +93,11 @@
String method1 = findMethodTextContaining(new B(), '(Method1Tag)');
Expect.isNotNull(method1, 'No method found containing "(Method1Tag)"');
- if (isCheckedMode) {
- match(method1, r'foo()');
- // TODO: inlining in checked mode.
- nomatch(method1, r'foo(1)');
- // t1.foo$3(x, 3, 10, 30) or y.EL(z,3,10,30)
- match(method1, r', 3, 10, 30)');
- } else {
- // Direct (inlined) calls don't have $3 or minified names.
- match(method1, r'.foo()');
- match(method1, r'.foo(1)');
- match(method1, r'.foo(2, 10)');
- match(method1, r'.foo(3, 10, 30)');
- }
+ // Direct (inlined) calls don't have $3 or minified names.
+ match(method1, r'.foo()');
+ match(method1, r'.foo(1)');
+ match(method1, r'.foo(2, 10)');
+ match(method1, r'.foo(3, 10, 30)');
// Ensure the methods are compiled by calling them.
var a = makeA();
diff --git a/tests/compiler/dart2js_native/native_mirror_test.dart b/tests/compiler/dart2js_native/native_mirror_test.dart
deleted file mode 100644
index 99551c6..0000000
--- a/tests/compiler/dart2js_native/native_mirror_test.dart
+++ /dev/null
@@ -1,29 +0,0 @@
-// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-// Intercepted members need to be accessed in a different way than normal
-// members. In this test the native class A (thus being intercepted) has a
-// member "foo", that is final. Therefore only the getter needs to be
-// intercepted. Dart2js had a bug where it used the intercepted
-// calling-convention for parts of the compiler, and the non-intercepted
-// convention for others, making this fail.
-
-import 'native_testing.dart';
-import 'dart:_js_helper';
-import 'dart:mirrors';
-
-@Native("A")
-class A {
- final foo;
-}
-
-class B {
- String foo;
-}
-
-main() {
- var b = new B();
- reflect(b).setField(new Symbol("foo"), "bar");
- Expect.equals("bar", b.foo);
-}
diff --git a/tests/compiler/dart2js_native/native_missing_method1_frog_test.dart b/tests/compiler/dart2js_native/native_missing_method1_frog_test.dart
index 7cc54be..d0595f6 100644
--- a/tests/compiler/dart2js_native/native_missing_method1_frog_test.dart
+++ b/tests/compiler/dart2js_native/native_missing_method1_frog_test.dart
@@ -33,7 +33,7 @@
typedContext() {
confuse(new B()).foo();
- A a = makeA();
+ dynamic a = makeA();
Expect.throws(() => a.foo(), (e) => e is NoSuchMethodError);
Expect.throws(() => a.foo, (e) => e is NoSuchMethodError);
Expect.throws(() => a.foo = 4, (e) => e is NoSuchMethodError);
diff --git a/tests/compiler/dart2js_native/native_missing_method2_frog_test.dart b/tests/compiler/dart2js_native/native_missing_method2_frog_test.dart
index 13efaa9..ae5799f 100644
--- a/tests/compiler/dart2js_native/native_missing_method2_frog_test.dart
+++ b/tests/compiler/dart2js_native/native_missing_method2_frog_test.dart
@@ -33,8 +33,8 @@
}
}
-typedContext() {
- A a = makeA();
+inferredContext() {
+ dynamic a = makeA();
Expect.throws(() => a.foo(), (e) => e is NoSuchMethodError);
Expect.throws(() => a.foo, (e) => e is NoSuchMethodError);
Expect.throws(() => a.foo = 4, (e) => e is NoSuchMethodError);
@@ -52,6 +52,6 @@
setup();
confuse(new B()).foo();
confuse(new C()).foo(1);
- typedContext();
+ inferredContext();
untypedContext();
}
diff --git a/tests/compiler/dart2js_native/native_mixin_field_test.dart b/tests/compiler/dart2js_native/native_mixin_field_test.dart
index 1b6d9d9..7f1aebb 100644
--- a/tests/compiler/dart2js_native/native_mixin_field_test.dart
+++ b/tests/compiler/dart2js_native/native_mixin_field_test.dart
@@ -47,9 +47,9 @@
setup();
A a = makeA();
Expect.equals("A-foo", a.foo);
- Expect.throws(() => a.bar, (e) => e is NoSuchMethodError);
- Expect.throws(() => a.baz, (e) => e is NoSuchMethodError);
- Expect.throws(() => a.buz, (e) => e is NoSuchMethodError);
+ Expect.throws(() => (a as dynamic).bar, (e) => e is NoSuchMethodError);
+ Expect.throws(() => (a as dynamic).baz, (e) => e is NoSuchMethodError);
+ Expect.throws(() => (a as dynamic).buz, (e) => e is NoSuchMethodError);
B b = makeB();
Expect.equals("A-foo", b.foo);
@@ -59,14 +59,14 @@
Expect.isNull(b.buz);
M1 m1 = new M1();
- Expect.throws(() => m1.foo, (e) => e is NoSuchMethodError);
- Expect.throws(() => m1.bar, (e) => e is NoSuchMethodError);
+ Expect.throws(() => (m1 as dynamic).foo, (e) => e is NoSuchMethodError);
+ Expect.throws(() => (m1 as dynamic).bar, (e) => e is NoSuchMethodError);
Expect.isNull(m1.baz);
- Expect.throws(() => m1.buz, (e) => e is NoSuchMethodError);
+ Expect.throws(() => (m1 as dynamic).buz, (e) => e is NoSuchMethodError);
M2 m2 = new M2();
- Expect.throws(() => m2.foo, (e) => e is NoSuchMethodError);
+ Expect.throws(() => (m2 as dynamic).foo, (e) => e is NoSuchMethodError);
Expect.isNull(m2.bar);
- Expect.throws(() => m2.baz, (e) => e is NoSuchMethodError);
+ Expect.throws(() => (m2 as dynamic).baz, (e) => e is NoSuchMethodError);
Expect.isNull(m2.buz);
}
diff --git a/tests/compiler/dart2js_native/native_mixin_multiple_test.dart b/tests/compiler/dart2js_native/native_mixin_multiple_test.dart
index 2cbbb24..310d75b 100644
--- a/tests/compiler/dart2js_native/native_mixin_multiple_test.dart
+++ b/tests/compiler/dart2js_native/native_mixin_multiple_test.dart
@@ -47,7 +47,8 @@
setup();
A a = makeA();
Expect.equals("A-foo", a.foo());
- Expect.throws(() => a.bar(), (error) => error is NoSuchMethodError);
+ Expect.throws(
+ () => (a as dynamic).bar(), (error) => error is NoSuchMethodError);
Expect.equals("A-baz", a.baz());
Expect.isTrue(a is A);
Expect.isFalse(a is B);
@@ -65,7 +66,8 @@
M1 m1 = new M1();
Expect.equals("M1-foo", m1.foo());
- Expect.throws(() => m1.bar(), (error) => error is NoSuchMethodError);
+ Expect.throws(
+ () => (m1 as dynamic).bar(), (error) => error is NoSuchMethodError);
Expect.equals("M1-baz", m1.baz());
Expect.isFalse(m1 is A);
Expect.isFalse(m1 is B);
@@ -74,8 +76,10 @@
M2 m2 = new M2();
Expect.equals("M2-foo", m2.foo());
- Expect.throws(() => m2.bar(), (error) => error is NoSuchMethodError);
- Expect.throws(() => m2.baz(), (error) => error is NoSuchMethodError);
+ Expect.throws(
+ () => (m2 as dynamic).bar(), (error) => error is NoSuchMethodError);
+ Expect.throws(
+ () => (m2 as dynamic).baz(), (error) => error is NoSuchMethodError);
Expect.isFalse(m2 is A);
Expect.isFalse(m2 is B);
Expect.isFalse(m2 is M1);
diff --git a/tests/compiler/dart2js_native/native_mixin_test.dart b/tests/compiler/dart2js_native/native_mixin_test.dart
index e214185..64bd3e4 100644
--- a/tests/compiler/dart2js_native/native_mixin_test.dart
+++ b/tests/compiler/dart2js_native/native_mixin_test.dart
@@ -43,7 +43,8 @@
setup();
A a = makeA();
Expect.equals("A-foo", a.foo());
- Expect.throws(() => a.bar(), (error) => error is NoSuchMethodError);
+ Expect.throws(
+ () => (a as dynamic).bar(), (error) => error is NoSuchMethodError);
Expect.equals("A-baz", a.baz());
Expect.isTrue(a is A);
Expect.isFalse(a is B);
@@ -60,7 +61,8 @@
M m = new M();
Expect.equals("M-foo", m.foo());
Expect.equals("M-bar", m.bar());
- Expect.throws(() => m.baz(), (error) => error is NoSuchMethodError);
+ Expect.throws(
+ () => (m as dynamic).baz(), (error) => error is NoSuchMethodError);
Expect.isFalse(m is A);
Expect.isFalse(m is B);
Expect.isTrue(m is M);
diff --git a/tests/compiler/dart2js_native/native_no_such_method_exception3_frog_test.dart b/tests/compiler/dart2js_native/native_no_such_method_exception3_frog_test.dart
deleted file mode 100644
index 0459703..0000000
--- a/tests/compiler/dart2js_native/native_no_such_method_exception3_frog_test.dart
+++ /dev/null
@@ -1,56 +0,0 @@
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-import "dart:mirrors" show reflect;
-import "native_testing.dart";
-
-class GetName {
- foo(x, y, [z]) => "foo";
-}
-
-String getName(im) => reflect(new GetName()).delegate(im);
-
-@Native("A")
-class A {
- bar() => 42;
-}
-
-@Native("B")
-class B {
- foo() => 42;
-}
-
-class C {
- static create() => new C();
- noSuchMethod(x) => "${getName(x)}:${x.positionalArguments}";
-}
-
-makeA() native;
-
-setup() {
- JS('', r"""
-(function(){
- function A() {}
- makeA = function() { return new A(); };
-
- self.nativeConstructor(A);
-})()""");
-}
-
-main() {
- nativeTesting();
- setup();
- var a = makeA();
- a.bar();
- var exception;
- try {
- a.foo();
- } on NoSuchMethodError catch (e) {
- exception = e;
- }
- Expect.isNotNull(exception);
- var c = C.create();
- Expect.equals("foo:[1, 2]", c.foo(1, 2));
- Expect.equals("foo:[3, 4, 5]", c.foo(3, 4, 5));
-}
diff --git a/tests/compiler/dart2js_native/native_no_such_method_exception4_frog_test.dart b/tests/compiler/dart2js_native/native_no_such_method_exception4_frog_test.dart
deleted file mode 100644
index ad77c89..0000000
--- a/tests/compiler/dart2js_native/native_no_such_method_exception4_frog_test.dart
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-import "dart:mirrors" show reflect;
-import "native_testing.dart";
-
-class GetName {
- foo(x, y) => "foo";
- baz(x, y, z) => "baz";
-}
-
-String getName(im) => reflect(new GetName()).delegate(im);
-
-@Native("A")
-class A {
- bar() => 42;
- noSuchMethod(x) => "native(${getName(x)}:${x.positionalArguments})";
-}
-
-@Native("B")
-class B {
- baz() => 42;
-}
-
-makeA() native;
-
-setup() {
- JS('', r"""
-(function(){
- function A() {}
- makeA = function() { return new A(); };
- self.nativeConstructor(A);
-})()""");
-}
-
-main() {
- nativeTesting();
- setup();
- var a = makeA();
- a.bar();
- Expect.equals("native(foo:[1, 2])", a.foo(1, 2));
- Expect.equals("native(baz:[3, 4, 5])", a.baz(3, 4, 5));
-}
diff --git a/tests/compiler/dart2js_native/native_no_such_method_exception5_frog_test.dart b/tests/compiler/dart2js_native/native_no_such_method_exception5_frog_test.dart
deleted file mode 100644
index 2a2fd6b..0000000
--- a/tests/compiler/dart2js_native/native_no_such_method_exception5_frog_test.dart
+++ /dev/null
@@ -1,51 +0,0 @@
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-import "dart:mirrors" show reflect;
-import "native_testing.dart";
-
-class GetName {
- foo(x, [y]) => "foo";
- baz(x, y, z) => "baz";
-}
-
-String getName(im) => reflect(new GetName()).delegate(im);
-
-@Native("A")
-class A {
- bar() => 42;
- noSuchMethod(x) => "native(${getName(x)}:${x.positionalArguments})";
-}
-
-@Native("B")
-class B {
- baz() => 42;
-}
-
-class C {
- static create() => new C();
- noSuchMethod(x) => "${getName(x)}:${x.positionalArguments}";
-}
-
-makeA() native;
-
-setup() {
- JS('', r"""
-(function(){
- function A() {}
- makeA = function() { return new A(); };
- self.nativeConstructor(A);
-})()""");
-}
-
-main() {
- nativeTesting();
- setup();
- var a = makeA();
- a.bar();
- Expect.equals("native(foo:[1, 2])", a.foo(1, 2));
- Expect.equals("native(baz:[3, 4, 5])", a.baz(3, 4, 5));
- var c = C.create();
- Expect.equals("foo:[6]", c.foo(6));
-}
diff --git a/tests/compiler/dart2js_native/native_window1_frog_test.dart b/tests/compiler/dart2js_native/native_window1_frog_test.dart
index fd18641..f47b66d 100644
--- a/tests/compiler/dart2js_native/native_window1_frog_test.dart
+++ b/tests/compiler/dart2js_native/native_window1_frog_test.dart
@@ -15,7 +15,9 @@
final int document;
}
-class Win implements Window {}
+class Win implements Window {
+ noSuchMethod(m) => super.noSuchMethod(m);
+}
main() {
nativeTesting();
diff --git a/tests/compiler/dart2js_native/native_window2_frog_test.dart b/tests/compiler/dart2js_native/native_window2_frog_test.dart
index 77846c3..143c1e6 100644
--- a/tests/compiler/dart2js_native/native_window2_frog_test.dart
+++ b/tests/compiler/dart2js_native/native_window2_frog_test.dart
@@ -15,12 +15,14 @@
final int document;
}
-class Win implements Window {}
+class Win implements Window {
+ noSuchMethod(m) => super.noSuchMethod(m);
+}
main() {
nativeTesting();
// By not typing the variable, Frog does not try to optimize calls
// on it.
- var win = new Win();
+ dynamic win = new Win();
Expect.throws(() => win.document, (e) => e is NoSuchMethodError);
}
diff --git a/tests/compiler/dart2js_native/rti_only_native_test.dart b/tests/compiler/dart2js_native/rti_only_native_test.dart
index 172d0ba..ec2fa525 100644
--- a/tests/compiler/dart2js_native/rti_only_native_test.dart
+++ b/tests/compiler/dart2js_native/rti_only_native_test.dart
@@ -19,7 +19,7 @@
main() {
void foo(A x) {}
- var map = {'a': 0, 'b': main};
+ var map = <String, dynamic>{'a': 0, 'b': main};
try {
map.values.forEach((x) => x.rti_only_native_test_field);
} finally {
diff --git a/tests/compiler/dart2js_native/static_methods_test.dart b/tests/compiler/dart2js_native/static_methods_test.dart
index d8badec..d356c25 100644
--- a/tests/compiler/dart2js_native/static_methods_test.dart
+++ b/tests/compiler/dart2js_native/static_methods_test.dart
@@ -57,19 +57,14 @@
nativeTesting();
setup();
- // TODO(sra): Investigate why this line is necessary to get a correctly
- // compiled convertDartClosureToJS. Without this line, the compiler crashes.
- convertDartClosureToJS(main, 1);
-
Expect.equals(5, AA.foo("Hello"));
- Expect.equals(3, AA.bar((s) => s.length));
- Expect.equals(3, AA.baz((s) => s.length));
+ Expect.equals(3, AA.bar((String s) => s.length));
+ Expect.equals(3, AA.baz((String s) => s.length));
- Expect.equals(6, AA.lepton((s) => s.length));
- Expect.equals(6, AA.electron((s) => s.length));
+ Expect.equals(6, AA.lepton((String s) => s.length));
+ Expect.equals(6, AA.electron((String s) => s.length));
- Expect.equals(12, AA._baryon((s) => s.length));
- Expect.equals(12, AA.proton((s) => s.length));
- Expect.throws(() => AA.baryon((s) => s.length)); // Not defined on AA.
+ Expect.equals(12, AA._baryon((String s) => s.length));
+ Expect.equals(12, AA.proton((String s) => s.length));
}
diff --git a/tests/compiler/dart2js_native/type_error_decode_test.dart b/tests/compiler/dart2js_native/type_error_decode_test.dart
index 1c37f03..ba97210 100644
--- a/tests/compiler/dart2js_native/type_error_decode_test.dart
+++ b/tests/compiler/dart2js_native/type_error_decode_test.dart
@@ -34,18 +34,18 @@
}
main() {
- var x = null;
- var z = new Object();
- var v = new List(1)[0];
- var s = "Cannot call method 'foo' of null";
- var nul = null;
- var f = new Foo();
+ dynamic x = null;
+ dynamic z = new Object();
+ dynamic v = new List(1)[0];
+ dynamic s = "Cannot call method 'foo' of null";
+ dynamic nul = null;
+ dynamic f = new Foo();
expectThrows(() => x.fisk(), isNullError);
expectThrows(() => v.fisk(), isNullError);
expectThrows(() => z.fisk(), isJsNoSuchMethodError);
expectThrows(() => s.fisk(), isJsNoSuchMethodError);
- expectThrows(() => null(), isNullError);
+ expectThrows(() => (null as dynamic)(), isNullError);
expectThrows(() => f.field(), isNullError);
expectThrows(() => confuse(x).fisk(), isNullError);
diff --git a/tests/corelib_2/corelib_2.status b/tests/corelib_2/corelib_2.status
index 1683b0a..ee3a46a 100644
--- a/tests/corelib_2/corelib_2.status
+++ b/tests/corelib_2/corelib_2.status
@@ -251,7 +251,6 @@
main_test: RuntimeError
nan_infinity_test/01: RuntimeError
symbol_reserved_word_test/03: RuntimeError # Issue 19972, new Symbol('void') should be allowed.
-uri_base_test: Crash # RangeError (index): Invalid value: Valid value range is empty: 0
[ $compiler == dart2js && $fasta ]
bigint_test: CompileTimeError, OK # Error if web int literal cannot be represented exactly, see http://dartbug.com/33351
@@ -284,22 +283,6 @@
num_parse_test/none: CompileTimeError, OK # Error if web int literal cannot be represented exactly, see http://dartbug.com/33351
num_sign_test: CompileTimeError, OK # Error if web int literal cannot be represented exactly, see http://dartbug.com/33351
-[ $compiler == dart2js && $fasta && $host_checked && $strong ]
-error_stack_trace1_test: RuntimeError # Issue 12399
-growable_list_test: RuntimeError # Concurrent modifications test always runs
-integer_to_radix_string_test/01: RuntimeError
-integer_to_radix_string_test/02: RuntimeError
-integer_to_radix_string_test/none: RuntimeError
-integer_to_string_test/01: RuntimeError
-iterable_return_type_test/02: RuntimeError # Dart2js does not support Uint64*.
-list_concurrent_modify_test: RuntimeError # dart2js does not fully implement these
-list_unmodifiable_test: RuntimeError
-main_test: RuntimeError
-nan_infinity_test/01: RuntimeError
-regexp/pcre_test: RuntimeError
-symbol_reserved_word_test/03: RuntimeError # Issue 19972, new Symbol('void') should be allowed.
-uri_base_test: RuntimeError
-
[ $compiler == dart2js && $fasta && $minified && $strong ]
dynamic_nosuchmethod_test: RuntimeError
error_stack_trace1_test: RuntimeError # Issue 12399
@@ -327,6 +310,21 @@
[ $compiler == dart2js && !$fasta ]
*: SkipByDesign
+[ $compiler == dart2js && $strong ]
+error_stack_trace1_test: RuntimeError # Issue 12399
+growable_list_test: RuntimeError # Concurrent modifications test always runs
+integer_to_radix_string_test/01: RuntimeError
+integer_to_radix_string_test/02: RuntimeError
+integer_to_radix_string_test/none: RuntimeError
+integer_to_string_test/01: RuntimeError
+iterable_return_type_test/02: RuntimeError # Dart2js does not support Uint64*.
+list_concurrent_modify_test: RuntimeError # dart2js does not fully implement these
+list_unmodifiable_test: RuntimeError
+main_test: RuntimeError
+nan_infinity_test/01: RuntimeError
+regexp/pcre_test: RuntimeError
+symbol_reserved_word_test/03: RuntimeError # Issue 19972, new Symbol('void') should be allowed.
+
[ $compiler != dart2js && $fasta ]
bool_from_environment2_test/03: MissingCompileTimeError
string_from_environment3_test/03: MissingCompileTimeError
diff --git a/tests/kernel/kernel.status b/tests/kernel/kernel.status
index 7d79601..dea875e 100644
--- a/tests/kernel/kernel.status
+++ b/tests/kernel/kernel.status
@@ -11,7 +11,7 @@
[ !$fasta ]
unsorted/loop_test: Skip # This test uses optional new/const.
-[ $compiler != app_jitk && $compiler != dartk && $compiler != dartkp && $runtime != none ]
+[ $compiler != app_jitk && $compiler != dart2js && $compiler != dartk && $compiler != dartkp && $runtime != none ]
unsorted/types_test: RuntimeError
[ $compiler == dart2analyzer && $runtime == none ]
@@ -30,6 +30,9 @@
[ $compiler == dart2js && !$fasta ]
unsorted/super_mixin_test: CompileTimeError
+[ $compiler == dart2js && !$strong ]
+unsorted/types_test: RuntimeError
+
[ $compiler != dartk && $compiler != dartkp && !$strong ]
unsorted/invocation_errors_test/00: MissingCompileTimeError # This test has been tuned for dart 2.
diff --git a/tests/language/language.status b/tests/language/language.status
index ac2747f..037d325 100644
--- a/tests/language/language.status
+++ b/tests/language/language.status
@@ -18,6 +18,9 @@
regress_23408_test: RuntimeError
vm/regress_27201_test: Skip # Deferred loading happens eagerly.
+[ $mode == debug ]
+large_class_declaration_test: Slow, Pass
+
[ $mode == product ]
assertion_test: SkipByDesign # Requires checked mode.
generic_test: SkipByDesign # Requires checked mode.
diff --git a/tests/language/language_dart2js.status b/tests/language/language_dart2js.status
index 4c6c2c1..f21f652 100644
--- a/tests/language/language_dart2js.status
+++ b/tests/language/language_dart2js.status
@@ -242,9 +242,6 @@
f_bounded_quantification5_test: Fail, OK # Issue 12605
[ $compiler == dart2js && $fast_startup && $fasta ]
-constructor_redirect1_negative_test: Crash # Stack Overflow
-constructor_redirect2_negative_test: Crash # Stack Overflow
-cyclic_constructor_test/01: Crash # Stack Overflow
deferred_constraints_constants_test/none: Crash # Unsupported operation: KernelDeferredLoadTask.addMirrorElementsForLibrary
deferred_constraints_constants_test/reference_after_load: Crash # Unsupported operation: KernelDeferredLoadTask.addMirrorElementsForLibrary
internal_library_test/02: Crash # NoSuchMethodError: Class 'DillLibraryBuilder' has no instance getter 'mixinApplicationClasses'.
@@ -315,17 +312,13 @@
const_switch2_test/01: MissingCompileTimeError
const_switch_test/02: RuntimeError
const_switch_test/04: RuntimeError
-constants_test/05: MissingCompileTimeError
constructor2_test: RuntimeError
constructor3_test: RuntimeError
constructor5_test: RuntimeError
constructor6_test: RuntimeError
constructor_call_as_function_test/01: MissingRuntimeError
constructor_named_arguments_test/none: RuntimeError
-constructor_redirect1_negative_test: Crash # Issue 30856
-constructor_redirect2_negative_test: Crash # Issue 30856
constructor_redirect_test/01: Crash # Assertion failure: Cannot find value Instance of 'ThisLocal' in (local(A.named2#x), local(A.named2#y), local(A.named2#z)) for j:constructor(A.named2).
-cyclic_constructor_test/01: Crash # Issue 30856
deferred_constraints_constants_test/none: RuntimeError
deferred_constraints_constants_test/reference_after_load: RuntimeError
deferred_inheritance_constraints_test/extends: MissingCompileTimeError
@@ -500,12 +493,6 @@
mixin_supertype_subclass_test/05: CompileTimeError
mixin_supertype_subclass_test/none: CompileTimeError
modulo_test: RuntimeError
-multiline_newline_test/04: MissingCompileTimeError
-multiline_newline_test/04r: MissingCompileTimeError
-multiline_newline_test/05: MissingCompileTimeError
-multiline_newline_test/05r: MissingCompileTimeError
-multiline_newline_test/06: MissingCompileTimeError
-multiline_newline_test/06r: MissingCompileTimeError
named_constructor_test/01: MissingRuntimeError
named_parameters_default_eq_test/02: MissingCompileTimeError
nan_identical_test: RuntimeError
@@ -564,7 +551,6 @@
top_level_getter_no_setter1_test/01: RuntimeError
top_level_getter_no_setter2_test/01: RuntimeError
truncdiv_test: RuntimeError
-try_catch_test/01: MissingCompileTimeError
type_literal_prefix_call_test/00: RuntimeError
type_variable_conflict2_test/02: MissingCompileTimeError
@@ -583,8 +569,6 @@
number_identity_test: CompileTimeError
sync_generator2_test/41: Crash # 'file:*/pkg/compiler/lib/src/kernel/element_map_impl.dart': Failed assertion: line 939 pos 18: 'asyncMarker == AsyncMarker.SYNC': is not true.
sync_generator2_test/52: Crash # 'file:*/pkg/compiler/lib/src/kernel/element_map_impl.dart': Failed assertion: line 939 pos 18: 'asyncMarker == AsyncMarker.SYNC': is not true.
-syntax_test/21: Crash # 'file:*/pkg/compiler/lib/src/kernel/env.dart': Failed assertion: line 322 pos 16: '!name.contains('#')': is not true.
-syntax_test/22: Crash # 'file:*/pkg/compiler/lib/src/kernel/env.dart': Failed assertion: line 322 pos 16: '!name.contains('#')': is not true.
[ $compiler == dart2js && $fasta && $minified ]
arithmetic_test: CompileTimeError
@@ -683,12 +667,6 @@
multiline_newline_test/02r: CompileTimeError # Issue 23888
multiline_newline_test/03: CompileTimeError # Issue 23888
multiline_newline_test/03r: CompileTimeError # Issue 23888
-multiline_newline_test/04: MissingCompileTimeError # Issue 23888
-multiline_newline_test/04r: MissingCompileTimeError # Issue 23888
-multiline_newline_test/05: MissingCompileTimeError # Issue 23888
-multiline_newline_test/05r: MissingCompileTimeError # Issue 23888
-multiline_newline_test/06: MissingCompileTimeError # Issue 23888
-multiline_newline_test/06r: MissingCompileTimeError # Issue 23888
multiline_newline_test/none: RuntimeError # Issue 23888
nan_identical_test: Fail # Issue 11551
not_enough_positional_arguments_test/01: CompileTimeError # Issue 12838
diff --git a/tests/language/language_kernel.status b/tests/language/language_kernel.status
index 8c89d8c..ca82ca7 100644
--- a/tests/language/language_kernel.status
+++ b/tests/language/language_kernel.status
@@ -24,11 +24,7 @@
const_map2_test/00: MissingCompileTimeError
const_map3_test/00: MissingCompileTimeError
const_switch2_test/01: MissingCompileTimeError
-constants_test/05: MissingCompileTimeError
-constructor_redirect1_negative_test: Fail
-constructor_redirect2_negative_test: Fail
constructor_redirect_test/01: MissingCompileTimeError
-cyclic_constructor_test/01: MissingCompileTimeError
deferred_inheritance_constraints_test/extends: MissingCompileTimeError
deferred_inheritance_constraints_test/implements: MissingCompileTimeError
deferred_inheritance_constraints_test/mixin: MissingCompileTimeError
@@ -105,12 +101,6 @@
mixin_super_bound2_test/none: CompileTimeError
mixin_super_constructor_named_test/01: MissingCompileTimeError
mixin_super_constructor_positionals_test/01: MissingCompileTimeError
-multiline_newline_test/04: MissingCompileTimeError
-multiline_newline_test/04r: MissingCompileTimeError
-multiline_newline_test/05: MissingCompileTimeError
-multiline_newline_test/05r: MissingCompileTimeError
-multiline_newline_test/06: MissingCompileTimeError
-multiline_newline_test/06r: MissingCompileTimeError
named_parameters_default_eq_test/02: MissingCompileTimeError
override_field_method1_negative_test: Fail
override_field_method2_negative_test: Fail
@@ -138,7 +128,6 @@
switch_case_test/01: MissingCompileTimeError
switch_case_test/02: MissingCompileTimeError
syntax_test/none: CompileTimeError
-try_catch_test/01: MissingCompileTimeError
type_variable_conflict2_test/02: MissingCompileTimeError
vm/debug_break_enabled_vm_test/01: CompileTimeError
vm/debug_break_enabled_vm_test/none: CompileTimeError
@@ -157,6 +146,7 @@
const_syntax_test/05: MissingCompileTimeError
const_syntax_test/08: MissingCompileTimeError
const_syntax_test/10: MissingCompileTimeError
+constants_test/05: MissingCompileTimeError
constructor3_negative_test: Fail
constructor_call_wrong_argument_count_negative_test: Fail
deopt_inlined_function_lazy_test: CompileTimeError
@@ -172,6 +162,12 @@
int2_test: CompileTimeError
interface_static_non_final_fields_negative_test: Fail
mint_compares_test: CompileTimeError
+multiline_newline_test/04: MissingCompileTimeError
+multiline_newline_test/04r: MissingCompileTimeError
+multiline_newline_test/05: MissingCompileTimeError
+multiline_newline_test/05r: MissingCompileTimeError
+multiline_newline_test/06: MissingCompileTimeError
+multiline_newline_test/06r: MissingCompileTimeError
no_such_method_negative_test: Fail
number_identity_test: CompileTimeError
prefix10_negative_test: Fail
@@ -187,6 +183,7 @@
private_member2_negative_test: Fail
private_member3_negative_test: Fail
static_call_wrong_argument_count_negative_test: Fail
+try_catch_test/01: MissingCompileTimeError
type_variable_static_context_negative_test: Fail
unresolved_in_factory_negative_test: Fail
unresolved_top_level_method_negative_test: Fail
diff --git a/tests/language_2/language_2_analyzer.status b/tests/language_2/language_2_analyzer.status
index 73f540f..530aaec 100644
--- a/tests/language_2/language_2_analyzer.status
+++ b/tests/language_2/language_2_analyzer.status
@@ -3,270 +3,11 @@
# BSD-style license that can be found in the LICENSE file.
# Sections in this file should contain "$compiler == dart2analyzer".
-[ $compiler == dart2analyzer ]
-abstract_override_adds_optional_args_concrete_subclass_test: MissingCompileTimeError # Issue #30568
-abstract_override_adds_optional_args_concrete_test: MissingCompileTimeError # Issue #30568
-abstract_override_adds_optional_args_supercall_test: MissingCompileTimeError # Issue #30568
-bad_initializer2_negative_test: Fail # Issue 14880
-built_in_identifier_prefix_test: CompileTimeError
-built_in_identifier_type_annotation_test/dynamic-gen: MissingCompileTimeError # Issue 28813
-config_import_corelib_test: StaticWarning, OK
-conflicting_type_variable_and_setter_test: CompileTimeError # Issue 25525
-const_cast2_test/01: CompileTimeError
-const_cast2_test/none: CompileTimeError
-const_constructor_mixin3_test/01: MissingCompileTimeError # Issue 33644
-const_constructor_mixin_test/01: MissingCompileTimeError # Issue 33644
-const_for_in_variable_test/01: MissingCompileTimeError # Issue 25161
-constructor_call_wrong_argument_count_negative_test: Fail # Issue 11585
-constructor_type_parameter_test/00: MissingCompileTimeError # Issue 33110
-constructor_with_type_parameters_test/03: MissingCompileTimeError
-deep_nesting1_negative_test: CompileTimeError # Issue 25558
-deep_nesting2_negative_test: CompileTimeError # Issue 25558
-duplicate_export_negative_test: CompileTimeError
-duplicate_interface_negative_test: CompileTimeError
-emit_const_fields_test: CompileTimeError
-enum_syntax_test/05: Fail # Issue 21649
-enum_syntax_test/06: Fail # Issue 21649
-field3_test/01: MissingCompileTimeError # Issue 33022
-field3_test/02: MissingCompileTimeError # Issue 33022
-final_syntax_test/01: Fail # Issue 11124
-final_syntax_test/02: Fail # Issue 11124
-final_syntax_test/03: Fail # Issue 11124
-final_syntax_test/04: Fail # Issue 11124
-function_type_parameter2_negative_test: CompileTimeError
-function_type_parameter_negative_test: CompileTimeError
-generic_function_type_as_type_argument_test/02: MissingCompileTimeError # Issue 30929
-generic_local_functions_test: CompileTimeError # Issue 28515
-generic_methods_generic_function_parameter_test: CompileTimeError # Issue 28515
-generic_no_such_method_dispatcher_simple_test: Skip # This test is just for kernel.
-getter_declaration_negative_test: CompileTimeError
-getter_setter_in_lib_test: Fail # Issue 23286
-implicit_creation/implicit_const_context_constructor_generic_named_test: CompileTimeError
-implicit_creation/implicit_const_context_constructor_generic_test: CompileTimeError
-implicit_creation/implicit_const_context_prefix_constructor_generic_named_test: CompileTimeError
-implicit_creation/implicit_const_context_prefix_constructor_generic_test: CompileTimeError
-import_core_prefix_test: StaticWarning
-index_assign_operator_infer_return_type_test: StaticWarning
-initializing_formal_final_test: MissingCompileTimeError
-inst_field_initializer1_negative_test: CompileTimeError
-instance_call_wrong_argument_count_negative_test: Fail # Issue 11585
-instance_method2_negative_test: CompileTimeError
-instance_method_negative_test: CompileTimeError
-interface2_negative_test: CompileTimeError
-interface_injection1_negative_test: CompileTimeError
-interface_injection2_negative_test: CompileTimeError
-interface_static_method_negative_test: CompileTimeError
-interface_static_non_final_fields_negative_test: Fail # Issue 11594
-interface_test/00: MissingCompileTimeError
-invalid_type_argument_count_test/01: MissingCompileTimeError
-invalid_type_argument_count_test/02: MissingCompileTimeError
-invalid_type_argument_count_test/03: MissingCompileTimeError
-invalid_type_argument_count_test/04: MissingCompileTimeError
-is_not_class1_negative_test: CompileTimeError
-is_not_class4_negative_test: CompileTimeError
-issue1578_negative_test: CompileTimeError
-list_literal2_negative_test: CompileTimeError
-list_literal_negative_test: CompileTimeError
-map_literal_negative_test: CompileTimeError
-method_override7_test/03: Fail # Issue 11497
-method_override_test: CompileTimeError
-method_override_test: StaticWarning
-mixin_supertype_subclass2_test/02: MissingStaticWarning # Issue 25614
-mixin_supertype_subclass2_test/05: MissingStaticWarning # Issue 25614
-mixin_supertype_subclass3_test/02: MissingStaticWarning # Issue 25614
-mixin_supertype_subclass3_test/05: MissingStaticWarning # Issue 25614
-mixin_supertype_subclass4_test/01: MissingStaticWarning # Issue 25614
-mixin_supertype_subclass4_test/02: MissingStaticWarning # Issue 25614
-mixin_supertype_subclass4_test/03: MissingStaticWarning # Issue 25614
-mixin_supertype_subclass4_test/04: MissingStaticWarning # Issue 25614
-mixin_supertype_subclass4_test/05: MissingStaticWarning # Issue 25614
-mixin_supertype_subclass_test/02: MissingStaticWarning # Issue 25614
-mixin_supertype_subclass_test/05: MissingStaticWarning # Issue 25614
-mock_writable_final_private_field_test: CompileTimeError # Issue 30848
-nested_generic_closure_test: CompileTimeError
-new_expression1_negative_test: CompileTimeError
-new_expression2_negative_test: CompileTimeError
-new_expression3_negative_test: CompileTimeError
-no_main_test/01: Fail # Issue 20030
-no_such_constructor2_test: StaticWarning
-non_const_super_negative_test: CompileTimeError
-operator1_negative_test: CompileTimeError
-operator2_negative_test: CompileTimeError
-override_field_method1_negative_test: CompileTimeError
-override_field_method2_negative_test: CompileTimeError
-override_field_method4_negative_test: CompileTimeError
-override_field_method5_negative_test: CompileTimeError
-override_field_test/03: Fail # Issue 29703
-parameter_initializer1_negative_test: CompileTimeError
-parameter_initializer2_negative_test: CompileTimeError
-parameter_initializer3_negative_test: CompileTimeError
-parameter_initializer4_negative_test: CompileTimeError
-parameter_initializer6_negative_test: CompileTimeError
-part_of_multiple_libs_test/01: MissingCompileTimeError # Issue 33227
-part_refers_to_core_library_test/01: MissingCompileTimeError # Issue 29709
-prefix_shadow_test/01: MissingCompileTimeError # Issue 33005
-private_member1_negative_test: Fail # Issue 14021
-private_member2_negative_test: Fail # Issue 14021
-private_member3_negative_test: Fail # Issue 14021
-regress_23408_test: Skip # don't care about the static warning.
-regress_27617_test/1: MissingCompileTimeError
-regress_29025_test: CompileTimeError # Issue 29081
-regress_29349_test: CompileTimeError # Issue 29744
-regress_29405_test: CompileTimeError # Issue 29421
-regress_29784_test/02: MissingCompileTimeError # Issue 29784
-reify_typevar_static_test/00: MissingCompileTimeError # Issue 21565
-script1_negative_test: CompileTimeError
-script2_negative_test: CompileTimeError
-setter_declaration2_negative_test: CompileTimeError
-setter_declaration_negative_test: CompileTimeError
-source_self_negative_test: CompileTimeError
-static_call_wrong_argument_count_negative_test: Fail # Issue 12156
-string_escape4_negative_test: CompileTimeError
-string_interpolate1_negative_test: CompileTimeError
-string_interpolate2_negative_test: CompileTimeError
-super_call4_test/01: MissingCompileTimeError
-super_setter_test: StaticWarning
-switch1_negative_test: CompileTimeError
-switch3_negative_test: CompileTimeError
-switch4_negative_test: CompileTimeError
-switch5_negative_test: CompileTimeError
-switch7_negative_test: CompileTimeError
-test_negative_test: CompileTimeError
-try_catch_on_syntax_test/10: MissingCompileTimeError
-try_catch_on_syntax_test/11: MissingCompileTimeError
-type_inference_inconsistent_inheritance_test: MissingCompileTimeError
-type_variable_scope_test/none: Fail # Issue 11578
-type_variable_static_context_negative_test: Fail # Issue 12161
-vm/debug_break_enabled_vm_test: Skip
-vm/debug_break_vm_test/*: Skip
-vm/lazy_deopt_with_exception_test: Pass
-vm/reflect_core_vm_test: CompileTimeError
-vm/regress_27201_test: SkipByDesign # Loads bad library, so will always crash.
-vm/regress_33469_test/01: Crash # http://dartbug.com/33481
-vm/regress_33469_test/02: Crash # http://dartbug.com/33481
-vm/regress_33469_test/03: MissingCompileTimeError # http://dartbug.com/33481
-void_type_override_test/00: MissingCompileTimeError
-void_type_override_test/00b: MissingCompileTimeError
-void_type_override_test/01: MissingCompileTimeError
-void_type_override_test/02: MissingCompileTimeError
-void_type_override_test/03: MissingCompileTimeError
-void_type_usage_test/call_conditional: MissingCompileTimeError
-void_type_usage_test/call_literal_list_init: MissingCompileTimeError
-void_type_usage_test/call_literal_map_key_init: MissingCompileTimeError
-void_type_usage_test/call_literal_map_value_init: MissingCompileTimeError
-void_type_usage_test/call_return: MissingCompileTimeError
-void_type_usage_test/call_void_init: MissingCompileTimeError
-void_type_usage_test/conditional2_conditional: MissingCompileTimeError
-void_type_usage_test/conditional2_for: MissingCompileTimeError
-void_type_usage_test/conditional2_literal_list_init: MissingCompileTimeError
-void_type_usage_test/conditional2_literal_map_value_init: MissingCompileTimeError
-void_type_usage_test/conditional2_null_equals2: MissingCompileTimeError
-void_type_usage_test/conditional2_parens: MissingCompileTimeError
-void_type_usage_test/conditional2_return: MissingCompileTimeError
-void_type_usage_test/conditional2_return_to_void: MissingCompileTimeError
-void_type_usage_test/conditional2_stmt: MissingCompileTimeError
-void_type_usage_test/conditional2_void_init: MissingCompileTimeError
-void_type_usage_test/conditional3_conditional: MissingCompileTimeError
-void_type_usage_test/conditional3_for: MissingCompileTimeError
-void_type_usage_test/conditional3_literal_list_init: MissingCompileTimeError
-void_type_usage_test/conditional3_literal_map_value_init: MissingCompileTimeError
-void_type_usage_test/conditional3_null_equals2: MissingCompileTimeError
-void_type_usage_test/conditional3_parens: MissingCompileTimeError
-void_type_usage_test/conditional3_return: MissingCompileTimeError
-void_type_usage_test/conditional3_return_to_void: MissingCompileTimeError
-void_type_usage_test/conditional3_stmt: MissingCompileTimeError
-void_type_usage_test/conditional3_void_init: MissingCompileTimeError
-void_type_usage_test/conditional_conditional: MissingCompileTimeError
-void_type_usage_test/conditional_for: MissingCompileTimeError
-void_type_usage_test/conditional_literal_list_init: MissingCompileTimeError
-void_type_usage_test/conditional_literal_map_value_init: MissingCompileTimeError
-void_type_usage_test/conditional_null_equals2: MissingCompileTimeError
-void_type_usage_test/conditional_parens: MissingCompileTimeError
-void_type_usage_test/conditional_return: MissingCompileTimeError
-void_type_usage_test/conditional_return_to_void: MissingCompileTimeError
-void_type_usage_test/conditional_stmt: MissingCompileTimeError
-void_type_usage_test/conditional_void_init: MissingCompileTimeError
-void_type_usage_test/final_local_conditional: MissingCompileTimeError
-void_type_usage_test/final_local_for_in2: MissingCompileTimeError
-void_type_usage_test/final_local_literal_list_init: MissingCompileTimeError
-void_type_usage_test/final_local_literal_map_key_init: MissingCompileTimeError
-void_type_usage_test/final_local_literal_map_value_init: MissingCompileTimeError
-void_type_usage_test/final_local_return: MissingCompileTimeError
-void_type_usage_test/final_local_void_init: MissingCompileTimeError
-void_type_usage_test/global_conditional: MissingCompileTimeError
-void_type_usage_test/global_literal_list_init: MissingCompileTimeError
-void_type_usage_test/global_literal_map_key_init: MissingCompileTimeError
-void_type_usage_test/global_literal_map_value_init: MissingCompileTimeError
-void_type_usage_test/global_return: MissingCompileTimeError
-void_type_usage_test/global_void_init: MissingCompileTimeError
-void_type_usage_test/instance2_conditional: MissingCompileTimeError
-void_type_usage_test/instance2_for_in2: MissingCompileTimeError
-void_type_usage_test/instance2_literal_list_init: MissingCompileTimeError
-void_type_usage_test/instance2_literal_map_key_init: MissingCompileTimeError
-void_type_usage_test/instance2_literal_map_value_init: MissingCompileTimeError
-void_type_usage_test/instance2_return: MissingCompileTimeError
-void_type_usage_test/instance2_void_init: MissingCompileTimeError
-void_type_usage_test/instance3_conditional: MissingCompileTimeError
-void_type_usage_test/instance3_for_in2: MissingCompileTimeError
-void_type_usage_test/instance3_literal_list_init: MissingCompileTimeError
-void_type_usage_test/instance3_literal_map_key_init: MissingCompileTimeError
-void_type_usage_test/instance3_literal_map_value_init: MissingCompileTimeError
-void_type_usage_test/instance3_return: MissingCompileTimeError
-void_type_usage_test/instance3_void_init: MissingCompileTimeError
-void_type_usage_test/instance_conditional: MissingCompileTimeError
-void_type_usage_test/instance_literal_list_init: MissingCompileTimeError
-void_type_usage_test/instance_literal_map_key_init: MissingCompileTimeError
-void_type_usage_test/instance_literal_map_value_init: MissingCompileTimeError
-void_type_usage_test/instance_return: MissingCompileTimeError
-void_type_usage_test/instance_void_init: MissingCompileTimeError
-void_type_usage_test/local_conditional: MissingCompileTimeError
-void_type_usage_test/local_literal_list_init: MissingCompileTimeError
-void_type_usage_test/local_literal_map_key_init: MissingCompileTimeError
-void_type_usage_test/local_literal_map_value_init: MissingCompileTimeError
-void_type_usage_test/local_return: MissingCompileTimeError
-void_type_usage_test/local_void_init: MissingCompileTimeError
-void_type_usage_test/param_conditional: MissingCompileTimeError
-void_type_usage_test/param_literal_list_init: MissingCompileTimeError
-void_type_usage_test/param_literal_map_key_init: MissingCompileTimeError
-void_type_usage_test/param_literal_map_value_init: MissingCompileTimeError
-void_type_usage_test/param_return: MissingCompileTimeError
-void_type_usage_test/param_void_init: MissingCompileTimeError
-void_type_usage_test/paren_conditional: MissingCompileTimeError
-void_type_usage_test/paren_literal_list_init: MissingCompileTimeError
-void_type_usage_test/paren_literal_map_key_init: MissingCompileTimeError
-void_type_usage_test/paren_literal_map_value_init: MissingCompileTimeError
-void_type_usage_test/paren_return: MissingCompileTimeError
-void_type_usage_test/paren_void_init: MissingCompileTimeError
-web_int_literals_test/01: MissingCompileTimeError
-web_int_literals_test/02: MissingCompileTimeError
-web_int_literals_test/03: MissingCompileTimeError
-web_int_literals_test/10: MissingCompileTimeError
-web_int_literals_test/11: MissingCompileTimeError
-web_int_literals_test/12: MissingCompileTimeError
-web_int_literals_test/13: MissingCompileTimeError
-web_int_literals_test/14: MissingCompileTimeError
-web_int_literals_test/20: MissingCompileTimeError
-web_int_literals_test/21: MissingCompileTimeError
-web_int_literals_test/22: MissingCompileTimeError
-web_int_literals_test/23: MissingCompileTimeError
-web_int_literals_test/24: MissingCompileTimeError
-web_int_literals_test/25: MissingCompileTimeError
-web_int_literals_test/26: MissingCompileTimeError
-web_int_literals_test/27: MissingCompileTimeError
-web_int_literals_test/28: MissingCompileTimeError
-web_int_literals_test/29: MissingCompileTimeError
-web_int_literals_test/61: MissingCompileTimeError
-web_int_literals_test/62: MissingCompileTimeError
-web_int_literals_test/63: MissingCompileTimeError
-web_int_literals_test/64: MissingCompileTimeError
-web_int_literals_test/65: MissingCompileTimeError
-web_int_literals_test/70: MissingCompileTimeError
-
-[ $compiler == dart2analyzer && $runtime == none ]
+[ $compiler == dart2analyzer && $runtime == none && !$fasta ]
error_stacktrace_test/00: MissingCompileTimeError
vm/lazy_deopt_with_exception_test: CompileTimeError
-[ $compiler == dart2analyzer && $checked && !$strong ]
+[ $compiler == dart2analyzer && $checked && !$fasta && !$strong ]
abstract_beats_arguments_test: MissingCompileTimeError
abstract_exact_selector_test/01: MissingCompileTimeError
abstract_factory_constructor_test/00: MissingCompileTimeError
@@ -359,7 +100,6 @@
deferred_inheritance_constraints_test/redirecting_constructor: MissingCompileTimeError
dynamic_field_test/01: MissingCompileTimeError
dynamic_field_test/02: MissingCompileTimeError
-dynamic_prefix_core_test/01: MissingCompileTimeError
emit_const_fields_test: Pass
empty_block_case_test: MissingCompileTimeError
enum_private_test/02: MissingCompileTimeError
@@ -641,7 +381,7 @@
type_variable_static_context_test: MissingCompileTimeError
unresolved_in_factory_test: MissingCompileTimeError
-[ $compiler == dart2analyzer && !$checked && !$strong ]
+[ $compiler == dart2analyzer && !$checked && !$fasta && !$strong ]
abstract_beats_arguments_test: MissingCompileTimeError
abstract_exact_selector_test/01: MissingCompileTimeError
abstract_factory_constructor_test/00: MissingCompileTimeError
@@ -758,7 +498,6 @@
deferred_inheritance_constraints_test/redirecting_constructor: MissingCompileTimeError
dynamic_field_test/01: MissingCompileTimeError
dynamic_field_test/02: MissingCompileTimeError
-dynamic_prefix_core_test/01: MissingCompileTimeError
emit_const_fields_test: Pass
empty_block_case_test: MissingCompileTimeError
enum_private_test/02: MissingCompileTimeError
@@ -1086,7 +825,269 @@
type_variable_static_context_test: MissingCompileTimeError
unresolved_in_factory_test: MissingCompileTimeError
-[ $compiler == dart2analyzer && !$preview_dart_2 ]
+[ $compiler == dart2analyzer && !$fasta ]
+abstract_override_adds_optional_args_concrete_subclass_test: MissingCompileTimeError # Issue #30568
+abstract_override_adds_optional_args_concrete_test: MissingCompileTimeError # Issue #30568
+abstract_override_adds_optional_args_supercall_test: MissingCompileTimeError # Issue #30568
+bad_initializer2_negative_test: Fail # Issue 14880
+built_in_identifier_prefix_test: CompileTimeError
+built_in_identifier_type_annotation_test/dynamic-gen: MissingCompileTimeError # Issue 28813
+config_import_corelib_test: StaticWarning, OK
+conflicting_type_variable_and_setter_test: CompileTimeError # Issue 25525
+const_cast2_test/01: CompileTimeError
+const_cast2_test/none: CompileTimeError
+const_constructor_mixin3_test/01: MissingCompileTimeError # Issue 33644
+const_constructor_mixin_test/01: MissingCompileTimeError # Issue 33644
+const_for_in_variable_test/01: MissingCompileTimeError # Issue 25161
+constructor_call_wrong_argument_count_negative_test: Fail # Issue 11585
+constructor_type_parameter_test/00: MissingCompileTimeError # Issue 33110
+constructor_with_type_parameters_test/03: MissingCompileTimeError
+deep_nesting1_negative_test: CompileTimeError # Issue 25558
+deep_nesting2_negative_test: CompileTimeError # Issue 25558
+duplicate_export_negative_test: CompileTimeError
+duplicate_interface_negative_test: CompileTimeError
+dynamic_prefix_core_test/01: MissingCompileTimeError
+emit_const_fields_test: CompileTimeError
+enum_syntax_test/05: Fail # Issue 21649
+enum_syntax_test/06: Fail # Issue 21649
+field3_test/01: MissingCompileTimeError # Issue 33022
+field3_test/02: MissingCompileTimeError # Issue 33022
+final_syntax_test/01: Fail # Issue 11124
+final_syntax_test/02: Fail # Issue 11124
+final_syntax_test/03: Fail # Issue 11124
+final_syntax_test/04: Fail # Issue 11124
+function_type_parameter2_negative_test: CompileTimeError
+function_type_parameter_negative_test: CompileTimeError
+generic_function_type_as_type_argument_test/02: MissingCompileTimeError # Issue 30929
+generic_local_functions_test: CompileTimeError # Issue 28515
+generic_methods_generic_function_parameter_test: CompileTimeError # Issue 28515
+generic_no_such_method_dispatcher_simple_test: Skip # This test is just for kernel.
+getter_declaration_negative_test: CompileTimeError
+getter_setter_in_lib_test: Fail # Issue 23286
+implicit_creation/implicit_const_context_constructor_generic_named_test: CompileTimeError
+implicit_creation/implicit_const_context_constructor_generic_test: CompileTimeError
+implicit_creation/implicit_const_context_prefix_constructor_generic_named_test: CompileTimeError
+implicit_creation/implicit_const_context_prefix_constructor_generic_test: CompileTimeError
+index_assign_operator_infer_return_type_test: StaticWarning
+initializing_formal_final_test: MissingCompileTimeError
+inst_field_initializer1_negative_test: CompileTimeError
+instance_call_wrong_argument_count_negative_test: Fail # Issue 11585
+instance_method2_negative_test: CompileTimeError
+instance_method_negative_test: CompileTimeError
+interface2_negative_test: CompileTimeError
+interface_injection1_negative_test: CompileTimeError
+interface_injection2_negative_test: CompileTimeError
+interface_static_method_negative_test: CompileTimeError
+interface_static_non_final_fields_negative_test: Fail # Issue 11594
+interface_test/00: MissingCompileTimeError
+invalid_type_argument_count_test/01: MissingCompileTimeError
+invalid_type_argument_count_test/02: MissingCompileTimeError
+invalid_type_argument_count_test/03: MissingCompileTimeError
+invalid_type_argument_count_test/04: MissingCompileTimeError
+is_not_class1_negative_test: CompileTimeError
+is_not_class4_negative_test: CompileTimeError
+issue1578_negative_test: CompileTimeError
+list_literal2_negative_test: CompileTimeError
+list_literal_negative_test: CompileTimeError
+map_literal_negative_test: CompileTimeError
+method_override7_test/03: Fail # Issue 11497
+method_override_test: CompileTimeError
+method_override_test: StaticWarning
+mixin_supertype_subclass2_test/02: MissingStaticWarning # Issue 25614
+mixin_supertype_subclass2_test/05: MissingStaticWarning # Issue 25614
+mixin_supertype_subclass3_test/02: MissingStaticWarning # Issue 25614
+mixin_supertype_subclass3_test/05: MissingStaticWarning # Issue 25614
+mixin_supertype_subclass4_test/01: MissingStaticWarning # Issue 25614
+mixin_supertype_subclass4_test/02: MissingStaticWarning # Issue 25614
+mixin_supertype_subclass4_test/03: MissingStaticWarning # Issue 25614
+mixin_supertype_subclass4_test/04: MissingStaticWarning # Issue 25614
+mixin_supertype_subclass4_test/05: MissingStaticWarning # Issue 25614
+mixin_supertype_subclass_test/02: MissingStaticWarning # Issue 25614
+mixin_supertype_subclass_test/05: MissingStaticWarning # Issue 25614
+mock_writable_final_private_field_test: CompileTimeError # Issue 30848
+nested_generic_closure_test: CompileTimeError
+new_expression1_negative_test: CompileTimeError
+new_expression2_negative_test: CompileTimeError
+new_expression3_negative_test: CompileTimeError
+no_main_test/01: Fail # Issue 20030
+no_such_constructor2_test: StaticWarning
+non_const_super_negative_test: CompileTimeError
+operator1_negative_test: CompileTimeError
+operator2_negative_test: CompileTimeError
+override_field_method1_negative_test: CompileTimeError
+override_field_method2_negative_test: CompileTimeError
+override_field_method4_negative_test: CompileTimeError
+override_field_method5_negative_test: CompileTimeError
+override_field_test/03: Fail # Issue 29703
+parameter_initializer1_negative_test: CompileTimeError
+parameter_initializer2_negative_test: CompileTimeError
+parameter_initializer3_negative_test: CompileTimeError
+parameter_initializer4_negative_test: CompileTimeError
+parameter_initializer6_negative_test: CompileTimeError
+part_of_multiple_libs_test/01: MissingCompileTimeError # Issue 33227
+part_refers_to_core_library_test/01: MissingCompileTimeError # Issue 29709
+prefix_shadow_test/01: MissingCompileTimeError # Issue 33005
+private_member1_negative_test: Fail # Issue 14021
+private_member2_negative_test: Fail # Issue 14021
+private_member3_negative_test: Fail # Issue 14021
+regress_23408_test: Skip # don't care about the static warning.
+regress_27617_test/1: MissingCompileTimeError
+regress_29025_test: CompileTimeError # Issue 29081
+regress_29349_test: CompileTimeError # Issue 29744
+regress_29405_test: CompileTimeError # Issue 29421
+regress_29784_test/02: MissingCompileTimeError # Issue 29784
+reify_typevar_static_test/00: MissingCompileTimeError # Issue 21565
+script1_negative_test: CompileTimeError
+script2_negative_test: CompileTimeError
+setter_declaration2_negative_test: CompileTimeError
+setter_declaration_negative_test: CompileTimeError
+source_self_negative_test: CompileTimeError
+static_call_wrong_argument_count_negative_test: Fail # Issue 12156
+static_setter_conflicts_test/02: MissingCompileTimeError
+static_setter_conflicts_test/11: MissingCompileTimeError
+static_setter_conflicts_test/12: MissingCompileTimeError
+string_escape4_negative_test: CompileTimeError
+string_interpolate1_negative_test: CompileTimeError
+string_interpolate2_negative_test: CompileTimeError
+super_call4_test/01: MissingCompileTimeError
+super_setter_test: StaticWarning
+switch1_negative_test: CompileTimeError
+switch3_negative_test: CompileTimeError
+switch4_negative_test: CompileTimeError
+switch5_negative_test: CompileTimeError
+switch7_negative_test: CompileTimeError
+test_negative_test: CompileTimeError
+try_catch_on_syntax_test/10: MissingCompileTimeError
+try_catch_on_syntax_test/11: MissingCompileTimeError
+type_inference_inconsistent_inheritance_test: MissingCompileTimeError
+type_variable_scope_test/none: Fail # Issue 11578
+type_variable_static_context_negative_test: Fail # Issue 12161
+vm/debug_break_enabled_vm_test: Skip
+vm/debug_break_vm_test/*: Skip
+vm/lazy_deopt_with_exception_test: Pass
+vm/reflect_core_vm_test: CompileTimeError
+vm/regress_27201_test: SkipByDesign # Loads bad library, so will always crash.
+vm/regress_33469_test/01: Crash # http://dartbug.com/33481
+vm/regress_33469_test/02: Crash # http://dartbug.com/33481
+vm/regress_33469_test/03: MissingCompileTimeError # http://dartbug.com/33481
+void_type_override_test/00: MissingCompileTimeError
+void_type_override_test/00b: MissingCompileTimeError
+void_type_override_test/01: MissingCompileTimeError
+void_type_override_test/02: MissingCompileTimeError
+void_type_override_test/03: MissingCompileTimeError
+void_type_usage_test/call_conditional: MissingCompileTimeError
+void_type_usage_test/call_literal_list_init: MissingCompileTimeError
+void_type_usage_test/call_literal_map_key_init: MissingCompileTimeError
+void_type_usage_test/call_literal_map_value_init: MissingCompileTimeError
+void_type_usage_test/call_return: MissingCompileTimeError
+void_type_usage_test/call_void_init: MissingCompileTimeError
+void_type_usage_test/conditional2_conditional: MissingCompileTimeError
+void_type_usage_test/conditional2_for: MissingCompileTimeError
+void_type_usage_test/conditional2_literal_list_init: MissingCompileTimeError
+void_type_usage_test/conditional2_literal_map_value_init: MissingCompileTimeError
+void_type_usage_test/conditional2_null_equals2: MissingCompileTimeError
+void_type_usage_test/conditional2_parens: MissingCompileTimeError
+void_type_usage_test/conditional2_return: MissingCompileTimeError
+void_type_usage_test/conditional2_return_to_void: MissingCompileTimeError
+void_type_usage_test/conditional2_stmt: MissingCompileTimeError
+void_type_usage_test/conditional2_void_init: MissingCompileTimeError
+void_type_usage_test/conditional3_conditional: MissingCompileTimeError
+void_type_usage_test/conditional3_for: MissingCompileTimeError
+void_type_usage_test/conditional3_literal_list_init: MissingCompileTimeError
+void_type_usage_test/conditional3_literal_map_value_init: MissingCompileTimeError
+void_type_usage_test/conditional3_null_equals2: MissingCompileTimeError
+void_type_usage_test/conditional3_parens: MissingCompileTimeError
+void_type_usage_test/conditional3_return: MissingCompileTimeError
+void_type_usage_test/conditional3_return_to_void: MissingCompileTimeError
+void_type_usage_test/conditional3_stmt: MissingCompileTimeError
+void_type_usage_test/conditional3_void_init: MissingCompileTimeError
+void_type_usage_test/conditional_conditional: MissingCompileTimeError
+void_type_usage_test/conditional_for: MissingCompileTimeError
+void_type_usage_test/conditional_literal_list_init: MissingCompileTimeError
+void_type_usage_test/conditional_literal_map_value_init: MissingCompileTimeError
+void_type_usage_test/conditional_null_equals2: MissingCompileTimeError
+void_type_usage_test/conditional_parens: MissingCompileTimeError
+void_type_usage_test/conditional_return: MissingCompileTimeError
+void_type_usage_test/conditional_return_to_void: MissingCompileTimeError
+void_type_usage_test/conditional_stmt: MissingCompileTimeError
+void_type_usage_test/conditional_void_init: MissingCompileTimeError
+void_type_usage_test/final_local_conditional: MissingCompileTimeError
+void_type_usage_test/final_local_for_in2: MissingCompileTimeError
+void_type_usage_test/final_local_literal_list_init: MissingCompileTimeError
+void_type_usage_test/final_local_literal_map_key_init: MissingCompileTimeError
+void_type_usage_test/final_local_literal_map_value_init: MissingCompileTimeError
+void_type_usage_test/final_local_return: MissingCompileTimeError
+void_type_usage_test/final_local_void_init: MissingCompileTimeError
+void_type_usage_test/global_conditional: MissingCompileTimeError
+void_type_usage_test/global_literal_list_init: MissingCompileTimeError
+void_type_usage_test/global_literal_map_key_init: MissingCompileTimeError
+void_type_usage_test/global_literal_map_value_init: MissingCompileTimeError
+void_type_usage_test/global_return: MissingCompileTimeError
+void_type_usage_test/global_void_init: MissingCompileTimeError
+void_type_usage_test/instance2_conditional: MissingCompileTimeError
+void_type_usage_test/instance2_for_in2: MissingCompileTimeError
+void_type_usage_test/instance2_literal_list_init: MissingCompileTimeError
+void_type_usage_test/instance2_literal_map_key_init: MissingCompileTimeError
+void_type_usage_test/instance2_literal_map_value_init: MissingCompileTimeError
+void_type_usage_test/instance2_return: MissingCompileTimeError
+void_type_usage_test/instance2_void_init: MissingCompileTimeError
+void_type_usage_test/instance3_conditional: MissingCompileTimeError
+void_type_usage_test/instance3_for_in2: MissingCompileTimeError
+void_type_usage_test/instance3_literal_list_init: MissingCompileTimeError
+void_type_usage_test/instance3_literal_map_key_init: MissingCompileTimeError
+void_type_usage_test/instance3_literal_map_value_init: MissingCompileTimeError
+void_type_usage_test/instance3_return: MissingCompileTimeError
+void_type_usage_test/instance3_void_init: MissingCompileTimeError
+void_type_usage_test/instance_conditional: MissingCompileTimeError
+void_type_usage_test/instance_literal_list_init: MissingCompileTimeError
+void_type_usage_test/instance_literal_map_key_init: MissingCompileTimeError
+void_type_usage_test/instance_literal_map_value_init: MissingCompileTimeError
+void_type_usage_test/instance_return: MissingCompileTimeError
+void_type_usage_test/instance_void_init: MissingCompileTimeError
+void_type_usage_test/local_conditional: MissingCompileTimeError
+void_type_usage_test/local_literal_list_init: MissingCompileTimeError
+void_type_usage_test/local_literal_map_key_init: MissingCompileTimeError
+void_type_usage_test/local_literal_map_value_init: MissingCompileTimeError
+void_type_usage_test/local_return: MissingCompileTimeError
+void_type_usage_test/local_void_init: MissingCompileTimeError
+void_type_usage_test/param_conditional: MissingCompileTimeError
+void_type_usage_test/param_literal_list_init: MissingCompileTimeError
+void_type_usage_test/param_literal_map_key_init: MissingCompileTimeError
+void_type_usage_test/param_literal_map_value_init: MissingCompileTimeError
+void_type_usage_test/param_return: MissingCompileTimeError
+void_type_usage_test/param_void_init: MissingCompileTimeError
+void_type_usage_test/paren_conditional: MissingCompileTimeError
+void_type_usage_test/paren_literal_list_init: MissingCompileTimeError
+void_type_usage_test/paren_literal_map_key_init: MissingCompileTimeError
+void_type_usage_test/paren_literal_map_value_init: MissingCompileTimeError
+void_type_usage_test/paren_return: MissingCompileTimeError
+void_type_usage_test/paren_void_init: MissingCompileTimeError
+web_int_literals_test/01: MissingCompileTimeError
+web_int_literals_test/02: MissingCompileTimeError
+web_int_literals_test/03: MissingCompileTimeError
+web_int_literals_test/10: MissingCompileTimeError
+web_int_literals_test/11: MissingCompileTimeError
+web_int_literals_test/12: MissingCompileTimeError
+web_int_literals_test/13: MissingCompileTimeError
+web_int_literals_test/14: MissingCompileTimeError
+web_int_literals_test/20: MissingCompileTimeError
+web_int_literals_test/21: MissingCompileTimeError
+web_int_literals_test/22: MissingCompileTimeError
+web_int_literals_test/23: MissingCompileTimeError
+web_int_literals_test/24: MissingCompileTimeError
+web_int_literals_test/25: MissingCompileTimeError
+web_int_literals_test/26: MissingCompileTimeError
+web_int_literals_test/27: MissingCompileTimeError
+web_int_literals_test/28: MissingCompileTimeError
+web_int_literals_test/29: MissingCompileTimeError
+web_int_literals_test/61: MissingCompileTimeError
+web_int_literals_test/62: MissingCompileTimeError
+web_int_literals_test/63: MissingCompileTimeError
+web_int_literals_test/64: MissingCompileTimeError
+web_int_literals_test/65: MissingCompileTimeError
+web_int_literals_test/70: MissingCompileTimeError
+
+[ $compiler == dart2analyzer && !$fasta && !$preview_dart_2 ]
call_type_literal_test: CompileTimeError
class_literal_static_test/none: CompileTimeError
class_literal_test/none: CompileTimeError
@@ -1111,7 +1112,12 @@
implicit_creation/implicit_new_prefix_constructor_test: CompileTimeError
type_literal_prefix_call_test: CompileTimeError
-[ $compiler == dart2analyzer && $strong ]
+[ $compiler == dart2analyzer && !$fasta && !$preview_dart_2 && !$strong ]
+static_setter_conflicts_test/01: MissingCompileTimeError
+static_setter_conflicts_test/04: MissingCompileTimeError
+static_setter_conflicts_test/07: MissingCompileTimeError
+
+[ $compiler == dart2analyzer && !$fasta && $strong ]
accessor_conflict_export2_test: CompileTimeError # Issue 25626
accessor_conflict_export_test: CompileTimeError # Issue 25626
accessor_conflict_import2_test: CompileTimeError # Issue 25626
@@ -1122,11 +1128,6 @@
cascaded_forwarding_stubs_test: CompileTimeError
config_import_corelib_test: CompileTimeError
conflicting_generic_interfaces_hierarchy_loop_infinite_test: Skip # Crashes or times out
-const_types_test/07: MissingCompileTimeError # Incorrectly allows using type parameter in const expression.
-const_types_test/08: MissingCompileTimeError # Incorrectly allows using type parameter in const expression.
-const_types_test/14: MissingCompileTimeError # Incorrectly allows using type parameter in const expression.
-const_types_test/15: MissingCompileTimeError # Incorrectly allows using type parameter in const expression.
-constant_type_literal_test/01: MissingCompileTimeError # Issue 28823
default_implementation2_test: CompileTimeError # Issue 30855
error_stacktrace_test/00: Pass
field3_test/02: MissingCompileTimeError # Issue 33022
@@ -1135,7 +1136,6 @@
generic_methods_generic_function_result_test/none: CompileTimeError # Issue #30207
generic_no_such_method_dispatcher_test: CompileTimeError
generic_tearoff_test: CompileTimeError
-import_core_prefix_test: CompileTimeError # "dynamic" should be defined in core.
interceptor6_test: CompileTimeError
issue13673_test: StaticWarning # Issue 31925
issue15606_test/none: CompileTimeError # invalid use of void for dart 2
@@ -1211,7 +1211,7 @@
void_type_callbacks_test/01: MissingCompileTimeError # Issue 30177
void_type_function_types_test/none: CompileTimeError # Issue 30177
-[ $compiler == dart2analyzer && !$strong ]
+[ $compiler == dart2analyzer && !$fasta && !$strong ]
accessor_conflict_export2_test: StaticWarning # Issue 25626
accessor_conflict_export_test: CompileTimeError
accessor_conflict_export_test: StaticWarning # Issue 25626
diff --git a/tests/language_2/language_2_dart2js.status b/tests/language_2/language_2_dart2js.status
index 84f88bb..332c2ea 100644
--- a/tests/language_2/language_2_dart2js.status
+++ b/tests/language_2/language_2_dart2js.status
@@ -6,10 +6,12 @@
[ $compiler == dart2js ]
async_star_cancel_while_paused_test: RuntimeError # Issue 22853
bit_operations_test: RuntimeError, OK # non JS number semantics
+bug32372_test: CompileTimeError
config_import_corelib_test: CompileTimeError # we need a special platform.dill file for categories=all. Once we fix that, all dart:* are supported when using '--categories=all' so this will become a RuntimeError, OK.
config_import_test: RuntimeError # Test flag is not passed to the compiler.
double_identical_test: RuntimeError # Negative and positive zero are distinct, but not in dart2js; bug #11551.
issue23244_test: RuntimeError # Isolates - enum canonicalization - Issue 23244
+issue32353_test: CompileTimeError
library_env_test/has_mirror_support: RuntimeError, OK
library_env_test/has_no_html_support: RuntimeError, OK
vm/*: SkipByDesign # Tests for the VM.
@@ -33,9 +35,7 @@
[ $compiler == dart2js && $runtime == d8 && $fasta ]
assertion_test: RuntimeError
-bug32372_test: CompileTimeError
implicit_creation/implicit_new_constructor_generic_test: Pass
-issue32353_test: CompileTimeError
[ $compiler == dart2js && $runtime == ff ]
field_override_optimization_test: RuntimeError
@@ -251,18 +251,14 @@
const_types_test/35: MissingCompileTimeError
const_types_test/39: MissingCompileTimeError
const_types_test/40: MissingCompileTimeError
-constants_test/05: MissingCompileTimeError
constructor_duplicate_final_test/01: MissingCompileTimeError
constructor_duplicate_final_test/02: MissingCompileTimeError
constructor_named_arguments_test/01: MissingCompileTimeError
constructor_named_arguments_test/none: RuntimeError
-constructor_redirect_cycle_test/01: MissingCompileTimeError
-constructor_redirect_indirect_cycle_test/01: Crash # Stack Overflow
constructor_redirect_test/01: Crash # Assertion failure: Cannot find value Instance of 'ThisLocal' in (local(A.named2#x), local(A.named2#y), local(A.named2#z)) for j:constructor(A.named2).
covariance_type_parameter_test/02: Crash # NoSuchMethodError: The method 'hasSubclass' was called on null.
covariant_override/runtime_check_test: RuntimeError
covariant_subtyping_test: RuntimeError
-cyclic_constructor_test/01: Crash # Stack Overflow
deferred_constraints_type_annotation_test/as_operation: MissingCompileTimeError
deferred_constraints_type_annotation_test/catch_check: MissingCompileTimeError
deferred_constraints_type_annotation_test/is_check: MissingCompileTimeError
@@ -311,7 +307,6 @@
instanceof4_test/01: RuntimeError
instanceof4_test/none: RuntimeError
integer_division_by_zero_test: RuntimeError # Issue 8301
-internal_library_test/02: Crash # NoSuchMethodError: Class 'DillLibraryBuilder' has no instance getter 'mixinApplicationClasses'.
invocation_mirror2_test: RuntimeError # mirrors not supported
issue21079_test: RuntimeError
issue23244_test: RuntimeError
@@ -377,7 +372,6 @@
mixin_issue10216_2_test: RuntimeError
mixin_mixin4_test: RuntimeError
mixin_mixin5_test: RuntimeError
-mixin_mixin6_test: RuntimeError
mixin_mixin7_test: RuntimeError
mixin_mixin_bound2_test: RuntimeError
mixin_mixin_bound_test: RuntimeError
@@ -408,13 +402,9 @@
mixin_supertype_subclass4_test/05: CompileTimeError
mixin_supertype_subclass4_test/none: CompileTimeError
mixin_type_parameters_super_test: RuntimeError
+mock_writable_final_field_test: RuntimeError # Issue 30847
+mock_writable_final_private_field_test: RuntimeError # Issue 17526, 30847
modulo_test: RuntimeError # non JS number semantics
-multiline_newline_test/04: MissingCompileTimeError
-multiline_newline_test/04r: MissingCompileTimeError
-multiline_newline_test/05: MissingCompileTimeError
-multiline_newline_test/05r: MissingCompileTimeError
-multiline_newline_test/06: MissingCompileTimeError
-multiline_newline_test/06r: MissingCompileTimeError
named_parameters_default_eq_test/02: MissingCompileTimeError
nan_identical_test: RuntimeError # Issue 11551
nested_generic_closure_test: Crash # Unsupported operation: Unsupported type parameter type node F.
@@ -436,14 +426,12 @@
redirecting_factory_long_test: RuntimeError
redirecting_factory_reflection_test: RuntimeError
regress_20394_test/01: MissingCompileTimeError
-regress_24283_test: RuntimeError # non JS number semantics
regress_27617_test/1: Crash # Assertion failure: Unexpected constructor j:constructor(Foo._) in ConstructorDataImpl._getConstructorConstant
regress_28217_test/01: MissingCompileTimeError
regress_28217_test/none: MissingCompileTimeError
regress_28255_test: RuntimeError
regress_28341_test: RuntimeError
regress_29405_test: RuntimeError
-regress_29784_test/01: Crash # Assertion failure: Cannot find value Instance of 'ThisLocal' in () for j:constructor(A.ok).
regress_29784_test/02: MissingCompileTimeError # Issue 29784
regress_30339_test: RuntimeError # Issue 26429
regress_31057_test: Crash # Unsupported operation: Unsupported type parameter type node B.
@@ -466,7 +454,6 @@
syntax_test/33: MissingCompileTimeError # Issue 29763
tearoff_dynamic_test: RuntimeError
truncdiv_test: RuntimeError # non JS number semantics - Issue 15246
-try_catch_test/01: MissingCompileTimeError
type_check_const_function_typedef2_test: MissingCompileTimeError
type_literal_test: RuntimeError
type_parameter_test/06: Crash # Internal Error: Unexpected type variable in static context.
@@ -496,265 +483,9 @@
vm/reflect_core_vm_test: Fail # mirrors not supported
[ $compiler == dart2js && $fast_startup && $fasta && $strong ]
-assertion_test: RuntimeError
-async_await_test/02: RuntimeError
-async_await_test/03: RuntimeError
-async_await_test/none: RuntimeError
async_star_cancel_while_paused_test: RuntimeError
-async_star_test/02: RuntimeError
-bit_operations_test: RuntimeError
-branch_canonicalization_test: RuntimeError
-canonical_const2_test: RuntimeError, OK # non JS number semantics
-class_cycle_test/02: MissingCompileTimeError
-class_cycle_test/03: MissingCompileTimeError
-compile_time_constant_o_test/01: MissingCompileTimeError
-compile_time_constant_o_test/02: MissingCompileTimeError
-compile_time_constant_static5_test/11: CompileTimeError
-compile_time_constant_static5_test/16: CompileTimeError
-compile_time_constant_static5_test/21: CompileTimeError
-compile_time_constant_static5_test/23: CompileTimeError
-conditional_rewrite_test: RuntimeError
-config_import_test: RuntimeError
-const_dynamic_type_literal_test/02: MissingCompileTimeError
-const_evaluation_test/01: RuntimeError
-const_instance_field_test/01: MissingCompileTimeError
-const_list_test: RuntimeError
-const_map2_test/00: MissingCompileTimeError
-const_map3_test/00: MissingCompileTimeError
-const_map4_test: RuntimeError
-const_switch2_test/01: MissingCompileTimeError
-const_switch_test/02: RuntimeError, OK # constant identity based on JS constants
-const_switch_test/04: RuntimeError, OK # constant identity based on JS constants
-const_types_test/34: MissingCompileTimeError
-const_types_test/39: MissingCompileTimeError
-constants_test/05: MissingCompileTimeError
-constructor12_test: RuntimeError
-constructor_named_arguments_test/none: RuntimeError
-constructor_redirect_cycle_test/01: Crash # Stack Overflow
-constructor_redirect_indirect_cycle_test/01: Crash # Stack Overflow
-constructor_redirect_test/01: Crash # Assertion failure: Cannot find value Instance of 'ThisLocal' in (local(A.named2#x), local(A.named2#y), local(A.named2#z)) for j:constructor(A.named2).
-covariance_type_parameter_test/02: RuntimeError
covariant_subtyping_test: Crash # Unsupported operation: Unsupported type parameter type node E.
-cyclic_constructor_test/01: Crash # Stack Overflow
-cyclic_type_test/00: RuntimeError
-cyclic_type_test/02: RuntimeError
-cyclic_type_test/03: RuntimeError
-cyclic_type_test/04: RuntimeError
-deferred_inheritance_constraints_test/extends: MissingCompileTimeError
-deferred_inheritance_constraints_test/implements: MissingCompileTimeError
-deferred_inheritance_constraints_test/mixin: MissingCompileTimeError
-deferred_load_library_wrong_args_test/01: CompileTimeError
-deferred_not_loaded_check_test: RuntimeError # Test out of date. Issue 31933
-deferred_redirecting_factory_test: RuntimeError
-double_int_to_string_test: RuntimeError, OK # non JS number semantics
-duplicate_implements_test/01: MissingCompileTimeError
-duplicate_implements_test/02: MissingCompileTimeError
-dynamic_prefix_core_test/none: CompileTimeError
-emit_const_fields_test: CompileTimeError
-enum_mirror_test: RuntimeError
-example_constructor_test: RuntimeError
-expect_test: RuntimeError, OK # Issue 13080
-external_test/10: MissingRuntimeError
-external_test/13: MissingRuntimeError
-external_test/20: MissingRuntimeError
-external_test/21: CompileTimeError
-external_test/24: CompileTimeError
-f_bounded_quantification4_test: RuntimeError
-field_initialization_order_test/01: MissingCompileTimeError
-field_initialization_order_test/none: RuntimeError
-flatten_test/05: MissingRuntimeError
-flatten_test/08: MissingRuntimeError
-flatten_test/09: MissingRuntimeError
-flatten_test/12: MissingRuntimeError
-full_stacktrace1_test: RuntimeError # Issue 12698
-full_stacktrace2_test: RuntimeError # Issue 12698
-full_stacktrace3_test: RuntimeError # Issue 12698
-function_subtype_inline2_test: RuntimeError
-function_subtype_setter0_test: RuntimeError
-generic_function_bounds_test: RuntimeError
-generic_function_dcall_test: RuntimeError
-generic_function_type_as_type_argument_test/01: MissingCompileTimeError
-generic_function_type_as_type_argument_test/02: MissingCompileTimeError
-generic_instanceof2_test: RuntimeError
-generic_is_check_test: RuntimeError
-generic_methods_bounds_test/02: MissingRuntimeError
-generic_methods_generic_function_result_test/01: MissingCompileTimeError
-generic_methods_unused_parameter_test: RuntimeError
-generic_no_such_method_dispatcher_simple_test: CompileTimeError
-generic_no_such_method_dispatcher_test: CompileTimeError
-generic_tearoff_test: CompileTimeError
-identical_closure2_test: RuntimeError # non JS number semantics
-if_null_precedence_test/none: RuntimeError
-infinity_test: RuntimeError # non JS number semantics - Issue 4984
-instance_creation_in_function_annotation_test: RuntimeError
-instantiate_tearoff_of_call_test: CompileTimeError
-int64_literal_test/01: RuntimeError
-int64_literal_test/02: RuntimeError
-int64_literal_test/04: RuntimeError
-int64_literal_test/05: RuntimeError
-int64_literal_test/10: RuntimeError
-int64_literal_test/20: RuntimeError
-int64_literal_test/40: RuntimeError
-int64_literal_test/none: RuntimeError
-integer_division_by_zero_test: RuntimeError # Issue 8301
-internal_library_test/02: Crash # NoSuchMethodError: Class 'DillLibraryBuilder' has no instance getter 'mixinApplicationClasses'.
-invocation_mirror_invoke_on2_test: RuntimeError
-invocation_mirror_invoke_on_test: RuntimeError
-issue21079_test: RuntimeError
issue23244_test: RuntimeError
-issue31596_super_test/01: CompileTimeError
-issue31596_super_test/03: CompileTimeError
-left_shift_test: RuntimeError # non JS number semantics
-library_env_test/has_mirror_support: RuntimeError
-local_function2_test/none: RuntimeError
-local_function3_test/none: RuntimeError
-local_function_test/none: RuntimeError
-method_override_test: CompileTimeError
-minify_closure_variable_collision_test: CompileTimeError
-mint_arithmetic_test: RuntimeError # non JS number semantics
-mixin_forwarding_constructor4_test/01: MissingCompileTimeError
-mixin_forwarding_constructor4_test/02: MissingCompileTimeError
-mixin_forwarding_constructor4_test/03: MissingCompileTimeError
-mixin_illegal_super_use_test/01: MissingCompileTimeError
-mixin_illegal_super_use_test/04: MissingCompileTimeError
-mixin_illegal_super_use_test/07: MissingCompileTimeError
-mixin_illegal_super_use_test/10: MissingCompileTimeError
-mixin_illegal_super_use_test/11: MissingCompileTimeError
-mixin_illegal_superclass_test/01: MissingCompileTimeError
-mixin_illegal_superclass_test/02: MissingCompileTimeError
-mixin_illegal_superclass_test/03: MissingCompileTimeError
-mixin_illegal_superclass_test/04: MissingCompileTimeError
-mixin_illegal_superclass_test/05: MissingCompileTimeError
-mixin_illegal_superclass_test/06: MissingCompileTimeError
-mixin_illegal_superclass_test/07: MissingCompileTimeError
-mixin_illegal_superclass_test/08: MissingCompileTimeError
-mixin_illegal_superclass_test/09: MissingCompileTimeError
-mixin_illegal_superclass_test/10: MissingCompileTimeError
-mixin_illegal_superclass_test/11: MissingCompileTimeError
-mixin_illegal_superclass_test/12: MissingCompileTimeError
-mixin_illegal_superclass_test/13: MissingCompileTimeError
-mixin_illegal_superclass_test/14: MissingCompileTimeError
-mixin_illegal_superclass_test/15: MissingCompileTimeError
-mixin_illegal_superclass_test/16: MissingCompileTimeError
-mixin_illegal_superclass_test/17: MissingCompileTimeError
-mixin_illegal_superclass_test/18: MissingCompileTimeError
-mixin_illegal_superclass_test/19: MissingCompileTimeError
-mixin_illegal_superclass_test/20: MissingCompileTimeError
-mixin_illegal_superclass_test/21: MissingCompileTimeError
-mixin_illegal_superclass_test/22: MissingCompileTimeError
-mixin_illegal_superclass_test/23: MissingCompileTimeError
-mixin_illegal_superclass_test/24: MissingCompileTimeError
-mixin_illegal_superclass_test/25: MissingCompileTimeError
-mixin_illegal_superclass_test/26: MissingCompileTimeError
-mixin_illegal_superclass_test/27: MissingCompileTimeError
-mixin_illegal_superclass_test/28: MissingCompileTimeError
-mixin_illegal_superclass_test/29: MissingCompileTimeError
-mixin_illegal_superclass_test/30: MissingCompileTimeError
-mixin_mixin6_test: RuntimeError
-mixin_of_mixin_test/none: CompileTimeError
-mixin_super_2_test/none: CompileTimeError
-mixin_super_constructor_named_test/01: MissingCompileTimeError
-mixin_super_constructor_positionals_test/01: MissingCompileTimeError
-mixin_super_test: CompileTimeError
-mixin_super_use_test: CompileTimeError
-mixin_superclass_test: CompileTimeError
-mixin_supertype_subclass2_test/01: CompileTimeError
-mixin_supertype_subclass2_test/02: CompileTimeError
-mixin_supertype_subclass2_test/03: CompileTimeError
-mixin_supertype_subclass2_test/04: CompileTimeError
-mixin_supertype_subclass2_test/05: CompileTimeError
-mixin_supertype_subclass2_test/none: CompileTimeError
-mixin_supertype_subclass3_test/01: CompileTimeError
-mixin_supertype_subclass3_test/02: CompileTimeError
-mixin_supertype_subclass3_test/03: CompileTimeError
-mixin_supertype_subclass3_test/04: CompileTimeError
-mixin_supertype_subclass3_test/05: CompileTimeError
-mixin_supertype_subclass3_test/none: CompileTimeError
-mixin_supertype_subclass4_test/01: CompileTimeError
-mixin_supertype_subclass4_test/02: CompileTimeError
-mixin_supertype_subclass4_test/03: CompileTimeError
-mixin_supertype_subclass4_test/04: CompileTimeError
-mixin_supertype_subclass4_test/05: CompileTimeError
-mixin_supertype_subclass4_test/none: CompileTimeError
-mixin_supertype_subclass_test/01: CompileTimeError
-mixin_supertype_subclass_test/03: CompileTimeError
-mixin_supertype_subclass_test/04: CompileTimeError
-mixin_supertype_subclass_test/none: CompileTimeError
-modulo_test: RuntimeError # non JS number semantics
-multiline_newline_test/04: MissingCompileTimeError
-multiline_newline_test/04r: MissingCompileTimeError
-multiline_newline_test/05: MissingCompileTimeError
-multiline_newline_test/05r: MissingCompileTimeError
-multiline_newline_test/06: MissingCompileTimeError
-multiline_newline_test/06r: MissingCompileTimeError
-named_parameters_default_eq_test/02: MissingCompileTimeError
-named_parameters_default_eq_test/none: RuntimeError
-nan_identical_test: RuntimeError # Issue 11551
-nested_generic_closure_test: RuntimeError
-no_main_test/01: CompileTimeError
-no_such_method_mock_test: RuntimeError
-null_no_such_method_test: CompileTimeError
-number_identity2_test: RuntimeError
-numbers_test: RuntimeError, OK # non JS number semantics
-override_inheritance_field_test/04: CompileTimeError
-override_inheritance_field_test/06: CompileTimeError
-override_inheritance_field_test/26: CompileTimeError
-override_inheritance_field_test/29: CompileTimeError
-override_inheritance_generic_test/02: CompileTimeError
-override_inheritance_method_test/28: CompileTimeError
-override_inheritance_method_test/29: CompileTimeError
-parser_quirks_test: CompileTimeError
-redirecting_factory_default_values_test/01: MissingCompileTimeError
-redirecting_factory_default_values_test/02: MissingCompileTimeError
-redirecting_factory_reflection_test: RuntimeError
-regress_23408_test: CompileTimeError
-regress_24283_test: RuntimeError # non JS number semantics
-regress_27617_test/1: Crash # Assertion failure: Unexpected constructor j:constructor(Foo._) in ConstructorDataImpl._getConstructorConstant
-regress_28255_test: RuntimeError
-regress_29025_test: CompileTimeError
-regress_29405_test: CompileTimeError
-regress_29784_test/01: Crash # Assertion failure: Cannot find value Instance of 'ThisLocal' in () for j:constructor(A.ok).
-regress_29784_test/02: MissingCompileTimeError # Issue 29784
-regress_30339_test: CompileTimeError
-setter_no_getter_test/01: CompileTimeError
-stacktrace_demangle_ctors_test: RuntimeError # Issue 12698
-stacktrace_rethrow_error_test/none: RuntimeError # Issue 12698
-stacktrace_rethrow_error_test/withtraceparameter: RuntimeError # Issue 12698
-stacktrace_rethrow_nonerror_test: RuntimeError # Issue 12698
-stacktrace_test: RuntimeError # Issue 12698
-string_interpolation_and_buffer_test: RuntimeError
-string_split_test: CompileTimeError
-string_supertype_checked_test: CompileTimeError
-super_bound_closure_test/none: CompileTimeError
-super_call4_test/01: MissingCompileTimeError
-super_test: RuntimeError
-switch_bad_case_test/01: MissingCompileTimeError
-switch_bad_case_test/02: MissingCompileTimeError
-switch_case_test/00: MissingCompileTimeError
-switch_case_test/01: MissingCompileTimeError
-switch_case_test/02: MissingCompileTimeError
-syntax_test/28: MissingCompileTimeError # Issue 29763
-syntax_test/29: MissingCompileTimeError # Issue 29763
-syntax_test/30: MissingCompileTimeError # Issue 29763
-syntax_test/31: MissingCompileTimeError # Issue 29763
-syntax_test/32: MissingCompileTimeError # Issue 29763
-syntax_test/33: MissingCompileTimeError # Issue 29763
-tearoff_dynamic_test: RuntimeError
-truncdiv_test: RuntimeError # non JS number semantics - Issue 15246
-try_catch_test/01: MissingCompileTimeError
-type_error_test: RuntimeError
-type_literal_test: RuntimeError
-type_promotion_functions_test/02: CompileTimeError
-type_promotion_functions_test/03: CompileTimeError
-type_promotion_functions_test/04: CompileTimeError
-type_promotion_functions_test/09: CompileTimeError
-type_promotion_functions_test/11: CompileTimeError
-type_promotion_functions_test/12: CompileTimeError
-type_promotion_functions_test/13: CompileTimeError
-type_promotion_functions_test/14: CompileTimeError
-type_promotion_functions_test/none: CompileTimeError
-type_promotion_more_specific_test/04: CompileTimeError
-type_variable_promotion_test: RuntimeError
[ $compiler == dart2js && $fasta ]
arithmetic_int64_test: CompileTimeError, OK # Error if web int literal cannot be represented exactly, see http://dartbug.com/33351
@@ -771,8 +502,6 @@
checked_setter_test: RuntimeError # Issue 31128
const_constructor_nonconst_param_test/01: MissingCompileTimeError
const_dynamic_type_literal_test/03: Pass # but it shouldn't until we fix issue 17207
-constructor_redirect_cycle_test/01: Crash # Stack Overflow
-constructor_redirect_indirect_cycle_test/01: Crash # Stack Overflow
deopt_inlined_function_lazy_test: CompileTimeError, OK # Error if web int literal cannot be represented exactly, see http://dartbug.com/33351
deopt_smi_op_test: CompileTimeError, OK # Error if web int literal cannot be represented exactly, see http://dartbug.com/33351
duplicate_interface_implements_test/01: MissingCompileTimeError
@@ -824,26 +553,16 @@
abstract_override_adds_optional_args_concrete_test: MissingCompileTimeError
additional_interface_adds_optional_args_concrete_subclass_test: MissingCompileTimeError
additional_interface_adds_optional_args_concrete_test: MissingCompileTimeError
-assertion_test: RuntimeError
-async_await_test/02: RuntimeError
-async_await_test/03: RuntimeError
-async_await_test/none: RuntimeError
async_or_generator_return_type_stacktrace_test/01: MissingCompileTimeError
async_or_generator_return_type_stacktrace_test/02: MissingCompileTimeError
async_or_generator_return_type_stacktrace_test/03: MissingCompileTimeError
async_return_types_test/nestedFuture: Crash # 'file:*/pkg/compiler/lib/src/js_emitter/runtime_type_generator.dart': Failed assertion: line 208 pos 18: '!(_useKernel && _strongMode && !_disableRtiOptimization) ||
async_return_types_test/wrongReturnType: Crash # 'file:*/pkg/compiler/lib/src/js_emitter/runtime_type_generator.dart': Failed assertion: line 208 pos 18: '!(_useKernel && _strongMode && !_disableRtiOptimization) ||
async_star_cancel_while_paused_test: Crash # 'file:*/pkg/compiler/lib/src/js_emitter/runtime_type_generator.dart': Failed assertion: line 208 pos 18: '!(_useKernel && _strongMode && !_disableRtiOptimization) ||
-async_star_test/02: RuntimeError
await_not_started_immediately_test: Crash # Assertion failure: Runtime type information not available for type_variable_local(bindCallback.R) in (local(_RootZone.bindCallback#)) for j:closure_call(_RootZone_bindCallback_closure.call).
-bit_operations_test: RuntimeError
-branch_canonicalization_test: RuntimeError
call_non_method_field_test/01: MissingCompileTimeError
call_non_method_field_test/02: MissingCompileTimeError
-canonical_const2_test: RuntimeError, OK # non JS number semantics
check_member_static_test/01: MissingCompileTimeError
-class_cycle_test/02: MissingCompileTimeError
-class_cycle_test/03: MissingCompileTimeError
class_literal_static_test/01: MissingCompileTimeError
class_literal_static_test/03: MissingCompileTimeError
class_literal_static_test/07: MissingCompileTimeError
@@ -851,134 +570,35 @@
compile_time_constant_k_test/01: MissingCompileTimeError
compile_time_constant_k_test/02: MissingCompileTimeError
compile_time_constant_k_test/03: MissingCompileTimeError
-compile_time_constant_o_test/01: MissingCompileTimeError
-compile_time_constant_o_test/02: MissingCompileTimeError
-compile_time_constant_static5_test/11: CompileTimeError
-compile_time_constant_static5_test/16: CompileTimeError
-compile_time_constant_static5_test/21: CompileTimeError
-compile_time_constant_static5_test/23: CompileTimeError
-conditional_rewrite_test: RuntimeError
config_import_corelib_test: CompileTimeError
-config_import_test: RuntimeError
-const_dynamic_type_literal_test/02: MissingCompileTimeError
-const_evaluation_test/01: RuntimeError
-const_instance_field_test/01: MissingCompileTimeError
-const_list_test: RuntimeError
-const_map2_test/00: MissingCompileTimeError
-const_map3_test/00: MissingCompileTimeError
-const_map4_test: RuntimeError
-const_switch2_test/01: MissingCompileTimeError
-const_switch_test/02: RuntimeError, OK # constant identity based on JS constants
-const_switch_test/04: RuntimeError, OK # constant identity based on JS constants
-const_types_test/34: MissingCompileTimeError
-const_types_test/39: MissingCompileTimeError
-constants_test/05: MissingCompileTimeError
-constructor12_test: RuntimeError
-constructor_named_arguments_test/none: RuntimeError
-constructor_redirect_cycle_test/01: Crash # Issue 30856
-constructor_redirect_indirect_cycle_test/01: Crash # Stack Overflow
-constructor_redirect_test/01: Crash # Assertion failure: Cannot find value Instance of 'ThisLocal' in (local(A.named2#x), local(A.named2#y), local(A.named2#z)) for j:constructor(A.named2).
-covariance_type_parameter_test/02: RuntimeError
covariant_subtyping_test: RuntimeError
-cyclic_constructor_test/01: Crash # Issue 30856
-cyclic_type_test/00: RuntimeError
-cyclic_type_test/02: RuntimeError
-cyclic_type_test/03: RuntimeError
-cyclic_type_test/04: RuntimeError
cyclic_type_variable_test/01: MissingCompileTimeError
cyclic_type_variable_test/02: MissingCompileTimeError
cyclic_type_variable_test/03: MissingCompileTimeError
cyclic_type_variable_test/04: MissingCompileTimeError
default_factory2_test/01: MissingCompileTimeError
default_factory_test/01: MissingCompileTimeError
-deferred_inheritance_constraints_test/extends: MissingCompileTimeError
-deferred_inheritance_constraints_test/implements: MissingCompileTimeError
-deferred_inheritance_constraints_test/mixin: MissingCompileTimeError
deferred_inheritance_constraints_test/redirecting_constructor: MissingCompileTimeError
-deferred_load_library_wrong_args_test/01: CompileTimeError
-deferred_not_loaded_check_test: RuntimeError # Test out of date. Issue 31933
-deferred_redirecting_factory_test: RuntimeError
-double_int_to_string_test: RuntimeError, OK # non JS number semantics
-duplicate_implements_test/01: MissingCompileTimeError
-duplicate_implements_test/02: MissingCompileTimeError
-dynamic_prefix_core_test/none: CompileTimeError
-emit_const_fields_test: CompileTimeError
-enum_mirror_test: RuntimeError
-example_constructor_test: RuntimeError
-expect_test: RuntimeError, OK # Issue 13080
-external_test/10: MissingRuntimeError
-external_test/13: MissingRuntimeError
-external_test/20: MissingRuntimeError
-external_test/21: CompileTimeError
-external_test/24: CompileTimeError
-f_bounded_quantification4_test: RuntimeError
f_bounded_quantification_test/01: MissingCompileTimeError
f_bounded_quantification_test/02: MissingCompileTimeError
factory4_test/00: MissingCompileTimeError
field3_test/01: MissingCompileTimeError
-field_initialization_order_test/01: MissingCompileTimeError
-field_initialization_order_test/none: RuntimeError
field_override_test/00: MissingCompileTimeError
field_override_test/01: MissingCompileTimeError
-flatten_test/05: MissingRuntimeError
-flatten_test/08: MissingRuntimeError
-flatten_test/09: MissingRuntimeError
-flatten_test/12: MissingRuntimeError
-full_stacktrace1_test: RuntimeError # Issue 12698
-full_stacktrace2_test: RuntimeError # Issue 12698
-full_stacktrace3_test: RuntimeError # Issue 12698
-function_subtype_inline2_test: RuntimeError
-function_subtype_setter0_test: RuntimeError
-generic_function_bounds_test: RuntimeError
-generic_function_dcall_test: RuntimeError
-generic_function_type_as_type_argument_test/01: MissingCompileTimeError
-generic_function_type_as_type_argument_test/02: MissingCompileTimeError
-generic_instanceof2_test: RuntimeError
-generic_is_check_test: RuntimeError
generic_methods_bounds_test/01: MissingCompileTimeError
-generic_methods_bounds_test/02: MissingRuntimeError
-generic_methods_generic_function_result_test/01: MissingCompileTimeError
generic_methods_overriding_test/01: MissingCompileTimeError
generic_methods_recursive_bound_test/02: MissingCompileTimeError
generic_methods_unused_parameter_test: Crash # Assertion failure: kind=special,memberName=instantiate,callStructure:CallStructure(arity=0, types=1)
-generic_no_such_method_dispatcher_simple_test: CompileTimeError
-generic_no_such_method_dispatcher_test: CompileTimeError
-generic_tearoff_test: CompileTimeError
-identical_closure2_test: RuntimeError # non JS number semantics
identical_const_test/01: MissingCompileTimeError
identical_const_test/02: MissingCompileTimeError
identical_const_test/03: MissingCompileTimeError
identical_const_test/04: MissingCompileTimeError
-if_null_precedence_test/none: RuntimeError
-infinity_test: RuntimeError # non JS number semantics - Issue 4984
-instance_creation_in_function_annotation_test: RuntimeError
-instantiate_tearoff_of_call_test: CompileTimeError
-int64_literal_test/01: RuntimeError
-int64_literal_test/02: RuntimeError
-int64_literal_test/04: RuntimeError
-int64_literal_test/05: RuntimeError
-int64_literal_test/10: RuntimeError
-int64_literal_test/20: RuntimeError
-int64_literal_test/40: RuntimeError
-int64_literal_test/none: RuntimeError
-integer_division_by_zero_test: RuntimeError # Issue 8301
-internal_library_test/02: Crash # type 'DillLibraryBuilder' is not a subtype of type 'SourceLibraryBuilder<KernelTypeBuilder, Library>' of 'value' where
-invocation_mirror_invoke_on2_test: RuntimeError
-invocation_mirror_invoke_on_test: RuntimeError
issue18628_2_test/01: MissingCompileTimeError
-issue21079_test: RuntimeError
issue23244_test: Crash # 'file:*/pkg/compiler/lib/src/js_emitter/runtime_type_generator.dart': Failed assertion: line 208 pos 18: '!(_useKernel && _strongMode && !_disableRtiOptimization) ||
issue31596_override_test/07: MissingCompileTimeError
issue31596_override_test/08: MissingCompileTimeError
-issue31596_super_test/01: CompileTimeError
-issue31596_super_test/03: CompileTimeError
-left_shift_test: RuntimeError # non JS number semantics
-library_env_test/has_mirror_support: RuntimeError
library_env_test/has_no_html_support: RuntimeError
library_env_test/has_no_io_support: RuntimeError
-local_function2_test/none: RuntimeError
-local_function3_test/none: RuntimeError
-local_function_test/none: RuntimeError
malbounded_instantiation_test/01: MissingCompileTimeError
malbounded_instantiation_test/02: MissingCompileTimeError
malbounded_instantiation_test/03: MissingCompileTimeError
@@ -998,47 +618,6 @@
map_literal3_test/01: MissingCompileTimeError
map_literal3_test/02: MissingCompileTimeError
map_literal3_test/03: MissingCompileTimeError
-method_override_test: CompileTimeError
-minify_closure_variable_collision_test: CompileTimeError
-mint_arithmetic_test: RuntimeError # non JS number semantics
-mixin_forwarding_constructor4_test/01: MissingCompileTimeError
-mixin_forwarding_constructor4_test/02: MissingCompileTimeError
-mixin_forwarding_constructor4_test/03: MissingCompileTimeError
-mixin_illegal_super_use_test/01: MissingCompileTimeError
-mixin_illegal_super_use_test/04: MissingCompileTimeError
-mixin_illegal_super_use_test/07: MissingCompileTimeError
-mixin_illegal_super_use_test/10: MissingCompileTimeError
-mixin_illegal_super_use_test/11: MissingCompileTimeError
-mixin_illegal_superclass_test/01: MissingCompileTimeError
-mixin_illegal_superclass_test/02: MissingCompileTimeError
-mixin_illegal_superclass_test/03: MissingCompileTimeError
-mixin_illegal_superclass_test/04: MissingCompileTimeError
-mixin_illegal_superclass_test/05: MissingCompileTimeError
-mixin_illegal_superclass_test/06: MissingCompileTimeError
-mixin_illegal_superclass_test/07: MissingCompileTimeError
-mixin_illegal_superclass_test/08: MissingCompileTimeError
-mixin_illegal_superclass_test/09: MissingCompileTimeError
-mixin_illegal_superclass_test/10: MissingCompileTimeError
-mixin_illegal_superclass_test/11: MissingCompileTimeError
-mixin_illegal_superclass_test/12: MissingCompileTimeError
-mixin_illegal_superclass_test/13: MissingCompileTimeError
-mixin_illegal_superclass_test/14: MissingCompileTimeError
-mixin_illegal_superclass_test/15: MissingCompileTimeError
-mixin_illegal_superclass_test/16: MissingCompileTimeError
-mixin_illegal_superclass_test/17: MissingCompileTimeError
-mixin_illegal_superclass_test/18: MissingCompileTimeError
-mixin_illegal_superclass_test/19: MissingCompileTimeError
-mixin_illegal_superclass_test/20: MissingCompileTimeError
-mixin_illegal_superclass_test/21: MissingCompileTimeError
-mixin_illegal_superclass_test/22: MissingCompileTimeError
-mixin_illegal_superclass_test/23: MissingCompileTimeError
-mixin_illegal_superclass_test/24: MissingCompileTimeError
-mixin_illegal_superclass_test/25: MissingCompileTimeError
-mixin_illegal_superclass_test/26: MissingCompileTimeError
-mixin_illegal_superclass_test/27: MissingCompileTimeError
-mixin_illegal_superclass_test/28: MissingCompileTimeError
-mixin_illegal_superclass_test/29: MissingCompileTimeError
-mixin_illegal_superclass_test/30: MissingCompileTimeError
mixin_invalid_bound2_test/02: MissingCompileTimeError
mixin_invalid_bound2_test/03: MissingCompileTimeError
mixin_invalid_bound2_test/04: MissingCompileTimeError
@@ -1062,137 +641,33 @@
mixin_invalid_bound_test/08: MissingCompileTimeError
mixin_invalid_bound_test/09: MissingCompileTimeError
mixin_invalid_bound_test/10: MissingCompileTimeError
-mixin_mixin6_test: RuntimeError
-mixin_of_mixin_test/none: CompileTimeError
-mixin_super_2_test/none: CompileTimeError
mixin_super_bound_test/01: MissingCompileTimeError
mixin_super_bound_test/02: MissingCompileTimeError
-mixin_super_constructor_named_test/01: MissingCompileTimeError
-mixin_super_constructor_positionals_test/01: MissingCompileTimeError
-mixin_super_test: CompileTimeError
-mixin_super_use_test: CompileTimeError
-mixin_superclass_test: CompileTimeError
-mixin_supertype_subclass2_test/01: CompileTimeError
-mixin_supertype_subclass2_test/02: CompileTimeError
-mixin_supertype_subclass2_test/03: CompileTimeError
-mixin_supertype_subclass2_test/04: CompileTimeError
-mixin_supertype_subclass2_test/05: CompileTimeError
-mixin_supertype_subclass2_test/none: CompileTimeError
-mixin_supertype_subclass3_test/01: CompileTimeError
-mixin_supertype_subclass3_test/02: CompileTimeError
-mixin_supertype_subclass3_test/03: CompileTimeError
-mixin_supertype_subclass3_test/04: CompileTimeError
-mixin_supertype_subclass3_test/05: CompileTimeError
-mixin_supertype_subclass3_test/none: CompileTimeError
-mixin_supertype_subclass4_test/01: CompileTimeError
-mixin_supertype_subclass4_test/02: CompileTimeError
-mixin_supertype_subclass4_test/03: CompileTimeError
-mixin_supertype_subclass4_test/04: CompileTimeError
-mixin_supertype_subclass4_test/05: CompileTimeError
-mixin_supertype_subclass4_test/none: CompileTimeError
-mixin_supertype_subclass_test/01: CompileTimeError
-mixin_supertype_subclass_test/03: CompileTimeError
-mixin_supertype_subclass_test/04: CompileTimeError
-mixin_supertype_subclass_test/none: CompileTimeError
mixin_type_parameters_errors_test/03: MissingCompileTimeError
mixin_type_parameters_errors_test/04: MissingCompileTimeError
-modulo_test: RuntimeError # non JS number semantics
-multiline_newline_test/04: MissingCompileTimeError
-multiline_newline_test/04r: MissingCompileTimeError
-multiline_newline_test/05: MissingCompileTimeError
-multiline_newline_test/05r: MissingCompileTimeError
-multiline_newline_test/06: MissingCompileTimeError
-multiline_newline_test/06r: MissingCompileTimeError
named_constructor_test/01: MissingCompileTimeError
-named_parameters_default_eq_test/02: MissingCompileTimeError
-named_parameters_default_eq_test/none: RuntimeError
-nan_identical_test: RuntimeError # Issue 11551
-nested_generic_closure_test: RuntimeError
-no_main_test/01: CompileTimeError
-no_such_method_mock_test: RuntimeError
-null_no_such_method_test: CompileTimeError
-number_identity2_test: RuntimeError
-numbers_test: RuntimeError, OK # non JS number semantics
override_field_test/02: MissingCompileTimeError
override_field_test/03: MissingCompileTimeError
-override_inheritance_field_test/04: CompileTimeError
-override_inheritance_field_test/06: CompileTimeError
-override_inheritance_field_test/26: CompileTimeError
-override_inheritance_field_test/29: CompileTimeError
override_inheritance_field_test/44: MissingCompileTimeError
override_inheritance_field_test/47: MissingCompileTimeError
override_inheritance_field_test/48: MissingCompileTimeError
override_inheritance_field_test/53: MissingCompileTimeError
override_inheritance_field_test/54: MissingCompileTimeError
-override_inheritance_generic_test/02: CompileTimeError
-override_inheritance_method_test/28: CompileTimeError
-override_inheritance_method_test/29: CompileTimeError
-parser_quirks_test: CompileTimeError
partial_tearoff_instantiation_test/05: Crash # Assertion failure: kind=special,memberName=instantiate,callStructure:CallStructure(arity=0, types=1)
partial_tearoff_instantiation_test/06: Crash # Assertion failure: kind=special,memberName=instantiate,callStructure:CallStructure(arity=0, types=1)
partial_tearoff_instantiation_test/07: Crash # Assertion failure: kind=special,memberName=instantiate,callStructure:CallStructure(arity=0, types=1)
partial_tearoff_instantiation_test/08: Crash # Assertion failure: kind=special,memberName=instantiate,callStructure:CallStructure(arity=0, types=1)
-redirecting_factory_default_values_test/01: MissingCompileTimeError
-redirecting_factory_default_values_test/02: MissingCompileTimeError
redirecting_factory_infinite_steps_test/01: MissingCompileTimeError
redirecting_factory_malbounded_test/01: MissingCompileTimeError
-redirecting_factory_reflection_test: RuntimeError
regress_13462_1_test: RuntimeError
regress_18535_test: RuntimeError
-regress_23408_test: CompileTimeError
-regress_24283_test: RuntimeError # non JS number semantics
-regress_27617_test/1: Crash # Assertion failure: Unexpected constructor j:constructor(Foo._) in ConstructorDataImpl._getConstructorConstant
-regress_28255_test: RuntimeError
-regress_29025_test: CompileTimeError
-regress_29405_test: CompileTimeError
-regress_29784_test/01: Crash # Assertion failure: Cannot find value Instance of 'ThisLocal' in () for j:constructor(A.ok).
-regress_29784_test/02: MissingCompileTimeError # Issue 29784
-regress_30339_test: CompileTimeError
setter4_test: MissingCompileTimeError
-setter_no_getter_test/01: CompileTimeError
-stacktrace_demangle_ctors_test: RuntimeError # Issue 12698
-stacktrace_rethrow_error_test/none: RuntimeError # Issue 12698
-stacktrace_rethrow_error_test/withtraceparameter: RuntimeError # Issue 12698
-stacktrace_rethrow_nonerror_test: RuntimeError # Issue 12698
-stacktrace_test: RuntimeError # Issue 12698
-string_interpolation_and_buffer_test: RuntimeError
-string_split_test: CompileTimeError
-string_supertype_checked_test: CompileTimeError
-super_bound_closure_test/none: CompileTimeError
-super_call4_test/01: MissingCompileTimeError
-super_test: RuntimeError
-switch_bad_case_test/01: MissingCompileTimeError
-switch_bad_case_test/02: MissingCompileTimeError
-switch_case_test/00: MissingCompileTimeError
-switch_case_test/01: MissingCompileTimeError
-switch_case_test/02: MissingCompileTimeError
sync_generator2_test/41: Crash # 'file:*/pkg/compiler/lib/src/kernel/element_map_impl.dart': Failed assertion: line 939 pos 18: 'asyncMarker == AsyncMarker.SYNC': is not true.
sync_generator2_test/52: Crash # 'file:*/pkg/compiler/lib/src/kernel/element_map_impl.dart': Failed assertion: line 939 pos 18: 'asyncMarker == AsyncMarker.SYNC': is not true.
syntax_test/21: Crash # 'file:*/pkg/compiler/lib/src/kernel/env.dart': Failed assertion: line 322 pos 16: '!name.contains('#')': is not true.
syntax_test/22: Crash # 'file:*/pkg/compiler/lib/src/kernel/env.dart': Failed assertion: line 322 pos 16: '!name.contains('#')': is not true.
-syntax_test/28: MissingCompileTimeError # Issue 29763
-syntax_test/29: MissingCompileTimeError # Issue 29763
-syntax_test/30: MissingCompileTimeError # Issue 29763
-syntax_test/31: MissingCompileTimeError # Issue 29763
-syntax_test/32: MissingCompileTimeError # Issue 29763
-syntax_test/33: MissingCompileTimeError # Issue 29763
-tearoff_dynamic_test: RuntimeError
-truncdiv_test: RuntimeError # non JS number semantics - Issue 15246
-try_catch_test/01: MissingCompileTimeError
-type_error_test: RuntimeError
type_literal_prefix_call_test/00: MissingCompileTimeError
-type_literal_test: RuntimeError
-type_promotion_functions_test/02: CompileTimeError
-type_promotion_functions_test/03: CompileTimeError
-type_promotion_functions_test/04: CompileTimeError
-type_promotion_functions_test/09: CompileTimeError
-type_promotion_functions_test/11: CompileTimeError
-type_promotion_functions_test/12: CompileTimeError
-type_promotion_functions_test/13: CompileTimeError
-type_promotion_functions_test/14: CompileTimeError
-type_promotion_functions_test/none: CompileTimeError
type_promotion_logical_and_test/01: MissingCompileTimeError
-type_promotion_more_specific_test/04: CompileTimeError
type_variable_bounds2_test: MissingCompileTimeError
type_variable_bounds3_test/00: MissingCompileTimeError
type_variable_bounds4_test/01: MissingCompileTimeError
@@ -1204,7 +679,6 @@
type_variable_bounds_test/06: MissingCompileTimeError
type_variable_bounds_test/08: MissingCompileTimeError
type_variable_bounds_test/11: MissingCompileTimeError
-type_variable_promotion_test: RuntimeError
vm/async_await_catch_stacktrace_test: Crash # Assertion failure: Runtime type information not available for type_variable_local(bindCallback.R) in (local(_RootZone.bindCallback#)) for j:closure_call(_RootZone_bindCallback_closure.call).
vm/await_synchronous_future_test: Crash # Interpolated value #1 is not an Expression or List of Expressions: [VariableUse(f), Instance of 'LiteralNull', null]
vm/causal_async_exception_stack2_test: Crash # Assertion failure: Unexpected arguments. Expected 1 argument, actual: [invoke dynamic method: selector=Selector(operator, *, arity=1), mask=[subclass=JSUInt32], HTypeInfoReadVariable(ListQueue.E)].
@@ -1283,159 +757,53 @@
abstract_override_adds_optional_args_concrete_test: MissingCompileTimeError
additional_interface_adds_optional_args_concrete_subclass_test: MissingCompileTimeError
additional_interface_adds_optional_args_concrete_test: MissingCompileTimeError
-assertion_test: RuntimeError
-async_await_test/02: RuntimeError
-async_await_test/03: RuntimeError
-async_await_test/none: RuntimeError
async_or_generator_return_type_stacktrace_test/01: MissingCompileTimeError
async_or_generator_return_type_stacktrace_test/02: MissingCompileTimeError
async_or_generator_return_type_stacktrace_test/03: MissingCompileTimeError
async_return_types_test/nestedFuture: Crash # Interpolated value #1 is not an Expression or List of Expressions: [VariableUse(f), Instance of 'LiteralNull', null]
async_return_types_test/wrongReturnType: Crash # Interpolated value #1 is not an Expression or List of Expressions: [VariableUse(f), Instance of 'LiteralNull', null]
async_star_cancel_while_paused_test: Crash # Interpolated value #1 is not an Expression or List of Expressions: [VariableUse(f), Instance of 'LiteralNull', null]
-async_star_test/02: RuntimeError
await_not_started_immediately_test: Crash # Assertion failure: Runtime type information not available for type_variable_local(bindCallback.R) in (local(_RootZone.bindCallback#)) for j:closure_call(_RootZone_bindCallback_closure.call).
-bit_operations_test: RuntimeError
-branch_canonicalization_test: RuntimeError
call_non_method_field_test/01: MissingCompileTimeError
call_non_method_field_test/02: MissingCompileTimeError
call_with_no_such_method_test: RuntimeError
-canonical_const2_test: RuntimeError, OK # non JS number semantics
check_member_static_test/01: MissingCompileTimeError
-class_cycle_test/02: MissingCompileTimeError
-class_cycle_test/03: MissingCompileTimeError
class_literal_static_test/01: MissingCompileTimeError
class_literal_static_test/03: MissingCompileTimeError
class_literal_static_test/07: MissingCompileTimeError
compile_time_constant_k_test/01: MissingCompileTimeError
compile_time_constant_k_test/02: MissingCompileTimeError
compile_time_constant_k_test/03: MissingCompileTimeError
-compile_time_constant_o_test/01: MissingCompileTimeError
-compile_time_constant_o_test/02: MissingCompileTimeError
-compile_time_constant_static5_test/11: CompileTimeError
-compile_time_constant_static5_test/16: CompileTimeError
-compile_time_constant_static5_test/21: CompileTimeError
-compile_time_constant_static5_test/23: CompileTimeError
-conditional_rewrite_test: RuntimeError
config_import_corelib_test: CompileTimeError
-config_import_test: RuntimeError
-const_dynamic_type_literal_test/02: MissingCompileTimeError
-const_evaluation_test/01: RuntimeError
-const_instance_field_test/01: MissingCompileTimeError
-const_list_test: RuntimeError
-const_map2_test/00: MissingCompileTimeError
-const_map3_test/00: MissingCompileTimeError
-const_map4_test: RuntimeError
-const_switch2_test/01: MissingCompileTimeError
-const_switch_test/02: RuntimeError, OK # constant identity based on JS constants
-const_switch_test/04: RuntimeError, OK # constant identity based on JS constants
-const_types_test/34: MissingCompileTimeError
-const_types_test/39: MissingCompileTimeError
-constants_test/05: MissingCompileTimeError
-constructor12_test: RuntimeError
-constructor_named_arguments_test/none: RuntimeError
-constructor_redirect_cycle_test/01: Crash # Issue 30856
-constructor_redirect_indirect_cycle_test/01: Crash # Stack Overflow
-constructor_redirect_test/01: Crash # Assertion failure: Cannot find value Instance of 'ThisLocal' in (local(A.named2#x), local(A.named2#y), local(A.named2#z)) for j:constructor(A.named2).
-covariance_type_parameter_test/02: RuntimeError
covariant_subtyping_test: RuntimeError
-cyclic_constructor_test/01: Crash # Issue 30856
cyclic_type_variable_test/01: MissingCompileTimeError
cyclic_type_variable_test/02: MissingCompileTimeError
cyclic_type_variable_test/03: MissingCompileTimeError
cyclic_type_variable_test/04: MissingCompileTimeError
default_factory2_test/01: MissingCompileTimeError
default_factory_test/01: MissingCompileTimeError
-deferred_inheritance_constraints_test/extends: MissingCompileTimeError
-deferred_inheritance_constraints_test/implements: MissingCompileTimeError
-deferred_inheritance_constraints_test/mixin: MissingCompileTimeError
deferred_inheritance_constraints_test/redirecting_constructor: MissingCompileTimeError
-deferred_load_library_wrong_args_test/01: CompileTimeError
-deferred_not_loaded_check_test: RuntimeError # Test out of date. Issue 31933
-deferred_redirecting_factory_test: RuntimeError
-double_int_to_string_test: RuntimeError, OK # non JS number semantics
-duplicate_implements_test/01: MissingCompileTimeError
-duplicate_implements_test/02: MissingCompileTimeError
-dynamic_prefix_core_test/none: CompileTimeError
-emit_const_fields_test: CompileTimeError
-enum_mirror_test: RuntimeError
-example_constructor_test: RuntimeError
-expect_test: RuntimeError, OK # Issue 13080
-external_test/10: MissingRuntimeError
-external_test/13: MissingRuntimeError
-external_test/20: MissingRuntimeError
-external_test/21: CompileTimeError
-external_test/24: CompileTimeError
-f_bounded_quantification4_test: RuntimeError # Issue 12605
f_bounded_quantification_test/01: MissingCompileTimeError
f_bounded_quantification_test/02: MissingCompileTimeError
factory4_test/00: MissingCompileTimeError
field3_test/01: MissingCompileTimeError
-field_initialization_order_test/01: MissingCompileTimeError
-field_initialization_order_test/none: RuntimeError
field_override_test/00: MissingCompileTimeError
field_override_test/01: MissingCompileTimeError
-flatten_test/05: MissingRuntimeError
-flatten_test/08: MissingRuntimeError
-flatten_test/09: MissingRuntimeError
-flatten_test/12: MissingRuntimeError
-full_stacktrace1_test: RuntimeError # Issue 12698
-full_stacktrace2_test: RuntimeError # Issue 12698
-full_stacktrace3_test: RuntimeError # Issue 12698
-function_subtype_inline2_test: RuntimeError
-function_subtype_setter0_test: RuntimeError
-generic_function_bounds_test: RuntimeError
-generic_function_dcall_test: RuntimeError
-generic_function_type_as_type_argument_test/01: MissingCompileTimeError
-generic_function_type_as_type_argument_test/02: MissingCompileTimeError
-generic_instanceof2_test: RuntimeError
-generic_is_check_test: RuntimeError
generic_methods_bounds_test/01: MissingCompileTimeError
-generic_methods_bounds_test/02: MissingRuntimeError
-generic_methods_generic_function_result_test/01: MissingCompileTimeError
generic_methods_overriding_test/01: MissingCompileTimeError
generic_methods_recursive_bound_test/02: MissingCompileTimeError
-generic_methods_unused_parameter_test: RuntimeError
-generic_no_such_method_dispatcher_simple_test: CompileTimeError
-generic_no_such_method_dispatcher_test: CompileTimeError
-generic_tearoff_test: CompileTimeError
-identical_closure2_test: RuntimeError # non JS number semantics
identical_const_test/01: MissingCompileTimeError
identical_const_test/02: MissingCompileTimeError
identical_const_test/03: MissingCompileTimeError
identical_const_test/04: MissingCompileTimeError
-if_null_precedence_test/none: RuntimeError
-infinity_test: RuntimeError # non JS number semantics - Issue 4984
-instance_creation_in_function_annotation_test: RuntimeError
-instantiate_tearoff_of_call_test: CompileTimeError
-int64_literal_test/01: RuntimeError
-int64_literal_test/02: RuntimeError
-int64_literal_test/04: RuntimeError
-int64_literal_test/05: RuntimeError
-int64_literal_test/10: RuntimeError
-int64_literal_test/20: RuntimeError
-int64_literal_test/40: RuntimeError
-int64_literal_test/none: RuntimeError
-integer_division_by_zero_test: RuntimeError # Issue 8301
-internal_library_test/02: Crash # NoSuchMethodError: Class 'DillLibraryBuilder' has no instance getter 'mixinApplicationClasses'.
invocation_mirror2_test: RuntimeError # mirrors not supported
-invocation_mirror_invoke_on2_test: RuntimeError
-invocation_mirror_invoke_on_test: RuntimeError
invocation_mirror_test: RuntimeError
issue18628_2_test/01: MissingCompileTimeError
-issue21079_test: RuntimeError
issue23244_test: Crash # Interpolated value #1 is not an Expression or List of Expressions: [VariableUse(f), Instance of 'LiteralNull', null]
issue31596_override_test/07: MissingCompileTimeError
issue31596_override_test/08: MissingCompileTimeError
-issue31596_super_test/01: CompileTimeError
-issue31596_super_test/03: CompileTimeError
-left_shift_test: RuntimeError # non JS number semantics
-library_env_test/has_mirror_support: RuntimeError
library_env_test/has_no_html_support: RuntimeError
library_env_test/has_no_io_support: RuntimeError
-local_function2_test/none: RuntimeError
-local_function3_test/none: RuntimeError
-local_function_test/none: RuntimeError
malbounded_instantiation_test/01: MissingCompileTimeError
malbounded_instantiation_test/02: MissingCompileTimeError
malbounded_instantiation_test/03: MissingCompileTimeError
@@ -1456,48 +824,7 @@
map_literal3_test/01: MissingCompileTimeError
map_literal3_test/02: MissingCompileTimeError
map_literal3_test/03: MissingCompileTimeError
-method_override_test: CompileTimeError
-minify_closure_variable_collision_test: CompileTimeError
-mint_arithmetic_test: RuntimeError # non JS number semantics
-mixin_forwarding_constructor4_test/01: MissingCompileTimeError
-mixin_forwarding_constructor4_test/02: MissingCompileTimeError
-mixin_forwarding_constructor4_test/03: MissingCompileTimeError
mixin_generic_test: RuntimeError # Issue 12605
-mixin_illegal_super_use_test/01: MissingCompileTimeError
-mixin_illegal_super_use_test/04: MissingCompileTimeError
-mixin_illegal_super_use_test/07: MissingCompileTimeError
-mixin_illegal_super_use_test/10: MissingCompileTimeError
-mixin_illegal_super_use_test/11: MissingCompileTimeError
-mixin_illegal_superclass_test/01: MissingCompileTimeError
-mixin_illegal_superclass_test/02: MissingCompileTimeError
-mixin_illegal_superclass_test/03: MissingCompileTimeError
-mixin_illegal_superclass_test/04: MissingCompileTimeError
-mixin_illegal_superclass_test/05: MissingCompileTimeError
-mixin_illegal_superclass_test/06: MissingCompileTimeError
-mixin_illegal_superclass_test/07: MissingCompileTimeError
-mixin_illegal_superclass_test/08: MissingCompileTimeError
-mixin_illegal_superclass_test/09: MissingCompileTimeError
-mixin_illegal_superclass_test/10: MissingCompileTimeError
-mixin_illegal_superclass_test/11: MissingCompileTimeError
-mixin_illegal_superclass_test/12: MissingCompileTimeError
-mixin_illegal_superclass_test/13: MissingCompileTimeError
-mixin_illegal_superclass_test/14: MissingCompileTimeError
-mixin_illegal_superclass_test/15: MissingCompileTimeError
-mixin_illegal_superclass_test/16: MissingCompileTimeError
-mixin_illegal_superclass_test/17: MissingCompileTimeError
-mixin_illegal_superclass_test/18: MissingCompileTimeError
-mixin_illegal_superclass_test/19: MissingCompileTimeError
-mixin_illegal_superclass_test/20: MissingCompileTimeError
-mixin_illegal_superclass_test/21: MissingCompileTimeError
-mixin_illegal_superclass_test/22: MissingCompileTimeError
-mixin_illegal_superclass_test/23: MissingCompileTimeError
-mixin_illegal_superclass_test/24: MissingCompileTimeError
-mixin_illegal_superclass_test/25: MissingCompileTimeError
-mixin_illegal_superclass_test/26: MissingCompileTimeError
-mixin_illegal_superclass_test/27: MissingCompileTimeError
-mixin_illegal_superclass_test/28: MissingCompileTimeError
-mixin_illegal_superclass_test/29: MissingCompileTimeError
-mixin_illegal_superclass_test/30: MissingCompileTimeError
mixin_invalid_bound2_test/02: MissingCompileTimeError
mixin_invalid_bound2_test/03: MissingCompileTimeError
mixin_invalid_bound2_test/04: MissingCompileTimeError
@@ -1522,137 +849,32 @@
mixin_invalid_bound_test/09: MissingCompileTimeError
mixin_invalid_bound_test/10: MissingCompileTimeError
mixin_mixin_type_arguments_test: RuntimeError
-mixin_of_mixin_test/none: CompileTimeError
-mixin_super_2_test/none: CompileTimeError
mixin_super_bound_test/01: MissingCompileTimeError
mixin_super_bound_test/02: MissingCompileTimeError
-mixin_super_constructor_named_test/01: MissingCompileTimeError
-mixin_super_constructor_positionals_test/01: MissingCompileTimeError
-mixin_super_test: CompileTimeError
-mixin_super_use_test: CompileTimeError
-mixin_superclass_test: CompileTimeError
-mixin_supertype_subclass2_test/01: CompileTimeError
-mixin_supertype_subclass2_test/02: CompileTimeError
-mixin_supertype_subclass2_test/03: CompileTimeError
-mixin_supertype_subclass2_test/04: CompileTimeError
-mixin_supertype_subclass2_test/05: CompileTimeError
-mixin_supertype_subclass2_test/none: CompileTimeError
-mixin_supertype_subclass3_test/01: CompileTimeError
-mixin_supertype_subclass3_test/02: CompileTimeError
-mixin_supertype_subclass3_test/03: CompileTimeError
-mixin_supertype_subclass3_test/04: CompileTimeError
-mixin_supertype_subclass3_test/05: CompileTimeError
-mixin_supertype_subclass3_test/none: CompileTimeError
-mixin_supertype_subclass4_test/01: CompileTimeError
-mixin_supertype_subclass4_test/02: CompileTimeError
-mixin_supertype_subclass4_test/03: CompileTimeError
-mixin_supertype_subclass4_test/04: CompileTimeError
-mixin_supertype_subclass4_test/05: CompileTimeError
-mixin_supertype_subclass4_test/none: CompileTimeError
-mixin_supertype_subclass_test/01: CompileTimeError
-mixin_supertype_subclass_test/03: CompileTimeError
-mixin_supertype_subclass_test/04: CompileTimeError
-mixin_supertype_subclass_test/none: CompileTimeError
mixin_type_parameters_errors_test/03: MissingCompileTimeError
mixin_type_parameters_errors_test/04: MissingCompileTimeError
-mock_writable_final_field_test: RuntimeError # Issue 30847
-mock_writable_final_private_field_test: RuntimeError # Issue 17526, 30847
-modulo_test: RuntimeError # non JS number semantics
-multiline_newline_test/04: MissingCompileTimeError
-multiline_newline_test/04r: MissingCompileTimeError
-multiline_newline_test/05: MissingCompileTimeError
-multiline_newline_test/05r: MissingCompileTimeError
-multiline_newline_test/06: MissingCompileTimeError
-multiline_newline_test/06r: MissingCompileTimeError
named_constructor_test/01: MissingCompileTimeError
-named_parameters_default_eq_test/02: MissingCompileTimeError
-named_parameters_default_eq_test/none: RuntimeError
-nan_identical_test: RuntimeError # Issue 11551
-nested_generic_closure_test: RuntimeError
-no_main_test/01: CompileTimeError
-no_such_method_mock_test: RuntimeError
no_such_method_native_test: RuntimeError
no_such_method_test: RuntimeError
-null_no_such_method_test: CompileTimeError
-number_identity2_test: RuntimeError
-numbers_test: RuntimeError, OK # non JS number semantics
overridden_no_such_method_test: RuntimeError
override_field_test/02: MissingCompileTimeError
override_field_test/03: MissingCompileTimeError
-override_inheritance_field_test/04: CompileTimeError
-override_inheritance_field_test/06: CompileTimeError
-override_inheritance_field_test/26: CompileTimeError
-override_inheritance_field_test/29: CompileTimeError
override_inheritance_field_test/44: MissingCompileTimeError
override_inheritance_field_test/47: MissingCompileTimeError
override_inheritance_field_test/48: MissingCompileTimeError
override_inheritance_field_test/53: MissingCompileTimeError
override_inheritance_field_test/54: MissingCompileTimeError
-override_inheritance_generic_test/02: CompileTimeError
-override_inheritance_method_test/28: CompileTimeError
-override_inheritance_method_test/29: CompileTimeError
-parser_quirks_test: CompileTimeError
recursive_generic_test: RuntimeError
-redirecting_factory_default_values_test/01: MissingCompileTimeError
-redirecting_factory_default_values_test/02: MissingCompileTimeError
redirecting_factory_infinite_steps_test/01: MissingCompileTimeError
redirecting_factory_malbounded_test/01: MissingCompileTimeError
-redirecting_factory_reflection_test: RuntimeError
regress_13462_1_test: RuntimeError
regress_18535_test: RuntimeError
regress_21795_test: RuntimeError # Issue 12605
-regress_23408_test: CompileTimeError
-regress_24283_test: RuntimeError, OK # Requires 64 bit numbers.
-regress_27617_test/1: Crash # Assertion failure: Unexpected constructor j:constructor(Foo._) in ConstructorDataImpl._getConstructorConstant
-regress_28255_test: RuntimeError
-regress_29025_test: CompileTimeError
-regress_29405_test: CompileTimeError
-regress_29784_test/01: Crash # Issue 29784
-regress_29784_test/02: MissingCompileTimeError # Issue 29784
-regress_30339_test: CompileTimeError
setter4_test: MissingCompileTimeError
-setter_no_getter_test/01: CompileTimeError
stack_trace_test: RuntimeError, OK # Stack trace not preserved in minified code.
-stacktrace_demangle_ctors_test: RuntimeError # Issue 12698
-stacktrace_rethrow_error_test/none: RuntimeError # Issue 12698
-stacktrace_rethrow_error_test/withtraceparameter: RuntimeError # Issue 12698
-stacktrace_rethrow_nonerror_test: RuntimeError # Issue 12698
-stacktrace_test: RuntimeError # Issue 12698
-string_interpolation_and_buffer_test: RuntimeError
-string_split_test: CompileTimeError
-string_supertype_checked_test: CompileTimeError
-super_bound_closure_test/none: CompileTimeError
-super_call4_test/01: MissingCompileTimeError
-super_test: RuntimeError
-switch_bad_case_test/01: MissingCompileTimeError
-switch_bad_case_test/02: MissingCompileTimeError
-switch_case_test/00: MissingCompileTimeError
-switch_case_test/01: MissingCompileTimeError
-switch_case_test/02: MissingCompileTimeError
symbol_conflict_test: RuntimeError # Issue 23857
-syntax_test/28: MissingCompileTimeError # Issue 29763
-syntax_test/29: MissingCompileTimeError # Issue 29763
-syntax_test/30: MissingCompileTimeError # Issue 29763
-syntax_test/31: MissingCompileTimeError # Issue 29763
-syntax_test/32: MissingCompileTimeError # Issue 29763
-syntax_test/33: MissingCompileTimeError # Issue 29763
-tearoff_dynamic_test: RuntimeError
-truncdiv_test: RuntimeError # non JS number semantics - Issue 15246
-try_catch_test/01: MissingCompileTimeError
-type_error_test: RuntimeError
type_literal_prefix_call_test/00: MissingCompileTimeError
-type_literal_test: RuntimeError
-type_promotion_functions_test/02: CompileTimeError
-type_promotion_functions_test/03: CompileTimeError
-type_promotion_functions_test/04: CompileTimeError
-type_promotion_functions_test/09: CompileTimeError
-type_promotion_functions_test/11: CompileTimeError
-type_promotion_functions_test/12: CompileTimeError
-type_promotion_functions_test/13: CompileTimeError
-type_promotion_functions_test/14: CompileTimeError
-type_promotion_functions_test/none: CompileTimeError
type_promotion_logical_and_test/01: MissingCompileTimeError
-type_promotion_more_specific_test/04: CompileTimeError
type_variable_bounds2_test: MissingCompileTimeError
type_variable_bounds3_test/00: MissingCompileTimeError
type_variable_bounds4_test/01: MissingCompileTimeError
@@ -1664,7 +886,6 @@
type_variable_bounds_test/06: MissingCompileTimeError
type_variable_bounds_test/08: MissingCompileTimeError
type_variable_bounds_test/11: MissingCompileTimeError
-type_variable_promotion_test: RuntimeError
vm/async_await_catch_stacktrace_test: Crash # Assertion failure: Runtime type information not available for type_variable_local(bindCallback.R) in (local(_RootZone.bindCallback#)) for j:closure_call(_RootZone_bindCallback_closure.call).
vm/await_synchronous_future_test: Crash # Interpolated value #1 is not an Expression or List of Expressions: [VariableUse(f), Instance of 'LiteralNull', null]
vm/causal_async_exception_stack2_test: Crash # Wrong number of template arguments, given 2, expected 1
@@ -1702,11 +923,6 @@
wrong_number_type_arguments_test/01: MissingCompileTimeError
wrong_number_type_arguments_test/none: Pass
-[ $compiler == dart2js && $fasta && $strong ]
-const_constructor3_test/04: MissingCompileTimeError # OK - Subtype check uses JS number semantics.
-covariant_subtyping_test: Crash
-ct_const_test: RuntimeError
-
[ $compiler == dart2js && $fasta && !$strong ]
*: SkipByDesign
@@ -1727,3 +943,255 @@
mixin_mixin_bound_test: RuntimeError # Issue 31054
mixin_mixin_type_arguments_test: RuntimeError # Issue 31054
runtime_type_function_test: RuntimeError # Uses runtimeType.toString()
+
+[ $compiler == dart2js && $strong ]
+assertion_test: RuntimeError
+async_await_test/02: RuntimeError
+async_await_test/03: RuntimeError
+async_await_test/none: RuntimeError
+async_star_test/02: RuntimeError
+bit_operations_test: RuntimeError
+branch_canonicalization_test: RuntimeError
+canonical_const2_test: RuntimeError, OK # non JS number semantics
+class_cycle_test/02: MissingCompileTimeError
+class_cycle_test/03: MissingCompileTimeError
+compile_time_constant_o_test/01: MissingCompileTimeError
+compile_time_constant_o_test/02: MissingCompileTimeError
+compile_time_constant_static5_test/11: CompileTimeError
+compile_time_constant_static5_test/16: CompileTimeError
+compile_time_constant_static5_test/21: CompileTimeError
+compile_time_constant_static5_test/23: CompileTimeError
+conditional_rewrite_test: RuntimeError
+config_import_test: RuntimeError
+const_constructor3_test/04: MissingCompileTimeError # OK - Subtype check uses JS number semantics.
+const_dynamic_type_literal_test/02: MissingCompileTimeError
+const_evaluation_test/01: RuntimeError
+const_instance_field_test/01: MissingCompileTimeError
+const_list_test: RuntimeError
+const_map2_test/00: MissingCompileTimeError
+const_map3_test/00: MissingCompileTimeError
+const_map4_test: RuntimeError
+const_switch2_test/01: MissingCompileTimeError
+const_switch_test/02: RuntimeError, OK # constant identity based on JS constants
+const_switch_test/04: RuntimeError, OK # constant identity based on JS constants
+const_types_test/34: MissingCompileTimeError
+const_types_test/39: MissingCompileTimeError
+constructor12_test: RuntimeError
+constructor_named_arguments_test/none: RuntimeError
+constructor_redirect_test/01: Crash # Assertion failure: Cannot find value Instance of 'ThisLocal' in (local(A.named2#x), local(A.named2#y), local(A.named2#z)) for j:constructor(A.named2).
+covariance_type_parameter_test/02: RuntimeError
+covariant_subtyping_test: Crash
+ct_const_test: RuntimeError
+cyclic_type_test/00: RuntimeError
+cyclic_type_test/02: RuntimeError
+cyclic_type_test/03: RuntimeError
+cyclic_type_test/04: RuntimeError
+deferred_inheritance_constraints_test/extends: MissingCompileTimeError
+deferred_inheritance_constraints_test/implements: MissingCompileTimeError
+deferred_inheritance_constraints_test/mixin: MissingCompileTimeError
+deferred_load_library_wrong_args_test/01: CompileTimeError
+deferred_not_loaded_check_test: RuntimeError # Test out of date. Issue 31933
+deferred_redirecting_factory_test: RuntimeError
+double_int_to_string_test: RuntimeError, OK # non JS number semantics
+duplicate_implements_test/01: MissingCompileTimeError
+duplicate_implements_test/02: MissingCompileTimeError
+dynamic_prefix_core_test/none: CompileTimeError
+emit_const_fields_test: CompileTimeError
+enum_mirror_test: RuntimeError
+example_constructor_test: RuntimeError
+expect_test: RuntimeError, OK # Issue 13080
+external_test/10: MissingRuntimeError
+external_test/13: MissingRuntimeError
+external_test/20: MissingRuntimeError
+external_test/21: CompileTimeError
+external_test/24: CompileTimeError
+f_bounded_quantification4_test: RuntimeError
+field_initialization_order_test/01: MissingCompileTimeError
+field_initialization_order_test/none: RuntimeError
+flatten_test/05: MissingRuntimeError
+flatten_test/08: MissingRuntimeError
+flatten_test/09: MissingRuntimeError
+flatten_test/12: MissingRuntimeError
+full_stacktrace1_test: RuntimeError # Issue 12698
+full_stacktrace2_test: RuntimeError # Issue 12698
+full_stacktrace3_test: RuntimeError # Issue 12698
+function_subtype_inline2_test: RuntimeError
+function_subtype_setter0_test: RuntimeError
+generic_function_bounds_test: RuntimeError
+generic_function_dcall_test: RuntimeError
+generic_function_type_as_type_argument_test/01: MissingCompileTimeError
+generic_function_type_as_type_argument_test/02: MissingCompileTimeError
+generic_instanceof2_test: RuntimeError
+generic_is_check_test: RuntimeError
+generic_methods_bounds_test/02: MissingRuntimeError
+generic_methods_generic_function_result_test/01: MissingCompileTimeError
+generic_methods_unused_parameter_test: RuntimeError
+generic_no_such_method_dispatcher_simple_test: CompileTimeError
+generic_no_such_method_dispatcher_test: CompileTimeError
+generic_tearoff_test: CompileTimeError
+identical_closure2_test: RuntimeError # non JS number semantics
+if_null_precedence_test/none: RuntimeError
+infinity_test: RuntimeError # non JS number semantics - Issue 4984
+instance_creation_in_function_annotation_test: RuntimeError
+instantiate_tearoff_of_call_test: CompileTimeError
+int64_literal_test/01: RuntimeError
+int64_literal_test/02: RuntimeError
+int64_literal_test/04: RuntimeError
+int64_literal_test/05: RuntimeError
+int64_literal_test/10: RuntimeError
+int64_literal_test/20: RuntimeError
+int64_literal_test/40: RuntimeError
+int64_literal_test/none: RuntimeError
+integer_division_by_zero_test: RuntimeError # Issue 8301
+internal_library_test/02: Crash
+invocation_mirror_invoke_on2_test: RuntimeError
+invocation_mirror_invoke_on_test: RuntimeError
+issue21079_test: RuntimeError
+issue31596_super_test/01: CompileTimeError
+issue31596_super_test/03: CompileTimeError
+left_shift_test: RuntimeError # non JS number semantics
+library_env_test/has_mirror_support: RuntimeError
+local_function2_test/none: RuntimeError
+local_function3_test/none: RuntimeError
+local_function_test/none: RuntimeError
+method_override_test: CompileTimeError
+minify_closure_variable_collision_test: CompileTimeError
+mint_arithmetic_test: RuntimeError # non JS number semantics
+mixin_forwarding_constructor4_test/01: MissingCompileTimeError
+mixin_forwarding_constructor4_test/02: MissingCompileTimeError
+mixin_forwarding_constructor4_test/03: MissingCompileTimeError
+mixin_illegal_super_use_test/01: MissingCompileTimeError
+mixin_illegal_super_use_test/04: MissingCompileTimeError
+mixin_illegal_super_use_test/07: MissingCompileTimeError
+mixin_illegal_super_use_test/10: MissingCompileTimeError
+mixin_illegal_super_use_test/11: MissingCompileTimeError
+mixin_illegal_superclass_test/01: MissingCompileTimeError
+mixin_illegal_superclass_test/02: MissingCompileTimeError
+mixin_illegal_superclass_test/03: MissingCompileTimeError
+mixin_illegal_superclass_test/04: MissingCompileTimeError
+mixin_illegal_superclass_test/05: MissingCompileTimeError
+mixin_illegal_superclass_test/06: MissingCompileTimeError
+mixin_illegal_superclass_test/07: MissingCompileTimeError
+mixin_illegal_superclass_test/08: MissingCompileTimeError
+mixin_illegal_superclass_test/09: MissingCompileTimeError
+mixin_illegal_superclass_test/10: MissingCompileTimeError
+mixin_illegal_superclass_test/11: MissingCompileTimeError
+mixin_illegal_superclass_test/12: MissingCompileTimeError
+mixin_illegal_superclass_test/13: MissingCompileTimeError
+mixin_illegal_superclass_test/14: MissingCompileTimeError
+mixin_illegal_superclass_test/15: MissingCompileTimeError
+mixin_illegal_superclass_test/16: MissingCompileTimeError
+mixin_illegal_superclass_test/17: MissingCompileTimeError
+mixin_illegal_superclass_test/18: MissingCompileTimeError
+mixin_illegal_superclass_test/19: MissingCompileTimeError
+mixin_illegal_superclass_test/20: MissingCompileTimeError
+mixin_illegal_superclass_test/21: MissingCompileTimeError
+mixin_illegal_superclass_test/22: MissingCompileTimeError
+mixin_illegal_superclass_test/23: MissingCompileTimeError
+mixin_illegal_superclass_test/24: MissingCompileTimeError
+mixin_illegal_superclass_test/25: MissingCompileTimeError
+mixin_illegal_superclass_test/26: MissingCompileTimeError
+mixin_illegal_superclass_test/27: MissingCompileTimeError
+mixin_illegal_superclass_test/28: MissingCompileTimeError
+mixin_illegal_superclass_test/29: MissingCompileTimeError
+mixin_illegal_superclass_test/30: MissingCompileTimeError
+mixin_mixin6_test: RuntimeError
+mixin_of_mixin_test/none: CompileTimeError
+mixin_super_2_test/none: CompileTimeError
+mixin_super_constructor_named_test/01: MissingCompileTimeError
+mixin_super_constructor_positionals_test/01: MissingCompileTimeError
+mixin_super_test: CompileTimeError
+mixin_super_use_test: CompileTimeError
+mixin_superclass_test: CompileTimeError
+mixin_supertype_subclass2_test/01: CompileTimeError
+mixin_supertype_subclass2_test/02: CompileTimeError
+mixin_supertype_subclass2_test/03: CompileTimeError
+mixin_supertype_subclass2_test/04: CompileTimeError
+mixin_supertype_subclass2_test/05: CompileTimeError
+mixin_supertype_subclass2_test/none: CompileTimeError
+mixin_supertype_subclass3_test/01: CompileTimeError
+mixin_supertype_subclass3_test/02: CompileTimeError
+mixin_supertype_subclass3_test/03: CompileTimeError
+mixin_supertype_subclass3_test/04: CompileTimeError
+mixin_supertype_subclass3_test/05: CompileTimeError
+mixin_supertype_subclass3_test/none: CompileTimeError
+mixin_supertype_subclass4_test/01: CompileTimeError
+mixin_supertype_subclass4_test/02: CompileTimeError
+mixin_supertype_subclass4_test/03: CompileTimeError
+mixin_supertype_subclass4_test/04: CompileTimeError
+mixin_supertype_subclass4_test/05: CompileTimeError
+mixin_supertype_subclass4_test/none: CompileTimeError
+mixin_supertype_subclass_test/01: CompileTimeError
+mixin_supertype_subclass_test/03: CompileTimeError
+mixin_supertype_subclass_test/04: CompileTimeError
+mixin_supertype_subclass_test/none: CompileTimeError
+mock_writable_final_field_test: RuntimeError # Issue 30847
+mock_writable_final_private_field_test: RuntimeError # Issue 17526, 30847
+modulo_test: RuntimeError # non JS number semantics
+named_parameters_default_eq_test/02: MissingCompileTimeError
+named_parameters_default_eq_test/none: RuntimeError
+nan_identical_test: RuntimeError # Issue 11551
+nested_generic_closure_test: RuntimeError
+no_main_test/01: CompileTimeError
+no_such_method_mock_test: RuntimeError
+null_no_such_method_test: CompileTimeError
+number_identity2_test: RuntimeError
+numbers_test: RuntimeError, OK # non JS number semantics
+override_inheritance_field_test/04: CompileTimeError
+override_inheritance_field_test/06: CompileTimeError
+override_inheritance_field_test/26: CompileTimeError
+override_inheritance_field_test/29: CompileTimeError
+override_inheritance_generic_test/02: CompileTimeError
+override_inheritance_method_test/28: CompileTimeError
+override_inheritance_method_test/29: CompileTimeError
+parser_quirks_test: CompileTimeError
+redirecting_factory_default_values_test/01: MissingCompileTimeError
+redirecting_factory_default_values_test/02: MissingCompileTimeError
+redirecting_factory_reflection_test: RuntimeError
+regress_23408_test: CompileTimeError
+regress_24283_test: RuntimeError, OK # non JS number semantics
+regress_27617_test/1: Crash # Assertion failure: Unexpected constructor j:constructor(Foo._) in ConstructorDataImpl._getConstructorConstant
+regress_28255_test: RuntimeError
+regress_29025_test: CompileTimeError
+regress_29405_test: CompileTimeError
+regress_29784_test/01: Crash
+regress_29784_test/02: MissingCompileTimeError # Issue 29784
+regress_30339_test: CompileTimeError
+setter_no_getter_test/01: CompileTimeError
+stacktrace_demangle_ctors_test: RuntimeError # Issue 12698
+stacktrace_rethrow_error_test/none: RuntimeError # Issue 12698
+stacktrace_rethrow_error_test/withtraceparameter: RuntimeError # Issue 12698
+stacktrace_rethrow_nonerror_test: RuntimeError # Issue 12698
+stacktrace_test: RuntimeError # Issue 12698
+string_interpolation_and_buffer_test: RuntimeError
+string_split_test: CompileTimeError
+string_supertype_checked_test: CompileTimeError
+super_bound_closure_test/none: CompileTimeError
+super_call4_test/01: MissingCompileTimeError
+super_test: RuntimeError
+switch_bad_case_test/01: MissingCompileTimeError
+switch_bad_case_test/02: MissingCompileTimeError
+switch_case_test/00: MissingCompileTimeError
+switch_case_test/01: MissingCompileTimeError
+switch_case_test/02: MissingCompileTimeError
+syntax_test/28: MissingCompileTimeError # Issue 29763
+syntax_test/29: MissingCompileTimeError # Issue 29763
+syntax_test/30: MissingCompileTimeError # Issue 29763
+syntax_test/31: MissingCompileTimeError # Issue 29763
+syntax_test/32: MissingCompileTimeError # Issue 29763
+syntax_test/33: MissingCompileTimeError # Issue 29763
+tearoff_dynamic_test: RuntimeError
+truncdiv_test: RuntimeError # non JS number semantics - Issue 15246
+type_error_test: RuntimeError
+type_literal_test: RuntimeError
+type_promotion_functions_test/02: CompileTimeError
+type_promotion_functions_test/03: CompileTimeError
+type_promotion_functions_test/04: CompileTimeError
+type_promotion_functions_test/09: CompileTimeError
+type_promotion_functions_test/11: CompileTimeError
+type_promotion_functions_test/12: CompileTimeError
+type_promotion_functions_test/13: CompileTimeError
+type_promotion_functions_test/14: CompileTimeError
+type_promotion_functions_test/none: CompileTimeError
+type_promotion_more_specific_test/04: CompileTimeError
+type_variable_promotion_test: RuntimeError
diff --git a/tests/language_2/language_2_dartdevc.status b/tests/language_2/language_2_dartdevc.status
index 83843ad..bd43f56 100644
--- a/tests/language_2/language_2_dartdevc.status
+++ b/tests/language_2/language_2_dartdevc.status
@@ -36,11 +36,6 @@
const_constructor_mixin3_test/01: MissingCompileTimeError # Issue 33644
const_constructor_mixin_test/01: MissingCompileTimeError # Issue 33644
const_for_in_variable_test/01: MissingCompileTimeError
-const_types_test/07: MissingCompileTimeError
-const_types_test/08: MissingCompileTimeError
-const_types_test/14: MissingCompileTimeError
-const_types_test/15: MissingCompileTimeError
-constant_type_literal_test/01: MissingCompileTimeError # DDC allows type parameter type literals in const expressions.
constructor_type_parameter_test/00: MissingCompileTimeError
constructor_with_type_parameters_test/03: MissingCompileTimeError
covariance_field_test/03: RuntimeError
@@ -48,6 +43,7 @@
default_implementation2_test: CompileTimeError # Issue 30855
deferred_load_library_wrong_args_test/01: MissingRuntimeError, RuntimeError # Issue 29920
double_identical_test: RuntimeError # Negative and positive zero are distinct, but not in ddc
+dynamic_prefix_core_test/01: MissingCompileTimeError
emit_const_fields_test: CompileTimeError
enum_syntax_test/05: MissingCompileTimeError
enum_syntax_test/06: MissingCompileTimeError
@@ -77,7 +73,6 @@
implicit_downcast_during_compound_assignment_test: RuntimeError
implicit_downcast_during_indexed_compound_assignment_test: RuntimeError
implicit_downcast_during_indexed_if_null_assignment_test: RuntimeError
-import_core_prefix_test: CompileTimeError
import_private_test/01: MissingCompileTimeError # Issue 29920
initializing_formal_final_test: MissingCompileTimeError
instantiate_tearoff_after_contravariance_check_test: RuntimeError
@@ -161,6 +156,9 @@
reify_typevar_static_test/00: MissingCompileTimeError # Issue 29920
setter_override2_test/02: MissingCompileTimeError # Issue 14736
stacktrace_test: RuntimeError # Issue 29920
+static_setter_conflicts_test/02: MissingCompileTimeError
+static_setter_conflicts_test/11: MissingCompileTimeError
+static_setter_conflicts_test/12: MissingCompileTimeError
string_split_test: CompileTimeError
string_supertype_checked_test: CompileTimeError
super_bound_closure_test/none: CompileTimeError
@@ -368,7 +366,6 @@
constants_test/05: MissingCompileTimeError
constructor_redirect_test/01: MissingCompileTimeError
covariant_subtyping_test: RuntimeError
-cyclic_constructor_test/01: MissingCompileTimeError
cyclic_type_variable_test/01: MissingCompileTimeError
cyclic_type_variable_test/02: MissingCompileTimeError
cyclic_type_variable_test/03: MissingCompileTimeError
diff --git a/tests/language_2/language_2_kernel.status b/tests/language_2/language_2_kernel.status
index b54747c..af6e7d3 100644
--- a/tests/language_2/language_2_kernel.status
+++ b/tests/language_2/language_2_kernel.status
@@ -162,6 +162,7 @@
type_promotion_functions_test/14: CompileTimeError
type_promotion_functions_test/none: CompileTimeError
type_promotion_more_specific_test/04: CompileTimeError
+vm/bool_check_stack_traces_test/02: RuntimeError # Issue 33584
vm/type_cast_vm_test: RuntimeError
web_int_literals_test/*: SkipByDesign # Test applies only to JavaScript targets
@@ -237,10 +238,7 @@
const_switch2_test/01: MissingCompileTimeError # KernelVM bug: Constant evaluation.
const_types_test/34: MissingCompileTimeError # Issue 32988
const_types_test/39: MissingCompileTimeError # Issue 32988
-constructor_redirect_cycle_test/01: MissingCompileTimeError # Issue 30856
-constructor_redirect_indirect_cycle_test/01: MissingCompileTimeError # Issue 30856
constructor_redirect_test/01: MissingCompileTimeError # Fasta bug: Initializer refers to this.
-cyclic_constructor_test/01: MissingCompileTimeError # Issue 30856 (cyclic constructor redirection)
cyclic_type_variable_test/01: MissingCompileTimeError # Issue 32989 (missing cycle check in bounds)
cyclic_type_variable_test/02: MissingCompileTimeError # Issue 32989 (missing cycle check in bounds)
cyclic_type_variable_test/03: MissingCompileTimeError # Issue 32989 (missing cycle check in bounds)
@@ -2063,6 +2061,10 @@
static_getter_no_setter1_test/01: MissingCompileTimeError
static_getter_no_setter2_test/01: MissingCompileTimeError
static_initializer_type_error_test: MissingCompileTimeError
+static_setter_conflicts_test/01: MissingCompileTimeError
+static_setter_conflicts_test/03: MissingCompileTimeError
+static_setter_conflicts_test/04: MissingCompileTimeError
+static_setter_conflicts_test/07: MissingCompileTimeError
static_setter_get_test/01: MissingCompileTimeError
string_interpolation_test/01: MissingCompileTimeError
string_no_operator_test/01: MissingCompileTimeError
diff --git a/tests/language_2/static_setter_conflicts_test.dart b/tests/language_2/static_setter_conflicts_test.dart
new file mode 100644
index 0000000..c8e4395
--- /dev/null
+++ b/tests/language_2/static_setter_conflicts_test.dart
@@ -0,0 +1,26 @@
+// Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+class C {
+ static set foo(int x) {}
+
+ int foo(int x) => x; //# 01: compile-time error
+ static int foo(int x) => x; //# 02: compile-time error
+
+ int foo = 3; //# 03: compile-time error
+ final int foo = 4; //# 04: compile-time error
+ static int foo = 5; //# 05: compile-time error
+ static final int foo = 6; //# 06: ok
+
+ int get foo => 7; //# 07: compile-time error
+ static int get foo => 8; //# 08: ok
+
+ set foo(int x) {} //# 09: compile-time error
+ static set foo(int x) {} //# 10: compile-time error
+
+ C.foo(int x) {} //# 11: compile-time error
+ factory C.foo(int x) => null; //# 12: compile-time error
+}
+
+main() {}
diff --git a/tests/lib/lib.status b/tests/lib/lib.status
index 9dd0262..6ee2255 100644
--- a/tests/lib/lib.status
+++ b/tests/lib/lib.status
@@ -323,6 +323,9 @@
async/catch_errors11_test: Pass, Timeout # Issue 22696
async/timer_isActive_test: Fail, Pass, Timeout # Issue 22696
+[ $runtime == ff && $system == windows ]
+convert/utf85_test: Pass, Slow, Timeout
+
[ $runtime != none && !$strong ]
async/stream_first_where_test: RuntimeError
async/stream_last_where_test: RuntimeError
diff --git a/tests/lib_2/async/async_no_await_zones_test.dart b/tests/lib_2/async/async_no_await_zones_test.dart
new file mode 100644
index 0000000..789de01
--- /dev/null
+++ b/tests/lib_2/async/async_no_await_zones_test.dart
@@ -0,0 +1,32 @@
+// Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+// Regression test for https://github.com/dart-lang/sdk/issues/33330
+import 'dart:async';
+import 'package:expect/expect.dart';
+import 'package:async_helper/async_helper.dart';
+
+var log = [];
+
+main() {
+ asyncStart();
+ runZoned(() {
+ dynamic d = new AsyncDoEvent();
+ return d.doEvent();
+ }, zoneSpecification: new ZoneSpecification(
+ scheduleMicrotask: (self, parent, zone, fn) {
+ log.add('scheduleMicrotask()');
+ return parent.scheduleMicrotask(zone, fn);
+ },
+ )).then((_) {
+ Expect.listEquals(log, ['doEvent()', 'scheduleMicrotask()']);
+ asyncEnd();
+ });
+}
+
+class AsyncDoEvent {
+ Future doEvent() async {
+ log.add('doEvent()');
+ }
+}
diff --git a/tests/lib_2/html/event_callback_test.dart b/tests/lib_2/html/event_callback_test.dart
new file mode 100644
index 0000000..347e754
--- /dev/null
+++ b/tests/lib_2/html/event_callback_test.dart
@@ -0,0 +1,33 @@
+// Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+// Regression test for issue 33627.
+
+import 'dart:html';
+import 'package:expect/expect.dart';
+
+void main() {
+ try {
+ print('InputElement');
+ var i = new InputElement();
+ print('> onKeyPress');
+ i.onKeyPress.listen(onEvent);
+ print('> onClick');
+ i.onClick.listen(onEvent);
+ print('TextAreaElement');
+ var e = new TextAreaElement();
+ print('> onKeyPress');
+ e.onKeyPress.listen(onEvent);
+ print('> onClick');
+ e.onClick.listen(onEvent);
+ print('Done!');
+ } catch (e, s) {
+ print('$e\n$s');
+ Expect.fail("Unexpected exception: $e");
+ }
+}
+
+void onEvent(Event e) {
+ print(e);
+}
diff --git a/tests/lib_2/lib_2_dart2js.status b/tests/lib_2/lib_2_dart2js.status
index ac52cb5..c93bfb9 100644
--- a/tests/lib_2/lib_2_dart2js.status
+++ b/tests/lib_2/lib_2_dart2js.status
@@ -12,7 +12,6 @@
html/async_test: SkipByDesign
html/custom/document_register_type_extensions_test/construction: Pass, Timeout # Roll 50 failure
html/custom/document_register_type_extensions_test/registration: Pass, Timeout # Roll 50 failure
-html/custom/element_upgrade_failure_test: MissingCompileTimeError
html/custom/entered_left_view_test/shadow_dom: Pass, Timeout # Roll 50 failure
html/custom_elements_test: Pass, Timeout # Issue 26789
html/debugger_test: CompileTimeError # Issue 30900
@@ -172,6 +171,7 @@
html/element_types_shadow_test: RuntimeError
html/element_types_template_test: RuntimeError
html/element_types_track_test: RuntimeError
+html/event_callback_test: Skip # Browser test
html/event_customevent_test: RuntimeError
html/event_test: RuntimeError
html/events_test: RuntimeError
@@ -339,12 +339,14 @@
[ $compiler == dart2js && $runtime == d8 && $fasta && $minified ]
collection/list_test: RuntimeError
-[ $compiler == dart2js && $runtime != d8 && $runtime != jsshell ]
+[ $compiler == dart2js && $runtime != d8 ]
html/html_mock_test: RuntimeError # Issue 31038
html/input_element_attributes_test: RuntimeError
-html/js_dart_functions_test: RuntimeError # does not implement Dart 2 implicit `.call` tearoff
html/js_extend_class_test: RuntimeError
+[ $compiler == dart2js && $runtime != d8 && !$strong ]
+html/js_dart_functions_test: RuntimeError # does not implement Dart 2 implicit `.call` tearoff
+
[ $compiler == dart2js && $runtime == drt && !$checked ]
html/audiocontext_test/functional: Pass, Fail
@@ -381,6 +383,9 @@
html/text_event_test: Fail # Issue 17893
html/webgl_1_test: Pass, Fail # Issue 8219
+[ $compiler == dart2js && $runtime == ff && $system == windows ]
+convert/utf85_test: Pass, Slow, Timeout
+
[ $compiler == dart2js && $runtime == ie11 ]
html/element_types_content_test: RuntimeError # Issue 29922
html/element_types_datalist_test: RuntimeError # Issue 29922
@@ -484,6 +489,15 @@
html/custom/element_upgrade_test: Fail # Issue 17298
html/custom/js_custom_test: Fail # Issue 14643
+[ $compiler == dart2js && $browser && $strong ]
+collection/list_test: RuntimeError
+html/element_classes_svg_test: RuntimeError
+html/fileapi_directory_reader_test: RuntimeError
+html/interactive_media_test: RuntimeError
+html/js_array_test: RuntimeError
+html/js_mock_test: RuntimeError
+html/typed_arrays_range_checks_test: RuntimeError
+
[ $compiler == dart2js && $checked ]
convert/utf85_test: Pass, Slow # Issue 12029.
html/js_function_getter_trust_types_test: Skip # --trust-type-annotations incompatible with --checked
@@ -782,7 +796,17 @@
[ $compiler == dart2js && $minified ]
html/canvas_pixel_array_type_alias_test/types2_runtimeTypeName: Fail, OK # Issue 12605
+[ $compiler == dart2js && $strong ]
+async/future_or_type_test: RuntimeError
+async/future_test/01: RuntimeError
+async/future_test/none: RuntimeError
+async/slow_consumer2_test: RuntimeError
+async/stream_controller_async_test: RuntimeError
+async/stream_distinct_test: RuntimeError
+async/stream_join_test: RuntimeError
+
[ $compiler == dart2js && !$strong ]
+html/custom/element_upgrade_failure_test: MissingCompileTimeError
html/element_classes_svg_test: RuntimeError # Expected runtime type check only in strong mode.
[ $compiler == dart2js && ($runtime == chrome || $runtime == ff) ]
diff --git a/tests/lib_2/lib_2_precompiled.status b/tests/lib_2/lib_2_precompiled.status
index 27e575f..662e008 100644
--- a/tests/lib_2/lib_2_precompiled.status
+++ b/tests/lib_2/lib_2_precompiled.status
@@ -7,6 +7,7 @@
convert/utf85_test: Pass, Timeout
html/*: SkipByDesign # dart:html not supported on AOT.
mirrors/*: SkipByDesign # Mirrors not supported on AOT.
+async/async_no_await_zones_test: RuntimeError # Issue 33700
[ $compiler == app_jit || $compiler == none || $compiler == precompiler ]
async/future_or_strong_test: RuntimeError
diff --git a/tests/lib_2/lib_2_vm.status b/tests/lib_2/lib_2_vm.status
index 6b5454d..c17f0bc 100644
--- a/tests/lib_2/lib_2_vm.status
+++ b/tests/lib_2/lib_2_vm.status
@@ -93,6 +93,9 @@
[ $runtime == vm && !$checked && !$strong ]
mirrors/regress_16321_test/01: MissingCompileTimeError
+[ $runtime == vm && $no_preview_dart_2 ]
+async/async_no_await_zones_test: RuntimeError # not supported in Dart 1 mode.
+
[ $runtime == vm && ($arch == simarm || $arch == simarmv5te || $arch == simarmv6) ]
convert/utf85_test: Skip # Pass, Slow Issue 12644.
diff --git a/tests/standalone/io/http_override_test.dart b/tests/standalone/io/http_override_test.dart
index 6060a67..adcb2ab 100644
--- a/tests/standalone/io/http_override_test.dart
+++ b/tests/standalone/io/http_override_test.dart
@@ -13,6 +13,7 @@
MyHttpClient1(SecurityContext context);
Duration idleTimeout;
+ Duration connectionTimeout;
int maxConnectionsPerHost;
bool autoUncompress;
@@ -51,6 +52,7 @@
MyHttpClient2(SecurityContext context);
Duration idleTimeout;
+ Duration connectionTimeout;
int maxConnectionsPerHost;
bool autoUncompress;
diff --git a/tests/standalone/io/io_override_test.dart b/tests/standalone/io/io_override_test.dart
index 012e7ff..1e5983a 100644
--- a/tests/standalone/io/io_override_test.dart
+++ b/tests/standalone/io/io_override_test.dart
@@ -162,6 +162,11 @@
return null;
}
+Future<ConnectionTask<Socket>> socketStartConnect(host, int port,
+ {sourceAddress}) {
+ return null;
+}
+
Future<Null> ioOverridesRunTest() async {
Future<Null> f = IOOverrides.runZoned(
() async {
@@ -181,6 +186,7 @@
Expect.isNull(new Directory("directory").watch());
Expect.isTrue(new Link("link") is LinkMock);
Expect.isNull(Socket.connect(null, 0));
+ Expect.isNull(Socket.startConnect(null, 0));
},
createDirectory: DirectoryMock.createDirectory,
getCurrentDirectory: DirectoryMock.getCurrent,
@@ -197,6 +203,7 @@
fsWatchIsSupported: FileSystemWatcherMock.watchSupported,
createLink: LinkMock.createLink,
socketConnect: socketConnect,
+ socketStartConnect: socketStartConnect,
);
Expect.isFalse(new Directory("directory") is DirectoryMock);
Expect.isTrue(new Directory("directory") is Directory);
diff --git a/tests/standalone_2/io/http_shutdown_test.dart b/tests/standalone_2/io/http_shutdown_test.dart
index a3410db..c04a537 100644
--- a/tests/standalone_2/io/http_shutdown_test.dart
+++ b/tests/standalone_2/io/http_shutdown_test.dart
@@ -160,7 +160,8 @@
return request.close();
})
.then((response) {})
- .catchError((e) {}, test: (e) => e is HttpException);
+ .catchError((e) {},
+ test: (e) => e is HttpException || e is SocketException);
}
bool clientClosed = false;
new Timer.periodic(new Duration(milliseconds: 100), (timer) {
diff --git a/tests/standalone_2/io/raw_socket_test.dart b/tests/standalone_2/io/raw_socket_test.dart
index f5506cc..d46d1d6 100644
--- a/tests/standalone_2/io/raw_socket_test.dart
+++ b/tests/standalone_2/io/raw_socket_test.dart
@@ -74,6 +74,21 @@
});
}
+void testCancelConnect() {
+ asyncStart();
+ RawSocket.startConnect(InternetAddress.loopbackIPv4, 0)
+ .then((ConnectionTask<RawSocket> task) {
+ task.cancel();
+ task.socket.catchError((error) {
+ Expect.isTrue(error is SocketException);
+ asyncEnd();
+ });
+ task.socket.then((s) {
+ Expect.fail("Unreachable");
+ });
+ });
+}
+
void testCloseOneEnd(String toClose) {
asyncStart();
Completer serverDone = new Completer();
@@ -467,6 +482,7 @@
testCloseOneEnd("server");
testInvalidBind();
testSimpleConnect();
+ testCancelConnect();
testServerListenAfterConnect();
testSimpleReadWrite(dropReads: false);
testSimpleReadWrite(dropReads: true);
diff --git a/tests/standalone_2/io/socket_cancel_connect_test.dart b/tests/standalone_2/io/socket_cancel_connect_test.dart
new file mode 100644
index 0000000..7a2e112
--- /dev/null
+++ b/tests/standalone_2/io/socket_cancel_connect_test.dart
@@ -0,0 +1,32 @@
+// Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+//
+// VMOptions=
+// VMOptions=--short_socket_read
+// VMOptions=--short_socket_write
+// VMOptions=--short_socket_read --short_socket_write
+
+import "dart:async";
+import "dart:io";
+
+import "package:async_helper/async_helper.dart";
+import "package:expect/expect.dart";
+
+void main() {
+ asyncStart();
+ Duration timeout = new Duration(milliseconds: 20);
+ Socket.startConnect("8.8.8.7", 80).then((task) {
+ task.socket.timeout(timeout, onTimeout: () {
+ task.cancel();
+ });
+ task.socket.then((socket) {
+ Expect.fail("Unexpected connection made.");
+ asyncEnd();
+ }).catchError((e) {
+ print(e);
+ Expect.isTrue(e is SocketException);
+ asyncEnd();
+ });
+ });
+}
diff --git a/tests/standalone_2/typed_data_test.dart b/tests/standalone_2/typed_data_test.dart
index 81fd5e1..9e263bc 100644
--- a/tests/standalone_2/typed_data_test.dart
+++ b/tests/standalone_2/typed_data_test.dart
@@ -205,6 +205,53 @@
testIndexOutOfRangeHelper(new Uint64List(3), 0);
}
+void testNoNullValueLoopSetter(list, value) {
+ for (int i = 0; i < list.length; i++) {
+ list[i] = value;
+ }
+}
+
+void testNoNullValueDirectSetter(list, value) {
+ list[0] = value;
+ list[1] = value;
+ list[2] = value;
+}
+
+void testNoNullValueHelper(list, value) {
+ testNoNullValueLoopSetter(list, value + 1);
+ for (int i = 0; i < list.length; i++) {
+ Expect.equals(value + 1, list[i]);
+ }
+ testNoNullValueDirectSetter(list, value + 2);
+ for (int i = 0; i < list.length; i++) {
+ Expect.equals(value + 2, list[i]);
+ }
+
+ Expect.throws(() {
+ testNoNullValueLoopSetter(list, null);
+ });
+
+ Expect.throws(() {
+ testNoNullValueDirectSetter(list, null);
+ });
+}
+
+void testNoNullValue() {
+ testNoNullValueHelper(new Int8List(3), 1);
+ testNoNullValueHelper(new Uint8List(3), 1);
+ testNoNullValueHelper(new Uint8ClampedList(3), 1);
+ testNoNullValueHelper(new Int16List(3), 1);
+ testNoNullValueHelper(new Uint16List(3), 1);
+ testNoNullValueHelper(new Int32List(3), 1);
+ testNoNullValueHelper(new Uint32List(3), 1);
+ testNoNullValueHelper(new Int64List(3), 1);
+ testNoNullValueHelper(new Uint64List(3), 1);
+ testNoNullValueHelper(new Float32List(3), 1.0);
+ testNoNullValueHelper(new Float64List(3), 1.0);
+ testNoNullValueHelper(new Int64List(3), 1);
+ testNoNullValueHelper(new Uint64List(3), 1);
+}
+
void testIndexOfHelper(list) {
for (int i = 0; i < list.length; i++) {
list[i] = i + 10;
@@ -483,6 +530,7 @@
testClampedUnsignedTypedDataRange(false);
testSetRange();
testIndexOutOfRange();
+ testNoNullValue();
testIndexOf();
var int8list = new Int8List(128);
diff --git a/third_party/pkg_tested/pkg_tested.status b/third_party/pkg_tested/pkg_tested.status
index 2340170..37bdd59 100644
--- a/third_party/pkg_tested/pkg_tested.status
+++ b/third_party/pkg_tested/pkg_tested.status
@@ -16,7 +16,7 @@
[ $runtime == vm ]
dart_style/test/command_line_test: Skip # Issue 33473
-http_io/test/http_client_stays_alive_test: Skip # Issue 33472
+http_io/test/http_cross_process_test: Skip # Fails with --no-preview-dart-2
[ $browser ]
dart_style/*: SkipByDesign
diff --git a/tools/VERSION b/tools/VERSION
index bbe378c..90d93fdf 100644
--- a/tools/VERSION
+++ b/tools/VERSION
@@ -27,5 +27,5 @@
MAJOR 2
MINOR 0
PATCH 0
-PRERELEASE 66
+PRERELEASE 67
PRERELEASE_PATCH 0
diff --git a/tools/bots/test_matrix.json b/tools/bots/test_matrix.json
index 786a339..6f1083b 100644
--- a/tools/bots/test_matrix.json
+++ b/tools/bots/test_matrix.json
@@ -1,6 +1,7 @@
{
"global": {
- "chrome": "65"
+ "chrome": "65",
+ "ff": "61"
},
"filesets": {
"analyzer": [
@@ -124,7 +125,7 @@
".packages"
]
},
- "configurations": [
+ "builder_configurations": [
{
"builders": [
"front-end-linux-release-x64",
@@ -1596,8 +1597,6 @@
"name": "analyze pkg tests",
"arguments": [
"--compiler=dart2analyzer",
- "--preview-dart-2",
- "--strong",
"--use-sdk",
"pkg"
]
@@ -1606,8 +1605,6 @@
"name": "analyze tests preview-dart2",
"arguments": [
"--compiler=dart2analyzer",
- "--preview-dart-2",
- "--strong",
"--use-sdk"
]
}
@@ -1625,17 +1622,17 @@
"arguments": ["create_sdk"]
},
{
- "name": "Analyze pkg/analysis_server/",
+ "name": "Analyze pkg/analysis_server",
"script": "out/ReleaseX64/dart-sdk/bin/dartanalyzer",
"arguments": ["--no-hints","pkg/analysis_server"]
},
{
- "name": "Analyze pkg/analyzer/",
+ "name": "Analyze pkg/analyzer",
"script": "out/ReleaseX64/dart-sdk/bin/dartanalyzer",
"arguments": ["--no-hints","pkg/analyzer"]
},
{
- "name": "Analyze pkg/analyzer_plugin/",
+ "name": "Analyze pkg/analyzer_plugin",
"script": "out/ReleaseX64/dart-sdk/bin/dartanalyzer",
"arguments": ["--no-hints","pkg/analyzer_plugin"]
}
@@ -1653,7 +1650,7 @@
"arguments": ["create_sdk"]
},
{
- "name": "analyze pkg/analysis_server/",
+ "name": "analyze pkg/analysis_server",
"script": "out/ReleaseX64/dart-sdk/bin/dartanalyzer",
"arguments": [
"--no-hints",
@@ -1662,7 +1659,7 @@
]
},
{
- "name": "analyze pkg/analyzer/",
+ "name": "analyze pkg/analyzer",
"script": "out/ReleaseX64/dart-sdk/bin/dartanalyzer",
"arguments": [
"--no-hints",
@@ -1671,7 +1668,7 @@
]
},
{
- "name": "analyze pkg/analyzer_cli/lib/",
+ "name": "analyze pkg/analyzer_cli/lib",
"script": "out/ReleaseX64/dart-sdk/bin/dartanalyzer",
"arguments": [
"--no-hints",
@@ -1686,7 +1683,7 @@
"--compiler=none",
"--use-sdk",
"--vm-options=-DuseFastaParser=true",
- "pkg/analyzer/"
+ "pkg/analyzer"
]
},
{
@@ -1696,7 +1693,7 @@
"--compiler=none",
"--use-sdk",
"--vm-options=-DuseFastaParser=true",
- "pkg/analyzer_plugin/"
+ "pkg/analyzer_plugin"
]
},
{
@@ -1706,7 +1703,7 @@
"--compiler=none",
"--use-sdk",
"--vm-options=-DuseFastaParser=true",
- "pkg/analysis_server/"
+ "pkg/analysis_server"
]
}
]
diff --git a/tools/dom/dom.json b/tools/dom/dom.json
index 97ccbd5..071dc8f 100644
--- a/tools/dom/dom.json
+++ b/tools/dom/dom.json
@@ -16403,6 +16403,9 @@
"generateCertificate": {
"support_level": "untriaged"
},
+ "getLegacyStats": {
+ "support_level": "untriaged"
+ },
"getLocalStreams": {},
"getReceivers": {
"support_level": "untriaged"
diff --git a/tools/dom/src/dart2js_CustomElementSupport.dart b/tools/dom/src/dart2js_CustomElementSupport.dart
index 983ba1a..98c3c24 100644
--- a/tools/dom/src/dart2js_CustomElementSupport.dart
+++ b/tools/dom/src/dart2js_CustomElementSupport.dart
@@ -200,7 +200,11 @@
Element upgrade(Element element) {
// Only exact type matches are supported- cannot be a subclass.
if (element.runtimeType != _nativeType) {
- throw new ArgumentError('element is not subclass of $_nativeType');
+ // Some browsers may represent non-upgraded elements <x-foo> as
+ // UnknownElement and not a plain HtmlElement.
+ if (_nativeType != HtmlElement || element.runtimeType != UnknownElement) {
+ throw new ArgumentError('element is not subclass of $_nativeType');
+ }
}
setNativeSubclassDispatchRecord(element, _interceptor);
diff --git a/tools/dom/templates/html/dart2js/html_dart2js.darttemplate b/tools/dom/templates/html/dart2js/html_dart2js.darttemplate
index fc54b75..8b5906d 100644
--- a/tools/dom/templates/html/dart2js/html_dart2js.darttemplate
+++ b/tools/dom/templates/html/dart2js/html_dart2js.darttemplate
@@ -15,6 +15,8 @@
* check out the [Element] class, the base class for many of the HTML
* DOM types.
*
+ * For information on writing web apps with Dart, see https://webdev.dartlang.org.
+ *
* {@category Web}
*/
library dart.dom.html;
diff --git a/tools/dom/templates/html/impl/impl_DocumentFragment.darttemplate b/tools/dom/templates/html/impl/impl_DocumentFragment.darttemplate
index 1b0f7a7..12f15b1 100644
--- a/tools/dom/templates/html/impl/impl_DocumentFragment.darttemplate
+++ b/tools/dom/templates/html/impl/impl_DocumentFragment.darttemplate
@@ -89,8 +89,8 @@
* Parses the specified text as HTML and adds the resulting node after the
* last child of this document fragment.
*/
- void appendHtml(String text, {NodeValidator validator,
- NodeTreeSanitizer, treeSanitizer}) {
+ void appendHtml(String text,
+ {NodeValidator validator, NodeTreeSanitizer treeSanitizer}) {
this.append(new DocumentFragment.html(text, validator: validator,
treeSanitizer: treeSanitizer));
}
diff --git a/tools/dom/templates/html/impl/impl_RTCPeerConnection.darttemplate b/tools/dom/templates/html/impl/impl_RTCPeerConnection.darttemplate
index 508af04..293fb19 100644
--- a/tools/dom/templates/html/impl/impl_RTCPeerConnection.darttemplate
+++ b/tools/dom/templates/html/impl/impl_RTCPeerConnection.darttemplate
@@ -50,6 +50,22 @@
return completer.future;
}
+ /**
+ * Temporarily exposes _getStats and old getStats as getLegacyStats until Chrome fully supports
+ * new getStats API.
+ */
+ @JSName('getStats')
+ Future<RtcStatsResponse> getLegacyStats([MediaStreamTrack selector]) {
+ var completer = new Completer<RtcStatsResponse>();
+ _getStats((value) {
+ completer.complete(value);
+ }, selector);
+ return completer.future;
+ }
+ @JSName('getStats')
+ Future _getStats(
+ [RtcStatsCallback successCallback, MediaStreamTrack selector]) native;
+
static Future generateCertificate(/*AlgorithmIdentifier*/ keygenAlgorithm) =>
JS('dynamic', 'generateCertificate(#)', keygenAlgorithm);
diff --git a/tools/dom/templates/html/impl/impl_Window.darttemplate b/tools/dom/templates/html/impl/impl_Window.darttemplate
index 03d768f..6575f86 100644
--- a/tools/dom/templates/html/impl/impl_Window.darttemplate
+++ b/tools/dom/templates/html/impl/impl_Window.darttemplate
@@ -174,11 +174,12 @@
Console get console => Console._safeConsole;
/**
- * Access a sandboxed file system of the specified `size`. If `persistent` is
- * true, the application will request permission from the user to create
- * lasting storage. This storage cannot be freed without the user's
- * permission. Returns a [Future] whose value stores a reference to the
- * sandboxed file system for use. Because the file system is sandboxed,
+ * Access a sandboxed file system of `size` bytes.
+ *
+ * If `persistent` is true, the application will request permission from the
+ * user to create lasting storage. This storage cannot be freed without the
+ * user's permission. Returns a [Future] whose value stores a reference to
+ * the sandboxed file system for use. Because the file system is sandboxed,
* applications cannot access file systems created in other web pages.
*/
Future<FileSystem> requestFileSystem(int size, {bool persistent: false}) {
diff --git a/tools/download_latest_dev_sdk.py b/tools/download_latest_dev_sdk.py
index ca086d2..36bab55 100755
--- a/tools/download_latest_dev_sdk.py
+++ b/tools/download_latest_dev_sdk.py
@@ -5,7 +5,7 @@
# This script downloads the latest dev SDK from
# http://gsdview.appspot.com/dart-archive/channels/dev/raw/latest/sdk/
-# into tools/sdks/$HOST_OS/. It is intended to be invoked from Jiri hooks in
+# into tools/sdks/. It is intended to be invoked from Jiri hooks in
# a Fuchsia checkout.
import os
@@ -49,7 +49,7 @@
host_os = host_os_for_sdk(HOST_OS)
zip_file = ('dartsdk-%s-x64-release.zip' % HOST_OS)
sha_file = zip_file + '.sha256sum'
- sdk_path = os.path.join(DART_ROOT, 'tools', 'sdks', host_os)
+ sdk_path = os.path.join(DART_ROOT, 'tools', 'sdks')
local_sha_path = os.path.join(sdk_path, sha_file)
remote_sha_path = os.path.join(sdk_path, sha_file + '.remote')
zip_path = os.path.join(sdk_path, zip_file)
diff --git a/tools/gardening/lib/src/results/failing_test.dart b/tools/gardening/lib/src/results/failing_test.dart
index e19a1e3..e8ff1f1 100644
--- a/tools/gardening/lib/src/results/failing_test.dart
+++ b/tools/gardening/lib/src/results/failing_test.dart
@@ -83,7 +83,7 @@
var entries = _sectionEntriesForTestInConfigurations(
expectations, failingConfigurations, result.name,
success: false);
- return new Set.from(entries).toList();
+ return new Set.of(entries).toList();
}
/// Gets the failing configurations not covered by expressions in [sections].
diff --git a/tools/gardening/lib/src/results/result_json_models.dart b/tools/gardening/lib/src/results/result_json_models.dart
index 1e3a0da..287902d 100644
--- a/tools/gardening/lib/src/results/result_json_models.dart
+++ b/tools/gardening/lib/src/results/result_json_models.dart
@@ -130,7 +130,7 @@
}
String _boolToArg(String name, bool value) {
- return value ? "--$name" : null;
+ return value == true ? "--$name" : null;
}
String _listToArg(String name, List<String> strings) {
diff --git a/tools/sdks/.gitignore b/tools/sdks/.gitignore
index e08a678a..9533a07 100644
--- a/tools/sdks/.gitignore
+++ b/tools/sdks/.gitignore
@@ -1,12 +1 @@
-/linux/dart-sdk
-/linux/dart-sdk.tar.gz
-/linux/dartsdk-linux-x64-release.zip
-/linux/dartsdk-linux-x64-release.zip.sha256sum
-/win/dart-sdk
-/win/dart-sdk.tar.gz
-/win/dartsdk-windows-x64-release.zip
-/win/dartsdk-windows-x64-release.zip.sha256sum
-/mac/dart-sdk
-/mac/dart-sdk.tar.gz
-/mac/dartsdk-macos-x64-release.zip
-/mac/dartsdk-macos-x64-release.zip.sha256sum
+/dart-sdk
diff --git a/tools/sdks/README b/tools/sdks/README
index 44c00f2..88e40d8 100644
--- a/tools/sdks/README
+++ b/tools/sdks/README
@@ -1,19 +1,13 @@
-This directory contains the hashes of tar.gz files uploaded to cloud storage.
-Hooks in the DEPS files run "download_from_google_storage" to download these
-tarfiles, and unpack them. These tar files contain a stable Dart SDK, which
-is used to build the observatory and to run the test scripts.
+This directory contains a stable Dart SDK, which is used to build the
+observatory and to run the test scripts.
-The hooks use the --auto-platform feature, so that only the SDK for the
-current platform (linux, macos, or windows) is downloaded. This requires
-the subdirectories to have the special names "linux", "win", and "mac", which
-the download script is hardcoded to recognize.
+The DEPS use CIPD's ${platform} syntax find the right SDK for the platform.
-The linux SDK has two extra dart executables added to the bin directory.
-'dart-arm' and 'dart-arm64' are executables compiled to run on
-arm and arm64 (aarch64) processors, respectively. We are currently
-using the 32-bit ia32 build as the default on windows, and the 64-bit x64
-build as the default on linux and macos.
+We are currently using the 32-bit ia32 build as the default on Windows, and the
+64-bit x64 build as the default on Linux and Mac. arm and arm64 CIPD packages
+are used on Linux.
-To upload new versions of these tar files, run "./update.sh" in this directory.
-Because these SDKs are used for the presubmit dartfmt check on changed files,
-they may need to be updated often when dartfmt is changing rapidly.
+To upload new versions of these CIPD packages, run "./update.sh" in this
+directory. Because these SDKs are used for the presubmit dartfmt check on
+changed files, they may need to be updated often when dartfmt is changing
+rapidly. Access to the project-dart-admins Luci auth group is required to do so.
diff --git a/tools/sdks/linux/dart-sdk.tar.gz.sha1 b/tools/sdks/linux/dart-sdk.tar.gz.sha1
deleted file mode 100644
index f888b4d..0000000
--- a/tools/sdks/linux/dart-sdk.tar.gz.sha1
+++ /dev/null
@@ -1 +0,0 @@
-739732637a9d7a2cbd04beb36c4d117d615fd22c
\ No newline at end of file
diff --git a/tools/sdks/mac/dart-sdk.tar.gz.sha1 b/tools/sdks/mac/dart-sdk.tar.gz.sha1
deleted file mode 100644
index 0db4273..0000000
--- a/tools/sdks/mac/dart-sdk.tar.gz.sha1
+++ /dev/null
@@ -1 +0,0 @@
-80c81b7d814e5897b8350b6f2a3b60353080ca45
\ No newline at end of file
diff --git a/tools/sdks/update.sh b/tools/sdks/update.sh
index 95a5ebc..ce8bfcc 100755
--- a/tools/sdks/update.sh
+++ b/tools/sdks/update.sh
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
-# Updates the checked in SDKs
+# Uploads a new version of the checked in SDK CIPD packages
set -e
set -x
@@ -21,35 +21,64 @@
pushd "$tmpdir"
gsutil cp "gs://dart-archive/channels/$channel/release/$1/sdk/dartsdk-linux-x64-release.zip" .
+unzip -q dartsdk-linux-x64-release.zip -d sdk
+cipd create \
+ -name dart/dart-sdk/linux-amd64 \
+ -in sdk \
+ -install-mode copy \
+ -tag version:$1 \
+ -ref $channel
+rm -rf sdk
+
gsutil cp "gs://dart-archive/channels/$channel/release/$1/sdk/dartsdk-linux-arm-release.zip" .
+unzip -q dartsdk-linux-arm-release.zip -d sdk
+cipd create \
+ -name dart/dart-sdk/linux-armv6l \
+ -in sdk \
+ -install-mode copy \
+ -tag version:$1 \
+ -ref $channel
+rm -rf sdk
+
gsutil cp "gs://dart-archive/channels/$channel/release/$1/sdk/dartsdk-linux-arm64-release.zip" .
+unzip -q dartsdk-linux-arm64-release.zip -d sdk
+cipd create \
+ -name dart/dart-sdk/linux-arm64 \
+ -in sdk \
+ -install-mode copy \
+ -tag version:$1 \
+ -ref $channel
+rm -rf sdk
+
gsutil cp "gs://dart-archive/channels/$channel/release/$1/sdk/dartsdk-macos-x64-release.zip" .
+unzip -q dartsdk-macos-x64-release.zip -d sdk
+cipd create \
+ -name dart/dart-sdk/mac-amd64 \
+ -in sdk \
+ -install-mode copy \
+ -tag version:$1 \
+ -ref $channel
+rm -rf sdk
+
+# We currently use the ia32 SDK on x64 Windows as well, see also README.
gsutil cp "gs://dart-archive/channels/$channel/release/$1/sdk/dartsdk-windows-ia32-release.zip" .
+unzip -q dartsdk-windows-ia32-release.zip -d sdk
+cipd create \
+ -name dart/dart-sdk/windows-amd64 \
+ -in sdk \
+ -install-mode copy \
+ -tag version:$1 \
+ -ref $channel
+rm -rf sdk
-unzip -q dartsdk-linux-arm-release.zip dart-sdk/bin/dart
-mv dart-sdk/bin/dart dart-sdk/bin/dart-arm
-unzip -q dartsdk-linux-arm64-release.zip dart-sdk/bin/dart
-mv dart-sdk/bin/dart dart-sdk/bin/dart-arm64
-unzip -q dartsdk-linux-x64-release.zip
-tar -czf dart-sdk.tar.gz dart-sdk
-upload_to_google_storage.py -b dart-dependencies dart-sdk.tar.gz
-mv dart-sdk.tar.gz.sha1 dart-sdk.tar.gz.sha1-linux
-rm -rf dart-sdk
-
-unzip -q dartsdk-macos-x64-release.zip
-tar -czf dart-sdk.tar.gz dart-sdk
-upload_to_google_storage.py -b dart-dependencies dart-sdk.tar.gz
-mv dart-sdk.tar.gz.sha1 dart-sdk.tar.gz.sha1-mac
-rm -rf dart-sdk
-
-unzip -q dartsdk-windows-ia32-release.zip
-tar -czf dart-sdk.tar.gz dart-sdk
-upload_to_google_storage.py -b dart-dependencies dart-sdk.tar.gz
-mv dart-sdk.tar.gz.sha1 dart-sdk.tar.gz.sha1-win
-rm -rf dart-sdk
+gsutil cp "gs://dart-archive/channels/$channel/release/$1/sdk/dartsdk-windows-ia32-release.zip" .
+unzip -q dartsdk-windows-ia32-release.zip -d sdk
+cipd create \
+ -name dart/dart-sdk/windows-386 \
+ -in sdk \
+ -install-mode copy \
+ -tag version:$1 \
+ -ref $channel
+rm -rf sdk
popd
-
-mv $tmpdir/dart-sdk.tar.gz.sha1-linux linux/dart-sdk.tar.gz.sha1
-mv $tmpdir/dart-sdk.tar.gz.sha1-mac mac/dart-sdk.tar.gz.sha1
-mv $tmpdir/dart-sdk.tar.gz.sha1-win win/dart-sdk.tar.gz.sha1
diff --git a/tools/sdks/win/dart-sdk.tar.gz.sha1 b/tools/sdks/win/dart-sdk.tar.gz.sha1
deleted file mode 100644
index 3b0ea4f..0000000
--- a/tools/sdks/win/dart-sdk.tar.gz.sha1
+++ /dev/null
@@ -1 +0,0 @@
-5dbee047c7824357eb7e6581cd69687a623449ab
\ No newline at end of file
diff --git a/tools/testing/dart/compiler_configuration.dart b/tools/testing/dart/compiler_configuration.dart
index c474bd7..c077166 100644
--- a/tools/testing/dart/compiler_configuration.dart
+++ b/tools/testing/dart/compiler_configuration.dart
@@ -36,7 +36,6 @@
bool get _isDebug => _configuration.mode.isDebug;
bool get _isChecked => _configuration.isChecked;
- bool get _isStrong => _configuration.isStrong;
bool get _isHostChecked => _configuration.isHostChecked;
bool get _useSdk => _configuration.useSdk;
bool get _useEnableAsserts => _configuration.useEnableAsserts;
@@ -740,9 +739,6 @@
args.add('--obfuscate');
}
- if (_isStrong) {
- args.add('--strong');
- }
if (previewDart2) {
args.addAll(_replaceDartFiles(arguments, tempKernelFile(tempDir)));
} else {
@@ -1003,12 +999,11 @@
CommandArtifact computeCompilationArtifact(String tempDir,
List<String> arguments, Map<String, String> environmentOverrides) {
arguments = arguments.toList();
- if (_isChecked || _isStrong) {
+ if (_isChecked || previewDart2) {
arguments.add('--enable_type_checks');
}
- if (_isStrong) {
- arguments.add('--strong');
- } else {
+ if (!previewDart2) {
+ arguments.add('--no-preview-dart-2');
arguments.add('--no-strong');
}
if (_configuration.useAnalyzerCfe) {
@@ -1066,7 +1061,6 @@
abstract class VMKernelCompilerMixin {
Configuration get _configuration;
bool get _useSdk;
- bool get _isStrong;
bool get _isAot;
bool get _isChecked;
bool get _useEnableAsserts;
@@ -1094,10 +1088,8 @@
final args = [
_isAot ? '--aot' : '--no-aot',
- // Specify strong mode irrespective of the value of _isStrong
- // as preview_dart_2 implies strong mode anyway.
'--strong-mode',
- _isStrong ? '--sync-async' : '--no-sync-async',
+ _configuration.noPreviewDart2 ? '--no-sync-async' : '--sync-async',
'--platform=$vmPlatform',
'-o',
dillFile,
@@ -1133,7 +1125,7 @@
final Uri _vmExecutable;
- bool get _isLegacy => !_configuration.isStrong;
+ bool get _isLegacy => _configuration.noPreviewDart2;
factory FastaCompilerConfiguration(Configuration configuration) {
var buildDirectory =
@@ -1144,7 +1136,7 @@
dillDir = buildDirectory.resolve("dart-sdk/lib/_internal/");
}
- var suffix = configuration.isStrong ? "_strong" : "";
+ var suffix = !configuration.noPreviewDart2 ? "_strong" : "";
var platformDill = dillDir.resolve("vm_platform$suffix.dill");
var vmExecutable = buildDirectory
diff --git a/tools/testing/dart/configuration.dart b/tools/testing/dart/configuration.dart
index 80808c3..f6588ac 100644
--- a/tools/testing/dart/configuration.dart
+++ b/tools/testing/dart/configuration.dart
@@ -33,7 +33,6 @@
this.hotReload,
this.hotReloadRollback,
this.isChecked,
- bool isStrong,
this.isHostChecked,
this.isCsp,
this.isMinified,
@@ -84,11 +83,7 @@
this.fastTestsOnly,
this.printPassingStdout})
: _packages = packages,
- _timeout = timeout,
- isStrong = isStrong ||
- // DDC always runs in strong mode.
- compiler == Compiler.dartdevc ||
- compiler == Compiler.dartdevk;
+ _timeout = timeout;
final Architecture architecture;
final Compiler compiler;
@@ -109,7 +104,6 @@
final bool hotReload;
final bool hotReloadRollback;
final bool isChecked;
- final bool isStrong;
final bool isHostChecked;
final bool isCsp;
final bool isMinified;
@@ -256,7 +250,6 @@
if (useEnableAsserts) args.add("--enable-asserts");
if (useDart2JSWithKernel) args.add("--use-kernel");
if (useDart2JSOldFrontend) args.add("--use-old-frontend");
- if (isStrong) args.add("--strong");
return args;
}
@@ -463,7 +456,6 @@
'compiler': compiler.name,
'runtime': runtime.name,
'checked': isChecked,
- 'strong': isStrong,
'host_checked': isHostChecked,
'minified': isMinified,
'csp': isCsp,
diff --git a/tools/testing/dart/environment.dart b/tools/testing/dart/environment.dart
index f0bda0dd..e4c571e 100644
--- a/tools/testing/dart/environment.dart
+++ b/tools/testing/dart/environment.dart
@@ -38,8 +38,7 @@
"preview_dart_2": new _Variable.bool((c) => !c.noPreviewDart2),
"runtime": new _Variable(_runtimeName, Runtime.names),
"spec_parser": new _Variable.bool((c) => c.compiler == Compiler.specParser),
- "strong": new _Variable.bool(
- (c) => c.isStrong || c.compilerConfiguration.previewDart2),
+ "strong": new _Variable.bool((c) => !c.noPreviewDart2),
"system": new _Variable((c) => c.system.name, System.names),
"use_sdk": new _Variable.bool((c) => c.useSdk)
};
diff --git a/tools/testing/dart/options.dart b/tools/testing/dart/options.dart
index fb29a71..c7dcc55 100644
--- a/tools/testing/dart/options.dart
+++ b/tools/testing/dart/options.dart
@@ -152,8 +152,15 @@
values: System.names,
defaultsTo: Platform.operatingSystem,
hide: true),
+ new _Option(
+ 'named_configuration',
+ '''The named test configuration that supplies the values for all
+test options, specifying how tests should be run. Unimplemented
+currently.''',
+ abbr: 'n',
+ hide: true),
new _Option.bool('checked', 'Run tests in checked mode.'),
- new _Option.bool('strong', 'Run tests in strong mode.'),
+ new _Option.bool('strong', 'Deprecated, no-op.', hide: true),
new _Option.bool('host_checked', 'Run compiler in checked mode.',
hide: true),
new _Option.bool('minified', 'Enable minification in the compiler.',
@@ -168,9 +175,6 @@
new _Option.bool('enable_asserts',
'Pass the --enable-asserts flag to dart2js or to the vm.'),
new _Option.bool(
- 'preview_dart_2', 'Pass the --preview-dart-2 flag to analyzer',
- hide: true),
- new _Option.bool(
'no_preview_dart_2', 'Pass the --no-preview-dart-2 flag to analyzer',
hide: true),
new _Option.bool('use_cfe', 'Pass the --use-cfe flag to analyzer',
@@ -243,7 +247,7 @@
'The name of the output directory for storing log files.',
defaultsTo: "logs", hide: true),
new _Option.bool('noBatch', 'Do not run tests in batch mode.',
- abbr: 'n', hide: true),
+ hide: true),
new _Option.bool('dart2js_batch', 'Run dart2js tests in batch mode.',
hide: true),
new _Option.bool(
@@ -649,7 +653,6 @@
hotReload: data["hot_reload"] as bool,
hotReloadRollback: data["hot_reload_rollback"] as bool,
isChecked: data["checked"] as bool,
- isStrong: data["strong"] as bool,
isHostChecked: data["host_checked"] as bool,
isCsp: data["csp"] as bool,
isMinified: data["minified"] as bool,
diff --git a/tools/testing/dart/runtime_configuration.dart b/tools/testing/dart/runtime_configuration.dart
index 83e9078..73c7a76 100644
--- a/tools/testing/dart/runtime_configuration.dart
+++ b/tools/testing/dart/runtime_configuration.dart
@@ -174,6 +174,7 @@
switch (arch) {
case Architecture.simarm:
case Architecture.arm:
+ case Architecture.arm64:
case Architecture.simarmv6:
case Architecture.armv6:
case Architecture.simarmv5te:
diff --git a/tools/testing/dart/test_configurations.dart b/tools/testing/dart/test_configurations.dart
index 32c0c32..6e05015 100644
--- a/tools/testing/dart/test_configurations.dart
+++ b/tools/testing/dart/test_configurations.dart
@@ -99,7 +99,7 @@
configuration.architecture.name
];
if (configuration.isChecked) settings.add('checked');
- if (configuration.isStrong) settings.add('strong');
+ if (configuration.noPreviewDart2) settings.add('no-preview-dart-2');
if (configuration.useFastStartup) settings.add('fast-startup');
if (configuration.useEnableAsserts) settings.add('enable-asserts');
outputWords.add(settings.join('_'));
diff --git a/tools/testing/dart/test_suite.dart b/tools/testing/dart/test_suite.dart
index 3da5f0d..5f738fb 100644
--- a/tools/testing/dart/test_suite.dart
+++ b/tools/testing/dart/test_suite.dart
@@ -394,22 +394,22 @@
String createOutputDirectory(Path testPath) {
var checked = configuration.isChecked ? '-checked' : '';
- var strong = configuration.isStrong ? '-strong' : '';
+ var legacy = configuration.noPreviewDart2 ? '-legacy' : '';
var minified = configuration.isMinified ? '-minified' : '';
var sdk = configuration.useSdk ? '-sdk' : '';
var dirName = "${configuration.compiler.name}-${configuration.runtime.name}"
- "$checked$strong$minified$sdk";
+ "$checked$legacy$minified$sdk";
return createGeneratedTestDirectoryHelper("tests", dirName, testPath);
}
String createCompilationOutputDirectory(Path testPath) {
var checked = configuration.isChecked ? '-checked' : '';
- var strong = configuration.isStrong ? '-strong' : '';
+ var legacy = configuration.noPreviewDart2 ? '-legacy' : '';
var minified = configuration.isMinified ? '-minified' : '';
var csp = configuration.isCsp ? '-csp' : '';
var sdk = configuration.useSdk ? '-sdk' : '';
var dirName = "${configuration.compiler.name}"
- "$checked$strong$minified$csp$sdk";
+ "$checked$legacy$minified$csp$sdk";
return createGeneratedTestDirectoryHelper(
"compilations", dirName, testPath);
}
@@ -481,9 +481,6 @@
args.add('--use-dart-frontend');
// '--dfe' has to be the first argument for run_vm_test to pick it up.
args.insert(0, '--dfe=$buildDir/gen/kernel-service.dart.snapshot');
- }
-
- if (configuration.isStrong) {
args.add('--strong');
}
diff --git a/tools/testing/dart/utils.dart b/tools/testing/dart/utils.dart
index e9c9175..dfd530f 100644
--- a/tools/testing/dart/utils.dart
+++ b/tools/testing/dart/utils.dart
@@ -446,12 +446,12 @@
configuration.compiler == Compiler.dartk ||
configuration.compiler == Compiler.dartkp) {
var checked = configuration.isChecked ? '-checked' : '';
- var strong = configuration.isStrong ? '-strong' : '';
+ var legacy = configuration.noPreviewDart2 ? '-legacy' : '';
var minified = configuration.isMinified ? '-minified' : '';
var csp = configuration.isCsp ? '-csp' : '';
var sdk = configuration.useSdk ? '-sdk' : '';
var dirName = "${configuration.compiler.name}"
- "$checked$strong$minified$csp$sdk";
+ "$checked$legacy$minified$csp$sdk";
var generatedPath =
configuration.buildDirectory + "/generated_compilations/$dirName";
if (FileSystemEntity.isDirectorySync(generatedPath)) {
diff --git a/tools/utils.py b/tools/utils.py
index 64f2b6c..0ec760a 100644
--- a/tools/utils.py
+++ b/tools/utils.py
@@ -676,7 +676,6 @@
tools_dir = os.path.dirname(os.path.realpath(__file__))
return os.path.join(tools_dir,
'sdks',
- osname,
'dart-sdk')
@@ -684,22 +683,8 @@
name = 'dart'
if IsWindows():
name = 'dart.exe'
- elif GuessOS() == 'linux':
- arch = GuessArchitecture()
- if arch == 'arm':
- name = 'dart-arm'
- elif arch == 'arm64':
- name = 'dart-arm64'
- elif arch == 'armv5te':
- # TODO(zra): This binary does not exist, yet. Check one in once we have
- # sufficient stability.
- name = 'dart-armv5te'
- elif arch == 'armv6':
- # TODO(zra): Ditto.
- name = 'dart-armv6'
return os.path.join(CheckedInSdkPath(), 'bin', name)
-
def CheckedInSdkCheckExecutable():
executable = CheckedInSdkExecutable()
canary_script = os.path.join(os.path.dirname(os.path.realpath(__file__)),
diff --git a/utils/compiler/BUILD.gn b/utils/compiler/BUILD.gn
index 53197d5..8eab081 100644
--- a/utils/compiler/BUILD.gn
+++ b/utils/compiler/BUILD.gn
@@ -82,7 +82,7 @@
compile_platform("compile_dart2js_platform") {
single_root_scheme = "org-dartlang-sdk"
- single_root_base = "../../"
+ single_root_base = rebase_path("../../")
libraries_specification_uri = "org-dartlang-sdk:///sdk/lib/libraries.json"
outputs = [
@@ -98,7 +98,7 @@
compile_platform("compile_dart2js_platform_strong") {
single_root_scheme = "org-dartlang-sdk"
- single_root_base = "../../"
+ single_root_base = rebase_path("../../")
libraries_specification_uri = "org-dartlang-sdk:///sdk/lib/libraries.json"
outputs = [
@@ -115,7 +115,7 @@
compile_platform("compile_dart2js_server_platform") {
single_root_scheme = "org-dartlang-sdk"
- single_root_base = "../../"
+ single_root_base = rebase_path("../../")
libraries_specification_uri = "org-dartlang-sdk:///sdk/lib/libraries.json"
outputs = [
@@ -131,7 +131,7 @@
compile_platform("compile_dart2js_server_platform_strong") {
single_root_scheme = "org-dartlang-sdk"
- single_root_base = "../../"
+ single_root_base = rebase_path("../../")
libraries_specification_uri = "org-dartlang-sdk:///sdk/lib/libraries.json"
outputs = [
diff --git a/utils/dartdevc/BUILD.gn b/utils/dartdevc/BUILD.gn
index ab80bcc..cd84c19 100644
--- a/utils/dartdevc/BUILD.gn
+++ b/utils/dartdevc/BUILD.gn
@@ -282,36 +282,49 @@
]
outputs = [
- "$target_gen_dir/pkg/async_helper.dill",
"$target_gen_dir/pkg/async_helper.js",
"$target_gen_dir/pkg/async_helper.sum",
- "$target_gen_dir/pkg/collection.dill",
"$target_gen_dir/pkg/collection.js",
"$target_gen_dir/pkg/collection.sum",
- "$target_gen_dir/pkg/expect.dill",
"$target_gen_dir/pkg/expect.js",
"$target_gen_dir/pkg/expect.sum",
- "$target_gen_dir/pkg/js.dill",
"$target_gen_dir/pkg/js.js",
"$target_gen_dir/pkg/js.sum",
- "$target_gen_dir/pkg/matcher.dill",
"$target_gen_dir/pkg/matcher.js",
"$target_gen_dir/pkg/matcher.sum",
- "$target_gen_dir/pkg/meta.dill",
"$target_gen_dir/pkg/meta.js",
"$target_gen_dir/pkg/meta.sum",
- "$target_gen_dir/pkg/path.dill",
"$target_gen_dir/pkg/path.js",
"$target_gen_dir/pkg/path.sum",
- "$target_gen_dir/pkg/stack_trace.dill",
"$target_gen_dir/pkg/stack_trace.js",
"$target_gen_dir/pkg/stack_trace.sum",
# TODO(rnystrom): Remove this when unittest is no longer used. Also remove
# any of the above packages that are only here because unittest uses them.
- "$target_gen_dir/pkg/unittest.dill",
"$target_gen_dir/pkg/unittest.js",
"$target_gen_dir/pkg/unittest.sum",
+
+ "$target_gen_dir/pkg_kernel/async_helper.dill",
+ "$target_gen_dir/pkg_kernel/async_helper.js",
+ "$target_gen_dir/pkg_kernel/collection.dill",
+ "$target_gen_dir/pkg_kernel/collection.js",
+ "$target_gen_dir/pkg_kernel/expect.dill",
+ "$target_gen_dir/pkg_kernel/expect.js",
+ "$target_gen_dir/pkg_kernel/js.dill",
+ "$target_gen_dir/pkg_kernel/js.js",
+ "$target_gen_dir/pkg_kernel/matcher.dill",
+ "$target_gen_dir/pkg_kernel/matcher.js",
+ "$target_gen_dir/pkg_kernel/meta.dill",
+ "$target_gen_dir/pkg_kernel/meta.js",
+ "$target_gen_dir/pkg_kernel/path.dill",
+ "$target_gen_dir/pkg_kernel/path.js",
+ "$target_gen_dir/pkg_kernel/stack_trace.dill",
+ "$target_gen_dir/pkg_kernel/stack_trace.js",
+
+ # TODO(rnystrom): Remove this when unittest is no longer used. Also remove
+ # any of the above packages that are only here because unittest uses them.
+ "$target_gen_dir/pkg_kernel/unittest.dill",
+ "$target_gen_dir/pkg_kernel/unittest.js",
]
script = "../../pkg/dev_compiler/tool/build_pkgs.dart"