Version 2.0.0-dev.54.0
Merge commit 'a0d3bef5fbe599a06fde34c79500b42a4eab265b' into dev
diff --git a/BUILD.gn b/BUILD.gn
index 6d24c82..fe6513a 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -2,7 +2,7 @@
# 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("build/dart_host_sdk_toolchain.gni")
+import("build/dart/dart_host_sdk_toolchain.gni")
targetting_fuchsia = target_os == "fuchsia"
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 1ef9bfb..0269232 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,11 @@
+## 2.0.0-dev.54.0
+
+### Tool Changes
+
+#### Pub
+
+* Retry on 500 errors from the pub server.
+
## 2.0.0-dev.53.0
## 2.0.0-dev.52.0
diff --git a/DEPS b/DEPS
index dc79768..6564eee 100644
--- a/DEPS
+++ b/DEPS
@@ -114,8 +114,8 @@
"ply_rev": "604b32590ffad5cbb82e4afef1d305512d06ae93",
"pool_tag": "1.3.4",
"protobuf_tag": "0.7.1",
- "pub_rev": "2e821bff00c00889afe5200e3a33f280ce942336",
- "pub_semver_tag": "1.3.7",
+ "pub_rev": "c61b8a3a24a7b1f931bad24b1f663e2c9a4c4354",
+ "pub_semver_tag": "1.4.1",
"quiver_tag": "5aaa3f58c48608af5b027444d561270b53f15dbf",
"resource_rev":"af5a5bf65511943398146cf146e466e5f0b95cb9",
"root_certificates_rev": "16ef64be64c7dfdff2b9f4b910726e635ccc519e",
diff --git a/build/compiled_action.gni b/build/compiled_action.gni
deleted file mode 100644
index 5b5afa7..0000000
--- a/build/compiled_action.gni
+++ /dev/null
@@ -1,191 +0,0 @@
-# Copyright 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-# This file introduces two related templates that act like action and
-# action_foreach but instead of running a Python script, it will compile a
-# given tool in the host toolchain and run that (either once or over the list
-# of inputs, depending on the variant).
-#
-# Parameters
-#
-# tool (required)
-# [label] Label of the tool to run. This should be an executable, and
-# this label should not include a toolchain (anything in parens). The
-# host compile of this tool will be used.
-#
-# outputs (required)
-# [list of files] Like the outputs of action (if using "compiled_action",
-# this would be just the list of outputs), or action_foreach (if using
-# "compiled_action_foreach", this would contain source expansions mapping
-# input to output files).
-#
-# args (required)
-# [list of strings] Same meaning as action/action_foreach.
-#
-# inputs (optional)
-# Files the binary takes as input. The step will be re-run whenever any
-# of these change. If inputs is empty, the step will run only when the
-# binary itself changes.
-#
-# visibility
-# deps
-# args (all optional)
-# Same meaning as action/action_foreach.
-#
-#
-# Example of usage:
-#
-# compiled_action("run_my_tool") {
-# tool = "//tools/something:mytool"
-# outputs = [
-# "$target_gen_dir/mysource.cc",
-# "$target_gen_dir/mysource.h",
-# ]
-#
-# # The tool takes this input.
-# inputs = [ "my_input_file.idl" ]
-#
-# # In this case, the tool takes as arguments the input file and the output
-# # build dir (both relative to the "cd" that the script will be run in)
-# # and will produce the output files listed above.
-# args = [
-# rebase_path("my_input_file.idl", root_build_dir),
-# "--output-dir", rebase_path(target_gen_dir, root_build_dir),
-# ]
-# }
-#
-# You would typically declare your tool like this:
-# if (host_toolchain == current_toolchain) {
-# executable("mytool") {
-# ...
-# }
-# }
-# The if statement around the executable is optional. That says "I only care
-# about this target in the host toolchain". Usually this is what you want, and
-# saves unnecessarily compiling your tool for the target platform. But if you
-# need a target build of your tool as well, just leave off the if statement.
-
-import("dart_host_sdk_toolchain.gni")
-
-if (host_os == "win") {
- _host_executable_suffix = ".exe"
-} else {
- _host_executable_suffix = ""
-}
-
-_dart_root = get_path_info("..", "abspath")
-
-template("compiled_action") {
- assert(defined(invoker.tool), "tool must be defined for $target_name")
- assert(defined(invoker.outputs), "outputs must be defined for $target_name")
- assert(defined(invoker.args), "args must be defined for $target_name")
-
- assert(!defined(invoker.sources),
- "compiled_action doesn't take a sources arg. Use inputs instead.")
-
- action(target_name) {
- if (defined(invoker.visibility)) {
- visibility = invoker.visibility
- }
-
- script = "$_dart_root/build/gn_run_binary.py"
-
- if (defined(invoker.inputs)) {
- inputs = invoker.inputs
- } else {
- inputs = []
- }
- outputs = invoker.outputs
-
- # Constuct the host toolchain version of the tool.
- host_tool = invoker.tool + "($dart_host_toolchain)"
-
- # Get the path to the executable. Currently, this assumes that the tool
- # does not specify output_name so that the target name is the name to use.
- # If that's not the case, we'll need another argument to the script to
- # specify this, since we can't know what the output name is (it might be in
- # another file not processed yet).
- host_executable =
- get_label_info(host_tool, "root_out_dir") + "/" +
- get_label_info(host_tool, "name") + _host_executable_suffix
-
- # Add the executable itself as an input.
- inputs += [ host_executable ]
-
- deps = [
- host_tool,
- ]
- if (defined(invoker.deps)) {
- deps += invoker.deps
- }
-
- if (defined(invoker.depfile)) {
- depfile = invoker.depfile
- }
-
- # The script takes as arguments the binary to run, and then the arguments
- # to pass it.
- args = [
- "compiled_action",
- rebase_path(host_executable, root_build_dir),
- ] + invoker.args
- }
-}
-
-template("compiled_action_foreach") {
- assert(defined(invoker.sources), "sources must be defined for $target_name")
- assert(defined(invoker.tool), "tool must be defined for $target_name")
- assert(defined(invoker.outputs), "outputs must be defined for $target_name")
- assert(defined(invoker.args), "args must be defined for $target_name")
-
- action_foreach(target_name) {
- # Otherwise this is a standalone action, define visibility if requested.
- if (defined(invoker.visibility)) {
- visibility = invoker.visibility
- }
-
- script = "$_dart_root/build/gn_run_binary.py"
- sources = invoker.sources
-
- if (defined(invoker.inputs)) {
- inputs = invoker.inputs
- } else {
- inputs = []
- }
- outputs = invoker.outputs
-
- # Constuct the host toolchain version of the tool.
- host_tool = invoker.tool + "($dart_host_toolchain)"
-
- # Get the path to the executable. Currently, this assumes that the tool
- # does not specify output_name so that the target name is the name to use.
- # If that's not the case, we'll need another argument to the script to
- # specify this, since we can't know what the output name is (it might be in
- # another file not processed yet).
- host_executable =
- get_label_info(host_tool, "root_out_dir") + "/" +
- get_label_info(host_tool, "name") + _host_executable_suffix
-
- # Add the executable itself as an input.
- inputs += [ host_executable ]
-
- deps = [
- host_tool,
- ]
- if (defined(invoker.deps)) {
- deps += invoker.deps
- }
-
- if (defined(invoker.depfile)) {
- depfile = invoker.depfile
- }
-
- # The script takes as arguments the binary to run, and then the arguments
- # to pass it.
- args = [
- "compiled_action",
- rebase_path(host_executable, root_build_dir),
- ] + invoker.args
- }
-}
diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn
index bdddd97..eeece1c 100644
--- a/build/config/compiler/BUILD.gn
+++ b/build/config/compiler/BUILD.gn
@@ -501,6 +501,7 @@
default_warning_flags += [
# Permanent.
"/wd4091", # typedef warning from dbghelp.h
+ "/wd4722", # destructor never returns
# Investigate.
"/wd4312", # int to pointer of greater size conversion.
diff --git a/build/dart/dart_action.gni b/build/dart/dart_action.gni
new file mode 100644
index 0000000..f5bf967
--- /dev/null
+++ b/build/dart/dart_action.gni
@@ -0,0 +1,367 @@
+# 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("../executable_suffix.gni")
+import("dart_host_sdk_toolchain.gni")
+import("prebuilt_dart_sdk.gni")
+
+# This file defines templates for running and compiling Dart code during
+# Dart's build.
+#
+# - prebuilt_dart_action()
+# Runs Dart scripts using the downloaded prebuilt Dart SDK if there is one,
+# and a built dart_bootstrap otherwise. This is the preferred method of
+# running Dart code during the build as it is much faster than using
+# dart_action() in debug and cross builds. However, prebuilt_dart_action()
+# should *not* be used to generate snapshots.
+#
+# - dart_action()
+# Runs Dart scripts using the binary built for runtime/bin:dart using the
+# host toolchain. It should only be used when an artifact agreeing exactly
+# with the version of the Dart VM being built must be produced, for example
+# an App-JIT snapshot. This will be slow in Debug builds, and very slow in
+# cross builds.
+#
+# - dart_bootstrap_action()
+# Ditto, but uses runtime/bin:dart_bootstrap.
+#
+# - gen_snapshot_action()
+# Runs the binary built for runtime/bin:gen_snapshot using the host
+# toolchain. It should only be used when an artifact agreeing exactly
+# with the version of the Dart VM being built must be produced.
+
+# This assigns _dart_root the GN absolute path of the Dart repo. For example,
+# in a Dart checkout, this will be "//". In a client repo it might be
+# "//third_party/dart".
+_dart_root = get_path_info("../..", "abspath")
+
+template("_compiled_action") {
+ assert(defined(invoker.tool), "tool must be defined for $target_name")
+ assert(defined(invoker.outputs), "outputs must be defined for $target_name")
+ assert(defined(invoker.args), "args must be defined for $target_name")
+
+ action(target_name) {
+ if (defined(invoker.visibility)) {
+ visibility = invoker.visibility
+ }
+
+ script = "$_dart_root/build/gn_run_binary.py"
+
+ if (defined(invoker.inputs)) {
+ inputs = invoker.inputs
+ } else {
+ inputs = []
+ }
+ outputs = invoker.outputs
+
+ # Construct the host toolchain version of the tool.
+ host_tool = invoker.tool + "($dart_host_toolchain)"
+
+ # Get the path to the executable. Currently, this assumes that the tool
+ # does not specify output_name so that the target name is the name to use.
+ # If that's not the case, we'll need another argument to the script to
+ # specify this, since we can't know what the output name is (it might be in
+ # another file not processed yet).
+ host_executable =
+ get_label_info(host_tool, "root_out_dir") + "/" +
+ get_label_info(host_tool, "name") + executable_suffix
+
+ # Add the executable itself as an input.
+ inputs += [ host_executable ]
+
+ deps = [
+ host_tool,
+ ]
+ if (defined(invoker.deps)) {
+ deps += invoker.deps
+ }
+
+ if (defined(invoker.depfile)) {
+ depfile = invoker.depfile
+ }
+
+ # The "compiled_action" argument to gn_run_binary.py indicates that
+ # it will exit with a non-zero status when the target program does.
+ args = [
+ "compiled_action",
+ rebase_path(host_executable, root_build_dir),
+ ] + invoker.args
+ }
+}
+
+# A template for running Dart scripts during the build using the prebuilt Dart
+# SDK. This should *not* be used for generating snapshots. It uses the dart
+# binary from the prebuilt Dart SDK if one is available, and dart_bootstrap
+# otherwise.
+#
+# Parameters:
+# script:
+# The un-rebased path to the Dart script.
+#
+# vm_args (optional):
+# Arguments to pass to the Dart VM.
+#
+# args (optional):
+# The arguments to pass to the Dart script.
+#
+# packages (optional):
+# The un-rebased path to the .packages file.
+#
+# Forwarded to action() with the usual meaning:
+# depfile
+# deps
+# inputs
+# outputs
+# visibility
+template("prebuilt_dart_action") {
+ assert(defined(invoker.script), "script must be defined for $target_name")
+ assert(defined(invoker.outputs), "outputs must be defined for $target_name")
+ assert(defined(invoker.args), "args must be defined for $target_name")
+ assert(!defined(invoker.sources),
+ "prebuilt_dart_action doesn't take a sources arg. Use inputs instead.")
+
+ vm_args = []
+ if (defined(invoker.vm_args)) {
+ vm_args += invoker.vm_args
+ }
+
+ if (prebuilt_dart_exe_works) {
+ action(target_name) {
+ forward_variables_from(invoker, [
+ "inputs",
+ "outputs",
+ "deps",
+ "visibility",
+ "depfile",
+ ])
+ script = "$_dart_root/build/gn_run_binary.py"
+ prebuilt_dart_binary =
+ "$_dart_root/tools/sdks/$host_os/dart-sdk/bin/dart$executable_suffix"
+
+ inputs += [ invoker.script ]
+ if (defined(invoker.packages)) {
+ inputs += [ invoker.packages ]
+ }
+
+ args = [
+ "compiled_action",
+ rebase_path(prebuilt_dart_binary),
+ ] + vm_args
+ if (defined(invoker.packages)) {
+ args += [
+ "--packages=" + rebase_path(invoker.packages),
+ ]
+ }
+ args += [ rebase_path(invoker.script) ] + invoker.args
+ }
+ } else {
+ _compiled_action(target_name) {
+ forward_variables_from(invoker, [
+ "inputs",
+ "outputs",
+ "deps",
+ "visibility",
+ "depfile",
+ ])
+
+ inputs += [ invoker.script ]
+ if (defined(invoker.packages)) {
+ inputs += [ invoker.packages ]
+ }
+
+ tool = "$_dart_root/runtime/bin:dart_bootstrap"
+ args = vm_args
+ if (defined(invoker.packages)) {
+ args += [
+ "--packages=" + rebase_path(invoker.packages),
+ ]
+ }
+ args += [ rebase_path(invoker.script) ] + invoker.args
+ }
+ }
+}
+
+# This template runs the specified tool produced by the in-progress build.
+#
+# Parameters:
+# tool:
+# The target of the tool to run.
+#
+# script (optional):
+# The un-rebased path to the Dart script.
+#
+# vm_args (optional):
+# Arguments to pass to the Dart VM.
+#
+# args (optional):
+# The arguments to pass to the Dart script.
+#
+# packages (optional):
+# The un-rebased path to the .packages file.
+#
+# Forwarded to action() with the usual meaning:
+# depfile
+# deps
+# inputs
+# outputs
+# visibility
+template("_built_tool_action") {
+ assert(defined(invoker.tool), "tool must be defined for $target_name")
+ assert(defined(invoker.outputs), "outputs must be defined for $target_name")
+ assert(defined(invoker.args), "args must be defined for $target_name")
+ assert(!defined(invoker.sources),
+ "sources arg not supported for $target_name. Use inputs instead.")
+
+ vm_args = []
+ if (defined(invoker.vm_args)) {
+ vm_args += invoker.vm_args
+ }
+
+ _compiled_action(target_name) {
+ forward_variables_from(invoker, [
+ "depfile",
+ "deps",
+ "inputs",
+ "outputs",
+ "tool",
+ "visibility",
+ ])
+
+ if (!defined(invoker.inputs)) {
+ inputs = []
+ }
+ if (defined(invoker.script)) {
+ inputs += [ invoker.script ]
+ }
+ if (defined(invoker.packages)) {
+ inputs += [ invoker.packages ]
+ }
+
+ args = vm_args
+ if (defined(invoker.packages)) {
+ args += [ "--packages=" + rebase_path(invoker.packages) ]
+ }
+ if (defined(invoker.script)) {
+ args += [ rebase_path(invoker.script) ]
+ }
+ args += invoker.args
+ }
+}
+
+# This template runs the Dart VM produced by the in-progress build.
+#
+# Parameters:
+# script:
+# The un-rebased path to the Dart script.
+#
+# vm_args (optional):
+# Arguments to pass to the Dart VM.
+#
+# args (optional):
+# The arguments to pass to the Dart script.
+#
+# packages (optional):
+# The un-rebased path to the .packages file.
+#
+# Forwarded to action() with the usual meaning:
+# depfile
+# deps
+# inputs
+# outputs
+# visibility
+template("dart_action") {
+ assert(defined(invoker.script), "script must be defined for $target_name")
+ _built_tool_action(target_name) {
+ tool = "$_dart_root/runtime/bin:dart"
+ forward_variables_from(invoker, [
+ "args",
+ "depfile",
+ "deps",
+ "inputs",
+ "outputs",
+ "packages",
+ "script",
+ "tool",
+ "visibility",
+ "vm_args",
+ ])
+ }
+}
+
+# This template runs the dart_bootstrap produced by the in-progress build.
+#
+# Parameters:
+# script:
+# The un-rebased path to the Dart script.
+#
+# vm_args (optional):
+# Arguments to pass to the Dart VM.
+#
+# args (optional):
+# The arguments to pass to the Dart script.
+#
+# packages (optional):
+# The un-rebased path to the .packages file.
+#
+# Forwarded to action() with the usual meaning:
+# depfile
+# deps
+# inputs
+# outputs
+# visibility
+template("dart_bootstrap_action") {
+ assert(defined(invoker.script), "script must be defined for $target_name")
+ _built_tool_action(target_name) {
+ tool = "$_dart_root/runtime/bin:dart_bootstrap"
+ forward_variables_from(invoker, [
+ "args",
+ "depfile",
+ "deps",
+ "inputs",
+ "outputs",
+ "packages",
+ "script",
+ "tool",
+ "visibility",
+ "vm_args",
+ ])
+ }
+}
+
+# This template runs the gen_snapshot produced by the in-progress build.
+#
+# Parameters:
+# vm_args (optional):
+# Arguments to pass to the Dart VM.
+#
+# args (optional):
+# The arguments to pass to the Dart script.
+#
+# packages (optional):
+# The un-rebased path to the .packages file.
+#
+# Forwarded to action() with the usual meaning:
+# depfile
+# deps
+# inputs
+# outputs
+# visibility
+template("gen_snapshot_action") {
+ assert(!defined(invoker.script),
+ "script must not be defined for $target_name. If there is a script use args instead.")
+ _built_tool_action(target_name) {
+ tool = "$_dart_root/runtime/bin:gen_snapshot"
+ forward_variables_from(invoker, [
+ "args",
+ "depfile",
+ "deps",
+ "inputs",
+ "outputs",
+ "packages",
+ "tool",
+ "visibility",
+ "vm_args",
+ ])
+ }
+}
diff --git a/build/dart_host_sdk_toolchain.gni b/build/dart/dart_host_sdk_toolchain.gni
similarity index 100%
rename from build/dart_host_sdk_toolchain.gni
rename to build/dart/dart_host_sdk_toolchain.gni
diff --git a/build/prebuilt_dart_sdk.gni b/build/dart/prebuilt_dart_sdk.gni
similarity index 63%
rename from build/prebuilt_dart_sdk.gni
rename to build/dart/prebuilt_dart_sdk.gni
index ca4261e..59e519c 100644
--- a/build/prebuilt_dart_sdk.gni
+++ b/build/dart/prebuilt_dart_sdk.gni
@@ -2,14 +2,15 @@
# 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("executable_suffix.gni")
+import("../executable_suffix.gni")
-_dart_root = rebase_path("..")
+_dart_root = rebase_path("../..")
_prebuilt_dart_exe = "$_dart_root/tools/sdks/$host_os/dart-sdk/bin/dart$executable_suffix"
-# Our gn_run_binary swallows output unless there is an error.
-_prebuilt_dart_exe_trial = exec_script("gn_run_binary.py",
+# 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.
+_prebuilt_dart_exe_trial = exec_script("../gn_run_binary.py",
["exec_script", _prebuilt_dart_exe, "--version"], "string")
if (_prebuilt_dart_exe_trial == "") {
prebuilt_dart_exe_works = true
diff --git a/build/dart_action.gni b/build/dart_action.gni
deleted file mode 100644
index 81c147f..0000000
--- a/build/dart_action.gni
+++ /dev/null
@@ -1,92 +0,0 @@
-# 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("compiled_action.gni")
-import("executable_suffix.gni")
-import("prebuilt_dart_sdk.gni")
-
-_dart_root = get_path_info("..", "abspath")
-
-# A template for running Dart scripts during the build. This should *not* be
-# used for generating snapshots. It uses the dart binary from the prebuilt
-# Dart SDK if one is available, and dart_bootstrap otherwise.
-#
-# Parameters:
-# script:
-# The un-rebased path to the Dart script.
-#
-# args:
-# The arguments to pass to the Dart script.
-
-# packages (optional):
-# The un-rebased path to the .packages file.
-#
-# Forwarded to action() with the usual meaning:
-# depfile
-# deps
-# inputs
-# outputs
-# visibility
-template("dart_action") {
- assert(defined(invoker.script), "script must be defined for $target_name")
- assert(defined(invoker.outputs), "outputs must be defined for $target_name")
- assert(defined(invoker.args), "args must be defined for $target_name")
- assert(!defined(invoker.sources),
- "dart_action doesn't take a sources arg. Use inputs instead.")
-
- if (prebuilt_dart_exe_works) {
- action(target_name) {
- forward_variables_from(invoker, [
- "inputs",
- "outputs",
- "deps",
- "visibility",
- "depfile",
- ])
- script = "$_dart_root/build/gn_run_binary.py"
- prebuilt_dart_binary =
- "$_dart_root/tools/sdks/$host_os/dart-sdk/bin/dart$executable_suffix"
-
- inputs += [ invoker.script ]
- if (defined(invoker.packages)) {
- inputs += [ invoker.packages ]
- }
-
- args = [
- "compiled_action",
- rebase_path(prebuilt_dart_binary),
- ]
- if (defined(invoker.packages)) {
- args += [
- "--packages=" + rebase_path(invoker.packages),
- ]
- }
- args += [ rebase_path(invoker.script) ] + invoker.args
- }
- } else {
- compiled_action(target_name) {
- forward_variables_from(invoker, [
- "inputs",
- "outputs",
- "deps",
- "visibility",
- "depfile",
- ])
-
- inputs += [ invoker.script ]
- if (defined(invoker.packages)) {
- inputs += [ invoker.packages ]
- }
-
- tool = "runtime/bin:dart_bootstrap"
- args = []
- if (defined(invoker.packages)) {
- args += [
- "--packages=" + rebase_path(invoker.packages),
- ]
- }
- args += [ rebase_path(invoker.script) ] + invoker.args
- }
- }
-}
diff --git a/build/vs_toolchain.py b/build/vs_toolchain.py
index 7c6a772..bfb8215 100644
--- a/build/vs_toolchain.py
+++ b/build/vs_toolchain.py
@@ -86,8 +86,9 @@
bitness = platform.architecture()[0]
# When running 64-bit python the x64 DLLs will be in System32
x64_path = 'System32' if bitness == '64bit' else 'Sysnative'
- x64_path = os.path.join(r'C:\Windows', x64_path)
- vs_runtime_dll_dirs = [x64_path, r'C:\Windows\SysWOW64']
+ system_root = os.environ['SystemRoot']
+ x64_path = os.path.join(system_root, x64_path)
+ vs_runtime_dll_dirs = [x64_path, os.path.join(system_root, r'SysWOW64')]
return vs_runtime_dll_dirs
diff --git a/docs/language/.gitignore b/docs/language/.gitignore
index 01da07f..13c7614 100644
--- a/docs/language/.gitignore
+++ b/docs/language/.gitignore
@@ -1,5 +1,7 @@
-dartLangSpec.aux
-dartLangSpec.log
-dartLangSpec.out
-dartLangSpec.pdf
-dartLangSpec.toc
+dartLangSpec*.aux
+dartLangSpec*.log
+dartLangSpec*.out
+dartLangSpec*.pdf
+dartLangSpec*.toc
+*-hash.tex
+*-list.txt
diff --git a/docs/language/dartLangSpec.tex b/docs/language/dartLangSpec.tex
index 2e76f4c..30d92e1 100644
--- a/docs/language/dartLangSpec.tex
+++ b/docs/language/dartLangSpec.tex
@@ -43,6 +43,8 @@
% - Update mixin application forwarding constructors to correctly handle
% optional parameters and const constructors.
% - Specify `call` for Dart 2 (no function type given to enclosing class).
+% - Clarify that an identifier reference denoting a top-level, static, or
+% local function evaluates to the closurization of that declaration.
%
% 1.15
% - Change how language specification describes control flow.
@@ -1128,11 +1130,11 @@
}
\rationale{
-It is up to the implementation to choose an appropriate representation for functions.
-For example, consider that a closure produced via property extraction treats equality different from ordinary closures, and is therefore likely a different class.
-Implementations may also use different classes for functions based on arity and or type.
+It is up to the implementation to choose an appropriate representation for function objects.
+For example, consider that a function object produced via property extraction treats equality differently from other function objects, and is therefore likely a different class.
+Implementations may also use different classes for function objects based on arity and or type.
Arity may be implicitly affected by whether a function is an instance method (with an implicit receiver parameter) or not.
-The variations are manifold, and so this specification only guarantees that function objects are instances of some class that is considered to implement \FUNCTION{}.
+The variations are manifold, and so this specification only guarantees that function objects are instances of some class that implements \FUNCTION{}.
}
@@ -3871,6 +3873,8 @@
\LMLabel{functionExpressions}
\LMHash{}
+%% TODO(eernst): A function literal is a syntactic construct, and we may use
+%% function closurization to obtain a corresponding function object.
A {\em function literal} is an object that encapsulates an executable unit of code.
\begin{grammar}
@@ -4915,6 +4919,45 @@
$[A_1/X_1, \ldots, A_r/X_s]T_0$ of $F$.
+\subsection{Function Closurization}
+\LMLabel{functionClosurization}
+
+\LMHash{}
+Let $f$ be an expression denoting
+a declaration of a local function, a static method, or a top-level function
+(\ref{identifierReference})
+or let $f$ be a function literal
+(\ref{functionExpressions}).
+Evaluation of $f$ yields a function object
+which is the outcome of a {\em function closurization}
+applied to the declaration denoted by $f$
+respectively to the function literal $f$ considered as a function declaration.
+% Note that we do not promise that this will be a fresh function object,
+% such that constant expressions are covered as well, and others may be
+% identical even if not required, e.g., local functions with no free variables.
+{\em Closurization} denotes instance method closurization
+(\ref{ordinaryMemberClosurization})
+as well as function closurization,
+and it is also used as a shorthand for either of them when there is no ambiguity.
+
+\LMHash{}
+Function closurization applied to a function declaration $f$
+amounts to the creation of a function object $o$
+which is an instance of a class whose interface is a subtype of the actual type
+(\ref{actualTypeOfADeclaration})
+corresponding to the signature in the function declaration $f$,
+using the current bindings of type variables, if any.
+%
+An invocation of $o$ with a given argument list will bind actuals to formals
+in the same way as an invocation of $f$
+(\ref{bindingActualsToFormals}),
+and then execute the body of $f$
+in the captured scope amended with the bound parameter scope,
+yielding the same completion
+(\ref{completion})
+as the invocation of $f$ would have yielded.
+
+
\subsection{Lookup}
\LMLabel{lookup}
@@ -5380,16 +5423,19 @@
\LMLabel{propertyExtraction}
\LMHash{}
-{\em Property extraction} allows for a member or constructor to be accessed as a property rather than a function.
+{\em Property extraction} allows for a member to be accessed as a property rather than a function.
A property extraction can be either:
\begin{enumerate}
-\item A {\em closurization} which converts a method or constructor into a closure.
+\item An instance method closurization,
+which converts a method into a function object
+(\ref{ordinaryMemberClosurization}).
Or
-\item A {\em getter invocation} which returns the result of invoking of a getter method.
+\item A getter invocation, which returns the result of invoking of a getter method
+(\ref{getterAccessAndMethodExtraction}).
\end{enumerate}
\commentary{
-Closures derived from members via closurization are colloquially known as tear-offs.
+Function objects derived via closurization are colloquially known as tear-offs.
}
Property extraction can be either {\em conditional} or {\em unconditional}.
@@ -5561,8 +5607,14 @@
}
\LMHash{}
+An {\em instance method closurization}
+is a closurization of some method on some object, defined below,
+or a super closurization (\ref{superClosurization}).
+
+\LMHash{}
Let $o$ be an object, and let $u$ be a fresh final variable bound to $o$.
-The {\em closurization of method $f$ on object $o$} is defined to be equivalent to:
+The {\em closurization of method $f$ on object $o$} is defined to be equivalent
+(\commentary{except for equality, as noted below}) to:
\begin{itemize}
%\item $(a) \{\RETURN{}$ $u$ $op$ $a;$\} if $f$ is named $op$ and $op$ is one of \code{<, >, <=, >=, ==, -, +, /, \~{}/, *, \%, $|$, \^{}, \&, $<<$, $>>$} (this precludes closurization of unary -).
%\item $() \{\RETURN{}$ \~{} $u;$\} if $f$ is named \~{}.
@@ -5638,8 +5690,13 @@
If that parameter declaration has no type annotation then $T_j$ is \DYNAMIC{}.
\LMHash{}
-There is one way in which the closurization differs from the function literal:
-\code{$o_1.m$ == $o_2.m$} is equal to \code{identical($o_1, o_2$)}.
+There is one way in which
+the function object yielded by the instance method closurization differs from
+the function object obtained by function closurization on the above mentioned function literal:
+Assume that $o_1$ and $o_2$ are objects, $m$ is an identifier,
+and $c_1$ and $c_2$ are function objects
+obtained by closurization of $m$ on $o_1$ respectively $o_2$.
+Then \code{$c_1$ == $c_2$} evaluates to true if and only if $o_1$ and $o_2$ is the same object.
%\item The static type of the property extraction is the static type of function $T.m$, where $T$ is the static type of $e$, if $T.m$ is defined. Otherwise the static type of $e.m$ is \DYNAMIC{}.
@@ -5648,12 +5705,12 @@
% and for the closurizations.
In particular, two closurizations of a method $m$ from the same object are equal,
and two closurizations of a method $m$ from non-identical objects are not equal.
-It also follows that \code{identical($o_1.m, o_2.m$)} must be false when $o_1$ and $o_2$ are not identical.
-However, Dart implementations are not required to canonicalize closures,
-which means that \code{identical($o_1.m, o_2.m$)} is not guaranteed to be true,
-even when it is known that $o_1$ and $o_2$ are identical.
+Assuming that $v_i$ is a fresh variable bound to an object, $i \in 1 .. 2$,
+it also follows that \code{identical($v_1.m, v_2.m$)} must be false when $v_1$ and $v_2$ are not bound to the same object.
+However, Dart implementations are not required to canonicalize function objects,
+which means that \code{identical($v_1.m, v_2.m$)} is not guaranteed to be true,
+even when it is known that $v_1$ and $v_2$ are bound to the same object.
}
-% local functions that have a closure extracted are always different
\rationale{
The special treatment of equality in this case facilitates the use of extracted property functions in APIs where callbacks such as event listeners must often be registered and later unregistered.
@@ -5679,7 +5736,11 @@
}
\LMHash{}
-The {\em closurization of method $f$ with respect to $S$} is defined to be equivalent to:
+A {\em super closurization}
+is a closurization of a method with respect to a class, as defined next.
+The {\em closurization of the method $f$ with respect to the class $S$}
+is defined to be equivalent
+(\commentary{except for equality, as noted below}) to:
\LMHash{}
\begin{itemize}
@@ -5711,6 +5772,11 @@
and optional positional parameters $p_1, \ldots, p_k$ with defaults $d_1, \ldots, d_k$.
\end{itemize}
+\commentary{
+Note that a super closurization is an {\em instance method closurization},
+as defined in (\ref{ordinaryMemberClosurization}).
+}
+
\LMHash{}
$B'_j, j \in 1 .. s$, are determined as follows:
If $S$ is a non-generic class then $B'_j = B_j, j \in 1 .. s$.
@@ -5752,10 +5818,13 @@
If that parameter declaration has no type annotation then $T_j$ is \DYNAMIC{}.
\LMHash{}
-There is one way in which the closurization differs from the function literal:
-Assume that an occurrence of the expression \SUPER{}.$m$ in a given class is evaluated on two occasions where \THIS{} is $o_1$ respectively $o_2$,
-and the resulting closurization is $c_1$ respectively $c_2$:
-\code{$c_1$ == $c_2$} is then equal to \code{identical($o_1, o_2$)}.
+There is one way in which
+the function object yielded by the super closurization differs from
+the function object obtained by function closurization on the above mentioned function literal:
+Assume that an occurrence of the expression \SUPER{}.$m$ in a given class
+is evaluated on two occasions where \THIS{} is bound to $o_1$ respectively $o_2$,
+and the resulting function objects are $c_1$ respectively $c_2$:
+\code{$c_1$ == $c_2$} is then true if and only if $o_1$ and $o_2$ is the same object.
\subsection{Assignment}
@@ -6121,8 +6190,8 @@
If all of the following hold:
\begin{itemize}
\item $e_1$ shows that a variable $v$ has type $T$.
-\item $v$ is not potentially mutated in $e_2$ or within a closure.
-\item If the variable $v$ is accessed by a closure in $e_2$ then the variable $v$ is not potentially mutated anywhere in the scope of $v$.
+\item $v$ is not potentially mutated in $e_2$ or within a function.
+\item If the variable $v$ is accessed by a function in $e_2$ then the variable $v$ is not potentially mutated anywhere in the scope of $v$.
\end{itemize}
then the type of $v$ is known to be $T$ in $e_2$.
@@ -6186,15 +6255,15 @@
\begin{itemize}
\item Either $e_1$ shows that $v$ has type $T$ or $e_2$ shows that $v$ has type $T$.
\item $v$ is a local variable or formal parameter.
-\item The variable $v$ is not mutated in $e_2$ or within a closure.
+\item The variable $v$ is not mutated in $e_2$ or within a function.
\end{itemize}
\LMHash{}
Furthermore, if all of the following hold:
\begin{itemize}
\item $e_1$ shows that $v$ has type $T$.
-\item $v$ is not mutated in either $e_1$, $e_2$ or within a closure.
-\item If the variable $v$ is accessed by a closure in $e_2$ then the variable $v$ is not potentially mutated anywhere in the scope of $v$.
+\item $v$ is not mutated in either $e_1$, $e_2$ or within a function.
+\item If the variable $v$ is accessed by a function in $e_2$ then the variable $v$ is not potentially mutated anywhere in the scope of $v$.
\end{itemize}
then the type of $v$ is known to be $T$ in $e_2$.
@@ -6849,7 +6918,7 @@
% \end{itemize}
\item If $d$ is a local variable or formal parameter then $e$ evaluates to the current binding of $id$.
%\item If $d$ is a library variable, local variable, or formal parameter, then $e$ evaluates to the current binding of $id$. \commentary{This case also applies if d is a library or local function declaration, as these are equivalent to function-valued variable declarations.}
-\item If $d$ is a static method, top-level function or local function then $e$ evaluates to the function defined by $d$.
+\item If $d$ is a static method, top-level function or local function then $e$ evaluates to the function object obtained by closurization (\ref{functionClosurization}) of the declaration denoted by $d$.
\item If $d$ is the declaration of a static variable, static getter or static setter declared in class $C$, then evaluation of $e$ is equivalent to evaluation of the property extraction (\ref{propertyExtraction}) $C.id$.
\item If $d$ is the declaration of a library variable, top-level getter or top-level setter, then evaluation of $e$ is equivalent to evaluation of the top level getter invocation (\ref{topLevelGetterInvocation}) $id$.
\item Otherwise, if $e$ occurs inside a top level or static function (be it function, method, getter, or setter) or variable initializer, evaluation of $e$ causes a \code{NoSuchMethod} to be thrown.
@@ -7155,7 +7224,7 @@
\commentary{
There is no way to write a pair of mutually recursive local functions, because one always has to come before the other is declared.
-These cases are quite rare, and can always be managed by defining a pair of variables first, then assigning them appropriate closures:
+These cases are quite rare, and can always be managed by defining a pair of variables first, then assigning them appropriate function literals:
}
\begin{dartCode}
@@ -7172,8 +7241,6 @@
It therefore makes sense to harmonize the rules for local functions with those for functions in general rather than with the rules for local variables.
}
-% elaborate on function identity and equality, run-time type. Likewsie in function expressions (closures) and declarations
-
\subsection{If}
\LMLabel{if}
@@ -7225,8 +7292,8 @@
If:
\begin{itemize}
\item $b$ shows that a variable $v$ has type $T$.
-\item $v$ is not potentially mutated in $s_1$ or within a closure.
-\item If the variable $v$ is accessed by a closure in $s_1$ then the variable $v$ is not potentially mutated anywhere in the scope of $v$.
+\item $v$ is not potentially mutated in $s_1$ or within a function.
+\item If the variable $v$ is accessed by a function in $s_1$ then the variable $v$ is not potentially mutated anywhere in the scope of $v$.
\end{itemize}
then the type of $v$ is known to be $T$ in $s_1$.
@@ -7295,7 +7362,9 @@
\end{enumerate}
\rationale{
-The definition above is intended to prevent the common error where users create a closure inside a for loop, intending to close over the current binding of the loop variable, and find (usually after a painful process of debugging and learning) that all the created closures have captured the same value - the one current in the last iteration executed.
+The definition above is intended to prevent the common error where users create a function object inside a for loop,
+intending to close over the current binding of the loop variable,
+and find (usually after a painful process of debugging and learning) that all the created function objects have captured the same value---the one current in the last iteration executed.
Instead, each iteration has its own distinct variable.
The first iteration uses the variable created by the initial declaration.
diff --git a/docs/language/informal/nosuchmethod-forwarding.md b/docs/language/informal/nosuchmethod-forwarding.md
index 8feaf68..7365f8b 100644
--- a/docs/language/informal/nosuchmethod-forwarding.md
+++ b/docs/language/informal/nosuchmethod-forwarding.md
@@ -4,7 +4,7 @@
**Status**: Under implementation.
-**Version**: 0.5 (2017-11-27)
+**Version**: 0.6 (2018-03-22)
**This document** is an informal specification of the support in Dart 2 for
invoking `noSuchMethod` in situations where an attempt is made to invoke a
@@ -294,9 +294,34 @@
statically checked and dynamic invocations: Whenever an instance method is
invoked, and no such method exists, `noSuchMethod` will be invoked.*
+*One special case to be aware of is where a forwarder is torn off and then
+invoked with an actual argument list which does not match the formal
+parameter list. In that situation we will get an invocation of
+`Object.noSuchMethod` rather than the `noSuchMethod` in the original
+receiver, because this is an invocation of a function object (and they do
+not override `noSuchMethod`):*
+
+```dart
+class A {
+ dynamic noSuchMethod(Invocation i) => null;
+ void foo();
+}
+
+main() {
+ A a = new A();
+ dynamic f = a.foo;
+ // Invokes `Object.noSuchMethod`, not `A.noSuchMethod`, so it throws.
+ f(42);
+}
+```
+
## Updates
+* Mar 22nd 2018, version 0.6: Added example to illustrate the case where a
+ torn-off method invokes `Object.noSuchMethod`, not the one in the
+ receiver, because of a non-matching actual argument list.
+
* Nov 27th 2017, version 0.5: Changed terminology to use 'implicitly
induced method implementations'. Helped achieving a major simplifaction
of the dynamic semantics.
diff --git a/pkg/analysis_server/benchmark/perf/memory_tests.dart b/pkg/analysis_server/benchmark/perf/memory_tests.dart
index ea4b3ba..2d9e01e 100644
--- a/pkg/analysis_server/benchmark/perf/memory_tests.dart
+++ b/pkg/analysis_server/benchmark/perf/memory_tests.dart
@@ -77,6 +77,7 @@
return startServer(
servicesPort: vmServicePort,
cfe: useCFE,
+ checked: false,
).then((_) {
server.listenToOutput(dispatchNotification);
server.exitCode.then((_) {
diff --git a/pkg/analysis_server/doc/api.html b/pkg/analysis_server/doc/api.html
index 23bda67..453a520 100644
--- a/pkg/analysis_server/doc/api.html
+++ b/pkg/analysis_server/doc/api.html
@@ -109,7 +109,7 @@
<body>
<h1>Analysis Server API Specification</h1>
<h1 style="color:#999999">Version
- 1.20.1
+ 1.20.2
</h1>
<p>
This document contains a specification of the API provided by the
diff --git a/pkg/analysis_server/lib/src/analysis_server.dart b/pkg/analysis_server/lib/src/analysis_server.dart
index 1e6b8d0..b838056 100644
--- a/pkg/analysis_server/lib/src/analysis_server.dart
+++ b/pkg/analysis_server/lib/src/analysis_server.dart
@@ -108,7 +108,7 @@
* The version of the analysis server. The value should be replaced
* automatically during the build.
*/
- static final String VERSION = '1.20.1';
+ static final String VERSION = '1.20.2';
/**
* The options of this server instance.
@@ -1275,6 +1275,15 @@
analysisServer, path, result.lineInfo, unit);
});
}
+ // TODO:(dantup) Uncomment this and equivilent in
+ // test/analysis/notification_folding_test.dart once the
+ // implementation is complete.
+ // if (analysisServer._hasAnalysisServiceSubscription(
+ // AnalysisService.FOLDING, path)) {
+ // _runDelayed(() {
+ // sendAnalysisNotificationFolding(analysisServer, path, unit);
+ // });
+ // }
if (analysisServer._hasAnalysisServiceSubscription(
AnalysisService.OUTLINE, path)) {
_runDelayed(() {
diff --git a/pkg/analysis_server/lib/src/computer/computer_folding.dart b/pkg/analysis_server/lib/src/computer/computer_folding.dart
new file mode 100644
index 0000000..19b0c0d
--- /dev/null
+++ b/pkg/analysis_server/lib/src/computer/computer_folding.dart
@@ -0,0 +1,52 @@
+// 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/dart/ast/ast.dart';
+import 'package:analyzer/dart/ast/visitor.dart';
+import 'package:analyzer_plugin/protocol/protocol_common.dart';
+
+/**
+ * A computer for [CompilationUnit] folding.
+ */
+class DartUnitFoldingComputer {
+ final CompilationUnit _unit;
+
+ Directive _firstDirective, _lastDirective;
+ final List<FoldingRegion> _foldingRegions = [];
+
+ DartUnitFoldingComputer(this._unit);
+
+ /**
+ * Returns a list of folding regions, not `null`.
+ */
+ List<FoldingRegion> compute() {
+ _unit.accept(new _DartUnitFoldingComputerVisitor(this));
+
+ if (_firstDirective != null &&
+ _lastDirective != null &&
+ _firstDirective != _lastDirective) {
+ _foldingRegions.add(new FoldingRegion(FoldingKind.DIRECTIVES,
+ _firstDirective.offset, _lastDirective.end - _firstDirective.offset));
+ }
+
+ return _foldingRegions;
+ }
+}
+
+/**
+ * An AST visitor for [DartUnitFoldingComputer].
+ */
+class _DartUnitFoldingComputerVisitor extends RecursiveAstVisitor<Object> {
+ final DartUnitFoldingComputer _computer;
+ _DartUnitFoldingComputerVisitor(this._computer);
+
+ @override
+ visitImportDirective(ImportDirective node) {
+ if (_computer._firstDirective == null) {
+ _computer._firstDirective = node;
+ }
+ _computer._lastDirective = node;
+ return super.visitImportDirective(node);
+ }
+}
diff --git a/pkg/analysis_server/lib/src/computer/computer_outline.dart b/pkg/analysis_server/lib/src/computer/computer_outline.dart
index 3516bbe..96432aa 100644
--- a/pkg/analysis_server/lib/src/computer/computer_outline.dart
+++ b/pkg/analysis_server/lib/src/computer/computer_outline.dart
@@ -365,6 +365,9 @@
* test package.
*/
bool isGroup(engine.ExecutableElement element) {
+ if (element != null && element.hasIsTestGroup) {
+ return true;
+ }
return element is engine.FunctionElement &&
element.name == 'group' &&
_isInsideTestPackage(element);
@@ -375,6 +378,9 @@
* test package.
*/
bool isTest(engine.ExecutableElement element) {
+ if (element != null && element.hasIsTest) {
+ return true;
+ }
return element is engine.FunctionElement &&
element.name == 'test' &&
_isInsideTestPackage(element);
@@ -424,9 +430,9 @@
}
void addOutlineNode(ElementKind kind, [List<Outline> children]) {
- String kindName = kind == ElementKind.UNIT_TEST_GROUP ? 'group' : 'test';
- String name = '$kindName("${extractString(
- node.argumentList?.arguments)}")';
+ String executableName = nameNode.name;
+ String description = extractString(node.argumentList?.arguments);
+ String name = '$executableName("$description")';
Element element = new Element(kind, name, 0,
location: outlineComputer._getLocationNode(nameNode));
contents.add(new Outline(
diff --git a/pkg/analysis_server/lib/src/computer/computer_overrides.dart b/pkg/analysis_server/lib/src/computer/computer_overrides.dart
index 5d53fd7..aeefe45 100644
--- a/pkg/analysis_server/lib/src/computer/computer_overrides.dart
+++ b/pkg/analysis_server/lib/src/computer/computer_overrides.dart
@@ -160,7 +160,7 @@
*/
OverriddenElements find() {
_visited.clear();
- _addSuperOverrides(_class.supertype);
+ _addSuperOverrides(_class.type, withThisType: false);
_visited.clear();
_addInterfaceOverrides(_class.type, false);
_superElements.forEach(_interfaceElements.remove);
@@ -189,20 +189,23 @@
_addInterfaceOverrides(type.superclass, checkType);
}
- void _addSuperOverrides(InterfaceType type) {
+ void _addSuperOverrides(InterfaceType type, {bool withThisType: true}) {
if (type == null) {
return;
}
if (!_visited.add(type)) {
return;
}
- // this type
- Element element = _lookupMember(type.element);
- if (element != null && !_superElements.contains(element)) {
- _superElements.add(element);
+
+ if (withThisType) {
+ Element element = _lookupMember(type.element);
+ if (element != null && !_superElements.contains(element)) {
+ _superElements.add(element);
+ }
}
- // super
+
_addSuperOverrides(type.superclass);
+ type.mixins.forEach(_addSuperOverrides);
}
Element _lookupMember(ClassElement classElement) {
diff --git a/pkg/analysis_server/lib/src/operation/operation_analysis.dart b/pkg/analysis_server/lib/src/operation/operation_analysis.dart
index 3a9fbc2..c08b148 100644
--- a/pkg/analysis_server/lib/src/operation/operation_analysis.dart
+++ b/pkg/analysis_server/lib/src/operation/operation_analysis.dart
@@ -6,6 +6,7 @@
import 'package:analysis_server/src/analysis_server.dart';
import 'package:analysis_server/src/computer/computer_closingLabels.dart';
+import 'package:analysis_server/src/computer/computer_folding.dart';
import 'package:analysis_server/src/computer/computer_highlights.dart';
import 'package:analysis_server/src/computer/computer_highlights2.dart';
import 'package:analysis_server/src/computer/computer_outline.dart';
@@ -80,6 +81,15 @@
});
}
+void sendAnalysisNotificationFolding(
+ AnalysisServer server, String file, CompilationUnit dartUnit) {
+ _sendNotification(server, () {
+ var regions = new DartUnitFoldingComputer(dartUnit).compute();
+ var params = new protocol.AnalysisFoldingParams(file, regions);
+ server.sendNotification(params.toNotification());
+ });
+}
+
void sendAnalysisNotificationFlushResults(
AnalysisServer server, List<String> files) {
_sendNotification(server, () {
diff --git a/pkg/analysis_server/lib/src/services/completion/dart/combinator_contributor.dart b/pkg/analysis_server/lib/src/services/completion/dart/combinator_contributor.dart
index 4d30f30..2914658 100644
--- a/pkg/analysis_server/lib/src/services/completion/dart/combinator_contributor.dart
+++ b/pkg/analysis_server/lib/src/services/completion/dart/combinator_contributor.dart
@@ -32,7 +32,9 @@
LibraryElementSuggestionBuilder builder =
new LibraryElementSuggestionBuilder(request.libraryElement,
CompletionSuggestionKind.IDENTIFIER, false, false);
- library.visitChildren(builder);
+ for (var element in library.exportNamespace.definedNames.values) {
+ element.accept(builder);
+ }
return builder.suggestions;
}
}
diff --git a/pkg/analysis_server/lib/src/services/completion/dart/library_member_contributor.dart b/pkg/analysis_server/lib/src/services/completion/dart/library_member_contributor.dart
index 078959a..b7afbbe 100644
--- a/pkg/analysis_server/lib/src/services/completion/dart/library_member_contributor.dart
+++ b/pkg/analysis_server/lib/src/services/completion/dart/library_member_contributor.dart
@@ -57,7 +57,9 @@
LibraryElementSuggestionBuilder builder =
new LibraryElementSuggestionBuilder(containingLibrary,
CompletionSuggestionKind.INVOCATION, typesOnly, instCreation);
- library.visitChildren(builder);
+ for (var element in importElem.namespace.definedNames.values) {
+ element.accept(builder);
+ }
suggestions.addAll(builder.suggestions);
// If the import is 'deferred' then suggest 'loadLibrary'
diff --git a/pkg/analysis_server/lib/src/services/completion/dart/suggestion_builder.dart b/pkg/analysis_server/lib/src/services/completion/dart/suggestion_builder.dart
index 909345c..7c88a82 100644
--- a/pkg/analysis_server/lib/src/services/completion/dart/suggestion_builder.dart
+++ b/pkg/analysis_server/lib/src/services/completion/dart/suggestion_builder.dart
@@ -211,21 +211,15 @@
}
/**
- * This class visits elements in a library and provides suggestions based upon
- * the visible members in that library.
+ * This class creates suggestions based upon top-level elements.
*/
-class LibraryElementSuggestionBuilder extends GeneralizingElementVisitor
+class LibraryElementSuggestionBuilder extends SimpleElementVisitor
with ElementSuggestionBuilder {
final LibraryElement containingLibrary;
final CompletionSuggestionKind kind;
final bool typesOnly;
final bool instCreation;
- /**
- * The set of libraries that have been, or are currently being, visited.
- */
- final Set<LibraryElement> visitedLibraries = new Set<LibraryElement>();
-
LibraryElementSuggestionBuilder(
this.containingLibrary, this.kind, this.typesOnly, this.instCreation);
@@ -239,17 +233,6 @@
}
@override
- visitCompilationUnitElement(CompilationUnitElement element) {
- element.visitChildren(this);
- LibraryElement containingLibrary = element.library;
- if (containingLibrary != null) {
- for (var lib in containingLibrary.exportedLibraries) {
- lib.accept(this);
- }
- }
- }
-
- @override
visitConstructorElement(ConstructorElement element) {
if (instCreation) {
ClassElement classElem = element.enclosingElement;
@@ -263,11 +246,6 @@
}
@override
- visitElement(Element element) {
- // ignored
- }
-
- @override
visitFunctionElement(FunctionElement element) {
if (!typesOnly) {
int relevance = element.library == containingLibrary
@@ -285,19 +263,13 @@
}
@override
- visitLibraryElement(LibraryElement element) {
- if (visitedLibraries.add(element)) {
- element.visitChildren(this);
- }
- }
-
- @override
- visitTopLevelVariableElement(TopLevelVariableElement element) {
+ visitPropertyAccessorElement(PropertyAccessorElement element) {
if (!typesOnly) {
- int relevance = element.library == containingLibrary
+ PropertyInducingElement variable = element.variable;
+ int relevance = variable.library == containingLibrary
? DART_RELEVANCE_LOCAL_TOP_LEVEL_VARIABLE
: DART_RELEVANCE_DEFAULT;
- addSuggestion(element, relevance: relevance);
+ addSuggestion(variable, relevance: relevance);
}
}
}
diff --git a/pkg/analysis_server/lib/src/services/completion/statement/statement_completion.dart b/pkg/analysis_server/lib/src/services/completion/statement/statement_completion.dart
index 2277f99..3c7bdd83 100644
--- a/pkg/analysis_server/lib/src/services/completion/statement/statement_completion.dart
+++ b/pkg/analysis_server/lib/src/services/completion/statement/statement_completion.dart
@@ -804,6 +804,9 @@
if (_isSyntheticExpression(statement.condition)) {
exitPosition = _newPosition(statement.leftParenthesis.offset + 1);
sb = new SourceBuilder(file, statement.rightParenthesis.offset + 1);
+ } else if (statement.rightParenthesis.isSynthetic) {
+ sb = new SourceBuilder(file, statement.condition.end);
+ sb.append(')');
} else {
int afterParen = statement.rightParenthesis.offset + 1;
if (utils
diff --git a/pkg/analysis_server/lib/src/services/correction/fix.dart b/pkg/analysis_server/lib/src/services/correction/fix.dart
index 3ba57d8..cdcdc36 100644
--- a/pkg/analysis_server/lib/src/services/correction/fix.dart
+++ b/pkg/analysis_server/lib/src/services/correction/fix.dart
@@ -98,6 +98,8 @@
'ADD_MISSING_PARAMETER_POSITIONAL',
31,
"Add optional positional parameter");
+ static const ADD_MISSING_PARAMETER_NAMED = const FixKind(
+ 'ADD_MISSING_PARAMETER_NAMED', 30, "Add named parameter '{0}'");
static const ADD_MISSING_PARAMETER_REQUIRED = const FixKind(
'ADD_MISSING_PARAMETER_REQUIRED', 30, "Add required parameter");
static const ADD_MISSING_REQUIRED_ARGUMENT = const FixKind(
diff --git a/pkg/analysis_server/lib/src/services/correction/fix_internal.dart b/pkg/analysis_server/lib/src/services/correction/fix_internal.dart
index 580e541..79b6f55 100644
--- a/pkg/analysis_server/lib/src/services/correction/fix_internal.dart
+++ b/pkg/analysis_server/lib/src/services/correction/fix_internal.dart
@@ -361,6 +361,9 @@
await _addFix_importLibrary_withTopLevelVariable();
await _addFix_createLocalVariable();
}
+ if (errorCode == StaticWarningCode.UNDEFINED_NAMED_PARAMETER) {
+ await _addFix_addMissingNamedArgument();
+ }
if (errorCode == StaticTypeWarningCode.UNDEFINED_METHOD_WITH_CONSTRUCTOR) {
await _addFix_undefinedMethodWithContructor();
}
@@ -608,6 +611,60 @@
}
}
+ Future<Null> _addFix_addMissingNamedArgument() async {
+ // Prepare the name of the missing parameter.
+ if (this.node is! SimpleIdentifier) {
+ return;
+ }
+ SimpleIdentifier node = this.node;
+ String name = node.name;
+
+ // We expect that the node is part of a NamedExpression.
+ if (node.parent?.parent is! NamedExpression) {
+ return;
+ }
+ NamedExpression namedExpression = node.parent.parent;
+
+ // We should be in an ArgumentList.
+ if (namedExpression.parent is! ArgumentList) {
+ return;
+ }
+ AstNode argumentList = namedExpression.parent;
+
+ // Prepare the invoked element.
+ var context =
+ new _ExecutableParameters(session, astProvider, argumentList.parent);
+ if (context == null) {
+ return;
+ }
+
+ // We cannot add named parameters when there are positional positional.
+ if (context.optionalPositional.isNotEmpty) {
+ return;
+ }
+
+ Future<void> addParameter(int offset, String prefix, String suffix) async {
+ if (offset != null) {
+ DartChangeBuilder changeBuilder = await context.addParameter(
+ offset, prefix, namedExpression.staticType, name, suffix);
+ _addFixFromBuilder(
+ changeBuilder, DartFixKind.ADD_MISSING_PARAMETER_NAMED,
+ args: [name]);
+ }
+ }
+
+ if (context.named.isNotEmpty) {
+ var prevNode = await context.getParameterNode(context.named.last);
+ await addParameter(prevNode?.end, ', ', '');
+ } else if (context.required.isNotEmpty) {
+ var prevNode = await context.getParameterNode(context.required.last);
+ await addParameter(prevNode?.end, ', {', '}');
+ } else {
+ var parameterList = await context.getParameterList();
+ await addParameter(parameterList?.leftParenthesis?.end, '{', '}');
+ }
+ }
+
Future<Null> _addFix_addMissingParameter() async {
if (node is ArgumentList && node.parent is MethodInvocation) {
ArgumentList argumentList = node;
@@ -2198,10 +2255,10 @@
if (list.variables.length == 1) {
DartChangeBuilder changeBuilder = new DartChangeBuilder(session);
await changeBuilder.addFileEdit(file, (DartFileEditBuilder builder) {
- if (list.type == null && list.keyword.keyword == Keyword.VAR) {
+ if (list.keyword == null) {
+ builder.addSimpleInsertion(list.offset, 'final ');
+ } else if (list.keyword.keyword == Keyword.VAR) {
builder.addSimpleReplacement(range.token(list.keyword), 'final');
- } else if (list.type != null && list.keyword == null) {
- builder.addSimpleInsertion(list.type.offset, 'final ');
}
});
_addFixFromBuilder(changeBuilder, DartFixKind.MAKE_FINAL);
@@ -3729,3 +3786,91 @@
}
}
}
+
+/**
+ * [ExecutableElement], its parameters, and operations on them.
+ */
+class _ExecutableParameters {
+ final AnalysisSession session;
+ final AstProvider astProvider;
+ final ExecutableElement executable;
+
+ final List<ParameterElement> required = [];
+ final List<ParameterElement> optionalPositional = [];
+ final List<ParameterElement> named = [];
+
+ factory _ExecutableParameters(
+ AnalysisSession session, AstProvider astProvider, AstNode invocation) {
+ Element element;
+ if (invocation is InstanceCreationExpression) {
+ element = invocation.staticElement;
+ }
+ if (invocation is MethodInvocation) {
+ element = invocation.methodName.staticElement;
+ }
+ if (element is ExecutableElement) {
+ return new _ExecutableParameters._(session, astProvider, element);
+ } else {
+ return null;
+ }
+ }
+
+ _ExecutableParameters._(this.session, this.astProvider, this.executable) {
+ for (var parameter in executable.parameters) {
+ if (parameter.isNotOptional) {
+ required.add(parameter);
+ } else if (parameter.isOptionalPositional) {
+ optionalPositional.add(parameter);
+ } else if (parameter.isNamed) {
+ named.add(parameter);
+ }
+ }
+ }
+
+ /**
+ * Write the code for a new parameter with the given [type] and [name].
+ */
+ Future<DartChangeBuilder> addParameter(int offset, String prefix,
+ DartType type, String name, String suffix) async {
+ String targetFile = executable.source.fullName;
+ var changeBuilder = new DartChangeBuilder(session);
+ await changeBuilder.addFileEdit(targetFile, (builder) {
+ builder.addInsertion(offset, (builder) {
+ builder.write(prefix);
+ builder.writeParameter(name, type: type);
+ builder.write(suffix);
+ });
+ });
+ return changeBuilder;
+ }
+
+ /**
+ * Return the [FormalParameterList] of the [executable], or `null` is cannot
+ * be found.
+ */
+ Future<FormalParameterList> getParameterList() async {
+ var name = await astProvider.getParsedNameForElement(executable);
+ AstNode targetDeclaration = name?.parent;
+ if (targetDeclaration is FunctionDeclaration) {
+ FunctionExpression function = targetDeclaration.functionExpression;
+ return function.parameters;
+ } else if (targetDeclaration is MethodDeclaration) {
+ return targetDeclaration.parameters;
+ }
+ return null;
+ }
+
+ /**
+ * Return the [FormalParameter] of the [element] in [FormalParameterList],
+ * or `null` is cannot be found.
+ */
+ Future<FormalParameter> getParameterNode(ParameterElement element) async {
+ var name = await astProvider.getParsedNameForElement(element);
+ for (AstNode node = name; node != null; node = node.parent) {
+ if (node is FormalParameter && node.parent is FormalParameterList) {
+ return node;
+ }
+ }
+ return null;
+ }
+}
diff --git a/pkg/analysis_server/lib/src/services/correction/namespace.dart b/pkg/analysis_server/lib/src/services/correction/namespace.dart
index fc0d748..1419922 100644
--- a/pkg/analysis_server/lib/src/services/correction/namespace.dart
+++ b/pkg/analysis_server/lib/src/services/correction/namespace.dart
@@ -114,8 +114,7 @@
if (importElementsMap.containsKey(importElement)) {
continue;
}
- Namespace namespace =
- new NamespaceBuilder().createImportNamespaceForDirective(importElement);
+ Namespace namespace = importElement.namespace;
Set<Element> elements = new Set.from(namespace.definedNames.values);
importElementsMap[importElement] = elements;
}
diff --git a/pkg/analysis_server/lib/src/services/correction/util.dart b/pkg/analysis_server/lib/src/services/correction/util.dart
index 5281867..5878f8c 100644
--- a/pkg/analysis_server/lib/src/services/correction/util.dart
+++ b/pkg/analysis_server/lib/src/services/correction/util.dart
@@ -16,7 +16,6 @@
import 'package:analyzer/src/dart/scanner/reader.dart';
import 'package:analyzer/src/dart/scanner/scanner.dart';
import 'package:analyzer/src/generated/engine.dart';
-import 'package:analyzer/src/generated/resolver.dart';
import 'package:analyzer/src/generated/source.dart';
import 'package:analyzer_plugin/protocol/protocol_common.dart'
show SourceChange, SourceEdit;
@@ -342,9 +341,7 @@
* Returns the namespace of the given [ImportElement].
*/
Map<String, Element> getImportNamespace(ImportElement imp) {
- NamespaceBuilder builder = new NamespaceBuilder();
- Namespace namespace = builder.createImportNamespaceForDirective(imp);
- return namespace.definedNames;
+ return imp.namespace.definedNames;
}
/**
diff --git a/pkg/analysis_server/lib/src/services/refactoring/extract_widget.dart b/pkg/analysis_server/lib/src/services/refactoring/extract_widget.dart
index 9d52193..d304a1c 100644
--- a/pkg/analysis_server/lib/src/services/refactoring/extract_widget.dart
+++ b/pkg/analysis_server/lib/src/services/refactoring/extract_widget.dart
@@ -41,6 +41,7 @@
ClassElement classStatefulWidget;
ClassElement classStatelessWidget;
ClassElement classWidget;
+ PropertyAccessorElement accessorRequired;
@override
String name;
@@ -200,12 +201,22 @@
return element;
}
+ Future<PropertyAccessorElement> getAccessor(String uri, String name) async {
+ var element = await sessionHelper.getTopLevelPropertyAccessor(uri, name);
+ if (element == null) {
+ result.addFatalError("Unable to find 'required' in $uri");
+ }
+ return element;
+ }
+
classBuildContext = await getClass('BuildContext');
classKey = await getClass('Key');
classStatelessWidget = await getClass('StatelessWidget');
classStatefulWidget = await getClass('StatefulWidget');
classWidget = await getClass('Widget');
+ accessorRequired = await getAccessor('package:meta/meta.dart', 'required');
+
return result;
}
@@ -309,6 +320,38 @@
name,
superclass: classStatelessWidget.type,
membersWriter: () {
+ // Add the constructor.
+ builder.write(' ');
+ builder.writeConstructorDeclaration(
+ name,
+ isConst: true,
+ parameterWriter: () {
+ builder.writeln('{');
+
+ // Add the required `key` parameter.
+ builder.write(' ');
+ builder.writeParameter('key', type: classKey.type);
+ builder.writeln(',');
+
+ // Add parameters for fields, local, and method parameters.
+ for (int i = 0; i < _parameters.length; i++) {
+ builder.write(' ');
+ builder.write('@');
+ builder.writeReference(accessorRequired);
+ builder.write(' this.');
+ builder.write(_parameters[i].name);
+ builder.writeln(',');
+ }
+
+ builder.write(' }');
+ },
+ initializerWriter: () {
+ builder.write('super(key: key)');
+ },
+ );
+ builder.writeln();
+ builder.writeln();
+
// Add the fields for the parameters.
if (_parameters.isNotEmpty) {
for (var parameter in _parameters) {
@@ -320,32 +363,6 @@
builder.writeln();
}
- // Add the constructor.
- builder.write(' ');
- builder.writeConstructorDeclaration(
- name,
- parameterWriter: () {
- builder.write('{');
-
- // Add the required `key` parameter.
- builder.writeParameter('key', type: classKey.type);
-
- // Add parameters for fields, local, and method parameters.
- for (int i = 0; i < _parameters.length; i++) {
- builder.write(', ');
- builder.write('this.');
- builder.write(_parameters[i].name);
- }
-
- builder.write('}');
- },
- initializerWriter: () {
- builder.write('super(key: key)');
- },
- );
- builder.writeln();
- builder.writeln();
-
// Widget build(BuildContext context) { ... }
builder.writeln(' @override');
builder.write(' ');
diff --git a/pkg/analysis_server/lib/src/services/refactoring/naming_conventions.dart b/pkg/analysis_server/lib/src/services/refactoring/naming_conventions.dart
index 7691fbb..0e5e556 100644
--- a/pkg/analysis_server/lib/src/services/refactoring/naming_conventions.dart
+++ b/pkg/analysis_server/lib/src/services/refactoring/naming_conventions.dart
@@ -27,7 +27,7 @@
if (name != null && name.isEmpty) {
return new RefactoringStatus();
}
- return _validateLowerCamelCase(name, "Constructor");
+ return _validateLowerCamelCase(name, "Constructor", allowBuiltIn: true);
}
/**
@@ -37,7 +37,7 @@
* FATAL if the name is illegal.
*/
RefactoringStatus validateFieldName(String name) {
- return _validateLowerCamelCase(name, "Field");
+ return _validateLowerCamelCase(name, "Field", allowBuiltIn: true);
}
/**
@@ -47,7 +47,7 @@
* FATAL if the name is illegal.
*/
RefactoringStatus validateFunctionName(String name) {
- return _validateLowerCamelCase(name, "Function");
+ return _validateLowerCamelCase(name, "Function", allowBuiltIn: true);
}
/**
@@ -80,7 +80,7 @@
* FATAL if the name is illegal.
*/
RefactoringStatus validateLabelName(String name) {
- return _validateLowerCamelCase(name, "Label");
+ return _validateLowerCamelCase(name, "Label", allowBuiltIn: true);
}
/**
@@ -127,7 +127,7 @@
* FATAL if the name is illegal.
*/
RefactoringStatus validateMethodName(String name) {
- return _validateLowerCamelCase(name, "Method");
+ return _validateLowerCamelCase(name, "Method", allowBuiltIn: true);
}
/**
@@ -137,7 +137,7 @@
* FATAL if the name is illegal.
*/
RefactoringStatus validateParameterName(String name) {
- return _validateLowerCamelCase(name, "Parameter");
+ return _validateLowerCamelCase(name, "Parameter", allowBuiltIn: true);
}
/**
@@ -147,11 +147,12 @@
* FATAL if the name is illegal.
*/
RefactoringStatus validateVariableName(String name) {
- return _validateLowerCamelCase(name, "Variable");
+ return _validateLowerCamelCase(name, "Variable", allowBuiltIn: true);
}
RefactoringStatus _validateIdentifier(
- String identifier, String desc, String beginDesc) {
+ String identifier, String desc, String beginDesc,
+ {bool allowBuiltIn: false}) {
// has leading/trailing spaces
String trimmed = identifier.trim();
if (identifier != trimmed) {
@@ -168,8 +169,13 @@
{
Keyword keyword = Keyword.keywords[identifier];
if (keyword != null) {
- String message = "$desc must not be a keyword.";
- return new RefactoringStatus.fatal(message);
+ if (keyword.isBuiltInOrPseudo && allowBuiltIn) {
+ String message = "Avoid using built-in identifiers as names.";
+ return new RefactoringStatus.warning(message);
+ } else {
+ String message = "$desc must not be a keyword.";
+ return new RefactoringStatus.fatal(message);
+ }
}
}
// first character
@@ -198,7 +204,8 @@
/**
* Validates [identifier], should be lower camel case.
*/
-RefactoringStatus _validateLowerCamelCase(String identifier, String desc) {
+RefactoringStatus _validateLowerCamelCase(String identifier, String desc,
+ {bool allowBuiltIn: false}) {
desc += ' name';
// null
if (identifier == null) {
@@ -206,8 +213,9 @@
return new RefactoringStatus.fatal(message);
}
// is not identifier
- RefactoringStatus status =
- _validateIdentifier(identifier, desc, "a lowercase letter or underscore");
+ RefactoringStatus status = _validateIdentifier(
+ identifier, desc, "a lowercase letter or underscore",
+ allowBuiltIn: allowBuiltIn);
if (!status.isOK) {
return status;
}
diff --git a/pkg/analysis_server/test/abstract_context.dart b/pkg/analysis_server/test/abstract_context.dart
index dccf6a6..3ee2c09 100644
--- a/pkg/analysis_server/test/abstract_context.dart
+++ b/pkg/analysis_server/test/abstract_context.dart
@@ -61,6 +61,7 @@
bool get previewDart2 => driver.analysisOptions.previewDart2;
void addFlutterPackage() {
+ addMetaPackageSource();
Folder libFolder = configureFlutterPackage(resourceProvider);
packageMap['flutter'] = [libFolder];
}
@@ -68,12 +69,24 @@
Source addMetaPackageSource() => addPackageSource('meta', 'meta.dart', r'''
library meta;
+const _IsTest isTest = const _IsTest();
+
+const _IsTestGroup isTestGroup = const _IsTestGroup();
+
const Required required = const Required();
class Required {
final String reason;
const Required([this.reason]);
}
+
+class _IsTest {
+ const _IsTest();
+}
+
+class _IsTestGroup {
+ const _IsTestGroup();
+}
''');
Source addPackageSource(String packageName, String filePath, String content) {
diff --git a/pkg/analysis_server/test/analysis/notification_folding_test.dart b/pkg/analysis_server/test/analysis/notification_folding_test.dart
new file mode 100644
index 0000000..51a400b
--- /dev/null
+++ b/pkg/analysis_server/test/analysis/notification_folding_test.dart
@@ -0,0 +1,100 @@
+// 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:async';
+
+import 'package:analysis_server/protocol/protocol.dart';
+import 'package:analysis_server/protocol/protocol_constants.dart';
+import 'package:analysis_server/protocol/protocol_generated.dart';
+import 'package:analysis_server/src/protocol_server.dart';
+import 'package:test/test.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
+
+import '../analysis_abstract.dart';
+
+main() {
+ defineReflectiveSuite(() {
+ // TODO(dantup): Uncomment once implementation is complete.
+ // Cannot just mark the tests as @failingTest as they time out
+ // (no FOLDING notification ever) and failingTest doesn't seem
+ // to cover that.
+ // defineReflectiveTests(_AnalysisNotificationFoldingTest);
+ });
+}
+
+@reflectiveTest
+class _AnalysisNotificationFoldingTest extends AbstractAnalysisTest {
+ static const sampleCode = '''
+import 'dart:async';
+import 'dart:core';
+
+main async() {}
+''';
+
+ static final expectedResults = [
+ new FoldingRegion(FoldingKind.DIRECTIVES, 0, 40)
+ ];
+
+ List<FoldingRegion> lastRegions;
+
+ Completer _regionsReceived;
+
+ void processNotification(Notification notification) {
+ if (notification.event == ANALYSIS_NOTIFICATION_FOLDING) {
+ var params = new AnalysisFoldingParams.fromNotification(notification);
+ if (params.file == testFile) {
+ lastRegions = params.regions;
+ _regionsReceived.complete(null);
+ }
+ } else if (notification.event == SERVER_NOTIFICATION_ERROR) {
+ var params = new ServerErrorParams.fromNotification(notification);
+ throw "${params.message}\n${params.stackTrace}";
+ }
+ }
+
+ @override
+ void setUp() {
+ super.setUp();
+ createProject();
+ }
+
+ void subscribeForFolding() {
+ addAnalysisSubscription(AnalysisService.FOLDING, testFile);
+ }
+
+ test_afterAnalysis() async {
+ addTestFile(sampleCode);
+ await waitForTasksFinished();
+ expect(lastRegions, isNull);
+
+ await waitForFolding(() => subscribeForFolding());
+
+ expect(lastRegions, expectedResults);
+ }
+
+ test_afterUpdate() async {
+ addTestFile('');
+ // Currently required to get notifications on updates
+ setPriorityFiles([testFile]);
+
+ // Before subscribing, we shouldn't have had any folding regions.
+ await waitForTasksFinished();
+ expect(lastRegions, isNull);
+
+ // With no content, there should be zero regions.
+ await waitForFolding(() => subscribeForFolding());
+ expect(lastRegions, hasLength(0));
+
+ // With sample code there will be folding regions.
+ await waitForFolding(() => modifyTestFile(sampleCode));
+
+ expect(lastRegions, expectedResults);
+ }
+
+ Future waitForFolding(action()) {
+ _regionsReceived = new Completer();
+ action();
+ return _regionsReceived.future;
+ }
+}
diff --git a/pkg/analysis_server/test/analysis/notification_overrides_test.dart b/pkg/analysis_server/test/analysis/notification_overrides_test.dart
index 774062e..5acb1d5 100644
--- a/pkg/analysis_server/test/analysis/notification_overrides_test.dart
+++ b/pkg/analysis_server/test/analysis/notification_overrides_test.dart
@@ -405,6 +405,55 @@
expect(override.interfaceMembers, isNull);
}
+ test_mixin_method_direct() async {
+ addTestFile('''
+class A {
+ m() {} // in A
+}
+class B extends Object with A {
+ m() {} // in B
+}
+''');
+ await prepareOverrides();
+ assertHasOverride('m() {} // in B');
+ assertHasSuperElement('m() {} // in A');
+ assertNoInterfaceMembers();
+ }
+
+ test_mixin_method_indirect() async {
+ addTestFile('''
+class A {
+ m() {} // in A
+}
+class B extends A {
+}
+class C extends Object with B {
+ m() {} // in C
+}
+''');
+ await prepareOverrides();
+ assertHasOverride('m() {} // in C');
+ assertHasSuperElement('m() {} // in A');
+ assertNoInterfaceMembers();
+ }
+
+ test_mixin_method_indirect2() async {
+ addTestFile('''
+class A {
+ m() {} // in A
+}
+class B extends Object with A {
+}
+class C extends B {
+ m() {} // in C
+}
+''');
+ await prepareOverrides();
+ assertHasOverride('m() {} // in C');
+ assertHasSuperElement('m() {} // in A');
+ assertNoInterfaceMembers();
+ }
+
test_staticMembers() async {
addTestFile('''
class A {
diff --git a/pkg/analysis_server/test/analysis/test_all.dart b/pkg/analysis_server/test/analysis/test_all.dart
index 76e1f5b..fa72b86 100644
--- a/pkg/analysis_server/test/analysis/test_all.dart
+++ b/pkg/analysis_server/test/analysis/test_all.dart
@@ -13,6 +13,7 @@
as notification_analyzedFiles_test;
import 'notification_closingLabels_test.dart'
as notification_closingLabels_test;
+import 'notification_folding_test.dart' as notification_folding_test;
import 'notification_errors_test.dart' as notification_errors_test;
import 'notification_highlights_test.dart' as notification_highlights_test;
import 'notification_highlights_test2.dart' as notification_highlights_test2;
@@ -36,6 +37,7 @@
notification_analysis_options_test.main();
notification_analyzedFiles_test.main();
notification_closingLabels_test.main();
+ notification_folding_test.main();
notification_errors_test.main();
notification_highlights_test.main();
notification_highlights_test2.main();
diff --git a/pkg/analysis_server/test/completion_test.dart b/pkg/analysis_server/test/completion_test.dart
index 4a2270c..1e1aec8 100644
--- a/pkg/analysis_server/test/completion_test.dart
+++ b/pkg/analysis_server/test/completion_test.dart
@@ -1606,25 +1606,17 @@
extraFiles: sources,
failingTests: '1');
- buildTests(
- 'test_importPrefix_hideCombinator',
- '''
+ buildTests('test_importPrefix_hideCombinator', '''
import 'dart:math' as math hide PI;
main() {
math.!1
-}''',
- <String>["1-PI", "1+LN10"],
- failingTests: '1');
+}''', <String>["1-PI", "1+LN10"]);
- buildTests(
- 'test_importPrefix_showCombinator',
- '''
+ buildTests('test_importPrefix_showCombinator', '''
import 'dart:math' as math show PI;
main() {
math.!1
-}''',
- <String>["1+PI", "1-LN10"],
- failingTests: '1');
+}''', <String>["1+PI", "1-LN10"]);
sources.clear();
sources["/lib.dart"] = '''
diff --git a/pkg/analysis_server/test/services/completion/dart/combinator_contributor_test.dart b/pkg/analysis_server/test/services/completion/dart/combinator_contributor_test.dart
index 2aa2825..ac4c454 100644
--- a/pkg/analysis_server/test/services/completion/dart/combinator_contributor_test.dart
+++ b/pkg/analysis_server/test/services/completion/dart/combinator_contributor_test.dart
@@ -123,6 +123,24 @@
assertNotSuggested('Object');
}
+ test_Combinator_show_export_withShow() async {
+ addSource('/a.dart', r'''
+class A {}
+class B {}
+''');
+ addSource('/b.dart', r'''
+export 'a.dart' show A;
+''');
+ addTestSource(r'''
+import 'b.dart' show ^;
+''');
+ await computeSuggestions();
+ assertSuggestClass('A',
+ relevance: DART_RELEVANCE_DEFAULT,
+ kind: CompletionSuggestionKind.IDENTIFIER);
+ assertNotSuggested('B');
+ }
+
test_Combinator_show_PI() async {
addTestSource('import "dart:math" show ^;');
await computeSuggestions();
diff --git a/pkg/analysis_server/test/services/completion/dart/library_member_contributor_test.dart b/pkg/analysis_server/test/services/completion/dart/library_member_contributor_test.dart
index 9679580..3f3f9fc 100644
--- a/pkg/analysis_server/test/services/completion/dart/library_member_contributor_test.dart
+++ b/pkg/analysis_server/test/services/completion/dart/library_member_contributor_test.dart
@@ -142,6 +142,41 @@
assertNotSuggested('==');
}
+ test_PrefixedIdentifier_library_export_withShow() async {
+ addSource('/a.dart', r'''
+class A {}
+class B {}
+''');
+ addSource('/b.dart', r'''
+export 'a.dart' show A;
+''');
+ addTestSource(r'''
+import 'b.dart' as p;
+main() {
+ p.^
+}
+''');
+ await computeSuggestions();
+ assertSuggestClass('A');
+ assertNotSuggested('B');
+ }
+
+ test_PrefixedIdentifier_library_import_withShow() async {
+ addSource('/a.dart', r'''
+class A {}
+class B {}
+''');
+ addTestSource(r'''
+import 'a.dart' as p show A;
+main() {
+ p.^
+}
+''');
+ await computeSuggestions();
+ assertSuggestClass('A');
+ assertNotSuggested('B');
+ }
+
test_PrefixedIdentifier_library_inPart() async {
// SimpleIdentifier PrefixedIdentifier ExpressionStatement
var libFile = '${testFile.substring(0, testFile.length - 5)}A.dart';
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 c3ddced..07a231e 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
@@ -1235,6 +1235,27 @@
(s) => _after(s, ' '));
}
+ test_withCondition_noRightParenthesis() async {
+ await _prepareCompletion(
+ 'if (true',
+ '''
+main() {
+ if (true
+}
+''',
+ atEnd: true);
+ _assertHasChange(
+ 'Complete if-statement',
+ '''
+main() {
+ if (true) {
+ ////
+ }
+}
+''',
+ (s) => _after(s, ' '));
+ }
+
test_withElse() async {
await _prepareCompletion(
'else',
diff --git a/pkg/analysis_server/test/services/correction/assist_test.dart b/pkg/analysis_server/test/services/correction/assist_test.dart
index 72e36b6..0cc4f57 100644
--- a/pkg/analysis_server/test/services/correction/assist_test.dart
+++ b/pkg/analysis_server/test/services/correction/assist_test.dart
@@ -3880,7 +3880,7 @@
main() {
var obj;
// start
- return new Row(children: [/*caret*/ new Transform()]);
+ return new Row(children: [/*caret*/ new Container()]);
// end
}
}
@@ -3898,9 +3898,9 @@
child: new Row(
// start
children: [/*caret*/
- new Transform(),
- new Transform(),
- new AspectRatio(),
+ new Text('111'),
+ new Text('222'),
+ new Container(),
],
// end
),
@@ -3917,9 +3917,9 @@
children: [
new widget(
children: [/*caret*/
- new Transform(),
- new Transform(),
- new AspectRatio(),
+ new Text('111'),
+ new Text('222'),
+ new Container(),
],
),
],
diff --git a/pkg/analysis_server/test/services/correction/fix_test.dart b/pkg/analysis_server/test/services/correction/fix_test.dart
index 426ff09..0f0bb9c 100644
--- a/pkg/analysis_server/test/services/correction/fix_test.dart
+++ b/pkg/analysis_server/test/services/correction/fix_test.dart
@@ -825,6 +825,120 @@
''');
}
+ test_addMissingParameterNamed_function_hasNamed() async {
+ await resolveTestUnit('''
+test(int a, {int b: 0}) {}
+
+main() {
+ test(1, b: 2, named: 3.0);
+}
+''');
+ await assertHasFix(DartFixKind.ADD_MISSING_PARAMETER_NAMED, '''
+test(int a, {int b: 0, double named}) {}
+
+main() {
+ test(1, b: 2, named: 3.0);
+}
+''');
+ }
+
+ test_addMissingParameterNamed_function_hasRequired() async {
+ await resolveTestUnit('''
+test(int a) {}
+
+main() {
+ test(1, named: 2.0);
+}
+''');
+ await assertHasFix(DartFixKind.ADD_MISSING_PARAMETER_NAMED, '''
+test(int a, {double named}) {}
+
+main() {
+ test(1, named: 2.0);
+}
+''');
+ }
+
+ test_addMissingParameterNamed_function_noParameters() async {
+ await resolveTestUnit('''
+test() {}
+
+main() {
+ test(named: 42);
+}
+''');
+ await assertHasFix(DartFixKind.ADD_MISSING_PARAMETER_NAMED, '''
+test({int named}) {}
+
+main() {
+ test(named: 42);
+}
+''');
+ }
+
+ test_addMissingParameterNamed_method_hasNamed() async {
+ await resolveTestUnit('''
+class A {
+ test(int a, {int b: 0}) {}
+
+ main() {
+ test(1, b: 2, named: 3.0);
+ }
+}
+''');
+ await assertHasFix(DartFixKind.ADD_MISSING_PARAMETER_NAMED, '''
+class A {
+ test(int a, {int b: 0, double named}) {}
+
+ main() {
+ test(1, b: 2, named: 3.0);
+ }
+}
+''');
+ }
+
+ test_addMissingParameterNamed_method_hasRequired() async {
+ await resolveTestUnit('''
+class A {
+ test(int a) {}
+
+ main() {
+ test(1, named: 2.0);
+ }
+}
+''');
+ await assertHasFix(DartFixKind.ADD_MISSING_PARAMETER_NAMED, '''
+class A {
+ test(int a, {double named}) {}
+
+ main() {
+ test(1, named: 2.0);
+ }
+}
+''');
+ }
+
+ test_addMissingParameterNamed_method_noParameters() async {
+ await resolveTestUnit('''
+class A {
+ test() {}
+
+ main() {
+ test(named: 42);
+ }
+}
+''');
+ await assertHasFix(DartFixKind.ADD_MISSING_PARAMETER_NAMED, '''
+class A {
+ test({int named}) {}
+
+ main() {
+ test(named: 42);
+ }
+}
+''');
+ }
+
test_addMissingRequiredArg_cons_flutter_children() async {
addFlutterPackage();
_addMetaPackageSource();
@@ -4139,6 +4253,27 @@
''');
}
+ test_importLibraryProject_withClass_instanceCreation_const_namedConstructor() async {
+ testFile = '/project/lib/test.dart';
+ addSource('/project/lib/lib.dart', '''
+class Test {
+ const Test.named();
+}
+''');
+ await resolveTestUnit('''
+main() {
+ const Test.named();
+}
+''');
+ await assertHasFix(DartFixKind.IMPORT_LIBRARY_PROJECT1, '''
+import 'lib.dart';
+
+main() {
+ const Test.named();
+}
+''');
+ }
+
test_importLibraryProject_withClass_instanceCreation_implicit() async {
testFile = '/project/lib/test.dart';
addSource('/project/lib/lib.dart', '''
@@ -4181,6 +4316,27 @@
''');
}
+ test_importLibraryProject_withClass_instanceCreation_new_namedConstructor() async {
+ testFile = '/project/lib/test.dart';
+ addSource('/project/lib/lib.dart', '''
+class Test {
+ Test.named();
+}
+''');
+ await resolveTestUnit('''
+main() {
+ new Test.named();
+}
+''');
+ await assertHasFix(DartFixKind.IMPORT_LIBRARY_PROJECT1, '''
+import 'lib.dart';
+
+main() {
+ new Test.named();
+}
+''');
+ }
+
test_importLibraryProject_withFunction() async {
testFile = '/project/lib/test.dart';
addSource('/project/lib/lib.dart', '''
@@ -5893,9 +6049,8 @@
return new Container(
child: new Row(
child: <Widget>[
- new Transform(),
+ new Container(),
null,
- new AspectRatio(),
],
),
);
@@ -5912,9 +6067,8 @@
return new Container(
child: new Row(
child: [
- new Transform(),
- new ClipRect.rect(),
- new AspectRatio(),
+ new Text('111'),
+ new Text('222'),
],
),
);
@@ -5926,9 +6080,8 @@
return new Container(
child: new Row(
children: <Widget>[
- new Transform(),
- new ClipRect.rect(),
- new AspectRatio(),
+ new Text('111'),
+ new Text('222'),
],
),
);
@@ -5944,9 +6097,8 @@
return new Container(
child: new Row(
child: <Widget>[
- new Transform(),
- new ClipRect.rect(),
- new AspectRatio(),
+ new Text('111'),
+ new Text('222'),
],
),
);
@@ -5958,9 +6110,8 @@
return new Container(
child: new Row(
children: <Widget>[
- new Transform(),
- new ClipRect.rect(),
- new AspectRatio(),
+ new Text('111'),
+ new Text('222'),
],
),
);
@@ -6493,6 +6644,23 @@
''');
}
+ test_makeFieldFinal_noKeyword() async {
+ String src = '''
+class C {
+ /*LINT*/f = 2;
+}
+''';
+ await findLint(src, LintNames.prefer_final_fields);
+
+ await applyFix(DartFixKind.MAKE_FINAL);
+
+ verifyResult('''
+class C {
+ final f = 2;
+}
+''');
+ }
+
test_makeFieldFinal_type() async {
String src = '''
class C {
diff --git a/pkg/analysis_server/test/services/refactoring/extract_widget_test.dart b/pkg/analysis_server/test/services/refactoring/extract_widget_test.dart
index 4e8323b..d007bc6 100644
--- a/pkg/analysis_server/test/services/refactoring/extract_widget_test.dart
+++ b/pkg/analysis_server/test/services/refactoring/extract_widget_test.dart
@@ -130,7 +130,9 @@
}
class Test extends StatelessWidget {
- Test({Key key}) : super(key: key);
+ const Test({
+ Key key,
+ }) : super(key: key);
@override
Widget build(BuildContext context) {
@@ -180,7 +182,9 @@
}
class Test extends StatelessWidget {
- Test({Key key}) : super(key: key);
+ const Test({
+ Key key,
+ }) : super(key: key);
@override
Widget build(BuildContext context) {
@@ -215,7 +219,9 @@
}
class Test extends StatelessWidget {
- Test({Key key}) : super(key: key);
+ const Test({
+ Key key,
+ }) : super(key: key);
@override
Widget build(BuildContext context) {
@@ -254,7 +260,9 @@
}
class Test extends StatelessWidget {
- Test({Key key}) : super(key: key);
+ const Test({
+ Key key,
+ }) : super(key: key);
@override
Widget build(BuildContext context) {
@@ -358,9 +366,12 @@
}
class Test extends StatelessWidget {
- final C c;
+ const Test({
+ Key key,
+ @required this.c,
+ }) : super(key: key);
- Test({Key key, this.c}) : super(key: key);
+ final C c;
@override
Widget build(BuildContext context) {
@@ -408,7 +419,9 @@
}
class Test extends StatelessWidget {
- Test({Key key}) : super(key: key);
+ const Test({
+ Key key,
+ }) : super(key: key);
@override
Widget build(BuildContext context) {
@@ -471,12 +484,17 @@
}
class Test extends StatelessWidget {
+ const Test({
+ Key key,
+ @required this.foo,
+ @required this.p1,
+ @required this.p2,
+ }) : super(key: key);
+
final String foo;
final String p1;
final int p2;
- Test({Key key, this.foo, this.p1, this.p2}) : super(key: key);
-
@override
Widget build(BuildContext context) {
var a = new Text('$foo $p1');
@@ -538,12 +556,17 @@
}
class Test extends StatelessWidget {
+ const Test({
+ Key key,
+ @required this.foo,
+ @required this.p1,
+ @required this.p2,
+ }) : super(key: key);
+
final String foo;
final String p1;
final int p2;
- Test({Key key, this.foo, this.p1, this.p2}) : super(key: key);
-
@override
Widget build(BuildContext context) {
var a = new Text('$foo $p1');
@@ -585,9 +608,12 @@
}
class Test extends StatelessWidget {
- final String field;
+ const Test({
+ Key key,
+ @required this.field,
+ }) : super(key: key);
- Test({Key key, this.field}) : super(key: key);
+ final String field;
@override
Widget build(BuildContext context) {
@@ -634,9 +660,12 @@
}
class Test extends StatelessWidget {
- final C c;
+ const Test({
+ Key key,
+ @required this.c,
+ }) : super(key: key);
- Test({Key key, this.c}) : super(key: key);
+ final C c;
@override
Widget build(BuildContext context) {
@@ -675,7 +704,9 @@
}
class Test extends StatelessWidget {
- Test({Key key}) : super(key: key);
+ const Test({
+ Key key,
+ }) : super(key: key);
@override
Widget build(BuildContext context) {
@@ -779,9 +810,12 @@
}
class Test extends StatelessWidget {
- final C c;
+ const Test({
+ Key key,
+ @required this.c,
+ }) : super(key: key);
- Test({Key key, this.c}) : super(key: key);
+ final C c;
@override
Widget build(BuildContext context) {
@@ -842,9 +876,12 @@
}
class Test extends StatelessWidget {
- final String local;
+ const Test({
+ Key key,
+ @required this.local,
+ }) : super(key: key);
- Test({Key key, this.local}) : super(key: key);
+ final String local;
@override
Widget build(BuildContext context) {
@@ -914,11 +951,15 @@
}
class Test extends StatelessWidget {
+ const Test({
+ Key key,
+ @required this.field,
+ @required this.local,
+ }) : super(key: key);
+
final String field;
final String local;
- Test({Key key, this.field, this.local}) : super(key: key);
-
@override
Widget build(BuildContext context) {
return new Column(
diff --git a/pkg/analysis_server/test/services/refactoring/naming_conventions_test.dart b/pkg/analysis_server/test/services/refactoring/naming_conventions_test.dart
index 736448b..fb78873 100644
--- a/pkg/analysis_server/test/services/refactoring/naming_conventions_test.dart
+++ b/pkg/analysis_server/test/services/refactoring/naming_conventions_test.dart
@@ -2,6 +2,7 @@
// 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:analysis_server/src/services/correction/status.dart';
import 'package:analysis_server/src/services/refactoring/naming_conventions.dart';
import 'package:analysis_server/src/services/refactoring/refactoring.dart';
import 'package:analyzer_plugin/protocol/protocol_common.dart'
@@ -144,6 +145,12 @@
expectedMessage: "Field name must not be empty.");
}
+ void test_validateFieldName_keyword() {
+ assertRefactoringStatus(
+ validateFieldName("for"), RefactoringProblemSeverity.FATAL,
+ expectedMessage: "Field name must not be a keyword.");
+ }
+
void test_validateFieldName_leadingBlanks() {
assertRefactoringStatus(
validateFieldName(" newName"), RefactoringProblemSeverity.FATAL,
@@ -163,18 +170,6 @@
"Field name must begin with a lowercase letter or underscore.");
}
- void test_validateFieldName_notKeyword() {
- assertRefactoringStatus(
- validateFieldName("for"), RefactoringProblemSeverity.FATAL,
- expectedMessage: "Field name must not be a keyword.");
- }
-
- void test_validateFieldName_notPseudoKeyword() {
- assertRefactoringStatus(
- validateFieldName("await"), RefactoringProblemSeverity.FATAL,
- expectedMessage: "Field name must not be a keyword.");
- }
-
void test_validateFieldName_null() {
assertRefactoringStatus(
validateFieldName(null), RefactoringProblemSeverity.FATAL,
@@ -193,6 +188,10 @@
assertRefactoringStatusOK(validateFieldName("new_name"));
}
+ void test_validateFieldName_pseudoKeyword() {
+ _assertWarningBuiltIn(validateFieldName("await"));
+ }
+
void test_validateFieldName_trailingBlanks() {
assertRefactoringStatus(
validateFieldName("newName "), RefactoringProblemSeverity.FATAL,
@@ -211,6 +210,12 @@
expectedMessage: "Function name must not be empty.");
}
+ void test_validateFunctionName_keyword() {
+ assertRefactoringStatus(
+ validateFunctionName("new"), RefactoringProblemSeverity.FATAL,
+ expectedMessage: "Function name must not be a keyword.");
+ }
+
void test_validateFunctionName_leadingBlanks() {
assertRefactoringStatus(
validateFunctionName(" newName"), RefactoringProblemSeverity.FATAL,
@@ -230,18 +235,6 @@
"Function name must begin with a lowercase letter or underscore.");
}
- void test_validateFunctionName_notKeyword() {
- assertRefactoringStatus(
- validateFunctionName("new"), RefactoringProblemSeverity.FATAL,
- expectedMessage: "Function name must not be a keyword.");
- }
-
- void test_validateFunctionName_notPseudoKeyword() {
- assertRefactoringStatus(
- validateFunctionName("yield"), RefactoringProblemSeverity.FATAL,
- expectedMessage: "Function name must not be a keyword.");
- }
-
void test_validateFunctionName_null() {
assertRefactoringStatus(
validateFunctionName(null), RefactoringProblemSeverity.FATAL,
@@ -260,6 +253,10 @@
assertRefactoringStatusOK(validateFunctionName("new_name"));
}
+ void test_validateFunctionName_pseudoKeyword() {
+ _assertWarningBuiltIn(validateFunctionName("yield"));
+ }
+
void test_validateFunctionName_trailingBlanks() {
assertRefactoringStatus(
validateFunctionName("newName "), RefactoringProblemSeverity.FATAL,
@@ -339,6 +336,12 @@
assertRefactoringStatusOK(validateImportPrefixName(""));
}
+ void test_validateImportPrefixName_keyword() {
+ assertRefactoringStatus(
+ validateImportPrefixName("while"), RefactoringProblemSeverity.FATAL,
+ expectedMessage: "Import prefix name must not be a keyword.");
+ }
+
void test_validateImportPrefixName_leadingBlanks() {
assertRefactoringStatus(
validateImportPrefixName(" newName"), RefactoringProblemSeverity.FATAL,
@@ -359,18 +362,6 @@
"Import prefix name must begin with a lowercase letter or underscore.");
}
- void test_validateImportPrefixName_notKeyword() {
- assertRefactoringStatus(
- validateImportPrefixName("while"), RefactoringProblemSeverity.FATAL,
- expectedMessage: "Import prefix name must not be a keyword.");
- }
-
- void test_validateImportPrefixName_notPseudoKeyword() {
- assertRefactoringStatus(
- validateImportPrefixName("await"), RefactoringProblemSeverity.FATAL,
- expectedMessage: "Import prefix name must not be a keyword.");
- }
-
void test_validateImportPrefixName_null() {
assertRefactoringStatus(
validateImportPrefixName(null), RefactoringProblemSeverity.FATAL,
@@ -389,6 +380,12 @@
assertRefactoringStatusOK(validateImportPrefixName("new_name"));
}
+ void test_validateImportPrefixName_pseudoKeyword() {
+ assertRefactoringStatus(
+ validateImportPrefixName("await"), RefactoringProblemSeverity.FATAL,
+ expectedMessage: "Import prefix name must not be a keyword.");
+ }
+
void test_validateImportPrefixName_trailingBlanks() {
assertRefactoringStatus(
validateImportPrefixName("newName "), RefactoringProblemSeverity.FATAL,
@@ -408,6 +405,12 @@
expectedMessage: "Label name must not be empty.");
}
+ void test_validateLabelName_keyword() {
+ assertRefactoringStatus(
+ validateLabelName("for"), RefactoringProblemSeverity.FATAL,
+ expectedMessage: "Label name must not be a keyword.");
+ }
+
void test_validateLabelName_leadingBlanks() {
assertRefactoringStatus(
validateLabelName(" newName"), RefactoringProblemSeverity.FATAL,
@@ -427,18 +430,6 @@
"Label name must begin with a lowercase letter or underscore.");
}
- void test_validateLabelName_notKeyword() {
- assertRefactoringStatus(
- validateLabelName("for"), RefactoringProblemSeverity.FATAL,
- expectedMessage: "Label name must not be a keyword.");
- }
-
- void test_validateLabelName_notPseudoKeyword() {
- assertRefactoringStatus(
- validateLabelName("await"), RefactoringProblemSeverity.FATAL,
- expectedMessage: "Label name must not be a keyword.");
- }
-
void test_validateLabelName_null() {
assertRefactoringStatus(
validateLabelName(null), RefactoringProblemSeverity.FATAL,
@@ -461,6 +452,10 @@
assertRefactoringStatusOK(validateLabelName("new_name"));
}
+ void test_validateLabelName_pseudoKeyword() {
+ _assertWarningBuiltIn(validateLabelName("await"));
+ }
+
void test_validateLabelName_trailingBlanks() {
assertRefactoringStatus(
validateLabelName("newName "), RefactoringProblemSeverity.FATAL,
@@ -493,6 +488,12 @@
"Library name should consist of lowercase identifier separated by dots.");
}
+ void test_validateLibraryName_keyword() {
+ assertRefactoringStatus(
+ validateLibraryName("my.for.name"), RefactoringProblemSeverity.FATAL,
+ expectedMessage: "Library name identifier must not be a keyword.");
+ }
+
void test_validateLibraryName_leadingBlanks() {
assertRefactoringStatus(
validateLibraryName("my. name"), RefactoringProblemSeverity.FATAL,
@@ -513,12 +514,6 @@
"Library name identifier must begin with a lowercase letter or underscore.");
}
- void test_validateLibraryName_notKeyword() {
- assertRefactoringStatus(
- validateLibraryName("my.yield.name"), RefactoringProblemSeverity.FATAL,
- expectedMessage: "Library name identifier must not be a keyword.");
- }
-
void test_validateLibraryName_null() {
assertRefactoringStatus(
validateLibraryName(null), RefactoringProblemSeverity.FATAL,
@@ -577,18 +572,6 @@
"Method name must begin with a lowercase letter or underscore.");
}
- void test_validateMethodName_notKeyword() {
- assertRefactoringStatus(
- validateMethodName("do"), RefactoringProblemSeverity.FATAL,
- expectedMessage: "Method name must not be a keyword.");
- }
-
- void test_validateMethodName_notPseudoKeyword() {
- assertRefactoringStatus(
- validateMethodName("yield"), RefactoringProblemSeverity.FATAL,
- expectedMessage: "Method name must not be a keyword.");
- }
-
void test_validateMethodName_null() {
assertRefactoringStatus(
validateMethodName(null), RefactoringProblemSeverity.FATAL,
@@ -607,12 +590,20 @@
assertRefactoringStatusOK(validateMethodName("new_name"));
}
+ void test_validateMethodName_pseudoKeyword() {
+ _assertWarningBuiltIn(validateMethodName("yield"));
+ }
+
void test_validateMethodName_trailingBlanks() {
assertRefactoringStatus(
validateMethodName("newName "), RefactoringProblemSeverity.FATAL,
expectedMessage: "Method name must not start or end with a blank.");
}
+ void test_validateParameterName_builtIn() {
+ _assertWarningBuiltIn(validateParameterName("await"));
+ }
+
void test_validateParameterName_doesNotStartWithLowerCase() {
assertRefactoringStatus(
validateParameterName("NewName"), RefactoringProblemSeverity.WARNING,
@@ -626,6 +617,12 @@
expectedMessage: "Parameter name must not be empty.");
}
+ void test_validateParameterName_keyword() {
+ assertRefactoringStatus(
+ validateParameterName("while"), RefactoringProblemSeverity.FATAL,
+ expectedMessage: "Parameter name must not be a keyword.");
+ }
+
void test_validateParameterName_leadingBlanks() {
assertRefactoringStatus(
validateParameterName(" newName"), RefactoringProblemSeverity.FATAL,
@@ -645,18 +642,6 @@
"Parameter name must begin with a lowercase letter or underscore.");
}
- void test_validateParameterName_notKeyword() {
- assertRefactoringStatus(
- validateParameterName("while"), RefactoringProblemSeverity.FATAL,
- expectedMessage: "Parameter name must not be a keyword.");
- }
-
- void test_validateParameterName_notPseudoKeyword() {
- assertRefactoringStatus(
- validateParameterName("await"), RefactoringProblemSeverity.FATAL,
- expectedMessage: "Parameter name must not be a keyword.");
- }
-
void test_validateParameterName_null() {
assertRefactoringStatus(
validateParameterName(null), RefactoringProblemSeverity.FATAL,
@@ -675,12 +660,20 @@
assertRefactoringStatusOK(validateParameterName("new_name"));
}
+ void test_validateParameterName_pseudoKeyword() {
+ _assertWarningBuiltIn(validateParameterName("await"));
+ }
+
void test_validateParameterName_trailingBlanks() {
assertRefactoringStatus(
validateParameterName("newName "), RefactoringProblemSeverity.FATAL,
expectedMessage: "Parameter name must not start or end with a blank.");
}
+ void test_validateVariableName_builtIn() {
+ _assertWarningBuiltIn(validateVariableName('abstract'));
+ }
+
void test_validateVariableName_doesNotStartWithLowerCase() {
assertRefactoringStatus(
validateVariableName("NewName"), RefactoringProblemSeverity.WARNING,
@@ -693,6 +686,12 @@
expectedMessage: "Variable name must not be empty.");
}
+ void test_validateVariableName_keyword() {
+ assertRefactoringStatus(
+ validateVariableName("for"), RefactoringProblemSeverity.FATAL,
+ expectedMessage: "Variable name must not be a keyword.");
+ }
+
void test_validateVariableName_leadingBlanks() {
assertRefactoringStatus(
validateVariableName(" newName"), RefactoringProblemSeverity.FATAL,
@@ -712,18 +711,6 @@
"Variable name must begin with a lowercase letter or underscore.");
}
- void test_validateVariableName_notKeyword() {
- assertRefactoringStatus(
- validateVariableName("for"), RefactoringProblemSeverity.FATAL,
- expectedMessage: "Variable name must not be a keyword.");
- }
-
- void test_validateVariableName_notPseudoKeyword() {
- assertRefactoringStatus(
- validateVariableName("await"), RefactoringProblemSeverity.FATAL,
- expectedMessage: "Variable name must not be a keyword.");
- }
-
void test_validateVariableName_null() {
assertRefactoringStatus(
validateVariableName(null), RefactoringProblemSeverity.FATAL,
@@ -746,9 +733,18 @@
assertRefactoringStatusOK(validateVariableName("new_name"));
}
+ void test_validateVariableName_pseudoKeyword() {
+ _assertWarningBuiltIn(validateVariableName("await"));
+ }
+
void test_validateVariableName_trailingBlanks() {
assertRefactoringStatus(
validateVariableName("newName "), RefactoringProblemSeverity.FATAL,
expectedMessage: "Variable name must not start or end with a blank.");
}
+
+ void _assertWarningBuiltIn(RefactoringStatus status) {
+ assertRefactoringStatus(status, RefactoringProblemSeverity.WARNING,
+ expectedMessage: 'Avoid using built-in identifiers as names.');
+ }
}
diff --git a/pkg/analysis_server/test/src/computer/folding_computer_test.dart b/pkg/analysis_server/test/src/computer/folding_computer_test.dart
new file mode 100644
index 0000000..c9d00a1
--- /dev/null
+++ b/pkg/analysis_server/test/src/computer/folding_computer_test.dart
@@ -0,0 +1,96 @@
+// 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:async';
+
+import 'package:analysis_server/src/computer/computer_folding.dart';
+import 'package:analysis_server/src/protocol_server.dart';
+import 'package:analyzer/dart/analysis/results.dart';
+import 'package:test/test.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
+
+import '../../abstract_context.dart';
+
+main() {
+ defineReflectiveSuite(() {
+ defineReflectiveTests(FoldingComputerTest);
+ });
+}
+
+@reflectiveTest
+class FoldingComputerTest extends AbstractContextTest {
+ String sourcePath;
+
+ setUp() {
+ super.setUp();
+ sourcePath = resourceProvider.convertPath('/p/lib/source.dart');
+ }
+
+ test_single_import_directives() async {
+ String content = """
+import 'dart:async';
+
+main() {}
+""";
+
+ // Since there are no region comment markers above
+ final regions = await _computeRegions(content);
+ expect(regions, hasLength(0));
+ }
+
+ test_multiple_import_directives() async {
+ String content = """
+/*1*/import 'dart:async';
+
+// We can have comments
+import 'package:a/b.dart';
+import 'package:b/c.dart';
+
+import '../a.dart';/*1:DIRECTIVES*/
+
+main() {}
+""";
+
+ final regions = await _computeRegions(content);
+ _compareRegions(regions, content);
+ }
+
+ /// Compares provided folding regions with expected
+ /// regions extracted from the comments in the provided content.
+ void _compareRegions(List<FoldingRegion> regions, String content) {
+ // Find all numeric markers for region starts.
+ final regex = new RegExp(r'/\*(\d+)\*/');
+ final expectedRegions = regex.allMatches(content);
+
+ // Check we didn't get more than expected, since the loop below only
+ // checks for the presence of matches, not absence.
+ expect(regions, hasLength(expectedRegions.length));
+
+ // Go through each marker, find the expected region start/end and
+ // ensure it's in the results.
+ expectedRegions.forEach((m) {
+ final i = m.group(1);
+ // Find the end marker.
+ final endMatch = new RegExp('/\\*$i:(.+?)\\*/').firstMatch(content);
+
+ final expectedStart = m.end;
+ final expectedLength = endMatch.start - expectedStart;
+ final expectedKindString = endMatch.group(1);
+ final expectedKind = FoldingKind.VALUES
+ .firstWhere((f) => f.toString() == 'FoldingKind.$expectedKindString');
+
+ expect(
+ regions,
+ contains(
+ new FoldingRegion(expectedKind, expectedStart, expectedLength)));
+ });
+ }
+
+ Future<List<FoldingRegion>> _computeRegions(String sourceContent) async {
+ newFile(sourcePath, content: sourceContent);
+ ResolveResult result = await driver.getResult(sourcePath);
+ DartUnitFoldingComputer computer = new DartUnitFoldingComputer(result.unit);
+ return computer.compute();
+ }
+}
diff --git a/pkg/analysis_server/test/src/computer/outline_computer_test.dart b/pkg/analysis_server/test/src/computer/outline_computer_test.dart
index 316cf31..67e9b9b 100644
--- a/pkg/analysis_server/test/src/computer/outline_computer_test.dart
+++ b/pkg/analysis_server/test/src/computer/outline_computer_test.dart
@@ -546,6 +546,124 @@
expect(outline, isNotNull);
}
+ test_isTest_isTestGroup() async {
+ addMetaPackageSource();
+ Outline outline = await _computeOutline('''
+import 'package:meta/meta.dart';
+
+@isTestGroup
+void myGroup(name, body()) {}
+
+@isTest
+void myTest(name) {}
+
+void main() {
+ myGroup('group1', () {
+ myGroup('group1_1', () {
+ myTest('test1_1_1');
+ myTest('test1_1_2');
+ });
+ myGroup('group1_2', () {
+ myTest('test1_2_1');
+ });
+ });
+ myGroup('group2', () {
+ myTest('test2_1');
+ myTest('test2_2');
+ });
+}
+''');
+ // unit
+ List<Outline> unit_children = outline.children;
+ expect(unit_children, hasLength(3));
+ // main
+ Outline main_outline = unit_children[2];
+ _expect(main_outline,
+ kind: ElementKind.FUNCTION,
+ name: 'main',
+ offset: testCode.indexOf("main() {"),
+ parameters: '()',
+ returnType: 'void');
+ List<Outline> main_children = main_outline.children;
+ expect(main_children, hasLength(2));
+ // group1
+ Outline group1_outline = main_children[0];
+ _expect(group1_outline,
+ kind: ElementKind.UNIT_TEST_GROUP,
+ length: 7,
+ name: 'myGroup("group1")',
+ offset: testCode.indexOf("myGroup('group1'"));
+ List<Outline> group1_children = group1_outline.children;
+ expect(group1_children, hasLength(2));
+ // group1_1
+ Outline group1_1_outline = group1_children[0];
+ _expect(group1_1_outline,
+ kind: ElementKind.UNIT_TEST_GROUP,
+ length: 7,
+ name: 'myGroup("group1_1")',
+ offset: testCode.indexOf("myGroup('group1_1'"));
+ List<Outline> group1_1_children = group1_1_outline.children;
+ expect(group1_1_children, hasLength(2));
+ // test1_1_1
+ Outline test1_1_1_outline = group1_1_children[0];
+ _expect(test1_1_1_outline,
+ kind: ElementKind.UNIT_TEST_TEST,
+ leaf: true,
+ length: 6,
+ name: 'myTest("test1_1_1")',
+ offset: testCode.indexOf("myTest('test1_1_1'"));
+ // test1_1_1
+ Outline test1_1_2_outline = group1_1_children[1];
+ _expect(test1_1_2_outline,
+ kind: ElementKind.UNIT_TEST_TEST,
+ leaf: true,
+ length: 6,
+ name: 'myTest("test1_1_2")',
+ offset: testCode.indexOf("myTest('test1_1_2'"));
+ // group1_2
+ Outline group1_2_outline = group1_children[1];
+ _expect(group1_2_outline,
+ kind: ElementKind.UNIT_TEST_GROUP,
+ length: 7,
+ name: 'myGroup("group1_2")',
+ offset: testCode.indexOf("myGroup('group1_2'"));
+ List<Outline> group1_2_children = group1_2_outline.children;
+ expect(group1_2_children, hasLength(1));
+ // test2_1
+ Outline test1_2_1_outline = group1_2_children[0];
+ _expect(test1_2_1_outline,
+ kind: ElementKind.UNIT_TEST_TEST,
+ leaf: true,
+ length: 6,
+ name: 'myTest("test1_2_1")',
+ offset: testCode.indexOf("myTest('test1_2_1'"));
+ // group2
+ Outline group2_outline = main_children[1];
+ _expect(group2_outline,
+ kind: ElementKind.UNIT_TEST_GROUP,
+ length: 7,
+ name: 'myGroup("group2")',
+ offset: testCode.indexOf("myGroup('group2'"));
+ List<Outline> group2_children = group2_outline.children;
+ expect(group2_children, hasLength(2));
+ // test2_1
+ Outline test2_1_outline = group2_children[0];
+ _expect(test2_1_outline,
+ kind: ElementKind.UNIT_TEST_TEST,
+ leaf: true,
+ length: 6,
+ name: 'myTest("test2_1")',
+ offset: testCode.indexOf("myTest('test2_1'"));
+ // test2_2
+ Outline test2_2_outline = group2_children[1];
+ _expect(test2_2_outline,
+ kind: ElementKind.UNIT_TEST_TEST,
+ leaf: true,
+ length: 6,
+ name: 'myTest("test2_2")',
+ offset: testCode.indexOf("myTest('test2_2'"));
+ }
+
test_localFunctions() async {
Outline unitOutline = await _computeOutline('''
class A {
diff --git a/pkg/analysis_server/test/src/computer/test_all.dart b/pkg/analysis_server/test/src/computer/test_all.dart
index 4bf0a76..8159db8 100644
--- a/pkg/analysis_server/test/src/computer/test_all.dart
+++ b/pkg/analysis_server/test/src/computer/test_all.dart
@@ -5,6 +5,7 @@
import 'package:test_reflective_loader/test_reflective_loader.dart';
import 'closingLabels_computer_test.dart' as closingLabels_computer_test;
+import 'folding_computer_test.dart' as folding_computer_test;
import 'import_elements_computer_test.dart' as import_elements_computer_test;
import 'imported_elements_computer_test.dart'
as imported_elements_computer_test;
@@ -13,6 +14,7 @@
main() {
defineReflectiveSuite(() {
closingLabels_computer_test.main();
+ folding_computer_test.main();
import_elements_computer_test.main();
imported_elements_computer_test.main();
outline_computer_test.main();
diff --git a/pkg/analysis_server/test/src/utilities/flutter_util.dart b/pkg/analysis_server/test/src/utilities/flutter_util.dart
index b7bdb1b..83b5b82 100644
--- a/pkg/analysis_server/test/src/utilities/flutter_util.dart
+++ b/pkg/analysis_server/test/src/utilities/flutter_util.dart
@@ -35,6 +35,13 @@
export 'src/widgets/text.dart';
''');
+ newFile('$flutterPkgLibPath/foundation.dart', r'''
+export 'package:meta/meta.dart' show
+ required;
+
+export 'src/foundation/key.dart';
+''');
+
void createSrcMaterial() {
newFile('$flutterPkgLibPath/src/material/app_bar.dart', r'''
import 'package:flutter/widgets.dart';
@@ -129,6 +136,28 @@
''');
}
+ void createSrcFoundation() {
+ newFile('$flutterPkgLibPath/src/foundation/key.dart', r'''
+
+abstract class Key {
+ const factory Key(String value) = ValueKey<String>;
+
+ const Key._();
+}
+
+abstract class LocalKey extends Key {
+ const LocalKey() : super._();
+}
+
+
+class ValueKey<T> extends LocalKey {
+ final T value;
+
+ const ValueKey(this.value);
+}
+''');
+ }
+
void createSrcWidgets() {
newFile('$flutterPkgLibPath/src/widgets/basic.dart', r'''
import 'framework.dart';
@@ -186,7 +215,7 @@
class AspectRatio extends SingleChildRenderObjectWidget {
const AspectRatio({
Key key,
- @required aspectRatio,
+ @required double aspectRatio,
Widget child,
});
}
@@ -221,22 +250,17 @@
''');
newFile('$flutterPkgLibPath/src/widgets/framework.dart', r'''
+import 'package:flutter/foundation.dart';
+
+export 'package:flutter/foundation.dart' show required;
+export 'package:flutter/foundation.dart' show Key, LocalKey, ValueKey;
+
typedef void VoidCallback();
abstract class BuildContext {
Widget get widget;
}
-abstract class Key {
- const factory Key(String value) = ValueKey<String>;
-
- const Key._();
-}
-
-abstract class LocalKey extends Key {
- const LocalKey() : super._();
-}
-
abstract class State<T extends StatefulWidget> {
BuildContext get context => null;
@@ -261,12 +285,6 @@
Widget build(BuildContext context) => null;
}
-class ValueKey<T> extends LocalKey {
- final T value;
-
- const ValueKey(this.value);
-}
-
class Widget {
final Key key;
@@ -324,6 +342,7 @@
''');
}
+ createSrcFoundation();
createPainting();
createRendering();
createSrcWidgets();
diff --git a/pkg/analysis_server/tool/spec/spec_input.html b/pkg/analysis_server/tool/spec/spec_input.html
index 62c933f..0d1c534 100644
--- a/pkg/analysis_server/tool/spec/spec_input.html
+++ b/pkg/analysis_server/tool/spec/spec_input.html
@@ -7,7 +7,7 @@
<body>
<h1>Analysis Server API Specification</h1>
<h1 style="color:#999999">Version
- <version>1.20.1</version>
+ <version>1.20.2</version>
</h1>
<p>
This document contains a specification of the API provided by the
diff --git a/pkg/analyzer/lib/dart/element/element.dart b/pkg/analyzer/lib/dart/element/element.dart
index 5b2237b..8af9b7d 100644
--- a/pkg/analyzer/lib/dart/element/element.dart
+++ b/pkg/analyzer/lib/dart/element/element.dart
@@ -618,6 +618,16 @@
bool get hasFactory;
/**
+ * Return `true` if this element has an annotation of the form `@isTest`.
+ */
+ bool get hasIsTest;
+
+ /**
+ * Return `true` if this element has an annotation of the form `@isTestGroup`.
+ */
+ bool get hasIsTestGroup;
+
+ /**
* Return `true` if this element has an annotation of the form `@JS(..)`.
*/
bool get hasJS;
@@ -889,6 +899,18 @@
bool get isImmutable;
/**
+ * Return `true` if this annotation marks the associated member as running
+ * a single test.
+ */
+ bool get isIsTest;
+
+ /**
+ * Return `true` if this annotation marks the associated member as running
+ * a test group.
+ */
+ bool get isIsTestGroup;
+
+ /**
* Return `true` if this annotation marks the associated element with the `JS`
* annotation.
*/
@@ -1436,6 +1458,11 @@
bool get isDeferred;
/**
+ * The [Namespace] that this directive contributes to the containing library.
+ */
+ Namespace get namespace;
+
+ /**
* Return the prefix that was specified as part of the import directive, or
* `null` if there was no prefix specified.
*/
diff --git a/pkg/analyzer/lib/source/line_info.dart b/pkg/analyzer/lib/source/line_info.dart
index 47661a2..5d0dee9 100644
--- a/pkg/analyzer/lib/source/line_info.dart
+++ b/pkg/analyzer/lib/source/line_info.dart
@@ -119,6 +119,6 @@
* containing the given [offset].
*/
int getOffsetOfLineAfter(int offset) {
- return getOffsetOfLine(getLocation(offset).lineNumber + 1);
+ return getOffsetOfLine(getLocation(offset).lineNumber);
}
}
diff --git a/pkg/analyzer/lib/src/dart/analysis/search.dart b/pkg/analyzer/lib/src/dart/analysis/search.dart
index 3933454..a54df1f 100644
--- a/pkg/analyzer/lib/src/dart/analysis/search.dart
+++ b/pkg/analyzer/lib/src/dart/analysis/search.dart
@@ -14,7 +14,6 @@
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/resolver/scope.dart' show NamespaceBuilder;
import 'package:analyzer/src/summary/idl.dart';
import 'package:collection/collection.dart';
@@ -823,11 +822,7 @@
_ImportElementReferencesVisitor(
ImportElement element, this.enclosingUnitElement)
: importElement = element {
- importedElements = new NamespaceBuilder()
- .createImportNamespaceForDirective(element)
- .definedNames
- .values
- .toSet();
+ importedElements = element.namespace.definedNames.values.toSet();
}
@override
diff --git a/pkg/analyzer/lib/src/dart/analysis/session_helper.dart b/pkg/analyzer/lib/src/dart/analysis/session_helper.dart
index 1644e8f..758fe29 100644
--- a/pkg/analyzer/lib/src/dart/analysis/session_helper.dart
+++ b/pkg/analyzer/lib/src/dart/analysis/session_helper.dart
@@ -29,4 +29,18 @@
return null;
}
}
+
+ /// Return the [PropertyAccessorElement] with the given [name] that is
+ /// exported from the library with the given [uri], or `null` if the
+ /// library does not export a top-level accessor with such name.
+ Future<PropertyAccessorElement> getTopLevelPropertyAccessor(
+ String uri, String name) async {
+ var libraryElement = await session.getLibraryByUri(uri);
+ var element = libraryElement.exportNamespace.get(name);
+ if (element is PropertyAccessorElement) {
+ return element;
+ } else {
+ return null;
+ }
+ }
}
diff --git a/pkg/analyzer/lib/src/dart/element/element.dart b/pkg/analyzer/lib/src/dart/element/element.dart
index 8fa0d0b..ac82f5f 100644
--- a/pkg/analyzer/lib/src/dart/element/element.dart
+++ b/pkg/analyzer/lib/src/dart/element/element.dart
@@ -2854,6 +2854,18 @@
static String _IMMUTABLE_VARIABLE_NAME = "immutable";
/**
+ * The name of the top-level variable used to mark a function as running
+ * a single test.
+ */
+ static String _IS_TEST_VARIABLE_NAME = "isTest";
+
+ /**
+ * The name of the top-level variable used to mark a function as running
+ * a test group.
+ */
+ static String _IS_TEST_GROUP_VARIABLE_NAME = "isTestGroup";
+
+ /**
* The name of the class used to JS annotate an element.
*/
static String _JS_CLASS_NAME = "JS";
@@ -2983,6 +2995,18 @@
element.library?.name == _META_LIB_NAME;
@override
+ bool get isIsTest =>
+ element is PropertyAccessorElement &&
+ element.name == _IS_TEST_VARIABLE_NAME &&
+ element.library?.name == _META_LIB_NAME;
+
+ @override
+ bool get isIsTestGroup =>
+ element is PropertyAccessorElement &&
+ element.name == _IS_TEST_GROUP_VARIABLE_NAME &&
+ element.library?.name == _META_LIB_NAME;
+
+ @override
bool get isJS =>
element is ConstructorElement &&
element.enclosingElement.name == _JS_CLASS_NAME &&
@@ -3214,6 +3238,14 @@
}
@override
+ bool get hasIsTest =>
+ metadata.any((ElementAnnotation annotation) => annotation.isIsTest);
+
+ @override
+ bool get hasIsTestGroup =>
+ metadata.any((ElementAnnotation annotation) => annotation.isIsTestGroup);
+
+ @override
bool get hasJS =>
metadata.any((ElementAnnotation annotation) => annotation.isJS);
@@ -5759,6 +5791,11 @@
String _selectedUri;
/**
+ * The cached value of [namespace].
+ */
+ Namespace _namespace;
+
+ /**
* Initialize a newly created import element at the given [offset].
* The offset may be `-1` if the import is synthetic.
*/
@@ -5907,6 +5944,12 @@
return offset;
}
+ @override
+ Namespace get namespace {
+ return _namespace ??=
+ new NamespaceBuilder().createImportNamespaceForDirective(this);
+ }
+
PrefixElement get prefix {
if (_prefix == null) {
if (_kernel != null && _kernel.name != null) {
@@ -7556,6 +7599,12 @@
bool get hasFactory => false;
@override
+ bool get hasIsTest => false;
+
+ @override
+ bool get hasIsTestGroup => false;
+
+ @override
bool get hasJS => false;
@override
diff --git a/pkg/analyzer/lib/src/dart/element/handle.dart b/pkg/analyzer/lib/src/dart/element/handle.dart
index a5f7cbe..c3a659d 100644
--- a/pkg/analyzer/lib/src/dart/element/handle.dart
+++ b/pkg/analyzer/lib/src/dart/element/handle.dart
@@ -363,6 +363,12 @@
int get hashCode => _location.hashCode;
@override
+ bool get hasIsTest => actualElement.hasIsTest;
+
+ @override
+ bool get hasIsTestGroup => actualElement.hasIsTestGroup;
+
+ @override
bool get hasJS => actualElement.hasJS;
@override
@@ -757,6 +763,9 @@
ElementKind get kind => ElementKind.IMPORT;
@override
+ Namespace get namespace => actualElement.namespace;
+
+ @override
PrefixElement get prefix => actualElement.prefix;
@override
diff --git a/pkg/analyzer/lib/src/dart/element/member.dart b/pkg/analyzer/lib/src/dart/element/member.dart
index 026a7ef..a304d9f 100644
--- a/pkg/analyzer/lib/src/dart/element/member.dart
+++ b/pkg/analyzer/lib/src/dart/element/member.dart
@@ -400,6 +400,12 @@
bool get hasFactory => _baseElement.hasFactory;
@override
+ bool get hasIsTest => _baseElement.hasIsTest;
+
+ @override
+ bool get hasIsTestGroup => _baseElement.hasIsTestGroup;
+
+ @override
bool get hasJS => _baseElement.hasJS;
@override
diff --git a/pkg/analyzer/lib/src/dart/resolver/scope.dart b/pkg/analyzer/lib/src/dart/resolver/scope.dart
index ef99e4c..a5533a8 100644
--- a/pkg/analyzer/lib/src/dart/resolver/scope.dart
+++ b/pkg/analyzer/lib/src/dart/resolver/scope.dart
@@ -488,13 +488,11 @@
* later reference.
*/
void _createImportedNamespaces() {
- NamespaceBuilder builder = new NamespaceBuilder();
List<ImportElement> imports = _definingLibrary.imports;
int count = imports.length;
_importedNamespaces = new List<Namespace>(count);
for (int i = 0; i < count; i++) {
- _importedNamespaces[i] =
- builder.createImportNamespaceForDirective(imports[i]);
+ _importedNamespaces[i] = imports[i].namespace;
}
}
diff --git a/pkg/analyzer/lib/src/fasta/ast_building_factory.dart b/pkg/analyzer/lib/src/fasta/ast_building_factory.dart
new file mode 100644
index 0000000..96318e4
--- /dev/null
+++ b/pkg/analyzer/lib/src/fasta/ast_building_factory.dart
@@ -0,0 +1,190 @@
+// 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/dart/ast/ast.dart';
+import 'package:analyzer/dart/ast/token.dart';
+import 'package:analyzer/src/dart/ast/ast_factory.dart';
+import 'package:front_end/src/fasta/kernel/forest.dart';
+import 'package:kernel/ast.dart' as kernel;
+
+/// An implementation of a [Forest] that can be used to build an AST structure.
+class AstBuildingForest
+ implements Forest<Expression, Statement, Token, _Arguments> {
+ /// The factory used to create AST nodes.
+ AstFactoryImpl astFactory = new AstFactoryImpl();
+
+ /// Initialize a newly created AST-building forest.
+ AstBuildingForest();
+
+ @override
+ _Arguments arguments(List<Expression> positional, Token location,
+ {covariant List types, covariant List named}) {
+ _Arguments arguments = new _Arguments();
+ if (types != null) {
+ arguments.typeArguments = types.cast<TypeAnnotation>();
+ }
+ arguments.positionalArguments = positional.cast<Expression>();
+ if (named != null) {
+ arguments.namedArguments = named.cast<Expression>();
+ }
+ return arguments;
+ }
+
+ @override
+ _Arguments argumentsEmpty(Token location) => new _Arguments();
+
+ @override
+ List argumentsNamed(_Arguments arguments) => arguments.namedArguments;
+
+ @override
+ List<Expression> argumentsPositional(_Arguments arguments) =>
+ arguments.positionalArguments;
+
+ @override
+ void argumentsSetTypeArguments(_Arguments arguments, covariant List types) {
+ arguments.typeArguments = types.cast<TypeAnnotation>();
+ }
+
+ @override
+ List argumentsTypeArguments(_Arguments arguments) => arguments.typeArguments;
+
+ @override
+ Expression asExpression(Expression expression, type, Token location) =>
+ astFactory.asExpression(expression, location, type);
+
+ Expression asLiteralString(Expression value) => value;
+
+ @override
+ Expression awaitExpression(Expression operand, Token awaitKeyword) {
+ return astFactory.awaitExpression(awaitKeyword, operand);
+ }
+
+ @override
+ kernel.Arguments castArguments(_Arguments arguments) {
+ // TODO(brianwilkerson) Implement this or remove it from the API.
+ throw new UnimplementedError();
+ }
+
+ @override
+ Expression checkLibraryIsLoaded(dependency) {
+ // TODO(brianwilkerson) Implement this.
+ throw new UnimplementedError();
+ }
+
+ @override
+ Expression conditionalExpression(Expression condition, Token question,
+ Expression thenExpression, Token colon, Expression elseExpression) =>
+ astFactory.conditionalExpression(
+ condition, question, thenExpression, colon, elseExpression);
+
+ @override
+ kernel.DartType getTypeAt(Object typeArguments, int index) {
+ return null; // (typeArguments as TypeArgumentList).arguments[index].type.kernelType;
+ }
+
+ @override
+ int getTypeCount(Object typeArguments) {
+ return (typeArguments as TypeArgumentList).arguments.length;
+ }
+
+ @override
+ bool isErroneousNode(covariant node) => false; // ???
+
+ @override
+ Expression isExpression(Expression expression, Token isOperator,
+ Token notOperator, Object type) =>
+ astFactory.isExpression(expression, isOperator, notOperator, type);
+
+ @override
+ Expression literalBool(bool value, Token location) =>
+ astFactory.booleanLiteral(location, value);
+
+ @override
+ Expression literalDouble(double value, Token location) =>
+ astFactory.doubleLiteral(location, value);
+
+ @override
+ Expression literalInt(int value, Token location) =>
+ astFactory.integerLiteral(location, value);
+
+ @override
+ Expression literalList(
+ Token constKeyword,
+ bool isConst,
+ Object typeArgument,
+ Object typeArguments,
+ Token leftBracket,
+ List<Expression> expressions,
+ Token rightBracket) =>
+ astFactory.listLiteral(
+ constKeyword, typeArguments, leftBracket, expressions, rightBracket);
+
+ @override
+ Expression literalMap(
+ Token constKeyword,
+ bool isConst,
+ covariant keyType,
+ covariant valueType,
+ Object typeArguments,
+ Token leftBracket,
+ covariant List entries,
+ Token rightBracket) =>
+ astFactory.mapLiteral(
+ constKeyword, typeArguments, leftBracket, entries, rightBracket);
+
+ @override
+ Expression literalNull(Token location) => astFactory.nullLiteral(location);
+
+ @override
+ Expression literalString(String value, Token location) =>
+ astFactory.simpleStringLiteral(location, value);
+
+ @override
+ Expression literalSymbol(String value, Token location) {
+ // TODO(brianwilkerson) Get the missing information.
+ return astFactory.symbolLiteral(location, null /* components */);
+ }
+
+ @override
+ Expression literalType(covariant type, Token location) {
+ // TODO(brianwilkerson) Capture the type information.
+ return astFactory.simpleIdentifier(location);
+ }
+
+ @override
+ Expression loadLibrary(dependency) {
+ // TODO(brianwilkerson) Implement this.
+ throw new UnimplementedError();
+ }
+
+ @override
+ Object mapEntry(Expression key, Token colon, Expression value) =>
+ astFactory.mapLiteralEntry(key, colon, value);
+
+ @override
+ List mapEntryList(int length) => <MapLiteralEntry>[];
+
+ @override
+ Expression notExpression(Expression operand, Token operator) =>
+ astFactory.prefixExpression(operator, operand);
+
+ @override
+ int readOffset(AstNode node) => node.offset;
+
+ @override
+ Expression stringConcatenationExpression(
+ List<Expression> strings, Token location) =>
+ astFactory.adjacentStrings(strings);
+
+ @override
+ Expression thisExpression(Token thisKeyword) =>
+ astFactory.thisExpression(thisKeyword);
+}
+
+/// A data holder used to conform to the [Forest] API.
+class _Arguments {
+ List<TypeAnnotation> typeArguments = <TypeAnnotation>[];
+ List<Expression> positionalArguments = <Expression>[];
+ List<Expression> namedArguments = <Expression>[];
+}
diff --git a/pkg/analyzer/lib/src/generated/resolver.dart b/pkg/analyzer/lib/src/generated/resolver.dart
index 5562394..503d7b1 100644
--- a/pkg/analyzer/lib/src/generated/resolver.dart
+++ b/pkg/analyzer/lib/src/generated/resolver.dart
@@ -4263,8 +4263,7 @@
// the map.
ImportElement importElement = importDirective.element;
if (importElement != null) {
- NamespaceBuilder builder = new NamespaceBuilder();
- namespace = builder.createImportNamespaceForDirective(importElement);
+ namespace = importElement.namespace;
_namespaceMap[importDirective] = namespace;
}
}
@@ -8505,7 +8504,17 @@
if (typeName is SimpleIdentifier) {
return typeName;
} else {
- return (typeName as PrefixedIdentifier).identifier;
+ PrefixedIdentifier prefixed = typeName;
+ SimpleIdentifier prefix = prefixed.prefix;
+ // The prefixed identifier can be:
+ // 1. new importPrefix.TypeName()
+ // 2. new TypeName.constructorName()
+ // 3. new unresolved.Unresolved()
+ if (prefix.staticElement is PrefixElement) {
+ return prefixed.identifier;
+ } else {
+ return prefix;
+ }
}
}
diff --git a/pkg/analyzer/lib/src/generated/type_system.dart b/pkg/analyzer/lib/src/generated/type_system.dart
index 7c76550..d178f25 100644
--- a/pkg/analyzer/lib/src/generated/type_system.dart
+++ b/pkg/analyzer/lib/src/generated/type_system.dart
@@ -20,6 +20,7 @@
show AnalysisContext, AnalysisOptionsImpl;
import 'package:analyzer/src/generated/resolver.dart' show TypeProvider;
import 'package:analyzer/src/generated/utilities_dart.dart' show ParameterKind;
+import 'package:meta/meta.dart';
/**
* `void`, `dynamic`, and `Object` are all equivalent. However, this makes
@@ -63,6 +64,651 @@
identical(t, UnknownInferredType.instance);
}
+/// Tracks upper and lower type bounds for a set of type parameters.
+///
+/// This class is used by calling [isSubtypeOf]. When it encounters one of
+/// the type parameters it is inferring, it will record the constraint, and
+/// optimistically assume the constraint will be satisfied.
+///
+/// For example if we are inferring type parameter A, and we ask if
+/// `A <: num`, this will record that A must be a subytpe of `num`. It also
+/// handles cases when A appears as part of the structure of another type, for
+/// example `Iterable<A> <: Iterable<num>` would infer the same constraint
+/// (due to covariant generic types) as would `() -> A <: () -> num`. In
+/// contrast `(A) -> void <: (num) -> void`.
+///
+/// Once the lower/upper bounds are determined, [infer] should be called to
+/// finish the inference. It will instantiate a generic function type with the
+/// inferred types for each type parameter.
+///
+/// It can also optionally compute a partial solution, in case some of the type
+/// parameters could not be inferred (because the constraints cannot be
+/// satisfied), or bail on the inference when this happens.
+///
+/// As currently designed, an instance of this class should only be used to
+/// infer a single call and discarded immediately afterwards.
+class GenericInferrer {
+ final StrongTypeSystemImpl _typeSystem;
+ final TypeProvider typeProvider;
+ final Map<TypeParameterElement, List<_TypeConstraint>> constraints;
+
+ /// Buffer recording constraints recorded while performing a recursive call to
+ /// [_matchSubtypeOf] that might fail, so that any constraints recorded during
+ /// the failed match can be rewound.
+ final _undoBuffer = <_TypeConstraint>[];
+
+ GenericInferrer(this.typeProvider, this._typeSystem,
+ Iterable<TypeParameterElement> typeFormals)
+ : constraints = new HashMap(
+ equals: (x, y) => x.location == y.location,
+ hashCode: (x) => x.location.hashCode) {
+ for (var formal in typeFormals) {
+ constraints[formal] = [];
+ }
+ }
+
+ /// Apply an argument constraint, which asserts that the [argument] staticType
+ /// is a subtype of the [parameterType].
+ void constrainArgument(
+ DartType argumentType, DartType parameterType, String parameterName,
+ {DartType genericType}) {
+ var origin = new _TypeConstraintFromArgument(
+ argumentType, parameterType, parameterName,
+ genericType: genericType);
+ tryMatchSubtypeOf(argumentType, parameterType, origin, covariant: false);
+ }
+
+ /// Constrain a universal function type [fnType] used in a context
+ /// [contextType].
+ void constrainGenericFunctionInContext(
+ FunctionType fnType, DartType contextType) {
+ var origin = new _TypeConstraintFromFunctionContext(fnType, contextType);
+
+ // Since we're trying to infer the instantiation, we want to ignore type
+ // formals as we check the parameters and return type.
+ var inferFnType =
+ fnType.instantiate(TypeParameterTypeImpl.getTypes(fnType.typeFormals));
+ tryMatchSubtypeOf(inferFnType, contextType, origin, covariant: true);
+ }
+
+ /// Apply a return type constraint, which asserts that the [declaredType]
+ /// is a subtype of the [contextType].
+ void constrainReturnType(DartType declaredType, DartType contextType) {
+ var origin = new _TypeConstraintFromReturnType(declaredType, contextType);
+ tryMatchSubtypeOf(declaredType, contextType, origin, covariant: true);
+ }
+
+ /// Given the constraints that were given by calling [isSubtypeOf], find the
+ /// instantiation of the generic function that satisfies these constraints.
+ ///
+ /// If [downwardsInferPhase] is set, we are in the first pass of inference,
+ /// pushing context types down. At that point we are allowed to push down
+ /// `?` to precisely represent an unknown type. If [downwardsInferPhase] is
+ /// false, we are on our final inference pass, have all available information
+ /// including argument types, and must not conclude `?` for any type formal.
+ T infer<T extends ParameterizedType>(
+ T genericType, List<TypeParameterElement> typeFormals,
+ {bool considerExtendsClause: true,
+ ErrorReporter errorReporter,
+ AstNode errorNode,
+ bool downwardsInferPhase: false}) {
+ var fnTypeParams = TypeParameterTypeImpl.getTypes(typeFormals);
+
+ // Initialize the inferred type array.
+ //
+ // In the downwards phase, they all start as `?` to offer reasonable
+ // degradation for f-bounded type parameters.
+ var inferredTypes = new List<DartType>.filled(
+ fnTypeParams.length, UnknownInferredType.instance);
+ var _inferTypeParameter = downwardsInferPhase
+ ? _inferTypeParameterFromContext
+ : _inferTypeParameterFromAll;
+
+ for (int i = 0; i < fnTypeParams.length; i++) {
+ TypeParameterType typeParam = fnTypeParams[i];
+
+ var typeParamBound = typeParam.bound;
+ _TypeConstraint extendsClause;
+ if (considerExtendsClause && !typeParamBound.isDynamic) {
+ extendsClause = new _TypeConstraint.fromExtends(typeParam,
+ typeParam.bound.substitute2(inferredTypes, fnTypeParams));
+ }
+
+ inferredTypes[i] =
+ _inferTypeParameter(constraints[typeParam.element], extendsClause);
+ }
+
+ // If the downwards infer phase has failed, we'll catch this in the upwards
+ // phase later on.
+ if (downwardsInferPhase) {
+ return genericType.instantiate(inferredTypes) as T;
+ }
+
+ // Check the inferred types against all of the constraints.
+ var knownTypes = new HashMap<TypeParameterType, DartType>(
+ equals: (x, y) => x.element == y.element,
+ hashCode: (x) => x.element.hashCode);
+ for (int i = 0; i < fnTypeParams.length; i++) {
+ TypeParameterType typeParam = fnTypeParams[i];
+ var constraints = this.constraints[typeParam.element];
+ var typeParamBound =
+ typeParam.bound.substitute2(inferredTypes, fnTypeParams);
+
+ var inferred = inferredTypes[i];
+ bool success =
+ constraints.every((c) => c.isSatisifedBy(_typeSystem, inferred));
+ if (success && !typeParamBound.isDynamic) {
+ // If everything else succeeded, check the `extends` constraint.
+ var extendsConstraint =
+ new _TypeConstraint.fromExtends(typeParam, typeParamBound);
+ constraints.add(extendsConstraint);
+ success = extendsConstraint.isSatisifedBy(_typeSystem, inferred);
+ }
+
+ if (!success) {
+ errorReporter?.reportErrorForNode(
+ StrongModeCode.COULD_NOT_INFER,
+ errorNode,
+ [typeParam, _formatError(typeParam, inferred, constraints)]);
+
+ // Heuristic: even if we failed, keep the erroneous type.
+ // It should satisfy at least some of the constraints (e.g. the return
+ // context). If we fall back to instantiateToBounds, we'll typically get
+ // more errors (e.g. because `dynamic` is the most common bound).
+ }
+
+ if (UnknownInferredType.isKnown(inferred)) {
+ knownTypes[typeParam] = inferred;
+ }
+ }
+
+ // Use instantiate to bounds to finish things off.
+ var hasError = new List<bool>.filled(fnTypeParams.length, false);
+ var result = _typeSystem.instantiateToBounds(genericType,
+ hasError: hasError, knownTypes: knownTypes) as T;
+
+ // Report any errors from instantiateToBounds.
+ for (int i = 0; i < hasError.length; i++) {
+ if (hasError[i]) {
+ TypeParameterType typeParam = fnTypeParams[i];
+ var typeParamBound =
+ typeParam.bound.substitute2(inferredTypes, fnTypeParams);
+ // TODO(jmesserly): improve this error message.
+ errorReporter
+ ?.reportErrorForNode(StrongModeCode.COULD_NOT_INFER, errorNode, [
+ typeParam,
+ "\nRecursive bound cannot be instantiated: '$typeParamBound'."
+ "\nConsider passing explicit type argument(s) "
+ "to the generic.\n\n'"
+ ]);
+ }
+ }
+ return result;
+ }
+
+ /// Tries to make [i1] a subtype of [i2] and accumulate constraints as needed.
+ ///
+ /// The return value indicates whether the match was successful. If it was
+ /// unsuccessful, any constraints that were accumulated during the match
+ /// attempt have been rewound (see [_rewindConstraints]).
+ bool tryMatchSubtypeOf(DartType t1, DartType t2, _TypeConstraintOrigin origin,
+ {bool covariant}) {
+ int previousRewindBufferLength = _undoBuffer.length;
+ bool success = _matchSubtypeOf(t1, t2, null, origin, covariant: covariant);
+ if (!success) {
+ _rewindConstraints(previousRewindBufferLength);
+ }
+ return success;
+ }
+
+ /// Choose the bound that was implied by the return type, if any.
+ ///
+ /// Which bound this is depends on what positions the type parameter
+ /// appears in. If the type only appears only in a contravariant position,
+ /// we will choose the lower bound instead.
+ ///
+ /// For example given:
+ ///
+ /// Func1<T, bool> makeComparer<T>(T x) => (T y) => x() == y;
+ ///
+ /// main() {
+ /// Func1<num, bool> t = makeComparer/* infer <num> */(42);
+ /// print(t(42.0)); /// false, no error.
+ /// }
+ ///
+ /// The constraints we collect are:
+ ///
+ /// * `num <: T`
+ /// * `int <: T`
+ ///
+ /// ... and no upper bound. Therefore the lower bound is the best choice.
+ DartType _chooseTypeFromConstraints(Iterable<_TypeConstraint> constraints,
+ {bool toKnownType: false}) {
+ DartType lower = UnknownInferredType.instance;
+ DartType upper = UnknownInferredType.instance;
+ for (var constraint in constraints) {
+ // Given constraints:
+ //
+ // L1 <: T <: U1
+ // L2 <: T <: U2
+ //
+ // These can be combined to produce:
+ //
+ // LUB(L1, L2) <: T <: GLB(U1, U2).
+ //
+ // This can then be done for all constraints in sequence.
+ //
+ // This resulting constraint may be unsatisfiable; in that case inference
+ // will fail.
+ upper = _getGreatestLowerBound(upper, constraint.upperBound);
+ lower = _typeSystem.getLeastUpperBound(lower, constraint.lowerBound);
+ }
+
+ // Prefer the known bound, if any.
+ // Otherwise take whatever bound has partial information, e.g. `Iterable<?>`
+ //
+ // For both of those, prefer the lower bound (arbitrary heuristic).
+ if (UnknownInferredType.isKnown(lower)) {
+ return lower;
+ }
+ if (UnknownInferredType.isKnown(upper)) {
+ return upper;
+ }
+ if (!identical(UnknownInferredType.instance, lower)) {
+ return toKnownType ? _typeSystem.lowerBoundForType(lower) : lower;
+ }
+ if (!identical(UnknownInferredType.instance, upper)) {
+ return toKnownType ? _typeSystem.upperBoundForType(upper) : upper;
+ }
+ return lower;
+ }
+
+ String _formatError(TypeParameterType typeParam, DartType inferred,
+ Iterable<_TypeConstraint> constraints) {
+ var intro = "Tried to infer '$inferred' for '$typeParam'"
+ " which doesn't work:";
+
+ var constraintsByOrigin = <_TypeConstraintOrigin, List<_TypeConstraint>>{};
+ for (var c in constraints) {
+ constraintsByOrigin.putIfAbsent(c.origin, () => []).add(c);
+ }
+
+ // Only report unique constraint origins.
+ Iterable<_TypeConstraint> isSatisified(bool expected) => constraintsByOrigin
+ .values
+ .where((l) =>
+ l.every((c) => c.isSatisifedBy(_typeSystem, inferred)) == expected)
+ .expand((i) => i);
+
+ String unsatisified = _formatConstraints(isSatisified(false));
+ String satisified = _formatConstraints(isSatisified(true));
+
+ assert(unsatisified.isNotEmpty);
+ if (satisified.isNotEmpty) {
+ satisified = "\nThe type '$inferred' was inferred from:\n$satisified";
+ }
+
+ return '\n\n$intro\n$unsatisified$satisified\n\n'
+ 'Consider passing explicit type argument(s) to the generic.\n\n';
+ }
+
+ /// This is first calls strong mode's GLB, but if it fails to find anything
+ /// (i.e. returns the bottom type), we kick in a few additional rules:
+ ///
+ /// - `GLB(FutureOr<A>, B)` is defined as:
+ /// - `GLB(FutureOr<A>, FutureOr<B>) == FutureOr<GLB(A, B)>`
+ /// - `GLB(FutureOr<A>, Future<B>) == Future<GLB(A, B)>`
+ /// - else `GLB(FutureOr<A>, B) == GLB(A, B)`
+ /// - `GLB(A, FutureOr<B>) == GLB(FutureOr<A>, B)` (defined above),
+ /// - else `GLB(A, B) == Null`
+ DartType _getGreatestLowerBound(DartType t1, DartType t2) {
+ var result = _typeSystem.getGreatestLowerBound(t1, t2);
+ if (result.isBottom) {
+ // See if we can do better by considering FutureOr rules.
+ if (t1 is InterfaceType && t1.isDartAsyncFutureOr) {
+ var t1TypeArg = t1.typeArguments[0];
+ if (t2 is InterfaceType) {
+ // GLB(FutureOr<A>, FutureOr<B>) == FutureOr<GLB(A, B)>
+ if (t2.isDartAsyncFutureOr) {
+ var t2TypeArg = t2.typeArguments[0];
+ return typeProvider.futureOrType
+ .instantiate([_getGreatestLowerBound(t1TypeArg, t2TypeArg)]);
+ }
+ // GLB(FutureOr<A>, Future<B>) == Future<GLB(A, B)>
+ if (t2.isDartAsyncFuture) {
+ var t2TypeArg = t2.typeArguments[0];
+ return typeProvider.futureType
+ .instantiate([_getGreatestLowerBound(t1TypeArg, t2TypeArg)]);
+ }
+ }
+ // GLB(FutureOr<A>, B) == GLB(A, B)
+ return _getGreatestLowerBound(t1TypeArg, t2);
+ }
+ if (t2 is InterfaceType && t2.isDartAsyncFutureOr) {
+ // GLB(A, FutureOr<B>) == GLB(FutureOr<A>, B)
+ return _getGreatestLowerBound(t2, t1);
+ }
+ // TODO(jmesserly): fix this rule once we support non-nullable types.
+ return typeProvider.nullType;
+ }
+ return result;
+ }
+
+ DartType _inferTypeParameterFromAll(
+ List<_TypeConstraint> constraints, _TypeConstraint extendsClause) {
+ // See if we already fixed this type from downwards inference.
+ // If so, then we aren't allowed to change it based on argument types.
+ DartType t = _inferTypeParameterFromContext(
+ constraints.where((c) => c.isDownwards), extendsClause);
+ if (UnknownInferredType.isKnown(t)) {
+ // Remove constraints that aren't downward ones; we'll ignore these for
+ // error reporting, because inference already succeeded.
+ constraints.removeWhere((c) => !c.isDownwards);
+ return t;
+ }
+
+ if (extendsClause != null) {
+ constraints = constraints.toList()..add(extendsClause);
+ }
+
+ var choice = _chooseTypeFromConstraints(constraints, toKnownType: true);
+ return choice;
+ }
+
+ DartType _inferTypeParameterFromContext(
+ Iterable<_TypeConstraint> constraints, _TypeConstraint extendsClause) {
+ DartType t = _chooseTypeFromConstraints(constraints);
+ if (UnknownInferredType.isUnknown(t)) {
+ return t;
+ }
+
+ // If we're about to make our final choice, apply the extends clause.
+ // This gives us a chance to refine the choice, in case it would violate
+ // the `extends` clause. For example:
+ //
+ // Object obj = math.min/*<infer Object, error>*/(1, 2);
+ //
+ // If we consider the `T extends num` we conclude `<num>`, which works.
+ if (extendsClause != null) {
+ constraints = constraints.toList()..add(extendsClause);
+ return _chooseTypeFromConstraints(constraints);
+ }
+ return t;
+ }
+
+ /// Tries to make [i1] a subtype of [i2] and accumulate constraints as needed.
+ ///
+ /// The return value indicates whether the match was successful. If it was
+ /// unsuccessful, the caller is responsible for ignoring any constraints that
+ /// were accumulated (see [_rewindConstraints]).
+ bool _matchInterfaceSubtypeOf(InterfaceType i1, InterfaceType i2,
+ Set<Element> visited, _TypeConstraintOrigin origin,
+ {bool covariant}) {
+ if (identical(i1, i2)) {
+ return true;
+ }
+
+ if (i1.element == i2.element) {
+ List<DartType> tArgs1 = i1.typeArguments;
+ List<DartType> tArgs2 = i2.typeArguments;
+ assert(tArgs1.length == tArgs2.length);
+ for (int i = 0; i < tArgs1.length; i++) {
+ if (!_matchSubtypeOf(tArgs1[i], tArgs2[i], visited, origin,
+ covariant: covariant)) {
+ return false;
+ }
+ }
+ return true;
+ }
+ if (i1.isObject) {
+ return false;
+ }
+
+ // Guard against loops in the class hierarchy
+ //
+ // TODO(jmesserly): this function isn't guarding against anything (it's not
+ // passsing down `visitedSet`, so adding the element has no effect).
+ //
+ // If that's fixed, it breaks inference tests for types like
+ // `Iterable<Iterable<?>>` matched aganinst `List<List<int>>`.
+ //
+ // The fix is for type arguments (above) to not pass down `visited`, similar
+ // to how _isInterfaceSubtypeOf does not pass down `visited` for type
+ // arguments.
+ bool guardedInterfaceSubtype(InterfaceType t1) {
+ var visitedSet = visited ?? new HashSet<Element>();
+ if (visitedSet.add(t1.element)) {
+ bool matched = _matchInterfaceSubtypeOf(t1, i2, visited, origin,
+ covariant: covariant);
+ visitedSet.remove(t1.element);
+ return matched;
+ } else {
+ // In the case of a recursive type parameter, consider the subtype
+ // match to have failed.
+ return false;
+ }
+ }
+
+ // We don't need to search the entire class hierarchy, since a given
+ // subclass can't appear multiple times with different generic parameters.
+ // So shortcut to the first match found.
+ //
+ // We don't need undo logic here because if the classes don't match, nothing
+ // is added to the constraint set.
+ if (guardedInterfaceSubtype(i1.superclass)) return true;
+ for (final parent in i1.interfaces) {
+ if (guardedInterfaceSubtype(parent)) return true;
+ }
+ for (final parent in i1.mixins) {
+ if (guardedInterfaceSubtype(parent)) return true;
+ }
+ return false;
+ }
+
+ /// Assert that [t1] will be a subtype of [t2], and returns if the constraint
+ /// can be satisfied.
+ ///
+ /// [covariant] must be true if [t1] is a declared type of the generic
+ /// function and [t2] is the context type, or false if the reverse. For
+ /// example [covariant] is used when [t1] is the declared return type
+ /// and [t2] is the context type. Contravariant would be used if [t1] is the
+ /// argument type (i.e. passed in to the generic function) and [t2] is the
+ /// declared parameter type.
+ ///
+ /// [origin] indicates where the constraint came from, for example an argument
+ /// or return type.
+ bool _matchSubtypeOf(DartType t1, DartType t2, Set<Element> visited,
+ _TypeConstraintOrigin origin,
+ {bool covariant}) {
+ if (covariant && t1 is TypeParameterType) {
+ var constraints = this.constraints[t1.element];
+ if (constraints != null) {
+ if (!identical(t2, UnknownInferredType.instance)) {
+ var constraint = new _TypeConstraint(origin, t1, upper: t2);
+ constraints.add(constraint);
+ _undoBuffer.add(constraint);
+ }
+ return true;
+ }
+ }
+ if (!covariant && t2 is TypeParameterType) {
+ var constraints = this.constraints[t2.element];
+ if (constraints != null) {
+ if (!identical(t1, UnknownInferredType.instance)) {
+ var constraint = new _TypeConstraint(origin, t2, lower: t1);
+ constraints.add(constraint);
+ _undoBuffer.add(constraint);
+ }
+ return true;
+ }
+ }
+
+ if (identical(t1, t2)) {
+ return true;
+ }
+
+ // TODO(jmesserly): this logic is taken from subtype.
+ bool matchSubtype(DartType t1, DartType t2) {
+ return _matchSubtypeOf(t1, t2, null, origin, covariant: covariant);
+ }
+
+ // Handle FutureOr<T> union type.
+ if (t1 is InterfaceType && t1.isDartAsyncFutureOr) {
+ var t1TypeArg = t1.typeArguments[0];
+ if (t2 is InterfaceType && t2.isDartAsyncFutureOr) {
+ var t2TypeArg = t2.typeArguments[0];
+ // FutureOr<A> <: FutureOr<B> iff A <: B
+ return matchSubtype(t1TypeArg, t2TypeArg);
+ }
+
+ // given t1 is Future<A> | A, then:
+ // (Future<A> | A) <: t2 iff Future<A> <: t2 and A <: t2.
+ var t1Future = typeProvider.futureType.instantiate([t1TypeArg]);
+ return matchSubtype(t1Future, t2) && matchSubtype(t1TypeArg, t2);
+ }
+
+ if (t2 is InterfaceType && t2.isDartAsyncFutureOr) {
+ // given t2 is Future<A> | A, then:
+ // t1 <: (Future<A> | A) iff t1 <: Future<A> or t1 <: A
+ var t2TypeArg = t2.typeArguments[0];
+ var t2Future = typeProvider.futureType.instantiate([t2TypeArg]);
+
+ // First we try matching `t1 <: Future<A>`. If that succeeds *and*
+ // records at least one constraint, then we proceed using that constraint.
+ var previousRewindBufferLength = _undoBuffer.length;
+ var success =
+ tryMatchSubtypeOf(t1, t2Future, origin, covariant: covariant);
+
+ if (_undoBuffer.length != previousRewindBufferLength) {
+ // Trying to match `t1 <: Future<A>` succeeded and recorded constraints,
+ // so those are the constraints we want.
+ return true;
+ } else {
+ // Either `t1 <: Future<A>` failed to match, or it matched trivially
+ // without recording any constraints (e.g. because t1 is `Null`). We
+ // want constraints, because they let us do more precise inference, so
+ // go ahead and try matching `t1 <: A` to see if it records any
+ // constraints.
+ if (tryMatchSubtypeOf(t1, t2TypeArg, origin, covariant: covariant)) {
+ // Trying to match `t1 <: A` succeeded. If it recorded constraints,
+ // those are the constraints we want. If it didn't, then there's no
+ // way we're going to get any constraints. So either way, we want to
+ // return `true` since the match suceeded and the constraints we want
+ // (if any) have been recorded.
+ return true;
+ } else {
+ // Trying to match `t1 <: A` failed. So there's no way we are going
+ // to get any constraints. Just return `success` to indicate whether
+ // the match succeeded.
+ return success;
+ }
+ }
+ }
+
+ // S <: T where S is a type variable
+ // T is not dynamic or object (handled above)
+ // True if T == S
+ // Or true if bound of S is S' and S' <: T
+
+ if (t1 is TypeParameterType) {
+ // Guard against recursive type parameters
+ //
+ // TODO(jmesserly): this function isn't guarding against anything (it's
+ // not passsing down `visitedSet`, so adding the element has no effect).
+ bool guardedSubtype(DartType t1, DartType t2) {
+ var visitedSet = visited ?? new HashSet<Element>();
+ if (visitedSet.add(t1.element)) {
+ bool matched = matchSubtype(t1, t2);
+ visitedSet.remove(t1.element);
+ return matched;
+ } else {
+ // In the case of a recursive type parameter, consider the subtype
+ // match to have failed.
+ return false;
+ }
+ }
+
+ if (t2 is TypeParameterType && t1.definition == t2.definition) {
+ return guardedSubtype(t1.bound, t2.bound);
+ }
+ return guardedSubtype(t1.bound, t2);
+ }
+ if (t2 is TypeParameterType) {
+ return false;
+ }
+
+ if (_isBottom(t1) || _isTop(t2)) return true;
+
+ if (t1 is InterfaceType && t2 is InterfaceType) {
+ return _matchInterfaceSubtypeOf(t1, t2, visited, origin,
+ covariant: covariant);
+ }
+
+ if (t1 is FunctionType && t2 is FunctionType) {
+ return FunctionTypeImpl.relate(
+ t1,
+ t2,
+ (t1, t2) {
+ // TODO(jmesserly): should we flip covariance when we're relating
+ // type formal bounds? They're more like parameters.
+ return matchSubtype(t1, t2);
+ },
+ _typeSystem.instantiateToBounds,
+ parameterRelation: (p1, p2) {
+ return _matchSubtypeOf(p2.type, p1.type, null, origin,
+ covariant: !covariant);
+ });
+ }
+
+ if (t1 is FunctionType && t2 == typeProvider.functionType) {
+ return true;
+ }
+
+ return false;
+ }
+
+ /// Un-does constraints that were gathered by a failed match attempt, until
+ /// [_undoBuffer] has length [previousRewindBufferLength].
+ ///
+ /// The intended usage is that the caller should record the length of
+ /// [_undoBuffer] before attempting to make a match. Then, if the match
+ /// fails, pass the recorded length to this method to erase any constraints
+ /// that were recorded during the failed match.
+ void _rewindConstraints(int previousRewindBufferLength) {
+ while (_undoBuffer.length > previousRewindBufferLength) {
+ var constraint = _undoBuffer.removeLast();
+ var element = constraint.typeParameter.element;
+ assert(identical(constraints[element].last, constraint));
+ constraints[element].removeLast();
+ }
+ }
+
+ static String _formatConstraints(Iterable<_TypeConstraint> constraints) {
+ List<List<String>> lineParts =
+ new Set<_TypeConstraintOrigin>.from(constraints.map((c) => c.origin))
+ .map((o) => o.formatError())
+ .toList();
+
+ int prefixMax = lineParts.map((p) => p[0].length).fold(0, math.max);
+
+ // Use a set to prevent identical message lines.
+ // (It's not uncommon for the same constraint to show up in a few places.)
+ var messageLines = new Set<String>.from(lineParts.map((parts) {
+ var prefix = parts[0];
+ var middle = parts[1];
+ var prefixPad = ' ' * (prefixMax - prefix.length);
+ var middlePad = ' ' * (prefixMax);
+ var end = "";
+ if (parts.length > 2) {
+ end = '\n $middlePad ${parts[2]}';
+ }
+ return ' $prefix$prefixPad $middle$end';
+ }));
+
+ return messageLines.join('\n');
+ }
+}
+
/**
* Implementation of [TypeSystem] using the strong mode rules.
* https://github.com/dart-lang/dev_compiler/blob/master/STRONG_MODE.md
@@ -99,20 +745,6 @@
@override
bool get isStrong => true;
- bool anyParameterType(FunctionType ft, bool predicate(DartType t)) {
- return ft.parameters.any((p) => predicate(p.type));
- }
-
- /// Given a type t, if t is an interface type with a call method
- /// defined, return the function type for the call method, otherwise
- /// return null.
- FunctionType getCallMethodType(DartType t) {
- if (t is InterfaceType) {
- return t.lookUpInheritedMethod("call")?.type;
- }
- return null;
- }
-
/// Returns true iff the type [t] accepts function types, and requires an
/// implicit coercion if interface types with a `call` method are passed in.
///
@@ -130,6 +762,20 @@
return t is FunctionType || t.isDartCoreFunction;
}
+ bool anyParameterType(FunctionType ft, bool predicate(DartType t)) {
+ return ft.parameters.any((p) => predicate(p.type));
+ }
+
+ /// Given a type t, if t is an interface type with a call method
+ /// defined, return the function type for the call method, otherwise
+ /// return null.
+ FunctionType getCallMethodType(DartType t) {
+ if (t is InterfaceType) {
+ return t.lookUpInheritedMethod("call")?.type;
+ }
+ return null;
+ }
+
/// Computes the greatest lower bound of [type1] and [type2].
DartType getGreatestLowerBound(DartType type1, DartType type2) {
// The greatest lower bound relation is reflexive.
@@ -233,7 +879,7 @@
// inferred. It will optimistically assume these type parameters can be
// subtypes (or supertypes) as necessary, and track the constraints that
// are implied by this.
- var inferrer = new _GenericInferrer(typeProvider, this, fnType.typeFormals);
+ var inferrer = new GenericInferrer(typeProvider, this, fnType.typeFormals);
inferrer.constrainGenericFunctionInContext(fnType, contextType);
// Infer and instantiate the resulting type.
@@ -280,7 +926,7 @@
// inferred. It will optimistically assume these type parameters can be
// subtypes (or supertypes) as necessary, and track the constraints that
// are implied by this.
- var inferrer = new _GenericInferrer(typeProvider, this, typeFormals);
+ var inferrer = new GenericInferrer(typeProvider, this, typeFormals);
DartType declaredReturnType =
genericType is FunctionType ? genericType.returnType : genericType;
@@ -549,6 +1195,91 @@
p1.isCovariant && isSubtypeOf(p1.type, p2.type);
}
+ @override
+ bool isSubtypeOf(DartType t1, DartType t2) {
+ if (identical(t1, t2)) {
+ return true;
+ }
+
+ // The types are void, dynamic, bottom, interface types, function types,
+ // FutureOr<T> and type parameters.
+ //
+ // We proceed by eliminating these different classes from consideration.
+
+ // Trivially true.
+ //
+ // Note that `?` is treated as a top and a bottom type during inference,
+ // so it's also covered here.
+ if (_isTop(t2) || _isBottom(t1)) {
+ return true;
+ }
+
+ // Trivially false.
+ if (_isTop(t1) || _isBottom(t2)) {
+ return false;
+ }
+
+ // Handle FutureOr<T> union type.
+ if (t1 is InterfaceType && t1.isDartAsyncFutureOr) {
+ var t1TypeArg = t1.typeArguments[0];
+ if (t2 is InterfaceType && t2.isDartAsyncFutureOr) {
+ var t2TypeArg = t2.typeArguments[0];
+ // FutureOr<A> <: FutureOr<B> iff A <: B
+ return isSubtypeOf(t1TypeArg, t2TypeArg);
+ }
+
+ // given t1 is Future<A> | A, then:
+ // (Future<A> | A) <: t2 iff Future<A> <: t2 and A <: t2.
+ var t1Future = typeProvider.futureType.instantiate([t1TypeArg]);
+ return isSubtypeOf(t1Future, t2) && isSubtypeOf(t1TypeArg, t2);
+ }
+
+ if (t2 is InterfaceType && t2.isDartAsyncFutureOr) {
+ // given t2 is Future<A> | A, then:
+ // t1 <: (Future<A> | A) iff t1 <: Future<A> or t1 <: A
+ var t2TypeArg = t2.typeArguments[0];
+ var t2Future = typeProvider.futureType.instantiate([t2TypeArg]);
+ return isSubtypeOf(t1, t2Future) || isSubtypeOf(t1, t2TypeArg);
+ }
+
+ // S <: T where S is a type variable
+ // T is not dynamic or object (handled above)
+ // True if T == S
+ // Or true if bound of S is S' and S' <: T
+ if (t1 is TypeParameterType) {
+ if (t2 is TypeParameterType &&
+ t1.definition == t2.definition &&
+ _typeParameterBoundsSubtype(t1.bound, t2.bound, true)) {
+ return true;
+ }
+ DartType bound = t1.element.bound;
+ return bound == null
+ ? false
+ : _typeParameterBoundsSubtype(bound, t2, false);
+ }
+ if (t2 is TypeParameterType) {
+ return false;
+ }
+
+ // We've eliminated void, dynamic, bottom, type parameters, and FutureOr.
+ // The only cases are the combinations of interface type and function type.
+
+ // A function type can only subtype an interface type if
+ // the interface type is Function
+ if (t1 is FunctionType && t2 is InterfaceType) {
+ return t2.isDartCoreFunction;
+ }
+
+ if (t1 is InterfaceType && t2 is FunctionType) return false;
+
+ // Two interface types
+ if (t1 is InterfaceType && t2 is InterfaceType) {
+ return _isInterfaceSubtypeOf(t1, t2, null);
+ }
+
+ return _isFunctionSubtypeOf(t1, t2);
+ }
+
/// Given a [type] T that may have an unknown type `?`, returns a type
/// R such that R <: T for any type substituted for `?`.
///
@@ -856,91 +1587,6 @@
return false;
}
- @override
- bool isSubtypeOf(DartType t1, DartType t2) {
- if (identical(t1, t2)) {
- return true;
- }
-
- // The types are void, dynamic, bottom, interface types, function types,
- // FutureOr<T> and type parameters.
- //
- // We proceed by eliminating these different classes from consideration.
-
- // Trivially true.
- //
- // Note that `?` is treated as a top and a bottom type during inference,
- // so it's also covered here.
- if (_isTop(t2) || _isBottom(t1)) {
- return true;
- }
-
- // Trivially false.
- if (_isTop(t1) || _isBottom(t2)) {
- return false;
- }
-
- // Handle FutureOr<T> union type.
- if (t1 is InterfaceType && t1.isDartAsyncFutureOr) {
- var t1TypeArg = t1.typeArguments[0];
- if (t2 is InterfaceType && t2.isDartAsyncFutureOr) {
- var t2TypeArg = t2.typeArguments[0];
- // FutureOr<A> <: FutureOr<B> iff A <: B
- return isSubtypeOf(t1TypeArg, t2TypeArg);
- }
-
- // given t1 is Future<A> | A, then:
- // (Future<A> | A) <: t2 iff Future<A> <: t2 and A <: t2.
- var t1Future = typeProvider.futureType.instantiate([t1TypeArg]);
- return isSubtypeOf(t1Future, t2) && isSubtypeOf(t1TypeArg, t2);
- }
-
- if (t2 is InterfaceType && t2.isDartAsyncFutureOr) {
- // given t2 is Future<A> | A, then:
- // t1 <: (Future<A> | A) iff t1 <: Future<A> or t1 <: A
- var t2TypeArg = t2.typeArguments[0];
- var t2Future = typeProvider.futureType.instantiate([t2TypeArg]);
- return isSubtypeOf(t1, t2Future) || isSubtypeOf(t1, t2TypeArg);
- }
-
- // S <: T where S is a type variable
- // T is not dynamic or object (handled above)
- // True if T == S
- // Or true if bound of S is S' and S' <: T
- if (t1 is TypeParameterType) {
- if (t2 is TypeParameterType &&
- t1.definition == t2.definition &&
- _typeParameterBoundsSubtype(t1.bound, t2.bound, true)) {
- return true;
- }
- DartType bound = t1.element.bound;
- return bound == null
- ? false
- : _typeParameterBoundsSubtype(bound, t2, false);
- }
- if (t2 is TypeParameterType) {
- return false;
- }
-
- // We've eliminated void, dynamic, bottom, type parameters, and FutureOr.
- // The only cases are the combinations of interface type and function type.
-
- // A function type can only subtype an interface type if
- // the interface type is Function
- if (t1 is FunctionType && t2 is InterfaceType) {
- return t2.isDartCoreFunction;
- }
-
- if (t1 is InterfaceType && t2 is FunctionType) return false;
-
- // Two interface types
- if (t1 is InterfaceType && t2 is InterfaceType) {
- return _isInterfaceSubtypeOf(t1, t2, null);
- }
-
- return _isFunctionSubtypeOf(t1, t2);
- }
-
DartType _substituteForUnknownType(DartType type, {bool lowerBound: false}) {
if (identical(type, UnknownInferredType.instance)) {
if (lowerBound) {
@@ -1231,7 +1877,7 @@
InterfaceType matchSupertypeConstraints(
ClassElement mixinElement, List<DartType> srcs, List<DartType> dests) {
var typeParameters = mixinElement.typeParameters;
- var inferrer = new _GenericInferrer(typeProvider, this, typeParameters);
+ var inferrer = new GenericInferrer(typeProvider, this, typeParameters);
for (int i = 0; i < srcs.length; i++) {
inferrer.constrainReturnType(srcs[i], dests[i]);
inferrer.constrainReturnType(dests[i], srcs[i]);
@@ -1659,575 +2305,6 @@
T accept<T>(ElementVisitor visitor) => null;
}
-/// Tracks upper and lower type bounds for a set of type parameters.
-///
-/// This class is used by calling [isSubtypeOf]. When it encounters one of
-/// the type parameters it is inferring, it will record the constraint, and
-/// optimistically assume the constraint will be satisfied.
-///
-/// For example if we are inferring type parameter A, and we ask if
-/// `A <: num`, this will record that A must be a subytpe of `num`. It also
-/// handles cases when A appears as part of the structure of another type, for
-/// example `Iterable<A> <: Iterable<num>` would infer the same constraint
-/// (due to covariant generic types) as would `() -> A <: () -> num`. In
-/// contrast `(A) -> void <: (num) -> void`.
-///
-/// Once the lower/upper bounds are determined, [infer] should be called to
-/// finish the inference. It will instantiate a generic function type with the
-/// inferred types for each type parameter.
-///
-/// It can also optionally compute a partial solution, in case some of the type
-/// parameters could not be inferred (because the constraints cannot be
-/// satisfied), or bail on the inference when this happens.
-///
-/// As currently designed, an instance of this class should only be used to
-/// infer a single call and discarded immediately afterwards.
-class _GenericInferrer {
- final StrongTypeSystemImpl _typeSystem;
- final TypeProvider typeProvider;
- final Map<TypeParameterElement, List<_TypeConstraint>> _constraints;
-
- /// Counter internally by [_matchSubtypeOf] to see if a recursive call
- /// added anything to [_constraints].
- ///
- /// Essentially just an optimization for:
- /// `_constraints.values.expand((x) => x).length`
- int _constraintCount = 0;
-
- _GenericInferrer(this.typeProvider, this._typeSystem,
- Iterable<TypeParameterElement> typeFormals)
- : _constraints = new HashMap(
- equals: (x, y) => x.location == y.location,
- hashCode: (x) => x.location.hashCode) {
- for (var formal in typeFormals) {
- _constraints[formal] = [];
- }
- }
-
- /// Apply an argument constraint, which asserts that the [argument] staticType
- /// is a subtype of the [parameterType].
- void constrainArgument(
- DartType argumentType, DartType parameterType, String parameterName,
- {DartType genericType}) {
- var origin = new _TypeConstraintFromArgument(
- argumentType, parameterType, parameterName,
- genericType: genericType);
- _matchSubtypeOf(argumentType, parameterType, null, origin,
- covariant: false);
- }
-
- /// Constrain a universal function type [fnType] used in a context
- /// [contextType].
- void constrainGenericFunctionInContext(
- FunctionType fnType, DartType contextType) {
- var origin = new _TypeConstraintFromFunctionContext(fnType, contextType);
-
- // Since we're trying to infer the instantiation, we want to ignore type
- // formals as we check the parameters and return type.
- var inferFnType =
- fnType.instantiate(TypeParameterTypeImpl.getTypes(fnType.typeFormals));
- _matchSubtypeOf(inferFnType, contextType, null, origin, covariant: true);
- }
-
- /// Apply a return type constraint, which asserts that the [declaredType]
- /// is a subtype of the [contextType].
- void constrainReturnType(DartType declaredType, DartType contextType) {
- var origin = new _TypeConstraintFromReturnType(declaredType, contextType);
- _matchSubtypeOf(declaredType, contextType, null, origin, covariant: true);
- }
-
- /// Given the constraints that were given by calling [isSubtypeOf], find the
- /// instantiation of the generic function that satisfies these constraints.
- ///
- /// If [downwardsInferPhase] is set, we are in the first pass of inference,
- /// pushing context types down. At that point we are allowed to push down
- /// `?` to precisely represent an unknown type. If [downwardsInferPhase] is
- /// false, we are on our final inference pass, have all available information
- /// including argument types, and must not conclude `?` for any type formal.
- T infer<T extends ParameterizedType>(
- T genericType, List<TypeParameterElement> typeFormals,
- {bool considerExtendsClause: true,
- ErrorReporter errorReporter,
- AstNode errorNode,
- bool downwardsInferPhase: false}) {
- var fnTypeParams = TypeParameterTypeImpl.getTypes(typeFormals);
-
- // Initialize the inferred type array.
- //
- // In the downwards phase, they all start as `?` to offer reasonable
- // degradation for f-bounded type parameters.
- var inferredTypes = new List<DartType>.filled(
- fnTypeParams.length, UnknownInferredType.instance);
- var _inferTypeParameter = downwardsInferPhase
- ? _inferTypeParameterFromContext
- : _inferTypeParameterFromAll;
-
- for (int i = 0; i < fnTypeParams.length; i++) {
- TypeParameterType typeParam = fnTypeParams[i];
-
- var typeParamBound = typeParam.bound;
- _TypeConstraint extendsClause;
- if (considerExtendsClause && !typeParamBound.isDynamic) {
- extendsClause = new _TypeConstraint.fromExtends(typeParam,
- typeParam.bound.substitute2(inferredTypes, fnTypeParams));
- }
-
- var constraints = _constraints[typeParam.element];
- inferredTypes[i] = _inferTypeParameter(constraints, extendsClause);
- }
-
- // If the downwards infer phase has failed, we'll catch this in the upwards
- // phase later on.
- if (downwardsInferPhase) {
- return genericType.instantiate(inferredTypes) as T;
- }
-
- // Check the inferred types against all of the constraints.
- var knownTypes = new HashMap<TypeParameterType, DartType>(
- equals: (x, y) => x.element == y.element,
- hashCode: (x) => x.element.hashCode);
- for (int i = 0; i < fnTypeParams.length; i++) {
- TypeParameterType typeParam = fnTypeParams[i];
- var constraints = _constraints[typeParam.element];
- var typeParamBound =
- typeParam.bound.substitute2(inferredTypes, fnTypeParams);
-
- var inferred = inferredTypes[i];
- bool success =
- constraints.every((c) => c.isSatisifedBy(_typeSystem, inferred));
- if (success && !typeParamBound.isDynamic) {
- // If everything else succeeded, check the `extends` constraint.
- var extendsConstraint =
- new _TypeConstraint.fromExtends(typeParam, typeParamBound);
- constraints.add(extendsConstraint);
- success = extendsConstraint.isSatisifedBy(_typeSystem, inferred);
- }
-
- if (!success) {
- errorReporter?.reportErrorForNode(
- StrongModeCode.COULD_NOT_INFER,
- errorNode,
- [typeParam, _formatError(typeParam, inferred, constraints)]);
-
- // Heuristic: even if we failed, keep the erroneous type.
- // It should satisfy at least some of the constraints (e.g. the return
- // context). If we fall back to instantiateToBounds, we'll typically get
- // more errors (e.g. because `dynamic` is the most common bound).
- }
-
- if (UnknownInferredType.isKnown(inferred)) {
- knownTypes[typeParam] = inferred;
- }
- }
-
- // Use instantiate to bounds to finish things off.
- var hasError = new List<bool>.filled(fnTypeParams.length, false);
- var result = _typeSystem.instantiateToBounds(genericType,
- hasError: hasError, knownTypes: knownTypes) as T;
-
- // Report any errors from instantiateToBounds.
- for (int i = 0; i < hasError.length; i++) {
- if (hasError[i]) {
- TypeParameterType typeParam = fnTypeParams[i];
- var typeParamBound =
- typeParam.bound.substitute2(inferredTypes, fnTypeParams);
- // TODO(jmesserly): improve this error message.
- errorReporter
- ?.reportErrorForNode(StrongModeCode.COULD_NOT_INFER, errorNode, [
- typeParam,
- "\nRecursive bound cannot be instantiated: '$typeParamBound'."
- "\nConsider passing explicit type argument(s) "
- "to the generic.\n\n'"
- ]);
- }
- }
- return result;
- }
-
- /// Choose the bound that was implied by the return type, if any.
- ///
- /// Which bound this is depends on what positions the type parameter
- /// appears in. If the type only appears only in a contravariant position,
- /// we will choose the lower bound instead.
- ///
- /// For example given:
- ///
- /// Func1<T, bool> makeComparer<T>(T x) => (T y) => x() == y;
- ///
- /// main() {
- /// Func1<num, bool> t = makeComparer/* infer <num> */(42);
- /// print(t(42.0)); /// false, no error.
- /// }
- ///
- /// The constraints we collect are:
- ///
- /// * `num <: T`
- /// * `int <: T`
- ///
- /// ... and no upper bound. Therefore the lower bound is the best choice.
- DartType _chooseTypeFromConstraints(Iterable<_TypeConstraint> constraints,
- {bool toKnownType: false}) {
- DartType lower = UnknownInferredType.instance;
- DartType upper = UnknownInferredType.instance;
- for (var constraint in constraints) {
- // Given constraints:
- //
- // L1 <: T <: U1
- // L2 <: T <: U2
- //
- // These can be combined to produce:
- //
- // LUB(L1, L2) <: T <: GLB(U1, U2).
- //
- // This can then be done for all constraints in sequence.
- //
- // This resulting constraint may be unsatisfiable; in that case inference
- // will fail.
- upper = _getGreatestLowerBound(upper, constraint.upperBound);
- lower = _typeSystem.getLeastUpperBound(lower, constraint.lowerBound);
- }
-
- // Prefer the known bound, if any.
- // Otherwise take whatever bound has partial information, e.g. `Iterable<?>`
- //
- // For both of those, prefer the lower bound (arbitrary heuristic).
- if (UnknownInferredType.isKnown(lower)) {
- return lower;
- }
- if (UnknownInferredType.isKnown(upper)) {
- return upper;
- }
- if (!identical(UnknownInferredType.instance, lower)) {
- return toKnownType ? _typeSystem.lowerBoundForType(lower) : lower;
- }
- if (!identical(UnknownInferredType.instance, upper)) {
- return toKnownType ? _typeSystem.upperBoundForType(upper) : upper;
- }
- return lower;
- }
-
- String _formatError(TypeParameterType typeParam, DartType inferred,
- Iterable<_TypeConstraint> constraints) {
- var intro = "Tried to infer '$inferred' for '$typeParam'"
- " which doesn't work:";
-
- var constraintsByOrigin = <_TypeConstraintOrigin, List<_TypeConstraint>>{};
- for (var c in constraints) {
- constraintsByOrigin.putIfAbsent(c.origin, () => []).add(c);
- }
-
- // Only report unique constraint origins.
- Iterable<_TypeConstraint> isSatisified(bool expected) => constraintsByOrigin
- .values
- .where((l) =>
- l.every((c) => c.isSatisifedBy(_typeSystem, inferred)) == expected)
- .expand((i) => i);
-
- String unsatisified = _formatConstraints(isSatisified(false));
- String satisified = _formatConstraints(isSatisified(true));
-
- assert(unsatisified.isNotEmpty);
- if (satisified.isNotEmpty) {
- satisified = "\nThe type '$inferred' was inferred from:\n$satisified";
- }
-
- return '\n\n$intro\n$unsatisified$satisified\n\n'
- 'Consider passing explicit type argument(s) to the generic.\n\n';
- }
-
- /// This is first calls strong mode's GLB, but if it fails to find anything
- /// (i.e. returns the bottom type), we kick in a few additional rules:
- ///
- /// - `GLB(FutureOr<A>, B)` is defined as:
- /// - `GLB(FutureOr<A>, FutureOr<B>) == FutureOr<GLB(A, B)>`
- /// - `GLB(FutureOr<A>, Future<B>) == Future<GLB(A, B)>`
- /// - else `GLB(FutureOr<A>, B) == GLB(A, B)`
- /// - `GLB(A, FutureOr<B>) == GLB(FutureOr<A>, B)` (defined above),
- /// - else `GLB(A, B) == Null`
- DartType _getGreatestLowerBound(DartType t1, DartType t2) {
- var result = _typeSystem.getGreatestLowerBound(t1, t2);
- if (result.isBottom) {
- // See if we can do better by considering FutureOr rules.
- if (t1 is InterfaceType && t1.isDartAsyncFutureOr) {
- var t1TypeArg = t1.typeArguments[0];
- if (t2 is InterfaceType) {
- // GLB(FutureOr<A>, FutureOr<B>) == FutureOr<GLB(A, B)>
- if (t2.isDartAsyncFutureOr) {
- var t2TypeArg = t2.typeArguments[0];
- return typeProvider.futureOrType
- .instantiate([_getGreatestLowerBound(t1TypeArg, t2TypeArg)]);
- }
- // GLB(FutureOr<A>, Future<B>) == Future<GLB(A, B)>
- if (t2.isDartAsyncFuture) {
- var t2TypeArg = t2.typeArguments[0];
- return typeProvider.futureType
- .instantiate([_getGreatestLowerBound(t1TypeArg, t2TypeArg)]);
- }
- }
- // GLB(FutureOr<A>, B) == GLB(A, B)
- return _getGreatestLowerBound(t1TypeArg, t2);
- }
- if (t2 is InterfaceType && t2.isDartAsyncFutureOr) {
- // GLB(A, FutureOr<B>) == GLB(FutureOr<A>, B)
- return _getGreatestLowerBound(t2, t1);
- }
- // TODO(jmesserly): fix this rule once we support non-nullable types.
- return typeProvider.nullType;
- }
- return result;
- }
-
- DartType _inferTypeParameterFromAll(
- List<_TypeConstraint> constraints, _TypeConstraint extendsClause) {
- // See if we already fixed this type from downwards inference.
- // If so, then we aren't allowed to change it based on argument types.
- DartType t = _inferTypeParameterFromContext(
- constraints.where((c) => c.isDownwards), extendsClause);
- if (UnknownInferredType.isKnown(t)) {
- // Remove constraints that aren't downward ones; we'll ignore these for
- // error reporting, because inference already succeeded.
- constraints.removeWhere((c) => !c.isDownwards);
- return t;
- }
-
- if (extendsClause != null) {
- constraints = constraints.toList()..add(extendsClause);
- }
-
- var choice = _chooseTypeFromConstraints(constraints, toKnownType: true);
- return choice;
- }
-
- DartType _inferTypeParameterFromContext(
- Iterable<_TypeConstraint> constraints, _TypeConstraint extendsClause) {
- DartType t = _chooseTypeFromConstraints(constraints);
- if (UnknownInferredType.isUnknown(t)) {
- return t;
- }
-
- // If we're about to make our final choice, apply the extends clause.
- // This gives us a chance to refine the choice, in case it would violate
- // the `extends` clause. For example:
- //
- // Object obj = math.min/*<infer Object, error>*/(1, 2);
- //
- // If we consider the `T extends num` we conclude `<num>`, which works.
- if (extendsClause != null) {
- constraints = constraints.toList()..add(extendsClause);
- return _chooseTypeFromConstraints(constraints);
- }
- return t;
- }
-
- void _matchInterfaceSubtypeOf(InterfaceType i1, InterfaceType i2,
- Set<Element> visited, _TypeConstraintOrigin origin,
- {bool covariant}) {
- if (identical(i1, i2)) {
- return;
- }
-
- if (i1.element == i2.element) {
- List<DartType> tArgs1 = i1.typeArguments;
- List<DartType> tArgs2 = i2.typeArguments;
- assert(tArgs1.length == tArgs2.length);
- for (int i = 0; i < tArgs1.length; i++) {
- _matchSubtypeOf(tArgs1[i], tArgs2[i], visited, origin,
- covariant: covariant);
- }
- return;
- }
- if (i1.isObject) {
- return;
- }
-
- // Guard against loops in the class hierarchy
- //
- // TODO(jmesserly): this function isn't guarding against anything (it's not
- // passsing down `visitedSet`, so adding the element has no effect).
- //
- // If that's fixed, it breaks inference tests for types like
- // `Iterable<Iterable<?>>` matched aganinst `List<List<int>>`.
- //
- // The fix is for type arguments (above) to not pass down `visited`, similar
- // to how _isInterfaceSubtypeOf does not pass down `visited` for type
- // arguments.
- void guardedInterfaceSubtype(InterfaceType t1) {
- var visitedSet = visited ?? new HashSet<Element>();
- if (visitedSet.add(t1.element)) {
- _matchInterfaceSubtypeOf(t1, i2, visited, origin, covariant: covariant);
- visitedSet.remove(t1.element);
- }
- }
-
- guardedInterfaceSubtype(i1.superclass);
- for (final parent in i1.interfaces) {
- guardedInterfaceSubtype(parent);
- }
- for (final parent in i1.mixins) {
- guardedInterfaceSubtype(parent);
- }
- }
-
- /// Assert that [t1] will be a subtype of [t2], and returns if the constraint
- /// can be satisfied.
- ///
- /// [covariant] must be true if [t1] is a declared type of the generic
- /// function and [t2] is the context type, or false if the reverse. For
- /// example [covariant] is used when [t1] is the declared return type
- /// and [t2] is the context type. Contravariant would be used if [t1] is the
- /// argument type (i.e. passed in to the generic function) and [t2] is the
- /// declared parameter type.
- ///
- /// [origin] indicates where the constraint came from, for example an argument
- /// or return type.
- void _matchSubtypeOf(DartType t1, DartType t2, Set<Element> visited,
- _TypeConstraintOrigin origin,
- {bool covariant}) {
- if (covariant && t1 is TypeParameterType) {
- var constraints = _constraints[t1.element];
- if (constraints != null) {
- if (!identical(t2, UnknownInferredType.instance)) {
- constraints.add(new _TypeConstraint(origin, t1, upper: t2));
- _constraintCount++;
- }
- return;
- }
- }
- if (!covariant && t2 is TypeParameterType) {
- var constraints = _constraints[t2.element];
- if (constraints != null) {
- if (!identical(t1, UnknownInferredType.instance)) {
- constraints.add(new _TypeConstraint(origin, t2, lower: t1));
- _constraintCount++;
- }
- return;
- }
- }
-
- if (identical(t1, t2)) {
- return;
- }
-
- // TODO(jmesserly): this logic is taken from subtype.
- void matchSubtype(DartType t1, DartType t2) {
- _matchSubtypeOf(t1, t2, null, origin, covariant: covariant);
- }
-
- // Handle FutureOr<T> union type.
- if (t1 is InterfaceType && t1.isDartAsyncFutureOr) {
- var t1TypeArg = t1.typeArguments[0];
- if (t2 is InterfaceType && t2.isDartAsyncFutureOr) {
- var t2TypeArg = t2.typeArguments[0];
- // FutureOr<A> <: FutureOr<B> iff A <: B
- matchSubtype(t1TypeArg, t2TypeArg);
- return;
- }
-
- // given t1 is Future<A> | A, then:
- // (Future<A> | A) <: t2 iff Future<A> <: t2 and A <: t2.
- var t1Future = typeProvider.futureType.instantiate([t1TypeArg]);
- matchSubtype(t1Future, t2);
- matchSubtype(t1TypeArg, t2);
- return;
- }
-
- if (t2 is InterfaceType && t2.isDartAsyncFutureOr) {
- // given t2 is Future<A> | A, then:
- // t1 <: (Future<A> | A) iff t1 <: Future<A> or t1 <: A
- var t2TypeArg = t2.typeArguments[0];
- var t2Future = typeProvider.futureType.instantiate([t2TypeArg]);
-
- int constraintCount = _constraintCount;
- matchSubtype(t1, t2Future);
-
- // We only want to record these as "or" constraints, so if we matched
- // the `t1 <: Future<A>` constraint, don't add `t1 <: A` constraint, as
- // that would be interpreted incorrectly as `t1 <: Future<A> && t1 <: A`.
- if (constraintCount == _constraintCount) {
- matchSubtype(t1, t2TypeArg);
- }
- return;
- }
-
- // S <: T where S is a type variable
- // T is not dynamic or object (handled above)
- // True if T == S
- // Or true if bound of S is S' and S' <: T
-
- if (t1 is TypeParameterType) {
- // Guard against recursive type parameters
- //
- // TODO(jmesserly): this function isn't guarding against anything (it's
- // not passsing down `visitedSet`, so adding the element has no effect).
- void guardedSubtype(DartType t1, DartType t2) {
- var visitedSet = visited ?? new HashSet<Element>();
- if (visitedSet.add(t1.element)) {
- matchSubtype(t1, t2);
- visitedSet.remove(t1.element);
- }
- }
-
- if (t2 is TypeParameterType && t1.definition == t2.definition) {
- guardedSubtype(t1.bound, t2.bound);
- return;
- }
- guardedSubtype(t1.bound, t2);
- return;
- }
- if (t2 is TypeParameterType) {
- return;
- }
-
- if (t1 is InterfaceType && t2 is InterfaceType) {
- _matchInterfaceSubtypeOf(t1, t2, visited, origin, covariant: covariant);
- return;
- }
-
- if (t1 is FunctionType && t2 is FunctionType) {
- FunctionTypeImpl.relate(
- t1,
- t2,
- (t1, t2) {
- // TODO(jmesserly): should we flip covariance when we're relating
- // type formal bounds? They're more like parameters.
- matchSubtype(t1, t2);
- return true;
- },
- _typeSystem.instantiateToBounds,
- parameterRelation: (p1, p2) {
- _matchSubtypeOf(p2.type, p1.type, null, origin,
- covariant: !covariant);
- return true;
- });
- }
- }
-
- static String _formatConstraints(Iterable<_TypeConstraint> constraints) {
- List<List<String>> lineParts =
- new Set<_TypeConstraintOrigin>.from(constraints.map((c) => c.origin))
- .map((o) => o.formatError())
- .toList();
-
- int prefixMax = lineParts.map((p) => p[0].length).fold(0, math.max);
-
- // Use a set to prevent identical message lines.
- // (It's not uncommon for the same constraint to show up in a few places.)
- var messageLines = new Set<String>.from(lineParts.map((parts) {
- var prefix = parts[0];
- var middle = parts[1];
- var prefixPad = ' ' * (prefixMax - prefix.length);
- var middlePad = ' ' * (prefixMax);
- var end = "";
- if (parts.length > 2) {
- end = '\n $middlePad ${parts[2]}';
- }
- return ' $prefix$prefixPad $middle$end';
- }));
-
- return messageLines.join('\n');
- }
-}
-
/// A constraint on a type parameter that we're inferring.
class _TypeConstraint extends _TypeRange {
/// The type parameter that is constrained by [lowerBound] or [upperBound].
@@ -2393,4 +2470,22 @@
_TypeRange({DartType lower, DartType upper})
: lowerBound = lower ?? UnknownInferredType.instance,
upperBound = upper ?? UnknownInferredType.instance;
+
+ /// Formats the typeRange as a string suitable for unit testing.
+ ///
+ /// For example, if [typeName] is 'T' and the range has bounds int and Object
+ /// respectively, the returned string will be 'int <: T <: Object'.
+ @visibleForTesting
+ String format(String typeName) {
+ var lowerString = identical(lowerBound, UnknownInferredType.instance)
+ ? ''
+ : '$lowerBound <: ';
+ var upperString = identical(upperBound, UnknownInferredType.instance)
+ ? ''
+ : ' <: $upperBound';
+ return '$lowerString$typeName$upperString';
+ }
+
+ @override
+ String toString() => format('(type)');
}
diff --git a/pkg/analyzer/test/generated/parser_forest_test.dart b/pkg/analyzer/test/generated/parser_forest_test.dart
new file mode 100644
index 0000000..7b9bc03
--- /dev/null
+++ b/pkg/analyzer/test/generated/parser_forest_test.dart
@@ -0,0 +1,1291 @@
+// 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:async';
+import 'dart:io' show File;
+
+import 'package:analyzer/dart/ast/ast.dart';
+import 'package:analyzer/src/fasta/ast_building_factory.dart';
+import "package:front_end/src/api_prototype/front_end.dart";
+import "package:front_end/src/api_prototype/memory_file_system.dart";
+import "package:front_end/src/base/processed_options.dart";
+import "package:front_end/src/compute_platform_binaries_location.dart";
+import 'package:front_end/src/fasta/compiler_context.dart';
+import 'package:front_end/src/fasta/constant_context.dart';
+import 'package:front_end/src/fasta/dill/built_type_builder.dart';
+import 'package:front_end/src/fasta/dill/dill_target.dart';
+import "package:front_end/src/fasta/fasta_codes.dart";
+import 'package:front_end/src/fasta/kernel/body_builder.dart';
+import 'package:front_end/src/fasta/kernel/forest.dart';
+import 'package:front_end/src/fasta/kernel/kernel_builder.dart';
+import "package:front_end/src/fasta/kernel/kernel_target.dart";
+import 'package:front_end/src/fasta/modifier.dart' as Modifier;
+import 'package:front_end/src/fasta/parser/parser.dart';
+import 'package:front_end/src/fasta/scanner.dart';
+import 'package:front_end/src/fasta/ticker.dart';
+import 'package:front_end/src/fasta/type_inference/type_inferrer.dart';
+import 'package:front_end/src/fasta/type_inference/type_schema_environment.dart';
+import 'package:front_end/src/fasta/uri_translator_impl.dart';
+import 'package:front_end/src/scanner/token.dart';
+import 'package:kernel/class_hierarchy.dart' as kernel;
+import 'package:kernel/core_types.dart' as kernel;
+import 'package:kernel/kernel.dart' as kernel;
+import 'package:test/test.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
+
+import 'parser_test.dart';
+
+main() async {
+ defineReflectiveSuite(() {
+ defineReflectiveTests(ExpressionParserTest_Forest);
+ });
+}
+
+/**
+ * Tests of the fasta parser based on [ExpressionParserTestMixin].
+ */
+@reflectiveTest
+class ExpressionParserTest_Forest extends FastaParserTestCase
+ with ExpressionParserTestMixin {
+ @failingTest
+ void test_1_plus_2() {
+ Expression expression = parseAdditiveExpression('1 + 2');
+ expect(expression, isNotNull);
+ assertNoErrors();
+ var binaryExpression = expression as BinaryExpression;
+ expect(binaryExpression.leftOperand, isNotNull);
+ expect(binaryExpression.operator, isNotNull);
+ expect(binaryExpression.operator.type, TokenType.PLUS);
+ expect(binaryExpression.rightOperand, isNotNull);
+ }
+
+ @failingTest
+ void test_namedArgument() {
+ super.test_namedArgument();
+ }
+
+ @failingTest
+ void test_parseAdditiveExpression_normal() {
+ super.test_parseAdditiveExpression_normal();
+ }
+
+ @failingTest
+ void test_parseAdditiveExpression_super() {
+ super.test_parseAdditiveExpression_super();
+ }
+
+ @failingTest
+ void test_parseAssignableExpression_expression_args_dot() {
+ super.test_parseAssignableExpression_expression_args_dot();
+ }
+
+ @failingTest
+ void
+ test_parseAssignableExpression_expression_args_dot_typeArgumentComments() {
+ super
+ .test_parseAssignableExpression_expression_args_dot_typeArgumentComments();
+ }
+
+ @failingTest
+ void test_parseAssignableExpression_expression_args_dot_typeArguments() {
+ super.test_parseAssignableExpression_expression_args_dot_typeArguments();
+ }
+
+ @failingTest
+ void test_parseAssignableExpression_expression_dot() {
+ super.test_parseAssignableExpression_expression_dot();
+ }
+
+ @failingTest
+ void test_parseAssignableExpression_expression_index() {
+ super.test_parseAssignableExpression_expression_index();
+ }
+
+ @failingTest
+ void test_parseAssignableExpression_expression_question_dot() {
+ super.test_parseAssignableExpression_expression_question_dot();
+ }
+
+ @failingTest
+ void test_parseAssignableExpression_identifier() {
+ super.test_parseAssignableExpression_identifier();
+ }
+
+ @failingTest
+ void test_parseAssignableExpression_identifier_args_dot() {
+ super.test_parseAssignableExpression_identifier_args_dot();
+ }
+
+ @failingTest
+ void
+ test_parseAssignableExpression_identifier_args_dot_typeArgumentComments() {
+ super
+ .test_parseAssignableExpression_identifier_args_dot_typeArgumentComments();
+ }
+
+ @failingTest
+ void test_parseAssignableExpression_identifier_args_dot_typeArguments() {
+ super.test_parseAssignableExpression_identifier_args_dot_typeArguments();
+ }
+
+ @failingTest
+ void test_parseAssignableExpression_identifier_dot() {
+ super.test_parseAssignableExpression_identifier_dot();
+ }
+
+ @failingTest
+ void test_parseAssignableExpression_identifier_index() {
+ super.test_parseAssignableExpression_identifier_index();
+ }
+
+ @failingTest
+ void test_parseAssignableExpression_identifier_question_dot() {
+ super.test_parseAssignableExpression_identifier_question_dot();
+ }
+
+ @failingTest
+ void test_parseAssignableExpression_super_dot() {
+ super.test_parseAssignableExpression_super_dot();
+ }
+
+ @failingTest
+ void test_parseAssignableExpression_super_index() {
+ super.test_parseAssignableExpression_super_index();
+ }
+
+ @failingTest
+ void test_parseAssignableSelector_dot() {
+ super.test_parseAssignableSelector_dot();
+ }
+
+ @failingTest
+ void test_parseAssignableSelector_index() {
+ super.test_parseAssignableSelector_index();
+ }
+
+ @failingTest
+ void test_parseAssignableSelector_none() {
+ super.test_parseAssignableSelector_none();
+ }
+
+ @failingTest
+ void test_parseAssignableSelector_question_dot() {
+ super.test_parseAssignableSelector_question_dot();
+ }
+
+ @failingTest
+ void test_parseAwaitExpression() {
+ super.test_parseAwaitExpression();
+ }
+
+ @failingTest
+ void test_parseBitwiseAndExpression_normal() {
+ super.test_parseBitwiseAndExpression_normal();
+ }
+
+ @failingTest
+ void test_parseBitwiseAndExpression_super() {
+ super.test_parseBitwiseAndExpression_super();
+ }
+
+ @failingTest
+ void test_parseBitwiseOrExpression_normal() {
+ super.test_parseBitwiseOrExpression_normal();
+ }
+
+ @failingTest
+ void test_parseBitwiseOrExpression_super() {
+ super.test_parseBitwiseOrExpression_super();
+ }
+
+ @failingTest
+ void test_parseBitwiseXorExpression_normal() {
+ super.test_parseBitwiseXorExpression_normal();
+ }
+
+ @failingTest
+ void test_parseBitwiseXorExpression_super() {
+ super.test_parseBitwiseXorExpression_super();
+ }
+
+ @failingTest
+ void test_parseCascadeSection_i() {
+ super.test_parseCascadeSection_i();
+ }
+
+ @failingTest
+ void test_parseCascadeSection_ia() {
+ super.test_parseCascadeSection_ia();
+ }
+
+ @failingTest
+ void test_parseCascadeSection_ia_typeArgumentComments() {
+ super.test_parseCascadeSection_ia_typeArgumentComments();
+ }
+
+ @failingTest
+ void test_parseCascadeSection_ia_typeArguments() {
+ super.test_parseCascadeSection_ia_typeArguments();
+ }
+
+ @failingTest
+ void test_parseCascadeSection_ii() {
+ super.test_parseCascadeSection_ii();
+ }
+
+ @failingTest
+ void test_parseCascadeSection_ii_typeArgumentComments() {
+ super.test_parseCascadeSection_ii_typeArgumentComments();
+ }
+
+ @failingTest
+ void test_parseCascadeSection_ii_typeArguments() {
+ super.test_parseCascadeSection_ii_typeArguments();
+ }
+
+ @failingTest
+ void test_parseCascadeSection_p() {
+ super.test_parseCascadeSection_p();
+ }
+
+ @failingTest
+ void test_parseCascadeSection_p_assign() {
+ super.test_parseCascadeSection_p_assign();
+ }
+
+ @failingTest
+ void test_parseCascadeSection_p_assign_withCascade() {
+ super.test_parseCascadeSection_p_assign_withCascade();
+ }
+
+ @failingTest
+ void test_parseCascadeSection_p_assign_withCascade_typeArgumentComments() {
+ super.test_parseCascadeSection_p_assign_withCascade_typeArgumentComments();
+ }
+
+ @failingTest
+ void test_parseCascadeSection_p_assign_withCascade_typeArguments() {
+ super.test_parseCascadeSection_p_assign_withCascade_typeArguments();
+ }
+
+ @failingTest
+ void test_parseCascadeSection_p_builtIn() {
+ super.test_parseCascadeSection_p_builtIn();
+ }
+
+ @failingTest
+ void test_parseCascadeSection_pa() {
+ super.test_parseCascadeSection_pa();
+ }
+
+ @failingTest
+ void test_parseCascadeSection_pa_typeArgumentComments() {
+ super.test_parseCascadeSection_pa_typeArgumentComments();
+ }
+
+ @failingTest
+ void test_parseCascadeSection_pa_typeArguments() {
+ super.test_parseCascadeSection_pa_typeArguments();
+ }
+
+ @failingTest
+ void test_parseCascadeSection_paa() {
+ super.test_parseCascadeSection_paa();
+ }
+
+ @failingTest
+ void test_parseCascadeSection_paa_typeArgumentComments() {
+ super.test_parseCascadeSection_paa_typeArgumentComments();
+ }
+
+ @failingTest
+ void test_parseCascadeSection_paa_typeArguments() {
+ super.test_parseCascadeSection_paa_typeArguments();
+ }
+
+ @failingTest
+ void test_parseCascadeSection_paapaa() {
+ super.test_parseCascadeSection_paapaa();
+ }
+
+ @failingTest
+ void test_parseCascadeSection_paapaa_typeArgumentComments() {
+ super.test_parseCascadeSection_paapaa_typeArgumentComments();
+ }
+
+ @failingTest
+ void test_parseCascadeSection_paapaa_typeArguments() {
+ super.test_parseCascadeSection_paapaa_typeArguments();
+ }
+
+ @failingTest
+ void test_parseCascadeSection_pap() {
+ super.test_parseCascadeSection_pap();
+ }
+
+ @failingTest
+ void test_parseCascadeSection_pap_typeArgumentComments() {
+ super.test_parseCascadeSection_pap_typeArgumentComments();
+ }
+
+ @failingTest
+ void test_parseCascadeSection_pap_typeArguments() {
+ super.test_parseCascadeSection_pap_typeArguments();
+ }
+
+ @failingTest
+ void test_parseConditionalExpression() {
+ super.test_parseConditionalExpression();
+ }
+
+ @failingTest
+ void test_parseConstExpression_instanceCreation() {
+ super.test_parseConstExpression_instanceCreation();
+ }
+
+ @failingTest
+ void test_parseConstExpression_listLiteral_typed() {
+ super.test_parseConstExpression_listLiteral_typed();
+ }
+
+ @failingTest
+ void test_parseConstExpression_listLiteral_typed_genericComment() {
+ super.test_parseConstExpression_listLiteral_typed_genericComment();
+ }
+
+ @failingTest
+ void test_parseConstExpression_listLiteral_untyped() {
+ super.test_parseConstExpression_listLiteral_untyped();
+ }
+
+ @failingTest
+ void test_parseConstExpression_mapLiteral_typed() {
+ super.test_parseConstExpression_mapLiteral_typed();
+ }
+
+ @failingTest
+ void test_parseConstExpression_mapLiteral_typed_genericComment() {
+ super.test_parseConstExpression_mapLiteral_typed_genericComment();
+ }
+
+ @failingTest
+ void test_parseConstExpression_mapLiteral_untyped() {
+ super.test_parseConstExpression_mapLiteral_untyped();
+ }
+
+ @failingTest
+ void test_parseEqualityExpression_normal() {
+ super.test_parseEqualityExpression_normal();
+ }
+
+ @failingTest
+ void test_parseEqualityExpression_super() {
+ super.test_parseEqualityExpression_super();
+ }
+
+ @failingTest
+ void test_parseExpression_assign() {
+ super.test_parseExpression_assign();
+ }
+
+ @failingTest
+ void test_parseExpression_assign_compound() {
+ super.test_parseExpression_assign_compound();
+ }
+
+ @failingTest
+ void test_parseExpression_comparison() {
+ super.test_parseExpression_comparison();
+ }
+
+ @failingTest
+ void test_parseExpression_function_async() {
+ super.test_parseExpression_function_async();
+ }
+
+ @failingTest
+ void test_parseExpression_function_asyncStar() {
+ super.test_parseExpression_function_asyncStar();
+ }
+
+ @failingTest
+ void test_parseExpression_function_sync() {
+ super.test_parseExpression_function_sync();
+ }
+
+ @failingTest
+ void test_parseExpression_function_syncStar() {
+ super.test_parseExpression_function_syncStar();
+ }
+
+ @failingTest
+ void test_parseExpression_invokeFunctionExpression() {
+ super.test_parseExpression_invokeFunctionExpression();
+ }
+
+ @failingTest
+ void test_parseExpression_nonAwait() {
+ super.test_parseExpression_nonAwait();
+ }
+
+ @failingTest
+ void test_parseExpression_superMethodInvocation() {
+ super.test_parseExpression_superMethodInvocation();
+ }
+
+ @failingTest
+ void test_parseExpression_superMethodInvocation_typeArgumentComments() {
+ super.test_parseExpression_superMethodInvocation_typeArgumentComments();
+ }
+
+ @failingTest
+ void test_parseExpression_superMethodInvocation_typeArguments() {
+ super.test_parseExpression_superMethodInvocation_typeArguments();
+ }
+
+ @failingTest
+ void test_parseExpression_superMethodInvocation_typeArguments_chained() {
+ super.test_parseExpression_superMethodInvocation_typeArguments_chained();
+ }
+
+ @failingTest
+ void test_parseExpressionList_multiple() {
+ super.test_parseExpressionList_multiple();
+ }
+
+ @failingTest
+ void test_parseExpressionList_single() {
+ super.test_parseExpressionList_single();
+ }
+
+ @failingTest
+ void test_parseExpressionWithoutCascade_assign() {
+ super.test_parseExpressionWithoutCascade_assign();
+ }
+
+ @failingTest
+ void test_parseExpressionWithoutCascade_comparison() {
+ super.test_parseExpressionWithoutCascade_comparison();
+ }
+
+ @failingTest
+ void test_parseExpressionWithoutCascade_superMethodInvocation() {
+ super.test_parseExpressionWithoutCascade_superMethodInvocation();
+ }
+
+ @failingTest
+ void
+ test_parseExpressionWithoutCascade_superMethodInvocation_typeArgumentComments() {
+ super
+ .test_parseExpressionWithoutCascade_superMethodInvocation_typeArgumentComments();
+ }
+
+ @failingTest
+ void
+ test_parseExpressionWithoutCascade_superMethodInvocation_typeArguments() {
+ super
+ .test_parseExpressionWithoutCascade_superMethodInvocation_typeArguments();
+ }
+
+ @failingTest
+ void test_parseFunctionExpression_body_inExpression() {
+ super.test_parseFunctionExpression_body_inExpression();
+ }
+
+ @failingTest
+ void test_parseFunctionExpression_typeParameterComments() {
+ super.test_parseFunctionExpression_typeParameterComments();
+ }
+
+ @failingTest
+ void test_parseFunctionExpression_typeParameters() {
+ super.test_parseFunctionExpression_typeParameters();
+ }
+
+ @failingTest
+ void test_parseInstanceCreationExpression_qualifiedType() {
+ super.test_parseInstanceCreationExpression_qualifiedType();
+ }
+
+ @failingTest
+ void test_parseInstanceCreationExpression_qualifiedType_named() {
+ super.test_parseInstanceCreationExpression_qualifiedType_named();
+ }
+
+ @failingTest
+ void
+ test_parseInstanceCreationExpression_qualifiedType_named_typeArgumentComments() {
+ super
+ .test_parseInstanceCreationExpression_qualifiedType_named_typeArgumentComments();
+ }
+
+ @failingTest
+ void
+ test_parseInstanceCreationExpression_qualifiedType_named_typeArguments() {
+ super
+ .test_parseInstanceCreationExpression_qualifiedType_named_typeArguments();
+ }
+
+ @failingTest
+ void
+ test_parseInstanceCreationExpression_qualifiedType_typeArgumentComments() {
+ super
+ .test_parseInstanceCreationExpression_qualifiedType_typeArgumentComments();
+ }
+
+ @failingTest
+ void test_parseInstanceCreationExpression_qualifiedType_typeArguments() {
+ super.test_parseInstanceCreationExpression_qualifiedType_typeArguments();
+ }
+
+ @failingTest
+ void test_parseInstanceCreationExpression_type() {
+ super.test_parseInstanceCreationExpression_type();
+ }
+
+ @failingTest
+ void test_parseInstanceCreationExpression_type_named() {
+ super.test_parseInstanceCreationExpression_type_named();
+ }
+
+ @failingTest
+ void test_parseInstanceCreationExpression_type_named_typeArgumentComments() {
+ super
+ .test_parseInstanceCreationExpression_type_named_typeArgumentComments();
+ }
+
+ @failingTest
+ void test_parseInstanceCreationExpression_type_named_typeArguments() {
+ super.test_parseInstanceCreationExpression_type_named_typeArguments();
+ }
+
+ @failingTest
+ void test_parseInstanceCreationExpression_type_typeArgumentComments() {
+ super.test_parseInstanceCreationExpression_type_typeArgumentComments();
+ }
+
+ @failingTest
+ void test_parseInstanceCreationExpression_type_typeArguments() {
+ super.test_parseInstanceCreationExpression_type_typeArguments();
+ }
+
+ @failingTest
+ void test_parseListLiteral_empty_oneToken() {
+ super.test_parseListLiteral_empty_oneToken();
+ }
+
+ @failingTest
+ void test_parseListLiteral_empty_oneToken_withComment() {
+ super.test_parseListLiteral_empty_oneToken_withComment();
+ }
+
+ @failingTest
+ void test_parseListLiteral_empty_twoTokens() {
+ super.test_parseListLiteral_empty_twoTokens();
+ }
+
+ @failingTest
+ void test_parseListLiteral_multiple() {
+ super.test_parseListLiteral_multiple();
+ }
+
+ @failingTest
+ void test_parseListLiteral_single() {
+ super.test_parseListLiteral_single();
+ }
+
+ @failingTest
+ void test_parseListLiteral_single_withTypeArgument() {
+ super.test_parseListLiteral_single_withTypeArgument();
+ }
+
+ @failingTest
+ void test_parseListOrMapLiteral_list_noType() {
+ super.test_parseListOrMapLiteral_list_noType();
+ }
+
+ @failingTest
+ void test_parseListOrMapLiteral_list_type() {
+ super.test_parseListOrMapLiteral_list_type();
+ }
+
+ @failingTest
+ void test_parseListOrMapLiteral_map_noType() {
+ super.test_parseListOrMapLiteral_map_noType();
+ }
+
+ @failingTest
+ void test_parseListOrMapLiteral_map_type() {
+ super.test_parseListOrMapLiteral_map_type();
+ }
+
+ @failingTest
+ void test_parseLogicalAndExpression() {
+ super.test_parseLogicalAndExpression();
+ }
+
+ @failingTest
+ void test_parseLogicalOrExpression() {
+ super.test_parseLogicalOrExpression();
+ }
+
+ @failingTest
+ void test_parseMapLiteral_empty() {
+ super.test_parseMapLiteral_empty();
+ }
+
+ @failingTest
+ void test_parseMapLiteral_multiple() {
+ super.test_parseMapLiteral_multiple();
+ }
+
+ @failingTest
+ void test_parseMapLiteral_single() {
+ super.test_parseMapLiteral_single();
+ }
+
+ @failingTest
+ void test_parseMapLiteralEntry_complex() {
+ super.test_parseMapLiteralEntry_complex();
+ }
+
+ @failingTest
+ void test_parseMapLiteralEntry_int() {
+ super.test_parseMapLiteralEntry_int();
+ }
+
+ @failingTest
+ void test_parseMapLiteralEntry_string() {
+ super.test_parseMapLiteralEntry_string();
+ }
+
+ @failingTest
+ void test_parseMultiplicativeExpression_normal() {
+ super.test_parseMultiplicativeExpression_normal();
+ }
+
+ @failingTest
+ void test_parseMultiplicativeExpression_super() {
+ super.test_parseMultiplicativeExpression_super();
+ }
+
+ @failingTest
+ void test_parseNewExpression() {
+ super.test_parseNewExpression();
+ }
+
+ @failingTest
+ void test_parsePostfixExpression_decrement() {
+ super.test_parsePostfixExpression_decrement();
+ }
+
+ @failingTest
+ void test_parsePostfixExpression_increment() {
+ super.test_parsePostfixExpression_increment();
+ }
+
+ @failingTest
+ void test_parsePostfixExpression_none_indexExpression() {
+ super.test_parsePostfixExpression_none_indexExpression();
+ }
+
+ @failingTest
+ void test_parsePostfixExpression_none_methodInvocation() {
+ super.test_parsePostfixExpression_none_methodInvocation();
+ }
+
+ @failingTest
+ void test_parsePostfixExpression_none_methodInvocation_question_dot() {
+ super.test_parsePostfixExpression_none_methodInvocation_question_dot();
+ }
+
+ @failingTest
+ void
+ test_parsePostfixExpression_none_methodInvocation_question_dot_typeArgumentComments() {
+ super
+ .test_parsePostfixExpression_none_methodInvocation_question_dot_typeArgumentComments();
+ }
+
+ @failingTest
+ void
+ test_parsePostfixExpression_none_methodInvocation_question_dot_typeArguments() {
+ super
+ .test_parsePostfixExpression_none_methodInvocation_question_dot_typeArguments();
+ }
+
+ @failingTest
+ void
+ test_parsePostfixExpression_none_methodInvocation_typeArgumentComments() {
+ super
+ .test_parsePostfixExpression_none_methodInvocation_typeArgumentComments();
+ }
+
+ @failingTest
+ void test_parsePostfixExpression_none_methodInvocation_typeArguments() {
+ super.test_parsePostfixExpression_none_methodInvocation_typeArguments();
+ }
+
+ @failingTest
+ void test_parsePostfixExpression_none_propertyAccess() {
+ super.test_parsePostfixExpression_none_propertyAccess();
+ }
+
+ @failingTest
+ void test_parsePrefixedIdentifier_noPrefix() {
+ super.test_parsePrefixedIdentifier_noPrefix();
+ }
+
+ @failingTest
+ void test_parsePrefixedIdentifier_prefix() {
+ super.test_parsePrefixedIdentifier_prefix();
+ }
+
+ @failingTest
+ void test_parsePrimaryExpression_const() {
+ super.test_parsePrimaryExpression_const();
+ }
+
+ @failingTest
+ void test_parsePrimaryExpression_double() {
+ super.test_parsePrimaryExpression_double();
+ }
+
+ @failingTest
+ void test_parsePrimaryExpression_false() {
+ super.test_parsePrimaryExpression_false();
+ }
+
+ @failingTest
+ void test_parsePrimaryExpression_function_arguments() {
+ super.test_parsePrimaryExpression_function_arguments();
+ }
+
+ @failingTest
+ void test_parsePrimaryExpression_function_noArguments() {
+ super.test_parsePrimaryExpression_function_noArguments();
+ }
+
+ @failingTest
+ void test_parsePrimaryExpression_genericFunctionExpression() {
+ super.test_parsePrimaryExpression_genericFunctionExpression();
+ }
+
+ @failingTest
+ void test_parsePrimaryExpression_hex() {
+ super.test_parsePrimaryExpression_hex();
+ }
+
+ @failingTest
+ void test_parsePrimaryExpression_identifier() {
+ super.test_parsePrimaryExpression_identifier();
+ }
+
+ @failingTest
+ void test_parsePrimaryExpression_int() {
+ super.test_parsePrimaryExpression_int();
+ }
+
+ @failingTest
+ void test_parsePrimaryExpression_listLiteral() {
+ super.test_parsePrimaryExpression_listLiteral();
+ }
+
+ @failingTest
+ void test_parsePrimaryExpression_listLiteral_index() {
+ super.test_parsePrimaryExpression_listLiteral_index();
+ }
+
+ @failingTest
+ void test_parsePrimaryExpression_listLiteral_typed() {
+ super.test_parsePrimaryExpression_listLiteral_typed();
+ }
+
+ @failingTest
+ void test_parsePrimaryExpression_listLiteral_typed_genericComment() {
+ super.test_parsePrimaryExpression_listLiteral_typed_genericComment();
+ }
+
+ @failingTest
+ void test_parsePrimaryExpression_mapLiteral() {
+ super.test_parsePrimaryExpression_mapLiteral();
+ }
+
+ @failingTest
+ void test_parsePrimaryExpression_mapLiteral_typed() {
+ super.test_parsePrimaryExpression_mapLiteral_typed();
+ }
+
+ @failingTest
+ void test_parsePrimaryExpression_mapLiteral_typed_genericComment() {
+ super.test_parsePrimaryExpression_mapLiteral_typed_genericComment();
+ }
+
+ @failingTest
+ void test_parsePrimaryExpression_new() {
+ super.test_parsePrimaryExpression_new();
+ }
+
+ @failingTest
+ void test_parsePrimaryExpression_null() {
+ super.test_parsePrimaryExpression_null();
+ }
+
+ @failingTest
+ void test_parsePrimaryExpression_parenthesized() {
+ super.test_parsePrimaryExpression_parenthesized();
+ }
+
+ @failingTest
+ void test_parsePrimaryExpression_string() {
+ super.test_parsePrimaryExpression_string();
+ }
+
+ @failingTest
+ void test_parsePrimaryExpression_string_multiline() {
+ super.test_parsePrimaryExpression_string_multiline();
+ }
+
+ @failingTest
+ void test_parsePrimaryExpression_string_raw() {
+ super.test_parsePrimaryExpression_string_raw();
+ }
+
+ @failingTest
+ void test_parsePrimaryExpression_super() {
+ super.test_parsePrimaryExpression_super();
+ }
+
+ @failingTest
+ void test_parsePrimaryExpression_this() {
+ super.test_parsePrimaryExpression_this();
+ }
+
+ @failingTest
+ void test_parsePrimaryExpression_true() {
+ super.test_parsePrimaryExpression_true();
+ }
+
+ @failingTest
+ void test_parseRedirectingConstructorInvocation_named() {
+ super.test_parseRedirectingConstructorInvocation_named();
+ }
+
+ @failingTest
+ void test_parseRedirectingConstructorInvocation_unnamed() {
+ super.test_parseRedirectingConstructorInvocation_unnamed();
+ }
+
+ @failingTest
+ void test_parseRelationalExpression_as_functionType_noReturnType() {
+ super.test_parseRelationalExpression_as_functionType_noReturnType();
+ }
+
+ @failingTest
+ void test_parseRelationalExpression_as_functionType_returnType() {
+ super.test_parseRelationalExpression_as_functionType_returnType();
+ }
+
+ @failingTest
+ void test_parseRelationalExpression_as_generic() {
+ super.test_parseRelationalExpression_as_generic();
+ }
+
+ @failingTest
+ void test_parseRelationalExpression_as_simple() {
+ super.test_parseRelationalExpression_as_simple();
+ }
+
+ @failingTest
+ void test_parseRelationalExpression_as_simple_function() {
+ super.test_parseRelationalExpression_as_simple_function();
+ }
+
+ @failingTest
+ void test_parseRelationalExpression_is() {
+ super.test_parseRelationalExpression_is();
+ }
+
+ @failingTest
+ void test_parseRelationalExpression_isNot() {
+ super.test_parseRelationalExpression_isNot();
+ }
+
+ @failingTest
+ void test_parseRelationalExpression_normal() {
+ super.test_parseRelationalExpression_normal();
+ }
+
+ @failingTest
+ void test_parseRelationalExpression_super() {
+ super.test_parseRelationalExpression_super();
+ }
+
+ @failingTest
+ void test_parseRethrowExpression() {
+ super.test_parseRethrowExpression();
+ }
+
+ @failingTest
+ void test_parseShiftExpression_normal() {
+ super.test_parseShiftExpression_normal();
+ }
+
+ @failingTest
+ void test_parseShiftExpression_super() {
+ super.test_parseShiftExpression_super();
+ }
+
+ @failingTest
+ void test_parseSimpleIdentifier_builtInIdentifier() {
+ super.test_parseSimpleIdentifier_builtInIdentifier();
+ }
+
+ @failingTest
+ void test_parseSimpleIdentifier_normalIdentifier() {
+ super.test_parseSimpleIdentifier_normalIdentifier();
+ }
+
+ @failingTest
+ void test_parseStringLiteral_adjacent() {
+ super.test_parseStringLiteral_adjacent();
+ }
+
+ @failingTest
+ void test_parseStringLiteral_endsWithInterpolation() {
+ super.test_parseStringLiteral_endsWithInterpolation();
+ }
+
+ @failingTest
+ void test_parseStringLiteral_interpolated() {
+ super.test_parseStringLiteral_interpolated();
+ }
+
+ @failingTest
+ void test_parseStringLiteral_multiline_encodedSpace() {
+ super.test_parseStringLiteral_multiline_encodedSpace();
+ }
+
+ @failingTest
+ void test_parseStringLiteral_multiline_endsWithInterpolation() {
+ super.test_parseStringLiteral_multiline_endsWithInterpolation();
+ }
+
+ @failingTest
+ void test_parseStringLiteral_multiline_escapedBackslash() {
+ super.test_parseStringLiteral_multiline_escapedBackslash();
+ }
+
+ @failingTest
+ void test_parseStringLiteral_multiline_escapedBackslash_raw() {
+ super.test_parseStringLiteral_multiline_escapedBackslash_raw();
+ }
+
+ @failingTest
+ void test_parseStringLiteral_multiline_escapedEolMarker() {
+ super.test_parseStringLiteral_multiline_escapedEolMarker();
+ }
+
+ @failingTest
+ void test_parseStringLiteral_multiline_escapedEolMarker_raw() {
+ super.test_parseStringLiteral_multiline_escapedEolMarker_raw();
+ }
+
+ @failingTest
+ void test_parseStringLiteral_multiline_escapedSpaceAndEolMarker() {
+ super.test_parseStringLiteral_multiline_escapedSpaceAndEolMarker();
+ }
+
+ @failingTest
+ void test_parseStringLiteral_multiline_escapedSpaceAndEolMarker_raw() {
+ super.test_parseStringLiteral_multiline_escapedSpaceAndEolMarker_raw();
+ }
+
+ @failingTest
+ void test_parseStringLiteral_multiline_escapedTab() {
+ super.test_parseStringLiteral_multiline_escapedTab();
+ }
+
+ @failingTest
+ void test_parseStringLiteral_multiline_escapedTab_raw() {
+ super.test_parseStringLiteral_multiline_escapedTab_raw();
+ }
+
+ @failingTest
+ void test_parseStringLiteral_multiline_quoteAfterInterpolation() {
+ super.test_parseStringLiteral_multiline_quoteAfterInterpolation();
+ }
+
+ @failingTest
+ void test_parseStringLiteral_multiline_startsWithInterpolation() {
+ super.test_parseStringLiteral_multiline_startsWithInterpolation();
+ }
+
+ @failingTest
+ void test_parseStringLiteral_multiline_twoSpaces() {
+ super.test_parseStringLiteral_multiline_twoSpaces();
+ }
+
+ @failingTest
+ void test_parseStringLiteral_multiline_twoSpaces_raw() {
+ super.test_parseStringLiteral_multiline_twoSpaces_raw();
+ }
+
+ @failingTest
+ void test_parseStringLiteral_multiline_untrimmed() {
+ super.test_parseStringLiteral_multiline_untrimmed();
+ }
+
+ @failingTest
+ void test_parseStringLiteral_quoteAfterInterpolation() {
+ super.test_parseStringLiteral_quoteAfterInterpolation();
+ }
+
+ @failingTest
+ void test_parseStringLiteral_single() {
+ super.test_parseStringLiteral_single();
+ }
+
+ @failingTest
+ void test_parseStringLiteral_startsWithInterpolation() {
+ super.test_parseStringLiteral_startsWithInterpolation();
+ }
+
+ @failingTest
+ void test_parseSuperConstructorInvocation_named() {
+ super.test_parseSuperConstructorInvocation_named();
+ }
+
+ @failingTest
+ void test_parseSuperConstructorInvocation_unnamed() {
+ super.test_parseSuperConstructorInvocation_unnamed();
+ }
+
+ @failingTest
+ void test_parseSymbolLiteral_builtInIdentifier() {
+ super.test_parseSymbolLiteral_builtInIdentifier();
+ }
+
+ @failingTest
+ void test_parseSymbolLiteral_multiple() {
+ super.test_parseSymbolLiteral_multiple();
+ }
+
+ @failingTest
+ void test_parseSymbolLiteral_operator() {
+ super.test_parseSymbolLiteral_operator();
+ }
+
+ @failingTest
+ void test_parseSymbolLiteral_single() {
+ super.test_parseSymbolLiteral_single();
+ }
+
+ @failingTest
+ void test_parseSymbolLiteral_void() {
+ super.test_parseSymbolLiteral_void();
+ }
+
+ @failingTest
+ void test_parseThrowExpression() {
+ super.test_parseThrowExpression();
+ }
+
+ @failingTest
+ void test_parseThrowExpressionWithoutCascade() {
+ super.test_parseThrowExpressionWithoutCascade();
+ }
+
+ @failingTest
+ void test_parseUnaryExpression_decrement_normal() {
+ super.test_parseUnaryExpression_decrement_normal();
+ }
+
+ @failingTest
+ void test_parseUnaryExpression_decrement_super() {
+ super.test_parseUnaryExpression_decrement_super();
+ }
+
+ @failingTest
+ void test_parseUnaryExpression_decrement_super_propertyAccess() {
+ super.test_parseUnaryExpression_decrement_super_propertyAccess();
+ }
+
+ @failingTest
+ void test_parseUnaryExpression_decrement_super_withComment() {
+ super.test_parseUnaryExpression_decrement_super_withComment();
+ }
+
+ @failingTest
+ void test_parseUnaryExpression_increment_normal() {
+ super.test_parseUnaryExpression_increment_normal();
+ }
+
+ @failingTest
+ void test_parseUnaryExpression_increment_super_index() {
+ super.test_parseUnaryExpression_increment_super_index();
+ }
+
+ @failingTest
+ void test_parseUnaryExpression_increment_super_propertyAccess() {
+ super.test_parseUnaryExpression_increment_super_propertyAccess();
+ }
+
+ @failingTest
+ void test_parseUnaryExpression_minus_normal() {
+ super.test_parseUnaryExpression_minus_normal();
+ }
+
+ @failingTest
+ void test_parseUnaryExpression_minus_super() {
+ super.test_parseUnaryExpression_minus_super();
+ }
+
+ @failingTest
+ void test_parseUnaryExpression_not_normal() {
+ super.test_parseUnaryExpression_not_normal();
+ }
+
+ @failingTest
+ void test_parseUnaryExpression_not_super() {
+ super.test_parseUnaryExpression_not_super();
+ }
+
+ @failingTest
+ void test_parseUnaryExpression_tilda_normal() {
+ super.test_parseUnaryExpression_tilda_normal();
+ }
+
+ @failingTest
+ void test_parseUnaryExpression_tilda_super() {
+ super.test_parseUnaryExpression_tilda_super();
+ }
+}
+
+/**
+ * Implementation of [AbstractParserTestCase] specialized for testing building
+ * Analyzer AST using the fasta [Forest] API.
+ */
+class FastaParserTestCase extends Object
+ with ParserTestHelpers
+ implements AbstractParserTestCase {
+ // TODO(danrubel): Consider HybridFileSystem.
+ static final MemoryFileSystem fs =
+ new MemoryFileSystem(Uri.parse("org-dartlang-test:///"));
+
+ /// The custom URI used to locate the dill file in the MemoryFileSystem.
+ static final Uri sdkSummary = fs.currentDirectory.resolve("vm_platform.dill");
+
+ /// The in memory test code URI
+ static final Uri entryPoint = fs.currentDirectory.resolve("main.dart");
+
+ static ProcessedOptions options;
+
+ static KernelTarget kernelTarget;
+
+ @override
+ Expression parseAdditiveExpression(String code) {
+ ScannerResult scan = scanString(code);
+
+ return CompilerContext.runWithOptions(options, (CompilerContext c) {
+ KernelLibraryBuilder library = new KernelLibraryBuilder(
+ entryPoint,
+ entryPoint,
+ kernelTarget.loader,
+ null /* actualOrigin */,
+ null /* enclosingLibrary */,
+ );
+ List<KernelTypeVariableBuilder> typeVariableBuilders =
+ <KernelTypeVariableBuilder>[];
+ List<KernelFormalParameterBuilder> formalParameterBuilders =
+ <KernelFormalParameterBuilder>[];
+ KernelProcedureBuilder procedureBuilder = new KernelProcedureBuilder(
+ null /* metadata */,
+ Modifier.staticMask /* or Modifier.varMask */,
+ new BuiltTypeBuilder(new kernel.DynamicType()),
+ "analyzerTest",
+ typeVariableBuilders,
+ formalParameterBuilders,
+ kernel.ProcedureKind.Method,
+ library,
+ -1 /* charOffset */,
+ -1 /* charOpenParenOffset */,
+ -1 /* charEndOffset */);
+
+ TypeInferrerDisabled typeInferrer =
+ new TypeInferrerDisabled(new TypeSchemaEnvironment(
+ kernelTarget.loader.coreTypes,
+ kernelTarget.loader.hierarchy,
+ // TODO(danrubel): Enable strong mode.
+ false /* strong mode */,
+ ));
+
+ BodyBuilder builder = new BodyBuilder(
+ library,
+ procedureBuilder,
+ library.scope,
+ procedureBuilder.computeFormalParameterScope(library.scope),
+ kernelTarget.loader.hierarchy,
+ kernelTarget.loader.coreTypes,
+ null /* classBuilder */,
+ false /* isInstanceMember */,
+ null /* uri */,
+ typeInferrer,
+ new AstBuildingForest(),
+ )..constantContext = ConstantContext.none; // .inferred ?
+
+ Parser parser = new Parser(builder);
+ parser.parseExpression(parser.syntheticPreviousToken(scan.tokens));
+ return builder.pop();
+ });
+ }
+
+ Future setUp() async {
+ // TODO(danrubel): Tear down once all tests in group have been run.
+ if (options != null) {
+ return;
+ }
+
+ // Read the dill file containing kernel platform summaries into memory.
+ List<int> sdkSummaryBytes = await new File.fromUri(
+ computePlatformBinariesLocation().resolve("vm_platform.dill"))
+ .readAsBytes();
+ fs.entityForUri(sdkSummary).writeAsBytesSync(sdkSummaryBytes);
+
+ final CompilerOptions optionBuilder = new CompilerOptions()
+ ..strongMode = false // TODO(danrubel): enable strong mode.
+ ..reportMessages = true
+ ..verbose = false
+ ..fileSystem = fs
+ ..sdkSummary = sdkSummary
+ ..onProblem = (FormattedMessage problem, Severity severity,
+ List<FormattedMessage> context) {
+ // TODO(danrubel): Capture problems and check against expectations.
+ print(problem.formatted);
+ };
+
+ options = new ProcessedOptions(optionBuilder, false, [entryPoint]);
+
+ UriTranslatorImpl uriTranslator = await options.getUriTranslator();
+
+ await CompilerContext.runWithOptions(options, (CompilerContext c) async {
+ DillTarget dillTarget = new DillTarget(
+ new Ticker(isVerbose: false), uriTranslator, options.target);
+
+ kernelTarget = new KernelTarget(fs, true, dillTarget, uriTranslator);
+
+ // Load the dill file containing platform code.
+ dillTarget.loader.read(Uri.parse('dart:core'), -1, fileUri: sdkSummary);
+ kernel.Component sdkComponent =
+ kernel.loadComponentFromBytes(sdkSummaryBytes);
+ dillTarget.loader
+ .appendLibraries(sdkComponent, byteCount: sdkSummaryBytes.length);
+ await dillTarget.buildOutlines();
+ await kernelTarget.buildOutlines();
+ kernelTarget.computeCoreTypes();
+ assert(kernelTarget.loader.coreTypes != null);
+ });
+ }
+
+ noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation);
+}
diff --git a/pkg/analyzer/test/generated/parser_test.dart b/pkg/analyzer/test/generated/parser_test.dart
index 83855d0..1f39754e 100644
--- a/pkg/analyzer/test/generated/parser_test.dart
+++ b/pkg/analyzer/test/generated/parser_test.dart
@@ -4117,11 +4117,11 @@
parseCompilationUnit("typedef var Function(var arg);",
errors: usingFastaParser
? [
+ expectedError(ParserErrorCode.EXPECTED_TYPE_NAME, 8, 3),
+ expectedError(ParserErrorCode.VAR_AND_TYPE, 21, 3),
+ expectedError(ParserErrorCode.MISSING_IDENTIFIER, 29, 1),
expectedError(
- ParserErrorCode.MISSING_CONST_FINAL_VAR_OR_TYPE, 0, 7),
- expectedError(ParserErrorCode.EXPECTED_TOKEN, 8, 3),
- expectedError(ParserErrorCode.VAR_RETURN_TYPE, 8, 3),
- expectedError(ParserErrorCode.MISSING_FUNCTION_BODY, 29, 1),
+ ParserErrorCode.MISSING_TYPEDEF_PARAMETERS, 29, 1),
]
: [
expectedError(ParserErrorCode.MISSING_IDENTIFIER, 8, 3),
@@ -11443,7 +11443,14 @@
G<int double> g;
}''',
errors: usingFastaParser
- ? [expectedError(ParserErrorCode.EXPECTED_TOKEN, 18, 6)]
+ ? [
+ // TODO(danrubel): Improve missing comma recovery.
+ expectedError(ParserErrorCode.EXPECTED_TOKEN, 18, 6),
+ expectedError(ParserErrorCode.MISSING_METHOD_PARAMETERS, 12, 1),
+ expectedError(ParserErrorCode.MISSING_FUNCTION_BODY, 26, 1),
+ expectedError(
+ ParserErrorCode.MISSING_CONST_FINAL_VAR_OR_TYPE, 26, 1),
+ ]
: [
expectedError(ParserErrorCode.EXPECTED_TOKEN, 18, 6),
expectedError(ParserErrorCode.EXPECTED_TOKEN, 18, 6),
@@ -11455,14 +11462,14 @@
// one class
List<CompilationUnitMember> declarations = unit.declarations;
expect(declarations, hasLength(1));
- ClassDeclaration classDecl = declarations[0] as ClassDeclaration;
// validate members
if (usingFastaParser) {
- expect(classDecl.members, hasLength(1));
- FieldDeclaration fields = classDecl.members.first;
- expect(fields.fields.variables, hasLength(1));
- VariableDeclaration field = fields.fields.variables.first;
- expect(field.name.name, 'g');
+// ClassDeclaration classDecl = declarations[0] as ClassDeclaration;
+// expect(classDecl.members, hasLength(1));
+// FieldDeclaration fields = classDecl.members.first;
+// expect(fields.fields.variables, hasLength(1));
+// VariableDeclaration field = fields.fields.variables.first;
+// expect(field.name.name, 'g');
}
}
diff --git a/pkg/analyzer/test/generated/test_all.dart b/pkg/analyzer/test/generated/test_all.dart
index 52a3081..ef889c4 100644
--- a/pkg/analyzer/test/generated/test_all.dart
+++ b/pkg/analyzer/test/generated/test_all.dart
@@ -42,6 +42,7 @@
import 'non_hint_code_test.dart' as non_hint_code_test;
import 'package_test.dart' as package_test;
import 'parser_fasta_test.dart' as parser_fasta_test;
+import 'parser_forest_test.dart' as parser_forest_test;
import 'parser_test.dart' as parser_test;
import 'resolver_driver_test.dart' as resolver_driver_test;
import 'resolver_kernel_test.dart' as resolver_kernel_test;
@@ -107,6 +108,7 @@
non_hint_code_test.main();
package_test.main();
parser_fasta_test.main();
+ parser_forest_test.main();
parser_test.main();
resolver_driver_test.main();
resolver_kernel_test.main();
diff --git a/pkg/analyzer/test/generated/type_system_test.dart b/pkg/analyzer/test/generated/type_system_test.dart
index da90947..c371ec8 100644
--- a/pkg/analyzer/test/generated/type_system_test.dart
+++ b/pkg/analyzer/test/generated/type_system_test.dart
@@ -6,7 +6,8 @@
library analyzer.test.generated.type_system_test;
-import 'package:analyzer/analyzer.dart' show ErrorReporter, StrongModeCode;
+import 'package:analyzer/analyzer.dart'
+ show ErrorReporter, ParameterKind, StrongModeCode;
import 'package:analyzer/dart/ast/standard_ast_factory.dart' show astFactory;
import 'package:analyzer/dart/ast/token.dart' show Keyword;
import 'package:analyzer/dart/element/element.dart';
@@ -28,6 +29,7 @@
main() {
defineReflectiveSuite(() {
+ defineReflectiveTests(ConstraintMatchingTest);
defineReflectiveTests(StrongAssignabilityTest);
defineReflectiveTests(StrongSubtypingTest);
defineReflectiveTests(StrongGenericFunctionInferenceTest);
@@ -49,13 +51,13 @@
InterfaceType get doubleType => typeProvider.doubleType;
DartType get dynamicType => typeProvider.dynamicType;
InterfaceType get functionType => typeProvider.functionType;
+ InterfaceType get futureOrType => typeProvider.futureOrType;
InterfaceType get intType => typeProvider.intType;
InterfaceType get iterableType => typeProvider.iterableType;
InterfaceType get listType => typeProvider.listType;
InterfaceType get numType => typeProvider.numType;
InterfaceType get objectType => typeProvider.objectType;
InterfaceType get stringType => typeProvider.stringType;
- InterfaceType get futureOrType => typeProvider.futureOrType;
StrongTypeSystemImpl get strongTypeSystem =>
typeSystem as StrongTypeSystemImpl;
@@ -133,6 +135,354 @@
}
}
+@reflectiveTest
+class ConstraintMatchingTest {
+ TypeProvider typeProvider;
+ TypeSystem typeSystem;
+ TypeParameterType T;
+
+ DartType get dynamicType => DynamicTypeImpl.instance;
+
+ InterfaceType get functionType => typeProvider.functionType;
+
+ InterfaceType get intType => typeProvider.intType;
+
+ InterfaceType get nullType => typeProvider.nullType;
+
+ InterfaceType get objectType => typeProvider.objectType;
+
+ InterfaceType get stringType => typeProvider.stringType;
+
+ DartType get voidType => VoidTypeImpl.instance;
+
+ DartType fn(DartType paramType, DartType returnType) =>
+ new FunctionElementImpl.synthetic([
+ new ParameterElementImpl.synthetic(
+ 'value', paramType, ParameterKind.REQUIRED)
+ ], returnType)
+ .type;
+
+ DartType future(DartType T) => typeProvider.futureType.instantiate([T]);
+
+ DartType futureOr(DartType T) => typeProvider.futureOrType.instantiate([T]);
+
+ DartType iterable(DartType T) => typeProvider.iterableType.instantiate([T]);
+
+ DartType list(DartType T) => typeProvider.listType.instantiate([T]);
+
+ void setUp() {
+ typeProvider = AnalysisContextFactory.contextWithCore().typeProvider;
+ typeSystem = new StrongTypeSystemImpl(typeProvider);
+ T = _newTypeParameter('T');
+ }
+
+ void test_function_coreFunction() {
+ _checkOrdinarySubtypeMatch(fn(intType, stringType), functionType, [T],
+ covariant: true);
+ }
+
+ void test_function_parameter_types() {
+ _checkIsSubtypeMatchOf(
+ fn(T, intType), fn(stringType, intType), [T], ['String <: T'],
+ covariant: true);
+ }
+
+ void test_function_return_types() {
+ _checkIsSubtypeMatchOf(
+ fn(intType, T), fn(intType, stringType), [T], ['T <: String'],
+ covariant: true);
+ }
+
+ void test_futureOr_futureOr() {
+ _checkIsSubtypeMatchOf(
+ futureOr(T), futureOr(stringType), [T], ['T <: String'],
+ covariant: true);
+ }
+
+ void test_futureOr_x_fail_future_branch() {
+ // FutureOr<List<T>> <: List<String> can't be satisfied because
+ // Future<List<T>> <: List<String> can't be satisfied
+ _checkIsNotSubtypeMatchOf(futureOr(list(T)), list(stringType), [T],
+ covariant: true);
+ }
+
+ void test_futureOr_x_fail_nonFuture_branch() {
+ // FutureOr<List<T>> <: Future<List<String>> can't be satisfied because
+ // List<T> <: Future<List<String>> can't be satisfied
+ _checkIsNotSubtypeMatchOf(futureOr(list(T)), future(list(stringType)), [T],
+ covariant: true);
+ }
+
+ void test_futureOr_x_success() {
+ // FutureOr<T> <: Future<T> can be satisfied by T=Null. At this point in
+ // the type inference algorithm all we figure out is that T must be a
+ // subtype of both String and Future<String>.
+ _checkIsSubtypeMatchOf(futureOr(T), future(stringType), [T],
+ ['T <: String', 'T <: Future<String>'],
+ covariant: true);
+ }
+
+ void test_lhs_null() {
+ // Null <: T is trivially satisfied by the constraint Null <: T.
+ _checkIsSubtypeMatchOf(nullType, T, [T], ['Null <: T'], covariant: false);
+ // For any other type X, Null <: X is satisfied without the need for any
+ // constraints.
+ _checkOrdinarySubtypeMatch(nullType, list(T), [T], covariant: false);
+ _checkOrdinarySubtypeMatch(nullType, stringType, [T], covariant: false);
+ _checkOrdinarySubtypeMatch(nullType, voidType, [T], covariant: false);
+ _checkOrdinarySubtypeMatch(nullType, dynamicType, [T], covariant: false);
+ _checkOrdinarySubtypeMatch(nullType, objectType, [T], covariant: false);
+ _checkOrdinarySubtypeMatch(nullType, nullType, [T], covariant: false);
+ _checkOrdinarySubtypeMatch(nullType, fn(intType, stringType), [T],
+ covariant: false);
+ }
+
+ void test_param_on_lhs_contravariant_direct() {
+ // When doing a contravariant match, the type parameters we're trying to
+ // find types for are on the right hand side. Is a type parameter also
+ // appears on the left hand side, there is a condition in which the
+ // constraint can be satisfied without consulting the bound of the LHS type
+ // parameter: the condition where both parameters appear at corresponding
+ // locations in the type tree.
+ //
+ // In other words, List<S> <: List<T> is satisfied provided that
+ // S <: T.
+ var S = _newTypeParameter('S');
+ _checkIsSubtypeMatchOf(list(S), list(T), [T], ['S <: T'], covariant: false);
+ }
+
+ void test_param_on_lhs_contravariant_via_bound() {
+ // When doing a contravariant match, the type parameters we're trying to
+ // find types for are on the right hand side. Is a type parameter also
+ // appears on the left hand side, we may have to constrain the RHS type
+ // parameter using the bounds of the LHS type parameter.
+ //
+ // In other words, S <: List<T> is satisfied provided that
+ // bound(S) <: List<T>.
+ var S = _newTypeParameter('S', list(stringType));
+ _checkIsSubtypeMatchOf(S, list(T), [T], ['String <: T'], covariant: false);
+ }
+
+ void test_param_on_lhs_covariant() {
+ // When doing a covariant match, the type parameters we're trying to find
+ // types for are on the left hand side.
+ _checkIsSubtypeMatchOf(T, stringType, [T], ['T <: String'],
+ covariant: true);
+ }
+
+ void test_param_on_rhs_contravariant() {
+ // When doing a contravariant match, the type parameters we're trying to
+ // find types for are on the right hand side.
+ _checkIsSubtypeMatchOf(stringType, T, [T], ['String <: T'],
+ covariant: false);
+ }
+
+ void test_param_on_rhs_covariant_match() {
+ // When doing a covariant match, the type parameters we're trying to find
+ // types for are on the left hand side. If a type parameter appears on the
+ // right hand side, there is a condition in which the constraint can be
+ // satisfied: where both parameters appear at corresponding locations in the
+ // type tree.
+ //
+ // In other words, T <: S can be satisfied trivially by the constraint
+ // T <: S.
+ var S = _newTypeParameter('S');
+ _checkIsSubtypeMatchOf(T, S, [T], ['T <: S'], covariant: true);
+ }
+
+ void test_param_on_rhs_covariant_no_match() {
+ // When doing a covariant match, the type parameters we're trying to find
+ // types for are on the left hand side. If a type parameter appears on the
+ // right hand side, it's probable that the constraint can't be satisfied,
+ // because there is no possible type for the LHS (other than bottom)
+ // that's guaranteed to satisfy the relation for all possible assignments of
+ // the RHS type parameter.
+ //
+ // In other words, no match can be found for List<T> <: S because regardless
+ // of T, we can't guarantee that List<T> <: S for all S.
+ var S = _newTypeParameter('S');
+ _checkIsNotSubtypeMatchOf(list(T), S, [T], covariant: true);
+ }
+
+ void test_related_interface_types_failure() {
+ _checkIsNotSubtypeMatchOf(iterable(T), list(stringType), [T],
+ covariant: true);
+ }
+
+ void test_related_interface_types_success() {
+ _checkIsSubtypeMatchOf(list(T), iterable(stringType), [T], ['T <: String'],
+ covariant: true);
+ }
+
+ void test_rhs_dynamic() {
+ // T <: dynamic is trivially satisfied by the constraint T <: dynamic.
+ _checkIsSubtypeMatchOf(T, dynamicType, [T], ['T <: dynamic'],
+ covariant: true);
+ // For any other type X, X <: dynamic is satisfied without the need for any
+ // constraints.
+ _checkOrdinarySubtypeMatch(list(T), dynamicType, [T], covariant: true);
+ _checkOrdinarySubtypeMatch(stringType, dynamicType, [T], covariant: true);
+ _checkOrdinarySubtypeMatch(voidType, dynamicType, [T], covariant: true);
+ _checkOrdinarySubtypeMatch(dynamicType, dynamicType, [T], covariant: true);
+ _checkOrdinarySubtypeMatch(objectType, dynamicType, [T], covariant: true);
+ _checkOrdinarySubtypeMatch(nullType, dynamicType, [T], covariant: true);
+ _checkOrdinarySubtypeMatch(fn(intType, stringType), dynamicType, [T],
+ covariant: true);
+ }
+
+ void test_rhs_object() {
+ // T <: Object is trivially satisfied by the constraint T <: Object.
+ _checkIsSubtypeMatchOf(T, objectType, [T], ['T <: Object'],
+ covariant: true);
+ // For any other type X, X <: Object is satisfied without the need for any
+ // constraints.
+ _checkOrdinarySubtypeMatch(list(T), objectType, [T], covariant: true);
+ _checkOrdinarySubtypeMatch(stringType, objectType, [T], covariant: true);
+ _checkOrdinarySubtypeMatch(voidType, objectType, [T], covariant: true);
+ _checkOrdinarySubtypeMatch(dynamicType, objectType, [T], covariant: true);
+ _checkOrdinarySubtypeMatch(objectType, objectType, [T], covariant: true);
+ _checkOrdinarySubtypeMatch(nullType, objectType, [T], covariant: true);
+ _checkOrdinarySubtypeMatch(fn(intType, stringType), objectType, [T],
+ covariant: true);
+ }
+
+ void test_rhs_void() {
+ // T <: void is trivially satisfied by the constraint T <: void.
+ _checkIsSubtypeMatchOf(T, voidType, [T], ['T <: void'], covariant: true);
+ // For any other type X, X <: void is satisfied without the need for any
+ // constraints.
+ _checkOrdinarySubtypeMatch(list(T), voidType, [T], covariant: true);
+ _checkOrdinarySubtypeMatch(stringType, voidType, [T], covariant: true);
+ _checkOrdinarySubtypeMatch(voidType, voidType, [T], covariant: true);
+ _checkOrdinarySubtypeMatch(dynamicType, voidType, [T], covariant: true);
+ _checkOrdinarySubtypeMatch(objectType, voidType, [T], covariant: true);
+ _checkOrdinarySubtypeMatch(nullType, voidType, [T], covariant: true);
+ _checkOrdinarySubtypeMatch(fn(intType, stringType), voidType, [T],
+ covariant: true);
+ }
+
+ void test_same_interface_types() {
+ _checkIsSubtypeMatchOf(list(T), list(stringType), [T], ['T <: String'],
+ covariant: true);
+ }
+
+ void test_x_futureOr_fail_both_branches() {
+ // List<T> <: FutureOr<String> can't be satisfied because neither
+ // List<T> <: Future<String> nor List<T> <: int can be satisfied
+ _checkIsNotSubtypeMatchOf(list(T), futureOr(stringType), [T],
+ covariant: true);
+ }
+
+ void test_x_futureOr_pass_both_branches_constraints_from_both_branches() {
+ // Future<String> <: FutureOr<T> can be satisfied because both
+ // Future<String> <: Future<T> and Future<String> <: T can be satisfied.
+ // Trying to match Future<String> <: Future<T> generates the constraint
+ // String <: T, whereas trying to match Future<String> <: T generates the
+ // constraint Future<String> <: T. We keep the constraint based on trying
+ // to match Future<String> <: Future<T>, so String <: T.
+ _checkIsSubtypeMatchOf(
+ future(stringType), futureOr(T), [T], ['String <: T'],
+ covariant: false);
+ }
+
+ void test_x_futureOr_pass_both_branches_constraints_from_future_branch() {
+ // Future<T> <: FutureOr<Object> can be satisfied because both
+ // Future<T> <: Future<Object> and Future<T> <: Object can be satisfied.
+ // Trying to match Future<T> <: Future<Object> generates the constraint
+ // T <: Object, whereas trying to match Future<T> <: Object generates no
+ // constraints, so we keep the constraint T <: Object.
+ _checkIsSubtypeMatchOf(
+ future(T), futureOr(objectType), [T], ['T <: Object'],
+ covariant: true);
+ }
+
+ void test_x_futureOr_pass_both_branches_constraints_from_nonFuture_branch() {
+ // Null <: FutureOr<T> can be satisfied because both
+ // Null <: Future<T> and Null <: T can be satisfied.
+ // Trying to match Null <: FutureOr<T> generates no constraints, whereas
+ // trying to match Null <: T generates the constraint Null <: T,
+ // so we keep the constraint Null <: T.
+ _checkIsSubtypeMatchOf(nullType, futureOr(T), [T], ['Null <: T'],
+ covariant: false);
+ }
+
+ void test_x_futureOr_pass_both_branches_no_constraints() {
+ // Future<String> <: FutureOr<Object> is satisfied because both
+ // Future<String> <: Future<Object> and Future<String> <: Object.
+ // No constraints are recorded.
+ _checkIsSubtypeMatchOf(future(stringType), futureOr(objectType), [T], [],
+ covariant: true);
+ }
+
+ void test_x_futureOr_pass_future_branch() {
+ // Future<T> <: FutureOr<String> can be satisfied because
+ // Future<T> <: Future<String> can be satisfied
+ _checkIsSubtypeMatchOf(
+ future(T), futureOr(stringType), [T], ['T <: String'],
+ covariant: true);
+ }
+
+ void test_x_futureOr_pass_nonFuture_branch() {
+ // List<T> <: FutureOr<List<String>> can be satisfied because
+ // List<T> <: List<String> can be satisfied
+ _checkIsSubtypeMatchOf(
+ list(T), futureOr(list(stringType)), [T], ['T <: String'],
+ covariant: true);
+ }
+
+ void _checkIsNotSubtypeMatchOf(
+ DartType t1, DartType t2, Iterable<TypeParameterType> typeFormals,
+ {bool covariant}) {
+ var inferrer = new GenericInferrer(
+ typeProvider, typeSystem, typeFormals.map((t) => t.element));
+ var success =
+ inferrer.tryMatchSubtypeOf(t1, t2, null, covariant: covariant);
+ expect(success, isFalse);
+ inferrer.constraints.forEach((typeParameter, constraintsForTypeParameter) {
+ expect(constraintsForTypeParameter, isEmpty);
+ });
+ }
+
+ void _checkIsSubtypeMatchOf(
+ DartType t1,
+ DartType t2,
+ Iterable<TypeParameterType> typeFormals,
+ Iterable<String> expectedConstraints,
+ {bool covariant}) {
+ var inferrer = new GenericInferrer(
+ typeProvider, typeSystem, typeFormals.map((t) => t.element));
+ var success =
+ inferrer.tryMatchSubtypeOf(t1, t2, null, covariant: covariant);
+ expect(success, isTrue);
+ var formattedConstraints = <String>[];
+ inferrer.constraints.forEach((typeParameter, constraintsForTypeParameter) {
+ for (var constraint in constraintsForTypeParameter) {
+ formattedConstraints.add(constraint.format(typeParameter.toString()));
+ }
+ });
+ expect(formattedConstraints, unorderedEquals(expectedConstraints));
+ }
+
+ void _checkOrdinarySubtypeMatch(
+ DartType t1, DartType t2, Iterable<TypeParameterType> typeFormals,
+ {bool covariant}) {
+ bool expectSuccess = typeSystem.isSubtypeOf(t1, t2);
+ if (expectSuccess) {
+ _checkIsSubtypeMatchOf(t1, t2, typeFormals, [], covariant: covariant);
+ } else {
+ _checkIsNotSubtypeMatchOf(t1, t2, typeFormals);
+ }
+ }
+
+ TypeParameterType _newTypeParameter(String name, [DartType bound]) {
+ var element = new TypeParameterElementImpl(name, 0);
+ if (bound != null) {
+ element.bound = bound;
+ }
+ return new TypeParameterTypeImpl(element);
+ }
+}
+
/**
* Tests LUB in spec mode.
*
@@ -1044,13 +1394,13 @@
}
void test_returnFunctionWithGenericParameterAndContext() {
- // <T>(T -> T) -> (T -> void)
+ // <T>(T -> T) -> (T -> Null)
var t = TypeBuilder.variable('T');
var f = TypeBuilder.function(types: [
t
], required: [
TypeBuilder.function(required: [t], result: t)
- ], result: TypeBuilder.function(required: [t], result: voidType));
+ ], result: TypeBuilder.function(required: [t], result: nullType));
expect(
_inferCall(f, [],
returnType:
@@ -1189,68 +1539,6 @@
_checkGreatestLowerBound(bottomType, typeParam, bottomType);
}
- void test_classAndSuperclass() {
- // class A
- // class B extends A
- // class C extends B
- ClassElementImpl classA = ElementFactory.classElement2("A");
- ClassElementImpl classB = ElementFactory.classElement("B", classA.type);
- ClassElementImpl classC = ElementFactory.classElement("C", classB.type);
- _checkGreatestLowerBound(classA.type, classC.type, classC.type);
- }
-
- void test_classAndSuperinterface() {
- // class A
- // class B implements A
- // class C implements B
- ClassElementImpl classA = ElementFactory.classElement2("A");
- ClassElementImpl classB = ElementFactory.classElement2("B");
- ClassElementImpl classC = ElementFactory.classElement2("C");
- classB.interfaces = <InterfaceType>[classA.type];
- classC.interfaces = <InterfaceType>[classB.type];
- _checkGreatestLowerBound(classA.type, classC.type, classC.type);
- }
-
- void test_dynamic_bottom() {
- _checkGreatestLowerBound(dynamicType, bottomType, bottomType);
- }
-
- void test_dynamic_function() {
- _checkGreatestLowerBound(
- dynamicType, simpleFunctionType, simpleFunctionType);
- }
-
- void test_dynamic_interface() {
- DartType interfaceType = ElementFactory.classElement2('A', []).type;
- _checkGreatestLowerBound(dynamicType, interfaceType, interfaceType);
- }
-
- void test_dynamic_typeParam() {
- DartType typeParam = ElementFactory.typeParameterElement('T').type;
- _checkGreatestLowerBound(dynamicType, typeParam, typeParam);
- }
-
- void test_dynamic_void() {
- // Note: _checkGreatestLowerBound tests `GLB(x, y)` as well as `GLB(y, x)`
- _checkGreatestLowerBound(dynamicType, voidType, voidType);
- }
-
- void test_bounds_of_top_types_sanity() {
- final futureOrDynamicType = futureOrType.instantiate([dynamicType]);
- final futureOrFutureOrDynamicType =
- futureOrType.instantiate([futureOrDynamicType]);
-
- // Sanity check specific cases of top for GLB/LUB.
- _checkLeastUpperBound(objectType, dynamicType, dynamicType);
- _checkGreatestLowerBound(objectType, dynamicType, objectType);
- _checkLeastUpperBound(objectType, voidType, objectType);
- _checkLeastUpperBound(futureOrDynamicType, dynamicType, dynamicType);
- _checkGreatestLowerBound(
- futureOrDynamicType, objectType, futureOrDynamicType);
- _checkGreatestLowerBound(futureOrDynamicType, futureOrFutureOrDynamicType,
- futureOrFutureOrDynamicType);
- }
-
void test_bounds_of_top_types_complete() {
// Test every combination of a subset of Tops programatically.
final futureOrDynamicType = futureOrType.instantiate([dynamicType]);
@@ -1297,6 +1585,68 @@
}
}
+ void test_bounds_of_top_types_sanity() {
+ final futureOrDynamicType = futureOrType.instantiate([dynamicType]);
+ final futureOrFutureOrDynamicType =
+ futureOrType.instantiate([futureOrDynamicType]);
+
+ // Sanity check specific cases of top for GLB/LUB.
+ _checkLeastUpperBound(objectType, dynamicType, dynamicType);
+ _checkGreatestLowerBound(objectType, dynamicType, objectType);
+ _checkLeastUpperBound(objectType, voidType, objectType);
+ _checkLeastUpperBound(futureOrDynamicType, dynamicType, dynamicType);
+ _checkGreatestLowerBound(
+ futureOrDynamicType, objectType, futureOrDynamicType);
+ _checkGreatestLowerBound(futureOrDynamicType, futureOrFutureOrDynamicType,
+ futureOrFutureOrDynamicType);
+ }
+
+ void test_classAndSuperclass() {
+ // class A
+ // class B extends A
+ // class C extends B
+ ClassElementImpl classA = ElementFactory.classElement2("A");
+ ClassElementImpl classB = ElementFactory.classElement("B", classA.type);
+ ClassElementImpl classC = ElementFactory.classElement("C", classB.type);
+ _checkGreatestLowerBound(classA.type, classC.type, classC.type);
+ }
+
+ void test_classAndSuperinterface() {
+ // class A
+ // class B implements A
+ // class C implements B
+ ClassElementImpl classA = ElementFactory.classElement2("A");
+ ClassElementImpl classB = ElementFactory.classElement2("B");
+ ClassElementImpl classC = ElementFactory.classElement2("C");
+ classB.interfaces = <InterfaceType>[classA.type];
+ classC.interfaces = <InterfaceType>[classB.type];
+ _checkGreatestLowerBound(classA.type, classC.type, classC.type);
+ }
+
+ void test_dynamic_bottom() {
+ _checkGreatestLowerBound(dynamicType, bottomType, bottomType);
+ }
+
+ void test_dynamic_function() {
+ _checkGreatestLowerBound(
+ dynamicType, simpleFunctionType, simpleFunctionType);
+ }
+
+ void test_dynamic_interface() {
+ DartType interfaceType = ElementFactory.classElement2('A', []).type;
+ _checkGreatestLowerBound(dynamicType, interfaceType, interfaceType);
+ }
+
+ void test_dynamic_typeParam() {
+ DartType typeParam = ElementFactory.typeParameterElement('T').type;
+ _checkGreatestLowerBound(dynamicType, typeParam, typeParam);
+ }
+
+ void test_dynamic_void() {
+ // Note: _checkGreatestLowerBound tests `GLB(x, y)` as well as `GLB(y, x)`
+ _checkGreatestLowerBound(dynamicType, voidType, voidType);
+ }
+
void test_functionsDifferentNamedTakeUnion() {
FunctionType type1 = _functionType([], named: {'a': intType, 'b': intType});
FunctionType type2 =
@@ -1613,13 +1963,13 @@
InterfaceType get doubleType => typeProvider.doubleType;
DartType get dynamicType => typeProvider.dynamicType;
InterfaceType get functionType => typeProvider.functionType;
+ InterfaceType get futureOrType => typeProvider.futureOrType;
InterfaceType get intType => typeProvider.intType;
InterfaceType get listType => typeProvider.listType;
InterfaceType get numType => typeProvider.numType;
InterfaceType get objectType => typeProvider.objectType;
InterfaceType get stringType => typeProvider.stringType;
DartType get voidType => VoidTypeImpl.instance;
- InterfaceType get futureOrType => typeProvider.futureOrType;
void setUp() {
typeProvider = AnalysisContextFactory.contextWithCore().typeProvider;
@@ -1692,21 +2042,6 @@
_checkGroups(dynamicType, equivalents: equivalents, subtypes: subtypes);
}
- void test_void_isTop() {
- DartType interfaceType = ElementFactory.classElement2('A', []).type;
- List<DartType> equivalents = <DartType>[dynamicType, objectType, voidType];
- List<DartType> subtypes = <DartType>[
- intType,
- doubleType,
- numType,
- stringType,
- functionType,
- interfaceType,
- bottomType
- ];
- _checkGroups(voidType, equivalents: equivalents, subtypes: subtypes);
- }
-
void test_function_subtypes_itself_top_types() {
var tops = [dynamicType, objectType, voidType];
// Add FutureOr<T> for T := dynamic, object, void
@@ -1958,6 +2293,21 @@
_checkIsStrictSubtypeOf(bottom, top);
}
+ void test_void_isTop() {
+ DartType interfaceType = ElementFactory.classElement2('A', []).type;
+ List<DartType> equivalents = <DartType>[dynamicType, objectType, voidType];
+ List<DartType> subtypes = <DartType>[
+ intType,
+ doubleType,
+ numType,
+ stringType,
+ functionType,
+ interfaceType,
+ bottomType
+ ];
+ _checkGroups(voidType, equivalents: equivalents, subtypes: subtypes);
+ }
+
void _checkEquivalent(DartType type1, DartType type2) {
_checkIsSubtypeOf(type1, type2);
_checkIsSubtypeOf(type2, type1);
diff --git a/pkg/analyzer/test/generated/utilities_test.dart b/pkg/analyzer/test/generated/utilities_test.dart
index 7781977..f960be0 100644
--- a/pkg/analyzer/test/generated/utilities_test.dart
+++ b/pkg/analyzer/test/generated/utilities_test.dart
@@ -2546,26 +2546,43 @@
}, throwsArgumentError);
}
- void test_firstLine() {
+ void test_getLocation_firstLine() {
LineInfo info = new LineInfo(<int>[0, 12, 34]);
CharacterLocation location = info.getLocation(4);
expect(location.lineNumber, 1);
expect(location.columnNumber, 5);
}
- void test_lastLine() {
+ void test_getLocation_lastLine() {
LineInfo info = new LineInfo(<int>[0, 12, 34]);
CharacterLocation location = info.getLocation(36);
expect(location.lineNumber, 3);
expect(location.columnNumber, 3);
}
- void test_middleLine() {
+ void test_getLocation_middleLine() {
LineInfo info = new LineInfo(<int>[0, 12, 34]);
CharacterLocation location = info.getLocation(12);
expect(location.lineNumber, 2);
expect(location.columnNumber, 1);
}
+
+ void test_getOffsetOfLine() {
+ LineInfo info = new LineInfo(<int>[0, 12, 34]);
+ expect(0, info.getOffsetOfLine(0));
+ expect(12, info.getOffsetOfLine(1));
+ expect(34, info.getOffsetOfLine(2));
+ }
+
+ void test_getOffsetOfLineAfter() {
+ LineInfo info = new LineInfo(<int>[0, 12, 34]);
+
+ expect(info.getOffsetOfLineAfter(0), 12);
+ expect(info.getOffsetOfLineAfter(11), 12);
+
+ expect(info.getOffsetOfLineAfter(12), 34);
+ expect(info.getOffsetOfLineAfter(33), 34);
+ }
}
class ListGetter_NodeReplacerTest_test_adjacentStrings
diff --git a/pkg/analyzer/test/src/dart/analysis/session_helper_test.dart b/pkg/analyzer/test/src/dart/analysis/session_helper_test.dart
index 47c5338..81e7cbb 100644
--- a/pkg/analyzer/test/src/dart/analysis/session_helper_test.dart
+++ b/pkg/analyzer/test/src/dart/analysis/session_helper_test.dart
@@ -2,6 +2,7 @@
// 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/dart/element/element.dart';
import 'package:analyzer/src/dart/analysis/session_helper.dart';
import 'package:test/test.dart';
import 'package:test_reflective_loader/test_reflective_loader.dart';
@@ -79,6 +80,99 @@
expect(element, isNull);
}
+ test_getTopLevelPropertyAccessor_defined_getter() async {
+ var path = _p('/test.dart');
+ var file = provider.newFile(path, r'''
+int get a => 0;
+''');
+ String uri = file.toUri().toString();
+
+ var element = await sessionHelper.getTopLevelPropertyAccessor(uri, 'a');
+ expect(element, isNotNull);
+ expect(element.kind, ElementKind.GETTER);
+ expect(element.displayName, 'a');
+ }
+
+ test_getTopLevelPropertyAccessor_defined_setter() async {
+ var path = _p('/test.dart');
+ var file = provider.newFile(path, r'''
+set a(_) {}
+''');
+ String uri = file.toUri().toString();
+
+ var element = await sessionHelper.getTopLevelPropertyAccessor(uri, 'a=');
+ expect(element, isNotNull);
+ expect(element.kind, ElementKind.SETTER);
+ expect(element.displayName, 'a');
+ }
+
+ test_getTopLevelPropertyAccessor_defined_variable() async {
+ var path = _p('/test.dart');
+ var file = provider.newFile(path, r'''
+int a;
+''');
+ String uri = file.toUri().toString();
+
+ var element = await sessionHelper.getTopLevelPropertyAccessor(uri, 'a');
+ expect(element, isNotNull);
+ expect(element.kind, ElementKind.GETTER);
+ expect(element.displayName, 'a');
+ }
+
+ test_getTopLevelPropertyAccessor_exported() async {
+ var a = _p('/a.dart');
+ var b = _p('/b.dart');
+ provider.newFile(a, r'''
+int a;
+''');
+ var bFile = provider.newFile(b, r'''
+export 'a.dart';
+''');
+ String bUri = bFile.toUri().toString();
+
+ var element = await sessionHelper.getTopLevelPropertyAccessor(bUri, 'a');
+ expect(element, isNotNull);
+ expect(element.kind, ElementKind.GETTER);
+ expect(element.displayName, 'a');
+ }
+
+ test_getTopLevelPropertyAccessor_imported() async {
+ var a = _p('/a.dart');
+ var b = _p('/b.dart');
+ provider.newFile(a, r'''
+int a;
+''');
+ var bFile = provider.newFile(b, r'''
+import 'a.dart';
+''');
+ String bUri = bFile.toUri().toString();
+
+ var element = await sessionHelper.getTopLevelPropertyAccessor(bUri, 'a');
+ expect(element, isNull);
+ }
+
+ test_getTopLevelPropertyAccessor_notDefined() async {
+ var path = _p('/test.dart');
+ var file = provider.newFile(path, r'''
+int a;
+''');
+ String uri = file.toUri().toString();
+
+ var element = await sessionHelper.getTopLevelPropertyAccessor(uri, 'b');
+ expect(element, isNull);
+ }
+
+ test_getTopLevelPropertyAccessor_notPropertyAccessor() async {
+ var path = _p('/test.dart');
+ var file = provider.newFile(path, r'''
+int a() {}
+''');
+ String uri = file.toUri().toString();
+
+ var element = await sessionHelper.getTopLevelPropertyAccessor(uri, 'a');
+ expect(element, isNull);
+ }
+
/// Return the [provider] specific path for the given Posix [path].
String _p(String path) => provider.convertPath(path);
}
diff --git a/pkg/analyzer/test/src/fasta/recovery/partial_code/import_directive_test.dart b/pkg/analyzer/test/src/fasta/recovery/partial_code/import_directive_test.dart
index e04d1b4..dd46a45 100644
--- a/pkg/analyzer/test/src/fasta/recovery/partial_code/import_directive_test.dart
+++ b/pkg/analyzer/test/src/fasta/recovery/partial_code/import_directive_test.dart
@@ -77,7 +77,7 @@
],
"import 'a.dart' if (b) '';"),
new TestDescriptor(
- 'ifCondition',
+ 'as',
"import 'a.dart' as",
[
ParserErrorCode.MISSING_IDENTIFIER,
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 735402b..eb14122 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
@@ -26,6 +26,7 @@
import 'switch_statement_test.dart' as switch_statement;
import 'top_level_variable_test.dart' as top_level_variable;
import 'try_statement_test.dart' as try_statement;
+import 'typedef_test.dart' as typedef_declaration;
import 'while_statement_test.dart' as while_statement;
import 'yield_statement_test.dart' as yield_statement;
@@ -53,6 +54,7 @@
switch_statement.main();
top_level_variable.main();
try_statement.main();
+ typedef_declaration.main();
while_statement.main();
yield_statement.main();
});
diff --git a/pkg/analyzer/test/src/fasta/recovery/partial_code/typedef_test.dart b/pkg/analyzer/test/src/fasta/recovery/partial_code/typedef_test.dart
new file mode 100644
index 0000000..9d91815
--- /dev/null
+++ b/pkg/analyzer/test/src/fasta/recovery/partial_code/typedef_test.dart
@@ -0,0 +1,50 @@
+// 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.
+
+import 'package:analyzer/src/dart/error/syntactic_errors.dart';
+
+import 'partial_code_support.dart';
+
+main() {
+ new TypedefTest().buildAll();
+}
+
+class TypedefTest extends PartialCodeTest {
+ buildAll() {
+ List<String> allExceptEof =
+ PartialCodeTest.declarationSuffixes.map((t) => t.name).toList();
+ buildTests(
+ 'typedef',
+ [
+ new TestDescriptor(
+ 'keyword',
+ 'typedef',
+ [
+ ParserErrorCode.MISSING_IDENTIFIER,
+ ParserErrorCode.MISSING_TYPEDEF_PARAMETERS,
+ ParserErrorCode.EXPECTED_TOKEN
+ ],
+ "typedef _s_();",
+ failing: [
+ 'functionVoid',
+ 'functionNonVoid',
+ 'var',
+ 'const',
+ 'final',
+ 'getter'
+ ]),
+ new TestDescriptor(
+ 'keywordEquals',
+ 'typedef =',
+ [
+ ParserErrorCode.MISSING_IDENTIFIER,
+ ParserErrorCode.EXPECTED_TYPE_NAME,
+ ParserErrorCode.EXPECTED_TOKEN
+ ],
+ "typedef _s_ = _s_;",
+ failing: allExceptEof),
+ ],
+ PartialCodeTest.declarationSuffixes);
+ }
+}
diff --git a/pkg/analyzer_plugin/lib/src/utilities/change_builder/change_builder_dart.dart b/pkg/analyzer_plugin/lib/src/utilities/change_builder/change_builder_dart.dart
index 19623cc..b9b3f80 100644
--- a/pkg/analyzer_plugin/lib/src/utilities/change_builder/change_builder_dart.dart
+++ b/pkg/analyzer_plugin/lib/src/utilities/change_builder/change_builder_dart.dart
@@ -580,6 +580,30 @@
}
@override
+ void writeReference(Element element) {
+ if (element.enclosingElement is CompilationUnitElement) {
+ LibraryElement definingLibrary = element.library;
+ LibraryElement importingLibrary =
+ dartFileEditBuilder.unit.element.library;
+
+ // TODO(scheglov) Extract this code (it is already used twice).
+ // TODO(scheglov) Consider updating `show` combinator to show the element.
+ ImportElement existingImport =
+ _getImportElement(element, importingLibrary);
+ if (existingImport != null) {
+ if (existingImport.prefix != null) {
+ write(existingImport.prefix.displayName);
+ write('.');
+ }
+ } else {
+ importLibrary(definingLibrary.source);
+ }
+ }
+
+ write(element.displayName);
+ }
+
+ @override
bool writeType(DartType type,
{bool addSupertypeProposals: false,
String groupName,
@@ -841,9 +865,7 @@
* Return the namespace added by the given import [element].
*/
Map<String, Element> _getImportNamespace(ImportElement element) {
- NamespaceBuilder builder = new NamespaceBuilder();
- Namespace namespace = builder.createImportNamespaceForDirective(element);
- return namespace.definedNames;
+ return element.namespace.definedNames;
}
/**
@@ -1402,19 +1424,22 @@
return;
}
- // If still at the beginning of the file, skip shebang and line comments.
- _InsertionDescription desc = _getInsertDescTop();
- int offset = desc.offset;
+ // If still at the beginning of the file, add before the first declaration.
+ int offset;
+ bool insertEmptyLineAfter = false;
+ if (unit.declarations.isNotEmpty) {
+ offset = unit.declarations.first.offset;
+ insertEmptyLineAfter = true;
+ } else {
+ offset = unit.end;
+ }
for (int i = 0; i < uriList.length; i++) {
String importUri = uriList[i];
addInsertion(offset, (EditBuilder builder) {
- if (i == 0 && desc.insertEmptyLineBefore) {
- builder.writeln();
- }
builder.write("import '");
builder.write(importUri);
builder.writeln("';");
- if (i == uriList.length - 1 && desc.insertEmptyLineAfter) {
+ if (i == uriList.length - 1 && insertEmptyLineAfter) {
builder.writeln();
}
});
@@ -1422,63 +1447,6 @@
}
/**
- * Returns an insertion description describing where to insert a new directive
- * or a top-level declaration at the top of the file.
- */
- _InsertionDescription _getInsertDescTop() {
- // skip leading line comments
- int offset = 0;
- bool insertEmptyLineBefore = false;
- bool insertEmptyLineAfter = false;
- String source = unit.element.context.getContents(unit.element.source).data;
- var lineInfo = unit.lineInfo;
- // skip hash-bang
- if (offset < source.length - 2) {
- String linePrefix = _getText(source, offset, 2);
- if (linePrefix == "#!") {
- insertEmptyLineBefore = true;
- offset = lineInfo.getOffsetOfLineAfter(offset);
- // skip empty lines to first line comment
- int emptyOffset = offset;
- while (emptyOffset < source.length - 2) {
- int nextLineOffset = lineInfo.getOffsetOfLineAfter(emptyOffset);
- String line = source.substring(emptyOffset, nextLineOffset);
- if (line.trim().isEmpty) {
- emptyOffset = nextLineOffset;
- continue;
- } else if (line.startsWith("//")) {
- offset = emptyOffset;
- break;
- } else {
- break;
- }
- }
- }
- }
- // skip line comments
- while (offset < source.length - 2) {
- String linePrefix = _getText(source, offset, 2);
- if (linePrefix == "//") {
- insertEmptyLineBefore = true;
- offset = lineInfo.getOffsetOfLineAfter(offset);
- } else {
- break;
- }
- }
- // determine if empty line is required after
- int currentLine = lineInfo.getLocation(offset).lineNumber;
- if (currentLine + 1 < lineInfo.lineCount) {
- int nextLineOffset = lineInfo.getOffsetOfLine(currentLine + 1);
- String insertLine = source.substring(offset, nextLineOffset);
- if (!insertLine.trim().isEmpty) {
- insertEmptyLineAfter = true;
- }
- }
- return new _InsertionDescription(
- offset, insertEmptyLineBefore, insertEmptyLineAfter);
- }
-
- /**
* Computes the best URI to import [what] into [from].
*/
String _getLibrarySourceUri(LibraryElement from, Source what) {
@@ -1496,13 +1464,6 @@
}
/**
- * Returns the text of the given range in the unit.
- */
- String _getText(String content, int offset, int length) {
- return content.substring(offset, offset + length);
- }
-
- /**
* Create an edit to replace the return type of the innermost function
* containing the given [node] with the type `Future`. The [typeProvider] is
* used to check the current return type, because if it is already `Future` no
@@ -1665,11 +1626,3 @@
return null;
}
}
-
-class _InsertionDescription {
- final int offset;
- final bool insertEmptyLineBefore;
- final bool insertEmptyLineAfter;
- _InsertionDescription(
- this.offset, this.insertEmptyLineBefore, this.insertEmptyLineAfter);
-}
diff --git a/pkg/analyzer_plugin/lib/utilities/change_builder/change_builder_dart.dart b/pkg/analyzer_plugin/lib/utilities/change_builder/change_builder_dart.dart
index 86545f0..f1f68be 100644
--- a/pkg/analyzer_plugin/lib/utilities/change_builder/change_builder_dart.dart
+++ b/pkg/analyzer_plugin/lib/utilities/change_builder/change_builder_dart.dart
@@ -223,6 +223,13 @@
void writeParametersMatchingArguments(ArgumentList arguments);
/**
+ * Write the code that references the [element]. If the [element] is a
+ * top-level element that has not been imported into the current library,
+ * imports will be updated.
+ */
+ void writeReference(Element element);
+
+ /**
* Write the code for a type annotation for the given [type]. If the [type] is
* either `null` or represents the type 'dynamic', then the behavior depends
* on whether a type is [required]. If [required] is `true`, then 'var' will
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 fdb1008..d8d76f8 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
@@ -154,6 +154,50 @@
''');
}
+ test_importLibrary_noDirectives_docComment() async {
+ await _assertImportLibraries('''
+/// Documentation comment.
+/// Continues.
+void main() {}
+''', ['dart:async'], '''
+import 'dart:async';
+
+/// Documentation comment.
+/// Continues.
+void main() {}
+''');
+ }
+
+ test_importLibrary_noDirectives_hashBang() async {
+ await _assertImportLibraries('''
+#!/bin/dart
+
+void main() {}
+''', ['dart:async'], '''
+#!/bin/dart
+
+import 'dart:async';
+
+void main() {}
+''');
+ }
+
+ test_importLibrary_noDirectives_lineComment() async {
+ await _assertImportLibraries('''
+// Not documentation comment.
+// Continues.
+
+void main() {}
+''', ['dart:async'], '''
+// Not documentation comment.
+// Continues.
+
+import 'dart:async';
+
+void main() {}
+''');
+ }
+
test_importLibrary_package_afterDart() async {
await _assertImportLibraries('''
import 'dart:async';
@@ -1577,6 +1621,99 @@
expect(edit.replacement, equalsIgnoringWhitespace('String s, int i'));
}
+ test_writeReference_method() async {
+ String aPath = provider.convertPath('/a.dart');
+ addSource(aPath, r'''
+class A {
+ void foo() {}
+}
+''');
+
+ String path = provider.convertPath('/test.dart');
+ String content = r'''
+import 'a.dart';
+''';
+ addSource(path, content);
+
+ var aElement = await _getClassElement(aPath, 'A');
+ var fooElement = aElement.methods[0];
+
+ DartChangeBuilderImpl builder = new DartChangeBuilder(session);
+ await builder.addFileEdit(path, (DartFileEditBuilder builder) {
+ builder.addInsertion(content.length - 1, (DartEditBuilder builder) {
+ builder.writeReference(fooElement);
+ });
+ });
+ SourceEdit edit = getEdit(builder);
+ expect(edit.replacement, equalsIgnoringWhitespace('foo'));
+ }
+
+ test_writeReference_topLevel_hasImport_noPrefix() async {
+ String aPath = provider.convertPath('/a.dart');
+ addSource(aPath, 'const a = 42;');
+
+ String path = provider.convertPath('/test.dart');
+ String content = r'''
+import 'a.dart';
+''';
+ addSource(path, content);
+
+ var aElement = await _getTopLevelAccessorElement(aPath, 'a');
+
+ DartChangeBuilderImpl builder = new DartChangeBuilder(session);
+ await builder.addFileEdit(path, (DartFileEditBuilder builder) {
+ builder.addInsertion(content.length - 1, (DartEditBuilder builder) {
+ builder.writeReference(aElement);
+ });
+ });
+ SourceEdit edit = getEdit(builder);
+ expect(edit.replacement, equalsIgnoringWhitespace('a'));
+ }
+
+ test_writeReference_topLevel_hasImport_prefix() async {
+ String aPath = provider.convertPath('/a.dart');
+ addSource(aPath, 'const a = 42;');
+
+ String path = provider.convertPath('/test.dart');
+ String content = r'''
+import 'a.dart' as p;
+''';
+ addSource(path, content);
+
+ var aElement = await _getTopLevelAccessorElement(aPath, 'a');
+
+ DartChangeBuilderImpl builder = new DartChangeBuilder(session);
+ await builder.addFileEdit(path, (DartFileEditBuilder builder) {
+ builder.addInsertion(content.length - 1, (DartEditBuilder builder) {
+ builder.writeReference(aElement);
+ });
+ });
+ SourceEdit edit = getEdit(builder);
+ expect(edit.replacement, equalsIgnoringWhitespace('p.a'));
+ }
+
+ test_writeReference_topLevel_noImport() async {
+ String aPath = provider.convertPath('/a.dart');
+ addSource(aPath, 'const a = 42;');
+
+ String path = provider.convertPath('/test.dart');
+ String content = '';
+ addSource(path, content);
+
+ var aElement = await _getTopLevelAccessorElement(aPath, 'a');
+
+ DartChangeBuilderImpl builder = new DartChangeBuilder(session);
+ await builder.addFileEdit(path, (DartFileEditBuilder builder) {
+ builder.addInsertion(content.length - 1, (DartEditBuilder builder) {
+ builder.writeReference(aElement);
+ });
+ });
+ List<SourceEdit> edits = getEdits(builder);
+ expect(edits, hasLength(2));
+ expect(edits[0].replacement, equalsIgnoringWhitespace("import 'a.dart';"));
+ expect(edits[1].replacement, equalsIgnoringWhitespace('a'));
+ }
+
test_writeType_dynamic() async {
String path = provider.convertPath('/test.dart');
String content = 'class A {}';
@@ -1912,6 +2049,12 @@
return result.element.getType(name);
}
+ Future<PropertyAccessorElement> _getTopLevelAccessorElement(
+ String path, String name) async {
+ UnitElementResult result = await driver.getUnitElement(path);
+ return result.element.accessors.firstWhere((v) => v.name == name);
+ }
+
Future<DartType> _getType(String path, String name) async {
ClassElement classElement = await _getClassElement(path, name);
return classElement.type;
diff --git a/pkg/compiler/lib/src/common_elements.dart b/pkg/compiler/lib/src/common_elements.dart
index 055d40e..d0a95e6 100644
--- a/pkg/compiler/lib/src/common_elements.dart
+++ b/pkg/compiler/lib/src/common_elements.dart
@@ -576,8 +576,10 @@
ClassEntity get controllerStream =>
_findAsyncHelperClass("_ControllerStream");
+ ClassEntity get streamIterator => _findAsyncHelperClass("StreamIterator");
+
ConstructorEntity get streamIteratorConstructor =>
- _env.lookupConstructor(_findAsyncHelperClass("StreamIterator"), "");
+ _env.lookupConstructor(streamIterator, "");
FunctionEntity _syncStarIterableFactory;
FunctionEntity get syncStarIterableFactory => _syncStarIterableFactory ??=
diff --git a/pkg/compiler/lib/src/deferred_load.dart b/pkg/compiler/lib/src/deferred_load.dart
index c7db088..1e56455 100644
--- a/pkg/compiler/lib/src/deferred_load.dart
+++ b/pkg/compiler/lib/src/deferred_load.dart
@@ -23,7 +23,7 @@
show AstElement, ClassElement, Element, MethodElement, LocalFunctionElement;
import 'elements/entities.dart';
import 'kernel/kelements.dart' show KLocalFunction;
-import 'universe/use.dart' show StaticUse, StaticUseKind, TypeUse, TypeUseKind;
+import 'universe/use.dart';
import 'universe/world_impact.dart'
show ImpactUseCase, WorldImpact, WorldImpactVisitorImpl;
import 'util/uri_extras.dart' as uri_extras;
@@ -320,6 +320,18 @@
case StaticUseKind.CONST_CONSTRUCTOR_INVOKE:
_collectTypeDependencies(staticUse.type, elements);
break;
+ case StaticUseKind.INVOKE:
+ case StaticUseKind.CLOSURE_CALL:
+ case StaticUseKind.DIRECT_INVOKE:
+ // TODO(johnniwinther): Use rti need data to skip unneeded type
+ // arguments.
+ List<DartType> typeArguments = staticUse.typeArguments;
+ if (typeArguments != null) {
+ for (DartType typeArgument in typeArguments) {
+ _collectTypeDependencies(typeArgument, elements);
+ }
+ }
+ break;
default:
}
}, visitTypeUse: (TypeUse typeUse) {
@@ -358,6 +370,15 @@
}
break;
}
+ }, visitDynamicUse: (DynamicUse dynamicUse) {
+ // TODO(johnniwinther): Use rti need data to skip unneeded type
+ // arguments.
+ List<DartType> typeArguments = dynamicUse.typeArguments;
+ if (typeArguments != null) {
+ for (DartType typeArgument in typeArguments) {
+ _collectTypeDependencies(typeArgument, elements);
+ }
+ }
}),
DeferredLoadTask.IMPACT_USE);
}
diff --git a/pkg/compiler/lib/src/dump_info.dart b/pkg/compiler/lib/src/dump_info.dart
index 165643c..dee89c3 100644
--- a/pkg/compiler/lib/src/dump_info.dart
+++ b/pkg/compiler/lib/src/dump_info.dart
@@ -8,7 +8,6 @@
show ChunkedConversionSink, JsonEncoder, StringConversionSink;
import 'package:dart2js_info/info.dart';
-import 'package:path/path.dart' as p;
import '../compiler_new.dart';
import 'common/names.dart';
@@ -78,17 +77,7 @@
libname = '<unnamed>';
}
int size = compiler.dumpInfoTask.sizeOf(lib);
-
- var uri = lib.canonicalUri;
- if (Uri.base.isScheme('file') && lib.canonicalUri.isScheme('file')) {
- var basePath = p.fromUri(Uri.base);
- var libPath = p.fromUri(lib.canonicalUri);
- if (p.isWithin(basePath, libPath)) {
- uri = p.toUri(p.relative(libPath, from: basePath));
- }
- }
-
- LibraryInfo info = new LibraryInfo(libname, uri, null, size);
+ LibraryInfo info = new LibraryInfo(libname, lib.canonicalUri, null, size);
_entityToInfo[lib] = info;
environment.forEachLibraryMember(lib, (MemberEntity member) {
diff --git a/pkg/compiler/lib/src/inferrer/inferrer_engine.dart b/pkg/compiler/lib/src/inferrer/inferrer_engine.dart
index 44c7969..184b42e 100644
--- a/pkg/compiler/lib/src/inferrer/inferrer_engine.dart
+++ b/pkg/compiler/lib/src/inferrer/inferrer_engine.dart
@@ -60,7 +60,7 @@
ClosedWorld get closedWorld;
ClosedWorldRefiner get closedWorldRefiner;
DiagnosticReporter get reporter;
- CommonMasks get commonMasks => closedWorld.commonMasks;
+ CommonMasks get commonMasks => closedWorld.abstractValueDomain;
CommonElements get commonElements => closedWorld.commonElements;
// TODO(johnniwinther): This should be part of [ClosedWorld] or
diff --git a/pkg/compiler/lib/src/inferrer/type_graph_inferrer.dart b/pkg/compiler/lib/src/inferrer/type_graph_inferrer.dart
index d0d98eb..b59bf9f 100644
--- a/pkg/compiler/lib/src/inferrer/type_graph_inferrer.dart
+++ b/pkg/compiler/lib/src/inferrer/type_graph_inferrer.dart
@@ -61,7 +61,7 @@
String get name => 'Graph inferrer';
- CommonMasks get commonMasks => closedWorld.commonMasks;
+ CommonMasks get commonMasks => closedWorld.abstractValueDomain;
TypeMask get _dynamicType => commonMasks.dynamicType;
diff --git a/pkg/compiler/lib/src/inferrer/type_graph_nodes.dart b/pkg/compiler/lib/src/inferrer/type_graph_nodes.dart
index a5ea018..d17c19d 100644
--- a/pkg/compiler/lib/src/inferrer/type_graph_nodes.dart
+++ b/pkg/compiler/lib/src/inferrer/type_graph_nodes.dart
@@ -2005,7 +2005,7 @@
} else if (annotation.isVoid) {
return type;
} else if (annotation.isTypedef || annotation.isFunctionType) {
- otherType = closedWorld.commonMasks.functionType;
+ otherType = closedWorld.abstractValueDomain.functionType;
} else if (annotation.isFutureOr) {
// TODO(johnniwinther): Narrow FutureOr types.
return type;
diff --git a/pkg/compiler/lib/src/inferrer/type_system.dart b/pkg/compiler/lib/src/inferrer/type_system.dart
index 90c3101..3d3c9c8 100644
--- a/pkg/compiler/lib/src/inferrer/type_system.dart
+++ b/pkg/compiler/lib/src/inferrer/type_system.dart
@@ -99,7 +99,7 @@
nonNullEmptyType = getConcreteTypeFor(commonMasks.emptyType);
}
- CommonMasks get commonMasks => closedWorld.commonMasks;
+ CommonMasks get commonMasks => closedWorld.abstractValueDomain;
/// Used to group [TypeInformation] nodes by the element that triggered their
/// creation.
diff --git a/pkg/compiler/lib/src/js_emitter/instantiation_stub_generator.dart b/pkg/compiler/lib/src/js_emitter/instantiation_stub_generator.dart
index 35ff906..865fc15 100644
--- a/pkg/compiler/lib/src/js_emitter/instantiation_stub_generator.dart
+++ b/pkg/compiler/lib/src/js_emitter/instantiation_stub_generator.dart
@@ -4,6 +4,7 @@
library dart2js.js_emitter.instantiation_stub_generator;
+import '../common/names.dart';
import '../common_elements.dart' show CommonElements;
import '../elements/entities.dart';
import '../io/source_information.dart';
@@ -147,22 +148,49 @@
Map<Selector, SelectorConstraints> callSelectors =
_codegenWorldBuilder.invocationsByName(call);
+ Set<ParameterStructure> computeLiveParameterStructures() {
+ Set<ParameterStructure> parameterStructures =
+ new Set<ParameterStructure>();
+
+ void process(Iterable<FunctionEntity> functions) {
+ for (FunctionEntity function in functions) {
+ if (function.parameterStructure.typeParameters == typeArgumentCount) {
+ parameterStructures.add(function.parameterStructure);
+ }
+ }
+ }
+
+ process(_codegenWorldBuilder.closurizedStatics);
+ process(_codegenWorldBuilder.closurizedMembers);
+ process(_codegenWorldBuilder.genericInstanceMethods.where(
+ (FunctionEntity function) =>
+ function.name == Identifiers.call &&
+ function.enclosingClass.isClosure));
+
+ return parameterStructures;
+ }
+
List<StubMethod> stubs = <StubMethod>[];
// For every call-selector generate a stub to the corresponding selector
// with filled-in type arguments.
+ Set<ParameterStructure> parameterStructures;
for (Selector selector in callSelectors.keys) {
CallStructure callStructure = selector.callStructure;
if (callStructure.typeArgumentCount != 0) continue;
- // TODO(sra): Eliminate selectors that are not supported by any generic
- // function with [typeArgumentCount] type arguments.
- CallStructure genericCallStructrure =
+ CallStructure genericCallStructure =
callStructure.withTypeArgumentCount(typeArgumentCount);
- Selector genericSelector =
- new Selector.call(selector.memberName, genericCallStructrure);
- stubs.add(_generateStub(
- instantiationClass, functionField, selector, genericSelector));
+ parameterStructures ??= computeLiveParameterStructures();
+ for (ParameterStructure parameterStructure in parameterStructures) {
+ if (genericCallStructure.signatureApplies(parameterStructure)) {
+ Selector genericSelector =
+ new Selector.call(selector.memberName, genericCallStructure);
+ stubs.add(_generateStub(
+ instantiationClass, functionField, selector, genericSelector));
+ break;
+ }
+ }
}
stubs.add(_generateSignatureStub(functionField));
diff --git a/pkg/compiler/lib/src/js_emitter/startup_emitter/fragment_emitter.dart b/pkg/compiler/lib/src/js_emitter/startup_emitter/fragment_emitter.dart
index 144e302..b47e96d 100644
--- a/pkg/compiler/lib/src/js_emitter/startup_emitter/fragment_emitter.dart
+++ b/pkg/compiler/lib/src/js_emitter/startup_emitter/fragment_emitter.dart
@@ -735,17 +735,10 @@
// If there are many references to `this`, cache it in a local.
if (cls.fields.length + (cls.hasRtiField ? 1 : 0) >= 4) {
- // TODO(29455): Fix js_ast printer and minifier to avoid conflicts between
- // js.Name and string-named variables, then use '_' in the js template
- // text.
-
- // We pick '_' in minified mode because no field minifies to '_'. This
- // avoids a conflict with one of the parameters which are named the same
- // as the fields. Unminified, a field might have the name '_', so we pick
- // '$_', which is an impossible member name since we escape '$'s in names.
- js.Name underscore = compiler.options.enableMinification
- ? new StringBackedName('_')
- : new StringBackedName(r'$_');
+ // Parameters are named t0, t1, etc, so '_' will not conflict. Forcing '_'
+ // in minified mode works because no parameter or local also minifies to
+ // '_' (the minifier doesn't know '_' is available).
+ js.Name underscore = new StringBackedName('_');
statements.add(js.js.statement('var # = this;', underscore));
thisRef = underscore;
} else {
diff --git a/pkg/compiler/lib/src/kernel/kernel_backend_strategy.dart b/pkg/compiler/lib/src/kernel/kernel_backend_strategy.dart
index b575680..3c3f6bf 100644
--- a/pkg/compiler/lib/src/kernel/kernel_backend_strategy.dart
+++ b/pkg/compiler/lib/src/kernel/kernel_backend_strategy.dart
@@ -149,7 +149,7 @@
TypeMask typeOfListLiteral(
MemberEntity owner, ir.ListLiteral listLiteral, ClosedWorld closedWorld) {
return _resultOf(owner).typeOfListLiteral(listLiteral) ??
- closedWorld.commonMasks.dynamicType;
+ closedWorld.abstractValueDomain.dynamicType;
}
TypeMask typeOfIterator(ir.ForInStatement node) {
@@ -183,7 +183,7 @@
mask.containsOnly(
closedWorld.commonElements.jsUnmodifiableArrayClass) ||
mask.containsOnlyString(closedWorld) ||
- closedWorld.commonMasks.isTypedArray(mask)) {
+ closedWorld.abstractValueDomain.isTypedArray(mask)) {
return true;
}
return false;
diff --git a/pkg/compiler/lib/src/native/ssa.dart b/pkg/compiler/lib/src/native/ssa.dart
index 5fc3b5d..240df64 100644
--- a/pkg/compiler/lib/src/native/ssa.dart
+++ b/pkg/compiler/lib/src/native/ssa.dart
@@ -101,7 +101,7 @@
effects: new SideEffects()));
// TODO(johnniwinther): Provide source information.
builder
- .close(new HReturn(builder.pop(), null))
+ .close(new HReturn(builder.abstractValueDomain, builder.pop(), null))
.addSuccessor(builder.graph.exit);
} else {
if (parameters.parameterCount != 0) {
diff --git a/pkg/compiler/lib/src/ordered_typeset.dart b/pkg/compiler/lib/src/ordered_typeset.dart
index 860d67f..52b4d61 100644
--- a/pkg/compiler/lib/src/ordered_typeset.dart
+++ b/pkg/compiler/lib/src/ordered_typeset.dart
@@ -36,8 +36,7 @@
final Link<InterfaceType> types;
final Link<InterfaceType> _supertypes;
- OrderedTypeSet.internal(List<Link<InterfaceType>> this._levels,
- Link<InterfaceType> this.types, Link<InterfaceType> this._supertypes);
+ OrderedTypeSet.internal(this._levels, this.types, this._supertypes);
factory OrderedTypeSet.singleton(InterfaceType type) {
Link<InterfaceType> types =
diff --git a/pkg/compiler/lib/src/ssa/builder.dart b/pkg/compiler/lib/src/ssa/builder.dart
index 8a75570..a18d29f 100644
--- a/pkg/compiler/lib/src/ssa/builder.dart
+++ b/pkg/compiler/lib/src/ssa/builder.dart
@@ -480,7 +480,7 @@
// Don't inline operator== methods if the parameter can be null.
if (function.name == '==') {
if (function.enclosingClass != commonElements.objectClass &&
- providedArguments[1].canBeNull()) {
+ providedArguments[1].canBeNull(abstractValueDomain)) {
return false;
}
}
@@ -727,8 +727,8 @@
push(invokeJsInteropFunction(functionElement, parameters.values.toList(),
sourceInformationBuilder.buildGeneric(function)));
var value = pop();
- closeAndGotoExit(new HReturn(
- value, sourceInformationBuilder.buildReturn(functionElement.node)));
+ closeAndGotoExit(new HReturn(abstractValueDomain, value,
+ sourceInformationBuilder.buildReturn(functionElement.node)));
return closeFunction();
}
assert(!function.modifiers.isExternal, failedAt(functionElement));
@@ -747,6 +747,7 @@
},
visitThen: () {
closeAndGotoExit(new HReturn(
+ abstractValueDomain,
graph.addConstantBool(false, closedWorld),
sourceInformationBuilder
.buildImplicitReturn(functionElement)));
@@ -756,8 +757,8 @@
}
}
if (const bool.fromEnvironment('unreachable-throw')) {
- var emptyParameters =
- parameters.values.where((p) => p.instructionType.isEmpty);
+ var emptyParameters = parameters.values
+ .where((p) => abstractValueDomain.isEmpty(p.instructionType));
if (emptyParameters.length > 0) {
addComment('${emptyParameters} inferred as [empty]');
pushInvokeStatic(
@@ -796,7 +797,7 @@
graph.entry.addBefore(graph.entry.last, parameter);
HInstruction value = typeBuilder.potentiallyCheckOrTrustTypeOfParameter(
parameter, field.type);
- add(new HFieldSet(field, thisInstruction, value));
+ add(new HFieldSet(abstractValueDomain, field, thisInstruction, value));
return closeFunction();
}
@@ -827,8 +828,8 @@
}
}
- closeAndGotoExit(new HReturn(
- value, sourceInformationBuilder.buildReturn(sourceInfoNode)));
+ closeAndGotoExit(new HReturn(abstractValueDomain, value,
+ sourceInformationBuilder.buildReturn(sourceInfoNode)));
return closeFunction();
}
@@ -1358,7 +1359,8 @@
add(new HFieldGet(null, newObject, commonMasks.dynamicType,
isAssignable: false));
for (int i = 0; i < fields.length; i++) {
- add(new HFieldSet(fields[i], newObject, constructorArguments[i]));
+ add(new HFieldSet(abstractValueDomain, fields[i], newObject,
+ constructorArguments[i]));
}
}
removeInlinedInstantiation(type);
@@ -1431,7 +1433,7 @@
}
}
if (inliningStack.isEmpty) {
- closeAndGotoExit(new HReturn(newObject,
+ closeAndGotoExit(new HReturn(abstractValueDomain, newObject,
sourceInformationBuilder.buildImplicitReturn(functionElement)));
return closeFunction();
} else {
@@ -1466,7 +1468,7 @@
parameters,
sourceInformationBuilder.buildDeclaration(element),
isGenerativeConstructorBody: element.isGenerativeConstructorBody);
- close(new HGoto()).addSuccessor(block);
+ close(new HGoto(abstractValueDomain)).addSuccessor(block);
open(block);
@@ -1598,8 +1600,8 @@
HGraph closeFunction() {
// TODO(kasperl): Make this goto an implicit return.
- if (!isAborted()) closeAndGotoExit(new HGoto());
- graph.finalize();
+ if (!isAborted()) closeAndGotoExit(new HGoto(abstractValueDomain));
+ graph.finalize(abstractValueDomain);
return graph;
}
@@ -1715,8 +1717,8 @@
if (throwExpression != null && inliningStack.isEmpty) {
visitThrowExpression(throwExpression.expression);
handleInTryStatement();
- closeAndGotoExit(
- new HThrow(pop(), sourceInformationBuilder.buildThrow(node)));
+ closeAndGotoExit(new HThrow(abstractValueDomain, pop(),
+ sourceInformationBuilder.buildThrow(node)));
} else {
visit(node.expression);
pop();
@@ -1813,7 +1815,7 @@
HBasicBlock bodyExitBlock;
bool isAbortingBody = false;
if (current != null) {
- bodyExitBlock = close(new HGoto());
+ bodyExitBlock = close(new HGoto(abstractValueDomain));
} else {
isAbortingBody = true;
bodyExitBlock = lastOpenedBlock;
@@ -1858,13 +1860,13 @@
visit(node.condition);
assert(!isAborted());
HInstruction conditionInstruction = popBoolified();
- HBasicBlock conditionEndBlock = close(
- new HLoopBranch(conditionInstruction, HLoopBranch.DO_WHILE_LOOP));
+ HBasicBlock conditionEndBlock = close(new HLoopBranch(abstractValueDomain,
+ conditionInstruction, HLoopBranch.DO_WHILE_LOOP));
HBasicBlock avoidCriticalEdge = addNewBlock();
conditionEndBlock.addSuccessor(avoidCriticalEdge);
open(avoidCriticalEdge);
- close(new HGoto());
+ close(new HGoto(abstractValueDomain));
avoidCriticalEdge.addSuccessor(loopEntryBlock); // The back-edge.
conditionExpression =
@@ -1873,7 +1875,7 @@
// Avoid a critical edge from the condition to the loop-exit body.
HBasicBlock conditionExitBlock = addNewBlock();
open(conditionExitBlock);
- close(new HGoto());
+ close(new HGoto(abstractValueDomain));
conditionEndBlock.addSuccessor(conditionExitBlock);
loopHandler.endLoop(
@@ -1913,7 +1915,8 @@
loopEntryBlock.setBlockFlow(info, current);
jumpHandler.forEachBreak((HBreak breakInstruction, _) {
HBasicBlock block = breakInstruction.block;
- block.addAtExit(new HBreak.toLabel(label, sourceInformation));
+ block.addAtExit(new HBreak.toLabel(
+ abstractValueDomain, label, sourceInformation));
block.remove(breakInstruction);
});
}
@@ -2431,7 +2434,8 @@
FieldElement field = element;
value = typeBuilder.potentiallyCheckOrTrustTypeOfAssignment(
value, field.type);
- addWithPosition(new HStaticStore(field, value), location);
+ addWithPosition(
+ new HStaticStore(abstractValueDomain, field, value), location);
}
stack.add(value);
} else if (Elements.isError(element)) {
@@ -2802,7 +2806,7 @@
if (trustedMask != null) {
// We only allow the type argument to narrow `dynamic`, which probably
// comes from an unspecified return type in the NativeBehavior.
- if (code.instructionType.containsAll(closedWorld)) {
+ if (abstractValueDomain.containsAll(code.instructionType)) {
// Overwrite the type with the narrower type.
code.instructionType = trustedMask;
} else if (trustedMask.containsMask(code.instructionType, closedWorld)) {
@@ -3471,7 +3475,7 @@
} else if (isGrowableListConstructorCall) {
TypeMask inferred = _inferredTypeOfNewList(send);
return inferred.containsAll(closedWorld)
- ? commonMasks.extendableArrayType
+ ? commonMasks.growableListType
: inferred;
} else if (Elements.isConstructorOfTypedArraySubclass(
originalElement, closedWorld)) {
@@ -3579,7 +3583,7 @@
TypeMask elementType = computeType(constructor);
if (isFixedListConstructorCall) {
- if (!inputs[0].isNumber(closedWorld)) {
+ if (!inputs[0].isNumber(abstractValueDomain)) {
HTypeConversion conversion = new HTypeConversion(
null,
HTypeConversion.ARGUMENT_TYPE_CHECK,
@@ -3598,7 +3602,7 @@
// TODO(sra): Array allocation should be an instruction so that canThrow
// can depend on a length type discovered in optimization.
bool canThrow = true;
- if (inputs[0].isInteger(closedWorld) && inputs[0] is HConstant) {
+ if (inputs[0].isInteger(abstractValueDomain) && inputs[0] is HConstant) {
dynamic constant = inputs[0];
IntConstantValue intConstant = constant.constant;
int value = intConstant.intValue;
@@ -4359,7 +4363,7 @@
type = TypeMaskFactory.inferredReturnTypeForElement(
method, globalInferenceResults);
} else {
- type = closedWorld.commonMasks.dynamicType;
+ type = closedWorld.abstractValueDomain.dynamicType;
}
HInstruction instruction = new HInvokeSuper(
element,
@@ -5219,8 +5223,8 @@
reporter.internalError(node, 'rethrowableException should not be null.');
}
handleInTryStatement();
- closeAndGotoExit(new HThrow(
- exception, sourceInformationBuilder.buildThrow(node),
+ closeAndGotoExit(new HThrow(abstractValueDomain, exception,
+ sourceInformationBuilder.buildThrow(node),
isRethrow: true));
}
@@ -5361,8 +5365,8 @@
visitThrowExpression(node.expression);
if (isReachable) {
handleInTryStatement();
- push(new HThrowExpression(
- pop(), sourceInformationBuilder.buildThrow(node)));
+ push(new HThrowExpression(abstractValueDomain, pop(),
+ sourceInformationBuilder.buildThrow(node)));
isReachable = false;
}
}
@@ -5370,8 +5374,8 @@
visitYield(ast.Yield node) {
visit(node.expression);
HInstruction yielded = pop();
- add(new HYield(
- yielded, node.hasStar, sourceInformationBuilder.buildYield(node)));
+ add(new HYield(abstractValueDomain, yielded, node.hasStar,
+ sourceInformationBuilder.buildYield(node)));
}
visitAwait(ast.Await node) {
@@ -5894,7 +5898,8 @@
// We lift this common call pattern into a helper function to save space
// in the output.
- if (typeInputs.every((HInstruction input) => input.isNull())) {
+ if (typeInputs
+ .every((HInstruction input) => input.isNull(abstractValueDomain))) {
if (listInputs.isEmpty) {
createFunction = commonElements.mapLiteralUntypedEmptyMaker;
} else {
@@ -6217,7 +6222,8 @@
return;
}
- HSwitch switchInstruction = new HSwitch(<HInstruction>[expression]);
+ HSwitch switchInstruction =
+ new HSwitch(abstractValueDomain, <HInstruction>[expression]);
HBasicBlock expressionEnd = close(switchInstruction);
LocalsHandler savedLocals = localsHandler;
@@ -6248,7 +6254,8 @@
if (caseIterator.hasNext && isReachable) {
pushInvokeStatic(switchCase, commonElements.fallThroughError, []);
HInstruction error = pop();
- closeAndGotoExit(new HThrow(error, error.sourceInformation));
+ closeAndGotoExit(
+ new HThrow(abstractValueDomain, error, error.sourceInformation));
} else if (!isDefaultCase(switchCase)) {
// If there is no default, we will add one later to avoid
// the critical edge. So we generate a break statement to make
@@ -6277,7 +6284,7 @@
assert(false, failedAt(errorNode, 'Continue cannot target a switch.'));
});
if (!isAborted()) {
- current.close(new HGoto());
+ current.close(new HGoto(abstractValueDomain));
lastOpenedBlock.addSuccessor(joinBlock);
caseHandlers.add(localsHandler);
}
@@ -6287,7 +6294,7 @@
HBasicBlock defaultCase = addNewBlock();
expressionEnd.addSuccessor(defaultCase);
open(defaultCase);
- close(new HGoto());
+ close(new HGoto(abstractValueDomain));
defaultCase.addSuccessor(joinBlock);
caseHandlers.add(savedLocals);
statements.add(new HSubGraphBlockInformation(
@@ -6340,7 +6347,7 @@
// variables were used in a non-dominated block.
LocalsHandler savedLocals = new LocalsHandler.from(localsHandler);
HBasicBlock enterBlock = openNewBlock();
- HTry tryInstruction = new HTry();
+ HTry tryInstruction = new HTry(abstractValueDomain);
close(tryInstruction);
bool oldInTryStatement = inTryStatement;
inTryStatement = true;
@@ -6356,7 +6363,7 @@
// We use a [HExitTry] instead of a [HGoto] for the try block
// because it will have two successors: the join block, and
// the finally block.
- if (!isAborted()) endTryBlock = close(new HExitTry());
+ if (!isAborted()) endTryBlock = close(new HExitTry(abstractValueDomain));
SubGraph bodyGraph = new SubGraph(startTryBlock, lastOpenedBlock);
SubGraph finallyGraph = null;
@@ -6365,7 +6372,7 @@
startFinallyBlock = graph.addNewBlock();
open(startFinallyBlock);
buildFinally();
- if (!isAborted()) endFinallyBlock = close(new HGoto());
+ if (!isAborted()) endFinallyBlock = close(new HGoto(abstractValueDomain));
tryInstruction.finallyBlock = startFinallyBlock;
finallyGraph = new SubGraph(startFinallyBlock, lastOpenedBlock);
@@ -6430,7 +6437,7 @@
// in a non-dominated block.
LocalsHandler savedLocals = new LocalsHandler.from(localsHandler);
HBasicBlock enterBlock = openNewBlock();
- HTry tryInstruction = new HTry();
+ HTry tryInstruction = new HTry(abstractValueDomain);
close(tryInstruction);
bool oldInTryStatement = inTryStatement;
inTryStatement = true;
@@ -6448,7 +6455,7 @@
// We use a [HExitTry] instead of a [HGoto] for the try block
// because it will have multiple successors: the join block, and
// the catch or finally block.
- if (!isAborted()) endTryBlock = close(new HExitTry());
+ if (!isAborted()) endTryBlock = close(new HExitTry(abstractValueDomain));
SubGraph bodyGraph = new SubGraph(startTryBlock, lastOpenedBlock);
SubGraph catchGraph = null;
HLocalValue exception = null;
@@ -6530,7 +6537,8 @@
void visitElse() {
if (link.isEmpty) {
- closeAndGotoExit(new HThrow(exception, exception.sourceInformation,
+ closeAndGotoExit(new HThrow(
+ abstractValueDomain, exception, exception.sourceInformation,
isRethrow: true));
} else {
ast.CatchBlock newBlock = link.head;
@@ -6554,7 +6562,7 @@
visitThen: visitThen,
visitElse: visitElse,
sourceInformation: sourceInformationBuilder.buildCatch(firstBlock));
- if (!isAborted()) endCatchBlock = close(new HGoto());
+ if (!isAborted()) endCatchBlock = close(new HGoto(abstractValueDomain));
rethrowableException = oldRethrowableException;
tryInstruction.catchBlock = startCatchBlock;
@@ -6567,7 +6575,7 @@
startFinallyBlock = graph.addNewBlock();
open(startFinallyBlock);
visit(node.finallyBlock);
- if (!isAborted()) endFinallyBlock = close(new HGoto());
+ if (!isAborted()) endFinallyBlock = close(new HGoto(abstractValueDomain));
tryInstruction.finallyBlock = startFinallyBlock;
finallyGraph = new SubGraph(startFinallyBlock, lastOpenedBlock);
}
@@ -6692,8 +6700,8 @@
void emitReturn(HInstruction value, ast.Node node) {
if (inliningStack.isEmpty) {
- closeAndGotoExit(
- new HReturn(value, sourceInformationBuilder.buildReturn(node)));
+ closeAndGotoExit(new HReturn(abstractValueDomain, value,
+ sourceInformationBuilder.buildReturn(node)));
} else {
localsHandler.updateLocal(returnLocal, value);
}
@@ -6782,7 +6790,7 @@
// conversions.
// 2. The value can be primitive, because the library stringifier has
// fast-path code for most primitives.
- if (expression.canBePrimitive(builder.closedWorld)) {
+ if (expression.canBePrimitive(builder.abstractValueDomain)) {
append(stringify(node, expression));
return;
}
diff --git a/pkg/compiler/lib/src/ssa/builder_kernel.dart b/pkg/compiler/lib/src/ssa/builder_kernel.dart
index 3d8966f..b22a63e 100644
--- a/pkg/compiler/lib/src/ssa/builder_kernel.dart
+++ b/pkg/compiler/lib/src/ssa/builder_kernel.dart
@@ -323,7 +323,7 @@
graph.entry.addBefore(graph.entry.last, parameter);
HInstruction value = typeBuilder.potentiallyCheckOrTrustTypeOfParameter(
parameter, _getDartTypeIfValid(node.type));
- add(new HFieldSet(field, thisInstruction, value));
+ add(new HFieldSet(abstractValueDomain, field, thisInstruction, value));
} else {
if (node.initializer != null) {
node.initializer.accept(this);
@@ -336,8 +336,8 @@
stack.add(graph.addConstantNull(closedWorld));
}
HInstruction value = pop();
- closeAndGotoExit(
- new HReturn(value, _sourceInformationBuilder.buildReturn(node)));
+ closeAndGotoExit(new HReturn(abstractValueDomain, value,
+ _sourceInformationBuilder.buildReturn(node)));
}
closeFunction();
}
@@ -496,7 +496,8 @@
add(new HFieldGet(null, newObject, commonMasks.dynamicType,
isAssignable: false));
for (int i = 0; i < fields.length; i++) {
- add(new HFieldSet(fields[i], newObject, constructorArguments[i]));
+ add(new HFieldSet(abstractValueDomain, fields[i], newObject,
+ constructorArguments[i]));
}
} else {
// Create the runtime type information, if needed.
@@ -604,7 +605,8 @@
}
if (_inliningStack.isEmpty) {
- closeAndGotoExit(new HReturn(newObject, sourceInformation));
+ closeAndGotoExit(
+ new HReturn(abstractValueDomain, newObject, sourceInformation));
closeFunction();
} else {
localsHandler.updateLocal(_returnLocal, newObject,
@@ -920,8 +922,8 @@
typeArguments,
commonMasks.functionType));
HInstruction value = pop();
- close(new HReturn(
- value, _sourceInformationBuilder.buildReturn(originalClosureNode)))
+ close(new HReturn(abstractValueDomain, value,
+ _sourceInformationBuilder.buildReturn(originalClosureNode)))
.addSuccessor(graph.exit);
closeFunction();
@@ -954,6 +956,7 @@
},
visitThen: () {
closeAndGotoExit(new HReturn(
+ abstractValueDomain,
graph.addConstantBool(false, closedWorld),
_sourceInformationBuilder.buildReturn(functionNode)));
},
@@ -1083,8 +1086,8 @@
if (targetElement.isSetter) {
value = graph.addConstantNull(closedWorld);
}
- close(new HReturn(
- value, _sourceInformationBuilder.buildReturn(functionNode)))
+ close(new HReturn(abstractValueDomain, value,
+ _sourceInformationBuilder.buildReturn(functionNode)))
.addSuccessor(graph.exit);
}
// TODO(sra): Handle JS-interop methods.
@@ -1129,7 +1132,7 @@
parameterMap,
_sourceInformationBuilder.buildDeclaration(targetElement),
isGenerativeConstructorBody: targetElement is ConstructorBodyEntity);
- close(new HGoto()).addSuccessor(block);
+ close(new HGoto(abstractValueDomain)).addSuccessor(block);
open(block);
@@ -1144,8 +1147,8 @@
}
void closeFunction() {
- if (!isAborted()) closeAndGotoExit(new HGoto());
- graph.finalize();
+ if (!isAborted()) closeAndGotoExit(new HGoto(abstractValueDomain));
+ graph.finalize(abstractValueDomain);
}
@override
@@ -1246,7 +1249,8 @@
handleInTryStatement();
SourceInformation sourceInformation =
_sourceInformationBuilder.buildThrow(node.expression);
- closeAndGotoExit(new HThrow(pop(), sourceInformation));
+ closeAndGotoExit(
+ new HThrow(abstractValueDomain, pop(), sourceInformation));
} else {
expression.accept(this);
pop();
@@ -1571,12 +1575,25 @@
HInstruction streamIterator;
node.iterable.accept(this);
- _pushStaticInvocation(
- _commonElements.streamIteratorConstructor,
- [pop(), graph.addConstantNull(closedWorld)],
- _typeInferenceMap
- .getReturnTypeOf(_commonElements.streamIteratorConstructor),
- const <DartType>[]);
+
+ List<HInstruction> arguments = [pop()];
+ ClassEntity cls = _commonElements.streamIterator;
+ DartType typeArg = _elementMap.getDartType(node.variable.type);
+ InterfaceType instanceType =
+ localsHandler.substInContext(new InterfaceType(cls, [typeArg]));
+ addImplicitInstantiation(instanceType);
+ SourceInformation sourceInformation =
+ _sourceInformationBuilder.buildForInIterator(node);
+ // TODO(johnniwinther): Pass type arguments to constructors like calling
+ // a generic method.
+ if (rtiNeed.classNeedsTypeArguments(cls)) {
+ _addTypeArguments(arguments, [typeArg], sourceInformation);
+ }
+ ConstructorEntity constructor = _commonElements.streamIteratorConstructor;
+ _pushStaticInvocation(constructor, arguments,
+ _typeInferenceMap.getReturnTypeOf(constructor), const <DartType>[],
+ instanceType: instanceType, sourceInformation: sourceInformation);
+
streamIterator = pop();
void buildInitializer() {}
@@ -1591,7 +1608,7 @@
const <DartType>[],
_sourceInformationBuilder.buildForInMoveNext(node));
HInstruction future = pop();
- push(new HAwait(future, closedWorld.commonMasks.dynamicType));
+ push(new HAwait(future, abstractValueDomain.dynamicType));
return popBoolified();
}
@@ -1628,7 +1645,7 @@
void finalizerFunction() {
_pushDynamicInvocation(node, null, Selectors.cancel, [streamIterator],
const <DartType>[], _sourceInformationBuilder.buildGeneric(node));
- add(new HAwait(pop(), closedWorld.commonMasks.dynamicType));
+ add(new HAwait(pop(), abstractValueDomain.dynamicType));
}
tryBuilder
@@ -1713,7 +1730,7 @@
HBasicBlock bodyExitBlock;
bool isAbortingBody = false;
if (current != null) {
- bodyExitBlock = close(new HGoto());
+ bodyExitBlock = close(new HGoto(abstractValueDomain));
} else {
isAbortingBody = true;
bodyExitBlock = lastOpenedBlock;
@@ -1758,13 +1775,13 @@
node.condition.accept(this);
assert(!isAborted());
HInstruction conditionInstruction = popBoolified();
- HBasicBlock conditionEndBlock = close(
- new HLoopBranch(conditionInstruction, HLoopBranch.DO_WHILE_LOOP));
+ HBasicBlock conditionEndBlock = close(new HLoopBranch(abstractValueDomain,
+ conditionInstruction, HLoopBranch.DO_WHILE_LOOP));
HBasicBlock avoidCriticalEdge = addNewBlock();
conditionEndBlock.addSuccessor(avoidCriticalEdge);
open(avoidCriticalEdge);
- close(new HGoto());
+ close(new HGoto(abstractValueDomain));
avoidCriticalEdge.addSuccessor(loopEntryBlock); // The back-edge.
conditionExpression =
@@ -1773,7 +1790,7 @@
// Avoid a critical edge from the condition to the loop-exit body.
HBasicBlock conditionExitBlock = addNewBlock();
open(conditionExitBlock);
- close(new HGoto());
+ close(new HGoto(abstractValueDomain));
conditionEndBlock.addSuccessor(conditionExitBlock);
loopHandler.endLoop(
@@ -1813,7 +1830,8 @@
loopEntryBlock.setBlockFlow(info, current);
jumpHandler.forEachBreak((HBreak breakInstruction, _) {
HBasicBlock block = breakInstruction.block;
- block.addAtExit(new HBreak.toLabel(label, sourceInformation));
+ block.addAtExit(new HBreak.toLabel(
+ abstractValueDomain, label, sourceInformation));
block.remove(breakInstruction);
});
}
@@ -2312,7 +2330,8 @@
return;
}
- HSwitch switchInstruction = new HSwitch(<HInstruction>[expression]);
+ HSwitch switchInstruction =
+ new HSwitch(abstractValueDomain, <HInstruction>[expression]);
HBasicBlock expressionEnd = close(switchInstruction);
LocalsHandler savedLocals = localsHandler;
@@ -2372,7 +2391,7 @@
'Continue cannot target a switch.'));
});
if (!isAborted()) {
- current.close(new HGoto());
+ current.close(new HGoto(abstractValueDomain));
lastOpenedBlock.addSuccessor(joinBlock);
caseHandlers.add(localsHandler);
}
@@ -2382,7 +2401,7 @@
HBasicBlock defaultCase = addNewBlock();
expressionEnd.addSuccessor(defaultCase);
open(defaultCase);
- close(new HGoto());
+ close(new HGoto(abstractValueDomain));
defaultCase.addSuccessor(joinBlock);
caseHandlers.add(savedLocals);
statements.add(new HSubGraphBlockInformation(
@@ -2586,7 +2605,8 @@
// We lift this common call pattern into a helper function to save space
// in the output.
- if (typeInputs.every((HInstruction input) => input.isNull())) {
+ if (typeInputs
+ .every((HInstruction input) => input.isNull(abstractValueDomain))) {
if (constructorArgs.isEmpty) {
constructor = _commonElements.mapLiteralUntypedEmptyMaker;
} else {
@@ -2724,6 +2744,7 @@
pop();
} else {
add(new HStaticStore(
+ abstractValueDomain,
_elementMap.getMember(staticTarget),
typeBuilder.potentiallyCheckOrTrustTypeOfAssignment(
value, _getDartTypeIfValid(staticTarget.setterType))));
@@ -3176,7 +3197,7 @@
"Unexpected arguments. "
"Expected 1-2 argument, actual: $arguments."));
HInstruction lengthInput = arguments.first;
- if (!lengthInput.isNumber(closedWorld)) {
+ if (!lengthInput.isNumber(abstractValueDomain)) {
HTypeConversion conversion = new HTypeConversion(
null,
HTypeConversion.ARGUMENT_TYPE_CHECK,
@@ -3199,7 +3220,7 @@
// TODO(sra): Array allocation should be an instruction so that canThrow
// can depend on a length type discovered in optimization.
bool canThrow = true;
- if (lengthInput.isUInt32(closedWorld)) {
+ if (lengthInput.isUInt32(abstractValueDomain)) {
canThrow = false;
}
@@ -3747,7 +3768,7 @@
if (trustedMask != null) {
// We only allow the type argument to narrow `dynamic`, which probably
// comes from an unspecified return type in the NativeBehavior.
- if (code.instructionType.containsAll(closedWorld)) {
+ if (abstractValueDomain.containsAll(code.instructionType)) {
// Overwrite the type with the narrower type.
code.instructionType = trustedMask;
} else if (trustedMask.containsMask(code.instructionType, closedWorld)) {
@@ -4176,7 +4197,7 @@
if (target is FunctionEntity) {
typeMask = _typeInferenceMap.getReturnTypeOf(target);
} else {
- typeMask = closedWorld.commonMasks.dynamicType;
+ typeMask = abstractValueDomain.dynamicType;
}
HInstruction instruction = new HInvokeSuper(
target,
@@ -4533,7 +4554,7 @@
SourceInformation sourceInformation =
_sourceInformationBuilder.buildThrow(node);
handleInTryStatement();
- push(new HThrowExpression(pop(), sourceInformation));
+ push(new HThrowExpression(abstractValueDomain, pop(), sourceInformation));
isReachable = false;
}
}
@@ -4550,8 +4571,8 @@
void visitYieldStatement(ir.YieldStatement node) {
node.expression.accept(this);
- add(new HYield(
- pop(), node.isYieldStar, _sourceInformationBuilder.buildYield(node)));
+ add(new HYield(abstractValueDomain, pop(), node.isYieldStar,
+ _sourceInformationBuilder.buildYield(node)));
}
@override
@@ -4559,7 +4580,7 @@
node.operand.accept(this);
HInstruction awaited = pop();
// TODO(herhut): Improve this type.
- push(new HAwait(awaited, closedWorld.commonMasks.dynamicType)
+ push(new HAwait(awaited, abstractValueDomain.dynamicType)
..sourceInformation = _sourceInformationBuilder.buildAwait(node));
}
@@ -4574,7 +4595,9 @@
handleInTryStatement();
SourceInformation sourceInformation =
_sourceInformationBuilder.buildThrow(node);
- closeAndGotoExit(new HThrow(exception, sourceInformation, isRethrow: true));
+ closeAndGotoExit(new HThrow(
+ abstractValueDomain, exception, sourceInformation,
+ isRethrow: true));
// ir.Rethrow is an expression so we need to push a value - a constant with
// no type.
stack.add(graph.addConstantUnreachable(closedWorld));
@@ -4699,7 +4722,7 @@
// Don't inline operator== methods if the parameter can be null.
if (function.name == '==') {
if (function.enclosingClass != commonElements.objectClass &&
- providedArguments[1].canBeNull()) {
+ providedArguments[1].canBeNull(abstractValueDomain)) {
return false;
}
}
@@ -5099,7 +5122,8 @@
void _emitReturn(HInstruction value, SourceInformation sourceInformation) {
if (_inliningStack.isEmpty) {
- closeAndGotoExit(new HReturn(value, sourceInformation));
+ closeAndGotoExit(
+ new HReturn(abstractValueDomain, value, sourceInformation));
} else {
localsHandler.updateLocal(_returnLocal, value);
}
@@ -5452,7 +5476,7 @@
LocalsHandler originalSavedLocals;
TryCatchFinallyBuilder(this.kernelBuilder, this.trySourceInformation) {
- tryInstruction = new HTry();
+ tryInstruction = new HTry(kernelBuilder.abstractValueDomain);
originalSavedLocals = new LocalsHandler.from(kernelBuilder.localsHandler);
enterBlock = kernelBuilder.openNewBlock();
kernelBuilder.close(tryInstruction);
@@ -5523,7 +5547,8 @@
kernelBuilder.open(startFinallyBlock);
buildFinalizer();
if (!kernelBuilder.isAborted()) {
- endFinallyBlock = kernelBuilder.close(new HGoto());
+ endFinallyBlock =
+ kernelBuilder.close(new HGoto(kernelBuilder.abstractValueDomain));
}
tryInstruction.finallyBlock = startFinallyBlock;
finallyGraph =
@@ -5535,7 +5560,8 @@
// because it will have multiple successors: the join block, and
// the catch or finally block.
if (!kernelBuilder.isAborted()) {
- endTryBlock = kernelBuilder.close(new HExitTry());
+ endTryBlock =
+ kernelBuilder.close(new HExitTry(kernelBuilder.abstractValueDomain));
}
bodyGraph = new SubGraph(startTryBlock, kernelBuilder.lastOpenedBlock);
}
@@ -5600,7 +5626,9 @@
void visitElse() {
if (catchesIndex >= tryCatch.catches.length) {
kernelBuilder.closeAndGotoExit(new HThrow(
- exception, exception.sourceInformation,
+ kernelBuilder.abstractValueDomain,
+ exception,
+ exception.sourceInformation,
isRethrow: true));
} else {
ir.Catch nextCatch = tryCatch.catches[catchesIndex];
@@ -5625,7 +5653,8 @@
sourceInformation:
kernelBuilder._sourceInformationBuilder.buildCatch(firstBlock));
if (!kernelBuilder.isAborted()) {
- endCatchBlock = kernelBuilder.close(new HGoto());
+ endCatchBlock =
+ kernelBuilder.close(new HGoto(kernelBuilder.abstractValueDomain));
}
kernelBuilder.rethrowableException = oldRethrowableException;
diff --git a/pkg/compiler/lib/src/ssa/codegen.dart b/pkg/compiler/lib/src/ssa/codegen.dart
index 2e4c056..fc0c71b 100644
--- a/pkg/compiler/lib/src/ssa/codegen.dart
+++ b/pkg/compiler/lib/src/ssa/codegen.dart
@@ -25,6 +25,7 @@
import '../js_emitter/code_emitter_task.dart';
import '../native/native.dart' as native;
import '../options.dart';
+import '../types/abstract_value_domain.dart';
import '../types/types.dart';
import '../universe/call_structure.dart' show CallStructure;
import '../universe/selector.dart' show Selector;
@@ -237,6 +238,9 @@
InterceptorData get _interceptorData => _closedWorld.interceptorData;
+ AbstractValueDomain get _abstractValueDomain =>
+ _closedWorld.abstractValueDomain;
+
bool isGenerateAtUseSite(HInstruction instruction) {
return generateAtUseSite.contains(instruction);
}
@@ -306,7 +310,7 @@
}
bool requiresUintConversion(HInstruction instruction) {
- if (instruction.isUInt31(_closedWorld)) return false;
+ if (instruction.isUInt31(_abstractValueDomain)) return false;
if (bitWidth(instruction) <= 31) return false;
// If the result of a bit-operation is only used by other bit
// operations, we do not have to convert to an unsigned integer.
@@ -353,7 +357,8 @@
.visitGraph(graph);
new SsaTypeKnownRemover().visitGraph(graph);
new SsaTrustedCheckRemover(_options).visitGraph(graph);
- new SsaInstructionMerger(generateAtUseSite, _superMemberData)
+ new SsaInstructionMerger(_closedWorld.abstractValueDomain,
+ generateAtUseSite, _superMemberData)
.visitGraph(graph);
new SsaConditionMerger(generateAtUseSite, controlFlowOperators)
.visitGraph(graph);
@@ -1467,11 +1472,11 @@
visitShiftRight(HShiftRight node) => visitBitInvokeBinary(node, '>>>');
visitTruncatingDivide(HTruncatingDivide node) {
- assert(node.isUInt31(_closedWorld));
+ assert(node.isUInt31(_abstractValueDomain));
// TODO(karlklose): Enable this assertion again when type propagation is
// fixed. Issue 23555.
// assert(node.left.isUInt32(compiler));
- assert(node.right.isPositiveInteger(_closedWorld));
+ assert(node.right.isPositiveInteger(_abstractValueDomain));
use(node.left);
js.Expression jsLeft = pop();
use(node.right);
@@ -1806,7 +1811,7 @@
// invoke dynamic knows more than the receiver.
ClassEntity enclosing = node.element.enclosingClass;
if (_closedWorld.isInstantiated(enclosing)) {
- return _closedWorld.commonMasks.createNonNullExact(enclosing);
+ return _closedWorld.abstractValueDomain.createNonNullExact(enclosing);
} else {
// The element is mixed in so a non-null subtype mask is the most
// precise we have.
@@ -1816,7 +1821,7 @@
node,
"Element ${node.element} from $enclosing expected "
"to be mixed in."));
- return _closedWorld.commonMasks.createNonNullSubtype(enclosing);
+ return _closedWorld.abstractValueDomain.createNonNullSubtype(enclosing);
}
}
// If [JSInvocationMirror._invokeOn] is enabled, and this call
@@ -2207,14 +2212,15 @@
HInstruction left = relational.left;
HInstruction right = relational.right;
- if (left.isStringOrNull(_closedWorld) &&
- right.isStringOrNull(_closedWorld)) {
+ if (left.isStringOrNull(_abstractValueDomain) &&
+ right.isStringOrNull(_abstractValueDomain)) {
return true;
}
// This optimization doesn't work for NaN, so we only do it if the
// type is known to be an integer.
- return left.isInteger(_closedWorld) && right.isInteger(_closedWorld);
+ return left.isInteger(_abstractValueDomain) &&
+ right.isInteger(_abstractValueDomain);
}
bool handledBySpecialCase = false;
@@ -2350,13 +2356,13 @@
js.Expression over;
if (node.staticChecks != HBoundsCheck.ALWAYS_ABOVE_ZERO) {
use(node.index);
- if (node.index.isInteger(_closedWorld)) {
+ if (node.index.isInteger(_abstractValueDomain)) {
under = js.js("# < 0", pop());
} else {
js.Expression jsIndex = pop();
under = js.js("# >>> 0 !== #", [jsIndex, jsIndex]);
}
- } else if (!node.index.isInteger(_closedWorld)) {
+ } else if (!node.index.isInteger(_abstractValueDomain)) {
checkInt(node.index, '!==');
under = pop();
}
@@ -2486,9 +2492,10 @@
void visitStringify(HStringify node) {
HInstruction input = node.inputs.first;
- if (input.isString(_closedWorld)) {
+ if (input.isString(_abstractValueDomain)) {
use(input);
- } else if (input.isInteger(_closedWorld) || input.isBoolean(_closedWorld)) {
+ } else if (input.isInteger(_abstractValueDomain) ||
+ input.isBoolean(_abstractValueDomain)) {
// JavaScript's + operator with a string for the left operand will convert
// the right operand to a string, and the conversion result is correct.
use(input);
@@ -2879,9 +2886,9 @@
} else if (type.isFunctionType) {
checkType(input, interceptor, type, sourceInformation,
negative: negative);
- } else if ((input.canBePrimitive(_closedWorld) &&
- !input.canBePrimitiveArray(_closedWorld)) ||
- input.canBeNull()) {
+ } else if ((input.canBePrimitive(_abstractValueDomain) &&
+ !input.canBePrimitiveArray(_abstractValueDomain)) ||
+ input.canBeNull(_abstractValueDomain)) {
checkObject(input, relation, node.sourceInformation);
js.Expression objectTest = pop();
checkType(input, interceptor, type, sourceInformation,
diff --git a/pkg/compiler/lib/src/ssa/codegen_helpers.dart b/pkg/compiler/lib/src/ssa/codegen_helpers.dart
index 85be9f0..d7194b8 100644
--- a/pkg/compiler/lib/src/ssa/codegen_helpers.dart
+++ b/pkg/compiler/lib/src/ssa/codegen_helpers.dart
@@ -7,6 +7,7 @@
import '../js_backend/js_backend.dart';
import '../js_backend/interceptor_data.dart';
import '../options.dart';
+import '../types/abstract_value_domain.dart';
import '../types/types.dart';
import '../universe/selector.dart' show Selector;
import '../world.dart' show ClosedWorld;
@@ -23,6 +24,9 @@
SsaInstructionSelection(this._closedWorld, this._interceptorData);
+ AbstractValueDomain get _abstractValueDomain =>
+ _closedWorld.abstractValueDomain;
+
void visitGraph(HGraph graph) {
this.graph = graph;
visitDominatorTree(graph);
@@ -68,7 +72,7 @@
HInstruction interceptor = node.interceptor;
if (interceptor != null) {
return new HIsViaInterceptor(node.typeExpression, interceptor,
- _closedWorld.commonMasks.boolType);
+ _closedWorld.abstractValueDomain.boolType);
}
}
return node;
@@ -87,7 +91,7 @@
if (leftType.isNullable && rightType.isNullable) {
if (left.isConstantNull() ||
right.isConstantNull() ||
- (left.isPrimitive(_closedWorld) && leftType == rightType)) {
+ (left.isPrimitive(_abstractValueDomain) && leftType == rightType)) {
return '==';
}
return null;
@@ -244,7 +248,7 @@
HInstruction bitop(String assignOp) {
// HBitAnd, HBitOr etc. are more difficult because HBitAnd(a.x, y)
// sometimes needs to be forced to unsigned: a.x = (a.x & y) >>> 0.
- if (op.isUInt31(_closedWorld)) return simpleBinary(assignOp);
+ if (op.isUInt31(_abstractValueDomain)) return simpleBinary(assignOp);
return noMatchingRead();
}
@@ -335,6 +339,7 @@
* t2 = add(4, 3);
*/
class SsaInstructionMerger extends HBaseVisitor {
+ final AbstractValueDomain _abstractValueDomain;
final SuperMemberData _superMemberData;
/**
* List of [HInstruction] that the instruction merger expects in
@@ -354,7 +359,8 @@
generateAtUseSite.add(instruction);
}
- SsaInstructionMerger(this.generateAtUseSite, this._superMemberData);
+ SsaInstructionMerger(
+ this._abstractValueDomain, this.generateAtUseSite, this._superMemberData);
void visitGraph(HGraph graph) {
visitDominatorTree(graph);
@@ -404,7 +410,7 @@
// construction always precede a use.
bool isEffectivelyPure(HInstruction instruction) {
if (instruction is HLocalGet) return !isAssignedLocal(instruction.local);
- return instruction.isPure();
+ return instruction.isPure(_abstractValueDomain);
}
bool isAssignedLocal(HLocalValue local) {
diff --git a/pkg/compiler/lib/src/ssa/graph_builder.dart b/pkg/compiler/lib/src/ssa/graph_builder.dart
index 9abf34d..4215366 100644
--- a/pkg/compiler/lib/src/ssa/graph_builder.dart
+++ b/pkg/compiler/lib/src/ssa/graph_builder.dart
@@ -25,6 +25,7 @@
import '../js_emitter/code_emitter_task.dart';
import '../options.dart';
import '../resolution/tree_elements.dart';
+import '../types/abstract_value_domain.dart';
import '../types/types.dart';
import '../world.dart' show ClosedWorld;
import 'jump_handler.dart';
@@ -59,7 +60,10 @@
ClosedWorld get closedWorld;
- CommonMasks get commonMasks => closedWorld.commonMasks;
+ AbstractValueDomain get abstractValueDomain =>
+ closedWorld.abstractValueDomain;
+
+ CommonMasks get commonMasks => closedWorld.abstractValueDomain;
DiagnosticReporter get reporter => backend.reporter;
@@ -135,7 +139,7 @@
/// Pushes a boolean checking [expression] against null.
pushCheckNull(HInstruction expression) {
push(new HIdentity(expression, graph.addConstantNull(closedWorld), null,
- closedWorld.commonMasks.boolType));
+ closedWorld.abstractValueDomain.boolType));
}
void dup() {
@@ -198,7 +202,7 @@
}
void goto(HBasicBlock from, HBasicBlock to) {
- from.close(new HGoto());
+ from.close(new HGoto(abstractValueDomain));
from.addSuccessor(to);
}
@@ -246,7 +250,7 @@
MemberEntity get sourceElement;
HLiteralList buildLiteralList(List<HInstruction> inputs) {
- return new HLiteralList(inputs, commonMasks.extendableArrayType);
+ return new HLiteralList(inputs, commonMasks.growableListType);
}
HInstruction callSetRuntimeTypeInfoWithTypeArguments(
@@ -262,7 +266,7 @@
TypeInfoExpressionKind.INSTANCE,
closedWorld.elementEnvironment.getThisType(type.element),
rtiInputs,
- closedWorld.commonMasks.dynamicType);
+ closedWorld.abstractValueDomain.dynamicType);
add(typeInfo);
return callSetRuntimeTypeInfo(typeInfo, newObject, sourceInformation);
}
@@ -271,7 +275,7 @@
/// specify special successors if we are already in a try/catch/finally block.
void handleInTryStatement() {
if (!inTryStatement) return;
- HBasicBlock block = close(new HExitTry());
+ HBasicBlock block = close(new HExitTry(abstractValueDomain));
HBasicBlock newBlock = graph.addNewBlock();
block.addSuccessor(newBlock);
open(newBlock);
diff --git a/pkg/compiler/lib/src/ssa/interceptor_simplifier.dart b/pkg/compiler/lib/src/ssa/interceptor_simplifier.dart
index cb2948a..11b98a0 100644
--- a/pkg/compiler/lib/src/ssa/interceptor_simplifier.dart
+++ b/pkg/compiler/lib/src/ssa/interceptor_simplifier.dart
@@ -7,6 +7,7 @@
import '../constants/values.dart';
import '../elements/entities.dart';
import '../js_backend/interceptor_data.dart';
+import '../types/abstract_value_domain.dart';
import '../types/types.dart';
import '../universe/selector.dart' show Selector;
import '../world.dart' show ClosedWorld;
@@ -48,6 +49,9 @@
InterceptorData get interceptorData => closedWorld.interceptorData;
+ AbstractValueDomain get _abstractValueDomain =>
+ closedWorld.abstractValueDomain;
+
void visitGraph(HGraph graph) {
this.graph = graph;
visitDominatorTree(graph);
@@ -94,11 +98,11 @@
bool canUseSelfForInterceptor(
HInstruction receiver, Set<ClassEntity> interceptedClasses) {
- if (receiver.canBePrimitive(closedWorld)) {
+ if (receiver.canBePrimitive(_abstractValueDomain)) {
// Primitives always need interceptors.
return false;
}
- if (receiver.canBeNull() &&
+ if (receiver.canBeNull(_abstractValueDomain) &&
interceptedClasses.contains(_commonElements.jsNullClass)) {
// Need the JSNull interceptor.
return false;
@@ -312,14 +316,15 @@
// `NoSuchMethodError`s, and if the receiver was not null we would have a
// constant interceptor `C`. Then we can use `(receiver && C)` for the
// interceptor.
- if (receiver.canBeNull()) {
+ if (receiver.canBeNull(_abstractValueDomain)) {
if (!interceptedClasses.contains(_commonElements.jsNullClass)) {
// Can use `(receiver && C)` only if receiver is either null or truthy.
- if (!(receiver.canBePrimitiveNumber(closedWorld) ||
- receiver.canBePrimitiveBoolean(closedWorld) ||
- receiver.canBePrimitiveString(closedWorld))) {
+ if (!(receiver.canBePrimitiveNumber(_abstractValueDomain) ||
+ receiver.canBePrimitiveBoolean(_abstractValueDomain) ||
+ receiver.canBePrimitiveString(_abstractValueDomain))) {
ClassEntity interceptorClass = tryComputeConstantInterceptorFromType(
- receiver.instructionType.nonNullable(), interceptedClasses);
+ _abstractValueDomain.excludeNull(receiver.instructionType),
+ interceptedClasses);
if (interceptorClass != null) {
HInstruction constantInstruction = graph.addConstant(
new InterceptorConstantValue(interceptorClass), closedWorld);
@@ -365,6 +370,7 @@
List<HInstruction> inputs = new List<HInstruction>.from(user.inputs);
inputs[0] = nullConstant;
HOneShotInterceptor oneShotInterceptor = new HOneShotInterceptor(
+ closedWorld.abstractValueDomain,
user.selector,
user.mask,
inputs,
diff --git a/pkg/compiler/lib/src/ssa/invoke_dynamic_specializers.dart b/pkg/compiler/lib/src/ssa/invoke_dynamic_specializers.dart
index f02b6c6..0ca17d5 100644
--- a/pkg/compiler/lib/src/ssa/invoke_dynamic_specializers.dart
+++ b/pkg/compiler/lib/src/ssa/invoke_dynamic_specializers.dart
@@ -124,8 +124,10 @@
ClosedWorld closedWorld) {
HInstruction receiver = instruction.inputs[1];
HInstruction index = instruction.inputs[2];
- if (!receiver.isMutableIndexable(closedWorld)) return null;
- if (!index.isInteger(closedWorld) && options.enableTypeAssertions) {
+ if (!receiver.isMutableIndexable(closedWorld.abstractValueDomain))
+ return null;
+ if (!index.isInteger(closedWorld.abstractValueDomain) &&
+ options.enableTypeAssertions) {
// We want the right checked mode error.
return null;
}
@@ -137,7 +139,8 @@
return null;
}
}
- return new HIndexAssign(receiver, index, value, instruction.selector);
+ return new HIndexAssign(closedWorld.abstractValueDomain, receiver, index,
+ value, instruction.selector);
}
/// Returns [true] if [value] meets the requirements for being stored into
@@ -153,9 +156,9 @@
if (instruction.element != null) {
ClassEntity cls = instruction.element.enclosingClass;
if (cls == commonElements.typedArrayOfIntClass) {
- return value.isInteger(closedWorld);
+ return value.isInteger(closedWorld.abstractValueDomain);
} else if (cls == commonElements.typedArrayOfDoubleClass) {
- return value.isNumber(closedWorld);
+ return value.isNumber(closedWorld.abstractValueDomain);
}
}
@@ -181,8 +184,9 @@
CompilerOptions options,
CommonElements commonElements,
ClosedWorld closedWorld) {
- if (!instruction.inputs[1].isIndexablePrimitive(closedWorld)) return null;
- if (!instruction.inputs[2].isInteger(closedWorld) &&
+ if (!instruction.inputs[1]
+ .isIndexablePrimitive(closedWorld.abstractValueDomain)) return null;
+ if (!instruction.inputs[2].isInteger(closedWorld.abstractValueDomain) &&
options.enableTypeAssertions) {
// We want the right checked mode error.
return null;
@@ -210,8 +214,9 @@
ClosedWorld closedWorld) {
// All bitwise operations on primitive types either produce an
// integer or throw an error.
- if (instruction.inputs[1].isPrimitiveOrNull(closedWorld)) {
- return closedWorld.commonMasks.uint32Type;
+ if (instruction.inputs[1]
+ .isPrimitiveOrNull(closedWorld.abstractValueDomain)) {
+ return closedWorld.abstractValueDomain.uint32Type;
}
return super
.computeTypeFromInputTypes(instruction, results, options, closedWorld);
@@ -225,7 +230,7 @@
CommonElements commonElements,
ClosedWorld closedWorld) {
HInstruction input = instruction.inputs[1];
- if (input.isNumber(closedWorld)) {
+ if (input.isNumber(closedWorld.abstractValueDomain)) {
return new HBitNot(
input,
instruction.selector,
@@ -249,16 +254,16 @@
CompilerOptions options,
ClosedWorld closedWorld) {
HInstruction operand = instruction.inputs[1];
- if (operand.isNumberOrNull(closedWorld)) {
+ if (operand.isNumberOrNull(closedWorld.abstractValueDomain)) {
// We have integer subclasses that represent ranges, so widen any int
// subclass to full integer.
- if (operand.isIntegerOrNull(closedWorld)) {
- return closedWorld.commonMasks.intType;
+ if (operand.isIntegerOrNull(closedWorld.abstractValueDomain)) {
+ return closedWorld.abstractValueDomain.intType;
}
- if (operand.isDoubleOrNull(closedWorld)) {
- return closedWorld.commonMasks.doubleType;
+ if (operand.isDoubleOrNull(closedWorld.abstractValueDomain)) {
+ return closedWorld.abstractValueDomain.doubleType;
}
- return closedWorld.commonMasks.numType;
+ return closedWorld.abstractValueDomain.numType;
}
return super
.computeTypeFromInputTypes(instruction, results, options, closedWorld);
@@ -272,7 +277,7 @@
CommonElements commonElements,
ClosedWorld closedWorld) {
HInstruction input = instruction.inputs[1];
- if (input.isNumber(closedWorld)) {
+ if (input.isNumber(closedWorld.abstractValueDomain)) {
return new HNegate(
input,
instruction.selector,
@@ -296,8 +301,8 @@
CompilerOptions options,
ClosedWorld closedWorld) {
HInstruction input = instruction.inputs[1];
- if (input.isNumberOrNull(closedWorld)) {
- return input.instructionType.nonNullable();
+ if (input.isNumberOrNull(closedWorld.abstractValueDomain)) {
+ return closedWorld.abstractValueDomain.excludeNull(input.instructionType);
}
return super
.computeTypeFromInputTypes(instruction, results, options, closedWorld);
@@ -311,7 +316,7 @@
CommonElements commonElements,
ClosedWorld closedWorld) {
HInstruction input = instruction.inputs[1];
- if (input.isNumber(closedWorld)) {
+ if (input.isNumber(closedWorld.abstractValueDomain)) {
return new HAbs(
input,
instruction.selector,
@@ -332,24 +337,24 @@
ClosedWorld closedWorld) {
HInstruction left = instruction.inputs[1];
HInstruction right = instruction.inputs[2];
- if (left.isIntegerOrNull(closedWorld) &&
- right.isIntegerOrNull(closedWorld)) {
- return closedWorld.commonMasks.intType;
+ if (left.isIntegerOrNull(closedWorld.abstractValueDomain) &&
+ right.isIntegerOrNull(closedWorld.abstractValueDomain)) {
+ return closedWorld.abstractValueDomain.intType;
}
- if (left.isNumberOrNull(closedWorld)) {
- if (left.isDoubleOrNull(closedWorld) ||
- right.isDoubleOrNull(closedWorld)) {
- return closedWorld.commonMasks.doubleType;
+ if (left.isNumberOrNull(closedWorld.abstractValueDomain)) {
+ if (left.isDoubleOrNull(closedWorld.abstractValueDomain) ||
+ right.isDoubleOrNull(closedWorld.abstractValueDomain)) {
+ return closedWorld.abstractValueDomain.doubleType;
}
- return closedWorld.commonMasks.numType;
+ return closedWorld.abstractValueDomain.numType;
}
return super
.computeTypeFromInputTypes(instruction, results, options, closedWorld);
}
bool isBuiltin(HInvokeDynamic instruction, ClosedWorld closedWorld) {
- return instruction.inputs[1].isNumber(closedWorld) &&
- instruction.inputs[2].isNumber(closedWorld);
+ return instruction.inputs[1].isNumber(closedWorld.abstractValueDomain) &&
+ instruction.inputs[2].isNumber(closedWorld.abstractValueDomain);
}
HInstruction tryConvertToBuiltin(
@@ -375,14 +380,15 @@
HInstruction instruction, ClosedWorld closedWorld) {
HInstruction left = instruction.inputs[1];
HInstruction right = instruction.inputs[2];
- return left.isPositiveIntegerOrNull(closedWorld) &&
- right.isPositiveIntegerOrNull(closedWorld);
+ return left.isPositiveIntegerOrNull(closedWorld.abstractValueDomain) &&
+ right.isPositiveIntegerOrNull(closedWorld.abstractValueDomain);
}
bool inputsAreUInt31(HInstruction instruction, ClosedWorld closedWorld) {
HInstruction left = instruction.inputs[1];
HInstruction right = instruction.inputs[2];
- return left.isUInt31(closedWorld) && right.isUInt31(closedWorld);
+ return left.isUInt31(closedWorld.abstractValueDomain) &&
+ right.isUInt31(closedWorld.abstractValueDomain);
}
HInstruction newBuiltinVariant(
@@ -401,10 +407,10 @@
CompilerOptions options,
ClosedWorld closedWorld) {
if (inputsAreUInt31(instruction, closedWorld)) {
- return closedWorld.commonMasks.uint32Type;
+ return closedWorld.abstractValueDomain.uint32Type;
}
if (inputsArePositiveIntegers(instruction, closedWorld)) {
- return closedWorld.commonMasks.positiveIntType;
+ return closedWorld.abstractValueDomain.positiveIntType;
}
return super
.computeTypeFromInputTypes(instruction, results, options, closedWorld);
@@ -440,8 +446,8 @@
CompilerOptions options,
ClosedWorld closedWorld) {
HInstruction left = instruction.inputs[1];
- if (left.isNumberOrNull(closedWorld)) {
- return closedWorld.commonMasks.doubleType;
+ if (left.isNumberOrNull(closedWorld.abstractValueDomain)) {
+ return closedWorld.abstractValueDomain.doubleType;
}
return super
.computeTypeFromInputTypes(instruction, results, options, closedWorld);
@@ -453,7 +459,7 @@
CompilerOptions options,
ClosedWorld closedWorld) {
return new HDivide(instruction.inputs[1], instruction.inputs[2],
- instruction.selector, closedWorld.commonMasks.doubleType);
+ instruction.selector, closedWorld.abstractValueDomain.doubleType);
}
}
@@ -466,7 +472,7 @@
CompilerOptions options,
ClosedWorld closedWorld) {
if (inputsArePositiveIntegers(instruction, closedWorld)) {
- return closedWorld.commonMasks.positiveIntType;
+ return closedWorld.abstractValueDomain.positiveIntType;
}
return super
.computeTypeFromInputTypes(instruction, results, options, closedWorld);
@@ -552,7 +558,7 @@
CompilerOptions options,
ClosedWorld closedWorld) {
if (inputsArePositiveIntegers(instruction, closedWorld)) {
- return closedWorld.commonMasks.positiveIntType;
+ return closedWorld.abstractValueDomain.positiveIntType;
}
return super
.computeTypeFromInputTypes(instruction, results, options, closedWorld);
@@ -588,7 +594,7 @@
CompilerOptions options,
ClosedWorld closedWorld) {
if (inputsArePositiveIntegers(instruction, closedWorld)) {
- return closedWorld.commonMasks.positiveIntType;
+ return closedWorld.abstractValueDomain.positiveIntType;
}
return super
.computeTypeFromInputTypes(instruction, results, options, closedWorld);
@@ -640,10 +646,10 @@
CompilerOptions options,
ClosedWorld closedWorld) {
if (hasUint31Result(instruction, closedWorld)) {
- return closedWorld.commonMasks.uint31Type;
+ return closedWorld.abstractValueDomain.uint31Type;
}
if (inputsArePositiveIntegers(instruction, closedWorld)) {
- return closedWorld.commonMasks.positiveIntType;
+ return closedWorld.abstractValueDomain.positiveIntType;
}
return super
.computeTypeFromInputTypes(instruction, results, options, closedWorld);
@@ -668,11 +674,12 @@
bool hasUint31Result(HInstruction instruction, ClosedWorld closedWorld) {
HInstruction left = instruction.inputs[1];
HInstruction right = instruction.inputs[2];
- if (right.isPositiveInteger(closedWorld)) {
- if (left.isUInt31(closedWorld) && isNotZero(right)) {
+ if (right.isPositiveInteger(closedWorld.abstractValueDomain)) {
+ if (left.isUInt31(closedWorld.abstractValueDomain) && isNotZero(right)) {
return true;
}
- if (left.isUInt32(closedWorld) && isTwoOrGreater(right)) {
+ if (left.isUInt32(closedWorld.abstractValueDomain) &&
+ isTwoOrGreater(right)) {
return true;
}
}
@@ -688,7 +695,8 @@
ClosedWorld closedWorld) {
HInstruction right = instruction.inputs[2];
if (isBuiltin(instruction, closedWorld)) {
- if (right.isPositiveInteger(closedWorld) && isNotZero(right)) {
+ if (right.isPositiveInteger(closedWorld.abstractValueDomain) &&
+ isNotZero(right)) {
if (hasUint31Result(instruction, closedWorld)) {
return newBuiltinVariant(instruction, results, options, closedWorld);
}
@@ -726,8 +734,8 @@
// All bitwise operations on primitive types either produce an
// integer or throw an error.
HInstruction left = instruction.inputs[1];
- if (left.isPrimitiveOrNull(closedWorld)) {
- return closedWorld.commonMasks.uint32Type;
+ if (left.isPrimitiveOrNull(closedWorld.abstractValueDomain)) {
+ return closedWorld.abstractValueDomain.uint32Type;
}
return super
.computeTypeFromInputTypes(instruction, results, options, closedWorld);
@@ -756,7 +764,7 @@
bool isPositive(HInstruction instruction, ClosedWorld closedWorld) {
// TODO: We should use the value range analysis. Currently, ranges
// are discarded just after the analysis.
- return instruction.isPositiveInteger(closedWorld);
+ return instruction.isPositiveInteger(closedWorld.abstractValueDomain);
}
}
@@ -776,7 +784,7 @@
ClosedWorld closedWorld) {
HInstruction left = instruction.inputs[1];
HInstruction right = instruction.inputs[2];
- if (left.isNumber(closedWorld)) {
+ if (left.isNumber(closedWorld.abstractValueDomain)) {
if (argumentLessThan32(right)) {
return newBuiltinVariant(instruction, results, options, closedWorld);
}
@@ -814,7 +822,8 @@
CompilerOptions options,
ClosedWorld closedWorld) {
HInstruction left = instruction.inputs[1];
- if (left.isUInt32(closedWorld)) return left.instructionType;
+ if (left.isUInt32(closedWorld.abstractValueDomain))
+ return left.instructionType;
return super
.computeTypeFromInputTypes(instruction, results, options, closedWorld);
}
@@ -828,7 +837,7 @@
ClosedWorld closedWorld) {
HInstruction left = instruction.inputs[1];
HInstruction right = instruction.inputs[2];
- if (left.isNumber(closedWorld)) {
+ if (left.isNumber(closedWorld.abstractValueDomain)) {
if (argumentLessThan32(right) && isPositive(left, closedWorld)) {
return newBuiltinVariant(instruction, results, options, closedWorld);
}
@@ -839,7 +848,8 @@
if (isPositive(right, closedWorld) && isPositive(left, closedWorld)) {
instruction.selector = renameToOptimizedSelector(
'_shrBothPositive', instruction.selector, commonElements);
- } else if (isPositive(left, closedWorld) && right.isNumber(closedWorld)) {
+ } else if (isPositive(left, closedWorld) &&
+ right.isNumber(closedWorld.abstractValueDomain)) {
instruction.selector = renameToOptimizedSelector(
'_shrReceiverPositive', instruction.selector, commonElements);
} else if (isPositive(right, closedWorld)) {
@@ -881,8 +891,9 @@
ClosedWorld closedWorld) {
HInstruction left = instruction.inputs[1];
HInstruction right = instruction.inputs[2];
- if (left.isUInt31(closedWorld) && right.isUInt31(closedWorld)) {
- return closedWorld.commonMasks.uint31Type;
+ if (left.isUInt31(closedWorld.abstractValueDomain) &&
+ right.isUInt31(closedWorld.abstractValueDomain)) {
+ return closedWorld.abstractValueDomain.uint31Type;
}
return super
.computeTypeFromInputTypes(instruction, results, options, closedWorld);
@@ -915,9 +926,10 @@
ClosedWorld closedWorld) {
HInstruction left = instruction.inputs[1];
HInstruction right = instruction.inputs[2];
- if (left.isPrimitiveOrNull(closedWorld) &&
- (left.isUInt31(closedWorld) || right.isUInt31(closedWorld))) {
- return closedWorld.commonMasks.uint31Type;
+ if (left.isPrimitiveOrNull(closedWorld.abstractValueDomain) &&
+ (left.isUInt31(closedWorld.abstractValueDomain) ||
+ right.isUInt31(closedWorld.abstractValueDomain))) {
+ return closedWorld.abstractValueDomain.uint31Type;
}
return super
.computeTypeFromInputTypes(instruction, results, options, closedWorld);
@@ -950,8 +962,9 @@
ClosedWorld closedWorld) {
HInstruction left = instruction.inputs[1];
HInstruction right = instruction.inputs[2];
- if (left.isUInt31(closedWorld) && right.isUInt31(closedWorld)) {
- return closedWorld.commonMasks.uint31Type;
+ if (left.isUInt31(closedWorld.abstractValueDomain) &&
+ right.isUInt31(closedWorld.abstractValueDomain)) {
+ return closedWorld.abstractValueDomain.uint31Type;
}
return super
.computeTypeFromInputTypes(instruction, results, options, closedWorld);
@@ -978,8 +991,9 @@
GlobalTypeInferenceResults results,
CompilerOptions options,
ClosedWorld closedWorld) {
- if (instruction.inputs[1].isPrimitiveOrNull(closedWorld)) {
- return closedWorld.commonMasks.boolType;
+ if (instruction.inputs[1]
+ .isPrimitiveOrNull(closedWorld.abstractValueDomain)) {
+ return closedWorld.abstractValueDomain.boolType;
}
return super
.computeTypeFromInputTypes(instruction, results, options, closedWorld);
@@ -994,7 +1008,8 @@
ClosedWorld closedWorld) {
HInstruction left = instruction.inputs[1];
HInstruction right = instruction.inputs[2];
- if (left.isNumber(closedWorld) && right.isNumber(closedWorld)) {
+ if (left.isNumber(closedWorld.abstractValueDomain) &&
+ right.isNumber(closedWorld.abstractValueDomain)) {
return newBuiltinVariant(instruction, closedWorld);
}
return null;
@@ -1017,7 +1032,8 @@
HInstruction left = instruction.inputs[1];
HInstruction right = instruction.inputs[2];
TypeMask instructionType = left.instructionType;
- if (right.isConstantNull() || left.isPrimitiveOrNull(closedWorld)) {
+ if (right.isConstantNull() ||
+ left.isPrimitiveOrNull(closedWorld.abstractValueDomain)) {
return newBuiltinVariant(instruction, closedWorld);
}
if (closedWorld.includesClosureCall(
@@ -1043,7 +1059,7 @@
HInstruction newBuiltinVariant(
HInvokeDynamic instruction, ClosedWorld closedWorld) {
return new HIdentity(instruction.inputs[1], instruction.inputs[2],
- instruction.selector, closedWorld.commonMasks.boolType);
+ instruction.selector, closedWorld.abstractValueDomain.boolType);
}
}
@@ -1057,7 +1073,7 @@
HInstruction newBuiltinVariant(
HInvokeDynamic instruction, ClosedWorld closedWorld) {
return new HLess(instruction.inputs[1], instruction.inputs[2],
- instruction.selector, closedWorld.commonMasks.boolType);
+ instruction.selector, closedWorld.abstractValueDomain.boolType);
}
}
@@ -1071,7 +1087,7 @@
HInstruction newBuiltinVariant(
HInvokeDynamic instruction, ClosedWorld closedWorld) {
return new HGreater(instruction.inputs[1], instruction.inputs[2],
- instruction.selector, closedWorld.commonMasks.boolType);
+ instruction.selector, closedWorld.abstractValueDomain.boolType);
}
}
@@ -1085,7 +1101,7 @@
HInstruction newBuiltinVariant(
HInvokeDynamic instruction, ClosedWorld closedWorld) {
return new HGreaterEqual(instruction.inputs[1], instruction.inputs[2],
- instruction.selector, closedWorld.commonMasks.boolType);
+ instruction.selector, closedWorld.abstractValueDomain.boolType);
}
}
@@ -1099,7 +1115,7 @@
HInstruction newBuiltinVariant(
HInvokeDynamic instruction, ClosedWorld closedWorld) {
return new HLessEqual(instruction.inputs[1], instruction.inputs[2],
- instruction.selector, closedWorld.commonMasks.boolType);
+ instruction.selector, closedWorld.abstractValueDomain.boolType);
}
}
@@ -1120,12 +1136,13 @@
// TODO(sra): Implement a builtin HCodeUnitAt instruction and the same index
// bounds checking optimizations as for HIndex.
HInstruction receiver = instruction.getDartReceiver(closedWorld);
- if (receiver.isStringOrNull(closedWorld)) {
+ if (receiver.isStringOrNull(closedWorld.abstractValueDomain)) {
// Even if there is no builtin equivalent instruction, we know
// String.codeUnitAt does not have any side effect (other than throwing),
// and that it can be GVN'ed.
clearAllSideEffects(instruction);
- if (instruction.inputs.last.isPositiveInteger(closedWorld)) {
+ if (instruction.inputs.last
+ .isPositiveInteger(closedWorld.abstractValueDomain)) {
instruction.selector = renameToOptimizedSelector(
'_codeUnitAt', instruction.selector, commonElements);
}
@@ -1147,13 +1164,15 @@
HInstruction receiver = instruction.getDartReceiver(closedWorld);
// `compareTo` has no side-effect (other than throwing) and can be GVN'ed
// for some known types.
- if (receiver.isStringOrNull(closedWorld) ||
- receiver.isNumberOrNull(closedWorld)) {
+ if (receiver.isStringOrNull(closedWorld.abstractValueDomain) ||
+ receiver.isNumberOrNull(closedWorld.abstractValueDomain)) {
// Replace `a.compareTo(a)` with `0`, but only if receiver and argument
// are such that no exceptions can be thrown.
HInstruction argument = instruction.inputs.last;
- if ((receiver.isNumber(closedWorld) && argument.isNumber(closedWorld)) ||
- (receiver.isString(closedWorld) && argument.isString(closedWorld))) {
+ if ((receiver.isNumber(closedWorld.abstractValueDomain) &&
+ argument.isNumber(closedWorld.abstractValueDomain)) ||
+ (receiver.isString(closedWorld.abstractValueDomain) &&
+ argument.isString(closedWorld.abstractValueDomain))) {
if (identical(receiver.nonCheck(), argument.nonCheck())) {
return graph.addConstantInt(0, closedWorld);
}
@@ -1175,7 +1194,7 @@
CommonElements commonElements,
ClosedWorld closedWorld) {
HInstruction receiver = instruction.getDartReceiver(closedWorld);
- if (receiver.isStringOrNull(closedWorld)) {
+ if (receiver.isStringOrNull(closedWorld.abstractValueDomain)) {
// String.xxx does not have any side effect (other than throwing), and it
// can be GVN'ed.
clearAllSideEffects(instruction);
@@ -1204,8 +1223,8 @@
ClosedWorld closedWorld) {
HInstruction receiver = instruction.getDartReceiver(closedWorld);
HInstruction pattern = instruction.inputs[2];
- if (receiver.isStringOrNull(closedWorld) &&
- pattern.isStringOrNull(closedWorld)) {
+ if (receiver.isStringOrNull(closedWorld.abstractValueDomain) &&
+ pattern.isStringOrNull(closedWorld.abstractValueDomain)) {
// String.contains(String s) does not have any side effect (other than
// throwing), and it can be GVN'ed.
clearAllSideEffects(instruction);
@@ -1229,7 +1248,7 @@
CommonElements commonElements,
ClosedWorld closedWorld) {
HInstruction receiver = instruction.getDartReceiver(closedWorld);
- if (receiver.isNumberOrNull(closedWorld)) {
+ if (receiver.isNumberOrNull(closedWorld.abstractValueDomain)) {
// Even if there is no builtin equivalent instruction, we know the
// instruction does not have any side effect, and that it can be GVN'ed.
clearAllSideEffects(instruction);
diff --git a/pkg/compiler/lib/src/ssa/jump_handler.dart b/pkg/compiler/lib/src/ssa/jump_handler.dart
index d8dc2ee..3687961 100644
--- a/pkg/compiler/lib/src/ssa/jump_handler.dart
+++ b/pkg/compiler/lib/src/ssa/jump_handler.dart
@@ -88,9 +88,11 @@
[LabelDefinition label]) {
HInstruction breakInstruction;
if (label == null) {
- breakInstruction = new HBreak(target, sourceInformation);
+ breakInstruction =
+ new HBreak(builder.abstractValueDomain, target, sourceInformation);
} else {
- breakInstruction = new HBreak.toLabel(label, sourceInformation);
+ breakInstruction = new HBreak.toLabel(
+ builder.abstractValueDomain, label, sourceInformation);
}
LocalsHandler locals = new LocalsHandler.from(builder.localsHandler);
builder.close(breakInstruction);
@@ -101,9 +103,11 @@
[LabelDefinition label]) {
HInstruction continueInstruction;
if (label == null) {
- continueInstruction = new HContinue(target, sourceInformation);
+ continueInstruction =
+ new HContinue(builder.abstractValueDomain, target, sourceInformation);
} else {
- continueInstruction = new HContinue.toLabel(label, sourceInformation);
+ continueInstruction = new HContinue.toLabel(
+ builder.abstractValueDomain, label, sourceInformation);
// Switch case continue statements must be handled by the
// [SwitchCaseJumpHandler].
assert(!label.target.isSwitchCase);
@@ -171,8 +175,9 @@
// for a switch statement with continue statements. See
// [SsaFromAstMixin.buildComplexSwitchStatement] for detail.
- HInstruction breakInstruction =
- new HBreak(target, sourceInformation, breakSwitchContinueLoop: true);
+ HInstruction breakInstruction = new HBreak(
+ builder.abstractValueDomain, target, sourceInformation,
+ breakSwitchContinueLoop: true);
LocalsHandler locals = new LocalsHandler.from(builder.localsHandler);
builder.close(breakInstruction);
jumps.add(new _JumpHandlerEntry(breakInstruction, locals));
@@ -199,7 +204,7 @@
assert(label.target.labels.contains(label));
HInstruction continueInstruction =
- new HContinue(target, sourceInformation);
+ new HContinue(builder.abstractValueDomain, target, sourceInformation);
LocalsHandler locals = new LocalsHandler.from(builder.localsHandler);
builder.close(continueInstruction);
jumps.add(new _JumpHandlerEntry(continueInstruction, locals));
diff --git a/pkg/compiler/lib/src/ssa/kernel_string_builder.dart b/pkg/compiler/lib/src/ssa/kernel_string_builder.dart
index 090d77b..92e4b4d 100644
--- a/pkg/compiler/lib/src/ssa/kernel_string_builder.dart
+++ b/pkg/compiler/lib/src/ssa/kernel_string_builder.dart
@@ -33,7 +33,7 @@
// conversions.
// 2. The value can be primitive, because the library stringifier has
// fast-path code for most primitives.
- if (expression.canBePrimitive(builder.closedWorld)) {
+ if (expression.canBePrimitive(builder.abstractValueDomain)) {
append(stringify(expression));
return;
}
diff --git a/pkg/compiler/lib/src/ssa/locals_handler.dart b/pkg/compiler/lib/src/ssa/locals_handler.dart
index 6626095..2f3973b 100644
--- a/pkg/compiler/lib/src/ssa/locals_handler.dart
+++ b/pkg/compiler/lib/src/ssa/locals_handler.dart
@@ -68,7 +68,7 @@
ClosedWorld get closedWorld => builder.closedWorld;
- CommonMasks get commonMasks => closedWorld.commonMasks;
+ CommonMasks get commonMasks => closedWorld.abstractValueDomain;
GlobalTypeInferenceResults get _globalInferenceResults =>
builder.globalInferenceResults;
@@ -443,13 +443,15 @@
// Inside the closure the box is stored in a closure-field and cannot
// be accessed directly.
HInstruction box = readLocal(localBox);
- builder.add(new HFieldSet(redirect, box, value)
- ..sourceInformation = sourceInformation);
+ builder.add(
+ new HFieldSet(builder.abstractValueDomain, redirect, box, value)
+ ..sourceInformation = sourceInformation);
} else {
assert(_isUsedInTryOrGenerator(local));
HLocalValue localValue = getLocal(local);
- builder.add(new HLocalSet(local, localValue, value)
- ..sourceInformation = sourceInformation);
+ builder.add(
+ new HLocalSet(builder.abstractValueDomain, local, localValue, value)
+ ..sourceInformation = sourceInformation);
}
}
diff --git a/pkg/compiler/lib/src/ssa/loop_handler.dart b/pkg/compiler/lib/src/ssa/loop_handler.dart
index 4bace0e..89ea833 100644
--- a/pkg/compiler/lib/src/ssa/loop_handler.dart
+++ b/pkg/compiler/lib/src/ssa/loop_handler.dart
@@ -65,8 +65,8 @@
if (startBlock == null) startBlock = conditionBlock;
HInstruction conditionInstruction = condition();
- HBasicBlock conditionEndBlock =
- builder.close(new HLoopBranch(conditionInstruction));
+ HBasicBlock conditionEndBlock = builder.close(
+ new HLoopBranch(builder.abstractValueDomain, conditionInstruction));
SubExpression conditionExpression =
new SubExpression(conditionBlock, conditionEndBlock);
@@ -85,7 +85,8 @@
SubGraph bodyGraph = new SubGraph(beginBodyBlock, builder.lastOpenedBlock);
HBasicBlock bodyBlock = builder.current;
- if (builder.current != null) builder.close(new HGoto());
+ if (builder.current != null)
+ builder.close(new HGoto(builder.abstractValueDomain));
SubExpression updateGraph;
@@ -133,7 +134,8 @@
update();
- HBasicBlock updateEndBlock = builder.close(new HGoto());
+ HBasicBlock updateEndBlock =
+ builder.close(new HGoto(builder.abstractValueDomain));
// The back-edge completing the cycle.
updateEndBlock.addSuccessor(conditionBlock);
updateGraph = new SubExpression(updateBlock, updateEndBlock);
@@ -141,7 +143,7 @@
// Avoid a critical edge from the condition to the loop-exit body.
HBasicBlock conditionExitBlock = builder.addNewBlock();
builder.open(conditionExitBlock);
- builder.close(new HGoto());
+ builder.close(new HGoto(builder.abstractValueDomain));
conditionEndBlock.addSuccessor(conditionExitBlock);
endLoop(conditionBlock, conditionExitBlock, jumpHandler, savedLocals);
@@ -172,7 +174,7 @@
// label to the if.
HBasicBlock elseBlock = builder.addNewBlock();
builder.open(elseBlock);
- builder.close(new HGoto());
+ builder.close(new HGoto(builder.abstractValueDomain));
// Pass the elseBlock as the branchBlock, because that's the block we go
// to just before leaving the 'loop'.
endLoop(conditionBlock, elseBlock, jumpHandler, savedLocals);
@@ -184,7 +186,8 @@
// Remove the [HLoopBranch] instruction and replace it with
// [HIf].
HInstruction condition = conditionEndBlock.last.inputs[0];
- conditionEndBlock.addAtExit(new HIf(condition));
+ conditionEndBlock
+ .addAtExit(new HIf(builder.abstractValueDomain, condition));
conditionEndBlock.addSuccessor(elseBlock);
conditionEndBlock.remove(conditionEndBlock.last);
HIfBlockInformation info = new HIfBlockInformation(
@@ -210,7 +213,8 @@
jumpHandler.forEachBreak((HBreak breakInstruction, _) {
HBasicBlock block = breakInstruction.block;
- block.addAtExit(new HBreak.toLabel(label, sourceInformation));
+ block.addAtExit(new HBreak.toLabel(
+ builder.abstractValueDomain, label, sourceInformation));
block.remove(breakInstruction);
});
}
@@ -224,7 +228,8 @@
/// Also notifies the locals handler that we're entering a loop.
JumpHandler beginLoopHeader(T node, JumpTarget jumpTarget) {
assert(!builder.isAborted());
- HBasicBlock previousBlock = builder.close(new HGoto());
+ HBasicBlock previousBlock =
+ builder.close(new HGoto(builder.abstractValueDomain));
JumpHandler jumpHandler =
createJumpHandler(node, jumpTarget, isLoopJump: true);
diff --git a/pkg/compiler/lib/src/ssa/nodes.dart b/pkg/compiler/lib/src/ssa/nodes.dart
index fbe8edd..a42c238 100644
--- a/pkg/compiler/lib/src/ssa/nodes.dart
+++ b/pkg/compiler/lib/src/ssa/nodes.dart
@@ -4,7 +4,6 @@
import '../closure.dart';
import '../common.dart';
-import '../common_elements.dart' show CommonElements;
import '../compiler.dart' show Compiler;
import '../constants/constant_system.dart';
import '../constants/values.dart';
@@ -16,8 +15,7 @@
import '../js/js.dart' as js;
import '../js_backend/js_backend.dart';
import '../native/native.dart' as native;
-import '../types/constants.dart' show computeTypeMask;
-import '../types/types.dart';
+import '../types/abstract_value_domain.dart';
import '../universe/selector.dart' show Selector;
import '../universe/side_effects.dart' show SideEffects;
import '../util/util.dart';
@@ -261,7 +259,8 @@
// We use `null` as the value for invalid constant expressions.
constant = const NullConstantValue();
}
- TypeMask type = computeTypeMask(closedWorld, constant);
+ AbstractValue type = closedWorld.abstractValueDomain
+ .computeAbstractValueForConstant(constant);
result = new HConstant.internal(constant, type)
..sourceInformation = sourceInformation;
entry.addAtExit(result);
@@ -318,15 +317,15 @@
// A constant with an empty type used as the HInstruction of an expression
// in an unreachable context.
return addConstant(
- new SyntheticConstantValue(
- SyntheticConstantKind.EMPTY_VALUE, const TypeMask.nonNullEmpty()),
+ new SyntheticConstantValue(SyntheticConstantKind.EMPTY_VALUE,
+ closedWorld.abstractValueDomain.emptyType),
closedWorld);
}
- void finalize() {
+ void finalize(AbstractValueDomain domain) {
addBlock(exit);
exit.open();
- exit.close(new HExit());
+ exit.close(new HExit(domain));
assignDominators();
}
@@ -975,225 +974,118 @@
* effect, nor any dependency. They can be moved anywhere in the
* graph.
*/
- bool isPure() {
+ bool isPure(AbstractValueDomain domain) {
return !sideEffects.hasSideEffects() &&
!sideEffects.dependsOnSomething() &&
- !canThrow();
+ !canThrow(domain);
}
/// An instruction is an 'allocation' is it is the sole alias for an object.
/// This applies to instructions that allocate new objects and can be extended
/// to methods that return other allocations without escaping them.
- bool get isAllocation => false;
+ bool isAllocation(AbstractValueDomain domain) => false;
/// Overridden by [HCheck] to return the actual non-[HCheck]
/// instruction it checks against.
HInstruction nonCheck() => this;
/// Can this node throw an exception?
- bool canThrow() => false;
+ bool canThrow(AbstractValueDomain domain) => false;
/// Does this node potentially affect control flow.
bool isControlFlow() => false;
- bool isExact() => instructionType.isExact || isNull();
+ bool isExact(AbstractValueDomain domain) => domain.isExact(instructionType);
- bool isValue() => instructionType.isValue;
+ bool isValue(AbstractValueDomain domain) => domain.isValue(instructionType);
- bool canBeNull() => instructionType.isNullable;
+ bool canBeNull(AbstractValueDomain domain) =>
+ domain.canBeNull(instructionType);
- bool isNull() => instructionType.isNull;
+ bool isNull(AbstractValueDomain domain) => domain.isNull(instructionType);
- bool isConflicting() => instructionType.isEmpty;
+ bool isConflicting(AbstractValueDomain domain) =>
+ domain.isEmpty(instructionType);
- /// Returns `true` if [typeMask] contains [cls].
- static bool containsType(
- TypeMask typeMask, ClassEntity cls, ClosedWorld closedWorld) {
- return closedWorld.isInstantiated(cls) &&
- typeMask.contains(cls, closedWorld);
- }
+ bool canBePrimitive(AbstractValueDomain domain) =>
+ domain.canBePrimitive(instructionType);
- /// Returns `true` if [typeMask] contains only [cls].
- static bool containsOnlyType(
- TypeMask typeMask, ClassEntity cls, ClosedWorld closedWorld) {
- return closedWorld.isInstantiated(cls) && typeMask.containsOnly(cls);
- }
+ bool canBePrimitiveNumber(AbstractValueDomain domain) =>
+ domain.canBePrimitiveNumber(instructionType);
- /// Returns `true` if [typeMask] is an instance of [cls].
- static bool isInstanceOf(
- TypeMask typeMask, ClassEntity cls, ClosedWorld closedWorld) {
- return closedWorld.isImplemented(cls) &&
- typeMask.satisfies(cls, closedWorld);
- }
+ bool canBePrimitiveBoolean(AbstractValueDomain domain) =>
+ domain.canBePrimitiveBoolean(instructionType);
- bool canBePrimitive(ClosedWorld closedWorld) {
- return canBePrimitiveNumber(closedWorld) ||
- canBePrimitiveArray(closedWorld) ||
- canBePrimitiveBoolean(closedWorld) ||
- canBePrimitiveString(closedWorld) ||
- isNull();
- }
+ bool canBePrimitiveArray(AbstractValueDomain domain) =>
+ domain.canBePrimitiveArray(instructionType);
- bool canBePrimitiveNumber(ClosedWorld closedWorld) {
- CommonElements commonElements = closedWorld.commonElements;
- // TODO(sra): It should be possible to test only jsDoubleClass and
- // jsUInt31Class, since all others are superclasses of these two.
- return containsType(
- instructionType, commonElements.jsNumberClass, closedWorld) ||
- containsType(instructionType, commonElements.jsIntClass, closedWorld) ||
- containsType(
- instructionType, commonElements.jsPositiveIntClass, closedWorld) ||
- containsType(
- instructionType, commonElements.jsUInt32Class, closedWorld) ||
- containsType(
- instructionType, commonElements.jsUInt31Class, closedWorld) ||
- containsType(
- instructionType, commonElements.jsDoubleClass, closedWorld);
- }
+ bool isIndexablePrimitive(AbstractValueDomain domain) =>
+ domain.isIndexablePrimitive(instructionType);
- bool canBePrimitiveBoolean(ClosedWorld closedWorld) {
- return containsType(
- instructionType, closedWorld.commonElements.jsBoolClass, closedWorld);
- }
+ bool isFixedArray(AbstractValueDomain domain) =>
+ domain.isFixedArray(instructionType);
- bool canBePrimitiveArray(ClosedWorld closedWorld) {
- CommonElements commonElements = closedWorld.commonElements;
- return containsType(
- instructionType, commonElements.jsArrayClass, closedWorld) ||
- containsType(
- instructionType, commonElements.jsFixedArrayClass, closedWorld) ||
- containsType(instructionType, commonElements.jsExtendableArrayClass,
- closedWorld) ||
- containsType(instructionType, commonElements.jsUnmodifiableArrayClass,
- closedWorld);
- }
+ bool isExtendableArray(AbstractValueDomain domain) =>
+ domain.isExtendableArray(instructionType);
- bool isIndexablePrimitive(ClosedWorld closedWorld) {
- return instructionType.containsOnlyString(closedWorld) ||
- isInstanceOf(instructionType,
- closedWorld.commonElements.jsIndexableClass, closedWorld);
- }
+ bool isMutableArray(AbstractValueDomain domain) =>
+ domain.isMutableArray(instructionType);
- bool isFixedArray(ClosedWorld closedWorld) {
- CommonElements commonElements = closedWorld.commonElements;
- // TODO(sra): Recognize the union of these types as well.
- return containsOnlyType(
- instructionType, commonElements.jsFixedArrayClass, closedWorld) ||
- containsOnlyType(instructionType,
- commonElements.jsUnmodifiableArrayClass, closedWorld);
- }
+ bool isMutableIndexable(AbstractValueDomain domain) =>
+ domain.isMutableIndexable(instructionType);
- bool isExtendableArray(ClosedWorld closedWorld) {
- return containsOnlyType(instructionType,
- closedWorld.commonElements.jsExtendableArrayClass, closedWorld);
- }
+ bool isArray(AbstractValueDomain domain) => domain.isArray(instructionType);
- bool isMutableArray(ClosedWorld closedWorld) {
- return isInstanceOf(instructionType,
- closedWorld.commonElements.jsMutableArrayClass, closedWorld);
- }
+ bool canBePrimitiveString(AbstractValueDomain domain) =>
+ domain.canBePrimitiveString(instructionType);
- bool isReadableArray(ClosedWorld closedWorld) {
- return isInstanceOf(
- instructionType, closedWorld.commonElements.jsArrayClass, closedWorld);
- }
+ bool isInteger(AbstractValueDomain domain) =>
+ domain.isInteger(instructionType);
- bool isMutableIndexable(ClosedWorld closedWorld) {
- return isInstanceOf(instructionType,
- closedWorld.commonElements.jsMutableIndexableClass, closedWorld);
- }
+ bool isUInt32(AbstractValueDomain domain) => domain.isUInt32(instructionType);
- bool isArray(ClosedWorld closedWorld) => isReadableArray(closedWorld);
+ bool isUInt31(AbstractValueDomain domain) => domain.isUInt31(instructionType);
- bool canBePrimitiveString(ClosedWorld closedWorld) {
- return containsType(
- instructionType, closedWorld.commonElements.jsStringClass, closedWorld);
- }
+ bool isPositiveInteger(AbstractValueDomain domain) =>
+ domain.isPositiveInteger(instructionType);
- bool isInteger(ClosedWorld closedWorld) {
- return instructionType.containsOnlyInt(closedWorld) &&
- !instructionType.isNullable;
- }
+ bool isPositiveIntegerOrNull(AbstractValueDomain domain) =>
+ domain.isPositiveIntegerOrNull(instructionType);
- bool isUInt32(ClosedWorld closedWorld) {
- return !instructionType.isNullable &&
- isInstanceOf(instructionType, closedWorld.commonElements.jsUInt32Class,
- closedWorld);
- }
+ bool isIntegerOrNull(AbstractValueDomain domain) =>
+ domain.isIntegerOrNull(instructionType);
- bool isUInt31(ClosedWorld closedWorld) {
- return !instructionType.isNullable &&
- isInstanceOf(instructionType, closedWorld.commonElements.jsUInt31Class,
- closedWorld);
- }
+ bool isNumber(AbstractValueDomain domain) => domain.isNumber(instructionType);
- bool isPositiveInteger(ClosedWorld closedWorld) {
- return !instructionType.isNullable &&
- isInstanceOf(instructionType,
- closedWorld.commonElements.jsPositiveIntClass, closedWorld);
- }
+ bool isNumberOrNull(AbstractValueDomain domain) =>
+ domain.isNumberOrNull(instructionType);
- bool isPositiveIntegerOrNull(ClosedWorld closedWorld) {
- return isInstanceOf(instructionType,
- closedWorld.commonElements.jsPositiveIntClass, closedWorld);
- }
+ bool isDouble(AbstractValueDomain domain) => domain.isDouble(instructionType);
- bool isIntegerOrNull(ClosedWorld closedWorld) {
- return instructionType.containsOnlyInt(closedWorld);
- }
+ bool isDoubleOrNull(AbstractValueDomain domain) =>
+ domain.isDoubleOrNull(instructionType);
- bool isNumber(ClosedWorld closedWorld) {
- return instructionType.containsOnlyNum(closedWorld) &&
- !instructionType.isNullable;
- }
+ bool isBoolean(AbstractValueDomain domain) =>
+ domain.isBoolean(instructionType);
- bool isNumberOrNull(ClosedWorld closedWorld) {
- return instructionType.containsOnlyNum(closedWorld);
- }
+ bool isBooleanOrNull(AbstractValueDomain domain) =>
+ domain.isBooleanOrNull(instructionType);
- bool isDouble(ClosedWorld closedWorld) {
- return instructionType.containsOnlyDouble(closedWorld) &&
- !instructionType.isNullable;
- }
+ bool isString(AbstractValueDomain domain) => domain.isString(instructionType);
- bool isDoubleOrNull(ClosedWorld closedWorld) {
- return instructionType.containsOnlyDouble(closedWorld);
- }
+ bool isStringOrNull(AbstractValueDomain domain) =>
+ domain.isStringOrNull(instructionType);
- bool isBoolean(ClosedWorld closedWorld) {
- return instructionType.containsOnlyBool(closedWorld) &&
- !instructionType.isNullable;
- }
+ bool isPrimitive(AbstractValueDomain domain) =>
+ domain.isPrimitive(instructionType);
- bool isBooleanOrNull(ClosedWorld closedWorld) {
- return instructionType.containsOnlyBool(closedWorld);
- }
-
- bool isString(ClosedWorld closedWorld) {
- return instructionType.containsOnlyString(closedWorld) &&
- !instructionType.isNullable;
- }
-
- bool isStringOrNull(ClosedWorld closedWorld) {
- return instructionType.containsOnlyString(closedWorld);
- }
-
- bool isPrimitive(ClosedWorld closedWorld) {
- return (isPrimitiveOrNull(closedWorld) && !instructionType.isNullable) ||
- isNull();
- }
-
- bool isPrimitiveOrNull(ClosedWorld closedWorld) {
- return isIndexablePrimitive(closedWorld) ||
- isNumberOrNull(closedWorld) ||
- isBooleanOrNull(closedWorld) ||
- isNull();
- }
+ bool isPrimitiveOrNull(AbstractValueDomain domain) =>
+ domain.isPrimitiveOrNull(instructionType);
/**
* Type of the instruction.
*/
- TypeMask instructionType;
+ AbstractValue instructionType;
Selector get selector => null;
HInstruction getDartReceiver(ClosedWorld closedWorld) => null;
@@ -1367,19 +1259,19 @@
if (type == closedWorld.commonElements.objectType) return this;
if (type.isFunctionType || type.isMalformed || type.isFutureOr) {
return new HTypeConversion(type, kind,
- closedWorld.commonMasks.dynamicType, this, sourceInformation);
+ closedWorld.abstractValueDomain.dynamicType, this, sourceInformation);
}
assert(type.isInterfaceType);
if (kind == HTypeConversion.BOOLEAN_CONVERSION_CHECK) {
// Boolean conversion checks work on non-nullable booleans.
- return new HTypeConversion(type, kind, closedWorld.commonMasks.boolType,
- this, sourceInformation);
+ return new HTypeConversion(type, kind,
+ closedWorld.abstractValueDomain.boolType, this, sourceInformation);
} else if (kind == HTypeConversion.CHECKED_MODE_CHECK && !type.treatAsRaw) {
throw 'creating compound check to $type (this = ${this})';
} else {
InterfaceType interfaceType = type;
- TypeMask subtype =
- new TypeMask.subtype(interfaceType.element, closedWorld);
+ AbstractValue subtype = closedWorld.abstractValueDomain
+ .createNullableSubtype(interfaceType.element);
return new HTypeConversion(type, kind, subtype, this, sourceInformation);
}
}
@@ -1556,12 +1448,12 @@
* codegen decisions just prior to generating JavaScript.
*/
abstract class HLateInstruction extends HInstruction {
- HLateInstruction(List<HInstruction> inputs, TypeMask type)
+ HLateInstruction(List<HInstruction> inputs, AbstractValue type)
: super(inputs, type);
}
class HBoolify extends HInstruction {
- HBoolify(HInstruction value, TypeMask type)
+ HBoolify(HInstruction value, AbstractValue type)
: super(<HInstruction>[value], type) {
setUseGvn();
sourceInformation = value.sourceInformation;
@@ -1586,7 +1478,7 @@
}
HInstruction get checkedInput => inputs[0];
bool isJsStatement() => true;
- bool canThrow() => true;
+ bool canThrow(AbstractValueDomain domain) => true;
HInstruction nonCheck() => checkedInput.nonCheck();
}
@@ -1621,14 +1513,19 @@
}
abstract class HConditionalBranch extends HControlFlow {
- HConditionalBranch(inputs) : super(inputs);
+ HConditionalBranch(AbstractValueDomain domain, List<HInstruction> inputs)
+ : super(domain, inputs);
HInstruction get condition => inputs[0];
HBasicBlock get trueBranch => block.successors[0];
HBasicBlock get falseBranch => block.successors[1];
}
abstract class HControlFlow extends HInstruction {
- HControlFlow(inputs) : super(inputs, const TypeMask.nonNullEmpty());
+ HControlFlow(AbstractValueDomain domain, List<HInstruction> inputs)
+ // TODO(johnniwinther): May only expression-like [HInstruction]s should
+ // have an `instructionType`, or statement-like [HInstruction]s should
+ // have a throwing getter.
+ : super(inputs, domain.emptyType);
bool isControlFlow() => true;
bool isJsStatement() => true;
}
@@ -1650,14 +1547,14 @@
/// the closure class.
FunctionEntity callMethod;
- HCreate(this.element, List<HInstruction> inputs, TypeMask type,
+ HCreate(this.element, List<HInstruction> inputs, AbstractValue type,
SourceInformation sourceInformation,
{this.instantiatedTypes, this.hasRtiInput: false, this.callMethod})
: super(inputs, type) {
this.sourceInformation = sourceInformation;
}
- bool get isAllocation => true;
+ bool isAllocation(AbstractValueDomain domain) => true;
HInstruction get rtiInput {
assert(hasRtiInput);
@@ -1671,9 +1568,9 @@
// Allocates a box to hold mutated captured variables.
class HCreateBox extends HInstruction {
- HCreateBox(TypeMask type) : super(<HInstruction>[], type);
+ HCreateBox(AbstractValue type) : super(<HInstruction>[], type);
- bool get isAllocation => true;
+ bool isAllocation(AbstractValueDomain domain) => true;
accept(HVisitor visitor) => visitor.visitCreateBox(this);
@@ -1681,7 +1578,7 @@
}
abstract class HInvoke extends HInstruction {
- bool isAllocation = false;
+ bool _isAllocation = false;
/// [isInterceptedCall] is true if this invocation uses the interceptor
/// calling convention where the first input is the methods and the second
@@ -1692,17 +1589,21 @@
sideEffects.setDependsOnSomething();
}
static const int ARGUMENTS_OFFSET = 1;
- bool canThrow() => true;
+ bool canThrow(AbstractValueDomain domain) => true;
+ bool isAllocation(AbstractValueDomain domain) => _isAllocation;
+ void setAllocation(bool value) {
+ _isAllocation = value;
+ }
}
abstract class HInvokeDynamic extends HInvoke {
final InvokeDynamicSpecializer specializer;
Selector selector;
- TypeMask mask;
+ AbstractValue mask;
MemberEntity element;
HInvokeDynamic(Selector selector, this.mask, this.element,
- List<HInstruction> inputs, bool isIntercepted, TypeMask type)
+ List<HInstruction> inputs, bool isIntercepted, AbstractValue type)
: this.selector = selector,
specializer = isIntercepted
? InvokeDynamicSpecializer.lookupSpecializer(selector)
@@ -1741,8 +1642,8 @@
class HInvokeClosure extends HInvokeDynamic {
final List<DartType> typeArguments;
- HInvokeClosure(Selector selector, List<HInstruction> inputs, TypeMask type,
- this.typeArguments)
+ HInvokeClosure(Selector selector, List<HInstruction> inputs,
+ AbstractValue type, this.typeArguments)
: super(selector, null, null, inputs, false, type) {
assert(selector.isClosureCall);
assert(selector.callStructure.typeArgumentCount == typeArguments.length);
@@ -1756,9 +1657,9 @@
HInvokeDynamicMethod(
Selector selector,
- TypeMask mask,
+ AbstractValue mask,
List<HInstruction> inputs,
- TypeMask type,
+ AbstractValue type,
this.typeArguments,
SourceInformation sourceInformation,
{bool isIntercepted: false})
@@ -1772,8 +1673,13 @@
}
abstract class HInvokeDynamicField extends HInvokeDynamic {
- HInvokeDynamicField(Selector selector, TypeMask mask, MemberEntity element,
- List<HInstruction> inputs, bool isIntercepted, TypeMask type)
+ HInvokeDynamicField(
+ Selector selector,
+ AbstractValue mask,
+ MemberEntity element,
+ List<HInstruction> inputs,
+ bool isIntercepted,
+ AbstractValue type)
: super(selector, mask, element, inputs, isIntercepted, type);
String toString() => 'invoke dynamic field: selector=$selector, mask=$mask';
@@ -1782,11 +1688,11 @@
class HInvokeDynamicGetter extends HInvokeDynamicField {
HInvokeDynamicGetter(
Selector selector,
- TypeMask mask,
+ AbstractValue mask,
MemberEntity element,
List<HInstruction> inputs,
bool isIntercepted,
- TypeMask type,
+ AbstractValue type,
SourceInformation sourceInformation)
: super(selector, mask, element, inputs, isIntercepted, type) {
this.sourceInformation = sourceInformation;
@@ -1799,7 +1705,8 @@
List<DartType> get typeArguments => const <DartType>[];
// There might be an interceptor input, so `inputs.last` is the dart receiver.
- bool canThrow() => isTearOff ? inputs.last.canBeNull() : super.canThrow();
+ bool canThrow(AbstractValueDomain domain) =>
+ isTearOff ? inputs.last.canBeNull(domain) : super.canThrow(domain);
String toString() => 'invoke dynamic getter: selector=$selector, mask=$mask';
}
@@ -1807,11 +1714,11 @@
class HInvokeDynamicSetter extends HInvokeDynamicField {
HInvokeDynamicSetter(
Selector selector,
- TypeMask mask,
+ AbstractValue mask,
MemberEntity element,
List<HInstruction> inputs,
bool isIntercepted,
- TypeMask type,
+ AbstractValue type,
SourceInformation sourceInformation)
: super(selector, mask, element, inputs, isIntercepted, type) {
this.sourceInformation = sourceInformation;
@@ -1832,7 +1739,7 @@
final bool targetCanThrow;
- bool canThrow() => targetCanThrow;
+ bool canThrow(AbstractValueDomain domain) => targetCanThrow;
/// If this instruction is a call to a constructor, [instantiatedTypes]
/// contains the type(s) used in the (Dart) `New` expression(s). The
@@ -1841,7 +1748,7 @@
List<DartType> instantiatedTypes;
/** The first input must be the target. */
- HInvokeStatic(this.element, inputs, TypeMask type, this.typeArguments,
+ HInvokeStatic(this.element, inputs, AbstractValue type, this.typeArguments,
{this.targetCanThrow: true, bool isIntercepted: false})
: super(inputs, type) {
isInterceptedCall = isIntercepted;
@@ -1866,7 +1773,7 @@
this.selector,
List<HInstruction> inputs,
bool isIntercepted,
- TypeMask type,
+ AbstractValue type,
List<DartType> typeArguments,
SourceInformation sourceInformation,
{this.isSetter})
@@ -1904,7 +1811,7 @@
HInvokeConstructorBody(
ConstructorBodyEntity element,
List<HInstruction> inputs,
- TypeMask type,
+ AbstractValue type,
SourceInformation sourceInformation)
: super(element, inputs, type, const <DartType>[]) {
this.sourceInformation = sourceInformation;
@@ -1917,7 +1824,7 @@
abstract class HFieldAccess extends HInstruction {
final FieldEntity element;
- HFieldAccess(this.element, List<HInstruction> inputs, TypeMask type)
+ HFieldAccess(this.element, List<HInstruction> inputs, AbstractValue type)
: super(inputs, type);
HInstruction get receiver => inputs[0];
@@ -1926,7 +1833,7 @@
class HFieldGet extends HFieldAccess {
final bool isAssignable;
- HFieldGet(FieldEntity element, HInstruction receiver, TypeMask type,
+ HFieldGet(FieldEntity element, HInstruction receiver, AbstractValue type,
{bool isAssignable})
: this.isAssignable =
(isAssignable != null) ? isAssignable : element.isAssignable,
@@ -1952,7 +1859,7 @@
return false;
}
- bool canThrow() => receiver.canBeNull();
+ bool canThrow(AbstractValueDomain domain) => receiver.canBeNull(domain);
HInstruction getDartReceiver(ClosedWorld closedWorld) => receiver;
bool onlyThrowsNSM() => true;
@@ -1967,15 +1874,15 @@
}
class HFieldSet extends HFieldAccess {
- HFieldSet(FieldEntity element, HInstruction receiver, HInstruction value)
- : super(element, <HInstruction>[receiver, value],
- const TypeMask.nonNullEmpty()) {
+ HFieldSet(AbstractValueDomain domain, FieldEntity element,
+ HInstruction receiver, HInstruction value)
+ : super(element, <HInstruction>[receiver, value], domain.emptyType) {
sideEffects.clearAllSideEffects();
sideEffects.clearAllDependencies();
sideEffects.setChangesInstanceProperty();
}
- bool canThrow() => receiver.canBeNull();
+ bool canThrow(AbstractValueDomain domain) => receiver.canBeNull(domain);
HInstruction getDartReceiver(ClosedWorld closedWorld) => receiver;
bool onlyThrowsNSM() => true;
@@ -1989,7 +1896,8 @@
class HGetLength extends HInstruction {
final bool isAssignable;
- HGetLength(HInstruction receiver, TypeMask type, {bool this.isAssignable})
+ HGetLength(HInstruction receiver, AbstractValue type,
+ {bool this.isAssignable})
: super(<HInstruction>[receiver], type) {
assert(isAssignable != null);
sideEffects.clearAllSideEffects();
@@ -2002,7 +1910,7 @@
HInstruction get receiver => inputs.single;
- bool canThrow() => receiver.canBeNull();
+ bool canThrow(AbstractValueDomain domain) => receiver.canBeNull(domain);
HInstruction getDartReceiver(ClosedWorld closedWorld) => receiver;
bool onlyThrowsNSM() => true;
@@ -2028,7 +1936,7 @@
final int opKind;
HReadModifyWrite._(this.element, this.jsOp, this.opKind,
- List<HInstruction> inputs, TypeMask type)
+ List<HInstruction> inputs, AbstractValue type)
: super(inputs, type) {
sideEffects.clearAllSideEffects();
sideEffects.clearAllDependencies();
@@ -2037,16 +1945,16 @@
}
HReadModifyWrite.assignOp(FieldEntity element, String jsOp,
- HInstruction receiver, HInstruction operand, TypeMask type)
+ HInstruction receiver, HInstruction operand, AbstractValue type)
: this._(
element, jsOp, ASSIGN_OP, <HInstruction>[receiver, operand], type);
- HReadModifyWrite.preOp(
- FieldEntity element, String jsOp, HInstruction receiver, TypeMask type)
+ HReadModifyWrite.preOp(FieldEntity element, String jsOp,
+ HInstruction receiver, AbstractValue type)
: this._(element, jsOp, PRE_OP, <HInstruction>[receiver], type);
- HReadModifyWrite.postOp(
- FieldEntity element, String jsOp, HInstruction receiver, TypeMask type)
+ HReadModifyWrite.postOp(FieldEntity element, String jsOp,
+ HInstruction receiver, AbstractValue type)
: this._(element, jsOp, POST_OP, <HInstruction>[receiver], type);
HInstruction get receiver => inputs[0];
@@ -2055,7 +1963,7 @@
bool get isPostOp => opKind == POST_OP;
bool get isAssignOp => opKind == ASSIGN_OP;
- bool canThrow() => receiver.canBeNull();
+ bool canThrow(AbstractValueDomain domain) => receiver.canBeNull(domain);
HInstruction getDartReceiver(ClosedWorld closedWorld) => receiver;
bool onlyThrowsNSM() => true;
@@ -2070,7 +1978,7 @@
abstract class HLocalAccess extends HInstruction {
final Local variable;
- HLocalAccess(this.variable, List<HInstruction> inputs, TypeMask type)
+ HLocalAccess(this.variable, List<HInstruction> inputs, AbstractValue type)
: super(inputs, type);
HInstruction get receiver => inputs[0];
@@ -2079,7 +1987,7 @@
class HLocalGet extends HLocalAccess {
// No need to use GVN for a [HLocalGet], it is just a local
// access.
- HLocalGet(Local variable, HLocalValue local, TypeMask type,
+ HLocalGet(Local variable, HLocalValue local, AbstractValue type,
SourceInformation sourceInformation)
: super(variable, <HInstruction>[local], type) {
this.sourceInformation = sourceInformation;
@@ -2091,9 +1999,9 @@
}
class HLocalSet extends HLocalAccess {
- HLocalSet(Local variable, HLocalValue local, HInstruction value)
- : super(variable, <HInstruction>[local, value],
- const TypeMask.nonNullEmpty());
+ HLocalSet(AbstractValueDomain domain, Local variable, HLocalValue local,
+ HInstruction value)
+ : super(variable, <HInstruction>[local, value], domain.emptyType);
accept(HVisitor visitor) => visitor.visitLocalSet(this);
@@ -2103,12 +2011,12 @@
}
abstract class HForeign extends HInstruction {
- HForeign(TypeMask type, List<HInstruction> inputs) : super(inputs, type);
+ HForeign(AbstractValue type, List<HInstruction> inputs) : super(inputs, type);
bool get isStatement => false;
native.NativeBehavior get nativeBehavior => null;
- bool canThrow() {
+ bool canThrow(AbstractValueDomain domain) {
return sideEffects.hasSideEffects() || sideEffects.dependsOnSomething();
}
}
@@ -2120,7 +2028,7 @@
native.NativeThrowBehavior throwBehavior;
final FunctionEntity foreignFunction;
- HForeignCode(this.codeTemplate, TypeMask type, List<HInstruction> inputs,
+ HForeignCode(this.codeTemplate, AbstractValue type, List<HInstruction> inputs,
{this.isStatement: false,
SideEffects effects,
native.NativeBehavior nativeBehavior,
@@ -2146,8 +2054,12 @@
}
}
- HForeignCode.statement(js.Template codeTemplate, List<HInstruction> inputs,
- SideEffects effects, native.NativeBehavior nativeBehavior, TypeMask type)
+ HForeignCode.statement(
+ js.Template codeTemplate,
+ List<HInstruction> inputs,
+ SideEffects effects,
+ native.NativeBehavior nativeBehavior,
+ AbstractValue type)
: this(codeTemplate, type, inputs,
isStatement: true,
effects: effects,
@@ -2156,9 +2068,9 @@
accept(HVisitor visitor) => visitor.visitForeignCode(this);
bool isJsStatement() => isStatement;
- bool canThrow() {
+ bool canThrow(AbstractValueDomain domain) {
if (inputs.length > 0) {
- return inputs.first.canBeNull()
+ return inputs.first.canBeNull(domain)
? throwBehavior.canThrow
: throwBehavior.onNonNull.canThrow;
}
@@ -2167,8 +2079,10 @@
bool onlyThrowsNSM() => throwBehavior.isOnlyNullNSMGuard;
- bool get isAllocation =>
- nativeBehavior != null && nativeBehavior.isAllocation && !canBeNull();
+ bool isAllocation(AbstractValueDomain domain) =>
+ nativeBehavior != null &&
+ nativeBehavior.isAllocation &&
+ !canBeNull(domain);
int typeCode() => HInstruction.FOREIGN_CODE_TYPECODE;
bool typeEquals(other) => other is HForeignCode;
@@ -2183,7 +2097,7 @@
abstract class HInvokeBinary extends HInstruction {
final Selector selector;
HInvokeBinary(
- HInstruction left, HInstruction right, this.selector, TypeMask type)
+ HInstruction left, HInstruction right, this.selector, AbstractValue type)
: super(<HInstruction>[left, right], type) {
sideEffects.clearAllSideEffects();
sideEffects.clearAllDependencies();
@@ -2197,14 +2111,15 @@
}
abstract class HBinaryArithmetic extends HInvokeBinary {
- HBinaryArithmetic(
- HInstruction left, HInstruction right, Selector selector, TypeMask type)
+ HBinaryArithmetic(HInstruction left, HInstruction right, Selector selector,
+ AbstractValue type)
: super(left, right, selector, type);
BinaryOperation operation(ConstantSystem constantSystem);
}
class HAdd extends HBinaryArithmetic {
- HAdd(HInstruction left, HInstruction right, Selector selector, TypeMask type)
+ HAdd(HInstruction left, HInstruction right, Selector selector,
+ AbstractValue type)
: super(left, right, selector, type);
accept(HVisitor visitor) => visitor.visitAdd(this);
@@ -2216,8 +2131,8 @@
}
class HDivide extends HBinaryArithmetic {
- HDivide(
- HInstruction left, HInstruction right, Selector selector, TypeMask type)
+ HDivide(HInstruction left, HInstruction right, Selector selector,
+ AbstractValue type)
: super(left, right, selector, type);
accept(HVisitor visitor) => visitor.visitDivide(this);
@@ -2229,8 +2144,8 @@
}
class HMultiply extends HBinaryArithmetic {
- HMultiply(
- HInstruction left, HInstruction right, Selector selector, TypeMask type)
+ HMultiply(HInstruction left, HInstruction right, Selector selector,
+ AbstractValue type)
: super(left, right, selector, type);
accept(HVisitor visitor) => visitor.visitMultiply(this);
@@ -2241,8 +2156,8 @@
}
class HSubtract extends HBinaryArithmetic {
- HSubtract(
- HInstruction left, HInstruction right, Selector selector, TypeMask type)
+ HSubtract(HInstruction left, HInstruction right, Selector selector,
+ AbstractValue type)
: super(left, right, selector, type);
accept(HVisitor visitor) => visitor.visitSubtract(this);
@@ -2254,8 +2169,8 @@
}
class HTruncatingDivide extends HBinaryArithmetic {
- HTruncatingDivide(
- HInstruction left, HInstruction right, Selector selector, TypeMask type)
+ HTruncatingDivide(HInstruction left, HInstruction right, Selector selector,
+ AbstractValue type)
: super(left, right, selector, type);
accept(HVisitor visitor) => visitor.visitTruncatingDivide(this);
@@ -2267,8 +2182,8 @@
}
class HRemainder extends HBinaryArithmetic {
- HRemainder(
- HInstruction left, HInstruction right, Selector selector, TypeMask type)
+ HRemainder(HInstruction left, HInstruction right, Selector selector,
+ AbstractValue type)
: super(left, right, selector, type);
accept(HVisitor visitor) => visitor.visitRemainder(this);
@@ -2285,7 +2200,8 @@
* Its block has one successor per constant, and one for the default.
*/
class HSwitch extends HControlFlow {
- HSwitch(List<HInstruction> inputs) : super(inputs);
+ HSwitch(AbstractValueDomain domain, List<HInstruction> inputs)
+ : super(domain, inputs);
HConstant constant(int index) => inputs[index + 1];
HInstruction get expression => inputs[0];
@@ -2303,14 +2219,14 @@
}
abstract class HBinaryBitOp extends HInvokeBinary {
- HBinaryBitOp(
- HInstruction left, HInstruction right, Selector selector, TypeMask type)
+ HBinaryBitOp(HInstruction left, HInstruction right, Selector selector,
+ AbstractValue type)
: super(left, right, selector, type);
}
class HShiftLeft extends HBinaryBitOp {
- HShiftLeft(
- HInstruction left, HInstruction right, Selector selector, TypeMask type)
+ HShiftLeft(HInstruction left, HInstruction right, Selector selector,
+ AbstractValue type)
: super(left, right, selector, type);
accept(HVisitor visitor) => visitor.visitShiftLeft(this);
@@ -2322,8 +2238,8 @@
}
class HShiftRight extends HBinaryBitOp {
- HShiftRight(
- HInstruction left, HInstruction right, Selector selector, TypeMask type)
+ HShiftRight(HInstruction left, HInstruction right, Selector selector,
+ AbstractValue type)
: super(left, right, selector, type);
accept(HVisitor visitor) => visitor.visitShiftRight(this);
@@ -2335,8 +2251,8 @@
}
class HBitOr extends HBinaryBitOp {
- HBitOr(
- HInstruction left, HInstruction right, Selector selector, TypeMask type)
+ HBitOr(HInstruction left, HInstruction right, Selector selector,
+ AbstractValue type)
: super(left, right, selector, type);
accept(HVisitor visitor) => visitor.visitBitOr(this);
@@ -2348,8 +2264,8 @@
}
class HBitAnd extends HBinaryBitOp {
- HBitAnd(
- HInstruction left, HInstruction right, Selector selector, TypeMask type)
+ HBitAnd(HInstruction left, HInstruction right, Selector selector,
+ AbstractValue type)
: super(left, right, selector, type);
accept(HVisitor visitor) => visitor.visitBitAnd(this);
@@ -2361,8 +2277,8 @@
}
class HBitXor extends HBinaryBitOp {
- HBitXor(
- HInstruction left, HInstruction right, Selector selector, TypeMask type)
+ HBitXor(HInstruction left, HInstruction right, Selector selector,
+ AbstractValue type)
: super(left, right, selector, type);
accept(HVisitor visitor) => visitor.visitBitXor(this);
@@ -2388,7 +2304,7 @@
}
class HNegate extends HInvokeUnary {
- HNegate(HInstruction input, Selector selector, TypeMask type)
+ HNegate(HInstruction input, Selector selector, AbstractValue type)
: super(input, selector, type);
accept(HVisitor visitor) => visitor.visitNegate(this);
@@ -2400,7 +2316,7 @@
}
class HAbs extends HInvokeUnary {
- HAbs(HInstruction input, Selector selector, TypeMask type)
+ HAbs(HInstruction input, Selector selector, AbstractValue type)
: super(input, selector, type);
accept(HVisitor visitor) => visitor.visitAbs(this);
@@ -2411,7 +2327,7 @@
}
class HBitNot extends HInvokeUnary {
- HBitNot(HInstruction input, Selector selector, TypeMask type)
+ HBitNot(HInstruction input, Selector selector, AbstractValue type)
: super(input, selector, type);
accept(HVisitor visitor) => visitor.visitBitNot(this);
@@ -2423,13 +2339,13 @@
}
class HExit extends HControlFlow {
- HExit() : super(const <HInstruction>[]);
+ HExit(AbstractValueDomain domain) : super(domain, const <HInstruction>[]);
toString() => 'exit';
accept(HVisitor visitor) => visitor.visitExit(this);
}
class HGoto extends HControlFlow {
- HGoto() : super(const <HInstruction>[]);
+ HGoto(AbstractValueDomain domain) : super(domain, const <HInstruction>[]);
toString() => 'goto';
accept(HVisitor visitor) => visitor.visitGoto(this);
}
@@ -2437,15 +2353,17 @@
abstract class HJump extends HControlFlow {
final JumpTarget target;
final LabelDefinition label;
- HJump(this.target, SourceInformation sourceInformation)
+ HJump(AbstractValueDomain domain, this.target,
+ SourceInformation sourceInformation)
: label = null,
- super(const <HInstruction>[]) {
+ super(domain, const <HInstruction>[]) {
this.sourceInformation = sourceInformation;
}
- HJump.toLabel(LabelDefinition label, SourceInformation sourceInformation)
+ HJump.toLabel(AbstractValueDomain domain, LabelDefinition label,
+ SourceInformation sourceInformation)
: label = label,
target = label.target,
- super(const <HInstruction>[]) {
+ super(domain, const <HInstruction>[]) {
this.sourceInformation = sourceInformation;
}
}
@@ -2456,13 +2374,15 @@
/// [SsaFromAstMixin.buildComplexSwitchStatement] for detail.
final bool breakSwitchContinueLoop;
- HBreak(JumpTarget target, SourceInformation sourceInformation,
+ HBreak(AbstractValueDomain domain, JumpTarget target,
+ SourceInformation sourceInformation,
{bool this.breakSwitchContinueLoop: false})
- : super(target, sourceInformation);
+ : super(domain, target, sourceInformation);
- HBreak.toLabel(LabelDefinition label, SourceInformation sourceInformation)
+ HBreak.toLabel(AbstractValueDomain domain, LabelDefinition label,
+ SourceInformation sourceInformation)
: breakSwitchContinueLoop = false,
- super.toLabel(label, sourceInformation);
+ super.toLabel(domain, label, sourceInformation);
String toString() => (label != null) ? 'break ${label.labelName}' : 'break';
@@ -2470,11 +2390,13 @@
}
class HContinue extends HJump {
- HContinue(JumpTarget target, SourceInformation sourceInformation)
- : super(target, sourceInformation);
+ HContinue(AbstractValueDomain domain, JumpTarget target,
+ SourceInformation sourceInformation)
+ : super(domain, target, sourceInformation);
- HContinue.toLabel(LabelDefinition label, SourceInformation sourceInformation)
- : super.toLabel(label, sourceInformation);
+ HContinue.toLabel(AbstractValueDomain domain, LabelDefinition label,
+ SourceInformation sourceInformation)
+ : super.toLabel(domain, label, sourceInformation);
String toString() =>
(label != null) ? 'continue ${label.labelName}' : 'continue';
@@ -2486,7 +2408,7 @@
HLocalValue exception;
HBasicBlock catchBlock;
HBasicBlock finallyBlock;
- HTry() : super(const <HInstruction>[]);
+ HTry(AbstractValueDomain domain) : super(domain, const <HInstruction>[]);
toString() => 'try';
accept(HVisitor visitor) => visitor.visitTry(this);
HBasicBlock get joinBlock => this.block.successors.last;
@@ -2498,7 +2420,7 @@
// leads to one of this instruction a predecessor of catch and
// finally.
class HExitTry extends HControlFlow {
- HExitTry() : super(const <HInstruction>[]);
+ HExitTry(AbstractValueDomain domain) : super(domain, const <HInstruction>[]);
toString() => 'exit try';
accept(HVisitor visitor) => visitor.visitExitTry(this);
HBasicBlock get bodyTrySuccessor => block.successors[0];
@@ -2506,7 +2428,8 @@
class HIf extends HConditionalBranch {
HBlockFlow blockInformation = null;
- HIf(HInstruction condition) : super(<HInstruction>[condition]);
+ HIf(AbstractValueDomain domain, HInstruction condition)
+ : super(domain, <HInstruction>[condition]);
toString() => 'if';
accept(HVisitor visitor) => visitor.visitIf(this);
@@ -2528,15 +2451,16 @@
static const int DO_WHILE_LOOP = 1;
final int kind;
- HLoopBranch(HInstruction condition, [this.kind = CONDITION_FIRST_LOOP])
- : super(<HInstruction>[condition]);
+ HLoopBranch(AbstractValueDomain domain, HInstruction condition,
+ [this.kind = CONDITION_FIRST_LOOP])
+ : super(domain, <HInstruction>[condition]);
toString() => 'loop-branch';
accept(HVisitor visitor) => visitor.visitLoopBranch(this);
}
class HConstant extends HInstruction {
final ConstantValue constant;
- HConstant.internal(this.constant, TypeMask constantType)
+ HConstant.internal(this.constant, AbstractValue constantType)
: super(<HInstruction>[], constantType);
toString() => 'literal: ${constant.toStructuredText()}';
@@ -2568,7 +2492,8 @@
}
class HNot extends HInstruction {
- HNot(HInstruction value, TypeMask type) : super(<HInstruction>[value], type) {
+ HNot(HInstruction value, AbstractValue type)
+ : super(<HInstruction>[value], type) {
setUseGvn();
}
@@ -2584,7 +2509,8 @@
* value from the start, whereas [HLocalValue]s need to be initialized first.
*/
class HLocalValue extends HInstruction {
- HLocalValue(Entity variable, TypeMask type) : super(<HInstruction>[], type) {
+ HLocalValue(Entity variable, AbstractValue type)
+ : super(<HInstruction>[], type) {
sourceElement = variable;
}
@@ -2611,7 +2537,7 @@
}
class HThis extends HParameterValue {
- HThis(ThisLocal element, TypeMask type) : super(element, type);
+ HThis(ThisLocal element, AbstractValue type) : super(element, type);
ThisLocal get sourceElement => super.sourceElement;
void set sourceElement(covariant ThisLocal local) {
@@ -2640,15 +2566,15 @@
// The order of the [inputs] must correspond to the order of the
// predecessor-edges. That is if an input comes from the first predecessor
// of the surrounding block, then the input must be the first in the [HPhi].
- HPhi(Local variable, List<HInstruction> inputs, TypeMask type)
+ HPhi(Local variable, List<HInstruction> inputs, AbstractValue type)
: super(inputs, type) {
sourceElement = variable;
}
- HPhi.noInputs(Local variable, TypeMask type)
+ HPhi.noInputs(Local variable, AbstractValue type)
: this(variable, <HInstruction>[], type);
- HPhi.singleInput(Local variable, HInstruction input, TypeMask type)
+ HPhi.singleInput(Local variable, HInstruction input, AbstractValue type)
: this(variable, <HInstruction>[input], type);
- HPhi.manyInputs(Local variable, List<HInstruction> inputs, TypeMask type)
+ HPhi.manyInputs(Local variable, List<HInstruction> inputs, AbstractValue type)
: this(variable, inputs, type);
void addInput(HInstruction input) {
@@ -2727,8 +2653,9 @@
}
class HReturn extends HControlFlow {
- HReturn(HInstruction value, SourceInformation sourceInformation)
- : super(<HInstruction>[value]) {
+ HReturn(AbstractValueDomain domain, HInstruction value,
+ SourceInformation sourceInformation)
+ : super(domain, <HInstruction>[value]) {
this.sourceInformation = sourceInformation;
}
toString() => 'return';
@@ -2736,42 +2663,45 @@
}
class HThrowExpression extends HInstruction {
- HThrowExpression(HInstruction value, SourceInformation sourceInformation)
- : super(<HInstruction>[value], const TypeMask.nonNullEmpty()) {
+ HThrowExpression(AbstractValueDomain domain, HInstruction value,
+ SourceInformation sourceInformation)
+ : super(<HInstruction>[value], domain.emptyType) {
this.sourceInformation = sourceInformation;
}
toString() => 'throw expression';
accept(HVisitor visitor) => visitor.visitThrowExpression(this);
- bool canThrow() => true;
+ bool canThrow(AbstractValueDomain domain) => true;
}
class HAwait extends HInstruction {
- HAwait(HInstruction value, TypeMask type)
+ HAwait(HInstruction value, AbstractValue type)
: super(<HInstruction>[value], type);
toString() => 'await';
accept(HVisitor visitor) => visitor.visitAwait(this);
// An await will throw if its argument is not a real future.
- bool canThrow() => true;
+ bool canThrow(AbstractValueDomain domain) => true;
SideEffects sideEffects = new SideEffects();
}
class HYield extends HInstruction {
- HYield(HInstruction value, this.hasStar, SourceInformation sourceInformation)
- : super(<HInstruction>[value], const TypeMask.nonNullEmpty()) {
+ HYield(AbstractValueDomain domain, HInstruction value, this.hasStar,
+ SourceInformation sourceInformation)
+ : super(<HInstruction>[value], domain.emptyType) {
this.sourceInformation = sourceInformation;
}
bool hasStar;
toString() => 'yield';
accept(HVisitor visitor) => visitor.visitYield(this);
- bool canThrow() => false;
+ bool canThrow(AbstractValueDomain domain) => false;
SideEffects sideEffects = new SideEffects();
}
class HThrow extends HControlFlow {
final bool isRethrow;
- HThrow(HInstruction value, SourceInformation sourceInformation,
+ HThrow(AbstractValueDomain domain, HInstruction value,
+ SourceInformation sourceInformation,
{this.isRethrow: false})
- : super(<HInstruction>[value]) {
+ : super(domain, <HInstruction>[value]) {
this.sourceInformation = sourceInformation;
}
toString() => 'throw';
@@ -2780,7 +2710,7 @@
class HStatic extends HInstruction {
final MemberEntity element;
- HStatic(this.element, TypeMask type, SourceInformation sourceInformation)
+ HStatic(this.element, AbstractValue type, SourceInformation sourceInformation)
: super(<HInstruction>[], type) {
assert(element != null);
sideEffects.clearAllSideEffects();
@@ -2815,7 +2745,7 @@
// (a && C.JSArray_methods).get$first(a)
//
- HInterceptor(HInstruction receiver, TypeMask type)
+ HInterceptor(HInstruction receiver, AbstractValue type)
: super(<HInstruction>[receiver], type) {
this.sourceInformation = receiver.sourceInformation;
sideEffects.clearAllSideEffects();
@@ -2858,15 +2788,16 @@
List<DartType> typeArguments;
Set<ClassEntity> interceptedClasses;
HOneShotInterceptor(
+ AbstractValueDomain domain,
Selector selector,
- TypeMask mask,
+ AbstractValue mask,
List<HInstruction> inputs,
- TypeMask type,
+ AbstractValue type,
this.typeArguments,
this.interceptedClasses)
: super(selector, mask, null, inputs, true, type) {
assert(inputs[0] is HConstant);
- assert(inputs[0].isNull());
+ assert(inputs[0].isNull(domain));
assert(selector.callStructure.typeArgumentCount == typeArguments.length);
}
bool isCallOnInterceptor(ClosedWorld closedWorld) => true;
@@ -2879,7 +2810,8 @@
class HLazyStatic extends HInstruction {
final FieldEntity element;
- HLazyStatic(this.element, TypeMask type, SourceInformation sourceInformation)
+ HLazyStatic(
+ this.element, AbstractValue type, SourceInformation sourceInformation)
: super(<HInstruction>[], type) {
// TODO(4931): The first access has side-effects, but we afterwards we
// should be able to GVN.
@@ -2894,13 +2826,13 @@
int typeCode() => 30;
// TODO(4931): can we do better here?
bool isCodeMotionInvariant() => false;
- bool canThrow() => true;
+ bool canThrow(AbstractValueDomain domain) => true;
}
class HStaticStore extends HInstruction {
MemberEntity element;
- HStaticStore(this.element, HInstruction value)
- : super(<HInstruction>[value], const TypeMask.nonNullEmpty()) {
+ HStaticStore(AbstractValueDomain domain, this.element, HInstruction value)
+ : super(<HInstruction>[value], domain.emptyType) {
sideEffects.clearAllSideEffects();
sideEffects.clearAllDependencies();
sideEffects.setChangesStaticProperty();
@@ -2915,11 +2847,12 @@
}
class HLiteralList extends HInstruction {
- HLiteralList(List<HInstruction> inputs, TypeMask type) : super(inputs, type);
+ HLiteralList(List<HInstruction> inputs, AbstractValue type)
+ : super(inputs, type);
toString() => 'literal list';
accept(HVisitor visitor) => visitor.visitLiteralList(this);
- bool get isAllocation => true;
+ bool isAllocation(AbstractValueDomain domain) => true;
}
/**
@@ -2928,8 +2861,8 @@
*/
class HIndex extends HInstruction {
final Selector selector;
- HIndex(
- HInstruction receiver, HInstruction index, this.selector, TypeMask type)
+ HIndex(HInstruction receiver, HInstruction index, this.selector,
+ AbstractValue type)
: super(<HInstruction>[receiver, index], type) {
sideEffects.clearAllSideEffects();
sideEffects.clearAllDependencies();
@@ -2949,7 +2882,7 @@
HInstruction getDartReceiver(ClosedWorld closedWorld) => receiver;
bool onlyThrowsNSM() => true;
- bool canThrow() => receiver.canBeNull();
+ bool canThrow(AbstractValueDomain domain) => receiver.canBeNull(domain);
int typeCode() => HInstruction.INDEX_TYPECODE;
bool typeEquals(HInstruction other) => other is HIndex;
@@ -2962,10 +2895,9 @@
*/
class HIndexAssign extends HInstruction {
final Selector selector;
- HIndexAssign(HInstruction receiver, HInstruction index, HInstruction value,
- this.selector)
- : super(<HInstruction>[receiver, index, value],
- const TypeMask.nonNullEmpty()) {
+ HIndexAssign(AbstractValueDomain domain, HInstruction receiver,
+ HInstruction index, HInstruction value, this.selector)
+ : super(<HInstruction>[receiver, index, value], domain.emptyType) {
sideEffects.clearAllSideEffects();
sideEffects.clearAllDependencies();
sideEffects.setChangesIndex();
@@ -2983,7 +2915,7 @@
HInstruction getDartReceiver(ClosedWorld closedWorld) => receiver;
bool onlyThrowsNSM() => true;
- bool canThrow() => receiver.canBeNull();
+ bool canThrow(AbstractValueDomain domain) => receiver.canBeNull(domain);
}
class HIs extends HInstruction {
@@ -3000,14 +2932,14 @@
final int kind;
final bool useInstanceOf;
- HIs.direct(DartType typeExpression, HInstruction expression, TypeMask type,
- SourceInformation sourceInformation)
+ HIs.direct(DartType typeExpression, HInstruction expression,
+ AbstractValue type, SourceInformation sourceInformation)
: this.internal(
typeExpression, [expression], RAW_CHECK, type, sourceInformation);
// Pre-verified that the check can be done using 'instanceof'.
HIs.instanceOf(DartType typeExpression, HInstruction expression,
- TypeMask type, SourceInformation sourceInformation)
+ AbstractValue type, SourceInformation sourceInformation)
: this.internal(
typeExpression, [expression], RAW_CHECK, type, sourceInformation,
useInstanceOf: true);
@@ -3016,7 +2948,7 @@
DartType typeExpression,
HInstruction expression,
HInterceptor interceptor,
- TypeMask type,
+ AbstractValue type,
SourceInformation sourceInformation) {
assert(
(typeExpression.isFunctionType || typeExpression.isInterfaceType) &&
@@ -3026,18 +2958,26 @@
RAW_CHECK, type, sourceInformation);
}
- HIs.compound(DartType typeExpression, HInstruction expression,
- HInstruction call, TypeMask type, SourceInformation sourceInformation)
+ HIs.compound(
+ DartType typeExpression,
+ HInstruction expression,
+ HInstruction call,
+ AbstractValue type,
+ SourceInformation sourceInformation)
: this.internal(typeExpression, [expression, call], COMPOUND_CHECK, type,
sourceInformation);
- HIs.variable(DartType typeExpression, HInstruction expression,
- HInstruction call, TypeMask type, SourceInformation sourceInformation)
+ HIs.variable(
+ DartType typeExpression,
+ HInstruction expression,
+ HInstruction call,
+ AbstractValue type,
+ SourceInformation sourceInformation)
: this.internal(typeExpression, [expression, call], VARIABLE_CHECK, type,
sourceInformation);
HIs.internal(this.typeExpression, List<HInstruction> inputs, this.kind,
- TypeMask type, SourceInformation sourceInformation,
+ AbstractValue type, SourceInformation sourceInformation,
{bool this.useInstanceOf: false})
: super(inputs, type) {
assert(kind >= RAW_CHECK && kind <= VARIABLE_CHECK);
@@ -3082,7 +3022,7 @@
class HIsViaInterceptor extends HLateInstruction {
final DartType typeExpression;
HIsViaInterceptor(
- this.typeExpression, HInstruction interceptor, TypeMask type)
+ this.typeExpression, HInstruction interceptor, AbstractValue type)
: super(<HInstruction>[interceptor], type) {
setUseGvn();
}
@@ -3116,10 +3056,11 @@
//
final Selector receiverTypeCheckSelector;
- TypeMask checkedType; // Not final because we refine it.
- TypeMask inputType; // Holds input type for codegen after HTypeKnown removal.
+ AbstractValue checkedType; // Not final because we refine it.
+ AbstractValue
+ inputType; // Holds input type for codegen after HTypeKnown removal.
- HTypeConversion(this.typeExpression, this.kind, TypeMask type,
+ HTypeConversion(this.typeExpression, this.kind, AbstractValue type,
HInstruction input, SourceInformation sourceInformation,
{this.receiverTypeCheckSelector})
: checkedType = type,
@@ -3131,7 +3072,7 @@
}
HTypeConversion.withTypeRepresentation(this.typeExpression, this.kind,
- TypeMask type, HInstruction input, HInstruction typeRepresentation)
+ AbstractValue type, HInstruction input, HInstruction typeRepresentation)
: checkedType = type,
receiverTypeCheckSelector = null,
super(<HInstruction>[input, typeRepresentation], type) {
@@ -3139,8 +3080,8 @@
sourceElement = input.sourceElement;
}
- HTypeConversion.viaMethodOnType(this.typeExpression, this.kind, TypeMask type,
- HInstruction reifiedType, HInstruction input)
+ HTypeConversion.viaMethodOnType(this.typeExpression, this.kind,
+ AbstractValue type, HInstruction reifiedType, HInstruction input)
: checkedType = type,
receiverTypeCheckSelector = null,
super(<HInstruction>[reifiedType, input], type) {
@@ -3203,16 +3144,16 @@
/// The [HTypeKnown] instruction marks a value with a refined type.
class HTypeKnown extends HCheck {
- TypeMask knownType;
+ AbstractValue knownType;
final bool _isMovable;
- HTypeKnown.pinned(TypeMask knownType, HInstruction input)
+ HTypeKnown.pinned(AbstractValue knownType, HInstruction input)
: this.knownType = knownType,
this._isMovable = false,
super(<HInstruction>[input], knownType);
HTypeKnown.witnessed(
- TypeMask knownType, HInstruction input, HInstruction witness)
+ AbstractValue knownType, HInstruction input, HInstruction witness)
: this.knownType = knownType,
this._isMovable = true,
super(<HInstruction>[input, witness], knownType);
@@ -3222,7 +3163,7 @@
bool isJsStatement() => false;
bool isControlFlow() => false;
- bool canThrow() => false;
+ bool canThrow(AbstractValueDomain domain) => false;
bool get isPinned => inputs.length == 1;
@@ -3251,7 +3192,7 @@
}
class HStringConcat extends HInstruction {
- HStringConcat(HInstruction left, HInstruction right, TypeMask type)
+ HStringConcat(HInstruction left, HInstruction right, AbstractValue type)
: super(<HInstruction>[left, right], type) {
// TODO(sra): Until Issue 9293 is fixed, this false dependency keeps the
// concats bunched with stringified inputs for much better looking code with
@@ -3271,7 +3212,7 @@
* into a String value.
*/
class HStringify extends HInstruction {
- HStringify(HInstruction input, TypeMask type)
+ HStringify(HInstruction input, AbstractValue type)
: super(<HInstruction>[input], type) {
sideEffects.setAllSideEffects();
sideEffects.setDependsOnSomething();
@@ -3561,14 +3502,14 @@
/// Reads raw reified type info from an object.
class HTypeInfoReadRaw extends HInstruction {
- HTypeInfoReadRaw(HInstruction receiver, TypeMask instructionType)
+ HTypeInfoReadRaw(HInstruction receiver, AbstractValue instructionType)
: super(<HInstruction>[receiver], instructionType) {
setUseGvn();
}
accept(HVisitor visitor) => visitor.visitTypeInfoReadRaw(this);
- bool canThrow() => false;
+ bool canThrow(AbstractValueDomain domain) => false;
int typeCode() => HInstruction.TYPE_INFO_READ_RAW_TYPECODE;
bool typeEquals(HInstruction other) => other is HTypeInfoReadRaw;
@@ -3587,14 +3528,14 @@
final bool isIntercepted;
HTypeInfoReadVariable.intercepted(this.variable, HInstruction interceptor,
- HInstruction receiver, TypeMask instructionType)
+ HInstruction receiver, AbstractValue instructionType)
: isIntercepted = true,
super(<HInstruction>[interceptor, receiver], instructionType) {
setUseGvn();
}
HTypeInfoReadVariable.noInterceptor(
- this.variable, HInstruction receiver, TypeMask instructionType)
+ this.variable, HInstruction receiver, AbstractValue instructionType)
: isIntercepted = false,
super(<HInstruction>[receiver], instructionType) {
setUseGvn();
@@ -3609,7 +3550,7 @@
accept(HVisitor visitor) => visitor.visitTypeInfoReadVariable(this);
- bool canThrow() => false;
+ bool canThrow(AbstractValueDomain domain) => false;
int typeCode() => HInstruction.TYPE_INFO_READ_VARIABLE_TYPECODE;
bool typeEquals(HInstruction other) => other is HTypeInfoReadVariable;
@@ -3677,14 +3618,14 @@
final TypeInfoExpressionKind kind;
final DartType dartType;
HTypeInfoExpression(this.kind, this.dartType, List<HInstruction> inputs,
- TypeMask instructionType)
+ AbstractValue instructionType)
: super(inputs, instructionType) {
setUseGvn();
}
accept(HVisitor visitor) => visitor.visitTypeInfoExpression(this);
- bool canThrow() => false;
+ bool canThrow(AbstractValueDomain domain) => false;
int typeCode() => HInstruction.TYPE_INFO_EXPRESSION_TYPECODE;
bool typeEquals(HInstruction other) => other is HTypeInfoExpression;
diff --git a/pkg/compiler/lib/src/ssa/optimize.dart b/pkg/compiler/lib/src/ssa/optimize.dart
index dd8bea5..170afb3 100644
--- a/pkg/compiler/lib/src/ssa/optimize.dart
+++ b/pkg/compiler/lib/src/ssa/optimize.dart
@@ -17,6 +17,7 @@
import '../js_backend/runtime_types.dart';
import '../native/native.dart' as native;
import '../options.dart';
+import '../types/abstract_value_domain.dart';
import '../types/types.dart';
import '../universe/selector.dart' show Selector;
import '../universe/side_effects.dart' show SideEffects;
@@ -88,12 +89,12 @@
// Run a dead code eliminator before LICM because dead
// interceptors are often in the way of LICM'able instructions.
new SsaDeadCodeEliminator(closedWorld, this),
- new SsaGlobalValueNumberer(),
+ new SsaGlobalValueNumberer(closedWorld.abstractValueDomain),
// After GVN, some instructions might need their type to be
// updated because they now have different inputs.
new SsaTypePropagator(
_results, _options, closedWorld.commonElements, closedWorld),
- codeMotion = new SsaCodeMotion(),
+ codeMotion = new SsaCodeMotion(closedWorld.abstractValueDomain),
loadElimination = new SsaLoadElimination(_compiler, closedWorld),
new SsaRedundantPhiEliminator(),
new SsaDeadPhiEliminator(),
@@ -126,8 +127,8 @@
phases = <OptimizationPhase>[
new SsaTypePropagator(
_results, _options, closedWorld.commonElements, closedWorld),
- new SsaGlobalValueNumberer(),
- new SsaCodeMotion(),
+ new SsaGlobalValueNumberer(closedWorld.abstractValueDomain),
+ new SsaCodeMotion(closedWorld.abstractValueDomain),
new SsaValueRangeAnalyzer(closedWorld, this),
new SsaInstructionSimplifier(
_results, _options, _rtiSubstitutions, closedWorld, registry),
@@ -163,7 +164,7 @@
if (mask.containsOnly(closedWorld.commonElements.jsFixedArrayClass) ||
mask.containsOnly(closedWorld.commonElements.jsUnmodifiableArrayClass) ||
mask.containsOnlyString(closedWorld) ||
- closedWorld.commonMasks.isTypedArray(mask)) {
+ closedWorld.abstractValueDomain.isTypedArray(mask)) {
return true;
}
return false;
@@ -195,6 +196,9 @@
ConstantSystem get constantSystem => _closedWorld.constantSystem;
+ AbstractValueDomain get _abstractValueDomain =>
+ _closedWorld.abstractValueDomain;
+
NativeData get _nativeData => _closedWorld.nativeData;
void visitGraph(HGraph visitee) {
@@ -215,12 +219,12 @@
// might be that an operation thought to return double, can be
// simplified to an int. For example:
// `2.5 * 10`.
- if (!(replacement.isNumberOrNull(_closedWorld) &&
- instruction.isNumberOrNull(_closedWorld))) {
+ if (!(replacement.isNumberOrNull(_abstractValueDomain) &&
+ instruction.isNumberOrNull(_abstractValueDomain))) {
// If we can replace [instruction] with [replacement], then
// [replacement]'s type can be narrowed.
- TypeMask newType = replacement.instructionType
- .intersection(instruction.instructionType, _closedWorld);
+ TypeMask newType = _abstractValueDomain.intersection(
+ replacement.instructionType, instruction.instructionType);
replacement.instructionType = newType;
}
@@ -249,7 +253,8 @@
}
ConstantValue getConstantFromType(HInstruction node) {
- if (node.isValue() && !node.canBeNull()) {
+ if (node.isValue(_abstractValueDomain) &&
+ !node.canBeNull(_abstractValueDomain)) {
ValueTypeMask valueMask = node.instructionType;
if (valueMask.value.isBool) {
return valueMask.value;
@@ -299,13 +304,13 @@
List<HInstruction> inputs = node.inputs;
assert(inputs.length == 1);
HInstruction input = inputs[0];
- if (input.isBoolean(_closedWorld)) return input;
+ if (input.isBoolean(_abstractValueDomain)) return input;
// If the code is unreachable, remove the HBoolify. This can happen when
// there is a throw expression in a short-circuit conditional. Removing the
// unreachable HBoolify makes it easier to reconstruct the short-circuit
// operation.
- if (input.instructionType.isEmpty) return input;
+ if (_abstractValueDomain.isEmpty(input.instructionType)) return input;
// All values that cannot be 'true' are boolified to false.
TypeMask mask = input.instructionType;
@@ -346,7 +351,7 @@
HInstruction tryOptimizeLengthInterceptedGetter(HInvokeDynamic node) {
HInstruction actualReceiver = node.inputs[1];
- if (actualReceiver.isIndexablePrimitive(_closedWorld)) {
+ if (actualReceiver.isIndexablePrimitive(_abstractValueDomain)) {
if (actualReceiver.isConstantString()) {
HConstant constantInput = actualReceiver;
StringConstantValue constant = constantInput.constant;
@@ -359,14 +364,14 @@
bool isFixed =
isFixedLength(actualReceiver.instructionType, _closedWorld);
TypeMask actualType = node.instructionType;
- TypeMask resultType = _closedWorld.commonMasks.positiveIntType;
+ TypeMask resultType = _abstractValueDomain.positiveIntType;
// If we already have computed a more specific type, keep that type.
- if (HInstruction.isInstanceOf(
- actualType, commonElements.jsUInt31Class, _closedWorld)) {
- resultType = _closedWorld.commonMasks.uint31Type;
- } else if (HInstruction.isInstanceOf(
- actualType, commonElements.jsUInt32Class, _closedWorld)) {
- resultType = _closedWorld.commonMasks.uint32Type;
+ if (_abstractValueDomain.isInstanceOf(
+ actualType, commonElements.jsUInt31Class)) {
+ resultType = _abstractValueDomain.uint31Type;
+ } else if (_abstractValueDomain.isInstanceOf(
+ actualType, commonElements.jsUInt32Class)) {
+ resultType = _abstractValueDomain.uint32Type;
}
HGetLength result =
new HGetLength(actualReceiver, resultType, isAssignable: !isFixed);
@@ -410,7 +415,7 @@
if (selector.isCall || selector.isOperator) {
FunctionEntity target;
- if (input.isExtendableArray(_closedWorld)) {
+ if (input.isExtendableArray(_abstractValueDomain)) {
if (applies(commonElements.jsArrayRemoveLast)) {
target = commonElements.jsArrayRemoveLast;
} else if (applies(commonElements.jsArrayAdd)) {
@@ -420,7 +425,7 @@
target = commonElements.jsArrayAdd;
}
}
- } else if (input.isStringOrNull(_closedWorld)) {
+ } else if (input.isStringOrNull(_abstractValueDomain)) {
if (commonElements.appliesToJsStringSplit(
selector, mask, _closedWorld)) {
return handleStringSplit(node);
@@ -429,11 +434,12 @@
// make sure the receiver and the argument are not null.
// TODO(sra): Do this via [node.specializer].
HInstruction argument = node.inputs[2];
- if (argument.isString(_closedWorld) && !input.canBeNull()) {
+ if (argument.isString(_abstractValueDomain) &&
+ !input.canBeNull(_abstractValueDomain)) {
return new HStringConcat(input, argument, node.instructionType);
}
} else if (applies(commonElements.jsStringToString) &&
- !input.canBeNull()) {
+ !input.canBeNull(_abstractValueDomain)) {
return input;
}
}
@@ -469,7 +475,7 @@
HInstruction handleStringSplit(HInvokeDynamic node) {
HInstruction argument = node.inputs[2];
- if (!argument.isString(_closedWorld)) return node;
+ if (!argument.isString(_abstractValueDomain)) return node;
// Replace `s.split$1(pattern)` with
//
@@ -479,7 +485,7 @@
// t4 = setRuntimeTypeInfo(t1, t3);
//
- TypeMask resultMask = _closedWorld.commonMasks.growableListType;
+ TypeMask resultMask = _abstractValueDomain.growableListType;
HInvokeDynamicMethod splitInstruction = new HInvokeDynamicMethod(
node.selector,
@@ -490,7 +496,7 @@
node.sourceInformation,
isIntercepted: false)
..element = commonElements.jsStringSplit
- ..isAllocation = true;
+ ..setAllocation(true);
if (!_closedWorld.rtiNeed
.classNeedsTypeArguments(commonElements.jsArrayClass)) {
@@ -503,7 +509,7 @@
TypeInfoExpressionKind.COMPLETE,
_closedWorld.elementEnvironment.getThisType(commonElements.stringClass),
<HInstruction>[],
- _closedWorld.commonMasks.dynamicType);
+ _abstractValueDomain.dynamicType);
node.block.addBefore(node, stringTypeInfo);
HInstruction typeInfo = new HTypeInfoExpression(
@@ -511,7 +517,7 @@
_closedWorld.elementEnvironment
.getThisType(commonElements.jsArrayClass),
<HInstruction>[stringTypeInfo],
- _closedWorld.commonMasks.dynamicType);
+ _abstractValueDomain.dynamicType);
node.block.addBefore(node, typeInfo);
HInvokeStatic tagInstruction = new HInvokeStatic(
@@ -522,7 +528,7 @@
// 'Linear typing' trick: [tagInstruction] is the only use of the
// [splitInstruction], so it becomes the sole alias.
// TODO(sra): Build this knowledge into alias analysis.
- tagInstruction.isAllocation = true;
+ tagInstruction.setAllocation(true);
return tagInstruction;
}
@@ -660,7 +666,7 @@
HInstruction visitBoundsCheck(HBoundsCheck node) {
HInstruction index = node.index;
- if (index.isInteger(_closedWorld)) return node;
+ if (index.isInteger(_abstractValueDomain)) return node;
if (index.isConstant()) {
HConstant constantInstruction = index;
assert(!constantInstruction.constant.isInt);
@@ -688,7 +694,8 @@
HInstruction right = node.right;
// We can only perform this rewriting on Integer, as it is not
// valid for -0.0.
- if (left.isInteger(_closedWorld) && right.isInteger(_closedWorld)) {
+ if (left.isInteger(_abstractValueDomain) &&
+ right.isInteger(_abstractValueDomain)) {
if (left is HConstant && left.constant.isZero) return right;
if (right is HConstant && right.constant.isZero) return left;
}
@@ -698,7 +705,8 @@
HInstruction visitMultiply(HMultiply node) {
HInstruction left = node.left;
HInstruction right = node.right;
- if (left.isNumber(_closedWorld) && right.isNumber(_closedWorld)) {
+ if (left.isNumber(_abstractValueDomain) &&
+ right.isNumber(_abstractValueDomain)) {
if (left is HConstant && left.constant.isOne) return right;
if (right is HConstant && right.constant.isOne) return left;
}
@@ -744,14 +752,15 @@
// Intersection of int and double return conflicting, so
// we don't optimize on numbers to preserve the runtime semantics.
- if (!(left.isNumberOrNull(_closedWorld) &&
- right.isNumberOrNull(_closedWorld))) {
+ if (!(left.isNumberOrNull(_abstractValueDomain) &&
+ right.isNumberOrNull(_abstractValueDomain))) {
if (leftType.isDisjoint(rightType, _closedWorld)) {
return makeFalse();
}
}
- if (left.isNull() && right.isNull()) {
+ if (left.isNull(_abstractValueDomain) &&
+ right.isNull(_abstractValueDomain)) {
return makeTrue();
}
@@ -759,15 +768,15 @@
if (constant.constant.isTrue) {
return input;
} else {
- return new HNot(input, _closedWorld.commonMasks.boolType);
+ return new HNot(input, _abstractValueDomain.boolType);
}
}
- if (left.isConstantBoolean() && right.isBoolean(_closedWorld)) {
+ if (left.isConstantBoolean() && right.isBoolean(_abstractValueDomain)) {
return compareConstant(left, right);
}
- if (right.isConstantBoolean() && left.isBoolean(_closedWorld)) {
+ if (right.isConstantBoolean() && left.isBoolean(_abstractValueDomain)) {
return compareConstant(right, left);
}
@@ -776,8 +785,8 @@
// dart2js runtime has not always been consistent with the Dart
// specification (section 16.0.1), which makes distinctions on NaNs and
// -0.0 that are hard to implement efficiently.
- if (left.isIntegerOrNull(_closedWorld)) return makeTrue();
- if (!left.canBePrimitiveNumber(_closedWorld)) return makeTrue();
+ if (left.isIntegerOrNull(_abstractValueDomain)) return makeTrue();
+ if (!left.canBePrimitiveNumber(_abstractValueDomain)) return makeTrue();
}
return null;
@@ -859,7 +868,7 @@
InterfaceType interfaceType = type;
ClassEntity element = interfaceType.element;
HInstruction expression = node.expression;
- if (expression.isInteger(_closedWorld)) {
+ if (expression.isInteger(_abstractValueDomain)) {
if (element == commonElements.intClass ||
element == commonElements.numClass ||
commonElements.isNumberOrStringSupertype(element)) {
@@ -871,7 +880,7 @@
} else {
return _graph.addConstantBool(false, _closedWorld);
}
- } else if (expression.isDouble(_closedWorld)) {
+ } else if (expression.isDouble(_abstractValueDomain)) {
if (element == commonElements.doubleClass ||
element == commonElements.numClass ||
commonElements.isNumberOrStringSupertype(element)) {
@@ -884,14 +893,14 @@
} else {
return _graph.addConstantBool(false, _closedWorld);
}
- } else if (expression.isNumber(_closedWorld)) {
+ } else if (expression.isNumber(_abstractValueDomain)) {
if (element == commonElements.numClass) {
return _graph.addConstantBool(true, _closedWorld);
} else {
// We cannot just return false, because the expression may be of
// type int or double.
}
- } else if (expression.canBePrimitiveNumber(_closedWorld) &&
+ } else if (expression.canBePrimitiveNumber(_abstractValueDomain) &&
element == commonElements.intClass) {
// We let the JS semantics decide for that check.
return node;
@@ -928,14 +937,14 @@
if (type.isFutureOr) {
HInstruction input = node.checkedInput;
// `null` always passes type conversion.
- if (input.isNull()) return input;
+ if (input.isNull(_abstractValueDomain)) return input;
// TODO(johnniwinther): Optimize FutureOr type conversions.
return node;
}
if (!type.treatAsRaw) {
HInstruction input = node.checkedInput;
// `null` always passes type conversion.
- if (input.isNull()) return input;
+ if (input.isNull(_abstractValueDomain)) return input;
// TODO(sra): We can statically check [input] if it is a constructor.
// TODO(sra): We can statically check [input] if it is load from a field
// of the same ground type, or load from a field of a parameterized type
@@ -945,7 +954,7 @@
if (type.isFunctionType) {
HInstruction input = node.checkedInput;
// `null` always passes type conversion.
- if (input.isNull()) return input;
+ if (input.isNull(_abstractValueDomain)) return input;
// TODO(johnniwinther): Optimize function type conversions.
// TODO(sra): We can statically check [input] if it is a closure getter.
return node;
@@ -999,7 +1008,7 @@
// should not be necessary but it currently makes it easier for
// other optimizations to reason about a fixed length constructor
// that we know takes an int.
- if (receiver.inputs[0].isInteger(_closedWorld)) {
+ if (receiver.inputs[0].isInteger(_abstractValueDomain)) {
return receiver.inputs[0];
}
} else if (receiver.isConstantList() || receiver.isConstantString()) {
@@ -1121,7 +1130,7 @@
value = other;
}
}
- return new HFieldSet(field, receiver, value);
+ return new HFieldSet(_abstractValueDomain, field, receiver, value);
}
HInstruction visitInvokeClosure(HInvokeClosure node) {
@@ -1151,8 +1160,8 @@
if (element == commonElements.identicalFunction) {
if (node.inputs.length == 2) {
- return new HIdentity(node.inputs[0], node.inputs[1], null,
- _closedWorld.commonMasks.boolType)
+ return new HIdentity(
+ node.inputs[0], node.inputs[1], null, _abstractValueDomain.boolType)
..sourceInformation = node.sourceInformation;
}
} else if (element == commonElements.setRuntimeTypeInfo) {
@@ -1170,17 +1179,17 @@
} else if (commonElements.isCheckInt(element)) {
if (node.inputs.length == 1) {
HInstruction argument = node.inputs[0];
- if (argument.isInteger(_closedWorld)) return argument;
+ if (argument.isInteger(_abstractValueDomain)) return argument;
}
} else if (commonElements.isCheckNum(element)) {
if (node.inputs.length == 1) {
HInstruction argument = node.inputs[0];
- if (argument.isNumber(_closedWorld)) return argument;
+ if (argument.isNumber(_abstractValueDomain)) return argument;
}
} else if (commonElements.isCheckString(element)) {
if (node.inputs.length == 1) {
HInstruction argument = node.inputs[0];
- if (argument.isString(_closedWorld)) return argument;
+ if (argument.isString(_abstractValueDomain)) return argument;
}
}
return node;
@@ -1190,7 +1199,7 @@
// If type information is not needed, use the raw Array.
HInstruction source = node.inputs[0];
if (source.usedBy.length != 1) return node;
- if (!source.isArray(_closedWorld)) return node;
+ if (!source.isArray(_abstractValueDomain)) return node;
for (HInstruction user in node.usedBy) {
if (user is HGetLength) continue;
if (user is HIndex) continue;
@@ -1263,13 +1272,12 @@
.createString(leftString.stringValue + rightString.stringValue),
_closedWorld);
if (prefix == null) return folded;
- return new HStringConcat(
- prefix, folded, _closedWorld.commonMasks.stringType);
+ return new HStringConcat(prefix, folded, _abstractValueDomain.stringType);
}
HInstruction visitStringify(HStringify node) {
HInstruction input = node.inputs[0];
- if (input.isString(_closedWorld)) return input;
+ if (input.isString(_abstractValueDomain)) return input;
HInstruction asString(String string) =>
_graph.addConstant(constantSystem.createString(string), _closedWorld);
@@ -1305,8 +1313,8 @@
// it directly. Keep the stringifier for primitives (since they have fast
// path code in the stringifier) and for classes requiring interceptors
// (since SsaInstructionSimplifier runs after SsaSimplifyInterceptors).
- if (input.canBePrimitive(_closedWorld)) return null;
- if (input.canBeNull()) return null;
+ if (input.canBePrimitive(_abstractValueDomain)) return null;
+ if (input.canBeNull(_abstractValueDomain)) return null;
Selector selector = Selectors.toString_;
TypeMask toStringType = TypeMaskFactory.inferredTypeForSelector(
selector, input.instructionType, _globalInferenceResults);
@@ -1394,7 +1402,7 @@
}
if (source == null) return null;
- return new HTypeInfoReadRaw(source, _closedWorld.commonMasks.dynamicType);
+ return new HTypeInfoReadRaw(source, _abstractValueDomain.dynamicType);
}
// TODO(sra): Consider fusing type expression trees with no type variables,
@@ -1418,7 +1426,7 @@
TypeInfoExpressionKind.COMPLETE,
typeArgument,
const <HInstruction>[],
- _closedWorld.commonMasks.dynamicType);
+ _abstractValueDomain.dynamicType);
return replacement;
}
return node;
@@ -1450,7 +1458,7 @@
TypeInfoExpressionKind.COMPLETE,
type,
arguments,
- _closedWorld.commonMasks.dynamicType);
+ _abstractValueDomain.dynamicType);
return replacement;
}
@@ -1543,6 +1551,9 @@
SsaCheckInserter(this.trustPrimitives, this.closedWorld, this.boundsChecked);
+ AbstractValueDomain get _abstractValueDomain =>
+ closedWorld.abstractValueDomain;
+
void visitGraph(HGraph graph) {
this.graph = graph;
@@ -1566,13 +1577,13 @@
HBoundsCheck insertBoundsCheck(
HInstruction indexNode, HInstruction array, HInstruction indexArgument) {
HGetLength length = new HGetLength(
- array, closedWorld.commonMasks.positiveIntType,
+ array, closedWorld.abstractValueDomain.positiveIntType,
isAssignable: !isFixedLength(array.instructionType, closedWorld));
indexNode.block.addBefore(indexNode, length);
- TypeMask type = indexArgument.isPositiveInteger(closedWorld)
+ TypeMask type = indexArgument.isPositiveInteger(_abstractValueDomain)
? indexArgument.instructionType
- : closedWorld.commonMasks.positiveIntType;
+ : closedWorld.abstractValueDomain.positiveIntType;
HBoundsCheck check = new HBoundsCheck(indexArgument, length, array, type)
..sourceInformation = indexNode.sourceInformation;
indexNode.block.addBefore(indexNode, check);
@@ -1583,7 +1594,7 @@
// the index eg. if it is a constant. The range information from the
// BoundsCheck instruction is attached to the input directly by
// visitBoundsCheck in the SsaValueRangeAnalyzer.
- if (!indexArgument.isInteger(closedWorld)) {
+ if (!indexArgument.isInteger(_abstractValueDomain)) {
indexArgument.replaceAllUsersDominatedBy(indexNode, check);
}
boundsChecked.add(indexNode);
@@ -1630,6 +1641,9 @@
SsaDeadCodeEliminator(this.closedWorld, this.optimizer);
+ AbstractValueDomain get _abstractValueDomain =>
+ closedWorld.abstractValueDomain;
+
HInstruction zapInstructionCache;
HInstruction get zapInstruction {
if (zapInstructionCache == null) {
@@ -1683,14 +1697,15 @@
HInstruction current = instruction.next;
do {
if ((current.getDartReceiver(closedWorld) == receiver) &&
- current.canThrow()) {
+ current.canThrow(_abstractValueDomain)) {
return true;
}
if (current is HForeignCode &&
templateThrowsNSMonNull(current, receiver)) {
return true;
}
- if (current.canThrow() || current.sideEffects.hasSideEffects()) {
+ if (current.canThrow(_abstractValueDomain) ||
+ current.sideEffects.hasSideEffects()) {
return false;
}
HInstruction next = current.next;
@@ -1734,8 +1749,8 @@
return false;
}
- return instruction.isAllocation &&
- instruction.isPure() &&
+ return instruction.isAllocation(_abstractValueDomain) &&
+ instruction.isPure(_abstractValueDomain) &&
trivialDeadStoreReceivers.putIfAbsent(
instruction, () => instruction.usedBy.every(isDeadUse));
}
@@ -1749,12 +1764,12 @@
if (!instruction.usedBy.isEmpty) return false;
if (isTrivialDeadStore(instruction)) return true;
if (instruction.sideEffects.hasSideEffects()) return false;
- if (instruction.canThrow() &&
+ if (instruction.canThrow(_abstractValueDomain) &&
instruction.onlyThrowsNSM() &&
hasFollowingThrowingNSM(instruction)) {
return true;
}
- return !instruction.canThrow() &&
+ return !instruction.canThrow(_abstractValueDomain) &&
instruction is! HParameterValue &&
instruction is! HLocalSet;
}
@@ -1966,6 +1981,9 @@
SsaLiveBlockAnalyzer(this.graph, this.closedWorld, this.optimizer);
+ AbstractValueDomain get _abstractValueDomain =>
+ closedWorld.abstractValueDomain;
+
Map<HInstruction, Range> get ranges => optimizer.ranges;
bool isDeadBlock(HBasicBlock block) => !live.contains(block);
@@ -2003,7 +2021,7 @@
}
void visitSwitch(HSwitch node) {
- if (node.expression.isInteger(closedWorld)) {
+ if (node.expression.isInteger(_abstractValueDomain)) {
Range switchRange = ranges[node.expression];
if (switchRange != null &&
switchRange.lower is IntValue &&
@@ -2149,13 +2167,14 @@
}
class SsaGlobalValueNumberer implements OptimizationPhase {
+ final AbstractValueDomain _abstractValueDomain;
final String name = "SsaGlobalValueNumberer";
final Set<int> visited;
List<int> blockChangesFlags;
List<int> loopChangesFlags;
- SsaGlobalValueNumberer() : visited = new Set<int>();
+ SsaGlobalValueNumberer(this._abstractValueDomain) : visited = new Set<int>();
void visitGraph(HGraph graph) {
computeChangesFlags(graph);
@@ -2210,7 +2229,8 @@
HInstruction next = instruction.next;
if (instruction.useGvn() &&
instruction.isMovable &&
- (!instruction.canThrow() || firstInstructionInLoop) &&
+ (!instruction.canThrow(_abstractValueDomain) ||
+ firstInstructionInLoop) &&
!instruction.sideEffects.dependsOn(dependsFlags)) {
bool loopInvariantInputs = true;
List<HInstruction> inputs = instruction.inputs;
@@ -2369,11 +2389,15 @@
// these computed ValueSet. It moves all instructions of the
// intersection into its own list of instructions.
class SsaCodeMotion extends HBaseVisitor implements OptimizationPhase {
+ final AbstractValueDomain _abstractValueDomain;
+
final String name = "SsaCodeMotion";
bool movedCode = false;
List<ValueSet> values;
+ SsaCodeMotion(this._abstractValueDomain);
+
void visitGraph(HGraph graph) {
values = new List<ValueSet>(graph.blocks.length);
for (int i = 0; i < graph.blocks.length; i++) {
@@ -2434,7 +2458,7 @@
// TODO(sra): We could move throwing instructions provided we keep the
// exceptions in the same order. This requires they are in the same order
// in all successors, which is not tracked by the ValueSet.
- if (current.canThrow()) continue;
+ if (current.canThrow(_abstractValueDomain)) continue;
if (current.sideEffects.dependsOn(dependsFlags)) continue;
bool canBeMoved = true;
@@ -2465,6 +2489,9 @@
SsaTypeConversionInserter(this.closedWorld);
+ AbstractValueDomain get _abstractValueDomain =>
+ closedWorld.abstractValueDomain;
+
void visitGraph(HGraph graph) {
visitDominatorTree(graph);
}
@@ -2537,7 +2564,7 @@
return;
}
- if (!input.instructionType.isNullable) return;
+ if (!_abstractValueDomain.canBeNull(input.instructionType)) return;
List<HBasicBlock> trueTargets = <HBasicBlock>[];
List<HBasicBlock> falseTargets = <HBasicBlock>[];
@@ -2546,7 +2573,8 @@
if (trueTargets.isEmpty && falseTargets.isEmpty) return;
- TypeMask nonNullType = input.instructionType.nonNullable();
+ TypeMask nonNullType =
+ _abstractValueDomain.excludeNull(input.instructionType);
for (HBasicBlock block in falseTargets) {
insertTypePropagationForDominatedUsers(block, input, nonNullType);
@@ -2607,6 +2635,9 @@
SsaLoadElimination(this.compiler, this.closedWorld);
+ AbstractValueDomain get _abstractValueDomain =>
+ closedWorld.abstractValueDomain;
+
void visitGraph(HGraph graph) {
memories = new List<MemorySet>(graph.blocks.length);
List<HBasicBlock> blocks = graph.blocks;
@@ -2764,7 +2795,7 @@
}
void visitInstruction(HInstruction instruction) {
- if (instruction.isAllocation) {
+ if (instruction.isAllocation(_abstractValueDomain)) {
memorySet.registerAllocation(instruction);
}
memorySet.killAffectedBy(instruction);
@@ -2877,6 +2908,9 @@
MemorySet(this.closedWorld);
+ AbstractValueDomain get _abstractValueDomain =>
+ closedWorld.abstractValueDomain;
+
/// Returns whether [first] and [second] always alias to the same object.
bool mustAlias(HInstruction first, HInstruction second) {
return first == second;
@@ -2890,8 +2924,8 @@
if (nonEscapingReceivers.contains(second)) return false;
// Typed arrays of different types might have a shared buffer.
if (couldBeTypedArray(first) && couldBeTypedArray(second)) return true;
- return !first.instructionType
- .isDisjoint(second.instructionType, closedWorld);
+ return !_abstractValueDomain.areDisjoint(
+ first.instructionType, second.instructionType);
}
bool isFinal(Object element) {
@@ -2905,7 +2939,8 @@
}
bool couldBeTypedArray(HInstruction receiver) {
- return closedWorld.commonMasks.couldBeTypedArray(receiver.instructionType);
+ return closedWorld.abstractValueDomain
+ .couldBeTypedArray(receiver.instructionType);
}
/// Returns whether [receiver] escapes the current function.
@@ -3090,8 +3125,8 @@
}
}
}
- TypeMask phiType =
- second.instructionType.union(first.instructionType, closedWorld);
+ TypeMask phiType = _abstractValueDomain.union(
+ second.instructionType, first.instructionType);
if (first is HPhi && first.block == block) {
HPhi phi = first;
phi.addInput(second);
diff --git a/pkg/compiler/lib/src/ssa/ssa_branch_builder.dart b/pkg/compiler/lib/src/ssa/ssa_branch_builder.dart
index 537fd50..f628a1e 100644
--- a/pkg/compiler/lib/src/ssa/ssa_branch_builder.dart
+++ b/pkg/compiler/lib/src/ssa/ssa_branch_builder.dart
@@ -42,7 +42,8 @@
checkNotAborted();
assert(identical(builder.current, builder.lastOpenedBlock));
HInstruction conditionValue = builder.popBoolified();
- HIf branch = new HIf(conditionValue)..sourceInformation = sourceInformation;
+ HIf branch = new HIf(builder.abstractValueDomain, conditionValue)
+ ..sourceInformation = sourceInformation;
HBasicBlock conditionExitBlock = builder.current;
builder.close(branch);
conditionBranch.exitLocals = builder.localsHandler;
diff --git a/pkg/compiler/lib/src/ssa/ssa_tracer.dart b/pkg/compiler/lib/src/ssa/ssa_tracer.dart
index 02bdb6b..f7956fb 100644
--- a/pkg/compiler/lib/src/ssa/ssa_tracer.dart
+++ b/pkg/compiler/lib/src/ssa/ssa_tracer.dart
@@ -7,6 +7,7 @@
import '../../compiler_new.dart' show OutputSink;
import '../diagnostics/invariant.dart' show DEBUG_MODE;
import '../js_backend/namer.dart' show Namer;
+import '../types/abstract_value_domain.dart';
import '../tracer.dart';
import '../world.dart' show ClosedWorld;
import 'nodes.dart';
@@ -118,35 +119,38 @@
HInstructionStringifier(this.currentBlock, this.closedWorld, this.namer);
+ AbstractValueDomain get _abstractValueDomain =>
+ closedWorld.abstractValueDomain;
+
visit(HInstruction node) => '${node.accept(this)} ${node.instructionType}';
String temporaryId(HInstruction instruction) {
String prefix;
- if (instruction.isNull()) {
+ if (instruction.isNull(_abstractValueDomain)) {
prefix = 'u';
- } else if (instruction.isConflicting()) {
+ } else if (instruction.isConflicting(_abstractValueDomain)) {
prefix = 'c';
- } else if (instruction.isExtendableArray(closedWorld)) {
+ } else if (instruction.isExtendableArray(_abstractValueDomain)) {
prefix = 'e';
- } else if (instruction.isFixedArray(closedWorld)) {
+ } else if (instruction.isFixedArray(_abstractValueDomain)) {
prefix = 'f';
- } else if (instruction.isMutableArray(closedWorld)) {
+ } else if (instruction.isMutableArray(_abstractValueDomain)) {
prefix = 'm';
- } else if (instruction.isReadableArray(closedWorld)) {
+ } else if (instruction.isArray(_abstractValueDomain)) {
prefix = 'a';
- } else if (instruction.isString(closedWorld)) {
+ } else if (instruction.isString(_abstractValueDomain)) {
prefix = 's';
- } else if (instruction.isIndexablePrimitive(closedWorld)) {
+ } else if (instruction.isIndexablePrimitive(_abstractValueDomain)) {
prefix = 'r';
- } else if (instruction.isBoolean(closedWorld)) {
+ } else if (instruction.isBoolean(_abstractValueDomain)) {
prefix = 'b';
- } else if (instruction.isInteger(closedWorld)) {
+ } else if (instruction.isInteger(_abstractValueDomain)) {
prefix = 'i';
- } else if (instruction.isDouble(closedWorld)) {
+ } else if (instruction.isDouble(_abstractValueDomain)) {
prefix = 'd';
- } else if (instruction.isNumber(closedWorld)) {
+ } else if (instruction.isNumber(_abstractValueDomain)) {
prefix = 'n';
- } else if (instruction.instructionType.containsAll(closedWorld)) {
+ } else if (_abstractValueDomain.containsAll(instruction.instructionType)) {
prefix = 'v';
} else {
prefix = 'U';
diff --git a/pkg/compiler/lib/src/ssa/types.dart b/pkg/compiler/lib/src/ssa/types.dart
index d973ef6..d93488d 100644
--- a/pkg/compiler/lib/src/ssa/types.dart
+++ b/pkg/compiler/lib/src/ssa/types.dart
@@ -13,30 +13,30 @@
static TypeMask inferredReturnTypeForElement(
FunctionEntity element, GlobalTypeInferenceResults results) {
return results.resultOfMember(element).returnType ??
- results.closedWorld.commonMasks.dynamicType;
+ results.closedWorld.abstractValueDomain.dynamicType;
}
static TypeMask inferredTypeForMember(
MemberEntity element, GlobalTypeInferenceResults results) {
return results.resultOfMember(element).type ??
- results.closedWorld.commonMasks.dynamicType;
+ results.closedWorld.abstractValueDomain.dynamicType;
}
static TypeMask inferredTypeForParameter(
Local element, GlobalTypeInferenceResults results) {
return results.resultOfParameter(element).type ??
- results.closedWorld.commonMasks.dynamicType;
+ results.closedWorld.abstractValueDomain.dynamicType;
}
static TypeMask inferredTypeForSelector(
Selector selector, TypeMask mask, GlobalTypeInferenceResults results) {
return results.typeOfSelector(selector, mask) ??
- results.closedWorld.commonMasks.dynamicType;
+ results.closedWorld.abstractValueDomain.dynamicType;
}
static TypeMask fromNativeBehavior(
native.NativeBehavior nativeBehavior, ClosedWorld closedWorld) {
- CommonMasks commonMasks = closedWorld.commonMasks;
+ CommonMasks commonMasks = closedWorld.abstractValueDomain;
var typesReturned = nativeBehavior.typesReturned;
if (typesReturned.isEmpty) return commonMasks.dynamicType;
diff --git a/pkg/compiler/lib/src/ssa/types_propagation.dart b/pkg/compiler/lib/src/ssa/types_propagation.dart
index 1d4a182..f5e50bb 100644
--- a/pkg/compiler/lib/src/ssa/types_propagation.dart
+++ b/pkg/compiler/lib/src/ssa/types_propagation.dart
@@ -5,6 +5,7 @@
import '../common_elements.dart' show CommonElements;
import '../elements/entities.dart';
import '../options.dart';
+import '../types/abstract_value_domain.dart';
import '../types/types.dart';
import '../universe/selector.dart' show Selector;
import '../world.dart' show ClosedWorld;
@@ -42,6 +43,9 @@
SsaTypePropagator(
this.results, this.options, this.commonElements, this.closedWorld);
+ AbstractValueDomain get abstractValueDomain =>
+ closedWorld.abstractValueDomain;
+
TypeMask computeType(HInstruction instruction) {
return instruction.accept(this);
}
@@ -125,21 +129,22 @@
TypeMask visitBinaryArithmetic(HBinaryArithmetic instruction) {
HInstruction left = instruction.left;
HInstruction right = instruction.right;
- if (left.isInteger(closedWorld) && right.isInteger(closedWorld)) {
- return closedWorld.commonMasks.intType;
+ if (left.isInteger(closedWorld.abstractValueDomain) &&
+ right.isInteger(closedWorld.abstractValueDomain)) {
+ return closedWorld.abstractValueDomain.intType;
}
- if (left.isDouble(closedWorld)) {
- return closedWorld.commonMasks.doubleType;
+ if (left.isDouble(closedWorld.abstractValueDomain)) {
+ return closedWorld.abstractValueDomain.doubleType;
}
- return closedWorld.commonMasks.numType;
+ return closedWorld.abstractValueDomain.numType;
}
TypeMask checkPositiveInteger(HBinaryArithmetic instruction) {
HInstruction left = instruction.left;
HInstruction right = instruction.right;
- if (left.isPositiveInteger(closedWorld) &&
- right.isPositiveInteger(closedWorld)) {
- return closedWorld.commonMasks.positiveIntType;
+ if (left.isPositiveInteger(closedWorld.abstractValueDomain) &&
+ right.isPositiveInteger(closedWorld.abstractValueDomain)) {
+ return closedWorld.abstractValueDomain.positiveIntType;
}
return visitBinaryArithmetic(instruction);
}
@@ -171,8 +176,8 @@
HInstruction operand = instruction.operand;
// We have integer subclasses that represent ranges, so widen any int
// subclass to full integer.
- if (operand.isInteger(closedWorld)) {
- return closedWorld.commonMasks.intType;
+ if (operand.isInteger(closedWorld.abstractValueDomain)) {
+ return closedWorld.abstractValueDomain.intType;
}
return instruction.operand.instructionType;
}
@@ -188,7 +193,7 @@
}
TypeMask visitPhi(HPhi phi) {
- TypeMask candidateType = closedWorld.commonMasks.emptyType;
+ TypeMask candidateType = closedWorld.abstractValueDomain.emptyType;
for (int i = 0, length = phi.inputs.length; i < length; i++) {
TypeMask inputType = phi.inputs[i].instructionType;
candidateType = candidateType.union(inputType, closedWorld);
@@ -206,11 +211,11 @@
// We only do an int check if the input is integer or null.
if (checkedType.containsOnlyNum(closedWorld) &&
!checkedType.containsOnlyDouble(closedWorld) &&
- input.isIntegerOrNull(closedWorld)) {
- instruction.checkedType = closedWorld.commonMasks.intType;
+ input.isIntegerOrNull(closedWorld.abstractValueDomain)) {
+ instruction.checkedType = closedWorld.abstractValueDomain.intType;
} else if (checkedType.containsOnlyInt(closedWorld) &&
- !input.isIntegerOrNull(closedWorld)) {
- instruction.checkedType = closedWorld.commonMasks.numType;
+ !input.isIntegerOrNull(closedWorld.abstractValueDomain)) {
+ instruction.checkedType = closedWorld.abstractValueDomain.numType;
}
}
@@ -224,9 +229,10 @@
if (inputType.containsOnlyInt(closedWorld) &&
checkedType.containsOnlyDouble(closedWorld)) {
if (inputType.isNullable && checkedType.isNullable) {
- outputType = closedWorld.commonMasks.doubleType.nullable();
+ outputType =
+ abstractValueDomain.includeNull(abstractValueDomain.doubleType);
} else {
- outputType = closedWorld.commonMasks.doubleType;
+ outputType = abstractValueDomain.doubleType;
}
}
}
@@ -252,7 +258,7 @@
HInstruction input = instruction.checkedInput;
TypeMask inputType = input.instructionType;
TypeMask outputType =
- instruction.knownType.intersection(inputType, closedWorld);
+ abstractValueDomain.intersection(instruction.knownType, inputType);
if (inputType != outputType) {
input.replaceAllUsersDominatedBy(instruction.next, instruction);
}
@@ -279,7 +285,7 @@
// If the instruction's type is integer or null, the codegen
// will emit a null check, which is enough to know if it will
// hit a noSuchMethod.
- return instruction.isIntegerOrNull(closedWorld);
+ return instruction.isIntegerOrNull(closedWorld.abstractValueDomain);
}
return true;
}
@@ -290,12 +296,12 @@
bool checkReceiver(HInvokeDynamic instruction) {
assert(instruction.isInterceptedCall);
HInstruction receiver = instruction.inputs[1];
- if (receiver.isNumber(closedWorld)) return false;
- if (receiver.isNumberOrNull(closedWorld)) {
+ if (receiver.isNumber(closedWorld.abstractValueDomain)) return false;
+ if (receiver.isNumberOrNull(closedWorld.abstractValueDomain)) {
convertInput(
instruction,
receiver,
- receiver.instructionType.nonNullable(),
+ closedWorld.abstractValueDomain.excludeNull(receiver.instructionType),
HTypeConversion.RECEIVER_TYPE_CHECK);
return true;
} else if (instruction.element == null) {
@@ -334,11 +340,11 @@
HInstruction right = instruction.inputs[2];
Selector selector = instruction.selector;
- if (selector.isOperator && left.isNumber(closedWorld)) {
- if (right.isNumber(closedWorld)) return false;
- TypeMask type = right.isIntegerOrNull(closedWorld)
- ? right.instructionType.nonNullable()
- : closedWorld.commonMasks.numType;
+ if (selector.isOperator && left.isNumber(closedWorld.abstractValueDomain)) {
+ if (right.isNumber(closedWorld.abstractValueDomain)) return false;
+ TypeMask type = right.isIntegerOrNull(closedWorld.abstractValueDomain)
+ ? closedWorld.abstractValueDomain.excludeNull(right.instructionType)
+ : closedWorld.abstractValueDomain.numType;
// TODO(ngeoffray): Some number operations don't have a builtin
// variant and will do the check in their method anyway. We
// still add a check because it allows to GVN these operations,
diff --git a/pkg/compiler/lib/src/ssa/value_range_analyzer.dart b/pkg/compiler/lib/src/ssa/value_range_analyzer.dart
index 1be4244f..97b75ff 100644
--- a/pkg/compiler/lib/src/ssa/value_range_analyzer.dart
+++ b/pkg/compiler/lib/src/ssa/value_range_analyzer.dart
@@ -633,7 +633,7 @@
void visitBasicBlock(HBasicBlock block) {
void visit(HInstruction instruction) {
Range range = instruction.accept(this);
- if (instruction.isInteger(closedWorld)) {
+ if (instruction.isInteger(closedWorld.abstractValueDomain)) {
assert(range != null);
ranges[instruction] = range;
}
@@ -644,10 +644,10 @@
}
Range visitInstruction(HInstruction instruction) {
- if (instruction.isPositiveInteger(closedWorld)) {
+ if (instruction.isPositiveInteger(closedWorld.abstractValueDomain)) {
return info.newNormalizedRange(
info.intZero, info.newPositiveValue(instruction));
- } else if (instruction.isInteger(closedWorld)) {
+ } else if (instruction.isInteger(closedWorld.abstractValueDomain)) {
InstructionValue value = info.newInstructionValue(instruction);
return info.newNormalizedRange(value, value);
} else {
@@ -656,12 +656,13 @@
}
Range visitPhi(HPhi phi) {
- if (!phi.isInteger(closedWorld)) return info.newUnboundRange();
+ if (!phi.isInteger(closedWorld.abstractValueDomain))
+ return info.newUnboundRange();
// Some phases may replace instructions that change the inputs of
// this phi. Only the [SsaTypesPropagation] phase will update the
// phi type. Play it safe by assuming the [SsaTypesPropagation]
// phase is not necessarily run before the [ValueRangeAnalyzer].
- if (phi.inputs.any((i) => !i.isInteger(closedWorld))) {
+ if (phi.inputs.any((i) => !i.isInteger(closedWorld.abstractValueDomain))) {
return info.newUnboundRange();
}
if (phi.block.isLoopHeader()) {
@@ -679,7 +680,8 @@
}
Range visitConstant(HConstant hConstant) {
- if (!hConstant.isInteger(closedWorld)) return info.newUnboundRange();
+ if (!hConstant.isInteger(closedWorld.abstractValueDomain))
+ return info.newUnboundRange();
ConstantValue constant = hConstant.constant;
NumConstantValue constantNum;
if (constant is DeferredConstantValue) {
@@ -721,7 +723,7 @@
Range lengthRange = ranges[check.length];
if (indexRange == null) {
indexRange = info.newUnboundRange();
- assert(!check.index.isInteger(closedWorld));
+ assert(!check.index.isInteger(closedWorld.abstractValueDomain));
}
if (lengthRange == null) {
// We might have lost the length range due to a type conversion that
@@ -729,7 +731,7 @@
// get to this point anyway, so no need to try and refine ranges.
return indexRange;
}
- assert(check.length.isInteger(closedWorld));
+ assert(check.length.isInteger(closedWorld.abstractValueDomain));
// Check if the index is strictly below the upper bound of the length
// range.
@@ -782,8 +784,10 @@
Range visitRelational(HRelational relational) {
HInstruction right = relational.right;
HInstruction left = relational.left;
- if (!left.isInteger(closedWorld)) return info.newUnboundRange();
- if (!right.isInteger(closedWorld)) return info.newUnboundRange();
+ if (!left.isInteger(closedWorld.abstractValueDomain))
+ return info.newUnboundRange();
+ if (!right.isInteger(closedWorld.abstractValueDomain))
+ return info.newUnboundRange();
BinaryOperation operation = relational.operation(constantSystem);
Range rightRange = ranges[relational.right];
Range leftRange = ranges[relational.left];
@@ -818,7 +822,8 @@
if (divisor != null) {
// For Integer values we can be precise in the upper bound, so special
// case those.
- if (left.isInteger(closedWorld) && right.isInteger(closedWorld)) {
+ if (left.isInteger(closedWorld.abstractValueDomain) &&
+ right.isInteger(closedWorld.abstractValueDomain)) {
if (divisor.isPositive) {
return info.newNormalizedRange(
info.intZero, divisor.upper - info.intOne);
@@ -826,7 +831,8 @@
return info.newNormalizedRange(
info.intZero, info.newNegateValue(divisor.lower) - info.intOne);
}
- } else if (left.isNumber(closedWorld) && right.isNumber(closedWorld)) {
+ } else if (left.isNumber(closedWorld.abstractValueDomain) &&
+ right.isNumber(closedWorld.abstractValueDomain)) {
if (divisor.isPositive) {
return info.newNormalizedRange(info.intZero, divisor.upper);
} else if (divisor.isNegative) {
@@ -844,16 +850,18 @@
Range dividend = ranges[left];
// If both operands are >=0, the result is >= 0 and bounded by the divisor.
if ((dividend != null && dividend.isPositive) ||
- left.isPositiveInteger(closedWorld)) {
+ left.isPositiveInteger(closedWorld.abstractValueDomain)) {
Range divisor = ranges[right];
if (divisor != null) {
if (divisor.isPositive) {
// For Integer values we can be precise in the upper bound.
- if (left.isInteger(closedWorld) && right.isInteger(closedWorld)) {
+ if (left.isInteger(closedWorld.abstractValueDomain) &&
+ right.isInteger(closedWorld.abstractValueDomain)) {
return info.newNormalizedRange(
info.intZero, divisor.upper - info.intOne);
}
- if (left.isNumber(closedWorld) && right.isNumber(closedWorld)) {
+ if (left.isNumber(closedWorld.abstractValueDomain) &&
+ right.isNumber(closedWorld.abstractValueDomain)) {
return info.newNormalizedRange(info.intZero, divisor.upper);
}
}
@@ -869,7 +877,9 @@
}
Range handleBinaryOperation(HBinaryArithmetic instruction) {
- if (!instruction.isInteger(closedWorld)) return info.newUnboundRange();
+ if (!instruction.isInteger(closedWorld.abstractValueDomain)) {
+ return info.newUnboundRange();
+ }
return instruction
.operation(constantSystem)
.apply(ranges[instruction.left], ranges[instruction.right]);
@@ -884,10 +894,13 @@
}
Range visitBitAnd(HBitAnd node) {
- if (!node.isInteger(closedWorld)) return info.newUnboundRange();
+ if (!node.isInteger(closedWorld.abstractValueDomain)) {
+ return info.newUnboundRange();
+ }
HInstruction right = node.right;
HInstruction left = node.left;
- if (left.isInteger(closedWorld) && right.isInteger(closedWorld)) {
+ if (left.isInteger(closedWorld.abstractValueDomain) &&
+ right.isInteger(closedWorld.abstractValueDomain)) {
return ranges[left] & ranges[right];
}
@@ -901,9 +914,9 @@
return info.newUnboundRange();
}
- if (left.isInteger(closedWorld)) {
+ if (left.isInteger(closedWorld.abstractValueDomain)) {
return tryComputeRange(left);
- } else if (right.isInteger(closedWorld)) {
+ } else if (right.isInteger(closedWorld.abstractValueDomain)) {
return tryComputeRange(right);
}
return info.newUnboundRange();
@@ -918,8 +931,8 @@
HInstruction createRangeConversion(
HInstruction cursor, HInstruction instruction) {
- HRangeConversion newInstruction =
- new HRangeConversion(instruction, closedWorld.commonMasks.intType);
+ HRangeConversion newInstruction = new HRangeConversion(
+ instruction, closedWorld.abstractValueDomain.intType);
conversions.add(newInstruction);
cursor.block.addBefore(cursor, newInstruction);
// Update the users of the instruction dominated by [cursor] to
@@ -982,8 +995,12 @@
if (condition is HIdentity) return info.newUnboundRange();
HInstruction right = condition.right;
HInstruction left = condition.left;
- if (!left.isInteger(closedWorld)) return info.newUnboundRange();
- if (!right.isInteger(closedWorld)) return info.newUnboundRange();
+ if (!left.isInteger(closedWorld.abstractValueDomain)) {
+ return info.newUnboundRange();
+ }
+ if (!right.isInteger(closedWorld.abstractValueDomain)) {
+ return info.newUnboundRange();
+ }
Range rightRange = ranges[right];
Range leftRange = ranges[left];
@@ -1073,7 +1090,7 @@
}
Range visit(HInstruction instruction) {
- if (!instruction.isInteger(closedWorld)) return null;
+ if (!instruction.isInteger(closedWorld.abstractValueDomain)) return null;
if (ranges[instruction] != null) return ranges[instruction];
return instruction.accept(this);
}
diff --git a/pkg/compiler/lib/src/types/abstract_value_domain.dart b/pkg/compiler/lib/src/types/abstract_value_domain.dart
index 287cd2e..3ce4ce1 100644
--- a/pkg/compiler/lib/src/types/abstract_value_domain.dart
+++ b/pkg/compiler/lib/src/types/abstract_value_domain.dart
@@ -4,166 +4,243 @@
library dart2js.abstract_value_domain;
-import '../constants/values.dart';
-import '../elements/resolution_types.dart';
-import '../elements/elements.dart';
-import '../universe/selector.dart' show Selector;
-
-enum AbstractBool { True, False, Maybe, Nothing }
+import '../constants/values.dart' show ConstantValue;
+import '../elements/entities.dart';
/// A value in an abstraction of runtime values.
abstract class AbstractValue {}
-/// A system that implements an abstraction over runtime values and provides
-/// access to interprocedural analysis results.
-// TODO(johnniwinther): Consider extracting the inference result access from
-// this interface.
+/// A system that implements an abstraction over runtime values.
abstract class AbstractValueDomain {
+ /// The [AbstractValue] that represents an unknown runtime value.
AbstractValue get dynamicType;
+
+ /// The [AbstractValue] that represents a non-null subtype of `Type` at
+ /// runtime.
AbstractValue get typeType;
+
+ /// The [AbstractValue] that represents a non-null subtype of `Function` at
+ /// runtime.
AbstractValue get functionType;
+
+ /// The [AbstractValue] that represents a non-null subtype of `bool` at
+ /// runtime.
AbstractValue get boolType;
+
+ /// The [AbstractValue] that represents a non-null subtype of `int` at
+ /// runtime.
AbstractValue get intType;
+
+ /// The [AbstractValue] that represents a non-null subtype of `double` at
+ /// runtime.
AbstractValue get doubleType;
+
+ /// The [AbstractValue] that represents a non-null subtype of `num` at
+ /// runtime.
AbstractValue get numType;
+
+ /// The [AbstractValue] that represents a non-null subtype of `String` at
+ /// runtime.
AbstractValue get stringType;
+
+ /// The [AbstractValue] that represents a non-null subtype of `List` at
+ /// runtime.
AbstractValue get listType;
+
+ /// The [AbstractValue] that represents a non-null subtype of `Map` at
+ /// runtime.
AbstractValue get mapType;
+
+ /// The [AbstractValue] that represents a non-null value at runtime.
AbstractValue get nonNullType;
+
+ /// The [AbstractValue] that represents the `null` at runtime.
AbstractValue get nullType;
- AbstractValue get extendableArrayType;
+
+ /// The [AbstractValue] that represents a non-null growable JavaScript array
+ /// at runtime.
+ AbstractValue get growableListType;
+
+ /// The [AbstractValue] that represents a non-null fixed size JavaScript array
+ /// at runtime.
AbstractValue get fixedArrayType;
- AbstractValue get arrayType;
+
+ /// The [AbstractValue] that represents a non-null 31-bit unsigned integer at
+ /// runtime.
AbstractValue get uint31Type;
+
+ /// The [AbstractValue] that represents a non-null 32-bit unsigned integer at
+ /// runtime.
AbstractValue get uint32Type;
- AbstractValue get uintType;
- AbstractValue get numStringBoolType;
+ /// The [AbstractValue] that represents a non-null unsigned integer at
+ /// runtime.
+ AbstractValue get positiveIntType;
- AbstractValue get fixedLengthType;
+ /// The [AbstractValue] that represents a non-null constant list literal at
+ /// runtime.
+ AbstractValue get constListType;
- AbstractValue get interceptorType;
+ /// The [AbstractValue] that represents a non-null constant map literal at
+ /// runtime.
+ AbstractValue get constMapType;
- AbstractValue get interceptedTypes;
+ /// The [AbstractValue] that represents the empty set of runtime values.
+ AbstractValue get emptyType;
- /// If true, [function] ignores its explicit receiver argument and will use
- /// its `this` value instead.
- bool methodIgnoresReceiverArgument(FunctionElement function);
+ /// Creates an [AbstractValue] for non-null exact instance of [cls].
+ AbstractValue createNonNullExact(ClassEntity cls);
- /// If true, the explicit receiver argument can be ignored when invoking
- /// [selector] on a value of [type].
- bool targetIgnoresReceiverArgument(AbstractValue type, Selector selector);
+ /// Creates an [AbstractValue] for non-null instance that implements [cls].
+ AbstractValue createNonNullSubtype(ClassEntity cls);
- Element locateSingleElement(AbstractValue mask, Selector selector);
+ AbstractValue createNullableSubtype(ClassEntity cls);
- ClassElement singleClass(AbstractValue mask);
+ /// Returns `true` if [value] is a native typed array or `null` at runtime.
+ bool isTypedArray(covariant AbstractValue value);
- bool needsNoSuchMethodHandling(AbstractValue mask, Selector selector);
+ /// Returns `true` if [value] could be a native typed array at runtime.
+ bool couldBeTypedArray(covariant AbstractValue value);
- AbstractValue getReceiverType(MethodElement method);
+ /// Returns the version of the abstract [value] that excludes `null`.
+ AbstractValue excludeNull(covariant AbstractValue value);
- AbstractValue getParameterType(ParameterElement parameter);
+ /// Returns the version of the abstract [value] that includes `null`.
+ AbstractValue includeNull(covariant AbstractValue value);
- AbstractValue getReturnType(FunctionElement function);
+ /// Returns `true` if [value] contains instances of [cls] at runtime.
+ bool containsType(covariant AbstractValue value, ClassEntity cls);
- AbstractValue getInvokeReturnType(Selector selector, AbstractValue mask);
+ /// Returns `true` if [value] only contains subtypes of [cls] or `null` at
+ /// runtime.
+ bool containsOnlyType(covariant AbstractValue value, ClassEntity cls);
- AbstractValue getFieldType(FieldElement field);
+ /// Returns `true` if [value] is an instance of [cls] or `null` at runtime.
+ bool isInstanceOf(covariant AbstractValue value, ClassEntity cls);
- AbstractValue join(AbstractValue a, AbstractValue b);
+ /// Returns `true` if [value] is empty set of runtime values.
+ bool isEmpty(covariant AbstractValue value);
- AbstractValue intersection(AbstractValue a, AbstractValue b);
+ /// Returns `true` if [value] is an exact class or `null` at runtime.
+ bool isExact(covariant AbstractValue value);
- AbstractValue getTypeOf(ConstantValue constant);
+ /// Returns `true` if [value] a known primitive JavaScript value at runtime.
+ bool isValue(covariant AbstractValue value);
- /// Returns the constant value if the [AbstractValue] represents a single
- /// constant value. Returns `null` if [value] is not a constant.
- ConstantValue getConstantOf(AbstractValue value);
+ /// Returns `true` if [value] can be `null` at runtime.
+ bool canBeNull(covariant AbstractValue value);
- AbstractValue nonNullExact(ClassElement element);
+ /// Returns `true` if [value] is `null` at runtime.
+ bool isNull(covariant AbstractValue value);
- AbstractValue nonNullSubclass(ClassElement element);
+ /// Returns `true` if [value] could be a JavaScript bool, number, string,
+ /// array or `null` at runtime.
+ bool canBePrimitive(covariant AbstractValue value);
- AbstractValue nonNullSubtype(ClassElement element);
+ /// Returns `true` if [value] could be a JavaScript number at runtime.
+ bool canBePrimitiveNumber(covariant AbstractValue value);
- bool isDefinitelyBool(AbstractValue t, {bool allowNull: false});
+ /// Returns `true` if [value] could be a JavaScript bool at runtime.
+ bool canBePrimitiveBoolean(covariant AbstractValue value);
- bool isDefinitelyNum(AbstractValue t, {bool allowNull: false});
+ /// Returns `true` if [value] could be a JavaScript array at runtime.
+ bool canBePrimitiveArray(covariant AbstractValue value);
- bool isDefinitelyString(AbstractValue t, {bool allowNull: false});
+ /// Returns `true` if [value] is a JavaScript string, array, native HTML list
+ /// or `null` at runtime.
+ bool isIndexablePrimitive(covariant AbstractValue value);
- bool isDefinitelyNumStringBool(AbstractValue t, {bool allowNull: false});
+ /// Returns `true` if [value] is a fixed-size or constant JavaScript array or
+ /// `null` at
+ /// runtime.
+ bool isFixedArray(covariant AbstractValue value);
- bool isDefinitelyNotNumStringBool(AbstractValue t);
+ /// Returns `true` if [value] is a growable JavaScript array or `null` at
+ /// runtime.
+ bool isExtendableArray(covariant AbstractValue value);
- /// True if all values of [t] are either integers or not numbers at all.
- ///
- /// This does not imply that the value is an integer, since most other values
- /// such as null are also not a non-integer double.
- bool isDefinitelyNotNonIntegerDouble(AbstractValue t);
+ /// Returns `true` if [value] is a mutable JavaScript array or `null` at
+ /// runtime.
+ bool isMutableArray(covariant AbstractValue value);
- bool isDefinitelyNonNegativeInt(AbstractValue t, {bool allowNull: false});
+ /// Returns `true` if [value] is a mutable JavaScript array, native HTML list
+ /// or `null` at runtime.
+ bool isMutableIndexable(covariant AbstractValue value);
- bool isDefinitelyInt(AbstractValue t, {bool allowNull: false});
+ /// Returns `true` if [value] is a JavaScript array or `null` at runtime.
+ bool isArray(covariant AbstractValue value);
- bool isDefinitelyUint31(AbstractValue t, {bool allowNull: false});
+ /// Returns `true` if [value] could be a JavaScript string at runtime.
+ bool canBePrimitiveString(covariant AbstractValue value);
- bool isDefinitelyUint32(AbstractValue t, {bool allowNull: false});
+ /// Returns `true` if [value] is a non-null integer value at runtime.
+ bool isInteger(covariant AbstractValue value);
- bool isDefinitelyUint(AbstractValue t, {bool allowNull: false});
+ /// Returns `true` if [value] is a non-null 32 bit unsigned integer value at
+ /// runtime.
+ bool isUInt32(covariant AbstractValue value);
- bool isDefinitelyArray(AbstractValue t, {bool allowNull: false});
+ /// Returns `true` if [value] is a non-null 31 bit unsigned integer value at
+ /// runtime.
+ bool isUInt31(covariant AbstractValue value);
- bool isDefinitelyMutableArray(AbstractValue t, {bool allowNull: false});
+ /// Returns `true` if [value] is a non-null unsigned integer value at runtime.
+ bool isPositiveInteger(covariant AbstractValue value);
- bool isDefinitelyFixedArray(AbstractValue t, {bool allowNull: false});
+ /// Returns `true` if [value] is an unsigned integer value or `null` at
+ /// runtime.
+ bool isPositiveIntegerOrNull(covariant AbstractValue value);
- bool isDefinitelyExtendableArray(AbstractValue t, {bool allowNull: false});
+ /// Returns `true` if [value] is an integer value or `null` at runtime.
+ bool isIntegerOrNull(covariant AbstractValue value);
- bool isDefinitelyIndexable(AbstractValue t, {bool allowNull: false});
+ /// Returns `true` if [value] is a non-null JavaScript number at runtime.
+ bool isNumber(covariant AbstractValue value);
- bool isDefinitelyMutableIndexable(AbstractValue t, {bool allowNull: false});
+ /// Returns `true` if [value] is a JavaScript number or `null` at runtime.
+ bool isNumberOrNull(covariant AbstractValue value);
- bool isDefinitelyFixedLengthIndexable(AbstractValue t,
- {bool allowNull: false});
+ /// Returns `true` if [value] is a non-integer number at runtime.
+ bool isDouble(covariant AbstractValue value);
- bool isDefinitelyIntercepted(AbstractValue t, {bool allowNull});
+ /// Returns `true` if [value] is a non-integer number or `null` at runtime.
+ bool isDoubleOrNull(covariant AbstractValue value);
- bool isDefinitelySelfInterceptor(AbstractValue t, {bool allowNull: false});
+ /// Returns `true` if [value] is a JavaScript bool at runtime.
+ bool isBoolean(covariant AbstractValue value);
- /// Given a class from the interceptor hierarchy, returns an [AbstractValue]
- /// matching all values with that interceptor (or a subtype thereof).
- AbstractValue getInterceptorSubtypes(ClassElement class_);
+ /// Returns `true` if [value] is a JavaScript bool or `null` at runtime.
+ bool isBooleanOrNull(covariant AbstractValue value);
- bool areDisjoint(AbstractValue leftType, AbstractValue rightType);
+ /// Returns `true` if [value] is a JavaScript string at runtime.
+ bool isString(covariant AbstractValue value);
- bool isMorePreciseOrEqual(AbstractValue t1, AbstractValue t2);
+ /// Returns `true` if [value] is a JavaScript string or `null` at runtime.
+ bool isStringOrNull(covariant AbstractValue value);
- AbstractBool isSubtypeOf(AbstractValue value, ResolutionDartType type,
- {bool allowNull});
+ /// Returns `true` if [value] a non-null JavaScript primitive or `null`?
+ // TODO(johnniwinther): This should probably not return true on `null`,
+ // investigate.
+ bool isPrimitive(covariant AbstractValue value);
- /// Returns whether [value] is one of the falsy values: false, 0, -0, NaN,
- /// the empty string, or null.
- AbstractBool boolify(AbstractValue value);
+ /// Returns `true` if [value] a JavaScript primitive, possible `null`.
+ bool isPrimitiveOrNull(covariant AbstractValue value);
- AbstractBool strictBoolify(AbstractValue type);
+ /// Returns [AbstractValue] for the runtime values contained in either [a] or
+ /// [b].
+ AbstractValue union(covariant AbstractValue a, covariant AbstractValue b);
- /// Create a type mask containing at least all subtypes of [type].
- AbstractValue subtypesOf(ResolutionDartType type);
+ /// Returns [AbstractValue] for the runtime values that [a] and [b] have in
+ /// common.
+ AbstractValue intersection(
+ covariant AbstractValue a, covariant AbstractValue b);
- /// Returns a subset of [receiver] containing at least the types
- /// that can respond to [selector] without throwing.
- AbstractValue receiverTypeFor(Selector selector, AbstractValue receiver);
+ /// Returns `true` if [a] and [b] have no runtime values in common.
+ bool areDisjoint(covariant AbstractValue a, covariant AbstractValue b);
- /// The result of an index operation on [value], or the dynamic type if
- /// unknown.
- AbstractValue elementTypeOfIndexable(AbstractValue value);
+ /// Returns `true` if [a] contains all non-null runtime values.
+ bool containsAll(covariant AbstractValue a);
- /// The length property of [value], or `null` if unknown.
- int getContainerLength(AbstractValue value);
-
- /// Returns the type of the entry of [container] at a given index.
- /// Returns `null` if unknown.
- AbstractValue indexWithConstant(
- AbstractValue container, ConstantValue indexValue);
+ /// Computes the [AbstractValue] corresponding to the constant [value].
+ AbstractValue computeAbstractValueForConstant(ConstantValue value);
}
diff --git a/pkg/compiler/lib/src/types/constants.dart b/pkg/compiler/lib/src/types/constants.dart
index 5d2b2af..58a51d7 100644
--- a/pkg/compiler/lib/src/types/constants.dart
+++ b/pkg/compiler/lib/src/types/constants.dart
@@ -23,7 +23,7 @@
TypeMask visitConstructed(
ConstructedConstantValue constant, ClosedWorld closedWorld) {
if (closedWorld.interceptorData.isInterceptedClass(constant.type.element)) {
- return closedWorld.commonMasks.nonNullType;
+ return closedWorld.abstractValueDomain.nonNullType;
}
return new TypeMask.nonNullExact(constant.type.element, closedWorld);
}
@@ -45,13 +45,13 @@
// We have to recognize double constants that are 'is int'.
if (closedWorld.constantSystem.isInt(constant)) {
if (constant.isMinusZero) {
- return closedWorld.commonMasks.uint31Type;
+ return closedWorld.abstractValueDomain.uint31Type;
} else {
assert(constant.isPositiveInfinity || constant.isNegativeInfinity);
- return closedWorld.commonMasks.intType;
+ return closedWorld.abstractValueDomain.intType;
}
}
- return closedWorld.commonMasks.doubleType;
+ return closedWorld.abstractValueDomain.doubleType;
}
@override
@@ -63,9 +63,9 @@
case SyntheticConstantKind.EMPTY_VALUE:
return constant.payload;
case SyntheticConstantKind.TYPEVARIABLE_REFERENCE:
- return closedWorld.commonMasks.intType;
+ return closedWorld.abstractValueDomain.intType;
case SyntheticConstantKind.NAME:
- return closedWorld.commonMasks.stringType;
+ return closedWorld.abstractValueDomain.stringType;
default:
throw failedAt(CURRENT_ELEMENT_SPANNABLE,
"Unexpected DummyConstantKind: ${constant.toStructuredText()}.");
@@ -74,63 +74,64 @@
@override
TypeMask visitBool(BoolConstantValue constant, ClosedWorld closedWorld) {
- return closedWorld.commonMasks.boolType;
+ return closedWorld.abstractValueDomain.boolType;
}
@override
TypeMask visitFunction(
FunctionConstantValue constant, ClosedWorld closedWorld) {
- return closedWorld.commonMasks.functionType;
+ return closedWorld.abstractValueDomain.functionType;
}
@override
TypeMask visitInstantiation(
InstantiationConstantValue constant, ClosedWorld closedWorld) {
- return closedWorld.commonMasks.functionType;
+ return closedWorld.abstractValueDomain.functionType;
}
@override
TypeMask visitInt(IntConstantValue constant, ClosedWorld closedWorld) {
- if (constant.isUInt31()) return closedWorld.commonMasks.uint31Type;
- if (constant.isUInt32()) return closedWorld.commonMasks.uint32Type;
- if (constant.isPositive()) return closedWorld.commonMasks.positiveIntType;
- return closedWorld.commonMasks.intType;
+ if (constant.isUInt31()) return closedWorld.abstractValueDomain.uint31Type;
+ if (constant.isUInt32()) return closedWorld.abstractValueDomain.uint32Type;
+ if (constant.isPositive())
+ return closedWorld.abstractValueDomain.positiveIntType;
+ return closedWorld.abstractValueDomain.intType;
}
@override
TypeMask visitInterceptor(
InterceptorConstantValue constant, ClosedWorld closedWorld) {
- return closedWorld.commonMasks.nonNullType;
+ return closedWorld.abstractValueDomain.nonNullType;
}
@override
TypeMask visitList(ListConstantValue constant, ClosedWorld closedWorld) {
- return closedWorld.commonMasks.constListType;
+ return closedWorld.abstractValueDomain.constListType;
}
@override
TypeMask visitMap(MapConstantValue constant, ClosedWorld closedWorld) {
- return closedWorld.commonMasks.constMapType;
+ return closedWorld.abstractValueDomain.constMapType;
}
@override
TypeMask visitNull(NullConstantValue constant, ClosedWorld closedWorld) {
- return closedWorld.commonMasks.nullType;
+ return closedWorld.abstractValueDomain.nullType;
}
@override
TypeMask visitNonConstant(
NonConstantValue constant, ClosedWorld closedWorld) {
- return closedWorld.commonMasks.nullType;
+ return closedWorld.abstractValueDomain.nullType;
}
@override
TypeMask visitString(StringConstantValue constant, ClosedWorld closedWorld) {
- return closedWorld.commonMasks.stringType;
+ return closedWorld.abstractValueDomain.stringType;
}
@override
TypeMask visitType(TypeConstantValue constant, ClosedWorld closedWorld) {
- return closedWorld.commonMasks.typeType;
+ return closedWorld.abstractValueDomain.typeType;
}
}
diff --git a/pkg/compiler/lib/src/types/masks.dart b/pkg/compiler/lib/src/types/masks.dart
index 4960ebc..24203e1 100644
--- a/pkg/compiler/lib/src/types/masks.dart
+++ b/pkg/compiler/lib/src/types/masks.dart
@@ -6,7 +6,7 @@
import '../common.dart';
import '../common_elements.dart' show CommonElements;
-import '../constants/values.dart' show PrimitiveConstantValue;
+import '../constants/values.dart' show ConstantValue, PrimitiveConstantValue;
import '../elements/entities.dart';
import '../inferrer/type_graph_inferrer.dart' show TypeGraphInferrer;
import '../universe/selector.dart' show Selector;
@@ -17,7 +17,8 @@
SelectorConstraintsStrategy;
import '../util/util.dart';
import '../world.dart' show ClassQuery, ClosedWorld;
-import 'abstract_value_domain.dart' show AbstractValue;
+import 'abstract_value_domain.dart';
+import 'constants.dart';
part 'container_type_mask.dart';
part 'dictionary_type_mask.dart';
@@ -28,14 +29,14 @@
part 'union_type_mask.dart';
part 'value_type_mask.dart';
-class CommonMasks {
+class CommonMasks implements AbstractValueDomain {
// TODO(sigmund): once we split out the backend common elements, depend
// directly on those instead.
- final ClosedWorld closedWorld;
+ final ClosedWorld _closedWorld;
- CommonMasks(this.closedWorld);
+ CommonMasks(this._closedWorld);
- CommonElements get commonElements => closedWorld.commonElements;
+ CommonElements get commonElements => _closedWorld.commonElements;
TypeMask _dynamicType;
TypeMask _nonNullType;
@@ -63,139 +64,315 @@
TypeMask _readableArrayType;
TypeMask _mutableArrayType;
TypeMask _fixedArrayType;
- TypeMask _extendableArrayType;
TypeMask _unmodifiableArrayType;
TypeMask _interceptorType;
TypeMask get dynamicType => _dynamicType ??= new TypeMask.subclass(
- closedWorld.commonElements.objectClass, closedWorld);
+ _closedWorld.commonElements.objectClass, _closedWorld);
TypeMask get nonNullType => _nonNullType ??= new TypeMask.nonNullSubclass(
- closedWorld.commonElements.objectClass, closedWorld);
+ _closedWorld.commonElements.objectClass, _closedWorld);
TypeMask get intType => _intType ??=
- new TypeMask.nonNullSubclass(commonElements.jsIntClass, closedWorld);
+ new TypeMask.nonNullSubclass(commonElements.jsIntClass, _closedWorld);
TypeMask get uint32Type => _uint32Type ??=
- new TypeMask.nonNullSubclass(commonElements.jsUInt32Class, closedWorld);
+ new TypeMask.nonNullSubclass(commonElements.jsUInt32Class, _closedWorld);
TypeMask get uint31Type => _uint31Type ??=
- new TypeMask.nonNullExact(commonElements.jsUInt31Class, closedWorld);
+ new TypeMask.nonNullExact(commonElements.jsUInt31Class, _closedWorld);
TypeMask get positiveIntType =>
_positiveIntType ??= new TypeMask.nonNullSubclass(
- commonElements.jsPositiveIntClass, closedWorld);
+ commonElements.jsPositiveIntClass, _closedWorld);
TypeMask get doubleType => _doubleType ??=
- new TypeMask.nonNullExact(commonElements.jsDoubleClass, closedWorld);
+ new TypeMask.nonNullExact(commonElements.jsDoubleClass, _closedWorld);
TypeMask get numType => _numType ??=
- new TypeMask.nonNullSubclass(commonElements.jsNumberClass, closedWorld);
+ new TypeMask.nonNullSubclass(commonElements.jsNumberClass, _closedWorld);
TypeMask get boolType => _boolType ??=
- new TypeMask.nonNullExact(commonElements.jsBoolClass, closedWorld);
+ new TypeMask.nonNullExact(commonElements.jsBoolClass, _closedWorld);
TypeMask get functionType => _functionType ??=
- new TypeMask.nonNullSubtype(commonElements.functionClass, closedWorld);
+ new TypeMask.nonNullSubtype(commonElements.functionClass, _closedWorld);
TypeMask get listType => _listType ??=
- new TypeMask.nonNullExact(commonElements.jsArrayClass, closedWorld);
+ new TypeMask.nonNullExact(commonElements.jsArrayClass, _closedWorld);
TypeMask get constListType => _constListType ??= new TypeMask.nonNullExact(
- commonElements.jsUnmodifiableArrayClass, closedWorld);
+ commonElements.jsUnmodifiableArrayClass, _closedWorld);
TypeMask get fixedListType => _fixedListType ??=
- new TypeMask.nonNullExact(commonElements.jsFixedArrayClass, closedWorld);
+ new TypeMask.nonNullExact(commonElements.jsFixedArrayClass, _closedWorld);
TypeMask get growableListType =>
_growableListType ??= new TypeMask.nonNullExact(
- commonElements.jsExtendableArrayClass, closedWorld);
+ commonElements.jsExtendableArrayClass, _closedWorld);
TypeMask get mapType => _mapType ??=
- new TypeMask.nonNullSubtype(commonElements.mapLiteralClass, closedWorld);
+ new TypeMask.nonNullSubtype(commonElements.mapLiteralClass, _closedWorld);
TypeMask get constMapType => _constMapType ??= new TypeMask.nonNullSubtype(
- commonElements.constMapLiteralClass, closedWorld);
+ commonElements.constMapLiteralClass, _closedWorld);
TypeMask get stringType => _stringType ??=
- new TypeMask.nonNullExact(commonElements.jsStringClass, closedWorld);
+ new TypeMask.nonNullExact(commonElements.jsStringClass, _closedWorld);
TypeMask get typeType => _typeType ??=
- new TypeMask.nonNullExact(commonElements.typeLiteralClass, closedWorld);
+ new TypeMask.nonNullExact(commonElements.typeLiteralClass, _closedWorld);
TypeMask get syncStarIterableType => _syncStarIterableType ??=
- new TypeMask.nonNullExact(commonElements.syncStarIterable, closedWorld);
+ new TypeMask.nonNullExact(commonElements.syncStarIterable, _closedWorld);
TypeMask get asyncFutureType =>
_asyncFutureType ??= new TypeMask.nonNullExact(
- commonElements.futureImplementation, closedWorld);
+ commonElements.futureImplementation, _closedWorld);
TypeMask get asyncStarStreamType => _asyncStarStreamType ??=
- new TypeMask.nonNullExact(commonElements.controllerStream, closedWorld);
+ new TypeMask.nonNullExact(commonElements.controllerStream, _closedWorld);
// TODO(johnniwinther): Assert that the null type has been resolved.
TypeMask get nullType => _nullType ??= const TypeMask.empty();
TypeMask get emptyType => const TypeMask.nonNullEmpty();
- TypeMask get indexablePrimitiveType => _indexablePrimitiveType ??=
- new TypeMask.nonNullSubtype(commonElements.jsIndexableClass, closedWorld);
+ TypeMask get indexablePrimitiveType =>
+ _indexablePrimitiveType ??= new TypeMask.nonNullSubtype(
+ commonElements.jsIndexableClass, _closedWorld);
TypeMask get readableArrayType => _readableArrayType ??=
- new TypeMask.nonNullSubclass(commonElements.jsArrayClass, closedWorld);
+ new TypeMask.nonNullSubclass(commonElements.jsArrayClass, _closedWorld);
TypeMask get mutableArrayType =>
_mutableArrayType ??= new TypeMask.nonNullSubclass(
- commonElements.jsMutableArrayClass, closedWorld);
+ commonElements.jsMutableArrayClass, _closedWorld);
TypeMask get fixedArrayType => _fixedArrayType ??=
- new TypeMask.nonNullExact(commonElements.jsFixedArrayClass, closedWorld);
-
- TypeMask get extendableArrayType =>
- _extendableArrayType ??= new TypeMask.nonNullExact(
- commonElements.jsExtendableArrayClass, closedWorld);
+ new TypeMask.nonNullExact(commonElements.jsFixedArrayClass, _closedWorld);
TypeMask get unmodifiableArrayType =>
_unmodifiableArrayType ??= new TypeMask.nonNullExact(
- commonElements.jsUnmodifiableArrayClass, closedWorld);
+ commonElements.jsUnmodifiableArrayClass, _closedWorld);
TypeMask get interceptorType =>
_interceptorType ??= new TypeMask.nonNullSubclass(
- commonElements.jsInterceptorClass, closedWorld);
+ commonElements.jsInterceptorClass, _closedWorld);
bool isTypedArray(TypeMask mask) {
- // Just checking for [:TypedData:] is not sufficient, as it is an
- // abstract class any user-defined class can implement. So we also
- // check for the interface [JavaScriptIndexingBehavior].
- ClassEntity typedDataClass = closedWorld.commonElements.typedDataClass;
+ // Just checking for `TypedData` is not sufficient, as it is an abstract
+ // class any user-defined class can implement. So we also check for the
+ // interface `JavaScriptIndexingBehavior`.
+ ClassEntity typedDataClass = _closedWorld.commonElements.typedDataClass;
return typedDataClass != null &&
- closedWorld.isInstantiated(typedDataClass) &&
- mask.satisfies(typedDataClass, closedWorld) &&
- mask.satisfies(closedWorld.commonElements.jsIndexingBehaviorInterface,
- closedWorld);
+ _closedWorld.isInstantiated(typedDataClass) &&
+ mask.satisfies(typedDataClass, _closedWorld) &&
+ mask.satisfies(_closedWorld.commonElements.jsIndexingBehaviorInterface,
+ _closedWorld);
}
bool couldBeTypedArray(TypeMask mask) {
bool intersects(TypeMask type1, TypeMask type2) =>
- !type1.intersection(type2, closedWorld).isEmpty;
+ !type1.intersection(type2, _closedWorld).isEmpty;
// TODO(herhut): Maybe cache the TypeMask for typedDataClass and
// jsIndexingBehaviourInterface.
- ClassEntity typedDataClass = closedWorld.commonElements.typedDataClass;
+ ClassEntity typedDataClass = _closedWorld.commonElements.typedDataClass;
return typedDataClass != null &&
- closedWorld.isInstantiated(typedDataClass) &&
- intersects(mask, new TypeMask.subtype(typedDataClass, closedWorld)) &&
+ _closedWorld.isInstantiated(typedDataClass) &&
+ intersects(mask, new TypeMask.subtype(typedDataClass, _closedWorld)) &&
intersects(
mask,
new TypeMask.subtype(
- closedWorld.commonElements.jsIndexingBehaviorInterface,
- closedWorld));
+ _closedWorld.commonElements.jsIndexingBehaviorInterface,
+ _closedWorld));
}
TypeMask createNonNullExact(ClassEntity cls) {
- return new TypeMask.nonNullExact(cls, closedWorld);
+ return new TypeMask.nonNullExact(cls, _closedWorld);
}
TypeMask createNonNullSubtype(ClassEntity cls) {
- return new TypeMask.nonNullSubtype(cls, closedWorld);
+ return new TypeMask.nonNullSubtype(cls, _closedWorld);
+ }
+
+ TypeMask createNullableSubtype(ClassEntity cls) {
+ return new TypeMask.subtype(cls, _closedWorld);
+ }
+
+ TypeMask excludeNull(TypeMask mask) => mask.nonNullable();
+
+ @override
+ TypeMask includeNull(TypeMask mask) => mask.nullable();
+
+ bool containsType(TypeMask typeMask, ClassEntity cls) {
+ return _closedWorld.isInstantiated(cls) &&
+ typeMask.contains(cls, _closedWorld);
+ }
+
+ bool containsOnlyType(TypeMask typeMask, ClassEntity cls) {
+ return _closedWorld.isInstantiated(cls) && typeMask.containsOnly(cls);
+ }
+
+ bool isInstanceOf(TypeMask typeMask, ClassEntity cls) {
+ return _closedWorld.isImplemented(cls) &&
+ typeMask.satisfies(cls, _closedWorld);
+ }
+
+ bool isEmpty(TypeMask value) => value.isEmpty;
+
+ bool isExact(TypeMask value) => value.isExact || isNull(value);
+
+ bool isValue(TypeMask value) => value.isValue;
+
+ bool canBeNull(TypeMask value) => value.isNullable;
+
+ bool isNull(TypeMask value) => value.isNull;
+
+ bool canBePrimitive(TypeMask value) {
+ return canBePrimitiveNumber(value) ||
+ canBePrimitiveArray(value) ||
+ canBePrimitiveBoolean(value) ||
+ canBePrimitiveString(value) ||
+ isNull(value);
+ }
+
+ bool canBePrimitiveNumber(TypeMask value) {
+ // TODO(sra): It should be possible to test only jsDoubleClass and
+ // jsUInt31Class, since all others are superclasses of these two.
+ return containsType(value, commonElements.jsNumberClass) ||
+ containsType(value, commonElements.jsIntClass) ||
+ containsType(value, commonElements.jsPositiveIntClass) ||
+ containsType(value, commonElements.jsUInt32Class) ||
+ containsType(value, commonElements.jsUInt31Class) ||
+ containsType(value, commonElements.jsDoubleClass);
+ }
+
+ bool canBePrimitiveBoolean(TypeMask value) {
+ return containsType(value, commonElements.jsBoolClass);
+ }
+
+ bool canBePrimitiveArray(TypeMask value) {
+ return containsType(value, commonElements.jsArrayClass) ||
+ containsType(value, commonElements.jsFixedArrayClass) ||
+ containsType(value, commonElements.jsExtendableArrayClass) ||
+ containsType(value, commonElements.jsUnmodifiableArrayClass);
+ }
+
+ bool isIndexablePrimitive(TypeMask value) {
+ return value.containsOnlyString(_closedWorld) ||
+ isInstanceOf(value, commonElements.jsIndexableClass);
+ }
+
+ bool isFixedArray(TypeMask value) {
+ // TODO(sra): Recognize the union of these types as well.
+ return containsOnlyType(value, commonElements.jsFixedArrayClass) ||
+ containsOnlyType(value, commonElements.jsUnmodifiableArrayClass);
+ }
+
+ bool isExtendableArray(TypeMask value) {
+ return containsOnlyType(value, commonElements.jsExtendableArrayClass);
+ }
+
+ bool isMutableArray(TypeMask value) {
+ return isInstanceOf(value, commonElements.jsMutableArrayClass);
+ }
+
+ bool isReadableArray(TypeMask value) {
+ return isInstanceOf(value, commonElements.jsArrayClass);
+ }
+
+ bool isMutableIndexable(TypeMask value) {
+ return isInstanceOf(value, commonElements.jsMutableIndexableClass);
+ }
+
+ bool isArray(TypeMask value) => isReadableArray(value);
+
+ bool canBePrimitiveString(TypeMask value) {
+ return containsType(value, commonElements.jsStringClass);
+ }
+
+ bool isInteger(TypeMask value) {
+ return value.containsOnlyInt(_closedWorld) && !value.isNullable;
+ }
+
+ bool isUInt32(TypeMask value) {
+ return !value.isNullable &&
+ isInstanceOf(value, commonElements.jsUInt32Class);
+ }
+
+ bool isUInt31(TypeMask value) {
+ return !value.isNullable &&
+ isInstanceOf(value, commonElements.jsUInt31Class);
+ }
+
+ bool isPositiveInteger(TypeMask value) {
+ return !value.isNullable &&
+ isInstanceOf(value, commonElements.jsPositiveIntClass);
+ }
+
+ bool isPositiveIntegerOrNull(TypeMask value) {
+ return isInstanceOf(value, commonElements.jsPositiveIntClass);
+ }
+
+ bool isIntegerOrNull(TypeMask value) {
+ return value.containsOnlyInt(_closedWorld);
+ }
+
+ bool isNumber(TypeMask value) {
+ return value.containsOnlyNum(_closedWorld) && !value.isNullable;
+ }
+
+ bool isNumberOrNull(TypeMask value) {
+ return value.containsOnlyNum(_closedWorld);
+ }
+
+ bool isDouble(TypeMask value) {
+ return value.containsOnlyDouble(_closedWorld) && !value.isNullable;
+ }
+
+ bool isDoubleOrNull(TypeMask value) {
+ return value.containsOnlyDouble(_closedWorld);
+ }
+
+ bool isBoolean(TypeMask value) {
+ return value.containsOnlyBool(_closedWorld) && !value.isNullable;
+ }
+
+ bool isBooleanOrNull(TypeMask value) {
+ return value.containsOnlyBool(_closedWorld);
+ }
+
+ bool isString(TypeMask value) {
+ return value.containsOnlyString(_closedWorld) && !value.isNullable;
+ }
+
+ bool isStringOrNull(TypeMask value) {
+ return value.containsOnlyString(_closedWorld);
+ }
+
+ bool isPrimitive(TypeMask value) {
+ return (isPrimitiveOrNull(value) && !value.isNullable) || isNull(value);
+ }
+
+ bool isPrimitiveOrNull(TypeMask value) {
+ return isIndexablePrimitive(value) ||
+ isNumberOrNull(value) ||
+ isBooleanOrNull(value) ||
+ isNull(value);
+ }
+
+ TypeMask union(TypeMask a, TypeMask b) => a.union(b, _closedWorld);
+
+ TypeMask intersection(TypeMask a, TypeMask b) =>
+ a.intersection(b, _closedWorld);
+
+ bool areDisjoint(TypeMask a, TypeMask b) => a.isDisjoint(b, _closedWorld);
+
+ bool containsAll(TypeMask a) => a.containsAll(_closedWorld);
+
+ @override
+ AbstractValue computeAbstractValueForConstant(ConstantValue value) {
+ return computeTypeMask(_closedWorld, value);
}
}
diff --git a/pkg/compiler/lib/src/types/type_mask.dart b/pkg/compiler/lib/src/types/type_mask.dart
index bf79fb9..50bc096 100644
--- a/pkg/compiler/lib/src/types/type_mask.dart
+++ b/pkg/compiler/lib/src/types/type_mask.dart
@@ -334,9 +334,7 @@
*/
bool contains(ClassEntity cls, ClosedWorld closedWorld);
- /**
- * Returns whether or not this type mask contains all types.
- */
+ /// Returns whether or not this type mask contains all types.
bool containsAll(ClosedWorld closedWorld);
/// Returns the [ClassEntity] if this type represents a single class,
diff --git a/pkg/compiler/lib/src/types/types.dart b/pkg/compiler/lib/src/types/types.dart
index d5554c6..963a622 100644
--- a/pkg/compiler/lib/src/types/types.dart
+++ b/pkg/compiler/lib/src/types/types.dart
@@ -293,7 +293,7 @@
parameter, () => createParameterResult(_inferrer, parameter));
}
- TypeMask get dynamicType => closedWorld.commonMasks.dynamicType;
+ TypeMask get dynamicType => closedWorld.abstractValueDomain.dynamicType;
/// Returns the type of a [selector] when applied to a receiver with the given
/// type [mask].
diff --git a/pkg/compiler/lib/src/world.dart b/pkg/compiler/lib/src/world.dart
index f2d8b34..c781eb0 100644
--- a/pkg/compiler/lib/src/world.dart
+++ b/pkg/compiler/lib/src/world.dart
@@ -28,6 +28,7 @@
show RuntimeTypesNeed, RuntimeTypesNeedBuilder;
import 'ordered_typeset.dart';
import 'options.dart';
+import 'types/abstract_value_domain.dart';
import 'types/masks.dart' show CommonMasks, FlatTypeMask, TypeMask;
import 'universe/class_set.dart';
import 'universe/function_set.dart' show FunctionSet;
@@ -60,7 +61,8 @@
CommonElements get commonElements;
- CommonMasks get commonMasks;
+ /// Returns the [AbstractValueDomain] used in the global type inference.
+ AbstractValueDomain get abstractValueDomain;
ConstantSystem get constantSystem;
@@ -526,7 +528,7 @@
final List<Map<ClassEntity, TypeMask>> _canonicalizedTypeMasks =
new List<Map<ClassEntity, TypeMask>>.filled(8, null);
- CommonMasks get commonMasks {
+ CommonMasks get abstractValueDomain {
return _commonMasks;
}
@@ -1069,13 +1071,13 @@
bool includesClosureCall(Selector selector, TypeMask mask) {
return selector.name == Identifiers.call &&
(mask == null ||
- mask.containsMask(commonMasks.functionType, closedWorld));
+ mask.containsMask(abstractValueDomain.functionType, closedWorld));
}
TypeMask computeReceiverType(Selector selector, TypeMask mask) {
_ensureFunctionSet();
if (includesClosureCall(selector, mask)) {
- return commonMasks.dynamicType;
+ return abstractValueDomain.dynamicType;
}
return _allFunctions.receiverType(selector, mask, this);
}
@@ -1101,7 +1103,7 @@
if (includesClosureCall(selector, mask)) {
return null;
}
- mask ??= commonMasks.dynamicType;
+ mask ??= abstractValueDomain.dynamicType;
return mask.locateSingleMember(selector, this);
}
@@ -1111,7 +1113,7 @@
canReachAll = backendUsage.isInvokeOnUsed &&
mask.needsNoSuchMethodHandling(selector, this);
}
- return canReachAll ? commonMasks.dynamicType : mask;
+ return canReachAll ? abstractValueDomain.dynamicType : mask;
}
bool fieldNeverChanges(MemberEntity element) {
diff --git a/pkg/compiler/pubspec.yaml b/pkg/compiler/pubspec.yaml
index 3530a9f..3cf04df 100644
--- a/pkg/compiler/pubspec.yaml
+++ b/pkg/compiler/pubspec.yaml
@@ -19,8 +19,6 @@
path: ../../third_party/pkg/dart2js_info
front_end:
path: ../front_end
- path:
- path: ../../third_party/pkg/path
dependency_overrides:
front_end:
path: ../front_end
diff --git a/pkg/compiler/testing.json b/pkg/compiler/testing.json
index e2ef599..d5fb717 100644
--- a/pkg/compiler/testing.json
+++ b/pkg/compiler/testing.json
@@ -14,9 +14,7 @@
],
"exclude": [
- "^tests/compiler/dart2js/inference/data/super_invoke\\.dart",
- "^tests/compiler/dart2js/old_frontend/data/.*",
- "^tests/compiler/dart2js/path with spaces/.*"
+ "^tests/compiler/dart2js/inference/data/super_invoke\\.dart"
]
}
}
diff --git a/pkg/compiler/testing_dart.json b/pkg/compiler/testing_dart.json
index f36c8ad..1b68d8b 100644
--- a/pkg/compiler/testing_dart.json
+++ b/pkg/compiler/testing_dart.json
@@ -38,23 +38,12 @@
"^tests/compiler/dart2js/kernel/closed_world_test\\.dart",
"^tests/compiler/dart2js/kernel/visitor_test\\.dart",
"^tests/compiler/dart2js/memory_compiler\\.dart",
- "^tests/compiler/dart2js/mirrors/data/mirrors_helper\\.dart",
- "^tests/compiler/dart2js/mirrors/deferred_mirrors_test\\.dart",
- "^tests/compiler/dart2js/mirrors/mirrors_used_test\\.dart",
"^tests/compiler/dart2js/mixin_typevariable_test\\.dart",
"^tests/compiler/dart2js/model/constant_expression_evaluate_test\\.dart",
"^tests/compiler/dart2js/model/constant_expression_test\\.dart",
"^tests/compiler/dart2js/needs_no_such_method_test\\.dart",
"^tests/compiler/dart2js/no_such_method_enabled_test\\.dart",
"^tests/compiler/dart2js/output_collector\\.dart",
- "^tests/compiler/dart2js/old_frontend/data/one_line_dart_program\\.dart",
- "^tests/compiler/dart2js/old_frontend/message_kind_helper\\.dart",
- "^tests/compiler/dart2js/old_frontend/metadata_test\\.dart",
- "^tests/compiler/dart2js/old_frontend/patch_test\\.dart",
- "^tests/compiler/dart2js/old_frontend/reexport_handled_test\\.dart",
- "^tests/compiler/dart2js/old_frontend/resolution_test\\.dart",
- "^tests/compiler/dart2js/quarantined/http_launch_data/http_launch_main_package\\.dart",
- "^tests/compiler/dart2js/quarantined/http_test\\.dart",
"^tests/compiler/dart2js/rti/data/future_or_future_or_generic_strong\\.dart",
"^tests/compiler/dart2js/rti/data/future_or_future_or_strong\\.dart",
"^tests/compiler/dart2js/rti/data/future_or_generic2_strong\\.dart",
@@ -78,9 +67,7 @@
"^tests/compiler/dart2js/token_naming_test\\.dart",
"^tests/compiler/dart2js/type_representation_test\\.dart",
"^tests/compiler/dart2js/type_variable_occurrence_test\\.dart",
- "^tests/compiler/dart2js/unused_empty_map_test\\.dart",
-
- "^tests/compiler/dart2js/path with spaces/.*"
+ "^tests/compiler/dart2js/unused_empty_map_test\\.dart"
]
}
}
diff --git a/pkg/dev_compiler/lib/src/kernel/compiler.dart b/pkg/dev_compiler/lib/src/kernel/compiler.dart
index e8aa203..bc50ca2 100644
--- a/pkg/dev_compiler/lib/src/kernel/compiler.dart
+++ b/pkg/dev_compiler/lib/src/kernel/compiler.dart
@@ -1367,15 +1367,19 @@
JS.Expression _emitConstructor(
Constructor node, List<Field> fields, JS.Expression className) {
+ var savedUri = _currentUri;
+ _currentUri = node.fileUri ?? savedUri;
var params = _emitFormalParameters(node.function);
var body = _withCurrentFunction(
node.function,
() => _superDisallowed(
() => _emitConstructorBody(node, fields, className)));
- return new JS.Fun(params, new JS.Block(body))
- ..sourceInformation = _nodeEnd(node.fileEndOffset) ??
- _nodeEnd(node.enclosingClass.fileEndOffset);
+ var end = _nodeEnd(node.fileEndOffset);
+ _currentUri = savedUri;
+ end ??= _nodeEnd(node.enclosingClass.fileEndOffset);
+
+ return new JS.Fun(params, new JS.Block(body))..sourceInformation = end;
}
List<JS.Statement> _emitConstructorBody(
@@ -1617,7 +1621,9 @@
}
}
+ var savedUri = _currentUri;
for (var m in c.procedures) {
+ _currentUri = m.fileUri ?? savedUri;
if (m.isForwardingStub) {
// TODO(jmesserly): is there any other kind of forwarding stub?
jsMethods.addAll(_emitCovarianceCheckStub(m));
@@ -1636,6 +1642,7 @@
jsMethods.add(_emitMethodDeclaration(m));
}
}
+ _currentUri = savedUri;
_classProperties.mockMembers.forEach((String name, Member member) {
jsMethods
diff --git a/pkg/dev_compiler/tool/input_sdk/lib/libraries.json b/pkg/dev_compiler/tool/input_sdk/lib/libraries.json
index 74a20ef..49b904f 100644
--- a/pkg/dev_compiler/tool/input_sdk/lib/libraries.json
+++ b/pkg/dev_compiler/tool/input_sdk/lib/libraries.json
@@ -18,7 +18,7 @@
},
"_internal": {
"uri": "../../../../../sdk/lib/internal/internal.dart",
- "patch": "../patch/internal_patch.dart"
+ "patches": "../patch/internal_patch.dart"
},
"_isolate_helper": {
"uri": "../private/isolate_helper.dart"
@@ -40,43 +40,43 @@
},
"async": {
"uri": "../../../../../sdk/lib/async/async.dart",
- "patch": "../patch/async_patch.dart"
+ "patches": "../patch/async_patch.dart"
},
"collection": {
"uri": "../../../../../sdk/lib/collection/collection.dart",
- "patch": "../patch/collection_patch.dart"
+ "patches": "../patch/collection_patch.dart"
},
"convert": {
"uri": "../../../../../sdk/lib/convert/convert.dart",
- "patch": "../patch/convert_patch.dart"
+ "patches": "../patch/convert_patch.dart"
},
"core": {
"uri": "../../../../../sdk/lib/core/core.dart",
- "patch": "../patch/core_patch.dart"
+ "patches": "../patch/core_patch.dart"
},
"developer": {
"uri": "../../../../../sdk/lib/developer/developer.dart",
- "patch": "../patch/developer_patch.dart"
+ "patches": "../patch/developer_patch.dart"
},
"io": {
"uri": "../../../../../sdk/lib/io/io.dart",
- "patch": "../patch/io_patch.dart"
+ "patches": "../patch/io_patch.dart"
},
"isolate": {
"uri": "../../../../../sdk/lib/isolate/isolate.dart",
- "patch": "../patch/isolate_patch.dart"
+ "patches": "../patch/isolate_patch.dart"
},
"mirrors": {
"uri": "../../../../../sdk/lib/mirrors/mirrors.dart",
- "patch": "../patch/mirrors_patch.dart"
+ "patches": "../patch/mirrors_patch.dart"
},
"math": {
"uri": "../../../../../sdk/lib/math/math.dart",
- "patch": "../patch/math_patch.dart"
+ "patches": "../patch/math_patch.dart"
},
"typed_data": {
"uri": "../../../../../sdk/lib/typed_data/typed_data.dart",
- "patch": "../patch/typed_data_patch.dart"
+ "patches": "../patch/typed_data_patch.dart"
},
"html": {
"uri": "../../../../../sdk/lib/html/dart2js/html_dart2js.dart"
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 b04009e..1dabfb7 100644
--- a/pkg/dev_compiler/tool/input_sdk/patch/async_patch.dart
+++ b/pkg/dev_compiler/tool/input_sdk/patch/async_patch.dart
@@ -15,7 +15,7 @@
@JSExportName('async')
@ReifyFunctionTypes(false)
-async_<T>(Function() initGenerator) {
+_async<T>(Function() initGenerator) {
var iter;
Object Function(Object) onValue;
Object Function(Object) onError;
diff --git a/pkg/dev_compiler/tool/input_sdk/patch/core_patch.dart b/pkg/dev_compiler/tool/input_sdk/patch/core_patch.dart
index b8ad752..7ae52ae 100644
--- a/pkg/dev_compiler/tool/input_sdk/patch/core_patch.dart
+++ b/pkg/dev_compiler/tool/input_sdk/patch/core_patch.dart
@@ -17,17 +17,18 @@
notNull,
nullCheck,
Primitives,
+ PrivateSymbol,
quoteStringForRegExp;
-
import 'dart:_runtime' as dart;
-
import 'dart:_foreign_helper' show JS;
-
import 'dart:_native_typed_data' show NativeUint8List;
-
+import 'dart:collection' show UnmodifiableMapView;
+import 'dart:convert' show Encoding, utf8;
import 'dart:typed_data' show Endian, Uint8List, Uint16List;
-String _symbolToString(Symbol symbol) => _symbol_dev.Symbol.getName(symbol);
+String _symbolToString(Symbol symbol) => symbol is PrivateSymbol
+ ? PrivateSymbol.getName(symbol)
+ : _symbol_dev.Symbol.getName(symbol);
@patch
int identityHashCode(Object object) {
diff --git a/pkg/dev_compiler/tool/input_sdk/patch/developer_patch.dart b/pkg/dev_compiler/tool/input_sdk/patch/developer_patch.dart
index d9c577b..99a85fd 100644
--- a/pkg/dev_compiler/tool/input_sdk/patch/developer_patch.dart
+++ b/pkg/dev_compiler/tool/input_sdk/patch/developer_patch.dart
@@ -6,6 +6,8 @@
import 'dart:_js_helper' show patch, ForceInline;
import 'dart:_foreign_helper' show JS;
+import 'dart:async';
+import 'dart:isolate';
@patch
@ForceInline()
diff --git a/pkg/dev_compiler/tool/input_sdk/patch/internal_patch.dart b/pkg/dev_compiler/tool/input_sdk/patch/internal_patch.dart
index c750542..5e850bb 100644
--- a/pkg/dev_compiler/tool/input_sdk/patch/internal_patch.dart
+++ b/pkg/dev_compiler/tool/input_sdk/patch/internal_patch.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.
+import 'dart:core' hide Symbol;
+import 'dart:core' as core show Symbol;
import 'dart:_js_primitives' show printString;
import 'dart:_js_helper' show patch;
import 'dart:_interceptors' show JSArray;
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 de914a5..604c0c8 100644
--- a/pkg/dev_compiler/tool/input_sdk/patch/io_patch.dart
+++ b/pkg/dev_compiler/tool/input_sdk/patch/io_patch.dart
@@ -3,6 +3,10 @@
// BSD-style license that can be found in the LICENSE file.
import 'dart:_js_helper' show patch;
+import 'dart:async';
+import 'dart:convert';
+import 'dart:isolate' show SendPort;
+import 'dart:typed_data';
@patch
class _Directory {
@@ -343,7 +347,7 @@
Map<String, String> environment,
bool includeParentEnvironment: true,
bool runInShell: false,
- ProcessStartMode mode: ProcessStartMode.NORMAL}) {
+ ProcessStartMode mode: ProcessStartMode.normal}) {
throw new UnsupportedError("Process.start");
}
@@ -353,8 +357,8 @@
Map<String, String> environment,
bool includeParentEnvironment: true,
bool runInShell: false,
- Encoding stdoutEncoding: SYSTEM_ENCODING,
- Encoding stderrEncoding: SYSTEM_ENCODING}) {
+ Encoding stdoutEncoding: systemEncoding,
+ Encoding stderrEncoding: systemEncoding}) {
throw new UnsupportedError("Process.run");
}
@@ -364,13 +368,13 @@
Map<String, String> environment,
bool includeParentEnvironment: true,
bool runInShell: false,
- Encoding stdoutEncoding: SYSTEM_ENCODING,
- Encoding stderrEncoding: SYSTEM_ENCODING}) {
+ Encoding stdoutEncoding: systemEncoding,
+ Encoding stderrEncoding: systemEncoding}) {
throw new UnsupportedError("Process.runSync");
}
@patch
- static bool killPid(int pid, [ProcessSignal signal = ProcessSignal.SIGTERM]) {
+ static bool killPid(int pid, [ProcessSignal signal = ProcessSignal.sigterm]) {
throw new UnsupportedError("Process.killPid");
}
}
@@ -403,7 +407,7 @@
}
@patch
static Future<List<InternetAddress>> lookup(String host,
- {InternetAddressType type: InternetAddressType.ANY}) {
+ {InternetAddressType type: InternetAddressType.any}) {
throw new UnsupportedError("InternetAddress.lookup");
}
@@ -425,7 +429,7 @@
static Future<List<NetworkInterface>> list(
{bool includeLoopback: false,
bool includeLinkLocal: false,
- InternetAddressType type: InternetAddressType.ANY}) {
+ InternetAddressType type: InternetAddressType.any}) {
throw new UnsupportedError("NetworkInterface.list");
}
}
diff --git a/pkg/dev_compiler/tool/input_sdk/patch/isolate_patch.dart b/pkg/dev_compiler/tool/input_sdk/patch/isolate_patch.dart
index a0464f3..bd0b258 100644
--- a/pkg/dev_compiler/tool/input_sdk/patch/isolate_patch.dart
+++ b/pkg/dev_compiler/tool/input_sdk/patch/isolate_patch.dart
@@ -5,6 +5,7 @@
// Patch file for the dart:isolate library.
import 'dart:_js_helper' show patch, NoReifyGeneric;
+import 'dart:async';
@patch
class Isolate {
diff --git a/pkg/dev_compiler/tool/input_sdk/private/interceptors.dart b/pkg/dev_compiler/tool/input_sdk/private/interceptors.dart
index 23c00f0..5566a25 100644
--- a/pkg/dev_compiler/tool/input_sdk/private/interceptors.dart
+++ b/pkg/dev_compiler/tool/input_sdk/private/interceptors.dart
@@ -96,17 +96,47 @@
String toString() => JS('String', 'String(#)', this);
}
+class NativeError extends Interceptor {
+ String dartStack() => JS('String', '#.stack', this);
+}
+
// Note that this needs to be in interceptors.dart in order for
// it to be picked up as an extension type.
@JsPeerInterface(name: 'TypeError')
-class NullError extends Interceptor implements NoSuchMethodError {
+class NullError extends NativeError implements NoSuchMethodError {
+ static RegExp _nullError =
+ new RegExp(r"^Cannot read property '(.+)' of null$");
+ static RegExp _extensionName = new RegExp(r"^Symbol\(dartx\.(.+)\)$");
+ static RegExp _privateName = new RegExp(r"^Symbol\((_.+)\)$");
+
+ String _fieldName() {
+ var message = JS('String', '#.message', this);
+ var match = _nullError.firstMatch(message);
+ if (match == null) return null;
+ var name = match[1];
+ match = _extensionName.firstMatch(name) ?? _privateName.firstMatch(name);
+ return match != null ? match[1] : name;
+ }
+
+ String dartStack() {
+ var stack = super.dartStack();
+ // Strip TypeError from first line.
+ stack = toString() + '\n' + stack.split('\n').sublist(1).join('\n');
+ return stack;
+ }
+
StackTrace get stackTrace => getTraceFromException(this);
String toString() {
// TODO(vsm): Distinguish between null reference errors and other
// TypeErrors. We should not get non-null TypeErrors from DDC code,
// but we may from native JavaScript.
- return "NullError: ${JS('String', '#.message', this)}";
+ var name = _fieldName();
+ if (name == null) {
+ // Not a Null NSM error: fallback to JS.
+ return JS('String', '#.toString()', this);
+ }
+ return "NullError: invalid member on null: '$name'";
}
}
diff --git a/pkg/dev_compiler/tool/input_sdk/private/js_helper.dart b/pkg/dev_compiler/tool/input_sdk/private/js_helper.dart
index 7157533..e7e7bd6 100644
--- a/pkg/dev_compiler/tool/input_sdk/private/js_helper.dart
+++ b/pkg/dev_compiler/tool/input_sdk/private/js_helper.dart
@@ -574,7 +574,7 @@
var error = dart.recordJsError(exception);
StackTrace trace = JS('', '#[#]', error, _stackTrace);
if (trace != null) return trace;
- trace = new _StackTrace(error);
+ trace = _StackTrace(error);
JS('', '#[#] = #', error, _stackTrace, trace);
return trace;
}
@@ -599,7 +599,11 @@
String trace;
if (JS('bool', '# !== null', _exception) &&
JS('bool', 'typeof # === "object"', _exception)) {
- trace = JS("", r"#.stack", _exception);
+ if (_exception is NativeError) {
+ trace = _exception.dartStack();
+ } else {
+ trace = JS("", r"#.stack", _exception);
+ }
if (trace != null && stackTraceMapper != null) {
trace = stackTraceMapper(trace);
}
diff --git a/pkg/dev_compiler/tool/kernel_sdk.dart b/pkg/dev_compiler/tool/kernel_sdk.dart
index fac6737..f2d5623 100755
--- a/pkg/dev_compiler/tool/kernel_sdk.dart
+++ b/pkg/dev_compiler/tool/kernel_sdk.dart
@@ -15,7 +15,6 @@
import 'package:front_end/src/api_prototype/kernel_generator.dart';
import 'package:kernel/kernel.dart';
import 'package:path/path.dart' as path;
-import 'patch_sdk.dart' as patch_sdk;
Future main(List<String> args) async {
// Parse flags.
@@ -28,9 +27,7 @@
var outputPath =
path.absolute(rest.length > 0 ? rest[0] : 'gen/sdk/kernel/ddc_sdk.dill');
- patch_sdk.main(['../..', 'tool/input_sdk', 'gen/patched_sdk']);
-
- var inputPath = path.absolute('gen/patched_sdk');
+ var inputPath = path.absolute('tool/input_sdk');
var target = new DevCompilerTarget();
var options = new CompilerOptions()
..compileSdk = true
diff --git a/pkg/front_end/lib/src/api_prototype/incremental_kernel_generator.dart b/pkg/front_end/lib/src/api_prototype/incremental_kernel_generator.dart
index d9ed1f49..76e4075 100644
--- a/pkg/front_end/lib/src/api_prototype/incremental_kernel_generator.dart
+++ b/pkg/front_end/lib/src/api_prototype/incremental_kernel_generator.dart
@@ -5,7 +5,7 @@
import 'dart:async' show Future;
import 'package:kernel/kernel.dart'
- show Component, DartType, NamedNode, Procedure, TypeParameter;
+ show Component, Procedure, DartType, TypeParameter;
import '../base/processed_options.dart' show ProcessedOptions;
@@ -17,15 +17,6 @@
import 'compiler_options.dart' show CompilerOptions;
-/// Identifies a position in the source program for expression compilation.
-///
-/// Currently this can be either a library-scope or a class-scope. This object
-/// may also contain references to FE-internal datastructures, so it is
-/// invalidated by any changes to the Kernel program.
-abstract class CompilationPosition {
- final NamedNode kernelNode = null;
-}
-
abstract class IncrementalKernelGenerator {
factory IncrementalKernelGenerator(CompilerOptions options, Uri entryPoint,
[Uri bootstrapDill]) {
@@ -53,9 +44,10 @@
/// parameters, whether or not they appear free in [expression]. The type
/// parameters should have a null parent pointer.
///
- /// [enclosingNode] must refer to either a [Library] or a [Class] in which
- /// scope [expression] is compiled. If it refers to a [Class], the flag
- /// [isStatic] determines whether [expression] may reference "this".
+ /// [libraryUri] must refer to either a previously compiled library.
+ /// [className] may optionally refer to a class within such library to use for
+ /// the scope of the expression. In that case, [isStatic] indicates whether
+ /// the scope can access [this].
///
/// It is illegal to use "await" in [expression] and the compiled function
/// will always be synchronous.
@@ -69,13 +61,9 @@
String expression,
Map<String, DartType> definitions,
List<TypeParameter> typeDefinitions,
- CompilationPosition position,
- [bool isStatic = false]);
-
- /// Finds the [CompilationPosition] referenced by [library] and optionally
- /// [class].
- CompilationPosition resolveCompilationPosition(Uri library,
- [String className]);
+ Uri libraryUri,
+ [String className,
+ bool isStatic = false]);
}
bool isLegalIdentifier(String identifier) {
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 27e264e..6121947 100644
--- a/pkg/front_end/lib/src/fasta/builder/class_builder.dart
+++ b/pkg/front_end/lib/src/fasta/builder/class_builder.dart
@@ -32,9 +32,6 @@
extends TypeDeclarationBuilder<T, R> {
final List<TypeVariableBuilder> typeVariables;
- /// List of type arguments provided by instantiate to bound.
- List<TypeBuilder> get calculatedBounds => null;
-
T supertype;
List<T> interfaces;
diff --git a/pkg/front_end/lib/src/fasta/builder/function_type_alias_builder.dart b/pkg/front_end/lib/src/fasta/builder/function_type_alias_builder.dart
index 564c636..7abb3f3 100644
--- a/pkg/front_end/lib/src/fasta/builder/function_type_alias_builder.dart
+++ b/pkg/front_end/lib/src/fasta/builder/function_type_alias_builder.dart
@@ -18,9 +18,6 @@
final List<TypeVariableBuilder> typeVariables;
- /// List of type arguments provided by instantiate to bound.
- List<TypeBuilder> get calculatedBounds;
-
FunctionTypeAliasBuilder(List<MetadataBuilder> metadata, String name,
this.typeVariables, this.type, LibraryBuilder parent, int charOffset)
: super(metadata, null, name, parent, charOffset);
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 5ad37c7..5407f55 100644
--- a/pkg/front_end/lib/src/fasta/builder/library_builder.dart
+++ b/pkg/front_end/lib/src/fasta/builder/library_builder.dart
@@ -31,8 +31,6 @@
ScopeBuilder,
TypeBuilder;
-import '../import.dart' show Import;
-
abstract class LibraryBuilder<T extends TypeBuilder, R>
extends ModifierBuilder {
final Scope scope;
@@ -172,7 +170,7 @@
null);
}
- int finishTypeVariables(ClassBuilder object) => 0;
+ int finishTypeVariables(ClassBuilder object, TypeBuilder dynamicType) => 0;
/// This method instantiates type parameters to their bounds in some cases
/// where they were omitted by the programmer and not provided by the type
@@ -217,19 +215,4 @@
if (!isPatch) return;
unsupported("${runtimeType}.applyPatches", -1, fileUri);
}
-
- void addSpecificImportsToScope(Iterable<Import> imports) {
- bool explicitCoreImport = this == loader.coreLibrary;
- for (Import import in imports) {
- if (import.imported == loader.coreLibrary) {
- explicitCoreImport = true;
- }
- import.finalizeImports(this);
- }
- if (!explicitCoreImport) {
- loader.coreLibrary.exportScope.forEach((String name, Builder member) {
- addToScope(name, member, -1, true);
- });
- }
- }
}
diff --git a/pkg/front_end/lib/src/fasta/builder/type_variable_builder.dart b/pkg/front_end/lib/src/fasta/builder/type_variable_builder.dart
index 465da46..4f3acc7 100644
--- a/pkg/front_end/lib/src/fasta/builder/type_variable_builder.dart
+++ b/pkg/front_end/lib/src/fasta/builder/type_variable_builder.dart
@@ -10,6 +10,8 @@
extends TypeDeclarationBuilder<T, R> {
T bound;
+ T defaultType;
+
TypeVariableBuilder(
String name, this.bound, LibraryBuilder compilationUnit, int charOffset)
: super(null, null, name, compilationUnit, charOffset);
diff --git a/pkg/front_end/lib/src/fasta/builder/unresolved_type.dart b/pkg/front_end/lib/src/fasta/builder/unresolved_type.dart
index ef75ed9..c539213 100644
--- a/pkg/front_end/lib/src/fasta/builder/unresolved_type.dart
+++ b/pkg/front_end/lib/src/fasta/builder/unresolved_type.dart
@@ -27,8 +27,8 @@
/// Performs checks on the type after it's resolved.
void checkType() {
- if (builder is NamedTypeBuilder) {
- NamedTypeBuilder resolvedType = builder as NamedTypeBuilder;
+ TypeBuilder resolvedType = builder;
+ if (resolvedType is NamedTypeBuilder) {
TypeDeclarationBuilder declaration = resolvedType.builder;
if (declaration is ClassBuilder) {
if (resolvedType.arguments != null &&
@@ -51,4 +51,25 @@
}
}
}
+
+ /// Normalizes the type arguments in accordance with Dart 1 semantics.
+ void normalizeType() {
+ TypeBuilder resolvedType = builder;
+ if (resolvedType is NamedTypeBuilder) {
+ TypeDeclarationBuilder declaration = resolvedType.builder;
+ if (declaration is ClassBuilder) {
+ if (resolvedType.arguments != null &&
+ resolvedType.arguments.length != declaration.typeVariablesCount) {
+ // [resolveType.arguments] will be normalized later if they are null.
+ resolvedType.arguments = null;
+ }
+ } else if (declaration is FunctionTypeAliasBuilder) {
+ if (resolvedType.arguments != null &&
+ resolvedType.arguments.length != declaration.typeVariablesCount) {
+ // [resolveType.arguments] will be normalized later if they are null.
+ resolvedType.arguments = null;
+ }
+ }
+ }
+ }
}
diff --git a/pkg/front_end/lib/src/fasta/dill/dill_class_builder.dart b/pkg/front_end/lib/src/fasta/dill/dill_class_builder.dart
index a2089f3..fc6df24 100644
--- a/pkg/front_end/lib/src/fasta/dill/dill_class_builder.dart
+++ b/pkg/front_end/lib/src/fasta/dill/dill_class_builder.dart
@@ -4,19 +4,17 @@
library fasta.dill_class_builder;
-import 'package:kernel/ast.dart' show Class, Member, TypeParameter, DartType;
-
-import 'package:kernel/type_algebra.dart' show calculateBounds;
+import 'package:kernel/ast.dart' show Class, DartType, Member;
import '../problems.dart' show unimplemented;
import '../kernel/kernel_builder.dart'
show
- MemberBuilder,
KernelClassBuilder,
KernelTypeBuilder,
- Scope,
- TypeBuilder;
+ LibraryBuilder,
+ MemberBuilder,
+ Scope;
import '../modifier.dart' show abstractMask;
@@ -24,8 +22,6 @@
import 'dill_library_builder.dart' show DillLibraryBuilder;
-import 'built_type_builder.dart' show BuiltTypeBuilder;
-
class DillClassBuilder extends KernelClassBuilder {
final Class cls;
@@ -63,24 +59,27 @@
@override
int get typeVariablesCount => cls.typeParameters.length;
- List<TypeBuilder> get calculatedBounds {
- if (super.calculatedBounds != null) {
- return super.calculatedBounds;
+ @override
+ List<DartType> buildTypeArguments(
+ LibraryBuilder library, List<KernelTypeBuilder> arguments) {
+ // For performance reasons, [typeVariables] aren't restored from [target].
+ // So, if [arguments] is null, the default types should be retrieved from
+ // [cls.typeParameters].
+ if (arguments == null) {
+ List<DartType> result =
+ new List<DartType>.filled(cls.typeParameters.length, null);
+ for (int i = 0; i < result.length; ++i) {
+ result[i] = cls.typeParameters[i].defaultType;
+ }
+ return result;
}
- DillLibraryBuilder parentLibraryBuilder = parent;
- DillClassBuilder objectClassBuilder =
- parentLibraryBuilder.loader.coreLibrary["Object"];
- Class objectClass = objectClassBuilder.cls;
- List<TypeParameter> targetTypeParameters = target.typeParameters;
- List<DartType> calculatedBoundTypes =
- calculateBounds(targetTypeParameters, objectClass);
- List<TypeBuilder> result =
- new List<BuiltTypeBuilder>(targetTypeParameters.length);
- for (int i = 0; i < result.length; i++) {
- result[i] = new BuiltTypeBuilder(calculatedBoundTypes[i]);
+
+ // [arguments] != null
+ List<DartType> result = new List<DartType>.filled(arguments.length, null);
+ for (int i = 0; i < result.length; ++i) {
+ result[i] = arguments[i].build(library);
}
- super.calculatedBounds = result;
- return super.calculatedBounds;
+ return result;
}
/// Returns true if this class is the result of applying a mixin to its
diff --git a/pkg/front_end/lib/src/fasta/dill/dill_library_builder.dart b/pkg/front_end/lib/src/fasta/dill/dill_library_builder.dart
index 57cb4e0..2b6c733 100644
--- a/pkg/front_end/lib/src/fasta/dill/dill_library_builder.dart
+++ b/pkg/front_end/lib/src/fasta/dill/dill_library_builder.dart
@@ -11,7 +11,6 @@
Class,
Field,
Library,
- LibraryDependency,
ListLiteral,
Member,
Procedure,
@@ -19,15 +18,9 @@
StringLiteral,
Typedef;
-import 'package:kernel/ast.dart' as kernel show Combinator;
-
-import '../combinator.dart' show Combinator;
-
import '../fasta_codes.dart' show templateUnspecified;
-import '../import.dart' show Import;
-
-import '../problems.dart' show internalProblem, unhandled;
+import '../problems.dart' show internalProblem, unhandled, unimplemented;
import '../kernel/kernel_builder.dart'
show
@@ -125,16 +118,7 @@
@override
void addToScope(String name, Builder member, int charOffset, bool isImport) {
- Map<String, Builder> map = member.isSetter ? scope.setters : scope.local;
- Builder existing = map[name];
- if (existing != null) {
- if (existing != member) {
- map[name] = buildAmbiguousBuilder(name, existing, member, charOffset,
- isImport: isImport);
- }
- } else {
- map[name] = member;
- }
+ unimplemented("addToScope", charOffset, fileUri);
}
@override
@@ -225,23 +209,4 @@
assert(node == builder.target);
}
}
-
- void addImportsToScope(Map<Uri, LibraryBuilder> libraries) {
- List<Import> imports = <Import>[];
- for (LibraryDependency dependency in library.dependencies) {
- if (!dependency.isImport) continue;
- LibraryBuilder imported = libraries[dependency.targetLibrary.importUri];
- assert(imported != null);
-
- List<Combinator> syntheticCombinators = <Combinator>[];
- for (kernel.Combinator combinator in dependency.combinators) {
- syntheticCombinators.add(new Combinator(combinator.isShow,
- new Set<String>.from(combinator.names), -1, uri));
- }
-
- imports.add(new Import(this, imported, false, dependency.name,
- syntheticCombinators, [], dependency.fileOffset, -1));
- }
- addSpecificImportsToScope(imports);
- }
}
diff --git a/pkg/front_end/lib/src/fasta/dill/dill_loader.dart b/pkg/front_end/lib/src/fasta/dill/dill_loader.dart
index ea49d48..d033d7d 100644
--- a/pkg/front_end/lib/src/fasta/dill/dill_loader.dart
+++ b/pkg/front_end/lib/src/fasta/dill/dill_loader.dart
@@ -8,8 +8,6 @@
import 'package:kernel/ast.dart' show Library, Component, Source;
-import 'package:kernel/core_types.dart' show CoreTypes;
-
import '../fasta_codes.dart'
show SummaryTemplate, Template, templateDillOutlineSummary;
@@ -30,9 +28,6 @@
/// Sources for all appended components.
final Map<Uri, Source> uriToSource = <Uri, Source>{};
- /// Should be set if code will be compiled in the context of this library.
- CoreTypes coreTypes;
-
DillLoader(TargetImplementation target) : super(target);
Template<SummaryTemplate> get outlineSummaryTemplate =>
diff --git a/pkg/front_end/lib/src/fasta/dill/dill_typedef_builder.dart b/pkg/front_end/lib/src/fasta/dill/dill_typedef_builder.dart
index e6eebed..f2666d8 100644
--- a/pkg/front_end/lib/src/fasta/dill/dill_typedef_builder.dart
+++ b/pkg/front_end/lib/src/fasta/dill/dill_typedef_builder.dart
@@ -4,26 +4,20 @@
library fasta.dill_typedef_builder;
-import 'package:kernel/ast.dart' show DartType, Typedef, TypeParameter, Class;
-
-import 'package:kernel/type_algebra.dart' show calculateBounds;
+import 'package:kernel/ast.dart' show DartType, Typedef;
import '../kernel/kernel_builder.dart'
show
KernelFunctionTypeAliasBuilder,
KernelFunctionTypeBuilder,
+ KernelTypeBuilder,
LibraryBuilder,
- MetadataBuilder,
- TypeBuilder;
+ MetadataBuilder;
import '../problems.dart' show unimplemented;
import 'dill_library_builder.dart' show DillLibraryBuilder;
-import 'dill_class_builder.dart' show DillClassBuilder;
-
-import 'built_type_builder.dart' show BuiltTypeBuilder;
-
class DillFunctionTypeAliasBuilder extends KernelFunctionTypeAliasBuilder {
DillFunctionTypeAliasBuilder(Typedef typedef, DillLibraryBuilder parent)
: super(null, typedef.name, null, null, parent, typedef.fileOffset,
@@ -36,26 +30,6 @@
@override
int get typeVariablesCount => target.typeParameters.length;
- List<TypeBuilder> get calculatedBounds {
- if (super.calculatedBounds != null) {
- return super.calculatedBounds;
- }
- DillLibraryBuilder parentLibraryBuilder = parent;
- DillClassBuilder objectClassBuilder =
- parentLibraryBuilder.loader.coreLibrary["Object"];
- Class objectClass = objectClassBuilder.cls;
- List<TypeParameter> targetTypeParameters = target.typeParameters;
- List<DartType> calculatedBoundTypes =
- calculateBounds(targetTypeParameters, objectClass);
- List<TypeBuilder> result =
- new List<BuiltTypeBuilder>(targetTypeParameters.length);
- for (int i = 0; i < result.length; i++) {
- result[i] = new BuiltTypeBuilder(calculatedBoundTypes[i]);
- }
- super.calculatedBounds = result;
- return super.calculatedBounds;
- }
-
@override
KernelFunctionTypeBuilder get type {
return unimplemented("type", -1, null);
@@ -63,4 +37,27 @@
@override
DartType buildThisType(LibraryBuilder library) => thisType ??= target.type;
+
+ @override
+ List<DartType> buildTypeArguments(
+ LibraryBuilder library, List<KernelTypeBuilder> arguments) {
+ // For performance reasons, [typeVariables] aren't restored from [target].
+ // So, if [arguments] is null, the default types should be retrieved from
+ // [cls.typeParameters].
+ if (arguments == null) {
+ List<DartType> result =
+ new List<DartType>.filled(target.typeParameters.length, null);
+ for (int i = 0; i < result.length; ++i) {
+ result[i] = target.typeParameters[i].defaultType;
+ }
+ return result;
+ }
+
+ // [arguments] != null
+ List<DartType> result = new List<DartType>.filled(arguments.length, null);
+ for (int i = 0; i < result.length; ++i) {
+ result[i] = arguments[i].build(library);
+ }
+ return result;
+ }
}
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 1513772..ae67c8e 100644
--- a/pkg/front_end/lib/src/fasta/fasta_codes_generated.dart
+++ b/pkg/front_end/lib/src/fasta/fasta_codes_generated.dart
@@ -967,6 +967,27 @@
}
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
+const Code<Null> codeDeclaredMemberConflictsWithInheritedMember =
+ messageDeclaredMemberConflictsWithInheritedMember;
+
+// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
+const MessageCode messageDeclaredMemberConflictsWithInheritedMember =
+ const MessageCode("DeclaredMemberConflictsWithInheritedMember",
+ severity: Severity.errorLegacyWarning,
+ message:
+ r"""Can't declare a member that conflicts with an inherited one.""");
+
+// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
+const Code<Null> codeDeclaredMemberConflictsWithInheritedMemberCause =
+ messageDeclaredMemberConflictsWithInheritedMemberCause;
+
+// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
+const MessageCode messageDeclaredMemberConflictsWithInheritedMemberCause =
+ const MessageCode("DeclaredMemberConflictsWithInheritedMemberCause",
+ severity: Severity.context,
+ message: r"""This is the inherited member.""");
+
+// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
const Code<Null> codeDeferredAfterPrefix = messageDeferredAfterPrefix;
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
@@ -1348,6 +1369,8 @@
const Code<Message Function(String name)> codeDuplicatedNamePreviouslyUsed =
const Code<Message Function(String name)>(
"DuplicatedNamePreviouslyUsed", templateDuplicatedNamePreviouslyUsed,
+ analyzerCode: "REFERENCED_BEFORE_DECLARATION",
+ dart2jsCode: "*ignored*",
severity: Severity.error);
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
@@ -1725,6 +1748,15 @@
}
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
+const Code<Null> codeExpectedOneExpression = messageExpectedOneExpression;
+
+// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
+const MessageCode messageExpectedOneExpression = const MessageCode(
+ "ExpectedOneExpression",
+ severity: Severity.error,
+ message: r"""Expected one expression, but found additional input.""");
+
+// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
const Code<Null> codeExpectedOpenParens = messageExpectedOpenParens;
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
@@ -2525,6 +2557,35 @@
}
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
+const Code<Null> codeInheritedMembersConflict = messageInheritedMembersConflict;
+
+// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
+const MessageCode messageInheritedMembersConflict = const MessageCode(
+ "InheritedMembersConflict",
+ severity: Severity.errorLegacyWarning,
+ message: r"""Can't inherit members that conflict with each other.""");
+
+// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
+const Code<Null> codeInheritedMembersConflictCause1 =
+ messageInheritedMembersConflictCause1;
+
+// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
+const MessageCode messageInheritedMembersConflictCause1 = const MessageCode(
+ "InheritedMembersConflictCause1",
+ severity: Severity.context,
+ message: r"""This is one inherited member.""");
+
+// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
+const Code<Null> codeInheritedMembersConflictCause2 =
+ messageInheritedMembersConflictCause2;
+
+// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
+const MessageCode messageInheritedMembersConflictCause2 = const MessageCode(
+ "InheritedMembersConflictCause2",
+ severity: Severity.context,
+ message: r"""This is the other inherited member.""");
+
+// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
const Code<Null> codeInitializedVariableInForEach =
messageInitializedVariableInForEach;
diff --git a/pkg/front_end/lib/src/testing/hybrid_file_system.dart b/pkg/front_end/lib/src/fasta/hybrid_file_system.dart
similarity index 79%
rename from pkg/front_end/lib/src/testing/hybrid_file_system.dart
rename to pkg/front_end/lib/src/fasta/hybrid_file_system.dart
index ba2a2fe..4b388a3 100644
--- a/pkg/front_end/lib/src/testing/hybrid_file_system.dart
+++ b/pkg/front_end/lib/src/fasta/hybrid_file_system.dart
@@ -8,17 +8,18 @@
import 'dart:async';
-import 'package:front_end/src/api_prototype/file_system.dart';
-import 'package:front_end/src/api_prototype/memory_file_system.dart';
-import 'package:front_end/src/api_prototype/standard_file_system.dart';
+import '../api_prototype/file_system.dart';
+import '../api_prototype/memory_file_system.dart';
+import '../api_prototype/standard_file_system.dart';
/// A file system that mixes files from memory and a physical file system. All
/// memory entities take priotity over file system entities.
class HybridFileSystem implements FileSystem {
final MemoryFileSystem memory;
- final StandardFileSystem physical = StandardFileSystem.instance;
+ final FileSystem physical;
- HybridFileSystem(this.memory);
+ HybridFileSystem(this.memory, [FileSystem _physical])
+ : physical = _physical ?? StandardFileSystem.instance;
@override
FileSystemEntity entityForUri(Uri uri) =>
@@ -37,7 +38,8 @@
Future<FileSystemEntity> get delegate async {
if (_delegate != null) return _delegate;
FileSystemEntity entity = _fs.memory.entityForUri(uri);
- if ((uri.scheme != 'file' && uri.scheme != 'data') ||
+ if (((uri.scheme != 'file' && uri.scheme != 'data') &&
+ _fs.physical is StandardFileSystem) ||
await entity.exists()) {
_delegate = entity;
return _delegate;
diff --git a/pkg/front_end/lib/src/fasta/import.dart b/pkg/front_end/lib/src/fasta/import.dart
index 1ae3b3b..d48f2a2 100644
--- a/pkg/front_end/lib/src/fasta/import.dart
+++ b/pkg/front_end/lib/src/fasta/import.dart
@@ -88,7 +88,7 @@
}
}
-createPrefixBuilder(
+KernelPrefixBuilder createPrefixBuilder(
String prefix,
LibraryBuilder importer,
LibraryBuilder imported,
diff --git a/pkg/front_end/lib/src/fasta/incremental_compiler.dart b/pkg/front_end/lib/src/fasta/incremental_compiler.dart
index 1933002..f23b510 100644
--- a/pkg/front_end/lib/src/fasta/incremental_compiler.dart
+++ b/pkg/front_end/lib/src/fasta/incremental_compiler.dart
@@ -12,21 +12,29 @@
import 'package:kernel/kernel.dart'
show
- AsyncMarker,
- Component,
- DartType,
- DynamicType,
- InterfaceType,
Library,
+ Name,
+ ReturnStatement,
+ FunctionNode,
+ Class,
+ Expression,
+ DartType,
LibraryPart,
- NamedNode,
- Procedure,
- ProcedureKind,
+ Component,
+ LibraryDependency,
Source,
- TypeParameter;
+ Procedure,
+ TypeParameter,
+ ProcedureKind;
+
+import '../api_prototype/memory_file_system.dart' show MemoryFileSystem;
+
+import 'hybrid_file_system.dart' show HybridFileSystem;
+
+import 'package:kernel/kernel.dart' as kernel show Combinator;
import '../api_prototype/incremental_kernel_generator.dart'
- show CompilationPosition, isLegalIdentifier, IncrementalKernelGenerator;
+ show IncrementalKernelGenerator, isLegalIdentifier;
import 'builder/builder.dart' show LibraryBuilder;
@@ -44,6 +52,7 @@
import 'library_graph.dart' show LibraryGraph;
import 'kernel/kernel_library_builder.dart' show KernelLibraryBuilder;
+import 'kernel/kernel_shadow_ast.dart' show ShadowVariableDeclaration;
import 'source/source_library_builder.dart' show SourceLibraryBuilder;
@@ -51,46 +60,7 @@
import 'uri_translator.dart' show UriTranslator;
-import 'modifier.dart' as Modifier;
-
-import '../scanner/token.dart' show Token;
-
-import 'scanner/error_token.dart' show ErrorToken;
-
-import 'scanner/string_scanner.dart' show StringScanner;
-
-import 'dill/built_type_builder.dart' show BuiltTypeBuilder;
-
-import 'kernel/kernel_formal_parameter_builder.dart'
- show KernelFormalParameterBuilder;
-
-import 'kernel/kernel_procedure_builder.dart' show KernelProcedureBuilder;
-
-import 'builder/class_builder.dart' show ClassBuilder;
-
-import 'kernel/kernel_shadow_ast.dart' show ShadowTypeInferenceEngine;
-
-import 'kernel/body_builder.dart' show BodyBuilder;
-
-import 'kernel/kernel_type_variable_builder.dart'
- show KernelTypeVariableBuilder;
-
-import 'parser/parser.dart' show Parser;
-
-import 'parser/member_kind.dart' show MemberKind;
-
-import 'scope.dart' show Scope;
-
-import 'type_inference/type_inferrer.dart' show TypeInferrer;
-
-class IncrementalCompilationPosition implements CompilationPosition {
- final NamedNode kernelNode;
- final LibraryBuilder libraryBuilder; // will not be null
- final ClassBuilder classBuilder; // may be null if not inside a class
-
- IncrementalCompilationPosition(
- this.kernelNode, this.libraryBuilder, this.classBuilder);
-}
+import 'combinator.dart' show Combinator;
class IncrementalCompiler implements IncrementalKernelGenerator {
final CompilerContext context;
@@ -101,7 +71,7 @@
DillTarget dillLoadedData;
Map<Uri, Source> dillLoadedDataUriToSource = <Uri, Source>{};
- Map<Uri, LibraryBuilder> platformBuilders;
+ List<LibraryBuilder> platformBuilders;
Map<Uri, LibraryBuilder> userBuilders;
final Uri initializeFromDillUri;
bool initializedFromDill = false;
@@ -156,10 +126,10 @@
}
summaryBytes = null;
userBuilders = <Uri, LibraryBuilder>{};
- platformBuilders = <Uri, LibraryBuilder>{};
+ platformBuilders = <LibraryBuilder>[];
dillLoadedData.loader.builders.forEach((uri, builder) {
if (builder.uri.scheme == "dart") {
- platformBuilders[uri] = builder;
+ platformBuilders.add(builder);
} else {
userBuilders[uri] = builder;
}
@@ -188,11 +158,17 @@
" of ${userCode.loader.builders.length} libraries");
}
- reusedLibraries.addAll(platformBuilders.values);
+ reusedLibraries.addAll(platformBuilders);
KernelIncrementalTarget userCodeOld = userCode;
userCode = new KernelIncrementalTarget(
- c.fileSystem, false, dillLoadedData, uriTranslator,
+ new HybridFileSystem(
+ new MemoryFileSystem(
+ new Uri(scheme: "org-dartlang-debug", path: "/")),
+ c.fileSystem),
+ false,
+ dillLoadedData,
+ uriTranslator,
uriToSource: c.uriToSource);
for (LibraryBuilder library in reusedLibraries) {
@@ -379,189 +355,104 @@
ticker.logMs("Appended libraries");
}
- IncrementalCompilationPosition resolveCompilationPosition(Uri libraryUri,
- [String className]) {
- if (userCode == null || dillLoadedData == null) return null;
-
- // Find library.
- LibraryBuilder enclosingLibrary = userCode.loader.builders[libraryUri];
- if (enclosingLibrary == null) return null;
-
- if (className == null) {
- return new IncrementalCompilationPosition(
- enclosingLibrary.target, enclosingLibrary, null);
- }
-
- ClassBuilder classBuilder = enclosingLibrary.scopeBuilder[className];
- if (classBuilder == null) return null;
-
- return new IncrementalCompilationPosition(
- classBuilder.target, enclosingLibrary, classBuilder);
- }
-
@override
Future<Procedure> compileExpression(
String expression,
Map<String, DartType> definitions,
List<TypeParameter> typeDefinitions,
- covariant IncrementalCompilationPosition position,
- [bool isStatic = false]) async {
+ Uri libraryUri,
+ [String className,
+ bool isStatic = false]) async {
assert(dillLoadedData != null && userCode != null);
- dillLoadedData.loader.seenMessages.clear();
- userCode.loader.seenMessages.clear();
+ return await context.runInContext((_) async {
+ LibraryBuilder library = userCode.loader.read(libraryUri, -1);
- for (TypeParameter typeParam in typeDefinitions) {
- if (!isLegalIdentifier(typeParam.name)) return null;
- }
- for (String name in definitions.keys) {
- if (!isLegalIdentifier(name)) return null;
- }
+ Class kernelClass;
+ if (className != null) {
+ kernelClass = library.scopeBuilder[className]?.target;
+ if (kernelClass == null) return null;
+ }
- String expressionPrefix =
- '(${definitions.keys.map((name) => "dynamic $name").join(",")}) =>';
+ userCode.loader.seenMessages.clear();
- return context.runInContext((CompilerContext c) async {
- // Find library builder or report error.
- bool inClass = position.classBuilder != null;
- LibraryBuilder enclosingLibraryBuilder = position.libraryBuilder;
- ClassBuilder classBuilder = position.classBuilder;
- Library enclosingLibrary = position.libraryBuilder.target;
+ for (TypeParameter typeParam in typeDefinitions) {
+ if (!isLegalIdentifier(typeParam.name)) return null;
+ }
+ for (String name in definitions.keys) {
+ if (!isLegalIdentifier(name)) return null;
+ }
- dillLoadedData.loader.coreTypes = userCode.loader.coreTypes;
-
- // Create a synthetic KernelLibraryBuilder to hold the compiled procedure.
- // This ensures that the uri and character offset positions inside the
- // expression refer to the the expression text, and not to random
- // positions in the enclosing library's source.
Uri debugExprUri = new Uri(
scheme: "org-dartlang-debug", path: "synthetic_debug_expression");
- KernelLibraryBuilder kernelLibraryBuilder = new KernelLibraryBuilder(
- debugExprUri,
+
+ KernelLibraryBuilder debugLibrary = new KernelLibraryBuilder(
+ libraryUri,
debugExprUri,
userCode.loader,
- /*actualOrigin=*/ null,
- enclosingLibrary);
+ null,
+ library.scope.createNestedScope("expression"),
+ library.target);
- // Parse the function prefix.
- StringScanner scanner = new StringScanner(expressionPrefix);
- Token startToken = scanner.tokenize();
- assert(startToken is! ErrorToken);
- assert(!scanner.hasErrors);
+ if (library is DillLibraryBuilder) {
+ for (LibraryDependency dependency in library.target.dependencies) {
+ if (!dependency.isImport) continue;
- // Parse the expression. By parsing the expression separately from the
- // function prefix, we ensure that the offsets for tokens coming from the
- // expression are correct.
- scanner = new StringScanner(expression);
- Token expressionStartToken = scanner.tokenize();
- while (expressionStartToken is ErrorToken) {
- ErrorToken token = expressionStartToken;
- // add compile time error
- kernelLibraryBuilder.addCompileTimeError(token.assertionMessage,
- token.charOffset, token.endOffset - token.charOffset, debugExprUri);
+ List<Combinator> combinators;
+
+ for (kernel.Combinator combinator in dependency.combinators) {
+ combinators ??= <Combinator>[];
+
+ combinators.add(combinator.isShow
+ ? new Combinator.show(
+ combinator.names, combinator.fileOffset, library.fileUri)
+ : new Combinator.hide(
+ combinator.names, combinator.fileOffset, library.fileUri));
+ }
+
+ debugLibrary.addImport(
+ null,
+ dependency.importedLibraryReference.canonicalName.name,
+ null,
+ dependency.name,
+ combinators,
+ dependency.isDeferred,
+ -1,
+ -1,
+ -1);
+ }
+
+ debugLibrary.addImportsToScope();
}
- var functionLastToken = startToken;
- while (!functionLastToken.next.isEof) {
- functionLastToken.offset = -1;
- functionLastToken = functionLastToken.next;
- }
- functionLastToken.offset = -1;
+ HybridFileSystem hfs = userCode.fileSystem;
+ MemoryFileSystem fs = hfs.memory;
+ fs.entityForUri(debugExprUri).writeAsStringSync(expression);
- functionLastToken.next = expressionStartToken;
- expressionStartToken.previous = functionLastToken;
+ FunctionNode parameters = new FunctionNode(null,
+ typeParameters: typeDefinitions,
+ positionalParameters: definitions.keys
+ .map((name) => new ShadowVariableDeclaration(name, 0))
+ .toList());
- // If we're in a library loaded from a dill file, we'll have to do some
- // extra work to get the scope setup.
- if (enclosingLibraryBuilder is DillLibraryBuilder) {
- dillLoadedData.loader.buildOutline(enclosingLibraryBuilder);
- Map<Uri, LibraryBuilder> libraries = <Uri, LibraryBuilder>{};
- if (userBuilders != null) libraries.addAll(userBuilders);
- libraries.addAll(platformBuilders);
- enclosingLibraryBuilder.addImportsToScope(libraries);
- }
- Scope scope =
- inClass ? classBuilder.scope : enclosingLibraryBuilder.scope;
+ debugLibrary.build(userCode.loader.coreLibrary, modifyTarget: false);
+ Expression compiledExpression = await userCode.loader.buildExpression(
+ debugLibrary, className, className != null && !isStatic, parameters);
- // Create a [ProcedureBuilder] and a [BodyBuilder] to parse the expression.
- dynamicType() => new BuiltTypeBuilder(new DynamicType());
- List<KernelFormalParameterBuilder> formalParameterBuilders =
- <KernelFormalParameterBuilder>[];
- definitions.forEach((name, type) {
- formalParameterBuilders.add(new KernelFormalParameterBuilder(
- null,
- Modifier.varMask,
- new BuiltTypeBuilder(type),
- name,
- false,
- kernelLibraryBuilder,
- -1));
- });
- List<KernelTypeVariableBuilder> typeVariableBuilders =
- <KernelTypeVariableBuilder>[];
- typeDefinitions.forEach((TypeParameter typeParam) {
- typeVariableBuilders.add(new KernelTypeVariableBuilder(
- typeParam.name,
- kernelLibraryBuilder,
- -1,
- new BuiltTypeBuilder(typeParam.bound),
- typeParam));
- });
- KernelProcedureBuilder procedureBuilder = new KernelProcedureBuilder(
- /*metadata=*/ null,
- isStatic ? Modifier.staticMask : Modifier.varMask,
- dynamicType(),
- "debugExpr",
- typeVariableBuilders,
- formalParameterBuilders,
- ProcedureKind.Method,
- kernelLibraryBuilder,
- /*charOffset=*/ -1,
- /*charOpenParenOffset=*/ -1,
- /*charEndOffset=*/ -1);
- Procedure procedure = procedureBuilder.build(kernelLibraryBuilder);
- procedure.parent =
- inClass ? classBuilder.target : kernelLibraryBuilder.target;
- scope = procedureBuilder.computeTypeParameterScope(scope);
- Scope formalParamScope =
- procedureBuilder.computeFormalParameterScope(scope);
- var typeInferenceEngine = new ShadowTypeInferenceEngine(
- null, /*strongMode=*/ context.options.strongMode);
- typeInferenceEngine.prepareTopLevel(
- userCode.loader.coreTypes, userCode.loader.hierarchy);
- InterfaceType thisType;
- if (inClass) {
- thisType = classBuilder.target.thisType;
- }
- TypeInferrer typeInferrer = typeInferenceEngine.createLocalTypeInferrer(
- debugExprUri, thisType, kernelLibraryBuilder);
- BodyBuilder bodyBuilder = new BodyBuilder(
- kernelLibraryBuilder,
- procedureBuilder,
- scope,
- formalParamScope,
- userCode.loader.hierarchy,
- userCode.loader.coreTypes,
- classBuilder,
- inClass && !isStatic,
- null /*uri*/,
- typeInferrer);
- bodyBuilder.scope = formalParamScope;
+ Procedure procedure = new Procedure(
+ new Name("debugExpr"), ProcedureKind.Method, parameters,
+ isStatic: isStatic);
- // Parse the expression.
- MemberKind kind = inClass
- ? (isStatic ? MemberKind.StaticMethod : MemberKind.NonStaticMethod)
- : MemberKind.TopLevelMethod;
- Parser parser = new Parser(bodyBuilder);
- Token token = parser.syntheticPreviousToken(startToken);
- token = parser.parseFormalParametersOpt(token, kind);
- var formals = bodyBuilder.pop();
- bodyBuilder.checkEmpty(token.next.charOffset);
- parser.parseFunctionBody(
- token, /*isExpression=*/ true, /*allowAbstract=*/ false);
- var body = bodyBuilder.pop();
- bodyBuilder.checkEmpty(token.charOffset);
- bodyBuilder.finishFunction([], formals, AsyncMarker.Sync, body);
+ parameters.body = new ReturnStatement(compiledExpression)
+ ..parent = parameters;
+
+ procedure.fileUri = debugLibrary.fileUri;
+ procedure.parent = className != null ? kernelClass : library.target;
+
+ userCode.uriToSource.remove(debugExprUri);
+ userCode.loader.sourceBytes.remove(debugExprUri);
+
+ userCode.runProcedureTransformations(procedure);
return procedure;
});
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 0170666..02d9745 100644
--- a/pkg/front_end/lib/src/fasta/kernel/body_builder.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/body_builder.dart
@@ -19,6 +19,7 @@
import '../parser.dart'
show
Assert,
+ Parser,
FormalParameterKind,
IdentifierContext,
MemberKind,
@@ -84,8 +85,6 @@
import 'kernel_builder.dart';
-final Forest _forest = new Fangorn();
-
// TODO(ahe): Remove this and ensure all nodes have a location.
const noLocation = null;
@@ -183,6 +182,10 @@
/// and where that was.
Map<String, int> initializedFields;
+ // TODO(ahe): Update type parameters.
+ @override
+ Forest<dynamic, dynamic, Token, dynamic> forest;
+
BodyBuilder(
KernelLibraryBuilder library,
this.member,
@@ -193,7 +196,8 @@
this.classBuilder,
this.isInstanceMember,
this.uri,
- this._typeInferrer)
+ this._typeInferrer,
+ [this.forest = const Fangorn()])
: enclosingScope = scope,
library = library,
enableNative =
@@ -207,9 +211,6 @@
typePromoter = _typeInferrer.typePromoter,
super(scope);
- @override
- Forest<Expression, Statement, Token, Arguments> get forest => _forest;
-
bool get hasParserError => recoverableErrors.isNotEmpty;
bool get inConstructor {
@@ -714,6 +715,42 @@
return expressions;
}
+ @override
+ Expression parseSingleExpression(
+ Parser parser, Token token, FunctionNode parameters) {
+ List<KernelTypeVariableBuilder> typeParameterBuilders;
+ for (TypeParameter typeParameter in parameters.typeParameters) {
+ typeParameterBuilders ??= <KernelTypeVariableBuilder>[];
+ typeParameterBuilders.add(
+ new KernelTypeVariableBuilder.fromKernel(typeParameter, library));
+ }
+ enterFunctionTypeScope(typeParameterBuilders);
+
+ enterLocalScope(
+ null,
+ new FormalParameters(parameters.positionalParameters, null, -1)
+ .computeFormalParameterScope(scope, member, this));
+
+ token = parser.parseExpression(parser.syntheticPreviousToken(token));
+
+ Expression expression = popForValue();
+ Token eof = token.next;
+
+ if (!eof.isEof) {
+ expression = wrapInLocatedCompileTimeError(
+ expression,
+ fasta.messageExpectedOneExpression
+ .withLocation(uri, eof.charOffset, eof.length));
+ }
+
+ ShadowReturnStatement fakeReturn = new ShadowReturnStatement(expression);
+
+ _typeInferrer.inferFunctionBody(
+ this, const DynamicType(), AsyncMarker.Sync, fakeReturn);
+
+ return fakeReturn.expression;
+ }
+
void finishConstructor(
KernelConstructorBuilder builder, AsyncMarker asyncModifier) {
/// Quotes below are from [Dart Programming Language Specification, 4th
@@ -942,8 +979,7 @@
if (receiver is ThisAccessor && receiver.isSuper) {
ThisAccessor thisAccessorReceiver = receiver;
isSuper = true;
- receiver = new ShadowThisExpression()
- ..fileOffset = offsetForToken(thisAccessorReceiver.token);
+ receiver = forest.thisExpression(thisAccessorReceiver.token);
}
push(buildBinaryOperator(toValue(receiver), token, argument, isSuper));
}
@@ -966,7 +1002,7 @@
// evaluating [a] and [b].
isConstantExpression: !isSuper,
isSuper: isSuper);
- return negate ? new ShadowNot(result) : result;
+ return negate ? forest.notExpression(result, null) : result;
}
}
@@ -1470,8 +1506,7 @@
expressions.add(forest.literalString(value, last));
}
}
- push(new ShadowStringConcatenation(expressions)
- ..fileOffset = offsetForToken(endToken));
+ push(forest.stringConcatenationExpression(expressions, endToken));
}
}
@@ -1507,7 +1542,7 @@
}
}
}
- push(new ShadowStringConcatenation(expressions ?? parts));
+ push(forest.stringConcatenationExpression(expressions ?? parts, null));
}
@override
@@ -1787,8 +1822,7 @@
@override
void endAwaitExpression(Token keyword, Token endToken) {
debugEvent("AwaitExpression");
- push(new ShadowAwaitExpression(popForValue())
- ..fileOffset = offsetForToken(keyword));
+ push(forest.awaitExpression(popForValue(), keyword));
}
@override
@@ -1802,25 +1836,30 @@
int count, Token beginToken, Token constKeyword, Token endToken) {
debugEvent("LiteralList");
List<Expression> expressions = popListForValue(count);
- List<DartType> typeArguments = pop();
+ Object typeArguments = pop();
DartType typeArgument;
if (typeArguments != null) {
- typeArgument = typeArguments.first;
- if (typeArguments.length > 1) {
- typeArgument = null;
+ if (forest.getTypeCount(typeArguments) > 1) {
addProblem(
fasta.messageListLiteralTooManyTypeArguments,
offsetForToken(beginToken),
lengthOfSpan(beginToken, beginToken.endGroup));
- } else if (library.loader.target.strongMode) {
- typeArgument = instantiateToBounds(typeArgument, coreTypes.objectClass);
+ } else {
+ typeArgument = forest.getTypeAt(typeArguments, 0);
+ if (library.loader.target.strongMode) {
+ typeArgument =
+ instantiateToBounds(typeArgument, coreTypes.objectClass);
+ }
}
}
push(forest.literalList(
- typeArgument,
- expressions,
+ constKeyword,
constKeyword != null || constantContext == ConstantContext.inferred,
- constKeyword ?? beginToken));
+ typeArgument,
+ typeArguments,
+ beginToken,
+ expressions,
+ endToken));
}
@override
@@ -1849,36 +1888,34 @@
debugEvent("LiteralMap");
List entries = forest.mapEntryList(count);
popList(count, entries);
- List<DartType> typeArguments = pop();
+ Object typeArguments = pop();
DartType keyType;
DartType valueType;
if (typeArguments != null) {
- if (typeArguments.length != 2) {
- keyType = null;
- valueType = null;
+ if (forest.getTypeCount(typeArguments) != 2) {
addProblem(
fasta.messageListLiteralTypeArgumentMismatch,
offsetForToken(beginToken),
lengthOfSpan(beginToken, beginToken.endGroup));
} else {
+ keyType = forest.getTypeAt(typeArguments, 0);
+ valueType = forest.getTypeAt(typeArguments, 1);
if (library.loader.target.strongMode) {
- keyType =
- instantiateToBounds(typeArguments[0], coreTypes.objectClass);
- valueType =
- instantiateToBounds(typeArguments[1], coreTypes.objectClass);
- } else {
- keyType = typeArguments[0];
- valueType = typeArguments[1];
+ keyType = instantiateToBounds(keyType, coreTypes.objectClass);
+ valueType = instantiateToBounds(valueType, coreTypes.objectClass);
}
}
}
push(forest.literalMap(
+ constKeyword,
+ constKeyword != null || constantContext == ConstantContext.inferred,
keyType,
valueType,
+ typeArguments,
+ beginToken,
entries,
- constKeyword != null || constantContext == ConstantContext.inferred,
- constKeyword ?? beginToken));
+ endToken));
}
@override
@@ -1886,7 +1923,7 @@
debugEvent("LiteralMapEntry");
Expression value = popForValue();
Expression key = popForValue();
- push(forest.mapEntry(key, value, colon));
+ push(forest.mapEntry(key, colon, value));
}
String symbolPartToString(name) {
@@ -2008,8 +2045,7 @@
push(deprecated_buildCompileTimeError(
"Not a constant expression.", operator.charOffset));
} else {
- push(new ShadowAsExpression(expression, type)
- ..fileOffset = offsetForToken(operator));
+ push(forest.asExpression(expression, type, operator));
}
}
@@ -2019,11 +2055,7 @@
DartType type = pop();
Expression operand = popForValue();
bool isInverted = not != null;
- var offset = offsetForToken(operator);
- Expression isExpression = isInverted
- ? new ShadowIsNotExpression(operand, type, offset)
- : new ShadowIsExpression(operand, type)
- ..fileOffset = offset;
+ Expression isExpression = forest.isExpression(operand, operator, not, type);
if (operand is VariableGet) {
typePromoter.handleIsCheck(isExpression, isInverted, operand.variable,
type, functionNestingLevel);
@@ -2059,9 +2091,8 @@
Expression thenExpression = pop();
Expression condition = pop();
typePromoter.exitConditional();
- push(new ShadowConditionalExpression(
- condition, thenExpression, elseExpression)
- ..fileOffset = question.offset);
+ push(forest.conditionalExpression(
+ condition, question, thenExpression, colon, elseExpression));
}
@override
@@ -2318,8 +2349,7 @@
debugEvent("UnaryPrefixExpression");
var receiver = pop();
if (optional("!", token)) {
- push(
- new ShadowNot(toValue(receiver))..fileOffset = offsetForToken(token));
+ push(forest.notExpression(toValue(receiver), token));
} else {
String operator = token.stringValue;
if (optional("-", token)) {
@@ -2338,8 +2368,7 @@
Expression receiverValue;
if (receiver is ThisAccessor && receiver.isSuper) {
isSuper = true;
- receiverValue = new ShadowThisExpression()
- ..fileOffset = offsetForToken(receiver.token);
+ receiverValue = forest.thisExpression(receiver.token);
} else {
receiverValue = toValue(receiver);
}
@@ -3529,7 +3558,9 @@
name.name, library, offsetForToken(name.token), null);
}
variable.parameter.bound = bound;
- push(variable..finish(library, library.loader.coreLibrary["Object"]));
+ push(variable
+ ..finish(library, library.loader.target.objectClassBuilder,
+ library.loader.target.dynamicType));
}
@override
diff --git a/pkg/front_end/lib/src/fasta/kernel/fangorn.dart b/pkg/front_end/lib/src/fasta/kernel/fangorn.dart
index 566ee45..45c842e 100644
--- a/pkg/front_end/lib/src/fasta/kernel/fangorn.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/fangorn.dart
@@ -28,23 +28,33 @@
import 'kernel_shadow_ast.dart'
show
ShadowArguments,
+ ShadowAsExpression,
+ ShadowAwaitExpression,
ShadowBoolLiteral,
ShadowCheckLibraryIsLoaded,
+ ShadowConditionalExpression,
ShadowDoubleLiteral,
ShadowIntLiteral,
+ ShadowIsExpression,
+ ShadowIsNotExpression,
ShadowListLiteral,
ShadowLoadLibrary,
ShadowMapLiteral,
+ ShadowNot,
ShadowNullLiteral,
+ ShadowStringConcatenation,
ShadowStringLiteral,
ShadowSymbolLiteral,
ShadowSyntheticExpression,
+ ShadowThisExpression,
ShadowTypeLiteral;
import 'forest.dart' show Forest;
/// A shadow tree factory.
class Fangorn extends Forest<Expression, Statement, Token, Arguments> {
+ const Fangorn();
+
@override
ShadowArguments arguments(List<Expression> positional, Token token,
{List<DartType> types, List<NamedExpression> named}) {
@@ -96,19 +106,36 @@
}
@override
- ShadowListLiteral literalList(covariant typeArgument,
- List<Expression> expressions, bool isConst, Token token) {
+ ShadowListLiteral literalList(
+ Token constKeyword,
+ bool isConst,
+ Object typeArgument,
+ Object typeArguments,
+ Token leftBracket,
+ List<Expression> expressions,
+ Token rightBracket) {
+ // TODO(brianwilkerson): The file offset computed below will not be correct
+ // if there are type arguments but no `const` keyword.
return new ShadowListLiteral(expressions,
typeArgument: typeArgument, isConst: isConst)
- ..fileOffset = offsetForToken(token);
+ ..fileOffset = offsetForToken(constKeyword ?? leftBracket);
}
@override
- ShadowMapLiteral literalMap(DartType keyType, DartType valueType,
- List<MapEntry> entries, bool isConst, Token token) {
+ ShadowMapLiteral literalMap(
+ Token constKeyword,
+ bool isConst,
+ DartType keyType,
+ DartType valueType,
+ Object typeArguments,
+ Token leftBracket,
+ List<MapEntry> entries,
+ Token rightBracket) {
+ // TODO(brianwilkerson): The file offset computed below will not be correct
+ // if there are type arguments but no `const` keyword.
return new ShadowMapLiteral(entries,
keyType: keyType, valueType: valueType, isConst: isConst)
- ..fileOffset = offsetForToken(token);
+ ..fileOffset = offsetForToken(constKeyword ?? leftBracket);
}
@override
@@ -132,8 +159,8 @@
}
@override
- MapEntry mapEntry(Expression key, Expression value, Token token) {
- return new MapEntry(key, value)..fileOffset = offsetForToken(token);
+ MapEntry mapEntry(Expression key, Token colon, Expression value) {
+ return new MapEntry(key, value)..fileOffset = offsetForToken(colon);
}
@override
@@ -145,6 +172,13 @@
int readOffset(TreeNode node) => node.fileOffset;
@override
+ int getTypeCount(Object typeArguments) => (typeArguments as List).length;
+
+ @override
+ DartType getTypeAt(Object typeArguments, int index) =>
+ (typeArguments as List)[index];
+
+ @override
Expression loadLibrary(LibraryDependency dependency) {
return new ShadowLoadLibrary(dependency);
}
@@ -155,6 +189,53 @@
}
@override
+ Expression asExpression(Expression expression, covariant type, Token token) {
+ return new ShadowAsExpression(expression, type)
+ ..fileOffset = offsetForToken(token);
+ }
+
+ @override
+ Expression awaitExpression(Expression operand, Token token) {
+ return new ShadowAwaitExpression(operand)
+ ..fileOffset = offsetForToken(token);
+ }
+
+ @override
+ Expression conditionalExpression(Expression condition, Token question,
+ Expression thenExpression, Token colon, Expression elseExpression) {
+ return new ShadowConditionalExpression(
+ condition, thenExpression, elseExpression)
+ ..fileOffset = offsetForToken(question);
+ }
+
+ @override
+ Expression isExpression(
+ Expression operand, isOperator, Token notOperator, covariant type) {
+ int offset = offsetForToken(isOperator);
+ if (notOperator != null) {
+ return new ShadowIsNotExpression(operand, type, offset);
+ }
+ return new ShadowIsExpression(operand, type)..fileOffset = offset;
+ }
+
+ @override
+ Expression notExpression(Expression operand, Token token) {
+ return new ShadowNot(operand)..fileOffset = offsetForToken(token);
+ }
+
+ @override
+ Expression stringConcatenationExpression(
+ List<Expression> expressions, Token token) {
+ return new ShadowStringConcatenation(expressions)
+ ..fileOffset = offsetForToken(token);
+ }
+
+ @override
+ Expression thisExpression(Token token) {
+ return new ShadowThisExpression()..fileOffset = offsetForToken(token);
+ }
+
+ @override
bool isErroneousNode(TreeNode node) {
if (node is ExpressionStatement) {
ExpressionStatement statement = node;
diff --git a/pkg/front_end/lib/src/fasta/kernel/fasta_accessors.dart b/pkg/front_end/lib/src/fasta/kernel/fasta_accessors.dart
index 8e79571..81521a1 100644
--- a/pkg/front_end/lib/src/fasta/kernel/fasta_accessors.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/fasta_accessors.dart
@@ -66,16 +66,12 @@
KernelClassBuilder,
KernelFunctionTypeAliasBuilder,
KernelInvalidTypeBuilder,
- KernelLibraryBuilder,
KernelPrefixBuilder,
KernelTypeVariableBuilder,
LibraryBuilder,
LoadLibraryBuilder,
PrefixBuilder,
- TypeDeclarationBuilder,
- KernelTypeBuilder;
-
-import 'type_algorithms.dart' show calculateBoundsForDeclaration;
+ TypeDeclarationBuilder;
abstract class BuilderHelper<Arguments> {
LibraryBuilder get library;
@@ -88,7 +84,8 @@
ConstantContext get constantContext;
- Forest<Expression, Statement, Token, Arguments> get forest;
+ // TODO(ahe): Update type parameters.
+ Forest<dynamic, dynamic, Token, dynamic> get forest;
Constructor lookupConstructor(Name name, {bool isSuper});
@@ -434,7 +431,7 @@
Expression buildSimpleRead() {
if (!isSuper) {
- return new ShadowThisExpression()..fileOffset = offsetForToken(token);
+ return forest.thisExpression(token);
} else {
return helper.buildCompileTimeError(messageSuperAsExpression,
offsetForToken(token), lengthForToken(token));
@@ -471,7 +468,7 @@
helper.warnUnresolvedMethod(name, offsetForToken(send.token),
isSuper: isSuper);
}
- return helper.buildMethodInvocation(new ShadowThisExpression(), name,
+ return helper.buildMethodInvocation(forest.thisExpression(null), name,
send.arguments, offsetForToken(send.token),
isSuper: isSuper, interfaceTarget: getter);
} else {
@@ -495,7 +492,7 @@
messageSuperAsExpression, offset, noLength);
} else {
return helper.buildMethodInvocation(
- new ShadowThisExpression(), callName, arguments, offset,
+ forest.thisExpression(null), callName, arguments, offset,
isImplicitCall: true);
}
}
@@ -1073,7 +1070,7 @@
interfaceTarget = null;
}
return helper.buildMethodInvocation(
- new ShadowThisExpression(), name, arguments, offset,
+ forest.thisExpression(null), name, arguments, offset,
interfaceTarget: interfaceTarget);
}
@@ -1303,27 +1300,12 @@
}
DartType type;
- LibraryBuilder helperLibrary = helper.library;
- if (arguments == null &&
- helperLibrary is KernelLibraryBuilder &&
- helperLibrary.loader.target.strongMode) {
+ if (arguments == null) {
TypeDeclarationBuilder typeDeclaration = declaration;
if (typeDeclaration is KernelClassBuilder) {
- typeDeclaration.calculatedBounds ??= calculateBoundsForDeclaration(
- typeDeclaration,
- helperLibrary.loader.target.dynamicType,
- helperLibrary.loader.target.bottomType,
- helperLibrary.loader.target.objectClassBuilder);
- type = typeDeclaration.buildType(
- helper.library, typeDeclaration.calculatedBounds);
+ type = typeDeclaration.buildType(helper.library, null);
} else if (typeDeclaration is KernelFunctionTypeAliasBuilder) {
- typeDeclaration.calculatedBounds ??= calculateBoundsForDeclaration(
- typeDeclaration,
- helperLibrary.loader.target.dynamicType,
- helperLibrary.loader.target.bottomType,
- helperLibrary.loader.target.objectClassBuilder);
- type = typeDeclaration.buildType(
- helper.library, typeDeclaration.calculatedBounds);
+ type = typeDeclaration.buildType(helper.library, null);
}
}
if (type == null) {
@@ -1337,41 +1319,6 @@
return type;
}
- DartType buildType(List<KernelTypeBuilder> arguments,
- {bool nonInstanceAccessIsError: false}) {
- if (arguments != null) {
- int expected = 0;
- if (declaration is KernelClassBuilder) {
- expected = declaration.target.typeParameters.length;
- } else if (declaration is FunctionTypeAliasBuilder) {
- expected = declaration.target.typeParameters.length;
- } else if (declaration is KernelTypeVariableBuilder) {
- // Type arguments on a type variable - error reported elsewhere.
- } else {
- return unhandled(
- "${declaration.runtimeType}",
- "TypeDeclarationAccessor.buildType",
- offsetForToken(token),
- helper.uri);
- }
- if (arguments.length != expected) {
- helper.warnTypeArgumentsMismatch(
- declaration.name, expected, offsetForToken(token));
- // We ignore the provided arguments, which will in turn return the
- // raw type below.
- // TODO(sigmund): change to use an InvalidType and include the raw type
- // as a recovery node once the IR can represent it (Issue #29840).
- arguments = null;
- }
- }
- DartType type = declaration.buildType(helper.library, arguments);
- if (type is TypeParameterType) {
- return helper.validatedTypeVariableUse(
- type, offsetForToken(token), nonInstanceAccessIsError);
- }
- return type;
- }
-
@override
Expression doInvocation(int offset, Arguments arguments) {
return helper.buildConstructorInvocation(declaration, token, arguments, "",
diff --git a/pkg/front_end/lib/src/fasta/kernel/forest.dart b/pkg/front_end/lib/src/fasta/kernel/forest.dart
index c9a526c..49d9333 100644
--- a/pkg/front_end/lib/src/fasta/kernel/forest.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/forest.dart
@@ -6,9 +6,14 @@
// TODO(ahe): Remove this import.
import 'package:kernel/ast.dart' as kernel show Arguments;
+import 'package:kernel/ast.dart';
/// A tree factory.
+///
+/// For now, the [Location] is always a token.
abstract class Forest<Expression, Statement, Location, Arguments> {
+ const Forest();
+
Arguments arguments(List<Expression> positional, Location location,
{covariant List types, covariant List named});
@@ -24,36 +29,125 @@
Expression asLiteralString(Expression value);
+ /// Return a representation of a boolean literal at the given [location]. The
+ /// literal has the given [value].
Expression literalBool(bool value, Location location);
+ /// Return a representation of a double literal at the given [location]. The
+ /// literal has the given [value].
Expression literalDouble(double value, Location location);
+ /// Return a representation of an integer literal at the given [location]. The
+ /// literal has the given [value].
Expression literalInt(int value, Location location);
- Expression literalList(covariant typeArgument, List<Expression> expressions,
- bool isConst, Location location);
+ /// Return a representation of a list literal. The [constKeyword] is the
+ /// location of the `const` keyword, or `null` if there is no keyword. The
+ /// [isConst] is `true` if either the `const` keyword is not-`null` or if the
+ /// list literal is in a const context. The [typeArgument] is the
+ /// representation of the single valid type argument preceding the list
+ /// literal, or `null` if there is no type argument, there is more than one
+ /// type argument, or if the type argument cannot be resolved. The
+ /// [typeArguments] is the representation of all of the type arguments
+ /// preceding the list literal, or `null` if there are no type arguments. The
+ /// [leftBracket] is the location of the `[`. The list of [expressions] is a
+ /// list of the representations of the list elements. The [rightBracket] is
+ /// the location of the `]`.
+ Expression literalList(
+ Location constKeyword,
+ bool isConst,
+ Object typeArgument,
+ Object typeArguments,
+ Location leftBracket,
+ List<Expression> expressions,
+ Location rightBracket);
- Expression literalMap(covariant keyType, covariant valueType,
- covariant List entries, bool isConst, Location location);
+ /// Return a representation of a map literal. The [constKeyword] is the
+ /// location of the `const` keyword, or `null` if there is no keyword. The
+ /// [isConst] is `true` if either the `const` keyword is not-`null` or if the
+ /// map literal is in a const context. The [keyType] is the representation of
+ /// the first type argument preceding the map literal, or `null` if there are
+ /// not exactly two type arguments or if the first type argument cannot be
+ /// resolved. The [valueType] is the representation of the second type
+ /// argument preceding the map literal, or `null` if there are not exactly two
+ /// type arguments or if the second type argument cannot be resolved. The
+ /// [typeArguments] is the representation of all of the type arguments
+ /// preceding the map literal, or `null` if there are no type arguments. The
+ /// [leftBracket] is the location of the `{`. The list of [entries] is a
+ /// list of the representations of the map entries. The [rightBracket] is
+ /// the location of the `}`.
+ Expression literalMap(
+ Location constKeyword,
+ bool isConst,
+ covariant keyType,
+ covariant valueType,
+ Object typeArguments,
+ Location leftBracket,
+ covariant List entries,
+ Location rightBracket);
+ /// Return a representation of a null literal at the given [location].
Expression literalNull(Location location);
+ /// Return a representation of a simple string literal at the given
+ /// [location]. The literal has the given [value]. This does not include
+ /// either adjacent strings or interpolated strings.
Expression literalString(String value, Location location);
Expression literalSymbol(String value, Location location);
Expression literalType(covariant type, Location location);
- Object mapEntry(Expression key, Expression value, Location location);
+ /// Return a representation of a key/value pair in a literal map. The [key] is
+ /// the representation of the expression used to compute the key. The [colon]
+ /// is the location of the colon separating the key and the value. The [value]
+ /// is the representation of the expression used to compute the value.
+ Object mapEntry(Expression key, Location colon, Expression value);
+ /// Return a list that can hold [length] representations of map entries, as
+ /// returned from [mapEntry].
List mapEntryList(int length);
int readOffset(covariant node);
+ /// Given a representation of a list of [typeArguments], return the number of
+ /// type arguments in the list.
+ int getTypeCount(Object typeArguments);
+
+ /// Given a representation of a list of [typeArguments], return the type
+ /// associated with the argument at the given [index].
+ DartType getTypeAt(Object typeArguments, int index);
+
Expression loadLibrary(covariant dependency);
Expression checkLibraryIsLoaded(covariant dependency);
+ Expression asExpression(
+ Expression expression, covariant type, Location location);
+
+ Expression awaitExpression(Expression operand, Location location);
+
+ /// Return a representation of a conditional expression. The [condition] is
+ /// the condition. The [question] is the `?`. The [thenExpression] is the
+ /// expression following the question mark. The [colon] is the `:`. The
+ /// [elseExpression] is the expression following the colon.
+ Expression conditionalExpression(Expression condition, Location question,
+ Expression thenExpression, Location colon, Expression elseExpression);
+
+ /// Return a representation of an `is` expression. The [operand] is the
+ /// representation of the left operand. The [isOperator] is the `is` operator.
+ /// The [notOperator] is either the `!` or `null` if the test is not negated.
+ /// The [type] is a representation of the type that is the right operand.
+ Expression isExpression(Expression operand, Location isOperator,
+ Location notOperator, covariant type);
+
+ Expression notExpression(Expression operand, Location location);
+
+ Expression stringConcatenationExpression(
+ List<Expression> expressions, Location location);
+
+ Expression thisExpression(Location location);
+
bool isErroneousNode(covariant node);
// TODO(ahe): Remove this method when all users are moved here.
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 6b91235..d384b5a 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
@@ -61,15 +61,12 @@
export 'kernel_shadow_ast.dart'
show
- ShadowAsExpression,
ShadowAssertInitializer,
ShadowAssertStatement,
- ShadowAwaitExpression,
ShadowBlock,
ShadowBreakStatement,
ShadowCascadeExpression,
ShadowComplexAssignment,
- ShadowConditionalExpression,
ShadowConstructorInvocation,
ShadowContinueSwitchStatement,
ShadowDeferredCheck,
@@ -86,14 +83,12 @@
ShadowIllegalAssignment,
ShadowIndexAssign,
ShadowInvalidInitializer,
- ShadowIsExpression,
ShadowIsNotExpression,
ShadowLabeledStatement,
ShadowLogicalExpression,
ShadowLoopAssignmentStatement,
ShadowMethodInvocation,
ShadowNamedFunctionExpression,
- ShadowNot,
ShadowNullAwareMethodInvocation,
ShadowPropertyAssign,
ShadowRedirectingInitializer,
@@ -102,13 +97,11 @@
ShadowStaticAssignment,
ShadowStaticGet,
ShadowStaticInvocation,
- ShadowStringConcatenation,
ShadowSuperInitializer,
ShadowSuperMethodInvocation,
ShadowSuperPropertyGet,
ShadowSwitchStatement,
ShadowSyntheticExpression,
- ShadowThisExpression,
ShadowThrow,
ShadowTryCatch,
ShadowTryFinally,
diff --git a/pkg/front_end/lib/src/fasta/kernel/kernel_builder.dart b/pkg/front_end/lib/src/fasta/kernel/kernel_builder.dart
index a225661..aa4860e 100644
--- a/pkg/front_end/lib/src/fasta/kernel/kernel_builder.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/kernel_builder.dart
@@ -49,28 +49,12 @@
show
Combinator,
Constructor,
- DartType,
- DynamicType,
Initializer,
Procedure,
- RedirectingInitializer,
- TypeParameter;
-
-import '../builder/builder.dart' show LibraryBuilder;
+ RedirectingInitializer;
import '../combinator.dart' as fasta;
-List<DartType> computeDefaultTypeArguments(LibraryBuilder library,
- List<TypeParameter> typeParameters, List<DartType> arguments) {
- // TODO(scheglov): Use TypeSchemaEnvironment.instantiateToBounds
- if (arguments == null || arguments.length != typeParameters.length) {
- // TODO(scheglov): Check that we report a warning.
- return new List<DartType>.filled(
- typeParameters.length, const DynamicType());
- }
- return arguments;
-}
-
int compareProcedures(Procedure a, Procedure b) {
int i = "${a.fileUri}".compareTo("${b.fileUri}");
if (i != 0) return i;
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 59f4546..884971a 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
@@ -56,7 +56,8 @@
templateOverrideTypeMismatchParameter,
templateOverrideTypeMismatchReturnType,
templateOverrideTypeVariablesMismatch,
- templateRedirectionTargetNotFound;
+ templateRedirectionTargetNotFound,
+ templateTypeArgumentMismatch;
import '../names.dart' show noSuchMethodName;
@@ -79,9 +80,7 @@
MetadataBuilder,
ProcedureBuilder,
Scope,
- TypeVariableBuilder,
- TypeBuilder,
- computeDefaultTypeArguments;
+ TypeVariableBuilder;
import 'redirecting_factory_body.dart' show RedirectingFactoryBody;
@@ -89,9 +88,6 @@
extends ClassBuilder<KernelTypeBuilder, InterfaceType> {
KernelClassBuilder actualOrigin;
- @override
- List<TypeBuilder> calculatedBounds;
-
KernelClassBuilder(
List<MetadataBuilder> metadata,
int modifiers,
@@ -127,37 +123,49 @@
List<DartType> buildTypeArguments(
LibraryBuilder library, List<KernelTypeBuilder> arguments) {
- List<DartType> typeArguments = <DartType>[];
- for (KernelTypeBuilder builder in arguments) {
- DartType type = builder.build(library);
- if (type == null) {
- unhandled("${builder.runtimeType}", "buildTypeArguments", -1, null);
- }
- typeArguments.add(type);
+ if (arguments == null && typeVariables == null) {
+ return <DartType>[];
}
- return computeDefaultTypeArguments(
- library, cls.typeParameters, typeArguments);
+
+ if (arguments == null && typeVariables != null) {
+ List<DartType> result =
+ new List<DartType>.filled(typeVariables.length, null);
+ for (int i = 0; i < result.length; ++i) {
+ result[i] = typeVariables[i].defaultType.build(library);
+ }
+ return result;
+ }
+
+ if (arguments != null && arguments.length != (typeVariables?.length ?? 0)) {
+ // That should be caught and reported as a compile-time error earlier.
+ return unhandled(
+ templateTypeArgumentMismatch
+ .withArguments(name, typeVariables.length.toString())
+ .message,
+ "buildTypeArguments",
+ -1,
+ null);
+ }
+
+ // arguments.length == typeVariables.length
+ List<DartType> result = new List<DartType>.filled(arguments.length, null);
+ for (int i = 0; i < result.length; ++i) {
+ result[i] = arguments[i].build(library);
+ }
+ return result;
}
+ /// If [arguments] are null, the default types for the variables are used.
InterfaceType buildType(
LibraryBuilder library, List<KernelTypeBuilder> arguments) {
- arguments ??= calculatedBounds;
- List<DartType> typeArguments;
- if (arguments != null) {
- typeArguments = buildTypeArguments(library, arguments);
- }
- return buildTypesWithBuiltArguments(library, typeArguments);
+ return buildTypesWithBuiltArguments(
+ library, buildTypeArguments(library, arguments));
}
Supertype buildSupertype(
LibraryBuilder library, List<KernelTypeBuilder> arguments) {
Class cls = isPatch ? origin.target : this.cls;
- arguments ??= calculatedBounds;
- if (arguments != null) {
- return new Supertype(cls, buildTypeArguments(library, arguments));
- } else {
- return cls.asRawSupertype;
- }
+ return new Supertype(cls, buildTypeArguments(library, arguments));
}
Supertype buildMixedInType(
diff --git a/pkg/front_end/lib/src/fasta/kernel/kernel_formal_parameter_builder.dart b/pkg/front_end/lib/src/fasta/kernel/kernel_formal_parameter_builder.dart
index 28105fd..1830ea2 100644
--- a/pkg/front_end/lib/src/fasta/kernel/kernel_formal_parameter_builder.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/kernel_formal_parameter_builder.dart
@@ -12,9 +12,9 @@
import 'kernel_builder.dart'
show
FormalParameterBuilder,
+ KernelLibraryBuilder,
KernelTypeBuilder,
- MetadataBuilder,
- LibraryBuilder;
+ MetadataBuilder;
import 'package:front_end/src/fasta/source/source_library_builder.dart'
show SourceLibraryBuilder;
@@ -30,7 +30,7 @@
KernelTypeBuilder type,
String name,
bool hasThis,
- LibraryBuilder compilationUnit,
+ KernelLibraryBuilder compilationUnit,
this.charOffset)
: super(metadata, modifiers, type, name, hasThis, compilationUnit,
charOffset);
diff --git a/pkg/front_end/lib/src/fasta/kernel/kernel_function_type_alias_builder.dart b/pkg/front_end/lib/src/fasta/kernel/kernel_function_type_alias_builder.dart
index d91de6e..99d686f 100644
--- a/pkg/front_end/lib/src/fasta/kernel/kernel_function_type_alias_builder.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/kernel_function_type_alias_builder.dart
@@ -15,7 +15,10 @@
import 'package:kernel/type_algebra.dart' show substitute;
-import '../fasta_codes.dart' show noLength, templateCyclicTypedef;
+import '../fasta_codes.dart'
+ show noLength, templateCyclicTypedef, templateTypeArgumentMismatch;
+
+import '../problems.dart' show unhandled;
import 'kernel_builder.dart'
show
@@ -25,9 +28,7 @@
KernelTypeVariableBuilder,
LibraryBuilder,
MetadataBuilder,
- TypeVariableBuilder,
- TypeBuilder,
- computeDefaultTypeArguments;
+ TypeVariableBuilder;
class KernelFunctionTypeAliasBuilder
extends FunctionTypeAliasBuilder<KernelFunctionTypeBuilder, DartType> {
@@ -35,9 +36,6 @@
DartType thisType;
- @override
- List<TypeBuilder> calculatedBounds;
-
KernelFunctionTypeAliasBuilder(
List<MetadataBuilder> metadata,
String name,
@@ -88,8 +86,6 @@
if (const DynamicType() == thisType) return thisType;
FunctionType result = thisType;
if (target.typeParameters.isEmpty && arguments == null) return result;
- arguments =
- computeDefaultTypeArguments(library, target.typeParameters, arguments);
Map<TypeParameter, DartType> substitution = <TypeParameter, DartType>{};
for (int i = 0; i < target.typeParameters.length; i++) {
substitution[target.typeParameters[i]] = arguments[i];
@@ -97,24 +93,53 @@
return substitute(result, substitution);
}
+ List<DartType> buildTypeArguments(
+ LibraryBuilder library, List<KernelTypeBuilder> arguments) {
+ if (arguments == null && typeVariables == null) {
+ return <DartType>[];
+ }
+
+ if (arguments == null && typeVariables != null) {
+ List<DartType> result =
+ new List<DartType>.filled(typeVariables.length, null);
+ for (int i = 0; i < result.length; ++i) {
+ result[i] = typeVariables[i].defaultType.build(library);
+ }
+ return result;
+ }
+
+ if (arguments != null && arguments.length != (typeVariables?.length ?? 0)) {
+ // That should be caught and reported as a compile-time error earlier.
+ return unhandled(
+ templateTypeArgumentMismatch
+ .withArguments(name, typeVariables.length.toString())
+ .message,
+ "buildTypeArguments",
+ -1,
+ null);
+ }
+
+ // arguments.length == typeVariables.length
+ List<DartType> result = new List<DartType>.filled(arguments.length, null);
+ for (int i = 0; i < result.length; ++i) {
+ result[i] = arguments[i].build(library);
+ }
+ return result;
+ }
+
+ /// If [arguments] are null, the default types for the variables are used.
@override
int get typeVariablesCount => typeVariables?.length ?? 0;
@override
DartType buildType(
LibraryBuilder library, List<KernelTypeBuilder> arguments) {
- arguments ??= calculatedBounds;
var thisType = buildThisType(library);
if (thisType is DynamicType) return thisType;
FunctionType result = thisType;
if (target.typeParameters.isEmpty && arguments == null) return result;
// Otherwise, substitute.
- List<DartType> builtArguments = <DartType>[];
- if (arguments != null) {
- for (int i = 0; i < arguments.length; i++) {
- builtArguments.add(arguments[i].build(library));
- }
- }
- return buildTypesWithBuiltArguments(library, builtArguments);
+ return buildTypesWithBuiltArguments(
+ library, buildTypeArguments(library, arguments));
}
}
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 0a02326..463f5b4 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
@@ -112,11 +112,10 @@
Map<String, String> unserializableExports;
KernelLibraryBuilder(Uri uri, Uri fileUri, Loader loader, this.actualOrigin,
- [Library intendedTarget])
- : library = intendedTarget ??
- actualOrigin?.library ??
- new Library(uri, fileUri: fileUri),
- super(loader, fileUri);
+ [Scope scope, Library target])
+ : library = target ??
+ (actualOrigin?.library ?? new Library(uri, fileUri: fileUri)),
+ super(loader, fileUri, scope);
@override
KernelLibraryBuilder get origin => actualOrigin ?? this;
@@ -831,13 +830,16 @@
}
@override
- Library build(LibraryBuilder coreLibrary) {
+ Library build(LibraryBuilder coreLibrary, {bool modifyTarget}) {
super.build(coreLibrary);
+ if (modifyTarget == false) return library;
+
addDependencies(library, new Set<KernelLibraryBuilder>());
loader.target.metadataCollector
?.setDocumentationComment(library, documentationComment);
+
library.name = name;
library.procedures.sort(compareProcedures);
@@ -979,10 +981,10 @@
return copy;
}
- int finishTypeVariables(ClassBuilder object) {
+ int finishTypeVariables(ClassBuilder object, TypeBuilder dynamicType) {
int count = boundlessTypeVariables.length;
for (KernelTypeVariableBuilder builder in boundlessTypeVariables) {
- builder.finish(this, object);
+ builder.finish(this, object, dynamicType);
}
boundlessTypeVariables.clear();
return count;
@@ -992,24 +994,42 @@
ClassBuilder objectClass) {
int count = 0;
- for (var declarationBuilder in libraryDeclaration.members.values) {
- if (declarationBuilder is KernelClassBuilder) {
- if (declarationBuilder.typeVariables != null) {
- declarationBuilder.calculatedBounds = calculateBounds(
- declarationBuilder.typeVariables,
- dynamicType,
- bottomType,
- objectClass);
- count += declarationBuilder.calculatedBounds.length;
+ for (var declaration in libraryDeclaration.members.values) {
+ if (declaration is KernelClassBuilder) {
+ if (declaration.typeVariables != null) {
+ List<KernelTypeBuilder> calculatedBounds;
+ if (loader.target.strongMode) {
+ calculatedBounds = calculateBounds(declaration.typeVariables,
+ dynamicType, bottomType, objectClass);
+ } else {
+ calculatedBounds =
+ new List<KernelTypeBuilder>(declaration.typeVariables.length);
+ for (int i = 0; i < calculatedBounds.length; ++i) {
+ calculatedBounds[i] = dynamicType;
+ }
+ }
+ for (int i = 0; i < calculatedBounds.length; ++i) {
+ declaration.typeVariables[i].defaultType = calculatedBounds[i];
+ }
+ count += calculatedBounds.length;
}
- } else if (declarationBuilder is KernelFunctionTypeAliasBuilder) {
- if (declarationBuilder.typeVariables != null) {
- declarationBuilder.calculatedBounds = calculateBounds(
- declarationBuilder.typeVariables,
- dynamicType,
- bottomType,
- objectClass);
- count += declarationBuilder.calculatedBounds.length;
+ } else if (declaration is KernelFunctionTypeAliasBuilder) {
+ if (declaration.typeVariables != null) {
+ List<KernelTypeBuilder> calculatedBounds;
+ if (loader.target.strongMode) {
+ calculatedBounds = calculateBounds(declaration.typeVariables,
+ dynamicType, bottomType, objectClass);
+ } else {
+ calculatedBounds =
+ new List<KernelTypeBuilder>(declaration.typeVariables.length);
+ for (int i = 0; i < calculatedBounds.length; ++i) {
+ calculatedBounds[i] = dynamicType;
+ }
+ }
+ for (int i = 0; i < calculatedBounds.length; ++i) {
+ declaration.typeVariables[i].defaultType = calculatedBounds[i];
+ }
+ count += calculatedBounds.length;
}
}
}
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 d27cf0d..96b6930 100644
--- a/pkg/front_end/lib/src/fasta/kernel/kernel_target.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/kernel_target.dart
@@ -14,6 +14,7 @@
Class,
Constructor,
DartType,
+ Procedure,
DynamicType,
EmptyStatement,
Expression,
@@ -28,7 +29,6 @@
Name,
NamedExpression,
NullLiteral,
- Procedure,
ProcedureKind,
Component,
Source,
@@ -106,6 +106,9 @@
/// Shared with [CompilerContext].
final Map<Uri, Source> uriToSource;
+ /// The [MetadataCollector] to write metadata to.
+ final MetadataCollector metadataCollector;
+
SourceLoader<Library> loader;
Component component;
@@ -130,8 +133,8 @@
{Map<Uri, Source> uriToSource, MetadataCollector metadataCollector})
: dillTarget = dillTarget,
uriToSource = uriToSource ?? CompilerContext.current.uriToSource,
- super(dillTarget.ticker, uriTranslator, dillTarget.backendTarget,
- metadataCollector) {
+ metadataCollector = metadataCollector,
+ super(dillTarget.ticker, uriTranslator, dillTarget.backendTarget) {
resetCrashReporting();
loader = createLoader();
}
@@ -242,7 +245,7 @@
loader.instantiateToBound(dynamicType, bottomType, objectClassBuilder);
List<SourceClassBuilder> myClasses = collectMyClasses();
loader.checkSemantics(myClasses);
- loader.finishTypeVariables(objectClassBuilder);
+ loader.finishTypeVariables(objectClassBuilder, dynamicType);
loader.buildComponent();
installDefaultSupertypes();
installDefaultConstructors(myClasses);
@@ -710,6 +713,12 @@
logger: (String msg) => ticker.logMs(msg));
}
+ void runProcedureTransformations(Procedure procedure) {
+ backendTarget.performTransformationsOnProcedure(
+ loader.coreTypes, loader.hierarchy, procedure,
+ logger: (String msg) => ticker.logMs(msg));
+ }
+
void verify() {
errors.addAll(verifyComponent(component));
ticker.logMs("Verified component");
diff --git a/pkg/front_end/lib/src/fasta/kernel/kernel_type_variable_builder.dart b/pkg/front_end/lib/src/fasta/kernel/kernel_type_variable_builder.dart
index 485a005..1290f11 100644
--- a/pkg/front_end/lib/src/fasta/kernel/kernel_type_variable_builder.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/kernel_type_variable_builder.dart
@@ -37,6 +37,11 @@
: (new TypeParameter(name, null)..fileOffset = charOffset),
super(name, bound, compilationUnit, charOffset);
+ KernelTypeVariableBuilder.fromKernel(
+ TypeParameter parameter, KernelLibraryBuilder compilationUnit)
+ : actualParameter = parameter,
+ super(parameter.name, null, compilationUnit, parameter.fileOffset);
+
@override
KernelTypeVariableBuilder get origin => actualOrigin ?? this;
@@ -72,10 +77,13 @@
return new KernelNamedTypeBuilder(name, null)..bind(this);
}
- void finish(LibraryBuilder library, KernelClassBuilder object) {
+ void finish(LibraryBuilder library, KernelClassBuilder object,
+ TypeBuilder dynamicType) {
if (isPatch) return;
parameter.bound ??=
bound?.build(library) ?? object.buildType(library, null);
+ parameter.defaultType ??=
+ defaultType?.build(library) ?? dynamicType.build(library);
}
void applyPatch(covariant KernelTypeVariableBuilder patch) {
diff --git a/pkg/front_end/lib/src/fasta/kernel/type_algorithms.dart b/pkg/front_end/lib/src/fasta/kernel/type_algorithms.dart
index a48b328..fa6795b 100644
--- a/pkg/front_end/lib/src/fasta/kernel/type_algorithms.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/type_algorithms.dart
@@ -11,12 +11,10 @@
KernelNamedTypeBuilder,
KernelTypeVariableBuilder,
KernelClassBuilder,
- KernelFunctionTypeAliasBuilder,
KernelFunctionTypeBuilder,
NamedTypeBuilder,
FormalParameterBuilder,
- FunctionTypeBuilder,
- TypeDeclarationBuilder;
+ FunctionTypeBuilder;
import 'package:kernel/util/graph.dart' show Graph, computeStrongComponents;
@@ -184,42 +182,6 @@
return bounds;
}
-List<KernelTypeBuilder> calculateBoundsForDeclaration(
- TypeDeclarationBuilder typeDeclarationBuilder,
- KernelTypeBuilder dynamicType,
- KernelTypeBuilder nullType,
- KernelClassBuilder objectClass) {
- List<TypeVariableBuilder> typeParameters;
-
- if (typeDeclarationBuilder is KernelClassBuilder) {
- typeParameters = typeDeclarationBuilder.typeVariables;
- } else if (typeDeclarationBuilder is KernelFunctionTypeAliasBuilder) {
- typeParameters = typeDeclarationBuilder.typeVariables;
- }
-
- if (typeParameters == null || typeParameters.length == 0) {
- return null;
- }
-
- return calculateBounds(typeParameters, dynamicType, nullType, objectClass);
-}
-
-int instantiateToBoundInPlace(
- NamedTypeBuilder typeBuilder,
- KernelTypeBuilder dynamicType,
- KernelTypeBuilder nullType,
- KernelClassBuilder objectClass) {
- int count = 0;
-
- if (typeBuilder.arguments == null) {
- typeBuilder.arguments = calculateBoundsForDeclaration(
- typeBuilder.builder, dynamicType, nullType, objectClass);
- count = typeBuilder.arguments?.length ?? 0;
- }
-
- return count;
-}
-
/// Graph of mutual dependencies of type variables from the same declaration.
/// Type variables are represented by their indices in the corresponding
/// declaration.
diff --git a/pkg/front_end/lib/src/fasta/parser/identifier_context.dart b/pkg/front_end/lib/src/fasta/parser/identifier_context.dart
index 0199b13..9d57e58 100644
--- a/pkg/front_end/lib/src/fasta/parser/identifier_context.dart
+++ b/pkg/front_end/lib/src/fasta/parser/identifier_context.dart
@@ -54,10 +54,7 @@
isContinuation: true);
/// Identifier is the name being declared by a typedef declaration.
- static const typedefDeclaration = const IdentifierContext(
- 'typedefDeclaration',
- inDeclaration: true,
- isBuiltInIdentifierAllowed: false);
+ static const typedefDeclaration = const TypedefDeclarationIdentifierContext();
/// Identifier is a field initializer in a formal parameter list (i.e. it
/// appears directly after `this.`).
diff --git a/pkg/front_end/lib/src/fasta/parser/identifier_context_impl.dart b/pkg/front_end/lib/src/fasta/parser/identifier_context_impl.dart
index 000b2f2..99a9c48 100644
--- a/pkg/front_end/lib/src/fasta/parser/identifier_context_impl.dart
+++ b/pkg/front_end/lib/src/fasta/parser/identifier_context_impl.dart
@@ -15,9 +15,9 @@
import 'type_info.dart'
show insertSyntheticIdentifierAfter, isValidTypeReference;
-import 'util.dart' show optional;
+import 'util.dart' show optional, skipMetadata;
-/// See [IdentifierContext].classOrNamedMixin
+/// See [IdentifierContext.classOrNamedMixinDeclaration].
class ClassOrNamedMixinIdentifierContext extends IdentifierContext {
const ClassOrNamedMixinIdentifierContext()
: super('classOrNamedMixinDeclaration',
@@ -53,7 +53,7 @@
}
}
-/// See [IdentifierContext].dottedName
+/// See [IdentifierContext.dottedName].
class DottedNameIdentifierContext extends IdentifierContext {
const DottedNameIdentifierContext() : super('dottedName');
@@ -95,7 +95,7 @@
}
}
-/// See [IdentifierContext].expression
+/// See [IdentifierContext.expression].
class ExpressionIdentifierContext extends IdentifierContext {
const ExpressionIdentifierContext()
: super('expression', isScopeReference: true);
@@ -145,6 +145,7 @@
}
}
+/// See [IdentifierContext.fieldDeclaration].
class FieldDeclarationIdentifierContext extends IdentifierContext {
const FieldDeclarationIdentifierContext()
: super('fieldDeclaration', inDeclaration: true);
@@ -175,7 +176,7 @@
}
}
-/// See [IdentifierContext].fieldInitializer
+/// See [IdentifierContext.fieldInitializer].
class FieldInitializerIdentifierContext extends IdentifierContext {
const FieldInitializerIdentifierContext()
: super('fieldInitializer', isContinuation: true);
@@ -234,7 +235,7 @@
}
}
-/// See [IdentifierContext].libraryName
+/// See [IdentifierContext.libraryName].
class LibraryIdentifierContext extends IdentifierContext {
const LibraryIdentifierContext()
: super('libraryName', inLibraryOrPartOfDeclaration: true);
@@ -276,7 +277,7 @@
}
}
-/// See [IdentifierContext].localVariableDeclaration
+/// See [IdentifierContext.localVariableDeclaration].
class LocalVariableDeclarationIdentifierContext extends IdentifierContext {
const LocalVariableDeclarationIdentifierContext()
: super('localVariableDeclaration', inDeclaration: true);
@@ -308,6 +309,7 @@
}
}
+/// See [IdentifierContext.methodDeclaration].
class MethodDeclarationIdentifierContext extends IdentifierContext {
const MethodDeclarationIdentifierContext()
: super('methodDeclaration', inDeclaration: true);
@@ -346,7 +348,44 @@
}
}
-/// See [IdentifierContext].typeReference
+/// See [IdentifierContext].typedefDeclaration
+class TypedefDeclarationIdentifierContext extends IdentifierContext {
+ const TypedefDeclarationIdentifierContext()
+ : super('typedefDeclaration',
+ inDeclaration: true, isBuiltInIdentifierAllowed: false);
+
+ @override
+ Token ensureIdentifier(Token token, Parser parser) {
+ Token identifier = token.next;
+ assert(identifier.kind != IDENTIFIER_TOKEN);
+ if (identifier.type.isPseudo) {
+ return identifier;
+ }
+
+ // Recovery
+ const followingValues = const ['(', '<', '=', ';', 'var'];
+ if (identifier.type.isBuiltIn &&
+ isOneOfOrEof(identifier.next, followingValues)) {
+ parser.reportRecoverableErrorWithToken(
+ identifier, fasta.templateBuiltInIdentifierInDeclaration);
+ } else if (looksLikeStartOfNextTopLevelDeclaration(identifier) ||
+ isOneOfOrEof(identifier, followingValues)) {
+ identifier = parser.insertSyntheticIdentifier(token, this,
+ message: fasta.templateExpectedIdentifier.withArguments(identifier));
+ } else {
+ parser.reportRecoverableErrorWithToken(
+ identifier, fasta.templateExpectedIdentifier);
+ if (!identifier.isKeywordOrIdentifier) {
+ // When in doubt, consume the token to ensure we make progress
+ // but insert a synthetic identifier to satisfy listeners.
+ identifier = insertSyntheticIdentifierAfter(identifier, parser);
+ }
+ }
+ return identifier;
+ }
+}
+
+/// See [IdentifierContext.typeReference].
class TypeReferenceIdentifierContext extends IdentifierContext {
const TypeReferenceIdentifierContext()
: super('typeReference',
@@ -378,7 +417,7 @@
// annotation is not allowed before type arguments.
parser.reportRecoverableErrorWithToken(
next, fasta.templateUnexpectedToken);
- token = skipMetadata(next);
+ token = skipMetadata(token);
next = token.next;
}
@@ -453,25 +492,3 @@
bool looksLikeStartOfNextTopLevelDeclaration(Token token) =>
token.isTopLevelKeyword ||
isOneOfOrEof(token, const ['const', 'get', 'final', 'set', 'var', 'void']);
-
-Token skipMetadata(Token token) {
- assert(optional('@', token));
- Token next = token.next;
- if (next.isIdentifier) {
- token = next;
- next = token.next;
- while (optional('.', next)) {
- token = next;
- next = token.next;
- if (next.isIdentifier) {
- token = next;
- next = token.next;
- }
- }
- if (optional('(', next)) {
- token = next.endGroup;
- next = token.next;
- }
- }
- return token;
-}
diff --git a/pkg/front_end/lib/src/fasta/parser/parser.dart b/pkg/front_end/lib/src/fasta/parser/parser.dart
index d58fa45..2ef4384 100644
--- a/pkg/front_end/lib/src/fasta/parser/parser.dart
+++ b/pkg/front_end/lib/src/fasta/parser/parser.dart
@@ -86,10 +86,13 @@
import 'type_info.dart'
show
TypeInfo,
+ TypeParamOrArgInfo,
computeType,
+ computeTypeParamOrArg,
isGeneralizedFunctionType,
isValidTypeReference,
- noType;
+ noType,
+ noTypeParamOrArg;
import 'type_info_impl.dart' show skipTypeVariables;
@@ -534,6 +537,12 @@
directiveState?.checkDeclaration();
if (next.isIdentifier || optional("void", next)) {
return parseTypedef(previous);
+ } else if (next.isTopLevelKeyword ||
+ optional('var', next) ||
+ optional('=', next) ||
+ next.isEof) {
+ // Recovery
+ return parseTypedef(previous);
} else {
return parseTopLevelMemberImpl(previous);
}
@@ -2019,8 +2028,6 @@
followingValues = ['(', '{', '=>'];
} else if (context == IdentifierContext.topLevelVariableDeclaration) {
followingValues = [';', '=', ','];
- } else if (context == IdentifierContext.typedefDeclaration) {
- followingValues = ['(', '<', ';'];
} else if (context == IdentifierContext.typeVariableDeclaration) {
followingValues = ['<', '>', ';', '}'];
} else {
@@ -2095,8 +2102,6 @@
initialKeywords = topLevelKeywords();
} else if (context == IdentifierContext.topLevelVariableDeclaration) {
initialKeywords = topLevelKeywords();
- } else if (context == IdentifierContext.typedefDeclaration) {
- initialKeywords = topLevelKeywords();
} else if (context == IdentifierContext.typeVariableDeclaration) {
initialKeywords = topLevelKeywords()
..addAll(classMemberKeywords())
@@ -4110,10 +4115,12 @@
TokenType type = next.type;
int tokenLevel = type.precedence;
Token typeArguments;
- if (isValidMethodTypeArguments(next)) {
- // For example a(b)<T>(c), where token is '<'.
+ TypeParamOrArgInfo typeArg = computeTypeParamOrArg(token);
+ if (typeArg != noTypeParamOrArg &&
+ optional('(', typeArg.skip(token).next)) {
+ // For example a(b)<T>(c), where token is before '<'.
typeArguments = next;
- token = parseTypeArgumentsOpt(token);
+ token = typeArg.parseArguments(token, this);
next = token.next;
assert(optional('(', next));
type = next.type;
diff --git a/pkg/front_end/lib/src/fasta/parser/token_stream_rewriter.dart b/pkg/front_end/lib/src/fasta/parser/token_stream_rewriter.dart
index eb7f4d5..b80a0a9 100644
--- a/pkg/front_end/lib/src/fasta/parser/token_stream_rewriter.dart
+++ b/pkg/front_end/lib/src/fasta/parser/token_stream_rewriter.dart
@@ -2,7 +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 '../../scanner/token.dart' show SimpleToken, Token, TokenType;
+import '../../scanner/token.dart'
+ show BeginToken, SimpleToken, Token, TokenType;
+
+import 'util.dart' show optional;
/// Provides the capability of inserting tokens into a token stream. This
/// implementation does this by rewriting the previous token to point to the
@@ -70,6 +73,32 @@
return replacementToken;
}
+ /// Split a `>>` token into two separate `>` tokens and return the first `>`.
+ /// This sets [start].endGroup to the second `>` and updates the token stream,
+ /// but does not set the inner group's endGroup.
+ Token splitGtGt(BeginToken start) {
+ Token gtgt = start.endGroup;
+ assert(gtgt != null);
+ assert(optional('>>', gtgt));
+
+ // A no-op rewriter could simply return `>>` here.
+
+ Token gt1 = new SimpleToken(TokenType.GT, gtgt.charOffset);
+ Token gt2 = gt1.setNext(new SimpleToken(TokenType.GT, gt1.charOffset + 1));
+ gt2.setNext(gtgt.next);
+
+ Token token = start;
+ Token next = token.next;
+ while (!identical(next, gtgt)) {
+ token = next;
+ next = token.next;
+ }
+ token.setNext(gt1);
+
+ start.endGroup = gt2;
+ return gt1;
+ }
+
/// Given the [firstToken] in a chain of tokens to be inserted, return the
/// last token in the chain.
///
diff --git a/pkg/front_end/lib/src/fasta/parser/type_info.dart b/pkg/front_end/lib/src/fasta/parser/type_info.dart
index 29a6a7a..0addae0 100644
--- a/pkg/front_end/lib/src/fasta/parser/type_info.dart
+++ b/pkg/front_end/lib/src/fasta/parser/type_info.dart
@@ -14,7 +14,7 @@
import 'util.dart' show optional;
-/// [TypeInfo] provides information that has collected by [computeType]
+/// [TypeInfo] provides information collected by [computeType]
/// about a particular type reference.
abstract class TypeInfo {
/// Return `true` if the tokens comprising the type represented by the
@@ -55,6 +55,22 @@
Token skipType(Token token);
}
+/// [TypeParamOrArgInfo] provides information collected by
+/// [computeTypeParamOrArg] about a particular group of type arguments
+/// or type parameters.
+abstract class TypeParamOrArgInfo {
+ /// Call this function to parse optional type arguments after [token].
+ /// This function will call the appropriate event methods on the [Parser]'s
+ /// listener to handle the arguments. This may modify the token stream
+ /// when parsing `>>` in valid code or during recovery.
+ Token parseArguments(Token token, Parser parser);
+
+ /// Call this function with the [token] before the type var to obtain
+ /// the last token in the type var. If there is no type var, then this method
+ /// will return [token]. This does not modify the token stream.
+ Token skip(Token token);
+}
+
/// [NoType] is a specialized [TypeInfo] returned by [computeType] when
/// there is no type information in the source.
const TypeInfo noType = const NoType();
@@ -76,6 +92,15 @@
/// identifier `<` identifier `>`.
const TypeInfo simpleTypeWith1Argument = const SimpleTypeWith1Argument();
+/// [NoTypeParamOrArg] is a specialized [TypeParamOrArgInfo] returned by
+/// [computeTypeParamOrArg] when no type parameters or arguments are found.
+const TypeParamOrArgInfo noTypeParamOrArg = const NoTypeParamOrArg();
+
+/// [SimpleTypeArgument1] is a specialized [TypeParamOrArgInfo] returned by
+/// [computeTypeParamOrArg] when the type reference is of the form:
+/// `<` identifier `>`.
+const TypeParamOrArgInfo simpleTypeArgument1 = const SimpleTypeArgument1();
+
Token insertSyntheticIdentifierAfter(Token token, Parser parser) {
Token identifier = new SyntheticStringToken(
TokenType.IDENTIFIER, '', token.next.charOffset, 0);
@@ -104,35 +129,37 @@
/// Called by the parser to obtain information about a possible type reference
/// that follows [token]. This does not modify the token stream.
-TypeInfo computeType(final Token token, bool required) {
+///
+/// If this method is called by [computeTypeParamOrArg] and the outer group ends
+/// with `>>`, then then [innerEndGroup] is set to either `>>` if the token
+/// has not been split or the first `>` if the `>>` token has been split.
+TypeInfo computeType(final Token token, bool required, [Token innerEndGroup]) {
Token next = token.next;
if (!isValidTypeReference(next)) {
if (next.type.isBuiltIn) {
- Token afterType = next.next;
- if (optional('<', afterType)) {
- Token endGroup = afterType.endGroup;
- if (endGroup != null && looksLikeName(endGroup.next)) {
- // Recovery: built-in used as a type
- return new ComplexTypeInfo(token).computeBuiltinAsType(required);
+ TypeParamOrArgInfo typeParamOrArg =
+ computeTypeParamOrArg(next, innerEndGroup);
+ if (typeParamOrArg != noTypeParamOrArg) {
+ // Recovery: built-in `<` ... `>`
+ if (required || looksLikeName(typeParamOrArg.skip(next).next)) {
+ return new ComplexTypeInfo(token, typeParamOrArg)
+ .computeBuiltinAsType(required);
}
- } else {
+ } else if (required || isGeneralizedFunctionType(next.next)) {
String value = next.stringValue;
- if (!identical('get', value) &&
+ if ((!identical('get', value) &&
!identical('set', value) &&
!identical('factory', value) &&
- !identical('operator', value)) {
- if (isGeneralizedFunctionType(afterType)) {
- // Recovery: built-in used as a type
- return new ComplexTypeInfo(token).computeBuiltinAsType(required);
- } else if (required) {
- // Recovery: built-in used as a type
- return new ComplexTypeInfo(token).computeBuiltinAsType(required);
- }
+ !identical('operator', value))) {
+ return new ComplexTypeInfo(token, typeParamOrArg)
+ .computeBuiltinAsType(required);
}
}
} else if (required && optional('.', next)) {
// Recovery: looks like prefixed type missing the prefix
- return new ComplexTypeInfo(token).computePrefixedType(required);
+ return new ComplexTypeInfo(
+ token, computeTypeParamOrArg(next, innerEndGroup))
+ .computePrefixedType(required);
}
return noType;
}
@@ -141,7 +168,8 @@
next = next.next;
if (isGeneralizedFunctionType(next)) {
// `void` `Function` ...
- return new ComplexTypeInfo(token).computeVoidGFT(required);
+ return new ComplexTypeInfo(token, noTypeParamOrArg)
+ .computeVoidGFT(required);
}
// `void`
return voidType;
@@ -149,51 +177,47 @@
if (isGeneralizedFunctionType(next)) {
// `Function` ...
- return new ComplexTypeInfo(token).computeNoTypeGFT(required);
+ return new ComplexTypeInfo(token, noTypeParamOrArg)
+ .computeNoTypeGFT(required);
}
// We've seen an identifier.
- next = next.next;
- if (optional('<', next)) {
- Token endGroup = next.endGroup;
- if (endGroup != null) {
- next = next.next;
- // identifier `<` `void` `>` is handled by ComplexTypeInfo.
- if (isValidTypeReference(next) && !identical('void', next.stringValue)) {
- next = next.next;
- if (next == endGroup) {
- // We've seen identifier `<` identifier `>`
- next = next.next;
- if (!isGeneralizedFunctionType(next)) {
- if (required || looksLikeName(next)) {
- // identifier `<` identifier `>` identifier
- return simpleTypeWith1Argument;
- } else {
- // identifier `<` identifier `>` non-identifier
- return noType;
- }
- }
+ TypeParamOrArgInfo typeParamOrArg =
+ computeTypeParamOrArg(next, innerEndGroup);
+ if (typeParamOrArg != noTypeParamOrArg) {
+ if (typeParamOrArg == simpleTypeArgument1) {
+ // We've seen identifier `<` identifier `>`
+ next = typeParamOrArg.skip(next).next;
+ if (!isGeneralizedFunctionType(next)) {
+ if (required || looksLikeName(next)) {
+ // identifier `<` identifier `>` identifier
+ return simpleTypeWith1Argument;
+ } else {
+ // identifier `<` identifier `>` non-identifier
+ return noType;
}
- // TODO(danrubel): Consider adding a const for
- // identifier `<` identifier `,` identifier `>`
- // if that proves to be a common case.
}
-
- // identifier `<` ... `>`
- return new ComplexTypeInfo(token)
- .computeSimpleWithTypeArguments(required);
}
- // identifier `<`
- return required ? simpleType : noType;
+ // TODO(danrubel): Consider adding a const for
+ // identifier `<` identifier `,` identifier `>`
+ // if that proves to be a common case.
+
+ // identifier `<` ... `>`
+ return new ComplexTypeInfo(token, typeParamOrArg)
+ .computeSimpleWithTypeArguments(required);
}
+ assert(typeParamOrArg == noTypeParamOrArg);
+ next = next.next;
if (optional('.', next)) {
next = next.next;
if (isValidTypeReference(next)) {
- next = next.next;
// We've seen identifier `.` identifier
- if (!optional('<', next) && !isGeneralizedFunctionType(next)) {
+ typeParamOrArg = computeTypeParamOrArg(next, innerEndGroup);
+ next = next.next;
+ if (typeParamOrArg == noTypeParamOrArg &&
+ !isGeneralizedFunctionType(next)) {
if (required || looksLikeName(next)) {
// identifier `.` identifier identifier
return prefixedType;
@@ -203,17 +227,23 @@
}
}
// identifier `.` identifier
- return new ComplexTypeInfo(token).computePrefixedType(required);
+ return new ComplexTypeInfo(token, typeParamOrArg)
+ .computePrefixedType(required);
}
// identifier `.` non-identifier
- return required
- ? new ComplexTypeInfo(token).computePrefixedType(required)
- : noType;
+ if (required) {
+ typeParamOrArg = computeTypeParamOrArg(token.next.next, innerEndGroup);
+ return new ComplexTypeInfo(token, typeParamOrArg)
+ .computePrefixedType(required);
+ }
+ return noType;
}
+ assert(typeParamOrArg == noTypeParamOrArg);
if (isGeneralizedFunctionType(next)) {
- // `Function`
- return new ComplexTypeInfo(token).computeIdentifierGFT(required);
+ // identifier `Function`
+ return new ComplexTypeInfo(token, noTypeParamOrArg)
+ .computeIdentifierGFT(required);
}
if (required || looksLikeName(next)) {
@@ -222,3 +252,30 @@
}
return noType;
}
+
+/// Called by the parser to obtain information about a possible group of type
+/// parameters or type arguments that follow [token].
+/// This does not modify the token stream.
+///
+/// If this method is called by [computeType] and the outer group ends
+/// with `>>`, then then [innerEndGroup] is set to either `>>` if the token
+/// has not been split or the first `>` if the `>>` token has been split.
+TypeParamOrArgInfo computeTypeParamOrArg(Token token, [Token innerEndGroup]) {
+ Token next = token.next;
+ if (!optional('<', next)) {
+ return noTypeParamOrArg;
+ }
+ Token endGroup = next.endGroup ?? innerEndGroup;
+ if (endGroup == null) {
+ return noTypeParamOrArg;
+ }
+ Token identifier = next.next;
+ // identifier `<` `void` `>` is handled by ComplexTypeInfo.
+ if (isValidTypeReference(identifier) &&
+ !optional('void', identifier) &&
+ identifier.next == endGroup) {
+ return simpleTypeArgument1;
+ }
+ // TODO(danrubel): Consider adding additional const for common situations.
+ return new ComplexTypeParamOrArgInfo(token).compute(innerEndGroup);
+}
diff --git a/pkg/front_end/lib/src/fasta/parser/type_info_impl.dart b/pkg/front_end/lib/src/fasta/parser/type_info_impl.dart
index f0e77fb..4120e05 100644
--- a/pkg/front_end/lib/src/fasta/parser/type_info_impl.dart
+++ b/pkg/front_end/lib/src/fasta/parser/type_info_impl.dart
@@ -4,7 +4,7 @@
library fasta.parser.type_info_impl;
-import '../../scanner/token.dart' show Token;
+import '../../scanner/token.dart' show BeginToken, Token;
import '../fasta_codes.dart' as fasta;
@@ -20,7 +20,7 @@
import 'type_info.dart';
-import 'util.dart' show optional;
+import 'util.dart' show optional, skipMetadata;
/// See documentation on the [noType] const.
class NoType implements TypeInfo {
@@ -128,25 +128,17 @@
assert(token.isKeywordOrIdentifier);
Listener listener = parser.listener;
listener.handleIdentifier(token, IdentifierContext.typeReference);
-
- Token begin = token = token.next;
- assert(optional('<', token));
- listener.beginTypeArguments(token);
-
- token = simpleType.parseTypeNotVoid(token, parser);
-
- token = token.next;
- assert(optional('>', token));
- assert(begin.endGroup == token);
- listener.endTypeArguments(1, begin, token);
-
+ token = simpleTypeArgument1.parseArguments(token, parser);
listener.handleType(start, token.next);
return token;
}
@override
Token skipType(Token token) {
- return token.next.next.endGroup;
+ token = token.next.next;
+ assert(optional('<', token));
+ assert(token.endGroup != null || optional('>>', token.next.next));
+ return token.endGroup ?? token.next;
}
}
@@ -172,10 +164,10 @@
@override
Token parseType(Token token, Parser parser) {
token = token.next;
- assert(token.isKeywordOrIdentifier);
+ assert(isValidTypeReference(token));
Listener listener = parser.listener;
listener.handleIdentifier(token, IdentifierContext.typeReference);
- listener.handleNoTypeArguments(token.next);
+ token = noTypeParamOrArg.parseArguments(token, parser);
listener.handleType(token, token.next);
return token;
}
@@ -260,12 +252,12 @@
/// The first token in the type reference.
Token start;
+ /// Type arguments were seen during analysis.
+ final TypeParamOrArgInfo typeArguments;
+
/// The last token in the type reference.
Token end;
- /// Non-null if type arguments were seen during analysis.
- Token typeArguments;
-
/// The tokens before the start of type variables of function types seen
/// during analysis. Notice that the tokens in this list might precede
/// either `'<'` or `'('` as not all function types have type parameters.
@@ -275,7 +267,8 @@
/// whether it has a return type, otherwise this is `null`.
bool gftHasReturnType;
- ComplexTypeInfo(Token beforeStart) : this.start = beforeStart.next;
+ ComplexTypeInfo(Token beforeStart, this.typeArguments)
+ : this.start = beforeStart.next;
@override
bool get couldBeExpression => false;
@@ -311,7 +304,7 @@
// A function type without return type.
// Push the non-existing return type first. The loop below will
// generate the full type.
- noType.parseTypeNotVoid(token, parser);
+ noType.parseType(token, parser);
} else {
Token typeRefOrPrefix = token.next;
if (optional('void', typeRefOrPrefix)) {
@@ -327,10 +320,11 @@
token = parser.parseQualifiedRest(
token, IdentifierContext.typeReferenceContinuation);
if (token.isSynthetic && end == typeRefOrPrefix.next) {
+ // Recovery: Update `end` if a synthetic identifier was inserted.
end = token;
}
}
- token = parser.parseTypeArgumentsOpt(token);
+ token = typeArguments.parseArguments(token, parser);
parser.listener.handleType(typeRefOrPrefix, token.next);
}
}
@@ -370,8 +364,8 @@
/// and return the receiver or one of the [TypeInfo] constants.
TypeInfo computeNoTypeGFT(bool required) {
assert(optional('Function', start));
- computeRest(start, required);
+ computeRest(start, required);
if (gftHasReturnType == null) {
return required ? simpleType : noType;
}
@@ -384,8 +378,8 @@
TypeInfo computeVoidGFT(bool required) {
assert(optional('void', start));
assert(optional('Function', start.next));
- computeRest(start.next, required);
+ computeRest(start.next, required);
if (gftHasReturnType == null) {
return voidType;
}
@@ -393,35 +387,13 @@
return this;
}
- /// Given a builtin, return the receiver so that parseType will report
- /// an error for the builtin used as a type.
- TypeInfo computeBuiltinAsType(bool required) {
- assert(start.type.isBuiltIn);
- end = start;
- Token token = start.next;
- if (optional('<', token)) {
- typeArguments = token;
- token = skipTypeVariables(typeArguments);
- if (token == null) {
- token = typeArguments;
- typeArguments = null;
- } else {
- end = token;
- }
- }
- computeRest(token, required);
-
- assert(end != null);
- return this;
- }
-
/// Given identifier `Function` non-identifier, compute the type
/// and return the receiver or one of the [TypeInfo] constants.
TypeInfo computeIdentifierGFT(bool required) {
assert(isValidTypeReference(start));
assert(optional('Function', start.next));
- computeRest(start.next, required);
+ computeRest(start.next, required);
if (gftHasReturnType == null) {
return simpleType;
}
@@ -429,19 +401,26 @@
return this;
}
+ /// Given a builtin, return the receiver so that parseType will report
+ /// an error for the builtin used as a type.
+ TypeInfo computeBuiltinAsType(bool required) {
+ assert(start.type.isBuiltIn);
+
+ end = typeArguments.skip(start);
+ computeRest(end.next, required);
+ assert(end != null);
+ return this;
+ }
+
/// Given identifier `<` ... `>`, compute the type
/// and return the receiver or one of the [TypeInfo] constants.
TypeInfo computeSimpleWithTypeArguments(bool required) {
assert(isValidTypeReference(start));
- typeArguments = start.next;
- assert(optional('<', typeArguments));
+ assert(optional('<', start.next));
+ assert(typeArguments != noTypeParamOrArg);
- Token token = skipTypeVariables(typeArguments);
- if (token == null) {
- return required ? simpleType : noType;
- }
- end = token;
- computeRest(token.next, required);
+ end = typeArguments.skip(start);
+ computeRest(end.next, required);
if (!required && !looksLikeName(end.next) && gftHasReturnType == null) {
return noType;
@@ -450,32 +429,22 @@
return this;
}
- /// Given identifier `.` identifier, compute the type
- /// and return the receiver or one of the [TypeInfo] constants.
+ /// Given identifier `.` identifier (or `.` identifier or identifier `.`
+ /// for recovery), compute the type and return the receiver or one of the
+ /// [TypeInfo] constants.
TypeInfo computePrefixedType(bool required) {
Token token = start;
if (!optional('.', token)) {
- assert(isValidTypeReference(token));
+ assert(token.isKeywordOrIdentifier);
token = token.next;
}
assert(optional('.', token));
- if (isValidTypeReference(token.next)) {
+ if (token.next.isKeywordOrIdentifier) {
token = token.next;
}
- end = token;
- token = token.next;
- if (optional('<', token)) {
- typeArguments = token;
- token = skipTypeVariables(token);
- if (token == null) {
- return required ? prefixedType : noType;
- }
- end = token;
- token = token.next;
- }
- computeRest(token, required);
-
+ end = typeArguments.skip(token);
+ computeRest(end.next, required);
if (!required && !looksLikeName(end.next) && gftHasReturnType == null) {
return noType;
}
@@ -513,3 +482,171 @@
}
}
}
+
+/// See [noTypeParamOrArg].
+class NoTypeParamOrArg implements TypeParamOrArgInfo {
+ const NoTypeParamOrArg();
+
+ @override
+ Token parseArguments(Token token, Parser parser) {
+ parser.listener.handleNoTypeArguments(token.next);
+ return token;
+ }
+
+ @override
+ Token skip(Token token) => token;
+}
+
+class SimpleTypeArgument1 implements TypeParamOrArgInfo {
+ const SimpleTypeArgument1();
+
+ @override
+ Token parseArguments(Token token, Parser parser) {
+ BeginToken start = token = token.next;
+ assert(optional('<', token));
+ Listener listener = parser.listener;
+ listener.beginTypeArguments(token);
+ token = simpleType.parseType(token, parser);
+ Token next = token.next;
+
+ if (next == start.endGroup) {
+ parser.listener.endTypeArguments(1, start, next);
+ return next;
+ } else if (optional('>', next)) {
+ // When `>>` is split, the inner group's endGroup updated here.
+ start.endGroup = next;
+ parser.listener.endTypeArguments(1, start, next);
+ return next;
+ } else if (optional('>>', next)) {
+ parser.listener.endTypeArguments(1, start, next);
+ // In this case, the last consumed token is the token before `>>`.
+ return token;
+ } else {
+ throw "Internal error: Expected '>' or '>>' but found '$next'.";
+ }
+ }
+
+ @override
+ Token skip(Token token) {
+ token = token.next;
+ assert(token.endGroup != null ||
+ (optional('>', token.next.next) || optional('>>', token.next.next)));
+ return token.endGroup ??
+ (optional('>>', token.next.next) ? token.next : token.next.next);
+ }
+}
+
+class ComplexTypeParamOrArgInfo implements TypeParamOrArgInfo {
+ /// The first token in the type var.
+ final BeginToken start;
+
+ /// The last token in the group (typically `>`).
+ /// If a `>>` has not yet been split, then this field will be
+ /// `>>` for the outer group and the token before `>>` for the inner group.
+ Token end;
+
+ ComplexTypeParamOrArgInfo(Token token)
+ : assert(optional('<', token.next)),
+ start = token.next;
+
+ /// Parse the tokens and return the receiver or [noTypeParamOrArg] if there
+ /// are no type parameters or arguments. This does not modify the token
+ /// stream.
+ ///
+ /// If this group is enclosed and the outer group ends with `>>`, then
+ /// [endGroup] is set to either `>>` if the token has not been split
+ /// or the first `>` if the `>>` token has been split.
+ TypeParamOrArgInfo compute(Token endGroup) {
+ Token innerEndGroup;
+ if (start.endGroup != null && optional('>>', start.endGroup)) {
+ innerEndGroup = start.endGroup;
+ }
+
+ Token token;
+ Token next = start;
+ do {
+ TypeInfo typeInfo = computeType(next, true, innerEndGroup);
+ if (typeInfo == noType) {
+ // Recovery
+ while (typeInfo == noType && optional('@', next.next)) {
+ next = skipMetadata(next);
+ typeInfo = computeType(next, true, innerEndGroup);
+ }
+ if (typeInfo == noType && !optional(',', next.next)) {
+ token = next;
+ next = token.next;
+ break;
+ }
+ assert(typeInfo != noType || optional(',', next.next));
+ // Fall through to process type (if any) and consume `,`
+ }
+ token = typeInfo.skipType(next);
+ next = token.next;
+ } while (optional(',', next));
+
+ if (next == start.endGroup) {
+ end = next;
+ } else if (next == endGroup) {
+ assert(start.endGroup == null);
+ assert(optional('>', endGroup) || optional('>>', endGroup));
+ // If `>>`, then the end or last consumed token is the token before `>>`.
+ end = optional('>>', next) ? token : next;
+ } else {
+ return noTypeParamOrArg;
+ }
+ return this;
+ }
+
+ @override
+ Token parseArguments(Token token, Parser parser) {
+ assert(identical(start, token.next));
+
+ Token innerEndGroup;
+ if (start.endGroup != null && optional('>>', start.endGroup)) {
+ innerEndGroup = parser.rewriter.splitGtGt(start);
+ }
+
+ Token next = start;
+ parser.listener.beginTypeArguments(start);
+ int count = 0;
+ do {
+ TypeInfo typeInfo = computeType(next, true, innerEndGroup);
+ if (typeInfo == noType) {
+ // Recovery
+ while (typeInfo == noType && optional('@', next.next)) {
+ parser.reportRecoverableErrorWithToken(
+ next.next, fasta.templateUnexpectedToken);
+ next = skipMetadata(next);
+ typeInfo = computeType(next, true, innerEndGroup);
+ }
+ // Fall through to process type (if any) and consume `,`
+ }
+ token = typeInfo.ensureTypeOrVoid(next, parser);
+ next = token.next;
+ ++count;
+ } while (optional(',', next));
+
+ if (next == start.endGroup) {
+ end = next;
+ parser.listener.endTypeArguments(count, start, end);
+ return end;
+ } else if (optional('>', next)) {
+ // When `>>` is split, this method is recursively called
+ // and the inner group's endGroup updated here.
+ assert(start.endGroup == null);
+ end = start.endGroup = next;
+ parser.listener.endTypeArguments(count, start, end);
+ return end;
+ } else if (optional('>>', next)) {
+ // In this case, the end or last consumed token is the token before `>>`.
+ end = token;
+ parser.listener.endTypeArguments(count, start, next);
+ return end;
+ } else {
+ throw "Internal error: Expected '>' or '>>' but found '$next'.";
+ }
+ }
+
+ @override
+ Token skip(Token token) => end;
+}
diff --git a/pkg/front_end/lib/src/fasta/parser/util.dart b/pkg/front_end/lib/src/fasta/parser/util.dart
index 50dd955..7eb1f46 100644
--- a/pkg/front_end/lib/src/fasta/parser/util.dart
+++ b/pkg/front_end/lib/src/fasta/parser/util.dart
@@ -53,3 +53,26 @@
if (end == null) return lengthForToken(begin);
return end.offset + end.length - begin.offset;
}
+
+Token skipMetadata(Token token) {
+ token = token.next;
+ assert(optional('@', token));
+ Token next = token.next;
+ if (next.isIdentifier) {
+ token = next;
+ next = token.next;
+ while (optional('.', next)) {
+ token = next;
+ next = token.next;
+ if (next.isIdentifier) {
+ token = next;
+ next = token.next;
+ }
+ }
+ if (optional('(', next)) {
+ token = next.endGroup;
+ next = token.next;
+ }
+ }
+ return token;
+}
diff --git a/pkg/front_end/lib/src/fasta/scanner/string_scanner.dart b/pkg/front_end/lib/src/fasta/scanner/string_scanner.dart
index ee2d64b..7de4ef6 100644
--- a/pkg/front_end/lib/src/fasta/scanner/string_scanner.dart
+++ b/pkg/front_end/lib/src/fasta/scanner/string_scanner.dart
@@ -4,7 +4,7 @@
library dart2js.scanner.string_scanner;
-import '../../scanner/token.dart' show SyntheticStringToken, Token, TokenType;
+import '../../scanner/token.dart' show Token, SyntheticStringToken, TokenType;
import '../../scanner/token.dart' as analyzer show StringToken;
diff --git a/pkg/front_end/lib/src/fasta/scope.dart b/pkg/front_end/lib/src/fasta/scope.dart
index cdf9a9b..f6b3309 100644
--- a/pkg/front_end/lib/src/fasta/scope.dart
+++ b/pkg/front_end/lib/src/fasta/scope.dart
@@ -66,6 +66,11 @@
: this(<String, Builder>{}, null, parent, debugName,
isModifiable: isModifiable);
+ Scope copyWithParent(Scope parent, String debugName) {
+ return new Scope(super.local, super.setters, parent, debugName,
+ isModifiable: isModifiable);
+ }
+
/// Don't use this. Use [becomePartOf] instead.
void set local(_) => unsupported("local=", -1, null);
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 68b1941..3f9ee22 100644
--- a/pkg/front_end/lib/src/fasta/source/diet_listener.dart
+++ b/pkg/front_end/lib/src/fasta/source/diet_listener.dart
@@ -527,13 +527,9 @@
StackListener createListener(
ModifierBuilder builder, Scope memberScope, bool isInstanceMember,
[Scope formalParameterScope]) {
- InterfaceType thisType;
- if (builder.isClassMember) {
- // Note: we set thisType regardless of whether we are building a static
- // member, since that provides better error recovery.
- Class cls = builder.parent.target;
- thisType = cls.thisType;
- }
+ // Note: we set thisType regardless of whether we are building a static
+ // member, since that provides better error recovery.
+ InterfaceType thisType = currentClass?.target?.thisType;
var typeInferrer = library.disableTypeInference
? typeInferenceEngine.createDisabledTypeInferrer()
: typeInferenceEngine.createLocalTypeInferrer(uri, thisType, library);
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 6def2ba..25be339 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
@@ -109,9 +109,9 @@
bool canAddImplementationBuilders = false;
- SourceLibraryBuilder(SourceLoader loader, Uri fileUri)
+ SourceLibraryBuilder(SourceLoader loader, Uri fileUri, Scope scope)
: this.fromScopes(loader, fileUri, new DeclarationBuilder<T>.library(),
- new Scope.top());
+ scope ?? new Scope.top());
SourceLibraryBuilder.fromScopes(
this.loader, this.fileUri, this.libraryDeclaration, this.importScope)
@@ -652,7 +652,18 @@
}
void addImportsToScope() {
- super.addSpecificImportsToScope(imports);
+ bool explicitCoreImport = this == loader.coreLibrary;
+ for (Import import in imports) {
+ if (import.imported == loader.coreLibrary) {
+ explicitCoreImport = true;
+ }
+ import.finalizeImports(this);
+ }
+ if (!explicitCoreImport) {
+ loader.coreLibrary.exportScope.forEach((String name, Builder member) {
+ addToScope(name, member, -1, true);
+ });
+ }
}
@override
@@ -678,6 +689,8 @@
t.resolveIn(scope);
if (loader.target.strongMode) {
t.checkType();
+ } else {
+ t.normalizeType();
}
}
types.clear();
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 687a738..5419f26 100644
--- a/pkg/front_end/lib/src/fasta/source/source_loader.dart
+++ b/pkg/front_end/lib/src/fasta/source/source_loader.dart
@@ -12,10 +12,12 @@
show
Arguments,
Class,
+ Component,
Expression,
+ FunctionNode,
Library,
LibraryDependency,
- Component,
+ ProcedureKind,
Supertype;
import 'package:kernel/class_hierarchy.dart' show ClassHierarchy;
@@ -64,13 +66,17 @@
import '../kernel/kernel_shadow_ast.dart'
show ShadowClass, ShadowTypeInferenceEngine;
+import '../kernel/kernel_builder.dart' show KernelProcedureBuilder;
+
import '../kernel/kernel_target.dart' show KernelTarget;
+import '../kernel/body_builder.dart' show BodyBuilder;
+
import '../loader.dart' show Loader;
import '../parser/class_member_parser.dart' show ClassMemberParser;
-import '../parser.dart' show lengthForToken, offsetForToken;
+import '../parser.dart' show Parser, lengthForToken, offsetForToken;
import '../problems.dart' show internalProblem;
@@ -207,6 +213,37 @@
}
}
+ Future<Expression> buildExpression(
+ SourceLibraryBuilder library,
+ String enclosingClass,
+ bool isInstanceMember,
+ FunctionNode parameters) async {
+ Token token = await tokenize(library, suppressLexicalErrors: false);
+ if (token == null) return null;
+ DietListener dietListener = createDietListener(library);
+
+ Builder parent = library;
+ if (enclosingClass != null) {
+ Builder cls = dietListener.memberScope.lookup(enclosingClass, -1, null);
+ if (cls is ClassBuilder) {
+ parent = cls;
+ dietListener
+ ..currentClass = cls
+ ..memberScope = cls.scope.copyWithParent(
+ dietListener.memberScope.withTypeVariables(cls.typeVariables),
+ "debugExpression in $enclosingClass");
+ }
+ }
+ KernelProcedureBuilder builder = new KernelProcedureBuilder(null, 0, null,
+ "debugExpr", null, null, ProcedureKind.Method, library, 0, -1, -1)
+ ..parent = parent;
+ BodyBuilder listener = dietListener.createListener(
+ builder, dietListener.memberScope, isInstanceMember);
+
+ return listener.parseSingleExpression(
+ new Parser(listener), token, parameters);
+ }
+
KernelTarget get target => super.target;
DietListener createDietListener(LibraryBuilder library) {
@@ -348,11 +385,11 @@
ticker.logMs("Resolved $count constructors");
}
- void finishTypeVariables(ClassBuilder object) {
+ void finishTypeVariables(ClassBuilder object, TypeBuilder dynamicType) {
int count = 0;
builders.forEach((Uri uri, LibraryBuilder library) {
if (library.loader == this) {
- count += library.finishTypeVariables(object);
+ count += library.finishTypeVariables(object, dynamicType);
}
});
ticker.logMs("Resolved $count type-variable bounds");
@@ -360,8 +397,6 @@
void instantiateToBound(TypeBuilder dynamicType, TypeBuilder bottomType,
ClassBuilder objectClass) {
- if (!target.strongMode) return;
-
int count = 0;
builders.forEach((Uri uri, LibraryBuilder library) {
if (library.loader == this) {
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 d440748..938ad81 100644
--- a/pkg/front_end/lib/src/fasta/source/stack_listener.dart
+++ b/pkg/front_end/lib/src/fasta/source/stack_listener.dart
@@ -4,7 +4,7 @@
library fasta.stack_listener;
-import 'package:kernel/ast.dart' show AsyncMarker, Expression;
+import 'package:kernel/ast.dart' show AsyncMarker, Expression, FunctionNode;
import '../deprecated_problems.dart' show deprecated_inputError;
@@ -14,7 +14,7 @@
messageNativeClauseShouldBeAnnotation,
templateInternalProblemStackNotEmpty;
-import '../parser.dart' show Listener, MemberKind;
+import '../parser.dart' show Listener, MemberKind, Parser;
import '../parser/identifier_context.dart' show IdentifierContext;
@@ -96,6 +96,12 @@
// and ast_builder.dart.
void exitLocalScope() => unsupported("exitLocalScope", -1, uri);
+ // TODO(ahe): This doesn't belong here. Only implemented by body_builder.dart.
+ dynamic parseSingleExpression(
+ Parser parser, Token token, FunctionNode parameters) {
+ return unsupported("finishSingleExpression", -1, uri);
+ }
+
void push(Object node) {
if (node == null) unhandled("null", "push", -1, uri);
stack.push(node);
diff --git a/pkg/front_end/lib/src/fasta/target_implementation.dart b/pkg/front_end/lib/src/fasta/target_implementation.dart
index 2c21ecf..5abbd00 100644
--- a/pkg/front_end/lib/src/fasta/target_implementation.dart
+++ b/pkg/front_end/lib/src/fasta/target_implementation.dart
@@ -18,8 +18,6 @@
import 'uri_translator.dart' show UriTranslator;
-import 'kernel/metadata_collector.dart' show MetadataCollector;
-
/// Provides the implementation details used by a loader for a target.
abstract class TargetImplementation extends Target {
final UriTranslator uriTranslator;
@@ -35,13 +33,7 @@
Builder cachedNativeAnnotation;
Builder cachedNativeExtensionAnnotation;
- /// The [MetadataCollector] to write metadata to.
- ///
- /// Maybe be [null] for targets where metadata cannot be written.
- final MetadataCollector metadataCollector;
-
- TargetImplementation(Ticker ticker, this.uriTranslator, this.backendTarget,
- [this.metadataCollector = null])
+ TargetImplementation(Ticker ticker, this.uriTranslator, this.backendTarget)
: super(ticker);
/// Creates a [LibraryBuilder] corresponding to [uri], if one doesn't exist
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 d041aac..25e961f 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
@@ -798,14 +798,15 @@
}
}
- /// Populates [apiMembers] with a list of the implemented and inherited
- /// members of the given [class_]'s interface.
+ /// Populates [getters] and [setters] with the members of the given [class_]'s
+ /// interface.
///
- /// Members of the class's interface that need to be resolved later are
- /// represented by a [ForwardingNode] object.
- ///
- /// If [setters] is `true`, the list will be populated by setters; otherwise
- /// it will be populated by getters and methods.
+ /// [getters] will contain methods and getters, [setters] will contain
+ /// setters. Some members cannot be resolved immediately. For instance,
+ /// top-level type inference has not yet inferred field types based on
+ /// initializers and so we cannot yet do override based resolution of getters
+ /// and setters. Members of the class's interface that need to be resolved
+ /// later are represented by a [ForwardingNode] object.
void createApiMembers(Class class_, List<Member> getters,
List<Member> setters, LibraryBuilder library) {
var candidates = ClassHierarchy.mergeSortedLists(
@@ -816,112 +817,167 @@
setters.length = candidates.length;
int getterIndex = 0;
int setterIndex = 0;
- forEachApiMember(candidates, (int getterStart, int setterEnd, Name name) {
+ forEachApiMember(candidates, (int start, int end, Name name) {
// TODO(paulberry): check for illegal getter/method mixing
+ Procedure member = candidates[start];
+ ProcedureKind kind = _kindOf(member);
+ if (kind != ProcedureKind.Getter && kind != ProcedureKind.Setter) {
+ for (int i = start + 1; i < end; ++i) {
+ if (_kindOf(candidates[i]) != kind) {
+ // We've seen a getter or setter. If it's a getter conflicting
+ // with a method and both are declared in the same class, then that
+ // has already been signaled as a duplicated definition.
+ Procedure conflict = candidates[i];
+ if (conflict.enclosingClass != member.enclosingClass) {
+ if (member.enclosingClass == class_) {
+ library.addProblem(
+ messageDeclaredMemberConflictsWithInheritedMember,
+ member.fileOffset,
+ noLength,
+ member.fileUri,
+ context: [
+ messageDeclaredMemberConflictsWithInheritedMemberCause
+ .withLocation(
+ conflict.fileUri, conflict.fileOffset, noLength)
+ ]);
+ } else if (conflict.enclosingClass == class_) {
+ library.addProblem(
+ messageDeclaredMemberConflictsWithInheritedMember,
+ conflict.fileOffset,
+ noLength,
+ conflict.fileUri,
+ context: [
+ messageDeclaredMemberConflictsWithInheritedMemberCause
+ .withLocation(
+ member.fileUri, member.fileOffset, noLength)
+ ]);
+ } else {
+ library.addProblem(messageInheritedMembersConflict,
+ class_.fileOffset, noLength, class_.fileUri,
+ context: [
+ messageInheritedMembersConflictCause1.withLocation(
+ member.fileUri, member.fileOffset, noLength),
+ messageInheritedMembersConflictCause2.withLocation(
+ conflict.fileUri, conflict.fileOffset, noLength)
+ ]);
+ }
+ }
+ return;
+ }
+ }
+ if (strongMode &&
+ member.enclosingClass == class_ &&
+ _requiresTypeInference(member)) {
+ inferMethodType(library, class_, member, candidates, start + 1, end);
+ }
+ var forwardingNode = new ForwardingNode(
+ this, null, class_, name, kind, candidates, start, end);
+ getters[getterIndex++] = forwardingNode.finalize();
+ return;
+ }
Procedure declaredGetter;
- int i = getterStart;
- int inheritedGetterStart;
- int getterEnd;
- if (_kindOf(candidates[i]) == ProcedureKind.Setter) {
- inheritedGetterStart = i;
- } else {
- if (identical(candidates[i].enclosingClass, class_)) {
- declaredGetter = candidates[i++];
+ int inheritedGetterStart = start;
+ int getterEnd = start;
+ if (kind == ProcedureKind.Getter) {
+ if (member.enclosingClass == class_) {
+ declaredGetter = member;
+ ++inheritedGetterStart;
}
- inheritedGetterStart = i;
- while (
- i < setterEnd && _kindOf(candidates[i]) != ProcedureKind.Setter) {
- ++i;
+ while (++getterEnd < end) {
+ ProcedureKind currentKind = _kindOf(candidates[getterEnd]);
+ if (currentKind == ProcedureKind.Setter) break;
+ if (currentKind != ProcedureKind.Getter) {
+ Procedure conflict = candidates[getterEnd];
+ if (conflict.enclosingClass != member.enclosingClass) {
+ if (member.enclosingClass == class_) {
+ library.addProblem(
+ messageDeclaredMemberConflictsWithInheritedMember,
+ member.fileOffset,
+ noLength,
+ member.fileUri,
+ context: [
+ messageDeclaredMemberConflictsWithInheritedMemberCause
+ .withLocation(
+ conflict.fileUri, conflict.fileOffset, noLength)
+ ]);
+ } else {
+ library.addProblem(messageInheritedMembersConflict,
+ class_.fileOffset, noLength, class_.fileUri,
+ context: [
+ messageInheritedMembersConflictCause1.withLocation(
+ member.fileUri, member.fileOffset, noLength),
+ messageInheritedMembersConflictCause2.withLocation(
+ conflict.fileUri, conflict.fileOffset, noLength)
+ ]);
+ }
+ }
+ return;
+ }
}
}
- getterEnd = i;
+
Procedure declaredSetter;
- int inheritedSetterStart;
- if (i < setterEnd && identical(candidates[i].enclosingClass, class_)) {
- declaredSetter = candidates[i];
- inheritedSetterStart = i + 1;
- } else {
- inheritedSetterStart = i;
+ int inheritedSetterStart = getterEnd;
+ if (getterEnd < end) {
+ member = candidates[getterEnd];
+ if (member.enclosingClass == class_) {
+ declaredSetter = member;
+ ++inheritedSetterStart;
+ }
}
InferenceNode getterInferenceNode;
- if (getterStart < getterEnd) {
- if (_kindOf(candidates[getterStart]) == ProcedureKind.Getter) {
- // Member is a getter.
- if (declaredGetter != null) {
- getterInferenceNode = _createInferenceNode(
- class_,
- declaredGetter,
- candidates,
- inheritedGetterStart,
- getterEnd,
- inheritedSetterStart,
- setterEnd,
- library,
- class_.fileUri);
- }
- // Getters need to be resolved later, as part of type
- // inference, so just save the forwarding node for now.
- getters[getterIndex++] = new ForwardingNode(
- this,
- getterInferenceNode,
+ if (start < getterEnd) {
+ if (declaredGetter != null) {
+ getterInferenceNode = _createInferenceNode(
class_,
- name,
- _kindOf(candidates[getterStart]),
+ declaredGetter,
candidates,
- getterStart,
- getterEnd);
- } else {
- // Member is a method.
- if (strongMode &&
- declaredGetter != null &&
- _requiresTypeInference(declaredGetter)) {
- inferMethodType(library, class_, declaredGetter, candidates,
- inheritedGetterStart, getterEnd);
- }
- var forwardingNode = new ForwardingNode(
- this,
- null,
- class_,
- name,
- _kindOf(candidates[getterStart]),
- candidates,
- getterStart,
- getterEnd);
- // Methods and operators can be finalized immediately.
- getters[getterIndex++] = forwardingNode.finalize();
+ inheritedGetterStart,
+ getterEnd,
+ inheritedSetterStart,
+ end,
+ library,
+ class_.fileUri);
}
+ // Getters need to be resolved later, as part of type inference, so just
+ // save the forwarding node for now.
+ //
+ // Choose a representative to use for error reporting, such as if a
+ // class inherits this getter and tries to declare a method with the
+ // same name.
+ Member representative = candidates[start];
+ getters[getterIndex++] = new ForwardingNode(this, getterInferenceNode,
+ class_, name, ProcedureKind.Getter, candidates, start, getterEnd)
+ ..fileUri = representative.fileUri
+ ..fileOffset = representative.fileOffset
+ ..fileEndOffset = representative.fileEndOffset;
}
- if (getterEnd < setterEnd) {
+ if (getterEnd < end) {
InferenceNode setterInferenceNode;
if (declaredSetter != null) {
- if (declaredSetter is SyntheticAccessor) {
- setterInferenceNode = getterInferenceNode;
- } else {
- setterInferenceNode = _createInferenceNode(
- class_,
- declaredSetter,
- candidates,
- inheritedSetterStart,
- setterEnd,
- inheritedGetterStart,
- getterEnd,
- library,
- class_.fileUri);
- }
+ setterInferenceNode = declaredSetter is SyntheticAccessor
+ ? getterInferenceNode
+ : _createInferenceNode(
+ class_,
+ declaredSetter,
+ candidates,
+ inheritedSetterStart,
+ end,
+ inheritedGetterStart,
+ getterEnd,
+ library,
+ class_.fileUri);
}
- var forwardingNode = new ForwardingNode(
- this,
- setterInferenceNode,
- class_,
- name,
- ProcedureKind.Setter,
- candidates,
- getterEnd,
- setterEnd);
- // Setters need to be resolved later, as part of type
- // inference, so just save the forwarding node for now.
+ Member representative = candidates[getterEnd];
+ var forwardingNode = new ForwardingNode(this, setterInferenceNode,
+ class_, name, ProcedureKind.Setter, candidates, getterEnd, end)
+ ..fileUri = representative.fileUri
+ ..fileOffset = representative.fileOffset
+ ..fileEndOffset = representative.fileEndOffset;
+ // Setters need to be resolved later, as part of type inference, so just
+ // save the forwarding node for now.
setters[setterIndex++] = forwardingNode;
}
});
diff --git a/pkg/front_end/lib/src/testing/compiler_common.dart b/pkg/front_end/lib/src/testing/compiler_common.dart
index 0193e73..d09c4c6 100644
--- a/pkg/front_end/lib/src/testing/compiler_common.dart
+++ b/pkg/front_end/lib/src/testing/compiler_common.dart
@@ -17,7 +17,7 @@
import '../compute_platform_binaries_location.dart'
show computePlatformBinariesLocation;
-import '../testing/hybrid_file_system.dart' show HybridFileSystem;
+import '../fasta/hybrid_file_system.dart' show HybridFileSystem;
/// Generate kernel for a script.
///
diff --git a/pkg/front_end/messages.status b/pkg/front_end/messages.status
index 01a8aa0..692b8d5 100644
--- a/pkg/front_end/messages.status
+++ b/pkg/front_end/messages.status
@@ -80,6 +80,7 @@
CyclicClassHierarchy/example: Fail
CyclicTypedef/analyzerCode: Fail
CyclicTypedef/example: Fail
+DeclaredMemberConflictsWithInheritedMember/analyzerCode: Fail
DeferredAfterPrefix/example: Fail
DeferredPrefixDuplicated/analyzerCode: Fail
DeferredPrefixDuplicated/example: Fail
@@ -118,6 +119,8 @@
ExpectedClassMember/example: Fail
ExpectedDeclaration/example: Fail
ExpectedFunctionBody/example: Fail
+ExpectedOneExpression/analyzerCode: Fail
+ExpectedOneExpression/example: Fail
ExpectedOpenParens/analyzerCode: Fail
ExpectedOpenParens/example: Fail
ExpectedStatement/statement: Fail
@@ -189,6 +192,7 @@
ImportAfterPart/script1: Fail
ImportHidesImport/analyzerCode: Fail
ImportHidesImport/example: Fail
+InheritedMembersConflict/analyzerCode: Fail
InputFileNotFound/analyzerCode: Fail
InputFileNotFound/example: Fail
IntegerLiteralIsOutOfRange/example: Fail
@@ -411,4 +415,3 @@
UnterminatedToken/example: Fail
YieldAsIdentifier/example: Fail
YieldNotGenerator/example: Fail
-
diff --git a/pkg/front_end/messages.yaml b/pkg/front_end/messages.yaml
index bf341d7..932840e 100644
--- a/pkg/front_end/messages.yaml
+++ b/pkg/front_end/messages.yaml
@@ -1423,6 +1423,80 @@
template: "This is the type variable."
severity: CONTEXT
+DeclaredMemberConflictsWithInheritedMember:
+ template: "Can't declare a member that conflicts with an inherited one."
+ severity: ERROR_LEGACY_WARNING
+ script:
+ - >-
+ class A {
+ var foo;
+ }
+ class B extends A {
+ foo() {}
+ }
+ - >-
+ abstract class A {
+ get foo;
+ }
+ class B implements A {
+ foo() {}
+ }
+ - >-
+ class A {
+ foo() {}
+ }
+ class B extends A {
+ var foo;
+ }
+ - >-
+ abstract class A {
+ foo();
+ }
+ class B implements A {
+ var foo;
+ }
+
+DeclaredMemberConflictsWithInheritedMemberCause:
+ template: "This is the inherited member."
+ severity: CONTEXT
+
+InheritedMembersConflict:
+ template: "Can't inherit members that conflict with each other."
+ severity: ERROR_LEGACY_WARNING
+ script:
+ - >-
+ class A {
+ foo() {}
+ }
+ abstract class B {
+ get foo;
+ }
+ class C extends A implements B {}
+ - >-
+ class A {
+ var foo;
+ }
+ abstract class B {
+ foo();
+ }
+ class C extends A implements B {}
+ - >-
+ class A {
+ get foo => 0;
+ }
+ abstract class B {
+ foo();
+ }
+ class C extends A implements B {}
+
+InheritedMembersConflictCause1:
+ template: "This is one inherited member."
+ severity: CONTEXT
+
+InheritedMembersConflictCause2:
+ template: "This is the other inherited member."
+ severity: CONTEXT
+
IllegalMixin:
template: "The type '#name' can't be mixed in."
@@ -2103,3 +2177,7 @@
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."
severity: ERROR
+
+ExpectedOneExpression:
+ template: "Expected one expression, but found additional input."
+ severity: ERROR
diff --git a/pkg/front_end/test/fasta/expression_test.dart b/pkg/front_end/test/fasta/expression_test.dart
index 37741b9..4a21e78 100644
--- a/pkg/front_end/test/fasta/expression_test.dart
+++ b/pkg/front_end/test/fasta/expression_test.dart
@@ -11,12 +11,7 @@
import "dart:io" show File, IOSink;
import "package:kernel/ast.dart"
- show
- Procedure,
- Component,
- DynamicType,
- DartType,
- TypeParameter;
+ show Procedure, Component, DynamicType, DartType, TypeParameter;
import "package:testing/testing.dart"
show Chain, ChainContext, Result, Step, TestDescription, runMe;
@@ -41,7 +36,7 @@
import 'package:front_end/src/fasta/compiler_context.dart' show CompilerContext;
import 'package:front_end/src/fasta/incremental_compiler.dart'
- show IncrementalCompiler, IncrementalCompilationPosition;
+ show IncrementalCompiler;
import 'package:kernel/text/ast_to_text.dart' show Printer;
@@ -326,13 +321,13 @@
}
for (var compiler in [sourceCompiler, dillCompiler]) {
- IncrementalCompilationPosition enclosingNode =
- compiler.resolveCompilationPosition(test.library, test.className);
- Procedure compiledProcedure;
- if (enclosingNode != null) {
- compiledProcedure = await compiler.compileExpression(test.expression,
- definitions, typeParams, enclosingNode, test.isStaticMethod);
- }
+ Procedure compiledProcedure = await compiler.compileExpression(
+ test.expression,
+ definitions,
+ typeParams,
+ test.library,
+ test.className,
+ test.isStaticMethod);
var errors = context.takeErrors();
test.results.add(new CompilationResult(compiledProcedure, errors));
}
diff --git a/pkg/front_end/test/fasta/messages_test.dart b/pkg/front_end/test/fasta/messages_test.dart
index 279bc8a..16f96a5 100644
--- a/pkg/front_end/test/fasta/messages_test.dart
+++ b/pkg/front_end/test/fasta/messages_test.dart
@@ -29,7 +29,7 @@
import 'package:front_end/src/fasta/severity.dart'
show Severity, severityEnumValues;
-import 'package:front_end/src/testing/hybrid_file_system.dart'
+import 'package:front_end/src/fasta/hybrid_file_system.dart'
show HybridFileSystem;
import "../../tool/_fasta/entry_points.dart" show BatchCompiler;
diff --git a/pkg/front_end/test/fasta/parser/type_info_test.dart b/pkg/front_end/test/fasta/parser/type_info_test.dart
index d09b895..c0b27e8 100644
--- a/pkg/front_end/test/fasta/parser/type_info_test.dart
+++ b/pkg/front_end/test/fasta/parser/type_info_test.dart
@@ -4,6 +4,7 @@
import 'package:front_end/src/fasta/messages.dart';
import 'package:front_end/src/fasta/parser.dart';
+import 'package:front_end/src/fasta/parser/token_stream_rewriter.dart';
import 'package:front_end/src/fasta/parser/type_info.dart';
import 'package:front_end/src/fasta/parser/type_info_impl.dart';
import 'package:front_end/src/fasta/scanner.dart';
@@ -13,12 +14,13 @@
main() {
defineReflectiveSuite(() {
- defineReflectiveTests(TokenInfoTest);
+ defineReflectiveTests(TypeInfoTest);
+ defineReflectiveTests(TypeParamOrArgInfoTest);
});
}
@reflectiveTest
-class TokenInfoTest {
+class TypeInfoTest {
void test_noType() {
final Token start = scanString('before ;').tokens;
@@ -190,6 +192,7 @@
void test_simpleTypeArgumentsInfo() {
final Token start = scanString('before C<T> ;').tokens;
final Token expectedEnd = start.next.next.next.next;
+ expect(expectedEnd.lexeme, '>');
expect(simpleTypeWith1Argument.skipType(start), expectedEnd);
expect(simpleTypeWith1Argument.couldBeExpression, isFalse);
@@ -226,6 +229,47 @@
simpleTypeWith1Argument.parseType(start, new Parser(listener)));
}
+ void test_simpleTypeArgumentsInfo2() {
+ final Token start = scanString('before S<C<T>> ;').tokens.next.next;
+ expect(start.lexeme, '<');
+ final Token expectedEnd = start.next.next.next;
+ expect(expectedEnd.next.lexeme, '>>');
+
+ expect(simpleTypeWith1Argument.skipType(start), expectedEnd);
+ expect(simpleTypeWith1Argument.couldBeExpression, isFalse);
+
+ TypeInfoListener listener;
+ assertResult(Token actualEnd) {
+ expect(actualEnd, expectedEnd);
+ expect(listener.calls, [
+ 'handleIdentifier C typeReference',
+ 'beginTypeArguments <',
+ 'handleIdentifier T typeReference',
+ 'handleNoTypeArguments >>',
+ 'handleType T >>',
+ 'endTypeArguments 1 < >>',
+ 'handleType C >>',
+ ]);
+ expect(listener.errors, isNull);
+ }
+
+ listener = new TypeInfoListener();
+ assertResult(
+ simpleTypeWith1Argument.ensureTypeNotVoid(start, new Parser(listener)));
+
+ listener = new TypeInfoListener();
+ assertResult(
+ simpleTypeWith1Argument.ensureTypeOrVoid(start, new Parser(listener)));
+
+ listener = new TypeInfoListener();
+ assertResult(
+ simpleTypeWith1Argument.parseTypeNotVoid(start, new Parser(listener)));
+
+ listener = new TypeInfoListener();
+ assertResult(
+ simpleTypeWith1Argument.parseType(start, new Parser(listener)));
+ }
+
void test_computeType_basic() {
expectInfo(noType, '');
expectInfo(noType, ';');
@@ -520,21 +564,23 @@
// TOOD(danrubel): dynamic, do, other keywords, malformed, recovery
// <T>
- expectComplexInfo('G<int double> g',
- required: true,
- tokenAfter: 'g',
- expectedCalls: [
- 'handleIdentifier G typeReference',
- 'beginTypeArguments <',
- 'handleIdentifier int typeReference',
- 'handleNoTypeArguments double',
- 'handleType int double',
- 'endTypeArguments 1 < >',
- 'handleType G g',
- ],
- expectedErrors: [
- error(codeExpectedToken, 6, 6)
- ]);
+ // TODO(danrubel): Improve missing comma recovery
+ expectTypeParamOrArg(noTypeParamOrArg, 'G<int double> g');
+ // expectComplexInfo('G<int double> g',
+ // required: true,
+ // tokenAfter: 'g',
+ // expectedCalls: [
+ // 'handleIdentifier G typeReference',
+ // 'beginTypeArguments <',
+ // 'handleIdentifier int typeReference',
+ // 'handleNoTypeArguments double',
+ // 'handleType int double',
+ // 'endTypeArguments 1 < >',
+ // 'handleType G g',
+ // ],
+ // expectedErrors: [
+ // error(codeExpectedToken, 6, 6)
+ // ]);
expectInfo(noType, 'C<>', required: false);
expectComplexInfo('C<>', required: true, expectedCalls: [
@@ -542,7 +588,7 @@
'beginTypeArguments <',
'handleIdentifier typeReference',
'handleNoTypeArguments >',
- 'handleType > >',
+ 'handleType >',
'endTypeArguments 1 < >',
'handleType C ',
], expectedErrors: [
@@ -553,7 +599,7 @@
'beginTypeArguments <',
'handleIdentifier typeReference',
'handleNoTypeArguments >',
- 'handleType > >',
+ 'handleType >',
'endTypeArguments 1 < >',
'handleType C f',
], expectedErrors: [
@@ -565,6 +611,23 @@
expectInfo(noType, 'C<T && T>U;', required: false);
}
+ void test_computeType_nested() {
+ expectNestedInfo(simpleType, '<T>');
+ expectNestedInfo(simpleTypeWith1Argument, '<T<S>>');
+ expectNestedComplexInfo('<T<S,R>>');
+ expectNestedComplexInfo('<T<S Function()>>');
+ expectNestedComplexInfo('<T<S Function()>>');
+ }
+
+ void test_computeType_nested_recovery() {
+ expectNestedInfo(noType, '<>');
+ expectNestedInfo(noType, '<3>');
+ expectNestedInfo(noType, '<,T>');
+ expectNestedInfo(simpleType, '<T,>');
+ expectNestedInfo(noType, '<,T<S>>');
+ expectNestedInfo(simpleTypeWith1Argument, '<T<S>,>');
+ }
+
void test_computeType_prefixed() {
expectInfo(noType, 'C.a', required: false);
expectInfo(noType, 'C.a;', required: false);
@@ -589,6 +652,20 @@
expectInfo(prefixedType, 'C.a Function');
}
+ void test_computeType_prefixedComplex() {
+ expectComplexInfo('a < b, c > d', tokenAfter: 'd');
+ expectComplexInfo('a < b, c > d', tokenAfter: 'd');
+
+ expectComplexInfo('a < p.b, c > d', tokenAfter: 'd');
+ expectComplexInfo('a < b, p.c > d', tokenAfter: 'd');
+
+ expectInfo(noType, 'a < p.q.b, c > d', required: false);
+ expectInfo(noType, 'a < b, p.q.c > d', required: false);
+
+ expectInfo(simpleType, 'a < p.q.b, c > d', required: true);
+ expectInfo(simpleType, 'a < b, p.q.c > d', required: true);
+ }
+
void test_computeType_prefixedGFT() {
expectComplexInfo('C.a Function(', // Scanner inserts synthetic ')'.
required: true,
@@ -752,6 +829,255 @@
}
}
+@reflectiveTest
+class TypeParamOrArgInfoTest {
+ void test_noTypeParamOrArg() {
+ final Token start = scanString('before after').tokens;
+
+ expect(noTypeParamOrArg.skip(start), start);
+ }
+
+ void test_noTypeParamOrArg_parseArguments() {
+ final Token start = scanString('before after').tokens;
+ final TypeInfoListener listener = new TypeInfoListener();
+
+ expect(noTypeParamOrArg.parseArguments(start, new Parser(listener)), start);
+ expect(listener.calls, ['handleNoTypeArguments after']);
+ expect(listener.errors, isNull);
+ }
+
+ void test_simple_skip() {
+ final Token start = scanString('before <T> after').tokens;
+ final Token gt = start.next.next.next;
+ expect(gt.lexeme, '>');
+
+ expect(simpleTypeArgument1.skip(start), gt);
+ }
+
+ void test_simple_skip2() {
+ final Token start = scanString('before <S<T>> after').tokens.next.next;
+ Token t = start.next.next;
+ expect(t.next.lexeme, '>>');
+
+ expect(simpleTypeArgument1.skip(start), t);
+ }
+
+ void test_simple_parseArguments() {
+ final Token start = scanString('before <T> after').tokens;
+ final Token gt = start.next.next.next;
+ expect(gt.lexeme, '>');
+ final TypeInfoListener listener = new TypeInfoListener();
+
+ expect(simpleTypeArgument1.parseArguments(start, new Parser(listener)), gt);
+ expect(listener.calls, [
+ 'beginTypeArguments <',
+ 'handleIdentifier T typeReference',
+ 'handleNoTypeArguments >',
+ 'handleType T >',
+ 'endTypeArguments 1 < >'
+ ]);
+ expect(listener.errors, isNull);
+ }
+
+ void test_simple_parseArguments2() {
+ final Token start = scanString('before <S<T>> after').tokens.next.next;
+ Token t = start.next.next;
+ expect(t.next.lexeme, '>>');
+ final TypeInfoListener listener = new TypeInfoListener();
+
+ expect(simpleTypeArgument1.parseArguments(start, new Parser(listener)), t);
+ expect(listener.calls, [
+ 'beginTypeArguments <',
+ 'handleIdentifier T typeReference',
+ 'handleNoTypeArguments >>',
+ 'handleType T >>',
+ 'endTypeArguments 1 < >>'
+ ]);
+ expect(listener.errors, isNull);
+ }
+
+ void test_computeTypeParamOrArg_basic() {
+ expectTypeParamOrArg(noTypeParamOrArg, '');
+ expectTypeParamOrArg(noTypeParamOrArg, 'a');
+ expectTypeParamOrArg(noTypeParamOrArg, 'a b');
+ expectTypeParamOrArg(noTypeParamOrArg, '<');
+ expectTypeParamOrArg(noTypeParamOrArg, '< b');
+ expectTypeParamOrArg(noTypeParamOrArg, '< 3 >');
+ }
+
+ void test_computeTypeParamOrArg_simple() {
+ expectTypeParamOrArg(simpleTypeArgument1, '<T>');
+ }
+
+ void test_computeTypeParamOrArg_simple_nested() {
+ String source = '<C<T>>';
+ Token start = scan(source).next.next;
+ expect(start.lexeme, 'C');
+ Token gtgt = start.next.next.next;
+ expect(gtgt.lexeme, '>>');
+
+ TypeParamOrArgInfo typeVarInfo = computeTypeParamOrArg(start, gtgt);
+ expect(typeVarInfo, simpleTypeArgument1, reason: source);
+ }
+
+ void test_computeTypeVar_complex() {
+ expectComplexTypeParamOrArg('<S,T>', expectedCalls: [
+ 'beginTypeArguments <',
+ 'handleIdentifier S typeReference',
+ 'handleNoTypeArguments ,',
+ 'handleType S ,',
+ 'handleIdentifier T typeReference',
+ 'handleNoTypeArguments >',
+ 'handleType T >',
+ 'endTypeArguments 2 < >'
+ ]);
+ expectComplexTypeParamOrArg('<S Function()>', expectedCalls: [
+ 'beginTypeArguments <',
+ 'handleNoTypeVariables (',
+ 'beginFunctionType S',
+ 'handleIdentifier S typeReference',
+ 'handleNoTypeArguments Function',
+ 'handleType S Function',
+ 'beginFormalParameters ( MemberKind.GeneralizedFunctionType',
+ 'endFormalParameters 0 ( ) MemberKind.GeneralizedFunctionType',
+ 'endFunctionType Function >',
+ 'endTypeArguments 1 < >'
+ ]);
+ expectComplexTypeParamOrArg('<void Function()>', expectedCalls: [
+ 'beginTypeArguments <',
+ 'handleNoTypeVariables (',
+ 'beginFunctionType void',
+ 'handleVoidKeyword void',
+ 'beginFormalParameters ( MemberKind.GeneralizedFunctionType',
+ 'endFormalParameters 0 ( ) MemberKind.GeneralizedFunctionType',
+ 'endFunctionType Function >',
+ 'endTypeArguments 1 < >'
+ ]);
+ expectComplexTypeParamOrArg('<S<T>>', expectedCalls: [
+ 'beginTypeArguments <',
+ 'handleIdentifier S typeReference',
+ 'beginTypeArguments <',
+ 'handleIdentifier T typeReference',
+ 'handleNoTypeArguments >',
+ 'handleType T >',
+ 'endTypeArguments 1 < >',
+ 'handleType S >',
+ 'endTypeArguments 1 < >'
+ ]);
+ expectComplexTypeParamOrArg('<S<T>>', splitGtGt: false, expectedCalls: [
+ 'beginTypeArguments <',
+ 'handleIdentifier S typeReference',
+ 'beginTypeArguments <',
+ 'handleIdentifier T typeReference',
+ 'handleNoTypeArguments >>',
+ 'handleType T >>',
+ 'endTypeArguments 1 < >>',
+ 'handleType S >>',
+ 'endTypeArguments 1 < >>'
+ ]);
+ expectComplexTypeParamOrArg('<S<Function()>>', expectedCalls: [
+ 'beginTypeArguments <',
+ 'handleIdentifier S typeReference',
+ 'beginTypeArguments <',
+ 'handleNoTypeVariables (',
+ 'beginFunctionType Function',
+ 'handleNoType <',
+ 'beginFormalParameters ( MemberKind.GeneralizedFunctionType',
+ 'endFormalParameters 0 ( ) MemberKind.GeneralizedFunctionType',
+ 'endFunctionType Function >',
+ 'endTypeArguments 1 < >',
+ 'handleType S >',
+ 'endTypeArguments 1 < >'
+ ]);
+ expectComplexTypeParamOrArg('<S<Function()>>',
+ splitGtGt: false,
+ expectedCalls: [
+ 'beginTypeArguments <',
+ 'handleIdentifier S typeReference',
+ 'beginTypeArguments <',
+ 'handleNoTypeVariables (',
+ 'beginFunctionType Function',
+ 'handleNoType <',
+ 'beginFormalParameters ( MemberKind.GeneralizedFunctionType',
+ 'endFormalParameters 0 ( ) MemberKind.GeneralizedFunctionType',
+ 'endFunctionType Function >>',
+ 'endTypeArguments 1 < >>',
+ 'handleType S >>',
+ 'endTypeArguments 1 < >>'
+ ]);
+ expectComplexTypeParamOrArg('<S<void Function()>>', expectedCalls: [
+ 'beginTypeArguments <',
+ 'handleIdentifier S typeReference',
+ 'beginTypeArguments <',
+ 'handleNoTypeVariables (',
+ 'beginFunctionType void', // was 'beginFunctionType Function'
+ 'handleVoidKeyword void', // was 'handleNoType <'
+ 'beginFormalParameters ( MemberKind.GeneralizedFunctionType',
+ 'endFormalParameters 0 ( ) MemberKind.GeneralizedFunctionType',
+ 'endFunctionType Function >',
+ 'endTypeArguments 1 < >',
+ 'handleType S >',
+ 'endTypeArguments 1 < >'
+ ]);
+ expectComplexTypeParamOrArg('<S<void Function()>>',
+ splitGtGt: false,
+ expectedCalls: [
+ 'beginTypeArguments <',
+ 'handleIdentifier S typeReference',
+ 'beginTypeArguments <',
+ 'handleNoTypeVariables (',
+ 'beginFunctionType void', // was 'beginFunctionType Function'
+ 'handleVoidKeyword void', // was 'handleNoType <'
+ 'beginFormalParameters ( MemberKind.GeneralizedFunctionType',
+ 'endFormalParameters 0 ( ) MemberKind.GeneralizedFunctionType',
+ 'endFunctionType Function >>',
+ 'endTypeArguments 1 < >>',
+ 'handleType S >>',
+ 'endTypeArguments 1 < >>'
+ ]);
+ }
+
+ void test_computeTypeVar_complex_recovery() {
+ expectComplexTypeParamOrArg('<@A S,T>', expectedErrors: [
+ error(codeUnexpectedToken, 1, 1)
+ ], expectedCalls: [
+ 'beginTypeArguments <',
+ 'handleIdentifier S typeReference',
+ 'handleNoTypeArguments ,',
+ 'handleType S ,',
+ 'handleIdentifier T typeReference',
+ 'handleNoTypeArguments >',
+ 'handleType T >',
+ 'endTypeArguments 2 < >'
+ ]);
+ expectComplexTypeParamOrArg('<@A() S,T>', expectedErrors: [
+ error(codeUnexpectedToken, 1, 1)
+ ], expectedCalls: [
+ 'beginTypeArguments <',
+ 'handleIdentifier S typeReference',
+ 'handleNoTypeArguments ,',
+ 'handleType S ,',
+ 'handleIdentifier T typeReference',
+ 'handleNoTypeArguments >',
+ 'handleType T >',
+ 'endTypeArguments 2 < >'
+ ]);
+ expectComplexTypeParamOrArg('<@A() @B S,T>', expectedErrors: [
+ error(codeUnexpectedToken, 1, 1),
+ error(codeUnexpectedToken, 6, 1),
+ ], expectedCalls: [
+ 'beginTypeArguments <',
+ 'handleIdentifier S typeReference',
+ 'handleNoTypeArguments ,',
+ 'handleType S ,',
+ 'handleIdentifier T typeReference',
+ 'handleNoTypeArguments >',
+ 'handleType T >',
+ 'endTypeArguments 2 < >'
+ ]);
+ }
+}
+
void expectInfo(expectedInfo, String source,
{bool required,
String expectedAfter,
@@ -782,6 +1108,28 @@
expectedErrors: expectedErrors);
}
+void expectNestedInfo(expectedInfo, String source,
+ {List<String> expectedCalls, List<ExpectedError> expectedErrors}) {
+ expect(source.startsWith('<'), isTrue);
+ Token start = scan(source).next;
+ Token innerEndGroup = start;
+ while (!innerEndGroup.next.isEof) {
+ innerEndGroup = innerEndGroup.next;
+ }
+ if (!optional('>>', innerEndGroup)) {
+ innerEndGroup = null;
+ }
+ compute(expectedInfo, source, start, true, innerEndGroup != null ? '>>' : '>',
+ expectedCalls, expectedErrors,
+ innerEndGroup: innerEndGroup);
+}
+
+void expectNestedComplexInfo(String source,
+ {List<String> expectedCalls, List<ExpectedError> expectedErrors}) {
+ expectNestedInfo(const isInstanceOf<ComplexTypeInfo>(), source,
+ expectedCalls: expectedCalls, expectedErrors: expectedErrors);
+}
+
void compute(
expectedInfo,
String source,
@@ -789,13 +1137,20 @@
bool required,
String expectedAfter,
List<String> expectedCalls,
- List<ExpectedError> expectedErrors) {
- TypeInfo typeInfo = computeType(start, required);
+ List<ExpectedError> expectedErrors,
+ {Token innerEndGroup}) {
+ int expectedGtGtAndNullEndCount = countGtGtAndNullEnd(start);
+ TypeInfo typeInfo = computeType(start, required, innerEndGroup);
expect(typeInfo, expectedInfo, reason: source);
+ expect(countGtGtAndNullEnd(start), expectedGtGtAndNullEndCount,
+ reason: 'computeType should not modify the token stream');
+
if (typeInfo is ComplexTypeInfo) {
expect(typeInfo.start, start.next, reason: source);
expect(typeInfo.couldBeExpression, isFalse);
expectEnd(expectedAfter, typeInfo.skipType(start));
+ expect(countGtGtAndNullEnd(start), expectedGtGtAndNullEndCount,
+ reason: 'TypeInfo.skipType should not modify the token stream');
TypeInfoListener listener;
assertResult(Token actualEnd) {
@@ -817,7 +1172,80 @@
listener = new TypeInfoListener();
assertResult(typeInfo.parseType(start, new Parser(listener)));
} else {
- assert(expectedErrors == null);
+ expect(expectedErrors, isNull);
+ }
+}
+
+void expectComplexTypeParamOrArg(String source,
+ {bool splitGtGt: true,
+ String tokenAfter,
+ List<String> expectedCalls,
+ List<ExpectedError> expectedErrors}) {
+ expectTypeParamOrArg(const isInstanceOf<ComplexTypeParamOrArgInfo>(), source,
+ splitGtGt: splitGtGt,
+ expectedAfter: tokenAfter,
+ expectedCalls: expectedCalls,
+ expectedErrors: expectedErrors);
+}
+
+void expectTypeParamOrArg(expectedInfo, String source,
+ {bool splitGtGt: true,
+ String expectedAfter,
+ List<String> expectedCalls,
+ List<ExpectedError> expectedErrors}) {
+ Token start = scan(source);
+ computeVar(expectedInfo, source, start, splitGtGt, expectedAfter,
+ expectedCalls, expectedErrors);
+}
+
+void computeVar(
+ expectedInfo,
+ String source,
+ Token start,
+ bool splitGtGt,
+ String expectedAfter,
+ List<String> expectedCalls,
+ List<ExpectedError> expectedErrors) {
+ int expectedGtGtAndNullEndCount = countGtGtAndNullEnd(start);
+ TypeParamOrArgInfo typeVarInfo = computeTypeParamOrArg(start);
+ expect(typeVarInfo, expectedInfo, reason: source);
+ expect(countGtGtAndNullEnd(start), expectedGtGtAndNullEndCount,
+ reason: 'computeTypeParamOrArg should not modify the token stream');
+
+ if (typeVarInfo is ComplexTypeParamOrArgInfo) {
+ expect(typeVarInfo.start, start.next, reason: source);
+ expectEnd(expectedAfter, typeVarInfo.skip(start));
+ expect(countGtGtAndNullEnd(start), expectedGtGtAndNullEndCount,
+ reason: 'TypeParamOrArgInfo.skipType'
+ ' should not modify the token stream');
+
+ TypeInfoListener listener = new TypeInfoListener();
+ Parser parser = new Parser(listener);
+ if (!splitGtGt) {
+ parser.cachedRewriter = new TokenStreamNonRewriter();
+ }
+ Token actualEnd = typeVarInfo.parseArguments(start, parser);
+ expectEnd(expectedAfter, actualEnd);
+ if (!splitGtGt) {
+ expect(countGtGtAndNullEnd(start), expectedGtGtAndNullEndCount,
+ reason: 'TypeParamOrArgInfo.parseArguments'
+ ' should not modify the token stream');
+ }
+
+ if (expectedCalls != null) {
+ // TypeInfoListener listener2 = new TypeInfoListener();
+ // new Parser(listener2).parseTypeArgumentsOpt(start);
+ // print('[');
+ // for (String call in listener2.calls) {
+ // print("'$call',");
+ // }
+ // print(']');
+
+ expect(listener.calls, expectedCalls, reason: source);
+ }
+ expect(listener.errors, expectedErrors, reason: source);
+ } else {
+ expect(expectedErrors, isNull);
}
}
@@ -838,6 +1266,18 @@
return new SyntheticToken(TokenType.EOF, 0)..setNext(start);
}
+int countGtGtAndNullEnd(Token token) {
+ int count = 0;
+ while (!token.isEof) {
+ if ((optional('<', token) && token.endGroup == null) ||
+ optional('>>', token)) {
+ ++count;
+ }
+ token = token.next;
+ }
+ return count;
+}
+
class TypeInfoListener implements Listener {
List<String> calls = <String>[];
List<ExpectedError> errors;
@@ -994,3 +1434,15 @@
@override
String toString() => 'error(${code.name}, $start, $length)';
}
+
+class TokenStreamNonRewriter implements TokenStreamRewriter {
+ @override
+ Token splitGtGt(BeginToken start) {
+ Token gtgt = start.endGroup;
+ assert(gtgt != null);
+ assert(optional('>>', gtgt));
+ return gtgt;
+ }
+
+ noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation);
+}
diff --git a/pkg/front_end/test/src/incremental/hot_reload_e2e_test.dart b/pkg/front_end/test/src/incremental/hot_reload_e2e_test.dart
index 9ad0d40..023efa7 100644
--- a/pkg/front_end/test/src/incremental/hot_reload_e2e_test.dart
+++ b/pkg/front_end/test/src/incremental/hot_reload_e2e_test.dart
@@ -36,7 +36,7 @@
import 'package:front_end/src/compute_platform_binaries_location.dart'
show computePlatformBinariesLocation;
-import 'package:front_end/src/testing/hybrid_file_system.dart'
+import 'package:front_end/src/fasta/hybrid_file_system.dart'
show HybridFileSystem;
import '../../tool/reload.dart' show RemoteVm;
diff --git a/pkg/front_end/test/subpackage_relationships_test.dart b/pkg/front_end/test/subpackage_relationships_test.dart
index 4ce0e7b..bcf7288 100644
--- a/pkg/front_end/test/subpackage_relationships_test.dart
+++ b/pkg/front_end/test/subpackage_relationships_test.dart
@@ -76,7 +76,6 @@
'lib/src/fasta/scanner',
'lib/src/fasta/source',
'lib/src/fasta/util',
- 'lib/src/fasta/type_inference',
'lib/src/scanner',
]),
'lib/src/fasta/builder': new SubpackageRules(allowedDependencies: [
@@ -162,6 +161,7 @@
'lib/src/testing': new SubpackageRules(allowedDependencies: [
'lib/src',
'lib/src/api_prototype',
+ 'lib/src/fasta',
]),
};
diff --git a/pkg/front_end/testcases/arrow_function.dart.direct.expect b/pkg/front_end/testcases/arrow_function.dart.direct.expect
index ec2e898..fd2c981 100644
--- a/pkg/front_end/testcases/arrow_function.dart.direct.expect
+++ b/pkg/front_end/testcases/arrow_function.dart.direct.expect
@@ -2,5 +2,5 @@
import self as self;
import "dart:core" as core;
-static method main<T extends core::Object>() → dynamic
+static method main<T extends core::Object = dynamic>() → dynamic
return () → dynamic => self::main::T;
diff --git a/pkg/front_end/testcases/arrow_function.dart.direct.transformed.expect b/pkg/front_end/testcases/arrow_function.dart.direct.transformed.expect
index ec2e898..fd2c981 100644
--- a/pkg/front_end/testcases/arrow_function.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/arrow_function.dart.direct.transformed.expect
@@ -2,5 +2,5 @@
import self as self;
import "dart:core" as core;
-static method main<T extends core::Object>() → dynamic
+static method main<T extends core::Object = dynamic>() → dynamic
return () → dynamic => self::main::T;
diff --git a/pkg/front_end/testcases/arrow_function.dart.outline.expect b/pkg/front_end/testcases/arrow_function.dart.outline.expect
index 8304bc1..ebd9bdd 100644
--- a/pkg/front_end/testcases/arrow_function.dart.outline.expect
+++ b/pkg/front_end/testcases/arrow_function.dart.outline.expect
@@ -2,5 +2,5 @@
import self as self;
import "dart:core" as core;
-static method main<T extends core::Object>() → dynamic
+static method main<T extends core::Object = dynamic>() → dynamic
;
diff --git a/pkg/front_end/testcases/arrow_function.dart.strong.expect b/pkg/front_end/testcases/arrow_function.dart.strong.expect
index 4cea2f2..b1e02d2 100644
--- a/pkg/front_end/testcases/arrow_function.dart.strong.expect
+++ b/pkg/front_end/testcases/arrow_function.dart.strong.expect
@@ -2,5 +2,5 @@
import self as self;
import "dart:core" as core;
-static method main<T extends core::Object>() → dynamic
+static method main<T extends core::Object = dynamic>() → dynamic
return () → core::Type => self::main::T;
diff --git a/pkg/front_end/testcases/arrow_function.dart.strong.transformed.expect b/pkg/front_end/testcases/arrow_function.dart.strong.transformed.expect
index 4cea2f2..b1e02d2 100644
--- a/pkg/front_end/testcases/arrow_function.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/arrow_function.dart.strong.transformed.expect
@@ -2,5 +2,5 @@
import self as self;
import "dart:core" as core;
-static method main<T extends core::Object>() → dynamic
+static method main<T extends core::Object = dynamic>() → dynamic
return () → core::Type => self::main::T;
diff --git a/pkg/front_end/testcases/bug30695.dart.strong.expect b/pkg/front_end/testcases/bug30695.dart.strong.expect
index 618721b..f784954 100644
--- a/pkg/front_end/testcases/bug30695.dart.strong.expect
+++ b/pkg/front_end/testcases/bug30695.dart.strong.expect
@@ -15,4 +15,7 @@
method foo() → dynamic
return 42;
}
+static const field dynamic #errors = const <dynamic>["pkg/front_end/testcases/bug30695.dart:11:3: Error: Can't declare a member that conflicts with an inherited one.
+ foo() => 42;
+ ^"]/* from null */;
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/bug32629.dart.direct.expect b/pkg/front_end/testcases/bug32629.dart.direct.expect
index 1f4307c..2269f15 100644
--- a/pkg/front_end/testcases/bug32629.dart.direct.expect
+++ b/pkg/front_end/testcases/bug32629.dart.direct.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-typedef Reducer<S extends core::Object> = (S, dynamic) → S;
+typedef Reducer<S extends core::Object = dynamic> = (S, dynamic) → S;
class A extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
@@ -11,7 +11,7 @@
return a;
}
}
-static method foo<S extends core::Object>((self::foo::S, dynamic) → self::foo::S v) → void {}
+static method foo<S extends core::Object = dynamic>((self::foo::S, dynamic) → self::foo::S v) → void {}
static method main() → void {
self::foo<core::String>(new self::A::•());
}
diff --git a/pkg/front_end/testcases/bug32629.dart.direct.transformed.expect b/pkg/front_end/testcases/bug32629.dart.direct.transformed.expect
index 1f4307c..2269f15 100644
--- a/pkg/front_end/testcases/bug32629.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/bug32629.dart.direct.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-typedef Reducer<S extends core::Object> = (S, dynamic) → S;
+typedef Reducer<S extends core::Object = dynamic> = (S, dynamic) → S;
class A extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
@@ -11,7 +11,7 @@
return a;
}
}
-static method foo<S extends core::Object>((self::foo::S, dynamic) → self::foo::S v) → void {}
+static method foo<S extends core::Object = dynamic>((self::foo::S, dynamic) → self::foo::S v) → void {}
static method main() → void {
self::foo<core::String>(new self::A::•());
}
diff --git a/pkg/front_end/testcases/bug32629.dart.outline.expect b/pkg/front_end/testcases/bug32629.dart.outline.expect
index d37f8be..fd95657 100644
--- a/pkg/front_end/testcases/bug32629.dart.outline.expect
+++ b/pkg/front_end/testcases/bug32629.dart.outline.expect
@@ -2,14 +2,14 @@
import self as self;
import "dart:core" as core;
-typedef Reducer<S extends core::Object> = (S, dynamic) → S;
+typedef Reducer<S extends core::Object = dynamic> = (S, dynamic) → S;
class A extends core::Object {
synthetic constructor •() → void
;
method call(dynamic a, dynamic b) → dynamic
;
}
-static method foo<S extends core::Object>((self::foo::S, dynamic) → self::foo::S v) → void
+static method foo<S extends core::Object = dynamic>((self::foo::S, dynamic) → self::foo::S v) → void
;
static method main() → void
;
diff --git a/pkg/front_end/testcases/covariant_generic.dart.direct.expect b/pkg/front_end/testcases/covariant_generic.dart.direct.expect
index 6c077b6..7070b05 100644
--- a/pkg/front_end/testcases/covariant_generic.dart.direct.expect
+++ b/pkg/front_end/testcases/covariant_generic.dart.direct.expect
@@ -2,8 +2,8 @@
import self as self;
import "dart:core" as core;
-typedef Callback<T extends core::Object> = (T) → void;
-class Foo<T extends core::Object> extends core::Object {
+typedef Callback<T extends core::Object = dynamic> = (T) → void;
+class Foo<T extends core::Object = dynamic> extends core::Object {
final field self::Foo::T finalField;
final field (self::Foo::T) → void callbackField;
field self::Foo::T mutableField = null;
diff --git a/pkg/front_end/testcases/covariant_generic.dart.direct.transformed.expect b/pkg/front_end/testcases/covariant_generic.dart.direct.transformed.expect
index 6c077b6..7070b05 100644
--- a/pkg/front_end/testcases/covariant_generic.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/covariant_generic.dart.direct.transformed.expect
@@ -2,8 +2,8 @@
import self as self;
import "dart:core" as core;
-typedef Callback<T extends core::Object> = (T) → void;
-class Foo<T extends core::Object> extends core::Object {
+typedef Callback<T extends core::Object = dynamic> = (T) → void;
+class Foo<T extends core::Object = dynamic> extends core::Object {
final field self::Foo::T finalField;
final field (self::Foo::T) → void callbackField;
field self::Foo::T mutableField = null;
diff --git a/pkg/front_end/testcases/covariant_generic.dart.outline.expect b/pkg/front_end/testcases/covariant_generic.dart.outline.expect
index e0c1173..ca50348 100644
--- a/pkg/front_end/testcases/covariant_generic.dart.outline.expect
+++ b/pkg/front_end/testcases/covariant_generic.dart.outline.expect
@@ -2,8 +2,8 @@
import self as self;
import "dart:core" as core;
-typedef Callback<T extends core::Object> = (T) → void;
-class Foo<T extends core::Object> extends core::Object {
+typedef Callback<T extends core::Object = dynamic> = (T) → void;
+class Foo<T extends core::Object = dynamic> extends core::Object {
final field self::Foo::T finalField;
final field (self::Foo::T) → void callbackField;
field self::Foo::T mutableField;
diff --git a/pkg/front_end/testcases/expression/invalid.expression.yaml.expect b/pkg/front_end/testcases/expression/invalid.expression.yaml.expect
index 1ce824d..1e3cd80 100644
--- a/pkg/front_end/testcases/expression/invalid.expression.yaml.expect
+++ b/pkg/front_end/testcases/expression/invalid.expression.yaml.expect
@@ -1,4 +1,5 @@
Errors: {
+ Can't find ')' to match '('. (@4)
Expected an identifier, but got '*'. (@0)
Method not found: 'foo'. (@1)
Getter not found: ''. (@0)
diff --git a/pkg/front_end/testcases/expression/lib_nonctor.expression.yaml b/pkg/front_end/testcases/expression/lib_nonctor.expression.yaml
index bae7baa..637ef0c 100644
--- a/pkg/front_end/testcases/expression/lib_nonctor.expression.yaml
+++ b/pkg/front_end/testcases/expression/lib_nonctor.expression.yaml
@@ -6,4 +6,4 @@
definitions: []
position: "main.dart"
expression: |
- new Random();
+ new Random()
diff --git a/pkg/front_end/testcases/expression/nolib.expression.yaml.expect b/pkg/front_end/testcases/expression/nolib.expression.yaml.expect
index ba1f145..c46c67f 100644
--- a/pkg/front_end/testcases/expression/nolib.expression.yaml.expect
+++ b/pkg/front_end/testcases/expression/nolib.expression.yaml.expect
@@ -1,3 +1,4 @@
Errors: {
}
-<no procedure>
+method /* from org-dartlang-debug:synthetic_debug_expression */ debugExpr() → dynamic
+ return 0;
diff --git a/pkg/front_end/testcases/expression/type_param_shadow_arg_ctor_inferred.expression.yaml.expect b/pkg/front_end/testcases/expression/type_param_shadow_arg_ctor_inferred.expression.yaml.expect
index b5a35db..4802c5b 100644
--- a/pkg/front_end/testcases/expression/type_param_shadow_arg_ctor_inferred.expression.yaml.expect
+++ b/pkg/front_end/testcases/expression/type_param_shadow_arg_ctor_inferred.expression.yaml.expect
@@ -1,7 +1,7 @@
Errors: {
- A value of type 'main::A<dynamic>' can't be assigned to a variable of type 'main::A::debugExpr::T'. (@17)
+ A value of type 'main::A<dynamic>' can't be assigned to a variable of type 'T'. (@17)
}
method /* from org-dartlang-debug:synthetic_debug_expression */ debugExpr<T extends dynamic>() → dynamic
return () → dart.core::Null {
- main::A::debugExpr::T k = let final dynamic #t1 = let dynamic _ = null in invalid-expression "Error: A value of type 'main::A<dynamic>' can't be assigned to a variable of type 'main::A::debugExpr::T'.\nTry changing the type of the left hand side, or casting the right hand side to 'main::A::debugExpr::T'." in let final dynamic #t2 = new main::A::•<dynamic>() in null;
+ main::A::debugExpr::T k = let final dynamic #t1 = let dynamic _ = null in invalid-expression "org-dartlang-debug:synthetic_debug_expression:2:13: Error: A value of type 'main::A<dynamic>' can't be assigned to a variable of type 'T'.\nTry changing the type of the left hand side, or casting the right hand side to 'T'.\n T k = new A();\n ^" in let final dynamic #t2 = new main::A::•<dynamic>() in null;
};
diff --git a/pkg/front_end/testcases/illegal_named_function_expression.dart.direct.expect b/pkg/front_end/testcases/illegal_named_function_expression.dart.direct.expect
index dc19dc1..197f600 100644
--- a/pkg/front_end/testcases/illegal_named_function_expression.dart.direct.expect
+++ b/pkg/front_end/testcases/illegal_named_function_expression.dart.direct.expect
@@ -12,7 +12,7 @@
print(void g<T>(T t) {});
^"]/* from null */;
static method main() → dynamic {
- dynamic x = let final <T extends core::Object>(T) → void f = <T extends core::Object>(T t) → dynamic {} in f;
+ dynamic x = let final <T extends core::Object = dynamic>(T) → void f = <T extends core::Object = dynamic>(T t) → dynamic {} in f;
core::print(x.runtimeType);
- core::print(let final <T extends core::Object>(T) → void g = <T extends core::Object>(T t) → dynamic {} in g);
+ core::print(let final <T extends core::Object = dynamic>(T) → void g = <T extends core::Object = dynamic>(T t) → dynamic {} in g);
}
diff --git a/pkg/front_end/testcases/illegal_named_function_expression.dart.direct.transformed.expect b/pkg/front_end/testcases/illegal_named_function_expression.dart.direct.transformed.expect
index dc19dc1..197f600 100644
--- a/pkg/front_end/testcases/illegal_named_function_expression.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/illegal_named_function_expression.dart.direct.transformed.expect
@@ -12,7 +12,7 @@
print(void g<T>(T t) {});
^"]/* from null */;
static method main() → dynamic {
- dynamic x = let final <T extends core::Object>(T) → void f = <T extends core::Object>(T t) → dynamic {} in f;
+ dynamic x = let final <T extends core::Object = dynamic>(T) → void f = <T extends core::Object = dynamic>(T t) → dynamic {} in f;
core::print(x.runtimeType);
- core::print(let final <T extends core::Object>(T) → void g = <T extends core::Object>(T t) → dynamic {} in g);
+ core::print(let final <T extends core::Object = dynamic>(T) → void g = <T extends core::Object = dynamic>(T t) → dynamic {} in g);
}
diff --git a/pkg/front_end/testcases/illegal_named_function_expression.dart.strong.expect b/pkg/front_end/testcases/illegal_named_function_expression.dart.strong.expect
index f1c5274..99ed439 100644
--- a/pkg/front_end/testcases/illegal_named_function_expression.dart.strong.expect
+++ b/pkg/front_end/testcases/illegal_named_function_expression.dart.strong.expect
@@ -12,7 +12,7 @@
print(void g<T>(T t) {});
^"]/* from null */;
static method main() → dynamic {
- <T extends core::Object>(T) → core::Null x = let final <T extends core::Object>(T) → core::Null f = <T extends core::Object>(T t) → core::Null {} in f;
+ <T extends core::Object = dynamic>(T) → core::Null x = let final <T extends core::Object = dynamic>(T) → core::Null f = <T extends core::Object = dynamic>(T t) → core::Null {} in f;
core::print(x.{core::Object::runtimeType});
- core::print(let final <T extends core::Object>(T) → core::Null g = <T extends core::Object>(T t) → core::Null {} in g);
+ core::print(let final <T extends core::Object = dynamic>(T) → core::Null g = <T extends core::Object = dynamic>(T t) → core::Null {} in g);
}
diff --git a/pkg/front_end/testcases/illegal_named_function_expression.dart.strong.transformed.expect b/pkg/front_end/testcases/illegal_named_function_expression.dart.strong.transformed.expect
index f1c5274..99ed439 100644
--- a/pkg/front_end/testcases/illegal_named_function_expression.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/illegal_named_function_expression.dart.strong.transformed.expect
@@ -12,7 +12,7 @@
print(void g<T>(T t) {});
^"]/* from null */;
static method main() → dynamic {
- <T extends core::Object>(T) → core::Null x = let final <T extends core::Object>(T) → core::Null f = <T extends core::Object>(T t) → core::Null {} in f;
+ <T extends core::Object = dynamic>(T) → core::Null x = let final <T extends core::Object = dynamic>(T) → core::Null f = <T extends core::Object = dynamic>(T t) → core::Null {} in f;
core::print(x.{core::Object::runtimeType});
- core::print(let final <T extends core::Object>(T) → core::Null g = <T extends core::Object>(T t) → core::Null {} in g);
+ core::print(let final <T extends core::Object = dynamic>(T) → core::Null g = <T extends core::Object = dynamic>(T t) → core::Null {} in g);
}
diff --git a/pkg/front_end/testcases/incremental.status b/pkg/front_end/testcases/incremental.status
index f14d52e..d5feffe 100644
--- a/pkg/front_end/testcases/incremental.status
+++ b/pkg/front_end/testcases/incremental.status
@@ -3,8 +3,3 @@
# BSD-style license that can be found in the LICENSE.md file.
# Status file for the test suite ../test/fasta/incremental_test.dart.
-
-dartino/override_field_with_method_conflict.incremental: Fail # These tests are the incremental version of tests like language_2/field_override* and language_2/override_field_method*
-dartino/override_getter_with_method_conflict.incremental: Fail # These tests are the incremental version of tests like language_2/field_override* and language_2/override_field_method*
-dartino/override_method_with_field_conflict.incremental: Fail # These tests are the incremental version of tests like language_2/field_override* and language_2/override_field_method*
-dartino/override_method_with_getter_conflict.incremental: Fail # These tests are the incremental version of tests like language_2/field_override* and language_2/override_field_method*
diff --git a/pkg/front_end/testcases/incremental_initialize_from_dill/status.status b/pkg/front_end/testcases/incremental_initialize_from_dill/status.status
index 656e437..79a60b5 100644
--- a/pkg/front_end/testcases/incremental_initialize_from_dill/status.status
+++ b/pkg/front_end/testcases/incremental_initialize_from_dill/status.status
@@ -4,5 +4,4 @@
# Status file for the test suite ../test/incremental_load_from_dill_yaml_test.dart.
-calculated_bounds_no_strongmode: Crash
strongmode_mixins_2: Crash
diff --git a/pkg/front_end/testcases/inference/abstract_class_instantiation.dart.direct.expect b/pkg/front_end/testcases/inference/abstract_class_instantiation.dart.direct.expect
index 3cd8d21..4624781 100644
--- a/pkg/front_end/testcases/inference/abstract_class_instantiation.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/abstract_class_instantiation.dart.direct.expect
@@ -7,7 +7,7 @@
: super core::Object::•()
;
}
-abstract class D<T extends core::Object> extends core::Object {
+abstract class D<T extends core::Object = dynamic> extends core::Object {
constructor •(self::D::T t) → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/inference/abstract_class_instantiation.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/abstract_class_instantiation.dart.direct.transformed.expect
index 3cd8d21..4624781 100644
--- a/pkg/front_end/testcases/inference/abstract_class_instantiation.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/abstract_class_instantiation.dart.direct.transformed.expect
@@ -7,7 +7,7 @@
: super core::Object::•()
;
}
-abstract class D<T extends core::Object> extends core::Object {
+abstract class D<T extends core::Object = dynamic> extends core::Object {
constructor •(self::D::T t) → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/inference/abstract_class_instantiation.dart.outline.expect b/pkg/front_end/testcases/inference/abstract_class_instantiation.dart.outline.expect
index 66f08a3..09b40a0 100644
--- a/pkg/front_end/testcases/inference/abstract_class_instantiation.dart.outline.expect
+++ b/pkg/front_end/testcases/inference/abstract_class_instantiation.dart.outline.expect
@@ -6,7 +6,7 @@
synthetic constructor •() → void
;
}
-abstract class D<T extends core::Object> extends core::Object {
+abstract class D<T extends core::Object = dynamic> extends core::Object {
constructor •(self::D::T t) → void
;
}
diff --git a/pkg/front_end/testcases/inference/assert.dart.direct.expect b/pkg/front_end/testcases/inference/assert.dart.direct.expect
index e5a1b8f..53b9899 100644
--- a/pkg/front_end/testcases/inference/assert.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/assert.dart.direct.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method test() → void {
assert(self::f<dynamic>());
diff --git a/pkg/front_end/testcases/inference/assert.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/assert.dart.direct.transformed.expect
index e5a1b8f..53b9899 100644
--- a/pkg/front_end/testcases/inference/assert.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/assert.dart.direct.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method test() → void {
assert(self::f<dynamic>());
diff --git a/pkg/front_end/testcases/inference/assert.dart.outline.expect b/pkg/front_end/testcases/inference/assert.dart.outline.expect
index ac49c9e..e8c03c5 100644
--- a/pkg/front_end/testcases/inference/assert.dart.outline.expect
+++ b/pkg/front_end/testcases/inference/assert.dart.outline.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
;
static method test() → void
;
diff --git a/pkg/front_end/testcases/inference/assert.dart.strong.expect b/pkg/front_end/testcases/inference/assert.dart.strong.expect
index 004b776..cfbd624 100644
--- a/pkg/front_end/testcases/inference/assert.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/assert.dart.strong.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method test() → void {
assert(self::f<core::bool>());
diff --git a/pkg/front_end/testcases/inference/assert.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/assert.dart.strong.transformed.expect
index 004b776..cfbd624 100644
--- a/pkg/front_end/testcases/inference/assert.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/assert.dart.strong.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method test() → void {
assert(self::f<core::bool>());
diff --git a/pkg/front_end/testcases/inference/assert_initializer.dart.direct.expect b/pkg/front_end/testcases/inference/assert_initializer.dart.direct.expect
index 602da12..a90d65d 100644
--- a/pkg/front_end/testcases/inference/assert_initializer.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/assert_initializer.dart.direct.expect
@@ -10,7 +10,7 @@
: assert(self::f<dynamic>(), self::f<dynamic>()), super core::Object::•()
;
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method main() → dynamic {
assert(self::f<dynamic>());
diff --git a/pkg/front_end/testcases/inference/assert_initializer.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/assert_initializer.dart.direct.transformed.expect
index 602da12..a90d65d 100644
--- a/pkg/front_end/testcases/inference/assert_initializer.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/assert_initializer.dart.direct.transformed.expect
@@ -10,7 +10,7 @@
: assert(self::f<dynamic>(), self::f<dynamic>()), super core::Object::•()
;
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method main() → dynamic {
assert(self::f<dynamic>());
diff --git a/pkg/front_end/testcases/inference/assert_initializer.dart.outline.expect b/pkg/front_end/testcases/inference/assert_initializer.dart.outline.expect
index 33bb051..5121bf1 100644
--- a/pkg/front_end/testcases/inference/assert_initializer.dart.outline.expect
+++ b/pkg/front_end/testcases/inference/assert_initializer.dart.outline.expect
@@ -8,7 +8,7 @@
constructor expressionAndMessage() → void
;
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
;
static method main() → dynamic
;
diff --git a/pkg/front_end/testcases/inference/assert_initializer.dart.strong.expect b/pkg/front_end/testcases/inference/assert_initializer.dart.strong.expect
index 27f0c32..f87c11c 100644
--- a/pkg/front_end/testcases/inference/assert_initializer.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/assert_initializer.dart.strong.expect
@@ -10,7 +10,7 @@
: assert(self::f<core::bool>(), self::f<dynamic>()), super core::Object::•()
;
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method main() → dynamic {
assert(self::f<core::bool>());
diff --git a/pkg/front_end/testcases/inference/assert_initializer.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/assert_initializer.dart.strong.transformed.expect
index 27f0c32..f87c11c 100644
--- a/pkg/front_end/testcases/inference/assert_initializer.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/assert_initializer.dart.strong.transformed.expect
@@ -10,7 +10,7 @@
: assert(self::f<core::bool>(), self::f<dynamic>()), super core::Object::•()
;
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method main() → dynamic {
assert(self::f<core::bool>());
diff --git a/pkg/front_end/testcases/inference/assign_local.dart.direct.expect b/pkg/front_end/testcases/inference/assign_local.dart.direct.expect
index 92719ee..35d51d7 100644
--- a/pkg/front_end/testcases/inference/assign_local.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/assign_local.dart.direct.expect
@@ -2,12 +2,12 @@
import self as self;
import "dart:core" as core;
-class A<T extends core::Object> extends core::Object {
+class A<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class B<T extends core::Object> extends self::A<self::B::T> {
+class B<T extends core::Object = dynamic> extends self::A<self::B::T> {
synthetic constructor •() → void
: super self::A::•()
;
diff --git a/pkg/front_end/testcases/inference/assign_local.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/assign_local.dart.direct.transformed.expect
index 92719ee..35d51d7 100644
--- a/pkg/front_end/testcases/inference/assign_local.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/assign_local.dart.direct.transformed.expect
@@ -2,12 +2,12 @@
import self as self;
import "dart:core" as core;
-class A<T extends core::Object> extends core::Object {
+class A<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class B<T extends core::Object> extends self::A<self::B::T> {
+class B<T extends core::Object = dynamic> extends self::A<self::B::T> {
synthetic constructor •() → void
: super self::A::•()
;
diff --git a/pkg/front_end/testcases/inference/assign_local.dart.outline.expect b/pkg/front_end/testcases/inference/assign_local.dart.outline.expect
index 134d614..43446c8 100644
--- a/pkg/front_end/testcases/inference/assign_local.dart.outline.expect
+++ b/pkg/front_end/testcases/inference/assign_local.dart.outline.expect
@@ -2,11 +2,11 @@
import self as self;
import "dart:core" as core;
-class A<T extends core::Object> extends core::Object {
+class A<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
;
}
-class B<T extends core::Object> extends self::A<self::B::T> {
+class B<T extends core::Object = dynamic> extends self::A<self::B::T> {
synthetic constructor •() → void
;
}
diff --git a/pkg/front_end/testcases/inference/assign_local.dart.strong.expect b/pkg/front_end/testcases/inference/assign_local.dart.strong.expect
index e8e11fe..5eaea0d 100644
--- a/pkg/front_end/testcases/inference/assign_local.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/assign_local.dart.strong.expect
@@ -2,12 +2,12 @@
import self as self;
import "dart:core" as core;
-class A<T extends core::Object> extends core::Object {
+class A<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class B<T extends core::Object> extends self::A<self::B::T> {
+class B<T extends core::Object = dynamic> extends self::A<self::B::T> {
synthetic constructor •() → void
: super self::A::•()
;
diff --git a/pkg/front_end/testcases/inference/assign_local.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/assign_local.dart.strong.transformed.expect
index e8e11fe..5eaea0d 100644
--- a/pkg/front_end/testcases/inference/assign_local.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/assign_local.dart.strong.transformed.expect
@@ -2,12 +2,12 @@
import self as self;
import "dart:core" as core;
-class A<T extends core::Object> extends core::Object {
+class A<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class B<T extends core::Object> extends self::A<self::B::T> {
+class B<T extends core::Object = dynamic> extends self::A<self::B::T> {
synthetic constructor •() → void
: super self::A::•()
;
diff --git a/pkg/front_end/testcases/inference/bug30251.dart.direct.expect b/pkg/front_end/testcases/inference/bug30251.dart.direct.expect
index fdfd49f..b7f6d44 100644
--- a/pkg/front_end/testcases/inference/bug30251.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/bug30251.dart.direct.expect
@@ -8,6 +8,6 @@
: self::C::x = self::f<dynamic>(1.+(p)), super core::Object::•()
;
}
-static method f<T extends core::Object>(self::f::T t) → self::f::T
+static method f<T extends core::Object = dynamic>(self::f::T t) → self::f::T
return t;
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/bug30251.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/bug30251.dart.direct.transformed.expect
index fdfd49f..b7f6d44 100644
--- a/pkg/front_end/testcases/inference/bug30251.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/bug30251.dart.direct.transformed.expect
@@ -8,6 +8,6 @@
: self::C::x = self::f<dynamic>(1.+(p)), super core::Object::•()
;
}
-static method f<T extends core::Object>(self::f::T t) → self::f::T
+static method f<T extends core::Object = dynamic>(self::f::T t) → self::f::T
return t;
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/bug30251.dart.outline.expect b/pkg/front_end/testcases/inference/bug30251.dart.outline.expect
index 8512f84..a19f31b 100644
--- a/pkg/front_end/testcases/inference/bug30251.dart.outline.expect
+++ b/pkg/front_end/testcases/inference/bug30251.dart.outline.expect
@@ -7,7 +7,7 @@
constructor •(core::int p) → void
;
}
-static method f<T extends core::Object>(self::f::T t) → self::f::T
+static method f<T extends core::Object = dynamic>(self::f::T t) → self::f::T
;
static method main() → dynamic
;
diff --git a/pkg/front_end/testcases/inference/bug30251.dart.strong.expect b/pkg/front_end/testcases/inference/bug30251.dart.strong.expect
index c3087fe..cb2070c 100644
--- a/pkg/front_end/testcases/inference/bug30251.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/bug30251.dart.strong.expect
@@ -8,6 +8,6 @@
: self::C::x = self::f<core::int>(1.{core::num::+}(p)), super core::Object::•()
;
}
-static method f<T extends core::Object>(self::f::T t) → self::f::T
+static method f<T extends core::Object = dynamic>(self::f::T t) → self::f::T
return t;
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/bug30251.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/bug30251.dart.strong.transformed.expect
index c3087fe..cb2070c 100644
--- a/pkg/front_end/testcases/inference/bug30251.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/bug30251.dart.strong.transformed.expect
@@ -8,6 +8,6 @@
: self::C::x = self::f<core::int>(1.{core::num::+}(p)), super core::Object::•()
;
}
-static method f<T extends core::Object>(self::f::T t) → self::f::T
+static method f<T extends core::Object = dynamic>(self::f::T t) → self::f::T
return t;
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/bug30624.dart.direct.expect b/pkg/front_end/testcases/inference/bug30624.dart.direct.expect
index 9a75e22..eeedbaf 100644
--- a/pkg/front_end/testcases/inference/bug30624.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/bug30624.dart.direct.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class C<E extends core::Object> extends core::Object {
+class C<E extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
@@ -29,5 +29,5 @@
return 1.unary-();
}
}
-static method foo<E extends core::Object>(self::C<self::foo::E> c, (self::foo::E, self::foo::E) → core::int cmp) → void {}
+static method foo<E extends core::Object = dynamic>(self::C<self::foo::E> c, (self::foo::E, self::foo::E) → core::int cmp) → void {}
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/bug30624.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/bug30624.dart.direct.transformed.expect
index 9a75e22..eeedbaf 100644
--- a/pkg/front_end/testcases/inference/bug30624.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/bug30624.dart.direct.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class C<E extends core::Object> extends core::Object {
+class C<E extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
@@ -29,5 +29,5 @@
return 1.unary-();
}
}
-static method foo<E extends core::Object>(self::C<self::foo::E> c, (self::foo::E, self::foo::E) → core::int cmp) → void {}
+static method foo<E extends core::Object = dynamic>(self::C<self::foo::E> c, (self::foo::E, self::foo::E) → core::int cmp) → void {}
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/bug30624.dart.outline.expect b/pkg/front_end/testcases/inference/bug30624.dart.outline.expect
index f705538..ff60989 100644
--- a/pkg/front_end/testcases/inference/bug30624.dart.outline.expect
+++ b/pkg/front_end/testcases/inference/bug30624.dart.outline.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class C<E extends core::Object> extends core::Object {
+class C<E extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
;
method barA([(self::C::E, self::C::E) → core::int cmp]) → void
@@ -20,7 +20,7 @@
static method _default(dynamic a, dynamic b) → core::int
;
}
-static method foo<E extends core::Object>(self::C<self::foo::E> c, (self::foo::E, self::foo::E) → core::int cmp) → void
+static method foo<E extends core::Object = dynamic>(self::C<self::foo::E> c, (self::foo::E, self::foo::E) → core::int cmp) → void
;
static method main() → dynamic
;
diff --git a/pkg/front_end/testcases/inference/bug30624.dart.strong.expect b/pkg/front_end/testcases/inference/bug30624.dart.strong.expect
index 1f952f5..9a5f732 100644
--- a/pkg/front_end/testcases/inference/bug30624.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/bug30624.dart.strong.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class C<E extends core::Object> extends core::Object {
+class C<E extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
@@ -29,5 +29,5 @@
return 1.{core::int::unary-}();
}
}
-static method foo<E extends core::Object>(self::C<self::foo::E> c, (self::foo::E, self::foo::E) → core::int cmp) → void {}
+static method foo<E extends core::Object = dynamic>(self::C<self::foo::E> c, (self::foo::E, self::foo::E) → core::int cmp) → void {}
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/bug30624.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/bug30624.dart.strong.transformed.expect
index 1f952f5..9a5f732 100644
--- a/pkg/front_end/testcases/inference/bug30624.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/bug30624.dart.strong.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class C<E extends core::Object> extends core::Object {
+class C<E extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
@@ -29,5 +29,5 @@
return 1.{core::int::unary-}();
}
}
-static method foo<E extends core::Object>(self::C<self::foo::E> c, (self::foo::E, self::foo::E) → core::int cmp) → void {}
+static method foo<E extends core::Object = dynamic>(self::C<self::foo::E> c, (self::foo::E, self::foo::E) → core::int cmp) → void {}
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/callable_generic_class.dart.direct.expect b/pkg/front_end/testcases/inference/callable_generic_class.dart.direct.expect
index b1b2544..93409b0 100644
--- a/pkg/front_end/testcases/inference/callable_generic_class.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/callable_generic_class.dart.direct.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class ActionDispatcher<P extends core::Object> extends core::Object {
+class ActionDispatcher<P extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/inference/callable_generic_class.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/callable_generic_class.dart.direct.transformed.expect
index b1b2544..93409b0 100644
--- a/pkg/front_end/testcases/inference/callable_generic_class.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/callable_generic_class.dart.direct.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class ActionDispatcher<P extends core::Object> extends core::Object {
+class ActionDispatcher<P extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/inference/callable_generic_class.dart.outline.expect b/pkg/front_end/testcases/inference/callable_generic_class.dart.outline.expect
index edb733d..309e3d2 100644
--- a/pkg/front_end/testcases/inference/callable_generic_class.dart.outline.expect
+++ b/pkg/front_end/testcases/inference/callable_generic_class.dart.outline.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class ActionDispatcher<P extends core::Object> extends core::Object {
+class ActionDispatcher<P extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
;
method call([self::ActionDispatcher::P value]) → void
diff --git a/pkg/front_end/testcases/inference/callable_generic_class.dart.strong.expect b/pkg/front_end/testcases/inference/callable_generic_class.dart.strong.expect
index 3e59656..bce5d96 100644
--- a/pkg/front_end/testcases/inference/callable_generic_class.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/callable_generic_class.dart.strong.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class ActionDispatcher<P extends core::Object> extends core::Object {
+class ActionDispatcher<P extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/inference/callable_generic_class.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/callable_generic_class.dart.strong.transformed.expect
index 3e59656..bce5d96 100644
--- a/pkg/front_end/testcases/inference/callable_generic_class.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/callable_generic_class.dart.strong.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class ActionDispatcher<P extends core::Object> extends core::Object {
+class ActionDispatcher<P extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/inference/conditional_upwards_inference.dart.direct.expect b/pkg/front_end/testcases/inference/conditional_upwards_inference.dart.direct.expect
index 8145e11..d942073 100644
--- a/pkg/front_end/testcases/inference/conditional_upwards_inference.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/conditional_upwards_inference.dart.direct.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class C<T extends core::Object> extends core::Object {
+class C<T extends core::Object = dynamic> extends core::Object {
constructor •(core::List<self::C::T> x) → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/inference/conditional_upwards_inference.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/conditional_upwards_inference.dart.direct.transformed.expect
index 8145e11..d942073 100644
--- a/pkg/front_end/testcases/inference/conditional_upwards_inference.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/conditional_upwards_inference.dart.direct.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class C<T extends core::Object> extends core::Object {
+class C<T extends core::Object = dynamic> extends core::Object {
constructor •(core::List<self::C::T> x) → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/inference/conditional_upwards_inference.dart.outline.expect b/pkg/front_end/testcases/inference/conditional_upwards_inference.dart.outline.expect
index 0c2d0dc..dafb078 100644
--- a/pkg/front_end/testcases/inference/conditional_upwards_inference.dart.outline.expect
+++ b/pkg/front_end/testcases/inference/conditional_upwards_inference.dart.outline.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class C<T extends core::Object> extends core::Object {
+class C<T extends core::Object = dynamic> extends core::Object {
constructor •(core::List<self::C::T> x) → void
;
}
diff --git a/pkg/front_end/testcases/inference/conditional_upwards_inference.dart.strong.expect b/pkg/front_end/testcases/inference/conditional_upwards_inference.dart.strong.expect
index a952ea0..f11d58d 100644
--- a/pkg/front_end/testcases/inference/conditional_upwards_inference.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/conditional_upwards_inference.dart.strong.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class C<T extends core::Object> extends core::Object {
+class C<T extends core::Object = dynamic> extends core::Object {
constructor •(core::List<self::C::T> x) → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/inference/conditional_upwards_inference.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/conditional_upwards_inference.dart.strong.transformed.expect
index a952ea0..f11d58d 100644
--- a/pkg/front_end/testcases/inference/conditional_upwards_inference.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/conditional_upwards_inference.dart.strong.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class C<T extends core::Object> extends core::Object {
+class C<T extends core::Object = dynamic> extends core::Object {
constructor •(core::List<self::C::T> x) → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/inference/constructors_downwards_with_constraint.dart.direct.expect b/pkg/front_end/testcases/inference/constructors_downwards_with_constraint.dart.direct.expect
index 1def021..9a717b9 100644
--- a/pkg/front_end/testcases/inference/constructors_downwards_with_constraint.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/constructors_downwards_with_constraint.dart.direct.expect
@@ -12,7 +12,7 @@
: super self::A::•()
;
}
-class Foo<T extends self::A> extends core::Object {
+class Foo<T extends self::A = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/inference/constructors_downwards_with_constraint.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/constructors_downwards_with_constraint.dart.direct.transformed.expect
index 1def021..9a717b9 100644
--- a/pkg/front_end/testcases/inference/constructors_downwards_with_constraint.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/constructors_downwards_with_constraint.dart.direct.transformed.expect
@@ -12,7 +12,7 @@
: super self::A::•()
;
}
-class Foo<T extends self::A> extends core::Object {
+class Foo<T extends self::A = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/inference/constructors_downwards_with_constraint.dart.strong.expect b/pkg/front_end/testcases/inference/constructors_downwards_with_constraint.dart.strong.expect
index 4da3023..53339a4 100644
--- a/pkg/front_end/testcases/inference/constructors_downwards_with_constraint.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/constructors_downwards_with_constraint.dart.strong.expect
@@ -12,7 +12,7 @@
: super self::A::•()
;
}
-class Foo<T extends self::A> extends core::Object {
+class Foo<T extends self::A = self::A> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/inference/constructors_downwards_with_constraint.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/constructors_downwards_with_constraint.dart.strong.transformed.expect
index 4da3023..53339a4 100644
--- a/pkg/front_end/testcases/inference/constructors_downwards_with_constraint.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/constructors_downwards_with_constraint.dart.strong.transformed.expect
@@ -12,7 +12,7 @@
: super self::A::•()
;
}
-class Foo<T extends self::A> extends core::Object {
+class Foo<T extends self::A = self::A> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/inference/constructors_infer_from_arguments.dart.direct.expect b/pkg/front_end/testcases/inference/constructors_infer_from_arguments.dart.direct.expect
index 8a1923c..e4269a9 100644
--- a/pkg/front_end/testcases/inference/constructors_infer_from_arguments.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/constructors_infer_from_arguments.dart.direct.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class C<T extends core::Object> extends core::Object {
+class C<T extends core::Object = dynamic> extends core::Object {
field self::C::T t;
constructor •(self::C::T t) → void
: self::C::t = t, super core::Object::•()
diff --git a/pkg/front_end/testcases/inference/constructors_infer_from_arguments.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/constructors_infer_from_arguments.dart.direct.transformed.expect
index 8a1923c..e4269a9 100644
--- a/pkg/front_end/testcases/inference/constructors_infer_from_arguments.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/constructors_infer_from_arguments.dart.direct.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class C<T extends core::Object> extends core::Object {
+class C<T extends core::Object = dynamic> extends core::Object {
field self::C::T t;
constructor •(self::C::T t) → void
: self::C::t = t, super core::Object::•()
diff --git a/pkg/front_end/testcases/inference/constructors_infer_from_arguments.dart.strong.expect b/pkg/front_end/testcases/inference/constructors_infer_from_arguments.dart.strong.expect
index b902c2a..80cb335 100644
--- a/pkg/front_end/testcases/inference/constructors_infer_from_arguments.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/constructors_infer_from_arguments.dart.strong.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class C<T extends core::Object> extends core::Object {
+class C<T extends core::Object = dynamic> extends core::Object {
generic-covariant-impl generic-covariant-interface field self::C::T t;
constructor •(self::C::T t) → void
: self::C::t = t, super core::Object::•()
diff --git a/pkg/front_end/testcases/inference/constructors_infer_from_arguments.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/constructors_infer_from_arguments.dart.strong.transformed.expect
index d6841ff..d1bb8ee 100644
--- a/pkg/front_end/testcases/inference/constructors_infer_from_arguments.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/constructors_infer_from_arguments.dart.strong.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class C<T extends core::Object> extends core::Object {
+class C<T extends core::Object = dynamic> extends core::Object {
generic-covariant-impl generic-covariant-interface field self::C::T t;
constructor •(self::C::T t) → void
: self::C::t = t, super core::Object::•()
diff --git a/pkg/front_end/testcases/inference/constructors_infer_from_arguments_argument_not_assignable.dart.direct.expect b/pkg/front_end/testcases/inference/constructors_infer_from_arguments_argument_not_assignable.dart.direct.expect
index 619f0a3..872f905 100644
--- a/pkg/front_end/testcases/inference/constructors_infer_from_arguments_argument_not_assignable.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/constructors_infer_from_arguments_argument_not_assignable.dart.direct.expect
@@ -2,13 +2,13 @@
import self as self;
import "dart:core" as core;
-typedef F<T extends core::Object> = () → T;
+typedef F<T extends core::Object = dynamic> = () → T;
class A extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class C<T extends self::A> extends core::Object {
+class C<T extends self::A = dynamic> extends core::Object {
constructor •(() → self::C::T f) → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/inference/constructors_infer_from_arguments_argument_not_assignable.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/constructors_infer_from_arguments_argument_not_assignable.dart.direct.transformed.expect
index 619f0a3..872f905 100644
--- a/pkg/front_end/testcases/inference/constructors_infer_from_arguments_argument_not_assignable.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/constructors_infer_from_arguments_argument_not_assignable.dart.direct.transformed.expect
@@ -2,13 +2,13 @@
import self as self;
import "dart:core" as core;
-typedef F<T extends core::Object> = () → T;
+typedef F<T extends core::Object = dynamic> = () → T;
class A extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class C<T extends self::A> extends core::Object {
+class C<T extends self::A = dynamic> extends core::Object {
constructor •(() → self::C::T f) → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/inference/constructors_infer_from_arguments_argument_not_assignable.dart.strong.expect b/pkg/front_end/testcases/inference/constructors_infer_from_arguments_argument_not_assignable.dart.strong.expect
index 4d9c033..68d5644 100644
--- a/pkg/front_end/testcases/inference/constructors_infer_from_arguments_argument_not_assignable.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/constructors_infer_from_arguments_argument_not_assignable.dart.strong.expect
@@ -2,13 +2,13 @@
import self as self;
import "dart:core" as core;
-typedef F<T extends core::Object> = () → T;
+typedef F<T extends core::Object = dynamic> = () → T;
class A extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class C<T extends self::A> extends core::Object {
+class C<T extends self::A = self::A> extends core::Object {
constructor •(() → self::C::T f) → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/inference/constructors_infer_from_arguments_const.dart.direct.expect b/pkg/front_end/testcases/inference/constructors_infer_from_arguments_const.dart.direct.expect
index c3c0ebc..dc33b93 100644
--- a/pkg/front_end/testcases/inference/constructors_infer_from_arguments_const.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/constructors_infer_from_arguments_const.dart.direct.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class C<T extends core::Object> extends core::Object {
+class C<T extends core::Object = dynamic> extends core::Object {
final field self::C::T t;
const constructor •(self::C::T t) → void
: self::C::t = t, super core::Object::•()
diff --git a/pkg/front_end/testcases/inference/constructors_infer_from_arguments_const.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/constructors_infer_from_arguments_const.dart.direct.transformed.expect
index c3c0ebc..dc33b93 100644
--- a/pkg/front_end/testcases/inference/constructors_infer_from_arguments_const.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/constructors_infer_from_arguments_const.dart.direct.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class C<T extends core::Object> extends core::Object {
+class C<T extends core::Object = dynamic> extends core::Object {
final field self::C::T t;
const constructor •(self::C::T t) → void
: self::C::t = t, super core::Object::•()
diff --git a/pkg/front_end/testcases/inference/constructors_infer_from_arguments_const.dart.strong.expect b/pkg/front_end/testcases/inference/constructors_infer_from_arguments_const.dart.strong.expect
index 366ee21..88d450f 100644
--- a/pkg/front_end/testcases/inference/constructors_infer_from_arguments_const.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/constructors_infer_from_arguments_const.dart.strong.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class C<T extends core::Object> extends core::Object {
+class C<T extends core::Object = dynamic> extends core::Object {
final field self::C::T t;
const constructor •(self::C::T t) → void
: self::C::t = t, super core::Object::•()
diff --git a/pkg/front_end/testcases/inference/constructors_infer_from_arguments_const.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/constructors_infer_from_arguments_const.dart.strong.transformed.expect
index 366ee21..88d450f 100644
--- a/pkg/front_end/testcases/inference/constructors_infer_from_arguments_const.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/constructors_infer_from_arguments_const.dart.strong.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class C<T extends core::Object> extends core::Object {
+class C<T extends core::Object = dynamic> extends core::Object {
final field self::C::T t;
const constructor •(self::C::T t) → void
: self::C::t = t, super core::Object::•()
diff --git a/pkg/front_end/testcases/inference/constructors_infer_from_arguments_const_with_upper_bound.dart.direct.expect b/pkg/front_end/testcases/inference/constructors_infer_from_arguments_const_with_upper_bound.dart.direct.expect
index f4cec98..b141829 100644
--- a/pkg/front_end/testcases/inference/constructors_infer_from_arguments_const_with_upper_bound.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/constructors_infer_from_arguments_const_with_upper_bound.dart.direct.expect
@@ -2,13 +2,13 @@
import self as self;
import "dart:core" as core;
-class C<T extends core::num> extends core::Object {
+class C<T extends core::num = dynamic> extends core::Object {
final field self::C::T x;
const constructor •(self::C::T x) → void
: self::C::x = x, super core::Object::•()
;
}
-class D<T extends core::num> extends core::Object {
+class D<T extends core::num = dynamic> extends core::Object {
const constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/inference/constructors_infer_from_arguments_const_with_upper_bound.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/constructors_infer_from_arguments_const_with_upper_bound.dart.direct.transformed.expect
index f4cec98..b141829 100644
--- a/pkg/front_end/testcases/inference/constructors_infer_from_arguments_const_with_upper_bound.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/constructors_infer_from_arguments_const_with_upper_bound.dart.direct.transformed.expect
@@ -2,13 +2,13 @@
import self as self;
import "dart:core" as core;
-class C<T extends core::num> extends core::Object {
+class C<T extends core::num = dynamic> extends core::Object {
final field self::C::T x;
const constructor •(self::C::T x) → void
: self::C::x = x, super core::Object::•()
;
}
-class D<T extends core::num> extends core::Object {
+class D<T extends core::num = dynamic> extends core::Object {
const constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/inference/constructors_infer_from_arguments_const_with_upper_bound.dart.strong.expect b/pkg/front_end/testcases/inference/constructors_infer_from_arguments_const_with_upper_bound.dart.strong.expect
index 97e2ca4..f90d5a7 100644
--- a/pkg/front_end/testcases/inference/constructors_infer_from_arguments_const_with_upper_bound.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/constructors_infer_from_arguments_const_with_upper_bound.dart.strong.expect
@@ -2,13 +2,13 @@
import self as self;
import "dart:core" as core;
-class C<T extends core::num> extends core::Object {
+class C<T extends core::num = core::num> extends core::Object {
final field self::C::T x;
const constructor •(self::C::T x) → void
: self::C::x = x, super core::Object::•()
;
}
-class D<T extends core::num> extends core::Object {
+class D<T extends core::num = core::num> extends core::Object {
const constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/inference/constructors_infer_from_arguments_const_with_upper_bound.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/constructors_infer_from_arguments_const_with_upper_bound.dart.strong.transformed.expect
index 97e2ca4..f90d5a7 100644
--- a/pkg/front_end/testcases/inference/constructors_infer_from_arguments_const_with_upper_bound.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/constructors_infer_from_arguments_const_with_upper_bound.dart.strong.transformed.expect
@@ -2,13 +2,13 @@
import self as self;
import "dart:core" as core;
-class C<T extends core::num> extends core::Object {
+class C<T extends core::num = core::num> extends core::Object {
final field self::C::T x;
const constructor •(self::C::T x) → void
: self::C::x = x, super core::Object::•()
;
}
-class D<T extends core::num> extends core::Object {
+class D<T extends core::num = core::num> extends core::Object {
const constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/inference/constructors_infer_from_arguments_downwards_from_constructor.dart.direct.expect b/pkg/front_end/testcases/inference/constructors_infer_from_arguments_downwards_from_constructor.dart.direct.expect
index 1e8e0c0..740c1dd 100644
--- a/pkg/front_end/testcases/inference/constructors_infer_from_arguments_downwards_from_constructor.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/constructors_infer_from_arguments_downwards_from_constructor.dart.direct.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class C<T extends core::Object> extends core::Object {
+class C<T extends core::Object = dynamic> extends core::Object {
constructor •(core::List<self::C::T> list) → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/inference/constructors_infer_from_arguments_downwards_from_constructor.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/constructors_infer_from_arguments_downwards_from_constructor.dart.direct.transformed.expect
index 1e8e0c0..740c1dd 100644
--- a/pkg/front_end/testcases/inference/constructors_infer_from_arguments_downwards_from_constructor.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/constructors_infer_from_arguments_downwards_from_constructor.dart.direct.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class C<T extends core::Object> extends core::Object {
+class C<T extends core::Object = dynamic> extends core::Object {
constructor •(core::List<self::C::T> list) → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/inference/constructors_infer_from_arguments_downwards_from_constructor.dart.strong.expect b/pkg/front_end/testcases/inference/constructors_infer_from_arguments_downwards_from_constructor.dart.strong.expect
index 2950d68..4eeaeb3 100644
--- a/pkg/front_end/testcases/inference/constructors_infer_from_arguments_downwards_from_constructor.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/constructors_infer_from_arguments_downwards_from_constructor.dart.strong.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class C<T extends core::Object> extends core::Object {
+class C<T extends core::Object = dynamic> extends core::Object {
constructor •(core::List<self::C::T> list) → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/inference/constructors_infer_from_arguments_downwards_from_constructor.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/constructors_infer_from_arguments_downwards_from_constructor.dart.strong.transformed.expect
index 2950d68..4eeaeb3 100644
--- a/pkg/front_end/testcases/inference/constructors_infer_from_arguments_downwards_from_constructor.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/constructors_infer_from_arguments_downwards_from_constructor.dart.strong.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class C<T extends core::Object> extends core::Object {
+class C<T extends core::Object = dynamic> extends core::Object {
constructor •(core::List<self::C::T> list) → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/inference/constructors_infer_from_arguments_factory.dart.direct.expect b/pkg/front_end/testcases/inference/constructors_infer_from_arguments_factory.dart.direct.expect
index c9e1108..2f2411b 100644
--- a/pkg/front_end/testcases/inference/constructors_infer_from_arguments_factory.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/constructors_infer_from_arguments_factory.dart.direct.expect
@@ -2,12 +2,12 @@
import self as self;
import "dart:core" as core;
-class C<T extends core::Object> extends core::Object {
+class C<T extends core::Object = dynamic> extends core::Object {
field self::C::T t = null;
constructor _() → void
: super core::Object::•()
;
- static factory •<T extends core::Object>(self::C::•::T t) → self::C<self::C::•::T> {
+ static factory •<T extends core::Object = dynamic>(self::C::•::T t) → self::C<self::C::•::T> {
dynamic x = new self::C::_<self::C::•::T>();
x.t = t;
return x;
diff --git a/pkg/front_end/testcases/inference/constructors_infer_from_arguments_factory.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/constructors_infer_from_arguments_factory.dart.direct.transformed.expect
index c9e1108..2f2411b 100644
--- a/pkg/front_end/testcases/inference/constructors_infer_from_arguments_factory.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/constructors_infer_from_arguments_factory.dart.direct.transformed.expect
@@ -2,12 +2,12 @@
import self as self;
import "dart:core" as core;
-class C<T extends core::Object> extends core::Object {
+class C<T extends core::Object = dynamic> extends core::Object {
field self::C::T t = null;
constructor _() → void
: super core::Object::•()
;
- static factory •<T extends core::Object>(self::C::•::T t) → self::C<self::C::•::T> {
+ static factory •<T extends core::Object = dynamic>(self::C::•::T t) → self::C<self::C::•::T> {
dynamic x = new self::C::_<self::C::•::T>();
x.t = t;
return x;
diff --git a/pkg/front_end/testcases/inference/constructors_infer_from_arguments_factory.dart.strong.expect b/pkg/front_end/testcases/inference/constructors_infer_from_arguments_factory.dart.strong.expect
index 835b191..72af9d8 100644
--- a/pkg/front_end/testcases/inference/constructors_infer_from_arguments_factory.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/constructors_infer_from_arguments_factory.dart.strong.expect
@@ -2,12 +2,12 @@
import self as self;
import "dart:core" as core;
-class C<T extends core::Object> extends core::Object {
+class C<T extends core::Object = dynamic> extends core::Object {
generic-covariant-impl generic-covariant-interface field self::C::T t = null;
constructor _() → void
: super core::Object::•()
;
- static factory •<T extends core::Object>(self::C::•::T t) → self::C<self::C::•::T> {
+ static factory •<T extends core::Object = dynamic>(self::C::•::T t) → self::C<self::C::•::T> {
self::C<self::C::•::T> x = new self::C::_<self::C::•::T>();
x.{self::C::t} = t;
return x;
diff --git a/pkg/front_end/testcases/inference/constructors_infer_from_arguments_factory.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/constructors_infer_from_arguments_factory.dart.strong.transformed.expect
index 65a3466..cd824ab 100644
--- a/pkg/front_end/testcases/inference/constructors_infer_from_arguments_factory.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/constructors_infer_from_arguments_factory.dart.strong.transformed.expect
@@ -2,12 +2,12 @@
import self as self;
import "dart:core" as core;
-class C<T extends core::Object> extends core::Object {
+class C<T extends core::Object = dynamic> extends core::Object {
generic-covariant-impl generic-covariant-interface field self::C::T t = null;
constructor _() → void
: super core::Object::•()
;
- static factory •<T extends core::Object>(self::C::•::T t) → self::C<self::C::•::T> {
+ static factory •<T extends core::Object = dynamic>(self::C::•::T t) → self::C<self::C::•::T> {
self::C<self::C::•::T> x = new self::C::_<self::C::•::T>();
x.{self::C::t} = t;
return x;
diff --git a/pkg/front_end/testcases/inference/constructors_infer_from_arguments_factory_calls_constructor.dart.direct.expect b/pkg/front_end/testcases/inference/constructors_infer_from_arguments_factory_calls_constructor.dart.direct.expect
index 538fd28..5fbdc88 100644
--- a/pkg/front_end/testcases/inference/constructors_infer_from_arguments_factory_calls_constructor.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/constructors_infer_from_arguments_factory_calls_constructor.dart.direct.expect
@@ -2,12 +2,12 @@
import self as self;
import "dart:core" as core;
-class A<T extends core::Object> extends core::Object {
+class A<T extends core::Object = dynamic> extends core::Object {
field self::A<self::A::T> f = new self::A::•<dynamic>();
constructor •() → void
: super core::Object::•()
;
- static factory factory<T extends core::Object>() → self::A<self::A::factory::T>
+ static factory factory<T extends core::Object = dynamic>() → self::A<self::A::factory::T>
return new self::A::•<dynamic>();
method m() → self::A<self::A::T>
return new self::A::•<dynamic>();
diff --git a/pkg/front_end/testcases/inference/constructors_infer_from_arguments_factory_calls_constructor.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/constructors_infer_from_arguments_factory_calls_constructor.dart.direct.transformed.expect
index 538fd28..5fbdc88 100644
--- a/pkg/front_end/testcases/inference/constructors_infer_from_arguments_factory_calls_constructor.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/constructors_infer_from_arguments_factory_calls_constructor.dart.direct.transformed.expect
@@ -2,12 +2,12 @@
import self as self;
import "dart:core" as core;
-class A<T extends core::Object> extends core::Object {
+class A<T extends core::Object = dynamic> extends core::Object {
field self::A<self::A::T> f = new self::A::•<dynamic>();
constructor •() → void
: super core::Object::•()
;
- static factory factory<T extends core::Object>() → self::A<self::A::factory::T>
+ static factory factory<T extends core::Object = dynamic>() → self::A<self::A::factory::T>
return new self::A::•<dynamic>();
method m() → self::A<self::A::T>
return new self::A::•<dynamic>();
diff --git a/pkg/front_end/testcases/inference/constructors_infer_from_arguments_factory_calls_constructor.dart.strong.expect b/pkg/front_end/testcases/inference/constructors_infer_from_arguments_factory_calls_constructor.dart.strong.expect
index ba0820f..4989080 100644
--- a/pkg/front_end/testcases/inference/constructors_infer_from_arguments_factory_calls_constructor.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/constructors_infer_from_arguments_factory_calls_constructor.dart.strong.expect
@@ -2,12 +2,12 @@
import self as self;
import "dart:core" as core;
-class A<T extends core::Object> extends core::Object {
+class A<T extends core::Object = dynamic> extends core::Object {
generic-covariant-impl generic-covariant-interface field self::A<self::A::T> f = new self::A::•<self::A::T>();
constructor •() → void
: super core::Object::•()
;
- static factory factory<T extends core::Object>() → self::A<self::A::factory::T>
+ static factory factory<T extends core::Object = dynamic>() → self::A<self::A::factory::T>
return new self::A::•<self::A::factory::T>();
method m() → self::A<self::A::T>
return new self::A::•<self::A::T>();
diff --git a/pkg/front_end/testcases/inference/constructors_infer_from_arguments_factory_calls_constructor.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/constructors_infer_from_arguments_factory_calls_constructor.dart.strong.transformed.expect
index ba0820f..4989080 100644
--- a/pkg/front_end/testcases/inference/constructors_infer_from_arguments_factory_calls_constructor.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/constructors_infer_from_arguments_factory_calls_constructor.dart.strong.transformed.expect
@@ -2,12 +2,12 @@
import self as self;
import "dart:core" as core;
-class A<T extends core::Object> extends core::Object {
+class A<T extends core::Object = dynamic> extends core::Object {
generic-covariant-impl generic-covariant-interface field self::A<self::A::T> f = new self::A::•<self::A::T>();
constructor •() → void
: super core::Object::•()
;
- static factory factory<T extends core::Object>() → self::A<self::A::factory::T>
+ static factory factory<T extends core::Object = dynamic>() → self::A<self::A::factory::T>
return new self::A::•<self::A::factory::T>();
method m() → self::A<self::A::T>
return new self::A::•<self::A::T>();
diff --git a/pkg/front_end/testcases/inference/constructors_infer_from_arguments_named.dart.direct.expect b/pkg/front_end/testcases/inference/constructors_infer_from_arguments_named.dart.direct.expect
index f244bce..16daec8 100644
--- a/pkg/front_end/testcases/inference/constructors_infer_from_arguments_named.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/constructors_infer_from_arguments_named.dart.direct.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class C<T extends core::Object> extends core::Object {
+class C<T extends core::Object = dynamic> extends core::Object {
field self::C::T t = null;
constructor named(core::List<self::C::T> t) → void
: super core::Object::•()
diff --git a/pkg/front_end/testcases/inference/constructors_infer_from_arguments_named.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/constructors_infer_from_arguments_named.dart.direct.transformed.expect
index f244bce..16daec8 100644
--- a/pkg/front_end/testcases/inference/constructors_infer_from_arguments_named.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/constructors_infer_from_arguments_named.dart.direct.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class C<T extends core::Object> extends core::Object {
+class C<T extends core::Object = dynamic> extends core::Object {
field self::C::T t = null;
constructor named(core::List<self::C::T> t) → void
: super core::Object::•()
diff --git a/pkg/front_end/testcases/inference/constructors_infer_from_arguments_named.dart.strong.expect b/pkg/front_end/testcases/inference/constructors_infer_from_arguments_named.dart.strong.expect
index 0e487ea..b0115e5 100644
--- a/pkg/front_end/testcases/inference/constructors_infer_from_arguments_named.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/constructors_infer_from_arguments_named.dart.strong.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class C<T extends core::Object> extends core::Object {
+class C<T extends core::Object = dynamic> extends core::Object {
generic-covariant-impl generic-covariant-interface field self::C::T t = null;
constructor named(core::List<self::C::T> t) → void
: super core::Object::•()
diff --git a/pkg/front_end/testcases/inference/constructors_infer_from_arguments_named.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/constructors_infer_from_arguments_named.dart.strong.transformed.expect
index 0e487ea..b0115e5 100644
--- a/pkg/front_end/testcases/inference/constructors_infer_from_arguments_named.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/constructors_infer_from_arguments_named.dart.strong.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class C<T extends core::Object> extends core::Object {
+class C<T extends core::Object = dynamic> extends core::Object {
generic-covariant-impl generic-covariant-interface field self::C::T t = null;
constructor named(core::List<self::C::T> t) → void
: super core::Object::•()
diff --git a/pkg/front_end/testcases/inference/constructors_infer_from_arguments_named_factory.dart.direct.expect b/pkg/front_end/testcases/inference/constructors_infer_from_arguments_named_factory.dart.direct.expect
index b56ab2c..7fbdfc2 100644
--- a/pkg/front_end/testcases/inference/constructors_infer_from_arguments_named_factory.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/constructors_infer_from_arguments_named_factory.dart.direct.expect
@@ -2,12 +2,12 @@
import self as self;
import "dart:core" as core;
-class C<T extends core::Object> extends core::Object {
+class C<T extends core::Object = dynamic> extends core::Object {
field self::C::T t = null;
constructor •() → void
: super core::Object::•()
;
- static factory named<T extends core::Object>(self::C::named::T t) → self::C<self::C::named::T> {
+ static factory named<T extends core::Object = dynamic>(self::C::named::T t) → self::C<self::C::named::T> {
dynamic x = new self::C::•<self::C::named::T>();
x.t = t;
return x;
diff --git a/pkg/front_end/testcases/inference/constructors_infer_from_arguments_named_factory.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/constructors_infer_from_arguments_named_factory.dart.direct.transformed.expect
index b56ab2c..7fbdfc2 100644
--- a/pkg/front_end/testcases/inference/constructors_infer_from_arguments_named_factory.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/constructors_infer_from_arguments_named_factory.dart.direct.transformed.expect
@@ -2,12 +2,12 @@
import self as self;
import "dart:core" as core;
-class C<T extends core::Object> extends core::Object {
+class C<T extends core::Object = dynamic> extends core::Object {
field self::C::T t = null;
constructor •() → void
: super core::Object::•()
;
- static factory named<T extends core::Object>(self::C::named::T t) → self::C<self::C::named::T> {
+ static factory named<T extends core::Object = dynamic>(self::C::named::T t) → self::C<self::C::named::T> {
dynamic x = new self::C::•<self::C::named::T>();
x.t = t;
return x;
diff --git a/pkg/front_end/testcases/inference/constructors_infer_from_arguments_named_factory.dart.strong.expect b/pkg/front_end/testcases/inference/constructors_infer_from_arguments_named_factory.dart.strong.expect
index 1b757b3..9fd81aa 100644
--- a/pkg/front_end/testcases/inference/constructors_infer_from_arguments_named_factory.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/constructors_infer_from_arguments_named_factory.dart.strong.expect
@@ -2,12 +2,12 @@
import self as self;
import "dart:core" as core;
-class C<T extends core::Object> extends core::Object {
+class C<T extends core::Object = dynamic> extends core::Object {
generic-covariant-impl generic-covariant-interface field self::C::T t = null;
constructor •() → void
: super core::Object::•()
;
- static factory named<T extends core::Object>(self::C::named::T t) → self::C<self::C::named::T> {
+ static factory named<T extends core::Object = dynamic>(self::C::named::T t) → self::C<self::C::named::T> {
self::C<self::C::named::T> x = new self::C::•<self::C::named::T>();
x.{self::C::t} = t;
return x;
diff --git a/pkg/front_end/testcases/inference/constructors_infer_from_arguments_named_factory.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/constructors_infer_from_arguments_named_factory.dart.strong.transformed.expect
index 1b757b3..9fd81aa 100644
--- a/pkg/front_end/testcases/inference/constructors_infer_from_arguments_named_factory.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/constructors_infer_from_arguments_named_factory.dart.strong.transformed.expect
@@ -2,12 +2,12 @@
import self as self;
import "dart:core" as core;
-class C<T extends core::Object> extends core::Object {
+class C<T extends core::Object = dynamic> extends core::Object {
generic-covariant-impl generic-covariant-interface field self::C::T t = null;
constructor •() → void
: super core::Object::•()
;
- static factory named<T extends core::Object>(self::C::named::T t) → self::C<self::C::named::T> {
+ static factory named<T extends core::Object = dynamic>(self::C::named::T t) → self::C<self::C::named::T> {
self::C<self::C::named::T> x = new self::C::•<self::C::named::T>();
x.{self::C::t} = t;
return x;
diff --git a/pkg/front_end/testcases/inference/constructors_infer_from_arguments_redirecting.dart.direct.expect b/pkg/front_end/testcases/inference/constructors_infer_from_arguments_redirecting.dart.direct.expect
index 41cb4fa..a985558 100644
--- a/pkg/front_end/testcases/inference/constructors_infer_from_arguments_redirecting.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/constructors_infer_from_arguments_redirecting.dart.direct.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class C<T extends core::Object> extends core::Object {
+class C<T extends core::Object = dynamic> extends core::Object {
field self::C::T t;
constructor •(self::C::T t) → void
: self::C::t = t, super core::Object::•()
diff --git a/pkg/front_end/testcases/inference/constructors_infer_from_arguments_redirecting.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/constructors_infer_from_arguments_redirecting.dart.direct.transformed.expect
index 41cb4fa..a985558 100644
--- a/pkg/front_end/testcases/inference/constructors_infer_from_arguments_redirecting.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/constructors_infer_from_arguments_redirecting.dart.direct.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class C<T extends core::Object> extends core::Object {
+class C<T extends core::Object = dynamic> extends core::Object {
field self::C::T t;
constructor •(self::C::T t) → void
: self::C::t = t, super core::Object::•()
diff --git a/pkg/front_end/testcases/inference/constructors_infer_from_arguments_redirecting.dart.strong.expect b/pkg/front_end/testcases/inference/constructors_infer_from_arguments_redirecting.dart.strong.expect
index d250ca0..b2a5c1a 100644
--- a/pkg/front_end/testcases/inference/constructors_infer_from_arguments_redirecting.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/constructors_infer_from_arguments_redirecting.dart.strong.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class C<T extends core::Object> extends core::Object {
+class C<T extends core::Object = dynamic> extends core::Object {
generic-covariant-impl generic-covariant-interface field self::C::T t;
constructor •(self::C::T t) → void
: self::C::t = t, super core::Object::•()
diff --git a/pkg/front_end/testcases/inference/constructors_infer_from_arguments_redirecting.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/constructors_infer_from_arguments_redirecting.dart.strong.transformed.expect
index d250ca0..b2a5c1a 100644
--- a/pkg/front_end/testcases/inference/constructors_infer_from_arguments_redirecting.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/constructors_infer_from_arguments_redirecting.dart.strong.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class C<T extends core::Object> extends core::Object {
+class C<T extends core::Object = dynamic> extends core::Object {
generic-covariant-impl generic-covariant-interface field self::C::T t;
constructor •(self::C::T t) → void
: self::C::t = t, super core::Object::•()
diff --git a/pkg/front_end/testcases/inference/constructors_infer_from_arguments_redirecting_factory.dart.direct.expect b/pkg/front_end/testcases/inference/constructors_infer_from_arguments_redirecting_factory.dart.direct.expect
index d2fa30a..4683180 100644
--- a/pkg/front_end/testcases/inference/constructors_infer_from_arguments_redirecting_factory.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/constructors_infer_from_arguments_redirecting_factory.dart.direct.expect
@@ -2,14 +2,14 @@
import self as self;
import "dart:core" as core;
-abstract class C<T extends core::Object> extends core::Object {
+abstract class C<T extends core::Object = dynamic> extends core::Object {
static field dynamic _redirecting# = <dynamic>[self::C::•];
abstract get t() → self::C::T;
abstract set t(self::C::T x) → void;
- static factory •<T extends core::Object>(self::C::•::T t) → self::C<self::C::•::T>
+ static factory •<T extends core::Object = dynamic>(self::C::•::T t) → self::C<self::C::•::T>
let dynamic #redirecting_factory = self::CImpl::• in let self::C::•::T #typeArg0 = null in invalid-expression;
}
-class CImpl<T extends core::Object> extends core::Object implements self::C<self::CImpl::T> {
+class CImpl<T extends core::Object = dynamic> extends core::Object implements self::C<self::CImpl::T> {
field self::CImpl::T t;
constructor •(self::CImpl::T t) → void
: self::CImpl::t = t, super core::Object::•()
diff --git a/pkg/front_end/testcases/inference/constructors_infer_from_arguments_redirecting_factory.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/constructors_infer_from_arguments_redirecting_factory.dart.direct.transformed.expect
index d2fa30a..4683180 100644
--- a/pkg/front_end/testcases/inference/constructors_infer_from_arguments_redirecting_factory.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/constructors_infer_from_arguments_redirecting_factory.dart.direct.transformed.expect
@@ -2,14 +2,14 @@
import self as self;
import "dart:core" as core;
-abstract class C<T extends core::Object> extends core::Object {
+abstract class C<T extends core::Object = dynamic> extends core::Object {
static field dynamic _redirecting# = <dynamic>[self::C::•];
abstract get t() → self::C::T;
abstract set t(self::C::T x) → void;
- static factory •<T extends core::Object>(self::C::•::T t) → self::C<self::C::•::T>
+ static factory •<T extends core::Object = dynamic>(self::C::•::T t) → self::C<self::C::•::T>
let dynamic #redirecting_factory = self::CImpl::• in let self::C::•::T #typeArg0 = null in invalid-expression;
}
-class CImpl<T extends core::Object> extends core::Object implements self::C<self::CImpl::T> {
+class CImpl<T extends core::Object = dynamic> extends core::Object implements self::C<self::CImpl::T> {
field self::CImpl::T t;
constructor •(self::CImpl::T t) → void
: self::CImpl::t = t, super core::Object::•()
diff --git a/pkg/front_end/testcases/inference/constructors_infer_from_arguments_redirecting_factory.dart.strong.expect b/pkg/front_end/testcases/inference/constructors_infer_from_arguments_redirecting_factory.dart.strong.expect
index 309c800..54b4372 100644
--- a/pkg/front_end/testcases/inference/constructors_infer_from_arguments_redirecting_factory.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/constructors_infer_from_arguments_redirecting_factory.dart.strong.expect
@@ -2,14 +2,14 @@
import self as self;
import "dart:core" as core;
-abstract class C<T extends core::Object> extends core::Object {
+abstract class C<T extends core::Object = dynamic> extends core::Object {
static field dynamic _redirecting# = <dynamic>[self::C::•];
abstract get t() → self::C::T;
abstract set t(generic-covariant-impl generic-covariant-interface self::C::T x) → void;
- static factory •<T extends core::Object>(self::C::•::T t) → self::C<self::C::•::T>
+ static factory •<T extends core::Object = dynamic>(self::C::•::T t) → self::C<self::C::•::T>
let dynamic #redirecting_factory = self::CImpl::• in let self::C::•::T #typeArg0 = null in invalid-expression;
}
-class CImpl<T extends core::Object> extends core::Object implements self::C<self::CImpl::T> {
+class CImpl<T extends core::Object = dynamic> extends core::Object implements self::C<self::CImpl::T> {
generic-covariant-impl generic-covariant-interface field self::CImpl::T t;
constructor •(self::CImpl::T t) → void
: self::CImpl::t = t, super core::Object::•()
diff --git a/pkg/front_end/testcases/inference/constructors_infer_from_arguments_redirecting_factory.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/constructors_infer_from_arguments_redirecting_factory.dart.strong.transformed.expect
index b46bcd1..2289573 100644
--- a/pkg/front_end/testcases/inference/constructors_infer_from_arguments_redirecting_factory.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/constructors_infer_from_arguments_redirecting_factory.dart.strong.transformed.expect
@@ -2,14 +2,14 @@
import self as self;
import "dart:core" as core;
-abstract class C<T extends core::Object> extends core::Object {
+abstract class C<T extends core::Object = dynamic> extends core::Object {
static field dynamic _redirecting# = <dynamic>[self::C::•];
abstract get t() → self::C::T;
abstract set t(generic-covariant-impl generic-covariant-interface self::C::T x) → void;
- static factory •<T extends core::Object>(self::C::•::T t) → self::C<self::C::•::T>
+ static factory •<T extends core::Object = dynamic>(self::C::•::T t) → self::C<self::C::•::T>
let<BottomType> #redirecting_factory = self::CImpl::• in let self::C::•::T #typeArg0 = null in invalid-expression;
}
-class CImpl<T extends core::Object> extends core::Object implements self::C<self::CImpl::T> {
+class CImpl<T extends core::Object = dynamic> extends core::Object implements self::C<self::CImpl::T> {
generic-covariant-impl generic-covariant-interface field self::CImpl::T t;
constructor •(self::CImpl::T t) → void
: self::CImpl::t = t, super core::Object::•()
diff --git a/pkg/front_end/testcases/inference/constructors_infer_from_arguments_redirecting_factory_to_factory.dart.direct.expect b/pkg/front_end/testcases/inference/constructors_infer_from_arguments_redirecting_factory_to_factory.dart.direct.expect
index 1975274..47f9df0 100644
--- a/pkg/front_end/testcases/inference/constructors_infer_from_arguments_redirecting_factory_to_factory.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/constructors_infer_from_arguments_redirecting_factory_to_factory.dart.direct.expect
@@ -2,19 +2,19 @@
import self as self;
import "dart:core" as core;
-abstract class C<T extends core::Object> extends core::Object {
+abstract class C<T extends core::Object = dynamic> extends core::Object {
static field dynamic _redirecting# = <dynamic>[self::C::•];
abstract get t() → self::C::T;
abstract set t(self::C::T x) → void;
- static factory •<T extends core::Object>(self::C::•::T t) → self::C<self::C::•::T>
+ static factory •<T extends core::Object = dynamic>(self::C::•::T t) → self::C<self::C::•::T>
let dynamic #redirecting_factory = self::CImpl::• in let self::C::•::T #typeArg0 = null in invalid-expression;
}
-class CImpl<T extends core::Object> extends core::Object implements self::C<self::CImpl::T> {
+class CImpl<T extends core::Object = dynamic> extends core::Object implements self::C<self::CImpl::T> {
field self::CImpl::T t;
constructor _(self::CImpl::T t) → void
: self::CImpl::t = t, super core::Object::•()
;
- static factory •<T extends core::Object>(self::CImpl::•::T t) → self::CImpl<self::CImpl::•::T>
+ static factory •<T extends core::Object = dynamic>(self::CImpl::•::T t) → self::CImpl<self::CImpl::•::T>
return new self::CImpl::_<dynamic>(t);
}
static method main() → dynamic {
diff --git a/pkg/front_end/testcases/inference/constructors_infer_from_arguments_redirecting_factory_to_factory.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/constructors_infer_from_arguments_redirecting_factory_to_factory.dart.direct.transformed.expect
index 1975274..47f9df0 100644
--- a/pkg/front_end/testcases/inference/constructors_infer_from_arguments_redirecting_factory_to_factory.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/constructors_infer_from_arguments_redirecting_factory_to_factory.dart.direct.transformed.expect
@@ -2,19 +2,19 @@
import self as self;
import "dart:core" as core;
-abstract class C<T extends core::Object> extends core::Object {
+abstract class C<T extends core::Object = dynamic> extends core::Object {
static field dynamic _redirecting# = <dynamic>[self::C::•];
abstract get t() → self::C::T;
abstract set t(self::C::T x) → void;
- static factory •<T extends core::Object>(self::C::•::T t) → self::C<self::C::•::T>
+ static factory •<T extends core::Object = dynamic>(self::C::•::T t) → self::C<self::C::•::T>
let dynamic #redirecting_factory = self::CImpl::• in let self::C::•::T #typeArg0 = null in invalid-expression;
}
-class CImpl<T extends core::Object> extends core::Object implements self::C<self::CImpl::T> {
+class CImpl<T extends core::Object = dynamic> extends core::Object implements self::C<self::CImpl::T> {
field self::CImpl::T t;
constructor _(self::CImpl::T t) → void
: self::CImpl::t = t, super core::Object::•()
;
- static factory •<T extends core::Object>(self::CImpl::•::T t) → self::CImpl<self::CImpl::•::T>
+ static factory •<T extends core::Object = dynamic>(self::CImpl::•::T t) → self::CImpl<self::CImpl::•::T>
return new self::CImpl::_<dynamic>(t);
}
static method main() → dynamic {
diff --git a/pkg/front_end/testcases/inference/constructors_infer_from_arguments_redirecting_factory_to_factory.dart.outline.expect b/pkg/front_end/testcases/inference/constructors_infer_from_arguments_redirecting_factory_to_factory.dart.outline.expect
index 37113f5..018e8a0 100644
--- a/pkg/front_end/testcases/inference/constructors_infer_from_arguments_redirecting_factory_to_factory.dart.outline.expect
+++ b/pkg/front_end/testcases/inference/constructors_infer_from_arguments_redirecting_factory_to_factory.dart.outline.expect
@@ -2,18 +2,18 @@
import self as self;
import "dart:core" as core;
-abstract class C<T extends core::Object> extends core::Object {
+abstract class C<T extends core::Object = dynamic> extends core::Object {
static field dynamic _redirecting# = <dynamic>[self::C::•];
abstract get t() → self::C::T;
abstract set t(self::C::T x) → void;
- static factory •<T extends core::Object>(self::C::•::T t) → self::C<self::C::•::T>
+ static factory •<T extends core::Object = dynamic>(self::C::•::T t) → self::C<self::C::•::T>
let dynamic #redirecting_factory = self::CImpl::• in let self::C::•::T #typeArg0 = null in invalid-expression;
}
-class CImpl<T extends core::Object> extends core::Object implements self::C<self::CImpl::T> {
+class CImpl<T extends core::Object = dynamic> extends core::Object implements self::C<self::CImpl::T> {
field self::CImpl::T t;
constructor _(self::CImpl::T t) → void
;
- static factory •<T extends core::Object>(self::CImpl::•::T t) → self::CImpl<self::CImpl::•::T>
+ static factory •<T extends core::Object = dynamic>(self::CImpl::•::T t) → self::CImpl<self::CImpl::•::T>
;
}
static method main() → dynamic
diff --git a/pkg/front_end/testcases/inference/constructors_infer_from_arguments_redirecting_factory_to_factory.dart.strong.expect b/pkg/front_end/testcases/inference/constructors_infer_from_arguments_redirecting_factory_to_factory.dart.strong.expect
index 5e10461..111277c 100644
--- a/pkg/front_end/testcases/inference/constructors_infer_from_arguments_redirecting_factory_to_factory.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/constructors_infer_from_arguments_redirecting_factory_to_factory.dart.strong.expect
@@ -2,19 +2,19 @@
import self as self;
import "dart:core" as core;
-abstract class C<T extends core::Object> extends core::Object {
+abstract class C<T extends core::Object = dynamic> extends core::Object {
static field dynamic _redirecting# = <dynamic>[self::C::•];
abstract get t() → self::C::T;
abstract set t(generic-covariant-impl generic-covariant-interface self::C::T x) → void;
- static factory •<T extends core::Object>(self::C::•::T t) → self::C<self::C::•::T>
+ static factory •<T extends core::Object = dynamic>(self::C::•::T t) → self::C<self::C::•::T>
let dynamic #redirecting_factory = self::CImpl::• in let self::C::•::T #typeArg0 = null in invalid-expression;
}
-class CImpl<T extends core::Object> extends core::Object implements self::C<self::CImpl::T> {
+class CImpl<T extends core::Object = dynamic> extends core::Object implements self::C<self::CImpl::T> {
generic-covariant-impl generic-covariant-interface field self::CImpl::T t;
constructor _(self::CImpl::T t) → void
: self::CImpl::t = t, super core::Object::•()
;
- static factory •<T extends core::Object>(self::CImpl::•::T t) → self::CImpl<self::CImpl::•::T>
+ static factory •<T extends core::Object = dynamic>(self::CImpl::•::T t) → self::CImpl<self::CImpl::•::T>
return new self::CImpl::_<self::CImpl::•::T>(t);
}
static method main() → dynamic {
diff --git a/pkg/front_end/testcases/inference/constructors_infer_from_arguments_redirecting_factory_to_factory.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/constructors_infer_from_arguments_redirecting_factory_to_factory.dart.strong.transformed.expect
index e599360..14d4ed3 100644
--- a/pkg/front_end/testcases/inference/constructors_infer_from_arguments_redirecting_factory_to_factory.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/constructors_infer_from_arguments_redirecting_factory_to_factory.dart.strong.transformed.expect
@@ -2,19 +2,19 @@
import self as self;
import "dart:core" as core;
-abstract class C<T extends core::Object> extends core::Object {
+abstract class C<T extends core::Object = dynamic> extends core::Object {
static field dynamic _redirecting# = <dynamic>[self::C::•];
abstract get t() → self::C::T;
abstract set t(generic-covariant-impl generic-covariant-interface self::C::T x) → void;
- static factory •<T extends core::Object>(self::C::•::T t) → self::C<self::C::•::T>
- let <T extends core::Object>(self::CImpl::•::T) → self::CImpl<self::CImpl::•::T> #redirecting_factory = self::CImpl::• in let self::C::•::T #typeArg0 = null in invalid-expression;
+ static factory •<T extends core::Object = dynamic>(self::C::•::T t) → self::C<self::C::•::T>
+ let <T extends core::Object = dynamic>(self::CImpl::•::T) → self::CImpl<self::CImpl::•::T> #redirecting_factory = self::CImpl::• in let self::C::•::T #typeArg0 = null in invalid-expression;
}
-class CImpl<T extends core::Object> extends core::Object implements self::C<self::CImpl::T> {
+class CImpl<T extends core::Object = dynamic> extends core::Object implements self::C<self::CImpl::T> {
generic-covariant-impl generic-covariant-interface field self::CImpl::T t;
constructor _(self::CImpl::T t) → void
: self::CImpl::t = t, super core::Object::•()
;
- static factory •<T extends core::Object>(self::CImpl::•::T t) → self::CImpl<self::CImpl::•::T>
+ static factory •<T extends core::Object = dynamic>(self::CImpl::•::T t) → self::CImpl<self::CImpl::•::T>
return new self::CImpl::_<self::CImpl::•::T>(t);
}
static method main() → dynamic {
diff --git a/pkg/front_end/testcases/inference/constructors_inference_f_bounded.dart.direct.expect b/pkg/front_end/testcases/inference/constructors_inference_f_bounded.dart.direct.expect
index 25d5c94..24bc890 100644
--- a/pkg/front_end/testcases/inference/constructors_inference_f_bounded.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/constructors_inference_f_bounded.dart.direct.expect
@@ -2,12 +2,12 @@
import self as self;
import "dart:core" as core;
-class Clonable<T extends core::Object> extends core::Object {
+class Clonable<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class Pair<T extends self::Clonable<self::Pair::T>, U extends self::Clonable<self::Pair::U>> extends core::Object {
+class Pair<T extends self::Clonable<self::Pair::T> = dynamic, U extends self::Clonable<self::Pair::U> = dynamic> extends core::Object {
field self::Pair::T t;
field self::Pair::U u;
constructor •(self::Pair::T t, self::Pair::U u) → void
diff --git a/pkg/front_end/testcases/inference/constructors_inference_f_bounded.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/constructors_inference_f_bounded.dart.direct.transformed.expect
index 25d5c94..24bc890 100644
--- a/pkg/front_end/testcases/inference/constructors_inference_f_bounded.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/constructors_inference_f_bounded.dart.direct.transformed.expect
@@ -2,12 +2,12 @@
import self as self;
import "dart:core" as core;
-class Clonable<T extends core::Object> extends core::Object {
+class Clonable<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class Pair<T extends self::Clonable<self::Pair::T>, U extends self::Clonable<self::Pair::U>> extends core::Object {
+class Pair<T extends self::Clonable<self::Pair::T> = dynamic, U extends self::Clonable<self::Pair::U> = dynamic> extends core::Object {
field self::Pair::T t;
field self::Pair::U u;
constructor •(self::Pair::T t, self::Pair::U u) → void
diff --git a/pkg/front_end/testcases/inference/constructors_inference_f_bounded.dart.strong.expect b/pkg/front_end/testcases/inference/constructors_inference_f_bounded.dart.strong.expect
index 6b36422..d22785f 100644
--- a/pkg/front_end/testcases/inference/constructors_inference_f_bounded.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/constructors_inference_f_bounded.dart.strong.expect
@@ -2,12 +2,12 @@
import self as self;
import "dart:core" as core;
-class Clonable<T extends core::Object> extends core::Object {
+class Clonable<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class Pair<T extends self::Clonable<self::Pair::T>, U extends self::Clonable<self::Pair::U>> extends core::Object {
+class Pair<T extends self::Clonable<self::Pair::T> = self::Clonable<dynamic>, U extends self::Clonable<self::Pair::U> = self::Clonable<dynamic>> extends core::Object {
generic-covariant-impl generic-covariant-interface field self::Pair::T t;
generic-covariant-impl generic-covariant-interface field self::Pair::U u;
constructor •(self::Pair::T t, self::Pair::U u) → void
diff --git a/pkg/front_end/testcases/inference/constructors_inference_f_bounded.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/constructors_inference_f_bounded.dart.strong.transformed.expect
index 6b36422..d22785f 100644
--- a/pkg/front_end/testcases/inference/constructors_inference_f_bounded.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/constructors_inference_f_bounded.dart.strong.transformed.expect
@@ -2,12 +2,12 @@
import self as self;
import "dart:core" as core;
-class Clonable<T extends core::Object> extends core::Object {
+class Clonable<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class Pair<T extends self::Clonable<self::Pair::T>, U extends self::Clonable<self::Pair::U>> extends core::Object {
+class Pair<T extends self::Clonable<self::Pair::T> = self::Clonable<dynamic>, U extends self::Clonable<self::Pair::U> = self::Clonable<dynamic>> extends core::Object {
generic-covariant-impl generic-covariant-interface field self::Pair::T t;
generic-covariant-impl generic-covariant-interface field self::Pair::U u;
constructor •(self::Pair::T t, self::Pair::U u) → void
diff --git a/pkg/front_end/testcases/inference/constructors_reverse_type_parameters.dart.direct.expect b/pkg/front_end/testcases/inference/constructors_reverse_type_parameters.dart.direct.expect
index dcf34f0..af3546f 100644
--- a/pkg/front_end/testcases/inference/constructors_reverse_type_parameters.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/constructors_reverse_type_parameters.dart.direct.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class Pair<T extends core::Object, U extends core::Object> extends core::Object {
+class Pair<T extends core::Object = dynamic, U extends core::Object = dynamic> extends core::Object {
field self::Pair::T t;
field self::Pair::U u;
constructor •(self::Pair::T t, self::Pair::U u) → void
diff --git a/pkg/front_end/testcases/inference/constructors_reverse_type_parameters.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/constructors_reverse_type_parameters.dart.direct.transformed.expect
index dcf34f0..af3546f 100644
--- a/pkg/front_end/testcases/inference/constructors_reverse_type_parameters.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/constructors_reverse_type_parameters.dart.direct.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class Pair<T extends core::Object, U extends core::Object> extends core::Object {
+class Pair<T extends core::Object = dynamic, U extends core::Object = dynamic> extends core::Object {
field self::Pair::T t;
field self::Pair::U u;
constructor •(self::Pair::T t, self::Pair::U u) → void
diff --git a/pkg/front_end/testcases/inference/constructors_reverse_type_parameters.dart.strong.expect b/pkg/front_end/testcases/inference/constructors_reverse_type_parameters.dart.strong.expect
index 7db8910..777d093 100644
--- a/pkg/front_end/testcases/inference/constructors_reverse_type_parameters.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/constructors_reverse_type_parameters.dart.strong.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class Pair<T extends core::Object, U extends core::Object> extends core::Object {
+class Pair<T extends core::Object = dynamic, U extends core::Object = dynamic> extends core::Object {
generic-covariant-impl generic-covariant-interface field self::Pair::T t;
generic-covariant-impl generic-covariant-interface field self::Pair::U u;
constructor •(self::Pair::T t, self::Pair::U u) → void
diff --git a/pkg/front_end/testcases/inference/constructors_reverse_type_parameters.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/constructors_reverse_type_parameters.dart.strong.transformed.expect
index 7db8910..777d093 100644
--- a/pkg/front_end/testcases/inference/constructors_reverse_type_parameters.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/constructors_reverse_type_parameters.dart.strong.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class Pair<T extends core::Object, U extends core::Object> extends core::Object {
+class Pair<T extends core::Object = dynamic, U extends core::Object = dynamic> extends core::Object {
generic-covariant-impl generic-covariant-interface field self::Pair::T t;
generic-covariant-impl generic-covariant-interface field self::Pair::U u;
constructor •(self::Pair::T t, self::Pair::U u) → void
diff --git a/pkg/front_end/testcases/inference/downward_inference_miscellaneous.dart.direct.expect b/pkg/front_end/testcases/inference/downward_inference_miscellaneous.dart.direct.expect
index 3fbf5b6..f8dcee7 100644
--- a/pkg/front_end/testcases/inference/downward_inference_miscellaneous.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/downward_inference_miscellaneous.dart.direct.expect
@@ -2,8 +2,8 @@
import self as self;
import "dart:core" as core;
-typedef Function2<S extends core::Object, T extends core::Object> = (S) → T;
-class A<T extends core::Object> extends core::Object {
+typedef Function2<S extends core::Object = dynamic, T extends core::Object = dynamic> = (S) → T;
+class A<T extends core::Object = dynamic> extends core::Object {
field (self::A::T) → self::A::T x;
constructor •((self::A::T) → self::A::T x) → void
: self::A::x = x, super core::Object::•()
diff --git a/pkg/front_end/testcases/inference/downward_inference_miscellaneous.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/downward_inference_miscellaneous.dart.direct.transformed.expect
index 3fbf5b6..f8dcee7 100644
--- a/pkg/front_end/testcases/inference/downward_inference_miscellaneous.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/downward_inference_miscellaneous.dart.direct.transformed.expect
@@ -2,8 +2,8 @@
import self as self;
import "dart:core" as core;
-typedef Function2<S extends core::Object, T extends core::Object> = (S) → T;
-class A<T extends core::Object> extends core::Object {
+typedef Function2<S extends core::Object = dynamic, T extends core::Object = dynamic> = (S) → T;
+class A<T extends core::Object = dynamic> extends core::Object {
field (self::A::T) → self::A::T x;
constructor •((self::A::T) → self::A::T x) → void
: self::A::x = x, super core::Object::•()
diff --git a/pkg/front_end/testcases/inference/downward_inference_miscellaneous.dart.strong.expect b/pkg/front_end/testcases/inference/downward_inference_miscellaneous.dart.strong.expect
index 4a97594..7fa4e4d 100644
--- a/pkg/front_end/testcases/inference/downward_inference_miscellaneous.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/downward_inference_miscellaneous.dart.strong.expect
@@ -2,8 +2,8 @@
import self as self;
import "dart:core" as core;
-typedef Function2<S extends core::Object, T extends core::Object> = (S) → T;
-class A<T extends core::Object> extends core::Object {
+typedef Function2<S extends core::Object = dynamic, T extends core::Object = dynamic> = (S) → T;
+class A<T extends core::Object = dynamic> extends core::Object {
generic-covariant-impl generic-covariant-interface field (self::A::T) → self::A::T x;
constructor •((self::A::T) → self::A::T x) → void
: self::A::x = x, super core::Object::•()
diff --git a/pkg/front_end/testcases/inference/downward_inference_miscellaneous.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/downward_inference_miscellaneous.dart.strong.transformed.expect
index 4a97594..7fa4e4d 100644
--- a/pkg/front_end/testcases/inference/downward_inference_miscellaneous.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/downward_inference_miscellaneous.dart.strong.transformed.expect
@@ -2,8 +2,8 @@
import self as self;
import "dart:core" as core;
-typedef Function2<S extends core::Object, T extends core::Object> = (S) → T;
-class A<T extends core::Object> extends core::Object {
+typedef Function2<S extends core::Object = dynamic, T extends core::Object = dynamic> = (S) → T;
+class A<T extends core::Object = dynamic> extends core::Object {
generic-covariant-impl generic-covariant-interface field (self::A::T) → self::A::T x;
constructor •((self::A::T) → self::A::T x) → void
: self::A::x = x, super core::Object::•()
diff --git a/pkg/front_end/testcases/inference/downwards_inference_annotations_type_variable.dart.direct.expect b/pkg/front_end/testcases/inference/downwards_inference_annotations_type_variable.dart.direct.expect
index c798f57..4ad6c42 100644
--- a/pkg/front_end/testcases/inference/downwards_inference_annotations_type_variable.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/downwards_inference_annotations_type_variable.dart.direct.expect
@@ -2,13 +2,13 @@
import self as self;
import "dart:core" as core;
-typedef F<T extends core::Object> = () → void;
+typedef F<T extends core::Object = dynamic> = () → void;
class Foo extends core::Object {
const constructor •(core::List<core::String> l) → void
: super core::Object::•()
;
}
-class C<T extends core::Object> extends core::Object {
+class C<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
@@ -17,7 +17,7 @@
synthetic constructor •() → void
: super core::Object::•()
;
- method m<T extends core::Object>() → void {}
+ method m<T extends core::Object = dynamic>() → void {}
}
-static method f<T extends core::Object>() → void {}
+static method f<T extends core::Object = dynamic>() → void {}
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/downwards_inference_annotations_type_variable.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/downwards_inference_annotations_type_variable.dart.direct.transformed.expect
index c798f57..4ad6c42 100644
--- a/pkg/front_end/testcases/inference/downwards_inference_annotations_type_variable.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/downwards_inference_annotations_type_variable.dart.direct.transformed.expect
@@ -2,13 +2,13 @@
import self as self;
import "dart:core" as core;
-typedef F<T extends core::Object> = () → void;
+typedef F<T extends core::Object = dynamic> = () → void;
class Foo extends core::Object {
const constructor •(core::List<core::String> l) → void
: super core::Object::•()
;
}
-class C<T extends core::Object> extends core::Object {
+class C<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
@@ -17,7 +17,7 @@
synthetic constructor •() → void
: super core::Object::•()
;
- method m<T extends core::Object>() → void {}
+ method m<T extends core::Object = dynamic>() → void {}
}
-static method f<T extends core::Object>() → void {}
+static method f<T extends core::Object = dynamic>() → void {}
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/downwards_inference_annotations_type_variable.dart.outline.expect b/pkg/front_end/testcases/inference/downwards_inference_annotations_type_variable.dart.outline.expect
index 2c07f4f..bc221a6 100644
--- a/pkg/front_end/testcases/inference/downwards_inference_annotations_type_variable.dart.outline.expect
+++ b/pkg/front_end/testcases/inference/downwards_inference_annotations_type_variable.dart.outline.expect
@@ -2,22 +2,22 @@
import self as self;
import "dart:core" as core;
-typedef F<T extends core::Object> = () → void;
+typedef F<T extends core::Object = dynamic> = () → void;
class Foo extends core::Object {
const constructor •(core::List<core::String> l) → void
;
}
-class C<T extends core::Object> extends core::Object {
+class C<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
;
}
class D extends core::Object {
synthetic constructor •() → void
;
- method m<T extends core::Object>() → void
+ method m<T extends core::Object = dynamic>() → void
;
}
-static method f<T extends core::Object>() → void
+static method f<T extends core::Object = dynamic>() → void
;
static method main() → dynamic
;
diff --git a/pkg/front_end/testcases/inference/downwards_inference_annotations_type_variable_local.dart.direct.expect b/pkg/front_end/testcases/inference/downwards_inference_annotations_type_variable_local.dart.direct.expect
index 4d24a73..7f49df8 100644
--- a/pkg/front_end/testcases/inference/downwards_inference_annotations_type_variable_local.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/downwards_inference_annotations_type_variable_local.dart.direct.expect
@@ -8,7 +8,7 @@
;
}
static method test() → void {
- function f<T extends core::Object>() → void {}
- dynamic x = <T extends core::Object>() → dynamic {};
+ function f<T extends core::Object = dynamic>() → void {}
+ dynamic x = <T extends core::Object = dynamic>() → dynamic {};
}
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/downwards_inference_annotations_type_variable_local.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/downwards_inference_annotations_type_variable_local.dart.direct.transformed.expect
index 4d24a73..7f49df8 100644
--- a/pkg/front_end/testcases/inference/downwards_inference_annotations_type_variable_local.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/downwards_inference_annotations_type_variable_local.dart.direct.transformed.expect
@@ -8,7 +8,7 @@
;
}
static method test() → void {
- function f<T extends core::Object>() → void {}
- dynamic x = <T extends core::Object>() → dynamic {};
+ function f<T extends core::Object = dynamic>() → void {}
+ dynamic x = <T extends core::Object = dynamic>() → dynamic {};
}
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/downwards_inference_for_each.dart.direct.expect b/pkg/front_end/testcases/inference/downwards_inference_for_each.dart.direct.expect
index faa662c..7a1ba88 100644
--- a/pkg/front_end/testcases/inference/downwards_inference_for_each.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/downwards_inference_for_each.dart.direct.expect
@@ -3,11 +3,11 @@
import "dart:core" as core;
import "dart:async" as asy;
-abstract class MyStream<T extends core::Object> extends asy::Stream<self::MyStream::T> {
- static factory •<T extends core::Object>() → self::MyStream<self::MyStream::•::T>
+abstract class MyStream<T extends core::Object = dynamic> extends asy::Stream<self::MyStream::T> {
+ static factory •<T extends core::Object = dynamic>() → self::MyStream<self::MyStream::•::T>
return null;
}
-static method F<T extends core::Object>() → self::F::T
+static method F<T extends core::Object = dynamic>() → self::F::T
return null;
static method f() → asy::Future<dynamic> async {
dynamic d;
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 ef5dc3a..3ef1a43 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
@@ -3,11 +3,11 @@
import "dart:core" as core;
import "dart:async" as asy;
-abstract class MyStream<T extends core::Object> extends asy::Stream<self::MyStream::T> {
- static factory •<T extends core::Object>() → self::MyStream<self::MyStream::•::T>
+abstract class MyStream<T extends core::Object = dynamic> extends asy::Stream<self::MyStream::T> {
+ static factory •<T extends core::Object = dynamic>() → self::MyStream<self::MyStream::•::T>
return null;
}
-static method F<T extends core::Object>() → self::F::T
+static method F<T extends core::Object = dynamic>() → self::F::T
return null;
static method f() → asy::Future<dynamic> /* originally async */ {
final asy::Completer<dynamic> :completer = asy::Completer::sync<dynamic>();
diff --git a/pkg/front_end/testcases/inference/downwards_inference_for_each.dart.strong.expect b/pkg/front_end/testcases/inference/downwards_inference_for_each.dart.strong.expect
index 86b9f5d..ad5f6d8 100644
--- a/pkg/front_end/testcases/inference/downwards_inference_for_each.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/downwards_inference_for_each.dart.strong.expect
@@ -3,11 +3,11 @@
import "dart:core" as core;
import "dart:async" as asy;
-abstract class MyStream<T extends core::Object> extends asy::Stream<self::MyStream::T> {
- static factory •<T extends core::Object>() → self::MyStream<self::MyStream::•::T>
+abstract class MyStream<T extends core::Object = dynamic> extends asy::Stream<self::MyStream::T> {
+ static factory •<T extends core::Object = dynamic>() → self::MyStream<self::MyStream::•::T>
return null;
}
-static method F<T extends core::Object>() → self::F::T
+static method F<T extends core::Object = dynamic>() → self::F::T
return null;
static method f() → asy::Future<dynamic> async {
dynamic d;
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 2138cb0..7dee1bb 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
@@ -3,11 +3,11 @@
import "dart:core" as core;
import "dart:async" as asy;
-abstract class MyStream<T extends core::Object> extends asy::Stream<self::MyStream::T> {
- static factory •<T extends core::Object>() → self::MyStream<self::MyStream::•::T>
+abstract class MyStream<T extends core::Object = dynamic> extends asy::Stream<self::MyStream::T> {
+ static factory •<T extends core::Object = dynamic>() → self::MyStream<self::MyStream::•::T>
return null;
}
-static method F<T extends core::Object>() → self::F::T
+static method F<T extends core::Object = dynamic>() → self::F::T
return null;
static method f() → asy::Future<dynamic> /* originally async */ {
final asy::Completer<dynamic> :completer = asy::Completer::sync<dynamic>();
diff --git a/pkg/front_end/testcases/inference/downwards_inference_initializing_formal_default_formal.dart.direct.expect b/pkg/front_end/testcases/inference/downwards_inference_initializing_formal_default_formal.dart.direct.expect
index cb0d81e..93b9a23 100644
--- a/pkg/front_end/testcases/inference/downwards_inference_initializing_formal_default_formal.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/downwards_inference_initializing_formal_default_formal.dart.direct.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-typedef Function2<S extends core::Object, T extends core::Object> = ([S]) → T;
+typedef Function2<S extends core::Object = dynamic, T extends core::Object = dynamic> = ([S]) → T;
class Foo extends core::Object {
field core::List<core::int> x;
constructor •([core::List<core::int> x = const <dynamic>[1]]) → void
diff --git a/pkg/front_end/testcases/inference/downwards_inference_initializing_formal_default_formal.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/downwards_inference_initializing_formal_default_formal.dart.direct.transformed.expect
index cb0d81e..93b9a23 100644
--- a/pkg/front_end/testcases/inference/downwards_inference_initializing_formal_default_formal.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/downwards_inference_initializing_formal_default_formal.dart.direct.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-typedef Function2<S extends core::Object, T extends core::Object> = ([S]) → T;
+typedef Function2<S extends core::Object = dynamic, T extends core::Object = dynamic> = ([S]) → T;
class Foo extends core::Object {
field core::List<core::int> x;
constructor •([core::List<core::int> x = const <dynamic>[1]]) → void
diff --git a/pkg/front_end/testcases/inference/downwards_inference_initializing_formal_default_formal.dart.strong.expect b/pkg/front_end/testcases/inference/downwards_inference_initializing_formal_default_formal.dart.strong.expect
index 29996bd..40bcf29 100644
--- a/pkg/front_end/testcases/inference/downwards_inference_initializing_formal_default_formal.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/downwards_inference_initializing_formal_default_formal.dart.strong.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-typedef Function2<S extends core::Object, T extends core::Object> = ([S]) → T;
+typedef Function2<S extends core::Object = dynamic, T extends core::Object = dynamic> = ([S]) → T;
class Foo extends core::Object {
field core::List<core::int> x;
constructor •([core::List<core::int> x = const <core::int>[1]]) → void
diff --git a/pkg/front_end/testcases/inference/downwards_inference_initializing_formal_default_formal.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/downwards_inference_initializing_formal_default_formal.dart.strong.transformed.expect
index 29996bd..40bcf29 100644
--- a/pkg/front_end/testcases/inference/downwards_inference_initializing_formal_default_formal.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/downwards_inference_initializing_formal_default_formal.dart.strong.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-typedef Function2<S extends core::Object, T extends core::Object> = ([S]) → T;
+typedef Function2<S extends core::Object = dynamic, T extends core::Object = dynamic> = ([S]) → T;
class Foo extends core::Object {
field core::List<core::int> x;
constructor •([core::List<core::int> x = const <core::int>[1]]) → void
diff --git a/pkg/front_end/testcases/inference/downwards_inference_inside_top_level.dart.direct.expect b/pkg/front_end/testcases/inference/downwards_inference_inside_top_level.dart.direct.expect
index ca9246e..bd69c63 100644
--- a/pkg/front_end/testcases/inference/downwards_inference_inside_top_level.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/downwards_inference_inside_top_level.dart.direct.expect
@@ -8,7 +8,7 @@
: super core::Object::•()
;
}
-class B<T extends core::Object> extends core::Object {
+class B<T extends core::Object = dynamic> extends core::Object {
constructor •(self::B::T x) → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/inference/downwards_inference_inside_top_level.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/downwards_inference_inside_top_level.dart.direct.transformed.expect
index ca9246e..bd69c63 100644
--- a/pkg/front_end/testcases/inference/downwards_inference_inside_top_level.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/downwards_inference_inside_top_level.dart.direct.transformed.expect
@@ -8,7 +8,7 @@
: super core::Object::•()
;
}
-class B<T extends core::Object> extends core::Object {
+class B<T extends core::Object = dynamic> extends core::Object {
constructor •(self::B::T x) → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/inference/downwards_inference_inside_top_level.dart.strong.expect b/pkg/front_end/testcases/inference/downwards_inference_inside_top_level.dart.strong.expect
index b742af9..6c7e70c 100644
--- a/pkg/front_end/testcases/inference/downwards_inference_inside_top_level.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/downwards_inference_inside_top_level.dart.strong.expect
@@ -8,7 +8,7 @@
: super core::Object::•()
;
}
-class B<T extends core::Object> extends core::Object {
+class B<T extends core::Object = dynamic> extends core::Object {
constructor •(self::B::T x) → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/inference/downwards_inference_inside_top_level.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/downwards_inference_inside_top_level.dart.strong.transformed.expect
index e377e03..8227e66 100644
--- a/pkg/front_end/testcases/inference/downwards_inference_inside_top_level.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/downwards_inference_inside_top_level.dart.strong.transformed.expect
@@ -8,7 +8,7 @@
: super core::Object::•()
;
}
-class B<T extends core::Object> extends core::Object {
+class B<T extends core::Object = dynamic> extends core::Object {
constructor •(self::B::T x) → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/inference/downwards_inference_inside_top_level_2.dart.direct.expect b/pkg/front_end/testcases/inference/downwards_inference_inside_top_level_2.dart.direct.expect
index da516ac..771832d 100644
--- a/pkg/front_end/testcases/inference/downwards_inference_inside_top_level_2.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/downwards_inference_inside_top_level_2.dart.direct.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class A<T extends core::Object> extends core::Object {
+class A<T extends core::Object = dynamic> extends core::Object {
constructor •(self::A::T x) → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/inference/downwards_inference_inside_top_level_2.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/downwards_inference_inside_top_level_2.dart.direct.transformed.expect
index da516ac..771832d 100644
--- a/pkg/front_end/testcases/inference/downwards_inference_inside_top_level_2.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/downwards_inference_inside_top_level_2.dart.direct.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class A<T extends core::Object> extends core::Object {
+class A<T extends core::Object = dynamic> extends core::Object {
constructor •(self::A::T x) → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/inference/downwards_inference_inside_top_level_2.dart.outline.expect b/pkg/front_end/testcases/inference/downwards_inference_inside_top_level_2.dart.outline.expect
index 12d8079..f9d3fb9 100644
--- a/pkg/front_end/testcases/inference/downwards_inference_inside_top_level_2.dart.outline.expect
+++ b/pkg/front_end/testcases/inference/downwards_inference_inside_top_level_2.dart.outline.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class A<T extends core::Object> extends core::Object {
+class A<T extends core::Object = dynamic> extends core::Object {
constructor •(self::A::T x) → void
;
}
diff --git a/pkg/front_end/testcases/inference/downwards_inference_inside_top_level_2.dart.strong.expect b/pkg/front_end/testcases/inference/downwards_inference_inside_top_level_2.dart.strong.expect
index d0e29da..c52cb1b 100644
--- a/pkg/front_end/testcases/inference/downwards_inference_inside_top_level_2.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/downwards_inference_inside_top_level_2.dart.strong.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class A<T extends core::Object> extends core::Object {
+class A<T extends core::Object = dynamic> extends core::Object {
constructor •(self::A::T x) → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/inference/downwards_inference_inside_top_level_2.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/downwards_inference_inside_top_level_2.dart.strong.transformed.expect
index d0e29da..c52cb1b 100644
--- a/pkg/front_end/testcases/inference/downwards_inference_inside_top_level_2.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/downwards_inference_inside_top_level_2.dart.strong.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class A<T extends core::Object> extends core::Object {
+class A<T extends core::Object = dynamic> extends core::Object {
constructor •(self::A::T x) → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/inference/downwards_inference_on_function_expressions.dart.direct.expect b/pkg/front_end/testcases/inference/downwards_inference_on_function_expressions.dart.direct.expect
index 12eb980..c3123ef 100644
--- a/pkg/front_end/testcases/inference/downwards_inference_on_function_expressions.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/downwards_inference_on_function_expressions.dart.direct.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-typedef Function2<S extends core::Object, T extends core::Object> = (S) → T;
+typedef Function2<S extends core::Object = dynamic, T extends core::Object = dynamic> = (S) → T;
static method test() → void {
{
(core::int) → core::String l0 = (core::int x) → dynamic => null;
diff --git a/pkg/front_end/testcases/inference/downwards_inference_on_function_expressions.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/downwards_inference_on_function_expressions.dart.direct.transformed.expect
index 12eb980..c3123ef 100644
--- a/pkg/front_end/testcases/inference/downwards_inference_on_function_expressions.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/downwards_inference_on_function_expressions.dart.direct.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-typedef Function2<S extends core::Object, T extends core::Object> = (S) → T;
+typedef Function2<S extends core::Object = dynamic, T extends core::Object = dynamic> = (S) → T;
static method test() → void {
{
(core::int) → core::String l0 = (core::int x) → dynamic => null;
diff --git a/pkg/front_end/testcases/inference/downwards_inference_on_function_expressions.dart.strong.expect b/pkg/front_end/testcases/inference/downwards_inference_on_function_expressions.dart.strong.expect
index 419a2d6..2f7fa93 100644
--- a/pkg/front_end/testcases/inference/downwards_inference_on_function_expressions.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/downwards_inference_on_function_expressions.dart.strong.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-typedef Function2<S extends core::Object, T extends core::Object> = (S) → T;
+typedef Function2<S extends core::Object = dynamic, T extends core::Object = dynamic> = (S) → T;
static method test() → void {
{
(core::int) → core::String l0 = (core::int x) → core::Null => null;
diff --git a/pkg/front_end/testcases/inference/downwards_inference_on_function_expressions.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/downwards_inference_on_function_expressions.dart.strong.transformed.expect
index 7e72e90..d4df104 100644
--- a/pkg/front_end/testcases/inference/downwards_inference_on_function_expressions.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/downwards_inference_on_function_expressions.dart.strong.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-typedef Function2<S extends core::Object, T extends core::Object> = (S) → T;
+typedef Function2<S extends core::Object = dynamic, T extends core::Object = dynamic> = (S) → T;
static method test() → void {
{
(core::int) → core::String l0 = (core::int x) → core::Null => null;
diff --git a/pkg/front_end/testcases/inference/downwards_inference_on_function_of_t_using_the_t.dart.direct.expect b/pkg/front_end/testcases/inference/downwards_inference_on_function_of_t_using_the_t.dart.direct.expect
index 5ffe78d..169595b 100644
--- a/pkg/front_end/testcases/inference/downwards_inference_on_function_of_t_using_the_t.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/downwards_inference_on_function_of_t_using_the_t.dart.direct.expect
@@ -4,16 +4,16 @@
static method main() → void {
{
- function f<T extends core::Object>(T x) → T
+ function f<T extends core::Object = dynamic>(T x) → T
return null;
dynamic v1 = f;
- v1 = <S extends core::Object>(dynamic x) → dynamic => x;
+ v1 = <S extends core::Object = dynamic>(dynamic x) → dynamic => x;
}
{
- function f<T extends core::Object>(T x) → core::List<T>
+ function f<T extends core::Object = dynamic>(T x) → core::List<T>
return null;
dynamic v2 = f;
- v2 = <S extends core::Object>(dynamic x) → dynamic => <dynamic>[x];
+ v2 = <S extends core::Object = dynamic>(dynamic x) → dynamic => <dynamic>[x];
core::Iterable<core::int> r = v2.call(42);
core::Iterable<core::String> s = v2.call("hello");
core::Iterable<core::List<core::int>> t = v2.call(<core::int>[]);
diff --git a/pkg/front_end/testcases/inference/downwards_inference_on_function_of_t_using_the_t.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/downwards_inference_on_function_of_t_using_the_t.dart.direct.transformed.expect
index 5ffe78d..169595b 100644
--- a/pkg/front_end/testcases/inference/downwards_inference_on_function_of_t_using_the_t.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/downwards_inference_on_function_of_t_using_the_t.dart.direct.transformed.expect
@@ -4,16 +4,16 @@
static method main() → void {
{
- function f<T extends core::Object>(T x) → T
+ function f<T extends core::Object = dynamic>(T x) → T
return null;
dynamic v1 = f;
- v1 = <S extends core::Object>(dynamic x) → dynamic => x;
+ v1 = <S extends core::Object = dynamic>(dynamic x) → dynamic => x;
}
{
- function f<T extends core::Object>(T x) → core::List<T>
+ function f<T extends core::Object = dynamic>(T x) → core::List<T>
return null;
dynamic v2 = f;
- v2 = <S extends core::Object>(dynamic x) → dynamic => <dynamic>[x];
+ v2 = <S extends core::Object = dynamic>(dynamic x) → dynamic => <dynamic>[x];
core::Iterable<core::int> r = v2.call(42);
core::Iterable<core::String> s = v2.call("hello");
core::Iterable<core::List<core::int>> t = v2.call(<core::int>[]);
diff --git a/pkg/front_end/testcases/inference/downwards_inference_on_generic_constructor_arguments_empty_list.dart.direct.expect b/pkg/front_end/testcases/inference/downwards_inference_on_generic_constructor_arguments_empty_list.dart.direct.expect
index 995d542..8e6cf96 100644
--- a/pkg/front_end/testcases/inference/downwards_inference_on_generic_constructor_arguments_empty_list.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/downwards_inference_on_generic_constructor_arguments_empty_list.dart.direct.expect
@@ -2,11 +2,11 @@
import self as self;
import "dart:core" as core;
-class F3<T extends core::Object> extends core::Object {
+class F3<T extends core::Object = dynamic> extends core::Object {
constructor •(core::Iterable<core::Iterable<self::F3::T>> a) → void
: super core::Object::•() {}
}
-class F4<T extends core::Object> extends core::Object {
+class F4<T extends core::Object = dynamic> extends core::Object {
constructor •({core::Iterable<core::Iterable<self::F4::T>> a = null}) → void
: super core::Object::•() {}
}
diff --git a/pkg/front_end/testcases/inference/downwards_inference_on_generic_constructor_arguments_empty_list.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/downwards_inference_on_generic_constructor_arguments_empty_list.dart.direct.transformed.expect
index 995d542..8e6cf96 100644
--- a/pkg/front_end/testcases/inference/downwards_inference_on_generic_constructor_arguments_empty_list.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/downwards_inference_on_generic_constructor_arguments_empty_list.dart.direct.transformed.expect
@@ -2,11 +2,11 @@
import self as self;
import "dart:core" as core;
-class F3<T extends core::Object> extends core::Object {
+class F3<T extends core::Object = dynamic> extends core::Object {
constructor •(core::Iterable<core::Iterable<self::F3::T>> a) → void
: super core::Object::•() {}
}
-class F4<T extends core::Object> extends core::Object {
+class F4<T extends core::Object = dynamic> extends core::Object {
constructor •({core::Iterable<core::Iterable<self::F4::T>> a = null}) → void
: super core::Object::•() {}
}
diff --git a/pkg/front_end/testcases/inference/downwards_inference_on_generic_constructor_arguments_empty_list.dart.strong.expect b/pkg/front_end/testcases/inference/downwards_inference_on_generic_constructor_arguments_empty_list.dart.strong.expect
index 8c1b574..3cb6605 100644
--- a/pkg/front_end/testcases/inference/downwards_inference_on_generic_constructor_arguments_empty_list.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/downwards_inference_on_generic_constructor_arguments_empty_list.dart.strong.expect
@@ -2,11 +2,11 @@
import self as self;
import "dart:core" as core;
-class F3<T extends core::Object> extends core::Object {
+class F3<T extends core::Object = dynamic> extends core::Object {
constructor •(core::Iterable<core::Iterable<self::F3::T>> a) → void
: super core::Object::•() {}
}
-class F4<T extends core::Object> extends core::Object {
+class F4<T extends core::Object = dynamic> extends core::Object {
constructor •({core::Iterable<core::Iterable<self::F4::T>> a = null}) → void
: super core::Object::•() {}
}
diff --git a/pkg/front_end/testcases/inference/downwards_inference_on_generic_constructor_arguments_empty_list.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/downwards_inference_on_generic_constructor_arguments_empty_list.dart.strong.transformed.expect
index 8c1b574..3cb6605 100644
--- a/pkg/front_end/testcases/inference/downwards_inference_on_generic_constructor_arguments_empty_list.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/downwards_inference_on_generic_constructor_arguments_empty_list.dart.strong.transformed.expect
@@ -2,11 +2,11 @@
import self as self;
import "dart:core" as core;
-class F3<T extends core::Object> extends core::Object {
+class F3<T extends core::Object = dynamic> extends core::Object {
constructor •(core::Iterable<core::Iterable<self::F3::T>> a) → void
: super core::Object::•() {}
}
-class F4<T extends core::Object> extends core::Object {
+class F4<T extends core::Object = dynamic> extends core::Object {
constructor •({core::Iterable<core::Iterable<self::F4::T>> a = null}) → void
: super core::Object::•() {}
}
diff --git a/pkg/front_end/testcases/inference/downwards_inference_on_generic_constructor_arguments_infer_downwards.dart.direct.expect b/pkg/front_end/testcases/inference/downwards_inference_on_generic_constructor_arguments_infer_downwards.dart.direct.expect
index 336e915..6ee04ff 100644
--- a/pkg/front_end/testcases/inference/downwards_inference_on_generic_constructor_arguments_infer_downwards.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/downwards_inference_on_generic_constructor_arguments_infer_downwards.dart.direct.expect
@@ -2,23 +2,23 @@
import self as self;
import "dart:core" as core;
-class F0<T extends core::Object> extends core::Object {
+class F0<T extends core::Object = dynamic> extends core::Object {
constructor •(core::List<self::F0::T> a) → void
: super core::Object::•() {}
}
-class F1<T extends core::Object> extends core::Object {
+class F1<T extends core::Object = dynamic> extends core::Object {
constructor •({core::List<self::F1::T> a = null}) → void
: super core::Object::•() {}
}
-class F2<T extends core::Object> extends core::Object {
+class F2<T extends core::Object = dynamic> extends core::Object {
constructor •(core::Iterable<self::F2::T> a) → void
: super core::Object::•() {}
}
-class F3<T extends core::Object> extends core::Object {
+class F3<T extends core::Object = dynamic> extends core::Object {
constructor •(core::Iterable<core::Iterable<self::F3::T>> a) → void
: super core::Object::•() {}
}
-class F4<T extends core::Object> extends core::Object {
+class F4<T extends core::Object = dynamic> extends core::Object {
constructor •({core::Iterable<core::Iterable<self::F4::T>> a = null}) → void
: super core::Object::•() {}
}
diff --git a/pkg/front_end/testcases/inference/downwards_inference_on_generic_constructor_arguments_infer_downwards.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/downwards_inference_on_generic_constructor_arguments_infer_downwards.dart.direct.transformed.expect
index 336e915..6ee04ff 100644
--- a/pkg/front_end/testcases/inference/downwards_inference_on_generic_constructor_arguments_infer_downwards.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/downwards_inference_on_generic_constructor_arguments_infer_downwards.dart.direct.transformed.expect
@@ -2,23 +2,23 @@
import self as self;
import "dart:core" as core;
-class F0<T extends core::Object> extends core::Object {
+class F0<T extends core::Object = dynamic> extends core::Object {
constructor •(core::List<self::F0::T> a) → void
: super core::Object::•() {}
}
-class F1<T extends core::Object> extends core::Object {
+class F1<T extends core::Object = dynamic> extends core::Object {
constructor •({core::List<self::F1::T> a = null}) → void
: super core::Object::•() {}
}
-class F2<T extends core::Object> extends core::Object {
+class F2<T extends core::Object = dynamic> extends core::Object {
constructor •(core::Iterable<self::F2::T> a) → void
: super core::Object::•() {}
}
-class F3<T extends core::Object> extends core::Object {
+class F3<T extends core::Object = dynamic> extends core::Object {
constructor •(core::Iterable<core::Iterable<self::F3::T>> a) → void
: super core::Object::•() {}
}
-class F4<T extends core::Object> extends core::Object {
+class F4<T extends core::Object = dynamic> extends core::Object {
constructor •({core::Iterable<core::Iterable<self::F4::T>> a = null}) → void
: super core::Object::•() {}
}
diff --git a/pkg/front_end/testcases/inference/downwards_inference_on_generic_constructor_arguments_infer_downwards.dart.strong.expect b/pkg/front_end/testcases/inference/downwards_inference_on_generic_constructor_arguments_infer_downwards.dart.strong.expect
index 2984bb7..9d2e2a2 100644
--- a/pkg/front_end/testcases/inference/downwards_inference_on_generic_constructor_arguments_infer_downwards.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/downwards_inference_on_generic_constructor_arguments_infer_downwards.dart.strong.expect
@@ -2,23 +2,23 @@
import self as self;
import "dart:core" as core;
-class F0<T extends core::Object> extends core::Object {
+class F0<T extends core::Object = dynamic> extends core::Object {
constructor •(core::List<self::F0::T> a) → void
: super core::Object::•() {}
}
-class F1<T extends core::Object> extends core::Object {
+class F1<T extends core::Object = dynamic> extends core::Object {
constructor •({core::List<self::F1::T> a = null}) → void
: super core::Object::•() {}
}
-class F2<T extends core::Object> extends core::Object {
+class F2<T extends core::Object = dynamic> extends core::Object {
constructor •(core::Iterable<self::F2::T> a) → void
: super core::Object::•() {}
}
-class F3<T extends core::Object> extends core::Object {
+class F3<T extends core::Object = dynamic> extends core::Object {
constructor •(core::Iterable<core::Iterable<self::F3::T>> a) → void
: super core::Object::•() {}
}
-class F4<T extends core::Object> extends core::Object {
+class F4<T extends core::Object = dynamic> extends core::Object {
constructor •({core::Iterable<core::Iterable<self::F4::T>> a = null}) → void
: super core::Object::•() {}
}
diff --git a/pkg/front_end/testcases/inference/downwards_inference_on_generic_constructor_arguments_infer_downwards.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/downwards_inference_on_generic_constructor_arguments_infer_downwards.dart.strong.transformed.expect
index 5aa4f1e..2517cb9 100644
--- a/pkg/front_end/testcases/inference/downwards_inference_on_generic_constructor_arguments_infer_downwards.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/downwards_inference_on_generic_constructor_arguments_infer_downwards.dart.strong.transformed.expect
@@ -2,23 +2,23 @@
import self as self;
import "dart:core" as core;
-class F0<T extends core::Object> extends core::Object {
+class F0<T extends core::Object = dynamic> extends core::Object {
constructor •(core::List<self::F0::T> a) → void
: super core::Object::•() {}
}
-class F1<T extends core::Object> extends core::Object {
+class F1<T extends core::Object = dynamic> extends core::Object {
constructor •({core::List<self::F1::T> a = null}) → void
: super core::Object::•() {}
}
-class F2<T extends core::Object> extends core::Object {
+class F2<T extends core::Object = dynamic> extends core::Object {
constructor •(core::Iterable<self::F2::T> a) → void
: super core::Object::•() {}
}
-class F3<T extends core::Object> extends core::Object {
+class F3<T extends core::Object = dynamic> extends core::Object {
constructor •(core::Iterable<core::Iterable<self::F3::T>> a) → void
: super core::Object::•() {}
}
-class F4<T extends core::Object> extends core::Object {
+class F4<T extends core::Object = dynamic> extends core::Object {
constructor •({core::Iterable<core::Iterable<self::F4::T>> a = null}) → void
: super core::Object::•() {}
}
diff --git a/pkg/front_end/testcases/inference/downwards_inference_on_generic_function_expressions.dart b/pkg/front_end/testcases/inference/downwards_inference_on_generic_function_expressions.dart
index f2c349c..7ca127b 100644
--- a/pkg/front_end/testcases/inference/downwards_inference_on_generic_function_expressions.dart
+++ b/pkg/front_end/testcases/inference/downwards_inference_on_generic_function_expressions.dart
@@ -8,7 +8,7 @@
void test() {
{
String f<S>(int x) => null;
- var /*@type=<S extends Object>(int) -> String*/ v = f;
+ var /*@type=<S extends Object = dynamic>(int) -> String*/ v = f;
v = <T> /*@returnType=Null*/ (int x) => null;
v = <T> /*@returnType=String*/ (int x) => "hello";
v = /*error:INVALID_ASSIGNMENT*/ <T> /*@returnType=String*/ (String x) =>
@@ -20,7 +20,7 @@
}
{
String f<S>(int x) => null;
- var /*@type=<S extends Object>(int) -> String*/ v = f;
+ var /*@type=<S extends Object = dynamic>(int) -> String*/ v = f;
v = <T> /*@returnType=Null*/ (/*@type=int*/ x) => null;
v = <T> /*@returnType=String*/ (/*@type=int*/ x) => "hello";
v = /*info:INFERRED_TYPE_CLOSURE, error:INVALID_ASSIGNMENT*/ <
@@ -35,7 +35,7 @@
}
{
List<String> f<S>(int x) => null;
- var /*@type=<S extends Object>(int) -> List<String>*/ v = f;
+ var /*@type=<S extends Object = dynamic>(int) -> List<String>*/ v = f;
v = <T> /*@returnType=Null*/ (int x) => null;
v = <T> /*@returnType=List<String>*/ (int x) => /*@typeArgs=String*/ [
"hello"
@@ -55,16 +55,17 @@
int int2int<S>(int x) => null;
String int2String<T>(int x) => null;
String string2String<T>(String x) => null;
- var /*@type=<S extends Object>(int) -> int*/ x = int2int;
+ var /*@type=<S extends Object = dynamic>(int) -> int*/ x = int2int;
x = <T> /*@returnType=int*/ (/*@type=int*/ x) => x;
x = <T> /*@returnType=int*/ (/*@type=int*/ x) => x /*@target=num::+*/ + 1;
- var /*@type=<T extends Object>(int) -> String*/ y = int2String;
+ var /*@type=<T extends Object = dynamic>(int) -> String*/ y = int2String;
y = /*info:INFERRED_TYPE_CLOSURE, error:INVALID_ASSIGNMENT*/ <
T> /*@returnType=String*/ (/*@type=int*/ x) =>
x;
y = <T> /*@returnType=String*/ (/*@type=int*/ x) => /*info:DYNAMIC_INVOKE, info:DYNAMIC_CAST*/ x
.substring(3);
- var /*@type=<T extends Object>(String) -> String*/ z = string2String;
+ var /*@type=<T extends Object = dynamic>(String) -> String*/ z =
+ string2String;
z = <T> /*@returnType=String*/ (/*@type=String*/ x) =>
x. /*@target=String::substring*/ substring(3);
}
diff --git a/pkg/front_end/testcases/inference/downwards_inference_on_generic_function_expressions.dart.direct.expect b/pkg/front_end/testcases/inference/downwards_inference_on_generic_function_expressions.dart.direct.expect
index ae8eea6..f1cf2f0 100644
--- a/pkg/front_end/testcases/inference/downwards_inference_on_generic_function_expressions.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/downwards_inference_on_generic_function_expressions.dart.direct.expect
@@ -4,58 +4,58 @@
static method test() → void {
{
- function f<S extends core::Object>(core::int x) → core::String
+ function f<S extends core::Object = dynamic>(core::int x) → core::String
return null;
dynamic v = f;
- v = <T extends core::Object>(core::int x) → dynamic => null;
- v = <T extends core::Object>(core::int x) → dynamic => "hello";
- v = <T extends core::Object>(core::String x) → dynamic => "hello";
- v = <T extends core::Object>(core::int x) → dynamic => 3;
- v = <T extends core::Object>(core::int x) → dynamic {
+ v = <T extends core::Object = dynamic>(core::int x) → dynamic => null;
+ v = <T extends core::Object = dynamic>(core::int x) → dynamic => "hello";
+ v = <T extends core::Object = dynamic>(core::String x) → dynamic => "hello";
+ v = <T extends core::Object = dynamic>(core::int x) → dynamic => 3;
+ v = <T extends core::Object = dynamic>(core::int x) → dynamic {
return 3;
};
}
{
- function f<S extends core::Object>(core::int x) → core::String
+ function f<S extends core::Object = dynamic>(core::int x) → core::String
return null;
dynamic v = f;
- v = <T extends core::Object>(dynamic x) → dynamic => null;
- v = <T extends core::Object>(dynamic x) → dynamic => "hello";
- v = <T extends core::Object>(dynamic x) → dynamic => 3;
- v = <T extends core::Object>(dynamic x) → dynamic {
+ v = <T extends core::Object = dynamic>(dynamic x) → dynamic => null;
+ v = <T extends core::Object = dynamic>(dynamic x) → dynamic => "hello";
+ v = <T extends core::Object = dynamic>(dynamic x) → dynamic => 3;
+ v = <T extends core::Object = dynamic>(dynamic x) → dynamic {
return 3;
};
- v = <T extends core::Object>(dynamic x) → dynamic {
+ v = <T extends core::Object = dynamic>(dynamic x) → dynamic {
return x;
};
}
{
- function f<S extends core::Object>(core::int x) → core::List<core::String>
+ function f<S extends core::Object = dynamic>(core::int x) → core::List<core::String>
return null;
dynamic v = f;
- v = <T extends core::Object>(core::int x) → dynamic => null;
- v = <T extends core::Object>(core::int x) → dynamic => <dynamic>["hello"];
- v = <T extends core::Object>(core::String x) → dynamic => <dynamic>["hello"];
- v = <T extends core::Object>(core::int x) → dynamic => <dynamic>[3];
- v = <T extends core::Object>(core::int x) → dynamic {
+ v = <T extends core::Object = dynamic>(core::int x) → dynamic => null;
+ v = <T extends core::Object = dynamic>(core::int x) → dynamic => <dynamic>["hello"];
+ v = <T extends core::Object = dynamic>(core::String x) → dynamic => <dynamic>["hello"];
+ v = <T extends core::Object = dynamic>(core::int x) → dynamic => <dynamic>[3];
+ v = <T extends core::Object = dynamic>(core::int x) → dynamic {
return <dynamic>[3];
};
}
{
- function int2int<S extends core::Object>(core::int x) → core::int
+ function int2int<S extends core::Object = dynamic>(core::int x) → core::int
return null;
- function int2String<T extends core::Object>(core::int x) → core::String
+ function int2String<T extends core::Object = dynamic>(core::int x) → core::String
return null;
- function string2String<T extends core::Object>(core::String x) → core::String
+ function string2String<T extends core::Object = dynamic>(core::String x) → core::String
return null;
dynamic x = int2int;
- x = <T extends core::Object>(dynamic x) → dynamic => x;
- x = <T extends core::Object>(dynamic x) → dynamic => x.+(1);
+ x = <T extends core::Object = dynamic>(dynamic x) → dynamic => x;
+ x = <T extends core::Object = dynamic>(dynamic x) → dynamic => x.+(1);
dynamic y = int2String;
- y = <T extends core::Object>(dynamic x) → dynamic => x;
- y = <T extends core::Object>(dynamic x) → dynamic => x.substring(3);
+ y = <T extends core::Object = dynamic>(dynamic x) → dynamic => x;
+ y = <T extends core::Object = dynamic>(dynamic x) → dynamic => x.substring(3);
dynamic z = string2String;
- z = <T extends core::Object>(dynamic x) → dynamic => x.substring(3);
+ z = <T extends core::Object = dynamic>(dynamic x) → dynamic => x.substring(3);
}
}
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/downwards_inference_on_generic_function_expressions.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/downwards_inference_on_generic_function_expressions.dart.direct.transformed.expect
index ae8eea6..f1cf2f0 100644
--- a/pkg/front_end/testcases/inference/downwards_inference_on_generic_function_expressions.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/downwards_inference_on_generic_function_expressions.dart.direct.transformed.expect
@@ -4,58 +4,58 @@
static method test() → void {
{
- function f<S extends core::Object>(core::int x) → core::String
+ function f<S extends core::Object = dynamic>(core::int x) → core::String
return null;
dynamic v = f;
- v = <T extends core::Object>(core::int x) → dynamic => null;
- v = <T extends core::Object>(core::int x) → dynamic => "hello";
- v = <T extends core::Object>(core::String x) → dynamic => "hello";
- v = <T extends core::Object>(core::int x) → dynamic => 3;
- v = <T extends core::Object>(core::int x) → dynamic {
+ v = <T extends core::Object = dynamic>(core::int x) → dynamic => null;
+ v = <T extends core::Object = dynamic>(core::int x) → dynamic => "hello";
+ v = <T extends core::Object = dynamic>(core::String x) → dynamic => "hello";
+ v = <T extends core::Object = dynamic>(core::int x) → dynamic => 3;
+ v = <T extends core::Object = dynamic>(core::int x) → dynamic {
return 3;
};
}
{
- function f<S extends core::Object>(core::int x) → core::String
+ function f<S extends core::Object = dynamic>(core::int x) → core::String
return null;
dynamic v = f;
- v = <T extends core::Object>(dynamic x) → dynamic => null;
- v = <T extends core::Object>(dynamic x) → dynamic => "hello";
- v = <T extends core::Object>(dynamic x) → dynamic => 3;
- v = <T extends core::Object>(dynamic x) → dynamic {
+ v = <T extends core::Object = dynamic>(dynamic x) → dynamic => null;
+ v = <T extends core::Object = dynamic>(dynamic x) → dynamic => "hello";
+ v = <T extends core::Object = dynamic>(dynamic x) → dynamic => 3;
+ v = <T extends core::Object = dynamic>(dynamic x) → dynamic {
return 3;
};
- v = <T extends core::Object>(dynamic x) → dynamic {
+ v = <T extends core::Object = dynamic>(dynamic x) → dynamic {
return x;
};
}
{
- function f<S extends core::Object>(core::int x) → core::List<core::String>
+ function f<S extends core::Object = dynamic>(core::int x) → core::List<core::String>
return null;
dynamic v = f;
- v = <T extends core::Object>(core::int x) → dynamic => null;
- v = <T extends core::Object>(core::int x) → dynamic => <dynamic>["hello"];
- v = <T extends core::Object>(core::String x) → dynamic => <dynamic>["hello"];
- v = <T extends core::Object>(core::int x) → dynamic => <dynamic>[3];
- v = <T extends core::Object>(core::int x) → dynamic {
+ v = <T extends core::Object = dynamic>(core::int x) → dynamic => null;
+ v = <T extends core::Object = dynamic>(core::int x) → dynamic => <dynamic>["hello"];
+ v = <T extends core::Object = dynamic>(core::String x) → dynamic => <dynamic>["hello"];
+ v = <T extends core::Object = dynamic>(core::int x) → dynamic => <dynamic>[3];
+ v = <T extends core::Object = dynamic>(core::int x) → dynamic {
return <dynamic>[3];
};
}
{
- function int2int<S extends core::Object>(core::int x) → core::int
+ function int2int<S extends core::Object = dynamic>(core::int x) → core::int
return null;
- function int2String<T extends core::Object>(core::int x) → core::String
+ function int2String<T extends core::Object = dynamic>(core::int x) → core::String
return null;
- function string2String<T extends core::Object>(core::String x) → core::String
+ function string2String<T extends core::Object = dynamic>(core::String x) → core::String
return null;
dynamic x = int2int;
- x = <T extends core::Object>(dynamic x) → dynamic => x;
- x = <T extends core::Object>(dynamic x) → dynamic => x.+(1);
+ x = <T extends core::Object = dynamic>(dynamic x) → dynamic => x;
+ x = <T extends core::Object = dynamic>(dynamic x) → dynamic => x.+(1);
dynamic y = int2String;
- y = <T extends core::Object>(dynamic x) → dynamic => x;
- y = <T extends core::Object>(dynamic x) → dynamic => x.substring(3);
+ y = <T extends core::Object = dynamic>(dynamic x) → dynamic => x;
+ y = <T extends core::Object = dynamic>(dynamic x) → dynamic => x.substring(3);
dynamic z = string2String;
- z = <T extends core::Object>(dynamic x) → dynamic => x.substring(3);
+ z = <T extends core::Object = dynamic>(dynamic x) → dynamic => x.substring(3);
}
}
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/downwards_inference_on_generic_function_expressions.dart.strong.expect b/pkg/front_end/testcases/inference/downwards_inference_on_generic_function_expressions.dart.strong.expect
index 4565308..03e0d17 100644
--- a/pkg/front_end/testcases/inference/downwards_inference_on_generic_function_expressions.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/downwards_inference_on_generic_function_expressions.dart.strong.expect
@@ -4,20 +4,20 @@
static method test() → void {
{
- function f<S extends core::Object>(core::int x) → core::String
+ function f<S extends core::Object = dynamic>(core::int x) → core::String
return null;
- <S extends core::Object>(core::int) → core::String v = f;
- v = <T extends core::Object>(core::int x) → core::Null => null;
- v = <T extends core::Object>(core::int x) → core::String => "hello";
- v = let final dynamic #t1 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_generic_function_expressions.dart:14:65: Error: A value of type '<T extends dart.core::Object>(dart.core::String) \u8594 dart.core::String' can't be assigned to a variable of type '<S extends dart.core::Object>(dart.core::int) \u8594 dart.core::String'.
-Try changing the type of the left hand side, or casting the right hand side to '<S extends dart.core::Object>(dart.core::int) \u8594 dart.core::String'.
+ <S extends core::Object = dynamic>(core::int) → core::String v = f;
+ v = <T extends core::Object = dynamic>(core::int x) → core::Null => null;
+ v = <T extends core::Object = dynamic>(core::int x) → core::String => "hello";
+ v = let final dynamic #t1 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_generic_function_expressions.dart:14:65: Error: A value of type '<T extends dart.core::Object = dynamic>(dart.core::String) \u8594 dart.core::String' can't be assigned to a variable of type '<S extends dart.core::Object = dynamic>(dart.core::int) \u8594 dart.core::String'.
+Try changing the type of the left hand side, or casting the right hand side to '<S extends dart.core::Object = dynamic>(dart.core::int) \u8594 dart.core::String'.
v = /*error:INVALID_ASSIGNMENT*/ <T> /*@returnType=String*/ (String x) =>
- ^" in let final dynamic #t2 = <T extends core::Object>(core::String x) → core::String => "hello" in null;
- v = <T extends core::Object>(core::int x) → core::String => let final dynamic #t3 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_generic_function_expressions.dart:16:76: Error: A value of type 'dart.core::int' can't be assigned to a variable of type 'dart.core::String'.
+ ^" in let final dynamic #t2 = <T extends core::Object = dynamic>(core::String x) → core::String => "hello" in null;
+ v = <T extends core::Object = dynamic>(core::int x) → core::String => let final dynamic #t3 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_generic_function_expressions.dart:16:76: Error: A value of type 'dart.core::int' can't be assigned to a variable of type 'dart.core::String'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::String'.
v = /*error:INVALID_ASSIGNMENT*/ <T> /*@returnType=String*/ (int x) => 3;
^" in let final dynamic #t4 = 3 in null;
- v = <T extends core::Object>(core::int x) → core::String {
+ v = <T extends core::Object = dynamic>(core::int x) → core::String {
return let final dynamic #t5 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_generic_function_expressions.dart:18:47: Error: A value of type 'dart.core::int' can't be assigned to a variable of type 'dart.core::String'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::String'.
return /*error:RETURN_OF_INVALID_TYPE*/ 3;
@@ -25,22 +25,22 @@
};
}
{
- function f<S extends core::Object>(core::int x) → core::String
+ function f<S extends core::Object = dynamic>(core::int x) → core::String
return null;
- <S extends core::Object>(core::int) → core::String v = f;
- v = <T extends core::Object>(core::int x) → core::Null => null;
- v = <T extends core::Object>(core::int x) → core::String => "hello";
- v = <T extends core::Object>(core::int x) → core::String => let final dynamic #t7 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_generic_function_expressions.dart:28:9: Error: A value of type 'dart.core::int' can't be assigned to a variable of type 'dart.core::String'.
+ <S extends core::Object = dynamic>(core::int) → core::String v = f;
+ v = <T extends core::Object = dynamic>(core::int x) → core::Null => null;
+ v = <T extends core::Object = dynamic>(core::int x) → core::String => "hello";
+ v = <T extends core::Object = dynamic>(core::int x) → core::String => let final dynamic #t7 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_generic_function_expressions.dart:28:9: Error: A value of type 'dart.core::int' can't be assigned to a variable of type 'dart.core::String'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::String'.
3;
^" in let final dynamic #t8 = 3 in null;
- v = <T extends core::Object>(core::int x) → core::String {
+ v = <T extends core::Object = dynamic>(core::int x) → core::String {
return let final dynamic #t9 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_generic_function_expressions.dart:30:47: Error: A value of type 'dart.core::int' can't be assigned to a variable of type 'dart.core::String'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::String'.
return /*error:RETURN_OF_INVALID_TYPE*/ 3;
^" in let final dynamic #t10 = 3 in null;
};
- v = <T extends core::Object>(core::int x) → core::String {
+ v = <T extends core::Object = dynamic>(core::int x) → core::String {
return let final dynamic #t11 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_generic_function_expressions.dart:33:47: Error: A value of type 'dart.core::int' can't be assigned to a variable of type 'dart.core::String'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::String'.
return /*error:RETURN_OF_INVALID_TYPE*/ x;
@@ -48,20 +48,20 @@
};
}
{
- function f<S extends core::Object>(core::int x) → core::List<core::String>
+ function f<S extends core::Object = dynamic>(core::int x) → core::List<core::String>
return null;
- <S extends core::Object>(core::int) → core::List<core::String> v = f;
- v = <T extends core::Object>(core::int x) → core::Null => null;
- v = <T extends core::Object>(core::int x) → core::List<core::String> => <core::String>["hello"];
- v = let final dynamic #t13 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_generic_function_expressions.dart:43:71: Error: A value of type '<T extends dart.core::Object>(dart.core::String) \u8594 dart.core::List<dart.core::String>' can't be assigned to a variable of type '<S extends dart.core::Object>(dart.core::int) \u8594 dart.core::List<dart.core::String>'.
-Try changing the type of the left hand side, or casting the right hand side to '<S extends dart.core::Object>(dart.core::int) \u8594 dart.core::List<dart.core::String>'.
+ <S extends core::Object = dynamic>(core::int) → core::List<core::String> v = f;
+ v = <T extends core::Object = dynamic>(core::int x) → core::Null => null;
+ v = <T extends core::Object = dynamic>(core::int x) → core::List<core::String> => <core::String>["hello"];
+ v = let final dynamic #t13 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_generic_function_expressions.dart:43:71: Error: A value of type '<T extends dart.core::Object = dynamic>(dart.core::String) \u8594 dart.core::List<dart.core::String>' can't be assigned to a variable of type '<S extends dart.core::Object = dynamic>(dart.core::int) \u8594 dart.core::List<dart.core::String>'.
+Try changing the type of the left hand side, or casting the right hand side to '<S extends dart.core::Object = dynamic>(dart.core::int) \u8594 dart.core::List<dart.core::String>'.
v = /*error:INVALID_ASSIGNMENT*/ <T> /*@returnType=List<String>*/ (String
- ^" in let final dynamic #t14 = <T extends core::Object>(core::String x) → core::List<core::String> => <core::String>["hello"] in null;
- v = <T extends core::Object>(core::int x) → core::List<core::String> => <core::String>[let final dynamic #t15 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_generic_function_expressions.dart:46:54: Error: A value of type 'dart.core::int' can't be assigned to a variable of type 'dart.core::String'.
+ ^" in let final dynamic #t14 = <T extends core::Object = dynamic>(core::String x) → core::List<core::String> => <core::String>["hello"] in null;
+ v = <T extends core::Object = dynamic>(core::int x) → core::List<core::String> => <core::String>[let final dynamic #t15 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_generic_function_expressions.dart:46:54: Error: A value of type 'dart.core::int' can't be assigned to a variable of type 'dart.core::String'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::String'.
/*error:LIST_ELEMENT_TYPE_NOT_ASSIGNABLE*/ 3
^" in let final dynamic #t16 = 3 in null];
- v = <T extends core::Object>(core::int x) → core::List<core::String> {
+ v = <T extends core::Object = dynamic>(core::int x) → core::List<core::String> {
return <core::String>[let final dynamic #t17 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_generic_function_expressions.dart:50:52: Error: A value of type 'dart.core::int' can't be assigned to a variable of type 'dart.core::String'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::String'.
/*error:LIST_ELEMENT_TYPE_NOT_ASSIGNABLE*/ 3
@@ -69,26 +69,26 @@
};
}
{
- function int2int<S extends core::Object>(core::int x) → core::int
+ function int2int<S extends core::Object = dynamic>(core::int x) → core::int
return null;
- function int2String<T extends core::Object>(core::int x) → core::String
+ function int2String<T extends core::Object = dynamic>(core::int x) → core::String
return null;
- function string2String<T extends core::Object>(core::String x) → core::String
+ function string2String<T extends core::Object = dynamic>(core::String x) → core::String
return null;
- <S extends core::Object>(core::int) → core::int x = int2int;
- x = <T extends core::Object>(core::int x) → core::int => x;
- x = <T extends core::Object>(core::int x) → core::int => x.{core::num::+}(1);
- <T extends core::Object>(core::int) → core::String y = int2String;
- y = <T extends core::Object>(core::int x) → core::String => let final dynamic #t19 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_generic_function_expressions.dart:64:9: Error: A value of type 'dart.core::int' can't be assigned to a variable of type 'dart.core::String'.
+ <S extends core::Object = dynamic>(core::int) → core::int x = int2int;
+ x = <T extends core::Object = dynamic>(core::int x) → core::int => x;
+ x = <T extends core::Object = dynamic>(core::int x) → core::int => x.{core::num::+}(1);
+ <T extends core::Object = dynamic>(core::int) → core::String y = int2String;
+ y = <T extends core::Object = dynamic>(core::int x) → core::String => let final dynamic #t19 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_generic_function_expressions.dart:64:9: Error: A value of type 'dart.core::int' can't be assigned to a variable of type 'dart.core::String'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::String'.
x;
^" in let final dynamic #t20 = x in null;
- y = <T extends core::Object>(core::int x) → core::String => (let final dynamic #t21 = x in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_generic_function_expressions.dart:66:10: Error: The method 'substring' isn't defined for the class 'dart.core::int'.
+ y = <T extends core::Object = dynamic>(core::int x) → core::String => (let final dynamic #t21 = x in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_generic_function_expressions.dart:66:10: Error: The method 'substring' isn't defined for the class 'dart.core::int'.
Try correcting the name to the name of an existing method, or defining a method named 'substring'.
.substring(3);
^") as{TypeError} core::String;
- <T extends core::Object>(core::String) → core::String z = string2String;
- z = <T extends core::Object>(core::String x) → core::String => x.{core::String::substring}(3);
+ <T extends core::Object = dynamic>(core::String) → core::String z = string2String;
+ z = <T extends core::Object = dynamic>(core::String x) → core::String => x.{core::String::substring}(3);
}
}
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/downwards_inference_on_generic_function_expressions.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/downwards_inference_on_generic_function_expressions.dart.strong.transformed.expect
index c9bbbdd..fbc3370 100644
--- a/pkg/front_end/testcases/inference/downwards_inference_on_generic_function_expressions.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/downwards_inference_on_generic_function_expressions.dart.strong.transformed.expect
@@ -4,20 +4,20 @@
static method test() → void {
{
- function f<S extends core::Object>(core::int x) → core::String
+ function f<S extends core::Object = dynamic>(core::int x) → core::String
return null;
- <S extends core::Object>(core::int) → core::String v = f;
- v = <T extends core::Object>(core::int x) → core::Null => null;
- v = <T extends core::Object>(core::int x) → core::String => "hello";
- v = let final dynamic #t1 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_generic_function_expressions.dart:14:65: Error: A value of type '<T extends dart.core::Object>(dart.core::String) \u8594 dart.core::String' can't be assigned to a variable of type '<S extends dart.core::Object>(dart.core::int) \u8594 dart.core::String'.
-Try changing the type of the left hand side, or casting the right hand side to '<S extends dart.core::Object>(dart.core::int) \u8594 dart.core::String'.
+ <S extends core::Object = dynamic>(core::int) → core::String v = f;
+ v = <T extends core::Object = dynamic>(core::int x) → core::Null => null;
+ v = <T extends core::Object = dynamic>(core::int x) → core::String => "hello";
+ v = let final dynamic #t1 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_generic_function_expressions.dart:14:65: Error: A value of type '<T extends dart.core::Object = dynamic>(dart.core::String) \u8594 dart.core::String' can't be assigned to a variable of type '<S extends dart.core::Object = dynamic>(dart.core::int) \u8594 dart.core::String'.
+Try changing the type of the left hand side, or casting the right hand side to '<S extends dart.core::Object = dynamic>(dart.core::int) \u8594 dart.core::String'.
v = /*error:INVALID_ASSIGNMENT*/ <T> /*@returnType=String*/ (String x) =>
- ^" in let final <T extends core::Object>(core::String) → core::String #t2 = <T extends core::Object>(core::String x) → core::String => "hello" in null;
- v = <T extends core::Object>(core::int x) → core::String => let final dynamic #t3 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_generic_function_expressions.dart:16:76: Error: A value of type 'dart.core::int' can't be assigned to a variable of type 'dart.core::String'.
+ ^" in let final <T extends core::Object = dynamic>(core::String) → core::String #t2 = <T extends core::Object = dynamic>(core::String x) → core::String => "hello" in null;
+ v = <T extends core::Object = dynamic>(core::int x) → core::String => let final dynamic #t3 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_generic_function_expressions.dart:16:76: Error: A value of type 'dart.core::int' can't be assigned to a variable of type 'dart.core::String'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::String'.
v = /*error:INVALID_ASSIGNMENT*/ <T> /*@returnType=String*/ (int x) => 3;
^" in let final core::int #t4 = 3 in null;
- v = <T extends core::Object>(core::int x) → core::String {
+ v = <T extends core::Object = dynamic>(core::int x) → core::String {
return let final dynamic #t5 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_generic_function_expressions.dart:18:47: Error: A value of type 'dart.core::int' can't be assigned to a variable of type 'dart.core::String'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::String'.
return /*error:RETURN_OF_INVALID_TYPE*/ 3;
@@ -25,22 +25,22 @@
};
}
{
- function f<S extends core::Object>(core::int x) → core::String
+ function f<S extends core::Object = dynamic>(core::int x) → core::String
return null;
- <S extends core::Object>(core::int) → core::String v = f;
- v = <T extends core::Object>(core::int x) → core::Null => null;
- v = <T extends core::Object>(core::int x) → core::String => "hello";
- v = <T extends core::Object>(core::int x) → core::String => let final dynamic #t7 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_generic_function_expressions.dart:28:9: Error: A value of type 'dart.core::int' can't be assigned to a variable of type 'dart.core::String'.
+ <S extends core::Object = dynamic>(core::int) → core::String v = f;
+ v = <T extends core::Object = dynamic>(core::int x) → core::Null => null;
+ v = <T extends core::Object = dynamic>(core::int x) → core::String => "hello";
+ v = <T extends core::Object = dynamic>(core::int x) → core::String => let final dynamic #t7 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_generic_function_expressions.dart:28:9: Error: A value of type 'dart.core::int' can't be assigned to a variable of type 'dart.core::String'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::String'.
3;
^" in let final core::int #t8 = 3 in null;
- v = <T extends core::Object>(core::int x) → core::String {
+ v = <T extends core::Object = dynamic>(core::int x) → core::String {
return let final dynamic #t9 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_generic_function_expressions.dart:30:47: Error: A value of type 'dart.core::int' can't be assigned to a variable of type 'dart.core::String'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::String'.
return /*error:RETURN_OF_INVALID_TYPE*/ 3;
^" in let final core::int #t10 = 3 in null;
};
- v = <T extends core::Object>(core::int x) → core::String {
+ v = <T extends core::Object = dynamic>(core::int x) → core::String {
return let final dynamic #t11 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_generic_function_expressions.dart:33:47: Error: A value of type 'dart.core::int' can't be assigned to a variable of type 'dart.core::String'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::String'.
return /*error:RETURN_OF_INVALID_TYPE*/ x;
@@ -48,20 +48,20 @@
};
}
{
- function f<S extends core::Object>(core::int x) → core::List<core::String>
+ function f<S extends core::Object = dynamic>(core::int x) → core::List<core::String>
return null;
- <S extends core::Object>(core::int) → core::List<core::String> v = f;
- v = <T extends core::Object>(core::int x) → core::Null => null;
- v = <T extends core::Object>(core::int x) → core::List<core::String> => <core::String>["hello"];
- v = let final dynamic #t13 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_generic_function_expressions.dart:43:71: Error: A value of type '<T extends dart.core::Object>(dart.core::String) \u8594 dart.core::List<dart.core::String>' can't be assigned to a variable of type '<S extends dart.core::Object>(dart.core::int) \u8594 dart.core::List<dart.core::String>'.
-Try changing the type of the left hand side, or casting the right hand side to '<S extends dart.core::Object>(dart.core::int) \u8594 dart.core::List<dart.core::String>'.
+ <S extends core::Object = dynamic>(core::int) → core::List<core::String> v = f;
+ v = <T extends core::Object = dynamic>(core::int x) → core::Null => null;
+ v = <T extends core::Object = dynamic>(core::int x) → core::List<core::String> => <core::String>["hello"];
+ v = let final dynamic #t13 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_generic_function_expressions.dart:43:71: Error: A value of type '<T extends dart.core::Object = dynamic>(dart.core::String) \u8594 dart.core::List<dart.core::String>' can't be assigned to a variable of type '<S extends dart.core::Object = dynamic>(dart.core::int) \u8594 dart.core::List<dart.core::String>'.
+Try changing the type of the left hand side, or casting the right hand side to '<S extends dart.core::Object = dynamic>(dart.core::int) \u8594 dart.core::List<dart.core::String>'.
v = /*error:INVALID_ASSIGNMENT*/ <T> /*@returnType=List<String>*/ (String
- ^" in let final <T extends core::Object>(core::String) → core::List<core::String> #t14 = <T extends core::Object>(core::String x) → core::List<core::String> => <core::String>["hello"] in null;
- v = <T extends core::Object>(core::int x) → core::List<core::String> => <core::String>[let final dynamic #t15 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_generic_function_expressions.dart:46:54: Error: A value of type 'dart.core::int' can't be assigned to a variable of type 'dart.core::String'.
+ ^" in let final <T extends core::Object = dynamic>(core::String) → core::List<core::String> #t14 = <T extends core::Object = dynamic>(core::String x) → core::List<core::String> => <core::String>["hello"] in null;
+ v = <T extends core::Object = dynamic>(core::int x) → core::List<core::String> => <core::String>[let final dynamic #t15 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_generic_function_expressions.dart:46:54: Error: A value of type 'dart.core::int' can't be assigned to a variable of type 'dart.core::String'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::String'.
/*error:LIST_ELEMENT_TYPE_NOT_ASSIGNABLE*/ 3
^" in let final core::int #t16 = 3 in null];
- v = <T extends core::Object>(core::int x) → core::List<core::String> {
+ v = <T extends core::Object = dynamic>(core::int x) → core::List<core::String> {
return <core::String>[let final dynamic #t17 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_generic_function_expressions.dart:50:52: Error: A value of type 'dart.core::int' can't be assigned to a variable of type 'dart.core::String'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::String'.
/*error:LIST_ELEMENT_TYPE_NOT_ASSIGNABLE*/ 3
@@ -69,26 +69,26 @@
};
}
{
- function int2int<S extends core::Object>(core::int x) → core::int
+ function int2int<S extends core::Object = dynamic>(core::int x) → core::int
return null;
- function int2String<T extends core::Object>(core::int x) → core::String
+ function int2String<T extends core::Object = dynamic>(core::int x) → core::String
return null;
- function string2String<T extends core::Object>(core::String x) → core::String
+ function string2String<T extends core::Object = dynamic>(core::String x) → core::String
return null;
- <S extends core::Object>(core::int) → core::int x = int2int;
- x = <T extends core::Object>(core::int x) → core::int => x;
- x = <T extends core::Object>(core::int x) → core::int => x.{core::num::+}(1);
- <T extends core::Object>(core::int) → core::String y = int2String;
- y = <T extends core::Object>(core::int x) → core::String => let final dynamic #t19 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_generic_function_expressions.dart:64:9: Error: A value of type 'dart.core::int' can't be assigned to a variable of type 'dart.core::String'.
+ <S extends core::Object = dynamic>(core::int) → core::int x = int2int;
+ x = <T extends core::Object = dynamic>(core::int x) → core::int => x;
+ x = <T extends core::Object = dynamic>(core::int x) → core::int => x.{core::num::+}(1);
+ <T extends core::Object = dynamic>(core::int) → core::String y = int2String;
+ y = <T extends core::Object = dynamic>(core::int x) → core::String => let final dynamic #t19 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_generic_function_expressions.dart:64:9: Error: A value of type 'dart.core::int' can't be assigned to a variable of type 'dart.core::String'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::String'.
x;
^" in let final core::int #t20 = x in null;
- y = <T extends core::Object>(core::int x) → core::String => (let final core::int #t21 = x in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_generic_function_expressions.dart:66:10: Error: The method 'substring' isn't defined for the class 'dart.core::int'.
+ y = <T extends core::Object = dynamic>(core::int x) → core::String => (let final core::int #t21 = x in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_generic_function_expressions.dart:66:10: Error: The method 'substring' isn't defined for the class 'dart.core::int'.
Try correcting the name to the name of an existing method, or defining a method named 'substring'.
.substring(3);
^") as{TypeError} core::String;
- <T extends core::Object>(core::String) → core::String z = string2String;
- z = <T extends core::Object>(core::String x) → core::String => x.{core::String::substring}(3);
+ <T extends core::Object = dynamic>(core::String) → core::String z = string2String;
+ z = <T extends core::Object = dynamic>(core::String x) → core::String => x.{core::String::substring}(3);
}
}
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/downwards_inference_on_instance_creations_infer_downwards.dart.direct.expect b/pkg/front_end/testcases/inference/downwards_inference_on_instance_creations_infer_downwards.dart.direct.expect
index e0aaab1..2f9e241 100644
--- a/pkg/front_end/testcases/inference/downwards_inference_on_instance_creations_infer_downwards.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/downwards_inference_on_instance_creations_infer_downwards.dart.direct.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class A<S extends core::Object, T extends core::Object> extends core::Object {
+class A<S extends core::Object = dynamic, T extends core::Object = dynamic> extends core::Object {
field self::A::S x;
field self::A::T y;
constructor •(self::A::S x, self::A::T y) → void
@@ -12,7 +12,7 @@
: self::A::x = x, self::A::y = y, super core::Object::•()
;
}
-class B<S extends core::Object, T extends core::Object> extends self::A<self::B::T, self::B::S> {
+class B<S extends core::Object = dynamic, T extends core::Object = dynamic> extends self::A<self::B::T, self::B::S> {
constructor •(self::B::S y, self::B::T x) → void
: super self::A::•(x, y)
;
@@ -20,7 +20,7 @@
: super self::A::named(x, y)
;
}
-class C<S extends core::Object> extends self::B<self::C::S, self::C::S> {
+class C<S extends core::Object = dynamic> extends self::B<self::C::S, self::C::S> {
constructor •(self::C::S a) → void
: super self::B::•(a, a)
;
@@ -28,7 +28,7 @@
: super self::B::named(a, a)
;
}
-class D<S extends core::Object, T extends core::Object> extends self::B<self::D::T, core::int> {
+class D<S extends core::Object = dynamic, T extends core::Object = dynamic> extends self::B<self::D::T, core::int> {
constructor •(self::D::T a) → void
: super self::B::•(a, 3)
;
@@ -36,12 +36,12 @@
: super self::B::named(a, 3)
;
}
-class E<S extends core::Object, T extends core::Object> extends self::A<self::C<self::E::S>, self::E::T> {
+class E<S extends core::Object = dynamic, T extends core::Object = dynamic> extends self::A<self::C<self::E::S>, self::E::T> {
constructor •(self::E::T a) → void
: super self::A::•(null, a)
;
}
-class F<S extends core::Object, T extends core::Object> extends self::A<self::F::S, self::F::T> {
+class F<S extends core::Object = dynamic, T extends core::Object = dynamic> extends self::A<self::F::S, self::F::T> {
constructor •(self::F::S x, self::F::T y, {core::List<self::F::S> a = null, core::List<self::F::T> b = null}) → void
: super self::A::•(x, y)
;
diff --git a/pkg/front_end/testcases/inference/downwards_inference_on_instance_creations_infer_downwards.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/downwards_inference_on_instance_creations_infer_downwards.dart.direct.transformed.expect
index e0aaab1..2f9e241 100644
--- a/pkg/front_end/testcases/inference/downwards_inference_on_instance_creations_infer_downwards.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/downwards_inference_on_instance_creations_infer_downwards.dart.direct.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class A<S extends core::Object, T extends core::Object> extends core::Object {
+class A<S extends core::Object = dynamic, T extends core::Object = dynamic> extends core::Object {
field self::A::S x;
field self::A::T y;
constructor •(self::A::S x, self::A::T y) → void
@@ -12,7 +12,7 @@
: self::A::x = x, self::A::y = y, super core::Object::•()
;
}
-class B<S extends core::Object, T extends core::Object> extends self::A<self::B::T, self::B::S> {
+class B<S extends core::Object = dynamic, T extends core::Object = dynamic> extends self::A<self::B::T, self::B::S> {
constructor •(self::B::S y, self::B::T x) → void
: super self::A::•(x, y)
;
@@ -20,7 +20,7 @@
: super self::A::named(x, y)
;
}
-class C<S extends core::Object> extends self::B<self::C::S, self::C::S> {
+class C<S extends core::Object = dynamic> extends self::B<self::C::S, self::C::S> {
constructor •(self::C::S a) → void
: super self::B::•(a, a)
;
@@ -28,7 +28,7 @@
: super self::B::named(a, a)
;
}
-class D<S extends core::Object, T extends core::Object> extends self::B<self::D::T, core::int> {
+class D<S extends core::Object = dynamic, T extends core::Object = dynamic> extends self::B<self::D::T, core::int> {
constructor •(self::D::T a) → void
: super self::B::•(a, 3)
;
@@ -36,12 +36,12 @@
: super self::B::named(a, 3)
;
}
-class E<S extends core::Object, T extends core::Object> extends self::A<self::C<self::E::S>, self::E::T> {
+class E<S extends core::Object = dynamic, T extends core::Object = dynamic> extends self::A<self::C<self::E::S>, self::E::T> {
constructor •(self::E::T a) → void
: super self::A::•(null, a)
;
}
-class F<S extends core::Object, T extends core::Object> extends self::A<self::F::S, self::F::T> {
+class F<S extends core::Object = dynamic, T extends core::Object = dynamic> extends self::A<self::F::S, self::F::T> {
constructor •(self::F::S x, self::F::T y, {core::List<self::F::S> a = null, core::List<self::F::T> b = null}) → void
: super self::A::•(x, y)
;
diff --git a/pkg/front_end/testcases/inference/downwards_inference_on_instance_creations_infer_downwards.dart.strong.expect b/pkg/front_end/testcases/inference/downwards_inference_on_instance_creations_infer_downwards.dart.strong.expect
index b3047dd..5fc98c7 100644
--- a/pkg/front_end/testcases/inference/downwards_inference_on_instance_creations_infer_downwards.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/downwards_inference_on_instance_creations_infer_downwards.dart.strong.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class A<S extends core::Object, T extends core::Object> extends core::Object {
+class A<S extends core::Object = dynamic, T extends core::Object = dynamic> extends core::Object {
generic-covariant-impl generic-covariant-interface field self::A::S x;
generic-covariant-impl generic-covariant-interface field self::A::T y;
constructor •(self::A::S x, self::A::T y) → void
@@ -12,7 +12,7 @@
: self::A::x = x, self::A::y = y, super core::Object::•()
;
}
-class B<S extends core::Object, T extends core::Object> extends self::A<self::B::T, self::B::S> {
+class B<S extends core::Object = dynamic, T extends core::Object = dynamic> extends self::A<self::B::T, self::B::S> {
constructor •(self::B::S y, self::B::T x) → void
: super self::A::•(x, y)
;
@@ -20,7 +20,7 @@
: super self::A::named(x, y)
;
}
-class C<S extends core::Object> extends self::B<self::C::S, self::C::S> {
+class C<S extends core::Object = dynamic> extends self::B<self::C::S, self::C::S> {
constructor •(self::C::S a) → void
: super self::B::•(a, a)
;
@@ -28,7 +28,7 @@
: super self::B::named(a, a)
;
}
-class D<S extends core::Object, T extends core::Object> extends self::B<self::D::T, core::int> {
+class D<S extends core::Object = dynamic, T extends core::Object = dynamic> extends self::B<self::D::T, core::int> {
constructor •(self::D::T a) → void
: super self::B::•(a, 3)
;
@@ -37,12 +37,12 @@
;
abstract forwarding-stub set x(generic-covariant-impl core::int _) → void;
}
-class E<S extends core::Object, T extends core::Object> extends self::A<self::C<self::E::S>, self::E::T> {
+class E<S extends core::Object = dynamic, T extends core::Object = dynamic> extends self::A<self::C<self::E::S>, self::E::T> {
constructor •(self::E::T a) → void
: super self::A::•(null, a)
;
}
-class F<S extends core::Object, T extends core::Object> extends self::A<self::F::S, self::F::T> {
+class F<S extends core::Object = dynamic, T extends core::Object = dynamic> extends self::A<self::F::S, self::F::T> {
constructor •(self::F::S x, self::F::T y, {core::List<self::F::S> a = null, core::List<self::F::T> b = null}) → void
: super self::A::•(x, y)
;
diff --git a/pkg/front_end/testcases/inference/downwards_inference_on_instance_creations_infer_downwards.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/downwards_inference_on_instance_creations_infer_downwards.dart.strong.transformed.expect
index 97104e0..1100687 100644
--- a/pkg/front_end/testcases/inference/downwards_inference_on_instance_creations_infer_downwards.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/downwards_inference_on_instance_creations_infer_downwards.dart.strong.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class A<S extends core::Object, T extends core::Object> extends core::Object {
+class A<S extends core::Object = dynamic, T extends core::Object = dynamic> extends core::Object {
generic-covariant-impl generic-covariant-interface field self::A::S x;
generic-covariant-impl generic-covariant-interface field self::A::T y;
constructor •(self::A::S x, self::A::T y) → void
@@ -12,7 +12,7 @@
: self::A::x = x, self::A::y = y, super core::Object::•()
;
}
-class B<S extends core::Object, T extends core::Object> extends self::A<self::B::T, self::B::S> {
+class B<S extends core::Object = dynamic, T extends core::Object = dynamic> extends self::A<self::B::T, self::B::S> {
constructor •(self::B::S y, self::B::T x) → void
: super self::A::•(x, y)
;
@@ -20,7 +20,7 @@
: super self::A::named(x, y)
;
}
-class C<S extends core::Object> extends self::B<self::C::S, self::C::S> {
+class C<S extends core::Object = dynamic> extends self::B<self::C::S, self::C::S> {
constructor •(self::C::S a) → void
: super self::B::•(a, a)
;
@@ -28,7 +28,7 @@
: super self::B::named(a, a)
;
}
-class D<S extends core::Object, T extends core::Object> extends self::B<self::D::T, core::int> {
+class D<S extends core::Object = dynamic, T extends core::Object = dynamic> extends self::B<self::D::T, core::int> {
constructor •(self::D::T a) → void
: super self::B::•(a, 3)
;
@@ -37,12 +37,12 @@
;
abstract forwarding-stub set x(generic-covariant-impl core::int _) → void;
}
-class E<S extends core::Object, T extends core::Object> extends self::A<self::C<self::E::S>, self::E::T> {
+class E<S extends core::Object = dynamic, T extends core::Object = dynamic> extends self::A<self::C<self::E::S>, self::E::T> {
constructor •(self::E::T a) → void
: super self::A::•(null, a)
;
}
-class F<S extends core::Object, T extends core::Object> extends self::A<self::F::S, self::F::T> {
+class F<S extends core::Object = dynamic, T extends core::Object = dynamic> extends self::A<self::F::S, self::F::T> {
constructor •(self::F::S x, self::F::T y, {core::List<self::F::S> a = null, core::List<self::F::T> b = null}) → void
: super self::A::•(x, y)
;
diff --git a/pkg/front_end/testcases/inference/downwards_inference_on_list_literals_infer_if_value_types_match_context.dart.direct.expect b/pkg/front_end/testcases/inference/downwards_inference_on_list_literals_infer_if_value_types_match_context.dart.direct.expect
index 85ea052..c243444 100644
--- a/pkg/front_end/testcases/inference/downwards_inference_on_list_literals_infer_if_value_types_match_context.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/downwards_inference_on_list_literals_infer_if_value_types_match_context.dart.direct.expect
@@ -2,8 +2,8 @@
import self as self;
import "dart:core" as core;
-typedef Asserter<T extends core::Object> = (T) → void;
-typedef AsserterBuilder<S extends core::Object, T extends core::Object> = (S) → (T) → void;
+typedef Asserter<T extends core::Object = dynamic> = (T) → void;
+typedef AsserterBuilder<S extends core::Object = dynamic, T extends core::Object = dynamic> = (S) → (T) → void;
class DartType extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
@@ -26,7 +26,7 @@
assertEOf.call(<dynamic>[self::_isInt, self::_isString]);
}
}
-abstract class G<T extends core::Object> extends core::Object {
+abstract class G<T extends core::Object = dynamic> extends core::Object {
field (core::List<(self::DartType) → void>) → (self::DartType) → void assertAOf = null;
synthetic constructor •() → void
: super core::Object::•()
diff --git a/pkg/front_end/testcases/inference/downwards_inference_on_list_literals_infer_if_value_types_match_context.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/downwards_inference_on_list_literals_infer_if_value_types_match_context.dart.direct.transformed.expect
index 85ea052..c243444 100644
--- a/pkg/front_end/testcases/inference/downwards_inference_on_list_literals_infer_if_value_types_match_context.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/downwards_inference_on_list_literals_infer_if_value_types_match_context.dart.direct.transformed.expect
@@ -2,8 +2,8 @@
import self as self;
import "dart:core" as core;
-typedef Asserter<T extends core::Object> = (T) → void;
-typedef AsserterBuilder<S extends core::Object, T extends core::Object> = (S) → (T) → void;
+typedef Asserter<T extends core::Object = dynamic> = (T) → void;
+typedef AsserterBuilder<S extends core::Object = dynamic, T extends core::Object = dynamic> = (S) → (T) → void;
class DartType extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
@@ -26,7 +26,7 @@
assertEOf.call(<dynamic>[self::_isInt, self::_isString]);
}
}
-abstract class G<T extends core::Object> extends core::Object {
+abstract class G<T extends core::Object = dynamic> extends core::Object {
field (core::List<(self::DartType) → void>) → (self::DartType) → void assertAOf = null;
synthetic constructor •() → void
: super core::Object::•()
diff --git a/pkg/front_end/testcases/inference/downwards_inference_on_list_literals_infer_if_value_types_match_context.dart.strong.expect b/pkg/front_end/testcases/inference/downwards_inference_on_list_literals_infer_if_value_types_match_context.dart.strong.expect
index 3339b4b..de41535 100644
--- a/pkg/front_end/testcases/inference/downwards_inference_on_list_literals_infer_if_value_types_match_context.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/downwards_inference_on_list_literals_infer_if_value_types_match_context.dart.strong.expect
@@ -2,8 +2,8 @@
import self as self;
import "dart:core" as core;
-typedef Asserter<T extends core::Object> = (T) → void;
-typedef AsserterBuilder<S extends core::Object, T extends core::Object> = (S) → (T) → void;
+typedef Asserter<T extends core::Object = dynamic> = (T) → void;
+typedef AsserterBuilder<S extends core::Object = dynamic, T extends core::Object = dynamic> = (S) → (T) → void;
class DartType extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
@@ -26,7 +26,7 @@
assertEOf.call(<(self::DartType) → void>[self::_isInt, self::_isString]);
}
}
-abstract class G<T extends core::Object> extends core::Object {
+abstract class G<T extends core::Object = dynamic> extends core::Object {
field (core::List<(self::DartType) → void>) → (self::DartType) → void assertAOf = null;
synthetic constructor •() → void
: super core::Object::•()
diff --git a/pkg/front_end/testcases/inference/downwards_inference_on_list_literals_infer_if_value_types_match_context.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/downwards_inference_on_list_literals_infer_if_value_types_match_context.dart.strong.transformed.expect
index 3339b4b..de41535 100644
--- a/pkg/front_end/testcases/inference/downwards_inference_on_list_literals_infer_if_value_types_match_context.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/downwards_inference_on_list_literals_infer_if_value_types_match_context.dart.strong.transformed.expect
@@ -2,8 +2,8 @@
import self as self;
import "dart:core" as core;
-typedef Asserter<T extends core::Object> = (T) → void;
-typedef AsserterBuilder<S extends core::Object, T extends core::Object> = (S) → (T) → void;
+typedef Asserter<T extends core::Object = dynamic> = (T) → void;
+typedef AsserterBuilder<S extends core::Object = dynamic, T extends core::Object = dynamic> = (S) → (T) → void;
class DartType extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
@@ -26,7 +26,7 @@
assertEOf.call(<(self::DartType) → void>[self::_isInt, self::_isString]);
}
}
-abstract class G<T extends core::Object> extends core::Object {
+abstract class G<T extends core::Object = dynamic> extends core::Object {
field (core::List<(self::DartType) → void>) → (self::DartType) → void assertAOf = null;
synthetic constructor •() → void
: super core::Object::•()
diff --git a/pkg/front_end/testcases/inference/downwards_inference_yield_yield_star.dart.direct.expect b/pkg/front_end/testcases/inference/downwards_inference_yield_yield_star.dart.direct.expect
index 2a6a8d9..bbe604f 100644
--- a/pkg/front_end/testcases/inference/downwards_inference_yield_yield_star.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/downwards_inference_yield_yield_star.dart.direct.expect
@@ -3,8 +3,8 @@
import "dart:core" as core;
import "dart:async" as asy;
-abstract class MyStream<T extends core::Object> extends asy::Stream<self::MyStream::T> {
- static factory •<T extends core::Object>() → self::MyStream<self::MyStream::•::T>
+abstract class MyStream<T extends core::Object = dynamic> extends asy::Stream<self::MyStream::T> {
+ static factory •<T extends core::Object = dynamic>() → self::MyStream<self::MyStream::•::T>
return null;
}
static method foo() → asy::Stream<core::List<core::int>> async* {
diff --git a/pkg/front_end/testcases/inference/downwards_inference_yield_yield_star.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/downwards_inference_yield_yield_star.dart.direct.transformed.expect
index 55bf544..14c0f7c 100644
--- a/pkg/front_end/testcases/inference/downwards_inference_yield_yield_star.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/downwards_inference_yield_yield_star.dart.direct.transformed.expect
@@ -3,8 +3,8 @@
import "dart:core" as core;
import "dart:async" as asy;
-abstract class MyStream<T extends core::Object> extends asy::Stream<self::MyStream::T> {
- static factory •<T extends core::Object>() → self::MyStream<self::MyStream::•::T>
+abstract class MyStream<T extends core::Object = dynamic> extends asy::Stream<self::MyStream::T> {
+ static factory •<T extends core::Object = dynamic>() → self::MyStream<self::MyStream::•::T>
return null;
}
static method foo() → asy::Stream<core::List<core::int>> /* originally async* */ {
diff --git a/pkg/front_end/testcases/inference/downwards_inference_yield_yield_star.dart.strong.expect b/pkg/front_end/testcases/inference/downwards_inference_yield_yield_star.dart.strong.expect
index 67bbde6..fcaf358 100644
--- a/pkg/front_end/testcases/inference/downwards_inference_yield_yield_star.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/downwards_inference_yield_yield_star.dart.strong.expect
@@ -3,8 +3,8 @@
import "dart:core" as core;
import "dart:async" as asy;
-abstract class MyStream<T extends core::Object> extends asy::Stream<self::MyStream::T> {
- static factory •<T extends core::Object>() → self::MyStream<self::MyStream::•::T>
+abstract class MyStream<T extends core::Object = dynamic> extends asy::Stream<self::MyStream::T> {
+ static factory •<T extends core::Object = dynamic>() → self::MyStream<self::MyStream::•::T>
return null;
}
static method foo() → asy::Stream<core::List<core::int>> async* {
diff --git a/pkg/front_end/testcases/inference/field_initializer_context_explicit.dart.direct.expect b/pkg/front_end/testcases/inference/field_initializer_context_explicit.dart.direct.expect
index a9ca0dd..01196f3 100644
--- a/pkg/front_end/testcases/inference/field_initializer_context_explicit.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/field_initializer_context_explicit.dart.direct.expect
@@ -8,6 +8,6 @@
: self::C::x = self::f<dynamic>(), super core::Object::•()
;
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/field_initializer_context_explicit.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/field_initializer_context_explicit.dart.direct.transformed.expect
index a9ca0dd..01196f3 100644
--- a/pkg/front_end/testcases/inference/field_initializer_context_explicit.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/field_initializer_context_explicit.dart.direct.transformed.expect
@@ -8,6 +8,6 @@
: self::C::x = self::f<dynamic>(), super core::Object::•()
;
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/field_initializer_context_explicit.dart.outline.expect b/pkg/front_end/testcases/inference/field_initializer_context_explicit.dart.outline.expect
index c3d8126..1a319e3 100644
--- a/pkg/front_end/testcases/inference/field_initializer_context_explicit.dart.outline.expect
+++ b/pkg/front_end/testcases/inference/field_initializer_context_explicit.dart.outline.expect
@@ -7,7 +7,7 @@
constructor •() → void
;
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
;
static method main() → dynamic
;
diff --git a/pkg/front_end/testcases/inference/field_initializer_context_explicit.dart.strong.expect b/pkg/front_end/testcases/inference/field_initializer_context_explicit.dart.strong.expect
index 8924797..ebfd78a 100644
--- a/pkg/front_end/testcases/inference/field_initializer_context_explicit.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/field_initializer_context_explicit.dart.strong.expect
@@ -8,6 +8,6 @@
: self::C::x = self::f<core::int>(), super core::Object::•()
;
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/field_initializer_context_explicit.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/field_initializer_context_explicit.dart.strong.transformed.expect
index 8924797..ebfd78a 100644
--- a/pkg/front_end/testcases/inference/field_initializer_context_explicit.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/field_initializer_context_explicit.dart.strong.transformed.expect
@@ -8,6 +8,6 @@
: self::C::x = self::f<core::int>(), super core::Object::•()
;
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/field_initializer_context_implicit.dart.direct.expect b/pkg/front_end/testcases/inference/field_initializer_context_implicit.dart.direct.expect
index d495b26..9057cb2 100644
--- a/pkg/front_end/testcases/inference/field_initializer_context_implicit.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/field_initializer_context_implicit.dart.direct.expect
@@ -14,6 +14,6 @@
;
abstract get x() → core::int;
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/field_initializer_context_implicit.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/field_initializer_context_implicit.dart.direct.transformed.expect
index d495b26..9057cb2 100644
--- a/pkg/front_end/testcases/inference/field_initializer_context_implicit.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/field_initializer_context_implicit.dart.direct.transformed.expect
@@ -14,6 +14,6 @@
;
abstract get x() → core::int;
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/field_initializer_context_implicit.dart.outline.expect b/pkg/front_end/testcases/inference/field_initializer_context_implicit.dart.outline.expect
index e0ab312..a7c7685 100644
--- a/pkg/front_end/testcases/inference/field_initializer_context_implicit.dart.outline.expect
+++ b/pkg/front_end/testcases/inference/field_initializer_context_implicit.dart.outline.expect
@@ -12,7 +12,7 @@
;
abstract get x() → core::int;
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
;
static method main() → dynamic
;
diff --git a/pkg/front_end/testcases/inference/field_initializer_context_implicit.dart.strong.expect b/pkg/front_end/testcases/inference/field_initializer_context_implicit.dart.strong.expect
index ef576d9..e060b43 100644
--- a/pkg/front_end/testcases/inference/field_initializer_context_implicit.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/field_initializer_context_implicit.dart.strong.expect
@@ -14,6 +14,6 @@
;
abstract get x() → core::int;
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/field_initializer_context_implicit.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/field_initializer_context_implicit.dart.strong.transformed.expect
index ef576d9..e060b43 100644
--- a/pkg/front_end/testcases/inference/field_initializer_context_implicit.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/field_initializer_context_implicit.dart.strong.transformed.expect
@@ -14,6 +14,6 @@
;
abstract get x() → core::int;
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/field_initializer_context_this.dart.direct.expect b/pkg/front_end/testcases/inference/field_initializer_context_this.dart.direct.expect
index a9ca0dd..01196f3 100644
--- a/pkg/front_end/testcases/inference/field_initializer_context_this.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/field_initializer_context_this.dart.direct.expect
@@ -8,6 +8,6 @@
: self::C::x = self::f<dynamic>(), super core::Object::•()
;
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/field_initializer_context_this.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/field_initializer_context_this.dart.direct.transformed.expect
index a9ca0dd..01196f3 100644
--- a/pkg/front_end/testcases/inference/field_initializer_context_this.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/field_initializer_context_this.dart.direct.transformed.expect
@@ -8,6 +8,6 @@
: self::C::x = self::f<dynamic>(), super core::Object::•()
;
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/field_initializer_context_this.dart.outline.expect b/pkg/front_end/testcases/inference/field_initializer_context_this.dart.outline.expect
index c3d8126..1a319e3 100644
--- a/pkg/front_end/testcases/inference/field_initializer_context_this.dart.outline.expect
+++ b/pkg/front_end/testcases/inference/field_initializer_context_this.dart.outline.expect
@@ -7,7 +7,7 @@
constructor •() → void
;
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
;
static method main() → dynamic
;
diff --git a/pkg/front_end/testcases/inference/field_initializer_context_this.dart.strong.expect b/pkg/front_end/testcases/inference/field_initializer_context_this.dart.strong.expect
index 8924797..ebfd78a 100644
--- a/pkg/front_end/testcases/inference/field_initializer_context_this.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/field_initializer_context_this.dart.strong.expect
@@ -8,6 +8,6 @@
: self::C::x = self::f<core::int>(), super core::Object::•()
;
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/field_initializer_context_this.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/field_initializer_context_this.dart.strong.transformed.expect
index 8924797..ebfd78a 100644
--- a/pkg/front_end/testcases/inference/field_initializer_context_this.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/field_initializer_context_this.dart.strong.transformed.expect
@@ -8,6 +8,6 @@
: self::C::x = self::f<core::int>(), super core::Object::•()
;
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/field_initializer_parameter.dart.direct.expect b/pkg/front_end/testcases/inference/field_initializer_parameter.dart.direct.expect
index dfabd77..f3969cb 100644
--- a/pkg/front_end/testcases/inference/field_initializer_parameter.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/field_initializer_parameter.dart.direct.expect
@@ -8,6 +8,6 @@
: self::C::x = self::f<dynamic>(p), super core::Object::•()
;
}
-static method f<T extends core::Object>(self::f::T t) → self::f::T
+static method f<T extends core::Object = dynamic>(self::f::T t) → self::f::T
return t;
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/field_initializer_parameter.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/field_initializer_parameter.dart.direct.transformed.expect
index dfabd77..f3969cb 100644
--- a/pkg/front_end/testcases/inference/field_initializer_parameter.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/field_initializer_parameter.dart.direct.transformed.expect
@@ -8,6 +8,6 @@
: self::C::x = self::f<dynamic>(p), super core::Object::•()
;
}
-static method f<T extends core::Object>(self::f::T t) → self::f::T
+static method f<T extends core::Object = dynamic>(self::f::T t) → self::f::T
return t;
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/field_initializer_parameter.dart.outline.expect b/pkg/front_end/testcases/inference/field_initializer_parameter.dart.outline.expect
index 8512f84..a19f31b 100644
--- a/pkg/front_end/testcases/inference/field_initializer_parameter.dart.outline.expect
+++ b/pkg/front_end/testcases/inference/field_initializer_parameter.dart.outline.expect
@@ -7,7 +7,7 @@
constructor •(core::int p) → void
;
}
-static method f<T extends core::Object>(self::f::T t) → self::f::T
+static method f<T extends core::Object = dynamic>(self::f::T t) → self::f::T
;
static method main() → dynamic
;
diff --git a/pkg/front_end/testcases/inference/field_initializer_parameter.dart.strong.expect b/pkg/front_end/testcases/inference/field_initializer_parameter.dart.strong.expect
index ba6f581f..e0950da 100644
--- a/pkg/front_end/testcases/inference/field_initializer_parameter.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/field_initializer_parameter.dart.strong.expect
@@ -8,6 +8,6 @@
: self::C::x = self::f<core::int>(p), super core::Object::•()
;
}
-static method f<T extends core::Object>(self::f::T t) → self::f::T
+static method f<T extends core::Object = dynamic>(self::f::T t) → self::f::T
return t;
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/field_initializer_parameter.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/field_initializer_parameter.dart.strong.transformed.expect
index ba6f581f..e0950da 100644
--- a/pkg/front_end/testcases/inference/field_initializer_parameter.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/field_initializer_parameter.dart.strong.transformed.expect
@@ -8,6 +8,6 @@
: self::C::x = self::f<core::int>(p), super core::Object::•()
;
}
-static method f<T extends core::Object>(self::f::T t) → self::f::T
+static method f<T extends core::Object = dynamic>(self::f::T t) → self::f::T
return t;
static method main() → dynamic {}
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 d9c0e0e..238fc77 100644
--- a/pkg/front_end/testcases/inference/future_then.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/future_then.dart.direct.expect
@@ -3,14 +3,14 @@
import "dart:core" as core;
import "dart:async" as asy;
-class MyFuture<T extends core::Object> extends core::Object implements asy::Future<self::MyFuture::T> {
+class MyFuture<T extends core::Object = dynamic> extends core::Object implements asy::Future<self::MyFuture::T> {
constructor •() → void
: super core::Object::•() {}
constructor value(self::MyFuture::T x) → void
: super core::Object::•() {}
method noSuchMethod(dynamic invocation) → dynamic
return null;
- method then<S extends core::Object>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
+ 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;
abstract 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>;
abstract 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>;
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 80a20d3..d3553bd 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
@@ -3,14 +3,14 @@
import "dart:core" as core;
import "dart:async" as asy;
-class MyFuture<T extends core::Object> extends core::Object implements asy::Future<self::MyFuture::T> {
+class MyFuture<T extends core::Object = dynamic> extends core::Object implements asy::Future<self::MyFuture::T> {
constructor •() → void
: super core::Object::•() {}
constructor value(self::MyFuture::T x) → void
: super core::Object::•() {}
method noSuchMethod(dynamic invocation) → dynamic
return null;
- method then<S extends core::Object>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
+ 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;
abstract 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>;
abstract 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>;
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 bf89d40..0e4e4b9 100644
--- a/pkg/front_end/testcases/inference/future_then.dart.outline.expect
+++ b/pkg/front_end/testcases/inference/future_then.dart.outline.expect
@@ -3,14 +3,14 @@
import "dart:core" as core;
import "dart:async" as asy;
-class MyFuture<T extends core::Object> extends core::Object implements asy::Future<self::MyFuture::T> {
+class MyFuture<T extends core::Object = dynamic> extends core::Object implements asy::Future<self::MyFuture::T> {
constructor •() → void
;
constructor value(self::MyFuture::T x) → void
;
method noSuchMethod(dynamic invocation) → dynamic
;
- method then<S extends core::Object>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError}) → self::MyFuture<self::MyFuture::then::S>
+ 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>
;
abstract 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>;
abstract 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>;
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 b7c6c22..59ff30a 100644
--- a/pkg/front_end/testcases/inference/future_then.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/future_then.dart.strong.expect
@@ -3,14 +3,14 @@
import "dart:core" as core;
import "dart:async" as asy;
-class MyFuture<T extends core::Object> extends core::Object implements asy::Future<self::MyFuture::T> {
+class MyFuture<T extends core::Object = dynamic> extends core::Object implements asy::Future<self::MyFuture::T> {
constructor •() → void
: super core::Object::•() {}
constructor value(self::MyFuture::T x) → void
: super core::Object::•() {}
method noSuchMethod(core::Invocation invocation) → dynamic
return null;
- method then<S extends core::Object>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
+ 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;
abstract 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>;
abstract 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>;
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 5caa1e0..5f0f486 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
@@ -3,14 +3,14 @@
import "dart:core" as core;
import "dart:async" as asy;
-class MyFuture<T extends core::Object> extends core::Object implements asy::Future<self::MyFuture::T> {
+class MyFuture<T extends core::Object = dynamic> extends core::Object implements asy::Future<self::MyFuture::T> {
constructor •() → void
: super core::Object::•() {}
constructor value(self::MyFuture::T x) → void
: super core::Object::•() {}
method noSuchMethod(core::Invocation invocation) → dynamic
return null;
- method then<S extends core::Object>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
+ 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;
abstract 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>;
abstract 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>;
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 3290595..d6b1ae2 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
@@ -3,14 +3,14 @@
import "dart:core" as core;
import "dart:async" as asy;
-class MyFuture<T extends core::Object> extends core::Object implements asy::Future<self::MyFuture::T> {
+class MyFuture<T extends core::Object = dynamic> extends core::Object implements asy::Future<self::MyFuture::T> {
constructor •() → void
: super core::Object::•() {}
constructor value(self::MyFuture::T x) → void
: super core::Object::•() {}
method noSuchMethod(dynamic invocation) → dynamic
return null;
- method then<S extends core::Object>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
+ 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;
abstract 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>;
abstract 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>;
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 93b4078..433be3a 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
@@ -3,14 +3,14 @@
import "dart:core" as core;
import "dart:async" as asy;
-class MyFuture<T extends core::Object> extends core::Object implements asy::Future<self::MyFuture::T> {
+class MyFuture<T extends core::Object = dynamic> extends core::Object implements asy::Future<self::MyFuture::T> {
constructor •() → void
: super core::Object::•() {}
constructor value(self::MyFuture::T x) → void
: super core::Object::•() {}
method noSuchMethod(dynamic invocation) → dynamic
return null;
- method then<S extends core::Object>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
+ 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;
abstract 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>;
abstract 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>;
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 bf89d40..0e4e4b9 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
@@ -3,14 +3,14 @@
import "dart:core" as core;
import "dart:async" as asy;
-class MyFuture<T extends core::Object> extends core::Object implements asy::Future<self::MyFuture::T> {
+class MyFuture<T extends core::Object = dynamic> extends core::Object implements asy::Future<self::MyFuture::T> {
constructor •() → void
;
constructor value(self::MyFuture::T x) → void
;
method noSuchMethod(dynamic invocation) → dynamic
;
- method then<S extends core::Object>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError}) → self::MyFuture<self::MyFuture::then::S>
+ 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>
;
abstract 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>;
abstract 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>;
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 264f452..c4514a8 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
@@ -3,14 +3,14 @@
import "dart:core" as core;
import "dart:async" as asy;
-class MyFuture<T extends core::Object> extends core::Object implements asy::Future<self::MyFuture::T> {
+class MyFuture<T extends core::Object = dynamic> extends core::Object implements asy::Future<self::MyFuture::T> {
constructor •() → void
: super core::Object::•() {}
constructor value(self::MyFuture::T x) → void
: super core::Object::•() {}
method noSuchMethod(core::Invocation invocation) → dynamic
return null;
- method then<S extends core::Object>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
+ 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;
abstract 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>;
abstract 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>;
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 8989332..4d6c659 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
@@ -3,14 +3,14 @@
import "dart:core" as core;
import "dart:async" as asy;
-class MyFuture<T extends core::Object> extends core::Object implements asy::Future<self::MyFuture::T> {
+class MyFuture<T extends core::Object = dynamic> extends core::Object implements asy::Future<self::MyFuture::T> {
constructor •() → void
: super core::Object::•() {}
constructor value(self::MyFuture::T x) → void
: super core::Object::•() {}
method noSuchMethod(core::Invocation invocation) → dynamic
return null;
- method then<S extends core::Object>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
+ 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;
abstract 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>;
abstract 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>;
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 fc2ec41..28f970f 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
@@ -3,14 +3,14 @@
import "dart:core" as core;
import "dart:async" as asy;
-class MyFuture<T extends core::Object> extends core::Object implements asy::Future<self::MyFuture::T> {
+class MyFuture<T extends core::Object = dynamic> extends core::Object implements asy::Future<self::MyFuture::T> {
constructor •() → void
: super core::Object::•() {}
constructor value(self::MyFuture::T x) → void
: super core::Object::•() {}
method noSuchMethod(dynamic invocation) → dynamic
return null;
- method then<S extends core::Object>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
+ 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;
abstract 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>;
abstract 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>;
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 a94ad9c..05ea1f5 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
@@ -3,14 +3,14 @@
import "dart:core" as core;
import "dart:async" as asy;
-class MyFuture<T extends core::Object> extends core::Object implements asy::Future<self::MyFuture::T> {
+class MyFuture<T extends core::Object = dynamic> extends core::Object implements asy::Future<self::MyFuture::T> {
constructor •() → void
: super core::Object::•() {}
constructor value(self::MyFuture::T x) → void
: super core::Object::•() {}
method noSuchMethod(dynamic invocation) → dynamic
return null;
- method then<S extends core::Object>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
+ 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;
abstract 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>;
abstract 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>;
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 bf89d40..0e4e4b9 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
@@ -3,14 +3,14 @@
import "dart:core" as core;
import "dart:async" as asy;
-class MyFuture<T extends core::Object> extends core::Object implements asy::Future<self::MyFuture::T> {
+class MyFuture<T extends core::Object = dynamic> extends core::Object implements asy::Future<self::MyFuture::T> {
constructor •() → void
;
constructor value(self::MyFuture::T x) → void
;
method noSuchMethod(dynamic invocation) → dynamic
;
- method then<S extends core::Object>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError}) → self::MyFuture<self::MyFuture::then::S>
+ 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>
;
abstract 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>;
abstract 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>;
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 496a434..41dd64d 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
@@ -3,14 +3,14 @@
import "dart:core" as core;
import "dart:async" as asy;
-class MyFuture<T extends core::Object> extends core::Object implements asy::Future<self::MyFuture::T> {
+class MyFuture<T extends core::Object = dynamic> extends core::Object implements asy::Future<self::MyFuture::T> {
constructor •() → void
: super core::Object::•() {}
constructor value(self::MyFuture::T x) → void
: super core::Object::•() {}
method noSuchMethod(core::Invocation invocation) → dynamic
return null;
- method then<S extends core::Object>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
+ 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;
abstract 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>;
abstract 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>;
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 78a4a61..90396a6 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
@@ -3,14 +3,14 @@
import "dart:core" as core;
import "dart:async" as asy;
-class MyFuture<T extends core::Object> extends core::Object implements asy::Future<self::MyFuture::T> {
+class MyFuture<T extends core::Object = dynamic> extends core::Object implements asy::Future<self::MyFuture::T> {
constructor •() → void
: super core::Object::•() {}
constructor value(self::MyFuture::T x) → void
: super core::Object::•() {}
method noSuchMethod(core::Invocation invocation) → dynamic
return null;
- method then<S extends core::Object>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
+ 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;
abstract 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>;
abstract 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>;
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 627469a9..9d89e58 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
@@ -3,14 +3,14 @@
import "dart:core" as core;
import "dart:async" as asy;
-class MyFuture<T extends core::Object> extends core::Object implements asy::Future<self::MyFuture::T> {
+class MyFuture<T extends core::Object = dynamic> extends core::Object implements asy::Future<self::MyFuture::T> {
constructor •() → void
: super core::Object::•() {}
constructor value(self::MyFuture::T x) → void
: super core::Object::•() {}
method noSuchMethod(dynamic invocation) → dynamic
return null;
- method then<S extends core::Object>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
+ 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;
abstract 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>;
abstract 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>;
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 ee00df9..ed1cac1 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
@@ -3,14 +3,14 @@
import "dart:core" as core;
import "dart:async" as asy;
-class MyFuture<T extends core::Object> extends core::Object implements asy::Future<self::MyFuture::T> {
+class MyFuture<T extends core::Object = dynamic> extends core::Object implements asy::Future<self::MyFuture::T> {
constructor •() → void
: super core::Object::•() {}
constructor value(self::MyFuture::T x) → void
: super core::Object::•() {}
method noSuchMethod(dynamic invocation) → dynamic
return null;
- method then<S extends core::Object>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
+ 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;
abstract 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>;
abstract 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>;
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 bf89d40..0e4e4b9 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
@@ -3,14 +3,14 @@
import "dart:core" as core;
import "dart:async" as asy;
-class MyFuture<T extends core::Object> extends core::Object implements asy::Future<self::MyFuture::T> {
+class MyFuture<T extends core::Object = dynamic> extends core::Object implements asy::Future<self::MyFuture::T> {
constructor •() → void
;
constructor value(self::MyFuture::T x) → void
;
method noSuchMethod(dynamic invocation) → dynamic
;
- method then<S extends core::Object>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError}) → self::MyFuture<self::MyFuture::then::S>
+ 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>
;
abstract 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>;
abstract 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>;
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 0e9ab26..fb3eb9f 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
@@ -3,14 +3,14 @@
import "dart:core" as core;
import "dart:async" as asy;
-class MyFuture<T extends core::Object> extends core::Object implements asy::Future<self::MyFuture::T> {
+class MyFuture<T extends core::Object = dynamic> extends core::Object implements asy::Future<self::MyFuture::T> {
constructor •() → void
: super core::Object::•() {}
constructor value(self::MyFuture::T x) → void
: super core::Object::•() {}
method noSuchMethod(core::Invocation invocation) → dynamic
return null;
- method then<S extends core::Object>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
+ 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;
abstract 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>;
abstract 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>;
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 03446f5..ff00d40 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
@@ -3,14 +3,14 @@
import "dart:core" as core;
import "dart:async" as asy;
-class MyFuture<T extends core::Object> extends core::Object implements asy::Future<self::MyFuture::T> {
+class MyFuture<T extends core::Object = dynamic> extends core::Object implements asy::Future<self::MyFuture::T> {
constructor •() → void
: super core::Object::•() {}
constructor value(self::MyFuture::T x) → void
: super core::Object::•() {}
method noSuchMethod(core::Invocation invocation) → dynamic
return null;
- method then<S extends core::Object>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
+ 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;
abstract 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>;
abstract 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>;
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 cf8341b..d8ab165 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
@@ -3,14 +3,14 @@
import "dart:core" as core;
import "dart:async" as asy;
-class MyFuture<T extends core::Object> extends core::Object implements asy::Future<self::MyFuture::T> {
+class MyFuture<T extends core::Object = dynamic> extends core::Object implements asy::Future<self::MyFuture::T> {
constructor •() → void
: super core::Object::•() {}
constructor value(self::MyFuture::T x) → void
: super core::Object::•() {}
method noSuchMethod(dynamic invocation) → dynamic
return null;
- method then<S extends core::Object>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
+ 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;
abstract 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>;
abstract 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>;
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 2c79488..62658a3 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
@@ -3,14 +3,14 @@
import "dart:core" as core;
import "dart:async" as asy;
-class MyFuture<T extends core::Object> extends core::Object implements asy::Future<self::MyFuture::T> {
+class MyFuture<T extends core::Object = dynamic> extends core::Object implements asy::Future<self::MyFuture::T> {
constructor •() → void
: super core::Object::•() {}
constructor value(self::MyFuture::T x) → void
: super core::Object::•() {}
method noSuchMethod(dynamic invocation) → dynamic
return null;
- method then<S extends core::Object>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
+ 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;
abstract 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>;
abstract 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>;
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 bf89d40..0e4e4b9 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
@@ -3,14 +3,14 @@
import "dart:core" as core;
import "dart:async" as asy;
-class MyFuture<T extends core::Object> extends core::Object implements asy::Future<self::MyFuture::T> {
+class MyFuture<T extends core::Object = dynamic> extends core::Object implements asy::Future<self::MyFuture::T> {
constructor •() → void
;
constructor value(self::MyFuture::T x) → void
;
method noSuchMethod(dynamic invocation) → dynamic
;
- method then<S extends core::Object>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError}) → self::MyFuture<self::MyFuture::then::S>
+ 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>
;
abstract 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>;
abstract 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>;
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 60a45b2..369cd48 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
@@ -3,14 +3,14 @@
import "dart:core" as core;
import "dart:async" as asy;
-class MyFuture<T extends core::Object> extends core::Object implements asy::Future<self::MyFuture::T> {
+class MyFuture<T extends core::Object = dynamic> extends core::Object implements asy::Future<self::MyFuture::T> {
constructor •() → void
: super core::Object::•() {}
constructor value(self::MyFuture::T x) → void
: super core::Object::•() {}
method noSuchMethod(core::Invocation invocation) → dynamic
return null;
- method then<S extends core::Object>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
+ 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;
abstract 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>;
abstract 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>;
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 495a584..3aba981 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
@@ -3,14 +3,14 @@
import "dart:core" as core;
import "dart:async" as asy;
-class MyFuture<T extends core::Object> extends core::Object implements asy::Future<self::MyFuture::T> {
+class MyFuture<T extends core::Object = dynamic> extends core::Object implements asy::Future<self::MyFuture::T> {
constructor •() → void
: super core::Object::•() {}
constructor value(self::MyFuture::T x) → void
: super core::Object::•() {}
method noSuchMethod(core::Invocation invocation) → dynamic
return null;
- method then<S extends core::Object>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
+ 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;
abstract 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>;
abstract 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>;
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 59eca7d..be6b273 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
@@ -3,14 +3,14 @@
import "dart:core" as core;
import "dart:async" as asy;
-class MyFuture<T extends core::Object> extends core::Object implements asy::Future<self::MyFuture::T> {
+class MyFuture<T extends core::Object = dynamic> extends core::Object implements asy::Future<self::MyFuture::T> {
constructor •() → void
: super core::Object::•() {}
constructor value(self::MyFuture::T x) → void
: super core::Object::•() {}
method noSuchMethod(dynamic invocation) → dynamic
return null;
- method then<S extends core::Object>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
+ 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;
abstract 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>;
abstract 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>;
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 470f6c1..434b5d6 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
@@ -3,14 +3,14 @@
import "dart:core" as core;
import "dart:async" as asy;
-class MyFuture<T extends core::Object> extends core::Object implements asy::Future<self::MyFuture::T> {
+class MyFuture<T extends core::Object = dynamic> extends core::Object implements asy::Future<self::MyFuture::T> {
constructor •() → void
: super core::Object::•() {}
constructor value(self::MyFuture::T x) → void
: super core::Object::•() {}
method noSuchMethod(dynamic invocation) → dynamic
return null;
- method then<S extends core::Object>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
+ 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;
abstract 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>;
abstract 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>;
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 bf89d40..0e4e4b9 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
@@ -3,14 +3,14 @@
import "dart:core" as core;
import "dart:async" as asy;
-class MyFuture<T extends core::Object> extends core::Object implements asy::Future<self::MyFuture::T> {
+class MyFuture<T extends core::Object = dynamic> extends core::Object implements asy::Future<self::MyFuture::T> {
constructor •() → void
;
constructor value(self::MyFuture::T x) → void
;
method noSuchMethod(dynamic invocation) → dynamic
;
- method then<S extends core::Object>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError}) → self::MyFuture<self::MyFuture::then::S>
+ 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>
;
abstract 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>;
abstract 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>;
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 03a4550..51d8ee3 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
@@ -3,14 +3,14 @@
import "dart:core" as core;
import "dart:async" as asy;
-class MyFuture<T extends core::Object> extends core::Object implements asy::Future<self::MyFuture::T> {
+class MyFuture<T extends core::Object = dynamic> extends core::Object implements asy::Future<self::MyFuture::T> {
constructor •() → void
: super core::Object::•() {}
constructor value(self::MyFuture::T x) → void
: super core::Object::•() {}
method noSuchMethod(core::Invocation invocation) → dynamic
return null;
- method then<S extends core::Object>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
+ 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;
abstract 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>;
abstract 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>;
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 01b2db8..2e7cc96 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
@@ -3,14 +3,14 @@
import "dart:core" as core;
import "dart:async" as asy;
-class MyFuture<T extends core::Object> extends core::Object implements asy::Future<self::MyFuture::T> {
+class MyFuture<T extends core::Object = dynamic> extends core::Object implements asy::Future<self::MyFuture::T> {
constructor •() → void
: super core::Object::•() {}
constructor value(self::MyFuture::T x) → void
: super core::Object::•() {}
method noSuchMethod(core::Invocation invocation) → dynamic
return null;
- method then<S extends core::Object>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
+ 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;
abstract 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>;
abstract 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>;
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 6352e0d..60890bc 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
@@ -3,14 +3,14 @@
import "dart:core" as core;
import "dart:async" as asy;
-class MyFuture<T extends core::Object> extends core::Object implements asy::Future<self::MyFuture::T> {
+class MyFuture<T extends core::Object = dynamic> extends core::Object implements asy::Future<self::MyFuture::T> {
constructor •() → void
: super core::Object::•() {}
constructor value(self::MyFuture::T x) → void
: super core::Object::•() {}
method noSuchMethod(dynamic invocation) → dynamic
return null;
- method then<S extends core::Object>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
+ 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;
abstract 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>;
abstract 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>;
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 8b8e2a7..f2f15cd 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
@@ -3,14 +3,14 @@
import "dart:core" as core;
import "dart:async" as asy;
-class MyFuture<T extends core::Object> extends core::Object implements asy::Future<self::MyFuture::T> {
+class MyFuture<T extends core::Object = dynamic> extends core::Object implements asy::Future<self::MyFuture::T> {
constructor •() → void
: super core::Object::•() {}
constructor value(self::MyFuture::T x) → void
: super core::Object::•() {}
method noSuchMethod(dynamic invocation) → dynamic
return null;
- method then<S extends core::Object>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
+ 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;
abstract 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>;
abstract 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>;
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 bf89d40..0e4e4b9 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
@@ -3,14 +3,14 @@
import "dart:core" as core;
import "dart:async" as asy;
-class MyFuture<T extends core::Object> extends core::Object implements asy::Future<self::MyFuture::T> {
+class MyFuture<T extends core::Object = dynamic> extends core::Object implements asy::Future<self::MyFuture::T> {
constructor •() → void
;
constructor value(self::MyFuture::T x) → void
;
method noSuchMethod(dynamic invocation) → dynamic
;
- method then<S extends core::Object>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError}) → self::MyFuture<self::MyFuture::then::S>
+ 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>
;
abstract 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>;
abstract 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>;
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 08ec64a..1d68a0b 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
@@ -3,14 +3,14 @@
import "dart:core" as core;
import "dart:async" as asy;
-class MyFuture<T extends core::Object> extends core::Object implements asy::Future<self::MyFuture::T> {
+class MyFuture<T extends core::Object = dynamic> extends core::Object implements asy::Future<self::MyFuture::T> {
constructor •() → void
: super core::Object::•() {}
constructor value(self::MyFuture::T x) → void
: super core::Object::•() {}
method noSuchMethod(core::Invocation invocation) → dynamic
return null;
- method then<S extends core::Object>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
+ 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;
abstract 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>;
abstract 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>;
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 ff77eeb..a1d8145 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
@@ -3,14 +3,14 @@
import "dart:core" as core;
import "dart:async" as asy;
-class MyFuture<T extends core::Object> extends core::Object implements asy::Future<self::MyFuture::T> {
+class MyFuture<T extends core::Object = dynamic> extends core::Object implements asy::Future<self::MyFuture::T> {
constructor •() → void
: super core::Object::•() {}
constructor value(self::MyFuture::T x) → void
: super core::Object::•() {}
method noSuchMethod(core::Invocation invocation) → dynamic
return null;
- method then<S extends core::Object>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
+ 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;
abstract 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>;
abstract 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>;
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 4884c6c..ffc7080 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
@@ -3,14 +3,14 @@
import "dart:core" as core;
import "dart:async" as asy;
-class MyFuture<T extends core::Object> extends core::Object implements asy::Future<self::MyFuture::T> {
+class MyFuture<T extends core::Object = dynamic> extends core::Object implements asy::Future<self::MyFuture::T> {
constructor •() → void
: super core::Object::•() {}
constructor value(self::MyFuture::T x) → void
: super core::Object::•() {}
method noSuchMethod(dynamic invocation) → dynamic
return null;
- method then<S extends core::Object>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
+ 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;
abstract 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>;
abstract 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>;
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 77323ea..2fa2c058 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
@@ -3,14 +3,14 @@
import "dart:core" as core;
import "dart:async" as asy;
-class MyFuture<T extends core::Object> extends core::Object implements asy::Future<self::MyFuture::T> {
+class MyFuture<T extends core::Object = dynamic> extends core::Object implements asy::Future<self::MyFuture::T> {
constructor •() → void
: super core::Object::•() {}
constructor value(self::MyFuture::T x) → void
: super core::Object::•() {}
method noSuchMethod(dynamic invocation) → dynamic
return null;
- method then<S extends core::Object>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
+ 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;
abstract 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>;
abstract 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>;
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 bf89d40..0e4e4b9 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
@@ -3,14 +3,14 @@
import "dart:core" as core;
import "dart:async" as asy;
-class MyFuture<T extends core::Object> extends core::Object implements asy::Future<self::MyFuture::T> {
+class MyFuture<T extends core::Object = dynamic> extends core::Object implements asy::Future<self::MyFuture::T> {
constructor •() → void
;
constructor value(self::MyFuture::T x) → void
;
method noSuchMethod(dynamic invocation) → dynamic
;
- method then<S extends core::Object>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError}) → self::MyFuture<self::MyFuture::then::S>
+ 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>
;
abstract 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>;
abstract 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>;
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 13b1486..0d784ca 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
@@ -3,14 +3,14 @@
import "dart:core" as core;
import "dart:async" as asy;
-class MyFuture<T extends core::Object> extends core::Object implements asy::Future<self::MyFuture::T> {
+class MyFuture<T extends core::Object = dynamic> extends core::Object implements asy::Future<self::MyFuture::T> {
constructor •() → void
: super core::Object::•() {}
constructor value(self::MyFuture::T x) → void
: super core::Object::•() {}
method noSuchMethod(core::Invocation invocation) → dynamic
return null;
- method then<S extends core::Object>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
+ 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;
abstract 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>;
abstract 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>;
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 f272bfc..10610b3 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
@@ -3,14 +3,14 @@
import "dart:core" as core;
import "dart:async" as asy;
-class MyFuture<T extends core::Object> extends core::Object implements asy::Future<self::MyFuture::T> {
+class MyFuture<T extends core::Object = dynamic> extends core::Object implements asy::Future<self::MyFuture::T> {
constructor •() → void
: super core::Object::•() {}
constructor value(self::MyFuture::T x) → void
: super core::Object::•() {}
method noSuchMethod(core::Invocation invocation) → dynamic
return null;
- method then<S extends core::Object>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
+ 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;
abstract 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>;
abstract 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>;
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 477583e..215e634 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
@@ -3,14 +3,14 @@
import "dart:core" as core;
import "dart:async" as asy;
-class MyFuture<T extends core::Object> extends core::Object implements asy::Future<self::MyFuture::T> {
+class MyFuture<T extends core::Object = dynamic> extends core::Object implements asy::Future<self::MyFuture::T> {
constructor •() → void
: super core::Object::•() {}
constructor value(self::MyFuture::T x) → void
: super core::Object::•() {}
method noSuchMethod(dynamic invocation) → dynamic
return null;
- method then<S extends core::Object>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
+ 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;
abstract 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>;
abstract 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>;
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 4fc92fe..ef2e0fb 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
@@ -3,14 +3,14 @@
import "dart:core" as core;
import "dart:async" as asy;
-class MyFuture<T extends core::Object> extends core::Object implements asy::Future<self::MyFuture::T> {
+class MyFuture<T extends core::Object = dynamic> extends core::Object implements asy::Future<self::MyFuture::T> {
constructor •() → void
: super core::Object::•() {}
constructor value(self::MyFuture::T x) → void
: super core::Object::•() {}
method noSuchMethod(dynamic invocation) → dynamic
return null;
- method then<S extends core::Object>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
+ 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;
abstract 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>;
abstract 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>;
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 bf89d40..0e4e4b9 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
@@ -3,14 +3,14 @@
import "dart:core" as core;
import "dart:async" as asy;
-class MyFuture<T extends core::Object> extends core::Object implements asy::Future<self::MyFuture::T> {
+class MyFuture<T extends core::Object = dynamic> extends core::Object implements asy::Future<self::MyFuture::T> {
constructor •() → void
;
constructor value(self::MyFuture::T x) → void
;
method noSuchMethod(dynamic invocation) → dynamic
;
- method then<S extends core::Object>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError}) → self::MyFuture<self::MyFuture::then::S>
+ 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>
;
abstract 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>;
abstract 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>;
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 af297a2..d153459 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
@@ -3,14 +3,14 @@
import "dart:core" as core;
import "dart:async" as asy;
-class MyFuture<T extends core::Object> extends core::Object implements asy::Future<self::MyFuture::T> {
+class MyFuture<T extends core::Object = dynamic> extends core::Object implements asy::Future<self::MyFuture::T> {
constructor •() → void
: super core::Object::•() {}
constructor value(self::MyFuture::T x) → void
: super core::Object::•() {}
method noSuchMethod(core::Invocation invocation) → dynamic
return null;
- method then<S extends core::Object>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
+ 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;
abstract 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>;
abstract 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>;
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 f2c3a2a..b2e6ed0 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
@@ -3,14 +3,14 @@
import "dart:core" as core;
import "dart:async" as asy;
-class MyFuture<T extends core::Object> extends core::Object implements asy::Future<self::MyFuture::T> {
+class MyFuture<T extends core::Object = dynamic> extends core::Object implements asy::Future<self::MyFuture::T> {
constructor •() → void
: super core::Object::•() {}
constructor value(self::MyFuture::T x) → void
: super core::Object::•() {}
method noSuchMethod(core::Invocation invocation) → dynamic
return null;
- method then<S extends core::Object>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
+ 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;
abstract 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>;
abstract 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>;
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 73ac5c0..801d3e8 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
@@ -3,14 +3,14 @@
import "dart:core" as core;
import "dart:async" as asy;
-class MyFuture<T extends core::Object> extends core::Object implements asy::Future<self::MyFuture::T> {
+class MyFuture<T extends core::Object = dynamic> extends core::Object implements asy::Future<self::MyFuture::T> {
constructor •() → void
: super core::Object::•() {}
constructor value(self::MyFuture::T x) → void
: super core::Object::•() {}
method noSuchMethod(dynamic invocation) → dynamic
return null;
- method then<S extends core::Object>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
+ 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;
abstract 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>;
abstract 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>;
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 dc2f85e..5ceaae0 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
@@ -3,14 +3,14 @@
import "dart:core" as core;
import "dart:async" as asy;
-class MyFuture<T extends core::Object> extends core::Object implements asy::Future<self::MyFuture::T> {
+class MyFuture<T extends core::Object = dynamic> extends core::Object implements asy::Future<self::MyFuture::T> {
constructor •() → void
: super core::Object::•() {}
constructor value(self::MyFuture::T x) → void
: super core::Object::•() {}
method noSuchMethod(dynamic invocation) → dynamic
return null;
- method then<S extends core::Object>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
+ 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;
abstract 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>;
abstract 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>;
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 bf89d40..0e4e4b9 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
@@ -3,14 +3,14 @@
import "dart:core" as core;
import "dart:async" as asy;
-class MyFuture<T extends core::Object> extends core::Object implements asy::Future<self::MyFuture::T> {
+class MyFuture<T extends core::Object = dynamic> extends core::Object implements asy::Future<self::MyFuture::T> {
constructor •() → void
;
constructor value(self::MyFuture::T x) → void
;
method noSuchMethod(dynamic invocation) → dynamic
;
- method then<S extends core::Object>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError}) → self::MyFuture<self::MyFuture::then::S>
+ 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>
;
abstract 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>;
abstract 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>;
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 b3e8ccc..a6160a6 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
@@ -3,14 +3,14 @@
import "dart:core" as core;
import "dart:async" as asy;
-class MyFuture<T extends core::Object> extends core::Object implements asy::Future<self::MyFuture::T> {
+class MyFuture<T extends core::Object = dynamic> extends core::Object implements asy::Future<self::MyFuture::T> {
constructor •() → void
: super core::Object::•() {}
constructor value(self::MyFuture::T x) → void
: super core::Object::•() {}
method noSuchMethod(core::Invocation invocation) → dynamic
return null;
- method then<S extends core::Object>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
+ 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;
abstract 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>;
abstract 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>;
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 6c4ab09..1262645 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
@@ -3,14 +3,14 @@
import "dart:core" as core;
import "dart:async" as asy;
-class MyFuture<T extends core::Object> extends core::Object implements asy::Future<self::MyFuture::T> {
+class MyFuture<T extends core::Object = dynamic> extends core::Object implements asy::Future<self::MyFuture::T> {
constructor •() → void
: super core::Object::•() {}
constructor value(self::MyFuture::T x) → void
: super core::Object::•() {}
method noSuchMethod(core::Invocation invocation) → dynamic
return null;
- method then<S extends core::Object>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
+ 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;
abstract 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>;
abstract 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>;
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 32dbcf8..94ca72c 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
@@ -3,14 +3,14 @@
import "dart:core" as core;
import "dart:async" as asy;
-class MyFuture<T extends core::Object> extends core::Object implements asy::Future<self::MyFuture::T> {
+class MyFuture<T extends core::Object = dynamic> extends core::Object implements asy::Future<self::MyFuture::T> {
constructor •() → void
: super core::Object::•() {}
constructor value(self::MyFuture::T x) → void
: super core::Object::•() {}
method noSuchMethod(dynamic invocation) → dynamic
return null;
- method then<S extends core::Object>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
+ 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;
abstract 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>;
abstract 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>;
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 d7bf2f2..a20328a 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
@@ -3,14 +3,14 @@
import "dart:core" as core;
import "dart:async" as asy;
-class MyFuture<T extends core::Object> extends core::Object implements asy::Future<self::MyFuture::T> {
+class MyFuture<T extends core::Object = dynamic> extends core::Object implements asy::Future<self::MyFuture::T> {
constructor •() → void
: super core::Object::•() {}
constructor value(self::MyFuture::T x) → void
: super core::Object::•() {}
method noSuchMethod(dynamic invocation) → dynamic
return null;
- method then<S extends core::Object>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
+ 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;
abstract 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>;
abstract 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>;
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 bf89d40..0e4e4b9 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
@@ -3,14 +3,14 @@
import "dart:core" as core;
import "dart:async" as asy;
-class MyFuture<T extends core::Object> extends core::Object implements asy::Future<self::MyFuture::T> {
+class MyFuture<T extends core::Object = dynamic> extends core::Object implements asy::Future<self::MyFuture::T> {
constructor •() → void
;
constructor value(self::MyFuture::T x) → void
;
method noSuchMethod(dynamic invocation) → dynamic
;
- method then<S extends core::Object>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError}) → self::MyFuture<self::MyFuture::then::S>
+ 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>
;
abstract 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>;
abstract 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>;
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 8425b11..0fe0dcd 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
@@ -3,14 +3,14 @@
import "dart:core" as core;
import "dart:async" as asy;
-class MyFuture<T extends core::Object> extends core::Object implements asy::Future<self::MyFuture::T> {
+class MyFuture<T extends core::Object = dynamic> extends core::Object implements asy::Future<self::MyFuture::T> {
constructor •() → void
: super core::Object::•() {}
constructor value(self::MyFuture::T x) → void
: super core::Object::•() {}
method noSuchMethod(core::Invocation invocation) → dynamic
return null;
- method then<S extends core::Object>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
+ 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;
abstract 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>;
abstract 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>;
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 f1cb720..de8bd3e 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
@@ -3,14 +3,14 @@
import "dart:core" as core;
import "dart:async" as asy;
-class MyFuture<T extends core::Object> extends core::Object implements asy::Future<self::MyFuture::T> {
+class MyFuture<T extends core::Object = dynamic> extends core::Object implements asy::Future<self::MyFuture::T> {
constructor •() → void
: super core::Object::•() {}
constructor value(self::MyFuture::T x) → void
: super core::Object::•() {}
method noSuchMethod(core::Invocation invocation) → dynamic
return null;
- method then<S extends core::Object>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
+ 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;
abstract 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>;
abstract 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>;
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 2fb57b2..57291da 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
@@ -3,14 +3,14 @@
import "dart:core" as core;
import "dart:async" as asy;
-class MyFuture<T extends core::Object> extends core::Object implements asy::Future<self::MyFuture::T> {
+class MyFuture<T extends core::Object = dynamic> extends core::Object implements asy::Future<self::MyFuture::T> {
constructor •() → void
: super core::Object::•() {}
constructor value(self::MyFuture::T x) → void
: super core::Object::•() {}
method noSuchMethod(dynamic invocation) → dynamic
return null;
- method then<S extends core::Object>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
+ 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;
abstract 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>;
abstract 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>;
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 93c7048..77de0e0 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
@@ -3,14 +3,14 @@
import "dart:core" as core;
import "dart:async" as asy;
-class MyFuture<T extends core::Object> extends core::Object implements asy::Future<self::MyFuture::T> {
+class MyFuture<T extends core::Object = dynamic> extends core::Object implements asy::Future<self::MyFuture::T> {
constructor •() → void
: super core::Object::•() {}
constructor value(self::MyFuture::T x) → void
: super core::Object::•() {}
method noSuchMethod(dynamic invocation) → dynamic
return null;
- method then<S extends core::Object>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
+ 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;
abstract 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>;
abstract 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>;
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 bf89d40..0e4e4b9 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
@@ -3,14 +3,14 @@
import "dart:core" as core;
import "dart:async" as asy;
-class MyFuture<T extends core::Object> extends core::Object implements asy::Future<self::MyFuture::T> {
+class MyFuture<T extends core::Object = dynamic> extends core::Object implements asy::Future<self::MyFuture::T> {
constructor •() → void
;
constructor value(self::MyFuture::T x) → void
;
method noSuchMethod(dynamic invocation) → dynamic
;
- method then<S extends core::Object>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError}) → self::MyFuture<self::MyFuture::then::S>
+ 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>
;
abstract 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>;
abstract 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>;
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 47e72b3..55f02eb 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
@@ -3,14 +3,14 @@
import "dart:core" as core;
import "dart:async" as asy;
-class MyFuture<T extends core::Object> extends core::Object implements asy::Future<self::MyFuture::T> {
+class MyFuture<T extends core::Object = dynamic> extends core::Object implements asy::Future<self::MyFuture::T> {
constructor •() → void
: super core::Object::•() {}
constructor value(self::MyFuture::T x) → void
: super core::Object::•() {}
method noSuchMethod(core::Invocation invocation) → dynamic
return null;
- method then<S extends core::Object>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
+ 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;
abstract 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>;
abstract 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>;
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 48d5198..1dd34b9 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
@@ -3,14 +3,14 @@
import "dart:core" as core;
import "dart:async" as asy;
-class MyFuture<T extends core::Object> extends core::Object implements asy::Future<self::MyFuture::T> {
+class MyFuture<T extends core::Object = dynamic> extends core::Object implements asy::Future<self::MyFuture::T> {
constructor •() → void
: super core::Object::•() {}
constructor value(self::MyFuture::T x) → void
: super core::Object::•() {}
method noSuchMethod(core::Invocation invocation) → dynamic
return null;
- method then<S extends core::Object>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
+ 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;
abstract 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>;
abstract 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>;
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 3f7d35c..2665c52 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
@@ -3,14 +3,14 @@
import "dart:core" as core;
import "dart:async" as asy;
-class MyFuture<T extends core::Object> extends core::Object implements asy::Future<self::MyFuture::T> {
+class MyFuture<T extends core::Object = dynamic> extends core::Object implements asy::Future<self::MyFuture::T> {
constructor •() → void
: super core::Object::•() {}
constructor value(self::MyFuture::T x) → void
: super core::Object::•() {}
method noSuchMethod(dynamic invocation) → dynamic
return null;
- method then<S extends core::Object>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
+ 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;
abstract 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>;
abstract 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>;
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 f0608c1..cb0d0d1 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
@@ -3,14 +3,14 @@
import "dart:core" as core;
import "dart:async" as asy;
-class MyFuture<T extends core::Object> extends core::Object implements asy::Future<self::MyFuture::T> {
+class MyFuture<T extends core::Object = dynamic> extends core::Object implements asy::Future<self::MyFuture::T> {
constructor •() → void
: super core::Object::•() {}
constructor value(self::MyFuture::T x) → void
: super core::Object::•() {}
method noSuchMethod(dynamic invocation) → dynamic
return null;
- method then<S extends core::Object>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
+ 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;
abstract 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>;
abstract 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>;
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 bf89d40..0e4e4b9 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
@@ -3,14 +3,14 @@
import "dart:core" as core;
import "dart:async" as asy;
-class MyFuture<T extends core::Object> extends core::Object implements asy::Future<self::MyFuture::T> {
+class MyFuture<T extends core::Object = dynamic> extends core::Object implements asy::Future<self::MyFuture::T> {
constructor •() → void
;
constructor value(self::MyFuture::T x) → void
;
method noSuchMethod(dynamic invocation) → dynamic
;
- method then<S extends core::Object>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError}) → self::MyFuture<self::MyFuture::then::S>
+ 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>
;
abstract 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>;
abstract 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>;
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 0b16167..5bef4dd 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
@@ -3,14 +3,14 @@
import "dart:core" as core;
import "dart:async" as asy;
-class MyFuture<T extends core::Object> extends core::Object implements asy::Future<self::MyFuture::T> {
+class MyFuture<T extends core::Object = dynamic> extends core::Object implements asy::Future<self::MyFuture::T> {
constructor •() → void
: super core::Object::•() {}
constructor value(self::MyFuture::T x) → void
: super core::Object::•() {}
method noSuchMethod(core::Invocation invocation) → dynamic
return null;
- method then<S extends core::Object>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
+ 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;
abstract 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>;
abstract 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>;
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 186d1fe..a07f3c4 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
@@ -3,14 +3,14 @@
import "dart:core" as core;
import "dart:async" as asy;
-class MyFuture<T extends core::Object> extends core::Object implements asy::Future<self::MyFuture::T> {
+class MyFuture<T extends core::Object = dynamic> extends core::Object implements asy::Future<self::MyFuture::T> {
constructor •() → void
: super core::Object::•() {}
constructor value(self::MyFuture::T x) → void
: super core::Object::•() {}
method noSuchMethod(core::Invocation invocation) → dynamic
return null;
- method then<S extends core::Object>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
+ 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;
abstract 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>;
abstract 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>;
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 ad86cf9..4f7b85b 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
@@ -3,14 +3,14 @@
import "dart:core" as core;
import "dart:async" as asy;
-class MyFuture<T extends core::Object> extends core::Object implements asy::Future<self::MyFuture::T> {
+class MyFuture<T extends core::Object = dynamic> extends core::Object implements asy::Future<self::MyFuture::T> {
constructor •() → void
: super core::Object::•() {}
constructor value(self::MyFuture::T x) → void
: super core::Object::•() {}
method noSuchMethod(dynamic invocation) → dynamic
return null;
- method then<S extends core::Object>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
+ 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;
abstract 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>;
abstract 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>;
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 ad86cf9..4f7b85b 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
@@ -3,14 +3,14 @@
import "dart:core" as core;
import "dart:async" as asy;
-class MyFuture<T extends core::Object> extends core::Object implements asy::Future<self::MyFuture::T> {
+class MyFuture<T extends core::Object = dynamic> extends core::Object implements asy::Future<self::MyFuture::T> {
constructor •() → void
: super core::Object::•() {}
constructor value(self::MyFuture::T x) → void
: super core::Object::•() {}
method noSuchMethod(dynamic invocation) → dynamic
return null;
- method then<S extends core::Object>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
+ 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;
abstract 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>;
abstract 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>;
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 dd8d84a..b0ad581 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
@@ -3,14 +3,14 @@
import "dart:core" as core;
import "dart:async" as asy;
-class MyFuture<T extends core::Object> extends core::Object implements asy::Future<self::MyFuture::T> {
+class MyFuture<T extends core::Object = dynamic> extends core::Object implements asy::Future<self::MyFuture::T> {
constructor •() → void
;
constructor value(self::MyFuture::T x) → void
;
method noSuchMethod(dynamic invocation) → dynamic
;
- method then<S extends core::Object>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError}) → self::MyFuture<self::MyFuture::then::S>
+ 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>
;
abstract 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>;
abstract 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>;
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 e70813f..b8334ef 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
@@ -3,14 +3,14 @@
import "dart:core" as core;
import "dart:async" as asy;
-class MyFuture<T extends core::Object> extends core::Object implements asy::Future<self::MyFuture::T> {
+class MyFuture<T extends core::Object = dynamic> extends core::Object implements asy::Future<self::MyFuture::T> {
constructor •() → void
: super core::Object::•() {}
constructor value(self::MyFuture::T x) → void
: super core::Object::•() {}
method noSuchMethod(core::Invocation invocation) → dynamic
return null;
- method then<S extends core::Object>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
+ 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;
abstract 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>;
abstract 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>;
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 5f33f15..ae2f1fe 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
@@ -3,14 +3,14 @@
import "dart:core" as core;
import "dart:async" as asy;
-class MyFuture<T extends core::Object> extends core::Object implements asy::Future<self::MyFuture::T> {
+class MyFuture<T extends core::Object = dynamic> extends core::Object implements asy::Future<self::MyFuture::T> {
constructor •() → void
: super core::Object::•() {}
constructor value(self::MyFuture::T x) → void
: super core::Object::•() {}
method noSuchMethod(core::Invocation invocation) → dynamic
return null;
- method then<S extends core::Object>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
+ 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;
abstract 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>;
abstract 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>;
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 a47a67c..8e506d2 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
@@ -3,14 +3,14 @@
import "dart:core" as core;
import "dart:async" as asy;
-class MyFuture<T extends core::Object> extends core::Object implements asy::Future<self::MyFuture::T> {
+class MyFuture<T extends core::Object = dynamic> extends core::Object implements asy::Future<self::MyFuture::T> {
constructor •() → void
: super core::Object::•() {}
constructor value(self::MyFuture::T x) → void
: super core::Object::•() {}
method noSuchMethod(dynamic invocation) → dynamic
return null;
- method then<S extends core::Object>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
+ 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;
abstract 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>;
abstract 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>;
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 a47a67c..8e506d2 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
@@ -3,14 +3,14 @@
import "dart:core" as core;
import "dart:async" as asy;
-class MyFuture<T extends core::Object> extends core::Object implements asy::Future<self::MyFuture::T> {
+class MyFuture<T extends core::Object = dynamic> extends core::Object implements asy::Future<self::MyFuture::T> {
constructor •() → void
: super core::Object::•() {}
constructor value(self::MyFuture::T x) → void
: super core::Object::•() {}
method noSuchMethod(dynamic invocation) → dynamic
return null;
- method then<S extends core::Object>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
+ 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;
abstract 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>;
abstract 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>;
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 dd8d84a..b0ad581 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
@@ -3,14 +3,14 @@
import "dart:core" as core;
import "dart:async" as asy;
-class MyFuture<T extends core::Object> extends core::Object implements asy::Future<self::MyFuture::T> {
+class MyFuture<T extends core::Object = dynamic> extends core::Object implements asy::Future<self::MyFuture::T> {
constructor •() → void
;
constructor value(self::MyFuture::T x) → void
;
method noSuchMethod(dynamic invocation) → dynamic
;
- method then<S extends core::Object>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError}) → self::MyFuture<self::MyFuture::then::S>
+ 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>
;
abstract 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>;
abstract 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>;
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 7a3e3e5..3557d61 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
@@ -3,14 +3,14 @@
import "dart:core" as core;
import "dart:async" as asy;
-class MyFuture<T extends core::Object> extends core::Object implements asy::Future<self::MyFuture::T> {
+class MyFuture<T extends core::Object = dynamic> extends core::Object implements asy::Future<self::MyFuture::T> {
constructor •() → void
: super core::Object::•() {}
constructor value(self::MyFuture::T x) → void
: super core::Object::•() {}
method noSuchMethod(core::Invocation invocation) → dynamic
return null;
- method then<S extends core::Object>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
+ 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;
abstract 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>;
abstract 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>;
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 c45f7a3..13d7235 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
@@ -3,14 +3,14 @@
import "dart:core" as core;
import "dart:async" as asy;
-class MyFuture<T extends core::Object> extends core::Object implements asy::Future<self::MyFuture::T> {
+class MyFuture<T extends core::Object = dynamic> extends core::Object implements asy::Future<self::MyFuture::T> {
constructor •() → void
: super core::Object::•() {}
constructor value(self::MyFuture::T x) → void
: super core::Object::•() {}
method noSuchMethod(core::Invocation invocation) → dynamic
return null;
- method then<S extends core::Object>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
+ 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;
abstract 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>;
abstract 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>;
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 e107ab2..78825bf 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
@@ -3,14 +3,14 @@
import "dart:core" as core;
import "dart:async" as asy;
-class MyFuture<T extends core::Object> extends core::Object implements asy::Future<self::MyFuture::T> {
+class MyFuture<T extends core::Object = dynamic> extends core::Object implements asy::Future<self::MyFuture::T> {
constructor •() → void
: super core::Object::•() {}
constructor value(self::MyFuture::T x) → void
: super core::Object::•() {}
method noSuchMethod(dynamic invocation) → dynamic
return null;
- method then<S extends core::Object>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
+ 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;
abstract 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>;
abstract 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>;
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 e107ab2..78825bf 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
@@ -3,14 +3,14 @@
import "dart:core" as core;
import "dart:async" as asy;
-class MyFuture<T extends core::Object> extends core::Object implements asy::Future<self::MyFuture::T> {
+class MyFuture<T extends core::Object = dynamic> extends core::Object implements asy::Future<self::MyFuture::T> {
constructor •() → void
: super core::Object::•() {}
constructor value(self::MyFuture::T x) → void
: super core::Object::•() {}
method noSuchMethod(dynamic invocation) → dynamic
return null;
- method then<S extends core::Object>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
+ 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;
abstract 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>;
abstract 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>;
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 f9939e0..f7f3336 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
@@ -3,14 +3,14 @@
import "dart:core" as core;
import "dart:async" as asy;
-class MyFuture<T extends core::Object> extends core::Object implements asy::Future<self::MyFuture::T> {
+class MyFuture<T extends core::Object = dynamic> extends core::Object implements asy::Future<self::MyFuture::T> {
constructor •() → void
;
constructor value(self::MyFuture::T x) → void
;
method noSuchMethod(dynamic invocation) → dynamic
;
- method then<S extends core::Object>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError}) → self::MyFuture<self::MyFuture::then::S>
+ 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>
;
abstract 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>;
abstract 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>;
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 d0de61c..ef64c92 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
@@ -3,14 +3,14 @@
import "dart:core" as core;
import "dart:async" as asy;
-class MyFuture<T extends core::Object> extends core::Object implements asy::Future<self::MyFuture::T> {
+class MyFuture<T extends core::Object = dynamic> extends core::Object implements asy::Future<self::MyFuture::T> {
constructor •() → void
: super core::Object::•() {}
constructor value(self::MyFuture::T x) → void
: super core::Object::•() {}
method noSuchMethod(core::Invocation invocation) → dynamic
return null;
- method then<S extends core::Object>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
+ 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;
abstract 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>;
abstract 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>;
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 7784c77..163b552 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
@@ -3,14 +3,14 @@
import "dart:core" as core;
import "dart:async" as asy;
-class MyFuture<T extends core::Object> extends core::Object implements asy::Future<self::MyFuture::T> {
+class MyFuture<T extends core::Object = dynamic> extends core::Object implements asy::Future<self::MyFuture::T> {
constructor •() → void
: super core::Object::•() {}
constructor value(self::MyFuture::T x) → void
: super core::Object::•() {}
method noSuchMethod(core::Invocation invocation) → dynamic
return null;
- method then<S extends core::Object>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
+ 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;
abstract 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>;
abstract 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>;
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 2f01968..cf63b53 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
@@ -3,14 +3,14 @@
import "dart:core" as core;
import "dart:async" as asy;
-class MyFuture<T extends core::Object> extends core::Object implements asy::Future<self::MyFuture::T> {
+class MyFuture<T extends core::Object = dynamic> extends core::Object implements asy::Future<self::MyFuture::T> {
constructor •() → void
: super core::Object::•() {}
constructor value(dynamic x) → void
: super core::Object::•() {}
method noSuchMethod(dynamic invocation) → dynamic
return null;
- method then<S extends core::Object>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
+ 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;
abstract 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>;
abstract 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>;
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 5fc5f19..b058d42 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
@@ -3,14 +3,14 @@
import "dart:core" as core;
import "dart:async" as asy;
-class MyFuture<T extends core::Object> extends core::Object implements asy::Future<self::MyFuture::T> {
+class MyFuture<T extends core::Object = dynamic> extends core::Object implements asy::Future<self::MyFuture::T> {
constructor •() → void
: super core::Object::•() {}
constructor value(dynamic x) → void
: super core::Object::•() {}
method noSuchMethod(dynamic invocation) → dynamic
return null;
- method then<S extends core::Object>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
+ 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;
abstract 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>;
abstract 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>;
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 353c1be..cb95b45 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
@@ -3,14 +3,14 @@
import "dart:core" as core;
import "dart:async" as asy;
-class MyFuture<T extends core::Object> extends core::Object implements asy::Future<self::MyFuture::T> {
+class MyFuture<T extends core::Object = dynamic> extends core::Object implements asy::Future<self::MyFuture::T> {
constructor •() → void
;
constructor value(dynamic x) → void
;
method noSuchMethod(dynamic invocation) → dynamic
;
- method then<S extends core::Object>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError}) → self::MyFuture<self::MyFuture::then::S>
+ 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>
;
abstract 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>;
abstract 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>;
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 722f2d6..fc102e4 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
@@ -3,14 +3,14 @@
import "dart:core" as core;
import "dart:async" as asy;
-class MyFuture<T extends core::Object> extends core::Object implements asy::Future<self::MyFuture::T> {
+class MyFuture<T extends core::Object = dynamic> extends core::Object implements asy::Future<self::MyFuture::T> {
constructor •() → void
: super core::Object::•() {}
constructor value(dynamic x) → void
: super core::Object::•() {}
method noSuchMethod(core::Invocation invocation) → dynamic
return null;
- method then<S extends core::Object>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
+ 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;
abstract 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>;
abstract 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>;
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 260e803..6385881 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
@@ -3,14 +3,14 @@
import "dart:core" as core;
import "dart:async" as asy;
-class MyFuture<T extends core::Object> extends core::Object implements asy::Future<self::MyFuture::T> {
+class MyFuture<T extends core::Object = dynamic> extends core::Object implements asy::Future<self::MyFuture::T> {
constructor •() → void
: super core::Object::•() {}
constructor value(dynamic x) → void
: super core::Object::•() {}
method noSuchMethod(core::Invocation invocation) → dynamic
return null;
- method then<S extends core::Object>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
+ 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;
abstract 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>;
abstract 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>;
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 e4c0c12..d08eb4f 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
@@ -3,14 +3,14 @@
import "dart:core" as core;
import "dart:async" as asy;
-class MyFuture<T extends core::Object> extends core::Object implements asy::Future<self::MyFuture::T> {
+class MyFuture<T extends core::Object = dynamic> extends core::Object implements asy::Future<self::MyFuture::T> {
constructor •() → void
: super core::Object::•() {}
constructor value(dynamic x) → void
: super core::Object::•() {}
method noSuchMethod(dynamic invocation) → dynamic
return null;
- method then<S extends core::Object>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
+ 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;
abstract 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>;
abstract 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>;
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 3010ada..fa93ea9 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
@@ -3,14 +3,14 @@
import "dart:core" as core;
import "dart:async" as asy;
-class MyFuture<T extends core::Object> extends core::Object implements asy::Future<self::MyFuture::T> {
+class MyFuture<T extends core::Object = dynamic> extends core::Object implements asy::Future<self::MyFuture::T> {
constructor •() → void
: super core::Object::•() {}
constructor value(dynamic x) → void
: super core::Object::•() {}
method noSuchMethod(dynamic invocation) → dynamic
return null;
- method then<S extends core::Object>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
+ 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;
abstract 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>;
abstract 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>;
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 353c1be..cb95b45 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
@@ -3,14 +3,14 @@
import "dart:core" as core;
import "dart:async" as asy;
-class MyFuture<T extends core::Object> extends core::Object implements asy::Future<self::MyFuture::T> {
+class MyFuture<T extends core::Object = dynamic> extends core::Object implements asy::Future<self::MyFuture::T> {
constructor •() → void
;
constructor value(dynamic x) → void
;
method noSuchMethod(dynamic invocation) → dynamic
;
- method then<S extends core::Object>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError}) → self::MyFuture<self::MyFuture::then::S>
+ 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>
;
abstract 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>;
abstract 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>;
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 c539bcd..b2ae474 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
@@ -3,14 +3,14 @@
import "dart:core" as core;
import "dart:async" as asy;
-class MyFuture<T extends core::Object> extends core::Object implements asy::Future<self::MyFuture::T> {
+class MyFuture<T extends core::Object = dynamic> extends core::Object implements asy::Future<self::MyFuture::T> {
constructor •() → void
: super core::Object::•() {}
constructor value(dynamic x) → void
: super core::Object::•() {}
method noSuchMethod(core::Invocation invocation) → dynamic
return null;
- method then<S extends core::Object>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
+ 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;
abstract 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>;
abstract 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>;
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 ee81fa3..ad3c572 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
@@ -3,14 +3,14 @@
import "dart:core" as core;
import "dart:async" as asy;
-class MyFuture<T extends core::Object> extends core::Object implements asy::Future<self::MyFuture::T> {
+class MyFuture<T extends core::Object = dynamic> extends core::Object implements asy::Future<self::MyFuture::T> {
constructor •() → void
: super core::Object::•() {}
constructor value(dynamic x) → void
: super core::Object::•() {}
method noSuchMethod(core::Invocation invocation) → dynamic
return null;
- method then<S extends core::Object>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
+ 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;
abstract 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>;
abstract 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>;
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 2bdcc03..31c6b7a 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
@@ -3,14 +3,14 @@
import "dart:core" as core;
import "dart:async" as asy;
-class MyFuture<T extends core::Object> extends core::Object implements asy::Future<self::MyFuture::T> {
+class MyFuture<T extends core::Object = dynamic> extends core::Object implements asy::Future<self::MyFuture::T> {
constructor •() → void
: super core::Object::•() {}
constructor value([dynamic x = null]) → void
: super core::Object::•() {}
method noSuchMethod(dynamic invocation) → dynamic
return null;
- method then<S extends core::Object>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
+ 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;
abstract 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>;
abstract 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>;
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 5db5ef3..167fe79 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
@@ -3,14 +3,14 @@
import "dart:core" as core;
import "dart:async" as asy;
-class MyFuture<T extends core::Object> extends core::Object implements asy::Future<self::MyFuture::T> {
+class MyFuture<T extends core::Object = dynamic> extends core::Object implements asy::Future<self::MyFuture::T> {
constructor •() → void
: super core::Object::•() {}
constructor value([dynamic x = null]) → void
: super core::Object::•() {}
method noSuchMethod(dynamic invocation) → dynamic
return null;
- method then<S extends core::Object>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
+ 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;
abstract 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>;
abstract 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>;
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 203722c..2bad4e8 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
@@ -3,14 +3,14 @@
import "dart:core" as core;
import "dart:async" as asy;
-class MyFuture<T extends core::Object> extends core::Object implements asy::Future<self::MyFuture::T> {
+class MyFuture<T extends core::Object = dynamic> extends core::Object implements asy::Future<self::MyFuture::T> {
constructor •() → void
;
constructor value([dynamic x]) → void
;
method noSuchMethod(dynamic invocation) → dynamic
;
- method then<S extends core::Object>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError}) → self::MyFuture<self::MyFuture::then::S>
+ 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>
;
abstract 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>;
abstract 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>;
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 c6c4632..07071bc 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
@@ -3,14 +3,14 @@
import "dart:core" as core;
import "dart:async" as asy;
-class MyFuture<T extends core::Object> extends core::Object implements asy::Future<self::MyFuture::T> {
+class MyFuture<T extends core::Object = dynamic> extends core::Object implements asy::Future<self::MyFuture::T> {
constructor •() → void
: super core::Object::•() {}
constructor value([dynamic x = null]) → void
: super core::Object::•() {}
method noSuchMethod(core::Invocation invocation) → dynamic
return null;
- method then<S extends core::Object>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
+ 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;
abstract 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>;
abstract 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>;
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 e8e745e..2086318 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
@@ -3,14 +3,14 @@
import "dart:core" as core;
import "dart:async" as asy;
-class MyFuture<T extends core::Object> extends core::Object implements asy::Future<self::MyFuture::T> {
+class MyFuture<T extends core::Object = dynamic> extends core::Object implements asy::Future<self::MyFuture::T> {
constructor •() → void
: super core::Object::•() {}
constructor value([dynamic x = null]) → void
: super core::Object::•() {}
method noSuchMethod(core::Invocation invocation) → dynamic
return null;
- method then<S extends core::Object>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
+ 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;
abstract 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>;
abstract 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>;
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 c76f12a..e8e6411 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
@@ -3,14 +3,14 @@
import "dart:core" as core;
import "dart:async" as asy;
-class MyFuture<T extends core::Object> extends core::Object implements asy::Future<self::MyFuture::T> {
+class MyFuture<T extends core::Object = dynamic> extends core::Object implements asy::Future<self::MyFuture::T> {
constructor •() → void
: super core::Object::•() {}
constructor value([dynamic x = null]) → void
: super core::Object::•() {}
method noSuchMethod(dynamic invocation) → dynamic
return null;
- method then<S extends core::Object>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
+ 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;
abstract 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>;
abstract 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>;
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 87b4be0eb..24fedaa 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
@@ -3,14 +3,14 @@
import "dart:core" as core;
import "dart:async" as asy;
-class MyFuture<T extends core::Object> extends core::Object implements asy::Future<self::MyFuture::T> {
+class MyFuture<T extends core::Object = dynamic> extends core::Object implements asy::Future<self::MyFuture::T> {
constructor •() → void
: super core::Object::•() {}
constructor value([dynamic x = null]) → void
: super core::Object::•() {}
method noSuchMethod(dynamic invocation) → dynamic
return null;
- method then<S extends core::Object>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
+ 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;
abstract 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>;
abstract 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>;
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 203722c..2bad4e8 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
@@ -3,14 +3,14 @@
import "dart:core" as core;
import "dart:async" as asy;
-class MyFuture<T extends core::Object> extends core::Object implements asy::Future<self::MyFuture::T> {
+class MyFuture<T extends core::Object = dynamic> extends core::Object implements asy::Future<self::MyFuture::T> {
constructor •() → void
;
constructor value([dynamic x]) → void
;
method noSuchMethod(dynamic invocation) → dynamic
;
- method then<S extends core::Object>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError}) → self::MyFuture<self::MyFuture::then::S>
+ 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>
;
abstract 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>;
abstract 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>;
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 5c9ecaf..83706a9 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
@@ -3,14 +3,14 @@
import "dart:core" as core;
import "dart:async" as asy;
-class MyFuture<T extends core::Object> extends core::Object implements asy::Future<self::MyFuture::T> {
+class MyFuture<T extends core::Object = dynamic> extends core::Object implements asy::Future<self::MyFuture::T> {
constructor •() → void
: super core::Object::•() {}
constructor value([dynamic x = null]) → void
: super core::Object::•() {}
method noSuchMethod(core::Invocation invocation) → dynamic
return null;
- method then<S extends core::Object>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
+ 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;
abstract 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>;
abstract 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>;
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 7eae3ec..6134e15 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
@@ -3,14 +3,14 @@
import "dart:core" as core;
import "dart:async" as asy;
-class MyFuture<T extends core::Object> extends core::Object implements asy::Future<self::MyFuture::T> {
+class MyFuture<T extends core::Object = dynamic> extends core::Object implements asy::Future<self::MyFuture::T> {
constructor •() → void
: super core::Object::•() {}
constructor value([dynamic x = null]) → void
: super core::Object::•() {}
method noSuchMethod(core::Invocation invocation) → dynamic
return null;
- method then<S extends core::Object>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
+ 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;
abstract 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>;
abstract 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>;
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 7e03996..9027e83 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
@@ -3,14 +3,14 @@
import "dart:core" as core;
import "dart:async" as asy;
-class MyFuture<T extends core::Object> extends core::Object implements asy::Future<self::MyFuture::T> {
+class MyFuture<T extends core::Object = dynamic> extends core::Object implements asy::Future<self::MyFuture::T> {
constructor •() → void
: super core::Object::•() {}
constructor value([dynamic x = null]) → void
: super core::Object::•() {}
method noSuchMethod(dynamic invocation) → dynamic
return null;
- method then<S extends core::Object>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
+ 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;
abstract 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>;
abstract 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>;
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 665f3ee..aacc250 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
@@ -3,14 +3,14 @@
import "dart:core" as core;
import "dart:async" as asy;
-class MyFuture<T extends core::Object> extends core::Object implements asy::Future<self::MyFuture::T> {
+class MyFuture<T extends core::Object = dynamic> extends core::Object implements asy::Future<self::MyFuture::T> {
constructor •() → void
: super core::Object::•() {}
constructor value([dynamic x = null]) → void
: super core::Object::•() {}
method noSuchMethod(dynamic invocation) → dynamic
return null;
- method then<S extends core::Object>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
+ 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;
abstract 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>;
abstract 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>;
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 64f58e3..4e0c84c 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
@@ -3,14 +3,14 @@
import "dart:core" as core;
import "dart:async" as asy;
-class MyFuture<T extends core::Object> extends core::Object implements asy::Future<self::MyFuture::T> {
+class MyFuture<T extends core::Object = dynamic> extends core::Object implements asy::Future<self::MyFuture::T> {
constructor •() → void
;
constructor value([dynamic x]) → void
;
method noSuchMethod(dynamic invocation) → dynamic
;
- method then<S extends core::Object>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError}) → self::MyFuture<self::MyFuture::then::S>
+ 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>
;
abstract 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>;
abstract 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>;
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 a78fef7..ed51407 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
@@ -3,14 +3,14 @@
import "dart:core" as core;
import "dart:async" as asy;
-class MyFuture<T extends core::Object> extends core::Object implements asy::Future<self::MyFuture::T> {
+class MyFuture<T extends core::Object = dynamic> extends core::Object implements asy::Future<self::MyFuture::T> {
constructor •() → void
: super core::Object::•() {}
constructor value([dynamic x = null]) → void
: super core::Object::•() {}
method noSuchMethod(core::Invocation invocation) → dynamic
return null;
- method then<S extends core::Object>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
+ 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;
abstract 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>;
abstract 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>;
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 ff49091..4dbee3a 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
@@ -3,14 +3,14 @@
import "dart:core" as core;
import "dart:async" as asy;
-class MyFuture<T extends core::Object> extends core::Object implements asy::Future<self::MyFuture::T> {
+class MyFuture<T extends core::Object = dynamic> extends core::Object implements asy::Future<self::MyFuture::T> {
constructor •() → void
: super core::Object::•() {}
constructor value([dynamic x = null]) → void
: super core::Object::•() {}
method noSuchMethod(core::Invocation invocation) → dynamic
return null;
- method then<S extends core::Object>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
+ 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;
abstract 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>;
abstract 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>;
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 a80ae91..4873748 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
@@ -3,14 +3,14 @@
import "dart:core" as core;
import "dart:async" as asy;
-class MyFuture<T extends core::Object> extends core::Object implements asy::Future<self::MyFuture::T> {
+class MyFuture<T extends core::Object = dynamic> extends core::Object implements asy::Future<self::MyFuture::T> {
constructor •() → void
: super core::Object::•() {}
constructor value([dynamic x = null]) → void
: super core::Object::•() {}
method noSuchMethod(dynamic invocation) → dynamic
return null;
- method then<S extends core::Object>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
+ 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;
abstract 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>;
abstract 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>;
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 b952431..87239a3 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
@@ -3,14 +3,14 @@
import "dart:core" as core;
import "dart:async" as asy;
-class MyFuture<T extends core::Object> extends core::Object implements asy::Future<self::MyFuture::T> {
+class MyFuture<T extends core::Object = dynamic> extends core::Object implements asy::Future<self::MyFuture::T> {
constructor •() → void
: super core::Object::•() {}
constructor value([dynamic x = null]) → void
: super core::Object::•() {}
method noSuchMethod(dynamic invocation) → dynamic
return null;
- method then<S extends core::Object>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
+ 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;
abstract 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>;
abstract 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>;
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 64f58e3..4e0c84c 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
@@ -3,14 +3,14 @@
import "dart:core" as core;
import "dart:async" as asy;
-class MyFuture<T extends core::Object> extends core::Object implements asy::Future<self::MyFuture::T> {
+class MyFuture<T extends core::Object = dynamic> extends core::Object implements asy::Future<self::MyFuture::T> {
constructor •() → void
;
constructor value([dynamic x]) → void
;
method noSuchMethod(dynamic invocation) → dynamic
;
- method then<S extends core::Object>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError}) → self::MyFuture<self::MyFuture::then::S>
+ 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>
;
abstract 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>;
abstract 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>;
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 d62bc1b..65901ec 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
@@ -3,14 +3,14 @@
import "dart:core" as core;
import "dart:async" as asy;
-class MyFuture<T extends core::Object> extends core::Object implements asy::Future<self::MyFuture::T> {
+class MyFuture<T extends core::Object = dynamic> extends core::Object implements asy::Future<self::MyFuture::T> {
constructor •() → void
: super core::Object::•() {}
constructor value([dynamic x = null]) → void
: super core::Object::•() {}
method noSuchMethod(core::Invocation invocation) → dynamic
return null;
- method then<S extends core::Object>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
+ 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;
abstract 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>;
abstract 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>;
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 f3bd417..af8f590 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
@@ -3,14 +3,14 @@
import "dart:core" as core;
import "dart:async" as asy;
-class MyFuture<T extends core::Object> extends core::Object implements asy::Future<self::MyFuture::T> {
+class MyFuture<T extends core::Object = dynamic> extends core::Object implements asy::Future<self::MyFuture::T> {
constructor •() → void
: super core::Object::•() {}
constructor value([dynamic x = null]) → void
: super core::Object::•() {}
method noSuchMethod(core::Invocation invocation) → dynamic
return null;
- method then<S extends core::Object>((self::MyFuture::T) → asy::FutureOr<self::MyFuture::then::S> f, {core::Function onError = null}) → self::MyFuture<self::MyFuture::then::S>
+ 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;
abstract 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>;
abstract 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>;
diff --git a/pkg/front_end/testcases/inference/future_union_downwards_generic_method_with_generic_return.dart.direct.expect b/pkg/front_end/testcases/inference/future_union_downwards_generic_method_with_generic_return.dart.direct.expect
index 99a343c..cee5b68 100644
--- a/pkg/front_end/testcases/inference/future_union_downwards_generic_method_with_generic_return.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/future_union_downwards_generic_method_with_generic_return.dart.direct.expect
@@ -3,7 +3,7 @@
import "dart:core" as core;
import "dart:async" as asy;
-static method id<T extends core::Object>(self::id::T x) → self::id::T
+static method id<T extends core::Object = dynamic>(self::id::T x) → self::id::T
return x;
static method test() → dynamic async {
asy::Future<core::String> f;
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 826a96d..91cb8b0 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
@@ -3,7 +3,7 @@
import "dart:core" as core;
import "dart:async" as asy;
-static method id<T extends core::Object>(self::id::T x) → self::id::T
+static method id<T extends core::Object = dynamic>(self::id::T x) → self::id::T
return x;
static method test() → dynamic /* originally async */ {
final asy::Completer<dynamic> :completer = asy::Completer::sync<dynamic>();
diff --git a/pkg/front_end/testcases/inference/future_union_downwards_generic_method_with_generic_return.dart.outline.expect b/pkg/front_end/testcases/inference/future_union_downwards_generic_method_with_generic_return.dart.outline.expect
index a323d38..92d9692 100644
--- a/pkg/front_end/testcases/inference/future_union_downwards_generic_method_with_generic_return.dart.outline.expect
+++ b/pkg/front_end/testcases/inference/future_union_downwards_generic_method_with_generic_return.dart.outline.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-static method id<T extends core::Object>(self::id::T x) → self::id::T
+static method id<T extends core::Object = dynamic>(self::id::T x) → self::id::T
;
static method test() → dynamic
;
diff --git a/pkg/front_end/testcases/inference/future_union_downwards_generic_method_with_generic_return.dart.strong.expect b/pkg/front_end/testcases/inference/future_union_downwards_generic_method_with_generic_return.dart.strong.expect
index 2417d16..39e445a 100644
--- a/pkg/front_end/testcases/inference/future_union_downwards_generic_method_with_generic_return.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/future_union_downwards_generic_method_with_generic_return.dart.strong.expect
@@ -3,7 +3,7 @@
import "dart:core" as core;
import "dart:async" as asy;
-static method id<T extends core::Object>(self::id::T x) → self::id::T
+static method id<T extends core::Object = dynamic>(self::id::T x) → self::id::T
return x;
static method test() → dynamic async {
asy::Future<core::String> f;
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 0a3ce6b..92c8c6b 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
@@ -3,7 +3,7 @@
import "dart:core" as core;
import "dart:async" as asy;
-static method id<T extends core::Object>(self::id::T x) → self::id::T
+static method id<T extends core::Object = dynamic>(self::id::T x) → self::id::T
return x;
static method test() → dynamic /* originally async */ {
final asy::Completer<dynamic> :completer = asy::Completer::sync<dynamic>();
diff --git a/pkg/front_end/testcases/inference/generic_functions_return_typedef.dart.direct.expect b/pkg/front_end/testcases/inference/generic_functions_return_typedef.dart.direct.expect
index e583060..53ab933f 100644
--- a/pkg/front_end/testcases/inference/generic_functions_return_typedef.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/generic_functions_return_typedef.dart.direct.expect
@@ -2,9 +2,9 @@
import self as self;
import "dart:core" as core;
-typedef ToValue<T extends core::Object> = (T) → void;
+typedef ToValue<T extends core::Object = dynamic> = (T) → void;
static method main() → dynamic {
- function f<T extends core::Object>(T x) → (T) → void
+ function f<T extends core::Object = dynamic>(T x) → (T) → void
return null;
dynamic x = f.call<core::int>(42);
dynamic y = f.call(42);
diff --git a/pkg/front_end/testcases/inference/generic_functions_return_typedef.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/generic_functions_return_typedef.dart.direct.transformed.expect
index e583060..53ab933f 100644
--- a/pkg/front_end/testcases/inference/generic_functions_return_typedef.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/generic_functions_return_typedef.dart.direct.transformed.expect
@@ -2,9 +2,9 @@
import self as self;
import "dart:core" as core;
-typedef ToValue<T extends core::Object> = (T) → void;
+typedef ToValue<T extends core::Object = dynamic> = (T) → void;
static method main() → dynamic {
- function f<T extends core::Object>(T x) → (T) → void
+ function f<T extends core::Object = dynamic>(T x) → (T) → void
return null;
dynamic x = f.call<core::int>(42);
dynamic y = f.call(42);
diff --git a/pkg/front_end/testcases/inference/generic_methods_basic_downward_inference.dart.direct.expect b/pkg/front_end/testcases/inference/generic_methods_basic_downward_inference.dart.direct.expect
index a770f08..fe1c799 100644
--- a/pkg/front_end/testcases/inference/generic_methods_basic_downward_inference.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/generic_methods_basic_downward_inference.dart.direct.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-static method f<S extends core::Object, T extends core::Object>(self::f::S s) → self::f::T
+static method f<S extends core::Object = dynamic, T extends core::Object = dynamic>(self::f::S s) → self::f::T
return null;
static method main() → dynamic {
core::String x = self::f<dynamic, dynamic>(42);
diff --git a/pkg/front_end/testcases/inference/generic_methods_basic_downward_inference.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/generic_methods_basic_downward_inference.dart.direct.transformed.expect
index a770f08..fe1c799 100644
--- a/pkg/front_end/testcases/inference/generic_methods_basic_downward_inference.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/generic_methods_basic_downward_inference.dart.direct.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-static method f<S extends core::Object, T extends core::Object>(self::f::S s) → self::f::T
+static method f<S extends core::Object = dynamic, T extends core::Object = dynamic>(self::f::S s) → self::f::T
return null;
static method main() → dynamic {
core::String x = self::f<dynamic, dynamic>(42);
diff --git a/pkg/front_end/testcases/inference/generic_methods_basic_downward_inference.dart.strong.expect b/pkg/front_end/testcases/inference/generic_methods_basic_downward_inference.dart.strong.expect
index e9fb8da..b410886 100644
--- a/pkg/front_end/testcases/inference/generic_methods_basic_downward_inference.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/generic_methods_basic_downward_inference.dart.strong.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-static method f<S extends core::Object, T extends core::Object>(self::f::S s) → self::f::T
+static method f<S extends core::Object = dynamic, T extends core::Object = dynamic>(self::f::S s) → self::f::T
return null;
static method main() → dynamic {
core::String x = self::f<core::int, core::String>(42);
diff --git a/pkg/front_end/testcases/inference/generic_methods_basic_downward_inference.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/generic_methods_basic_downward_inference.dart.strong.transformed.expect
index e9fb8da..b410886 100644
--- a/pkg/front_end/testcases/inference/generic_methods_basic_downward_inference.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/generic_methods_basic_downward_inference.dart.strong.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-static method f<S extends core::Object, T extends core::Object>(self::f::S s) → self::f::T
+static method f<S extends core::Object = dynamic, T extends core::Object = dynamic>(self::f::S s) → self::f::T
return null;
static method main() → dynamic {
core::String x = self::f<core::int, core::String>(42);
diff --git a/pkg/front_end/testcases/inference/generic_methods_correctly_recognize_generic_upper_bound.dart.direct.expect b/pkg/front_end/testcases/inference/generic_methods_correctly_recognize_generic_upper_bound.dart.direct.expect
index 4b4f413..17b048c 100644
--- a/pkg/front_end/testcases/inference/generic_methods_correctly_recognize_generic_upper_bound.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/generic_methods_correctly_recognize_generic_upper_bound.dart.direct.expect
@@ -2,11 +2,11 @@
import self as self;
import "dart:core" as core;
-class Foo<T extends core::Pattern> extends core::Object {
+class Foo<T extends core::Pattern = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
- method method<U extends self::Foo::T>(self::Foo::method::U u) → self::Foo::method::U
+ method method<U extends self::Foo::T = dynamic>(self::Foo::method::U u) → self::Foo::method::U
return u;
}
static method main() → dynamic {
diff --git a/pkg/front_end/testcases/inference/generic_methods_correctly_recognize_generic_upper_bound.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/generic_methods_correctly_recognize_generic_upper_bound.dart.direct.transformed.expect
index 4b4f413..17b048c 100644
--- a/pkg/front_end/testcases/inference/generic_methods_correctly_recognize_generic_upper_bound.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/generic_methods_correctly_recognize_generic_upper_bound.dart.direct.transformed.expect
@@ -2,11 +2,11 @@
import self as self;
import "dart:core" as core;
-class Foo<T extends core::Pattern> extends core::Object {
+class Foo<T extends core::Pattern = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
- method method<U extends self::Foo::T>(self::Foo::method::U u) → self::Foo::method::U
+ method method<U extends self::Foo::T = dynamic>(self::Foo::method::U u) → self::Foo::method::U
return u;
}
static method main() → dynamic {
diff --git a/pkg/front_end/testcases/inference/generic_methods_correctly_recognize_generic_upper_bound.dart.strong.expect b/pkg/front_end/testcases/inference/generic_methods_correctly_recognize_generic_upper_bound.dart.strong.expect
index 920bdcc..f365fb5 100644
--- a/pkg/front_end/testcases/inference/generic_methods_correctly_recognize_generic_upper_bound.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/generic_methods_correctly_recognize_generic_upper_bound.dart.strong.expect
@@ -2,11 +2,11 @@
import self as self;
import "dart:core" as core;
-class Foo<T extends core::Pattern> extends core::Object {
+class Foo<T extends core::Pattern = core::Pattern> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
- method method<generic-covariant-impl generic-covariant-interface U extends self::Foo::T>(self::Foo::method::U u) → self::Foo::method::U
+ method method<generic-covariant-impl generic-covariant-interface U extends self::Foo::T = dynamic>(self::Foo::method::U u) → self::Foo::method::U
return u;
}
static method main() → dynamic {
diff --git a/pkg/front_end/testcases/inference/generic_methods_do_not_infer_invalid_override_of_generic_method.dart.direct.expect b/pkg/front_end/testcases/inference/generic_methods_do_not_infer_invalid_override_of_generic_method.dart.direct.expect
index 7e92972..4370627 100644
--- a/pkg/front_end/testcases/inference/generic_methods_do_not_infer_invalid_override_of_generic_method.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/generic_methods_do_not_infer_invalid_override_of_generic_method.dart.direct.expect
@@ -6,7 +6,7 @@
synthetic constructor •() → void
: super core::Object::•()
;
- method m<T extends core::Object>(self::C::m::T x) → self::C::m::T
+ method m<T extends core::Object = dynamic>(self::C::m::T x) → self::C::m::T
return x;
}
class D extends self::C {
diff --git a/pkg/front_end/testcases/inference/generic_methods_do_not_infer_invalid_override_of_generic_method.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/generic_methods_do_not_infer_invalid_override_of_generic_method.dart.direct.transformed.expect
index 7e92972..4370627 100644
--- a/pkg/front_end/testcases/inference/generic_methods_do_not_infer_invalid_override_of_generic_method.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/generic_methods_do_not_infer_invalid_override_of_generic_method.dart.direct.transformed.expect
@@ -6,7 +6,7 @@
synthetic constructor •() → void
: super core::Object::•()
;
- method m<T extends core::Object>(self::C::m::T x) → self::C::m::T
+ method m<T extends core::Object = dynamic>(self::C::m::T x) → self::C::m::T
return x;
}
class D extends self::C {
diff --git a/pkg/front_end/testcases/inference/generic_methods_do_not_infer_invalid_override_of_generic_method.dart.strong.expect b/pkg/front_end/testcases/inference/generic_methods_do_not_infer_invalid_override_of_generic_method.dart.strong.expect
index 8514bf6..1d84eb1 100644
--- a/pkg/front_end/testcases/inference/generic_methods_do_not_infer_invalid_override_of_generic_method.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/generic_methods_do_not_infer_invalid_override_of_generic_method.dart.strong.expect
@@ -6,7 +6,7 @@
synthetic constructor •() → void
: super core::Object::•()
;
- method m<T extends core::Object>(self::C::m::T x) → self::C::m::T
+ method m<T extends core::Object = dynamic>(self::C::m::T x) → self::C::m::T
return x;
}
class D extends self::C {
diff --git a/pkg/front_end/testcases/inference/generic_methods_downwards_inference_affects_arguments.dart.direct.expect b/pkg/front_end/testcases/inference/generic_methods_downwards_inference_affects_arguments.dart.direct.expect
index e070910..5ab9647 100644
--- a/pkg/front_end/testcases/inference/generic_methods_downwards_inference_affects_arguments.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/generic_methods_downwards_inference_affects_arguments.dart.direct.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-static method f<T extends core::Object>(core::List<self::f::T> s) → self::f::T
+static method f<T extends core::Object = dynamic>(core::List<self::f::T> s) → self::f::T
return null;
static method test() → dynamic {
core::String x = self::f<dynamic>(<dynamic>["hi"]);
diff --git a/pkg/front_end/testcases/inference/generic_methods_downwards_inference_affects_arguments.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/generic_methods_downwards_inference_affects_arguments.dart.direct.transformed.expect
index e070910..5ab9647 100644
--- a/pkg/front_end/testcases/inference/generic_methods_downwards_inference_affects_arguments.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/generic_methods_downwards_inference_affects_arguments.dart.direct.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-static method f<T extends core::Object>(core::List<self::f::T> s) → self::f::T
+static method f<T extends core::Object = dynamic>(core::List<self::f::T> s) → self::f::T
return null;
static method test() → dynamic {
core::String x = self::f<dynamic>(<dynamic>["hi"]);
diff --git a/pkg/front_end/testcases/inference/generic_methods_downwards_inference_affects_arguments.dart.strong.expect b/pkg/front_end/testcases/inference/generic_methods_downwards_inference_affects_arguments.dart.strong.expect
index 5ac5390..a980b89 100644
--- a/pkg/front_end/testcases/inference/generic_methods_downwards_inference_affects_arguments.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/generic_methods_downwards_inference_affects_arguments.dart.strong.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-static method f<T extends core::Object>(core::List<self::f::T> s) → self::f::T
+static method f<T extends core::Object = dynamic>(core::List<self::f::T> s) → self::f::T
return null;
static method test() → dynamic {
core::String x = self::f<core::String>(<core::String>["hi"]);
diff --git a/pkg/front_end/testcases/inference/generic_methods_downwards_inference_affects_arguments.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/generic_methods_downwards_inference_affects_arguments.dart.strong.transformed.expect
index 4722ed3..4a81079 100644
--- a/pkg/front_end/testcases/inference/generic_methods_downwards_inference_affects_arguments.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/generic_methods_downwards_inference_affects_arguments.dart.strong.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-static method f<T extends core::Object>(core::List<self::f::T> s) → self::f::T
+static method f<T extends core::Object = dynamic>(core::List<self::f::T> s) → self::f::T
return null;
static method test() → dynamic {
core::String x = self::f<core::String>(<core::String>["hi"]);
diff --git a/pkg/front_end/testcases/inference/generic_methods_handle_override_of_non_generic_with_generic.dart.direct.expect b/pkg/front_end/testcases/inference/generic_methods_handle_override_of_non_generic_with_generic.dart.direct.expect
index af643ea..f688995 100644
--- a/pkg/front_end/testcases/inference/generic_methods_handle_override_of_non_generic_with_generic.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/generic_methods_handle_override_of_non_generic_with_generic.dart.direct.expect
@@ -15,9 +15,9 @@
synthetic constructor •() → void
: super self::C::•()
;
- method m<T extends core::Object>(self::D::m::T x) → self::D::m::T
+ method m<T extends core::Object = dynamic>(self::D::m::T x) → self::D::m::T
return x;
- method g<T extends core::Object>(self::D::g::T x) → self::D::g::T
+ method g<T extends core::Object = dynamic>(self::D::g::T x) → self::D::g::T
return x;
}
static method main() → dynamic {
diff --git a/pkg/front_end/testcases/inference/generic_methods_handle_override_of_non_generic_with_generic.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/generic_methods_handle_override_of_non_generic_with_generic.dart.direct.transformed.expect
index af643ea..f688995 100644
--- a/pkg/front_end/testcases/inference/generic_methods_handle_override_of_non_generic_with_generic.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/generic_methods_handle_override_of_non_generic_with_generic.dart.direct.transformed.expect
@@ -15,9 +15,9 @@
synthetic constructor •() → void
: super self::C::•()
;
- method m<T extends core::Object>(self::D::m::T x) → self::D::m::T
+ method m<T extends core::Object = dynamic>(self::D::m::T x) → self::D::m::T
return x;
- method g<T extends core::Object>(self::D::g::T x) → self::D::g::T
+ method g<T extends core::Object = dynamic>(self::D::g::T x) → self::D::g::T
return x;
}
static method main() → dynamic {
diff --git a/pkg/front_end/testcases/inference/generic_methods_handle_override_of_non_generic_with_generic.dart.strong.expect b/pkg/front_end/testcases/inference/generic_methods_handle_override_of_non_generic_with_generic.dart.strong.expect
index db0f902..7e4bcfc6 100644
--- a/pkg/front_end/testcases/inference/generic_methods_handle_override_of_non_generic_with_generic.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/generic_methods_handle_override_of_non_generic_with_generic.dart.strong.expect
@@ -15,9 +15,9 @@
synthetic constructor •() → void
: super self::C::•()
;
- method m<T extends core::Object>(self::D::m::T x) → self::D::m::T
+ method m<T extends core::Object = dynamic>(self::D::m::T x) → self::D::m::T
return x;
- method g<T extends core::Object>(self::D::g::T x) → self::D::g::T
+ method g<T extends core::Object = dynamic>(self::D::g::T x) → self::D::g::T
return x;
}
static const field dynamic #errors = const <dynamic>["pkg/front_end/testcases/inference/generic_methods_handle_override_of_non_generic_with_generic.dart:14:46: Error: Declared type variables of 'D::m' doesn't match those on overridden method 'C::m'.
diff --git a/pkg/front_end/testcases/inference/generic_methods_infer_generic_function_parameter_type.dart.direct.expect b/pkg/front_end/testcases/inference/generic_methods_infer_generic_function_parameter_type.dart.direct.expect
index 99e84b5..0f57adc 100644
--- a/pkg/front_end/testcases/inference/generic_methods_infer_generic_function_parameter_type.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/generic_methods_infer_generic_function_parameter_type.dart.direct.expect
@@ -2,18 +2,18 @@
import self as self;
import "dart:core" as core;
-typedef F<V extends core::Object> = (V) → void;
-class C<T extends core::Object> extends self::D<self::C::T> {
+typedef F<V extends core::Object = dynamic> = (V) → void;
+class C<T extends core::Object = dynamic> extends self::D<self::C::T> {
synthetic constructor •() → void
: super self::D::•()
;
- method f<U extends core::Object>(dynamic x) → dynamic {}
+ method f<U extends core::Object = dynamic>(dynamic x) → dynamic {}
}
-class D<T extends core::Object> extends core::Object {
+class D<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
- method f<U extends core::Object>(self::D::f::U u) → (self::D::f::U) → void
+ method f<U extends core::Object = dynamic>(self::D::f::U u) → (self::D::f::U) → void
return null;
}
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/generic_methods_infer_generic_function_parameter_type.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/generic_methods_infer_generic_function_parameter_type.dart.direct.transformed.expect
index 99e84b5..0f57adc 100644
--- a/pkg/front_end/testcases/inference/generic_methods_infer_generic_function_parameter_type.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/generic_methods_infer_generic_function_parameter_type.dart.direct.transformed.expect
@@ -2,18 +2,18 @@
import self as self;
import "dart:core" as core;
-typedef F<V extends core::Object> = (V) → void;
-class C<T extends core::Object> extends self::D<self::C::T> {
+typedef F<V extends core::Object = dynamic> = (V) → void;
+class C<T extends core::Object = dynamic> extends self::D<self::C::T> {
synthetic constructor •() → void
: super self::D::•()
;
- method f<U extends core::Object>(dynamic x) → dynamic {}
+ method f<U extends core::Object = dynamic>(dynamic x) → dynamic {}
}
-class D<T extends core::Object> extends core::Object {
+class D<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
- method f<U extends core::Object>(self::D::f::U u) → (self::D::f::U) → void
+ method f<U extends core::Object = dynamic>(self::D::f::U u) → (self::D::f::U) → void
return null;
}
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/generic_methods_infer_generic_function_parameter_type.dart.strong.expect b/pkg/front_end/testcases/inference/generic_methods_infer_generic_function_parameter_type.dart.strong.expect
index b141cc6..9e57aaf 100644
--- a/pkg/front_end/testcases/inference/generic_methods_infer_generic_function_parameter_type.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/generic_methods_infer_generic_function_parameter_type.dart.strong.expect
@@ -2,18 +2,18 @@
import self as self;
import "dart:core" as core;
-typedef F<V extends core::Object> = (V) → void;
-class C<T extends core::Object> extends self::D<self::C::T> {
+typedef F<V extends core::Object = dynamic> = (V) → void;
+class C<T extends core::Object = dynamic> extends self::D<self::C::T> {
synthetic constructor •() → void
: super self::D::•()
;
- method f<U extends core::Object>(self::C::f::U x) → (self::C::f::U) → void {}
+ method f<U extends core::Object = dynamic>(self::C::f::U x) → (self::C::f::U) → void {}
}
-class D<T extends core::Object> extends core::Object {
+class D<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
- method f<U extends core::Object>(self::D::f::U u) → (self::D::f::U) → void
+ method f<U extends core::Object = dynamic>(self::D::f::U u) → (self::D::f::U) → void
return null;
}
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/generic_methods_infer_generic_function_parameter_type.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/generic_methods_infer_generic_function_parameter_type.dart.strong.transformed.expect
index b141cc6..9e57aaf 100644
--- a/pkg/front_end/testcases/inference/generic_methods_infer_generic_function_parameter_type.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/generic_methods_infer_generic_function_parameter_type.dart.strong.transformed.expect
@@ -2,18 +2,18 @@
import self as self;
import "dart:core" as core;
-typedef F<V extends core::Object> = (V) → void;
-class C<T extends core::Object> extends self::D<self::C::T> {
+typedef F<V extends core::Object = dynamic> = (V) → void;
+class C<T extends core::Object = dynamic> extends self::D<self::C::T> {
synthetic constructor •() → void
: super self::D::•()
;
- method f<U extends core::Object>(self::C::f::U x) → (self::C::f::U) → void {}
+ method f<U extends core::Object = dynamic>(self::C::f::U x) → (self::C::f::U) → void {}
}
-class D<T extends core::Object> extends core::Object {
+class D<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
- method f<U extends core::Object>(self::D::f::U u) → (self::D::f::U) → void
+ method f<U extends core::Object = dynamic>(self::D::f::U u) → (self::D::f::U) → void
return null;
}
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/generic_methods_infer_generic_function_parameter_type2.dart.direct.expect b/pkg/front_end/testcases/inference/generic_methods_infer_generic_function_parameter_type2.dart.direct.expect
index 551a22b..17d6815 100644
--- a/pkg/front_end/testcases/inference/generic_methods_infer_generic_function_parameter_type2.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/generic_methods_infer_generic_function_parameter_type2.dart.direct.expect
@@ -2,18 +2,18 @@
import self as self;
import "dart:core" as core;
-typedef G<V extends core::Object> = () → core::List<V>;
-class C<T extends core::Object> extends self::D<self::C::T> {
+typedef G<V extends core::Object = dynamic> = () → core::List<V>;
+class C<T extends core::Object = dynamic> extends self::D<self::C::T> {
synthetic constructor •() → void
: super self::D::•()
;
- method f<U extends core::Object>(dynamic g) → dynamic
+ method f<U extends core::Object = dynamic>(dynamic g) → dynamic
return null;
}
-abstract class D<T extends core::Object> extends core::Object {
+abstract class D<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
- abstract method f<U extends core::Object>(() → core::List<self::D::f::U> g) → void;
+ abstract method f<U extends core::Object = dynamic>(() → core::List<self::D::f::U> g) → void;
}
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/generic_methods_infer_generic_function_parameter_type2.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/generic_methods_infer_generic_function_parameter_type2.dart.direct.transformed.expect
index 551a22b..17d6815 100644
--- a/pkg/front_end/testcases/inference/generic_methods_infer_generic_function_parameter_type2.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/generic_methods_infer_generic_function_parameter_type2.dart.direct.transformed.expect
@@ -2,18 +2,18 @@
import self as self;
import "dart:core" as core;
-typedef G<V extends core::Object> = () → core::List<V>;
-class C<T extends core::Object> extends self::D<self::C::T> {
+typedef G<V extends core::Object = dynamic> = () → core::List<V>;
+class C<T extends core::Object = dynamic> extends self::D<self::C::T> {
synthetic constructor •() → void
: super self::D::•()
;
- method f<U extends core::Object>(dynamic g) → dynamic
+ method f<U extends core::Object = dynamic>(dynamic g) → dynamic
return null;
}
-abstract class D<T extends core::Object> extends core::Object {
+abstract class D<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
- abstract method f<U extends core::Object>(() → core::List<self::D::f::U> g) → void;
+ abstract method f<U extends core::Object = dynamic>(() → core::List<self::D::f::U> g) → void;
}
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/generic_methods_infer_generic_function_parameter_type2.dart.strong.expect b/pkg/front_end/testcases/inference/generic_methods_infer_generic_function_parameter_type2.dart.strong.expect
index 4e1632a..d201593 100644
--- a/pkg/front_end/testcases/inference/generic_methods_infer_generic_function_parameter_type2.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/generic_methods_infer_generic_function_parameter_type2.dart.strong.expect
@@ -2,18 +2,18 @@
import self as self;
import "dart:core" as core;
-typedef G<V extends core::Object> = () → core::List<V>;
-class C<T extends core::Object> extends self::D<self::C::T> {
+typedef G<V extends core::Object = dynamic> = () → core::List<V>;
+class C<T extends core::Object = dynamic> extends self::D<self::C::T> {
synthetic constructor •() → void
: super self::D::•()
;
- method f<U extends core::Object>(() → core::List<self::C::f::U> g) → void
+ method f<U extends core::Object = dynamic>(() → core::List<self::C::f::U> g) → void
return null;
}
-abstract class D<T extends core::Object> extends core::Object {
+abstract class D<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
- abstract method f<U extends core::Object>(() → core::List<self::D::f::U> g) → void;
+ abstract method f<U extends core::Object = dynamic>(() → core::List<self::D::f::U> g) → void;
}
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/generic_methods_infer_generic_function_parameter_type2.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/generic_methods_infer_generic_function_parameter_type2.dart.strong.transformed.expect
index 4e1632a..d201593 100644
--- a/pkg/front_end/testcases/inference/generic_methods_infer_generic_function_parameter_type2.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/generic_methods_infer_generic_function_parameter_type2.dart.strong.transformed.expect
@@ -2,18 +2,18 @@
import self as self;
import "dart:core" as core;
-typedef G<V extends core::Object> = () → core::List<V>;
-class C<T extends core::Object> extends self::D<self::C::T> {
+typedef G<V extends core::Object = dynamic> = () → core::List<V>;
+class C<T extends core::Object = dynamic> extends self::D<self::C::T> {
synthetic constructor •() → void
: super self::D::•()
;
- method f<U extends core::Object>(() → core::List<self::C::f::U> g) → void
+ method f<U extends core::Object = dynamic>(() → core::List<self::C::f::U> g) → void
return null;
}
-abstract class D<T extends core::Object> extends core::Object {
+abstract class D<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
- abstract method f<U extends core::Object>(() → core::List<self::D::f::U> g) → void;
+ abstract method f<U extends core::Object = dynamic>(() → core::List<self::D::f::U> g) → void;
}
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/generic_methods_infer_generic_function_return_type.dart.direct.expect b/pkg/front_end/testcases/inference/generic_methods_infer_generic_function_return_type.dart.direct.expect
index 4465b65..4b020dd 100644
--- a/pkg/front_end/testcases/inference/generic_methods_infer_generic_function_return_type.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/generic_methods_infer_generic_function_return_type.dart.direct.expect
@@ -2,18 +2,18 @@
import self as self;
import "dart:core" as core;
-typedef F<V extends core::Object> = () → V;
-class C<T extends core::Object> extends self::D<self::C::T> {
+typedef F<V extends core::Object = dynamic> = () → V;
+class C<T extends core::Object = dynamic> extends self::D<self::C::T> {
synthetic constructor •() → void
: super self::D::•()
;
- method f<U extends core::Object>(dynamic x) → dynamic {}
+ method f<U extends core::Object = dynamic>(dynamic x) → dynamic {}
}
-class D<T extends core::Object> extends core::Object {
+class D<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
- method f<U extends core::Object>(self::D::f::U u) → () → self::D::f::U
+ method f<U extends core::Object = dynamic>(self::D::f::U u) → () → self::D::f::U
return null;
}
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/generic_methods_infer_generic_function_return_type.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/generic_methods_infer_generic_function_return_type.dart.direct.transformed.expect
index 4465b65..4b020dd 100644
--- a/pkg/front_end/testcases/inference/generic_methods_infer_generic_function_return_type.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/generic_methods_infer_generic_function_return_type.dart.direct.transformed.expect
@@ -2,18 +2,18 @@
import self as self;
import "dart:core" as core;
-typedef F<V extends core::Object> = () → V;
-class C<T extends core::Object> extends self::D<self::C::T> {
+typedef F<V extends core::Object = dynamic> = () → V;
+class C<T extends core::Object = dynamic> extends self::D<self::C::T> {
synthetic constructor •() → void
: super self::D::•()
;
- method f<U extends core::Object>(dynamic x) → dynamic {}
+ method f<U extends core::Object = dynamic>(dynamic x) → dynamic {}
}
-class D<T extends core::Object> extends core::Object {
+class D<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
- method f<U extends core::Object>(self::D::f::U u) → () → self::D::f::U
+ method f<U extends core::Object = dynamic>(self::D::f::U u) → () → self::D::f::U
return null;
}
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/generic_methods_infer_generic_function_return_type.dart.strong.expect b/pkg/front_end/testcases/inference/generic_methods_infer_generic_function_return_type.dart.strong.expect
index eb9055b..53feefd 100644
--- a/pkg/front_end/testcases/inference/generic_methods_infer_generic_function_return_type.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/generic_methods_infer_generic_function_return_type.dart.strong.expect
@@ -2,18 +2,18 @@
import self as self;
import "dart:core" as core;
-typedef F<V extends core::Object> = () → V;
-class C<T extends core::Object> extends self::D<self::C::T> {
+typedef F<V extends core::Object = dynamic> = () → V;
+class C<T extends core::Object = dynamic> extends self::D<self::C::T> {
synthetic constructor •() → void
: super self::D::•()
;
- method f<U extends core::Object>(self::C::f::U x) → () → self::C::f::U {}
+ method f<U extends core::Object = dynamic>(self::C::f::U x) → () → self::C::f::U {}
}
-class D<T extends core::Object> extends core::Object {
+class D<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
- method f<U extends core::Object>(self::D::f::U u) → () → self::D::f::U
+ method f<U extends core::Object = dynamic>(self::D::f::U u) → () → self::D::f::U
return null;
}
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/generic_methods_infer_generic_function_return_type.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/generic_methods_infer_generic_function_return_type.dart.strong.transformed.expect
index eb9055b..53feefd 100644
--- a/pkg/front_end/testcases/inference/generic_methods_infer_generic_function_return_type.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/generic_methods_infer_generic_function_return_type.dart.strong.transformed.expect
@@ -2,18 +2,18 @@
import self as self;
import "dart:core" as core;
-typedef F<V extends core::Object> = () → V;
-class C<T extends core::Object> extends self::D<self::C::T> {
+typedef F<V extends core::Object = dynamic> = () → V;
+class C<T extends core::Object = dynamic> extends self::D<self::C::T> {
synthetic constructor •() → void
: super self::D::•()
;
- method f<U extends core::Object>(self::C::f::U x) → () → self::C::f::U {}
+ method f<U extends core::Object = dynamic>(self::C::f::U x) → () → self::C::f::U {}
}
-class D<T extends core::Object> extends core::Object {
+class D<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
- method f<U extends core::Object>(self::D::f::U u) → () → self::D::f::U
+ method f<U extends core::Object = dynamic>(self::D::f::U u) → () → self::D::f::U
return null;
}
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/generic_methods_infer_generic_instantiation.dart.direct.expect b/pkg/front_end/testcases/inference/generic_methods_infer_generic_instantiation.dart.direct.expect
index 3a68a44..5f8ac38 100644
--- a/pkg/front_end/testcases/inference/generic_methods_infer_generic_instantiation.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/generic_methods_infer_generic_instantiation.dart.direct.expect
@@ -7,7 +7,7 @@
synthetic constructor •() → void
: super core::Object::•()
;
- method m<T extends core::num>(self::C::m::T x, self::C::m::T y) → self::C::m::T
+ method m<T extends core::num = dynamic>(self::C::m::T x, self::C::m::T y) → self::C::m::T
return null;
}
static method test() → dynamic {
diff --git a/pkg/front_end/testcases/inference/generic_methods_infer_generic_instantiation.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/generic_methods_infer_generic_instantiation.dart.direct.transformed.expect
index 3a68a44..5f8ac38 100644
--- a/pkg/front_end/testcases/inference/generic_methods_infer_generic_instantiation.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/generic_methods_infer_generic_instantiation.dart.direct.transformed.expect
@@ -7,7 +7,7 @@
synthetic constructor •() → void
: super core::Object::•()
;
- method m<T extends core::num>(self::C::m::T x, self::C::m::T y) → self::C::m::T
+ method m<T extends core::num = dynamic>(self::C::m::T x, self::C::m::T y) → self::C::m::T
return null;
}
static method test() → dynamic {
diff --git a/pkg/front_end/testcases/inference/generic_methods_infer_generic_instantiation.dart.strong.expect b/pkg/front_end/testcases/inference/generic_methods_infer_generic_instantiation.dart.strong.expect
index 7774f17..7572fdd 100644
--- a/pkg/front_end/testcases/inference/generic_methods_infer_generic_instantiation.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/generic_methods_infer_generic_instantiation.dart.strong.expect
@@ -7,7 +7,7 @@
synthetic constructor •() → void
: super core::Object::•()
;
- method m<T extends core::num>(self::C::m::T x, self::C::m::T y) → self::C::m::T
+ method m<T extends core::num = dynamic>(self::C::m::T x, self::C::m::T y) → self::C::m::T
return null;
}
static method test() → dynamic {
diff --git a/pkg/front_end/testcases/inference/generic_methods_infer_generic_instantiation.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/generic_methods_infer_generic_instantiation.dart.strong.transformed.expect
index a11c923..a687df6 100644
--- a/pkg/front_end/testcases/inference/generic_methods_infer_generic_instantiation.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/generic_methods_infer_generic_instantiation.dart.strong.transformed.expect
@@ -7,7 +7,7 @@
synthetic constructor •() → void
: super core::Object::•()
;
- method m<T extends core::num>(self::C::m::T x, self::C::m::T y) → self::C::m::T
+ method m<T extends core::num = dynamic>(self::C::m::T x, self::C::m::T y) → self::C::m::T
return null;
}
static method test() → dynamic {
diff --git a/pkg/front_end/testcases/inference/generic_methods_infer_generic_method_type.dart.direct.expect b/pkg/front_end/testcases/inference/generic_methods_infer_generic_method_type.dart.direct.expect
index 41749ee..65e0f43 100644
--- a/pkg/front_end/testcases/inference/generic_methods_infer_generic_method_type.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/generic_methods_infer_generic_method_type.dart.direct.expect
@@ -6,14 +6,14 @@
synthetic constructor •() → void
: super core::Object::•()
;
- method m<T extends core::Object>(self::C::m::T x) → self::C::m::T
+ method m<T extends core::Object = dynamic>(self::C::m::T x) → self::C::m::T
return x;
}
class D extends self::C {
synthetic constructor •() → void
: super self::C::•()
;
- method m<S extends core::Object>(dynamic x) → dynamic
+ method m<S extends core::Object = dynamic>(dynamic x) → dynamic
return x;
}
static method main() → dynamic {
diff --git a/pkg/front_end/testcases/inference/generic_methods_infer_generic_method_type.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/generic_methods_infer_generic_method_type.dart.direct.transformed.expect
index 41749ee..65e0f43 100644
--- a/pkg/front_end/testcases/inference/generic_methods_infer_generic_method_type.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/generic_methods_infer_generic_method_type.dart.direct.transformed.expect
@@ -6,14 +6,14 @@
synthetic constructor •() → void
: super core::Object::•()
;
- method m<T extends core::Object>(self::C::m::T x) → self::C::m::T
+ method m<T extends core::Object = dynamic>(self::C::m::T x) → self::C::m::T
return x;
}
class D extends self::C {
synthetic constructor •() → void
: super self::C::•()
;
- method m<S extends core::Object>(dynamic x) → dynamic
+ method m<S extends core::Object = dynamic>(dynamic x) → dynamic
return x;
}
static method main() → dynamic {
diff --git a/pkg/front_end/testcases/inference/generic_methods_infer_generic_method_type.dart.strong.expect b/pkg/front_end/testcases/inference/generic_methods_infer_generic_method_type.dart.strong.expect
index 671ce41..b58c879 100644
--- a/pkg/front_end/testcases/inference/generic_methods_infer_generic_method_type.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/generic_methods_infer_generic_method_type.dart.strong.expect
@@ -6,14 +6,14 @@
synthetic constructor •() → void
: super core::Object::•()
;
- method m<T extends core::Object>(self::C::m::T x) → self::C::m::T
+ method m<T extends core::Object = dynamic>(self::C::m::T x) → self::C::m::T
return x;
}
class D extends self::C {
synthetic constructor •() → void
: super self::C::•()
;
- method m<S extends core::Object>(self::D::m::S x) → self::D::m::S
+ method m<S extends core::Object = dynamic>(self::D::m::S x) → self::D::m::S
return x;
}
static method main() → dynamic {
diff --git a/pkg/front_end/testcases/inference/generic_methods_infer_generic_method_type.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/generic_methods_infer_generic_method_type.dart.strong.transformed.expect
index 671ce41..b58c879 100644
--- a/pkg/front_end/testcases/inference/generic_methods_infer_generic_method_type.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/generic_methods_infer_generic_method_type.dart.strong.transformed.expect
@@ -6,14 +6,14 @@
synthetic constructor •() → void
: super core::Object::•()
;
- method m<T extends core::Object>(self::C::m::T x) → self::C::m::T
+ method m<T extends core::Object = dynamic>(self::C::m::T x) → self::C::m::T
return x;
}
class D extends self::C {
synthetic constructor •() → void
: super self::C::•()
;
- method m<S extends core::Object>(self::D::m::S x) → self::D::m::S
+ method m<S extends core::Object = dynamic>(self::D::m::S x) → self::D::m::S
return x;
}
static method main() → dynamic {
diff --git a/pkg/front_end/testcases/inference/generic_methods_uses_greatest_lower_bound.dart.direct.expect b/pkg/front_end/testcases/inference/generic_methods_uses_greatest_lower_bound.dart.direct.expect
index 1c4540d..cdb7f17 100644
--- a/pkg/front_end/testcases/inference/generic_methods_uses_greatest_lower_bound.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/generic_methods_uses_greatest_lower_bound.dart.direct.expect
@@ -4,7 +4,7 @@
typedef F = (core::int) → core::Iterable<core::num>;
typedef G = (core::double) → core::List<core::int>;
-static method generic<T extends core::Object>((self::generic::T) → dynamic a, (self::generic::T) → dynamic b) → self::generic::T
+static method generic<T extends core::Object = dynamic>((self::generic::T) → dynamic a, (self::generic::T) → dynamic b) → self::generic::T
return null;
static method main() → dynamic {
dynamic v = self::generic<dynamic>(((core::int) → core::Iterable<core::num> f) → dynamic => null, ((core::double) → core::List<core::int> g) → dynamic => null);
diff --git a/pkg/front_end/testcases/inference/generic_methods_uses_greatest_lower_bound.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/generic_methods_uses_greatest_lower_bound.dart.direct.transformed.expect
index 1c4540d..cdb7f17 100644
--- a/pkg/front_end/testcases/inference/generic_methods_uses_greatest_lower_bound.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/generic_methods_uses_greatest_lower_bound.dart.direct.transformed.expect
@@ -4,7 +4,7 @@
typedef F = (core::int) → core::Iterable<core::num>;
typedef G = (core::double) → core::List<core::int>;
-static method generic<T extends core::Object>((self::generic::T) → dynamic a, (self::generic::T) → dynamic b) → self::generic::T
+static method generic<T extends core::Object = dynamic>((self::generic::T) → dynamic a, (self::generic::T) → dynamic b) → self::generic::T
return null;
static method main() → dynamic {
dynamic v = self::generic<dynamic>(((core::int) → core::Iterable<core::num> f) → dynamic => null, ((core::double) → core::List<core::int> g) → dynamic => null);
diff --git a/pkg/front_end/testcases/inference/generic_methods_uses_greatest_lower_bound.dart.strong.expect b/pkg/front_end/testcases/inference/generic_methods_uses_greatest_lower_bound.dart.strong.expect
index 0aafd64..cd5eddc 100644
--- a/pkg/front_end/testcases/inference/generic_methods_uses_greatest_lower_bound.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/generic_methods_uses_greatest_lower_bound.dart.strong.expect
@@ -4,7 +4,7 @@
typedef F = (core::int) → core::Iterable<core::num>;
typedef G = (core::double) → core::List<core::int>;
-static method generic<T extends core::Object>((self::generic::T) → dynamic a, (self::generic::T) → dynamic b) → self::generic::T
+static method generic<T extends core::Object = dynamic>((self::generic::T) → dynamic a, (self::generic::T) → dynamic b) → self::generic::T
return null;
static method main() → dynamic {
(core::num) → core::List<core::int> v = self::generic<(core::num) → core::List<core::int>>(((core::int) → core::Iterable<core::num> f) → core::Null => null, ((core::double) → core::List<core::int> g) → core::Null => null);
diff --git a/pkg/front_end/testcases/inference/generic_methods_uses_greatest_lower_bound.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/generic_methods_uses_greatest_lower_bound.dart.strong.transformed.expect
index 0aafd64..cd5eddc 100644
--- a/pkg/front_end/testcases/inference/generic_methods_uses_greatest_lower_bound.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/generic_methods_uses_greatest_lower_bound.dart.strong.transformed.expect
@@ -4,7 +4,7 @@
typedef F = (core::int) → core::Iterable<core::num>;
typedef G = (core::double) → core::List<core::int>;
-static method generic<T extends core::Object>((self::generic::T) → dynamic a, (self::generic::T) → dynamic b) → self::generic::T
+static method generic<T extends core::Object = dynamic>((self::generic::T) → dynamic a, (self::generic::T) → dynamic b) → self::generic::T
return null;
static method main() → dynamic {
(core::num) → core::List<core::int> v = self::generic<(core::num) → core::List<core::int>>(((core::int) → core::Iterable<core::num> f) → core::Null => null, ((core::double) → core::List<core::int> g) → core::Null => null);
diff --git a/pkg/front_end/testcases/inference/greatest_closure_multiple_params.dart.direct.expect b/pkg/front_end/testcases/inference/greatest_closure_multiple_params.dart.direct.expect
index e98bebc..bf38d28 100644
--- a/pkg/front_end/testcases/inference/greatest_closure_multiple_params.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/greatest_closure_multiple_params.dart.direct.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-abstract class C<E extends core::Object> extends core::Object {
+abstract class C<E extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
@@ -12,7 +12,7 @@
static method _compareAny(dynamic a, dynamic b) → core::int {
throw "unimplemented";
}
- static method sort2<E extends core::Object>(self::C<self::C::sort2::E> a, (self::C::sort2::E, self::C::sort2::E) → core::int compare) → void {
+ static method sort2<E extends core::Object = dynamic>(self::C<self::C::sort2::E> a, (self::C::sort2::E, self::C::sort2::E) → core::int compare) → void {
throw "unimplemented";
}
}
diff --git a/pkg/front_end/testcases/inference/greatest_closure_multiple_params.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/greatest_closure_multiple_params.dart.direct.transformed.expect
index e98bebc..bf38d28 100644
--- a/pkg/front_end/testcases/inference/greatest_closure_multiple_params.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/greatest_closure_multiple_params.dart.direct.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-abstract class C<E extends core::Object> extends core::Object {
+abstract class C<E extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
@@ -12,7 +12,7 @@
static method _compareAny(dynamic a, dynamic b) → core::int {
throw "unimplemented";
}
- static method sort2<E extends core::Object>(self::C<self::C::sort2::E> a, (self::C::sort2::E, self::C::sort2::E) → core::int compare) → void {
+ static method sort2<E extends core::Object = dynamic>(self::C<self::C::sort2::E> a, (self::C::sort2::E, self::C::sort2::E) → core::int compare) → void {
throw "unimplemented";
}
}
diff --git a/pkg/front_end/testcases/inference/greatest_closure_multiple_params.dart.outline.expect b/pkg/front_end/testcases/inference/greatest_closure_multiple_params.dart.outline.expect
index 3ab1e85..dcee7af 100644
--- a/pkg/front_end/testcases/inference/greatest_closure_multiple_params.dart.outline.expect
+++ b/pkg/front_end/testcases/inference/greatest_closure_multiple_params.dart.outline.expect
@@ -2,14 +2,14 @@
import self as self;
import "dart:core" as core;
-abstract class C<E extends core::Object> extends core::Object {
+abstract class C<E extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
;
method sort([(self::C::E, self::C::E) → core::int compare]) → void
;
static method _compareAny(dynamic a, dynamic b) → core::int
;
- static method sort2<E extends core::Object>(self::C<self::C::sort2::E> a, (self::C::sort2::E, self::C::sort2::E) → core::int compare) → void
+ static method sort2<E extends core::Object = dynamic>(self::C<self::C::sort2::E> a, (self::C::sort2::E, self::C::sort2::E) → core::int compare) → void
;
}
static method main() → dynamic
diff --git a/pkg/front_end/testcases/inference/greatest_closure_multiple_params.dart.strong.expect b/pkg/front_end/testcases/inference/greatest_closure_multiple_params.dart.strong.expect
index 949aa38..12798a4 100644
--- a/pkg/front_end/testcases/inference/greatest_closure_multiple_params.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/greatest_closure_multiple_params.dart.strong.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-abstract class C<E extends core::Object> extends core::Object {
+abstract class C<E extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
@@ -12,7 +12,7 @@
static method _compareAny(dynamic a, dynamic b) → core::int {
throw "unimplemented";
}
- static method sort2<E extends core::Object>(self::C<self::C::sort2::E> a, (self::C::sort2::E, self::C::sort2::E) → core::int compare) → void {
+ static method sort2<E extends core::Object = dynamic>(self::C<self::C::sort2::E> a, (self::C::sort2::E, self::C::sort2::E) → core::int compare) → void {
throw "unimplemented";
}
}
diff --git a/pkg/front_end/testcases/inference/greatest_closure_multiple_params.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/greatest_closure_multiple_params.dart.strong.transformed.expect
index 949aa38..12798a4 100644
--- a/pkg/front_end/testcases/inference/greatest_closure_multiple_params.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/greatest_closure_multiple_params.dart.strong.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-abstract class C<E extends core::Object> extends core::Object {
+abstract class C<E extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
@@ -12,7 +12,7 @@
static method _compareAny(dynamic a, dynamic b) → core::int {
throw "unimplemented";
}
- static method sort2<E extends core::Object>(self::C<self::C::sort2::E> a, (self::C::sort2::E, self::C::sort2::E) → core::int compare) → void {
+ static method sort2<E extends core::Object = dynamic>(self::C<self::C::sort2::E> a, (self::C::sort2::E, self::C::sort2::E) → core::int compare) → void {
throw "unimplemented";
}
}
diff --git a/pkg/front_end/testcases/inference/infer_assign_to_implicit_this.dart.direct.expect b/pkg/front_end/testcases/inference/infer_assign_to_implicit_this.dart.direct.expect
index 2b083f0..c5a8995 100644
--- a/pkg/front_end/testcases/inference/infer_assign_to_implicit_this.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/infer_assign_to_implicit_this.dart.direct.expect
@@ -46,6 +46,6 @@
dynamic v7 = let final dynamic #t2 = this.{self::Test::member} in let final dynamic #t3 = this.{self::Test::member} = #t2.-(1) in #t2;
}
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/infer_assign_to_implicit_this.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/infer_assign_to_implicit_this.dart.direct.transformed.expect
index 2b083f0..c5a8995 100644
--- a/pkg/front_end/testcases/inference/infer_assign_to_implicit_this.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/infer_assign_to_implicit_this.dart.direct.transformed.expect
@@ -46,6 +46,6 @@
dynamic v7 = let final dynamic #t2 = this.{self::Test::member} in let final dynamic #t3 = this.{self::Test::member} = #t2.-(1) in #t2;
}
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/infer_assign_to_implicit_this.dart.outline.expect b/pkg/front_end/testcases/inference/infer_assign_to_implicit_this.dart.outline.expect
index 031084f..ca2db03 100644
--- a/pkg/front_end/testcases/inference/infer_assign_to_implicit_this.dart.outline.expect
+++ b/pkg/front_end/testcases/inference/infer_assign_to_implicit_this.dart.outline.expect
@@ -29,7 +29,7 @@
method test() → void
;
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
;
static method main() → dynamic
;
diff --git a/pkg/front_end/testcases/inference/infer_assign_to_implicit_this.dart.strong.expect b/pkg/front_end/testcases/inference/infer_assign_to_implicit_this.dart.strong.expect
index 9efe1fd..06514fa 100644
--- a/pkg/front_end/testcases/inference/infer_assign_to_implicit_this.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/infer_assign_to_implicit_this.dart.strong.expect
@@ -46,6 +46,6 @@
self::B v7 = let final self::B #t2 = this.{self::Test::member} in let final self::B #t3 = this.{self::Test::member} = #t2.{self::B::-}(1) in #t2;
}
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/infer_assign_to_implicit_this.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/infer_assign_to_implicit_this.dart.strong.transformed.expect
index 9efe1fd..06514fa 100644
--- a/pkg/front_end/testcases/inference/infer_assign_to_implicit_this.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/infer_assign_to_implicit_this.dart.strong.transformed.expect
@@ -46,6 +46,6 @@
self::B v7 = let final self::B #t2 = this.{self::Test::member} in let final self::B #t3 = this.{self::Test::member} = #t2.{self::B::-}(1) in #t2;
}
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/infer_assign_to_index_full.dart.direct.expect b/pkg/front_end/testcases/inference/infer_assign_to_index_full.dart.direct.expect
index 38a2aec..a8ccc13 100644
--- a/pkg/front_end/testcases/inference/infer_assign_to_index_full.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/infer_assign_to_index_full.dart.direct.expect
@@ -54,6 +54,6 @@
dynamic v7 = let final dynamic #t38 = t in let final dynamic #t39 = self::f<dynamic>() in let final dynamic #t40 = #t38.[](#t39) in let final dynamic #t41 = #t38.[]=(#t39, #t40.-(1)) in #t40;
}
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/infer_assign_to_index_full.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/infer_assign_to_index_full.dart.direct.transformed.expect
index 38a2aec..a8ccc13 100644
--- a/pkg/front_end/testcases/inference/infer_assign_to_index_full.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/infer_assign_to_index_full.dart.direct.transformed.expect
@@ -54,6 +54,6 @@
dynamic v7 = let final dynamic #t38 = t in let final dynamic #t39 = self::f<dynamic>() in let final dynamic #t40 = #t38.[](#t39) in let final dynamic #t41 = #t38.[]=(#t39, #t40.-(1)) in #t40;
}
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/infer_assign_to_index_full.dart.outline.expect b/pkg/front_end/testcases/inference/infer_assign_to_index_full.dart.outline.expect
index ff1db0b..8286554 100644
--- a/pkg/front_end/testcases/inference/infer_assign_to_index_full.dart.outline.expect
+++ b/pkg/front_end/testcases/inference/infer_assign_to_index_full.dart.outline.expect
@@ -36,7 +36,7 @@
method test() → void
;
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
;
static method main() → dynamic
;
diff --git a/pkg/front_end/testcases/inference/infer_assign_to_index_full.dart.strong.expect b/pkg/front_end/testcases/inference/infer_assign_to_index_full.dart.strong.expect
index 5675288..62bd534 100644
--- a/pkg/front_end/testcases/inference/infer_assign_to_index_full.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/infer_assign_to_index_full.dart.strong.expect
@@ -54,6 +54,6 @@
self::B v7 = let final self::Test #t38 = t in let final dynamic #t39 = self::f<dynamic>() in let final self::B #t40 = #t38.{self::Test::[]}(#t39 as{TypeError} self::Index) in let final void #t41 = #t38.{self::Test::[]=}(#t39 as{TypeError} self::Index, #t40.{self::B::-}(1)) in #t40;
}
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/infer_assign_to_index_full.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/infer_assign_to_index_full.dart.strong.transformed.expect
index 5675288..62bd534 100644
--- a/pkg/front_end/testcases/inference/infer_assign_to_index_full.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/infer_assign_to_index_full.dart.strong.transformed.expect
@@ -54,6 +54,6 @@
self::B v7 = let final self::Test #t38 = t in let final dynamic #t39 = self::f<dynamic>() in let final self::B #t40 = #t38.{self::Test::[]}(#t39 as{TypeError} self::Index) in let final void #t41 = #t38.{self::Test::[]=}(#t39 as{TypeError} self::Index, #t40.{self::B::-}(1)) in #t40;
}
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/infer_assign_to_index_super.dart.direct.expect b/pkg/front_end/testcases/inference/infer_assign_to_index_super.dart.direct.expect
index d8df616..ed16eaa 100644
--- a/pkg/front_end/testcases/inference/infer_assign_to_index_super.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/infer_assign_to_index_super.dart.direct.expect
@@ -58,6 +58,6 @@
dynamic v7 = let final dynamic #t27 = self::f<dynamic>() in let final dynamic #t28 = super.{self::Base::[]}(#t27) in let final dynamic #t29 = super.{self::Base::[]=}(#t27, #t28.-(1)) in #t28;
}
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/infer_assign_to_index_super.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/infer_assign_to_index_super.dart.direct.transformed.expect
index d8df616..ed16eaa 100644
--- a/pkg/front_end/testcases/inference/infer_assign_to_index_super.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/infer_assign_to_index_super.dart.direct.transformed.expect
@@ -58,6 +58,6 @@
dynamic v7 = let final dynamic #t27 = self::f<dynamic>() in let final dynamic #t28 = super.{self::Base::[]}(#t27) in let final dynamic #t29 = super.{self::Base::[]=}(#t27, #t28.-(1)) in #t28;
}
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/infer_assign_to_index_super.dart.outline.expect b/pkg/front_end/testcases/inference/infer_assign_to_index_super.dart.outline.expect
index 421df3f..1d2a695 100644
--- a/pkg/front_end/testcases/inference/infer_assign_to_index_super.dart.outline.expect
+++ b/pkg/front_end/testcases/inference/infer_assign_to_index_super.dart.outline.expect
@@ -40,7 +40,7 @@
method test() → void
;
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
;
static method main() → dynamic
;
diff --git a/pkg/front_end/testcases/inference/infer_assign_to_index_super.dart.strong.expect b/pkg/front_end/testcases/inference/infer_assign_to_index_super.dart.strong.expect
index 1b1837a..6b4c7fe 100644
--- a/pkg/front_end/testcases/inference/infer_assign_to_index_super.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/infer_assign_to_index_super.dart.strong.expect
@@ -58,6 +58,6 @@
self::B v7 = let final dynamic #t27 = self::f<dynamic>() in let final self::B #t28 = super.{self::Base::[]}(#t27 as{TypeError} self::Index) in let final void #t29 = super.{self::Base::[]=}(#t27 as{TypeError} self::Index, #t28.{self::B::-}(1)) in #t28;
}
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/infer_assign_to_index_super.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/infer_assign_to_index_super.dart.strong.transformed.expect
index 1b1837a..6b4c7fe 100644
--- a/pkg/front_end/testcases/inference/infer_assign_to_index_super.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/infer_assign_to_index_super.dart.strong.transformed.expect
@@ -58,6 +58,6 @@
self::B v7 = let final dynamic #t27 = self::f<dynamic>() in let final self::B #t28 = super.{self::Base::[]}(#t27 as{TypeError} self::Index) in let final void #t29 = super.{self::Base::[]=}(#t27 as{TypeError} self::Index, #t28.{self::B::-}(1)) in #t28;
}
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/infer_assign_to_index_this.dart.direct.expect b/pkg/front_end/testcases/inference/infer_assign_to_index_this.dart.direct.expect
index 80bc52f..ac3de09 100644
--- a/pkg/front_end/testcases/inference/infer_assign_to_index_this.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/infer_assign_to_index_this.dart.direct.expect
@@ -53,6 +53,6 @@
dynamic v7 = let final dynamic #t27 = self::f<dynamic>() in let final dynamic #t28 = this.[](#t27) in let final dynamic #t29 = this.[]=(#t27, #t28.-(1)) in #t28;
}
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/infer_assign_to_index_this.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/infer_assign_to_index_this.dart.direct.transformed.expect
index 80bc52f..ac3de09 100644
--- a/pkg/front_end/testcases/inference/infer_assign_to_index_this.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/infer_assign_to_index_this.dart.direct.transformed.expect
@@ -53,6 +53,6 @@
dynamic v7 = let final dynamic #t27 = self::f<dynamic>() in let final dynamic #t28 = this.[](#t27) in let final dynamic #t29 = this.[]=(#t27, #t28.-(1)) in #t28;
}
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/infer_assign_to_index_this.dart.outline.expect b/pkg/front_end/testcases/inference/infer_assign_to_index_this.dart.outline.expect
index ff1db0b..8286554 100644
--- a/pkg/front_end/testcases/inference/infer_assign_to_index_this.dart.outline.expect
+++ b/pkg/front_end/testcases/inference/infer_assign_to_index_this.dart.outline.expect
@@ -36,7 +36,7 @@
method test() → void
;
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
;
static method main() → dynamic
;
diff --git a/pkg/front_end/testcases/inference/infer_assign_to_index_this.dart.strong.expect b/pkg/front_end/testcases/inference/infer_assign_to_index_this.dart.strong.expect
index 781c625..81add7c 100644
--- a/pkg/front_end/testcases/inference/infer_assign_to_index_this.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/infer_assign_to_index_this.dart.strong.expect
@@ -53,6 +53,6 @@
self::B v7 = let final dynamic #t27 = self::f<dynamic>() in let final self::B #t28 = this.{self::Test::[]}(#t27 as{TypeError} self::Index) in let final void #t29 = this.{self::Test::[]=}(#t27 as{TypeError} self::Index, #t28.{self::B::-}(1)) in #t28;
}
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/infer_assign_to_index_this.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/infer_assign_to_index_this.dart.strong.transformed.expect
index 781c625..81add7c 100644
--- a/pkg/front_end/testcases/inference/infer_assign_to_index_this.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/infer_assign_to_index_this.dart.strong.transformed.expect
@@ -53,6 +53,6 @@
self::B v7 = let final dynamic #t27 = self::f<dynamic>() in let final self::B #t28 = this.{self::Test::[]}(#t27 as{TypeError} self::Index) in let final void #t29 = this.{self::Test::[]=}(#t27 as{TypeError} self::Index, #t28.{self::B::-}(1)) in #t28;
}
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/infer_assign_to_local.dart.direct.expect b/pkg/front_end/testcases/inference/infer_assign_to_local.dart.direct.expect
index 3566c8f..e94bc2f 100644
--- a/pkg/front_end/testcases/inference/infer_assign_to_local.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/infer_assign_to_local.dart.direct.expect
@@ -25,7 +25,7 @@
: super self::B::•()
;
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method test() → void {
self::B local;
diff --git a/pkg/front_end/testcases/inference/infer_assign_to_local.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/infer_assign_to_local.dart.direct.transformed.expect
index 3566c8f..e94bc2f 100644
--- a/pkg/front_end/testcases/inference/infer_assign_to_local.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/infer_assign_to_local.dart.direct.transformed.expect
@@ -25,7 +25,7 @@
: super self::B::•()
;
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method test() → void {
self::B local;
diff --git a/pkg/front_end/testcases/inference/infer_assign_to_local.dart.outline.expect b/pkg/front_end/testcases/inference/infer_assign_to_local.dart.outline.expect
index e4b381c..7db001d 100644
--- a/pkg/front_end/testcases/inference/infer_assign_to_local.dart.outline.expect
+++ b/pkg/front_end/testcases/inference/infer_assign_to_local.dart.outline.expect
@@ -22,7 +22,7 @@
synthetic constructor •() → void
;
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
;
static method test() → void
;
diff --git a/pkg/front_end/testcases/inference/infer_assign_to_local.dart.strong.expect b/pkg/front_end/testcases/inference/infer_assign_to_local.dart.strong.expect
index 22bf885..917a5ff 100644
--- a/pkg/front_end/testcases/inference/infer_assign_to_local.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/infer_assign_to_local.dart.strong.expect
@@ -25,7 +25,7 @@
: super self::B::•()
;
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method test() → void {
self::B local;
diff --git a/pkg/front_end/testcases/inference/infer_assign_to_local.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/infer_assign_to_local.dart.strong.transformed.expect
index 22bf885..917a5ff 100644
--- a/pkg/front_end/testcases/inference/infer_assign_to_local.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/infer_assign_to_local.dart.strong.transformed.expect
@@ -25,7 +25,7 @@
: super self::B::•()
;
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method test() → void {
self::B local;
diff --git a/pkg/front_end/testcases/inference/infer_assign_to_property_full.dart.direct.expect b/pkg/front_end/testcases/inference/infer_assign_to_property_full.dart.direct.expect
index 8dd8737..519248d 100644
--- a/pkg/front_end/testcases/inference/infer_assign_to_property_full.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/infer_assign_to_property_full.dart.direct.expect
@@ -46,6 +46,6 @@
dynamic v7 = let final dynamic #t12 = t in let final dynamic #t13 = #t12.member in let final dynamic #t14 = #t12.member = #t13.-(1) in #t13;
}
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/infer_assign_to_property_full.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/infer_assign_to_property_full.dart.direct.transformed.expect
index 8dd8737..519248d 100644
--- a/pkg/front_end/testcases/inference/infer_assign_to_property_full.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/infer_assign_to_property_full.dart.direct.transformed.expect
@@ -46,6 +46,6 @@
dynamic v7 = let final dynamic #t12 = t in let final dynamic #t13 = #t12.member in let final dynamic #t14 = #t12.member = #t13.-(1) in #t13;
}
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/infer_assign_to_property_full.dart.outline.expect b/pkg/front_end/testcases/inference/infer_assign_to_property_full.dart.outline.expect
index de60c09..c483408 100644
--- a/pkg/front_end/testcases/inference/infer_assign_to_property_full.dart.outline.expect
+++ b/pkg/front_end/testcases/inference/infer_assign_to_property_full.dart.outline.expect
@@ -29,7 +29,7 @@
static method test(self::Test t) → void
;
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
;
static method main() → dynamic
;
diff --git a/pkg/front_end/testcases/inference/infer_assign_to_property_full.dart.strong.expect b/pkg/front_end/testcases/inference/infer_assign_to_property_full.dart.strong.expect
index 69aa5fc..84dd210 100644
--- a/pkg/front_end/testcases/inference/infer_assign_to_property_full.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/infer_assign_to_property_full.dart.strong.expect
@@ -46,6 +46,6 @@
self::B v7 = let final self::Test #t12 = t in let final self::B #t13 = #t12.{self::Test::member} in let final self::B #t14 = #t12.{self::Test::member} = #t13.{self::B::-}(1) in #t13;
}
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/infer_assign_to_property_full.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/infer_assign_to_property_full.dart.strong.transformed.expect
index 69aa5fc..84dd210 100644
--- a/pkg/front_end/testcases/inference/infer_assign_to_property_full.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/infer_assign_to_property_full.dart.strong.transformed.expect
@@ -46,6 +46,6 @@
self::B v7 = let final self::Test #t12 = t in let final self::B #t13 = #t12.{self::Test::member} in let final self::B #t14 = #t12.{self::Test::member} = #t13.{self::B::-}(1) in #t13;
}
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/infer_assign_to_property_null_aware.dart.direct.expect b/pkg/front_end/testcases/inference/infer_assign_to_property_null_aware.dart.direct.expect
index 94d0d64..5513712 100644
--- a/pkg/front_end/testcases/inference/infer_assign_to_property_null_aware.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/infer_assign_to_property_null_aware.dart.direct.expect
@@ -46,6 +46,6 @@
dynamic v7 = let final dynamic #t14 = t in #t14.==(null) ? null : let final dynamic #t15 = #t14.member in let final dynamic #t16 = #t14.member = #t15.-(1) in #t15;
}
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/infer_assign_to_property_null_aware.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/infer_assign_to_property_null_aware.dart.direct.transformed.expect
index 94d0d64..5513712 100644
--- a/pkg/front_end/testcases/inference/infer_assign_to_property_null_aware.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/infer_assign_to_property_null_aware.dart.direct.transformed.expect
@@ -46,6 +46,6 @@
dynamic v7 = let final dynamic #t14 = t in #t14.==(null) ? null : let final dynamic #t15 = #t14.member in let final dynamic #t16 = #t14.member = #t15.-(1) in #t15;
}
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/infer_assign_to_property_null_aware.dart.outline.expect b/pkg/front_end/testcases/inference/infer_assign_to_property_null_aware.dart.outline.expect
index de60c09..c483408 100644
--- a/pkg/front_end/testcases/inference/infer_assign_to_property_null_aware.dart.outline.expect
+++ b/pkg/front_end/testcases/inference/infer_assign_to_property_null_aware.dart.outline.expect
@@ -29,7 +29,7 @@
static method test(self::Test t) → void
;
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
;
static method main() → dynamic
;
diff --git a/pkg/front_end/testcases/inference/infer_assign_to_property_null_aware.dart.strong.expect b/pkg/front_end/testcases/inference/infer_assign_to_property_null_aware.dart.strong.expect
index 941a4b2..abecc5d 100644
--- a/pkg/front_end/testcases/inference/infer_assign_to_property_null_aware.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/infer_assign_to_property_null_aware.dart.strong.expect
@@ -46,6 +46,6 @@
self::B v7 = let final self::Test #t14 = t in #t14.==(null) ?{self::B} null : let final self::B #t15 = #t14.{self::Test::member} in let final self::B #t16 = #t14.{self::Test::member} = #t15.{self::B::-}(1) in #t15;
}
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/infer_assign_to_property_null_aware.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/infer_assign_to_property_null_aware.dart.strong.transformed.expect
index 941a4b2..abecc5d 100644
--- a/pkg/front_end/testcases/inference/infer_assign_to_property_null_aware.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/infer_assign_to_property_null_aware.dart.strong.transformed.expect
@@ -46,6 +46,6 @@
self::B v7 = let final self::Test #t14 = t in #t14.==(null) ?{self::B} null : let final self::B #t15 = #t14.{self::Test::member} in let final self::B #t16 = #t14.{self::Test::member} = #t15.{self::B::-}(1) in #t15;
}
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/infer_assign_to_property_super.dart.direct.expect b/pkg/front_end/testcases/inference/infer_assign_to_property_super.dart.direct.expect
index 9f3a3bf..a4ec9d8 100644
--- a/pkg/front_end/testcases/inference/infer_assign_to_property_super.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/infer_assign_to_property_super.dart.direct.expect
@@ -51,6 +51,6 @@
dynamic v7 = let final dynamic #t2 = super.{self::Base::member} in let final dynamic #t3 = super.{self::Base::member} = #t2.-(1) in #t2;
}
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/infer_assign_to_property_super.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/infer_assign_to_property_super.dart.direct.transformed.expect
index 9f3a3bf..a4ec9d8 100644
--- a/pkg/front_end/testcases/inference/infer_assign_to_property_super.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/infer_assign_to_property_super.dart.direct.transformed.expect
@@ -51,6 +51,6 @@
dynamic v7 = let final dynamic #t2 = super.{self::Base::member} in let final dynamic #t3 = super.{self::Base::member} = #t2.-(1) in #t2;
}
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/infer_assign_to_property_super.dart.outline.expect b/pkg/front_end/testcases/inference/infer_assign_to_property_super.dart.outline.expect
index 077e4d6..8aa62bc 100644
--- a/pkg/front_end/testcases/inference/infer_assign_to_property_super.dart.outline.expect
+++ b/pkg/front_end/testcases/inference/infer_assign_to_property_super.dart.outline.expect
@@ -33,7 +33,7 @@
method test() → void
;
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
;
static method main() → dynamic
;
diff --git a/pkg/front_end/testcases/inference/infer_assign_to_property_super.dart.strong.expect b/pkg/front_end/testcases/inference/infer_assign_to_property_super.dart.strong.expect
index 65a0233..609bc691 100644
--- a/pkg/front_end/testcases/inference/infer_assign_to_property_super.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/infer_assign_to_property_super.dart.strong.expect
@@ -51,6 +51,6 @@
self::B v7 = let final self::B #t2 = super.{self::Base::member} in let final self::B #t3 = super.{self::Base::member} = #t2.{self::B::-}(1) in #t2;
}
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/infer_assign_to_property_super.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/infer_assign_to_property_super.dart.strong.transformed.expect
index 65a0233..609bc691 100644
--- a/pkg/front_end/testcases/inference/infer_assign_to_property_super.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/infer_assign_to_property_super.dart.strong.transformed.expect
@@ -51,6 +51,6 @@
self::B v7 = let final self::B #t2 = super.{self::Base::member} in let final self::B #t3 = super.{self::Base::member} = #t2.{self::B::-}(1) in #t2;
}
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/infer_assign_to_static.dart.direct.expect b/pkg/front_end/testcases/inference/infer_assign_to_static.dart.direct.expect
index f3c9f8d..02325a0 100644
--- a/pkg/front_end/testcases/inference/infer_assign_to_static.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/infer_assign_to_static.dart.direct.expect
@@ -27,7 +27,7 @@
;
}
static field self::B topLevelVariable;
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method test_topLevelVariable() → void {
self::topLevelVariable = self::f<dynamic>();
diff --git a/pkg/front_end/testcases/inference/infer_assign_to_static.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/infer_assign_to_static.dart.direct.transformed.expect
index f3c9f8d..02325a0 100644
--- a/pkg/front_end/testcases/inference/infer_assign_to_static.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/infer_assign_to_static.dart.direct.transformed.expect
@@ -27,7 +27,7 @@
;
}
static field self::B topLevelVariable;
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method test_topLevelVariable() → void {
self::topLevelVariable = self::f<dynamic>();
diff --git a/pkg/front_end/testcases/inference/infer_assign_to_static.dart.outline.expect b/pkg/front_end/testcases/inference/infer_assign_to_static.dart.outline.expect
index e348b03..dca7f38 100644
--- a/pkg/front_end/testcases/inference/infer_assign_to_static.dart.outline.expect
+++ b/pkg/front_end/testcases/inference/infer_assign_to_static.dart.outline.expect
@@ -24,7 +24,7 @@
;
}
static field self::B topLevelVariable;
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
;
static method test_topLevelVariable() → void
;
diff --git a/pkg/front_end/testcases/inference/infer_assign_to_static.dart.strong.expect b/pkg/front_end/testcases/inference/infer_assign_to_static.dart.strong.expect
index e66e6c8..5199214 100644
--- a/pkg/front_end/testcases/inference/infer_assign_to_static.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/infer_assign_to_static.dart.strong.expect
@@ -27,7 +27,7 @@
;
}
static field self::B topLevelVariable;
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method test_topLevelVariable() → void {
self::topLevelVariable = self::f<self::B>();
diff --git a/pkg/front_end/testcases/inference/infer_assign_to_static.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/infer_assign_to_static.dart.strong.transformed.expect
index e66e6c8..5199214 100644
--- a/pkg/front_end/testcases/inference/infer_assign_to_static.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/infer_assign_to_static.dart.strong.transformed.expect
@@ -27,7 +27,7 @@
;
}
static field self::B topLevelVariable;
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method test_topLevelVariable() → void {
self::topLevelVariable = self::f<self::B>();
diff --git a/pkg/front_end/testcases/inference/infer_field_override_with_substitution.dart.direct.expect b/pkg/front_end/testcases/inference/infer_field_override_with_substitution.dart.direct.expect
index de0ee9c..d80578b 100644
--- a/pkg/front_end/testcases/inference/infer_field_override_with_substitution.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/infer_field_override_with_substitution.dart.direct.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-abstract class A<T extends core::Object> extends core::Object {
+abstract class A<T extends core::Object = dynamic> extends core::Object {
field core::List<self::A::T> z = null;
synthetic constructor •() → void
: super core::Object::•()
diff --git a/pkg/front_end/testcases/inference/infer_field_override_with_substitution.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/infer_field_override_with_substitution.dart.direct.transformed.expect
index de0ee9c..d80578b 100644
--- a/pkg/front_end/testcases/inference/infer_field_override_with_substitution.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/infer_field_override_with_substitution.dart.direct.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-abstract class A<T extends core::Object> extends core::Object {
+abstract class A<T extends core::Object = dynamic> extends core::Object {
field core::List<self::A::T> z = null;
synthetic constructor •() → void
: super core::Object::•()
diff --git a/pkg/front_end/testcases/inference/infer_field_override_with_substitution.dart.outline.expect b/pkg/front_end/testcases/inference/infer_field_override_with_substitution.dart.outline.expect
index 1d6e2bc..bb96bee 100644
--- a/pkg/front_end/testcases/inference/infer_field_override_with_substitution.dart.outline.expect
+++ b/pkg/front_end/testcases/inference/infer_field_override_with_substitution.dart.outline.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-abstract class A<T extends core::Object> extends core::Object {
+abstract class A<T extends core::Object = dynamic> extends core::Object {
field core::List<self::A::T> z;
synthetic constructor •() → void
;
diff --git a/pkg/front_end/testcases/inference/infer_field_override_with_substitution.dart.strong.expect b/pkg/front_end/testcases/inference/infer_field_override_with_substitution.dart.strong.expect
index e1b8859..3139312 100644
--- a/pkg/front_end/testcases/inference/infer_field_override_with_substitution.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/infer_field_override_with_substitution.dart.strong.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-abstract class A<T extends core::Object> extends core::Object {
+abstract class A<T extends core::Object = dynamic> extends core::Object {
generic-covariant-impl generic-covariant-interface field core::List<self::A::T> z = null;
synthetic constructor •() → void
: super core::Object::•()
diff --git a/pkg/front_end/testcases/inference/infer_field_override_with_substitution.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/infer_field_override_with_substitution.dart.strong.transformed.expect
index e1b8859..3139312 100644
--- a/pkg/front_end/testcases/inference/infer_field_override_with_substitution.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/infer_field_override_with_substitution.dart.strong.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-abstract class A<T extends core::Object> extends core::Object {
+abstract class A<T extends core::Object = dynamic> extends core::Object {
generic-covariant-impl generic-covariant-interface field core::List<self::A::T> z = null;
synthetic constructor •() → void
: super core::Object::•()
diff --git a/pkg/front_end/testcases/inference/infer_generic_method_type_named.dart.direct.expect b/pkg/front_end/testcases/inference/infer_generic_method_type_named.dart.direct.expect
index 79ae48f..4b95c54 100644
--- a/pkg/front_end/testcases/inference/infer_generic_method_type_named.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/infer_generic_method_type_named.dart.direct.expect
@@ -6,7 +6,7 @@
synthetic constructor •() → void
: super core::Object::•()
;
- method m<T extends core::Object>(core::int a, {core::String b = null, self::C::m::T c = null}) → self::C::m::T
+ method m<T extends core::Object = dynamic>(core::int a, {core::String b = null, self::C::m::T c = null}) → self::C::m::T
return null;
}
static method main() → dynamic {
diff --git a/pkg/front_end/testcases/inference/infer_generic_method_type_named.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/infer_generic_method_type_named.dart.direct.transformed.expect
index 79ae48f..4b95c54 100644
--- a/pkg/front_end/testcases/inference/infer_generic_method_type_named.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/infer_generic_method_type_named.dart.direct.transformed.expect
@@ -6,7 +6,7 @@
synthetic constructor •() → void
: super core::Object::•()
;
- method m<T extends core::Object>(core::int a, {core::String b = null, self::C::m::T c = null}) → self::C::m::T
+ method m<T extends core::Object = dynamic>(core::int a, {core::String b = null, self::C::m::T c = null}) → self::C::m::T
return null;
}
static method main() → dynamic {
diff --git a/pkg/front_end/testcases/inference/infer_generic_method_type_named.dart.strong.expect b/pkg/front_end/testcases/inference/infer_generic_method_type_named.dart.strong.expect
index 3e03634..bd07f13 100644
--- a/pkg/front_end/testcases/inference/infer_generic_method_type_named.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/infer_generic_method_type_named.dart.strong.expect
@@ -6,7 +6,7 @@
synthetic constructor •() → void
: super core::Object::•()
;
- method m<T extends core::Object>(core::int a, {core::String b = null, self::C::m::T c = null}) → self::C::m::T
+ method m<T extends core::Object = dynamic>(core::int a, {core::String b = null, self::C::m::T c = null}) → self::C::m::T
return null;
}
static method main() → dynamic {
diff --git a/pkg/front_end/testcases/inference/infer_generic_method_type_named.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/infer_generic_method_type_named.dart.strong.transformed.expect
index 3e03634..bd07f13 100644
--- a/pkg/front_end/testcases/inference/infer_generic_method_type_named.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/infer_generic_method_type_named.dart.strong.transformed.expect
@@ -6,7 +6,7 @@
synthetic constructor •() → void
: super core::Object::•()
;
- method m<T extends core::Object>(core::int a, {core::String b = null, self::C::m::T c = null}) → self::C::m::T
+ method m<T extends core::Object = dynamic>(core::int a, {core::String b = null, self::C::m::T c = null}) → self::C::m::T
return null;
}
static method main() → dynamic {
diff --git a/pkg/front_end/testcases/inference/infer_generic_method_type_positional.dart.direct.expect b/pkg/front_end/testcases/inference/infer_generic_method_type_positional.dart.direct.expect
index b3f2fc0..2641064 100644
--- a/pkg/front_end/testcases/inference/infer_generic_method_type_positional.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/infer_generic_method_type_positional.dart.direct.expect
@@ -6,7 +6,7 @@
synthetic constructor •() → void
: super core::Object::•()
;
- method m<T extends core::Object>(core::int a, [self::C::m::T b = null]) → self::C::m::T
+ method m<T extends core::Object = dynamic>(core::int a, [self::C::m::T b = null]) → self::C::m::T
return null;
}
static method main() → dynamic {
diff --git a/pkg/front_end/testcases/inference/infer_generic_method_type_positional.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/infer_generic_method_type_positional.dart.direct.transformed.expect
index b3f2fc0..2641064 100644
--- a/pkg/front_end/testcases/inference/infer_generic_method_type_positional.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/infer_generic_method_type_positional.dart.direct.transformed.expect
@@ -6,7 +6,7 @@
synthetic constructor •() → void
: super core::Object::•()
;
- method m<T extends core::Object>(core::int a, [self::C::m::T b = null]) → self::C::m::T
+ method m<T extends core::Object = dynamic>(core::int a, [self::C::m::T b = null]) → self::C::m::T
return null;
}
static method main() → dynamic {
diff --git a/pkg/front_end/testcases/inference/infer_generic_method_type_positional.dart.strong.expect b/pkg/front_end/testcases/inference/infer_generic_method_type_positional.dart.strong.expect
index 7f57027..58dcecf 100644
--- a/pkg/front_end/testcases/inference/infer_generic_method_type_positional.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/infer_generic_method_type_positional.dart.strong.expect
@@ -6,7 +6,7 @@
synthetic constructor •() → void
: super core::Object::•()
;
- method m<T extends core::Object>(core::int a, [self::C::m::T b = null]) → self::C::m::T
+ method m<T extends core::Object = dynamic>(core::int a, [self::C::m::T b = null]) → self::C::m::T
return null;
}
static method main() → dynamic {
diff --git a/pkg/front_end/testcases/inference/infer_generic_method_type_positional.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/infer_generic_method_type_positional.dart.strong.transformed.expect
index 7f57027..58dcecf 100644
--- a/pkg/front_end/testcases/inference/infer_generic_method_type_positional.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/infer_generic_method_type_positional.dart.strong.transformed.expect
@@ -6,7 +6,7 @@
synthetic constructor •() → void
: super core::Object::•()
;
- method m<T extends core::Object>(core::int a, [self::C::m::T b = null]) → self::C::m::T
+ method m<T extends core::Object = dynamic>(core::int a, [self::C::m::T b = null]) → self::C::m::T
return null;
}
static method main() → dynamic {
diff --git a/pkg/front_end/testcases/inference/infer_generic_method_type_positional2.dart.direct.expect b/pkg/front_end/testcases/inference/infer_generic_method_type_positional2.dart.direct.expect
index c4ff57c..e4e7bd1 100644
--- a/pkg/front_end/testcases/inference/infer_generic_method_type_positional2.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/infer_generic_method_type_positional2.dart.direct.expect
@@ -6,7 +6,7 @@
synthetic constructor •() → void
: super core::Object::•()
;
- method m<T extends core::Object>(core::int a, [core::String b = null, self::C::m::T c = null]) → self::C::m::T
+ method m<T extends core::Object = dynamic>(core::int a, [core::String b = null, self::C::m::T c = null]) → self::C::m::T
return null;
}
static method main() → dynamic {
diff --git a/pkg/front_end/testcases/inference/infer_generic_method_type_positional2.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/infer_generic_method_type_positional2.dart.direct.transformed.expect
index c4ff57c..e4e7bd1 100644
--- a/pkg/front_end/testcases/inference/infer_generic_method_type_positional2.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/infer_generic_method_type_positional2.dart.direct.transformed.expect
@@ -6,7 +6,7 @@
synthetic constructor •() → void
: super core::Object::•()
;
- method m<T extends core::Object>(core::int a, [core::String b = null, self::C::m::T c = null]) → self::C::m::T
+ method m<T extends core::Object = dynamic>(core::int a, [core::String b = null, self::C::m::T c = null]) → self::C::m::T
return null;
}
static method main() → dynamic {
diff --git a/pkg/front_end/testcases/inference/infer_generic_method_type_positional2.dart.strong.expect b/pkg/front_end/testcases/inference/infer_generic_method_type_positional2.dart.strong.expect
index 4b84fa0..10a9999 100644
--- a/pkg/front_end/testcases/inference/infer_generic_method_type_positional2.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/infer_generic_method_type_positional2.dart.strong.expect
@@ -6,7 +6,7 @@
synthetic constructor •() → void
: super core::Object::•()
;
- method m<T extends core::Object>(core::int a, [core::String b = null, self::C::m::T c = null]) → self::C::m::T
+ method m<T extends core::Object = dynamic>(core::int a, [core::String b = null, self::C::m::T c = null]) → self::C::m::T
return null;
}
static method main() → dynamic {
diff --git a/pkg/front_end/testcases/inference/infer_generic_method_type_positional2.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/infer_generic_method_type_positional2.dart.strong.transformed.expect
index 4b84fa0..10a9999 100644
--- a/pkg/front_end/testcases/inference/infer_generic_method_type_positional2.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/infer_generic_method_type_positional2.dart.strong.transformed.expect
@@ -6,7 +6,7 @@
synthetic constructor •() → void
: super core::Object::•()
;
- method m<T extends core::Object>(core::int a, [core::String b = null, self::C::m::T c = null]) → self::C::m::T
+ method m<T extends core::Object = dynamic>(core::int a, [core::String b = null, self::C::m::T c = null]) → self::C::m::T
return null;
}
static method main() → dynamic {
diff --git a/pkg/front_end/testcases/inference/infer_generic_method_type_required.dart.direct.expect b/pkg/front_end/testcases/inference/infer_generic_method_type_required.dart.direct.expect
index c9998b1..bfa9057 100644
--- a/pkg/front_end/testcases/inference/infer_generic_method_type_required.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/infer_generic_method_type_required.dart.direct.expect
@@ -6,7 +6,7 @@
synthetic constructor •() → void
: super core::Object::•()
;
- method m<T extends core::Object>(self::C::m::T x) → self::C::m::T
+ method m<T extends core::Object = dynamic>(self::C::m::T x) → self::C::m::T
return x;
}
static method main() → dynamic {
diff --git a/pkg/front_end/testcases/inference/infer_generic_method_type_required.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/infer_generic_method_type_required.dart.direct.transformed.expect
index c9998b1..bfa9057 100644
--- a/pkg/front_end/testcases/inference/infer_generic_method_type_required.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/infer_generic_method_type_required.dart.direct.transformed.expect
@@ -6,7 +6,7 @@
synthetic constructor •() → void
: super core::Object::•()
;
- method m<T extends core::Object>(self::C::m::T x) → self::C::m::T
+ method m<T extends core::Object = dynamic>(self::C::m::T x) → self::C::m::T
return x;
}
static method main() → dynamic {
diff --git a/pkg/front_end/testcases/inference/infer_generic_method_type_required.dart.strong.expect b/pkg/front_end/testcases/inference/infer_generic_method_type_required.dart.strong.expect
index 1d672d3..da75fda 100644
--- a/pkg/front_end/testcases/inference/infer_generic_method_type_required.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/infer_generic_method_type_required.dart.strong.expect
@@ -6,7 +6,7 @@
synthetic constructor •() → void
: super core::Object::•()
;
- method m<T extends core::Object>(self::C::m::T x) → self::C::m::T
+ method m<T extends core::Object = dynamic>(self::C::m::T x) → self::C::m::T
return x;
}
static method main() → dynamic {
diff --git a/pkg/front_end/testcases/inference/infer_generic_method_type_required.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/infer_generic_method_type_required.dart.strong.transformed.expect
index 1d672d3..da75fda 100644
--- a/pkg/front_end/testcases/inference/infer_generic_method_type_required.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/infer_generic_method_type_required.dart.strong.transformed.expect
@@ -6,7 +6,7 @@
synthetic constructor •() → void
: super core::Object::•()
;
- method m<T extends core::Object>(self::C::m::T x) → self::C::m::T
+ method m<T extends core::Object = dynamic>(self::C::m::T x) → self::C::m::T
return x;
}
static method main() → dynamic {
diff --git a/pkg/front_end/testcases/inference/infer_list_literal_nested_in_map_literal.dart.direct.expect b/pkg/front_end/testcases/inference/infer_list_literal_nested_in_map_literal.dart.direct.expect
index 3ae0ee0..3fc4e1c 100644
--- a/pkg/front_end/testcases/inference/infer_list_literal_nested_in_map_literal.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/infer_list_literal_nested_in_map_literal.dart.direct.expect
@@ -12,7 +12,7 @@
: super self::Resource::•()
;
}
-class Foo<T extends core::Object> extends core::Object {
+class Foo<T extends core::Object = dynamic> extends core::Object {
constructor •(self::Foo::T t) → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/inference/infer_list_literal_nested_in_map_literal.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/infer_list_literal_nested_in_map_literal.dart.direct.transformed.expect
index 3ae0ee0..3fc4e1c 100644
--- a/pkg/front_end/testcases/inference/infer_list_literal_nested_in_map_literal.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/infer_list_literal_nested_in_map_literal.dart.direct.transformed.expect
@@ -12,7 +12,7 @@
: super self::Resource::•()
;
}
-class Foo<T extends core::Object> extends core::Object {
+class Foo<T extends core::Object = dynamic> extends core::Object {
constructor •(self::Foo::T t) → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/inference/infer_list_literal_nested_in_map_literal.dart.strong.expect b/pkg/front_end/testcases/inference/infer_list_literal_nested_in_map_literal.dart.strong.expect
index 61a99de..517d849 100644
--- a/pkg/front_end/testcases/inference/infer_list_literal_nested_in_map_literal.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/infer_list_literal_nested_in_map_literal.dart.strong.expect
@@ -12,7 +12,7 @@
: super self::Resource::•()
;
}
-class Foo<T extends core::Object> extends core::Object {
+class Foo<T extends core::Object = dynamic> extends core::Object {
constructor •(self::Foo::T t) → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/inference/infer_list_literal_nested_in_map_literal.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/infer_list_literal_nested_in_map_literal.dart.strong.transformed.expect
index 61a99de..517d849 100644
--- a/pkg/front_end/testcases/inference/infer_list_literal_nested_in_map_literal.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/infer_list_literal_nested_in_map_literal.dart.strong.transformed.expect
@@ -12,7 +12,7 @@
: super self::Resource::•()
;
}
-class Foo<T extends core::Object> extends core::Object {
+class Foo<T extends core::Object = dynamic> extends core::Object {
constructor •(self::Foo::T t) → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/inference/infer_method_function_typed.dart.direct.expect b/pkg/front_end/testcases/inference/infer_method_function_typed.dart.direct.expect
index cb7e421..d4ee51b 100644
--- a/pkg/front_end/testcases/inference/infer_method_function_typed.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/infer_method_function_typed.dart.direct.expect
@@ -15,7 +15,7 @@
;
abstract method x(() → dynamic value) → void;
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method g(self::B b) → dynamic {
b.x(self::f<dynamic>());
diff --git a/pkg/front_end/testcases/inference/infer_method_function_typed.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/infer_method_function_typed.dart.direct.transformed.expect
index cb7e421..d4ee51b 100644
--- a/pkg/front_end/testcases/inference/infer_method_function_typed.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/infer_method_function_typed.dart.direct.transformed.expect
@@ -15,7 +15,7 @@
;
abstract method x(() → dynamic value) → void;
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method g(self::B b) → dynamic {
b.x(self::f<dynamic>());
diff --git a/pkg/front_end/testcases/inference/infer_method_function_typed.dart.outline.expect b/pkg/front_end/testcases/inference/infer_method_function_typed.dart.outline.expect
index 00d3cbe..4ee1701 100644
--- a/pkg/front_end/testcases/inference/infer_method_function_typed.dart.outline.expect
+++ b/pkg/front_end/testcases/inference/infer_method_function_typed.dart.outline.expect
@@ -13,7 +13,7 @@
;
abstract method x(() → dynamic value) → void;
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
;
static method g(self::B b) → dynamic
;
diff --git a/pkg/front_end/testcases/inference/infer_method_function_typed.dart.strong.expect b/pkg/front_end/testcases/inference/infer_method_function_typed.dart.strong.expect
index f0e5701..dd7fcd8 100644
--- a/pkg/front_end/testcases/inference/infer_method_function_typed.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/infer_method_function_typed.dart.strong.expect
@@ -15,7 +15,7 @@
;
abstract method x(() → dynamic value) → void;
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method g(self::B b) → dynamic {
b.{self::B::x}(self::f<() → dynamic>());
diff --git a/pkg/front_end/testcases/inference/infer_method_function_typed.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/infer_method_function_typed.dart.strong.transformed.expect
index f0e5701..dd7fcd8 100644
--- a/pkg/front_end/testcases/inference/infer_method_function_typed.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/infer_method_function_typed.dart.strong.transformed.expect
@@ -15,7 +15,7 @@
;
abstract method x(() → dynamic value) → void;
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method g(self::B b) → dynamic {
b.{self::B::x}(self::f<() → dynamic>());
diff --git a/pkg/front_end/testcases/inference/infer_setter_function_typed.dart.direct.expect b/pkg/front_end/testcases/inference/infer_setter_function_typed.dart.direct.expect
index d15047a..ddb9de6 100644
--- a/pkg/front_end/testcases/inference/infer_setter_function_typed.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/infer_setter_function_typed.dart.direct.expect
@@ -15,7 +15,7 @@
;
abstract set x(() → dynamic value) → void;
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method g(self::B b) → dynamic {
b.x = self::f<dynamic>();
diff --git a/pkg/front_end/testcases/inference/infer_setter_function_typed.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/infer_setter_function_typed.dart.direct.transformed.expect
index d15047a..ddb9de6 100644
--- a/pkg/front_end/testcases/inference/infer_setter_function_typed.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/infer_setter_function_typed.dart.direct.transformed.expect
@@ -15,7 +15,7 @@
;
abstract set x(() → dynamic value) → void;
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method g(self::B b) → dynamic {
b.x = self::f<dynamic>();
diff --git a/pkg/front_end/testcases/inference/infer_setter_function_typed.dart.outline.expect b/pkg/front_end/testcases/inference/infer_setter_function_typed.dart.outline.expect
index f550eb1..e8bf885 100644
--- a/pkg/front_end/testcases/inference/infer_setter_function_typed.dart.outline.expect
+++ b/pkg/front_end/testcases/inference/infer_setter_function_typed.dart.outline.expect
@@ -13,7 +13,7 @@
;
abstract set x(() → dynamic value) → void;
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
;
static method g(self::B b) → dynamic
;
diff --git a/pkg/front_end/testcases/inference/infer_setter_function_typed.dart.strong.expect b/pkg/front_end/testcases/inference/infer_setter_function_typed.dart.strong.expect
index dafd372..d9e3fdf 100644
--- a/pkg/front_end/testcases/inference/infer_setter_function_typed.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/infer_setter_function_typed.dart.strong.expect
@@ -15,7 +15,7 @@
;
abstract set x(() → dynamic value) → void;
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method g(self::B b) → dynamic {
b.{self::B::x} = self::f<() → dynamic>();
diff --git a/pkg/front_end/testcases/inference/infer_setter_function_typed.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/infer_setter_function_typed.dart.strong.transformed.expect
index dafd372..d9e3fdf 100644
--- a/pkg/front_end/testcases/inference/infer_setter_function_typed.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/infer_setter_function_typed.dart.strong.transformed.expect
@@ -15,7 +15,7 @@
;
abstract set x(() → dynamic value) → void;
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method g(self::B b) → dynamic {
b.{self::B::x} = self::f<() → dynamic>();
diff --git a/pkg/front_end/testcases/inference/infer_throw_downwards.dart.direct.expect b/pkg/front_end/testcases/inference/infer_throw_downwards.dart.direct.expect
index 7e9227c..0964033 100644
--- a/pkg/front_end/testcases/inference/infer_throw_downwards.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/infer_throw_downwards.dart.direct.expect
@@ -3,7 +3,7 @@
import "dart:core" as core;
static field dynamic x = throw self::f<dynamic>();
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method g() → void {
dynamic x = throw self::f<dynamic>();
diff --git a/pkg/front_end/testcases/inference/infer_throw_downwards.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/infer_throw_downwards.dart.direct.transformed.expect
index 7e9227c..0964033 100644
--- a/pkg/front_end/testcases/inference/infer_throw_downwards.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/infer_throw_downwards.dart.direct.transformed.expect
@@ -3,7 +3,7 @@
import "dart:core" as core;
static field dynamic x = throw self::f<dynamic>();
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method g() → void {
dynamic x = throw self::f<dynamic>();
diff --git a/pkg/front_end/testcases/inference/infer_throw_downwards.dart.outline.expect b/pkg/front_end/testcases/inference/infer_throw_downwards.dart.outline.expect
index 8e0e7e2..61ee50c 100644
--- a/pkg/front_end/testcases/inference/infer_throw_downwards.dart.outline.expect
+++ b/pkg/front_end/testcases/inference/infer_throw_downwards.dart.outline.expect
@@ -3,7 +3,7 @@
import "dart:core" as core;
static field dynamic x;
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
;
static method g() → void
;
diff --git a/pkg/front_end/testcases/inference/infer_throw_downwards.dart.strong.expect b/pkg/front_end/testcases/inference/infer_throw_downwards.dart.strong.expect
index 7e9227c..0964033 100644
--- a/pkg/front_end/testcases/inference/infer_throw_downwards.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/infer_throw_downwards.dart.strong.expect
@@ -3,7 +3,7 @@
import "dart:core" as core;
static field dynamic x = throw self::f<dynamic>();
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method g() → void {
dynamic x = throw self::f<dynamic>();
diff --git a/pkg/front_end/testcases/inference/infer_throw_downwards.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/infer_throw_downwards.dart.strong.transformed.expect
index 7e9227c..0964033 100644
--- a/pkg/front_end/testcases/inference/infer_throw_downwards.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/infer_throw_downwards.dart.strong.transformed.expect
@@ -3,7 +3,7 @@
import "dart:core" as core;
static field dynamic x = throw self::f<dynamic>();
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method g() → void {
dynamic x = throw self::f<dynamic>();
diff --git a/pkg/front_end/testcases/inference/infer_types_on_generic_instantiations_3.dart.direct.expect b/pkg/front_end/testcases/inference/infer_types_on_generic_instantiations_3.dart.direct.expect
index cb1b1b6..10fb95d 100644
--- a/pkg/front_end/testcases/inference/infer_types_on_generic_instantiations_3.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/infer_types_on_generic_instantiations_3.dart.direct.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class A<T extends core::Object> extends core::Object {
+class A<T extends core::Object = dynamic> extends core::Object {
final field self::A::T x = null;
final field self::A::T w = null;
synthetic constructor •() → void
diff --git a/pkg/front_end/testcases/inference/infer_types_on_generic_instantiations_3.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/infer_types_on_generic_instantiations_3.dart.direct.transformed.expect
index cb1b1b6..10fb95d 100644
--- a/pkg/front_end/testcases/inference/infer_types_on_generic_instantiations_3.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/infer_types_on_generic_instantiations_3.dart.direct.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class A<T extends core::Object> extends core::Object {
+class A<T extends core::Object = dynamic> extends core::Object {
final field self::A::T x = null;
final field self::A::T w = null;
synthetic constructor •() → void
diff --git a/pkg/front_end/testcases/inference/infer_types_on_generic_instantiations_3.dart.strong.expect b/pkg/front_end/testcases/inference/infer_types_on_generic_instantiations_3.dart.strong.expect
index f6f271d..680dc9c 100644
--- a/pkg/front_end/testcases/inference/infer_types_on_generic_instantiations_3.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/infer_types_on_generic_instantiations_3.dart.strong.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class A<T extends core::Object> extends core::Object {
+class A<T extends core::Object = dynamic> extends core::Object {
final field self::A::T x = null;
final field self::A::T w = null;
synthetic constructor •() → void
diff --git a/pkg/front_end/testcases/inference/infer_types_on_generic_instantiations_3.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/infer_types_on_generic_instantiations_3.dart.strong.transformed.expect
index b41ed11..cecd7ae 100644
--- a/pkg/front_end/testcases/inference/infer_types_on_generic_instantiations_3.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/infer_types_on_generic_instantiations_3.dart.strong.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class A<T extends core::Object> extends core::Object {
+class A<T extends core::Object = dynamic> extends core::Object {
final field self::A::T x = null;
final field self::A::T w = null;
synthetic constructor •() → void
diff --git a/pkg/front_end/testcases/inference/infer_types_on_generic_instantiations_4.dart.direct.expect b/pkg/front_end/testcases/inference/infer_types_on_generic_instantiations_4.dart.direct.expect
index 3aa3a9c..b834ab4 100644
--- a/pkg/front_end/testcases/inference/infer_types_on_generic_instantiations_4.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/infer_types_on_generic_instantiations_4.dart.direct.expect
@@ -2,13 +2,13 @@
import self as self;
import "dart:core" as core;
-class A<T extends core::Object> extends core::Object {
+class A<T extends core::Object = dynamic> extends core::Object {
field self::A::T x = null;
synthetic constructor •() → void
: super core::Object::•()
;
}
-class B<E extends core::Object> extends self::A<self::B::E> {
+class B<E extends core::Object = dynamic> extends self::A<self::B::E> {
field self::B::E y = null;
synthetic constructor •() → void
: super self::A::•()
diff --git a/pkg/front_end/testcases/inference/infer_types_on_generic_instantiations_4.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/infer_types_on_generic_instantiations_4.dart.direct.transformed.expect
index 3aa3a9c..b834ab4 100644
--- a/pkg/front_end/testcases/inference/infer_types_on_generic_instantiations_4.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/infer_types_on_generic_instantiations_4.dart.direct.transformed.expect
@@ -2,13 +2,13 @@
import self as self;
import "dart:core" as core;
-class A<T extends core::Object> extends core::Object {
+class A<T extends core::Object = dynamic> extends core::Object {
field self::A::T x = null;
synthetic constructor •() → void
: super core::Object::•()
;
}
-class B<E extends core::Object> extends self::A<self::B::E> {
+class B<E extends core::Object = dynamic> extends self::A<self::B::E> {
field self::B::E y = null;
synthetic constructor •() → void
: super self::A::•()
diff --git a/pkg/front_end/testcases/inference/infer_types_on_generic_instantiations_4.dart.strong.expect b/pkg/front_end/testcases/inference/infer_types_on_generic_instantiations_4.dart.strong.expect
index 870f4ed..df2a21a 100644
--- a/pkg/front_end/testcases/inference/infer_types_on_generic_instantiations_4.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/infer_types_on_generic_instantiations_4.dart.strong.expect
@@ -2,13 +2,13 @@
import self as self;
import "dart:core" as core;
-class A<T extends core::Object> extends core::Object {
+class A<T extends core::Object = dynamic> extends core::Object {
generic-covariant-impl generic-covariant-interface field self::A::T x = null;
synthetic constructor •() → void
: super core::Object::•()
;
}
-class B<E extends core::Object> extends self::A<self::B::E> {
+class B<E extends core::Object = dynamic> extends self::A<self::B::E> {
generic-covariant-impl generic-covariant-interface field self::B::E y = null;
synthetic constructor •() → void
: super self::A::•()
diff --git a/pkg/front_end/testcases/inference/infer_types_on_generic_instantiations_4.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/infer_types_on_generic_instantiations_4.dart.strong.transformed.expect
index 30e1bb6..06e2b22 100644
--- a/pkg/front_end/testcases/inference/infer_types_on_generic_instantiations_4.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/infer_types_on_generic_instantiations_4.dart.strong.transformed.expect
@@ -2,13 +2,13 @@
import self as self;
import "dart:core" as core;
-class A<T extends core::Object> extends core::Object {
+class A<T extends core::Object = dynamic> extends core::Object {
generic-covariant-impl generic-covariant-interface field self::A::T x = null;
synthetic constructor •() → void
: super core::Object::•()
;
}
-class B<E extends core::Object> extends self::A<self::B::E> {
+class B<E extends core::Object = dynamic> extends self::A<self::B::E> {
generic-covariant-impl generic-covariant-interface field self::B::E y = null;
synthetic constructor •() → void
: super self::A::•()
diff --git a/pkg/front_end/testcases/inference/infer_types_on_generic_instantiations_5.dart.direct.expect b/pkg/front_end/testcases/inference/infer_types_on_generic_instantiations_5.dart.direct.expect
index b9909f6..d3df882 100644
--- a/pkg/front_end/testcases/inference/infer_types_on_generic_instantiations_5.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/infer_types_on_generic_instantiations_5.dart.direct.expect
@@ -2,13 +2,13 @@
import self as self;
import "dart:core" as core;
-abstract class I<E extends core::Object> extends core::Object {
+abstract class I<E extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
abstract method m(dynamic a, (dynamic, self::I::E) → core::String f) → core::String;
}
-abstract class A<E extends core::Object> extends core::Object implements self::I<self::A::E> {
+abstract class A<E extends core::Object = dynamic> extends core::Object implements self::I<self::A::E> {
const constructor •() → void
: super core::Object::•()
;
@@ -20,7 +20,7 @@
: super core::Object::•()
;
}
-class B<E extends core::Object> extends self::A<self::B::E> implements self::M {
+class B<E extends core::Object = dynamic> extends self::A<self::B::E> implements self::M {
const constructor •() → void
: super self::A::•()
;
diff --git a/pkg/front_end/testcases/inference/infer_types_on_generic_instantiations_5.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/infer_types_on_generic_instantiations_5.dart.direct.transformed.expect
index b9909f6..d3df882 100644
--- a/pkg/front_end/testcases/inference/infer_types_on_generic_instantiations_5.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/infer_types_on_generic_instantiations_5.dart.direct.transformed.expect
@@ -2,13 +2,13 @@
import self as self;
import "dart:core" as core;
-abstract class I<E extends core::Object> extends core::Object {
+abstract class I<E extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
abstract method m(dynamic a, (dynamic, self::I::E) → core::String f) → core::String;
}
-abstract class A<E extends core::Object> extends core::Object implements self::I<self::A::E> {
+abstract class A<E extends core::Object = dynamic> extends core::Object implements self::I<self::A::E> {
const constructor •() → void
: super core::Object::•()
;
@@ -20,7 +20,7 @@
: super core::Object::•()
;
}
-class B<E extends core::Object> extends self::A<self::B::E> implements self::M {
+class B<E extends core::Object = dynamic> extends self::A<self::B::E> implements self::M {
const constructor •() → void
: super self::A::•()
;
diff --git a/pkg/front_end/testcases/inference/infer_types_on_generic_instantiations_5.dart.strong.expect b/pkg/front_end/testcases/inference/infer_types_on_generic_instantiations_5.dart.strong.expect
index 7c59a35..8bd9cd0 100644
--- a/pkg/front_end/testcases/inference/infer_types_on_generic_instantiations_5.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/infer_types_on_generic_instantiations_5.dart.strong.expect
@@ -2,13 +2,13 @@
import self as self;
import "dart:core" as core;
-abstract class I<E extends core::Object> extends core::Object {
+abstract class I<E extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
abstract method m(dynamic a, (dynamic, self::I::E) → core::String f) → core::String;
}
-abstract class A<E extends core::Object> extends core::Object implements self::I<self::A::E> {
+abstract class A<E extends core::Object = dynamic> extends core::Object implements self::I<self::A::E> {
const constructor •() → void
: super core::Object::•()
;
@@ -20,7 +20,7 @@
: super core::Object::•()
;
}
-class B<E extends core::Object> extends self::A<self::B::E> implements self::M {
+class B<E extends core::Object = dynamic> extends self::A<self::B::E> implements self::M {
const constructor •() → void
: super self::A::•()
;
diff --git a/pkg/front_end/testcases/inference/infer_types_on_generic_instantiations_5.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/infer_types_on_generic_instantiations_5.dart.strong.transformed.expect
index 9d7b98a..5c0657a 100644
--- a/pkg/front_end/testcases/inference/infer_types_on_generic_instantiations_5.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/infer_types_on_generic_instantiations_5.dart.strong.transformed.expect
@@ -2,13 +2,13 @@
import self as self;
import "dart:core" as core;
-abstract class I<E extends core::Object> extends core::Object {
+abstract class I<E extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
abstract method m(dynamic a, (dynamic, self::I::E) → core::String f) → core::String;
}
-abstract class A<E extends core::Object> extends core::Object implements self::I<self::A::E> {
+abstract class A<E extends core::Object = dynamic> extends core::Object implements self::I<self::A::E> {
const constructor •() → void
: super core::Object::•()
;
@@ -20,7 +20,7 @@
: super core::Object::•()
;
}
-class B<E extends core::Object> extends self::A<self::B::E> implements self::M {
+class B<E extends core::Object = dynamic> extends self::A<self::B::E> implements self::M {
const constructor •() → void
: super self::A::•()
;
diff --git a/pkg/front_end/testcases/inference/infer_types_on_generic_instantiations_in_library_cycle.dart.direct.expect b/pkg/front_end/testcases/inference/infer_types_on_generic_instantiations_in_library_cycle.dart.direct.expect
index 97f9b08..b9c1563 100644
--- a/pkg/front_end/testcases/inference/infer_types_on_generic_instantiations_in_library_cycle.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/infer_types_on_generic_instantiations_in_library_cycle.dart.direct.expect
@@ -3,7 +3,7 @@
import "dart:core" as core;
import "./infer_types_on_generic_instantiations_in_library_cycle_a.dart" as inf;
-abstract class A<E extends core::Object> extends core::Object implements inf::I<self::A::E> {
+abstract class A<E extends core::Object = dynamic> extends core::Object implements inf::I<self::A::E> {
final field self::A::E value = null;
const constructor •() → void
: super core::Object::•()
@@ -15,7 +15,7 @@
: super core::Object::•()
;
}
-class B<E extends core::Object> extends self::A<self::B::E> implements self::M {
+class B<E extends core::Object = dynamic> extends self::A<self::B::E> implements self::M {
const constructor •() → void
: super self::A::•()
;
diff --git a/pkg/front_end/testcases/inference/infer_types_on_generic_instantiations_in_library_cycle.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/infer_types_on_generic_instantiations_in_library_cycle.dart.direct.transformed.expect
index 97f9b08..b9c1563 100644
--- a/pkg/front_end/testcases/inference/infer_types_on_generic_instantiations_in_library_cycle.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/infer_types_on_generic_instantiations_in_library_cycle.dart.direct.transformed.expect
@@ -3,7 +3,7 @@
import "dart:core" as core;
import "./infer_types_on_generic_instantiations_in_library_cycle_a.dart" as inf;
-abstract class A<E extends core::Object> extends core::Object implements inf::I<self::A::E> {
+abstract class A<E extends core::Object = dynamic> extends core::Object implements inf::I<self::A::E> {
final field self::A::E value = null;
const constructor •() → void
: super core::Object::•()
@@ -15,7 +15,7 @@
: super core::Object::•()
;
}
-class B<E extends core::Object> extends self::A<self::B::E> implements self::M {
+class B<E extends core::Object = dynamic> extends self::A<self::B::E> implements self::M {
const constructor •() → void
: super self::A::•()
;
diff --git a/pkg/front_end/testcases/inference/infer_types_on_generic_instantiations_in_library_cycle.dart.strong.expect b/pkg/front_end/testcases/inference/infer_types_on_generic_instantiations_in_library_cycle.dart.strong.expect
index 33ef878..a3154f4 100644
--- a/pkg/front_end/testcases/inference/infer_types_on_generic_instantiations_in_library_cycle.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/infer_types_on_generic_instantiations_in_library_cycle.dart.strong.expect
@@ -3,7 +3,7 @@
import "dart:core" as core;
import "./infer_types_on_generic_instantiations_in_library_cycle_a.dart" as inf;
-abstract class A<E extends core::Object> extends core::Object implements inf::I<self::A::E> {
+abstract class A<E extends core::Object = dynamic> extends core::Object implements inf::I<self::A::E> {
final field self::A::E value = null;
const constructor •() → void
: super core::Object::•()
@@ -15,7 +15,7 @@
: super core::Object::•()
;
}
-class B<E extends core::Object> extends self::A<self::B::E> implements self::M {
+class B<E extends core::Object = dynamic> extends self::A<self::B::E> implements self::M {
const constructor •() → void
: super self::A::•()
;
diff --git a/pkg/front_end/testcases/inference/infer_types_on_generic_instantiations_in_library_cycle.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/infer_types_on_generic_instantiations_in_library_cycle.dart.strong.transformed.expect
index e7bb4e0..53741ec 100644
--- a/pkg/front_end/testcases/inference/infer_types_on_generic_instantiations_in_library_cycle.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/infer_types_on_generic_instantiations_in_library_cycle.dart.strong.transformed.expect
@@ -3,7 +3,7 @@
import "dart:core" as core;
import "./infer_types_on_generic_instantiations_in_library_cycle_a.dart" as inf;
-abstract class A<E extends core::Object> extends core::Object implements inf::I<self::A::E> {
+abstract class A<E extends core::Object = dynamic> extends core::Object implements inf::I<self::A::E> {
final field self::A::E value = null;
const constructor •() → void
: super core::Object::•()
@@ -15,7 +15,7 @@
: super core::Object::•()
;
}
-class B<E extends core::Object> extends self::A<self::B::E> implements self::M {
+class B<E extends core::Object = dynamic> extends self::A<self::B::E> implements self::M {
const constructor •() → void
: super self::A::•()
;
diff --git a/pkg/front_end/testcases/inference/infer_types_on_generic_instantiations_in_library_cycle_a.dart.direct.expect b/pkg/front_end/testcases/inference/infer_types_on_generic_instantiations_in_library_cycle_a.dart.direct.expect
index b26d0cb..83c90ce 100644
--- a/pkg/front_end/testcases/inference/infer_types_on_generic_instantiations_in_library_cycle_a.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/infer_types_on_generic_instantiations_in_library_cycle_a.dart.direct.expect
@@ -3,7 +3,7 @@
import "dart:core" as core;
import "./infer_types_on_generic_instantiations_in_library_cycle.dart" as test;
-abstract class I<E extends core::Object> extends core::Object {
+abstract class I<E extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/inference/infer_types_on_generic_instantiations_in_library_cycle_a.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/infer_types_on_generic_instantiations_in_library_cycle_a.dart.direct.transformed.expect
index b26d0cb..83c90ce 100644
--- a/pkg/front_end/testcases/inference/infer_types_on_generic_instantiations_in_library_cycle_a.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/infer_types_on_generic_instantiations_in_library_cycle_a.dart.direct.transformed.expect
@@ -3,7 +3,7 @@
import "dart:core" as core;
import "./infer_types_on_generic_instantiations_in_library_cycle.dart" as test;
-abstract class I<E extends core::Object> extends core::Object {
+abstract class I<E extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/inference/infer_types_on_generic_instantiations_in_library_cycle_a.dart.strong.expect b/pkg/front_end/testcases/inference/infer_types_on_generic_instantiations_in_library_cycle_a.dart.strong.expect
index b26d0cb..83c90ce 100644
--- a/pkg/front_end/testcases/inference/infer_types_on_generic_instantiations_in_library_cycle_a.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/infer_types_on_generic_instantiations_in_library_cycle_a.dart.strong.expect
@@ -3,7 +3,7 @@
import "dart:core" as core;
import "./infer_types_on_generic_instantiations_in_library_cycle.dart" as test;
-abstract class I<E extends core::Object> extends core::Object {
+abstract class I<E extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/inference/infer_types_on_generic_instantiations_in_library_cycle_a.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/infer_types_on_generic_instantiations_in_library_cycle_a.dart.strong.transformed.expect
index b26d0cb..83c90ce 100644
--- a/pkg/front_end/testcases/inference/infer_types_on_generic_instantiations_in_library_cycle_a.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/infer_types_on_generic_instantiations_in_library_cycle_a.dart.strong.transformed.expect
@@ -3,7 +3,7 @@
import "dart:core" as core;
import "./infer_types_on_generic_instantiations_in_library_cycle.dart" as test;
-abstract class I<E extends core::Object> extends core::Object {
+abstract class I<E extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/inference/infer_types_on_generic_instantiations_infer.dart.direct.expect b/pkg/front_end/testcases/inference/infer_types_on_generic_instantiations_infer.dart.direct.expect
index f45b7c8..dafc844 100644
--- a/pkg/front_end/testcases/inference/infer_types_on_generic_instantiations_infer.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/infer_types_on_generic_instantiations_infer.dart.direct.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class A<T extends core::Object> extends core::Object {
+class A<T extends core::Object = dynamic> extends core::Object {
final field self::A::T x = null;
synthetic constructor •() → void
: super core::Object::•()
diff --git a/pkg/front_end/testcases/inference/infer_types_on_generic_instantiations_infer.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/infer_types_on_generic_instantiations_infer.dart.direct.transformed.expect
index f45b7c8..dafc844 100644
--- a/pkg/front_end/testcases/inference/infer_types_on_generic_instantiations_infer.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/infer_types_on_generic_instantiations_infer.dart.direct.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class A<T extends core::Object> extends core::Object {
+class A<T extends core::Object = dynamic> extends core::Object {
final field self::A::T x = null;
synthetic constructor •() → void
: super core::Object::•()
diff --git a/pkg/front_end/testcases/inference/infer_types_on_generic_instantiations_infer.dart.strong.expect b/pkg/front_end/testcases/inference/infer_types_on_generic_instantiations_infer.dart.strong.expect
index 032d625..615fcf8 100644
--- a/pkg/front_end/testcases/inference/infer_types_on_generic_instantiations_infer.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/infer_types_on_generic_instantiations_infer.dart.strong.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class A<T extends core::Object> extends core::Object {
+class A<T extends core::Object = dynamic> extends core::Object {
final field self::A::T x = null;
synthetic constructor •() → void
: super core::Object::•()
diff --git a/pkg/front_end/testcases/inference/infer_types_on_loop_indices_for_each_loop.dart.direct.expect b/pkg/front_end/testcases/inference/infer_types_on_loop_indices_for_each_loop.dart.direct.expect
index d9c5ceb..4c5fd78 100644
--- a/pkg/front_end/testcases/inference/infer_types_on_loop_indices_for_each_loop.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/infer_types_on_loop_indices_for_each_loop.dart.direct.expect
@@ -8,7 +8,7 @@
: super core::Object::•()
;
}
-class Bar<T extends core::Iterable<core::String>> extends core::Object {
+class Bar<T extends core::Iterable<core::String> = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
@@ -18,7 +18,7 @@
}
}
}
-class Baz<T extends core::Object, E extends core::Iterable<self::Baz::T>, S extends self::Baz::E> extends core::Object {
+class Baz<T extends core::Object = dynamic, E extends core::Iterable<self::Baz::T> = dynamic, S extends self::Baz::E = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/inference/infer_types_on_loop_indices_for_each_loop.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/infer_types_on_loop_indices_for_each_loop.dart.direct.transformed.expect
index d9c5ceb..4c5fd78 100644
--- a/pkg/front_end/testcases/inference/infer_types_on_loop_indices_for_each_loop.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/infer_types_on_loop_indices_for_each_loop.dart.direct.transformed.expect
@@ -8,7 +8,7 @@
: super core::Object::•()
;
}
-class Bar<T extends core::Iterable<core::String>> extends core::Object {
+class Bar<T extends core::Iterable<core::String> = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
@@ -18,7 +18,7 @@
}
}
}
-class Baz<T extends core::Object, E extends core::Iterable<self::Baz::T>, S extends self::Baz::E> extends core::Object {
+class Baz<T extends core::Object = dynamic, E extends core::Iterable<self::Baz::T> = dynamic, S extends self::Baz::E = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/inference/infer_types_on_loop_indices_for_each_loop.dart.strong.expect b/pkg/front_end/testcases/inference/infer_types_on_loop_indices_for_each_loop.dart.strong.expect
index e02a9c4..0b9e781 100644
--- a/pkg/front_end/testcases/inference/infer_types_on_loop_indices_for_each_loop.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/infer_types_on_loop_indices_for_each_loop.dart.strong.expect
@@ -8,7 +8,7 @@
: super core::Object::•()
;
}
-class Bar<T extends core::Iterable<core::String>> extends core::Object {
+class Bar<T extends core::Iterable<core::String> = core::Iterable<core::String>> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
@@ -21,7 +21,7 @@
}
}
}
-class Baz<T extends core::Object, E extends core::Iterable<self::Baz::T>, S extends self::Baz::E> extends core::Object {
+class Baz<T extends core::Object = dynamic, E extends core::Iterable<self::Baz::T> = core::Iterable<dynamic>, S extends self::Baz::E = core::Iterable<dynamic>> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/inference/infer_types_on_loop_indices_for_each_loop.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/infer_types_on_loop_indices_for_each_loop.dart.strong.transformed.expect
index a4e6e95..2f136bc 100644
--- a/pkg/front_end/testcases/inference/infer_types_on_loop_indices_for_each_loop.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/infer_types_on_loop_indices_for_each_loop.dart.strong.transformed.expect
@@ -8,7 +8,7 @@
: super core::Object::•()
;
}
-class Bar<T extends core::Iterable<core::String>> extends core::Object {
+class Bar<T extends core::Iterable<core::String> = core::Iterable<core::String>> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
@@ -21,7 +21,7 @@
}
}
}
-class Baz<T extends core::Object, E extends core::Iterable<self::Baz::T>, S extends self::Baz::E> extends core::Object {
+class Baz<T extends core::Object = dynamic, E extends core::Iterable<self::Baz::T> = core::Iterable<dynamic>, S extends self::Baz::E = core::Iterable<dynamic>> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/inference/infer_types_on_loop_indices_for_each_loop_async.dart.direct.expect b/pkg/front_end/testcases/inference/infer_types_on_loop_indices_for_each_loop_async.dart.direct.expect
index 6421db3..a243798 100644
--- a/pkg/front_end/testcases/inference/infer_types_on_loop_indices_for_each_loop_async.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/infer_types_on_loop_indices_for_each_loop_async.dart.direct.expect
@@ -9,7 +9,7 @@
: super core::Object::•()
;
}
-class Bar<T extends asy::Stream<core::String>> extends core::Object {
+class Bar<T extends asy::Stream<core::String> = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
@@ -19,7 +19,7 @@
}
}
}
-class Baz<T extends core::Object, E extends asy::Stream<self::Baz::T>, S extends self::Baz::E> extends core::Object {
+class Baz<T extends core::Object = dynamic, E extends asy::Stream<self::Baz::T> = dynamic, S extends self::Baz::E = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
@@ -30,8 +30,8 @@
}
}
}
-abstract class MyStream<T extends core::Object> extends asy::Stream<self::MyStream::T> {
- static factory •<T extends core::Object>() → self::MyStream<self::MyStream::•::T>
+abstract class MyStream<T extends core::Object = dynamic> extends asy::Stream<self::MyStream::T> {
+ static factory •<T extends core::Object = dynamic>() → self::MyStream<self::MyStream::•::T>
return null;
}
static method test() → dynamic async {
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 bfda42e..f8f99d3 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
@@ -9,7 +9,7 @@
: super core::Object::•()
;
}
-class Bar<T extends asy::Stream<core::String>> extends core::Object {
+class Bar<T extends asy::Stream<core::String> = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
@@ -64,7 +64,7 @@
return :completer.{asy::Completer::future};
}
}
-class Baz<T extends core::Object, E extends asy::Stream<self::Baz::T>, S extends self::Baz::E> extends core::Object {
+class Baz<T extends core::Object = dynamic, E extends asy::Stream<self::Baz::T> = dynamic, S extends self::Baz::E = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
@@ -120,8 +120,8 @@
return :completer.{asy::Completer::future};
}
}
-abstract class MyStream<T extends core::Object> extends asy::Stream<self::MyStream::T> {
- static factory •<T extends core::Object>() → self::MyStream<self::MyStream::•::T>
+abstract class MyStream<T extends core::Object = dynamic> extends asy::Stream<self::MyStream::T> {
+ static factory •<T extends core::Object = dynamic>() → self::MyStream<self::MyStream::•::T>
return null;
}
static method test() → dynamic /* originally async */ {
diff --git a/pkg/front_end/testcases/inference/infer_types_on_loop_indices_for_each_loop_async.dart.outline.expect b/pkg/front_end/testcases/inference/infer_types_on_loop_indices_for_each_loop_async.dart.outline.expect
index 0abefd8..312b175 100644
--- a/pkg/front_end/testcases/inference/infer_types_on_loop_indices_for_each_loop_async.dart.outline.expect
+++ b/pkg/front_end/testcases/inference/infer_types_on_loop_indices_for_each_loop_async.dart.outline.expect
@@ -8,20 +8,20 @@
synthetic constructor •() → void
;
}
-class Bar<T extends asy::Stream<core::String>> extends core::Object {
+class Bar<T extends asy::Stream<core::String> = dynamic> extends core::Object {
synthetic constructor •() → void
;
method foo(self::Bar::T t) → dynamic
;
}
-class Baz<T extends core::Object, E extends asy::Stream<self::Baz::T>, S extends self::Baz::E> extends core::Object {
+class Baz<T extends core::Object = dynamic, E extends asy::Stream<self::Baz::T> = dynamic, S extends self::Baz::E = dynamic> extends core::Object {
synthetic constructor •() → void
;
method foo(self::Baz::S t) → dynamic
;
}
-abstract class MyStream<T extends core::Object> extends asy::Stream<self::MyStream::T> {
- static factory •<T extends core::Object>() → self::MyStream<self::MyStream::•::T>
+abstract class MyStream<T extends core::Object = dynamic> extends asy::Stream<self::MyStream::T> {
+ static factory •<T extends core::Object = dynamic>() → self::MyStream<self::MyStream::•::T>
;
}
static method test() → dynamic
diff --git a/pkg/front_end/testcases/inference/infer_types_on_loop_indices_for_each_loop_async.dart.strong.expect b/pkg/front_end/testcases/inference/infer_types_on_loop_indices_for_each_loop_async.dart.strong.expect
index 98d998a..43e0fad 100644
--- a/pkg/front_end/testcases/inference/infer_types_on_loop_indices_for_each_loop_async.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/infer_types_on_loop_indices_for_each_loop_async.dart.strong.expect
@@ -9,7 +9,7 @@
: super core::Object::•()
;
}
-class Bar<T extends asy::Stream<core::String>> extends core::Object {
+class Bar<T extends asy::Stream<core::String> = asy::Stream<core::String>> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
@@ -22,7 +22,7 @@
}
}
}
-class Baz<T extends core::Object, E extends asy::Stream<self::Baz::T>, S extends self::Baz::E> extends core::Object {
+class Baz<T extends core::Object = dynamic, E extends asy::Stream<self::Baz::T> = asy::Stream<dynamic>, S extends self::Baz::E = asy::Stream<dynamic>> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
@@ -36,8 +36,8 @@
}
}
}
-abstract class MyStream<T extends core::Object> extends asy::Stream<self::MyStream::T> {
- static factory •<T extends core::Object>() → self::MyStream<self::MyStream::•::T>
+abstract class MyStream<T extends core::Object = dynamic> extends asy::Stream<self::MyStream::T> {
+ static factory •<T extends core::Object = dynamic>() → self::MyStream<self::MyStream::•::T>
return null;
}
static method test() → dynamic async {
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 cf338e2..bb29f89 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
@@ -9,7 +9,7 @@
: super core::Object::•()
;
}
-class Bar<T extends asy::Stream<core::String>> extends core::Object {
+class Bar<T extends asy::Stream<core::String> = asy::Stream<core::String>> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
@@ -67,7 +67,7 @@
return :completer.{asy::Completer::future};
}
}
-class Baz<T extends core::Object, E extends asy::Stream<self::Baz::T>, S extends self::Baz::E> extends core::Object {
+class Baz<T extends core::Object = dynamic, E extends asy::Stream<self::Baz::T> = asy::Stream<dynamic>, S extends self::Baz::E = asy::Stream<dynamic>> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
@@ -126,8 +126,8 @@
return :completer.{asy::Completer::future};
}
}
-abstract class MyStream<T extends core::Object> extends asy::Stream<self::MyStream::T> {
- static factory •<T extends core::Object>() → self::MyStream<self::MyStream::•::T>
+abstract class MyStream<T extends core::Object = dynamic> extends asy::Stream<self::MyStream::T> {
+ static factory •<T extends core::Object = dynamic>() → self::MyStream<self::MyStream::•::T>
return null;
}
static method test() → dynamic /* originally async */ {
diff --git a/pkg/front_end/testcases/inference/inferred_type_is_typedef_parameterized.dart.direct.expect b/pkg/front_end/testcases/inference/inferred_type_is_typedef_parameterized.dart.direct.expect
index ab7a925..b9fa6d2 100644
--- a/pkg/front_end/testcases/inference/inferred_type_is_typedef_parameterized.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/inferred_type_is_typedef_parameterized.dart.direct.expect
@@ -2,6 +2,6 @@
import self as self;
import "dart:core" as core;
-typedef F<T extends core::Object> = () → T;
+typedef F<T extends core::Object = dynamic> = () → T;
static final field dynamic x = <core::String, () → core::int>{};
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/inferred_type_is_typedef_parameterized.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/inferred_type_is_typedef_parameterized.dart.direct.transformed.expect
index ab7a925..b9fa6d2 100644
--- a/pkg/front_end/testcases/inference/inferred_type_is_typedef_parameterized.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/inferred_type_is_typedef_parameterized.dart.direct.transformed.expect
@@ -2,6 +2,6 @@
import self as self;
import "dart:core" as core;
-typedef F<T extends core::Object> = () → T;
+typedef F<T extends core::Object = dynamic> = () → T;
static final field dynamic x = <core::String, () → core::int>{};
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/inferred_type_is_typedef_parameterized.dart.strong.expect b/pkg/front_end/testcases/inference/inferred_type_is_typedef_parameterized.dart.strong.expect
index 017095d..40eb28c 100644
--- a/pkg/front_end/testcases/inference/inferred_type_is_typedef_parameterized.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/inferred_type_is_typedef_parameterized.dart.strong.expect
@@ -2,6 +2,6 @@
import self as self;
import "dart:core" as core;
-typedef F<T extends core::Object> = () → T;
+typedef F<T extends core::Object = dynamic> = () → T;
static final field core::Map<core::String, () → core::int> x = <core::String, () → core::int>{};
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/inferred_type_is_typedef_parameterized.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/inferred_type_is_typedef_parameterized.dart.strong.transformed.expect
index 017095d..40eb28c 100644
--- a/pkg/front_end/testcases/inference/inferred_type_is_typedef_parameterized.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/inferred_type_is_typedef_parameterized.dart.strong.transformed.expect
@@ -2,6 +2,6 @@
import self as self;
import "dart:core" as core;
-typedef F<T extends core::Object> = () → T;
+typedef F<T extends core::Object = dynamic> = () → T;
static final field core::Map<core::String, () → core::int> x = <core::String, () → core::int>{};
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/instance_creation_downwards.dart.direct.expect b/pkg/front_end/testcases/inference/instance_creation_downwards.dart.direct.expect
index 9a8589f..eb85185 100644
--- a/pkg/front_end/testcases/inference/instance_creation_downwards.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/instance_creation_downwards.dart.direct.expect
@@ -2,12 +2,12 @@
import self as self;
import "dart:core" as core;
-class A<T extends core::Object> extends core::Object {
+class A<T extends core::Object = dynamic> extends core::Object {
constructor •(self::B<core::List<self::A::T>> b) → void
: super core::Object::•()
;
}
-class B<T extends core::Object> extends core::Object {
+class B<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/inference/instance_creation_downwards.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/instance_creation_downwards.dart.direct.transformed.expect
index 9a8589f..eb85185 100644
--- a/pkg/front_end/testcases/inference/instance_creation_downwards.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/instance_creation_downwards.dart.direct.transformed.expect
@@ -2,12 +2,12 @@
import self as self;
import "dart:core" as core;
-class A<T extends core::Object> extends core::Object {
+class A<T extends core::Object = dynamic> extends core::Object {
constructor •(self::B<core::List<self::A::T>> b) → void
: super core::Object::•()
;
}
-class B<T extends core::Object> extends core::Object {
+class B<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/inference/instance_creation_downwards.dart.outline.expect b/pkg/front_end/testcases/inference/instance_creation_downwards.dart.outline.expect
index 91dce6c..fdd5f51 100644
--- a/pkg/front_end/testcases/inference/instance_creation_downwards.dart.outline.expect
+++ b/pkg/front_end/testcases/inference/instance_creation_downwards.dart.outline.expect
@@ -2,11 +2,11 @@
import self as self;
import "dart:core" as core;
-class A<T extends core::Object> extends core::Object {
+class A<T extends core::Object = dynamic> extends core::Object {
constructor •(self::B<core::List<self::A::T>> b) → void
;
}
-class B<T extends core::Object> extends core::Object {
+class B<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
;
}
diff --git a/pkg/front_end/testcases/inference/instance_creation_downwards.dart.strong.expect b/pkg/front_end/testcases/inference/instance_creation_downwards.dart.strong.expect
index 65851c3..c5b34ab 100644
--- a/pkg/front_end/testcases/inference/instance_creation_downwards.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/instance_creation_downwards.dart.strong.expect
@@ -2,12 +2,12 @@
import self as self;
import "dart:core" as core;
-class A<T extends core::Object> extends core::Object {
+class A<T extends core::Object = dynamic> extends core::Object {
constructor •(self::B<core::List<self::A::T>> b) → void
: super core::Object::•()
;
}
-class B<T extends core::Object> extends core::Object {
+class B<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/inference/instance_creation_downwards.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/instance_creation_downwards.dart.strong.transformed.expect
index 65851c3..c5b34ab 100644
--- a/pkg/front_end/testcases/inference/instance_creation_downwards.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/instance_creation_downwards.dart.strong.transformed.expect
@@ -2,12 +2,12 @@
import self as self;
import "dart:core" as core;
-class A<T extends core::Object> extends core::Object {
+class A<T extends core::Object = dynamic> extends core::Object {
constructor •(self::B<core::List<self::A::T>> b) → void
: super core::Object::•()
;
}
-class B<T extends core::Object> extends core::Object {
+class B<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/inference/instantiate_tearoff.dart.direct.expect b/pkg/front_end/testcases/inference/instantiate_tearoff.dart.direct.expect
index 7464b33..003db25 100644
--- a/pkg/front_end/testcases/inference/instantiate_tearoff.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/instantiate_tearoff.dart.direct.expect
@@ -6,9 +6,9 @@
synthetic constructor •() → void
: super core::Object::•()
;
- method f<T extends core::Object>(self::C::f::T x) → self::C::f::T
+ method f<T extends core::Object = dynamic>(self::C::f::T x) → self::C::f::T
return x;
- static method g<T extends core::Object>(self::C::g::T x) → self::C::g::T
+ static method g<T extends core::Object = dynamic>(self::C::g::T x) → self::C::g::T
return x;
}
class D extends self::C {
@@ -20,10 +20,10 @@
func = super.{self::C::f};
}
}
-static method f<T extends core::Object>(self::f::T x) → self::f::T
+static method f<T extends core::Object = dynamic>(self::f::T x) → self::f::T
return x;
static method test() → void {
- function h<T extends core::Object>(T x) → T
+ function h<T extends core::Object = dynamic>(T x) → T
return x;
(core::int) → core::int func;
func = self::f;
diff --git a/pkg/front_end/testcases/inference/instantiate_tearoff.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/instantiate_tearoff.dart.direct.transformed.expect
index 7464b33..003db25 100644
--- a/pkg/front_end/testcases/inference/instantiate_tearoff.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/instantiate_tearoff.dart.direct.transformed.expect
@@ -6,9 +6,9 @@
synthetic constructor •() → void
: super core::Object::•()
;
- method f<T extends core::Object>(self::C::f::T x) → self::C::f::T
+ method f<T extends core::Object = dynamic>(self::C::f::T x) → self::C::f::T
return x;
- static method g<T extends core::Object>(self::C::g::T x) → self::C::g::T
+ static method g<T extends core::Object = dynamic>(self::C::g::T x) → self::C::g::T
return x;
}
class D extends self::C {
@@ -20,10 +20,10 @@
func = super.{self::C::f};
}
}
-static method f<T extends core::Object>(self::f::T x) → self::f::T
+static method f<T extends core::Object = dynamic>(self::f::T x) → self::f::T
return x;
static method test() → void {
- function h<T extends core::Object>(T x) → T
+ function h<T extends core::Object = dynamic>(T x) → T
return x;
(core::int) → core::int func;
func = self::f;
diff --git a/pkg/front_end/testcases/inference/instantiate_tearoff.dart.outline.expect b/pkg/front_end/testcases/inference/instantiate_tearoff.dart.outline.expect
index cac8ab3..425d634 100644
--- a/pkg/front_end/testcases/inference/instantiate_tearoff.dart.outline.expect
+++ b/pkg/front_end/testcases/inference/instantiate_tearoff.dart.outline.expect
@@ -5,9 +5,9 @@
class C extends core::Object {
synthetic constructor •() → void
;
- method f<T extends core::Object>(self::C::f::T x) → self::C::f::T
+ method f<T extends core::Object = dynamic>(self::C::f::T x) → self::C::f::T
;
- static method g<T extends core::Object>(self::C::g::T x) → self::C::g::T
+ static method g<T extends core::Object = dynamic>(self::C::g::T x) → self::C::g::T
;
}
class D extends self::C {
@@ -16,7 +16,7 @@
method test() → void
;
}
-static method f<T extends core::Object>(self::f::T x) → self::f::T
+static method f<T extends core::Object = dynamic>(self::f::T x) → self::f::T
;
static method test() → void
;
diff --git a/pkg/front_end/testcases/inference/instantiate_tearoff.dart.strong.expect b/pkg/front_end/testcases/inference/instantiate_tearoff.dart.strong.expect
index 24d056a..5f9428d 100644
--- a/pkg/front_end/testcases/inference/instantiate_tearoff.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/instantiate_tearoff.dart.strong.expect
@@ -6,9 +6,9 @@
synthetic constructor •() → void
: super core::Object::•()
;
- method f<T extends core::Object>(self::C::f::T x) → self::C::f::T
+ method f<T extends core::Object = dynamic>(self::C::f::T x) → self::C::f::T
return x;
- static method g<T extends core::Object>(self::C::g::T x) → self::C::g::T
+ static method g<T extends core::Object = dynamic>(self::C::g::T x) → self::C::g::T
return x;
}
class D extends self::C {
@@ -20,10 +20,10 @@
func = super.{self::C::f}<core::int>;
}
}
-static method f<T extends core::Object>(self::f::T x) → self::f::T
+static method f<T extends core::Object = dynamic>(self::f::T x) → self::f::T
return x;
static method test() → void {
- function h<T extends core::Object>(T x) → T
+ function h<T extends core::Object = dynamic>(T x) → T
return x;
(core::int) → core::int func;
func = self::f<core::int>;
diff --git a/pkg/front_end/testcases/inference/instantiate_tearoff.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/instantiate_tearoff.dart.strong.transformed.expect
index 24d056a..5f9428d 100644
--- a/pkg/front_end/testcases/inference/instantiate_tearoff.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/instantiate_tearoff.dart.strong.transformed.expect
@@ -6,9 +6,9 @@
synthetic constructor •() → void
: super core::Object::•()
;
- method f<T extends core::Object>(self::C::f::T x) → self::C::f::T
+ method f<T extends core::Object = dynamic>(self::C::f::T x) → self::C::f::T
return x;
- static method g<T extends core::Object>(self::C::g::T x) → self::C::g::T
+ static method g<T extends core::Object = dynamic>(self::C::g::T x) → self::C::g::T
return x;
}
class D extends self::C {
@@ -20,10 +20,10 @@
func = super.{self::C::f}<core::int>;
}
}
-static method f<T extends core::Object>(self::f::T x) → self::f::T
+static method f<T extends core::Object = dynamic>(self::f::T x) → self::f::T
return x;
static method test() → void {
- function h<T extends core::Object>(T x) → T
+ function h<T extends core::Object = dynamic>(T x) → T
return x;
(core::int) → core::int func;
func = self::f<core::int>;
diff --git a/pkg/front_end/testcases/inference/instantiate_tearoff_after_contravariance_check.dart.direct.expect b/pkg/front_end/testcases/inference/instantiate_tearoff_after_contravariance_check.dart.direct.expect
index 407abc7..254d3c1 100644
--- a/pkg/front_end/testcases/inference/instantiate_tearoff_after_contravariance_check.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/instantiate_tearoff_after_contravariance_check.dart.direct.expect
@@ -2,11 +2,11 @@
import self as self;
import "dart:core" as core;
-class C<T extends core::Object> extends core::Object {
+class C<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
- method f<U extends core::Object>(self::C::f::U x) → (self::C::T) → void
+ method f<U extends core::Object = dynamic>(self::C::f::U x) → (self::C::T) → void
return (dynamic y) → dynamic {};
}
static method test(self::C<core::String> c) → void {
diff --git a/pkg/front_end/testcases/inference/instantiate_tearoff_after_contravariance_check.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/instantiate_tearoff_after_contravariance_check.dart.direct.transformed.expect
index 407abc7..254d3c1 100644
--- a/pkg/front_end/testcases/inference/instantiate_tearoff_after_contravariance_check.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/instantiate_tearoff_after_contravariance_check.dart.direct.transformed.expect
@@ -2,11 +2,11 @@
import self as self;
import "dart:core" as core;
-class C<T extends core::Object> extends core::Object {
+class C<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
- method f<U extends core::Object>(self::C::f::U x) → (self::C::T) → void
+ method f<U extends core::Object = dynamic>(self::C::f::U x) → (self::C::T) → void
return (dynamic y) → dynamic {};
}
static method test(self::C<core::String> c) → void {
diff --git a/pkg/front_end/testcases/inference/instantiate_tearoff_after_contravariance_check.dart.outline.expect b/pkg/front_end/testcases/inference/instantiate_tearoff_after_contravariance_check.dart.outline.expect
index 743f43f..2ec6364 100644
--- a/pkg/front_end/testcases/inference/instantiate_tearoff_after_contravariance_check.dart.outline.expect
+++ b/pkg/front_end/testcases/inference/instantiate_tearoff_after_contravariance_check.dart.outline.expect
@@ -2,10 +2,10 @@
import self as self;
import "dart:core" as core;
-class C<T extends core::Object> extends core::Object {
+class C<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
;
- method f<U extends core::Object>(self::C::f::U x) → (self::C::T) → void
+ method f<U extends core::Object = dynamic>(self::C::f::U x) → (self::C::T) → void
;
}
static method test(self::C<core::String> c) → void
diff --git a/pkg/front_end/testcases/inference/instantiate_tearoff_after_contravariance_check.dart.strong.expect b/pkg/front_end/testcases/inference/instantiate_tearoff_after_contravariance_check.dart.strong.expect
index 5dc12db..e3ccda9 100644
--- a/pkg/front_end/testcases/inference/instantiate_tearoff_after_contravariance_check.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/instantiate_tearoff_after_contravariance_check.dart.strong.expect
@@ -2,11 +2,11 @@
import self as self;
import "dart:core" as core;
-class C<T extends core::Object> extends core::Object {
+class C<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
- method f<U extends core::Object>(self::C::f::U x) → (self::C::T) → void
+ method f<U extends core::Object = dynamic>(self::C::f::U x) → (self::C::T) → void
return (self::C::T y) → core::Null {};
}
static method test(self::C<core::String> c) → void {
diff --git a/pkg/front_end/testcases/inference/instantiate_tearoff_after_contravariance_check.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/instantiate_tearoff_after_contravariance_check.dart.strong.transformed.expect
index 5dc12db..e3ccda9 100644
--- a/pkg/front_end/testcases/inference/instantiate_tearoff_after_contravariance_check.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/instantiate_tearoff_after_contravariance_check.dart.strong.transformed.expect
@@ -2,11 +2,11 @@
import self as self;
import "dart:core" as core;
-class C<T extends core::Object> extends core::Object {
+class C<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
- method f<U extends core::Object>(self::C::f::U x) → (self::C::T) → void
+ method f<U extends core::Object = dynamic>(self::C::f::U x) → (self::C::T) → void
return (self::C::T y) → core::Null {};
}
static method test(self::C<core::String> c) → void {
diff --git a/pkg/front_end/testcases/inference/instantiate_tearoff_of_call.dart.direct.expect b/pkg/front_end/testcases/inference/instantiate_tearoff_of_call.dart.direct.expect
index 258ba0e..59e7aab 100644
--- a/pkg/front_end/testcases/inference/instantiate_tearoff_of_call.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/instantiate_tearoff_of_call.dart.direct.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-static method test(<T extends core::Object>(T) → T f) → void {
+static method test(<T extends core::Object = dynamic>(T) → T f) → void {
(core::int) → core::int func;
func = f.call;
}
diff --git a/pkg/front_end/testcases/inference/instantiate_tearoff_of_call.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/instantiate_tearoff_of_call.dart.direct.transformed.expect
index 258ba0e..59e7aab 100644
--- a/pkg/front_end/testcases/inference/instantiate_tearoff_of_call.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/instantiate_tearoff_of_call.dart.direct.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-static method test(<T extends core::Object>(T) → T f) → void {
+static method test(<T extends core::Object = dynamic>(T) → T f) → void {
(core::int) → core::int func;
func = f.call;
}
diff --git a/pkg/front_end/testcases/inference/instantiate_tearoff_of_call.dart.outline.expect b/pkg/front_end/testcases/inference/instantiate_tearoff_of_call.dart.outline.expect
index 65e10ba..30f8885 100644
--- a/pkg/front_end/testcases/inference/instantiate_tearoff_of_call.dart.outline.expect
+++ b/pkg/front_end/testcases/inference/instantiate_tearoff_of_call.dart.outline.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-static method test(<T extends core::Object>(T) → T f) → void
+static method test(<T extends core::Object = dynamic>(T) → T f) → void
;
static method main() → dynamic
;
diff --git a/pkg/front_end/testcases/inference/instantiate_to_bounds_generic2_has_bound_defined_after.dart.direct.expect b/pkg/front_end/testcases/inference/instantiate_to_bounds_generic2_has_bound_defined_after.dart.direct.expect
index ac05240..e7c62a1 100644
--- a/pkg/front_end/testcases/inference/instantiate_to_bounds_generic2_has_bound_defined_after.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/instantiate_to_bounds_generic2_has_bound_defined_after.dart.direct.expect
@@ -2,12 +2,12 @@
import self as self;
import "dart:core" as core;
-class B<T extends self::A<dynamic>> extends core::Object {
+class B<T extends self::A<dynamic> = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class A<T extends core::int> extends core::Object {
+class A<T extends core::int = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/inference/instantiate_to_bounds_generic2_has_bound_defined_after.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/instantiate_to_bounds_generic2_has_bound_defined_after.dart.direct.transformed.expect
index ac05240..e7c62a1 100644
--- a/pkg/front_end/testcases/inference/instantiate_to_bounds_generic2_has_bound_defined_after.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/instantiate_to_bounds_generic2_has_bound_defined_after.dart.direct.transformed.expect
@@ -2,12 +2,12 @@
import self as self;
import "dart:core" as core;
-class B<T extends self::A<dynamic>> extends core::Object {
+class B<T extends self::A<dynamic> = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class A<T extends core::int> extends core::Object {
+class A<T extends core::int = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/inference/instantiate_to_bounds_generic2_has_bound_defined_after.dart.strong.expect b/pkg/front_end/testcases/inference/instantiate_to_bounds_generic2_has_bound_defined_after.dart.strong.expect
index 1675d51..57b9777 100644
--- a/pkg/front_end/testcases/inference/instantiate_to_bounds_generic2_has_bound_defined_after.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/instantiate_to_bounds_generic2_has_bound_defined_after.dart.strong.expect
@@ -2,12 +2,12 @@
import self as self;
import "dart:core" as core;
-class B<T extends self::A<core::int>> extends core::Object {
+class B<T extends self::A<core::int> = self::A<core::int>> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class A<T extends core::int> extends core::Object {
+class A<T extends core::int = core::int> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/inference/instantiate_to_bounds_generic2_has_bound_defined_after.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/instantiate_to_bounds_generic2_has_bound_defined_after.dart.strong.transformed.expect
index 1675d51..57b9777 100644
--- a/pkg/front_end/testcases/inference/instantiate_to_bounds_generic2_has_bound_defined_after.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/instantiate_to_bounds_generic2_has_bound_defined_after.dart.strong.transformed.expect
@@ -2,12 +2,12 @@
import self as self;
import "dart:core" as core;
-class B<T extends self::A<core::int>> extends core::Object {
+class B<T extends self::A<core::int> = self::A<core::int>> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class A<T extends core::int> extends core::Object {
+class A<T extends core::int = core::int> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/inference/instantiate_to_bounds_generic2_has_bound_defined_before.dart.direct.expect b/pkg/front_end/testcases/inference/instantiate_to_bounds_generic2_has_bound_defined_before.dart.direct.expect
index a8450dd..38b7a42 100644
--- a/pkg/front_end/testcases/inference/instantiate_to_bounds_generic2_has_bound_defined_before.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/instantiate_to_bounds_generic2_has_bound_defined_before.dart.direct.expect
@@ -2,12 +2,12 @@
import self as self;
import "dart:core" as core;
-class A<T extends core::int> extends core::Object {
+class A<T extends core::int = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class B<T extends self::A<dynamic>> extends core::Object {
+class B<T extends self::A<dynamic> = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/inference/instantiate_to_bounds_generic2_has_bound_defined_before.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/instantiate_to_bounds_generic2_has_bound_defined_before.dart.direct.transformed.expect
index a8450dd..38b7a42 100644
--- a/pkg/front_end/testcases/inference/instantiate_to_bounds_generic2_has_bound_defined_before.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/instantiate_to_bounds_generic2_has_bound_defined_before.dart.direct.transformed.expect
@@ -2,12 +2,12 @@
import self as self;
import "dart:core" as core;
-class A<T extends core::int> extends core::Object {
+class A<T extends core::int = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class B<T extends self::A<dynamic>> extends core::Object {
+class B<T extends self::A<dynamic> = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/inference/instantiate_to_bounds_generic2_has_bound_defined_before.dart.strong.expect b/pkg/front_end/testcases/inference/instantiate_to_bounds_generic2_has_bound_defined_before.dart.strong.expect
index c47d4b1..42ff84b 100644
--- a/pkg/front_end/testcases/inference/instantiate_to_bounds_generic2_has_bound_defined_before.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/instantiate_to_bounds_generic2_has_bound_defined_before.dart.strong.expect
@@ -2,12 +2,12 @@
import self as self;
import "dart:core" as core;
-class A<T extends core::int> extends core::Object {
+class A<T extends core::int = core::int> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class B<T extends self::A<core::int>> extends core::Object {
+class B<T extends self::A<core::int> = self::A<core::int>> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/inference/instantiate_to_bounds_generic2_has_bound_defined_before.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/instantiate_to_bounds_generic2_has_bound_defined_before.dart.strong.transformed.expect
index c47d4b1..42ff84b 100644
--- a/pkg/front_end/testcases/inference/instantiate_to_bounds_generic2_has_bound_defined_before.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/instantiate_to_bounds_generic2_has_bound_defined_before.dart.strong.transformed.expect
@@ -2,12 +2,12 @@
import self as self;
import "dart:core" as core;
-class A<T extends core::int> extends core::Object {
+class A<T extends core::int = core::int> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class B<T extends self::A<core::int>> extends core::Object {
+class B<T extends self::A<core::int> = self::A<core::int>> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/inference/instantiate_to_bounds_generic2_no_bound.dart.direct.expect b/pkg/front_end/testcases/inference/instantiate_to_bounds_generic2_no_bound.dart.direct.expect
index d39e0fe..dfb57c4 100644
--- a/pkg/front_end/testcases/inference/instantiate_to_bounds_generic2_no_bound.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/instantiate_to_bounds_generic2_no_bound.dart.direct.expect
@@ -2,12 +2,12 @@
import self as self;
import "dart:core" as core;
-class A<T extends core::Object> extends core::Object {
+class A<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class B<T extends self::A<dynamic>> extends core::Object {
+class B<T extends self::A<dynamic> = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/inference/instantiate_to_bounds_generic2_no_bound.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/instantiate_to_bounds_generic2_no_bound.dart.direct.transformed.expect
index d39e0fe..dfb57c4 100644
--- a/pkg/front_end/testcases/inference/instantiate_to_bounds_generic2_no_bound.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/instantiate_to_bounds_generic2_no_bound.dart.direct.transformed.expect
@@ -2,12 +2,12 @@
import self as self;
import "dart:core" as core;
-class A<T extends core::Object> extends core::Object {
+class A<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class B<T extends self::A<dynamic>> extends core::Object {
+class B<T extends self::A<dynamic> = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/inference/instantiate_to_bounds_generic2_no_bound.dart.strong.expect b/pkg/front_end/testcases/inference/instantiate_to_bounds_generic2_no_bound.dart.strong.expect
index 1b49427..ad11219 100644
--- a/pkg/front_end/testcases/inference/instantiate_to_bounds_generic2_no_bound.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/instantiate_to_bounds_generic2_no_bound.dart.strong.expect
@@ -2,12 +2,12 @@
import self as self;
import "dart:core" as core;
-class A<T extends core::Object> extends core::Object {
+class A<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class B<T extends self::A<dynamic>> extends core::Object {
+class B<T extends self::A<dynamic> = self::A<dynamic>> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/inference/instantiate_to_bounds_generic2_no_bound.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/instantiate_to_bounds_generic2_no_bound.dart.strong.transformed.expect
index 1b49427..ad11219 100644
--- a/pkg/front_end/testcases/inference/instantiate_to_bounds_generic2_no_bound.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/instantiate_to_bounds_generic2_no_bound.dart.strong.transformed.expect
@@ -2,12 +2,12 @@
import self as self;
import "dart:core" as core;
-class A<T extends core::Object> extends core::Object {
+class A<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class B<T extends self::A<dynamic>> extends core::Object {
+class B<T extends self::A<dynamic> = self::A<dynamic>> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/inference/instantiate_to_bounds_generic_has_bound_defined_after.dart.direct.expect b/pkg/front_end/testcases/inference/instantiate_to_bounds_generic_has_bound_defined_after.dart.direct.expect
index c31aed4..d78301f 100644
--- a/pkg/front_end/testcases/inference/instantiate_to_bounds_generic_has_bound_defined_after.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/instantiate_to_bounds_generic_has_bound_defined_after.dart.direct.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class A<T extends core::int> extends core::Object {
+class A<T extends core::int = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/inference/instantiate_to_bounds_generic_has_bound_defined_after.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/instantiate_to_bounds_generic_has_bound_defined_after.dart.direct.transformed.expect
index c31aed4..d78301f 100644
--- a/pkg/front_end/testcases/inference/instantiate_to_bounds_generic_has_bound_defined_after.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/instantiate_to_bounds_generic_has_bound_defined_after.dart.direct.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class A<T extends core::int> extends core::Object {
+class A<T extends core::int = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/inference/instantiate_to_bounds_generic_has_bound_defined_after.dart.strong.expect b/pkg/front_end/testcases/inference/instantiate_to_bounds_generic_has_bound_defined_after.dart.strong.expect
index 250e9df..006a1e5 100644
--- a/pkg/front_end/testcases/inference/instantiate_to_bounds_generic_has_bound_defined_after.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/instantiate_to_bounds_generic_has_bound_defined_after.dart.strong.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class A<T extends core::int> extends core::Object {
+class A<T extends core::int = core::int> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/inference/instantiate_to_bounds_generic_has_bound_defined_after.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/instantiate_to_bounds_generic_has_bound_defined_after.dart.strong.transformed.expect
index 250e9df..006a1e5 100644
--- a/pkg/front_end/testcases/inference/instantiate_to_bounds_generic_has_bound_defined_after.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/instantiate_to_bounds_generic_has_bound_defined_after.dart.strong.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class A<T extends core::int> extends core::Object {
+class A<T extends core::int = core::int> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/inference/instantiate_to_bounds_generic_has_bound_defined_before.dart.direct.expect b/pkg/front_end/testcases/inference/instantiate_to_bounds_generic_has_bound_defined_before.dart.direct.expect
index c31aed4..d78301f 100644
--- a/pkg/front_end/testcases/inference/instantiate_to_bounds_generic_has_bound_defined_before.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/instantiate_to_bounds_generic_has_bound_defined_before.dart.direct.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class A<T extends core::int> extends core::Object {
+class A<T extends core::int = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/inference/instantiate_to_bounds_generic_has_bound_defined_before.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/instantiate_to_bounds_generic_has_bound_defined_before.dart.direct.transformed.expect
index c31aed4..d78301f 100644
--- a/pkg/front_end/testcases/inference/instantiate_to_bounds_generic_has_bound_defined_before.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/instantiate_to_bounds_generic_has_bound_defined_before.dart.direct.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class A<T extends core::int> extends core::Object {
+class A<T extends core::int = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/inference/instantiate_to_bounds_generic_has_bound_defined_before.dart.strong.expect b/pkg/front_end/testcases/inference/instantiate_to_bounds_generic_has_bound_defined_before.dart.strong.expect
index 250e9df..006a1e5 100644
--- a/pkg/front_end/testcases/inference/instantiate_to_bounds_generic_has_bound_defined_before.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/instantiate_to_bounds_generic_has_bound_defined_before.dart.strong.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class A<T extends core::int> extends core::Object {
+class A<T extends core::int = core::int> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/inference/instantiate_to_bounds_generic_has_bound_defined_before.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/instantiate_to_bounds_generic_has_bound_defined_before.dart.strong.transformed.expect
index 250e9df..006a1e5 100644
--- a/pkg/front_end/testcases/inference/instantiate_to_bounds_generic_has_bound_defined_before.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/instantiate_to_bounds_generic_has_bound_defined_before.dart.strong.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class A<T extends core::int> extends core::Object {
+class A<T extends core::int = core::int> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/inference/instantiate_to_bounds_invoke_constructor_no_bound.dart.direct.expect b/pkg/front_end/testcases/inference/instantiate_to_bounds_invoke_constructor_no_bound.dart.direct.expect
index ab2d9ba..cbe8ecd 100644
--- a/pkg/front_end/testcases/inference/instantiate_to_bounds_invoke_constructor_no_bound.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/instantiate_to_bounds_invoke_constructor_no_bound.dart.direct.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class C<T extends core::Object> extends core::Object {
+class C<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/inference/instantiate_to_bounds_invoke_constructor_no_bound.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/instantiate_to_bounds_invoke_constructor_no_bound.dart.direct.transformed.expect
index ab2d9ba..cbe8ecd 100644
--- a/pkg/front_end/testcases/inference/instantiate_to_bounds_invoke_constructor_no_bound.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/instantiate_to_bounds_invoke_constructor_no_bound.dart.direct.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class C<T extends core::Object> extends core::Object {
+class C<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/inference/instantiate_to_bounds_invoke_constructor_no_bound.dart.strong.expect b/pkg/front_end/testcases/inference/instantiate_to_bounds_invoke_constructor_no_bound.dart.strong.expect
index 8e3e3d3..ab4b6a5 100644
--- a/pkg/front_end/testcases/inference/instantiate_to_bounds_invoke_constructor_no_bound.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/instantiate_to_bounds_invoke_constructor_no_bound.dart.strong.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class C<T extends core::Object> extends core::Object {
+class C<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/inference/instantiate_to_bounds_invoke_constructor_no_bound.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/instantiate_to_bounds_invoke_constructor_no_bound.dart.strong.transformed.expect
index 8e3e3d3..ab4b6a5 100644
--- a/pkg/front_end/testcases/inference/instantiate_to_bounds_invoke_constructor_no_bound.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/instantiate_to_bounds_invoke_constructor_no_bound.dart.strong.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class C<T extends core::Object> extends core::Object {
+class C<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/inference/instantiate_to_bounds_invoke_constructor_type_args_exact.dart.direct.expect b/pkg/front_end/testcases/inference/instantiate_to_bounds_invoke_constructor_type_args_exact.dart.direct.expect
index e062f16..83feed9 100644
--- a/pkg/front_end/testcases/inference/instantiate_to_bounds_invoke_constructor_type_args_exact.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/instantiate_to_bounds_invoke_constructor_type_args_exact.dart.direct.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class C<T extends core::num> extends core::Object {
+class C<T extends core::num = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/inference/instantiate_to_bounds_invoke_constructor_type_args_exact.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/instantiate_to_bounds_invoke_constructor_type_args_exact.dart.direct.transformed.expect
index e062f16..83feed9 100644
--- a/pkg/front_end/testcases/inference/instantiate_to_bounds_invoke_constructor_type_args_exact.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/instantiate_to_bounds_invoke_constructor_type_args_exact.dart.direct.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class C<T extends core::num> extends core::Object {
+class C<T extends core::num = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/inference/instantiate_to_bounds_invoke_constructor_type_args_exact.dart.strong.expect b/pkg/front_end/testcases/inference/instantiate_to_bounds_invoke_constructor_type_args_exact.dart.strong.expect
index 75d4b70..9efc5a7 100644
--- a/pkg/front_end/testcases/inference/instantiate_to_bounds_invoke_constructor_type_args_exact.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/instantiate_to_bounds_invoke_constructor_type_args_exact.dart.strong.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class C<T extends core::num> extends core::Object {
+class C<T extends core::num = core::num> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/inference/instantiate_to_bounds_invoke_constructor_type_args_exact.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/instantiate_to_bounds_invoke_constructor_type_args_exact.dart.strong.transformed.expect
index 75d4b70..9efc5a7 100644
--- a/pkg/front_end/testcases/inference/instantiate_to_bounds_invoke_constructor_type_args_exact.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/instantiate_to_bounds_invoke_constructor_type_args_exact.dart.strong.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class C<T extends core::num> extends core::Object {
+class C<T extends core::num = core::num> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/inference/instantiate_to_bounds_not_generic.dart.direct.expect b/pkg/front_end/testcases/inference/instantiate_to_bounds_not_generic.dart.direct.expect
index 3a30a80..b4bf7c0 100644
--- a/pkg/front_end/testcases/inference/instantiate_to_bounds_not_generic.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/instantiate_to_bounds_not_generic.dart.direct.expect
@@ -7,7 +7,7 @@
: super core::Object::•()
;
}
-class B<T extends self::A> extends core::Object {
+class B<T extends self::A = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/inference/instantiate_to_bounds_not_generic.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/instantiate_to_bounds_not_generic.dart.direct.transformed.expect
index 3a30a80..b4bf7c0 100644
--- a/pkg/front_end/testcases/inference/instantiate_to_bounds_not_generic.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/instantiate_to_bounds_not_generic.dart.direct.transformed.expect
@@ -7,7 +7,7 @@
: super core::Object::•()
;
}
-class B<T extends self::A> extends core::Object {
+class B<T extends self::A = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/inference/instantiate_to_bounds_not_generic.dart.strong.expect b/pkg/front_end/testcases/inference/instantiate_to_bounds_not_generic.dart.strong.expect
index 7ac3b90d..e97dd63 100644
--- a/pkg/front_end/testcases/inference/instantiate_to_bounds_not_generic.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/instantiate_to_bounds_not_generic.dart.strong.expect
@@ -7,7 +7,7 @@
: super core::Object::•()
;
}
-class B<T extends self::A> extends core::Object {
+class B<T extends self::A = self::A> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/inference/instantiate_to_bounds_not_generic.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/instantiate_to_bounds_not_generic.dart.strong.transformed.expect
index 7ac3b90d..e97dd63 100644
--- a/pkg/front_end/testcases/inference/instantiate_to_bounds_not_generic.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/instantiate_to_bounds_not_generic.dart.strong.transformed.expect
@@ -7,7 +7,7 @@
: super core::Object::•()
;
}
-class B<T extends self::A> extends core::Object {
+class B<T extends self::A = self::A> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/inference/local_constructor_from_arguments.dart.direct.expect b/pkg/front_end/testcases/inference/local_constructor_from_arguments.dart.direct.expect
index d80777c..5513c11 100644
--- a/pkg/front_end/testcases/inference/local_constructor_from_arguments.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/local_constructor_from_arguments.dart.direct.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class C<T extends core::Object> extends core::Object {
+class C<T extends core::Object = dynamic> extends core::Object {
field self::C::T t;
constructor •(self::C::T t) → void
: self::C::t = t, super core::Object::•()
diff --git a/pkg/front_end/testcases/inference/local_constructor_from_arguments.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/local_constructor_from_arguments.dart.direct.transformed.expect
index d80777c..5513c11 100644
--- a/pkg/front_end/testcases/inference/local_constructor_from_arguments.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/local_constructor_from_arguments.dart.direct.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class C<T extends core::Object> extends core::Object {
+class C<T extends core::Object = dynamic> extends core::Object {
field self::C::T t;
constructor •(self::C::T t) → void
: self::C::t = t, super core::Object::•()
diff --git a/pkg/front_end/testcases/inference/local_constructor_from_arguments.dart.outline.expect b/pkg/front_end/testcases/inference/local_constructor_from_arguments.dart.outline.expect
index 55cf657..883eda4 100644
--- a/pkg/front_end/testcases/inference/local_constructor_from_arguments.dart.outline.expect
+++ b/pkg/front_end/testcases/inference/local_constructor_from_arguments.dart.outline.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class C<T extends core::Object> extends core::Object {
+class C<T extends core::Object = dynamic> extends core::Object {
field self::C::T t;
constructor •(self::C::T t) → void
;
diff --git a/pkg/front_end/testcases/inference/local_constructor_from_arguments.dart.strong.expect b/pkg/front_end/testcases/inference/local_constructor_from_arguments.dart.strong.expect
index 55e11e2..68853a4 100644
--- a/pkg/front_end/testcases/inference/local_constructor_from_arguments.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/local_constructor_from_arguments.dart.strong.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class C<T extends core::Object> extends core::Object {
+class C<T extends core::Object = dynamic> extends core::Object {
generic-covariant-impl generic-covariant-interface field self::C::T t;
constructor •(self::C::T t) → void
: self::C::t = t, super core::Object::•()
diff --git a/pkg/front_end/testcases/inference/local_constructor_from_arguments.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/local_constructor_from_arguments.dart.strong.transformed.expect
index 55e11e2..68853a4 100644
--- a/pkg/front_end/testcases/inference/local_constructor_from_arguments.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/local_constructor_from_arguments.dart.strong.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class C<T extends core::Object> extends core::Object {
+class C<T extends core::Object = dynamic> extends core::Object {
generic-covariant-impl generic-covariant-interface field self::C::T t;
constructor •(self::C::T t) → void
: self::C::t = t, super core::Object::•()
diff --git a/pkg/front_end/testcases/inference/method_call_with_type_arguments_instance_method.dart.direct.expect b/pkg/front_end/testcases/inference/method_call_with_type_arguments_instance_method.dart.direct.expect
index 0d4c4d9..faa9af9 100644
--- a/pkg/front_end/testcases/inference/method_call_with_type_arguments_instance_method.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/method_call_with_type_arguments_instance_method.dart.direct.expect
@@ -6,10 +6,10 @@
synthetic constructor •() → void
: super core::Object::•()
;
- method f<T extends core::Object>() → self::D<self::C::f::T>
+ method f<T extends core::Object = dynamic>() → self::D<self::C::f::T>
return null;
}
-class D<T extends core::Object> extends core::Object {
+class D<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/inference/method_call_with_type_arguments_instance_method.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/method_call_with_type_arguments_instance_method.dart.direct.transformed.expect
index 0d4c4d9..faa9af9 100644
--- a/pkg/front_end/testcases/inference/method_call_with_type_arguments_instance_method.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/method_call_with_type_arguments_instance_method.dart.direct.transformed.expect
@@ -6,10 +6,10 @@
synthetic constructor •() → void
: super core::Object::•()
;
- method f<T extends core::Object>() → self::D<self::C::f::T>
+ method f<T extends core::Object = dynamic>() → self::D<self::C::f::T>
return null;
}
-class D<T extends core::Object> extends core::Object {
+class D<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/inference/method_call_with_type_arguments_instance_method.dart.strong.expect b/pkg/front_end/testcases/inference/method_call_with_type_arguments_instance_method.dart.strong.expect
index 28b0bd9..100098d 100644
--- a/pkg/front_end/testcases/inference/method_call_with_type_arguments_instance_method.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/method_call_with_type_arguments_instance_method.dart.strong.expect
@@ -6,10 +6,10 @@
synthetic constructor •() → void
: super core::Object::•()
;
- method f<T extends core::Object>() → self::D<self::C::f::T>
+ method f<T extends core::Object = dynamic>() → self::D<self::C::f::T>
return null;
}
-class D<T extends core::Object> extends core::Object {
+class D<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/inference/method_call_with_type_arguments_instance_method.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/method_call_with_type_arguments_instance_method.dart.strong.transformed.expect
index 28b0bd9..100098d 100644
--- a/pkg/front_end/testcases/inference/method_call_with_type_arguments_instance_method.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/method_call_with_type_arguments_instance_method.dart.strong.transformed.expect
@@ -6,10 +6,10 @@
synthetic constructor •() → void
: super core::Object::•()
;
- method f<T extends core::Object>() → self::D<self::C::f::T>
+ method f<T extends core::Object = dynamic>() → self::D<self::C::f::T>
return null;
}
-class D<T extends core::Object> extends core::Object {
+class D<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/inference/method_call_with_type_arguments_instance_method_identifier_sequence.dart.direct.expect b/pkg/front_end/testcases/inference/method_call_with_type_arguments_instance_method_identifier_sequence.dart.direct.expect
index 2409e0e2..9812401 100644
--- a/pkg/front_end/testcases/inference/method_call_with_type_arguments_instance_method_identifier_sequence.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/method_call_with_type_arguments_instance_method_identifier_sequence.dart.direct.expect
@@ -6,10 +6,10 @@
synthetic constructor •() → void
: super core::Object::•()
;
- method f<T extends core::Object>() → self::D<self::C::f::T>
+ method f<T extends core::Object = dynamic>() → self::D<self::C::f::T>
return null;
}
-class D<T extends core::Object> extends core::Object {
+class D<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/inference/method_call_with_type_arguments_instance_method_identifier_sequence.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/method_call_with_type_arguments_instance_method_identifier_sequence.dart.direct.transformed.expect
index 2409e0e2..9812401 100644
--- a/pkg/front_end/testcases/inference/method_call_with_type_arguments_instance_method_identifier_sequence.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/method_call_with_type_arguments_instance_method_identifier_sequence.dart.direct.transformed.expect
@@ -6,10 +6,10 @@
synthetic constructor •() → void
: super core::Object::•()
;
- method f<T extends core::Object>() → self::D<self::C::f::T>
+ method f<T extends core::Object = dynamic>() → self::D<self::C::f::T>
return null;
}
-class D<T extends core::Object> extends core::Object {
+class D<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/inference/method_call_with_type_arguments_instance_method_identifier_sequence.dart.strong.expect b/pkg/front_end/testcases/inference/method_call_with_type_arguments_instance_method_identifier_sequence.dart.strong.expect
index e7701fd..03106b1 100644
--- a/pkg/front_end/testcases/inference/method_call_with_type_arguments_instance_method_identifier_sequence.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/method_call_with_type_arguments_instance_method_identifier_sequence.dart.strong.expect
@@ -6,10 +6,10 @@
synthetic constructor •() → void
: super core::Object::•()
;
- method f<T extends core::Object>() → self::D<self::C::f::T>
+ method f<T extends core::Object = dynamic>() → self::D<self::C::f::T>
return null;
}
-class D<T extends core::Object> extends core::Object {
+class D<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/inference/method_call_with_type_arguments_instance_method_identifier_sequence.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/method_call_with_type_arguments_instance_method_identifier_sequence.dart.strong.transformed.expect
index e7701fd..03106b1 100644
--- a/pkg/front_end/testcases/inference/method_call_with_type_arguments_instance_method_identifier_sequence.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/method_call_with_type_arguments_instance_method_identifier_sequence.dart.strong.transformed.expect
@@ -6,10 +6,10 @@
synthetic constructor •() → void
: super core::Object::•()
;
- method f<T extends core::Object>() → self::D<self::C::f::T>
+ method f<T extends core::Object = dynamic>() → self::D<self::C::f::T>
return null;
}
-class D<T extends core::Object> extends core::Object {
+class D<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/inference/method_call_with_type_arguments_static_method.dart.direct.expect b/pkg/front_end/testcases/inference/method_call_with_type_arguments_static_method.dart.direct.expect
index f986cdf..ed2b11c 100644
--- a/pkg/front_end/testcases/inference/method_call_with_type_arguments_static_method.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/method_call_with_type_arguments_static_method.dart.direct.expect
@@ -6,10 +6,10 @@
synthetic constructor •() → void
: super core::Object::•()
;
- static method f<T extends core::Object>() → self::D<self::C::f::T>
+ static method f<T extends core::Object = dynamic>() → self::D<self::C::f::T>
return null;
}
-class D<T extends core::Object> extends core::Object {
+class D<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/inference/method_call_with_type_arguments_static_method.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/method_call_with_type_arguments_static_method.dart.direct.transformed.expect
index f986cdf..ed2b11c 100644
--- a/pkg/front_end/testcases/inference/method_call_with_type_arguments_static_method.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/method_call_with_type_arguments_static_method.dart.direct.transformed.expect
@@ -6,10 +6,10 @@
synthetic constructor •() → void
: super core::Object::•()
;
- static method f<T extends core::Object>() → self::D<self::C::f::T>
+ static method f<T extends core::Object = dynamic>() → self::D<self::C::f::T>
return null;
}
-class D<T extends core::Object> extends core::Object {
+class D<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/inference/method_call_with_type_arguments_static_method.dart.strong.expect b/pkg/front_end/testcases/inference/method_call_with_type_arguments_static_method.dart.strong.expect
index 5a6e1b5..62f476b 100644
--- a/pkg/front_end/testcases/inference/method_call_with_type_arguments_static_method.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/method_call_with_type_arguments_static_method.dart.strong.expect
@@ -6,10 +6,10 @@
synthetic constructor •() → void
: super core::Object::•()
;
- static method f<T extends core::Object>() → self::D<self::C::f::T>
+ static method f<T extends core::Object = dynamic>() → self::D<self::C::f::T>
return null;
}
-class D<T extends core::Object> extends core::Object {
+class D<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/inference/method_call_with_type_arguments_static_method.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/method_call_with_type_arguments_static_method.dart.strong.transformed.expect
index 5a6e1b5..62f476b 100644
--- a/pkg/front_end/testcases/inference/method_call_with_type_arguments_static_method.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/method_call_with_type_arguments_static_method.dart.strong.transformed.expect
@@ -6,10 +6,10 @@
synthetic constructor •() → void
: super core::Object::•()
;
- static method f<T extends core::Object>() → self::D<self::C::f::T>
+ static method f<T extends core::Object = dynamic>() → self::D<self::C::f::T>
return null;
}
-class D<T extends core::Object> extends core::Object {
+class D<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/inference/method_call_with_type_arguments_top_level_function.dart.direct.expect b/pkg/front_end/testcases/inference/method_call_with_type_arguments_top_level_function.dart.direct.expect
index 9b0f603..eb7c958 100644
--- a/pkg/front_end/testcases/inference/method_call_with_type_arguments_top_level_function.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/method_call_with_type_arguments_top_level_function.dart.direct.expect
@@ -2,13 +2,13 @@
import self as self;
import "dart:core" as core;
-class D<T extends core::Object> extends core::Object {
+class D<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
static field dynamic g = self::f<core::int>();
-static method f<T extends core::Object>() → self::D<self::f::T>
+static method f<T extends core::Object = dynamic>() → self::D<self::f::T>
return null;
static method main() → dynamic {
self::g;
diff --git a/pkg/front_end/testcases/inference/method_call_with_type_arguments_top_level_function.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/method_call_with_type_arguments_top_level_function.dart.direct.transformed.expect
index 9b0f603..eb7c958 100644
--- a/pkg/front_end/testcases/inference/method_call_with_type_arguments_top_level_function.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/method_call_with_type_arguments_top_level_function.dart.direct.transformed.expect
@@ -2,13 +2,13 @@
import self as self;
import "dart:core" as core;
-class D<T extends core::Object> extends core::Object {
+class D<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
static field dynamic g = self::f<core::int>();
-static method f<T extends core::Object>() → self::D<self::f::T>
+static method f<T extends core::Object = dynamic>() → self::D<self::f::T>
return null;
static method main() → dynamic {
self::g;
diff --git a/pkg/front_end/testcases/inference/method_call_with_type_arguments_top_level_function.dart.strong.expect b/pkg/front_end/testcases/inference/method_call_with_type_arguments_top_level_function.dart.strong.expect
index 711c11f..ede5169 100644
--- a/pkg/front_end/testcases/inference/method_call_with_type_arguments_top_level_function.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/method_call_with_type_arguments_top_level_function.dart.strong.expect
@@ -2,13 +2,13 @@
import self as self;
import "dart:core" as core;
-class D<T extends core::Object> extends core::Object {
+class D<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
static field self::D<core::int> g = self::f<core::int>();
-static method f<T extends core::Object>() → self::D<self::f::T>
+static method f<T extends core::Object = dynamic>() → self::D<self::f::T>
return null;
static method main() → dynamic {
self::g;
diff --git a/pkg/front_end/testcases/inference/method_call_with_type_arguments_top_level_function.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/method_call_with_type_arguments_top_level_function.dart.strong.transformed.expect
index 711c11f..ede5169 100644
--- a/pkg/front_end/testcases/inference/method_call_with_type_arguments_top_level_function.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/method_call_with_type_arguments_top_level_function.dart.strong.transformed.expect
@@ -2,13 +2,13 @@
import self as self;
import "dart:core" as core;
-class D<T extends core::Object> extends core::Object {
+class D<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
static field self::D<core::int> g = self::f<core::int>();
-static method f<T extends core::Object>() → self::D<self::f::T>
+static method f<T extends core::Object = dynamic>() → self::D<self::f::T>
return null;
static method main() → dynamic {
self::g;
diff --git a/pkg/front_end/testcases/inference/mixin_inference_instantiate_to_bounds_1.dart.direct.expect b/pkg/front_end/testcases/inference/mixin_inference_instantiate_to_bounds_1.dart.direct.expect
index 5bb0107b..b56f103 100644
--- a/pkg/front_end/testcases/inference/mixin_inference_instantiate_to_bounds_1.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/mixin_inference_instantiate_to_bounds_1.dart.direct.expect
@@ -2,12 +2,12 @@
import self as self;
import "dart:core" as core;
-class I<X extends core::Object> extends core::Object {
+class I<X extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class M0<X extends core::Object, Y extends core::String> extends self::I<self::M0::X> {
+class M0<X extends core::Object = dynamic, Y extends core::String = dynamic> extends self::I<self::M0::X> {
synthetic constructor •() → void
: super self::I::•()
;
diff --git a/pkg/front_end/testcases/inference/mixin_inference_instantiate_to_bounds_1.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/mixin_inference_instantiate_to_bounds_1.dart.direct.transformed.expect
index babd076..985fb07 100644
--- a/pkg/front_end/testcases/inference/mixin_inference_instantiate_to_bounds_1.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/mixin_inference_instantiate_to_bounds_1.dart.direct.transformed.expect
@@ -2,12 +2,12 @@
import self as self;
import "dart:core" as core;
-class I<X extends core::Object> extends core::Object {
+class I<X extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class M0<X extends core::Object, Y extends core::String> extends self::I<self::M0::X> {
+class M0<X extends core::Object = dynamic, Y extends core::String = dynamic> extends self::I<self::M0::X> {
synthetic constructor •() → void
: super self::I::•()
;
diff --git a/pkg/front_end/testcases/inference/mixin_inference_instantiate_to_bounds_1.dart.outline.expect b/pkg/front_end/testcases/inference/mixin_inference_instantiate_to_bounds_1.dart.outline.expect
index d2d243e..43c1de6 100644
--- a/pkg/front_end/testcases/inference/mixin_inference_instantiate_to_bounds_1.dart.outline.expect
+++ b/pkg/front_end/testcases/inference/mixin_inference_instantiate_to_bounds_1.dart.outline.expect
@@ -2,11 +2,11 @@
import self as self;
import "dart:core" as core;
-class I<X extends core::Object> extends core::Object {
+class I<X extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
;
}
-class M0<X extends core::Object, Y extends core::String> extends self::I<self::M0::X> {
+class M0<X extends core::Object = dynamic, Y extends core::String = dynamic> extends self::I<self::M0::X> {
synthetic constructor •() → void
;
}
diff --git a/pkg/front_end/testcases/inference/mixin_inference_instantiate_to_bounds_1.dart.strong.expect b/pkg/front_end/testcases/inference/mixin_inference_instantiate_to_bounds_1.dart.strong.expect
index c88b202..46148e92 100644
--- a/pkg/front_end/testcases/inference/mixin_inference_instantiate_to_bounds_1.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/mixin_inference_instantiate_to_bounds_1.dart.strong.expect
@@ -2,12 +2,12 @@
import self as self;
import "dart:core" as core;
-class I<X extends core::Object> extends core::Object {
+class I<X extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class M0<X extends core::Object, Y extends core::String> extends self::I<self::M0::X> {
+class M0<X extends core::Object = dynamic, Y extends core::String = core::String> extends self::I<self::M0::X> {
synthetic constructor •() → void
: super self::I::•()
;
diff --git a/pkg/front_end/testcases/inference/mixin_inference_instantiate_to_bounds_1.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/mixin_inference_instantiate_to_bounds_1.dart.strong.transformed.expect
index 3dfcef8..149f1f7 100644
--- a/pkg/front_end/testcases/inference/mixin_inference_instantiate_to_bounds_1.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/mixin_inference_instantiate_to_bounds_1.dart.strong.transformed.expect
@@ -2,12 +2,12 @@
import self as self;
import "dart:core" as core;
-class I<X extends core::Object> extends core::Object {
+class I<X extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class M0<X extends core::Object, Y extends core::String> extends self::I<self::M0::X> {
+class M0<X extends core::Object = dynamic, Y extends core::String = core::String> extends self::I<self::M0::X> {
synthetic constructor •() → void
: super self::I::•()
;
diff --git a/pkg/front_end/testcases/inference/mixin_inference_instantiate_to_bounds_2.dart.direct.expect b/pkg/front_end/testcases/inference/mixin_inference_instantiate_to_bounds_2.dart.direct.expect
index 99c0ac1..afaa901 100644
--- a/pkg/front_end/testcases/inference/mixin_inference_instantiate_to_bounds_2.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/mixin_inference_instantiate_to_bounds_2.dart.direct.expect
@@ -2,12 +2,12 @@
import self as self;
import "dart:core" as core;
-class I<X extends core::Object> extends core::Object {
+class I<X extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class M0<X extends core::Object, Y extends self::M0::X> extends self::I<self::M0::X> {
+class M0<X extends core::Object = dynamic, Y extends self::M0::X = dynamic> extends self::I<self::M0::X> {
synthetic constructor •() → void
: super self::I::•()
;
diff --git a/pkg/front_end/testcases/inference/mixin_inference_instantiate_to_bounds_2.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/mixin_inference_instantiate_to_bounds_2.dart.direct.transformed.expect
index 88b88c5..76f85c6 100644
--- a/pkg/front_end/testcases/inference/mixin_inference_instantiate_to_bounds_2.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/mixin_inference_instantiate_to_bounds_2.dart.direct.transformed.expect
@@ -2,12 +2,12 @@
import self as self;
import "dart:core" as core;
-class I<X extends core::Object> extends core::Object {
+class I<X extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class M0<X extends core::Object, Y extends self::M0::X> extends self::I<self::M0::X> {
+class M0<X extends core::Object = dynamic, Y extends self::M0::X = dynamic> extends self::I<self::M0::X> {
synthetic constructor •() → void
: super self::I::•()
;
diff --git a/pkg/front_end/testcases/inference/mixin_inference_instantiate_to_bounds_2.dart.outline.expect b/pkg/front_end/testcases/inference/mixin_inference_instantiate_to_bounds_2.dart.outline.expect
index b32af06..715d575 100644
--- a/pkg/front_end/testcases/inference/mixin_inference_instantiate_to_bounds_2.dart.outline.expect
+++ b/pkg/front_end/testcases/inference/mixin_inference_instantiate_to_bounds_2.dart.outline.expect
@@ -2,11 +2,11 @@
import self as self;
import "dart:core" as core;
-class I<X extends core::Object> extends core::Object {
+class I<X extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
;
}
-class M0<X extends core::Object, Y extends self::M0::X> extends self::I<self::M0::X> {
+class M0<X extends core::Object = dynamic, Y extends self::M0::X = dynamic> extends self::I<self::M0::X> {
synthetic constructor •() → void
;
}
diff --git a/pkg/front_end/testcases/inference/mixin_inference_instantiate_to_bounds_2.dart.strong.expect b/pkg/front_end/testcases/inference/mixin_inference_instantiate_to_bounds_2.dart.strong.expect
index fc43a81..4df303d 100644
--- a/pkg/front_end/testcases/inference/mixin_inference_instantiate_to_bounds_2.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/mixin_inference_instantiate_to_bounds_2.dart.strong.expect
@@ -2,12 +2,12 @@
import self as self;
import "dart:core" as core;
-class I<X extends core::Object> extends core::Object {
+class I<X extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class M0<X extends core::Object, Y extends self::M0::X> extends self::I<self::M0::X> {
+class M0<X extends core::Object = dynamic, Y extends self::M0::X = dynamic> extends self::I<self::M0::X> {
synthetic constructor •() → void
: super self::I::•()
;
diff --git a/pkg/front_end/testcases/inference/mixin_inference_instantiate_to_bounds_2.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/mixin_inference_instantiate_to_bounds_2.dart.strong.transformed.expect
index db58674..49745bb 100644
--- a/pkg/front_end/testcases/inference/mixin_inference_instantiate_to_bounds_2.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/mixin_inference_instantiate_to_bounds_2.dart.strong.transformed.expect
@@ -2,12 +2,12 @@
import self as self;
import "dart:core" as core;
-class I<X extends core::Object> extends core::Object {
+class I<X extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class M0<X extends core::Object, Y extends self::M0::X> extends self::I<self::M0::X> {
+class M0<X extends core::Object = dynamic, Y extends self::M0::X = dynamic> extends self::I<self::M0::X> {
synthetic constructor •() → void
: super self::I::•()
;
diff --git a/pkg/front_end/testcases/inference/mixin_inference_instantiate_to_bounds_3.dart.direct.expect b/pkg/front_end/testcases/inference/mixin_inference_instantiate_to_bounds_3.dart.direct.expect
index 1bf2b7f..8d308b9 100644
--- a/pkg/front_end/testcases/inference/mixin_inference_instantiate_to_bounds_3.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/mixin_inference_instantiate_to_bounds_3.dart.direct.expect
@@ -2,12 +2,12 @@
import self as self;
import "dart:core" as core;
-class I<X extends core::Object> extends core::Object {
+class I<X extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class M0<X extends core::Object, Y extends core::Comparable<self::M0::Y>> extends self::I<self::M0::X> {
+class M0<X extends core::Object = dynamic, Y extends core::Comparable<self::M0::Y> = dynamic> extends self::I<self::M0::X> {
synthetic constructor •() → void
: super self::I::•()
;
diff --git a/pkg/front_end/testcases/inference/mixin_inference_instantiate_to_bounds_3.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/mixin_inference_instantiate_to_bounds_3.dart.direct.transformed.expect
index af781d1..4b68fa6 100644
--- a/pkg/front_end/testcases/inference/mixin_inference_instantiate_to_bounds_3.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/mixin_inference_instantiate_to_bounds_3.dart.direct.transformed.expect
@@ -2,12 +2,12 @@
import self as self;
import "dart:core" as core;
-class I<X extends core::Object> extends core::Object {
+class I<X extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class M0<X extends core::Object, Y extends core::Comparable<self::M0::Y>> extends self::I<self::M0::X> {
+class M0<X extends core::Object = dynamic, Y extends core::Comparable<self::M0::Y> = dynamic> extends self::I<self::M0::X> {
synthetic constructor •() → void
: super self::I::•()
;
diff --git a/pkg/front_end/testcases/inference/mixin_inference_instantiate_to_bounds_3.dart.outline.expect b/pkg/front_end/testcases/inference/mixin_inference_instantiate_to_bounds_3.dart.outline.expect
index 5a8614d..df1859b 100644
--- a/pkg/front_end/testcases/inference/mixin_inference_instantiate_to_bounds_3.dart.outline.expect
+++ b/pkg/front_end/testcases/inference/mixin_inference_instantiate_to_bounds_3.dart.outline.expect
@@ -2,11 +2,11 @@
import self as self;
import "dart:core" as core;
-class I<X extends core::Object> extends core::Object {
+class I<X extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
;
}
-class M0<X extends core::Object, Y extends core::Comparable<self::M0::Y>> extends self::I<self::M0::X> {
+class M0<X extends core::Object = dynamic, Y extends core::Comparable<self::M0::Y> = dynamic> extends self::I<self::M0::X> {
synthetic constructor •() → void
;
}
diff --git a/pkg/front_end/testcases/inference/mixin_inference_instantiate_to_bounds_3.dart.strong.expect b/pkg/front_end/testcases/inference/mixin_inference_instantiate_to_bounds_3.dart.strong.expect
index 261aee6..661c0f5 100644
--- a/pkg/front_end/testcases/inference/mixin_inference_instantiate_to_bounds_3.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/mixin_inference_instantiate_to_bounds_3.dart.strong.expect
@@ -2,12 +2,12 @@
import self as self;
import "dart:core" as core;
-class I<X extends core::Object> extends core::Object {
+class I<X extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class M0<X extends core::Object, Y extends core::Comparable<self::M0::Y>> extends self::I<self::M0::X> {
+class M0<X extends core::Object = dynamic, Y extends core::Comparable<self::M0::Y> = core::Comparable<dynamic>> extends self::I<self::M0::X> {
synthetic constructor •() → void
: super self::I::•()
;
diff --git a/pkg/front_end/testcases/inference/mixin_inference_instantiate_to_bounds_3.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/mixin_inference_instantiate_to_bounds_3.dart.strong.transformed.expect
index c7f6535..b13c5c1 100644
--- a/pkg/front_end/testcases/inference/mixin_inference_instantiate_to_bounds_3.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/mixin_inference_instantiate_to_bounds_3.dart.strong.transformed.expect
@@ -2,12 +2,12 @@
import self as self;
import "dart:core" as core;
-class I<X extends core::Object> extends core::Object {
+class I<X extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class M0<X extends core::Object, Y extends core::Comparable<self::M0::Y>> extends self::I<self::M0::X> {
+class M0<X extends core::Object = dynamic, Y extends core::Comparable<self::M0::Y> = core::Comparable<dynamic>> extends self::I<self::M0::X> {
synthetic constructor •() → void
: super self::I::•()
;
diff --git a/pkg/front_end/testcases/inference/mixin_inference_multiple_constraints.dart.direct.expect b/pkg/front_end/testcases/inference/mixin_inference_multiple_constraints.dart.direct.expect
index 732cded..b84a7e5e 100644
--- a/pkg/front_end/testcases/inference/mixin_inference_multiple_constraints.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/mixin_inference_multiple_constraints.dart.direct.expect
@@ -2,19 +2,19 @@
import self as self;
import "dart:core" as core;
-class I<X extends core::Object> extends core::Object {
+class I<X extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class J<X extends core::Object> extends core::Object {
+class J<X extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-abstract class _M0&I&J<X extends core::Object, Y extends core::Object> = self::I<self::_M0&I&J::X> with self::J<self::_M0&I&J::Y> {
+abstract class _M0&I&J<X extends core::Object = dynamic, Y extends core::Object = dynamic> = self::I<self::_M0&I&J::X> with self::J<self::_M0&I&J::Y> {
}
-class M0<X extends core::Object, Y extends core::Object> extends self::_M0&I&J<self::M0::X, self::M0::Y> {
+class M0<X extends core::Object = dynamic, Y extends core::Object = dynamic> extends self::_M0&I&J<self::M0::X, self::M0::Y> {
synthetic constructor •() → void
: super self::I::•()
;
diff --git a/pkg/front_end/testcases/inference/mixin_inference_multiple_constraints.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/mixin_inference_multiple_constraints.dart.direct.transformed.expect
index 6bd4312..2feb2bd 100644
--- a/pkg/front_end/testcases/inference/mixin_inference_multiple_constraints.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/mixin_inference_multiple_constraints.dart.direct.transformed.expect
@@ -2,22 +2,22 @@
import self as self;
import "dart:core" as core;
-class I<X extends core::Object> extends core::Object {
+class I<X extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class J<X extends core::Object> extends core::Object {
+class J<X extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-abstract class _M0&I&J<X extends core::Object, Y extends core::Object> extends self::I<self::_M0&I&J::X> implements self::J<self::_M0&I&J::Y> {
+abstract class _M0&I&J<X extends core::Object = dynamic, Y extends core::Object = dynamic> extends self::I<self::_M0&I&J::X> implements self::J<self::_M0&I&J::Y> {
synthetic constructor •() → void
: super self::I::•()
;
}
-class M0<X extends core::Object, Y extends core::Object> extends self::_M0&I&J<self::M0::X, self::M0::Y> {
+class M0<X extends core::Object = dynamic, Y extends core::Object = dynamic> extends self::_M0&I&J<self::M0::X, self::M0::Y> {
synthetic constructor •() → void
: super self::I::•()
;
diff --git a/pkg/front_end/testcases/inference/mixin_inference_multiple_constraints.dart.outline.expect b/pkg/front_end/testcases/inference/mixin_inference_multiple_constraints.dart.outline.expect
index 5d417f7..6ea16975 100644
--- a/pkg/front_end/testcases/inference/mixin_inference_multiple_constraints.dart.outline.expect
+++ b/pkg/front_end/testcases/inference/mixin_inference_multiple_constraints.dart.outline.expect
@@ -2,17 +2,17 @@
import self as self;
import "dart:core" as core;
-class I<X extends core::Object> extends core::Object {
+class I<X extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
;
}
-class J<X extends core::Object> extends core::Object {
+class J<X extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
;
}
-abstract class _M0&I&J<X extends core::Object, Y extends core::Object> = self::I<self::_M0&I&J::X> with self::J<self::_M0&I&J::Y> {
+abstract class _M0&I&J<X extends core::Object = dynamic, Y extends core::Object = dynamic> = self::I<self::_M0&I&J::X> with self::J<self::_M0&I&J::Y> {
}
-class M0<X extends core::Object, Y extends core::Object> extends self::_M0&I&J<self::M0::X, self::M0::Y> {
+class M0<X extends core::Object = dynamic, Y extends core::Object = dynamic> extends self::_M0&I&J<self::M0::X, self::M0::Y> {
synthetic constructor •() → void
;
}
diff --git a/pkg/front_end/testcases/inference/mixin_inference_multiple_constraints.dart.strong.expect b/pkg/front_end/testcases/inference/mixin_inference_multiple_constraints.dart.strong.expect
index 92d614a..d395781 100644
--- a/pkg/front_end/testcases/inference/mixin_inference_multiple_constraints.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/mixin_inference_multiple_constraints.dart.strong.expect
@@ -2,19 +2,19 @@
import self as self;
import "dart:core" as core;
-class I<X extends core::Object> extends core::Object {
+class I<X extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class J<X extends core::Object> extends core::Object {
+class J<X extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-abstract class _M0&I&J<X extends core::Object, Y extends core::Object> = self::I<self::_M0&I&J::X> with self::J<self::_M0&I&J::Y> {
+abstract class _M0&I&J<X extends core::Object = dynamic, Y extends core::Object = dynamic> = self::I<self::_M0&I&J::X> with self::J<self::_M0&I&J::Y> {
}
-class M0<X extends core::Object, Y extends core::Object> extends self::_M0&I&J<self::M0::X, self::M0::Y> {
+class M0<X extends core::Object = dynamic, Y extends core::Object = dynamic> extends self::_M0&I&J<self::M0::X, self::M0::Y> {
synthetic constructor •() → void
: super self::I::•()
;
diff --git a/pkg/front_end/testcases/inference/mixin_inference_multiple_constraints.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/mixin_inference_multiple_constraints.dart.strong.transformed.expect
index b0a644f..9173943 100644
--- a/pkg/front_end/testcases/inference/mixin_inference_multiple_constraints.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/mixin_inference_multiple_constraints.dart.strong.transformed.expect
@@ -2,22 +2,22 @@
import self as self;
import "dart:core" as core;
-class I<X extends core::Object> extends core::Object {
+class I<X extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class J<X extends core::Object> extends core::Object {
+class J<X extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-abstract class _M0&I&J<X extends core::Object, Y extends core::Object> extends self::I<self::_M0&I&J::X> implements self::J<self::_M0&I&J::Y> {
+abstract class _M0&I&J<X extends core::Object = dynamic, Y extends core::Object = dynamic> extends self::I<self::_M0&I&J::X> implements self::J<self::_M0&I&J::Y> {
synthetic constructor •() → void
: super self::I::•()
;
}
-class M0<X extends core::Object, Y extends core::Object> extends self::_M0&I&J<self::M0::X, self::M0::Y> {
+class M0<X extends core::Object = dynamic, Y extends core::Object = dynamic> extends self::_M0&I&J<self::M0::X, self::M0::Y> {
synthetic constructor •() → void
: super self::I::•()
;
diff --git a/pkg/front_end/testcases/inference/mixin_inference_non_trivial_constraints.dart.direct.expect b/pkg/front_end/testcases/inference/mixin_inference_non_trivial_constraints.dart.direct.expect
index ce175b8..5328a92 100644
--- a/pkg/front_end/testcases/inference/mixin_inference_non_trivial_constraints.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/mixin_inference_non_trivial_constraints.dart.direct.expect
@@ -2,22 +2,22 @@
import self as self;
import "dart:core" as core;
-class I<X extends core::Object> extends core::Object {
+class I<X extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class M0<T extends core::Object> extends self::I<core::List<self::M0::T>> {
+class M0<T extends core::Object = dynamic> extends self::I<core::List<self::M0::T>> {
synthetic constructor •() → void
: super self::I::•()
;
}
-class M1<T extends core::Object> extends self::I<core::List<self::M1::T>> {
+class M1<T extends core::Object = dynamic> extends self::I<core::List<self::M1::T>> {
synthetic constructor •() → void
: super self::I::•()
;
}
-class M2<T extends core::Object> extends self::M1<core::Map<self::M2::T, self::M2::T>> {
+class M2<T extends core::Object = dynamic> extends self::M1<core::Map<self::M2::T, self::M2::T>> {
synthetic constructor •() → void
: super self::M1::•()
;
diff --git a/pkg/front_end/testcases/inference/mixin_inference_non_trivial_constraints.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/mixin_inference_non_trivial_constraints.dart.direct.transformed.expect
index 47d99df..bcf0add 100644
--- a/pkg/front_end/testcases/inference/mixin_inference_non_trivial_constraints.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/mixin_inference_non_trivial_constraints.dart.direct.transformed.expect
@@ -2,22 +2,22 @@
import self as self;
import "dart:core" as core;
-class I<X extends core::Object> extends core::Object {
+class I<X extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class M0<T extends core::Object> extends self::I<core::List<self::M0::T>> {
+class M0<T extends core::Object = dynamic> extends self::I<core::List<self::M0::T>> {
synthetic constructor •() → void
: super self::I::•()
;
}
-class M1<T extends core::Object> extends self::I<core::List<self::M1::T>> {
+class M1<T extends core::Object = dynamic> extends self::I<core::List<self::M1::T>> {
synthetic constructor •() → void
: super self::I::•()
;
}
-class M2<T extends core::Object> extends self::M1<core::Map<self::M2::T, self::M2::T>> {
+class M2<T extends core::Object = dynamic> extends self::M1<core::Map<self::M2::T, self::M2::T>> {
synthetic constructor •() → void
: super self::M1::•()
;
diff --git a/pkg/front_end/testcases/inference/mixin_inference_non_trivial_constraints.dart.outline.expect b/pkg/front_end/testcases/inference/mixin_inference_non_trivial_constraints.dart.outline.expect
index a626b7e..e08bdb7 100644
--- a/pkg/front_end/testcases/inference/mixin_inference_non_trivial_constraints.dart.outline.expect
+++ b/pkg/front_end/testcases/inference/mixin_inference_non_trivial_constraints.dart.outline.expect
@@ -2,19 +2,19 @@
import self as self;
import "dart:core" as core;
-class I<X extends core::Object> extends core::Object {
+class I<X extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
;
}
-class M0<T extends core::Object> extends self::I<core::List<self::M0::T>> {
+class M0<T extends core::Object = dynamic> extends self::I<core::List<self::M0::T>> {
synthetic constructor •() → void
;
}
-class M1<T extends core::Object> extends self::I<core::List<self::M1::T>> {
+class M1<T extends core::Object = dynamic> extends self::I<core::List<self::M1::T>> {
synthetic constructor •() → void
;
}
-class M2<T extends core::Object> extends self::M1<core::Map<self::M2::T, self::M2::T>> {
+class M2<T extends core::Object = dynamic> extends self::M1<core::Map<self::M2::T, self::M2::T>> {
synthetic constructor •() → void
;
}
diff --git a/pkg/front_end/testcases/inference/mixin_inference_non_trivial_constraints.dart.strong.expect b/pkg/front_end/testcases/inference/mixin_inference_non_trivial_constraints.dart.strong.expect
index bc3f07d..83ed933 100644
--- a/pkg/front_end/testcases/inference/mixin_inference_non_trivial_constraints.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/mixin_inference_non_trivial_constraints.dart.strong.expect
@@ -2,22 +2,22 @@
import self as self;
import "dart:core" as core;
-class I<X extends core::Object> extends core::Object {
+class I<X extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class M0<T extends core::Object> extends self::I<core::List<self::M0::T>> {
+class M0<T extends core::Object = dynamic> extends self::I<core::List<self::M0::T>> {
synthetic constructor •() → void
: super self::I::•()
;
}
-class M1<T extends core::Object> extends self::I<core::List<self::M1::T>> {
+class M1<T extends core::Object = dynamic> extends self::I<core::List<self::M1::T>> {
synthetic constructor •() → void
: super self::I::•()
;
}
-class M2<T extends core::Object> extends self::M1<core::Map<self::M2::T, self::M2::T>> {
+class M2<T extends core::Object = dynamic> extends self::M1<core::Map<self::M2::T, self::M2::T>> {
synthetic constructor •() → void
: super self::M1::•()
;
diff --git a/pkg/front_end/testcases/inference/mixin_inference_non_trivial_constraints.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/mixin_inference_non_trivial_constraints.dart.strong.transformed.expect
index bab9455..274d765 100644
--- a/pkg/front_end/testcases/inference/mixin_inference_non_trivial_constraints.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/mixin_inference_non_trivial_constraints.dart.strong.transformed.expect
@@ -2,22 +2,22 @@
import self as self;
import "dart:core" as core;
-class I<X extends core::Object> extends core::Object {
+class I<X extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class M0<T extends core::Object> extends self::I<core::List<self::M0::T>> {
+class M0<T extends core::Object = dynamic> extends self::I<core::List<self::M0::T>> {
synthetic constructor •() → void
: super self::I::•()
;
}
-class M1<T extends core::Object> extends self::I<core::List<self::M1::T>> {
+class M1<T extends core::Object = dynamic> extends self::I<core::List<self::M1::T>> {
synthetic constructor •() → void
: super self::I::•()
;
}
-class M2<T extends core::Object> extends self::M1<core::Map<self::M2::T, self::M2::T>> {
+class M2<T extends core::Object = dynamic> extends self::M1<core::Map<self::M2::T, self::M2::T>> {
synthetic constructor •() → void
: super self::M1::•()
;
diff --git a/pkg/front_end/testcases/inference/mixin_inference_outwards_1.dart.direct.expect b/pkg/front_end/testcases/inference/mixin_inference_outwards_1.dart.direct.expect
index 58630ac..99b8e77 100644
--- a/pkg/front_end/testcases/inference/mixin_inference_outwards_1.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/mixin_inference_outwards_1.dart.direct.expect
@@ -2,17 +2,17 @@
import self as self;
import "dart:core" as core;
-class I<X extends core::Object> extends core::Object {
+class I<X extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class M0<T extends core::Object> extends self::I<self::M0::T> {
+class M0<T extends core::Object = dynamic> extends self::I<self::M0::T> {
synthetic constructor •() → void
: super self::I::•()
;
}
-class M1<T extends core::Object> extends self::I<self::M1::T> {
+class M1<T extends core::Object = dynamic> extends self::I<self::M1::T> {
synthetic constructor •() → void
: super self::I::•()
;
diff --git a/pkg/front_end/testcases/inference/mixin_inference_outwards_1.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/mixin_inference_outwards_1.dart.direct.transformed.expect
index 94e9c02..f099c87 100644
--- a/pkg/front_end/testcases/inference/mixin_inference_outwards_1.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/mixin_inference_outwards_1.dart.direct.transformed.expect
@@ -2,17 +2,17 @@
import self as self;
import "dart:core" as core;
-class I<X extends core::Object> extends core::Object {
+class I<X extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class M0<T extends core::Object> extends self::I<self::M0::T> {
+class M0<T extends core::Object = dynamic> extends self::I<self::M0::T> {
synthetic constructor •() → void
: super self::I::•()
;
}
-class M1<T extends core::Object> extends self::I<self::M1::T> {
+class M1<T extends core::Object = dynamic> extends self::I<self::M1::T> {
synthetic constructor •() → void
: super self::I::•()
;
diff --git a/pkg/front_end/testcases/inference/mixin_inference_outwards_1.dart.outline.expect b/pkg/front_end/testcases/inference/mixin_inference_outwards_1.dart.outline.expect
index e7482bf..faaabfd 100644
--- a/pkg/front_end/testcases/inference/mixin_inference_outwards_1.dart.outline.expect
+++ b/pkg/front_end/testcases/inference/mixin_inference_outwards_1.dart.outline.expect
@@ -2,15 +2,15 @@
import self as self;
import "dart:core" as core;
-class I<X extends core::Object> extends core::Object {
+class I<X extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
;
}
-class M0<T extends core::Object> extends self::I<self::M0::T> {
+class M0<T extends core::Object = dynamic> extends self::I<self::M0::T> {
synthetic constructor •() → void
;
}
-class M1<T extends core::Object> extends self::I<self::M1::T> {
+class M1<T extends core::Object = dynamic> extends self::I<self::M1::T> {
synthetic constructor •() → void
;
}
diff --git a/pkg/front_end/testcases/inference/mixin_inference_outwards_1.dart.strong.expect b/pkg/front_end/testcases/inference/mixin_inference_outwards_1.dart.strong.expect
index a21a809..2c2aa5c 100644
--- a/pkg/front_end/testcases/inference/mixin_inference_outwards_1.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/mixin_inference_outwards_1.dart.strong.expect
@@ -2,17 +2,17 @@
import self as self;
import "dart:core" as core;
-class I<X extends core::Object> extends core::Object {
+class I<X extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class M0<T extends core::Object> extends self::I<self::M0::T> {
+class M0<T extends core::Object = dynamic> extends self::I<self::M0::T> {
synthetic constructor •() → void
: super self::I::•()
;
}
-class M1<T extends core::Object> extends self::I<self::M1::T> {
+class M1<T extends core::Object = dynamic> extends self::I<self::M1::T> {
synthetic constructor •() → void
: super self::I::•()
;
diff --git a/pkg/front_end/testcases/inference/mixin_inference_outwards_1.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/mixin_inference_outwards_1.dart.strong.transformed.expect
index f1c52e6..701b84c 100644
--- a/pkg/front_end/testcases/inference/mixin_inference_outwards_1.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/mixin_inference_outwards_1.dart.strong.transformed.expect
@@ -2,17 +2,17 @@
import self as self;
import "dart:core" as core;
-class I<X extends core::Object> extends core::Object {
+class I<X extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class M0<T extends core::Object> extends self::I<self::M0::T> {
+class M0<T extends core::Object = dynamic> extends self::I<self::M0::T> {
synthetic constructor •() → void
: super self::I::•()
;
}
-class M1<T extends core::Object> extends self::I<self::M1::T> {
+class M1<T extends core::Object = dynamic> extends self::I<self::M1::T> {
synthetic constructor •() → void
: super self::I::•()
;
diff --git a/pkg/front_end/testcases/inference/mixin_inference_outwards_2.dart.direct.expect b/pkg/front_end/testcases/inference/mixin_inference_outwards_2.dart.direct.expect
index 848a79e..708e099 100644
--- a/pkg/front_end/testcases/inference/mixin_inference_outwards_2.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/mixin_inference_outwards_2.dart.direct.expect
@@ -2,22 +2,22 @@
import self as self;
import "dart:core" as core;
-class I<X extends core::Object> extends core::Object {
+class I<X extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class M0<T extends core::Object> extends self::I<self::M0::T> {
+class M0<T extends core::Object = dynamic> extends self::I<self::M0::T> {
synthetic constructor •() → void
: super self::I::•()
;
}
-class M1<T extends core::Object> extends self::I<self::M1::T> {
+class M1<T extends core::Object = dynamic> extends self::I<self::M1::T> {
synthetic constructor •() → void
: super self::I::•()
;
}
-class M2<T extends core::Object> extends self::I<self::M2::T> {
+class M2<T extends core::Object = dynamic> extends self::I<self::M2::T> {
synthetic constructor •() → void
: super self::I::•()
;
diff --git a/pkg/front_end/testcases/inference/mixin_inference_outwards_2.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/mixin_inference_outwards_2.dart.direct.transformed.expect
index 3988528..07fd39a 100644
--- a/pkg/front_end/testcases/inference/mixin_inference_outwards_2.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/mixin_inference_outwards_2.dart.direct.transformed.expect
@@ -2,22 +2,22 @@
import self as self;
import "dart:core" as core;
-class I<X extends core::Object> extends core::Object {
+class I<X extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class M0<T extends core::Object> extends self::I<self::M0::T> {
+class M0<T extends core::Object = dynamic> extends self::I<self::M0::T> {
synthetic constructor •() → void
: super self::I::•()
;
}
-class M1<T extends core::Object> extends self::I<self::M1::T> {
+class M1<T extends core::Object = dynamic> extends self::I<self::M1::T> {
synthetic constructor •() → void
: super self::I::•()
;
}
-class M2<T extends core::Object> extends self::I<self::M2::T> {
+class M2<T extends core::Object = dynamic> extends self::I<self::M2::T> {
synthetic constructor •() → void
: super self::I::•()
;
diff --git a/pkg/front_end/testcases/inference/mixin_inference_outwards_2.dart.outline.expect b/pkg/front_end/testcases/inference/mixin_inference_outwards_2.dart.outline.expect
index acc4658..d20ff99 100644
--- a/pkg/front_end/testcases/inference/mixin_inference_outwards_2.dart.outline.expect
+++ b/pkg/front_end/testcases/inference/mixin_inference_outwards_2.dart.outline.expect
@@ -2,19 +2,19 @@
import self as self;
import "dart:core" as core;
-class I<X extends core::Object> extends core::Object {
+class I<X extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
;
}
-class M0<T extends core::Object> extends self::I<self::M0::T> {
+class M0<T extends core::Object = dynamic> extends self::I<self::M0::T> {
synthetic constructor •() → void
;
}
-class M1<T extends core::Object> extends self::I<self::M1::T> {
+class M1<T extends core::Object = dynamic> extends self::I<self::M1::T> {
synthetic constructor •() → void
;
}
-class M2<T extends core::Object> extends self::I<self::M2::T> {
+class M2<T extends core::Object = dynamic> extends self::I<self::M2::T> {
synthetic constructor •() → void
;
}
diff --git a/pkg/front_end/testcases/inference/mixin_inference_outwards_2.dart.strong.expect b/pkg/front_end/testcases/inference/mixin_inference_outwards_2.dart.strong.expect
index 036d56c..cea7021 100644
--- a/pkg/front_end/testcases/inference/mixin_inference_outwards_2.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/mixin_inference_outwards_2.dart.strong.expect
@@ -2,22 +2,22 @@
import self as self;
import "dart:core" as core;
-class I<X extends core::Object> extends core::Object {
+class I<X extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class M0<T extends core::Object> extends self::I<self::M0::T> {
+class M0<T extends core::Object = dynamic> extends self::I<self::M0::T> {
synthetic constructor •() → void
: super self::I::•()
;
}
-class M1<T extends core::Object> extends self::I<self::M1::T> {
+class M1<T extends core::Object = dynamic> extends self::I<self::M1::T> {
synthetic constructor •() → void
: super self::I::•()
;
}
-class M2<T extends core::Object> extends self::I<self::M2::T> {
+class M2<T extends core::Object = dynamic> extends self::I<self::M2::T> {
synthetic constructor •() → void
: super self::I::•()
;
diff --git a/pkg/front_end/testcases/inference/mixin_inference_outwards_2.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/mixin_inference_outwards_2.dart.strong.transformed.expect
index 42ec419..d8aadbfc 100644
--- a/pkg/front_end/testcases/inference/mixin_inference_outwards_2.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/mixin_inference_outwards_2.dart.strong.transformed.expect
@@ -2,22 +2,22 @@
import self as self;
import "dart:core" as core;
-class I<X extends core::Object> extends core::Object {
+class I<X extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class M0<T extends core::Object> extends self::I<self::M0::T> {
+class M0<T extends core::Object = dynamic> extends self::I<self::M0::T> {
synthetic constructor •() → void
: super self::I::•()
;
}
-class M1<T extends core::Object> extends self::I<self::M1::T> {
+class M1<T extends core::Object = dynamic> extends self::I<self::M1::T> {
synthetic constructor •() → void
: super self::I::•()
;
}
-class M2<T extends core::Object> extends self::I<self::M2::T> {
+class M2<T extends core::Object = dynamic> extends self::I<self::M2::T> {
synthetic constructor •() → void
: super self::I::•()
;
diff --git a/pkg/front_end/testcases/inference/mixin_inference_outwards_3.dart.direct.expect b/pkg/front_end/testcases/inference/mixin_inference_outwards_3.dart.direct.expect
index a9749fe..cf9d1f4 100644
--- a/pkg/front_end/testcases/inference/mixin_inference_outwards_3.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/mixin_inference_outwards_3.dart.direct.expect
@@ -2,17 +2,17 @@
import self as self;
import "dart:core" as core;
-class I<X extends core::Object> extends core::Object {
+class I<X extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class M0<T extends core::Object> extends core::Object implements self::I<self::M0::T> {
+class M0<T extends core::Object = dynamic> extends core::Object implements self::I<self::M0::T> {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class M1<T extends core::Object> extends self::I<self::M1::T> {
+class M1<T extends core::Object = dynamic> extends self::I<self::M1::T> {
synthetic constructor •() → void
: super self::I::•()
;
diff --git a/pkg/front_end/testcases/inference/mixin_inference_outwards_3.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/mixin_inference_outwards_3.dart.direct.transformed.expect
index e737000..53f5baf 100644
--- a/pkg/front_end/testcases/inference/mixin_inference_outwards_3.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/mixin_inference_outwards_3.dart.direct.transformed.expect
@@ -2,17 +2,17 @@
import self as self;
import "dart:core" as core;
-class I<X extends core::Object> extends core::Object {
+class I<X extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class M0<T extends core::Object> extends core::Object implements self::I<self::M0::T> {
+class M0<T extends core::Object = dynamic> extends core::Object implements self::I<self::M0::T> {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class M1<T extends core::Object> extends self::I<self::M1::T> {
+class M1<T extends core::Object = dynamic> extends self::I<self::M1::T> {
synthetic constructor •() → void
: super self::I::•()
;
diff --git a/pkg/front_end/testcases/inference/mixin_inference_outwards_3.dart.outline.expect b/pkg/front_end/testcases/inference/mixin_inference_outwards_3.dart.outline.expect
index f83992c..79c34df 100644
--- a/pkg/front_end/testcases/inference/mixin_inference_outwards_3.dart.outline.expect
+++ b/pkg/front_end/testcases/inference/mixin_inference_outwards_3.dart.outline.expect
@@ -2,15 +2,15 @@
import self as self;
import "dart:core" as core;
-class I<X extends core::Object> extends core::Object {
+class I<X extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
;
}
-class M0<T extends core::Object> extends core::Object implements self::I<self::M0::T> {
+class M0<T extends core::Object = dynamic> extends core::Object implements self::I<self::M0::T> {
synthetic constructor •() → void
;
}
-class M1<T extends core::Object> extends self::I<self::M1::T> {
+class M1<T extends core::Object = dynamic> extends self::I<self::M1::T> {
synthetic constructor •() → void
;
}
diff --git a/pkg/front_end/testcases/inference/mixin_inference_outwards_3.dart.strong.expect b/pkg/front_end/testcases/inference/mixin_inference_outwards_3.dart.strong.expect
index a9749fe..cf9d1f4 100644
--- a/pkg/front_end/testcases/inference/mixin_inference_outwards_3.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/mixin_inference_outwards_3.dart.strong.expect
@@ -2,17 +2,17 @@
import self as self;
import "dart:core" as core;
-class I<X extends core::Object> extends core::Object {
+class I<X extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class M0<T extends core::Object> extends core::Object implements self::I<self::M0::T> {
+class M0<T extends core::Object = dynamic> extends core::Object implements self::I<self::M0::T> {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class M1<T extends core::Object> extends self::I<self::M1::T> {
+class M1<T extends core::Object = dynamic> extends self::I<self::M1::T> {
synthetic constructor •() → void
: super self::I::•()
;
diff --git a/pkg/front_end/testcases/inference/mixin_inference_outwards_4.dart.direct.expect b/pkg/front_end/testcases/inference/mixin_inference_outwards_4.dart.direct.expect
index b341add..8d072fe 100644
--- a/pkg/front_end/testcases/inference/mixin_inference_outwards_4.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/mixin_inference_outwards_4.dart.direct.expect
@@ -2,17 +2,17 @@
import self as self;
import "dart:core" as core;
-class I<X extends core::Object> extends core::Object {
+class I<X extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class M0<T extends core::Object> extends core::Object implements self::I<self::M0::T> {
+class M0<T extends core::Object = dynamic> extends core::Object implements self::I<self::M0::T> {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class M1<T extends core::Object> extends self::I<self::M1::T> {
+class M1<T extends core::Object = dynamic> extends self::I<self::M1::T> {
synthetic constructor •() → void
: super self::I::•()
;
diff --git a/pkg/front_end/testcases/inference/mixin_inference_outwards_4.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/mixin_inference_outwards_4.dart.direct.transformed.expect
index 2b4d638..d6e5c6c 100644
--- a/pkg/front_end/testcases/inference/mixin_inference_outwards_4.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/mixin_inference_outwards_4.dart.direct.transformed.expect
@@ -2,17 +2,17 @@
import self as self;
import "dart:core" as core;
-class I<X extends core::Object> extends core::Object {
+class I<X extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class M0<T extends core::Object> extends core::Object implements self::I<self::M0::T> {
+class M0<T extends core::Object = dynamic> extends core::Object implements self::I<self::M0::T> {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class M1<T extends core::Object> extends self::I<self::M1::T> {
+class M1<T extends core::Object = dynamic> extends self::I<self::M1::T> {
synthetic constructor •() → void
: super self::I::•()
;
diff --git a/pkg/front_end/testcases/inference/mixin_inference_outwards_4.dart.outline.expect b/pkg/front_end/testcases/inference/mixin_inference_outwards_4.dart.outline.expect
index 46f1868..9c4a906 100644
--- a/pkg/front_end/testcases/inference/mixin_inference_outwards_4.dart.outline.expect
+++ b/pkg/front_end/testcases/inference/mixin_inference_outwards_4.dart.outline.expect
@@ -2,15 +2,15 @@
import self as self;
import "dart:core" as core;
-class I<X extends core::Object> extends core::Object {
+class I<X extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
;
}
-class M0<T extends core::Object> extends core::Object implements self::I<self::M0::T> {
+class M0<T extends core::Object = dynamic> extends core::Object implements self::I<self::M0::T> {
synthetic constructor •() → void
;
}
-class M1<T extends core::Object> extends self::I<self::M1::T> {
+class M1<T extends core::Object = dynamic> extends self::I<self::M1::T> {
synthetic constructor •() → void
;
}
diff --git a/pkg/front_end/testcases/inference/mixin_inference_outwards_4.dart.strong.expect b/pkg/front_end/testcases/inference/mixin_inference_outwards_4.dart.strong.expect
index b341add..8d072fe 100644
--- a/pkg/front_end/testcases/inference/mixin_inference_outwards_4.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/mixin_inference_outwards_4.dart.strong.expect
@@ -2,17 +2,17 @@
import self as self;
import "dart:core" as core;
-class I<X extends core::Object> extends core::Object {
+class I<X extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class M0<T extends core::Object> extends core::Object implements self::I<self::M0::T> {
+class M0<T extends core::Object = dynamic> extends core::Object implements self::I<self::M0::T> {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class M1<T extends core::Object> extends self::I<self::M1::T> {
+class M1<T extends core::Object = dynamic> extends self::I<self::M1::T> {
synthetic constructor •() → void
: super self::I::•()
;
diff --git a/pkg/front_end/testcases/inference/mixin_inference_unification_1.dart.direct.expect b/pkg/front_end/testcases/inference/mixin_inference_unification_1.dart.direct.expect
index f15969d..7268b70 100644
--- a/pkg/front_end/testcases/inference/mixin_inference_unification_1.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/mixin_inference_unification_1.dart.direct.expect
@@ -2,17 +2,17 @@
import self as self;
import "dart:core" as core;
-class I<X extends core::Object, Y extends core::Object> extends core::Object {
+class I<X extends core::Object = dynamic, Y extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class M0<T extends core::Object> extends core::Object implements self::I<self::M0::T, core::int> {
+class M0<T extends core::Object = dynamic> extends core::Object implements self::I<self::M0::T, core::int> {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class M1<T extends core::Object> extends core::Object implements self::I<core::String, self::M1::T> {
+class M1<T extends core::Object = dynamic> extends core::Object implements self::I<core::String, self::M1::T> {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/inference/mixin_inference_unification_1.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/mixin_inference_unification_1.dart.direct.transformed.expect
index 1f32528..c6ca47c 100644
--- a/pkg/front_end/testcases/inference/mixin_inference_unification_1.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/mixin_inference_unification_1.dart.direct.transformed.expect
@@ -2,17 +2,17 @@
import self as self;
import "dart:core" as core;
-class I<X extends core::Object, Y extends core::Object> extends core::Object {
+class I<X extends core::Object = dynamic, Y extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class M0<T extends core::Object> extends core::Object implements self::I<self::M0::T, core::int> {
+class M0<T extends core::Object = dynamic> extends core::Object implements self::I<self::M0::T, core::int> {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class M1<T extends core::Object> extends core::Object implements self::I<core::String, self::M1::T> {
+class M1<T extends core::Object = dynamic> extends core::Object implements self::I<core::String, self::M1::T> {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/inference/mixin_inference_unification_1.dart.outline.expect b/pkg/front_end/testcases/inference/mixin_inference_unification_1.dart.outline.expect
index 4e5c65c..558e05a 100644
--- a/pkg/front_end/testcases/inference/mixin_inference_unification_1.dart.outline.expect
+++ b/pkg/front_end/testcases/inference/mixin_inference_unification_1.dart.outline.expect
@@ -2,15 +2,15 @@
import self as self;
import "dart:core" as core;
-class I<X extends core::Object, Y extends core::Object> extends core::Object {
+class I<X extends core::Object = dynamic, Y extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
;
}
-class M0<T extends core::Object> extends core::Object implements self::I<self::M0::T, core::int> {
+class M0<T extends core::Object = dynamic> extends core::Object implements self::I<self::M0::T, core::int> {
synthetic constructor •() → void
;
}
-class M1<T extends core::Object> extends core::Object implements self::I<core::String, self::M1::T> {
+class M1<T extends core::Object = dynamic> extends core::Object implements self::I<core::String, self::M1::T> {
synthetic constructor •() → void
;
}
diff --git a/pkg/front_end/testcases/inference/mixin_inference_unification_1.dart.strong.expect b/pkg/front_end/testcases/inference/mixin_inference_unification_1.dart.strong.expect
index f15969d..7268b70 100644
--- a/pkg/front_end/testcases/inference/mixin_inference_unification_1.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/mixin_inference_unification_1.dart.strong.expect
@@ -2,17 +2,17 @@
import self as self;
import "dart:core" as core;
-class I<X extends core::Object, Y extends core::Object> extends core::Object {
+class I<X extends core::Object = dynamic, Y extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class M0<T extends core::Object> extends core::Object implements self::I<self::M0::T, core::int> {
+class M0<T extends core::Object = dynamic> extends core::Object implements self::I<self::M0::T, core::int> {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class M1<T extends core::Object> extends core::Object implements self::I<core::String, self::M1::T> {
+class M1<T extends core::Object = dynamic> extends core::Object implements self::I<core::String, self::M1::T> {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/inference/mixin_inference_unification_2.dart.direct.expect b/pkg/front_end/testcases/inference/mixin_inference_unification_2.dart.direct.expect
index 1cf79e6..9b8dd77 100644
--- a/pkg/front_end/testcases/inference/mixin_inference_unification_2.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/mixin_inference_unification_2.dart.direct.expect
@@ -2,17 +2,17 @@
import self as self;
import "dart:core" as core;
-class I<X extends core::Object, Y extends core::Object> extends core::Object {
+class I<X extends core::Object = dynamic, Y extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class M0<T extends core::Object> extends core::Object implements self::I<self::M0::T, core::List<self::M0::T>> {
+class M0<T extends core::Object = dynamic> extends core::Object implements self::I<self::M0::T, core::List<self::M0::T>> {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class M1<T extends core::Object> extends core::Object implements self::I<core::List<self::M1::T>, self::M1::T> {
+class M1<T extends core::Object = dynamic> extends core::Object implements self::I<core::List<self::M1::T>, self::M1::T> {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/inference/mixin_inference_unification_2.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/mixin_inference_unification_2.dart.direct.transformed.expect
index 3819847..cc0d501 100644
--- a/pkg/front_end/testcases/inference/mixin_inference_unification_2.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/mixin_inference_unification_2.dart.direct.transformed.expect
@@ -2,17 +2,17 @@
import self as self;
import "dart:core" as core;
-class I<X extends core::Object, Y extends core::Object> extends core::Object {
+class I<X extends core::Object = dynamic, Y extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class M0<T extends core::Object> extends core::Object implements self::I<self::M0::T, core::List<self::M0::T>> {
+class M0<T extends core::Object = dynamic> extends core::Object implements self::I<self::M0::T, core::List<self::M0::T>> {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class M1<T extends core::Object> extends core::Object implements self::I<core::List<self::M1::T>, self::M1::T> {
+class M1<T extends core::Object = dynamic> extends core::Object implements self::I<core::List<self::M1::T>, self::M1::T> {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/inference/mixin_inference_unification_2.dart.outline.expect b/pkg/front_end/testcases/inference/mixin_inference_unification_2.dart.outline.expect
index 82b7624..0486b4b 100644
--- a/pkg/front_end/testcases/inference/mixin_inference_unification_2.dart.outline.expect
+++ b/pkg/front_end/testcases/inference/mixin_inference_unification_2.dart.outline.expect
@@ -2,15 +2,15 @@
import self as self;
import "dart:core" as core;
-class I<X extends core::Object, Y extends core::Object> extends core::Object {
+class I<X extends core::Object = dynamic, Y extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
;
}
-class M0<T extends core::Object> extends core::Object implements self::I<self::M0::T, core::List<self::M0::T>> {
+class M0<T extends core::Object = dynamic> extends core::Object implements self::I<self::M0::T, core::List<self::M0::T>> {
synthetic constructor •() → void
;
}
-class M1<T extends core::Object> extends core::Object implements self::I<core::List<self::M1::T>, self::M1::T> {
+class M1<T extends core::Object = dynamic> extends core::Object implements self::I<core::List<self::M1::T>, self::M1::T> {
synthetic constructor •() → void
;
}
diff --git a/pkg/front_end/testcases/inference/mixin_inference_unification_2.dart.strong.expect b/pkg/front_end/testcases/inference/mixin_inference_unification_2.dart.strong.expect
index 1cf79e6..9b8dd77 100644
--- a/pkg/front_end/testcases/inference/mixin_inference_unification_2.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/mixin_inference_unification_2.dart.strong.expect
@@ -2,17 +2,17 @@
import self as self;
import "dart:core" as core;
-class I<X extends core::Object, Y extends core::Object> extends core::Object {
+class I<X extends core::Object = dynamic, Y extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class M0<T extends core::Object> extends core::Object implements self::I<self::M0::T, core::List<self::M0::T>> {
+class M0<T extends core::Object = dynamic> extends core::Object implements self::I<self::M0::T, core::List<self::M0::T>> {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class M1<T extends core::Object> extends core::Object implements self::I<core::List<self::M1::T>, self::M1::T> {
+class M1<T extends core::Object = dynamic> extends core::Object implements self::I<core::List<self::M1::T>, self::M1::T> {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/inference/non_const_invocation.dart.direct.expect b/pkg/front_end/testcases/inference/non_const_invocation.dart.direct.expect
index a535f30..3526479 100644
--- a/pkg/front_end/testcases/inference/non_const_invocation.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/non_const_invocation.dart.direct.expect
@@ -2,8 +2,8 @@
import self as self;
import "dart:core" as core;
-typedef F<U extends core::Object, V extends core::Object> = (U) → V;
-class Foo<T extends core::Object> extends core::Object {
+typedef F<U extends core::Object = dynamic, V extends core::Object = dynamic> = (U) → V;
+class Foo<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
@@ -26,7 +26,7 @@
get v9() → core::Map<self::Foo::T, (self::Foo::T) → self::Foo::T>
return <dynamic, dynamic>{};
}
-class Bar<T extends core::Object> extends core::Object {
+class Bar<T extends core::Object = dynamic> extends core::Object {
const constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/inference/non_const_invocation.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/non_const_invocation.dart.direct.transformed.expect
index a535f30..3526479 100644
--- a/pkg/front_end/testcases/inference/non_const_invocation.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/non_const_invocation.dart.direct.transformed.expect
@@ -2,8 +2,8 @@
import self as self;
import "dart:core" as core;
-typedef F<U extends core::Object, V extends core::Object> = (U) → V;
-class Foo<T extends core::Object> extends core::Object {
+typedef F<U extends core::Object = dynamic, V extends core::Object = dynamic> = (U) → V;
+class Foo<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
@@ -26,7 +26,7 @@
get v9() → core::Map<self::Foo::T, (self::Foo::T) → self::Foo::T>
return <dynamic, dynamic>{};
}
-class Bar<T extends core::Object> extends core::Object {
+class Bar<T extends core::Object = dynamic> extends core::Object {
const constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/inference/non_const_invocation.dart.outline.expect b/pkg/front_end/testcases/inference/non_const_invocation.dart.outline.expect
index 393359f..96fab41 100644
--- a/pkg/front_end/testcases/inference/non_const_invocation.dart.outline.expect
+++ b/pkg/front_end/testcases/inference/non_const_invocation.dart.outline.expect
@@ -2,8 +2,8 @@
import self as self;
import "dart:core" as core;
-typedef F<U extends core::Object, V extends core::Object> = (U) → V;
-class Foo<T extends core::Object> extends core::Object {
+typedef F<U extends core::Object = dynamic, V extends core::Object = dynamic> = (U) → V;
+class Foo<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
;
get v1() → self::Bar<self::Foo::T>
@@ -25,7 +25,7 @@
get v9() → core::Map<self::Foo::T, (self::Foo::T) → self::Foo::T>
;
}
-class Bar<T extends core::Object> extends core::Object {
+class Bar<T extends core::Object = dynamic> extends core::Object {
const constructor •() → void
;
}
diff --git a/pkg/front_end/testcases/inference/non_const_invocation.dart.strong.expect b/pkg/front_end/testcases/inference/non_const_invocation.dart.strong.expect
index 2175864..b943f9f 100644
--- a/pkg/front_end/testcases/inference/non_const_invocation.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/non_const_invocation.dart.strong.expect
@@ -2,8 +2,8 @@
import self as self;
import "dart:core" as core;
-typedef F<U extends core::Object, V extends core::Object> = (U) → V;
-class Foo<T extends core::Object> extends core::Object {
+typedef F<U extends core::Object = dynamic, V extends core::Object = dynamic> = (U) → V;
+class Foo<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
@@ -26,7 +26,7 @@
get v9() → core::Map<self::Foo::T, (self::Foo::T) → self::Foo::T>
return <self::Foo::T, (self::Foo::T) → self::Foo::T>{};
}
-class Bar<T extends core::Object> extends core::Object {
+class Bar<T extends core::Object = dynamic> extends core::Object {
const constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/inference/non_const_invocation.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/non_const_invocation.dart.strong.transformed.expect
index 2175864..b943f9f 100644
--- a/pkg/front_end/testcases/inference/non_const_invocation.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/non_const_invocation.dart.strong.transformed.expect
@@ -2,8 +2,8 @@
import self as self;
import "dart:core" as core;
-typedef F<U extends core::Object, V extends core::Object> = (U) → V;
-class Foo<T extends core::Object> extends core::Object {
+typedef F<U extends core::Object = dynamic, V extends core::Object = dynamic> = (U) → V;
+class Foo<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
@@ -26,7 +26,7 @@
get v9() → core::Map<self::Foo::T, (self::Foo::T) → self::Foo::T>
return <self::Foo::T, (self::Foo::T) → self::Foo::T>{};
}
-class Bar<T extends core::Object> extends core::Object {
+class Bar<T extends core::Object = dynamic> extends core::Object {
const constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/inference/parameter_defaults_upwards.dart.direct.expect b/pkg/front_end/testcases/inference/parameter_defaults_upwards.dart.direct.expect
index e517d09..b8a8312 100644
--- a/pkg/front_end/testcases/inference/parameter_defaults_upwards.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/parameter_defaults_upwards.dart.direct.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class C<T extends core::Object> extends core::Object {
+class C<T extends core::Object = dynamic> extends core::Object {
constructor optional(([self::C::T]) → void func) → void
: super core::Object::•() {}
constructor named(({x: self::C::T}) → void func) → void
diff --git a/pkg/front_end/testcases/inference/parameter_defaults_upwards.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/parameter_defaults_upwards.dart.direct.transformed.expect
index e517d09..b8a8312 100644
--- a/pkg/front_end/testcases/inference/parameter_defaults_upwards.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/parameter_defaults_upwards.dart.direct.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class C<T extends core::Object> extends core::Object {
+class C<T extends core::Object = dynamic> extends core::Object {
constructor optional(([self::C::T]) → void func) → void
: super core::Object::•() {}
constructor named(({x: self::C::T}) → void func) → void
diff --git a/pkg/front_end/testcases/inference/parameter_defaults_upwards.dart.outline.expect b/pkg/front_end/testcases/inference/parameter_defaults_upwards.dart.outline.expect
index d3b9d37..08422b2 100644
--- a/pkg/front_end/testcases/inference/parameter_defaults_upwards.dart.outline.expect
+++ b/pkg/front_end/testcases/inference/parameter_defaults_upwards.dart.outline.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class C<T extends core::Object> extends core::Object {
+class C<T extends core::Object = dynamic> extends core::Object {
constructor optional(([self::C::T]) → void func) → void
;
constructor named(({x: self::C::T}) → void func) → void
diff --git a/pkg/front_end/testcases/inference/parameter_defaults_upwards.dart.strong.expect b/pkg/front_end/testcases/inference/parameter_defaults_upwards.dart.strong.expect
index c8d5b63..8ac8dc0 100644
--- a/pkg/front_end/testcases/inference/parameter_defaults_upwards.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/parameter_defaults_upwards.dart.strong.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class C<T extends core::Object> extends core::Object {
+class C<T extends core::Object = dynamic> extends core::Object {
constructor optional(([self::C::T]) → void func) → void
: super core::Object::•() {}
constructor named(({x: self::C::T}) → void func) → void
diff --git a/pkg/front_end/testcases/inference/parameter_defaults_upwards.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/parameter_defaults_upwards.dart.strong.transformed.expect
index c8d5b63..8ac8dc0 100644
--- a/pkg/front_end/testcases/inference/parameter_defaults_upwards.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/parameter_defaults_upwards.dart.strong.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class C<T extends core::Object> extends core::Object {
+class C<T extends core::Object = dynamic> extends core::Object {
constructor optional(([self::C::T]) → void func) → void
: super core::Object::•() {}
constructor named(({x: self::C::T}) → void func) → void
diff --git a/pkg/front_end/testcases/inference/promote_bounds.dart.direct.expect b/pkg/front_end/testcases/inference/promote_bounds.dart.direct.expect
index e939b9e..793b217 100644
--- a/pkg/front_end/testcases/inference/promote_bounds.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/promote_bounds.dart.direct.expect
@@ -14,7 +14,7 @@
;
abstract method bar() → void;
}
-static method f<T extends self::B>(self::f::T a) → void {
+static method f<T extends self::B = dynamic>(self::f::T a) → void {
if(a is core::String) {
a.foo();
}
diff --git a/pkg/front_end/testcases/inference/promote_bounds.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/promote_bounds.dart.direct.transformed.expect
index e939b9e..793b217 100644
--- a/pkg/front_end/testcases/inference/promote_bounds.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/promote_bounds.dart.direct.transformed.expect
@@ -14,7 +14,7 @@
;
abstract method bar() → void;
}
-static method f<T extends self::B>(self::f::T a) → void {
+static method f<T extends self::B = dynamic>(self::f::T a) → void {
if(a is core::String) {
a.foo();
}
diff --git a/pkg/front_end/testcases/inference/promote_bounds.dart.outline.expect b/pkg/front_end/testcases/inference/promote_bounds.dart.outline.expect
index 53eed9a..040b762 100644
--- a/pkg/front_end/testcases/inference/promote_bounds.dart.outline.expect
+++ b/pkg/front_end/testcases/inference/promote_bounds.dart.outline.expect
@@ -12,7 +12,7 @@
;
abstract method bar() → void;
}
-static method f<T extends self::B>(self::f::T a) → void
+static method f<T extends self::B = dynamic>(self::f::T a) → void
;
static method main() → dynamic
;
diff --git a/pkg/front_end/testcases/inference/promote_bounds.dart.strong.expect b/pkg/front_end/testcases/inference/promote_bounds.dart.strong.expect
index 56d7592..a25cdbd 100644
--- a/pkg/front_end/testcases/inference/promote_bounds.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/promote_bounds.dart.strong.expect
@@ -14,7 +14,7 @@
;
abstract method bar() → void;
}
-static method f<T extends self::B>(self::f::T a) → void {
+static method f<T extends self::B = dynamic>(self::f::T a) → void {
if(a is core::String) {
a.{self::B::foo}();
}
diff --git a/pkg/front_end/testcases/inference/promote_bounds.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/promote_bounds.dart.strong.transformed.expect
index 56d7592..a25cdbd 100644
--- a/pkg/front_end/testcases/inference/promote_bounds.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/promote_bounds.dart.strong.transformed.expect
@@ -14,7 +14,7 @@
;
abstract method bar() → void;
}
-static method f<T extends self::B>(self::f::T a) → void {
+static method f<T extends self::B = dynamic>(self::f::T a) → void {
if(a is core::String) {
a.{self::B::foo}();
}
diff --git a/pkg/front_end/testcases/inference/property_set.dart.direct.expect b/pkg/front_end/testcases/inference/property_set.dart.direct.expect
index c247031..f50e2b3 100644
--- a/pkg/front_end/testcases/inference/property_set.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/property_set.dart.direct.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class A<T extends core::Object> extends core::Object {
+class A<T extends core::Object = dynamic> extends core::Object {
field core::List<self::A::T> x = null;
synthetic constructor •() → void
: super core::Object::•()
diff --git a/pkg/front_end/testcases/inference/property_set.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/property_set.dart.direct.transformed.expect
index c247031..f50e2b3 100644
--- a/pkg/front_end/testcases/inference/property_set.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/property_set.dart.direct.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class A<T extends core::Object> extends core::Object {
+class A<T extends core::Object = dynamic> extends core::Object {
field core::List<self::A::T> x = null;
synthetic constructor •() → void
: super core::Object::•()
diff --git a/pkg/front_end/testcases/inference/property_set.dart.outline.expect b/pkg/front_end/testcases/inference/property_set.dart.outline.expect
index e693bd9..c3e10a3 100644
--- a/pkg/front_end/testcases/inference/property_set.dart.outline.expect
+++ b/pkg/front_end/testcases/inference/property_set.dart.outline.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class A<T extends core::Object> extends core::Object {
+class A<T extends core::Object = dynamic> extends core::Object {
field core::List<self::A::T> x;
synthetic constructor •() → void
;
diff --git a/pkg/front_end/testcases/inference/property_set.dart.strong.expect b/pkg/front_end/testcases/inference/property_set.dart.strong.expect
index 699d136..97ca7fe 100644
--- a/pkg/front_end/testcases/inference/property_set.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/property_set.dart.strong.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class A<T extends core::Object> extends core::Object {
+class A<T extends core::Object = dynamic> extends core::Object {
generic-covariant-impl generic-covariant-interface field core::List<self::A::T> x = null;
synthetic constructor •() → void
: super core::Object::•()
diff --git a/pkg/front_end/testcases/inference/property_set.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/property_set.dart.strong.transformed.expect
index 699d136..97ca7fe 100644
--- a/pkg/front_end/testcases/inference/property_set.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/property_set.dart.strong.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class A<T extends core::Object> extends core::Object {
+class A<T extends core::Object = dynamic> extends core::Object {
generic-covariant-impl generic-covariant-interface field core::List<self::A::T> x = null;
synthetic constructor •() → void
: super core::Object::•()
diff --git a/pkg/front_end/testcases/inference/recursive_generic_function.dart.direct.expect b/pkg/front_end/testcases/inference/recursive_generic_function.dart.direct.expect
index 4af9ac5..df0ef92 100644
--- a/pkg/front_end/testcases/inference/recursive_generic_function.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/recursive_generic_function.dart.direct.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-static method _mergeSort<T extends core::Object>((self::_mergeSort::T) → self::_mergeSort::T list, (self::_mergeSort::T, self::_mergeSort::T) → core::int compare, (self::_mergeSort::T) → self::_mergeSort::T target) → void {
+static method _mergeSort<T extends core::Object = dynamic>((self::_mergeSort::T) → self::_mergeSort::T list, (self::_mergeSort::T, self::_mergeSort::T) → core::int compare, (self::_mergeSort::T) → self::_mergeSort::T target) → void {
self::_mergeSort<dynamic>(list, compare, target);
self::_mergeSort<dynamic>(list, compare, list);
self::_mergeSort<dynamic>(target, compare, target);
diff --git a/pkg/front_end/testcases/inference/recursive_generic_function.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/recursive_generic_function.dart.direct.transformed.expect
index 4af9ac5..df0ef92 100644
--- a/pkg/front_end/testcases/inference/recursive_generic_function.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/recursive_generic_function.dart.direct.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-static method _mergeSort<T extends core::Object>((self::_mergeSort::T) → self::_mergeSort::T list, (self::_mergeSort::T, self::_mergeSort::T) → core::int compare, (self::_mergeSort::T) → self::_mergeSort::T target) → void {
+static method _mergeSort<T extends core::Object = dynamic>((self::_mergeSort::T) → self::_mergeSort::T list, (self::_mergeSort::T, self::_mergeSort::T) → core::int compare, (self::_mergeSort::T) → self::_mergeSort::T target) → void {
self::_mergeSort<dynamic>(list, compare, target);
self::_mergeSort<dynamic>(list, compare, list);
self::_mergeSort<dynamic>(target, compare, target);
diff --git a/pkg/front_end/testcases/inference/recursive_generic_function.dart.outline.expect b/pkg/front_end/testcases/inference/recursive_generic_function.dart.outline.expect
index 31cc717..3b14cff 100644
--- a/pkg/front_end/testcases/inference/recursive_generic_function.dart.outline.expect
+++ b/pkg/front_end/testcases/inference/recursive_generic_function.dart.outline.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-static method _mergeSort<T extends core::Object>((self::_mergeSort::T) → self::_mergeSort::T list, (self::_mergeSort::T, self::_mergeSort::T) → core::int compare, (self::_mergeSort::T) → self::_mergeSort::T target) → void
+static method _mergeSort<T extends core::Object = dynamic>((self::_mergeSort::T) → self::_mergeSort::T list, (self::_mergeSort::T, self::_mergeSort::T) → core::int compare, (self::_mergeSort::T) → self::_mergeSort::T target) → void
;
static method main() → dynamic
;
diff --git a/pkg/front_end/testcases/inference/recursive_generic_function.dart.strong.expect b/pkg/front_end/testcases/inference/recursive_generic_function.dart.strong.expect
index ab23a10..60a3552 100644
--- a/pkg/front_end/testcases/inference/recursive_generic_function.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/recursive_generic_function.dart.strong.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-static method _mergeSort<T extends core::Object>((self::_mergeSort::T) → self::_mergeSort::T list, (self::_mergeSort::T, self::_mergeSort::T) → core::int compare, (self::_mergeSort::T) → self::_mergeSort::T target) → void {
+static method _mergeSort<T extends core::Object = dynamic>((self::_mergeSort::T) → self::_mergeSort::T list, (self::_mergeSort::T, self::_mergeSort::T) → core::int compare, (self::_mergeSort::T) → self::_mergeSort::T target) → void {
self::_mergeSort<self::_mergeSort::T>(list, compare, target);
self::_mergeSort<self::_mergeSort::T>(list, compare, list);
self::_mergeSort<self::_mergeSort::T>(target, compare, target);
diff --git a/pkg/front_end/testcases/inference/recursive_generic_function.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/recursive_generic_function.dart.strong.transformed.expect
index ab23a10..60a3552 100644
--- a/pkg/front_end/testcases/inference/recursive_generic_function.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/recursive_generic_function.dart.strong.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-static method _mergeSort<T extends core::Object>((self::_mergeSort::T) → self::_mergeSort::T list, (self::_mergeSort::T, self::_mergeSort::T) → core::int compare, (self::_mergeSort::T) → self::_mergeSort::T target) → void {
+static method _mergeSort<T extends core::Object = dynamic>((self::_mergeSort::T) → self::_mergeSort::T list, (self::_mergeSort::T, self::_mergeSort::T) → core::int compare, (self::_mergeSort::T) → self::_mergeSort::T target) → void {
self::_mergeSort<self::_mergeSort::T>(list, compare, target);
self::_mergeSort<self::_mergeSort::T>(list, compare, list);
self::_mergeSort<self::_mergeSort::T>(target, compare, target);
diff --git a/pkg/front_end/testcases/inference/refine_binary_expression_type_type_parameter_t_double.dart.direct.expect b/pkg/front_end/testcases/inference/refine_binary_expression_type_type_parameter_t_double.dart.direct.expect
index 2dcf59c..06e16af 100644
--- a/pkg/front_end/testcases/inference/refine_binary_expression_type_type_parameter_t_double.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/refine_binary_expression_type_type_parameter_t_double.dart.direct.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class C<T extends core::num> extends core::Object {
+class C<T extends core::num = dynamic> extends core::Object {
field self::C::T a = null;
synthetic constructor •() → void
: super core::Object::•()
diff --git a/pkg/front_end/testcases/inference/refine_binary_expression_type_type_parameter_t_double.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/refine_binary_expression_type_type_parameter_t_double.dart.direct.transformed.expect
index 2dcf59c..06e16af 100644
--- a/pkg/front_end/testcases/inference/refine_binary_expression_type_type_parameter_t_double.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/refine_binary_expression_type_type_parameter_t_double.dart.direct.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class C<T extends core::num> extends core::Object {
+class C<T extends core::num = dynamic> extends core::Object {
field self::C::T a = null;
synthetic constructor •() → void
: super core::Object::•()
diff --git a/pkg/front_end/testcases/inference/refine_binary_expression_type_type_parameter_t_double.dart.strong.expect b/pkg/front_end/testcases/inference/refine_binary_expression_type_type_parameter_t_double.dart.strong.expect
index 7a020fb..88e493b 100644
--- a/pkg/front_end/testcases/inference/refine_binary_expression_type_type_parameter_t_double.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/refine_binary_expression_type_type_parameter_t_double.dart.strong.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class C<T extends core::num> extends core::Object {
+class C<T extends core::num = core::num> extends core::Object {
generic-covariant-impl generic-covariant-interface field self::C::T a = null;
synthetic constructor •() → void
: super core::Object::•()
diff --git a/pkg/front_end/testcases/inference/refine_binary_expression_type_type_parameter_t_double.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/refine_binary_expression_type_type_parameter_t_double.dart.strong.transformed.expect
index 7a020fb..88e493b 100644
--- a/pkg/front_end/testcases/inference/refine_binary_expression_type_type_parameter_t_double.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/refine_binary_expression_type_type_parameter_t_double.dart.strong.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class C<T extends core::num> extends core::Object {
+class C<T extends core::num = core::num> extends core::Object {
generic-covariant-impl generic-covariant-interface field self::C::T a = null;
synthetic constructor •() → void
: super core::Object::•()
diff --git a/pkg/front_end/testcases/inference/refine_binary_expression_type_type_parameter_t_int.dart.direct.expect b/pkg/front_end/testcases/inference/refine_binary_expression_type_type_parameter_t_int.dart.direct.expect
index 33580fd..4b188010 100644
--- a/pkg/front_end/testcases/inference/refine_binary_expression_type_type_parameter_t_int.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/refine_binary_expression_type_type_parameter_t_int.dart.direct.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class C<T extends core::num> extends core::Object {
+class C<T extends core::num = dynamic> extends core::Object {
field self::C::T a = null;
synthetic constructor •() → void
: super core::Object::•()
diff --git a/pkg/front_end/testcases/inference/refine_binary_expression_type_type_parameter_t_int.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/refine_binary_expression_type_type_parameter_t_int.dart.direct.transformed.expect
index 33580fd..4b188010 100644
--- a/pkg/front_end/testcases/inference/refine_binary_expression_type_type_parameter_t_int.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/refine_binary_expression_type_type_parameter_t_int.dart.direct.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class C<T extends core::num> extends core::Object {
+class C<T extends core::num = dynamic> extends core::Object {
field self::C::T a = null;
synthetic constructor •() → void
: super core::Object::•()
diff --git a/pkg/front_end/testcases/inference/refine_binary_expression_type_type_parameter_t_int.dart.strong.expect b/pkg/front_end/testcases/inference/refine_binary_expression_type_type_parameter_t_int.dart.strong.expect
index 15431c7..97ae897 100644
--- a/pkg/front_end/testcases/inference/refine_binary_expression_type_type_parameter_t_int.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/refine_binary_expression_type_type_parameter_t_int.dart.strong.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class C<T extends core::num> extends core::Object {
+class C<T extends core::num = core::num> extends core::Object {
generic-covariant-impl generic-covariant-interface field self::C::T a = null;
synthetic constructor •() → void
: super core::Object::•()
diff --git a/pkg/front_end/testcases/inference/refine_binary_expression_type_type_parameter_t_int.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/refine_binary_expression_type_type_parameter_t_int.dart.strong.transformed.expect
index 15431c7..97ae897 100644
--- a/pkg/front_end/testcases/inference/refine_binary_expression_type_type_parameter_t_int.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/refine_binary_expression_type_type_parameter_t_int.dart.strong.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class C<T extends core::num> extends core::Object {
+class C<T extends core::num = core::num> extends core::Object {
generic-covariant-impl generic-covariant-interface field self::C::T a = null;
synthetic constructor •() → void
: super core::Object::•()
diff --git a/pkg/front_end/testcases/inference/refine_binary_expression_type_type_parameter_t_t.dart.direct.expect b/pkg/front_end/testcases/inference/refine_binary_expression_type_type_parameter_t_t.dart.direct.expect
index a4422e2..fbd611f 100644
--- a/pkg/front_end/testcases/inference/refine_binary_expression_type_type_parameter_t_t.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/refine_binary_expression_type_type_parameter_t_t.dart.direct.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class C<T extends core::num> extends core::Object {
+class C<T extends core::num = dynamic> extends core::Object {
field self::C::T a = null;
synthetic constructor •() → void
: super core::Object::•()
diff --git a/pkg/front_end/testcases/inference/refine_binary_expression_type_type_parameter_t_t.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/refine_binary_expression_type_type_parameter_t_t.dart.direct.transformed.expect
index a4422e2..fbd611f 100644
--- a/pkg/front_end/testcases/inference/refine_binary_expression_type_type_parameter_t_t.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/refine_binary_expression_type_type_parameter_t_t.dart.direct.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class C<T extends core::num> extends core::Object {
+class C<T extends core::num = dynamic> extends core::Object {
field self::C::T a = null;
synthetic constructor •() → void
: super core::Object::•()
diff --git a/pkg/front_end/testcases/inference/refine_binary_expression_type_type_parameter_t_t.dart.strong.expect b/pkg/front_end/testcases/inference/refine_binary_expression_type_type_parameter_t_t.dart.strong.expect
index 6410fb3..a33fa5e 100644
--- a/pkg/front_end/testcases/inference/refine_binary_expression_type_type_parameter_t_t.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/refine_binary_expression_type_type_parameter_t_t.dart.strong.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class C<T extends core::num> extends core::Object {
+class C<T extends core::num = core::num> extends core::Object {
generic-covariant-impl generic-covariant-interface field self::C::T a = null;
synthetic constructor •() → void
: super core::Object::•()
diff --git a/pkg/front_end/testcases/inference/refine_binary_expression_type_type_parameter_t_t.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/refine_binary_expression_type_type_parameter_t_t.dart.strong.transformed.expect
index 6410fb3..a33fa5e 100644
--- a/pkg/front_end/testcases/inference/refine_binary_expression_type_type_parameter_t_t.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/refine_binary_expression_type_type_parameter_t_t.dart.strong.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class C<T extends core::num> extends core::Object {
+class C<T extends core::num = core::num> extends core::Object {
generic-covariant-impl generic-covariant-interface field self::C::T a = null;
synthetic constructor •() → void
: super core::Object::•()
diff --git a/pkg/front_end/testcases/inference/super_index_set.dart.direct.expect b/pkg/front_end/testcases/inference/super_index_set.dart.direct.expect
index 041e05e..0134a2a 100644
--- a/pkg/front_end/testcases/inference/super_index_set.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/super_index_set.dart.direct.expect
@@ -17,6 +17,6 @@
super.{self::B::[]=}(self::f<dynamic>(), self::f<dynamic>());
}
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/super_index_set.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/super_index_set.dart.direct.transformed.expect
index 041e05e..0134a2a 100644
--- a/pkg/front_end/testcases/inference/super_index_set.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/super_index_set.dart.direct.transformed.expect
@@ -17,6 +17,6 @@
super.{self::B::[]=}(self::f<dynamic>(), self::f<dynamic>());
}
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/super_index_set.dart.outline.expect b/pkg/front_end/testcases/inference/super_index_set.dart.outline.expect
index 9d1472d..95d7070 100644
--- a/pkg/front_end/testcases/inference/super_index_set.dart.outline.expect
+++ b/pkg/front_end/testcases/inference/super_index_set.dart.outline.expect
@@ -16,7 +16,7 @@
method h() → void
;
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
;
static method main() → dynamic
;
diff --git a/pkg/front_end/testcases/inference/super_index_set.dart.strong.expect b/pkg/front_end/testcases/inference/super_index_set.dart.strong.expect
index 6908392..defc412 100644
--- a/pkg/front_end/testcases/inference/super_index_set.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/super_index_set.dart.strong.expect
@@ -17,6 +17,6 @@
super.{self::B::[]=}(self::f<dynamic>() as{TypeError} core::int, self::f<core::String>());
}
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/super_index_set.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/super_index_set.dart.strong.transformed.expect
index 6908392..defc412 100644
--- a/pkg/front_end/testcases/inference/super_index_set.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/super_index_set.dart.strong.transformed.expect
@@ -17,6 +17,6 @@
super.{self::B::[]=}(self::f<dynamic>() as{TypeError} core::int, self::f<core::String>());
}
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/super_index_set_substitution.dart.direct.expect b/pkg/front_end/testcases/inference/super_index_set_substitution.dart.direct.expect
index cd3af92..22405f9 100644
--- a/pkg/front_end/testcases/inference/super_index_set_substitution.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/super_index_set_substitution.dart.direct.expect
@@ -3,13 +3,13 @@
import "dart:core" as core;
import "dart:async" as asy;
-class B<T extends core::Object> extends core::Object {
+class B<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
operator []=(core::Map<core::int, self::B::T> x, core::List<self::B::T> y) → void {}
}
-class C<U extends core::Object> extends self::B<asy::Future<self::C::U>> {
+class C<U extends core::Object = dynamic> extends self::B<asy::Future<self::C::U>> {
synthetic constructor •() → void
: super self::B::•()
;
@@ -18,6 +18,6 @@
super.{self::B::[]=}(self::f<dynamic>(), self::f<dynamic>());
}
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/super_index_set_substitution.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/super_index_set_substitution.dart.direct.transformed.expect
index cd3af92..22405f9 100644
--- a/pkg/front_end/testcases/inference/super_index_set_substitution.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/super_index_set_substitution.dart.direct.transformed.expect
@@ -3,13 +3,13 @@
import "dart:core" as core;
import "dart:async" as asy;
-class B<T extends core::Object> extends core::Object {
+class B<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
operator []=(core::Map<core::int, self::B::T> x, core::List<self::B::T> y) → void {}
}
-class C<U extends core::Object> extends self::B<asy::Future<self::C::U>> {
+class C<U extends core::Object = dynamic> extends self::B<asy::Future<self::C::U>> {
synthetic constructor •() → void
: super self::B::•()
;
@@ -18,6 +18,6 @@
super.{self::B::[]=}(self::f<dynamic>(), self::f<dynamic>());
}
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/super_index_set_substitution.dart.outline.expect b/pkg/front_end/testcases/inference/super_index_set_substitution.dart.outline.expect
index 9ef3f0c..e45d970 100644
--- a/pkg/front_end/testcases/inference/super_index_set_substitution.dart.outline.expect
+++ b/pkg/front_end/testcases/inference/super_index_set_substitution.dart.outline.expect
@@ -3,13 +3,13 @@
import "dart:core" as core;
import "dart:async" as asy;
-class B<T extends core::Object> extends core::Object {
+class B<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
;
operator []=(core::Map<core::int, self::B::T> x, core::List<self::B::T> y) → void
;
}
-class C<U extends core::Object> extends self::B<asy::Future<self::C::U>> {
+class C<U extends core::Object = dynamic> extends self::B<asy::Future<self::C::U>> {
synthetic constructor •() → void
;
operator []=(core::Object x, core::Object y) → void
@@ -17,7 +17,7 @@
method h() → void
;
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
;
static method main() → dynamic
;
diff --git a/pkg/front_end/testcases/inference/super_index_set_substitution.dart.strong.expect b/pkg/front_end/testcases/inference/super_index_set_substitution.dart.strong.expect
index a5cd75e..3f4ad5b 100644
--- a/pkg/front_end/testcases/inference/super_index_set_substitution.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/super_index_set_substitution.dart.strong.expect
@@ -3,13 +3,13 @@
import "dart:core" as core;
import "dart:async" as asy;
-class B<T extends core::Object> extends core::Object {
+class B<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
operator []=(generic-covariant-impl generic-covariant-interface core::Map<core::int, self::B::T> x, generic-covariant-impl generic-covariant-interface core::List<self::B::T> y) → void {}
}
-class C<U extends core::Object> extends self::B<asy::Future<self::C::U>> {
+class C<U extends core::Object = dynamic> extends self::B<asy::Future<self::C::U>> {
synthetic constructor •() → void
: super self::B::•()
;
@@ -18,6 +18,6 @@
super.{self::B::[]=}(self::f<dynamic>() as{TypeError} core::Map<core::int, asy::Future<self::C::U>>, self::f<core::List<asy::Future<self::C::U>>>());
}
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/super_index_set_substitution.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/super_index_set_substitution.dart.strong.transformed.expect
index a5cd75e..3f4ad5b 100644
--- a/pkg/front_end/testcases/inference/super_index_set_substitution.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/super_index_set_substitution.dart.strong.transformed.expect
@@ -3,13 +3,13 @@
import "dart:core" as core;
import "dart:async" as asy;
-class B<T extends core::Object> extends core::Object {
+class B<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
operator []=(generic-covariant-impl generic-covariant-interface core::Map<core::int, self::B::T> x, generic-covariant-impl generic-covariant-interface core::List<self::B::T> y) → void {}
}
-class C<U extends core::Object> extends self::B<asy::Future<self::C::U>> {
+class C<U extends core::Object = dynamic> extends self::B<asy::Future<self::C::U>> {
synthetic constructor •() → void
: super self::B::•()
;
@@ -18,6 +18,6 @@
super.{self::B::[]=}(self::f<dynamic>() as{TypeError} core::Map<core::int, asy::Future<self::C::U>>, self::f<core::List<asy::Future<self::C::U>>>());
}
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/super_initializer.dart.direct.expect b/pkg/front_end/testcases/inference/super_initializer.dart.direct.expect
index 1d9a2bf..f973b94 100644
--- a/pkg/front_end/testcases/inference/super_initializer.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/super_initializer.dart.direct.expect
@@ -12,6 +12,6 @@
: super core::Object::•()
;
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/super_initializer.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/super_initializer.dart.direct.transformed.expect
index 1d9a2bf..f973b94 100644
--- a/pkg/front_end/testcases/inference/super_initializer.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/super_initializer.dart.direct.transformed.expect
@@ -12,6 +12,6 @@
: super core::Object::•()
;
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/super_initializer.dart.outline.expect b/pkg/front_end/testcases/inference/super_initializer.dart.outline.expect
index 3ad68e3..e148d16 100644
--- a/pkg/front_end/testcases/inference/super_initializer.dart.outline.expect
+++ b/pkg/front_end/testcases/inference/super_initializer.dart.outline.expect
@@ -10,7 +10,7 @@
constructor •(core::int x) → void
;
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
;
static method main() → dynamic
;
diff --git a/pkg/front_end/testcases/inference/super_initializer.dart.strong.expect b/pkg/front_end/testcases/inference/super_initializer.dart.strong.expect
index e36e82d..c0a9963 100644
--- a/pkg/front_end/testcases/inference/super_initializer.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/super_initializer.dart.strong.expect
@@ -12,6 +12,6 @@
: super core::Object::•()
;
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/super_initializer.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/super_initializer.dart.strong.transformed.expect
index e36e82d..c0a9963 100644
--- a/pkg/front_end/testcases/inference/super_initializer.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/super_initializer.dart.strong.transformed.expect
@@ -12,6 +12,6 @@
: super core::Object::•()
;
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/super_initializer_substitution.dart.direct.expect b/pkg/front_end/testcases/inference/super_initializer_substitution.dart.direct.expect
index e6ba748..349bb55 100644
--- a/pkg/front_end/testcases/inference/super_initializer_substitution.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/super_initializer_substitution.dart.direct.expect
@@ -2,16 +2,16 @@
import self as self;
import "dart:core" as core;
-class B<T extends core::Object> extends core::Object {
+class B<T extends core::Object = dynamic> extends core::Object {
constructor •(self::B::T t) → void
: super core::Object::•()
;
}
-class C<U extends core::Object> extends self::B<core::List<self::C::U>> {
+class C<U extends core::Object = dynamic> extends self::B<core::List<self::C::U>> {
constructor •() → void
: super self::B::•(self::f<dynamic>())
;
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/super_initializer_substitution.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/super_initializer_substitution.dart.direct.transformed.expect
index e6ba748..349bb55 100644
--- a/pkg/front_end/testcases/inference/super_initializer_substitution.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/super_initializer_substitution.dart.direct.transformed.expect
@@ -2,16 +2,16 @@
import self as self;
import "dart:core" as core;
-class B<T extends core::Object> extends core::Object {
+class B<T extends core::Object = dynamic> extends core::Object {
constructor •(self::B::T t) → void
: super core::Object::•()
;
}
-class C<U extends core::Object> extends self::B<core::List<self::C::U>> {
+class C<U extends core::Object = dynamic> extends self::B<core::List<self::C::U>> {
constructor •() → void
: super self::B::•(self::f<dynamic>())
;
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/super_initializer_substitution.dart.outline.expect b/pkg/front_end/testcases/inference/super_initializer_substitution.dart.outline.expect
index 68d8998..c748dab 100644
--- a/pkg/front_end/testcases/inference/super_initializer_substitution.dart.outline.expect
+++ b/pkg/front_end/testcases/inference/super_initializer_substitution.dart.outline.expect
@@ -2,15 +2,15 @@
import self as self;
import "dart:core" as core;
-class B<T extends core::Object> extends core::Object {
+class B<T extends core::Object = dynamic> extends core::Object {
constructor •(self::B::T t) → void
;
}
-class C<U extends core::Object> extends self::B<core::List<self::C::U>> {
+class C<U extends core::Object = dynamic> extends self::B<core::List<self::C::U>> {
constructor •() → void
;
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
;
static method main() → dynamic
;
diff --git a/pkg/front_end/testcases/inference/super_initializer_substitution.dart.strong.expect b/pkg/front_end/testcases/inference/super_initializer_substitution.dart.strong.expect
index da5d5a2..f357c51 100644
--- a/pkg/front_end/testcases/inference/super_initializer_substitution.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/super_initializer_substitution.dart.strong.expect
@@ -2,16 +2,16 @@
import self as self;
import "dart:core" as core;
-class B<T extends core::Object> extends core::Object {
+class B<T extends core::Object = dynamic> extends core::Object {
constructor •(self::B::T t) → void
: super core::Object::•()
;
}
-class C<U extends core::Object> extends self::B<core::List<self::C::U>> {
+class C<U extends core::Object = dynamic> extends self::B<core::List<self::C::U>> {
constructor •() → void
: super self::B::•(self::f<core::List<self::C::U>>())
;
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/super_initializer_substitution.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/super_initializer_substitution.dart.strong.transformed.expect
index da5d5a2..f357c51 100644
--- a/pkg/front_end/testcases/inference/super_initializer_substitution.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/super_initializer_substitution.dart.strong.transformed.expect
@@ -2,16 +2,16 @@
import self as self;
import "dart:core" as core;
-class B<T extends core::Object> extends core::Object {
+class B<T extends core::Object = dynamic> extends core::Object {
constructor •(self::B::T t) → void
: super core::Object::•()
;
}
-class C<U extends core::Object> extends self::B<core::List<self::C::U>> {
+class C<U extends core::Object = dynamic> extends self::B<core::List<self::C::U>> {
constructor •() → void
: super self::B::•(self::f<core::List<self::C::U>>())
;
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/super_method_invocation_substitution.dart.direct.expect b/pkg/front_end/testcases/inference/super_method_invocation_substitution.dart.direct.expect
index bcfab27..31245d1 100644
--- a/pkg/front_end/testcases/inference/super_method_invocation_substitution.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/super_method_invocation_substitution.dart.direct.expect
@@ -3,24 +3,24 @@
import "dart:core" as core;
import "dart:async" as asy;
-class D<T extends core::Object> extends core::Object {
+class D<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class E<T extends core::Object> extends self::D<self::E::T> {
+class E<T extends core::Object = dynamic> extends self::D<self::E::T> {
synthetic constructor •() → void
: super self::D::•()
;
}
-class B<T extends core::Object> extends core::Object {
+class B<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
method g(self::E<self::B::T> x) → self::D<self::B::T>
return null;
}
-class C<U extends core::Object> extends self::B<asy::Future<self::C::U>> {
+class C<U extends core::Object = dynamic> extends self::B<asy::Future<self::C::U>> {
synthetic constructor •() → void
: super self::B::•()
;
@@ -30,6 +30,6 @@
dynamic x = super.{self::B::g}(self::f<dynamic>());
}
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/super_method_invocation_substitution.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/super_method_invocation_substitution.dart.direct.transformed.expect
index bcfab27..31245d1 100644
--- a/pkg/front_end/testcases/inference/super_method_invocation_substitution.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/super_method_invocation_substitution.dart.direct.transformed.expect
@@ -3,24 +3,24 @@
import "dart:core" as core;
import "dart:async" as asy;
-class D<T extends core::Object> extends core::Object {
+class D<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class E<T extends core::Object> extends self::D<self::E::T> {
+class E<T extends core::Object = dynamic> extends self::D<self::E::T> {
synthetic constructor •() → void
: super self::D::•()
;
}
-class B<T extends core::Object> extends core::Object {
+class B<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
method g(self::E<self::B::T> x) → self::D<self::B::T>
return null;
}
-class C<U extends core::Object> extends self::B<asy::Future<self::C::U>> {
+class C<U extends core::Object = dynamic> extends self::B<asy::Future<self::C::U>> {
synthetic constructor •() → void
: super self::B::•()
;
@@ -30,6 +30,6 @@
dynamic x = super.{self::B::g}(self::f<dynamic>());
}
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/super_method_invocation_substitution.dart.outline.expect b/pkg/front_end/testcases/inference/super_method_invocation_substitution.dart.outline.expect
index 4d0679c..0186853 100644
--- a/pkg/front_end/testcases/inference/super_method_invocation_substitution.dart.outline.expect
+++ b/pkg/front_end/testcases/inference/super_method_invocation_substitution.dart.outline.expect
@@ -3,21 +3,21 @@
import "dart:core" as core;
import "dart:async" as asy;
-class D<T extends core::Object> extends core::Object {
+class D<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
;
}
-class E<T extends core::Object> extends self::D<self::E::T> {
+class E<T extends core::Object = dynamic> extends self::D<self::E::T> {
synthetic constructor •() → void
;
}
-class B<T extends core::Object> extends core::Object {
+class B<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
;
method g(self::E<self::B::T> x) → self::D<self::B::T>
;
}
-class C<U extends core::Object> extends self::B<asy::Future<self::C::U>> {
+class C<U extends core::Object = dynamic> extends self::B<asy::Future<self::C::U>> {
synthetic constructor •() → void
;
method g(core::Object x) → self::E<asy::Future<self::C::U>>
@@ -25,7 +25,7 @@
method h() → void
;
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
;
static method main() → dynamic
;
diff --git a/pkg/front_end/testcases/inference/super_method_invocation_substitution.dart.strong.expect b/pkg/front_end/testcases/inference/super_method_invocation_substitution.dart.strong.expect
index 973b188..d492a07 100644
--- a/pkg/front_end/testcases/inference/super_method_invocation_substitution.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/super_method_invocation_substitution.dart.strong.expect
@@ -3,24 +3,24 @@
import "dart:core" as core;
import "dart:async" as asy;
-class D<T extends core::Object> extends core::Object {
+class D<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class E<T extends core::Object> extends self::D<self::E::T> {
+class E<T extends core::Object = dynamic> extends self::D<self::E::T> {
synthetic constructor •() → void
: super self::D::•()
;
}
-class B<T extends core::Object> extends core::Object {
+class B<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
method g(generic-covariant-impl generic-covariant-interface self::E<self::B::T> x) → self::D<self::B::T>
return null;
}
-class C<U extends core::Object> extends self::B<asy::Future<self::C::U>> {
+class C<U extends core::Object = dynamic> extends self::B<asy::Future<self::C::U>> {
synthetic constructor •() → void
: super self::B::•()
;
@@ -30,6 +30,6 @@
self::D<asy::Future<self::C::U>> x = super.{self::B::g}(self::f<self::E<asy::Future<self::C::U>>>());
}
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/super_method_invocation_substitution.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/super_method_invocation_substitution.dart.strong.transformed.expect
index 973b188..d492a07 100644
--- a/pkg/front_end/testcases/inference/super_method_invocation_substitution.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/super_method_invocation_substitution.dart.strong.transformed.expect
@@ -3,24 +3,24 @@
import "dart:core" as core;
import "dart:async" as asy;
-class D<T extends core::Object> extends core::Object {
+class D<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class E<T extends core::Object> extends self::D<self::E::T> {
+class E<T extends core::Object = dynamic> extends self::D<self::E::T> {
synthetic constructor •() → void
: super self::D::•()
;
}
-class B<T extends core::Object> extends core::Object {
+class B<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
method g(generic-covariant-impl generic-covariant-interface self::E<self::B::T> x) → self::D<self::B::T>
return null;
}
-class C<U extends core::Object> extends self::B<asy::Future<self::C::U>> {
+class C<U extends core::Object = dynamic> extends self::B<asy::Future<self::C::U>> {
synthetic constructor •() → void
: super self::B::•()
;
@@ -30,6 +30,6 @@
self::D<asy::Future<self::C::U>> x = super.{self::B::g}(self::f<self::E<asy::Future<self::C::U>>>());
}
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/super_property_get_substitution.dart.direct.expect b/pkg/front_end/testcases/inference/super_property_get_substitution.dart.direct.expect
index 8ee6c1c..a191aad 100644
--- a/pkg/front_end/testcases/inference/super_property_get_substitution.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/super_property_get_substitution.dart.direct.expect
@@ -3,23 +3,23 @@
import "dart:core" as core;
import "dart:async" as asy;
-class D<T extends core::Object> extends core::Object {
+class D<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class E<T extends core::Object> extends self::D<self::E::T> {
+class E<T extends core::Object = dynamic> extends self::D<self::E::T> {
synthetic constructor •() → void
: super self::D::•()
;
}
-class B<T extends core::Object> extends core::Object {
+class B<T extends core::Object = dynamic> extends core::Object {
field self::D<self::B::T> x = null;
synthetic constructor •() → void
: super core::Object::•()
;
}
-class C<U extends core::Object> extends self::B<asy::Future<self::C::U>> {
+class C<U extends core::Object = dynamic> extends self::B<asy::Future<self::C::U>> {
synthetic constructor •() → void
: super self::B::•()
;
diff --git a/pkg/front_end/testcases/inference/super_property_get_substitution.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/super_property_get_substitution.dart.direct.transformed.expect
index 8ee6c1c..a191aad 100644
--- a/pkg/front_end/testcases/inference/super_property_get_substitution.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/super_property_get_substitution.dart.direct.transformed.expect
@@ -3,23 +3,23 @@
import "dart:core" as core;
import "dart:async" as asy;
-class D<T extends core::Object> extends core::Object {
+class D<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class E<T extends core::Object> extends self::D<self::E::T> {
+class E<T extends core::Object = dynamic> extends self::D<self::E::T> {
synthetic constructor •() → void
: super self::D::•()
;
}
-class B<T extends core::Object> extends core::Object {
+class B<T extends core::Object = dynamic> extends core::Object {
field self::D<self::B::T> x = null;
synthetic constructor •() → void
: super core::Object::•()
;
}
-class C<U extends core::Object> extends self::B<asy::Future<self::C::U>> {
+class C<U extends core::Object = dynamic> extends self::B<asy::Future<self::C::U>> {
synthetic constructor •() → void
: super self::B::•()
;
diff --git a/pkg/front_end/testcases/inference/super_property_get_substitution.dart.outline.expect b/pkg/front_end/testcases/inference/super_property_get_substitution.dart.outline.expect
index 04cb684..5c18f14 100644
--- a/pkg/front_end/testcases/inference/super_property_get_substitution.dart.outline.expect
+++ b/pkg/front_end/testcases/inference/super_property_get_substitution.dart.outline.expect
@@ -3,20 +3,20 @@
import "dart:core" as core;
import "dart:async" as asy;
-class D<T extends core::Object> extends core::Object {
+class D<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
;
}
-class E<T extends core::Object> extends self::D<self::E::T> {
+class E<T extends core::Object = dynamic> extends self::D<self::E::T> {
synthetic constructor •() → void
;
}
-class B<T extends core::Object> extends core::Object {
+class B<T extends core::Object = dynamic> extends core::Object {
field self::D<self::B::T> x;
synthetic constructor •() → void
;
}
-class C<U extends core::Object> extends self::B<asy::Future<self::C::U>> {
+class C<U extends core::Object = dynamic> extends self::B<asy::Future<self::C::U>> {
synthetic constructor •() → void
;
get x() → self::E<asy::Future<self::C::U>>
diff --git a/pkg/front_end/testcases/inference/super_property_get_substitution.dart.strong.expect b/pkg/front_end/testcases/inference/super_property_get_substitution.dart.strong.expect
index 5841a0d..f8bd96c 100644
--- a/pkg/front_end/testcases/inference/super_property_get_substitution.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/super_property_get_substitution.dart.strong.expect
@@ -3,23 +3,23 @@
import "dart:core" as core;
import "dart:async" as asy;
-class D<T extends core::Object> extends core::Object {
+class D<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class E<T extends core::Object> extends self::D<self::E::T> {
+class E<T extends core::Object = dynamic> extends self::D<self::E::T> {
synthetic constructor •() → void
: super self::D::•()
;
}
-class B<T extends core::Object> extends core::Object {
+class B<T extends core::Object = dynamic> extends core::Object {
generic-covariant-impl generic-covariant-interface field self::D<self::B::T> x = null;
synthetic constructor •() → void
: super core::Object::•()
;
}
-class C<U extends core::Object> extends self::B<asy::Future<self::C::U>> {
+class C<U extends core::Object = dynamic> extends self::B<asy::Future<self::C::U>> {
synthetic constructor •() → void
: super self::B::•()
;
diff --git a/pkg/front_end/testcases/inference/super_property_get_substitution.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/super_property_get_substitution.dart.strong.transformed.expect
index 5841a0d..f8bd96c 100644
--- a/pkg/front_end/testcases/inference/super_property_get_substitution.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/super_property_get_substitution.dart.strong.transformed.expect
@@ -3,23 +3,23 @@
import "dart:core" as core;
import "dart:async" as asy;
-class D<T extends core::Object> extends core::Object {
+class D<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class E<T extends core::Object> extends self::D<self::E::T> {
+class E<T extends core::Object = dynamic> extends self::D<self::E::T> {
synthetic constructor •() → void
: super self::D::•()
;
}
-class B<T extends core::Object> extends core::Object {
+class B<T extends core::Object = dynamic> extends core::Object {
generic-covariant-impl generic-covariant-interface field self::D<self::B::T> x = null;
synthetic constructor •() → void
: super core::Object::•()
;
}
-class C<U extends core::Object> extends self::B<asy::Future<self::C::U>> {
+class C<U extends core::Object = dynamic> extends self::B<asy::Future<self::C::U>> {
synthetic constructor •() → void
: super self::B::•()
;
diff --git a/pkg/front_end/testcases/inference/super_property_set_substitution.dart.direct.expect b/pkg/front_end/testcases/inference/super_property_set_substitution.dart.direct.expect
index f4bec43..df509d6 100644
--- a/pkg/front_end/testcases/inference/super_property_set_substitution.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/super_property_set_substitution.dart.direct.expect
@@ -3,23 +3,23 @@
import "dart:core" as core;
import "dart:async" as asy;
-class D<T extends core::Object> extends core::Object {
+class D<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class E<T extends core::Object> extends self::D<self::E::T> {
+class E<T extends core::Object = dynamic> extends self::D<self::E::T> {
synthetic constructor •() → void
: super self::D::•()
;
}
-class B<T extends core::Object> extends core::Object {
+class B<T extends core::Object = dynamic> extends core::Object {
field self::D<self::B::T> x = null;
synthetic constructor •() → void
: super core::Object::•()
;
}
-class C<U extends core::Object> extends self::B<asy::Future<self::C::U>> {
+class C<U extends core::Object = dynamic> extends self::B<asy::Future<self::C::U>> {
synthetic constructor •() → void
: super self::B::•()
;
@@ -30,6 +30,6 @@
super.{self::B::x} = self::f<dynamic>();
}
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/super_property_set_substitution.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/super_property_set_substitution.dart.direct.transformed.expect
index f4bec43..df509d6 100644
--- a/pkg/front_end/testcases/inference/super_property_set_substitution.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/super_property_set_substitution.dart.direct.transformed.expect
@@ -3,23 +3,23 @@
import "dart:core" as core;
import "dart:async" as asy;
-class D<T extends core::Object> extends core::Object {
+class D<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class E<T extends core::Object> extends self::D<self::E::T> {
+class E<T extends core::Object = dynamic> extends self::D<self::E::T> {
synthetic constructor •() → void
: super self::D::•()
;
}
-class B<T extends core::Object> extends core::Object {
+class B<T extends core::Object = dynamic> extends core::Object {
field self::D<self::B::T> x = null;
synthetic constructor •() → void
: super core::Object::•()
;
}
-class C<U extends core::Object> extends self::B<asy::Future<self::C::U>> {
+class C<U extends core::Object = dynamic> extends self::B<asy::Future<self::C::U>> {
synthetic constructor •() → void
: super self::B::•()
;
@@ -30,6 +30,6 @@
super.{self::B::x} = self::f<dynamic>();
}
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/super_property_set_substitution.dart.outline.expect b/pkg/front_end/testcases/inference/super_property_set_substitution.dart.outline.expect
index 97fbb9b..aa354a1 100644
--- a/pkg/front_end/testcases/inference/super_property_set_substitution.dart.outline.expect
+++ b/pkg/front_end/testcases/inference/super_property_set_substitution.dart.outline.expect
@@ -3,20 +3,20 @@
import "dart:core" as core;
import "dart:async" as asy;
-class D<T extends core::Object> extends core::Object {
+class D<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
;
}
-class E<T extends core::Object> extends self::D<self::E::T> {
+class E<T extends core::Object = dynamic> extends self::D<self::E::T> {
synthetic constructor •() → void
;
}
-class B<T extends core::Object> extends core::Object {
+class B<T extends core::Object = dynamic> extends core::Object {
field self::D<self::B::T> x;
synthetic constructor •() → void
;
}
-class C<U extends core::Object> extends self::B<asy::Future<self::C::U>> {
+class C<U extends core::Object = dynamic> extends self::B<asy::Future<self::C::U>> {
synthetic constructor •() → void
;
get x() → self::E<asy::Future<self::C::U>>
@@ -26,7 +26,7 @@
method g() → void
;
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
;
static method main() → dynamic
;
diff --git a/pkg/front_end/testcases/inference/super_property_set_substitution.dart.strong.expect b/pkg/front_end/testcases/inference/super_property_set_substitution.dart.strong.expect
index 3103ff0..db2885e 100644
--- a/pkg/front_end/testcases/inference/super_property_set_substitution.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/super_property_set_substitution.dart.strong.expect
@@ -3,23 +3,23 @@
import "dart:core" as core;
import "dart:async" as asy;
-class D<T extends core::Object> extends core::Object {
+class D<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class E<T extends core::Object> extends self::D<self::E::T> {
+class E<T extends core::Object = dynamic> extends self::D<self::E::T> {
synthetic constructor •() → void
: super self::D::•()
;
}
-class B<T extends core::Object> extends core::Object {
+class B<T extends core::Object = dynamic> extends core::Object {
generic-covariant-impl generic-covariant-interface field self::D<self::B::T> x = null;
synthetic constructor •() → void
: super core::Object::•()
;
}
-class C<U extends core::Object> extends self::B<asy::Future<self::C::U>> {
+class C<U extends core::Object = dynamic> extends self::B<asy::Future<self::C::U>> {
synthetic constructor •() → void
: super self::B::•()
;
@@ -30,6 +30,6 @@
super.{self::B::x} = self::f<self::D<asy::Future<self::C::U>>>();
}
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/super_property_set_substitution.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/super_property_set_substitution.dart.strong.transformed.expect
index 3103ff0..db2885e 100644
--- a/pkg/front_end/testcases/inference/super_property_set_substitution.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/super_property_set_substitution.dart.strong.transformed.expect
@@ -3,23 +3,23 @@
import "dart:core" as core;
import "dart:async" as asy;
-class D<T extends core::Object> extends core::Object {
+class D<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class E<T extends core::Object> extends self::D<self::E::T> {
+class E<T extends core::Object = dynamic> extends self::D<self::E::T> {
synthetic constructor •() → void
: super self::D::•()
;
}
-class B<T extends core::Object> extends core::Object {
+class B<T extends core::Object = dynamic> extends core::Object {
generic-covariant-impl generic-covariant-interface field self::D<self::B::T> x = null;
synthetic constructor •() → void
: super core::Object::•()
;
}
-class C<U extends core::Object> extends self::B<asy::Future<self::C::U>> {
+class C<U extends core::Object = dynamic> extends self::B<asy::Future<self::C::U>> {
synthetic constructor •() → void
: super self::B::•()
;
@@ -30,6 +30,6 @@
super.{self::B::x} = self::f<self::D<asy::Future<self::C::U>>>();
}
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/this_reference.dart.direct.expect b/pkg/front_end/testcases/inference/this_reference.dart.direct.expect
index b04ed9d..bb11426 100644
--- a/pkg/front_end/testcases/inference/this_reference.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/this_reference.dart.direct.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class C<T extends core::Object> extends core::Object {
+class C<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/inference/this_reference.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/this_reference.dart.direct.transformed.expect
index b04ed9d..bb11426 100644
--- a/pkg/front_end/testcases/inference/this_reference.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/this_reference.dart.direct.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class C<T extends core::Object> extends core::Object {
+class C<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/inference/this_reference.dart.outline.expect b/pkg/front_end/testcases/inference/this_reference.dart.outline.expect
index c506387..26fb9e8 100644
--- a/pkg/front_end/testcases/inference/this_reference.dart.outline.expect
+++ b/pkg/front_end/testcases/inference/this_reference.dart.outline.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class C<T extends core::Object> extends core::Object {
+class C<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
;
method f() → void
diff --git a/pkg/front_end/testcases/inference/this_reference.dart.strong.expect b/pkg/front_end/testcases/inference/this_reference.dart.strong.expect
index 2c721a1..d2a5bd6 100644
--- a/pkg/front_end/testcases/inference/this_reference.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/this_reference.dart.strong.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class C<T extends core::Object> extends core::Object {
+class C<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/inference/this_reference.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/this_reference.dart.strong.transformed.expect
index 2c721a1..d2a5bd6 100644
--- a/pkg/front_end/testcases/inference/this_reference.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/this_reference.dart.strong.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class C<T extends core::Object> extends core::Object {
+class C<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/inference/type_cast.dart.direct.expect b/pkg/front_end/testcases/inference/type_cast.dart.direct.expect
index 92d88c6..a69bbca 100644
--- a/pkg/front_end/testcases/inference/type_cast.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/type_cast.dart.direct.expect
@@ -2,12 +2,12 @@
import self as self;
import "dart:core" as core;
-class A<T extends core::Object> extends core::Object {
+class A<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class B<T extends core::Object> extends self::A<self::B::T> {
+class B<T extends core::Object = dynamic> extends self::A<self::B::T> {
synthetic constructor •() → void
: super self::A::•()
;
diff --git a/pkg/front_end/testcases/inference/type_cast.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/type_cast.dart.direct.transformed.expect
index 92d88c6..a69bbca 100644
--- a/pkg/front_end/testcases/inference/type_cast.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/type_cast.dart.direct.transformed.expect
@@ -2,12 +2,12 @@
import self as self;
import "dart:core" as core;
-class A<T extends core::Object> extends core::Object {
+class A<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class B<T extends core::Object> extends self::A<self::B::T> {
+class B<T extends core::Object = dynamic> extends self::A<self::B::T> {
synthetic constructor •() → void
: super self::A::•()
;
diff --git a/pkg/front_end/testcases/inference/type_cast.dart.outline.expect b/pkg/front_end/testcases/inference/type_cast.dart.outline.expect
index 8491585..626f607 100644
--- a/pkg/front_end/testcases/inference/type_cast.dart.outline.expect
+++ b/pkg/front_end/testcases/inference/type_cast.dart.outline.expect
@@ -2,11 +2,11 @@
import self as self;
import "dart:core" as core;
-class A<T extends core::Object> extends core::Object {
+class A<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
;
}
-class B<T extends core::Object> extends self::A<self::B::T> {
+class B<T extends core::Object = dynamic> extends self::A<self::B::T> {
synthetic constructor •() → void
;
method foo() → dynamic
diff --git a/pkg/front_end/testcases/inference/type_cast.dart.strong.expect b/pkg/front_end/testcases/inference/type_cast.dart.strong.expect
index 2418fa8..cd505b4 100644
--- a/pkg/front_end/testcases/inference/type_cast.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/type_cast.dart.strong.expect
@@ -2,12 +2,12 @@
import self as self;
import "dart:core" as core;
-class A<T extends core::Object> extends core::Object {
+class A<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class B<T extends core::Object> extends self::A<self::B::T> {
+class B<T extends core::Object = dynamic> extends self::A<self::B::T> {
synthetic constructor •() → void
: super self::A::•()
;
diff --git a/pkg/front_end/testcases/inference/type_cast.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/type_cast.dart.strong.transformed.expect
index 2418fa8..cd505b4 100644
--- a/pkg/front_end/testcases/inference/type_cast.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/type_cast.dart.strong.transformed.expect
@@ -2,12 +2,12 @@
import self as self;
import "dart:core" as core;
-class A<T extends core::Object> extends core::Object {
+class A<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class B<T extends core::Object> extends self::A<self::B::T> {
+class B<T extends core::Object = dynamic> extends self::A<self::B::T> {
synthetic constructor •() → void
: super self::A::•()
;
diff --git a/pkg/front_end/testcases/inference/unresolved_super.dart.direct.expect b/pkg/front_end/testcases/inference/unresolved_super.dart.direct.expect
index 42d105e..7b6dfaa 100644
--- a/pkg/front_end/testcases/inference/unresolved_super.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/unresolved_super.dart.direct.expect
@@ -14,6 +14,6 @@
dynamic v5 = let final dynamic #t1 = 0 in let final dynamic #t2 = self::f<dynamic>() in let final dynamic #t3 = super.[]=(#t1, #t2) in #t2;
}
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/unresolved_super.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/unresolved_super.dart.direct.transformed.expect
index 42d105e..7b6dfaa 100644
--- a/pkg/front_end/testcases/inference/unresolved_super.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/unresolved_super.dart.direct.transformed.expect
@@ -14,6 +14,6 @@
dynamic v5 = let final dynamic #t1 = 0 in let final dynamic #t2 = self::f<dynamic>() in let final dynamic #t3 = super.[]=(#t1, #t2) in #t2;
}
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/unresolved_super.dart.outline.expect b/pkg/front_end/testcases/inference/unresolved_super.dart.outline.expect
index ac4a642..5b2f1ca 100644
--- a/pkg/front_end/testcases/inference/unresolved_super.dart.outline.expect
+++ b/pkg/front_end/testcases/inference/unresolved_super.dart.outline.expect
@@ -8,7 +8,7 @@
method test() → void
;
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
;
static method main() → dynamic
;
diff --git a/pkg/front_end/testcases/inference/unresolved_super.dart.strong.expect b/pkg/front_end/testcases/inference/unresolved_super.dart.strong.expect
index f3c83b5..7406276 100644
--- a/pkg/front_end/testcases/inference/unresolved_super.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/unresolved_super.dart.strong.expect
@@ -25,6 +25,6 @@
^^^", "pkg/front_end/testcases/inference/unresolved_super.dart:16:37: Error: Superclass has no method named '[]='.
var /*@type=dynamic*/ v5 = super[0] = /*@typeArgs=dynamic*/ f();
^"]/* from null */;
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/unsafe_block_closure_inference_constructor_call_explicit_dynamic_param.dart.direct.expect b/pkg/front_end/testcases/inference/unsafe_block_closure_inference_constructor_call_explicit_dynamic_param.dart.direct.expect
index ea9c98e..75af777 100644
--- a/pkg/front_end/testcases/inference/unsafe_block_closure_inference_constructor_call_explicit_dynamic_param.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/unsafe_block_closure_inference_constructor_call_explicit_dynamic_param.dart.direct.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class C<T extends core::Object> extends core::Object {
+class C<T extends core::Object = dynamic> extends core::Object {
constructor •(() → self::C::T x) → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/inference/unsafe_block_closure_inference_constructor_call_explicit_dynamic_param.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/unsafe_block_closure_inference_constructor_call_explicit_dynamic_param.dart.direct.transformed.expect
index ea9c98e..75af777 100644
--- a/pkg/front_end/testcases/inference/unsafe_block_closure_inference_constructor_call_explicit_dynamic_param.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/unsafe_block_closure_inference_constructor_call_explicit_dynamic_param.dart.direct.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class C<T extends core::Object> extends core::Object {
+class C<T extends core::Object = dynamic> extends core::Object {
constructor •(() → self::C::T x) → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/inference/unsafe_block_closure_inference_constructor_call_explicit_dynamic_param.dart.strong.expect b/pkg/front_end/testcases/inference/unsafe_block_closure_inference_constructor_call_explicit_dynamic_param.dart.strong.expect
index e19dd93..89810b9 100644
--- a/pkg/front_end/testcases/inference/unsafe_block_closure_inference_constructor_call_explicit_dynamic_param.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/unsafe_block_closure_inference_constructor_call_explicit_dynamic_param.dart.strong.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class C<T extends core::Object> extends core::Object {
+class C<T extends core::Object = dynamic> extends core::Object {
constructor •(() → self::C::T x) → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/inference/unsafe_block_closure_inference_constructor_call_explicit_dynamic_param.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/unsafe_block_closure_inference_constructor_call_explicit_dynamic_param.dart.strong.transformed.expect
index e19dd93..89810b9 100644
--- a/pkg/front_end/testcases/inference/unsafe_block_closure_inference_constructor_call_explicit_dynamic_param.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/unsafe_block_closure_inference_constructor_call_explicit_dynamic_param.dart.strong.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class C<T extends core::Object> extends core::Object {
+class C<T extends core::Object = dynamic> extends core::Object {
constructor •(() → self::C::T x) → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/inference/unsafe_block_closure_inference_constructor_call_explicit_type_param.dart.direct.expect b/pkg/front_end/testcases/inference/unsafe_block_closure_inference_constructor_call_explicit_type_param.dart.direct.expect
index 2f5725e..7627c24 100644
--- a/pkg/front_end/testcases/inference/unsafe_block_closure_inference_constructor_call_explicit_type_param.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/unsafe_block_closure_inference_constructor_call_explicit_type_param.dart.direct.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class C<T extends core::Object> extends core::Object {
+class C<T extends core::Object = dynamic> extends core::Object {
constructor •(() → self::C::T x) → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/inference/unsafe_block_closure_inference_constructor_call_explicit_type_param.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/unsafe_block_closure_inference_constructor_call_explicit_type_param.dart.direct.transformed.expect
index 2f5725e..7627c24 100644
--- a/pkg/front_end/testcases/inference/unsafe_block_closure_inference_constructor_call_explicit_type_param.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/unsafe_block_closure_inference_constructor_call_explicit_type_param.dart.direct.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class C<T extends core::Object> extends core::Object {
+class C<T extends core::Object = dynamic> extends core::Object {
constructor •(() → self::C::T x) → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/inference/unsafe_block_closure_inference_constructor_call_explicit_type_param.dart.strong.expect b/pkg/front_end/testcases/inference/unsafe_block_closure_inference_constructor_call_explicit_type_param.dart.strong.expect
index cdef38d..bbd32a9 100644
--- a/pkg/front_end/testcases/inference/unsafe_block_closure_inference_constructor_call_explicit_type_param.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/unsafe_block_closure_inference_constructor_call_explicit_type_param.dart.strong.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class C<T extends core::Object> extends core::Object {
+class C<T extends core::Object = dynamic> extends core::Object {
constructor •(() → self::C::T x) → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/inference/unsafe_block_closure_inference_constructor_call_explicit_type_param.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/unsafe_block_closure_inference_constructor_call_explicit_type_param.dart.strong.transformed.expect
index cdef38d..bbd32a9 100644
--- a/pkg/front_end/testcases/inference/unsafe_block_closure_inference_constructor_call_explicit_type_param.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/unsafe_block_closure_inference_constructor_call_explicit_type_param.dart.strong.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class C<T extends core::Object> extends core::Object {
+class C<T extends core::Object = dynamic> extends core::Object {
constructor •(() → self::C::T x) → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/inference/unsafe_block_closure_inference_constructor_call_implicit_type_param.dart.direct.expect b/pkg/front_end/testcases/inference/unsafe_block_closure_inference_constructor_call_implicit_type_param.dart.direct.expect
index ab67a68..33065a8 100644
--- a/pkg/front_end/testcases/inference/unsafe_block_closure_inference_constructor_call_implicit_type_param.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/unsafe_block_closure_inference_constructor_call_implicit_type_param.dart.direct.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class C<T extends core::Object> extends core::Object {
+class C<T extends core::Object = dynamic> extends core::Object {
constructor •(() → self::C::T x) → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/inference/unsafe_block_closure_inference_constructor_call_implicit_type_param.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/unsafe_block_closure_inference_constructor_call_implicit_type_param.dart.direct.transformed.expect
index ab67a68..33065a8 100644
--- a/pkg/front_end/testcases/inference/unsafe_block_closure_inference_constructor_call_implicit_type_param.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/unsafe_block_closure_inference_constructor_call_implicit_type_param.dart.direct.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class C<T extends core::Object> extends core::Object {
+class C<T extends core::Object = dynamic> extends core::Object {
constructor •(() → self::C::T x) → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/inference/unsafe_block_closure_inference_constructor_call_implicit_type_param.dart.strong.expect b/pkg/front_end/testcases/inference/unsafe_block_closure_inference_constructor_call_implicit_type_param.dart.strong.expect
index 9377cb7..93ad8f7 100644
--- a/pkg/front_end/testcases/inference/unsafe_block_closure_inference_constructor_call_implicit_type_param.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/unsafe_block_closure_inference_constructor_call_implicit_type_param.dart.strong.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class C<T extends core::Object> extends core::Object {
+class C<T extends core::Object = dynamic> extends core::Object {
constructor •(() → self::C::T x) → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/inference/unsafe_block_closure_inference_constructor_call_implicit_type_param.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/unsafe_block_closure_inference_constructor_call_implicit_type_param.dart.strong.transformed.expect
index 9377cb7..93ad8f7 100644
--- a/pkg/front_end/testcases/inference/unsafe_block_closure_inference_constructor_call_implicit_type_param.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/unsafe_block_closure_inference_constructor_call_implicit_type_param.dart.strong.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class C<T extends core::Object> extends core::Object {
+class C<T extends core::Object = dynamic> extends core::Object {
constructor •(() → self::C::T x) → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_dynamic_param.dart.direct.expect b/pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_dynamic_param.dart.direct.expect
index 987511d..8fe3a76 100644
--- a/pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_dynamic_param.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_dynamic_param.dart.direct.expect
@@ -5,7 +5,7 @@
static field dynamic v = self::f<dynamic>(() → dynamic {
return 1;
});
-static method f<T extends core::Object>(() → self::f::T g) → core::List<self::f::T>
+static method f<T extends core::Object = dynamic>(() → self::f::T g) → core::List<self::f::T>
return <self::f::T>[g.call()];
static method main() → dynamic {
self::v;
diff --git a/pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_dynamic_param.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_dynamic_param.dart.direct.transformed.expect
index 987511d..8fe3a76 100644
--- a/pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_dynamic_param.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_dynamic_param.dart.direct.transformed.expect
@@ -5,7 +5,7 @@
static field dynamic v = self::f<dynamic>(() → dynamic {
return 1;
});
-static method f<T extends core::Object>(() → self::f::T g) → core::List<self::f::T>
+static method f<T extends core::Object = dynamic>(() → self::f::T g) → core::List<self::f::T>
return <self::f::T>[g.call()];
static method main() → dynamic {
self::v;
diff --git a/pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_dynamic_param.dart.strong.expect b/pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_dynamic_param.dart.strong.expect
index 757a833..ef5e6ca 100644
--- a/pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_dynamic_param.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_dynamic_param.dart.strong.expect
@@ -5,7 +5,7 @@
static field core::List<dynamic> v = self::f<dynamic>(() → core::int {
return 1;
});
-static method f<T extends core::Object>(() → self::f::T g) → core::List<self::f::T>
+static method f<T extends core::Object = dynamic>(() → self::f::T g) → core::List<self::f::T>
return <self::f::T>[g.call()];
static method main() → dynamic {
self::v;
diff --git a/pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_dynamic_param.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_dynamic_param.dart.strong.transformed.expect
index 757a833..ef5e6ca 100644
--- a/pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_dynamic_param.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_dynamic_param.dart.strong.transformed.expect
@@ -5,7 +5,7 @@
static field core::List<dynamic> v = self::f<dynamic>(() → core::int {
return 1;
});
-static method f<T extends core::Object>(() → self::f::T g) → core::List<self::f::T>
+static method f<T extends core::Object = dynamic>(() → self::f::T g) → core::List<self::f::T>
return <self::f::T>[g.call()];
static method main() → dynamic {
self::v;
diff --git a/pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_type_param.dart.direct.expect b/pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_type_param.dart.direct.expect
index 4965d22..2e73b66 100644
--- a/pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_type_param.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_type_param.dart.direct.expect
@@ -5,7 +5,7 @@
static field dynamic v = self::f<core::int>(() → dynamic {
return 1;
});
-static method f<T extends core::Object>(() → self::f::T g) → core::List<self::f::T>
+static method f<T extends core::Object = dynamic>(() → self::f::T g) → core::List<self::f::T>
return <self::f::T>[g.call()];
static method main() → dynamic {
self::v;
diff --git a/pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_type_param.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_type_param.dart.direct.transformed.expect
index 4965d22..2e73b66 100644
--- a/pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_type_param.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_type_param.dart.direct.transformed.expect
@@ -5,7 +5,7 @@
static field dynamic v = self::f<core::int>(() → dynamic {
return 1;
});
-static method f<T extends core::Object>(() → self::f::T g) → core::List<self::f::T>
+static method f<T extends core::Object = dynamic>(() → self::f::T g) → core::List<self::f::T>
return <self::f::T>[g.call()];
static method main() → dynamic {
self::v;
diff --git a/pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_type_param.dart.strong.expect b/pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_type_param.dart.strong.expect
index 4242dc9..16be853 100644
--- a/pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_type_param.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_type_param.dart.strong.expect
@@ -5,7 +5,7 @@
static field core::List<core::int> v = self::f<core::int>(() → core::int {
return 1;
});
-static method f<T extends core::Object>(() → self::f::T g) → core::List<self::f::T>
+static method f<T extends core::Object = dynamic>(() → self::f::T g) → core::List<self::f::T>
return <self::f::T>[g.call()];
static method main() → dynamic {
self::v;
diff --git a/pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_type_param.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_type_param.dart.strong.transformed.expect
index 4242dc9..16be853 100644
--- a/pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_type_param.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_explicit_type_param.dart.strong.transformed.expect
@@ -5,7 +5,7 @@
static field core::List<core::int> v = self::f<core::int>(() → core::int {
return 1;
});
-static method f<T extends core::Object>(() → self::f::T g) → core::List<self::f::T>
+static method f<T extends core::Object = dynamic>(() → self::f::T g) → core::List<self::f::T>
return <self::f::T>[g.call()];
static method main() → dynamic {
self::v;
diff --git a/pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_implicit_type_param.dart.direct.expect b/pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_implicit_type_param.dart.direct.expect
index 89fc3e2..e222b86 100644
--- a/pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_implicit_type_param.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_implicit_type_param.dart.direct.expect
@@ -7,5 +7,5 @@
return 1;
});
}
-static method f<T extends core::Object>(() → self::f::T g) → core::List<self::f::T>
+static method f<T extends core::Object = dynamic>(() → self::f::T g) → core::List<self::f::T>
return <self::f::T>[g.call()];
diff --git a/pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_implicit_type_param.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_implicit_type_param.dart.direct.transformed.expect
index 89fc3e2..e222b86 100644
--- a/pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_implicit_type_param.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_implicit_type_param.dart.direct.transformed.expect
@@ -7,5 +7,5 @@
return 1;
});
}
-static method f<T extends core::Object>(() → self::f::T g) → core::List<self::f::T>
+static method f<T extends core::Object = dynamic>(() → self::f::T g) → core::List<self::f::T>
return <self::f::T>[g.call()];
diff --git a/pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_implicit_type_param.dart.strong.expect b/pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_implicit_type_param.dart.strong.expect
index 27f92d8..6e09452 100644
--- a/pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_implicit_type_param.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_implicit_type_param.dart.strong.expect
@@ -7,5 +7,5 @@
return 1;
});
}
-static method f<T extends core::Object>(() → self::f::T g) → core::List<self::f::T>
+static method f<T extends core::Object = dynamic>(() → self::f::T g) → core::List<self::f::T>
return <self::f::T>[g.call()];
diff --git a/pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_implicit_type_param.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_implicit_type_param.dart.strong.transformed.expect
index 27f92d8..6e09452 100644
--- a/pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_implicit_type_param.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_implicit_type_param.dart.strong.transformed.expect
@@ -7,5 +7,5 @@
return 1;
});
}
-static method f<T extends core::Object>(() → self::f::T g) → core::List<self::f::T>
+static method f<T extends core::Object = dynamic>(() → self::f::T g) → core::List<self::f::T>
return <self::f::T>[g.call()];
diff --git a/pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_implicit_type_param_via_expr.dart.direct.expect b/pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_implicit_type_param_via_expr.dart.direct.expect
index 5d7db44..614a9eb 100644
--- a/pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_implicit_type_param_via_expr.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_implicit_type_param_via_expr.dart.direct.expect
@@ -7,5 +7,5 @@
return 1;
});
}
-static method f<T extends core::Object>(() → self::f::T g) → core::List<self::f::T>
+static method f<T extends core::Object = dynamic>(() → self::f::T g) → core::List<self::f::T>
return <self::f::T>[g.call()];
diff --git a/pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_implicit_type_param_via_expr.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_implicit_type_param_via_expr.dart.direct.transformed.expect
index 5d7db44..614a9eb 100644
--- a/pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_implicit_type_param_via_expr.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_implicit_type_param_via_expr.dart.direct.transformed.expect
@@ -7,5 +7,5 @@
return 1;
});
}
-static method f<T extends core::Object>(() → self::f::T g) → core::List<self::f::T>
+static method f<T extends core::Object = dynamic>(() → self::f::T g) → core::List<self::f::T>
return <self::f::T>[g.call()];
diff --git a/pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_implicit_type_param_via_expr.dart.strong.expect b/pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_implicit_type_param_via_expr.dart.strong.expect
index d78578d..f1a71c2 100644
--- a/pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_implicit_type_param_via_expr.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_implicit_type_param_via_expr.dart.strong.expect
@@ -7,5 +7,5 @@
return 1;
});
}
-static method f<T extends core::Object>(() → self::f::T g) → core::List<self::f::T>
+static method f<T extends core::Object = dynamic>(() → self::f::T g) → core::List<self::f::T>
return <self::f::T>[g.call()];
diff --git a/pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_implicit_type_param_via_expr.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_implicit_type_param_via_expr.dart.strong.transformed.expect
index d78578d..f1a71c2 100644
--- a/pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_implicit_type_param_via_expr.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/unsafe_block_closure_inference_function_call_implicit_type_param_via_expr.dart.strong.transformed.expect
@@ -7,5 +7,5 @@
return 1;
});
}
-static method f<T extends core::Object>(() → self::f::T g) → core::List<self::f::T>
+static method f<T extends core::Object = dynamic>(() → self::f::T g) → core::List<self::f::T>
return <self::f::T>[g.call()];
diff --git a/pkg/front_end/testcases/inference/unsafe_block_closure_inference_method_call_explicit_dynamic_param.dart.direct.expect b/pkg/front_end/testcases/inference/unsafe_block_closure_inference_method_call_explicit_dynamic_param.dart.direct.expect
index 94926cb..acfcd08 100644
--- a/pkg/front_end/testcases/inference/unsafe_block_closure_inference_method_call_explicit_dynamic_param.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/unsafe_block_closure_inference_method_call_explicit_dynamic_param.dart.direct.expect
@@ -6,7 +6,7 @@
synthetic constructor •() → void
: super core::Object::•()
;
- method f<T extends core::Object>(() → self::C::f::T g) → core::List<self::C::f::T>
+ method f<T extends core::Object = dynamic>(() → self::C::f::T g) → core::List<self::C::f::T>
return <self::C::f::T>[g.call()];
}
static method main() → dynamic {
diff --git a/pkg/front_end/testcases/inference/unsafe_block_closure_inference_method_call_explicit_dynamic_param.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/unsafe_block_closure_inference_method_call_explicit_dynamic_param.dart.direct.transformed.expect
index 94926cb..acfcd08 100644
--- a/pkg/front_end/testcases/inference/unsafe_block_closure_inference_method_call_explicit_dynamic_param.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/unsafe_block_closure_inference_method_call_explicit_dynamic_param.dart.direct.transformed.expect
@@ -6,7 +6,7 @@
synthetic constructor •() → void
: super core::Object::•()
;
- method f<T extends core::Object>(() → self::C::f::T g) → core::List<self::C::f::T>
+ method f<T extends core::Object = dynamic>(() → self::C::f::T g) → core::List<self::C::f::T>
return <self::C::f::T>[g.call()];
}
static method main() → dynamic {
diff --git a/pkg/front_end/testcases/inference/unsafe_block_closure_inference_method_call_explicit_dynamic_param.dart.strong.expect b/pkg/front_end/testcases/inference/unsafe_block_closure_inference_method_call_explicit_dynamic_param.dart.strong.expect
index 453c72f..1541ba0 100644
--- a/pkg/front_end/testcases/inference/unsafe_block_closure_inference_method_call_explicit_dynamic_param.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/unsafe_block_closure_inference_method_call_explicit_dynamic_param.dart.strong.expect
@@ -6,7 +6,7 @@
synthetic constructor •() → void
: super core::Object::•()
;
- method f<T extends core::Object>(() → self::C::f::T g) → core::List<self::C::f::T>
+ method f<T extends core::Object = dynamic>(() → self::C::f::T g) → core::List<self::C::f::T>
return <self::C::f::T>[g.call()];
}
static method main() → dynamic {
diff --git a/pkg/front_end/testcases/inference/unsafe_block_closure_inference_method_call_explicit_dynamic_param.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/unsafe_block_closure_inference_method_call_explicit_dynamic_param.dart.strong.transformed.expect
index 453c72f..1541ba0 100644
--- a/pkg/front_end/testcases/inference/unsafe_block_closure_inference_method_call_explicit_dynamic_param.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/unsafe_block_closure_inference_method_call_explicit_dynamic_param.dart.strong.transformed.expect
@@ -6,7 +6,7 @@
synthetic constructor •() → void
: super core::Object::•()
;
- method f<T extends core::Object>(() → self::C::f::T g) → core::List<self::C::f::T>
+ method f<T extends core::Object = dynamic>(() → self::C::f::T g) → core::List<self::C::f::T>
return <self::C::f::T>[g.call()];
}
static method main() → dynamic {
diff --git a/pkg/front_end/testcases/inference/unsafe_block_closure_inference_method_call_explicit_type_param.dart.direct.expect b/pkg/front_end/testcases/inference/unsafe_block_closure_inference_method_call_explicit_type_param.dart.direct.expect
index 601a1ea..6d4f94d 100644
--- a/pkg/front_end/testcases/inference/unsafe_block_closure_inference_method_call_explicit_type_param.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/unsafe_block_closure_inference_method_call_explicit_type_param.dart.direct.expect
@@ -6,7 +6,7 @@
synthetic constructor •() → void
: super core::Object::•()
;
- method f<T extends core::Object>(() → self::C::f::T g) → core::List<self::C::f::T>
+ method f<T extends core::Object = dynamic>(() → self::C::f::T g) → core::List<self::C::f::T>
return <self::C::f::T>[g.call()];
}
static method main() → dynamic {
diff --git a/pkg/front_end/testcases/inference/unsafe_block_closure_inference_method_call_explicit_type_param.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/unsafe_block_closure_inference_method_call_explicit_type_param.dart.direct.transformed.expect
index 601a1ea..6d4f94d 100644
--- a/pkg/front_end/testcases/inference/unsafe_block_closure_inference_method_call_explicit_type_param.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/unsafe_block_closure_inference_method_call_explicit_type_param.dart.direct.transformed.expect
@@ -6,7 +6,7 @@
synthetic constructor •() → void
: super core::Object::•()
;
- method f<T extends core::Object>(() → self::C::f::T g) → core::List<self::C::f::T>
+ method f<T extends core::Object = dynamic>(() → self::C::f::T g) → core::List<self::C::f::T>
return <self::C::f::T>[g.call()];
}
static method main() → dynamic {
diff --git a/pkg/front_end/testcases/inference/unsafe_block_closure_inference_method_call_explicit_type_param.dart.strong.expect b/pkg/front_end/testcases/inference/unsafe_block_closure_inference_method_call_explicit_type_param.dart.strong.expect
index 2cb1a2a..cb76f4d 100644
--- a/pkg/front_end/testcases/inference/unsafe_block_closure_inference_method_call_explicit_type_param.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/unsafe_block_closure_inference_method_call_explicit_type_param.dart.strong.expect
@@ -6,7 +6,7 @@
synthetic constructor •() → void
: super core::Object::•()
;
- method f<T extends core::Object>(() → self::C::f::T g) → core::List<self::C::f::T>
+ method f<T extends core::Object = dynamic>(() → self::C::f::T g) → core::List<self::C::f::T>
return <self::C::f::T>[g.call()];
}
static method main() → dynamic {
diff --git a/pkg/front_end/testcases/inference/unsafe_block_closure_inference_method_call_explicit_type_param.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/unsafe_block_closure_inference_method_call_explicit_type_param.dart.strong.transformed.expect
index 2cb1a2a..cb76f4d 100644
--- a/pkg/front_end/testcases/inference/unsafe_block_closure_inference_method_call_explicit_type_param.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/unsafe_block_closure_inference_method_call_explicit_type_param.dart.strong.transformed.expect
@@ -6,7 +6,7 @@
synthetic constructor •() → void
: super core::Object::•()
;
- method f<T extends core::Object>(() → self::C::f::T g) → core::List<self::C::f::T>
+ method f<T extends core::Object = dynamic>(() → self::C::f::T g) → core::List<self::C::f::T>
return <self::C::f::T>[g.call()];
}
static method main() → dynamic {
diff --git a/pkg/front_end/testcases/inference/unsafe_block_closure_inference_method_call_implicit_type_param.dart.direct.expect b/pkg/front_end/testcases/inference/unsafe_block_closure_inference_method_call_implicit_type_param.dart.direct.expect
index 46c4204..e8f01e3 100644
--- a/pkg/front_end/testcases/inference/unsafe_block_closure_inference_method_call_implicit_type_param.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/unsafe_block_closure_inference_method_call_implicit_type_param.dart.direct.expect
@@ -6,7 +6,7 @@
synthetic constructor •() → void
: super core::Object::•()
;
- method f<T extends core::Object>(() → self::C::f::T g) → core::List<self::C::f::T>
+ method f<T extends core::Object = dynamic>(() → self::C::f::T g) → core::List<self::C::f::T>
return <self::C::f::T>[g.call()];
}
static method main() → dynamic {
diff --git a/pkg/front_end/testcases/inference/unsafe_block_closure_inference_method_call_implicit_type_param.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/unsafe_block_closure_inference_method_call_implicit_type_param.dart.direct.transformed.expect
index 46c4204..e8f01e3 100644
--- a/pkg/front_end/testcases/inference/unsafe_block_closure_inference_method_call_implicit_type_param.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/unsafe_block_closure_inference_method_call_implicit_type_param.dart.direct.transformed.expect
@@ -6,7 +6,7 @@
synthetic constructor •() → void
: super core::Object::•()
;
- method f<T extends core::Object>(() → self::C::f::T g) → core::List<self::C::f::T>
+ method f<T extends core::Object = dynamic>(() → self::C::f::T g) → core::List<self::C::f::T>
return <self::C::f::T>[g.call()];
}
static method main() → dynamic {
diff --git a/pkg/front_end/testcases/inference/unsafe_block_closure_inference_method_call_implicit_type_param.dart.strong.expect b/pkg/front_end/testcases/inference/unsafe_block_closure_inference_method_call_implicit_type_param.dart.strong.expect
index 2cb1a2a..cb76f4d 100644
--- a/pkg/front_end/testcases/inference/unsafe_block_closure_inference_method_call_implicit_type_param.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/unsafe_block_closure_inference_method_call_implicit_type_param.dart.strong.expect
@@ -6,7 +6,7 @@
synthetic constructor •() → void
: super core::Object::•()
;
- method f<T extends core::Object>(() → self::C::f::T g) → core::List<self::C::f::T>
+ method f<T extends core::Object = dynamic>(() → self::C::f::T g) → core::List<self::C::f::T>
return <self::C::f::T>[g.call()];
}
static method main() → dynamic {
diff --git a/pkg/front_end/testcases/inference/unsafe_block_closure_inference_method_call_implicit_type_param.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/unsafe_block_closure_inference_method_call_implicit_type_param.dart.strong.transformed.expect
index 2cb1a2a..cb76f4d 100644
--- a/pkg/front_end/testcases/inference/unsafe_block_closure_inference_method_call_implicit_type_param.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/unsafe_block_closure_inference_method_call_implicit_type_param.dart.strong.transformed.expect
@@ -6,7 +6,7 @@
synthetic constructor •() → void
: super core::Object::•()
;
- method f<T extends core::Object>(() → self::C::f::T g) → core::List<self::C::f::T>
+ method f<T extends core::Object = dynamic>(() → self::C::f::T g) → core::List<self::C::f::T>
return <self::C::f::T>[g.call()];
}
static method main() → dynamic {
diff --git a/pkg/front_end/testcases/inference/void_return_type_subtypes_dynamic.dart.direct.expect b/pkg/front_end/testcases/inference/void_return_type_subtypes_dynamic.dart.direct.expect
index 7aabcb2..e9f8f19 100644
--- a/pkg/front_end/testcases/inference/void_return_type_subtypes_dynamic.dart.direct.expect
+++ b/pkg/front_end/testcases/inference/void_return_type_subtypes_dynamic.dart.direct.expect
@@ -3,7 +3,7 @@
import "dart:core" as core;
static field dynamic x = self::run<dynamic>(self::printRunning);
-static method run<T extends core::Object>(() → self::run::T f) → self::run::T {
+static method run<T extends core::Object = dynamic>(() → self::run::T f) → self::run::T {
core::print("running");
dynamic t = f.call();
core::print("done running");
diff --git a/pkg/front_end/testcases/inference/void_return_type_subtypes_dynamic.dart.direct.transformed.expect b/pkg/front_end/testcases/inference/void_return_type_subtypes_dynamic.dart.direct.transformed.expect
index 7aabcb2..e9f8f19 100644
--- a/pkg/front_end/testcases/inference/void_return_type_subtypes_dynamic.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference/void_return_type_subtypes_dynamic.dart.direct.transformed.expect
@@ -3,7 +3,7 @@
import "dart:core" as core;
static field dynamic x = self::run<dynamic>(self::printRunning);
-static method run<T extends core::Object>(() → self::run::T f) → self::run::T {
+static method run<T extends core::Object = dynamic>(() → self::run::T f) → self::run::T {
core::print("running");
dynamic t = f.call();
core::print("done running");
diff --git a/pkg/front_end/testcases/inference/void_return_type_subtypes_dynamic.dart.strong.expect b/pkg/front_end/testcases/inference/void_return_type_subtypes_dynamic.dart.strong.expect
index 0fdc0e3..0d3fd7d 100644
--- a/pkg/front_end/testcases/inference/void_return_type_subtypes_dynamic.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/void_return_type_subtypes_dynamic.dart.strong.expect
@@ -3,7 +3,7 @@
import "dart:core" as core;
static field dynamic x = self::run<dynamic>(self::printRunning);
-static method run<T extends core::Object>(() → self::run::T f) → self::run::T {
+static method run<T extends core::Object = dynamic>(() → self::run::T f) → self::run::T {
core::print("running");
self::run::T t = f.call();
core::print("done running");
diff --git a/pkg/front_end/testcases/inference/void_return_type_subtypes_dynamic.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/void_return_type_subtypes_dynamic.dart.strong.transformed.expect
index 0fdc0e3..0d3fd7d 100644
--- a/pkg/front_end/testcases/inference/void_return_type_subtypes_dynamic.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/void_return_type_subtypes_dynamic.dart.strong.transformed.expect
@@ -3,7 +3,7 @@
import "dart:core" as core;
static field dynamic x = self::run<dynamic>(self::printRunning);
-static method run<T extends core::Object>(() → self::run::T f) → self::run::T {
+static method run<T extends core::Object = dynamic>(() → self::run::T f) → self::run::T {
core::print("running");
self::run::T t = f.call();
core::print("done running");
diff --git a/pkg/front_end/testcases/inference_new/const_invocation.dart.direct.expect b/pkg/front_end/testcases/inference_new/const_invocation.dart.direct.expect
index 16e4209..94629b4 100644
--- a/pkg/front_end/testcases/inference_new/const_invocation.dart.direct.expect
+++ b/pkg/front_end/testcases/inference_new/const_invocation.dart.direct.expect
@@ -2,8 +2,8 @@
import self as self;
import "dart:core" as core;
-typedef F<U extends core::Object, V extends core::Object> = (U) → V;
-class Foo<T extends core::Object> extends core::Object {
+typedef F<U extends core::Object = dynamic, V extends core::Object = dynamic> = (U) → V;
+class Foo<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
@@ -26,7 +26,7 @@
get v9() → core::Map<self::Foo::T, (self::Foo::T) → self::Foo::T>
return const <dynamic, dynamic>{};
}
-class Bar<T extends core::Object> extends core::Object {
+class Bar<T extends core::Object = dynamic> extends core::Object {
const constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/inference_new/const_invocation.dart.direct.transformed.expect b/pkg/front_end/testcases/inference_new/const_invocation.dart.direct.transformed.expect
index 16e4209..94629b4 100644
--- a/pkg/front_end/testcases/inference_new/const_invocation.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference_new/const_invocation.dart.direct.transformed.expect
@@ -2,8 +2,8 @@
import self as self;
import "dart:core" as core;
-typedef F<U extends core::Object, V extends core::Object> = (U) → V;
-class Foo<T extends core::Object> extends core::Object {
+typedef F<U extends core::Object = dynamic, V extends core::Object = dynamic> = (U) → V;
+class Foo<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
@@ -26,7 +26,7 @@
get v9() → core::Map<self::Foo::T, (self::Foo::T) → self::Foo::T>
return const <dynamic, dynamic>{};
}
-class Bar<T extends core::Object> extends core::Object {
+class Bar<T extends core::Object = dynamic> extends core::Object {
const constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/inference_new/const_invocation.dart.outline.expect b/pkg/front_end/testcases/inference_new/const_invocation.dart.outline.expect
index 393359f..96fab41 100644
--- a/pkg/front_end/testcases/inference_new/const_invocation.dart.outline.expect
+++ b/pkg/front_end/testcases/inference_new/const_invocation.dart.outline.expect
@@ -2,8 +2,8 @@
import self as self;
import "dart:core" as core;
-typedef F<U extends core::Object, V extends core::Object> = (U) → V;
-class Foo<T extends core::Object> extends core::Object {
+typedef F<U extends core::Object = dynamic, V extends core::Object = dynamic> = (U) → V;
+class Foo<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
;
get v1() → self::Bar<self::Foo::T>
@@ -25,7 +25,7 @@
get v9() → core::Map<self::Foo::T, (self::Foo::T) → self::Foo::T>
;
}
-class Bar<T extends core::Object> extends core::Object {
+class Bar<T extends core::Object = dynamic> extends core::Object {
const constructor •() → void
;
}
diff --git a/pkg/front_end/testcases/inference_new/const_invocation.dart.strong.expect b/pkg/front_end/testcases/inference_new/const_invocation.dart.strong.expect
index 6926e12..29c327c 100644
--- a/pkg/front_end/testcases/inference_new/const_invocation.dart.strong.expect
+++ b/pkg/front_end/testcases/inference_new/const_invocation.dart.strong.expect
@@ -2,8 +2,8 @@
import self as self;
import "dart:core" as core;
-typedef F<U extends core::Object, V extends core::Object> = (U) → V;
-class Foo<T extends core::Object> extends core::Object {
+typedef F<U extends core::Object = dynamic, V extends core::Object = dynamic> = (U) → V;
+class Foo<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
@@ -26,7 +26,7 @@
get v9() → core::Map<self::Foo::T, (self::Foo::T) → self::Foo::T>
return const <core::Null, (core::Object) → core::Null>{};
}
-class Bar<T extends core::Object> extends core::Object {
+class Bar<T extends core::Object = dynamic> extends core::Object {
const constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/inference_new/const_invocation.dart.strong.transformed.expect b/pkg/front_end/testcases/inference_new/const_invocation.dart.strong.transformed.expect
index 6926e12..29c327c 100644
--- a/pkg/front_end/testcases/inference_new/const_invocation.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference_new/const_invocation.dart.strong.transformed.expect
@@ -2,8 +2,8 @@
import self as self;
import "dart:core" as core;
-typedef F<U extends core::Object, V extends core::Object> = (U) → V;
-class Foo<T extends core::Object> extends core::Object {
+typedef F<U extends core::Object = dynamic, V extends core::Object = dynamic> = (U) → V;
+class Foo<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
@@ -26,7 +26,7 @@
get v9() → core::Map<self::Foo::T, (self::Foo::T) → self::Foo::T>
return const <core::Null, (core::Object) → core::Null>{};
}
-class Bar<T extends core::Object> extends core::Object {
+class Bar<T extends core::Object = dynamic> extends core::Object {
const constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/inference_new/dependency_only_if_generic_method.dart.direct.expect b/pkg/front_end/testcases/inference_new/dependency_only_if_generic_method.dart.direct.expect
index 2e54afa..8488c70 100644
--- a/pkg/front_end/testcases/inference_new/dependency_only_if_generic_method.dart.direct.expect
+++ b/pkg/front_end/testcases/inference_new/dependency_only_if_generic_method.dart.direct.expect
@@ -6,7 +6,7 @@
synthetic constructor •() → void
: super core::Object::•()
;
- method f<T extends core::Object>(self::A::f::T t) → self::A::f::T
+ method f<T extends core::Object = dynamic>(self::A::f::T t) → self::A::f::T
return t;
method g(dynamic i) → core::int
return 0;
diff --git a/pkg/front_end/testcases/inference_new/dependency_only_if_generic_method.dart.direct.transformed.expect b/pkg/front_end/testcases/inference_new/dependency_only_if_generic_method.dart.direct.transformed.expect
index 2e54afa..8488c70 100644
--- a/pkg/front_end/testcases/inference_new/dependency_only_if_generic_method.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference_new/dependency_only_if_generic_method.dart.direct.transformed.expect
@@ -6,7 +6,7 @@
synthetic constructor •() → void
: super core::Object::•()
;
- method f<T extends core::Object>(self::A::f::T t) → self::A::f::T
+ method f<T extends core::Object = dynamic>(self::A::f::T t) → self::A::f::T
return t;
method g(dynamic i) → core::int
return 0;
diff --git a/pkg/front_end/testcases/inference_new/dependency_only_if_generic_method.dart.outline.expect b/pkg/front_end/testcases/inference_new/dependency_only_if_generic_method.dart.outline.expect
index ad47727..072ea33 100644
--- a/pkg/front_end/testcases/inference_new/dependency_only_if_generic_method.dart.outline.expect
+++ b/pkg/front_end/testcases/inference_new/dependency_only_if_generic_method.dart.outline.expect
@@ -5,7 +5,7 @@
class A extends core::Object {
synthetic constructor •() → void
;
- method f<T extends core::Object>(self::A::f::T t) → self::A::f::T
+ method f<T extends core::Object = dynamic>(self::A::f::T t) → self::A::f::T
;
method g(dynamic i) → core::int
;
diff --git a/pkg/front_end/testcases/inference_new/dependency_only_if_generic_method.dart.strong.expect b/pkg/front_end/testcases/inference_new/dependency_only_if_generic_method.dart.strong.expect
index b23bd77..59ee258 100644
--- a/pkg/front_end/testcases/inference_new/dependency_only_if_generic_method.dart.strong.expect
+++ b/pkg/front_end/testcases/inference_new/dependency_only_if_generic_method.dart.strong.expect
@@ -6,7 +6,7 @@
synthetic constructor •() → void
: super core::Object::•()
;
- method f<T extends core::Object>(self::A::f::T t) → self::A::f::T
+ method f<T extends core::Object = dynamic>(self::A::f::T t) → self::A::f::T
return t;
method g(dynamic i) → core::int
return 0;
diff --git a/pkg/front_end/testcases/inference_new/dependency_only_if_generic_method.dart.strong.transformed.expect b/pkg/front_end/testcases/inference_new/dependency_only_if_generic_method.dart.strong.transformed.expect
index b23bd77..59ee258 100644
--- a/pkg/front_end/testcases/inference_new/dependency_only_if_generic_method.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference_new/dependency_only_if_generic_method.dart.strong.transformed.expect
@@ -6,7 +6,7 @@
synthetic constructor •() → void
: super core::Object::•()
;
- method f<T extends core::Object>(self::A::f::T t) → self::A::f::T
+ method f<T extends core::Object = dynamic>(self::A::f::T t) → self::A::f::T
return t;
method g(dynamic i) → core::int
return 0;
diff --git a/pkg/front_end/testcases/inference_new/do_loop.dart.direct.expect b/pkg/front_end/testcases/inference_new/do_loop.dart.direct.expect
index 8d9986c..edd314e 100644
--- a/pkg/front_end/testcases/inference_new/do_loop.dart.direct.expect
+++ b/pkg/front_end/testcases/inference_new/do_loop.dart.direct.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method test() → void {
do {
diff --git a/pkg/front_end/testcases/inference_new/do_loop.dart.direct.transformed.expect b/pkg/front_end/testcases/inference_new/do_loop.dart.direct.transformed.expect
index 8d9986c..edd314e 100644
--- a/pkg/front_end/testcases/inference_new/do_loop.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference_new/do_loop.dart.direct.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method test() → void {
do {
diff --git a/pkg/front_end/testcases/inference_new/do_loop.dart.outline.expect b/pkg/front_end/testcases/inference_new/do_loop.dart.outline.expect
index ac49c9e..e8c03c5 100644
--- a/pkg/front_end/testcases/inference_new/do_loop.dart.outline.expect
+++ b/pkg/front_end/testcases/inference_new/do_loop.dart.outline.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
;
static method test() → void
;
diff --git a/pkg/front_end/testcases/inference_new/do_loop.dart.strong.expect b/pkg/front_end/testcases/inference_new/do_loop.dart.strong.expect
index 9262769..5e323f3 100644
--- a/pkg/front_end/testcases/inference_new/do_loop.dart.strong.expect
+++ b/pkg/front_end/testcases/inference_new/do_loop.dart.strong.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method test() → void {
do {
diff --git a/pkg/front_end/testcases/inference_new/do_loop.dart.strong.transformed.expect b/pkg/front_end/testcases/inference_new/do_loop.dart.strong.transformed.expect
index 9262769..5e323f3 100644
--- a/pkg/front_end/testcases/inference_new/do_loop.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference_new/do_loop.dart.strong.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method test() → void {
do {
diff --git a/pkg/front_end/testcases/inference_new/downwards_inference_inside_top_level.dart.direct.expect b/pkg/front_end/testcases/inference_new/downwards_inference_inside_top_level.dart.direct.expect
index e86775a..06b6924 100644
--- a/pkg/front_end/testcases/inference_new/downwards_inference_inside_top_level.dart.direct.expect
+++ b/pkg/front_end/testcases/inference_new/downwards_inference_inside_top_level.dart.direct.expect
@@ -8,7 +8,7 @@
: super core::Object::•()
;
}
-class B<T extends core::Object> extends core::Object {
+class B<T extends core::Object = dynamic> extends core::Object {
constructor •(self::B::T x) → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/inference_new/downwards_inference_inside_top_level.dart.direct.transformed.expect b/pkg/front_end/testcases/inference_new/downwards_inference_inside_top_level.dart.direct.transformed.expect
index e86775a..06b6924 100644
--- a/pkg/front_end/testcases/inference_new/downwards_inference_inside_top_level.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference_new/downwards_inference_inside_top_level.dart.direct.transformed.expect
@@ -8,7 +8,7 @@
: super core::Object::•()
;
}
-class B<T extends core::Object> extends core::Object {
+class B<T extends core::Object = dynamic> extends core::Object {
constructor •(self::B::T x) → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/inference_new/downwards_inference_inside_top_level.dart.outline.expect b/pkg/front_end/testcases/inference_new/downwards_inference_inside_top_level.dart.outline.expect
index d0b810a..5f8f019 100644
--- a/pkg/front_end/testcases/inference_new/downwards_inference_inside_top_level.dart.outline.expect
+++ b/pkg/front_end/testcases/inference_new/downwards_inference_inside_top_level.dart.outline.expect
@@ -7,7 +7,7 @@
synthetic constructor •() → void
;
}
-class B<T extends core::Object> extends core::Object {
+class B<T extends core::Object = dynamic> extends core::Object {
constructor •(self::B::T x) → void
;
}
diff --git a/pkg/front_end/testcases/inference_new/downwards_inference_inside_top_level.dart.strong.expect b/pkg/front_end/testcases/inference_new/downwards_inference_inside_top_level.dart.strong.expect
index 019ae1b..c3f1d56 100644
--- a/pkg/front_end/testcases/inference_new/downwards_inference_inside_top_level.dart.strong.expect
+++ b/pkg/front_end/testcases/inference_new/downwards_inference_inside_top_level.dart.strong.expect
@@ -8,7 +8,7 @@
: super core::Object::•()
;
}
-class B<T extends core::Object> extends core::Object {
+class B<T extends core::Object = dynamic> extends core::Object {
constructor •(self::B::T x) → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/inference_new/downwards_inference_inside_top_level.dart.strong.transformed.expect b/pkg/front_end/testcases/inference_new/downwards_inference_inside_top_level.dart.strong.transformed.expect
index 019ae1b..c3f1d56 100644
--- a/pkg/front_end/testcases/inference_new/downwards_inference_inside_top_level.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference_new/downwards_inference_inside_top_level.dart.strong.transformed.expect
@@ -8,7 +8,7 @@
: super core::Object::•()
;
}
-class B<T extends core::Object> extends core::Object {
+class B<T extends core::Object = dynamic> extends core::Object {
constructor •(self::B::T x) → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/inference_new/downwards_inference_inside_top_level_2.dart.direct.expect b/pkg/front_end/testcases/inference_new/downwards_inference_inside_top_level_2.dart.direct.expect
index ca47657..de7183e 100644
--- a/pkg/front_end/testcases/inference_new/downwards_inference_inside_top_level_2.dart.direct.expect
+++ b/pkg/front_end/testcases/inference_new/downwards_inference_inside_top_level_2.dart.direct.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class A<T extends core::Object> extends core::Object {
+class A<T extends core::Object = dynamic> extends core::Object {
constructor •(self::A::T x) → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/inference_new/downwards_inference_inside_top_level_2.dart.direct.transformed.expect b/pkg/front_end/testcases/inference_new/downwards_inference_inside_top_level_2.dart.direct.transformed.expect
index ca47657..de7183e 100644
--- a/pkg/front_end/testcases/inference_new/downwards_inference_inside_top_level_2.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference_new/downwards_inference_inside_top_level_2.dart.direct.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class A<T extends core::Object> extends core::Object {
+class A<T extends core::Object = dynamic> extends core::Object {
constructor •(self::A::T x) → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/inference_new/downwards_inference_inside_top_level_2.dart.outline.expect b/pkg/front_end/testcases/inference_new/downwards_inference_inside_top_level_2.dart.outline.expect
index 3497efa..2a7abc7 100644
--- a/pkg/front_end/testcases/inference_new/downwards_inference_inside_top_level_2.dart.outline.expect
+++ b/pkg/front_end/testcases/inference_new/downwards_inference_inside_top_level_2.dart.outline.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class A<T extends core::Object> extends core::Object {
+class A<T extends core::Object = dynamic> extends core::Object {
constructor •(self::A::T x) → void
;
}
diff --git a/pkg/front_end/testcases/inference_new/downwards_inference_inside_top_level_2.dart.strong.expect b/pkg/front_end/testcases/inference_new/downwards_inference_inside_top_level_2.dart.strong.expect
index 115862f..5f2c35d 100644
--- a/pkg/front_end/testcases/inference_new/downwards_inference_inside_top_level_2.dart.strong.expect
+++ b/pkg/front_end/testcases/inference_new/downwards_inference_inside_top_level_2.dart.strong.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class A<T extends core::Object> extends core::Object {
+class A<T extends core::Object = dynamic> extends core::Object {
constructor •(self::A::T x) → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/inference_new/downwards_inference_inside_top_level_2.dart.strong.transformed.expect b/pkg/front_end/testcases/inference_new/downwards_inference_inside_top_level_2.dart.strong.transformed.expect
index 115862f..5f2c35d 100644
--- a/pkg/front_end/testcases/inference_new/downwards_inference_inside_top_level_2.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference_new/downwards_inference_inside_top_level_2.dart.strong.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class A<T extends core::Object> extends core::Object {
+class A<T extends core::Object = dynamic> extends core::Object {
constructor •(self::A::T x) → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/inference_new/for_each_identifier_downwards.dart.direct.expect b/pkg/front_end/testcases/inference_new/for_each_identifier_downwards.dart.direct.expect
index e612ea3..7b9d366 100644
--- a/pkg/front_end/testcases/inference_new/for_each_identifier_downwards.dart.direct.expect
+++ b/pkg/front_end/testcases/inference_new/for_each_identifier_downwards.dart.direct.expect
@@ -33,7 +33,7 @@
}
}
static field self::A aTopLevel;
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static set aTopLevelSetter(self::A value) → void {}
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference_new/for_each_identifier_downwards.dart.direct.transformed.expect b/pkg/front_end/testcases/inference_new/for_each_identifier_downwards.dart.direct.transformed.expect
index e612ea3..7b9d366 100644
--- a/pkg/front_end/testcases/inference_new/for_each_identifier_downwards.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference_new/for_each_identifier_downwards.dart.direct.transformed.expect
@@ -33,7 +33,7 @@
}
}
static field self::A aTopLevel;
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static set aTopLevelSetter(self::A value) → void {}
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference_new/for_each_identifier_downwards.dart.outline.expect b/pkg/front_end/testcases/inference_new/for_each_identifier_downwards.dart.outline.expect
index 6bd42ce..19aaf1e 100644
--- a/pkg/front_end/testcases/inference_new/for_each_identifier_downwards.dart.outline.expect
+++ b/pkg/front_end/testcases/inference_new/for_each_identifier_downwards.dart.outline.expect
@@ -16,7 +16,7 @@
;
}
static field self::A aTopLevel;
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
;
static set aTopLevelSetter(self::A value) → void
;
diff --git a/pkg/front_end/testcases/inference_new/for_each_identifier_downwards.dart.strong.expect b/pkg/front_end/testcases/inference_new/for_each_identifier_downwards.dart.strong.expect
index c5b3997..89f7813 100644
--- a/pkg/front_end/testcases/inference_new/for_each_identifier_downwards.dart.strong.expect
+++ b/pkg/front_end/testcases/inference_new/for_each_identifier_downwards.dart.strong.expect
@@ -33,7 +33,7 @@
}
}
static field self::A aTopLevel;
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static set aTopLevelSetter(self::A value) → void {}
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference_new/for_each_identifier_downwards.dart.strong.transformed.expect b/pkg/front_end/testcases/inference_new/for_each_identifier_downwards.dart.strong.transformed.expect
index c5b3997..89f7813 100644
--- a/pkg/front_end/testcases/inference_new/for_each_identifier_downwards.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference_new/for_each_identifier_downwards.dart.strong.transformed.expect
@@ -33,7 +33,7 @@
}
}
static field self::A aTopLevel;
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static set aTopLevelSetter(self::A value) → void {}
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference_new/for_each_outer_var_type.dart.direct.expect b/pkg/front_end/testcases/inference_new/for_each_outer_var_type.dart.direct.expect
index f8bb637..8f2e22d 100644
--- a/pkg/front_end/testcases/inference_new/for_each_outer_var_type.dart.direct.expect
+++ b/pkg/front_end/testcases/inference_new/for_each_outer_var_type.dart.direct.expect
@@ -13,7 +13,7 @@
: super self::A::•()
;
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method test() → dynamic async {
core::Iterable<self::A> iterable;
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 df5d861..c6044b0 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
@@ -13,7 +13,7 @@
: super self::A::•()
;
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method test() → dynamic /* originally async */ {
final asy::Completer<dynamic> :completer = asy::Completer::sync<dynamic>();
diff --git a/pkg/front_end/testcases/inference_new/for_each_outer_var_type.dart.outline.expect b/pkg/front_end/testcases/inference_new/for_each_outer_var_type.dart.outline.expect
index 006a0f5..acae199 100644
--- a/pkg/front_end/testcases/inference_new/for_each_outer_var_type.dart.outline.expect
+++ b/pkg/front_end/testcases/inference_new/for_each_outer_var_type.dart.outline.expect
@@ -10,7 +10,7 @@
synthetic constructor •() → void
;
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
;
static method test() → dynamic
;
diff --git a/pkg/front_end/testcases/inference_new/for_each_outer_var_type.dart.strong.expect b/pkg/front_end/testcases/inference_new/for_each_outer_var_type.dart.strong.expect
index 60f704bb..5800a96 100644
--- a/pkg/front_end/testcases/inference_new/for_each_outer_var_type.dart.strong.expect
+++ b/pkg/front_end/testcases/inference_new/for_each_outer_var_type.dart.strong.expect
@@ -13,7 +13,7 @@
: super self::A::•()
;
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method test() → dynamic async {
core::Iterable<self::A> iterable;
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 cd0a0a7..e8c97af 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
@@ -13,7 +13,7 @@
: super self::A::•()
;
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method test() → dynamic /* originally async */ {
final asy::Completer<dynamic> :completer = asy::Completer::sync<dynamic>();
diff --git a/pkg/front_end/testcases/inference_new/indexed_assign_combiner.dart.direct.expect b/pkg/front_end/testcases/inference_new/indexed_assign_combiner.dart.direct.expect
index 53d59d1..6748909 100644
--- a/pkg/front_end/testcases/inference_new/indexed_assign_combiner.dart.direct.expect
+++ b/pkg/front_end/testcases/inference_new/indexed_assign_combiner.dart.direct.expect
@@ -48,7 +48,7 @@
return null;
operator []=(core::int i, self::B value) → void {}
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method test1(self::G g) → void {
let final dynamic #t1 = g in let final dynamic #t2 = 0 in #t1.[]=(#t2, #t1.[](#t2).*(self::f<dynamic>()));
diff --git a/pkg/front_end/testcases/inference_new/indexed_assign_combiner.dart.direct.transformed.expect b/pkg/front_end/testcases/inference_new/indexed_assign_combiner.dart.direct.transformed.expect
index 53d59d1..6748909 100644
--- a/pkg/front_end/testcases/inference_new/indexed_assign_combiner.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference_new/indexed_assign_combiner.dart.direct.transformed.expect
@@ -48,7 +48,7 @@
return null;
operator []=(core::int i, self::B value) → void {}
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method test1(self::G g) → void {
let final dynamic #t1 = g in let final dynamic #t2 = 0 in #t1.[]=(#t2, #t1.[](#t2).*(self::f<dynamic>()));
diff --git a/pkg/front_end/testcases/inference_new/indexed_assign_combiner.dart.outline.expect b/pkg/front_end/testcases/inference_new/indexed_assign_combiner.dart.outline.expect
index 1116704..f45b9cb 100644
--- a/pkg/front_end/testcases/inference_new/indexed_assign_combiner.dart.outline.expect
+++ b/pkg/front_end/testcases/inference_new/indexed_assign_combiner.dart.outline.expect
@@ -42,7 +42,7 @@
operator []=(core::int i, self::B value) → void
;
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
;
static method test1(self::G g) → void
;
diff --git a/pkg/front_end/testcases/inference_new/indexed_assign_combiner.dart.strong.expect b/pkg/front_end/testcases/inference_new/indexed_assign_combiner.dart.strong.expect
index 9a5b546..93d3e6a 100644
--- a/pkg/front_end/testcases/inference_new/indexed_assign_combiner.dart.strong.expect
+++ b/pkg/front_end/testcases/inference_new/indexed_assign_combiner.dart.strong.expect
@@ -48,7 +48,7 @@
return null;
operator []=(core::int i, self::B value) → void {}
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method test1(self::G g) → void {
let final self::G #t1 = g in let final core::int #t2 = 0 in #t1.{self::G::[]=}(#t2, #t1.{self::G::[]}(#t2).{self::A::*}(self::f<dynamic>() as{TypeError} self::D));
diff --git a/pkg/front_end/testcases/inference_new/indexed_assign_combiner.dart.strong.transformed.expect b/pkg/front_end/testcases/inference_new/indexed_assign_combiner.dart.strong.transformed.expect
index 9a5b546..93d3e6a 100644
--- a/pkg/front_end/testcases/inference_new/indexed_assign_combiner.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference_new/indexed_assign_combiner.dart.strong.transformed.expect
@@ -48,7 +48,7 @@
return null;
operator []=(core::int i, self::B value) → void {}
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method test1(self::G g) → void {
let final self::G #t1 = g in let final core::int #t2 = 0 in #t1.{self::G::[]=}(#t2, #t1.{self::G::[]}(#t2).{self::A::*}(self::f<dynamic>() as{TypeError} self::D));
diff --git a/pkg/front_end/testcases/inference_new/infer_assign_to_implicit_this.dart.direct.expect b/pkg/front_end/testcases/inference_new/infer_assign_to_implicit_this.dart.direct.expect
index 233af9d..a47f9b9 100644
--- a/pkg/front_end/testcases/inference_new/infer_assign_to_implicit_this.dart.direct.expect
+++ b/pkg/front_end/testcases/inference_new/infer_assign_to_implicit_this.dart.direct.expect
@@ -47,6 +47,6 @@
dynamic v7 = let final dynamic #t2 = this.{self::Test::member} in let final dynamic #t3 = this.{self::Test::member} = #t2.-(1) in #t2;
}
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference_new/infer_assign_to_implicit_this.dart.direct.transformed.expect b/pkg/front_end/testcases/inference_new/infer_assign_to_implicit_this.dart.direct.transformed.expect
index 233af9d..a47f9b9 100644
--- a/pkg/front_end/testcases/inference_new/infer_assign_to_implicit_this.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference_new/infer_assign_to_implicit_this.dart.direct.transformed.expect
@@ -47,6 +47,6 @@
dynamic v7 = let final dynamic #t2 = this.{self::Test::member} in let final dynamic #t3 = this.{self::Test::member} = #t2.-(1) in #t2;
}
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference_new/infer_assign_to_implicit_this.dart.outline.expect b/pkg/front_end/testcases/inference_new/infer_assign_to_implicit_this.dart.outline.expect
index 031084f..ca2db03 100644
--- a/pkg/front_end/testcases/inference_new/infer_assign_to_implicit_this.dart.outline.expect
+++ b/pkg/front_end/testcases/inference_new/infer_assign_to_implicit_this.dart.outline.expect
@@ -29,7 +29,7 @@
method test() → void
;
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
;
static method main() → dynamic
;
diff --git a/pkg/front_end/testcases/inference_new/infer_assign_to_implicit_this.dart.strong.expect b/pkg/front_end/testcases/inference_new/infer_assign_to_implicit_this.dart.strong.expect
index 128a53e..8338d42 100644
--- a/pkg/front_end/testcases/inference_new/infer_assign_to_implicit_this.dart.strong.expect
+++ b/pkg/front_end/testcases/inference_new/infer_assign_to_implicit_this.dart.strong.expect
@@ -47,6 +47,6 @@
self::B v7 = let final self::B #t2 = this.{self::Test::member} in let final self::B #t3 = this.{self::Test::member} = #t2.{self::B::-}(1) in #t2;
}
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference_new/infer_assign_to_implicit_this.dart.strong.transformed.expect b/pkg/front_end/testcases/inference_new/infer_assign_to_implicit_this.dart.strong.transformed.expect
index 128a53e..8338d42 100644
--- a/pkg/front_end/testcases/inference_new/infer_assign_to_implicit_this.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference_new/infer_assign_to_implicit_this.dart.strong.transformed.expect
@@ -47,6 +47,6 @@
self::B v7 = let final self::B #t2 = this.{self::Test::member} in let final self::B #t3 = this.{self::Test::member} = #t2.{self::B::-}(1) in #t2;
}
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference_new/infer_assign_to_index_full.dart.direct.expect b/pkg/front_end/testcases/inference_new/infer_assign_to_index_full.dart.direct.expect
index c460798..6fd428b 100644
--- a/pkg/front_end/testcases/inference_new/infer_assign_to_index_full.dart.direct.expect
+++ b/pkg/front_end/testcases/inference_new/infer_assign_to_index_full.dart.direct.expect
@@ -55,6 +55,6 @@
dynamic v7 = let final dynamic #t42 = t in let final dynamic #t43 = self::f<dynamic>() in let final dynamic #t44 = #t42.[](#t43) in let final dynamic #t45 = #t42.[]=(#t43, #t44.-(1)) in #t44;
}
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference_new/infer_assign_to_index_full.dart.direct.transformed.expect b/pkg/front_end/testcases/inference_new/infer_assign_to_index_full.dart.direct.transformed.expect
index c460798..6fd428b 100644
--- a/pkg/front_end/testcases/inference_new/infer_assign_to_index_full.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference_new/infer_assign_to_index_full.dart.direct.transformed.expect
@@ -55,6 +55,6 @@
dynamic v7 = let final dynamic #t42 = t in let final dynamic #t43 = self::f<dynamic>() in let final dynamic #t44 = #t42.[](#t43) in let final dynamic #t45 = #t42.[]=(#t43, #t44.-(1)) in #t44;
}
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference_new/infer_assign_to_index_full.dart.outline.expect b/pkg/front_end/testcases/inference_new/infer_assign_to_index_full.dart.outline.expect
index ff1db0b..8286554 100644
--- a/pkg/front_end/testcases/inference_new/infer_assign_to_index_full.dart.outline.expect
+++ b/pkg/front_end/testcases/inference_new/infer_assign_to_index_full.dart.outline.expect
@@ -36,7 +36,7 @@
method test() → void
;
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
;
static method main() → dynamic
;
diff --git a/pkg/front_end/testcases/inference_new/infer_assign_to_index_full.dart.strong.expect b/pkg/front_end/testcases/inference_new/infer_assign_to_index_full.dart.strong.expect
index 211cbb9..1bc265f 100644
--- a/pkg/front_end/testcases/inference_new/infer_assign_to_index_full.dart.strong.expect
+++ b/pkg/front_end/testcases/inference_new/infer_assign_to_index_full.dart.strong.expect
@@ -55,6 +55,6 @@
self::B v7 = let final self::Test #t42 = t in let final dynamic #t43 = self::f<dynamic>() in let final self::B #t44 = #t42.{self::Test::[]}(#t43 as{TypeError} self::Index) in let final void #t45 = #t42.{self::Test::[]=}(#t43 as{TypeError} self::Index, #t44.{self::B::-}(1)) in #t44;
}
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference_new/infer_assign_to_index_full.dart.strong.transformed.expect b/pkg/front_end/testcases/inference_new/infer_assign_to_index_full.dart.strong.transformed.expect
index 211cbb9..1bc265f 100644
--- a/pkg/front_end/testcases/inference_new/infer_assign_to_index_full.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference_new/infer_assign_to_index_full.dart.strong.transformed.expect
@@ -55,6 +55,6 @@
self::B v7 = let final self::Test #t42 = t in let final dynamic #t43 = self::f<dynamic>() in let final self::B #t44 = #t42.{self::Test::[]}(#t43 as{TypeError} self::Index) in let final void #t45 = #t42.{self::Test::[]=}(#t43 as{TypeError} self::Index, #t44.{self::B::-}(1)) in #t44;
}
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference_new/infer_assign_to_index_set_vs_get.dart.direct.expect b/pkg/front_end/testcases/inference_new/infer_assign_to_index_set_vs_get.dart.direct.expect
index 515c5dd..5b671bb 100644
--- a/pkg/front_end/testcases/inference_new/infer_assign_to_index_set_vs_get.dart.direct.expect
+++ b/pkg/front_end/testcases/inference_new/infer_assign_to_index_set_vs_get.dart.direct.expect
@@ -66,6 +66,6 @@
dynamic v5 = let final dynamic #t30 = t in let final dynamic #t31 = self::f<dynamic>() in let final dynamic #t32 = #t30.[](#t31) in let final dynamic #t33 = #t30.[]=(#t31, #t32.-(1)) in #t32;
}
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference_new/infer_assign_to_index_set_vs_get.dart.direct.transformed.expect b/pkg/front_end/testcases/inference_new/infer_assign_to_index_set_vs_get.dart.direct.transformed.expect
index 515c5dd..5b671bb 100644
--- a/pkg/front_end/testcases/inference_new/infer_assign_to_index_set_vs_get.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference_new/infer_assign_to_index_set_vs_get.dart.direct.transformed.expect
@@ -66,6 +66,6 @@
dynamic v5 = let final dynamic #t30 = t in let final dynamic #t31 = self::f<dynamic>() in let final dynamic #t32 = #t30.[](#t31) in let final dynamic #t33 = #t30.[]=(#t31, #t32.-(1)) in #t32;
}
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference_new/infer_assign_to_index_set_vs_get.dart.outline.expect b/pkg/front_end/testcases/inference_new/infer_assign_to_index_set_vs_get.dart.outline.expect
index 0b77cdc..0a5efaa 100644
--- a/pkg/front_end/testcases/inference_new/infer_assign_to_index_set_vs_get.dart.outline.expect
+++ b/pkg/front_end/testcases/inference_new/infer_assign_to_index_set_vs_get.dart.outline.expect
@@ -48,7 +48,7 @@
method test() → void
;
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
;
static method main() → dynamic
;
diff --git a/pkg/front_end/testcases/inference_new/infer_assign_to_index_set_vs_get.dart.strong.expect b/pkg/front_end/testcases/inference_new/infer_assign_to_index_set_vs_get.dart.strong.expect
index 8c2dd0c..874ad18 100644
--- a/pkg/front_end/testcases/inference_new/infer_assign_to_index_set_vs_get.dart.strong.expect
+++ b/pkg/front_end/testcases/inference_new/infer_assign_to_index_set_vs_get.dart.strong.expect
@@ -66,6 +66,6 @@
self::B v5 = let final self::Test #t30 = t in let final dynamic #t31 = self::f<dynamic>() in let final self::B #t32 = #t30.{self::Test::[]}(#t31 as{TypeError} self::Index) in let final void #t33 = #t30.{self::Test::[]=}(#t31 as{TypeError} self::Index, #t32.{self::B::-}(1)) in #t32;
}
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference_new/infer_assign_to_index_set_vs_get.dart.strong.transformed.expect b/pkg/front_end/testcases/inference_new/infer_assign_to_index_set_vs_get.dart.strong.transformed.expect
index 8c2dd0c..874ad18 100644
--- a/pkg/front_end/testcases/inference_new/infer_assign_to_index_set_vs_get.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference_new/infer_assign_to_index_set_vs_get.dart.strong.transformed.expect
@@ -66,6 +66,6 @@
self::B v5 = let final self::Test #t30 = t in let final dynamic #t31 = self::f<dynamic>() in let final self::B #t32 = #t30.{self::Test::[]}(#t31 as{TypeError} self::Index) in let final void #t33 = #t30.{self::Test::[]=}(#t31 as{TypeError} self::Index, #t32.{self::B::-}(1)) in #t32;
}
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference_new/infer_assign_to_index_super.dart.direct.expect b/pkg/front_end/testcases/inference_new/infer_assign_to_index_super.dart.direct.expect
index 02ff3dc..d613228 100644
--- a/pkg/front_end/testcases/inference_new/infer_assign_to_index_super.dart.direct.expect
+++ b/pkg/front_end/testcases/inference_new/infer_assign_to_index_super.dart.direct.expect
@@ -59,6 +59,6 @@
dynamic v7 = let final dynamic #t30 = self::f<dynamic>() in let final dynamic #t31 = super.{self::Base::[]}(#t30) in let final dynamic #t32 = super.{self::Base::[]=}(#t30, #t31.-(1)) in #t31;
}
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference_new/infer_assign_to_index_super.dart.direct.transformed.expect b/pkg/front_end/testcases/inference_new/infer_assign_to_index_super.dart.direct.transformed.expect
index 02ff3dc..d613228 100644
--- a/pkg/front_end/testcases/inference_new/infer_assign_to_index_super.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference_new/infer_assign_to_index_super.dart.direct.transformed.expect
@@ -59,6 +59,6 @@
dynamic v7 = let final dynamic #t30 = self::f<dynamic>() in let final dynamic #t31 = super.{self::Base::[]}(#t30) in let final dynamic #t32 = super.{self::Base::[]=}(#t30, #t31.-(1)) in #t31;
}
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference_new/infer_assign_to_index_super.dart.outline.expect b/pkg/front_end/testcases/inference_new/infer_assign_to_index_super.dart.outline.expect
index 421df3f..1d2a695 100644
--- a/pkg/front_end/testcases/inference_new/infer_assign_to_index_super.dart.outline.expect
+++ b/pkg/front_end/testcases/inference_new/infer_assign_to_index_super.dart.outline.expect
@@ -40,7 +40,7 @@
method test() → void
;
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
;
static method main() → dynamic
;
diff --git a/pkg/front_end/testcases/inference_new/infer_assign_to_index_super.dart.strong.expect b/pkg/front_end/testcases/inference_new/infer_assign_to_index_super.dart.strong.expect
index ac4968c..d77ddb9 100644
--- a/pkg/front_end/testcases/inference_new/infer_assign_to_index_super.dart.strong.expect
+++ b/pkg/front_end/testcases/inference_new/infer_assign_to_index_super.dart.strong.expect
@@ -59,6 +59,6 @@
self::B v7 = let final dynamic #t30 = self::f<dynamic>() in let final self::B #t31 = super.{self::Base::[]}(#t30 as{TypeError} self::Index) in let final void #t32 = super.{self::Base::[]=}(#t30 as{TypeError} self::Index, #t31.{self::B::-}(1)) in #t31;
}
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference_new/infer_assign_to_index_super.dart.strong.transformed.expect b/pkg/front_end/testcases/inference_new/infer_assign_to_index_super.dart.strong.transformed.expect
index ac4968c..d77ddb9 100644
--- a/pkg/front_end/testcases/inference_new/infer_assign_to_index_super.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference_new/infer_assign_to_index_super.dart.strong.transformed.expect
@@ -59,6 +59,6 @@
self::B v7 = let final dynamic #t30 = self::f<dynamic>() in let final self::B #t31 = super.{self::Base::[]}(#t30 as{TypeError} self::Index) in let final void #t32 = super.{self::Base::[]=}(#t30 as{TypeError} self::Index, #t31.{self::B::-}(1)) in #t31;
}
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference_new/infer_assign_to_index_super_upwards.dart.direct.expect b/pkg/front_end/testcases/inference_new/infer_assign_to_index_super_upwards.dart.direct.expect
index 7ad93e72..1610dd9 100644
--- a/pkg/front_end/testcases/inference_new/infer_assign_to_index_super_upwards.dart.direct.expect
+++ b/pkg/front_end/testcases/inference_new/infer_assign_to_index_super_upwards.dart.direct.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-abstract class Base<T extends core::Object, U extends core::Object> extends core::Object {
+abstract class Base<T extends core::Object = dynamic, U extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/inference_new/infer_assign_to_index_super_upwards.dart.direct.transformed.expect b/pkg/front_end/testcases/inference_new/infer_assign_to_index_super_upwards.dart.direct.transformed.expect
index 7ad93e72..1610dd9 100644
--- a/pkg/front_end/testcases/inference_new/infer_assign_to_index_super_upwards.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference_new/infer_assign_to_index_super_upwards.dart.direct.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-abstract class Base<T extends core::Object, U extends core::Object> extends core::Object {
+abstract class Base<T extends core::Object = dynamic, U extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/inference_new/infer_assign_to_index_super_upwards.dart.outline.expect b/pkg/front_end/testcases/inference_new/infer_assign_to_index_super_upwards.dart.outline.expect
index e678ac3..24d45db 100644
--- a/pkg/front_end/testcases/inference_new/infer_assign_to_index_super_upwards.dart.outline.expect
+++ b/pkg/front_end/testcases/inference_new/infer_assign_to_index_super_upwards.dart.outline.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-abstract class Base<T extends core::Object, U extends core::Object> extends core::Object {
+abstract class Base<T extends core::Object = dynamic, U extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
;
operator [](core::String s) → self::Base::T
diff --git a/pkg/front_end/testcases/inference_new/infer_assign_to_index_super_upwards.dart.strong.expect b/pkg/front_end/testcases/inference_new/infer_assign_to_index_super_upwards.dart.strong.expect
index 7d69433..a9953b5 100644
--- a/pkg/front_end/testcases/inference_new/infer_assign_to_index_super_upwards.dart.strong.expect
+++ b/pkg/front_end/testcases/inference_new/infer_assign_to_index_super_upwards.dart.strong.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-abstract class Base<T extends core::Object, U extends core::Object> extends core::Object {
+abstract class Base<T extends core::Object = dynamic, U extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/inference_new/infer_assign_to_index_this.dart.direct.expect b/pkg/front_end/testcases/inference_new/infer_assign_to_index_this.dart.direct.expect
index 2c0f5d8..f031580 100644
--- a/pkg/front_end/testcases/inference_new/infer_assign_to_index_this.dart.direct.expect
+++ b/pkg/front_end/testcases/inference_new/infer_assign_to_index_this.dart.direct.expect
@@ -54,6 +54,6 @@
dynamic v7 = let final dynamic #t30 = self::f<dynamic>() in let final dynamic #t31 = this.[](#t30) in let final dynamic #t32 = this.[]=(#t30, #t31.-(1)) in #t31;
}
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference_new/infer_assign_to_index_this.dart.direct.transformed.expect b/pkg/front_end/testcases/inference_new/infer_assign_to_index_this.dart.direct.transformed.expect
index 2c0f5d8..f031580 100644
--- a/pkg/front_end/testcases/inference_new/infer_assign_to_index_this.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference_new/infer_assign_to_index_this.dart.direct.transformed.expect
@@ -54,6 +54,6 @@
dynamic v7 = let final dynamic #t30 = self::f<dynamic>() in let final dynamic #t31 = this.[](#t30) in let final dynamic #t32 = this.[]=(#t30, #t31.-(1)) in #t31;
}
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference_new/infer_assign_to_index_this.dart.outline.expect b/pkg/front_end/testcases/inference_new/infer_assign_to_index_this.dart.outline.expect
index ff1db0b..8286554 100644
--- a/pkg/front_end/testcases/inference_new/infer_assign_to_index_this.dart.outline.expect
+++ b/pkg/front_end/testcases/inference_new/infer_assign_to_index_this.dart.outline.expect
@@ -36,7 +36,7 @@
method test() → void
;
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
;
static method main() → dynamic
;
diff --git a/pkg/front_end/testcases/inference_new/infer_assign_to_index_this.dart.strong.expect b/pkg/front_end/testcases/inference_new/infer_assign_to_index_this.dart.strong.expect
index 754dfc6..494fe12 100644
--- a/pkg/front_end/testcases/inference_new/infer_assign_to_index_this.dart.strong.expect
+++ b/pkg/front_end/testcases/inference_new/infer_assign_to_index_this.dart.strong.expect
@@ -54,6 +54,6 @@
self::B v7 = let final dynamic #t30 = self::f<dynamic>() in let final self::B #t31 = this.{self::Test::[]}(#t30 as{TypeError} self::Index) in let final void #t32 = this.{self::Test::[]=}(#t30 as{TypeError} self::Index, #t31.{self::B::-}(1)) in #t31;
}
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference_new/infer_assign_to_index_this.dart.strong.transformed.expect b/pkg/front_end/testcases/inference_new/infer_assign_to_index_this.dart.strong.transformed.expect
index 754dfc6..494fe12 100644
--- a/pkg/front_end/testcases/inference_new/infer_assign_to_index_this.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference_new/infer_assign_to_index_this.dart.strong.transformed.expect
@@ -54,6 +54,6 @@
self::B v7 = let final dynamic #t30 = self::f<dynamic>() in let final self::B #t31 = this.{self::Test::[]}(#t30 as{TypeError} self::Index) in let final void #t32 = this.{self::Test::[]=}(#t30 as{TypeError} self::Index, #t31.{self::B::-}(1)) in #t31;
}
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference_new/infer_assign_to_index_upwards.dart.direct.expect b/pkg/front_end/testcases/inference_new/infer_assign_to_index_upwards.dart.direct.expect
index 7455ebf..552f176 100644
--- a/pkg/front_end/testcases/inference_new/infer_assign_to_index_upwards.dart.direct.expect
+++ b/pkg/front_end/testcases/inference_new/infer_assign_to_index_upwards.dart.direct.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-abstract class Test<T extends core::Object, U extends core::Object> extends core::Object {
+abstract class Test<T extends core::Object = dynamic, U extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/inference_new/infer_assign_to_index_upwards.dart.direct.transformed.expect b/pkg/front_end/testcases/inference_new/infer_assign_to_index_upwards.dart.direct.transformed.expect
index 7455ebf..552f176 100644
--- a/pkg/front_end/testcases/inference_new/infer_assign_to_index_upwards.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference_new/infer_assign_to_index_upwards.dart.direct.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-abstract class Test<T extends core::Object, U extends core::Object> extends core::Object {
+abstract class Test<T extends core::Object = dynamic, U extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/inference_new/infer_assign_to_index_upwards.dart.outline.expect b/pkg/front_end/testcases/inference_new/infer_assign_to_index_upwards.dart.outline.expect
index 68b8c6d..49a438a 100644
--- a/pkg/front_end/testcases/inference_new/infer_assign_to_index_upwards.dart.outline.expect
+++ b/pkg/front_end/testcases/inference_new/infer_assign_to_index_upwards.dart.outline.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-abstract class Test<T extends core::Object, U extends core::Object> extends core::Object {
+abstract class Test<T extends core::Object = dynamic, U extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
;
abstract operator [](core::String s) → self::Test::T;
diff --git a/pkg/front_end/testcases/inference_new/infer_assign_to_index_upwards.dart.strong.expect b/pkg/front_end/testcases/inference_new/infer_assign_to_index_upwards.dart.strong.expect
index 8a8c568..6b1a389 100644
--- a/pkg/front_end/testcases/inference_new/infer_assign_to_index_upwards.dart.strong.expect
+++ b/pkg/front_end/testcases/inference_new/infer_assign_to_index_upwards.dart.strong.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-abstract class Test<T extends core::Object, U extends core::Object> extends core::Object {
+abstract class Test<T extends core::Object = dynamic, U extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/inference_new/infer_assign_to_local.dart.direct.expect b/pkg/front_end/testcases/inference_new/infer_assign_to_local.dart.direct.expect
index eec4890..c564570 100644
--- a/pkg/front_end/testcases/inference_new/infer_assign_to_local.dart.direct.expect
+++ b/pkg/front_end/testcases/inference_new/infer_assign_to_local.dart.direct.expect
@@ -25,7 +25,7 @@
: super self::B::•()
;
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method test() → void {
self::B local;
diff --git a/pkg/front_end/testcases/inference_new/infer_assign_to_local.dart.direct.transformed.expect b/pkg/front_end/testcases/inference_new/infer_assign_to_local.dart.direct.transformed.expect
index eec4890..c564570 100644
--- a/pkg/front_end/testcases/inference_new/infer_assign_to_local.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference_new/infer_assign_to_local.dart.direct.transformed.expect
@@ -25,7 +25,7 @@
: super self::B::•()
;
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method test() → void {
self::B local;
diff --git a/pkg/front_end/testcases/inference_new/infer_assign_to_local.dart.outline.expect b/pkg/front_end/testcases/inference_new/infer_assign_to_local.dart.outline.expect
index e4b381c..7db001d 100644
--- a/pkg/front_end/testcases/inference_new/infer_assign_to_local.dart.outline.expect
+++ b/pkg/front_end/testcases/inference_new/infer_assign_to_local.dart.outline.expect
@@ -22,7 +22,7 @@
synthetic constructor •() → void
;
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
;
static method test() → void
;
diff --git a/pkg/front_end/testcases/inference_new/infer_assign_to_local.dart.strong.expect b/pkg/front_end/testcases/inference_new/infer_assign_to_local.dart.strong.expect
index 1758b80..a6a2ebc 100644
--- a/pkg/front_end/testcases/inference_new/infer_assign_to_local.dart.strong.expect
+++ b/pkg/front_end/testcases/inference_new/infer_assign_to_local.dart.strong.expect
@@ -25,7 +25,7 @@
: super self::B::•()
;
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method test() → void {
self::B local;
diff --git a/pkg/front_end/testcases/inference_new/infer_assign_to_local.dart.strong.transformed.expect b/pkg/front_end/testcases/inference_new/infer_assign_to_local.dart.strong.transformed.expect
index 1758b80..a6a2ebc 100644
--- a/pkg/front_end/testcases/inference_new/infer_assign_to_local.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference_new/infer_assign_to_local.dart.strong.transformed.expect
@@ -25,7 +25,7 @@
: super self::B::•()
;
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method test() → void {
self::B local;
diff --git a/pkg/front_end/testcases/inference_new/infer_assign_to_property_full.dart.direct.expect b/pkg/front_end/testcases/inference_new/infer_assign_to_property_full.dart.direct.expect
index cf78a86..a15f403 100644
--- a/pkg/front_end/testcases/inference_new/infer_assign_to_property_full.dart.direct.expect
+++ b/pkg/front_end/testcases/inference_new/infer_assign_to_property_full.dart.direct.expect
@@ -47,6 +47,6 @@
dynamic v7 = let final dynamic #t13 = t in let final dynamic #t14 = #t13.member in let final dynamic #t15 = #t13.member = #t14.-(1) in #t14;
}
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference_new/infer_assign_to_property_full.dart.direct.transformed.expect b/pkg/front_end/testcases/inference_new/infer_assign_to_property_full.dart.direct.transformed.expect
index cf78a86..a15f403 100644
--- a/pkg/front_end/testcases/inference_new/infer_assign_to_property_full.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference_new/infer_assign_to_property_full.dart.direct.transformed.expect
@@ -47,6 +47,6 @@
dynamic v7 = let final dynamic #t13 = t in let final dynamic #t14 = #t13.member in let final dynamic #t15 = #t13.member = #t14.-(1) in #t14;
}
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference_new/infer_assign_to_property_full.dart.outline.expect b/pkg/front_end/testcases/inference_new/infer_assign_to_property_full.dart.outline.expect
index de60c09..c483408 100644
--- a/pkg/front_end/testcases/inference_new/infer_assign_to_property_full.dart.outline.expect
+++ b/pkg/front_end/testcases/inference_new/infer_assign_to_property_full.dart.outline.expect
@@ -29,7 +29,7 @@
static method test(self::Test t) → void
;
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
;
static method main() → dynamic
;
diff --git a/pkg/front_end/testcases/inference_new/infer_assign_to_property_full.dart.strong.expect b/pkg/front_end/testcases/inference_new/infer_assign_to_property_full.dart.strong.expect
index 0009111..a310675 100644
--- a/pkg/front_end/testcases/inference_new/infer_assign_to_property_full.dart.strong.expect
+++ b/pkg/front_end/testcases/inference_new/infer_assign_to_property_full.dart.strong.expect
@@ -47,6 +47,6 @@
self::B v7 = let final self::Test #t13 = t in let final self::B #t14 = #t13.{self::Test::member} in let final self::B #t15 = #t13.{self::Test::member} = #t14.{self::B::-}(1) in #t14;
}
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference_new/infer_assign_to_property_full.dart.strong.transformed.expect b/pkg/front_end/testcases/inference_new/infer_assign_to_property_full.dart.strong.transformed.expect
index 0009111..a310675 100644
--- a/pkg/front_end/testcases/inference_new/infer_assign_to_property_full.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference_new/infer_assign_to_property_full.dart.strong.transformed.expect
@@ -47,6 +47,6 @@
self::B v7 = let final self::Test #t13 = t in let final self::B #t14 = #t13.{self::Test::member} in let final self::B #t15 = #t13.{self::Test::member} = #t14.{self::B::-}(1) in #t14;
}
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference_new/infer_assign_to_property_null_aware.dart.direct.expect b/pkg/front_end/testcases/inference_new/infer_assign_to_property_null_aware.dart.direct.expect
index 9e6a640..d006bf2 100644
--- a/pkg/front_end/testcases/inference_new/infer_assign_to_property_null_aware.dart.direct.expect
+++ b/pkg/front_end/testcases/inference_new/infer_assign_to_property_null_aware.dart.direct.expect
@@ -47,6 +47,6 @@
dynamic v7 = let final dynamic #t15 = t in #t15.==(null) ? null : let final dynamic #t16 = #t15.member in let final dynamic #t17 = #t15.member = #t16.-(1) in #t16;
}
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference_new/infer_assign_to_property_null_aware.dart.direct.transformed.expect b/pkg/front_end/testcases/inference_new/infer_assign_to_property_null_aware.dart.direct.transformed.expect
index 9e6a640..d006bf2 100644
--- a/pkg/front_end/testcases/inference_new/infer_assign_to_property_null_aware.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference_new/infer_assign_to_property_null_aware.dart.direct.transformed.expect
@@ -47,6 +47,6 @@
dynamic v7 = let final dynamic #t15 = t in #t15.==(null) ? null : let final dynamic #t16 = #t15.member in let final dynamic #t17 = #t15.member = #t16.-(1) in #t16;
}
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference_new/infer_assign_to_property_null_aware.dart.outline.expect b/pkg/front_end/testcases/inference_new/infer_assign_to_property_null_aware.dart.outline.expect
index de60c09..c483408 100644
--- a/pkg/front_end/testcases/inference_new/infer_assign_to_property_null_aware.dart.outline.expect
+++ b/pkg/front_end/testcases/inference_new/infer_assign_to_property_null_aware.dart.outline.expect
@@ -29,7 +29,7 @@
static method test(self::Test t) → void
;
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
;
static method main() → dynamic
;
diff --git a/pkg/front_end/testcases/inference_new/infer_assign_to_property_null_aware.dart.strong.expect b/pkg/front_end/testcases/inference_new/infer_assign_to_property_null_aware.dart.strong.expect
index d13eac7..1fb2336 100644
--- a/pkg/front_end/testcases/inference_new/infer_assign_to_property_null_aware.dart.strong.expect
+++ b/pkg/front_end/testcases/inference_new/infer_assign_to_property_null_aware.dart.strong.expect
@@ -47,6 +47,6 @@
self::B v7 = let final self::Test #t15 = t in #t15.==(null) ?{self::B} null : let final self::B #t16 = #t15.{self::Test::member} in let final self::B #t17 = #t15.{self::Test::member} = #t16.{self::B::-}(1) in #t16;
}
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference_new/infer_assign_to_property_null_aware.dart.strong.transformed.expect b/pkg/front_end/testcases/inference_new/infer_assign_to_property_null_aware.dart.strong.transformed.expect
index d13eac7..1fb2336 100644
--- a/pkg/front_end/testcases/inference_new/infer_assign_to_property_null_aware.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference_new/infer_assign_to_property_null_aware.dart.strong.transformed.expect
@@ -47,6 +47,6 @@
self::B v7 = let final self::Test #t15 = t in #t15.==(null) ?{self::B} null : let final self::B #t16 = #t15.{self::Test::member} in let final self::B #t17 = #t15.{self::Test::member} = #t16.{self::B::-}(1) in #t16;
}
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference_new/infer_assign_to_property_super.dart.direct.expect b/pkg/front_end/testcases/inference_new/infer_assign_to_property_super.dart.direct.expect
index ccc4134..ee3089f 100644
--- a/pkg/front_end/testcases/inference_new/infer_assign_to_property_super.dart.direct.expect
+++ b/pkg/front_end/testcases/inference_new/infer_assign_to_property_super.dart.direct.expect
@@ -52,6 +52,6 @@
dynamic v7 = let final dynamic #t2 = super.{self::Base::member} in let final dynamic #t3 = super.{self::Base::member} = #t2.-(1) in #t2;
}
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference_new/infer_assign_to_property_super.dart.direct.transformed.expect b/pkg/front_end/testcases/inference_new/infer_assign_to_property_super.dart.direct.transformed.expect
index ccc4134..ee3089f 100644
--- a/pkg/front_end/testcases/inference_new/infer_assign_to_property_super.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference_new/infer_assign_to_property_super.dart.direct.transformed.expect
@@ -52,6 +52,6 @@
dynamic v7 = let final dynamic #t2 = super.{self::Base::member} in let final dynamic #t3 = super.{self::Base::member} = #t2.-(1) in #t2;
}
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference_new/infer_assign_to_property_super.dart.outline.expect b/pkg/front_end/testcases/inference_new/infer_assign_to_property_super.dart.outline.expect
index 077e4d6..8aa62bc 100644
--- a/pkg/front_end/testcases/inference_new/infer_assign_to_property_super.dart.outline.expect
+++ b/pkg/front_end/testcases/inference_new/infer_assign_to_property_super.dart.outline.expect
@@ -33,7 +33,7 @@
method test() → void
;
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
;
static method main() → dynamic
;
diff --git a/pkg/front_end/testcases/inference_new/infer_assign_to_property_super.dart.strong.expect b/pkg/front_end/testcases/inference_new/infer_assign_to_property_super.dart.strong.expect
index 5963336..bb277ea 100644
--- a/pkg/front_end/testcases/inference_new/infer_assign_to_property_super.dart.strong.expect
+++ b/pkg/front_end/testcases/inference_new/infer_assign_to_property_super.dart.strong.expect
@@ -52,6 +52,6 @@
self::B v7 = let final self::B #t2 = super.{self::Base::member} in let final self::B #t3 = super.{self::Base::member} = #t2.{self::B::-}(1) in #t2;
}
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference_new/infer_assign_to_property_super.dart.strong.transformed.expect b/pkg/front_end/testcases/inference_new/infer_assign_to_property_super.dart.strong.transformed.expect
index 5963336..bb277ea 100644
--- a/pkg/front_end/testcases/inference_new/infer_assign_to_property_super.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference_new/infer_assign_to_property_super.dart.strong.transformed.expect
@@ -52,6 +52,6 @@
self::B v7 = let final self::B #t2 = super.{self::Base::member} in let final self::B #t3 = super.{self::Base::member} = #t2.{self::B::-}(1) in #t2;
}
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference_new/infer_assign_to_static.dart.direct.expect b/pkg/front_end/testcases/inference_new/infer_assign_to_static.dart.direct.expect
index fa2ea61..7aa35c1 100644
--- a/pkg/front_end/testcases/inference_new/infer_assign_to_static.dart.direct.expect
+++ b/pkg/front_end/testcases/inference_new/infer_assign_to_static.dart.direct.expect
@@ -27,7 +27,7 @@
;
}
static field self::B topLevelVariable;
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method test_topLevelVariable() → void {
self::topLevelVariable = self::f<dynamic>();
diff --git a/pkg/front_end/testcases/inference_new/infer_assign_to_static.dart.direct.transformed.expect b/pkg/front_end/testcases/inference_new/infer_assign_to_static.dart.direct.transformed.expect
index fa2ea61..7aa35c1 100644
--- a/pkg/front_end/testcases/inference_new/infer_assign_to_static.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference_new/infer_assign_to_static.dart.direct.transformed.expect
@@ -27,7 +27,7 @@
;
}
static field self::B topLevelVariable;
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method test_topLevelVariable() → void {
self::topLevelVariable = self::f<dynamic>();
diff --git a/pkg/front_end/testcases/inference_new/infer_assign_to_static.dart.outline.expect b/pkg/front_end/testcases/inference_new/infer_assign_to_static.dart.outline.expect
index e348b03..dca7f38 100644
--- a/pkg/front_end/testcases/inference_new/infer_assign_to_static.dart.outline.expect
+++ b/pkg/front_end/testcases/inference_new/infer_assign_to_static.dart.outline.expect
@@ -24,7 +24,7 @@
;
}
static field self::B topLevelVariable;
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
;
static method test_topLevelVariable() → void
;
diff --git a/pkg/front_end/testcases/inference_new/infer_assign_to_static.dart.strong.expect b/pkg/front_end/testcases/inference_new/infer_assign_to_static.dart.strong.expect
index 84c4d62..153a008 100644
--- a/pkg/front_end/testcases/inference_new/infer_assign_to_static.dart.strong.expect
+++ b/pkg/front_end/testcases/inference_new/infer_assign_to_static.dart.strong.expect
@@ -27,7 +27,7 @@
;
}
static field self::B topLevelVariable;
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method test_topLevelVariable() → void {
self::topLevelVariable = self::f<self::B>();
diff --git a/pkg/front_end/testcases/inference_new/infer_assign_to_static.dart.strong.transformed.expect b/pkg/front_end/testcases/inference_new/infer_assign_to_static.dart.strong.transformed.expect
index 84c4d62..153a008 100644
--- a/pkg/front_end/testcases/inference_new/infer_assign_to_static.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference_new/infer_assign_to_static.dart.strong.transformed.expect
@@ -27,7 +27,7 @@
;
}
static field self::B topLevelVariable;
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method test_topLevelVariable() → void {
self::topLevelVariable = self::f<self::B>();
diff --git a/pkg/front_end/testcases/inference_new/infer_logical.dart.direct.expect b/pkg/front_end/testcases/inference_new/infer_logical.dart.direct.expect
index 02c47e9..4656afd 100644
--- a/pkg/front_end/testcases/inference_new/infer_logical.dart.direct.expect
+++ b/pkg/front_end/testcases/inference_new/infer_logical.dart.direct.expect
@@ -4,7 +4,7 @@
static field dynamic x = self::f<dynamic>() || self::f<dynamic>();
static field dynamic y = self::f<dynamic>() && self::f<dynamic>();
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method test() → void {
dynamic x = self::f<dynamic>() || self::f<dynamic>();
diff --git a/pkg/front_end/testcases/inference_new/infer_logical.dart.direct.transformed.expect b/pkg/front_end/testcases/inference_new/infer_logical.dart.direct.transformed.expect
index 02c47e9..4656afd 100644
--- a/pkg/front_end/testcases/inference_new/infer_logical.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference_new/infer_logical.dart.direct.transformed.expect
@@ -4,7 +4,7 @@
static field dynamic x = self::f<dynamic>() || self::f<dynamic>();
static field dynamic y = self::f<dynamic>() && self::f<dynamic>();
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method test() → void {
dynamic x = self::f<dynamic>() || self::f<dynamic>();
diff --git a/pkg/front_end/testcases/inference_new/infer_logical.dart.outline.expect b/pkg/front_end/testcases/inference_new/infer_logical.dart.outline.expect
index b13c369..a718af3 100644
--- a/pkg/front_end/testcases/inference_new/infer_logical.dart.outline.expect
+++ b/pkg/front_end/testcases/inference_new/infer_logical.dart.outline.expect
@@ -4,7 +4,7 @@
static field dynamic x;
static field dynamic y;
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
;
static method test() → void
;
diff --git a/pkg/front_end/testcases/inference_new/infer_logical.dart.strong.expect b/pkg/front_end/testcases/inference_new/infer_logical.dart.strong.expect
index b5ead6e..1791f79 100644
--- a/pkg/front_end/testcases/inference_new/infer_logical.dart.strong.expect
+++ b/pkg/front_end/testcases/inference_new/infer_logical.dart.strong.expect
@@ -4,7 +4,7 @@
static field core::bool x = self::f<core::bool>() || self::f<core::bool>();
static field core::bool y = self::f<core::bool>() && self::f<core::bool>();
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method test() → void {
core::bool x = self::f<core::bool>() || self::f<core::bool>();
diff --git a/pkg/front_end/testcases/inference_new/infer_logical.dart.strong.transformed.expect b/pkg/front_end/testcases/inference_new/infer_logical.dart.strong.transformed.expect
index b5ead6e..1791f79 100644
--- a/pkg/front_end/testcases/inference_new/infer_logical.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference_new/infer_logical.dart.strong.transformed.expect
@@ -4,7 +4,7 @@
static field core::bool x = self::f<core::bool>() || self::f<core::bool>();
static field core::bool y = self::f<core::bool>() && self::f<core::bool>();
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method test() → void {
core::bool x = self::f<core::bool>() || self::f<core::bool>();
diff --git a/pkg/front_end/testcases/inference_new/property_assign_combiner.dart.direct.expect b/pkg/front_end/testcases/inference_new/property_assign_combiner.dart.direct.expect
index 1bb7b06..2599105 100644
--- a/pkg/front_end/testcases/inference_new/property_assign_combiner.dart.direct.expect
+++ b/pkg/front_end/testcases/inference_new/property_assign_combiner.dart.direct.expect
@@ -48,7 +48,7 @@
return null;
set target(self::B value) → void {}
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method test1(self::G g) → void {
let final dynamic #t1 = g in #t1.target = #t1.target.*(self::f<dynamic>());
diff --git a/pkg/front_end/testcases/inference_new/property_assign_combiner.dart.direct.transformed.expect b/pkg/front_end/testcases/inference_new/property_assign_combiner.dart.direct.transformed.expect
index 1bb7b06..2599105 100644
--- a/pkg/front_end/testcases/inference_new/property_assign_combiner.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference_new/property_assign_combiner.dart.direct.transformed.expect
@@ -48,7 +48,7 @@
return null;
set target(self::B value) → void {}
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method test1(self::G g) → void {
let final dynamic #t1 = g in #t1.target = #t1.target.*(self::f<dynamic>());
diff --git a/pkg/front_end/testcases/inference_new/property_assign_combiner.dart.outline.expect b/pkg/front_end/testcases/inference_new/property_assign_combiner.dart.outline.expect
index b4b96d8..33e3444 100644
--- a/pkg/front_end/testcases/inference_new/property_assign_combiner.dart.outline.expect
+++ b/pkg/front_end/testcases/inference_new/property_assign_combiner.dart.outline.expect
@@ -42,7 +42,7 @@
set target(self::B value) → void
;
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
;
static method test1(self::G g) → void
;
diff --git a/pkg/front_end/testcases/inference_new/property_assign_combiner.dart.strong.expect b/pkg/front_end/testcases/inference_new/property_assign_combiner.dart.strong.expect
index 1bb49c8..c050b0a 100644
--- a/pkg/front_end/testcases/inference_new/property_assign_combiner.dart.strong.expect
+++ b/pkg/front_end/testcases/inference_new/property_assign_combiner.dart.strong.expect
@@ -48,7 +48,7 @@
return null;
set target(self::B value) → void {}
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method test1(self::G g) → void {
let final self::G #t1 = g in #t1.{self::G::target} = #t1.{self::G::target}.{self::A::*}(self::f<dynamic>() as{TypeError} self::D);
diff --git a/pkg/front_end/testcases/inference_new/property_assign_combiner.dart.strong.transformed.expect b/pkg/front_end/testcases/inference_new/property_assign_combiner.dart.strong.transformed.expect
index 1bb49c8..c050b0a 100644
--- a/pkg/front_end/testcases/inference_new/property_assign_combiner.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference_new/property_assign_combiner.dart.strong.transformed.expect
@@ -48,7 +48,7 @@
return null;
set target(self::B value) → void {}
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method test1(self::G g) → void {
let final self::G #t1 = g in #t1.{self::G::target} = #t1.{self::G::target}.{self::A::*}(self::f<dynamic>() as{TypeError} self::D);
diff --git a/pkg/front_end/testcases/inference_new/static_assign_combiner.dart.direct.expect b/pkg/front_end/testcases/inference_new/static_assign_combiner.dart.direct.expect
index 3b7b792..6513a99 100644
--- a/pkg/front_end/testcases/inference_new/static_assign_combiner.dart.direct.expect
+++ b/pkg/front_end/testcases/inference_new/static_assign_combiner.dart.direct.expect
@@ -40,7 +40,7 @@
: super core::Object::•()
;
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static get target() → self::A
return null;
diff --git a/pkg/front_end/testcases/inference_new/static_assign_combiner.dart.direct.transformed.expect b/pkg/front_end/testcases/inference_new/static_assign_combiner.dart.direct.transformed.expect
index 3b7b792..6513a99 100644
--- a/pkg/front_end/testcases/inference_new/static_assign_combiner.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference_new/static_assign_combiner.dart.direct.transformed.expect
@@ -40,7 +40,7 @@
: super core::Object::•()
;
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static get target() → self::A
return null;
diff --git a/pkg/front_end/testcases/inference_new/static_assign_combiner.dart.outline.expect b/pkg/front_end/testcases/inference_new/static_assign_combiner.dart.outline.expect
index 1e63c29..2642de0 100644
--- a/pkg/front_end/testcases/inference_new/static_assign_combiner.dart.outline.expect
+++ b/pkg/front_end/testcases/inference_new/static_assign_combiner.dart.outline.expect
@@ -34,7 +34,7 @@
synthetic constructor •() → void
;
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
;
static get target() → self::A
;
diff --git a/pkg/front_end/testcases/inference_new/static_assign_combiner.dart.strong.expect b/pkg/front_end/testcases/inference_new/static_assign_combiner.dart.strong.expect
index e2277e6..77baa37 100644
--- a/pkg/front_end/testcases/inference_new/static_assign_combiner.dart.strong.expect
+++ b/pkg/front_end/testcases/inference_new/static_assign_combiner.dart.strong.expect
@@ -40,7 +40,7 @@
: super core::Object::•()
;
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static get target() → self::A
return null;
diff --git a/pkg/front_end/testcases/inference_new/static_assign_combiner.dart.strong.transformed.expect b/pkg/front_end/testcases/inference_new/static_assign_combiner.dart.strong.transformed.expect
index e2277e6..77baa37 100644
--- a/pkg/front_end/testcases/inference_new/static_assign_combiner.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference_new/static_assign_combiner.dart.strong.transformed.expect
@@ -40,7 +40,7 @@
: super core::Object::•()
;
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static get target() → self::A
return null;
diff --git a/pkg/front_end/testcases/inference_new/super_index_get.dart.direct.expect b/pkg/front_end/testcases/inference_new/super_index_get.dart.direct.expect
index d30ced1..65b823a 100644
--- a/pkg/front_end/testcases/inference_new/super_index_get.dart.direct.expect
+++ b/pkg/front_end/testcases/inference_new/super_index_get.dart.direct.expect
@@ -19,6 +19,6 @@
dynamic x = super.{self::B::[]}(self::f<dynamic>());
}
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference_new/super_index_get.dart.direct.transformed.expect b/pkg/front_end/testcases/inference_new/super_index_get.dart.direct.transformed.expect
index d30ced1..65b823a 100644
--- a/pkg/front_end/testcases/inference_new/super_index_get.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference_new/super_index_get.dart.direct.transformed.expect
@@ -19,6 +19,6 @@
dynamic x = super.{self::B::[]}(self::f<dynamic>());
}
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference_new/super_index_get.dart.outline.expect b/pkg/front_end/testcases/inference_new/super_index_get.dart.outline.expect
index 662ebfe..ee2a715 100644
--- a/pkg/front_end/testcases/inference_new/super_index_get.dart.outline.expect
+++ b/pkg/front_end/testcases/inference_new/super_index_get.dart.outline.expect
@@ -16,7 +16,7 @@
method h() → void
;
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
;
static method main() → dynamic
;
diff --git a/pkg/front_end/testcases/inference_new/super_index_get.dart.strong.expect b/pkg/front_end/testcases/inference_new/super_index_get.dart.strong.expect
index 78e7bfb..4f219d0 100644
--- a/pkg/front_end/testcases/inference_new/super_index_get.dart.strong.expect
+++ b/pkg/front_end/testcases/inference_new/super_index_get.dart.strong.expect
@@ -19,6 +19,6 @@
core::num x = super.{self::B::[]}(self::f<core::int>());
}
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference_new/super_index_get.dart.strong.transformed.expect b/pkg/front_end/testcases/inference_new/super_index_get.dart.strong.transformed.expect
index 78e7bfb..4f219d0 100644
--- a/pkg/front_end/testcases/inference_new/super_index_get.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference_new/super_index_get.dart.strong.transformed.expect
@@ -19,6 +19,6 @@
core::num x = super.{self::B::[]}(self::f<core::int>());
}
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference_new/super_index_get_substitution.dart.direct.expect b/pkg/front_end/testcases/inference_new/super_index_get_substitution.dart.direct.expect
index ee237ad..dd25816 100644
--- a/pkg/front_end/testcases/inference_new/super_index_get_substitution.dart.direct.expect
+++ b/pkg/front_end/testcases/inference_new/super_index_get_substitution.dart.direct.expect
@@ -3,24 +3,24 @@
import "dart:core" as core;
import "dart:async" as asy;
-class D<T extends core::Object> extends core::Object {
+class D<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class E<T extends core::Object> extends self::D<self::E::T> {
+class E<T extends core::Object = dynamic> extends self::D<self::E::T> {
synthetic constructor •() → void
: super self::D::•()
;
}
-class B<T extends core::Object> extends core::Object {
+class B<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
operator [](self::E<self::B::T> x) → self::D<self::B::T>
return null;
}
-class C<U extends core::Object> extends self::B<asy::Future<self::C::U>> {
+class C<U extends core::Object = dynamic> extends self::B<asy::Future<self::C::U>> {
synthetic constructor •() → void
: super self::B::•()
;
@@ -30,6 +30,6 @@
dynamic x = super.{self::B::[]}(self::f<dynamic>());
}
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference_new/super_index_get_substitution.dart.direct.transformed.expect b/pkg/front_end/testcases/inference_new/super_index_get_substitution.dart.direct.transformed.expect
index ee237ad..dd25816 100644
--- a/pkg/front_end/testcases/inference_new/super_index_get_substitution.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference_new/super_index_get_substitution.dart.direct.transformed.expect
@@ -3,24 +3,24 @@
import "dart:core" as core;
import "dart:async" as asy;
-class D<T extends core::Object> extends core::Object {
+class D<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class E<T extends core::Object> extends self::D<self::E::T> {
+class E<T extends core::Object = dynamic> extends self::D<self::E::T> {
synthetic constructor •() → void
: super self::D::•()
;
}
-class B<T extends core::Object> extends core::Object {
+class B<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
operator [](self::E<self::B::T> x) → self::D<self::B::T>
return null;
}
-class C<U extends core::Object> extends self::B<asy::Future<self::C::U>> {
+class C<U extends core::Object = dynamic> extends self::B<asy::Future<self::C::U>> {
synthetic constructor •() → void
: super self::B::•()
;
@@ -30,6 +30,6 @@
dynamic x = super.{self::B::[]}(self::f<dynamic>());
}
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference_new/super_index_get_substitution.dart.outline.expect b/pkg/front_end/testcases/inference_new/super_index_get_substitution.dart.outline.expect
index 469ee7f..89cded9 100644
--- a/pkg/front_end/testcases/inference_new/super_index_get_substitution.dart.outline.expect
+++ b/pkg/front_end/testcases/inference_new/super_index_get_substitution.dart.outline.expect
@@ -3,21 +3,21 @@
import "dart:core" as core;
import "dart:async" as asy;
-class D<T extends core::Object> extends core::Object {
+class D<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
;
}
-class E<T extends core::Object> extends self::D<self::E::T> {
+class E<T extends core::Object = dynamic> extends self::D<self::E::T> {
synthetic constructor •() → void
;
}
-class B<T extends core::Object> extends core::Object {
+class B<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
;
operator [](self::E<self::B::T> x) → self::D<self::B::T>
;
}
-class C<U extends core::Object> extends self::B<asy::Future<self::C::U>> {
+class C<U extends core::Object = dynamic> extends self::B<asy::Future<self::C::U>> {
synthetic constructor •() → void
;
operator [](core::Object x) → self::E<asy::Future<self::C::U>>
@@ -25,7 +25,7 @@
method h() → void
;
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
;
static method main() → dynamic
;
diff --git a/pkg/front_end/testcases/inference_new/super_index_get_substitution.dart.strong.expect b/pkg/front_end/testcases/inference_new/super_index_get_substitution.dart.strong.expect
index b061ba0..b94dffa 100644
--- a/pkg/front_end/testcases/inference_new/super_index_get_substitution.dart.strong.expect
+++ b/pkg/front_end/testcases/inference_new/super_index_get_substitution.dart.strong.expect
@@ -3,24 +3,24 @@
import "dart:core" as core;
import "dart:async" as asy;
-class D<T extends core::Object> extends core::Object {
+class D<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class E<T extends core::Object> extends self::D<self::E::T> {
+class E<T extends core::Object = dynamic> extends self::D<self::E::T> {
synthetic constructor •() → void
: super self::D::•()
;
}
-class B<T extends core::Object> extends core::Object {
+class B<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
operator [](generic-covariant-impl generic-covariant-interface self::E<self::B::T> x) → self::D<self::B::T>
return null;
}
-class C<U extends core::Object> extends self::B<asy::Future<self::C::U>> {
+class C<U extends core::Object = dynamic> extends self::B<asy::Future<self::C::U>> {
synthetic constructor •() → void
: super self::B::•()
;
@@ -30,6 +30,6 @@
self::D<asy::Future<self::C::U>> x = super.{self::B::[]}(self::f<self::E<asy::Future<self::C::U>>>());
}
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference_new/super_index_get_substitution.dart.strong.transformed.expect b/pkg/front_end/testcases/inference_new/super_index_get_substitution.dart.strong.transformed.expect
index b061ba0..b94dffa 100644
--- a/pkg/front_end/testcases/inference_new/super_index_get_substitution.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference_new/super_index_get_substitution.dart.strong.transformed.expect
@@ -3,24 +3,24 @@
import "dart:core" as core;
import "dart:async" as asy;
-class D<T extends core::Object> extends core::Object {
+class D<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class E<T extends core::Object> extends self::D<self::E::T> {
+class E<T extends core::Object = dynamic> extends self::D<self::E::T> {
synthetic constructor •() → void
: super self::D::•()
;
}
-class B<T extends core::Object> extends core::Object {
+class B<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
operator [](generic-covariant-impl generic-covariant-interface self::E<self::B::T> x) → self::D<self::B::T>
return null;
}
-class C<U extends core::Object> extends self::B<asy::Future<self::C::U>> {
+class C<U extends core::Object = dynamic> extends self::B<asy::Future<self::C::U>> {
synthetic constructor •() → void
: super self::B::•()
;
@@ -30,6 +30,6 @@
self::D<asy::Future<self::C::U>> x = super.{self::B::[]}(self::f<self::E<asy::Future<self::C::U>>>());
}
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference_new/switch.dart.direct.expect b/pkg/front_end/testcases/inference_new/switch.dart.direct.expect
index 2cafaef..e90c140 100644
--- a/pkg/front_end/testcases/inference_new/switch.dart.direct.expect
+++ b/pkg/front_end/testcases/inference_new/switch.dart.direct.expect
@@ -2,12 +2,12 @@
import self as self;
import "dart:core" as core;
-class C<T extends core::Object> extends core::Object {
+class C<T extends core::Object = dynamic> extends core::Object {
const constructor •() → void
: super core::Object::•()
;
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method test(self::C<core::int> x) → void {
#L1:
diff --git a/pkg/front_end/testcases/inference_new/switch.dart.direct.transformed.expect b/pkg/front_end/testcases/inference_new/switch.dart.direct.transformed.expect
index 2cafaef..e90c140 100644
--- a/pkg/front_end/testcases/inference_new/switch.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference_new/switch.dart.direct.transformed.expect
@@ -2,12 +2,12 @@
import self as self;
import "dart:core" as core;
-class C<T extends core::Object> extends core::Object {
+class C<T extends core::Object = dynamic> extends core::Object {
const constructor •() → void
: super core::Object::•()
;
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method test(self::C<core::int> x) → void {
#L1:
diff --git a/pkg/front_end/testcases/inference_new/switch.dart.outline.expect b/pkg/front_end/testcases/inference_new/switch.dart.outline.expect
index 052db93..9cbe2f4 100644
--- a/pkg/front_end/testcases/inference_new/switch.dart.outline.expect
+++ b/pkg/front_end/testcases/inference_new/switch.dart.outline.expect
@@ -2,11 +2,11 @@
import self as self;
import "dart:core" as core;
-class C<T extends core::Object> extends core::Object {
+class C<T extends core::Object = dynamic> extends core::Object {
const constructor •() → void
;
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
;
static method test(self::C<core::int> x) → void
;
diff --git a/pkg/front_end/testcases/inference_new/switch.dart.strong.expect b/pkg/front_end/testcases/inference_new/switch.dart.strong.expect
index 1c6f5e5..5bb4779 100644
--- a/pkg/front_end/testcases/inference_new/switch.dart.strong.expect
+++ b/pkg/front_end/testcases/inference_new/switch.dart.strong.expect
@@ -2,12 +2,12 @@
import self as self;
import "dart:core" as core;
-class C<T extends core::Object> extends core::Object {
+class C<T extends core::Object = dynamic> extends core::Object {
const constructor •() → void
: super core::Object::•()
;
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method test(self::C<core::int> x) → void {
#L1:
diff --git a/pkg/front_end/testcases/inference_new/switch.dart.strong.transformed.expect b/pkg/front_end/testcases/inference_new/switch.dart.strong.transformed.expect
index 1c6f5e5..5bb4779 100644
--- a/pkg/front_end/testcases/inference_new/switch.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference_new/switch.dart.strong.transformed.expect
@@ -2,12 +2,12 @@
import self as self;
import "dart:core" as core;
-class C<T extends core::Object> extends core::Object {
+class C<T extends core::Object = dynamic> extends core::Object {
const constructor •() → void
: super core::Object::•()
;
}
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method test(self::C<core::int> x) → void {
#L1:
diff --git a/pkg/front_end/testcases/inference_new/unsafe_block_closure_inference_function_call_explicit_dynamic_param_via_expr2.dart.direct.expect b/pkg/front_end/testcases/inference_new/unsafe_block_closure_inference_function_call_explicit_dynamic_param_via_expr2.dart.direct.expect
index db7a7bd..9c67644 100644
--- a/pkg/front_end/testcases/inference_new/unsafe_block_closure_inference_function_call_explicit_dynamic_param_via_expr2.dart.direct.expect
+++ b/pkg/front_end/testcases/inference_new/unsafe_block_closure_inference_function_call_explicit_dynamic_param_via_expr2.dart.direct.expect
@@ -5,7 +5,7 @@
static field dynamic v = self::f.call(() → dynamic {
return 1;
});
-static method f<T extends core::Object>(() → self::f::T g) → core::List<self::f::T>
+static method f<T extends core::Object = dynamic>(() → self::f::T g) → core::List<self::f::T>
return <self::f::T>[g.call()];
static method main() → dynamic {
self::v;
diff --git a/pkg/front_end/testcases/inference_new/unsafe_block_closure_inference_function_call_explicit_dynamic_param_via_expr2.dart.direct.transformed.expect b/pkg/front_end/testcases/inference_new/unsafe_block_closure_inference_function_call_explicit_dynamic_param_via_expr2.dart.direct.transformed.expect
index db7a7bd..9c67644 100644
--- a/pkg/front_end/testcases/inference_new/unsafe_block_closure_inference_function_call_explicit_dynamic_param_via_expr2.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference_new/unsafe_block_closure_inference_function_call_explicit_dynamic_param_via_expr2.dart.direct.transformed.expect
@@ -5,7 +5,7 @@
static field dynamic v = self::f.call(() → dynamic {
return 1;
});
-static method f<T extends core::Object>(() → self::f::T g) → core::List<self::f::T>
+static method f<T extends core::Object = dynamic>(() → self::f::T g) → core::List<self::f::T>
return <self::f::T>[g.call()];
static method main() → dynamic {
self::v;
diff --git a/pkg/front_end/testcases/inference_new/unsafe_block_closure_inference_function_call_explicit_dynamic_param_via_expr2.dart.outline.expect b/pkg/front_end/testcases/inference_new/unsafe_block_closure_inference_function_call_explicit_dynamic_param_via_expr2.dart.outline.expect
index 6b93fcc..49b1ecf 100644
--- a/pkg/front_end/testcases/inference_new/unsafe_block_closure_inference_function_call_explicit_dynamic_param_via_expr2.dart.outline.expect
+++ b/pkg/front_end/testcases/inference_new/unsafe_block_closure_inference_function_call_explicit_dynamic_param_via_expr2.dart.outline.expect
@@ -3,7 +3,7 @@
import "dart:core" as core;
static field dynamic v;
-static method f<T extends core::Object>(() → self::f::T g) → core::List<self::f::T>
+static method f<T extends core::Object = dynamic>(() → self::f::T g) → core::List<self::f::T>
;
static method main() → dynamic
;
diff --git a/pkg/front_end/testcases/inference_new/unsafe_block_closure_inference_function_call_explicit_dynamic_param_via_expr2.dart.strong.expect b/pkg/front_end/testcases/inference_new/unsafe_block_closure_inference_function_call_explicit_dynamic_param_via_expr2.dart.strong.expect
index 5c16415..cd480b4 100644
--- a/pkg/front_end/testcases/inference_new/unsafe_block_closure_inference_function_call_explicit_dynamic_param_via_expr2.dart.strong.expect
+++ b/pkg/front_end/testcases/inference_new/unsafe_block_closure_inference_function_call_explicit_dynamic_param_via_expr2.dart.strong.expect
@@ -5,7 +5,7 @@
static field core::List<core::int> v = self::f.call<core::int>(() → core::int {
return 1;
});
-static method f<T extends core::Object>(() → self::f::T g) → core::List<self::f::T>
+static method f<T extends core::Object = dynamic>(() → self::f::T g) → core::List<self::f::T>
return <self::f::T>[g.call()];
static method main() → dynamic {
self::v;
diff --git a/pkg/front_end/testcases/inference_new/unsafe_block_closure_inference_function_call_explicit_dynamic_param_via_expr2.dart.strong.transformed.expect b/pkg/front_end/testcases/inference_new/unsafe_block_closure_inference_function_call_explicit_dynamic_param_via_expr2.dart.strong.transformed.expect
index 5c16415..cd480b4 100644
--- a/pkg/front_end/testcases/inference_new/unsafe_block_closure_inference_function_call_explicit_dynamic_param_via_expr2.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference_new/unsafe_block_closure_inference_function_call_explicit_dynamic_param_via_expr2.dart.strong.transformed.expect
@@ -5,7 +5,7 @@
static field core::List<core::int> v = self::f.call<core::int>(() → core::int {
return 1;
});
-static method f<T extends core::Object>(() → self::f::T g) → core::List<self::f::T>
+static method f<T extends core::Object = dynamic>(() → self::f::T g) → core::List<self::f::T>
return <self::f::T>[g.call()];
static method main() → dynamic {
self::v;
diff --git a/pkg/front_end/testcases/inference_new/unsafe_block_closure_inference_function_call_explicit_type_param_via_expr2.dart.direct.expect b/pkg/front_end/testcases/inference_new/unsafe_block_closure_inference_function_call_explicit_type_param_via_expr2.dart.direct.expect
index db7a7bd..9c67644 100644
--- a/pkg/front_end/testcases/inference_new/unsafe_block_closure_inference_function_call_explicit_type_param_via_expr2.dart.direct.expect
+++ b/pkg/front_end/testcases/inference_new/unsafe_block_closure_inference_function_call_explicit_type_param_via_expr2.dart.direct.expect
@@ -5,7 +5,7 @@
static field dynamic v = self::f.call(() → dynamic {
return 1;
});
-static method f<T extends core::Object>(() → self::f::T g) → core::List<self::f::T>
+static method f<T extends core::Object = dynamic>(() → self::f::T g) → core::List<self::f::T>
return <self::f::T>[g.call()];
static method main() → dynamic {
self::v;
diff --git a/pkg/front_end/testcases/inference_new/unsafe_block_closure_inference_function_call_explicit_type_param_via_expr2.dart.direct.transformed.expect b/pkg/front_end/testcases/inference_new/unsafe_block_closure_inference_function_call_explicit_type_param_via_expr2.dart.direct.transformed.expect
index db7a7bd..9c67644 100644
--- a/pkg/front_end/testcases/inference_new/unsafe_block_closure_inference_function_call_explicit_type_param_via_expr2.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference_new/unsafe_block_closure_inference_function_call_explicit_type_param_via_expr2.dart.direct.transformed.expect
@@ -5,7 +5,7 @@
static field dynamic v = self::f.call(() → dynamic {
return 1;
});
-static method f<T extends core::Object>(() → self::f::T g) → core::List<self::f::T>
+static method f<T extends core::Object = dynamic>(() → self::f::T g) → core::List<self::f::T>
return <self::f::T>[g.call()];
static method main() → dynamic {
self::v;
diff --git a/pkg/front_end/testcases/inference_new/unsafe_block_closure_inference_function_call_explicit_type_param_via_expr2.dart.outline.expect b/pkg/front_end/testcases/inference_new/unsafe_block_closure_inference_function_call_explicit_type_param_via_expr2.dart.outline.expect
index 6b93fcc..49b1ecf 100644
--- a/pkg/front_end/testcases/inference_new/unsafe_block_closure_inference_function_call_explicit_type_param_via_expr2.dart.outline.expect
+++ b/pkg/front_end/testcases/inference_new/unsafe_block_closure_inference_function_call_explicit_type_param_via_expr2.dart.outline.expect
@@ -3,7 +3,7 @@
import "dart:core" as core;
static field dynamic v;
-static method f<T extends core::Object>(() → self::f::T g) → core::List<self::f::T>
+static method f<T extends core::Object = dynamic>(() → self::f::T g) → core::List<self::f::T>
;
static method main() → dynamic
;
diff --git a/pkg/front_end/testcases/inference_new/unsafe_block_closure_inference_function_call_explicit_type_param_via_expr2.dart.strong.expect b/pkg/front_end/testcases/inference_new/unsafe_block_closure_inference_function_call_explicit_type_param_via_expr2.dart.strong.expect
index 5c16415..cd480b4 100644
--- a/pkg/front_end/testcases/inference_new/unsafe_block_closure_inference_function_call_explicit_type_param_via_expr2.dart.strong.expect
+++ b/pkg/front_end/testcases/inference_new/unsafe_block_closure_inference_function_call_explicit_type_param_via_expr2.dart.strong.expect
@@ -5,7 +5,7 @@
static field core::List<core::int> v = self::f.call<core::int>(() → core::int {
return 1;
});
-static method f<T extends core::Object>(() → self::f::T g) → core::List<self::f::T>
+static method f<T extends core::Object = dynamic>(() → self::f::T g) → core::List<self::f::T>
return <self::f::T>[g.call()];
static method main() → dynamic {
self::v;
diff --git a/pkg/front_end/testcases/inference_new/unsafe_block_closure_inference_function_call_explicit_type_param_via_expr2.dart.strong.transformed.expect b/pkg/front_end/testcases/inference_new/unsafe_block_closure_inference_function_call_explicit_type_param_via_expr2.dart.strong.transformed.expect
index 5c16415..cd480b4 100644
--- a/pkg/front_end/testcases/inference_new/unsafe_block_closure_inference_function_call_explicit_type_param_via_expr2.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference_new/unsafe_block_closure_inference_function_call_explicit_type_param_via_expr2.dart.strong.transformed.expect
@@ -5,7 +5,7 @@
static field core::List<core::int> v = self::f.call<core::int>(() → core::int {
return 1;
});
-static method f<T extends core::Object>(() → self::f::T g) → core::List<self::f::T>
+static method f<T extends core::Object = dynamic>(() → self::f::T g) → core::List<self::f::T>
return <self::f::T>[g.call()];
static method main() → dynamic {
self::v;
diff --git a/pkg/front_end/testcases/inference_new/void_return_type_subtypes_dynamic.dart.direct.expect b/pkg/front_end/testcases/inference_new/void_return_type_subtypes_dynamic.dart.direct.expect
index 9a95c8a..f799565 100644
--- a/pkg/front_end/testcases/inference_new/void_return_type_subtypes_dynamic.dart.direct.expect
+++ b/pkg/front_end/testcases/inference_new/void_return_type_subtypes_dynamic.dart.direct.expect
@@ -3,7 +3,7 @@
import "dart:core" as core;
static field dynamic y = self::run<dynamic>(self::printRunning);
-static method run<T extends core::Object>(() → self::run::T f) → self::run::T {
+static method run<T extends core::Object = dynamic>(() → self::run::T f) → self::run::T {
core::print("running");
dynamic t = f.call();
core::print("done running");
diff --git a/pkg/front_end/testcases/inference_new/void_return_type_subtypes_dynamic.dart.direct.transformed.expect b/pkg/front_end/testcases/inference_new/void_return_type_subtypes_dynamic.dart.direct.transformed.expect
index 9a95c8a..f799565 100644
--- a/pkg/front_end/testcases/inference_new/void_return_type_subtypes_dynamic.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference_new/void_return_type_subtypes_dynamic.dart.direct.transformed.expect
@@ -3,7 +3,7 @@
import "dart:core" as core;
static field dynamic y = self::run<dynamic>(self::printRunning);
-static method run<T extends core::Object>(() → self::run::T f) → self::run::T {
+static method run<T extends core::Object = dynamic>(() → self::run::T f) → self::run::T {
core::print("running");
dynamic t = f.call();
core::print("done running");
diff --git a/pkg/front_end/testcases/inference_new/void_return_type_subtypes_dynamic.dart.outline.expect b/pkg/front_end/testcases/inference_new/void_return_type_subtypes_dynamic.dart.outline.expect
index c3364c8..4834b17 100644
--- a/pkg/front_end/testcases/inference_new/void_return_type_subtypes_dynamic.dart.outline.expect
+++ b/pkg/front_end/testcases/inference_new/void_return_type_subtypes_dynamic.dart.outline.expect
@@ -3,7 +3,7 @@
import "dart:core" as core;
static field dynamic y;
-static method run<T extends core::Object>(() → self::run::T f) → self::run::T
+static method run<T extends core::Object = dynamic>(() → self::run::T f) → self::run::T
;
static method printRunning() → void
;
diff --git a/pkg/front_end/testcases/inference_new/void_return_type_subtypes_dynamic.dart.strong.expect b/pkg/front_end/testcases/inference_new/void_return_type_subtypes_dynamic.dart.strong.expect
index fc015dc..5417786 100644
--- a/pkg/front_end/testcases/inference_new/void_return_type_subtypes_dynamic.dart.strong.expect
+++ b/pkg/front_end/testcases/inference_new/void_return_type_subtypes_dynamic.dart.strong.expect
@@ -3,7 +3,7 @@
import "dart:core" as core;
static field void y = self::run<void>(self::printRunning);
-static method run<T extends core::Object>(() → self::run::T f) → self::run::T {
+static method run<T extends core::Object = dynamic>(() → self::run::T f) → self::run::T {
core::print("running");
self::run::T t = f.call();
core::print("done running");
diff --git a/pkg/front_end/testcases/inference_new/void_return_type_subtypes_dynamic.dart.strong.transformed.expect b/pkg/front_end/testcases/inference_new/void_return_type_subtypes_dynamic.dart.strong.transformed.expect
index fc015dc..5417786 100644
--- a/pkg/front_end/testcases/inference_new/void_return_type_subtypes_dynamic.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference_new/void_return_type_subtypes_dynamic.dart.strong.transformed.expect
@@ -3,7 +3,7 @@
import "dart:core" as core;
static field void y = self::run<void>(self::printRunning);
-static method run<T extends core::Object>(() → self::run::T f) → self::run::T {
+static method run<T extends core::Object = dynamic>(() → self::run::T f) → self::run::T {
core::print("running");
self::run::T t = f.call();
core::print("done running");
diff --git a/pkg/front_end/testcases/inference_new/while_loop.dart.direct.expect b/pkg/front_end/testcases/inference_new/while_loop.dart.direct.expect
index 93db6ac0..5f1da21 100644
--- a/pkg/front_end/testcases/inference_new/while_loop.dart.direct.expect
+++ b/pkg/front_end/testcases/inference_new/while_loop.dart.direct.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method test() → void {
while (self::f<dynamic>()) {
diff --git a/pkg/front_end/testcases/inference_new/while_loop.dart.direct.transformed.expect b/pkg/front_end/testcases/inference_new/while_loop.dart.direct.transformed.expect
index 93db6ac0..5f1da21 100644
--- a/pkg/front_end/testcases/inference_new/while_loop.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/inference_new/while_loop.dart.direct.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method test() → void {
while (self::f<dynamic>()) {
diff --git a/pkg/front_end/testcases/inference_new/while_loop.dart.outline.expect b/pkg/front_end/testcases/inference_new/while_loop.dart.outline.expect
index ac49c9e..e8c03c5 100644
--- a/pkg/front_end/testcases/inference_new/while_loop.dart.outline.expect
+++ b/pkg/front_end/testcases/inference_new/while_loop.dart.outline.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
;
static method test() → void
;
diff --git a/pkg/front_end/testcases/inference_new/while_loop.dart.strong.expect b/pkg/front_end/testcases/inference_new/while_loop.dart.strong.expect
index 411b444..a2d0208 100644
--- a/pkg/front_end/testcases/inference_new/while_loop.dart.strong.expect
+++ b/pkg/front_end/testcases/inference_new/while_loop.dart.strong.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method test() → void {
while (self::f<core::bool>()) {
diff --git a/pkg/front_end/testcases/inference_new/while_loop.dart.strong.transformed.expect b/pkg/front_end/testcases/inference_new/while_loop.dart.strong.transformed.expect
index 411b444..a2d0208 100644
--- a/pkg/front_end/testcases/inference_new/while_loop.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference_new/while_loop.dart.strong.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-static method f<T extends core::Object>() → self::f::T
+static method f<T extends core::Object = dynamic>() → self::f::T
return null;
static method test() → void {
while (self::f<core::bool>()) {
diff --git a/pkg/front_end/testcases/instantiate_to_bound/all_steps.dart.direct.expect b/pkg/front_end/testcases/instantiate_to_bound/all_steps.dart.direct.expect
index 90d33dd..f767cb7 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/all_steps.dart.direct.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/all_steps.dart.direct.expect
@@ -2,17 +2,17 @@
import self as self;
import "dart:core" as core;
-class B<X extends core::Object, Y extends core::Object> extends core::Object {
+class B<X extends core::Object = dynamic, Y extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class C<X extends core::Object, Y extends core::Object> extends core::Object {
+class C<X extends core::Object = dynamic, Y extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class D<X extends self::B<self::D::X, self::D::Y>, Y extends self::C<self::D::X, self::D::Y>, Z extends (self::D::Y) → self::D::X, W extends core::num> extends core::Object {
+class D<X extends self::B<self::D::X, self::D::Y> = dynamic, Y extends self::C<self::D::X, self::D::Y> = dynamic, Z extends (self::D::Y) → self::D::X = dynamic, W extends core::num = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/instantiate_to_bound/all_steps.dart.direct.transformed.expect b/pkg/front_end/testcases/instantiate_to_bound/all_steps.dart.direct.transformed.expect
index 90d33dd..f767cb7 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/all_steps.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/all_steps.dart.direct.transformed.expect
@@ -2,17 +2,17 @@
import self as self;
import "dart:core" as core;
-class B<X extends core::Object, Y extends core::Object> extends core::Object {
+class B<X extends core::Object = dynamic, Y extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class C<X extends core::Object, Y extends core::Object> extends core::Object {
+class C<X extends core::Object = dynamic, Y extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class D<X extends self::B<self::D::X, self::D::Y>, Y extends self::C<self::D::X, self::D::Y>, Z extends (self::D::Y) → self::D::X, W extends core::num> extends core::Object {
+class D<X extends self::B<self::D::X, self::D::Y> = dynamic, Y extends self::C<self::D::X, self::D::Y> = dynamic, Z extends (self::D::Y) → self::D::X = dynamic, W extends core::num = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/instantiate_to_bound/all_steps.dart.outline.expect b/pkg/front_end/testcases/instantiate_to_bound/all_steps.dart.outline.expect
index 8f375f5..57cce0b 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/all_steps.dart.outline.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/all_steps.dart.outline.expect
@@ -2,15 +2,15 @@
import self as self;
import "dart:core" as core;
-class B<X extends core::Object, Y extends core::Object> extends core::Object {
+class B<X extends core::Object = dynamic, Y extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
;
}
-class C<X extends core::Object, Y extends core::Object> extends core::Object {
+class C<X extends core::Object = dynamic, Y extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
;
}
-class D<X extends self::B<self::D::X, self::D::Y>, Y extends self::C<self::D::X, self::D::Y>, Z extends (self::D::Y) → self::D::X, W extends core::num> extends core::Object {
+class D<X extends self::B<self::D::X, self::D::Y> = dynamic, Y extends self::C<self::D::X, self::D::Y> = dynamic, Z extends (self::D::Y) → self::D::X = dynamic, W extends core::num = dynamic> extends core::Object {
synthetic constructor •() → void
;
}
diff --git a/pkg/front_end/testcases/instantiate_to_bound/all_steps.dart.strong.expect b/pkg/front_end/testcases/instantiate_to_bound/all_steps.dart.strong.expect
index e209715..0d386e5 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/all_steps.dart.strong.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/all_steps.dart.strong.expect
@@ -2,17 +2,17 @@
import self as self;
import "dart:core" as core;
-class B<X extends core::Object, Y extends core::Object> extends core::Object {
+class B<X extends core::Object = dynamic, Y extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class C<X extends core::Object, Y extends core::Object> extends core::Object {
+class C<X extends core::Object = dynamic, Y extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class D<X extends self::B<self::D::X, self::D::Y>, Y extends self::C<self::D::X, self::D::Y>, Z extends (self::D::Y) → self::D::X, W extends core::num> extends core::Object {
+class D<X extends self::B<self::D::X, self::D::Y> = self::B<dynamic, dynamic>, Y extends self::C<self::D::X, self::D::Y> = self::C<dynamic, dynamic>, Z extends (self::D::Y) → self::D::X = (core::Null) → self::B<dynamic, dynamic>, W extends core::num = core::num> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/instantiate_to_bound/all_steps.dart.strong.transformed.expect b/pkg/front_end/testcases/instantiate_to_bound/all_steps.dart.strong.transformed.expect
index e209715..0d386e5 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/all_steps.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/all_steps.dart.strong.transformed.expect
@@ -2,17 +2,17 @@
import self as self;
import "dart:core" as core;
-class B<X extends core::Object, Y extends core::Object> extends core::Object {
+class B<X extends core::Object = dynamic, Y extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class C<X extends core::Object, Y extends core::Object> extends core::Object {
+class C<X extends core::Object = dynamic, Y extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class D<X extends self::B<self::D::X, self::D::Y>, Y extends self::C<self::D::X, self::D::Y>, Z extends (self::D::Y) → self::D::X, W extends core::num> extends core::Object {
+class D<X extends self::B<self::D::X, self::D::Y> = self::B<dynamic, dynamic>, Y extends self::C<self::D::X, self::D::Y> = self::C<dynamic, dynamic>, Z extends (self::D::Y) → self::D::X = (core::Null) → self::B<dynamic, dynamic>, W extends core::num = core::num> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/instantiate_to_bound/body_literal_list.dart.direct.expect b/pkg/front_end/testcases/instantiate_to_bound/body_literal_list.dart.direct.expect
index 473030f..39c01de 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/body_literal_list.dart.direct.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/body_literal_list.dart.direct.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class A<T extends core::num> extends core::Object {
+class A<T extends core::num = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/instantiate_to_bound/body_literal_list.dart.direct.transformed.expect b/pkg/front_end/testcases/instantiate_to_bound/body_literal_list.dart.direct.transformed.expect
index 473030f..39c01de 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/body_literal_list.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/body_literal_list.dart.direct.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class A<T extends core::num> extends core::Object {
+class A<T extends core::num = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/instantiate_to_bound/body_literal_list.dart.outline.expect b/pkg/front_end/testcases/instantiate_to_bound/body_literal_list.dart.outline.expect
index e894545..265f85f 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/body_literal_list.dart.outline.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/body_literal_list.dart.outline.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class A<T extends core::num> extends core::Object {
+class A<T extends core::num = dynamic> extends core::Object {
synthetic constructor •() → void
;
}
diff --git a/pkg/front_end/testcases/instantiate_to_bound/body_literal_list.dart.strong.expect b/pkg/front_end/testcases/instantiate_to_bound/body_literal_list.dart.strong.expect
index 7f1bc8a..0d74fd8 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/body_literal_list.dart.strong.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/body_literal_list.dart.strong.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class A<T extends core::num> extends core::Object {
+class A<T extends core::num = core::num> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/instantiate_to_bound/body_literal_list.dart.strong.transformed.expect b/pkg/front_end/testcases/instantiate_to_bound/body_literal_list.dart.strong.transformed.expect
index 7f1bc8a..0d74fd8 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/body_literal_list.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/body_literal_list.dart.strong.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class A<T extends core::num> extends core::Object {
+class A<T extends core::num = core::num> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/instantiate_to_bound/body_literal_list_with_generic_argument.dart.direct.expect b/pkg/front_end/testcases/instantiate_to_bound/body_literal_list_with_generic_argument.dart.direct.expect
index b96b592..ee479f2 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/body_literal_list_with_generic_argument.dart.direct.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/body_literal_list_with_generic_argument.dart.direct.expect
@@ -2,12 +2,12 @@
import self as self;
import "dart:core" as core;
-class A<T extends core::Object> extends core::Object {
+class A<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class B<U extends core::Object> extends core::Object {
+class B<U extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/instantiate_to_bound/body_literal_list_with_generic_argument.dart.direct.transformed.expect b/pkg/front_end/testcases/instantiate_to_bound/body_literal_list_with_generic_argument.dart.direct.transformed.expect
index b96b592..ee479f2 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/body_literal_list_with_generic_argument.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/body_literal_list_with_generic_argument.dart.direct.transformed.expect
@@ -2,12 +2,12 @@
import self as self;
import "dart:core" as core;
-class A<T extends core::Object> extends core::Object {
+class A<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class B<U extends core::Object> extends core::Object {
+class B<U extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/instantiate_to_bound/body_literal_list_with_generic_argument.dart.outline.expect b/pkg/front_end/testcases/instantiate_to_bound/body_literal_list_with_generic_argument.dart.outline.expect
index 73d2f33..4de7478 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/body_literal_list_with_generic_argument.dart.outline.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/body_literal_list_with_generic_argument.dart.outline.expect
@@ -2,11 +2,11 @@
import self as self;
import "dart:core" as core;
-class A<T extends core::Object> extends core::Object {
+class A<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
;
}
-class B<U extends core::Object> extends core::Object {
+class B<U extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
;
method fun() → dynamic
diff --git a/pkg/front_end/testcases/instantiate_to_bound/body_literal_list_with_generic_argument.dart.strong.expect b/pkg/front_end/testcases/instantiate_to_bound/body_literal_list_with_generic_argument.dart.strong.expect
index b96b592..ee479f2 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/body_literal_list_with_generic_argument.dart.strong.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/body_literal_list_with_generic_argument.dart.strong.expect
@@ -2,12 +2,12 @@
import self as self;
import "dart:core" as core;
-class A<T extends core::Object> extends core::Object {
+class A<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class B<U extends core::Object> extends core::Object {
+class B<U extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/instantiate_to_bound/body_literal_list_with_generic_argument.dart.strong.transformed.expect b/pkg/front_end/testcases/instantiate_to_bound/body_literal_list_with_generic_argument.dart.strong.transformed.expect
index b96b592..ee479f2 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/body_literal_list_with_generic_argument.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/body_literal_list_with_generic_argument.dart.strong.transformed.expect
@@ -2,12 +2,12 @@
import self as self;
import "dart:core" as core;
-class A<T extends core::Object> extends core::Object {
+class A<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class B<U extends core::Object> extends core::Object {
+class B<U extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/instantiate_to_bound/body_literal_map.dart.direct.expect b/pkg/front_end/testcases/instantiate_to_bound/body_literal_map.dart.direct.expect
index 571bb1b..fa8a1cd 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/body_literal_map.dart.direct.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/body_literal_map.dart.direct.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class A<T extends core::num> extends core::Object {
+class A<T extends core::num = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/instantiate_to_bound/body_literal_map.dart.direct.transformed.expect b/pkg/front_end/testcases/instantiate_to_bound/body_literal_map.dart.direct.transformed.expect
index 571bb1b..fa8a1cd 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/body_literal_map.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/body_literal_map.dart.direct.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class A<T extends core::num> extends core::Object {
+class A<T extends core::num = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/instantiate_to_bound/body_literal_map.dart.outline.expect b/pkg/front_end/testcases/instantiate_to_bound/body_literal_map.dart.outline.expect
index e894545..265f85f 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/body_literal_map.dart.outline.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/body_literal_map.dart.outline.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class A<T extends core::num> extends core::Object {
+class A<T extends core::num = dynamic> extends core::Object {
synthetic constructor •() → void
;
}
diff --git a/pkg/front_end/testcases/instantiate_to_bound/body_literal_map.dart.strong.expect b/pkg/front_end/testcases/instantiate_to_bound/body_literal_map.dart.strong.expect
index 7a9a472..9da4319 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/body_literal_map.dart.strong.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/body_literal_map.dart.strong.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class A<T extends core::num> extends core::Object {
+class A<T extends core::num = core::num> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/instantiate_to_bound/body_literal_map.dart.strong.transformed.expect b/pkg/front_end/testcases/instantiate_to_bound/body_literal_map.dart.strong.transformed.expect
index 7a9a472..9da4319 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/body_literal_map.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/body_literal_map.dart.strong.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class A<T extends core::num> extends core::Object {
+class A<T extends core::num = core::num> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/instantiate_to_bound/body_omitted_bound.dart.direct.expect b/pkg/front_end/testcases/instantiate_to_bound/body_omitted_bound.dart.direct.expect
index b7936f1..d8c6ef0 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/body_omitted_bound.dart.direct.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/body_omitted_bound.dart.direct.expect
@@ -3,7 +3,7 @@
import "dart:core" as core;
import "dart:collection" as col;
-class A<T extends core::Object> extends core::Object {
+class A<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/instantiate_to_bound/body_omitted_bound.dart.direct.transformed.expect b/pkg/front_end/testcases/instantiate_to_bound/body_omitted_bound.dart.direct.transformed.expect
index b7936f1..d8c6ef0 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/body_omitted_bound.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/body_omitted_bound.dart.direct.transformed.expect
@@ -3,7 +3,7 @@
import "dart:core" as core;
import "dart:collection" as col;
-class A<T extends core::Object> extends core::Object {
+class A<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/instantiate_to_bound/body_omitted_bound.dart.outline.expect b/pkg/front_end/testcases/instantiate_to_bound/body_omitted_bound.dart.outline.expect
index 09674b8..5eaaf89 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/body_omitted_bound.dart.outline.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/body_omitted_bound.dart.outline.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class A<T extends core::Object> extends core::Object {
+class A<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
;
}
diff --git a/pkg/front_end/testcases/instantiate_to_bound/body_omitted_bound.dart.strong.expect b/pkg/front_end/testcases/instantiate_to_bound/body_omitted_bound.dart.strong.expect
index b7936f1..d8c6ef0 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/body_omitted_bound.dart.strong.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/body_omitted_bound.dart.strong.expect
@@ -3,7 +3,7 @@
import "dart:core" as core;
import "dart:collection" as col;
-class A<T extends core::Object> extends core::Object {
+class A<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/instantiate_to_bound/body_omitted_bound.dart.strong.transformed.expect b/pkg/front_end/testcases/instantiate_to_bound/body_omitted_bound.dart.strong.transformed.expect
index b7936f1..d8c6ef0 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/body_omitted_bound.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/body_omitted_bound.dart.strong.transformed.expect
@@ -3,7 +3,7 @@
import "dart:core" as core;
import "dart:collection" as col;
-class A<T extends core::Object> extends core::Object {
+class A<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/instantiate_to_bound/body_super_bounded_type.dart.direct.expect b/pkg/front_end/testcases/instantiate_to_bound/body_super_bounded_type.dart.direct.expect
index 174756c..45a4ce3 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/body_super_bounded_type.dart.direct.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/body_super_bounded_type.dart.direct.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class A<T extends self::A<self::A::T>> extends core::Object {
+class A<T extends self::A<self::A::T> = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/instantiate_to_bound/body_super_bounded_type.dart.direct.transformed.expect b/pkg/front_end/testcases/instantiate_to_bound/body_super_bounded_type.dart.direct.transformed.expect
index 174756c..45a4ce3 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/body_super_bounded_type.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/body_super_bounded_type.dart.direct.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class A<T extends self::A<self::A::T>> extends core::Object {
+class A<T extends self::A<self::A::T> = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/instantiate_to_bound/body_super_bounded_type.dart.outline.expect b/pkg/front_end/testcases/instantiate_to_bound/body_super_bounded_type.dart.outline.expect
index 4d3d1cf..4c18033 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/body_super_bounded_type.dart.outline.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/body_super_bounded_type.dart.outline.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class A<T extends self::A<self::A::T>> extends core::Object {
+class A<T extends self::A<self::A::T> = dynamic> extends core::Object {
synthetic constructor •() → void
;
}
diff --git a/pkg/front_end/testcases/instantiate_to_bound/body_super_bounded_type.dart.strong.expect b/pkg/front_end/testcases/instantiate_to_bound/body_super_bounded_type.dart.strong.expect
index 3657fb3..dca475f 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/body_super_bounded_type.dart.strong.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/body_super_bounded_type.dart.strong.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class A<T extends self::A<self::A::T>> extends core::Object {
+class A<T extends self::A<self::A::T> = self::A<dynamic>> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/instantiate_to_bound/body_super_bounded_type.dart.strong.transformed.expect b/pkg/front_end/testcases/instantiate_to_bound/body_super_bounded_type.dart.strong.transformed.expect
index 3657fb3..dca475f 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/body_super_bounded_type.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/body_super_bounded_type.dart.strong.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class A<T extends self::A<self::A::T>> extends core::Object {
+class A<T extends self::A<self::A::T> = self::A<dynamic>> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/instantiate_to_bound/body_typedef_literal_list.dart.direct.expect b/pkg/front_end/testcases/instantiate_to_bound/body_typedef_literal_list.dart.direct.expect
index 7d3b891..a1a10da 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/body_typedef_literal_list.dart.direct.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/body_typedef_literal_list.dart.direct.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-typedef A<T extends core::num> = (T) → dynamic;
+typedef A<T extends core::num = dynamic> = (T) → dynamic;
class B extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
diff --git a/pkg/front_end/testcases/instantiate_to_bound/body_typedef_literal_list.dart.direct.transformed.expect b/pkg/front_end/testcases/instantiate_to_bound/body_typedef_literal_list.dart.direct.transformed.expect
index 7d3b891..a1a10da 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/body_typedef_literal_list.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/body_typedef_literal_list.dart.direct.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-typedef A<T extends core::num> = (T) → dynamic;
+typedef A<T extends core::num = dynamic> = (T) → dynamic;
class B extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
diff --git a/pkg/front_end/testcases/instantiate_to_bound/body_typedef_literal_list.dart.outline.expect b/pkg/front_end/testcases/instantiate_to_bound/body_typedef_literal_list.dart.outline.expect
index 145b481..ad8fcd8 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/body_typedef_literal_list.dart.outline.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/body_typedef_literal_list.dart.outline.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-typedef A<T extends core::num> = (T) → dynamic;
+typedef A<T extends core::num = dynamic> = (T) → dynamic;
class B extends core::Object {
synthetic constructor •() → void
;
diff --git a/pkg/front_end/testcases/instantiate_to_bound/body_typedef_literal_list.dart.strong.expect b/pkg/front_end/testcases/instantiate_to_bound/body_typedef_literal_list.dart.strong.expect
index 00162ec..a2b129b 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/body_typedef_literal_list.dart.strong.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/body_typedef_literal_list.dart.strong.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-typedef A<T extends core::num> = (T) → dynamic;
+typedef A<T extends core::num = core::num> = (T) → dynamic;
class B extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
diff --git a/pkg/front_end/testcases/instantiate_to_bound/body_typedef_literal_list.dart.strong.transformed.expect b/pkg/front_end/testcases/instantiate_to_bound/body_typedef_literal_list.dart.strong.transformed.expect
index 00162ec..a2b129b 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/body_typedef_literal_list.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/body_typedef_literal_list.dart.strong.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-typedef A<T extends core::num> = (T) → dynamic;
+typedef A<T extends core::num = core::num> = (T) → dynamic;
class B extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
diff --git a/pkg/front_end/testcases/instantiate_to_bound/body_typedef_literal_list_with_generic_argument.dart.direct.expect b/pkg/front_end/testcases/instantiate_to_bound/body_typedef_literal_list_with_generic_argument.dart.direct.expect
index 52cb506..02da85f 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/body_typedef_literal_list_with_generic_argument.dart.direct.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/body_typedef_literal_list_with_generic_argument.dart.direct.expect
@@ -2,8 +2,8 @@
import self as self;
import "dart:core" as core;
-typedef A<T extends core::Object> = (T) → dynamic;
-class B<U extends core::Object> extends core::Object {
+typedef A<T extends core::Object = dynamic> = (T) → dynamic;
+class B<U extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/instantiate_to_bound/body_typedef_literal_list_with_generic_argument.dart.direct.transformed.expect b/pkg/front_end/testcases/instantiate_to_bound/body_typedef_literal_list_with_generic_argument.dart.direct.transformed.expect
index 52cb506..02da85f 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/body_typedef_literal_list_with_generic_argument.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/body_typedef_literal_list_with_generic_argument.dart.direct.transformed.expect
@@ -2,8 +2,8 @@
import self as self;
import "dart:core" as core;
-typedef A<T extends core::Object> = (T) → dynamic;
-class B<U extends core::Object> extends core::Object {
+typedef A<T extends core::Object = dynamic> = (T) → dynamic;
+class B<U extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/instantiate_to_bound/body_typedef_literal_list_with_generic_argument.dart.outline.expect b/pkg/front_end/testcases/instantiate_to_bound/body_typedef_literal_list_with_generic_argument.dart.outline.expect
index 540d4a9..73418c3 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/body_typedef_literal_list_with_generic_argument.dart.outline.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/body_typedef_literal_list_with_generic_argument.dart.outline.expect
@@ -2,8 +2,8 @@
import self as self;
import "dart:core" as core;
-typedef A<T extends core::Object> = (T) → dynamic;
-class B<U extends core::Object> extends core::Object {
+typedef A<T extends core::Object = dynamic> = (T) → dynamic;
+class B<U extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
;
method fun() → dynamic
diff --git a/pkg/front_end/testcases/instantiate_to_bound/body_typedef_literal_list_with_generic_argument.dart.strong.expect b/pkg/front_end/testcases/instantiate_to_bound/body_typedef_literal_list_with_generic_argument.dart.strong.expect
index 52cb506..02da85f 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/body_typedef_literal_list_with_generic_argument.dart.strong.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/body_typedef_literal_list_with_generic_argument.dart.strong.expect
@@ -2,8 +2,8 @@
import self as self;
import "dart:core" as core;
-typedef A<T extends core::Object> = (T) → dynamic;
-class B<U extends core::Object> extends core::Object {
+typedef A<T extends core::Object = dynamic> = (T) → dynamic;
+class B<U extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/instantiate_to_bound/body_typedef_literal_list_with_generic_argument.dart.strong.transformed.expect b/pkg/front_end/testcases/instantiate_to_bound/body_typedef_literal_list_with_generic_argument.dart.strong.transformed.expect
index 52cb506..02da85f 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/body_typedef_literal_list_with_generic_argument.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/body_typedef_literal_list_with_generic_argument.dart.strong.transformed.expect
@@ -2,8 +2,8 @@
import self as self;
import "dart:core" as core;
-typedef A<T extends core::Object> = (T) → dynamic;
-class B<U extends core::Object> extends core::Object {
+typedef A<T extends core::Object = dynamic> = (T) → dynamic;
+class B<U extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/instantiate_to_bound/body_typedef_literal_map.dart.direct.expect b/pkg/front_end/testcases/instantiate_to_bound/body_typedef_literal_map.dart.direct.expect
index fd38c09..939111c 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/body_typedef_literal_map.dart.direct.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/body_typedef_literal_map.dart.direct.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-typedef A<T extends core::num> = (T) → dynamic;
+typedef A<T extends core::num = dynamic> = (T) → dynamic;
class B extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
diff --git a/pkg/front_end/testcases/instantiate_to_bound/body_typedef_literal_map.dart.direct.transformed.expect b/pkg/front_end/testcases/instantiate_to_bound/body_typedef_literal_map.dart.direct.transformed.expect
index fd38c09..939111c 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/body_typedef_literal_map.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/body_typedef_literal_map.dart.direct.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-typedef A<T extends core::num> = (T) → dynamic;
+typedef A<T extends core::num = dynamic> = (T) → dynamic;
class B extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
diff --git a/pkg/front_end/testcases/instantiate_to_bound/body_typedef_literal_map.dart.outline.expect b/pkg/front_end/testcases/instantiate_to_bound/body_typedef_literal_map.dart.outline.expect
index 145b481..ad8fcd8 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/body_typedef_literal_map.dart.outline.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/body_typedef_literal_map.dart.outline.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-typedef A<T extends core::num> = (T) → dynamic;
+typedef A<T extends core::num = dynamic> = (T) → dynamic;
class B extends core::Object {
synthetic constructor •() → void
;
diff --git a/pkg/front_end/testcases/instantiate_to_bound/body_typedef_literal_map.dart.strong.expect b/pkg/front_end/testcases/instantiate_to_bound/body_typedef_literal_map.dart.strong.expect
index f63ba9a..d8117ee 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/body_typedef_literal_map.dart.strong.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/body_typedef_literal_map.dart.strong.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-typedef A<T extends core::num> = (T) → dynamic;
+typedef A<T extends core::num = core::num> = (T) → dynamic;
class B extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
diff --git a/pkg/front_end/testcases/instantiate_to_bound/body_typedef_literal_map.dart.strong.transformed.expect b/pkg/front_end/testcases/instantiate_to_bound/body_typedef_literal_map.dart.strong.transformed.expect
index f63ba9a..d8117ee 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/body_typedef_literal_map.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/body_typedef_literal_map.dart.strong.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-typedef A<T extends core::num> = (T) → dynamic;
+typedef A<T extends core::num = core::num> = (T) → dynamic;
class B extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
diff --git a/pkg/front_end/testcases/instantiate_to_bound/body_typedef_omitted_bound.dart.direct.expect b/pkg/front_end/testcases/instantiate_to_bound/body_typedef_omitted_bound.dart.direct.expect
index ff7a612..e707e98 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/body_typedef_omitted_bound.dart.direct.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/body_typedef_omitted_bound.dart.direct.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-typedef A<T extends core::Object> = (T) → dynamic;
+typedef A<T extends core::Object = dynamic> = (T) → dynamic;
class C extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
diff --git a/pkg/front_end/testcases/instantiate_to_bound/body_typedef_omitted_bound.dart.direct.transformed.expect b/pkg/front_end/testcases/instantiate_to_bound/body_typedef_omitted_bound.dart.direct.transformed.expect
index ff7a612..e707e98 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/body_typedef_omitted_bound.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/body_typedef_omitted_bound.dart.direct.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-typedef A<T extends core::Object> = (T) → dynamic;
+typedef A<T extends core::Object = dynamic> = (T) → dynamic;
class C extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
diff --git a/pkg/front_end/testcases/instantiate_to_bound/body_typedef_omitted_bound.dart.outline.expect b/pkg/front_end/testcases/instantiate_to_bound/body_typedef_omitted_bound.dart.outline.expect
index 3c49af3..1796d4d 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/body_typedef_omitted_bound.dart.outline.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/body_typedef_omitted_bound.dart.outline.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-typedef A<T extends core::Object> = (T) → dynamic;
+typedef A<T extends core::Object = dynamic> = (T) → dynamic;
class C extends core::Object {
synthetic constructor •() → void
;
diff --git a/pkg/front_end/testcases/instantiate_to_bound/body_typedef_omitted_bound.dart.strong.expect b/pkg/front_end/testcases/instantiate_to_bound/body_typedef_omitted_bound.dart.strong.expect
index ff7a612..e707e98 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/body_typedef_omitted_bound.dart.strong.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/body_typedef_omitted_bound.dart.strong.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-typedef A<T extends core::Object> = (T) → dynamic;
+typedef A<T extends core::Object = dynamic> = (T) → dynamic;
class C extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
diff --git a/pkg/front_end/testcases/instantiate_to_bound/body_typedef_omitted_bound.dart.strong.transformed.expect b/pkg/front_end/testcases/instantiate_to_bound/body_typedef_omitted_bound.dart.strong.transformed.expect
index ff7a612..e707e98 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/body_typedef_omitted_bound.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/body_typedef_omitted_bound.dart.strong.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-typedef A<T extends core::Object> = (T) → dynamic;
+typedef A<T extends core::Object = dynamic> = (T) → dynamic;
class C extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
diff --git a/pkg/front_end/testcases/instantiate_to_bound/body_typedef_super_bounded_type.dart.direct.expect b/pkg/front_end/testcases/instantiate_to_bound/body_typedef_super_bounded_type.dart.direct.expect
index 1712b9b..9471d94 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/body_typedef_super_bounded_type.dart.direct.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/body_typedef_super_bounded_type.dart.direct.expect
@@ -2,8 +2,8 @@
import self as self;
import "dart:core" as core;
-typedef A<T extends core::Object> = (T) → dynamic;
-typedef B<U extends (U) → dynamic> = (U) → dynamic;
+typedef A<T extends core::Object = dynamic> = (T) → dynamic;
+typedef B<U extends (U) → dynamic = dynamic> = (U) → dynamic;
class C extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
diff --git a/pkg/front_end/testcases/instantiate_to_bound/body_typedef_super_bounded_type.dart.direct.transformed.expect b/pkg/front_end/testcases/instantiate_to_bound/body_typedef_super_bounded_type.dart.direct.transformed.expect
index 1712b9b..9471d94 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/body_typedef_super_bounded_type.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/body_typedef_super_bounded_type.dart.direct.transformed.expect
@@ -2,8 +2,8 @@
import self as self;
import "dart:core" as core;
-typedef A<T extends core::Object> = (T) → dynamic;
-typedef B<U extends (U) → dynamic> = (U) → dynamic;
+typedef A<T extends core::Object = dynamic> = (T) → dynamic;
+typedef B<U extends (U) → dynamic = dynamic> = (U) → dynamic;
class C extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
diff --git a/pkg/front_end/testcases/instantiate_to_bound/body_typedef_super_bounded_type.dart.outline.expect b/pkg/front_end/testcases/instantiate_to_bound/body_typedef_super_bounded_type.dart.outline.expect
index 78f47f1..f49fc49 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/body_typedef_super_bounded_type.dart.outline.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/body_typedef_super_bounded_type.dart.outline.expect
@@ -2,8 +2,8 @@
import self as self;
import "dart:core" as core;
-typedef A<T extends core::Object> = (T) → dynamic;
-typedef B<U extends (U) → dynamic> = (U) → dynamic;
+typedef A<T extends core::Object = dynamic> = (T) → dynamic;
+typedef B<U extends (U) → dynamic = dynamic> = (U) → dynamic;
class C extends core::Object {
synthetic constructor •() → void
;
diff --git a/pkg/front_end/testcases/instantiate_to_bound/contravariant_dependence.dart.direct.expect b/pkg/front_end/testcases/instantiate_to_bound/contravariant_dependence.dart.direct.expect
index b2e548c..64da62b 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/contravariant_dependence.dart.direct.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/contravariant_dependence.dart.direct.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class C<X extends core::num, Y extends (self::C::X) → void> extends core::Object {
+class C<X extends core::num = dynamic, Y extends (self::C::X) → void = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/instantiate_to_bound/contravariant_dependence.dart.direct.transformed.expect b/pkg/front_end/testcases/instantiate_to_bound/contravariant_dependence.dart.direct.transformed.expect
index b2e548c..64da62b 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/contravariant_dependence.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/contravariant_dependence.dart.direct.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class C<X extends core::num, Y extends (self::C::X) → void> extends core::Object {
+class C<X extends core::num = dynamic, Y extends (self::C::X) → void = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/instantiate_to_bound/contravariant_dependence.dart.outline.expect b/pkg/front_end/testcases/instantiate_to_bound/contravariant_dependence.dart.outline.expect
index 79ffb56..3eb7ec4 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/contravariant_dependence.dart.outline.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/contravariant_dependence.dart.outline.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class C<X extends core::num, Y extends (self::C::X) → void> extends core::Object {
+class C<X extends core::num = dynamic, Y extends (self::C::X) → void = dynamic> extends core::Object {
synthetic constructor •() → void
;
}
diff --git a/pkg/front_end/testcases/instantiate_to_bound/contravariant_dependence.dart.strong.expect b/pkg/front_end/testcases/instantiate_to_bound/contravariant_dependence.dart.strong.expect
index 7752f4e..db904c5 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/contravariant_dependence.dart.strong.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/contravariant_dependence.dart.strong.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class C<X extends core::num, Y extends (self::C::X) → void> extends core::Object {
+class C<X extends core::num = core::num, Y extends (self::C::X) → void = (core::Null) → void> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/instantiate_to_bound/contravariant_dependence.dart.strong.transformed.expect b/pkg/front_end/testcases/instantiate_to_bound/contravariant_dependence.dart.strong.transformed.expect
index 7752f4e..db904c5 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/contravariant_dependence.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/contravariant_dependence.dart.strong.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class C<X extends core::num, Y extends (self::C::X) → void> extends core::Object {
+class C<X extends core::num = core::num, Y extends (self::C::X) → void = (core::Null) → void> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/instantiate_to_bound/contravariant_dependence_in_literals.dart.direct.expect b/pkg/front_end/testcases/instantiate_to_bound/contravariant_dependence_in_literals.dart.direct.expect
index 88dc108..769b44d 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/contravariant_dependence_in_literals.dart.direct.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/contravariant_dependence_in_literals.dart.direct.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class C<X extends core::num, Y extends (self::C::X) → void> extends core::Object {
+class C<X extends core::num = dynamic, Y extends (self::C::X) → void = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/instantiate_to_bound/contravariant_dependence_in_literals.dart.direct.transformed.expect b/pkg/front_end/testcases/instantiate_to_bound/contravariant_dependence_in_literals.dart.direct.transformed.expect
index 88dc108..769b44d 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/contravariant_dependence_in_literals.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/contravariant_dependence_in_literals.dart.direct.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class C<X extends core::num, Y extends (self::C::X) → void> extends core::Object {
+class C<X extends core::num = dynamic, Y extends (self::C::X) → void = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/instantiate_to_bound/contravariant_dependence_in_literals.dart.outline.expect b/pkg/front_end/testcases/instantiate_to_bound/contravariant_dependence_in_literals.dart.outline.expect
index 4c67675..17ae19a 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/contravariant_dependence_in_literals.dart.outline.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/contravariant_dependence_in_literals.dart.outline.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class C<X extends core::num, Y extends (self::C::X) → void> extends core::Object {
+class C<X extends core::num = dynamic, Y extends (self::C::X) → void = dynamic> extends core::Object {
synthetic constructor •() → void
;
}
diff --git a/pkg/front_end/testcases/instantiate_to_bound/contravariant_dependence_in_literals.dart.strong.expect b/pkg/front_end/testcases/instantiate_to_bound/contravariant_dependence_in_literals.dart.strong.expect
index a18fd3d..df12d4d 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/contravariant_dependence_in_literals.dart.strong.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/contravariant_dependence_in_literals.dart.strong.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class C<X extends core::num, Y extends (self::C::X) → void> extends core::Object {
+class C<X extends core::num = core::num, Y extends (self::C::X) → void = (core::Null) → void> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/instantiate_to_bound/contravariant_dependence_in_literals.dart.strong.transformed.expect b/pkg/front_end/testcases/instantiate_to_bound/contravariant_dependence_in_literals.dart.strong.transformed.expect
index a18fd3d..df12d4d 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/contravariant_dependence_in_literals.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/contravariant_dependence_in_literals.dart.strong.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class C<X extends core::num, Y extends (self::C::X) → void> extends core::Object {
+class C<X extends core::num = core::num, Y extends (self::C::X) → void = (core::Null) → void> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/instantiate_to_bound/contravariant_mutual_dependence.dart.direct.expect b/pkg/front_end/testcases/instantiate_to_bound/contravariant_mutual_dependence.dart.direct.expect
index 17cca3b..3f02fe8 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/contravariant_mutual_dependence.dart.direct.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/contravariant_mutual_dependence.dart.direct.expect
@@ -2,12 +2,12 @@
import self as self;
import "dart:core" as core;
-class D<X extends (self::D::X, self::D::Y) → void, Y extends (self::D::X, self::D::Y) → void> extends core::Object {
+class D<X extends (self::D::X, self::D::Y) → void = dynamic, Y extends (self::D::X, self::D::Y) → void = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class E<X extends (self::E::X) → void> extends core::Object {
+class E<X extends (self::E::X) → void = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/instantiate_to_bound/contravariant_mutual_dependence.dart.direct.transformed.expect b/pkg/front_end/testcases/instantiate_to_bound/contravariant_mutual_dependence.dart.direct.transformed.expect
index 17cca3b..3f02fe8 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/contravariant_mutual_dependence.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/contravariant_mutual_dependence.dart.direct.transformed.expect
@@ -2,12 +2,12 @@
import self as self;
import "dart:core" as core;
-class D<X extends (self::D::X, self::D::Y) → void, Y extends (self::D::X, self::D::Y) → void> extends core::Object {
+class D<X extends (self::D::X, self::D::Y) → void = dynamic, Y extends (self::D::X, self::D::Y) → void = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class E<X extends (self::E::X) → void> extends core::Object {
+class E<X extends (self::E::X) → void = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/instantiate_to_bound/contravariant_mutual_dependence.dart.outline.expect b/pkg/front_end/testcases/instantiate_to_bound/contravariant_mutual_dependence.dart.outline.expect
index fe0a77b..d10f5b4 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/contravariant_mutual_dependence.dart.outline.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/contravariant_mutual_dependence.dart.outline.expect
@@ -2,11 +2,11 @@
import self as self;
import "dart:core" as core;
-class D<X extends (self::D::X, self::D::Y) → void, Y extends (self::D::X, self::D::Y) → void> extends core::Object {
+class D<X extends (self::D::X, self::D::Y) → void = dynamic, Y extends (self::D::X, self::D::Y) → void = dynamic> extends core::Object {
synthetic constructor •() → void
;
}
-class E<X extends (self::E::X) → void> extends core::Object {
+class E<X extends (self::E::X) → void = dynamic> extends core::Object {
synthetic constructor •() → void
;
}
diff --git a/pkg/front_end/testcases/instantiate_to_bound/contravariant_mutual_dependence.dart.strong.expect b/pkg/front_end/testcases/instantiate_to_bound/contravariant_mutual_dependence.dart.strong.expect
index b3fcc39..484914d 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/contravariant_mutual_dependence.dart.strong.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/contravariant_mutual_dependence.dart.strong.expect
@@ -2,12 +2,12 @@
import self as self;
import "dart:core" as core;
-class D<X extends (self::D::X, self::D::Y) → void, Y extends (self::D::X, self::D::Y) → void> extends core::Object {
+class D<X extends (self::D::X, self::D::Y) → void = (core::Null, core::Null) → void, Y extends (self::D::X, self::D::Y) → void = (core::Null, core::Null) → void> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class E<X extends (self::E::X) → void> extends core::Object {
+class E<X extends (self::E::X) → void = (core::Null) → void> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/instantiate_to_bound/contravariant_mutual_dependence.dart.strong.transformed.expect b/pkg/front_end/testcases/instantiate_to_bound/contravariant_mutual_dependence.dart.strong.transformed.expect
index b3fcc39..484914d 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/contravariant_mutual_dependence.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/contravariant_mutual_dependence.dart.strong.transformed.expect
@@ -2,12 +2,12 @@
import self as self;
import "dart:core" as core;
-class D<X extends (self::D::X, self::D::Y) → void, Y extends (self::D::X, self::D::Y) → void> extends core::Object {
+class D<X extends (self::D::X, self::D::Y) → void = (core::Null, core::Null) → void, Y extends (self::D::X, self::D::Y) → void = (core::Null, core::Null) → void> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class E<X extends (self::E::X) → void> extends core::Object {
+class E<X extends (self::E::X) → void = (core::Null) → void> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/instantiate_to_bound/contravariant_mutual_dependence_in_literals.dart.direct.expect b/pkg/front_end/testcases/instantiate_to_bound/contravariant_mutual_dependence_in_literals.dart.direct.expect
index 803b7ee..d1dd2cb 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/contravariant_mutual_dependence_in_literals.dart.direct.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/contravariant_mutual_dependence_in_literals.dart.direct.expect
@@ -2,12 +2,12 @@
import self as self;
import "dart:core" as core;
-class D<X extends (self::D::X, self::D::Y) → void, Y extends (self::D::X, self::D::Y) → void> extends core::Object {
+class D<X extends (self::D::X, self::D::Y) → void = dynamic, Y extends (self::D::X, self::D::Y) → void = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class E<X extends (self::E::X) → void> extends core::Object {
+class E<X extends (self::E::X) → void = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/instantiate_to_bound/contravariant_mutual_dependence_in_literals.dart.direct.transformed.expect b/pkg/front_end/testcases/instantiate_to_bound/contravariant_mutual_dependence_in_literals.dart.direct.transformed.expect
index 803b7ee..d1dd2cb 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/contravariant_mutual_dependence_in_literals.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/contravariant_mutual_dependence_in_literals.dart.direct.transformed.expect
@@ -2,12 +2,12 @@
import self as self;
import "dart:core" as core;
-class D<X extends (self::D::X, self::D::Y) → void, Y extends (self::D::X, self::D::Y) → void> extends core::Object {
+class D<X extends (self::D::X, self::D::Y) → void = dynamic, Y extends (self::D::X, self::D::Y) → void = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class E<X extends (self::E::X) → void> extends core::Object {
+class E<X extends (self::E::X) → void = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/instantiate_to_bound/contravariant_mutual_dependence_in_literals.dart.outline.expect b/pkg/front_end/testcases/instantiate_to_bound/contravariant_mutual_dependence_in_literals.dart.outline.expect
index 4006f50..638b8fc 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/contravariant_mutual_dependence_in_literals.dart.outline.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/contravariant_mutual_dependence_in_literals.dart.outline.expect
@@ -2,11 +2,11 @@
import self as self;
import "dart:core" as core;
-class D<X extends (self::D::X, self::D::Y) → void, Y extends (self::D::X, self::D::Y) → void> extends core::Object {
+class D<X extends (self::D::X, self::D::Y) → void = dynamic, Y extends (self::D::X, self::D::Y) → void = dynamic> extends core::Object {
synthetic constructor •() → void
;
}
-class E<X extends (self::E::X) → void> extends core::Object {
+class E<X extends (self::E::X) → void = dynamic> extends core::Object {
synthetic constructor •() → void
;
}
diff --git a/pkg/front_end/testcases/instantiate_to_bound/contravariant_mutual_dependence_in_literals.dart.strong.expect b/pkg/front_end/testcases/instantiate_to_bound/contravariant_mutual_dependence_in_literals.dart.strong.expect
index 1797ecd..4a12d44 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/contravariant_mutual_dependence_in_literals.dart.strong.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/contravariant_mutual_dependence_in_literals.dart.strong.expect
@@ -2,12 +2,12 @@
import self as self;
import "dart:core" as core;
-class D<X extends (self::D::X, self::D::Y) → void, Y extends (self::D::X, self::D::Y) → void> extends core::Object {
+class D<X extends (self::D::X, self::D::Y) → void = (core::Null, core::Null) → void, Y extends (self::D::X, self::D::Y) → void = (core::Null, core::Null) → void> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class E<X extends (self::E::X) → void> extends core::Object {
+class E<X extends (self::E::X) → void = (core::Null) → void> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/instantiate_to_bound/contravariant_mutual_dependence_in_literals.dart.strong.transformed.expect b/pkg/front_end/testcases/instantiate_to_bound/contravariant_mutual_dependence_in_literals.dart.strong.transformed.expect
index 1797ecd..4a12d44 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/contravariant_mutual_dependence_in_literals.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/contravariant_mutual_dependence_in_literals.dart.strong.transformed.expect
@@ -2,12 +2,12 @@
import self as self;
import "dart:core" as core;
-class D<X extends (self::D::X, self::D::Y) → void, Y extends (self::D::X, self::D::Y) → void> extends core::Object {
+class D<X extends (self::D::X, self::D::Y) → void = (core::Null, core::Null) → void, Y extends (self::D::X, self::D::Y) → void = (core::Null, core::Null) → void> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class E<X extends (self::E::X) → void> extends core::Object {
+class E<X extends (self::E::X) → void = (core::Null) → void> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/instantiate_to_bound/covariant_dependence.dart.direct.expect b/pkg/front_end/testcases/instantiate_to_bound/covariant_dependence.dart.direct.expect
index 2d50f0b..6c05a05 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/covariant_dependence.dart.direct.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/covariant_dependence.dart.direct.expect
@@ -2,27 +2,27 @@
import self as self;
import "dart:core" as core;
-class A<X extends core::Object> extends core::Object {
+class A<X extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class C<X extends core::Object, Y extends self::A<self::C::X>> extends core::Object {
+class C<X extends core::Object = dynamic, Y extends self::A<self::C::X> = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class D<X extends core::num, Y extends self::A<self::D::X>> extends core::Object {
+class D<X extends core::num = dynamic, Y extends self::A<self::D::X> = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class E<X extends core::Object, Y extends () → self::E::X> extends core::Object {
+class E<X extends core::Object = dynamic, Y extends () → self::E::X = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class F<X extends core::num, Y extends () → self::F::X> extends core::Object {
+class F<X extends core::num = dynamic, Y extends () → self::F::X = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/instantiate_to_bound/covariant_dependence.dart.direct.transformed.expect b/pkg/front_end/testcases/instantiate_to_bound/covariant_dependence.dart.direct.transformed.expect
index 2d50f0b..6c05a05 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/covariant_dependence.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/covariant_dependence.dart.direct.transformed.expect
@@ -2,27 +2,27 @@
import self as self;
import "dart:core" as core;
-class A<X extends core::Object> extends core::Object {
+class A<X extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class C<X extends core::Object, Y extends self::A<self::C::X>> extends core::Object {
+class C<X extends core::Object = dynamic, Y extends self::A<self::C::X> = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class D<X extends core::num, Y extends self::A<self::D::X>> extends core::Object {
+class D<X extends core::num = dynamic, Y extends self::A<self::D::X> = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class E<X extends core::Object, Y extends () → self::E::X> extends core::Object {
+class E<X extends core::Object = dynamic, Y extends () → self::E::X = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class F<X extends core::num, Y extends () → self::F::X> extends core::Object {
+class F<X extends core::num = dynamic, Y extends () → self::F::X = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/instantiate_to_bound/covariant_dependence.dart.outline.expect b/pkg/front_end/testcases/instantiate_to_bound/covariant_dependence.dart.outline.expect
index cca8bfd..5056d3f 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/covariant_dependence.dart.outline.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/covariant_dependence.dart.outline.expect
@@ -2,23 +2,23 @@
import self as self;
import "dart:core" as core;
-class A<X extends core::Object> extends core::Object {
+class A<X extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
;
}
-class C<X extends core::Object, Y extends self::A<self::C::X>> extends core::Object {
+class C<X extends core::Object = dynamic, Y extends self::A<self::C::X> = dynamic> extends core::Object {
synthetic constructor •() → void
;
}
-class D<X extends core::num, Y extends self::A<self::D::X>> extends core::Object {
+class D<X extends core::num = dynamic, Y extends self::A<self::D::X> = dynamic> extends core::Object {
synthetic constructor •() → void
;
}
-class E<X extends core::Object, Y extends () → self::E::X> extends core::Object {
+class E<X extends core::Object = dynamic, Y extends () → self::E::X = dynamic> extends core::Object {
synthetic constructor •() → void
;
}
-class F<X extends core::num, Y extends () → self::F::X> extends core::Object {
+class F<X extends core::num = dynamic, Y extends () → self::F::X = dynamic> extends core::Object {
synthetic constructor •() → void
;
}
diff --git a/pkg/front_end/testcases/instantiate_to_bound/covariant_dependence.dart.strong.expect b/pkg/front_end/testcases/instantiate_to_bound/covariant_dependence.dart.strong.expect
index dfad499..9f14994 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/covariant_dependence.dart.strong.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/covariant_dependence.dart.strong.expect
@@ -2,27 +2,27 @@
import self as self;
import "dart:core" as core;
-class A<X extends core::Object> extends core::Object {
+class A<X extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class C<X extends core::Object, Y extends self::A<self::C::X>> extends core::Object {
+class C<X extends core::Object = dynamic, Y extends self::A<self::C::X> = self::A<dynamic>> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class D<X extends core::num, Y extends self::A<self::D::X>> extends core::Object {
+class D<X extends core::num = core::num, Y extends self::A<self::D::X> = self::A<core::num>> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class E<X extends core::Object, Y extends () → self::E::X> extends core::Object {
+class E<X extends core::Object = dynamic, Y extends () → self::E::X = () → dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class F<X extends core::num, Y extends () → self::F::X> extends core::Object {
+class F<X extends core::num = core::num, Y extends () → self::F::X = () → core::num> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/instantiate_to_bound/covariant_dependence.dart.strong.transformed.expect b/pkg/front_end/testcases/instantiate_to_bound/covariant_dependence.dart.strong.transformed.expect
index dfad499..9f14994 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/covariant_dependence.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/covariant_dependence.dart.strong.transformed.expect
@@ -2,27 +2,27 @@
import self as self;
import "dart:core" as core;
-class A<X extends core::Object> extends core::Object {
+class A<X extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class C<X extends core::Object, Y extends self::A<self::C::X>> extends core::Object {
+class C<X extends core::Object = dynamic, Y extends self::A<self::C::X> = self::A<dynamic>> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class D<X extends core::num, Y extends self::A<self::D::X>> extends core::Object {
+class D<X extends core::num = core::num, Y extends self::A<self::D::X> = self::A<core::num>> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class E<X extends core::Object, Y extends () → self::E::X> extends core::Object {
+class E<X extends core::Object = dynamic, Y extends () → self::E::X = () → dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class F<X extends core::num, Y extends () → self::F::X> extends core::Object {
+class F<X extends core::num = core::num, Y extends () → self::F::X = () → core::num> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/instantiate_to_bound/covariant_dependence_in_literals.dart.direct.expect b/pkg/front_end/testcases/instantiate_to_bound/covariant_dependence_in_literals.dart.direct.expect
index f3f4e88..f3ff161 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/covariant_dependence_in_literals.dart.direct.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/covariant_dependence_in_literals.dart.direct.expect
@@ -2,27 +2,27 @@
import self as self;
import "dart:core" as core;
-class A<X extends core::Object> extends core::Object {
+class A<X extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class C<X extends core::Object, Y extends self::A<self::C::X>> extends core::Object {
+class C<X extends core::Object = dynamic, Y extends self::A<self::C::X> = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class D<X extends core::num, Y extends self::A<self::D::X>> extends core::Object {
+class D<X extends core::num = dynamic, Y extends self::A<self::D::X> = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class E<X extends core::Object, Y extends () → self::E::X> extends core::Object {
+class E<X extends core::Object = dynamic, Y extends () → self::E::X = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class F<X extends core::num, Y extends () → self::F::X> extends core::Object {
+class F<X extends core::num = dynamic, Y extends () → self::F::X = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/instantiate_to_bound/covariant_dependence_in_literals.dart.direct.transformed.expect b/pkg/front_end/testcases/instantiate_to_bound/covariant_dependence_in_literals.dart.direct.transformed.expect
index f3f4e88..f3ff161 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/covariant_dependence_in_literals.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/covariant_dependence_in_literals.dart.direct.transformed.expect
@@ -2,27 +2,27 @@
import self as self;
import "dart:core" as core;
-class A<X extends core::Object> extends core::Object {
+class A<X extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class C<X extends core::Object, Y extends self::A<self::C::X>> extends core::Object {
+class C<X extends core::Object = dynamic, Y extends self::A<self::C::X> = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class D<X extends core::num, Y extends self::A<self::D::X>> extends core::Object {
+class D<X extends core::num = dynamic, Y extends self::A<self::D::X> = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class E<X extends core::Object, Y extends () → self::E::X> extends core::Object {
+class E<X extends core::Object = dynamic, Y extends () → self::E::X = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class F<X extends core::num, Y extends () → self::F::X> extends core::Object {
+class F<X extends core::num = dynamic, Y extends () → self::F::X = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/instantiate_to_bound/covariant_dependence_in_literals.dart.outline.expect b/pkg/front_end/testcases/instantiate_to_bound/covariant_dependence_in_literals.dart.outline.expect
index 004ef30..59670f0 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/covariant_dependence_in_literals.dart.outline.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/covariant_dependence_in_literals.dart.outline.expect
@@ -2,23 +2,23 @@
import self as self;
import "dart:core" as core;
-class A<X extends core::Object> extends core::Object {
+class A<X extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
;
}
-class C<X extends core::Object, Y extends self::A<self::C::X>> extends core::Object {
+class C<X extends core::Object = dynamic, Y extends self::A<self::C::X> = dynamic> extends core::Object {
synthetic constructor •() → void
;
}
-class D<X extends core::num, Y extends self::A<self::D::X>> extends core::Object {
+class D<X extends core::num = dynamic, Y extends self::A<self::D::X> = dynamic> extends core::Object {
synthetic constructor •() → void
;
}
-class E<X extends core::Object, Y extends () → self::E::X> extends core::Object {
+class E<X extends core::Object = dynamic, Y extends () → self::E::X = dynamic> extends core::Object {
synthetic constructor •() → void
;
}
-class F<X extends core::num, Y extends () → self::F::X> extends core::Object {
+class F<X extends core::num = dynamic, Y extends () → self::F::X = dynamic> extends core::Object {
synthetic constructor •() → void
;
}
diff --git a/pkg/front_end/testcases/instantiate_to_bound/covariant_dependence_in_literals.dart.strong.expect b/pkg/front_end/testcases/instantiate_to_bound/covariant_dependence_in_literals.dart.strong.expect
index e2ae82b..c158c43 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/covariant_dependence_in_literals.dart.strong.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/covariant_dependence_in_literals.dart.strong.expect
@@ -2,27 +2,27 @@
import self as self;
import "dart:core" as core;
-class A<X extends core::Object> extends core::Object {
+class A<X extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class C<X extends core::Object, Y extends self::A<self::C::X>> extends core::Object {
+class C<X extends core::Object = dynamic, Y extends self::A<self::C::X> = self::A<dynamic>> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class D<X extends core::num, Y extends self::A<self::D::X>> extends core::Object {
+class D<X extends core::num = core::num, Y extends self::A<self::D::X> = self::A<core::num>> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class E<X extends core::Object, Y extends () → self::E::X> extends core::Object {
+class E<X extends core::Object = dynamic, Y extends () → self::E::X = () → dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class F<X extends core::num, Y extends () → self::F::X> extends core::Object {
+class F<X extends core::num = core::num, Y extends () → self::F::X = () → core::num> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/instantiate_to_bound/covariant_dependence_in_literals.dart.strong.transformed.expect b/pkg/front_end/testcases/instantiate_to_bound/covariant_dependence_in_literals.dart.strong.transformed.expect
index e2ae82b..c158c43 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/covariant_dependence_in_literals.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/covariant_dependence_in_literals.dart.strong.transformed.expect
@@ -2,27 +2,27 @@
import self as self;
import "dart:core" as core;
-class A<X extends core::Object> extends core::Object {
+class A<X extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class C<X extends core::Object, Y extends self::A<self::C::X>> extends core::Object {
+class C<X extends core::Object = dynamic, Y extends self::A<self::C::X> = self::A<dynamic>> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class D<X extends core::num, Y extends self::A<self::D::X>> extends core::Object {
+class D<X extends core::num = core::num, Y extends self::A<self::D::X> = self::A<core::num>> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class E<X extends core::Object, Y extends () → self::E::X> extends core::Object {
+class E<X extends core::Object = dynamic, Y extends () → self::E::X = () → dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class F<X extends core::num, Y extends () → self::F::X> extends core::Object {
+class F<X extends core::num = core::num, Y extends () → self::F::X = () → core::num> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/instantiate_to_bound/covariant_mutual_dependence.dart.direct.expect b/pkg/front_end/testcases/instantiate_to_bound/covariant_mutual_dependence.dart.direct.expect
index d6cc852..b4a02a0 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/covariant_mutual_dependence.dart.direct.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/covariant_mutual_dependence.dart.direct.expect
@@ -2,27 +2,27 @@
import self as self;
import "dart:core" as core;
-class B<X extends core::Object, Y extends core::Object> extends core::Object {
+class B<X extends core::Object = dynamic, Y extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class C<X extends core::Object, Y extends core::Object> extends core::Object {
+class C<X extends core::Object = dynamic, Y extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class D<X extends self::B<self::D::X, self::D::Y>, Y extends self::C<self::D::X, self::D::Y>> extends core::Object {
+class D<X extends self::B<self::D::X, self::D::Y> = dynamic, Y extends self::C<self::D::X, self::D::Y> = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class E<X extends self::B<self::E::X, self::E::Y>, Y extends () → self::E::X> extends core::Object {
+class E<X extends self::B<self::E::X, self::E::Y> = dynamic, Y extends () → self::E::X = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class F<X extends () → self::F::X> extends core::Object {
+class F<X extends () → self::F::X = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/instantiate_to_bound/covariant_mutual_dependence.dart.direct.transformed.expect b/pkg/front_end/testcases/instantiate_to_bound/covariant_mutual_dependence.dart.direct.transformed.expect
index d6cc852..b4a02a0 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/covariant_mutual_dependence.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/covariant_mutual_dependence.dart.direct.transformed.expect
@@ -2,27 +2,27 @@
import self as self;
import "dart:core" as core;
-class B<X extends core::Object, Y extends core::Object> extends core::Object {
+class B<X extends core::Object = dynamic, Y extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class C<X extends core::Object, Y extends core::Object> extends core::Object {
+class C<X extends core::Object = dynamic, Y extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class D<X extends self::B<self::D::X, self::D::Y>, Y extends self::C<self::D::X, self::D::Y>> extends core::Object {
+class D<X extends self::B<self::D::X, self::D::Y> = dynamic, Y extends self::C<self::D::X, self::D::Y> = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class E<X extends self::B<self::E::X, self::E::Y>, Y extends () → self::E::X> extends core::Object {
+class E<X extends self::B<self::E::X, self::E::Y> = dynamic, Y extends () → self::E::X = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class F<X extends () → self::F::X> extends core::Object {
+class F<X extends () → self::F::X = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/instantiate_to_bound/covariant_mutual_dependence.dart.outline.expect b/pkg/front_end/testcases/instantiate_to_bound/covariant_mutual_dependence.dart.outline.expect
index cd39a20..11e2058 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/covariant_mutual_dependence.dart.outline.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/covariant_mutual_dependence.dart.outline.expect
@@ -2,23 +2,23 @@
import self as self;
import "dart:core" as core;
-class B<X extends core::Object, Y extends core::Object> extends core::Object {
+class B<X extends core::Object = dynamic, Y extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
;
}
-class C<X extends core::Object, Y extends core::Object> extends core::Object {
+class C<X extends core::Object = dynamic, Y extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
;
}
-class D<X extends self::B<self::D::X, self::D::Y>, Y extends self::C<self::D::X, self::D::Y>> extends core::Object {
+class D<X extends self::B<self::D::X, self::D::Y> = dynamic, Y extends self::C<self::D::X, self::D::Y> = dynamic> extends core::Object {
synthetic constructor •() → void
;
}
-class E<X extends self::B<self::E::X, self::E::Y>, Y extends () → self::E::X> extends core::Object {
+class E<X extends self::B<self::E::X, self::E::Y> = dynamic, Y extends () → self::E::X = dynamic> extends core::Object {
synthetic constructor •() → void
;
}
-class F<X extends () → self::F::X> extends core::Object {
+class F<X extends () → self::F::X = dynamic> extends core::Object {
synthetic constructor •() → void
;
}
diff --git a/pkg/front_end/testcases/instantiate_to_bound/covariant_mutual_dependence.dart.strong.expect b/pkg/front_end/testcases/instantiate_to_bound/covariant_mutual_dependence.dart.strong.expect
index 1ebe886..ef9bb81 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/covariant_mutual_dependence.dart.strong.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/covariant_mutual_dependence.dart.strong.expect
@@ -2,27 +2,27 @@
import self as self;
import "dart:core" as core;
-class B<X extends core::Object, Y extends core::Object> extends core::Object {
+class B<X extends core::Object = dynamic, Y extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class C<X extends core::Object, Y extends core::Object> extends core::Object {
+class C<X extends core::Object = dynamic, Y extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class D<X extends self::B<self::D::X, self::D::Y>, Y extends self::C<self::D::X, self::D::Y>> extends core::Object {
+class D<X extends self::B<self::D::X, self::D::Y> = self::B<dynamic, dynamic>, Y extends self::C<self::D::X, self::D::Y> = self::C<dynamic, dynamic>> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class E<X extends self::B<self::E::X, self::E::Y>, Y extends () → self::E::X> extends core::Object {
+class E<X extends self::B<self::E::X, self::E::Y> = self::B<dynamic, dynamic>, Y extends () → self::E::X = () → dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class F<X extends () → self::F::X> extends core::Object {
+class F<X extends () → self::F::X = () → dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/instantiate_to_bound/covariant_mutual_dependence.dart.strong.transformed.expect b/pkg/front_end/testcases/instantiate_to_bound/covariant_mutual_dependence.dart.strong.transformed.expect
index 1ebe886..ef9bb81 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/covariant_mutual_dependence.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/covariant_mutual_dependence.dart.strong.transformed.expect
@@ -2,27 +2,27 @@
import self as self;
import "dart:core" as core;
-class B<X extends core::Object, Y extends core::Object> extends core::Object {
+class B<X extends core::Object = dynamic, Y extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class C<X extends core::Object, Y extends core::Object> extends core::Object {
+class C<X extends core::Object = dynamic, Y extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class D<X extends self::B<self::D::X, self::D::Y>, Y extends self::C<self::D::X, self::D::Y>> extends core::Object {
+class D<X extends self::B<self::D::X, self::D::Y> = self::B<dynamic, dynamic>, Y extends self::C<self::D::X, self::D::Y> = self::C<dynamic, dynamic>> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class E<X extends self::B<self::E::X, self::E::Y>, Y extends () → self::E::X> extends core::Object {
+class E<X extends self::B<self::E::X, self::E::Y> = self::B<dynamic, dynamic>, Y extends () → self::E::X = () → dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class F<X extends () → self::F::X> extends core::Object {
+class F<X extends () → self::F::X = () → dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/instantiate_to_bound/covariant_mutual_dependence_in_literals.dart.direct.expect b/pkg/front_end/testcases/instantiate_to_bound/covariant_mutual_dependence_in_literals.dart.direct.expect
index bc1bfe2..30cbae9 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/covariant_mutual_dependence_in_literals.dart.direct.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/covariant_mutual_dependence_in_literals.dart.direct.expect
@@ -2,27 +2,27 @@
import self as self;
import "dart:core" as core;
-class B<X extends core::Object, Y extends core::Object> extends core::Object {
+class B<X extends core::Object = dynamic, Y extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class C<X extends core::Object, Y extends core::Object> extends core::Object {
+class C<X extends core::Object = dynamic, Y extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class D<X extends self::B<self::D::X, self::D::Y>, Y extends self::C<self::D::X, self::D::Y>> extends core::Object {
+class D<X extends self::B<self::D::X, self::D::Y> = dynamic, Y extends self::C<self::D::X, self::D::Y> = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class E<X extends self::B<self::E::X, self::E::Y>, Y extends () → self::E::X> extends core::Object {
+class E<X extends self::B<self::E::X, self::E::Y> = dynamic, Y extends () → self::E::X = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class F<X extends () → self::F::X> extends core::Object {
+class F<X extends () → self::F::X = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/instantiate_to_bound/covariant_mutual_dependence_in_literals.dart.direct.transformed.expect b/pkg/front_end/testcases/instantiate_to_bound/covariant_mutual_dependence_in_literals.dart.direct.transformed.expect
index bc1bfe2..30cbae9 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/covariant_mutual_dependence_in_literals.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/covariant_mutual_dependence_in_literals.dart.direct.transformed.expect
@@ -2,27 +2,27 @@
import self as self;
import "dart:core" as core;
-class B<X extends core::Object, Y extends core::Object> extends core::Object {
+class B<X extends core::Object = dynamic, Y extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class C<X extends core::Object, Y extends core::Object> extends core::Object {
+class C<X extends core::Object = dynamic, Y extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class D<X extends self::B<self::D::X, self::D::Y>, Y extends self::C<self::D::X, self::D::Y>> extends core::Object {
+class D<X extends self::B<self::D::X, self::D::Y> = dynamic, Y extends self::C<self::D::X, self::D::Y> = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class E<X extends self::B<self::E::X, self::E::Y>, Y extends () → self::E::X> extends core::Object {
+class E<X extends self::B<self::E::X, self::E::Y> = dynamic, Y extends () → self::E::X = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class F<X extends () → self::F::X> extends core::Object {
+class F<X extends () → self::F::X = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/instantiate_to_bound/covariant_mutual_dependence_in_literals.dart.outline.expect b/pkg/front_end/testcases/instantiate_to_bound/covariant_mutual_dependence_in_literals.dart.outline.expect
index fb41cb5..9cd5b0b 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/covariant_mutual_dependence_in_literals.dart.outline.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/covariant_mutual_dependence_in_literals.dart.outline.expect
@@ -2,23 +2,23 @@
import self as self;
import "dart:core" as core;
-class B<X extends core::Object, Y extends core::Object> extends core::Object {
+class B<X extends core::Object = dynamic, Y extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
;
}
-class C<X extends core::Object, Y extends core::Object> extends core::Object {
+class C<X extends core::Object = dynamic, Y extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
;
}
-class D<X extends self::B<self::D::X, self::D::Y>, Y extends self::C<self::D::X, self::D::Y>> extends core::Object {
+class D<X extends self::B<self::D::X, self::D::Y> = dynamic, Y extends self::C<self::D::X, self::D::Y> = dynamic> extends core::Object {
synthetic constructor •() → void
;
}
-class E<X extends self::B<self::E::X, self::E::Y>, Y extends () → self::E::X> extends core::Object {
+class E<X extends self::B<self::E::X, self::E::Y> = dynamic, Y extends () → self::E::X = dynamic> extends core::Object {
synthetic constructor •() → void
;
}
-class F<X extends () → self::F::X> extends core::Object {
+class F<X extends () → self::F::X = dynamic> extends core::Object {
synthetic constructor •() → void
;
}
diff --git a/pkg/front_end/testcases/instantiate_to_bound/covariant_mutual_dependence_in_literals.dart.strong.expect b/pkg/front_end/testcases/instantiate_to_bound/covariant_mutual_dependence_in_literals.dart.strong.expect
index 5dd347a..9579477 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/covariant_mutual_dependence_in_literals.dart.strong.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/covariant_mutual_dependence_in_literals.dart.strong.expect
@@ -2,27 +2,27 @@
import self as self;
import "dart:core" as core;
-class B<X extends core::Object, Y extends core::Object> extends core::Object {
+class B<X extends core::Object = dynamic, Y extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class C<X extends core::Object, Y extends core::Object> extends core::Object {
+class C<X extends core::Object = dynamic, Y extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class D<X extends self::B<self::D::X, self::D::Y>, Y extends self::C<self::D::X, self::D::Y>> extends core::Object {
+class D<X extends self::B<self::D::X, self::D::Y> = self::B<dynamic, dynamic>, Y extends self::C<self::D::X, self::D::Y> = self::C<dynamic, dynamic>> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class E<X extends self::B<self::E::X, self::E::Y>, Y extends () → self::E::X> extends core::Object {
+class E<X extends self::B<self::E::X, self::E::Y> = self::B<dynamic, dynamic>, Y extends () → self::E::X = () → dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class F<X extends () → self::F::X> extends core::Object {
+class F<X extends () → self::F::X = () → dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/instantiate_to_bound/covariant_mutual_dependence_in_literals.dart.strong.transformed.expect b/pkg/front_end/testcases/instantiate_to_bound/covariant_mutual_dependence_in_literals.dart.strong.transformed.expect
index 5dd347a..9579477 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/covariant_mutual_dependence_in_literals.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/covariant_mutual_dependence_in_literals.dart.strong.transformed.expect
@@ -2,27 +2,27 @@
import self as self;
import "dart:core" as core;
-class B<X extends core::Object, Y extends core::Object> extends core::Object {
+class B<X extends core::Object = dynamic, Y extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class C<X extends core::Object, Y extends core::Object> extends core::Object {
+class C<X extends core::Object = dynamic, Y extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class D<X extends self::B<self::D::X, self::D::Y>, Y extends self::C<self::D::X, self::D::Y>> extends core::Object {
+class D<X extends self::B<self::D::X, self::D::Y> = self::B<dynamic, dynamic>, Y extends self::C<self::D::X, self::D::Y> = self::C<dynamic, dynamic>> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class E<X extends self::B<self::E::X, self::E::Y>, Y extends () → self::E::X> extends core::Object {
+class E<X extends self::B<self::E::X, self::E::Y> = self::B<dynamic, dynamic>, Y extends () → self::E::X = () → dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class F<X extends () → self::F::X> extends core::Object {
+class F<X extends () → self::F::X = () → dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/instantiate_to_bound/dependence.dart.direct.expect b/pkg/front_end/testcases/instantiate_to_bound/dependence.dart.direct.expect
index 50c5cd5..8a75651 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/dependence.dart.direct.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/dependence.dart.direct.expect
@@ -2,17 +2,17 @@
import self as self;
import "dart:core" as core;
-class A<X extends core::Object> extends core::Object {
+class A<X extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class C<X extends core::Object, Y extends (self::C::X) → self::C::X> extends core::Object {
+class C<X extends core::Object = dynamic, Y extends (self::C::X) → self::C::X = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class D<X extends core::num, Y extends (self::D::X) → self::D::X> extends core::Object {
+class D<X extends core::num = dynamic, Y extends (self::D::X) → self::D::X = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/instantiate_to_bound/dependence.dart.direct.transformed.expect b/pkg/front_end/testcases/instantiate_to_bound/dependence.dart.direct.transformed.expect
index 50c5cd5..8a75651 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/dependence.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/dependence.dart.direct.transformed.expect
@@ -2,17 +2,17 @@
import self as self;
import "dart:core" as core;
-class A<X extends core::Object> extends core::Object {
+class A<X extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class C<X extends core::Object, Y extends (self::C::X) → self::C::X> extends core::Object {
+class C<X extends core::Object = dynamic, Y extends (self::C::X) → self::C::X = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class D<X extends core::num, Y extends (self::D::X) → self::D::X> extends core::Object {
+class D<X extends core::num = dynamic, Y extends (self::D::X) → self::D::X = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/instantiate_to_bound/dependence.dart.outline.expect b/pkg/front_end/testcases/instantiate_to_bound/dependence.dart.outline.expect
index 3bfdc8a..830d760 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/dependence.dart.outline.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/dependence.dart.outline.expect
@@ -2,15 +2,15 @@
import self as self;
import "dart:core" as core;
-class A<X extends core::Object> extends core::Object {
+class A<X extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
;
}
-class C<X extends core::Object, Y extends (self::C::X) → self::C::X> extends core::Object {
+class C<X extends core::Object = dynamic, Y extends (self::C::X) → self::C::X = dynamic> extends core::Object {
synthetic constructor •() → void
;
}
-class D<X extends core::num, Y extends (self::D::X) → self::D::X> extends core::Object {
+class D<X extends core::num = dynamic, Y extends (self::D::X) → self::D::X = dynamic> extends core::Object {
synthetic constructor •() → void
;
}
diff --git a/pkg/front_end/testcases/instantiate_to_bound/dependence.dart.strong.expect b/pkg/front_end/testcases/instantiate_to_bound/dependence.dart.strong.expect
index 5e74c50..b12947d 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/dependence.dart.strong.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/dependence.dart.strong.expect
@@ -2,17 +2,17 @@
import self as self;
import "dart:core" as core;
-class A<X extends core::Object> extends core::Object {
+class A<X extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class C<X extends core::Object, Y extends (self::C::X) → self::C::X> extends core::Object {
+class C<X extends core::Object = dynamic, Y extends (self::C::X) → self::C::X = (core::Null) → dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class D<X extends core::num, Y extends (self::D::X) → self::D::X> extends core::Object {
+class D<X extends core::num = core::num, Y extends (self::D::X) → self::D::X = (core::Null) → core::num> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/instantiate_to_bound/dependence.dart.strong.transformed.expect b/pkg/front_end/testcases/instantiate_to_bound/dependence.dart.strong.transformed.expect
index 5e74c50..b12947d 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/dependence.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/dependence.dart.strong.transformed.expect
@@ -2,17 +2,17 @@
import self as self;
import "dart:core" as core;
-class A<X extends core::Object> extends core::Object {
+class A<X extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class C<X extends core::Object, Y extends (self::C::X) → self::C::X> extends core::Object {
+class C<X extends core::Object = dynamic, Y extends (self::C::X) → self::C::X = (core::Null) → dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class D<X extends core::num, Y extends (self::D::X) → self::D::X> extends core::Object {
+class D<X extends core::num = core::num, Y extends (self::D::X) → self::D::X = (core::Null) → core::num> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/instantiate_to_bound/dependence_in_literals.dart.direct.expect b/pkg/front_end/testcases/instantiate_to_bound/dependence_in_literals.dart.direct.expect
index 3d63194..a5b5d59 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/dependence_in_literals.dart.direct.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/dependence_in_literals.dart.direct.expect
@@ -2,17 +2,17 @@
import self as self;
import "dart:core" as core;
-class A<X extends core::Object> extends core::Object {
+class A<X extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class C<X extends core::Object, Y extends (self::C::X) → self::C::X> extends core::Object {
+class C<X extends core::Object = dynamic, Y extends (self::C::X) → self::C::X = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class D<X extends core::num, Y extends (self::D::X) → self::D::X> extends core::Object {
+class D<X extends core::num = dynamic, Y extends (self::D::X) → self::D::X = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/instantiate_to_bound/dependence_in_literals.dart.direct.transformed.expect b/pkg/front_end/testcases/instantiate_to_bound/dependence_in_literals.dart.direct.transformed.expect
index 3d63194..a5b5d59 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/dependence_in_literals.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/dependence_in_literals.dart.direct.transformed.expect
@@ -2,17 +2,17 @@
import self as self;
import "dart:core" as core;
-class A<X extends core::Object> extends core::Object {
+class A<X extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class C<X extends core::Object, Y extends (self::C::X) → self::C::X> extends core::Object {
+class C<X extends core::Object = dynamic, Y extends (self::C::X) → self::C::X = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class D<X extends core::num, Y extends (self::D::X) → self::D::X> extends core::Object {
+class D<X extends core::num = dynamic, Y extends (self::D::X) → self::D::X = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/instantiate_to_bound/dependence_in_literals.dart.outline.expect b/pkg/front_end/testcases/instantiate_to_bound/dependence_in_literals.dart.outline.expect
index 20f0f48..dbc3047 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/dependence_in_literals.dart.outline.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/dependence_in_literals.dart.outline.expect
@@ -2,15 +2,15 @@
import self as self;
import "dart:core" as core;
-class A<X extends core::Object> extends core::Object {
+class A<X extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
;
}
-class C<X extends core::Object, Y extends (self::C::X) → self::C::X> extends core::Object {
+class C<X extends core::Object = dynamic, Y extends (self::C::X) → self::C::X = dynamic> extends core::Object {
synthetic constructor •() → void
;
}
-class D<X extends core::num, Y extends (self::D::X) → self::D::X> extends core::Object {
+class D<X extends core::num = dynamic, Y extends (self::D::X) → self::D::X = dynamic> extends core::Object {
synthetic constructor •() → void
;
}
diff --git a/pkg/front_end/testcases/instantiate_to_bound/dependence_in_literals.dart.strong.expect b/pkg/front_end/testcases/instantiate_to_bound/dependence_in_literals.dart.strong.expect
index 454cf25..2e7c48b 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/dependence_in_literals.dart.strong.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/dependence_in_literals.dart.strong.expect
@@ -2,17 +2,17 @@
import self as self;
import "dart:core" as core;
-class A<X extends core::Object> extends core::Object {
+class A<X extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class C<X extends core::Object, Y extends (self::C::X) → self::C::X> extends core::Object {
+class C<X extends core::Object = dynamic, Y extends (self::C::X) → self::C::X = (core::Null) → dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class D<X extends core::num, Y extends (self::D::X) → self::D::X> extends core::Object {
+class D<X extends core::num = core::num, Y extends (self::D::X) → self::D::X = (core::Null) → core::num> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/instantiate_to_bound/dependence_in_literals.dart.strong.transformed.expect b/pkg/front_end/testcases/instantiate_to_bound/dependence_in_literals.dart.strong.transformed.expect
index 454cf25..2e7c48b 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/dependence_in_literals.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/dependence_in_literals.dart.strong.transformed.expect
@@ -2,17 +2,17 @@
import self as self;
import "dart:core" as core;
-class A<X extends core::Object> extends core::Object {
+class A<X extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class C<X extends core::Object, Y extends (self::C::X) → self::C::X> extends core::Object {
+class C<X extends core::Object = dynamic, Y extends (self::C::X) → self::C::X = (core::Null) → dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class D<X extends core::num, Y extends (self::D::X) → self::D::X> extends core::Object {
+class D<X extends core::num = core::num, Y extends (self::D::X) → self::D::X = (core::Null) → core::num> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/instantiate_to_bound/generic_classes_from_dill.dart.direct.expect b/pkg/front_end/testcases/instantiate_to_bound/generic_classes_from_dill.dart.direct.expect
index 2a54655..a3c9999 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/generic_classes_from_dill.dart.direct.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/generic_classes_from_dill.dart.direct.expect
@@ -2,5 +2,5 @@
import self as self;
import "dart:collection" as col;
-static field col::LinkedListEntry<col::LinkedListEntry<dynamic>> y;
+static field col::LinkedListEntry<dynamic> y;
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/instantiate_to_bound/generic_classes_from_dill.dart.direct.transformed.expect b/pkg/front_end/testcases/instantiate_to_bound/generic_classes_from_dill.dart.direct.transformed.expect
index 2a54655..a3c9999 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/generic_classes_from_dill.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/generic_classes_from_dill.dart.direct.transformed.expect
@@ -2,5 +2,5 @@
import self as self;
import "dart:collection" as col;
-static field col::LinkedListEntry<col::LinkedListEntry<dynamic>> y;
+static field col::LinkedListEntry<dynamic> y;
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/instantiate_to_bound/generic_classes_from_dill.dart.outline.expect b/pkg/front_end/testcases/instantiate_to_bound/generic_classes_from_dill.dart.outline.expect
index e9f3933..de12238 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/generic_classes_from_dill.dart.outline.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/generic_classes_from_dill.dart.outline.expect
@@ -2,6 +2,6 @@
import self as self;
import "dart:collection" as col;
-static field col::LinkedListEntry<col::LinkedListEntry<dynamic>> y;
+static field col::LinkedListEntry<dynamic> y;
static method main() → dynamic
;
diff --git a/pkg/front_end/testcases/instantiate_to_bound/inference_constrained_by_bound.dart.direct.expect b/pkg/front_end/testcases/instantiate_to_bound/inference_constrained_by_bound.dart.direct.expect
index a268770..8ab5904 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/inference_constrained_by_bound.dart.direct.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/inference_constrained_by_bound.dart.direct.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class A<T extends core::num> extends core::Object {
+class A<T extends core::num = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/instantiate_to_bound/inference_constrained_by_bound.dart.direct.transformed.expect b/pkg/front_end/testcases/instantiate_to_bound/inference_constrained_by_bound.dart.direct.transformed.expect
index a268770..8ab5904 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/inference_constrained_by_bound.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/inference_constrained_by_bound.dart.direct.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class A<T extends core::num> extends core::Object {
+class A<T extends core::num = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/instantiate_to_bound/inference_constrained_by_bound.dart.outline.expect b/pkg/front_end/testcases/instantiate_to_bound/inference_constrained_by_bound.dart.outline.expect
index 4bea4fc..1cc5b2f 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/inference_constrained_by_bound.dart.outline.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/inference_constrained_by_bound.dart.outline.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class A<T extends core::num> extends core::Object {
+class A<T extends core::num = dynamic> extends core::Object {
synthetic constructor •() → void
;
}
diff --git a/pkg/front_end/testcases/instantiate_to_bound/inference_constrained_by_bound.dart.strong.expect b/pkg/front_end/testcases/instantiate_to_bound/inference_constrained_by_bound.dart.strong.expect
index b63980f..73b735f 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/inference_constrained_by_bound.dart.strong.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/inference_constrained_by_bound.dart.strong.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class A<T extends core::num> extends core::Object {
+class A<T extends core::num = core::num> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/instantiate_to_bound/inference_constrained_by_bound.dart.strong.transformed.expect b/pkg/front_end/testcases/instantiate_to_bound/inference_constrained_by_bound.dart.strong.transformed.expect
index b63980f..73b735f 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/inference_constrained_by_bound.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/inference_constrained_by_bound.dart.strong.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class A<T extends core::num> extends core::Object {
+class A<T extends core::num = core::num> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/instantiate_to_bound/inference_defaults_to_bound.dart.direct.expect b/pkg/front_end/testcases/instantiate_to_bound/inference_defaults_to_bound.dart.direct.expect
index 7d9fe60..27905d6 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/inference_defaults_to_bound.dart.direct.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/inference_defaults_to_bound.dart.direct.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class A<T extends core::num> extends core::Object {
+class A<T extends core::num = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/instantiate_to_bound/inference_defaults_to_bound.dart.direct.transformed.expect b/pkg/front_end/testcases/instantiate_to_bound/inference_defaults_to_bound.dart.direct.transformed.expect
index 7d9fe60..27905d6 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/inference_defaults_to_bound.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/inference_defaults_to_bound.dart.direct.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class A<T extends core::num> extends core::Object {
+class A<T extends core::num = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/instantiate_to_bound/inference_defaults_to_bound.dart.outline.expect b/pkg/front_end/testcases/instantiate_to_bound/inference_defaults_to_bound.dart.outline.expect
index 4bea4fc..1cc5b2f 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/inference_defaults_to_bound.dart.outline.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/inference_defaults_to_bound.dart.outline.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class A<T extends core::num> extends core::Object {
+class A<T extends core::num = dynamic> extends core::Object {
synthetic constructor •() → void
;
}
diff --git a/pkg/front_end/testcases/instantiate_to_bound/inference_defaults_to_bound.dart.strong.expect b/pkg/front_end/testcases/instantiate_to_bound/inference_defaults_to_bound.dart.strong.expect
index bf8ac07..122f608 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/inference_defaults_to_bound.dart.strong.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/inference_defaults_to_bound.dart.strong.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class A<T extends core::num> extends core::Object {
+class A<T extends core::num = core::num> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/instantiate_to_bound/inference_defaults_to_bound.dart.strong.transformed.expect b/pkg/front_end/testcases/instantiate_to_bound/inference_defaults_to_bound.dart.strong.transformed.expect
index bf8ac07..122f608 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/inference_defaults_to_bound.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/inference_defaults_to_bound.dart.strong.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class A<T extends core::num> extends core::Object {
+class A<T extends core::num = core::num> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/instantiate_to_bound/inference_gives_input.dart.direct.expect b/pkg/front_end/testcases/instantiate_to_bound/inference_gives_input.dart.direct.expect
index 964c2f9..5072d9a 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/inference_gives_input.dart.direct.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/inference_gives_input.dart.direct.expect
@@ -2,12 +2,12 @@
import self as self;
import "dart:core" as core;
-class A<T extends core::Object> extends core::Object {
+class A<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class B<T extends core::num, S extends core::List<self::B::T>> extends self::A<self::B::T> {
+class B<T extends core::num = dynamic, S extends core::List<self::B::T> = dynamic> extends self::A<self::B::T> {
constructor •([self::B::T x = null]) → void
: super self::A::•() {}
}
diff --git a/pkg/front_end/testcases/instantiate_to_bound/inference_gives_input.dart.direct.transformed.expect b/pkg/front_end/testcases/instantiate_to_bound/inference_gives_input.dart.direct.transformed.expect
index 964c2f9..5072d9a 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/inference_gives_input.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/inference_gives_input.dart.direct.transformed.expect
@@ -2,12 +2,12 @@
import self as self;
import "dart:core" as core;
-class A<T extends core::Object> extends core::Object {
+class A<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class B<T extends core::num, S extends core::List<self::B::T>> extends self::A<self::B::T> {
+class B<T extends core::num = dynamic, S extends core::List<self::B::T> = dynamic> extends self::A<self::B::T> {
constructor •([self::B::T x = null]) → void
: super self::A::•() {}
}
diff --git a/pkg/front_end/testcases/instantiate_to_bound/inference_gives_input.dart.outline.expect b/pkg/front_end/testcases/instantiate_to_bound/inference_gives_input.dart.outline.expect
index feaa0f3..25e2d3a 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/inference_gives_input.dart.outline.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/inference_gives_input.dart.outline.expect
@@ -2,11 +2,11 @@
import self as self;
import "dart:core" as core;
-class A<T extends core::Object> extends core::Object {
+class A<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
;
}
-class B<T extends core::num, S extends core::List<self::B::T>> extends self::A<self::B::T> {
+class B<T extends core::num = dynamic, S extends core::List<self::B::T> = dynamic> extends self::A<self::B::T> {
constructor •([self::B::T x]) → void
;
}
diff --git a/pkg/front_end/testcases/instantiate_to_bound/inference_gives_input.dart.strong.expect b/pkg/front_end/testcases/instantiate_to_bound/inference_gives_input.dart.strong.expect
index cf6dc06..2851c1c 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/inference_gives_input.dart.strong.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/inference_gives_input.dart.strong.expect
@@ -2,12 +2,12 @@
import self as self;
import "dart:core" as core;
-class A<T extends core::Object> extends core::Object {
+class A<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class B<T extends core::num, S extends core::List<self::B::T>> extends self::A<self::B::T> {
+class B<T extends core::num = core::num, S extends core::List<self::B::T> = core::List<core::num>> extends self::A<self::B::T> {
constructor •([self::B::T x = null]) → void
: super self::A::•() {}
}
diff --git a/pkg/front_end/testcases/instantiate_to_bound/inference_gives_input.dart.strong.transformed.expect b/pkg/front_end/testcases/instantiate_to_bound/inference_gives_input.dart.strong.transformed.expect
index cf6dc06..2851c1c 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/inference_gives_input.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/inference_gives_input.dart.strong.transformed.expect
@@ -2,12 +2,12 @@
import self as self;
import "dart:core" as core;
-class A<T extends core::Object> extends core::Object {
+class A<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class B<T extends core::num, S extends core::List<self::B::T>> extends self::A<self::B::T> {
+class B<T extends core::num = core::num, S extends core::List<self::B::T> = core::List<core::num>> extends self::A<self::B::T> {
constructor •([self::B::T x = null]) → void
: super self::A::•() {}
}
diff --git a/pkg/front_end/testcases/instantiate_to_bound/inference_super_bounded_rejected.dart.direct.expect b/pkg/front_end/testcases/instantiate_to_bound/inference_super_bounded_rejected.dart.direct.expect
index b7dd39e..7c07c34 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/inference_super_bounded_rejected.dart.direct.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/inference_super_bounded_rejected.dart.direct.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class B<T extends core::Comparable<self::B::T>> extends core::Object {
+class B<T extends core::Comparable<self::B::T> = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/instantiate_to_bound/inference_super_bounded_rejected.dart.direct.transformed.expect b/pkg/front_end/testcases/instantiate_to_bound/inference_super_bounded_rejected.dart.direct.transformed.expect
index b7dd39e..7c07c34 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/inference_super_bounded_rejected.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/inference_super_bounded_rejected.dart.direct.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class B<T extends core::Comparable<self::B::T>> extends core::Object {
+class B<T extends core::Comparable<self::B::T> = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/instantiate_to_bound/inference_super_bounded_rejected.dart.outline.expect b/pkg/front_end/testcases/instantiate_to_bound/inference_super_bounded_rejected.dart.outline.expect
index 50dad2d..99fed4d 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/inference_super_bounded_rejected.dart.outline.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/inference_super_bounded_rejected.dart.outline.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class B<T extends core::Comparable<self::B::T>> extends core::Object {
+class B<T extends core::Comparable<self::B::T> = dynamic> extends core::Object {
synthetic constructor •() → void
;
}
diff --git a/pkg/front_end/testcases/instantiate_to_bound/inference_super_bounded_rejected.dart.strong.expect b/pkg/front_end/testcases/instantiate_to_bound/inference_super_bounded_rejected.dart.strong.expect
index c3b6891..893b908 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/inference_super_bounded_rejected.dart.strong.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/inference_super_bounded_rejected.dart.strong.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class B<T extends core::Comparable<self::B::T>> extends core::Object {
+class B<T extends core::Comparable<self::B::T> = core::Comparable<dynamic>> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/instantiate_to_bound/inference_super_bounded_rejected.dart.strong.transformed.expect b/pkg/front_end/testcases/instantiate_to_bound/inference_super_bounded_rejected.dart.strong.transformed.expect
index c3b6891..893b908 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/inference_super_bounded_rejected.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/inference_super_bounded_rejected.dart.strong.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class B<T extends core::Comparable<self::B::T>> extends core::Object {
+class B<T extends core::Comparable<self::B::T> = core::Comparable<dynamic>> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/instantiate_to_bound/instantiated_in_outline.dart.direct.expect b/pkg/front_end/testcases/instantiate_to_bound/instantiated_in_outline.dart.direct.expect
index f455106..7e7802f 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/instantiated_in_outline.dart.direct.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/instantiated_in_outline.dart.direct.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class A<T extends core::num> extends core::Object {
+class A<T extends core::num = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/instantiate_to_bound/instantiated_in_outline.dart.direct.transformed.expect b/pkg/front_end/testcases/instantiate_to_bound/instantiated_in_outline.dart.direct.transformed.expect
index f455106..7e7802f 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/instantiated_in_outline.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/instantiated_in_outline.dart.direct.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class A<T extends core::num> extends core::Object {
+class A<T extends core::num = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/instantiate_to_bound/instantiated_in_outline.dart.outline.expect b/pkg/front_end/testcases/instantiate_to_bound/instantiated_in_outline.dart.outline.expect
index 792d380..8d47cf3 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/instantiated_in_outline.dart.outline.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/instantiated_in_outline.dart.outline.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class A<T extends core::num> extends core::Object {
+class A<T extends core::num = dynamic> extends core::Object {
synthetic constructor •() → void
;
}
diff --git a/pkg/front_end/testcases/instantiate_to_bound/instantiated_in_outline.dart.strong.expect b/pkg/front_end/testcases/instantiate_to_bound/instantiated_in_outline.dart.strong.expect
index 8b8b879..2dbd3fa 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/instantiated_in_outline.dart.strong.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/instantiated_in_outline.dart.strong.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class A<T extends core::num> extends core::Object {
+class A<T extends core::num = core::num> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/instantiate_to_bound/instantiated_in_outline.dart.strong.transformed.expect b/pkg/front_end/testcases/instantiate_to_bound/instantiated_in_outline.dart.strong.transformed.expect
index 8b8b879..2dbd3fa 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/instantiated_in_outline.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/instantiated_in_outline.dart.strong.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class A<T extends core::num> extends core::Object {
+class A<T extends core::num = core::num> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/instantiate_to_bound/literal_list.dart.direct.expect b/pkg/front_end/testcases/instantiate_to_bound/literal_list.dart.direct.expect
index 4d4eb3a..752d9aa 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/literal_list.dart.direct.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/literal_list.dart.direct.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class A<T extends core::num> extends core::Object {
+class A<T extends core::num = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/instantiate_to_bound/literal_list.dart.direct.transformed.expect b/pkg/front_end/testcases/instantiate_to_bound/literal_list.dart.direct.transformed.expect
index 4d4eb3a..752d9aa 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/literal_list.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/literal_list.dart.direct.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class A<T extends core::num> extends core::Object {
+class A<T extends core::num = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/instantiate_to_bound/literal_list.dart.outline.expect b/pkg/front_end/testcases/instantiate_to_bound/literal_list.dart.outline.expect
index 303959e..b6268f4 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/literal_list.dart.outline.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/literal_list.dart.outline.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class A<T extends core::num> extends core::Object {
+class A<T extends core::num = dynamic> extends core::Object {
synthetic constructor •() → void
;
}
diff --git a/pkg/front_end/testcases/instantiate_to_bound/literal_list.dart.strong.expect b/pkg/front_end/testcases/instantiate_to_bound/literal_list.dart.strong.expect
index e031824..bae54a3 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/literal_list.dart.strong.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/literal_list.dart.strong.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class A<T extends core::num> extends core::Object {
+class A<T extends core::num = core::num> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/instantiate_to_bound/literal_list.dart.strong.transformed.expect b/pkg/front_end/testcases/instantiate_to_bound/literal_list.dart.strong.transformed.expect
index e031824..bae54a3 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/literal_list.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/literal_list.dart.strong.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class A<T extends core::num> extends core::Object {
+class A<T extends core::num = core::num> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/instantiate_to_bound/literal_list_with_generic_argument.dart.direct.expect b/pkg/front_end/testcases/instantiate_to_bound/literal_list_with_generic_argument.dart.direct.expect
index 7c0008d..513f483 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/literal_list_with_generic_argument.dart.direct.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/literal_list_with_generic_argument.dart.direct.expect
@@ -2,12 +2,12 @@
import self as self;
import "dart:core" as core;
-class A<T extends core::Object> extends core::Object {
+class A<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class B<S extends core::Object> extends core::Object {
+class B<S extends core::Object = dynamic> extends core::Object {
final field core::List<self::A<self::B::S>> foo = <self::A<self::B::S>>[];
final field core::List<self::A<core::num>> bar = <self::A<core::num>>[];
synthetic constructor •() → void
diff --git a/pkg/front_end/testcases/instantiate_to_bound/literal_list_with_generic_argument.dart.direct.transformed.expect b/pkg/front_end/testcases/instantiate_to_bound/literal_list_with_generic_argument.dart.direct.transformed.expect
index 7c0008d..513f483 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/literal_list_with_generic_argument.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/literal_list_with_generic_argument.dart.direct.transformed.expect
@@ -2,12 +2,12 @@
import self as self;
import "dart:core" as core;
-class A<T extends core::Object> extends core::Object {
+class A<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class B<S extends core::Object> extends core::Object {
+class B<S extends core::Object = dynamic> extends core::Object {
final field core::List<self::A<self::B::S>> foo = <self::A<self::B::S>>[];
final field core::List<self::A<core::num>> bar = <self::A<core::num>>[];
synthetic constructor •() → void
diff --git a/pkg/front_end/testcases/instantiate_to_bound/literal_list_with_generic_argument.dart.outline.expect b/pkg/front_end/testcases/instantiate_to_bound/literal_list_with_generic_argument.dart.outline.expect
index 30f1130..c839345 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/literal_list_with_generic_argument.dart.outline.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/literal_list_with_generic_argument.dart.outline.expect
@@ -2,11 +2,11 @@
import self as self;
import "dart:core" as core;
-class A<T extends core::Object> extends core::Object {
+class A<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
;
}
-class B<S extends core::Object> extends core::Object {
+class B<S extends core::Object = dynamic> extends core::Object {
final field core::List<self::A<self::B::S>> foo;
final field core::List<self::A<core::num>> bar;
synthetic constructor •() → void
diff --git a/pkg/front_end/testcases/instantiate_to_bound/literal_list_with_generic_argument.dart.strong.expect b/pkg/front_end/testcases/instantiate_to_bound/literal_list_with_generic_argument.dart.strong.expect
index 7c0008d..513f483 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/literal_list_with_generic_argument.dart.strong.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/literal_list_with_generic_argument.dart.strong.expect
@@ -2,12 +2,12 @@
import self as self;
import "dart:core" as core;
-class A<T extends core::Object> extends core::Object {
+class A<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class B<S extends core::Object> extends core::Object {
+class B<S extends core::Object = dynamic> extends core::Object {
final field core::List<self::A<self::B::S>> foo = <self::A<self::B::S>>[];
final field core::List<self::A<core::num>> bar = <self::A<core::num>>[];
synthetic constructor •() → void
diff --git a/pkg/front_end/testcases/instantiate_to_bound/literal_list_with_generic_argument.dart.strong.transformed.expect b/pkg/front_end/testcases/instantiate_to_bound/literal_list_with_generic_argument.dart.strong.transformed.expect
index 7c0008d..513f483 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/literal_list_with_generic_argument.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/literal_list_with_generic_argument.dart.strong.transformed.expect
@@ -2,12 +2,12 @@
import self as self;
import "dart:core" as core;
-class A<T extends core::Object> extends core::Object {
+class A<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class B<S extends core::Object> extends core::Object {
+class B<S extends core::Object = dynamic> extends core::Object {
final field core::List<self::A<self::B::S>> foo = <self::A<self::B::S>>[];
final field core::List<self::A<core::num>> bar = <self::A<core::num>>[];
synthetic constructor •() → void
diff --git a/pkg/front_end/testcases/instantiate_to_bound/literal_map.dart.direct.expect b/pkg/front_end/testcases/instantiate_to_bound/literal_map.dart.direct.expect
index cde27c3..936727b 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/literal_map.dart.direct.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/literal_map.dart.direct.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class A<T extends core::num> extends core::Object {
+class A<T extends core::num = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/instantiate_to_bound/literal_map.dart.direct.transformed.expect b/pkg/front_end/testcases/instantiate_to_bound/literal_map.dart.direct.transformed.expect
index cde27c3..936727b 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/literal_map.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/literal_map.dart.direct.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class A<T extends core::num> extends core::Object {
+class A<T extends core::num = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/instantiate_to_bound/literal_map.dart.outline.expect b/pkg/front_end/testcases/instantiate_to_bound/literal_map.dart.outline.expect
index 303959e..b6268f4 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/literal_map.dart.outline.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/literal_map.dart.outline.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class A<T extends core::num> extends core::Object {
+class A<T extends core::num = dynamic> extends core::Object {
synthetic constructor •() → void
;
}
diff --git a/pkg/front_end/testcases/instantiate_to_bound/literal_map.dart.strong.expect b/pkg/front_end/testcases/instantiate_to_bound/literal_map.dart.strong.expect
index 945d678..2a9e814 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/literal_map.dart.strong.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/literal_map.dart.strong.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class A<T extends core::num> extends core::Object {
+class A<T extends core::num = core::num> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/instantiate_to_bound/literal_map.dart.strong.transformed.expect b/pkg/front_end/testcases/instantiate_to_bound/literal_map.dart.strong.transformed.expect
index 945d678..2a9e814 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/literal_map.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/literal_map.dart.strong.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class A<T extends core::num> extends core::Object {
+class A<T extends core::num = core::num> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/instantiate_to_bound/multiple_strongly_connected.dart.direct.expect b/pkg/front_end/testcases/instantiate_to_bound/multiple_strongly_connected.dart.direct.expect
index 9ecef65..e8031c5 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/multiple_strongly_connected.dart.direct.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/multiple_strongly_connected.dart.direct.expect
@@ -2,52 +2,52 @@
import self as self;
import "dart:core" as core;
-class A<X extends core::Object> extends core::Object {
+class A<X extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class B<X extends core::Object, Y extends core::Object> extends core::Object {
+class B<X extends core::Object = dynamic, Y extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class C<X extends core::Object, Y extends core::Object> extends core::Object {
+class C<X extends core::Object = dynamic, Y extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class D<X extends self::A<self::D::X>, Y extends self::A<self::D::Y>> extends core::Object {
+class D<X extends self::A<self::D::X> = dynamic, Y extends self::A<self::D::Y> = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class E<W extends self::B<self::E::W, self::E::X>, X extends self::C<self::E::W, self::E::X>, Y extends self::B<self::E::Y, self::E::Z>, Z extends self::C<self::E::Y, self::E::Z>> extends core::Object {
+class E<W extends self::B<self::E::W, self::E::X> = dynamic, X extends self::C<self::E::W, self::E::X> = dynamic, Y extends self::B<self::E::Y, self::E::Z> = dynamic, Z extends self::C<self::E::Y, self::E::Z> = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class F<V extends core::num, W extends self::B<self::F::W, self::F::X>, X extends self::C<self::F::W, self::F::X>, Y extends self::B<self::F::W, self::F::X>, Z extends self::C<self::F::Y, self::F::Z>> extends core::Object {
+class F<V extends core::num = dynamic, W extends self::B<self::F::W, self::F::X> = dynamic, X extends self::C<self::F::W, self::F::X> = dynamic, Y extends self::B<self::F::W, self::F::X> = dynamic, Z extends self::C<self::F::Y, self::F::Z> = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class G<V extends core::num, W extends self::B<self::G::V, self::G::X>, X extends self::C<self::G::W, self::G::V>, Y extends self::B<self::G::W, self::G::X>, Z extends self::C<self::G::Y, self::G::Z>> extends core::Object {
+class G<V extends core::num = dynamic, W extends self::B<self::G::V, self::G::X> = dynamic, X extends self::C<self::G::W, self::G::V> = dynamic, Y extends self::B<self::G::W, self::G::X> = dynamic, Z extends self::C<self::G::Y, self::G::Z> = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class H<S extends self::A<self::H::S>, T extends self::B<self::H::T, self::H::U>, U extends self::C<self::H::T, self::H::U>, V extends self::A<self::H::V>, W extends self::H::S, X extends self::H::T, Y extends self::H::U, Z extends self::H::V> extends core::Object {
+class H<S extends self::A<self::H::S> = dynamic, T extends self::B<self::H::T, self::H::U> = dynamic, U extends self::C<self::H::T, self::H::U> = dynamic, V extends self::A<self::H::V> = dynamic, W extends self::H::S = dynamic, X extends self::H::T = dynamic, Y extends self::H::U = dynamic, Z extends self::H::V = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class I<T extends self::I::U, U extends self::I::Y, V extends (self::I::W) → dynamic, W extends (self::I::X) → dynamic, X extends (self::I::V) → dynamic, Y extends self::I::Z, Z extends self::I::T> extends core::Object {
+class I<T extends self::I::U = dynamic, U extends self::I::Y = dynamic, V extends (self::I::W) → dynamic = dynamic, W extends (self::I::X) → dynamic = dynamic, X extends (self::I::V) → dynamic = dynamic, Y extends self::I::Z = dynamic, Z extends self::I::T = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class J<S extends (self::J::U) → self::J::T, T extends (self::J::S) → self::J::U, U extends (self::J::T) → self::J::S, V extends self::J::W, W extends self::J::X, X extends (self::J::V) → self::J::Y, Y extends self::J::Z, Z extends self::J::X> extends core::Object {
+class J<S extends (self::J::U) → self::J::T = dynamic, T extends (self::J::S) → self::J::U = dynamic, U extends (self::J::T) → self::J::S = dynamic, V extends self::J::W = dynamic, W extends self::J::X = dynamic, X extends (self::J::V) → self::J::Y = dynamic, Y extends self::J::Z = dynamic, Z extends self::J::X = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/instantiate_to_bound/multiple_strongly_connected.dart.direct.transformed.expect b/pkg/front_end/testcases/instantiate_to_bound/multiple_strongly_connected.dart.direct.transformed.expect
index 9ecef65..e8031c5 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/multiple_strongly_connected.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/multiple_strongly_connected.dart.direct.transformed.expect
@@ -2,52 +2,52 @@
import self as self;
import "dart:core" as core;
-class A<X extends core::Object> extends core::Object {
+class A<X extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class B<X extends core::Object, Y extends core::Object> extends core::Object {
+class B<X extends core::Object = dynamic, Y extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class C<X extends core::Object, Y extends core::Object> extends core::Object {
+class C<X extends core::Object = dynamic, Y extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class D<X extends self::A<self::D::X>, Y extends self::A<self::D::Y>> extends core::Object {
+class D<X extends self::A<self::D::X> = dynamic, Y extends self::A<self::D::Y> = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class E<W extends self::B<self::E::W, self::E::X>, X extends self::C<self::E::W, self::E::X>, Y extends self::B<self::E::Y, self::E::Z>, Z extends self::C<self::E::Y, self::E::Z>> extends core::Object {
+class E<W extends self::B<self::E::W, self::E::X> = dynamic, X extends self::C<self::E::W, self::E::X> = dynamic, Y extends self::B<self::E::Y, self::E::Z> = dynamic, Z extends self::C<self::E::Y, self::E::Z> = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class F<V extends core::num, W extends self::B<self::F::W, self::F::X>, X extends self::C<self::F::W, self::F::X>, Y extends self::B<self::F::W, self::F::X>, Z extends self::C<self::F::Y, self::F::Z>> extends core::Object {
+class F<V extends core::num = dynamic, W extends self::B<self::F::W, self::F::X> = dynamic, X extends self::C<self::F::W, self::F::X> = dynamic, Y extends self::B<self::F::W, self::F::X> = dynamic, Z extends self::C<self::F::Y, self::F::Z> = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class G<V extends core::num, W extends self::B<self::G::V, self::G::X>, X extends self::C<self::G::W, self::G::V>, Y extends self::B<self::G::W, self::G::X>, Z extends self::C<self::G::Y, self::G::Z>> extends core::Object {
+class G<V extends core::num = dynamic, W extends self::B<self::G::V, self::G::X> = dynamic, X extends self::C<self::G::W, self::G::V> = dynamic, Y extends self::B<self::G::W, self::G::X> = dynamic, Z extends self::C<self::G::Y, self::G::Z> = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class H<S extends self::A<self::H::S>, T extends self::B<self::H::T, self::H::U>, U extends self::C<self::H::T, self::H::U>, V extends self::A<self::H::V>, W extends self::H::S, X extends self::H::T, Y extends self::H::U, Z extends self::H::V> extends core::Object {
+class H<S extends self::A<self::H::S> = dynamic, T extends self::B<self::H::T, self::H::U> = dynamic, U extends self::C<self::H::T, self::H::U> = dynamic, V extends self::A<self::H::V> = dynamic, W extends self::H::S = dynamic, X extends self::H::T = dynamic, Y extends self::H::U = dynamic, Z extends self::H::V = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class I<T extends self::I::U, U extends self::I::Y, V extends (self::I::W) → dynamic, W extends (self::I::X) → dynamic, X extends (self::I::V) → dynamic, Y extends self::I::Z, Z extends self::I::T> extends core::Object {
+class I<T extends self::I::U = dynamic, U extends self::I::Y = dynamic, V extends (self::I::W) → dynamic = dynamic, W extends (self::I::X) → dynamic = dynamic, X extends (self::I::V) → dynamic = dynamic, Y extends self::I::Z = dynamic, Z extends self::I::T = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class J<S extends (self::J::U) → self::J::T, T extends (self::J::S) → self::J::U, U extends (self::J::T) → self::J::S, V extends self::J::W, W extends self::J::X, X extends (self::J::V) → self::J::Y, Y extends self::J::Z, Z extends self::J::X> extends core::Object {
+class J<S extends (self::J::U) → self::J::T = dynamic, T extends (self::J::S) → self::J::U = dynamic, U extends (self::J::T) → self::J::S = dynamic, V extends self::J::W = dynamic, W extends self::J::X = dynamic, X extends (self::J::V) → self::J::Y = dynamic, Y extends self::J::Z = dynamic, Z extends self::J::X = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/instantiate_to_bound/multiple_strongly_connected.dart.outline.expect b/pkg/front_end/testcases/instantiate_to_bound/multiple_strongly_connected.dart.outline.expect
index 64dbcc8..c917def 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/multiple_strongly_connected.dart.outline.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/multiple_strongly_connected.dart.outline.expect
@@ -2,43 +2,43 @@
import self as self;
import "dart:core" as core;
-class A<X extends core::Object> extends core::Object {
+class A<X extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
;
}
-class B<X extends core::Object, Y extends core::Object> extends core::Object {
+class B<X extends core::Object = dynamic, Y extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
;
}
-class C<X extends core::Object, Y extends core::Object> extends core::Object {
+class C<X extends core::Object = dynamic, Y extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
;
}
-class D<X extends self::A<self::D::X>, Y extends self::A<self::D::Y>> extends core::Object {
+class D<X extends self::A<self::D::X> = dynamic, Y extends self::A<self::D::Y> = dynamic> extends core::Object {
synthetic constructor •() → void
;
}
-class E<W extends self::B<self::E::W, self::E::X>, X extends self::C<self::E::W, self::E::X>, Y extends self::B<self::E::Y, self::E::Z>, Z extends self::C<self::E::Y, self::E::Z>> extends core::Object {
+class E<W extends self::B<self::E::W, self::E::X> = dynamic, X extends self::C<self::E::W, self::E::X> = dynamic, Y extends self::B<self::E::Y, self::E::Z> = dynamic, Z extends self::C<self::E::Y, self::E::Z> = dynamic> extends core::Object {
synthetic constructor •() → void
;
}
-class F<V extends core::num, W extends self::B<self::F::W, self::F::X>, X extends self::C<self::F::W, self::F::X>, Y extends self::B<self::F::W, self::F::X>, Z extends self::C<self::F::Y, self::F::Z>> extends core::Object {
+class F<V extends core::num = dynamic, W extends self::B<self::F::W, self::F::X> = dynamic, X extends self::C<self::F::W, self::F::X> = dynamic, Y extends self::B<self::F::W, self::F::X> = dynamic, Z extends self::C<self::F::Y, self::F::Z> = dynamic> extends core::Object {
synthetic constructor •() → void
;
}
-class G<V extends core::num, W extends self::B<self::G::V, self::G::X>, X extends self::C<self::G::W, self::G::V>, Y extends self::B<self::G::W, self::G::X>, Z extends self::C<self::G::Y, self::G::Z>> extends core::Object {
+class G<V extends core::num = dynamic, W extends self::B<self::G::V, self::G::X> = dynamic, X extends self::C<self::G::W, self::G::V> = dynamic, Y extends self::B<self::G::W, self::G::X> = dynamic, Z extends self::C<self::G::Y, self::G::Z> = dynamic> extends core::Object {
synthetic constructor •() → void
;
}
-class H<S extends self::A<self::H::S>, T extends self::B<self::H::T, self::H::U>, U extends self::C<self::H::T, self::H::U>, V extends self::A<self::H::V>, W extends self::H::S, X extends self::H::T, Y extends self::H::U, Z extends self::H::V> extends core::Object {
+class H<S extends self::A<self::H::S> = dynamic, T extends self::B<self::H::T, self::H::U> = dynamic, U extends self::C<self::H::T, self::H::U> = dynamic, V extends self::A<self::H::V> = dynamic, W extends self::H::S = dynamic, X extends self::H::T = dynamic, Y extends self::H::U = dynamic, Z extends self::H::V = dynamic> extends core::Object {
synthetic constructor •() → void
;
}
-class I<T extends self::I::U, U extends self::I::Y, V extends (self::I::W) → dynamic, W extends (self::I::X) → dynamic, X extends (self::I::V) → dynamic, Y extends self::I::Z, Z extends self::I::T> extends core::Object {
+class I<T extends self::I::U = dynamic, U extends self::I::Y = dynamic, V extends (self::I::W) → dynamic = dynamic, W extends (self::I::X) → dynamic = dynamic, X extends (self::I::V) → dynamic = dynamic, Y extends self::I::Z = dynamic, Z extends self::I::T = dynamic> extends core::Object {
synthetic constructor •() → void
;
}
-class J<S extends (self::J::U) → self::J::T, T extends (self::J::S) → self::J::U, U extends (self::J::T) → self::J::S, V extends self::J::W, W extends self::J::X, X extends (self::J::V) → self::J::Y, Y extends self::J::Z, Z extends self::J::X> extends core::Object {
+class J<S extends (self::J::U) → self::J::T = dynamic, T extends (self::J::S) → self::J::U = dynamic, U extends (self::J::T) → self::J::S = dynamic, V extends self::J::W = dynamic, W extends self::J::X = dynamic, X extends (self::J::V) → self::J::Y = dynamic, Y extends self::J::Z = dynamic, Z extends self::J::X = dynamic> extends core::Object {
synthetic constructor •() → void
;
}
diff --git a/pkg/front_end/testcases/instantiate_to_bound/multiple_strongly_connected.dart.strong.expect b/pkg/front_end/testcases/instantiate_to_bound/multiple_strongly_connected.dart.strong.expect
index b890460..7b2576f 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/multiple_strongly_connected.dart.strong.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/multiple_strongly_connected.dart.strong.expect
@@ -2,52 +2,52 @@
import self as self;
import "dart:core" as core;
-class A<X extends core::Object> extends core::Object {
+class A<X extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class B<X extends core::Object, Y extends core::Object> extends core::Object {
+class B<X extends core::Object = dynamic, Y extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class C<X extends core::Object, Y extends core::Object> extends core::Object {
+class C<X extends core::Object = dynamic, Y extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class D<X extends self::A<self::D::X>, Y extends self::A<self::D::Y>> extends core::Object {
+class D<X extends self::A<self::D::X> = self::A<dynamic>, Y extends self::A<self::D::Y> = self::A<dynamic>> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class E<W extends self::B<self::E::W, self::E::X>, X extends self::C<self::E::W, self::E::X>, Y extends self::B<self::E::Y, self::E::Z>, Z extends self::C<self::E::Y, self::E::Z>> extends core::Object {
+class E<W extends self::B<self::E::W, self::E::X> = self::B<dynamic, dynamic>, X extends self::C<self::E::W, self::E::X> = self::C<dynamic, dynamic>, Y extends self::B<self::E::Y, self::E::Z> = self::B<dynamic, dynamic>, Z extends self::C<self::E::Y, self::E::Z> = self::C<dynamic, dynamic>> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class F<V extends core::num, W extends self::B<self::F::W, self::F::X>, X extends self::C<self::F::W, self::F::X>, Y extends self::B<self::F::W, self::F::X>, Z extends self::C<self::F::Y, self::F::Z>> extends core::Object {
+class F<V extends core::num = core::num, W extends self::B<self::F::W, self::F::X> = self::B<dynamic, dynamic>, X extends self::C<self::F::W, self::F::X> = self::C<dynamic, dynamic>, Y extends self::B<self::F::W, self::F::X> = self::B<self::B<dynamic, dynamic>, self::C<dynamic, dynamic>>, Z extends self::C<self::F::Y, self::F::Z> = self::C<self::B<self::B<dynamic, dynamic>, self::C<dynamic, dynamic>>, dynamic>> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class G<V extends core::num, W extends self::B<self::G::V, self::G::X>, X extends self::C<self::G::W, self::G::V>, Y extends self::B<self::G::W, self::G::X>, Z extends self::C<self::G::Y, self::G::Z>> extends core::Object {
+class G<V extends core::num = core::num, W extends self::B<self::G::V, self::G::X> = self::B<core::num, dynamic>, X extends self::C<self::G::W, self::G::V> = self::C<dynamic, core::num>, Y extends self::B<self::G::W, self::G::X> = self::B<self::B<core::num, dynamic>, self::C<dynamic, core::num>>, Z extends self::C<self::G::Y, self::G::Z> = self::C<self::B<self::B<core::num, dynamic>, self::C<dynamic, core::num>>, dynamic>> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class H<S extends self::A<self::H::S>, T extends self::B<self::H::T, self::H::U>, U extends self::C<self::H::T, self::H::U>, V extends self::A<self::H::V>, W extends self::H::S, X extends self::H::T, Y extends self::H::U, Z extends self::H::V> extends core::Object {
+class H<S extends self::A<self::H::S> = self::A<dynamic>, T extends self::B<self::H::T, self::H::U> = self::B<dynamic, dynamic>, U extends self::C<self::H::T, self::H::U> = self::C<dynamic, dynamic>, V extends self::A<self::H::V> = self::A<dynamic>, W extends self::H::S = self::A<dynamic>, X extends self::H::T = self::B<dynamic, dynamic>, Y extends self::H::U = self::C<dynamic, dynamic>, Z extends self::H::V = self::A<dynamic>> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class I<T extends self::I::U, U extends self::I::Y, V extends (self::I::W) → dynamic, W extends (self::I::X) → dynamic, X extends (self::I::V) → dynamic, Y extends self::I::Z, Z extends self::I::T> extends core::Object {
+class I<T extends self::I::U = dynamic, U extends self::I::Y = dynamic, V extends (self::I::W) → dynamic = (core::Null) → dynamic, W extends (self::I::X) → dynamic = (core::Null) → dynamic, X extends (self::I::V) → dynamic = (core::Null) → dynamic, Y extends self::I::Z = dynamic, Z extends self::I::T = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class J<S extends (self::J::U) → self::J::T, T extends (self::J::S) → self::J::U, U extends (self::J::T) → self::J::S, V extends self::J::W, W extends self::J::X, X extends (self::J::V) → self::J::Y, Y extends self::J::Z, Z extends self::J::X> extends core::Object {
+class J<S extends (self::J::U) → self::J::T = (core::Null) → dynamic, T extends (self::J::S) → self::J::U = (core::Null) → dynamic, U extends (self::J::T) → self::J::S = (core::Null) → dynamic, V extends self::J::W = dynamic, W extends self::J::X = dynamic, X extends (self::J::V) → self::J::Y = (core::Null) → dynamic, Y extends self::J::Z = dynamic, Z extends self::J::X = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/instantiate_to_bound/multiple_strongly_connected.dart.strong.transformed.expect b/pkg/front_end/testcases/instantiate_to_bound/multiple_strongly_connected.dart.strong.transformed.expect
index b890460..7b2576f 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/multiple_strongly_connected.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/multiple_strongly_connected.dart.strong.transformed.expect
@@ -2,52 +2,52 @@
import self as self;
import "dart:core" as core;
-class A<X extends core::Object> extends core::Object {
+class A<X extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class B<X extends core::Object, Y extends core::Object> extends core::Object {
+class B<X extends core::Object = dynamic, Y extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class C<X extends core::Object, Y extends core::Object> extends core::Object {
+class C<X extends core::Object = dynamic, Y extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class D<X extends self::A<self::D::X>, Y extends self::A<self::D::Y>> extends core::Object {
+class D<X extends self::A<self::D::X> = self::A<dynamic>, Y extends self::A<self::D::Y> = self::A<dynamic>> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class E<W extends self::B<self::E::W, self::E::X>, X extends self::C<self::E::W, self::E::X>, Y extends self::B<self::E::Y, self::E::Z>, Z extends self::C<self::E::Y, self::E::Z>> extends core::Object {
+class E<W extends self::B<self::E::W, self::E::X> = self::B<dynamic, dynamic>, X extends self::C<self::E::W, self::E::X> = self::C<dynamic, dynamic>, Y extends self::B<self::E::Y, self::E::Z> = self::B<dynamic, dynamic>, Z extends self::C<self::E::Y, self::E::Z> = self::C<dynamic, dynamic>> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class F<V extends core::num, W extends self::B<self::F::W, self::F::X>, X extends self::C<self::F::W, self::F::X>, Y extends self::B<self::F::W, self::F::X>, Z extends self::C<self::F::Y, self::F::Z>> extends core::Object {
+class F<V extends core::num = core::num, W extends self::B<self::F::W, self::F::X> = self::B<dynamic, dynamic>, X extends self::C<self::F::W, self::F::X> = self::C<dynamic, dynamic>, Y extends self::B<self::F::W, self::F::X> = self::B<self::B<dynamic, dynamic>, self::C<dynamic, dynamic>>, Z extends self::C<self::F::Y, self::F::Z> = self::C<self::B<self::B<dynamic, dynamic>, self::C<dynamic, dynamic>>, dynamic>> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class G<V extends core::num, W extends self::B<self::G::V, self::G::X>, X extends self::C<self::G::W, self::G::V>, Y extends self::B<self::G::W, self::G::X>, Z extends self::C<self::G::Y, self::G::Z>> extends core::Object {
+class G<V extends core::num = core::num, W extends self::B<self::G::V, self::G::X> = self::B<core::num, dynamic>, X extends self::C<self::G::W, self::G::V> = self::C<dynamic, core::num>, Y extends self::B<self::G::W, self::G::X> = self::B<self::B<core::num, dynamic>, self::C<dynamic, core::num>>, Z extends self::C<self::G::Y, self::G::Z> = self::C<self::B<self::B<core::num, dynamic>, self::C<dynamic, core::num>>, dynamic>> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class H<S extends self::A<self::H::S>, T extends self::B<self::H::T, self::H::U>, U extends self::C<self::H::T, self::H::U>, V extends self::A<self::H::V>, W extends self::H::S, X extends self::H::T, Y extends self::H::U, Z extends self::H::V> extends core::Object {
+class H<S extends self::A<self::H::S> = self::A<dynamic>, T extends self::B<self::H::T, self::H::U> = self::B<dynamic, dynamic>, U extends self::C<self::H::T, self::H::U> = self::C<dynamic, dynamic>, V extends self::A<self::H::V> = self::A<dynamic>, W extends self::H::S = self::A<dynamic>, X extends self::H::T = self::B<dynamic, dynamic>, Y extends self::H::U = self::C<dynamic, dynamic>, Z extends self::H::V = self::A<dynamic>> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class I<T extends self::I::U, U extends self::I::Y, V extends (self::I::W) → dynamic, W extends (self::I::X) → dynamic, X extends (self::I::V) → dynamic, Y extends self::I::Z, Z extends self::I::T> extends core::Object {
+class I<T extends self::I::U = dynamic, U extends self::I::Y = dynamic, V extends (self::I::W) → dynamic = (core::Null) → dynamic, W extends (self::I::X) → dynamic = (core::Null) → dynamic, X extends (self::I::V) → dynamic = (core::Null) → dynamic, Y extends self::I::Z = dynamic, Z extends self::I::T = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class J<S extends (self::J::U) → self::J::T, T extends (self::J::S) → self::J::U, U extends (self::J::T) → self::J::S, V extends self::J::W, W extends self::J::X, X extends (self::J::V) → self::J::Y, Y extends self::J::Z, Z extends self::J::X> extends core::Object {
+class J<S extends (self::J::U) → self::J::T = (core::Null) → dynamic, T extends (self::J::S) → self::J::U = (core::Null) → dynamic, U extends (self::J::T) → self::J::S = (core::Null) → dynamic, V extends self::J::W = dynamic, W extends self::J::X = dynamic, X extends (self::J::V) → self::J::Y = (core::Null) → dynamic, Y extends self::J::Z = dynamic, Z extends self::J::X = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/instantiate_to_bound/mutual_dependence.dart.direct.expect b/pkg/front_end/testcases/instantiate_to_bound/mutual_dependence.dart.direct.expect
index 74147c8..c0cb9b8 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/mutual_dependence.dart.direct.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/mutual_dependence.dart.direct.expect
@@ -2,52 +2,52 @@
import self as self;
import "dart:core" as core;
-class B<X extends core::Object, Y extends core::Object> extends core::Object {
+class B<X extends core::Object = dynamic, Y extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class C1<X extends (self::C1::Y) → self::C1::X, Y extends (self::C1::Y) → self::C1::X> extends core::Object {
+class C1<X extends (self::C1::Y) → self::C1::X = dynamic, Y extends (self::C1::Y) → self::C1::X = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class C2<X extends (self::C2::Y) → self::C2::X, Y extends (self::C2::X) → self::C2::Y> extends core::Object {
+class C2<X extends (self::C2::Y) → self::C2::X = dynamic, Y extends (self::C2::X) → self::C2::Y = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class C3<X extends (self::C3::X, self::C3::Y) → self::C3::X, Y extends (self::C3::X, self::C3::Y) → self::C3::X> extends core::Object {
+class C3<X extends (self::C3::X, self::C3::Y) → self::C3::X = dynamic, Y extends (self::C3::X, self::C3::Y) → self::C3::X = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class C4<X extends (self::C4::X, self::C4::Y) → self::C4::X, Y extends (self::C4::X, self::C4::Y) → self::C4::Y> extends core::Object {
+class C4<X extends (self::C4::X, self::C4::Y) → self::C4::X = dynamic, Y extends (self::C4::X, self::C4::Y) → self::C4::Y = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class D1<X extends self::B<self::D1::X, self::D1::Y>, Y extends (self::D1::Y) → self::D1::X> extends core::Object {
+class D1<X extends self::B<self::D1::X, self::D1::Y> = dynamic, Y extends (self::D1::Y) → self::D1::X = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class D2<X extends self::B<self::D2::X, self::D2::Y>, Y extends (self::D2::X) → self::D2::Y> extends core::Object {
+class D2<X extends self::B<self::D2::X, self::D2::Y> = dynamic, Y extends (self::D2::X) → self::D2::Y = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class D3<X extends self::B<self::D3::X, self::D3::Y>, Y extends (self::D3::X, self::D3::Y) → self::D3::X> extends core::Object {
+class D3<X extends self::B<self::D3::X, self::D3::Y> = dynamic, Y extends (self::D3::X, self::D3::Y) → self::D3::X = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class D4<X extends self::B<self::D4::X, self::D4::Y>, Y extends (self::D4::X, self::D4::Y) → self::D4::Y> extends core::Object {
+class D4<X extends self::B<self::D4::X, self::D4::Y> = dynamic, Y extends (self::D4::X, self::D4::Y) → self::D4::Y = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class E<X extends (self::E::X) → self::E::X> extends core::Object {
+class E<X extends (self::E::X) → self::E::X = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/instantiate_to_bound/mutual_dependence.dart.direct.transformed.expect b/pkg/front_end/testcases/instantiate_to_bound/mutual_dependence.dart.direct.transformed.expect
index 74147c8..c0cb9b8 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/mutual_dependence.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/mutual_dependence.dart.direct.transformed.expect
@@ -2,52 +2,52 @@
import self as self;
import "dart:core" as core;
-class B<X extends core::Object, Y extends core::Object> extends core::Object {
+class B<X extends core::Object = dynamic, Y extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class C1<X extends (self::C1::Y) → self::C1::X, Y extends (self::C1::Y) → self::C1::X> extends core::Object {
+class C1<X extends (self::C1::Y) → self::C1::X = dynamic, Y extends (self::C1::Y) → self::C1::X = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class C2<X extends (self::C2::Y) → self::C2::X, Y extends (self::C2::X) → self::C2::Y> extends core::Object {
+class C2<X extends (self::C2::Y) → self::C2::X = dynamic, Y extends (self::C2::X) → self::C2::Y = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class C3<X extends (self::C3::X, self::C3::Y) → self::C3::X, Y extends (self::C3::X, self::C3::Y) → self::C3::X> extends core::Object {
+class C3<X extends (self::C3::X, self::C3::Y) → self::C3::X = dynamic, Y extends (self::C3::X, self::C3::Y) → self::C3::X = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class C4<X extends (self::C4::X, self::C4::Y) → self::C4::X, Y extends (self::C4::X, self::C4::Y) → self::C4::Y> extends core::Object {
+class C4<X extends (self::C4::X, self::C4::Y) → self::C4::X = dynamic, Y extends (self::C4::X, self::C4::Y) → self::C4::Y = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class D1<X extends self::B<self::D1::X, self::D1::Y>, Y extends (self::D1::Y) → self::D1::X> extends core::Object {
+class D1<X extends self::B<self::D1::X, self::D1::Y> = dynamic, Y extends (self::D1::Y) → self::D1::X = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class D2<X extends self::B<self::D2::X, self::D2::Y>, Y extends (self::D2::X) → self::D2::Y> extends core::Object {
+class D2<X extends self::B<self::D2::X, self::D2::Y> = dynamic, Y extends (self::D2::X) → self::D2::Y = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class D3<X extends self::B<self::D3::X, self::D3::Y>, Y extends (self::D3::X, self::D3::Y) → self::D3::X> extends core::Object {
+class D3<X extends self::B<self::D3::X, self::D3::Y> = dynamic, Y extends (self::D3::X, self::D3::Y) → self::D3::X = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class D4<X extends self::B<self::D4::X, self::D4::Y>, Y extends (self::D4::X, self::D4::Y) → self::D4::Y> extends core::Object {
+class D4<X extends self::B<self::D4::X, self::D4::Y> = dynamic, Y extends (self::D4::X, self::D4::Y) → self::D4::Y = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class E<X extends (self::E::X) → self::E::X> extends core::Object {
+class E<X extends (self::E::X) → self::E::X = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/instantiate_to_bound/mutual_dependence.dart.outline.expect b/pkg/front_end/testcases/instantiate_to_bound/mutual_dependence.dart.outline.expect
index 9ba0b7d..3b6681f 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/mutual_dependence.dart.outline.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/mutual_dependence.dart.outline.expect
@@ -2,43 +2,43 @@
import self as self;
import "dart:core" as core;
-class B<X extends core::Object, Y extends core::Object> extends core::Object {
+class B<X extends core::Object = dynamic, Y extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
;
}
-class C1<X extends (self::C1::Y) → self::C1::X, Y extends (self::C1::Y) → self::C1::X> extends core::Object {
+class C1<X extends (self::C1::Y) → self::C1::X = dynamic, Y extends (self::C1::Y) → self::C1::X = dynamic> extends core::Object {
synthetic constructor •() → void
;
}
-class C2<X extends (self::C2::Y) → self::C2::X, Y extends (self::C2::X) → self::C2::Y> extends core::Object {
+class C2<X extends (self::C2::Y) → self::C2::X = dynamic, Y extends (self::C2::X) → self::C2::Y = dynamic> extends core::Object {
synthetic constructor •() → void
;
}
-class C3<X extends (self::C3::X, self::C3::Y) → self::C3::X, Y extends (self::C3::X, self::C3::Y) → self::C3::X> extends core::Object {
+class C3<X extends (self::C3::X, self::C3::Y) → self::C3::X = dynamic, Y extends (self::C3::X, self::C3::Y) → self::C3::X = dynamic> extends core::Object {
synthetic constructor •() → void
;
}
-class C4<X extends (self::C4::X, self::C4::Y) → self::C4::X, Y extends (self::C4::X, self::C4::Y) → self::C4::Y> extends core::Object {
+class C4<X extends (self::C4::X, self::C4::Y) → self::C4::X = dynamic, Y extends (self::C4::X, self::C4::Y) → self::C4::Y = dynamic> extends core::Object {
synthetic constructor •() → void
;
}
-class D1<X extends self::B<self::D1::X, self::D1::Y>, Y extends (self::D1::Y) → self::D1::X> extends core::Object {
+class D1<X extends self::B<self::D1::X, self::D1::Y> = dynamic, Y extends (self::D1::Y) → self::D1::X = dynamic> extends core::Object {
synthetic constructor •() → void
;
}
-class D2<X extends self::B<self::D2::X, self::D2::Y>, Y extends (self::D2::X) → self::D2::Y> extends core::Object {
+class D2<X extends self::B<self::D2::X, self::D2::Y> = dynamic, Y extends (self::D2::X) → self::D2::Y = dynamic> extends core::Object {
synthetic constructor •() → void
;
}
-class D3<X extends self::B<self::D3::X, self::D3::Y>, Y extends (self::D3::X, self::D3::Y) → self::D3::X> extends core::Object {
+class D3<X extends self::B<self::D3::X, self::D3::Y> = dynamic, Y extends (self::D3::X, self::D3::Y) → self::D3::X = dynamic> extends core::Object {
synthetic constructor •() → void
;
}
-class D4<X extends self::B<self::D4::X, self::D4::Y>, Y extends (self::D4::X, self::D4::Y) → self::D4::Y> extends core::Object {
+class D4<X extends self::B<self::D4::X, self::D4::Y> = dynamic, Y extends (self::D4::X, self::D4::Y) → self::D4::Y = dynamic> extends core::Object {
synthetic constructor •() → void
;
}
-class E<X extends (self::E::X) → self::E::X> extends core::Object {
+class E<X extends (self::E::X) → self::E::X = dynamic> extends core::Object {
synthetic constructor •() → void
;
}
diff --git a/pkg/front_end/testcases/instantiate_to_bound/mutual_dependence.dart.strong.expect b/pkg/front_end/testcases/instantiate_to_bound/mutual_dependence.dart.strong.expect
index 77802e7..3621db7 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/mutual_dependence.dart.strong.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/mutual_dependence.dart.strong.expect
@@ -2,52 +2,52 @@
import self as self;
import "dart:core" as core;
-class B<X extends core::Object, Y extends core::Object> extends core::Object {
+class B<X extends core::Object = dynamic, Y extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class C1<X extends (self::C1::Y) → self::C1::X, Y extends (self::C1::Y) → self::C1::X> extends core::Object {
+class C1<X extends (self::C1::Y) → self::C1::X = (core::Null) → dynamic, Y extends (self::C1::Y) → self::C1::X = (core::Null) → dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class C2<X extends (self::C2::Y) → self::C2::X, Y extends (self::C2::X) → self::C2::Y> extends core::Object {
+class C2<X extends (self::C2::Y) → self::C2::X = (core::Null) → dynamic, Y extends (self::C2::X) → self::C2::Y = (core::Null) → dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class C3<X extends (self::C3::X, self::C3::Y) → self::C3::X, Y extends (self::C3::X, self::C3::Y) → self::C3::X> extends core::Object {
+class C3<X extends (self::C3::X, self::C3::Y) → self::C3::X = (core::Null, core::Null) → dynamic, Y extends (self::C3::X, self::C3::Y) → self::C3::X = (core::Null, core::Null) → dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class C4<X extends (self::C4::X, self::C4::Y) → self::C4::X, Y extends (self::C4::X, self::C4::Y) → self::C4::Y> extends core::Object {
+class C4<X extends (self::C4::X, self::C4::Y) → self::C4::X = (core::Null, core::Null) → dynamic, Y extends (self::C4::X, self::C4::Y) → self::C4::Y = (core::Null, core::Null) → dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class D1<X extends self::B<self::D1::X, self::D1::Y>, Y extends (self::D1::Y) → self::D1::X> extends core::Object {
+class D1<X extends self::B<self::D1::X, self::D1::Y> = self::B<dynamic, dynamic>, Y extends (self::D1::Y) → self::D1::X = (core::Null) → dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class D2<X extends self::B<self::D2::X, self::D2::Y>, Y extends (self::D2::X) → self::D2::Y> extends core::Object {
+class D2<X extends self::B<self::D2::X, self::D2::Y> = self::B<dynamic, dynamic>, Y extends (self::D2::X) → self::D2::Y = (core::Null) → dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class D3<X extends self::B<self::D3::X, self::D3::Y>, Y extends (self::D3::X, self::D3::Y) → self::D3::X> extends core::Object {
+class D3<X extends self::B<self::D3::X, self::D3::Y> = self::B<dynamic, dynamic>, Y extends (self::D3::X, self::D3::Y) → self::D3::X = (core::Null, core::Null) → dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class D4<X extends self::B<self::D4::X, self::D4::Y>, Y extends (self::D4::X, self::D4::Y) → self::D4::Y> extends core::Object {
+class D4<X extends self::B<self::D4::X, self::D4::Y> = self::B<dynamic, dynamic>, Y extends (self::D4::X, self::D4::Y) → self::D4::Y = (core::Null, core::Null) → dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class E<X extends (self::E::X) → self::E::X> extends core::Object {
+class E<X extends (self::E::X) → self::E::X = (core::Null) → dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/instantiate_to_bound/mutual_dependence.dart.strong.transformed.expect b/pkg/front_end/testcases/instantiate_to_bound/mutual_dependence.dart.strong.transformed.expect
index 77802e7..3621db7 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/mutual_dependence.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/mutual_dependence.dart.strong.transformed.expect
@@ -2,52 +2,52 @@
import self as self;
import "dart:core" as core;
-class B<X extends core::Object, Y extends core::Object> extends core::Object {
+class B<X extends core::Object = dynamic, Y extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class C1<X extends (self::C1::Y) → self::C1::X, Y extends (self::C1::Y) → self::C1::X> extends core::Object {
+class C1<X extends (self::C1::Y) → self::C1::X = (core::Null) → dynamic, Y extends (self::C1::Y) → self::C1::X = (core::Null) → dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class C2<X extends (self::C2::Y) → self::C2::X, Y extends (self::C2::X) → self::C2::Y> extends core::Object {
+class C2<X extends (self::C2::Y) → self::C2::X = (core::Null) → dynamic, Y extends (self::C2::X) → self::C2::Y = (core::Null) → dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class C3<X extends (self::C3::X, self::C3::Y) → self::C3::X, Y extends (self::C3::X, self::C3::Y) → self::C3::X> extends core::Object {
+class C3<X extends (self::C3::X, self::C3::Y) → self::C3::X = (core::Null, core::Null) → dynamic, Y extends (self::C3::X, self::C3::Y) → self::C3::X = (core::Null, core::Null) → dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class C4<X extends (self::C4::X, self::C4::Y) → self::C4::X, Y extends (self::C4::X, self::C4::Y) → self::C4::Y> extends core::Object {
+class C4<X extends (self::C4::X, self::C4::Y) → self::C4::X = (core::Null, core::Null) → dynamic, Y extends (self::C4::X, self::C4::Y) → self::C4::Y = (core::Null, core::Null) → dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class D1<X extends self::B<self::D1::X, self::D1::Y>, Y extends (self::D1::Y) → self::D1::X> extends core::Object {
+class D1<X extends self::B<self::D1::X, self::D1::Y> = self::B<dynamic, dynamic>, Y extends (self::D1::Y) → self::D1::X = (core::Null) → dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class D2<X extends self::B<self::D2::X, self::D2::Y>, Y extends (self::D2::X) → self::D2::Y> extends core::Object {
+class D2<X extends self::B<self::D2::X, self::D2::Y> = self::B<dynamic, dynamic>, Y extends (self::D2::X) → self::D2::Y = (core::Null) → dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class D3<X extends self::B<self::D3::X, self::D3::Y>, Y extends (self::D3::X, self::D3::Y) → self::D3::X> extends core::Object {
+class D3<X extends self::B<self::D3::X, self::D3::Y> = self::B<dynamic, dynamic>, Y extends (self::D3::X, self::D3::Y) → self::D3::X = (core::Null, core::Null) → dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class D4<X extends self::B<self::D4::X, self::D4::Y>, Y extends (self::D4::X, self::D4::Y) → self::D4::Y> extends core::Object {
+class D4<X extends self::B<self::D4::X, self::D4::Y> = self::B<dynamic, dynamic>, Y extends (self::D4::X, self::D4::Y) → self::D4::Y = (core::Null, core::Null) → dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class E<X extends (self::E::X) → self::E::X> extends core::Object {
+class E<X extends (self::E::X) → self::E::X = (core::Null) → dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/instantiate_to_bound/mutual_dependence_in_literals.dart.direct.expect b/pkg/front_end/testcases/instantiate_to_bound/mutual_dependence_in_literals.dart.direct.expect
index ec1fdc4..e323b52 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/mutual_dependence_in_literals.dart.direct.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/mutual_dependence_in_literals.dart.direct.expect
@@ -2,52 +2,52 @@
import self as self;
import "dart:core" as core;
-class B<X extends core::Object, Y extends core::Object> extends core::Object {
+class B<X extends core::Object = dynamic, Y extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class C1<X extends (self::C1::Y) → self::C1::X, Y extends (self::C1::Y) → self::C1::X> extends core::Object {
+class C1<X extends (self::C1::Y) → self::C1::X = dynamic, Y extends (self::C1::Y) → self::C1::X = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class C2<X extends (self::C2::Y) → self::C2::X, Y extends (self::C2::X) → self::C2::Y> extends core::Object {
+class C2<X extends (self::C2::Y) → self::C2::X = dynamic, Y extends (self::C2::X) → self::C2::Y = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class C3<X extends (self::C3::X, self::C3::Y) → self::C3::X, Y extends (self::C3::X, self::C3::Y) → self::C3::X> extends core::Object {
+class C3<X extends (self::C3::X, self::C3::Y) → self::C3::X = dynamic, Y extends (self::C3::X, self::C3::Y) → self::C3::X = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class C4<X extends (self::C4::X, self::C4::Y) → self::C4::X, Y extends (self::C4::X, self::C4::Y) → self::C4::Y> extends core::Object {
+class C4<X extends (self::C4::X, self::C4::Y) → self::C4::X = dynamic, Y extends (self::C4::X, self::C4::Y) → self::C4::Y = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class D1<X extends self::B<self::D1::X, self::D1::Y>, Y extends (self::D1::Y) → self::D1::X> extends core::Object {
+class D1<X extends self::B<self::D1::X, self::D1::Y> = dynamic, Y extends (self::D1::Y) → self::D1::X = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class D2<X extends self::B<self::D2::X, self::D2::Y>, Y extends (self::D2::X) → self::D2::Y> extends core::Object {
+class D2<X extends self::B<self::D2::X, self::D2::Y> = dynamic, Y extends (self::D2::X) → self::D2::Y = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class D3<X extends self::B<self::D3::X, self::D3::Y>, Y extends (self::D3::X, self::D3::Y) → self::D3::X> extends core::Object {
+class D3<X extends self::B<self::D3::X, self::D3::Y> = dynamic, Y extends (self::D3::X, self::D3::Y) → self::D3::X = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class D4<X extends self::B<self::D4::X, self::D4::Y>, Y extends (self::D4::X, self::D4::Y) → self::D4::Y> extends core::Object {
+class D4<X extends self::B<self::D4::X, self::D4::Y> = dynamic, Y extends (self::D4::X, self::D4::Y) → self::D4::Y = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class E<X extends (self::E::X) → self::E::X> extends core::Object {
+class E<X extends (self::E::X) → self::E::X = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/instantiate_to_bound/mutual_dependence_in_literals.dart.direct.transformed.expect b/pkg/front_end/testcases/instantiate_to_bound/mutual_dependence_in_literals.dart.direct.transformed.expect
index ec1fdc4..e323b52 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/mutual_dependence_in_literals.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/mutual_dependence_in_literals.dart.direct.transformed.expect
@@ -2,52 +2,52 @@
import self as self;
import "dart:core" as core;
-class B<X extends core::Object, Y extends core::Object> extends core::Object {
+class B<X extends core::Object = dynamic, Y extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class C1<X extends (self::C1::Y) → self::C1::X, Y extends (self::C1::Y) → self::C1::X> extends core::Object {
+class C1<X extends (self::C1::Y) → self::C1::X = dynamic, Y extends (self::C1::Y) → self::C1::X = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class C2<X extends (self::C2::Y) → self::C2::X, Y extends (self::C2::X) → self::C2::Y> extends core::Object {
+class C2<X extends (self::C2::Y) → self::C2::X = dynamic, Y extends (self::C2::X) → self::C2::Y = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class C3<X extends (self::C3::X, self::C3::Y) → self::C3::X, Y extends (self::C3::X, self::C3::Y) → self::C3::X> extends core::Object {
+class C3<X extends (self::C3::X, self::C3::Y) → self::C3::X = dynamic, Y extends (self::C3::X, self::C3::Y) → self::C3::X = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class C4<X extends (self::C4::X, self::C4::Y) → self::C4::X, Y extends (self::C4::X, self::C4::Y) → self::C4::Y> extends core::Object {
+class C4<X extends (self::C4::X, self::C4::Y) → self::C4::X = dynamic, Y extends (self::C4::X, self::C4::Y) → self::C4::Y = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class D1<X extends self::B<self::D1::X, self::D1::Y>, Y extends (self::D1::Y) → self::D1::X> extends core::Object {
+class D1<X extends self::B<self::D1::X, self::D1::Y> = dynamic, Y extends (self::D1::Y) → self::D1::X = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class D2<X extends self::B<self::D2::X, self::D2::Y>, Y extends (self::D2::X) → self::D2::Y> extends core::Object {
+class D2<X extends self::B<self::D2::X, self::D2::Y> = dynamic, Y extends (self::D2::X) → self::D2::Y = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class D3<X extends self::B<self::D3::X, self::D3::Y>, Y extends (self::D3::X, self::D3::Y) → self::D3::X> extends core::Object {
+class D3<X extends self::B<self::D3::X, self::D3::Y> = dynamic, Y extends (self::D3::X, self::D3::Y) → self::D3::X = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class D4<X extends self::B<self::D4::X, self::D4::Y>, Y extends (self::D4::X, self::D4::Y) → self::D4::Y> extends core::Object {
+class D4<X extends self::B<self::D4::X, self::D4::Y> = dynamic, Y extends (self::D4::X, self::D4::Y) → self::D4::Y = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class E<X extends (self::E::X) → self::E::X> extends core::Object {
+class E<X extends (self::E::X) → self::E::X = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/instantiate_to_bound/mutual_dependence_in_literals.dart.outline.expect b/pkg/front_end/testcases/instantiate_to_bound/mutual_dependence_in_literals.dart.outline.expect
index c1a07b1..862f29e 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/mutual_dependence_in_literals.dart.outline.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/mutual_dependence_in_literals.dart.outline.expect
@@ -2,43 +2,43 @@
import self as self;
import "dart:core" as core;
-class B<X extends core::Object, Y extends core::Object> extends core::Object {
+class B<X extends core::Object = dynamic, Y extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
;
}
-class C1<X extends (self::C1::Y) → self::C1::X, Y extends (self::C1::Y) → self::C1::X> extends core::Object {
+class C1<X extends (self::C1::Y) → self::C1::X = dynamic, Y extends (self::C1::Y) → self::C1::X = dynamic> extends core::Object {
synthetic constructor •() → void
;
}
-class C2<X extends (self::C2::Y) → self::C2::X, Y extends (self::C2::X) → self::C2::Y> extends core::Object {
+class C2<X extends (self::C2::Y) → self::C2::X = dynamic, Y extends (self::C2::X) → self::C2::Y = dynamic> extends core::Object {
synthetic constructor •() → void
;
}
-class C3<X extends (self::C3::X, self::C3::Y) → self::C3::X, Y extends (self::C3::X, self::C3::Y) → self::C3::X> extends core::Object {
+class C3<X extends (self::C3::X, self::C3::Y) → self::C3::X = dynamic, Y extends (self::C3::X, self::C3::Y) → self::C3::X = dynamic> extends core::Object {
synthetic constructor •() → void
;
}
-class C4<X extends (self::C4::X, self::C4::Y) → self::C4::X, Y extends (self::C4::X, self::C4::Y) → self::C4::Y> extends core::Object {
+class C4<X extends (self::C4::X, self::C4::Y) → self::C4::X = dynamic, Y extends (self::C4::X, self::C4::Y) → self::C4::Y = dynamic> extends core::Object {
synthetic constructor •() → void
;
}
-class D1<X extends self::B<self::D1::X, self::D1::Y>, Y extends (self::D1::Y) → self::D1::X> extends core::Object {
+class D1<X extends self::B<self::D1::X, self::D1::Y> = dynamic, Y extends (self::D1::Y) → self::D1::X = dynamic> extends core::Object {
synthetic constructor •() → void
;
}
-class D2<X extends self::B<self::D2::X, self::D2::Y>, Y extends (self::D2::X) → self::D2::Y> extends core::Object {
+class D2<X extends self::B<self::D2::X, self::D2::Y> = dynamic, Y extends (self::D2::X) → self::D2::Y = dynamic> extends core::Object {
synthetic constructor •() → void
;
}
-class D3<X extends self::B<self::D3::X, self::D3::Y>, Y extends (self::D3::X, self::D3::Y) → self::D3::X> extends core::Object {
+class D3<X extends self::B<self::D3::X, self::D3::Y> = dynamic, Y extends (self::D3::X, self::D3::Y) → self::D3::X = dynamic> extends core::Object {
synthetic constructor •() → void
;
}
-class D4<X extends self::B<self::D4::X, self::D4::Y>, Y extends (self::D4::X, self::D4::Y) → self::D4::Y> extends core::Object {
+class D4<X extends self::B<self::D4::X, self::D4::Y> = dynamic, Y extends (self::D4::X, self::D4::Y) → self::D4::Y = dynamic> extends core::Object {
synthetic constructor •() → void
;
}
-class E<X extends (self::E::X) → self::E::X> extends core::Object {
+class E<X extends (self::E::X) → self::E::X = dynamic> extends core::Object {
synthetic constructor •() → void
;
}
diff --git a/pkg/front_end/testcases/instantiate_to_bound/mutual_dependence_in_literals.dart.strong.expect b/pkg/front_end/testcases/instantiate_to_bound/mutual_dependence_in_literals.dart.strong.expect
index 8a37dd2..d8c6cc7 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/mutual_dependence_in_literals.dart.strong.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/mutual_dependence_in_literals.dart.strong.expect
@@ -2,52 +2,52 @@
import self as self;
import "dart:core" as core;
-class B<X extends core::Object, Y extends core::Object> extends core::Object {
+class B<X extends core::Object = dynamic, Y extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class C1<X extends (self::C1::Y) → self::C1::X, Y extends (self::C1::Y) → self::C1::X> extends core::Object {
+class C1<X extends (self::C1::Y) → self::C1::X = (core::Null) → dynamic, Y extends (self::C1::Y) → self::C1::X = (core::Null) → dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class C2<X extends (self::C2::Y) → self::C2::X, Y extends (self::C2::X) → self::C2::Y> extends core::Object {
+class C2<X extends (self::C2::Y) → self::C2::X = (core::Null) → dynamic, Y extends (self::C2::X) → self::C2::Y = (core::Null) → dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class C3<X extends (self::C3::X, self::C3::Y) → self::C3::X, Y extends (self::C3::X, self::C3::Y) → self::C3::X> extends core::Object {
+class C3<X extends (self::C3::X, self::C3::Y) → self::C3::X = (core::Null, core::Null) → dynamic, Y extends (self::C3::X, self::C3::Y) → self::C3::X = (core::Null, core::Null) → dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class C4<X extends (self::C4::X, self::C4::Y) → self::C4::X, Y extends (self::C4::X, self::C4::Y) → self::C4::Y> extends core::Object {
+class C4<X extends (self::C4::X, self::C4::Y) → self::C4::X = (core::Null, core::Null) → dynamic, Y extends (self::C4::X, self::C4::Y) → self::C4::Y = (core::Null, core::Null) → dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class D1<X extends self::B<self::D1::X, self::D1::Y>, Y extends (self::D1::Y) → self::D1::X> extends core::Object {
+class D1<X extends self::B<self::D1::X, self::D1::Y> = self::B<dynamic, dynamic>, Y extends (self::D1::Y) → self::D1::X = (core::Null) → dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class D2<X extends self::B<self::D2::X, self::D2::Y>, Y extends (self::D2::X) → self::D2::Y> extends core::Object {
+class D2<X extends self::B<self::D2::X, self::D2::Y> = self::B<dynamic, dynamic>, Y extends (self::D2::X) → self::D2::Y = (core::Null) → dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class D3<X extends self::B<self::D3::X, self::D3::Y>, Y extends (self::D3::X, self::D3::Y) → self::D3::X> extends core::Object {
+class D3<X extends self::B<self::D3::X, self::D3::Y> = self::B<dynamic, dynamic>, Y extends (self::D3::X, self::D3::Y) → self::D3::X = (core::Null, core::Null) → dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class D4<X extends self::B<self::D4::X, self::D4::Y>, Y extends (self::D4::X, self::D4::Y) → self::D4::Y> extends core::Object {
+class D4<X extends self::B<self::D4::X, self::D4::Y> = self::B<dynamic, dynamic>, Y extends (self::D4::X, self::D4::Y) → self::D4::Y = (core::Null, core::Null) → dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class E<X extends (self::E::X) → self::E::X> extends core::Object {
+class E<X extends (self::E::X) → self::E::X = (core::Null) → dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/instantiate_to_bound/mutual_dependence_in_literals.dart.strong.transformed.expect b/pkg/front_end/testcases/instantiate_to_bound/mutual_dependence_in_literals.dart.strong.transformed.expect
index 8a37dd2..d8c6cc7 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/mutual_dependence_in_literals.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/mutual_dependence_in_literals.dart.strong.transformed.expect
@@ -2,52 +2,52 @@
import self as self;
import "dart:core" as core;
-class B<X extends core::Object, Y extends core::Object> extends core::Object {
+class B<X extends core::Object = dynamic, Y extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class C1<X extends (self::C1::Y) → self::C1::X, Y extends (self::C1::Y) → self::C1::X> extends core::Object {
+class C1<X extends (self::C1::Y) → self::C1::X = (core::Null) → dynamic, Y extends (self::C1::Y) → self::C1::X = (core::Null) → dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class C2<X extends (self::C2::Y) → self::C2::X, Y extends (self::C2::X) → self::C2::Y> extends core::Object {
+class C2<X extends (self::C2::Y) → self::C2::X = (core::Null) → dynamic, Y extends (self::C2::X) → self::C2::Y = (core::Null) → dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class C3<X extends (self::C3::X, self::C3::Y) → self::C3::X, Y extends (self::C3::X, self::C3::Y) → self::C3::X> extends core::Object {
+class C3<X extends (self::C3::X, self::C3::Y) → self::C3::X = (core::Null, core::Null) → dynamic, Y extends (self::C3::X, self::C3::Y) → self::C3::X = (core::Null, core::Null) → dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class C4<X extends (self::C4::X, self::C4::Y) → self::C4::X, Y extends (self::C4::X, self::C4::Y) → self::C4::Y> extends core::Object {
+class C4<X extends (self::C4::X, self::C4::Y) → self::C4::X = (core::Null, core::Null) → dynamic, Y extends (self::C4::X, self::C4::Y) → self::C4::Y = (core::Null, core::Null) → dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class D1<X extends self::B<self::D1::X, self::D1::Y>, Y extends (self::D1::Y) → self::D1::X> extends core::Object {
+class D1<X extends self::B<self::D1::X, self::D1::Y> = self::B<dynamic, dynamic>, Y extends (self::D1::Y) → self::D1::X = (core::Null) → dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class D2<X extends self::B<self::D2::X, self::D2::Y>, Y extends (self::D2::X) → self::D2::Y> extends core::Object {
+class D2<X extends self::B<self::D2::X, self::D2::Y> = self::B<dynamic, dynamic>, Y extends (self::D2::X) → self::D2::Y = (core::Null) → dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class D3<X extends self::B<self::D3::X, self::D3::Y>, Y extends (self::D3::X, self::D3::Y) → self::D3::X> extends core::Object {
+class D3<X extends self::B<self::D3::X, self::D3::Y> = self::B<dynamic, dynamic>, Y extends (self::D3::X, self::D3::Y) → self::D3::X = (core::Null, core::Null) → dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class D4<X extends self::B<self::D4::X, self::D4::Y>, Y extends (self::D4::X, self::D4::Y) → self::D4::Y> extends core::Object {
+class D4<X extends self::B<self::D4::X, self::D4::Y> = self::B<dynamic, dynamic>, Y extends (self::D4::X, self::D4::Y) → self::D4::Y = (core::Null, core::Null) → dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class E<X extends (self::E::X) → self::E::X> extends core::Object {
+class E<X extends (self::E::X) → self::E::X = (core::Null) → dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/instantiate_to_bound/omitted_bound.dart.direct.expect b/pkg/front_end/testcases/instantiate_to_bound/omitted_bound.dart.direct.expect
index bd60470..b7dfd8e 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/omitted_bound.dart.direct.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/omitted_bound.dart.direct.expect
@@ -3,7 +3,7 @@
import "dart:core" as core;
import "dart:collection" as col;
-class A<T extends core::Object> extends core::Object {
+class A<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/instantiate_to_bound/omitted_bound.dart.direct.transformed.expect b/pkg/front_end/testcases/instantiate_to_bound/omitted_bound.dart.direct.transformed.expect
index bd60470..b7dfd8e 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/omitted_bound.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/omitted_bound.dart.direct.transformed.expect
@@ -3,7 +3,7 @@
import "dart:core" as core;
import "dart:collection" as col;
-class A<T extends core::Object> extends core::Object {
+class A<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/instantiate_to_bound/omitted_bound.dart.outline.expect b/pkg/front_end/testcases/instantiate_to_bound/omitted_bound.dart.outline.expect
index b822c38..debf17c 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/omitted_bound.dart.outline.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/omitted_bound.dart.outline.expect
@@ -3,7 +3,7 @@
import "dart:core" as core;
import "dart:collection" as col;
-class A<T extends core::Object> extends core::Object {
+class A<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
;
}
diff --git a/pkg/front_end/testcases/instantiate_to_bound/omitted_bound.dart.strong.expect b/pkg/front_end/testcases/instantiate_to_bound/omitted_bound.dart.strong.expect
index bd60470..b7dfd8e 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/omitted_bound.dart.strong.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/omitted_bound.dart.strong.expect
@@ -3,7 +3,7 @@
import "dart:core" as core;
import "dart:collection" as col;
-class A<T extends core::Object> extends core::Object {
+class A<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/instantiate_to_bound/omitted_bound.dart.strong.transformed.expect b/pkg/front_end/testcases/instantiate_to_bound/omitted_bound.dart.strong.transformed.expect
index bd60470..b7dfd8e 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/omitted_bound.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/omitted_bound.dart.strong.transformed.expect
@@ -3,7 +3,7 @@
import "dart:core" as core;
import "dart:collection" as col;
-class A<T extends core::Object> extends core::Object {
+class A<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/instantiate_to_bound/raw_in_bound.dart.direct.expect b/pkg/front_end/testcases/instantiate_to_bound/raw_in_bound.dart.direct.expect
index bb24dfc..995aaf1 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/raw_in_bound.dart.direct.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/raw_in_bound.dart.direct.expect
@@ -2,12 +2,12 @@
import self as self;
import "dart:core" as core;
-class A<T extends core::num> extends core::Object {
+class A<T extends core::num = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class B<T extends self::A<dynamic>> extends core::Object {
+class B<T extends self::A<dynamic> = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/instantiate_to_bound/raw_in_bound.dart.direct.transformed.expect b/pkg/front_end/testcases/instantiate_to_bound/raw_in_bound.dart.direct.transformed.expect
index bb24dfc..995aaf1 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/raw_in_bound.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/raw_in_bound.dart.direct.transformed.expect
@@ -2,12 +2,12 @@
import self as self;
import "dart:core" as core;
-class A<T extends core::num> extends core::Object {
+class A<T extends core::num = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class B<T extends self::A<dynamic>> extends core::Object {
+class B<T extends self::A<dynamic> = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/instantiate_to_bound/raw_in_bound.dart.outline.expect b/pkg/front_end/testcases/instantiate_to_bound/raw_in_bound.dart.outline.expect
index 1cbb0e9..a958ced 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/raw_in_bound.dart.outline.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/raw_in_bound.dart.outline.expect
@@ -2,11 +2,11 @@
import self as self;
import "dart:core" as core;
-class A<T extends core::num> extends core::Object {
+class A<T extends core::num = dynamic> extends core::Object {
synthetic constructor •() → void
;
}
-class B<T extends self::A<dynamic>> extends core::Object {
+class B<T extends self::A<dynamic> = dynamic> extends core::Object {
synthetic constructor •() → void
;
}
diff --git a/pkg/front_end/testcases/instantiate_to_bound/raw_in_bound.dart.strong.expect b/pkg/front_end/testcases/instantiate_to_bound/raw_in_bound.dart.strong.expect
index 99ef415..465a807 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/raw_in_bound.dart.strong.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/raw_in_bound.dart.strong.expect
@@ -2,12 +2,12 @@
import self as self;
import "dart:core" as core;
-class A<T extends core::num> extends core::Object {
+class A<T extends core::num = core::num> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class B<T extends self::A<core::num>> extends core::Object {
+class B<T extends self::A<core::num> = self::A<core::num>> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/instantiate_to_bound/raw_in_bound.dart.strong.transformed.expect b/pkg/front_end/testcases/instantiate_to_bound/raw_in_bound.dart.strong.transformed.expect
index 99ef415..465a807 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/raw_in_bound.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/raw_in_bound.dart.strong.transformed.expect
@@ -2,12 +2,12 @@
import self as self;
import "dart:core" as core;
-class A<T extends core::num> extends core::Object {
+class A<T extends core::num = core::num> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-class B<T extends self::A<core::num>> extends core::Object {
+class B<T extends self::A<core::num> = self::A<core::num>> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/instantiate_to_bound/super_bounded_type.dart.direct.expect b/pkg/front_end/testcases/instantiate_to_bound/super_bounded_type.dart.direct.expect
index 2f1df6b..b0c2284 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/super_bounded_type.dart.direct.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/super_bounded_type.dart.direct.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class A<T extends self::A<self::A::T>> extends core::Object {
+class A<T extends self::A<self::A::T> = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/instantiate_to_bound/super_bounded_type.dart.direct.transformed.expect b/pkg/front_end/testcases/instantiate_to_bound/super_bounded_type.dart.direct.transformed.expect
index 2f1df6b..b0c2284 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/super_bounded_type.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/super_bounded_type.dart.direct.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class A<T extends self::A<self::A::T>> extends core::Object {
+class A<T extends self::A<self::A::T> = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/instantiate_to_bound/super_bounded_type.dart.outline.expect b/pkg/front_end/testcases/instantiate_to_bound/super_bounded_type.dart.outline.expect
index e3addef..80aba07 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/super_bounded_type.dart.outline.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/super_bounded_type.dart.outline.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class A<T extends self::A<self::A::T>> extends core::Object {
+class A<T extends self::A<self::A::T> = dynamic> extends core::Object {
synthetic constructor •() → void
;
}
diff --git a/pkg/front_end/testcases/instantiate_to_bound/super_bounded_type.dart.strong.expect b/pkg/front_end/testcases/instantiate_to_bound/super_bounded_type.dart.strong.expect
index 08af2f5..a9c0166 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/super_bounded_type.dart.strong.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/super_bounded_type.dart.strong.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class A<T extends self::A<self::A::T>> extends core::Object {
+class A<T extends self::A<self::A::T> = self::A<dynamic>> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/instantiate_to_bound/super_bounded_type.dart.strong.transformed.expect b/pkg/front_end/testcases/instantiate_to_bound/super_bounded_type.dart.strong.transformed.expect
index 08af2f5..a9c0166 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/super_bounded_type.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/super_bounded_type.dart.strong.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class A<T extends self::A<self::A::T>> extends core::Object {
+class A<T extends self::A<self::A::T> = self::A<dynamic>> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/instantiate_to_bound/supertypes.dart.direct.expect b/pkg/front_end/testcases/instantiate_to_bound/supertypes.dart.direct.expect
index 159c3d8..b090467 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/supertypes.dart.direct.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/supertypes.dart.direct.expect
@@ -8,7 +8,7 @@
: super core::Object::•()
;
}
-class X<T extends self::B> extends core::Object {
+class X<T extends self::B = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/instantiate_to_bound/supertypes.dart.direct.transformed.expect b/pkg/front_end/testcases/instantiate_to_bound/supertypes.dart.direct.transformed.expect
index 159c3d8..b090467 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/supertypes.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/supertypes.dart.direct.transformed.expect
@@ -8,7 +8,7 @@
: super core::Object::•()
;
}
-class X<T extends self::B> extends core::Object {
+class X<T extends self::B = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/instantiate_to_bound/supertypes.dart.outline.expect b/pkg/front_end/testcases/instantiate_to_bound/supertypes.dart.outline.expect
index a9960ece..95892c3 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/supertypes.dart.outline.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/supertypes.dart.outline.expect
@@ -6,7 +6,7 @@
synthetic constructor •() → void
;
}
-class X<T extends self::B> extends core::Object {
+class X<T extends self::B = dynamic> extends core::Object {
synthetic constructor •() → void
;
}
diff --git a/pkg/front_end/testcases/instantiate_to_bound/supertypes.dart.strong.expect b/pkg/front_end/testcases/instantiate_to_bound/supertypes.dart.strong.expect
index c261752..170e64b 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/supertypes.dart.strong.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/supertypes.dart.strong.expect
@@ -8,7 +8,7 @@
: super core::Object::•()
;
}
-class X<T extends self::B> extends core::Object {
+class X<T extends self::B = self::B> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/instantiate_to_bound/supertypes.dart.strong.transformed.expect b/pkg/front_end/testcases/instantiate_to_bound/supertypes.dart.strong.transformed.expect
index c261752..170e64b 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/supertypes.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/supertypes.dart.strong.transformed.expect
@@ -8,7 +8,7 @@
: super core::Object::•()
;
}
-class X<T extends self::B> extends core::Object {
+class X<T extends self::B = self::B> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/instantiate_to_bound/typedef_instantiated_in_outline.dart.direct.expect b/pkg/front_end/testcases/instantiate_to_bound/typedef_instantiated_in_outline.dart.direct.expect
index 2e8df2e..82574be 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/typedef_instantiated_in_outline.dart.direct.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/typedef_instantiated_in_outline.dart.direct.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-typedef A<T extends core::num> = (T) → dynamic;
+typedef A<T extends core::num = dynamic> = (T) → dynamic;
class B extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
diff --git a/pkg/front_end/testcases/instantiate_to_bound/typedef_instantiated_in_outline.dart.direct.transformed.expect b/pkg/front_end/testcases/instantiate_to_bound/typedef_instantiated_in_outline.dart.direct.transformed.expect
index 2e8df2e..82574be 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/typedef_instantiated_in_outline.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/typedef_instantiated_in_outline.dart.direct.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-typedef A<T extends core::num> = (T) → dynamic;
+typedef A<T extends core::num = dynamic> = (T) → dynamic;
class B extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
diff --git a/pkg/front_end/testcases/instantiate_to_bound/typedef_instantiated_in_outline.dart.outline.expect b/pkg/front_end/testcases/instantiate_to_bound/typedef_instantiated_in_outline.dart.outline.expect
index bf24d2c..1b7b1df 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/typedef_instantiated_in_outline.dart.outline.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/typedef_instantiated_in_outline.dart.outline.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-typedef A<T extends core::num> = (T) → dynamic;
+typedef A<T extends core::num = dynamic> = (T) → dynamic;
class B extends core::Object {
synthetic constructor •() → void
;
diff --git a/pkg/front_end/testcases/instantiate_to_bound/typedef_instantiated_in_outline.dart.strong.expect b/pkg/front_end/testcases/instantiate_to_bound/typedef_instantiated_in_outline.dart.strong.expect
index 52fa1cf..6c19133 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/typedef_instantiated_in_outline.dart.strong.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/typedef_instantiated_in_outline.dart.strong.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-typedef A<T extends core::num> = (T) → dynamic;
+typedef A<T extends core::num = core::num> = (T) → dynamic;
class B extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
diff --git a/pkg/front_end/testcases/instantiate_to_bound/typedef_instantiated_in_outline.dart.strong.transformed.expect b/pkg/front_end/testcases/instantiate_to_bound/typedef_instantiated_in_outline.dart.strong.transformed.expect
index 52fa1cf..6c19133 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/typedef_instantiated_in_outline.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/typedef_instantiated_in_outline.dart.strong.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-typedef A<T extends core::num> = (T) → dynamic;
+typedef A<T extends core::num = core::num> = (T) → dynamic;
class B extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
diff --git a/pkg/front_end/testcases/instantiate_to_bound/typedef_literal_list.dart.direct.expect b/pkg/front_end/testcases/instantiate_to_bound/typedef_literal_list.dart.direct.expect
index 3e9d62e..a682c5a 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/typedef_literal_list.dart.direct.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/typedef_literal_list.dart.direct.expect
@@ -2,6 +2,6 @@
import self as self;
import "dart:core" as core;
-typedef A<T extends core::num> = (T) → dynamic;
+typedef A<T extends core::num = dynamic> = (T) → dynamic;
static field dynamic a = <(dynamic) → dynamic>[];
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/instantiate_to_bound/typedef_literal_list.dart.direct.transformed.expect b/pkg/front_end/testcases/instantiate_to_bound/typedef_literal_list.dart.direct.transformed.expect
index 3e9d62e..a682c5a 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/typedef_literal_list.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/typedef_literal_list.dart.direct.transformed.expect
@@ -2,6 +2,6 @@
import self as self;
import "dart:core" as core;
-typedef A<T extends core::num> = (T) → dynamic;
+typedef A<T extends core::num = dynamic> = (T) → dynamic;
static field dynamic a = <(dynamic) → dynamic>[];
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/instantiate_to_bound/typedef_literal_list.dart.outline.expect b/pkg/front_end/testcases/instantiate_to_bound/typedef_literal_list.dart.outline.expect
index 9545c7a..4b19220 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/typedef_literal_list.dart.outline.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/typedef_literal_list.dart.outline.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-typedef A<T extends core::num> = (T) → dynamic;
+typedef A<T extends core::num = dynamic> = (T) → dynamic;
static field dynamic a;
static method main() → dynamic
;
diff --git a/pkg/front_end/testcases/instantiate_to_bound/typedef_literal_list.dart.strong.expect b/pkg/front_end/testcases/instantiate_to_bound/typedef_literal_list.dart.strong.expect
index 6194fc1..f3acf59 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/typedef_literal_list.dart.strong.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/typedef_literal_list.dart.strong.expect
@@ -2,6 +2,6 @@
import self as self;
import "dart:core" as core;
-typedef A<T extends core::num> = (T) → dynamic;
+typedef A<T extends core::num = core::num> = (T) → dynamic;
static field core::List<(core::num) → dynamic> a = <(core::num) → dynamic>[];
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/instantiate_to_bound/typedef_literal_list.dart.strong.transformed.expect b/pkg/front_end/testcases/instantiate_to_bound/typedef_literal_list.dart.strong.transformed.expect
index 6194fc1..f3acf59 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/typedef_literal_list.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/typedef_literal_list.dart.strong.transformed.expect
@@ -2,6 +2,6 @@
import self as self;
import "dart:core" as core;
-typedef A<T extends core::num> = (T) → dynamic;
+typedef A<T extends core::num = core::num> = (T) → dynamic;
static field core::List<(core::num) → dynamic> a = <(core::num) → dynamic>[];
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/instantiate_to_bound/typedef_literal_list_with_generic_argument.dart.direct.expect b/pkg/front_end/testcases/instantiate_to_bound/typedef_literal_list_with_generic_argument.dart.direct.expect
index b156915..c2775ea 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/typedef_literal_list_with_generic_argument.dart.direct.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/typedef_literal_list_with_generic_argument.dart.direct.expect
@@ -2,8 +2,8 @@
import self as self;
import "dart:core" as core;
-typedef A<T extends core::Object> = (T) → dynamic;
-class B<S extends core::Object> extends core::Object {
+typedef A<T extends core::Object = dynamic> = (T) → dynamic;
+class B<S extends core::Object = dynamic> extends core::Object {
final field core::List<(self::B::S) → dynamic> foo = <(self::B::S) → dynamic>[];
final field core::List<(core::num) → dynamic> bar = <(core::num) → dynamic>[];
synthetic constructor •() → void
diff --git a/pkg/front_end/testcases/instantiate_to_bound/typedef_literal_list_with_generic_argument.dart.direct.transformed.expect b/pkg/front_end/testcases/instantiate_to_bound/typedef_literal_list_with_generic_argument.dart.direct.transformed.expect
index b156915..c2775ea 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/typedef_literal_list_with_generic_argument.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/typedef_literal_list_with_generic_argument.dart.direct.transformed.expect
@@ -2,8 +2,8 @@
import self as self;
import "dart:core" as core;
-typedef A<T extends core::Object> = (T) → dynamic;
-class B<S extends core::Object> extends core::Object {
+typedef A<T extends core::Object = dynamic> = (T) → dynamic;
+class B<S extends core::Object = dynamic> extends core::Object {
final field core::List<(self::B::S) → dynamic> foo = <(self::B::S) → dynamic>[];
final field core::List<(core::num) → dynamic> bar = <(core::num) → dynamic>[];
synthetic constructor •() → void
diff --git a/pkg/front_end/testcases/instantiate_to_bound/typedef_literal_list_with_generic_argument.dart.outline.expect b/pkg/front_end/testcases/instantiate_to_bound/typedef_literal_list_with_generic_argument.dart.outline.expect
index fb0ee2e..de720ff 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/typedef_literal_list_with_generic_argument.dart.outline.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/typedef_literal_list_with_generic_argument.dart.outline.expect
@@ -2,8 +2,8 @@
import self as self;
import "dart:core" as core;
-typedef A<T extends core::Object> = (T) → dynamic;
-class B<S extends core::Object> extends core::Object {
+typedef A<T extends core::Object = dynamic> = (T) → dynamic;
+class B<S extends core::Object = dynamic> extends core::Object {
final field core::List<(self::B::S) → dynamic> foo;
final field core::List<(core::num) → dynamic> bar;
synthetic constructor •() → void
diff --git a/pkg/front_end/testcases/instantiate_to_bound/typedef_literal_list_with_generic_argument.dart.strong.expect b/pkg/front_end/testcases/instantiate_to_bound/typedef_literal_list_with_generic_argument.dart.strong.expect
index b156915..c2775ea 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/typedef_literal_list_with_generic_argument.dart.strong.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/typedef_literal_list_with_generic_argument.dart.strong.expect
@@ -2,8 +2,8 @@
import self as self;
import "dart:core" as core;
-typedef A<T extends core::Object> = (T) → dynamic;
-class B<S extends core::Object> extends core::Object {
+typedef A<T extends core::Object = dynamic> = (T) → dynamic;
+class B<S extends core::Object = dynamic> extends core::Object {
final field core::List<(self::B::S) → dynamic> foo = <(self::B::S) → dynamic>[];
final field core::List<(core::num) → dynamic> bar = <(core::num) → dynamic>[];
synthetic constructor •() → void
diff --git a/pkg/front_end/testcases/instantiate_to_bound/typedef_literal_list_with_generic_argument.dart.strong.transformed.expect b/pkg/front_end/testcases/instantiate_to_bound/typedef_literal_list_with_generic_argument.dart.strong.transformed.expect
index b156915..c2775ea 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/typedef_literal_list_with_generic_argument.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/typedef_literal_list_with_generic_argument.dart.strong.transformed.expect
@@ -2,8 +2,8 @@
import self as self;
import "dart:core" as core;
-typedef A<T extends core::Object> = (T) → dynamic;
-class B<S extends core::Object> extends core::Object {
+typedef A<T extends core::Object = dynamic> = (T) → dynamic;
+class B<S extends core::Object = dynamic> extends core::Object {
final field core::List<(self::B::S) → dynamic> foo = <(self::B::S) → dynamic>[];
final field core::List<(core::num) → dynamic> bar = <(core::num) → dynamic>[];
synthetic constructor •() → void
diff --git a/pkg/front_end/testcases/instantiate_to_bound/typedef_literal_map.dart.direct.expect b/pkg/front_end/testcases/instantiate_to_bound/typedef_literal_map.dart.direct.expect
index 5258ebf..cb487a9 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/typedef_literal_map.dart.direct.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/typedef_literal_map.dart.direct.expect
@@ -2,6 +2,6 @@
import self as self;
import "dart:core" as core;
-typedef A<T extends core::num> = (T) → dynamic;
+typedef A<T extends core::num = dynamic> = (T) → dynamic;
static field dynamic a = <(dynamic) → dynamic, (dynamic) → dynamic>{};
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/instantiate_to_bound/typedef_literal_map.dart.direct.transformed.expect b/pkg/front_end/testcases/instantiate_to_bound/typedef_literal_map.dart.direct.transformed.expect
index 5258ebf..cb487a9 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/typedef_literal_map.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/typedef_literal_map.dart.direct.transformed.expect
@@ -2,6 +2,6 @@
import self as self;
import "dart:core" as core;
-typedef A<T extends core::num> = (T) → dynamic;
+typedef A<T extends core::num = dynamic> = (T) → dynamic;
static field dynamic a = <(dynamic) → dynamic, (dynamic) → dynamic>{};
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/instantiate_to_bound/typedef_literal_map.dart.outline.expect b/pkg/front_end/testcases/instantiate_to_bound/typedef_literal_map.dart.outline.expect
index 9545c7a..4b19220 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/typedef_literal_map.dart.outline.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/typedef_literal_map.dart.outline.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-typedef A<T extends core::num> = (T) → dynamic;
+typedef A<T extends core::num = dynamic> = (T) → dynamic;
static field dynamic a;
static method main() → dynamic
;
diff --git a/pkg/front_end/testcases/instantiate_to_bound/typedef_literal_map.dart.strong.expect b/pkg/front_end/testcases/instantiate_to_bound/typedef_literal_map.dart.strong.expect
index c2e8007..fe31568 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/typedef_literal_map.dart.strong.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/typedef_literal_map.dart.strong.expect
@@ -2,6 +2,6 @@
import self as self;
import "dart:core" as core;
-typedef A<T extends core::num> = (T) → dynamic;
+typedef A<T extends core::num = core::num> = (T) → dynamic;
static field core::Map<(core::num) → dynamic, (core::num) → dynamic> a = <(core::num) → dynamic, (core::num) → dynamic>{};
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/instantiate_to_bound/typedef_literal_map.dart.strong.transformed.expect b/pkg/front_end/testcases/instantiate_to_bound/typedef_literal_map.dart.strong.transformed.expect
index c2e8007..fe31568 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/typedef_literal_map.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/typedef_literal_map.dart.strong.transformed.expect
@@ -2,6 +2,6 @@
import self as self;
import "dart:core" as core;
-typedef A<T extends core::num> = (T) → dynamic;
+typedef A<T extends core::num = core::num> = (T) → dynamic;
static field core::Map<(core::num) → dynamic, (core::num) → dynamic> a = <(core::num) → dynamic, (core::num) → dynamic>{};
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/instantiate_to_bound/typedef_omitted_bound.dart.direct.expect b/pkg/front_end/testcases/instantiate_to_bound/typedef_omitted_bound.dart.direct.expect
index f3c3c27..b7cb482 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/typedef_omitted_bound.dart.direct.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/typedef_omitted_bound.dart.direct.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-typedef A<T extends core::Object> = (T) → dynamic;
+typedef A<T extends core::Object = dynamic> = (T) → dynamic;
class C extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
diff --git a/pkg/front_end/testcases/instantiate_to_bound/typedef_omitted_bound.dart.direct.transformed.expect b/pkg/front_end/testcases/instantiate_to_bound/typedef_omitted_bound.dart.direct.transformed.expect
index f3c3c27..b7cb482 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/typedef_omitted_bound.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/typedef_omitted_bound.dart.direct.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-typedef A<T extends core::Object> = (T) → dynamic;
+typedef A<T extends core::Object = dynamic> = (T) → dynamic;
class C extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
diff --git a/pkg/front_end/testcases/instantiate_to_bound/typedef_omitted_bound.dart.outline.expect b/pkg/front_end/testcases/instantiate_to_bound/typedef_omitted_bound.dart.outline.expect
index 6a2e4db..a88799c 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/typedef_omitted_bound.dart.outline.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/typedef_omitted_bound.dart.outline.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-typedef A<T extends core::Object> = (T) → dynamic;
+typedef A<T extends core::Object = dynamic> = (T) → dynamic;
class C extends core::Object {
synthetic constructor •() → void
;
diff --git a/pkg/front_end/testcases/instantiate_to_bound/typedef_omitted_bound.dart.strong.expect b/pkg/front_end/testcases/instantiate_to_bound/typedef_omitted_bound.dart.strong.expect
index f3c3c27..b7cb482 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/typedef_omitted_bound.dart.strong.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/typedef_omitted_bound.dart.strong.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-typedef A<T extends core::Object> = (T) → dynamic;
+typedef A<T extends core::Object = dynamic> = (T) → dynamic;
class C extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
diff --git a/pkg/front_end/testcases/instantiate_to_bound/typedef_omitted_bound.dart.strong.transformed.expect b/pkg/front_end/testcases/instantiate_to_bound/typedef_omitted_bound.dart.strong.transformed.expect
index f3c3c27..b7cb482 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/typedef_omitted_bound.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/typedef_omitted_bound.dart.strong.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-typedef A<T extends core::Object> = (T) → dynamic;
+typedef A<T extends core::Object = dynamic> = (T) → dynamic;
class C extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
diff --git a/pkg/front_end/testcases/instantiate_to_bound/typedef_raw_in_bound.dart.direct.expect b/pkg/front_end/testcases/instantiate_to_bound/typedef_raw_in_bound.dart.direct.expect
index ddb4888..7df4a93 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/typedef_raw_in_bound.dart.direct.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/typedef_raw_in_bound.dart.direct.expect
@@ -2,8 +2,8 @@
import self as self;
import "dart:core" as core;
-typedef A<T extends core::num> = (T) → dynamic;
-class B<T extends (dynamic) → dynamic> extends core::Object {
+typedef A<T extends core::num = dynamic> = (T) → dynamic;
+class B<T extends (dynamic) → dynamic = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/instantiate_to_bound/typedef_raw_in_bound.dart.direct.transformed.expect b/pkg/front_end/testcases/instantiate_to_bound/typedef_raw_in_bound.dart.direct.transformed.expect
index ddb4888..7df4a93 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/typedef_raw_in_bound.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/typedef_raw_in_bound.dart.direct.transformed.expect
@@ -2,8 +2,8 @@
import self as self;
import "dart:core" as core;
-typedef A<T extends core::num> = (T) → dynamic;
-class B<T extends (dynamic) → dynamic> extends core::Object {
+typedef A<T extends core::num = dynamic> = (T) → dynamic;
+class B<T extends (dynamic) → dynamic = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/instantiate_to_bound/typedef_raw_in_bound.dart.outline.expect b/pkg/front_end/testcases/instantiate_to_bound/typedef_raw_in_bound.dart.outline.expect
index 8e00857..f7220cb 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/typedef_raw_in_bound.dart.outline.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/typedef_raw_in_bound.dart.outline.expect
@@ -2,8 +2,8 @@
import self as self;
import "dart:core" as core;
-typedef A<T extends core::num> = (T) → dynamic;
-class B<T extends (dynamic) → dynamic> extends core::Object {
+typedef A<T extends core::num = dynamic> = (T) → dynamic;
+class B<T extends (dynamic) → dynamic = dynamic> extends core::Object {
synthetic constructor •() → void
;
}
diff --git a/pkg/front_end/testcases/instantiate_to_bound/typedef_raw_in_bound.dart.strong.expect b/pkg/front_end/testcases/instantiate_to_bound/typedef_raw_in_bound.dart.strong.expect
index 03b6e9c..97ca06a 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/typedef_raw_in_bound.dart.strong.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/typedef_raw_in_bound.dart.strong.expect
@@ -2,8 +2,8 @@
import self as self;
import "dart:core" as core;
-typedef A<T extends core::num> = (T) → dynamic;
-class B<T extends (core::num) → dynamic> extends core::Object {
+typedef A<T extends core::num = core::num> = (T) → dynamic;
+class B<T extends (core::num) → dynamic = (core::num) → dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/instantiate_to_bound/typedef_raw_in_bound.dart.strong.transformed.expect b/pkg/front_end/testcases/instantiate_to_bound/typedef_raw_in_bound.dart.strong.transformed.expect
index 03b6e9c..97ca06a 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/typedef_raw_in_bound.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/typedef_raw_in_bound.dart.strong.transformed.expect
@@ -2,8 +2,8 @@
import self as self;
import "dart:core" as core;
-typedef A<T extends core::num> = (T) → dynamic;
-class B<T extends (core::num) → dynamic> extends core::Object {
+typedef A<T extends core::num = core::num> = (T) → dynamic;
+class B<T extends (core::num) → dynamic = (core::num) → dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/instantiate_to_bound/typedef_super_bounded_type.dart.direct.expect b/pkg/front_end/testcases/instantiate_to_bound/typedef_super_bounded_type.dart.direct.expect
index 819253e..caa1662 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/typedef_super_bounded_type.dart.direct.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/typedef_super_bounded_type.dart.direct.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-typedef A<T extends core::Object> = (T) → dynamic;
-typedef B<S extends (S) → dynamic> = (S) → dynamic;
+typedef A<T extends core::Object = dynamic> = (T) → dynamic;
+typedef B<S extends (S) → dynamic = dynamic> = (S) → dynamic;
static field (dynamic) → dynamic b;
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/instantiate_to_bound/typedef_super_bounded_type.dart.direct.transformed.expect b/pkg/front_end/testcases/instantiate_to_bound/typedef_super_bounded_type.dart.direct.transformed.expect
index 819253e..caa1662 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/typedef_super_bounded_type.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/typedef_super_bounded_type.dart.direct.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-typedef A<T extends core::Object> = (T) → dynamic;
-typedef B<S extends (S) → dynamic> = (S) → dynamic;
+typedef A<T extends core::Object = dynamic> = (T) → dynamic;
+typedef B<S extends (S) → dynamic = dynamic> = (S) → dynamic;
static field (dynamic) → dynamic b;
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/instantiate_to_bound/typedef_super_bounded_type.dart.outline.expect b/pkg/front_end/testcases/instantiate_to_bound/typedef_super_bounded_type.dart.outline.expect
index 61fcce0..68eb853 100644
--- a/pkg/front_end/testcases/instantiate_to_bound/typedef_super_bounded_type.dart.outline.expect
+++ b/pkg/front_end/testcases/instantiate_to_bound/typedef_super_bounded_type.dart.outline.expect
@@ -2,8 +2,8 @@
import self as self;
import "dart:core" as core;
-typedef A<T extends core::Object> = (T) → dynamic;
-typedef B<S extends (S) → dynamic> = (S) → dynamic;
+typedef A<T extends core::Object = dynamic> = (T) → dynamic;
+typedef B<S extends (S) → dynamic = dynamic> = (S) → dynamic;
static field (dynamic) → dynamic b;
static method main() → dynamic
;
diff --git a/pkg/front_end/testcases/local_generic_function.dart.direct.expect b/pkg/front_end/testcases/local_generic_function.dart.direct.expect
index 204a1a3..26709f0 100644
--- a/pkg/front_end/testcases/local_generic_function.dart.direct.expect
+++ b/pkg/front_end/testcases/local_generic_function.dart.direct.expect
@@ -3,7 +3,7 @@
import "dart:core" as core;
static method main() → dynamic {
- function f<T extends core::Object>(core::List<T> l) → T
+ function f<T extends core::Object = dynamic>(core::List<T> l) → T
return l.[](0);
dynamic x = f.call(<dynamic>[0]);
}
diff --git a/pkg/front_end/testcases/local_generic_function.dart.direct.transformed.expect b/pkg/front_end/testcases/local_generic_function.dart.direct.transformed.expect
index 204a1a3..26709f0 100644
--- a/pkg/front_end/testcases/local_generic_function.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/local_generic_function.dart.direct.transformed.expect
@@ -3,7 +3,7 @@
import "dart:core" as core;
static method main() → dynamic {
- function f<T extends core::Object>(core::List<T> l) → T
+ function f<T extends core::Object = dynamic>(core::List<T> l) → T
return l.[](0);
dynamic x = f.call(<dynamic>[0]);
}
diff --git a/pkg/front_end/testcases/local_generic_function.dart.strong.expect b/pkg/front_end/testcases/local_generic_function.dart.strong.expect
index 8f00c9d..f3d3e87 100644
--- a/pkg/front_end/testcases/local_generic_function.dart.strong.expect
+++ b/pkg/front_end/testcases/local_generic_function.dart.strong.expect
@@ -3,7 +3,7 @@
import "dart:core" as core;
static method main() → dynamic {
- function f<T extends core::Object>(core::List<T> l) → T
+ function f<T extends core::Object = dynamic>(core::List<T> l) → T
return l.{core::List::[]}(0);
core::int x = f.call<core::int>(<core::int>[0]);
}
diff --git a/pkg/front_end/testcases/local_generic_function.dart.strong.transformed.expect b/pkg/front_end/testcases/local_generic_function.dart.strong.transformed.expect
index 8f00c9d..f3d3e87 100644
--- a/pkg/front_end/testcases/local_generic_function.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/local_generic_function.dart.strong.transformed.expect
@@ -3,7 +3,7 @@
import "dart:core" as core;
static method main() → dynamic {
- function f<T extends core::Object>(core::List<T> l) → T
+ function f<T extends core::Object = dynamic>(core::List<T> l) → T
return l.{core::List::[]}(0);
core::int x = f.call<core::int>(<core::int>[0]);
}
diff --git a/pkg/front_end/testcases/mixin.dart.direct.expect b/pkg/front_end/testcases/mixin.dart.direct.expect
index 7ebdddc..249e126 100644
--- a/pkg/front_end/testcases/mixin.dart.direct.expect
+++ b/pkg/front_end/testcases/mixin.dart.direct.expect
@@ -34,16 +34,16 @@
: super core::Object::•()
;
}
-abstract class G1<T extends core::Object> extends core::Object {
+abstract class G1<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
method m() → dynamic
return core::print(self::G1::T);
}
-abstract class _D&Object&G1<S extends core::Object> = core::Object with self::G1<self::_D&Object&G1::S> {
+abstract class _D&Object&G1<S extends core::Object = dynamic> = core::Object with self::G1<self::_D&Object&G1::S> {
}
-class D<S extends core::Object> extends self::_D&Object&G1<self::D::S> {
+class D<S extends core::Object = dynamic> extends self::_D&Object&G1<self::D::S> {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/mixin.dart.direct.transformed.expect b/pkg/front_end/testcases/mixin.dart.direct.transformed.expect
index 572573a..c3b7891 100644
--- a/pkg/front_end/testcases/mixin.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/mixin.dart.direct.transformed.expect
@@ -54,21 +54,21 @@
: super core::Object::•()
;
}
-abstract class G1<T extends core::Object> extends core::Object {
+abstract class G1<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
method m() → dynamic
return core::print(self::G1::T);
}
-abstract class _D&Object&G1<S extends core::Object> extends core::Object implements self::G1<self::_D&Object&G1::S> {
+abstract class _D&Object&G1<S extends core::Object = dynamic> extends core::Object implements self::G1<self::_D&Object&G1::S> {
synthetic constructor •() → void
: super core::Object::•()
;
method m() → dynamic
return core::print(self::_D&Object&G1::S);
}
-class D<S extends core::Object> extends self::_D&Object&G1<self::D::S> {
+class D<S extends core::Object = dynamic> extends self::_D&Object&G1<self::D::S> {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/mixin.dart.outline.expect b/pkg/front_end/testcases/mixin.dart.outline.expect
index ec5b2f3..35f0145 100644
--- a/pkg/front_end/testcases/mixin.dart.outline.expect
+++ b/pkg/front_end/testcases/mixin.dart.outline.expect
@@ -30,15 +30,15 @@
constructor •(dynamic value) → void
;
}
-abstract class G1<T extends core::Object> extends core::Object {
+abstract class G1<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
;
method m() → dynamic
;
}
-abstract class _D&Object&G1<S extends core::Object> = core::Object with self::G1<self::_D&Object&G1::S> {
+abstract class _D&Object&G1<S extends core::Object = dynamic> = core::Object with self::G1<self::_D&Object&G1::S> {
}
-class D<S extends core::Object> extends self::_D&Object&G1<self::D::S> {
+class D<S extends core::Object = dynamic> extends self::_D&Object&G1<self::D::S> {
synthetic constructor •() → void
;
}
diff --git a/pkg/front_end/testcases/mixin.dart.strong.expect b/pkg/front_end/testcases/mixin.dart.strong.expect
index b60be6e..675b2e9 100644
--- a/pkg/front_end/testcases/mixin.dart.strong.expect
+++ b/pkg/front_end/testcases/mixin.dart.strong.expect
@@ -34,16 +34,16 @@
: super core::Object::•()
;
}
-abstract class G1<T extends core::Object> extends core::Object {
+abstract class G1<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
method m() → dynamic
return core::print(self::G1::T);
}
-abstract class _D&Object&G1<S extends core::Object> = core::Object with self::G1<self::_D&Object&G1::S> {
+abstract class _D&Object&G1<S extends core::Object = dynamic> = core::Object with self::G1<self::_D&Object&G1::S> {
}
-class D<S extends core::Object> extends self::_D&Object&G1<self::D::S> {
+class D<S extends core::Object = dynamic> extends self::_D&Object&G1<self::D::S> {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/mixin.dart.strong.transformed.expect b/pkg/front_end/testcases/mixin.dart.strong.transformed.expect
index e84c17f..12ddf25 100644
--- a/pkg/front_end/testcases/mixin.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/mixin.dart.strong.transformed.expect
@@ -54,21 +54,21 @@
: super core::Object::•()
;
}
-abstract class G1<T extends core::Object> extends core::Object {
+abstract class G1<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
method m() → dynamic
return core::print(self::G1::T);
}
-abstract class _D&Object&G1<S extends core::Object> extends core::Object implements self::G1<self::_D&Object&G1::S> {
+abstract class _D&Object&G1<S extends core::Object = dynamic> extends core::Object implements self::G1<self::_D&Object&G1::S> {
synthetic constructor •() → void
: super core::Object::•()
;
method m() → dynamic
return core::print(self::_D&Object&G1::S);
}
-class D<S extends core::Object> extends self::_D&Object&G1<self::D::S> {
+class D<S extends core::Object = dynamic> extends self::_D&Object&G1<self::D::S> {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/mixin_inherited_setter_for_mixed_in_field.dart.direct.expect b/pkg/front_end/testcases/mixin_inherited_setter_for_mixed_in_field.dart.direct.expect
index 4affa80..9d1770e 100644
--- a/pkg/front_end/testcases/mixin_inherited_setter_for_mixed_in_field.dart.direct.expect
+++ b/pkg/front_end/testcases/mixin_inherited_setter_for_mixed_in_field.dart.direct.expect
@@ -7,7 +7,7 @@
: super core::Object::•()
;
}
-class C<T extends self::A> extends core::Object {
+class C<T extends self::A = dynamic> extends core::Object {
field self::C::T _field = null;
synthetic constructor •() → void
: super core::Object::•()
diff --git a/pkg/front_end/testcases/mixin_inherited_setter_for_mixed_in_field.dart.direct.transformed.expect b/pkg/front_end/testcases/mixin_inherited_setter_for_mixed_in_field.dart.direct.transformed.expect
index 6424b60..0e95fd1 100644
--- a/pkg/front_end/testcases/mixin_inherited_setter_for_mixed_in_field.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/mixin_inherited_setter_for_mixed_in_field.dart.direct.transformed.expect
@@ -7,7 +7,7 @@
: super core::Object::•()
;
}
-class C<T extends self::A> extends core::Object {
+class C<T extends self::A = dynamic> extends core::Object {
field self::C::T _field = null;
synthetic constructor •() → void
: super core::Object::•()
diff --git a/pkg/front_end/testcases/mixin_inherited_setter_for_mixed_in_field.dart.outline.expect b/pkg/front_end/testcases/mixin_inherited_setter_for_mixed_in_field.dart.outline.expect
index dbe9a87..9409948 100644
--- a/pkg/front_end/testcases/mixin_inherited_setter_for_mixed_in_field.dart.outline.expect
+++ b/pkg/front_end/testcases/mixin_inherited_setter_for_mixed_in_field.dart.outline.expect
@@ -6,7 +6,7 @@
synthetic constructor •() → void
;
}
-class C<T extends self::A> extends core::Object {
+class C<T extends self::A = dynamic> extends core::Object {
field self::C::T _field;
synthetic constructor •() → void
;
diff --git a/pkg/front_end/testcases/mixin_inherited_setter_for_mixed_in_field.dart.strong.expect b/pkg/front_end/testcases/mixin_inherited_setter_for_mixed_in_field.dart.strong.expect
index 453c4fe..3600b5a 100644
--- a/pkg/front_end/testcases/mixin_inherited_setter_for_mixed_in_field.dart.strong.expect
+++ b/pkg/front_end/testcases/mixin_inherited_setter_for_mixed_in_field.dart.strong.expect
@@ -7,7 +7,7 @@
: super core::Object::•()
;
}
-class C<T extends self::A> extends core::Object {
+class C<T extends self::A = self::A> extends core::Object {
generic-covariant-impl generic-covariant-interface field self::C::T _field = null;
synthetic constructor •() → void
: super core::Object::•()
diff --git a/pkg/front_end/testcases/mixin_inherited_setter_for_mixed_in_field.dart.strong.transformed.expect b/pkg/front_end/testcases/mixin_inherited_setter_for_mixed_in_field.dart.strong.transformed.expect
index 79519a1..94cb3e5 100644
--- a/pkg/front_end/testcases/mixin_inherited_setter_for_mixed_in_field.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/mixin_inherited_setter_for_mixed_in_field.dart.strong.transformed.expect
@@ -7,7 +7,7 @@
: super core::Object::•()
;
}
-class C<T extends self::A> extends core::Object {
+class C<T extends self::A = self::A> extends core::Object {
generic-covariant-impl generic-covariant-interface field self::C::T _field = null;
synthetic constructor •() → void
: super core::Object::•()
diff --git a/pkg/front_end/testcases/named_function_scope.dart.direct.expect b/pkg/front_end/testcases/named_function_scope.dart.direct.expect
index a6a572a..637e4c1 100644
--- a/pkg/front_end/testcases/named_function_scope.dart.direct.expect
+++ b/pkg/front_end/testcases/named_function_scope.dart.direct.expect
@@ -59,7 +59,7 @@
{
dynamic x = let final dynamic #t4 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/named_function_scope.dart:63:9: Error: 'T' is already declared in this scope.
T< /*@context=DuplicatedNameCause*/ T>() {};
- ^" in let final <T extends core::Object>() → dynamic T = <T extends core::Object>() → dynamic {} in T;
+ ^" in let final <T extends core::Object = dynamic>() → dynamic T = <T extends core::Object = dynamic>() → dynamic {} in T;
}
{
self::T t;
diff --git a/pkg/front_end/testcases/named_function_scope.dart.direct.transformed.expect b/pkg/front_end/testcases/named_function_scope.dart.direct.transformed.expect
index a6a572a..637e4c1 100644
--- a/pkg/front_end/testcases/named_function_scope.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/named_function_scope.dart.direct.transformed.expect
@@ -59,7 +59,7 @@
{
dynamic x = let final dynamic #t4 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/named_function_scope.dart:63:9: Error: 'T' is already declared in this scope.
T< /*@context=DuplicatedNameCause*/ T>() {};
- ^" in let final <T extends core::Object>() → dynamic T = <T extends core::Object>() → dynamic {} in T;
+ ^" in let final <T extends core::Object = dynamic>() → dynamic T = <T extends core::Object = dynamic>() → dynamic {} in T;
}
{
self::T t;
diff --git a/pkg/front_end/testcases/named_function_scope.dart.strong.expect b/pkg/front_end/testcases/named_function_scope.dart.strong.expect
index c207784..3c4db65 100644
--- a/pkg/front_end/testcases/named_function_scope.dart.strong.expect
+++ b/pkg/front_end/testcases/named_function_scope.dart.strong.expect
@@ -61,7 +61,7 @@
{
dynamic x = let final dynamic #t4 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/named_function_scope.dart:63:9: Error: 'T' is already declared in this scope.
T< /*@context=DuplicatedNameCause*/ T>() {};
- ^" in let final <T extends core::Object>() → dynamic T = <T extends core::Object>() → dynamic {} in T;
+ ^" in let final <T extends core::Object = dynamic>() → dynamic T = <T extends core::Object = dynamic>() → dynamic {} in T;
}
{
self::T t;
diff --git a/pkg/front_end/testcases/named_function_scope.dart.strong.transformed.expect b/pkg/front_end/testcases/named_function_scope.dart.strong.transformed.expect
index 4fcb933..155e18a 100644
--- a/pkg/front_end/testcases/named_function_scope.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/named_function_scope.dart.strong.transformed.expect
@@ -61,7 +61,7 @@
{
dynamic x = let final dynamic #t4 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/named_function_scope.dart:63:9: Error: 'T' is already declared in this scope.
T< /*@context=DuplicatedNameCause*/ T>() {};
- ^" in let final <T extends core::Object>() → dynamic T = <T extends core::Object>() → dynamic {} in T;
+ ^" in let final <T extends core::Object = dynamic>() → dynamic T = <T extends core::Object = dynamic>() → dynamic {} in T;
}
{
self::T t;
diff --git a/pkg/front_end/testcases/no_such_method_forwarders/subst_on_forwarder.dart.direct.expect b/pkg/front_end/testcases/no_such_method_forwarders/subst_on_forwarder.dart.direct.expect
index bf9c46c..4ff7688 100644
--- a/pkg/front_end/testcases/no_such_method_forwarders/subst_on_forwarder.dart.direct.expect
+++ b/pkg/front_end/testcases/no_such_method_forwarders/subst_on_forwarder.dart.direct.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-abstract class I<T extends core::Object> extends core::Object {
+abstract class I<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/no_such_method_forwarders/subst_on_forwarder.dart.direct.transformed.expect b/pkg/front_end/testcases/no_such_method_forwarders/subst_on_forwarder.dart.direct.transformed.expect
index 32ef81f..01d96cb 100644
--- a/pkg/front_end/testcases/no_such_method_forwarders/subst_on_forwarder.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/no_such_method_forwarders/subst_on_forwarder.dart.direct.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-abstract class I<T extends core::Object> extends core::Object {
+abstract class I<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/no_such_method_forwarders/subst_on_forwarder.dart.outline.expect b/pkg/front_end/testcases/no_such_method_forwarders/subst_on_forwarder.dart.outline.expect
index 969a34b..7e40698 100644
--- a/pkg/front_end/testcases/no_such_method_forwarders/subst_on_forwarder.dart.outline.expect
+++ b/pkg/front_end/testcases/no_such_method_forwarders/subst_on_forwarder.dart.outline.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-abstract class I<T extends core::Object> extends core::Object {
+abstract class I<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
;
abstract method foo() → self::I::T;
diff --git a/pkg/front_end/testcases/no_such_method_forwarders/subst_on_forwarder.dart.strong.expect b/pkg/front_end/testcases/no_such_method_forwarders/subst_on_forwarder.dart.strong.expect
index bf9c46c..4ff7688 100644
--- a/pkg/front_end/testcases/no_such_method_forwarders/subst_on_forwarder.dart.strong.expect
+++ b/pkg/front_end/testcases/no_such_method_forwarders/subst_on_forwarder.dart.strong.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-abstract class I<T extends core::Object> extends core::Object {
+abstract class I<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/no_such_method_forwarders/subst_on_forwarder.dart.strong.transformed.expect b/pkg/front_end/testcases/no_such_method_forwarders/subst_on_forwarder.dart.strong.transformed.expect
index 32ef81f..01d96cb 100644
--- a/pkg/front_end/testcases/no_such_method_forwarders/subst_on_forwarder.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/no_such_method_forwarders/subst_on_forwarder.dart.strong.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-abstract class I<T extends core::Object> extends core::Object {
+abstract class I<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/override_check_two_substitutions.dart.direct.expect b/pkg/front_end/testcases/override_check_two_substitutions.dart.direct.expect
index 0273119..edbd26a 100644
--- a/pkg/front_end/testcases/override_check_two_substitutions.dart.direct.expect
+++ b/pkg/front_end/testcases/override_check_two_substitutions.dart.direct.expect
@@ -2,16 +2,16 @@
import self as self;
import "dart:core" as core;
-class A<T extends core::Object> extends core::Object {
+class A<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
- method f<U extends core::Object>(core::Map<self::A::T, self::A::f::U> m) → void {}
+ method f<U extends core::Object = dynamic>(core::Map<self::A::T, self::A::f::U> m) → void {}
}
class B extends self::A<core::String> {
synthetic constructor •() → void
: super self::A::•()
;
- method f<V extends core::Object>(core::Map<core::String, self::B::f::V> m) → void {}
+ method f<V extends core::Object = dynamic>(core::Map<core::String, self::B::f::V> m) → void {}
}
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/override_check_two_substitutions.dart.direct.transformed.expect b/pkg/front_end/testcases/override_check_two_substitutions.dart.direct.transformed.expect
index 0273119..edbd26a 100644
--- a/pkg/front_end/testcases/override_check_two_substitutions.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/override_check_two_substitutions.dart.direct.transformed.expect
@@ -2,16 +2,16 @@
import self as self;
import "dart:core" as core;
-class A<T extends core::Object> extends core::Object {
+class A<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
- method f<U extends core::Object>(core::Map<self::A::T, self::A::f::U> m) → void {}
+ method f<U extends core::Object = dynamic>(core::Map<self::A::T, self::A::f::U> m) → void {}
}
class B extends self::A<core::String> {
synthetic constructor •() → void
: super self::A::•()
;
- method f<V extends core::Object>(core::Map<core::String, self::B::f::V> m) → void {}
+ method f<V extends core::Object = dynamic>(core::Map<core::String, self::B::f::V> m) → void {}
}
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/override_check_two_substitutions.dart.outline.expect b/pkg/front_end/testcases/override_check_two_substitutions.dart.outline.expect
index 5c2a82a..b2cfae4 100644
--- a/pkg/front_end/testcases/override_check_two_substitutions.dart.outline.expect
+++ b/pkg/front_end/testcases/override_check_two_substitutions.dart.outline.expect
@@ -2,16 +2,16 @@
import self as self;
import "dart:core" as core;
-class A<T extends core::Object> extends core::Object {
+class A<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
;
- method f<U extends core::Object>(core::Map<self::A::T, self::A::f::U> m) → void
+ method f<U extends core::Object = dynamic>(core::Map<self::A::T, self::A::f::U> m) → void
;
}
class B extends self::A<core::String> {
synthetic constructor •() → void
;
- method f<V extends core::Object>(core::Map<core::String, self::B::f::V> m) → void
+ method f<V extends core::Object = dynamic>(core::Map<core::String, self::B::f::V> m) → void
;
}
static method main() → dynamic
diff --git a/pkg/front_end/testcases/override_check_two_substitutions.dart.strong.expect b/pkg/front_end/testcases/override_check_two_substitutions.dart.strong.expect
index 5871307..3d2edc0 100644
--- a/pkg/front_end/testcases/override_check_two_substitutions.dart.strong.expect
+++ b/pkg/front_end/testcases/override_check_two_substitutions.dart.strong.expect
@@ -2,16 +2,16 @@
import self as self;
import "dart:core" as core;
-class A<T extends core::Object> extends core::Object {
+class A<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
- method f<U extends core::Object>(generic-covariant-impl generic-covariant-interface core::Map<self::A::T, self::A::f::U> m) → void {}
+ method f<U extends core::Object = dynamic>(generic-covariant-impl generic-covariant-interface core::Map<self::A::T, self::A::f::U> m) → void {}
}
class B extends self::A<core::String> {
synthetic constructor •() → void
: super self::A::•()
;
- method f<V extends core::Object>(generic-covariant-impl core::Map<core::String, self::B::f::V> m) → void {}
+ method f<V extends core::Object = dynamic>(generic-covariant-impl core::Map<core::String, self::B::f::V> m) → void {}
}
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/override_check_two_substitutions.dart.strong.transformed.expect b/pkg/front_end/testcases/override_check_two_substitutions.dart.strong.transformed.expect
index 5871307..3d2edc0 100644
--- a/pkg/front_end/testcases/override_check_two_substitutions.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/override_check_two_substitutions.dart.strong.transformed.expect
@@ -2,16 +2,16 @@
import self as self;
import "dart:core" as core;
-class A<T extends core::Object> extends core::Object {
+class A<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
- method f<U extends core::Object>(generic-covariant-impl generic-covariant-interface core::Map<self::A::T, self::A::f::U> m) → void {}
+ method f<U extends core::Object = dynamic>(generic-covariant-impl generic-covariant-interface core::Map<self::A::T, self::A::f::U> m) → void {}
}
class B extends self::A<core::String> {
synthetic constructor •() → void
: super self::A::•()
;
- method f<V extends core::Object>(generic-covariant-impl core::Map<core::String, self::B::f::V> m) → void {}
+ method f<V extends core::Object = dynamic>(generic-covariant-impl core::Map<core::String, self::B::f::V> m) → void {}
}
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/qualified.dart.direct.expect b/pkg/front_end/testcases/qualified.dart.direct.expect
index 9a7583a..545aedf 100644
--- a/pkg/front_end/testcases/qualified.dart.direct.expect
+++ b/pkg/front_end/testcases/qualified.dart.direct.expect
@@ -14,7 +14,7 @@
: super lib::Supertype::•()
;
}
-class C<T extends core::Object> extends core::Object { // from org-dartlang-testcase:///qualified_part.dart
+class C<T extends core::Object = dynamic> extends core::Object { // from org-dartlang-testcase:///qualified_part.dart
static field dynamic _redirecting# = <dynamic>[self::C::b];
constructor •() → void
: super core::Object::•()
@@ -22,7 +22,7 @@
constructor a() → void
: super core::Object::•()
;
- static factory b<T extends core::Object>() → self::C<self::C::b::T>
+ static factory b<T extends core::Object = dynamic>() → self::C<self::C::b::T>
let dynamic #redirecting_factory = lib::C::b in let self::C::b::T #typeArg0 = null in invalid-expression;
}
static const field dynamic #errors = const <dynamic>["pkg/front_end/testcases/qualified.dart:11:19: Error: Type 'lib.Missing' not found.
diff --git a/pkg/front_end/testcases/qualified.dart.direct.transformed.expect b/pkg/front_end/testcases/qualified.dart.direct.transformed.expect
index a428888..de3c17e 100644
--- a/pkg/front_end/testcases/qualified.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/qualified.dart.direct.transformed.expect
@@ -20,7 +20,7 @@
: super lib::Supertype::•()
;
}
-class C<T extends core::Object> extends core::Object { // from org-dartlang-testcase:///qualified_part.dart
+class C<T extends core::Object = dynamic> extends core::Object { // from org-dartlang-testcase:///qualified_part.dart
static field dynamic _redirecting# = <dynamic>[self::C::b];
constructor •() → void
: super core::Object::•()
@@ -28,7 +28,7 @@
constructor a() → void
: super core::Object::•()
;
- static factory b<T extends core::Object>() → self::C<self::C::b::T>
+ static factory b<T extends core::Object = dynamic>() → self::C<self::C::b::T>
let dynamic #redirecting_factory = lib::C::b in let self::C::b::T #typeArg0 = null in invalid-expression;
}
static const field dynamic #errors = const <dynamic>["pkg/front_end/testcases/qualified.dart:11:19: Error: Type 'lib.Missing' not found.
diff --git a/pkg/front_end/testcases/qualified.dart.outline.expect b/pkg/front_end/testcases/qualified.dart.outline.expect
index 1214470..b04c33a 100644
--- a/pkg/front_end/testcases/qualified.dart.outline.expect
+++ b/pkg/front_end/testcases/qualified.dart.outline.expect
@@ -15,13 +15,13 @@
synthetic constructor •() → void
;
}
-class C<T extends core::Object> extends core::Object { // from org-dartlang-testcase:///qualified_part.dart
+class C<T extends core::Object = dynamic> extends core::Object { // from org-dartlang-testcase:///qualified_part.dart
static field dynamic _redirecting# = <dynamic>[self::C::b];
constructor •() → void
;
constructor a() → void
;
- static factory b<T extends core::Object>() → self::C<self::C::b::T>
+ static factory b<T extends core::Object = dynamic>() → self::C<self::C::b::T>
let dynamic #redirecting_factory = lib::C::b in let self::C::b::T #typeArg0 = null in invalid-expression;
}
static method main() → dynamic
diff --git a/pkg/front_end/testcases/qualified.dart.strong.expect b/pkg/front_end/testcases/qualified.dart.strong.expect
index 7136bf5..ead5697 100644
--- a/pkg/front_end/testcases/qualified.dart.strong.expect
+++ b/pkg/front_end/testcases/qualified.dart.strong.expect
@@ -14,7 +14,7 @@
: super lib::Supertype::•()
;
}
-class C<T extends core::Object> extends core::Object { // from org-dartlang-testcase:///qualified_part.dart
+class C<T extends core::Object = dynamic> extends core::Object { // from org-dartlang-testcase:///qualified_part.dart
static field dynamic _redirecting# = <dynamic>[self::C::b];
constructor •() → void
: super core::Object::•()
@@ -22,7 +22,7 @@
constructor a() → void
: super core::Object::•()
;
- static factory b<T extends core::Object>() → self::C<self::C::b::T>
+ static factory b<T extends core::Object = dynamic>() → self::C<self::C::b::T>
let dynamic #redirecting_factory = lib::C::b in let self::C::b::T #typeArg0 = null in invalid-expression;
}
static const field dynamic #errors = const <dynamic>["pkg/front_end/testcases/qualified.dart:12:3: Error: Type 'lib.Missing' not found.
diff --git a/pkg/front_end/testcases/qualified.dart.strong.transformed.expect b/pkg/front_end/testcases/qualified.dart.strong.transformed.expect
index b90128a..54bc304 100644
--- a/pkg/front_end/testcases/qualified.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/qualified.dart.strong.transformed.expect
@@ -20,7 +20,7 @@
: super lib::Supertype::•()
;
}
-class C<T extends core::Object> extends core::Object { // from org-dartlang-testcase:///qualified_part.dart
+class C<T extends core::Object = dynamic> extends core::Object { // from org-dartlang-testcase:///qualified_part.dart
static field dynamic _redirecting# = <dynamic>[self::C::b];
constructor •() → void
: super core::Object::•()
@@ -28,8 +28,8 @@
constructor a() → void
: super core::Object::•()
;
- static factory b<T extends core::Object>() → self::C<self::C::b::T>
- let <T extends core::Object>() → lib::C<lib::C::b::T> #redirecting_factory = lib::C::b in let self::C::b::T #typeArg0 = null in invalid-expression;
+ static factory b<T extends core::Object = dynamic>() → self::C<self::C::b::T>
+ let <T extends core::Object = dynamic>() → lib::C<lib::C::b::T> #redirecting_factory = lib::C::b in let self::C::b::T #typeArg0 = null in invalid-expression;
}
static const field dynamic #errors = const <dynamic>["pkg/front_end/testcases/qualified.dart:12:3: Error: Type 'lib.Missing' not found.
lib.Missing method() {}
diff --git a/pkg/front_end/testcases/rasta/generic_factory.dart.outline.expect b/pkg/front_end/testcases/rasta/generic_factory.dart.outline.expect
index b03c5e3..1033641 100644
--- a/pkg/front_end/testcases/rasta/generic_factory.dart.outline.expect
+++ b/pkg/front_end/testcases/rasta/generic_factory.dart.outline.expect
@@ -14,27 +14,27 @@
synthetic constructor •() → void
;
}
-class A<T extends core::Object> extends core::Object {
+class A<T extends core::Object = dynamic> extends core::Object {
static field dynamic _redirecting# = <dynamic>[self::A::a, self::A::b, self::A::c];
constructor internal() → void
;
- static factory a<T extends core::Object>() → self::A<self::A::a::T>
+ static factory a<T extends core::Object = dynamic>() → self::A<self::A::a::T>
let dynamic #redirecting_factory = self::B::a in let self::A::a::T #typeArg0 = null in invalid-expression;
- static factory b<T extends core::Object>() → self::A<self::A::b::T>
+ static factory b<T extends core::Object = dynamic>() → self::A<self::A::b::T>
let dynamic #redirecting_factory = self::B::a in let self::C1 #typeArg0 = null in invalid-expression;
- static factory c<T extends core::Object>() → self::A<self::A::c::T>
+ static factory c<T extends core::Object = dynamic>() → self::A<self::A::c::T>
let dynamic #redirecting_factory = "Missing" in invalid-expression;
}
-class B<S extends core::Object> extends self::A<self::B::S> {
+class B<S extends core::Object = dynamic> extends self::A<self::B::S> {
static field dynamic _redirecting# = <dynamic>[self::B::a, self::B::b];
constructor internal() → void
;
- static factory a<S extends core::Object>() → self::B<self::B::a::S>
+ static factory a<S extends core::Object = dynamic>() → self::B<self::B::a::S>
let dynamic #redirecting_factory = self::C::• in let self::B::a::S #typeArg0 = null in invalid-expression;
- static factory b<S extends core::Object>() → self::B<self::B::b::S>
+ static factory b<S extends core::Object = dynamic>() → self::B<self::B::b::S>
let dynamic #redirecting_factory = self::C::• in let self::C2 #typeArg0 = null in invalid-expression;
}
-class C<U extends core::Object> extends self::B<self::C::U> {
+class C<U extends core::Object = dynamic> extends self::B<self::C::U> {
constructor •() → void
;
}
diff --git a/pkg/front_end/testcases/rasta/issue_000068.dart.direct.expect b/pkg/front_end/testcases/rasta/issue_000068.dart.direct.expect
index d2e5607..3432824 100644
--- a/pkg/front_end/testcases/rasta/issue_000068.dart.direct.expect
+++ b/pkg/front_end/testcases/rasta/issue_000068.dart.direct.expect
@@ -3,7 +3,7 @@
import "dart:core" as core;
import "package:expect/expect.dart" as exp;
-class G<T extends core::Object> extends core::Object {
+class G<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/rasta/issue_000068.dart.direct.transformed.expect b/pkg/front_end/testcases/rasta/issue_000068.dart.direct.transformed.expect
index d2e5607..3432824 100644
--- a/pkg/front_end/testcases/rasta/issue_000068.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/rasta/issue_000068.dart.direct.transformed.expect
@@ -3,7 +3,7 @@
import "dart:core" as core;
import "package:expect/expect.dart" as exp;
-class G<T extends core::Object> extends core::Object {
+class G<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/rasta/issue_000068.dart.outline.expect b/pkg/front_end/testcases/rasta/issue_000068.dart.outline.expect
index e1d7f2e..9c46dd8 100644
--- a/pkg/front_end/testcases/rasta/issue_000068.dart.outline.expect
+++ b/pkg/front_end/testcases/rasta/issue_000068.dart.outline.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class G<T extends core::Object> extends core::Object {
+class G<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
;
}
diff --git a/pkg/front_end/testcases/rasta/issue_000070.dart.direct.expect b/pkg/front_end/testcases/rasta/issue_000070.dart.direct.expect
index a80d4c3..3ea2923b 100644
--- a/pkg/front_end/testcases/rasta/issue_000070.dart.direct.expect
+++ b/pkg/front_end/testcases/rasta/issue_000070.dart.direct.expect
@@ -3,7 +3,7 @@
import "dart:core" as core;
import "package:expect/expect.dart" as exp;
-class A<N extends core::Object, S extends core::Object, U extends core::Object> extends core::Object {
+class A<N extends core::Object = dynamic, S extends core::Object = dynamic, U extends core::Object = dynamic> extends core::Object {
final field core::List<self::A::U> field;
constructor •(self::A::N n, self::A::S s) → void
: self::A::field = core::List::•<self::A::U>(), super core::Object::•() {
@@ -15,7 +15,7 @@
const constructor c(self::A::U u, self::A::S s) → void
: self::A::field = const <dynamic>[null], super core::Object::•()
;
- static factory f<N extends core::Object, S extends core::Object, U extends core::Object>(self::A::f::S s) → self::A<self::A::f::N, self::A::f::S, self::A::f::U> {
+ static factory f<N extends core::Object = dynamic, S extends core::Object = dynamic, U extends core::Object = dynamic>(self::A::f::S s) → self::A<self::A::f::N, self::A::f::S, self::A::f::U> {
exp::Expect::isTrue(s is self::A::f::S);
return new self::A::empty<dynamic, dynamic, dynamic>();
}
@@ -24,12 +24,12 @@
}
set setter(self::A::S s) → void {}
}
-abstract class J<Aa extends core::Object, B extends core::Object> extends core::Object {
+abstract class J<Aa extends core::Object = dynamic, B extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-abstract class I<H extends core::Object, C extends core::Object, K extends core::Object> extends self::J<self::I::C, self::I::K> {
+abstract class I<H extends core::Object = dynamic, C extends core::Object = dynamic, K extends core::Object = dynamic> extends self::J<self::I::C, self::I::K> {
synthetic constructor •() → void
: super self::J::•()
;
diff --git a/pkg/front_end/testcases/rasta/issue_000070.dart.direct.transformed.expect b/pkg/front_end/testcases/rasta/issue_000070.dart.direct.transformed.expect
index a80d4c3..3ea2923b 100644
--- a/pkg/front_end/testcases/rasta/issue_000070.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/rasta/issue_000070.dart.direct.transformed.expect
@@ -3,7 +3,7 @@
import "dart:core" as core;
import "package:expect/expect.dart" as exp;
-class A<N extends core::Object, S extends core::Object, U extends core::Object> extends core::Object {
+class A<N extends core::Object = dynamic, S extends core::Object = dynamic, U extends core::Object = dynamic> extends core::Object {
final field core::List<self::A::U> field;
constructor •(self::A::N n, self::A::S s) → void
: self::A::field = core::List::•<self::A::U>(), super core::Object::•() {
@@ -15,7 +15,7 @@
const constructor c(self::A::U u, self::A::S s) → void
: self::A::field = const <dynamic>[null], super core::Object::•()
;
- static factory f<N extends core::Object, S extends core::Object, U extends core::Object>(self::A::f::S s) → self::A<self::A::f::N, self::A::f::S, self::A::f::U> {
+ static factory f<N extends core::Object = dynamic, S extends core::Object = dynamic, U extends core::Object = dynamic>(self::A::f::S s) → self::A<self::A::f::N, self::A::f::S, self::A::f::U> {
exp::Expect::isTrue(s is self::A::f::S);
return new self::A::empty<dynamic, dynamic, dynamic>();
}
@@ -24,12 +24,12 @@
}
set setter(self::A::S s) → void {}
}
-abstract class J<Aa extends core::Object, B extends core::Object> extends core::Object {
+abstract class J<Aa extends core::Object = dynamic, B extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-abstract class I<H extends core::Object, C extends core::Object, K extends core::Object> extends self::J<self::I::C, self::I::K> {
+abstract class I<H extends core::Object = dynamic, C extends core::Object = dynamic, K extends core::Object = dynamic> extends self::J<self::I::C, self::I::K> {
synthetic constructor •() → void
: super self::J::•()
;
diff --git a/pkg/front_end/testcases/rasta/issue_000070.dart.outline.expect b/pkg/front_end/testcases/rasta/issue_000070.dart.outline.expect
index c0e3673..00c0cb3 100644
--- a/pkg/front_end/testcases/rasta/issue_000070.dart.outline.expect
+++ b/pkg/front_end/testcases/rasta/issue_000070.dart.outline.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class A<N extends core::Object, S extends core::Object, U extends core::Object> extends core::Object {
+class A<N extends core::Object = dynamic, S extends core::Object = dynamic, U extends core::Object = dynamic> extends core::Object {
final field core::List<self::A::U> field;
constructor •(self::A::N n, self::A::S s) → void
;
@@ -10,18 +10,18 @@
;
const constructor c(self::A::U u, self::A::S s) → void
;
- static factory f<N extends core::Object, S extends core::Object, U extends core::Object>(self::A::f::S s) → self::A<self::A::f::N, self::A::f::S, self::A::f::U>
+ static factory f<N extends core::Object = dynamic, S extends core::Object = dynamic, U extends core::Object = dynamic>(self::A::f::S s) → self::A<self::A::f::N, self::A::f::S, self::A::f::U>
;
get getter() → core::List<self::A::U>
;
set setter(self::A::S s) → void
;
}
-abstract class J<Aa extends core::Object, B extends core::Object> extends core::Object {
+abstract class J<Aa extends core::Object = dynamic, B extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
;
}
-abstract class I<H extends core::Object, C extends core::Object, K extends core::Object> extends self::J<self::I::C, self::I::K> {
+abstract class I<H extends core::Object = dynamic, C extends core::Object = dynamic, K extends core::Object = dynamic> extends self::J<self::I::C, self::I::K> {
synthetic constructor •() → void
;
}
diff --git a/pkg/front_end/testcases/rasta/mixin_library.dart.outline.expect b/pkg/front_end/testcases/rasta/mixin_library.dart.outline.expect
index fdda949..27d7daf 100644
--- a/pkg/front_end/testcases/rasta/mixin_library.dart.outline.expect
+++ b/pkg/front_end/testcases/rasta/mixin_library.dart.outline.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class Mixin<T extends core::Object> extends core::Object {
+class Mixin<T extends core::Object = dynamic> extends core::Object {
field dynamic x;
field dynamic y;
field dynamic z;
diff --git a/pkg/front_end/testcases/rasta/mixin_library.dart.strong.expect b/pkg/front_end/testcases/rasta/mixin_library.dart.strong.expect
index 58551e4..06badae 100644
--- a/pkg/front_end/testcases/rasta/mixin_library.dart.strong.expect
+++ b/pkg/front_end/testcases/rasta/mixin_library.dart.strong.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class Mixin<T extends core::Object> extends core::Object {
+class Mixin<T extends core::Object = dynamic> extends core::Object {
field dynamic x = self::f();
field dynamic y = null;
field dynamic z = null;
diff --git a/pkg/front_end/testcases/rasta/super_mixin.dart.direct.expect b/pkg/front_end/testcases/rasta/super_mixin.dart.direct.expect
index 25388a4..f43c8b5 100644
--- a/pkg/front_end/testcases/rasta/super_mixin.dart.direct.expect
+++ b/pkg/front_end/testcases/rasta/super_mixin.dart.direct.expect
@@ -3,7 +3,7 @@
import "dart:core" as core;
import "./mixin_library.dart" as mix;
-class Super<S extends core::Object> extends core::Object {
+class Super<S extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
@@ -12,9 +12,9 @@
method f() → dynamic
return 3;
}
-abstract class _C&Super&Mixin<V extends core::Object> = self::Super<self::_C&Super&Mixin::V> with mix::Mixin<self::_C&Super&Mixin::V> {
+abstract class _C&Super&Mixin<V extends core::Object = dynamic> = self::Super<self::_C&Super&Mixin::V> with mix::Mixin<self::_C&Super&Mixin::V> {
}
-class C<V extends core::Object> extends self::_C&Super&Mixin<self::C::V> {
+class C<V extends core::Object = dynamic> extends self::_C&Super&Mixin<self::C::V> {
synthetic constructor •() → void
: super self::Super::•()
;
@@ -26,7 +26,7 @@
: super self::Super::•()
;
}
-class C2<V extends core::Object> = self::Super<self::C2::V> with mix::Mixin<self::C2::V> {
+class C2<V extends core::Object = dynamic> = self::Super<self::C2::V> with mix::Mixin<self::C2::V> {
synthetic constructor •() → void
: super self::Super::•()
;
diff --git a/pkg/front_end/testcases/rasta/super_mixin.dart.direct.transformed.expect b/pkg/front_end/testcases/rasta/super_mixin.dart.direct.transformed.expect
index 8540267..49f815b 100644
--- a/pkg/front_end/testcases/rasta/super_mixin.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/rasta/super_mixin.dart.direct.transformed.expect
@@ -3,7 +3,7 @@
import "dart:core" as core;
import "./mixin_library.dart" as mix;
-class Super<S extends core::Object> extends core::Object {
+class Super<S extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
@@ -12,7 +12,7 @@
method f() → dynamic
return 3;
}
-abstract class _C&Super&Mixin<V extends core::Object> extends self::Super<self::_C&Super&Mixin::V> implements mix::Mixin<self::_C&Super&Mixin::V> {
+abstract class _C&Super&Mixin<V extends core::Object = dynamic> extends self::Super<self::_C&Super&Mixin::V> implements mix::Mixin<self::_C&Super&Mixin::V> {
field dynamic x = mix::f()/* from org-dartlang-testcase:///mixin_library.dart */;
field dynamic y = null /* from org-dartlang-testcase:///mixin_library.dart */;
field dynamic z = null /* from org-dartlang-testcase:///mixin_library.dart */;
@@ -33,7 +33,7 @@
method /* from org-dartlang-testcase:///mixin_library.dart */ publicMethod() → dynamic
return this.{mix::Mixin::_privateMethod}();
}
-class C<V extends core::Object> extends self::_C&Super&Mixin<self::C::V> {
+class C<V extends core::Object = dynamic> extends self::_C&Super&Mixin<self::C::V> {
synthetic constructor •() → void
: super self::Super::•()
;
@@ -64,7 +64,7 @@
: super self::Super::•()
;
}
-class C2<V extends core::Object> extends self::Super<self::C2::V> implements mix::Mixin<self::C2::V> {
+class C2<V extends core::Object = dynamic> extends self::Super<self::C2::V> implements mix::Mixin<self::C2::V> {
field dynamic x = mix::f()/* from org-dartlang-testcase:///mixin_library.dart */;
field dynamic y = null /* from org-dartlang-testcase:///mixin_library.dart */;
field dynamic z = null /* from org-dartlang-testcase:///mixin_library.dart */;
diff --git a/pkg/front_end/testcases/rasta/super_mixin.dart.outline.expect b/pkg/front_end/testcases/rasta/super_mixin.dart.outline.expect
index e1bc111..226be4d 100644
--- a/pkg/front_end/testcases/rasta/super_mixin.dart.outline.expect
+++ b/pkg/front_end/testcases/rasta/super_mixin.dart.outline.expect
@@ -3,7 +3,7 @@
import "dart:core" as core;
import "./mixin_library.dart" as mix;
-class Super<S extends core::Object> extends core::Object {
+class Super<S extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
;
method foo() → dynamic
@@ -11,9 +11,9 @@
method f() → dynamic
;
}
-abstract class _C&Super&Mixin<V extends core::Object> = self::Super<self::_C&Super&Mixin::V> with mix::Mixin<self::_C&Super&Mixin::V> {
+abstract class _C&Super&Mixin<V extends core::Object = dynamic> = self::Super<self::_C&Super&Mixin::V> with mix::Mixin<self::_C&Super&Mixin::V> {
}
-class C<V extends core::Object> extends self::_C&Super&Mixin<self::C::V> {
+class C<V extends core::Object = dynamic> extends self::_C&Super&Mixin<self::C::V> {
synthetic constructor •() → void
;
}
@@ -23,7 +23,7 @@
synthetic constructor •() → void
;
}
-class C2<V extends core::Object> = self::Super<self::C2::V> with mix::Mixin<self::C2::V> {
+class C2<V extends core::Object = dynamic> = self::Super<self::C2::V> with mix::Mixin<self::C2::V> {
synthetic constructor •() → void
: super self::Super::•()
;
diff --git a/pkg/front_end/testcases/rasta/super_mixin.dart.strong.expect b/pkg/front_end/testcases/rasta/super_mixin.dart.strong.expect
index 6a403fb..abb198d 100644
--- a/pkg/front_end/testcases/rasta/super_mixin.dart.strong.expect
+++ b/pkg/front_end/testcases/rasta/super_mixin.dart.strong.expect
@@ -3,7 +3,7 @@
import "dart:core" as core;
import "./mixin_library.dart" as mix;
-class Super<S extends core::Object> extends core::Object {
+class Super<S extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
@@ -12,9 +12,9 @@
method f() → dynamic
return 3;
}
-abstract class _C&Super&Mixin<V extends core::Object> = self::Super<self::_C&Super&Mixin::V> with mix::Mixin<self::_C&Super&Mixin::V> {
+abstract class _C&Super&Mixin<V extends core::Object = dynamic> = self::Super<self::_C&Super&Mixin::V> with mix::Mixin<self::_C&Super&Mixin::V> {
}
-class C<V extends core::Object> extends self::_C&Super&Mixin<self::C::V> {
+class C<V extends core::Object = dynamic> extends self::_C&Super&Mixin<self::C::V> {
synthetic constructor •() → void
: super self::Super::•()
;
@@ -29,7 +29,7 @@
;
abstract forwarding-stub set t(generic-covariant-impl dynamic _) → void;
}
-class C2<V extends core::Object> = self::Super<self::C2::V> with mix::Mixin<self::C2::V> {
+class C2<V extends core::Object = dynamic> = self::Super<self::C2::V> with mix::Mixin<self::C2::V> {
synthetic constructor •() → void
: super self::Super::•()
;
diff --git a/pkg/front_end/testcases/rasta/type_literals.dart.outline.expect b/pkg/front_end/testcases/rasta/type_literals.dart.outline.expect
index 4f17669..48fb196 100644
--- a/pkg/front_end/testcases/rasta/type_literals.dart.outline.expect
+++ b/pkg/front_end/testcases/rasta/type_literals.dart.outline.expect
@@ -3,7 +3,7 @@
import "dart:core" as core;
typedef Func = () → void;
-class C<T extends core::Object> extends core::Object {
+class C<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
;
method test() → dynamic
diff --git a/pkg/front_end/testcases/redirecting_factory.dart.outline.expect b/pkg/front_end/testcases/redirecting_factory.dart.outline.expect
index 4a460e9..0e9db8ea 100644
--- a/pkg/front_end/testcases/redirecting_factory.dart.outline.expect
+++ b/pkg/front_end/testcases/redirecting_factory.dart.outline.expect
@@ -2,51 +2,51 @@
import self as self;
import "dart:core" as core;
-abstract class FooBase<Tf extends core::Object> extends core::Object {
+abstract class FooBase<Tf extends core::Object = dynamic> extends core::Object {
static field dynamic _redirecting# = <dynamic>[self::FooBase::•];
abstract get x() → core::int;
- static factory •<Tf extends core::Object>(core::int x) → self::FooBase<self::FooBase::•::Tf>
+ static factory •<Tf extends core::Object = dynamic>(core::int x) → self::FooBase<self::FooBase::•::Tf>
let dynamic #redirecting_factory = self::Foo::• in let self::FooBase::•::Tf #typeArg0 = null in invalid-expression;
}
-abstract class Foo<T extends core::Object> extends core::Object implements self::FooBase<dynamic> {
+abstract class Foo<T extends core::Object = dynamic> extends core::Object implements self::FooBase<dynamic> {
static field dynamic _redirecting# = <dynamic>[self::Foo::•];
- static factory •<T extends core::Object>(core::int x) → self::Foo<self::Foo::•::T>
+ static factory •<T extends core::Object = dynamic>(core::int x) → self::Foo<self::Foo::•::T>
let dynamic #redirecting_factory = self::Bar::• in let core::String #typeArg0 = null in let self::Foo::•::T #typeArg1 = null in invalid-expression;
}
-class Bar<Sb extends core::Object, Tb extends core::Object> extends core::Object implements self::Foo<self::Bar::Tb> {
+class Bar<Sb extends core::Object = dynamic, Tb extends core::Object = dynamic> extends core::Object implements self::Foo<self::Bar::Tb> {
field core::int x;
constructor •(core::int x) → void
;
}
-class Builder<X extends core::Object> extends core::Object {
+class Builder<X extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
;
method method() → dynamic
;
}
-class SimpleCase<A extends core::Object, B extends core::Object> extends core::Object {
+class SimpleCase<A extends core::Object = dynamic, B extends core::Object = dynamic> extends core::Object {
static field dynamic _redirecting# = <dynamic>[self::SimpleCase::•];
- static factory •<A extends core::Object, B extends core::Object>() → self::SimpleCase<self::SimpleCase::•::A, self::SimpleCase::•::B>
+ static factory •<A extends core::Object = dynamic, B extends core::Object = dynamic>() → self::SimpleCase<self::SimpleCase::•::A, self::SimpleCase::•::B>
let dynamic #redirecting_factory = self::SimpleCaseImpl::• in let self::SimpleCase::•::A #typeArg0 = null in let self::SimpleCase::•::B #typeArg1 = null in invalid-expression;
}
-class SimpleCaseImpl<Ai extends core::Object, Bi extends core::Object> extends core::Object implements self::SimpleCase<self::SimpleCaseImpl::Ai, self::SimpleCaseImpl::Bi> {
+class SimpleCaseImpl<Ai extends core::Object = dynamic, Bi extends core::Object = dynamic> extends core::Object implements self::SimpleCase<self::SimpleCaseImpl::Ai, self::SimpleCaseImpl::Bi> {
static field dynamic _redirecting# = <dynamic>[self::SimpleCaseImpl::•];
- static factory •<Ai extends core::Object, Bi extends core::Object>() → self::SimpleCaseImpl<self::SimpleCaseImpl::•::Ai, self::SimpleCaseImpl::•::Bi>
+ static factory •<Ai extends core::Object = dynamic, Bi extends core::Object = dynamic>() → self::SimpleCaseImpl<self::SimpleCaseImpl::•::Ai, self::SimpleCaseImpl::•::Bi>
let dynamic #redirecting_factory = self::SimpleCaseImpl2::• in let self::SimpleCaseImpl::•::Ai #typeArg0 = null in let self::SimpleCaseImpl::•::Bi #typeArg1 = null in invalid-expression;
}
-class SimpleCaseImpl2<Ai2 extends core::Object, Bi2 extends core::Object> extends core::Object implements self::SimpleCaseImpl<self::SimpleCaseImpl2::Ai2, self::SimpleCaseImpl2::Bi2> {
+class SimpleCaseImpl2<Ai2 extends core::Object = dynamic, Bi2 extends core::Object = dynamic> extends core::Object implements self::SimpleCaseImpl<self::SimpleCaseImpl2::Ai2, self::SimpleCaseImpl2::Bi2> {
synthetic constructor •() → void
;
}
-class Base<M extends core::Object> extends core::Object {
+class Base<M extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
;
}
-class Mixin<M extends core::Object> extends core::Object {
+class Mixin<M extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
;
}
-class Mix<M extends core::Object> = self::Base<self::Mix::M> with self::Mixin<self::Mix::M> {
+class Mix<M extends core::Object = dynamic> = self::Base<self::Mix::M> with self::Mixin<self::Mix::M> {
synthetic constructor •() → void
: super self::Base::•()
;
diff --git a/pkg/front_end/testcases/redirecting_initializer_arguments_assignable_test.dart.direct.expect b/pkg/front_end/testcases/redirecting_initializer_arguments_assignable_test.dart.direct.expect
index ff74d26..b456e45 100644
--- a/pkg/front_end/testcases/redirecting_initializer_arguments_assignable_test.dart.direct.expect
+++ b/pkg/front_end/testcases/redirecting_initializer_arguments_assignable_test.dart.direct.expect
@@ -7,7 +7,7 @@
: super core::Object::•()
;
}
-class Foo<T extends self::X> extends core::Object {
+class Foo<T extends self::X = dynamic> extends core::Object {
field self::Foo::T x;
constructor fromX(self::X _init) → void
: this self::Foo::_internal(x: _init)
diff --git a/pkg/front_end/testcases/redirecting_initializer_arguments_assignable_test.dart.direct.transformed.expect b/pkg/front_end/testcases/redirecting_initializer_arguments_assignable_test.dart.direct.transformed.expect
index ff74d26..b456e45 100644
--- a/pkg/front_end/testcases/redirecting_initializer_arguments_assignable_test.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/redirecting_initializer_arguments_assignable_test.dart.direct.transformed.expect
@@ -7,7 +7,7 @@
: super core::Object::•()
;
}
-class Foo<T extends self::X> extends core::Object {
+class Foo<T extends self::X = dynamic> extends core::Object {
field self::Foo::T x;
constructor fromX(self::X _init) → void
: this self::Foo::_internal(x: _init)
diff --git a/pkg/front_end/testcases/redirecting_initializer_arguments_assignable_test.dart.outline.expect b/pkg/front_end/testcases/redirecting_initializer_arguments_assignable_test.dart.outline.expect
index 5cbe7eb..9a93e35 100644
--- a/pkg/front_end/testcases/redirecting_initializer_arguments_assignable_test.dart.outline.expect
+++ b/pkg/front_end/testcases/redirecting_initializer_arguments_assignable_test.dart.outline.expect
@@ -6,7 +6,7 @@
synthetic constructor •() → void
;
}
-class Foo<T extends self::X> extends core::Object {
+class Foo<T extends self::X = dynamic> extends core::Object {
field self::Foo::T x;
constructor fromX(self::X _init) → void
;
diff --git a/pkg/front_end/testcases/redirecting_initializer_arguments_assignable_test.dart.strong.expect b/pkg/front_end/testcases/redirecting_initializer_arguments_assignable_test.dart.strong.expect
index 81b63fc..ad19bc0 100644
--- a/pkg/front_end/testcases/redirecting_initializer_arguments_assignable_test.dart.strong.expect
+++ b/pkg/front_end/testcases/redirecting_initializer_arguments_assignable_test.dart.strong.expect
@@ -7,7 +7,7 @@
: super core::Object::•()
;
}
-class Foo<T extends self::X> extends core::Object {
+class Foo<T extends self::X = self::X> extends core::Object {
generic-covariant-impl generic-covariant-interface field self::Foo::T x;
constructor fromX(self::X _init) → void
: this self::Foo::_internal(x: _init as{TypeError} self::Foo::T)
diff --git a/pkg/front_end/testcases/redirecting_initializer_arguments_assignable_test.dart.strong.transformed.expect b/pkg/front_end/testcases/redirecting_initializer_arguments_assignable_test.dart.strong.transformed.expect
index 81b63fc..ad19bc0 100644
--- a/pkg/front_end/testcases/redirecting_initializer_arguments_assignable_test.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/redirecting_initializer_arguments_assignable_test.dart.strong.transformed.expect
@@ -7,7 +7,7 @@
: super core::Object::•()
;
}
-class Foo<T extends self::X> extends core::Object {
+class Foo<T extends self::X = self::X> extends core::Object {
generic-covariant-impl generic-covariant-interface field self::Foo::T x;
constructor fromX(self::X _init) → void
: this self::Foo::_internal(x: _init as{TypeError} self::Foo::T)
diff --git a/pkg/front_end/testcases/redirecting_initializer_arguments_test.dart.direct.expect b/pkg/front_end/testcases/redirecting_initializer_arguments_test.dart.direct.expect
index d42aaa0..4a3a9d5 100644
--- a/pkg/front_end/testcases/redirecting_initializer_arguments_test.dart.direct.expect
+++ b/pkg/front_end/testcases/redirecting_initializer_arguments_test.dart.direct.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class Foo<T extends core::Object> extends core::Object {
+class Foo<T extends core::Object = dynamic> extends core::Object {
field self::Foo::T x;
constructor from(core::String _init) → void
: this self::Foo::_internal(x: _init)
diff --git a/pkg/front_end/testcases/redirecting_initializer_arguments_test.dart.direct.transformed.expect b/pkg/front_end/testcases/redirecting_initializer_arguments_test.dart.direct.transformed.expect
index d42aaa0..4a3a9d5 100644
--- a/pkg/front_end/testcases/redirecting_initializer_arguments_test.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/redirecting_initializer_arguments_test.dart.direct.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class Foo<T extends core::Object> extends core::Object {
+class Foo<T extends core::Object = dynamic> extends core::Object {
field self::Foo::T x;
constructor from(core::String _init) → void
: this self::Foo::_internal(x: _init)
diff --git a/pkg/front_end/testcases/redirecting_initializer_arguments_test.dart.outline.expect b/pkg/front_end/testcases/redirecting_initializer_arguments_test.dart.outline.expect
index 10bf447..467c389 100644
--- a/pkg/front_end/testcases/redirecting_initializer_arguments_test.dart.outline.expect
+++ b/pkg/front_end/testcases/redirecting_initializer_arguments_test.dart.outline.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class Foo<T extends core::Object> extends core::Object {
+class Foo<T extends core::Object = dynamic> extends core::Object {
field self::Foo::T x;
constructor from(core::String _init) → void
;
diff --git a/pkg/front_end/testcases/redirecting_initializer_arguments_test.dart.strong.expect b/pkg/front_end/testcases/redirecting_initializer_arguments_test.dart.strong.expect
index db3b854..b07315d 100644
--- a/pkg/front_end/testcases/redirecting_initializer_arguments_test.dart.strong.expect
+++ b/pkg/front_end/testcases/redirecting_initializer_arguments_test.dart.strong.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class Foo<T extends core::Object> extends core::Object {
+class Foo<T extends core::Object = dynamic> extends core::Object {
generic-covariant-impl generic-covariant-interface field self::Foo::T x;
constructor from(core::String _init) → void
: this self::Foo::_internal(x: let final dynamic #t1 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/redirecting_initializer_arguments_test.dart:12:46: Error: A value of type 'dart.core::String' can't be assigned to a variable of type '#lib1::Foo::T'.
diff --git a/pkg/front_end/testcases/redirecting_initializer_arguments_test.dart.strong.transformed.expect b/pkg/front_end/testcases/redirecting_initializer_arguments_test.dart.strong.transformed.expect
index db3b854..b07315d 100644
--- a/pkg/front_end/testcases/redirecting_initializer_arguments_test.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/redirecting_initializer_arguments_test.dart.strong.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class Foo<T extends core::Object> extends core::Object {
+class Foo<T extends core::Object = dynamic> extends core::Object {
generic-covariant-impl generic-covariant-interface field self::Foo::T x;
constructor from(core::String _init) → void
: this self::Foo::_internal(x: let final dynamic #t1 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/redirecting_initializer_arguments_test.dart:12:46: Error: A value of type 'dart.core::String' can't be assigned to a variable of type '#lib1::Foo::T'.
diff --git a/pkg/front_end/testcases/redirection_chain_type_arguments.dart.outline.expect b/pkg/front_end/testcases/redirection_chain_type_arguments.dart.outline.expect
index 1b274eb..038ab97 100644
--- a/pkg/front_end/testcases/redirection_chain_type_arguments.dart.outline.expect
+++ b/pkg/front_end/testcases/redirection_chain_type_arguments.dart.outline.expect
@@ -2,21 +2,21 @@
import self as self;
import "dart:core" as core;
-class A<T extends core::Object> extends core::Object {
+class A<T extends core::Object = dynamic> extends core::Object {
static field dynamic _redirecting# = <dynamic>[self::A::•];
constructor empty() → void
;
- static factory •<T extends core::Object>() → self::A<self::A::•::T>
+ static factory •<T extends core::Object = dynamic>() → self::A<self::A::•::T>
let dynamic #redirecting_factory = self::B::• in let self::A::•::T #typeArg0 = null in let core::num #typeArg1 = null in invalid-expression;
}
-class B<U extends core::Object, W extends core::Object> extends self::A<self::B::U> {
+class B<U extends core::Object = dynamic, W extends core::Object = dynamic> extends self::A<self::B::U> {
static field dynamic _redirecting# = <dynamic>[self::B::•];
constructor empty() → void
;
- static factory •<U extends core::Object, W extends core::Object>() → self::B<self::B::•::U, self::B::•::W>
+ static factory •<U extends core::Object = dynamic, W extends core::Object = dynamic>() → self::B<self::B::•::U, self::B::•::W>
let dynamic #redirecting_factory = self::C::• in let self::B::•::U #typeArg0 = null in let self::B::•::W #typeArg1 = null in let core::String #typeArg2 = null in invalid-expression;
}
-class C<V extends core::Object, S extends core::Object, R extends core::Object> extends self::B<self::C::V, self::C::S> {
+class C<V extends core::Object = dynamic, S extends core::Object = dynamic, R extends core::Object = dynamic> extends self::B<self::C::V, self::C::S> {
constructor •() → void
;
method toString() → dynamic
diff --git a/pkg/front_end/testcases/redirection_chain_type_arguments_subst.dart.outline.expect b/pkg/front_end/testcases/redirection_chain_type_arguments_subst.dart.outline.expect
index 7e4faab..f6ba5d2 100644
--- a/pkg/front_end/testcases/redirection_chain_type_arguments_subst.dart.outline.expect
+++ b/pkg/front_end/testcases/redirection_chain_type_arguments_subst.dart.outline.expect
@@ -2,21 +2,21 @@
import self as self;
import "dart:core" as core;
-abstract class A<T extends core::Object> extends core::Object {
+abstract class A<T extends core::Object = dynamic> extends core::Object {
static field dynamic _redirecting# = <dynamic>[self::A::•];
constructor empty() → void
;
- static factory •<T extends core::Object>() → self::A<self::A::•::T>
+ static factory •<T extends core::Object = dynamic>() → self::A<self::A::•::T>
let dynamic #redirecting_factory = self::B::• in let self::A::•::T #typeArg0 = null in let core::List<self::A::•::T> #typeArg1 = null in invalid-expression;
}
-abstract class B<U extends core::Object, W extends core::Object> extends self::A<self::B::U> {
+abstract class B<U extends core::Object = dynamic, W extends core::Object = dynamic> extends self::A<self::B::U> {
static field dynamic _redirecting# = <dynamic>[self::B::•];
constructor empty() → void
;
- static factory •<U extends core::Object, W extends core::Object>() → self::B<self::B::•::U, self::B::•::W>
+ static factory •<U extends core::Object = dynamic, W extends core::Object = dynamic>() → self::B<self::B::•::U, self::B::•::W>
let dynamic #redirecting_factory = self::C::• in let self::B::•::U #typeArg0 = null in let self::B::•::W #typeArg1 = null in let core::Map<self::B::•::U, self::B::•::W> #typeArg2 = null in invalid-expression;
}
-class C<V extends core::Object, S extends core::Object, R extends core::Object> extends self::B<self::C::V, self::C::S> {
+class C<V extends core::Object = dynamic, S extends core::Object = dynamic, R extends core::Object = dynamic> extends self::B<self::C::V, self::C::S> {
constructor •() → void
;
method toString() → dynamic
diff --git a/pkg/front_end/testcases/redirection_type_arguments.dart.direct.expect b/pkg/front_end/testcases/redirection_type_arguments.dart.direct.expect
index 8a13842..c39fbd5 100644
--- a/pkg/front_end/testcases/redirection_type_arguments.dart.direct.expect
+++ b/pkg/front_end/testcases/redirection_type_arguments.dart.direct.expect
@@ -11,7 +11,7 @@
static factory •() → self::A
let dynamic #redirecting_factory = self::B::• in let core::String #typeArg0 = null in invalid-expression;
}
-class B<T extends core::Object> extends self::A {
+class B<T extends core::Object = dynamic> extends self::A {
const constructor •() → void
: super self::A::empty()
;
diff --git a/pkg/front_end/testcases/redirection_type_arguments.dart.direct.transformed.expect b/pkg/front_end/testcases/redirection_type_arguments.dart.direct.transformed.expect
index 8a13842..c39fbd5 100644
--- a/pkg/front_end/testcases/redirection_type_arguments.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/redirection_type_arguments.dart.direct.transformed.expect
@@ -11,7 +11,7 @@
static factory •() → self::A
let dynamic #redirecting_factory = self::B::• in let core::String #typeArg0 = null in invalid-expression;
}
-class B<T extends core::Object> extends self::A {
+class B<T extends core::Object = dynamic> extends self::A {
const constructor •() → void
: super self::A::empty()
;
diff --git a/pkg/front_end/testcases/redirection_type_arguments.dart.outline.expect b/pkg/front_end/testcases/redirection_type_arguments.dart.outline.expect
index 3d5f4a4..7ec5a97 100644
--- a/pkg/front_end/testcases/redirection_type_arguments.dart.outline.expect
+++ b/pkg/front_end/testcases/redirection_type_arguments.dart.outline.expect
@@ -9,7 +9,7 @@
static factory •() → self::A
let dynamic #redirecting_factory = self::B::• in let core::String #typeArg0 = null in invalid-expression;
}
-class B<T extends core::Object> extends self::A {
+class B<T extends core::Object = dynamic> extends self::A {
const constructor •() → void
;
method toString() → dynamic
diff --git a/pkg/front_end/testcases/redirection_type_arguments.dart.strong.expect b/pkg/front_end/testcases/redirection_type_arguments.dart.strong.expect
index 1ded566..781d97dc 100644
--- a/pkg/front_end/testcases/redirection_type_arguments.dart.strong.expect
+++ b/pkg/front_end/testcases/redirection_type_arguments.dart.strong.expect
@@ -11,7 +11,7 @@
static factory •() → self::A
let dynamic #redirecting_factory = self::B::• in let core::String #typeArg0 = null in invalid-expression;
}
-class B<T extends core::Object> extends self::A {
+class B<T extends core::Object = dynamic> extends self::A {
const constructor •() → void
: super self::A::empty()
;
diff --git a/pkg/front_end/testcases/redirection_type_arguments.dart.strong.transformed.expect b/pkg/front_end/testcases/redirection_type_arguments.dart.strong.transformed.expect
index f69d118..993c466 100644
--- a/pkg/front_end/testcases/redirection_type_arguments.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/redirection_type_arguments.dart.strong.transformed.expect
@@ -11,7 +11,7 @@
static factory •() → self::A
let<BottomType> #redirecting_factory = self::B::• in let core::String #typeArg0 = null in invalid-expression;
}
-class B<T extends core::Object> extends self::A {
+class B<T extends core::Object = dynamic> extends self::A {
const constructor •() → void
: super self::A::empty()
;
diff --git a/pkg/front_end/testcases/regress/issue_29981.dart.direct.expect b/pkg/front_end/testcases/regress/issue_29981.dart.direct.expect
index 6da0dfb..dad6a74 100644
--- a/pkg/front_end/testcases/regress/issue_29981.dart.direct.expect
+++ b/pkg/front_end/testcases/regress/issue_29981.dart.direct.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class C<T extends core::Object> extends core::Object {
+class C<T extends core::Object = dynamic> extends core::Object {
field self::C<dynamic> field = null;
synthetic constructor •() → void
: super core::Object::•()
diff --git a/pkg/front_end/testcases/regress/issue_29981.dart.direct.transformed.expect b/pkg/front_end/testcases/regress/issue_29981.dart.direct.transformed.expect
index 6da0dfb..dad6a74 100644
--- a/pkg/front_end/testcases/regress/issue_29981.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/regress/issue_29981.dart.direct.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class C<T extends core::Object> extends core::Object {
+class C<T extends core::Object = dynamic> extends core::Object {
field self::C<dynamic> field = null;
synthetic constructor •() → void
: super core::Object::•()
diff --git a/pkg/front_end/testcases/regress/issue_29981.dart.outline.expect b/pkg/front_end/testcases/regress/issue_29981.dart.outline.expect
index b6cacd1..95b5a02 100644
--- a/pkg/front_end/testcases/regress/issue_29981.dart.outline.expect
+++ b/pkg/front_end/testcases/regress/issue_29981.dart.outline.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class C<T extends core::Object> extends core::Object {
+class C<T extends core::Object = dynamic> extends core::Object {
field self::C<dynamic> field;
synthetic constructor •() → void
;
diff --git a/pkg/front_end/testcases/regress/issue_29981.dart.strong.expect b/pkg/front_end/testcases/regress/issue_29981.dart.strong.expect
index c4d09ee..5b58a21 100644
--- a/pkg/front_end/testcases/regress/issue_29981.dart.strong.expect
+++ b/pkg/front_end/testcases/regress/issue_29981.dart.strong.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class C<T extends core::Object> extends core::Object {
+class C<T extends core::Object = dynamic> extends core::Object {
field invalid-type field = null;
synthetic constructor •() → void
: super core::Object::•()
diff --git a/pkg/front_end/testcases/regress/issue_29981.dart.strong.transformed.expect b/pkg/front_end/testcases/regress/issue_29981.dart.strong.transformed.expect
index c4d09ee..5b58a21 100644
--- a/pkg/front_end/testcases/regress/issue_29981.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/regress/issue_29981.dart.strong.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class C<T extends core::Object> extends core::Object {
+class C<T extends core::Object = dynamic> extends core::Object {
field invalid-type field = null;
synthetic constructor •() → void
: super core::Object::•()
diff --git a/pkg/front_end/testcases/regress/issue_30838.dart.direct.expect b/pkg/front_end/testcases/regress/issue_30838.dart.direct.expect
index f535fa7..9e4af92 100644
--- a/pkg/front_end/testcases/regress/issue_30838.dart.direct.expect
+++ b/pkg/front_end/testcases/regress/issue_30838.dart.direct.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-typedef Foo<S extends core::Object> = <T extends core::Object>(T) → S;
+typedef Foo<S extends core::Object = dynamic> = <T extends core::Object = dynamic>(T) → S;
class A extends core::Object {
field <T extends core::Object>(T) → core::int f = null;
synthetic constructor •() → void
@@ -12,7 +12,7 @@
this.f<core::String>("hello");
}
}
-static method foo<T extends core::Object>(self::foo::T x) → core::int
+static method foo<T extends core::Object = dynamic>(self::foo::T x) → core::int
return 3;
static method bar() → <T extends core::Object>(T) → core::int
return self::foo;
diff --git a/pkg/front_end/testcases/regress/issue_30838.dart.direct.transformed.expect b/pkg/front_end/testcases/regress/issue_30838.dart.direct.transformed.expect
index f535fa7..9e4af92 100644
--- a/pkg/front_end/testcases/regress/issue_30838.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/regress/issue_30838.dart.direct.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-typedef Foo<S extends core::Object> = <T extends core::Object>(T) → S;
+typedef Foo<S extends core::Object = dynamic> = <T extends core::Object = dynamic>(T) → S;
class A extends core::Object {
field <T extends core::Object>(T) → core::int f = null;
synthetic constructor •() → void
@@ -12,7 +12,7 @@
this.f<core::String>("hello");
}
}
-static method foo<T extends core::Object>(self::foo::T x) → core::int
+static method foo<T extends core::Object = dynamic>(self::foo::T x) → core::int
return 3;
static method bar() → <T extends core::Object>(T) → core::int
return self::foo;
diff --git a/pkg/front_end/testcases/regress/issue_30838.dart.outline.expect b/pkg/front_end/testcases/regress/issue_30838.dart.outline.expect
index c9ded96..55709ba 100644
--- a/pkg/front_end/testcases/regress/issue_30838.dart.outline.expect
+++ b/pkg/front_end/testcases/regress/issue_30838.dart.outline.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-typedef Foo<S extends core::Object> = <T extends core::Object>(T) → S;
+typedef Foo<S extends core::Object = dynamic> = <T extends core::Object = dynamic>(T) → S;
class A extends core::Object {
field <T extends core::Object>(T) → core::int f;
synthetic constructor •() → void
@@ -10,7 +10,7 @@
method test() → void
;
}
-static method foo<T extends core::Object>(self::foo::T x) → core::int
+static method foo<T extends core::Object = dynamic>(self::foo::T x) → core::int
;
static method bar() → <T extends core::Object>(T) → core::int
;
diff --git a/pkg/front_end/testcases/regress/issue_30838.dart.strong.expect b/pkg/front_end/testcases/regress/issue_30838.dart.strong.expect
index c2c1595..f08b8e7 100644
--- a/pkg/front_end/testcases/regress/issue_30838.dart.strong.expect
+++ b/pkg/front_end/testcases/regress/issue_30838.dart.strong.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-typedef Foo<S extends core::Object> = <T extends core::Object>(T) → S;
+typedef Foo<S extends core::Object = dynamic> = <T extends core::Object = dynamic>(T) → S;
class A extends core::Object {
field <T extends core::Object>(T) → core::int f = null;
synthetic constructor •() → void
@@ -12,7 +12,7 @@
this.{self::A::f}<core::String>("hello");
}
}
-static method foo<T extends core::Object>(self::foo::T x) → core::int
+static method foo<T extends core::Object = dynamic>(self::foo::T x) → core::int
return 3;
static method bar() → <T extends core::Object>(T) → core::int
return self::foo;
diff --git a/pkg/front_end/testcases/regress/issue_30838.dart.strong.transformed.expect b/pkg/front_end/testcases/regress/issue_30838.dart.strong.transformed.expect
index c2c1595..f08b8e7 100644
--- a/pkg/front_end/testcases/regress/issue_30838.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/regress/issue_30838.dart.strong.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-typedef Foo<S extends core::Object> = <T extends core::Object>(T) → S;
+typedef Foo<S extends core::Object = dynamic> = <T extends core::Object = dynamic>(T) → S;
class A extends core::Object {
field <T extends core::Object>(T) → core::int f = null;
synthetic constructor •() → void
@@ -12,7 +12,7 @@
this.{self::A::f}<core::String>("hello");
}
}
-static method foo<T extends core::Object>(self::foo::T x) → core::int
+static method foo<T extends core::Object = dynamic>(self::foo::T x) → core::int
return 3;
static method bar() → <T extends core::Object>(T) → core::int
return self::foo;
diff --git a/pkg/front_end/testcases/regress/issue_31181.dart.direct.expect b/pkg/front_end/testcases/regress/issue_31181.dart.direct.expect
index b89cafc..28d2985 100644
--- a/pkg/front_end/testcases/regress/issue_31181.dart.direct.expect
+++ b/pkg/front_end/testcases/regress/issue_31181.dart.direct.expect
@@ -2,6 +2,6 @@
import self as self;
import "dart:core" as core;
-typedef Foo<T extends core::Object> = <T extends core::Object>(T) → T;
-static field <T extends core::Object>(T) → T x;
+typedef Foo<T extends core::Object = dynamic> = <T extends core::Object = dynamic>(T) → T;
+static field <T extends core::Object = dynamic>(T) → T x;
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/regress/issue_31181.dart.direct.transformed.expect b/pkg/front_end/testcases/regress/issue_31181.dart.direct.transformed.expect
index b89cafc..28d2985 100644
--- a/pkg/front_end/testcases/regress/issue_31181.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/regress/issue_31181.dart.direct.transformed.expect
@@ -2,6 +2,6 @@
import self as self;
import "dart:core" as core;
-typedef Foo<T extends core::Object> = <T extends core::Object>(T) → T;
-static field <T extends core::Object>(T) → T x;
+typedef Foo<T extends core::Object = dynamic> = <T extends core::Object = dynamic>(T) → T;
+static field <T extends core::Object = dynamic>(T) → T x;
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/regress/issue_31181.dart.outline.expect b/pkg/front_end/testcases/regress/issue_31181.dart.outline.expect
index 8ca2fe8..b2e2e71 100644
--- a/pkg/front_end/testcases/regress/issue_31181.dart.outline.expect
+++ b/pkg/front_end/testcases/regress/issue_31181.dart.outline.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-typedef Foo<T extends core::Object> = <T extends core::Object>(T) → T;
-static field <T extends core::Object>(T) → T x;
+typedef Foo<T extends core::Object = dynamic> = <T extends core::Object = dynamic>(T) → T;
+static field <T extends core::Object = dynamic>(T) → T x;
static method main() → dynamic
;
diff --git a/pkg/front_end/testcases/regress/issue_31181.dart.strong.expect b/pkg/front_end/testcases/regress/issue_31181.dart.strong.expect
index b89cafc..28d2985 100644
--- a/pkg/front_end/testcases/regress/issue_31181.dart.strong.expect
+++ b/pkg/front_end/testcases/regress/issue_31181.dart.strong.expect
@@ -2,6 +2,6 @@
import self as self;
import "dart:core" as core;
-typedef Foo<T extends core::Object> = <T extends core::Object>(T) → T;
-static field <T extends core::Object>(T) → T x;
+typedef Foo<T extends core::Object = dynamic> = <T extends core::Object = dynamic>(T) → T;
+static field <T extends core::Object = dynamic>(T) → T x;
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/regress/issue_31181.dart.strong.transformed.expect b/pkg/front_end/testcases/regress/issue_31181.dart.strong.transformed.expect
index b89cafc..28d2985 100644
--- a/pkg/front_end/testcases/regress/issue_31181.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/regress/issue_31181.dart.strong.transformed.expect
@@ -2,6 +2,6 @@
import self as self;
import "dart:core" as core;
-typedef Foo<T extends core::Object> = <T extends core::Object>(T) → T;
-static field <T extends core::Object>(T) → T x;
+typedef Foo<T extends core::Object = dynamic> = <T extends core::Object = dynamic>(T) → T;
+static field <T extends core::Object = dynamic>(T) → T x;
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/regress/issue_31190.dart.direct.expect b/pkg/front_end/testcases/regress/issue_31190.dart.direct.expect
index 4fad235..808b453 100644
--- a/pkg/front_end/testcases/regress/issue_31190.dart.direct.expect
+++ b/pkg/front_end/testcases/regress/issue_31190.dart.direct.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class Typed<T extends core::Object> extends core::Object {
+class Typed<T extends core::Object = dynamic> extends core::Object {
field self::Typed::T v = null;
synthetic constructor •() → void
: super core::Object::•()
diff --git a/pkg/front_end/testcases/regress/issue_31190.dart.direct.transformed.expect b/pkg/front_end/testcases/regress/issue_31190.dart.direct.transformed.expect
index 4fad235..808b453 100644
--- a/pkg/front_end/testcases/regress/issue_31190.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/regress/issue_31190.dart.direct.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class Typed<T extends core::Object> extends core::Object {
+class Typed<T extends core::Object = dynamic> extends core::Object {
field self::Typed::T v = null;
synthetic constructor •() → void
: super core::Object::•()
diff --git a/pkg/front_end/testcases/regress/issue_31190.dart.outline.expect b/pkg/front_end/testcases/regress/issue_31190.dart.outline.expect
index 3f98d5d..b7201fd 100644
--- a/pkg/front_end/testcases/regress/issue_31190.dart.outline.expect
+++ b/pkg/front_end/testcases/regress/issue_31190.dart.outline.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class Typed<T extends core::Object> extends core::Object {
+class Typed<T extends core::Object = dynamic> extends core::Object {
field self::Typed::T v;
synthetic constructor •() → void
;
diff --git a/pkg/front_end/testcases/regress/issue_31190.dart.strong.expect b/pkg/front_end/testcases/regress/issue_31190.dart.strong.expect
index 2eacbb9..38248c76 100644
--- a/pkg/front_end/testcases/regress/issue_31190.dart.strong.expect
+++ b/pkg/front_end/testcases/regress/issue_31190.dart.strong.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class Typed<T extends core::Object> extends core::Object {
+class Typed<T extends core::Object = dynamic> extends core::Object {
generic-covariant-impl generic-covariant-interface field self::Typed::T v = null;
synthetic constructor •() → void
: super core::Object::•()
diff --git a/pkg/front_end/testcases/regress/issue_31190.dart.strong.transformed.expect b/pkg/front_end/testcases/regress/issue_31190.dart.strong.transformed.expect
index 2eacbb9..38248c76 100644
--- a/pkg/front_end/testcases/regress/issue_31190.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/regress/issue_31190.dart.strong.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class Typed<T extends core::Object> extends core::Object {
+class Typed<T extends core::Object = dynamic> extends core::Object {
generic-covariant-impl generic-covariant-interface field self::Typed::T v = null;
synthetic constructor •() → void
: super core::Object::•()
diff --git a/pkg/front_end/testcases/regress/issue_31213.dart.direct.expect b/pkg/front_end/testcases/regress/issue_31213.dart.direct.expect
index 860b081..a54adf0 100644
--- a/pkg/front_end/testcases/regress/issue_31213.dart.direct.expect
+++ b/pkg/front_end/testcases/regress/issue_31213.dart.direct.expect
@@ -2,11 +2,11 @@
import self as self;
import "dart:core" as core;
-typedef C<A extends core::Object, K extends core::Object> = <B extends core::Object>(A, K, B) → core::int;
-typedef D<K extends core::Object> = <A extends core::Object>(core::int) → <B extends core::Object>(A, K, B) → core::int;
-static method producer<K extends core::Object>() → dynamic {
- return <A extends core::Object>(core::int v1) → dynamic {
- return <B extends core::Object>(A v2, self::producer::K v3, B v4) → dynamic => 0;
+typedef C<A extends core::Object = dynamic, K extends core::Object = dynamic> = <B extends core::Object = dynamic>(A, K, B) → core::int;
+typedef D<K extends core::Object = dynamic> = <A extends core::Object = dynamic>(core::int) → <B extends core::Object>(A, K, B) → core::int;
+static method producer<K extends core::Object = dynamic>() → dynamic {
+ return <A extends core::Object = dynamic>(core::int v1) → dynamic {
+ return <B extends core::Object = dynamic>(A v2, self::producer::K v3, B v4) → dynamic => 0;
};
}
static method main() → dynamic {
diff --git a/pkg/front_end/testcases/regress/issue_31213.dart.direct.transformed.expect b/pkg/front_end/testcases/regress/issue_31213.dart.direct.transformed.expect
index 860b081..a54adf0 100644
--- a/pkg/front_end/testcases/regress/issue_31213.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/regress/issue_31213.dart.direct.transformed.expect
@@ -2,11 +2,11 @@
import self as self;
import "dart:core" as core;
-typedef C<A extends core::Object, K extends core::Object> = <B extends core::Object>(A, K, B) → core::int;
-typedef D<K extends core::Object> = <A extends core::Object>(core::int) → <B extends core::Object>(A, K, B) → core::int;
-static method producer<K extends core::Object>() → dynamic {
- return <A extends core::Object>(core::int v1) → dynamic {
- return <B extends core::Object>(A v2, self::producer::K v3, B v4) → dynamic => 0;
+typedef C<A extends core::Object = dynamic, K extends core::Object = dynamic> = <B extends core::Object = dynamic>(A, K, B) → core::int;
+typedef D<K extends core::Object = dynamic> = <A extends core::Object = dynamic>(core::int) → <B extends core::Object>(A, K, B) → core::int;
+static method producer<K extends core::Object = dynamic>() → dynamic {
+ return <A extends core::Object = dynamic>(core::int v1) → dynamic {
+ return <B extends core::Object = dynamic>(A v2, self::producer::K v3, B v4) → dynamic => 0;
};
}
static method main() → dynamic {
diff --git a/pkg/front_end/testcases/regress/issue_31213.dart.outline.expect b/pkg/front_end/testcases/regress/issue_31213.dart.outline.expect
index ab22b45..2626a19 100644
--- a/pkg/front_end/testcases/regress/issue_31213.dart.outline.expect
+++ b/pkg/front_end/testcases/regress/issue_31213.dart.outline.expect
@@ -2,9 +2,9 @@
import self as self;
import "dart:core" as core;
-typedef C<A extends core::Object, K extends core::Object> = <B extends core::Object>(A, K, B) → core::int;
-typedef D<K extends core::Object> = <A extends core::Object>(core::int) → <B extends core::Object>(A, K, B) → core::int;
-static method producer<K extends core::Object>() → dynamic
+typedef C<A extends core::Object = dynamic, K extends core::Object = dynamic> = <B extends core::Object = dynamic>(A, K, B) → core::int;
+typedef D<K extends core::Object = dynamic> = <A extends core::Object = dynamic>(core::int) → <B extends core::Object>(A, K, B) → core::int;
+static method producer<K extends core::Object = dynamic>() → dynamic
;
static method main() → dynamic
;
diff --git a/pkg/front_end/testcases/regress/issue_31213.dart.strong.expect b/pkg/front_end/testcases/regress/issue_31213.dart.strong.expect
index c6e0d5f..730da9b 100644
--- a/pkg/front_end/testcases/regress/issue_31213.dart.strong.expect
+++ b/pkg/front_end/testcases/regress/issue_31213.dart.strong.expect
@@ -2,11 +2,11 @@
import self as self;
import "dart:core" as core;
-typedef C<A extends core::Object, K extends core::Object> = <B extends core::Object>(A, K, B) → core::int;
-typedef D<K extends core::Object> = <A extends core::Object>(core::int) → <B extends core::Object>(A, K, B) → core::int;
-static method producer<K extends core::Object>() → dynamic {
- return <A extends core::Object>(core::int v1) → <B extends core::Object>(A, self::producer::K, B) → core::int {
- return <B extends core::Object>(A v2, self::producer::K v3, B v4) → core::int => 0;
+typedef C<A extends core::Object = dynamic, K extends core::Object = dynamic> = <B extends core::Object = dynamic>(A, K, B) → core::int;
+typedef D<K extends core::Object = dynamic> = <A extends core::Object = dynamic>(core::int) → <B extends core::Object>(A, K, B) → core::int;
+static method producer<K extends core::Object = dynamic>() → dynamic {
+ return <A extends core::Object = dynamic>(core::int v1) → <B extends core::Object = dynamic>(A, self::producer::K, B) → core::int {
+ return <B extends core::Object = dynamic>(A v2, self::producer::K v3, B v4) → core::int => 0;
};
}
static method main() → dynamic {
diff --git a/pkg/front_end/testcases/regress/issue_31213.dart.strong.transformed.expect b/pkg/front_end/testcases/regress/issue_31213.dart.strong.transformed.expect
index c6e0d5f..730da9b 100644
--- a/pkg/front_end/testcases/regress/issue_31213.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/regress/issue_31213.dart.strong.transformed.expect
@@ -2,11 +2,11 @@
import self as self;
import "dart:core" as core;
-typedef C<A extends core::Object, K extends core::Object> = <B extends core::Object>(A, K, B) → core::int;
-typedef D<K extends core::Object> = <A extends core::Object>(core::int) → <B extends core::Object>(A, K, B) → core::int;
-static method producer<K extends core::Object>() → dynamic {
- return <A extends core::Object>(core::int v1) → <B extends core::Object>(A, self::producer::K, B) → core::int {
- return <B extends core::Object>(A v2, self::producer::K v3, B v4) → core::int => 0;
+typedef C<A extends core::Object = dynamic, K extends core::Object = dynamic> = <B extends core::Object = dynamic>(A, K, B) → core::int;
+typedef D<K extends core::Object = dynamic> = <A extends core::Object = dynamic>(core::int) → <B extends core::Object>(A, K, B) → core::int;
+static method producer<K extends core::Object = dynamic>() → dynamic {
+ return <A extends core::Object = dynamic>(core::int v1) → <B extends core::Object = dynamic>(A, self::producer::K, B) → core::int {
+ return <B extends core::Object = dynamic>(A v2, self::producer::K v3, B v4) → core::int => 0;
};
}
static method main() → dynamic {
diff --git a/pkg/front_end/testcases/regress/issue_31766.dart.direct.expect b/pkg/front_end/testcases/regress/issue_31766.dart.direct.expect
index ad01f98..c532f88 100644
--- a/pkg/front_end/testcases/regress/issue_31766.dart.direct.expect
+++ b/pkg/front_end/testcases/regress/issue_31766.dart.direct.expect
@@ -10,11 +10,11 @@
return null;
}
static method main() → dynamic {
- function bar<T extends self::A>(T t) → void {
+ function bar<T extends self::A = dynamic>(T t) → void {
core::print("t.foo()=${t.foo()}");
}
bar.call(new self::A::•());
- (<S extends self::A>(S s) → dynamic {
+ (<S extends self::A = dynamic>(S s) → dynamic {
core::print("s.foo()=${s.foo()}");
}).call(new self::A::•());
}
diff --git a/pkg/front_end/testcases/regress/issue_31766.dart.direct.transformed.expect b/pkg/front_end/testcases/regress/issue_31766.dart.direct.transformed.expect
index ad01f98..c532f88 100644
--- a/pkg/front_end/testcases/regress/issue_31766.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/regress/issue_31766.dart.direct.transformed.expect
@@ -10,11 +10,11 @@
return null;
}
static method main() → dynamic {
- function bar<T extends self::A>(T t) → void {
+ function bar<T extends self::A = dynamic>(T t) → void {
core::print("t.foo()=${t.foo()}");
}
bar.call(new self::A::•());
- (<S extends self::A>(S s) → dynamic {
+ (<S extends self::A = dynamic>(S s) → dynamic {
core::print("s.foo()=${s.foo()}");
}).call(new self::A::•());
}
diff --git a/pkg/front_end/testcases/regress/issue_31766.dart.strong.expect b/pkg/front_end/testcases/regress/issue_31766.dart.strong.expect
index 5228fa9..33b060d 100644
--- a/pkg/front_end/testcases/regress/issue_31766.dart.strong.expect
+++ b/pkg/front_end/testcases/regress/issue_31766.dart.strong.expect
@@ -10,11 +10,11 @@
return null;
}
static method main() → dynamic {
- function bar<T extends self::A>(T t) → void {
+ function bar<T extends self::A = dynamic>(T t) → void {
core::print("t.foo()=${t.{self::A::foo}()}");
}
bar.call<self::A>(new self::A::•());
- (<S extends self::A>(S s) → core::Null {
+ (<S extends self::A = dynamic>(S s) → core::Null {
core::print("s.foo()=${s.{self::A::foo}()}");
}).call<self::A>(new self::A::•());
}
diff --git a/pkg/front_end/testcases/regress/issue_31766.dart.strong.transformed.expect b/pkg/front_end/testcases/regress/issue_31766.dart.strong.transformed.expect
index 5228fa9..33b060d 100644
--- a/pkg/front_end/testcases/regress/issue_31766.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/regress/issue_31766.dart.strong.transformed.expect
@@ -10,11 +10,11 @@
return null;
}
static method main() → dynamic {
- function bar<T extends self::A>(T t) → void {
+ function bar<T extends self::A = dynamic>(T t) → void {
core::print("t.foo()=${t.{self::A::foo}()}");
}
bar.call<self::A>(new self::A::•());
- (<S extends self::A>(S s) → core::Null {
+ (<S extends self::A = dynamic>(S s) → core::Null {
core::print("s.foo()=${s.{self::A::foo}()}");
}).call<self::A>(new self::A::•());
}
diff --git a/pkg/front_end/testcases/regress/issue_31846.dart.direct.expect b/pkg/front_end/testcases/regress/issue_31846.dart.direct.expect
index 960d4d1..710cc04 100644
--- a/pkg/front_end/testcases/regress/issue_31846.dart.direct.expect
+++ b/pkg/front_end/testcases/regress/issue_31846.dart.direct.expect
@@ -4,7 +4,7 @@
static method main() → dynamic {
core::print(self::main is () → dynamic);
- core::print((<T extends core::Object>(T x) → dynamic => x).runtimeType);
- core::print((<T extends core::num>(T x) → dynamic => x).runtimeType);
- core::print((<T extends core::Comparable<T>>(T x) → dynamic => x).runtimeType);
+ core::print((<T extends core::Object = dynamic>(T x) → dynamic => x).runtimeType);
+ core::print((<T extends core::num = dynamic>(T x) → dynamic => x).runtimeType);
+ core::print((<T extends core::Comparable<T> = dynamic>(T x) → dynamic => x).runtimeType);
}
diff --git a/pkg/front_end/testcases/regress/issue_31846.dart.direct.transformed.expect b/pkg/front_end/testcases/regress/issue_31846.dart.direct.transformed.expect
index 960d4d1..710cc04 100644
--- a/pkg/front_end/testcases/regress/issue_31846.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/regress/issue_31846.dart.direct.transformed.expect
@@ -4,7 +4,7 @@
static method main() → dynamic {
core::print(self::main is () → dynamic);
- core::print((<T extends core::Object>(T x) → dynamic => x).runtimeType);
- core::print((<T extends core::num>(T x) → dynamic => x).runtimeType);
- core::print((<T extends core::Comparable<T>>(T x) → dynamic => x).runtimeType);
+ core::print((<T extends core::Object = dynamic>(T x) → dynamic => x).runtimeType);
+ core::print((<T extends core::num = dynamic>(T x) → dynamic => x).runtimeType);
+ core::print((<T extends core::Comparable<T> = dynamic>(T x) → dynamic => x).runtimeType);
}
diff --git a/pkg/front_end/testcases/regress/issue_31846.dart.strong.expect b/pkg/front_end/testcases/regress/issue_31846.dart.strong.expect
index 8a842f2..fc1a7b3 100644
--- a/pkg/front_end/testcases/regress/issue_31846.dart.strong.expect
+++ b/pkg/front_end/testcases/regress/issue_31846.dart.strong.expect
@@ -4,7 +4,7 @@
static method main() → dynamic {
core::print(self::main is () → dynamic);
- core::print((<T extends core::Object>(T x) → T => x).{core::Object::runtimeType});
- core::print((<T extends core::num>(T x) → T => x).{core::Object::runtimeType});
- core::print((<T extends core::Comparable<T>>(T x) → T => x).{core::Object::runtimeType});
+ core::print((<T extends core::Object = dynamic>(T x) → T => x).{core::Object::runtimeType});
+ core::print((<T extends core::num = dynamic>(T x) → T => x).{core::Object::runtimeType});
+ core::print((<T extends core::Comparable<T> = dynamic>(T x) → T => x).{core::Object::runtimeType});
}
diff --git a/pkg/front_end/testcases/regress/issue_31846.dart.strong.transformed.expect b/pkg/front_end/testcases/regress/issue_31846.dart.strong.transformed.expect
index 8a842f2..fc1a7b3 100644
--- a/pkg/front_end/testcases/regress/issue_31846.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/regress/issue_31846.dart.strong.transformed.expect
@@ -4,7 +4,7 @@
static method main() → dynamic {
core::print(self::main is () → dynamic);
- core::print((<T extends core::Object>(T x) → T => x).{core::Object::runtimeType});
- core::print((<T extends core::num>(T x) → T => x).{core::Object::runtimeType});
- core::print((<T extends core::Comparable<T>>(T x) → T => x).{core::Object::runtimeType});
+ core::print((<T extends core::Object = dynamic>(T x) → T => x).{core::Object::runtimeType});
+ core::print((<T extends core::num = dynamic>(T x) → T => x).{core::Object::runtimeType});
+ core::print((<T extends core::Comparable<T> = dynamic>(T x) → T => x).{core::Object::runtimeType});
}
diff --git a/pkg/front_end/testcases/regress/issue_31996.dart.direct.expect b/pkg/front_end/testcases/regress/issue_31996.dart.direct.expect
index 7b5a76e..46c7f90 100644
--- a/pkg/front_end/testcases/regress/issue_31996.dart.direct.expect
+++ b/pkg/front_end/testcases/regress/issue_31996.dart.direct.expect
@@ -2,12 +2,12 @@
import self as self;
import "dart:core" as core;
-abstract class B<T extends core::Object> extends core::Object {
+abstract class B<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-abstract class C<T extends core::Object> extends core::Object {
+abstract class C<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/regress/issue_31996.dart.direct.transformed.expect b/pkg/front_end/testcases/regress/issue_31996.dart.direct.transformed.expect
index 7b5a76e..46c7f90 100644
--- a/pkg/front_end/testcases/regress/issue_31996.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/regress/issue_31996.dart.direct.transformed.expect
@@ -2,12 +2,12 @@
import self as self;
import "dart:core" as core;
-abstract class B<T extends core::Object> extends core::Object {
+abstract class B<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-abstract class C<T extends core::Object> extends core::Object {
+abstract class C<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/regress/issue_31996.dart.outline.expect b/pkg/front_end/testcases/regress/issue_31996.dart.outline.expect
index 5dca73f..38497b9 100644
--- a/pkg/front_end/testcases/regress/issue_31996.dart.outline.expect
+++ b/pkg/front_end/testcases/regress/issue_31996.dart.outline.expect
@@ -2,11 +2,11 @@
import self as self;
import "dart:core" as core;
-abstract class B<T extends core::Object> extends core::Object {
+abstract class B<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
;
}
-abstract class C<T extends core::Object> extends core::Object {
+abstract class C<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
;
}
diff --git a/pkg/front_end/testcases/regress/issue_31996.dart.strong.expect b/pkg/front_end/testcases/regress/issue_31996.dart.strong.expect
index 7b5a76e..46c7f90 100644
--- a/pkg/front_end/testcases/regress/issue_31996.dart.strong.expect
+++ b/pkg/front_end/testcases/regress/issue_31996.dart.strong.expect
@@ -2,12 +2,12 @@
import self as self;
import "dart:core" as core;
-abstract class B<T extends core::Object> extends core::Object {
+abstract class B<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-abstract class C<T extends core::Object> extends core::Object {
+abstract class C<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/regress/issue_31996.dart.strong.transformed.expect b/pkg/front_end/testcases/regress/issue_31996.dart.strong.transformed.expect
index 7b5a76e..46c7f90 100644
--- a/pkg/front_end/testcases/regress/issue_31996.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/regress/issue_31996.dart.strong.transformed.expect
@@ -2,12 +2,12 @@
import self as self;
import "dart:core" as core;
-abstract class B<T extends core::Object> extends core::Object {
+abstract class B<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
}
-abstract class C<T extends core::Object> extends core::Object {
+abstract class C<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/regress/issue_32182.dart.direct.expect b/pkg/front_end/testcases/regress/issue_32182.dart.direct.expect
index 634143d..f95cc9a 100644
--- a/pkg/front_end/testcases/regress/issue_32182.dart.direct.expect
+++ b/pkg/front_end/testcases/regress/issue_32182.dart.direct.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class A<T extends core::Object> extends core::Object {
+class A<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/regress/issue_32182.dart.direct.transformed.expect b/pkg/front_end/testcases/regress/issue_32182.dart.direct.transformed.expect
index aeae487..a899754 100644
--- a/pkg/front_end/testcases/regress/issue_32182.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/regress/issue_32182.dart.direct.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class A<T extends core::Object> extends core::Object {
+class A<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/regress/issue_32182.dart.outline.expect b/pkg/front_end/testcases/regress/issue_32182.dart.outline.expect
index 92da155..a8c130e 100644
--- a/pkg/front_end/testcases/regress/issue_32182.dart.outline.expect
+++ b/pkg/front_end/testcases/regress/issue_32182.dart.outline.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class A<T extends core::Object> extends core::Object {
+class A<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
;
}
diff --git a/pkg/front_end/testcases/regress/issue_32182.dart.strong.expect b/pkg/front_end/testcases/regress/issue_32182.dart.strong.expect
index e9a1802..3d90b60 100644
--- a/pkg/front_end/testcases/regress/issue_32182.dart.strong.expect
+++ b/pkg/front_end/testcases/regress/issue_32182.dart.strong.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class A<T extends core::Object> extends core::Object {
+class A<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/regress/issue_32182.dart.strong.transformed.expect b/pkg/front_end/testcases/regress/issue_32182.dart.strong.transformed.expect
index 179409c..34ee38b 100644
--- a/pkg/front_end/testcases/regress/issue_32182.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/regress/issue_32182.dart.strong.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class A<T extends core::Object> extends core::Object {
+class A<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/runtime_checks/contravariant_field.dart.direct.expect b/pkg/front_end/testcases/runtime_checks/contravariant_field.dart.direct.expect
index cd8a1ec..24a436e 100644
--- a/pkg/front_end/testcases/runtime_checks/contravariant_field.dart.direct.expect
+++ b/pkg/front_end/testcases/runtime_checks/contravariant_field.dart.direct.expect
@@ -2,8 +2,8 @@
import self as self;
import "dart:core" as core;
-typedef F<T extends core::Object> = (T) → void;
-class C<T extends core::Object> extends core::Object {
+typedef F<T extends core::Object = dynamic> = (T) → void;
+class C<T extends core::Object = dynamic> extends core::Object {
field (self::C::T) → void y = null;
synthetic constructor •() → void
: super core::Object::•()
diff --git a/pkg/front_end/testcases/runtime_checks/contravariant_field.dart.direct.transformed.expect b/pkg/front_end/testcases/runtime_checks/contravariant_field.dart.direct.transformed.expect
index cd8a1ec..24a436e 100644
--- a/pkg/front_end/testcases/runtime_checks/contravariant_field.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/runtime_checks/contravariant_field.dart.direct.transformed.expect
@@ -2,8 +2,8 @@
import self as self;
import "dart:core" as core;
-typedef F<T extends core::Object> = (T) → void;
-class C<T extends core::Object> extends core::Object {
+typedef F<T extends core::Object = dynamic> = (T) → void;
+class C<T extends core::Object = dynamic> extends core::Object {
field (self::C::T) → void y = null;
synthetic constructor •() → void
: super core::Object::•()
diff --git a/pkg/front_end/testcases/runtime_checks/contravariant_field.dart.outline.expect b/pkg/front_end/testcases/runtime_checks/contravariant_field.dart.outline.expect
index 27f223b..e23f39e 100644
--- a/pkg/front_end/testcases/runtime_checks/contravariant_field.dart.outline.expect
+++ b/pkg/front_end/testcases/runtime_checks/contravariant_field.dart.outline.expect
@@ -2,8 +2,8 @@
import self as self;
import "dart:core" as core;
-typedef F<T extends core::Object> = (T) → void;
-class C<T extends core::Object> extends core::Object {
+typedef F<T extends core::Object = dynamic> = (T) → void;
+class C<T extends core::Object = dynamic> extends core::Object {
field (self::C::T) → void y;
synthetic constructor •() → void
;
diff --git a/pkg/front_end/testcases/runtime_checks/contravariant_field.dart.strong.expect b/pkg/front_end/testcases/runtime_checks/contravariant_field.dart.strong.expect
index c6d729f..44fde23 100644
--- a/pkg/front_end/testcases/runtime_checks/contravariant_field.dart.strong.expect
+++ b/pkg/front_end/testcases/runtime_checks/contravariant_field.dart.strong.expect
@@ -2,8 +2,8 @@
import self as self;
import "dart:core" as core;
-typedef F<T extends core::Object> = (T) → void;
-class C<T extends core::Object> extends core::Object {
+typedef F<T extends core::Object = dynamic> = (T) → void;
+class C<T extends core::Object = dynamic> extends core::Object {
field (self::C::T) → void y = null;
synthetic constructor •() → void
: super core::Object::•()
diff --git a/pkg/front_end/testcases/runtime_checks/contravariant_field.dart.strong.transformed.expect b/pkg/front_end/testcases/runtime_checks/contravariant_field.dart.strong.transformed.expect
index c6d729f..44fde23 100644
--- a/pkg/front_end/testcases/runtime_checks/contravariant_field.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/runtime_checks/contravariant_field.dart.strong.transformed.expect
@@ -2,8 +2,8 @@
import self as self;
import "dart:core" as core;
-typedef F<T extends core::Object> = (T) → void;
-class C<T extends core::Object> extends core::Object {
+typedef F<T extends core::Object = dynamic> = (T) → void;
+class C<T extends core::Object = dynamic> extends core::Object {
field (self::C::T) → void y = null;
synthetic constructor •() → void
: super core::Object::•()
diff --git a/pkg/front_end/testcases/runtime_checks/contravariant_generic_method_type_parameter.dart.direct.expect b/pkg/front_end/testcases/runtime_checks/contravariant_generic_method_type_parameter.dart.direct.expect
index bf5d9be..bd2b5aa 100644
--- a/pkg/front_end/testcases/runtime_checks/contravariant_generic_method_type_parameter.dart.direct.expect
+++ b/pkg/front_end/testcases/runtime_checks/contravariant_generic_method_type_parameter.dart.direct.expect
@@ -2,12 +2,12 @@
import self as self;
import "dart:core" as core;
-typedef F<T extends core::Object> = (T) → void;
-class C<T extends core::Object> extends core::Object {
+typedef F<T extends core::Object = dynamic> = (T) → void;
+class C<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
- method f<U extends (self::C::T) → void>(self::C::f::U x) → void {}
+ method f<U extends (self::C::T) → void = dynamic>(self::C::f::U x) → void {}
}
static method g(self::C<core::num> c) → void {
c.f<(core::Object) → void>((core::Object o) → dynamic {});
diff --git a/pkg/front_end/testcases/runtime_checks/contravariant_generic_method_type_parameter.dart.direct.transformed.expect b/pkg/front_end/testcases/runtime_checks/contravariant_generic_method_type_parameter.dart.direct.transformed.expect
index bf5d9be..bd2b5aa 100644
--- a/pkg/front_end/testcases/runtime_checks/contravariant_generic_method_type_parameter.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/runtime_checks/contravariant_generic_method_type_parameter.dart.direct.transformed.expect
@@ -2,12 +2,12 @@
import self as self;
import "dart:core" as core;
-typedef F<T extends core::Object> = (T) → void;
-class C<T extends core::Object> extends core::Object {
+typedef F<T extends core::Object = dynamic> = (T) → void;
+class C<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
- method f<U extends (self::C::T) → void>(self::C::f::U x) → void {}
+ method f<U extends (self::C::T) → void = dynamic>(self::C::f::U x) → void {}
}
static method g(self::C<core::num> c) → void {
c.f<(core::Object) → void>((core::Object o) → dynamic {});
diff --git a/pkg/front_end/testcases/runtime_checks/contravariant_generic_method_type_parameter.dart.outline.expect b/pkg/front_end/testcases/runtime_checks/contravariant_generic_method_type_parameter.dart.outline.expect
index 8ec2342..a709687 100644
--- a/pkg/front_end/testcases/runtime_checks/contravariant_generic_method_type_parameter.dart.outline.expect
+++ b/pkg/front_end/testcases/runtime_checks/contravariant_generic_method_type_parameter.dart.outline.expect
@@ -2,11 +2,11 @@
import self as self;
import "dart:core" as core;
-typedef F<T extends core::Object> = (T) → void;
-class C<T extends core::Object> extends core::Object {
+typedef F<T extends core::Object = dynamic> = (T) → void;
+class C<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
;
- method f<U extends (self::C::T) → void>(self::C::f::U x) → void
+ method f<U extends (self::C::T) → void = dynamic>(self::C::f::U x) → void
;
}
static method g(self::C<core::num> c) → void
diff --git a/pkg/front_end/testcases/runtime_checks/contravariant_generic_method_type_parameter.dart.strong.expect b/pkg/front_end/testcases/runtime_checks/contravariant_generic_method_type_parameter.dart.strong.expect
index 547faf4..9ca2a67 100644
--- a/pkg/front_end/testcases/runtime_checks/contravariant_generic_method_type_parameter.dart.strong.expect
+++ b/pkg/front_end/testcases/runtime_checks/contravariant_generic_method_type_parameter.dart.strong.expect
@@ -2,12 +2,12 @@
import self as self;
import "dart:core" as core;
-typedef F<T extends core::Object> = (T) → void;
-class C<T extends core::Object> extends core::Object {
+typedef F<T extends core::Object = dynamic> = (T) → void;
+class C<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
- method f<U extends (self::C::T) → void>(self::C::f::U x) → void {}
+ method f<U extends (self::C::T) → void = dynamic>(self::C::f::U x) → void {}
}
static method g(self::C<core::num> c) → void {
c.{self::C::f}<(core::Object) → void>((core::Object o) → core::Null {});
diff --git a/pkg/front_end/testcases/runtime_checks/contravariant_generic_method_type_parameter.dart.strong.transformed.expect b/pkg/front_end/testcases/runtime_checks/contravariant_generic_method_type_parameter.dart.strong.transformed.expect
index 547faf4..9ca2a67 100644
--- a/pkg/front_end/testcases/runtime_checks/contravariant_generic_method_type_parameter.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/runtime_checks/contravariant_generic_method_type_parameter.dart.strong.transformed.expect
@@ -2,12 +2,12 @@
import self as self;
import "dart:core" as core;
-typedef F<T extends core::Object> = (T) → void;
-class C<T extends core::Object> extends core::Object {
+typedef F<T extends core::Object = dynamic> = (T) → void;
+class C<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
- method f<U extends (self::C::T) → void>(self::C::f::U x) → void {}
+ method f<U extends (self::C::T) → void = dynamic>(self::C::f::U x) → void {}
}
static method g(self::C<core::num> c) → void {
c.{self::C::f}<(core::Object) → void>((core::Object o) → core::Null {});
diff --git a/pkg/front_end/testcases/runtime_checks/contravariant_generic_return.dart.direct.expect b/pkg/front_end/testcases/runtime_checks/contravariant_generic_return.dart.direct.expect
index 5221de2..e5707a0 100644
--- a/pkg/front_end/testcases/runtime_checks/contravariant_generic_return.dart.direct.expect
+++ b/pkg/front_end/testcases/runtime_checks/contravariant_generic_return.dart.direct.expect
@@ -2,8 +2,8 @@
import self as self;
import "dart:core" as core;
-typedef F<T extends core::Object> = (T) → void;
-class C<T extends core::Object> extends core::Object {
+typedef F<T extends core::Object = dynamic> = (T) → void;
+class C<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/runtime_checks/contravariant_generic_return.dart.direct.transformed.expect b/pkg/front_end/testcases/runtime_checks/contravariant_generic_return.dart.direct.transformed.expect
index 5221de2..e5707a0 100644
--- a/pkg/front_end/testcases/runtime_checks/contravariant_generic_return.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/runtime_checks/contravariant_generic_return.dart.direct.transformed.expect
@@ -2,8 +2,8 @@
import self as self;
import "dart:core" as core;
-typedef F<T extends core::Object> = (T) → void;
-class C<T extends core::Object> extends core::Object {
+typedef F<T extends core::Object = dynamic> = (T) → void;
+class C<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/runtime_checks/contravariant_generic_return.dart.outline.expect b/pkg/front_end/testcases/runtime_checks/contravariant_generic_return.dart.outline.expect
index a87c9ba..87b34bb 100644
--- a/pkg/front_end/testcases/runtime_checks/contravariant_generic_return.dart.outline.expect
+++ b/pkg/front_end/testcases/runtime_checks/contravariant_generic_return.dart.outline.expect
@@ -2,8 +2,8 @@
import self as self;
import "dart:core" as core;
-typedef F<T extends core::Object> = (T) → void;
-class C<T extends core::Object> extends core::Object {
+typedef F<T extends core::Object = dynamic> = (T) → void;
+class C<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
;
method f1() → (self::C::T) → void
diff --git a/pkg/front_end/testcases/runtime_checks/contravariant_generic_return.dart.strong.expect b/pkg/front_end/testcases/runtime_checks/contravariant_generic_return.dart.strong.expect
index a18c06b..c94a828 100644
--- a/pkg/front_end/testcases/runtime_checks/contravariant_generic_return.dart.strong.expect
+++ b/pkg/front_end/testcases/runtime_checks/contravariant_generic_return.dart.strong.expect
@@ -2,8 +2,8 @@
import self as self;
import "dart:core" as core;
-typedef F<T extends core::Object> = (T) → void;
-class C<T extends core::Object> extends core::Object {
+typedef F<T extends core::Object = dynamic> = (T) → void;
+class C<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/runtime_checks/contravariant_generic_return.dart.strong.transformed.expect b/pkg/front_end/testcases/runtime_checks/contravariant_generic_return.dart.strong.transformed.expect
index a18c06b..c94a828 100644
--- a/pkg/front_end/testcases/runtime_checks/contravariant_generic_return.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/runtime_checks/contravariant_generic_return.dart.strong.transformed.expect
@@ -2,8 +2,8 @@
import self as self;
import "dart:core" as core;
-typedef F<T extends core::Object> = (T) → void;
-class C<T extends core::Object> extends core::Object {
+typedef F<T extends core::Object = dynamic> = (T) → void;
+class C<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/runtime_checks/contravariant_generic_return_null_aware.dart.direct.expect b/pkg/front_end/testcases/runtime_checks/contravariant_generic_return_null_aware.dart.direct.expect
index 8acd66a..e4d2536 100644
--- a/pkg/front_end/testcases/runtime_checks/contravariant_generic_return_null_aware.dart.direct.expect
+++ b/pkg/front_end/testcases/runtime_checks/contravariant_generic_return_null_aware.dart.direct.expect
@@ -2,8 +2,8 @@
import self as self;
import "dart:core" as core;
-typedef F<T extends core::Object> = (T) → void;
-class C<T extends core::Object> extends core::Object {
+typedef F<T extends core::Object = dynamic> = (T) → void;
+class C<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/runtime_checks/contravariant_generic_return_null_aware.dart.direct.transformed.expect b/pkg/front_end/testcases/runtime_checks/contravariant_generic_return_null_aware.dart.direct.transformed.expect
index 8acd66a..e4d2536 100644
--- a/pkg/front_end/testcases/runtime_checks/contravariant_generic_return_null_aware.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/runtime_checks/contravariant_generic_return_null_aware.dart.direct.transformed.expect
@@ -2,8 +2,8 @@
import self as self;
import "dart:core" as core;
-typedef F<T extends core::Object> = (T) → void;
-class C<T extends core::Object> extends core::Object {
+typedef F<T extends core::Object = dynamic> = (T) → void;
+class C<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/runtime_checks/contravariant_generic_return_null_aware.dart.outline.expect b/pkg/front_end/testcases/runtime_checks/contravariant_generic_return_null_aware.dart.outline.expect
index a87c9ba..87b34bb 100644
--- a/pkg/front_end/testcases/runtime_checks/contravariant_generic_return_null_aware.dart.outline.expect
+++ b/pkg/front_end/testcases/runtime_checks/contravariant_generic_return_null_aware.dart.outline.expect
@@ -2,8 +2,8 @@
import self as self;
import "dart:core" as core;
-typedef F<T extends core::Object> = (T) → void;
-class C<T extends core::Object> extends core::Object {
+typedef F<T extends core::Object = dynamic> = (T) → void;
+class C<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
;
method f1() → (self::C::T) → void
diff --git a/pkg/front_end/testcases/runtime_checks/contravariant_generic_return_null_aware.dart.strong.expect b/pkg/front_end/testcases/runtime_checks/contravariant_generic_return_null_aware.dart.strong.expect
index a67d03d..e9ad7e2 100644
--- a/pkg/front_end/testcases/runtime_checks/contravariant_generic_return_null_aware.dart.strong.expect
+++ b/pkg/front_end/testcases/runtime_checks/contravariant_generic_return_null_aware.dart.strong.expect
@@ -2,8 +2,8 @@
import self as self;
import "dart:core" as core;
-typedef F<T extends core::Object> = (T) → void;
-class C<T extends core::Object> extends core::Object {
+typedef F<T extends core::Object = dynamic> = (T) → void;
+class C<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/runtime_checks/contravariant_generic_return_null_aware.dart.strong.transformed.expect b/pkg/front_end/testcases/runtime_checks/contravariant_generic_return_null_aware.dart.strong.transformed.expect
index a67d03d..e9ad7e2 100644
--- a/pkg/front_end/testcases/runtime_checks/contravariant_generic_return_null_aware.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/runtime_checks/contravariant_generic_return_null_aware.dart.strong.transformed.expect
@@ -2,8 +2,8 @@
import self as self;
import "dart:core" as core;
-typedef F<T extends core::Object> = (T) → void;
-class C<T extends core::Object> extends core::Object {
+typedef F<T extends core::Object = dynamic> = (T) → void;
+class C<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/runtime_checks/contravariant_generic_return_tear_off.dart.direct.expect b/pkg/front_end/testcases/runtime_checks/contravariant_generic_return_tear_off.dart.direct.expect
index 70ed6d7..7c86eac 100644
--- a/pkg/front_end/testcases/runtime_checks/contravariant_generic_return_tear_off.dart.direct.expect
+++ b/pkg/front_end/testcases/runtime_checks/contravariant_generic_return_tear_off.dart.direct.expect
@@ -2,9 +2,9 @@
import self as self;
import "dart:core" as core;
-typedef F<T extends core::Object> = (T) → void;
-typedef G<T extends core::Object> = () → (T) → void;
-class C<T extends core::Object> extends core::Object {
+typedef F<T extends core::Object = dynamic> = (T) → void;
+typedef G<T extends core::Object = dynamic> = () → (T) → void;
+class C<T extends core::Object = dynamic> extends core::Object {
field (self::C::T) → void _x;
constructor •((self::C::T) → void _x) → void
: self::C::_x = _x, super core::Object::•()
diff --git a/pkg/front_end/testcases/runtime_checks/contravariant_generic_return_tear_off.dart.direct.transformed.expect b/pkg/front_end/testcases/runtime_checks/contravariant_generic_return_tear_off.dart.direct.transformed.expect
index 70ed6d7..7c86eac 100644
--- a/pkg/front_end/testcases/runtime_checks/contravariant_generic_return_tear_off.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/runtime_checks/contravariant_generic_return_tear_off.dart.direct.transformed.expect
@@ -2,9 +2,9 @@
import self as self;
import "dart:core" as core;
-typedef F<T extends core::Object> = (T) → void;
-typedef G<T extends core::Object> = () → (T) → void;
-class C<T extends core::Object> extends core::Object {
+typedef F<T extends core::Object = dynamic> = (T) → void;
+typedef G<T extends core::Object = dynamic> = () → (T) → void;
+class C<T extends core::Object = dynamic> extends core::Object {
field (self::C::T) → void _x;
constructor •((self::C::T) → void _x) → void
: self::C::_x = _x, super core::Object::•()
diff --git a/pkg/front_end/testcases/runtime_checks/contravariant_generic_return_tear_off.dart.outline.expect b/pkg/front_end/testcases/runtime_checks/contravariant_generic_return_tear_off.dart.outline.expect
index e1a454a..929714f 100644
--- a/pkg/front_end/testcases/runtime_checks/contravariant_generic_return_tear_off.dart.outline.expect
+++ b/pkg/front_end/testcases/runtime_checks/contravariant_generic_return_tear_off.dart.outline.expect
@@ -2,9 +2,9 @@
import self as self;
import "dart:core" as core;
-typedef F<T extends core::Object> = (T) → void;
-typedef G<T extends core::Object> = () → (T) → void;
-class C<T extends core::Object> extends core::Object {
+typedef F<T extends core::Object = dynamic> = (T) → void;
+typedef G<T extends core::Object = dynamic> = () → (T) → void;
+class C<T extends core::Object = dynamic> extends core::Object {
field (self::C::T) → void _x;
constructor •((self::C::T) → void _x) → void
;
diff --git a/pkg/front_end/testcases/runtime_checks/contravariant_generic_return_tear_off.dart.strong.expect b/pkg/front_end/testcases/runtime_checks/contravariant_generic_return_tear_off.dart.strong.expect
index ce92ed1..c12fd60 100644
--- a/pkg/front_end/testcases/runtime_checks/contravariant_generic_return_tear_off.dart.strong.expect
+++ b/pkg/front_end/testcases/runtime_checks/contravariant_generic_return_tear_off.dart.strong.expect
@@ -2,9 +2,9 @@
import self as self;
import "dart:core" as core;
-typedef F<T extends core::Object> = (T) → void;
-typedef G<T extends core::Object> = () → (T) → void;
-class C<T extends core::Object> extends core::Object {
+typedef F<T extends core::Object = dynamic> = (T) → void;
+typedef G<T extends core::Object = dynamic> = () → (T) → void;
+class C<T extends core::Object = dynamic> extends core::Object {
field (self::C::T) → void _x;
constructor •((self::C::T) → void _x) → void
: self::C::_x = _x, super core::Object::•()
diff --git a/pkg/front_end/testcases/runtime_checks/contravariant_generic_return_tear_off.dart.strong.transformed.expect b/pkg/front_end/testcases/runtime_checks/contravariant_generic_return_tear_off.dart.strong.transformed.expect
index ce92ed1..c12fd60 100644
--- a/pkg/front_end/testcases/runtime_checks/contravariant_generic_return_tear_off.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/runtime_checks/contravariant_generic_return_tear_off.dart.strong.transformed.expect
@@ -2,9 +2,9 @@
import self as self;
import "dart:core" as core;
-typedef F<T extends core::Object> = (T) → void;
-typedef G<T extends core::Object> = () → (T) → void;
-class C<T extends core::Object> extends core::Object {
+typedef F<T extends core::Object = dynamic> = (T) → void;
+typedef G<T extends core::Object = dynamic> = () → (T) → void;
+class C<T extends core::Object = dynamic> extends core::Object {
field (self::C::T) → void _x;
constructor •((self::C::T) → void _x) → void
: self::C::_x = _x, super core::Object::•()
diff --git a/pkg/front_end/testcases/runtime_checks/contravariant_getter.dart.direct.expect b/pkg/front_end/testcases/runtime_checks/contravariant_getter.dart.direct.expect
index e4fcea0..427e870 100644
--- a/pkg/front_end/testcases/runtime_checks/contravariant_getter.dart.direct.expect
+++ b/pkg/front_end/testcases/runtime_checks/contravariant_getter.dart.direct.expect
@@ -2,8 +2,8 @@
import self as self;
import "dart:core" as core;
-typedef F<T extends core::Object> = (T) → void;
-class C<T extends core::Object> extends core::Object {
+typedef F<T extends core::Object = dynamic> = (T) → void;
+class C<T extends core::Object = dynamic> extends core::Object {
field (self::C::T) → void y = null;
synthetic constructor •() → void
: super core::Object::•()
diff --git a/pkg/front_end/testcases/runtime_checks/contravariant_getter.dart.direct.transformed.expect b/pkg/front_end/testcases/runtime_checks/contravariant_getter.dart.direct.transformed.expect
index e4fcea0..427e870 100644
--- a/pkg/front_end/testcases/runtime_checks/contravariant_getter.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/runtime_checks/contravariant_getter.dart.direct.transformed.expect
@@ -2,8 +2,8 @@
import self as self;
import "dart:core" as core;
-typedef F<T extends core::Object> = (T) → void;
-class C<T extends core::Object> extends core::Object {
+typedef F<T extends core::Object = dynamic> = (T) → void;
+class C<T extends core::Object = dynamic> extends core::Object {
field (self::C::T) → void y = null;
synthetic constructor •() → void
: super core::Object::•()
diff --git a/pkg/front_end/testcases/runtime_checks/contravariant_getter.dart.outline.expect b/pkg/front_end/testcases/runtime_checks/contravariant_getter.dart.outline.expect
index 871ab56..46e1514 100644
--- a/pkg/front_end/testcases/runtime_checks/contravariant_getter.dart.outline.expect
+++ b/pkg/front_end/testcases/runtime_checks/contravariant_getter.dart.outline.expect
@@ -2,8 +2,8 @@
import self as self;
import "dart:core" as core;
-typedef F<T extends core::Object> = (T) → void;
-class C<T extends core::Object> extends core::Object {
+typedef F<T extends core::Object = dynamic> = (T) → void;
+class C<T extends core::Object = dynamic> extends core::Object {
field (self::C::T) → void y;
synthetic constructor •() → void
;
diff --git a/pkg/front_end/testcases/runtime_checks/contravariant_getter.dart.strong.expect b/pkg/front_end/testcases/runtime_checks/contravariant_getter.dart.strong.expect
index a13a055..0d90e29 100644
--- a/pkg/front_end/testcases/runtime_checks/contravariant_getter.dart.strong.expect
+++ b/pkg/front_end/testcases/runtime_checks/contravariant_getter.dart.strong.expect
@@ -2,8 +2,8 @@
import self as self;
import "dart:core" as core;
-typedef F<T extends core::Object> = (T) → void;
-class C<T extends core::Object> extends core::Object {
+typedef F<T extends core::Object = dynamic> = (T) → void;
+class C<T extends core::Object = dynamic> extends core::Object {
field (self::C::T) → void y = null;
synthetic constructor •() → void
: super core::Object::•()
diff --git a/pkg/front_end/testcases/runtime_checks/contravariant_getter.dart.strong.transformed.expect b/pkg/front_end/testcases/runtime_checks/contravariant_getter.dart.strong.transformed.expect
index a13a055..0d90e29 100644
--- a/pkg/front_end/testcases/runtime_checks/contravariant_getter.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/runtime_checks/contravariant_getter.dart.strong.transformed.expect
@@ -2,8 +2,8 @@
import self as self;
import "dart:core" as core;
-typedef F<T extends core::Object> = (T) → void;
-class C<T extends core::Object> extends core::Object {
+typedef F<T extends core::Object = dynamic> = (T) → void;
+class C<T extends core::Object = dynamic> extends core::Object {
field (self::C::T) → void y = null;
synthetic constructor •() → void
: super core::Object::•()
diff --git a/pkg/front_end/testcases/runtime_checks/contravariant_getter_return.dart.direct.expect b/pkg/front_end/testcases/runtime_checks/contravariant_getter_return.dart.direct.expect
index 012a192..a07d5f0 100644
--- a/pkg/front_end/testcases/runtime_checks/contravariant_getter_return.dart.direct.expect
+++ b/pkg/front_end/testcases/runtime_checks/contravariant_getter_return.dart.direct.expect
@@ -2,8 +2,8 @@
import self as self;
import "dart:core" as core;
-typedef F<T extends core::Object> = (T) → void;
-class C<T extends core::Object> extends core::Object {
+typedef F<T extends core::Object = dynamic> = (T) → void;
+class C<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/runtime_checks/contravariant_getter_return.dart.direct.transformed.expect b/pkg/front_end/testcases/runtime_checks/contravariant_getter_return.dart.direct.transformed.expect
index 012a192..a07d5f0 100644
--- a/pkg/front_end/testcases/runtime_checks/contravariant_getter_return.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/runtime_checks/contravariant_getter_return.dart.direct.transformed.expect
@@ -2,8 +2,8 @@
import self as self;
import "dart:core" as core;
-typedef F<T extends core::Object> = (T) → void;
-class C<T extends core::Object> extends core::Object {
+typedef F<T extends core::Object = dynamic> = (T) → void;
+class C<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/runtime_checks/contravariant_getter_return.dart.outline.expect b/pkg/front_end/testcases/runtime_checks/contravariant_getter_return.dart.outline.expect
index 5f2d058..1043616 100644
--- a/pkg/front_end/testcases/runtime_checks/contravariant_getter_return.dart.outline.expect
+++ b/pkg/front_end/testcases/runtime_checks/contravariant_getter_return.dart.outline.expect
@@ -2,8 +2,8 @@
import self as self;
import "dart:core" as core;
-typedef F<T extends core::Object> = (T) → void;
-class C<T extends core::Object> extends core::Object {
+typedef F<T extends core::Object = dynamic> = (T) → void;
+class C<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
;
get f1() → (self::C::T) → void
diff --git a/pkg/front_end/testcases/runtime_checks/contravariant_getter_return.dart.strong.expect b/pkg/front_end/testcases/runtime_checks/contravariant_getter_return.dart.strong.expect
index 5f2899e..147d4fd 100644
--- a/pkg/front_end/testcases/runtime_checks/contravariant_getter_return.dart.strong.expect
+++ b/pkg/front_end/testcases/runtime_checks/contravariant_getter_return.dart.strong.expect
@@ -2,8 +2,8 @@
import self as self;
import "dart:core" as core;
-typedef F<T extends core::Object> = (T) → void;
-class C<T extends core::Object> extends core::Object {
+typedef F<T extends core::Object = dynamic> = (T) → void;
+class C<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/runtime_checks/contravariant_getter_return.dart.strong.transformed.expect b/pkg/front_end/testcases/runtime_checks/contravariant_getter_return.dart.strong.transformed.expect
index 5f2899e..147d4fd 100644
--- a/pkg/front_end/testcases/runtime_checks/contravariant_getter_return.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/runtime_checks/contravariant_getter_return.dart.strong.transformed.expect
@@ -2,8 +2,8 @@
import self as self;
import "dart:core" as core;
-typedef F<T extends core::Object> = (T) → void;
-class C<T extends core::Object> extends core::Object {
+typedef F<T extends core::Object = dynamic> = (T) → void;
+class C<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/runtime_checks/contravariant_getter_return_null_aware.dart.direct.expect b/pkg/front_end/testcases/runtime_checks/contravariant_getter_return_null_aware.dart.direct.expect
index 7b9c2c6..35547b1 100644
--- a/pkg/front_end/testcases/runtime_checks/contravariant_getter_return_null_aware.dart.direct.expect
+++ b/pkg/front_end/testcases/runtime_checks/contravariant_getter_return_null_aware.dart.direct.expect
@@ -2,8 +2,8 @@
import self as self;
import "dart:core" as core;
-typedef F<T extends core::Object> = (T) → void;
-class C<T extends core::Object> extends core::Object {
+typedef F<T extends core::Object = dynamic> = (T) → void;
+class C<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/runtime_checks/contravariant_getter_return_null_aware.dart.direct.transformed.expect b/pkg/front_end/testcases/runtime_checks/contravariant_getter_return_null_aware.dart.direct.transformed.expect
index 7b9c2c6..35547b1 100644
--- a/pkg/front_end/testcases/runtime_checks/contravariant_getter_return_null_aware.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/runtime_checks/contravariant_getter_return_null_aware.dart.direct.transformed.expect
@@ -2,8 +2,8 @@
import self as self;
import "dart:core" as core;
-typedef F<T extends core::Object> = (T) → void;
-class C<T extends core::Object> extends core::Object {
+typedef F<T extends core::Object = dynamic> = (T) → void;
+class C<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/runtime_checks/contravariant_getter_return_null_aware.dart.outline.expect b/pkg/front_end/testcases/runtime_checks/contravariant_getter_return_null_aware.dart.outline.expect
index 5f2d058..1043616 100644
--- a/pkg/front_end/testcases/runtime_checks/contravariant_getter_return_null_aware.dart.outline.expect
+++ b/pkg/front_end/testcases/runtime_checks/contravariant_getter_return_null_aware.dart.outline.expect
@@ -2,8 +2,8 @@
import self as self;
import "dart:core" as core;
-typedef F<T extends core::Object> = (T) → void;
-class C<T extends core::Object> extends core::Object {
+typedef F<T extends core::Object = dynamic> = (T) → void;
+class C<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
;
get f1() → (self::C::T) → void
diff --git a/pkg/front_end/testcases/runtime_checks/contravariant_getter_return_null_aware.dart.strong.expect b/pkg/front_end/testcases/runtime_checks/contravariant_getter_return_null_aware.dart.strong.expect
index 764aea8..6f4b3ea 100644
--- a/pkg/front_end/testcases/runtime_checks/contravariant_getter_return_null_aware.dart.strong.expect
+++ b/pkg/front_end/testcases/runtime_checks/contravariant_getter_return_null_aware.dart.strong.expect
@@ -2,8 +2,8 @@
import self as self;
import "dart:core" as core;
-typedef F<T extends core::Object> = (T) → void;
-class C<T extends core::Object> extends core::Object {
+typedef F<T extends core::Object = dynamic> = (T) → void;
+class C<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/runtime_checks/contravariant_getter_return_null_aware.dart.strong.transformed.expect b/pkg/front_end/testcases/runtime_checks/contravariant_getter_return_null_aware.dart.strong.transformed.expect
index 764aea8..6f4b3ea 100644
--- a/pkg/front_end/testcases/runtime_checks/contravariant_getter_return_null_aware.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/runtime_checks/contravariant_getter_return_null_aware.dart.strong.transformed.expect
@@ -2,8 +2,8 @@
import self as self;
import "dart:core" as core;
-typedef F<T extends core::Object> = (T) → void;
-class C<T extends core::Object> extends core::Object {
+typedef F<T extends core::Object = dynamic> = (T) → void;
+class C<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/runtime_checks/covariant_generic_method_type_parameter.dart.direct.expect b/pkg/front_end/testcases/runtime_checks/covariant_generic_method_type_parameter.dart.direct.expect
index b0a70d9..4f1bbc3 100644
--- a/pkg/front_end/testcases/runtime_checks/covariant_generic_method_type_parameter.dart.direct.expect
+++ b/pkg/front_end/testcases/runtime_checks/covariant_generic_method_type_parameter.dart.direct.expect
@@ -2,12 +2,12 @@
import self as self;
import "dart:core" as core;
-class C<T extends core::Object> extends core::Object {
+class C<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
- method f<U extends self::C::T>(self::C::f::U x) → void {}
- method g1<U extends self::C::T>() → void {
+ method f<U extends self::C::T = dynamic>(self::C::f::U x) → void {}
+ method g1<U extends self::C::T = dynamic>() → void {
this.{self::C::f}<self::C::g1::U>(1.5);
}
}
diff --git a/pkg/front_end/testcases/runtime_checks/covariant_generic_method_type_parameter.dart.direct.transformed.expect b/pkg/front_end/testcases/runtime_checks/covariant_generic_method_type_parameter.dart.direct.transformed.expect
index b0a70d9..4f1bbc3 100644
--- a/pkg/front_end/testcases/runtime_checks/covariant_generic_method_type_parameter.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/runtime_checks/covariant_generic_method_type_parameter.dart.direct.transformed.expect
@@ -2,12 +2,12 @@
import self as self;
import "dart:core" as core;
-class C<T extends core::Object> extends core::Object {
+class C<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
- method f<U extends self::C::T>(self::C::f::U x) → void {}
- method g1<U extends self::C::T>() → void {
+ method f<U extends self::C::T = dynamic>(self::C::f::U x) → void {}
+ method g1<U extends self::C::T = dynamic>() → void {
this.{self::C::f}<self::C::g1::U>(1.5);
}
}
diff --git a/pkg/front_end/testcases/runtime_checks/covariant_generic_method_type_parameter.dart.outline.expect b/pkg/front_end/testcases/runtime_checks/covariant_generic_method_type_parameter.dart.outline.expect
index eaad1c0..ec15d19 100644
--- a/pkg/front_end/testcases/runtime_checks/covariant_generic_method_type_parameter.dart.outline.expect
+++ b/pkg/front_end/testcases/runtime_checks/covariant_generic_method_type_parameter.dart.outline.expect
@@ -2,12 +2,12 @@
import self as self;
import "dart:core" as core;
-class C<T extends core::Object> extends core::Object {
+class C<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
;
- method f<U extends self::C::T>(self::C::f::U x) → void
+ method f<U extends self::C::T = dynamic>(self::C::f::U x) → void
;
- method g1<U extends self::C::T>() → void
+ method g1<U extends self::C::T = dynamic>() → void
;
}
static method g2(self::C<core::Object> c) → void
diff --git a/pkg/front_end/testcases/runtime_checks/covariant_generic_method_type_parameter.dart.strong.expect b/pkg/front_end/testcases/runtime_checks/covariant_generic_method_type_parameter.dart.strong.expect
index 73a7f87..26fb1d3 100644
--- a/pkg/front_end/testcases/runtime_checks/covariant_generic_method_type_parameter.dart.strong.expect
+++ b/pkg/front_end/testcases/runtime_checks/covariant_generic_method_type_parameter.dart.strong.expect
@@ -2,12 +2,12 @@
import self as self;
import "dart:core" as core;
-class C<T extends core::Object> extends core::Object {
+class C<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
- method f<generic-covariant-impl generic-covariant-interface U extends self::C::T>(self::C::f::U x) → void {}
- method g1<generic-covariant-impl generic-covariant-interface U extends self::C::T>() → void {
+ method f<generic-covariant-impl generic-covariant-interface U extends self::C::T = dynamic>(self::C::f::U x) → void {}
+ method g1<generic-covariant-impl generic-covariant-interface U extends self::C::T = dynamic>() → void {
this.{self::C::f}<self::C::g1::U>(let final dynamic #t1 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/runtime_checks/covariant_generic_method_type_parameter.dart:11:15: Error: A value of type 'dart.core::double' can't be assigned to a variable of type 'test::C::g1::U'.
Try changing the type of the left hand side, or casting the right hand side to 'test::C::g1::U'.
this.f<U>(1.5);
diff --git a/pkg/front_end/testcases/runtime_checks/covariant_generic_method_type_parameter.dart.strong.transformed.expect b/pkg/front_end/testcases/runtime_checks/covariant_generic_method_type_parameter.dart.strong.transformed.expect
index 25a05fa..d43df56 100644
--- a/pkg/front_end/testcases/runtime_checks/covariant_generic_method_type_parameter.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/runtime_checks/covariant_generic_method_type_parameter.dart.strong.transformed.expect
@@ -2,12 +2,12 @@
import self as self;
import "dart:core" as core;
-class C<T extends core::Object> extends core::Object {
+class C<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
- method f<generic-covariant-impl generic-covariant-interface U extends self::C::T>(self::C::f::U x) → void {}
- method g1<generic-covariant-impl generic-covariant-interface U extends self::C::T>() → void {
+ method f<generic-covariant-impl generic-covariant-interface U extends self::C::T = dynamic>(self::C::f::U x) → void {}
+ method g1<generic-covariant-impl generic-covariant-interface U extends self::C::T = dynamic>() → void {
this.{self::C::f}<self::C::g1::U>(let final dynamic #t1 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/runtime_checks/covariant_generic_method_type_parameter.dart:11:15: Error: A value of type 'dart.core::double' can't be assigned to a variable of type 'test::C::g1::U'.
Try changing the type of the left hand side, or casting the right hand side to 'test::C::g1::U'.
this.f<U>(1.5);
diff --git a/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter.dart.direct.expect b/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter.dart.direct.expect
index 421712c..cf3c2b8 100644
--- a/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter.dart.direct.expect
+++ b/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter.dart.direct.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class C<T extends core::Object> extends core::Object {
+class C<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter.dart.direct.transformed.expect b/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter.dart.direct.transformed.expect
index 421712c..cf3c2b8 100644
--- a/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter.dart.direct.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class C<T extends core::Object> extends core::Object {
+class C<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter.dart.outline.expect b/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter.dart.outline.expect
index 6ebe36d..67723c56 100644
--- a/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter.dart.outline.expect
+++ b/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter.dart.outline.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class C<T extends core::Object> extends core::Object {
+class C<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
;
method f(self::C::T x) → void
diff --git a/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter.dart.strong.expect b/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter.dart.strong.expect
index 78f2e36..5552a2d 100644
--- a/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter.dart.strong.expect
+++ b/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter.dart.strong.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class C<T extends core::Object> extends core::Object {
+class C<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter.dart.strong.transformed.expect b/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter.dart.strong.transformed.expect
index 78f2e36..5552a2d 100644
--- a/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter.dart.strong.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class C<T extends core::Object> extends core::Object {
+class C<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter_complex.dart.direct.expect b/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter_complex.dart.direct.expect
index 51f994d..3487157 100644
--- a/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter_complex.dart.direct.expect
+++ b/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter_complex.dart.direct.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class C<T extends core::Object> extends core::Object {
+class C<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter_complex.dart.direct.transformed.expect b/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter_complex.dart.direct.transformed.expect
index 51f994d..3487157 100644
--- a/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter_complex.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter_complex.dart.direct.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class C<T extends core::Object> extends core::Object {
+class C<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter_complex.dart.outline.expect b/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter_complex.dart.outline.expect
index d3057ec..3968bbe 100644
--- a/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter_complex.dart.outline.expect
+++ b/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter_complex.dart.outline.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class C<T extends core::Object> extends core::Object {
+class C<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
;
method f1(core::List<self::C::T> x) → void
diff --git a/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter_complex.dart.strong.expect b/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter_complex.dart.strong.expect
index e945744..79250d9 100644
--- a/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter_complex.dart.strong.expect
+++ b/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter_complex.dart.strong.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class C<T extends core::Object> extends core::Object {
+class C<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter_complex.dart.strong.transformed.expect b/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter_complex.dart.strong.transformed.expect
index e945744..79250d9 100644
--- a/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter_complex.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter_complex.dart.strong.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class C<T extends core::Object> extends core::Object {
+class C<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter_in_interface.dart.direct.expect b/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter_in_interface.dart.direct.expect
index 49169f4..7dfdaaf 100644
--- a/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter_in_interface.dart.direct.expect
+++ b/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter_in_interface.dart.direct.expect
@@ -2,21 +2,21 @@
import self as self;
import "dart:core" as core;
-abstract class I<T extends core::Object> extends core::Object {
+abstract class I<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
abstract method f1(self::I::T x) → void;
abstract method f2(self::I::T x) → void;
}
-class C<U extends core::Object> extends core::Object implements self::I<core::int> {
+class C<U extends core::Object = dynamic> extends core::Object implements self::I<core::int> {
synthetic constructor •() → void
: super core::Object::•()
;
method f1(core::int x) → void {}
method f2(core::int x, [self::C::U y = null]) → void {}
}
-class D<U extends core::Object> extends self::C<self::D::U> {
+class D<U extends core::Object = dynamic> extends self::C<self::D::U> {
synthetic constructor •() → void
: super self::C::•()
;
diff --git a/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter_in_interface.dart.direct.transformed.expect b/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter_in_interface.dart.direct.transformed.expect
index 49169f4..7dfdaaf 100644
--- a/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter_in_interface.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter_in_interface.dart.direct.transformed.expect
@@ -2,21 +2,21 @@
import self as self;
import "dart:core" as core;
-abstract class I<T extends core::Object> extends core::Object {
+abstract class I<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
abstract method f1(self::I::T x) → void;
abstract method f2(self::I::T x) → void;
}
-class C<U extends core::Object> extends core::Object implements self::I<core::int> {
+class C<U extends core::Object = dynamic> extends core::Object implements self::I<core::int> {
synthetic constructor •() → void
: super core::Object::•()
;
method f1(core::int x) → void {}
method f2(core::int x, [self::C::U y = null]) → void {}
}
-class D<U extends core::Object> extends self::C<self::D::U> {
+class D<U extends core::Object = dynamic> extends self::C<self::D::U> {
synthetic constructor •() → void
: super self::C::•()
;
diff --git a/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter_in_interface.dart.outline.expect b/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter_in_interface.dart.outline.expect
index 6a0cec0..426bf40 100644
--- a/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter_in_interface.dart.outline.expect
+++ b/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter_in_interface.dart.outline.expect
@@ -2,13 +2,13 @@
import self as self;
import "dart:core" as core;
-abstract class I<T extends core::Object> extends core::Object {
+abstract class I<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
;
abstract method f1(self::I::T x) → void;
abstract method f2(self::I::T x) → void;
}
-class C<U extends core::Object> extends core::Object implements self::I<core::int> {
+class C<U extends core::Object = dynamic> extends core::Object implements self::I<core::int> {
synthetic constructor •() → void
;
method f1(core::int x) → void
@@ -16,7 +16,7 @@
method f2(core::int x, [self::C::U y]) → void
;
}
-class D<U extends core::Object> extends self::C<self::D::U> {
+class D<U extends core::Object = dynamic> extends self::C<self::D::U> {
synthetic constructor •() → void
;
method f1(core::int x) → void
diff --git a/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter_in_interface.dart.strong.expect b/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter_in_interface.dart.strong.expect
index b941549..97d183c 100644
--- a/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter_in_interface.dart.strong.expect
+++ b/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter_in_interface.dart.strong.expect
@@ -2,21 +2,21 @@
import self as self;
import "dart:core" as core;
-abstract class I<T extends core::Object> extends core::Object {
+abstract class I<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
abstract method f1(generic-covariant-impl generic-covariant-interface self::I::T x) → void;
abstract method f2(generic-covariant-impl generic-covariant-interface self::I::T x) → void;
}
-class C<U extends core::Object> extends core::Object implements self::I<core::int> {
+class C<U extends core::Object = dynamic> extends core::Object implements self::I<core::int> {
synthetic constructor •() → void
: super core::Object::•()
;
method f1(generic-covariant-impl core::int x) → void {}
method f2(generic-covariant-impl core::int x, [generic-covariant-impl generic-covariant-interface self::C::U y = null]) → void {}
}
-class D<U extends core::Object> extends self::C<self::D::U> {
+class D<U extends core::Object = dynamic> extends self::C<self::D::U> {
synthetic constructor •() → void
: super self::C::•()
;
diff --git a/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter_in_interface.dart.strong.transformed.expect b/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter_in_interface.dart.strong.transformed.expect
index b941549..97d183c 100644
--- a/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter_in_interface.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter_in_interface.dart.strong.transformed.expect
@@ -2,21 +2,21 @@
import self as self;
import "dart:core" as core;
-abstract class I<T extends core::Object> extends core::Object {
+abstract class I<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
abstract method f1(generic-covariant-impl generic-covariant-interface self::I::T x) → void;
abstract method f2(generic-covariant-impl generic-covariant-interface self::I::T x) → void;
}
-class C<U extends core::Object> extends core::Object implements self::I<core::int> {
+class C<U extends core::Object = dynamic> extends core::Object implements self::I<core::int> {
synthetic constructor •() → void
: super core::Object::•()
;
method f1(generic-covariant-impl core::int x) → void {}
method f2(generic-covariant-impl core::int x, [generic-covariant-impl generic-covariant-interface self::C::U y = null]) → void {}
}
-class D<U extends core::Object> extends self::C<self::D::U> {
+class D<U extends core::Object = dynamic> extends self::C<self::D::U> {
synthetic constructor •() → void
: super self::C::•()
;
diff --git a/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter_in_interface_mixin.dart.direct.expect b/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter_in_interface_mixin.dart.direct.expect
index 8d93c66..6577fa6 100644
--- a/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter_in_interface_mixin.dart.direct.expect
+++ b/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter_in_interface_mixin.dart.direct.expect
@@ -8,7 +8,7 @@
;
method f(core::int x) → void {}
}
-abstract class I<T extends core::Object> extends core::Object {
+abstract class I<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter_in_interface_mixin.dart.direct.transformed.expect b/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter_in_interface_mixin.dart.direct.transformed.expect
index 0292b5f..f4b7d39 100644
--- a/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter_in_interface_mixin.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter_in_interface_mixin.dart.direct.transformed.expect
@@ -8,7 +8,7 @@
;
method f(core::int x) → void {}
}
-abstract class I<T extends core::Object> extends core::Object {
+abstract class I<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter_in_interface_mixin.dart.outline.expect b/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter_in_interface_mixin.dart.outline.expect
index a9b1002..0a93e1b 100644
--- a/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter_in_interface_mixin.dart.outline.expect
+++ b/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter_in_interface_mixin.dart.outline.expect
@@ -8,7 +8,7 @@
method f(core::int x) → void
;
}
-abstract class I<T extends core::Object> extends core::Object {
+abstract class I<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
;
abstract method f(self::I::T x) → void;
diff --git a/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter_in_interface_mixin.dart.strong.expect b/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter_in_interface_mixin.dart.strong.expect
index 10178cb..d5ddea7 100644
--- a/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter_in_interface_mixin.dart.strong.expect
+++ b/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter_in_interface_mixin.dart.strong.expect
@@ -8,7 +8,7 @@
;
method f(core::int x) → void {}
}
-abstract class I<T extends core::Object> extends core::Object {
+abstract class I<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter_in_interface_mixin.dart.strong.transformed.expect b/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter_in_interface_mixin.dart.strong.transformed.expect
index 2a932d4..1feabc7 100644
--- a/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter_in_interface_mixin.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter_in_interface_mixin.dart.strong.transformed.expect
@@ -8,7 +8,7 @@
;
method f(core::int x) → void {}
}
-abstract class I<T extends core::Object> extends core::Object {
+abstract class I<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter_in_interface_super.dart.direct.expect b/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter_in_interface_super.dart.direct.expect
index e6d6b9b..5c01902 100644
--- a/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter_in_interface_super.dart.direct.expect
+++ b/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter_in_interface_super.dart.direct.expect
@@ -8,7 +8,7 @@
;
method f(core::int x) → void {}
}
-abstract class I<T extends core::Object> extends core::Object {
+abstract class I<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter_in_interface_super.dart.direct.transformed.expect b/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter_in_interface_super.dart.direct.transformed.expect
index e6d6b9b..5c01902 100644
--- a/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter_in_interface_super.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter_in_interface_super.dart.direct.transformed.expect
@@ -8,7 +8,7 @@
;
method f(core::int x) → void {}
}
-abstract class I<T extends core::Object> extends core::Object {
+abstract class I<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter_in_interface_super.dart.outline.expect b/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter_in_interface_super.dart.outline.expect
index 57bd231..5990c58 100644
--- a/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter_in_interface_super.dart.outline.expect
+++ b/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter_in_interface_super.dart.outline.expect
@@ -8,7 +8,7 @@
method f(core::int x) → void
;
}
-abstract class I<T extends core::Object> extends core::Object {
+abstract class I<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
;
abstract method f(self::I::T x) → void;
diff --git a/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter_in_interface_super.dart.strong.expect b/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter_in_interface_super.dart.strong.expect
index dfe595c..fb37f0a 100644
--- a/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter_in_interface_super.dart.strong.expect
+++ b/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter_in_interface_super.dart.strong.expect
@@ -8,7 +8,7 @@
;
method f(core::int x) → void {}
}
-abstract class I<T extends core::Object> extends core::Object {
+abstract class I<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter_in_interface_super.dart.strong.transformed.expect b/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter_in_interface_super.dart.strong.transformed.expect
index dfe595c..fb37f0a 100644
--- a/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter_in_interface_super.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter_in_interface_super.dart.strong.transformed.expect
@@ -8,7 +8,7 @@
;
method f(core::int x) → void {}
}
-abstract class I<T extends core::Object> extends core::Object {
+abstract class I<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter_in_interface_super_mixin.dart.direct.expect b/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter_in_interface_super_mixin.dart.direct.expect
index 2a83d23..eb9914c 100644
--- a/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter_in_interface_super_mixin.dart.direct.expect
+++ b/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter_in_interface_super_mixin.dart.direct.expect
@@ -8,7 +8,7 @@
;
method f(core::int x) → void {}
}
-abstract class I<T extends core::Object> extends core::Object {
+abstract class I<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter_in_interface_super_mixin.dart.direct.transformed.expect b/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter_in_interface_super_mixin.dart.direct.transformed.expect
index 11b38c7..0cc0cd00 100644
--- a/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter_in_interface_super_mixin.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter_in_interface_super_mixin.dart.direct.transformed.expect
@@ -8,7 +8,7 @@
;
method f(core::int x) → void {}
}
-abstract class I<T extends core::Object> extends core::Object {
+abstract class I<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter_in_interface_super_mixin.dart.outline.expect b/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter_in_interface_super_mixin.dart.outline.expect
index 94b5113..4815e5f 100644
--- a/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter_in_interface_super_mixin.dart.outline.expect
+++ b/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter_in_interface_super_mixin.dart.outline.expect
@@ -8,7 +8,7 @@
method f(core::int x) → void
;
}
-abstract class I<T extends core::Object> extends core::Object {
+abstract class I<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
;
abstract method f(self::I::T x) → void;
diff --git a/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter_in_interface_super_mixin.dart.strong.expect b/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter_in_interface_super_mixin.dart.strong.expect
index 2f06fdd..710336f 100644
--- a/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter_in_interface_super_mixin.dart.strong.expect
+++ b/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter_in_interface_super_mixin.dart.strong.expect
@@ -8,7 +8,7 @@
;
method f(core::int x) → void {}
}
-abstract class I<T extends core::Object> extends core::Object {
+abstract class I<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter_in_interface_super_mixin.dart.strong.transformed.expect b/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter_in_interface_super_mixin.dart.strong.transformed.expect
index e10a6c4..7d07c7b 100644
--- a/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter_in_interface_super_mixin.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter_in_interface_super_mixin.dart.strong.transformed.expect
@@ -8,7 +8,7 @@
;
method f(core::int x) → void {}
}
-abstract class I<T extends core::Object> extends core::Object {
+abstract class I<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter_tear_off.dart.direct.expect b/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter_tear_off.dart.direct.expect
index f7ef8a8..625be9b 100644
--- a/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter_tear_off.dart.direct.expect
+++ b/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter_tear_off.dart.direct.expect
@@ -2,9 +2,9 @@
import self as self;
import "dart:core" as core;
-typedef F<T extends core::Object> = (T) → void;
-typedef G<T extends core::Object, U extends core::Object> = (T) → U;
-class C<T extends core::Object> extends core::Object {
+typedef F<T extends core::Object = dynamic> = (T) → void;
+typedef G<T extends core::Object = dynamic, U extends core::Object = dynamic> = (T) → U;
+class C<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter_tear_off.dart.direct.transformed.expect b/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter_tear_off.dart.direct.transformed.expect
index f7ef8a8..625be9b 100644
--- a/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter_tear_off.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter_tear_off.dart.direct.transformed.expect
@@ -2,9 +2,9 @@
import self as self;
import "dart:core" as core;
-typedef F<T extends core::Object> = (T) → void;
-typedef G<T extends core::Object, U extends core::Object> = (T) → U;
-class C<T extends core::Object> extends core::Object {
+typedef F<T extends core::Object = dynamic> = (T) → void;
+typedef G<T extends core::Object = dynamic, U extends core::Object = dynamic> = (T) → U;
+class C<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter_tear_off.dart.outline.expect b/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter_tear_off.dart.outline.expect
index 351f537..f1468ee 100644
--- a/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter_tear_off.dart.outline.expect
+++ b/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter_tear_off.dart.outline.expect
@@ -2,9 +2,9 @@
import self as self;
import "dart:core" as core;
-typedef F<T extends core::Object> = (T) → void;
-typedef G<T extends core::Object, U extends core::Object> = (T) → U;
-class C<T extends core::Object> extends core::Object {
+typedef F<T extends core::Object = dynamic> = (T) → void;
+typedef G<T extends core::Object = dynamic, U extends core::Object = dynamic> = (T) → U;
+class C<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
;
method f1(self::C::T x) → void
diff --git a/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter_tear_off.dart.strong.expect b/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter_tear_off.dart.strong.expect
index 89e8e41..b36578d 100644
--- a/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter_tear_off.dart.strong.expect
+++ b/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter_tear_off.dart.strong.expect
@@ -2,9 +2,9 @@
import self as self;
import "dart:core" as core;
-typedef F<T extends core::Object> = (T) → void;
-typedef G<T extends core::Object, U extends core::Object> = (T) → U;
-class C<T extends core::Object> extends core::Object {
+typedef F<T extends core::Object = dynamic> = (T) → void;
+typedef G<T extends core::Object = dynamic, U extends core::Object = dynamic> = (T) → U;
+class C<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter_tear_off.dart.strong.transformed.expect b/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter_tear_off.dart.strong.transformed.expect
index 89e8e41..b36578d 100644
--- a/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter_tear_off.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter_tear_off.dart.strong.transformed.expect
@@ -2,9 +2,9 @@
import self as self;
import "dart:core" as core;
-typedef F<T extends core::Object> = (T) → void;
-typedef G<T extends core::Object, U extends core::Object> = (T) → U;
-class C<T extends core::Object> extends core::Object {
+typedef F<T extends core::Object = dynamic> = (T) → void;
+typedef G<T extends core::Object = dynamic, U extends core::Object = dynamic> = (T) → U;
+class C<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/runtime_checks/covariant_keyword.dart.direct.expect b/pkg/front_end/testcases/runtime_checks/covariant_keyword.dart.direct.expect
index 773f079..85f3c37 100644
--- a/pkg/front_end/testcases/runtime_checks/covariant_keyword.dart.direct.expect
+++ b/pkg/front_end/testcases/runtime_checks/covariant_keyword.dart.direct.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-typedef F<T extends core::Object> = (T) → dynamic;
+typedef F<T extends core::Object = dynamic> = (T) → dynamic;
class C extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
diff --git a/pkg/front_end/testcases/runtime_checks/covariant_keyword.dart.direct.transformed.expect b/pkg/front_end/testcases/runtime_checks/covariant_keyword.dart.direct.transformed.expect
index 773f079..85f3c37 100644
--- a/pkg/front_end/testcases/runtime_checks/covariant_keyword.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/runtime_checks/covariant_keyword.dart.direct.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-typedef F<T extends core::Object> = (T) → dynamic;
+typedef F<T extends core::Object = dynamic> = (T) → dynamic;
class C extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
diff --git a/pkg/front_end/testcases/runtime_checks/covariant_keyword.dart.outline.expect b/pkg/front_end/testcases/runtime_checks/covariant_keyword.dart.outline.expect
index c28351a..2b11d85 100644
--- a/pkg/front_end/testcases/runtime_checks/covariant_keyword.dart.outline.expect
+++ b/pkg/front_end/testcases/runtime_checks/covariant_keyword.dart.outline.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-typedef F<T extends core::Object> = (T) → dynamic;
+typedef F<T extends core::Object = dynamic> = (T) → dynamic;
class C extends core::Object {
synthetic constructor •() → void
;
diff --git a/pkg/front_end/testcases/runtime_checks/covariant_keyword.dart.strong.expect b/pkg/front_end/testcases/runtime_checks/covariant_keyword.dart.strong.expect
index 03b5829..ba57944 100644
--- a/pkg/front_end/testcases/runtime_checks/covariant_keyword.dart.strong.expect
+++ b/pkg/front_end/testcases/runtime_checks/covariant_keyword.dart.strong.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-typedef F<T extends core::Object> = (T) → dynamic;
+typedef F<T extends core::Object = dynamic> = (T) → dynamic;
class C extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
diff --git a/pkg/front_end/testcases/runtime_checks/covariant_keyword.dart.strong.transformed.expect b/pkg/front_end/testcases/runtime_checks/covariant_keyword.dart.strong.transformed.expect
index 03b5829..ba57944 100644
--- a/pkg/front_end/testcases/runtime_checks/covariant_keyword.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/runtime_checks/covariant_keyword.dart.strong.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-typedef F<T extends core::Object> = (T) → dynamic;
+typedef F<T extends core::Object = dynamic> = (T) → dynamic;
class C extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
diff --git a/pkg/front_end/testcases/runtime_checks/covariant_setter.dart.direct.expect b/pkg/front_end/testcases/runtime_checks/covariant_setter.dart.direct.expect
index 3552fdc..af80278 100644
--- a/pkg/front_end/testcases/runtime_checks/covariant_setter.dart.direct.expect
+++ b/pkg/front_end/testcases/runtime_checks/covariant_setter.dart.direct.expect
@@ -2,8 +2,8 @@
import self as self;
import "dart:core" as core;
-typedef F<T extends core::Object> = (T) → void;
-class C<T extends core::Object> extends core::Object {
+typedef F<T extends core::Object = dynamic> = (T) → void;
+class C<T extends core::Object = dynamic> extends core::Object {
field self::C::T x = null;
synthetic constructor •() → void
: super core::Object::•()
diff --git a/pkg/front_end/testcases/runtime_checks/covariant_setter.dart.direct.transformed.expect b/pkg/front_end/testcases/runtime_checks/covariant_setter.dart.direct.transformed.expect
index 3552fdc..af80278 100644
--- a/pkg/front_end/testcases/runtime_checks/covariant_setter.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/runtime_checks/covariant_setter.dart.direct.transformed.expect
@@ -2,8 +2,8 @@
import self as self;
import "dart:core" as core;
-typedef F<T extends core::Object> = (T) → void;
-class C<T extends core::Object> extends core::Object {
+typedef F<T extends core::Object = dynamic> = (T) → void;
+class C<T extends core::Object = dynamic> extends core::Object {
field self::C::T x = null;
synthetic constructor •() → void
: super core::Object::•()
diff --git a/pkg/front_end/testcases/runtime_checks/covariant_setter.dart.outline.expect b/pkg/front_end/testcases/runtime_checks/covariant_setter.dart.outline.expect
index 0ab028a..70e1cb2 100644
--- a/pkg/front_end/testcases/runtime_checks/covariant_setter.dart.outline.expect
+++ b/pkg/front_end/testcases/runtime_checks/covariant_setter.dart.outline.expect
@@ -2,8 +2,8 @@
import self as self;
import "dart:core" as core;
-typedef F<T extends core::Object> = (T) → void;
-class C<T extends core::Object> extends core::Object {
+typedef F<T extends core::Object = dynamic> = (T) → void;
+class C<T extends core::Object = dynamic> extends core::Object {
field self::C::T x;
synthetic constructor •() → void
;
diff --git a/pkg/front_end/testcases/runtime_checks/covariant_setter.dart.strong.expect b/pkg/front_end/testcases/runtime_checks/covariant_setter.dart.strong.expect
index 6dcd2b4..872b355 100644
--- a/pkg/front_end/testcases/runtime_checks/covariant_setter.dart.strong.expect
+++ b/pkg/front_end/testcases/runtime_checks/covariant_setter.dart.strong.expect
@@ -2,8 +2,8 @@
import self as self;
import "dart:core" as core;
-typedef F<T extends core::Object> = (T) → void;
-class C<T extends core::Object> extends core::Object {
+typedef F<T extends core::Object = dynamic> = (T) → void;
+class C<T extends core::Object = dynamic> extends core::Object {
generic-covariant-impl generic-covariant-interface field self::C::T x = null;
synthetic constructor •() → void
: super core::Object::•()
diff --git a/pkg/front_end/testcases/runtime_checks/covariant_setter.dart.strong.transformed.expect b/pkg/front_end/testcases/runtime_checks/covariant_setter.dart.strong.transformed.expect
index 6dcd2b4..872b355 100644
--- a/pkg/front_end/testcases/runtime_checks/covariant_setter.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/runtime_checks/covariant_setter.dart.strong.transformed.expect
@@ -2,8 +2,8 @@
import self as self;
import "dart:core" as core;
-typedef F<T extends core::Object> = (T) → void;
-class C<T extends core::Object> extends core::Object {
+typedef F<T extends core::Object = dynamic> = (T) → void;
+class C<T extends core::Object = dynamic> extends core::Object {
generic-covariant-impl generic-covariant-interface field self::C::T x = null;
synthetic constructor •() → void
: super core::Object::•()
diff --git a/pkg/front_end/testcases/runtime_checks/dynamic_invocation.dart.direct.expect b/pkg/front_end/testcases/runtime_checks/dynamic_invocation.dart.direct.expect
index e710937..4ac52bc 100644
--- a/pkg/front_end/testcases/runtime_checks/dynamic_invocation.dart.direct.expect
+++ b/pkg/front_end/testcases/runtime_checks/dynamic_invocation.dart.direct.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class C<T extends core::Object> extends core::Object {
+class C<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/runtime_checks/dynamic_invocation.dart.direct.transformed.expect b/pkg/front_end/testcases/runtime_checks/dynamic_invocation.dart.direct.transformed.expect
index e710937..4ac52bc 100644
--- a/pkg/front_end/testcases/runtime_checks/dynamic_invocation.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/runtime_checks/dynamic_invocation.dart.direct.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class C<T extends core::Object> extends core::Object {
+class C<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/runtime_checks/dynamic_invocation.dart.outline.expect b/pkg/front_end/testcases/runtime_checks/dynamic_invocation.dart.outline.expect
index 29cb370..3ce3e00 100644
--- a/pkg/front_end/testcases/runtime_checks/dynamic_invocation.dart.outline.expect
+++ b/pkg/front_end/testcases/runtime_checks/dynamic_invocation.dart.outline.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class C<T extends core::Object> extends core::Object {
+class C<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
;
method f1(self::C::T x) → void
diff --git a/pkg/front_end/testcases/runtime_checks/dynamic_invocation.dart.strong.expect b/pkg/front_end/testcases/runtime_checks/dynamic_invocation.dart.strong.expect
index 4655e62..24e6b93 100644
--- a/pkg/front_end/testcases/runtime_checks/dynamic_invocation.dart.strong.expect
+++ b/pkg/front_end/testcases/runtime_checks/dynamic_invocation.dart.strong.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class C<T extends core::Object> extends core::Object {
+class C<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/runtime_checks/dynamic_invocation.dart.strong.transformed.expect b/pkg/front_end/testcases/runtime_checks/dynamic_invocation.dart.strong.transformed.expect
index 4655e62..24e6b93 100644
--- a/pkg/front_end/testcases/runtime_checks/dynamic_invocation.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/runtime_checks/dynamic_invocation.dart.strong.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class C<T extends core::Object> extends core::Object {
+class C<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/runtime_checks/dynamic_invocation_generic.dart.direct.expect b/pkg/front_end/testcases/runtime_checks/dynamic_invocation_generic.dart.direct.expect
index 1bd3bd3..7595443 100644
--- a/pkg/front_end/testcases/runtime_checks/dynamic_invocation_generic.dart.direct.expect
+++ b/pkg/front_end/testcases/runtime_checks/dynamic_invocation_generic.dart.direct.expect
@@ -2,11 +2,11 @@
import self as self;
import "dart:core" as core;
-class C<T extends core::Object> extends core::Object {
+class C<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
- method f<U extends self::C::T>(self::C::f::U x) → void {}
+ method f<U extends self::C::T = dynamic>(self::C::f::U x) → void {}
}
static method g1(dynamic d) → void {
d.f<core::num>(1.5);
diff --git a/pkg/front_end/testcases/runtime_checks/dynamic_invocation_generic.dart.direct.transformed.expect b/pkg/front_end/testcases/runtime_checks/dynamic_invocation_generic.dart.direct.transformed.expect
index 1bd3bd3..7595443 100644
--- a/pkg/front_end/testcases/runtime_checks/dynamic_invocation_generic.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/runtime_checks/dynamic_invocation_generic.dart.direct.transformed.expect
@@ -2,11 +2,11 @@
import self as self;
import "dart:core" as core;
-class C<T extends core::Object> extends core::Object {
+class C<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
- method f<U extends self::C::T>(self::C::f::U x) → void {}
+ method f<U extends self::C::T = dynamic>(self::C::f::U x) → void {}
}
static method g1(dynamic d) → void {
d.f<core::num>(1.5);
diff --git a/pkg/front_end/testcases/runtime_checks/dynamic_invocation_generic.dart.outline.expect b/pkg/front_end/testcases/runtime_checks/dynamic_invocation_generic.dart.outline.expect
index 1beaf51..b72ecf1 100644
--- a/pkg/front_end/testcases/runtime_checks/dynamic_invocation_generic.dart.outline.expect
+++ b/pkg/front_end/testcases/runtime_checks/dynamic_invocation_generic.dart.outline.expect
@@ -2,10 +2,10 @@
import self as self;
import "dart:core" as core;
-class C<T extends core::Object> extends core::Object {
+class C<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
;
- method f<U extends self::C::T>(self::C::f::U x) → void
+ method f<U extends self::C::T = dynamic>(self::C::f::U x) → void
;
}
static method g1(dynamic d) → void
diff --git a/pkg/front_end/testcases/runtime_checks/dynamic_invocation_generic.dart.strong.expect b/pkg/front_end/testcases/runtime_checks/dynamic_invocation_generic.dart.strong.expect
index 3ebc69c..015a396 100644
--- a/pkg/front_end/testcases/runtime_checks/dynamic_invocation_generic.dart.strong.expect
+++ b/pkg/front_end/testcases/runtime_checks/dynamic_invocation_generic.dart.strong.expect
@@ -2,11 +2,11 @@
import self as self;
import "dart:core" as core;
-class C<T extends core::Object> extends core::Object {
+class C<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
- method f<generic-covariant-impl generic-covariant-interface U extends self::C::T>(self::C::f::U x) → void {}
+ method f<generic-covariant-impl generic-covariant-interface U extends self::C::T = dynamic>(self::C::f::U x) → void {}
}
static method g1(dynamic d) → void {
d.f<core::num>(1.5);
diff --git a/pkg/front_end/testcases/runtime_checks/dynamic_invocation_generic.dart.strong.transformed.expect b/pkg/front_end/testcases/runtime_checks/dynamic_invocation_generic.dart.strong.transformed.expect
index 3ebc69c..015a396 100644
--- a/pkg/front_end/testcases/runtime_checks/dynamic_invocation_generic.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/runtime_checks/dynamic_invocation_generic.dart.strong.transformed.expect
@@ -2,11 +2,11 @@
import self as self;
import "dart:core" as core;
-class C<T extends core::Object> extends core::Object {
+class C<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
- method f<generic-covariant-impl generic-covariant-interface U extends self::C::T>(self::C::f::U x) → void {}
+ method f<generic-covariant-impl generic-covariant-interface U extends self::C::T = dynamic>(self::C::f::U x) → void {}
}
static method g1(dynamic d) → void {
d.f<core::num>(1.5);
diff --git a/pkg/front_end/testcases/runtime_checks/field_forwarding_stub_generic_covariant.dart.direct.expect b/pkg/front_end/testcases/runtime_checks/field_forwarding_stub_generic_covariant.dart.direct.expect
index bd9af0e..ed9baff 100644
--- a/pkg/front_end/testcases/runtime_checks/field_forwarding_stub_generic_covariant.dart.direct.expect
+++ b/pkg/front_end/testcases/runtime_checks/field_forwarding_stub_generic_covariant.dart.direct.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class B<T extends core::Object> extends core::Object {
+class B<T extends core::Object = dynamic> extends core::Object {
field self::B::T x = null;
synthetic constructor •() → void
: super core::Object::•()
diff --git a/pkg/front_end/testcases/runtime_checks/field_forwarding_stub_generic_covariant.dart.direct.transformed.expect b/pkg/front_end/testcases/runtime_checks/field_forwarding_stub_generic_covariant.dart.direct.transformed.expect
index bd9af0e..ed9baff 100644
--- a/pkg/front_end/testcases/runtime_checks/field_forwarding_stub_generic_covariant.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/runtime_checks/field_forwarding_stub_generic_covariant.dart.direct.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class B<T extends core::Object> extends core::Object {
+class B<T extends core::Object = dynamic> extends core::Object {
field self::B::T x = null;
synthetic constructor •() → void
: super core::Object::•()
diff --git a/pkg/front_end/testcases/runtime_checks/field_forwarding_stub_generic_covariant.dart.outline.expect b/pkg/front_end/testcases/runtime_checks/field_forwarding_stub_generic_covariant.dart.outline.expect
index 2ac3d36..b253175 100644
--- a/pkg/front_end/testcases/runtime_checks/field_forwarding_stub_generic_covariant.dart.outline.expect
+++ b/pkg/front_end/testcases/runtime_checks/field_forwarding_stub_generic_covariant.dart.outline.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class B<T extends core::Object> extends core::Object {
+class B<T extends core::Object = dynamic> extends core::Object {
field self::B::T x;
synthetic constructor •() → void
;
diff --git a/pkg/front_end/testcases/runtime_checks/field_forwarding_stub_generic_covariant.dart.strong.expect b/pkg/front_end/testcases/runtime_checks/field_forwarding_stub_generic_covariant.dart.strong.expect
index 0620b1b..ad33099 100644
--- a/pkg/front_end/testcases/runtime_checks/field_forwarding_stub_generic_covariant.dart.strong.expect
+++ b/pkg/front_end/testcases/runtime_checks/field_forwarding_stub_generic_covariant.dart.strong.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class B<T extends core::Object> extends core::Object {
+class B<T extends core::Object = dynamic> extends core::Object {
generic-covariant-impl generic-covariant-interface field self::B::T x = null;
synthetic constructor •() → void
: super core::Object::•()
diff --git a/pkg/front_end/testcases/runtime_checks/field_forwarding_stub_generic_covariant.dart.strong.transformed.expect b/pkg/front_end/testcases/runtime_checks/field_forwarding_stub_generic_covariant.dart.strong.transformed.expect
index 0620b1b..ad33099 100644
--- a/pkg/front_end/testcases/runtime_checks/field_forwarding_stub_generic_covariant.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/runtime_checks/field_forwarding_stub_generic_covariant.dart.strong.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class B<T extends core::Object> extends core::Object {
+class B<T extends core::Object = dynamic> extends core::Object {
generic-covariant-impl generic-covariant-interface field self::B::T x = null;
synthetic constructor •() → void
: super core::Object::•()
diff --git a/pkg/front_end/testcases/runtime_checks/forwarding_stub_with_default_values.dart.direct.expect b/pkg/front_end/testcases/runtime_checks/forwarding_stub_with_default_values.dart.direct.expect
index e6905e8..de3d63c 100644
--- a/pkg/front_end/testcases/runtime_checks/forwarding_stub_with_default_values.dart.direct.expect
+++ b/pkg/front_end/testcases/runtime_checks/forwarding_stub_with_default_values.dart.direct.expect
@@ -19,7 +19,7 @@
}
}
}
-abstract class I<T extends core::Object> extends core::Object {
+abstract class I<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/runtime_checks/forwarding_stub_with_default_values.dart.direct.transformed.expect b/pkg/front_end/testcases/runtime_checks/forwarding_stub_with_default_values.dart.direct.transformed.expect
index e6905e8..de3d63c 100644
--- a/pkg/front_end/testcases/runtime_checks/forwarding_stub_with_default_values.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/runtime_checks/forwarding_stub_with_default_values.dart.direct.transformed.expect
@@ -19,7 +19,7 @@
}
}
}
-abstract class I<T extends core::Object> extends core::Object {
+abstract class I<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/runtime_checks/forwarding_stub_with_default_values.dart.outline.expect b/pkg/front_end/testcases/runtime_checks/forwarding_stub_with_default_values.dart.outline.expect
index eb83109..9719eeb 100644
--- a/pkg/front_end/testcases/runtime_checks/forwarding_stub_with_default_values.dart.outline.expect
+++ b/pkg/front_end/testcases/runtime_checks/forwarding_stub_with_default_values.dart.outline.expect
@@ -13,7 +13,7 @@
method check(core::Object expectedValue) → void
;
}
-abstract class I<T extends core::Object> extends core::Object {
+abstract class I<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
;
abstract method f([self::I::T x]) → void;
diff --git a/pkg/front_end/testcases/runtime_checks/forwarding_stub_with_default_values.dart.strong.expect b/pkg/front_end/testcases/runtime_checks/forwarding_stub_with_default_values.dart.strong.expect
index 8db2e73..3cd551d 100644
--- a/pkg/front_end/testcases/runtime_checks/forwarding_stub_with_default_values.dart.strong.expect
+++ b/pkg/front_end/testcases/runtime_checks/forwarding_stub_with_default_values.dart.strong.expect
@@ -19,7 +19,7 @@
}
}
}
-abstract class I<T extends core::Object> extends core::Object {
+abstract class I<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/runtime_checks/forwarding_stub_with_default_values.dart.strong.transformed.expect b/pkg/front_end/testcases/runtime_checks/forwarding_stub_with_default_values.dart.strong.transformed.expect
index 8db2e73..3cd551d 100644
--- a/pkg/front_end/testcases/runtime_checks/forwarding_stub_with_default_values.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/runtime_checks/forwarding_stub_with_default_values.dart.strong.transformed.expect
@@ -19,7 +19,7 @@
}
}
}
-abstract class I<T extends core::Object> extends core::Object {
+abstract class I<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/runtime_checks/forwarding_stub_with_non_covariant_param.dart.direct.expect b/pkg/front_end/testcases/runtime_checks/forwarding_stub_with_non_covariant_param.dart.direct.expect
index bc78480..33fa3f3 100644
--- a/pkg/front_end/testcases/runtime_checks/forwarding_stub_with_non_covariant_param.dart.direct.expect
+++ b/pkg/front_end/testcases/runtime_checks/forwarding_stub_with_non_covariant_param.dart.direct.expect
@@ -8,7 +8,7 @@
;
method f(core::int x, core::int y) → void {}
}
-abstract class I<T extends core::Object> extends core::Object {
+abstract class I<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/runtime_checks/forwarding_stub_with_non_covariant_param.dart.direct.transformed.expect b/pkg/front_end/testcases/runtime_checks/forwarding_stub_with_non_covariant_param.dart.direct.transformed.expect
index bc78480..33fa3f3 100644
--- a/pkg/front_end/testcases/runtime_checks/forwarding_stub_with_non_covariant_param.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/runtime_checks/forwarding_stub_with_non_covariant_param.dart.direct.transformed.expect
@@ -8,7 +8,7 @@
;
method f(core::int x, core::int y) → void {}
}
-abstract class I<T extends core::Object> extends core::Object {
+abstract class I<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/runtime_checks/forwarding_stub_with_non_covariant_param.dart.outline.expect b/pkg/front_end/testcases/runtime_checks/forwarding_stub_with_non_covariant_param.dart.outline.expect
index 9abb71b..8206474 100644
--- a/pkg/front_end/testcases/runtime_checks/forwarding_stub_with_non_covariant_param.dart.outline.expect
+++ b/pkg/front_end/testcases/runtime_checks/forwarding_stub_with_non_covariant_param.dart.outline.expect
@@ -8,7 +8,7 @@
method f(core::int x, core::int y) → void
;
}
-abstract class I<T extends core::Object> extends core::Object {
+abstract class I<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
;
abstract method f(self::I::T x, core::int y) → void;
diff --git a/pkg/front_end/testcases/runtime_checks/forwarding_stub_with_non_covariant_param.dart.strong.expect b/pkg/front_end/testcases/runtime_checks/forwarding_stub_with_non_covariant_param.dart.strong.expect
index 0bfc9ad..71807009 100644
--- a/pkg/front_end/testcases/runtime_checks/forwarding_stub_with_non_covariant_param.dart.strong.expect
+++ b/pkg/front_end/testcases/runtime_checks/forwarding_stub_with_non_covariant_param.dart.strong.expect
@@ -8,7 +8,7 @@
;
method f(core::int x, core::int y) → void {}
}
-abstract class I<T extends core::Object> extends core::Object {
+abstract class I<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/runtime_checks/forwarding_stub_with_non_covariant_param.dart.strong.transformed.expect b/pkg/front_end/testcases/runtime_checks/forwarding_stub_with_non_covariant_param.dart.strong.transformed.expect
index 0bfc9ad..71807009 100644
--- a/pkg/front_end/testcases/runtime_checks/forwarding_stub_with_non_covariant_param.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/runtime_checks/forwarding_stub_with_non_covariant_param.dart.strong.transformed.expect
@@ -8,7 +8,7 @@
;
method f(core::int x, core::int y) → void {}
}
-abstract class I<T extends core::Object> extends core::Object {
+abstract class I<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/runtime_checks/generic_covariance_inheritance_setter_field.dart.direct.expect b/pkg/front_end/testcases/runtime_checks/generic_covariance_inheritance_setter_field.dart.direct.expect
index e76c032..61904ef 100644
--- a/pkg/front_end/testcases/runtime_checks/generic_covariance_inheritance_setter_field.dart.direct.expect
+++ b/pkg/front_end/testcases/runtime_checks/generic_covariance_inheritance_setter_field.dart.direct.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class C<T extends core::Object> extends core::Object {
+class C<T extends core::Object = dynamic> extends core::Object {
field self::C::T y = null;
synthetic constructor •() → void
: super core::Object::•()
diff --git a/pkg/front_end/testcases/runtime_checks/generic_covariance_inheritance_setter_field.dart.direct.transformed.expect b/pkg/front_end/testcases/runtime_checks/generic_covariance_inheritance_setter_field.dart.direct.transformed.expect
index e76c032..61904ef 100644
--- a/pkg/front_end/testcases/runtime_checks/generic_covariance_inheritance_setter_field.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/runtime_checks/generic_covariance_inheritance_setter_field.dart.direct.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class C<T extends core::Object> extends core::Object {
+class C<T extends core::Object = dynamic> extends core::Object {
field self::C::T y = null;
synthetic constructor •() → void
: super core::Object::•()
diff --git a/pkg/front_end/testcases/runtime_checks/generic_covariance_inheritance_setter_field.dart.outline.expect b/pkg/front_end/testcases/runtime_checks/generic_covariance_inheritance_setter_field.dart.outline.expect
index d22bd7e..88ddc9b 100644
--- a/pkg/front_end/testcases/runtime_checks/generic_covariance_inheritance_setter_field.dart.outline.expect
+++ b/pkg/front_end/testcases/runtime_checks/generic_covariance_inheritance_setter_field.dart.outline.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class C<T extends core::Object> extends core::Object {
+class C<T extends core::Object = dynamic> extends core::Object {
field self::C::T y;
synthetic constructor •() → void
;
diff --git a/pkg/front_end/testcases/runtime_checks/generic_covariance_inheritance_setter_field.dart.strong.expect b/pkg/front_end/testcases/runtime_checks/generic_covariance_inheritance_setter_field.dart.strong.expect
index 42d0664..94d01ed 100644
--- a/pkg/front_end/testcases/runtime_checks/generic_covariance_inheritance_setter_field.dart.strong.expect
+++ b/pkg/front_end/testcases/runtime_checks/generic_covariance_inheritance_setter_field.dart.strong.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class C<T extends core::Object> extends core::Object {
+class C<T extends core::Object = dynamic> extends core::Object {
generic-covariant-impl generic-covariant-interface field self::C::T y = null;
synthetic constructor •() → void
: super core::Object::•()
diff --git a/pkg/front_end/testcases/runtime_checks/generic_covariance_inheritance_setter_field.dart.strong.transformed.expect b/pkg/front_end/testcases/runtime_checks/generic_covariance_inheritance_setter_field.dart.strong.transformed.expect
index 42d0664..94d01ed 100644
--- a/pkg/front_end/testcases/runtime_checks/generic_covariance_inheritance_setter_field.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/runtime_checks/generic_covariance_inheritance_setter_field.dart.strong.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class C<T extends core::Object> extends core::Object {
+class C<T extends core::Object = dynamic> extends core::Object {
generic-covariant-impl generic-covariant-interface field self::C::T y = null;
synthetic constructor •() → void
: super core::Object::•()
diff --git a/pkg/front_end/testcases/runtime_checks/generic_vs_explicit_covariance.dart.direct.expect b/pkg/front_end/testcases/runtime_checks/generic_vs_explicit_covariance.dart.direct.expect
index 6c33166..19e4b9b 100644
--- a/pkg/front_end/testcases/runtime_checks/generic_vs_explicit_covariance.dart.direct.expect
+++ b/pkg/front_end/testcases/runtime_checks/generic_vs_explicit_covariance.dart.direct.expect
@@ -15,7 +15,7 @@
;
method f(covariant core::Object x) → void {}
}
-class C<T extends core::Object> extends core::Object implements self::B {
+class C<T extends core::Object = dynamic> extends core::Object implements self::B {
field self::C::T x = null;
synthetic constructor •() → void
: super core::Object::•()
diff --git a/pkg/front_end/testcases/runtime_checks/generic_vs_explicit_covariance.dart.direct.transformed.expect b/pkg/front_end/testcases/runtime_checks/generic_vs_explicit_covariance.dart.direct.transformed.expect
index 6c33166..19e4b9b 100644
--- a/pkg/front_end/testcases/runtime_checks/generic_vs_explicit_covariance.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/runtime_checks/generic_vs_explicit_covariance.dart.direct.transformed.expect
@@ -15,7 +15,7 @@
;
method f(covariant core::Object x) → void {}
}
-class C<T extends core::Object> extends core::Object implements self::B {
+class C<T extends core::Object = dynamic> extends core::Object implements self::B {
field self::C::T x = null;
synthetic constructor •() → void
: super core::Object::•()
diff --git a/pkg/front_end/testcases/runtime_checks/generic_vs_explicit_covariance.dart.outline.expect b/pkg/front_end/testcases/runtime_checks/generic_vs_explicit_covariance.dart.outline.expect
index 8382a52..6f06015 100644
--- a/pkg/front_end/testcases/runtime_checks/generic_vs_explicit_covariance.dart.outline.expect
+++ b/pkg/front_end/testcases/runtime_checks/generic_vs_explicit_covariance.dart.outline.expect
@@ -14,7 +14,7 @@
method f(covariant core::Object x) → void
;
}
-class C<T extends core::Object> extends core::Object implements self::B {
+class C<T extends core::Object = dynamic> extends core::Object implements self::B {
field self::C::T x;
synthetic constructor •() → void
;
diff --git a/pkg/front_end/testcases/runtime_checks/generic_vs_explicit_covariance.dart.strong.expect b/pkg/front_end/testcases/runtime_checks/generic_vs_explicit_covariance.dart.strong.expect
index 3cb3cc3..a03ad85 100644
--- a/pkg/front_end/testcases/runtime_checks/generic_vs_explicit_covariance.dart.strong.expect
+++ b/pkg/front_end/testcases/runtime_checks/generic_vs_explicit_covariance.dart.strong.expect
@@ -15,7 +15,7 @@
;
method f(covariant core::Object x) → void {}
}
-class C<T extends core::Object> extends core::Object implements self::B {
+class C<T extends core::Object = dynamic> extends core::Object implements self::B {
covariant generic-covariant-impl generic-covariant-interface field self::C::T x = null;
synthetic constructor •() → void
: super core::Object::•()
diff --git a/pkg/front_end/testcases/runtime_checks/generic_vs_explicit_covariance.dart.strong.transformed.expect b/pkg/front_end/testcases/runtime_checks/generic_vs_explicit_covariance.dart.strong.transformed.expect
index 3cb3cc3..a03ad85 100644
--- a/pkg/front_end/testcases/runtime_checks/generic_vs_explicit_covariance.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/runtime_checks/generic_vs_explicit_covariance.dart.strong.transformed.expect
@@ -15,7 +15,7 @@
;
method f(covariant core::Object x) → void {}
}
-class C<T extends core::Object> extends core::Object implements self::B {
+class C<T extends core::Object = dynamic> extends core::Object implements self::B {
covariant generic-covariant-impl generic-covariant-interface field self::C::T x = null;
synthetic constructor •() → void
: super core::Object::•()
diff --git a/pkg/front_end/testcases/runtime_checks_new/abstract_override_becomes_forwarding_stub.dart.direct.expect b/pkg/front_end/testcases/runtime_checks_new/abstract_override_becomes_forwarding_stub.dart.direct.expect
index fa00c10..fb75e74 100644
--- a/pkg/front_end/testcases/runtime_checks_new/abstract_override_becomes_forwarding_stub.dart.direct.expect
+++ b/pkg/front_end/testcases/runtime_checks_new/abstract_override_becomes_forwarding_stub.dart.direct.expect
@@ -8,7 +8,7 @@
;
method f(core::num x) → void {}
}
-abstract class I<T extends core::Object> extends core::Object {
+abstract class I<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/runtime_checks_new/abstract_override_becomes_forwarding_stub.dart.direct.transformed.expect b/pkg/front_end/testcases/runtime_checks_new/abstract_override_becomes_forwarding_stub.dart.direct.transformed.expect
index fa00c10..fb75e74 100644
--- a/pkg/front_end/testcases/runtime_checks_new/abstract_override_becomes_forwarding_stub.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/runtime_checks_new/abstract_override_becomes_forwarding_stub.dart.direct.transformed.expect
@@ -8,7 +8,7 @@
;
method f(core::num x) → void {}
}
-abstract class I<T extends core::Object> extends core::Object {
+abstract class I<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/runtime_checks_new/abstract_override_becomes_forwarding_stub.dart.outline.expect b/pkg/front_end/testcases/runtime_checks_new/abstract_override_becomes_forwarding_stub.dart.outline.expect
index 75bdee2..0a75151 100644
--- a/pkg/front_end/testcases/runtime_checks_new/abstract_override_becomes_forwarding_stub.dart.outline.expect
+++ b/pkg/front_end/testcases/runtime_checks_new/abstract_override_becomes_forwarding_stub.dart.outline.expect
@@ -8,7 +8,7 @@
method f(core::num x) → void
;
}
-abstract class I<T extends core::Object> extends core::Object {
+abstract class I<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
;
abstract method f(self::I::T x) → void;
diff --git a/pkg/front_end/testcases/runtime_checks_new/abstract_override_becomes_forwarding_stub.dart.strong.expect b/pkg/front_end/testcases/runtime_checks_new/abstract_override_becomes_forwarding_stub.dart.strong.expect
index 4cdc473..730f655 100644
--- a/pkg/front_end/testcases/runtime_checks_new/abstract_override_becomes_forwarding_stub.dart.strong.expect
+++ b/pkg/front_end/testcases/runtime_checks_new/abstract_override_becomes_forwarding_stub.dart.strong.expect
@@ -8,7 +8,7 @@
;
method f(core::num x) → void {}
}
-abstract class I<T extends core::Object> extends core::Object {
+abstract class I<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/runtime_checks_new/abstract_override_becomes_forwarding_stub.dart.strong.transformed.expect b/pkg/front_end/testcases/runtime_checks_new/abstract_override_becomes_forwarding_stub.dart.strong.transformed.expect
index 4cdc473..730f655 100644
--- a/pkg/front_end/testcases/runtime_checks_new/abstract_override_becomes_forwarding_stub.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/runtime_checks_new/abstract_override_becomes_forwarding_stub.dart.strong.transformed.expect
@@ -8,7 +8,7 @@
;
method f(core::num x) → void {}
}
-abstract class I<T extends core::Object> extends core::Object {
+abstract class I<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/runtime_checks_new/call_through_this.dart.direct.expect b/pkg/front_end/testcases/runtime_checks_new/call_through_this.dart.direct.expect
index b0e9bfc..20d497c 100644
--- a/pkg/front_end/testcases/runtime_checks_new/call_through_this.dart.direct.expect
+++ b/pkg/front_end/testcases/runtime_checks_new/call_through_this.dart.direct.expect
@@ -2,8 +2,8 @@
import self as self;
import "dart:core" as core;
-typedef F<T extends core::Object> = (T) → dynamic;
-class C<T extends core::Object> extends core::Object {
+typedef F<T extends core::Object = dynamic> = (T) → dynamic;
+class C<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/runtime_checks_new/call_through_this.dart.direct.transformed.expect b/pkg/front_end/testcases/runtime_checks_new/call_through_this.dart.direct.transformed.expect
index b0e9bfc..20d497c 100644
--- a/pkg/front_end/testcases/runtime_checks_new/call_through_this.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/runtime_checks_new/call_through_this.dart.direct.transformed.expect
@@ -2,8 +2,8 @@
import self as self;
import "dart:core" as core;
-typedef F<T extends core::Object> = (T) → dynamic;
-class C<T extends core::Object> extends core::Object {
+typedef F<T extends core::Object = dynamic> = (T) → dynamic;
+class C<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/runtime_checks_new/call_through_this.dart.outline.expect b/pkg/front_end/testcases/runtime_checks_new/call_through_this.dart.outline.expect
index 9c70c67..1b240b6 100644
--- a/pkg/front_end/testcases/runtime_checks_new/call_through_this.dart.outline.expect
+++ b/pkg/front_end/testcases/runtime_checks_new/call_through_this.dart.outline.expect
@@ -2,8 +2,8 @@
import self as self;
import "dart:core" as core;
-typedef F<T extends core::Object> = (T) → dynamic;
-class C<T extends core::Object> extends core::Object {
+typedef F<T extends core::Object = dynamic> = (T) → dynamic;
+class C<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
;
method f(self::C::T x) → void
diff --git a/pkg/front_end/testcases/runtime_checks_new/call_through_this.dart.strong.expect b/pkg/front_end/testcases/runtime_checks_new/call_through_this.dart.strong.expect
index a8e4634..56e15b3 100644
--- a/pkg/front_end/testcases/runtime_checks_new/call_through_this.dart.strong.expect
+++ b/pkg/front_end/testcases/runtime_checks_new/call_through_this.dart.strong.expect
@@ -2,8 +2,8 @@
import self as self;
import "dart:core" as core;
-typedef F<T extends core::Object> = (T) → dynamic;
-class C<T extends core::Object> extends core::Object {
+typedef F<T extends core::Object = dynamic> = (T) → dynamic;
+class C<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/runtime_checks_new/call_through_this.dart.strong.transformed.expect b/pkg/front_end/testcases/runtime_checks_new/call_through_this.dart.strong.transformed.expect
index a8e4634..56e15b3 100644
--- a/pkg/front_end/testcases/runtime_checks_new/call_through_this.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/runtime_checks_new/call_through_this.dart.strong.transformed.expect
@@ -2,8 +2,8 @@
import self as self;
import "dart:core" as core;
-typedef F<T extends core::Object> = (T) → dynamic;
-class C<T extends core::Object> extends core::Object {
+typedef F<T extends core::Object = dynamic> = (T) → dynamic;
+class C<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/runtime_checks_new/contravariant_combiner.dart.direct.expect b/pkg/front_end/testcases/runtime_checks_new/contravariant_combiner.dart.direct.expect
index 142da81..1c8d174 100644
--- a/pkg/front_end/testcases/runtime_checks_new/contravariant_combiner.dart.direct.expect
+++ b/pkg/front_end/testcases/runtime_checks_new/contravariant_combiner.dart.direct.expect
@@ -2,8 +2,8 @@
import self as self;
import "dart:core" as core;
-typedef F<T extends core::Object> = (T) → void;
-class B<T extends core::Object, U extends (self::B::T) → void> extends core::Object {
+typedef F<T extends core::Object = dynamic> = (T) → void;
+class B<T extends core::Object = dynamic, U extends (self::B::T) → void = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/runtime_checks_new/contravariant_combiner.dart.direct.transformed.expect b/pkg/front_end/testcases/runtime_checks_new/contravariant_combiner.dart.direct.transformed.expect
index 142da81..1c8d174 100644
--- a/pkg/front_end/testcases/runtime_checks_new/contravariant_combiner.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/runtime_checks_new/contravariant_combiner.dart.direct.transformed.expect
@@ -2,8 +2,8 @@
import self as self;
import "dart:core" as core;
-typedef F<T extends core::Object> = (T) → void;
-class B<T extends core::Object, U extends (self::B::T) → void> extends core::Object {
+typedef F<T extends core::Object = dynamic> = (T) → void;
+class B<T extends core::Object = dynamic, U extends (self::B::T) → void = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/runtime_checks_new/contravariant_combiner.dart.outline.expect b/pkg/front_end/testcases/runtime_checks_new/contravariant_combiner.dart.outline.expect
index 51e24b8..99545e4 100644
--- a/pkg/front_end/testcases/runtime_checks_new/contravariant_combiner.dart.outline.expect
+++ b/pkg/front_end/testcases/runtime_checks_new/contravariant_combiner.dart.outline.expect
@@ -2,8 +2,8 @@
import self as self;
import "dart:core" as core;
-typedef F<T extends core::Object> = (T) → void;
-class B<T extends core::Object, U extends (self::B::T) → void> extends core::Object {
+typedef F<T extends core::Object = dynamic> = (T) → void;
+class B<T extends core::Object = dynamic, U extends (self::B::T) → void = dynamic> extends core::Object {
synthetic constructor •() → void
;
operator +(dynamic other) → self::B<self::B::T, (self::B::T) → void>
diff --git a/pkg/front_end/testcases/runtime_checks_new/contravariant_combiner.dart.strong.expect b/pkg/front_end/testcases/runtime_checks_new/contravariant_combiner.dart.strong.expect
index abb7c26..447bd5c 100644
--- a/pkg/front_end/testcases/runtime_checks_new/contravariant_combiner.dart.strong.expect
+++ b/pkg/front_end/testcases/runtime_checks_new/contravariant_combiner.dart.strong.expect
@@ -2,8 +2,8 @@
import self as self;
import "dart:core" as core;
-typedef F<T extends core::Object> = (T) → void;
-class B<T extends core::Object, U extends (self::B::T) → void> extends core::Object {
+typedef F<T extends core::Object = dynamic> = (T) → void;
+class B<T extends core::Object = dynamic, U extends (self::B::T) → void = (dynamic) → void> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/runtime_checks_new/contravariant_combiner.dart.strong.transformed.expect b/pkg/front_end/testcases/runtime_checks_new/contravariant_combiner.dart.strong.transformed.expect
index abb7c26..447bd5c 100644
--- a/pkg/front_end/testcases/runtime_checks_new/contravariant_combiner.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/runtime_checks_new/contravariant_combiner.dart.strong.transformed.expect
@@ -2,8 +2,8 @@
import self as self;
import "dart:core" as core;
-typedef F<T extends core::Object> = (T) → void;
-class B<T extends core::Object, U extends (self::B::T) → void> extends core::Object {
+typedef F<T extends core::Object = dynamic> = (T) → void;
+class B<T extends core::Object = dynamic, U extends (self::B::T) → void = (dynamic) → void> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/runtime_checks_new/contravariant_generic_return_with_compound_assign_implicit_downcast.dart.direct.expect b/pkg/front_end/testcases/runtime_checks_new/contravariant_generic_return_with_compound_assign_implicit_downcast.dart.direct.expect
index f7da8fe..aa918d1 100644
--- a/pkg/front_end/testcases/runtime_checks_new/contravariant_generic_return_with_compound_assign_implicit_downcast.dart.direct.expect
+++ b/pkg/front_end/testcases/runtime_checks_new/contravariant_generic_return_with_compound_assign_implicit_downcast.dart.direct.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class C<T extends core::Object> extends core::Object {
+class C<T extends core::Object = dynamic> extends core::Object {
final field (self::C::T) → core::num plusResult;
constructor •((self::C::T) → core::num plusResult) → void
: self::C::plusResult = plusResult, super core::Object::•()
diff --git a/pkg/front_end/testcases/runtime_checks_new/contravariant_generic_return_with_compound_assign_implicit_downcast.dart.direct.transformed.expect b/pkg/front_end/testcases/runtime_checks_new/contravariant_generic_return_with_compound_assign_implicit_downcast.dart.direct.transformed.expect
index f7da8fe..aa918d1 100644
--- a/pkg/front_end/testcases/runtime_checks_new/contravariant_generic_return_with_compound_assign_implicit_downcast.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/runtime_checks_new/contravariant_generic_return_with_compound_assign_implicit_downcast.dart.direct.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class C<T extends core::Object> extends core::Object {
+class C<T extends core::Object = dynamic> extends core::Object {
final field (self::C::T) → core::num plusResult;
constructor •((self::C::T) → core::num plusResult) → void
: self::C::plusResult = plusResult, super core::Object::•()
diff --git a/pkg/front_end/testcases/runtime_checks_new/contravariant_generic_return_with_compound_assign_implicit_downcast.dart.outline.expect b/pkg/front_end/testcases/runtime_checks_new/contravariant_generic_return_with_compound_assign_implicit_downcast.dart.outline.expect
index cd27122..466bc13 100644
--- a/pkg/front_end/testcases/runtime_checks_new/contravariant_generic_return_with_compound_assign_implicit_downcast.dart.outline.expect
+++ b/pkg/front_end/testcases/runtime_checks_new/contravariant_generic_return_with_compound_assign_implicit_downcast.dart.outline.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class C<T extends core::Object> extends core::Object {
+class C<T extends core::Object = dynamic> extends core::Object {
final field (self::C::T) → core::num plusResult;
constructor •((self::C::T) → core::num plusResult) → void
;
diff --git a/pkg/front_end/testcases/runtime_checks_new/contravariant_generic_return_with_compound_assign_implicit_downcast.dart.strong.expect b/pkg/front_end/testcases/runtime_checks_new/contravariant_generic_return_with_compound_assign_implicit_downcast.dart.strong.expect
index 8a36099..1447ddb 100644
--- a/pkg/front_end/testcases/runtime_checks_new/contravariant_generic_return_with_compound_assign_implicit_downcast.dart.strong.expect
+++ b/pkg/front_end/testcases/runtime_checks_new/contravariant_generic_return_with_compound_assign_implicit_downcast.dart.strong.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class C<T extends core::Object> extends core::Object {
+class C<T extends core::Object = dynamic> extends core::Object {
final field (self::C::T) → core::num plusResult;
constructor •((self::C::T) → core::num plusResult) → void
: self::C::plusResult = plusResult, super core::Object::•()
diff --git a/pkg/front_end/testcases/runtime_checks_new/contravariant_generic_return_with_compound_assign_implicit_downcast.dart.strong.transformed.expect b/pkg/front_end/testcases/runtime_checks_new/contravariant_generic_return_with_compound_assign_implicit_downcast.dart.strong.transformed.expect
index 9e71b47..8378a4c 100644
--- a/pkg/front_end/testcases/runtime_checks_new/contravariant_generic_return_with_compound_assign_implicit_downcast.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/runtime_checks_new/contravariant_generic_return_with_compound_assign_implicit_downcast.dart.strong.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class C<T extends core::Object> extends core::Object {
+class C<T extends core::Object = dynamic> extends core::Object {
final field (self::C::T) → core::num plusResult;
constructor •((self::C::T) → core::num plusResult) → void
: self::C::plusResult = plusResult, super core::Object::•()
diff --git a/pkg/front_end/testcases/runtime_checks_new/contravariant_getter_return_compound_assign.dart.direct.expect b/pkg/front_end/testcases/runtime_checks_new/contravariant_getter_return_compound_assign.dart.direct.expect
index e5d0682..7941e44 100644
--- a/pkg/front_end/testcases/runtime_checks_new/contravariant_getter_return_compound_assign.dart.direct.expect
+++ b/pkg/front_end/testcases/runtime_checks_new/contravariant_getter_return_compound_assign.dart.direct.expect
@@ -2,15 +2,15 @@
import self as self;
import "dart:core" as core;
-typedef F<T extends core::Object> = (T) → void;
-class B<T extends core::Object> extends core::Object {
+typedef F<T extends core::Object = dynamic> = (T) → void;
+class B<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
operator +(self::B<self::B::T> other) → self::B<self::B::T>
return null;
}
-class C<T extends core::Object> extends core::Object {
+class C<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/runtime_checks_new/contravariant_getter_return_compound_assign.dart.direct.transformed.expect b/pkg/front_end/testcases/runtime_checks_new/contravariant_getter_return_compound_assign.dart.direct.transformed.expect
index e5d0682..7941e44 100644
--- a/pkg/front_end/testcases/runtime_checks_new/contravariant_getter_return_compound_assign.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/runtime_checks_new/contravariant_getter_return_compound_assign.dart.direct.transformed.expect
@@ -2,15 +2,15 @@
import self as self;
import "dart:core" as core;
-typedef F<T extends core::Object> = (T) → void;
-class B<T extends core::Object> extends core::Object {
+typedef F<T extends core::Object = dynamic> = (T) → void;
+class B<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
operator +(self::B<self::B::T> other) → self::B<self::B::T>
return null;
}
-class C<T extends core::Object> extends core::Object {
+class C<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/runtime_checks_new/contravariant_getter_return_compound_assign.dart.outline.expect b/pkg/front_end/testcases/runtime_checks_new/contravariant_getter_return_compound_assign.dart.outline.expect
index 0b7e9a5..6305ba1 100644
--- a/pkg/front_end/testcases/runtime_checks_new/contravariant_getter_return_compound_assign.dart.outline.expect
+++ b/pkg/front_end/testcases/runtime_checks_new/contravariant_getter_return_compound_assign.dart.outline.expect
@@ -2,14 +2,14 @@
import self as self;
import "dart:core" as core;
-typedef F<T extends core::Object> = (T) → void;
-class B<T extends core::Object> extends core::Object {
+typedef F<T extends core::Object = dynamic> = (T) → void;
+class B<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
;
operator +(self::B<self::B::T> other) → self::B<self::B::T>
;
}
-class C<T extends core::Object> extends core::Object {
+class C<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
;
get x() → self::B<(self::C::T) → void>
diff --git a/pkg/front_end/testcases/runtime_checks_new/contravariant_getter_return_compound_assign.dart.strong.expect b/pkg/front_end/testcases/runtime_checks_new/contravariant_getter_return_compound_assign.dart.strong.expect
index 5661177..35cd46f 100644
--- a/pkg/front_end/testcases/runtime_checks_new/contravariant_getter_return_compound_assign.dart.strong.expect
+++ b/pkg/front_end/testcases/runtime_checks_new/contravariant_getter_return_compound_assign.dart.strong.expect
@@ -2,15 +2,15 @@
import self as self;
import "dart:core" as core;
-typedef F<T extends core::Object> = (T) → void;
-class B<T extends core::Object> extends core::Object {
+typedef F<T extends core::Object = dynamic> = (T) → void;
+class B<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
operator +(generic-covariant-impl generic-covariant-interface self::B<self::B::T> other) → self::B<self::B::T>
return null;
}
-class C<T extends core::Object> extends core::Object {
+class C<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/runtime_checks_new/contravariant_getter_return_compound_assign.dart.strong.transformed.expect b/pkg/front_end/testcases/runtime_checks_new/contravariant_getter_return_compound_assign.dart.strong.transformed.expect
index 7a9ab98..5a9326d 100644
--- a/pkg/front_end/testcases/runtime_checks_new/contravariant_getter_return_compound_assign.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/runtime_checks_new/contravariant_getter_return_compound_assign.dart.strong.transformed.expect
@@ -2,15 +2,15 @@
import self as self;
import "dart:core" as core;
-typedef F<T extends core::Object> = (T) → void;
-class B<T extends core::Object> extends core::Object {
+typedef F<T extends core::Object = dynamic> = (T) → void;
+class B<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
operator +(generic-covariant-impl generic-covariant-interface self::B<self::B::T> other) → self::B<self::B::T>
return null;
}
-class C<T extends core::Object> extends core::Object {
+class C<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/runtime_checks_new/contravariant_index_assign.dart.direct.expect b/pkg/front_end/testcases/runtime_checks_new/contravariant_index_assign.dart.direct.expect
index 78a8669..8370814 100644
--- a/pkg/front_end/testcases/runtime_checks_new/contravariant_index_assign.dart.direct.expect
+++ b/pkg/front_end/testcases/runtime_checks_new/contravariant_index_assign.dart.direct.expect
@@ -2,15 +2,15 @@
import self as self;
import "dart:core" as core;
-typedef F<T extends core::Object> = (T) → void;
-class B<T extends core::Object> extends core::Object {
+typedef F<T extends core::Object = dynamic> = (T) → void;
+class B<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
operator +(self::B<self::B::T> other) → self::B<self::B::T>
return null;
}
-class C<T extends core::Object> extends core::Object {
+class C<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/runtime_checks_new/contravariant_index_assign.dart.direct.transformed.expect b/pkg/front_end/testcases/runtime_checks_new/contravariant_index_assign.dart.direct.transformed.expect
index 78a8669..8370814 100644
--- a/pkg/front_end/testcases/runtime_checks_new/contravariant_index_assign.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/runtime_checks_new/contravariant_index_assign.dart.direct.transformed.expect
@@ -2,15 +2,15 @@
import self as self;
import "dart:core" as core;
-typedef F<T extends core::Object> = (T) → void;
-class B<T extends core::Object> extends core::Object {
+typedef F<T extends core::Object = dynamic> = (T) → void;
+class B<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
operator +(self::B<self::B::T> other) → self::B<self::B::T>
return null;
}
-class C<T extends core::Object> extends core::Object {
+class C<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/runtime_checks_new/contravariant_index_assign.dart.outline.expect b/pkg/front_end/testcases/runtime_checks_new/contravariant_index_assign.dart.outline.expect
index 4e1e19f..9fe6f92 100644
--- a/pkg/front_end/testcases/runtime_checks_new/contravariant_index_assign.dart.outline.expect
+++ b/pkg/front_end/testcases/runtime_checks_new/contravariant_index_assign.dart.outline.expect
@@ -2,14 +2,14 @@
import self as self;
import "dart:core" as core;
-typedef F<T extends core::Object> = (T) → void;
-class B<T extends core::Object> extends core::Object {
+typedef F<T extends core::Object = dynamic> = (T) → void;
+class B<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
;
operator +(self::B<self::B::T> other) → self::B<self::B::T>
;
}
-class C<T extends core::Object> extends core::Object {
+class C<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
;
operator [](core::int i) → self::B<(self::C::T) → void>
diff --git a/pkg/front_end/testcases/runtime_checks_new/contravariant_index_assign.dart.strong.expect b/pkg/front_end/testcases/runtime_checks_new/contravariant_index_assign.dart.strong.expect
index 4c7b92c..b74c2ed 100644
--- a/pkg/front_end/testcases/runtime_checks_new/contravariant_index_assign.dart.strong.expect
+++ b/pkg/front_end/testcases/runtime_checks_new/contravariant_index_assign.dart.strong.expect
@@ -2,15 +2,15 @@
import self as self;
import "dart:core" as core;
-typedef F<T extends core::Object> = (T) → void;
-class B<T extends core::Object> extends core::Object {
+typedef F<T extends core::Object = dynamic> = (T) → void;
+class B<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
operator +(generic-covariant-impl generic-covariant-interface self::B<self::B::T> other) → self::B<self::B::T>
return null;
}
-class C<T extends core::Object> extends core::Object {
+class C<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/runtime_checks_new/contravariant_index_assign.dart.strong.transformed.expect b/pkg/front_end/testcases/runtime_checks_new/contravariant_index_assign.dart.strong.transformed.expect
index 4c7b92c..b74c2ed 100644
--- a/pkg/front_end/testcases/runtime_checks_new/contravariant_index_assign.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/runtime_checks_new/contravariant_index_assign.dart.strong.transformed.expect
@@ -2,15 +2,15 @@
import self as self;
import "dart:core" as core;
-typedef F<T extends core::Object> = (T) → void;
-class B<T extends core::Object> extends core::Object {
+typedef F<T extends core::Object = dynamic> = (T) → void;
+class B<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
operator +(generic-covariant-impl generic-covariant-interface self::B<self::B::T> other) → self::B<self::B::T>
return null;
}
-class C<T extends core::Object> extends core::Object {
+class C<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/runtime_checks_new/contravariant_index_get.dart.direct.expect b/pkg/front_end/testcases/runtime_checks_new/contravariant_index_get.dart.direct.expect
index 02c5897..be5b7ea 100644
--- a/pkg/front_end/testcases/runtime_checks_new/contravariant_index_get.dart.direct.expect
+++ b/pkg/front_end/testcases/runtime_checks_new/contravariant_index_get.dart.direct.expect
@@ -2,8 +2,8 @@
import self as self;
import "dart:core" as core;
-typedef F<T extends core::Object> = (T) → void;
-class C<T extends core::Object> extends core::Object {
+typedef F<T extends core::Object = dynamic> = (T) → void;
+class C<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/runtime_checks_new/contravariant_index_get.dart.direct.transformed.expect b/pkg/front_end/testcases/runtime_checks_new/contravariant_index_get.dart.direct.transformed.expect
index 02c5897..be5b7ea 100644
--- a/pkg/front_end/testcases/runtime_checks_new/contravariant_index_get.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/runtime_checks_new/contravariant_index_get.dart.direct.transformed.expect
@@ -2,8 +2,8 @@
import self as self;
import "dart:core" as core;
-typedef F<T extends core::Object> = (T) → void;
-class C<T extends core::Object> extends core::Object {
+typedef F<T extends core::Object = dynamic> = (T) → void;
+class C<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/runtime_checks_new/contravariant_index_get.dart.outline.expect b/pkg/front_end/testcases/runtime_checks_new/contravariant_index_get.dart.outline.expect
index 31036c6..136af72 100644
--- a/pkg/front_end/testcases/runtime_checks_new/contravariant_index_get.dart.outline.expect
+++ b/pkg/front_end/testcases/runtime_checks_new/contravariant_index_get.dart.outline.expect
@@ -2,8 +2,8 @@
import self as self;
import "dart:core" as core;
-typedef F<T extends core::Object> = (T) → void;
-class C<T extends core::Object> extends core::Object {
+typedef F<T extends core::Object = dynamic> = (T) → void;
+class C<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
;
operator [](core::int i) → (self::C::T) → void
diff --git a/pkg/front_end/testcases/runtime_checks_new/contravariant_index_get.dart.strong.expect b/pkg/front_end/testcases/runtime_checks_new/contravariant_index_get.dart.strong.expect
index 4c9a372..5d00df6 100644
--- a/pkg/front_end/testcases/runtime_checks_new/contravariant_index_get.dart.strong.expect
+++ b/pkg/front_end/testcases/runtime_checks_new/contravariant_index_get.dart.strong.expect
@@ -2,8 +2,8 @@
import self as self;
import "dart:core" as core;
-typedef F<T extends core::Object> = (T) → void;
-class C<T extends core::Object> extends core::Object {
+typedef F<T extends core::Object = dynamic> = (T) → void;
+class C<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/runtime_checks_new/contravariant_index_get.dart.strong.transformed.expect b/pkg/front_end/testcases/runtime_checks_new/contravariant_index_get.dart.strong.transformed.expect
index 4c9a372..5d00df6 100644
--- a/pkg/front_end/testcases/runtime_checks_new/contravariant_index_get.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/runtime_checks_new/contravariant_index_get.dart.strong.transformed.expect
@@ -2,8 +2,8 @@
import self as self;
import "dart:core" as core;
-typedef F<T extends core::Object> = (T) → void;
-class C<T extends core::Object> extends core::Object {
+typedef F<T extends core::Object = dynamic> = (T) → void;
+class C<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/runtime_checks_new/derived_class_typed.dart.direct.expect b/pkg/front_end/testcases/runtime_checks_new/derived_class_typed.dart.direct.expect
index e8eb073..7d922fa 100644
--- a/pkg/front_end/testcases/runtime_checks_new/derived_class_typed.dart.direct.expect
+++ b/pkg/front_end/testcases/runtime_checks_new/derived_class_typed.dart.direct.expect
@@ -2,13 +2,13 @@
import self as self;
import "dart:core" as core;
-class B<T extends core::Object> extends core::Object {
+class B<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
method f(self::B::T x) → void {}
method g({self::B::T x = null}) → void {}
- method h<U extends self::B::T>() → void {}
+ method h<U extends self::B::T = dynamic>() → void {}
}
class C extends self::B<core::int> {
synthetic constructor •() → void
diff --git a/pkg/front_end/testcases/runtime_checks_new/derived_class_typed.dart.direct.transformed.expect b/pkg/front_end/testcases/runtime_checks_new/derived_class_typed.dart.direct.transformed.expect
index e8eb073..7d922fa 100644
--- a/pkg/front_end/testcases/runtime_checks_new/derived_class_typed.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/runtime_checks_new/derived_class_typed.dart.direct.transformed.expect
@@ -2,13 +2,13 @@
import self as self;
import "dart:core" as core;
-class B<T extends core::Object> extends core::Object {
+class B<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
method f(self::B::T x) → void {}
method g({self::B::T x = null}) → void {}
- method h<U extends self::B::T>() → void {}
+ method h<U extends self::B::T = dynamic>() → void {}
}
class C extends self::B<core::int> {
synthetic constructor •() → void
diff --git a/pkg/front_end/testcases/runtime_checks_new/derived_class_typed.dart.outline.expect b/pkg/front_end/testcases/runtime_checks_new/derived_class_typed.dart.outline.expect
index ebd92db..895a16d 100644
--- a/pkg/front_end/testcases/runtime_checks_new/derived_class_typed.dart.outline.expect
+++ b/pkg/front_end/testcases/runtime_checks_new/derived_class_typed.dart.outline.expect
@@ -2,14 +2,14 @@
import self as self;
import "dart:core" as core;
-class B<T extends core::Object> extends core::Object {
+class B<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
;
method f(self::B::T x) → void
;
method g({self::B::T x}) → void
;
- method h<U extends self::B::T>() → void
+ method h<U extends self::B::T = dynamic>() → void
;
}
class C extends self::B<core::int> {
diff --git a/pkg/front_end/testcases/runtime_checks_new/derived_class_typed.dart.strong.expect b/pkg/front_end/testcases/runtime_checks_new/derived_class_typed.dart.strong.expect
index e4bff7d..485a5a8 100644
--- a/pkg/front_end/testcases/runtime_checks_new/derived_class_typed.dart.strong.expect
+++ b/pkg/front_end/testcases/runtime_checks_new/derived_class_typed.dart.strong.expect
@@ -2,13 +2,13 @@
import self as self;
import "dart:core" as core;
-class B<T extends core::Object> extends core::Object {
+class B<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
method f(generic-covariant-impl generic-covariant-interface self::B::T x) → void {}
method g({generic-covariant-impl generic-covariant-interface self::B::T x = null}) → void {}
- method h<generic-covariant-impl generic-covariant-interface U extends self::B::T>() → void {}
+ method h<generic-covariant-impl generic-covariant-interface U extends self::B::T = dynamic>() → void {}
}
class C extends self::B<core::int> {
synthetic constructor •() → void
diff --git a/pkg/front_end/testcases/runtime_checks_new/derived_class_typed.dart.strong.transformed.expect b/pkg/front_end/testcases/runtime_checks_new/derived_class_typed.dart.strong.transformed.expect
index e4bff7d..485a5a8 100644
--- a/pkg/front_end/testcases/runtime_checks_new/derived_class_typed.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/runtime_checks_new/derived_class_typed.dart.strong.transformed.expect
@@ -2,13 +2,13 @@
import self as self;
import "dart:core" as core;
-class B<T extends core::Object> extends core::Object {
+class B<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
method f(generic-covariant-impl generic-covariant-interface self::B::T x) → void {}
method g({generic-covariant-impl generic-covariant-interface self::B::T x = null}) → void {}
- method h<generic-covariant-impl generic-covariant-interface U extends self::B::T>() → void {}
+ method h<generic-covariant-impl generic-covariant-interface U extends self::B::T = dynamic>() → void {}
}
class C extends self::B<core::int> {
synthetic constructor •() → void
diff --git a/pkg/front_end/testcases/runtime_checks_new/field_forwarding_stub_abstract_generic_covariant.dart.direct.expect b/pkg/front_end/testcases/runtime_checks_new/field_forwarding_stub_abstract_generic_covariant.dart.direct.expect
index 5ae17d3..25d0e7a 100644
--- a/pkg/front_end/testcases/runtime_checks_new/field_forwarding_stub_abstract_generic_covariant.dart.direct.expect
+++ b/pkg/front_end/testcases/runtime_checks_new/field_forwarding_stub_abstract_generic_covariant.dart.direct.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class B<T extends core::Object> extends core::Object {
+class B<T extends core::Object = dynamic> extends core::Object {
field self::B::T x = null;
synthetic constructor •() → void
: super core::Object::•()
diff --git a/pkg/front_end/testcases/runtime_checks_new/field_forwarding_stub_abstract_generic_covariant.dart.direct.transformed.expect b/pkg/front_end/testcases/runtime_checks_new/field_forwarding_stub_abstract_generic_covariant.dart.direct.transformed.expect
index 5ae17d3..25d0e7a 100644
--- a/pkg/front_end/testcases/runtime_checks_new/field_forwarding_stub_abstract_generic_covariant.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/runtime_checks_new/field_forwarding_stub_abstract_generic_covariant.dart.direct.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class B<T extends core::Object> extends core::Object {
+class B<T extends core::Object = dynamic> extends core::Object {
field self::B::T x = null;
synthetic constructor •() → void
: super core::Object::•()
diff --git a/pkg/front_end/testcases/runtime_checks_new/field_forwarding_stub_abstract_generic_covariant.dart.outline.expect b/pkg/front_end/testcases/runtime_checks_new/field_forwarding_stub_abstract_generic_covariant.dart.outline.expect
index b70e682..5146cef 100644
--- a/pkg/front_end/testcases/runtime_checks_new/field_forwarding_stub_abstract_generic_covariant.dart.outline.expect
+++ b/pkg/front_end/testcases/runtime_checks_new/field_forwarding_stub_abstract_generic_covariant.dart.outline.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class B<T extends core::Object> extends core::Object {
+class B<T extends core::Object = dynamic> extends core::Object {
field self::B::T x;
synthetic constructor •() → void
;
diff --git a/pkg/front_end/testcases/runtime_checks_new/field_forwarding_stub_abstract_generic_covariant.dart.strong.expect b/pkg/front_end/testcases/runtime_checks_new/field_forwarding_stub_abstract_generic_covariant.dart.strong.expect
index e0ee96e..0de2a48 100644
--- a/pkg/front_end/testcases/runtime_checks_new/field_forwarding_stub_abstract_generic_covariant.dart.strong.expect
+++ b/pkg/front_end/testcases/runtime_checks_new/field_forwarding_stub_abstract_generic_covariant.dart.strong.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class B<T extends core::Object> extends core::Object {
+class B<T extends core::Object = dynamic> extends core::Object {
generic-covariant-impl generic-covariant-interface field self::B::T x = null;
synthetic constructor •() → void
: super core::Object::•()
diff --git a/pkg/front_end/testcases/runtime_checks_new/field_forwarding_stub_abstract_generic_covariant.dart.strong.transformed.expect b/pkg/front_end/testcases/runtime_checks_new/field_forwarding_stub_abstract_generic_covariant.dart.strong.transformed.expect
index e0ee96e..0de2a48 100644
--- a/pkg/front_end/testcases/runtime_checks_new/field_forwarding_stub_abstract_generic_covariant.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/runtime_checks_new/field_forwarding_stub_abstract_generic_covariant.dart.strong.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class B<T extends core::Object> extends core::Object {
+class B<T extends core::Object = dynamic> extends core::Object {
generic-covariant-impl generic-covariant-interface field self::B::T x = null;
synthetic constructor •() → void
: super core::Object::•()
diff --git a/pkg/front_end/testcases/runtime_checks_new/generic_covariance_based_on_inference.dart.direct.expect b/pkg/front_end/testcases/runtime_checks_new/generic_covariance_based_on_inference.dart.direct.expect
index 2582858..caf1225 100644
--- a/pkg/front_end/testcases/runtime_checks_new/generic_covariance_based_on_inference.dart.direct.expect
+++ b/pkg/front_end/testcases/runtime_checks_new/generic_covariance_based_on_inference.dart.direct.expect
@@ -2,14 +2,14 @@
import self as self;
import "dart:core" as core;
-class B<T extends core::Object> extends core::Object {
+class B<T extends core::Object = dynamic> extends core::Object {
field self::B::T x = null;
field self::B::T y = null;
synthetic constructor •() → void
: super core::Object::•()
;
}
-abstract class C<T extends core::Object> extends core::Object implements self::B<core::num> {
+abstract class C<T extends core::Object = dynamic> extends core::Object implements self::B<core::num> {
field dynamic x = null;
synthetic constructor •() → void
: super core::Object::•()
@@ -17,7 +17,7 @@
abstract get y() → dynamic;
abstract set y(dynamic value) → dynamic;
}
-abstract class D<T extends core::Object> extends core::Object implements self::B<self::D::T> {
+abstract class D<T extends core::Object = dynamic> extends core::Object implements self::B<self::D::T> {
field dynamic x = null;
synthetic constructor •() → void
: super core::Object::•()
diff --git a/pkg/front_end/testcases/runtime_checks_new/generic_covariance_based_on_inference.dart.direct.transformed.expect b/pkg/front_end/testcases/runtime_checks_new/generic_covariance_based_on_inference.dart.direct.transformed.expect
index 2582858..caf1225 100644
--- a/pkg/front_end/testcases/runtime_checks_new/generic_covariance_based_on_inference.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/runtime_checks_new/generic_covariance_based_on_inference.dart.direct.transformed.expect
@@ -2,14 +2,14 @@
import self as self;
import "dart:core" as core;
-class B<T extends core::Object> extends core::Object {
+class B<T extends core::Object = dynamic> extends core::Object {
field self::B::T x = null;
field self::B::T y = null;
synthetic constructor •() → void
: super core::Object::•()
;
}
-abstract class C<T extends core::Object> extends core::Object implements self::B<core::num> {
+abstract class C<T extends core::Object = dynamic> extends core::Object implements self::B<core::num> {
field dynamic x = null;
synthetic constructor •() → void
: super core::Object::•()
@@ -17,7 +17,7 @@
abstract get y() → dynamic;
abstract set y(dynamic value) → dynamic;
}
-abstract class D<T extends core::Object> extends core::Object implements self::B<self::D::T> {
+abstract class D<T extends core::Object = dynamic> extends core::Object implements self::B<self::D::T> {
field dynamic x = null;
synthetic constructor •() → void
: super core::Object::•()
diff --git a/pkg/front_end/testcases/runtime_checks_new/generic_covariance_based_on_inference.dart.outline.expect b/pkg/front_end/testcases/runtime_checks_new/generic_covariance_based_on_inference.dart.outline.expect
index 6ae5d4d..441306a 100644
--- a/pkg/front_end/testcases/runtime_checks_new/generic_covariance_based_on_inference.dart.outline.expect
+++ b/pkg/front_end/testcases/runtime_checks_new/generic_covariance_based_on_inference.dart.outline.expect
@@ -2,20 +2,20 @@
import self as self;
import "dart:core" as core;
-class B<T extends core::Object> extends core::Object {
+class B<T extends core::Object = dynamic> extends core::Object {
field self::B::T x;
field self::B::T y;
synthetic constructor •() → void
;
}
-abstract class C<T extends core::Object> extends core::Object implements self::B<core::num> {
+abstract class C<T extends core::Object = dynamic> extends core::Object implements self::B<core::num> {
field dynamic x;
synthetic constructor •() → void
;
abstract get y() → dynamic;
abstract set y(dynamic value) → dynamic;
}
-abstract class D<T extends core::Object> extends core::Object implements self::B<self::D::T> {
+abstract class D<T extends core::Object = dynamic> extends core::Object implements self::B<self::D::T> {
field dynamic x;
synthetic constructor •() → void
;
diff --git a/pkg/front_end/testcases/runtime_checks_new/generic_covariance_based_on_inference.dart.strong.expect b/pkg/front_end/testcases/runtime_checks_new/generic_covariance_based_on_inference.dart.strong.expect
index d32e1ab..56bdaf5 100644
--- a/pkg/front_end/testcases/runtime_checks_new/generic_covariance_based_on_inference.dart.strong.expect
+++ b/pkg/front_end/testcases/runtime_checks_new/generic_covariance_based_on_inference.dart.strong.expect
@@ -2,14 +2,14 @@
import self as self;
import "dart:core" as core;
-class B<T extends core::Object> extends core::Object {
+class B<T extends core::Object = dynamic> extends core::Object {
generic-covariant-impl generic-covariant-interface field self::B::T x = null;
generic-covariant-impl generic-covariant-interface field self::B::T y = null;
synthetic constructor •() → void
: super core::Object::•()
;
}
-abstract class C<T extends core::Object> extends core::Object implements self::B<core::num> {
+abstract class C<T extends core::Object = dynamic> extends core::Object implements self::B<core::num> {
generic-covariant-impl field core::num x = null;
synthetic constructor •() → void
: super core::Object::•()
@@ -17,7 +17,7 @@
abstract get y() → core::num;
abstract set y(generic-covariant-impl core::num value) → void;
}
-abstract class D<T extends core::Object> extends core::Object implements self::B<self::D::T> {
+abstract class D<T extends core::Object = dynamic> extends core::Object implements self::B<self::D::T> {
generic-covariant-impl generic-covariant-interface field self::D::T x = null;
synthetic constructor •() → void
: super core::Object::•()
diff --git a/pkg/front_end/testcases/runtime_checks_new/generic_covariance_based_on_inference.dart.strong.transformed.expect b/pkg/front_end/testcases/runtime_checks_new/generic_covariance_based_on_inference.dart.strong.transformed.expect
index d32e1ab..56bdaf5 100644
--- a/pkg/front_end/testcases/runtime_checks_new/generic_covariance_based_on_inference.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/runtime_checks_new/generic_covariance_based_on_inference.dart.strong.transformed.expect
@@ -2,14 +2,14 @@
import self as self;
import "dart:core" as core;
-class B<T extends core::Object> extends core::Object {
+class B<T extends core::Object = dynamic> extends core::Object {
generic-covariant-impl generic-covariant-interface field self::B::T x = null;
generic-covariant-impl generic-covariant-interface field self::B::T y = null;
synthetic constructor •() → void
: super core::Object::•()
;
}
-abstract class C<T extends core::Object> extends core::Object implements self::B<core::num> {
+abstract class C<T extends core::Object = dynamic> extends core::Object implements self::B<core::num> {
generic-covariant-impl field core::num x = null;
synthetic constructor •() → void
: super core::Object::•()
@@ -17,7 +17,7 @@
abstract get y() → core::num;
abstract set y(generic-covariant-impl core::num value) → void;
}
-abstract class D<T extends core::Object> extends core::Object implements self::B<self::D::T> {
+abstract class D<T extends core::Object = dynamic> extends core::Object implements self::B<self::D::T> {
generic-covariant-impl generic-covariant-interface field self::D::T x = null;
synthetic constructor •() → void
: super core::Object::•()
diff --git a/pkg/front_end/testcases/runtime_checks_new/mixin_forwarding_stub_field.dart.direct.expect b/pkg/front_end/testcases/runtime_checks_new/mixin_forwarding_stub_field.dart.direct.expect
index 4c4735d..386f01b 100644
--- a/pkg/front_end/testcases/runtime_checks_new/mixin_forwarding_stub_field.dart.direct.expect
+++ b/pkg/front_end/testcases/runtime_checks_new/mixin_forwarding_stub_field.dart.direct.expect
@@ -19,7 +19,7 @@
throw "Should not be reached";
}
}
-abstract class I<T extends core::Object> extends core::Object {
+abstract class I<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/runtime_checks_new/mixin_forwarding_stub_field.dart.direct.transformed.expect b/pkg/front_end/testcases/runtime_checks_new/mixin_forwarding_stub_field.dart.direct.transformed.expect
index 78ffd8c5..0cdd702 100644
--- a/pkg/front_end/testcases/runtime_checks_new/mixin_forwarding_stub_field.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/runtime_checks_new/mixin_forwarding_stub_field.dart.direct.transformed.expect
@@ -19,7 +19,7 @@
throw "Should not be reached";
}
}
-abstract class I<T extends core::Object> extends core::Object {
+abstract class I<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/runtime_checks_new/mixin_forwarding_stub_field.dart.outline.expect b/pkg/front_end/testcases/runtime_checks_new/mixin_forwarding_stub_field.dart.outline.expect
index 05bfd76..a054265 100644
--- a/pkg/front_end/testcases/runtime_checks_new/mixin_forwarding_stub_field.dart.outline.expect
+++ b/pkg/front_end/testcases/runtime_checks_new/mixin_forwarding_stub_field.dart.outline.expect
@@ -14,7 +14,7 @@
set y(core::int value) → void
;
}
-abstract class I<T extends core::Object> extends core::Object {
+abstract class I<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
;
abstract get x() → self::I::T;
diff --git a/pkg/front_end/testcases/runtime_checks_new/mixin_forwarding_stub_field.dart.strong.expect b/pkg/front_end/testcases/runtime_checks_new/mixin_forwarding_stub_field.dart.strong.expect
index 7ae9bb9..314d87d 100644
--- a/pkg/front_end/testcases/runtime_checks_new/mixin_forwarding_stub_field.dart.strong.expect
+++ b/pkg/front_end/testcases/runtime_checks_new/mixin_forwarding_stub_field.dart.strong.expect
@@ -19,7 +19,7 @@
throw "Should not be reached";
}
}
-abstract class I<T extends core::Object> extends core::Object {
+abstract class I<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/runtime_checks_new/mixin_forwarding_stub_getter.dart.direct.expect b/pkg/front_end/testcases/runtime_checks_new/mixin_forwarding_stub_getter.dart.direct.expect
index 20bef1d..16a273b 100644
--- a/pkg/front_end/testcases/runtime_checks_new/mixin_forwarding_stub_getter.dart.direct.expect
+++ b/pkg/front_end/testcases/runtime_checks_new/mixin_forwarding_stub_getter.dart.direct.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-typedef F<T extends core::Object> = (T) → void;
+typedef F<T extends core::Object = dynamic> = (T) → void;
class B extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
@@ -14,14 +14,14 @@
throw "Should not be reached";
}
}
-abstract class I<T extends core::Object> extends core::Object {
+abstract class I<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
abstract get x() → (self::I::T) → void;
abstract set x(core::Object value) → void;
}
-abstract class M<T extends core::Object> extends core::Object {
+abstract class M<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
@@ -32,7 +32,7 @@
}
abstract method f() → self::M::T;
}
-abstract class C<T extends core::Object> = self::B with self::M<(self::C::T) → void> implements self::I<self::C::T> {
+abstract class C<T extends core::Object = dynamic> = self::B with self::M<(self::C::T) → void> implements self::I<self::C::T> {
synthetic constructor •() → void
: super self::B::•()
;
diff --git a/pkg/front_end/testcases/runtime_checks_new/mixin_forwarding_stub_getter.dart.direct.transformed.expect b/pkg/front_end/testcases/runtime_checks_new/mixin_forwarding_stub_getter.dart.direct.transformed.expect
index f43208c..92d7a50 100644
--- a/pkg/front_end/testcases/runtime_checks_new/mixin_forwarding_stub_getter.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/runtime_checks_new/mixin_forwarding_stub_getter.dart.direct.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-typedef F<T extends core::Object> = (T) → void;
+typedef F<T extends core::Object = dynamic> = (T) → void;
class B extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
@@ -14,14 +14,14 @@
throw "Should not be reached";
}
}
-abstract class I<T extends core::Object> extends core::Object {
+abstract class I<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
abstract get x() → (self::I::T) → void;
abstract set x(core::Object value) → void;
}
-abstract class M<T extends core::Object> extends core::Object {
+abstract class M<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
@@ -32,7 +32,7 @@
}
abstract method f() → self::M::T;
}
-abstract class C<T extends core::Object> extends self::B implements self::I<self::C::T>, self::M<(self::C::T) → void> {
+abstract class C<T extends core::Object = dynamic> extends self::B implements self::I<self::C::T>, self::M<(self::C::T) → void> {
synthetic constructor •() → void
: super self::B::•()
;
diff --git a/pkg/front_end/testcases/runtime_checks_new/mixin_forwarding_stub_getter.dart.outline.expect b/pkg/front_end/testcases/runtime_checks_new/mixin_forwarding_stub_getter.dart.outline.expect
index 95b1dc0..6ce8632 100644
--- a/pkg/front_end/testcases/runtime_checks_new/mixin_forwarding_stub_getter.dart.outline.expect
+++ b/pkg/front_end/testcases/runtime_checks_new/mixin_forwarding_stub_getter.dart.outline.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-typedef F<T extends core::Object> = (T) → void;
+typedef F<T extends core::Object = dynamic> = (T) → void;
class B extends core::Object {
synthetic constructor •() → void
;
@@ -11,13 +11,13 @@
set x(core::Object value) → void
;
}
-abstract class I<T extends core::Object> extends core::Object {
+abstract class I<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
;
abstract get x() → (self::I::T) → void;
abstract set x(core::Object value) → void;
}
-abstract class M<T extends core::Object> extends core::Object {
+abstract class M<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
;
get x() → self::M::T
@@ -26,7 +26,7 @@
;
abstract method f() → self::M::T;
}
-abstract class C<T extends core::Object> = self::B with self::M<(self::C::T) → void> implements self::I<self::C::T> {
+abstract class C<T extends core::Object = dynamic> = self::B with self::M<(self::C::T) → void> implements self::I<self::C::T> {
synthetic constructor •() → void
: super self::B::•()
;
diff --git a/pkg/front_end/testcases/runtime_checks_new/mixin_forwarding_stub_getter.dart.strong.expect b/pkg/front_end/testcases/runtime_checks_new/mixin_forwarding_stub_getter.dart.strong.expect
index f3d6139..606c252 100644
--- a/pkg/front_end/testcases/runtime_checks_new/mixin_forwarding_stub_getter.dart.strong.expect
+++ b/pkg/front_end/testcases/runtime_checks_new/mixin_forwarding_stub_getter.dart.strong.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-typedef F<T extends core::Object> = (T) → void;
+typedef F<T extends core::Object = dynamic> = (T) → void;
class B extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
@@ -14,14 +14,14 @@
throw "Should not be reached";
}
}
-abstract class I<T extends core::Object> extends core::Object {
+abstract class I<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
abstract get x() → (self::I::T) → void;
abstract set x(core::Object value) → void;
}
-abstract class M<T extends core::Object> extends core::Object {
+abstract class M<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
@@ -32,7 +32,7 @@
}
abstract method f() → self::M::T;
}
-abstract class C<T extends core::Object> = self::B with self::M<(self::C::T) → void> implements self::I<self::C::T> {
+abstract class C<T extends core::Object = dynamic> = self::B with self::M<(self::C::T) → void> implements self::I<self::C::T> {
synthetic constructor •() → void
: super self::B::•()
;
diff --git a/pkg/front_end/testcases/runtime_checks_new/mixin_forwarding_stub_setter.dart.direct.expect b/pkg/front_end/testcases/runtime_checks_new/mixin_forwarding_stub_setter.dart.direct.expect
index f15e59d..ddda646 100644
--- a/pkg/front_end/testcases/runtime_checks_new/mixin_forwarding_stub_setter.dart.direct.expect
+++ b/pkg/front_end/testcases/runtime_checks_new/mixin_forwarding_stub_setter.dart.direct.expect
@@ -19,7 +19,7 @@
throw "Should not be reached";
}
}
-abstract class I<T extends core::Object> extends core::Object {
+abstract class I<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/runtime_checks_new/mixin_forwarding_stub_setter.dart.direct.transformed.expect b/pkg/front_end/testcases/runtime_checks_new/mixin_forwarding_stub_setter.dart.direct.transformed.expect
index b204ff8..062777f 100644
--- a/pkg/front_end/testcases/runtime_checks_new/mixin_forwarding_stub_setter.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/runtime_checks_new/mixin_forwarding_stub_setter.dart.direct.transformed.expect
@@ -19,7 +19,7 @@
throw "Should not be reached";
}
}
-abstract class I<T extends core::Object> extends core::Object {
+abstract class I<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/runtime_checks_new/mixin_forwarding_stub_setter.dart.outline.expect b/pkg/front_end/testcases/runtime_checks_new/mixin_forwarding_stub_setter.dart.outline.expect
index 27d681e..2bd1d45 100644
--- a/pkg/front_end/testcases/runtime_checks_new/mixin_forwarding_stub_setter.dart.outline.expect
+++ b/pkg/front_end/testcases/runtime_checks_new/mixin_forwarding_stub_setter.dart.outline.expect
@@ -14,7 +14,7 @@
set y(core::int value) → void
;
}
-abstract class I<T extends core::Object> extends core::Object {
+abstract class I<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
;
abstract get x() → self::I::T;
diff --git a/pkg/front_end/testcases/runtime_checks_new/mixin_forwarding_stub_setter.dart.strong.expect b/pkg/front_end/testcases/runtime_checks_new/mixin_forwarding_stub_setter.dart.strong.expect
index 9fc4e47..77c4077 100644
--- a/pkg/front_end/testcases/runtime_checks_new/mixin_forwarding_stub_setter.dart.strong.expect
+++ b/pkg/front_end/testcases/runtime_checks_new/mixin_forwarding_stub_setter.dart.strong.expect
@@ -19,7 +19,7 @@
throw "Should not be reached";
}
}
-abstract class I<T extends core::Object> extends core::Object {
+abstract class I<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/runtime_checks_new/stub_from_interface_contravariant_from_class.dart.direct.expect b/pkg/front_end/testcases/runtime_checks_new/stub_from_interface_contravariant_from_class.dart.direct.expect
index 8324835..8075c32 100644
--- a/pkg/front_end/testcases/runtime_checks_new/stub_from_interface_contravariant_from_class.dart.direct.expect
+++ b/pkg/front_end/testcases/runtime_checks_new/stub_from_interface_contravariant_from_class.dart.direct.expect
@@ -2,20 +2,20 @@
import self as self;
import "dart:core" as core;
-typedef F<T extends core::Object> = (T) → void;
-class B<T extends core::Object> extends core::Object {
+typedef F<T extends core::Object = dynamic> = (T) → void;
+class B<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
method f(core::int x) → self::B::T {}
}
-abstract class I<T extends core::Object> extends core::Object {
+abstract class I<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
abstract method f(core::Object x) → self::I::T;
}
-class C<T extends core::Object> extends self::B<(self::C::T) → void> implements self::I<(self::C::T) → void> {
+class C<T extends core::Object = dynamic> extends self::B<(self::C::T) → void> implements self::I<(self::C::T) → void> {
synthetic constructor •() → void
: super self::B::•()
;
diff --git a/pkg/front_end/testcases/runtime_checks_new/stub_from_interface_contravariant_from_class.dart.direct.transformed.expect b/pkg/front_end/testcases/runtime_checks_new/stub_from_interface_contravariant_from_class.dart.direct.transformed.expect
index 8324835..8075c32 100644
--- a/pkg/front_end/testcases/runtime_checks_new/stub_from_interface_contravariant_from_class.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/runtime_checks_new/stub_from_interface_contravariant_from_class.dart.direct.transformed.expect
@@ -2,20 +2,20 @@
import self as self;
import "dart:core" as core;
-typedef F<T extends core::Object> = (T) → void;
-class B<T extends core::Object> extends core::Object {
+typedef F<T extends core::Object = dynamic> = (T) → void;
+class B<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
method f(core::int x) → self::B::T {}
}
-abstract class I<T extends core::Object> extends core::Object {
+abstract class I<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
abstract method f(core::Object x) → self::I::T;
}
-class C<T extends core::Object> extends self::B<(self::C::T) → void> implements self::I<(self::C::T) → void> {
+class C<T extends core::Object = dynamic> extends self::B<(self::C::T) → void> implements self::I<(self::C::T) → void> {
synthetic constructor •() → void
: super self::B::•()
;
diff --git a/pkg/front_end/testcases/runtime_checks_new/stub_from_interface_contravariant_from_class.dart.outline.expect b/pkg/front_end/testcases/runtime_checks_new/stub_from_interface_contravariant_from_class.dart.outline.expect
index ea24f69..9da9feb 100644
--- a/pkg/front_end/testcases/runtime_checks_new/stub_from_interface_contravariant_from_class.dart.outline.expect
+++ b/pkg/front_end/testcases/runtime_checks_new/stub_from_interface_contravariant_from_class.dart.outline.expect
@@ -2,19 +2,19 @@
import self as self;
import "dart:core" as core;
-typedef F<T extends core::Object> = (T) → void;
-class B<T extends core::Object> extends core::Object {
+typedef F<T extends core::Object = dynamic> = (T) → void;
+class B<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
;
method f(core::int x) → self::B::T
;
}
-abstract class I<T extends core::Object> extends core::Object {
+abstract class I<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
;
abstract method f(core::Object x) → self::I::T;
}
-class C<T extends core::Object> extends self::B<(self::C::T) → void> implements self::I<(self::C::T) → void> {
+class C<T extends core::Object = dynamic> extends self::B<(self::C::T) → void> implements self::I<(self::C::T) → void> {
synthetic constructor •() → void
;
}
diff --git a/pkg/front_end/testcases/runtime_checks_new/stub_from_interface_contravariant_from_class.dart.strong.expect b/pkg/front_end/testcases/runtime_checks_new/stub_from_interface_contravariant_from_class.dart.strong.expect
index fde8b6f..d78be9f 100644
--- a/pkg/front_end/testcases/runtime_checks_new/stub_from_interface_contravariant_from_class.dart.strong.expect
+++ b/pkg/front_end/testcases/runtime_checks_new/stub_from_interface_contravariant_from_class.dart.strong.expect
@@ -2,20 +2,20 @@
import self as self;
import "dart:core" as core;
-typedef F<T extends core::Object> = (T) → void;
-class B<T extends core::Object> extends core::Object {
+typedef F<T extends core::Object = dynamic> = (T) → void;
+class B<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
method f(core::int x) → self::B::T {}
}
-abstract class I<T extends core::Object> extends core::Object {
+abstract class I<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
abstract method f(core::Object x) → self::I::T;
}
-class C<T extends core::Object> extends self::B<(self::C::T) → void> implements self::I<(self::C::T) → void> {
+class C<T extends core::Object = dynamic> extends self::B<(self::C::T) → void> implements self::I<(self::C::T) → void> {
synthetic constructor •() → void
: super self::B::•()
;
diff --git a/pkg/front_end/testcases/runtime_checks_new/stub_from_interface_covariantImpl_from_class.dart.direct.expect b/pkg/front_end/testcases/runtime_checks_new/stub_from_interface_covariantImpl_from_class.dart.direct.expect
index 1d29587..a267375 100644
--- a/pkg/front_end/testcases/runtime_checks_new/stub_from_interface_covariantImpl_from_class.dart.direct.expect
+++ b/pkg/front_end/testcases/runtime_checks_new/stub_from_interface_covariantImpl_from_class.dart.direct.expect
@@ -2,20 +2,20 @@
import self as self;
import "dart:core" as core;
-typedef F<T extends core::Object> = (T) → void;
-class B<T extends core::Object> extends core::Object {
+typedef F<T extends core::Object = dynamic> = (T) → void;
+class B<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
method f((self::B::T) → void x, core::int y) → void {}
}
-abstract class I<T extends core::Object> extends core::Object {
+abstract class I<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
abstract method f((self::I::T) → void x, core::Object y) → void;
}
-class C<T extends core::Object> extends self::B<(self::C::T) → void> implements self::I<(self::C::T) → void> {
+class C<T extends core::Object = dynamic> extends self::B<(self::C::T) → void> implements self::I<(self::C::T) → void> {
synthetic constructor •() → void
: super self::B::•()
;
diff --git a/pkg/front_end/testcases/runtime_checks_new/stub_from_interface_covariantImpl_from_class.dart.direct.transformed.expect b/pkg/front_end/testcases/runtime_checks_new/stub_from_interface_covariantImpl_from_class.dart.direct.transformed.expect
index 1d29587..a267375 100644
--- a/pkg/front_end/testcases/runtime_checks_new/stub_from_interface_covariantImpl_from_class.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/runtime_checks_new/stub_from_interface_covariantImpl_from_class.dart.direct.transformed.expect
@@ -2,20 +2,20 @@
import self as self;
import "dart:core" as core;
-typedef F<T extends core::Object> = (T) → void;
-class B<T extends core::Object> extends core::Object {
+typedef F<T extends core::Object = dynamic> = (T) → void;
+class B<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
method f((self::B::T) → void x, core::int y) → void {}
}
-abstract class I<T extends core::Object> extends core::Object {
+abstract class I<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
abstract method f((self::I::T) → void x, core::Object y) → void;
}
-class C<T extends core::Object> extends self::B<(self::C::T) → void> implements self::I<(self::C::T) → void> {
+class C<T extends core::Object = dynamic> extends self::B<(self::C::T) → void> implements self::I<(self::C::T) → void> {
synthetic constructor •() → void
: super self::B::•()
;
diff --git a/pkg/front_end/testcases/runtime_checks_new/stub_from_interface_covariantImpl_from_class.dart.outline.expect b/pkg/front_end/testcases/runtime_checks_new/stub_from_interface_covariantImpl_from_class.dart.outline.expect
index 3c3e508..6959519 100644
--- a/pkg/front_end/testcases/runtime_checks_new/stub_from_interface_covariantImpl_from_class.dart.outline.expect
+++ b/pkg/front_end/testcases/runtime_checks_new/stub_from_interface_covariantImpl_from_class.dart.outline.expect
@@ -2,19 +2,19 @@
import self as self;
import "dart:core" as core;
-typedef F<T extends core::Object> = (T) → void;
-class B<T extends core::Object> extends core::Object {
+typedef F<T extends core::Object = dynamic> = (T) → void;
+class B<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
;
method f((self::B::T) → void x, core::int y) → void
;
}
-abstract class I<T extends core::Object> extends core::Object {
+abstract class I<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
;
abstract method f((self::I::T) → void x, core::Object y) → void;
}
-class C<T extends core::Object> extends self::B<(self::C::T) → void> implements self::I<(self::C::T) → void> {
+class C<T extends core::Object = dynamic> extends self::B<(self::C::T) → void> implements self::I<(self::C::T) → void> {
synthetic constructor •() → void
;
}
diff --git a/pkg/front_end/testcases/runtime_checks_new/stub_from_interface_covariantImpl_from_class.dart.strong.expect b/pkg/front_end/testcases/runtime_checks_new/stub_from_interface_covariantImpl_from_class.dart.strong.expect
index ee19538..8e34bf3 100644
--- a/pkg/front_end/testcases/runtime_checks_new/stub_from_interface_covariantImpl_from_class.dart.strong.expect
+++ b/pkg/front_end/testcases/runtime_checks_new/stub_from_interface_covariantImpl_from_class.dart.strong.expect
@@ -2,20 +2,20 @@
import self as self;
import "dart:core" as core;
-typedef F<T extends core::Object> = (T) → void;
-class B<T extends core::Object> extends core::Object {
+typedef F<T extends core::Object = dynamic> = (T) → void;
+class B<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
method f((self::B::T) → void x, core::int y) → void {}
}
-abstract class I<T extends core::Object> extends core::Object {
+abstract class I<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
abstract method f((self::I::T) → void x, core::Object y) → void;
}
-class C<T extends core::Object> extends self::B<(self::C::T) → void> implements self::I<(self::C::T) → void> {
+class C<T extends core::Object = dynamic> extends self::B<(self::C::T) → void> implements self::I<(self::C::T) → void> {
synthetic constructor •() → void
: super self::B::•()
;
diff --git a/pkg/front_end/testcases/runtime_checks_new/stub_from_interface_covariantImpl_from_class.dart.strong.transformed.expect b/pkg/front_end/testcases/runtime_checks_new/stub_from_interface_covariantImpl_from_class.dart.strong.transformed.expect
index ee19538..8e34bf3 100644
--- a/pkg/front_end/testcases/runtime_checks_new/stub_from_interface_covariantImpl_from_class.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/runtime_checks_new/stub_from_interface_covariantImpl_from_class.dart.strong.transformed.expect
@@ -2,20 +2,20 @@
import self as self;
import "dart:core" as core;
-typedef F<T extends core::Object> = (T) → void;
-class B<T extends core::Object> extends core::Object {
+typedef F<T extends core::Object = dynamic> = (T) → void;
+class B<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
method f((self::B::T) → void x, core::int y) → void {}
}
-abstract class I<T extends core::Object> extends core::Object {
+abstract class I<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
abstract method f((self::I::T) → void x, core::Object y) → void;
}
-class C<T extends core::Object> extends self::B<(self::C::T) → void> implements self::I<(self::C::T) → void> {
+class C<T extends core::Object = dynamic> extends self::B<(self::C::T) → void> implements self::I<(self::C::T) → void> {
synthetic constructor •() → void
: super self::B::•()
;
diff --git a/pkg/front_end/testcases/runtime_checks_new/stub_from_interface_covariantImpl_from_interface.dart.direct.expect b/pkg/front_end/testcases/runtime_checks_new/stub_from_interface_covariantImpl_from_interface.dart.direct.expect
index fcf58faa..43f51a2 100644
--- a/pkg/front_end/testcases/runtime_checks_new/stub_from_interface_covariantImpl_from_interface.dart.direct.expect
+++ b/pkg/front_end/testcases/runtime_checks_new/stub_from_interface_covariantImpl_from_interface.dart.direct.expect
@@ -8,7 +8,7 @@
;
method f(core::int x, core::int y) → void {}
}
-abstract class I<T extends core::Object> extends core::Object {
+abstract class I<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/runtime_checks_new/stub_from_interface_covariantImpl_from_interface.dart.direct.transformed.expect b/pkg/front_end/testcases/runtime_checks_new/stub_from_interface_covariantImpl_from_interface.dart.direct.transformed.expect
index fcf58faa..43f51a2 100644
--- a/pkg/front_end/testcases/runtime_checks_new/stub_from_interface_covariantImpl_from_interface.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/runtime_checks_new/stub_from_interface_covariantImpl_from_interface.dart.direct.transformed.expect
@@ -8,7 +8,7 @@
;
method f(core::int x, core::int y) → void {}
}
-abstract class I<T extends core::Object> extends core::Object {
+abstract class I<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/runtime_checks_new/stub_from_interface_covariantImpl_from_interface.dart.outline.expect b/pkg/front_end/testcases/runtime_checks_new/stub_from_interface_covariantImpl_from_interface.dart.outline.expect
index 9151bf7..123da75 100644
--- a/pkg/front_end/testcases/runtime_checks_new/stub_from_interface_covariantImpl_from_interface.dart.outline.expect
+++ b/pkg/front_end/testcases/runtime_checks_new/stub_from_interface_covariantImpl_from_interface.dart.outline.expect
@@ -8,7 +8,7 @@
method f(core::int x, core::int y) → void
;
}
-abstract class I<T extends core::Object> extends core::Object {
+abstract class I<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
;
abstract method f(self::I::T x, core::Object y) → void;
diff --git a/pkg/front_end/testcases/runtime_checks_new/stub_from_interface_covariantImpl_from_interface.dart.strong.expect b/pkg/front_end/testcases/runtime_checks_new/stub_from_interface_covariantImpl_from_interface.dart.strong.expect
index 892c2f0..c26770b 100644
--- a/pkg/front_end/testcases/runtime_checks_new/stub_from_interface_covariantImpl_from_interface.dart.strong.expect
+++ b/pkg/front_end/testcases/runtime_checks_new/stub_from_interface_covariantImpl_from_interface.dart.strong.expect
@@ -8,7 +8,7 @@
;
method f(core::int x, core::int y) → void {}
}
-abstract class I<T extends core::Object> extends core::Object {
+abstract class I<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/runtime_checks_new/stub_from_interface_covariantImpl_from_interface.dart.strong.transformed.expect b/pkg/front_end/testcases/runtime_checks_new/stub_from_interface_covariantImpl_from_interface.dart.strong.transformed.expect
index 892c2f0..c26770b 100644
--- a/pkg/front_end/testcases/runtime_checks_new/stub_from_interface_covariantImpl_from_interface.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/runtime_checks_new/stub_from_interface_covariantImpl_from_interface.dart.strong.transformed.expect
@@ -8,7 +8,7 @@
;
method f(core::int x, core::int y) → void {}
}
-abstract class I<T extends core::Object> extends core::Object {
+abstract class I<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/runtime_checks_new/stub_from_interface_covariantImpl_from_super.dart.direct.expect b/pkg/front_end/testcases/runtime_checks_new/stub_from_interface_covariantImpl_from_super.dart.direct.expect
index b2f0239..34a373d 100644
--- a/pkg/front_end/testcases/runtime_checks_new/stub_from_interface_covariantImpl_from_super.dart.direct.expect
+++ b/pkg/front_end/testcases/runtime_checks_new/stub_from_interface_covariantImpl_from_super.dart.direct.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class B<T extends core::Object> extends core::Object {
+class B<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/runtime_checks_new/stub_from_interface_covariantImpl_from_super.dart.direct.transformed.expect b/pkg/front_end/testcases/runtime_checks_new/stub_from_interface_covariantImpl_from_super.dart.direct.transformed.expect
index b2f0239..34a373d 100644
--- a/pkg/front_end/testcases/runtime_checks_new/stub_from_interface_covariantImpl_from_super.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/runtime_checks_new/stub_from_interface_covariantImpl_from_super.dart.direct.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class B<T extends core::Object> extends core::Object {
+class B<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/runtime_checks_new/stub_from_interface_covariantImpl_from_super.dart.outline.expect b/pkg/front_end/testcases/runtime_checks_new/stub_from_interface_covariantImpl_from_super.dart.outline.expect
index a7c73a2..97b15b3 100644
--- a/pkg/front_end/testcases/runtime_checks_new/stub_from_interface_covariantImpl_from_super.dart.outline.expect
+++ b/pkg/front_end/testcases/runtime_checks_new/stub_from_interface_covariantImpl_from_super.dart.outline.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class B<T extends core::Object> extends core::Object {
+class B<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
;
method f(self::B::T x, core::int y) → void
diff --git a/pkg/front_end/testcases/runtime_checks_new/stub_from_interface_covariantImpl_from_super.dart.strong.expect b/pkg/front_end/testcases/runtime_checks_new/stub_from_interface_covariantImpl_from_super.dart.strong.expect
index 37bfc39..79fe012 100644
--- a/pkg/front_end/testcases/runtime_checks_new/stub_from_interface_covariantImpl_from_super.dart.strong.expect
+++ b/pkg/front_end/testcases/runtime_checks_new/stub_from_interface_covariantImpl_from_super.dart.strong.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class B<T extends core::Object> extends core::Object {
+class B<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/runtime_checks_new/stub_from_interface_covariantInterface_from_class.dart.direct.expect b/pkg/front_end/testcases/runtime_checks_new/stub_from_interface_covariantInterface_from_class.dart.direct.expect
index a9dd532..863ae95 100644
--- a/pkg/front_end/testcases/runtime_checks_new/stub_from_interface_covariantInterface_from_class.dart.direct.expect
+++ b/pkg/front_end/testcases/runtime_checks_new/stub_from_interface_covariantInterface_from_class.dart.direct.expect
@@ -2,26 +2,26 @@
import self as self;
import "dart:core" as core;
-typedef F<T extends core::Object> = (T) → void;
-abstract class A<T extends core::Object> extends core::Object {
+typedef F<T extends core::Object = dynamic> = (T) → void;
+abstract class A<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
abstract method f(self::A::T x, core::int y) → void;
}
-class B<T extends core::Object> extends core::Object implements self::A<(self::B::T) → void> {
+class B<T extends core::Object = dynamic> extends core::Object implements self::A<(self::B::T) → void> {
synthetic constructor •() → void
: super core::Object::•()
;
method f((self::B::T) → void x, core::int y) → void {}
}
-abstract class I<T extends core::Object> extends core::Object implements self::A<(self::I::T) → void> {
+abstract class I<T extends core::Object = dynamic> extends core::Object implements self::A<(self::I::T) → void> {
synthetic constructor •() → void
: super core::Object::•()
;
abstract method f((self::I::T) → void x, core::Object y) → void;
}
-class C<T extends core::Object> extends self::B<(self::C::T) → void> implements self::I<(self::C::T) → void> {
+class C<T extends core::Object = dynamic> extends self::B<(self::C::T) → void> implements self::I<(self::C::T) → void> {
synthetic constructor •() → void
: super self::B::•()
;
diff --git a/pkg/front_end/testcases/runtime_checks_new/stub_from_interface_covariantInterface_from_class.dart.direct.transformed.expect b/pkg/front_end/testcases/runtime_checks_new/stub_from_interface_covariantInterface_from_class.dart.direct.transformed.expect
index a9dd532..863ae95 100644
--- a/pkg/front_end/testcases/runtime_checks_new/stub_from_interface_covariantInterface_from_class.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/runtime_checks_new/stub_from_interface_covariantInterface_from_class.dart.direct.transformed.expect
@@ -2,26 +2,26 @@
import self as self;
import "dart:core" as core;
-typedef F<T extends core::Object> = (T) → void;
-abstract class A<T extends core::Object> extends core::Object {
+typedef F<T extends core::Object = dynamic> = (T) → void;
+abstract class A<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
abstract method f(self::A::T x, core::int y) → void;
}
-class B<T extends core::Object> extends core::Object implements self::A<(self::B::T) → void> {
+class B<T extends core::Object = dynamic> extends core::Object implements self::A<(self::B::T) → void> {
synthetic constructor •() → void
: super core::Object::•()
;
method f((self::B::T) → void x, core::int y) → void {}
}
-abstract class I<T extends core::Object> extends core::Object implements self::A<(self::I::T) → void> {
+abstract class I<T extends core::Object = dynamic> extends core::Object implements self::A<(self::I::T) → void> {
synthetic constructor •() → void
: super core::Object::•()
;
abstract method f((self::I::T) → void x, core::Object y) → void;
}
-class C<T extends core::Object> extends self::B<(self::C::T) → void> implements self::I<(self::C::T) → void> {
+class C<T extends core::Object = dynamic> extends self::B<(self::C::T) → void> implements self::I<(self::C::T) → void> {
synthetic constructor •() → void
: super self::B::•()
;
diff --git a/pkg/front_end/testcases/runtime_checks_new/stub_from_interface_covariantInterface_from_class.dart.outline.expect b/pkg/front_end/testcases/runtime_checks_new/stub_from_interface_covariantInterface_from_class.dart.outline.expect
index 9e334f5..723d19c 100644
--- a/pkg/front_end/testcases/runtime_checks_new/stub_from_interface_covariantInterface_from_class.dart.outline.expect
+++ b/pkg/front_end/testcases/runtime_checks_new/stub_from_interface_covariantInterface_from_class.dart.outline.expect
@@ -2,24 +2,24 @@
import self as self;
import "dart:core" as core;
-typedef F<T extends core::Object> = (T) → void;
-abstract class A<T extends core::Object> extends core::Object {
+typedef F<T extends core::Object = dynamic> = (T) → void;
+abstract class A<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
;
abstract method f(self::A::T x, core::int y) → void;
}
-class B<T extends core::Object> extends core::Object implements self::A<(self::B::T) → void> {
+class B<T extends core::Object = dynamic> extends core::Object implements self::A<(self::B::T) → void> {
synthetic constructor •() → void
;
method f((self::B::T) → void x, core::int y) → void
;
}
-abstract class I<T extends core::Object> extends core::Object implements self::A<(self::I::T) → void> {
+abstract class I<T extends core::Object = dynamic> extends core::Object implements self::A<(self::I::T) → void> {
synthetic constructor •() → void
;
abstract method f((self::I::T) → void x, core::Object y) → void;
}
-class C<T extends core::Object> extends self::B<(self::C::T) → void> implements self::I<(self::C::T) → void> {
+class C<T extends core::Object = dynamic> extends self::B<(self::C::T) → void> implements self::I<(self::C::T) → void> {
synthetic constructor •() → void
;
}
diff --git a/pkg/front_end/testcases/runtime_checks_new/stub_from_interface_covariantInterface_from_class.dart.strong.expect b/pkg/front_end/testcases/runtime_checks_new/stub_from_interface_covariantInterface_from_class.dart.strong.expect
index fcb22cdd..ee0c689 100644
--- a/pkg/front_end/testcases/runtime_checks_new/stub_from_interface_covariantInterface_from_class.dart.strong.expect
+++ b/pkg/front_end/testcases/runtime_checks_new/stub_from_interface_covariantInterface_from_class.dart.strong.expect
@@ -2,26 +2,26 @@
import self as self;
import "dart:core" as core;
-typedef F<T extends core::Object> = (T) → void;
-abstract class A<T extends core::Object> extends core::Object {
+typedef F<T extends core::Object = dynamic> = (T) → void;
+abstract class A<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
abstract method f(generic-covariant-impl generic-covariant-interface self::A::T x, core::int y) → void;
}
-class B<T extends core::Object> extends core::Object implements self::A<(self::B::T) → void> {
+class B<T extends core::Object = dynamic> extends core::Object implements self::A<(self::B::T) → void> {
synthetic constructor •() → void
: super core::Object::•()
;
method f(generic-covariant-impl (self::B::T) → void x, core::int y) → void {}
}
-abstract class I<T extends core::Object> extends core::Object implements self::A<(self::I::T) → void> {
+abstract class I<T extends core::Object = dynamic> extends core::Object implements self::A<(self::I::T) → void> {
synthetic constructor •() → void
: super core::Object::•()
;
abstract method f(generic-covariant-impl (self::I::T) → void x, core::Object y) → void;
}
-class C<T extends core::Object> extends self::B<(self::C::T) → void> implements self::I<(self::C::T) → void> {
+class C<T extends core::Object = dynamic> extends self::B<(self::C::T) → void> implements self::I<(self::C::T) → void> {
synthetic constructor •() → void
: super self::B::•()
;
diff --git a/pkg/front_end/testcases/type_variable_as_super.dart.outline.expect b/pkg/front_end/testcases/type_variable_as_super.dart.outline.expect
index a770e2c..5df44e4 100644
--- a/pkg/front_end/testcases/type_variable_as_super.dart.outline.expect
+++ b/pkg/front_end/testcases/type_variable_as_super.dart.outline.expect
@@ -2,15 +2,15 @@
import self as self;
import "dart:core" as core;
-abstract class A<T extends core::Object> extends core::Object {
+abstract class A<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
;
}
-abstract class B<T extends core::Object> extends core::Object {
+abstract class B<T extends core::Object = dynamic> extends core::Object {
constructor •() → void
;
}
-class C<T extends core::Object> extends core::Object {
+class C<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
;
}
diff --git a/pkg/front_end/testcases/type_variable_prefix.dart.direct.expect b/pkg/front_end/testcases/type_variable_prefix.dart.direct.expect
index b588a3e..515d754 100644
--- a/pkg/front_end/testcases/type_variable_prefix.dart.direct.expect
+++ b/pkg/front_end/testcases/type_variable_prefix.dart.direct.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class C<T extends core::Object> extends core::Object {
+class C<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/type_variable_prefix.dart.direct.transformed.expect b/pkg/front_end/testcases/type_variable_prefix.dart.direct.transformed.expect
index b588a3e..515d754 100644
--- a/pkg/front_end/testcases/type_variable_prefix.dart.direct.transformed.expect
+++ b/pkg/front_end/testcases/type_variable_prefix.dart.direct.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class C<T extends core::Object> extends core::Object {
+class C<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/type_variable_prefix.dart.outline.expect b/pkg/front_end/testcases/type_variable_prefix.dart.outline.expect
index 6447b5b..be7fb5e 100644
--- a/pkg/front_end/testcases/type_variable_prefix.dart.outline.expect
+++ b/pkg/front_end/testcases/type_variable_prefix.dart.outline.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class C<T extends core::Object> extends core::Object {
+class C<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
;
method method() → invalid-type
diff --git a/pkg/front_end/testcases/type_variable_prefix.dart.strong.expect b/pkg/front_end/testcases/type_variable_prefix.dart.strong.expect
index 862b7b7..52774b2 100644
--- a/pkg/front_end/testcases/type_variable_prefix.dart.strong.expect
+++ b/pkg/front_end/testcases/type_variable_prefix.dart.strong.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class C<T extends core::Object> extends core::Object {
+class C<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/testcases/type_variable_prefix.dart.strong.transformed.expect b/pkg/front_end/testcases/type_variable_prefix.dart.strong.transformed.expect
index bd3a6bd..c26c47a 100644
--- a/pkg/front_end/testcases/type_variable_prefix.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/type_variable_prefix.dart.strong.transformed.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class C<T extends core::Object> extends core::Object {
+class C<T extends core::Object = dynamic> extends core::Object {
synthetic constructor •() → void
: super core::Object::•()
;
diff --git a/pkg/front_end/tool/_fasta/compile_platform.dart b/pkg/front_end/tool/_fasta/compile_platform.dart
index 7dcf8b4..58cd0ce 100644
--- a/pkg/front_end/tool/_fasta/compile_platform.dart
+++ b/pkg/front_end/tool/_fasta/compile_platform.dart
@@ -11,7 +11,7 @@
import 'package:compiler/src/kernel/dart2js_target.dart' show Dart2jsTarget;
import 'package:vm/bytecode/gen_bytecode.dart'
- show generateBytecode, kEnableKernelBytecodeForPlatform;
+ show generateBytecode, isKernelBytecodeEnabledForPlatform;
import 'package:vm/target/dart_runner.dart' show DartRunnerTarget;
@@ -89,7 +89,7 @@
new File.fromUri(outlineOutput).writeAsBytesSync(result.summary);
c.options.ticker.logMs("Wrote outline to ${outlineOutput.toFilePath()}");
- if (kEnableKernelBytecodeForPlatform) {
+ if (isKernelBytecodeEnabledForPlatform) {
generateBytecode(result.component, strongMode: c.options.strongMode);
}
diff --git a/pkg/kernel/binary.md b/pkg/kernel/binary.md
index ba13f5c..0af9f95 100644
--- a/pkg/kernel/binary.md
+++ b/pkg/kernel/binary.md
@@ -42,6 +42,8 @@
type UInt32 = big endian 32-bit unsigned integer
+type Double = Double-precision floating-point number.
+
type List<T> {
UInt length;
T[length] items;
@@ -711,7 +713,7 @@
type DoubleLiteral extends Expression {
Byte tag = 40;
- StringReference valueString;
+ Double value;
}
type TrueLiteral extends Expression {
@@ -874,7 +876,7 @@
type DoubleConstant extends Constant {
Byte tag = 3;
- StringReference value;
+ Double value;
}
type StringConstant extends Constant {
diff --git a/pkg/kernel/lib/binary/ast_from_binary.dart b/pkg/kernel/lib/binary/ast_from_binary.dart
index d9e61cc..4ff4a37 100644
--- a/pkg/kernel/lib/binary/ast_from_binary.dart
+++ b/pkg/kernel/lib/binary/ast_from_binary.dart
@@ -97,6 +97,22 @@
readByte();
}
+ final Float64List _doubleBuffer = new Float64List(1);
+ Uint8List _doubleBufferUint8;
+
+ double readDouble() {
+ _doubleBufferUint8 ??= _doubleBuffer.buffer.asUint8List();
+ _doubleBufferUint8[0] = readByte();
+ _doubleBufferUint8[1] = readByte();
+ _doubleBufferUint8[2] = readByte();
+ _doubleBufferUint8[3] = readByte();
+ _doubleBufferUint8[4] = readByte();
+ _doubleBufferUint8[5] = readByte();
+ _doubleBufferUint8[6] = readByte();
+ _doubleBufferUint8[7] = readByte();
+ return _doubleBuffer[0];
+ }
+
List<int> readByteList() {
List<int> bytes = new Uint8List(readUInt());
bytes.setRange(0, bytes.length, _bytes, _byteOffset);
@@ -174,7 +190,7 @@
case ConstantTag.IntConstant:
return new IntConstant((readExpression() as IntLiteral).value);
case ConstantTag.DoubleConstant:
- return new DoubleConstant(double.parse(readStringReference()));
+ return new DoubleConstant(readDouble());
case ConstantTag.StringConstant:
return new StringConstant(readStringReference());
case ConstantTag.MapConstant:
@@ -1333,7 +1349,7 @@
case Tag.BigIntLiteral:
return new IntLiteral(int.parse(readStringReference()));
case Tag.DoubleLiteral:
- return new DoubleLiteral(double.parse(readStringReference()));
+ return new DoubleLiteral(readDouble());
case Tag.TrueLiteral:
return new BoolLiteral(true);
case Tag.FalseLiteral:
diff --git a/pkg/kernel/lib/binary/ast_to_binary.dart b/pkg/kernel/lib/binary/ast_to_binary.dart
index adb16a0..a65dd03 100644
--- a/pkg/kernel/lib/binary/ast_to_binary.dart
+++ b/pkg/kernel/lib/binary/ast_to_binary.dart
@@ -147,7 +147,7 @@
writeInteger(constant.value);
} else if (constant is DoubleConstant) {
writeByte(ConstantTag.DoubleConstant);
- writeStringReference('${constant.value}');
+ writeDouble(constant.value);
} else if (constant is StringConstant) {
writeByte(ConstantTag.StringConstant);
writeStringReference(constant.value);
@@ -1238,13 +1238,12 @@
@override
void visitDoubleLiteral(DoubleLiteral node) {
+ writeByte(Tag.DoubleLiteral);
writeDouble(node.value);
}
writeDouble(double value) {
- // TODO: Pick a better format for double literals.
- writeByte(Tag.DoubleLiteral);
- writeStringReference('$value');
+ _sink.addDouble(value);
}
@override
@@ -2190,8 +2189,20 @@
int length = 0;
int flushedLength = 0;
+ Float64List _doubleBuffer = new Float64List(1);
+ Uint8List _doubleBufferUint8;
+
BufferedSink(this._sink);
+ void addDouble(double d) {
+ _doubleBufferUint8 ??= _doubleBuffer.buffer.asUint8List();
+ _doubleBuffer[0] = d;
+ addByte4(_doubleBufferUint8[0], _doubleBufferUint8[1],
+ _doubleBufferUint8[2], _doubleBufferUint8[3]);
+ addByte4(_doubleBufferUint8[4], _doubleBufferUint8[5],
+ _doubleBufferUint8[6], _doubleBufferUint8[7]);
+ }
+
void addByte(int byte) {
_buffer[length++] = byte;
if (length == SIZE) {
diff --git a/pkg/kernel/lib/target/targets.dart b/pkg/kernel/lib/target/targets.dart
index ec9a8aa..1f49bf5 100644
--- a/pkg/kernel/lib/target/targets.dart
+++ b/pkg/kernel/lib/target/targets.dart
@@ -153,6 +153,15 @@
void performGlobalTransformations(CoreTypes coreTypes, Component component,
{void logger(String msg)});
+ /// Perform target-specific modular transformations on the given program.
+ ///
+ /// This is used when an individual expression is compiled, e.g. for debugging
+ /// purposes. It is illegal to modify any of the enclosing nodes of the
+ /// procedure.
+ void performTransformationsOnProcedure(
+ CoreTypes coreTypes, ClassHierarchy hierarchy, Procedure procedure,
+ {void logger(String msg)}) {}
+
/// Whether a platform library may define a restricted type, such as `bool`,
/// `int`, `double`, `num`, and `String`.
///
diff --git a/pkg/kernel/lib/target/vm.dart b/pkg/kernel/lib/target/vm.dart
index 322d2c5..e79a78c 100644
--- a/pkg/kernel/lib/target/vm.dart
+++ b/pkg/kernel/lib/target/vm.dart
@@ -12,7 +12,7 @@
import '../transformations/mixin_full_resolution.dart' as transformMixins
show transformLibraries;
import '../transformations/continuation.dart' as transformAsync
- show transformLibraries;
+ show transformLibraries, transformProcedure;
import 'targets.dart';
@@ -75,6 +75,14 @@
{void logger(String msg)}) {}
@override
+ void performTransformationsOnProcedure(
+ CoreTypes coreTypes, ClassHierarchy hierarchy, Procedure procedure,
+ {void logger(String msg)}) {
+ transformAsync.transformProcedure(coreTypes, procedure, flags.syncAsync);
+ logger?.call("Transformed async functions");
+ }
+
+ @override
Expression instantiateInvocation(CoreTypes coreTypes, Expression receiver,
String name, Arguments arguments, int offset, bool isSuper) {
// See [_InvocationMirror]
diff --git a/pkg/meta/CHANGELOG.md b/pkg/meta/CHANGELOG.md
index 12ec383..ed639d0 100644
--- a/pkg/meta/CHANGELOG.md
+++ b/pkg/meta/CHANGELOG.md
@@ -1,3 +1,8 @@
+## 1.1.5
+
+* Introduce @isTest and @isTestGroup to declare a function that is a
+ test, or a test group.
+
## 1.1.4
* Added dart2js.dart.
@@ -7,9 +12,11 @@
* Rollback SDK constraint update for 2.0.0. No longer needed.
## 1.1.1
+
* Update SDK constraint to be 2.0.0 dev friendly.
## 1.1.0
+
* Introduce `@alwaysThrows` to declare that a function always throws
(SDK issue [17999](https://github.com/dart-lang/sdk/issues/17999)). This
is first available in Dart SDK 1.25.0-dev.1.0.
@@ -33,6 +40,7 @@
```
## 1.0.5
+
* Introduce `@experimental` to annotate a library, or any declaration that is
part of the public interface of a library (such as top-level members, class
members, and function parameters) to indicate that the annotated API is
@@ -41,6 +49,7 @@
be a breaking change.
## 1.0.4
+
* Introduce `@virtual` to allow field overrides in strong mode
(SDK issue [27384](https://github.com/dart-lang/sdk/issues/27384)).
@@ -59,6 +68,7 @@
```
## 1.0.3
+
* Introduce `@checked` to override a method and tighten a parameter
type (SDK issue [25578](https://github.com/dart-lang/sdk/issues/25578)).
@@ -79,34 +89,42 @@
```
## 1.0.2
+
* Introduce `@visibleForTesting` annotation for declarations that may be referenced only in the library or in a test.
## 1.0.1
+
* Updated `@factory` to allow statics and methods returning `null`.
## 1.0.0
+
* First stable API release.
## 0.12.2
+
* Updated `@protected` to include implemented interfaces (linter#252).
## 0.12.1
+
* Fixed markdown in dartdocs.
## 0.12.0
+
* Introduce `@optionalTypeArgs` annotation for classes whose type arguments are to be treated as optional.
## 0.11.0
+
* Added new `Required` constructor with a means to specify a reason to explain why a parameter is required.
## 0.10.0
-* Introduce `@factory` annotation for methods that must either be abstract or
-must return a newly allocated object.
+
+* Introduce `@factory` annotation for methods that must either be abstract or must return a newly allocated object.
* Introduce `@literal` annotation that indicates that any invocation of a
constructor must use the keyword `const` unless one or more of the
arguments to the constructor is not a compile-time constant.
## 0.9.0
+
* Introduce `@protected` annotation for members that must only be called from
instance members of subclasses.
* Introduce `@required` annotation for optional parameters that should be treated
diff --git a/pkg/meta/pubspec.yaml b/pkg/meta/pubspec.yaml
index ae9a123..73e1dfd 100644
--- a/pkg/meta/pubspec.yaml
+++ b/pkg/meta/pubspec.yaml
@@ -1,5 +1,5 @@
name: meta
-version: 1.1.4
+version: 1.1.5
author: Dart Team <misc@dartlang.org>
homepage: https://github.com/dart-lang/sdk/tree/master/pkg/meta
description: >
diff --git a/pkg/testing/lib/src/stdio_process.dart b/pkg/testing/lib/src/stdio_process.dart
index 1004a59..72b534a 100644
--- a/pkg/testing/lib/src/stdio_process.dart
+++ b/pkg/testing/lib/src/stdio_process.dart
@@ -60,7 +60,7 @@
process.kill();
timer = new Timer(const Duration(seconds: 10), () {
sb.writeln("Sending SIGKILL to process");
- process.kill(ProcessSignal.SIGKILL);
+ process.kill(ProcessSignal.sigkill);
});
});
}
diff --git a/pkg/vm/bin/gen_kernel.dart b/pkg/vm/bin/gen_kernel.dart
index d845a2d..0a2e4a2 100644
--- a/pkg/vm/bin/gen_kernel.dart
+++ b/pkg/vm/bin/gen_kernel.dart
@@ -14,7 +14,7 @@
import 'package:kernel/target/vm.dart' show VmTarget;
import 'package:kernel/text/ast_to_text.dart'
show globalDebuggingNames, NameSystem;
-import 'package:vm/bytecode/gen_bytecode.dart' show kEnableKernelBytecode;
+import 'package:vm/bytecode/gen_bytecode.dart' show isKernelBytecodeEnabled;
import 'package:vm/kernel_front_end.dart' show compileToKernel, ErrorDetector;
final ArgParser _argParser = new ArgParser(allowTrailingOptions: true)
@@ -39,7 +39,7 @@
..addMultiOption('entry-points',
help: 'Path to JSON file with the list of entry points')
..addFlag('gen-bytecode',
- help: 'Generate bytecode', defaultsTo: kEnableKernelBytecode);
+ help: 'Generate bytecode', defaultsTo: isKernelBytecodeEnabled);
final String _usage = '''
Usage: dart pkg/vm/bin/gen_kernel.dart --platform vm_platform_strong.dill [options] input.dart
diff --git a/pkg/vm/bin/kernel_service.dart b/pkg/vm/bin/kernel_service.dart
index ef4c8ef..329b554 100644
--- a/pkg/vm/bin/kernel_service.dart
+++ b/pkg/vm/bin/kernel_service.dart
@@ -32,7 +32,7 @@
import 'package:front_end/src/compute_platform_binaries_location.dart'
show computePlatformBinariesLocation;
import 'package:front_end/src/fasta/kernel/utils.dart';
-import 'package:front_end/src/testing/hybrid_file_system.dart';
+import 'package:front_end/src/fasta/hybrid_file_system.dart';
import 'package:kernel/kernel.dart' show Component;
import 'package:kernel/target/targets.dart' show TargetFlags;
import 'package:kernel/target/vm.dart' show VmTarget;
diff --git a/pkg/vm/bin/run_binary_size_analysis.dart b/pkg/vm/bin/run_binary_size_analysis.dart
index 512e56f..4a63676 100644
--- a/pkg/vm/bin/run_binary_size_analysis.dart
+++ b/pkg/vm/bin/run_binary_size_analysis.dart
@@ -122,7 +122,7 @@
node['t'] = symbolTypeGlobalText;
node['value'] = size;
depth += 2;
- root['maxDepth'] = max(root['maxDepth'], depth);
+ root['maxDepth'] = max<int>(root['maxDepth'], depth);
}
/// Convert all children entries from maps to lists.
diff --git a/pkg/vm/lib/bytecode/constant_pool.dart b/pkg/vm/lib/bytecode/constant_pool.dart
index 25da76d..958c7c6 100644
--- a/pkg/vm/lib/bytecode/constant_pool.dart
+++ b/pkg/vm/lib/bytecode/constant_pool.dart
@@ -397,8 +397,8 @@
'ArgDesc num-args $numArguments, num-type-args $numTypeArgs, names $argNames';
@override
- int get hashCode =>
- (numArguments * 31 + numTypeArgs) * 31 + listHashCode(argNames);
+ int get hashCode => _combineHashes(
+ _combineHashes(numArguments, numTypeArgs), listHashCode(argNames));
@override
bool operator ==(other) =>
@@ -770,9 +770,9 @@
new MapEntry(fieldRef.asField.name.name, valueIndex))}';
@override
- int get hashCode =>
- (classNode.hashCode * 31 + _typeArgumentsConstantIndex) * 31 +
- mapHashCode(_fieldValues);
+ int get hashCode => _combineHashes(
+ _combineHashes(classNode.hashCode, _typeArgumentsConstantIndex),
+ mapHashCode(_fieldValues));
@override
bool operator ==(other) =>
@@ -844,7 +844,7 @@
@override
int get hashCode =>
- instantiatingClass.hashCode * 31 + _typeArgumentsConstantIndex;
+ _combineHashes(instantiatingClass.hashCode, _typeArgumentsConstantIndex);
@override
bool operator ==(other) =>
@@ -893,3 +893,6 @@
return sb.toString();
}
}
+
+int _combineHashes(int hash1, int hash2) =>
+ (((hash1 * 31) & 0x3fffffff) + hash2) & 0x3fffffff;
diff --git a/pkg/vm/lib/bytecode/gen_bytecode.dart b/pkg/vm/lib/bytecode/gen_bytecode.dart
index 3763ecc..c51cf1f 100644
--- a/pkg/vm/lib/bytecode/gen_bytecode.dart
+++ b/pkg/vm/lib/bytecode/gen_bytecode.dart
@@ -20,12 +20,12 @@
import 'package:vm/metadata/bytecode.dart';
/// Flag to toggle generation of bytecode in kernel files.
-const bool kEnableKernelBytecode = false;
+const bool isKernelBytecodeEnabled = false;
/// Flag to toggle generation of bytecode in platform kernel files.
-const bool kEnableKernelBytecodeForPlatform = kEnableKernelBytecode;
+const bool isKernelBytecodeEnabledForPlatform = isKernelBytecodeEnabled;
-const bool kTrace = false;
+const bool isTraceEnabled = false;
void generateBytecode(Component component, {bool strongMode: true}) {
final coreTypes = new CoreTypes(component);
@@ -114,7 +114,7 @@
end(node);
}
} on UnsupportedOperationError catch (e) {
- if (kTrace) {
+ if (isTraceEnabled) {
print('Unable to generate bytecode for $node: $e');
}
}
@@ -382,7 +382,7 @@
enclosingMember = null;
enclosingClass = null;
metadata.mapping[node] = new BytecodeMetadata(asm.bytecode, cp);
- if (kTrace) {
+ if (isTraceEnabled) {
print('Generated bytecode for $node');
}
}
diff --git a/pkg/vm/lib/transformations/type_flow/analysis.dart b/pkg/vm/lib/transformations/type_flow/analysis.dart
index 99a885c..71ee83e 100644
--- a/pkg/vm/lib/transformations/type_flow/analysis.dart
+++ b/pkg/vm/lib/transformations/type_flow/analysis.dart
@@ -7,6 +7,7 @@
import 'dart:collection';
import 'dart:core' hide Type;
+import 'dart:math' show max;
import 'package:kernel/ast.dart' hide Statement, StatementVisitor;
import 'package:kernel/class_hierarchy.dart' show ClosedWorldClassHierarchy;
@@ -55,6 +56,12 @@
void invalidateDependentInvocations(_WorkList workList) {
if (_dependentInvocations != null) {
+ if (kPrintTrace) {
+ tracePrint(' - CHANGED: $this');
+ for (var di in _dependentInvocations) {
+ tracePrint(' - invalidating $di');
+ }
+ }
_dependentInvocations.forEach(workList.invalidateInvocation);
}
}
@@ -77,6 +84,13 @@
/// result or not (to avoid invalidation of callers if result hasn't changed).
Type invalidatedResult;
+ /// Number of times result of this invocation was invalidated.
+ int invalidationCounter = 0;
+
+ /// If an invocation is invalidated more than [invalidationLimit] times,
+ /// its result is saturated in order to guarantee convergence.
+ static const int invalidationLimit = 1000;
+
Type process(TypeFlowAnalysis typeFlowAnalysis);
_Invocation(this.selector, this.args);
@@ -320,6 +334,9 @@
.getInvocation(directSelector, directArgs);
type = typeFlowAnalysis.workList.processInvocation(directInvocation);
+ if (kPrintTrace) {
+ tracePrint('Dispatch: $directInvocation, result: $type');
+ }
// Result of this invocation depends on the results of direct
// invocations corresponding to each target.
@@ -672,7 +689,9 @@
newValue.intersection(staticType, typeFlowAnalysis.hierarchyCache),
typeFlowAnalysis.hierarchyCache);
if (newType != value) {
- tracePrint("Set field $field value $newType");
+ if (kPrintTrace) {
+ tracePrint("Set field $field value $newType");
+ }
invalidateDependentInvocations(typeFlowAnalysis.workList);
value = newType;
}
@@ -866,7 +885,9 @@
@override
Type specializeTypeCone(DartType base) {
- tracePrint("specializeTypeCone for $base");
+ if (kPrintTrace) {
+ tracePrint("specializeTypeCone for $base");
+ }
Statistics.typeConeSpecializations++;
// TODO(alexmarkov): handle function types properly
@@ -1009,7 +1030,7 @@
callStack.add(invocation);
pending.remove(invocation);
- final Type result = invocation.process(_typeFlowAnalysis);
+ Type result = invocation.process(_typeFlowAnalysis);
assertx(result != null);
invocation.result = result;
@@ -1017,6 +1038,21 @@
if (invocation.invalidatedResult != null) {
if (invocation.invalidatedResult != result) {
invocation.invalidateDependentInvocations(this);
+
+ invocation.invalidationCounter++;
+ Statistics.maxInvalidationsPerInvocation = max(
+ Statistics.maxInvalidationsPerInvocation,
+ invocation.invalidationCounter);
+ // In rare cases, loops in dependencies and approximation of
+ // recursive invocations may cause infinite bouncing of result
+ // types. To prevent infinite looping and guarantee convergence of
+ // the analysis, result is saturated after invocation is invalidated
+ // at least [_Invocation.invalidationLimit] times.
+ if (invocation.invalidationCounter > _Invocation.invalidationLimit) {
+ result = result.union(
+ invocation.invalidatedResult, _typeFlowAnalysis.hierarchyCache);
+ invocation.result = result;
+ }
}
invocation.invalidatedResult = null;
}
@@ -1034,14 +1070,20 @@
processing.remove(invocation);
Statistics.invocationsProcessed++;
+ if (kPrintTrace) {
+ tracePrint('END PROCESSING $invocation, RESULT $result');
+ }
return result;
} else {
// Recursive invocation, approximate with static type.
Statistics.recursiveInvocationsApproximated++;
final staticType =
new Type.fromStatic(invocation.selector.staticReturnType);
- tracePrint(
- "Approximated recursive invocation with static type $staticType");
+ if (kPrintTrace) {
+ tracePrint(
+ "Approximated recursive invocation with static type $staticType");
+ tracePrint('END PROCESSING $invocation, RESULT $staticType');
+ }
return staticType;
}
}
@@ -1145,7 +1187,9 @@
@override
void addRawCall(Selector selector) {
- debugPrint("ADD RAW CALL: $selector");
+ if (kPrintDebug) {
+ debugPrint("ADD RAW CALL: $selector");
+ }
assertx(selector is! DynamicSelector); // TODO(alexmarkov)
applyCall(null, selector, summaryCollector.rawArguments(selector),
@@ -1154,7 +1198,9 @@
@override
ConcreteType addAllocatedClass(Class c) {
- debugPrint("ADD ALLOCATED CLASS: $c");
+ if (kPrintDebug) {
+ debugPrint("ADD ALLOCATED CLASS: $c");
+ }
return hierarchyCache.addAllocatedClass(c);
}
}
diff --git a/pkg/vm/lib/transformations/type_flow/utils.dart b/pkg/vm/lib/transformations/type_flow/utils.dart
index 95e4467..de0d7a0 100644
--- a/pkg/vm/lib/transformations/type_flow/utils.dart
+++ b/pkg/vm/lib/transformations/type_flow/utils.dart
@@ -75,6 +75,7 @@
static int invocationsProcessed = 0;
static int usedCachedResultsOfInvocations = 0;
static int invocationsInvalidated = 0;
+ static int maxInvalidationsPerInvocation = 0;
static int recursiveInvocationsApproximated = 0;
static int typeConeSpecializations = 0;
static int classesDropped = 0;
@@ -93,6 +94,7 @@
invocationsProcessed = 0;
usedCachedResultsOfInvocations = 0;
invocationsInvalidated = 0;
+ maxInvalidationsPerInvocation = 0;
recursiveInvocationsApproximated = 0;
typeConeSpecializations = 0;
classesDropped = 0;
@@ -112,6 +114,7 @@
${invocationsProcessed} invocations processed
${usedCachedResultsOfInvocations} times cached result of invocation is used
${invocationsInvalidated} invocations invalidated
+ ${maxInvalidationsPerInvocation} maximum invalidations per invocation
${recursiveInvocationsApproximated} recursive invocations approximated
${typeConeSpecializations} type cones specialized
${classesDropped} classes dropped
diff --git a/pkg/vm/test/frontend_server_test.dart b/pkg/vm/test/frontend_server_test.dart
index fb1c877..7ea07d4 100644
--- a/pkg/vm/test/frontend_server_test.dart
+++ b/pkg/vm/test/frontend_server_test.dart
@@ -7,6 +7,7 @@
import 'package:kernel/binary/ast_to_binary.dart';
import 'package:kernel/ast.dart' show Component;
import 'package:mockito/mockito.dart';
+import 'package:path/path.dart' as path;
import 'package:test/test.dart';
import 'package:vm/incremental_compiler.dart';
@@ -462,7 +463,7 @@
Directory tempDir;
setUp(() {
var systemTempDir = Directory.systemTemp;
- tempDir = systemTempDir.createTempSync('foo');
+ tempDir = systemTempDir.createTempSync('foo bar');
});
tearDown(() {
@@ -656,15 +657,11 @@
});
test('compile and produce deps file', () async {
- if (Platform.isWindows) {
- // TODO(dartbug.com/33032): Fix depfile generation on Windows.
- return;
- }
var file = new File('${tempDir.path}/foo.dart')..createSync();
file.writeAsStringSync("main() {}\n");
var dillFile = new File('${tempDir.path}/app.dill');
expect(dillFile.existsSync(), equals(false));
- var depFile = new File('${tempDir.path}/depfile');
+ var depFile = new File('${tempDir.path}/the depfile');
expect(depFile.existsSync(), equals(false));
final List<String> args = <String>[
'--sdk-root=${sdkRoot.toFilePath()}',
@@ -679,8 +676,8 @@
expect(depFile.existsSync(), true);
var depContents = depFile.readAsStringSync();
- var depContentsParsed = depContents.split(':');
- expect(depContentsParsed[0], dillFile.path);
+ var depContentsParsed = depContents.split(': ');
+ expect(path.basename(depContentsParsed[0]), path.basename(dillFile.path));
expect(depContentsParsed[1], isNotEmpty);
});
});
diff --git a/pkg/vm/testcases/bytecode/instance_creation.dart.expect b/pkg/vm/testcases/bytecode/instance_creation.dart.expect
index b026f3c0..b91a903 100644
--- a/pkg/vm/testcases/bytecode/instance_creation.dart.expect
+++ b/pkg/vm/testcases/bytecode/instance_creation.dart.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class Base<T1 extends core::Object, T2 extends core::Object> extends core::Object {
+class Base<T1 extends core::Object = dynamic, T2 extends core::Object = dynamic> extends core::Object {
generic-covariant-impl generic-covariant-interface field self::Base::T1 t1 = null;
generic-covariant-impl generic-covariant-interface field self::Base::T2 t2 = null;
[@vm.bytecode=
@@ -92,7 +92,7 @@
abstract forwarding-stub set t1(generic-covariant-impl core::int _) → void;
abstract forwarding-stub set t2(generic-covariant-impl core::String _) → void;
}
-class B<T extends core::Object> extends self::Base<core::List<self::B::T>, core::String> {
+class B<T extends core::Object = dynamic> extends self::Base<core::List<self::B::T>, core::String> {
[@vm.bytecode=
Bytecode {
Entry 1
@@ -282,7 +282,7 @@
[4] = ArgDesc num-args 1, num-type-args 0, names []
[5] = StaticICData target '#lib::B::', arg-desc CP#4
}
-]static method foo3<T extends core::Object>() → void {
+]static method foo3<T extends core::Object = dynamic>() → void {
new self::B::•<core::List<self::foo3::T>>();
}
[@vm.bytecode=
diff --git a/pkg/vm/testcases/bytecode/literals.dart.expect b/pkg/vm/testcases/bytecode/literals.dart.expect
index b56cae6..df1fe96 100644
--- a/pkg/vm/testcases/bytecode/literals.dart.expect
+++ b/pkg/vm/testcases/bytecode/literals.dart.expect
@@ -609,7 +609,7 @@
[22] = StaticICData target 'dart.core::Map::_fromLiteral', arg-desc CP#7
[23] = StaticICData target 'dart.core::print', arg-desc CP#9
}
-]static method test_map_literal<T extends core::Object>(core::int a, core::int b, self::test_map_literal::T c) → void {
+]static method test_map_literal<T extends core::Object = dynamic>(core::int a, core::int b, self::test_map_literal::T c) → void {
core::print(<core::int, core::int>{1: a, b: 2});
core::print(<core::String, core::int>{"foo": a, b.{core::int::toString}(): 3});
core::print(<core::String, self::test_map_literal::T>{});
@@ -660,7 +660,7 @@
[4] = Null
[5] = StaticICData target 'dart.core::print', arg-desc CP#1
}
-]static method test_type_literal<T extends core::Object>() → void {
+]static method test_type_literal<T extends core::Object = dynamic>() → void {
core::print(core::String);
core::print(self::test_type_literal::T);
}
diff --git a/pkg/vm/testcases/bytecode/type_ops.dart.expect b/pkg/vm/testcases/bytecode/type_ops.dart.expect
index f53ec42..e6af3e1 100644
--- a/pkg/vm/testcases/bytecode/type_ops.dart.expect
+++ b/pkg/vm/testcases/bytecode/type_ops.dart.expect
@@ -2,7 +2,7 @@
import self as self;
import "dart:core" as core;
-class A<T extends core::Object> extends core::Object {
+class A<T extends core::Object = dynamic> extends core::Object {
[@vm.bytecode=
Bytecode {
Entry 0
@@ -44,7 +44,7 @@
: super self::A::•()
;
}
-class C<T1 extends core::Object, T2 extends core::Object, T3 extends core::Object> extends self::B {
+class C<T1 extends core::Object = dynamic, T2 extends core::Object = dynamic, T3 extends core::Object = dynamic> extends self::B {
[@vm.bytecode=
Bytecode {
Entry 0
@@ -65,7 +65,7 @@
: super self::B::•()
;
}
-class D<P extends core::Object, Q extends core::Object> extends self::C<core::int, self::D::Q, self::D::P> {
+class D<P extends core::Object = dynamic, Q extends core::Object = dynamic> extends self::C<core::int, self::D::Q, self::D::P> {
generic-covariant-impl generic-covariant-interface field core::Map<self::D::P, self::D::Q> foo = null;
[@vm.bytecode=
Bytecode {
@@ -215,7 +215,7 @@
[14] = ICData target-name 'get:values', arg-desc CP#6
[15] = Null
}
-] method foo3<T1 extends core::Object, T2 extends core::Object>(dynamic z) → dynamic {
+] method foo3<T1 extends core::Object = dynamic, T2 extends core::Object = dynamic>(dynamic z) → dynamic {
if(z is self::A<self::D::foo3::T1>) {
core::print("31");
}
diff --git a/pkg/vm/testcases/transformations/type_flow/transformer/invalidation_cycle.dart b/pkg/vm/testcases/transformations/type_flow/transformer/invalidation_cycle.dart
new file mode 100644
index 0000000..da1f458
--- /dev/null
+++ b/pkg/vm/testcases/transformations/type_flow/transformer/invalidation_cycle.dart
@@ -0,0 +1,122 @@
+// 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 carefully reproduces subtle situation when TFA fails to converge
+// unless result types are saturated.
+// * There is a loop in dependencies (or even multiple loops).
+// * There is a recursive invocation which may result in a type approximation.
+// * Invalidation of results of certain invocations cause types to bounce
+// between approximated and non-approximated results, causing more
+// self-induced invalidations.
+//
+
+class StreamSubscription {}
+
+class _BufferingStreamSubscription extends StreamSubscription {}
+
+class _BroadcastSubscription extends StreamSubscription {}
+
+abstract class Stream {
+ StreamSubscription foobar(void onData(event), {Function onError});
+}
+
+abstract class _StreamImpl extends Stream {
+ StreamSubscription foobar(void onData(data), {Function onError}) {
+ return _createSubscription();
+ }
+
+ StreamSubscription _createSubscription() {
+ return new _BufferingStreamSubscription();
+ }
+}
+
+class _ControllerStream extends _StreamImpl {
+ StreamSubscription _createSubscription() {
+ return new _BroadcastSubscription();
+ }
+}
+
+class _GeneratedStreamImpl extends _StreamImpl {}
+
+class StreamView extends Stream {
+ final Stream _stream;
+
+ StreamView(Stream stream) : _stream = stream;
+
+ StreamSubscription foobar(void onData(value), {Function onError}) {
+ return _stream.foobar(onData, onError: onError);
+ }
+}
+
+class ByteStream extends StreamView {
+ ByteStream(Stream stream) : super(stream);
+
+ super_foobar1(void onData(value)) {
+ super.foobar(onData);
+ }
+
+ super_foobar2(void onData(value)) {
+ super.foobar(onData);
+ }
+
+ super_foobar3({void onData(value), Function onError}) {
+ super.foobar(onData, onError: onError);
+ }
+
+ Stream get super_stream => super._stream;
+}
+
+class _HandleErrorStream extends Stream {
+ StreamSubscription foobar(void onData(event), {Function onError}) {
+ return new _BufferingStreamSubscription();
+ }
+}
+
+void round0() {
+ new ByteStream(new ByteStream(new _GeneratedStreamImpl()));
+}
+
+void round1({void onData(value)}) {
+ var x = new ByteStream(new ByteStream(new _GeneratedStreamImpl()));
+ x.super_foobar1(onData);
+}
+
+void round2({void onData(value), Function onError}) {
+ new _ControllerStream();
+ Stream x = new _GeneratedStreamImpl();
+ x = new ByteStream(x);
+ x.foobar(onData, onError: onError);
+}
+
+void round3({void onData(value), Function onError}) {
+ Stream x = new _GeneratedStreamImpl();
+ x = new ByteStream(x);
+ x = new _ControllerStream();
+ x.foobar(onData, onError: onError);
+}
+
+void round4({void onData(value)}) {
+ var x = new ByteStream(new _ControllerStream());
+ var y = x.super_stream;
+ var z = x._stream;
+ if (y == z) {
+ x.super_foobar2(onData);
+ }
+}
+
+void round5() {
+ var x = new ByteStream(new _GeneratedStreamImpl());
+ new _HandleErrorStream();
+ x.super_foobar3();
+}
+
+main(List<String> args) {
+ new _GeneratedStreamImpl();
+ round0();
+ round1();
+ round2();
+ round3();
+ round4();
+ round5();
+}
diff --git a/pkg/vm/testcases/transformations/type_flow/transformer/invalidation_cycle.dart.expect b/pkg/vm/testcases/transformations/type_flow/transformer/invalidation_cycle.dart.expect
new file mode 100644
index 0000000..fd8c263
--- /dev/null
+++ b/pkg/vm/testcases/transformations/type_flow/transformer/invalidation_cycle.dart.expect
@@ -0,0 +1,120 @@
+library #lib;
+import self as self;
+import "dart:core" as core;
+
+abstract class StreamSubscription extends core::Object {
+ synthetic constructor •() → void
+ : super core::Object::•()
+ ;
+}
+class _BufferingStreamSubscription extends self::StreamSubscription {
+ synthetic constructor •() → void
+ : super self::StreamSubscription::•()
+ ;
+}
+class _BroadcastSubscription extends self::StreamSubscription {
+ synthetic constructor •() → void
+ : super self::StreamSubscription::•()
+ ;
+}
+abstract class Stream extends core::Object {
+ synthetic constructor •() → void
+ : super core::Object::•()
+ ;
+ abstract method foobar((dynamic) → void onData, {core::Function onError = null}) → self::StreamSubscription;
+}
+abstract class _StreamImpl extends self::Stream {
+ synthetic constructor •() → void
+ : super self::Stream::•()
+ ;
+ method foobar([@vm.inferred-type.metadata=dart.core::Null?] (dynamic) → void onData, {[@vm.inferred-type.metadata=dart.core::Null?] core::Function onError = null}) → self::StreamSubscription {
+ return [@vm.inferred-type.metadata=!] this.{self::_StreamImpl::_createSubscription}();
+ }
+ method _createSubscription() → self::StreamSubscription {
+ return new self::_BufferingStreamSubscription::•();
+ }
+}
+class _ControllerStream extends self::_StreamImpl {
+ synthetic constructor •() → void
+ : super self::_StreamImpl::•()
+ ;
+ method _createSubscription() → self::StreamSubscription {
+ return new self::_BroadcastSubscription::•();
+ }
+}
+class _GeneratedStreamImpl extends self::_StreamImpl {
+ synthetic constructor •() → void
+ : super self::_StreamImpl::•()
+ ;
+}
+abstract class StreamView extends self::Stream {
+[@vm.inferred-type.metadata=!] final field self::Stream _stream;
+ constructor •([@vm.inferred-type.metadata=!] self::Stream stream) → void
+ : self::StreamView::_stream = stream, super self::Stream::•()
+ ;
+ method foobar([@vm.inferred-type.metadata=dart.core::Null?] (dynamic) → void onData, {[@vm.inferred-type.metadata=dart.core::Null?] core::Function onError = null}) → self::StreamSubscription {
+ return [@vm.direct-call.metadata=#lib::StreamView::_stream] [@vm.inferred-type.metadata=!] this.{self::StreamView::_stream}.{self::Stream::foobar}(onData, onError: onError);
+ }
+}
+class ByteStream extends self::StreamView {
+ constructor •([@vm.inferred-type.metadata=!] self::Stream stream) → void
+ : super self::StreamView::•(stream)
+ ;
+ method super_foobar1([@vm.inferred-type.metadata=dart.core::Null?] (dynamic) → void onData) → dynamic {
+ super.{self::StreamView::foobar}(onData);
+ }
+ method super_foobar2([@vm.inferred-type.metadata=dart.core::Null?] (dynamic) → void onData) → dynamic {
+ super.{self::StreamView::foobar}(onData);
+ }
+ method super_foobar3({[@vm.inferred-type.metadata=dart.core::Null?] (dynamic) → void onData = null, [@vm.inferred-type.metadata=dart.core::Null?] core::Function onError = null}) → dynamic {
+ super.{self::StreamView::foobar}(onData, onError: onError);
+ }
+ get super_stream() → self::Stream
+ return [@vm.inferred-type.metadata=!] super.{self::StreamView::_stream};
+}
+class _HandleErrorStream extends self::Stream {
+ synthetic constructor •() → void
+ : super self::Stream::•()
+ ;
+}
+static method round0() → void {
+ new self::ByteStream::•(new self::ByteStream::•(new self::_GeneratedStreamImpl::•()));
+}
+static method round1({[@vm.inferred-type.metadata=dart.core::Null?] (dynamic) → void onData = null}) → void {
+ self::ByteStream x = new self::ByteStream::•(new self::ByteStream::•(new self::_GeneratedStreamImpl::•()));
+ [@vm.direct-call.metadata=#lib::ByteStream::super_foobar1] x.{self::ByteStream::super_foobar1}(onData);
+}
+static method round2({[@vm.inferred-type.metadata=dart.core::Null?] (dynamic) → void onData = null, [@vm.inferred-type.metadata=dart.core::Null?] core::Function onError = null}) → void {
+ new self::_ControllerStream::•();
+ self::Stream x = new self::_GeneratedStreamImpl::•();
+ x = new self::ByteStream::•(x);
+ x.{self::Stream::foobar}(onData, onError: onError);
+}
+static method round3({[@vm.inferred-type.metadata=dart.core::Null?] (dynamic) → void onData = null, [@vm.inferred-type.metadata=dart.core::Null?] core::Function onError = null}) → void {
+ self::Stream x = new self::_GeneratedStreamImpl::•();
+ x = new self::ByteStream::•(x);
+ x = new self::_ControllerStream::•();
+ x.{self::Stream::foobar}(onData, onError: onError);
+}
+static method round4({[@vm.inferred-type.metadata=dart.core::Null?] (dynamic) → void onData = null}) → void {
+ self::ByteStream x = new self::ByteStream::•(new self::_ControllerStream::•());
+ self::Stream y = [@vm.direct-call.metadata=#lib::ByteStream::super_stream] [@vm.inferred-type.metadata=!] x.{self::ByteStream::super_stream};
+ self::Stream z = [@vm.direct-call.metadata=#lib::StreamView::_stream] [@vm.inferred-type.metadata=!] x.{self::StreamView::_stream};
+ if([@vm.direct-call.metadata=dart.core::Object::==] [@vm.inferred-type.metadata=dart.core::bool] y.{core::Object::==}(z)) {
+ [@vm.direct-call.metadata=#lib::ByteStream::super_foobar2] x.{self::ByteStream::super_foobar2}(onData);
+ }
+}
+static method round5() → void {
+ self::ByteStream x = new self::ByteStream::•(new self::_GeneratedStreamImpl::•());
+ new self::_HandleErrorStream::•();
+ [@vm.direct-call.metadata=#lib::ByteStream::super_foobar3] x.{self::ByteStream::super_foobar3}();
+}
+static method main(core::List<core::String> args) → dynamic {
+ new self::_GeneratedStreamImpl::•();
+ self::round0();
+ self::round1();
+ self::round2();
+ self::round3();
+ self::round4();
+ self::round5();
+}
diff --git a/runtime/BUILD.gn b/runtime/BUILD.gn
index 00065fc..f0e3eac 100644
--- a/runtime/BUILD.gn
+++ b/runtime/BUILD.gn
@@ -2,7 +2,7 @@
# 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("../build/dart_host_sdk_toolchain.gni")
+import("../build/dart/dart_host_sdk_toolchain.gni")
import("runtime_args.gni")
config("dart_public_config") {
diff --git a/runtime/bin/BUILD.gn b/runtime/bin/BUILD.gn
index db2fa71..71d98d4 100644
--- a/runtime/bin/BUILD.gn
+++ b/runtime/bin/BUILD.gn
@@ -2,7 +2,7 @@
# 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("../../build/compiled_action.gni")
+import("../../build/dart/dart_action.gni")
import("../../sdk/lib/_http/http_sources.gni")
import("../../sdk/lib/io/io_sources.gni")
import("../../sdk/lib/cli/cli_sources.gni")
@@ -651,7 +651,7 @@
extra_sources = []
}
-compiled_action("generate_snapshot_bin") {
+gen_snapshot_action("generate_snapshot_bin") {
vm_snapshot_data = "$target_gen_dir/vm_snapshot_data.bin"
vm_snapshot_instructions = "$target_gen_dir/vm_snapshot_instructions.bin"
isolate_snapshot_data = "$target_gen_dir/isolate_snapshot_data.bin"
@@ -665,7 +665,6 @@
isolate_snapshot_data,
isolate_snapshot_instructions,
]
- tool = ":gen_snapshot"
args = [
"--deterministic",
"--snapshot_kind=" + dart_core_snapshot_kind,
@@ -1071,101 +1070,6 @@
]
}
-if (is_fuchsia) {
- hello_fuchsia_source = rebase_path("../tests/vm/dart/hello_fuchsia_test.dart")
-
- copy("hello_fuchsia") {
- sources = [
- hello_fuchsia_source,
- ]
- outputs = [
- "$root_out_dir/hello_fuchsia.dart",
- ]
- }
-
- hello_fuchsia_assembly = "$target_gen_dir/hello_fuchsia.S"
-
- compiled_action("hello_fuchsia_assembly") {
- inputs = [
- hello_fuchsia_source,
- ]
- outputs = [
- hello_fuchsia_assembly,
- ]
- tool = ":dart_bootstrap"
- args = [
- "--snapshot-kind=app-aot",
- "--snapshot=" + rebase_path(hello_fuchsia_assembly),
- hello_fuchsia_source,
- ]
- }
-
- shared_library("hello_fuchsia_dylib") {
- deps = [
- ":hello_fuchsia_assembly",
- ]
- sources = [
- hello_fuchsia_assembly,
- ]
- cflags = [
- "-nostdlib",
- "-nostartfiles",
- ]
- output_name = "hello_fuchsia"
- }
-
- # Uncomment after https://fuchsia-review.googlesource.com/#/c/build/+/37541/
- # lands.
- # copy("copy_hello_fuchsia_dylib") {
- # sources = [
- # get_label_info(":hello_fuchsia_lib($shlib_toolchain)", "root_out_dir") +
- # "/libhello_fuchsia.so",
- # ]
- # outputs = [
- # "$root_build_dir/{{source_file_part}}",
- # ]
- # deps = [
- # ":hello_fuchsia_dylib($shlib_toolchain)",
- # ]
- # }
-
- import("//build/package.gni")
-
- package("package") {
- deprecated_system_image = true
-
- package_name = "dart"
-
- deps = [
- ":dart",
- ":dart_precompiled_runtime",
- ]
-
- binaries = [
- {
- name = "dart"
- },
- {
- name = "dart_precompiled_runtime"
- },
- ]
- }
-
- package("dart_tests") {
- deprecated_system_image = true
-
- deps = [
- ":hello_fuchsia",
- ]
-
- binaries = [
- {
- name = "hello_fuchsia.dart"
- },
- ]
- }
-}
-
executable("process_test") {
sources = [
"process_test.cc",
diff --git a/runtime/bin/console_posix.cc b/runtime/bin/console_posix.cc
index 61fd677..af28e15 100644
--- a/runtime/bin/console_posix.cc
+++ b/runtime/bin/console_posix.cc
@@ -88,5 +88,5 @@
} // namespace bin
} // namespace dart
-#endif // defined(HOST_OS_LINUX) || defined(HOST_OS_MACOS) || \
+#endif // defined(HOST_OS_LINUX) || defined(HOST_OS_MACOS) ||
// defined(HOST_OS_ANDROID) || defined(HOST_OS_FUCHSIA)
diff --git a/runtime/bin/file_patch.dart b/runtime/bin/file_patch.dart
index 5023379..247c480 100644
--- a/runtime/bin/file_patch.dart
+++ b/runtime/bin/file_patch.dart
@@ -103,7 +103,7 @@
_WatcherPath _watcherPath;
- StreamController _broadcastController;
+ StreamController<FileSystemEvent> _broadcastController;
@patch
static Stream<FileSystemEvent> _watch(
@@ -127,11 +127,11 @@
throw new FileSystemException(
"File system watching is not supported on this platform", _path);
}
- _broadcastController =
- new StreamController.broadcast(onListen: _listen, onCancel: _cancel);
+ _broadcastController = new StreamController<FileSystemEvent>.broadcast(
+ onListen: _listen, onCancel: _cancel);
}
- Stream get _stream => _broadcastController.stream;
+ Stream<FileSystemEvent> get _stream => _broadcastController.stream;
void _listen() {
if (_id == null) {
@@ -201,7 +201,7 @@
var stops = [];
var events = [];
var pair = {};
- if (event == RawSocketEvent.READ) {
+ if (event == RawSocketEvent.read) {
String getPath(event) {
var path = _pathFromPathId(event[4]).path;
if (event[2] != null && event[2].isNotEmpty) {
@@ -216,7 +216,7 @@
// Windows does not get 'isDir' as part of the event.
return FileSystemEntity.isDirectorySync(getPath(event));
}
- return (event[0] & FileSystemEvent._IS_DIR) != 0;
+ return (event[0] & FileSystemEvent._isDir) != 0;
}
void add(id, event) {
@@ -245,16 +245,16 @@
}
bool isDir = getIsDir(event);
var path = getPath(event);
- if ((event[0] & FileSystemEvent.CREATE) != 0) {
+ if ((event[0] & FileSystemEvent.create) != 0) {
add(event[4], new FileSystemCreateEvent._(path, isDir));
}
- if ((event[0] & FileSystemEvent.MODIFY) != 0) {
+ if ((event[0] & FileSystemEvent.modify) != 0) {
add(event[4], new FileSystemModifyEvent._(path, isDir, true));
}
- if ((event[0] & FileSystemEvent._MODIFY_ATTRIBUTES) != 0) {
+ if ((event[0] & FileSystemEvent._modifyAttributes) != 0) {
add(event[4], new FileSystemModifyEvent._(path, isDir, false));
}
- if ((event[0] & FileSystemEvent.MOVE) != 0) {
+ if ((event[0] & FileSystemEvent.move) != 0) {
int link = event[1];
if (link > 0) {
pair.putIfAbsent(pathId, () => {});
@@ -271,10 +271,10 @@
rewriteMove(event, isDir);
}
}
- if ((event[0] & FileSystemEvent.DELETE) != 0) {
+ if ((event[0] & FileSystemEvent.delete) != 0) {
add(event[4], new FileSystemDeleteEvent._(path, isDir));
}
- if ((event[0] & FileSystemEvent._DELETE_SELF) != 0) {
+ if ((event[0] & FileSystemEvent._deleteSelf) != 0) {
add(event[4], new FileSystemDeleteEvent._(path, isDir));
// Signal done event.
stops.add([event[4], null]);
@@ -289,8 +289,8 @@
rewriteMove(event, getIsDir(event));
}
}
- } else if (event == RawSocketEvent.CLOSED) {} else if (event ==
- RawSocketEvent.READ_CLOSED) {} else {
+ } else if (event == RawSocketEvent.closed) {} else if (event ==
+ RawSocketEvent.readClosed) {} else {
assert(false);
}
events.addAll(stops);
@@ -342,7 +342,7 @@
Stream _pathWatched() {
var pathId = _watcherPath.pathId;
if (!_idMap.containsKey(pathId)) {
- _idMap[pathId] = new StreamController.broadcast();
+ _idMap[pathId] = new StreamController<FileSystemEvent>.broadcast();
}
return _idMap[pathId].stream;
}
@@ -364,7 +364,7 @@
Stream _pathWatched() {
var pathId = _watcherPath.pathId;
- _controller = new StreamController();
+ _controller = new StreamController<FileSystemEvent>();
_subscription =
_FileSystemWatcher._listenOnSocket(pathId, 0, pathId).listen((event) {
assert(event[0] == pathId);
@@ -393,7 +393,7 @@
Stream _pathWatched() {
var pathId = _watcherPath.pathId;
var socketId = _FileSystemWatcher._getSocketId(0, pathId);
- _controller = new StreamController();
+ _controller = new StreamController<FileSystemEvent>();
_subscription =
_FileSystemWatcher._listenOnSocket(socketId, 0, pathId).listen((event) {
if (event[1] != null) {
diff --git a/runtime/bin/process_patch.dart b/runtime/bin/process_patch.dart
index e216e63..80cf710 100644
--- a/runtime/bin/process_patch.dart
+++ b/runtime/bin/process_patch.dart
@@ -24,7 +24,7 @@
Map<String, String> environment,
bool includeParentEnvironment: true,
bool runInShell: false,
- ProcessStartMode mode: ProcessStartMode.NORMAL}) {
+ ProcessStartMode mode: ProcessStartMode.normal}) {
_ProcessImpl process = new _ProcessImpl(
executable,
arguments,
@@ -42,8 +42,8 @@
Map<String, String> environment,
bool includeParentEnvironment: true,
bool runInShell: false,
- Encoding stdoutEncoding: SYSTEM_ENCODING,
- Encoding stderrEncoding: SYSTEM_ENCODING}) {
+ Encoding stdoutEncoding: systemEncoding,
+ Encoding stderrEncoding: systemEncoding}) {
return _runNonInteractiveProcess(
executable,
arguments,
@@ -61,8 +61,8 @@
Map<String, String> environment,
bool includeParentEnvironment: true,
bool runInShell: false,
- Encoding stdoutEncoding: SYSTEM_ENCODING,
- Encoding stderrEncoding: SYSTEM_ENCODING}) {
+ Encoding stdoutEncoding: systemEncoding,
+ Encoding stderrEncoding: systemEncoding}) {
return _runNonInteractiveProcessSync(
executable,
arguments,
@@ -75,7 +75,7 @@
}
@patch
- static bool killPid(int pid, [ProcessSignal signal = ProcessSignal.SIGTERM]) {
+ static bool killPid(int pid, [ProcessSignal signal = ProcessSignal.sigterm]) {
if (signal is! ProcessSignal) {
throw new ArgumentError("Argument 'signal' must be a ProcessSignal");
}
@@ -108,7 +108,7 @@
_id = id;
var socket = new _RawSocket(new _NativeSocket.watchSignal(id));
socket.listen((event) {
- if (event == RawSocketEvent.READ) {
+ if (event == RawSocketEvent.read) {
var bytes = socket.read();
for (int i = 0; i < bytes.length; i++) {
_controller.add(signal);
@@ -146,13 +146,13 @@
static bool _killPid(int pid, int signal) native "Process_KillPid";
@patch
static Stream<ProcessSignal> _watchSignal(ProcessSignal signal) {
- if (signal != ProcessSignal.SIGHUP &&
- signal != ProcessSignal.SIGINT &&
- signal != ProcessSignal.SIGTERM &&
+ if (signal != ProcessSignal.sighup &&
+ signal != ProcessSignal.sigint &&
+ signal != ProcessSignal.sigterm &&
(Platform.isWindows ||
- (signal != ProcessSignal.SIGUSR1 &&
- signal != ProcessSignal.SIGUSR2 &&
- signal != ProcessSignal.SIGWINCH))) {
+ (signal != ProcessSignal.sigusr1 &&
+ signal != ProcessSignal.sigusr2 &&
+ signal != ProcessSignal.sigwinch))) {
throw new SignalException(
"Listening for signal $signal is not supported");
}
@@ -304,13 +304,13 @@
(_stderr._stream as _Socket)._nativeSocket;
static bool _modeIsAttached(ProcessStartMode mode) {
- return (mode == ProcessStartMode.NORMAL) ||
- (mode == ProcessStartMode.INHERIT_STDIO);
+ return (mode == ProcessStartMode.normal) ||
+ (mode == ProcessStartMode.inheritStdio);
}
static bool _modeHasStdio(ProcessStartMode mode) {
- return (mode == ProcessStartMode.NORMAL) ||
- (mode == ProcessStartMode.DETACHED_WITH_STDIO);
+ return (mode == ProcessStartMode.normal) ||
+ (mode == ProcessStartMode.detachedWithStdio);
}
static String _getShellCommand() {
@@ -413,7 +413,7 @@
_arguments,
_workingDirectory,
_environment,
- _mode.index,
+ _mode._mode,
_modeHasStdio(_mode) ? _stdinNativeSocket : null,
_modeHasStdio(_mode) ? _stdoutNativeSocket : null,
_modeHasStdio(_mode) ? _stderrNativeSocket : null,
@@ -475,7 +475,7 @@
_arguments,
_workingDirectory,
_environment,
- ProcessStartMode.NORMAL.index,
+ ProcessStartMode.normal._mode,
_stdinNativeSocket,
_stdoutNativeSocket,
_stderrNativeSocket,
@@ -535,7 +535,7 @@
Future<int> get exitCode => _exitCode != null ? _exitCode.future : null;
- bool kill([ProcessSignal signal = ProcessSignal.SIGTERM]) {
+ bool kill([ProcessSignal signal = ProcessSignal.sigterm]) {
if (signal is! ProcessSignal) {
throw new ArgumentError("Argument 'signal' must be a ProcessSignal");
}
@@ -627,6 +627,6 @@
environment,
includeParentEnvironment,
runInShell,
- ProcessStartMode.NORMAL);
+ ProcessStartMode.normal);
return process._runAndWait(stdoutEncoding, stderrEncoding);
}
diff --git a/runtime/bin/run_vm_tests.cc b/runtime/bin/run_vm_tests.cc
index b896978..9d08b5d 100644
--- a/runtime/bin/run_vm_tests.cc
+++ b/runtime/bin/run_vm_tests.cc
@@ -297,7 +297,7 @@
OS::PrintErr("No tests matched: %s\n", run_filter);
return 1;
}
- if (DynamicAssertionHelper::failed()) {
+ if (Expect::failed()) {
return 255;
}
return 0;
diff --git a/runtime/bin/secure_socket_patch.dart b/runtime/bin/secure_socket_patch.dart
index cae58a5..74c8bf4 100644
--- a/runtime/bin/secure_socket_patch.dart
+++ b/runtime/bin/secure_socket_patch.dart
@@ -66,12 +66,13 @@
implements _SecureFilter {
// Performance is improved if a full buffer of plaintext fits
// in the encrypted buffer, when encrypted.
+ // SIZE and ENCRYPTED_SIZE are referenced from C++.
static final int SIZE = 8 * 1024;
static final int ENCRYPTED_SIZE = 10 * 1024;
_SecureFilterImpl() {
- buffers = new List<_ExternalBuffer>(_RawSecureSocket.NUM_BUFFERS);
- for (int i = 0; i < _RawSecureSocket.NUM_BUFFERS; ++i) {
+ buffers = new List<_ExternalBuffer>(_RawSecureSocket.bufferCount);
+ for (int i = 0; i < _RawSecureSocket.bufferCount; ++i) {
buffers[i] = new _ExternalBuffer(
_RawSecureSocket._isBufferEncrypted(i) ? ENCRYPTED_SIZE : SIZE);
}
diff --git a/runtime/bin/socket_patch.dart b/runtime/bin/socket_patch.dart
index ac7dc37..5f5d220 100644
--- a/runtime/bin/socket_patch.dart
+++ b/runtime/bin/socket_patch.dart
@@ -26,22 +26,22 @@
class InternetAddress {
@patch
static InternetAddress get LOOPBACK_IP_V4 {
- return _InternetAddress.LOOPBACK_IP_V4;
+ return _InternetAddress.loopbackIPv4;
}
@patch
static InternetAddress get LOOPBACK_IP_V6 {
- return _InternetAddress.LOOPBACK_IP_V6;
+ return _InternetAddress.loopbackIPv6;
}
@patch
static InternetAddress get ANY_IP_V4 {
- return _InternetAddress.ANY_IP_V4;
+ return _InternetAddress.anyIPv4;
}
@patch
static InternetAddress get ANY_IP_V6 {
- return _InternetAddress.ANY_IP_V6;
+ return _InternetAddress.anyIPv6;
}
@patch
@@ -51,7 +51,7 @@
@patch
static Future<List<InternetAddress>> lookup(String host,
- {InternetAddressType type: InternetAddressType.ANY}) {
+ {InternetAddressType type: InternetAddressType.any}) {
return _NativeSocket.lookup(host, type: type);
}
@@ -73,7 +73,7 @@
static Future<List<NetworkInterface>> list(
{bool includeLoopback: false,
bool includeLinkLocal: false,
- InternetAddressType type: InternetAddressType.ANY}) {
+ InternetAddressType type: InternetAddressType.any}) {
return _NativeSocket.listInterfaces(
includeLoopback: includeLoopback,
includeLinkLocal: includeLinkLocal,
@@ -90,29 +90,27 @@
}
class _InternetAddress implements InternetAddress {
- static const int _ADDRESS_LOOPBACK_IP_V4 = 0;
- static const int _ADDRESS_LOOPBACK_IP_V6 = 1;
- static const int _ADDRESS_ANY_IP_V4 = 2;
- static const int _ADDRESS_ANY_IP_V6 = 3;
- static const int _IPV4_ADDR_LENGTH = 4;
- static const int _IPV6_ADDR_LENGTH = 16;
+ static const int _addressLoopbackIPv4 = 0;
+ static const int _addressLoopbackIPv6 = 1;
+ static const int _addressAnyIPv4 = 2;
+ static const int _addressAnyIPv6 = 3;
+ static const int _IPv4AddrLength = 4;
+ static const int _IPv6AddrLength = 16;
- static _InternetAddress LOOPBACK_IP_V4 =
- new _InternetAddress.fixed(_ADDRESS_LOOPBACK_IP_V4);
- static _InternetAddress LOOPBACK_IP_V6 =
- new _InternetAddress.fixed(_ADDRESS_LOOPBACK_IP_V6);
- static _InternetAddress ANY_IP_V4 =
- new _InternetAddress.fixed(_ADDRESS_ANY_IP_V4);
- static _InternetAddress ANY_IP_V6 =
- new _InternetAddress.fixed(_ADDRESS_ANY_IP_V6);
+ static _InternetAddress loopbackIPv4 =
+ new _InternetAddress.fixed(_addressLoopbackIPv4);
+ static _InternetAddress loopbackIPv6 =
+ new _InternetAddress.fixed(_addressLoopbackIPv6);
+ static _InternetAddress anyIPv4 = new _InternetAddress.fixed(_addressAnyIPv4);
+ static _InternetAddress anyIPv6 = new _InternetAddress.fixed(_addressAnyIPv6);
final String address;
final String _host;
final Uint8List _in_addr;
- InternetAddressType get type => _in_addr.length == _IPV4_ADDR_LENGTH
- ? InternetAddressType.IP_V4
- : InternetAddressType.IP_V6;
+ InternetAddressType get type => _in_addr.length == _IPv4AddrLength
+ ? InternetAddressType.IPv4
+ : InternetAddressType.IPv6;
String get host => _host != null ? _host : address;
@@ -120,24 +118,24 @@
bool get isLoopback {
switch (type) {
- case InternetAddressType.IP_V4:
+ case InternetAddressType.IPv4:
return _in_addr[0] == 127;
- case InternetAddressType.IP_V6:
- for (int i = 0; i < _IPV6_ADDR_LENGTH - 1; i++) {
+ case InternetAddressType.IPv6:
+ for (int i = 0; i < _IPv6AddrLength - 1; i++) {
if (_in_addr[i] != 0) return false;
}
- return _in_addr[_IPV6_ADDR_LENGTH - 1] == 1;
+ return _in_addr[_IPv6AddrLength - 1] == 1;
}
}
bool get isLinkLocal {
switch (type) {
- case InternetAddressType.IP_V4:
+ case InternetAddressType.IPv4:
// Checking for 169.254.0.0/16.
return _in_addr[0] == 169 && _in_addr[1] == 254;
- case InternetAddressType.IP_V6:
+ case InternetAddressType.IPv6:
// Checking for fe80::/10.
return _in_addr[0] == 0xFE && (_in_addr[1] & 0xB0) == 0x80;
}
@@ -145,11 +143,11 @@
bool get isMulticast {
switch (type) {
- case InternetAddressType.IP_V4:
+ case InternetAddressType.IPv4:
// Checking for 224.0.0.0 through 239.255.255.255.
return _in_addr[0] >= 224 && _in_addr[0] < 240;
- case InternetAddressType.IP_V6:
+ case InternetAddressType.IPv6:
// Checking for ff00::/8.
return _in_addr[0] == 0xFF;
}
@@ -172,20 +170,20 @@
factory _InternetAddress.fixed(int id) {
switch (id) {
- case _ADDRESS_LOOPBACK_IP_V4:
- var in_addr = new Uint8List(_IPV4_ADDR_LENGTH);
+ case _addressLoopbackIPv4:
+ var in_addr = new Uint8List(_IPv4AddrLength);
in_addr[0] = 127;
- in_addr[_IPV4_ADDR_LENGTH - 1] = 1;
+ in_addr[_IPv4AddrLength - 1] = 1;
return new _InternetAddress("127.0.0.1", null, in_addr);
- case _ADDRESS_LOOPBACK_IP_V6:
- var in_addr = new Uint8List(_IPV6_ADDR_LENGTH);
- in_addr[_IPV6_ADDR_LENGTH - 1] = 1;
+ case _addressLoopbackIPv6:
+ var in_addr = new Uint8List(_IPv6AddrLength);
+ in_addr[_IPv6AddrLength - 1] = 1;
return new _InternetAddress("::1", null, in_addr);
- case _ADDRESS_ANY_IP_V4:
- var in_addr = new Uint8List(_IPV4_ADDR_LENGTH);
+ case _addressAnyIPv4:
+ var in_addr = new Uint8List(_IPv4AddrLength);
return new _InternetAddress("0.0.0.0", "0.0.0.0", in_addr);
- case _ADDRESS_ANY_IP_V6:
- var in_addr = new Uint8List(_IPV6_ADDR_LENGTH);
+ case _addressAnyIPv6:
+ var in_addr = new Uint8List(_IPv6AddrLength);
return new _InternetAddress("::", "::", in_addr);
default:
assert(false);
@@ -251,63 +249,63 @@
// eventhandler. COMMAND flags are never received from the
// eventhandler. Additional flags are used to communicate other
// information.
- static const int READ_EVENT = 0;
- static const int WRITE_EVENT = 1;
- static const int ERROR_EVENT = 2;
- static const int CLOSED_EVENT = 3;
- static const int DESTROYED_EVENT = 4;
- static const int FIRST_EVENT = READ_EVENT;
- static const int LAST_EVENT = DESTROYED_EVENT;
- static const int EVENT_COUNT = LAST_EVENT - FIRST_EVENT + 1;
+ static const int readEvent = 0;
+ static const int writeEvent = 1;
+ static const int errorEvent = 2;
+ static const int closedEvent = 3;
+ static const int destroyedEvent = 4;
+ static const int firstEvent = readEvent;
+ static const int lastEvent = destroyedEvent;
+ static const int eventCount = lastEvent - firstEvent + 1;
- static const int CLOSE_COMMAND = 8;
- static const int SHUTDOWN_READ_COMMAND = 9;
- static const int SHUTDOWN_WRITE_COMMAND = 10;
- // The lower bits of RETURN_TOKEN_COMMAND messages contains the number
+ static const int closeCommand = 8;
+ static const int shutdownReadCommand = 9;
+ static const int shutdownWriteCommand = 10;
+ // The lower bits of returnTokenCommand messages contains the number
// of tokens returned.
- static const int RETURN_TOKEN_COMMAND = 11;
- static const int SET_EVENT_MASK_COMMAND = 12;
- static const int FIRST_COMMAND = CLOSE_COMMAND;
- static const int LAST_COMMAND = SET_EVENT_MASK_COMMAND;
+ static const int returnTokenCommand = 11;
+ static const int setEventMaskCommand = 12;
+ static const int firstCommand = closeCommand;
+ static const int lastCommand = setEventMaskCommand;
// Type flag send to the eventhandler providing additional
// information on the type of the file descriptor.
- static const int LISTENING_SOCKET = 16;
- static const int PIPE_SOCKET = 17;
- static const int TYPE_NORMAL_SOCKET = 0;
- static const int TYPE_LISTENING_SOCKET = 1 << LISTENING_SOCKET;
- static const int TYPE_PIPE = 1 << PIPE_SOCKET;
- static const int TYPE_TYPE_MASK = TYPE_LISTENING_SOCKET | PIPE_SOCKET;
+ static const int listeningSocket = 16;
+ static const int pipeSocket = 17;
+ static const int typeNormalSocket = 0;
+ static const int typeListeningSocket = 1 << listeningSocket;
+ static const int typePipe = 1 << pipeSocket;
+ static const int typeTypeMask = typeListeningSocket | pipeSocket;
// Protocol flags.
// Keep in sync with SocketType enum in socket.h.
- static const int TCP_SOCKET = 18;
- static const int UDP_SOCKET = 19;
- static const int INTERNAL_SOCKET = 20;
- static const int INTERNAL_SIGNAL_SOCKET = 21;
- static const int TYPE_TCP_SOCKET = 1 << TCP_SOCKET;
- static const int TYPE_UDP_SOCKET = 1 << UDP_SOCKET;
- static const int TYPE_INTERNAL_SOCKET = 1 << INTERNAL_SOCKET;
- static const int TYPE_INTERNAL_SIGNAL_SOCKET = 1 << INTERNAL_SIGNAL_SOCKET;
- static const int TYPE_PROTOCOL_MASK = TYPE_TCP_SOCKET |
- TYPE_UDP_SOCKET |
- TYPE_INTERNAL_SOCKET |
- TYPE_INTERNAL_SIGNAL_SOCKET;
+ static const int tcpSocket = 18;
+ static const int udpSocket = 19;
+ static const int internalSocket = 20;
+ static const int internalSignalSocket = 21;
+ static const int typeTcpSocket = 1 << tcpSocket;
+ static const int typeUdpSocket = 1 << udpSocket;
+ static const int typeInternalSocket = 1 << internalSocket;
+ static const int typeInternalSignalSocket = 1 << internalSignalSocket;
+ static const int typeProtocolMask = typeTcpSocket |
+ typeUdpSocket |
+ typeInternalSocket |
+ typeInternalSignalSocket;
// Native port messages.
- static const HOST_NAME_LOOKUP = 0;
- static const LIST_INTERFACES = 1;
- static const REVERSE_LOOKUP = 2;
+ static const hostNameLookupMessage = 0;
+ static const listInterfacesMessage = 1;
+ static const reverseLookupMessage = 2;
// Protocol flags.
- static const int PROTOCOL_IPV4 = 1 << 0;
- static const int PROTOCOL_IPV6 = 1 << 1;
+ static const int protocolIPv4 = 1 << 0;
+ static const int protocolIPv6 = 1 << 1;
- static const int NORMAL_TOKEN_BATCH_SIZE = 8;
- static const int LISTENING_TOKEN_BATCH_SIZE = 2;
+ static const int normalTokenBatchSize = 8;
+ static const int listeningTokenBatchSize = 2;
- static const Duration _RETRY_DURATION = const Duration(milliseconds: 250);
- static const Duration _RETRY_DURATION_LOOPBACK =
+ static const Duration _retryDuration = const Duration(milliseconds: 250);
+ static const Duration _retryDurationLoopback =
const Duration(milliseconds: 25);
// Socket close state
@@ -319,7 +317,7 @@
Completer closeCompleter = new Completer.sync();
// Handlers and receive port for socket events from the event handler.
- final List eventHandlers = new List(EVENT_COUNT + 1);
+ final List eventHandlers = new List(eventCount + 1);
RawReceivePort eventPort;
bool flagsSent = false;
@@ -351,9 +349,9 @@
Object owner;
static Future<List<InternetAddress>> lookup(String host,
- {InternetAddressType type: InternetAddressType.ANY}) {
- return _IOService
- ._dispatch(_SOCKET_LOOKUP, [host, type._value]).then((response) {
+ {InternetAddressType type: InternetAddressType.any}) {
+ return _IOService._dispatch(
+ _IOService.socketLookup, [host, type._value]).then((response) {
if (isErrorResponse(response)) {
throw createError(response, "Failed host lookup: '$host'");
} else {
@@ -366,7 +364,7 @@
}
static Future<InternetAddress> reverseLookup(InternetAddress addr) {
- return _IOService._dispatch(_SOCKET_REVERSE_LOOKUP,
+ return _IOService._dispatch(_IOService.socketReverseLookup,
[(addr as _InternetAddress)._in_addr]).then((response) {
if (isErrorResponse(response)) {
throw createError(response, "Failed reverse host lookup", addr);
@@ -379,9 +377,9 @@
static Future<List<NetworkInterface>> listInterfaces(
{bool includeLoopback: false,
bool includeLinkLocal: false,
- InternetAddressType type: InternetAddressType.ANY}) {
- return _IOService
- ._dispatch(_SOCKET_LIST_INTERFACES, [type._value]).then((response) {
+ InternetAddressType type: InternetAddressType.any}) {
+ return _IOService._dispatch(
+ _IOService.socketListInterfaces, [type._value]).then((response) {
if (isErrorResponse(response)) {
throw createError(response, "Failed listing interfaces");
} else {
@@ -483,7 +481,7 @@
// Set up timer for when we should retry the next address
// (if any).
var duration =
- address.isLoopback ? _RETRY_DURATION_LOOPBACK : _RETRY_DURATION;
+ address.isLoopback ? _retryDurationLoopback : _retryDuration;
var timer = new Timer(duration, connectNext);
setupResourceInfo(socket);
@@ -576,33 +574,33 @@
}
_NativeSocket.datagram(this.localAddress)
- : typeFlags = TYPE_NORMAL_SOCKET | TYPE_UDP_SOCKET;
+ : typeFlags = typeNormalSocket | typeUdpSocket;
- _NativeSocket.normal() : typeFlags = TYPE_NORMAL_SOCKET | TYPE_TCP_SOCKET;
+ _NativeSocket.normal() : typeFlags = typeNormalSocket | typeTcpSocket;
- _NativeSocket.listen() : typeFlags = TYPE_LISTENING_SOCKET | TYPE_TCP_SOCKET {
+ _NativeSocket.listen() : typeFlags = typeListeningSocket | typeTcpSocket {
isClosedWrite = true;
}
- _NativeSocket.pipe() : typeFlags = TYPE_PIPE;
+ _NativeSocket.pipe() : typeFlags = typePipe;
_NativeSocket._watchCommon(int id, int type)
- : typeFlags = TYPE_NORMAL_SOCKET | type {
+ : typeFlags = typeNormalSocket | type {
isClosedWrite = true;
nativeSetSocketId(id, typeFlags);
}
_NativeSocket.watchSignal(int id)
- : this._watchCommon(id, TYPE_INTERNAL_SIGNAL_SOCKET);
+ : this._watchCommon(id, typeInternalSignalSocket);
- _NativeSocket.watch(int id) : this._watchCommon(id, TYPE_INTERNAL_SOCKET);
+ _NativeSocket.watch(int id) : this._watchCommon(id, typeInternalSocket);
- bool get isListening => (typeFlags & TYPE_LISTENING_SOCKET) != 0;
- bool get isPipe => (typeFlags & TYPE_PIPE) != 0;
- bool get isInternal => (typeFlags & TYPE_INTERNAL_SOCKET) != 0;
- bool get isInternalSignal => (typeFlags & TYPE_INTERNAL_SIGNAL_SOCKET) != 0;
- bool get isTcp => (typeFlags & TYPE_TCP_SOCKET) != 0;
- bool get isUdp => (typeFlags & TYPE_UDP_SOCKET) != 0;
+ bool get isListening => (typeFlags & typeListeningSocket) != 0;
+ bool get isPipe => (typeFlags & typePipe) != 0;
+ bool get isInternal => (typeFlags & typeInternalSocket) != 0;
+ bool get isInternalSignal => (typeFlags & typeInternalSignalSocket) != 0;
+ bool get isTcp => (typeFlags & typeTcpSocket) != 0;
+ bool get isUdp => (typeFlags & typeUdpSocket) != 0;
Map _toJSON(bool ref) => throw new UnimplementedError();
String get _serviceTypePath => throw new UnimplementedError();
@@ -734,7 +732,7 @@
assert(available > 0);
available--;
tokens++;
- returnTokens(LISTENING_TOKEN_BATCH_SIZE);
+ returnTokens(listeningTokenBatchSize);
var socket = new _NativeSocket.normal();
if (nativeAccept(socket) != true) return null;
socket.localPort = localPort;
@@ -786,14 +784,14 @@
if (available == 0) {
if (isClosedRead && !closedReadEventSent) {
if (isClosedWrite) close();
- var handler = eventHandlers[CLOSED_EVENT];
+ var handler = eventHandlers[closedEvent];
if (handler == null) return;
closedReadEventSent = true;
handler();
}
return;
}
- var handler = eventHandlers[READ_EVENT];
+ var handler = eventHandlers[readEvent];
if (handler == null) return;
readEventIssued = true;
handler();
@@ -812,7 +810,7 @@
if (isClosing) return;
if (!sendWriteEvents) return;
sendWriteEvents = false;
- var handler = eventHandlers[WRITE_EVENT];
+ var handler = eventHandlers[writeEvent];
if (handler == null) return;
handler();
}
@@ -830,23 +828,23 @@
// TODO(paulberry): when issue #31305 is fixed, we should be able to simply
// declare `events` as a `covariant int` parameter.
int events = eventsObj;
- for (int i = FIRST_EVENT; i <= LAST_EVENT; i++) {
+ for (int i = firstEvent; i <= lastEvent; i++) {
if (((events & (1 << i)) != 0)) {
- if ((i == CLOSED_EVENT || i == READ_EVENT) && isClosedRead) continue;
- if (isClosing && i != DESTROYED_EVENT) continue;
- if (i == CLOSED_EVENT && !isListening && !isClosing && !isClosed) {
+ if ((i == closedEvent || i == readEvent) && isClosedRead) continue;
+ if (isClosing && i != destroyedEvent) continue;
+ if (i == closedEvent && !isListening && !isClosing && !isClosed) {
isClosedRead = true;
issueReadEvent();
continue;
}
- if (i == WRITE_EVENT) {
+ if (i == writeEvent) {
writeAvailable = true;
issueWriteEvent(delayed: false);
continue;
}
- if (i == READ_EVENT) {
+ if (i == readEvent) {
if (isListening) {
available++;
} else {
@@ -857,7 +855,7 @@
}
var handler = eventHandlers[i];
- if (i == DESTROYED_EVENT) {
+ if (i == destroyedEvent) {
assert(isClosing);
assert(!isClosed);
// TODO(ricow): Remove/update when we track internal and pipe uses.
@@ -873,7 +871,7 @@
continue;
}
- if (i == ERROR_EVENT) {
+ if (i == errorEvent) {
if (!isClosing) {
reportError(nativeGetError(), "");
}
@@ -886,7 +884,7 @@
}
if (!isListening) {
tokens++;
- returnTokens(NORMAL_TOKEN_BATCH_SIZE);
+ returnTokens(normalTokenBatchSize);
}
}
@@ -895,19 +893,19 @@
assert(eventPort != null);
// Return in batches.
if (tokens == tokenBatchSize) {
- assert(tokens < (1 << FIRST_COMMAND));
- sendToEventHandler((1 << RETURN_TOKEN_COMMAND) | tokens);
+ assert(tokens < (1 << firstCommand));
+ sendToEventHandler((1 << returnTokenCommand) | tokens);
tokens = 0;
}
}
}
void setHandlers({read, write, error, closed, destroyed}) {
- eventHandlers[READ_EVENT] = read;
- eventHandlers[WRITE_EVENT] = write;
- eventHandlers[ERROR_EVENT] = error;
- eventHandlers[CLOSED_EVENT] = closed;
- eventHandlers[DESTROYED_EVENT] = destroyed;
+ eventHandlers[readEvent] = read;
+ eventHandlers[writeEvent] = write;
+ eventHandlers[errorEvent] = error;
+ eventHandlers[closedEvent] = closed;
+ eventHandlers[destroyedEvent] = destroyed;
}
void setListening({read: true, write: true}) {
@@ -917,16 +915,16 @@
if (write) issueWriteEvent();
if (!flagsSent && !isClosing) {
flagsSent = true;
- int flags = 1 << SET_EVENT_MASK_COMMAND;
- if (!isClosedRead) flags |= 1 << READ_EVENT;
- if (!isClosedWrite) flags |= 1 << WRITE_EVENT;
+ int flags = 1 << setEventMaskCommand;
+ if (!isClosedRead) flags |= 1 << readEvent;
+ if (!isClosedWrite) flags |= 1 << writeEvent;
sendToEventHandler(flags);
}
}
Future close() {
if (!isClosing && !isClosed) {
- sendToEventHandler(1 << CLOSE_COMMAND);
+ sendToEventHandler(1 << closeCommand);
isClosing = true;
}
return closeCompleter.future;
@@ -935,13 +933,13 @@
void shutdown(SocketDirection direction) {
if (!isClosing && !isClosed) {
switch (direction) {
- case SocketDirection.RECEIVE:
+ case SocketDirection.receive:
shutdownRead();
break;
- case SocketDirection.SEND:
+ case SocketDirection.send:
shutdownWrite();
break;
- case SocketDirection.BOTH:
+ case SocketDirection.both:
close();
break;
default:
@@ -955,7 +953,7 @@
if (closedReadEventSent) {
close();
} else {
- sendToEventHandler(1 << SHUTDOWN_WRITE_COMMAND);
+ sendToEventHandler(1 << shutdownWriteCommand);
}
isClosedWrite = true;
}
@@ -966,14 +964,14 @@
if (isClosedWrite) {
close();
} else {
- sendToEventHandler(1 << SHUTDOWN_READ_COMMAND);
+ sendToEventHandler(1 << shutdownReadCommand);
}
isClosedRead = true;
}
}
void sendToEventHandler(int data) {
- int fullData = (typeFlags & TYPE_TYPE_MASK) | data;
+ int fullData = (typeFlags & typeTypeMask) | data;
assert(!isClosing);
connectToEventHandler();
_EventHandler._sendData(this, eventPort.sendPort, fullData);
@@ -1005,7 +1003,7 @@
// Check whether this is an error response from a native port call.
static bool isErrorResponse(response) {
- return response is List && response[0] != _SUCCESS_RESPONSE;
+ return response is List && response[0] != _successResponse;
}
// Create the appropriate error/exception from different returned
@@ -1018,9 +1016,9 @@
} else if (error is List) {
assert(isErrorResponse(error));
switch (error[0]) {
- case _ILLEGAL_ARGUMENT_RESPONSE:
+ case _illegalArgumentResponse:
return new ArgumentError();
- case _OSERROR_RESPONSE:
+ case _osErrorResponse:
return new SocketException(message,
osError: new OSError(error[2], error[1]),
address: address,
@@ -1036,8 +1034,8 @@
void reportError(error, String message) {
var e = createError(error, message, address, localPort);
// Invoke the error handler if any.
- if (eventHandlers[ERROR_EVENT] != null) {
- eventHandlers[ERROR_EVENT](e);
+ if (eventHandlers[errorEvent] != null) {
+ eventHandlers[errorEvent](e);
}
// For all errors we close the socket
close();
@@ -1060,10 +1058,10 @@
InternetAddress addr, NetworkInterface interface) {
// On Mac OS using the interface index for joining IPv4 multicast groups
// is not supported. Here the IP address of the interface is needed.
- if (Platform.isMacOS && addr.type == InternetAddressType.IP_V4) {
+ if (Platform.isMacOS && addr.type == InternetAddressType.IPv4) {
if (interface != null) {
for (int i = 0; i < interface.addresses.length; i++) {
- if (interface.addresses[i].type == InternetAddressType.IP_V4) {
+ if (interface.addresses[i].type == InternetAddressType.IPv4) {
return interface.addresses[i];
}
}
@@ -1073,7 +1071,7 @@
"of the same family as the multicast address");
} else {
// Default to the ANY address if no interface is specified.
- return InternetAddress.ANY_IP_V4;
+ return InternetAddress.anyIPv4;
}
} else {
return null;
@@ -1244,16 +1242,16 @@
onPause: _onPauseStateChange,
onResume: _onPauseStateChange);
_socket.setHandlers(
- read: () => _controller.add(RawSocketEvent.READ),
+ read: () => _controller.add(RawSocketEvent.read),
write: () {
// The write event handler is automatically disabled by the
// event handler when it fires.
writeEventsEnabled = false;
- _controller.add(RawSocketEvent.WRITE);
+ _controller.add(RawSocketEvent.write);
},
- closed: () => _controller.add(RawSocketEvent.READ_CLOSED),
+ closed: () => _controller.add(RawSocketEvent.readClosed),
destroyed: () {
- _controller.add(RawSocketEvent.CLOSED);
+ _controller.add(RawSocketEvent.closed);
_controller.close();
},
error: zone.bindUnaryCallbackGuarded((e) {
@@ -1277,7 +1275,7 @@
if (fd != null) {
var socketType = _StdIOUtils._nativeSocketType(result._socket);
result._isMacOSTerminalInput =
- Platform.isMacOS && socketType == _STDIO_HANDLE_TYPE_TERMINAL;
+ Platform.isMacOS && socketType == _stdioHandleTypeTerminal;
}
return result;
}
@@ -1298,7 +1296,7 @@
if (data == null || data.length < available) {
// Reading less than available from a Mac OS terminal indicate Ctrl-D.
// This is interpreted as read closed.
- scheduleMicrotask(() => _controller.add(RawSocketEvent.READ_CLOSED));
+ scheduleMicrotask(() => _controller.add(RawSocketEvent.readClosed));
}
return data;
} else {
@@ -1656,7 +1654,7 @@
} else {
_controllerClosed = true;
if (_raw != null) {
- _raw.shutdown(SocketDirection.RECEIVE);
+ _raw.shutdown(SocketDirection.receive);
}
}
}
@@ -1669,14 +1667,14 @@
void _onData(event) {
switch (event) {
- case RawSocketEvent.READ:
+ case RawSocketEvent.read:
var buffer = _raw.read();
if (buffer != null) _controller.add(buffer);
break;
- case RawSocketEvent.WRITE:
+ case RawSocketEvent.write:
_consumer.write();
break;
- case RawSocketEvent.READ_CLOSED:
+ case RawSocketEvent.readClosed:
_controllerClosed = true;
_controller.close();
break;
@@ -1718,7 +1716,7 @@
_detachReady.complete(null);
} else {
if (_raw != null) {
- _raw.shutdown(SocketDirection.SEND);
+ _raw.shutdown(SocketDirection.send);
_disableWriteEvent();
}
}
@@ -1756,16 +1754,16 @@
onPause: _onPauseStateChange,
onResume: _onPauseStateChange);
_socket.setHandlers(
- read: () => _controller.add(RawSocketEvent.READ),
+ read: () => _controller.add(RawSocketEvent.read),
write: () {
// The write event handler is automatically disabled by the
// event handler when it fires.
writeEventsEnabled = false;
- _controller.add(RawSocketEvent.WRITE);
+ _controller.add(RawSocketEvent.write);
},
- closed: () => _controller.add(RawSocketEvent.READ_CLOSED),
+ closed: () => _controller.add(RawSocketEvent.readClosed),
destroyed: () {
- _controller.add(RawSocketEvent.CLOSED);
+ _controller.add(RawSocketEvent.closed);
_controller.close();
},
error: zone.bindUnaryCallbackGuarded((e) {
@@ -1821,21 +1819,21 @@
}
bool get multicastLoopback =>
- _socket.getOption(SocketOption._IP_MULTICAST_LOOP);
+ _socket.getOption(SocketOption._ipMulticastLoop);
void set multicastLoopback(bool value) =>
- _socket.setOption(SocketOption._IP_MULTICAST_LOOP, value);
+ _socket.setOption(SocketOption._ipMulticastLoop, value);
- int get multicastHops => _socket.getOption(SocketOption._IP_MULTICAST_HOPS);
+ int get multicastHops => _socket.getOption(SocketOption._ipMulticastHops);
void set multicastHops(int value) =>
- _socket.setOption(SocketOption._IP_MULTICAST_HOPS, value);
+ _socket.setOption(SocketOption._ipMulticastHops, value);
NetworkInterface get multicastInterface => throw "Not implemented";
void set multicastInterface(NetworkInterface value) =>
throw "Not implemented";
- bool get broadcastEnabled => _socket.getOption(SocketOption._IP_BROADCAST);
+ bool get broadcastEnabled => _socket.getOption(SocketOption._ipBroadcast);
void set broadcastEnabled(bool value) =>
- _socket.setOption(SocketOption._IP_BROADCAST, value);
+ _socket.setOption(SocketOption._ipBroadcast, value);
int get port => _socket.port;
diff --git a/runtime/bin/stdio_patch.dart b/runtime/bin/stdio_patch.dart
index 14bee98..ca8f16e 100644
--- a/runtime/bin/stdio_patch.dart
+++ b/runtime/bin/stdio_patch.dart
@@ -9,11 +9,11 @@
@patch
static Stdin _getStdioInputStream(int fd) {
switch (_getStdioHandleType(fd)) {
- case _STDIO_HANDLE_TYPE_TERMINAL:
- case _STDIO_HANDLE_TYPE_PIPE:
- case _STDIO_HANDLE_TYPE_SOCKET:
+ case _stdioHandleTypeTerminal:
+ case _stdioHandleTypePipe:
+ case _stdioHandleTypeSocket:
return new Stdin._(new _Socket._readPipe(fd), fd);
- case _STDIO_HANDLE_TYPE_FILE:
+ case _stdioHandleTypeFile:
return new Stdin._(new _FileStream.forStdin(), fd);
default:
throw new FileSystemException(
@@ -24,10 +24,10 @@
@patch
static _getStdioOutputStream(int fd) {
switch (_getStdioHandleType(fd)) {
- case _STDIO_HANDLE_TYPE_TERMINAL:
- case _STDIO_HANDLE_TYPE_PIPE:
- case _STDIO_HANDLE_TYPE_SOCKET:
- case _STDIO_HANDLE_TYPE_FILE:
+ case _stdioHandleTypeTerminal:
+ case _stdioHandleTypePipe:
+ case _stdioHandleTypeSocket:
+ case _stdioHandleTypeFile:
return new Stdout._(new IOSink(new _StdConsumer(fd)), fd);
default:
throw new FileSystemException(
diff --git a/runtime/bin/sync_socket_patch.dart b/runtime/bin/sync_socket_patch.dart
index 147b0e1..1f525c1 100644
--- a/runtime/bin/sync_socket_patch.dart
+++ b/runtime/bin/sync_socket_patch.dart
@@ -254,13 +254,13 @@
return;
}
switch (direction) {
- case SocketDirection.RECEIVE:
+ case SocketDirection.receive:
shutdownRead();
break;
- case SocketDirection.SEND:
+ case SocketDirection.send:
shutdownWrite();
break;
- case SocketDirection.BOTH:
+ case SocketDirection.both:
closeSync();
break;
default:
diff --git a/runtime/include/dart_api.h b/runtime/include/dart_api.h
index 1e39caf..b3fdd96 100644
--- a/runtime/include/dart_api.h
+++ b/runtime/include/dart_api.h
@@ -1013,7 +1013,7 @@
*
* \return A valid handle if no error occurs during the operation.
*/
-DART_EXPORT Dart_Handle
+DART_EXPORT DART_WARN_UNUSED_RESULT Dart_Handle
Dart_CreateSnapshot(uint8_t** vm_snapshot_data_buffer,
intptr_t* vm_snapshot_data_size,
uint8_t** isolate_snapshot_data_buffer,
@@ -1035,7 +1035,7 @@
*
* \return A valid handle if no error occurs during the operation.
*/
-DART_EXPORT Dart_Handle
+DART_EXPORT DART_WARN_UNUSED_RESULT Dart_Handle
Dart_CreateScriptSnapshot(uint8_t** script_snapshot_buffer,
intptr_t* script_snapshot_size);
@@ -1245,7 +1245,7 @@
*
* \return A valid handle if no error occurs during the operation.
*/
-DART_EXPORT Dart_Handle Dart_HandleMessage();
+DART_EXPORT DART_WARN_UNUSED_RESULT Dart_Handle Dart_HandleMessage();
/**
* Drains the microtask queue, then blocks the calling thread until the current
@@ -1255,7 +1255,8 @@
number of milliseconds even if no message was received.
* \return A valid handle if no error occurs, otherwise an error handle.
*/
-DART_EXPORT Dart_Handle Dart_WaitForEvent(int64_t timeout_millis);
+DART_EXPORT DART_WARN_UNUSED_RESULT Dart_Handle
+Dart_WaitForEvent(int64_t timeout_millis);
/**
* Handles any pending messages for the vm service for the current
@@ -1295,7 +1296,7 @@
* exception or other error occurs while processing messages, an
* error handle is returned.
*/
-DART_EXPORT Dart_Handle Dart_RunLoop();
+DART_EXPORT DART_WARN_UNUSED_RESULT Dart_Handle Dart_RunLoop();
/* TODO(turnidge): Should this be removed from the public api? */
/**
@@ -2218,10 +2219,11 @@
* then the new object. If an error occurs during execution, then an
* error handle is returned.
*/
-DART_EXPORT Dart_Handle Dart_New(Dart_Handle type,
- Dart_Handle constructor_name,
- int number_of_arguments,
- Dart_Handle* arguments);
+DART_EXPORT DART_WARN_UNUSED_RESULT Dart_Handle
+Dart_New(Dart_Handle type,
+ Dart_Handle constructor_name,
+ int number_of_arguments,
+ Dart_Handle* arguments);
/**
* Allocate a new object without invoking a constructor.
@@ -2231,7 +2233,7 @@
* \return The new object. If an error occurs during execution, then an
* error handle is returned.
*/
-DART_EXPORT Dart_Handle Dart_Allocate(Dart_Handle type);
+DART_EXPORT DART_WARN_UNUSED_RESULT Dart_Handle Dart_Allocate(Dart_Handle type);
/**
* Allocate a new object without invoking a constructor, and sets specified
@@ -2272,10 +2274,11 @@
* successfully, then the return value is returned. If an error
* occurs during execution, then an error handle is returned.
*/
-DART_EXPORT Dart_Handle Dart_Invoke(Dart_Handle target,
- Dart_Handle name,
- int number_of_arguments,
- Dart_Handle* arguments);
+DART_EXPORT DART_WARN_UNUSED_RESULT Dart_Handle
+Dart_Invoke(Dart_Handle target,
+ Dart_Handle name,
+ int number_of_arguments,
+ Dart_Handle* arguments);
/* TODO(turnidge): Document how to invoke operators. */
/**
@@ -2287,9 +2290,10 @@
* invoking the closure is returned. If an error occurs during
* execution, then an error handle is returned.
*/
-DART_EXPORT Dart_Handle Dart_InvokeClosure(Dart_Handle closure,
- int number_of_arguments,
- Dart_Handle* arguments);
+DART_EXPORT DART_WARN_UNUSED_RESULT Dart_Handle
+Dart_InvokeClosure(Dart_Handle closure,
+ int number_of_arguments,
+ Dart_Handle* arguments);
/**
* Invokes a Generative Constructor on an object that was previously
@@ -2311,10 +2315,11 @@
* successfully, then the object is returned. If an error
* occurs during execution, then an error handle is returned.
*/
-DART_EXPORT Dart_Handle Dart_InvokeConstructor(Dart_Handle object,
- Dart_Handle name,
- int number_of_arguments,
- Dart_Handle* arguments);
+DART_EXPORT DART_WARN_UNUSED_RESULT Dart_Handle
+Dart_InvokeConstructor(Dart_Handle object,
+ Dart_Handle name,
+ int number_of_arguments,
+ Dart_Handle* arguments);
/**
* Gets the value of a field.
@@ -2336,7 +2341,8 @@
* \return If no error occurs, then the value of the field is
* returned. Otherwise an error handle is returned.
*/
-DART_EXPORT Dart_Handle Dart_GetField(Dart_Handle container, Dart_Handle name);
+DART_EXPORT DART_WARN_UNUSED_RESULT Dart_Handle
+Dart_GetField(Dart_Handle container, Dart_Handle name);
/**
* Sets the value of a field.
@@ -2358,9 +2364,8 @@
*
* \return A valid handle if no error occurs.
*/
-DART_EXPORT Dart_Handle Dart_SetField(Dart_Handle container,
- Dart_Handle name,
- Dart_Handle value);
+DART_EXPORT DART_WARN_UNUSED_RESULT Dart_Handle
+Dart_SetField(Dart_Handle container, Dart_Handle name, Dart_Handle value);
/*
* ==========
@@ -2887,11 +2892,12 @@
*
* \return A valid handle if no error occurs during the operation.
*/
-DART_EXPORT Dart_Handle Dart_LoadScript(Dart_Handle url,
- Dart_Handle resolved_url,
- Dart_Handle source,
- intptr_t line_offset,
- intptr_t col_offset);
+DART_EXPORT DART_WARN_UNUSED_RESULT Dart_Handle
+Dart_LoadScript(Dart_Handle url,
+ Dart_Handle resolved_url,
+ Dart_Handle source,
+ intptr_t line_offset,
+ intptr_t col_offset);
/**
* Loads the root script for current isolate from a script snapshot. The
@@ -2919,8 +2925,8 @@
*
* \return A handle to the root library, or an error.
*/
-DART_EXPORT Dart_Handle Dart_LoadScriptFromKernel(const uint8_t* kernel_buffer,
- intptr_t kernel_size);
+DART_EXPORT DART_WARN_UNUSED_RESULT Dart_Handle
+Dart_LoadScriptFromKernel(const uint8_t* kernel_buffer, intptr_t kernel_size);
/**
* Constructs an in-memory kernel program form a binary.
@@ -3039,11 +3045,12 @@
*
* \return A valid handle if no error occurs during the operation.
*/
-DART_EXPORT Dart_Handle Dart_LoadLibrary(Dart_Handle url,
- Dart_Handle resolved_url,
- Dart_Handle source,
- intptr_t line_offset,
- intptr_t column_offset);
+DART_EXPORT DART_WARN_UNUSED_RESULT Dart_Handle
+Dart_LoadLibrary(Dart_Handle url,
+ Dart_Handle resolved_url,
+ Dart_Handle source,
+ intptr_t line_offset,
+ intptr_t column_offset);
/**
* Called by the embedder to load a partial program. Does not set the root
@@ -3055,8 +3062,9 @@
*
* \return A handle to the main library of the compilation unit, or an error.
*/
-DART_EXPORT Dart_Handle Dart_LoadLibraryFromKernel(const uint8_t* kernel_buffer,
- intptr_t kernel_buffer_size);
+DART_EXPORT DART_WARN_UNUSED_RESULT Dart_Handle
+Dart_LoadLibraryFromKernel(const uint8_t* kernel_buffer,
+ intptr_t kernel_buffer_size);
/**
* Imports a library into another library, optionally with a prefix.
@@ -3069,9 +3077,10 @@
*
* \return A valid handle if no error occurs during the operation.
*/
-DART_EXPORT Dart_Handle Dart_LibraryImportLibrary(Dart_Handle library,
- Dart_Handle import,
- Dart_Handle prefix);
+DART_EXPORT DART_WARN_UNUSED_RESULT Dart_Handle
+Dart_LibraryImportLibrary(Dart_Handle library,
+ Dart_Handle import,
+ Dart_Handle prefix);
/**
* Returns a flattened list of pairs. The first element in each pair is the
@@ -3109,12 +3118,13 @@
*
* \return A valid handle if no error occurs during the operation.
*/
-DART_EXPORT Dart_Handle Dart_LoadSource(Dart_Handle library,
- Dart_Handle url,
- Dart_Handle resolved_url,
- Dart_Handle source,
- intptr_t line_offset,
- intptr_t column_offset);
+DART_EXPORT DART_WARN_UNUSED_RESULT Dart_Handle
+Dart_LoadSource(Dart_Handle library,
+ Dart_Handle url,
+ Dart_Handle resolved_url,
+ Dart_Handle source,
+ intptr_t line_offset,
+ intptr_t column_offset);
/**
* Loads a patch source string into a library.
@@ -3123,9 +3133,10 @@
* \param url A url identifying the origin of the patch source
* \param source A string of Dart patch source
*/
-DART_EXPORT Dart_Handle Dart_LibraryLoadPatch(Dart_Handle library,
- Dart_Handle url,
- Dart_Handle patch_source);
+DART_EXPORT DART_WARN_UNUSED_RESULT Dart_Handle
+Dart_LibraryLoadPatch(Dart_Handle library,
+ Dart_Handle url,
+ Dart_Handle patch_source);
/**
* Indicates that all outstanding load requests have been satisfied.
@@ -3140,7 +3151,8 @@
* \return Success if all classes have been finalized and deferred library
* futures are completed. Otherwise, returns an error.
*/
-DART_EXPORT Dart_Handle Dart_FinalizeLoading(bool complete_futures);
+DART_EXPORT DART_WARN_UNUSED_RESULT Dart_Handle
+Dart_FinalizeLoading(bool complete_futures);
/*
* =====
@@ -3266,8 +3278,8 @@
* \param size Returns the size of the buffer.
* \return Returns an valid handle upon success.
*/
-DART_EXPORT Dart_Handle Dart_SaveCompilationTrace(uint8_t** buffer,
- intptr_t* buffer_length);
+DART_EXPORT DART_WARN_UNUSED_RESULT Dart_Handle
+Dart_SaveCompilationTrace(uint8_t** buffer, intptr_t* buffer_length);
/**
* Compile all functions from data from Dart_SaveCompilationTrace. Unlike JIT
@@ -3277,8 +3289,8 @@
*
* \return Returns an error handle if a compilation error was encountered.
*/
-DART_EXPORT Dart_Handle Dart_LoadCompilationTrace(uint8_t* buffer,
- intptr_t buffer_length);
+DART_EXPORT DART_WARN_UNUSED_RESULT Dart_Handle
+Dart_LoadCompilationTrace(uint8_t* buffer, intptr_t buffer_length);
/*
* ==============
@@ -3325,7 +3337,7 @@
*
* \return A valid handle if no error occurs during the operation.
*/
-DART_EXPORT Dart_Handle
+DART_EXPORT DART_WARN_UNUSED_RESULT Dart_Handle
Dart_CreateAppAOTSnapshotAsAssembly(Dart_StreamingWriteCallback callback,
void* callback_data);
@@ -3333,7 +3345,7 @@
* Like Dart_CreateAppAOTSnapshotAsAssembly, but only includes
* kDartVmSnapshotData and kDartVmSnapshotInstructions.
*/
-DART_EXPORT Dart_Handle
+DART_EXPORT DART_WARN_UNUSED_RESULT Dart_Handle
Dart_CreateVMAOTSnapshotAsAssembly(Dart_StreamingWriteCallback callback,
void* callback_data);
@@ -3343,7 +3355,7 @@
* instructions pieces must be loaded with read and execute permissions; the
* other pieces may be loaded as read-only.
*/
-DART_EXPORT Dart_Handle
+DART_EXPORT DART_WARN_UNUSED_RESULT Dart_Handle
Dart_CreateAppAOTSnapshotAsBlobs(uint8_t** vm_snapshot_data_buffer,
intptr_t* vm_snapshot_data_size,
uint8_t** vm_snapshot_instructions_buffer,
@@ -3362,7 +3374,7 @@
*
* \return A valid handle if no error occurs during the operation.
*/
-DART_EXPORT Dart_Handle Dart_SortClasses();
+DART_EXPORT DART_WARN_UNUSED_RESULT Dart_Handle Dart_SortClasses();
/**
* Creates a snapshot that caches compiled code and type feedback for faster
@@ -3386,7 +3398,7 @@
*
* \return A valid handle if no error occurs during the operation.
*/
-DART_EXPORT Dart_Handle
+DART_EXPORT DART_WARN_UNUSED_RESULT Dart_Handle
Dart_CreateAppJITSnapshotAsBlobs(uint8_t** isolate_snapshot_data_buffer,
intptr_t* isolate_snapshot_data_size,
uint8_t** isolate_snapshot_instructions_buffer,
@@ -3395,7 +3407,8 @@
/**
* Like Dart_CreateAppJITSnapshotAsBlobs, but also creates a new VM snapshot.
*/
-DART_EXPORT Dart_Handle Dart_CreateCoreJITSnapshotAsBlobs(
+DART_EXPORT DART_WARN_UNUSED_RESULT Dart_Handle
+Dart_CreateCoreJITSnapshotAsBlobs(
uint8_t** vm_snapshot_data_buffer,
intptr_t* vm_snapshot_data_size,
uint8_t** vm_snapshot_instructions_buffer,
@@ -3414,8 +3427,8 @@
* \return Returns an error handler if the VM was built in a mode that does not
* support obfuscation.
*/
-DART_EXPORT Dart_Handle Dart_GetObfuscationMap(uint8_t** buffer,
- intptr_t* buffer_length);
+DART_EXPORT DART_WARN_UNUSED_RESULT Dart_Handle
+Dart_GetObfuscationMap(uint8_t** buffer, intptr_t* buffer_length);
/**
* Returns whether the VM only supports running from precompiled snapshots and
diff --git a/runtime/include/dart_native_api.h b/runtime/include/dart_native_api.h
index 10fde6e..934ef3d 100644
--- a/runtime/include/dart_native_api.h
+++ b/runtime/include/dart_native_api.h
@@ -167,12 +167,12 @@
*
* TODO(turnidge): Document.
*/
-DART_EXPORT Dart_Handle Dart_CompileAll();
+DART_EXPORT DART_WARN_UNUSED_RESULT Dart_Handle Dart_CompileAll();
/**
* Parses all loaded functions in the current isolate..
*
*/
-DART_EXPORT Dart_Handle Dart_ParseAll();
+DART_EXPORT DART_WARN_UNUSED_RESULT Dart_Handle Dart_ParseAll();
#endif /* INCLUDE_DART_NATIVE_API_H_ */ /* NOLINT */
diff --git a/runtime/lib/bigint_patch.dart b/runtime/lib/bigint_patch.dart
index 7516712..0b0cd0f 100644
--- a/runtime/lib/bigint_patch.dart
+++ b/runtime/lib/bigint_patch.dart
@@ -2628,7 +2628,8 @@
}
_BigIntImpl _revert(Uint32List xDigits, int xUsed) {
- var resultDigits = _newDigits(2 * _normModulusUsed);
+ // Reserve enough digits for modulus squaring and accumulator carry.
+ var resultDigits = _newDigits(2 * _normModulusUsed + 2);
var i = xUsed + (xUsed & 1);
while (--i >= 0) {
resultDigits[i] = xDigits[i];
@@ -2640,8 +2641,8 @@
// x = x/R mod _modulus.
// Returns xUsed.
int _reduce(Uint32List xDigits, int xUsed) {
- while (xUsed < 2 * _normModulusUsed) {
- // Pad x so _mulAdd has enough room later.
+ while (xUsed < 2 * _normModulusUsed + 2) {
+ // Pad x so _mulAdd has enough room later for a possible carry.
xDigits[xUsed++] = 0;
}
var i = 0;
diff --git a/runtime/lib/compact_hash.dart b/runtime/lib/compact_hash.dart
index 6f55f41..82bc532 100644
--- a/runtime/lib/compact_hash.dart
+++ b/runtime/lib/compact_hash.dart
@@ -78,14 +78,19 @@
static const int _UNUSED_PAIR = 0;
static const int _DELETED_PAIR = 1;
- // The top bits are wasted to avoid Mint allocation.
+ // On 32-bit, the top bits are wasted to avoid Mint allocation.
+ // TODO(koda): Reclaim the bits by making the compiler treat hash patterns
+ // as unsigned words.
static int _indexSizeToHashMask(int indexSize) {
int indexBits = indexSize.bitLength - 2;
- return (1 << (30 - indexBits)) - 1;
+ return internal.is64Bit
+ ? (1 << (32 - indexBits)) - 1
+ : (1 << (30 - indexBits)) - 1;
}
static int _hashPattern(int fullHash, int hashMask, int size) {
final int maskedHash = fullHash & hashMask;
+ // TODO(koda): Consider keeping bit length and use left shift.
return (maskedHash == 0) ? (size >> 1) : maskedHash * (size >> 1);
}
diff --git a/runtime/lib/integers_patch.dart b/runtime/lib/integers_patch.dart
index 15598fe..d1c13be 100644
--- a/runtime/lib/integers_patch.dart
+++ b/runtime/lib/integers_patch.dart
@@ -32,7 +32,7 @@
return null; // Empty.
}
}
- var smiLimit = 9;
+ var smiLimit = is64Bit ? 18 : 9;
if ((last - ix) >= smiLimit) {
return null; // May not fit into a Smi.
}
@@ -133,7 +133,7 @@
static int _parseRadix(
String source, int radix, int start, int end, int sign) {
- int tableIndex = (radix - 2) * 2;
+ int tableIndex = (radix - 2) * 4 + (is64Bit ? 2 : 0);
int blockSize = _PARSE_LIMITS[tableIndex];
int length = end - start;
if (length <= blockSize) {
@@ -159,7 +159,7 @@
int positiveOverflowLimit = 0;
int negativeOverflowLimit = 0;
if (_limitIntsTo64Bits) {
- tableIndex = tableIndex << 1; // Pre-multiply by 2 for simpler indexing.
+ tableIndex = tableIndex << 1; // pre-multiply by 2 for simpler indexing
positiveOverflowLimit = _int64OverflowLimits[tableIndex];
if (positiveOverflowLimit == 0) {
positiveOverflowLimit =
@@ -175,10 +175,14 @@
if (result >= positiveOverflowLimit) {
if ((result > positiveOverflowLimit) ||
(smi > _int64OverflowLimits[tableIndex + 2])) {
+ // Although the unsigned overflow limits do not depend on the
+ // platform, the multiplier and block size, which are used to
+ // compute it, do.
+ int X = is64Bit ? 1 : 0;
if (radix == 16 &&
- !(result >= _int64UnsignedOverflowLimit &&
- (result > _int64UnsignedOverflowLimit ||
- smi > _int64UnsignedSmiOverflowLimit)) &&
+ !(result >= _int64UnsignedOverflowLimits[X] &&
+ (result > _int64UnsignedOverflowLimits[X] ||
+ smi > _int64UnsignedSmiOverflowLimits[X])) &&
blockEnd + blockSize > end) {
return (result * multiplier) + smi;
}
@@ -223,42 +227,43 @@
// For each radix, 2-36, how many digits are guaranteed to fit in a smi,
// and magnitude of such a block (radix ** digit-count).
+ // 32-bit limit/multiplier at (radix - 2)*4, 64-bit limit at (radix-2)*4+2
static const _PARSE_LIMITS = const [
- 30, 1073741824, // radix: 2
- 18, 387420489,
- 15, 1073741824,
- 12, 244140625, // radix: 5
- 11, 362797056,
- 10, 282475249,
- 10, 1073741824,
- 9, 387420489,
- 9, 1000000000, // radix: 10
- 8, 214358881,
- 8, 429981696,
- 8, 815730721,
- 7, 105413504,
- 7, 170859375, // radix: 15
- 7, 268435456,
- 7, 410338673,
- 7, 612220032,
- 7, 893871739,
- 6, 64000000, // radix: 20
- 6, 85766121,
- 6, 113379904,
- 6, 148035889,
- 6, 191102976,
- 6, 244140625, // radix: 25
- 6, 308915776,
- 6, 387420489,
- 6, 481890304,
- 6, 594823321,
- 6, 729000000, // radix: 30
- 6, 887503681,
- 6, 1073741824,
- 5, 39135393,
- 5, 45435424,
- 5, 52521875, // radix: 35
- 5, 60466176,
+ 30, 1073741824, 62, 4611686018427387904, // radix: 2
+ 18, 387420489, 39, 4052555153018976267,
+ 15, 1073741824, 30, 1152921504606846976,
+ 12, 244140625, 26, 1490116119384765625, // radix: 5
+ 11, 362797056, 23, 789730223053602816,
+ 10, 282475249, 22, 3909821048582988049,
+ 10, 1073741824, 20, 1152921504606846976,
+ 9, 387420489, 19, 1350851717672992089,
+ 9, 1000000000, 18, 1000000000000000000, // radix: 10
+ 8, 214358881, 17, 505447028499293771,
+ 8, 429981696, 17, 2218611106740436992,
+ 8, 815730721, 16, 665416609183179841,
+ 7, 105413504, 16, 2177953337809371136,
+ 7, 170859375, 15, 437893890380859375, // radix: 15
+ 7, 268435456, 15, 1152921504606846976,
+ 7, 410338673, 15, 2862423051509815793,
+ 7, 612220032, 14, 374813367582081024,
+ 7, 893871739, 14, 799006685782884121,
+ 6, 64000000, 14, 1638400000000000000, // radix: 20
+ 6, 85766121, 14, 3243919932521508681,
+ 6, 113379904, 13, 282810057883082752,
+ 6, 148035889, 13, 504036361936467383,
+ 6, 191102976, 13, 876488338465357824,
+ 6, 244140625, 13, 1490116119384765625, // radix: 25
+ 6, 308915776, 13, 2481152873203736576,
+ 6, 387420489, 13, 4052555153018976267,
+ 6, 481890304, 12, 232218265089212416,
+ 6, 594823321, 12, 353814783205469041,
+ 6, 729000000, 12, 531441000000000000, // radix: 30
+ 6, 887503681, 12, 787662783788549761,
+ 6, 1073741824, 12, 1152921504606846976,
+ 5, 39135393, 12, 1667889514952984961,
+ 5, 45435424, 12, 2386420683693101056,
+ 5, 52521875, 12, 3379220508056640625, // radix: 35
+ 5, 60466176, 11, 131621703842267136,
];
/// Flag indicating if integers are limited by 64 bits
@@ -268,8 +273,11 @@
static const _maxInt64 = 0x7fffffffffffffff;
static const _minInt64 = -_maxInt64 - 1;
- static const _int64UnsignedOverflowLimit = 0xfffffffff;
- static const _int64UnsignedSmiOverflowLimit = 0xfffffff;
+ static const _int64UnsignedOverflowLimits = const [0xfffffffff, 0xf];
+ static const _int64UnsignedSmiOverflowLimits = const [
+ 0xfffffff,
+ 0xfffffffffffffff
+ ];
/// In the `--limit-ints-to-64-bits` mode calculation of the expression
///
diff --git a/runtime/lib/internal_patch.dart b/runtime/lib/internal_patch.dart
index dc6b038..fb640c3 100644
--- a/runtime/lib/internal_patch.dart
+++ b/runtime/lib/internal_patch.dart
@@ -93,11 +93,12 @@
}
}
-// Prepend the parent type arguments (maybe null) to the function type
-// arguments (may be null). The result is null if both input vectors are null
-// or is a newly allocated and canonicalized vector of length 'len'.
-_prependTypeArguments(functionTypeArguments, parentTypeArguments, len)
- native "Internal_prependTypeArguments";
+// Prepend the parent type arguments (maybe null) of length 'parentLen' to the
+// function type arguments (may be null). The result is null if both input
+// vectors are null or is a newly allocated and canonicalized vector of length
+// 'totalLen'.
+_prependTypeArguments(functionTypeArguments, parentTypeArguments, parentLen,
+ totalLen) native "Internal_prependTypeArguments";
// Called by IRRegExpMacroAssembler::GrowStack.
Int32List _growRegExpStack(Int32List stack) {
diff --git a/runtime/lib/mirrors.cc b/runtime/lib/mirrors.cc
index 8783fee..362842d 100644
--- a/runtime/lib/mirrors.cc
+++ b/runtime/lib/mirrors.cc
@@ -34,7 +34,9 @@
const Object& result = Object::Handle(DartLibraryCalls::InstanceCreate(
mirrors_lib, mirror_class_name, constructor_name, constructor_arguments));
- ASSERT(!result.IsError());
+ if (result.IsError()) {
+ Exceptions::PropagateError(Error::Cast(result));
+ }
return Instance::Cast(result).raw();
}
diff --git a/runtime/lib/mirrors_impl.dart b/runtime/lib/mirrors_impl.dart
index 6ee28f1..4688f63 100644
--- a/runtime/lib/mirrors_impl.dart
+++ b/runtime/lib/mirrors_impl.dart
@@ -4,13 +4,11 @@
// part of "mirrors_patch.dart";
-var _dirty = false;
-// Note: _emtpyList needs to be assignable to List<T> for any T hence Null.
-final _emptyList = new UnmodifiableListView<Null>([]);
+var _dirty = false; // Set to true by the VM when more libraries are loaded.
-class _InternalMirrorError {
+class _InternalMirrorError extends Error {
final String _msg;
- const _InternalMirrorError(this._msg);
+ _InternalMirrorError(this._msg);
String toString() => _msg;
}
@@ -65,13 +63,13 @@
SourceLocation _location(reflectee) native "DeclarationMirror_location";
-List _metadata(reflectee) native 'DeclarationMirror_metadata';
+List<dynamic> _metadata(reflectee) native 'DeclarationMirror_metadata';
bool _subtypeTest(Type a, Type b) native 'TypeMirror_subtypeTest';
-class _AccessorCacheAssociation {
+class _AccessorCacheAssociation<T extends Function> {
String key;
- Function value;
+ T value;
bool usedSinceGrowth = true;
_AccessorCacheAssociation(this.key, this.value);
}
@@ -82,7 +80,7 @@
* grow again. Implemented as an open addressing hash table.
*/
class _AccessorCache<T extends Function> {
- List table;
+ List<_AccessorCacheAssociation<T>> table;
int shift;
int mask;
int capacity; // Max number of associations before we start evicting/growing.
@@ -94,7 +92,9 @@
_AccessorCache.withInitialShift(int shift) {
// The scheme used here for handling collisions relies on there always
// being at least one empty slot.
- if (shift < 1) throw new Exception("_AccessorCache requires a shift >= 1");
+ if (shift < 1) {
+ throw new _InternalMirrorError("_AccessorCache requires a shift >= 1");
+ }
initWithShift(shift);
}
@@ -102,7 +102,7 @@
this.shift = shift;
this.mask = (1 << shift) - 1;
this.capacity = (1 << shift) * 3 ~/ 4;
- this.table = new List(1 << shift);
+ this.table = new List<_AccessorCacheAssociation<T>>(1 << shift);
assert(table.length > capacity);
}
@@ -118,7 +118,7 @@
} while (index != start);
// Should never happen because we start evicting associations before the
// table is full.
- throw new Exception("Internal error: _AccessorCache table full");
+ throw new _InternalMirrorError("Internal error: _AccessorCache table full");
}
int scanForEmpty(String key) {
@@ -132,7 +132,7 @@
} while (index != start);
// Should never happen because we start evicting associations before the
// table is full.
- throw new Exception("Internal error: _AccessorCache table full");
+ throw new _InternalMirrorError("Internal error: _AccessorCache table full");
}
void fixCollisionsAfter(int start) {
@@ -218,16 +218,19 @@
var _libraries;
Map<Uri, LibraryMirror> get libraries {
if ((_libraries == null) || _dirty) {
- _libraries = new Map<Uri, LibraryMirror>.fromIterable(_computeLibraries(),
- key: (e) => e.uri);
+ _libraries = new Map<Uri, LibraryMirror>();
+ for (LibraryMirror lib in _computeLibraries()) {
+ _libraries[lib.uri] = lib;
+ }
+ _libraries = new UnmodifiableMapView<Uri, LibraryMirror>(_libraries);
_dirty = false;
}
return _libraries;
}
- static _computeLibraries() native "MirrorSystem_libraries";
+ static List<dynamic> _computeLibraries() native "MirrorSystem_libraries";
- var _isolate;
+ IsolateMirror _isolate;
IsolateMirror get isolate {
if (_isolate == null) {
_isolate = _computeIsolate();
@@ -235,7 +238,7 @@
return _isolate;
}
- static _computeIsolate() native "MirrorSystem_isolate";
+ static IsolateMirror _computeIsolate() native "MirrorSystem_isolate";
String toString() => "MirrorSystem for isolate '${isolate.debugName}'";
}
@@ -298,13 +301,13 @@
TypeMirror get returnType => _target.type;
List<ParameterMirror> get parameters {
- if (isGetter) return _emptyList;
- return new UnmodifiableListView(
- [new _SyntheticSetterParameter(this, this._target)]);
+ if (isGetter) return const <ParameterMirror>[];
+ return new UnmodifiableListView<ParameterMirror>(
+ <ParameterMirror>[new _SyntheticSetterParameter(this, this._target)]);
}
SourceLocation get location => null;
- List<InstanceMirror> get metadata => _emptyList;
+ List<InstanceMirror> get metadata => const <InstanceMirror>[];
String get source => null;
}
@@ -328,7 +331,7 @@
bool get hasDefaultValue => false;
InstanceMirror get defaultValue => null;
SourceLocation get location => null;
- List<InstanceMirror> get metadata => _emptyList;
+ List<InstanceMirror> get metadata => const <InstanceMirror>[];
}
abstract class _LocalObjectMirror extends _LocalMirror implements ObjectMirror {
@@ -608,7 +611,7 @@
return _simpleName;
}
- Symbol _qualifiedName = null;
+ Symbol _qualifiedName;
Symbol get qualifiedName {
if (_qualifiedName == null) {
_qualifiedName = _computeQualifiedName(owner, simpleName);
@@ -658,8 +661,8 @@
_superinterfaces = isOriginalDeclaration
? _nativeInterfaces(_reflectedType)
: _nativeInterfacesInstantiated(_reflectedType);
- _superinterfaces =
- new UnmodifiableListView(_superinterfaces.map(reflectType));
+ _superinterfaces = new UnmodifiableListView<ClassMirror>(
+ _superinterfaces.map(reflectType));
}
return _superinterfaces;
}
@@ -787,10 +790,12 @@
return true;
}
- List<TypeVariableMirror> _typeVariables = null;
+ List<TypeVariableMirror> _typeVariables;
List<TypeVariableMirror> get typeVariables {
if (_typeVariables == null) {
- if (_isAnonymousMixinApplication) return _typeVariables = _emptyList;
+ if (_isAnonymousMixinApplication) {
+ return _typeVariables = const <TypeVariableMirror>[];
+ }
_typeVariables = new List<TypeVariableMirror>();
List params = _ClassMirror_type_variables(_reflectee);
@@ -800,19 +805,20 @@
mirror = new _LocalTypeVariableMirror(params[i + 1], params[i], owner);
_typeVariables.add(mirror);
}
- _typeVariables = new UnmodifiableListView(_typeVariables);
+ _typeVariables =
+ new UnmodifiableListView<TypeVariableMirror>(_typeVariables);
}
return _typeVariables;
}
- List<TypeMirror> _typeArguments = null;
+ List<TypeMirror> _typeArguments;
List<TypeMirror> get typeArguments {
if (_typeArguments == null) {
if (_isGenericDeclaration || _isAnonymousMixinApplication) {
- _typeArguments = _emptyList;
+ _typeArguments = const <TypeMirror>[];
} else {
- _typeArguments =
- new UnmodifiableListView(_computeTypeArguments(_reflectedType));
+ _typeArguments = new UnmodifiableListView<TypeMirror>(
+ _computeTypeArguments(_reflectedType).cast<TypeMirror>());
}
}
return _typeArguments;
@@ -856,7 +862,8 @@
List<InstanceMirror> get metadata {
// Get the metadata objects, convert them into InstanceMirrors using
// reflect() and then make them into a Dart list.
- return new UnmodifiableListView(_metadata(_reflectee).map(reflect));
+ return new UnmodifiableListView<InstanceMirror>(
+ _metadata(_reflectee).map(reflect));
}
bool operator ==(other) {
@@ -895,26 +902,28 @@
return false;
}
- static _libraryUri(reflectee) native "ClassMirror_libraryUri";
+ static String _libraryUri(reflectee) native "ClassMirror_libraryUri";
- static _supertype(reflectedType) native "ClassMirror_supertype";
+ static Type _supertype(reflectedType) native "ClassMirror_supertype";
- static _supertypeInstantiated(reflectedType)
+ static Type _supertypeInstantiated(reflectedType)
native "ClassMirror_supertype_instantiated";
- static _nativeInterfaces(reflectedType) native "ClassMirror_interfaces";
+ static List<dynamic> _nativeInterfaces(reflectedType)
+ native "ClassMirror_interfaces";
- static _nativeInterfacesInstantiated(reflectedType)
+ static List<dynamic> _nativeInterfacesInstantiated(reflectedType)
native "ClassMirror_interfaces_instantiated";
- static _nativeMixin(reflectedType) native "ClassMirror_mixin";
+ static Type _nativeMixin(reflectedType) native "ClassMirror_mixin";
- static _nativeMixinInstantiated(reflectedType, instantiator)
+ static Type _nativeMixinInstantiated(reflectedType, instantiator)
native "ClassMirror_mixin_instantiated";
- _computeMembers(reflectee, instantiator) native "ClassMirror_members";
+ List<dynamic> _computeMembers(reflectee, instantiator)
+ native "ClassMirror_members";
- _computeConstructors(reflectee, instantiator)
+ List<dynamic> _computeConstructors(reflectee, instantiator)
native "ClassMirror_constructors";
_invoke(reflectee, memberName, arguments, argumentNames)
@@ -927,10 +936,11 @@
static _invokeConstructor(reflectee, type, constructorName, arguments,
argumentNames) native 'ClassMirror_invokeConstructor';
- static _ClassMirror_type_variables(reflectee)
+ static List<dynamic> _ClassMirror_type_variables(reflectee)
native "ClassMirror_type_variables";
- static _computeTypeArguments(reflectee) native "ClassMirror_type_arguments";
+ static List<dynamic> _computeTypeArguments(reflectee)
+ native "ClassMirror_type_arguments";
}
class _LocalFunctionTypeMirror extends _LocalClassMirror
@@ -943,7 +953,7 @@
bool get _isAnonymousMixinApplication => false;
// FunctionTypeMirrors have a simpleName generated from their signature.
- Symbol _simpleName = null;
+ Symbol _simpleName;
Symbol get simpleName {
if (_simpleName == null) {
_simpleName = _s(_makeSignatureString(returnType, parameters));
@@ -959,7 +969,7 @@
return _callMethod;
}
- TypeMirror _returnType = null;
+ TypeMirror _returnType;
TypeMirror get returnType {
if (_returnType == null) {
_returnType =
@@ -968,20 +978,20 @@
return _returnType;
}
- List<ParameterMirror> _parameters = null;
+ List<ParameterMirror> _parameters;
List<ParameterMirror> get parameters {
if (_parameters == null) {
_parameters = _FunctionTypeMirror_parameters(_functionReflectee);
- _parameters = new UnmodifiableListView(_parameters);
+ _parameters = new UnmodifiableListView<ParameterMirror>(_parameters);
}
return _parameters;
}
bool get isOriginalDeclaration => true;
ClassMirror get originalDeclaration => this;
- get typeVariables => _emptyList;
- get typeArguments => _emptyList;
- get metadata => _emptyList;
+ get typeVariables => const <TypeVariableMirror>[];
+ get typeArguments => const <TypeMirror>[];
+ get metadata => const <InstanceMirror>[];
get location => null;
String toString() => "FunctionTypeMirror on '${_n(simpleName)}'";
@@ -992,7 +1002,7 @@
static Type _FunctionTypeMirror_return_type(functionReflectee)
native "FunctionTypeMirror_return_type";
- List<ParameterMirror> _FunctionTypeMirror_parameters(functionReflectee)
+ List<dynamic> _FunctionTypeMirror_parameters(functionReflectee)
native "FunctionTypeMirror_parameters";
}
@@ -1005,7 +1015,7 @@
Symbol get simpleName => _simpleName;
- Symbol _qualifiedName = null;
+ Symbol _qualifiedName;
Symbol get qualifiedName {
if (_qualifiedName == null) {
_qualifiedName = _computeQualifiedName(owner, simpleName);
@@ -1022,7 +1032,8 @@
List<InstanceMirror> get metadata {
// Get the metadata objects, convert them into InstanceMirrors using
// reflect() and then make them into a Dart list.
- return new UnmodifiableListView(_metadata(_reflectee).map(reflect));
+ return new UnmodifiableListView<InstanceMirror>(
+ _metadata(_reflectee).map(reflect));
}
bool operator ==(other) {
@@ -1050,7 +1061,7 @@
bool get isStatic => false;
bool get isTopLevel => false;
- TypeMirror _upperBound = null;
+ TypeMirror _upperBound;
TypeMirror get upperBound {
if (_upperBound == null) {
_upperBound = reflectType(_TypeVariableMirror_upper_bound(_reflectee));
@@ -1065,8 +1076,8 @@
Type get _reflectedType => _reflectee;
- List<TypeVariableMirror> get typeVariables => _emptyList;
- List<TypeMirror> get typeArguments => _emptyList;
+ List<TypeVariableMirror> get typeVariables => const <TypeVariableMirror>[];
+ List<TypeMirror> get typeArguments => const <TypeMirror>[];
bool get isOriginalDeclaration => true;
TypeMirror get originalDeclaration => this;
@@ -1124,7 +1135,7 @@
return _owner;
}
- _LocalFunctionTypeMirror _referent = null;
+ _LocalFunctionTypeMirror _referent;
FunctionTypeMirror get referent {
if (_referent == null) {
_referent = _nativeReferent(_reflectedType);
@@ -1152,7 +1163,7 @@
}
}
- List<TypeVariableMirror> _typeVariables = null;
+ List<TypeVariableMirror> _typeVariables;
List<TypeVariableMirror> get typeVariables {
if (_typeVariables == null) {
_typeVariables = new List<TypeVariableMirror>();
@@ -1167,14 +1178,15 @@
return _typeVariables;
}
- List<TypeMirror> _typeArguments = null;
+ List<TypeMirror> _typeArguments;
List<TypeMirror> get typeArguments {
if (_typeArguments == null) {
if (_isGenericDeclaration) {
- _typeArguments = _emptyList;
+ _typeArguments = const <TypeMirror>[];
} else {
- _typeArguments = new UnmodifiableListView(
- _LocalClassMirror._computeTypeArguments(_reflectedType));
+ _typeArguments = new UnmodifiableListView<TypeMirror>(_LocalClassMirror
+ ._computeTypeArguments(_reflectedType)
+ .cast<TypeMirror>());
}
}
return _typeArguments;
@@ -1197,9 +1209,11 @@
_subtypeTest(otherReflectedType, _reflectedType);
}
- static _nativeReferent(reflectedType) native "TypedefMirror_referent";
+ static FunctionTypeMirror _nativeReferent(reflectedType)
+ native "TypedefMirror_referent";
- static _nativeDeclaration(reflectedType) native "TypedefMirror_declaration";
+ static TypedefMirror _nativeDeclaration(reflectedType)
+ native "TypedefMirror_declaration";
}
Symbol _asSetter(Symbol getter, LibraryMirror library) {
@@ -1247,7 +1261,8 @@
List<InstanceMirror> get metadata {
// Get the metadata objects, convert them into InstanceMirrors using
// reflect() and then make them into a Dart list.
- return new UnmodifiableListView(_metadata(_reflectee).map(reflect));
+ return new UnmodifiableListView<InstanceMirror>(
+ _metadata(_reflectee).map(reflect));
}
bool operator ==(other) {
@@ -1262,12 +1277,15 @@
var _cachedLibraryDependencies;
get libraryDependencies {
if (_cachedLibraryDependencies == null) {
- _cachedLibraryDependencies = _libraryDependencies(_reflectee);
+ _cachedLibraryDependencies =
+ new UnmodifiableListView<LibraryDependencyMirror>(
+ _libraryDependencies(_reflectee).cast<LibraryDependencyMirror>());
}
return _cachedLibraryDependencies;
}
- _libraryDependencies(reflectee) native 'LibraryMirror_libraryDependencies';
+ List<dynamic> _libraryDependencies(reflectee)
+ native 'LibraryMirror_libraryDependencies';
_invoke(reflectee, memberName, arguments, argumentNames)
native 'LibraryMirror_invoke';
@@ -1277,7 +1295,7 @@
_invokeSetter(reflectee, setterName, value)
native 'LibraryMirror_invokeSetter';
- _computeMembers(reflectee) native "LibraryMirror_members";
+ List<dynamic> _computeMembers(reflectee) native "LibraryMirror_members";
}
class _LocalLibraryDependencyMirror extends _LocalMirror
@@ -1297,9 +1315,10 @@
prefixString,
this.isImport,
this.isDeferred,
- unwrappedMetadata)
+ List<dynamic> unwrappedMetadata)
: prefix = _s(prefixString),
- metadata = new UnmodifiableListView(unwrappedMetadata.map(reflect));
+ metadata = new UnmodifiableListView<InstanceMirror>(
+ unwrappedMetadata.map(reflect));
bool get isExport => !isImport;
@@ -1324,7 +1343,8 @@
});
}
- static _tryUpgradePrefix(libraryPrefix) native "LibraryMirror_fromPrefix";
+ static LibraryMirror _tryUpgradePrefix(libraryPrefix)
+ native "LibraryMirror_fromPrefix";
SourceLocation get location => null;
}
@@ -1395,7 +1415,7 @@
bool get isTopLevel => owner is LibraryMirror;
bool get isSynthetic => false;
- TypeMirror _returnType = null;
+ TypeMirror _returnType;
TypeMirror get returnType {
if (_returnType == null) {
if (isConstructor) {
@@ -1408,18 +1428,18 @@
return _returnType;
}
- List<ParameterMirror> _parameters = null;
+ List<ParameterMirror> _parameters;
List<ParameterMirror> get parameters {
if (_parameters == null) {
- _parameters = _MethodMirror_parameters(_reflectee);
- _parameters = new UnmodifiableListView(_parameters);
+ _parameters = new UnmodifiableListView<ParameterMirror>(
+ _MethodMirror_parameters(_reflectee).cast<ParameterMirror>());
}
return _parameters;
}
bool get isRegularMethod => !isGetter && !isSetter && !isConstructor;
- Symbol _constructorName = null;
+ Symbol _constructorName;
Symbol get constructorName {
if (_constructorName == null) {
if (!isConstructor) {
@@ -1460,7 +1480,7 @@
static dynamic _MethodMirror_return_type(reflectee, instantiator)
native "MethodMirror_return_type";
- List<ParameterMirror> _MethodMirror_parameters(reflectee)
+ List<dynamic> _MethodMirror_parameters(reflectee)
native "MethodMirror_parameters";
static String _MethodMirror_source(reflectee) native "MethodMirror_source";
@@ -1553,11 +1573,12 @@
}
List<InstanceMirror> get metadata {
- if (_unmirroredMetadata == null) return _emptyList;
- return new UnmodifiableListView(_unmirroredMetadata.map(reflect));
+ if (_unmirroredMetadata == null) return const <InstanceMirror>[];
+ return new UnmodifiableListView<InstanceMirror>(
+ _unmirroredMetadata.map(reflect));
}
- TypeMirror _type = null;
+ TypeMirror _type;
TypeMirror get type {
if (_type == null) {
_type = reflectType(
@@ -1584,7 +1605,7 @@
DeclarationMirror get owner => null;
SourceLocation get location => null;
- List<InstanceMirror> get metadata => _emptyList;
+ List<InstanceMirror> get metadata => const <InstanceMirror>[];
bool get hasReflectedType => simpleName == #dynamic;
Type get reflectedType {
@@ -1592,8 +1613,8 @@
throw new UnsupportedError("void has no reflected type");
}
- List<TypeVariableMirror> get typeVariables => _emptyList;
- List<TypeMirror> get typeArguments => _emptyList;
+ List<TypeVariableMirror> get typeVariables => const <TypeVariableMirror>[];
+ List<TypeMirror> get typeArguments => const <TypeMirror>[];
bool get isOriginalDeclaration => true;
TypeMirror get originalDeclaration => this;
diff --git a/runtime/lib/object.cc b/runtime/lib/object.cc
index fe0711f..9008f08 100644
--- a/runtime/lib/object.cc
+++ b/runtime/lib/object.cc
@@ -457,14 +457,15 @@
return result.raw();
}
-DEFINE_NATIVE_ENTRY(Internal_prependTypeArguments, 3) {
+DEFINE_NATIVE_ENTRY(Internal_prependTypeArguments, 4) {
const TypeArguments& function_type_arguments =
TypeArguments::CheckedHandle(zone, arguments->NativeArgAt(0));
const TypeArguments& parent_type_arguments =
TypeArguments::CheckedHandle(zone, arguments->NativeArgAt(1));
- GET_NON_NULL_NATIVE_ARGUMENT(Smi, smi_len, arguments->NativeArgAt(2));
- const intptr_t len = smi_len.Value();
- return function_type_arguments.Prepend(zone, parent_type_arguments, len);
+ GET_NON_NULL_NATIVE_ARGUMENT(Smi, smi_parent_len, arguments->NativeArgAt(2));
+ GET_NON_NULL_NATIVE_ARGUMENT(Smi, smi_len, arguments->NativeArgAt(3));
+ return function_type_arguments.Prepend(
+ zone, parent_type_arguments, smi_parent_len.Value(), smi_len.Value());
}
DEFINE_NATIVE_ENTRY(InvocationMirror_unpackTypeArguments, 1) {
diff --git a/runtime/observatory/BUILD.gn b/runtime/observatory/BUILD.gn
index 77571e2..badb8cb 100644
--- a/runtime/observatory/BUILD.gn
+++ b/runtime/observatory/BUILD.gn
@@ -2,9 +2,9 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-import("../../build/dart_host_sdk_toolchain.gni")
+import("../../build/dart/dart_host_sdk_toolchain.gni")
+import("../../build/dart/prebuilt_dart_sdk.gni")
import("../../build/executable_suffix.gni")
-import("../../build/prebuilt_dart_sdk.gni")
import("observatory_sources.gni")
# Construct arguments to the observatory tool for finding pub.
diff --git a/runtime/observatory/lib/src/elements/function_view.dart b/runtime/observatory/lib/src/elements/function_view.dart
index b11bc3a..a829ded 100644
--- a/runtime/observatory/lib/src/elements/function_view.dart
+++ b/runtime/observatory/lib/src/elements/function_view.dart
@@ -401,8 +401,6 @@
return 'closure';
case M.FunctionKind.implicitClosure:
return 'implicit closure';
- case M.FunctionKind.convertedClosure:
- return 'converted closure';
case M.FunctionKind.getter:
return 'getter';
case M.FunctionKind.setter:
diff --git a/runtime/observatory/lib/src/models/objects/function.dart b/runtime/observatory/lib/src/models/objects/function.dart
index 6851759..0d4a997 100644
--- a/runtime/observatory/lib/src/models/objects/function.dart
+++ b/runtime/observatory/lib/src/models/objects/function.dart
@@ -8,7 +8,6 @@
regular,
closure,
implicitClosure,
- convertedClosure,
getter,
setter,
constructor,
diff --git a/runtime/observatory/lib/src/service/object.dart b/runtime/observatory/lib/src/service/object.dart
index 29800f7..1fa79a6 100644
--- a/runtime/observatory/lib/src/service/object.dart
+++ b/runtime/observatory/lib/src/service/object.dart
@@ -3056,8 +3056,6 @@
return M.FunctionKind.closure;
case 'ImplicitClosureFunction':
return M.FunctionKind.implicitClosure;
- case 'ConvertedClosureFunction':
- return M.FunctionKind.convertedClosure;
case 'GetterFunction':
return M.FunctionKind.getter;
case 'SetterFunction':
diff --git a/runtime/observatory/tests/service/evaluate_async_closure_test.dart b/runtime/observatory/tests/service/evaluate_async_closure_test.dart
new file mode 100644
index 0000000..d014683
--- /dev/null
+++ b/runtime/observatory/tests/service/evaluate_async_closure_test.dart
@@ -0,0 +1,29 @@
+// 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=--error_on_bad_type --error_on_bad_override
+
+import 'dart:async';
+
+import 'package:observatory/service_io.dart';
+import 'package:unittest/unittest.dart';
+
+import 'test_helper.dart';
+
+var tests = <IsolateTest>[
+ (Isolate isolate) async {
+ // Silence analyzer on 'dart:async' import.
+ expect(new Future.value(0) != null, isTrue);
+ String test = "(){ "
+ " var k = () { return Future.value(3); }; "
+ " var w = () async { return await k(); }; "
+ " return w(); "
+ "}()";
+ Library lib = await isolate.rootLibrary.load();
+
+ var result = await lib.evaluate(test);
+ expect("$result", equals("Instance(a _Future)"));
+ },
+];
+
+main(args) => runIsolateTests(args, tests);
diff --git a/runtime/observatory/tests/service/service.status b/runtime/observatory/tests/service/service.status
index 55035cd..5a699c0 100644
--- a/runtime/observatory/tests/service/service.status
+++ b/runtime/observatory/tests/service/service.status
@@ -7,6 +7,8 @@
get_isolate_rpc_test: Pass, RuntimeError # Issue 29324
get_retained_size_rpc_test: Pass, RuntimeError # Issue 28193
isolate_lifecycle_test: Pass, RuntimeError # Issue 24174
+pause_on_exceptions_test: Pass, RuntimeError # Issue 33049
+pause_on_start_and_exit_with_child_test: Pass, RuntimeError # Issue 33049
reload_sources_test: Pass, Slow # Reload is slow on the bots
valid_source_locations_test: Pass, Slow # Generally slow, even in release-x64.
diff --git a/runtime/platform/assert.cc b/runtime/platform/assert.cc
index fb7cc88..262548e 100644
--- a/runtime/platform/assert.cc
+++ b/runtime/platform/assert.cc
@@ -10,9 +10,9 @@
namespace dart {
-bool DynamicAssertionHelper::failed_ = false;
+bool Expect::failed_ = false;
-void DynamicAssertionHelper::Fail(const char* format, ...) {
+void DynamicAssertionHelper::Print(const char* format, va_list arguments) {
// Take only the last 1KB of the file name if it is longer.
const intptr_t file_len = strlen(file_);
const intptr_t file_offset = (file_len > (1 * KB)) ? file_len - (1 * KB) : 0;
@@ -25,22 +25,32 @@
snprintf(buffer, sizeof(buffer), "%s: %d: error: ", file, line_);
// Print the error message into the buffer.
- va_list arguments;
- va_start(arguments, format);
vsnprintf(buffer + file_and_line_length,
sizeof(buffer) - file_and_line_length, format, arguments);
- va_end(arguments);
// Print the buffer on stderr and/or syslog.
OS::PrintErr("%s\n", buffer);
+}
- // In case of failed assertions, abort right away. Otherwise, wait
- // until the program is exiting before producing a non-zero exit
+void Assert::Fail(const char* format, ...) {
+ va_list arguments;
+ va_start(arguments, format);
+ Print(format, arguments);
+ va_end(arguments);
+
+ // Abort right away.
+ NOT_IN_PRODUCT(Dart_DumpNativeStackTrace(NULL));
+ OS::Abort();
+}
+
+void Expect::Fail(const char* format, ...) {
+ va_list arguments;
+ va_start(arguments, format);
+ Print(format, arguments);
+ va_end(arguments);
+
+ // Wait until the program is exiting before producing a non-zero exit
// code through abort.
- if (kind_ == ASSERT) {
- NOT_IN_PRODUCT(Dart_DumpNativeStackTrace(NULL));
- OS::Abort();
- }
failed_ = true;
}
diff --git a/runtime/platform/assert.h b/runtime/platform/assert.h
index 1b01b73..48d1443 100644
--- a/runtime/platform/assert.h
+++ b/runtime/platform/assert.h
@@ -26,15 +26,34 @@
class DynamicAssertionHelper {
public:
- enum Kind { ASSERT, EXPECT };
+ DynamicAssertionHelper(const char* file, int line)
+ : file_(file), line_(line) {}
- DynamicAssertionHelper(const char* file, int line, Kind kind)
- : file_(file), line_(line), kind_(kind) {}
+ protected:
+ void Print(const char* format, va_list arguments);
+
+ const char* const file_;
+ const int line_;
+
+ DISALLOW_IMPLICIT_CONSTRUCTORS(DynamicAssertionHelper);
+};
+
+class Assert : public DynamicAssertionHelper {
+ public:
+ Assert(const char* file, int line) : DynamicAssertionHelper(file, line) {}
+
+ DART_NORETURN void Fail(const char* format, ...) PRINTF_ATTRIBUTE(2, 3);
+
+ template <typename T>
+ T NotNull(const T p);
+};
+
+class Expect : public DynamicAssertionHelper {
+ public:
+ Expect(const char* file, int line) : DynamicAssertionHelper(file, line) {}
void Fail(const char* format, ...) PRINTF_ATTRIBUTE(2, 3);
- static bool failed() { return failed_; }
-
#if defined(TESTING)
template <typename E, typename A>
void Equals(const E& expected, const A& actual);
@@ -65,38 +84,29 @@
template <typename E, typename A>
void GreaterEqual(const E& left, const A& right);
-#endif
template <typename T>
T NotNull(const T p);
+#endif
+
+ static bool failed() { return failed_; }
private:
static bool failed_;
-
- const char* const file_;
- const int line_;
- const Kind kind_;
-
- DISALLOW_IMPLICIT_CONSTRUCTORS(DynamicAssertionHelper);
};
-class Assert : public DynamicAssertionHelper {
- public:
- Assert(const char* file, int line)
- : DynamicAssertionHelper(file, line, ASSERT) {}
-};
-
-class Expect : public DynamicAssertionHelper {
- public:
- Expect(const char* file, int line)
- : DynamicAssertionHelper(file, line, EXPECT) {}
-};
+template <typename T>
+T Assert::NotNull(const T p) {
+ if (p != NULL) return p;
+ Fail("expected: not NULL, found NULL");
+ return NULL;
+}
#if defined(TESTING)
// Only allow the expensive (with respect to code size) assertions
// in testing code.
template <typename E, typename A>
-void DynamicAssertionHelper::Equals(const E& expected, const A& actual) {
+void Expect::Equals(const E& expected, const A& actual) {
if (actual == expected) return;
std::ostringstream ess, ass;
ess << expected;
@@ -106,7 +116,7 @@
}
template <typename E, typename A>
-void DynamicAssertionHelper::NotEquals(const E& not_expected, const A& actual) {
+void Expect::NotEquals(const E& not_expected, const A& actual) {
if (actual != not_expected) return;
std::ostringstream ness;
ness << not_expected;
@@ -115,9 +125,7 @@
}
template <typename E, typename A, typename T>
-void DynamicAssertionHelper::FloatEquals(const E& expected,
- const A& actual,
- const T& tol) {
+void Expect::FloatEquals(const E& expected, const A& actual, const T& tol) {
if (((expected - tol) <= actual) && (actual <= (expected + tol))) {
return;
}
@@ -131,8 +139,8 @@
}
template <typename E, typename A>
-NO_SANITIZE_MEMORY void DynamicAssertionHelper::StringEquals(const E& expected,
- const A& actual) {
+NO_SANITIZE_MEMORY void Expect::StringEquals(const E& expected,
+ const A& actual) {
std::ostringstream ess, ass;
ess << expected;
ass << actual;
@@ -142,8 +150,8 @@
}
template <typename E, typename A>
-NO_SANITIZE_MEMORY void DynamicAssertionHelper::IsSubstring(const E& needle,
- const A& haystack) {
+NO_SANITIZE_MEMORY void Expect::IsSubstring(const E& needle,
+ const A& haystack) {
std::ostringstream ess, ass;
ess << needle;
ass << haystack;
@@ -154,9 +162,8 @@
}
template <typename E, typename A>
-NO_SANITIZE_MEMORY void DynamicAssertionHelper::IsNotSubstring(
- const E& needle,
- const A& haystack) {
+NO_SANITIZE_MEMORY void Expect::IsNotSubstring(const E& needle,
+ const A& haystack) {
std::ostringstream ess, ass;
ess << needle;
ass << haystack;
@@ -167,7 +174,7 @@
}
template <typename E, typename A>
-void DynamicAssertionHelper::LessThan(const E& left, const A& right) {
+void Expect::LessThan(const E& left, const A& right) {
if (left < right) return;
std::ostringstream ess, ass;
ess << left;
@@ -177,7 +184,7 @@
}
template <typename E, typename A>
-void DynamicAssertionHelper::LessEqual(const E& left, const A& right) {
+void Expect::LessEqual(const E& left, const A& right) {
if (left <= right) return;
std::ostringstream ess, ass;
ess << left;
@@ -187,7 +194,7 @@
}
template <typename E, typename A>
-void DynamicAssertionHelper::GreaterThan(const E& left, const A& right) {
+void Expect::GreaterThan(const E& left, const A& right) {
if (left > right) return;
std::ostringstream ess, ass;
ess << left;
@@ -197,7 +204,7 @@
}
template <typename E, typename A>
-void DynamicAssertionHelper::GreaterEqual(const E& left, const A& right) {
+void Expect::GreaterEqual(const E& left, const A& right) {
if (left >= right) return;
std::ostringstream ess, ass;
ess << left;
@@ -205,14 +212,14 @@
std::string es = ess.str(), as = ass.str();
Fail("expected: %s >= %s", es.c_str(), as.c_str());
}
-#endif
template <typename T>
-T DynamicAssertionHelper::NotNull(const T p) {
+T Expect::NotNull(const T p) {
if (p != NULL) return p;
Fail("expected: not NULL, found NULL");
return NULL;
}
+#endif
} // namespace dart
diff --git a/runtime/platform/atomic_android.h b/runtime/platform/atomic_android.h
index 8178d6e..42dda56 100644
--- a/runtime/platform/atomic_android.h
+++ b/runtime/platform/atomic_android.h
@@ -28,6 +28,9 @@
}
inline void AtomicOperations::IncrementInt64By(int64_t* p, int64_t value) {
+ // Some ARM implementations require 8-byte alignment for atomic access but
+ // not non-atomic access.
+ ASSERT((reinterpret_cast<uword>(p) % 8) == 0);
__sync_fetch_and_add(p, value);
}
diff --git a/runtime/platform/atomic_linux.h b/runtime/platform/atomic_linux.h
index 627bc9f..3db8d73 100644
--- a/runtime/platform/atomic_linux.h
+++ b/runtime/platform/atomic_linux.h
@@ -28,6 +28,9 @@
}
inline void AtomicOperations::IncrementInt64By(int64_t* p, int64_t value) {
+ // Some ARM implementations require 8-byte alignment for atomic access but
+ // not non-atomic access.
+ ASSERT((reinterpret_cast<uword>(p) % 8) == 0);
__sync_fetch_and_add(p, value);
}
diff --git a/runtime/platform/atomic_macos.h b/runtime/platform/atomic_macos.h
index e8c1545..b08ba4f 100644
--- a/runtime/platform/atomic_macos.h
+++ b/runtime/platform/atomic_macos.h
@@ -28,6 +28,9 @@
}
inline void AtomicOperations::IncrementInt64By(int64_t* p, int64_t value) {
+ // Some ARM implementations require 8-byte alignment for atomic access but
+ // not non-atomic access.
+ ASSERT((reinterpret_cast<uword>(p) % 8) == 0);
__sync_fetch_and_add(p, value);
}
diff --git a/runtime/platform/utils.cc b/runtime/platform/utils.cc
index c53af65..205cafc 100644
--- a/runtime/platform/utils.cc
+++ b/runtime/platform/utils.cc
@@ -78,8 +78,10 @@
switch (size) {
case 3:
hash ^= cursor[2] << 16;
+ /* Falls through. */
case 2:
hash ^= cursor[1] << 8;
+ /* Falls through. */
case 1:
hash ^= cursor[0];
hash *= M;
diff --git a/runtime/tests/vm/vm.status b/runtime/tests/vm/vm.status
index 4c98cc9..1c25d3c 100644
--- a/runtime/tests/vm/vm.status
+++ b/runtime/tests/vm/vm.status
@@ -9,6 +9,7 @@
cc/Fail0: Fail # These tests are expected to crash on all platforms.
cc/Fail1: Fail # These tests are expected to crash on all platforms.
cc/Fail2: Fail # These tests are expected to crash on all platforms.
+cc/IsolateReload_ChangeInstanceFormat9: Fail, Crash # issue 32942
cc/IsolateReload_PendingConstructorCall_AbstractToConcrete: Fail, Crash # Issue 32981. Fails on non-Windows, crashes on Windows (because of test.py special handline)
cc/IsolateReload_PendingConstructorCall_ConcreteToAbstract: Fail, Crash # Issue 32981. Fails on non-Windows, crashes on Windows (because of test.py special handline)
cc/IsolateReload_PendingStaticCall_DefinedToNSM: Fail # Issue 32981
@@ -46,8 +47,8 @@
dart/wrap_around_in_range_analysis_test: SkipByDesign # The test requires int64.
[ $compiler == dartk ]
-cc/DartAPI_New: Fail
-cc/DartAPI_TypeGetParameterizedTypes: Crash
+cc/DartAPI_New: Fail # Issue #33041
+cc/DartAPI_TypeGetParameterizedTypes: Crash # Issue 33042
dart/redirection_type_shuffling_test/00: RuntimeError
dart/redirection_type_shuffling_test/none: RuntimeError
@@ -147,8 +148,7 @@
[ $compiler == dartk && $runtime == vm ]
cc/Class_ComputeEndTokenPos: Crash
cc/DartAPI_IsolateShutdownRunDartCode: Skip # Flaky
-cc/DartAPI_LazyLoadDeoptimizes: Fail
-cc/DartAPI_LoadLibrary: Crash
+cc/DartAPI_LoadLibrary: Crash # Issue 33048.
cc/DebuggerAPI_BreakpointStubPatching: Fail
cc/DebuggerAPI_GetClosureInfo: Fail
cc/DebuggerAPI_InterruptIsolate: SkipSlow
@@ -203,8 +203,6 @@
cc/Service_Code: Fail
[ $compiler == dartk && $strong ]
-cc/DartAPI_ImportLibrary3: Fail # Issue 32190
-cc/DartAPI_LazyLoadDeoptimizes: Crash # Issue 32190
cc/DartGeneratedArrayLiteralMessages: Crash # Issue 32190
cc/FullSnapshot1: Crash # Issue 32190
cc/IsolateReload_LibraryImportAdded: Crash # Issue 32190
@@ -294,6 +292,7 @@
[ $compiler == dartk || $compiler == dartkp ]
cc/CanonicalizationInScriptSnapshots: SkipByDesign # Script snapshots unsupported.
cc/DartAPI_IsolateSetCheckedMode: SkipByDesign # Checked mode is not relevant for dart 2?
+cc/DartAPI_LazyLoadDeoptimizes: SkipByDesign # Issue 33043, Dart_LoadSource unsupported.
cc/DartAPI_LoadLibraryPatch_Error1: SkipByDesign # Dart_LibraryLoadPatch unsupported.
cc/DartAPI_LoadLibraryPatch_Error2: SkipByDesign
cc/DartAPI_LoadLibraryPatch_Error3: SkipByDesign
diff --git a/runtime/vm/BUILD.gn b/runtime/vm/BUILD.gn
index 5a14a55..69e3168 100644
--- a/runtime/vm/BUILD.gn
+++ b/runtime/vm/BUILD.gn
@@ -3,7 +3,6 @@
# BSD-style license that can be found in the LICENSE file.
import("../../build/executable_suffix.gni")
-import("../../build/prebuilt_dart_sdk.gni")
import("../../sdk/lib/async/async_sources.gni")
import("../../sdk/lib/collection/collection_sources.gni")
import("../../sdk/lib/convert/convert_sources.gni")
diff --git a/runtime/vm/ast.cc b/runtime/vm/ast.cc
index e7e74bc..08def4b 100644
--- a/runtime/vm/ast.cc
+++ b/runtime/vm/ast.cc
@@ -314,7 +314,7 @@
this->right()->AsLiteralNode()->literal().IsNull()) {
return false;
}
- // Fall-through intentional.
+ /* Falls through */
case Token::kADD:
case Token::kSUB:
case Token::kMUL:
@@ -353,7 +353,7 @@
if (left_val->IsString()) {
return right_val->IsString() ? left_val : NULL;
}
- // Fall-through intentional.
+ /* Falls through */
case Token::kSUB:
case Token::kMUL:
case Token::kDIV:
diff --git a/runtime/vm/benchmark_test.cc b/runtime/vm/benchmark_test.cc
index 4fc6436..ddce675 100644
--- a/runtime/vm/benchmark_test.cc
+++ b/runtime/vm/benchmark_test.cc
@@ -289,11 +289,13 @@
args[0] = Dart_NewInteger(kNumIterations);
// Warmup first to avoid compilation jitters.
- Dart_Invoke(lib, NewString("benchmark"), 1, args);
+ result = Dart_Invoke(lib, NewString("benchmark"), 1, args);
+ EXPECT_VALID(result);
Timer timer(true, "UseDartApi benchmark");
timer.Start();
- Dart_Invoke(lib, NewString("benchmark"), 1, args);
+ result = Dart_Invoke(lib, NewString("benchmark"), 1, args);
+ EXPECT_VALID(result);
timer.Stop();
int64_t elapsed_time = timer.TotalElapsedTime();
benchmark->set_score(elapsed_time);
@@ -554,7 +556,8 @@
Timer timer(true, "currentMirrorSystem() benchmark");
timer.Start();
- Dart_Invoke(lib, NewString("benchmark"), 0, NULL);
+ Dart_Handle result = Dart_Invoke(lib, NewString("benchmark"), 0, NULL);
+ EXPECT_VALID(result);
timer.Stop();
int64_t elapsed_time = timer.TotalElapsedTime();
benchmark->set_score(elapsed_time);
diff --git a/runtime/vm/bootstrap_natives.h b/runtime/vm/bootstrap_natives.h
index 753fbd4..b292388 100644
--- a/runtime/vm/bootstrap_natives.h
+++ b/runtime/vm/bootstrap_natives.h
@@ -315,7 +315,7 @@
V(Internal_makeFixedListUnmodifiable, 1) \
V(Internal_inquireIs64Bit, 0) \
V(Internal_extractTypeArguments, 2) \
- V(Internal_prependTypeArguments, 3) \
+ V(Internal_prependTypeArguments, 4) \
V(InvocationMirror_unpackTypeArguments, 1) \
V(NoSuchMethodError_existingMethodSignature, 3) \
V(LinkedHashMap_getIndex, 1) \
diff --git a/runtime/vm/compiler/aot/precompiler.cc b/runtime/vm/compiler/aot/precompiler.cc
index 37eea57..29afb6d 100644
--- a/runtime/vm/compiler/aot/precompiler.cc
+++ b/runtime/vm/compiler/aot/precompiler.cc
@@ -1914,12 +1914,6 @@
continue;
}
- // [kVectorCid] is excluded because it doesn't have a real class,
- // corresponding to the class id, in Dart source code.
- if (type.IsType() && type.type_class_id() == kVectorCid) {
- continue;
- }
-
if (type.InVMHeap()) {
// The only important types in the vm isolate are "dynamic"/"void", which
// will get their optimized top-type testing stub installed at creation.
diff --git a/runtime/vm/compiler/assembler/assembler_arm64.h b/runtime/vm/compiler/assembler/assembler_arm64.h
index 5a6a9d1..b0d94c2 100644
--- a/runtime/vm/compiler/assembler/assembler_arm64.h
+++ b/runtime/vm/compiler/assembler/assembler_arm64.h
@@ -1069,18 +1069,12 @@
const Register crn = ConcreteRegister(rn);
EmitFPIntCvtOp(SCVTFD, static_cast<Register>(vd), crn, kWord);
}
- void fcvtzdsx(Register rd, VRegister vn) {
+ void fcvtzds(Register rd, VRegister vn) {
ASSERT(rd != R31);
ASSERT(rd != CSP);
const Register crd = ConcreteRegister(rd);
EmitFPIntCvtOp(FCVTZDS, crd, static_cast<Register>(vn));
}
- void fcvtzdsw(Register rd, VRegister vn) {
- ASSERT(rd != R31);
- ASSERT(rd != CSP);
- const Register crd = ConcreteRegister(rd);
- EmitFPIntCvtOp(FCVTZDS, crd, static_cast<Register>(vn), kWord);
- }
void fmovdd(VRegister vd, VRegister vn) { EmitFPOneSourceOp(FMOVDD, vd, vn); }
void fabsd(VRegister vd, VRegister vn) { EmitFPOneSourceOp(FABSD, vd, vn); }
void fnegd(VRegister vd, VRegister vn) { EmitFPOneSourceOp(FNEGD, vd, vn); }
@@ -1371,17 +1365,9 @@
LslImmediate(dst, src, kSmiTagSize);
}
- void BranchIfNotSmi(Register reg, Label* label) {
- ASSERT(kSmiTagMask == 1);
- ASSERT(kSmiTag == 0);
- tbnz(label, reg, 0);
- }
+ void BranchIfNotSmi(Register reg, Label* label) { tbnz(label, reg, kSmiTag); }
- void BranchIfSmi(Register reg, Label* label) {
- ASSERT(kSmiTagMask == 1);
- ASSERT(kSmiTag == 0);
- tbz(label, reg, 0);
- }
+ void BranchIfSmi(Register reg, Label* label) { tbz(label, reg, kSmiTag); }
void Branch(const StubEntry& stub_entry,
Register pp,
@@ -1465,11 +1451,6 @@
kValueCanBeSmi,
};
- enum CanBeHeapPointer {
- kValueIsNotHeapPointer,
- kValueCanBeHeapPointer,
- };
-
// Storing into an object.
void StoreIntoObject(Register object,
const Address& dest,
@@ -1611,22 +1592,6 @@
Register tmp,
OperandSize sz);
- void AssertSmiInRange(
- Register object,
- CanBeHeapPointer can_be_heap_pointer = kValueIsNotHeapPointer) {
-#if defined(DEBUG)
- Label ok;
- if (can_be_heap_pointer == kValueCanBeHeapPointer) {
- BranchIfNotSmi(object, &ok);
- }
- cmp(object, Operand(object, SXTW, 0));
- b(&ok, EQ);
- Stop("Smi out of range");
-
- Bind(&ok);
-#endif
- }
-
private:
AssemblerBuffer buffer_; // Contains position independent code.
ObjectPoolWrapper object_pool_wrapper_;
diff --git a/runtime/vm/compiler/assembler/assembler_arm64_test.cc b/runtime/vm/compiler/assembler/assembler_arm64_test.cc
index 523688b..a41fad24 100644
--- a/runtime/vm/compiler/assembler/assembler_arm64_test.cc
+++ b/runtime/vm/compiler/assembler/assembler_arm64_test.cc
@@ -2576,73 +2576,17 @@
EXPECT_EQ(42.0, EXECUTE_TEST_CODE_DOUBLE(DoubleReturn, test->entry()));
}
-ASSEMBLER_TEST_GENERATE(Fcvtzdsx, assembler) {
+ASSEMBLER_TEST_GENERATE(Fcvtzds, assembler) {
__ LoadDImmediate(V0, 42.0);
- __ fcvtzdsx(R0, V0);
+ __ fcvtzds(R0, V0);
__ ret();
}
-ASSEMBLER_TEST_RUN(Fcvtzdsx, test) {
+ASSEMBLER_TEST_RUN(Fcvtzds, test) {
typedef int64_t (*Int64Return)() DART_UNUSED;
EXPECT_EQ(42, EXECUTE_TEST_CODE_INT64(Int64Return, test->entry()));
}
-ASSEMBLER_TEST_GENERATE(Fcvtzdsw, assembler) {
- __ LoadDImmediate(V0, 42.0);
- __ fcvtzdsw(R0, V0);
- __ ret();
-}
-
-ASSEMBLER_TEST_RUN(Fcvtzdsw, test) {
- typedef int64_t (*Int64Return)() DART_UNUSED;
- EXPECT_EQ(42, EXECUTE_TEST_CODE_INT64(Int64Return, test->entry()));
-}
-
-ASSEMBLER_TEST_GENERATE(Fcvtzdsx_overflow, assembler) {
- __ LoadDImmediate(V0, 1e20);
- __ fcvtzdsx(R0, V0);
- __ ret();
-}
-
-ASSEMBLER_TEST_RUN(Fcvtzdsx_overflow, test) {
- typedef int64_t (*Int64Return)() DART_UNUSED;
- EXPECT_EQ(kMaxInt64, EXECUTE_TEST_CODE_INT64(Int64Return, test->entry()));
-}
-
-ASSEMBLER_TEST_GENERATE(Fcvtzdsx_overflow_negative, assembler) {
- __ LoadDImmediate(V0, -1e20);
- __ fcvtzdsx(R0, V0);
- __ ret();
-}
-
-ASSEMBLER_TEST_RUN(Fcvtzdsx_overflow_negative, test) {
- typedef int64_t (*Int64Return)() DART_UNUSED;
- EXPECT_EQ(kMinInt64, EXECUTE_TEST_CODE_INT64(Int64Return, test->entry()));
-}
-
-ASSEMBLER_TEST_GENERATE(Fcvtzdsw_overflow, assembler) {
- __ LoadDImmediate(V0, 1e10);
- __ fcvtzdsw(R0, V0);
- __ ret();
-}
-
-ASSEMBLER_TEST_RUN(Fcvtzdsw_overflow, test) {
- typedef int64_t (*Int64Return)() DART_UNUSED;
- EXPECT_EQ(kMaxInt32, EXECUTE_TEST_CODE_INT64(Int64Return, test->entry()));
-}
-
-ASSEMBLER_TEST_GENERATE(Fcvtzdsw_overflow_negative, assembler) {
- __ LoadDImmediate(V0, -1e10);
- __ fcvtzdsw(R0, V0);
- __ sxtw(R0, R0);
- __ ret();
-}
-
-ASSEMBLER_TEST_RUN(Fcvtzdsw_overflow_negative, test) {
- typedef int64_t (*Int64Return)() DART_UNUSED;
- EXPECT_EQ(kMinInt32, EXECUTE_TEST_CODE_INT64(Int64Return, test->entry()));
-}
-
ASSEMBLER_TEST_GENERATE(Scvtfdx, assembler) {
__ LoadImmediate(R0, 42);
__ scvtfdx(V0, R0);
diff --git a/runtime/vm/compiler/assembler/assembler_x64.h b/runtime/vm/compiler/assembler/assembler_x64.h
index 5d9375d3..569a962 100644
--- a/runtime/vm/compiler/assembler/assembler_x64.h
+++ b/runtime/vm/compiler/assembler/assembler_x64.h
@@ -521,10 +521,7 @@
return CompareImmediate(reg, Immediate(immediate));
}
- void testl(Register reg, const Immediate& imm) {
- Immediate imm2(imm.value() & 0xffffffffll);
- testq(reg, imm2);
- }
+ void testl(Register reg, const Immediate& imm) { testq(reg, imm); }
void testb(const Address& address, const Immediate& imm);
void testq(Register reg, const Immediate& imm);
@@ -713,11 +710,6 @@
kValueCanBeSmi,
};
- enum CanBeHeapPointer {
- kValueIsNotHeapPointer,
- kValueCanBeHeapPointer,
- };
-
// Destroys value.
void StoreIntoObject(Register object, // Object we are storing into.
const Address& dest, // Where we are storing into.
@@ -948,26 +940,6 @@
Register array,
Register index);
- void AssertSmiInRange(
- Register object,
- CanBeHeapPointer can_be_heap_pointer = kValueIsNotHeapPointer) {
-#if defined(DEBUG)
- Register tmp = object == TMP ? TMP2 : TMP;
- Label ok;
- if (can_be_heap_pointer == kValueCanBeHeapPointer) {
- testl(object, Immediate(kSmiTagMask));
- ASSERT(kSmiTag == 0);
- j(ZERO, &ok);
- }
- movsxd(tmp, object);
- cmpq(tmp, object);
- j(EQUAL, &ok);
- Stop("Smi out of range");
-
- Bind(&ok);
-#endif
- }
-
static Address VMTagAddress() {
return Address(THR, Thread::vm_tag_offset());
}
diff --git a/runtime/vm/compiler/backend/il.cc b/runtime/vm/compiler/backend/il.cc
index fa6d94a..c0d51f7 100644
--- a/runtime/vm/compiler/backend/il.cc
+++ b/runtime/vm/compiler/backend/il.cc
@@ -1585,10 +1585,10 @@
return Utils::IsPowerOfTwo(Utils::Abs(int_value));
}
-static intptr_t SignificantRepresentationBits(Representation r) {
+static intptr_t RepresentationBits(Representation r) {
switch (r) {
case kTagged:
- return 31;
+ return kBitsPerWord - 1;
case kUnboxedInt32:
case kUnboxedUint32:
return 32;
@@ -1602,7 +1602,7 @@
static int64_t RepresentationMask(Representation r) {
return static_cast<int64_t>(static_cast<uint64_t>(-1) >>
- (64 - SignificantRepresentationBits(r)));
+ (64 - RepresentationBits(r)));
}
static bool ToIntegerConstant(Value* value, int64_t* result) {
@@ -2163,8 +2163,7 @@
break;
case Token::kSHL: {
- const intptr_t kMaxShift =
- SignificantRepresentationBits(representation()) - 1;
+ const intptr_t kMaxShift = RepresentationBits(representation()) - 1;
if (rhs == 0) {
return left()->definition();
} else if ((rhs < 0) || (rhs >= kMaxShift)) {
diff --git a/runtime/vm/compiler/backend/il.h b/runtime/vm/compiler/backend/il.h
index 62ebc72..2fee1fc 100644
--- a/runtime/vm/compiler/backend/il.h
+++ b/runtime/vm/compiler/backend/il.h
@@ -3263,7 +3263,10 @@
CompileType* result_type() const { return result_type_; }
intptr_t result_cid() const {
- return (result_type_ != NULL) ? result_type_->ToCid() : kDynamicCid;
+ if (result_type_ == NULL) {
+ return kDynamicCid;
+ }
+ return result_type_->ToCid();
}
PRINT_OPERANDS_TO_SUPPORT
@@ -3759,7 +3762,10 @@
CompileType* result_type() const { return result_type_; }
intptr_t result_cid() const {
- return (result_type_ != NULL) ? result_type_->ToCid() : kDynamicCid;
+ if (result_type_ == NULL) {
+ return kDynamicCid;
+ }
+ return result_type_->ToCid();
}
bool is_known_list_constructor() const { return is_known_list_constructor_; }
diff --git a/runtime/vm/compiler/backend/il_arm64.cc b/runtime/vm/compiler/backend/il_arm64.cc
index 4f4a097..9c0a698 100644
--- a/runtime/vm/compiler/backend/il_arm64.cc
+++ b/runtime/vm/compiler/backend/il_arm64.cc
@@ -997,13 +997,9 @@
case kTwoByteStringCid:
case kExternalOneByteStringCid:
case kExternalTwoByteStringCid:
- return CompileType::FromCid(kSmiCid);
-
case kTypedDataInt32ArrayCid:
case kTypedDataUint32ArrayCid:
- // TODO(erikcorry): Perhaps this can return a faster type. See
- // https://github.com/dart-lang/sdk/issues/32582
- return CompileType::Int();
+ return CompileType::FromCid(kSmiCid);
default:
UNIMPLEMENTED();
@@ -1277,6 +1273,7 @@
default:
UNREACHABLE();
}
+ __ SmiTag(result);
break;
case kTwoByteStringCid:
case kExternalTwoByteStringCid:
@@ -1290,15 +1287,12 @@
default:
UNREACHABLE();
}
+ __ SmiTag(result);
break;
default:
UNREACHABLE();
break;
}
- if (representation_ == kTagged) {
- ASSERT(can_pack_into_smi());
- __ SmiTag(result);
- }
}
Representation StoreIndexedInstr::RequiredInputRepresentation(
@@ -2776,27 +2770,18 @@
if (locs.in(1).IsConstant()) {
const Object& constant = locs.in(1).constant();
ASSERT(constant.IsSmi());
- // Immediate shift operation takes 5 bits for the count.
- const intptr_t kCountLimit = 0x1F;
- // These should be around the same size.
- COMPILE_ASSERT(kCountLimit + 1 == kSmiBits + 2);
+ // Immediate shift operation takes 6 bits for the count.
+ const intptr_t kCountLimit = 0x3F;
const intptr_t value = Smi::Cast(constant).Value();
ASSERT((0 < value) && (value < kCountLimit));
if (shift_left->can_overflow()) {
// Check for overflow (preserve left).
- __ LslImmediate(TMP, left, value, kWord);
- __ cmpw(left, Operand(TMP, ASR, value));
+ __ LslImmediate(TMP, left, value);
+ __ cmp(left, Operand(TMP, ASR, value));
__ b(deopt, NE); // Overflow.
}
- // Shift for result now we know there is no overflow. This writes the full
- // 64 bits of the output register, but unless we are in truncating mode the
- // top bits will just be sign extension bits.
+ // Shift for result now we know there is no overflow.
__ LslImmediate(result, left, value);
- if (shift_left->is_truncating()) {
- // This preserves the invariant that Smis only use the low 32 bits of the
- // register, the high bits being sign extension bits.
- __ sxtw(result, result);
- }
return;
}
@@ -2804,33 +2789,28 @@
const Register right = locs.in(1).reg();
Range* right_range = shift_left->right_range();
if (shift_left->left()->BindsToConstant() && shift_left->can_overflow()) {
+ // TODO(srdjan): Implement code below for is_truncating().
// If left is constant, we know the maximal allowed size for right.
const Object& obj = shift_left->left()->BoundConstant();
- // Even though we have a non-Smi constant on the left, we might still emit
- // a Smi op here. In that case the Smi check above will have deopted, so
- // we can't reach this point. Emit a breakpoint to be sure.
- if (!obj.IsSmi()) {
- __ Breakpoint();
- return;
+ if (obj.IsSmi()) {
+ const intptr_t left_int = Smi::Cast(obj).Value();
+ if (left_int == 0) {
+ __ CompareRegisters(right, ZR);
+ __ b(deopt, MI);
+ __ mov(result, ZR);
+ return;
+ }
+ const intptr_t max_right = kSmiBits - Utils::HighestBit(left_int);
+ const bool right_needs_check =
+ !RangeUtils::IsWithin(right_range, 0, max_right - 1);
+ if (right_needs_check) {
+ __ CompareImmediate(right,
+ reinterpret_cast<int64_t>(Smi::New(max_right)));
+ __ b(deopt, CS);
+ }
+ __ SmiUntag(TMP, right);
+ __ lslv(result, left, TMP);
}
- const intptr_t left_int = Smi::Cast(obj).Value();
- if (left_int == 0) {
- __ CompareRegisters(right, ZR);
- __ b(deopt, MI);
- __ mov(result, ZR);
- return;
- }
- const intptr_t max_right = kSmiBits - Utils::HighestBit(left_int);
- const bool right_needs_check =
- !RangeUtils::IsWithin(right_range, 0, max_right - 1);
- if (right_needs_check) {
- __ CompareImmediate(right,
- reinterpret_cast<int64_t>(Smi::New(max_right)));
- __ b(deopt, CS);
- }
- __ SmiUntag(TMP, right);
- __ lslv(result, left, TMP);
- ASSERT(!shift_left->is_truncating());
return;
}
@@ -2854,11 +2834,7 @@
__ SmiUntag(TMP, right);
__ lslv(result, left, TMP);
}
- if (shift_left->is_truncating()) {
- __ sxtw(result, result);
- }
} else {
- // If we can overflow.
if (right_needs_check) {
ASSERT(shift_left->CanDeoptimize());
__ CompareImmediate(right,
@@ -2866,16 +2842,15 @@
__ b(deopt, CS);
}
// Left is not a constant.
- // Check if count is too large for handling it inlined.
+ // Check if count too large for handling it inlined.
__ SmiUntag(TMP, right);
// Overflow test (preserve left, right, and TMP);
const Register temp = locs.temp(0).reg();
- __ lslvw(temp, left, TMP);
- __ asrvw(TMP2, temp, TMP);
- __ cmpw(left, Operand(TMP2));
+ __ lslv(temp, left, TMP);
+ __ asrv(TMP2, temp, TMP);
+ __ CompareRegisters(left, TMP2);
__ b(deopt, NE); // Overflow.
- // Shift for result now we know there is no overflow. This is a 64 bit
- // operation, so no sign extension is needed.
+ // Shift for result now we know there is no overflow.
__ lslv(result, left, TMP);
}
}
@@ -2956,20 +2931,18 @@
switch (op_kind()) {
case Token::kADD:
- __ addsw(result, left, Operand(right));
+ __ adds(result, left, Operand(right));
__ b(slow_path->entry_label(), VS);
- __ sxtw(result, result);
break;
case Token::kSUB:
- __ subsw(result, left, Operand(right));
+ __ subs(result, left, Operand(right));
__ b(slow_path->entry_label(), VS);
- __ sxtw(result, result);
break;
case Token::kMUL:
__ SmiUntag(TMP, left);
- __ smull(result, TMP, right);
- __ AsrImmediate(TMP, result, 31);
- // TMP: result bits 31-63
+ __ mul(result, TMP, right);
+ __ smulh(TMP, TMP, right);
+ // TMP: result bits 64..127.
__ cmp(TMP, Operand(result, ASR, 63));
__ b(slow_path->entry_label(), NE);
break;
@@ -2994,8 +2967,8 @@
__ SmiUntag(TMP, right);
__ lslv(result, left, TMP);
- __ asrvw(TMP2, result, TMP);
- __ cmp(left, Operand(TMP2, SXTW, 0));
+ __ asrv(TMP2, result, TMP);
+ __ CompareRegisters(left, TMP2);
__ b(slow_path->entry_label(), NE); // Overflow.
break;
case Token::kSHR:
@@ -3005,8 +2978,6 @@
reinterpret_cast<int64_t>(Smi::New(Smi::kBits)));
__ b(slow_path->entry_label(), CS);
- __ AssertSmiInRange(left);
- __ AssertSmiInRange(right);
__ SmiUntag(result, right);
__ SmiUntag(TMP, left);
__ asrv(result, TMP, result);
@@ -3016,7 +2987,6 @@
UNIMPLEMENTED();
}
__ Bind(slow_path->exit_label());
- __ AssertSmiInRange(result, Assembler::kValueCanBeHeapPointer);
}
class CheckedSmiComparisonSlowPath
@@ -3207,28 +3177,20 @@
case Token::kADD: {
if (deopt == NULL) {
__ AddImmediate(result, left, imm);
- if (is_truncating()) {
- __ sxtw(result, result);
- }
} else {
- __ AddImmediateSetFlags(result, left, imm, kWord);
+ __ AddImmediateSetFlags(result, left, imm);
__ b(deopt, VS);
- __ sxtw(result, result);
}
break;
}
case Token::kSUB: {
if (deopt == NULL) {
__ AddImmediate(result, left, -imm);
- if (is_truncating()) {
- __ sxtw(result, result);
- }
} else {
// Negating imm and using AddImmediateSetFlags would not detect the
- // overflow when imm == kMinInt32.
- __ SubImmediateSetFlags(result, left, imm, kWord);
+ // overflow when imm == kMinInt64.
+ __ SubImmediateSetFlags(result, left, imm);
__ b(deopt, VS);
- __ sxtw(result, result);
}
break;
}
@@ -3236,14 +3198,12 @@
// Keep left value tagged and untag right value.
const intptr_t value = Smi::Cast(constant).Value();
__ LoadImmediate(TMP, value);
- __ smull(result, left, TMP);
+ __ mul(result, left, TMP);
if (deopt != NULL) {
- __ AsrImmediate(TMP, result, 31);
- // TMP: result bits 31..63.
+ __ smulh(TMP, left, TMP);
+ // TMP: result bits 64..127.
__ cmp(TMP, Operand(result, ASR, 63));
__ b(deopt, NE);
- } else if (is_truncating()) {
- __ sxtw(result, result);
}
break;
}
@@ -3254,10 +3214,9 @@
const intptr_t shift_count =
Utils::ShiftForPowerOfTwo(Utils::Abs(value)) + kSmiTagSize;
ASSERT(kSmiTagSize == 1);
- __ AsrImmediate(TMP, left, 31); // All 1s or all 0s.
+ __ AsrImmediate(TMP, left, 63);
ASSERT(shift_count > 1); // 1, -1 case handled above.
const Register temp = TMP2;
- // Adjust so that we round to 0 instead of round down.
__ add(temp, left, Operand(TMP, LSR, 64 - shift_count));
ASSERT(shift_count > 0);
__ AsrImmediate(result, temp, shift_count);
@@ -3292,7 +3251,6 @@
UNREACHABLE();
break;
}
- __ AssertSmiInRange(result);
return;
}
@@ -3301,26 +3259,18 @@
case Token::kADD: {
if (deopt == NULL) {
__ add(result, left, Operand(right));
- if (is_truncating()) {
- __ sxtw(result, result);
- }
} else {
- __ addsw(result, left, Operand(right));
+ __ adds(result, left, Operand(right));
__ b(deopt, VS);
- __ sxtw(result, result);
}
break;
}
case Token::kSUB: {
if (deopt == NULL) {
__ sub(result, left, Operand(right));
- if (is_truncating()) {
- __ sxtw(result, result);
- }
} else {
- __ subsw(result, left, Operand(right));
+ __ subs(result, left, Operand(right));
__ b(deopt, VS);
- __ sxtw(result, result);
}
break;
}
@@ -3328,13 +3278,10 @@
__ SmiUntag(TMP, left);
if (deopt == NULL) {
__ mul(result, TMP, right);
- if (is_truncating()) {
- __ sxtw(result, result);
- }
} else {
- __ smull(result, TMP, right);
- __ AsrImmediate(TMP, result, 31);
- // TMP: result bits 31..63.
+ __ mul(result, TMP, right);
+ __ smulh(TMP, TMP, right);
+ // TMP: result bits 64..127.
__ cmp(TMP, Operand(result, ASR, 63));
__ b(deopt, NE);
}
@@ -3369,7 +3316,7 @@
// Check the corner case of dividing the 'MIN_SMI' with -1, in which
// case we cannot tag the result.
- __ CompareImmediate(result, 0x40000000LL);
+ __ CompareImmediate(result, 0x4000000000000000LL);
__ b(deopt, EQ);
__ SmiTag(result);
break;
@@ -3414,10 +3361,8 @@
__ b(deopt, LT);
}
__ SmiUntag(TMP, right);
- // The asrv operation masks the count to 6 bits, but any shift between 31
- // and 63 gives the same result because 32 bit Smis are stored sign
- // extended in the registers.
- const intptr_t kCountLimit = 0x1F;
+ // sarl operation masks the count to 6 bits.
+ const intptr_t kCountLimit = 0x3F;
if (!RangeUtils::OnlyLessThanOrEqualTo(right_range(), kCountLimit)) {
__ LoadImmediate(TMP2, kCountLimit);
__ CompareRegisters(TMP, TMP2);
@@ -3446,7 +3391,6 @@
UNREACHABLE();
break;
}
- __ AssertSmiInRange(result);
}
LocationSummary* CheckEitherNonSmiInstr::MakeLocationSummary(Zone* zone,
@@ -3599,17 +3543,10 @@
ASSERT((from_representation() == kUnboxedInt32) ||
(from_representation() == kUnboxedUint32));
const intptr_t kNumInputs = 1;
- const intptr_t kNumTemps = ValueFitsSmi() ? 0 : 1;
+ const intptr_t kNumTemps = 0;
LocationSummary* summary = new (zone)
- LocationSummary(zone, kNumInputs, kNumTemps,
- ValueFitsSmi() ? LocationSummary::kNoCall
- : LocationSummary::kCallOnSlowPath);
- // Get two distinct registers for input and output, plus a temp
- // register for testing for overflow and allocating a Mint.
+ LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
summary->set_in(0, Location::RequiresRegister());
- if (!ValueFitsSmi()) {
- summary->set_temp(0, Location::RequiresRegister());
- }
summary->set_out(0, Location::RequiresRegister());
return summary;
}
@@ -3618,51 +3555,16 @@
Register value = locs()->in(0).reg();
Register out = locs()->out(0).reg();
ASSERT(value != out);
- Label done;
+ ASSERT(kSmiTagSize == 1);
+ // TODO(vegorov) implement and use UBFM/SBFM for this.
+ __ LslImmediate(out, value, 32);
if (from_representation() == kUnboxedInt32) {
- ASSERT(kSmiTag == 0);
- // Signed Bitfield Insert in Zero instruction extracts the 31 significant
- // bits from a Smi.
- __ sbfiz(out, value, kSmiTagSize, 32 - kSmiTagSize);
- if (ValueFitsSmi()) {
- return;
- }
- Register temp = locs()->temp(0).reg();
- __ cmp(out, Operand(value, LSL, 1));
- __ b(&done, EQ); // Jump if the sbfiz instruction didn't lose info.
- BoxAllocationSlowPath::Allocate(compiler, this, compiler->mint_class(), out,
- temp);
- __ sxtw(temp, value);
+ __ AsrImmediate(out, out, 32 - kSmiTagSize);
} else {
ASSERT(from_representation() == kUnboxedUint32);
- ASSERT(kSmiTag == 0);
- // A 32 bit positive Smi has one tag bit and one unused sign bit,
- // leaving only 30 bits for the payload.
- __ ubfiz(out, value, kSmiTagSize, kSmiBits);
- if (ValueFitsSmi()) {
- return;
- }
- Register temp = locs()->temp(0).reg();
- __ TestImmediate(value, 0xc0000000);
- __ b(&done, EQ); // Jump if both bits are zero.
- BoxAllocationSlowPath::Allocate(compiler, this, compiler->mint_class(), out,
- temp);
- __ ubfiz(temp, value, 0, 32); // Zero extend word.
+ __ LsrImmediate(out, out, 32 - kSmiTagSize);
}
-
- __ StoreToOffset(locs()->temp(0).reg(), out,
- Mint::value_offset() - kHeapObjectTag);
-
-#if defined(DEBUG)
- Label skip_smi_test;
- __ b(&skip_smi_test);
- __ Bind(&done);
- __ AssertSmiInRange(out, Assembler::kValueCanBeHeapPointer);
- __ Bind(&skip_smi_test);
-#else
- __ Bind(&done);
-#endif
}
LocationSummary* BoxInt64Instr::MakeLocationSummary(Zone* zone,
@@ -3690,8 +3592,7 @@
}
ASSERT(kSmiTag == 0);
- __ LslImmediate(out, in, kSmiTagSize, kWord);
- __ sxtw(out, out);
+ __ LslImmediate(out, in, kSmiTagSize);
Label done;
__ cmp(in, Operand(out, ASR, kSmiTagSize));
__ b(&done, EQ);
@@ -4432,9 +4333,8 @@
switch (op_kind()) {
case Token::kNEGATE: {
Label* deopt = compiler->AddDeoptStub(deopt_id(), ICData::kDeoptUnaryOp);
- __ subsw(result, ZR, Operand(value));
+ __ subs(result, ZR, Operand(value));
__ b(deopt, VS);
- __ sxtw(result, result);
break;
}
case Token::kBIT_NOT:
@@ -4445,7 +4345,6 @@
default:
UNREACHABLE();
}
- __ AssertSmiInRange(result);
}
LocationSummary* UnaryDoubleOpInstr::MakeLocationSummary(Zone* zone,
@@ -4497,7 +4396,7 @@
const Register value = locs()->in(0).reg();
const VRegister result = locs()->out(0).fpu_reg();
__ SmiUntag(TMP, value);
- __ scvtfdw(result, TMP);
+ __ scvtfdx(result, TMP);
}
LocationSummary* Int64ToDoubleInstr::MakeLocationSummary(Zone* zone,
@@ -4541,13 +4440,12 @@
__ fcmpd(VTMP, VTMP);
__ b(&do_call, VS);
- __ fcvtzdsx(result, VTMP);
+ __ fcvtzds(result, VTMP);
// Overflow is signaled with minint.
// Check for overflow and that it fits into Smi.
- __ AsrImmediate(TMP, result, 30);
- __ cmp(TMP, Operand(result, ASR, 63));
- __ b(&do_call, NE);
+ __ CompareImmediate(result, 0xC000000000000000);
+ __ b(&do_call, MI);
__ SmiTag(result);
__ b(&done);
__ Bind(&do_call);
@@ -4564,7 +4462,6 @@
args_info, locs(), ICData::Handle(),
ICData::kStatic);
__ Bind(&done);
- __ AssertSmiInRange(result, Assembler::kValueCanBeHeapPointer);
}
LocationSummary* DoubleToSmiInstr::MakeLocationSummary(Zone* zone,
@@ -4588,13 +4485,11 @@
__ fcmpd(value, value);
__ b(deopt, VS);
- __ fcvtzdsx(result, value);
+ __ fcvtzds(result, value);
// Check for overflow and that it fits into Smi.
- __ AsrImmediate(TMP, result, 30);
- __ cmp(TMP, Operand(result, ASR, 63));
- __ b(deopt, NE);
+ __ CompareImmediate(result, 0xC000000000000000);
+ __ b(deopt, MI);
__ SmiTag(result);
- __ AssertSmiInRange(result);
}
LocationSummary* DoubleToDoubleInstr::MakeLocationSummary(Zone* zone,
@@ -4863,7 +4758,7 @@
// Check the corner case of dividing the 'MIN_SMI' with -1, in which
// case we cannot tag the result.
- __ CompareImmediate(result_div, 0x40000000);
+ __ CompareImmediate(result_div, 0x4000000000000000);
__ b(deopt, EQ);
// result_mod <- left - right * result_div.
__ msub(result_mod, TMP, result_div, result_mod);
@@ -5392,10 +5287,6 @@
Register shifter = locs()->in(1).reg();
// TODO(johnmccutchan): Use range information to avoid these checks.
- // Assert this is a legitimate Smi in debug mode, but does not assert
- // anything about the range relative to the bit width.
- __ AssertSmiInRange(shifter);
-
__ SmiUntag(TMP, shifter);
__ CompareImmediate(TMP, 0);
// If shift value is < 0, deoptimize.
@@ -5415,7 +5306,7 @@
__ CompareImmediate(TMP, kShifterLimit);
// If shift value is > 31, return zero.
- __ csel(out, ZR, out, GT);
+ __ csel(out, out, ZR, GT);
}
LocationSummary* UnaryUint32OpInstr::MakeLocationSummary(Zone* zone,
diff --git a/runtime/vm/compiler/backend/il_x64.cc b/runtime/vm/compiler/backend/il_x64.cc
index bf409ff..b44d650 100644
--- a/runtime/vm/compiler/backend/il_x64.cc
+++ b/runtime/vm/compiler/backend/il_x64.cc
@@ -1074,13 +1074,11 @@
case kTwoByteStringCid:
case kExternalOneByteStringCid:
case kExternalTwoByteStringCid:
- return CompileType::FromCid(kSmiCid);
-
case kTypedDataInt32ArrayCid:
case kTypedDataUint32ArrayCid:
+ return CompileType::FromCid(kSmiCid);
+
case kTypedDataInt64ArrayCid:
- // TODO(erikcorry): Perhaps this can return a faster type. See
- // https://github.com/dart-lang/sdk/issues/32582
return CompileType::Int();
default:
@@ -1263,24 +1261,16 @@
LocationSummary* LoadCodeUnitsInstr::MakeLocationSummary(Zone* zone,
bool opt) const {
- const bool might_box = (representation() == kTagged) && !can_pack_into_smi();
const intptr_t kNumInputs = 2;
- const intptr_t kNumTemps = might_box ? 2 : 0;
- LocationSummary* summary = new (zone) LocationSummary(
- zone, kNumInputs, kNumTemps,
- might_box ? LocationSummary::kCallOnSlowPath : LocationSummary::kNoCall);
+ const intptr_t kNumTemps = 0;
+ LocationSummary* summary = new (zone)
+ LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
summary->set_in(0, Location::RequiresRegister());
// The smi index is either untagged (element size == 1), or it is left smi
// tagged (for all element sizes > 1).
summary->set_in(1, index_scale() == 1 ? Location::WritableRegister()
: Location::RequiresRegister());
summary->set_out(0, Location::RequiresRegister());
-
- if (might_box) {
- summary->set_temp(0, Location::RequiresRegister());
- summary->set_temp(1, Location::RequiresRegister());
- }
-
return summary;
}
@@ -1312,6 +1302,7 @@
default:
UNREACHABLE();
}
+ __ SmiTag(result);
break;
case kTwoByteStringCid:
case kExternalTwoByteStringCid:
@@ -1325,34 +1316,12 @@
default:
UNREACHABLE();
}
+ __ SmiTag(result);
break;
default:
UNREACHABLE();
break;
}
- if (representation_ == kTagged) {
- if (can_pack_into_smi()) {
- __ SmiTag(result);
- } else {
- // If the value cannot fit in a smi then allocate a mint box for it.
- Register temp = locs()->temp(0).reg();
- Register temp2 = locs()->temp(1).reg();
- // Temp register needs to be manually preserved on allocation slow-path.
- locs()->live_registers()->Add(locs()->temp(0), kUnboxedInt32);
-
- ASSERT(temp != result);
- __ MoveRegister(temp, result);
- __ SmiTag(result);
-
- Label done;
- __ TestImmediate(temp, Immediate(0xc0000000ll));
- __ j(ZERO, &done);
- BoxAllocationSlowPath::Allocate(compiler, this, compiler->mint_class(),
- result, temp2);
- __ movq(FieldAddress(result, Mint::value_offset()), temp);
- __ Bind(&done);
- }
- }
}
Representation StoreIndexedInstr::RequiredInputRepresentation(
@@ -2742,32 +2711,27 @@
if (locs.in(1).IsConstant()) {
const Object& constant = locs.in(1).constant();
ASSERT(constant.IsSmi());
- // shll operation masks the count to 5 bits.
- const intptr_t kCountLimit = 0x1F;
+ // shlq operation masks the count to 6 bits.
+ const intptr_t kCountLimit = 0x3F;
const intptr_t value = Smi::Cast(constant).Value();
ASSERT((0 < value) && (value < kCountLimit));
if (shift_left->can_overflow()) {
if (value == 1) {
// Use overflow flag.
- __ shll(left, Immediate(1));
+ __ shlq(left, Immediate(1));
__ j(OVERFLOW, deopt);
- __ movsxd(left, left);
return;
}
// Check for overflow.
Register temp = locs.temp(0).reg();
__ movq(temp, left);
- __ shll(left, Immediate(value));
- __ sarl(left, Immediate(value));
- __ movsxd(left, left);
+ __ shlq(left, Immediate(value));
+ __ sarq(left, Immediate(value));
__ cmpq(left, temp);
__ j(NOT_EQUAL, deopt); // Overflow.
}
// Shift for result now we know there is no overflow.
__ shlq(left, Immediate(value));
- if (shift_left->is_truncating()) {
- __ movsxd(left, left);
- }
return;
}
@@ -2778,32 +2742,23 @@
// TODO(srdjan): Implement code below for is_truncating().
// If left is constant, we know the maximal allowed size for right.
const Object& obj = shift_left->left()->BoundConstant();
- // Even though we have a non-Smi constant on the left, we might still emit
- // a Smi op here. In that case the Smi check above will have deopted, so
- // we can't reach this point. Emit a breakpoint to be sure.
- if (!obj.IsSmi()) {
- __ int3();
- return;
- }
- const intptr_t left_int = Smi::Cast(obj).Value();
- if (left_int == 0) {
- __ CompareImmediate(right, Immediate(0));
- __ j(NEGATIVE, deopt);
- return;
- }
- const intptr_t max_right = kSmiBits - Utils::HighestBit(left_int);
- const bool right_needs_check =
- !RangeUtils::IsWithin(right_range, 0, max_right - 1);
- if (right_needs_check) {
- __ CompareImmediate(
- right, Immediate(reinterpret_cast<int64_t>(Smi::New(max_right))));
- __ j(ABOVE_EQUAL, deopt);
- }
- __ AssertSmiInRange(right);
- __ SmiUntag(right);
- __ shlq(left, right);
- if (shift_left->is_truncating()) {
- __ movsxd(left, left);
+ if (obj.IsSmi()) {
+ const intptr_t left_int = Smi::Cast(obj).Value();
+ if (left_int == 0) {
+ __ CompareImmediate(right, Immediate(0));
+ __ j(NEGATIVE, deopt);
+ return;
+ }
+ const intptr_t max_right = kSmiBits - Utils::HighestBit(left_int);
+ const bool right_needs_check =
+ !RangeUtils::IsWithin(right_range, 0, max_right - 1);
+ if (right_needs_check) {
+ __ CompareImmediate(
+ right, Immediate(reinterpret_cast<int64_t>(Smi::New(max_right))));
+ __ j(ABOVE_EQUAL, deopt);
+ }
+ __ SmiUntag(right);
+ __ shlq(left, right);
}
return;
}
@@ -2827,18 +2782,13 @@
__ xorq(left, left);
__ jmp(&done, Assembler::kNearJump);
__ Bind(&is_not_zero);
- __ AssertSmiInRange(right);
__ SmiUntag(right);
__ shlq(left, right);
__ Bind(&done);
} else {
- __ AssertSmiInRange(right);
__ SmiUntag(right);
__ shlq(left, right);
}
- if (shift_left->is_truncating()) {
- __ movsxd(left, left);
- }
} else {
if (right_needs_check) {
ASSERT(shift_left->CanDeoptimize());
@@ -2848,18 +2798,16 @@
}
// Left is not a constant.
Register temp = locs.temp(0).reg();
- // Check if count is too large for handling it inlined.
- __ movl(temp, left);
- __ AssertSmiInRange(right);
+ // Check if count too large for handling it inlined.
+ __ movq(temp, left);
__ SmiUntag(right);
// Overflow test (preserve temp and right);
- __ shll(temp, right);
- __ sarl(temp, right);
- __ cmpl(temp, left);
+ __ shlq(left, right);
+ __ sarq(left, right);
+ __ cmpq(left, temp);
__ j(NOT_EQUAL, deopt); // Overflow.
// Shift for result now we know there is no overflow.
__ shlq(left, right);
- ASSERT(!shift_left->is_truncating());
}
}
@@ -2959,23 +2907,19 @@
switch (op_kind()) {
case Token::kADD:
__ movq(result, left);
- __ addl(result, right);
+ __ addq(result, right);
__ j(OVERFLOW, slow_path->entry_label());
- __ movsxd(result, result);
break;
case Token::kSUB:
__ movq(result, left);
- __ subl(result, right);
+ __ subq(result, right);
__ j(OVERFLOW, slow_path->entry_label());
- __ movsxd(result, result);
break;
case Token::kMUL:
__ movq(result, left);
- __ AssertSmiInRange(result);
__ SmiUntag(result);
- __ imull(result, right);
+ __ imulq(result, right);
__ j(OVERFLOW, slow_path->entry_label());
- __ movsxd(result, result);
break;
case Token::kBIT_OR:
ASSERT(left == result);
@@ -2996,15 +2940,13 @@
__ j(ABOVE_EQUAL, slow_path->entry_label());
__ movq(RCX, right);
- __ AssertSmiInRange(RCX);
__ SmiUntag(RCX);
__ movq(result, left);
- __ shll(result, RCX);
+ __ shlq(result, RCX);
__ movq(TMP, result);
- __ sarl(TMP, RCX);
- __ cmpl(TMP, left);
+ __ sarq(TMP, RCX);
+ __ cmpq(TMP, left);
__ j(NOT_EQUAL, slow_path->entry_label());
- __ movsxd(result, result);
break;
case Token::kSHR: {
Label shift_count_ok;
@@ -3013,8 +2955,6 @@
__ cmpq(right, Immediate(Smi::RawValue(Smi::kBits)));
__ j(ABOVE_EQUAL, slow_path->entry_label());
- __ AssertSmiInRange(left);
- __ AssertSmiInRange(right);
__ movq(RCX, right);
__ SmiUntag(RCX);
__ movq(result, left);
@@ -3272,41 +3212,20 @@
const int64_t imm = reinterpret_cast<int64_t>(constant.raw());
switch (op_kind()) {
case Token::kADD: {
- if (deopt != NULL) {
- __ AddImmediate(left, Immediate(imm), Assembler::k32Bit);
- __ j(OVERFLOW, deopt);
- } else {
- __ AddImmediate(left, Immediate(imm), Assembler::k64Bit);
- }
- if (deopt != NULL || is_truncating()) {
- __ movsxd(left, left);
- }
+ __ AddImmediate(left, Immediate(imm));
+ if (deopt != NULL) __ j(OVERFLOW, deopt);
break;
}
case Token::kSUB: {
- if (deopt != NULL) {
- __ SubImmediate(left, Immediate(imm), Assembler::k32Bit);
- __ j(OVERFLOW, deopt);
- } else {
- __ SubImmediate(left, Immediate(imm), Assembler::k64Bit);
- }
- if (deopt != NULL || is_truncating()) {
- __ movsxd(left, left);
- }
+ __ SubImmediate(left, Immediate(imm));
+ if (deopt != NULL) __ j(OVERFLOW, deopt);
break;
}
case Token::kMUL: {
// Keep left value tagged and untag right value.
const intptr_t value = Smi::Cast(constant).Value();
- if (deopt != NULL) {
- __ MulImmediate(left, Immediate(value), Assembler::k32Bit);
- __ j(OVERFLOW, deopt);
- } else {
- __ MulImmediate(left, Immediate(value), Assembler::k64Bit);
- }
- if (deopt != NULL || is_truncating()) {
- __ movsxd(left, left);
- }
+ __ MulImmediate(left, Immediate(value));
+ if (deopt != NULL) __ j(OVERFLOW, deopt);
break;
}
case Token::kTRUNCDIV: {
@@ -3318,9 +3237,7 @@
ASSERT(kSmiTagSize == 1);
Register temp = locs()->temp(0).reg();
__ movq(temp, left);
- // Since Smis are sign extended this is enough shift to put all-1s or
- // all-0s in the temp register.
- __ sarq(temp, Immediate(31));
+ __ sarq(temp, Immediate(63));
ASSERT(shift_count > 1); // 1, -1 case handled above.
__ shrq(temp, Immediate(64 - shift_count));
__ addq(left, temp);
@@ -3349,10 +3266,8 @@
}
case Token::kSHR: {
- // The sarq operation masks the count to 6 bits, but any shift between
- // 31 and 63 gives the same result because 32 bit Smis are stored sign
- // extended in the registers.
- const intptr_t kCountLimit = 0x1F;
+ // sarq operation masks the count to 6 bits.
+ const intptr_t kCountLimit = 0x3F;
const intptr_t value = Smi::Cast(constant).Value();
__ sarq(left,
Immediate(Utils::Minimum(value + kSmiTagSize, kCountLimit)));
@@ -3364,7 +3279,6 @@
UNREACHABLE();
break;
}
- __ AssertSmiInRange(left);
return;
} // locs()->in(1).IsConstant().
@@ -3372,40 +3286,19 @@
const Address& right = locs()->in(1).ToStackSlotAddress();
switch (op_kind()) {
case Token::kADD: {
- if (deopt != NULL) {
- __ addl(left, right);
- __ j(OVERFLOW, deopt);
- } else {
- __ addq(left, right);
- }
- if (deopt != NULL || is_truncating()) {
- __ movsxd(left, left);
- }
+ __ addq(left, right);
+ if (deopt != NULL) __ j(OVERFLOW, deopt);
break;
}
case Token::kSUB: {
- if (deopt != NULL) {
- __ subl(left, right);
- __ j(OVERFLOW, deopt);
- } else {
- __ subq(left, right);
- }
- if (deopt != NULL || is_truncating()) {
- __ movsxd(left, left);
- }
+ __ subq(left, right);
+ if (deopt != NULL) __ j(OVERFLOW, deopt);
break;
}
case Token::kMUL: {
__ SmiUntag(left);
- if (deopt != NULL) {
- __ imull(left, right);
- __ j(OVERFLOW, deopt);
- } else {
- __ imulq(left, right);
- }
- if (deopt != NULL || is_truncating()) {
- __ movsxd(left, left);
- }
+ __ imulq(left, right);
+ if (deopt != NULL) __ j(OVERFLOW, deopt);
break;
}
case Token::kBIT_AND: {
@@ -3434,40 +3327,19 @@
Register right = locs()->in(1).reg();
switch (op_kind()) {
case Token::kADD: {
- if (deopt != NULL) {
- __ addl(left, right);
- __ j(OVERFLOW, deopt);
- } else {
- __ addq(left, right);
- }
- if (deopt != NULL || is_truncating()) {
- __ movsxd(left, left);
- }
+ __ addq(left, right);
+ if (deopt != NULL) __ j(OVERFLOW, deopt);
break;
}
case Token::kSUB: {
- if (deopt != NULL) {
- __ subl(left, right);
- __ j(OVERFLOW, deopt);
- } else {
- __ subq(left, right);
- }
- if (deopt != NULL || is_truncating()) {
- __ movsxd(left, left);
- }
+ __ subq(left, right);
+ if (deopt != NULL) __ j(OVERFLOW, deopt);
break;
}
case Token::kMUL: {
__ SmiUntag(left);
- if (deopt != NULL) {
- __ imull(left, right);
- __ j(OVERFLOW, deopt);
- } else {
- __ imulq(left, right);
- }
- if (deopt != NULL || is_truncating()) {
- __ movsxd(left, left);
- }
+ __ imulq(left, right);
+ if (deopt != NULL) __ j(OVERFLOW, deopt);
break;
}
case Token::kBIT_AND: {
@@ -3486,6 +3358,8 @@
break;
}
case Token::kTRUNCDIV: {
+ Label not_32bit, done;
+
Register temp = locs()->temp(0).reg();
ASSERT(left == RAX);
ASSERT((right != RDX) && (right != RAX));
@@ -3496,20 +3370,43 @@
__ testq(right, right);
__ j(ZERO, deopt);
}
+ // Check if both operands fit into 32bits as idiv with 64bit operands
+ // requires twice as many cycles and has much higher latency.
+ // We are checking this before untagging them to avoid corner case
+ // dividing INT_MAX by -1 that raises exception because quotient is
+ // too large for 32bit register.
+ __ movsxd(temp, left);
+ __ cmpq(temp, left);
+ __ j(NOT_EQUAL, ¬_32bit);
+ __ movsxd(temp, right);
+ __ cmpq(temp, right);
+ __ j(NOT_EQUAL, ¬_32bit);
+
// Both operands are 31bit smis. Divide using 32bit idiv.
__ SmiUntag(left);
__ SmiUntag(right);
__ cdq();
__ idivl(right);
+ __ movsxd(result, result);
+ __ jmp(&done);
+
+ // Divide using 64bit idiv.
+ __ Bind(¬_32bit);
+ __ SmiUntag(left);
+ __ SmiUntag(right);
+ __ cqo(); // Sign extend RAX -> RDX:RAX.
+ __ idivq(right); // RAX: quotient, RDX: remainder.
// Check the corner case of dividing the 'MIN_SMI' with -1, in which
// case we cannot tag the result.
- __ cmpl(result, Immediate(0x40000000));
+ __ CompareImmediate(result, Immediate(0x4000000000000000));
__ j(EQUAL, deopt);
- __ movsxd(result, result);
+ __ Bind(&done);
__ SmiTag(result);
break;
}
case Token::kMOD: {
+ Label not_32bit, div_done;
+
Register temp = locs()->temp(0).reg();
ASSERT(left == RDX);
ASSERT((right != RDX) && (right != RAX));
@@ -3520,6 +3417,17 @@
__ testq(right, right);
__ j(ZERO, deopt);
}
+ // Check if both operands fit into 32bits as idiv with 64bit operands
+ // requires twice as many cycles and has much higher latency.
+ // We are checking this before untagging them to avoid corner case
+ // dividing INT_MAX by -1 that raises exception because quotient is
+ // too large for 32bit register.
+ __ movsxd(temp, left);
+ __ cmpq(temp, left);
+ __ j(NOT_EQUAL, ¬_32bit);
+ __ movsxd(temp, right);
+ __ cmpq(temp, right);
+ __ j(NOT_EQUAL, ¬_32bit);
// Both operands are 31bit smis. Divide using 32bit idiv.
__ SmiUntag(left);
__ SmiUntag(right);
@@ -3527,7 +3435,16 @@
__ cdq();
__ idivl(right);
__ movsxd(result, result);
+ __ jmp(&div_done);
+ // Divide using 64bit idiv.
+ __ Bind(¬_32bit);
+ __ SmiUntag(left);
+ __ SmiUntag(right);
+ __ movq(RAX, RDX);
+ __ cqo(); // Sign extend RAX -> RDX:RAX.
+ __ idivq(right); // RAX: quotient, RDX: remainder.
+ __ Bind(&div_done);
// res = left % right;
// if (res < 0) {
// if (right < 0) {
@@ -3565,10 +3482,7 @@
__ j(LESS, deopt);
}
__ SmiUntag(right);
- // The sarq operation masks the count to 6 bits, but any shift between 31
- // and 63 gives the same result because 32 bit Smis are stored sign
- // extended in the registers. We check for 63 in order to take the branch
- // more predictably.
+ // sarq operation masks the count to 6 bits.
const intptr_t kCountLimit = 0x3F;
if (!RangeUtils::OnlyLessThanOrEqualTo(right_range(), kCountLimit)) {
__ CompareImmediate(right, Immediate(kCountLimit));
@@ -3781,52 +3695,41 @@
GetDeoptId(), ICData::kDeoptUnboxInteger)
: NULL;
ASSERT(value == locs()->out(0).reg());
- Label done_and_no_need_to_check_range;
-
- ASSERT(locs()->out(0).reg() == value);
if (value_cid == kSmiCid) {
- __ AssertSmiInRange(value);
__ SmiUntag(value);
- return;
} else if (value_cid == kMintCid) {
__ movq(value, FieldAddress(value, Mint::value_offset()));
} else if (!CanDeoptimize()) {
+ // Type information is not conclusive, but range analysis found
+ // the value to be in int64 range. Therefore it must be a smi
+ // or mint value.
+ ASSERT(is_truncating());
Label done;
__ SmiUntag(value);
__ j(NOT_CARRY, &done, Assembler::kNearJump);
- // Multiply by two in addressing mode because we erroneously
- // untagged a pointer by dividing it by two.
- Address value_field(value, TIMES_2, Mint::value_offset());
- if (is_truncating()) {
- __ movl(value, value_field);
- __ movsxd(value, value);
- } else {
- __ movq(value, value_field);
- }
+ __ movq(value, Address(value, TIMES_2, Mint::value_offset()));
__ Bind(&done);
return;
} else {
- __ SmiUntagOrCheckClass(value, kMintCid, &done_and_no_need_to_check_range);
+ Label done;
+ // Optimistically untag value.
+ __ SmiUntagOrCheckClass(value, kMintCid, &done);
__ j(NOT_EQUAL, deopt);
- // Multiply by two in addressing mode because we erroneously
- // untagged a pointer by dividing it by two.
+ // Undo untagging by multiplying value with 2.
__ movq(value, Address(value, TIMES_2, Mint::value_offset()));
+ __ Bind(&done);
}
- // We get here for the Mint cases, which might be out of range for an
- // unboxed int32 output.
-
- // TODO(vegorov): Truncating unboxing leaves garbage in the higher word.
- // Is this the best semantics?
+ // TODO(vegorov): as it is implemented right now truncating unboxing would
+ // leave "garbage" in the higher word.
if (!is_truncating() && (deopt != NULL)) {
ASSERT(representation() == kUnboxedInt32);
- const Register temp = locs()->temp(0).reg();
+ Register temp = locs()->temp(0).reg();
__ movsxd(temp, value);
__ cmpq(temp, value);
__ j(NOT_EQUAL, deopt);
}
- __ Bind(&done_and_no_need_to_check_range);
}
LocationSummary* BoxInteger32Instr::MakeLocationSummary(Zone* zone,
@@ -3834,61 +3737,27 @@
ASSERT((from_representation() == kUnboxedInt32) ||
(from_representation() == kUnboxedUint32));
const intptr_t kNumInputs = 1;
- const intptr_t kNumTemps = ValueFitsSmi() ? 0 : 1;
+ const intptr_t kNumTemps = 0;
LocationSummary* summary = new (zone)
- LocationSummary(zone, kNumInputs, kNumTemps,
- ValueFitsSmi() ? LocationSummary::kNoCall
- : LocationSummary::kCallOnSlowPath);
- const bool needs_writable_input =
- ValueFitsSmi() || (from_representation() == kUnboxedUint32);
- summary->set_in(0, needs_writable_input ? Location::RequiresRegister()
- : Location::WritableRegister());
- if (!ValueFitsSmi()) {
- summary->set_temp(0, Location::RequiresRegister());
- }
- summary->set_out(0, ValueFitsSmi() ? Location::SameAsFirstInput()
- : Location::RequiresRegister());
+ LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
+ summary->set_in(0, Location::RequiresRegister());
+ summary->set_out(0, Location::RequiresRegister());
return summary;
}
void BoxInteger32Instr::EmitNativeCode(FlowGraphCompiler* compiler) {
const Register value = locs()->in(0).reg();
const Register out = locs()->out(0).reg();
- Label done;
+ ASSERT(value != out);
+ ASSERT(kSmiTagSize == 1);
if (from_representation() == kUnboxedInt32) {
- __ MoveRegister(out, value);
- ASSERT(kSmiTagMask == 1 && kSmiTag == 0);
- __ addl(out, out);
- __ movsxd(out, out); // Does not affect flags.
+ __ movsxd(out, value);
} else {
- // Unsigned.
+ ASSERT(from_representation() == kUnboxedUint32);
__ movl(out, value);
- __ SmiTag(out);
}
-
- if (!ValueFitsSmi()) {
- if (from_representation() == kUnboxedInt32) {
- __ j(NO_OVERFLOW, &done);
- } else {
- ASSERT(value != out);
- __ TestImmediate(value, Immediate(0xc0000000ll));
- __ j(ZERO, &done);
- }
- // Allocate a mint.
- // Value input is a writable register and we have to inform the compiler of
- // the type so it can be preserved untagged on the slow path
- locs()->live_registers()->Add(locs()->in(0), kUnboxedInt32);
- BoxAllocationSlowPath::Allocate(compiler, this, compiler->mint_class(), out,
- locs()->temp(0).reg());
- if (from_representation() == kUnboxedInt32) {
- __ movsxd(value, value);
- } else {
- __ movl(value, value);
- }
- __ movq(FieldAddress(out, Mint::value_offset()), value);
- __ Bind(&done);
- }
+ __ SmiTag(out);
}
LocationSummary* BoxInt64Instr::MakeLocationSummary(Zone* zone,
@@ -3910,20 +3779,15 @@
void BoxInt64Instr::EmitNativeCode(FlowGraphCompiler* compiler) {
const Register out = locs()->out(0).reg();
const Register value = locs()->in(0).reg();
- __ leaq(out, Address(value, value, TIMES_1, 0));
+ __ MoveRegister(out, value);
+ __ SmiTag(out);
if (!ValueFitsSmi()) {
const Register temp = locs()->temp(0).reg();
Label done;
- __ movq(temp, value);
- __ sarq(temp, Immediate(30));
- __ addq(temp, Immediate(1));
- __ cmpq(temp, Immediate(2));
- __ j(BELOW, &done);
-
+ __ j(NO_OVERFLOW, &done);
BoxAllocationSlowPath::Allocate(compiler, this, compiler->mint_class(), out,
temp);
__ movq(FieldAddress(out, Mint::value_offset()), value);
-
__ Bind(&done);
}
}
@@ -4485,9 +4349,8 @@
switch (op_kind()) {
case Token::kNEGATE: {
Label* deopt = compiler->AddDeoptStub(deopt_id(), ICData::kDeoptUnaryOp);
- __ cmpq(value, Immediate(-0x80000000ll));
- __ j(EQUAL, deopt);
__ negq(value);
+ __ j(OVERFLOW, deopt);
break;
}
case Token::kBIT_NOT:
@@ -4636,7 +4499,6 @@
void SmiToDoubleInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
Register value = locs()->in(0).reg();
FpuRegister result = locs()->out(0).fpu_reg();
- __ AssertSmiInRange(value);
__ SmiUntag(value);
__ cvtsi2sdq(result, value);
}
@@ -4666,15 +4528,14 @@
ASSERT(result != value_obj);
ASSERT(result != temp);
__ movsd(value_double, FieldAddress(value_obj, Double::value_offset()));
- __ cvttsd2sil(result, value_double);
+ __ cvttsd2siq(result, value_double);
// Overflow is signalled with minint.
Label do_call, done;
// Check for overflow and that it fits into Smi.
- __ movl(temp, result);
- __ shll(temp, Immediate(1));
+ __ movq(temp, result);
+ __ shlq(temp, Immediate(1));
__ j(OVERFLOW, &do_call, Assembler::kNearJump);
- ASSERT(kSmiTagShift == 1 && kSmiTag == 0);
- __ movsxd(result, temp);
+ __ SmiTag(result);
__ jmp(&done);
__ Bind(&do_call);
__ pushq(value_obj);
@@ -4710,15 +4571,14 @@
XmmRegister value = locs()->in(0).fpu_reg();
Register temp = locs()->temp(0).reg();
- __ cvttsd2sil(result, value);
+ __ cvttsd2siq(result, value);
// Overflow is signalled with minint.
Label do_call, done;
// Check for overflow and that it fits into Smi.
- __ movl(temp, result);
- __ shll(temp, Immediate(1));
+ __ movq(temp, result);
+ __ shlq(temp, Immediate(1));
__ j(OVERFLOW, deopt);
- ASSERT(kSmiTagShift == 1 && kSmiTag == 0);
- __ movsxd(result, temp);
+ __ SmiTag(result);
}
LocationSummary* DoubleToDoubleInstr::MakeLocationSummary(Zone* zone,
@@ -5017,7 +4877,6 @@
// Both inputs must be writable because they will be untagged.
summary->set_in(0, Location::RegisterLocation(RAX));
summary->set_in(1, Location::WritableRegister());
- // Output is a pair of registers.
summary->set_out(0, Location::Pair(Location::RegisterLocation(RAX),
Location::RegisterLocation(RDX)));
return summary;
@@ -5032,26 +4891,50 @@
PairLocation* pair = locs()->out(0).AsPairLocation();
Register result1 = pair->At(0).reg();
Register result2 = pair->At(1).reg();
+ Label not_32bit, done;
+ Register temp = RDX;
+ ASSERT(left == RAX);
+ ASSERT((right != RDX) && (right != RAX));
+ ASSERT(result1 == RAX);
+ ASSERT(result2 == RDX);
if (RangeUtils::CanBeZero(divisor_range())) {
// Handle divide by zero in runtime.
__ testq(right, right);
__ j(ZERO, deopt);
}
- ASSERT(left == RAX);
- ASSERT((right != RDX) && (right != RAX));
- ASSERT(result1 == RAX);
- ASSERT(result2 == RDX);
+ // Check if both operands fit into 32bits as idiv with 64bit operands
+ // requires twice as many cycles and has much higher latency.
+ // We are checking this before untagging them to avoid corner case
+ // dividing INT_MAX by -1 that raises exception because quotient is
+ // too large for 32bit register.
+ __ movsxd(temp, left);
+ __ cmpq(temp, left);
+ __ j(NOT_EQUAL, ¬_32bit);
+ __ movsxd(temp, right);
+ __ cmpq(temp, right);
+ __ j(NOT_EQUAL, ¬_32bit);
+
// Both operands are 31bit smis. Divide using 32bit idiv.
__ SmiUntag(left);
__ SmiUntag(right);
__ cdq();
__ idivl(right);
- // Check the corner case of dividing the 'MIN_SMI' with -1, in which
- // case we cannot tag the result.
- __ cmpl(RAX, Immediate(0x40000000));
- __ j(EQUAL, deopt);
__ movsxd(RAX, RAX);
__ movsxd(RDX, RDX);
+ __ jmp(&done);
+
+ // Divide using 64bit idiv.
+ __ Bind(¬_32bit);
+ __ SmiUntag(left);
+ __ SmiUntag(right);
+ __ cqo(); // Sign extend RAX -> RDX:RAX.
+ __ idivq(right); // RAX: quotient, RDX: remainder.
+ // Check the corner case of dividing the 'MIN_SMI' with -1, in which
+ // case we cannot tag the result.
+ __ CompareImmediate(RAX, Immediate(0x4000000000000000));
+ __ j(EQUAL, deopt);
+ __ Bind(&done);
+
// Modulo correction (RDX).
// res = left % right;
// if (res < 0) {
@@ -5061,16 +4944,16 @@
// res = res + right;
// }
// }
- Label done;
+ Label all_done;
__ cmpq(RDX, Immediate(0));
- __ j(GREATER_EQUAL, &done, Assembler::kNearJump);
+ __ j(GREATER_EQUAL, &all_done, Assembler::kNearJump);
// Result is negative, adjust it.
if ((divisor_range() == NULL) || divisor_range()->Overlaps(-1, 1)) {
Label subtract;
__ cmpq(right, Immediate(0));
__ j(LESS, &subtract, Assembler::kNearJump);
__ addq(RDX, right);
- __ jmp(&done, Assembler::kNearJump);
+ __ jmp(&all_done, Assembler::kNearJump);
__ Bind(&subtract);
__ subq(RDX, right);
} else if (divisor_range()->IsPositive()) {
@@ -5080,7 +4963,7 @@
// Right is negative.
__ subq(RDX, right);
}
- __ Bind(&done);
+ __ Bind(&all_done);
__ SmiTag(RAX);
__ SmiTag(RDX);
@@ -5422,7 +5305,6 @@
// Code for a variable shift amount.
// Deoptimize if shift count is > 63 or negative.
// Sarq and shlq instructions mask the count to 6 bits.
- __ AssertSmiInRange(RCX);
__ SmiUntag(RCX);
if (!IsShiftCountInRange()) {
__ cmpq(RCX, Immediate(kMintShiftCountLimit));
@@ -5455,15 +5337,15 @@
}
CompileType BinaryUint32OpInstr::ComputeType() const {
- return CompileType::Int();
+ return CompileType::FromCid(kSmiCid);
}
CompileType ShiftUint32OpInstr::ComputeType() const {
- return CompileType::Int();
+ return CompileType::FromCid(kSmiCid);
}
CompileType UnaryUint32OpInstr::ComputeType() const {
- return CompileType::Int();
+ return CompileType::FromCid(kSmiCid);
}
LocationSummary* BinaryUint32OpInstr::MakeLocationSummary(Zone* zone,
@@ -5578,7 +5460,6 @@
Label zero;
// TODO(johnmccutchan): Use range information to avoid these checks.
- __ AssertSmiInRange(shifter);
__ SmiUntag(shifter);
__ cmpq(shifter, Immediate(0));
// If shift value is < 0, deoptimize.
@@ -5603,7 +5484,7 @@
__ Bind(&zero);
// Shift was greater than 31 bits, just return zero.
- __ xorl(left, left);
+ __ xorq(left, left);
// Exit path.
__ Bind(&done);
@@ -5644,8 +5525,8 @@
const Register out = locs()->out(0).reg();
// Representations are bitwise equivalent but we want to normalize
// upperbits for safety reasons.
- // TODO(vegorov) if we ensure that we never leave garbage in the upper bits
- // we could avoid this.
+ // TODO(vegorov) if we ensure that we never use upperbits we could
+ // avoid this.
__ movl(out, value);
} else if (from() == kUnboxedUint32 && to() == kUnboxedInt32) {
// Representations are bitwise equivalent.
diff --git a/runtime/vm/compiler/backend/range_analysis_test.cc b/runtime/vm/compiler/backend/range_analysis_test.cc
index 175b42b..081c7e8 100644
--- a/runtime/vm/compiler/backend/range_analysis_test.cc
+++ b/runtime/vm/compiler/backend/range_analysis_test.cc
@@ -66,10 +66,17 @@
RangeBoundary::PositiveInfinity());
TEST_RANGE_OP(Range::Shl, -1, 1, 63, 63, RangeBoundary(kMinInt64),
RangeBoundary::PositiveInfinity());
- TEST_RANGE_OP_SMI(Range::Shl, -1, 1, 30, 30, RangeBoundary(kSmiMin),
- RangeBoundary(kSmiMax));
- TEST_RANGE_OP_SMI(Range::Shl, -1, 1, 62, 62, RangeBoundary(kSmiMin),
- RangeBoundary(kSmiMax));
+ if (kBitsPerWord == 64) {
+ TEST_RANGE_OP_SMI(Range::Shl, -1, 1, 62, 62, RangeBoundary(kSmiMin),
+ RangeBoundary(kSmiMax));
+ TEST_RANGE_OP_SMI(Range::Shl, -1, 1, 30, 30, RangeBoundary(-(1 << 30)),
+ RangeBoundary(1 << 30));
+ } else {
+ TEST_RANGE_OP_SMI(Range::Shl, -1, 1, 30, 30, RangeBoundary(kSmiMin),
+ RangeBoundary(kSmiMax));
+ TEST_RANGE_OP_SMI(Range::Shl, -1, 1, 62, 62, RangeBoundary(kSmiMin),
+ RangeBoundary(kSmiMax));
+ }
TEST_RANGE_OP(Range::Shl, 0, 100, 0, 64, RangeBoundary(0),
RangeBoundary::PositiveInfinity());
TEST_RANGE_OP(Range::Shl, -100, 0, 0, 64, RangeBoundary::NegativeInfinity(),
diff --git a/runtime/vm/compiler/call_specializer.cc b/runtime/vm/compiler/call_specializer.cc
index 870884e..adfdeb3 100644
--- a/runtime/vm/compiler/call_specializer.cc
+++ b/runtime/vm/compiler/call_specializer.cc
@@ -1560,10 +1560,10 @@
}
void CallSpecializer::VisitLoadCodeUnits(LoadCodeUnitsInstr* instr) {
- // Note that on ARM64 the result can always be packed into a Smi, so this
- // is never triggered.
- // TODO(zerny): Use kUnboxedUint32 once it is fully supported/optimized.
+// TODO(zerny): Use kUnboxedUint32 once it is fully supported/optimized.
+#if defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_ARM)
if (!instr->can_pack_into_smi()) instr->set_representation(kUnboxedInt64);
+#endif
}
static bool CidTestResultsContains(const ZoneGrowableArray<intptr_t>& results,
diff --git a/runtime/vm/compiler/frontend/flow_graph_builder.cc b/runtime/vm/compiler/frontend/flow_graph_builder.cc
index 5c82158..c26f4a6 100644
--- a/runtime/vm/compiler/frontend/flow_graph_builder.cc
+++ b/runtime/vm/compiler/frontend/flow_graph_builder.cc
@@ -3797,15 +3797,18 @@
ASSERT(parent_type_args_var->owner() != scope);
// Call the runtime to concatenate both vectors.
ZoneGrowableArray<PushArgumentInstr*>* arguments =
- new (Z) ZoneGrowableArray<PushArgumentInstr*>(3);
+ new (Z) ZoneGrowableArray<PushArgumentInstr*>(4);
arguments->Add(PushArgument(type_args_val));
Value* parent_type_args_val =
Bind(BuildLoadLocal(*parent_type_args_var, node->token_pos()));
arguments->Add(PushArgument(parent_type_args_val));
- Value* len_const = Bind(new (Z) ConstantInstr(
+ Value* parent_len = Bind(new (Z) ConstantInstr(
+ Smi::ZoneHandle(Z, Smi::New(function.NumParentTypeParameters()))));
+ arguments->Add(PushArgument(parent_len));
+ Value* total_len = Bind(new (Z) ConstantInstr(
Smi::ZoneHandle(Z, Smi::New(function.NumTypeParameters() +
function.NumParentTypeParameters()))));
- arguments->Add(PushArgument(len_const));
+ arguments->Add(PushArgument(total_len));
const Library& dart_internal =
Library::Handle(Z, Library::InternalLibrary());
const Function& prepend_function =
diff --git a/runtime/vm/compiler/frontend/kernel_binary_flowgraph.cc b/runtime/vm/compiler/frontend/kernel_binary_flowgraph.cc
index 943119a..5d5b373 100644
--- a/runtime/vm/compiler/frontend/kernel_binary_flowgraph.cc
+++ b/runtime/vm/compiler/frontend/kernel_binary_flowgraph.cc
@@ -38,43 +38,55 @@
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;
}
@@ -114,25 +126,32 @@
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;
}
@@ -156,28 +175,35 @@
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) {
@@ -185,9 +211,11 @@
}
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 &&
@@ -207,6 +235,7 @@
helper_->SkipExpression(); // read initializer.
}
if (++next_read_ == field) return;
+ /* Falls through */
case kEnd:
return;
}
@@ -222,31 +251,39 @@
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 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) {
@@ -254,20 +291,24 @@
}
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;
}
@@ -283,28 +324,35 @@
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 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) {
@@ -312,9 +360,11 @@
}
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.
@@ -323,6 +373,7 @@
}
if (++next_read_ == field) return;
}
+ /* Falls through */
case kEnd:
return;
}
@@ -338,28 +389,35 @@
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 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) {
@@ -367,9 +425,11 @@
}
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) {
@@ -377,6 +437,7 @@
}
if (++next_read_ == field) return;
}
+ /* Falls through */
case kMixinType: {
Tag type_tag = helper_->ReadTag(); // read mixin type (part 1).
if (type_tag == kSomething) {
@@ -384,9 +445,11 @@
}
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.
@@ -396,6 +459,7 @@
}
if (++next_read_ == field) return;
}
+ /* Falls through */
case kConstructors: {
intptr_t list_length =
helper_->ReadListLength(); // read constructors list length.
@@ -406,6 +470,7 @@
}
if (++next_read_ == field) return;
}
+ /* Falls through */
case kProcedures: {
procedure_count_ = helper_->ReadListLength(); // read procedures #.
for (intptr_t i = 0; i < procedure_count_; i++) {
@@ -415,6 +480,7 @@
}
if (++next_read_ == field) return;
}
+ /* Falls through */
case kClassIndex:
// Read class index.
for (intptr_t i = 0; i < procedure_count_; ++i) {
@@ -423,6 +489,7 @@
helper_->reader_.ReadUInt32();
helper_->reader_.ReadUInt32();
if (++next_read_ == field) return;
+ /* Falls through */
case kEnd:
return;
}
@@ -437,20 +504,25 @@
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) {
@@ -458,6 +530,7 @@
}
if (++next_read_ == field) return;
}
+ /* Falls through */
case kAdditionalExports: {
intptr_t name_count = helper_->ReadUInt();
for (intptr_t i = 0; i < name_count; ++i) {
@@ -465,6 +538,7 @@
}
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) {
@@ -472,6 +546,7 @@
}
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++) {
@@ -479,6 +554,7 @@
}
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) {
@@ -487,6 +563,7 @@
}
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) {
@@ -495,6 +572,7 @@
}
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) {
@@ -503,6 +581,7 @@
}
if (++next_read_ == field) return;
}
+ /* Falls through */
case kLibraryIndex:
// Read library index.
for (intptr_t i = 0; i < class_count_; ++i) {
@@ -516,6 +595,7 @@
helper_->reader_.ReadUInt32();
helper_->reader_.ReadUInt32();
if (++next_read_ == field) return;
+ /* Falls through */
case kEnd:
return;
}
@@ -530,22 +610,27 @@
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) {
@@ -556,6 +641,7 @@
}
if (++next_read_ == field) return;
}
+ /* Falls through */
case kEnd:
return;
}
@@ -921,7 +1007,6 @@
switch (function.kind()) {
case RawFunction::kClosureFunction:
case RawFunction::kImplicitClosureFunction:
- case RawFunction::kConvertedClosureFunction:
case RawFunction::kRegularFunction:
case RawFunction::kGetterFunction:
case RawFunction::kSetterFunction:
@@ -1548,7 +1633,7 @@
builder_->ReadUInt(); // read value.
return;
case kDoubleLiteral:
- builder_->SkipStringReference(); // read index into string table.
+ builder_->ReadDouble(); // read value.
return;
case kTrueLiteral:
return;
@@ -1556,27 +1641,6 @@
return;
case kNullLiteral:
return;
- case kVectorCreation:
- builder_->ReadUInt(); // read size.
- return;
- case kVectorGet:
- VisitExpression(); // read expression.
- builder_->ReadUInt(); // read index.
- return;
- case kVectorSet:
- VisitExpression(); // read vector expression.
- builder_->ReadUInt(); // read index.
- VisitExpression(); // read value.
- return;
- case kVectorCopy:
- VisitExpression(); // read vector expression.
- return;
- case kClosureCreation:
- builder_->SkipCanonicalNameReference(); // read function reference.
- VisitExpression(); // read context vector.
- VisitDartType(); // read function type of the closure.
- builder_->SkipListOfDartTypes(); // read type arguments.
- return;
case kConstantExpression: {
builder_->SkipConstantReference();
return;
@@ -1959,7 +2023,6 @@
case kDynamicType:
case kVoidType:
case kBottomType:
- case kVectorType:
// those contain nothing.
return;
case kInterfaceType:
@@ -2449,9 +2512,6 @@
case kVoidType:
result_ = Object::void_type().raw();
break;
- case kVectorType:
- result_ = Object::vector_type().raw();
- break;
case kBottomType:
result_ =
Class::Handle(Z, I->object_store()->null_class()).CanonicalType();
@@ -3542,8 +3602,7 @@
}
void StreamingConstantEvaluator::EvaluateDoubleLiteral() {
- result_ = Double::New(H.DartString(builder_->ReadStringReference()),
- Heap::kOld); // read string reference.
+ result_ = Double::New(builder_->ReadDouble(), Heap::kOld); // read value.
result_ = H.Canonicalize(result_);
}
@@ -3929,9 +3988,9 @@
case kDynamicType:
case kVoidType:
case kBottomType:
- case kVectorType:
// those contain nothing.
break;
+ UNIMPLEMENTED();
case kInterfaceType:
CalculateInterfaceTypeFingerprint(false);
break;
@@ -4202,28 +4261,6 @@
CalculateExpressionFingerprint(); // read expression.
CalculateListOfDartTypesFingerprint(); // read type arguments.
return;
- case kVectorCreation:
- BuildHash(ReadUInt()); // read value.
- return;
- case kVectorGet:
- CalculateExpressionFingerprint(); // read vector expression.
- BuildHash(ReadUInt()); // read index.
- return;
- case kVectorSet:
- CalculateExpressionFingerprint(); // read vector expression.
- BuildHash(ReadUInt()); // read index.
- CalculateExpressionFingerprint(); // read value.
- return;
- case kVectorCopy:
- CalculateExpressionFingerprint(); // read vector expression.
- return;
- case kClosureCreation:
- // read top-level function reference.
- CalculateCanonicalNameFingerprint();
- CalculateExpressionFingerprint(); // read context vector.
- CalculateDartTypeFingerprint(); // read function type.
- CalculateListOfDartTypesFingerprint(); // read type arguments.
- return;
case kBigIntLiteral:
CalculateStringReferenceFingerprint(); // read string reference.
return;
@@ -4238,9 +4275,13 @@
case kPositiveIntLiteral:
BuildHash(ReadUInt()); // read value.
return;
- case kDoubleLiteral:
- CalculateStringReferenceFingerprint(); // read index into string table.
+ case kDoubleLiteral: {
+ double value = ReadDouble(); // read value.
+ uint64_t data = bit_cast<uint64_t>(value);
+ BuildHash(static_cast<uint32_t>(data >> 32));
+ BuildHash(static_cast<uint32_t>(data));
return;
+ }
case kTrueLiteral:
return;
case kFalseLiteral:
@@ -5411,61 +5452,12 @@
LocalVariable* closure = NULL;
if (dart_function.IsClosureFunction()) {
closure = parsed_function()->node_sequence()->scope()->VariableAt(0);
- } else if (dart_function.IsConvertedClosureFunction()) {
- closure = new (Z) LocalVariable(
- TokenPosition::kNoSource, TokenPosition::kNoSource,
- Symbols::TempParam(), AbstractType::ZoneHandle(Z, Type::DynamicType()));
- closure->set_index(parsed_function()->first_parameter_index());
- closure->set_is_captured_parameter(true);
}
- if ((dart_function.IsClosureFunction() ||
- dart_function.IsConvertedClosureFunction()) &&
- dart_function.NumParentTypeParameters() > 0 &&
- I->reify_generic_functions()) {
- LocalVariable* fn_type_args = parsed_function()->function_type_arguments();
- ASSERT(fn_type_args != NULL && closure != NULL);
-
- if (dart_function.IsGeneric()) {
- body += LoadLocal(fn_type_args);
- body += PushArgument();
- body += LoadLocal(closure);
- body += LoadField(Closure::function_type_arguments_offset());
- body += PushArgument();
- body += IntConstant(dart_function.NumTypeParameters() +
- dart_function.NumParentTypeParameters());
- body += PushArgument();
-
- const Library& dart_internal =
- Library::Handle(Z, Library::InternalLibrary());
- const Function& prepend_function =
- Function::ZoneHandle(Z, dart_internal.LookupFunctionAllowPrivate(
- Symbols::PrependTypeArguments()));
- ASSERT(!prepend_function.IsNull());
-
- body += StaticCall(TokenPosition::kNoSource, prepend_function, 3,
- ICData::kStatic);
- body += StoreLocal(TokenPosition::kNoSource, fn_type_args);
- body += Drop();
- } else {
- body += LoadLocal(closure);
- body += LoadField(Closure::function_type_arguments_offset());
- body += StoreLocal(TokenPosition::kNoSource, fn_type_args);
- body += Drop();
- }
- }
-
- if (dart_function.IsConvertedClosureFunction()) {
- body += LoadLocal(closure);
- body += LoadField(Closure::context_offset());
- LocalVariable* context = closure;
- body += StoreLocal(TokenPosition::kNoSource, context);
- body += Drop();
- }
-
- if (!dart_function.is_native())
+ if (!dart_function.is_native()) {
body += flow_graph_builder_->CheckStackOverflowInPrologue(
dart_function.token_pos());
+ }
intptr_t context_size =
parsed_function()->node_sequence()->scope()->num_context_variables();
if (context_size > 0) {
@@ -5654,6 +5646,53 @@
flow_graph_builder_->context_depth_ = current_context_depth;
}
+ // :function_type_arguments_var handling is built here and prepended to the
+ // body because it needs to be executed everytime we enter the function -
+ // even if we are resuming from the yield.
+ Fragment prologue;
+ if (dart_function.IsClosureFunction() &&
+ dart_function.NumParentTypeParameters() > 0 &&
+ I->reify_generic_functions()) {
+ // Function with yield points can not be generic itself but the outer
+ // function can be.
+ ASSERT(yield_continuations().is_empty() || !dart_function.IsGeneric());
+
+ LocalVariable* fn_type_args = parsed_function()->function_type_arguments();
+ ASSERT(fn_type_args != NULL && closure != NULL);
+
+ if (dart_function.IsGeneric()) {
+ prologue += LoadLocal(fn_type_args);
+ prologue += PushArgument();
+ prologue += LoadLocal(closure);
+ prologue += LoadField(Closure::function_type_arguments_offset());
+ prologue += PushArgument();
+ prologue += IntConstant(dart_function.NumParentTypeParameters());
+ prologue += PushArgument();
+ prologue += IntConstant(dart_function.NumTypeParameters() +
+ dart_function.NumParentTypeParameters());
+ prologue += PushArgument();
+
+ const Library& dart_internal =
+ Library::Handle(Z, Library::InternalLibrary());
+ const Function& prepend_function =
+ Function::ZoneHandle(Z, dart_internal.LookupFunctionAllowPrivate(
+ Symbols::PrependTypeArguments()));
+ ASSERT(!prepend_function.IsNull());
+
+ prologue += StaticCall(TokenPosition::kNoSource, prepend_function, 4,
+ ICData::kStatic);
+ prologue += StoreLocal(TokenPosition::kNoSource, fn_type_args);
+ prologue += Drop();
+ } else {
+ prologue += LoadLocal(closure);
+ prologue += LoadField(Closure::function_type_arguments_offset());
+ prologue += StoreLocal(TokenPosition::kNoSource, fn_type_args);
+ prologue += Drop();
+ }
+ }
+
+ body = prologue + body;
+
if (FLAG_causal_async_stacks &&
(dart_function.IsAsyncClosure() || dart_function.IsAsyncGenClosure())) {
// The code we are building will be executed right after we enter
@@ -5779,9 +5818,8 @@
return BuildGraphOfImplicitClosureFunction(function);
}
}
- // fallthrough intended
- case RawFunction::kClosureFunction:
- case RawFunction::kConvertedClosureFunction: {
+ /* Falls through */
+ case RawFunction::kClosureFunction: {
ReadUntilFunctionNode(parsed_function()); // read until function node.
return BuildGraphOfFunction(false);
}
@@ -5911,16 +5949,6 @@
return BuildBoolLiteral(false, position);
case kNullLiteral:
return BuildNullLiteral(position);
- case kVectorCreation:
- return BuildVectorCreation(position);
- case kVectorGet:
- return BuildVectorGet(position);
- case kVectorSet:
- return BuildVectorSet(position);
- case kVectorCopy:
- return BuildVectorCopy(position);
- case kClosureCreation:
- return BuildClosureCreation(position);
case kConstantExpression:
return BuildConstantExpression(position);
case kInstantiation:
@@ -6022,6 +6050,10 @@
return reader_.ReadUInt();
}
+double KernelReaderHelper::ReadDouble() {
+ return reader_.ReadDouble();
+}
+
uint32_t KernelReaderHelper::PeekListLength() {
AlternativeReadingScope alt(&reader_);
return reader_.ReadListLength();
@@ -6132,7 +6164,6 @@
case kDynamicType:
case kVoidType:
case kBottomType:
- case kVectorType:
// those contain nothing.
return;
case kInterfaceType:
@@ -6453,27 +6484,6 @@
SkipExpression(); // read expression.
SkipListOfDartTypes(); // read type arguments.
return;
- case kVectorCreation:
- ReadUInt(); // read value.
- return;
- case kVectorGet:
- SkipExpression(); // read vector expression.
- ReadUInt(); // read index.
- return;
- case kVectorSet:
- SkipExpression(); // read vector expression.
- ReadUInt(); // read index.
- SkipExpression(); // read value.
- return;
- case kVectorCopy:
- SkipExpression(); // read vector expression.
- return;
- case kClosureCreation:
- SkipCanonicalNameReference(); // read top-level function reference.
- SkipExpression(); // read context vector.
- SkipDartType(); // read function type.
- SkipListOfDartTypes(); // read type arguments.
- return;
case kBigIntLiteral:
SkipStringReference(); // read string reference.
return;
@@ -6489,7 +6499,7 @@
ReadUInt(); // read value.
return;
case kDoubleLiteral:
- SkipStringReference(); // read index into string table.
+ ReadDouble(); // read value.
return;
case kTrueLiteral:
return;
@@ -8983,8 +8993,7 @@
if (position != NULL) *position = TokenPosition::kNoSource;
Double& constant = Double::ZoneHandle(
- Z, Double::NewCanonical(
- H.DartString(ReadStringReference()))); // read string reference.
+ Z, Double::NewCanonical(ReadDouble())); // read double.
return Constant(constant);
}
@@ -9018,117 +9027,6 @@
return instructions;
}
-Fragment StreamingFlowGraphBuilder::BuildVectorCreation(
- TokenPosition* position) {
- if (position != NULL) *position = TokenPosition::kNoSource;
-
- intptr_t size = ReadUInt(); // read size.
- return AllocateContext(size);
-}
-
-Fragment StreamingFlowGraphBuilder::BuildVectorGet(TokenPosition* position) {
- if (position != NULL) *position = TokenPosition::kNoSource;
-
- Fragment instructions = BuildExpression(); // read expression.
- intptr_t index = ReadUInt(); // read index.
- instructions += LoadField(Context::variable_offset(index));
- return instructions;
-}
-
-Fragment StreamingFlowGraphBuilder::BuildVectorSet(TokenPosition* position) {
- if (position != NULL) *position = TokenPosition::kNoSource;
-
- Fragment instructions = NullConstant();
- LocalVariable* result = MakeTemporary();
-
- instructions += BuildExpression(); // read vector expression.
- intptr_t index = ReadUInt(); // read index.
- instructions += BuildExpression(); // read value expression.
- instructions += StoreLocal(TokenPosition::kNoSource, result);
-
- instructions += StoreInstanceField(TokenPosition::kNoSource,
- Context::variable_offset(index));
-
- return instructions;
-}
-
-Fragment StreamingFlowGraphBuilder::BuildVectorCopy(TokenPosition* position) {
- if (position != NULL) *position = TokenPosition::kNoSource;
-
- Fragment instructions = BuildExpression(); // read vector expression.
- Value* context_to_copy = Pop();
- // TODO(dartbug.com/31218) VectorCopy should contain size of the context
- // as a constant.
- CloneContextInstr* clone_instruction =
- new (Z) CloneContextInstr(TokenPosition::kNoSource, context_to_copy,
- CloneContextInstr::kUnknownContextSize,
- Thread::Current()->GetNextDeoptId());
- instructions <<= clone_instruction;
- Push(clone_instruction);
-
- return instructions;
-}
-
-Fragment StreamingFlowGraphBuilder::BuildClosureCreation(
- TokenPosition* position) {
- if (position != NULL) *position = TokenPosition::kNoSource;
-
- NameIndex function_reference =
- ReadCanonicalNameReference(); // read function reference.
- Function& function = Function::ZoneHandle(
- Z, H.LookupStaticMethodByKernelProcedure(function_reference));
-
- intptr_t num_type_parameters;
- {
- AlternativeReadingScope _(&reader_);
- SkipExpression(); // context vector
- SkipDartType(); // skip function type
- num_type_parameters = ReadListLength();
- }
- function = function.ConvertedClosureFunction(num_type_parameters);
- ASSERT(!function.IsNull());
-
- const Class& closure_class =
- Class::ZoneHandle(Z, I->object_store()->closure_class());
- Fragment instructions = AllocateObject(closure_class, function);
- LocalVariable* closure = MakeTemporary();
-
- instructions += BuildExpression(); // read context vector.
- LocalVariable* context = MakeTemporary();
-
- instructions += LoadLocal(closure);
- instructions += Constant(function);
- instructions +=
- StoreInstanceField(TokenPosition::kNoSource, Closure::function_offset());
-
- instructions += LoadLocal(closure);
- instructions += LoadLocal(context);
- instructions +=
- StoreInstanceField(TokenPosition::kNoSource, Closure::context_offset());
-
- // Skip the function type of the closure (it's predicable from the
- // target and the supplied type arguments).
- SkipDartType();
-
- ReadListLength(); // type parameter count
- if (num_type_parameters > 0) {
- instructions += LoadLocal(closure);
- const TypeArguments& type_args = T.BuildTypeArguments(
- num_type_parameters); // read list of type arguments.
- instructions += TranslateInstantiatedTypeArguments(type_args);
- instructions += StoreInstanceField(
- TokenPosition::kNoSource, Closure::function_type_arguments_offset());
- }
-
- instructions += LoadLocal(closure);
- instructions += Constant(Object::empty_type_arguments());
- instructions += StoreInstanceField(TokenPosition::kNoSource,
- Closure::delayed_type_arguments_offset());
-
- instructions += Drop(); // context
- return instructions;
-}
-
Fragment StreamingFlowGraphBuilder::BuildConstantExpression(
TokenPosition* position) {
if (position != NULL) *position = TokenPosition::kNoSource;
@@ -10826,8 +10724,7 @@
break;
}
case kDoubleConstant: {
- temp_instance_ = Double::New(
- H.DartString(builder_.ReadStringReference()), Heap::kOld);
+ temp_instance_ = Double::New(builder_.ReadDouble(), Heap::kOld);
temp_instance_ = H.Canonicalize(temp_instance_);
break;
}
diff --git a/runtime/vm/compiler/frontend/kernel_binary_flowgraph.h b/runtime/vm/compiler/frontend/kernel_binary_flowgraph.h
index 82ebe8a..87ef12b 100644
--- a/runtime/vm/compiler/frontend/kernel_binary_flowgraph.h
+++ b/runtime/vm/compiler/frontend/kernel_binary_flowgraph.h
@@ -769,7 +769,6 @@
void VisitInterfaceType(bool simple);
void VisitFunctionType(bool simple);
void VisitTypeParameterType();
- void VisitVectorType();
void HandleLocalFunction(intptr_t parent_kernel_offset);
AbstractType& BuildAndVisitVariableType();
@@ -1043,6 +1042,7 @@
uint32_t ReadUInt();
uint32_t ReadUInt32();
uint32_t PeekUInt();
+ double ReadDouble();
uint32_t PeekListLength();
StringIndex ReadStringReference();
NameIndex ReadCanonicalNameReference();
@@ -1510,11 +1510,6 @@
Fragment BuildBoolLiteral(bool value, TokenPosition* position);
Fragment BuildNullLiteral(TokenPosition* position);
Fragment BuildFutureNullValue(TokenPosition* position);
- Fragment BuildVectorCreation(TokenPosition* position);
- Fragment BuildVectorGet(TokenPosition* position);
- Fragment BuildVectorSet(TokenPosition* position);
- Fragment BuildVectorCopy(TokenPosition* position);
- Fragment BuildClosureCreation(TokenPosition* position);
Fragment BuildConstantExpression(TokenPosition* position);
Fragment BuildPartialTearoffInstantiation(TokenPosition* position);
diff --git a/runtime/vm/compiler/frontend/prologue_builder.cc b/runtime/vm/compiler/frontend/prologue_builder.cc
index 902b5b0..3e32dbc 100644
--- a/runtime/vm/compiler/frontend/prologue_builder.cc
+++ b/runtime/vm/compiler/frontend/prologue_builder.cc
@@ -34,8 +34,7 @@
const bool load_optional_arguments = function_.HasOptionalParameters();
const bool expect_type_args =
function_.IsGeneric() && isolate->reify_generic_functions();
- const bool check_arguments =
- (function_.IsClosureFunction() || function_.IsConvertedClosureFunction());
+ const bool check_arguments = function_.IsClosureFunction();
Fragment prologue = Fragment(entry);
JoinEntryInstr* nsm = NULL;
diff --git a/runtime/vm/compiler/intrinsifier.cc b/runtime/vm/compiler/intrinsifier.cc
index 654d33c..d7ffab5 100644
--- a/runtime/vm/compiler/intrinsifier.cc
+++ b/runtime/vm/compiler/intrinsifier.cc
@@ -61,6 +61,45 @@
}
#if !defined(DART_PRECOMPILED_RUNTIME)
+struct IntrinsicDesc {
+ const char* class_name;
+ const char* function_name;
+};
+
+struct LibraryInstrinsicsDesc {
+ Library& library;
+ IntrinsicDesc* intrinsics;
+};
+
+#define DEFINE_INTRINSIC(class_name, function_name, destination, type, fp) \
+ {#class_name, #function_name},
+
+// clang-format off
+static IntrinsicDesc core_intrinsics[] = {
+ CORE_LIB_INTRINSIC_LIST(DEFINE_INTRINSIC)
+ CORE_INTEGER_LIB_INTRINSIC_LIST(DEFINE_INTRINSIC)
+ GRAPH_CORE_INTRINSICS_LIST(DEFINE_INTRINSIC)
+ {nullptr, nullptr},
+};
+
+static IntrinsicDesc math_intrinsics[] = {
+ MATH_LIB_INTRINSIC_LIST(DEFINE_INTRINSIC)
+ GRAPH_MATH_LIB_INTRINSIC_LIST(DEFINE_INTRINSIC)
+ {nullptr, nullptr},
+};
+
+static IntrinsicDesc typed_data_intrinsics[] = {
+ TYPED_DATA_LIB_INTRINSIC_LIST(DEFINE_INTRINSIC)
+ GRAPH_TYPED_DATA_INTRINSICS_LIST(DEFINE_INTRINSIC)
+ {nullptr, nullptr},
+};
+
+static IntrinsicDesc developer_intrinsics[] = {
+ DEVELOPER_LIB_INTRINSIC_LIST(DEFINE_INTRINSIC)
+ {nullptr, nullptr},
+};
+// clang-format on
+
void Intrinsifier::InitializeState() {
Thread* thread = Thread::Current();
Zone* zone = thread->zone();
@@ -68,62 +107,53 @@
Class& cls = Class::Handle(zone);
Function& func = Function::Handle(zone);
String& str = String::Handle(zone);
+ String& str2 = String::Handle(zone);
Error& error = Error::Handle(zone);
-#define SETUP_FUNCTION(class_name, function_name, destination, type, fp) \
- func = Function::null(); \
- if (strcmp(#class_name, "::") == 0) { \
- str = String::New(#function_name); \
- func = lib.LookupFunctionAllowPrivate(str); \
- } else { \
- str = String::New(#class_name); \
- cls = lib.LookupClassAllowPrivate(str); \
- ASSERT(FLAG_precompiled_mode || !cls.IsNull()); \
- if (!cls.IsNull()) { \
- error = cls.EnsureIsFinalized(thread); \
- if (!error.IsNull()) { \
- OS::PrintErr("%s\n", error.ToErrorCString()); \
- } \
- ASSERT(error.IsNull()); \
- if (#function_name[0] == '.') { \
- str = String::New(#class_name #function_name); \
- } else { \
- str = String::New(#function_name); \
- } \
- func = cls.LookupFunctionAllowPrivate(str); \
- } \
- } \
- if (!func.IsNull()) { \
- func.set_is_intrinsic(true); \
- } else if (!FLAG_precompiled_mode) { \
- FATAL2("Intrinsifier failed to find method %s in class %s\n", \
- #function_name, #class_name); \
+ static const intptr_t kNumLibs = 4;
+ LibraryInstrinsicsDesc intrinsics[kNumLibs] = {
+ {Library::Handle(zone, Library::CoreLibrary()), core_intrinsics},
+ {Library::Handle(zone, Library::MathLibrary()), math_intrinsics},
+ {Library::Handle(zone, Library::TypedDataLibrary()),
+ typed_data_intrinsics},
+ {Library::Handle(zone, Library::DeveloperLibrary()),
+ developer_intrinsics},
+ };
+
+ for (intptr_t i = 0; i < kNumLibs; i++) {
+ lib = intrinsics[i].library.raw();
+ for (IntrinsicDesc* intrinsic = intrinsics[i].intrinsics;
+ intrinsic->class_name != nullptr; intrinsic++) {
+ func = Function::null();
+ if (strcmp(intrinsic->class_name, "::") == 0) {
+ str = String::New(intrinsic->function_name);
+ func = lib.LookupFunctionAllowPrivate(str);
+ } else {
+ str = String::New(intrinsic->class_name);
+ cls = lib.LookupClassAllowPrivate(str);
+ ASSERT(FLAG_precompiled_mode || !cls.IsNull());
+ if (!cls.IsNull()) {
+ error = cls.EnsureIsFinalized(thread);
+ if (!error.IsNull()) {
+ OS::PrintErr("%s\n", error.ToErrorCString());
+ }
+ ASSERT(error.IsNull());
+ str = String::New(intrinsic->function_name);
+ if (intrinsic->function_name[0] == '.') {
+ str2 = String::New(intrinsic->class_name);
+ str = String::Concat(str2, str);
+ }
+ func = cls.LookupFunctionAllowPrivate(str);
+ }
+ }
+ if (!func.IsNull()) {
+ func.set_is_intrinsic(true);
+ } else if (!FLAG_precompiled_mode) {
+ FATAL2("Intrinsifier failed to find method %s in class %s\n",
+ intrinsic->function_name, intrinsic->class_name);
+ }
+ }
}
-
- // Set up all core lib functions that can be intrinsified.
- lib = Library::CoreLibrary();
- ASSERT(!lib.IsNull());
- CORE_LIB_INTRINSIC_LIST(SETUP_FUNCTION);
- CORE_INTEGER_LIB_INTRINSIC_LIST(SETUP_FUNCTION);
- GRAPH_CORE_INTRINSICS_LIST(SETUP_FUNCTION);
-
- // Set up all math lib functions that can be intrinsified.
- lib = Library::MathLibrary();
- ASSERT(!lib.IsNull());
- MATH_LIB_INTRINSIC_LIST(SETUP_FUNCTION);
- GRAPH_MATH_LIB_INTRINSIC_LIST(SETUP_FUNCTION);
-
- // Set up all dart:typed_data lib functions that can be intrinsified.
- lib = Library::TypedDataLibrary();
- ASSERT(!lib.IsNull());
- TYPED_DATA_LIB_INTRINSIC_LIST(SETUP_FUNCTION);
- GRAPH_TYPED_DATA_INTRINSICS_LIST(SETUP_FUNCTION);
-
- // Setup all dart:developer lib functions that can be intrinsified.
- lib = Library::DeveloperLibrary();
- ASSERT(!lib.IsNull());
- DEVELOPER_LIB_INTRINSIC_LIST(SETUP_FUNCTION);
-
#undef SETUP_FUNCTION
}
#endif // !defined(DART_PRECOMPILED_RUNTIME)
diff --git a/runtime/vm/compiler/intrinsifier_arm64.cc b/runtime/vm/compiler/intrinsifier_arm64.cc
index 2102c93..4598536 100644
--- a/runtime/vm/compiler/intrinsifier_arm64.cc
+++ b/runtime/vm/compiler/intrinsifier_arm64.cc
@@ -265,9 +265,8 @@
void Intrinsifier::Integer_addFromInteger(Assembler* assembler) {
Label fall_through;
TestBothArgumentsSmis(assembler, &fall_through); // Checks two smis.
- __ addsw(R0, R0, Operand(R1)); // Adds.
+ __ adds(R0, R0, Operand(R1)); // Adds.
__ b(&fall_through, VS); // Fall-through on overflow.
- __ sxtw(R0, R0); // Sign extend - flags not affected.
__ ret();
__ Bind(&fall_through);
}
@@ -279,9 +278,8 @@
void Intrinsifier::Integer_subFromInteger(Assembler* assembler) {
Label fall_through;
TestBothArgumentsSmis(assembler, &fall_through);
- __ subsw(R0, R0, Operand(R1)); // Subtract.
- __ b(&fall_through, VS); // Fall-through on overflow.
- __ sxtw(R0, R0); // Sign extend - flags not affected.
+ __ subs(R0, R0, Operand(R1)); // Subtract.
+ __ b(&fall_through, VS); // Fall-through on overflow.
__ ret();
__ Bind(&fall_through);
}
@@ -289,9 +287,8 @@
void Intrinsifier::Integer_sub(Assembler* assembler) {
Label fall_through;
TestBothArgumentsSmis(assembler, &fall_through);
- __ subsw(R0, R1, Operand(R0)); // Subtract.
- __ b(&fall_through, VS); // Fall-through on overflow.
- __ sxtw(R0, R0); // Sign extend - flags not affected.
+ __ subs(R0, R1, Operand(R0)); // Subtract.
+ __ b(&fall_through, VS); // Fall-through on overflow.
__ ret();
__ Bind(&fall_through);
}
@@ -302,9 +299,9 @@
TestBothArgumentsSmis(assembler, &fall_through); // checks two smis
__ SmiUntag(R0); // Untags R6. We only want result shifted by one.
- __ smull(TMP, R0, R1);
- __ AsrImmediate(TMP2, TMP, 31);
- // TMP: result bits 31..63.
+ __ mul(TMP, R0, R1);
+ __ smulh(TMP2, R0, R1);
+ // TMP: result bits 64..127.
__ cmp(TMP2, Operand(TMP, ASR, 63));
__ b(&fall_through, NE);
__ mov(R0, TMP);
@@ -420,7 +417,7 @@
// Check the corner case of dividing the 'MIN_SMI' with -1, in which case we
// cannot tag the result.
- __ CompareImmediate(R0, 0x40000000);
+ __ CompareImmediate(R0, 0x4000000000000000);
__ b(&fall_through, EQ);
__ SmiTag(R0); // Not equal. Okay to tag and return.
__ ret(); // Return.
@@ -431,9 +428,8 @@
Label fall_through;
__ ldr(R0, Address(SP, +0 * kWordSize)); // Grab first argument.
__ BranchIfNotSmi(R0, &fall_through);
- __ negsw(R0, R0);
+ __ negs(R0, R0);
__ b(&fall_through, VS);
- __ sxtw(R0, R0); // Sign extend - flags not affected.
__ ret();
__ Bind(&fall_through);
}
@@ -492,9 +488,9 @@
// Check if count too large for handling it inlined.
__ SmiUntag(TMP, right); // SmiUntag right into TMP.
// Overflow test (preserve left, right, and TMP);
- __ lslvw(temp, left, TMP);
- __ asrvw(TMP2, temp, TMP);
- __ cmpw(left, Operand(TMP2));
+ __ lslv(temp, left, TMP);
+ __ asrv(TMP2, temp, TMP);
+ __ CompareRegisters(left, TMP2);
__ b(&fall_through, NE); // Overflow.
// Shift for result now we know there is no overflow.
__ lslv(result, left, TMP);
@@ -567,7 +563,6 @@
__ CompareClassId(R0, kDoubleCid);
__ b(&fall_through, EQ);
- __ AssertSmiInRange(R1);
__ LoadObject(R0, Bool::False()); // Smi == Mint -> false.
__ ret();
@@ -578,7 +573,6 @@
__ b(&fall_through, NE);
// Receiver is Mint, return false if right is Smi.
__ BranchIfNotSmi(R0, &fall_through);
- __ AssertSmiInRange(R0);
__ LoadObject(R0, Bool::False());
__ ret();
// TODO(srdjan): Implement Mint == Mint comparison.
@@ -1501,12 +1495,11 @@
__ fcmpd(V0, V0);
__ b(&fall_through, VS);
- __ fcvtzdsx(R0, V0);
+ __ fcvtzds(R0, V0);
// Overflow is signaled with minint.
// Check for overflow and that it fits into Smi.
- __ AsrImmediate(TMP, R0, 30);
- __ cmp(TMP, Operand(R0, ASR, 63));
- __ b(&fall_through, NE);
+ __ CompareImmediate(R0, 0xC000000000000000);
+ __ b(&fall_through, MI);
__ SmiTag(R0);
__ ret();
__ Bind(&fall_through);
@@ -1523,10 +1516,10 @@
__ fcmpd(V0, V0);
__ b(&double_hash, VS);
- // Convert double value to signed 32-bit int in R0 and back to a
+ // Convert double value to signed 64-bit int in R0 and back to a
// double value in V1.
- __ fcvtzdsw(R0, V0);
- __ scvtfdw(V1, R0);
+ __ fcvtzds(R0, V0);
+ __ scvtfdx(V1, R0);
// Tag the int as a Smi, making sure that it fits; this checks for
// overflow in the conversion from double to int. Conversion
@@ -1534,9 +1527,8 @@
// INT64_MAX or INT64_MIN (saturation).
Label fall_through;
ASSERT(kSmiTag == 0 && kSmiTagShift == 1);
- __ addsw(R0, R0, Operand(R0));
+ __ adds(R0, R0, Operand(R0));
__ b(&fall_through, VS);
- __ sxtw(R0, R0); // Sign extend - flags not affected.
// Compare the two double values. If they are equal, we return the
// Smi tagged result immediately as the hash code.
diff --git a/runtime/vm/compiler/intrinsifier_x64.cc b/runtime/vm/compiler/intrinsifier_x64.cc
index c8ddf76..1e2574c 100644
--- a/runtime/vm/compiler/intrinsifier_x64.cc
+++ b/runtime/vm/compiler/intrinsifier_x64.cc
@@ -269,10 +269,8 @@
Label fall_through;
TestBothArgumentsSmis(assembler, &fall_through);
// RAX contains right argument.
- __ AssertSmiInRange(RAX);
- __ addl(RAX, Address(RSP, +2 * kWordSize));
+ __ addq(RAX, Address(RSP, +2 * kWordSize));
__ j(OVERFLOW, &fall_through, Assembler::kNearJump);
- __ movsxd(RAX, RAX);
// Result is in RAX.
__ ret();
__ Bind(&fall_through);
@@ -286,10 +284,8 @@
Label fall_through;
TestBothArgumentsSmis(assembler, &fall_through);
// RAX contains right argument, which is the actual minuend of subtraction.
- __ AssertSmiInRange(RAX);
- __ subl(RAX, Address(RSP, +2 * kWordSize));
+ __ subq(RAX, Address(RSP, +2 * kWordSize));
__ j(OVERFLOW, &fall_through, Assembler::kNearJump);
- __ movsxd(RAX, RAX);
// Result is in RAX.
__ ret();
__ Bind(&fall_through);
@@ -299,13 +295,10 @@
Label fall_through;
TestBothArgumentsSmis(assembler, &fall_through);
// RAX contains right argument, which is the actual subtrahend of subtraction.
- __ AssertSmiInRange(RAX);
__ movq(RCX, RAX);
__ movq(RAX, Address(RSP, +2 * kWordSize));
- __ AssertSmiInRange(RAX);
- __ subl(RAX, RCX);
+ __ subq(RAX, RCX);
__ j(OVERFLOW, &fall_through, Assembler::kNearJump);
- __ movsxd(RAX, RAX);
// Result is in RAX.
__ ret();
__ Bind(&fall_through);
@@ -315,12 +308,10 @@
Label fall_through;
TestBothArgumentsSmis(assembler, &fall_through);
// RAX is the right argument.
- __ AssertSmiInRange(RAX);
ASSERT(kSmiTag == 0); // Adjust code below if not the case.
__ SmiUntag(RAX);
- __ imull(RAX, Address(RSP, +2 * kWordSize));
+ __ imulq(RAX, Address(RSP, +2 * kWordSize));
__ j(OVERFLOW, &fall_through, Assembler::kNearJump);
- __ movsxd(RAX, RAX);
// Result is in RAX.
__ ret();
__ Bind(&fall_through);
@@ -342,9 +333,7 @@
// RAX: Untagged fallthrough result (remainder to be adjusted), or
// RAX: Tagged return result (remainder).
static void EmitRemainderOperation(Assembler* assembler) {
- Label return_zero, try_modulo, not_32bit;
- __ AssertSmiInRange(RAX);
- __ AssertSmiInRange(RCX);
+ Label return_zero, try_modulo, not_32bit, done;
// Check for quick zero results.
__ cmpq(RAX, Immediate(0));
__ j(EQUAL, &return_zero, Assembler::kNearJump);
@@ -366,12 +355,33 @@
__ Bind(&try_modulo);
+ // Check if both operands fit into 32bits as idiv with 64bit operands
+ // requires twice as many cycles and has much higher latency. We are checking
+ // this before untagging them to avoid corner case dividing INT_MAX by -1 that
+ // raises exception because quotient is too large for 32bit register.
+ __ movsxd(RBX, RAX);
+ __ cmpq(RBX, RAX);
+ __ j(NOT_EQUAL, ¬_32bit, Assembler::kNearJump);
+ __ movsxd(RBX, RCX);
+ __ cmpq(RBX, RCX);
+ __ j(NOT_EQUAL, ¬_32bit, Assembler::kNearJump);
+
// Both operands are 31bit smis. Divide using 32bit idiv.
__ SmiUntag(RAX);
__ SmiUntag(RCX);
__ cdq();
__ idivl(RCX);
__ movsxd(RAX, RDX);
+ __ jmp(&done, Assembler::kNearJump);
+
+ // Divide using 64bit idiv.
+ __ Bind(¬_32bit);
+ __ SmiUntag(RAX);
+ __ SmiUntag(RCX);
+ __ cqo();
+ __ idivq(RCX);
+ __ movq(RAX, RDX);
+ __ Bind(&done);
}
// Implementation:
@@ -386,9 +396,7 @@
void Intrinsifier::Integer_moduloFromInteger(Assembler* assembler) {
Label fall_through, negative_result;
TestBothArgumentsSmis(assembler, &fall_through);
- __ AssertSmiInRange(RAX);
__ movq(RCX, Address(RSP, +2 * kWordSize));
- __ AssertSmiInRange(RCX);
// RAX: Tagged left (dividend).
// RCX: Tagged right (divisor).
__ cmpq(RCX, Immediate(0));
@@ -422,17 +430,21 @@
Label fall_through, not_32bit;
TestBothArgumentsSmis(assembler, &fall_through);
// RAX: right argument (divisor)
- __ AssertSmiInRange(RAX);
__ cmpq(RAX, Immediate(0));
__ j(EQUAL, &fall_through, Assembler::kNearJump);
__ movq(RCX, RAX);
__ movq(RAX, Address(RSP, +2 * kWordSize)); // Left argument (dividend).
- __ AssertSmiInRange(RAX);
- // Check the corner case of dividing the 'MIN_SMI' with -1, in which case we
- // cannot tag the result.
- __ cmpq(RAX, Immediate(-0x80000000ll));
- __ j(EQUAL, &fall_through);
+ // Check if both operands fit into 32bits as idiv with 64bit operands
+ // requires twice as many cycles and has much higher latency. We are checking
+ // this before untagging them to avoid corner case dividing INT_MAX by -1 that
+ // raises exception because quotient is too large for 32bit register.
+ __ movsxd(RBX, RAX);
+ __ cmpq(RBX, RAX);
+ __ j(NOT_EQUAL, ¬_32bit);
+ __ movsxd(RBX, RCX);
+ __ cmpq(RBX, RCX);
+ __ j(NOT_EQUAL, ¬_32bit);
// Both operands are 31bit smis. Divide using 32bit idiv.
__ SmiUntag(RAX);
@@ -442,6 +454,21 @@
__ movsxd(RAX, RAX);
__ SmiTag(RAX); // Result is guaranteed to fit into a smi.
__ ret();
+
+ // Divide using 64bit idiv.
+ __ Bind(¬_32bit);
+ __ SmiUntag(RAX);
+ __ SmiUntag(RCX);
+ __ pushq(RDX); // Preserve RDX in case of 'fall_through'.
+ __ cqo();
+ __ idivq(RCX);
+ __ popq(RDX);
+ // Check the corner case of dividing the 'MIN_SMI' with -1, in which case we
+ // cannot tag the result.
+ __ cmpq(RAX, Immediate(0x4000000000000000));
+ __ j(EQUAL, &fall_through);
+ __ SmiTag(RAX);
+ __ ret();
__ Bind(&fall_through);
}
@@ -450,10 +477,8 @@
__ movq(RAX, Address(RSP, +1 * kWordSize));
__ testq(RAX, Immediate(kSmiTagMask));
__ j(NOT_ZERO, &fall_through, Assembler::kNearJump); // Non-smi value.
- __ AssertSmiInRange(RAX);
- __ cmpq(RAX, Immediate(-0x80000000ll));
- __ j(EQUAL, &fall_through, Assembler::kNearJump);
__ negq(RAX);
+ __ j(OVERFLOW, &fall_through, Assembler::kNearJump);
// Result is in RAX.
__ ret();
__ Bind(&fall_through);
@@ -462,7 +487,6 @@
void Intrinsifier::Integer_bitAndFromInteger(Assembler* assembler) {
Label fall_through;
TestBothArgumentsSmis(assembler, &fall_through);
- __ AssertSmiInRange(RAX);
// RAX is the right argument.
__ andq(RAX, Address(RSP, +2 * kWordSize));
// Result is in RAX.
@@ -478,7 +502,6 @@
Label fall_through;
TestBothArgumentsSmis(assembler, &fall_through);
// RAX is the right argument.
- __ AssertSmiInRange(RAX);
__ orq(RAX, Address(RSP, +2 * kWordSize));
// Result is in RAX.
__ ret();
@@ -494,7 +517,6 @@
TestBothArgumentsSmis(assembler, &fall_through);
// RAX is the right argument.
__ xorq(RAX, Address(RSP, +2 * kWordSize));
- __ AssertSmiInRange(RAX);
// Result is in RAX.
__ ret();
__ Bind(&fall_through);
@@ -510,32 +532,28 @@
Label fall_through, overflow;
TestBothArgumentsSmis(assembler, &fall_through);
// Shift value is in RAX. Compare with tagged Smi.
- __ AssertSmiInRange(RAX);
__ cmpq(RAX, Immediate(Smi::RawValue(Smi::kBits)));
__ j(ABOVE_EQUAL, &fall_through, Assembler::kNearJump);
__ SmiUntag(RAX);
__ movq(RCX, RAX); // Shift amount must be in RCX.
__ movq(RAX, Address(RSP, +2 * kWordSize)); // Value.
- __ AssertSmiInRange(RAX);
// Overflow test - all the shifted-out bits must be same as the sign bit.
__ movq(RDI, RAX);
- __ shll(RAX, RCX);
- __ sarl(RAX, RCX);
- __ movsxd(RAX, RAX);
+ __ shlq(RAX, RCX);
+ __ sarq(RAX, RCX);
__ cmpq(RAX, RDI);
__ j(NOT_EQUAL, &overflow, Assembler::kNearJump);
- __ shlq(RDI, RCX); // Shift for result now we know there is no overflow.
- __ movq(RAX, RDI);
+ __ shlq(RAX, RCX); // Shift for result now we know there is no overflow.
// RAX is a correctly tagged Smi.
__ ret();
__ Bind(&overflow);
- // Mint is used on x64 for integers requiring 64 bit instead of 31 bits as
- // represented by Smi.
+ // Mint is rarely used on x64 (only for integers requiring 64 bit instead of
+ // 63 bits as represented by Smi).
__ Bind(&fall_through);
}
@@ -543,7 +561,6 @@
Label fall_through, true_label;
TestBothArgumentsSmis(assembler, &fall_through);
// RAX contains the right argument.
- __ AssertSmiInRange(RAX);
__ cmpq(Address(RSP, +2 * kWordSize), RAX);
__ j(true_condition, &true_label, Assembler::kNearJump);
__ LoadObject(RAX, Bool::False());
@@ -589,9 +606,6 @@
__ orq(RAX, RCX);
__ testq(RAX, Immediate(kSmiTagMask));
__ j(NOT_ZERO, &check_for_mint, Assembler::kNearJump);
- // Or-ing them together should still leave them both as compressible smis.
- __ AssertSmiInRange(RAX);
- __ AssertSmiInRange(RCX);
// Both arguments are smi, '===' is good enough.
__ LoadObject(RAX, Bool::False());
__ ret();
@@ -609,21 +623,9 @@
// Left (receiver) is Smi, return false if right is not Double.
// Note that an instance of Mint or Bigint never contains a value that can be
// represented by Smi.
- __ AssertSmiInRange(RAX);
__ movq(RAX, Address(RSP, +kArgumentOffset * kWordSize));
__ CompareClassId(RAX, kDoubleCid);
__ j(EQUAL, &fall_through);
-#if defined(DEBUG)
- Label ok;
- __ CompareClassId(RAX, kMintCid);
- __ j(NOT_EQUAL, &ok);
- __ movq(RAX, FieldAddress(RAX, Mint::value_offset()));
- __ sarq(RCX, Immediate(1));
- __ cmpq(RAX, RCX);
- __ j(NOT_EQUAL, &ok);
- __ Stop("Smi wrapped in a Mint");
- __ Bind(&ok);
-#endif
__ LoadObject(RAX, Bool::False());
__ ret();
@@ -635,7 +637,6 @@
__ movq(RAX, Address(RSP, +kArgumentOffset * kWordSize));
__ testq(RAX, Immediate(kSmiTagMask));
__ j(NOT_ZERO, &fall_through);
- __ AssertSmiInRange(RAX);
// Smi == Mint -> false.
__ LoadObject(RAX, Bool::False());
__ ret();
@@ -665,7 +666,6 @@
__ Bind(&shift_count_ok);
__ movq(RCX, RAX); // Shift amount must be in RCX.
__ movq(RAX, Address(RSP, +2 * kWordSize)); // Value.
- __ AssertSmiInRange(RAX);
__ SmiUntag(RAX); // Value.
__ sarq(RAX, RCX);
__ SmiTag(RAX);
@@ -676,7 +676,6 @@
// Argument is Smi (receiver).
void Intrinsifier::Smi_bitNegate(Assembler* assembler) {
__ movq(RAX, Address(RSP, +1 * kWordSize)); // Index.
- __ AssertSmiInRange(RAX);
__ notq(RAX);
__ andq(RAX, Immediate(~kSmiTagMask)); // Remove inverted smi-tag.
__ ret();
@@ -685,7 +684,6 @@
void Intrinsifier::Smi_bitLength(Assembler* assembler) {
ASSERT(kSmiTagShift == 1);
__ movq(RAX, Address(RSP, +1 * kWordSize)); // Index.
- __ AssertSmiInRange(RAX);
// XOR with sign bit to complement bits if value is negative.
__ movq(RCX, RAX);
__ sarq(RCX, Immediate(63)); // All 0 or all 1.
@@ -711,7 +709,6 @@
__ subq(R8, Immediate(2)); // x_used > 0, Smi. R8 = x_used - 1, round up.
__ sarq(R8, Immediate(2)); // R8 + 1 = number of digit pairs to read.
__ movq(RCX, Address(RSP, 2 * kWordSize)); // n is Smi
- __ AssertSmiInRange(RCX);
__ SmiUntag(RCX);
__ movq(RBX, Address(RSP, 1 * kWordSize)); // r_digits
__ movq(RSI, RCX);
@@ -747,7 +744,6 @@
__ movq(RDI, Address(RSP, 4 * kWordSize)); // x_digits
__ movq(RCX, Address(RSP, 2 * kWordSize)); // n is Smi
- __ AssertSmiInRange(RCX);
__ SmiUntag(RCX);
__ movq(RBX, Address(RSP, 1 * kWordSize)); // r_digits
__ movq(RDX, RCX);
@@ -1235,7 +1231,6 @@
__ LoadObject(RAX, Bool::True());
__ ret();
__ Bind(&is_smi);
- __ AssertSmiInRange(RAX);
__ SmiUntag(RAX);
__ cvtsi2sdq(XMM1, RAX);
__ jmp(&double_op);
@@ -1296,7 +1291,6 @@
__ movsd(FieldAddress(RAX, Double::value_offset()), XMM0);
__ ret();
__ Bind(&is_smi);
- __ AssertSmiInRange(RAX);
__ SmiUntag(RAX);
__ cvtsi2sdq(XMM1, RAX);
__ jmp(&double_op);
@@ -1326,7 +1320,6 @@
__ testq(RAX, Immediate(kSmiTagMask));
__ j(NOT_ZERO, &fall_through);
// Is Smi.
- __ AssertSmiInRange(RAX);
__ SmiUntag(RAX);
__ cvtsi2sdq(XMM1, RAX);
__ movq(RAX, Address(RSP, +2 * kWordSize));
@@ -1349,7 +1342,6 @@
__ testq(RAX, Immediate(kSmiTagMask));
__ j(NOT_ZERO, &fall_through);
// Is Smi.
- __ AssertSmiInRange(RAX);
__ SmiUntag(RAX);
__ cvtsi2sdq(XMM0, RAX);
const Class& double_class =
@@ -1420,15 +1412,14 @@
void Intrinsifier::DoubleToInteger(Assembler* assembler) {
__ movq(RAX, Address(RSP, +1 * kWordSize));
__ movsd(XMM0, FieldAddress(RAX, Double::value_offset()));
- __ cvttsd2sil(RAX, XMM0);
+ __ cvttsd2siq(RAX, XMM0);
// Overflow is signalled with minint.
Label fall_through;
// Check for overflow and that it fits into Smi.
__ movq(RCX, RAX);
- __ shll(RCX, Immediate(1));
+ __ shlq(RCX, Immediate(1));
__ j(OVERFLOW, &fall_through, Assembler::kNearJump);
- ASSERT(kSmiTagShift == 1 && kSmiTag == 0);
- __ movsxd(RAX, RCX);
+ __ SmiTag(RAX);
__ ret();
__ Bind(&fall_through);
}
@@ -1440,17 +1431,16 @@
// back to a double in XMM1.
__ movq(RCX, Address(RSP, +1 * kWordSize));
__ movsd(XMM0, FieldAddress(RCX, Double::value_offset()));
- __ cvttsd2sil(RAX, XMM0);
- __ cvtsi2sdl(XMM1, RAX);
+ __ cvttsd2siq(RAX, XMM0);
+ __ cvtsi2sdq(XMM1, RAX);
// Tag the int as a Smi, making sure that it fits; this checks for
// overflow and NaN in the conversion from double to int. Conversion
- // overflow from cvttsd2sil is signalled with an INT32_MIN value.
+ // overflow from cvttsd2si is signalled with an INT64_MIN value.
Label fall_through;
ASSERT(kSmiTag == 0 && kSmiTagShift == 1);
- __ addl(RAX, RAX);
+ __ addq(RAX, RAX);
__ j(OVERFLOW, &fall_through, Assembler::kNearJump);
- __ movsxd(RAX, RAX);
// Compare the two double values. If they are equal, we return the
// Smi tagged result immediately as the hash code.
@@ -1488,7 +1478,6 @@
__ movsd(FieldAddress(RAX, Double::value_offset()), XMM0);
__ ret();
__ Bind(&is_smi);
- __ AssertSmiInRange(RAX);
__ SmiUntag(RAX);
__ cvtsi2sdq(XMM1, RAX);
__ jmp(&double_op);
diff --git a/runtime/vm/compiler_stats.h b/runtime/vm/compiler_stats.h
index 412cb61..4a7d49f 100644
--- a/runtime/vm/compiler_stats.h
+++ b/runtime/vm/compiler_stats.h
@@ -78,27 +78,27 @@
Timer graphcompiler_timer; // Included in codegen_timer.
Timer codefinalizer_timer; // Included in codegen_timer.
- int64_t num_tokens_total; // Isolate + VM isolate
- int64_t num_tokens_scanned;
- int64_t num_tokens_consumed;
- int64_t num_cached_consts;
- int64_t num_const_cache_hits;
- int64_t num_execute_const;
+ ALIGN8 int64_t num_tokens_total; // Isolate + VM isolate
+ ALIGN8 int64_t num_tokens_scanned;
+ ALIGN8 int64_t num_tokens_consumed;
+ ALIGN8 int64_t num_cached_consts;
+ ALIGN8 int64_t num_const_cache_hits;
+ ALIGN8 int64_t num_execute_const;
- int64_t num_classes_parsed;
- int64_t num_class_tokens;
- int64_t num_functions_parsed; // Num parsed functions.
- int64_t num_functions_compiled; // Num unoptimized compilations.
- int64_t num_functions_optimized; // Num optimized compilations.
- int64_t num_func_tokens_compiled;
- int64_t num_implicit_final_getters;
- int64_t num_method_extractors;
+ ALIGN8 int64_t num_classes_parsed;
+ ALIGN8 int64_t num_class_tokens;
+ ALIGN8 int64_t num_functions_parsed; // Num parsed functions.
+ ALIGN8 int64_t num_functions_compiled; // Num unoptimized compilations.
+ ALIGN8 int64_t num_functions_optimized; // Num optimized compilations.
+ ALIGN8 int64_t num_func_tokens_compiled;
+ ALIGN8 int64_t num_implicit_final_getters;
+ ALIGN8 int64_t num_method_extractors;
- int64_t src_length; // Total number of characters in source.
- int64_t total_code_size; // Bytes allocated for code and meta info.
- int64_t total_instr_size; // Total size of generated code in bytes.
- int64_t pc_desc_size;
- int64_t vardesc_size;
+ ALIGN8 int64_t src_length; // Total number of characters in source.
+ ALIGN8 int64_t total_code_size; // Bytes allocated for code and meta info.
+ ALIGN8 int64_t total_instr_size; // Total size of generated code in bytes.
+ ALIGN8 int64_t pc_desc_size;
+ ALIGN8 int64_t vardesc_size;
char* text;
bool use_benchmark_output;
diff --git a/runtime/vm/constants_arm64.h b/runtime/vm/constants_arm64.h
index cbf0db4..95b3f87 100644
--- a/runtime/vm/constants_arm64.h
+++ b/runtime/vm/constants_arm64.h
@@ -708,14 +708,14 @@
enum Extend {
kNoExtend = -1,
- UXTB = 0, // Zero extend byte.
- UXTH = 1, // Zero extend halfword (16 bits).
- UXTW = 2, // Zero extend word (32 bits).
- UXTX = 3, // Zero extend doubleword (64 bits).
- SXTB = 4, // Sign extend byte.
- SXTH = 5, // Sign extend halfword (16 bits).
- SXTW = 6, // Sign extend word (32 bits).
- SXTX = 7, // Sign extend doubleword (64 bits).
+ UXTB = 0,
+ UXTH = 1,
+ UXTW = 2,
+ UXTX = 3,
+ SXTB = 4,
+ SXTH = 5,
+ SXTW = 6,
+ SXTX = 7,
kMaxExtend = 8,
};
diff --git a/runtime/vm/dart_api_impl_test.cc b/runtime/vm/dart_api_impl_test.cc
index 6cc86f0..5370e37 100644
--- a/runtime/vm/dart_api_impl_test.cc
+++ b/runtime/vm/dart_api_impl_test.cc
@@ -6579,6 +6579,12 @@
int sourcefiles_count = sizeof(sourcefiles) / sizeof(Dart_SourceFile);
lib = TestCase::LoadTestScriptWithDFE(sourcefiles_count, sourcefiles, NULL,
true);
+ if (TestCase::UsingStrongMode()) {
+ EXPECT_ERROR(lib,
+ "Compilation failed file:///test-lib:4:10:"
+ " Error: Setter not found: 'foo'");
+ return;
+ }
EXPECT_VALID(lib);
} else {
Dart_Handle url = NewString(TestCase::url());
diff --git a/runtime/vm/globals.h b/runtime/vm/globals.h
index c15516d..4fa43f2 100644
--- a/runtime/vm/globals.h
+++ b/runtime/vm/globals.h
@@ -21,8 +21,9 @@
#undef OVERFLOW // From math.h conflicts in constants_ia32.h
namespace dart {
-// Smi value range is from -(2^N) to (2^N)-1. N=30
-const intptr_t kSmiBits = 30;
+// Smi value range is from -(2^N) to (2^N)-1.
+// N=30 (32-bit build) or N=62 (64-bit build).
+const intptr_t kSmiBits = kBitsPerWord - 2;
const intptr_t kSmiMax = (static_cast<intptr_t>(1) << kSmiBits) - 1;
const intptr_t kSmiMin = -(static_cast<intptr_t>(1) << kSmiBits);
diff --git a/runtime/vm/isolate_reload_test.cc b/runtime/vm/isolate_reload_test.cc
index d8e1d5d..1362438 100644
--- a/runtime/vm/isolate_reload_test.cc
+++ b/runtime/vm/isolate_reload_test.cc
@@ -2782,6 +2782,39 @@
EXPECT_STREQ("Instance of 'A' Instance of 'B'", SimpleInvokeStr(lib, "main"));
}
+// Tests reload fails when type arguments change.
+// Change: Baz extends Foo<String> -> Baz extends Bar<String, double>
+// Validate: the right error message is returned.
+TEST_CASE(IsolateReload_ChangeInstanceFormat9) {
+ const char* kScript =
+ "class Foo<A> {\n"
+ " var a;\n"
+ "}\n"
+ "class Bar<B, C> extends Foo<B> {}\n"
+ "class Baz extends Foo<String> {}"
+ "main() {\n"
+ " new Baz();\n"
+ " return 43;\n"
+ "}\n";
+
+ Dart_Handle lib = TestCase::LoadTestScript(kScript, NULL);
+ EXPECT_VALID(lib);
+ EXPECT_EQ(43, SimpleInvoke(lib, "main"));
+
+ const char* kReloadScript =
+ "class Foo<A> {\n"
+ " var a;\n"
+ "}\n"
+ "class Bar<B, C> extends Foo<B> {}\n"
+ "class Baz extends Bar<String, double> {}"
+ "main() {\n"
+ " new Baz();\n"
+ " return 43;\n"
+ "}\n";
+ lib = TestCase::ReloadTestScript(kReloadScript);
+ EXPECT_ERROR(lib, "type parameters have changed");
+}
+
TEST_CASE(IsolateReload_ShapeChangeRetainsHash) {
const char* kScript =
"class A{\n"
diff --git a/runtime/vm/kernel_binary.h b/runtime/vm/kernel_binary.h
index 1106d45..daee540 100644
--- a/runtime/vm/kernel_binary.h
+++ b/runtime/vm/kernel_binary.h
@@ -213,6 +213,14 @@
return value;
}
+ double ReadDouble() {
+ ASSERT((size_ >= 8) && (offset_ >= 0) && (offset_ <= size_ - 8));
+ double value = ReadUnaligned(
+ reinterpret_cast<const double*>(&this->buffer()[offset_]));
+ offset_ += 8;
+ return value;
+ }
+
uint32_t ReadUInt() {
ASSERT((size_ >= 1) && (offset_ >= 0) && (offset_ <= size_ - 1));
diff --git a/runtime/vm/kernel_loader.cc b/runtime/vm/kernel_loader.cc
index 4b83212..6a3358c 100644
--- a/runtime/vm/kernel_loader.cc
+++ b/runtime/vm/kernel_loader.cc
@@ -82,8 +82,7 @@
return true;
case kDoubleLiteral:
simple_value_ = &Double::ZoneHandle(
- Z, Double::New(H.DartString(builder_->ReadStringReference()),
- Heap::kOld)); // read string reference.
+ Z, Double::New(builder_->ReadDouble(), Heap::kOld)); // read value.
*simple_value_ = H.Canonicalize(*simple_value_);
return true;
case kTrueLiteral:
diff --git a/runtime/vm/object.cc b/runtime/vm/object.cc
index 7c31cf4..1e84c31 100644
--- a/runtime/vm/object.cc
+++ b/runtime/vm/object.cc
@@ -135,12 +135,10 @@
Array* Object::vm_isolate_snapshot_object_table_ = NULL;
Type* Object::dynamic_type_ = NULL;
Type* Object::void_type_ = NULL;
-Type* Object::vector_type_ = NULL;
RawObject* Object::null_ = reinterpret_cast<RawObject*>(RAW_NULL);
RawClass* Object::class_class_ = reinterpret_cast<RawClass*>(RAW_NULL);
RawClass* Object::dynamic_class_ = reinterpret_cast<RawClass*>(RAW_NULL);
-RawClass* Object::vector_class_ = reinterpret_cast<RawClass*>(RAW_NULL);
RawClass* Object::void_class_ = reinterpret_cast<RawClass*>(RAW_NULL);
RawClass* Object::unresolved_class_class_ =
reinterpret_cast<RawClass*>(RAW_NULL);
@@ -531,7 +529,6 @@
vm_isolate_snapshot_object_table_ = Array::ReadOnlyHandle();
dynamic_type_ = Type::ReadOnlyHandle();
void_type_ = Type::ReadOnlyHandle();
- vector_type_ = Type::ReadOnlyHandle();
*null_object_ = Object::null();
*null_array_ = Array::null();
@@ -884,14 +881,6 @@
cls.set_is_cycle_free();
void_class_ = cls.raw();
- cls = Class::New<Instance>(kVectorCid);
- cls.set_num_type_arguments(0);
- cls.set_num_own_type_arguments(0);
- cls.set_is_finalized();
- cls.set_is_type_finalized();
- cls.set_is_cycle_free();
- vector_class_ = cls.raw();
-
cls = Class::New<Type>();
cls.set_is_finalized();
cls.set_is_type_finalized();
@@ -903,9 +892,6 @@
cls = void_class_;
*void_type_ = Type::NewNonParameterizedType(cls);
- cls = vector_class_;
- *vector_type_ = Type::NewNonParameterizedType(cls);
-
// Since TypeArguments objects are passed as function arguments, make them
// behave as Dart instances, although they are just VM objects.
// Note that we cannot set the super type to ObjectType, which does not live
@@ -1007,7 +993,7 @@
void Object::FinishInitOnce(Isolate* isolate) {
// The type testing stubs we initialize in AbstractType objects for the
- // canonical type of kDynamicCid/kVoidCid/kVectorCid need to be set in this
+ // canonical type of kDynamicCid/kVoidCid need to be set in this
// method, which is called after StubCode::InitOnce().
Instructions& instr = Instructions::Handle();
@@ -1016,9 +1002,6 @@
instr = TypeTestingStubGenerator::DefaultCodeForType(*void_type_);
void_type_->SetTypeTestingStub(instr);
-
- instr = TypeTestingStubGenerator::DefaultCodeForType(*vector_type_);
- vector_type_->SetTypeTestingStub(instr);
}
// An object visitor which will mark all visited objects. This is used to
@@ -4858,21 +4841,20 @@
RawTypeArguments* TypeArguments::Prepend(Zone* zone,
const TypeArguments& other,
+ intptr_t other_length,
intptr_t total_length) const {
if (IsNull() && other.IsNull()) {
- return Object::null_type_arguments().raw();
+ return TypeArguments::null();
}
const TypeArguments& result =
TypeArguments::Handle(zone, TypeArguments::New(total_length, Heap::kNew));
AbstractType& type = AbstractType::Handle(zone);
- const intptr_t split =
- other.IsNull() ? total_length - Length() : other.Length();
- for (intptr_t i = 0; i < split; i++) {
+ for (intptr_t i = 0; i < other_length; i++) {
type = other.IsNull() ? Type::DynamicType() : other.TypeAt(i);
result.SetTypeAt(i, type);
}
- for (intptr_t i = split; i < total_length; i++) {
- type = IsNull() ? Type::DynamicType() : TypeAt(i - split);
+ for (intptr_t i = other_length; i < total_length; i++) {
+ type = IsNull() ? Type::DynamicType() : TypeAt(i - other_length);
result.SetTypeAt(i, type);
}
return result.Canonicalize();
@@ -5698,7 +5680,7 @@
}
RawContextScope* Function::context_scope() const {
- if (IsClosureFunction() || IsConvertedClosureFunction()) {
+ if (IsClosureFunction()) {
const Object& obj = Object::Handle(raw_ptr()->data_);
ASSERT(!obj.IsNull());
return ClosureData::Cast(obj).context_scope();
@@ -5707,7 +5689,7 @@
}
void Function::set_context_scope(const ContextScope& value) const {
- if (IsClosureFunction() || IsConvertedClosureFunction()) {
+ if (IsClosureFunction()) {
const Object& obj = Object::Handle(raw_ptr()->data_);
ASSERT(!obj.IsNull());
ClosureData::Cast(obj).set_context_scope(value);
@@ -5799,11 +5781,10 @@
}
RawFunction* Function::parent_function() const {
- if (IsClosureFunction() || IsConvertedClosureFunction() ||
- IsSignatureFunction()) {
+ if (IsClosureFunction() || IsSignatureFunction()) {
const Object& obj = Object::Handle(raw_ptr()->data_);
ASSERT(!obj.IsNull());
- if (IsClosureFunction() || IsConvertedClosureFunction()) {
+ if (IsClosureFunction()) {
return ClosureData::Cast(obj).parent_function();
} else {
return SignatureData::Cast(obj).parent_function();
@@ -5815,7 +5796,7 @@
void Function::set_parent_function(const Function& value) const {
const Object& obj = Object::Handle(raw_ptr()->data_);
ASSERT(!obj.IsNull());
- if (IsClosureFunction() || IsConvertedClosureFunction()) {
+ if (IsClosureFunction()) {
ClosureData::Cast(obj).set_parent_function(value);
} else {
ASSERT(IsSignatureFunction());
@@ -5828,8 +5809,6 @@
// The parent function of an implicit closure function is not the enclosing
// function we are asking about here.
return false;
- } else if (IsConvertedClosureFunction()) {
- return NumParentTypeParameters() > 0;
}
Function& parent = Function::Handle(parent_function());
while (!parent.IsNull()) {
@@ -5842,8 +5821,7 @@
}
RawFunction* Function::implicit_closure_function() const {
- if (IsClosureFunction() || IsConvertedClosureFunction() ||
- IsSignatureFunction() || IsFactory()) {
+ if (IsClosureFunction() || IsSignatureFunction() || IsFactory()) {
return Function::null();
}
const Object& obj = Object::Handle(raw_ptr()->data_);
@@ -5861,8 +5839,7 @@
}
void Function::set_implicit_closure_function(const Function& value) const {
- ASSERT(!IsClosureFunction() && !IsSignatureFunction() &&
- !IsConvertedClosureFunction());
+ ASSERT(!IsClosureFunction() && !IsSignatureFunction());
const Object& old_data = Object::Handle(raw_ptr()->data_);
if (is_native()) {
ASSERT(old_data.IsArray());
@@ -5880,31 +5857,13 @@
}
}
-RawFunction* Function::converted_closure_function() const {
- if (IsClosureFunction() || IsSignatureFunction() || IsFactory()) {
- return Function::null();
- }
- const Object& obj = Object::Handle(raw_ptr()->data_);
- ASSERT(obj.IsNull() || obj.IsFunction());
- if (obj.IsFunction()) {
- return Function::Cast(obj).raw();
- }
- return Function::null();
-}
-
-void Function::set_converted_closure_function(const Function& value) const {
- ASSERT(!IsClosureFunction() && !IsSignatureFunction() && !is_native());
- ASSERT((raw_ptr()->data_ == Object::null()) || value.IsNull());
- set_data(value);
-}
-
RawType* Function::ExistingSignatureType() const {
const Object& obj = Object::Handle(raw_ptr()->data_);
ASSERT(!obj.IsNull());
if (IsSignatureFunction()) {
return SignatureData::Cast(obj).signature_type();
} else {
- ASSERT(IsClosureFunction() || IsConvertedClosureFunction());
+ ASSERT(IsClosureFunction());
return ClosureData::Cast(obj).signature_type();
}
}
@@ -5957,7 +5916,7 @@
SignatureData::Cast(obj).set_signature_type(value);
ASSERT(!value.IsCanonical() || (value.signature() == this->raw()));
} else {
- ASSERT(IsClosureFunction() || IsConvertedClosureFunction());
+ ASSERT(IsClosureFunction());
ClosureData::Cast(obj).set_signature_type(value);
}
}
@@ -5989,9 +5948,6 @@
case RawFunction::kImplicitClosureFunction:
return "ImplicitClosureFunction";
break;
- case RawFunction::kConvertedClosureFunction:
- return "ConvertedClosureFunction";
- break;
case RawFunction::kSignatureFunction:
return "SignatureFunction";
break;
@@ -6237,8 +6193,6 @@
intptr_t Function::NumParentTypeParameters() const {
if (IsImplicitClosureFunction()) {
return 0;
- } else if (IsConvertedClosureFunction()) {
- return num_parent_type_parameters();
}
Thread* thread = Thread::Current();
Function& parent = Function::Handle(parent_function());
@@ -6411,8 +6365,7 @@
}
if ((k == RawFunction::kClosureFunction) ||
(k == RawFunction::kImplicitClosureFunction) ||
- (k == RawFunction::kSignatureFunction) ||
- (k == RawFunction::kConvertedClosureFunction)) {
+ (k == RawFunction::kSignatureFunction)) {
return 1; // Closure object.
}
if (!is_static()) {
@@ -7076,8 +7029,7 @@
result.SetInstructionsSafe(
Code::Handle(StubCode::LazyCompile_entry()->code()));
if (kind == RawFunction::kClosureFunction ||
- kind == RawFunction::kImplicitClosureFunction ||
- kind == RawFunction::kConvertedClosureFunction) {
+ kind == RawFunction::kImplicitClosureFunction) {
ASSERT(space == Heap::kOld);
const ClosureData& data = ClosureData::Handle(ClosureData::New());
result.set_data(data);
@@ -7149,12 +7101,8 @@
const Function& parent,
TokenPosition token_pos) {
ASSERT((kind == RawFunction::kClosureFunction) ||
- (kind == RawFunction::kImplicitClosureFunction) ||
- (kind == RawFunction::kConvertedClosureFunction));
+ (kind == RawFunction::kImplicitClosureFunction));
ASSERT(!parent.IsNull());
- // Only static top-level functions are allowed to be converted right now.
- ASSERT((kind != RawFunction::kConvertedClosureFunction) ||
- parent.is_static());
// Use the owner defining the parent function and not the class containing it.
const Object& parent_owner = Object::Handle(parent.raw_ptr()->owner_);
ASSERT(!parent_owner.IsNull());
@@ -7183,13 +7131,6 @@
parent, token_pos);
}
-RawFunction* Function::NewConvertedClosureFunction(const String& name,
- const Function& parent,
- TokenPosition token_pos) {
- return NewClosureFunctionWithKind(RawFunction::kConvertedClosureFunction,
- name, parent, token_pos);
-}
-
RawFunction* Function::NewSignatureFunction(const Object& owner,
const Function& parent,
TokenPosition token_pos,
@@ -7368,202 +7309,6 @@
}
}
-// Converted closure functions represent a pair of a top-level function and a
-// vector of captured variables. When being invoked, converted closure
-// functions get the vector as the first argument, and the arguments supplied at
-// the invocation are passed as the remaining arguments to that function.
-//
-// Consider the following example in Kernel:
-//
-// static method foo(core::int start) → core::Function {
-// core::int i = 0;
-// return () → dynamic => start.+(
-// let final dynamic #t1 = i in
-// let final dynamic #t2 = i = #t1.+(1) in
-// #t1
-// );
-// }
-//
-// The method [foo] above produces a closure as a result. The closure captures
-// two variables: function parameter [start] and local variable [i]. Here is
-// how this code would look like after closure conversion:
-//
-// static method foo(core::int start) → core::Function {
-// final Vector #context = MakeVector(3);
-// #context[1] = start;
-// #context[2] = 0;
-// return MakeClosure<() → dynamic>(com::closure#foo#function, #context);
-// }
-// static method closure#foo#function(Vector #contextParameter) → dynamic {
-// return (#contextParameter[1]).+(
-// let final dynamic #t1 = #contextParameter[2] in
-// let final dynamic #t2 = #contextParameter[2] = #t1.+(1) in
-// #t1
-// );
-// }
-//
-// Converted closure functions are used in VM Closure instances that represent
-// the results of evaluation of [MakeClosure] primitive operations.
-//
-// Internally, converted closure functions are represented with the same Closure
-// class as implicit closure functions (that are used for dealing with
-// tear-offs). The Closure class instances have two fields, one for the
-// function, and one for the captured context. Implicit closure functions have
-// pre-defined shape of the context: it's a single variable that is used as
-// 'this'. Converted closure functions use the context field to store the
-// vector of captured variables that will be supplied as the first argument
-// during invocation.
-//
-// The top-level functions used in converted closure functions are generated
-// during a front-end transformation in Kernel. Those functions have some
-// common properties:
-// * they expect the captured context to be passed as the first argument,
-// * the first argument should be of [Vector] type (index-based storage),
-// * they retrieve the captured variables from [Vector] explicitly, so they
-// don't need the variables from the context to be put into their current
-// scope.
-//
-// During closure-conversion pass in Kernel, the contexts are generated
-// explicitly and are represented as [Vector]s. Then they are paired together
-// with the top-level functions to form a closure. When the closure, created
-// this way, is invoked, it should receive the [Vector] as the first argument,
-// and take the rest of the arguments from the invocation.
-//
-// Converted closure functions in VM follow same discipline as implicit closure
-// functions, because they are similar in many ways. For further details, please
-// refer to the following methods:
-// -> Function::ConvertedClosureFunction
-// -> StreamingFlowGraphBuilder::BuildGraphOfConvertedClosureFunction
-// -> StreamingFlowGraphBuilder::BuildGraph (small change that calls
-// BuildGraphOfConvertedClosureFunction)
-// -> StreamingFlowGraphBuilder::BuildClosureCreation (converted closure
-// functions are created here)
-//
-// Function::ConvertedClosureFunction method follows the logic of
-// Function::ImplicitClosureFunction method.
-RawFunction* Function::ConvertedClosureFunction(
- intptr_t num_parent_type_parameters) const {
- // Return the existing converted closure function if any.
- if (converted_closure_function() != Function::null()) {
- return converted_closure_function();
- }
- ASSERT(!IsSignatureFunction() && !IsClosureFunction());
- Thread* thread = Thread::Current();
- Zone* zone = thread->zone();
- // Create closure function.
- const String& closure_name = String::Handle(zone, name());
- const Function& closure_function = Function::Handle(
- zone, NewConvertedClosureFunction(closure_name, *this, token_pos()));
-
- // Currently only static top-level functions are allowed to be converted.
- ASSERT(is_static());
- closure_function.set_context_scope(Object::empty_context_scope());
-
- // Set closure function's type parameters.
- {
- TypeArguments& total_type_parameters =
- TypeArguments::Handle(type_parameters());
-
- intptr_t num_type_parameters =
- total_type_parameters.Length() - num_parent_type_parameters;
- if (num_type_parameters == 0) {
- closure_function.set_type_parameters(Object::null_type_arguments());
- } else {
- ASSERT(num_type_parameters > 0);
- TypeArguments& new_type_parameters =
- TypeArguments::Handle(TypeArguments::New(num_type_parameters));
-
- for (intptr_t i = 0; i < num_type_parameters; ++i) {
- new_type_parameters.SetTypeAt(
- i, AbstractType::Handle(total_type_parameters.TypeAt(
- i + num_parent_type_parameters)));
- }
- closure_function.set_type_parameters(new_type_parameters);
- }
- closure_function.set_num_parent_type_parameters(num_parent_type_parameters);
- }
-
- // Set closure function's result type to this result type.
- closure_function.set_result_type(AbstractType::Handle(zone, result_type()));
-
- // Set closure function's end token to this end token.
- closure_function.set_end_token_pos(end_token_pos());
-
- // Set closure function's formal parameters to this formal parameters,
- // removing the first parameter over which the currying is done, and adding
- // the closure class instance as the first parameter. So, the overall number
- // of fixed parameters doesn't change.
- const int num_fixed_params = num_fixed_parameters();
- const int num_opt_params = NumOptionalParameters();
- const bool has_opt_pos_params = HasOptionalPositionalParameters();
- const int num_params = num_fixed_params + num_opt_params;
-
- closure_function.set_num_fixed_parameters(num_fixed_params);
- closure_function.SetNumOptionalParameters(num_opt_params, has_opt_pos_params);
- closure_function.set_parameter_types(
- Array::Handle(zone, Array::New(num_params, Heap::kOld)));
- closure_function.set_parameter_names(
- Array::Handle(zone, Array::New(num_params, Heap::kOld)));
-
- AbstractType& param_type = AbstractType::Handle(zone);
- String& param_name = String::Handle(zone);
-
- // Add implicit closure object as the first parameter.
- param_type = Type::DynamicType();
- closure_function.SetParameterTypeAt(0, param_type);
- closure_function.SetParameterNameAt(0, Symbols::ClosureParameter());
-
- // All the parameters, but the first one, are the same for the top-level
- // function being converted, and the method of the closure class that is being
- // generated.
- for (int i = 1; i < num_params; i++) {
- param_type = ParameterTypeAt(i);
- closure_function.SetParameterTypeAt(i, param_type);
- param_name = ParameterNameAt(i);
- closure_function.SetParameterNameAt(i, param_name);
- }
- closure_function.set_kernel_offset(kernel_offset());
-
- const Type& signature_type =
- Type::Handle(zone, closure_function.SignatureType());
- if (!signature_type.IsFinalized()) {
- ClassFinalizer::FinalizeType(Class::Handle(zone, Owner()), signature_type);
- }
-
- set_converted_closure_function(closure_function);
-
- return closure_function.raw();
-}
-
-void Function::DropUncompiledConvertedClosureFunction() const {
- if (converted_closure_function() != Function::null()) {
- const Function& func = Function::Handle(converted_closure_function());
- if (!func.HasCode()) {
- set_converted_closure_function(Function::Handle());
- }
- }
-}
-
-void Function::set_num_parent_type_parameters(intptr_t num) const {
- if (IsConvertedClosureFunction()) {
- const Object& obj = Object::Handle(raw_ptr()->data_);
- ASSERT(!obj.IsNull());
- ClosureData::Cast(obj).set_num_parent_type_parameters(num);
- return;
- }
- UNREACHABLE();
-}
-
-intptr_t Function::num_parent_type_parameters() const {
- if (IsConvertedClosureFunction()) {
- const Object& obj = Object::Handle(raw_ptr()->data_);
- ASSERT(!obj.IsNull());
- return ClosureData::Cast(obj).num_parent_type_parameters();
- }
- UNREACHABLE();
- return 0;
-}
-
void Function::BuildSignatureParameters(
Thread* thread,
Zone* zone,
@@ -7771,7 +7516,7 @@
return script.raw();
}
}
- if (IsClosureFunction() || IsConvertedClosureFunction()) {
+ if (IsClosureFunction()) {
return Function::Handle(parent_function()).script();
}
const Object& obj = Object::Handle(raw_ptr()->owner_);
@@ -8068,7 +7813,6 @@
case RawFunction::kRegularFunction:
case RawFunction::kClosureFunction:
case RawFunction::kImplicitClosureFunction:
- case RawFunction::kConvertedClosureFunction:
case RawFunction::kGetterFunction:
case RawFunction::kSetterFunction:
kind_str = "";
@@ -8109,14 +7853,6 @@
const_str);
}
-intptr_t ClosureData::num_parent_type_parameters() const {
- return Smi::Value(raw_ptr()->num_parent_type_parameters_);
-}
-
-void ClosureData::set_num_parent_type_parameters(intptr_t value) const {
- StorePointer(&raw_ptr()->num_parent_type_parameters_, Smi::New(value));
-}
-
void ClosureData::set_context_scope(const ContextScope& value) const {
StorePointer(&raw_ptr()->context_scope_, value.raw());
}
@@ -17073,8 +16809,7 @@
if (instr.IsNull()) {
// This only happens during bootstrapping when creating Type objects before
// we have the instructions.
- ASSERT(type_class_id() == kDynamicCid || type_class_id() == kVoidCid ||
- type_class_id() == kVectorCid);
+ ASSERT(type_class_id() == kDynamicCid || type_class_id() == kVoidCid);
StoreNonPointer(&raw_ptr()->type_test_stub_entry_point_, 0);
} else {
StoreNonPointer(&raw_ptr()->type_test_stub_entry_point_,
@@ -17749,10 +17484,6 @@
ASSERT(Object::dynamic_type().IsCanonical());
return Object::dynamic_type().raw();
}
- if ((type_class_id() == kVectorCid) && (isolate != Dart::vm_isolate())) {
- ASSERT(Object::vector_type().IsCanonical());
- return Object::vector_type().raw();
- }
const Class& cls = Class::Handle(zone, type_class());
@@ -22804,7 +22535,7 @@
if (delayed_type_args.raw() != Object::empty_type_arguments().raw()) {
num_free_params = kCurrentAndEnclosingFree;
fn_type_args = delayed_type_args.Prepend(
- zone, fn_type_args,
+ zone, fn_type_args, sig_fun.NumParentTypeParameters(),
sig_fun.NumTypeParameters() + sig_fun.NumParentTypeParameters());
} else {
num_free_params = kAllFree;
diff --git a/runtime/vm/object.h b/runtime/vm/object.h
index 60e0288..6a99622 100644
--- a/runtime/vm/object.h
+++ b/runtime/vm/object.h
@@ -498,10 +498,6 @@
ASSERT(void_type_ != NULL);
return *void_type_;
}
- static const Type& vector_type() {
- ASSERT(vector_type_ != NULL);
- return *vector_type_;
- }
static void set_vm_isolate_snapshot_object_table(const Array& table);
@@ -771,7 +767,6 @@
static RawClass* class_class_; // Class of the Class vm object.
static RawClass* dynamic_class_; // Class of the 'dynamic' type.
static RawClass* void_class_; // Class of the 'void' type.
- static RawClass* vector_class_; // Class of the 'vector' type.
static RawClass* unresolved_class_class_; // Class of UnresolvedClass.
static RawClass* type_arguments_class_; // Class of TypeArguments vm object.
static RawClass* patch_class_class_; // Class of the PatchClass vm object.
@@ -840,7 +835,6 @@
static Array* vm_isolate_snapshot_object_table_;
static Type* dynamic_type_;
static Type* void_type_;
- static Type* vector_type_;
friend void ClassTable::Register(const Class& cls);
friend void RawObject::Validate(Isolate* isolate) const;
@@ -2165,11 +2159,6 @@
RawArray* parameter_names() const { return raw_ptr()->parameter_names_; }
void set_parameter_names(const Array& value) const;
- // For converted closure functions: indicate how many type parameters on the
- // target are actually captured.
- void set_num_parent_type_parameters(intptr_t num) const;
- intptr_t num_parent_type_parameters() const;
-
// The type parameters (and their bounds) are specified as an array of
// TypeParameter.
RawTypeArguments* type_parameters() const {
@@ -2291,26 +2280,12 @@
return implicit_closure_function() != null();
}
- // Returns true iff a converted closure function has been created
- // for this function.
- bool HasConvertedClosureFunction() const {
- return converted_closure_function() != null();
- }
-
// Returns the closure function implicitly created for this function. If none
// exists yet, create one and remember it. Implicit closure functions are
// used in VM Closure instances that represent results of tear-off operations.
RawFunction* ImplicitClosureFunction() const;
void DropUncompiledImplicitClosureFunction() const;
- // Returns the converted closure function created for this function.
- // If none exists yet, create one and remember it. See the comment on
- // ConvertedClosureFunction definition in runtime/vm/object.cc for elaborate
- // explanation.
- RawFunction* ConvertedClosureFunction(
- intptr_t num_parent_type_parameters) const;
- void DropUncompiledConvertedClosureFunction() const;
-
// Return the closure implicitly created for this function.
// If none exists yet, create one and remember it.
RawInstance* ImplicitStaticClosure() const;
@@ -2640,11 +2615,6 @@
return kind() == RawFunction::kImplicitClosureFunction;
}
- // Returns true if this function represents a converted closure function.
- bool IsConvertedClosureFunction() const {
- return kind() == RawFunction::kConvertedClosureFunction;
- }
-
// Returns true if this function represents a non implicit closure function.
bool IsNonImplicitClosureFunction() const {
return IsClosureFunction() && !IsImplicitClosureFunction();
@@ -2731,8 +2701,7 @@
Heap::Space space = Heap::kOld);
// Allocates a new Function object representing a closure function
- // with given kind - kClosureFunction, kImplicitClosureFunction or
- // kConvertedClosureFunction.
+ // with given kind - kClosureFunction or kImplicitClosureFunction.
static RawFunction* NewClosureFunctionWithKind(RawFunction::Kind kind,
const String& name,
const Function& parent,
@@ -2748,11 +2717,6 @@
const Function& parent,
TokenPosition token_pos);
- // Allocates a new Function object representing a converted closure function.
- static RawFunction* NewConvertedClosureFunction(const String& name,
- const Function& parent,
- TokenPosition token_pos);
-
// Allocates a new Function object representing a signature function.
// The owner is the scope class of the function type.
// The parent is the enclosing function or null if none.
@@ -2927,8 +2891,6 @@
void set_owner(const Object& value) const;
RawFunction* implicit_closure_function() const;
void set_implicit_closure_function(const Function& value) const;
- RawFunction* converted_closure_function() const;
- void set_converted_closure_function(const Function& value) const;
RawInstance* implicit_static_closure() const;
void set_implicit_static_closure(const Instance& closure) const;
RawScript* eval_script() const;
@@ -2991,9 +2953,6 @@
RawInstance* implicit_static_closure() const { return raw_ptr()->closure_; }
void set_implicit_static_closure(const Instance& closure) const;
- intptr_t num_parent_type_parameters() const;
- void set_num_parent_type_parameters(intptr_t value) const;
-
static RawClosureData* New();
FINAL_HEAP_OBJECT_IMPLEMENTATION(ClosureData, Object);
@@ -5757,6 +5716,7 @@
RawTypeArguments* Prepend(Zone* zone,
const TypeArguments& other,
+ intptr_t other_length,
intptr_t total_length) const;
// Check if the subvector of length 'len' starting at 'from_index' of this
@@ -7913,16 +7873,7 @@
virtual uword ComputeCanonicalTableHash() const;
static const intptr_t kBytesPerElement = kWordSize;
- // The length field is a Smi so that sets one limit on the max Array length.
- // But we also need to be able to represent the length in bytes in an
- // intptr_t, which is a different limit. Either may be smaller. We can't
- // use Utils::Minimum here because it is not a const expression.
- static const intptr_t kElementLimitDueToIntptrMax = static_cast<intptr_t>(
- (kIntptrMax - sizeof(RawArray) - kObjectAlignment + kBytesPerElement) /
- kBytesPerElement);
- static const intptr_t kMaxElements = kSmiMax < kElementLimitDueToIntptrMax
- ? kSmiMax
- : kElementLimitDueToIntptrMax;
+ static const intptr_t kMaxElements = kSmiMax / kBytesPerElement;
static const intptr_t kMaxNewSpaceElements =
(Heap::kNewAllocatableSize - sizeof(RawArray)) / kBytesPerElement;
diff --git a/runtime/vm/object_test.cc b/runtime/vm/object_test.cc
index 17eadb0..4890d04 100644
--- a/runtime/vm/object_test.cc
+++ b/runtime/vm/object_test.cc
@@ -308,10 +308,16 @@
EXPECT(Smi::IsValid(-15));
EXPECT(Smi::IsValid(0xFFu));
// Upper two bits must be either 00 or 11.
+#if defined(ARCH_IS_64_BIT)
+ EXPECT(!Smi::IsValid(kMaxInt64));
+ EXPECT(Smi::IsValid(0x3FFFFFFFFFFFFFFF));
+ EXPECT(Smi::IsValid(-1));
+#else
EXPECT(!Smi::IsValid(kMaxInt32));
EXPECT(Smi::IsValid(0x3FFFFFFF));
EXPECT(Smi::IsValid(-1));
EXPECT(!Smi::IsValid(0xFFFFFFFFu));
+#endif
EXPECT_EQ(5, smi.AsInt64Value());
EXPECT_EQ(5.0, smi.AsDoubleValue());
@@ -439,6 +445,9 @@
}
ISOLATE_UNIT_TEST_CASE(Mint) {
+// On 64-bit architectures a Smi is stored in a 64 bit word. A Midint cannot
+// be allocated if it does fit into a Smi.
+#if !defined(ARCH_IS_64_BIT)
{
Mint& med = Mint::Handle();
EXPECT(med.IsNull());
@@ -508,6 +517,7 @@
EXPECT_EQ(mint1.value(), mint_value);
EXPECT_EQ(mint2.value(), mint_value);
EXPECT_EQ(mint1.raw(), mint2.raw());
+#endif
}
ISOLATE_UNIT_TEST_CASE(Double) {
@@ -2737,6 +2747,22 @@
EXPECT(Smi::Cast(result).Value() == kSmiTestValue);
}
+#if defined(ARCH_IS_64_BIT)
+// Test for Embedded Smi object in the instructions.
+ISOLATE_UNIT_TEST_CASE(EmbedSmiIn64BitCode) {
+ extern void GenerateEmbedSmiInCode(Assembler * assembler, intptr_t value);
+ const intptr_t kSmiTestValue = DART_INT64_C(5) << 32;
+ Assembler _assembler_;
+ GenerateEmbedSmiInCode(&_assembler_, kSmiTestValue);
+ const Function& function =
+ Function::Handle(CreateFunction("Test_EmbedSmiIn64BitCode"));
+ const Code& code = Code::Handle(Code::FinalizeCode(function, &_assembler_));
+ function.AttachCode(code);
+ const Object& result =
+ Object::Handle(DartEntry::InvokeFunction(function, Array::empty_array()));
+ EXPECT(Smi::Cast(result).Value() == kSmiTestValue);
+}
+#endif // ARCH_IS_64_BIT
ISOLATE_UNIT_TEST_CASE(ExceptionHandlers) {
const int kNumEntries = 4;
@@ -3268,9 +3294,9 @@
const char* lib_url =
isolate->use_dart_frontend() ? "file:///test-lib" : "test-lib";
- const size_t kExpectedLen = 512;
- char expected[kExpectedLen];
- snprintf(expected, kExpectedLen,
+ const size_t kBufferSize = 1024;
+ char expected[kBufferSize];
+ snprintf(expected, kBufferSize,
"Unhandled exception:\n"
"MyException\n"
"#0 baz (%1$s:2:3)\n"
diff --git a/runtime/vm/os.h b/runtime/vm/os.h
index 1fde4da..94bb98d 100644
--- a/runtime/vm/os.h
+++ b/runtime/vm/os.h
@@ -120,9 +120,9 @@
// Shut down the OS class.
static void Shutdown();
- static void Abort();
+ static DART_NORETURN void Abort();
- static void Exit(int code);
+ static DART_NORETURN void Exit(int code);
};
} // namespace dart
diff --git a/runtime/vm/parser.cc b/runtime/vm/parser.cc
index 129152f..29fb803 100644
--- a/runtime/vm/parser.cc
+++ b/runtime/vm/parser.cc
@@ -200,8 +200,7 @@
const bool load_optional_arguments = function.HasOptionalParameters();
- const bool check_arguments =
- (function_.IsClosureFunction() || function_.IsConvertedClosureFunction());
+ const bool check_arguments = function_.IsClosureFunction();
const bool need_argument_descriptor =
load_optional_arguments || check_arguments || reify_generic_argument;
diff --git a/runtime/vm/profiler.h b/runtime/vm/profiler.h
index 79d0c68..b657c8d 100644
--- a/runtime/vm/profiler.h
+++ b/runtime/vm/profiler.h
@@ -32,20 +32,20 @@
struct ProfilerCounters {
// Count of bail out reasons:
- int64_t bail_out_unknown_task;
- int64_t bail_out_jump_to_exception_handler;
- int64_t bail_out_check_isolate;
+ ALIGN8 int64_t bail_out_unknown_task;
+ ALIGN8 int64_t bail_out_jump_to_exception_handler;
+ ALIGN8 int64_t bail_out_check_isolate;
// Count of single frame sampling reasons:
- int64_t single_frame_sample_deoptimizing;
- int64_t single_frame_sample_register_check;
- int64_t single_frame_sample_get_and_validate_stack_bounds;
+ ALIGN8 int64_t single_frame_sample_deoptimizing;
+ ALIGN8 int64_t single_frame_sample_register_check;
+ ALIGN8 int64_t single_frame_sample_get_and_validate_stack_bounds;
// Count of stack walkers used:
- int64_t stack_walker_native;
- int64_t stack_walker_dart_exit;
- int64_t stack_walker_dart;
- int64_t stack_walker_none;
+ ALIGN8 int64_t stack_walker_native;
+ ALIGN8 int64_t stack_walker_dart_exit;
+ ALIGN8 int64_t stack_walker_dart;
+ ALIGN8 int64_t stack_walker_none;
// Count of failed checks:
- int64_t failure_native_allocation_sample;
+ ALIGN8 int64_t failure_native_allocation_sample;
};
class Profiler : public AllStatic {
diff --git a/runtime/vm/raw_object.h b/runtime/vm/raw_object.h
index 89875ca..e0128b1 100644
--- a/runtime/vm/raw_object.h
+++ b/runtime/vm/raw_object.h
@@ -188,12 +188,10 @@
kByteBufferCid,
// The following entries do not describe a predefined class, but instead
- // are class indexes for pre-allocated instances (Null, dynamic, Void and
- // Vector).
+ // are class indexes for pre-allocated instances (Null, dynamic and Void).
kNullCid,
kDynamicCid,
kVoidCid,
- kVectorCid,
kNumPredefinedCids,
};
@@ -399,7 +397,7 @@
UpdateTagBit<MarkBit>(false);
}
// Returns false if the bit was already set.
- // TODO(koda): Add "must use result" annotation here, after we add support.
+ DART_WARN_UNUSED_RESULT
bool TryAcquireMarkBit() { return TryAcquireTagBit<MarkBit>(); }
// Support for object tags.
@@ -426,7 +424,7 @@
ptr()->tags_ = RememberedBit::update(false, tags);
}
// Returns false if the bit was already set.
- // TODO(koda): Add "must use result" annotation here, after we add support.
+ DART_WARN_UNUSED_RESULT
bool TryAcquireRememberedBit() { return TryAcquireTagBit<RememberedBit>(); }
#define DEFINE_IS_CID(clazz) \
@@ -862,7 +860,6 @@
kRegularFunction,
kClosureFunction,
kImplicitClosureFunction,
- kConvertedClosureFunction,
kSignatureFunction, // represents a signature only without actual code.
kGetterFunction, // represents getter functions e.g: get foo() { .. }.
kSetterFunction, // represents setter functions e.g: set foo(..) { .. }.
@@ -987,8 +984,7 @@
RawFunction* parent_function_; // Enclosing function of this local function.
RawType* signature_type_;
RawInstance* closure_; // Closure object for static implicit closures.
- RawSmi* num_parent_type_parameters_; // For converted closures only
- VISIT_TO(RawObject*, num_parent_type_parameters_);
+ VISIT_TO(RawObject*, closure_);
friend class Function;
};
diff --git a/runtime/vm/regexp.cc b/runtime/vm/regexp.cc
index 3d23411..4d99e0f 100644
--- a/runtime/vm/regexp.cc
+++ b/runtime/vm/regexp.cc
@@ -3023,19 +3023,10 @@
Trace* current_trace,
PreloadState* state) {
if (state->eats_at_least_ == PreloadState::kEatsAtLeastNotYetInitialized) {
- // On ARM64, only read 16 bits ahead for now. This ensures that boxing is
- // trivial even with the new smaller Smis. See
- // https://github.com/dart-lang/sdk/issues/29951 and
- // LoadCodeUnitsInstr::EmitNativeCode.
-#if defined(TARGET_ARCH_ARM64)
- const int kMaxBytesLoaded = 2;
-#else
- const int kMaxBytesLoaded = 4;
-#endif
- const int kMaxTwoByteCharactersLoaded = kMaxBytesLoaded / 2;
- state->eats_at_least_ = EatsAtLeast(
- compiler->one_byte() ? kMaxBytesLoaded : kMaxTwoByteCharactersLoaded,
- kRecursionBudget, current_trace->at_start() == Trace::FALSE_VALUE);
+ // Save some time by looking at most one machine word ahead.
+ state->eats_at_least_ =
+ EatsAtLeast(compiler->one_byte() ? 4 : 2, kRecursionBudget,
+ current_trace->at_start() == Trace::FALSE_VALUE);
}
state->preload_characters_ =
CalculatePreloadCharacters(compiler, state->eats_at_least_);
diff --git a/runtime/vm/regexp_parser.cc b/runtime/vm/regexp_parser.cc
index 5d10d08..bd6b1e3 100644
--- a/runtime/vm/regexp_parser.cc
+++ b/runtime/vm/regexp_parser.cc
@@ -557,8 +557,8 @@
ReportError("Nothing to repeat");
UNREACHABLE();
}
- // fallthrough
}
+ /* Falls through */
default:
builder->AddCharacter(current());
Advance();
diff --git a/runtime/vm/simulator_arm64.cc b/runtime/vm/simulator_arm64.cc
index 926b75e..3db2d65 100644
--- a/runtime/vm/simulator_arm64.cc
+++ b/runtime/vm/simulator_arm64.cc
@@ -3199,21 +3199,13 @@
set_vregisterd(vd, 1, 0);
} else if (instr->Bits(16, 5) == 24) {
// Format(instr, "fcvtzds'sf 'rd, 'vn");
- const intptr_t max = instr->Bit(31) == 1 ? INT64_MAX : INT32_MAX;
- const intptr_t min = instr->Bit(31) == 1 ? INT64_MIN : INT32_MIN;
const double vn_val = bit_cast<double, int64_t>(get_vregisterd(vn, 0));
- int64_t result;
- if (vn_val >= static_cast<double>(max)) {
- result = max;
- } else if (vn_val <= static_cast<double>(min)) {
- result = min;
+ if (vn_val >= static_cast<double>(INT64_MAX)) {
+ set_register(instr, rd, INT64_MAX, instr->RdMode());
+ } else if (vn_val <= static_cast<double>(INT64_MIN)) {
+ set_register(instr, rd, INT64_MIN, instr->RdMode());
} else {
- result = static_cast<int64_t>(vn_val);
- }
- if (instr->Bit(31) == 1) {
- set_register(instr, rd, result, instr->RdMode());
- } else {
- set_register(instr, rd, result & 0xffffffffll, instr->RdMode());
+ set_register(instr, rd, static_cast<int64_t>(vn_val), instr->RdMode());
}
} else {
UnimplementedInstruction(instr);
diff --git a/runtime/vm/simulator_dbc.cc b/runtime/vm/simulator_dbc.cc
index c9906c3..487143f 100644
--- a/runtime/vm/simulator_dbc.cc
+++ b/runtime/vm/simulator_dbc.cc
@@ -636,11 +636,11 @@
// __builtin_s{add,sub,mul}_overflow() intrinsics here and below.
// Note that they may clobber the output location even when there is overflow:
// https://gcc.gnu.org/onlinedocs/gcc/Integer-Overflow-Builtins.html
-DART_FORCE_INLINE static bool SignedAddWithOverflow(int32_t lhs,
- int32_t rhs,
+DART_FORCE_INLINE static bool SignedAddWithOverflow(intptr_t lhs,
+ intptr_t rhs,
intptr_t* out) {
intptr_t res = 1;
-#if defined(HOST_ARCH_IA32)
+#if defined(HOST_ARCH_IA32) || defined(HOST_ARCH_X64)
asm volatile(
"add %2, %1\n"
"jo 1f;\n"
@@ -650,19 +650,7 @@
: "+r"(res), "+r"(lhs)
: "r"(rhs), "r"(out)
: "cc");
-#elif defined(HOST_ARCH_X64)
- int64_t tmp;
- asm volatile(
- "addl %[rhs], %[lhs]\n"
- "jo 1f;\n"
- "xor %[res], %[res]\n"
- "movslq %[lhs], %[tmp]\n"
- "mov %[tmp], 0(%[out])\n"
- "1: "
- : [res] "+r"(res), [lhs] "+r"(lhs), [tmp] "=&r"(tmp)
- : [rhs] "r"(rhs), [out] "r"(out)
- : "cc");
-#elif defined(HOST_ARCH_ARM)
+#elif defined(HOST_ARCH_ARM) || defined(HOST_ARCH_ARM64)
asm volatile(
"adds %1, %1, %2;\n"
"bvs 1f;\n"
@@ -672,28 +660,17 @@
: "+r"(res), "+r"(lhs)
: "r"(rhs), "r"(out)
: "cc");
-#elif defined(HOST_ARCH_ARM64)
- asm volatile(
- "adds %w1, %w1, %w2;\n"
- "bvs 1f;\n"
- "sxtw %x1, %w1;\n"
- "mov %0, #0;\n"
- "str %x1, [%3, #0]\n"
- "1:"
- : "+r"(res), "+r"(lhs)
- : "r"(rhs), "r"(out)
- : "cc");
#else
#error "Unsupported platform"
#endif
return (res != 0);
}
-DART_FORCE_INLINE static bool SignedSubWithOverflow(int32_t lhs,
- int32_t rhs,
+DART_FORCE_INLINE static bool SignedSubWithOverflow(intptr_t lhs,
+ intptr_t rhs,
intptr_t* out) {
intptr_t res = 1;
-#if defined(HOST_ARCH_IA32)
+#if defined(HOST_ARCH_IA32) || defined(HOST_ARCH_X64)
asm volatile(
"sub %2, %1\n"
"jo 1f;\n"
@@ -703,19 +680,7 @@
: "+r"(res), "+r"(lhs)
: "r"(rhs), "r"(out)
: "cc");
-#elif defined(HOST_ARCH_X64)
- int64_t tmp;
- asm volatile(
- "subl %[rhs], %[lhs]\n"
- "jo 1f;\n"
- "xor %[res], %[res]\n"
- "movslq %[lhs], %[tmp]\n"
- "mov %[tmp], 0(%[out])\n"
- "1: "
- : [res] "+r"(res), [lhs] "+r"(lhs), [tmp] "=&r"(tmp)
- : [rhs] "r"(rhs), [out] "r"(out)
- : "cc");
-#elif defined(HOST_ARCH_ARM)
+#elif defined(HOST_ARCH_ARM) || defined(HOST_ARCH_ARM64)
asm volatile(
"subs %1, %1, %2;\n"
"bvs 1f;\n"
@@ -725,28 +690,17 @@
: "+r"(res), "+r"(lhs)
: "r"(rhs), "r"(out)
: "cc");
-#elif defined(HOST_ARCH_ARM64)
- asm volatile(
- "subs %w1, %w1, %w2;\n"
- "bvs 1f;\n"
- "sxtw %x1, %w1;\n"
- "mov %0, #0;\n"
- "str %x1, [%3, #0]\n"
- "1:"
- : "+r"(res), "+r"(lhs)
- : "r"(rhs), "r"(out)
- : "cc");
#else
#error "Unsupported platform"
#endif
return (res != 0);
}
-DART_FORCE_INLINE static bool SignedMulWithOverflow(int32_t lhs,
- int32_t rhs,
+DART_FORCE_INLINE static bool SignedMulWithOverflow(intptr_t lhs,
+ intptr_t rhs,
intptr_t* out) {
intptr_t res = 1;
-#if defined(HOST_ARCH_IA32)
+#if defined(HOST_ARCH_IA32) || defined(HOST_ARCH_X64)
asm volatile(
"imul %2, %1\n"
"jo 1f;\n"
@@ -756,18 +710,6 @@
: "+r"(res), "+r"(lhs)
: "r"(rhs), "r"(out)
: "cc");
-#elif defined(HOST_ARCH_X64)
- int64_t tmp;
- asm volatile(
- "imull %[rhs], %[lhs]\n"
- "jo 1f;\n"
- "xor %[res], %[res]\n"
- "movslq %[lhs], %[tmp]\n"
- "mov %[tmp], 0(%[out])\n"
- "1: "
- : [res] "+r"(res), [lhs] "+r"(lhs), [tmp] "=&r"(tmp)
- : [rhs] "r"(rhs), [out] "r"(out)
- : "cc");
#elif defined(HOST_ARCH_ARM)
asm volatile(
"smull %1, ip, %1, %2;\n"
@@ -782,12 +724,12 @@
#elif defined(HOST_ARCH_ARM64)
int64_t prod_lo = 0;
asm volatile(
- "smull %x1, %w2, %w3\n"
- "asr %x2, %x1, #63\n"
- "cmp %x2, %x1, ASR #31;\n"
+ "mul %1, %2, %3\n"
+ "smulh %2, %2, %3\n"
+ "cmp %2, %1, ASR #63;\n"
"bne 1f;\n"
"mov %0, #0;\n"
- "str %x1, [%4, #0]\n"
+ "str %1, [%4, #0]\n"
"1:"
: "=r"(res), "+r"(prod_lo), "+r"(lhs)
: "r"(rhs), "r"(out)
@@ -2029,7 +1971,11 @@
if (rhs != 0) {
const intptr_t lhs = reinterpret_cast<intptr_t>(FP[rB]);
const intptr_t res = (lhs >> kSmiTagSize) / (rhs >> kSmiTagSize);
+#if defined(ARCH_IS_64_BIT)
+ const intptr_t untaggable = 0x4000000000000000LL;
+#else
const intptr_t untaggable = 0x40000000L;
+#endif // defined(ARCH_IS_64_BIT)
if (res != untaggable) {
*reinterpret_cast<intptr_t*>(&FP[rA]) = res << kSmiTagSize;
pc++;
@@ -2055,12 +2001,11 @@
{
BYTECODE(Shl, A_B_C);
const intptr_t rhs = reinterpret_cast<intptr_t>(FP[rC]) >> kSmiTagSize;
- const int kBitsPerInt32 = 32;
- if (static_cast<uintptr_t>(rhs) < kBitsPerInt32) {
- const int32_t lhs = reinterpret_cast<intptr_t>(FP[rB]);
- const int32_t res = lhs << rhs;
+ if (static_cast<uintptr_t>(rhs) < kBitsPerWord) {
+ const intptr_t lhs = reinterpret_cast<intptr_t>(FP[rB]);
+ const intptr_t res = lhs << rhs;
if (lhs == (res >> rhs)) {
- *reinterpret_cast<intptr_t*>(&FP[rA]) = static_cast<intptr_t>(res);
+ *reinterpret_cast<intptr_t*>(&FP[rA]) = res;
pc++;
}
}
@@ -2071,7 +2016,8 @@
BYTECODE(Shr, A_B_C);
const intptr_t rhs = reinterpret_cast<intptr_t>(FP[rC]) >> kSmiTagSize;
if (rhs >= 0) {
- const intptr_t shift_amount = (rhs >= 32) ? (32 - 1) : rhs;
+ const intptr_t shift_amount =
+ (rhs >= kBitsPerWord) ? (kBitsPerWord - 1) : rhs;
const intptr_t lhs = reinterpret_cast<intptr_t>(FP[rB]) >> kSmiTagSize;
*reinterpret_cast<intptr_t*>(&FP[rA]) = (lhs >> shift_amount)
<< kSmiTagSize;
diff --git a/runtime/vm/snapshot_test.cc b/runtime/vm/snapshot_test.cc
index 22067a5..dc70397 100644
--- a/runtime/vm/snapshot_test.cc
+++ b/runtime/vm/snapshot_test.cc
@@ -253,6 +253,10 @@
// here covers most of the 64-bit range. On 32-bit platforms the smi
// range covers most of the 32-bit range and values outside that
// range are also represented as mints.
+#if defined(ARCH_IS_64_BIT)
+ EXPECT_EQ(Dart_CObject_kInt64, mint_cobject->type);
+ EXPECT_EQ(value, mint_cobject->value.as_int64);
+#else
if (kMinInt32 < value && value < kMaxInt32) {
EXPECT_EQ(Dart_CObject_kInt32, mint_cobject->type);
EXPECT_EQ(value, mint_cobject->value.as_int32);
@@ -260,6 +264,7 @@
EXPECT_EQ(Dart_CObject_kInt64, mint_cobject->type);
EXPECT_EQ(value, mint_cobject->value.as_int64);
}
+#endif
}
TEST_CASE(SerializeMints) {
diff --git a/runtime/vm/stub_code_arm64.cc b/runtime/vm/stub_code_arm64.cc
index 401a611..f0354a8 100644
--- a/runtime/vm/stub_code_arm64.cc
+++ b/runtime/vm/stub_code_arm64.cc
@@ -1334,18 +1334,14 @@
__ ldr(R1, Address(SP, +1 * kWordSize)); // Left.
__ orr(TMP, R0, Operand(R1));
__ BranchIfNotSmi(TMP, not_smi_or_overflow);
- __ AssertSmiInRange(R0);
- __ AssertSmiInRange(R1);
switch (kind) {
case Token::kADD: {
- __ addsw(R0, R1, Operand(R0)); // Adds.
- __ sxtw(R0, R0);
+ __ adds(R0, R1, Operand(R0)); // Adds.
__ b(not_smi_or_overflow, VS); // Branch if overflow.
break;
}
case Token::kSUB: {
- __ subsw(R0, R1, Operand(R0)); // Subtract.
- __ sxtw(R0, R0);
+ __ subs(R0, R1, Operand(R0)); // Subtract.
__ b(not_smi_or_overflow, VS); // Branch if overflow.
break;
}
@@ -1387,8 +1383,6 @@
__ StoreToOffset(R1, R6, count_offset);
}
- __ AssertSmiInRange(R0, Assembler::kValueCanBeHeapPointer);
-
__ ret();
}
diff --git a/runtime/vm/stub_code_x64.cc b/runtime/vm/stub_code_x64.cc
index b21d9db..fc8e781 100644
--- a/runtime/vm/stub_code_x64.cc
+++ b/runtime/vm/stub_code_x64.cc
@@ -1274,15 +1274,13 @@
__ j(NOT_ZERO, not_smi_or_overflow);
switch (kind) {
case Token::kADD: {
- __ addl(RAX, RCX);
+ __ addq(RAX, RCX);
__ j(OVERFLOW, not_smi_or_overflow);
- __ movsxd(RAX, RAX);
break;
}
case Token::kSUB: {
- __ subl(RAX, RCX);
+ __ subq(RAX, RCX);
__ j(OVERFLOW, not_smi_or_overflow);
- __ movsxd(RAX, RAX);
break;
}
case Token::kEQ: {
diff --git a/runtime/vm/timer.h b/runtime/vm/timer.h
index 7d0efcb..c9e4a19 100644
--- a/runtime/vm/timer.h
+++ b/runtime/vm/timer.h
@@ -87,10 +87,10 @@
return stop_ - start_;
}
- int64_t start_;
- int64_t stop_;
- int64_t total_;
- int64_t max_contiguous_;
+ ALIGN8 int64_t start_;
+ ALIGN8 int64_t stop_;
+ ALIGN8 int64_t total_;
+ ALIGN8 int64_t max_contiguous_;
bool report_;
bool running_;
const char* message_;
diff --git a/runtime/vm/token_position.h b/runtime/vm/token_position.h
index eadb562..c28f9a4 100644
--- a/runtime/vm/token_position.h
+++ b/runtime/vm/token_position.h
@@ -18,7 +18,7 @@
// ClassifyingTokenPositions N -> -1 - N
//
// Synthetically created AstNodes are given real source positions but encoded
-// as negative numbers from [kSmiMin, -1 - N]. For example:
+// as negative numbers from [kSmiMin32, -1 - N]. For example:
//
// A source position of 0 in a synthetic AstNode would be encoded as -2 - N.
// A source position of 1 in a synthetic AstNode would be encoded as -3 - N.
@@ -86,7 +86,7 @@
#undef DECLARE_VALUES
static const intptr_t kMinSourcePos = 0;
static const TokenPosition kMinSource;
- static const intptr_t kMaxSourcePos = kSmiMax - kMaxSentinelDescriptors - 2;
+ static const intptr_t kMaxSourcePos = kSmiMax32 - kMaxSentinelDescriptors - 2;
static const TokenPosition kMaxSource;
// Decode from a snapshot.
diff --git a/runtime/vm/type_testing_stubs.cc b/runtime/vm/type_testing_stubs.cc
index 70c1e2c..2a3b85c 100644
--- a/runtime/vm/type_testing_stubs.cc
+++ b/runtime/vm/type_testing_stubs.cc
@@ -98,7 +98,7 @@
if (!StubCode::HasBeenInitialized()) {
ASSERT(type.IsType());
const intptr_t cid = Type::Cast(type).type_class_id();
- ASSERT(cid == kDynamicCid || cid == kVoidCid || cid == kVectorCid);
+ ASSERT(cid == kDynamicCid || cid == kVoidCid);
return Instructions::null();
}
diff --git a/sdk/BUILD.gn b/sdk/BUILD.gn
index 40dfafb..5a3cf37 100644
--- a/sdk/BUILD.gn
+++ b/sdk/BUILD.gn
@@ -13,7 +13,7 @@
# or ":copy_libraries" may delete/overwrite your addition, and the build will
# fail.
-import("../build/copy_tree.gni")
+import("copy_tree.gni")
declare_args() {
# Build a SDK with less stuff. It excludes dart2js, ddc, and web libraries.
diff --git a/build/copy_tree.gni b/sdk/copy_tree.gni
similarity index 100%
rename from build/copy_tree.gni
rename to sdk/copy_tree.gni
diff --git a/sdk/lib/_internal/js_runtime/lib/io_patch.dart b/sdk/lib/_internal/js_runtime/lib/io_patch.dart
index e850ad6..7c88473 100644
--- a/sdk/lib/_internal/js_runtime/lib/io_patch.dart
+++ b/sdk/lib/_internal/js_runtime/lib/io_patch.dart
@@ -348,7 +348,7 @@
Map<String, String> environment,
bool includeParentEnvironment: true,
bool runInShell: false,
- ProcessStartMode mode: ProcessStartMode.NORMAL}) {
+ ProcessStartMode mode: ProcessStartMode.normal}) {
throw new UnsupportedError("Process.start");
}
@@ -358,8 +358,8 @@
Map<String, String> environment,
bool includeParentEnvironment: true,
bool runInShell: false,
- Encoding stdoutEncoding: SYSTEM_ENCODING,
- Encoding stderrEncoding: SYSTEM_ENCODING}) {
+ Encoding stdoutEncoding: systemEncoding,
+ Encoding stderrEncoding: systemEncoding}) {
throw new UnsupportedError("Process.run");
}
@@ -369,13 +369,13 @@
Map<String, String> environment,
bool includeParentEnvironment: true,
bool runInShell: false,
- Encoding stdoutEncoding: SYSTEM_ENCODING,
- Encoding stderrEncoding: SYSTEM_ENCODING}) {
+ Encoding stdoutEncoding: systemEncoding,
+ Encoding stderrEncoding: systemEncoding}) {
throw new UnsupportedError("Process.runSync");
}
@patch
- static bool killPid(int pid, [ProcessSignal signal = ProcessSignal.SIGTERM]) {
+ static bool killPid(int pid, [ProcessSignal signal = ProcessSignal.sigterm]) {
throw new UnsupportedError("Process.killPid");
}
}
@@ -408,7 +408,7 @@
}
@patch
static Future<List<InternetAddress>> lookup(String host,
- {InternetAddressType type: InternetAddressType.ANY}) {
+ {InternetAddressType type: InternetAddressType.any}) {
throw new UnsupportedError("InternetAddress.lookup");
}
@@ -430,7 +430,7 @@
static Future<List<NetworkInterface>> list(
{bool includeLoopback: false,
bool includeLinkLocal: false,
- InternetAddressType type: InternetAddressType.ANY}) {
+ InternetAddressType type: InternetAddressType.any}) {
throw new UnsupportedError("NetworkInterface.list");
}
}
diff --git a/sdk/lib/_internal/js_runtime/lib/preambles/jsshell.js b/sdk/lib/_internal/js_runtime/lib/preambles/jsshell.js
index 9f136c2..a6b41c4 100644
--- a/sdk/lib/_internal/js_runtime/lib/preambles/jsshell.js
+++ b/sdk/lib/_internal/js_runtime/lib/preambles/jsshell.js
@@ -18,7 +18,262 @@
self.location = { href: "file://" + workingDirectory + "/" };
- function computeCurrentScript() {
+ // Event loop.
+
+ // Task queue as cyclic list queue.
+ var taskQueue = new Array(8); // Length is power of 2.
+ var head = 0;
+ var tail = 0;
+ var mask = taskQueue.length - 1;
+ function addTask(elem) {
+ taskQueue[head] = elem;
+ head = (head + 1) & mask;
+ if (head == tail) _growTaskQueue();
+ }
+ function removeTask() {
+ if (head == tail) return;
+ var result = taskQueue[tail];
+ taskQueue[tail] = undefined;
+ tail = (tail + 1) & mask;
+ return result;
+ }
+ function _growTaskQueue() {
+ // head == tail.
+ var length = taskQueue.length;
+ var split = head;
+ taskQueue.length = length * 2;
+ if (split * 2 < length) { // split < length / 2
+ for (var i = 0; i < split; i++) {
+ taskQueue[length + i] = taskQueue[i];
+ taskQueue[i] = undefined;
+ }
+ head += length;
+ } else {
+ for (var i = split; i < length; i++) {
+ taskQueue[length + i] = taskQueue[i];
+ taskQueue[i] = undefined;
+ }
+ tail += length;
+ }
+ mask = taskQueue.length - 1;
+ }
+
+ // Mapping from timer id to timer function.
+ // The timer id is written on the function as .$timerId.
+ // That field is cleared when the timer is cancelled, but it is not returned
+ // from the queue until its time comes.
+ var timerIds = {};
+ var timerIdCounter = 1; // Counter used to assign ids.
+
+ // Zero-timer queue as simple array queue using push/shift.
+ var zeroTimerQueue = [];
+
+ function addTimer(f, ms) {
+ var id = timerIdCounter++;
+ f.$timerId = id;
+ timerIds[id] = f;
+ if (ms == 0 && !isNextTimerDue()) {
+ zeroTimerQueue.push(f);
+ } else {
+ addDelayedTimer(f, ms);
+ }
+ return id;
+ }
+
+ function nextZeroTimer() {
+ while (zeroTimerQueue.length > 0) {
+ var action = zeroTimerQueue.shift();
+ if (action.$timerId !== undefined) return action;
+ }
+ }
+
+ function nextEvent() {
+ var action = removeTask();
+ if (action) {
+ return action;
+ }
+ do {
+ action = nextZeroTimer();
+ if (action) break;
+ var nextList = nextDelayedTimerQueue();
+ if (!nextList) {
+ return;
+ }
+ var newTime = nextList.shift();
+ advanceTimeTo(newTime);
+ zeroTimerQueue = nextList;
+ } while (true)
+ var id = action.$timerId;
+ clearTimerId(action, id);
+ return action;
+ }
+
+ // Mocking time.
+ var timeOffset = 0;
+ var now = function() {
+ // Install the mock Date object only once.
+ // Following calls to "now" will just use the new (mocked) Date.now
+ // method directly.
+ installMockDate();
+ now = Date.now;
+ return Date.now();
+ };
+ var originalDate = Date;
+ var originalNow = originalDate.now;
+ function advanceTimeTo(time) {
+ var now = originalNow();
+ if (timeOffset < time - now) {
+ timeOffset = time - now;
+ }
+ }
+ function installMockDate() {
+ var NewDate = function Date(Y, M, D, h, m, s, ms) {
+ if (this instanceof Date) {
+ // Assume a construct call.
+ switch (arguments.length) {
+ case 0: return new originalDate(originalNow() + timeOffset);
+ case 1: return new originalDate(Y);
+ case 2: return new originalDate(Y, M);
+ case 3: return new originalDate(Y, M, D);
+ case 4: return new originalDate(Y, M, D, h);
+ case 5: return new originalDate(Y, M, D, h, m);
+ case 6: return new originalDate(Y, M, D, h, m, s);
+ default: return new originalDate(Y, M, D, h, m, s, ms);
+ }
+ }
+ return new originalDate(originalNow() + timeOffset).toString();
+ };
+ NewDate.UTC = originalDate.UTC;
+ NewDate.parse = originalDate.parse;
+ NewDate.now = function now() { return originalNow() + timeOffset; };
+ NewDate.prototype = originalDate.prototype;
+ originalDate.prototype.constructor = NewDate;
+ Date = NewDate;
+ }
+
+ // Heap priority queue with key index.
+ // Each entry is list of [timeout, callback1 ... callbackn].
+ var timerHeap = [];
+ var timerIndex = {};
+ function addDelayedTimer(f, ms) {
+ var timeout = now() + ms;
+ var timerList = timerIndex[timeout];
+ if (timerList == null) {
+ timerList = [timeout, f];
+ timerIndex[timeout] = timerList;
+ var index = timerHeap.length;
+ timerHeap.length += 1;
+ bubbleUp(index, timeout, timerList);
+ } else {
+ timerList.push(f);
+ }
+ }
+
+ function isNextTimerDue() {
+ if (timerHeap.length == 0) return false;
+ var head = timerHeap[0];
+ return head[0] < originalNow() + timeOffset;
+ }
+
+ function nextDelayedTimerQueue() {
+ if (timerHeap.length == 0) return null;
+ var result = timerHeap[0];
+ var last = timerHeap.pop();
+ if (timerHeap.length > 0) {
+ bubbleDown(0, last[0], last);
+ }
+ return result;
+ }
+
+ function bubbleUp(index, key, value) {
+ while (index != 0) {
+ var parentIndex = (index - 1) >> 1;
+ var parent = timerHeap[parentIndex];
+ var parentKey = parent[0];
+ if (key > parentKey) break;
+ timerHeap[index] = parent;
+ index = parentIndex;
+ }
+ timerHeap[index] = value;
+ }
+
+ function bubbleDown(index, key, value) {
+ while (true) {
+ var leftChildIndex = index * 2 + 1;
+ if (leftChildIndex >= timerHeap.length) break;
+ var minChildIndex = leftChildIndex;
+ var minChild = timerHeap[leftChildIndex];
+ var minChildKey = minChild[0];
+ var rightChildIndex = leftChildIndex + 1;
+ if (rightChildIndex < timerHeap.length) {
+ var rightChild = timerHeap[rightChildIndex];
+ var rightKey = rightChild[0];
+ if (rightKey < minChildKey) {
+ minChildIndex = rightChildIndex;
+ minChild = rightChild;
+ minChildKey = rightKey;
+ }
+ }
+ if (minChildKey > key) break;
+ timerHeap[index] = minChild;
+ index = minChildIndex;
+ }
+ timerHeap[index] = value;
+ }
+
+ function addInterval(f, ms) {
+ var id = timerIdCounter++;
+ function repeat() {
+ // Reactivate with the same id.
+ repeat.$timerId = id;
+ timerIds[id] = repeat;
+ addDelayedTimer(repeat, ms);
+ f();
+ }
+ repeat.$timerId = id;
+ timerIds[id] = repeat;
+ addDelayedTimer(repeat, ms);
+ return id;
+ }
+
+ function cancelTimer(id) {
+ var f = timerIds[id];
+ if (f == null) return;
+ clearTimerId(f, id);
+ }
+
+ function clearTimerId(f, id) {
+ f.$timerId = undefined;
+ delete timerIds[id];
+ }
+
+ function eventLoop(action) {
+ while (action) {
+ try {
+ action();
+ } catch (e) {
+ if (typeof onerror == "function") {
+ onerror(e, null, -1);
+ } else {
+ throw e;
+ }
+ }
+ action = nextEvent();
+ }
+ }
+
+ self.dartMainRunner = function(main, args) {
+ // Initialize.
+ var action = function() { main(args); }
+ eventLoop(action);
+ };
+ self.setTimeout = addTimer;
+ self.clearTimeout = cancelTimer;
+ self.setInterval = addInterval;
+ self.clearInterval = cancelTimer;
+ self.scheduleImmediate = addTask;
+
+ function computeCurrentScript() {
try {
throw new Error();
} catch(e) {
diff --git a/sdk/lib/io/bytes_builder.dart b/sdk/lib/io/bytes_builder.dart
index b5745e3..3962037 100644
--- a/sdk/lib/io/bytes_builder.dart
+++ b/sdk/lib/io/bytes_builder.dart
@@ -80,7 +80,7 @@
class _CopyingBytesBuilder implements BytesBuilder {
// Start with 1024 bytes.
- static const int _INIT_SIZE = 1024;
+ static const int _initSize = 1024;
static final _emptyList = new Uint8List(0);
@@ -125,8 +125,8 @@
// We will create a list in the range of 2-4 times larger than
// required.
int newSize = required * 2;
- if (newSize < _INIT_SIZE) {
- newSize = _INIT_SIZE;
+ if (newSize < _initSize) {
+ newSize = _initSize;
} else {
newSize = _pow2roundup(newSize);
}
diff --git a/sdk/lib/io/common.dart b/sdk/lib/io/common.dart
index ae9cd12..852a267 100644
--- a/sdk/lib/io/common.dart
+++ b/sdk/lib/io/common.dart
@@ -6,32 +6,32 @@
// Constants used when working with native ports.
// These must match the constants in runtime/bin/dartutils.h class CObject.
-const int _SUCCESS_RESPONSE = 0;
-const int _ILLEGAL_ARGUMENT_RESPONSE = 1;
-const int _OSERROR_RESPONSE = 2;
-const int _FILE_CLOSED_RESPONSE = 3;
+const int _successResponse = 0;
+const int _illegalArgumentResponse = 1;
+const int _osErrorResponse = 2;
+const int _fileClosedResponse = 3;
-const int _ERROR_RESPONSE_ERROR_TYPE = 0;
-const int _OSERROR_RESPONSE_ERROR_CODE = 1;
-const int _OSERROR_RESPONSE_MESSAGE = 2;
+const int _errorResponseErrorType = 0;
+const int _osErrorResponseErrorCode = 1;
+const int _osErrorResponseMessage = 2;
// Functions used to receive exceptions from native ports.
bool _isErrorResponse(response) =>
- response is List && response[0] != _SUCCESS_RESPONSE;
+ response is List && response[0] != _successResponse;
/**
* Returns an Exception or an Error
*/
_exceptionFromResponse(response, String message, String path) {
assert(_isErrorResponse(response));
- switch (response[_ERROR_RESPONSE_ERROR_TYPE]) {
- case _ILLEGAL_ARGUMENT_RESPONSE:
+ switch (response[_errorResponseErrorType]) {
+ case _illegalArgumentResponse:
return new ArgumentError("$message: $path");
- case _OSERROR_RESPONSE:
- var err = new OSError(response[_OSERROR_RESPONSE_MESSAGE],
- response[_OSERROR_RESPONSE_ERROR_CODE]);
+ case _osErrorResponse:
+ var err = new OSError(response[_osErrorResponseMessage],
+ response[_osErrorResponseErrorCode]);
return new FileSystemException(message, path, err);
- case _FILE_CLOSED_RESPONSE:
+ case _fileClosedResponse:
return new FileSystemException("File closed", path);
default:
return new Exception("Unknown error");
diff --git a/sdk/lib/io/data_transformer.dart b/sdk/lib/io/data_transformer.dart
index ae409b9..ab0770b 100644
--- a/sdk/lib/io/data_transformer.dart
+++ b/sdk/lib/io/data_transformer.dart
@@ -12,55 +12,85 @@
abstract class ZLibOption {
/// Minimal value for [ZLibCodec.windowBits], [ZLibEncoder.windowBits]
/// and [ZLibDecoder.windowBits].
+ static const int minWindowBits = 8;
+ @Deprecated("Use minWindowBits instead")
static const int MIN_WINDOW_BITS = 8;
/// Maximal value for [ZLibCodec.windowBits], [ZLibEncoder.windowBits]
/// and [ZLibDecoder.windowBits].
+ static const int maxWindowBits = 15;
+ @Deprecated("Use maxWindowBits instead")
static const int MAX_WINDOW_BITS = 15;
/// Default value for [ZLibCodec.windowBits], [ZLibEncoder.windowBits]
/// and [ZLibDecoder.windowBits].
+ static const int defaultWindowBits = 15;
+ @Deprecated("Use defaultWindowBits instead")
static const int DEFAULT_WINDOW_BITS = 15;
/// Minimal value for [ZLibCodec.level] and [ZLibEncoder.level].
+ static const int minLevel = -1;
+ @Deprecated("Use minLevel instead")
static const int MIN_LEVEL = -1;
/// Maximal value for [ZLibCodec.level] and [ZLibEncoder.level]
+ static const int maxLevel = 9;
+ @Deprecated("Use maxLevel instead")
static const int MAX_LEVEL = 9;
/// Default value for [ZLibCodec.level] and [ZLibEncoder.level].
+ static const int defaultLevel = 6;
+ @Deprecated("Use defaultLevel instead")
static const int DEFAULT_LEVEL = 6;
/// Minimal value for [ZLibCodec.memLevel] and [ZLibEncoder.memLevel].
+ static const int minMemLevel = 1;
+ @Deprecated("Use minMemLevel instead")
static const int MIN_MEM_LEVEL = 1;
/// Maximal value for [ZLibCodec.memLevel] and [ZLibEncoder.memLevel].
+ static const int maxMemLevel = 9;
+ @Deprecated("Use maxMemLevel instead")
static const int MAX_MEM_LEVEL = 9;
/// Default value for [ZLibCodec.memLevel] and [ZLibEncoder.memLevel].
+ static const int defaultMemLevel = 8;
+ @Deprecated("Use defaultMemLevel instead")
static const int DEFAULT_MEM_LEVEL = 8;
/// Recommended strategy for data produced by a filter (or predictor)
+ static const int strategyFiltered = 1;
+ @Deprecated("Use strategyFiltered instead")
static const int STRATEGY_FILTERED = 1;
/// Use this strategy to force Huffman encoding only (no string match)
+ static const int strategyHuffmanOnly = 2;
+ @Deprecated("Use strategyHuffmanOnly instead")
static const int STRATEGY_HUFFMAN_ONLY = 2;
/// Use this strategy to limit match distances to one (run-length encoding)
+ static const int strategyRle = 3;
+ @Deprecated("Use strategyRle instead")
static const int STRATEGY_RLE = 3;
/// This strategy prevents the use of dynamic Huffman codes, allowing for a
/// simpler decoder
+ static const int strategyFixed = 4;
+ @Deprecated("Use strategyFixed instead")
static const int STRATEGY_FIXED = 4;
/// Recommended strategy for normal data
+ static const int strategyDefault = 0;
+ @Deprecated("Use strategyDefault instead")
static const int STRATEGY_DEFAULT = 0;
}
/**
* An instance of the default implementation of the [ZLibCodec].
*/
-const ZLibCodec ZLIB = const ZLibCodec._default();
+const ZLibCodec zlib = const ZLibCodec._default();
+@Deprecated("Use zlib instead")
+const ZLibCodec ZLIB = zlib;
/**
* The [ZLibCodec] encodes raw bytes to ZLib compressed bytes and decodes ZLib
@@ -93,10 +123,10 @@
final int memLevel;
/**
- * Tunes the compression algorithm. Use the value STRATEGY_DEFAULT for normal
- * data, STRATEGY_FILTERED for data produced by a filter (or predictor),
- * STRATEGY_HUFFMAN_ONLY to force Huffman encoding only (no string match), or
- * STRATEGY_RLE to limit match distances to one (run-length encoding).
+ * Tunes the compression algorithm. Use the value strategyDefault for normal
+ * data, strategyFiltered for data produced by a filter (or predictor),
+ * strategyHuffmanOnly to force Huffman encoding only (no string match), or
+ * strategyRle to limit match distances to one (run-length encoding).
*/
final int strategy;
@@ -126,10 +156,10 @@
final List<int> dictionary;
ZLibCodec(
- {this.level: ZLibOption.DEFAULT_LEVEL,
- this.windowBits: ZLibOption.DEFAULT_WINDOW_BITS,
- this.memLevel: ZLibOption.DEFAULT_MEM_LEVEL,
- this.strategy: ZLibOption.STRATEGY_DEFAULT,
+ {this.level: ZLibOption.defaultLevel,
+ this.windowBits: ZLibOption.defaultWindowBits,
+ this.memLevel: ZLibOption.defaultMemLevel,
+ this.strategy: ZLibOption.strategyDefault,
this.dictionary: null,
this.raw: false,
this.gzip: false}) {
@@ -140,10 +170,10 @@
}
const ZLibCodec._default()
- : level = ZLibOption.DEFAULT_LEVEL,
- windowBits = ZLibOption.DEFAULT_WINDOW_BITS,
- memLevel = ZLibOption.DEFAULT_MEM_LEVEL,
- strategy = ZLibOption.STRATEGY_DEFAULT,
+ : level = ZLibOption.defaultLevel,
+ windowBits = ZLibOption.defaultWindowBits,
+ memLevel = ZLibOption.defaultMemLevel,
+ strategy = ZLibOption.strategyDefault,
raw = false,
gzip = false,
dictionary = null;
@@ -170,7 +200,9 @@
/**
* An instance of the default implementation of the [GZipCodec].
*/
-const GZipCodec GZIP = const GZipCodec._default();
+const GZipCodec gzip = const GZipCodec._default();
+@Deprecated("Use gzip instead")
+const GZipCodec GZIP = gzip;
/**
* The [GZipCodec] encodes raw bytes to GZip compressed bytes and decodes GZip
@@ -207,10 +239,10 @@
/**
* Tunes the compression algorithm. Use the value
- * [ZLibOption.STRATEGY_DEFAULT] for normal data,
- * [ZLibOption.STRATEGY_FILTERED] for data produced by a filter
- * (or predictor), [ZLibOption.STRATEGY_HUFFMAN_ONLY] to force Huffman
- * encoding only (no string match), or [ZLibOption.STRATEGY_RLE] to limit
+ * [ZLibOption.strategyDefault] for normal data,
+ * [ZLibOption.strategyFiltered] for data produced by a filter
+ * (or predictor), [ZLibOption.strategyHuffmanOnly] to force Huffman
+ * encoding only (no string match), or [ZLibOption.strategyRle] to limit
* match distances to one (run-length encoding).
*/
final int strategy;
@@ -241,10 +273,10 @@
final bool raw;
GZipCodec(
- {this.level: ZLibOption.DEFAULT_LEVEL,
- this.windowBits: ZLibOption.DEFAULT_WINDOW_BITS,
- this.memLevel: ZLibOption.DEFAULT_MEM_LEVEL,
- this.strategy: ZLibOption.STRATEGY_DEFAULT,
+ {this.level: ZLibOption.defaultLevel,
+ this.windowBits: ZLibOption.defaultWindowBits,
+ this.memLevel: ZLibOption.defaultMemLevel,
+ this.strategy: ZLibOption.strategyDefault,
this.dictionary: null,
this.raw: false,
this.gzip: true}) {
@@ -255,10 +287,10 @@
}
const GZipCodec._default()
- : level = ZLibOption.DEFAULT_LEVEL,
- windowBits = ZLibOption.DEFAULT_WINDOW_BITS,
- memLevel = ZLibOption.DEFAULT_MEM_LEVEL,
- strategy = ZLibOption.STRATEGY_DEFAULT,
+ : level = ZLibOption.defaultLevel,
+ windowBits = ZLibOption.defaultWindowBits,
+ memLevel = ZLibOption.defaultMemLevel,
+ strategy = ZLibOption.strategyDefault,
raw = false,
gzip = true,
dictionary = null;
@@ -314,10 +346,10 @@
/**
* Tunes the compression algorithm. Use the value
- * [ZLibOption.STRATEGY_DEFAULT] for normal data,
- * [ZLibOption.STRATEGY_FILTERED] for data produced by a filter
- * (or predictor), [ZLibOption.STRATEGY_HUFFMAN_ONLY] to force Huffman
- * encoding only (no string match), or [ZLibOption.STRATEGY_RLE] to limit
+ * [ZLibOption.strategyDefault] for normal data,
+ * [ZLibOption.strategyFiltered] for data produced by a filter
+ * (or predictor), [ZLibOption.strategyHuffmanOnly] to force Huffman
+ * encoding only (no string match), or [ZLibOption.strategyRle] to limit
* match distances to one (run-length encoding).
*/
final int strategy;
@@ -349,10 +381,10 @@
ZLibEncoder(
{this.gzip: false,
- this.level: ZLibOption.DEFAULT_LEVEL,
- this.windowBits: ZLibOption.DEFAULT_WINDOW_BITS,
- this.memLevel: ZLibOption.DEFAULT_MEM_LEVEL,
- this.strategy: ZLibOption.STRATEGY_DEFAULT,
+ this.level: ZLibOption.defaultLevel,
+ this.windowBits: ZLibOption.defaultWindowBits,
+ this.memLevel: ZLibOption.defaultMemLevel,
+ this.strategy: ZLibOption.strategyDefault,
this.dictionary: null,
this.raw: false}) {
_validateZLibeLevel(level);
@@ -417,7 +449,7 @@
final bool raw;
ZLibDecoder(
- {this.windowBits: ZLibOption.DEFAULT_WINDOW_BITS,
+ {this.windowBits: ZLibOption.defaultWindowBits,
this.dictionary: null,
this.raw: false}) {
_validateZLibWindowBits(windowBits);
@@ -458,10 +490,10 @@
*/
factory RawZLibFilter.deflateFilter({
bool gzip: false,
- int level: ZLibOption.DEFAULT_LEVEL,
- int windowBits: ZLibOption.DEFAULT_WINDOW_BITS,
- int memLevel: ZLibOption.DEFAULT_MEM_LEVEL,
- int strategy: ZLibOption.STRATEGY_DEFAULT,
+ int level: ZLibOption.defaultLevel,
+ int windowBits: ZLibOption.defaultWindowBits,
+ int memLevel: ZLibOption.defaultMemLevel,
+ int strategy: ZLibOption.strategyDefault,
List<int> dictionary,
bool raw: false,
}) {
@@ -474,7 +506,7 @@
* decompress data.
*/
factory RawZLibFilter.inflateFilter({
- int windowBits: ZLibOption.DEFAULT_WINDOW_BITS,
+ int windowBits: ZLibOption.defaultWindowBits,
List<int> dictionary,
bool raw: false,
}) {
@@ -606,35 +638,33 @@
}
void _validateZLibWindowBits(int windowBits) {
- if (ZLibOption.MIN_WINDOW_BITS > windowBits ||
- ZLibOption.MAX_WINDOW_BITS < windowBits) {
+ if (ZLibOption.minWindowBits > windowBits ||
+ ZLibOption.maxWindowBits < windowBits) {
throw new RangeError.range(
- windowBits, ZLibOption.MIN_WINDOW_BITS, ZLibOption.MAX_WINDOW_BITS);
+ windowBits, ZLibOption.minWindowBits, ZLibOption.maxWindowBits);
}
}
void _validateZLibeLevel(int level) {
- if (ZLibOption.MIN_LEVEL > level || ZLibOption.MAX_LEVEL < level) {
- throw new RangeError.range(
- level, ZLibOption.MIN_LEVEL, ZLibOption.MAX_LEVEL);
+ if (ZLibOption.minLevel > level || ZLibOption.maxLevel < level) {
+ throw new RangeError.range(level, ZLibOption.minLevel, ZLibOption.maxLevel);
}
}
void _validateZLibMemLevel(int memLevel) {
- if (ZLibOption.MIN_MEM_LEVEL > memLevel ||
- ZLibOption.MAX_MEM_LEVEL < memLevel) {
+ if (ZLibOption.minMemLevel > memLevel || ZLibOption.maxMemLevel < memLevel) {
throw new RangeError.range(
- memLevel, ZLibOption.MIN_MEM_LEVEL, ZLibOption.MAX_MEM_LEVEL);
+ memLevel, ZLibOption.minMemLevel, ZLibOption.maxMemLevel);
}
}
void _validateZLibStrategy(int strategy) {
const strategies = const <int>[
- ZLibOption.STRATEGY_FILTERED,
- ZLibOption.STRATEGY_HUFFMAN_ONLY,
- ZLibOption.STRATEGY_RLE,
- ZLibOption.STRATEGY_FIXED,
- ZLibOption.STRATEGY_DEFAULT
+ ZLibOption.strategyFiltered,
+ ZLibOption.strategyHuffmanOnly,
+ ZLibOption.strategyRle,
+ ZLibOption.strategyFixed,
+ ZLibOption.strategyDefault
];
if (strategies.indexOf(strategy) == -1) {
throw new ArgumentError("Unsupported 'strategy'");
diff --git a/sdk/lib/io/directory_impl.dart b/sdk/lib/io/directory_impl.dart
index f74c0f8..8be9257 100644
--- a/sdk/lib/io/directory_impl.dart
+++ b/sdk/lib/io/directory_impl.dart
@@ -58,8 +58,8 @@
}
Future<bool> exists() {
- return _File._dispatchWithNamespace(_DIRECTORY_EXISTS, [null, path]).then(
- (response) {
+ return _File._dispatchWithNamespace(
+ _IOService.directoryExists, [null, path]).then((response) {
if (_isErrorResponse(response)) {
throw _exceptionOrErrorFromResponse(response, "Exists failed");
}
@@ -90,8 +90,8 @@
}
});
} else {
- return _File._dispatchWithNamespace(_DIRECTORY_CREATE, [null, path]).then(
- (response) {
+ return _File._dispatchWithNamespace(
+ _IOService.directoryCreate, [null, path]).then((response) {
if (_isErrorResponse(response)) {
throw _exceptionOrErrorFromResponse(response, "Creation failed");
}
@@ -129,7 +129,7 @@
fullPrefix = "$path${Platform.pathSeparator}$prefix";
}
return _File._dispatchWithNamespace(
- _DIRECTORY_CREATE_TEMP, [null, fullPrefix]).then((response) {
+ _IOService.directoryCreateTemp, [null, fullPrefix]).then((response) {
if (_isErrorResponse(response)) {
throw _exceptionOrErrorFromResponse(
response, "Creation of temporary directory failed");
@@ -160,7 +160,7 @@
Future<Directory> _delete({bool recursive: false}) {
return _File._dispatchWithNamespace(
- _DIRECTORY_DELETE, [null, path, recursive]).then((response) {
+ _IOService.directoryDelete, [null, path, recursive]).then((response) {
if (_isErrorResponse(response)) {
throw _exceptionOrErrorFromResponse(response, "Deletion failed");
}
@@ -177,7 +177,7 @@
Future<Directory> rename(String newPath) {
return _File._dispatchWithNamespace(
- _DIRECTORY_RENAME, [null, path, newPath]).then((response) {
+ _IOService.directoryRename, [null, path, newPath]).then((response) {
if (_isErrorResponse(response)) {
throw _exceptionOrErrorFromResponse(response, "Rename failed");
}
@@ -223,16 +223,16 @@
String toString() => "Directory: '$path'";
bool _isErrorResponse(response) =>
- response is List && response[0] != _SUCCESS_RESPONSE;
+ response is List && response[0] != _successResponse;
_exceptionOrErrorFromResponse(response, String message) {
assert(_isErrorResponse(response));
- switch (response[_ERROR_RESPONSE_ERROR_TYPE]) {
- case _ILLEGAL_ARGUMENT_RESPONSE:
+ switch (response[_errorResponseErrorType]) {
+ case _illegalArgumentResponse:
return new ArgumentError();
- case _OSERROR_RESPONSE:
- var err = new OSError(response[_OSERROR_RESPONSE_MESSAGE],
- response[_OSERROR_RESPONSE_ERROR_CODE]);
+ case _osErrorResponse:
+ var err = new OSError(response[_osErrorResponseMessage],
+ response[_osErrorResponseErrorCode]);
return new FileSystemException(message, path, err);
default:
return new Exception("Unknown error");
@@ -247,16 +247,16 @@
}
class _AsyncDirectoryLister {
- static const int LIST_FILE = 0;
- static const int LIST_DIRECTORY = 1;
- static const int LIST_LINK = 2;
- static const int LIST_ERROR = 3;
- static const int LIST_DONE = 4;
+ static const int listFile = 0;
+ static const int listDirectory = 1;
+ static const int listLink = 2;
+ static const int listError = 3;
+ static const int listDone = 4;
- static const int RESPONSE_TYPE = 0;
- static const int RESPONSE_PATH = 1;
- static const int RESPONSE_COMPLETE = 1;
- static const int RESPONSE_ERROR = 2;
+ static const int responseType = 0;
+ static const int responsePath = 1;
+ static const int responseComplete = 1;
+ static const int responseError = 2;
final String path;
final bool recursive;
@@ -286,7 +286,7 @@
Stream<FileSystemEntity> get stream => controller.stream;
void onListen() {
- _File._dispatchWithNamespace(_DIRECTORY_LIST_START,
+ _File._dispatchWithNamespace(_IOService.directoryListStart,
[null, path, recursive, followLinks]).then((response) {
if (response is int) {
_ops = new _AsyncDirectoryListerOps(response);
@@ -330,7 +330,8 @@
return;
}
nextRunning = true;
- _IOService._dispatch(_DIRECTORY_LIST_NEXT, [pointer]).then((result) {
+ _IOService
+ ._dispatch(_IOService.directoryListNext, [pointer]).then((result) {
nextRunning = false;
if (result is List) {
next();
@@ -338,19 +339,19 @@
for (int i = 0; i < result.length; i++) {
assert(i % 2 == 0);
switch (result[i++]) {
- case LIST_FILE:
+ case listFile:
controller.add(new File(result[i]));
break;
- case LIST_DIRECTORY:
+ case listDirectory:
controller.add(new Directory(result[i]));
break;
- case LIST_LINK:
+ case listLink:
controller.add(new Link(result[i]));
break;
- case LIST_ERROR:
+ case listError:
error(result[i]);
break;
- case LIST_DONE:
+ case listDone:
canceled = true;
return;
}
@@ -380,20 +381,20 @@
if (pointer == null) {
_cleanup();
} else {
- _IOService
- ._dispatch(_DIRECTORY_LIST_STOP, [pointer]).whenComplete(_cleanup);
+ _IOService._dispatch(
+ _IOService.directoryListStop, [pointer]).whenComplete(_cleanup);
}
}
void error(message) {
- var errorType = message[RESPONSE_ERROR][_ERROR_RESPONSE_ERROR_TYPE];
- if (errorType == _ILLEGAL_ARGUMENT_RESPONSE) {
+ var errorType = message[responseError][_errorResponseErrorType];
+ if (errorType == _illegalArgumentResponse) {
controller.addError(new ArgumentError());
- } else if (errorType == _OSERROR_RESPONSE) {
- var responseError = message[RESPONSE_ERROR];
- var err = new OSError(responseError[_OSERROR_RESPONSE_MESSAGE],
- responseError[_OSERROR_RESPONSE_ERROR_CODE]);
- var errorPath = message[RESPONSE_PATH];
+ } else if (errorType == _osErrorResponse) {
+ var responseErrorInfo = message[responseError];
+ var err = new OSError(responseErrorInfo[_osErrorResponseMessage],
+ responseErrorInfo[_osErrorResponseErrorCode]);
+ var errorPath = message[responsePath];
if (errorPath == null) errorPath = path;
controller.addError(
new FileSystemException("Directory listing failed", errorPath, err));
diff --git a/sdk/lib/io/file.dart b/sdk/lib/io/file.dart
index b881bbe..33ce01f 100644
--- a/sdk/lib/io/file.dart
+++ b/sdk/lib/io/file.dart
@@ -9,64 +9,92 @@
*/
class FileMode {
/// The mode for opening a file only for reading.
- static const READ = const FileMode._internal(0);
+ static const read = const FileMode._internal(0);
+ @Deprecated("Use read instead")
+ static const READ = read;
/// Mode for opening a file for reading and writing. The file is
/// overwritten if it already exists. The file is created if it does not
/// already exist.
- static const WRITE = const FileMode._internal(1);
+ static const write = const FileMode._internal(1);
+ @Deprecated("Use write instead")
+ static const WRITE = write;
/// Mode for opening a file for reading and writing to the
/// end of it. The file is created if it does not already exist.
- static const APPEND = const FileMode._internal(2);
+ static const append = const FileMode._internal(2);
+ @Deprecated("Use append instead")
+ static const APPEND = append;
/// Mode for opening a file for writing *only*. The file is
/// overwritten if it already exists. The file is created if it does not
/// already exist.
- static const WRITE_ONLY = const FileMode._internal(3);
+ static const writeOnly = const FileMode._internal(3);
+ @Deprecated("Use writeOnly instead")
+ static const WRITE_ONLY = writeOnly;
/// Mode for opening a file for writing *only* to the
/// end of it. The file is created if it does not already exist.
- static const WRITE_ONLY_APPEND = const FileMode._internal(4);
+ static const writeOnlyAppend = const FileMode._internal(4);
+ @Deprecated("Use writeOnlyAppend instead")
+ static const WRITE_ONLY_APPEND = writeOnlyAppend;
+
final int _mode;
const FileMode._internal(this._mode);
}
/// The mode for opening a file only for reading.
-const READ = FileMode.READ;
+@Deprecated("Use FileMode.read instead")
+const READ = FileMode.read;
/// The mode for opening a file for reading and writing. The file is
/// overwritten if it already exists. The file is created if it does not
/// already exist.
-const WRITE = FileMode.WRITE;
+@Deprecated("Use FileMode.write instead")
+const WRITE = FileMode.write;
/// The mode for opening a file for reading and writing to the
/// end of it. The file is created if it does not already exist.
-const APPEND = FileMode.APPEND;
+@Deprecated("Use FileMode.append instead")
+const APPEND = FileMode.append;
/// Mode for opening a file for writing *only*. The file is
/// overwritten if it already exists. The file is created if it does not
/// already exist.
-const WRITE_ONLY = FileMode.WRITE_ONLY;
+@Deprecated("Use FileMode.writeOnly instead")
+const WRITE_ONLY = FileMode.writeOnly;
/// Mode for opening a file for writing *only* to the
/// end of it. The file is created if it does not already exist.
-const WRITE_ONLY_APPEND = FileMode.WRITE_ONLY_APPEND;
+@Deprecated("Use FileMode.writeOnlyAppend instead")
+const WRITE_ONLY_APPEND = FileMode.writeOnlyAppend;
/// Type of lock when requesting a lock on a file.
-enum FileLock {
+class FileLock {
/// Shared file lock.
- SHARED,
+ static const shared = const FileLock._internal(1);
+ @Deprecated("Use shared instead")
+ static const SHARED = shared;
/// Exclusive file lock.
- EXCLUSIVE,
+ static const exclusive = const FileLock._internal(2);
+ @Deprecated("Use exclusive instead")
+ static const EXCLUSIVE = exclusive;
/// Blocking shared file lock.
- BLOCKING_SHARED,
+ static const blockingShared = const FileLock._internal(3);
+ @Deprecated("Use blockingShared instead")
+ static const BLOCKING_SHARED = blockingShared;
/// Blocking exclusive file lock.
- BLOCKING_EXCLUSIVE,
+ static const blockingExclusive = const FileLock._internal(4);
+ @Deprecated("Use blockingExclusive instead")
+ static const BLOCKING_EXCLUSIVE = blockingExclusive;
+
+ final int _type;
+
+ const FileLock._internal(this._type);
}
/**
@@ -403,16 +431,16 @@
*
* Files can be opened in three modes:
*
- * [FileMode.READ]: open the file for reading.
+ * [FileMode.read]: open the file for reading.
*
- * [FileMode.WRITE]: open the file for both reading and writing and
+ * [FileMode.write]: open the file for both reading and writing and
* truncate the file to length zero. If the file does not exist the
* file is created.
*
- * [FileMode.APPEND]: same as [FileMode.WRITE] except that the file is
+ * [FileMode.append]: same as [FileMode.write] except that the file is
* not truncated.
*/
- Future<RandomAccessFile> open({FileMode mode: FileMode.READ});
+ Future<RandomAccessFile> open({FileMode mode: FileMode.read});
/**
* Synchronously open the file for random access operations. The
@@ -424,7 +452,7 @@
*
* Throws a [FileSystemException] if the operation fails.
*/
- RandomAccessFile openSync({FileMode mode: FileMode.READ});
+ RandomAccessFile openSync({FileMode mode: FileMode.read});
/**
* Create a new independent [Stream] for the contents of this file.
@@ -448,8 +476,8 @@
*
* An [IOSink] for a file can be opened in two modes:
*
- * * [FileMode.WRITE]: truncates the file to length zero.
- * * [FileMode.APPEND]: sets the initial write position to the end
+ * * [FileMode.write]: truncates the file to length zero.
+ * * [FileMode.append]: sets the initial write position to the end
* of the file.
*
* When writing strings through the returned [IOSink] the encoding
@@ -457,7 +485,7 @@
* has an `encoding` property which can be changed after the
* [IOSink] has been created.
*/
- IOSink openWrite({FileMode mode: FileMode.WRITE, Encoding encoding: utf8});
+ IOSink openWrite({FileMode mode: FileMode.write, Encoding encoding: utf8});
/**
* Read the entire file contents as a list of bytes. Returns a
@@ -516,13 +544,13 @@
*
* By default [writeAsBytes] creates the file for writing and truncates the
* file if it already exists. In order to append the bytes to an existing
- * file, pass [FileMode.APPEND] as the optional mode parameter.
+ * file, pass [FileMode.append] as the optional mode parameter.
*
* If the argument [flush] is set to `true`, the data written will be
* flushed to the file system before the returned future completes.
*/
Future<File> writeAsBytes(List<int> bytes,
- {FileMode mode: FileMode.WRITE, bool flush: false});
+ {FileMode mode: FileMode.write, bool flush: false});
/**
* Synchronously write a list of bytes to a file.
@@ -531,7 +559,7 @@
*
* By default [writeAsBytesSync] creates the file for writing and truncates
* the file if it already exists. In order to append the bytes to an existing
- * file, pass [FileMode.APPEND] as the optional mode parameter.
+ * file, pass [FileMode.append] as the optional mode parameter.
*
* If the [flush] argument is set to `true` data written will be
* flushed to the file system before returning.
@@ -539,7 +567,7 @@
* Throws a [FileSystemException] if the operation fails.
*/
void writeAsBytesSync(List<int> bytes,
- {FileMode mode: FileMode.WRITE, bool flush: false});
+ {FileMode mode: FileMode.write, bool flush: false});
/**
* Write a string to a file.
@@ -550,14 +578,14 @@
*
* By default [writeAsString] creates the file for writing and truncates the
* file if it already exists. In order to append the bytes to an existing
- * file, pass [FileMode.APPEND] as the optional mode parameter.
+ * file, pass [FileMode.append] as the optional mode parameter.
*
* If the argument [flush] is set to `true`, the data written will be
* flushed to the file system before the returned future completes.
*
*/
Future<File> writeAsString(String contents,
- {FileMode mode: FileMode.WRITE,
+ {FileMode mode: FileMode.write,
Encoding encoding: utf8,
bool flush: false});
@@ -569,7 +597,7 @@
*
* By default [writeAsStringSync] creates the file for writing and
* truncates the file if it already exists. In order to append the bytes
- * to an existing file, pass [FileMode.APPEND] as the optional mode
+ * to an existing file, pass [FileMode.append] as the optional mode
* parameter.
*
* If the [flush] argument is set to `true` data written will be
@@ -578,7 +606,7 @@
* Throws a [FileSystemException] if the operation fails.
*/
void writeAsStringSync(String contents,
- {FileMode mode: FileMode.WRITE,
+ {FileMode mode: FileMode.write,
Encoding encoding: utf8,
bool flush: false});
@@ -805,9 +833,9 @@
*
* To obtain an exclusive lock on a file it must be opened for writing.
*
- * If [mode] is [FileLock.EXCLUSIVE] or [FileLock.SHARED], an error is
+ * If [mode] is [FileLock.exclusive] or [FileLock.shared], an error is
* signaled if the lock cannot be obtained. If [mode] is
- * [FileLock.BLOCKING_EXCLUSIVE] or [FileLock.BLOCKING_SHARED], the
+ * [FileLock.blockingExclusive] or [FileLock.blockingShared], the
* returned [Future] is resolved only when the lock has been obtained.
*
* *NOTE* file locking does have slight differences in behavior across
@@ -826,7 +854,7 @@
* already unlocked".
*/
Future<RandomAccessFile> lock(
- [FileLock mode = FileLock.EXCLUSIVE, int start = 0, int end = -1]);
+ [FileLock mode = FileLock.exclusive, int start = 0, int end = -1]);
/**
* Synchronously locks the file or part of the file.
@@ -843,9 +871,9 @@
*
* To obtain an exclusive lock on a file it must be opened for writing.
*
- * If [mode] is [FileLock.EXCLUSIVE] or [FileLock.SHARED], an exception is
+ * If [mode] is [FileLock.exclusive] or [FileLock.shared], an exception is
* thrown if the lock cannot be obtained. If [mode] is
- * [FileLock.BLOCKING_EXCLUSIVE] or [FileLock.BLOCKING_SHARED], the
+ * [FileLock.blockingExclusive] or [FileLock.blockingShared], the
* call returns only after the lock has been obtained.
*
* *NOTE* file locking does have slight differences in behavior across
@@ -865,7 +893,7 @@
*
*/
void lockSync(
- [FileLock mode = FileLock.EXCLUSIVE, int start = 0, int end = -1]);
+ [FileLock mode = FileLock.exclusive, int start = 0, int end = -1]);
/**
* Unlocks the file or part of the file.
diff --git a/sdk/lib/io/file_impl.dart b/sdk/lib/io/file_impl.dart
index a64fdc2..67a49b7 100644
--- a/sdk/lib/io/file_impl.dart
+++ b/sdk/lib/io/file_impl.dart
@@ -5,7 +5,7 @@
part of dart.io;
// Read the file in blocks of size 64k.
-const int _BLOCK_SIZE = 64 * 1024;
+const int _blockSize = 64 * 1024;
class _FileStream extends Stream<List<int>> {
// Stream controller.
@@ -74,7 +74,7 @@
return;
}
_readInProgress = true;
- int readBytes = _BLOCK_SIZE;
+ int readBytes = _blockSize;
if (_end != null) {
readBytes = min(readBytes, _end - _position);
if (readBytes < 0) {
@@ -147,7 +147,7 @@
if (_path != null) {
new File(_path)
- .open(mode: FileMode.READ)
+ .open(mode: FileMode.read)
.then(onOpenFile, onError: openFailed);
} else {
try {
@@ -226,7 +226,8 @@
}
Future<bool> exists() {
- return _dispatchWithNamespace(_FILE_EXISTS, [null, path]).then((response) {
+ return _dispatchWithNamespace(_IOService.fileExists, [null, path])
+ .then((response) {
if (_isErrorResponse(response)) {
throw _exceptionFromResponse(response, "Cannot check existence", path);
}
@@ -248,7 +249,8 @@
var result =
recursive ? parent.create(recursive: true) : new Future.value(null);
return result
- .then((_) => _dispatchWithNamespace(_FILE_CREATE, [null, path]))
+ .then(
+ (_) => _dispatchWithNamespace(_IOService.fileCreate, [null, path]))
.then((response) {
if (_isErrorResponse(response)) {
throw _exceptionFromResponse(response, "Cannot create file", path);
@@ -275,7 +277,8 @@
if (recursive) {
return new Directory(path).delete(recursive: true).then((_) => this);
}
- return _dispatchWithNamespace(_FILE_DELETE, [null, path]).then((response) {
+ return _dispatchWithNamespace(_IOService.fileDelete, [null, path])
+ .then((response) {
if (_isErrorResponse(response)) {
throw _exceptionFromResponse(response, "Cannot delete file", path);
}
@@ -296,7 +299,7 @@
}
Future<File> rename(String newPath) {
- return _dispatchWithNamespace(_FILE_RENAME, [null, path, newPath])
+ return _dispatchWithNamespace(_IOService.fileRename, [null, path, newPath])
.then((response) {
if (_isErrorResponse(response)) {
throw _exceptionFromResponse(
@@ -318,7 +321,7 @@
}
Future<File> copy(String newPath) {
- return _dispatchWithNamespace(_FILE_COPY, [null, path, newPath])
+ return _dispatchWithNamespace(_IOService.fileCopy, [null, path, newPath])
.then((response) {
if (_isErrorResponse(response)) {
throw _exceptionFromResponse(
@@ -336,16 +339,16 @@
return new File(newPath);
}
- Future<RandomAccessFile> open({FileMode mode: FileMode.READ}) {
- if (mode != FileMode.READ &&
- mode != FileMode.WRITE &&
- mode != FileMode.APPEND &&
- mode != FileMode.WRITE_ONLY &&
- mode != FileMode.WRITE_ONLY_APPEND) {
+ Future<RandomAccessFile> open({FileMode mode: FileMode.read}) {
+ if (mode != FileMode.read &&
+ mode != FileMode.write &&
+ mode != FileMode.append &&
+ mode != FileMode.writeOnly &&
+ mode != FileMode.writeOnlyAppend) {
return new Future.error(
new ArgumentError('Invalid file mode for this operation'));
}
- return _dispatchWithNamespace(_FILE_OPEN, [null, path, mode._mode])
+ return _dispatchWithNamespace(_IOService.fileOpen, [null, path, mode._mode])
.then((response) {
if (_isErrorResponse(response)) {
throw _exceptionFromResponse(response, "Cannot open file", path);
@@ -355,7 +358,7 @@
}
Future<int> length() {
- return _dispatchWithNamespace(_FILE_LENGTH_FROM_PATH, [null, path])
+ return _dispatchWithNamespace(_IOService.fileLengthFromPath, [null, path])
.then((response) {
if (_isErrorResponse(response)) {
throw _exceptionFromResponse(
@@ -374,7 +377,7 @@
}
Future<DateTime> lastAccessed() {
- return _dispatchWithNamespace(_FILE_LAST_ACCESSED, [null, path])
+ return _dispatchWithNamespace(_IOService.fileLastAccessed, [null, path])
.then((response) {
if (_isErrorResponse(response)) {
throw _exceptionFromResponse(
@@ -394,8 +397,8 @@
Future setLastAccessed(DateTime time) {
int millis = time.millisecondsSinceEpoch;
- return _dispatchWithNamespace(_FILE_SET_LAST_ACCESSED, [null, path, millis])
- .then((response) {
+ return _dispatchWithNamespace(
+ _IOService.fileSetLastAccessed, [null, path, millis]).then((response) {
if (_isErrorResponse(response)) {
throw _exceptionFromResponse(response, "Cannot set access time", path);
}
@@ -416,7 +419,7 @@
}
Future<DateTime> lastModified() {
- return _dispatchWithNamespace(_FILE_LAST_MODIFIED, [null, path])
+ return _dispatchWithNamespace(_IOService.fileLastModified, [null, path])
.then((response) {
if (_isErrorResponse(response)) {
throw _exceptionFromResponse(
@@ -436,8 +439,8 @@
Future setLastModified(DateTime time) {
int millis = time.millisecondsSinceEpoch;
- return _dispatchWithNamespace(_FILE_SET_LAST_MODIFIED, [null, path, millis])
- .then((response) {
+ return _dispatchWithNamespace(
+ _IOService.fileSetLastModified, [null, path, millis]).then((response) {
if (_isErrorResponse(response)) {
throw _exceptionFromResponse(
response, "Cannot set modification time", path);
@@ -460,12 +463,12 @@
external static _open(_Namespace namespace, String path, int mode);
- RandomAccessFile openSync({FileMode mode: FileMode.READ}) {
- if (mode != FileMode.READ &&
- mode != FileMode.WRITE &&
- mode != FileMode.APPEND &&
- mode != FileMode.WRITE_ONLY &&
- mode != FileMode.WRITE_ONLY_APPEND) {
+ RandomAccessFile openSync({FileMode mode: FileMode.read}) {
+ if (mode != FileMode.read &&
+ mode != FileMode.write &&
+ mode != FileMode.append &&
+ mode != FileMode.writeOnly &&
+ mode != FileMode.writeOnlyAppend) {
throw new ArgumentError('Invalid file mode for this operation');
}
var id = _open(_Namespace._namespace, path, mode._mode);
@@ -487,11 +490,11 @@
return new _FileStream(path, start, end);
}
- IOSink openWrite({FileMode mode: FileMode.WRITE, Encoding encoding: utf8}) {
- if (mode != FileMode.WRITE &&
- mode != FileMode.APPEND &&
- mode != FileMode.WRITE_ONLY &&
- mode != FileMode.WRITE_ONLY_APPEND) {
+ IOSink openWrite({FileMode mode: FileMode.write, Encoding encoding: utf8}) {
+ if (mode != FileMode.write &&
+ mode != FileMode.append &&
+ mode != FileMode.writeOnly &&
+ mode != FileMode.writeOnlyAppend) {
throw new ArgumentError('Invalid file mode for this operation');
}
var consumer = new _FileStreamConsumer(this, mode);
@@ -503,7 +506,7 @@
var builder = new BytesBuilder(copy: false);
var completer = new Completer<List<int>>();
void read() {
- file.read(_BLOCK_SIZE).then((data) {
+ file.read(_blockSize).then((data) {
if (data.length > 0) {
builder.add(data);
read();
@@ -537,7 +540,7 @@
// May be character device, try to read it in chunks.
var builder = new BytesBuilder(copy: false);
do {
- data = opened.readSync(_BLOCK_SIZE);
+ data = opened.readSync(_blockSize);
if (data.length > 0) builder.add(data);
} while (data.length > 0);
data = builder.takeBytes();
@@ -583,7 +586,7 @@
const LineSplitter().convert(readAsStringSync(encoding: encoding));
Future<File> writeAsBytes(List<int> bytes,
- {FileMode mode: FileMode.WRITE, bool flush: false}) {
+ {FileMode mode: FileMode.write, bool flush: false}) {
return open(mode: mode).then((file) {
return file.writeFrom(bytes, 0, bytes.length).then<File>((_) {
if (flush) return file.flush().then((_) => this);
@@ -593,7 +596,7 @@
}
void writeAsBytesSync(List<int> bytes,
- {FileMode mode: FileMode.WRITE, bool flush: false}) {
+ {FileMode mode: FileMode.write, bool flush: false}) {
RandomAccessFile opened = openSync(mode: mode);
try {
opened.writeFromSync(bytes, 0, bytes.length);
@@ -604,7 +607,7 @@
}
Future<File> writeAsString(String contents,
- {FileMode mode: FileMode.WRITE,
+ {FileMode mode: FileMode.write,
Encoding encoding: utf8,
bool flush: false}) {
try {
@@ -615,7 +618,7 @@
}
void writeAsStringSync(String contents,
- {FileMode mode: FileMode.WRITE,
+ {FileMode mode: FileMode.write,
Encoding encoding: utf8,
bool flush: false}) {
writeAsBytesSync(encoding.encode(contents), mode: mode, flush: flush);
@@ -686,7 +689,8 @@
}
Future<void> close() {
- return _dispatch(_FILE_CLOSE, [null], markClosed: true).then((result) {
+ return _dispatch(_IOService.fileClose, [null], markClosed: true)
+ .then((result) {
if (result == -1) {
throw new FileSystemException("Cannot close file", path);
}
@@ -706,7 +710,7 @@
}
Future<int> readByte() {
- return _dispatch(_FILE_READ_BYTE, [null]).then((response) {
+ return _dispatch(_IOService.fileReadByte, [null]).then((response) {
if (_isErrorResponse(response)) {
throw _exceptionFromResponse(response, "readByte failed", path);
}
@@ -729,7 +733,7 @@
if (bytes is! int) {
throw new ArgumentError(bytes);
}
- return _dispatch(_FILE_READ, [null, bytes]).then((response) {
+ return _dispatch(_IOService.fileRead, [null, bytes]).then((response) {
if (_isErrorResponse(response)) {
throw _exceptionFromResponse(response, "read failed", path);
}
@@ -763,7 +767,7 @@
return new Future.value(0);
}
int length = end - start;
- return _dispatch(_FILE_READ_INTO, [null, length]).then((response) {
+ return _dispatch(_IOService.fileReadInto, [null, length]).then((response) {
if (_isErrorResponse(response)) {
throw _exceptionFromResponse(response, "readInto failed", path);
}
@@ -798,7 +802,7 @@
if (value is! int) {
throw new ArgumentError(value);
}
- return _dispatch(_FILE_WRITE_BYTE, [null, value]).then((response) {
+ return _dispatch(_IOService.fileWriteByte, [null, value]).then((response) {
if (_isErrorResponse(response)) {
throw _exceptionFromResponse(response, "writeByte failed", path);
}
@@ -843,7 +847,7 @@
request[1] = result.buffer;
request[2] = result.start;
request[3] = end - (start - result.start);
- return _dispatch(_FILE_WRITE_FROM, request).then((response) {
+ return _dispatch(_IOService.fileWriteFrom, request).then((response) {
if (_isErrorResponse(response)) {
throw _exceptionFromResponse(response, "writeFrom failed", path);
}
@@ -891,7 +895,7 @@
}
Future<int> position() {
- return _dispatch(_FILE_POSITION, [null]).then((response) {
+ return _dispatch(_IOService.filePosition, [null]).then((response) {
if (_isErrorResponse(response)) {
throw _exceptionFromResponse(response, "position failed", path);
}
@@ -909,7 +913,8 @@
}
Future<RandomAccessFile> setPosition(int position) {
- return _dispatch(_FILE_SET_POSITION, [null, position]).then((response) {
+ return _dispatch(_IOService.fileSetPosition, [null, position])
+ .then((response) {
if (_isErrorResponse(response)) {
throw _exceptionFromResponse(response, "setPosition failed", path);
}
@@ -926,7 +931,7 @@
}
Future<RandomAccessFile> truncate(int length) {
- return _dispatch(_FILE_TRUNCATE, [null, length]).then((response) {
+ return _dispatch(_IOService.fileTruncate, [null, length]).then((response) {
if (_isErrorResponse(response)) {
throw _exceptionFromResponse(response, "truncate failed", path);
}
@@ -943,7 +948,7 @@
}
Future<int> length() {
- return _dispatch(_FILE_LENGTH, [null]).then((response) {
+ return _dispatch(_IOService.fileLength, [null]).then((response) {
if (_isErrorResponse(response)) {
throw _exceptionFromResponse(response, "length failed", path);
}
@@ -961,7 +966,7 @@
}
Future<RandomAccessFile> flush() {
- return _dispatch(_FILE_FLUSH, [null]).then((response) {
+ return _dispatch(_IOService.fileFlush, [null]).then((response) {
if (_isErrorResponse(response)) {
throw _exceptionFromResponse(response, "flush failed", path);
}
@@ -977,29 +982,16 @@
}
}
- static const int LOCK_UNLOCK = 0;
- static const int LOCK_SHARED = 1;
- static const int LOCK_EXCLUSIVE = 2;
- static const int LOCK_BLOCKING_SHARED = 3;
- static const int LOCK_BLOCKING_EXCLUSIVE = 4;
+ static const int lockUnlock = 0;
+ // static const int lockShared = 1;
+ // static const int lockExclusive = 2;
+ // static const int lockBlockingShared = 3;
+ // static const int lockBlockingExclusive = 4;
- int _fileLockValue(FileLock fl) {
- switch (fl) {
- case FileLock.SHARED:
- return LOCK_SHARED;
- case FileLock.EXCLUSIVE:
- return LOCK_EXCLUSIVE;
- case FileLock.BLOCKING_SHARED:
- return LOCK_BLOCKING_SHARED;
- case FileLock.BLOCKING_EXCLUSIVE:
- return LOCK_BLOCKING_EXCLUSIVE;
- default:
- return -1;
- }
- }
+ int _fileLockValue(FileLock fl) => fl._type;
Future<RandomAccessFile> lock(
- [FileLock mode = FileLock.EXCLUSIVE, int start = 0, int end = -1]) {
+ [FileLock mode = FileLock.exclusive, int start = 0, int end = -1]) {
if ((mode is! FileLock) || (start is! int) || (end is! int)) {
throw new ArgumentError();
}
@@ -1007,7 +999,8 @@
throw new ArgumentError();
}
int lock = _fileLockValue(mode);
- return _dispatch(_FILE_LOCK, [null, lock, start, end]).then((response) {
+ return _dispatch(_IOService.fileLock, [null, lock, start, end])
+ .then((response) {
if (_isErrorResponse(response)) {
throw _exceptionFromResponse(response, 'lock failed', path);
}
@@ -1022,7 +1015,7 @@
if (start == end) {
throw new ArgumentError();
}
- return _dispatch(_FILE_LOCK, [null, LOCK_UNLOCK, start, end])
+ return _dispatch(_IOService.fileLock, [null, lockUnlock, start, end])
.then((response) {
if (_isErrorResponse(response)) {
throw _exceptionFromResponse(response, 'unlock failed', path);
@@ -1032,7 +1025,7 @@
}
void lockSync(
- [FileLock mode = FileLock.EXCLUSIVE, int start = 0, int end = -1]) {
+ [FileLock mode = FileLock.exclusive, int start = 0, int end = -1]) {
_checkAvailable();
if ((mode is! FileLock) || (start is! int) || (end is! int)) {
throw new ArgumentError();
@@ -1055,7 +1048,7 @@
if (start == end) {
throw new ArgumentError();
}
- var result = _ops.lock(LOCK_UNLOCK, start, end);
+ var result = _ops.lock(lockUnlock, start, end);
if (result is OSError) {
throw new FileSystemException('unlock failed', path, result);
}
diff --git a/sdk/lib/io/file_system_entity.dart b/sdk/lib/io/file_system_entity.dart
index d66c9f4..a78e03f 100644
--- a/sdk/lib/io/file_system_entity.dart
+++ b/sdk/lib/io/file_system_entity.dart
@@ -13,22 +13,34 @@
*/
class FileSystemEntityType {
- static const FILE = const FileSystemEntityType._internal(0);
- static const DIRECTORY = const FileSystemEntityType._internal(1);
- static const LINK = const FileSystemEntityType._internal(2);
- static const NOT_FOUND = const FileSystemEntityType._internal(3);
+ static const file = const FileSystemEntityType._internal(0);
+ @Deprecated("Use file instead")
+ static const FILE = file;
+
+ static const directory = const FileSystemEntityType._internal(1);
+ @Deprecated("Use directory instead")
+ static const DIRECTORY = directory;
+
+ static const link = const FileSystemEntityType._internal(2);
+ @Deprecated("Use link instead")
+ static const LINK = link;
+
+ static const notFound = const FileSystemEntityType._internal(3);
+ @Deprecated("Use notFound instead")
+ static const NOT_FOUND = notFound;
+
static const _typeList = const [
- FileSystemEntityType.FILE,
- FileSystemEntityType.DIRECTORY,
- FileSystemEntityType.LINK,
- FileSystemEntityType.NOT_FOUND
+ FileSystemEntityType.file,
+ FileSystemEntityType.directory,
+ FileSystemEntityType.link,
+ FileSystemEntityType.notFound,
];
final int _type;
const FileSystemEntityType._internal(this._type);
static FileSystemEntityType _lookup(int type) => _typeList[type];
- String toString() => const ['FILE', 'DIRECTORY', 'LINK', 'NOT_FOUND'][_type];
+ String toString() => const ['file', 'directory', 'link', 'notFound'][_type];
}
/**
@@ -38,12 +50,12 @@
*/
class FileStat {
// These must agree with enum FileStat in file.h.
- static const _TYPE = 0;
- static const _CHANGED_TIME = 1;
- static const _MODIFIED_TIME = 2;
- static const _ACCESSED_TIME = 3;
- static const _MODE = 4;
- static const _SIZE = 5;
+ static const _type = 0;
+ static const _changedTime = 1;
+ static const _modifiedTime = 2;
+ static const _accessedTime = 3;
+ static const _mode = 4;
+ static const _size = 5;
static const _notFound = const FileStat._internalNotFound();
@@ -71,7 +83,7 @@
/**
* The type of the object (file, directory, or link).
*
- * If the call to stat() fails, the type of the returned object is NOT_FOUND.
+ * If the call to stat() fails, the type of the returned object is notFound.
*/
final FileSystemEntityType type;
@@ -95,7 +107,7 @@
: changed = null,
modified = null,
accessed = null,
- type = FileSystemEntityType.NOT_FOUND,
+ type = FileSystemEntityType.notFound,
mode = 0,
size = -1;
@@ -106,7 +118,7 @@
*
* Returns a [FileStat] object containing the data returned by stat().
* If the call fails, returns a [FileStat] object with .type set to
- * FileSystemEntityType.NOT_FOUND and the other fields invalid.
+ * FileSystemEntityType.notFound and the other fields invalid.
*/
static FileStat statSync(String path) {
final IOOverrides overrides = IOOverrides.current;
@@ -124,12 +136,12 @@
var data = _statSync(_Namespace._namespace, path);
if (data is OSError) return FileStat._notFound;
return new FileStat._internal(
- new DateTime.fromMillisecondsSinceEpoch(data[_CHANGED_TIME]),
- new DateTime.fromMillisecondsSinceEpoch(data[_MODIFIED_TIME]),
- new DateTime.fromMillisecondsSinceEpoch(data[_ACCESSED_TIME]),
- FileSystemEntityType._lookup(data[_TYPE]),
- data[_MODE],
- data[_SIZE]);
+ new DateTime.fromMillisecondsSinceEpoch(data[_changedTime]),
+ new DateTime.fromMillisecondsSinceEpoch(data[_modifiedTime]),
+ new DateTime.fromMillisecondsSinceEpoch(data[_accessedTime]),
+ FileSystemEntityType._lookup(data[_type]),
+ data[_mode],
+ data[_size]);
}
/**
@@ -137,7 +149,7 @@
*
* Returns a Future which completes with a [FileStat] object containing
* the data returned by stat(). If the call fails, completes the future with a
- * [FileStat] object with `.type` set to FileSystemEntityType.NOT_FOUND and
+ * [FileStat] object with `.type` set to FileSystemEntityType.notFound and
* the other fields invalid.
*/
static Future<FileStat> stat(String path) {
@@ -153,20 +165,20 @@
if (Platform.isWindows) {
path = FileSystemEntity._trimTrailingPathSeparators(path);
}
- return _File
- ._dispatchWithNamespace(_FILE_STAT, [null, path]).then((response) {
+ return _File._dispatchWithNamespace(_IOService.fileStat, [null, path]).then(
+ (response) {
if (_isErrorResponse(response)) {
return FileStat._notFound;
}
// Unwrap the real list from the "I'm not an error" wrapper.
List data = response[1];
return new FileStat._internal(
- new DateTime.fromMillisecondsSinceEpoch(data[_CHANGED_TIME]),
- new DateTime.fromMillisecondsSinceEpoch(data[_MODIFIED_TIME]),
- new DateTime.fromMillisecondsSinceEpoch(data[_ACCESSED_TIME]),
- FileSystemEntityType._lookup(data[_TYPE]),
- data[_MODE],
- data[_SIZE]);
+ new DateTime.fromMillisecondsSinceEpoch(data[_changedTime]),
+ new DateTime.fromMillisecondsSinceEpoch(data[_modifiedTime]),
+ new DateTime.fromMillisecondsSinceEpoch(data[_accessedTime]),
+ FileSystemEntityType._lookup(data[_type]),
+ data[_mode],
+ data[_size]);
});
}
@@ -339,7 +351,7 @@
*/
Future<String> resolveSymbolicLinks() {
return _File._dispatchWithNamespace(
- _FILE_RESOLVE_SYMBOLIC_LINKS, [null, path]).then((response) {
+ _IOService.fileResolveSymbolicLinks, [null, path]).then((response) {
if (_isErrorResponse(response)) {
throw _exceptionFromResponse(
response, "Cannot resolve symbolic links", path);
@@ -394,7 +406,7 @@
*
* If the call fails, completes the future with a [FileStat] object
* with .type set to
- * FileSystemEntityType.NOT_FOUND and the other fields invalid.
+ * FileSystemEntityType.notFound and the other fields invalid.
*/
Future<FileStat> stat() => FileStat.stat(path);
@@ -407,7 +419,7 @@
* Returns a [FileStat] object containing the data returned by stat().
*
* If the call fails, returns a [FileStat] object with .type set to
- * FileSystemEntityType.NOT_FOUND and the other fields invalid.
+ * FileSystemEntityType.notFound and the other fields invalid.
*/
FileStat statSync() => FileStat.statSync(path);
@@ -482,7 +494,7 @@
* A move event may be reported as seperate delete and create events.
*/
Stream<FileSystemEvent> watch(
- {int events: FileSystemEvent.ALL, bool recursive: false}) {
+ {int events: FileSystemEvent.all, bool recursive: false}) {
final String trimmedPath = _trimTrailingPathSeparators(path);
final IOOverrides overrides = IOOverrides.current;
if (overrides == null) {
@@ -496,7 +508,7 @@
static Future<bool> _identical(String path1, String path2) {
return _File._dispatchWithNamespace(
- _FILE_IDENTICAL, [null, path1, path2]).then((response) {
+ _IOService.fileIdentical, [null, path1, path2]).then((response) {
if (_isErrorResponse(response)) {
throw _exceptionFromResponse(response,
"Error in FileSystemEntity.identical($path1, $path2)", "");
@@ -611,11 +623,11 @@
*
* Returns a [:Future<FileSystemEntityType>:] that completes with the result.
*
- * [FileSystemEntityType] has the constant instances FILE, DIRECTORY,
- * LINK, and NOT_FOUND. [type] will return LINK only if the optional
+ * [FileSystemEntityType] has the constant instances file, directory,
+ * link, and notFound. [type] will return link only if the optional
* named argument [followLinks] is false, and [path] points to a link.
* If the path does not point to a file system object, or any other error
- * occurs in looking up the path, NOT_FOUND is returned. The only
+ * occurs in looking up the path, notFound is returned. The only
* error or exception that may be put on the returned future is ArgumentError,
* caused by passing the wrong type of arguments to the function.
*/
@@ -629,11 +641,11 @@
*
* Returns a [FileSystemEntityType].
*
- * [FileSystemEntityType] has the constant instances FILE, DIRECTORY,
- * LINK, and NOT_FOUND. [type] will return LINK only if the optional
+ * [FileSystemEntityType] has the constant instances file, directory,
+ * link, and notFound. [type] will return link only if the optional
* named argument [followLinks] is false, and [path] points to a link.
* If the path does not point to a file system object, or any other error
- * occurs in looking up the path, NOT_FOUND is returned. The only
+ * occurs in looking up the path, notFound is returned. The only
* error or exception that may be thrown is ArgumentError,
* caused by passing the wrong type of arguments to the function.
*/
@@ -642,43 +654,43 @@
}
/**
- * Checks if type(path, followLinks: false) returns FileSystemEntityType.LINK.
+ * Checks if type(path, followLinks: false) returns FileSystemEntityType.link.
*/
static Future<bool> isLink(String path) =>
- _getType(path, false).then((type) => (type == FileSystemEntityType.LINK));
+ _getType(path, false).then((type) => (type == FileSystemEntityType.link));
/**
- * Checks if type(path) returns FileSystemEntityType.FILE.
+ * Checks if type(path) returns FileSystemEntityType.file.
*/
static Future<bool> isFile(String path) =>
- _getType(path, true).then((type) => (type == FileSystemEntityType.FILE));
+ _getType(path, true).then((type) => (type == FileSystemEntityType.file));
/**
- * Checks if type(path) returns FileSystemEntityType.DIRECTORY.
+ * Checks if type(path) returns FileSystemEntityType.directory.
*/
static Future<bool> isDirectory(String path) => _getType(path, true)
- .then((type) => (type == FileSystemEntityType.DIRECTORY));
+ .then((type) => (type == FileSystemEntityType.directory));
/**
* Synchronously checks if typeSync(path, followLinks: false) returns
- * FileSystemEntityType.LINK.
+ * FileSystemEntityType.link.
*/
static bool isLinkSync(String path) =>
- (_getTypeSync(path, false) == FileSystemEntityType.LINK);
+ (_getTypeSync(path, false) == FileSystemEntityType.link);
/**
* Synchronously checks if typeSync(path) returns
- * FileSystemEntityType.FILE.
+ * FileSystemEntityType.file.
*/
static bool isFileSync(String path) =>
- (_getTypeSync(path, true) == FileSystemEntityType.FILE);
+ (_getTypeSync(path, true) == FileSystemEntityType.file);
/**
* Synchronously checks if typeSync(path) returns
- * FileSystemEntityType.DIRECTORY.
+ * FileSystemEntityType.directory.
*/
static bool isDirectorySync(String path) =>
- (_getTypeSync(path, true) == FileSystemEntityType.DIRECTORY);
+ (_getTypeSync(path, true) == FileSystemEntityType.directory);
external static _getTypeNative(
_Namespace namespace, String path, bool followLinks);
@@ -747,7 +759,7 @@
static Future<FileSystemEntityType> _getTypeRequest(
String path, bool followLinks) {
return _File._dispatchWithNamespace(
- _FILE_TYPE, [null, path, followLinks]).then((response) {
+ _IOService.fileType, [null, path, followLinks]).then((response) {
if (_isErrorResponse(response)) {
throw _exceptionFromResponse(response, "Error getting type", path);
}
@@ -811,32 +823,42 @@
/**
* Bitfield for [FileSystemEntity.watch], to enable [FileSystemCreateEvent]s.
*/
+ static const int create = 1 << 0;
+ @Deprecated("Use create instead")
static const int CREATE = 1 << 0;
/**
* Bitfield for [FileSystemEntity.watch], to enable [FileSystemModifyEvent]s.
*/
+ static const int modify = 1 << 1;
+ @Deprecated("Use modify instead")
static const int MODIFY = 1 << 1;
/**
* Bitfield for [FileSystemEntity.watch], to enable [FileSystemDeleteEvent]s.
*/
+ static const int delete = 1 << 2;
+ @Deprecated("Use delete instead")
static const int DELETE = 1 << 2;
/**
* Bitfield for [FileSystemEntity.watch], to enable [FileSystemMoveEvent]s.
*/
+ static const int move = 1 << 3;
+ @Deprecated("Use move instead")
static const int MOVE = 1 << 3;
/**
- * Bitfield for [FileSystemEntity.watch], for enabling all of [CREATE],
- * [MODIFY], [DELETE] and [MOVE].
+ * Bitfield for [FileSystemEntity.watch], for enabling all of [create],
+ * [modify], [delete] and [move].
*/
- static const int ALL = CREATE | MODIFY | DELETE | MOVE;
+ static const int all = create | modify | delete | move;
+ @Deprecated("Use all instead")
+ static const int ALL = create | modify | delete | move;
- static const int _MODIFY_ATTRIBUTES = 1 << 4;
- static const int _DELETE_SELF = 1 << 5;
- static const int _IS_DIR = 1 << 6;
+ static const int _modifyAttributes = 1 << 4;
+ static const int _deleteSelf = 1 << 5;
+ static const int _isDir = 1 << 6;
/**
* The type of event. See [FileSystemEvent] for a list of events.
@@ -856,7 +878,7 @@
*
* Note that if the file has been deleted by the time the event has arrived,
* this will always be `false` on Windows. In particular, it will always be
- * `false` for `DELETE` events.
+ * `false` for `delete` events.
*/
final bool isDirectory;
@@ -868,7 +890,7 @@
*/
class FileSystemCreateEvent extends FileSystemEvent {
FileSystemCreateEvent._(path, isDirectory)
- : super._(FileSystemEvent.CREATE, path, isDirectory);
+ : super._(FileSystemEvent.create, path, isDirectory);
String toString() => "FileSystemCreateEvent('$path')";
}
@@ -884,7 +906,7 @@
final bool contentChanged;
FileSystemModifyEvent._(path, isDirectory, this.contentChanged)
- : super._(FileSystemEvent.MODIFY, path, isDirectory);
+ : super._(FileSystemEvent.modify, path, isDirectory);
String toString() =>
"FileSystemModifyEvent('$path', contentChanged=$contentChanged)";
@@ -895,7 +917,7 @@
*/
class FileSystemDeleteEvent extends FileSystemEvent {
FileSystemDeleteEvent._(path, isDirectory)
- : super._(FileSystemEvent.DELETE, path, isDirectory);
+ : super._(FileSystemEvent.delete, path, isDirectory);
String toString() => "FileSystemDeleteEvent('$path')";
}
@@ -911,7 +933,7 @@
final String destination;
FileSystemMoveEvent._(path, isDirectory, this.destination)
- : super._(FileSystemEvent.MOVE, path, isDirectory);
+ : super._(FileSystemEvent.move, path, isDirectory);
String toString() {
var buffer = new StringBuffer();
diff --git a/sdk/lib/io/io_resource_info.dart b/sdk/lib/io/io_resource_info.dart
index 22ff562..3e29221 100644
--- a/sdk/lib/io/io_resource_info.dart
+++ b/sdk/lib/io/io_resource_info.dart
@@ -86,14 +86,14 @@
}
class _FileResourceInfo extends _ReadWriteResourceInfo {
- static const String TYPE = '_file';
+ static const String _type = '_file';
final file;
static Map<int, _FileResourceInfo> openFiles =
new Map<int, _FileResourceInfo>();
- _FileResourceInfo(this.file) : super(TYPE) {
+ _FileResourceInfo(this.file) : super(_type) {
FileOpened(this);
}
@@ -137,7 +137,7 @@
}
class _ProcessResourceInfo extends _IOResourceInfo {
- static const String TYPE = '_process';
+ static const String _type = '_process';
final process;
final double startedAt;
@@ -146,7 +146,7 @@
_ProcessResourceInfo(this.process)
: startedAt = _IOResourceInfo.timestamp,
- super(TYPE) {
+ super(_type) {
ProcessStarted(this);
}
@@ -200,16 +200,16 @@
}
class _SocketResourceInfo extends _ReadWriteResourceInfo {
- static const String TCP_STRING = 'TCP';
- static const String UDP_STRING = 'UDP';
- static const String TYPE = '_socket';
+ static const String _tcpString = 'TCP';
+ static const String _udpString = 'UDP';
+ static const String _type = '_socket';
final /*_NativeSocket|*/ socket;
static Map<int, _SocketResourceInfo> openSockets =
new Map<int, _SocketResourceInfo>();
- _SocketResourceInfo(this.socket) : super(TYPE) {
+ _SocketResourceInfo(this.socket) : super(_type) {
SocketOpened(this);
}
@@ -232,7 +232,7 @@
Map<String, dynamic> getSocketInfoMap() {
var result = fullValueMap;
- result['socketType'] = socket.isTcp ? TCP_STRING : UDP_STRING;
+ result['socketType'] = socket.isTcp ? _tcpString : _udpString;
result['listening'] = socket.isListening;
result['host'] = socket.address.host;
result['port'] = socket.port;
diff --git a/sdk/lib/io/io_service.dart b/sdk/lib/io/io_service.dart
index 0ed4439..7af382c 100644
--- a/sdk/lib/io/io_service.dart
+++ b/sdk/lib/io/io_service.dart
@@ -4,51 +4,51 @@
part of dart.io;
-// This list must be kept in sync with the list in runtime/bin/io_service.h
-const int _FILE_EXISTS = 0;
-const int _FILE_CREATE = 1;
-const int _FILE_DELETE = 2;
-const int _FILE_RENAME = 3;
-const int _FILE_COPY = 4;
-const int _FILE_OPEN = 5;
-const int _FILE_RESOLVE_SYMBOLIC_LINKS = 6;
-const int _FILE_CLOSE = 7;
-const int _FILE_POSITION = 8;
-const int _FILE_SET_POSITION = 9;
-const int _FILE_TRUNCATE = 10;
-const int _FILE_LENGTH = 11;
-const int _FILE_LENGTH_FROM_PATH = 12;
-const int _FILE_LAST_ACCESSED = 13;
-const int _FILE_SET_LAST_ACCESSED = 14;
-const int _FILE_LAST_MODIFIED = 15;
-const int _FILE_SET_LAST_MODIFIED = 16;
-const int _FILE_FLUSH = 17;
-const int _FILE_READ_BYTE = 18;
-const int _FILE_WRITE_BYTE = 19;
-const int _FILE_READ = 20;
-const int _FILE_READ_INTO = 21;
-const int _FILE_WRITE_FROM = 22;
-const int _FILE_CREATE_LINK = 23;
-const int _FILE_DELETE_LINK = 24;
-const int _FILE_RENAME_LINK = 25;
-const int _FILE_LINK_TARGET = 26;
-const int _FILE_TYPE = 27;
-const int _FILE_IDENTICAL = 28;
-const int _FILE_STAT = 29;
-const int _FILE_LOCK = 30;
-const int _SOCKET_LOOKUP = 31;
-const int _SOCKET_LIST_INTERFACES = 32;
-const int _SOCKET_REVERSE_LOOKUP = 33;
-const int _DIRECTORY_CREATE = 34;
-const int _DIRECTORY_DELETE = 35;
-const int _DIRECTORY_EXISTS = 36;
-const int _DIRECTORY_CREATE_TEMP = 37;
-const int _DIRECTORY_LIST_START = 38;
-const int _DIRECTORY_LIST_NEXT = 39;
-const int _DIRECTORY_LIST_STOP = 40;
-const int _DIRECTORY_RENAME = 41;
-const int _SSL_PROCESS_FILTER = 42;
-
class _IOService {
+ // This list must be kept in sync with the list in runtime/bin/io_service.h
+ static const int fileExists = 0;
+ static const int fileCreate = 1;
+ static const int fileDelete = 2;
+ static const int fileRename = 3;
+ static const int fileCopy = 4;
+ static const int fileOpen = 5;
+ static const int fileResolveSymbolicLinks = 6;
+ static const int fileClose = 7;
+ static const int filePosition = 8;
+ static const int fileSetPosition = 9;
+ static const int fileTruncate = 10;
+ static const int fileLength = 11;
+ static const int fileLengthFromPath = 12;
+ static const int fileLastAccessed = 13;
+ static const int fileSetLastAccessed = 14;
+ static const int fileLastModified = 15;
+ static const int fileSetLastModified = 16;
+ static const int fileFlush = 17;
+ static const int fileReadByte = 18;
+ static const int fileWriteByte = 19;
+ static const int fileRead = 20;
+ static const int fileReadInto = 21;
+ static const int fileWriteFrom = 22;
+ static const int fileCreateLink = 23;
+ static const int fileDeleteLink = 24;
+ static const int fileRenameLink = 25;
+ static const int fileLinkTarget = 26;
+ static const int fileType = 27;
+ static const int fileIdentical = 28;
+ static const int fileStat = 29;
+ static const int fileLock = 30;
+ static const int socketLookup = 31;
+ static const int socketListInterfaces = 32;
+ static const int socketReverseLookup = 33;
+ static const int directoryCreate = 34;
+ static const int directoryDelete = 35;
+ static const int directoryExists = 36;
+ static const int directoryCreateTemp = 37;
+ static const int directoryListStart = 38;
+ static const int directoryListNext = 39;
+ static const int directoryListStop = 40;
+ static const int directoryRename = 41;
+ static const int sslProcessFilter = 42;
+
external static Future _dispatch(int request, List data);
}
diff --git a/sdk/lib/io/link.dart b/sdk/lib/io/link.dart
index 42e5bca..697694f 100644
--- a/sdk/lib/io/link.dart
+++ b/sdk/lib/io/link.dart
@@ -174,8 +174,8 @@
var result =
recursive ? parent.create(recursive: true) : new Future.value(null);
return result
- .then((_) => _File
- ._dispatchWithNamespace(_FILE_CREATE_LINK, [null, path, target]))
+ .then((_) => _File._dispatchWithNamespace(
+ _IOService.fileCreateLink, [null, path, target]))
.then((response) {
if (_isErrorResponse(response)) {
throw _exceptionFromResponse(
@@ -232,8 +232,8 @@
if (recursive) {
return new Directory(path).delete(recursive: true).then((_) => this);
}
- return _File._dispatchWithNamespace(_FILE_DELETE_LINK, [null, path]).then(
- (response) {
+ return _File._dispatchWithNamespace(
+ _IOService.fileDeleteLink, [null, path]).then((response) {
if (_isErrorResponse(response)) {
throw _exceptionFromResponse(response, "Cannot delete link", path);
}
@@ -251,7 +251,7 @@
Future<Link> rename(String newPath) {
return _File._dispatchWithNamespace(
- _FILE_RENAME_LINK, [null, path, newPath]).then((response) {
+ _IOService.fileRenameLink, [null, path, newPath]).then((response) {
if (_isErrorResponse(response)) {
throw _exceptionFromResponse(
response, "Cannot rename link to '$newPath'", path);
@@ -267,8 +267,8 @@
}
Future<String> target() {
- return _File._dispatchWithNamespace(_FILE_LINK_TARGET, [null, path]).then(
- (response) {
+ return _File._dispatchWithNamespace(
+ _IOService.fileLinkTarget, [null, path]).then((response) {
if (_isErrorResponse(response)) {
throw _exceptionFromResponse(
response, "Cannot get target of link", path);
@@ -290,17 +290,17 @@
}
bool _isErrorResponse(response) {
- return response is List && response[0] != _SUCCESS_RESPONSE;
+ return response is List && response[0] != _successResponse;
}
_exceptionFromResponse(response, String message, String path) {
assert(_isErrorResponse(response));
- switch (response[_ERROR_RESPONSE_ERROR_TYPE]) {
- case _ILLEGAL_ARGUMENT_RESPONSE:
+ switch (response[_errorResponseErrorType]) {
+ case _illegalArgumentResponse:
return new ArgumentError();
- case _OSERROR_RESPONSE:
- var err = new OSError(response[_OSERROR_RESPONSE_MESSAGE],
- response[_OSERROR_RESPONSE_ERROR_CODE]);
+ case _osErrorResponse:
+ var err = new OSError(response[_osErrorResponseMessage],
+ response[_osErrorResponseErrorCode]);
return new FileSystemException(message, path, err);
default:
return new Exception("Unknown error");
diff --git a/sdk/lib/io/process.dart b/sdk/lib/io/process.dart
index 5cd5951..e1d4c23 100644
--- a/sdk/lib/io/process.dart
+++ b/sdk/lib/io/process.dart
@@ -137,19 +137,39 @@
/**
* Modes for running a new process.
*/
-enum ProcessStartMode {
+class ProcessStartMode {
/// Normal child process.
- NORMAL,
+ static const normal = const ProcessStartMode._internal(0);
+ @Deprecated("Use normal instead")
+ static const NORMAL = normal;
/// Stdio handles are inherited by the child process.
- INHERIT_STDIO,
+ static const inheritStdio = const ProcessStartMode._internal(1);
+ @Deprecated("Use inheritStdio instead")
+ static const INHERIT_STDIO = inheritStdio;
/// Detached child process with no open communication channel.
- DETACHED,
+ static const detached = const ProcessStartMode._internal(2);
+ @Deprecated("Use detached instead")
+ static const DETACHED = detached;
/// Detached child process with stdin, stdout and stderr still open
/// for communication with the child.
- DETACHED_WITH_STDIO,
+ static const detachedWithStdio = const ProcessStartMode._internal(3);
+ @Deprecated("Use detachedWithStdio instead")
+ static const DETACHED_WITH_STDIO = detachedWithStdio;
+
+ List<ProcessStartMode> get values => const <ProcessStartMode>[
+ normal,
+ inheritStdio,
+ detached,
+ detachedWithStdio
+ ];
+ String toString() =>
+ const ["normal", "inheritStdio", "detached", "detachedWithStdio"][_mode];
+
+ final int _mode;
+ const ProcessStartMode._internal(this._mode);
}
/**
@@ -311,25 +331,25 @@
* stderr.addStream(process.stderr);
* });
*
- * If [mode] is [ProcessStartMode.NORMAL] (the default) a child
+ * If [mode] is [ProcessStartMode.normal] (the default) a child
* process will be started with `stdin`, `stdout` and `stderr`
* connected.
*
- * If `mode` is [ProcessStartMode.DETACHED] a detached process will
+ * If `mode` is [ProcessStartMode.detached] a detached process will
* be created. A detached process has no connection to its parent,
* and can keep running on its own when the parent dies. The only
* information available from a detached process is its `pid`. There
* is no connection to its `stdin`, `stdout` or `stderr`, nor will
* the process' exit code become available when it terminates.
*
- * If `mode` is [ProcessStartMode.DETACHED_WITH_STDIO] a detached
+ * If `mode` is [ProcessStartMode.detachedWithStdio] a detached
* process will be created where the `stdin`, `stdout` and `stderr`
* are connected. The creator can communicate with the child through
* these. The detached process will keep running even if these
* communication channels are closed. The process' exit code will
* not become available when it terminated.
*
- * The default value for `mode` is `ProcessStartMode.NORMAL`.
+ * The default value for `mode` is `ProcessStartMode.normal`.
*/
external static Future<Process> start(
String executable, List<String> arguments,
@@ -337,7 +357,7 @@
Map<String, String> environment,
bool includeParentEnvironment: true,
bool runInShell: false,
- ProcessStartMode mode: ProcessStartMode.NORMAL});
+ ProcessStartMode mode: ProcessStartMode.normal});
/**
* Starts a process and runs it non-interactively to completion. The
@@ -364,7 +384,7 @@
*
* The encoding used for decoding `stdout` and `stderr` into text is
* controlled through [stdoutEncoding] and [stderrEncoding]. The
- * default encoding is [SYSTEM_ENCODING]. If `null` is used no
+ * default encoding is [systemEncoding]. If `null` is used no
* decoding will happen and the [ProcessResult] will hold binary
* data.
*
@@ -386,8 +406,8 @@
Map<String, String> environment,
bool includeParentEnvironment: true,
bool runInShell: false,
- Encoding stdoutEncoding: SYSTEM_ENCODING,
- Encoding stderrEncoding: SYSTEM_ENCODING});
+ Encoding stdoutEncoding: systemEncoding,
+ Encoding stderrEncoding: systemEncoding});
/**
* Starts a process and runs it to completion. This is a synchronous
@@ -404,15 +424,15 @@
Map<String, String> environment,
bool includeParentEnvironment: true,
bool runInShell: false,
- Encoding stdoutEncoding: SYSTEM_ENCODING,
- Encoding stderrEncoding: SYSTEM_ENCODING});
+ Encoding stdoutEncoding: systemEncoding,
+ Encoding stderrEncoding: systemEncoding});
/**
* Kills the process with id [pid].
*
* Where possible, sends the [signal] to the process with id
* `pid`. This includes Linux and OS X. The default signal is
- * [ProcessSignal.SIGTERM] which will normally terminate the
+ * [ProcessSignal.sigterm] which will normally terminate the
* process.
*
* On platforms without signal support, including Windows, the call
@@ -424,7 +444,7 @@
* that the process is already dead.
*/
external static bool killPid(int pid,
- [ProcessSignal signal = ProcessSignal.SIGTERM]);
+ [ProcessSignal signal = ProcessSignal.sigterm]);
/**
* Returns the standard output stream of the process as a [:Stream:].
@@ -450,7 +470,7 @@
* Kills the process.
*
* Where possible, sends the [signal] to the process. This includes
- * Linux and OS X. The default signal is [ProcessSignal.SIGTERM]
+ * Linux and OS X. The default signal is [ProcessSignal.sigterm]
* which will normally terminate the process.
*
* On platforms without signal support, including Windows, the call
@@ -461,7 +481,7 @@
* process. Otherwise the signal could not be sent, usually meaning
* that the process is already dead.
*/
- bool kill([ProcessSignal signal = ProcessSignal.SIGTERM]);
+ bool kill([ProcessSignal signal = ProcessSignal.sigterm]);
}
/**
@@ -510,35 +530,94 @@
* information.
*/
class ProcessSignal {
- static const ProcessSignal SIGHUP = const ProcessSignal._(1, "SIGHUP");
- static const ProcessSignal SIGINT = const ProcessSignal._(2, "SIGINT");
- static const ProcessSignal SIGQUIT = const ProcessSignal._(3, "SIGQUIT");
- static const ProcessSignal SIGILL = const ProcessSignal._(4, "SIGILL");
- static const ProcessSignal SIGTRAP = const ProcessSignal._(5, "SIGTRAP");
- static const ProcessSignal SIGABRT = const ProcessSignal._(6, "SIGABRT");
- static const ProcessSignal SIGBUS = const ProcessSignal._(7, "SIGBUS");
- static const ProcessSignal SIGFPE = const ProcessSignal._(8, "SIGFPE");
- static const ProcessSignal SIGKILL = const ProcessSignal._(9, "SIGKILL");
- static const ProcessSignal SIGUSR1 = const ProcessSignal._(10, "SIGUSR1");
- static const ProcessSignal SIGSEGV = const ProcessSignal._(11, "SIGSEGV");
- static const ProcessSignal SIGUSR2 = const ProcessSignal._(12, "SIGUSR2");
- static const ProcessSignal SIGPIPE = const ProcessSignal._(13, "SIGPIPE");
- static const ProcessSignal SIGALRM = const ProcessSignal._(14, "SIGALRM");
- static const ProcessSignal SIGTERM = const ProcessSignal._(15, "SIGTERM");
- static const ProcessSignal SIGCHLD = const ProcessSignal._(17, "SIGCHLD");
- static const ProcessSignal SIGCONT = const ProcessSignal._(18, "SIGCONT");
- static const ProcessSignal SIGSTOP = const ProcessSignal._(19, "SIGSTOP");
- static const ProcessSignal SIGTSTP = const ProcessSignal._(20, "SIGTSTP");
- static const ProcessSignal SIGTTIN = const ProcessSignal._(21, "SIGTTIN");
- static const ProcessSignal SIGTTOU = const ProcessSignal._(22, "SIGTTOU");
- static const ProcessSignal SIGURG = const ProcessSignal._(23, "SIGURG");
- static const ProcessSignal SIGXCPU = const ProcessSignal._(24, "SIGXCPU");
- static const ProcessSignal SIGXFSZ = const ProcessSignal._(25, "SIGXFSZ");
- static const ProcessSignal SIGVTALRM = const ProcessSignal._(26, "SIGVTALRM");
- static const ProcessSignal SIGPROF = const ProcessSignal._(27, "SIGPROF");
- static const ProcessSignal SIGWINCH = const ProcessSignal._(28, "SIGWINCH");
- static const ProcessSignal SIGPOLL = const ProcessSignal._(29, "SIGPOLL");
- static const ProcessSignal SIGSYS = const ProcessSignal._(31, "SIGSYS");
+ static const ProcessSignal sighup = const ProcessSignal._(1, "SIGHUP");
+ static const ProcessSignal sigint = const ProcessSignal._(2, "SIGINT");
+ static const ProcessSignal sigquit = const ProcessSignal._(3, "SIGQUIT");
+ static const ProcessSignal sigill = const ProcessSignal._(4, "SIGILL");
+ static const ProcessSignal sigtrap = const ProcessSignal._(5, "SIGTRAP");
+ static const ProcessSignal sigabrt = const ProcessSignal._(6, "SIGABRT");
+ static const ProcessSignal sigbus = const ProcessSignal._(7, "SIGBUS");
+ static const ProcessSignal sigfpe = const ProcessSignal._(8, "SIGFPE");
+ static const ProcessSignal sigkill = const ProcessSignal._(9, "SIGKILL");
+ static const ProcessSignal sigusr1 = const ProcessSignal._(10, "SIGUSR1");
+ static const ProcessSignal sigsegv = const ProcessSignal._(11, "SIGSEGV");
+ static const ProcessSignal sigusr2 = const ProcessSignal._(12, "SIGUSR2");
+ static const ProcessSignal sigpipe = const ProcessSignal._(13, "SIGPIPE");
+ static const ProcessSignal sigalrm = const ProcessSignal._(14, "SIGALRM");
+ static const ProcessSignal sigterm = const ProcessSignal._(15, "SIGTERM");
+ static const ProcessSignal sigchld = const ProcessSignal._(17, "SIGCHLD");
+ static const ProcessSignal sigcont = const ProcessSignal._(18, "SIGCONT");
+ static const ProcessSignal sigstop = const ProcessSignal._(19, "SIGSTOP");
+ static const ProcessSignal sigtstp = const ProcessSignal._(20, "SIGTSTP");
+ static const ProcessSignal sigttin = const ProcessSignal._(21, "SIGTTIN");
+ static const ProcessSignal sigttou = const ProcessSignal._(22, "SIGTTOU");
+ static const ProcessSignal sigurg = const ProcessSignal._(23, "SIGURG");
+ static const ProcessSignal sigxcpu = const ProcessSignal._(24, "SIGXCPU");
+ static const ProcessSignal sigxfsz = const ProcessSignal._(25, "SIGXFSZ");
+ static const ProcessSignal sigvtalrm = const ProcessSignal._(26, "SIGVTALRM");
+ static const ProcessSignal sigprof = const ProcessSignal._(27, "SIGPROF");
+ static const ProcessSignal sigwinch = const ProcessSignal._(28, "SIGWINCH");
+ static const ProcessSignal sigpoll = const ProcessSignal._(29, "SIGPOLL");
+ static const ProcessSignal sigsys = const ProcessSignal._(31, "SIGSYS");
+
+ @Deprecated("Use sighup instead")
+ static const ProcessSignal SIGHUP = sighup;
+ @Deprecated("Use sigint instead")
+ static const ProcessSignal SIGINT = sigint;
+ @Deprecated("Use sigquit instead")
+ static const ProcessSignal SIGQUIT = sigquit;
+ @Deprecated("Use sigill instead")
+ static const ProcessSignal SIGILL = sigill;
+ @Deprecated("Use sigtrap instead")
+ static const ProcessSignal SIGTRAP = sigtrap;
+ @Deprecated("Use sigabrt instead")
+ static const ProcessSignal SIGABRT = sigabrt;
+ @Deprecated("Use sigbus instead")
+ static const ProcessSignal SIGBUS = sigbus;
+ @Deprecated("Use sigfpe instead")
+ static const ProcessSignal SIGFPE = sigfpe;
+ @Deprecated("Use sigkill instead")
+ static const ProcessSignal SIGKILL = sigkill;
+ @Deprecated("Use sigusr1 instead")
+ static const ProcessSignal SIGUSR1 = sigusr1;
+ @Deprecated("Use sigsegv instead")
+ static const ProcessSignal SIGSEGV = sigsegv;
+ @Deprecated("Use sigusr2 instead")
+ static const ProcessSignal SIGUSR2 = sigusr2;
+ @Deprecated("Use sigpipe instead")
+ static const ProcessSignal SIGPIPE = sigpipe;
+ @Deprecated("Use sigalrm instead")
+ static const ProcessSignal SIGALRM = sigalrm;
+ @Deprecated("Use sigterm instead")
+ static const ProcessSignal SIGTERM = sigterm;
+ @Deprecated("Use sigchld instead")
+ static const ProcessSignal SIGCHLD = sigchld;
+ @Deprecated("Use sigcont instead")
+ static const ProcessSignal SIGCONT = sigcont;
+ @Deprecated("Use sigstop instead")
+ static const ProcessSignal SIGSTOP = sigstop;
+ @Deprecated("Use sigtstp instead")
+ static const ProcessSignal SIGTSTP = sigtstp;
+ @Deprecated("Use sigttin instead")
+ static const ProcessSignal SIGTTIN = sigttin;
+ @Deprecated("Use sigttou instead")
+ static const ProcessSignal SIGTTOU = sigttou;
+ @Deprecated("Use sigurg instead")
+ static const ProcessSignal SIGURG = sigurg;
+ @Deprecated("Use sigxcpu instead")
+ static const ProcessSignal SIGXCPU = sigxcpu;
+ @Deprecated("Use sigxfsz instead")
+ static const ProcessSignal SIGXFSZ = sigxfsz;
+ @Deprecated("Use sigvtalrm instead")
+ static const ProcessSignal SIGVTALRM = sigvtalrm;
+ @Deprecated("Use sigprof instead")
+ static const ProcessSignal SIGPROF = sigprof;
+ @Deprecated("Use sigwinch instead")
+ static const ProcessSignal SIGWINCH = sigwinch;
+ @Deprecated("Use sigpoll instead")
+ static const ProcessSignal SIGPOLL = sigpoll;
+ @Deprecated("Use sigsys instead")
+ static const ProcessSignal SIGSYS = sigsys;
final int _signalNumber;
final String _name;
@@ -552,12 +631,12 @@
*
* The following [ProcessSignal]s can be listened to:
*
- * * [ProcessSignal.SIGHUP].
- * * [ProcessSignal.SIGINT]. Signal sent by e.g. CTRL-C.
- * * [ProcessSignal.SIGTERM]. Not available on Windows.
- * * [ProcessSignal.SIGUSR1]. Not available on Windows.
- * * [ProcessSignal.SIGUSR2]. Not available on Windows.
- * * [ProcessSignal.SIGWINCH]. Not available on Windows.
+ * * [ProcessSignal.sighup].
+ * * [ProcessSignal.sigint]. Signal sent by e.g. CTRL-C.
+ * * [ProcessSignal.sigterm]. Not available on Windows.
+ * * [ProcessSignal.sigusr1]. Not available on Windows.
+ * * [ProcessSignal.sigusr2]. Not available on Windows.
+ * * [ProcessSignal.sigwinch]. Not available on Windows.
*
* Other signals are disallowed, as they may be used by the VM.
*
diff --git a/sdk/lib/io/secure_server_socket.dart b/sdk/lib/io/secure_server_socket.dart
index 5533df6..b4ca32e 100644
--- a/sdk/lib/io/secure_server_socket.dart
+++ b/sdk/lib/io/secure_server_socket.dart
@@ -25,10 +25,10 @@
* perform a [InternetAddress.lookup] and use the first value in the
* list. To listen on the loopback adapter, which will allow only
* incoming connections from the local host, use the value
- * [InternetAddress.LOOPBACK_IP_V4] or
- * [InternetAddress.LOOPBACK_IP_V6]. To allow for incoming
+ * [InternetAddress.loopbackIPv4] or
+ * [InternetAddress.loopbackIPv6]. To allow for incoming
* connection from the network use either one of the values
- * [InternetAddress.ANY_IP_V4] or [InternetAddress.ANY_IP_V6] to
+ * [InternetAddress.anyIPv4] or [InternetAddress.anyIPv6] to
* bind to all interfaces or the IP address of a specific interface.
*
* If [port] has the value [:0:] an ephemeral port will be chosen by
@@ -155,10 +155,10 @@
* perform a [InternetAddress.lookup] and use the first value in the
* list. To listen on the loopback adapter, which will allow only
* incoming connections from the local host, use the value
- * [InternetAddress.LOOPBACK_IP_V4] or
- * [InternetAddress.LOOPBACK_IP_V6]. To allow for incoming
+ * [InternetAddress.loopbackIPv4] or
+ * [InternetAddress.loopbackIPv6]. To allow for incoming
* connection from the network use either one of the values
- * [InternetAddress.ANY_IP_V4] or [InternetAddress.ANY_IP_V6] to
+ * [InternetAddress.anyIPv4] or [InternetAddress.anyIPv6] to
* bind to all interfaces or the IP address of a specific interface.
*
* If [port] has the value [:0:] an ephemeral port will be chosen by
diff --git a/sdk/lib/io/secure_socket.dart b/sdk/lib/io/secure_socket.dart
index 0262e10..9f2711b 100644
--- a/sdk/lib/io/secure_socket.dart
+++ b/sdk/lib/io/secure_socket.dart
@@ -364,21 +364,21 @@
class _RawSecureSocket extends Stream<RawSocketEvent>
implements RawSecureSocket {
// Status states
- static const int HANDSHAKE = 201;
- static const int CONNECTED = 202;
- static const int CLOSED = 203;
+ static const int handshakeStatus = 201;
+ static const int connectedStatus = 202;
+ static const int closedStatus = 203;
// Buffer identifiers.
// These must agree with those in the native C++ implementation.
- static const int READ_PLAINTEXT = 0;
- static const int WRITE_PLAINTEXT = 1;
- static const int READ_ENCRYPTED = 2;
- static const int WRITE_ENCRYPTED = 3;
- static const int NUM_BUFFERS = 4;
+ static const int readPlaintextId = 0;
+ static const int writePlaintextId = 1;
+ static const int readEncryptedId = 2;
+ static const int writeEncryptedId = 3;
+ static const int bufferCount = 4;
// Is a buffer identifier for an encrypted buffer?
static bool _isBufferEncrypted(int identifier) =>
- identifier >= READ_ENCRYPTED;
+ identifier >= readEncryptedId;
RawSocket _socket;
final Completer<_RawSecureSocket> _handshakeComplete =
@@ -395,7 +395,7 @@
final bool requireClientCertificate;
final Function onBadCertificate;
- var _status = HANDSHAKE;
+ var _status = handshakeStatus;
bool _writeEventsEnabled = true;
bool _readEventsEnabled = true;
int _pauseCount = 0;
@@ -491,10 +491,10 @@
throw new ArgumentError("Subscription passed to TLS upgrade is paused");
}
// If we are upgrading a socket that is already closed for read,
- // report an error as if we received READ_CLOSED during the handshake.
+ // report an error as if we received readClosed during the handshake.
dynamic s = _socket; // Cast to dynamic to avoid warning.
if (s._socket.closedReadEventSent) {
- _eventDispatcher(RawSocketEvent.READ_CLOSED);
+ _eventDispatcher(RawSocketEvent.readClosed);
}
_socketSubscription
..onData(_eventDispatcher)
@@ -562,13 +562,13 @@
}
int available() {
- return _status != CONNECTED
+ return _status != connectedStatus
? 0
- : _secureFilter.buffers[READ_PLAINTEXT].length;
+ : _secureFilter.buffers[readPlaintextId].length;
}
Future<RawSecureSocket> close() {
- shutdown(SocketDirection.BOTH);
+ shutdown(SocketDirection.both);
return _closeCompleter.future;
}
@@ -594,26 +594,26 @@
_socketSubscription.cancel();
}
_controller.close();
- _status = CLOSED;
+ _status = closedStatus;
}
void shutdown(SocketDirection direction) {
- if (direction == SocketDirection.SEND ||
- direction == SocketDirection.BOTH) {
+ if (direction == SocketDirection.send ||
+ direction == SocketDirection.both) {
_closedWrite = true;
if (_filterStatus.writeEmpty) {
- _socket.shutdown(SocketDirection.SEND);
+ _socket.shutdown(SocketDirection.send);
_socketClosedWrite = true;
if (_closedRead) {
_close();
}
}
}
- if (direction == SocketDirection.RECEIVE ||
- direction == SocketDirection.BOTH) {
+ if (direction == SocketDirection.receive ||
+ direction == SocketDirection.both) {
_closedRead = true;
_socketClosedRead = true;
- _socket.shutdown(SocketDirection.RECEIVE);
+ _socket.shutdown(SocketDirection.receive);
if (_socketClosedWrite) {
_close();
}
@@ -644,10 +644,10 @@
if (_closedRead) {
throw new SocketException("Reading from a closed socket");
}
- if (_status != CONNECTED) {
+ if (_status != connectedStatus) {
return null;
}
- var result = _secureFilter.buffers[READ_PLAINTEXT].read(length);
+ var result = _secureFilter.buffers[readPlaintextId].read(length);
_scheduleFilter();
return result;
}
@@ -666,12 +666,12 @@
_controller.addError(new SocketException("Writing to a closed socket"));
return 0;
}
- if (_status != CONNECTED) return 0;
+ if (_status != connectedStatus) return 0;
if (offset == null) offset = 0;
if (bytes == null) bytes = data.length - offset;
int written =
- _secureFilter.buffers[WRITE_PLAINTEXT].write(data, offset, bytes);
+ _secureFilter.buffers[writePlaintextId].write(data, offset, bytes);
if (written > 0) {
_filterStatus.writeEmpty = false;
}
@@ -698,11 +698,11 @@
void _eventDispatcher(RawSocketEvent event) {
try {
- if (event == RawSocketEvent.READ) {
+ if (event == RawSocketEvent.read) {
_readHandler();
- } else if (event == RawSocketEvent.WRITE) {
+ } else if (event == RawSocketEvent.write) {
_writeHandler();
- } else if (event == RawSocketEvent.READ_CLOSED) {
+ } else if (event == RawSocketEvent.readClosed) {
_closeHandler();
}
} catch (e, stackTrace) {
@@ -727,7 +727,7 @@
}
void _reportError(e, [StackTrace stackTrace]) {
- if (_status == CLOSED) {
+ if (_status == closedStatus) {
return;
} else if (_connectPending) {
// _connectPending is true until the handshake has completed, and the
@@ -741,19 +741,19 @@
}
void _closeHandler() {
- if (_status == CONNECTED) {
+ if (_status == connectedStatus) {
if (_closedRead) return;
_socketClosedRead = true;
if (_filterStatus.readEmpty) {
_closedRead = true;
- _controller.add(RawSocketEvent.READ_CLOSED);
+ _controller.add(RawSocketEvent.readClosed);
if (_socketClosedWrite) {
_close();
}
} else {
_scheduleFilter();
}
- } else if (_status == HANDSHAKE) {
+ } else if (_status == handshakeStatus) {
_socketClosedRead = true;
if (_filterStatus.readEmpty) {
_reportError(
@@ -781,19 +781,19 @@
{bool useSessionCache: true,
bool requestClientCertificate: false,
bool requireClientCertificate: false}) {
- if (_status != CONNECTED) {
+ if (_status != connectedStatus) {
throw new HandshakeException(
"Called renegotiate on a non-connected socket");
}
_secureFilter.renegotiate(
useSessionCache, requestClientCertificate, requireClientCertificate);
- _status = HANDSHAKE;
+ _status = handshakeStatus;
_filterStatus.writeEmpty = false;
_scheduleFilter();
}
void _secureHandshakeCompleteHandler() {
- _status = CONNECTED;
+ _status = connectedStatus;
if (_connectPending) {
_connectPending = false;
try {
@@ -838,7 +838,7 @@
}
void _tryFilter() {
- if (_status == CLOSED) {
+ if (_status == closedStatus) {
return;
}
if (_filterPending && !_filterActive) {
@@ -847,7 +847,7 @@
_pushAllFilterStages().then((status) {
_filterStatus = status;
_filterActive = false;
- if (_status == CLOSED) {
+ if (_status == closedStatus) {
_secureFilter.destroy();
_secureFilter = null;
return;
@@ -855,22 +855,22 @@
_socket.readEventsEnabled = true;
if (_filterStatus.writeEmpty && _closedWrite && !_socketClosedWrite) {
// Checks for and handles all cases of partially closed sockets.
- shutdown(SocketDirection.SEND);
- if (_status == CLOSED) {
+ shutdown(SocketDirection.send);
+ if (_status == closedStatus) {
return;
}
}
if (_filterStatus.readEmpty && _socketClosedRead && !_closedRead) {
- if (_status == HANDSHAKE) {
+ if (_status == handshakeStatus) {
_secureFilter.handshake();
- if (_status == HANDSHAKE) {
+ if (_status == handshakeStatus) {
throw new HandshakeException(
'Connection terminated during handshake');
}
}
_closeHandler();
}
- if (_status == CLOSED) {
+ if (_status == closedStatus) {
return;
}
if (_filterStatus.progress) {
@@ -887,7 +887,7 @@
if (_filterStatus.readPlaintextNoLongerEmpty) {
_scheduleReadEvent();
}
- if (_status == HANDSHAKE) {
+ if (_status == handshakeStatus) {
_secureHandshake();
}
}
@@ -916,8 +916,8 @@
}
void _readSocket() {
- if (_status == CLOSED) return;
- var buffer = _secureFilter.buffers[READ_ENCRYPTED];
+ if (_status == closedStatus) return;
+ var buffer = _secureFilter.buffers[readEncryptedId];
if (buffer.writeFromSource(_readSocketOrBufferedData) > 0) {
_filterStatus.readEmpty = false;
} else {
@@ -927,7 +927,7 @@
void _writeSocket() {
if (_socketClosedWrite) return;
- var buffer = _secureFilter.buffers[WRITE_ENCRYPTED];
+ var buffer = _secureFilter.buffers[writeEncryptedId];
if (buffer.readToSocket(_socket)) {
// Returns true if blocked
_socket.writeEventsEnabled = true;
@@ -940,7 +940,7 @@
_readEventsEnabled &&
_pauseCount == 0 &&
_secureFilter != null &&
- !_secureFilter.buffers[READ_PLAINTEXT].isEmpty) {
+ !_secureFilter.buffers[readPlaintextId].isEmpty) {
_pendingReadEvent = true;
Timer.run(_sendReadEvent);
}
@@ -948,12 +948,12 @@
_sendReadEvent() {
_pendingReadEvent = false;
- if (_status != CLOSED &&
+ if (_status != closedStatus &&
_readEventsEnabled &&
_pauseCount == 0 &&
_secureFilter != null &&
- !_secureFilter.buffers[READ_PLAINTEXT].isEmpty) {
- _controller.add(RawSocketEvent.READ);
+ !_secureFilter.buffers[readPlaintextId].isEmpty) {
+ _controller.add(RawSocketEvent.read);
_scheduleReadEvent();
}
}
@@ -964,24 +964,26 @@
_writeEventsEnabled &&
_pauseCount == 0 &&
_secureFilter != null &&
- _secureFilter.buffers[WRITE_PLAINTEXT].free > 0) {
+ _secureFilter.buffers[writePlaintextId].free > 0) {
_writeEventsEnabled = false;
- _controller.add(RawSocketEvent.WRITE);
+ _controller.add(RawSocketEvent.write);
}
}
Future<_FilterStatus> _pushAllFilterStages() {
- bool wasInHandshake = _status != CONNECTED;
- List args = new List(2 + NUM_BUFFERS * 2);
+ bool wasInHandshake = _status != connectedStatus;
+ List args = new List(2 + bufferCount * 2);
args[0] = _secureFilter._pointer();
args[1] = wasInHandshake;
var bufs = _secureFilter.buffers;
- for (var i = 0; i < NUM_BUFFERS; ++i) {
+ for (var i = 0; i < bufferCount; ++i) {
args[2 * i + 2] = bufs[i].start;
args[2 * i + 3] = bufs[i].end;
}
- return _IOService._dispatch(_SSL_PROCESS_FILTER, args).then((response) {
+ return _IOService
+ ._dispatch(_IOService.sslProcessFilter, args)
+ .then((response) {
if (response.length == 2) {
if (wasInHandshake) {
// If we're in handshake, throw a handshake error.
@@ -1000,19 +1002,19 @@
_FilterStatus status = new _FilterStatus();
// Compute writeEmpty as "write plaintext buffer and write encrypted
// buffer were empty when we started and are empty now".
- status.writeEmpty = bufs[WRITE_PLAINTEXT].isEmpty &&
- start(WRITE_ENCRYPTED) == end(WRITE_ENCRYPTED);
+ status.writeEmpty = bufs[writePlaintextId].isEmpty &&
+ start(writeEncryptedId) == end(writeEncryptedId);
// If we were in handshake when this started, _writeEmpty may be false
// because the handshake wrote data after we checked.
if (wasInHandshake) status.writeEmpty = false;
// Compute readEmpty as "both read buffers were empty when we started
// and are empty now".
- status.readEmpty = bufs[READ_ENCRYPTED].isEmpty &&
- start(READ_PLAINTEXT) == end(READ_PLAINTEXT);
+ status.readEmpty = bufs[readEncryptedId].isEmpty &&
+ start(readPlaintextId) == end(readPlaintextId);
- _ExternalBuffer buffer = bufs[WRITE_PLAINTEXT];
- int new_start = start(WRITE_PLAINTEXT);
+ _ExternalBuffer buffer = bufs[writePlaintextId];
+ int new_start = start(writePlaintextId);
if (new_start != buffer.start) {
status.progress = true;
if (buffer.free == 0) {
@@ -1020,8 +1022,8 @@
}
buffer.start = new_start;
}
- buffer = bufs[READ_ENCRYPTED];
- new_start = start(READ_ENCRYPTED);
+ buffer = bufs[readEncryptedId];
+ new_start = start(readEncryptedId);
if (new_start != buffer.start) {
status.progress = true;
if (buffer.free == 0) {
@@ -1029,8 +1031,8 @@
}
buffer.start = new_start;
}
- buffer = bufs[WRITE_ENCRYPTED];
- int new_end = end(WRITE_ENCRYPTED);
+ buffer = bufs[writeEncryptedId];
+ int new_end = end(writeEncryptedId);
if (new_end != buffer.end) {
status.progress = true;
if (buffer.length == 0) {
@@ -1038,8 +1040,8 @@
}
buffer.end = new_end;
}
- buffer = bufs[READ_PLAINTEXT];
- new_end = end(READ_PLAINTEXT);
+ buffer = bufs[readPlaintextId];
+ new_end = end(readPlaintextId);
if (new_end != buffer.end) {
status.progress = true;
if (buffer.length == 0) {
diff --git a/sdk/lib/io/socket.dart b/sdk/lib/io/socket.dart
index 7c25e2c..0ab315e 100644
--- a/sdk/lib/io/socket.dart
+++ b/sdk/lib/io/socket.dart
@@ -9,31 +9,38 @@
* IP version 4 (IPv4) and IP version 6 (IPv6) are supported.
*/
class InternetAddressType {
- static const InternetAddressType IP_V4 = const InternetAddressType._(0);
- static const InternetAddressType IP_V6 = const InternetAddressType._(1);
- static const InternetAddressType ANY = const InternetAddressType._(-1);
+ static const InternetAddressType IPv4 = const InternetAddressType._(0);
+ static const InternetAddressType IPv6 = const InternetAddressType._(1);
+ static const InternetAddressType any = const InternetAddressType._(-1);
+
+ @Deprecated("Use IPv4 instead")
+ static const InternetAddressType IP_V4 = IPv4;
+ @Deprecated("Use IPv6 instead")
+ static const InternetAddressType IP_V6 = IPv6;
+ @Deprecated("Use any instead")
+ static const InternetAddressType ANY = any;
final int _value;
const InternetAddressType._(this._value);
factory InternetAddressType._from(int value) {
- if (value == 0) return IP_V4;
- if (value == 1) return IP_V6;
+ if (value == 0) return IPv4;
+ if (value == 1) return IPv6;
throw new ArgumentError("Invalid type: $value");
}
/**
- * Get the name of the type, e.g. "IP_V4" or "IP_V6".
+ * Get the name of the type, e.g. "IPv4" or "IPv6".
*/
String get name {
switch (_value) {
case -1:
return "ANY";
case 0:
- return "IP_V4";
+ return "IPv4";
case 1:
- return "IP_V6";
+ return "IPv6";
default:
throw new ArgumentError("Invalid InternetAddress");
}
@@ -57,24 +64,32 @@
* IP version 4 loopback address. Use this address when listening on
* or connecting to the loopback adapter using IP version 4 (IPv4).
*/
+ static InternetAddress get loopbackIPv4 => LOOPBACK_IP_V4;
+ @Deprecated("Use loopbackIPv4 instead")
external static InternetAddress get LOOPBACK_IP_V4;
/**
* IP version 6 loopback address. Use this address when listening on
* or connecting to the loopback adapter using IP version 6 (IPv6).
*/
+ static InternetAddress get loopbackIPv6 => LOOPBACK_IP_V6;
+ @Deprecated("Use loopbackIPv6 instead")
external static InternetAddress get LOOPBACK_IP_V6;
/**
* IP version 4 any address. Use this address when listening on
* all adapters IP addresses using IP version 4 (IPv4).
*/
+ static InternetAddress get anyIPv4 => ANY_IP_V4;
+ @Deprecated("Use anyIPv4 instead")
external static InternetAddress get ANY_IP_V4;
/**
* IP version 6 any address. Use this address when listening on
* all adapters IP addresses using IP version 6 (IPv6).
*/
+ static InternetAddress get anyIPv6 => ANY_IP_V6;
+ @Deprecated("Use anyIPv6 instead")
external static InternetAddress get ANY_IP_V6;
/**
@@ -136,13 +151,13 @@
* Lookup a host, returning a Future of a list of
* [InternetAddress]s. If [type] is [InternetAddressType.ANY], it
* will lookup both IP version 4 (IPv4) and IP version 6 (IPv6)
- * addresses. If [type] is either [InternetAddressType.IP_V4] or
- * [InternetAddressType.IP_V6] it will only lookup addresses of the
+ * addresses. If [type] is either [InternetAddressType.IPv4] or
+ * [InternetAddressType.IPv6] it will only lookup addresses of the
* specified type. The order of the list can, and most likely will,
* change over time.
*/
external static Future<List<InternetAddress>> lookup(String host,
- {InternetAddressType type: InternetAddressType.ANY});
+ {InternetAddressType type: InternetAddressType.any});
/**
* Clones the given [address] with the new [host].
@@ -192,14 +207,14 @@
* If [includeLinkLocal] is `true`, the list of addresses of the returned
* [NetworkInterface]s, may include link local addresses. Default is `false`.
*
- * If [type] is either [InternetAddressType.IP_V4] or
- * [InternetAddressType.IP_V6] it will only lookup addresses of the
- * specified type. Default is [InternetAddressType.ANY].
+ * If [type] is either [InternetAddressType.IPv4] or
+ * [InternetAddressType.IPv6] it will only lookup addresses of the
+ * specified type. Default is [InternetAddressType.any].
*/
external static Future<List<NetworkInterface>> list(
{bool includeLoopback: false,
bool includeLinkLocal: false,
- InternetAddressType type: InternetAddressType.ANY});
+ InternetAddressType type: InternetAddressType.any});
}
/**
@@ -220,10 +235,10 @@
* perform a [InternetAddress.lookup] and use the first value in the
* list. To listen on the loopback adapter, which will allow only
* incoming connections from the local host, use the value
- * [InternetAddress.LOOPBACK_IP_V4] or
- * [InternetAddress.LOOPBACK_IP_V6]. To allow for incoming
+ * [InternetAddress.loopbackIPv4] or
+ * [InternetAddress.loopbackIPv6]. To allow for incoming
* connection from the network use either one of the values
- * [InternetAddress.ANY_IP_V4] or [InternetAddress.ANY_IP_V6] to
+ * [InternetAddress.anyIPv4] or [InternetAddress.anyIPv6] to
* bind to all interfaces or the IP address of a specific interface.
*
* If an IP version 6 (IPv6) address is used, both IP version 6
@@ -285,10 +300,10 @@
* perform a [InternetAddress.lookup] and use the first value in the
* list. To listen on the loopback adapter, which will allow only
* incoming connections from the local host, use the value
- * [InternetAddress.LOOPBACK_IP_V4] or
- * [InternetAddress.LOOPBACK_IP_V6]. To allow for incoming
+ * [InternetAddress.loopbackIPv4] or
+ * [InternetAddress.loopbackIPv6]. To allow for incoming
* connection from the network use either one of the values
- * [InternetAddress.ANY_IP_V4] or [InternetAddress.ANY_IP_V6] to
+ * [InternetAddress.anyIPv4] or [InternetAddress.anyIPv6] to
* bind to all interfaces or the IP address of a specific interface.
*
* If an IP version 6 (IPv6) address is used, both IP version 6
@@ -337,9 +352,17 @@
* [RawSocket.close] to close a socket in the specified direction(s).
*/
class SocketDirection {
- static const SocketDirection RECEIVE = const SocketDirection._(0);
- static const SocketDirection SEND = const SocketDirection._(1);
- static const SocketDirection BOTH = const SocketDirection._(2);
+ static const SocketDirection receive = const SocketDirection._(0);
+ static const SocketDirection send = const SocketDirection._(1);
+ static const SocketDirection both = const SocketDirection._(2);
+
+ @Deprecated("Use receive instead")
+ static const SocketDirection RECEIVE = receive;
+ @Deprecated("Use send instead")
+ static const SocketDirection SEND = send;
+ @Deprecated("Use both instead")
+ static const SocketDirection BOTH = both;
+
final _value;
const SocketDirection._(this._value);
@@ -352,18 +375,21 @@
*/
class SocketOption {
/**
- * Enable or disable no-delay on the socket. If TCP_NODELAY is enabled, the
+ * Enable or disable no-delay on the socket. If tcpNoDelay is enabled, the
* socket will not buffer data internally, but instead write each data chunk
* as an individual TCP packet.
*
- * TCP_NODELAY is disabled by default.
+ * tcpNoDelay is disabled by default.
*/
- static const SocketOption TCP_NODELAY = const SocketOption._(0);
+ static const SocketOption tcpNoDelay = const SocketOption._(0);
+ @Deprecated("Use tcpNoDelay instead")
+ static const SocketOption TCP_NODELAY = tcpNoDelay;
- static const SocketOption _IP_MULTICAST_LOOP = const SocketOption._(1);
- static const SocketOption _IP_MULTICAST_HOPS = const SocketOption._(2);
- static const SocketOption _IP_MULTICAST_IF = const SocketOption._(3);
- static const SocketOption _IP_BROADCAST = const SocketOption._(4);
+ static const SocketOption _ipMulticastLoop = const SocketOption._(1);
+ static const SocketOption _ipMulticastHops = const SocketOption._(2);
+ static const SocketOption _ipMulticastIf = const SocketOption._(3);
+ static const SocketOption _ipBroadcast = const SocketOption._(4);
+
final _value;
const SocketOption._(this._value);
@@ -373,19 +399,29 @@
* Events for the [RawSocket].
*/
class RawSocketEvent {
- static const RawSocketEvent READ = const RawSocketEvent._(0);
- static const RawSocketEvent WRITE = const RawSocketEvent._(1);
- static const RawSocketEvent READ_CLOSED = const RawSocketEvent._(2);
- static const RawSocketEvent CLOSED = const RawSocketEvent._(3);
+ static const RawSocketEvent read = const RawSocketEvent._(0);
+ static const RawSocketEvent write = const RawSocketEvent._(1);
+ static const RawSocketEvent readClosed = const RawSocketEvent._(2);
+ static const RawSocketEvent closed = const RawSocketEvent._(3);
+
+ @Deprecated("Use read instead")
+ static const RawSocketEvent READ = read;
+ @Deprecated("Use write instead")
+ static const RawSocketEvent WRITE = write;
+ @Deprecated("Use readClosed instead")
+ static const RawSocketEvent READ_CLOSED = readClosed;
+ @Deprecated("Use closed instead")
+ static const RawSocketEvent CLOSED = closed;
+
final int _value;
const RawSocketEvent._(this._value);
String toString() {
return const [
- 'RawSocketEvent:READ',
- 'RawSocketEvent:WRITE',
- 'RawSocketEvent:READ_CLOSED',
- 'RawSocketEvent:CLOSED'
+ 'RawSocketEvent.read',
+ 'RawSocketEvent.write',
+ 'RawSocketEvent.readClosed',
+ 'RawSocketEvent.closed'
][_value];
}
}
@@ -396,13 +432,13 @@
*/
abstract class RawSocket implements Stream<RawSocketEvent> {
/**
- * Set or get, if the [RawSocket] should listen for [RawSocketEvent.READ]
+ * Set or get, if the [RawSocket] should listen for [RawSocketEvent.read]
* events. Default is [:true:].
*/
bool readEventsEnabled;
/**
- * Set or get, if the [RawSocket] should listen for [RawSocketEvent.WRITE]
+ * Set or get, if the [RawSocket] should listen for [RawSocketEvent.write]
* events. Default is [:true:].
* This is a one-shot listener, and writeEventsEnabled must be set
* to true again to receive another write event.
@@ -486,15 +522,15 @@
*
* Calling [close] will never throw an exception
* and calling it several times is supported. Calling [close] can result in
- * a [RawSocketEvent.READ_CLOSED] event.
+ * a [RawSocketEvent.readClosed] event.
*/
Future<RawSocket> close();
/**
* Shutdown the socket in the [direction]. Calling [shutdown] will never
* throw an exception and calling it several times is supported. Calling
- * shutdown with either [SocketDirection.BOTH] or [SocketDirection.RECEIVE]
- * can result in a [RawSocketEvent.READ_CLOSED] event.
+ * shutdown with either [SocketDirection.both] or [SocketDirection.receive]
+ * can result in a [RawSocketEvent.readClosed] event.
*/
void shutdown(SocketDirection direction);
@@ -611,19 +647,19 @@
* exposing the raw events signaled by the system. It's a [Stream] of
* [RawSocketEvent]s.
*
- * Note that the event [RawSocketEvent.READ_CLOSED] will never be
+ * Note that the event [RawSocketEvent.readClosed] will never be
* received as an UDP socket cannot be closed by a remote peer.
*/
abstract class RawDatagramSocket extends Stream<RawSocketEvent> {
/**
* Set or get, if the [RawDatagramSocket] should listen for
- * [RawSocketEvent.READ] events. Default is [:true:].
+ * [RawSocketEvent.read] events. Default is [:true:].
*/
bool readEventsEnabled;
/**
* Set or get, if the [RawDatagramSocket] should listen for
- * [RawSocketEvent.WRITE] events. Default is [:true:]. This is a
+ * [RawSocketEvent.write] events. Default is [:true:]. This is a
* one-shot listener, and writeEventsEnabled must be set to true
* again to receive another write event.
*/
diff --git a/sdk/lib/io/stdio.dart b/sdk/lib/io/stdio.dart
index 09f2698..626ce7e 100644
--- a/sdk/lib/io/stdio.dart
+++ b/sdk/lib/io/stdio.dart
@@ -4,11 +4,11 @@
part of dart.io;
-const int _STDIO_HANDLE_TYPE_TERMINAL = 0;
-const int _STDIO_HANDLE_TYPE_PIPE = 1;
-const int _STDIO_HANDLE_TYPE_FILE = 2;
-const int _STDIO_HANDLE_TYPE_SOCKET = 3;
-const int _STDIO_HANDLE_TYPE_OTHER = 4;
+const int _stdioHandleTypeTerminal = 0;
+const int _stdioHandleTypePipe = 1;
+const int _stdioHandleTypeFile = 2;
+const int _stdioHandleTypeSocket = 3;
+const int _stdioHandleTypeOther = 4;
class _StdStream extends Stream<List<int>> {
final Stream<List<int>> _stream;
@@ -38,7 +38,7 @@
* line is available.
*
* The argument [encoding] can be used to changed how the input should be
- * decoded. Default is [SYSTEM_ENCODING].
+ * decoded. Default is [systemEncoding].
*
* If [retainNewlines] is `false`, the returned String will not contain the
* final newline. If `true`, the returned String will contain the line
@@ -49,13 +49,13 @@
* Returns `null` if no bytes preceded the end of input.
*/
String readLineSync(
- {Encoding encoding: SYSTEM_ENCODING, bool retainNewlines: false}) {
+ {Encoding encoding: systemEncoding, bool retainNewlines: false}) {
const CR = 13;
const LF = 10;
final List<int> line = <int>[];
// On Windows, if lineMode is disabled, only CR is received.
bool crIsNewline = Platform.isWindows &&
- (stdioType(stdin) == StdioType.TERMINAL) &&
+ (stdioType(stdin) == StdioType.terminal) &&
!lineMode;
if (retainNewlines) {
int byte;
@@ -175,7 +175,7 @@
*/
bool get hasTerminal {
try {
- return stdioType(this) == StdioType.TERMINAL;
+ return stdioType(this) == StdioType.terminal;
} on FileSystemException catch (_) {
// If stdioType throws a FileSystemException, then it is not hooked up to
// a terminal, probably because it is closed, but let other exception
@@ -358,10 +358,20 @@
/// The type of object a standard IO stream is attached to.
class StdioType {
- static const StdioType TERMINAL = const StdioType._("terminal");
- static const StdioType PIPE = const StdioType._("pipe");
- static const StdioType FILE = const StdioType._("file");
- static const StdioType OTHER = const StdioType._("other");
+ static const StdioType terminal = const StdioType._("terminal");
+ static const StdioType pipe = const StdioType._("pipe");
+ static const StdioType file = const StdioType._("file");
+ static const StdioType other = const StdioType._("other");
+
+ @Deprecated("Use terminal instead")
+ static const StdioType TERMINAL = terminal;
+ @Deprecated("Use pipe instead")
+ static const StdioType PIPE = pipe;
+ @Deprecated("Use file instead")
+ static const StdioType FILE = file;
+ @Deprecated("Use other instead")
+ static const StdioType OTHER = other;
+
final String name;
const StdioType._(this.name);
String toString() => "StdioType: $name";
@@ -416,39 +426,39 @@
} else if (object == stdout || object == stderr) {
int stdiofd = object == stdout ? _stdoutFD : _stderrFD;
switch (_StdIOUtils._getStdioHandleType(stdiofd)) {
- case _STDIO_HANDLE_TYPE_TERMINAL:
- return StdioType.TERMINAL;
- case _STDIO_HANDLE_TYPE_PIPE:
- return StdioType.PIPE;
- case _STDIO_HANDLE_TYPE_FILE:
- return StdioType.FILE;
+ case _stdioHandleTypeTerminal:
+ return StdioType.terminal;
+ case _stdioHandleTypePipe:
+ return StdioType.pipe;
+ case _stdioHandleTypeFile:
+ return StdioType.file;
}
}
if (object is _FileStream) {
- return StdioType.FILE;
+ return StdioType.file;
}
if (object is Socket) {
int socketType = _StdIOUtils._socketType(object);
- if (socketType == null) return StdioType.OTHER;
+ if (socketType == null) return StdioType.other;
switch (socketType) {
- case _STDIO_HANDLE_TYPE_TERMINAL:
- return StdioType.TERMINAL;
- case _STDIO_HANDLE_TYPE_PIPE:
- return StdioType.PIPE;
- case _STDIO_HANDLE_TYPE_FILE:
- return StdioType.FILE;
+ case _stdioHandleTypeTerminal:
+ return StdioType.terminal;
+ case _stdioHandleTypePipe:
+ return StdioType.pipe;
+ case _stdioHandleTypeFile:
+ return StdioType.file;
}
}
if (object is _IOSinkImpl) {
try {
if (object._target is _FileStreamConsumer) {
- return StdioType.FILE;
+ return StdioType.file;
}
} catch (e) {
// Only the interface implemented, _sink not available.
}
}
- return StdioType.OTHER;
+ return StdioType.other;
}
class _StdIOUtils {
diff --git a/sdk/lib/io/string_transformer.dart b/sdk/lib/io/string_transformer.dart
index fb864ad..5f4a14c 100644
--- a/sdk/lib/io/string_transformer.dart
+++ b/sdk/lib/io/string_transformer.dart
@@ -11,6 +11,8 @@
///
/// On Windows this will use the currently active code page for the
/// conversion. On all other systems it will always use UTF-8.
+const SystemEncoding systemEncoding = const SystemEncoding();
+@Deprecated("Use systemEncoding instead")
const SystemEncoding SYSTEM_ENCODING = const SystemEncoding();
/**
diff --git a/sdk/lib/js/_js_client.dart b/sdk/lib/js/_js_client.dart
index 74df24d..de25540 100644
--- a/sdk/lib/js/_js_client.dart
+++ b/sdk/lib/js/_js_client.dart
@@ -2,7 +2,7 @@
// 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' show Blob, Event, ImageData, Node, Window;
+import 'dart:html' show Blob, Event, ImageData, Node, Window, WorkerGlobalScope;
import 'dart:indexed_db' show KeyRange;
import 'dart:_js_helper' show patch;
import 'dart:_foreign_helper' show JS;
@@ -14,8 +14,9 @@
o is KeyRange ||
o is ImageData ||
o is Node ||
- o is Window;
+ o is Window ||
+ o is WorkerGlobalScope;
@patch
Object convertFromBrowserObject(dynamic o) =>
- JS('Blob|Event|KeyRange|ImageData|Node|Window', '#', o);
+ JS('Blob|Event|KeyRange|ImageData|Node|Window|WorkerGlobalScope', '#', o);
diff --git a/tests/co19/co19-dart2js.status b/tests/co19/co19-dart2js.status
index 6296cde..ceb2592 100644
--- a/tests/co19/co19-dart2js.status
+++ b/tests/co19/co19-dart2js.status
@@ -886,6 +886,7 @@
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: Pass, RuntimeError # Please triage this failure
LayoutTests/fast/sub-pixel/cssom-subpixel-precision_t01: RuntimeError # Please triage this failure
LayoutTests/fast/sub-pixel/replaced-element-baseline_t01: Pass, RuntimeError # Please triage this failure
LayoutTests/fast/table/anonymous-table-section-removed_t01: RuntimeError # Please triage this failure
@@ -6492,7 +6493,6 @@
LibTest/html/IFrameElement/getNamespacedAttributes_A01_t01: RuntimeError # Please triage this failure
LibTest/html/IFrameElement/innerHtml_A01_t01: RuntimeError # Please triage this failure
LibTest/html/IFrameElement/isContentEditable_A01_t01: RuntimeError, Pass # Fails 19 out of 20.
-LibTest/html/IFrameElement/isContentEditable_A01_t01: RuntimeError # Please triage this failure
LibTest/html/IFrameElement/leftView_A01_t01: RuntimeError # Please triage this failure
LibTest/html/IFrameElement/marginEdge_A01_t01: RuntimeError # Please triage this failure
LibTest/html/IFrameElement/offsetTo_A01_t01: RuntimeError # Please triage this failure
diff --git a/tests/co19/co19-kernel.status b/tests/co19/co19-kernel.status
index 5d636c5..d72657b 100644
--- a/tests/co19/co19-kernel.status
+++ b/tests/co19/co19-kernel.status
@@ -57,10 +57,10 @@
Language/Classes/Constructors/Constant_Constructors/initializer_not_a_constant_t01: MissingCompileTimeError
Language/Classes/Constructors/Constant_Constructors/initializer_not_a_constant_t02: MissingCompileTimeError
Language/Classes/Constructors/Constant_Constructors/invalid_constant_initializer_t02: MissingCompileTimeError
-Language/Classes/Getters/same_name_method_t03: MissingCompileTimeError
-Language/Classes/Getters/same_name_method_t04: MissingCompileTimeError
-Language/Classes/Getters/same_name_method_t05: MissingCompileTimeError
-Language/Classes/Getters/same_name_method_t07: MissingCompileTimeError
+Language/Classes/Instance_Methods/same_name_setter_t02: CompileTimeError # Issue 14736
+Language/Classes/Setters/name_t03: CompileTimeError
+Language/Classes/Setters/name_t04: CompileTimeError
+Language/Classes/Setters/name_t06: CompileTimeError
Language/Classes/Superinterfaces/more_than_once_t01: MissingCompileTimeError
Language/Classes/Superinterfaces/superclass_as_superinterface_t01: MissingCompileTimeError
Language/Classes/same_name_instance_and_static_members_t01: MissingCompileTimeError
@@ -72,9 +72,10 @@
Language/Expressions/Constants/no_other_constant_expressions_t11: MissingCompileTimeError
Language/Expressions/Constants/ternary_operator_t02: MissingCompileTimeError
Language/Expressions/Instance_Creation/Const/exception_t01: MissingCompileTimeError
+Language/Interfaces/Superinterfaces/Inheritance_and_Overriding/same_name_members_t01: CompileTimeError
+Language/Interfaces/Superinterfaces/Inheritance_and_Overriding/same_name_method_and_getter_t01: CompileTimeError
+Language/Interfaces/Superinterfaces/Inheritance_and_Overriding/same_name_method_and_getter_t02: CompileTimeError
Language/Metadata/compilation_t03: MissingCompileTimeError
-Language/Mixins/Mixin_Application/error_t01: MissingCompileTimeError
-Language/Mixins/Mixin_Application/error_t02: MissingCompileTimeError
[ $compiler == fasta && !$strong ]
Language/Classes/Constructors/Constant_Constructors/initializer_not_a_constant_t01: MissingCompileTimeError
diff --git a/tests/co19/co19-runtime.status b/tests/co19/co19-runtime.status
index 76eadd0..2dd3260 100644
--- a/tests/co19/co19-runtime.status
+++ b/tests/co19/co19-runtime.status
@@ -188,6 +188,9 @@
LibTest/collection/ListMixin/ListMixin_class_A01_t02: Skip # co19 issue 673, These tests take too much memory (300 MB) for our 1 GB test machine co19 issue 673. http://code.google.com/p/co19/issues/detail?id=673
LibTest/core/List/List_class_A01_t02: Skip # co19 issue 673, These tests take too much memory (300 MB) for our 1 GB test machine co19 issue 673. http://code.google.com/p/co19/issues/detail?id=673
+[ $arch != arm64 && $arch != simarm64 && $arch != simdbc && $arch != simdbc64 && $arch != x64 && ($runtime == dart_precompiled || $runtime == vm) ]
+LibTest/core/int/operator_left_shift_A01_t02: Fail # co19 issue 129
+
[ $arch == ia32 && $mode == release && $runtime == vm && $system == linux ]
service/dev_fs_spawn_test: Pass, Fail # Issue 28411
@@ -379,9 +382,6 @@
LibTest/typed_data/Uint64List/Uint64List.view_A01_t02: CompileTimeError # Large integer literal
WebPlatformTest/*: SkipByDesign # dart:html not supported on VM.
-[ $runtime == dart_precompiled || $runtime == vm ]
-LibTest/core/int/operator_left_shift_A01_t02: Fail # Can't represent 1 << 2147483647 without running out of memory.
-
[ $runtime == flutter || $hot_reload || $hot_reload_rollback ]
Language/Expressions/Assignment/prefix_object_t02: Skip # Requires deferred libraries
Language/Expressions/Constants/constant_constructor_t03: Skip # Requires deferred libraries
diff --git a/tests/compiler/dart2js/all_native_test.dart b/tests/compiler/dart2js/all_native_test.dart
index e1f236c..9550f03 100644
--- a/tests/compiler/dart2js/all_native_test.dart
+++ b/tests/compiler/dart2js/all_native_test.dart
@@ -9,8 +9,6 @@
main() {
asyncTest(() async {
- print('--test from ast---------------------------------------------------');
- await test([Flags.useOldFrontend]);
print('--test from kernel------------------------------------------------');
await test([]);
});
diff --git a/tests/compiler/dart2js/codegen/arithmetic_simplification_test.dart b/tests/compiler/dart2js/codegen/arithmetic_simplification_test.dart
index f213526..159d8d2 100644
--- a/tests/compiler/dart2js/codegen/arithmetic_simplification_test.dart
+++ b/tests/compiler/dart2js/codegen/arithmetic_simplification_test.dart
@@ -78,29 +78,19 @@
var timesOne = new RegExp(r"\* 1");
var oneTimes = new RegExp(r"1 \*");
- test({bool useKernel}) async {
- await compileAndDoNotMatch(INT_PLUS_ZERO, 'main', plusZero,
- useKernel: useKernel);
- await compileAndDoNotMatch(ZERO_PLUS_INT, 'main', zeroPlus,
- useKernel: useKernel);
- await compileAndMatch(NUM_PLUS_ZERO, 'main', plusZero,
- useKernel: useKernel);
- await compileAndMatch(ZERO_PLUS_NUM, 'main', zeroPlus,
- useKernel: useKernel);
- await compileAndDoNotMatch(INT_TIMES_ONE, 'main', timesOne,
- useKernel: useKernel);
- await compileAndDoNotMatch(ONE_TIMES_INT, 'main', oneTimes,
- useKernel: useKernel);
- await compileAndDoNotMatch(NUM_TIMES_ONE, 'main', timesOne,
- useKernel: useKernel);
- await compileAndDoNotMatch(ONE_TIMES_NUM, 'main', oneTimes,
- useKernel: useKernel);
+ test() async {
+ await compileAndDoNotMatch(INT_PLUS_ZERO, 'main', plusZero);
+ await compileAndDoNotMatch(ZERO_PLUS_INT, 'main', zeroPlus);
+ await compileAndMatch(NUM_PLUS_ZERO, 'main', plusZero);
+ await compileAndMatch(ZERO_PLUS_NUM, 'main', zeroPlus);
+ await compileAndDoNotMatch(INT_TIMES_ONE, 'main', timesOne);
+ await compileAndDoNotMatch(ONE_TIMES_INT, 'main', oneTimes);
+ await compileAndDoNotMatch(NUM_TIMES_ONE, 'main', timesOne);
+ await compileAndDoNotMatch(ONE_TIMES_NUM, 'main', oneTimes);
}
asyncTest(() async {
- print('--test from ast---------------------------------------------------');
- await test(useKernel: false);
print('--test from kernel------------------------------------------------');
- await test(useKernel: true);
+ await test();
});
}
diff --git a/tests/compiler/dart2js/codegen/array_static_intercept_test.dart b/tests/compiler/dart2js/codegen/array_static_intercept_test.dart
index 95bddad..f7cb5e3 100644
--- a/tests/compiler/dart2js/codegen/array_static_intercept_test.dart
+++ b/tests/compiler/dart2js/codegen/array_static_intercept_test.dart
@@ -15,9 +15,8 @@
""";
main() {
- test({bool useKernel}) async {
- await compile(TEST_ONE, entry: 'foo', useKernel: useKernel,
- check: (String generated) {
+ test() async {
+ await compile(TEST_ONE, entry: 'foo', check: (String generated) {
Expect.isTrue(generated.contains(r'.add$1('));
Expect.isTrue(generated.contains(r'.removeLast$0('));
Expect.isTrue(generated.contains(r'.length'),
@@ -26,9 +25,7 @@
}
asyncTest(() async {
- print('--test from ast---------------------------------------------------');
- await test(useKernel: false);
print('--test from kernel------------------------------------------------');
- await test(useKernel: true);
+ await test();
});
}
diff --git a/tests/compiler/dart2js/codegen/boolify_test.dart b/tests/compiler/dart2js/codegen/boolify_test.dart
index afaefc5..9f0c41b 100644
--- a/tests/compiler/dart2js/codegen/boolify_test.dart
+++ b/tests/compiler/dart2js/codegen/boolify_test.dart
@@ -17,17 +17,14 @@
""";
main() {
- test({bool useKernel}) async {
- await compile(TEST, entry: 'foo', useKernel: useKernel,
- check: (String generated) {
+ test() async {
+ await compile(TEST, entry: 'foo', check: (String generated) {
Expect.isTrue(generated.contains('foo() !== true)'));
});
}
asyncTest(() async {
- print('--test from ast---------------------------------------------------');
- await test(useKernel: false);
print('--test from kernel------------------------------------------------');
- await test(useKernel: true);
+ await test();
});
}
diff --git a/tests/compiler/dart2js/codegen/builtin_equals_test.dart b/tests/compiler/dart2js/codegen/builtin_equals_test.dart
index 9adc8fa..f60d067 100644
--- a/tests/compiler/dart2js/codegen/builtin_equals_test.dart
+++ b/tests/compiler/dart2js/codegen/builtin_equals_test.dart
@@ -18,11 +18,9 @@
""";
main() {
- test({bool useKernel}) async {
- await compile(TEST,
- entry: 'foo',
- enableTypeAssertions: true,
- useKernel: useKernel, check: (String generated) {
+ test() async {
+ await compile(TEST, entry: 'foo', enableTypeAssertions: true,
+ check: (String generated) {
Expect.isTrue(!generated.contains('eqB'));
RegExp regexp = new RegExp('==');
@@ -32,9 +30,7 @@
}
asyncTest(() async {
- print('--test from ast---------------------------------------------------');
- await test(useKernel: false);
print('--test from kernel------------------------------------------------');
- await test(useKernel: true);
+ await test();
});
}
diff --git a/tests/compiler/dart2js/codegen/builtin_interceptor_test.dart b/tests/compiler/dart2js/codegen/builtin_interceptor_test.dart
index 1384a0f..b8e7201 100644
--- a/tests/compiler/dart2js/codegen/builtin_interceptor_test.dart
+++ b/tests/compiler/dart2js/codegen/builtin_interceptor_test.dart
@@ -25,25 +25,20 @@
""";
main() {
- test({bool useKernel}) async {
- await compile(TEST_ONE, entry: 'foo', useKernel: useKernel,
- check: (String generated) {
+ test() async {
+ await compile(TEST_ONE, entry: 'foo', check: (String generated) {
Expect.isTrue(generated.contains("return 3;"));
});
- await compile(TEST_TWO, entry: 'foo', useKernel: useKernel,
- check: (String generated) {
+ await compile(TEST_TWO, entry: 'foo', check: (String generated) {
Expect.isTrue(generated.contains("return 3;"));
});
- await compile(TEST_THREE, entry: 'foo', useKernel: useKernel,
- check: (String generated) {
+ await compile(TEST_THREE, entry: 'foo', check: (String generated) {
Expect.isTrue(generated.contains("push(2);"));
});
}
asyncTest(() async {
- print('--test from ast---------------------------------------------------');
- await test(useKernel: false);
print('--test from kernel------------------------------------------------');
- await test(useKernel: true);
+ await test();
});
}
diff --git a/tests/compiler/dart2js/codegen/class_codegen2_test.dart b/tests/compiler/dart2js/codegen/class_codegen2_test.dart
index 8577b77..2fb2595 100644
--- a/tests/compiler/dart2js/codegen/class_codegen2_test.dart
+++ b/tests/compiler/dart2js/codegen/class_codegen2_test.dart
@@ -89,17 +89,15 @@
// { a: true, }. Make sure this doesn't happen again.
RegExp danglingComma = new RegExp(r',[ \n]*}');
- Future runTests(CompileMode compileMode) async {
+ Future runTests() async {
for (String test in [TEST_ONE, TEST_TWO, TEST_THREE, TEST_FOUR]) {
- String generated = await compileAll(test, compileMode: compileMode);
+ String generated = await compileAll(test);
Expect.isFalse(danglingComma.hasMatch(generated));
}
}
asyncTest(() async {
- print('--test from ast---------------------------------------------------');
- await runTests(CompileMode.memory);
print('--test from kernel------------------------------------------------');
- await runTests(CompileMode.kernel);
+ await runTests();
});
}
diff --git a/tests/compiler/dart2js/codegen/class_codegen_test.dart b/tests/compiler/dart2js/codegen/class_codegen_test.dart
index 693e934..b27fda4 100644
--- a/tests/compiler/dart2js/codegen/class_codegen_test.dart
+++ b/tests/compiler/dart2js/codegen/class_codegen_test.dart
@@ -63,45 +63,43 @@
}
""";
-twoClasses(CompileMode compileMode) async {
- String generated = await compileAll(TEST_ONE, compileMode: compileMode);
+twoClasses() async {
+ String generated = await compileAll(TEST_ONE);
Expect.isTrue(generated.contains(new RegExp('A: {[ \n]*"\\^": "Object;"')));
Expect.isTrue(generated.contains(new RegExp('B: {[ \n]*"\\^": "Object;"')));
}
-subClass(CompileMode compileMode) async {
+subClass() async {
checkOutput(String generated) {
Expect.isTrue(generated.contains(new RegExp('A: {[ \n]*"\\^": "Object;"')));
Expect.isTrue(generated.contains(new RegExp('B: {[ \n]*"\\^": "A;"')));
}
- checkOutput(await compileAll(TEST_TWO, compileMode: compileMode));
- checkOutput(await compileAll(TEST_THREE, compileMode: compileMode));
+ checkOutput(await compileAll(TEST_TWO));
+ checkOutput(await compileAll(TEST_THREE));
}
-fieldTest(CompileMode compileMode) async {
- String generated = await compileAll(TEST_FOUR, compileMode: compileMode);
+fieldTest() async {
+ String generated = await compileAll(TEST_FOUR);
Expect.isTrue(generated
.contains(new RegExp('B: {[ \n]*"\\^": "A;y,z,x",[ \n]*static:')));
}
-constructor1(CompileMode compileMode) async {
- String generated = await compileAll(TEST_FIVE, compileMode: compileMode);
+constructor1() async {
+ String generated = await compileAll(TEST_FIVE);
Expect.isTrue(generated.contains(new RegExp(r"new [$A-Z]+\.A\(a\);")));
}
main() {
- runTests(CompileMode compileMode) async {
- await twoClasses(compileMode);
- await subClass(compileMode);
- await fieldTest(compileMode);
- await constructor1(compileMode);
+ runTests() async {
+ await twoClasses();
+ await subClass();
+ await fieldTest();
+ await constructor1();
}
asyncTest(() async {
- print('--test from ast---------------------------------------------------');
- await runTests(CompileMode.memory);
print('--test from kernel------------------------------------------------');
- await runTests(CompileMode.kernel);
+ await runTests();
});
}
diff --git a/tests/compiler/dart2js/codegen/class_order_test.dart b/tests/compiler/dart2js/codegen/class_order_test.dart
index 1946305..14d79a7 100644
--- a/tests/compiler/dart2js/codegen/class_order_test.dart
+++ b/tests/compiler/dart2js/codegen/class_order_test.dart
@@ -36,18 +36,16 @@
// we just verify that their members are in the correct order.
RegExp regexp = new RegExp(r"foo\$0?:(.|\n)*bar\$0:(.|\n)*gee\$0:");
- runTests(CompileMode compileMode) async {
- String generated1 = await compileAll(TEST_ONE, compileMode: compileMode);
+ runTests() async {
+ String generated1 = await compileAll(TEST_ONE);
Expect.isTrue(regexp.hasMatch(generated1));
- String generated2 = await compileAll(TEST_TWO, compileMode: compileMode);
+ String generated2 = await compileAll(TEST_TWO);
Expect.isTrue(regexp.hasMatch(generated2));
}
asyncTest(() async {
- print('--test from ast---------------------------------------------------');
- await runTests(CompileMode.memory);
print('--test from kernel------------------------------------------------');
- await runTests(CompileMode.kernel);
+ await runTests();
});
}
diff --git a/tests/compiler/dart2js/codegen/closure_codegen_test.dart b/tests/compiler/dart2js/codegen/closure_codegen_test.dart
index 07650a2..927d023 100644
--- a/tests/compiler/dart2js/codegen/closure_codegen_test.dart
+++ b/tests/compiler/dart2js/codegen/closure_codegen_test.dart
@@ -41,47 +41,37 @@
main() { new A().foo(1); }
""";
-Future closureInvocation({bool useKernel, bool minify, String prefix}) async {
- await compile(TEST_INVOCATION0, useKernel: useKernel, minify: minify,
- check: (String generated) {
+Future closureInvocation({bool minify, String prefix}) async {
+ await compile(TEST_INVOCATION0, minify: minify, check: (String generated) {
Expect.isTrue(generated.contains(".$prefix\$0()"));
});
- await compile(TEST_INVOCATION1, useKernel: useKernel, minify: minify,
- check: (String generated) {
+ await compile(TEST_INVOCATION1, minify: minify, check: (String generated) {
Expect.isTrue(generated.contains(".$prefix\$1(1)"));
});
- await compile(TEST_INVOCATION2, useKernel: useKernel, minify: minify,
- check: (String generated) {
+ await compile(TEST_INVOCATION2, minify: minify, check: (String generated) {
Expect.isTrue(generated.contains(".$prefix\$2(1,${minify ? "" : " "}2)"));
});
}
// Make sure that the bailout version does not introduce a second version of
// the closure.
-Future closureBailout(CompileMode compileMode,
- {bool minify, String prefix}) async {
- String generated =
- await compileAll(TEST_BAILOUT, compileMode: compileMode, minify: minify);
+Future closureBailout({bool minify, String prefix}) async {
+ String generated = await compileAll(TEST_BAILOUT, minify: minify);
RegExp regexp = new RegExp("$prefix\\\$0:${minify ? "" : " "}function");
Iterator<Match> matches = regexp.allMatches(generated).iterator;
checkNumberOfMatches(matches, 1);
}
main() {
- runTests({bool useKernel}) async {
- await closureInvocation(
- useKernel: useKernel, minify: false, prefix: "call");
- await closureInvocation(useKernel: useKernel, minify: true, prefix: "");
- CompileMode compileMode =
- useKernel ? CompileMode.kernel : CompileMode.memory;
- await closureBailout(compileMode, minify: false, prefix: "call");
- await closureBailout(compileMode, minify: true, prefix: "");
+ runTests() async {
+ await closureInvocation(minify: false, prefix: "call");
+ await closureInvocation(minify: true, prefix: "");
+ await closureBailout(minify: false, prefix: "call");
+ await closureBailout(minify: true, prefix: "");
}
asyncTest(() async {
- print('--test from ast---------------------------------------------------');
- await runTests(useKernel: false);
print('--test from kernel------------------------------------------------');
- await runTests(useKernel: true);
+ await runTests();
});
}
diff --git a/tests/compiler/dart2js/codegen/code_motion_test.dart b/tests/compiler/dart2js/codegen/code_motion_test.dart
index f800e33..b727164 100644
--- a/tests/compiler/dart2js/codegen/code_motion_test.dart
+++ b/tests/compiler/dart2js/codegen/code_motion_test.dart
@@ -22,9 +22,8 @@
""";
main() {
- runTest({bool useKernel}) async {
- await compile(TEST_ONE, useKernel: useKernel, entry: 'foo',
- check: (String generated) {
+ runTest() async {
+ await compile(TEST_ONE, entry: 'foo', check: (String generated) {
RegExp regexp = new RegExp('a \\+ b');
Iterator matches = regexp.allMatches(generated).iterator;
Expect.isTrue(matches.moveNext());
@@ -33,9 +32,7 @@
}
asyncTest(() async {
- print('--test from ast---------------------------------------------------');
- await runTest(useKernel: false);
print('--test from kernel------------------------------------------------');
- await runTest(useKernel: true);
+ await runTest();
});
}
diff --git a/tests/compiler/dart2js/codegen/constant_folding_codeUnitAt_test.dart b/tests/compiler/dart2js/codegen/constant_folding_codeUnitAt_test.dart
index d576b64..74dda1b 100644
--- a/tests/compiler/dart2js/codegen/constant_folding_codeUnitAt_test.dart
+++ b/tests/compiler/dart2js/codegen/constant_folding_codeUnitAt_test.dart
@@ -33,21 +33,15 @@
""";
main() {
- runTests({bool useKernel}) async {
- await compileAndMatch(TEST_1, 'foo', new RegExp(r'return 72'),
- useKernel: useKernel);
- await compileAndDoNotMatch(TEST_1, 'foo', new RegExp(r'Hello'),
- useKernel: useKernel);
- await compileAndMatch(TEST_2, 'foo', new RegExp(r'Hello'),
- useKernel: useKernel);
- await compileAndMatch(TEST_3, 'foo', new RegExp(r'Hello'),
- useKernel: useKernel);
+ runTests() async {
+ await compileAndMatch(TEST_1, 'foo', new RegExp(r'return 72'));
+ await compileAndDoNotMatch(TEST_1, 'foo', new RegExp(r'Hello'));
+ await compileAndMatch(TEST_2, 'foo', new RegExp(r'Hello'));
+ await compileAndMatch(TEST_3, 'foo', new RegExp(r'Hello'));
}
asyncTest(() async {
- print('--test from ast---------------------------------------------------');
- await runTests(useKernel: false);
print('--test from kernel------------------------------------------------');
- await runTests(useKernel: true);
+ await runTests();
});
}
diff --git a/tests/compiler/dart2js/codegen/constant_folding_test.dart b/tests/compiler/dart2js/codegen/constant_folding_test.dart
index 80bcac7..c6d0a58 100644
--- a/tests/compiler/dart2js/codegen/constant_folding_test.dart
+++ b/tests/compiler/dart2js/codegen/constant_folding_test.dart
@@ -57,14 +57,11 @@
""";
main() {
- runTests({bool useKernel}) async {
- await compileAndMatch(NUMBER_FOLDING, 'main', new RegExp(r"print\(7\)"),
- useKernel: useKernel);
+ runTests() async {
+ await compileAndMatch(NUMBER_FOLDING, 'main', new RegExp(r"print\(7\)"));
await compileAndMatch(
- NEGATIVE_NUMBER_FOLDING, 'main', new RegExp(r"print\(1\)"),
- useKernel: useKernel);
- await compile(NULL_EQUALS_FOLDING, useKernel: useKernel, entry: 'foo',
- check: (String generated) {
+ NEGATIVE_NUMBER_FOLDING, 'main', new RegExp(r"print\(1\)"));
+ await compile(NULL_EQUALS_FOLDING, entry: 'foo', check: (String generated) {
RegExp regexp = new RegExp(r'a == null');
Expect.isTrue(regexp.hasMatch(generated));
@@ -77,23 +74,17 @@
regexp = new RegExp('"foo" === d');
Expect.isTrue(regexp.hasMatch(generated));
});
- await compileAndMatch(LIST_LENGTH_FOLDING, 'foo', new RegExp(r"return 3"),
- useKernel: useKernel);
- await compileAndMatch(LIST_INDEX_FOLDING, 'foo', new RegExp(r"return 1"),
- useKernel: useKernel);
- await compileAndDoNotMatch(LIST_INDEX_FOLDING, 'foo', new RegExp(r"ioore"),
- useKernel: useKernel);
- await compileAndMatch(STRING_LENGTH_FOLDING, 'foo', new RegExp(r"return 3"),
- useKernel: useKernel);
+ await compileAndMatch(LIST_LENGTH_FOLDING, 'foo', new RegExp(r"return 3"));
+ await compileAndMatch(LIST_INDEX_FOLDING, 'foo', new RegExp(r"return 1"));
+ await compileAndDoNotMatch(LIST_INDEX_FOLDING, 'foo', new RegExp(r"ioore"));
await compileAndMatch(
- RANGE_ERROR_INDEX_FOLDING, 'foo', new RegExp(r"ioore"),
- useKernel: useKernel);
+ STRING_LENGTH_FOLDING, 'foo', new RegExp(r"return 3"));
+ await compileAndMatch(
+ RANGE_ERROR_INDEX_FOLDING, 'foo', new RegExp(r"ioore"));
}
asyncTest(() async {
- print('--test from ast---------------------------------------------------');
- await runTests(useKernel: false);
print('--test from kernel------------------------------------------------');
- await runTests(useKernel: true);
+ await runTests();
});
}
diff --git a/tests/compiler/dart2js/codegen/constant_namer_test.dart b/tests/compiler/dart2js/codegen/constant_namer_test.dart
index 14d93ce..3a491f9 100644
--- a/tests/compiler/dart2js/codegen/constant_namer_test.dart
+++ b/tests/compiler/dart2js/codegen/constant_namer_test.dart
@@ -27,9 +27,8 @@
Expect.isTrue(generated.contains(text), text);
}
- runTests({bool useKernel}) async {
- String generated =
- await compile(TEST_ONE, useKernel: useKernel, entry: 'test');
+ runTests() async {
+ String generated = await compile(TEST_ONE, entry: 'test');
check(generated, '.List_12_53.');
check(generated, '.Token_start_null.');
check(generated, '.Token_end_null.');
@@ -38,9 +37,7 @@
}
asyncTest(() async {
- print('--test from ast---------------------------------------------------');
- await runTests(useKernel: false);
print('--test from kernel------------------------------------------------');
- await runTests(useKernel: true);
+ await runTests();
});
}
diff --git a/tests/compiler/dart2js/codegen/dead_code_test.dart b/tests/compiler/dart2js/codegen/dead_code_test.dart
index 56f42d1..d62af18 100644
--- a/tests/compiler/dart2js/codegen/dead_code_test.dart
+++ b/tests/compiler/dart2js/codegen/dead_code_test.dart
@@ -17,16 +17,13 @@
''';
main() {
- runTest({bool useKernel}) async {
- String generated = await compileAll(TEST,
- compileMode: useKernel ? CompileMode.kernel : CompileMode.memory);
+ runTest() async {
+ String generated = await compileAll(TEST);
Expect.isFalse(generated.contains('return 42'), 'dead code not eliminated');
}
asyncTest(() async {
- print('--test from ast---------------------------------------------------');
- await runTest(useKernel: false);
print('--test from kernel------------------------------------------------');
- await runTest(useKernel: true);
+ await runTest();
});
}
diff --git a/tests/compiler/dart2js/codegen/dead_phi_eliminator_test.dart b/tests/compiler/dart2js/codegen/dead_phi_eliminator_test.dart
index aa5597e..d6627b3 100644
--- a/tests/compiler/dart2js/codegen/dead_phi_eliminator_test.dart
+++ b/tests/compiler/dart2js/codegen/dead_phi_eliminator_test.dart
@@ -18,18 +18,15 @@
""";
main() {
- runTest({bool useKernel}) async {
- await compile(TEST_ONE, useKernel: useKernel, entry: 'foo',
- check: (String generated) {
+ runTest() async {
+ await compile(TEST_ONE, entry: 'foo', check: (String generated) {
RegExp regexp = new RegExp("toBeRemoved");
Expect.isTrue(!regexp.hasMatch(generated));
});
}
asyncTest(() async {
- print('--test from ast---------------------------------------------------');
- await runTest(useKernel: false);
print('--test from kernel------------------------------------------------');
- await runTest(useKernel: true);
+ await runTest();
});
}
diff --git a/tests/compiler/dart2js/codegen/declare_once_test.dart b/tests/compiler/dart2js/codegen/declare_once_test.dart
index 68e0036..b1d9cbb 100644
--- a/tests/compiler/dart2js/codegen/declare_once_test.dart
+++ b/tests/compiler/dart2js/codegen/declare_once_test.dart
@@ -11,7 +11,7 @@
// For a function with only one variable we declare it inline for more
// compactness. Test that we don't also declare it at the start of the
// method.
- runTest({bool useKernel}) async {
+ runTest() async {
String generated = await compile(
'final List a = const ["bar", "baz"];'
'int foo() {'
@@ -19,7 +19,6 @@
' print(a[i]);'
' }'
'}',
- useKernel: useKernel,
entry: 'foo',
minify: false);
RegExp re = new RegExp(r"var ");
@@ -29,9 +28,7 @@
}
asyncTest(() async {
- print('--test from ast---------------------------------------------------');
- await runTest(useKernel: false);
print('--test from kernel------------------------------------------------');
- await runTest(useKernel: true);
+ await runTest();
});
}
diff --git a/tests/compiler/dart2js/codegen/elide_callthrough_stub_test.dart b/tests/compiler/dart2js/codegen/elide_callthrough_stub_test.dart
index f7a3db9..c315c66 100644
--- a/tests/compiler/dart2js/codegen/elide_callthrough_stub_test.dart
+++ b/tests/compiler/dart2js/codegen/elide_callthrough_stub_test.dart
@@ -38,10 +38,8 @@
''';
main() {
- runTests({bool useKernel}) async {
- CompileMode compileMode =
- useKernel ? CompileMode.kernel : CompileMode.memory;
- String generated1 = await compileAll(TEST1, compileMode: compileMode);
+ runTests() async {
+ String generated1 = await compileAll(TEST1);
// Direct call through field.
Expect.isTrue(generated1.contains(r'this._fun.call$1(zzz)'));
// No stub.
@@ -49,7 +47,7 @@
// No call to stub.
Expect.isFalse(generated1.contains(r'_fun$1('));
- String generated2 = await compileAll(TEST2, compileMode: compileMode);
+ String generated2 = await compileAll(TEST2);
// No call through field.
Expect.isFalse(generated2.contains(r'this._fun.call$1(zzz)'));
// Call through stub.
@@ -61,9 +59,7 @@
}
asyncTest(() async {
- print('--test from ast---------------------------------------------------');
- await runTests(useKernel: false);
print('--test from kernel------------------------------------------------');
- await runTests(useKernel: true);
+ await runTests();
});
}
diff --git a/tests/compiler/dart2js/codegen/emit_const_fields_test.dart b/tests/compiler/dart2js/codegen/emit_const_fields_test.dart
index 8a7eea4..abc960f 100644
--- a/tests/compiler/dart2js/codegen/emit_const_fields_test.dart
+++ b/tests/compiler/dart2js/codegen/emit_const_fields_test.dart
@@ -19,17 +19,14 @@
""";
main() {
- runTest({bool useKernel}) async {
- String generated = await compileAll(TEST_GUIDE,
- compileMode: useKernel ? CompileMode.kernel : CompileMode.memory);
+ runTest() async {
+ String generated = await compileAll(TEST_GUIDE);
Expect.isTrue(generated.contains("42"));
Expect.isFalse(generated.contains("TITLE"));
}
asyncTest(() async {
- print('--test from ast---------------------------------------------------');
- await runTest(useKernel: false);
print('--test from kernel------------------------------------------------');
- await runTest(useKernel: true);
+ await runTest();
});
}
diff --git a/tests/compiler/dart2js/codegen/expect_annotations2_test.dart b/tests/compiler/dart2js/codegen/expect_annotations2_test.dart
index 81d8a0a..3ceca1c 100644
--- a/tests/compiler/dart2js/codegen/expect_annotations2_test.dart
+++ b/tests/compiler/dart2js/codegen/expect_annotations2_test.dart
@@ -5,7 +5,6 @@
import "package:expect/expect.dart";
import "package:async_helper/async_helper.dart";
import 'package:compiler/compiler_new.dart';
-import 'package:compiler/src/commandline_options.dart';
import '../memory_compiler.dart';
const MEMORY_SOURCE_FILES = const {
@@ -37,12 +36,10 @@
};
void main() {
- runTest({bool useKernel}) async {
+ runTest() async {
OutputCollector collector = new OutputCollector();
await runCompiler(
- memorySourceFiles: MEMORY_SOURCE_FILES,
- outputProvider: collector,
- options: useKernel ? [] : [Flags.useOldFrontend]);
+ memorySourceFiles: MEMORY_SOURCE_FILES, outputProvider: collector);
// Simply check that the constants of the small functions are still in the
// output, and that we don't see the result of constant folding.
String jsOutput = collector.getOutput('', OutputType.js);
@@ -57,9 +54,7 @@
}
asyncTest(() async {
- print('--test from ast---------------------------------------------------');
- await runTest(useKernel: false);
print('--test from kernel------------------------------------------------');
- await runTest(useKernel: true);
+ await runTest();
});
}
diff --git a/tests/compiler/dart2js/codegen/expect_annotations_test.dart b/tests/compiler/dart2js/codegen/expect_annotations_test.dart
index 89619b6..bff2af5 100644
--- a/tests/compiler/dart2js/codegen/expect_annotations_test.dart
+++ b/tests/compiler/dart2js/codegen/expect_annotations_test.dart
@@ -4,7 +4,6 @@
import 'package:expect/expect.dart';
import 'package:async_helper/async_helper.dart';
-import 'package:compiler/src/commandline_options.dart';
import 'package:compiler/src/compiler.dart';
import 'package:compiler/src/elements/entities.dart';
import 'package:compiler/src/js_backend/annotations.dart' as optimizerHints;
@@ -50,17 +49,14 @@
main() {
asyncTest(() async {
- print('--test from ast---------------------------------------------------');
- await runTest(useKernel: false);
print('--test from kernel------------------------------------------------');
- await runTest(useKernel: true);
+ await runTest();
});
}
-runTest({bool useKernel}) async {
- CompilationResult result = await runCompiler(
- memorySourceFiles: MEMORY_SOURCE_FILES,
- options: useKernel ? [] : [Flags.useOldFrontend]);
+runTest() async {
+ CompilationResult result =
+ await runCompiler(memorySourceFiles: MEMORY_SOURCE_FILES);
Compiler compiler = result.compiler;
ClosedWorld closedWorld = compiler.backendClosedWorldForTesting;
Expect.isFalse(compiler.compilationFailed, 'Unsuccessful compilation');
@@ -117,12 +113,12 @@
method, expectedParameterType, expectedReturnType, inferrer);
} else if (expectAssumeDynamic) {
testTypeMatch(
- method, closedWorld.commonMasks.dynamicType, null, inferrer);
+ method, closedWorld.abstractValueDomain.dynamicType, null, inferrer);
}
}
- TypeMask jsStringType = closedWorld.commonMasks.stringType;
- TypeMask jsIntType = closedWorld.commonMasks.intType;
+ TypeMask jsStringType = closedWorld.abstractValueDomain.stringType;
+ TypeMask jsIntType = closedWorld.abstractValueDomain.intType;
TypeMask coreStringType =
new TypeMask.subtype(closedWorld.commonElements.stringClass, closedWorld);
diff --git a/tests/compiler/dart2js/codegen/field_codegen_test.dart b/tests/compiler/dart2js/codegen/field_codegen_test.dart
index e77a1c2..46229f7 100644
--- a/tests/compiler/dart2js/codegen/field_codegen_test.dart
+++ b/tests/compiler/dart2js/codegen/field_codegen_test.dart
@@ -20,21 +20,16 @@
""";
main() {
- runTests({bool useKernel}) async {
- CompileMode compileMode =
- useKernel ? CompileMode.kernel : CompileMode.memory;
-
- String generated1 = await compileAll(TEST_NULL0, compileMode: compileMode);
+ runTests() async {
+ String generated1 = await compileAll(TEST_NULL0);
Expect.isTrue(generated1.contains("null"));
- String generated2 = await compileAll(TEST_NULL1, compileMode: compileMode);
+ String generated2 = await compileAll(TEST_NULL1);
Expect.isTrue(generated2.contains("null"));
}
asyncTest(() async {
- print('--test from ast---------------------------------------------------');
- await runTests(useKernel: false);
print('--test from kernel------------------------------------------------');
- await runTests(useKernel: true);
+ await runTests();
});
}
diff --git a/tests/compiler/dart2js/codegen/field_update_test.dart b/tests/compiler/dart2js/codegen/field_update_test.dart
index 8f809b5..6e24a0b 100644
--- a/tests/compiler/dart2js/codegen/field_update_test.dart
+++ b/tests/compiler/dart2js/codegen/field_update_test.dart
@@ -82,18 +82,14 @@
main() {
asyncTest(() async {
- print('--test from ast---------------------------------------------------');
- await runTests(useKernel: false);
print('--test from kernel------------------------------------------------');
- await runTests(useKernel: true);
+ await runTests();
});
}
-runTests({bool useKernel}) async {
+runTests() async {
test(String code, Function f) async {
- String generated = await compileAll(code,
- disableInlining: true,
- compileMode: useKernel ? CompileMode.kernel : CompileMode.memory);
+ String generated = await compileAll(code, disableInlining: true);
Expect.isTrue(f(generated));
}
diff --git a/tests/compiler/dart2js/codegen/for_in_test.dart b/tests/compiler/dart2js/codegen/for_in_test.dart
index 2ae009d..0bf5b31 100644
--- a/tests/compiler/dart2js/codegen/for_in_test.dart
+++ b/tests/compiler/dart2js/codegen/for_in_test.dart
@@ -28,19 +28,17 @@
""";
main() {
- runTests({bool useKernel}) async {
+ runTests() async {
await compile(TEST_ONE, entry: 'foo', check: (String generated) {
Expect.isTrue(!generated.contains(r'break'));
- }, useKernel: useKernel);
+ });
await compile(TEST_TWO, entry: 'foo', check: (String generated) {
Expect.isTrue(generated.contains(r'continue'));
- }, useKernel: useKernel);
+ });
}
asyncTest(() async {
- print('--test from ast---------------------------------------------------');
- await runTests(useKernel: false);
print('--test from kernel------------------------------------------------');
- await runTests(useKernel: true);
+ await runTests();
});
}
diff --git a/tests/compiler/dart2js/codegen/forloop_box_test.dart b/tests/compiler/dart2js/codegen/forloop_box_test.dart
index 915cbf4..3651aae 100644
--- a/tests/compiler/dart2js/codegen/forloop_box_test.dart
+++ b/tests/compiler/dart2js/codegen/forloop_box_test.dart
@@ -40,17 +40,12 @@
''';
main() {
- runTests({bool useKernel}) async {
- CompileMode compileMode =
- useKernel ? CompileMode.kernel : CompileMode.memory;
-
- String generated1 =
- await compileAll(SHOULD_NOT_BE_BOXED_TEST, compileMode: compileMode);
+ runTests() async {
+ String generated1 = await compileAll(SHOULD_NOT_BE_BOXED_TEST);
Expect.isTrue(generated1.contains('main_closure(i)'),
'for-loop variable should not have been boxed');
- String generated2 =
- await compileAll(SHOULD_BE_BOXED_TEST, compileMode: compileMode);
+ String generated2 = await compileAll(SHOULD_BE_BOXED_TEST);
Expect.isFalse(generated2.contains('main_closure(i)'),
'for-loop variable should have been boxed');
@@ -62,9 +57,7 @@
}
asyncTest(() async {
- print('--test from ast---------------------------------------------------');
- await runTests(useKernel: false);
print('--test from kernel------------------------------------------------');
- await runTests(useKernel: true);
+ await runTests();
});
}
diff --git a/tests/compiler/dart2js/codegen/generate_at_use_site_test.dart b/tests/compiler/dart2js/codegen/generate_at_use_site_test.dart
index a7e3bf48..afb890f 100644
--- a/tests/compiler/dart2js/codegen/generate_at_use_site_test.dart
+++ b/tests/compiler/dart2js/codegen/generate_at_use_site_test.dart
@@ -50,16 +50,13 @@
""";
main() {
- runTests({bool useKernel}) async {
+ runTests() async {
// Make sure we don't introduce a new variable.
- await compileAndDoNotMatch(FIB, 'fib', new RegExp("var $anyIdentifier ="),
- useKernel: useKernel);
+ await compileAndDoNotMatch(FIB, 'fib', new RegExp("var $anyIdentifier ="));
- await compileAndDoNotMatch(BAR, 'bar', new RegExp("isLeaf"),
- useKernel: useKernel);
+ await compileAndDoNotMatch(BAR, 'bar', new RegExp("isLeaf"));
- await compile(TEST, entry: 'foo', useKernel: useKernel,
- check: (String generated) {
+ await compile(TEST, entry: 'foo', check: (String generated) {
Expect.isFalse(generated.contains('else'));
// Regression check to ensure that there is no floating variable
// expression.
@@ -68,9 +65,7 @@
}
asyncTest(() async {
- print('--test from ast---------------------------------------------------');
- await runTests(useKernel: false);
print('--test from kernel------------------------------------------------');
- await runTests(useKernel: true);
+ await runTests();
});
}
diff --git a/tests/compiler/dart2js/codegen/gvn_dynamic_field_get_test.dart b/tests/compiler/dart2js/codegen/gvn_dynamic_field_get_test.dart
index f9381f8..591d3ad 100644
--- a/tests/compiler/dart2js/codegen/gvn_dynamic_field_get_test.dart
+++ b/tests/compiler/dart2js/codegen/gvn_dynamic_field_get_test.dart
@@ -8,7 +8,6 @@
import 'package:async_helper/async_helper.dart';
import '../compiler_helper.dart';
import 'package:compiler/compiler_new.dart';
-import 'package:compiler/src/commandline_options.dart';
import 'package:compiler/src/compiler.dart';
import 'package:compiler/src/elements/names.dart';
import 'package:compiler/src/universe/selector.dart' show Selector;
@@ -29,12 +28,11 @@
""";
main() {
- runTests({bool useKernel}) async {
+ runTests() async {
OutputCollector outputCollector = new OutputCollector();
CompilationResult result = await runCompiler(
memorySourceFiles: {'main.dart': TEST},
- outputProvider: outputCollector,
- options: useKernel ? [] : [Flags.useOldFrontend]);
+ outputProvider: outputCollector);
Compiler compiler = result.compiler;
ClosedWorldBase closedWorld =
compiler.resolutionWorldBuilder.closedWorldForTesting;
@@ -55,9 +53,7 @@
}
asyncTest(() async {
- print('--test from ast---------------------------------------------------');
- await runTests(useKernel: false);
print('--test from kernel------------------------------------------------');
- await runTests(useKernel: true);
+ await runTests();
});
}
diff --git a/tests/compiler/dart2js/codegen/gvn_test.dart b/tests/compiler/dart2js/codegen/gvn_test.dart
index b9962bc..4d3fad9 100644
--- a/tests/compiler/dart2js/codegen/gvn_test.dart
+++ b/tests/compiler/dart2js/codegen/gvn_test.dart
@@ -106,49 +106,40 @@
""";
main() {
- runTests({bool useKernel}) async {
- await compile(TEST_ONE, entry: 'foo', useKernel: useKernel,
- check: (String generated) {
+ runTests() async {
+ await compile(TEST_ONE, entry: 'foo', check: (String generated) {
RegExp regexp = new RegExp(r"1 \+ [a-z]+");
checkNumberOfMatches(regexp.allMatches(generated).iterator, 1);
});
- await compile(TEST_TWO, entry: 'foo', useKernel: useKernel,
- check: (String generated) {
+ await compile(TEST_TWO, entry: 'foo', check: (String generated) {
checkNumberOfMatches(
new RegExp("length").allMatches(generated).iterator, 1);
});
- await compile(TEST_THREE, entry: 'foo', useKernel: useKernel,
- check: (String generated) {
+ await compile(TEST_THREE, entry: 'foo', check: (String generated) {
checkNumberOfMatches(
new RegExp("number").allMatches(generated).iterator, 1);
});
- await compile(TEST_FOUR, entry: 'foo', useKernel: useKernel,
- check: (String generated) {
+ await compile(TEST_FOUR, entry: 'foo', check: (String generated) {
checkNumberOfMatches(new RegExp("shr").allMatches(generated).iterator, 1);
});
- CompileMode compileMode =
- useKernel ? CompileMode.kernel : CompileMode.memory;
-
- await compileAll(TEST_FIVE, compileMode: compileMode).then((generated) {
+ await compileAll(TEST_FIVE).then((generated) {
checkNumberOfMatches(
new RegExp("get\\\$foo").allMatches(generated).iterator, 1);
});
- await compileAll(TEST_SIX, compileMode: compileMode).then((generated) {
+ await compileAll(TEST_SIX).then((generated) {
Expect.isTrue(generated.contains('for (t1 = a.field === 54; t1;)'));
});
- await compileAll(TEST_SEVEN, compileMode: compileMode).then((generated) {
+ await compileAll(TEST_SEVEN).then((generated) {
Expect.isTrue(generated.contains('for (t1 = a.field === 54; t1;)'));
});
- await compileAll(TEST_EIGHT, compileMode: compileMode).then((generated) {
+ await compileAll(TEST_EIGHT).then((generated) {
Expect.isTrue(generated.contains('for (; i < t1; ++i)'));
});
}
asyncTest(() async {
- print('--test from ast---------------------------------------------------');
- await runTests(useKernel: false);
print('--test from kernel------------------------------------------------');
- await runTests(useKernel: true);
+ await runTests();
});
}
diff --git a/tests/compiler/dart2js/codegen/identity_test.dart b/tests/compiler/dart2js/codegen/identity_test.dart
index 78f65cd..1f400f1 100644
--- a/tests/compiler/dart2js/codegen/identity_test.dart
+++ b/tests/compiler/dart2js/codegen/identity_test.dart
@@ -16,9 +16,8 @@
""";
main() {
- runTest({bool useKernel}) async {
- await compile(TEST_ONE, entry: 'foo', useKernel: useKernel,
- check: (String generated) {
+ runTest() async {
+ await compile(TEST_ONE, entry: 'foo', check: (String generated) {
// Check that no boolify code is generated.
RegExp regexp = new RegExp("=== true");
Iterator matches = regexp.allMatches(generated).iterator;
@@ -32,9 +31,7 @@
}
asyncTest(() async {
- print('--test from ast---------------------------------------------------');
- await runTest(useKernel: false);
print('--test from kernel------------------------------------------------');
- await runTest(useKernel: true);
+ await runTest();
});
}
diff --git a/tests/compiler/dart2js/codegen/if_do_while_test.dart b/tests/compiler/dart2js/codegen/if_do_while_test.dart
index ff6b8d0..fb6378a 100644
--- a/tests/compiler/dart2js/codegen/if_do_while_test.dart
+++ b/tests/compiler/dart2js/codegen/if_do_while_test.dart
@@ -19,9 +19,8 @@
""";
main() {
- runTest({bool useKernel}) async {
- await compile(TEST, entry: 'foo', useKernel: useKernel,
- check: (String generated) {
+ runTest() async {
+ await compile(TEST, entry: 'foo', check: (String generated) {
// Check that the do-while in the 'then' is enclosed in braces.
// Otherwise Android 4.0 stock browser has a syntax error. See issue 10923.
Expect.isTrue(
@@ -30,9 +29,7 @@
}
asyncTest(() async {
- print('--test from ast---------------------------------------------------');
- await runTest(useKernel: false);
print('--test from kernel------------------------------------------------');
- await runTest(useKernel: true);
+ await runTest();
});
}
diff --git a/tests/compiler/dart2js/codegen/inferrer_factory_test.dart b/tests/compiler/dart2js/codegen/inferrer_factory_test.dart
index 59f39ab..30bb917 100644
--- a/tests/compiler/dart2js/codegen/inferrer_factory_test.dart
+++ b/tests/compiler/dart2js/codegen/inferrer_factory_test.dart
@@ -23,18 +23,15 @@
""";
main() {
- runTest({bool useKernel}) async {
- String generated = await compileAll(TEST1,
- compileMode: useKernel ? CompileMode.kernel : CompileMode.memory);
+ runTest() async {
+ String generated = await compileAll(TEST1);
// Check that we're using the index operator on the object returned
// by the A factory.
Expect.isTrue(generated.contains('[0] = 42'));
}
asyncTest(() async {
- print('--test from ast---------------------------------------------------');
- await runTest(useKernel: false);
print('--test from kernel------------------------------------------------');
- await runTest(useKernel: true);
+ await runTest();
});
}
diff --git a/tests/compiler/dart2js/codegen/interceptor_almost_constant_test.dart b/tests/compiler/dart2js/codegen/interceptor_almost_constant_test.dart
index b9b1783..acc5fff 100644
--- a/tests/compiler/dart2js/codegen/interceptor_almost_constant_test.dart
+++ b/tests/compiler/dart2js/codegen/interceptor_almost_constant_test.dart
@@ -14,19 +14,16 @@
""";
main() {
- runTest({bool useKernel}) async {
+ runTest() async {
// Check that almost-constant interceptor is used.
- await compile(TEST_ONE, entry: 'foo', useKernel: useKernel,
- check: (String generated) {
+ await compile(TEST_ONE, entry: 'foo', check: (String generated) {
String re = r'a && [\w\.]*_methods';
Expect.isTrue(generated.contains(new RegExp(re)), 'contains /$re/');
});
}
asyncTest(() async {
- print('--test from ast---------------------------------------------------');
- await runTest(useKernel: false);
print('--test from kernel------------------------------------------------');
- await runTest(useKernel: true);
+ await runTest();
});
}
diff --git a/tests/compiler/dart2js/codegen/interceptor_test.dart b/tests/compiler/dart2js/codegen/interceptor_test.dart
index 3955b33..3776d52 100644
--- a/tests/compiler/dart2js/codegen/interceptor_test.dart
+++ b/tests/compiler/dart2js/codegen/interceptor_test.dart
@@ -25,11 +25,10 @@
""";
main() {
- runTests({bool useKernel}) async {
+ runTests() async {
// Check that one-shot interceptors preserve variable names, see
// https://code.google.com/p/dart/issues/detail?id=8106.
- await compile(TEST_ONE, entry: 'foo', useKernel: useKernel,
- check: (String generated) {
+ await compile(TEST_ONE, entry: 'foo', check: (String generated) {
Expect.isTrue(
generated.contains(new RegExp(r'[$A-Z]+\.toString\$0\$\(a\)')));
Expect.isTrue(generated.contains('myVariableName'));
@@ -37,8 +36,7 @@
// Check that an intercepted getter that does not need to be
// intercepted, is turned into a regular getter call or field
// access.
- await compile(TEST_TWO, entry: 'foo', useKernel: useKernel,
- check: (String generated) {
+ await compile(TEST_TWO, entry: 'foo', check: (String generated) {
Expect.isFalse(generated.contains(r'a.get$length()'));
Expect
.isTrue(generated.contains(new RegExp(r'[$A-Z]+\.A\$\(\)\.length')));
@@ -48,9 +46,7 @@
}
asyncTest(() async {
- print('--test from ast---------------------------------------------------');
- await runTests(useKernel: false);
print('--test from kernel------------------------------------------------');
- await runTests(useKernel: true);
+ await runTests();
});
}
diff --git a/tests/compiler/dart2js/codegen/interpolation_folding_test.dart b/tests/compiler/dart2js/codegen/interpolation_folding_test.dart
index 68f13e6..ef88234 100644
--- a/tests/compiler/dart2js/codegen/interpolation_folding_test.dart
+++ b/tests/compiler/dart2js/codegen/interpolation_folding_test.dart
@@ -38,10 +38,9 @@
""";
main() {
- runTests({bool useKernel}) async {
+ runTests() async {
check(String test, String contained) async {
- String generated =
- await compile(test, entry: 'foo', useKernel: useKernel);
+ String generated = await compile(test, entry: 'foo');
Expect.isTrue(generated.contains(contained), contained);
}
@@ -61,9 +60,7 @@
}
asyncTest(() async {
- print('--test from ast---------------------------------------------------');
- await runTests(useKernel: false);
print('--test from kernel------------------------------------------------');
- await runTests(useKernel: true);
+ await runTests();
});
}
diff --git a/tests/compiler/dart2js/codegen/inverse_operator_test.dart b/tests/compiler/dart2js/codegen/inverse_operator_test.dart
index eb1cee1..5881a49 100644
--- a/tests/compiler/dart2js/codegen/inverse_operator_test.dart
+++ b/tests/compiler/dart2js/codegen/inverse_operator_test.dart
@@ -17,15 +17,13 @@
}""";
main() {
- runTest({bool useKernel}) async {
+ runTest() async {
// Make sure we don't introduce a new variable.
- await compileAndMatchFuzzy(MAIN, 'main', "1 >= x", useKernel: useKernel);
+ await compileAndMatchFuzzy(MAIN, 'main', "1 >= x");
}
asyncTest(() async {
- print('--test from ast---------------------------------------------------');
- await runTest(useKernel: false);
print('--test from kernel------------------------------------------------');
- await runTest(useKernel: true);
+ await runTest();
});
}
diff --git a/tests/compiler/dart2js/codegen/is_function_test.dart b/tests/compiler/dart2js/codegen/is_function_test.dart
index 9f1676d..e535c69 100644
--- a/tests/compiler/dart2js/codegen/is_function_test.dart
+++ b/tests/compiler/dart2js/codegen/is_function_test.dart
@@ -18,11 +18,8 @@
''';
main() {
- runTest({bool useKernel}) async {
+ runTest() async {
List<String> options = [Flags.enableCheckedMode];
- if (!useKernel) {
- options.add(Flags.useOldFrontend);
- }
CompilationResult result = await runCompiler(
memorySourceFiles: {'main.dart': SOURCE}, options: options);
Expect.isTrue(result.isSuccess);
@@ -44,9 +41,7 @@
}
asyncTest(() async {
- print('--test from ast---------------------------------------------------');
- await runTest(useKernel: false);
print('--test from kernel------------------------------------------------');
- await runTest(useKernel: true);
+ await runTest();
});
}
diff --git a/tests/compiler/dart2js/codegen/is_inference2_test.dart b/tests/compiler/dart2js/codegen/is_inference2_test.dart
index e2bff2a..cfd6ba9 100644
--- a/tests/compiler/dart2js/codegen/is_inference2_test.dart
+++ b/tests/compiler/dart2js/codegen/is_inference2_test.dart
@@ -14,9 +14,9 @@
""";
main() {
- runTest({bool useKernel}) async {
- await compile(TEST_IF_BOOL_FIRST_INSTRUCTION,
- entry: 'negate', useKernel: useKernel, check: (String generated) {
+ runTest() async {
+ await compile(TEST_IF_BOOL_FIRST_INSTRUCTION, entry: 'negate',
+ check: (String generated) {
Expect.isTrue(generated.contains("!")); // We want to see !x.
Expect.isFalse(generated.contains("!=")); // And not !== true.
Expect.isFalse(generated.contains("true"));
@@ -25,9 +25,7 @@
}
asyncTest(() async {
- print('--test from ast---------------------------------------------------');
- await runTest(useKernel: false);
print('--test from kernel------------------------------------------------');
- await runTest(useKernel: true);
+ await runTest();
});
}
diff --git a/tests/compiler/dart2js/codegen/is_inference_test.dart b/tests/compiler/dart2js/codegen/is_inference_test.dart
index 9915918..8758dd8 100644
--- a/tests/compiler/dart2js/codegen/is_inference_test.dart
+++ b/tests/compiler/dart2js/codegen/is_inference_test.dart
@@ -71,9 +71,8 @@
}
""";
-Future compileAndTest(String code, {bool useKernel}) {
- return compile(code, entry: 'test', useKernel: useKernel,
- check: (String generated) {
+Future compileAndTest(String code) {
+ return compile(code, entry: 'test', check: (String generated) {
RegExp validAdd =
new RegExp("($anyIdentifier \\+ 42)|($anyIdentifier \\+= 42)");
RegExp invalidAdd = new RegExp("$anyIdentifier \\+ 53");
@@ -83,19 +82,17 @@
}
main() {
- runTests({bool useKernel}) async {
- await compileAndTest(TEST_IF, useKernel: useKernel);
- await compileAndTest(TEST_IF_ELSE, useKernel: useKernel);
- await compileAndTest(TEST_IF_RETURN, useKernel: useKernel);
- await compileAndTest(TEST_IF_NOT_ELSE, useKernel: useKernel);
- await compileAndTest(TEST_IF_NOT_RETURN, useKernel: useKernel);
- await compileAndTest(TEST_IF_NOT_ELSE_RETURN, useKernel: useKernel);
+ runTests() async {
+ await compileAndTest(TEST_IF);
+ await compileAndTest(TEST_IF_ELSE);
+ await compileAndTest(TEST_IF_RETURN);
+ await compileAndTest(TEST_IF_NOT_ELSE);
+ await compileAndTest(TEST_IF_NOT_RETURN);
+ await compileAndTest(TEST_IF_NOT_ELSE_RETURN);
}
asyncTest(() async {
- print('--test from ast---------------------------------------------------');
- await runTests(useKernel: false);
print('--test from kernel------------------------------------------------');
- await runTests(useKernel: true);
+ await runTests();
});
}
diff --git a/tests/compiler/dart2js/codegen/jsarray_indexof_test.dart b/tests/compiler/dart2js/codegen/jsarray_indexof_test.dart
index 5d224e8..c6d31ac 100644
--- a/tests/compiler/dart2js/codegen/jsarray_indexof_test.dart
+++ b/tests/compiler/dart2js/codegen/jsarray_indexof_test.dart
@@ -32,10 +32,6 @@
main() {
asyncTest(() async {
- print('--test from ast---------------------------------------------------');
- await runTest([Flags.useOldFrontend]);
- print('--test from ast (trust-type-annotations)--------------------------');
- await runTest([Flags.useOldFrontend, Flags.trustTypeAnnotations]);
print('--test from kernel------------------------------------------------');
await runTest([]);
print('--test from kernel (trust-type-annotations)-----------------------');
diff --git a/tests/compiler/dart2js/codegen/licm_test.dart b/tests/compiler/dart2js/codegen/licm_test.dart
index f6fee65..a5c397b 100644
--- a/tests/compiler/dart2js/codegen/licm_test.dart
+++ b/tests/compiler/dart2js/codegen/licm_test.dart
@@ -24,16 +24,13 @@
''';
main() {
- runTest({bool useKernel}) async {
+ runTest() async {
await compileAndMatch(TEST, 'main',
- new RegExp('if \\(typeof count !== "number"\\)(.|\\n)*while'),
- useKernel: useKernel);
+ new RegExp('if \\(typeof count !== "number"\\)(.|\\n)*while'));
}
asyncTest(() async {
- print('--test from ast---------------------------------------------------');
- await runTest(useKernel: false);
print('--test from kernel------------------------------------------------');
- await runTest(useKernel: true);
+ await runTest();
});
}
diff --git a/tests/compiler/dart2js/codegen/list_tracer_length_test.dart b/tests/compiler/dart2js/codegen/list_tracer_length_test.dart
index d5e8d72..ac42284 100644
--- a/tests/compiler/dart2js/codegen/list_tracer_length_test.dart
+++ b/tests/compiler/dart2js/codegen/list_tracer_length_test.dart
@@ -2,8 +2,7 @@
// 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.
-/// TODO(johnniwinther): Move this to the codegen folder. Currently this only
-/// works with the mock compiler.
+/// TODO(johnniwinther): Currently this only works with the mock compiler.
import "package:expect/expect.dart";
import "package:async_helper/async_helper.dart";
@@ -90,23 +89,28 @@
}
""";
-void checkRangeError(String test, {bool hasRangeError}) {
- asyncTest(() => compileAll(test).then((generated) {
- Expect.equals(hasRangeError, generated.contains('ioore'));
- }));
+checkRangeError(String test, {bool hasRangeError}) async {
+ String generated = await compileAll(test);
+ Expect.equals(
+ hasRangeError,
+ generated.contains('ioore'),
+ "Unexpected use of 'hasRangeError' for test:\n$test\n"
+ "in code\n$generated");
}
main() {
- checkRangeError(TEST1, hasRangeError: false);
- checkRangeError(TEST2('insert', 'null, null'), hasRangeError: true);
- checkRangeError(TEST2('add', 'null'), hasRangeError: true);
- checkRangeError(TEST2('clear', ''), hasRangeError: true);
- checkRangeError(TEST2('toString', ''), hasRangeError: false);
- checkRangeError(TEST3, hasRangeError: false);
- checkRangeError(TEST4, hasRangeError: true);
- checkRangeError(TEST5, hasRangeError: true);
- checkRangeError(TEST6, hasRangeError: true);
- checkRangeError(TEST7, hasRangeError: false);
- checkRangeError(TEST8, hasRangeError: true);
- checkRangeError(TEST9, hasRangeError: false);
+ asyncTest(() async {
+ await checkRangeError(TEST1, hasRangeError: false);
+ await checkRangeError(TEST2('insert', 'null, null'), hasRangeError: true);
+ await checkRangeError(TEST2('add', 'null'), hasRangeError: true);
+ await checkRangeError(TEST2('clear', ''), hasRangeError: true);
+ await checkRangeError(TEST2('toString', ''), hasRangeError: false);
+ await checkRangeError(TEST3, hasRangeError: false);
+ await checkRangeError(TEST4, hasRangeError: true);
+ await checkRangeError(TEST5, hasRangeError: true);
+ await checkRangeError(TEST6, hasRangeError: true);
+ await checkRangeError(TEST7, hasRangeError: false);
+ await checkRangeError(TEST8, hasRangeError: true);
+ await checkRangeError(TEST9, hasRangeError: false);
+ });
}
diff --git a/tests/compiler/dart2js/codegen/list_tracer_node_type_test.dart b/tests/compiler/dart2js/codegen/list_tracer_node_type_test.dart
index 03ae59c..339512a 100644
--- a/tests/compiler/dart2js/codegen/list_tracer_node_type_test.dart
+++ b/tests/compiler/dart2js/codegen/list_tracer_node_type_test.dart
@@ -2,8 +2,7 @@
// 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.
-/// TODO(johnniwinther): Move this to the codegen folder. Currently this only
-/// works with the mock compiler.
+/// TODO(johnniwinther): Currently this only works with the mock compiler.
import "package:expect/expect.dart";
import "package:async_helper/async_helper.dart";
@@ -70,47 +69,56 @@
}
main() {
- asyncTest(() => compileAll(TEST1).then((generated) {
- Expect.isTrue(generated.contains('if (typeof t1'));
- }));
+ runTests() async {
+ String generated1 = await compileAll(TEST1);
+ Expect.isTrue(generated1.contains('if (typeof t1'));
- asyncTest(() => compileAll(TEST2).then((generated) {
- Expect.isTrue(generated.contains('if (typeof t1'));
- }));
+ String generated2 = await compileAll(TEST2);
+ Expect.isTrue(generated2.contains('if (typeof t1'));
- asyncTest(() => compileAll(TEST3).then((generated) {
- Expect.isTrue(generated.contains('if (typeof t1'));
- }));
+ String generated3 = await compileAll(TEST3);
+ Expect.isTrue(generated3.contains('if (typeof t1'));
- asyncTest(() => compileAll(TEST4).then((generated) {
- Expect.isTrue(generated.contains('if (typeof t1'));
- }));
+ String generated4 = await compileAll(TEST4);
+ Expect.isTrue(generated4.contains('if (typeof t1'));
- asyncTest(() => compileAll(TEST5).then((generated) {
- Expect.isFalse(generated.contains('iae'));
- }));
+ String generated5 = await compileAll(TEST5);
+ Expect.isFalse(generated5.contains('iae'));
- asyncTest(() => compileAll(TEST6).then((generated) {
- Expect.isFalse(generated.contains('iae'));
- }));
+ String generated6 = await compileAll(TEST6);
+ Expect.isFalse(generated6.contains('iae'));
- var memberInvocations = const <String>[
- 'first',
- 'last',
- 'single',
- 'singleWhere((x) => true)',
- 'elementAt(0)',
- 'removeAt(0)',
- 'removeLast()',
- ];
- memberInvocations
- .map((member) => generateTest('$member'))
- .forEach((String test) {
- asyncTest(() => compileAll(test, expectedErrors: 0, expectedWarnings: 0)
- .then((generated) {
- Expect.isTrue(generated.contains('+ 42'));
- Expect.isFalse(generated.contains('if (typeof t1'));
- Expect.isFalse(generated.contains('if (t1 == null)'));
- }));
+ var memberInvocations = const <String>[
+ 'first',
+ 'last',
+ 'single',
+ 'singleWhere((x) => true)',
+ 'elementAt(0)',
+ 'removeAt(0)',
+ 'removeLast()',
+ ];
+ for (String member in memberInvocations) {
+ String generated = await compileAll(generateTest('$member'),
+ expectedErrors: 0, expectedWarnings: 0);
+ Expect.isTrue(
+ generated.contains('+ 42'),
+ "Missing '+ 42' code for invocation '$member':\n"
+ "$generated");
+ // TODO(johnniwinther): Update this test to query the generated code for
+ // main only.
+ /*Expect.isFalse(
+ generated.contains('if (typeof t1'),
+ "Unexpected 'if (typeof t1' code for invocation '$member':\n"
+ "$generated");
+ Expect.isFalse(
+ generated.contains('if (t1 == null)'),
+ "Unexpected 'if (t1 == null)' code for invocation '$member':\n"
+ "$generated");*/
+ }
+ }
+
+ asyncTest(() async {
+ print('--test from kernel------------------------------------------------');
+ await runTests();
});
}
diff --git a/tests/compiler/dart2js/codegen/literal_list_test.dart b/tests/compiler/dart2js/codegen/literal_list_test.dart
index fa05bec..a989045 100644
--- a/tests/compiler/dart2js/codegen/literal_list_test.dart
+++ b/tests/compiler/dart2js/codegen/literal_list_test.dart
@@ -16,9 +16,8 @@
""";
main() {
- runTest({bool useKernel}) async {
- await compile(TEST_ONE, entry: 'foo', useKernel: useKernel,
- check: (String generated) {
+ runTest() async {
+ await compile(TEST_ONE, entry: 'foo', check: (String generated) {
Expect.isTrue(generated.contains('print([1, 2]);'));
Expect.isTrue(generated.contains('print([3]);'));
Expect.isTrue(generated.contains('print([4, 5]);'));
@@ -26,9 +25,7 @@
}
asyncTest(() async {
- print('--test from ast---------------------------------------------------');
- await runTest(useKernel: false);
print('--test from kernel------------------------------------------------');
- await runTest(useKernel: true);
+ await runTest();
});
}
diff --git a/tests/compiler/dart2js/codegen/literal_map_test.dart b/tests/compiler/dart2js/codegen/literal_map_test.dart
index 363a8e2..c1bfcf3 100644
--- a/tests/compiler/dart2js/codegen/literal_map_test.dart
+++ b/tests/compiler/dart2js/codegen/literal_map_test.dart
@@ -15,9 +15,8 @@
""";
main() {
- runTest({bool useKernel}) async {
- await compile(TEST, entry: 'foo', useKernel: useKernel,
- check: (String generated) {
+ runTest() async {
+ await compile(TEST, entry: 'foo', check: (String generated) {
// Make sure we have all the type information we need.
Expect.isFalse(generated.contains('bailout'));
Expect.isFalse(generated.contains('interceptor'));
@@ -28,9 +27,7 @@
}
asyncTest(() async {
- print('--test from ast---------------------------------------------------');
- await runTest(useKernel: false);
print('--test from kernel------------------------------------------------');
- await runTest(useKernel: true);
+ await runTest();
});
}
diff --git a/tests/compiler/dart2js/codegen/load_elimination_test.dart b/tests/compiler/dart2js/codegen/load_elimination_test.dart
index 2a8935e..c6d6e27 100644
--- a/tests/compiler/dart2js/codegen/load_elimination_test.dart
+++ b/tests/compiler/dart2js/codegen/load_elimination_test.dart
@@ -234,11 +234,9 @@
""";
main() {
- runTests({bool useKernel}) async {
+ runTests() async {
test(String code, String expected) async {
- String generated = await compileAll(code,
- disableInlining: false,
- compileMode: useKernel ? CompileMode.kernel : CompileMode.memory);
+ String generated = await compileAll(code, disableInlining: false);
Expect.isTrue(
generated.contains(expected),
"Generated code didn't contain '$expected'.\n"
@@ -266,9 +264,7 @@
}
asyncTest(() async {
- print('--test from ast---------------------------------------------------');
- await runTests(useKernel: false);
print('--test from kernel------------------------------------------------');
- await runTests(useKernel: true);
+ await runTests();
});
}
diff --git a/tests/compiler/dart2js/codegen/logical_expression_test.dart b/tests/compiler/dart2js/codegen/logical_expression_test.dart
index 8ed8e00..2efbaca 100644
--- a/tests/compiler/dart2js/codegen/logical_expression_test.dart
+++ b/tests/compiler/dart2js/codegen/logical_expression_test.dart
@@ -24,38 +24,29 @@
""";
main() {
- runTests({bool useKernel}) async {
+ runTests() async {
// We want something like:
// var t1 = bar.call$0() === true;
// if (t1 || gee.call$0() === true) gee.call$0();
// if (t1 || gee.call$0() === true) gee.call$0();
await compileAndDoNotMatchFuzzy(
- TEST_ONE,
- 'foo',
- r"""var x = [a-zA-Z0-9$.]+\(\) == true;
+ TEST_ONE, 'foo', r"""var x = [a-zA-Z0-9$.]+\(\) == true;
if \(x \|\| [a-zA-Z0-9$.]+\(\) === true\) [^;]+;
- if \(x \|\| [a-zA-Z0-9$.]+\(\) === true\) [^;]+;""",
- useKernel: useKernel);
+ if \(x \|\| [a-zA-Z0-9$.]+\(\) === true\) [^;]+;""");
// We want something like:
// var t1 = list == null;
// if (t1) bar.call$0();
// if (t1 || bar.call$0() === true) bar.call$0();
// if (t1 || bar.call$0() === true) bar.call$0();
- await compileAndMatchFuzzy(
- TEST_TWO,
- 'foo',
- r"""var x = x == null;
+ await compileAndMatchFuzzy(TEST_TWO, 'foo', r"""var x = x == null;
if \(x\) [^;]+;
if \(x \|\| [a-zA-Z0-9$.]+\(\) === true\) [^;]+;
- if \(x \|\| [a-zA-Z0-9$.]+\(\) === true\) [^;]+;""",
- useKernel: useKernel);
+ if \(x \|\| [a-zA-Z0-9$.]+\(\) === true\) [^;]+;""");
}
asyncTest(() async {
- print('--test from ast---------------------------------------------------');
- await runTests(useKernel: false);
print('--test from kernel------------------------------------------------');
- await runTests(useKernel: true);
+ await runTests();
});
}
diff --git a/tests/compiler/dart2js/codegen/loop_test.dart b/tests/compiler/dart2js/codegen/loop_test.dart
index 3594325..2615469 100644
--- a/tests/compiler/dart2js/codegen/loop_test.dart
+++ b/tests/compiler/dart2js/codegen/loop_test.dart
@@ -53,29 +53,23 @@
""";
main() {
- runTests({bool useKernel}) async {
- await compile(TEST_ONE, entry: 'foo', useKernel: useKernel,
- check: (String generated) {
+ runTests() async {
+ await compile(TEST_ONE, entry: 'foo', check: (String generated) {
Expect.isTrue(generated.contains(r'for ('));
});
- await compile(TEST_TWO, entry: 'foo', useKernel: useKernel,
- check: (String generated) {
+ await compile(TEST_TWO, entry: 'foo', check: (String generated) {
Expect.isTrue(!generated.contains(r'break'));
});
- await compile(TEST_THREE, entry: 'foo', useKernel: useKernel,
- check: (String generated) {
+ await compile(TEST_THREE, entry: 'foo', check: (String generated) {
Expect.isTrue(generated.contains(r'continue'));
});
- await compile(TEST_FOUR, entry: 'foo', useKernel: useKernel,
- check: (String generated) {
+ await compile(TEST_FOUR, entry: 'foo', check: (String generated) {
Expect.isTrue(generated.contains(r'continue'));
});
}
asyncTest(() async {
- print('--test from ast---------------------------------------------------');
- await runTests(useKernel: false);
print('--test from kernel------------------------------------------------');
- await runTests(useKernel: true);
+ await runTests();
});
}
diff --git a/tests/compiler/dart2js/codegen/minify_many_locals_test.dart b/tests/compiler/dart2js/codegen/minify_many_locals_test.dart
index ed902ed..b69a0fd 100644
--- a/tests/compiler/dart2js/codegen/minify_many_locals_test.dart
+++ b/tests/compiler/dart2js/codegen/minify_many_locals_test.dart
@@ -8,7 +8,7 @@
import '../compiler_helper.dart';
main() {
- runTests({bool useKernel, int numberOfParameters}) async {
+ runTests({int numberOfParameters}) async {
StringBuffer buffer = new StringBuffer();
buffer.write("foo(");
for (int i = 0; i < numberOfParameters; i++) {
@@ -21,8 +21,7 @@
buffer.write("$numberOfParameters; return i; }");
String code = buffer.toString();
- String generated =
- await compile(code, entry: 'foo', minify: true, useKernel: useKernel);
+ String generated = await compile(code, entry: 'foo', minify: true);
RegExp re = new RegExp(r"\(a,b,c");
Expect.isTrue(re.hasMatch(generated));
@@ -46,10 +45,8 @@
}
asyncTest(() async {
- // The [numberOfParameters] values are somewhat arbitrary.
- print('--test from ast---------------------------------------------------');
- await runTests(useKernel: false, numberOfParameters: 1800);
+ // The [numberOfParameters] value is somewhat arbitrary.
print('--test from kernel------------------------------------------------');
- await runTests(useKernel: true, numberOfParameters: 2000);
+ await runTests(numberOfParameters: 2000);
});
}
diff --git a/tests/compiler/dart2js/codegen/modulo_remainder_test.dart b/tests/compiler/dart2js/codegen/modulo_remainder_test.dart
index 29d8b1b..7997dbf 100644
--- a/tests/compiler/dart2js/codegen/modulo_remainder_test.dart
+++ b/tests/compiler/dart2js/codegen/modulo_remainder_test.dart
@@ -65,12 +65,9 @@
""";
main() {
- runTests({bool useKernel}) async {
+ runTests() async {
check(String test) async {
- await compile(test,
- entry: 'foo',
- useKernel: useKernel,
- check: checkerForAbsentPresent(test));
+ await compile(test, entry: 'foo', check: checkerForAbsentPresent(test));
}
await check(MOD1);
@@ -82,9 +79,7 @@
}
asyncTest(() async {
- print('--test from ast---------------------------------------------------');
- await runTests(useKernel: false);
print('--test from kernel------------------------------------------------');
- await runTests(useKernel: true);
+ await runTests();
});
}
diff --git a/tests/compiler/dart2js/codegen/negation_shift_regression_test.dart b/tests/compiler/dart2js/codegen/negation_shift_regression_test.dart
index ec028c8..aeb6731 100644
--- a/tests/compiler/dart2js/codegen/negation_shift_regression_test.dart
+++ b/tests/compiler/dart2js/codegen/negation_shift_regression_test.dart
@@ -26,12 +26,9 @@
""";
main() {
- runTests({bool useKernel}) async {
+ runTests() async {
check(String test) async {
- await compile(test,
- entry: 'foo',
- useKernel: useKernel,
- check: checkerForAbsentPresent(test));
+ await compile(test, entry: 'foo', check: checkerForAbsentPresent(test));
}
await check(TEST1);
@@ -39,9 +36,7 @@
}
asyncTest(() async {
- print('--test from ast---------------------------------------------------');
- await runTests(useKernel: false);
print('--test from kernel------------------------------------------------');
- await runTests(useKernel: true);
+ await runTests();
});
}
diff --git a/tests/compiler/dart2js/codegen/no_constructor_body_test.dart b/tests/compiler/dart2js/codegen/no_constructor_body_test.dart
index 3d3e8ec..2279739 100644
--- a/tests/compiler/dart2js/codegen/no_constructor_body_test.dart
+++ b/tests/compiler/dart2js/codegen/no_constructor_body_test.dart
@@ -18,18 +18,15 @@
""";
main() {
- runTest({bool useKernel}) async {
- String generated = await compileAll(TEST,
- compileMode: useKernel ? CompileMode.kernel : CompileMode.memory);
+ runTest() async {
+ String generated = await compileAll(TEST);
Expect.isTrue(generated
.contains(new RegExp('A: {[ \n]*"\\^": "Object;",[ \n]*static:')));
}
asyncTest(() async {
- print('--test from ast---------------------------------------------------');
- await runTest(useKernel: false);
print('--test from kernel------------------------------------------------');
- await runTest(useKernel: true);
+ await runTest();
});
}
diff --git a/tests/compiler/dart2js/codegen/no_duplicate_constructor_body2_test.dart b/tests/compiler/dart2js/codegen/no_duplicate_constructor_body2_test.dart
index b90eba5..e7cd4cd 100644
--- a/tests/compiler/dart2js/codegen/no_duplicate_constructor_body2_test.dart
+++ b/tests/compiler/dart2js/codegen/no_duplicate_constructor_body2_test.dart
@@ -22,18 +22,15 @@
""";
main() {
- runTest({bool useKernel}) async {
- String generated = await compileAll(CODE,
- compileMode: useKernel ? CompileMode.kernel : CompileMode.memory);
+ runTest() async {
+ String generated = await compileAll(CODE);
RegExp regexp = new RegExp(r'A\$0: function');
Iterator<Match> matches = regexp.allMatches(generated).iterator;
checkNumberOfMatches(matches, 1);
}
asyncTest(() async {
- print('--test from ast---------------------------------------------------');
- await runTest(useKernel: false);
print('--test from kernel------------------------------------------------');
- await runTest(useKernel: true);
+ await runTest();
});
}
diff --git a/tests/compiler/dart2js/codegen/no_duplicate_constructor_body_test.dart b/tests/compiler/dart2js/codegen/no_duplicate_constructor_body_test.dart
index 6bba7dd..f5625d5 100644
--- a/tests/compiler/dart2js/codegen/no_duplicate_constructor_body_test.dart
+++ b/tests/compiler/dart2js/codegen/no_duplicate_constructor_body_test.dart
@@ -16,18 +16,15 @@
""";
main() {
- runTest({bool useKernel}) async {
- String generated = await compileAll(CODE,
- compileMode: useKernel ? CompileMode.kernel : CompileMode.memory);
+ runTest() async {
+ String generated = await compileAll(CODE);
RegExp regexp = new RegExp(r'\A: {[ \n]*"\^": "[A-Za-z]+;"');
Iterator<Match> matches = regexp.allMatches(generated).iterator;
checkNumberOfMatches(matches, 1);
}
asyncTest(() async {
- print('--test from ast---------------------------------------------------');
- await runTest(useKernel: false);
print('--test from kernel------------------------------------------------');
- await runTest(useKernel: true);
+ await runTest();
});
}
diff --git a/tests/compiler/dart2js/codegen/no_duplicate_stub_test.dart b/tests/compiler/dart2js/codegen/no_duplicate_stub_test.dart
index 2c9e0bb6..cd7a05a 100644
--- a/tests/compiler/dart2js/codegen/no_duplicate_stub_test.dart
+++ b/tests/compiler/dart2js/codegen/no_duplicate_stub_test.dart
@@ -29,18 +29,15 @@
""";
main() {
- runTest({bool useKernel}) async {
- String generated = await compileAll(TEST,
- compileMode: useKernel ? CompileMode.kernel : CompileMode.memory);
+ runTest() async {
+ String generated = await compileAll(TEST);
RegExp regexp = new RegExp('foo\\\$1\\\$a: function');
Iterator<Match> matches = regexp.allMatches(generated).iterator;
checkNumberOfMatches(matches, 1);
}
asyncTest(() async {
- print('--test from ast---------------------------------------------------');
- await runTest(useKernel: false);
print('--test from kernel------------------------------------------------');
- await runTest(useKernel: true);
+ await runTest();
});
}
diff --git a/tests/compiler/dart2js/codegen/null_check_test.dart b/tests/compiler/dart2js/codegen/null_check_test.dart
index 34bf897..90b7847 100644
--- a/tests/compiler/dart2js/codegen/null_check_test.dart
+++ b/tests/compiler/dart2js/codegen/null_check_test.dart
@@ -17,16 +17,13 @@
""";
main() {
- runTest({bool useKernel}) async {
- String generated = await compileAll(TEST1,
- compileMode: useKernel ? CompileMode.kernel : CompileMode.memory);
+ runTest() async {
+ String generated = await compileAll(TEST1);
Expect.isFalse(generated.contains('foo.length'));
}
asyncTest(() async {
- print('--test from ast---------------------------------------------------');
- await runTest(useKernel: false);
print('--test from kernel------------------------------------------------');
- await runTest(useKernel: true);
+ await runTest();
});
}
diff --git a/tests/compiler/dart2js/codegen/null_type_test.dart b/tests/compiler/dart2js/codegen/null_type_test.dart
index 353e424..ecbf6df 100644
--- a/tests/compiler/dart2js/codegen/null_type_test.dart
+++ b/tests/compiler/dart2js/codegen/null_type_test.dart
@@ -14,17 +14,14 @@
""";
main() {
- runTest({bool useKernel}) async {
- await compile(TEST_ONE, entry: 'foo', useKernel: useKernel,
- check: (String generated) {
+ runTest() async {
+ await compile(TEST_ONE, entry: 'foo', check: (String generated) {
Expect.isFalse(generated.contains('typeof (void 0)'));
});
}
asyncTest(() async {
- print('--test from ast---------------------------------------------------');
- await runTest(useKernel: false);
print('--test from kernel------------------------------------------------');
- await runTest(useKernel: true);
+ await runTest();
});
}
diff --git a/tests/compiler/dart2js/codegen/number_output_test.dart b/tests/compiler/dart2js/codegen/number_output_test.dart
index 07e7126..a51bd7c 100644
--- a/tests/compiler/dart2js/codegen/number_output_test.dart
+++ b/tests/compiler/dart2js/codegen/number_output_test.dart
@@ -20,12 +20,9 @@
}'''
};
-Future test({bool useKernel, bool minify}) async {
+Future test({bool minify}) async {
OutputCollector collector = new OutputCollector();
List<String> options = <String>[];
- if (!useKernel) {
- options.add(Flags.useOldFrontend);
- }
if (minify) {
options.add(Flags.minify);
}
@@ -56,15 +53,13 @@
}
main() {
- runTest({bool useKernel}) async {
- await test(useKernel: useKernel, minify: true);
- await test(useKernel: useKernel, minify: false);
+ runTest() async {
+ await test(minify: true);
+ await test(minify: false);
}
asyncTest(() async {
- print('--test from ast---------------------------------------------------');
- await runTest(useKernel: false);
print('--test from kernel------------------------------------------------');
- await runTest(useKernel: true);
+ await runTest();
});
}
diff --git a/tests/compiler/dart2js/codegen/parameter_phi_elimination_test.dart b/tests/compiler/dart2js/codegen/parameter_phi_elimination_test.dart
index 29f6992..2b843d6 100644
--- a/tests/compiler/dart2js/codegen/parameter_phi_elimination_test.dart
+++ b/tests/compiler/dart2js/codegen/parameter_phi_elimination_test.dart
@@ -19,14 +19,12 @@
""";
main() {
- runTest({bool useKernel}) async {
- await compile(SOURCE, entry: "baz", useKernel: useKernel);
+ runTest() async {
+ await compile(SOURCE, entry: "baz");
}
asyncTest(() async {
- print('--test from ast---------------------------------------------------');
- await runTest(useKernel: false);
print('--test from kernel------------------------------------------------');
- await runTest(useKernel: true);
+ await runTest();
});
}
diff --git a/tests/compiler/dart2js/codegen/pretty_parameter_test.dart b/tests/compiler/dart2js/codegen/pretty_parameter_test.dart
index d2ca04e..bd68a4c 100644
--- a/tests/compiler/dart2js/codegen/pretty_parameter_test.dart
+++ b/tests/compiler/dart2js/codegen/pretty_parameter_test.dart
@@ -72,42 +72,35 @@
""";
main() {
- runTests({bool useKernel}) async {
- await compile(FOO, entry: 'foo', useKernel: useKernel,
- check: (String generated) {
+ runTests() async {
+ await compile(FOO, entry: 'foo', check: (String generated) {
Expect.isTrue(generated.contains(r"function(a, b) {"));
});
- await compile(BAR, entry: 'bar', useKernel: useKernel,
- check: (String generated) {
+ await compile(BAR, entry: 'bar', check: (String generated) {
Expect.isTrue(generated.contains(r"function($eval, $$eval) {"));
});
- await compile(PARAMETER_AND_TEMP, entry: 'bar', useKernel: useKernel,
- check: (String generated) {
+ await compile(PARAMETER_AND_TEMP, entry: 'bar', check: (String generated) {
Expect.isTrue(generated.contains(r"print(t00)"));
// Check that the second 't0' got another name.
Expect.isTrue(generated.contains(r"print(t01)"));
});
- await compile(MULTIPLE_PHIS_ONE_LOCAL, entry: 'foo', useKernel: useKernel,
+ await compile(MULTIPLE_PHIS_ONE_LOCAL, entry: 'foo',
check: (String generated) {
Expect.isTrue(generated.contains("var a;"));
// Check that there is only one var declaration.
checkNumberOfMatches(new RegExp("var").allMatches(generated).iterator, 1);
});
- await compile(NO_LOCAL, entry: 'foo', useKernel: useKernel,
- check: (String generated) {
+ await compile(NO_LOCAL, entry: 'foo', check: (String generated) {
Expect.isFalse(generated.contains('var'));
});
- await compile(PARAMETER_INIT, entry: 'foo', useKernel: useKernel,
- check: (String generated) {
+ await compile(PARAMETER_INIT, entry: 'foo', check: (String generated) {
// Check that there is only one var declaration.
checkNumberOfMatches(new RegExp("var").allMatches(generated).iterator, 1);
});
}
asyncTest(() async {
- print('--test from ast---------------------------------------------------');
- await runTests(useKernel: false);
print('--test from kernel------------------------------------------------');
- await runTests(useKernel: true);
+ await runTests();
});
}
diff --git a/tests/compiler/dart2js/codegen/redundant_phi_eliminator_test.dart b/tests/compiler/dart2js/codegen/redundant_phi_eliminator_test.dart
index e18c6e3..a6f6c37 100644
--- a/tests/compiler/dart2js/codegen/redundant_phi_eliminator_test.dart
+++ b/tests/compiler/dart2js/codegen/redundant_phi_eliminator_test.dart
@@ -28,14 +28,12 @@
""";
main() {
- runTests({bool useKernel}) async {
- await compile(TEST_ONE, entry: 'foo', useKernel: useKernel,
- check: (String generated) {
+ runTests() async {
+ await compile(TEST_ONE, entry: 'foo', check: (String generated) {
RegExp regexp = new RegExp("toBeRemoved");
Expect.isTrue(!regexp.hasMatch(generated));
});
- await compile(TEST_TWO, entry: 'foo', useKernel: useKernel,
- check: (String generated) {
+ await compile(TEST_TWO, entry: 'foo', check: (String generated) {
RegExp regexp = new RegExp("toBeRemoved");
Expect.isTrue(!regexp.hasMatch(generated));
regexp = new RegExp("temp");
@@ -44,9 +42,7 @@
}
asyncTest(() async {
- print('--test from ast---------------------------------------------------');
- await runTests(useKernel: false);
print('--test from kernel------------------------------------------------');
- await runTests(useKernel: true);
+ await runTests();
});
}
diff --git a/tests/compiler/dart2js/codegen/regress_10231_test.dart b/tests/compiler/dart2js/codegen/regress_10231_test.dart
index 2c2c242..bc97ecb 100644
--- a/tests/compiler/dart2js/codegen/regress_10231_test.dart
+++ b/tests/compiler/dart2js/codegen/regress_10231_test.dart
@@ -25,18 +25,15 @@
""";
void main() {
- runTests({bool useKernel}) async {
- String code =
- await compile(SOURCE, useKernel: useKernel, methodName: 'test');
+ runTests() async {
+ String code = await compile(SOURCE, methodName: 'test');
Expect.isNotNull(code);
Expect.equals(0, new RegExp('add').allMatches(code).length);
Expect.equals(3, new RegExp('\\+').allMatches(code).length);
}
asyncTest(() async {
- print('--test from ast---------------------------------------------------');
- await runTests(useKernel: false);
print('--test from kernel------------------------------------------------');
- await runTests(useKernel: true);
+ await runTests();
});
}
diff --git a/tests/compiler/dart2js/codegen/side_effect_tdiv_regression_test.dart b/tests/compiler/dart2js/codegen/side_effect_tdiv_regression_test.dart
index 4d87085..670316a 100644
--- a/tests/compiler/dart2js/codegen/side_effect_tdiv_regression_test.dart
+++ b/tests/compiler/dart2js/codegen/side_effect_tdiv_regression_test.dart
@@ -23,17 +23,14 @@
''';
void main() {
- runTest({bool useKernel}) async {
- String generated = await compileAll(TEST,
- compileMode: useKernel ? CompileMode.kernel : CompileMode.mock);
- Expect.isTrue(generated.contains('return c + c;'));
+ runTest() async {
+ String generated = await compileAll(TEST);
+ Expect.isTrue(generated.contains('return c + c;'),
+ "Expected generated code to contain 'return c + c;':\n$generated");
}
asyncTest(() async {
- print('--test from ast---------------------------------------------------');
- await runTest(useKernel: false);
- // TODO(johnniwinther): This test only works with the mock compiler.
- //print('--test from kernel----------------------------------------------');
- //await runTest(useKernel: true);
+ print('--test from kernel----------------------------------------------');
+ await runTest();
});
}
diff --git a/tests/compiler/dart2js/codegen/simple_function_subtype_test.dart b/tests/compiler/dart2js/codegen/simple_function_subtype_test.dart
index 7821d4a..6f64cdf 100644
--- a/tests/compiler/dart2js/codegen/simple_function_subtype_test.dart
+++ b/tests/compiler/dart2js/codegen/simple_function_subtype_test.dart
@@ -51,9 +51,8 @@
""";
main() {
- runTest({bool useKernel}) async {
- await compile(TEST, entry: 'foo', useKernel: useKernel,
- check: (String generated) {
+ runTest() async {
+ await compile(TEST, entry: 'foo', check: (String generated) {
for (int i = 0; i <= 15; i++) {
String predicateCheck = '.\$is_args$i';
Expect.isTrue(generated.contains(predicateCheck),
@@ -65,9 +64,7 @@
}
asyncTest(() async {
- print('--test from ast---------------------------------------------------');
- await runTest(useKernel: false);
print('--test from kernel------------------------------------------------');
- await runTest(useKernel: true);
+ await runTest();
});
}
diff --git a/tests/compiler/dart2js/codegen/simple_inferrer_relations_test.dart b/tests/compiler/dart2js/codegen/simple_inferrer_relations_test.dart
index b89d27a..6eef9bb 100644
--- a/tests/compiler/dart2js/codegen/simple_inferrer_relations_test.dart
+++ b/tests/compiler/dart2js/codegen/simple_inferrer_relations_test.dart
@@ -50,9 +50,8 @@
""";
void main() {
- runTest({bool useKernel}) async {
- String generated = await compileAll(TEST,
- compileMode: useKernel ? CompileMode.kernel : CompileMode.memory);
+ runTest() async {
+ String generated = await compileAll(TEST);
if (generated.contains(r'=== true')) {
print(generated);
Expect.fail("missing elision of '=== true'");
@@ -60,9 +59,7 @@
}
asyncTest(() async {
- print('--test from ast---------------------------------------------------');
- await runTest(useKernel: false);
print('--test from kernel------------------------------------------------');
- await runTest(useKernel: true);
+ await runTest();
});
}
diff --git a/tests/compiler/dart2js/codegen/ssa_phi_codegen_test.dart b/tests/compiler/dart2js/codegen/ssa_phi_codegen_test.dart
index 8aa46ad..b5fd0c1 100644
--- a/tests/compiler/dart2js/codegen/ssa_phi_codegen_test.dart
+++ b/tests/compiler/dart2js/codegen/ssa_phi_codegen_test.dart
@@ -69,39 +69,29 @@
""";
main() {
- runTests({bool useKernel}) async {
- await compileAndMatchFuzzy(TEST_ONE, 'foo', "var x = x === true \\? 2 : 3;",
- useKernel: useKernel);
- await compileAndMatchFuzzy(TEST_ONE, 'foo', "print\\(x\\);",
- useKernel: useKernel);
+ runTests() async {
+ await compileAndMatchFuzzy(
+ TEST_ONE, 'foo', "var x = x === true \\? 2 : 3;");
+ await compileAndMatchFuzzy(TEST_ONE, 'foo', "print\\(x\\);");
- await compileAndMatchFuzzy(TEST_TWO, 'main', "x \\+= 10",
- useKernel: useKernel);
- await compileAndMatchFuzzy(TEST_TWO, 'main', "\\+\\+x",
- useKernel: useKernel);
+ await compileAndMatchFuzzy(TEST_TWO, 'main', "x \\+= 10");
+ await compileAndMatchFuzzy(TEST_TWO, 'main', "\\+\\+x");
// Check that we don't have 'd = d' (using regexp back references).
- await compileAndDoNotMatchFuzzy(TEST_THREE, 'foo', '(x) = \1',
- useKernel: useKernel);
- await compileAndMatchFuzzy(TEST_THREE, 'foo', 'return x',
- useKernel: useKernel);
+ await compileAndDoNotMatchFuzzy(TEST_THREE, 'foo', '(x) = \1');
+ await compileAndMatchFuzzy(TEST_THREE, 'foo', 'return x');
// Check that a store just after the declaration of the local
// only generates one instruction.
- await compileAndMatchFuzzy(TEST_THREE, 'foo', 'x = 42',
- useKernel: useKernel);
+ await compileAndMatchFuzzy(TEST_THREE, 'foo', 'x = 42');
- await compileAndDoNotMatchFuzzy(TEST_FOUR, 'foo', '(x) = \1;',
- useKernel: useKernel);
+ await compileAndDoNotMatchFuzzy(TEST_FOUR, 'foo', '(x) = \1;');
- await compileAndDoNotMatch(TEST_FIVE, 'main', new RegExp('hash0'),
- useKernel: useKernel);
+ await compileAndDoNotMatch(TEST_FIVE, 'main', new RegExp('hash0'));
}
asyncTest(() async {
- print('--test from ast---------------------------------------------------');
- await runTests(useKernel: false);
print('--test from kernel------------------------------------------------');
- await runTests(useKernel: true);
+ await runTests();
});
}
diff --git a/tests/compiler/dart2js/codegen/static_closure_test.dart b/tests/compiler/dart2js/codegen/static_closure_test.dart
index 67fe7d1..7865768 100644
--- a/tests/compiler/dart2js/codegen/static_closure_test.dart
+++ b/tests/compiler/dart2js/codegen/static_closure_test.dart
@@ -9,9 +9,8 @@
import '../compiler_helper.dart';
main() {
- runTest({bool useKernel}) async {
- String code = await compileAll(r'''main() { print(main); }''',
- compileMode: useKernel ? CompileMode.kernel : CompileMode.mock);
+ runTest() async {
+ String code = await compileAll(r'''main() { print(main); }''');
// At some point, we will have to closurize global functions
// differently, at which point this test will break. Then it is time
// to implement a way to call a Dart closure from JS foreign
@@ -21,15 +20,12 @@
// toStringWrapper in captureStackTrace in js_helper.dart.
Expect.isTrue(
code.contains(
- new RegExp(r'print\([$A-Z]+\.lib___main\$closure\(\)\);')),
+ new RegExp(r'print\([$A-Z]+\.main__main\$closure\(\)\);')),
code);
}
asyncTest(() async {
- print('--test from ast---------------------------------------------------');
- await runTest(useKernel: false);
- // TODO(johnniwinther): This test only works with the mock compiler.
- //print('--test from kernel----------------------------------------------');
- //await runTest(useKernel: true);
+ print('--test from kernel----------------------------------------------');
+ await runTest();
});
}
diff --git a/tests/compiler/dart2js/codegen/strength_eq_test.dart b/tests/compiler/dart2js/codegen/strength_eq_test.dart
index c8d9f29..327c9cc 100644
--- a/tests/compiler/dart2js/codegen/strength_eq_test.dart
+++ b/tests/compiler/dart2js/codegen/strength_eq_test.dart
@@ -24,17 +24,15 @@
""";
main() {
- runTest({bool useKernel}) async {
+ runTest() async {
// The `==` is strengthened to a HIdentity instruction. The HIdentity follows
// `x.link`, so x cannot be `null`.
var compare = new RegExp(r'x === x\.get\$link\(\)');
- await compileAndMatch(CODE, 'main', compare, useKernel: useKernel);
+ await compileAndMatch(CODE, 'main', compare);
}
asyncTest(() async {
- print('--test from ast---------------------------------------------------');
- await runTest(useKernel: false);
print('--test from kernel------------------------------------------------');
- await runTest(useKernel: true);
+ await runTest();
});
}
diff --git a/tests/compiler/dart2js/codegen/string_add_test.dart b/tests/compiler/dart2js/codegen/string_add_test.dart
index 1be733a..da069f1 100644
--- a/tests/compiler/dart2js/codegen/string_add_test.dart
+++ b/tests/compiler/dart2js/codegen/string_add_test.dart
@@ -7,16 +7,13 @@
import '../compiler_helper.dart';
main() {
- runTest({bool useKernel}) async {
- String code = await compileAll(r'''main() { return "foo" + "bar"; }''',
- compileMode: useKernel ? CompileMode.kernel : CompileMode.memory);
+ runTest() async {
+ String code = await compileAll(r'''main() { return "foo" + "bar"; }''');
Expect.isTrue(!code.contains(r'$add'));
}
asyncTest(() async {
- print('--test from ast---------------------------------------------------');
- await runTest(useKernel: false);
print('--test from kernel------------------------------------------------');
- await runTest(useKernel: true);
+ await runTest();
});
}
diff --git a/tests/compiler/dart2js/codegen/string_escapes_test.dart b/tests/compiler/dart2js/codegen/string_escapes_test.dart
index 14b69d8..c765230 100644
--- a/tests/compiler/dart2js/codegen/string_escapes_test.dart
+++ b/tests/compiler/dart2js/codegen/string_escapes_test.dart
@@ -10,75 +10,94 @@
// Test that the compiler handles string literals containing line terminators.
main() {
- runTests({bool useKernel}) async {
+ runTests() async {
Future<String> compileExpression(String expression) {
var source = "foo() { return $expression; }";
- return compile(source, entry: "foo", useKernel: useKernel);
+ return compile(source, entry: "foo");
}
await compileExpression("''' \n\r\u2028\u2029'''").then((String generated) {
- Expect.isTrue(generated.contains(r'"\r\u2028\u2029"') ||
- generated.contains(r"'\r\u2028\u2029'"));
+ Expect.isTrue(
+ generated.contains(r'"\r\u2028\u2029"') ||
+ generated.contains(r"'\r\u2028\u2029'"),
+ generated);
});
await compileExpression("r''' \n\r\u2028\u2029'''")
.then((String generated) {
- Expect.isTrue(generated.contains(r'"\r\u2028\u2029"') ||
- generated.contains(r"'\r\u2028\u2029'"));
+ Expect.isTrue(
+ generated.contains(r'"\r\u2028\u2029"') ||
+ generated.contains(r"'\r\u2028\u2029'"),
+ generated);
});
await compileExpression("r''' \r\n\u2028\u2029'''")
.then((String generated) {
- Expect.isTrue(generated.contains(r'"\u2028\u2029"') ||
- generated.contains(r"'\u2028\u2029'"));
+ Expect.isTrue(
+ generated.contains(r'"\u2028\u2029"') ||
+ generated.contains(r"'\u2028\u2029'"),
+ generated);
});
await compileExpression("r''' \r\u2028\u2029'''").then((String generated) {
- Expect.isTrue(generated.contains(r'"\u2028\u2029"') ||
- generated.contains(r"'\u2028\u2029'"));
+ Expect.isTrue(
+ generated.contains(r'"\u2028\u2029"') ||
+ generated.contains(r"'\u2028\u2029'"),
+ generated);
});
await compileExpression("r''' \n\u2028\u2029'''").then((String generated) {
- Expect.isTrue(generated.contains(r'"\u2028\u2029"') ||
- generated.contains(r"'\u2028\u2029'"));
+ Expect.isTrue(
+ generated.contains(r'"\u2028\u2029"') ||
+ generated.contains(r"'\u2028\u2029'"),
+ generated);
});
await compileExpression(
"r'''\t\t \t\t \t\t \t \t \n\r\u2028\u2029'''")
.then((String generated) {
- Expect.isTrue(generated.contains(r'"\r\u2028\u2029"') ||
- generated.contains(r"'\r\u2028\u2029'"));
+ Expect.isTrue(
+ generated.contains(r'"\r\u2028\u2029"') ||
+ generated.contains(r"'\r\u2028\u2029'"),
+ generated);
});
await compileExpression(
"r'''\\\t\\\t \\ \\ \t\\\t \t \\\n\r\u2028\u2029'''")
.then((String generated) {
- Expect.isTrue(generated.contains(r'"\r\u2028\u2029"') ||
- generated.contains(r"'\r\u2028\u2029'"));
+ Expect.isTrue(
+ generated.contains(r'"\r\u2028\u2029"') ||
+ generated.contains(r"'\r\u2028\u2029'"),
+ generated);
});
await compileExpression(
"r'''\t\t \t\t \t\t \t \t \\\n\r\u2028\u2029'''")
.then((String generated) {
- Expect.isTrue(generated.contains(r'"\r\u2028\u2029"') ||
- generated.contains(r"'\r\u2028\u2029'"));
+ Expect.isTrue(
+ generated.contains(r'"\r\u2028\u2029"') ||
+ generated.contains(r"'\r\u2028\u2029'"),
+ generated);
});
await compileExpression(
"r'''\\\t\\\t \\ \\ \t\\\t \\\r\n\u2028\u2029'''")
.then((String generated) {
- Expect.isTrue(generated.contains(r'"\u2028\u2029"') ||
- generated.contains(r"'\u2028\u2029'"));
+ Expect.isTrue(
+ generated.contains(r'"\u2028\u2029"') ||
+ generated.contains(r"'\u2028\u2029'"),
+ generated);
});
await compileExpression(
"r'''\\\t\\\t \\ \\ \t\\\t \\\r\u2028\u2029'''")
.then((String generated) {
- Expect.isTrue(generated.contains(r'"\u2028\u2029"') ||
- generated.contains(r"'\u2028\u2029'"));
+ Expect.isTrue(
+ generated.contains(r'"\u2028\u2029"') ||
+ generated.contains(r"'\u2028\u2029'"),
+ generated);
});
await compileExpression("'\u2028\u2029'").then((String generated) {
- Expect.isTrue(generated.contains(r'"\u2028\u2029"') ||
- generated.contains(r"'\u2028\u2029'"));
+ Expect.isTrue(
+ generated.contains(r'"\u2028\u2029"') ||
+ generated.contains(r"'\u2028\u2029'"),
+ generated);
});
}
asyncTest(() async {
- print('--test from ast---------------------------------------------------');
- await runTests(useKernel: false);
- // TODO(johnniwinther): This test doesn't work with kernel.
- //print('--test from kernel----------------------------------------------');
- //await runTests(useKernel: true);
+ print('--test from kernel----------------------------------------------');
+ await runTests();
});
}
diff --git a/tests/compiler/dart2js/codegen/string_interpolation_test.dart b/tests/compiler/dart2js/codegen/string_interpolation_test.dart
index 13cbbfa..1e3f2ed 100644
--- a/tests/compiler/dart2js/codegen/string_interpolation_test.dart
+++ b/tests/compiler/dart2js/codegen/string_interpolation_test.dart
@@ -7,25 +7,18 @@
import '../compiler_helper.dart';
main() {
- runTests({bool useKernel}) async {
- CompileMode compileMode =
- useKernel ? CompileMode.kernel : CompileMode.memory;
-
- String code1 = await compileAll(
- r'''main() { return "${2}${true}${'a'}${3.14}"; }''',
- compileMode: compileMode);
+ runTests() async {
+ String code1 =
+ await compileAll(r'''main() { return "${2}${true}${'a'}${3.14}"; }''');
Expect.isTrue(code1.contains(r'2truea3.14'));
- String code2 = await compileAll(
- r'''main() { return "foo ${new Object()}"; }''',
- compileMode: compileMode);
+ String code2 =
+ await compileAll(r'''main() { return "foo ${new Object()}"; }''');
Expect.isFalse(code2.contains(r'$add'));
}
asyncTest(() async {
- print('--test from ast---------------------------------------------------');
- await runTests(useKernel: false);
print('--test from kernel------------------------------------------------');
- await runTests(useKernel: true);
+ await runTests();
});
}
diff --git a/tests/compiler/dart2js/codegen/switch_empty_default_test.dart b/tests/compiler/dart2js/codegen/switch_empty_default_test.dart
index 1250ef7..4fc1bf7 100644
--- a/tests/compiler/dart2js/codegen/switch_empty_default_test.dart
+++ b/tests/compiler/dart2js/codegen/switch_empty_default_test.dart
@@ -119,19 +119,17 @@
var defOrCase3 = new RegExp(r"(default:|case 3):");
var case3 = new RegExp(r"case 3:");
- runTests({bool useKernel}) async {
- await compileAndDoNotMatch(SIMPLY_EMPTY, 'main', def, useKernel: useKernel);
- await compileAndDoNotMatch(TOTAL, 'main', defOrCase3, useKernel: useKernel);
- await compileAndDoNotMatch(OPTIMIZED, 'main', def, useKernel: useKernel);
- await compileAndMatch(LABEL, 'main', case3, useKernel: useKernel);
- await compileAndMatch(DEFLABEL, 'main', def, useKernel: useKernel);
- await compileAndMatch(EMPTYDEFLABEL, 'main', def, useKernel: useKernel);
+ runTests() async {
+ await compileAndDoNotMatch(SIMPLY_EMPTY, 'main', def);
+ await compileAndDoNotMatch(TOTAL, 'main', defOrCase3);
+ await compileAndDoNotMatch(OPTIMIZED, 'main', def);
+ await compileAndMatch(LABEL, 'main', case3);
+ await compileAndMatch(DEFLABEL, 'main', def);
+ await compileAndMatch(EMPTYDEFLABEL, 'main', def);
}
asyncTest(() async {
- print('--test from ast---------------------------------------------------');
- await runTests(useKernel: false);
print('--test from kernel------------------------------------------------');
- await runTests(useKernel: true);
+ await runTests();
});
}
diff --git a/tests/compiler/dart2js/codegen/tdiv_test.dart b/tests/compiler/dart2js/codegen/tdiv_test.dart
index f894754..0101c71 100644
--- a/tests/compiler/dart2js/codegen/tdiv_test.dart
+++ b/tests/compiler/dart2js/codegen/tdiv_test.dart
@@ -61,12 +61,9 @@
""";
main() {
- runTests({bool useKernel}) async {
+ runTests() async {
Future check(String test) {
- return compile(test,
- entry: 'foo',
- useKernel: useKernel,
- check: checkerForAbsentPresent(test));
+ return compile(test, entry: 'foo', check: checkerForAbsentPresent(test));
}
await check(TEST1);
@@ -77,9 +74,7 @@
}
asyncTest(() async {
- print('--test from ast---------------------------------------------------');
- await runTests(useKernel: false);
print('--test from kernel------------------------------------------------');
- await runTests(useKernel: true);
+ await runTests();
});
}
diff --git a/tests/compiler/dart2js/codegen/top_level_closure_tree_shake_test.dart b/tests/compiler/dart2js/codegen/top_level_closure_tree_shake_test.dart
index 277c631..5f21bfe 100644
--- a/tests/compiler/dart2js/codegen/top_level_closure_tree_shake_test.dart
+++ b/tests/compiler/dart2js/codegen/top_level_closure_tree_shake_test.dart
@@ -26,17 +26,14 @@
""";
main() {
- runTest({bool useKernel}) async {
- String generated = await compileAll(TEST_ONE,
- compileMode: useKernel ? CompileMode.kernel : CompileMode.memory);
+ runTest() async {
+ String generated = await compileAll(TEST_ONE);
Expect.isFalse(generated.contains('Tarantula!'), "failed to remove 'foo'");
Expect.isTrue(generated.contains('Coelacanth!'));
}
asyncTest(() async {
- print('--test from ast---------------------------------------------------');
- await runTest(useKernel: false);
print('--test from kernel------------------------------------------------');
- await runTest(useKernel: true);
+ await runTest();
});
}
diff --git a/tests/compiler/dart2js/codegen/tree_shaking_test.dart b/tests/compiler/dart2js/codegen/tree_shaking_test.dart
index 4d47a5f..2d8d365 100644
--- a/tests/compiler/dart2js/codegen/tree_shaking_test.dart
+++ b/tests/compiler/dart2js/codegen/tree_shaking_test.dart
@@ -26,18 +26,15 @@
""";
void main() {
- runTest({bool useKernel}) async {
- String generated = await compileAll(TEST,
- compileMode: useKernel ? CompileMode.kernel : CompileMode.memory);
+ runTest() async {
+ String generated = await compileAll(TEST);
Expect.isTrue(generated.contains('return 42'));
Expect.isTrue(generated.contains('return 54'));
Expect.isFalse(generated.contains('return 68'));
}
asyncTest(() async {
- print('--test from ast---------------------------------------------------');
- await runTest(useKernel: false);
print('--test from kernel------------------------------------------------');
- await runTest(useKernel: true);
+ await runTest();
});
}
diff --git a/tests/compiler/dart2js/codegen/trust_type_annotations2_test.dart b/tests/compiler/dart2js/codegen/trust_type_annotations2_test.dart
index ba65ade..b5b8bdd 100644
--- a/tests/compiler/dart2js/codegen/trust_type_annotations2_test.dart
+++ b/tests/compiler/dart2js/codegen/trust_type_annotations2_test.dart
@@ -25,11 +25,8 @@
};
main() {
- runTest({bool useKernel}) async {
+ runTest() async {
var options = [Flags.trustTypeAnnotations];
- if (!useKernel) {
- options.add(Flags.useOldFrontend);
- }
var result = await runCompiler(
memorySourceFiles: MEMORY_SOURCE_FILES, options: options);
var compiler = result.compiler;
@@ -40,9 +37,7 @@
}
asyncTest(() async {
- print('--test from ast---------------------------------------------------');
- await runTest(useKernel: false);
print('--test from kernel------------------------------------------------');
- await runTest(useKernel: true);
+ await runTest();
});
}
diff --git a/tests/compiler/dart2js/codegen/trust_type_annotations_test.dart b/tests/compiler/dart2js/codegen/trust_type_annotations_test.dart
index ff423ac..4e8b777 100644
--- a/tests/compiler/dart2js/codegen/trust_type_annotations_test.dart
+++ b/tests/compiler/dart2js/codegen/trust_type_annotations_test.dart
@@ -50,11 +50,8 @@
""";
void main() {
- runTest({bool useKernel}) async {
+ runTest() async {
var options = [Flags.trustTypeAnnotations];
- if (!useKernel) {
- options.add(Flags.useOldFrontend);
- }
var result = await runCompiler(
memorySourceFiles: {'main.dart': TEST}, options: options);
var compiler = result.compiler;
@@ -89,9 +86,7 @@
}
asyncTest(() async {
- print('--test from ast---------------------------------------------------');
- await runTest(useKernel: false);
print('--test from kernel------------------------------------------------');
- await runTest(useKernel: true);
+ await runTest();
});
}
diff --git a/tests/compiler/dart2js/codegen/type_guard_unuser_test.dart b/tests/compiler/dart2js/codegen/type_guard_unuser_test.dart
index 43bd9e8..3232909 100644
--- a/tests/compiler/dart2js/codegen/type_guard_unuser_test.dart
+++ b/tests/compiler/dart2js/codegen/type_guard_unuser_test.dart
@@ -41,7 +41,7 @@
""";
main() {
- runTests({bool useKernel}) async {
+ runTests() async {
await compile(TEST_ONE, entry: 'foo', check: (String generated) {
RegExp regexp = new RegExp(getIntTypeCheck(anyIdentifier));
Iterator<Match> matches = regexp.allMatches(generated).iterator;
@@ -70,9 +70,7 @@
}
asyncTest(() async {
- print('--test from ast---------------------------------------------------');
- await runTests(useKernel: false);
print('--test from kernel------------------------------------------------');
- await runTests(useKernel: true);
+ await runTests();
});
}
diff --git a/tests/compiler/dart2js/codegen/type_inference2_test.dart b/tests/compiler/dart2js/codegen/type_inference2_test.dart
index 60b8899..415f8fc 100644
--- a/tests/compiler/dart2js/codegen/type_inference2_test.dart
+++ b/tests/compiler/dart2js/codegen/type_inference2_test.dart
@@ -14,14 +14,12 @@
""";
main() {
- runTest({bool useKernel}) async {
- await compileAndMatchFuzzy(TEST_ONE, 'sum', r"\+\+x", useKernel: useKernel);
+ runTest() async {
+ await compileAndMatchFuzzy(TEST_ONE, 'sum', r"\+\+x");
}
asyncTest(() async {
- print('--test from ast---------------------------------------------------');
- await runTest(useKernel: false);
print('--test from kernel------------------------------------------------');
- await runTest(useKernel: true);
+ await runTest();
});
}
diff --git a/tests/compiler/dart2js/codegen/type_inference3_test.dart b/tests/compiler/dart2js/codegen/type_inference3_test.dart
index 8cb9a1b..8574b25 100644
--- a/tests/compiler/dart2js/codegen/type_inference3_test.dart
+++ b/tests/compiler/dart2js/codegen/type_inference3_test.dart
@@ -15,9 +15,8 @@
""";
main() {
- runTest({bool useKernel}) async {
- await compile(TEST_ONE, entry: 'sum', useKernel: useKernel,
- check: (String generated) {
+ runTest() async {
+ await compile(TEST_ONE, entry: 'sum', check: (String generated) {
RegExp regexp = new RegExp(getNumberTypeCheck('(param1|b)'));
Expect.isTrue(
regexp.hasMatch(generated), '$regexp not found in:\n$generated');
@@ -25,9 +24,7 @@
}
asyncTest(() async {
- print('--test from ast---------------------------------------------------');
- await runTest(useKernel: false);
print('--test from kernel------------------------------------------------');
- await runTest(useKernel: true);
+ await runTest();
});
}
diff --git a/tests/compiler/dart2js/codegen/type_inference4_test.dart b/tests/compiler/dart2js/codegen/type_inference4_test.dart
index 300826d..6dc393f 100644
--- a/tests/compiler/dart2js/codegen/type_inference4_test.dart
+++ b/tests/compiler/dart2js/codegen/type_inference4_test.dart
@@ -17,9 +17,8 @@
""";
main() {
- runTest({bool useKernel}) async {
- await compile(TEST_ONE, entry: 'foo', useKernel: useKernel,
- check: (String generated) {
+ runTest() async {
+ await compile(TEST_ONE, entry: 'foo', check: (String generated) {
// Test for absence of an illegal argument exception. This means that the
// arguments are known to be integers.
Expect.isFalse(generated.contains('iae'));
@@ -31,9 +30,7 @@
}
asyncTest(() async {
- print('--test from ast---------------------------------------------------');
- await runTest(useKernel: false);
print('--test from kernel------------------------------------------------');
- await runTest(useKernel: true);
+ await runTest();
});
}
diff --git a/tests/compiler/dart2js/codegen/type_inference5_test.dart b/tests/compiler/dart2js/codegen/type_inference5_test.dart
index 3e43f2b..75799aa 100644
--- a/tests/compiler/dart2js/codegen/type_inference5_test.dart
+++ b/tests/compiler/dart2js/codegen/type_inference5_test.dart
@@ -16,9 +16,8 @@
""";
main() {
- runTest({bool useKernel}) async {
- await compile(TEST_ONE, entry: 'foo', useKernel: useKernel,
- check: (String generated) {
+ runTest() async {
+ await compile(TEST_ONE, entry: 'foo', check: (String generated) {
// Test for absence of an illegal argument exception. This means that the
// arguments are known to be integers.
Expect.isFalse(generated.contains('iae'));
@@ -33,9 +32,7 @@
}
asyncTest(() async {
- print('--test from ast---------------------------------------------------');
- await runTest(useKernel: false);
print('--test from kernel------------------------------------------------');
- await runTest(useKernel: true);
+ await runTest();
});
}
diff --git a/tests/compiler/dart2js/codegen/type_inference8_test.dart b/tests/compiler/dart2js/codegen/type_inference8_test.dart
index 9c37e97..e1be1bb 100644
--- a/tests/compiler/dart2js/codegen/type_inference8_test.dart
+++ b/tests/compiler/dart2js/codegen/type_inference8_test.dart
@@ -9,6 +9,7 @@
import "package:compiler/src/types/types.dart";
import "package:expect/expect.dart";
import '../compiler_helper.dart';
+import '../memory_compiler.dart';
import 'dart:async';
@@ -31,27 +32,27 @@
}
""";
-Future runTest1() {
- Uri uri = new Uri(scheme: 'source');
- var compiler = mockCompilerFor(TEST1, uri);
- return compiler.run(uri).then((_) {
- var typesInferrer = compiler.globalInference.typesInferrerInternal;
- var commonMasks = typesInferrer.closedWorld.commonMasks;
- MemberElement element = findElement(compiler, "foo");
- var mask = typesInferrer.getReturnTypeOfMember(element);
- var falseType =
- new ValueTypeMask(commonMasks.boolType, new FalseConstantValue());
- // 'foo' should always return false
- Expect.equals(falseType, mask);
- // the argument to 'bar' is always false
- dynamic bar = findElement(compiler, "bar");
- var barArg = bar.parameters.first;
- var barArgMask = typesInferrer.getTypeOfParameter(barArg);
- Expect.equals(falseType, barArgMask);
- var barCode = compiler.backend.getGeneratedCode(bar);
- Expect.isTrue(barCode.contains('"bbb"'));
- Expect.isFalse(barCode.contains('"aaa"'));
- });
+Future runTest1() async {
+ var result = await runCompiler(
+ memorySourceFiles: {'main.dart': TEST1},
+ options: ['--use-old-frontend', '--disable-inlining']);
+ var compiler = result.compiler;
+ var typesInferrer = compiler.globalInference.typesInferrerInternal;
+ var commonMasks = typesInferrer.closedWorld.abstractValueDomain;
+ MemberElement element = findElement(compiler, "foo");
+ var mask = typesInferrer.getReturnTypeOfMember(element);
+ var falseType =
+ new ValueTypeMask(commonMasks.boolType, new FalseConstantValue());
+ // 'foo' should always return false
+ Expect.equals(falseType, mask);
+ // the argument to 'bar' is always false
+ dynamic bar = findElement(compiler, "bar");
+ var barArg = bar.parameters.first;
+ var barArgMask = typesInferrer.getTypeOfParameter(barArg);
+ Expect.equals(falseType, barArgMask);
+ var barCode = compiler.backend.getGeneratedCode(bar);
+ Expect.isTrue(barCode.contains('"bbb"'));
+ Expect.isFalse(barCode.contains('"aaa"'));
}
const String TEST2 = r"""
@@ -74,26 +75,26 @@
}
""";
-Future runTest2() {
- Uri uri = new Uri(scheme: 'source');
- var compiler = mockCompilerFor(TEST2, uri);
- return compiler.run(uri).then((_) {
- var typesInferrer = compiler.globalInference.typesInferrerInternal;
- var commonMasks = typesInferrer.closedWorld.commonMasks;
- MemberElement element = findElement(compiler, "foo");
- var mask = typesInferrer.getReturnTypeOfMember(element);
- // Can't infer value for foo's return type, it could be either true or false
- Expect.identical(commonMasks.boolType, mask);
- dynamic bar = findElement(compiler, "bar");
- var barArg = bar.parameters.first;
- var barArgMask = typesInferrer.getTypeOfParameter(barArg);
- // The argument to bar should have the same type as the return type of foo
- Expect.identical(commonMasks.boolType, barArgMask);
- var barCode = compiler.backend.getGeneratedCode(bar);
- Expect.isTrue(barCode.contains('"bbb"'));
- // Still must output the print for "aaa"
- Expect.isTrue(barCode.contains('"aaa"'));
- });
+Future runTest2() async {
+ var result = await runCompiler(
+ memorySourceFiles: {'main.dart': TEST2},
+ options: ['--use-old-frontend', '--disable-inlining']);
+ var compiler = result.compiler;
+ var typesInferrer = compiler.globalInference.typesInferrerInternal;
+ var commonMasks = typesInferrer.closedWorld.abstractValueDomain;
+ MemberElement element = findElement(compiler, "foo");
+ var mask = typesInferrer.getReturnTypeOfMember(element);
+ // Can't infer value for foo's return type, it could be either true or false
+ Expect.identical(commonMasks.boolType, mask);
+ dynamic bar = findElement(compiler, "bar");
+ var barArg = bar.parameters.first;
+ var barArgMask = typesInferrer.getTypeOfParameter(barArg);
+ // The argument to bar should have the same type as the return type of foo
+ Expect.identical(commonMasks.boolType, barArgMask);
+ var barCode = compiler.backend.getGeneratedCode(bar);
+ Expect.isTrue(barCode.contains('"bbb"'));
+ // Still must output the print for "aaa"
+ Expect.isTrue(barCode.contains('"aaa"'));
}
main() {
diff --git a/tests/compiler/dart2js/codegen/types_of_captured_variables_test.dart b/tests/compiler/dart2js/codegen/types_of_captured_variables_test.dart
index 02d60de..0326068 100644
--- a/tests/compiler/dart2js/codegen/types_of_captured_variables_test.dart
+++ b/tests/compiler/dart2js/codegen/types_of_captured_variables_test.dart
@@ -35,28 +35,23 @@
""";
main() {
- runTests({bool useKernel}) async {
- CompileMode compileMode =
- useKernel ? CompileMode.kernel : CompileMode.memory;
-
+ runTests() async {
// Test that we know the type of captured, non-mutated variables.
- String generated1 = await compileAll(TEST1, compileMode: compileMode);
+ String generated1 = await compileAll(TEST1);
Expect.isTrue(generated1.contains('+ 87'));
// Test that we know the type of captured, mutated variables.
- String generated2 = await compileAll(TEST2, compileMode: compileMode);
+ String generated2 = await compileAll(TEST2);
Expect.isTrue(generated2.contains('+ 87'));
// Test that we know when types of a captured, mutated variable
// conflict.
- String generated3 = await compileAll(TEST3, compileMode: compileMode);
+ String generated3 = await compileAll(TEST3);
Expect.isFalse(generated3.contains('+ 87'));
}
asyncTest(() async {
- print('--test from ast---------------------------------------------------');
- await runTests(useKernel: false);
print('--test from kernel------------------------------------------------');
- await runTests(useKernel: true);
+ await runTests();
});
}
diff --git a/tests/compiler/dart2js/codegen/unused_empty_map_test.dart b/tests/compiler/dart2js/codegen/unused_empty_map_test.dart
index db577be..dd7d6fb 100644
--- a/tests/compiler/dart2js/codegen/unused_empty_map_test.dart
+++ b/tests/compiler/dart2js/codegen/unused_empty_map_test.dart
@@ -6,7 +6,6 @@
import 'package:async_helper/async_helper.dart';
import 'package:compiler/compiler_new.dart';
-import 'package:compiler/src/commandline_options.dart';
import 'package:expect/expect.dart';
import '../memory_compiler.dart';
@@ -22,20 +21,16 @@
const HASHMAP_EMPTY_CONSTRUCTOR = r"LinkedHashMap_LinkedHashMap$_empty";
main() {
- runTest({bool useKernel}) async {
+ runTest() async {
var collector = new OutputCollector();
await runCompiler(
- memorySourceFiles: TEST_SOURCE,
- outputProvider: collector,
- options: useKernel ? [] : [Flags.useOldFrontend]);
+ memorySourceFiles: TEST_SOURCE, outputProvider: collector);
String generated = collector.getOutput('', OutputType.js);
Expect.isFalse(generated.contains(HASHMAP_EMPTY_CONSTRUCTOR));
}
asyncTest(() async {
- print('--test from ast---------------------------------------------------');
- await runTest(useKernel: false);
print('--test from kernel------------------------------------------------');
- await runTest(useKernel: true);
+ await runTest();
});
}
diff --git a/tests/compiler/dart2js/codegen/use_checks_test.dart b/tests/compiler/dart2js/codegen/use_checks_test.dart
index 283e81c..0d50d070 100644
--- a/tests/compiler/dart2js/codegen/use_checks_test.dart
+++ b/tests/compiler/dart2js/codegen/use_checks_test.dart
@@ -24,9 +24,8 @@
};
main() {
- runTest({bool useKernel}) async {
+ runTest() async {
var options = [Flags.enableCheckedMode];
- if (!useKernel) options.add(Flags.useOldFrontend);
var result = await runCompiler(
memorySourceFiles: MEMORY_SOURCE_FILES, options: options);
var compiler = result.compiler;
@@ -37,9 +36,7 @@
}
asyncTest(() async {
- print('--test from ast---------------------------------------------------');
- await runTest(useKernel: false);
print('--test from kernel------------------------------------------------');
- await runTest(useKernel: true);
+ await runTest();
});
}
diff --git a/tests/compiler/dart2js/codegen/use_strict_test.dart b/tests/compiler/dart2js/codegen/use_strict_test.dart
index fe3cd70..6c65a7f 100644
--- a/tests/compiler/dart2js/codegen/use_strict_test.dart
+++ b/tests/compiler/dart2js/codegen/use_strict_test.dart
@@ -4,7 +4,6 @@
import 'package:async_helper/async_helper.dart';
import 'package:compiler/compiler_new.dart';
-import 'package:compiler/src/commandline_options.dart';
import 'package:expect/expect.dart';
import '../memory_compiler.dart';
@@ -48,12 +47,10 @@
};
main() {
- runTest({bool useKernel}) async {
+ runTest() async {
OutputCollector collector = new OutputCollector();
await runCompiler(
- memorySourceFiles: MEMORY_SOURCE_FILES,
- outputProvider: collector,
- options: useKernel ? [] : [Flags.useOldFrontend]);
+ memorySourceFiles: MEMORY_SOURCE_FILES, outputProvider: collector);
String jsOutput = collector.getOutput('', OutputType.js);
// Skip comments.
@@ -70,9 +67,7 @@
}
asyncTest(() async {
- print('--test from ast---------------------------------------------------');
- await runTest(useKernel: false);
print('--test from kernel------------------------------------------------');
- await runTest(useKernel: true);
+ await runTest();
});
}
diff --git a/tests/compiler/dart2js/codegen/value_range2_test.dart b/tests/compiler/dart2js/codegen/value_range2_test.dart
index f4b9376..be9df0f 100644
--- a/tests/compiler/dart2js/codegen/value_range2_test.dart
+++ b/tests/compiler/dart2js/codegen/value_range2_test.dart
@@ -5,12 +5,24 @@
import "package:expect/expect.dart";
import "package:compiler/src/ssa/nodes.dart";
import "package:compiler/src/ssa/value_range_analyzer.dart";
+import "package:compiler/src/types/abstract_value_domain.dart";
import "package:compiler/src/js_backend/constant_system_javascript.dart";
ValueRangeInfo info = new ValueRangeInfo(const JavaScriptConstantSystem());
-Value instructionValue = info.newInstructionValue(new HBreak(null, null));
-Value lengthValue = info.newPositiveValue(new HBreak(null, null));
+class AbstractValueDomainMock implements AbstractValueDomain {
+ const AbstractValueDomainMock();
+
+ @override
+ noSuchMethod(Invocation invocation) => null;
+}
+
+AbstractValueDomain abstractValueDomain = const AbstractValueDomainMock();
+
+Value instructionValue =
+ info.newInstructionValue(new HBreak(abstractValueDomain, null, null));
+Value lengthValue =
+ info.newPositiveValue(new HBreak(abstractValueDomain, null, null));
Range createSingleRange(Value value) => info.newNormalizedRange(value, value);
diff --git a/tests/compiler/dart2js/codegen/value_range3_test.dart b/tests/compiler/dart2js/codegen/value_range3_test.dart
index 899f5f3..bc973e5 100644
--- a/tests/compiler/dart2js/codegen/value_range3_test.dart
+++ b/tests/compiler/dart2js/codegen/value_range3_test.dart
@@ -5,7 +5,6 @@
// Test that global analysis in dart2js propagates positive integers.
import 'package:async_helper/async_helper.dart';
-import 'package:compiler/src/commandline_options.dart';
import 'package:expect/expect.dart';
import '../memory_compiler.dart';
@@ -24,10 +23,8 @@
};
main() {
- runTest({bool useKernel}) async {
- var result = await runCompiler(
- memorySourceFiles: MEMORY_SOURCE_FILES,
- options: useKernel ? [] : [Flags.useOldFrontend]);
+ runTest() async {
+ var result = await runCompiler(memorySourceFiles: MEMORY_SOURCE_FILES);
var compiler = result.compiler;
var element =
compiler.backendClosedWorldForTesting.elementEnvironment.mainFunction;
@@ -36,9 +33,7 @@
}
asyncTest(() async {
- print('--test from ast---------------------------------------------------');
- await runTest(useKernel: false);
print('--test from kernel------------------------------------------------');
- await runTest(useKernel: true);
+ await runTest();
});
}
diff --git a/tests/compiler/dart2js/codegen/value_range_kernel_test.dart b/tests/compiler/dart2js/codegen/value_range_kernel_test.dart
deleted file mode 100644
index 1e133d6..0000000
--- a/tests/compiler/dart2js/codegen/value_range_kernel_test.dart
+++ /dev/null
@@ -1,14 +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.
-
-import 'package:async_helper/async_helper.dart';
-import 'value_range_test_helper.dart';
-
-main() {
- asyncTest(() async {
- // AST part tested in 'value_range_test.dart'.
- print('--test from kernel------------------------------------------------');
- await runTests(useKernel: true);
- });
-}
diff --git a/tests/compiler/dart2js/codegen/value_range_test.dart b/tests/compiler/dart2js/codegen/value_range_test.dart
index e03aa79..10e3f32 100644
--- a/tests/compiler/dart2js/codegen/value_range_test.dart
+++ b/tests/compiler/dart2js/codegen/value_range_test.dart
@@ -1,14 +1,298 @@
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// 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.
+import 'dart:async';
import 'package:async_helper/async_helper.dart';
-import 'value_range_test_helper.dart';
+import 'package:expect/expect.dart';
+import '../compiler_helper.dart';
+
+const int REMOVED = 0;
+const int ABOVE_ZERO = 1;
+const int BELOW_LENGTH = 2;
+const int KEPT = 3;
+const int ONE_CHECK = 4;
+const int ONE_ZERO_CHECK = 5;
+const int BELOW_ZERO_CHECK = 6;
+
+final List TESTS = [
+ """
+main() {
+ var a = new List();
+ var sum = 0;
+ for (int i = 0; i < a.length; i++) {
+ sum += a[i];
+ }
+ return sum;
+}
+""",
+ REMOVED,
+ """
+main(value) {
+ var a = new List();
+ var sum = 0;
+ for (int i = 0; i < value; i++) {
+ sum += a[i];
+ }
+ return sum;
+}
+""",
+ ABOVE_ZERO,
+ """
+main(check) {
+ // Make sure value is an int.
+ var value = check ? 42 : 54;
+ var a = new List(value);
+ var sum = 0;
+ for (int i = 0; i < value; i++) {
+ sum += a[i];
+ }
+ return sum;
+}
+""",
+ REMOVED,
+ """
+main() {
+ var a = new List();
+ return a[0];
+}
+""",
+ KEPT,
+ """
+main() {
+ var a = new List();
+ return a.removeLast();
+}
+""",
+ KEPT,
+ """
+main() {
+ var a = new List(4);
+ return a[0];
+}
+""",
+ REMOVED,
+ """
+main() {
+ var a = new List(4);
+ return a.removeLast();
+}
+""",
+ REMOVED,
+ """
+main(value) {
+ var a = new List(value);
+ return a[value];
+}
+""",
+ KEPT,
+ """
+main(value) {
+ var a = new List(1024);
+ return a[1023 & value];
+}
+""",
+ REMOVED,
+ """
+main(value) {
+ var a = new List(1024);
+ return a[1024 & value];
+}
+""",
+ ABOVE_ZERO,
+ """
+main(value) {
+ var a = new List();
+ return a[1];
+}
+""",
+ ABOVE_ZERO,
+ """
+main(value, call) {
+ var a = new List();
+ return a[value] + call() + a[value];
+}
+""",
+ ONE_ZERO_CHECK,
+ """
+main(value) {
+ var a = new List();
+ return a[1] + a[0];
+}
+""",
+ ONE_CHECK,
+ """
+main() {
+ var a = new List();
+ var sum = 0;
+ for (int i = 0; i <= a.length - 1; i++) {
+ sum += a[i];
+ }
+ return sum;
+}
+""",
+ REMOVED,
+ """
+main() {
+ var a = new List();
+ var sum = 0;
+ for (int i = a.length - 1; i >=0; i--) {
+ sum += a[i];
+ }
+ return sum;
+}
+""",
+ REMOVED,
+ """
+main(value) {
+ value = value is int ? value as int : 42;
+ int sum = ~value;
+ for (int i = 0; i < 42; i++) sum += (value & 4);
+ var a = new List();
+ if (value > a.length - 1) return;
+ if (value < 0) return;
+ return a[value];
+}
+""",
+ REMOVED,
+ """
+main(value) {
+ value = value is int ? value as int : 42;
+ int sum = ~value;
+ for (int i = 0; i < 42; i++) sum += (value & 4);
+ var a = new List();
+ if (value <= a.length - 1) {
+ if (value >= 0) {
+ return a[value];
+ }
+ }
+}
+""",
+ REMOVED,
+ """
+main(value) {
+ value = value is int ? value as int : 42;
+ int sum = ~value;
+ for (int i = 0; i < 42; i++) sum += (value & 4);
+ var a = new List();
+ if (value >= a.length) return;
+ if (value <= -1) return;
+ return a[value];
+}
+""",
+ REMOVED,
+ """
+main(value) {
+ var a = new List(4);
+ var sum = 0;
+ for (int i = 0; i < a.length; i++) {
+ sum += a[i];
+ if (sum == 0) i++;
+ }
+ return sum;
+}
+""",
+ REMOVED,
+ """
+main(value) {
+ var a = new List(5);
+ var sum = 0;
+ for (int i = a.length - 1; i >= 0; i--) {
+ sum += a[i];
+ if (sum == 0) i--;
+ }
+ return sum;
+}
+""",
+ REMOVED,
+ """
+main(value) {
+ var a = new List(6);
+ var sum = 0;
+ for (int i = 0; i < a.length; i++) {
+ sum += a[i];
+ if (sum == 0) i--;
+ }
+ return sum;
+}
+""",
+ BELOW_ZERO_CHECK,
+ """
+main(value) {
+ var a = new List(7);
+ var sum = 0;
+ for (int i = 0; i < a.length;) {
+ sum += a[i];
+ sum == 0 ? i-- : i++;
+ }
+ return sum;
+}
+""",
+ BELOW_ZERO_CHECK,
+ """
+main(value) {
+ var a = new List(7);
+ var sum = 0;
+ for (int i = -2; i < a.length; i = 0) {
+ sum += a[i];
+ }
+ return sum;
+}
+""",
+ BELOW_ZERO_CHECK,
+];
+
+Future expect(String code, int kind) {
+ return compile(code, check: (String generated) {
+ switch (kind) {
+ case REMOVED:
+ Expect.isTrue(!generated.contains('ioore'));
+ break;
+
+ case ABOVE_ZERO:
+ Expect.isTrue(!generated.contains('< 0'));
+ Expect.isTrue(generated.contains('ioore'));
+ break;
+
+ case BELOW_ZERO_CHECK:
+ Expect.isTrue(generated.contains('< 0'));
+ Expect.isTrue(!generated.contains('||'));
+ Expect.isTrue(generated.contains('ioore'));
+ break;
+
+ case BELOW_LENGTH:
+ Expect.isTrue(!generated.contains('||'));
+ Expect.isTrue(generated.contains('ioore'));
+ break;
+
+ case KEPT:
+ Expect.isTrue(generated.contains('ioore'));
+ break;
+
+ case ONE_CHECK:
+ RegExp regexp = new RegExp('ioore');
+ Iterator matches = regexp.allMatches(generated).iterator;
+ checkNumberOfMatches(matches, 1);
+ break;
+
+ case ONE_ZERO_CHECK:
+ RegExp regexp = new RegExp('< 0|>>> 0 !==');
+ Iterator matches = regexp.allMatches(generated).iterator;
+ checkNumberOfMatches(matches, 1);
+ break;
+ }
+ });
+}
+
+runTests() async {
+ for (int i = 0; i < TESTS.length; i += 2) {
+ await expect(TESTS[i], TESTS[i + 1]);
+ }
+}
main() {
asyncTest(() async {
- print('--test from ast---------------------------------------------------');
- await runTests(useKernel: false);
- // Kernel part tested in 'value_range_kernel_test.dart'.
+ print('--test from kernel------------------------------------------------');
+ await runTests();
});
}
diff --git a/tests/compiler/dart2js/codegen/value_range_test_helper.dart b/tests/compiler/dart2js/codegen/value_range_test_helper.dart
deleted file mode 100644
index c486048..0000000
--- a/tests/compiler/dart2js/codegen/value_range_test_helper.dart
+++ /dev/null
@@ -1,290 +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.
-
-import 'dart:async';
-import 'package:expect/expect.dart';
-import '../compiler_helper.dart';
-
-const int REMOVED = 0;
-const int ABOVE_ZERO = 1;
-const int BELOW_LENGTH = 2;
-const int KEPT = 3;
-const int ONE_CHECK = 4;
-const int ONE_ZERO_CHECK = 5;
-const int BELOW_ZERO_CHECK = 6;
-
-final List TESTS = [
- """
-main() {
- var a = new List();
- var sum = 0;
- for (int i = 0; i < a.length; i++) {
- sum += a[i];
- }
- return sum;
-}
-""",
- REMOVED,
- """
-main(value) {
- var a = new List();
- var sum = 0;
- for (int i = 0; i < value; i++) {
- sum += a[i];
- }
- return sum;
-}
-""",
- ABOVE_ZERO,
- """
-main(check) {
- // Make sure value is an int.
- var value = check ? 42 : 54;
- var a = new List(value);
- var sum = 0;
- for (int i = 0; i < value; i++) {
- sum += a[i];
- }
- return sum;
-}
-""",
- REMOVED,
- """
-main() {
- var a = new List();
- return a[0];
-}
-""",
- KEPT,
- """
-main() {
- var a = new List();
- return a.removeLast();
-}
-""",
- KEPT,
- """
-main() {
- var a = new List(4);
- return a[0];
-}
-""",
- REMOVED,
- """
-main() {
- var a = new List(4);
- return a.removeLast();
-}
-""",
- REMOVED,
- """
-main(value) {
- var a = new List(value);
- return a[value];
-}
-""",
- KEPT,
- """
-main(value) {
- var a = new List(1024);
- return a[1023 & value];
-}
-""",
- REMOVED,
- """
-main(value) {
- var a = new List(1024);
- return a[1024 & value];
-}
-""",
- ABOVE_ZERO,
- """
-main(value) {
- var a = new List();
- return a[1];
-}
-""",
- ABOVE_ZERO,
- """
-main(value, call) {
- var a = new List();
- return a[value] + call() + a[value];
-}
-""",
- ONE_ZERO_CHECK,
- """
-main(value) {
- var a = new List();
- return a[1] + a[0];
-}
-""",
- ONE_CHECK,
- """
-main() {
- var a = new List();
- var sum = 0;
- for (int i = 0; i <= a.length - 1; i++) {
- sum += a[i];
- }
- return sum;
-}
-""",
- REMOVED,
- """
-main() {
- var a = new List();
- var sum = 0;
- for (int i = a.length - 1; i >=0; i--) {
- sum += a[i];
- }
- return sum;
-}
-""",
- REMOVED,
- """
-main(value) {
- value = value is int ? value as int : 42;
- int sum = ~value;
- for (int i = 0; i < 42; i++) sum += (value & 4);
- var a = new List();
- if (value > a.length - 1) return;
- if (value < 0) return;
- return a[value];
-}
-""",
- REMOVED,
- """
-main(value) {
- value = value is int ? value as int : 42;
- int sum = ~value;
- for (int i = 0; i < 42; i++) sum += (value & 4);
- var a = new List();
- if (value <= a.length - 1) {
- if (value >= 0) {
- return a[value];
- }
- }
-}
-""",
- REMOVED,
- """
-main(value) {
- value = value is int ? value as int : 42;
- int sum = ~value;
- for (int i = 0; i < 42; i++) sum += (value & 4);
- var a = new List();
- if (value >= a.length) return;
- if (value <= -1) return;
- return a[value];
-}
-""",
- REMOVED,
- """
-main(value) {
- var a = new List(4);
- var sum = 0;
- for (int i = 0; i < a.length; i++) {
- sum += a[i];
- if (sum == 0) i++;
- }
- return sum;
-}
-""",
- REMOVED,
- """
-main(value) {
- var a = new List(5);
- var sum = 0;
- for (int i = a.length - 1; i >= 0; i--) {
- sum += a[i];
- if (sum == 0) i--;
- }
- return sum;
-}
-""",
- REMOVED,
- """
-main(value) {
- var a = new List(6);
- var sum = 0;
- for (int i = 0; i < a.length; i++) {
- sum += a[i];
- if (sum == 0) i--;
- }
- return sum;
-}
-""",
- BELOW_ZERO_CHECK,
- """
-main(value) {
- var a = new List(7);
- var sum = 0;
- for (int i = 0; i < a.length;) {
- sum += a[i];
- sum == 0 ? i-- : i++;
- }
- return sum;
-}
-""",
- BELOW_ZERO_CHECK,
- """
-main(value) {
- var a = new List(7);
- var sum = 0;
- for (int i = -2; i < a.length; i = 0) {
- sum += a[i];
- }
- return sum;
-}
-""",
- BELOW_ZERO_CHECK,
-];
-
-Future expect(String code, int kind, {bool useKernel}) {
- return compile(code, useKernel: useKernel, check: (String generated) {
- switch (kind) {
- case REMOVED:
- Expect.isTrue(!generated.contains('ioore'));
- break;
-
- case ABOVE_ZERO:
- Expect.isTrue(!generated.contains('< 0'));
- Expect.isTrue(generated.contains('ioore'));
- break;
-
- case BELOW_ZERO_CHECK:
- Expect.isTrue(generated.contains('< 0'));
- Expect.isTrue(!generated.contains('||'));
- Expect.isTrue(generated.contains('ioore'));
- break;
-
- case BELOW_LENGTH:
- Expect.isTrue(!generated.contains('||'));
- Expect.isTrue(generated.contains('ioore'));
- break;
-
- case KEPT:
- Expect.isTrue(generated.contains('ioore'));
- break;
-
- case ONE_CHECK:
- RegExp regexp = new RegExp('ioore');
- Iterator matches = regexp.allMatches(generated).iterator;
- checkNumberOfMatches(matches, 1);
- break;
-
- case ONE_ZERO_CHECK:
- RegExp regexp = new RegExp('< 0|>>> 0 !==');
- Iterator matches = regexp.allMatches(generated).iterator;
- checkNumberOfMatches(matches, 1);
- break;
- }
- });
-}
-
-runTests({bool useKernel}) async {
- for (int i = 0; i < TESTS.length; i += 2) {
- await expect(TESTS[i], TESTS[i + 1], useKernel: useKernel);
- }
-}
diff --git a/tests/compiler/dart2js/compiler_helper.dart b/tests/compiler/dart2js/compiler_helper.dart
index dfd7721..f1505be 100644
--- a/tests/compiler/dart2js/compiler_helper.dart
+++ b/tests/compiler/dart2js/compiler_helper.dart
@@ -34,22 +34,16 @@
export 'package:compiler/src/tree/tree.dart';
-import 'old_frontend/mock_compiler.dart';
-export 'old_frontend/mock_compiler.dart';
-
import 'memory_compiler.dart';
import 'output_collector.dart';
export 'output_collector.dart';
-enum CompileMode { mock, memory, kernel }
-
-/// Compile [code] and returns either the code for [methodName] or, if [returnAll] is
-/// true, the code for the entire program.
+/// Compile [code] and returns either the code for [methodName] or, if
+/// [returnAll] is true, the code for the entire program.
///
/// If [check] is provided, it is executed on the code for [entry] before
-/// returning. If [useMock] is `true` the [MockCompiler] is used for
-/// compilation, otherwise the memory compiler is used.
+/// returning.
Future<String> compile(String code,
{String entry: 'main',
String methodName,
@@ -58,7 +52,6 @@
bool analyzeAll: false,
bool disableInlining: true,
bool trustJSInteropTypeAnnotations: false,
- bool useKernel: false,
void check(String generatedEntry),
bool returnAll: false}) async {
OutputCollector outputCollector = returnAll ? new OutputCollector() : null;
@@ -75,9 +68,6 @@
if (trustJSInteropTypeAnnotations) {
options.add(Flags.trustJSInteropTypeAnnotations);
}
- if (!useKernel) {
- options.add(Flags.useOldFrontend);
- }
if (disableInlining) {
options.add(Flags.disableInlining);
}
@@ -110,93 +100,35 @@
}
Future<String> compileAll(String code,
- {Map<String, String> coreSource,
- bool disableInlining: true,
+ {bool disableInlining: true,
bool trustTypeAnnotations: false,
bool minify: false,
int expectedErrors,
- int expectedWarnings,
- CompileMode compileMode: CompileMode.mock}) async {
+ int expectedWarnings}) async {
OutputCollector outputCollector = new OutputCollector();
- if (compileMode == CompileMode.mock) {
- Uri uri = new Uri(scheme: 'source');
- MockCompiler compiler = mockCompilerFor(code, uri,
- coreSource: coreSource,
- disableInlining: disableInlining,
- minify: minify,
- expectedErrors: expectedErrors,
- trustTypeAnnotations: trustTypeAnnotations,
- expectedWarnings: expectedWarnings,
- outputProvider: outputCollector);
- compiler.diagnosticHandler = createHandler(compiler, code);
- bool compilationSucceeded = await compiler.run(uri);
- Expect.isTrue(
- compilationSucceeded,
- 'Unexpected compilation error(s): '
- '${compiler.diagnosticCollector.errors}');
- } else {
- DiagnosticCollector diagnosticCollector = new DiagnosticCollector();
- if (coreSource != null) {
- throw new UnsupportedError(
- 'coreSource is not supported for $compileMode');
- }
- List<String> options = <String>[];
- if (disableInlining) {
- options.add(Flags.disableInlining);
- }
- if (trustTypeAnnotations) {
- options.add(Flags.trustTypeAnnotations);
- }
- if (minify) {
- options.add(Flags.minify);
- }
- if (compileMode == CompileMode.kernel) {
- options.add(Flags.useKernel);
- }
- CompilationResult result = await runCompiler(
- memorySourceFiles: {'main.dart': code},
- options: options,
- outputProvider: outputCollector,
- diagnosticHandler: diagnosticCollector);
- Expect.isTrue(
- result.isSuccess,
- 'Unexpected compilation error(s): '
- '${diagnosticCollector.errors}');
+ DiagnosticCollector diagnosticCollector = new DiagnosticCollector();
+ List<String> options = <String>[];
+ if (disableInlining) {
+ options.add(Flags.disableInlining);
}
+ if (trustTypeAnnotations) {
+ options.add(Flags.trustTypeAnnotations);
+ }
+ if (minify) {
+ options.add(Flags.minify);
+ }
+ CompilationResult result = await runCompiler(
+ memorySourceFiles: {'main.dart': code},
+ options: options,
+ outputProvider: outputCollector,
+ diagnosticHandler: diagnosticCollector);
+ Expect.isTrue(
+ result.isSuccess,
+ 'Unexpected compilation error(s): '
+ '${diagnosticCollector.errors}');
return outputCollector.getOutput('', OutputType.js);
}
-Future analyzeAndCheck(
- String code, String name, check(MockCompiler compiler, Element element),
- {int expectedErrors, int expectedWarnings}) {
- Uri uri = new Uri(scheme: 'source');
- MockCompiler compiler = mockCompilerFor(code, uri,
- expectedErrors: expectedErrors,
- expectedWarnings: expectedWarnings,
- analyzeOnly: true);
- return compiler.run(uri).then((_) {
- Element element = findElement(compiler, name);
- return check(compiler, element);
- });
-}
-
-Future compileSources(
- Map<String, String> sources, check(MockCompiler compiler)) {
- Uri base = new Uri(scheme: 'source', path: '/');
- Uri mainUri = base.resolve('main.dart');
- String mainCode = sources['main.dart'];
- Expect.isNotNull(mainCode, 'No source code found for "main.dart"');
- MockCompiler compiler = mockCompilerFor(mainCode, mainUri);
- sources.forEach((String path, String code) {
- if (path == 'main.dart') return;
- compiler.registerSource(base.resolve(path), code);
- });
-
- return compiler.run(mainUri).then((_) {
- return check(compiler);
- });
-}
-
Element findElement(compiler, String name, [Uri library]) {
LibraryElement lib = compiler.frontendStrategy.elementEnvironment.mainLibrary;
if (library != null) {
@@ -228,19 +160,15 @@
Expect.isFalse(hasNext, "Found more than $nb matches");
}
-Future compileAndMatch(String code, String entry, RegExp regexp,
- {bool useKernel: false}) {
- return compile(code, entry: entry, useKernel: useKernel,
- check: (String generated) {
+Future compileAndMatch(String code, String entry, RegExp regexp) {
+ return compile(code, entry: entry, check: (String generated) {
Expect.isTrue(
regexp.hasMatch(generated), '"$generated" does not match /$regexp/');
});
}
-Future compileAndDoNotMatch(String code, String entry, RegExp regexp,
- {bool useKernel: false}) {
- return compile(code, entry: entry, useKernel: useKernel,
- check: (String generated) {
+Future compileAndDoNotMatch(String code, String entry, RegExp regexp) {
+ return compile(code, entry: entry, check: (String generated) {
Expect.isFalse(
regexp.hasMatch(generated), '"$generated" has a match in /$regexp/');
});
@@ -250,22 +178,17 @@
// Does a compile and then a match where every 'x' is replaced by something
// that matches any variable, and every space is optional.
-Future compileAndMatchFuzzy(String code, String entry, String regexp,
- {bool useKernel: false}) {
- return compileAndMatchFuzzyHelper(code, entry, regexp,
- shouldMatch: true, useKernel: useKernel);
+Future compileAndMatchFuzzy(String code, String entry, String regexp) {
+ return compileAndMatchFuzzyHelper(code, entry, regexp, shouldMatch: true);
}
-Future compileAndDoNotMatchFuzzy(String code, String entry, String regexp,
- {bool useKernel: false}) {
- return compileAndMatchFuzzyHelper(code, entry, regexp,
- shouldMatch: false, useKernel: useKernel);
+Future compileAndDoNotMatchFuzzy(String code, String entry, String regexp) {
+ return compileAndMatchFuzzyHelper(code, entry, regexp, shouldMatch: false);
}
Future compileAndMatchFuzzyHelper(String code, String entry, String regexp,
- {bool shouldMatch, bool useKernel: false}) {
- return compile(code, entry: entry, useKernel: useKernel,
- check: (String generated) {
+ {bool shouldMatch}) {
+ return compile(code, entry: entry, check: (String generated) {
final xRe = new RegExp('\\bx\\b');
regexp = regexp.replaceAll(xRe, '(?:$anyIdentifier)');
final spaceRe = new RegExp('\\s+');
diff --git a/tests/compiler/dart2js/dart2js.status b/tests/compiler/dart2js/dart2js.status
index d7f0004..de4f98d 100644
--- a/tests/compiler/dart2js/dart2js.status
+++ b/tests/compiler/dart2js/dart2js.status
@@ -1,15 +1,19 @@
# 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.
+
analyze_dart_test: Slow, Pass
analyze_test: Slow, Pass
async_await_syntax_test: Pass # DON'T CHANGE THIS LINE -- Don't mark these tests as failing. Instead, fix the errors/warnings that they report or update the whitelist in the test-files to temporarily allow digression.
boolified_operator_test: Fail # Issue 8001
closure/closure_test: Pass, Slow
codegen/gvn_dynamic_field_get_test: Fail # Issue 18519
+codegen/list_tracer_length_test: Fail # Issue 33051
codegen/load_elimination_test: Pass, Slow
codegen/logical_expression_test: Fail # Issue 17027
+codegen/side_effect_tdiv_regression_test: Fail # Issue 33050
codegen/simple_function_subtype_test: Fail # simple_function_subtype_test is temporarily(?) disabled due to new method for building function type tests.
+codegen/string_escapes_test: Fail # Issue 33060
deferred_loading/deferred_loading_test: Slow, Pass
equivalence/id_equivalence1_test: Pass, Slow
equivalence/id_equivalence2_test: Pass, Slow
@@ -25,21 +29,9 @@
kernel/*: Slow, Pass
kernel/compile_from_dill_fast_startup_test: RuntimeError # Test must be updated to support FE with patching.
kernel/compile_from_dill_test: RuntimeError # Test must be updated to support FE with patching.
-mirrors/library_exports_hidden_test: Fail
-mirrors/library_exports_shown_test: Fail
-mirrors/library_imports_hidden_test: Fail
-mirrors/library_imports_prefixed_show_hide_test: Fail # Issue 32057
-mirrors/library_imports_prefixed_test: Fail
-mirrors/library_imports_shown_test: Fail
model/subtype_test: Pass, Slow
no_such_method_enabled_test: Pass, Slow
-old_frontend/bad_loop_test: RuntimeError
-old_frontend/check_elements_invariants_test: Skip # Times out even with Slow marker. Slow due to inlining in the CPS backend
-old_frontend/compile_with_empty_libraries_test: Fail # Issue 24223
-old_frontend/patch_test/bug: RuntimeError # Issue 21132
-old_frontend/resolver_test: RuntimeError # Test must be updated given new parser recovery
packages/*: Skip # Skip packages folder
-quarantined/http_test: RuntimeError # not supported with CFE, consider deleting.
rti/rti_emission_test: Pass, Slow
rti/rti_need0_test: Pass, Slow
rti/rti_need1_test: Pass, Slow
@@ -56,14 +48,6 @@
end_to_end/dart2js_batch_test: Pass, Slow
end_to_end/exit_code_test: Pass, Slow
in_user_code_test: Pass, Slow
-mirrors/deferred_mirrors_test: Pass, Slow
-mirrors/import_mirrors_test: Pass, Slow
-mirrors/mirror_final_field_inferrer2_test: Crash, Pass, Slow # Issue 15581
-old_frontend/analyze_api_test: Pass, Slow # DON'T CHANGE THIS LINE -- Don't mark these tests as failing. Instead, fix the errors/warnings that they report or update the whitelist in the test-files to temporarily allow digression.
-old_frontend/check_elements_invariants_test: Skip # Slow and only needs to be run in one configuration
-old_frontend/check_members_test: Pass, Slow
-old_frontend/duplicate_library_test: Pass, Slow
-old_frontend/message_kind_test: Pass, Slow
show_package_warnings_test: Pass, Slow
sourcemaps/source_map_pub_build_validity_test: Pass, Slow
@@ -78,12 +62,6 @@
jsinterop/interop_anonymous_unreachable_test: Pass, Slow
jsinterop/world_test: Pass, Slow
kernel/visitor_test: Pass, Slow
-mirrors/deferred_mirrors_test: Pass, Slow
-mirrors/import_mirrors_test: Slow, Pass
-mirrors/mirror_final_field_inferrer2_test: Pass, Slow
-mirrors/preserve_uris_test: Pass, Slow
-old_frontend/analyze_dart2js_helpers_test: Pass, Slow
-old_frontend/duplicate_library_test: Pass, Slow
output_type_test: Pass, Slow
sourcemaps/source_map_pub_build_validity_test: Pass, Slow
sourcemaps/stacktrace_test: Pass, Slow
diff --git a/tests/compiler/dart2js/deferred/closures_test.dart b/tests/compiler/dart2js/deferred/closures_test.dart
index 9e97701..f8d7dcc 100644
--- a/tests/compiler/dart2js/deferred/closures_test.dart
+++ b/tests/compiler/dart2js/deferred/closures_test.dart
@@ -6,7 +6,6 @@
import 'package:async_helper/async_helper.dart';
import 'package:compiler/compiler_new.dart';
-import 'package:compiler/src/commandline_options.dart';
import 'package:expect/expect.dart';
import '../memory_compiler.dart';
@@ -14,18 +13,14 @@
void main() {
asyncTest(() async {
- print('--test from ast---------------------------------------------------');
- await runTest(useKernel: false);
print('--test from kernel------------------------------------------------');
- await runTest(useKernel: true);
+ await runTest();
});
}
-runTest({bool useKernel}) async {
+runTest() async {
OutputCollector collector = new OutputCollector();
- var options = useKernel ? [] : [Flags.useOldFrontend];
- await runCompiler(
- memorySourceFiles: sources, outputProvider: collector, options: options);
+ await runCompiler(memorySourceFiles: sources, outputProvider: collector);
String mainOutput = collector.getOutput("", OutputType.js);
String deferredOutput = collector.getOutput("out_1", OutputType.jsPart);
diff --git a/tests/compiler/dart2js/deferred/custom_element_test.dart b/tests/compiler/dart2js/deferred/custom_element_test.dart
index b47edfa..01fb615 100644
--- a/tests/compiler/dart2js/deferred/custom_element_test.dart
+++ b/tests/compiler/dart2js/deferred/custom_element_test.dart
@@ -8,23 +8,19 @@
import 'package:async_helper/async_helper.dart';
import 'package:compiler/src/compiler.dart';
-import 'package:compiler/src/commandline_options.dart';
import 'package:expect/expect.dart';
import '../memory_compiler.dart';
void main() {
asyncTest(() async {
- print('--test from ast---------------------------------------------------');
- await runTest(useKernel: false);
print('--test from kernel------------------------------------------------');
- await runTest(useKernel: true);
+ await runTest();
});
}
-runTest({bool useKernel}) async {
- CompilationResult result = await runCompiler(
- memorySourceFiles: MEMORY_SOURCE_FILES,
- options: useKernel ? [] : [Flags.useOldFrontend]);
+runTest() async {
+ CompilationResult result =
+ await runCompiler(memorySourceFiles: MEMORY_SOURCE_FILES);
Compiler compiler = result.compiler;
var closedWorld = compiler.backendClosedWorldForTesting;
var outputUnitForEntity = compiler.backend.outputUnitData.outputUnitForEntity;
diff --git a/tests/compiler/dart2js/deferred/dont_inline_deferred_constants_test.dart b/tests/compiler/dart2js/deferred/dont_inline_deferred_constants_test.dart
index 23d692f..33da0d2 100644
--- a/tests/compiler/dart2js/deferred/dont_inline_deferred_constants_test.dart
+++ b/tests/compiler/dart2js/deferred/dont_inline_deferred_constants_test.dart
@@ -7,19 +7,16 @@
import 'package:async_helper/async_helper.dart';
import 'package:compiler/compiler_new.dart';
-import 'package:compiler/src/commandline_options.dart';
import 'package:compiler/src/compiler.dart';
import 'package:expect/expect.dart';
import '../memory_compiler.dart';
import '../output_collector.dart';
void main() {
- runTest({bool useKernel}) async {
+ runTest() async {
OutputCollector collector = new OutputCollector();
CompilationResult result = await runCompiler(
- memorySourceFiles: MEMORY_SOURCE_FILES,
- outputProvider: collector,
- options: useKernel ? [] : [Flags.useOldFrontend]);
+ memorySourceFiles: MEMORY_SOURCE_FILES, outputProvider: collector);
Compiler compiler = result.compiler;
var closedWorld = compiler.backendClosedWorldForTesting;
var elementEnvironment = closedWorld.elementEnvironment;
@@ -88,10 +85,8 @@
}
asyncTest(() async {
- print('--test from ast---------------------------------------------------');
- await runTest(useKernel: false);
print('--test from kernel------------------------------------------------');
- await runTest(useKernel: true);
+ await runTest();
});
}
diff --git a/tests/compiler/dart2js/deferred/dont_inline_deferred_globals_test.dart b/tests/compiler/dart2js/deferred/dont_inline_deferred_globals_test.dart
index 558f585..7b6db2d 100644
--- a/tests/compiler/dart2js/deferred/dont_inline_deferred_globals_test.dart
+++ b/tests/compiler/dart2js/deferred/dont_inline_deferred_globals_test.dart
@@ -7,19 +7,16 @@
import 'package:async_helper/async_helper.dart';
import 'package:compiler/compiler_new.dart';
-import 'package:compiler/src/commandline_options.dart';
import 'package:compiler/src/compiler.dart';
import 'package:expect/expect.dart';
import '../memory_compiler.dart';
import '../output_collector.dart';
void main() {
- runTest({bool useKernel}) async {
+ runTest() async {
OutputCollector collector = new OutputCollector();
CompilationResult result = await runCompiler(
- memorySourceFiles: MEMORY_SOURCE_FILES,
- outputProvider: collector,
- options: useKernel ? [] : [Flags.useOldFrontend]);
+ memorySourceFiles: MEMORY_SOURCE_FILES, outputProvider: collector);
Compiler compiler = result.compiler;
var closedWorld = compiler.backendClosedWorldForTesting;
var elementEnvironment = closedWorld.elementEnvironment;
@@ -48,10 +45,8 @@
}
asyncTest(() async {
- print('--test from ast---------------------------------------------------');
- await runTest(useKernel: false);
print('--test from kernel------------------------------------------------');
- await runTest(useKernel: true);
+ await runTest();
});
}
diff --git a/tests/compiler/dart2js/deferred/emit_type_checks_test.dart b/tests/compiler/dart2js/deferred/emit_type_checks_test.dart
index 370fc30..6b38487 100644
--- a/tests/compiler/dart2js/deferred/emit_type_checks_test.dart
+++ b/tests/compiler/dart2js/deferred/emit_type_checks_test.dart
@@ -7,7 +7,6 @@
import 'package:async_helper/async_helper.dart';
import 'package:compiler/compiler_new.dart';
-import 'package:compiler/src/commandline_options.dart';
import 'package:compiler/src/compiler.dart';
import 'package:compiler/src/js_backend/js_backend.dart' show JavaScriptBackend;
import 'package:expect/expect.dart';
@@ -15,12 +14,10 @@
import '../output_collector.dart';
void main() {
- runTest({bool useKernel}) async {
+ runTest() async {
OutputCollector collector = new OutputCollector();
CompilationResult result = await runCompiler(
- memorySourceFiles: MEMORY_SOURCE_FILES,
- outputProvider: collector,
- options: useKernel ? [] : [Flags.useOldFrontend]);
+ memorySourceFiles: MEMORY_SOURCE_FILES, outputProvider: collector);
Compiler compiler = result.compiler;
String mainOutput = collector.getOutput('', OutputType.js);
String deferredOutput = collector.getOutput('out_1', OutputType.jsPart);
@@ -34,10 +31,8 @@
}
asyncTest(() async {
- print('--test from ast---------------------------------------------------');
- await runTest(useKernel: false);
print('--test from kernel------------------------------------------------');
- await runTest(useKernel: true);
+ await runTest();
});
}
diff --git a/tests/compiler/dart2js/deferred/follow_constant_dependencies_test.dart b/tests/compiler/dart2js/deferred/follow_constant_dependencies_test.dart
index 6944dff..4ed0b6d 100644
--- a/tests/compiler/dart2js/deferred/follow_constant_dependencies_test.dart
+++ b/tests/compiler/dart2js/deferred/follow_constant_dependencies_test.dart
@@ -5,17 +5,15 @@
// Test that constants depended on by other constants are correctly deferred.
import 'package:async_helper/async_helper.dart';
-import 'package:compiler/src/commandline_options.dart';
import 'package:compiler/src/compiler.dart';
import 'package:compiler/src/constants/values.dart';
import 'package:expect/expect.dart';
import '../memory_compiler.dart';
void main() {
- runTest({bool useKernel}) async {
- CompilationResult result = await runCompiler(
- memorySourceFiles: MEMORY_SOURCE_FILES,
- options: useKernel ? [] : [Flags.useOldFrontend]);
+ runTest() async {
+ CompilationResult result =
+ await runCompiler(memorySourceFiles: MEMORY_SOURCE_FILES);
Compiler compiler = result.compiler;
var outputUnitForConstant =
compiler.backend.outputUnitData.outputUnitForConstant;
@@ -46,10 +44,8 @@
}
asyncTest(() async {
- print('--test from ast---------------------------------------------------');
- await runTest(useKernel: false);
print('--test from kernel------------------------------------------------');
- await runTest(useKernel: true);
+ await runTest();
});
}
diff --git a/tests/compiler/dart2js/deferred/follow_implicit_super_regression_test.dart b/tests/compiler/dart2js/deferred/follow_implicit_super_regression_test.dart
index b83812e..f5e7858 100644
--- a/tests/compiler/dart2js/deferred/follow_implicit_super_regression_test.dart
+++ b/tests/compiler/dart2js/deferred/follow_implicit_super_regression_test.dart
@@ -3,17 +3,15 @@
// BSD-style license that can be found in the LICENSE file.
import 'package:async_helper/async_helper.dart';
-import 'package:compiler/src/commandline_options.dart';
import 'package:compiler/src/compiler.dart' as dart2js;
import 'package:expect/expect.dart';
import '../memory_compiler.dart';
void main() {
- runTest({bool useKernel}) async {
- CompilationResult result = await runCompiler(
- memorySourceFiles: MEMORY_SOURCE_FILES,
- options: useKernel ? [] : [Flags.useOldFrontend]);
+ runTest() async {
+ CompilationResult result =
+ await runCompiler(memorySourceFiles: MEMORY_SOURCE_FILES);
dart2js.Compiler compiler = result.compiler;
var closedWorld = compiler.backendClosedWorldForTesting;
var elementEnvironment = closedWorld.elementEnvironment;
@@ -36,10 +34,8 @@
}
asyncTest(() async {
- print('--test from ast---------------------------------------------------');
- await runTest(useKernel: false);
print('--test from kernel------------------------------------------------');
- await runTest(useKernel: true);
+ await runTest();
});
}
diff --git a/tests/compiler/dart2js/deferred/unneeded_part_js_test.dart b/tests/compiler/dart2js/deferred/unneeded_part_js_test.dart
index 2ad4c00..67b8c44 100644
--- a/tests/compiler/dart2js/deferred/unneeded_part_js_test.dart
+++ b/tests/compiler/dart2js/deferred/unneeded_part_js_test.dart
@@ -5,29 +5,25 @@
// Test that no parts are emitted when deferred loading isn't used.
import 'package:async_helper/async_helper.dart';
-import 'package:compiler/src/commandline_options.dart';
import 'package:expect/expect.dart';
import '../memory_compiler.dart';
main() {
- runTest({bool useKernel}) async {
+ runTest() async {
DiagnosticCollector diagnostics = new DiagnosticCollector();
OutputCollector output = new OutputCollector();
CompilationResult result = await runCompiler(
memorySourceFiles: MEMORY_SOURCE_FILES,
diagnosticHandler: diagnostics,
- outputProvider: output,
- options: useKernel ? [] : [Flags.useOldFrontend]);
+ outputProvider: output);
Expect.isFalse(diagnostics.hasRegularMessages);
Expect.isFalse(output.hasExtraOutput);
Expect.isTrue(result.isSuccess);
}
asyncTest(() async {
- print('--test from ast---------------------------------------------------');
- await runTest(useKernel: false);
print('--test from kernel------------------------------------------------');
- await runTest(useKernel: true);
+ await runTest();
});
}
diff --git a/tests/compiler/dart2js/deferred_loading/data/type_argument_dependency.dart b/tests/compiler/dart2js/deferred_loading/data/type_argument_dependency.dart
new file mode 100644
index 0000000..80026e3
--- /dev/null
+++ b/tests/compiler/dart2js/deferred_loading/data/type_argument_dependency.dart
@@ -0,0 +1,13 @@
+// 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 '../libs/type_argument_dependency_lib1.dart';
+import '../libs/type_argument_dependency_lib2.dart' deferred as c;
+
+/*element: main:OutputUnit(main, {})*/
+main() async {
+ await c.loadLibrary();
+ c.createA();
+ doCast(<dynamic>[1, 2]);
+}
diff --git a/tests/compiler/dart2js/deferred_loading/deferred_loading_test.dart b/tests/compiler/dart2js/deferred_loading/deferred_loading_test.dart
index d69452a..37b9fed 100644
--- a/tests/compiler/dart2js/deferred_loading/deferred_loading_test.dart
+++ b/tests/compiler/dart2js/deferred_loading/deferred_loading_test.dart
@@ -34,10 +34,13 @@
Directory dataDir = new Directory.fromUri(Platform.script.resolve('data'));
await checkTests(
dataDir, computeAstOutputUnitData, computeKernelOutputUnitData,
+ computeClassDataFromAst: computeAstClassOutputUnitData,
+ computeClassDataFromKernel: computeKernelClassOutputUnitData,
libDirectory: new Directory.fromUri(Platform.script.resolve('libs')),
skipForKernel: skipForKernel,
options: compilerOptions,
- args: args, setUpFunction: () {
+ args: args,
+ testOmit: true, setUpFunction: () {
importPrefixes.clear();
});
});
@@ -107,6 +110,17 @@
}
}
+void computeAstClassOutputUnitData(
+ Compiler compiler, ClassEntity _cls, Map<Id, ActualData> actualMap,
+ {bool verbose: false}) {
+ ClassElement cls = _cls;
+ OutputUnitData data = compiler.backend.outputUnitData;
+ String value = outputUnitString(data.outputUnitForEntity(cls));
+
+ _registerValue(new ClassId(cls.name), value, cls, cls.sourcePosition,
+ actualMap, compiler.reporter);
+}
+
/// OutputData for [member] as a kernel based element.
///
/// At this point the compiler has already been run, so it is holding the
@@ -157,6 +171,25 @@
}
}
+void computeKernelClassOutputUnitData(
+ Compiler compiler, ClassEntity cls, Map<Id, ActualData> actualMap,
+ {bool verbose: false}) {
+ OutputUnitData data = compiler.backend.outputUnitData;
+ String value = outputUnitString(data.outputUnitForEntity(cls));
+
+ KernelBackendStrategy backendStrategy = compiler.backendStrategy;
+ KernelToElementMapForBuilding elementMap = backendStrategy.elementMap;
+ ClassDefinition definition = elementMap.getClassDefinition(cls);
+
+ _registerValue(
+ new ClassId(cls.name),
+ value,
+ cls,
+ computeSourceSpanFromTreeNode(definition.node),
+ actualMap,
+ compiler.reporter);
+}
+
/// Set [actualMap] to hold a key of [id] with the computed data [value]
/// corresponding to [object] at location [sourceSpan]. We also perform error
/// checking to ensure that the same [id] isn't added twice.
diff --git a/tests/compiler/dart2js/deferred_loading/libs/deferred_class_library.dart b/tests/compiler/dart2js/deferred_loading/libs/deferred_class_library.dart
index 95f54b4..3e359eb 100644
--- a/tests/compiler/dart2js/deferred_loading/libs/deferred_class_library.dart
+++ b/tests/compiler/dart2js/deferred_loading/libs/deferred_class_library.dart
@@ -6,6 +6,7 @@
library deferred_class_library;
+/*class: MyClass:OutputUnit(1, {lib})*/
class MyClass {
/*element: MyClass.:OutputUnit(1, {lib})*/
const MyClass();
diff --git a/tests/compiler/dart2js/deferred_loading/libs/deferred_constant1_lib3.dart b/tests/compiler/dart2js/deferred_loading/libs/deferred_constant1_lib3.dart
index 1cb567c9..3935220 100644
--- a/tests/compiler/dart2js/deferred_loading/libs/deferred_constant1_lib3.dart
+++ b/tests/compiler/dart2js/deferred_loading/libs/deferred_constant1_lib3.dart
@@ -4,6 +4,7 @@
library deferred_constants1_lib3;
+/*class: C:OutputUnit(main, {})*/
class C {
/*element: C.value:OutputUnit(main, {})*/
final value;
diff --git a/tests/compiler/dart2js/deferred_loading/libs/deferred_constant2_lib.dart b/tests/compiler/dart2js/deferred_loading/libs/deferred_constant2_lib.dart
index dc59b97..33b5017 100644
--- a/tests/compiler/dart2js/deferred_loading/libs/deferred_constant2_lib.dart
+++ b/tests/compiler/dart2js/deferred_loading/libs/deferred_constant2_lib.dart
@@ -4,6 +4,7 @@
library deferred_constants2_lib;
+/*class: Constant:OutputUnit(1, {lib})*/
class Constant {
/*element: Constant.value:OutputUnit(1, {lib})*/
final value;
diff --git a/tests/compiler/dart2js/deferred_loading/libs/deferred_overlapping_lib1.dart b/tests/compiler/dart2js/deferred_loading/libs/deferred_overlapping_lib1.dart
index e1c3a03..7587f4e 100644
--- a/tests/compiler/dart2js/deferred_loading/libs/deferred_overlapping_lib1.dart
+++ b/tests/compiler/dart2js/deferred_loading/libs/deferred_overlapping_lib1.dart
@@ -4,5 +4,6 @@
import "deferred_overlapping_lib3.dart";
+/*class: C1:OutputUnit(1, {lib1})*/
/*element: C1.:OutputUnit(1, {lib1})*/
class C1 extends C3 {}
diff --git a/tests/compiler/dart2js/deferred_loading/libs/deferred_overlapping_lib2.dart b/tests/compiler/dart2js/deferred_loading/libs/deferred_overlapping_lib2.dart
index 4d7c620..3e49d22 100644
--- a/tests/compiler/dart2js/deferred_loading/libs/deferred_overlapping_lib2.dart
+++ b/tests/compiler/dart2js/deferred_loading/libs/deferred_overlapping_lib2.dart
@@ -4,5 +4,6 @@
import "deferred_overlapping_lib3.dart";
+/*class: C2:OutputUnit(3, {lib2})*/
/*element: C2.:OutputUnit(3, {lib2})*/
class C2 extends C3 {}
diff --git a/tests/compiler/dart2js/deferred_loading/libs/deferred_overlapping_lib3.dart b/tests/compiler/dart2js/deferred_loading/libs/deferred_overlapping_lib3.dart
index 6804b23..5447ff9 100644
--- a/tests/compiler/dart2js/deferred_loading/libs/deferred_overlapping_lib3.dart
+++ b/tests/compiler/dart2js/deferred_loading/libs/deferred_overlapping_lib3.dart
@@ -2,5 +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.
+/*class: C3:OutputUnit(2, {lib1, lib2})*/
/*element: C3.:OutputUnit(2, {lib1, lib2})*/
class C3 {}
diff --git a/tests/compiler/dart2js/deferred_loading/libs/deferred_typed_map_lib1.dart b/tests/compiler/dart2js/deferred_loading/libs/deferred_typed_map_lib1.dart
index 4529ffb..36d7d4a 100644
--- a/tests/compiler/dart2js/deferred_loading/libs/deferred_typed_map_lib1.dart
+++ b/tests/compiler/dart2js/deferred_loading/libs/deferred_typed_map_lib1.dart
@@ -2,6 +2,7 @@
// 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: M:OutputUnit(1, {lib})*/
class M {}
typedef dynamic FF({M b});
@@ -9,8 +10,7 @@
/*element: table:OutputUnit(1, {lib})*/
const table =
/*ast.null*/
-/*kernel.OutputUnit(1, {lib})*/
-/*strong.OutputUnit(1, {lib})*/
+/*!ast.OutputUnit(1, {lib})*/
const <int, FF>{1: f1, 2: f2};
/*element: f1:OutputUnit(1, {lib})*/
diff --git a/tests/compiler/dart2js/deferred_loading/libs/deferred_typedef_lib1.dart b/tests/compiler/dart2js/deferred_loading/libs/deferred_typedef_lib1.dart
index 9344b77..9d6d26a 100644
--- a/tests/compiler/dart2js/deferred_loading/libs/deferred_typedef_lib1.dart
+++ b/tests/compiler/dart2js/deferred_loading/libs/deferred_typedef_lib1.dart
@@ -4,6 +4,7 @@
library deferred_typedef_lib1;
+/*class: C:OutputUnit(1, {lib1})*/
class C {
/*element: C.a:OutputUnit(1, {lib1})*/
final a;
diff --git a/tests/compiler/dart2js/deferred_loading/libs/dont_inline_deferred_constants_lib1.dart b/tests/compiler/dart2js/deferred_loading/libs/dont_inline_deferred_constants_lib1.dart
index 1fefeae..80c37a0 100644
--- a/tests/compiler/dart2js/deferred_loading/libs/dont_inline_deferred_constants_lib1.dart
+++ b/tests/compiler/dart2js/deferred_loading/libs/dont_inline_deferred_constants_lib1.dart
@@ -17,6 +17,7 @@
/*element: C2b:OutputUnit(1, {lib1})*/
const C2b = /*OutputUnit(1, {lib1})*/ const C(1010);
+/*class: D:OutputUnit(main, {})*/
class D {
/*element: D.C3:OutputUnit(1, {lib1})*/
static const C3 = "string2";
diff --git a/tests/compiler/dart2js/deferred_loading/libs/dont_inline_deferred_constants_main.dart b/tests/compiler/dart2js/deferred_loading/libs/dont_inline_deferred_constants_main.dart
index a68724a..494a35d 100644
--- a/tests/compiler/dart2js/deferred_loading/libs/dont_inline_deferred_constants_main.dart
+++ b/tests/compiler/dart2js/deferred_loading/libs/dont_inline_deferred_constants_main.dart
@@ -8,6 +8,7 @@
/*element: c:OutputUnit(main, {})*/
const c = "string3";
+/*class: C:OutputUnit(main, {})*/
class C {
/*element: C.p:OutputUnit(main, {})*/
final p;
diff --git a/tests/compiler/dart2js/deferred_loading/libs/shared_constant_c.dart b/tests/compiler/dart2js/deferred_loading/libs/shared_constant_c.dart
index 370c0e1..b6ce057 100644
--- a/tests/compiler/dart2js/deferred_loading/libs/shared_constant_c.dart
+++ b/tests/compiler/dart2js/deferred_loading/libs/shared_constant_c.dart
@@ -2,6 +2,7 @@
// 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:OutputUnit(1, {s1, s2})*/
class C {
/*element: C.:OutputUnit(1, {s1, s2})*/
const C();
diff --git a/tests/compiler/dart2js/deferred_loading/libs/type_argument_dependency_lib1.dart b/tests/compiler/dart2js/deferred_loading/libs/type_argument_dependency_lib1.dart
new file mode 100644
index 0000000..37095d3
--- /dev/null
+++ b/tests/compiler/dart2js/deferred_loading/libs/type_argument_dependency_lib1.dart
@@ -0,0 +1,8 @@
+// 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 'type_argument_dependency_lib2.dart';
+
+/*element: doCast:OutputUnit(main, {})*/
+doCast(List<dynamic> l) => l.cast<B>().map((x) => 1);
diff --git a/tests/compiler/dart2js/deferred_loading/libs/type_argument_dependency_lib2.dart b/tests/compiler/dart2js/deferred_loading/libs/type_argument_dependency_lib2.dart
new file mode 100644
index 0000000..bf70190
--- /dev/null
+++ b/tests/compiler/dart2js/deferred_loading/libs/type_argument_dependency_lib2.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.
+
+/*ast.class: A:OutputUnit(1, {c})*/
+/*kernel.class: A:OutputUnit(1, {c})*/
+/*strong.class: A:OutputUnit(main, {})*/
+/*omit.class: A:OutputUnit(main, {})*/
+class A {
+ /*element: A.:OutputUnit(1, {c})*/
+ A();
+}
+
+/*class: B:OutputUnit(main, {})*/
+class B extends A {}
+
+/*element: createA:OutputUnit(1, {c})*/
+createA() => new A();
diff --git a/tests/compiler/dart2js/dump_info_test.dart b/tests/compiler/dart2js/dump_info_test.dart
index cf1399b..4d57673 100644
--- a/tests/compiler/dart2js/dump_info_test.dart
+++ b/tests/compiler/dart2js/dump_info_test.dart
@@ -97,11 +97,8 @@
typedef void JsonTaking(Map<String, dynamic> json);
-jsonTest(String program, JsonTaking testFn, {bool useKernel}) async {
+jsonTest(String program, JsonTaking testFn) async {
var options = ['--out=out.js', Flags.dumpInfo];
- if (!useKernel) {
- options.add(Flags.useOldFrontend);
- }
var result = await runCompiler(
memorySourceFiles: {'main.dart': program}, options: options);
var compiler = result.compiler;
@@ -118,14 +115,12 @@
main() {
asyncTest(() async {
- print('--test from ast---------------------------------------------------');
- await runTests(useKernel: false);
print('--test from kernel------------------------------------------------');
- await runTests(useKernel: true);
+ await runTests();
});
}
-runTests({bool useKernel}) async {
+runTests() async {
await jsonTest(TEST_BASIC, (map) {
Expect.isTrue(map['elements'].isNotEmpty);
Expect.isTrue(map['elements']['function'].isNotEmpty);
@@ -139,7 +134,7 @@
Expect.isTrue(map['elements']['function'].values.any((fun) {
return fun['name'] == 'f';
}));
- }, useKernel: useKernel);
+ });
await jsonTest(TEST_CLOSURES, (map) {
var functions = map['elements']['function'].values;
@@ -149,7 +144,7 @@
Expect.isTrue(functions.any((fn) {
return fn['name'] == 'foo' && fn['children'].length == 10;
}));
- }, useKernel: useKernel);
+ });
await jsonTest(TEST_STATICS, (map) {
var functions = map['elements']['function'].values;
@@ -160,7 +155,7 @@
Expect.isTrue(classes.any((cls) {
return cls['name'] == 'ContainsStatics' && cls['children'].length >= 1;
}));
- }, useKernel: useKernel);
+ });
await jsonTest(TEST_INLINED_1, (map) {
var functions = map['elements']['function'].values;
@@ -171,7 +166,7 @@
Expect.isTrue(classes.any((cls) {
return cls['name'] == 'Doubler' && cls['children'].length >= 1;
}));
- }, useKernel: useKernel);
+ });
await jsonTest(TEST_INLINED_2, (map) {
var functions = map['elements']['function'].values;
@@ -187,5 +182,5 @@
Expect.isTrue(deps.containsKey(fn2['id']));
Expect.isTrue(deps[main_['id']].any((dep) => dep['id'] == fn1['id']));
Expect.isTrue(deps[fn1['id']].any((dep) => dep['id'] == fn2['id']));
- }, useKernel: useKernel);
+ });
}
diff --git a/tests/compiler/dart2js/end_to_end/command_line_test.dart b/tests/compiler/dart2js/end_to_end/command_line_test.dart
index 75db352..88fb3e8 100644
--- a/tests/compiler/dart2js/end_to_end/command_line_test.dart
+++ b/tests/compiler/dart2js/end_to_end/command_line_test.dart
@@ -10,7 +10,6 @@
import 'package:expect/expect.dart';
import 'package:compiler/compiler_new.dart' as api;
-import 'package:compiler/src/commandline_options.dart';
import 'package:compiler/src/dart2js.dart' as entry;
import 'package:compiler/src/options.dart' show CompilerOptions;
@@ -19,8 +18,6 @@
asyncTest(() async {
await test([], exitCode: 1);
await test(['foo.dart']);
- await test([Flags.useOldFrontend], exitCode: 1);
- await test([Flags.useOldFrontend, 'foo.dart']);
});
}
diff --git a/tests/compiler/dart2js/generic_methods/function_type_variable_test.dart b/tests/compiler/dart2js/generic_methods/function_type_variable_test.dart
index 0c4ed18..aaef4ea 100644
--- a/tests/compiler/dart2js/generic_methods/function_type_variable_test.dart
+++ b/tests/compiler/dart2js/generic_methods/function_type_variable_test.dart
@@ -39,7 +39,7 @@
}
void F11<Q extends C3<Q>>(Q q) {}
void F12<P extends C3<P>>(P p) {}
- """), compileMode: CompileMode.kernel, options: [Flags.strongMode]);
+ """), options: [Flags.strongMode]);
testToString(FunctionType type, String expectedToString) {
Expect.equals(expectedToString, type.toString());
diff --git a/tests/compiler/dart2js/generic_methods/generic_method_type_test.dart b/tests/compiler/dart2js/generic_methods/generic_method_type_test.dart
index 0357757..3d90b38 100644
--- a/tests/compiler/dart2js/generic_methods/generic_method_type_test.dart
+++ b/tests/compiler/dart2js/generic_methods/generic_method_type_test.dart
@@ -22,13 +22,10 @@
main() {
asyncTest(() async {
- TypeEnvironment env = await TypeEnvironment.create(
- """
+ TypeEnvironment env = await TypeEnvironment.create("""
${createTypedefs(signatures, prefix: 't')}
${createMethods(signatures, prefix: 'm')}
- """,
- compileMode: CompileMode.kernel,
- options: [Flags.strongMode]);
+ """, options: [Flags.strongMode]);
for (FunctionTypeData data in signatures) {
FunctionType functionType = env.getElementType('t${data.name}');
diff --git a/tests/compiler/dart2js/generic_methods/instantiation_stub_test.dart b/tests/compiler/dart2js/generic_methods/instantiation_stub_test.dart
new file mode 100644
index 0000000..6d2478b
--- /dev/null
+++ b/tests/compiler/dart2js/generic_methods/instantiation_stub_test.dart
@@ -0,0 +1,97 @@
+// 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:async_helper/async_helper.dart';
+import 'package:compiler/src/commandline_options.dart';
+import 'package:compiler/src/compiler.dart';
+import 'package:compiler/src/elements/entities.dart';
+import 'package:compiler/src/js_emitter/model.dart';
+import 'package:compiler/src/world.dart';
+import 'package:expect/expect.dart';
+import '../helpers/program_lookup.dart';
+import '../memory_compiler.dart';
+
+const String code = '''
+import 'package:meta/dart2js.dart';
+
+// This needs one-arg instantiation.
+@noInline
+T f1a<T>(T t) => t;
+
+// This needs no instantiation because it is not closurized.
+@noInline
+T f1b<T>(T t1, T t2) => t1;
+
+class Class {
+ // This needs two-arg instantiation.
+ @noInline
+ bool f2a<T, S>(T t, S s) => t == s;
+
+ // This needs no instantiation because it is not closurized.
+ @noInline
+ bool f2b<T, S>(T t, S s1, S s2) => t == s1;
+}
+
+@noInline
+int method1(int i, int Function(int) f) => f(i);
+
+@noInline
+bool method2(int a, int b, bool Function(int, int) f) => f(a, b);
+
+@noInline
+int method3(int a, int b, int c, int Function(int, int, int) f) => f(a, b, c);
+
+main() {
+ // This needs three-arg instantiation.
+ T local1<T, S, U>(T t, S s, U u) => t;
+
+ // This needs no instantiation because but a local function is always
+ // closurized so we assume it does.
+ T local2<T, S, U>(T t, S s, U u1, U u2) => t;
+
+ print(method1(42, f1a));
+ print(f1b(42, 87));
+
+ Class c = new Class();
+ print(method2(0, 1, c.f2a));
+ print(c.f2b(42, 87, 123));
+
+ print(method3(0, 1, 2, local1));
+ print(local2(42, 87, 123, 256));
+}
+''';
+
+main() {
+ asyncTest(() async {
+ CompilationResult result = await runCompiler(
+ memorySourceFiles: {'main.dart': code},
+ options: [Flags.strongMode, Flags.omitImplicitChecks]);
+ Expect.isTrue(result.isSuccess);
+ Compiler compiler = result.compiler;
+ ClosedWorld closedWorld = compiler.backendClosedWorldForTesting;
+ ProgramLookup programLookup = new ProgramLookup(compiler);
+
+ void checkStubs(ClassEntity element, List<String> expectedStubs) {
+ Class cls = programLookup.getClass(element);
+ List<String> actualStubs = <String>[];
+ if (cls != null) {
+ for (StubMethod stub in cls.callStubs) {
+ actualStubs.add(stub.name.key);
+ }
+ }
+ Expect.setEquals(
+ expectedStubs,
+ actualStubs,
+ "Unexpected stubs for $element:\n "
+ "Expected: $expectedStubs\n Actual: $actualStubs");
+ }
+
+ checkStubs(closedWorld.commonElements.instantiation1Class,
+ [r'call$1', r'$signature']);
+ checkStubs(closedWorld.commonElements.instantiation2Class,
+ [r'call$2', r'$signature']);
+ checkStubs(closedWorld.commonElements.instantiation3Class,
+ [r'call$3', r'call$4', r'$signature']);
+ });
+}
diff --git a/tests/compiler/dart2js/inference/list_tracer_test.dart b/tests/compiler/dart2js/inference/list_tracer_test.dart
index 5e682cc..4e3b241 100644
--- a/tests/compiler/dart2js/inference/list_tracer_test.dart
+++ b/tests/compiler/dart2js/inference/list_tracer_test.dart
@@ -4,7 +4,6 @@
import 'package:async_helper/async_helper.dart';
import 'package:compiler/src/types/types.dart' show ContainerTypeMask, TypeMask;
-import 'package:compiler/src/commandline_options.dart';
import 'package:expect/expect.dart';
import 'type_mask_test_helper.dart';
@@ -188,38 +187,33 @@
}
void main() {
- runTest({bool useKernel}) async {
+ runTest() async {
// Test literal list.
- await doTest('[]', nullify: false, useKernel: useKernel);
+ await doTest('[]', nullify: false);
// Test growable list.
- await doTest('new List()', nullify: false, useKernel: useKernel);
+ await doTest('new List()', nullify: false);
// Test fixed list.
- await doTest('new List(1)', nullify: true, useKernel: useKernel);
+ await doTest('new List(1)', nullify: true);
// Test List.filled.
- await doTest('new List.filled(1, 0)', nullify: false, useKernel: useKernel);
+ await doTest('new List.filled(1, 0)', nullify: false);
// Test List.filled.
- await doTest('new List.filled(1, null)',
- nullify: true, useKernel: useKernel);
+ await doTest('new List.filled(1, null)', nullify: true);
}
asyncTest(() async {
- print('--test from ast---------------------------------------------------');
- await runTest(useKernel: false);
print('--test from kernel------------------------------------------------');
- await runTest(useKernel: true);
+ await runTest();
});
}
-doTest(String allocation, {bool nullify, bool useKernel}) async {
+doTest(String allocation, {bool nullify}) async {
String source = generateTest(allocation);
- var result = await runCompiler(
- memorySourceFiles: {'main.dart': source},
- options: useKernel ? [] : [Flags.useOldFrontend]);
+ var result = await runCompiler(memorySourceFiles: {'main.dart': source});
Expect.isTrue(result.isSuccess);
var compiler = result.compiler;
var typesInferrer = compiler.globalInference.typesInferrerInternal;
var closedWorld = typesInferrer.closedWorld;
- var commonMasks = closedWorld.commonMasks;
+ var commonMasks = closedWorld.abstractValueDomain;
checkType(String name, type) {
var element = findMember(closedWorld, name);
diff --git a/tests/compiler/dart2js/inference/load_deferred_library_test.dart b/tests/compiler/dart2js/inference/load_deferred_library_test.dart
index 985453c..78a0ea5 100644
--- a/tests/compiler/dart2js/inference/load_deferred_library_test.dart
+++ b/tests/compiler/dart2js/inference/load_deferred_library_test.dart
@@ -7,10 +7,10 @@
import 'package:compiler/src/common_elements.dart';
import 'package:compiler/src/common/names.dart';
import 'package:compiler/src/compiler.dart';
-import 'package:compiler/src/elements/elements.dart';
import 'package:compiler/src/elements/entities.dart';
import 'package:compiler/src/js_model/js_strategy.dart';
import 'package:compiler/src/kernel/element_map.dart';
+import 'package:compiler/src/types/abstract_value_domain.dart';
import 'package:compiler/src/types/types.dart';
import 'package:compiler/src/world.dart';
import 'package:expect/expect.dart';
@@ -29,8 +29,6 @@
main() async {
asyncTest(() async {
- print('--test Dart 1 --use-old-frontend ---------------------------------');
- await runTest([Flags.useOldFrontend], trust: false, useOldFrontend: true);
print('--test Dart 1 ----------------------------------------------------');
await runTest([], trust: false);
print('--test Dart 1 --trust-type-annotations ---------------------------');
@@ -42,39 +40,36 @@
});
}
-runTest(List<String> options,
- {bool trust: true, bool useOldFrontend: false}) async {
+runTest(List<String> options, {bool trust: true}) async {
CompilationResult result = await runCompiler(
memorySourceFiles: {'main.dart': source}, options: options);
Expect.isTrue(result.isSuccess);
Compiler compiler = result.compiler;
ClosedWorld closedWorld = compiler.backendClosedWorldForTesting;
+ AbstractValueDomain abstractValueDomain = closedWorld.abstractValueDomain;
ElementEnvironment elementEnvironment = closedWorld.elementEnvironment;
LibraryEntity helperLibrary =
elementEnvironment.lookupLibrary(Uris.dart__js_helper);
FunctionEntity loadDeferredLibrary = elementEnvironment.lookupLibraryMember(
helperLibrary, 'loadDeferredLibrary');
TypeMask typeMask;
- if (useOldFrontend) {
- MethodElement method = loadDeferredLibrary;
- typeMask = compiler.globalInference.results
- .resultOfParameter(method.parameters.first)
- .type;
- } else {
- JsBackendStrategy backendStrategy = compiler.backendStrategy;
- KernelToLocalsMap localsMap = backendStrategy.globalLocalsMapForTesting
- .getLocalsMap(loadDeferredLibrary);
- MemberDefinition definition =
- backendStrategy.elementMap.getMemberDefinition(loadDeferredLibrary);
- ir.Procedure procedure = definition.node;
- typeMask = compiler.globalInference.results
- .resultOfParameter(localsMap
- .getLocalVariable(procedure.function.positionalParameters.first))
- .type;
- }
+
+ JsBackendStrategy backendStrategy = compiler.backendStrategy;
+ KernelToLocalsMap localsMap = backendStrategy.globalLocalsMapForTesting
+ .getLocalsMap(loadDeferredLibrary);
+ MemberDefinition definition =
+ backendStrategy.elementMap.getMemberDefinition(loadDeferredLibrary);
+ ir.Procedure procedure = definition.node;
+ typeMask = compiler.globalInference.results
+ .resultOfParameter(localsMap
+ .getLocalVariable(procedure.function.positionalParameters.first))
+ .type;
+
if (trust) {
- Expect.equals(closedWorld.commonMasks.stringType.nullable(), typeMask);
+ Expect.equals(
+ abstractValueDomain.includeNull(abstractValueDomain.stringType),
+ typeMask);
} else {
- Expect.equals(closedWorld.commonMasks.dynamicType, typeMask);
+ Expect.equals(abstractValueDomain.dynamicType, typeMask);
}
}
diff --git a/tests/compiler/dart2js/inference/map_tracer_test.dart b/tests/compiler/dart2js/inference/map_tracer_test.dart
index 33e6b10..c450698 100644
--- a/tests/compiler/dart2js/inference/map_tracer_test.dart
+++ b/tests/compiler/dart2js/inference/map_tracer_test.dart
@@ -3,7 +3,6 @@
// BSD-style license that can be found in the LICENSE file.
import 'package:async_helper/async_helper.dart';
-import 'package:compiler/src/commandline_options.dart';
import 'package:compiler/src/compiler.dart';
import 'package:compiler/src/elements/entities.dart';
import 'package:compiler/src/inferrer/type_graph_inferrer.dart';
@@ -207,42 +206,34 @@
}
void main() {
- runTests({bool useKernel}) async {
+ runTests() async {
// Test empty literal map
- await doTest('{}', useKernel: useKernel);
+ await doTest('{}');
// Test preset map of <String,uint32>
await doTest('{presetKey : anInt}',
- keyElementName: "presetKey",
- valueElementName: "anInt",
- useKernel: useKernel);
+ keyElementName: "presetKey", valueElementName: "anInt");
// Test preset map of <Double,uint32>
await doTest('{aDouble : anInt}',
- keyElementName: "aDouble",
- valueElementName: "anInt",
- useKernel: useKernel);
+ keyElementName: "aDouble", valueElementName: "anInt");
}
asyncTest(() async {
- print('--test from ast---------------------------------------------------');
- await runTests(useKernel: false);
print('--test from kernel------------------------------------------------');
- await runTests(useKernel: true);
+ await runTests();
});
}
doTest(String allocation,
- {String keyElementName, String valueElementName, bool useKernel}) async {
+ {String keyElementName, String valueElementName}) async {
String source = generateTest(allocation);
- var result = await runCompiler(
- memorySourceFiles: {'main.dart': source},
- options: useKernel ? [] : [Flags.useOldFrontend]);
+ var result = await runCompiler(memorySourceFiles: {'main.dart': source});
Expect.isTrue(result.isSuccess);
Compiler compiler = result.compiler;
TypeMask keyType, valueType;
TypeGraphInferrer typesInferrer =
compiler.globalInference.typesInferrerInternal;
ClosedWorld closedWorld = typesInferrer.closedWorld;
- CommonMasks commonMasks = closedWorld.commonMasks;
+ CommonMasks commonMasks = closedWorld.abstractValueDomain;
TypeMask emptyType = new TypeMask.nonNullEmpty();
MemberEntity aKey = findMember(closedWorld, 'aKey');
TypeMask aKeyType = typesInferrer.getTypeOfMember(aKey);
diff --git a/tests/compiler/dart2js/inference/type_combination_test.dart b/tests/compiler/dart2js/inference/type_combination_test.dart
index 8a05664..2d84f97 100644
--- a/tests/compiler/dart2js/inference/type_combination_test.dart
+++ b/tests/compiler/dart2js/inference/type_combination_test.dart
@@ -6,7 +6,6 @@
import 'package:expect/expect.dart';
import 'package:compiler/src/common_elements.dart';
import 'package:compiler/src/compiler.dart';
-import 'package:compiler/src/commandline_options.dart';
import 'package:compiler/src/elements/entities.dart';
import 'package:compiler/src/types/types.dart';
import 'package:compiler/src/world.dart';
@@ -741,17 +740,14 @@
void main() {
asyncTest(() async {
- print('--test from ast---------------------------------------------------');
- await runTests(useKernel: false);
print('--test from kernel------------------------------------------------');
- await runTests(useKernel: true);
+ await runTests();
});
}
-runTests({bool useKernel}) async {
- CompilationResult result = await runCompiler(
- memorySourceFiles: {
- 'main.dart': r'''
+runTests() async {
+ CompilationResult result = await runCompiler(memorySourceFiles: {
+ 'main.dart': r'''
import 'dart:collection';
class AList<E> extends ListBase<E> {}
main() {
@@ -760,9 +756,7 @@
print('${const []}${const {}}${(){}}${new AList()}');
}
'''
- },
- options: useKernel ? [] : [Flags.useOldFrontend],
- beforeRun: (compiler) => compiler.stopAfterTypeInference = true);
+ }, beforeRun: (compiler) => compiler.stopAfterTypeInference = true);
Expect.isTrue(result.isSuccess);
Compiler compiler = result.compiler;
ClosedWorld closedWorld = compiler.backendClosedWorldForTesting;
diff --git a/tests/compiler/dart2js/inference/type_mask2_test.dart b/tests/compiler/dart2js/inference/type_mask2_test.dart
index 2f2362a..3cd3137 100644
--- a/tests/compiler/dart2js/inference/type_mask2_test.dart
+++ b/tests/compiler/dart2js/inference/type_mask2_test.dart
@@ -24,16 +24,14 @@
}
void main() {
- runTests(CompileMode compileMode) async {
- await testUnionTypeMaskFlatten(compileMode);
- await testStringSubtypes(compileMode);
+ runTests() async {
+ await testUnionTypeMaskFlatten();
+ await testStringSubtypes();
}
asyncTest(() async {
- print('--test from ast---------------------------------------------------');
- await runTests(CompileMode.memory);
print('--test from kernel------------------------------------------------');
- await runTests(CompileMode.kernel);
+ await runTests();
});
}
@@ -92,7 +90,7 @@
return union;
}
-Future testUnionTypeMaskFlatten(CompileMode compileMode) async {
+Future testUnionTypeMaskFlatten() async {
TypeEnvironment env = await TypeEnvironment.create(r"""
class A {}
class B {}
@@ -107,7 +105,7 @@
new D();
new E();
}
- """, compileMode: compileMode);
+ """);
ClosedWorld closedWorld = env.closedWorld;
@@ -210,14 +208,12 @@
containedClasses: [A, B, E]);
}
-Future testStringSubtypes(CompileMode compileMode) async {
- TypeEnvironment env = await TypeEnvironment.create('',
- mainSource: r"""
+Future testStringSubtypes() async {
+ TypeEnvironment env = await TypeEnvironment.create('', mainSource: r"""
main() {
'' is String;
}
- """,
- compileMode: compileMode);
+ """);
ClosedWorld closedWorld = env.closedWorld;
ClassEntity Object_ = env.getElement("Object");
diff --git a/tests/compiler/dart2js/inference/type_mask_disjoint_test.dart b/tests/compiler/dart2js/inference/type_mask_disjoint_test.dart
index f9d8e70..b520387 100644
--- a/tests/compiler/dart2js/inference/type_mask_disjoint_test.dart
+++ b/tests/compiler/dart2js/inference/type_mask_disjoint_test.dart
@@ -4,7 +4,6 @@
import 'package:async_helper/async_helper.dart';
import 'package:expect/expect.dart';
-import 'package:compiler/src/commandline_options.dart';
import 'package:compiler/src/common_elements.dart';
import 'package:compiler/src/compiler.dart';
import 'package:compiler/src/elements/entities.dart';
@@ -40,10 +39,9 @@
""";
main() {
- runTests({bool useKernel}) async {
- CompilationResult result = await runCompiler(
- memorySourceFiles: {'main.dart': CODE},
- options: useKernel ? [] : [Flags.useOldFrontend]);
+ runTests() async {
+ CompilationResult result =
+ await runCompiler(memorySourceFiles: {'main.dart': CODE});
Expect.isTrue(result.isSuccess);
Compiler compiler = result.compiler;
ClosedWorld world = compiler.backendClosedWorldForTesting;
@@ -202,9 +200,7 @@
}
asyncTest(() async {
- print('--test from ast---------------------------------------------------');
- await runTests(useKernel: false);
print('--test from kernel------------------------------------------------');
- await runTests(useKernel: true);
+ await runTests();
});
}
diff --git a/tests/compiler/dart2js/inference/type_mask_test.dart b/tests/compiler/dart2js/inference/type_mask_test.dart
index dd77a78..91b1968 100644
--- a/tests/compiler/dart2js/inference/type_mask_test.dart
+++ b/tests/compiler/dart2js/inference/type_mask_test.dart
@@ -6,7 +6,6 @@
import 'package:expect/expect.dart';
import 'package:compiler/src/types/types.dart';
-import 'package:compiler/src/commandline_options.dart';
import 'package:compiler/src/common_elements.dart';
import 'package:compiler/src/compiler.dart';
import 'package:compiler/src/world.dart';
@@ -23,10 +22,9 @@
""";
main() {
- runTests({bool useKernel}) async {
- CompilationResult result = await runCompiler(
- memorySourceFiles: {'main.dart': CODE},
- options: useKernel ? [] : [Flags.useOldFrontend]);
+ runTests() async {
+ CompilationResult result =
+ await runCompiler(memorySourceFiles: {'main.dart': CODE});
Expect.isTrue(result.isSuccess);
Compiler compiler = result.compiler;
ClosedWorld closedWorld = compiler.backendClosedWorldForTesting;
@@ -138,9 +136,7 @@
}
asyncTest(() async {
- print('--test from ast---------------------------------------------------');
- await runTests(useKernel: false);
print('--test from kernel------------------------------------------------');
- await runTests(useKernel: true);
+ await runTests();
});
}
diff --git a/tests/compiler/dart2js/inference/union_type_test.dart b/tests/compiler/dart2js/inference/union_type_test.dart
index 6b0bcdf..1890622 100644
--- a/tests/compiler/dart2js/inference/union_type_test.dart
+++ b/tests/compiler/dart2js/inference/union_type_test.dart
@@ -9,7 +9,7 @@
import '../type_test_helper.dart';
main() {
- runTest(CompileMode compileMode) async {
+ runTest() async {
TypeEnvironment env = await TypeEnvironment.create(r"""
class A {}
class B {}
@@ -18,7 +18,7 @@
new A();
new B();
}
- """, compileMode: compileMode);
+ """);
ClosedWorld world = env.closedWorld;
FlatTypeMask mask1 = new FlatTypeMask.exact(env.getClass('A'));
FlatTypeMask mask2 = new FlatTypeMask.exact(env.getClass('B'));
@@ -28,9 +28,7 @@
}
asyncTest(() async {
- print('--test from ast---------------------------------------------------');
- await runTest(CompileMode.memory);
print('--test from kernel------------------------------------------------');
- await runTest(CompileMode.kernel);
+ await runTest();
});
}
diff --git a/tests/compiler/dart2js/inlining/meta_annotations2_test.dart b/tests/compiler/dart2js/inlining/meta_annotations2_test.dart
index 64769bc..ba54022 100644
--- a/tests/compiler/dart2js/inlining/meta_annotations2_test.dart
+++ b/tests/compiler/dart2js/inlining/meta_annotations2_test.dart
@@ -7,7 +7,6 @@
import "package:expect/expect.dart";
import "package:async_helper/async_helper.dart";
import 'package:compiler/compiler_new.dart';
-import 'package:compiler/src/commandline_options.dart';
import '../memory_compiler.dart';
const MEMORY_SOURCE_FILES = const {
@@ -39,12 +38,10 @@
};
void main() {
- runTests({bool useKernel}) async {
+ runTests() async {
OutputCollector collector = new OutputCollector();
await runCompiler(
- memorySourceFiles: MEMORY_SOURCE_FILES,
- outputProvider: collector,
- options: useKernel ? [] : [Flags.useOldFrontend]);
+ memorySourceFiles: MEMORY_SOURCE_FILES, outputProvider: collector);
// Simply check that the constants of the small functions are still in the
// output, and that we don't see the result of constant folding.
String jsOutput = collector.getOutput('', OutputType.js);
@@ -68,9 +65,7 @@
}
asyncTest(() async {
- print('--test from ast---------------------------------------------------');
- await runTests(useKernel: false);
print('--test from kernel------------------------------------------------');
- await runTests(useKernel: true);
+ await runTests();
});
}
diff --git a/tests/compiler/dart2js/inlining/meta_annotations3_test.dart b/tests/compiler/dart2js/inlining/meta_annotations3_test.dart
index 47109f3..e34c263 100644
--- a/tests/compiler/dart2js/inlining/meta_annotations3_test.dart
+++ b/tests/compiler/dart2js/inlining/meta_annotations3_test.dart
@@ -7,7 +7,6 @@
import "package:expect/expect.dart";
import "package:async_helper/async_helper.dart";
import 'package:compiler/compiler_new.dart';
-import 'package:compiler/src/commandline_options.dart';
import '../memory_compiler.dart';
const MEMORY_SOURCE_FILES = const {
@@ -51,12 +50,10 @@
};
void main() {
- runTests({bool useKernel}) async {
+ runTests() async {
OutputCollector collector = new OutputCollector();
await runCompiler(
- memorySourceFiles: MEMORY_SOURCE_FILES,
- outputProvider: collector,
- options: useKernel ? [] : [Flags.useOldFrontend]);
+ memorySourceFiles: MEMORY_SOURCE_FILES, outputProvider: collector);
String jsOutput = collector.getOutput('', OutputType.js);
void has(String text) {
@@ -83,9 +80,7 @@
}
asyncTest(() async {
- print('--test from ast---------------------------------------------------');
- await runTests(useKernel: false);
print('--test from kernel------------------------------------------------');
- await runTests(useKernel: true);
+ await runTests();
});
}
diff --git a/tests/compiler/dart2js/inlining/meta_annotations_test.dart b/tests/compiler/dart2js/inlining/meta_annotations_test.dart
index 256c28c..e8aa7c3 100644
--- a/tests/compiler/dart2js/inlining/meta_annotations_test.dart
+++ b/tests/compiler/dart2js/inlining/meta_annotations_test.dart
@@ -4,7 +4,6 @@
import 'package:expect/expect.dart';
import 'package:async_helper/async_helper.dart';
-import 'package:compiler/src/commandline_options.dart';
import 'package:compiler/src/common_elements.dart';
import 'package:compiler/src/compiler.dart';
import 'package:compiler/src/elements/entities.dart';
@@ -34,10 +33,9 @@
};
main() {
- runTests({bool useKernel}) async {
- CompilationResult result = await runCompiler(
- memorySourceFiles: MEMORY_SOURCE_FILES,
- options: useKernel ? [] : [Flags.useOldFrontend]);
+ runTests() async {
+ CompilationResult result =
+ await runCompiler(memorySourceFiles: MEMORY_SOURCE_FILES);
Compiler compiler = result.compiler;
ClosedWorld closedWorld =
compiler.resolutionWorldBuilder.closedWorldForTesting;
@@ -72,9 +70,7 @@
}
asyncTest(() async {
- print('--test from ast---------------------------------------------------');
- await runTests(useKernel: false);
print('--test from kernel------------------------------------------------');
- await runTests(useKernel: true);
+ await runTests();
});
}
diff --git a/tests/compiler/dart2js/instantiated_classes_test.dart b/tests/compiler/dart2js/instantiated_classes_test.dart
index 11a276a..4c1aab1 100644
--- a/tests/compiler/dart2js/instantiated_classes_test.dart
+++ b/tests/compiler/dart2js/instantiated_classes_test.dart
@@ -12,7 +12,7 @@
import 'type_test_helper.dart';
void main() {
- Future runTests({bool useKernel}) async {
+ Future runTests() async {
Future test(String source, List<String> directlyInstantiatedClasses,
[List<String> newClasses = const <String>["Class"]]) async {
StringBuffer mainSource = new StringBuffer();
@@ -22,8 +22,7 @@
}
mainSource.write('}');
dynamic env = await TypeEnvironment.create(source,
- mainSource: mainSource.toString(),
- compileMode: useKernel ? CompileMode.kernel : CompileMode.memory);
+ mainSource: mainSource.toString());
LibraryEntity mainLibrary =
env.compiler.frontendStrategy.elementEnvironment.mainLibrary;
Iterable<ClassEntity> expectedClasses =
@@ -70,24 +69,14 @@
class Class extends B with A {}""", ["Class", "A"],
["Class", "A"]);
- if (!useKernel) {
- // TODO(johnniwinther): Avoid registration of `Class` as instantiated.
- await test("""class A {}
- class Class implements A {
- factory Class() = A;
- }""", ["Class", "A"], ["Class"]);
- } else {
- await test("""class A {}
- class Class implements A {
- factory Class() = A;
- }""", ["A"], ["Class"]);
- }
+ await test("""class A {}
+ class Class implements A {
+ factory Class() = A;
+ }""", ["A"], ["Class"]);
}
asyncTest(() async {
- print('--test from ast---------------------------------------------------');
- await runTests(useKernel: false);
print('--test from kernel------------------------------------------------');
- await runTests(useKernel: true);
+ await runTests();
});
}
diff --git a/tests/compiler/dart2js/js/js_constant_test.dart b/tests/compiler/dart2js/js/js_constant_test.dart
index 22eeedf..f373884 100644
--- a/tests/compiler/dart2js/js/js_constant_test.dart
+++ b/tests/compiler/dart2js/js/js_constant_test.dart
@@ -3,7 +3,6 @@
// BSD-style license that can be found in the LICENSE file.
import 'package:async_helper/async_helper.dart';
-import 'package:compiler/src/commandline_options.dart';
import 'package:compiler/src/elements/entities.dart';
import 'package:expect/expect.dart';
import '../compiler_helper.dart';
@@ -19,16 +18,14 @@
""";
main() {
- runTest({bool useKernel}) async {
+ runTest() async {
check(String test) async {
// Pretend this is a dart2js_native test to allow use of 'native' keyword
// and import of private libraries.
String main = 'sdk/tests/compiler/dart2js_native/main.dart';
Uri entryPoint = Uri.parse('memory:$main');
var result = await runCompiler(
- entryPoint: entryPoint,
- memorySourceFiles: {main: test},
- options: useKernel ? [] : [Flags.useOldFrontend]);
+ entryPoint: entryPoint, memorySourceFiles: {main: test});
Expect.isTrue(result.isSuccess);
var compiler = result.compiler;
var closedWorld = compiler.backendClosedWorldForTesting;
@@ -44,9 +41,7 @@
}
asyncTest(() async {
- print('--test from ast---------------------------------------------------');
- await runTest(useKernel: false);
print('--test from kernel------------------------------------------------');
- await runTest(useKernel: true);
+ await runTest();
});
}
diff --git a/tests/compiler/dart2js/js/js_spec_optimization_test.dart b/tests/compiler/dart2js/js/js_spec_optimization_test.dart
index 3608519..8b97114 100644
--- a/tests/compiler/dart2js/js/js_spec_optimization_test.dart
+++ b/tests/compiler/dart2js/js/js_spec_optimization_test.dart
@@ -3,7 +3,6 @@
// BSD-style license that can be found in the LICENSE file.
import 'package:async_helper/async_helper.dart';
-import 'package:compiler/src/commandline_options.dart';
import 'package:compiler/src/elements/entities.dart';
import 'package:expect/expect.dart';
import '../compiler_helper.dart';
@@ -87,15 +86,13 @@
""";
main() {
- runTests({bool useKernel}) async {
+ runTests() async {
check(String test) async {
var checker = checkerForAbsentPresent(test);
String main = 'sdk/tests/compiler/dart2js_native/main.dart';
Uri entryPoint = Uri.parse('memory:$main');
var result = await runCompiler(
- entryPoint: entryPoint,
- memorySourceFiles: {main: test},
- options: useKernel ? [] : [Flags.useOldFrontend]);
+ entryPoint: entryPoint, memorySourceFiles: {main: test});
Expect.isTrue(result.isSuccess);
var compiler = result.compiler;
var closedWorld = compiler.backendClosedWorldForTesting;
@@ -115,9 +112,7 @@
}
asyncTest(() async {
- print('--test from ast---------------------------------------------------');
- await runTests(useKernel: false);
print('--test from kernel------------------------------------------------');
- await runTests(useKernel: true);
+ await runTests();
});
}
diff --git a/tests/compiler/dart2js/jsinterop/declaration_test.dart b/tests/compiler/dart2js/jsinterop/declaration_test.dart
index 31ad8d3..a53ae1a 100644
--- a/tests/compiler/dart2js/jsinterop/declaration_test.dart
+++ b/tests/compiler/dart2js/jsinterop/declaration_test.dart
@@ -439,22 +439,16 @@
runTest(Test test) async {
print('==${test.name}======================================================');
print(test.source);
- await runTestInternal(test, useKernel: false);
if (!test.skipForKernel) {
- await runTestInternal(test, useKernel: true);
+ await runTestInternal(test);
}
}
-runTestInternal(Test test, {bool useKernel}) async {
+runTestInternal(Test test) async {
DiagnosticCollector collector = new DiagnosticCollector();
List<String> options = <String>[];
- if (useKernel) {
- // TODO(redemption): Enable inlining.
- options.add(Flags.disableInlining);
- } else {
- options.add(Flags.useOldFrontend);
- }
- print('--useKernel=${useKernel}--------------------------------------------');
+ // TODO(redemption): Enable inlining.
+ options.add(Flags.disableInlining);
await runCompiler(
diagnosticHandler: collector,
options: options,
diff --git a/tests/compiler/dart2js/jsinterop/interop_anonymous_unreachable_test.dart b/tests/compiler/dart2js/jsinterop/interop_anonymous_unreachable_test.dart
index 97b27a6..b1084d2 100644
--- a/tests/compiler/dart2js/jsinterop/interop_anonymous_unreachable_test.dart
+++ b/tests/compiler/dart2js/jsinterop/interop_anonymous_unreachable_test.dart
@@ -8,7 +8,7 @@
import 'package:expect/expect.dart';
import '../compiler_helper.dart';
-testUnreachableCrash({bool useKernel}) async {
+testUnreachableCrash() async {
print("-- unreachable code doesn't crash the compiler --");
// This test is a regression for Issue #24974
String generated = await compile("""
@@ -19,13 +19,13 @@
external factory UniqueLongNameForTesting_A();
}
main() {}
- """, returnAll: true, useKernel: useKernel);
+ """, returnAll: true);
// the code should not be included in the output either.
Expect.isFalse(generated.contains("UniqueLongNameForTesting_A"));
}
-testTreeShakingJsInteropTypes({bool useKernel}) async {
+testTreeShakingJsInteropTypes() async {
print('-- tree-shaking interop types --');
String program = """
import 'package:js/js.dart';
@@ -71,8 +71,7 @@
""";
print(' - no tree-shaking by default -');
- String generated1 =
- await compile(program, returnAll: true, useKernel: useKernel);
+ String generated1 = await compile(program, returnAll: true);
Expect.isTrue(generated1.contains("UniqueLongNameForTesting_A"));
Expect.isTrue(generated1.contains("UniqueLongNameForTesting_D"));
@@ -82,9 +81,7 @@
print(' - tree-shake when using flag -');
String generated2 = await compile(program,
- trustJSInteropTypeAnnotations: true,
- returnAll: true,
- useKernel: useKernel);
+ trustJSInteropTypeAnnotations: true, returnAll: true);
Expect.isTrue(generated2.contains("UniqueLongNameForTesting_A"));
Expect.isTrue(generated2.contains("UniqueLongNameForTesting_D"));
@@ -93,7 +90,7 @@
Expect.isFalse(generated2.contains("UniqueLongNameForTesting_E"));
}
-testTreeShakingNativeTypes({bool useKernel}) async {
+testTreeShakingNativeTypes() async {
print('-- tree-shaking other native types --');
String program = """
@@ -116,8 +113,7 @@
""";
print(' - allocation effect of dynamic excludes native types -');
- String generated1 =
- await compile(program, returnAll: true, useKernel: useKernel);
+ String generated1 = await compile(program, returnAll: true);
Expect.isTrue(generated1.contains("UniqueLongNameForTesting_A"));
// any js-interop type could be allocated by `get x`
Expect.isTrue(generated1.contains("UniqueLongNameForTesting_B"));
@@ -127,9 +123,7 @@
print(' - allocation effect of dynamic excludes native types [flag] -');
// Trusting types doesn't make a difference.
String generated2 = await compile(program,
- trustJSInteropTypeAnnotations: true,
- returnAll: true,
- useKernel: useKernel);
+ trustJSInteropTypeAnnotations: true, returnAll: true);
Expect.isTrue(generated2.contains("UniqueLongNameForTesting_A"));
Expect.isTrue(generated2.contains("UniqueLongNameForTesting_B"));
Expect.isFalse(generated2.contains("HTMLAudioElement"));
@@ -149,8 +143,7 @@
}
""";
- String generated3 =
- await compile(program2, returnAll: true, useKernel: useKernel);
+ String generated3 = await compile(program2, returnAll: true);
Expect.isTrue(generated3.contains("UniqueLongNameForTesting_A"));
Expect.isTrue(generated3.contains("HTMLAudioElement"));
@@ -168,7 +161,7 @@
}
""";
- generated3 = await compile(program2, returnAll: true, useKernel: useKernel);
+ generated3 = await compile(program2, returnAll: true);
Expect.isTrue(generated3.contains("UniqueLongNameForTesting_A"));
// This extra check is to make sure that we don't include HTMLAudioElement
// just because of the is-check. It is optimized away in this case because
@@ -177,16 +170,14 @@
}
main() {
- runTests({bool useKernel}) async {
- await testUnreachableCrash(useKernel: useKernel);
- await testTreeShakingJsInteropTypes(useKernel: useKernel);
- await testTreeShakingNativeTypes(useKernel: useKernel);
+ runTests() async {
+ await testUnreachableCrash();
+ await testTreeShakingJsInteropTypes();
+ await testTreeShakingNativeTypes();
}
asyncTest(() async {
- print('--test from ast---------------------------------------------------');
- await runTests(useKernel: false);
print('--test from kernel------------------------------------------------');
- await runTests(useKernel: true);
+ await runTests();
});
}
diff --git a/tests/compiler/dart2js/jsinterop/world_test.dart b/tests/compiler/dart2js/jsinterop/world_test.dart
index 94e990a..a691e29 100644
--- a/tests/compiler/dart2js/jsinterop/world_test.dart
+++ b/tests/compiler/dart2js/jsinterop/world_test.dart
@@ -7,7 +7,6 @@
import 'package:expect/expect.dart';
import 'package:async_helper/async_helper.dart';
import 'package:compiler/src/common_elements.dart';
-import 'package:compiler/src/commandline_options.dart';
import 'package:compiler/src/compiler.dart';
import 'package:compiler/src/elements/entities.dart' show ClassEntity;
import 'package:compiler/src/elements/names.dart';
@@ -18,8 +17,6 @@
void main() {
asyncTest(() async {
- print('--test from ast---------------------------------------------------');
- await testClasses([Flags.useOldFrontend]);
print('--test from kernel------------------------------------------------');
await testClasses([]);
print('--test from kernel (strong mode)----------------------------------');
diff --git a/tests/compiler/dart2js/mirrors/array_tracing_mirror_test.dart b/tests/compiler/dart2js/mirrors/array_tracing_mirror_test.dart
deleted file mode 100644
index bb819cb..0000000
--- a/tests/compiler/dart2js/mirrors/array_tracing_mirror_test.dart
+++ /dev/null
@@ -1,44 +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.
-
-// Make sure that limiting mirrors through @MirrorsUsed does not
-// affect optimizations done on arrays.
-
-import 'package:expect/expect.dart';
-import 'package:async_helper/async_helper.dart';
-import 'package:compiler/src/commandline_options.dart';
-import '../memory_compiler.dart';
-
-const MEMORY_SOURCE_FILES = const {
- 'main.dart': '''
-
-@MirrorsUsed(targets: 'main')
-import 'dart:mirrors';
-class A {
- var field;
-}
-
-main() {
- var a = new A();
- var mirror = reflect(a);
- var array = [42, 42];
- a.field = array;
- var field = mirror.getField(#field);
- field.invoke(#clear, []);
- return array.length;
-}
-''',
-};
-
-main() {
- asyncTest(() async {
- var result = await runCompiler(
- memorySourceFiles: MEMORY_SOURCE_FILES,
- options: [Flags.useOldFrontend]);
- var compiler = result.compiler;
- var element = compiler.frontendStrategy.elementEnvironment.mainFunction;
- var code = compiler.backend.getGeneratedCode(element);
- Expect.isTrue(code.contains('return 2'), "Unexpected code:\n$code");
- });
-}
diff --git a/tests/compiler/dart2js/mirrors/data/mirrors_helper.dart b/tests/compiler/dart2js/mirrors/data/mirrors_helper.dart
deleted file mode 100644
index b8de0ac..0000000
--- a/tests/compiler/dart2js/mirrors/data/mirrors_helper.dart
+++ /dev/null
@@ -1,77 +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.
-
-/**
- * This file is read by 'mirrors_test.dart'.
- */
-
-library mirrors_helper;
-
-typedef E Func<E, F extends Foo>(F f);
-
-main() {}
-
-/// Singleline doc comment.
-@Metadata(null)
-// Singleline comment 1.
-// Singleline comment 2.
-@Metadata(true)
-@Metadata(false)
-@Metadata(0)
-@Metadata(1.5)
-@Metadata("Foo")
-@Metadata(const ["Foo"])
-@Metadata(const {'foo': "Foo"})
-@metadata
-/** Multiline doc comment. */
-/* Multiline comment. */ class Foo {
- m(@metadata a) {}
-}
-
-abstract class Bar<E> {}
-
-class Baz<E, F extends Foo> implements Bar<E> {
- Baz();
- const Baz.named();
- factory Baz.factory() => new Baz<E, F>();
-
- static method1(e) {}
- void method2(E e, [F f = null]) {}
- Baz<E, F> method3(E func1(F f), Func<E, F> func2) => null;
-
- bool operator ==(Object other) => false;
- int operator -() => 0;
- operator$foo() {}
-}
-
-class Boz extends Foo {
- var field1;
- int _field2;
- final String field3 = "field3";
-
- int get field2 => _field2;
- void set field2(int value) {
- _field2 = value;
- }
-}
-
-// ignore: UNUSED_ELEMENT
-class _PrivateClass {
- var _privateField;
- // ignore: UNUSED_ELEMENT
- get _privateGetter => _privateField;
- // ignore: UNUSED_ELEMENT
- void set _privateSetter(value) => _privateField = value;
- // ignore: UNUSED_ELEMENT
- void _privateMethod() {}
- _PrivateClass._privateConstructor();
- factory _PrivateClass._privateFactoryConstructor() => null;
-}
-
-const metadata = const Metadata(null);
-
-class Metadata {
- final data;
- const Metadata(this.data);
-}
diff --git a/tests/compiler/dart2js/mirrors/deferred_mirrors_test.dart b/tests/compiler/dart2js/mirrors/deferred_mirrors_test.dart
deleted file mode 100644
index bfff8f1..0000000
--- a/tests/compiler/dart2js/mirrors/deferred_mirrors_test.dart
+++ /dev/null
@@ -1,202 +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 of the graph segmentation algorithm used by deferred loading
-// to determine which elements can be deferred and which libraries
-// much be included in the initial download (loaded eagerly).
-
-import 'dart:async';
-import 'package:expect/expect.dart';
-import 'package:async_helper/async_helper.dart';
-import 'package:compiler/src/commandline_options.dart';
-import '../memory_compiler.dart';
-
-Future runTest(String mainScript, test) async {
- CompilationResult result = await runCompiler(
- entryPoint: Uri.parse(mainScript),
- memorySourceFiles: MEMORY_SOURCE_FILES,
- options: [Flags.useOldFrontend]);
- test(result.compiler);
-}
-
-lookupLibrary(compiler, name) {
- return compiler.libraryLoader.lookupLibrary(Uri.parse(name));
-}
-
-void main() {
- asyncTest(runTests);
-}
-
-runTests() async {
- await runTest('memory:main.dart', (compiler) {
- var main = compiler.frontendStrategy.elementEnvironment.mainFunction;
- Expect.isNotNull(main, "Could not find 'main'");
- var outputUnitForEntity =
- compiler.backend.outputUnitData.outputUnitForEntity;
-
- var lib1 = lookupLibrary(compiler, "memory:lib1.dart");
- var lib2 = lookupLibrary(compiler, "memory:lib2.dart");
- var mathLib = lookupLibrary(compiler, "dart:math");
- var sin = mathLib.find('sin');
- var foo1 = lib1.find("foo1");
- var foo2 = lib2.find("foo2");
- var field2 = lib2.find("field2");
-
- Expect.notEquals(outputUnitForEntity(main), outputUnitForEntity(foo1));
- Expect.equals(outputUnitForEntity(main), outputUnitForEntity(sin));
- Expect.equals(outputUnitForEntity(foo2), outputUnitForEntity(field2));
- });
- await runTest('memory:main2.dart', (compiler) {
- // Just check that the compile runs.
- // This is a regression test.
- Expect.isTrue(true);
- });
- await runTest('memory:main3.dart', (compiler) {
- var main = compiler.frontendStrategy.elementEnvironment.mainFunction;
- Expect.isNotNull(main, "Could not find 'main'");
- var outputUnitForEntity =
- compiler.backend.outputUnitData.outputUnitForEntity;
-
- Expect.isFalse(compiler.backend.mirrorsData.hasInsufficientMirrorsUsed);
- var mainLib = lookupLibrary(compiler, "memory:main3.dart");
- var lib3 = lookupLibrary(compiler, "memory:lib3.dart");
- var C = mainLib.find("C");
- var foo = lib3.find("foo");
-
- Expect.notEquals(outputUnitForEntity(main), outputUnitForEntity(foo));
- Expect.equals(outputUnitForEntity(main), outputUnitForEntity(C));
- });
- await runTest('memory:main4.dart', (compiler) {
- var main = compiler.frontendStrategy.elementEnvironment.mainFunction;
- Expect.isNotNull(main, "Could not find 'main'");
- var outputUnitForEntity =
- compiler.backend.outputUnitData.outputUnitForEntity;
-
- lookupLibrary(compiler, "memory:main4.dart");
- lookupLibrary(compiler, "memory:lib4.dart");
- var lib5 = lookupLibrary(compiler, "memory:lib5.dart");
- var lib6 = lookupLibrary(compiler, "memory:lib6.dart");
- var foo5 = lib5.find("foo");
- var foo6 = lib6.find("foo");
-
- Expect.notEquals(outputUnitForEntity(main), outputUnitForEntity(foo5));
- Expect.equals(outputUnitForEntity(foo5), outputUnitForEntity(foo6));
- });
-}
-
-// "lib1.dart" uses mirrors without a MirrorsUsed annotation, so everything
-// should be put in the "lib1" output unit.
-const Map MEMORY_SOURCE_FILES = const {
- "main.dart": """
-import "dart:math";
-
-import 'lib1.dart' deferred as lib1;
-import 'lib2.dart' deferred as lib2;
-
-void main() {
- lib1.loadLibrary().then((_) {
- lib1.foo1();
- });
- lib2.loadLibrary().then((_) {
- lib2.foo2();
- });
-}
-""",
- "lib1.dart": """
-library lib1;
-import "dart:mirrors";
-
-const field1 = 42;
-
-void foo1() {
- var mirror = reflect(field1);
- mirror.invoke(null, null);
-}
-""",
- "lib2.dart": """
-library lib2;
-@MirrorsUsed(targets: "field2") import "dart:mirrors";
-
-const field2 = 42;
-
-void foo2() {
- var mirror = reflect(field2);
- mirror.invoke(null, null);
-}
-""",
-// The elements C and f are named as targets, but there is no actual use of
-// mirrors.
- "main2.dart": """
-import "lib.dart" deferred as lib;
-
-@MirrorsUsed(targets: const ["C", "f"])
-import "dart:mirrors";
-
-class C {}
-
-var f = 3;
-
-void main() {
-
-}
-""",
- "lib.dart": """ """,
-// Lib3 has a MirrorsUsed annotation with a library.
-// Check that that is handled correctly.
- "main3.dart": """
-library main3;
-
-import "lib3.dart" deferred as lib;
-
-class C {}
-
-class D {}
-
-f() {}
-
-void main() {
- lib.loadLibrary().then((_) {
- lib.foo();
- });
-}
-""",
- "lib3.dart": """
-@MirrorsUsed(targets: const ["main3.C"])
-import "dart:mirrors";
-
-foo() {
- currentMirrorSystem().findLibrary(#main3);
-}
-""",
-// Check that exports and imports are handled correctly with mirrors.
- "main4.dart": """
-library main3;
-
-@MirrorsUsed(targets: const ["lib5.foo","lib6.foo"])
-import "dart:mirrors";
-
-import "lib4.dart" deferred as lib;
-
-void main() {
- lib.loadLibrary().then((_) {
- currentMirrorSystem().findLibrary(#lib5);
- });
-}
-""",
- "lib4.dart": """
-import "lib5.dart";
-export "lib6.dart";
-
-""",
- "lib5.dart": """
-library lib5;
-
-foo() {}
-""",
- "lib6.dart": """
-library lib6;
-
-foo() {}
-""",
-};
diff --git a/tests/compiler/dart2js/mirrors/import_mirrors_test.dart b/tests/compiler/dart2js/mirrors/import_mirrors_test.dart
deleted file mode 100644
index 5a2017f..0000000
--- a/tests/compiler/dart2js/mirrors/import_mirrors_test.dart
+++ /dev/null
@@ -1,376 +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 the compiler emits a warning on import of 'dart:mirrors' unless
-// the flag --enable-experimental-mirrors is used.
-
-library dart2js.test.import_mirrors;
-
-import 'dart:async';
-import 'package:expect/expect.dart';
-import 'package:async_helper/async_helper.dart';
-import 'package:compiler/src/commandline_options.dart';
-import 'package:compiler/src/diagnostics/messages.dart'
- show MessageKind, MessageTemplate;
-import '../memory_compiler.dart';
-
-const DIRECT_IMPORT = const {
- '/main.dart': '''
-import 'dart:mirrors';
-
-main() {}
-''',
- 'paths': "main.dart => dart:mirrors",
-};
-
-const INDIRECT_IMPORT1 = const {
- '/main.dart': '''
-import 'first.dart';
-
-main() {}
-''',
- '/first.dart': '''
-import 'dart:mirrors';
-''',
- 'paths': "first.dart => dart:mirrors",
- 'verbosePaths': "main.dart => first.dart => dart:mirrors",
-};
-
-const INDIRECT_IMPORT2 = const {
- '/main.dart': '''
-import 'first.dart';
-
-main() {}
-''',
- '/first.dart': '''
-import 'second.dart';
-''',
- '/second.dart': '''
-import 'dart:mirrors';
-''',
- 'paths': "second.dart => dart:mirrors",
- 'verbosePaths': "main.dart => first.dart => second.dart => dart:mirrors",
-};
-
-const INDIRECT_PACKAGE_IMPORT1 = const {
- '/main.dart': '''
-import 'first.dart';
-
-main() {}
-''',
- '/first.dart': '''
-import 'package:second/second.dart';
-''',
- '/pkg/second/second.dart': '''
-import 'dart:mirrors';
-''',
- 'paths': "first.dart => package:second => dart:mirrors",
- 'verbosePaths':
- "main.dart => first.dart => package:second/second.dart => dart:mirrors",
-};
-
-const INDIRECT_PACKAGE_IMPORT2 = const {
- '/main.dart': '''
-import 'first.dart';
-
-main() {}
-''',
- '/first.dart': '''
-import 'package:packagename/second.dart';
-''',
- '/pkg/packagename/second.dart': '''
-import 'dart:mirrors';
-''',
- 'paths': "first.dart => package:packagename => dart:mirrors",
- 'verbosePaths': "main.dart => first.dart => package:packagename/second.dart "
- "=> dart:mirrors",
-};
-
-const INDIRECT_PACKAGE_IMPORT3 = const {
- '/main.dart': '''
-import 'first.dart';
-
-main() {}
-''',
- '/first.dart': '''
-import 'package:package1/second.dart';
-''',
- '/pkg/package1/second.dart': '''
-import 'package:package2/third.dart';
-''',
- '/pkg/package2/third.dart': '''
-import 'dart:mirrors';
-''',
- 'paths': "first.dart => package:package1 => package:package2 => dart:mirrors",
- 'verbosePaths': "main.dart => first.dart => package:package1/second.dart "
- "=> package:package2/third.dart => dart:mirrors",
-};
-
-const INDIRECT_PACKAGE_IMPORT4 = const {
- '/main.dart': '''
-import 'first.dart';
-
-main() {}
-''',
- '/first.dart': '''
-import 'package:package1/second.dart';
-''',
- '/pkg/package1/second.dart': '''
-import 'sub/third.dart';
-''',
- '/pkg/package1/sub/third.dart': '''
-import 'package:package2/fourth.dart';
-''',
- '/pkg/package2/fourth.dart': '''
-import 'lib/src/fifth.dart';
-''',
- '/pkg/package2/lib/src/fifth.dart': '''
-import 'dart:mirrors';
-''',
- 'paths': "first.dart => package:package1 => package:package2 => dart:mirrors",
- 'verbosePaths': "main.dart => first.dart => package:package1/second.dart "
- "=> package:package1/sub/third.dart => package:package2/fourth.dart "
- "=> package:package2/lib/src/fifth.dart => dart:mirrors",
-};
-
-const DUAL_DIRECT_IMPORT = const {
- '/main.dart': '''
-import 'dart:mirrors';
-import 'dart:mirrors';
-
-main() {}
-''',
- 'paths': "main.dart => dart:mirrors",
-};
-
-const DUAL_INDIRECT_IMPORT1 = const {
- '/main.dart': '''
-import 'dart:mirrors';
-import 'first.dart';
-
-main() {}
-''',
- '/first.dart': '''
-import 'dart:mirrors';
-''',
- 'paths': const ["main.dart => dart:mirrors", "first.dart => dart:mirrors"],
- 'verbosePaths': const [
- "main.dart => dart:mirrors",
- "main.dart => first.dart => dart:mirrors"
- ],
-};
-
-const DUAL_INDIRECT_IMPORT2 = const {
- '/main.dart': '''
-import 'first.dart';
-import 'second.dart';
-
-main() {}
-''',
- '/first.dart': '''
-import 'dart:mirrors';
-''',
- '/second.dart': '''
-import 'dart:mirrors';
-''',
- 'paths': const ["first.dart => dart:mirrors", "second.dart => dart:mirrors"],
- 'verbosePaths': const [
- "main.dart => first.dart => dart:mirrors",
- "main.dart => second.dart => dart:mirrors"
- ],
-};
-
-const DUAL_INDIRECT_IMPORT3 = const {
- '/main.dart': '''
-import 'first.dart';
-import 'second.dart';
-
-main() {}
-''',
- '/first.dart': '''
-import 'third.dart';
-''',
- '/second.dart': '''
-import 'third.dart';
-''',
- '/third.dart': '''
-import 'dart:mirrors';
-''',
- 'paths': "third.dart => dart:mirrors",
- 'verbosePaths': const [
- "main.dart => first.dart => third.dart => dart:mirrors",
- "main.dart => second.dart => third.dart => dart:mirrors"
- ],
-};
-
-const DUAL_INDIRECT_PACKAGE_IMPORT1 = const {
- '/main.dart': '''
-import 'package:package1/second.dart';
-import 'first.dart';
-
-main() {}
-''',
- '/first.dart': '''
-import 'package:package2/third.dart';
-''',
- '/pkg/package1/second.dart': '''
-import 'dart:mirrors';
-''',
- '/pkg/package2/third.dart': '''
-import 'dart:mirrors';
-''',
- 'paths': const [
- "main.dart => package:package1 => dart:mirrors",
- "first.dart => package:package2 => dart:mirrors"
- ],
- 'verbosePaths': const [
- "main.dart => package:package1/second.dart => dart:mirrors",
- "main.dart => first.dart => package:package2/third.dart => dart:mirrors"
- ]
-};
-
-const DIRECT_EXPORT = const {
- '/main.dart': '''
-export 'dart:mirrors';
-
-main() {}
-''',
- 'paths': "main.dart => dart:mirrors",
-};
-
-const INDIRECT_EXPORT1 = const {
- '/main.dart': '''
-import 'first.dart';
-
-main() {}
-''',
- '/first.dart': '''
-export 'dart:mirrors';
-''',
- 'paths': "first.dart => dart:mirrors",
- 'verbosePaths': "main.dart => first.dart => dart:mirrors",
-};
-
-const INDIRECT_EXPORT2 = const {
- '/main.dart': '''
-import 'first.dart';
-
-main() {}
-''',
- '/first.dart': '''
-import 'second.dart';
-''',
- '/second.dart': '''
-export 'dart:mirrors';
-''',
- 'paths': "second.dart => dart:mirrors",
- 'verbosePaths': "main.dart => first.dart => second.dart => dart:mirrors",
-};
-
-const INDIRECT_PACKAGE_EXPORT1 = const {
- '/main.dart': '''
-import 'first.dart';
-
-main() {}
-''',
- '/first.dart': '''
-import 'package:packagename/second.dart';
-''',
- '/pkg/packagename/second.dart': '''
-export 'dart:mirrors';
-''',
- 'paths': "first.dart => package:packagename => dart:mirrors",
- 'verbosePaths': "main.dart => first.dart => package:packagename/second.dart "
- "=> dart:mirrors",
-};
-
-const INDIRECT_PACKAGE_EXPORT2 = const {
- '/main.dart': '''
-import 'first.dart';
-
-main() {}
-''',
- '/first.dart': '''
-export 'package:packagename/second.dart';
-''',
- '/pkg/packagename/second.dart': '''
-import 'dart:mirrors';
-''',
- 'paths': "first.dart => package:packagename => dart:mirrors",
- 'verbosePaths': "main.dart => first.dart => package:packagename/second.dart "
- "=> dart:mirrors",
-};
-
-Future test(Map sourceFiles,
- {expectedPaths,
- bool verbose: false,
- bool enableExperimentalMirrors: false}) async {
- if (expectedPaths is! List) {
- expectedPaths = [expectedPaths];
- }
- var collector = new DiagnosticCollector();
- var options = [Flags.useOldFrontend];
- if (verbose) {
- options.add('--verbose');
- }
- if (enableExperimentalMirrors) {
- options.add('--enable-experimental-mirrors');
- }
- await runCompiler(
- entryPoint: Uri.parse('memory:/main.dart'),
- memorySourceFiles: sourceFiles,
- diagnosticHandler: collector,
- packageRoot: Uri.parse('memory:/pkg/'),
- options: options);
- Expect.equals(0, collector.errors.length, 'Errors: ${collector.errors}');
- if (enableExperimentalMirrors) {
- Expect.equals(
- 0, collector.warnings.length, 'Warnings: ${collector.errors}');
- } else {
- Expect.equals(
- 1, collector.warnings.length, 'Warnings: ${collector.errors}');
- Expect.equals(MessageKind.IMPORT_EXPERIMENTAL_MIRRORS,
- collector.warnings.first.message.kind);
- Expect.equals(
- expectedPaths.join(MessageTemplate.IMPORT_EXPERIMENTAL_MIRRORS_PADDING),
- collector.warnings.first.message.arguments['importChain']);
- }
-}
-
-Future checkPaths(Map sourceData) {
- Map sourceFiles = sourceData;
- var expectedPaths = sourceData['paths'];
- var expectedVerbosePaths = sourceData['verbosePaths'];
- if (expectedVerbosePaths == null) {
- expectedVerbosePaths = expectedPaths;
- }
- return test(sourceFiles, expectedPaths: expectedPaths).then((_) {
- return test(sourceFiles,
- expectedPaths: expectedVerbosePaths, verbose: true);
- }).then((_) {
- return test(sourceFiles, enableExperimentalMirrors: true);
- });
-}
-
-void main() {
- asyncTest(() => Future.forEach([
- DIRECT_IMPORT,
- INDIRECT_IMPORT1,
- INDIRECT_IMPORT2,
- INDIRECT_PACKAGE_IMPORT1,
- INDIRECT_PACKAGE_IMPORT2,
- INDIRECT_PACKAGE_IMPORT3,
- INDIRECT_PACKAGE_IMPORT4,
- DUAL_DIRECT_IMPORT,
- DUAL_INDIRECT_IMPORT1,
- DUAL_INDIRECT_IMPORT2,
- DUAL_INDIRECT_IMPORT3,
- DUAL_INDIRECT_PACKAGE_IMPORT1,
- DIRECT_EXPORT,
- INDIRECT_EXPORT1,
- INDIRECT_EXPORT2,
- INDIRECT_PACKAGE_EXPORT1,
- INDIRECT_PACKAGE_EXPORT2
- ], (map) => checkPaths(map)));
-}
diff --git a/tests/compiler/dart2js/mirrors/mirror_final_field_inferrer2_test.dart b/tests/compiler/dart2js/mirrors/mirror_final_field_inferrer2_test.dart
deleted file mode 100644
index 2126ac9..0000000
--- a/tests/compiler/dart2js/mirrors/mirror_final_field_inferrer2_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 final fields in @MirrorsUsed are still inferred.
-
-import 'package:expect/expect.dart';
-import "package:async_helper/async_helper.dart";
-import 'package:compiler/src/commandline_options.dart';
-import '../memory_compiler.dart' show runCompiler;
-import '../compiler_helper.dart' show findElement;
-import '../inference/type_mask_test_helper.dart';
-
-const MEMORY_SOURCE_FILES = const <String, String>{
- 'main.dart': """
-import 'dart:mirrors';
-
-const field = 42;
-
-main() {
- var mirror = reflect(field);
- mirror.invoke(null, null);
-}
-"""
-};
-
-void main() {
- asyncTest(() async {
- var result = await runCompiler(
- memorySourceFiles: MEMORY_SOURCE_FILES,
- options: [Flags.useOldFrontend]);
- var compiler = result.compiler;
- var element = findElement(compiler, 'field');
- var typesInferrer = compiler.globalInference.typesInferrerInternal;
- var closedWorld = typesInferrer.closedWorld;
- var commonMasks = closedWorld.commonMasks;
- Expect.equals(commonMasks.uint31Type,
- simplify(typesInferrer.getTypeOfMember(element), closedWorld), 'field');
- });
-}
diff --git a/tests/compiler/dart2js/mirrors/mirror_final_field_inferrer_test.dart b/tests/compiler/dart2js/mirrors/mirror_final_field_inferrer_test.dart
deleted file mode 100644
index 8583e11..0000000
--- a/tests/compiler/dart2js/mirrors/mirror_final_field_inferrer_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 final fields in @MirrorsUsed are still inferred.
-
-import 'package:expect/expect.dart';
-import "package:async_helper/async_helper.dart";
-import 'package:compiler/src/commandline_options.dart';
-import '../memory_compiler.dart' show runCompiler;
-import '../compiler_helper.dart' show findElement;
-import '../inference/type_mask_test_helper.dart';
-
-const MEMORY_SOURCE_FILES = const <String, String>{
- 'main.dart': """
-@MirrorsUsed(targets: 'field')
-import 'dart:mirrors';
-
-const field = 42;
-
-main() {
- return field;
-}
-"""
-};
-
-void main() {
- asyncTest(() async {
- var result = await runCompiler(
- memorySourceFiles: MEMORY_SOURCE_FILES,
- options: [Flags.useOldFrontend]);
- var compiler = result.compiler;
- var element = findElement(compiler, 'field');
- var typesInferrer = compiler.globalInference.typesInferrerInternal;
- var closedWorld = typesInferrer.closedWorld;
- var commonMasks = closedWorld.commonMasks;
- Expect.equals(commonMasks.uint31Type,
- simplify(typesInferrer.getTypeOfMember(element), closedWorld), 'field');
- });
-}
diff --git a/tests/compiler/dart2js/mirrors/mirror_private_name_inheritance_test.dart b/tests/compiler/dart2js/mirrors/mirror_private_name_inheritance_test.dart
deleted file mode 100644
index 830b3b7..0000000
--- a/tests/compiler/dart2js/mirrors/mirror_private_name_inheritance_test.dart
+++ /dev/null
@@ -1,55 +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 final fields in @MirrorsUsed are still inferred.
-
-import 'package:expect/expect.dart';
-import "package:async_helper/async_helper.dart";
-import 'package:compiler/src/commandline_options.dart';
-import '../memory_compiler.dart' show runCompiler;
-import '../compiler_helper.dart' show findElement;
-
-const MEMORY_SOURCE_FILES = const <String, String>{
- 'main.dart': """
-@MirrorsUsed(targets: 'Super')
-import 'dart:mirrors';
-import 'lib.dart';
-
-
-class Subclass extends Super {
- int _private;
-
- int magic() => _private++;
-}
-
-main() {
- var objects = [new Super(), new Subclass()];
- reflect(objects[0]); // Trigger mirror usage.
-}
-""",
- 'lib.dart': """
-class Super {
- int _private;
-
- int magic() => _private++;
-}
-"""
-};
-
-void main() {
- asyncTest(() async {
- var result = await runCompiler(
- memorySourceFiles: MEMORY_SOURCE_FILES,
- options: [Flags.useOldFrontend]);
- var compiler = result.compiler;
-
- dynamic superclass =
- findElement(compiler, 'Super', Uri.parse('memory:lib.dart'));
- dynamic subclass = findElement(compiler, 'Subclass');
- var oracle = compiler.backend.mirrorsData.isMemberAccessibleByReflection;
- print(superclass.lookupMember('_private'));
- Expect.isTrue(oracle(superclass.lookupMember('_private')));
- Expect.isFalse(oracle(subclass.lookupMember('_private')));
- });
-}
diff --git a/tests/compiler/dart2js/mirrors/mirror_tree_shaking_test.dart b/tests/compiler/dart2js/mirrors/mirror_tree_shaking_test.dart
deleted file mode 100644
index 0afce8b..0000000
--- a/tests/compiler/dart2js/mirrors/mirror_tree_shaking_test.dart
+++ /dev/null
@@ -1,59 +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 tree-shaking hasn't been turned off.
-
-import 'package:async_helper/async_helper.dart';
-import 'package:compiler/src/commandline_options.dart';
-import 'package:compiler/src/compiler.dart';
-import 'package:compiler/src/js_backend/js_backend.dart' show JavaScriptBackend;
-import 'package:compiler/src/js_backend/mirrors_analysis.dart';
-import 'package:expect/expect.dart';
-import '../memory_compiler.dart';
-
-main() {
- DiagnosticCollector collector = new DiagnosticCollector();
- asyncTest(() async {
- CompilationResult result = await runCompiler(
- memorySourceFiles: MEMORY_SOURCE_FILES,
- diagnosticHandler: collector,
- options: [Flags.useOldFrontend]);
- Compiler compiler = result.compiler;
- JavaScriptBackend backend = compiler.backend;
- Expect.isTrue(collector.errors.isEmpty);
- Expect.isTrue(collector.infos.isEmpty);
- Expect.isFalse(compiler.compilationFailed);
- MirrorsResolutionAnalysisImpl mirrorsResolutionAnalysis =
- backend.mirrorsResolutionAnalysis;
- Expect.isFalse(
- mirrorsResolutionAnalysis.handler.hasEnqueuedReflectiveElements);
- Expect.isFalse(
- mirrorsResolutionAnalysis.handler.hasEnqueuedReflectiveStaticFields);
- MirrorsCodegenAnalysisImpl mirrorsCodegenAnalysis =
- backend.mirrorsCodegenAnalysis;
- Expect
- .isFalse(mirrorsCodegenAnalysis.handler.hasEnqueuedReflectiveElements);
- Expect.isFalse(
- mirrorsCodegenAnalysis.handler.hasEnqueuedReflectiveStaticFields);
- Expect.isFalse(compiler.disableTypeInference);
- Expect.isFalse(backend.mirrorsData.hasRetainedMetadata);
- });
-}
-
-const Map MEMORY_SOURCE_FILES = const {
- 'main.dart': r"""
-import 'dart:mirrors';
-
-class Foo {
- noSuchMethod(invocation) {
- print('Invoked ${MirrorSystem.getName(invocation.memberName)}');
- return reflect('foobar').delegate(invocation);
- }
-}
-
-void main() {
- print(new Foo().substring(3));
-}
-""",
-};
diff --git a/tests/compiler/dart2js/mirrors/mirrors_used_test.dart b/tests/compiler/dart2js/mirrors/mirrors_used_test.dart
deleted file mode 100644
index 63c6915..0000000
--- a/tests/compiler/dart2js/mirrors/mirrors_used_test.dart
+++ /dev/null
@@ -1,219 +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 the @MirrorsUsed annotation suppress hints and that only
-/// requested elements are retained for reflection.
-library dart2js.test.mirrors_used_test;
-
-import 'package:compiler/src/js/js.dart' as jsAst;
-
-import 'package:expect/expect.dart';
-import "package:async_helper/async_helper.dart";
-
-import '../memory_compiler.dart' show runCompiler;
-
-import 'package:compiler/src/apiimpl.dart' show CompilerImpl;
-import 'package:compiler/src/commandline_options.dart';
-
-import 'package:compiler/src/constants/values.dart'
- show ConstantValue, TypeConstantValue;
-
-import 'package:compiler/src/elements/elements.dart'
- show ClassElement, Elements;
-
-import 'package:compiler/src/js_backend/js_backend.dart' show JavaScriptBackend;
-import 'package:compiler/src/js_backend/mirrors_analysis.dart';
-
-import 'package:compiler/src/js_emitter/full_emitter/emitter.dart' as full
- show Emitter;
-
-import 'package:compiler/src/old_to_new_api.dart'
- show LegacyCompilerDiagnostics;
-
-import 'package:compiler/src/universe/world_builder.dart';
-
-void expectOnlyVerboseInfo(Uri uri, int begin, int end, String message, kind) {
- if (kind.name == 'verbose info') {
- print(message);
- return;
- }
- if (message.contains('methods retained for use by dart:mirrors out of')) {
- print(message);
- return;
- }
- if (kind.name == 'info') return;
-
- // TODO(aprelev@gmail.com): Remove once dartbug.com/13907 is fixed.
- if (message.contains("Warning: 'typedef' not allowed here")) return;
-
- throw '$uri:$begin:$end: $kind: $message';
-}
-
-void main() {
- asyncTest(() async {
- var result = await runCompiler(
- memorySourceFiles: MEMORY_SOURCE_FILES,
- diagnosticHandler: new LegacyCompilerDiagnostics(expectOnlyVerboseInfo),
- options: ['--enable-experimental-mirrors', Flags.useOldFrontend]);
- CompilerImpl compiler = result.compiler;
- JavaScriptBackend backend = compiler.backend;
- print('');
- List generatedCode =
- Elements.sortedByPosition(new List.from(backend.generatedCode.keys));
- for (var element in generatedCode) {
- print(element);
- }
- print('');
-
- // This assertion can fail for two reasons:
- // 1. Too many elements retained for reflection.
- // 2. Some code was refactored, and there are more methods.
- // Either situation could be problematic, but in situation 2, it is often
- // acceptable to increase [expectedMethodCount] a little.
- int expectedMethodCount = 490;
- Expect.isTrue(
- generatedCode.length <= expectedMethodCount,
- 'Too many compiled methods: '
- '${generatedCode.length} > $expectedMethodCount');
-
- // The following names should be retained:
- List<jsAst.Name> expectedNames = [
- 'Foo', // The name of class Foo.
- r'Foo$', // The name of class Foo's constructor.
- r'get$field' // The (getter) name of Foo.field.
- ].map(backend.namer.asName).toList();
- // TODO(ahe): Check for the following names, currently they are not being
- // recorded correctly, but are being emitted.
- [
- 'Foo_staticMethod', // The name of Foo.staticMethod.
- r'instanceMethod$0' // The name of Foo.instanceMethod.
- ];
-
- // We always include the names of some native classes.
- List<ClassElement> nativeClasses = [
- compiler.resolution.commonElements.intClass,
- compiler.resolution.commonElements.doubleClass,
- compiler.resolution.commonElements.numClass,
- compiler.resolution.commonElements.stringClass,
- compiler.resolution.commonElements.boolClass,
- compiler.resolution.commonElements.nullClass,
- compiler.resolution.commonElements.listClass
- ];
- Iterable<jsAst.Name> nativeNames =
- nativeClasses.map((c) => backend.namer.className(c));
- expectedNames.addAll(nativeNames);
-
- // Mirrors only work in the full emitter. We can thus be certain that the
- // emitter is the full emitter.
- full.Emitter fullEmitter = backend.emitter.emitter;
- Set<jsAst.Name> recordedNames = new Set()
- ..addAll(fullEmitter.recordedMangledNames)
- ..addAll(fullEmitter.mangledFieldNames.keys)
- ..addAll(fullEmitter.mangledGlobalFieldNames.keys);
- Expect.setEquals(new Set.from(expectedNames), recordedNames);
-
- for (dynamic library in compiler.libraryLoader.libraries) {
- library.forEachLocalMember((member) {
- if (member.isClass) {
- if (library ==
- compiler.frontendStrategy.elementEnvironment.mainLibrary &&
- member.name == 'Foo') {
- Expect.isTrue(
- compiler.backend.mirrorsData
- .isClassAccessibleByReflection(member),
- '$member');
- member.forEachLocalMember((classMember) {
- Expect.isTrue(
- compiler.backend.mirrorsData
- .isMemberAccessibleByReflection(classMember),
- '$classMember');
- });
- } else {
- Expect.isFalse(
- compiler.backend.mirrorsData
- .isClassAccessibleByReflection(member),
- '$member');
- }
- } else if (member.isTypedef) {
- Expect.isFalse(
- compiler.backend.mirrorsData
- .isTypedefAccessibleByReflection(member),
- '$member');
- } else {
- Expect.isFalse(
- compiler.backend.mirrorsData
- .isMemberAccessibleByReflection(member),
- '$member');
- }
- });
- }
-
- int metadataCount = 0;
- CodegenWorldBuilderImpl codegenWorldBuilder = compiler.codegenWorldBuilder;
- Set<ConstantValue> compiledConstants =
- codegenWorldBuilder.compiledConstants;
- // Make sure that most of the metadata constants aren't included in the
- // generated code.
- MirrorsResolutionAnalysisImpl mirrorsResolutionAnalysis =
- backend.mirrorsResolutionAnalysis;
- mirrorsResolutionAnalysis.processMetadata(
- compiler.enqueuer.resolution.processedEntities, (metadata) {
- ConstantValue constant =
- backend.constants.getConstantValueForMetadata(metadata);
- Expect.isFalse(
- compiledConstants.contains(constant), constant.toStructuredText());
- metadataCount++;
- });
-
- // There should at least be one metadata constant:
- // 1. The constructed constant for 'MirrorsUsed'.
- Expect.isTrue(metadataCount >= 1);
-
- // The type literal 'Foo' is both used as metadata, and as a plain value in
- // the program. Make sure that it isn't duplicated.
- int fooConstantCount = 0;
- for (ConstantValue constant in compiledConstants) {
- if (constant is TypeConstantValue &&
- '${constant.representedType}' == 'Foo') {
- fooConstantCount++;
- }
- }
- Expect.equals(1, fooConstantCount,
- "The type literal 'Foo' is duplicated or missing.");
- });
-}
-
-const MEMORY_SOURCE_FILES = const <String, String>{
- 'main.dart': """
-// The repeated constant value for symbols and targets used to crash dart2js in
-// host-checked mode, and could potentially lead to other problems.
-@MirrorsUsed(symbols: 'Foo', targets: 'Foo', override: '*')
-import 'dart:mirrors';
-
-import 'library.dart';
-
-class Foo {
- int field;
- instanceMethod() {}
- static staticMethod() {}
-}
-
-unusedFunction() {
-}
-
-main() {
- useReflect(Foo);
-}
-""",
- 'library.dart': """
-library lib;
-
-import 'dart:mirrors';
-
-useReflect(type) {
- print(new Symbol('Foo'));
- print(MirrorSystem.getName(reflectClass(type).owner.qualifiedName));
-}
-""",
-};
diff --git a/tests/compiler/dart2js/mixin_typevariable_test.dart b/tests/compiler/dart2js/mixin_typevariable_test.dart
deleted file mode 100644
index b2bcd618..0000000
--- a/tests/compiler/dart2js/mixin_typevariable_test.dart
+++ /dev/null
@@ -1,214 +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.
-
-library mixin_typevariable_test;
-
-import 'package:expect/expect.dart';
-import "package:async_helper/async_helper.dart";
-import 'type_test_helper.dart';
-import 'package:compiler/src/elements/resolution_types.dart';
-import "package:compiler/src/elements/elements.dart" show ClassElement;
-
-void main() {
- testMixinSupertypes();
- testNonTrivialSubstitutions();
-}
-
-void testMixinSupertypes() {
- asyncTest(() => TypeEnvironment.create(r"""
- class S<S_T> {}
- class M1<M1_T> {}
- class M2<M2_T> {}
- class M3<M3_T> {}
-
- class C1<C1_T> extends S<C1_T> with M1<C1_T>, M2<C1_T>, M3<C1_T> {}
- class C2<C2_T> = S<C2_T> with M1<C2_T>, M2<C2_T>, M3<C2_T>;
- """, expectNoWarningsOrErrors: true).then((env) {
- ClassElement Object = env.getElement('Object');
- ClassElement S = env.getElement('S');
- ClassElement M1 = env.getElement('M1');
- ClassElement M2 = env.getElement('M2');
- ClassElement C1 = env.getElement('C1');
- ClassElement C2 = env.getElement('C2');
-
- ClassElement C1_S_M1_M2_M3 = C1.superclass;
- ClassElement C1_S_M1_M2 = C1_S_M1_M2_M3.superclass;
- ClassElement C1_S_M1 = C1_S_M1_M2.superclass;
-
- ClassElement C2_S_M1_M2 = C2.superclass;
- ClassElement C2_S_M1 = C2_S_M1_M2.superclass;
-
- void testSupertypes(ClassElement element) {
- if (element != Object) {
- Expect.isTrue(element.typeVariables.length == 1);
- Expect.equals(
- element, element.typeVariables.first.element.enclosingElement);
- }
- for (ResolutionInterfaceType supertype
- in element.allSupertypesAndSelf.types) {
- if (!supertype.typeArguments.isEmpty) {
- Expect.listEquals(element.typeVariables, supertype.typeArguments,
- "Type argument mismatch on supertype $supertype of $element.");
- } else {
- Expect.equals(Object, supertype.element);
- }
- }
- }
-
- testSupertypes(Object);
- testSupertypes(S);
- testSupertypes(M1);
- testSupertypes(M2);
- testSupertypes(C1_S_M1);
- testSupertypes(C1_S_M1_M2);
- testSupertypes(C1_S_M1_M2_M3);
- testSupertypes(C1);
- testSupertypes(C2_S_M1);
- testSupertypes(C2_S_M1_M2);
- testSupertypes(C2);
- }));
-}
-
-void testNonTrivialSubstitutions() {
- asyncTest(() => TypeEnvironment.create(r"""
- class _ {}
- class A<A_T> {}
- class B<B_T, B_S> {}
-
- class C1<C1_T> extends A with B {}
- class C2<C2_T> = A with B;
-
- class D1<D1_T> extends A<D1_T> with B<D1_T, A<D1_T>> {}
- class D2<D2_T> = A<D2_T> with B<D2_T, A<D2_T>>;
-
- class E1<E1_T> extends A<_> with B<_, A<_>> {}
- class E2<E2_T> = A<_> with B<_, A<_>>;
-
- class F1<F1_T> extends A<_> with B<_, B<F1_T, _>> {}
- class F2<F2_T> = A<_> with B<_, B<F2_T, _>>;
- """, expectNoWarningsOrErrors: true).then((env) {
- ResolutionDartType _dynamic = env['dynamic'];
- ResolutionDartType _ = env['_'];
-
- ClassElement Object = env.getElement('Object');
- ClassElement A = env.getElement('A');
- ClassElement B = env.getElement('B');
- ClassElement C1 = env.getElement('C1');
- ClassElement C2 = env.getElement('C2');
- ClassElement D1 = env.getElement('D1');
- ClassElement D2 = env.getElement('D2');
- ClassElement E1 = env.getElement('E1');
- ClassElement E2 = env.getElement('E2');
- ClassElement F1 = env.getElement('F1');
- ClassElement F2 = env.getElement('F2');
-
- void testSupertypes(ClassElement element,
- Map<ClassElement, List<ResolutionDartType>> typeArguments) {
- if (element != Object) {
- Expect.isTrue(element.typeVariables.length == 1);
- Expect.equals(
- element, element.typeVariables.first.element.enclosingElement);
- }
- for (ResolutionInterfaceType supertype
- in element.allSupertypesAndSelf.types) {
- if (typeArguments.containsKey(supertype.element)) {
- Expect.listEquals(
- typeArguments[supertype.element],
- supertype.typeArguments,
- "Type argument mismatch on supertype $supertype of $element.");
- } else if (!supertype.typeArguments.isEmpty) {
- Expect.listEquals(element.typeVariables, supertype.typeArguments,
- "Type argument mismatch on supertype $supertype of $element.");
- } else {
- Expect.equals(Object, supertype.element);
- }
- }
- }
-
- testSupertypes(C1, {
- A: [_dynamic],
- B: [_dynamic, _dynamic]
- });
- testSupertypes(C1.superclass, {
- A: [_dynamic],
- B: [_dynamic, _dynamic]
- });
- testSupertypes(C2, {
- A: [_dynamic],
- B: [_dynamic, _dynamic]
- });
-
- ResolutionDartType D1_T = D1.typeVariables.first;
- testSupertypes(D1, {
- A: [D1_T],
- B: [
- D1_T,
- instantiate(A, [D1_T])
- ]
- });
- ResolutionDartType D1_superclass_T = D1.superclass.typeVariables.first;
- testSupertypes(D1.superclass, {
- A: [D1_superclass_T],
- B: [
- D1_superclass_T,
- instantiate(A, [D1_superclass_T])
- ]
- });
- ResolutionDartType D2_T = D2.typeVariables.first;
- testSupertypes(D2, {
- A: [D2_T],
- B: [
- D2_T,
- instantiate(A, [D2_T])
- ]
- });
-
- testSupertypes(E1, {
- A: [_],
- B: [
- _,
- instantiate(A, [_])
- ]
- });
- testSupertypes(E1.superclass, {
- A: [_],
- B: [
- _,
- instantiate(A, [_])
- ]
- });
- testSupertypes(E2, {
- A: [_],
- B: [
- _,
- instantiate(A, [_])
- ]
- });
-
- ResolutionDartType F1_T = F1.typeVariables.first;
- testSupertypes(F1, {
- A: [_],
- B: [
- _,
- instantiate(B, [F1_T, _])
- ]
- });
- ResolutionDartType F1_superclass_T = F1.superclass.typeVariables.first;
- testSupertypes(F1.superclass, {
- A: [_],
- B: [
- _,
- instantiate(B, [F1_superclass_T, _])
- ]
- });
- ResolutionDartType F2_T = F2.typeVariables.first;
- testSupertypes(F2, {
- A: [_],
- B: [
- _,
- instantiate(B, [F2_T, _])
- ]
- });
- }));
-}
diff --git a/tests/compiler/dart2js/model/class_set_test.dart b/tests/compiler/dart2js/model/class_set_test.dart
index f2d7b83..a8216b1 100644
--- a/tests/compiler/dart2js/model/class_set_test.dart
+++ b/tests/compiler/dart2js/model/class_set_test.dart
@@ -18,22 +18,20 @@
void main() {
asyncTest(() async {
- print('--test from ast---------------------------------------------------');
- await testAll(CompileMode.memory);
print('--test from kernel------------------------------------------------');
- await testAll(CompileMode.kernel);
+ await testAll();
print('--test from kernel (strong)---------------------------------------');
- await testAll(CompileMode.kernel, strongMode: true);
+ await testAll(strongMode: true);
});
}
-testAll(CompileMode compileMode, {bool strongMode: false}) async {
- await testIterators(compileMode);
- await testForEach(compileMode);
- await testClosures(compileMode, strongMode);
+testAll({bool strongMode: false}) async {
+ await testIterators();
+ await testForEach();
+ await testClosures(strongMode: strongMode);
}
-testIterators(CompileMode compileMode) async {
+testIterators() async {
var env = await TypeEnvironment.create(r"""
/// A
/// / \
@@ -57,7 +55,7 @@
new F();
new G();
}
- """, compileMode: compileMode);
+ """);
ClosedWorld world = env.closedWorld;
ClassEntity A = env.getClass("A");
@@ -356,7 +354,7 @@
Expect.isNull(iterator.current);
}
-testForEach(CompileMode compileMode) async {
+testForEach() async {
var env = await TypeEnvironment.create(r"""
/// A
/// / \
@@ -387,7 +385,7 @@
new H();
new I();
}
- """, compileMode: compileMode);
+ """);
ClosedWorld world = env.closedWorld;
ClassEntity A = env.getClass("A");
@@ -590,7 +588,7 @@
find: I, anySubtype: true, expectedResult: true);
}
-testClosures(CompileMode compileMode, bool strongMode) async {
+testClosures({bool strongMode}) async {
var env = await TypeEnvironment.create(r"""
class A {
call() => null;
@@ -603,7 +601,6 @@
local() {}
}
""",
- compileMode: compileMode,
options: strongMode ? [Flags.strongMode] : [],
testBackendWorld: true);
ClosedWorld world = env.closedWorld;
diff --git a/tests/compiler/dart2js/model/const_exp_test.dart b/tests/compiler/dart2js/model/const_exp_test.dart
deleted file mode 100644
index a8b93f0..0000000
--- a/tests/compiler/dart2js/model/const_exp_test.dart
+++ /dev/null
@@ -1,109 +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:async';
-import 'package:async_helper/async_helper.dart';
-import 'package:expect/expect.dart';
-import '../type_test_helper.dart';
-
-test(String constantInitializer, [String expectedOutput]) {
- if (expectedOutput == null) {
- expectedOutput = constantInitializer;
- }
- return () => TypeEnvironment.create("""
- class Class<T, S> {
- final a;
- final b;
- final c;
- const Class(this.a, {this.b, this.c: true});
- const Class.named([this.a, this.b = 0, this.c = 2]);
-
- static const staticConstant = 0;
- static staticFunction() {}
- }
- const t = true;
- const f = false;
- const toplevelConstant = 0;
- toplevelFunction() {}
- const constant = $constantInitializer;
-""", expectNoWarningsOrErrors: true).then((env) {
- dynamic element = env.getElement('constant');
- Expect.isNotNull(element, "Element 'constant' not found.");
-
- /// ignore: undefined_getter
- var constant = element.constant;
- var value = env.compiler.constants.getConstantValue(constant);
- Expect.isNotNull(constant, "No constant computed for '$element'.");
- Expect.equals(
- expectedOutput,
- constant.toDartText(),
- "Unexpected to string '${constant.toDartText()}' for constant "
- "'$constantInitializer' of value "
- "${value.toStructuredText()}");
- });
-}
-
-void main() {
- asyncTest(() => Future.forEach([
- test('null'),
- test('0'),
- test('1.5'),
- test('true'),
- test('false'),
- test('"f"'),
- test('"a" "b"', '"ab"'),
- test('const []'),
- test('const <int>[0, 1]'),
- test('const <dynamic>[0, 1]', 'const [0, 1]'),
- test('const {}'),
- test('const {0: 1, 2: 3}'),
- test('const <String, int>{"0": 1, "2": 3}'),
- test('const <String, dynamic>{"0": 1, "2": 3}'),
- test('const <dynamic, dynamic>{"0": 1, "2": 3}',
- 'const {"0": 1, "2": 3}'),
- test('const Class(0)'),
- test('const Class(0, b: 1)'),
- test('const Class(0, c: 2)'),
- test('const Class(0, b: 3, c: 4)'),
- test('const Class.named()'),
- test('const Class.named(0)'),
- test('const Class.named(0, 1)'),
- test('const Class.named(0, 1, 2)'),
- test('const Class<String, int>(0)'),
- test('const Class<String, dynamic>(0)'),
- test('const Class<dynamic, String>(0)'),
- test('const Class<dynamic, dynamic>(0)', 'const Class(0)'),
- test('toplevelConstant'),
- test('toplevelFunction'),
- test('Class.staticConstant'),
- test('Class.staticFunction'),
- test('#a'),
- test('1 + 2'),
- test('1 + 2 + 3'),
- test('1 + -2'),
- test('-1 + 2'),
- test('(1 + 2) + 3', '1 + 2 + 3'),
- test('1 + (2 + 3)', '1 + 2 + 3'),
- test('1 * 2'),
- test('1 * 2 + 3'),
- test('1 * (2 + 3)'),
- test('1 + 2 * 3'),
- test('(1 + 2) * 3'),
- test('false || identical(0, 1)'),
- test('!identical(0, 1)'),
- test('!identical(0, 1) || false'),
- test('!(identical(0, 1) || false)'),
- test('identical(0, 1) ? 3 * 4 + 5 : 6 + 7 * 8'),
- test('t ? f ? 0 : 1 : 2'),
- test('(t ? t : f) ? f ? 0 : 1 : 2'),
- test('t ? t : f ? f ? 0 : 1 : 2'),
- test('t ? t ? t : t : t ? t : t'),
- test('t ? (t ? t : t) : (t ? t : t)', 't ? t ? t : t : t ? t : t'),
- test(
- 'const [const <dynamic, dynamic>{0: true, "1": "c" "d"}, '
- 'const Class(const Class<dynamic, dynamic>(toplevelConstant))]',
- 'const [const {0: true, "1": "cd"}, '
- 'const Class(const Class(toplevelConstant))]'),
- ], (f) => f()));
-}
diff --git a/tests/compiler/dart2js/model/constant_expression_test.dart b/tests/compiler/dart2js/model/constant_expression_test.dart
index efe465e..ae5ec8a 100644
--- a/tests/compiler/dart2js/model/constant_expression_test.dart
+++ b/tests/compiler/dart2js/model/constant_expression_test.dart
@@ -55,7 +55,22 @@
}
const List<TestData> DATA = const [
- const TestData('', const [
+ const TestData('''
+class Class<T, S> {
+ final a;
+ final b;
+ final c;
+ const Class(this.a, {this.b, this.c: true});
+ const Class.named([this.a, this.b = 0, this.c = 2]);
+
+ static const staticConstant = 0;
+ static staticFunction() {}
+}
+const t = true;
+const f = false;
+const toplevelConstant = 0;
+toplevelFunction() {}
+''', const [
const ConstantData('null', ConstantExpressionKind.NULL),
const ConstantData('false', ConstantExpressionKind.BOOL),
const ConstantData('true', ConstantExpressionKind.BOOL),
@@ -78,13 +93,24 @@
const ConstantData('proxy', ConstantExpressionKind.FIELD),
const ConstantData('Object', ConstantExpressionKind.TYPE),
const ConstantData('#name', ConstantExpressionKind.SYMBOL),
+ const ConstantData('const []', ConstantExpressionKind.LIST),
const ConstantData('const [0, 1]', ConstantExpressionKind.LIST,
strongText: 'const <int>[0, 1]'),
const ConstantData('const <int>[0, 1]', ConstantExpressionKind.LIST),
+ const ConstantData('const <dynamic>[0, 1]', ConstantExpressionKind.LIST,
+ text: 'const [0, 1]'),
+ const ConstantData('const {}', ConstantExpressionKind.MAP),
const ConstantData('const {0: 1, 2: 3}', ConstantExpressionKind.MAP,
strongText: 'const <int, int>{0: 1, 2: 3}'),
const ConstantData(
'const <int, int>{0: 1, 2: 3}', ConstantExpressionKind.MAP),
+ const ConstantData(
+ 'const <String, int>{"0": 1, "2": 3}', ConstantExpressionKind.MAP),
+ const ConstantData(
+ 'const <String, dynamic>{"0": 1, "2": 3}', ConstantExpressionKind.MAP),
+ const ConstantData(
+ 'const <dynamic, dynamic>{"0": 1, "2": 3}', ConstantExpressionKind.MAP,
+ text: 'const {"0": 1, "2": 3}'),
const ConstantData('const bool.fromEnvironment("foo", defaultValue: false)',
ConstantExpressionKind.BOOL_FROM_ENVIRONMENT),
const ConstantData('const int.fromEnvironment("foo", defaultValue: 42)',
@@ -92,6 +118,74 @@
const ConstantData(
'const String.fromEnvironment("foo", defaultValue: "bar")',
ConstantExpressionKind.STRING_FROM_ENVIRONMENT),
+ const ConstantData('const Class(0)', ConstantExpressionKind.CONSTRUCTED),
+ const ConstantData(
+ 'const Class(0, b: 1)', ConstantExpressionKind.CONSTRUCTED),
+ const ConstantData(
+ 'const Class(0, c: 2)', ConstantExpressionKind.CONSTRUCTED),
+ const ConstantData(
+ 'const Class(0, b: 3, c: 4)', ConstantExpressionKind.CONSTRUCTED),
+ const ConstantData(
+ 'const Class.named()', ConstantExpressionKind.CONSTRUCTED),
+ const ConstantData(
+ 'const Class.named(0)', ConstantExpressionKind.CONSTRUCTED),
+ const ConstantData(
+ 'const Class.named(0, 1)', ConstantExpressionKind.CONSTRUCTED),
+ const ConstantData(
+ 'const Class.named(0, 1, 2)', ConstantExpressionKind.CONSTRUCTED),
+ const ConstantData(
+ 'const Class<String, int>(0)', ConstantExpressionKind.CONSTRUCTED),
+ const ConstantData(
+ 'const Class<String, dynamic>(0)', ConstantExpressionKind.CONSTRUCTED),
+ const ConstantData(
+ 'const Class<dynamic, String>(0)', ConstantExpressionKind.CONSTRUCTED),
+ const ConstantData(
+ 'const Class<dynamic, dynamic>(0)', ConstantExpressionKind.CONSTRUCTED,
+ text: 'const Class(0)'),
+ const ConstantData('toplevelConstant', ConstantExpressionKind.FIELD),
+ const ConstantData('toplevelFunction', ConstantExpressionKind.FUNCTION),
+ const ConstantData('Class.staticConstant', ConstantExpressionKind.FIELD),
+ const ConstantData('Class.staticFunction', ConstantExpressionKind.FUNCTION),
+ const ConstantData('1 + 2', ConstantExpressionKind.BINARY),
+ const ConstantData('1 + 2 + 3', ConstantExpressionKind.BINARY),
+ const ConstantData('1 + -2', ConstantExpressionKind.BINARY),
+ const ConstantData('-1 + 2', ConstantExpressionKind.BINARY),
+ const ConstantData('(1 + 2) + 3', ConstantExpressionKind.BINARY,
+ text: '1 + 2 + 3'),
+ const ConstantData('1 + (2 + 3)', ConstantExpressionKind.BINARY,
+ text: '1 + 2 + 3'),
+ const ConstantData('1 * 2', ConstantExpressionKind.BINARY),
+ const ConstantData('1 * 2 + 3', ConstantExpressionKind.BINARY),
+ const ConstantData('1 * (2 + 3)', ConstantExpressionKind.BINARY),
+ const ConstantData('1 + 2 * 3', ConstantExpressionKind.BINARY),
+ const ConstantData('(1 + 2) * 3', ConstantExpressionKind.BINARY),
+ const ConstantData(
+ 'false || identical(0, 1)', ConstantExpressionKind.BINARY),
+ const ConstantData('!identical(0, 1)', ConstantExpressionKind.UNARY),
+ const ConstantData(
+ '!identical(0, 1) || false', ConstantExpressionKind.BINARY),
+ const ConstantData(
+ '!(identical(0, 1) || false)', ConstantExpressionKind.UNARY),
+ const ConstantData('identical(0, 1) ? 3 * 4 + 5 : 6 + 7 * 8',
+ ConstantExpressionKind.CONDITIONAL),
+ const ConstantData('t ? f ? 0 : 1 : 2', ConstantExpressionKind.CONDITIONAL),
+ const ConstantData(
+ '(t ? t : f) ? f ? 0 : 1 : 2', ConstantExpressionKind.CONDITIONAL),
+ const ConstantData(
+ 't ? t : f ? f ? 0 : 1 : 2', ConstantExpressionKind.CONDITIONAL),
+ const ConstantData(
+ 't ? t ? t : t : t ? t : t', ConstantExpressionKind.CONDITIONAL),
+ const ConstantData(
+ 't ? (t ? t : t) : (t ? t : t)', ConstantExpressionKind.CONDITIONAL,
+ text: 't ? t ? t : t : t ? t : t'),
+ const ConstantData(
+ 'const [const <dynamic, dynamic>{0: true, "1": "c" "d"}, '
+ 'const Class(const Class<dynamic, dynamic>(toplevelConstant))]',
+ ConstantExpressionKind.LIST,
+ text: 'const [const {0: true, "1": "cd"}, '
+ 'const Class(const Class(toplevelConstant))]',
+ strongText: 'const <Object>[const {0: true, "1": "cd"}, '
+ 'const Class(const Class(toplevelConstant))]'),
]),
const TestData('''
class A {
diff --git a/tests/compiler/dart2js/model/constant_value_test.dart b/tests/compiler/dart2js/model/constant_value_test.dart
index 2e44dba..5d0aa37 100644
--- a/tests/compiler/dart2js/model/constant_value_test.dart
+++ b/tests/compiler/dart2js/model/constant_value_test.dart
@@ -7,7 +7,8 @@
import 'package:async_helper/async_helper.dart';
import 'package:expect/expect.dart';
import 'package:compiler/src/helpers/helpers.dart';
-import 'package:compiler/src/elements/elements.dart';
+import 'package:compiler/src/elements/entities.dart';
+import 'package:compiler/src/elements/types.dart';
import 'package:compiler/src/constants/values.dart';
import '../type_test_helper.dart';
@@ -23,14 +24,15 @@
C(this.field1, this.field2);
}
''');
- ClassElement C = env.getElement('C');
- FieldElement field1 = C.lookupLocalMember('field1');
- FieldElement field2 = C.lookupLocalMember('field2');
- ConstantValue value1 = new ConstructedConstantValue(C.rawType, {
+ ClassEntity C = env.getClass('C');
+ InterfaceType C_raw = env.elementEnvironment.getRawType(C);
+ FieldEntity field1 = env.elementEnvironment.lookupClassMember(C, 'field1');
+ FieldEntity field2 = env.elementEnvironment.lookupClassMember(C, 'field2');
+ ConstructedConstantValue value1 = new ConstructedConstantValue(C_raw, {
field1: new IntConstantValue(0),
field2: new IntConstantValue(1),
});
- ConstantValue value2 = new ConstructedConstantValue(C.rawType, {
+ ConstantValue value2 = new ConstructedConstantValue(C_raw, {
field2: new IntConstantValue(1),
field1: new IntConstantValue(0),
});
diff --git a/tests/compiler/dart2js/model/future_or_test.dart b/tests/compiler/dart2js/model/future_or_test.dart
index e1598ee..4da2f32 100644
--- a/tests/compiler/dart2js/model/future_or_test.dart
+++ b/tests/compiler/dart2js/model/future_or_test.dart
@@ -11,8 +11,7 @@
main() {
asyncTest(() async {
- var env = await TypeEnvironment.create(
- '''
+ var env = await TypeEnvironment.create('''
Future<num> futureNum() async => null;
FutureOr<num> futureOrNum() async => null;
@@ -34,9 +33,7 @@
Future<T> futureT() async => null;
FutureOr<T> futureOrT() async => null;
}
-''',
- compileMode: CompileMode.kernel,
- options: [Flags.strongMode]);
+''', options: [Flags.strongMode]);
FunctionType getFunctionType(String name, String expectedType,
[ClassEntity cls]) {
FunctionType type = env.getMemberType(name, cls);
diff --git a/tests/compiler/dart2js/model/mixin_typevariable_test.dart b/tests/compiler/dart2js/model/mixin_typevariable_test.dart
new file mode 100644
index 0000000..ff9a9ec
--- /dev/null
+++ b/tests/compiler/dart2js/model/mixin_typevariable_test.dart
@@ -0,0 +1,237 @@
+// 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.
+
+library mixin_typevariable_test;
+
+import 'package:async_helper/async_helper.dart';
+import 'package:compiler/src/elements/entities.dart';
+import 'package:compiler/src/elements/types.dart';
+import 'package:expect/expect.dart';
+import '../type_test_helper.dart';
+
+void main() {
+ asyncTest(() async {
+ await testMixinSupertypes();
+ await testNonTrivialSubstitutions();
+ });
+}
+
+testMixinSupertypes() async {
+ var env = await TypeEnvironment.create(r"""
+ class S<S_T> {}
+ class M1<M1_T> {}
+ class M2<M2_T> {}
+ class M3<M3_T> {}
+
+ class C1<C1_T> extends S<C1_T> with M1<C1_T>, M2<C1_T>, M3<C1_T> {}
+ class C2<C2_T> = S<C2_T> with M1<C2_T>, M2<C2_T>, M3<C2_T>;
+ """, expectNoWarningsOrErrors: true);
+ ClassEntity Object = env.getElement('Object');
+ ClassEntity S = env.getClass('S');
+ ClassEntity M1 = env.getClass('M1');
+ ClassEntity M2 = env.getClass('M2');
+ ClassEntity C1 = env.getClass('C1');
+ ClassEntity C2 = env.getClass('C2');
+
+ ClassEntity C1_S_M1_M2_M3 = env.elementEnvironment.getSuperClass(C1);
+ ClassEntity C1_S_M1_M2 = env.elementEnvironment.getSuperClass(C1_S_M1_M2_M3);
+ ClassEntity C1_S_M1 = env.elementEnvironment.getSuperClass(C1_S_M1_M2);
+
+ ClassEntity C2_S_M1_M2 = env.elementEnvironment.getSuperClass(C2);
+ ClassEntity C2_S_M1 = env.elementEnvironment.getSuperClass(C2_S_M1_M2);
+
+ void testSupertypes(ClassEntity element) {
+ List<DartType> typeVariables = const <DartType>[];
+ if (element != Object) {
+ typeVariables = env.elementEnvironment.getThisType(element).typeArguments;
+ Expect.isTrue(typeVariables.length == 1);
+ TypeVariableType typeVariable = typeVariables.first;
+ Expect.equals(element, typeVariable.element.typeDeclaration);
+ }
+ env.elementEnvironment.forEachSupertype(element, (InterfaceType supertype) {
+ if (!supertype.typeArguments.isEmpty) {
+ Expect.listEquals(typeVariables, supertype.typeArguments,
+ "Type argument mismatch on supertype $supertype of $element.");
+ } else {
+ Expect.equals(Object, supertype.element);
+ }
+ });
+ }
+
+ testSupertypes(Object);
+ testSupertypes(S);
+ testSupertypes(M1);
+ testSupertypes(M2);
+ testSupertypes(C1_S_M1);
+ testSupertypes(C1_S_M1_M2);
+ testSupertypes(C1_S_M1_M2_M3);
+ testSupertypes(C1);
+ testSupertypes(C2_S_M1);
+ testSupertypes(C2_S_M1_M2);
+ testSupertypes(C2);
+}
+
+testNonTrivialSubstitutions() async {
+ var env = await TypeEnvironment.create(r"""
+ class _ {}
+ class A<A_T> {}
+ class B<B_T, B_S> {}
+
+ class C1<C1_T> extends A with B {}
+ class C2<C2_T> = A with B;
+
+ class D1<D1_T> extends A<D1_T> with B<D1_T, A<D1_T>> {}
+ class D2<D2_T> = A<D2_T> with B<D2_T, A<D2_T>>;
+
+ class E1<E1_T> extends A<_> with B<_, A<_>> {}
+ class E2<E2_T> = A<_> with B<_, A<_>>;
+
+ class F1<F1_T> extends A<_> with B<_, B<F1_T, _>> {}
+ class F2<F2_T> = A<_> with B<_, B<F2_T, _>>;
+ """, expectNoWarningsOrErrors: true);
+ DartType _dynamic = env['dynamic'];
+ DartType _ = env['_'];
+
+ ClassEntity Object = env.getElement('Object');
+ ClassEntity A = env.getClass('A');
+ ClassEntity B = env.getClass('B');
+ ClassEntity C1 = env.getClass('C1');
+ ClassEntity C2 = env.getClass('C2');
+ ClassEntity D1 = env.getClass('D1');
+ ClassEntity D2 = env.getClass('D2');
+ ClassEntity E1 = env.getClass('E1');
+ ClassEntity E2 = env.getClass('E2');
+ ClassEntity F1 = env.getClass('F1');
+ ClassEntity F2 = env.getClass('F2');
+
+ void testSupertypes(
+ ClassEntity element, Map<ClassEntity, List<DartType>> typeArguments) {
+ List<DartType> typeVariables = const <DartType>[];
+ if (element != Object) {
+ typeVariables = env.elementEnvironment.getThisType(element).typeArguments;
+ if (env.elementEnvironment.isUnnamedMixinApplication(element)) {
+ // Kernel doesn't add type variables to unnamed mixin applications when
+ // these aren't need for its supertypes.
+ Expect.isTrue(typeVariables.length <= 1);
+ } else {
+ Expect.isTrue(typeVariables.length == 1);
+ }
+ if (typeVariables.isNotEmpty) {
+ TypeVariableType typeVariable = typeVariables.first;
+ Expect.equals(element, typeVariable.element.typeDeclaration);
+ }
+ }
+ env.elementEnvironment.forEachSupertype(element, (InterfaceType supertype) {
+ if (typeArguments.containsKey(supertype.element)) {
+ Expect.listEquals(
+ typeArguments[supertype.element],
+ supertype.typeArguments,
+ "Type argument mismatch on supertype $supertype of $element.");
+ } else if (!supertype.typeArguments.isEmpty) {
+ Expect.listEquals(typeVariables, supertype.typeArguments,
+ "Type argument mismatch on supertype $supertype of $element.");
+ } else if (env.elementEnvironment
+ .isUnnamedMixinApplication(supertype.element)) {
+ // Kernel doesn't add type variables to unnamed mixin applications when
+ // these aren't need for its supertypes.
+ Expect.isTrue(supertype.typeArguments.isEmpty,
+ "Type argument mismatch on supertype $supertype of $element.");
+ } else {
+ Expect.equals(Object, supertype.element,
+ "Type argument mismatch on supertype $supertype of $element.");
+ }
+ });
+ }
+
+ testSupertypes(C1, {
+ A: [_dynamic],
+ B: [_dynamic, _dynamic]
+ });
+ testSupertypes(env.elementEnvironment.getSuperClass(C1), {
+ A: [_dynamic],
+ B: [_dynamic, _dynamic]
+ });
+ testSupertypes(C2, {
+ A: [_dynamic],
+ B: [_dynamic, _dynamic]
+ });
+
+ DartType D1_T = env.elementEnvironment.getThisType(D1).typeArguments.first;
+ testSupertypes(D1, {
+ A: [D1_T],
+ B: [
+ D1_T,
+ instantiate(A, [D1_T])
+ ]
+ });
+ DartType D1_superclass_T = env.elementEnvironment
+ .getThisType(env.elementEnvironment.getSuperClass(D1))
+ .typeArguments
+ .first;
+ testSupertypes(env.elementEnvironment.getSuperClass(D1), {
+ A: [D1_superclass_T],
+ B: [
+ D1_superclass_T,
+ instantiate(A, [D1_superclass_T])
+ ]
+ });
+ DartType D2_T = env.elementEnvironment.getThisType(D2).typeArguments.first;
+ testSupertypes(D2, {
+ A: [D2_T],
+ B: [
+ D2_T,
+ instantiate(A, [D2_T])
+ ]
+ });
+
+ testSupertypes(E1, {
+ A: [_],
+ B: [
+ _,
+ instantiate(A, [_])
+ ]
+ });
+ testSupertypes(env.elementEnvironment.getSuperClass(E1), {
+ A: [_],
+ B: [
+ _,
+ instantiate(A, [_])
+ ]
+ });
+ testSupertypes(E2, {
+ A: [_],
+ B: [
+ _,
+ instantiate(A, [_])
+ ]
+ });
+
+ DartType F1_T = env.elementEnvironment.getThisType(F1).typeArguments.first;
+ testSupertypes(F1, {
+ A: [_],
+ B: [
+ _,
+ instantiate(B, [F1_T, _])
+ ]
+ });
+ DartType F1_superclass_T = env.elementEnvironment
+ .getThisType(env.elementEnvironment.getSuperClass(F1))
+ .typeArguments
+ .first;
+ testSupertypes(env.elementEnvironment.getSuperClass(F1), {
+ A: [_],
+ B: [
+ _,
+ instantiate(B, [F1_superclass_T, _])
+ ]
+ });
+ DartType F2_T = env.elementEnvironment.getThisType(F2).typeArguments.first;
+ testSupertypes(F2, {
+ A: [_],
+ B: [
+ _,
+ instantiate(B, [F2_T, _])
+ ]
+ });
+}
diff --git a/tests/compiler/dart2js/model/subtype_test.dart b/tests/compiler/dart2js/model/subtype_test.dart
index 48445e3..63eaa41 100644
--- a/tests/compiler/dart2js/model/subtype_test.dart
+++ b/tests/compiler/dart2js/model/subtype_test.dart
@@ -15,26 +15,24 @@
void main() {
asyncTest(() async {
- print('--test from ast---------------------------------------------------');
- await runTests(CompileMode.memory);
print('--test from kernel------------------------------------------------');
- await runTests(CompileMode.kernel);
+ await runTests();
print('--test from kernel (strong)---------------------------------------');
- await runTests(CompileMode.kernel, strongMode: true);
+ await runTests(strongMode: true);
});
}
-Future runTests(CompileMode compileMode, {bool strongMode: false}) async {
- await testCallableSubtype(compileMode, strongMode);
- await testInterfaceSubtype(compileMode, strongMode);
- await testFunctionSubtyping(compileMode, strongMode);
- await testTypedefSubtyping(compileMode, strongMode);
- await testFunctionSubtypingOptional(compileMode, strongMode);
- await testTypedefSubtypingOptional(compileMode, strongMode);
- await testFunctionSubtypingNamed(compileMode, strongMode);
- await testTypedefSubtypingNamed(compileMode, strongMode);
- await testTypeVariableSubtype(compileMode, strongMode);
- await testStrongModeSubtyping(compileMode, strongMode);
+Future runTests({bool strongMode: false}) async {
+ await testCallableSubtype(strongMode: strongMode);
+ await testInterfaceSubtype(strongMode: strongMode);
+ await testFunctionSubtyping(strongMode: strongMode);
+ await testTypedefSubtyping(strongMode: strongMode);
+ await testFunctionSubtypingOptional(strongMode: strongMode);
+ await testTypedefSubtypingOptional(strongMode: strongMode);
+ await testFunctionSubtypingNamed(strongMode: strongMode);
+ await testTypedefSubtypingNamed(strongMode: strongMode);
+ await testTypeVariableSubtype(strongMode: strongMode);
+ await testStrongModeSubtyping(strongMode: strongMode);
}
void testTypes(TypeEnvironment env, DartType subtype, DartType supertype,
@@ -59,16 +57,14 @@
testTypes(env, subtype, supertype, expectSubtype, expectMoreSpecific);
}
-Future testInterfaceSubtype(CompileMode compileMode, bool strongMode) async {
+Future testInterfaceSubtype({bool strongMode}) async {
await TypeEnvironment.create(r"""
class A<T> {}
class B<T1, T2> extends A<T1> {}
// TODO(johnniwinther): Inheritance with different type arguments is
// currently not supported by the implementation.
class C<T1, T2> extends B<T2, T1> /*implements A<A<T1>>*/ {}
- """,
- compileMode: compileMode,
- options: strongMode ? [Flags.strongMode] : []).then((env) {
+ """, options: strongMode ? [Flags.strongMode] : []).then((env) {
void expect(bool expectSubtype, DartType T, DartType S,
{bool expectMoreSpecific}) {
testTypes(env, T, S, expectSubtype, expectMoreSpecific);
@@ -306,7 +302,7 @@
});
}
-Future testCallableSubtype(CompileMode compileMode, bool strongMode) async {
+Future testCallableSubtype({bool strongMode}) async {
await TypeEnvironment.create(r"""
class U {}
class V extends U {}
@@ -320,9 +316,7 @@
int m4(V v, U u) => null;
void m5(V v, int i) => null;
}
- """,
- compileMode: compileMode,
- options: strongMode ? [Flags.strongMode] : []).then((env) {
+ """, options: strongMode ? [Flags.strongMode] : []).then((env) {
void expect(bool expectSubtype, DartType T, DartType S,
{bool expectMoreSpecific}) {
testTypes(env, T, S, expectSubtype, expectMoreSpecific);
@@ -369,18 +363,16 @@
'void', 'inline_void__int', '(void Function(int i) f)'),
];
-Future testFunctionSubtyping(CompileMode compileMode, bool strongMode) async {
+Future testFunctionSubtyping({bool strongMode}) async {
await TypeEnvironment
.create(createMethods(functionTypesData),
- compileMode: compileMode,
options: strongMode ? [Flags.strongMode] : [])
.then(functionSubtypingHelper);
}
-Future testTypedefSubtyping(CompileMode compileMode, bool strongMode) async {
+Future testTypedefSubtyping({bool strongMode}) async {
await TypeEnvironment
.create(createTypedefs(functionTypesData),
- compileMode: compileMode,
options: strongMode ? [Flags.strongMode] : [])
.then(functionSubtypingHelper);
}
@@ -457,20 +449,16 @@
const FunctionTypeData('void', 'void___Object_int', '([Object o, int i])'),
];
-Future testFunctionSubtypingOptional(
- CompileMode compileMode, bool strongMode) async {
+Future testFunctionSubtypingOptional({bool strongMode}) async {
await TypeEnvironment
.create(createMethods(optionalFunctionTypesData),
- compileMode: compileMode,
options: strongMode ? [Flags.strongMode] : [])
.then((env) => functionSubtypingOptionalHelper(env, strongMode));
}
-Future testTypedefSubtypingOptional(
- CompileMode compileMode, bool strongMode) async {
+Future testTypedefSubtypingOptional({bool strongMode}) async {
await TypeEnvironment
.create(createTypedefs(optionalFunctionTypesData),
- compileMode: compileMode,
options: strongMode ? [Flags.strongMode] : [])
.then((env) => functionSubtypingOptionalHelper(env, strongMode));
}
@@ -535,20 +523,16 @@
const FunctionTypeData('void', 'void___c_int', '({int c})'),
];
-Future testFunctionSubtypingNamed(
- CompileMode compileMode, bool strongMode) async {
+Future testFunctionSubtypingNamed({bool strongMode}) async {
await TypeEnvironment
.create(createMethods(namedFunctionTypesData),
- compileMode: compileMode,
options: strongMode ? [Flags.strongMode] : [])
.then((env) => functionSubtypingNamedHelper(env, strongMode));
}
-Future testTypedefSubtypingNamed(
- CompileMode compileMode, bool strongMode) async {
+Future testTypedefSubtypingNamed({bool strongMode}) async {
await TypeEnvironment
.create(createTypedefs(namedFunctionTypesData),
- compileMode: compileMode,
options: strongMode ? [Flags.strongMode] : [])
.then((env) => functionSubtypingNamedHelper(env, strongMode));
}
@@ -589,7 +573,7 @@
expect(true, 'void___a_int_b_int_c_int', 'void___c_int');
}
-Future testTypeVariableSubtype(CompileMode compileMode, bool strongMode) async {
+Future testTypeVariableSubtype({bool strongMode}) async {
await TypeEnvironment.create(r"""
class A<T> {}
class B<T extends Object> {}
@@ -601,9 +585,7 @@
class H<T extends S, S extends T> {}
class I<T extends S, S extends U, U extends T> {}
class J<T extends S, S extends U, U extends S> {}
- """,
- compileMode: compileMode,
- options: strongMode ? [Flags.strongMode] : []).then((env) {
+ """, options: strongMode ? [Flags.strongMode] : []).then((env) {
void expect(bool expectSubtype, DartType T, DartType S,
{bool expectMoreSpecific}) {
testTypes(env, T, S, expectSubtype, expectMoreSpecific);
@@ -813,7 +795,7 @@
});
}
-Future testStrongModeSubtyping(CompileMode compileMode, bool strongMode) async {
+Future testStrongModeSubtyping({bool strongMode}) async {
await TypeEnvironment.create(r"""
class ClassWithCall {
void call() {}
@@ -827,9 +809,7 @@
takeInt(int o) => null;
takeVoid(void o) => null;
takeObject(Object o) => null;
- """,
- compileMode: compileMode,
- options: strongMode ? [Flags.strongMode] : []).then((env) {
+ """, options: strongMode ? [Flags.strongMode] : []).then((env) {
void expect(bool expectSubtype, DartType T, DartType S) {
Expect.equals(expectSubtype, env.isSubtype(T, S), '$T <: $S');
if (expectSubtype) {
diff --git a/tests/compiler/dart2js/model/subtypeset_test.dart b/tests/compiler/dart2js/model/subtypeset_test.dart
index cbaf315..af5d652 100644
--- a/tests/compiler/dart2js/model/subtypeset_test.dart
+++ b/tests/compiler/dart2js/model/subtypeset_test.dart
@@ -16,16 +16,14 @@
void main() {
asyncTest(() async {
- print('--test from ast---------------------------------------------------');
- await runTests(CompileMode.memory);
print('--test from kernel------------------------------------------------');
- await runTests(CompileMode.kernel);
+ await runTests();
print('--test from kernel (strong)---------------------------------------');
- await runTests(CompileMode.kernel, strongMode: true);
+ await runTests(strongMode: true);
});
}
-runTests(CompileMode compileMode, {bool strongMode: false}) async {
+runTests({bool strongMode: false}) async {
var env = await TypeEnvironment.create(r"""
/// A
/// / \
@@ -44,8 +42,7 @@
class G extends C {}
abstract class H implements C {}
abstract class I implements H {}
- """,
- mainSource: r"""
+ """, mainSource: r"""
main() {
new A().call;
new C();
@@ -54,9 +51,7 @@
new F();
new G();
}
- """,
- compileMode: compileMode,
- options: strongMode ? [Flags.strongMode] : []);
+ """, options: strongMode ? [Flags.strongMode] : []);
ClosedWorld world = env.closedWorld;
ClassEntity A = env.getElement("A");
diff --git a/tests/compiler/dart2js/model/type_substitution_test.dart b/tests/compiler/dart2js/model/type_substitution_test.dart
index 72ed70c..a00a701 100644
--- a/tests/compiler/dart2js/model/type_substitution_test.dart
+++ b/tests/compiler/dart2js/model/type_substitution_test.dart
@@ -8,18 +8,17 @@
import 'package:expect/expect.dart';
import 'package:async_helper/async_helper.dart';
-import 'package:compiler/src/elements/resolution_types.dart';
-import '../compiler_helper.dart';
+import 'package:compiler/src/common_elements.dart';
+import 'package:compiler/src/elements/entities.dart';
+import 'package:compiler/src/elements/types.dart';
import '../type_test_helper.dart';
-ResolutionDartType getType(compiler, String name) {
- dynamic clazz = findElement(compiler, "Class");
- clazz.ensureResolved(compiler.resolution);
- dynamic element = clazz.buildScope().lookup(name);
+DartType getType(ElementEnvironment elementEnvironment, String name) {
+ ClassEntity cls =
+ elementEnvironment.lookupClass(elementEnvironment.mainLibrary, 'Class');
+ FunctionEntity element = elementEnvironment.lookupClassMember(cls, name);
Expect.isNotNull(element);
- Expect.equals(element.kind, ElementKind.FUNCTION);
- element.computeType(compiler.resolution);
- FunctionSignature signature = element.functionSignature;
+ FunctionType type = elementEnvironment.getFunctionType(element);
// Function signatures are used to be to provide void types (only occurring as
// as return types) and (inlined) function types (only occurring as method
@@ -27,69 +26,78 @@
//
// Only a single type is used from each signature. That is, it is not the
// intention to check the whole signatures against eachother.
- if (signature.requiredParameterCount == 0) {
+ if (type.parameterTypes.isEmpty) {
// If parameters is empty, use return type.
- return signature.type.returnType;
+ return type.returnType;
} else {
// Otherwise use the first argument type.
- return signature.requiredParameters.first.type;
+ return type.parameterTypes.first;
}
}
void main() {
- testAsInstanceOf();
- testTypeSubstitution();
+ asyncTest(() async {
+ await testAsInstanceOf();
+ await testTypeSubstitution();
+ });
}
-void testAsInstanceOf() {
- asyncTest(() => TypeEnvironment.create('''
+testAsInstanceOf() async {
+ var env = await TypeEnvironment.create('''
class A<T> {}
class B<T> {}
class C<T> extends A<T> {}
class D<T> extends A<int> {}
class E<T> extends A<A<T>> {}
class F<T, U> extends B<F<T, String>> implements A<F<B<U>, int>> {}
- ''').then((env) {
- ClassElement A = env.getElement("A");
- ClassElement B = env.getElement("B");
- ClassElement C = env.getElement("C");
- ClassElement D = env.getElement("D");
- ClassElement E = env.getElement("E");
- ClassElement F = env.getElement("F");
+ ''', mainSource: '''
+ main() {
+ new A();
+ new B();
+ new C();
+ new D();
+ new E();
+ new F();
+ }
+ ''');
+ ClassEntity A = env.getElement("A");
+ ClassEntity B = env.getElement("B");
+ ClassEntity C = env.getElement("C");
+ ClassEntity D = env.getElement("D");
+ ClassEntity E = env.getElement("E");
+ ClassEntity F = env.getElement("F");
- ResolutionDartType intType = env['int'];
- ResolutionDartType stringType = env['String'];
+ DartType intType = env['int'];
+ DartType stringType = env['String'];
- ResolutionInterfaceType C_int = instantiate(C, [intType]);
- Expect.equals(instantiate(C, [intType]), C_int);
- Expect.equals(instantiate(A, [intType]), C_int.asInstanceOf(A));
+ InterfaceType C_int = instantiate(C, [intType]);
+ Expect.equals(instantiate(C, [intType]), C_int);
+ Expect.equals(instantiate(A, [intType]), env.types.asInstanceOf(C_int, A));
- ResolutionInterfaceType D_int = instantiate(D, [stringType]);
- Expect.equals(instantiate(A, [intType]), D_int.asInstanceOf(A));
+ InterfaceType D_int = instantiate(D, [stringType]);
+ Expect.equals(instantiate(A, [intType]), env.types.asInstanceOf(D_int, A));
- ResolutionInterfaceType E_int = instantiate(E, [intType]);
- Expect.equals(
- instantiate(A, [
- instantiate(A, [intType])
- ]),
- E_int.asInstanceOf(A));
+ InterfaceType E_int = instantiate(E, [intType]);
+ Expect.equals(
+ instantiate(A, [
+ instantiate(A, [intType])
+ ]),
+ env.types.asInstanceOf(E_int, A));
- ResolutionInterfaceType F_int_string =
- instantiate(F, [intType, stringType]);
- Expect.equals(
- instantiate(B, [
- instantiate(F, [intType, stringType])
- ]),
- F_int_string.asInstanceOf(B));
- Expect.equals(
- instantiate(A, [
- instantiate(F, [
- instantiate(B, [stringType]),
- intType
- ])
- ]),
- F_int_string.asInstanceOf(A));
- }));
+ InterfaceType F_int_string = instantiate(F, [intType, stringType]);
+ Expect.equals(
+ instantiate(B, [
+ instantiate(F, [intType, stringType])
+ ]),
+ env.types.asInstanceOf(F_int_string, B));
+ Expect.equals(
+ instantiate(A, [
+ instantiate(F, [
+ instantiate(B, [stringType]),
+ intType
+ ])
+ ]),
+ env.types.asInstanceOf(F_int_string, A));
}
/**
@@ -97,16 +105,20 @@
* through [name1] is the same as the type found through [name2].
*/
void testSubstitution(
- compiler, arguments, parameters, String name1, String name2) {
- ResolutionDartType type1 = getType(compiler, name1);
- ResolutionDartType type2 = getType(compiler, name2);
- ResolutionDartType subst = type1.subst(arguments, parameters);
+ ElementEnvironment elementEnvironment,
+ List<DartType> arguments,
+ List<DartType> parameters,
+ String name1,
+ String name2) {
+ DartType type1 = getType(elementEnvironment, name1);
+ DartType type2 = getType(elementEnvironment, name2);
+ DartType subst = type1.subst(arguments, parameters);
Expect.equals(
type2, subst, "$type1.subst($arguments,$parameters)=$subst != $type2");
}
-void testTypeSubstitution() {
- asyncTest(() => TypeEnvironment.create(r"""
+testTypeSubstitution() async {
+ var env = await TypeEnvironment.create(r"""
typedef void Typedef1<X,Y>(X x1, Y y2);
typedef void Typedef2<Z>(Z z1);
@@ -158,99 +170,96 @@
void Typedef1e(Typedef2<S> a) {}
void Typedef2e(Typedef2<String> b) {}
}
- """).then((env) {
- var compiler = env.compiler;
+ """);
+ InterfaceType Class_T_S = env["Class"];
+ Expect.isNotNull(Class_T_S);
+ Expect.isTrue(Class_T_S.isInterfaceType);
+ Expect.equals(2, Class_T_S.typeArguments.length);
- ResolutionInterfaceType Class_T_S = env["Class"];
- Expect.isNotNull(Class_T_S);
- Expect.identical(Class_T_S.kind, ResolutionTypeKind.INTERFACE);
- Expect.equals(2, Class_T_S.typeArguments.length);
+ DartType T = Class_T_S.typeArguments[0];
+ Expect.isNotNull(T);
+ Expect.isTrue(T.isTypeVariable);
- ResolutionDartType T = Class_T_S.typeArguments[0];
- Expect.isNotNull(T);
- Expect.identical(T.kind, ResolutionTypeKind.TYPE_VARIABLE);
+ DartType S = Class_T_S.typeArguments[1];
+ Expect.isNotNull(S);
+ Expect.isTrue(S.isTypeVariable);
- ResolutionDartType S = Class_T_S.typeArguments[1];
- Expect.isNotNull(S);
- Expect.identical(S.kind, ResolutionTypeKind.TYPE_VARIABLE);
+ DartType intType = env['int']; //getType(compiler, "int1");
+ Expect.isNotNull(intType);
+ Expect.isTrue(intType.isInterfaceType);
- ResolutionDartType intType = env['int']; //getType(compiler, "int1");
- Expect.isNotNull(intType);
- Expect.identical(intType.kind, ResolutionTypeKind.INTERFACE);
+ DartType StringType = env['String']; //getType(compiler, "String1");
+ Expect.isNotNull(StringType);
+ Expect.isTrue(StringType.isInterfaceType);
- ResolutionDartType StringType =
- env['String']; //getType(compiler, "String1");
- Expect.isNotNull(StringType);
- Expect.identical(StringType.kind, ResolutionTypeKind.INTERFACE);
+ List<DartType> parameters = <DartType>[T, S];
+ List<DartType> arguments = <DartType>[intType, StringType];
- List<ResolutionDartType> parameters = <ResolutionDartType>[T, S];
- List<ResolutionDartType> arguments = <ResolutionDartType>[
- intType,
- StringType
- ];
+ // TODO(johnniwinther): Create types directly from strings to improve
+ // test readability.
- // TODO(johnniwinther): Create types directly from strings to improve
- // test readability.
+ testSubstitution(
+ env.elementEnvironment, arguments, parameters, "void1", "void2");
+ testSubstitution(
+ env.elementEnvironment, arguments, parameters, "dynamic1", "dynamic2");
+ testSubstitution(
+ env.elementEnvironment, arguments, parameters, "int1", "int2");
+ testSubstitution(
+ env.elementEnvironment, arguments, parameters, "String1", "String2");
+ testSubstitution(
+ env.elementEnvironment, arguments, parameters, "ListInt1", "ListInt2");
+ testSubstitution(
+ env.elementEnvironment, arguments, parameters, "ListT1", "ListT2");
+ testSubstitution(
+ env.elementEnvironment, arguments, parameters, "ListS1", "ListS2");
+ testSubstitution(env.elementEnvironment, arguments, parameters, "ListListT1",
+ "ListListT2");
+ testSubstitution(
+ env.elementEnvironment, arguments, parameters, "ListRaw1", "ListRaw2");
+ testSubstitution(env.elementEnvironment, arguments, parameters,
+ "ListDynamic1", "ListDynamic2");
+ testSubstitution(env.elementEnvironment, arguments, parameters,
+ "MapIntString1", "MapIntString2");
+ testSubstitution(env.elementEnvironment, arguments, parameters, "MapTString1",
+ "MapTString2");
+ testSubstitution(env.elementEnvironment, arguments, parameters,
+ "MapDynamicString1", "MapDynamicString2");
+ testSubstitution(
+ env.elementEnvironment, arguments, parameters, "TypeVarT1", "TypeVarT2");
+ testSubstitution(
+ env.elementEnvironment, arguments, parameters, "TypeVarS1", "TypeVarS2");
+ testSubstitution(env.elementEnvironment, arguments, parameters, "Function1a",
+ "Function2a");
+ testSubstitution(env.elementEnvironment, arguments, parameters, "Function1b",
+ "Function2b");
+ testSubstitution(env.elementEnvironment, arguments, parameters, "Function1c",
+ "Function2c");
+ testSubstitution(
+ env.elementEnvironment, arguments, parameters, "Typedef1a", "Typedef2a");
+ testSubstitution(
+ env.elementEnvironment, arguments, parameters, "Typedef1b", "Typedef2b");
+ testSubstitution(
+ env.elementEnvironment, arguments, parameters, "Typedef1c", "Typedef2c");
+ testSubstitution(
+ env.elementEnvironment, arguments, parameters, "Typedef1d", "Typedef2d");
+ testSubstitution(
+ env.elementEnvironment, arguments, parameters, "Typedef1e", "Typedef2e");
- testSubstitution(compiler, arguments, parameters, "void1", "void2");
- testSubstitution(
- compiler, arguments, parameters, "dynamic1", "dynamic2");
- testSubstitution(compiler, arguments, parameters, "int1", "int2");
- testSubstitution(compiler, arguments, parameters, "String1", "String2");
- testSubstitution(
- compiler, arguments, parameters, "ListInt1", "ListInt2");
- testSubstitution(compiler, arguments, parameters, "ListT1", "ListT2");
- testSubstitution(compiler, arguments, parameters, "ListS1", "ListS2");
- testSubstitution(
- compiler, arguments, parameters, "ListListT1", "ListListT2");
- testSubstitution(
- compiler, arguments, parameters, "ListRaw1", "ListRaw2");
- testSubstitution(
- compiler, arguments, parameters, "ListDynamic1", "ListDynamic2");
- testSubstitution(
- compiler, arguments, parameters, "MapIntString1", "MapIntString2");
- testSubstitution(
- compiler, arguments, parameters, "MapTString1", "MapTString2");
- testSubstitution(compiler, arguments, parameters, "MapDynamicString1",
- "MapDynamicString2");
- testSubstitution(
- compiler, arguments, parameters, "TypeVarT1", "TypeVarT2");
- testSubstitution(
- compiler, arguments, parameters, "TypeVarS1", "TypeVarS2");
- testSubstitution(
- compiler, arguments, parameters, "Function1a", "Function2a");
- testSubstitution(
- compiler, arguments, parameters, "Function1b", "Function2b");
- testSubstitution(
- compiler, arguments, parameters, "Function1c", "Function2c");
- testSubstitution(
- compiler, arguments, parameters, "Typedef1a", "Typedef2a");
- testSubstitution(
- compiler, arguments, parameters, "Typedef1b", "Typedef2b");
- testSubstitution(
- compiler, arguments, parameters, "Typedef1c", "Typedef2c");
- testSubstitution(
- compiler, arguments, parameters, "Typedef1d", "Typedef2d");
- testSubstitution(
- compiler, arguments, parameters, "Typedef1e", "Typedef2e");
+ // Substitution in unalias.
+ DartType Typedef2_int_String = getType(env.elementEnvironment, "Typedef2a");
+ Expect.isNotNull(Typedef2_int_String);
+ DartType Function_int_String = getType(env.elementEnvironment, "Function2b");
+ Expect.isNotNull(Function_int_String);
+ DartType unalias1 = Typedef2_int_String.unaliased;
+ Expect.equals(Function_int_String, unalias1,
+ '$Typedef2_int_String.unalias=$unalias1 != $Function_int_String');
- // Substitution in unalias.
- ResolutionDartType Typedef2_int_String = getType(compiler, "Typedef2a");
- Expect.isNotNull(Typedef2_int_String);
- ResolutionDartType Function_int_String =
- getType(compiler, "Function2b");
- Expect.isNotNull(Function_int_String);
- ResolutionDartType unalias1 = Typedef2_int_String.unaliased;
- Expect.equals(Function_int_String, unalias1,
- '$Typedef2_int_String.unalias=$unalias1 != $Function_int_String');
-
- ResolutionDartType Typedef1 = getType(compiler, "Typedef1c");
- Expect.isNotNull(Typedef1);
- ResolutionDartType Function_dynamic_dynamic =
- getType(compiler, "Function1c");
- Expect.isNotNull(Function_dynamic_dynamic);
- ResolutionDartType unalias2 = Typedef1.unaliased;
- Expect.equals(Function_dynamic_dynamic, unalias2,
- '$Typedef1.unalias=$unalias2 != $Function_dynamic_dynamic');
- }));
+ DartType Typedef1 = getType(env.elementEnvironment, "Typedef1c");
+ Expect.isNotNull(Typedef1);
+ DartType Function_dynamic_dynamic =
+ getType(env.elementEnvironment, "Function1c");
+ Expect.isNotNull(Function_dynamic_dynamic);
+ DartType unalias2 = Typedef1.unaliased;
+ Expect.equals(Function_dynamic_dynamic, unalias2,
+ '$Typedef1.unalias=$unalias2 != $Function_dynamic_dynamic');
}
diff --git a/tests/compiler/dart2js/model/world_test.dart b/tests/compiler/dart2js/model/world_test.dart
index 70332ce..e56ce30 100644
--- a/tests/compiler/dart2js/model/world_test.dart
+++ b/tests/compiler/dart2js/model/world_test.dart
@@ -14,22 +14,20 @@
import '../type_test_helper.dart';
void main() {
- runTests(CompileMode compileMode) async {
- await testClassSets(compileMode);
- await testProperties(compileMode);
- await testNativeClasses(compileMode);
- await testCommonSubclasses(compileMode);
+ runTests() async {
+ await testClassSets();
+ await testProperties();
+ await testNativeClasses();
+ await testCommonSubclasses();
}
asyncTest(() async {
- print('--test from ast---------------------------------------------------');
- await runTests(CompileMode.memory);
print('--test from kernel------------------------------------------------');
- await runTests(CompileMode.kernel);
+ await runTests();
});
}
-testClassSets(CompileMode compileMode) async {
+testClassSets() async {
var env = await TypeEnvironment.create(r"""
class A implements X {}
class B {}
@@ -53,7 +51,7 @@
html.window;
new html.Worker('');
}
- """, compileMode: compileMode);
+ """);
ClosedWorld closedWorld = env.closedWorld;
ElementEnvironment elementEnvironment = closedWorld.elementEnvironment;
@@ -189,7 +187,7 @@
testMixinUses(X, []);
}
-testProperties(CompileMode compileMode) async {
+testProperties() async {
var env = await TypeEnvironment.create(r"""
class A {}
class A1 extends A {}
@@ -244,7 +242,7 @@
new G3();
new H4();
}
- """, compileMode: compileMode);
+ """);
ClosedWorld closedWorld = env.closedWorld;
check(String name, {bool hasStrictSubtype, bool hasOnlySubclasses}) {
@@ -310,9 +308,8 @@
check("H4", hasStrictSubtype: false, hasOnlySubclasses: true);
}
-testNativeClasses(CompileMode compileMode) async {
- var env = await TypeEnvironment.create('',
- mainSource: r"""
+testNativeClasses() async {
+ var env = await TypeEnvironment.create('', mainSource: r"""
import 'dart:html' as html;
main() {
html.window; // Creates 'Window'.
@@ -320,8 +317,7 @@
new html.CanvasElement() // Creates CanvasElement
..getContext(''); // Creates CanvasRenderingContext2D
}
- """,
- compileMode: compileMode);
+ """);
ClosedWorld closedWorld = env.closedWorld;
ElementEnvironment elementEnvironment = closedWorld.elementEnvironment;
LibraryEntity dart_html = elementEnvironment.lookupLibrary(Uris.dart_html);
@@ -520,9 +516,8 @@
instantiatedSubtypeCount: 0);
}
-testCommonSubclasses(CompileMode compileMode) async {
- var env = await TypeEnvironment.create('',
- mainSource: r"""
+testCommonSubclasses() async {
+ var env = await TypeEnvironment.create('', mainSource: r"""
class A {}
class B {}
class C extends A {}
@@ -545,8 +540,7 @@
new I();
new J();
}
- """,
- compileMode: compileMode);
+ """);
ClosedWorld closedWorld = env.closedWorld;
ClassEntity A = env.getElement("A");
diff --git a/tests/compiler/dart2js/needs_no_such_method_test.dart b/tests/compiler/dart2js/needs_no_such_method_test.dart
index 01e467e..e216047 100644
--- a/tests/compiler/dart2js/needs_no_such_method_test.dart
+++ b/tests/compiler/dart2js/needs_no_such_method_test.dart
@@ -14,10 +14,8 @@
void main() {
asyncTest(() async {
- print('--test from ast---------------------------------------------------');
- await testClassSets(CompileMode.memory);
print('--test from kernel------------------------------------------------');
- await testClassSets(CompileMode.kernel);
+ await testClassSets();
});
}
@@ -33,7 +31,7 @@
}
""";
-testClassSets(CompileMode compileMode) async {
+testClassSets() async {
Selector foo, bar, baz;
ClosedWorld closedWorld;
ClassEntity superclass, subclass, subtype;
@@ -48,8 +46,8 @@
main.write('}');
testMode = '$instantiated';
- var env = await TypeEnvironment.create(CLASSES,
- mainSource: main.toString(), compileMode: compileMode);
+ var env =
+ await TypeEnvironment.create(CLASSES, mainSource: main.toString());
foo = new Selector.call(const PublicName('foo'), CallStructure.NO_ARGS);
bar = new Selector.call(const PublicName('bar'), CallStructure.NO_ARGS);
baz = new Selector.call(const PublicName('baz'), CallStructure.NO_ARGS);
diff --git a/tests/compiler/dart2js/no_such_method_enabled_test.dart b/tests/compiler/dart2js/no_such_method_enabled_test.dart
index 68ff7c5..1142b92 100644
--- a/tests/compiler/dart2js/no_such_method_enabled_test.dart
+++ b/tests/compiler/dart2js/no_such_method_enabled_test.dart
@@ -3,7 +3,6 @@
// BSD-style license that can be found in the LICENSE file.
import 'package:async_helper/async_helper.dart';
-import 'package:compiler/src/commandline_options.dart';
import 'package:compiler/src/common_elements.dart';
import 'package:compiler/src/compiler.dart';
import 'package:compiler/src/elements/entities.dart';
@@ -206,23 +205,20 @@
];
main() {
- runTests({bool useKernel}) async {
+ runTests() async {
for (NoSuchMethodTest test in TESTS) {
print('---- testing -------------------------------------------------');
print(test.code);
- CompilationResult result = await runCompiler(
- memorySourceFiles: {'main.dart': test.code},
- options: useKernel ? [] : [Flags.useOldFrontend]);
+ CompilationResult result =
+ await runCompiler(memorySourceFiles: {'main.dart': test.code});
Compiler compiler = result.compiler;
checkTest(compiler, test);
}
}
asyncTest(() async {
- print('--test from ast---------------------------------------------------');
- await runTests(useKernel: false);
print('--test from kernel------------------------------------------------');
- await runTests(useKernel: true);
+ await runTests();
});
}
diff --git a/tests/compiler/dart2js/old_frontend/analyze_all_test.dart b/tests/compiler/dart2js/old_frontend/analyze_all_test.dart
deleted file mode 100644
index 4936c1c..0000000
--- a/tests/compiler/dart2js/old_frontend/analyze_all_test.dart
+++ /dev/null
@@ -1,112 +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:async';
-import 'package:async_helper/async_helper.dart';
-import 'package:compiler/src/commandline_options.dart';
-import 'package:compiler/src/diagnostics/messages.dart';
-import 'package:expect/expect.dart';
-import '../memory_compiler.dart';
-
-const String SOURCE = """
-class Foo {
- // Deliberately not const to ensure compile error.
- Foo(_);
-}
-
-@Bar()
-class Bar {
- const Bar();
-}
-
-@Foo('x')
-typedef void VoidFunction();
-
-@Foo('y')
-class MyClass {}
-
-main() {
-}
-""";
-
-Future<DiagnosticCollector> run(String source,
- {bool analyzeAll, bool expectSuccess}) async {
- DiagnosticCollector collector = new DiagnosticCollector();
-
- List<String> options = [Flags.useOldFrontend];
- if (analyzeAll) {
- options.add(Flags.analyzeAll);
- } else {
- options.add(Flags.analyzeOnly);
- }
- CompilationResult result = await runCompiler(
- memorySourceFiles: {'main.dart': source},
- diagnosticHandler: collector,
- options: options);
- Expect.equals(expectSuccess, result.isSuccess);
- return collector;
-}
-
-test1() async {
- DiagnosticCollector collector =
- await run(SOURCE, analyzeAll: false, expectSuccess: true);
- Expect.isTrue(
- collector.warnings.isEmpty, 'Unexpected warnings: ${collector.warnings}');
- Expect.isTrue(
- collector.errors.isEmpty, 'Unexpected errors: ${collector.errors}');
-}
-
-test2() async {
- DiagnosticCollector collector =
- await run(SOURCE, analyzeAll: true, expectSuccess: false);
-
- Expect.isTrue(
- collector.warnings.isEmpty, 'unexpected warnings: ${collector.warnings}');
- Expect.equals(2, collector.errors.length,
- 'expected exactly two errors, but got ${collector.errors}');
-
- CollectedMessage first = collector.errors.first;
- Expect.equals(MessageKind.CONSTRUCTOR_IS_NOT_CONST, first.message.kind);
- Expect.equals("Foo", SOURCE.substring(first.begin, first.end));
-
- CollectedMessage second = collector.errors.elementAt(1);
- Expect.equals(MessageKind.CONSTRUCTOR_IS_NOT_CONST, second.message.kind);
- Expect.equals("Foo", SOURCE.substring(second.begin, second.end));
-}
-
-// This is a regression test, testing that we can handle annotations on
-// malformed elements. Depending on the order of analysis, annotations on such
-// elements might not be resolved which caused a crash when trying to detect
-// a `@NoInline()` annotation.
-test3() async {
- String source = '''
-import 'package:expect/expect.dart';
-
-class A {
- @NoInline
- m() {
- => print(0);
- }
-}
-
-@NoInline()
-main() => new A().m();
-''';
-
- DiagnosticCollector collector =
- await run(source, analyzeAll: true, expectSuccess: false);
-
- Expect.isTrue(
- collector.warnings.isEmpty, 'unexpected warnings: ${collector.warnings}');
- Expect.equals(1, collector.errors.length,
- 'expected exactly one error, but got ${collector.errors}');
-}
-
-main() {
- asyncTest(() async {
- await test1();
- await test2();
- await test3();
- });
-}
diff --git a/tests/compiler/dart2js/old_frontend/analyze_api_test.dart b/tests/compiler/dart2js/old_frontend/analyze_api_test.dart
deleted file mode 100644
index 678e798..0000000
--- a/tests/compiler/dart2js/old_frontend/analyze_api_test.dart
+++ /dev/null
@@ -1,38 +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.
-
-library analyze_api;
-
-import 'package:sdk_library_metadata/libraries.dart';
-import 'analyze_helper.dart';
-import 'package:async_helper/async_helper.dart';
-
-/**
- * Map of white-listed warnings and errors.
- *
- * Only add a white-listing together with a bug report to dartbug.com and add
- * the bug issue number as a comment on the white-listing.
- *
- * Use an identifiable suffix of the file uri as key. Use a fixed substring of
- * the error/warning message in the list of white-listings for each file.
- */
-// TODO(johnniwinther): Support canonical URIs as keys.
-const Map<String, List<String>> WHITE_LIST = const {
- "sdk/lib/io/file.dart": const [
- "'void' is not a subtype of bound 'Object' for type variable",
- ],
- "sdk/lib/io/file_impl.dart": const [
- "'void' is not a subtype of bound 'Object' for type variable",
- ],
-};
-
-void main() {
- var uriList = new List<Uri>();
- libraries.forEach((String name, LibraryInfo info) {
- if (info.documented) {
- uriList.add(new Uri(scheme: 'dart', path: name));
- }
- });
- asyncTest(() => analyze(uriList, WHITE_LIST, mode: AnalysisMode.ALL));
-}
diff --git a/tests/compiler/dart2js/old_frontend/analyze_dart2js_helpers_test.dart b/tests/compiler/dart2js/old_frontend/analyze_dart2js_helpers_test.dart
deleted file mode 100644
index 7ff112a..0000000
--- a/tests/compiler/dart2js/old_frontend/analyze_dart2js_helpers_test.dart
+++ /dev/null
@@ -1,219 +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.
-
-library dart2js.analyze_helpers.test;
-
-import 'dart:io';
-
-import 'package:async_helper/async_helper.dart';
-import 'package:compiler/compiler_new.dart' show Diagnostic;
-import 'package:compiler/src/apiimpl.dart' show CompilerImpl;
-import 'package:compiler/src/commandline_options.dart';
-import 'package:compiler/src/constants/expressions.dart'
- show ConstructedConstantExpression;
-import 'package:compiler/src/elements/resolution_types.dart'
- show ResolutionInterfaceType;
-import 'package:compiler/src/diagnostics/source_span.dart' show SourceSpan;
-import 'package:compiler/src/elements/elements.dart';
-import 'package:compiler/src/filenames.dart' show nativeToUriPath;
-import 'package:compiler/src/resolution/semantic_visitor.dart';
-import 'package:compiler/src/resolution/tree_elements.dart' show TreeElements;
-import 'package:compiler/src/source_file_provider.dart'
- show FormattingDiagnosticHandler;
-import 'package:compiler/src/tree/tree.dart';
-import 'package:compiler/src/universe/call_structure.dart' show CallStructure;
-import 'package:expect/expect.dart';
-
-import '../memory_compiler.dart';
-
-main(List<String> arguments) {
- bool verbose = arguments.contains('-v');
-
- List<String> options = <String>[
- Flags.useOldFrontend,
- Flags.analyzeOnly,
- Flags.analyzeMain,
- '--categories=Client,Server'
- ];
- if (verbose) {
- options.add(Flags.verbose);
- }
- asyncTest(() async {
- CompilerImpl compiler =
- compilerFor(options: options, showDiagnostics: verbose);
- FormattingDiagnosticHandler diagnostics =
- new FormattingDiagnosticHandler(compiler.provider);
- Directory dir =
- new Directory.fromUri(Uri.base.resolve('pkg/compiler/lib/'));
- String helpersUriPrefix = dir.uri.resolve('src/helpers/').toString();
- HelperAnalyzer analyzer = new HelperAnalyzer(diagnostics, helpersUriPrefix);
- LibraryElement helperLibrary;
- for (FileSystemEntity entity in dir.listSync(recursive: true)) {
- if (entity is File && entity.path.endsWith('.dart')) {
- Uri file = Uri.base.resolve(nativeToUriPath(entity.path));
- if (verbose) {
- print('---- analyzing $file ----');
- }
- LibraryElement library = await compiler.analyzeUri(file);
- if (library != null) {
- if (library.libraryName == 'dart2js.helpers') {
- helperLibrary = library;
- }
- library.forEachLocalMember((Element element) {
- if (element is ClassElement) {
- element.forEachLocalMember((_member) {
- AstElement member = _member;
- analyzer.analyze(member.resolvedAst);
- });
- } else if (element is MemberElement) {
- analyzer.analyze(element.resolvedAst);
- }
- });
- }
- }
- }
- Expect.isNotNull(helperLibrary, 'Helper library not found');
- Expect.isTrue(analyzer.isHelper(helperLibrary),
- "Helper library $helperLibrary is not considered a helper.");
- Expect.isTrue(analyzer.errors.isEmpty, "Errors found.");
- });
-}
-
-class HelperAnalyzer extends TraversalVisitor {
- final FormattingDiagnosticHandler diagnostics;
- final String helpersUriPrefix;
- List<SourceSpan> errors = <SourceSpan>[];
-
- ResolvedAst resolvedAst;
-
- @override
- TreeElements get elements => resolvedAst.elements;
-
- AnalyzableElement get analyzedElement => resolvedAst.element;
-
- HelperAnalyzer(this.diagnostics, this.helpersUriPrefix) : super(null);
-
- @override
- void apply(Node node, [_]) {
- node.accept(this);
- }
-
- void analyze(ResolvedAst resolvedAst) {
- if (resolvedAst.kind != ResolvedAstKind.PARSED) {
- // Skip synthesized members.
- return;
- }
- this.resolvedAst = resolvedAst;
- apply(resolvedAst.node);
- this.resolvedAst = null;
- }
-
- bool isHelper(Element element) {
- Uri uri = element.library.canonicalUri;
- return '$uri'.startsWith(helpersUriPrefix);
- }
-
- void checkAccess(Node node, MemberElement element) {
- if (isHelper(element) && !isHelper(analyzedElement)) {
- Uri uri = analyzedElement.implementation.sourcePosition.uri;
- SourceSpan span = new SourceSpan.fromNode(uri, node);
- diagnostics.report(null, span.uri, span.begin, span.end,
- "Helper used in production code.", Diagnostic.ERROR);
- errors.add(span);
- }
- }
-
- @override
- void visitTopLevelFieldInvoke(Send node, FieldElement field,
- NodeList arguments, CallStructure callStructure, _) {
- checkAccess(node, field);
- apply(arguments);
- }
-
- @override
- void visitTopLevelGetterInvoke(Send node, GetterElement getter,
- NodeList arguments, CallStructure callStructure, _) {
- checkAccess(node, getter);
- apply(arguments);
- }
-
- @override
- void visitTopLevelFunctionInvoke(Send node, MethodElement method,
- NodeList arguments, CallStructure callStructure, _) {
- checkAccess(node, method);
- apply(arguments);
- }
-
- @override
- void visitTopLevelFieldGet(Send node, FieldElement field, _) {
- checkAccess(node, field);
- }
-
- @override
- void visitTopLevelGetterGet(Send node, GetterElement getter, _) {
- checkAccess(node, getter);
- }
-
- @override
- void visitTopLevelFunctionGet(Send node, MethodElement method, _) {
- checkAccess(node, method);
- }
-
- @override
- void visitGenerativeConstructorInvoke(
- NewExpression node,
- ConstructorElement constructor,
- ResolutionInterfaceType type,
- NodeList arguments,
- CallStructure callStructure,
- _) {
- checkAccess(node, constructor);
- apply(arguments);
- }
-
- @override
- void visitRedirectingGenerativeConstructorInvoke(
- NewExpression node,
- ConstructorElement constructor,
- ResolutionInterfaceType type,
- NodeList arguments,
- CallStructure callStructure,
- _) {
- checkAccess(node, constructor);
- apply(arguments);
- }
-
- @override
- void visitFactoryConstructorInvoke(
- NewExpression node,
- ConstructorElement constructor,
- ResolutionInterfaceType type,
- NodeList arguments,
- CallStructure callStructure,
- _) {
- checkAccess(node, constructor);
- apply(arguments);
- }
-
- @override
- void visitRedirectingFactoryConstructorInvoke(
- NewExpression node,
- ConstructorElement constructor,
- ResolutionInterfaceType type,
- ConstructorElement effectiveTarget,
- ResolutionInterfaceType effectiveTargetType,
- NodeList arguments,
- CallStructure callStructure,
- _) {
- checkAccess(node, constructor);
- apply(arguments);
- }
-
- @override
- void visitConstConstructorInvoke(
- NewExpression node, ConstructedConstantExpression constant, _) {
- ConstructorElement constructor = constant.target;
- checkAccess(node, constructor);
- }
-}
diff --git a/tests/compiler/dart2js/old_frontend/analyze_helper.dart b/tests/compiler/dart2js/old_frontend/analyze_helper.dart
deleted file mode 100644
index 84dc1c1..0000000
--- a/tests/compiler/dart2js/old_frontend/analyze_helper.dart
+++ /dev/null
@@ -1,298 +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 analyze_helper;
-
-import 'dart:async';
-import 'dart:io';
-import 'package:compiler/compiler.dart' as api;
-import 'package:compiler/src/apiimpl.dart';
-import 'package:compiler/src/commandline_options.dart';
-import 'package:compiler/src/diagnostics/messages.dart'
- show Message, MessageKind;
-import 'package:compiler/src/filenames.dart';
-import 'package:compiler/src/options.dart' show CompilerOptions;
-import 'package:compiler/src/source_file_provider.dart';
-import 'package:compiler/src/util/uri_extras.dart';
-import '../diagnostic_helper.dart';
-
-/// Option for hiding whitelisted messages.
-const String HIDE_WHITELISTED = '--hide-whitelisted';
-
-/**
- * Map of whitelisted warnings and errors.
- *
- * Only add a whitelisting together with a bug report to dartbug.com and add
- * the bug issue number as a comment on the whitelisting.
- *
- * Use an identifiable suffix of the file uri as key. Use a fixed substring of
- * the error/warning message in the list of whitelistings for each file.
- */
-// TODO(johnniwinther): Support canonical URIs as keys and message kinds as
-// values.
-
-class CollectingDiagnosticHandler extends FormattingDiagnosticHandler {
- bool hasWarnings = false;
- bool hasHint = false;
- bool hasErrors = false;
- bool lastWasWhitelisted = false;
- bool showWhitelisted = true;
-
- Map<String, Map<dynamic /* String|MessageKind */, int>> whiteListMap =
- new Map<String, Map<dynamic /* String|MessageKind */, int>>();
- List<MessageKind> skipList;
- List<CollectedMessage> collectedMessages = <CollectedMessage>[];
-
- CollectingDiagnosticHandler(
- Map<String, List /* <String|MessageKind> */ > whiteList,
- this.skipList,
- SourceFileProvider provider)
- : super(provider) {
- whiteList
- .forEach((String file, List /* <String|MessageKind> */ messageParts) {
- var useMap = new Map<dynamic /* String|MessageKind */, int>();
- for (var messagePart in messageParts) {
- useMap[messagePart] = 0;
- }
- whiteListMap[file] = useMap;
- });
- }
-
- bool checkResults() {
- bool validWhiteListUse = checkWhiteListUse();
- reportWhiteListUse();
- reportCollectedMessages();
- return !hasWarnings && !hasHint && !hasErrors && validWhiteListUse;
- }
-
- bool checkWhiteListUse() {
- bool allUsed = true;
- for (String file in whiteListMap.keys) {
- for (var messagePart in whiteListMap[file].keys) {
- if (whiteListMap[file][messagePart] == 0) {
- print("Whitelisting '$messagePart' is unused in '$file'. "
- "Remove the whitelisting from the whitelist map.");
- allUsed = false;
- }
- }
- }
- return allUsed;
- }
-
- void reportCollectedMessages() {
- if (collectedMessages.isNotEmpty) {
- print('----------------------------------------------------------------');
- print('Unexpected messages:');
- print('----------------------------------------------------------------');
- for (CollectedMessage message in collectedMessages) {
- super.report(message.message, message.uri, message.begin, message.end,
- message.text, message.kind);
- }
- print('----------------------------------------------------------------');
- }
- }
-
- void reportWhiteListUse() {
- for (String file in whiteListMap.keys) {
- for (var messagePart in whiteListMap[file].keys) {
- int useCount = whiteListMap[file][messagePart];
- print("Whitelisted message '$messagePart' suppressed $useCount "
- "time(s) in '$file'.");
- }
- }
- }
-
- bool checkWhiteList(Uri uri, Message message, String text) {
- if (uri == null) {
- return false;
- }
- if (skipList.contains(message.kind)) {
- return true;
- }
- String path = uri.path;
- for (String file in whiteListMap.keys) {
- if (path.contains(file)) {
- for (var messagePart in whiteListMap[file].keys) {
- bool found = false;
- if (messagePart is String) {
- found = text.contains(messagePart);
- } else {
- assert(messagePart is MessageKind);
- found = message.kind == messagePart;
- }
- if (found) {
- whiteListMap[file][messagePart]++;
- return true;
- }
- }
- }
- }
- return false;
- }
-
- @override
- void report(covariant Message message, Uri uri, int begin, int end,
- String text, api.Diagnostic kind) {
- if (kind == api.Diagnostic.WARNING) {
- if (checkWhiteList(uri, message, text)) {
- // Suppress whitelisted warnings.
- lastWasWhitelisted = true;
- if (showWhitelisted || verbose) {
- print("*already whitelisted*");
- super.report(message, uri, begin, end, text, kind);
- }
- return;
- }
- print("*NOT WHITELISTED*");
- hasWarnings = true;
- }
- if (kind == api.Diagnostic.HINT) {
- if (checkWhiteList(uri, message, text)) {
- // Suppress whitelisted hints.
- lastWasWhitelisted = true;
- if (showWhitelisted || verbose) {
- print("*already whitelisted*");
- super.report(message, uri, begin, end, text, kind);
- }
- return;
- }
- print("*NOT WHITELISTED*");
- hasHint = true;
- }
- if (kind == api.Diagnostic.ERROR) {
- if (checkWhiteList(uri, message, text)) {
- // Suppress whitelisted errors.
- lastWasWhitelisted = true;
- if (showWhitelisted || verbose) {
- print("*already whitelisted*");
- super.report(message, uri, begin, end, text, kind);
- }
- return;
- }
- print("*NOT WHITELISTED*");
- hasErrors = true;
- }
- if (kind == api.Diagnostic.INFO && lastWasWhitelisted) {
- return;
- }
- lastWasWhitelisted = false;
- if (kind != api.Diagnostic.VERBOSE_INFO) {
- collectedMessages
- .add(new CollectedMessage(message, uri, begin, end, text, kind));
- }
- super.report(message, uri, begin, end, text, kind);
- }
-}
-
-typedef bool CheckResults(
- CompilerImpl compiler, CollectingDiagnosticHandler handler);
-
-enum AnalysisMode {
- /// Analyze all declarations in all libraries in one go.
- ALL,
-
- /// Analyze all declarations in the main library.
- MAIN,
-
- /// Analyze all declarations in the given URIs one at a time. This mode can
- /// handle URIs for parts (i.e. skips these).
- URI,
-
- /// Analyze all declarations reachable from the entry point.
- TREE_SHAKING,
-}
-
-/// Analyzes the file(s) in [uriList] using the provided [mode] and checks that
-/// no messages (errors, warnings or hints) are emitted.
-///
-/// Messages can be generally allowed using [skipList] or on a per-file basis
-/// using [whiteList].
-Future analyze(
- List<Uri> uriList, Map<String, List /* <String|MessageKind> */ > whiteList,
- {AnalysisMode mode: AnalysisMode.ALL,
- CheckResults checkResults,
- List<String> options: const <String>[],
- List<MessageKind> skipList: const <MessageKind>[]}) async {
- String testFileName =
- relativize(Uri.base, Platform.script, Platform.isWindows);
-
- print("""
-
-
-===
-=== NOTE: If this test fails, update [WHITE_LIST] in $testFileName
-===
-
-
-""");
-
- var libraryRoot = currentDirectory.resolve('sdk/');
- var packageConfig = currentDirectory.resolve('.packages');
- var provider = new CompilerSourceFileProvider();
- var handler = new CollectingDiagnosticHandler(whiteList, skipList, provider);
- options = <String>[
- Flags.useOldFrontend,
- Flags.analyzeOnly,
- '--categories=Client,Server',
- Flags.showPackageWarnings
- ]..addAll(options);
- switch (mode) {
- case AnalysisMode.URI:
- case AnalysisMode.MAIN:
- options.add(Flags.analyzeMain);
- break;
- case AnalysisMode.ALL:
- options.add(Flags.analyzeAll);
- break;
- case AnalysisMode.TREE_SHAKING:
- break;
- }
- if (options.contains(Flags.verbose)) {
- handler.verbose = true;
- }
- if (options.contains(HIDE_WHITELISTED)) {
- handler.showWhitelisted = false;
- }
- var compiler = new CompilerImpl(
- provider,
- null,
- handler,
- CompilerOptions.parse(options, libraryRoot: libraryRoot)
- ..packageConfig = packageConfig
- ..environment = {});
- String MESSAGE = """
-
-
-===
-=== ERROR: Unexpected result of analysis.
-===
-=== Please update [WHITE_LIST] in $testFileName
-===
-""";
-
- if (mode == AnalysisMode.URI) {
- for (Uri uri in uriList) {
- print('Analyzing uri: $uri');
- await compiler.analyzeUri(uri);
- }
- } else if (mode != AnalysisMode.TREE_SHAKING) {
- print('Analyzing libraries: $uriList');
- compiler.librariesToAnalyzeWhenRun = uriList;
- await compiler.run(null);
- } else {
- print('Analyzing entry point: ${uriList.single}');
- await compiler.run(uriList.single);
- }
-
- bool result;
- if (checkResults != null) {
- result = checkResults(compiler, handler);
- } else {
- result = handler.checkResults();
- }
- if (!result) {
- print(MESSAGE);
- exit(1);
- }
-}
diff --git a/tests/compiler/dart2js/old_frontend/analyze_only_test.dart b/tests/compiler/dart2js/old_frontend/analyze_only_test.dart
deleted file mode 100644
index e2e1f3b..0000000
--- a/tests/compiler/dart2js/old_frontend/analyze_only_test.dart
+++ /dev/null
@@ -1,175 +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.
-
-// Smoke test of the dart2js compiler API.
-library analyze_only;
-
-import 'dart:async';
-
-import 'package:async_helper/async_helper.dart';
-import 'package:expect/expect.dart';
-
-import 'package:compiler/compiler_new.dart';
-import 'package:compiler/src/commandline_options.dart';
-import 'package:compiler/src/diagnostics/messages.dart'
- show MessageKind, MessageTemplate;
-import 'package:compiler/src/old_to_new_api.dart';
-import 'package:compiler/src/options.dart';
-
-import '../../dart2js_extra/dummy_compiler_test.dart' as dummy;
-import '../output_collector.dart';
-
-runCompiler(String main, List<String> options,
- onValue(String code, List errors, List warnings)) {
- List errors = new List();
- List warnings = new List();
-
- Future<String> localProvider(Uri uri) {
- if (uri.scheme != 'main') return dummy.provider(uri);
- return new Future<String>.value(main);
- }
-
- void localHandler(
- Uri uri, int begin, int end, String message, Diagnostic kind) {
- dummy.handler(uri, begin, end, message, kind);
- if (kind == Diagnostic.ERROR) {
- errors.add(message);
- } else if (kind == Diagnostic.WARNING) {
- warnings.add(message);
- }
- }
-
- options = [Flags.useOldFrontend]..addAll(options);
- print('-----------------------------------------------');
- print('main source:\n$main');
- print('options: $options\n');
- asyncStart();
- OutputCollector outputCollector = new OutputCollector();
- Future<CompilationResult> result = compile(
- CompilerOptions.parse(options,
- libraryRoot: new Uri(scheme: 'lib', path: '/'))
- ..entryPoint = new Uri(scheme: 'main')
- ..packageRoot = new Uri(scheme: 'package', path: '/'),
- new LegacyCompilerInput(localProvider),
- new LegacyCompilerDiagnostics(localHandler),
- outputCollector);
- result
- .then((_) {
- onValue(outputCollector.getOutput('', OutputType.js), errors, warnings);
- }, onError: (e, st) {
- throw 'Compilation failed: ${e} ${st}';
- })
- .then(asyncSuccess)
- .catchError((error, stack) {
- print('\n\n-----------------------------------------------');
- print('main source:\n$main');
- print('options: $options\n');
- print('threw:\n $error\n$stack');
- print('-----------------------------------------------\n\n');
- throw error;
- });
-}
-
-main() {
- runCompiler("", [Flags.generateCodeWithCompileTimeErrors],
- (String code, List errors, List warnings) {
- Expect.isNotNull(code);
- Expect.isTrue(errors.isEmpty, 'errors is not empty: $errors');
- MessageTemplate template =
- MessageTemplate.TEMPLATES[MessageKind.MISSING_MAIN];
- Expect.equals("${template.message({'main': 'main'})}", warnings.single);
- });
-
- runCompiler("main() {}", [Flags.generateCodeWithCompileTimeErrors],
- (String code, List errors, List warnings) {
- Expect.isNotNull(code);
- Expect.isTrue(errors.isEmpty);
- Expect.isTrue(warnings.isEmpty);
- });
-
- runCompiler("", [Flags.analyzeOnly],
- (String code, List errors, List warnings) {
- Expect.isNull(code);
- Expect.isTrue(errors.isEmpty, 'errors is not empty: $errors');
- MessageTemplate template =
- MessageTemplate.TEMPLATES[MessageKind.CONSIDER_ANALYZE_ALL];
- Expect.equals("${template.message({'main': 'main'})}", warnings.single);
- });
-
- runCompiler("main() {}", [Flags.analyzeOnly],
- (String code, List errors, List warnings) {
- Expect.isNull(code);
- Expect.isTrue(errors.isEmpty);
- Expect.isTrue(warnings.isEmpty);
- });
-
- runCompiler("Foo foo; // Unresolved but not analyzed.", [Flags.analyzeOnly],
- (String code, List errors, List warnings) {
- Expect.isNull(code);
- Expect.isTrue(errors.isEmpty, 'errors is not empty: $errors');
- MessageTemplate template =
- MessageTemplate.TEMPLATES[MessageKind.CONSIDER_ANALYZE_ALL];
- Expect.equals("${template.message({'main': 'main'})}", warnings.single);
- });
-
- runCompiler("""main() {
- Foo foo; // Unresolved and analyzed.
- }""", [Flags.analyzeOnly], (String code, List errors, List warnings) {
- Expect.isNull(code);
- Expect.isTrue(errors.isEmpty);
- Expect.equals(1, warnings.length);
- Expect.equals("Cannot resolve type 'Foo'.", warnings[0].toString());
- });
-
- runCompiler("""main() {
- Foo foo; // Unresolved and analyzed.
- }""", [Flags.analyzeOnly, Flags.analyzeSignaturesOnly],
- (String code, List errors, List warnings) {
- Expect.isNull(code);
- Expect.isTrue(errors.isEmpty);
- Expect.isTrue(warnings.isEmpty);
- });
-
- runCompiler("Foo foo; // Unresolved and analyzed.", [
- Flags.analyzeOnly,
- Flags.analyzeAll
- ], (String code, List errors, List warnings) {
- Expect.isNull(code);
- Expect.isTrue(errors.isEmpty);
- Expect.equals("Cannot resolve type 'Foo'.", warnings[0].toString());
- });
-
- runCompiler("""Foo foo; // Unresolved and analyzed.
- main() {}""", [Flags.analyzeOnly, Flags.analyzeAll],
- (String code, List errors, List warnings) {
- Expect.isNull(code);
- Expect.isTrue(errors.isEmpty, 'Unexpected errors: $errors.');
- Expect.equals(1, warnings.length, 'Unexpected warning count: $warnings.');
- Expect.equals("Cannot resolve type 'Foo'.", warnings[0].toString());
- });
-
- runCompiler("", [Flags.analyzeOnly, Flags.analyzeAll],
- (String code, List errors, List warnings) {
- Expect.isNull(code);
- Expect.isTrue(errors.isEmpty);
- Expect.isTrue(warnings.isEmpty);
- });
-
- // --analyze-signatures-only implies --analyze-only
- runCompiler("", [Flags.analyzeSignaturesOnly, Flags.analyzeAll],
- (String code, List errors, List warnings) {
- Expect.isNull(code);
- Expect.isTrue(errors.isEmpty);
- Expect.isTrue(warnings.isEmpty);
- });
-
- runCompiler("""main() {}
- foo() native 'foo';""", [Flags.analyzeOnly],
- (String code, List errors, List warnings) {
- Expect.isNull(code);
- Expect.isTrue(
- errors.single.startsWith("'native' modifier is not supported."));
- Expect.isTrue(warnings.isEmpty);
- });
-}
diff --git a/tests/compiler/dart2js/old_frontend/analyze_test_test.dart b/tests/compiler/dart2js/old_frontend/analyze_test_test.dart
deleted file mode 100644
index 495ce73..0000000
--- a/tests/compiler/dart2js/old_frontend/analyze_test_test.dart
+++ /dev/null
@@ -1,99 +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 dart2js.analyze_test.test;
-
-import 'dart:io';
-
-import 'package:async_helper/async_helper.dart';
-import 'package:compiler/src/commandline_options.dart';
-import 'package:compiler/src/filenames.dart' show nativeToUriPath;
-
-import 'analyze_helper.dart';
-
-/**
- * Map of white-listed warnings and errors.
- *
- * Use an identifiable suffix of the file uri as key. Use a fixed substring of
- * the error/warning message in the list of white-listings for each file.
- */
-// TODO(johnniwinther): Support canonical URIs as keys.
-const Map<String, List /* <String|MessageKind> */ > WHITE_LIST = const {
- "pkg/kernel/lib/transformations/closure/": const [
- "Duplicated library name 'kernel.transformations.closure.converter'",
- ],
-};
-
-const List<String> SKIP_LIST = const <String>[
- // Helper files:
- "/data/",
- "/emission/",
- "/side_effects/",
- "quarantined/http_launch_data/",
- "mirrors_helper.dart",
- "path%20with%20spaces/",
- // Broken tests:
- "quarantined/http_test.dart",
- // Package directory
- "packages/",
-];
-
-List<Uri> computeInputUris({String filter}) {
- List<Uri> uriList = <Uri>[];
- Directory dir =
- new Directory.fromUri(Uri.base.resolve('tests/compiler/dart2js/'));
- for (FileSystemEntity entity in dir.listSync(recursive: true)) {
- if (entity is File && entity.path.endsWith('.dart')) {
- Uri file = Uri.base.resolve(nativeToUriPath(entity.path));
- if (filter != null && !'$file'.contains(filter)) {
- continue;
- }
- if (!SKIP_LIST.any((skip) => file.path.contains(skip))) {
- uriList.add(file);
- }
- }
- }
- return uriList;
-}
-
-main(List<String> arguments) {
- List<String> options = <String>[];
- List<Uri> uriList = <Uri>[];
- String filter;
- bool first = true;
- for (String argument in arguments) {
- if (argument.startsWith('-')) {
- options.add(argument == '-v' ? Flags.verbose : argument);
- } else if (first) {
- File file = new File(argument);
- if (file.existsSync()) {
- // Read test files from [file].
- for (String line in file.readAsLinesSync()) {
- line = line.trim();
- if (line.startsWith('Analyzing uri: ')) {
- int filenameOffset = line.indexOf('tests/compiler/dart2js/');
- if (filenameOffset != -1) {
- uriList.add(Uri.base
- .resolve(nativeToUriPath(line.substring(filenameOffset))));
- }
- }
- }
- } else {
- // Use argument as filter on test files.
- filter = argument;
- }
- } else {
- throw new ArgumentError("Extra argument $argument in $arguments.");
- }
- first = false;
- }
-
- asyncTest(() async {
- if (uriList.isEmpty) {
- uriList = computeInputUris(filter: filter);
- }
- await analyze(uriList, WHITE_LIST,
- mode: AnalysisMode.URI, options: options);
- });
-}
diff --git a/tests/compiler/dart2js/old_frontend/async_await_syntax_test.dart b/tests/compiler/dart2js/old_frontend/async_await_syntax_test.dart
deleted file mode 100644
index 16be073..0000000
--- a/tests/compiler/dart2js/old_frontend/async_await_syntax_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.
-
-// Test that dart2js produces the expected static type warnings and
-// compile-time errors for these tests.
-
-import 'frontend_checker.dart';
-
-/// Map of test files to run together with their associated whitelist.
-///
-/// For instance
-/// 'language/async_await_syntax_test.dart': const ['a03b', 'a04b']
-/// includes the multitest in 'language/async_await_syntax_test.dart' but
-/// expects the subtests 'a03b' and 'a04c' to fail.
-const Map<String, List<String>> TESTS = const <String, List<String>>{
- 'language_2/async_await_syntax_test.dart': const [
- 'a10a',
- 'b10a',
- 'c10a',
- 'd08b',
- 'd10a',
- ],
-};
-
-void main(List<String> arguments) {
- check(TESTS, arguments: arguments, options: []);
-}
diff --git a/tests/compiler/dart2js/old_frontend/bad_loop_test.dart b/tests/compiler/dart2js/old_frontend/bad_loop_test.dart
deleted file mode 100644
index 69d2490..0000000
--- a/tests/compiler/dart2js/old_frontend/bad_loop_test.dart
+++ /dev/null
@@ -1,68 +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.
-
-import 'package:async_helper/async_helper.dart';
-import 'package:compiler/compiler.dart' show Diagnostic;
-import 'package:compiler/src/options.dart' show CompilerOptions;
-import 'package:compiler/src/old_to_new_api.dart';
-import 'package:expect/expect.dart';
-import '../memory_source_file_helper.dart';
-
-main() {
- Uri script = currentDirectory.resolveUri(Platform.script);
- Uri libraryRoot = script.resolve('../../../../sdk/');
- Uri packageRoot = script.resolve('./packages/');
-
- var provider = new MemorySourceFileProvider(MEMORY_SOURCE_FILES);
- int warningCount = 0;
- int errorCount = 0;
- void diagnosticHandler(
- Uri uri, int begin, int end, String message, Diagnostic kind) {
- if (kind == Diagnostic.VERBOSE_INFO) {
- return;
- }
- if (kind == Diagnostic.ERROR) {
- errorCount++;
- } else if (kind == Diagnostic.WARNING) {
- warningCount++;
- } else {
- throw 'unexpected diagnostic $kind: $message';
- }
- }
-
- CompilerImpl compiler = new CompilerImpl(
- provider,
- new LegacyCompilerOutput(),
- new LegacyCompilerDiagnostics(diagnosticHandler),
- new CompilerOptions()
- ..libraryRoot = libraryRoot
- ..useKernel = false
- ..packageRoot = packageRoot);
- asyncTest(() => compiler.run(Uri.parse('memory:main.dart')).then((_) {
- Expect.isTrue(compiler.compilationFailed);
- Expect.equals(5, errorCount);
- Expect.equals(1, warningCount);
- }));
-}
-
-const Map MEMORY_SOURCE_FILES = const {
- 'main.dart': """
-main() {
- for (var x, y in []) {
- }
-
- for (var x = 10 in []) {
- }
-
- for (x.y in []) { // Also causes a warning "x unresolved".
- }
-
- for ((){}() in []) {
- }
-
- for (1 in []) {
- }
-}
-"""
-};
diff --git a/tests/compiler/dart2js/old_frontend/begin_end_token_test.dart b/tests/compiler/dart2js/old_frontend/begin_end_token_test.dart
deleted file mode 100644
index 0a0ce7a..0000000
--- a/tests/compiler/dart2js/old_frontend/begin_end_token_test.dart
+++ /dev/null
@@ -1,174 +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.
-
-import 'package:compiler/src/tree/tree.dart';
-import 'package:expect/expect.dart';
-import 'parser_helper.dart';
-
-void testNode(Node node, String expected, String text, [bool hard = true]) {
- var debug = 'text=$text,expected=$expected,node:${node}';
- Expect.isNotNull(node, debug);
-
- Token beginToken = node.getBeginToken();
- Expect.isNotNull(beginToken, debug);
- Token endToken = node.getEndToken();
- Expect.isNotNull(endToken, debug);
-
- int begin = beginToken.charOffset;
- int end = endToken.charOffset + endToken.charCount;
- Expect.isTrue(begin <= end, debug);
-
- if (hard) {
- Expect.stringEquals(expected, text.substring(begin, end), debug);
- }
-}
-
-Node testExpression(String text, [String alternate]) {
- ExpressionStatement statement = parseStatement('$text;');
- Expression node = statement.expression;
- testNode(node, alternate == null ? text : alternate, text);
- return node;
-}
-
-void testUnaryExpression() {
- testExpression('x++');
- testExpression('++x');
-}
-
-void testAssignment() {
- Expression node;
- SendSet sendSet;
- String text;
-
- text = "a = b";
- node = testExpression(text);
-
- text = "a = b = c";
- node = testExpression(text);
- // Should parse as: a = (b = c).
- Expect.isNotNull(sendSet = node.asSendSet());
- testNode(sendSet.arguments.head.asSendSet(), 'b = c', text);
-
- text = "a = b = c = d";
- node = testExpression(text);
- // Should parse as: a = (b = (c = d)).
- Expect.isNotNull(sendSet = node.asSendSet());
- testNode(sendSet = sendSet.arguments.head.asSendSet(), 'b = c = d', text);
- testNode(sendSet = sendSet.arguments.head.asSendSet(), 'c = d', text);
-
- text = "a.b = c";
- node = testExpression(text);
- // Should parse as: receiver = a, selector = b, arguments = c.
- Expect.isNotNull(sendSet = node.asSendSet());
- testNode(sendSet.receiver, "a", "a.b = c");
- testNode(sendSet.selector, "b", "a.b = c");
- testNode(sendSet.arguments.head, "c", "a.b = c");
-
- text = "a.b = c.d";
- node = testExpression(text);
- // Should parse as: a.b = (c.d).
- Expect.isNotNull(sendSet = node.asSendSet());
- Expect.stringEquals("a", sendSet.receiver.toString());
- Expect.stringEquals("b", sendSet.selector.toString());
- Expect.stringEquals("c.d", sendSet.arguments.head.toString());
-
- text = "a.b = c.d = e.f";
- node = testExpression(text);
- // Should parse as: a.b = (c.d = (e.f)).
- Expect.isNotNull(sendSet = node.asSendSet());
- testNode(sendSet.receiver, "a", text);
- testNode(sendSet.selector, "b", text);
- Expect.isNotNull(sendSet = sendSet.arguments.head.asSendSet());
- testNode(sendSet.receiver, "c", text);
- testNode(sendSet.selector, "d", text);
- testNode(sendSet.arguments.head, "e.f", text);
-}
-
-void testIndex() {
- Expression node;
- Send send;
- SendSet sendSet;
- String text;
-
- text = "a[b]";
- node = testExpression(text);
- // Should parse as: (a)[b].
- Expect.isNotNull(send = node.asSend());
- testNode(send.receiver, "a", text);
- // TODO(johnniwinther): [selector] is the synthetic [] Operator which doesn't
- // return the right begin/end tokens. In the next line we should have expected
- // "[b]" instead of "[b".
- testNode(send.selector, "[b", text);
- testNode(send.arguments.head, "b", text);
-
- text = "a[b] = c";
- node = testExpression(text);
- // Should parse as: (a)[b] = c.
- Expect.isNotNull(sendSet = node.asSendSet());
- testNode(sendSet.receiver, "a", text);
- testNode(sendSet.selector, "[]", text, false); // Operator token is synthetic.
- testNode(sendSet.assignmentOperator, "=", text);
- testNode(sendSet.arguments.head, "b", text);
- testNode(sendSet.arguments.tail.head, "c", text);
-
- text = "a.b[c]";
- node = testExpression(text);
- // Should parse as: (a.b)[c].
- Expect.isNotNull(send = node.asSend());
- testNode(send.receiver, "a.b", text);
- testNode(send.selector, "[]", text, false); // Operator token is synthetic.
- testNode(send.arguments.head, "c", text);
-
- text = "a.b[c] = d";
- node = testExpression(text);
- // Should parse as: (a.b)[] = (c, d).
- Expect.isNotNull(sendSet = node.asSendSet());
- Expect.isNotNull(send = sendSet.receiver.asSend());
- testNode(send, "a.b", text);
- testNode(sendSet.selector, "[]", text, false); // Operator token is synthetic.
- testNode(sendSet.assignmentOperator, "=", text);
- testNode(sendSet.arguments.head, "c", text);
- testNode(sendSet.arguments.tail.head, "d", text);
-}
-
-void testPostfix() {
- Expression node;
- SendSet sendSet;
- String text;
-
- text = "a.b++";
- node = testExpression(text);
- // Should parse as: (a.b)++.
- Expect.isNotNull(sendSet = node.asSendSet());
- testNode(sendSet.receiver, "a", text);
- testNode(sendSet.selector, "b", text);
- testNode(sendSet.assignmentOperator, "++", text);
- Expect.isTrue(sendSet.arguments.isEmpty);
-
- text = "++a[b]";
- // TODO(johnniwinther): SendSet generates the wrong end token in the following
- // line. We should have [:testExpression(text):] instead of
- // [:testExpression(text, "++a"):].
- node = testExpression(text, "++a");
- Expect.isNotNull(sendSet = node.asSendSet());
- testNode(sendSet.receiver, "a", text);
- testNode(sendSet.selector, "[]", text, false); // Operator token is synthetic.
- testNode(sendSet.assignmentOperator, "++", text);
- testNode(sendSet.arguments.head, "b", text);
-
- text = "a[b]++";
- node = testExpression(text);
- Expect.isNotNull(sendSet = node.asSendSet());
- testNode(sendSet.receiver, "a", text);
- testNode(sendSet.selector, "[]", text, false); // Operator token is synthetic.
- testNode(sendSet.assignmentOperator, "++", text);
- testNode(sendSet.arguments.head, "b", text);
-}
-
-void main() {
- testUnaryExpression();
- testAssignment();
- testIndex();
- testPostfix();
-}
diff --git a/tests/compiler/dart2js/old_frontend/benign_error_test.dart b/tests/compiler/dart2js/old_frontend/benign_error_test.dart
deleted file mode 100644
index a94a5aa..0000000
--- a/tests/compiler/dart2js/old_frontend/benign_error_test.dart
+++ /dev/null
@@ -1,43 +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 that benign error do not prevent compilation.
-
-import '../memory_compiler.dart';
-
-import 'package:async_helper/async_helper.dart';
-import 'package:compiler/src/commandline_options.dart';
-import 'package:compiler/src/compiler.dart';
-import 'package:compiler/src/diagnostics/messages.dart';
-import 'package:compiler/src/js_backend/js_backend.dart';
-import 'package:expect/expect.dart';
-
-main() {
- asyncTest(() async {
- for (MessageKind kind in Compiler.BENIGN_ERRORS) {
- await testExamples(kind);
- }
- });
-}
-
-testExamples(MessageKind kind) async {
- MessageTemplate template = MessageTemplate.TEMPLATES[kind];
- for (var example in template.examples) {
- if (example is! Map) {
- example = {'main.dart': example};
- }
- DiagnosticCollector collector = new DiagnosticCollector();
- CompilationResult result = await runCompiler(
- memorySourceFiles: example,
- diagnosticHandler: collector,
- options: [Flags.useOldFrontend]);
- Expect.isTrue(result.isSuccess);
- Expect
- .isTrue(collector.errors.any((message) => message.messageKind == kind));
- Compiler compiler = result.compiler;
- JavaScriptBackend backend = compiler.backend;
- Expect.isNotNull(backend.generatedCode[
- compiler.frontendStrategy.elementEnvironment.mainFunction]);
- }
-}
diff --git a/tests/compiler/dart2js/old_frontend/categories_test.dart b/tests/compiler/dart2js/old_frontend/categories_test.dart
deleted file mode 100644
index 6b4317c..0000000
--- a/tests/compiler/dart2js/old_frontend/categories_test.dart
+++ /dev/null
@@ -1,33 +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.
-
-import "package:expect/expect.dart";
-import 'package:async_helper/async_helper.dart';
-import 'package:compiler/src/commandline_options.dart';
-
-import "../memory_compiler.dart";
-
-runTest(String source, String categories, int expectedErrors) async {
- var collector = new DiagnosticCollector();
- await runCompiler(
- memorySourceFiles: {"main.dart": source},
- options: ["--categories=$categories", Flags.useOldFrontend],
- diagnosticHandler: collector);
- Expect.equals(expectedErrors, collector.errors.length);
- Expect.equals(0, collector.warnings.length);
-}
-
-void main() {
- asyncTest(() async {
- await runTest("import 'dart:async'; main() {}", "Client", 0);
- await runTest("import 'dart:async'; main() {}", "Server", 0);
- await runTest("import 'dart:html'; main() {}", "Client", 0);
- await runTest("import 'dart:html'; main() {}", "Server", 1);
- // Importing dart:io is temporarily allowed as a stopgap measure for the
- // lack of config specific imports. Once that is added, this will be
- // disallowed again.
- await runTest("import 'dart:io'; main() {}", "Client", 0);
- await runTest("import 'dart:io'; main() {}", "Server", 0);
- });
-}
diff --git a/tests/compiler/dart2js/old_frontend/check_elements_invariants_test.dart b/tests/compiler/dart2js/old_frontend/check_elements_invariants_test.dart
deleted file mode 100644
index f394e6d..0000000
--- a/tests/compiler/dart2js/old_frontend/check_elements_invariants_test.dart
+++ /dev/null
@@ -1,45 +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:async';
-import 'package:async_helper/async_helper.dart';
-import 'package:compiler/src/apiimpl.dart';
-import 'package:compiler/src/commandline_options.dart';
-import 'package:expect/expect.dart';
-import 'package:compiler/src/elements/entities.dart' show ClassEntity;
-import 'package:compiler/src/resolution/class_members.dart'
- show ClassMemberMixin;
-import '../memory_compiler.dart';
-
-const String DART2JS_SOURCE = 'pkg/compiler/lib/src/dart2js.dart';
-const List<String> DART2JS_OPTIONS = const <String>[
- '--categories=Client,Server',
- '--disable-type-inference',
- Flags.useOldFrontend
-];
-
-Iterable<ClassEntity> computeLiveClasses(CompilerImpl compiler) {
- return new Set<ClassEntity>()
- ..addAll(compiler.resolutionWorldBuilder.directlyInstantiatedClasses)
- ..addAll(compiler.codegenWorldBuilder.directlyInstantiatedClasses);
-}
-
-void checkClassInvariants(ClassEntity cls) {
- ClassMemberMixin impl = cls;
- Expect.isTrue(impl.areAllMembersComputed(),
- "Not all members have been computed for $cls.");
-}
-
-Future checkElementInvariantsAfterCompiling(Uri uri) async {
- CompilationResult result =
- await runCompiler(entryPoint: uri, options: DART2JS_OPTIONS);
- Expect.isTrue(result.isSuccess, "Compilation of dart2js failed.");
-
- computeLiveClasses(result.compiler).forEach(checkClassInvariants);
-}
-
-void main() {
- var uri = Uri.base.resolve(DART2JS_SOURCE);
- asyncTest(() => checkElementInvariantsAfterCompiling(uri));
-}
diff --git a/tests/compiler/dart2js/old_frontend/check_members_test.dart b/tests/compiler/dart2js/old_frontend/check_members_test.dart
deleted file mode 100644
index 26a5a53..0000000
--- a/tests/compiler/dart2js/old_frontend/check_members_test.dart
+++ /dev/null
@@ -1,76 +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 dart2js produces the expected static type warnings for least upper
-// bound language tests. This ensures that the analyzer and dart2js agrees
-// on these tests.
-
-import 'warnings_checker.dart';
-
-/// Map from test files to a map of their expected status. If the status map is
-/// `null` no warnings must be missing or unexpected, otherwise the status map
-/// can contain a list of line numbers for keys 'missing' and 'unexpected' for
-/// the warnings of each category.
-const Map<String, dynamic> TESTS = const {
- // Instance methods.
- 'language/check_method_override_test.dart': null,
- 'co19/src/Language/Classes/Instance_Methods/'
- 'override_more_parameters_t01.dart': null,
- 'co19/src/Language/Classes/Instance_Methods/'
- 'override_more_parameters_t02.dart': null,
- 'co19/src/Language/Classes/Instance_Methods/'
- 'override_fewer_parameters_t01.dart': null,
- 'co19/src/Language/Classes/Instance_Methods/'
- 'override_fewer_parameters_t02.dart': null,
- 'co19/src/Language/Classes/Instance_Methods/'
- 'override_named_parameters_t01.dart': null,
- 'co19/src/Language/Classes/Instance_Methods/'
- 'override_named_parameters_t02.dart': null,
- 'co19/src/Language/Classes/Instance_Methods/'
- 'override_named_parameters_t03.dart': null,
- 'co19/src/Language/Classes/Instance_Methods/'
- 'override_named_parameters_t04.dart': null,
- 'co19/src/Language/Classes/Instance_Methods/'
- 'override_named_parameters_t05.dart': null,
- 'co19/src/Language/Classes/Instance_Methods/'
- 'override_named_parameters_t06.dart': null,
- 'co19/src/Language/Classes/Instance_Methods/'
- 'override_subtype_t01.dart': null,
- 'co19/src/Language/Classes/Instance_Methods/'
- 'override_subtype_t02.dart': null,
- 'co19/src/Language/Classes/Instance_Methods/'
- 'override_subtype_t03.dart': null,
- 'co19/src/Language/Classes/Instance_Methods/'
- 'override_subtype_t04.dart': null,
- 'co19/src/Language/Classes/Instance_Methods/'
- 'override_subtype_t05.dart': null,
- 'co19/src/Language/Classes/Instance_Methods/'
- 'override_subtype_t06.dart': null,
- 'co19/src/Language/Classes/Instance_Methods/'
- 'same_name_static_member_in_superclass_t01.dart': null,
- 'co19/src/Language/Classes/Instance_Methods/'
- 'same_name_static_member_in_superclass_t02.dart': null,
- 'co19/src/Language/Classes/Instance_Methods/'
- 'same_name_static_member_in_superclass_t04.dart': null,
- 'co19/src/Language/Classes/Instance_Methods/'
- 'same_name_static_member_in_superclass_t05.dart': null,
- 'co19/src/Language/Classes/Instance_Methods/'
- 'same_name_static_member_in_superclass_t06.dart': null,
- 'co19/src/Language/Classes/Instance_Methods/'
- 'same_name_static_member_in_superclass_t07.dart': null,
- 'co19/src/Language/Classes/Instance_Methods/'
- 'same_name_static_member_in_superclass_t08.dart': null,
- 'co19/src/Language/Classes/Instance_Methods/'
- 'same_name_static_member_in_superclass_t09.dart': null,
-
- // Getters.
- 'co19/src/Language/Classes/Getters/override_t01.dart': null,
- 'co19/src/Language/Classes/Getters/override_t02.dart': null,
- 'co19/src/Language/Classes/Getters/override_t03.dart': null,
- 'co19/src/Language/Classes/Getters/override_t04.dart': null,
-};
-
-void main() {
- checkWarnings(TESTS);
-}
diff --git a/tests/compiler/dart2js/old_frontend/combinator_hint_test.dart b/tests/compiler/dart2js/old_frontend/combinator_hint_test.dart
deleted file mode 100644
index 3ff105c..0000000
--- a/tests/compiler/dart2js/old_frontend/combinator_hint_test.dart
+++ /dev/null
@@ -1,110 +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 that the hint on empty combinators works as intended.
-
-import 'dart:async';
-import 'package:async_helper/async_helper.dart';
-import 'package:expect/expect.dart';
-import 'package:compiler/src/commandline_options.dart';
-import 'package:compiler/src/compiler.dart';
-import '../memory_compiler.dart';
-
-const SOURCE = const {
- 'show_local.dart': """
-import 'lib.dart' show Foo;
-
-main() {}
-""",
- 'hide_local.dart': """
-import 'lib.dart' hide Foo;
-
-main() {}
-""",
- 'show_package.dart': """
-import 'package:pkg/pkg.dart' show Foo;
-
-main() {}
-""",
- 'hide_package.dart': """
-import 'package:pkg/pkg.dart' hide Foo;
-
-main() {}
-""",
- 'lib.dart': '',
- 'pkg/pkg/pkg.dart': '',
-};
-
-Future<Compiler> test(Uri entryPoint,
- {bool showPackageWarnings: false,
- bool suppressHints: false,
- int hints: 0,
- Compiler cachedCompiler}) async {
- print('==================================================================');
- print('test: $entryPoint showPackageWarnings=$showPackageWarnings '
- 'suppressHints=$suppressHints');
- var options = [Flags.analyzeOnly, Flags.useOldFrontend];
- if (showPackageWarnings) {
- options.add(Flags.showPackageWarnings);
- }
- if (suppressHints) {
- options.add(Flags.suppressHints);
- }
- var collector = new DiagnosticCollector();
- CompilationResult result = await runCompiler(
- entryPoint: entryPoint,
- memorySourceFiles: SOURCE,
- options: options,
- packageRoot: Uri.parse('memory:pkg/'),
- diagnosticHandler: collector,
- cachedCompiler: cachedCompiler);
- Expect.equals(
- 0, collector.errors.length, 'Unexpected errors: ${collector.errors}');
- Expect.equals(0, collector.warnings.length,
- 'Unexpected warnings: ${collector.warnings}');
- Expect.equals(
- hints, collector.hints.length, 'Unexpected hints: ${collector.hints}');
- Expect.equals(
- 0, collector.infos.length, 'Unexpected infos: ${collector.infos}');
- print('==================================================================');
- return result.compiler;
-}
-
-Future<Compiler> testUri(Uri entrypoint,
- {bool suppressed: false, Compiler cachedCompiler}) async {
- cachedCompiler = await test(entrypoint,
- showPackageWarnings: true,
- suppressHints: false,
- hints: 1,
- cachedCompiler: cachedCompiler);
- cachedCompiler = await test(entrypoint,
- showPackageWarnings: false,
- suppressHints: false,
- hints: suppressed ? 0 : 1,
- cachedCompiler: cachedCompiler);
- cachedCompiler = await test(entrypoint,
- showPackageWarnings: true,
- suppressHints: true,
- hints: 0,
- cachedCompiler: cachedCompiler);
- cachedCompiler = await test(entrypoint,
- showPackageWarnings: false,
- suppressHints: true,
- hints: 0,
- cachedCompiler: cachedCompiler);
- return cachedCompiler;
-}
-
-void main() {
- asyncTest(() async {
- Compiler cachedCompiler =
- await testUri(Uri.parse('memory:show_local.dart'));
- cachedCompiler = await testUri(Uri.parse('memory:hide_local.dart'),
- cachedCompiler: cachedCompiler);
- cachedCompiler = await testUri(Uri.parse('memory:show_package.dart'),
- cachedCompiler: cachedCompiler);
- cachedCompiler = await testUri(Uri.parse('memory:hide_package.dart'),
- suppressed: true, cachedCompiler: cachedCompiler);
- });
-}
diff --git a/tests/compiler/dart2js/old_frontend/compile_with_empty_libraries_test.dart b/tests/compiler/dart2js/old_frontend/compile_with_empty_libraries_test.dart
deleted file mode 100644
index d16fe9e..0000000
--- a/tests/compiler/dart2js/old_frontend/compile_with_empty_libraries_test.dart
+++ /dev/null
@@ -1,18 +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 that the dart2js compiler can compile an empty script without
-/// references to core library definitions.
-
-import 'package:async_helper/async_helper.dart';
-import 'mock_compiler.dart';
-
-const String TEST = r"main() {}";
-
-main() {
- Uri uri = new Uri(scheme: 'source');
- MockCompiler compiler =
- new MockCompiler.internal(librariesOverride: (_) => '');
- asyncTest(() => compiler.run(uri));
-}
diff --git a/tests/compiler/dart2js/old_frontend/compiler_test.dart b/tests/compiler/dart2js/old_frontend/compiler_test.dart
deleted file mode 100644
index 82db42a..0000000
--- a/tests/compiler/dart2js/old_frontend/compiler_test.dart
+++ /dev/null
@@ -1,36 +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:async";
-
-import "package:async_helper/async_helper.dart";
-import 'package:compiler/compiler.dart';
-import "package:compiler/src/elements/elements.dart";
-import "package:compiler/src/old_to_new_api.dart";
-import "package:expect/expect.dart";
-
-import "mock_compiler.dart";
-
-Future testErrorHandling() {
- // Test that compiler.currentElement is set correctly when
- // reporting errors/warnings.
- MockCompiler compiler = new MockCompiler.internal();
- return compiler.init().then((_) {
- compiler.parseScript('NoSuchPrefix.NoSuchType foo() {}');
- LibraryElement mainApp = compiler.mainApp;
- FunctionElement foo = mainApp.find('foo');
- compiler.diagnosticHandler = new LegacyCompilerDiagnostics(
- (Uri uri, int begin, int end, String message, Diagnostic kind) {
- if (kind == Diagnostic.WARNING) {
- Expect.equals(foo, compiler.currentElement);
- }
- });
- foo.computeType(compiler.resolution);
- Expect.equals(1, compiler.diagnosticCollector.warnings.length);
- });
-}
-
-main() {
- asyncTest(() => testErrorHandling());
-}
diff --git a/tests/compiler/dart2js/old_frontend/data/one_line_dart_program.dart b/tests/compiler/dart2js/old_frontend/data/one_line_dart_program.dart
deleted file mode 100644
index 24a0c96..0000000
--- a/tests/compiler/dart2js/old_frontend/data/one_line_dart_program.dart
+++ /dev/null
@@ -1 +0,0 @@
-String main() => 499
\ No newline at end of file
diff --git a/tests/compiler/dart2js/old_frontend/diagnose_ambiguous_test.dart b/tests/compiler/dart2js/old_frontend/diagnose_ambiguous_test.dart
deleted file mode 100644
index 6e8708b..0000000
--- a/tests/compiler/dart2js/old_frontend/diagnose_ambiguous_test.dart
+++ /dev/null
@@ -1,71 +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:async_helper/async_helper.dart';
-import 'package:compiler/src/commandline_options.dart';
-import 'package:compiler/compiler_new.dart' show Diagnostic;
-import 'package:expect/expect.dart';
-import '../memory_compiler.dart';
-
-void main() {
- DiagnosticCollector collector = new DiagnosticCollector();
- asyncTest(() async {
- CompilationResult result = await runCompiler(
- memorySourceFiles: MEMORY_SOURCE_FILES,
- diagnosticHandler: collector,
- options: ['--analyze-all', Flags.useOldFrontend]);
-
- List<String> diagnostics = <String>[];
- collector.messages.forEach((CollectedMessage message) {
- if (message.kind == Diagnostic.VERBOSE_INFO) return;
- diagnostics.add(message.toString());
- });
- diagnostics.sort();
- var expected = [
- "MessageKind.AMBIGUOUS_LOCATION:"
- "memory:exporter.dart:43:49:'hest' is defined here.:info",
- "MessageKind.AMBIGUOUS_LOCATION:"
- "memory:library.dart:41:47:'hest' is defined here.:info",
- "MessageKind.DUPLICATE_IMPORT:"
- "memory:main.dart:86:92:Duplicate import of 'hest'.:warning",
- "MessageKind.IMPORTED_HERE:"
- "memory:main.dart:0:22:'hest' is imported here.:info",
- "MessageKind.IMPORTED_HERE:"
- "memory:main.dart:23:46:'hest' is imported here.:info",
- ];
- print(">>\n$diagnostics\n<<");
- Expect.listEquals(expected, diagnostics);
- Expect.isTrue(result.isSuccess);
- });
-}
-
-const Map MEMORY_SOURCE_FILES = const {
- 'main.dart': """
-import 'library.dart';
-import 'exporter.dart';
-
-main() {
- Fisk x = null;
- fisk();
- hest();
-}
-""",
- 'library.dart': """
-library lib;
-
-class Fisk {
-}
-
-fisk() {}
-
-hest() {}
-""",
- 'exporter.dart': """
-library exporter;
-
-export 'library.dart';
-
-hest() {}
-""",
-};
diff --git a/tests/compiler/dart2js/old_frontend/duplicate_library_test.dart b/tests/compiler/dart2js/old_frontend/duplicate_library_test.dart
deleted file mode 100644
index ea030a3..0000000
--- a/tests/compiler/dart2js/old_frontend/duplicate_library_test.dart
+++ /dev/null
@@ -1,154 +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 duplicate library names result in different messages depending
-// on whether the libraries are based on the same resource.
-
-import 'dart:async';
-import 'package:async_helper/async_helper.dart';
-import 'package:expect/expect.dart';
-import 'package:compiler/src/commandline_options.dart';
-import 'package:compiler/src/diagnostics/messages.dart' show MessageKind;
-import '../memory_compiler.dart';
-
-void check(String kind, Iterable<CollectedMessage> messages,
- List<MessageKind> expectedMessageKinds) {
- Expect.equals(expectedMessageKinds.length, messages.length,
- "Unexpected $kind count: $messages");
- int i = 0;
- messages.forEach((CollectedMessage message) {
- Expect.equals(expectedMessageKinds[i++], message.messageKind);
- });
-}
-
-Future test(Map<String, String> source,
- {List<MessageKind> warnings: const <MessageKind>[],
- List<MessageKind> hints: const <MessageKind>[]}) async {
- DiagnosticCollector collector = new DiagnosticCollector();
- await runCompiler(
- memorySourceFiles: source,
- diagnosticHandler: collector,
- showDiagnostics: true,
- options: [Flags.analyzeOnly, Flags.analyzeAll, Flags.useOldFrontend],
- packageRoot: Uri.parse('memory:pkg/'));
-
- Expect.isTrue(collector.errors.isEmpty);
- check('warning', collector.warnings, warnings);
- check('hint', collector.hints, hints);
- Expect.isTrue(collector.infos.isEmpty);
-}
-
-void main() {
- asyncTest(runTests);
-}
-
-Future runTests() async {
- await test({
- 'main.dart': """
-library main;
-
-import 'package:lib/foo.dart';
-import 'pkg/lib/foo.dart';
-""",
- 'pkg/lib/foo.dart': """
-library lib.foo;
-"""
- }, warnings: [
- MessageKind.DUPLICATED_LIBRARY_RESOURCE
- ], hints: []);
-
- await test({
- 'main.dart': """
-library main;
-
-import 'package:lib/bar.dart';
-import 'pkg/foo.dart';
-""",
- 'pkg/foo.dart': """
-library foo;
-
-import 'lib/bar.dart';
-""",
- 'pkg/lib/bar.dart': """
-library lib.bar;
-"""
- }, warnings: [
- MessageKind.DUPLICATED_LIBRARY_RESOURCE
- ], hints: []);
-
- await test({
- 'main.dart': """
-library main;
-
-import 'foo.dart';
-import 'pkg/lib/baz.dart';
-""",
- 'foo.dart': """
-library foo;
-
-import 'package:lib/baz.dart';
-""",
- 'pkg/lib/baz.dart': """
-library lib.baz;
-"""
- }, warnings: [
- MessageKind.DUPLICATED_LIBRARY_RESOURCE
- ], hints: []);
-
- await test({
- 'main.dart': """
-library main;
-
-import 'foo.dart';
-import 'pkg/bar.dart';
-""",
- 'foo.dart': """
-library foo;
-
-import 'package:lib/boz.dart';
-""",
- 'pkg/bar.dart': """
-library bar;
-
-import 'lib/boz.dart';
-""",
- 'pkg/lib/boz.dart': """
-library lib.boz;
-"""
- }, warnings: [
- MessageKind.DUPLICATED_LIBRARY_RESOURCE
- ], hints: []);
-
- await test({
- 'main.dart': """
-library main;
-
-import 'package:lib/qux.dart';
-import 'pkg/lib/qux.dart';
-""",
- 'pkg/lib/qux.dart': """
-// No library tag.
-"""
- }, hints: [
- MessageKind.DUPLICATED_RESOURCE,
- ]);
-
- await test({
- 'main.dart': """
-library main;
-
-import 'foo.dart';
-import 'bar.dart';
-""",
- 'foo.dart': """
-library lib;
-""",
- 'bar.dart': """
-library lib;
-"""
- }, warnings: [
- MessageKind.DUPLICATED_LIBRARY_NAME,
- MessageKind.DUPLICATED_LIBRARY_NAME
- ], hints: []);
-}
diff --git a/tests/compiler/dart2js/old_frontend/embedded_category_api_boundary_test.dart b/tests/compiler/dart2js/old_frontend/embedded_category_api_boundary_test.dart
deleted file mode 100644
index 8fcf124..0000000
--- a/tests/compiler/dart2js/old_frontend/embedded_category_api_boundary_test.dart
+++ /dev/null
@@ -1,51 +0,0 @@
-// Copyright (c) 2015, the Fletch 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.md file.
-
-/// Tests that analyzing everything from the libraries that are public from the
-/// embedded category does not cause elements from other libraries to be
-/// processed.
-library embedded_category_boundary_test;
-
-import 'package:async_helper/async_helper.dart';
-import 'package:compiler/src/compiler.dart';
-import 'package:compiler/src/elements/elements.dart';
-import 'package:sdk_library_metadata/libraries.dart';
-
-import 'analyze_helper.dart';
-
-main() async {
- List<Uri> uriList = new List<Uri>();
- libraries.forEach((String name, LibraryInfo info) {
- if (info.categories.contains(Category.embedded)) {
- uriList.add(new Uri(scheme: 'dart', path: name));
- }
- });
- asyncTest(() async {
- await analyze(uriList, {},
- checkResults: checkResults, mode: AnalysisMode.MAIN);
- });
-}
-
-/// These elements are currently escaping from dart:async via
-/// `core._Resource#_readAsStream`.
-Set<String> whiteList = new Set.from([
- "function(StreamController#addError)",
- "getter(StreamController#stream)",
- "setter(StreamController#onListen)"
-]);
-
-bool checkResults(Compiler compiler, CollectingDiagnosticHandler handler) {
- return compiler.enqueuer.resolution.processedEntities.every((_element) {
- MemberElement element = _element;
- if (whiteList.contains("$element")) return true;
- LibraryInfo info = libraries[element.library.canonicalUri.path];
- bool isAllowedInEmbedded =
- info.isInternal || info.categories.contains(Category.embedded);
- if (!isAllowedInEmbedded) {
- print(
- 'Disallowed element: $element from ${element.library.canonicalUri}');
- }
- return isAllowedInEmbedded;
- });
-}
diff --git a/tests/compiler/dart2js/old_frontend/erroneous_element_test.dart b/tests/compiler/dart2js/old_frontend/erroneous_element_test.dart
deleted file mode 100644
index 0fee336..0000000
--- a/tests/compiler/dart2js/old_frontend/erroneous_element_test.dart
+++ /dev/null
@@ -1,15 +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 'package:compiler/src/diagnostics/messages.dart' show MessageKind;
-import 'package:compiler/src/elements/elements.dart';
-import 'package:compiler/src/elements/modelx.dart' show ErroneousElementX;
-
-void main() {
- ErroneousElement e = new ErroneousElementX(
- MessageKind.GENERIC, {'text': 'error'}, 'foo', null);
- Expect.stringEquals('<foo: error>', '$e');
-}
diff --git a/tests/compiler/dart2js/old_frontend/error_token_test.dart b/tests/compiler/dart2js/old_frontend/error_token_test.dart
deleted file mode 100644
index fb0854e..0000000
--- a/tests/compiler/dart2js/old_frontend/error_token_test.dart
+++ /dev/null
@@ -1,54 +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.
-
-// Test that we don't report invalid modifier on error tokens.
-
-library dart2js.test.error_token;
-
-import 'dart:async';
-import 'package:async_helper/async_helper.dart';
-import 'package:compiler/src/commandline_options.dart';
-import "package:compiler/src/diagnostics/messages.dart";
-import 'package:expect/expect.dart';
-import '../memory_compiler.dart';
-
-Future runTest(String code,
- {MessageKind error, int expectedWarningCount: 0}) async {
- DiagnosticCollector diagnostics = new DiagnosticCollector();
- OutputCollector output = new OutputCollector();
- await runCompiler(
- entryPoint: Uri.parse('memory:main.dart'),
- memorySourceFiles: {'main.dart': code},
- diagnosticHandler: diagnostics,
- outputProvider: output,
- options: [Flags.useOldFrontend]);
-
- Expect.equals(error != null ? 1 : 0, diagnostics.errors.length);
- if (error != null)
- Expect.equals(error, diagnostics.errors.first.message.kind);
- Expect.equals(expectedWarningCount, diagnostics.warnings.length);
- Expect.equals(0, diagnostics.hints.length);
- Expect.equals(0, diagnostics.infos.length);
-}
-
-void main() {
- asyncTest(() async {
- await runTest('''
-main() {Foo.bar();}
-class Foo {
- static void bar() {
- baz());
- }
-}
-''', error: MessageKind.MISSING_TOKEN_AFTER_THIS, expectedWarningCount: 1);
-
- await runTest('''
-main() {new C(v);}
-class C {
- C(v) {
- throw '');
- }
-}''', error: MessageKind.MISSING_TOKEN_AFTER_THIS, expectedWarningCount: 1);
- });
-}
diff --git a/tests/compiler/dart2js/old_frontend/find_my_name_test.dart b/tests/compiler/dart2js/old_frontend/find_my_name_test.dart
deleted file mode 100644
index 72063ed..0000000
--- a/tests/compiler/dart2js/old_frontend/find_my_name_test.dart
+++ /dev/null
@@ -1,49 +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 "package:async_helper/async_helper.dart";
-import "package:compiler/src/elements/elements.dart";
-import 'package:compiler/src/elements/entity_utils.dart' as utils;
-import "mock_compiler.dart";
-import "parser_helper.dart";
-import 'package:compiler/src/elements/modelx.dart';
-
-String TEST_0 = '''
-class Foo {
- Foo();
- Foo.named();
- factory Foo._internal() => null;
- operator+(other) => null;
-}
-''';
-
-String TEST_1 = '''
-class Bar {
- const Bar();
- const Bar.named();
- Map<int, List<int>> baz() => null;
-}
-''';
-
-main() {
- asyncTest(() => MockCompiler.create((MockCompiler compiler) {
- testClass(TEST_0, compiler);
- testClass(TEST_1, compiler);
- }));
-}
-
-testClass(String code, MockCompiler compiler) {
- int skip = code.indexOf('{');
- ClassElementX cls = parseUnit(code, compiler, compiler.mainApp).head;
- cls.parseNode(compiler.parsingContext);
- cls.forEachLocalMember((Element e) {
- String name = e.name;
- if (e.isConstructor) {
- ConstructorElement c = e;
- name = utils.reconstructConstructorName(c).replaceFirst(r'$', '.');
- }
- Expect.equals(code.indexOf(name, skip), e.position.charOffset);
- });
-}
diff --git a/tests/compiler/dart2js/old_frontend/flatten_test.dart b/tests/compiler/dart2js/old_frontend/flatten_test.dart
deleted file mode 100644
index 5e08375..0000000
--- a/tests/compiler/dart2js/old_frontend/flatten_test.dart
+++ /dev/null
@@ -1,83 +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.
-
-library flatten_test;
-
-import 'package:expect/expect.dart';
-import "package:async_helper/async_helper.dart";
-import '../type_test_helper.dart';
-import 'package:compiler/src/elements/resolution_types.dart';
-import "package:compiler/src/elements/elements.dart" show ClassElement;
-
-void main() {
- asyncTest(() => TypeEnvironment.create(r"""
- abstract class F<T> implements Future<T> {}
- abstract class G<T> implements Future<G<T>> {}
- abstract class H<T> implements Future<H<H<T>>> {}
- """).then((env) {
- void check(
- ResolutionDartType T, ResolutionDartType expectedFlattenedType) {
- ResolutionDartType flattenedType = env.flatten(T);
- Expect.equals(
- expectedFlattenedType,
- flattenedType,
- "Unexpected flattening of '$T' = '$flattenedType',"
- "expected '$expectedFlattenedType'.");
- }
-
- ClassElement Future_ = env.getElement('Future');
- ClassElement F = env.getElement('F');
- ClassElement G = env.getElement('G');
- ClassElement H = env.getElement('H');
- ResolutionDartType int_ = env['int'];
- ResolutionDartType dynamic_ = env['dynamic'];
- ResolutionDartType Future_int = instantiate(Future_, [int_]);
- ResolutionDartType F_int = instantiate(F, [int_]);
- ResolutionDartType G_int = instantiate(G, [int_]);
- ResolutionDartType H_int = instantiate(H, [int_]);
- ResolutionDartType H_H_int = instantiate(H, [H_int]);
-
- // flatten(int) = int
- check(int_, int_);
-
- // flatten(Future) = dynamic
- check(Future_.rawType, dynamic_);
-
- // flatten(Future<int>) = int
- check(Future_int, int_);
-
- // flatten(Future<Future<int>>) = int
- check(instantiate(Future_, [Future_int]), int_);
-
- // flatten(F) = dynamic
- check(F.rawType, dynamic_);
-
- // flatten(F<int>) = int
- check(F_int, int_);
-
- // flatten(F<Future<int>>) = Future<int>
- check(instantiate(F, [Future_int]), Future_int);
-
- // flatten(G) = G
- check(G.rawType, G.rawType);
-
- // flatten(G<int>) = G<int>
- check(G_int, G_int);
-
- // flatten(H) = H<H>
- check(H.rawType, instantiate(H, [H.rawType]));
-
- // flatten(H<int>) = H<H<int>>
- check(H_int, H_H_int);
-
- // flatten(Future<F<int>>) = int
- check(instantiate(Future_, [F_int]), int_);
-
- // flatten(Future<G<int>>) = int
- check(instantiate(Future_, [G_int]), G_int);
-
- // flatten(Future<H<int>>) = int
- check(instantiate(Future_, [H_int]), H_H_int);
- }));
-}
diff --git a/tests/compiler/dart2js/old_frontend/frontend_checker.dart b/tests/compiler/dart2js/old_frontend/frontend_checker.dart
deleted file mode 100644
index 7fc1552..0000000
--- a/tests/compiler/dart2js/old_frontend/frontend_checker.dart
+++ /dev/null
@@ -1,110 +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.
-
-// Checks that dart2js produces the expected static type warnings and
-// compile-time errors for the provided multitests.
-
-import 'dart:async';
-import 'dart:io';
-
-import 'package:async_helper/async_helper.dart';
-import 'package:compiler/src/commandline_options.dart';
-import 'package:compiler/src/util/uri_extras.dart' show relativize;
-import '../memory_compiler.dart';
-
-import '../../../../tools/testing/dart/multitest.dart'
- show extractTestsFromMultitest;
-import '../../../../tools/testing/dart/path.dart' show Path;
-
-/// Check the analysis of the multitests in [testFiles] to result in the
-/// expected static warnings and compile-time errors.
-///
-/// [testFiles] is a map of the test files to be checked together with their
-/// associated white listing.
-///
-/// For instance if [testFiles] contain the mapping
-/// 'language/async_await_syntax_test.dart': const ['a03b', 'a04b']
-/// the multitests in 'language/async_await_syntax_test.dart' are checked but
-/// the subtests 'a03b' and 'a04c' are expected to fail.
-void check(Map<String, List<String>> testFiles,
- {List<String> arguments: const <String>[],
- List<String> options: const <String>[]}) {
- bool outcomeMismatch = false;
- bool verbose = arguments.contains('-v');
- var cachedCompiler;
- asyncTest(() => Future.forEach(testFiles.keys, (String testFile) {
- Map<String, String> testSources = {};
- Map<String, Set<String>> testOutcomes = {};
- String fileName = 'tests/$testFile';
- extractTestsFromMultitest(
- new Path(fileName), testSources, testOutcomes);
- return Future.forEach(testSources.keys, (String testName) async {
- String testFileName = '$fileName/$testName';
- Set<String> expectedOutcome = testOutcomes[testName];
- bool expectFailure = testFiles[testFile].contains(testName);
- DiagnosticCollector collector = new DiagnosticCollector();
- CompilationResult result = await runCompiler(
- entryPoint: Uri.parse('memory:$testFileName'),
- memorySourceFiles: {testFileName: testSources[testName]},
- diagnosticHandler: collector,
- options: [Flags.analyzeOnly, Flags.useOldFrontend]
- ..addAll(options),
- showDiagnostics: verbose,
- cachedCompiler: cachedCompiler);
- var compiler = result.compiler;
- bool unexpectedResult = false;
- if (expectedOutcome.contains('compile-time error') ||
- expectedOutcome.contains('syntax error')) {
- if (collector.errors.isEmpty) {
- print('$testFileName: Missing compile-time error.');
- unexpectedResult = true;
- }
- } else if (expectedOutcome.contains('static type warning')) {
- if (collector.warnings.isEmpty) {
- print('$testFileName: Missing static type warning.');
- unexpectedResult = true;
- }
- } else {
- // Expect ok.
- if (!collector.errors.isEmpty || !collector.warnings.isEmpty) {
- collector.errors.forEach((message) {
- print('$testFileName: Unexpected error: ${message.message}');
- });
- collector.warnings.forEach((message) {
- print('$testFileName: Unexpected warning: ${message.message}');
- });
- unexpectedResult = true;
- }
- }
- if (expectFailure) {
- if (unexpectedResult) {
- unexpectedResult = false;
- } else {
- print('$testFileName: The test is white-listed '
- 'and therefore expected to fail.');
- unexpectedResult = true;
- }
- }
- if (unexpectedResult) {
- outcomeMismatch = true;
- }
- cachedCompiler = compiler;
- });
- }).then((_) {
- if (outcomeMismatch) {
- String testFileName =
- relativize(Uri.base, Platform.script, Platform.isWindows);
- print('''
-
-===
-=== ERROR: Unexpected result of analysis.
-===
-=== Please update the white-listing in $testFileName
-===
-
-''');
- exit(1);
- }
- }));
-}
diff --git a/tests/compiler/dart2js/old_frontend/generic_method_type_usage_test.dart b/tests/compiler/dart2js/old_frontend/generic_method_type_usage_test.dart
deleted file mode 100644
index 7d352c0..0000000
--- a/tests/compiler/dart2js/old_frontend/generic_method_type_usage_test.dart
+++ /dev/null
@@ -1,127 +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.
-
-/// Dart test verifying that method type variables are considered to denote
-/// the type `dynamic`.
-///
-/// NB: This test is intended to succeed with a `dart2js` with the option
-/// '--generic-method-syntax', but it should fail with a full implementation
-/// of generic method support, and it should fail with every other tool than
-/// `dart2js`.
-
-library dart2js.test.generic_method_type_usage;
-
-import 'dart:async';
-import 'package:async_helper/async_helper.dart';
-import 'package:compiler/src/commandline_options.dart';
-import "package:compiler/src/diagnostics/messages.dart";
-import 'package:expect/expect.dart';
-import '../memory_compiler.dart';
-
-const MEMORY_SOURCE_FILES = const {
- 'type_variable_is_dynamic.dart': '''
-class C {
- bool aMethod<X>(X x) {
- // `dynamic` is assignable to both `int` and `String`: no warnings.
- int i = x;
- String s = x;
- try {
- // Only `dynamic` allows unknown member lookup without a warning.
- var y = x.undefinedMember;
- } on NoSuchMethodError catch (_) {
- return true;
- }
- return false;
- }
-}
-
-bool aFunction<X>(X x) {
- // `dynamic` is assignable to both `int` and `String`: no warnings.
- int i = x;
- String s = x;
- try {
- // Only `dynamic` allows unknown member lookup without a warning.
- var y = x.undefinedMember;
- } on NoSuchMethodError catch (_) {
- return true;
- }
- return false;
-}
-
-main() {
- print(new C().aMethod<Set>(null));
- print(aFunction<Set>(null));
-}
-''',
- 'cannot_new_method_type_variable.dart': '''
-class C {
- X aMethod<X>() => new X();
-}
-
-main() {
- new C().aMethod<Set>();
-}
-''',
- 'cannot_new_function_type_variable.dart': '''
-X aFunction<X>() => new X(42);
-
-main() {
- aFunction<Set>();
-}
-''',
- 'dynamic_as_type_argument.dart': '''
-main() {
- method<dynamic>();
-}
-method<T>() {}
-''',
- 'malformed_type_argument.dart': '''
-main() {
- method<Unresolved>();
-}
-method<T>() {}
-''',
-};
-
-Future runTest(Uri main, {MessageKind warning, MessageKind info}) async {
- print("----\nentry-point: $main\n");
-
- DiagnosticCollector diagnostics = new DiagnosticCollector();
- OutputCollector output = new OutputCollector();
- await runCompiler(
- entryPoint: main,
- options: const <String>["--generic-method-syntax", Flags.useOldFrontend],
- memorySourceFiles: MEMORY_SOURCE_FILES,
- diagnosticHandler: diagnostics,
- outputProvider: output);
-
- Expect.isFalse(output.hasExtraOutput);
- Expect.equals(0, diagnostics.errors.length, "Unexpected errors.");
- Expect.equals(warning != null ? 1 : 0, diagnostics.warnings.length);
- if (warning != null) {
- Expect.equals(warning, diagnostics.warnings.first.message.kind);
- }
- Expect.equals(info != null ? 1 : 0, diagnostics.infos.length);
- if (info != null) {
- Expect.equals(info, diagnostics.infos.first.message.kind);
- }
- Expect.equals(0, diagnostics.hints.length);
-}
-
-void main() {
- asyncTest(() async {
- await runTest(Uri.parse('memory:type_variable_is_dynamic.dart'));
-
- await runTest(Uri.parse('memory:cannot_new_method_type_variable.dart'),
- warning: MessageKind.CANNOT_INSTANTIATE_TYPE_VARIABLE);
-
- await runTest(Uri.parse('memory:cannot_new_function_type_variable.dart'),
- warning: MessageKind.CANNOT_INSTANTIATE_TYPE_VARIABLE);
-
- await runTest(Uri.parse('memory:dynamic_as_type_argument.dart'));
-
- await runTest(Uri.parse('memory:malformed_type_argument.dart'),
- warning: MessageKind.CANNOT_RESOLVE_TYPE);
- });
-}
diff --git a/tests/compiler/dart2js/old_frontend/import_test.dart b/tests/compiler/dart2js/old_frontend/import_test.dart
deleted file mode 100644
index 59f5362..0000000
--- a/tests/compiler/dart2js/old_frontend/import_test.dart
+++ /dev/null
@@ -1,101 +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 the compiler can handle missing files used in imports, exports,
-// part tags or as the main source file.
-
-library dart2js.test.import;
-
-import 'package:async_helper/async_helper.dart';
-import 'package:compiler/src/commandline_options.dart';
-import 'package:compiler/src/diagnostics/messages.dart';
-import '../memory_compiler.dart';
-
-const MEMORY_SOURCE_FILES = const {
- 'main.dart': '''
-
-library main;
-
-import 'dart:thisLibraryShouldNotExist';
-import 'package:thisPackageShouldNotExist/thisPackageShouldNotExist.dart';
-export 'foo.dart';
-
-part 'bar.dart';
-
-main() {
- int i = "";
-}
-''',
- 'part.dart': '''
-part of lib;
-
-main() {}
-''',
- 'lib.dart': '''
-library lib;
-
-import 'part.dart';
-
-part 'part.dart';
-''',
-};
-
-testEntryPointIsPart() async {
- var collector = new DiagnosticCollector();
- await runCompiler(
- entryPoint: Uri.parse('memory:part.dart'),
- memorySourceFiles: MEMORY_SOURCE_FILES,
- diagnosticHandler: collector,
- options: [Flags.useOldFrontend]);
-
- collector.checkMessages([const Expected.error(MessageKind.MAIN_HAS_PART_OF)]);
-}
-
-testImportPart() async {
- var collector = new DiagnosticCollector();
- await runCompiler(
- entryPoint: Uri.parse('memory:lib.dart'),
- memorySourceFiles: MEMORY_SOURCE_FILES,
- diagnosticHandler: collector,
- options: [Flags.useOldFrontend]);
-
- collector.checkMessages([
- const Expected.error(MessageKind.IMPORT_PART_OF),
- const Expected.info(MessageKind.IMPORT_PART_OF_HERE)
- ]);
-}
-
-testMissingImports() async {
- var collector = new DiagnosticCollector();
- await runCompiler(
- memorySourceFiles: MEMORY_SOURCE_FILES,
- diagnosticHandler: collector,
- options: [Flags.useOldFrontend]);
-
- collector.checkMessages([
- const Expected.error(MessageKind.READ_URI_ERROR),
- const Expected.error(MessageKind.LIBRARY_NOT_FOUND),
- const Expected.error(MessageKind.LIBRARY_NOT_FOUND),
- const Expected.error(MessageKind.READ_URI_ERROR),
- const Expected.warning(MessageKind.NOT_ASSIGNABLE)
- ]);
-}
-
-testMissingMain() async {
- var collector = new DiagnosticCollector();
- await runCompiler(
- entryPoint: Uri.parse('memory:missing.dart'),
- diagnosticHandler: collector,
- options: [Flags.useOldFrontend]);
- collector.checkMessages([const Expected.error(MessageKind.READ_SELF_ERROR)]);
-}
-
-void main() {
- asyncTest(() async {
- await testEntryPointIsPart();
- await testImportPart();
- await testMissingImports();
- await testMissingMain();
- });
-}
diff --git a/tests/compiler/dart2js/old_frontend/least_upper_bound_language_test.dart b/tests/compiler/dart2js/old_frontend/least_upper_bound_language_test.dart
deleted file mode 100644
index 53d5900..0000000
--- a/tests/compiler/dart2js/old_frontend/least_upper_bound_language_test.dart
+++ /dev/null
@@ -1,22 +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 dart2js produces the expected static type warnings for least upper
-// bound language tests. This ensures that the analyzer and dart2js agrees
-// on these tests.
-
-import 'warnings_checker.dart';
-
-/// Map from test files to a map of their expected status. If the status map is
-/// `null` no warnings must be missing or unexpected, otherwise the status map
-/// can contain a list of line numbers for keys 'missing' and 'unexpected' for
-/// the warnings of each category.
-const Map<String, dynamic> TESTS = const {
- 'language/least_upper_bound_test.dart': null,
- 'language/least_upper_bound_expansive_test.dart': null,
-};
-
-void main() {
- checkWarnings(TESTS);
-}
diff --git a/tests/compiler/dart2js/old_frontend/least_upper_bound_test.dart b/tests/compiler/dart2js/old_frontend/least_upper_bound_test.dart
deleted file mode 100644
index bb2f12d..0000000
--- a/tests/compiler/dart2js/old_frontend/least_upper_bound_test.dart
+++ /dev/null
@@ -1,851 +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.
-
-library least_upper_bound_test;
-
-import 'package:expect/expect.dart';
-import 'package:async_helper/async_helper.dart';
-import 'package:compiler/src/elements/resolution_types.dart';
-import 'package:compiler/src/elements/elements.dart' show ClassElement;
-
-import '../type_test_helper.dart';
-
-void main() {
- testInterface1();
- testInterface2();
- testGeneric();
- testMixin();
- testFunction();
- testTypeVariable();
-}
-
-void testInterface1() {
- asyncTest(() => TypeEnvironment.create(r"""
- class A {} // A and B have equal depth.
- class B {}
- class I implements A, B {}
- class J implements A, B {}
- """).then((env) {
- ResolutionDartType Object_ = env['Object'];
- ResolutionDartType A = env['A'];
- ResolutionDartType B = env['B'];
- ResolutionDartType I = env['I'];
- ResolutionDartType J = env['J'];
-
- checkLub(ResolutionDartType a, ResolutionDartType b,
- ResolutionDartType expect) {
- ResolutionDartType lub = env.computeLeastUpperBound(a, b);
- Expect.equals(
- expect, lub, 'Unexpected lub($a,$b) = $lub, expected $expect.');
- }
-
- checkLub(Object_, Object_, Object_);
- checkLub(Object_, A, Object_);
- checkLub(Object_, B, Object_);
- checkLub(Object_, I, Object_);
- checkLub(Object_, J, Object_);
-
- checkLub(A, Object_, Object_);
- checkLub(A, A, A);
- checkLub(A, B, Object_);
- checkLub(A, I, A);
- checkLub(A, J, A);
-
- checkLub(B, Object_, Object_);
- checkLub(B, A, Object_);
- checkLub(B, B, B);
- checkLub(B, I, B);
- checkLub(B, J, B);
-
- checkLub(I, Object_, Object_);
- checkLub(I, A, A);
- checkLub(I, B, B);
- checkLub(I, I, I);
- checkLub(I, J, Object_);
-
- checkLub(J, Object_, Object_);
- checkLub(J, A, A);
- checkLub(J, B, B);
- checkLub(J, I, Object_);
- checkLub(J, J, J);
- }));
-}
-
-void testInterface2() {
- asyncTest(() => TypeEnvironment.create(r"""
- class A {}
- class B {}
- class C extends B {} // This makes C have higher depth than A.
- class I implements A, C {}
- class J implements A, C {}
- """).then((env) {
- ResolutionDartType Object_ = env['Object'];
- ResolutionDartType A = env['A'];
- ResolutionDartType B = env['B'];
- ResolutionDartType C = env['C'];
- ResolutionDartType I = env['I'];
- ResolutionDartType J = env['J'];
-
- checkLub(ResolutionDartType a, ResolutionDartType b,
- ResolutionDartType expectedLub) {
- ResolutionDartType lub = env.computeLeastUpperBound(a, b);
- Expect.equals(expectedLub, lub,
- 'Unexpected lub($a,$b) = $lub, expected $expectedLub');
- }
-
- checkLub(Object_, Object_, Object_);
- checkLub(Object_, A, Object_);
- checkLub(Object_, B, Object_);
- checkLub(Object_, C, Object_);
- checkLub(Object_, I, Object_);
- checkLub(Object_, J, Object_);
-
- checkLub(A, Object_, Object_);
- checkLub(A, A, A);
- checkLub(A, B, Object_);
- checkLub(A, C, Object_);
- checkLub(A, I, A);
- checkLub(A, J, A);
-
- checkLub(B, Object_, Object_);
- checkLub(B, A, Object_);
- checkLub(B, B, B);
- checkLub(B, C, B);
- checkLub(B, I, B);
- checkLub(B, J, B);
-
- checkLub(C, Object_, Object_);
- checkLub(C, A, Object_);
- checkLub(C, B, B);
- checkLub(C, C, C);
- checkLub(C, I, C);
- checkLub(C, J, C);
-
- checkLub(I, Object_, Object_);
- checkLub(I, A, A);
- checkLub(I, B, B);
- checkLub(I, C, C);
- checkLub(I, I, I);
- checkLub(I, J, C);
-
- checkLub(J, Object_, Object_);
- checkLub(J, A, A);
- checkLub(J, B, B);
- checkLub(J, C, C);
- checkLub(J, I, C);
- checkLub(J, J, J);
- }));
-}
-
-void testGeneric() {
- asyncTest(() => TypeEnvironment.create(r"""
- class A {}
- class B {}
- class C extends B {}
- class I<T> {}
- """).then((env) {
- ResolutionDartType Object_ = env['Object'];
- ResolutionDartType A = env['A'];
- ResolutionDartType B = env['B'];
- ResolutionDartType C = env['C'];
- ClassElement I = env.getElement('I');
- ResolutionDartType I_A = instantiate(I, [A]);
- ResolutionDartType I_B = instantiate(I, [B]);
- ResolutionDartType I_C = instantiate(I, [C]);
-
- checkLub(ResolutionDartType a, ResolutionDartType b,
- ResolutionDartType expectedLub) {
- ResolutionDartType lub = env.computeLeastUpperBound(a, b);
- Expect.equals(expectedLub, lub,
- 'Unexpected lub($a,$b) = $lub, expected $expectedLub');
- }
-
- checkLub(Object_, Object_, Object_);
- checkLub(Object_, A, Object_);
- checkLub(Object_, B, Object_);
- checkLub(Object_, C, Object_);
- checkLub(Object_, I_A, Object_);
- checkLub(Object_, I_B, Object_);
- checkLub(Object_, I_C, Object_);
-
- checkLub(A, Object_, Object_);
- checkLub(A, A, A);
- checkLub(A, B, Object_);
- checkLub(A, C, Object_);
- checkLub(A, I_A, Object_);
- checkLub(A, I_B, Object_);
- checkLub(A, I_C, Object_);
-
- checkLub(B, Object_, Object_);
- checkLub(B, A, Object_);
- checkLub(B, B, B);
- checkLub(B, C, B);
- checkLub(B, I_A, Object_);
- checkLub(B, I_B, Object_);
- checkLub(B, I_C, Object_);
-
- checkLub(C, Object_, Object_);
- checkLub(C, A, Object_);
- checkLub(C, B, B);
- checkLub(C, C, C);
- checkLub(C, I_A, Object_);
- checkLub(C, I_B, Object_);
- checkLub(C, I_C, Object_);
-
- checkLub(I_A, Object_, Object_);
- checkLub(I_A, A, Object_);
- checkLub(I_A, B, Object_);
- checkLub(I_A, C, Object_);
- checkLub(I_A, I_A, I_A);
- checkLub(I_A, I_B, Object_);
- checkLub(I_A, I_C, Object_);
-
- checkLub(I_B, Object_, Object_);
- checkLub(I_B, A, Object_);
- checkLub(I_B, B, Object_);
- checkLub(I_B, C, Object_);
- checkLub(I_B, I_A, Object_);
- checkLub(I_B, I_B, I_B);
- checkLub(I_B, I_C, Object_);
-
- checkLub(I_C, Object_, Object_);
- checkLub(I_C, A, Object_);
- checkLub(I_C, B, Object_);
- checkLub(I_C, C, Object_);
- checkLub(I_C, I_A, Object_);
- checkLub(I_C, I_B, Object_);
- checkLub(I_C, I_C, I_C);
- }));
-}
-
-void testMixin() {
- asyncTest(() => TypeEnvironment.create(r"""
- class A {}
- class B {}
- class C extends B {}
- class D extends C {} // This makes D have higher depth than Object+A.
- class I extends Object with A, B implements A, D {}
- class I2 extends Object with A, B implements A, D {}
- class J extends Object with B, A implements A, D {}
- """).then((env) {
- ResolutionDartType Object_ = env['Object'];
- ResolutionDartType A = env['A'];
- ResolutionDartType B = env['B'];
- ResolutionDartType C = env['C'];
- ResolutionDartType D = env['D'];
- ResolutionDartType I = env['I'];
- ResolutionDartType I2 = env['I2'];
- ResolutionDartType J = env['J'];
-
- checkLub(ResolutionDartType a, ResolutionDartType b,
- ResolutionDartType expectedLub) {
- ResolutionDartType lub = env.computeLeastUpperBound(a, b);
- Expect.equals(expectedLub, lub,
- 'Unexpected lub($a,$b) = $lub, expected $expectedLub');
- }
-
- checkLub(Object_, Object_, Object_);
- checkLub(Object_, A, Object_);
- checkLub(Object_, B, Object_);
- checkLub(Object_, C, Object_);
- checkLub(Object_, D, Object_);
- checkLub(Object_, I, Object_);
- checkLub(Object_, I2, Object_);
- checkLub(Object_, J, Object_);
-
- checkLub(A, Object_, Object_);
- checkLub(A, A, A);
- checkLub(A, B, Object_);
- checkLub(A, C, Object_);
- checkLub(A, D, Object_);
- checkLub(A, I, A);
- checkLub(A, I2, A);
- checkLub(A, J, A);
-
- checkLub(B, Object_, Object_);
- checkLub(B, A, Object_);
- checkLub(B, B, B);
- checkLub(B, C, B);
- checkLub(B, D, B);
- checkLub(B, I, B);
- checkLub(B, I2, B);
- checkLub(B, J, B);
-
- checkLub(C, Object_, Object_);
- checkLub(C, A, Object_);
- checkLub(C, B, B);
- checkLub(C, C, C);
- checkLub(C, D, C);
- checkLub(C, I, C);
- checkLub(C, I2, C);
- checkLub(C, J, C);
-
- checkLub(D, Object_, Object_);
- checkLub(D, A, Object_);
- checkLub(D, B, B);
- checkLub(D, C, C);
- checkLub(D, D, D);
- checkLub(D, I, D);
- checkLub(D, I2, D);
- checkLub(D, J, D);
-
- checkLub(I, Object_, Object_);
- checkLub(I, A, A);
- checkLub(I, B, B);
- checkLub(I, C, C);
- checkLub(I, D, D);
- checkLub(I, I, I);
- checkLub(I, I2, D);
- checkLub(I, J, D);
-
- checkLub(I2, Object_, Object_);
- checkLub(I2, A, A);
- checkLub(I2, B, B);
- checkLub(I2, C, C);
- checkLub(I2, D, D);
- checkLub(I2, I, D);
- checkLub(I2, I2, I2);
- checkLub(I2, J, D);
-
- checkLub(J, Object_, Object_);
- checkLub(J, A, A);
- checkLub(J, B, B);
- checkLub(J, C, C);
- checkLub(J, D, D);
- checkLub(J, I, D);
- checkLub(J, I2, D);
- checkLub(J, J, J);
- }));
-}
-
-void testFunction() {
- asyncTest(() => TypeEnvironment.create(r"""
- class A {}
- class B {}
- class C extends B {}
-
- typedef dynamic__();
- typedef void void__();
- typedef A A__();
- typedef B B__();
- typedef C C__();
-
- typedef void void__A_B(A a, B b);
- typedef void void__A_C(A a, C b);
- typedef void void__B_A(B a, A b);
- typedef void void__B_C(B a, C b);
-
- typedef void void___B([B a]);
- typedef void void___B_C([B a, C b]);
- typedef void void___C_C([C a, C b]);
-
- typedef void void____B({B a});
- typedef void void____B_C({B a, C b});
- typedef void void____C_C({C a, C b});
- """).then((env) {
- ResolutionDartType Object_ = env['Object'];
- ResolutionDartType Function_ = env['Function'];
- ResolutionDartType dynamic__ = env['dynamic__'];
- ResolutionDartType void__ = env['void__'];
- ResolutionDartType A__ = env['A__'];
- ResolutionDartType B__ = env['B__'];
- ResolutionDartType C__ = env['C__'];
- ResolutionDartType void__A_B = env['void__A_B'];
- ResolutionDartType void__A_C = env['void__A_C'];
- ResolutionDartType void__B_A = env['void__B_A'];
- ResolutionDartType void__B_C = env['void__B_C'];
- ResolutionDartType void___B = env['void___B'];
- ResolutionDartType void___B_C = env['void___B_C'];
- ResolutionDartType void___C_C = env['void___C_C'];
- ResolutionDartType void____B = env['void____B'];
- ResolutionDartType void____B_C = env['void____B_C'];
- ResolutionDartType void____C_C = env['void____C_C'];
-
- // Types used only for checking results.
- ResolutionDartType void_ = env['void'];
- ResolutionDartType B = env['B'];
- ResolutionDartType C = env['C'];
- ResolutionFunctionType Object__ = env.functionType(Object_, []);
- ResolutionFunctionType void__Object_Object =
- env.functionType(void_, [Object_, Object_]);
- ResolutionFunctionType void__Object_B =
- env.functionType(void_, [Object_, B]);
- ResolutionFunctionType void__Object_C =
- env.functionType(void_, [Object_, C]);
- ResolutionFunctionType void__B_Object =
- env.functionType(void_, [B, Object_]);
-
- checkLub(ResolutionDartType a, ResolutionDartType b,
- ResolutionDartType expectedLub) {
- ResolutionDartType lub = env.computeLeastUpperBound(a, b);
- if (a != b) {
- expectedLub = expectedLub.unaliased;
- lub = lub.unaliased;
- }
- Expect.equals(
- expectedLub,
- lub,
- 'Unexpected lub(${a.unaliased},'
- '${b.unaliased} = '
- '${lub}, expected ${expectedLub}');
- }
-
- checkLub(Object_, Object_, Object_);
- checkLub(Object_, Function_, Object_);
- checkLub(Object_, dynamic__, Object_);
- checkLub(Object_, void__, Object_);
- checkLub(Object_, A__, Object_);
- checkLub(Object_, B__, Object_);
- checkLub(Object_, C__, Object_);
- checkLub(Object_, void__A_B, Object_);
- checkLub(Object_, void__A_C, Object_);
- checkLub(Object_, void__B_A, Object_);
- checkLub(Object_, void__B_C, Object_);
- checkLub(Object_, void___B, Object_);
- checkLub(Object_, void___B_C, Object_);
- checkLub(Object_, void___C_C, Object_);
- checkLub(Object_, void____B, Object_);
- checkLub(Object_, void____B_C, Object_);
- checkLub(Object_, void____C_C, Object_);
-
- checkLub(Function_, Object_, Object_);
- checkLub(Function_, Function_, Function_);
- checkLub(Function_, dynamic__, Function_);
- checkLub(Function_, void__, Function_);
- checkLub(Function_, A__, Function_);
- checkLub(Function_, B__, Function_);
- checkLub(Function_, C__, Function_);
- checkLub(Function_, void__A_B, Function_);
- checkLub(Function_, void__A_C, Function_);
- checkLub(Function_, void__B_A, Function_);
- checkLub(Function_, void__B_C, Function_);
- checkLub(Function_, void___B, Function_);
- checkLub(Function_, void___B_C, Function_);
- checkLub(Function_, void___C_C, Function_);
- checkLub(Function_, void____B, Function_);
- checkLub(Function_, void____B_C, Function_);
- checkLub(Function_, void____C_C, Function_);
-
- checkLub(dynamic__, Object_, Object_);
- checkLub(dynamic__, Function_, Function_);
- checkLub(dynamic__, dynamic__, dynamic__);
- checkLub(dynamic__, void__, dynamic__);
- checkLub(dynamic__, A__, dynamic__);
- checkLub(dynamic__, B__, dynamic__);
- checkLub(dynamic__, C__, dynamic__);
- checkLub(dynamic__, void__A_B, Function_);
- checkLub(dynamic__, void__A_C, Function_);
- checkLub(dynamic__, void__B_A, Function_);
- checkLub(dynamic__, void__B_C, Function_);
- checkLub(dynamic__, void___B, dynamic__);
- checkLub(dynamic__, void___B_C, dynamic__);
- checkLub(dynamic__, void___C_C, dynamic__);
- checkLub(dynamic__, void____B, dynamic__);
- checkLub(dynamic__, void____B_C, dynamic__);
- checkLub(dynamic__, void____C_C, dynamic__);
-
- checkLub(void__, Object_, Object_);
- checkLub(void__, Function_, Function_);
- checkLub(void__, dynamic__, dynamic__);
- checkLub(void__, void__, void__);
- checkLub(void__, A__, void__);
- checkLub(void__, B__, void__);
- checkLub(void__, C__, void__);
- checkLub(void__, void__A_B, Function_);
- checkLub(void__, void__A_C, Function_);
- checkLub(void__, void__B_A, Function_);
- checkLub(void__, void__B_C, Function_);
- checkLub(void__, void___B, void__);
- checkLub(void__, void___B_C, void__);
- checkLub(void__, void___C_C, void__);
- checkLub(void__, void____B, void__);
- checkLub(void__, void____B_C, void__);
- checkLub(void__, void____C_C, void__);
-
- checkLub(A__, Object_, Object_);
- checkLub(A__, Function_, Function_);
- checkLub(A__, dynamic__, dynamic__);
- checkLub(A__, void__, void__);
- checkLub(A__, A__, A__);
- checkLub(A__, B__, Object__);
- checkLub(A__, C__, Object__);
- checkLub(A__, void__A_B, Function_);
- checkLub(A__, void__A_C, Function_);
- checkLub(A__, void__B_A, Function_);
- checkLub(A__, void__B_C, Function_);
- checkLub(A__, void___B, void__);
- checkLub(A__, void___B_C, void__);
- checkLub(A__, void___C_C, void__);
- checkLub(A__, void____B, void__);
- checkLub(A__, void____B_C, void__);
- checkLub(A__, void____C_C, void__);
-
- checkLub(B__, Object_, Object_);
- checkLub(B__, Function_, Function_);
- checkLub(B__, dynamic__, dynamic__);
- checkLub(B__, void__, void__);
- checkLub(B__, A__, Object__);
- checkLub(B__, B__, B__);
- checkLub(B__, C__, B__);
- checkLub(B__, void__A_B, Function_);
- checkLub(B__, void__A_C, Function_);
- checkLub(B__, void__B_A, Function_);
- checkLub(B__, void__B_C, Function_);
- checkLub(B__, void___B, void__);
- checkLub(B__, void___B_C, void__);
- checkLub(B__, void___C_C, void__);
- checkLub(B__, void____B, void__);
- checkLub(B__, void____B_C, void__);
- checkLub(B__, void____C_C, void__);
-
- checkLub(C__, Object_, Object_);
- checkLub(C__, Function_, Function_);
- checkLub(C__, dynamic__, dynamic__);
- checkLub(C__, void__, void__);
- checkLub(C__, A__, Object__);
- checkLub(C__, B__, B__);
- checkLub(C__, C__, C__);
- checkLub(C__, void__A_B, Function_);
- checkLub(C__, void__A_C, Function_);
- checkLub(C__, void__B_A, Function_);
- checkLub(C__, void__B_C, Function_);
- checkLub(C__, void___B, void__);
- checkLub(C__, void___B_C, void__);
- checkLub(C__, void___C_C, void__);
- checkLub(C__, void____B, void__);
- checkLub(C__, void____B_C, void__);
- checkLub(C__, void____C_C, void__);
-
- checkLub(void__A_B, Object_, Object_);
- checkLub(void__A_B, Function_, Function_);
- checkLub(void__A_B, dynamic__, Function_);
- checkLub(void__A_B, void__, Function_);
- checkLub(void__A_B, A__, Function_);
- checkLub(void__A_B, B__, Function_);
- checkLub(void__A_B, C__, Function_);
- checkLub(void__A_B, void__A_B, void__A_B);
- checkLub(void__A_B, void__A_C, void__A_B);
- checkLub(void__A_B, void__B_A, void__Object_Object);
- checkLub(void__A_B, void__B_C, void__Object_B);
- checkLub(void__A_B, void___B, Function_);
- checkLub(void__A_B, void___B_C, Function_);
- checkLub(void__A_B, void___C_C, Function_);
- checkLub(void__A_B, void____B, Function_);
- checkLub(void__A_B, void____B_C, Function_);
- checkLub(void__A_B, void____C_C, Function_);
-
- checkLub(void__A_C, Object_, Object_);
- checkLub(void__A_C, Function_, Function_);
- checkLub(void__A_C, dynamic__, Function_);
- checkLub(void__A_C, void__, Function_);
- checkLub(void__A_C, A__, Function_);
- checkLub(void__A_C, B__, Function_);
- checkLub(void__A_C, C__, Function_);
- checkLub(void__A_C, void__A_B, void__A_B);
- checkLub(void__A_C, void__A_C, void__A_C);
- checkLub(void__A_C, void__B_A, void__Object_Object);
- checkLub(void__A_C, void__B_C, void__Object_C);
- checkLub(void__A_C, void___B, Function_);
- checkLub(void__A_C, void___B_C, Function_);
- checkLub(void__A_C, void___C_C, Function_);
- checkLub(void__A_C, void____B, Function_);
- checkLub(void__A_C, void____B_C, Function_);
- checkLub(void__A_C, void____C_C, Function_);
-
- checkLub(void__B_A, Object_, Object_);
- checkLub(void__B_A, Function_, Function_);
- checkLub(void__B_A, dynamic__, Function_);
- checkLub(void__B_A, void__, Function_);
- checkLub(void__B_A, A__, Function_);
- checkLub(void__B_A, B__, Function_);
- checkLub(void__B_A, C__, Function_);
- checkLub(void__B_A, void__A_B, void__Object_Object);
- checkLub(void__B_A, void__A_C, void__Object_Object);
- checkLub(void__B_A, void__B_A, void__B_A);
- checkLub(void__B_A, void__B_C, void__B_Object);
- checkLub(void__B_A, void___B, Function_);
- checkLub(void__B_A, void___B_C, Function_);
- checkLub(void__B_A, void___C_C, Function_);
- checkLub(void__B_A, void____B, Function_);
- checkLub(void__B_A, void____B_C, Function_);
- checkLub(void__B_A, void____C_C, Function_);
-
- checkLub(void__B_C, Object_, Object_);
- checkLub(void__B_C, Function_, Function_);
- checkLub(void__B_C, dynamic__, Function_);
- checkLub(void__B_C, void__, Function_);
- checkLub(void__B_C, A__, Function_);
- checkLub(void__B_C, B__, Function_);
- checkLub(void__B_C, C__, Function_);
- checkLub(void__B_C, void__A_B, void__Object_B);
- checkLub(void__B_C, void__A_C, void__Object_C);
- checkLub(void__B_C, void__B_A, void__B_Object);
- checkLub(void__B_C, void__B_C, void__B_C);
- checkLub(void__B_C, void___B, Function_);
- checkLub(void__B_C, void___B_C, Function_);
- checkLub(void__B_C, void___C_C, Function_);
- checkLub(void__B_C, void____B, Function_);
- checkLub(void__B_C, void____B_C, Function_);
- checkLub(void__B_C, void____C_C, Function_);
-
- checkLub(void___B, Object_, Object_);
- checkLub(void___B, Function_, Function_);
- checkLub(void___B, dynamic__, dynamic__);
- checkLub(void___B, void__, void__);
- checkLub(void___B, A__, void__);
- checkLub(void___B, B__, void__);
- checkLub(void___B, C__, void__);
- checkLub(void___B, void__A_B, Function_);
- checkLub(void___B, void__A_C, Function_);
- checkLub(void___B, void__B_A, Function_);
- checkLub(void___B, void__B_C, Function_);
- checkLub(void___B, void___B, void___B);
- checkLub(void___B, void___B_C, void___B);
- checkLub(void___B, void___C_C, void___B);
- checkLub(void___B, void____B, void__);
- checkLub(void___B, void____B_C, void__);
- checkLub(void___B, void____C_C, void__);
-
- checkLub(void___B_C, Object_, Object_);
- checkLub(void___B_C, Function_, Function_);
- checkLub(void___B_C, dynamic__, dynamic__);
- checkLub(void___B_C, void__, void__);
- checkLub(void___B_C, A__, void__);
- checkLub(void___B_C, B__, void__);
- checkLub(void___B_C, C__, void__);
- checkLub(void___B_C, void__A_B, Function_);
- checkLub(void___B_C, void__A_C, Function_);
- checkLub(void___B_C, void__B_A, Function_);
- checkLub(void___B_C, void__B_C, Function_);
- checkLub(void___B_C, void___B, void___B);
- checkLub(void___B_C, void___B_C, void___B_C);
- checkLub(void___B_C, void___C_C, void___B_C);
- checkLub(void___B_C, void____B, void__);
- checkLub(void___B_C, void____B_C, void__);
- checkLub(void___B_C, void____C_C, void__);
-
- checkLub(void___C_C, Object_, Object_);
- checkLub(void___C_C, Function_, Function_);
- checkLub(void___C_C, dynamic__, dynamic__);
- checkLub(void___C_C, void__, void__);
- checkLub(void___C_C, A__, void__);
- checkLub(void___C_C, B__, void__);
- checkLub(void___C_C, C__, void__);
- checkLub(void___C_C, void__A_B, Function_);
- checkLub(void___C_C, void__A_C, Function_);
- checkLub(void___C_C, void__B_A, Function_);
- checkLub(void___C_C, void__B_C, Function_);
- checkLub(void___C_C, void___B, void___B);
- checkLub(void___C_C, void___B_C, void___B_C);
- checkLub(void___C_C, void___C_C, void___C_C);
- checkLub(void___C_C, void____B, void__);
- checkLub(void___C_C, void____B_C, void__);
- checkLub(void___C_C, void____C_C, void__);
-
- checkLub(void____B, Object_, Object_);
- checkLub(void____B, Function_, Function_);
- checkLub(void____B, dynamic__, dynamic__);
- checkLub(void____B, void__, void__);
- checkLub(void____B, A__, void__);
- checkLub(void____B, B__, void__);
- checkLub(void____B, C__, void__);
- checkLub(void____B, void__A_B, Function_);
- checkLub(void____B, void__A_C, Function_);
- checkLub(void____B, void__B_A, Function_);
- checkLub(void____B, void__B_C, Function_);
- checkLub(void____B, void___B, void__);
- checkLub(void____B, void___B_C, void__);
- checkLub(void____B, void___C_C, void__);
- checkLub(void____B, void____B, void____B);
- checkLub(void____B, void____B_C, void____B);
- checkLub(void____B, void____C_C, void____B);
-
- checkLub(void____B_C, Object_, Object_);
- checkLub(void____B_C, Function_, Function_);
- checkLub(void____B_C, dynamic__, dynamic__);
- checkLub(void____B_C, void__, void__);
- checkLub(void____B_C, A__, void__);
- checkLub(void____B_C, B__, void__);
- checkLub(void____B_C, C__, void__);
- checkLub(void____B_C, void__A_B, Function_);
- checkLub(void____B_C, void__A_C, Function_);
- checkLub(void____B_C, void__B_A, Function_);
- checkLub(void____B_C, void__B_C, Function_);
- checkLub(void____B_C, void___B, void__);
- checkLub(void____B_C, void___B_C, void__);
- checkLub(void____B_C, void___C_C, void__);
- checkLub(void____B_C, void____B, void____B);
- checkLub(void____B_C, void____B_C, void____B_C);
- checkLub(void____B_C, void____C_C, void____B_C);
-
- checkLub(void____C_C, Object_, Object_);
- checkLub(void____C_C, Function_, Function_);
- checkLub(void____C_C, dynamic__, dynamic__);
- checkLub(void____C_C, void__, void__);
- checkLub(void____C_C, A__, void__);
- checkLub(void____C_C, B__, void__);
- checkLub(void____C_C, C__, void__);
- checkLub(void____C_C, void__A_B, Function_);
- checkLub(void____C_C, void__A_C, Function_);
- checkLub(void____C_C, void__B_A, Function_);
- checkLub(void____C_C, void__B_C, Function_);
- checkLub(void____C_C, void___B, void__);
- checkLub(void____C_C, void___B_C, void__);
- checkLub(void____C_C, void___C_C, void__);
- checkLub(void____C_C, void____B, void____B);
- checkLub(void____C_C, void____B_C, void____B_C);
- checkLub(void____C_C, void____C_C, void____C_C);
- }));
-}
-
-void testTypeVariable() {
- asyncTest(() => TypeEnvironment.create(r"""
- class A {}
- class B {}
- class C extends B {}
- class I<S extends A,
- T extends B,
- U extends C,
- V extends T,
- W extends V,
- X extends T> {}
- """).then((env) {
- // A B
- // | / \
- // S T C
- // / \ \
- // V X U
- // /
- // W
-
- ResolutionDartType Object_ = env['Object'];
- ResolutionDartType A = env['A'];
- ResolutionDartType B = env['B'];
- ResolutionDartType C = env['C'];
- ClassElement I = env.getElement('I');
- ResolutionDartType S = I.typeVariables[0];
- ResolutionDartType T = I.typeVariables[1];
- ResolutionDartType U = I.typeVariables[2];
- ResolutionDartType V = I.typeVariables[3];
- ResolutionDartType W = I.typeVariables[4];
- ResolutionDartType X = I.typeVariables[5];
-
- checkLub(ResolutionDartType a, ResolutionDartType b,
- ResolutionDartType expectedLub) {
- ResolutionDartType lub = env.computeLeastUpperBound(a, b);
- Expect.equals(expectedLub, lub,
- 'Unexpected lub($a,$b) = $lub, expected $expectedLub');
- }
-
- checkLub(Object_, Object_, Object_);
- checkLub(Object_, A, Object_);
- checkLub(Object_, B, Object_);
- checkLub(Object_, C, Object_);
- checkLub(Object_, S, Object_);
- checkLub(Object_, T, Object_);
- checkLub(Object_, U, Object_);
- checkLub(Object_, V, Object_);
- checkLub(Object_, W, Object_);
- checkLub(Object_, X, Object_);
-
- checkLub(A, Object_, Object_);
- checkLub(A, A, A);
- checkLub(A, B, Object_);
- checkLub(A, C, Object_);
- checkLub(A, S, A);
- checkLub(A, T, Object_);
- checkLub(A, U, Object_);
- checkLub(A, V, Object_);
- checkLub(A, W, Object_);
- checkLub(A, X, Object_);
-
- checkLub(B, Object_, Object_);
- checkLub(B, A, Object_);
- checkLub(B, B, B);
- checkLub(B, C, B);
- checkLub(B, S, Object_);
- checkLub(B, T, B);
- checkLub(B, U, B);
- checkLub(B, V, B);
- checkLub(B, W, B);
- checkLub(B, X, B);
-
- checkLub(C, Object_, Object_);
- checkLub(C, A, Object_);
- checkLub(C, B, B);
- checkLub(C, C, C);
- checkLub(C, S, Object_);
- checkLub(C, T, B);
- checkLub(C, U, C);
- checkLub(C, V, B);
- checkLub(C, W, B);
- checkLub(C, X, B);
-
- checkLub(S, Object_, Object_);
- checkLub(S, A, A);
- checkLub(S, B, Object_);
- checkLub(S, C, Object_);
- checkLub(S, S, S);
- checkLub(S, T, Object_);
- checkLub(S, U, Object_);
- checkLub(S, V, Object_);
- checkLub(S, W, Object_);
- checkLub(S, X, Object_);
-
- checkLub(T, Object_, Object_);
- checkLub(T, A, Object_);
- checkLub(T, B, B);
- checkLub(T, C, B);
- checkLub(T, S, Object_);
- checkLub(T, T, T);
- checkLub(T, U, B);
- checkLub(T, V, T);
- checkLub(T, W, T);
- checkLub(T, X, T);
-
- checkLub(U, Object_, Object_);
- checkLub(U, A, Object_);
- checkLub(U, B, B);
- checkLub(U, C, C);
- checkLub(U, S, Object_);
- checkLub(U, T, B);
- checkLub(U, U, U);
- checkLub(U, V, B);
- checkLub(U, W, B);
- checkLub(U, X, B);
-
- checkLub(V, Object_, Object_);
- checkLub(V, A, Object_);
- checkLub(V, B, B);
- checkLub(V, C, B);
- checkLub(V, S, Object_);
- checkLub(V, T, T);
- checkLub(V, U, B);
- checkLub(V, V, V);
- checkLub(V, W, V);
- checkLub(V, X, T);
-
- checkLub(W, Object_, Object_);
- checkLub(W, A, Object_);
- checkLub(W, B, B);
- checkLub(W, C, B);
- checkLub(W, S, Object_);
- checkLub(W, T, T);
- checkLub(W, U, B);
- checkLub(W, V, V);
- checkLub(W, W, W);
- checkLub(W, X, T);
-
- checkLub(X, Object_, Object_);
- checkLub(X, A, Object_);
- checkLub(X, B, B);
- checkLub(X, C, B);
- checkLub(X, S, Object_);
- checkLub(X, T, T);
- checkLub(X, U, B);
- checkLub(X, V, T);
- checkLub(X, W, T);
- checkLub(X, X, X);
- }));
-}
diff --git a/tests/compiler/dart2js/old_frontend/library_resolution_test.dart b/tests/compiler/dart2js/old_frontend/library_resolution_test.dart
deleted file mode 100644
index 86250d2..0000000
--- a/tests/compiler/dart2js/old_frontend/library_resolution_test.dart
+++ /dev/null
@@ -1,101 +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.
-
-/// Check that relative URIs are resolved against the canonical name of a
-/// library. This only matters for dart:-libraries, so this test mocks up two
-/// dart:-libraries.
-
-import "dart:async";
-
-import "../memory_source_file_helper.dart";
-
-import "package:async_helper/async_helper.dart";
-
-import 'package:expect/expect.dart' show Expect;
-
-import 'package:compiler/compiler_new.dart';
-
-import 'package:compiler/src/diagnostics/messages.dart'
- show MessageKind, MessageTemplate;
-
-import 'package:compiler/src/library_loader.dart' show LoadedLibraries;
-
-import 'package:compiler/src/null_compiler_output.dart' show NullCompilerOutput;
-
-import 'package:compiler/src/old_to_new_api.dart'
- show LegacyCompilerDiagnostics, LegacyCompilerInput;
-import 'package:compiler/src/options.dart' show CompilerOptions;
-
-Uri sdkRoot = Uri.base.resolve("sdk/");
-Uri mock1LibraryUri = sdkRoot.resolve("lib/mock1.dart");
-Uri mock2LibraryUri = sdkRoot.resolve("lib/mock2.dart");
-
-class CustomCompiler extends CompilerImpl {
- CustomCompiler(provider, handler, libraryRoot, packageConfig)
- : super(
- provider,
- const NullCompilerOutput(),
- handler,
- new CompilerOptions()
- ..libraryRoot = libraryRoot
- ..useKernel = false
- ..packageConfig = packageConfig);
-}
-
-main() async {
- Uri packageConfig = Uri.base.resolve('.packages');
-
- var provider = new MemorySourceFileProvider(MEMORY_SOURCE_FILES);
- var handler = new FormattingDiagnosticHandler(provider);
-
- Future wrappedProvider(Uri uri) async {
- if (uri == mock1LibraryUri) {
- uri = Uri.parse('memory:mock1.dart');
- }
- if (uri == mock2LibraryUri) {
- uri = Uri.parse('memory:mock2.dart');
- }
- Input input = await provider.readBytesFromUri(uri, InputKind.UTF8);
- return input.data;
- }
-
- String expectedMessage = MessageTemplate
- .TEMPLATES[MessageKind.LIBRARY_NOT_FOUND]
- .message({'resolvedUri': 'dart:mock2.dart'}).computeMessage();
-
- int actualMessageCount = 0;
-
- wrappedHandler(Uri uri, int begin, int end, String message, kind) {
- if (message == expectedMessage) {
- actualMessageCount++;
- } else {
- return handler(uri, begin, end, message, kind);
- }
- }
-
- checkLibraries(LoadedLibraries libraries) {
- Expect.equals(1, actualMessageCount);
- }
-
- CompilerImpl compiler = new CustomCompiler(
- new LegacyCompilerInput(wrappedProvider),
- new LegacyCompilerDiagnostics(wrappedHandler),
- sdkRoot,
- packageConfig);
-
- asyncStart();
- await compiler.setupSdk();
- // TODO(het): Find cleaner way to do this
- compiler.resolvedUriTranslator.sdkLibraries['m_o_c_k_1'] = mock1LibraryUri;
- compiler.resolvedUriTranslator.sdkLibraries['m_o_c_k_2'] = mock2LibraryUri;
- var libraries =
- await compiler.libraryLoader.loadLibrary(Uri.parse("dart:m_o_c_k_1"));
- await checkLibraries(libraries);
- asyncSuccess(null);
-}
-
-const Map MEMORY_SOURCE_FILES = const {
- "mock1.dart": "library mock1; import 'mock2.dart';",
- "mock2.dart": "library mock2;",
-};
diff --git a/tests/compiler/dart2js/old_frontend/lookup_member_test.dart b/tests/compiler/dart2js/old_frontend/lookup_member_test.dart
deleted file mode 100644
index 30d58c7..0000000
--- a/tests/compiler/dart2js/old_frontend/lookup_member_test.dart
+++ /dev/null
@@ -1,79 +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.
-
-library lookup_member_test;
-
-import 'package:expect/expect.dart';
-import "package:async_helper/async_helper.dart";
-import '../type_test_helper.dart';
-import 'package:compiler/src/elements/resolution_types.dart';
-import "package:compiler/src/elements/elements.dart"
- show ClassElement, MemberSignature;
-import "package:compiler/src/elements/names.dart";
-
-void main() {
- test();
-}
-
-void test() {
- asyncTest(() => TypeEnvironment.create(r"""
- class A<T> {
- T foo;
- }
- class B<S> extends A<A<S>> {
- S bar;
- }
- class C<U> extends B<String> with D<B<U>> {
- U baz;
- }
- class D<V> {
- V boz;
- }
- """).then((env) {
- void expect(ResolutionInterfaceType receiverType, String memberName,
- ResolutionDartType expectedType) {
- MemberSignature member =
- receiverType.lookupInterfaceMember(new PublicName(memberName));
- Expect.isNotNull(member);
- ResolutionDartType memberType = member.type;
- Expect.equals(expectedType, memberType,
- 'Wrong member type for $receiverType.$memberName.');
- }
-
- ResolutionDartType int_ = env['int'];
- ResolutionDartType String_ = env['String'];
-
- ClassElement A = env.getElement('A');
- ResolutionDartType T = A.typeVariables.first;
- ResolutionDartType A_T = A.thisType;
- expect(A_T, 'foo', T);
-
- ResolutionDartType A_int = instantiate(A, [int_]);
- expect(A_int, 'foo', int_);
-
- ClassElement B = env.getElement('B');
- ResolutionDartType S = B.typeVariables.first;
- ResolutionDartType B_S = B.thisType;
- expect(B_S, 'foo', instantiate(A, [S]));
- expect(B_S, 'bar', S);
-
- ResolutionDartType B_int = instantiate(B, [int_]);
- expect(B_int, 'foo', A_int);
- expect(B_int, 'bar', int_);
-
- ClassElement C = env.getElement('C');
- ResolutionDartType U = C.typeVariables.first;
- ResolutionDartType C_U = C.thisType;
- expect(C_U, 'foo', instantiate(A, [String_]));
- expect(C_U, 'bar', String_);
- expect(C_U, 'baz', U);
- expect(C_U, 'boz', instantiate(B, [U]));
-
- ResolutionDartType C_int = instantiate(C, [int_]);
- expect(C_int, 'foo', instantiate(A, [String_]));
- expect(C_int, 'bar', String_);
- expect(C_int, 'baz', int_);
- expect(C_int, 'boz', instantiate(B, [int_]));
- }));
-}
diff --git a/tests/compiler/dart2js/old_frontend/malformed_uri_test.dart b/tests/compiler/dart2js/old_frontend/malformed_uri_test.dart
deleted file mode 100644
index d5affd7..0000000
--- a/tests/compiler/dart2js/old_frontend/malformed_uri_test.dart
+++ /dev/null
@@ -1,36 +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 that the compiler can handle missing files used in imports, exports,
-// part tags or as the main source file.
-
-library dart2js.test.malformed_uri;
-
-import 'package:expect/expect.dart';
-import "package:async_helper/async_helper.dart";
-import 'package:compiler/src/commandline_options.dart';
-import '../memory_compiler.dart';
-
-const MEMORY_SOURCE_FILES = const {
- 'main.dart': '''
-import '../../Udyn[mic ils/expect.dart';
-
-main () { print("Hi"); }
-''',
-};
-
-testMalformedUri() {
- asyncTest(() async {
- var collector = new DiagnosticCollector();
- await runCompiler(
- memorySourceFiles: MEMORY_SOURCE_FILES,
- diagnosticHandler: collector,
- options: [Flags.useOldFrontend]);
- Expect.equals(1, collector.errors.length);
- });
-}
-
-void main() {
- testMalformedUri();
-}
diff --git a/tests/compiler/dart2js/old_frontend/members_test.dart b/tests/compiler/dart2js/old_frontend/members_test.dart
deleted file mode 100644
index 2ca4b90..0000000
--- a/tests/compiler/dart2js/old_frontend/members_test.dart
+++ /dev/null
@@ -1,754 +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 members_test;
-
-import 'package:expect/expect.dart';
-import "package:async_helper/async_helper.dart";
-import '../type_test_helper.dart';
-import 'package:compiler/src/commandline_options.dart';
-import 'package:compiler/src/elements/resolution_types.dart';
-import "package:compiler/src/elements/elements.dart"
- show ClassElement, MemberSignature;
-import "package:compiler/src/elements/names.dart";
-import "package:compiler/src/resolution/class_members.dart"
- show MembersCreator, DeclaredMember, ErroneousMember, SyntheticMember;
-
-void main() {
- testClassMembers();
- testInterfaceMembers();
- testClassVsInterfaceMembers();
- testMixinMembers();
- testMixinMembersWithoutImplements();
-}
-
-MemberSignature getMember(ResolutionInterfaceType cls, String name,
- {bool isSetter: false, int checkType: CHECK_INTERFACE}) {
- Name memberName = new Name(name, cls.element.library, isSetter: isSetter);
- MemberSignature member = checkType == CHECK_CLASS
- ? cls.element.lookupClassMember(memberName)
- : cls.element.lookupInterfaceMember(memberName);
- if (member != null) {
- Expect.equals(memberName, member.name);
- }
- return member;
-}
-
-/// Check interface member only.
-const int CHECK_INTERFACE = 0;
-
-/// Check class member only.
-const int CHECK_CLASS = 1;
-
-/// Check that there is no class member for the interface member.
-const int NO_CLASS_MEMBER = 2;
-
-/// Check that the interface member is also a class member.
-const int ALSO_CLASS_MEMBER = 3;
-
-/**
- * Checks [member] or interface member [name] of the declaration of [cls].
- *
- * If [inheritFrom] is set, the member from [cls] must be identical to the
- * member from [inheritedFrom].
- *
- * Otherwise, the properties of member are checked against the values of
- * [isStatic], [isSetter], [isGetter], [declarer], [type] and
- * [functionType].
- *
- * If [synthesizedFrom] or [erroneousFrom] is not `null`, the member is checked
- * to be synthesized for the corresponding members found on the type is
- * [synthesizedFrom] or or [erroneousFrom], respectively.
- * Otherwise, if [declarer] is `null`, the declarer is checked to be [cls], and
- * if [declarer] is not `null`, the declarer is checked to be [declarer].
- * If [type] is `null` it is checked that the type of the member is also the
- * member type, otherwise the type is checked to be [type].
- *
- * If [isClassMember] is `true` it is checked that the member is also a class
- * member.
- */
-MemberSignature checkMember(ResolutionInterfaceType cls, String name,
- {bool isStatic: false,
- bool isSetter: false,
- bool isGetter: false,
- ResolutionInterfaceType declarer,
- ResolutionDartType type,
- ResolutionFunctionType functionType,
- ResolutionInterfaceType inheritedFrom,
- List<ResolutionInterfaceType> synthesizedFrom,
- List<ResolutionInterfaceType> erroneousFrom,
- int checkType: ALSO_CLASS_MEMBER}) {
- String memberKind = checkType == CHECK_CLASS ? 'class' : 'interface';
- MemberSignature member =
- getMember(cls, name, isSetter: isSetter, checkType: checkType);
- Expect.isNotNull(member, "No $memberKind member '$name' in $cls.");
- Name memberName = member.name;
- if (checkType == ALSO_CLASS_MEMBER) {
- MemberSignature classMember = cls.element.lookupClassMember(memberName);
- Expect.isNotNull(classMember, "No class member '$memberName' in $cls.");
- Expect.equals(member, classMember);
- } else if (checkType == NO_CLASS_MEMBER) {
- Expect.isNull(cls.element.lookupClassMember(memberName));
- }
-
- if (inheritedFrom != null) {
- DeclaredMember inherited = checkType == CHECK_CLASS
- ? inheritedFrom.element.lookupClassMember(memberName)
- : inheritedFrom.element.lookupInterfaceMember(memberName);
- Expect.isNotNull(
- inherited, "No $memberKind member '$memberName' in $inheritedFrom.");
- Expect.equals(inherited.inheritFrom(inheritedFrom), member);
- } else {
- if (erroneousFrom != null || synthesizedFrom != null) {
- Expect.notEquals(
- checkType,
- CHECK_CLASS,
- "Arguments 'erroneousFrom' and 'synthesizedFrom' only apply "
- "to interface members.");
- if (synthesizedFrom != null) {
- Expect.isTrue(
- member is SyntheticMember, "Member '$member' is not synthesized.");
- } else {
- Expect.isTrue(
- member is ErroneousMember, "Member '$member' is not erroneous.");
- }
- Set<MemberSignature> members = new Set<MemberSignature>();
- List from = synthesizedFrom != null ? synthesizedFrom : erroneousFrom;
- for (ResolutionInterfaceType type in from) {
- DeclaredMember inheritedMember =
- type.element.lookupInterfaceMember(memberName);
- Expect.isNotNull(inheritedMember);
- members.add(inheritedMember.inheritFrom(type));
- }
- Expect.setEquals(members, member.declarations);
- } else if (declarer != null) {
- DeclaredMember declared = member;
- Expect.equals(
- declarer,
- declared.declarer,
- "Unexpected declarer '${declared.declarer}' of $memberKind member "
- "'$member'. Expected '${declarer}'.");
- } else {
- DeclaredMember declared = member;
- Expect.equals(cls.element, declared.element.enclosingClass);
- Expect.equals(cls, declared.declarer);
- }
- Expect.equals(isSetter, member.isSetter);
- Expect.equals(isGetter, member.isGetter);
- if (type != null) {
- Expect.equals(type, member.type,
- "Unexpected type of $memberKind member '$member'.");
- }
- if (functionType != null) {
- if (type == null) {
- Expect.equals(member.type, member.functionType,
- "Unexpected type of $memberKind member '$member'.");
- }
- Expect.equals(functionType, member.functionType,
- "Unexpected member type of $memberKind member '$member'.");
- }
- }
- return member;
-}
-
-void checkMemberCount(ResolutionInterfaceType cls, int expectedCount,
- {bool interfaceMembers: true}) {
- int count = 0;
- if (interfaceMembers) {
- cls.element.forEachInterfaceMember((_) => count++);
- } else {
- cls.element.forEachClassMember((_) => count++);
- }
- Expect.equals(expectedCount, count);
-}
-
-void testClassMembers() {
- asyncTest(() => TypeEnvironment.create(r"""
- abstract class A {
- int field;
- final finalField = 0;
- static var staticField;
-
- int get getter => 0;
- get abstractGetter;
- void set setter(int _) {}
- set abstractSetter(_);
-
- method() {}
- abstractMethod();
- static staticMethod() {}
- }
- class B<T> {
- T field;
- void method(T t) {}
- static staticMethod() {}
- toString([T t]) {}
- }
- class C<S> extends B<S> {}
- class D extends C<int> {}
- class E extends D {}
- """,
- options: [Flags.useOldFrontend],
- compileMode: CompileMode.memory).then((env) {
- ResolutionInterfaceType bool_ = env['bool'];
- ResolutionInterfaceType String_ = env['String'];
- ResolutionInterfaceType int_ = env['int'];
- ResolutionDynamicType dynamic_ = env['dynamic'];
- ResolutionVoidType void_ = env['void'];
- ResolutionInterfaceType Type_ = env['Type'];
- ResolutionInterfaceType Invocation_ = env['Invocation'];
-
- ResolutionInterfaceType Object_ = env['Object'];
- checkMemberCount(Object_, 5 /*declared*/, interfaceMembers: true);
- checkMemberCount(Object_, 5 /*declared*/, interfaceMembers: false);
-
- checkMember(Object_, '==',
- functionType: env.functionType(bool_, [dynamic_]));
- checkMember(Object_, 'hashCode',
- isGetter: true,
- type: int_,
- functionType: env.functionType(int_, []));
- checkMember(Object_, 'noSuchMethod',
- functionType: env.functionType(dynamic_, [Invocation_]));
- checkMember(Object_, 'runtimeType',
- isGetter: true,
- type: Type_,
- functionType: env.functionType(Type_, []));
- checkMember(Object_, 'toString',
- functionType: env.functionType(String_, []));
-
- ResolutionInterfaceType A = env['A'];
- MembersCreator.computeAllClassMembers(env.resolution, A.element);
-
- checkMemberCount(A, 5 /*inherited*/ + 9 /*non-static declared*/,
- interfaceMembers: true);
- checkMemberCount(
- A,
- 5 /*inherited*/ +
- 9 /*non-abstract declared*/ +
- 3 /* abstract declared */,
- interfaceMembers: false);
-
- checkMember(A, '==', inheritedFrom: Object_);
- checkMember(A, 'hashCode', inheritedFrom: Object_);
- checkMember(A, 'noSuchMethod', inheritedFrom: Object_);
- checkMember(A, 'runtimeType', inheritedFrom: Object_);
- checkMember(A, 'toString', inheritedFrom: Object_);
-
- checkMember(A, 'field',
- isGetter: true,
- type: int_,
- functionType: env.functionType(int_, []));
- checkMember(A, 'field',
- isSetter: true,
- type: int_,
- functionType: env.functionType(void_, [int_]));
- checkMember(A, 'finalField',
- isGetter: true,
- type: dynamic_,
- functionType: env.functionType(dynamic_, []));
- checkMember(A, 'staticField',
- isGetter: true,
- isStatic: true,
- checkType: CHECK_CLASS,
- type: dynamic_,
- functionType: env.functionType(dynamic_, []));
- checkMember(A, 'staticField',
- isSetter: true,
- isStatic: true,
- checkType: CHECK_CLASS,
- type: dynamic_,
- functionType: env.functionType(void_, [dynamic_]));
-
- checkMember(A, 'getter',
- isGetter: true,
- type: int_,
- functionType: env.functionType(int_, []));
- checkMember(A, 'abstractGetter',
- isGetter: true,
- type: dynamic_,
- functionType: env.functionType(dynamic_, []));
- checkMember(A, 'setter',
- isSetter: true,
- type: int_,
- functionType: env.functionType(void_, [int_]));
- checkMember(A, 'abstractSetter',
- isSetter: true,
- type: dynamic_,
- functionType: env.functionType(dynamic_, [dynamic_]));
-
- checkMember(A, 'method', functionType: env.functionType(dynamic_, []));
- checkMember(A, 'abstractMethod',
- functionType: env.functionType(dynamic_, []));
- checkMember(A, 'staticMethod',
- checkType: CHECK_CLASS,
- isStatic: true,
- functionType: env.functionType(dynamic_, []));
-
- ClassElement B = env.getElement('B');
- MembersCreator.computeAllClassMembers(env.resolution, B);
- ResolutionInterfaceType B_this = B.thisType;
- ResolutionTypeVariableType B_T = B_this.typeArguments.first;
- checkMemberCount(B_this, 4 /*inherited*/ + 4 /*non-static declared*/,
- interfaceMembers: true);
- checkMemberCount(B_this, 4 /*inherited*/ + 5 /*declared*/,
- interfaceMembers: false);
-
- checkMember(B_this, '==', inheritedFrom: Object_);
- checkMember(B_this, 'hashCode', inheritedFrom: Object_);
- checkMember(B_this, 'noSuchMethod', inheritedFrom: Object_);
- checkMember(B_this, 'runtimeType', inheritedFrom: Object_);
-
- checkMember(B_this, 'field',
- isGetter: true, type: B_T, functionType: env.functionType(B_T, []));
- checkMember(B_this, 'field',
- isSetter: true,
- type: B_T,
- functionType: env.functionType(void_, [B_T]));
- checkMember(B_this, 'method',
- functionType: env.functionType(void_, [B_T]));
- checkMember(B_this, 'staticMethod',
- checkType: CHECK_CLASS,
- isStatic: true,
- functionType: env.functionType(dynamic_, []));
- checkMember(B_this, 'toString',
- functionType:
- env.functionType(dynamic_, [], optionalParameters: [B_T]));
-
- ClassElement C = env.getElement('C');
- MembersCreator.computeAllClassMembers(env.resolution, C);
- ResolutionInterfaceType C_this = C.thisType;
- ResolutionTypeVariableType C_S = C_this.typeArguments.first;
- checkMemberCount(C_this, 8 /*inherited*/, interfaceMembers: true);
- checkMemberCount(C_this, 8 /*inherited*/, interfaceMembers: false);
- ResolutionInterfaceType B_S = instantiate(B, [C_S]);
-
- checkMember(C_this, '==', inheritedFrom: Object_);
- checkMember(C_this, 'hashCode', inheritedFrom: Object_);
- checkMember(C_this, 'noSuchMethod', inheritedFrom: Object_);
- checkMember(C_this, 'runtimeType', inheritedFrom: Object_);
-
- checkMember(C_this, 'field',
- isGetter: true,
- declarer: B_S,
- type: C_S,
- functionType: env.functionType(C_S, []));
- checkMember(C_this, 'field',
- isSetter: true,
- declarer: B_S,
- type: C_S,
- functionType: env.functionType(void_, [C_S]));
- checkMember(C_this, 'method',
- declarer: B_S, functionType: env.functionType(void_, [C_S]));
- checkMember(C_this, 'toString',
- declarer: B_S,
- functionType:
- env.functionType(dynamic_, [], optionalParameters: [C_S]));
-
- ResolutionInterfaceType D = env['D'];
- MembersCreator.computeAllClassMembers(env.resolution, D.element);
- checkMemberCount(D, 8 /*inherited*/, interfaceMembers: true);
- checkMemberCount(D, 8 /*inherited*/, interfaceMembers: false);
- ResolutionInterfaceType B_int = instantiate(B, [int_]);
-
- checkMember(D, '==', inheritedFrom: Object_);
- checkMember(D, 'hashCode', inheritedFrom: Object_);
- checkMember(D, 'noSuchMethod', inheritedFrom: Object_);
- checkMember(D, 'runtimeType', inheritedFrom: Object_);
-
- checkMember(D, 'field',
- isGetter: true,
- declarer: B_int,
- type: int_,
- functionType: env.functionType(int_, []));
- checkMember(D, 'field',
- isSetter: true,
- declarer: B_int,
- type: int_,
- functionType: env.functionType(void_, [int_]));
- checkMember(D, 'method',
- declarer: B_int, functionType: env.functionType(void_, [int_]));
- checkMember(D, 'toString',
- declarer: B_int,
- functionType:
- env.functionType(dynamic_, [], optionalParameters: [int_]));
-
- ResolutionInterfaceType E = env['E'];
- MembersCreator.computeAllClassMembers(env.resolution, E.element);
- checkMemberCount(E, 8 /*inherited*/, interfaceMembers: true);
- checkMemberCount(E, 8 /*inherited*/, interfaceMembers: false);
-
- checkMember(E, '==', inheritedFrom: Object_);
- checkMember(E, 'hashCode', inheritedFrom: Object_);
- checkMember(E, 'noSuchMethod', inheritedFrom: Object_);
- checkMember(E, 'runtimeType', inheritedFrom: Object_);
-
- checkMember(E, 'field',
- isGetter: true,
- declarer: B_int,
- type: int_,
- functionType: env.functionType(int_, []));
- checkMember(E, 'field',
- isSetter: true,
- declarer: B_int,
- type: int_,
- functionType: env.functionType(void_, [int_]));
- checkMember(E, 'method',
- declarer: B_int, functionType: env.functionType(void_, [int_]));
- checkMember(E, 'toString',
- declarer: B_int,
- functionType:
- env.functionType(dynamic_, [], optionalParameters: [int_]));
- }));
-}
-
-void testInterfaceMembers() {
- asyncTest(() => TypeEnvironment.create(r"""
- abstract class A {
- num method1();
- void method2();
- void method3();
- void method4();
- method5(a);
- method6(a);
- method7(a);
- method8(a, b);
- method9(a, b, c);
- method10(a, {b, c});
- method11(a, {b, c});
- num get getter1;
- num get getter2;
- void set setter1(num _);
- void set setter2(num _);
- void set setter3(num _);
- get getterAndMethod;
- }
- abstract class B {
- int method1();
- int method2();
- num method3();
- num method4();
- method5([a]);
- method6([a, b]);
- method7(a, [b]);
- method8([a]);
- method9(a, [b]);
- method10(a, {c, d});
- method11(a, b, {c, d});
- num get getter1;
- int get getter2;
- void set setter1(num _);
- set setter2(num _);
- void set setter3(int _);
- getterAndMethod();
- }
- abstract class C {
- int method3();
- num method4();
- }
- abstract class D implements A, B, C {}
- """, options: [Flags.useOldFrontend]).then((env) {
- ResolutionDynamicType dynamic_ = env['dynamic'];
- ResolutionVoidType void_ = env['void'];
- ResolutionInterfaceType num_ = env['num'];
-
- ResolutionInterfaceType A = env['A'];
- ResolutionInterfaceType B = env['B'];
- ResolutionInterfaceType C = env['C'];
- ResolutionInterfaceType D = env['D'];
-
- // Ensure that members have been computed on all classes.
- MembersCreator.computeAllClassMembers(env.resolution, D.element);
-
- // A: num method1()
- // B: int method1()
- // D: dynamic method1() -- synthesized from A and B.
- checkMember(D, 'method1',
- synthesizedFrom: [A, B],
- functionType: env.functionType(dynamic_, []),
- checkType: NO_CLASS_MEMBER);
-
- // A: void method2()
- // B: int method2()
- // D: int method2() -- inherited from B
- checkMember(D, 'method2', inheritedFrom: B, checkType: NO_CLASS_MEMBER);
-
- // A: void method3()
- // B: num method3()
- // C: int method3()
- // D: dynamic method3() -- synthesized from A, B, and C.
- checkMember(D, 'method3',
- synthesizedFrom: [A, B, C],
- functionType: env.functionType(dynamic_, []),
- checkType: NO_CLASS_MEMBER);
-
- // A: void method4()
- // B: num method4()
- // C: num method4()
- // D: num method4() -- synthesized from B and C.
- checkMember(D, 'method4',
- synthesizedFrom: [B, C],
- functionType: env.functionType(num_, []),
- checkType: NO_CLASS_MEMBER);
-
- // A: method5(a)
- // B: method5([a])
- // D: method5([a]) -- inherited from B
- checkMember(D, 'method5', inheritedFrom: B, checkType: NO_CLASS_MEMBER);
-
- // A: method6(a)
- // B: method6([a, b])
- // D: method6([a, b]) -- inherited from B
- checkMember(D, 'method6', inheritedFrom: B, checkType: NO_CLASS_MEMBER);
-
- // A: method7(a)
- // B: method7(a, [b])
- // D: method7(a, [b]) -- inherited from B
- checkMember(D, 'method7', inheritedFrom: B, checkType: NO_CLASS_MEMBER);
-
- // A: method8(a, b)
- // B: method8([a])
- // D: method8([a, b]) -- synthesized from A and B.
- checkMember(D, 'method8',
- synthesizedFrom: [A, B],
- functionType: env.functionType(dynamic_, [],
- optionalParameters: [dynamic_, dynamic_]),
- checkType: NO_CLASS_MEMBER);
-
- // A: method9(a, b, c)
- // B: method9(a, [b])
- // D: method9(a, [b, c]) -- synthesized from A and B.
- checkMember(D, 'method9',
- synthesizedFrom: [A, B],
- functionType: env.functionType(dynamic_, [dynamic_],
- optionalParameters: [dynamic_, dynamic_]),
- checkType: NO_CLASS_MEMBER);
-
- // A: method10(a, {b, c})
- // B: method10(a, {c, d})
- // D: method10(a, {b, c, d}) -- synthesized from A and B.
- checkMember(D, 'method10',
- synthesizedFrom: [A, B],
- functionType: env.functionType(dynamic_, [dynamic_],
- namedParameters: {'b': dynamic_, 'c': dynamic_, 'd': dynamic_}),
- checkType: NO_CLASS_MEMBER);
-
- // A: method11(a, {b, c})
- // B: method11(a, b, {c, d})
- // D: method11(a, [b], {c, d}) -- synthesized from A and B.
- // TODO(johnniwinther): Change to check synthesized member when function
- // types with both optional and named parameters are supported.
- Expect.isNull(getMember(D, 'method11'));
- /*checkMember(D, 'method11',
- synthesizedFrom: [A, B],
- functionType: env.functionType(dynamic_, [dynamic_],
- optionalParameters: [dynamic_],
- namedParameters: {'c': dynamic_,
- 'd': dynamic_,}),
- checkType: NO_CLASS_MEMBER);*/
-
- // A: num get getter1
- // B: num get getter1
- // D: num get getter1 -- synthesized from A and B.
- checkMember(D, 'getter1',
- isGetter: true,
- synthesizedFrom: [A, B],
- type: num_,
- functionType: env.functionType(num_, []),
- checkType: NO_CLASS_MEMBER);
-
- // A: num get getter2
- // B: int get getter2
- // D: dynamic get getter2 -- synthesized from A and B.
- checkMember(D, 'getter2',
- isGetter: true,
- synthesizedFrom: [A, B],
- type: dynamic_,
- functionType: env.functionType(dynamic_, []),
- checkType: NO_CLASS_MEMBER);
-
- // A: void set setter1(num _)
- // B: void set setter1(num _)
- // D: void set setter1(num _) -- synthesized from A and B.
- checkMember(D, 'setter1',
- isSetter: true,
- synthesizedFrom: [A, B],
- type: num_,
- functionType: env.functionType(void_, [num_]),
- checkType: NO_CLASS_MEMBER);
-
- // A: void set setter2(num _)
- // B: set setter2(num _)
- // D: dynamic set setter2(dynamic _) -- synthesized from A and B.
- checkMember(D, 'setter2',
- isSetter: true,
- synthesizedFrom: [A, B],
- type: dynamic_,
- functionType: env.functionType(dynamic_, [dynamic_]),
- checkType: NO_CLASS_MEMBER);
-
- // A: void set setter3(num _)
- // B: void set setter3(int _)
- // D: dynamic set setter3(dynamic _) -- synthesized from A and B.
- checkMember(D, 'setter3',
- isSetter: true,
- synthesizedFrom: [A, B],
- type: dynamic_,
- functionType: env.functionType(dynamic_, [dynamic_]),
- checkType: NO_CLASS_MEMBER);
-
- // A: get getterAndMethod
- // B: getterAndMethod()
- // D: nothing inherited
- checkMember(D, 'getterAndMethod',
- erroneousFrom: [A, B], checkType: NO_CLASS_MEMBER);
- }));
-}
-
-void testClassVsInterfaceMembers() {
- asyncTest(() => TypeEnvironment.create(r"""
- class A {
- method1() {}
- method2() {}
- }
- abstract class B {
- method1();
- method2(a);
- }
- abstract class C extends A implements B {}
- """, options: [Flags.useOldFrontend]).then((env) {
- ResolutionDynamicType dynamic_ = env['dynamic'];
-
- ResolutionInterfaceType A = env['A'];
- ResolutionInterfaceType B = env['B'];
- ResolutionInterfaceType C = env['C'];
-
- // Ensure that members have been computed on all classes.
- MembersCreator.computeAllClassMembers(env.resolution, C.element);
-
- // A: method1()
- // B: method1()
- // C class: method1() -- inherited from A.
- // C interface: dynamic method1() -- synthesized from A and B.
- MemberSignature interfaceMember = checkMember(C, 'method1',
- checkType: CHECK_INTERFACE,
- synthesizedFrom: [A, B],
- functionType: env.functionType(dynamic_, []));
- MemberSignature classMember =
- checkMember(C, 'method1', checkType: CHECK_CLASS, inheritedFrom: A);
- Expect.notEquals(interfaceMember, classMember);
-
- // A: method2()
- // B: method2(a)
- // C class: method2() -- inherited from A.
- // C interface: dynamic method2([a]) -- synthesized from A and B.
- interfaceMember = checkMember(C, 'method2',
- checkType: CHECK_INTERFACE,
- synthesizedFrom: [A, B],
- functionType:
- env.functionType(dynamic_, [], optionalParameters: [dynamic_]));
- classMember =
- checkMember(C, 'method2', checkType: CHECK_CLASS, inheritedFrom: A);
- Expect.notEquals(interfaceMember, classMember);
- }));
-}
-
-void testMixinMembers() {
- asyncTest(() => TypeEnvironment.create(r"""
- class A<T> {
- method1() {}
- method2() {}
- method3(T a) {}
- method4(T a) {}
- }
- abstract class B<S> {
- method1();
- method2(a);
- method3(S a) {}
- }
- abstract class C<U, V> extends Object with A<U> implements B<V> {}
- """, options: [Flags.useOldFrontend]).then((env) {
- ResolutionDynamicType dynamic_ = env['dynamic'];
-
- ClassElement A = env.getElement('A');
- ClassElement B = env.getElement('B');
- ClassElement C = env.getElement('C');
- ResolutionInterfaceType C_this = C.thisType;
- ResolutionTypeVariableType C_U = C_this.typeArguments[0];
- ResolutionTypeVariableType C_V = C_this.typeArguments[1];
- ResolutionInterfaceType A_U = instantiate(A, [C_U]);
- ResolutionInterfaceType B_V = instantiate(B, [C_V]);
-
- // Ensure that members have been computed on all classes.
- MembersCreator.computeAllClassMembers(env.resolution, C);
-
- // A: method1()
- // B: method1()
- // C class: method1() -- inherited from A.
- // C interface: dynamic method1() -- synthesized from A and B.
- MemberSignature interfaceMember = checkMember(C_this, 'method1',
- checkType: CHECK_INTERFACE,
- synthesizedFrom: [A_U, B_V],
- functionType: env.functionType(dynamic_, []));
- MemberSignature classMember = checkMember(C_this, 'method1',
- checkType: CHECK_CLASS, inheritedFrom: A_U);
- Expect.notEquals(interfaceMember, classMember);
-
- // A: method2()
- // B: method2(a)
- // C class: method2() -- inherited from A.
- // C interface: dynamic method2([a]) -- synthesized from A and B.
- interfaceMember = checkMember(C_this, 'method2',
- checkType: CHECK_INTERFACE,
- synthesizedFrom: [A_U, B_V],
- functionType:
- env.functionType(dynamic_, [], optionalParameters: [dynamic_]));
- classMember = checkMember(C_this, 'method2',
- checkType: CHECK_CLASS, inheritedFrom: A_U);
- Expect.notEquals(interfaceMember, classMember);
-
- // A: method3(U a)
- // B: method3(V a)
- // C class: method3(U a) -- inherited from A.
- // C interface: dynamic method3(a) -- synthesized from A and B.
- interfaceMember = checkMember(C_this, 'method3',
- checkType: CHECK_INTERFACE,
- synthesizedFrom: [A_U, B_V],
- functionType: env.functionType(dynamic_, [dynamic_]));
- classMember = checkMember(C_this, 'method3',
- checkType: CHECK_CLASS, inheritedFrom: A_U);
- Expect.notEquals(interfaceMember, classMember);
-
- // A: method4(U a)
- // B: --
- // C class: method4(U a) -- inherited from A.
- // C interface: method4(U a) -- inherited from A.
- checkMember(C_this, 'method4',
- checkType: ALSO_CLASS_MEMBER, inheritedFrom: A_U);
- }));
-}
-
-void testMixinMembersWithoutImplements() {
- asyncTest(() => TypeEnvironment.create(r"""
- abstract class A {
- m();
- }
- abstract class B implements A {
- }
- abstract class C extends Object with B {}
- """, options: [Flags.useOldFrontend]).then((env) {
- ResolutionDynamicType dynamic_ = env['dynamic'];
-
- ResolutionInterfaceType A = env['A'];
- ResolutionInterfaceType C = env['C'];
-
- // Ensure that members have been computed on all classes.
- MembersCreator.computeAllClassMembers(env.resolution, C.element);
-
- checkMember(C, 'm',
- checkType: NO_CLASS_MEMBER,
- inheritedFrom: A,
- functionType: env.functionType(dynamic_, []));
- }));
-}
diff --git a/tests/compiler/dart2js/old_frontend/message_kind_helper.dart b/tests/compiler/dart2js/old_frontend/message_kind_helper.dart
deleted file mode 100644
index f869e39..0000000
--- a/tests/compiler/dart2js/old_frontend/message_kind_helper.dart
+++ /dev/null
@@ -1,156 +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.
-
-library dart2js.test.message_kind_helper;
-
-import 'package:expect/expect.dart';
-import 'dart:async';
-
-import 'package:compiler/src/commandline_options.dart';
-import 'package:compiler/src/compiler.dart' show Compiler;
-import 'package:compiler/src/diagnostics/messages.dart'
- show MessageKind, MessageTemplate;
-import 'package:compiler/compiler_new.dart' show Diagnostic;
-
-import '../memory_compiler.dart';
-
-const String ESCAPE_REGEXP = r'[[\]{}()*+?.\\^$|]';
-
-/// Most examples generate a single diagnostic.
-/// Add an exception here if a single diagnostic cannot be produced.
-/// However, consider that a single concise diagnostic is easier to understand,
-/// so try to change error reporting logic before adding an exception.
-final Set<MessageKind> kindsWithExtraMessages = new Set<MessageKind>.from([
- // See http://dartbug.com/18361:
- MessageKind.CANNOT_EXTEND_MALFORMED,
- MessageKind.CANNOT_IMPLEMENT_MALFORMED,
- MessageKind.CANNOT_MIXIN,
- MessageKind.CANNOT_MIXIN_MALFORMED,
- MessageKind.CANNOT_INSTANTIATE_ENUM,
- MessageKind.CYCLIC_TYPEDEF_ONE,
- MessageKind.DUPLICATE_DEFINITION,
- MessageKind.EQUAL_MAP_ENTRY_KEY,
- MessageKind.FINAL_FUNCTION_TYPE_PARAMETER,
- MessageKind.FORMAL_DECLARED_CONST,
- MessageKind.FORMAL_DECLARED_STATIC,
- MessageKind.FUNCTION_TYPE_FORMAL_WITH_DEFAULT,
- MessageKind.HIDDEN_IMPLICIT_IMPORT,
- MessageKind.HIDDEN_IMPORT,
- MessageKind.INHERIT_GETTER_AND_METHOD,
- MessageKind.UNIMPLEMENTED_METHOD,
- MessageKind.UNIMPLEMENTED_METHOD_ONE,
- MessageKind.VAR_FUNCTION_TYPE_PARAMETER,
- MessageKind.UNMATCHED_TOKEN,
-]);
-
-/// Most messages can be tested without causing a fatal error. Add an exception
-/// here if a fatal error is unavoidable and leads to pending classes.
-/// Try to avoid adding exceptions here; a fatal error causes the compiler to
-/// stop before analyzing all input, and it isn't safe to reuse it.
-final Set<MessageKind> kindsWithPendingClasses = new Set<MessageKind>.from([
- // If you add something here, please file a *new* bug report.
-]);
-
-Future<Compiler> check(MessageTemplate template, Compiler cachedCompiler) {
- Expect.isFalse(template.examples.isEmpty);
-
- return Future.forEach(template.examples, (example) {
- if (example is String) {
- example = {'main.dart': example};
- } else {
- Expect.isTrue(
- example is Map, "Example must be either a String or a Map.");
- Expect.isTrue(example.containsKey('main.dart'),
- "Example map must contain a 'main.dart' entry.");
- }
- DiagnosticCollector collector = new DiagnosticCollector();
-
- Compiler compiler = compilerFor(
- memorySourceFiles: example,
- diagnosticHandler: collector,
- options: [
- Flags.analyzeOnly,
- Flags.enableExperimentalMirrors,
- Flags.useOldFrontend
- ]..addAll(template.options),
- cachedCompiler: cachedCompiler);
-
- return compiler.run(Uri.parse('memory:main.dart')).then((_) {
- Iterable<CollectedMessage> messages = collector.filterMessagesByKinds([
- Diagnostic.ERROR,
- Diagnostic.WARNING,
- Diagnostic.HINT,
- Diagnostic.CRASH
- ]);
-
- Expect.isFalse(messages.isEmpty, 'No messages in """$example"""');
-
- String expectedText = !template.hasHowToFix
- ? template.template
- : '${template.template}\n${template.howToFix}';
- String pattern = expectedText.replaceAllMapped(
- new RegExp(ESCAPE_REGEXP), (m) => '\\${m[0]}');
- pattern = pattern.replaceAll(new RegExp(r'#\\\{[^}]*\\\}'), '.*');
-
- bool checkMessage(CollectedMessage message) {
- if (message.message.kind != MessageKind.GENERIC) {
- return message.message.kind == template.kind;
- } else {
- return new RegExp('^$pattern\$').hasMatch(message.text);
- }
- }
-
- // TODO(johnniwinther): Extend MessageKind to contain information on
- // where info messages are expected.
- bool messageFound = false;
- List unexpectedMessages = [];
- for (CollectedMessage message in messages) {
- if (!messageFound && checkMessage(message)) {
- messageFound = true;
- } else {
- unexpectedMessages.add(message);
- }
- }
- Expect.isTrue(
- messageFound,
- '${template.kind}} does not match any in\n '
- '${messages.join('\n ')}\n'
- 'Consider searching for ${template.kind} in\n'
- ' pkg/compiler/lib/src/diagnostics/messages.dart\n'
- 'and removing the associated example');
- dynamic reporter = compiler.reporter;
- Expect.isFalse(reporter.hasCrashed);
- if (!unexpectedMessages.isEmpty) {
- for (CollectedMessage message in unexpectedMessages) {
- print("Unexpected message: $message");
- }
- if (!kindsWithExtraMessages.contains(template.kind)) {
- // Try changing the error reporting logic before adding an exception
- // to [kindsWithExtraMessages].
- throw 'Unexpected messages found.';
- }
- }
-
- bool pendingStuff = false;
- for (var e in compiler.resolver.pendingClassesToBePostProcessed) {
- pendingStuff = true;
- compiler.reporter.reportInfo(e, MessageKind.GENERIC,
- {'text': 'Pending class to be post-processed.'});
- }
- for (var e in compiler.resolver.pendingClassesToBeResolved) {
- pendingStuff = true;
- compiler.reporter.reportInfo(
- e, MessageKind.GENERIC, {'text': 'Pending class to be resolved.'});
- }
- Expect
- .isTrue(!pendingStuff || kindsWithPendingClasses.contains(template));
-
- if (!pendingStuff) {
- // If there is pending stuff, or the compiler was cancelled, we
- // shouldn't reuse the compiler.
- cachedCompiler = compiler;
- }
- });
- }).then((_) => cachedCompiler);
-}
diff --git a/tests/compiler/dart2js/old_frontend/message_kind_test.dart b/tests/compiler/dart2js/old_frontend/message_kind_test.dart
deleted file mode 100644
index c397ede..0000000
--- a/tests/compiler/dart2js/old_frontend/message_kind_test.dart
+++ /dev/null
@@ -1,64 +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';
-import 'dart:async';
-import "package:async_helper/async_helper.dart";
-import 'package:compiler/src/diagnostics/messages.dart'
- show MessageKind, MessageTemplate;
-
-import 'message_kind_helper.dart';
-
-main(List<String> arguments) {
- List<MessageTemplate> examples = <MessageTemplate>[];
- for (var kind in MessageKind.values) {
- MessageTemplate template = MessageTemplate.TEMPLATES[kind];
- Expect.isNotNull(template, "No template for $kind.");
- Expect.equals(kind, template.kind,
- "Invalid MessageTemplate.kind for $kind, found ${template.kind}.");
-
- String name = '${kind.toString()}'.substring('MessageKind.'.length);
- if (!arguments.isEmpty && !arguments.contains(name)) continue;
- if (name == 'GENERIC' // Shouldn't be used.
- // We can't provoke a crash.
- ||
- name == 'COMPILER_CRASHED' ||
- name == 'PLEASE_REPORT_THE_CRASH'
- // We cannot provide examples for patch errors.
- ||
- name.startsWith('PATCH_') ||
- name == 'LIBRARY_NOT_SUPPORTED'
- // TODO(johnniwinther): Remove these when [Compiler.reportUnusedCode] is
- // reenabled.
- ||
- name == 'UNUSED_METHOD' ||
- name == 'UNUSED_CLASS' ||
- name == 'UNUSED_TYPEDEF' ||
-
- // Fasta no longer generates EXTRANEOUS_MODIFIER_REPLACE.
- name == 'EXTRANEOUS_MODIFIER_REPLACE' ||
-
- // Fasta just reports EXTRANEOUS_MODIFIER.
- name == 'FORMAL_DECLARED_STATIC' ||
-
- // Additional warning from dart2js.
- name == 'VOID_NOT_ALLOWED') continue;
- if (template.examples != null) {
- examples.add(template);
- } else {
- print("No example in '$name'");
- }
- }
- ;
- var cachedCompiler;
- asyncTest(() => Future.forEach(examples, (MessageTemplate template) {
- print("Checking '${template.kind}'.");
- Stopwatch sw = new Stopwatch()..start();
- return check(template, cachedCompiler).then((var compiler) {
- cachedCompiler = compiler;
- sw.stop();
- print("Checked '${template.kind}' in ${sw.elapsedMilliseconds}ms.");
- });
- }));
-}
diff --git a/tests/compiler/dart2js/old_frontend/message_span_test.dart b/tests/compiler/dart2js/old_frontend/message_span_test.dart
deleted file mode 100644
index 6d774bc..0000000
--- a/tests/compiler/dart2js/old_frontend/message_span_test.dart
+++ /dev/null
@@ -1,184 +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.
-
-import 'dart:convert' show json, utf8;
-import 'package:async_helper/async_helper.dart';
-import 'package:compiler/src/commandline_options.dart';
-import 'package:compiler/src/diagnostics/messages.dart';
-import 'package:compiler/src/io/source_file.dart';
-import 'package:expect/expect.dart';
-import '../memory_compiler.dart';
-import '../memory_source_file_helper.dart';
-
-const List<Test> TESTS = const <Test>[
- const Test('''
-class A { A(b); }
-class B extends A {
- a() {}
-
- lot() {}
-
- of() {}
-
- var members;
-}
-main() => new B();''', const {
- MessageKind.NO_MATCHING_CONSTRUCTOR_FOR_IMPLICIT: '''
-class B extends A {
-^^^^^^^^^^^^^^^^^'''
- }),
- const Test('''
-class I {}
-class A { A(b); }
-class B extends A implements I {
- a() {}
-
- lot() {}
-
- of() {}
-
- var members;
-}
-main() => new B();''', const {
- MessageKind.NO_MATCHING_CONSTRUCTOR_FOR_IMPLICIT: '''
-class B extends A implements I {
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^'''
- }),
- const Test('''
-class M<T> {}
-class A { A(b); }
-class B extends A with M<int> {
- a() {}
-
- lot() {}
-
- of() {}
-
- var members;
-}
-main() => new B();''', const {
- MessageKind.NO_MATCHING_CONSTRUCTOR_FOR_IMPLICIT: '''
-class B extends A with M<int> {
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^'''
- }),
- const Test('''
-class A { A(b); }
-class B
- extends A {
- a() {}
-
- lot() {}
-
- of() {}
-
- var members;
-}
-main() => new B();''', const {
- MessageKind.NO_MATCHING_CONSTRUCTOR_FOR_IMPLICIT: '''
-class B
- extends A {
-'''
- }),
- const Test('''
-void foo(int a) {
- // a
- // non-empty
- // body
-}
-main() => foo('');''', const {
- MessageKind.THIS_IS_THE_METHOD: '''
-void foo(int a) {
-^^^^^^^^^^^^^^^'''
- }),
- const Test('''
-void foo(int a,
- int b) {
- // a
- // non-empty
- // body
-}
-main() => foo('', 0);''', const {
- MessageKind.THIS_IS_THE_METHOD: '''
-void foo(int a,
- int b) {
-'''
- }),
- const Test('''
-class A {
- int foo() {
- // a
- // non-empty
- // body
- }
-}
-class B extends A {
- int get foo {
- // a
- // non-empty
- // body
- return 0;
- }
-}
-main() => new B();''', const {
- MessageKind.CANNOT_OVERRIDE_METHOD_WITH_GETTER: '''
- int get foo {
- ^^^^^^^^^^^''',
- MessageKind.CANNOT_OVERRIDE_METHOD_WITH_GETTER_CONT: '''
- int foo() {
- ^^^^^^^^^'''
- }),
-];
-
-class Test {
- final String code;
- final Map<MessageKind, String> kindToSpan;
-
- const Test(this.code, this.kindToSpan);
-}
-
-const String MARKER = '---marker---';
-
-main() {
- asyncTest(() async {
- var cachedCompiler;
- for (Test test in TESTS) {
- DiagnosticCollector collector = new DiagnosticCollector();
- CompilationResult result = await runCompiler(
- memorySourceFiles: {'main.dart': test.code},
- options: [Flags.analyzeOnly, Flags.useOldFrontend],
- diagnosticHandler: collector,
- cachedCompiler: cachedCompiler);
- cachedCompiler = result.compiler;
- MemorySourceFileProvider provider = cachedCompiler.provider;
- Map<MessageKind, String> kindToSpan =
- new Map<MessageKind, String>.from(test.kindToSpan);
- for (CollectedMessage message in collector.messages) {
- String expectedSpanText = kindToSpan[message.messageKind];
- if (expectedSpanText != null) {
- SourceFile sourceFile = provider.getUtf8SourceFile(message.uri);
- String locationMessage =
- sourceFile.getLocationMessage(MARKER, message.begin, message.end);
- // Remove `filename:line:column:` and message.
- String strippedLocationMessage = locationMessage
- .substring(locationMessage.indexOf(MARKER) + MARKER.length + 1);
- // Using jsonEncode to add string quotes and backslashes.
- String expected = json.encode(
- utf8.decode(expectedSpanText.codeUnits, allowMalformed: true));
- String actual = json.encode(utf8
- .decode(strippedLocationMessage.codeUnits, allowMalformed: true));
- Expect.equals(
- expectedSpanText,
- strippedLocationMessage,
- "Unexpected span for ${message.messageKind} in\n${test.code}"
- "\nExpected: $expected"
- "\nActual : $actual");
- kindToSpan.remove(message.messageKind);
- }
- }
- kindToSpan.forEach((MessageKind kind, _) {
- Expect.fail("Missing message kin $kind in\n${test.code}");
- });
- }
- });
-}
diff --git a/tests/compiler/dart2js/old_frontend/metadata_test.dart b/tests/compiler/dart2js/old_frontend/metadata_test.dart
deleted file mode 100644
index f24dcf22..0000000
--- a/tests/compiler/dart2js/old_frontend/metadata_test.dart
+++ /dev/null
@@ -1,242 +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:async_helper/async_helper.dart';
-import 'package:compiler/src/constants/values.dart'
- show ConstantValue, StringConstantValue;
-import 'package:expect/expect.dart';
-import '../compiler_helper.dart';
-import 'package:compiler/src/parser/partial_elements.dart'
- show PartialMetadataAnnotation;
-import 'package:compiler/src/diagnostics/diagnostic_listener.dart'
- show DiagnosticReporter;
-
-void checkPosition(Spannable spannable, Node node, String source,
- DiagnosticReporter reporter) {
- SourceSpan span = reporter.spanFromSpannable(spannable);
- Expect.isTrue(
- span.begin < span.end, 'begin = ${span.begin}; end = ${span.end}');
- Expect.isTrue(
- span.end < source.length, 'end = ${span.end}; length = ${source.length}');
- String yield = source.substring(span.begin, span.end);
-
- // TODO(ahe): The node does not include "@". Fix that.
- Expect.stringEquals('@$node', yield);
-}
-
-void checkAnnotation(String name, String declaration,
- {bool isTopLevelOnly: false}) {
- // Ensure that a compile-time constant can be resolved from an
- // annotation.
- var source1 = """const native = 'xyz';
- @native
- $declaration
- main() {}""";
-
- analyzeAndCheck(source1, name, (compiler, element) {
- compiler.enqueuer.resolution.queueIsClosed = false;
- Expect.equals(
- 1, element.metadata.length, 'Unexpected metadata count on $element.');
- PartialMetadataAnnotation annotation = element.metadata.first;
- annotation.ensureResolved(compiler.resolution);
- ConstantValue value =
- compiler.constants.getConstantValue(annotation.constant);
- Expect.isTrue(value is StringConstantValue);
- Expect.stringEquals('xyz', (value as StringConstantValue).stringValue);
-
- checkPosition(
- annotation, annotation.cachedNode, source1, compiler.reporter);
- });
-
- // Ensure that each repeated annotation has a unique instance of
- // [MetadataAnnotation].
- var source2 = """const native = 'xyz';
- @native @native
- $declaration
- main() {}""";
-
- analyzeAndCheck(source2, name, (compiler, element) {
- compiler.enqueuer.resolution.queueIsClosed = false;
- Expect.equals(2, element.metadata.length);
- PartialMetadataAnnotation annotation1 = element.metadata.elementAt(0);
- PartialMetadataAnnotation annotation2 = element.metadata.elementAt(1);
- annotation1.ensureResolved(compiler.resolution);
- annotation2.ensureResolved(compiler.resolution);
- Expect.isFalse(
- identical(annotation1, annotation2), 'expected unique instances');
- Expect.notEquals(annotation1, annotation2, 'expected unequal instances');
- ConstantValue value1 =
- compiler.constants.getConstantValue(annotation1.constant);
- ConstantValue value2 =
- compiler.constants.getConstantValue(annotation2.constant);
- Expect.identical(value1, value2, 'expected same compile-time constant');
- Expect.isTrue(value1 is StringConstantValue);
- Expect.isTrue(value2 is StringConstantValue);
- Expect.stringEquals('xyz', (value1 as StringConstantValue).stringValue);
- Expect.stringEquals('xyz', (value2 as StringConstantValue).stringValue);
-
- checkPosition(
- annotation1, annotation1.cachedNode, source2, compiler.reporter);
- checkPosition(
- annotation2, annotation2.cachedNode, source2, compiler.reporter);
- });
-
- if (isTopLevelOnly) return;
-
- // Ensure that a compile-time constant can be resolved from an
- // annotation.
- var source3 = """const native = 'xyz';
- class Foo {
- @native
- $declaration
- }
- main() {}""";
-
- analyzeAndCheck(source3, 'Foo', (compiler, dynamic element) {
- compiler.enqueuer.resolution.queueIsClosed = false;
- Expect.equals(0, element.metadata.length);
- element.ensureResolved(compiler.resolution);
- Expect.equals(0, element.metadata.length);
- element = element.lookupLocalMember(name);
- Expect.equals(1, element.metadata.length);
- PartialMetadataAnnotation annotation = element.metadata.first;
- annotation.ensureResolved(compiler.resolution);
- ConstantValue value =
- compiler.constants.getConstantValue(annotation.constant);
- Expect.isTrue(value is StringConstantValue);
- Expect.stringEquals('xyz', (value as StringConstantValue).stringValue);
-
- checkPosition(
- annotation, annotation.cachedNode, source3, compiler.reporter);
- });
-
- // Ensure that each repeated annotation has a unique instance of
- // [MetadataAnnotation].
- var source4 = """const native = 'xyz';
- class Foo {
- @native @native
- $declaration
- }
- main() {}""";
-
- analyzeAndCheck(source4, 'Foo', (compiler, dynamic element) {
- compiler.enqueuer.resolution.queueIsClosed = false;
- Expect.equals(0, element.metadata.length);
- element.ensureResolved(compiler.resolution);
- Expect.equals(0, element.metadata.length);
- element = element.lookupLocalMember(name);
- Expect.equals(2, element.metadata.length);
- PartialMetadataAnnotation annotation1 = element.metadata.elementAt(0);
- PartialMetadataAnnotation annotation2 = element.metadata.elementAt(1);
- annotation1.ensureResolved(compiler.resolution);
- annotation2.ensureResolved(compiler.resolution);
- Expect.isFalse(
- identical(annotation1, annotation2), 'expected unique instances');
- Expect.notEquals(annotation1, annotation2, 'expected unequal instances');
- ConstantValue value1 =
- compiler.constants.getConstantValue(annotation1.constant);
- ConstantValue value2 =
- compiler.constants.getConstantValue(annotation2.constant);
- Expect.identical(value1, value2, 'expected same compile-time constant');
- Expect.isTrue(value1 is StringConstantValue);
- Expect.isTrue(value2 is StringConstantValue);
- Expect.stringEquals('xyz', (value1 as StringConstantValue).stringValue);
- Expect.stringEquals('xyz', (value2 as StringConstantValue).stringValue);
-
- checkPosition(
- annotation1, annotation1.cachedNode, source4, compiler.reporter);
- checkPosition(
- annotation1, annotation2.cachedNode, source4, compiler.reporter);
- });
-}
-
-void testClassMetadata() {
- checkAnnotation('Foo', 'class Foo {}', isTopLevelOnly: true);
-}
-
-void testTopLevelMethodMetadata() {
- checkAnnotation('foo', 'foo() {}');
-}
-
-void testTopLevelFieldMetadata() {
- checkAnnotation('foo', 'var foo;');
- checkAnnotation('bar', 'var foo, bar;');
-}
-
-void testLibraryTags() {
- void compileAndCheckLibrary(String source,
- List<MetadataAnnotation> extractMetadata(LibraryElement element)) {
- Uri partUri = new Uri(scheme: 'source', path: 'part.dart');
- String partSource = '@native part of foo;';
-
- Uri libUri = new Uri(scheme: 'source', path: 'lib.dart');
- String libSource = 'library lib;';
-
- Uri uri = new Uri(scheme: 'source', path: 'main.dart');
-
- var compiler = mockCompilerFor(source, uri, analyzeOnly: true)
- ..registerSource(partUri, partSource)
- ..registerSource(libUri, libSource);
-
- asyncTest(() => compiler.run(uri).then((_) {
- compiler.enqueuer.resolution.queueIsClosed = false;
- LibraryElement element = compiler.libraryLoader.lookupLibrary(uri);
- Expect.isNotNull(element, 'Cannot find $uri');
-
- List<MetadataAnnotation> metadata = extractMetadata(element);
- Expect.equals(1, metadata.length);
-
- PartialMetadataAnnotation annotation = metadata.first;
- annotation.ensureResolved(compiler.resolution);
- ConstantValue value =
- compiler.constants.getConstantValue(annotation.constant);
- Expect.isTrue(value is StringConstantValue);
- Expect.stringEquals(
- 'xyz', (value as StringConstantValue).stringValue);
-
- checkPosition(
- annotation, annotation.cachedNode, source, compiler.reporter);
- }));
- }
-
- var source;
-
- source = """@native
- library foo;
- const native = 'xyz';
- main() {}""";
- compileAndCheckLibrary(source, (dynamic e) => e.libraryTag.metadata);
-
- source = """@native
- import 'lib.dart';
- const native = 'xyz';
- main() {}""";
- compileAndCheckLibrary(source, (dynamic e) => e.tags.single.metadata);
-
- source = """@native
- export 'lib.dart';
- const native = 'xyz';
- main() {}""";
- compileAndCheckLibrary(source, (dynamic e) => e.tags.single.metadata);
-
- source = """@native
- part 'part.dart';
- const native = 'xyz';
- main() {}""";
- compileAndCheckLibrary(source, (dynamic e) => e.tags.single.metadata);
-
- source = """@native
- part 'part.dart';
- const native = 'xyz';
- main() {}""";
- compileAndCheckLibrary(
- source, (dynamic e) => e.compilationUnits.first.partTag.metadata);
-}
-
-void main() {
- testClassMetadata();
- testTopLevelMethodMetadata();
- testTopLevelFieldMetadata();
- testLibraryTags();
-}
diff --git a/tests/compiler/dart2js/old_frontend/method_type_variable_test.dart b/tests/compiler/dart2js/old_frontend/method_type_variable_test.dart
deleted file mode 100644
index 00a037a..0000000
--- a/tests/compiler/dart2js/old_frontend/method_type_variable_test.dart
+++ /dev/null
@@ -1,144 +0,0 @@
-import 'package:async_helper/async_helper.dart';
-import 'package:compiler/src/commandline_options.dart';
-import 'package:compiler/src/diagnostics/messages.dart';
-import 'package:expect/expect.dart';
-import '../memory_compiler.dart';
-
-runTest(String code,
- {List<MessageKind> expectedWarnings: const <MessageKind>[],
- List<MessageKind> expectedHints: const <MessageKind>[]}) async {
- print('--test--------------------------------------------------------------');
- print(code);
- DiagnosticCollector collector = new DiagnosticCollector();
- await runCompiler(
- memorySourceFiles: {'main.dart': code},
- diagnosticHandler: collector,
- options: [Flags.useOldFrontend]);
- Expect.equals(0, collector.errors.length, "Unexpected errors.");
- Expect.listEquals(
- expectedWarnings,
- collector.warnings.map((m) => m.messageKind).toList(),
- "Unexpected warnings.");
- Expect.listEquals(expectedHints,
- collector.hints.map((m) => m.messageKind).toList(), "Unexpected hints.");
-}
-
-class Test {
- final String code;
- final List<MessageKind> warnings;
- final List<MessageKind> hints;
-
- const Test(this.code,
- {this.warnings: const <MessageKind>[],
- this.hints: const <MessageKind>[]});
-}
-
-const List<Test> tests = const <Test>[
- /// Is-test on method type variable in unused static method.
- const Test('''
-method<T>(T t) => t is T;
-main() {}
-'''),
-
- /// Is-test on method type variable in used static method.
- const Test('''
-method<T>(T t) => t is T;
-main() => method<int>(0);
-''', warnings: const <MessageKind>[
- MessageKind.TYPE_VARIABLE_FROM_METHOD_NOT_REIFIED
- ]),
-
- /// Is-test on method type variable in unused instance method.
- const Test('''
-class C {
- method<T>(T t) => t is T;
-}
-main() => new C();
-'''),
-
- /// Is-test on method type variable in used instance method.
- const Test('''
-class C {
- method<T>(T t) => t is T;
-}
-main() => new C().method<int>(0);
-''', warnings: const <MessageKind>[
- MessageKind.TYPE_VARIABLE_FROM_METHOD_NOT_REIFIED
- ]),
-
- /// As-cast on method type variable in unused static method.
- const Test('''
-method<T>(T t) => t as T;
-main() {}
-'''),
-
- /// As-cast on method type variable in used static method.
- const Test('''
-method<T>(T t) => t as T;
-main() => method<int>(0);
-''', hints: const <MessageKind>[
- MessageKind.TYPE_VARIABLE_FROM_METHOD_CONSIDERED_DYNAMIC
- ]),
-
- /// As-cast on method type variable in unused instance method.
- const Test('''
-class C {
- method<T>(T t) => t as T;
-}
-main() => new C();
-'''),
-
- /// As-cast on method type variable in used instance method.
- const Test('''
-class C {
- method<T>(T t) => t as T;
-}
-main() => new C().method<int>(0);
-''', hints: const <MessageKind>[
- MessageKind.TYPE_VARIABLE_FROM_METHOD_CONSIDERED_DYNAMIC
- ]),
-
- /// Method type variable literal in unused static method.
- const Test('''
-method<T>() => T;
-main() {}
-'''),
-
- /// Method type variable literal in used static method.
- const Test('''
-method<T>() => T;
-main() => method<int>();
-''', warnings: const <MessageKind>[
- MessageKind.TYPE_VARIABLE_FROM_METHOD_NOT_REIFIED
- ]),
-
- /// Method type variable literal in unused instance method.
- const Test('''
-class C {
- method<T>() => T;
-}
-main() => new C();
-'''),
-
- /// Method type variable literal in used instance method.
- const Test('''
-class C {
- method<T>() => T;
-}
-main() => new C().method<int>();
-''', warnings: const <MessageKind>[
- MessageKind.TYPE_VARIABLE_FROM_METHOD_NOT_REIFIED
- ]),
-];
-
-main() {
- asyncTest(() async {
- for (Test test in tests) {
- await runTest(
- test.code,
- expectedWarnings: test.warnings,
- expectedHints: test.hints,
- );
- }
- });
-}
diff --git a/tests/compiler/dart2js/old_frontend/minimal_resolution_test.dart b/tests/compiler/dart2js/old_frontend/minimal_resolution_test.dart
deleted file mode 100644
index c266e93..0000000
--- a/tests/compiler/dart2js/old_frontend/minimal_resolution_test.dart
+++ /dev/null
@@ -1,63 +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 that elements are not needlessly required by dart2js.
-
-import 'package:async_helper/async_helper.dart';
-import 'package:compiler/src/commandline_options.dart';
-import 'package:compiler/src/common/names.dart';
-import 'package:compiler/src/compiler.dart';
-import 'package:compiler/src/elements/elements.dart';
-import 'package:compiler/src/enqueue.dart';
-import 'package:expect/expect.dart';
-import '../memory_compiler.dart';
-
-main() {
- asyncTest(() async {
- await analyze('main() {}');
- await analyze('main() => proxy;', proxyConstantComputed: true);
- await analyze('@deprecated main() {}');
- await analyze('@deprecated main() => deprecated;', deprecatedClass: true);
- await analyze('main() => deprecated;', deprecatedClass: true);
- });
-}
-
-void checkInstantiated(Compiler compiler, ClassElement cls, bool expected) {
- ResolutionEnqueuer enqueuer = compiler.enqueuer.resolution;
- bool isInstantiated =
- enqueuer.worldBuilder.directlyInstantiatedClasses.contains(cls);
- bool isProcessed = enqueuer.processedClasses.contains(cls);
- Expect.equals(expected, isInstantiated,
- 'Unexpected instantiation state of class $cls.');
- Expect.equals(
- expected, isProcessed, 'Unexpected processing state of class $cls.');
-}
-
-analyze(String code,
- {bool proxyConstantComputed: false, bool deprecatedClass: false}) async {
- CompilationResult result = await runCompiler(
- memorySourceFiles: {'main.dart': code},
- options: ['--analyze-only', Flags.useOldFrontend]);
- Expect.isTrue(result.isSuccess);
- Compiler compiler = result.compiler;
- Expect.equals(
- proxyConstantComputed,
- compiler.resolution.wasProxyConstantComputedTestingOnly,
- "Unexpected computation of proxy constant.");
-
- LibraryElement coreLibrary =
- compiler.frontendStrategy.commonElements.coreLibrary;
- checkInstantiated(
- compiler, coreLibrary.find('_Proxy'), proxyConstantComputed);
- checkInstantiated(compiler, coreLibrary.find('Deprecated'), deprecatedClass);
-
- LibraryElement jsHelperLibrary =
- compiler.libraryLoader.lookupLibrary(Uris.dart__js_helper);
- jsHelperLibrary.forEachLocalMember((Element element) {
- Uri uri = element.compilationUnit.script.resourceUri;
- if (element.isClass && uri.path.endsWith('annotations.dart')) {
- checkInstantiated(compiler, element, false);
- }
- });
-}
diff --git a/tests/compiler/dart2js/old_frontend/missing_file_test.dart b/tests/compiler/dart2js/old_frontend/missing_file_test.dart
deleted file mode 100644
index 5fdbb8a..0000000
--- a/tests/compiler/dart2js/old_frontend/missing_file_test.dart
+++ /dev/null
@@ -1,85 +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 the compiler can handle imports when package root has not been set.
-
-library dart2js.test.missing_file;
-
-import 'dart:async';
-import 'package:async_helper/async_helper.dart';
-import 'package:compiler/src/commandline_options.dart';
-import "package:compiler/src/diagnostics/messages.dart";
-import 'package:expect/expect.dart';
-import '../memory_compiler.dart';
-
-const MEMORY_SOURCE_FILES = const {
- 'main.dart': '''
-import 'foo.dart';
-main() {}
-''',
- 'bar.dart': '''
-import 'dart:foo';
-main() {}
-''',
- 'baz.dart': '''
-import 'dart:io';
-main() {}
-''',
-};
-
-Future runTest(Uri main, {MessageKind error, MessageKind info}) async {
- print("----\nentry-point: $main\n");
-
- DiagnosticCollector diagnostics = new DiagnosticCollector();
- OutputCollector output = new OutputCollector();
- await runCompiler(
- entryPoint: main,
- memorySourceFiles: MEMORY_SOURCE_FILES,
- diagnosticHandler: diagnostics,
- outputProvider: output,
- options: [Flags.useOldFrontend]);
-
- Expect.isFalse(output.hasExtraOutput);
- Expect.equals(error != null ? 1 : 0, diagnostics.errors.length);
- if (error != null) {
- Expect.equals(error, diagnostics.errors.first.message.kind);
- }
- Expect.equals(info != null ? 1 : 0, diagnostics.infos.length);
- if (info != null) {
- Expect.equals(info, diagnostics.infos.first.message.kind);
- }
- Expect.equals(0, diagnostics.warnings.length);
- Expect.equals(0, diagnostics.hints.length);
-}
-
-void main() {
- asyncTest(() async {
- await runTest(Uri.parse('memory:main.dart'),
- error: MessageKind.READ_URI_ERROR);
-
- await runTest(Uri.parse('memory:foo.dart'),
- error: MessageKind.READ_SELF_ERROR);
-
- await runTest(Uri.parse('dart:foo'), error: MessageKind.LIBRARY_NOT_FOUND);
-
- await runTest(Uri.parse('dart:_mirror_helper'),
- error: MessageKind.INTERNAL_LIBRARY,
- info: MessageKind.DISALLOWED_LIBRARY_IMPORT);
-
- await runTest(Uri.parse('memory:bar.dart'),
- error: MessageKind.LIBRARY_NOT_FOUND);
-
- // Importing dart:io is temporarily allowed as a stopgap measure for the
- // lack of config specific imports. Once that is added, this will be
- // disallowed again.
-
- //await runTest(Uri.parse('dart:io'),
- // error: MessageKind.LIBRARY_NOT_SUPPORTED,
- // info: MessageKind.DISALLOWED_LIBRARY_IMPORT);
-
- //await runTest(Uri.parse('memory:baz.dart'),
- // error: MessageKind.LIBRARY_NOT_SUPPORTED,
- // info: MessageKind.DISALLOWED_LIBRARY_IMPORT);
- });
-}
diff --git a/tests/compiler/dart2js/old_frontend/mixin_language_test.dart b/tests/compiler/dart2js/old_frontend/mixin_language_test.dart
deleted file mode 100644
index 89b4e0f..0000000
--- a/tests/compiler/dart2js/old_frontend/mixin_language_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.
-
-// Test that dart2js produces the expected static type warnings for these
-// language tests. This ensures that the analyzer and dart2js agrees on the
-// tests.
-
-import 'warnings_checker.dart';
-
-/// Map from test files to a map of their expected status. If the status map is
-/// `null` no warnings must be missing or unexpected, otherwise the status map
-/// can contain a list of line numbers for keys 'missing' and 'unexpected' for
-/// the warnings of each category.
-const Map<String, dynamic> TESTS = const {
- 'language_2/typevariable_substitution2_test.dart': null,
-};
-
-void main(List<String> arguments) {
- checkWarnings(TESTS, arguments);
-}
diff --git a/tests/compiler/dart2js/old_frontend/mock_compiler.dart b/tests/compiler/dart2js/old_frontend/mock_compiler.dart
deleted file mode 100644
index 2bb5bee..0000000
--- a/tests/compiler/dart2js/old_frontend/mock_compiler.dart
+++ /dev/null
@@ -1,401 +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 mock_compiler;
-
-import 'dart:async';
-import 'dart:collection';
-
-import 'package:compiler/compiler_new.dart' as api;
-import 'package:compiler/src/common/names.dart' show Uris;
-import 'package:compiler/src/constants/expressions.dart';
-import 'package:compiler/src/elements/resolution_types.dart'
- show ResolutionDartType;
-import 'package:compiler/src/diagnostics/diagnostic_listener.dart';
-import 'package:compiler/src/diagnostics/source_span.dart';
-import 'package:compiler/src/diagnostics/spannable.dart';
-import 'package:compiler/src/elements/elements.dart';
-import 'package:compiler/src/elements/visitor.dart';
-import 'package:compiler/src/library_loader.dart' show LoadedLibraries;
-import 'package:compiler/src/io/source_file.dart';
-import 'package:compiler/src/options.dart' show CompilerOptions;
-import 'package:compiler/src/resolution/members.dart';
-import 'package:compiler/src/resolution/registry.dart';
-import 'package:compiler/src/resolution/scope.dart';
-import 'package:compiler/src/resolution/tree_elements.dart';
-import 'package:compiler/src/resolved_uri_translator.dart';
-import 'package:compiler/src/script.dart';
-import 'package:compiler/src/tree/tree.dart';
-import 'package:compiler/src/old_to_new_api.dart';
-import 'parser_helper.dart';
-
-import 'package:compiler/src/elements/modelx.dart'
- show ErroneousElementX, FunctionElementX;
-
-import 'package:compiler/src/compiler.dart';
-import 'package:compiler/src/common/tasks.dart' show Measurer;
-
-import 'package:compiler/src/deferred_load.dart' show OutputUnit;
-
-import 'package:compiler/src/resolution/deferred_load.dart'
- show AstDeferredLoadTask;
-
-import 'mock_libraries.dart';
-import '../diagnostic_helper.dart';
-
-export '../diagnostic_helper.dart';
-
-final Uri PATCH_CORE = new Uri(scheme: 'patch', path: 'core');
-
-typedef String LibrarySourceProvider(Uri uri);
-
-class MockCompiler extends Compiler {
- api.CompilerDiagnostics diagnosticHandler;
- final api.CompilerInput provider = null;
-
- /// Expected number of warnings. If `null`, the number of warnings is
- /// not checked.
- final int expectedWarnings;
-
- /// Expected number of errors. If `null`, the number of errors is not checked.
- final int expectedErrors;
- final Map<String, SourceFile> sourceFiles;
- Node parsedTree;
- final LibrarySourceProvider librariesOverride;
- final DiagnosticCollector diagnosticCollector = new DiagnosticCollector();
- final ResolvedUriTranslator resolvedUriTranslator =
- new MockResolvedUriTranslator();
- final Measurer measurer = new Measurer();
- LibraryElement mainApp;
-
- MockCompiler.internal(
- {Map<String, String> coreSource,
- bool enableTypeAssertions: false,
- bool enableUserAssertions: false,
- bool enableMinification: false,
- bool disableTypeInference: false,
- bool analyzeAll: false,
- bool analyzeOnly: false,
- // Our unit tests check code generation output that is
- // affected by inlining support.
- bool disableInlining: true,
- bool trustTypeAnnotations: false,
- bool trustJSInteropTypeAnnotations: false,
- bool enableAsyncAwait: false,
- int this.expectedWarnings,
- int this.expectedErrors,
- api.CompilerOutput outputProvider,
- LibrarySourceProvider this.librariesOverride})
- : sourceFiles = new Map<String, SourceFile>(),
- super(
- options: new CompilerOptions()
- ..entryPoint = new Uri(scheme: 'mock')
- ..libraryRoot = Uri.parse('placeholder_library_root_for_mock/')
- ..useKernel = false
- ..enableTypeAssertions = enableTypeAssertions
- ..enableUserAssertions = enableUserAssertions
- ..disableInlining = disableInlining
- ..enableAssertMessage = true
- ..enableMinification = enableMinification
- ..disableTypeInference = disableTypeInference
- ..analyzeAll = analyzeAll
- ..analyzeOnly = analyzeOnly
- ..trustTypeAnnotations = trustTypeAnnotations
- ..trustJSInteropTypeAnnotations = trustJSInteropTypeAnnotations
- ..shownPackageWarnings = const [],
- outputProvider: outputProvider) {
- deferredLoadTask = new MockDeferredLoadTask(this);
-
- registerSource(
- Uris.dart_core, buildLibrarySource(DEFAULT_CORE_LIBRARY, coreSource));
- registerSource(PATCH_CORE, DEFAULT_PATCH_CORE_SOURCE);
- registerSource(
- Uris.dart__internal, buildLibrarySource(DEFAULT_INTERNAL_LIBRARY));
-
- registerSource(
- Uris.dart__js_helper, buildLibrarySource(DEFAULT_JS_HELPER_LIBRARY));
- registerSource(Uris.dart__foreign_helper,
- buildLibrarySource(DEFAULT_FOREIGN_HELPER_LIBRARY));
- registerSource(Uris.dart__interceptors,
- buildLibrarySource(DEFAULT_INTERCEPTORS_LIBRARY));
- registerSource(Uris.dart__isolate_helper,
- buildLibrarySource(DEFAULT_ISOLATE_HELPER_LIBRARY));
- registerSource(Uris.dart_mirrors, DEFAULT_MIRRORS_SOURCE);
- registerSource(Uris.dart__js_mirrors, DEFAULT_JS_MIRRORS_SOURCE);
-
- Map<String, String> asyncLibrarySource = <String, String>{};
- asyncLibrarySource.addAll(DEFAULT_ASYNC_LIBRARY);
- if (enableAsyncAwait) {
- asyncLibrarySource.addAll(ASYNC_AWAIT_LIBRARY);
- }
- registerSource(Uris.dart_async, buildLibrarySource(asyncLibrarySource));
- }
-
- /// Initialize the mock compiler with an empty main library.
- Future<Uri> init([String mainSource = ""]) {
- Uri uri = new Uri(scheme: "mock");
- registerSource(uri, mainSource);
- return libraryLoader
- .loadLibrary(uri)
- .then((LoadedLibraries loadedLibraries) {
- processLoadedLibraries(loadedLibraries);
- mainApp = loadedLibraries.rootLibrary;
- startResolution();
- // We need to make sure the Object class is resolved. When registering a
- // dynamic invocation the ArgumentTypesRegistry eventually iterates over
- // the interfaces of the Object class which would be 'null' if the class
- // wasn't resolved.
- ClassElement objectClass = resolution.commonElements.objectClass;
- objectClass.ensureResolved(resolution);
- }).then((_) => uri);
- }
-
- Future<bool> run(Uri uri, [String mainSource = ""]) {
- return init(mainSource).then((Uri mainUri) {
- return super.run(uri == null ? mainUri : uri);
- }).then((result) {
- if (expectedErrors != null &&
- expectedErrors != diagnosticCollector.errors.length) {
- throw "unexpected error during compilation "
- "${diagnosticCollector.errors}";
- } else if (expectedWarnings != null &&
- expectedWarnings != diagnosticCollector.warnings.length) {
- throw "unexpected warnings during compilation "
- "${diagnosticCollector.warnings}";
- } else {
- return result;
- }
- });
- }
-
- /**
- * Registers the [source] with [uri] making it possible load [source] as a
- * library. If an override has been provided in [librariesOverride], that
- * is used instead.
- */
- void registerSource(Uri uri, String source) {
- if (librariesOverride != null) {
- String override = librariesOverride(uri);
- if (override != null) {
- source = override;
- }
- }
- sourceFiles[uri.toString()] = new MockFile(source);
- }
-
- void reportDiagnostic(DiagnosticMessage message,
- List<DiagnosticMessage> infoMessages, api.Diagnostic kind) {
- void processMessage(DiagnosticMessage message, api.Diagnostic kind) {
- SourceSpan span = message.sourceSpan;
- Uri uri;
- int begin;
- int end;
- String text = '${message.message}';
- if (span != null) {
- uri = span.uri;
- begin = span.begin;
- end = span.end;
- }
- diagnosticCollector.report(message.message, uri, begin, end, text, kind);
- if (diagnosticHandler != null) {
- diagnosticHandler.report(message.message, uri, begin, end, text, kind);
- }
- }
-
- processMessage(message, kind);
- infoMessages.forEach((i) => processMessage(i, api.Diagnostic.INFO));
- }
-
- CollectingTreeElements resolveStatement(String text) {
- parsedTree = parseStatement(text);
- LibraryElement library = mainApp;
- return resolveNodeStatement(parsedTree, new MockElement(library));
- }
-
- TreeElementMapping resolveNodeStatement(
- Node tree, ExecutableElement element) {
- ResolverVisitor visitor = new ResolverVisitor(
- this.resolution,
- element,
- new ResolutionRegistry(
- this.backend.target, new CollectingTreeElements(element)),
- scope:
- new MockTypeVariablesScope(element.enclosingElement.buildScope()));
- if (visitor.scope is LibraryScope ||
- visitor.scope is MockTypeVariablesScope) {
- visitor.scope = new MethodScope(visitor.scope, element);
- }
- visitor.visit(tree);
- visitor.scope = new LibraryScope(element.library);
- return visitor.registry.mapping;
- }
-
- resolverVisitor() {
- LibraryElement library = mainApp;
- Element mockElement = new MockElement(library.entryCompilationUnit);
- ResolverVisitor visitor = new ResolverVisitor(
- this.resolution,
- mockElement,
- new ResolutionRegistry(
- this.backend.target, new CollectingTreeElements(mockElement)),
- scope: mockElement.enclosingElement.buildScope());
- visitor.scope = new MethodScope(visitor.scope, mockElement);
- return visitor;
- }
-
- parseScript(String text, [LibraryElement library]) {
- if (library == null) library = mainApp;
- parseUnit(text, this, library, registerSource);
- }
-
- Future scanBuiltinLibraries() {
- // Do nothing. The mock core library is already handled in the constructor.
- return new Future.value();
- }
-
- Future<LibraryElement> scanBuiltinLibrary(String name) {
- // Do nothing. The mock core library is already handled in the constructor.
- return new Future.value();
- }
-
- // The mock library doesn't need any patches.
- Uri resolvePatchUri(String dartLibraryName) {
- if (dartLibraryName == 'core') {
- return PATCH_CORE;
- }
- return null;
- }
-
- Future<Script> readScript(Uri uri, [Spannable spannable]) {
- SourceFile sourceFile = sourceFiles[uri.toString()];
- if (sourceFile == null) throw new ArgumentError(uri);
- return new Future.value(new Script(uri, uri, sourceFile));
- }
-
- Element lookupElementIn(ScopeContainerElement container, name) {
- Element element = container.localLookup(name);
- return element != null
- ? element
- : new ErroneousElementX(null, null, name, container);
- }
-
- /// Create a new [MockCompiler] and apply it asynchronously to [f].
- static Future<T> create<T>(FutureOr<T> f(MockCompiler compiler)) {
- MockCompiler compiler = new MockCompiler.internal();
- return compiler.init().then((_) => f(compiler));
- }
-}
-
-class MockResolvedUriTranslator implements ResolvedUriTranslator {
- static final dynamic _emptySet = new Set();
-
- Uri translate(LibraryElement importingLibrary, Uri resolvedUri,
- Spannable spannable) =>
- resolvedUri;
- Set<Uri> get disallowedLibraryUris => _emptySet;
- bool get mockableLibraryUsed => false;
- Map<String, Uri> get sdkLibraries => const <String, Uri>{};
-}
-
-class CollectingTreeElements extends TreeElementMapping {
- final Map<Node, Element> map = new LinkedHashMap<Node, Element>();
-
- CollectingTreeElements(Element currentElement) : super(currentElement);
-
- operator []=(Node node, Element element) {
- map[node] = element;
- }
-
- operator [](Node node) => map[node];
-
- void remove(Node node) {
- map.remove(node);
- }
-
- List<ConstantExpression> get constants {
- List<ConstantExpression> list = <ConstantExpression>[];
- forEachConstantNode((_, c) => list.add(c));
- return list;
- }
-}
-
-class MockTypeVariablesScope extends TypeVariablesScope {
- @override
- List<ResolutionDartType> get typeVariables => <ResolutionDartType>[];
- MockTypeVariablesScope(Scope parent) : super(parent);
- String toString() => 'MockTypeVariablesScope($parent)';
-}
-
-// The mock compiler does not split the program in output units.
-class MockDeferredLoadTask extends AstDeferredLoadTask {
- MockDeferredLoadTask(Compiler compiler) : super(compiler);
-
- OutputUnit getElementOutputUnit(dynamic dependency) {
- return mainOutputUnit;
- }
-}
-
-api.CompilerDiagnostics createHandler(MockCompiler compiler, String text,
- {bool verbose: false}) {
- return new LegacyCompilerDiagnostics(
- (uri, int begin, int end, String message, kind) {
- if (kind == api.Diagnostic.VERBOSE_INFO && !verbose) return;
- SourceFile sourceFile;
- if (uri == null) {
- sourceFile = new StringSourceFile.fromName('analysis', text);
- } else {
- sourceFile = compiler.sourceFiles[uri.toString()];
- }
- if (sourceFile != null && begin != null && end != null) {
- print('${kind}: ${sourceFile.getLocationMessage(message, begin, end)}');
- } else {
- print('${kind}: $message');
- }
- });
-}
-
-class MockElement extends FunctionElementX {
- MockElement(Element enclosingElement)
- : super('', ElementKind.FUNCTION, Modifiers.EMPTY, enclosingElement);
-
- get node => null;
-
- parseNode(_) => null;
-
- bool get hasNode => false;
-
- accept(ElementVisitor visitor, arg) {
- return visitor.visitMethodElement(this, arg);
- }
-}
-
-// TODO(herhut): Disallow warnings and errors during compilation by default.
-MockCompiler mockCompilerFor(String code, Uri uri,
- {bool analyzeAll: false,
- bool analyzeOnly: false,
- Map<String, String> coreSource,
- bool disableInlining: true,
- bool minify: false,
- bool trustTypeAnnotations: false,
- bool enableTypeAssertions: false,
- bool enableUserAssertions: false,
- int expectedErrors,
- int expectedWarnings,
- api.CompilerOutput outputProvider}) {
- MockCompiler compiler = new MockCompiler.internal(
- analyzeAll: analyzeAll,
- analyzeOnly: analyzeOnly,
- coreSource: coreSource,
- disableInlining: disableInlining,
- enableMinification: minify,
- trustTypeAnnotations: trustTypeAnnotations,
- enableTypeAssertions: enableTypeAssertions,
- enableUserAssertions: enableUserAssertions,
- expectedErrors: expectedErrors,
- expectedWarnings: expectedWarnings,
- outputProvider: outputProvider);
- compiler.registerSource(uri, code);
- compiler.diagnosticHandler = createHandler(compiler, code);
- return compiler;
-}
diff --git a/tests/compiler/dart2js/old_frontend/no_such_method_codegen_test.dart b/tests/compiler/dart2js/old_frontend/no_such_method_codegen_test.dart
deleted file mode 100644
index 4c531f5..0000000
--- a/tests/compiler/dart2js/old_frontend/no_such_method_codegen_test.dart
+++ /dev/null
@@ -1,24 +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.
-
-// The mock compiler of dart2js used to make the compiler crash on
-// this program.
-//
-// The SSA backend generates a call to a throwNoSuchMethod helper for
-// the access to `foo`, and we used to not infer return types of
-// helpers, so we did not know throwNoSuchMethod was not returning.
-// As a consequence, all operator[] had to be compiled, and due to
-// missing backend dependencies, some of them were not resolved.
-
-import '../compiler_helper.dart';
-
-const String TEST = '''
-main() => foo[42];
-''';
-
-main() {
- Uri uri = new Uri(scheme: 'source');
- var compiler = mockCompilerFor(TEST, uri);
- compiler.run(uri);
-}
diff --git a/tests/compiler/dart2js/old_frontend/null_is_bottom_test.dart b/tests/compiler/dart2js/old_frontend/null_is_bottom_test.dart
deleted file mode 100644
index 4d2ca6b..0000000
--- a/tests/compiler/dart2js/old_frontend/null_is_bottom_test.dart
+++ /dev/null
@@ -1,21 +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.
-
-// Test that dart2js produces the expected static type warnings for proxy
-// language tests. This ensures that the analyzer and dart2js agrees on these
-// tests.
-
-import 'warnings_checker.dart';
-
-/// Map from test files to a map of their expected status. If the status map is
-/// `null` no warnings must be missing or unexpected, otherwise the status map
-/// can contain a list of line numbers for keys 'missing' and 'unexpected' for
-/// the warnings of each category.
-const Map<String, dynamic> TESTS = const {
- 'language/null_is_bottom_type_test.dart': null,
-};
-
-void main(List<String> args) {
- checkWarnings(TESTS, args);
-}
diff --git a/tests/compiler/dart2js/old_frontend/options_helper.dart b/tests/compiler/dart2js/old_frontend/options_helper.dart
deleted file mode 100644
index ec63774..0000000
--- a/tests/compiler/dart2js/old_frontend/options_helper.dart
+++ /dev/null
@@ -1,20 +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 options_helper;
-
-import 'package:compiler/src/options.dart';
-export 'package:compiler/src/options.dart';
-
-class MockDiagnosticOptions implements DiagnosticOptions {
- const MockDiagnosticOptions();
-
- bool get fatalWarnings => false;
- bool get terseDiagnostics => false;
- bool get suppressWarnings => false;
- bool get suppressHints => false;
- bool get showAllPackageWarnings => false;
- bool get hidePackageWarnings => true;
- bool showPackageWarningsFor(Uri uri) => false;
-}
diff --git a/tests/compiler/dart2js/old_frontend/override_inheritance_test.dart b/tests/compiler/dart2js/old_frontend/override_inheritance_test.dart
deleted file mode 100644
index 271b498..0000000
--- a/tests/compiler/dart2js/old_frontend/override_inheritance_test.dart
+++ /dev/null
@@ -1,1610 +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:async';
-import 'package:async_helper/async_helper.dart';
-import '../compiler_helper.dart';
-import 'package:compiler/src/resolution/class_members.dart' show MembersCreator;
-
-main() {
- asyncTest(() => Future.wait([
- testRequiredParameters(),
- testPositionalParameters(),
- testNamedParameters(),
- testNotSubtype(),
- testGetterNotSubtype(),
- testSetterNotSubtype(),
- testGenericNotSubtype(),
- testFieldNotSubtype(),
- testMixedOverride(),
- testAbstractMethods(),
- testNoSuchMethod(),
- ]));
-}
-
-Future check(String source, {errors, warnings, hints, infos}) {
- return MockCompiler.create((MockCompiler compiler) {
- compiler.diagnosticHandler = createHandler(compiler, source);
- compiler.parseScript(source);
- dynamic mainApp = compiler.mainApp;
- var cls = mainApp.find('Class');
- cls.ensureResolved(compiler.resolution);
- MembersCreator.computeAllClassMembers(compiler.resolution, cls);
-
- toList(o) => o == null ? [] : o is List ? o : [o];
-
- compareMessageKinds(
- source, toList(errors), compiler.diagnosticCollector.errors, 'error');
-
- compareMessageKinds(source, toList(warnings),
- compiler.diagnosticCollector.warnings, 'warning');
-
- if (infos != null) {
- compareMessageKinds(
- source, toList(infos), compiler.diagnosticCollector.infos, 'info');
- }
-
- if (hints != null) {
- compareMessageKinds(
- source, toList(hints), compiler.diagnosticCollector.hints, 'hint');
- }
- });
-}
-
-Future testRequiredParameters() {
- return Future.wait([
- check("""
- class A {
- method() => null; // testRequiredParameters:0
- }
- class Class extends A {
- method() => null; // testRequiredParameters:1
- }
- """),
- check("""
- class A {
- method(a) => null; // testRequiredParameters:2
- }
- class Class extends A {
- method(b) => null; // testRequiredParameters:3
- }
- """),
- check("""
- class A {
- method(a, b, c, d) => null; // testRequiredParameters:3
- }
- class Class extends A {
- method(b, a, d, c) => null; // testRequiredParameters:4
- }
- """),
- check("""
- class A {
- method() => null; // testRequiredParameters:5
- }
- class Class extends A {
- method(a) => null; // testRequiredParameters:6
- }
- """,
- warnings: MessageKind.INVALID_OVERRIDE_METHOD,
- infos: MessageKind.INVALID_OVERRIDDEN_METHOD),
- check("""
- class A {
- method() => null; // testRequiredParameters:7
- }
- class Class implements A {
- method(a) => null; // testRequiredParameters:8
- }
- """,
- warnings: MessageKind.INVALID_OVERRIDE_METHOD,
- infos: MessageKind.INVALID_OVERRIDDEN_METHOD),
- check("""
- class A {
- method(a, b, c) => null; // testRequiredParameters:9
- }
- class Class extends A {
- method(a, b, c, d) => null; // testRequiredParameters:10
- }
- """,
- warnings: MessageKind.INVALID_OVERRIDE_METHOD,
- infos: MessageKind.INVALID_OVERRIDDEN_METHOD),
- ]);
-}
-
-Future testPositionalParameters() {
- return Future.wait([
- check("""
- class A {
- method([a]) => null; // testPositionalParameters:1
- }
- class Class extends A {
- method([a]) => null; // testPositionalParameters:2
- }
- """),
- check("""
- class A {
- method([a, b]) => null; // testPositionalParameters:3
- }
- class Class extends A {
- method([b, a]) => null; // testPositionalParameters:4
- }
- """),
- check("""
- class A {
- method([a, b, c]) => null; // testPositionalParameters:5
- }
- class Class extends A {
- method([b, d, a, c]) => null; // testPositionalParameters:6
- }
- """),
- check("""
- class A {
- method([a]) => null; // testPositionalParameters:7
- }
- class Class extends A {
- method([a]) => null; // testPositionalParameters:8
- }
- """),
- check("""
- class A {
- method(a) => null; // testPositionalParameters:9
- }
- class Class extends A {
- method() => null; // testPositionalParameters:10
- }
- """,
- warnings: MessageKind.INVALID_OVERRIDE_METHOD,
- infos: MessageKind.INVALID_OVERRIDDEN_METHOD),
- check("""
- class A {
- method(a, [b]) => null; // testPositionalParameters:11
- }
- class Class extends A {
- method(a) => null; // testPositionalParameters:12
- }
- """,
- warnings: MessageKind.INVALID_OVERRIDE_METHOD,
- infos: MessageKind.INVALID_OVERRIDDEN_METHOD),
- check("""
- class A {
- method(a, [b]) => null; // testPositionalParameters:13
- }
- class Class extends A {
- method([a]) => null; // testPositionalParameters:14
- }
- """,
- warnings: MessageKind.INVALID_OVERRIDE_METHOD,
- infos: MessageKind.INVALID_OVERRIDDEN_METHOD),
- check("""
- class A {
- method(a, b, [c, d, e]) => null; // testPositionalParameters:15
- }
- class Class extends A {
- method([a, b, c, d]) => null; // testPositionalParameters:16
- }
- """,
- warnings: MessageKind.INVALID_OVERRIDE_METHOD,
- infos: MessageKind.INVALID_OVERRIDDEN_METHOD),
- ]);
-}
-
-Future testNamedParameters() {
- return Future.wait([
- check("""
- class A {
- method({a}) => null; // testNamedParameters:1
- }
- class Class extends A {
- method({a}) => null; // testNamedParameters:2
- }
- """),
- check("""
- class A {
- method({a, b}) => null; // testNamedParameters:3
- }
- class Class extends A {
- method({b, a}) => null; // testNamedParameters:4
- }
- """),
- check("""
- class A {
- method({a, b, c}) => null; // testNamedParameters:5
- }
- class Class extends A {
- method({b, c, a, d}) => null; // testNamedParameters:6
- }
- """),
- check("""
- class A {
- method(d, {a, b, c}) => null; // testNamedParameters:7
- }
- class Class extends A {
- method(e, {b, c, a, d}) => null; // testNamedParameters:8
- }
- """),
- check("""
- class A {
- method({a}) => null; // testNamedParameters:9
- }
- class Class extends A {
- method() => null; // testNamedParameters:10
- }
- """,
- warnings: MessageKind.INVALID_OVERRIDE_METHOD,
- infos: MessageKind.INVALID_OVERRIDDEN_METHOD),
- check("""
- class A {
- method({a, b}) => null; // testNamedParameters:11
- }
- class Class extends A {
- method({b}) => null; // testNamedParameters:12
- }
- """,
- warnings: MessageKind.INVALID_OVERRIDE_METHOD,
- infos: MessageKind.INVALID_OVERRIDDEN_METHOD),
- check("""
- class A {
- method({a, b, c, d}) => null; // testNamedParameters:13
- }
- class Class extends A {
- method({a, e, d, c}) => null; // testNamedParameters:14
- }
- """,
- warnings: MessageKind.INVALID_OVERRIDE_METHOD,
- infos: MessageKind.INVALID_OVERRIDDEN_METHOD),
- ]);
-}
-
-Future testNotSubtype() {
- return Future.wait([
- check("""
- class A {
- method(int a) => null; // testNotSubtype:1
- }
- class Class extends A {
- method(int a) => null; // testNotSubtype:2
- }
- """),
-
- check("""
- class A {
- method(int a) => null; // testNotSubtype:3
- }
- class Class extends A {
- method(num a) => null; // testNotSubtype:4
- }
- """),
-
- check("""
- class A {
- void method() {} // testNotSubtype:5
- }
- class Class extends A {
- method() => null; // testNotSubtype:6
- }
- """),
-
- check("""
- class A {
- method() => null; // testNotSubtype:7
- }
- class Class extends A {
- void method() {} // testNotSubtype:8
- }
- """),
-
- check("""
- class A {
- void method() {} // testNotSubtype:9
- }
- class Class extends A {
- int method() => null; // testNotSubtype:10
- }
- """),
-
- check("""
- class A {
- int method() => null; // testNotSubtype:11
- }
- class Class extends A {
- void method() {} // testNotSubtype:12
- }
- """,
- warnings: MessageKind.INVALID_OVERRIDE_METHOD,
- infos: MessageKind.INVALID_OVERRIDDEN_METHOD),
-
- check("""
- class A {
- method(int a) => null; // testNotSubtype:13
- }
- class B extends A {
- method(num a) => null; // testNotSubtype:14
- }
- class Class extends B {
- method(double a) => null; // testNotSubtype:15
- }
- """),
-
- check("""
- class A {
- method(int a) => null; // testNotSubtype:16
- }
- class B extends A {
- method(a) => null; // testNotSubtype:17
- }
- class Class extends B {
- method(String a) => null; // testNotSubtype:18
- }
- """),
-
- check("""
- class A {
- method(int a) => null; // testNotSubtype:19
- }
- class Class extends A {
- method(String a) => null; // testNotSubtype:20
- }
- """,
- warnings: MessageKind.INVALID_OVERRIDE_METHOD,
- infos: MessageKind.INVALID_OVERRIDDEN_METHOD),
-
- // TODO(johnniwinther): These are unclear. Issue 16443 has been filed.
- check("""
- class A {
- method(int a) => null; // testNotSubtype:23
- }
- class B {
- method(num a) => null; // testNotSubtype:24
- }
- abstract class C implements A, B {
- }
- class Class implements C {
- method(double a) => null; // testNotSubtype:25
- }
- """,
- warnings: MessageKind.INVALID_OVERRIDE_METHOD,
- infos: MessageKind.INVALID_OVERRIDDEN_METHOD),
-
- check("""
- class A {
- method(num a) => null; // testNotSubtype:29
- }
- class B {
- method(int a) => null; // testNotSubtype:30
- }
- abstract class C implements A, B {
- }
- class Class implements C {
- method(double a) => null; // testNotSubtype:31
- }
- """,
- warnings: MessageKind.INVALID_OVERRIDE_METHOD,
- infos: MessageKind.INVALID_OVERRIDDEN_METHOD),
-
- check("""
- class A {
- method(int a) => null; // testNotSubtype:26
- }
- class B {
- method(num a) => null; // testNotSubtype:27
- }
- abstract class C implements A, B {
- }
- class Class implements C {
- method(String a) => null; // testNotSubtype:28
- }
- """, warnings: [
- MessageKind.INVALID_OVERRIDE_METHOD,
- MessageKind.INVALID_OVERRIDE_METHOD
- ], infos: [
- MessageKind.INVALID_OVERRIDDEN_METHOD,
- MessageKind.INVALID_OVERRIDDEN_METHOD
- ]),
- ]);
-}
-
-Future testGetterNotSubtype() {
- return Future.wait([
- check("""
- class A {
- get getter => null; // testGetterNotSubtype:1
- }
- class Class extends A {
- get getter => null; // testGetterNotSubtype:2
- }
- """),
-
- check("""
- class A {
- num get getter => null; // testGetterNotSubtype:3
- }
- class Class extends A {
- num get getter => null; // testGetterNotSubtype:4
- }
- """),
-
- check("""
- class A {
- num get getter => null; // testGetterNotSubtype:5
- }
- class Class extends A {
- int get getter => null; // testGetterNotSubtype:6
- }
- """),
-
- check("""
- class A {
- int get getter => null; // testGetterNotSubtype:7
- }
- class Class extends A {
- num get getter => null; // testGetterNotSubtype:8
- }
- """),
-
- check("""
- class A {
- int get getter => null; // testGetterNotSubtype:9
- }
- class Class extends A {
- double get getter => null; // testGetterNotSubtype:10
- }
- """,
- warnings: MessageKind.INVALID_OVERRIDE_GETTER,
- infos: MessageKind.INVALID_OVERRIDDEN_GETTER),
-
- check("""
- class A {
- int get getter => null; // testGetterNotSubtype:11
- }
- class B extends A {
- num get getter => null; // testGetterNotSubtype:12
- }
- class Class extends B {
- double get getter => null; // testGetterNotSubtype:13
- }
- """),
-
- check("""
- class A {
- int get getter => null; // testGetterNotSubtype:14
- }
- class B {
- num get getter => null; // testGetterNotSubtype:15
- }
- class Class extends A implements B {
- double get getter => null; // testGetterNotSubtype:16
- }
- """,
- warnings: MessageKind.INVALID_OVERRIDE_GETTER,
- infos: MessageKind.INVALID_OVERRIDDEN_GETTER),
-
- check("""
- class A {
- int get getter => null; // testGetterNotSubtype:17
- }
- class B {
- String get getter => null; // testGetterNotSubtype:18
- }
- class Class extends A implements B {
- double get getter => null; // testGetterNotSubtype:19
- }
- """, warnings: [
- MessageKind.INVALID_OVERRIDE_GETTER,
- MessageKind.INVALID_OVERRIDE_GETTER
- ], infos: [
- MessageKind.INVALID_OVERRIDDEN_GETTER,
- MessageKind.INVALID_OVERRIDDEN_GETTER
- ]),
-
- check("""
- class A {
- int get getter => null; // testGetterNotSubtype:20
- }
- class B {
- String get getter => null; // testGetterNotSubtype:21
- }
- class Class implements A, B {
- double get getter => null; // testGetterNotSubtype:22
- }
- """, warnings: [
- MessageKind.INVALID_OVERRIDE_GETTER,
- MessageKind.INVALID_OVERRIDE_GETTER
- ], infos: [
- MessageKind.INVALID_OVERRIDDEN_GETTER,
- MessageKind.INVALID_OVERRIDDEN_GETTER
- ]),
-
- // TODO(johnniwinther): These are unclear. Issue 16443 has been filed.
- check("""
- class A {
- int get getter => null; // testGetterNotSubtype:23
- }
- class B {
- num get getter => null; // testGetterNotSubtype:24
- }
- abstract class C implements A, B {
- }
- class Class implements C {
- double get getter => null; // testGetterNotSubtype:25
- }
- """,
- warnings: MessageKind.INVALID_OVERRIDE_GETTER,
- infos: MessageKind.INVALID_OVERRIDDEN_GETTER),
-
- check("""
- class A {
- int get getter => null; // testGetterNotSubtype:26
- }
- class B {
- num get getter => null; // testGetterNotSubtype:27
- }
- abstract class C implements A, B {
- }
- class Class implements C {
- String get getter => null; // testGetterNotSubtype:28
- }
- """, warnings: [
- MessageKind.INVALID_OVERRIDE_GETTER,
- MessageKind.INVALID_OVERRIDE_GETTER
- ], infos: [
- MessageKind.INVALID_OVERRIDDEN_GETTER,
- MessageKind.INVALID_OVERRIDDEN_GETTER
- ]),
- ]);
-}
-
-Future testGenericNotSubtype() {
- return Future.wait([
- check("""
- class A<T> {
- method(T t) => null; // testGenericNotSubtype:1
- }
- class Class<S> extends A<S> {
- method(S s) => null; // testGenericNotSubtype:2
- }
- """),
-
- check("""
- class A<T> {
- method(T t) => null; // testGenericNotSubtype:3
- }
- class Class extends A<num> {
- method(int i) => null; // testGenericNotSubtype:4
- }
- """),
-
- check("""
- class A<T> {
- method(T t) => null; // testGenericNotSubtype:5
- }
- class B<S> {
- method(S s) => null; // testGenericNotSubtype:6
- }
- class Class extends A<double> implements B<int> {
- method(num i) => null; // testGenericNotSubtype:7
- }
- """),
-
- check("""
- class A<T> {
- method(T t) => null; // testGenericNotSubtype:8
- }
- class Class<S> extends A<S> {
- method(int i) => null; // testGenericNotSubtype:9
- }
- """,
- warnings: MessageKind.INVALID_OVERRIDE_METHOD,
- infos: MessageKind.INVALID_OVERRIDDEN_METHOD),
-
- check("""
- class A<T> {
- method(T t) => null; // testGenericNotSubtype:10
- }
- class B<S> extends A<S> {
-
- }
- class Class<U> extends B<U> {
- method(U u) => null; // testGenericNotSubtype:11
- }
- """),
-
- check("""
- class A<T> {
- method(T t) => null; // testGenericNotSubtype:12
- }
- class B<S> {
- method(S s) => null; // testGenericNotSubtype:13
- }
- class Class<U> extends A<U> implements B<num> {
- method(int i) => null; // testGenericNotSubtype:14
- }
- """,
- warnings: MessageKind.INVALID_OVERRIDE_METHOD,
- infos: MessageKind.INVALID_OVERRIDDEN_METHOD),
-
- check("""
- class A<T> {
- method(T t) => null; // testGenericNotSubtype:15
- }
- class B<S> {
- method(S s) => null; // testGenericNotSubtype:16
- }
- class Class extends A<int> implements B<String> {
- method(double d) => null; // testGenericNotSubtype:17
- }
- """, warnings: [
- MessageKind.INVALID_OVERRIDE_METHOD,
- MessageKind.INVALID_OVERRIDE_METHOD
- ], infos: [
- MessageKind.INVALID_OVERRIDDEN_METHOD,
- MessageKind.INVALID_OVERRIDDEN_METHOD
- ]),
-
- check("""
- class A<T> {
- method(T t) => null; // testGenericNotSubtype:18
- }
- class B<S> {
- method(S s) => null; // testGenericNotSubtype:19
- }
- class Class implements A<int>, B<String> {
- method(double d) => null; // testGenericNotSubtype:20
- }
- """, warnings: [
- MessageKind.INVALID_OVERRIDE_METHOD,
- MessageKind.INVALID_OVERRIDE_METHOD
- ], infos: [
- MessageKind.INVALID_OVERRIDDEN_METHOD,
- MessageKind.INVALID_OVERRIDDEN_METHOD
- ]),
-
- // TODO(johnniwinther): These are unclear. Issue 16443 has been filed.
- check("""
- class A<T> {
- method(T t) => null; // testGenericNotSubtype:21
- }
- class B<S> {
- method(S s) => null; // testGenericNotSubtype:22
- }
- abstract class C implements A<int>, B<num> {
- }
- class Class implements C {
- method(double d) => null; // testGenericNotSubtype:23
- }
- """,
- warnings: MessageKind.INVALID_OVERRIDE_METHOD,
- infos: MessageKind.INVALID_OVERRIDDEN_METHOD),
-
- check("""
- class A<T> {
- method(T t) => null; // testGenericNotSubtype:24
- }
- class B<S> {
- method(S s) => null; // testGenericNotSubtype:25
- }
- abstract class C implements A<int>, B<num> {
- }
- class Class implements C {
- method(String s) => null; // testGenericNotSubtype:26
- }
- """, warnings: [
- MessageKind.INVALID_OVERRIDE_METHOD,
- MessageKind.INVALID_OVERRIDE_METHOD
- ], infos: [
- MessageKind.INVALID_OVERRIDDEN_METHOD,
- MessageKind.INVALID_OVERRIDDEN_METHOD
- ]),
- ]);
-}
-
-Future testSetterNotSubtype() {
- return Future.wait([
- check("""
- class A {
- set setter(_) => null; // testSetterNotSubtype:1
- }
- class Class extends A {
- set setter(_) => null; // testSetterNotSubtype:2
- }
- """),
-
- check("""
- class A {
- void set setter(_) {} // testSetterNotSubtype:3
- }
- class Class extends A {
- set setter(_) => null; // testSetterNotSubtype:4
- }
- """),
-
- check("""
- class A {
- set setter(_) => null; // testSetterNotSubtype:5
- }
- class Class extends A {
- void set setter(_) {} // testSetterNotSubtype:6
- }
- """),
-
- check("""
- class A {
- set setter(_) => null; // testSetterNotSubtype:7
- }
- class Class extends A {
- void set setter(_) {} // testSetterNotSubtype:8
- }
- """),
-
- check("""
- class A {
- set setter(num _) => null; // testSetterNotSubtype:9
- }
- class Class extends A {
- set setter(num _) => null; // testSetterNotSubtype:10
- }
- """),
-
- check("""
- class A {
- set setter(num _) => null; // testSetterNotSubtype:11
- }
- class Class extends A {
- set setter(int _) => null; // testSetterNotSubtype:12
- }
- """),
-
- check("""
- class A {
- set setter(int _) => null; // testSetterNotSubtype:13
- }
- class Class extends A {
- set setter(num _) => null; // testSetterNotSubtype:14
- }
- """),
-
- check("""
- class A {
- set setter(int _) => null; // testSetterNotSubtype:15
- }
- class Class extends A {
- set setter(double _) => null; // testSetterNotSubtype:16
- }
- """,
- warnings: MessageKind.INVALID_OVERRIDE_SETTER,
- infos: MessageKind.INVALID_OVERRIDDEN_SETTER),
-
- check("""
- class A {
- set setter(int _) => null; // testSetterNotSubtype:17
- }
- class B extends A {
- set setter(num _) => null; // testSetterNotSubtype:18
- }
- class Class extends B {
- set setter(double _) => null; // testSetterNotSubtype:19
- }
- """),
-
- check("""
- class A {
- set setter(int _) => null; // testSetterNotSubtype:20
- }
- class B {
- set setter(num _) => null; // testSetterNotSubtype:21
- }
- class Class extends A implements B {
- set setter(double _) => null; // testSetterNotSubtype:22
- }
- """,
- warnings: MessageKind.INVALID_OVERRIDE_SETTER,
- infos: MessageKind.INVALID_OVERRIDDEN_SETTER),
-
- check("""
- class A {
- set setter(int _) => null; // testSetterNotSubtype:23
- }
- class B {
- set setter(String _) => null; // testSetterNotSubtype:24
- }
- class Class extends A implements B {
- set setter(double _) => null; // testSetterNotSubtype:25
- }
- """, warnings: [
- MessageKind.INVALID_OVERRIDE_SETTER,
- MessageKind.INVALID_OVERRIDE_SETTER
- ], infos: [
- MessageKind.INVALID_OVERRIDDEN_SETTER,
- MessageKind.INVALID_OVERRIDDEN_SETTER
- ]),
-
- check("""
- class A {
- set setter(int _) => null; // testSetterNotSubtype:26
- }
- class B {
- set setter(String _) => null; // testSetterNotSubtype:27
- }
- class Class implements A, B {
- set setter(double _) => null; // testSetterNotSubtype:28
- }
- """, warnings: [
- MessageKind.INVALID_OVERRIDE_SETTER,
- MessageKind.INVALID_OVERRIDE_SETTER
- ], infos: [
- MessageKind.INVALID_OVERRIDDEN_SETTER,
- MessageKind.INVALID_OVERRIDDEN_SETTER
- ]),
-
- // TODO(johnniwinther): These are unclear. Issue 16443 has been filed.
- check("""
- class A {
- set setter(int _) => null; // testSetterNotSubtype:29
- }
- class B {
- set setter(num _) => null; // testSetterNotSubtype:30
- }
- abstract class C implements A, B {
- }
- class Class implements C {
- set setter(double _) => null; // testSetterNotSubtype:31
- }
- """,
- warnings: MessageKind.INVALID_OVERRIDE_SETTER,
- infos: MessageKind.INVALID_OVERRIDDEN_SETTER),
-
- check("""
- class A {
- set setter(int _) => null; // testSetterNotSubtype:32
- }
- class B {
- set setter(num _) => null; // testSetterNotSubtype:33
- }
- abstract class C implements A, B {
- }
- class Class implements C {
- set setter(String _) => null; // testSetterNotSubtype:34
- }
- """, warnings: [
- MessageKind.INVALID_OVERRIDE_SETTER,
- MessageKind.INVALID_OVERRIDE_SETTER
- ], infos: [
- MessageKind.INVALID_OVERRIDDEN_SETTER,
- MessageKind.INVALID_OVERRIDDEN_SETTER
- ]),
- ]);
-}
-
-Future testFieldNotSubtype() {
- return Future.wait([
- check("""
- class A {
- int field; // testFieldNotSubtype:1
- }
- class Class extends A {
- int field; // testFieldNotSubtype:2
- }
- """),
- check("""
- class A {
- num field; // testFieldNotSubtype:3
- }
- class Class extends A {
- int field; // testFieldNotSubtype:4
- }
- """),
- check("""
- class A {
- int field; // testFieldNotSubtype:5
- }
- class Class extends A {
- num field; // testFieldNotSubtype:6
- }
- """),
- check("""
- class A {
- int field; // testFieldNotSubtype:7
- }
- class Class extends A {
- double field; // testFieldNotSubtype:8
- }
- """,
- warnings: MessageKind.INVALID_OVERRIDE_FIELD,
- infos: MessageKind.INVALID_OVERRIDDEN_FIELD),
- check("""
- class A {
- int field; // testFieldNotSubtype:9
- }
- class B extends A {
- num field; // testFieldNotSubtype:10
- }
- class Class extends B {
- double field; // testFieldNotSubtype:11
- }
- """),
- check("""
- class A {
- num field; // testFieldNotSubtype:12
- }
- class Class extends A {
- int get field => null; // testFieldNotSubtype:13
- }
- """),
- check("""
- class A {
- num field; // testFieldNotSubtype:14
- }
- class Class extends A {
- String get field => null; // testFieldNotSubtype:15
- }
- """,
- warnings: MessageKind.INVALID_OVERRIDE_FIELD_WITH_GETTER,
- infos: MessageKind.INVALID_OVERRIDDEN_FIELD),
- check("""
- class A {
- num get field => null; // testFieldNotSubtype:16
- }
- class Class extends A {
- String field; // testFieldNotSubtype:17
- }
- """,
- warnings: MessageKind.INVALID_OVERRIDE_GETTER_WITH_FIELD,
- infos: MessageKind.INVALID_OVERRIDDEN_GETTER),
- check("""
- class A {
- num field; // testFieldNotSubtype:18
- }
- class Class extends A {
- set field(int _) {} // testFieldNotSubtype:19
- }
- """),
- check("""
- class A {
- num field; // testFieldNotSubtype:19
- }
- class Class extends A {
- void set field(int _) {} // testFieldNotSubtype:20
- }
- """),
- check("""
- class A {
- set field(int _) {} // testFieldNotSubtype:21
- }
- class Class extends A {
- num field; // testFieldNotSubtype:22
- }
- """),
- check("""
- class A {
- void set field(int _) {} // testFieldNotSubtype:23
- }
- class Class extends A {
- num field; // testFieldNotSubtype:24
- }
- """),
- check("""
- class A {
- num field; // testFieldNotSubtype:25
- }
- class Class extends A {
- set field(String _) {} // testFieldNotSubtype:26
- }
- """,
- warnings: MessageKind.INVALID_OVERRIDE_FIELD_WITH_SETTER,
- infos: MessageKind.INVALID_OVERRIDDEN_FIELD),
- check("""
- class A {
- set field(num _) {} // testFieldNotSubtype:27
- }
- class Class extends A {
- String field; // testFieldNotSubtype:28
- }
- """,
- warnings: MessageKind.INVALID_OVERRIDE_SETTER_WITH_FIELD,
- infos: MessageKind.INVALID_OVERRIDDEN_SETTER),
- check("""
- class A {
- int field; // testFieldNotSubtype:29
- }
- class Class implements A {
- String get field => null; // testFieldNotSubtype:30
- void set field(String s) {} // testFieldNotSubtype:31
- }
- """, warnings: [
- MessageKind.INVALID_OVERRIDE_FIELD_WITH_GETTER,
- MessageKind.INVALID_OVERRIDE_FIELD_WITH_SETTER
- ], infos: [
- MessageKind.INVALID_OVERRIDDEN_FIELD,
- MessageKind.INVALID_OVERRIDDEN_FIELD
- ]),
- check("""
- class A {
- String get field => null; // testFieldNotSubtype:32
- void set field(String s) {} // testFieldNotSubtype:33
- }
- class Class implements A {
- int field; // testFieldNotSubtype:34
- }
- """, warnings: [
- MessageKind.INVALID_OVERRIDE_GETTER_WITH_FIELD,
- MessageKind.INVALID_OVERRIDE_SETTER_WITH_FIELD
- ], infos: [
- MessageKind.INVALID_OVERRIDDEN_GETTER,
- MessageKind.INVALID_OVERRIDDEN_SETTER
- ]),
- ]);
-}
-
-Future testMixedOverride() {
- return Future.wait([
- check("""
- class A {
- var member; // testMixedOverride:1
- }
- class Class extends A {
- member() {} // testMixedOverride:2
- }
- """,
- errors: MessageKind.CANNOT_OVERRIDE_FIELD_WITH_METHOD,
- infos: MessageKind.CANNOT_OVERRIDE_FIELD_WITH_METHOD_CONT),
- check("""
- class A {
- member() {} // testMixedOverride:3
- }
- class Class extends A {
- var member; // testMixedOverride:4
- }
- """,
- errors: MessageKind.CANNOT_OVERRIDE_METHOD_WITH_FIELD,
- infos: MessageKind.CANNOT_OVERRIDE_METHOD_WITH_FIELD_CONT),
- check("""
- class A {
- get member => null; // testMixedOverride:5
- }
- class Class extends A {
- member() {} // testMixedOverride:6
- }
- """,
- errors: MessageKind.CANNOT_OVERRIDE_GETTER_WITH_METHOD,
- infos: MessageKind.CANNOT_OVERRIDE_GETTER_WITH_METHOD_CONT),
- check("""
- class A {
- member() {} // testMixedOverride:7
- }
- class Class extends A {
- get member => null; // testMixedOverride:8
- }
- """,
- errors: MessageKind.CANNOT_OVERRIDE_METHOD_WITH_GETTER,
- infos: MessageKind.CANNOT_OVERRIDE_METHOD_WITH_GETTER_CONT),
- check("""
- abstract class A {
- var member; // testMixedOverride:9
- }
- abstract class B {
- get member; // testMixedOverride:10
- }
- abstract class Class implements A, B {
- }
- """),
- check(
- """
- abstract class A {
- var member; // testMixedOverride:11
- }
- abstract class B {
- member() {} // testMixedOverride:12
- }
- abstract class Class implements A, B {
- }
- """,
- warnings: MessageKind.INHERIT_GETTER_AND_METHOD,
- infos: [
- MessageKind.INHERITED_METHOD,
- MessageKind.INHERITED_IMPLICIT_GETTER
- ]),
- check(
- """
- abstract class A {
- get member; // testMixedOverride:13
- }
- abstract class B {
- member() {} // testMixedOverride:14
- }
- abstract class Class implements A, B {
- }
- """,
- warnings: MessageKind.INHERIT_GETTER_AND_METHOD,
- infos: [
- MessageKind.INHERITED_METHOD,
- MessageKind.INHERITED_EXPLICIT_GETTER
- ]),
- check(
- """
- abstract class A {
- get member; // testMixedOverride:15
- }
- abstract class B {
- member() {} // testMixedOverride:16
- }
- abstract class C {
- var member; // testMixedOverride:17
- }
- abstract class D {
- member() {} // testMixedOverride:18
- }
- abstract class E {
- get member; // testMixedOverride:19
- }
- abstract class Class implements A, B, C, D, E {
- }
- """,
- warnings: MessageKind.INHERIT_GETTER_AND_METHOD,
- infos: [
- MessageKind.INHERITED_EXPLICIT_GETTER,
- MessageKind.INHERITED_METHOD,
- MessageKind.INHERITED_IMPLICIT_GETTER,
- MessageKind.INHERITED_METHOD,
- MessageKind.INHERITED_EXPLICIT_GETTER
- ]),
- check(
- """
- abstract class A {
- get member; // testMixedOverride:20
- }
- abstract class B {
- member() {} // testMixedOverride:21
- }
- abstract class C implements A, B {
- }
- class Class extends C {
- member() {} // testMixedOverride:22
- }
- """,
- errors: MessageKind.CANNOT_OVERRIDE_GETTER_WITH_METHOD,
- warnings: MessageKind.INHERIT_GETTER_AND_METHOD,
- infos: [
- MessageKind.INHERITED_METHOD,
- MessageKind.INHERITED_EXPLICIT_GETTER,
- MessageKind.CANNOT_OVERRIDE_GETTER_WITH_METHOD_CONT
- ]),
- check(
- """
- abstract class A {
- get member; // testMixedOverride:23
- }
- abstract class B {
- member() {} // testMixedOverride:24
- }
- abstract class C implements A, B {
- }
- class Class extends C {
- get member => null; // testMixedOverride:25
- }
- """,
- errors: MessageKind.CANNOT_OVERRIDE_METHOD_WITH_GETTER,
- warnings: MessageKind.INHERIT_GETTER_AND_METHOD,
- infos: [
- MessageKind.INHERITED_METHOD,
- MessageKind.INHERITED_EXPLICIT_GETTER,
- MessageKind.CANNOT_OVERRIDE_METHOD_WITH_GETTER_CONT
- ]),
- ]);
-}
-
-Future testAbstractMethods() {
- return Future.wait([
- check("""
- abstract class Class {
- method(); // testAbstractMethod:1
- }
- """),
- check(
- """
- class Class {
- method(); // testAbstractMethod:2
- }
- """,
- warnings: MessageKind.ABSTRACT_METHOD,
- infos: []),
- check(
- """
- class Class {
- get getter; // testAbstractMethod:3
- }
- """,
- warnings: MessageKind.ABSTRACT_GETTER,
- infos: []),
- check(
- """
- class Class {
- set setter(_); // testAbstractMethod:4
- }
- """,
- warnings: MessageKind.ABSTRACT_SETTER,
- infos: []),
- check("""
- abstract class A {
- method(); // testAbstractMethod:5
- }
- class Class extends A {
- method() {} // testAbstractMethod:6
- }
- """),
- check("""
- abstract class A {
- method(); // testAbstractMethod:7
- }
- class Class extends A {
- method([a]) {} // testAbstractMethod:8
- }
- """),
- check("""
- abstract class A {
- method(); // testAbstractMethod:9
- }
- class Class extends A {
- }
- """,
- warnings: MessageKind.UNIMPLEMENTED_METHOD_ONE,
- infos: MessageKind.UNIMPLEMENTED_METHOD_CONT),
- check("""
- abstract class A {
- get getter; // testAbstractMethod:10
- }
- class Class extends A {
- }
- """,
- warnings: MessageKind.UNIMPLEMENTED_GETTER_ONE,
- infos: MessageKind.UNIMPLEMENTED_EXPLICIT_GETTER),
- check("""
- abstract class A {
- set setter(_); // testAbstractMethod:11
- }
- class Class extends A {
- }
- """,
- warnings: MessageKind.UNIMPLEMENTED_SETTER_ONE,
- infos: MessageKind.UNIMPLEMENTED_EXPLICIT_SETTER),
- check(
- """
- abstract class A {
- method(); // testAbstractMethod:12
- }
- class B {
- method() {} // testAbstractMethod:13
- }
- class Class extends A implements B {
- }
- """,
- warnings: MessageKind.UNIMPLEMENTED_METHOD,
- infos: [
- MessageKind.UNIMPLEMENTED_METHOD_CONT,
- MessageKind.UNIMPLEMENTED_METHOD_CONT
- ]),
- check(
- """
- class Class implements Function {
- }
- """,
- warnings: MessageKind.UNIMPLEMENTED_METHOD_ONE,
- infos: []),
- check(
- """
- abstract class A {
- get getter; // testAbstractMethod:14
- }
- class B {
- get getter => 0; // testAbstractMethod:15
- }
- class Class extends A implements B {
- }
- """,
- warnings: MessageKind.UNIMPLEMENTED_GETTER,
- infos: [
- MessageKind.UNIMPLEMENTED_EXPLICIT_GETTER,
- MessageKind.UNIMPLEMENTED_EXPLICIT_GETTER
- ]),
- check(
- """
- abstract class A {
- set setter(_); // testAbstractMethod:16
- }
- class B {
- set setter(_) {} // testAbstractMethod:17
- }
- class Class extends A implements B {
- }
- """,
- warnings: MessageKind.UNIMPLEMENTED_SETTER,
- infos: [
- MessageKind.UNIMPLEMENTED_EXPLICIT_SETTER,
- MessageKind.UNIMPLEMENTED_EXPLICIT_SETTER
- ]),
- check(
- """
- abstract class A {
- get field; // testAbstractMethod:18
- }
- class B {
- var field; // testAbstractMethod:19
- }
- class Class extends A implements B {
- set field(_) {} // testAbstractMethod:20
- }
- """,
- warnings: MessageKind.UNIMPLEMENTED_GETTER,
- infos: [
- MessageKind.UNIMPLEMENTED_EXPLICIT_GETTER,
- MessageKind.UNIMPLEMENTED_IMPLICIT_GETTER
- ]),
- check(
- """
- abstract class A {
- set field(_); // testAbstractMethod:21
- }
- class B {
- var field; // testAbstractMethod:22
- }
- class Class extends A implements B {
- get field => 0; // testAbstractMethod:23
- }
- """,
- warnings: MessageKind.UNIMPLEMENTED_SETTER,
- infos: [
- MessageKind.UNIMPLEMENTED_EXPLICIT_SETTER,
- MessageKind.UNIMPLEMENTED_IMPLICIT_SETTER
- ]),
- check("""
- class A {
- method() {} // testAbstractMethod:24
- }
- class Class implements A {
- method() {} // testAbstractMethod:25
- }
- """),
- check("""
- class A {
- method() {} // testAbstractMethod:26
- }
- class Class implements A {
- method([a]) {} // testAbstractMethod:27
- }
- """),
- check("""
- class A {
- method() {} // testAbstractMethod:28
- }
- class Class implements A {
- }
- """,
- warnings: MessageKind.UNIMPLEMENTED_METHOD_ONE,
- infos: MessageKind.UNIMPLEMENTED_METHOD_CONT),
- check("""
- class A {
- method() {} // testAbstractMethod:29
- }
- class B {
- method() {} // testAbstractMethod:30
- }
- class Class extends A implements B {
- }
- """),
- check("""
- class A {
- var member; // testAbstractMethod:31
- }
- class Class implements A {
- }
- """, warnings: [
- MessageKind.UNIMPLEMENTED_GETTER_ONE,
- MessageKind.UNIMPLEMENTED_SETTER_ONE
- ], infos: [
- MessageKind.UNIMPLEMENTED_IMPLICIT_GETTER,
- MessageKind.UNIMPLEMENTED_IMPLICIT_SETTER
- ]),
- check("""
- class A {
- var member; // testAbstractMethod:32
- }
- class B {
- get member => null; // testAbstractMethod:33
- set member(_) {} // testAbstractMethod:34
- }
- class Class implements A, B {
- }
- """, warnings: [
- MessageKind.UNIMPLEMENTED_GETTER,
- MessageKind.UNIMPLEMENTED_SETTER
- ], infos: [
- MessageKind.UNIMPLEMENTED_EXPLICIT_GETTER,
- MessageKind.UNIMPLEMENTED_IMPLICIT_GETTER,
- MessageKind.UNIMPLEMENTED_EXPLICIT_SETTER,
- MessageKind.UNIMPLEMENTED_IMPLICIT_SETTER
- ]),
- check("""
- class A {
- var member; // testAbstractMethod:35
- }
- class B {
- var member; // testAbstractMethod:36
- }
- class Class implements A, B {
- }
- """, warnings: [
- MessageKind.UNIMPLEMENTED_GETTER,
- MessageKind.UNIMPLEMENTED_SETTER
- ], infos: [
- MessageKind.UNIMPLEMENTED_IMPLICIT_GETTER,
- MessageKind.UNIMPLEMENTED_IMPLICIT_GETTER,
- MessageKind.UNIMPLEMENTED_IMPLICIT_SETTER,
- MessageKind.UNIMPLEMENTED_IMPLICIT_SETTER
- ]),
- check("""
- class A {
- get member => 0; // testAbstractMethod:37
- }
- class Class implements A {
- }
- """,
- warnings: MessageKind.UNIMPLEMENTED_GETTER_ONE,
- infos: MessageKind.UNIMPLEMENTED_EXPLICIT_GETTER),
- check("""
- class A {
- set member(_) {} // testAbstractMethod:38
- }
- class Class implements A {
- }
- """,
- warnings: MessageKind.UNIMPLEMENTED_SETTER_ONE,
- infos: MessageKind.UNIMPLEMENTED_EXPLICIT_SETTER),
- check("""
- class A {
- var member; // testAbstractMethod:39
- }
- class Class implements A {
- get member => 0;
- }
- """,
- warnings: MessageKind.UNIMPLEMENTED_SETTER_ONE,
- infos: MessageKind.UNIMPLEMENTED_IMPLICIT_SETTER),
- check("""
- class A {
- var field; // testAbstractMethod:40
- }
- class Class implements A {
- final field = 0; // testAbstractMethod:41
- }
- """,
- warnings: MessageKind.UNIMPLEMENTED_SETTER_ONE,
- infos: MessageKind.UNIMPLEMENTED_IMPLICIT_SETTER),
- check("""
- class A {
- var member; // testAbstractMethod:42
- }
- class Class implements A {
- set member(_) {}
- }
- """,
- warnings: MessageKind.UNIMPLEMENTED_GETTER_ONE,
- infos: MessageKind.UNIMPLEMENTED_IMPLICIT_GETTER),
- check("""
- abstract class A {
- method() {} // testAbstractMethod:43
- }
- class Class extends A {
- method();
- }
- """),
- ]);
-}
-
-Future testNoSuchMethod() {
- return Future.wait([
- check(
- """
- class Class {
- method(); // testNoSuchMethod:1
- }
- """,
- warnings: MessageKind.ABSTRACT_METHOD,
- infos: []),
- check(
- """
- @proxy
- class Class {
- method(); // testNoSuchMethod:2
- }
- """,
- warnings: MessageKind.ABSTRACT_METHOD,
- infos: []),
- check("""
- class Class {
- noSuchMethod(_) => null;
- method(); // testNoSuchMethod:3
- }
- """),
- check("""
- class Class {
- noSuchMethod(_, [__]) => null;
- method(); // testNoSuchMethod:4
- }
- """),
- check("""
- class Class {
- noSuchMethod(_);
- method(); // testNoSuchMethod:5
- }
- """),
- check("""
- abstract class A {
- method(); // testNoSuchMethod:6
- }
- class Class extends A {
- }
- """,
- warnings: MessageKind.UNIMPLEMENTED_METHOD_ONE,
- infos: MessageKind.UNIMPLEMENTED_METHOD_CONT),
- check("""
- abstract class A {
- method(); // testNoSuchMethod:7
- }
- @proxy
- class Class extends A {
- }
- """,
- warnings: MessageKind.UNIMPLEMENTED_METHOD_ONE,
- infos: MessageKind.UNIMPLEMENTED_METHOD_CONT),
- check("""
- abstract class A {
- method(); // testNoSuchMethod:8
- }
- class Class extends A {
- noSuchMethod(_) => null;
- }
- """),
- check("""
- class A {
- method() {} // testNoSuchMethod:9
- }
- class Class implements A {
- }
- """,
- warnings: MessageKind.UNIMPLEMENTED_METHOD_ONE,
- infos: MessageKind.UNIMPLEMENTED_METHOD_CONT),
- check("""
- class A {
- method() {} // testNoSuchMethod:10
- }
- class Class implements A {
- }
- """,
- warnings: MessageKind.UNIMPLEMENTED_METHOD_ONE,
- infos: MessageKind.UNIMPLEMENTED_METHOD_CONT),
- check("""
- class A {
- method() {} // testNoSuchMethod:11
- }
- @proxy
- class Class implements A {
- }
- """,
- warnings: MessageKind.UNIMPLEMENTED_METHOD_ONE,
- infos: MessageKind.UNIMPLEMENTED_METHOD_CONT),
- check("""
- class A {
- method() {} // testNoSuchMethod:12
- }
- class Class implements A {
- noSuchMethod(_) => null;
- }
- """),
- check("""
- class A {
- noSuchMethod(_) => null;
- method(); // testNoSuchMethod:13
- }
- class Class extends A {
- }
- """),
- ]);
-}
diff --git a/tests/compiler/dart2js/old_frontend/package_root_test.dart b/tests/compiler/dart2js/old_frontend/package_root_test.dart
deleted file mode 100644
index 793d17f..0000000
--- a/tests/compiler/dart2js/old_frontend/package_root_test.dart
+++ /dev/null
@@ -1,79 +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 the compiler can handle imports when package root has not been set.
-
-library dart2js.test.package_root;
-
-import 'dart:async';
-
-import 'package:async_helper/async_helper.dart';
-import 'package:expect/expect.dart';
-import 'package:compiler/src/commandline_options.dart';
-import 'package:compiler/compiler.dart' show PackagesDiscoveryProvider;
-import 'package:compiler/src/diagnostics/messages.dart' show MessageKind;
-import 'package:package_config/packages.dart';
-
-import '../memory_compiler.dart';
-import '../memory_source_file_helper.dart';
-
-const MEMORY_SOURCE_FILES = const {
- 'main.dart': '''
-
-import 'package:foo/foo.dart';
-
-main() {}
-''',
- 'package.config': '''
-''',
-};
-
-final Uri PACKAGE_CONFIG_URI = Uri.parse('memory:package.config');
-
-Future runTest(Uri main, MessageKind expectedMessageKind,
- {Uri packageRoot,
- Uri packageConfig,
- PackagesDiscoveryProvider packagesDiscoveryProvider}) async {
- DiagnosticCollector collector = new DiagnosticCollector();
- await runCompiler(
- entryPoint: main,
- memorySourceFiles: MEMORY_SOURCE_FILES,
- diagnosticHandler: collector,
- packageRoot: packageRoot,
- packageConfig: packageConfig,
- packagesDiscoveryProvider: packagesDiscoveryProvider,
- options: [Flags.useOldFrontend]);
- Expect.equals(
- 1, collector.errors.length, "Unexpected errors: ${collector.errors}");
- Expect.equals(expectedMessageKind, collector.errors.first.message.kind,
- "Unexpected error: ${collector.errors.first}");
-}
-
-void main() {
- asyncTest(() async {
- Uri script = currentDirectory.resolveUri(Platform.script);
- Uri packageRoot = script.resolve('./packages/');
-
- PackagesDiscoveryProvider noPackagesDiscovery = (Uri uri) {
- return new Future.value(Packages.noPackages);
- };
-
- await runTest(Uri.parse('memory:main.dart'), MessageKind.READ_URI_ERROR,
- packageRoot: packageRoot);
- await runTest(Uri.parse('memory:main.dart'), MessageKind.LIBRARY_NOT_FOUND,
- packageConfig: PACKAGE_CONFIG_URI);
- await runTest(Uri.parse('memory:main.dart'), MessageKind.LIBRARY_NOT_FOUND,
- packagesDiscoveryProvider: noPackagesDiscovery);
-
- await runTest(
- Uri.parse('package:foo/foo.dart'), MessageKind.READ_SELF_ERROR,
- packageRoot: packageRoot);
- await runTest(
- Uri.parse('package:foo/foo.dart'), MessageKind.LIBRARY_NOT_FOUND,
- packageConfig: PACKAGE_CONFIG_URI);
- await runTest(
- Uri.parse('package:foo/foo.dart'), MessageKind.LIBRARY_NOT_FOUND,
- packagesDiscoveryProvider: noPackagesDiscovery);
- });
-}
diff --git a/tests/compiler/dart2js/old_frontend/parser_helper.dart b/tests/compiler/dart2js/old_frontend/parser_helper.dart
deleted file mode 100644
index 55a4f34..0000000
--- a/tests/compiler/dart2js/old_frontend/parser_helper.dart
+++ /dev/null
@@ -1,165 +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 parser_helper;
-
-import 'package:expect/expect.dart';
-
-import 'package:compiler/src/elements/elements.dart';
-import 'package:compiler/src/elements/entities.dart';
-import 'package:compiler/src/id_generator.dart';
-import 'package:compiler/src/tree/tree.dart';
-import 'package:compiler/src/parser/element_listener.dart';
-import 'package:compiler/src/parser/node_listener.dart';
-import 'package:compiler/src/parser/diet_parser_task.dart';
-import 'package:front_end/src/fasta/parser.dart' hide parse;
-import 'package:front_end/src/fasta/scanner.dart' hide scan;
-import 'package:compiler/src/io/source_file.dart';
-import 'package:compiler/src/util/util.dart';
-
-import 'package:compiler/src/elements/modelx.dart'
- show CompilationUnitElementX, ElementX, LibraryElementX;
-
-import 'package:compiler/src/compiler.dart';
-import 'package:compiler/src/options.dart';
-import 'package:compiler/src/diagnostics/source_span.dart';
-import 'package:compiler/src/diagnostics/spannable.dart';
-import 'package:compiler/src/diagnostics/diagnostic_listener.dart';
-import 'package:compiler/src/diagnostics/messages.dart';
-import 'package:compiler/src/script.dart';
-
-import 'options_helper.dart';
-
-export 'package:front_end/src/fasta/parser.dart' hide parse;
-export 'package:front_end/src/fasta/scanner.dart' hide scan;
-export 'package:compiler/src/diagnostics/diagnostic_listener.dart';
-export 'package:compiler/src/parser/node_listener.dart';
-export 'package:compiler/src/parser/diet_parser_task.dart';
-export 'package:front_end/src/fasta/scanner/token_constants.dart';
-
-import 'mock_compiler.dart';
-
-class LoggerCanceler extends DiagnosticReporter {
- DiagnosticOptions get options => const MockDiagnosticOptions();
-
- void log(message) {
- print(message);
- }
-
- void internalError(Spannable node, message) {
- log(message);
- }
-
- SourceSpan spanFromSpannable(node) {
- throw 'unsupported operation';
- }
-
- SourceSpan spanFromToken(token) => null;
-
- void reportError(DiagnosticMessage message,
- [List<DiagnosticMessage> infos = const <DiagnosticMessage>[]]) {
- log(message);
- infos.forEach(log);
- }
-
- void reportWarning(DiagnosticMessage message,
- [List<DiagnosticMessage> infos = const <DiagnosticMessage>[]]) {
- log(message);
- infos.forEach(log);
- }
-
- void reportInfo(Spannable node, MessageKind errorCode,
- [Map arguments = const {}]) {
- log(new Message(MessageTemplate.TEMPLATES[errorCode], arguments, false));
- }
-
- void reportHint(DiagnosticMessage message,
- [List<DiagnosticMessage> infos = const <DiagnosticMessage>[]]) {
- log(message);
- infos.forEach(log);
- }
-
- withCurrentElement(Entity element, f()) => f();
-
- @override
- DiagnosticMessage createMessage(Spannable spannable, MessageKind messageKind,
- [Map arguments = const {}]) {
- return new DiagnosticMessage(null, spannable,
- new Message(MessageTemplate.TEMPLATES[messageKind], arguments, false));
- }
-
- @override
- bool get hasReportedError => false;
-}
-
-Token scan(String text) => new StringScanner(text).tokenize();
-
-Node parseBodyCode(String text, Function parseMethod,
- {DiagnosticReporter reporter}) {
- Token tokens = scan(text);
- if (reporter == null) reporter = new LoggerCanceler();
- Uri uri = new Uri(scheme: "source");
- Script script = new Script(uri, uri, new MockFile(text));
- LibraryElement library = new LibraryElementX(script);
- NodeListener listener = new NodeListener(
- new ScannerOptions(canUseNative: true),
- reporter,
- library.entryCompilationUnit);
- Parser parser = new Parser(listener);
- Token endToken = parseMethod(parser, tokens).next;
- assert(endToken.kind == EOF_TOKEN);
- Node node = listener.popNode();
- Expect.isNotNull(node);
- Expect.isTrue(listener.nodes.isEmpty, 'Not empty: ${listener.nodes}');
- return node;
-}
-
-Node parseStatement(String text) => parseBodyCode(
- text,
- (parser, tokens) =>
- parser.parseStatement(parser.syntheticPreviousToken(tokens)));
-
-Node parseFunction(String text, MockCompiler compiler) {
- ElementX element = parseUnit(text, compiler, compiler.mainApp).head;
- Expect.isNotNull(element);
- Expect.equals(ElementKind.FUNCTION, element.kind);
- return element.parseNode(compiler.parsingContext);
-}
-
-Node parseMember(String text, {DiagnosticReporter reporter}) {
- return parseBodyCode(
- text, (parser, tokens) => parser.parseClassMember(tokens),
- reporter: reporter);
-}
-
-class MockFile extends StringSourceFile {
- MockFile(text) : super.fromName('<string>', text);
-}
-
-var sourceCounter = 0;
-
-Link<Element> parseUnit(String text, Compiler compiler, LibraryElement library,
- [void registerSource(Uri uri, String source)]) {
- Token tokens = scan(text);
- Uri uri = new Uri(scheme: "source", path: '${++sourceCounter}');
- if (registerSource != null) {
- registerSource(uri, text);
- }
- var script = new Script(uri, uri, new MockFile(text));
- var unit = new CompilationUnitElementX(script, library);
- DiagnosticReporter reporter = compiler.reporter;
- ElementListener listener = new ElementListener(
- compiler.parsingContext.getScannerOptionsFor(library),
- reporter,
- unit,
- new IdGenerator());
- PartialParser parser = new PartialParser(listener);
- reporter.withCurrentElement(unit, () => parser.parseUnit(tokens));
- return unit.localMembers;
-}
-
-NodeList fullParseUnit(String source, {DiagnosticReporter reporter}) {
- return parseBodyCode(source, (parser, tokens) => parser.parseUnit(tokens),
- reporter: reporter);
-}
diff --git a/tests/compiler/dart2js/old_frontend/parser_test.dart b/tests/compiler/dart2js/old_frontend/parser_test.dart
deleted file mode 100644
index c4f9881..0000000
--- a/tests/compiler/dart2js/old_frontend/parser_test.dart
+++ /dev/null
@@ -1,381 +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.
-
-import "package:expect/expect.dart";
-import 'parser_helper.dart';
-import 'package:compiler/src/tree/tree.dart';
-
-void testStatement(String statement) {
- Node node = parseStatement(statement);
- Expect.isNotNull(node.toString());
-}
-
-void testGenericTypes() {
- testStatement('List<T> t;');
- testStatement('List<List<T>> t;');
- testStatement('List<List<List<T>>> t;');
- testStatement('List<List<List<List<T>>>> t;');
- testStatement('List<List<List<List<List<T>>>>> t;');
-
- testStatement('List<List<T> > t;');
- testStatement('List<List<List<T> >> t;');
- testStatement('List<List<List<List<T> >>> t;');
- testStatement('List<List<List<List<List<T> >>>> t;');
-
- testStatement('List<List<List<T> > > t;');
- testStatement('List<List<List<List<T> > >> t;');
- testStatement('List<List<List<List<List<T> > >>> t;');
-
- testStatement('List<List<List<List<T> > > > t;');
- testStatement('List<List<List<List<List<T> > > >> t;');
-
- testStatement('List<List<List<List<List<T> > > > > t;');
-
- testStatement('List<List<List<List<List<T> >> >> t;');
-
- testStatement('List<List<List<List<List<T> >>> > t;');
-
- testStatement('List<List<List<List<List<T >>> >> t;');
-
- testStatement('List<T> t;');
- testStatement('List<List<T>> t;');
- testStatement('List<List<List<T>>> t;');
- testStatement('List<List<List<List<T>>>> t;');
- testStatement('List<List<List<List<List<T>>>>> t;');
-}
-
-void testPrefixedGenericTypes() {
- testStatement('lib.List<List<T> > t;');
- testStatement('lib.List<List<List<T> >> t;');
- testStatement('lib.List<List<List<List<T> >>> t;');
- testStatement('lib.List<List<List<List<List<T> >>>> t;');
-
- testStatement('lib.List<List<List<T> > > t;');
- testStatement('lib.List<List<List<List<T> > >> t;');
- testStatement('lib.List<List<List<List<List<T> > >>> t;');
-
- testStatement('lib.List<List<List<List<T> > > > t;');
- testStatement('lib.List<List<List<List<List<T> > > >> t;');
-
- testStatement('lib.List<List<List<List<List<T> > > > > t;');
-
- testStatement('lib.List<List<List<List<List<T> >> >> t;');
-
- testStatement('lib.List<List<List<List<List<T> >>> > t;');
-
- testStatement('lib.List<List<List<List<List<T >>> >> t;');
-}
-
-void testUnaryExpression() {
- testStatement('x++;');
- // TODO(ahe): reenable following test.
- // testStatement('++x++;');
- testStatement('++x;');
- testStatement('print(x++);');
- // TODO(ahe): reenable following test.
- // testStatement('print(++x++);'); // Accepted by parser, rejected later.
- testStatement('print(++x);');
-}
-
-void testChainedMethodCalls() {
- testStatement('MyClass.foo().bar().baz();');
- // TODO(ahe): reenable following test.
- // testStatement('MyClass.foo().-x;'); // Accepted by parser, rejected later.
- testStatement('a.b.c.d();');
-}
-
-void testFunctionStatement() {
- testStatement('int f() {}');
- testStatement('void f() {}');
-}
-
-void testDoStatement() {
- testStatement('do fisk(); while (hest());');
- testStatement('do { fisk(); } while (hest());');
-}
-
-void testWhileStatement() {
- testStatement('while (fisk()) hest();');
- testStatement('while (fisk()) { hest(); }');
-}
-
-void testConditionalExpression() {
- ExpressionStatement node = parseStatement("a ? b : c;");
- Conditional conditional = node.expression;
-
- node = parseStatement("a ? b ? c : d : e;");
- // Should parse as: a ? ( b ? c : d ) : e.
- conditional = node.expression;
- Expect.isNotNull(conditional.thenExpression.asConditional());
- Expect.isNotNull(conditional.elseExpression.asSend());
-
- node = parseStatement("a ? b : c ? d : e;");
- // Should parse as: a ? b : (c ? d : e).
- conditional = node.expression;
- Expect.isNotNull(conditional.thenExpression.asSend());
- Expect.isNotNull(conditional.elseExpression.asConditional());
-
- node = parseStatement("a ? b ? c : d : e ? f : g;");
- // Should parse as: a ? (b ? c : d) : (e ? f : g).
- conditional = node.expression;
- Expect.isNotNull(conditional.thenExpression.asConditional());
- Expect.isNotNull(conditional.elseExpression.asConditional());
-
- node = parseStatement("a = b ? c : d;");
- // Should parse as: a = (b ? c : d).
- SendSet sendSet = node.expression;
- Expect.isNotNull(sendSet.arguments.head.asConditional());
-
- node = parseStatement("a ? b : c = d;");
- // Should parse as: a ? b : (c = d).
- conditional = node.expression;
- Expect.isNull(conditional.thenExpression.asSendSet());
- Expect.isNotNull(conditional.elseExpression.asSendSet());
-
- node = parseStatement("a ? b = c : d;");
- // Should parse as: a ? (b = c) : d.
- conditional = node.expression;
- Expect.isNotNull(conditional.thenExpression.asSendSet());
- Expect.isNull(conditional.elseExpression.asSendSet());
-
- node = parseStatement("a ? b = c : d = e;");
- // Should parse as: a ? (b = c) : (d = e).
- conditional = node.expression;
- Expect.isNotNull(conditional.thenExpression.asSendSet());
- Expect.isNotNull(conditional.elseExpression.asSendSet());
-
- node = parseStatement("a ?? b ? c : d;");
- // Should parse as: (a ?? b) ? c : d;
- conditional = node.expression;
- Expect.isNotNull(conditional.condition.asSend());
- Expect.isTrue(conditional.condition.asSend().isIfNull);
- Expect.isNotNull(conditional.thenExpression.asSend());
- Expect.isNotNull(conditional.elseExpression.asSend());
-}
-
-void testNullOperators() {
- ExpressionStatement statement = parseStatement("a ?? b;");
- Expression node = statement.expression;
- Expect.isNotNull(node.asSend());
- Expect.isTrue(node.asSend().isIfNull);
-
- statement = parseStatement("a ??= b;");
- node = statement.expression;
- Expect.isNotNull(node.asSendSet());
- Expect.isTrue(node.asSendSet().isIfNullAssignment);
-
- statement = parseStatement("a?.b;");
- node = statement.expression;
- Expect.isNotNull(node.asSend());
- Expect.isTrue(node.asSend().isConditional);
-
- statement = parseStatement("a?.m();");
- node = statement.expression;
- Expect.isNotNull(node.asSend());
- Expect.isTrue(node.asSend().isConditional);
-}
-
-void testAssignment() {
- ExpressionStatement node;
- Expression expression;
- SendSet sendSet;
-
- node = parseStatement("a = b;");
- expression = node.expression;
- Expect.isNotNull(expression.asSendSet());
-
- node = parseStatement("a = b = c;");
- // Should parse as: a = (b = c).
- expression = node.expression;
- Expect.isNotNull(sendSet = expression.asSendSet());
- Expect.isNotNull(sendSet.arguments.head.asSendSet());
-
- node = parseStatement("a = b = c = d;");
- // Should parse as: a = (b = (c = d)).
- expression = node.expression;
- Expect.isNotNull(sendSet = expression.asSendSet());
- Expect.isNotNull(sendSet = sendSet.arguments.head.asSendSet());
- Expect.isNotNull(sendSet = sendSet.arguments.head.asSendSet());
-
- node = parseStatement("a.b = c;");
- // Should parse as: receiver = a, selector = b, arguments = c.
- expression = node.expression;
- Expect.isNotNull(sendSet = expression.asSendSet());
- Expect.stringEquals("a", sendSet.receiver.toString());
- Expect.stringEquals("b", sendSet.selector.toString());
- Expect.stringEquals("c", sendSet.arguments.head.toString());
-
- node = parseStatement("a.b = c.d;");
- // Should parse as: a.b = (c.d).
- expression = node.expression;
- Expect.isNotNull(sendSet = expression.asSendSet());
- Expect.stringEquals("a", sendSet.receiver.toString());
- Expect.stringEquals("b", sendSet.selector.toString());
- Expect.stringEquals("c.d", sendSet.arguments.head.toString());
-
- node = parseStatement("a.b = c.d = e.f;");
- // Should parse as: a.b = (c.d = (e.f)).
- expression = node.expression;
- Expect.isNotNull(sendSet = expression.asSendSet());
- Expect.stringEquals("a", sendSet.receiver.toString());
- Expect.stringEquals("b", sendSet.selector.toString());
- Expect.isNotNull(sendSet = sendSet.arguments.head.asSendSet());
- Expect.stringEquals("c", sendSet.receiver.toString());
- Expect.stringEquals("d", sendSet.selector.toString());
- Expect.stringEquals("e.f", sendSet.arguments.head.toString());
-}
-
-void testIndex() {
- ExpressionStatement node;
- Expression expression;
- Send send;
- SendSet sendSet;
-
- node = parseStatement("a[b];");
- // Should parse as: (a)[b].
- expression = node.expression;
- Expect.isNotNull(send = expression.asSend());
- Expect.stringEquals("a", send.receiver.toString());
- Expect.stringEquals("[]", send.selector.toString());
- Expect.stringEquals("b", send.arguments.head.toString());
-
- node = parseStatement("a[b] = c;");
- // Should parse as: (a)[b] = c.
- expression = node.expression;
- Expect.isNotNull(sendSet = expression.asSendSet());
- Expect.stringEquals("a", sendSet.receiver.toString());
- Expect.stringEquals("[]", sendSet.selector.toString());
- Expect.stringEquals("=", sendSet.assignmentOperator.toString());
- Expect.stringEquals("b", sendSet.arguments.head.toString());
- Expect.stringEquals("c", sendSet.arguments.tail.head.toString());
-
- node = parseStatement("a.b[c];");
- // Should parse as: (a.b)[c].
- expression = node.expression;
- Expect.isNotNull(send = expression.asSend());
- Expect.stringEquals("a.b", send.receiver.toString());
- Expect.stringEquals("[]", send.selector.toString());
- Expect.stringEquals("c", send.arguments.head.toString());
-
- node = parseStatement("a.b[c] = d;");
- // Should parse as: (a.b)[] = (c, d).
- expression = node.expression;
- Expect.isNotNull(sendSet = expression.asSendSet());
- Expect.isNotNull(send = sendSet.receiver.asSend());
- Expect.stringEquals("a.b", send.toString());
- Expect.stringEquals("[]", sendSet.selector.toString());
- Expect.stringEquals("=", sendSet.assignmentOperator.toString());
- Expect.stringEquals("c", sendSet.arguments.head.toString());
- Expect.stringEquals("d", sendSet.arguments.tail.head.toString());
-}
-
-void testPostfix() {
- ExpressionStatement node;
- Expression expression;
- SendSet sendSet;
-
- node = parseStatement("a.b++;");
- // Should parse as: (a.b)++.
- expression = node.expression;
- Expect.isNotNull(sendSet = expression.asSendSet());
- Expect.stringEquals("a", sendSet.receiver.toString());
- Expect.stringEquals("b", sendSet.selector.toString());
- Expect.stringEquals("++", sendSet.assignmentOperator.toString());
- Expect.isTrue(sendSet.arguments.isEmpty);
-}
-
-void testOperatorParse() {
- FunctionExpression function = parseMember('operator -() => null;');
- Send name = function.name.asSend();
- Expect.isNotNull(name);
- Expect.stringEquals('operator', name.receiver.toString());
- Expect.stringEquals('-', name.selector.toString());
- Expect.isTrue(function.parameters.isEmpty);
- Expect.isNull(function.returnType);
- Expect.isNull(function.getOrSet);
-}
-
-class Collector extends DiagnosticReporter {
- int token = -1;
-
- void reportFatalError(Token token) {
- this.token = token.kind;
- throw this;
- }
-
- void reportError(DiagnosticMessage message,
- [List<DiagnosticMessage> infos = const <DiagnosticMessage>[]]) {
- assert(token != -1);
- throw this;
- }
-
- spanFromToken(Token token) {
- this.token = token.kind;
- }
-
- void log(message) {
- print(message);
- }
-
- noSuchMethod(Invocation invocation) {
- throw 'unsupported operation';
- }
-
- @override
- DiagnosticMessage createMessage(spannable, messageKind,
- [arguments = const {}]) {
- return new DiagnosticMessage(null, spannable, null);
- }
-}
-
-void testMissingCloseParen() {
- final String source = '''foo(x { // <= missing closing ")"
- return x;
-}''';
- parse() {
- parseMember(source, reporter: new Collector());
- }
-
- check(exn) {
- Collector c = exn;
- Expect.equals(OPEN_CURLY_BRACKET_TOKEN, c.token);
- return true;
- }
-
- Expect.throws(parse, check);
-}
-
-void testMissingCloseBraceInClass() {
- final String source = 'class Foo {'; // Missing close '}'.
- parse() {
- fullParseUnit(source, reporter: new Collector());
- }
-
- check(exn) {
- Collector c = exn;
- Expect.equals(BAD_INPUT_TOKEN, c.token);
- return true;
- }
-
- Expect.throws(parse, check);
-}
-
-void main() {
- testGenericTypes();
- // TODO(ahe): Enable this test when we handle library prefixes.
- // testPrefixedGenericTypes();
- testUnaryExpression();
- testChainedMethodCalls();
- testFunctionStatement();
- testDoStatement();
- testWhileStatement();
- testConditionalExpression();
- testNullOperators();
- testAssignment();
- testIndex();
- testPostfix();
- testOperatorParse();
- testMissingCloseParen();
- testMissingCloseBraceInClass();
-}
diff --git a/tests/compiler/dart2js/old_frontend/part_of_test.dart b/tests/compiler/dart2js/old_frontend/part_of_test.dart
deleted file mode 100644
index 9c7bfee..0000000
--- a/tests/compiler/dart2js/old_frontend/part_of_test.dart
+++ /dev/null
@@ -1,43 +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.
-
-library part_of_test;
-
-import "package:expect/expect.dart";
-import "package:async_helper/async_helper.dart";
-import 'package:compiler/src/diagnostics/messages.dart' show MessageKind;
-import 'mock_compiler.dart';
-
-final libraryUri = Uri.parse('test:library.dart');
-const String LIBRARY_SOURCE = '''
-library foo;
-part 'part.dart';
-''';
-
-final partUri = Uri.parse('test:part.dart');
-const String PART_SOURCE = '''
-part of bar;
-''';
-
-void main() {
- MockCompiler compiler = new MockCompiler.internal();
- compiler.registerSource(libraryUri, LIBRARY_SOURCE);
- compiler.registerSource(partUri, PART_SOURCE);
-
- asyncTest(
- () => compiler.libraryLoader.loadLibrary(libraryUri).then((libraries) {
- compiler.processLoadedLibraries(libraries);
- DiagnosticCollector collector = compiler.diagnosticCollector;
- print('errors: ${collector.errors}');
- print('warnings: ${collector.warnings}');
- Expect.isTrue(collector.errors.isEmpty);
- Expect.equals(1, collector.warnings.length);
- Expect.equals(MessageKind.LIBRARY_NAME_MISMATCH,
- collector.warnings.first.messageKind);
- Expect.equals(
- 'foo',
- collector.warnings.first.message.arguments['libraryName']
- .toString());
- }));
-}
diff --git a/tests/compiler/dart2js/old_frontend/partial_parser_test.dart b/tests/compiler/dart2js/old_frontend/partial_parser_test.dart
deleted file mode 100644
index ec8f619..0000000
--- a/tests/compiler/dart2js/old_frontend/partial_parser_test.dart
+++ /dev/null
@@ -1,25 +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.
-
-import "package:expect/expect.dart";
-import 'parser_helper.dart';
-
-void main() {
- testSkipExpression();
-}
-
-void testSkipExpression() {
- PartialParser parser = new PartialParser(new Listener());
- Token token = scan('a < b;');
- token = parser.skipExpression(parser.syntheticPreviousToken(token)).next;
- Expect.equals(';', token.lexeme);
-
- token = scan('[a < b]');
- token = parser.skipExpression(token).next;
- Expect.equals(']', token.lexeme);
-
- token = scan('a < b,');
- token = parser.skipExpression(parser.syntheticPreviousToken(token)).next;
- Expect.equals(',', token.lexeme);
-}
diff --git a/tests/compiler/dart2js/old_frontend/patch_test.dart b/tests/compiler/dart2js/old_frontend/patch_test.dart
deleted file mode 100644
index 2c8dbfd..0000000
--- a/tests/compiler/dart2js/old_frontend/patch_test.dart
+++ /dev/null
@@ -1,1068 +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:async';
-import 'package:expect/expect.dart';
-import 'package:async_helper/async_helper.dart';
-import 'package:compiler/src/compiler.dart';
-import 'package:compiler/src/diagnostics/messages.dart' show MessageKind;
-import 'package:compiler/src/elements/elements.dart';
-import 'package:compiler/src/elements/modelx.dart';
-import 'package:compiler/src/elements/names.dart';
-import 'package:compiler/src/tree/tree.dart';
-import 'package:compiler/src/types/types.dart';
-import 'package:compiler/src/universe/call_structure.dart' show CallStructure;
-import 'package:compiler/src/universe/selector.dart' show Selector;
-import 'package:compiler/src/world.dart';
-
-import 'mock_compiler.dart';
-import 'mock_libraries.dart';
-
-Future<Compiler> applyPatch(String script, String patch,
- {bool analyzeAll: false,
- bool analyzeOnly: false,
- bool runCompiler: false,
- String main: ""}) async {
- Map<String, String> core = <String, String>{'script': script};
- MockCompiler compiler = new MockCompiler.internal(
- coreSource: core, analyzeAll: analyzeAll, analyzeOnly: analyzeOnly);
- compiler.diagnosticHandler = createHandler(compiler, '');
- var uri = Uri.parse("patch:core");
- compiler.registerSource(uri, "$DEFAULT_PATCH_CORE_SOURCE\n$patch");
- if (runCompiler) {
- await compiler.run(null, main);
- } else {
- await compiler.init(main);
- }
- return compiler;
-}
-
-void expectHasBody(compiler, ElementX element) {
- dynamic node = element.parseNode(compiler.parsingContext);
- Expect.isNotNull(node, "Element isn't parseable, when a body was expected");
- Expect.isNotNull(node.body);
- // If the element has a body it is either a Block or a Return statement,
- // both with different begin and end tokens.
- Expect.isTrue(node.body is Block || node.body is Return);
- Expect.notEquals(node.body.getBeginToken(), node.body.getEndToken());
-}
-
-void expectHasNoBody(compiler, ElementX element) {
- dynamic node = element.parseNode(compiler.parsingContext);
- Expect.isNotNull(node, "Element isn't parseable, when a body was expected");
- Expect.isFalse(node.hasBody);
-}
-
-Element ensure(compiler, String name, Element lookup(String name),
- {bool expectIsPatched: false,
- bool expectIsPatch: false,
- bool checkHasBody: false,
- bool expectIsGetter: false,
- bool expectIsFound: true,
- bool expectIsRegular: false}) {
- dynamic element = lookup(name);
- if (!expectIsFound) {
- Expect.isNull(element);
- return element;
- }
- Expect.isNotNull(element);
- if (expectIsGetter) {
- Expect.isTrue(element is AbstractFieldElement);
- Expect.isNotNull(element.getter);
- element = element.getter;
- }
- Expect.equals(expectIsPatched, element.isPatched,
- 'Unexpected: $element.isPatched = ${element.isPatched}');
- if (expectIsPatched) {
- Expect.isNull(element.origin);
- Expect.isNotNull(element.patch);
-
- Expect.equals(element, element.declaration);
- Expect.equals(element.patch, element.implementation);
-
- if (checkHasBody) {
- expectHasNoBody(compiler, element);
- expectHasBody(compiler, element.patch);
- }
- } else {
- Expect.isTrue(element.isImplementation);
- }
- Expect.equals(expectIsPatch, element.isPatch);
- if (expectIsPatch) {
- Expect.isNotNull(element.origin);
- Expect.isNull(element.patch);
-
- Expect.equals(element.origin, element.declaration);
- Expect.equals(element, element.implementation);
-
- if (checkHasBody) {
- expectHasBody(compiler, element);
- expectHasNoBody(compiler, element.origin);
- }
- } else {
- Expect.isTrue(element.isDeclaration);
- }
- if (expectIsRegular) {
- Expect.isNull(element.origin);
- Expect.isNull(element.patch);
-
- Expect.equals(element, element.declaration);
- Expect.equals(element, element.implementation);
-
- if (checkHasBody) {
- expectHasBody(compiler, element);
- }
- }
- Expect.isFalse(element.isPatched && element.isPatch);
- return element;
-}
-
-Future testPatchFunction() async {
- dynamic compiler = await applyPatch(
- "external test();", "@patch test() { return 'string'; } ");
- ensure(compiler, "test", compiler.resolution.commonElements.coreLibrary.find,
- expectIsPatched: true, checkHasBody: true);
- ensure(compiler, "test",
- compiler.resolution.commonElements.coreLibrary.patch.find,
- expectIsPatch: true, checkHasBody: true);
-
- DiagnosticCollector collector = compiler.diagnosticCollector;
- Expect.isTrue(
- collector.warnings.isEmpty, "Unexpected warnings: ${collector.warnings}");
- Expect.isTrue(
- collector.errors.isEmpty, "Unexpected errors: ${collector.errors}");
-}
-
-Future testPatchFunctionMetadata() async {
- dynamic compiler = await applyPatch("""
- const a = 0;
- @a external test();
- """, """
- const _b = 1;
- @patch @_b test() {}
- """);
- Element origin = ensure(
- compiler, "test", compiler.resolution.commonElements.coreLibrary.find,
- expectIsPatched: true, checkHasBody: true);
- Element patch = ensure(compiler, "test",
- compiler.resolution.commonElements.coreLibrary.patch.find,
- expectIsPatch: true, checkHasBody: true);
-
- DiagnosticCollector collector = compiler.diagnosticCollector;
- Expect.isTrue(
- collector.warnings.isEmpty, "Unexpected warnings: ${collector.warnings}");
- Expect.isTrue(
- collector.errors.isEmpty, "Unexpected errors: ${collector.errors}");
-
- Expect.equals(1, origin.metadata.length,
- "Unexpected origin metadata: ${origin.metadata}.");
- Expect.equals(3, patch.metadata.length,
- "Unexpected patch metadata: ${patch.metadata}.");
-}
-
-Future testPatchFunctionGeneric() async {
- dynamic compiler = await applyPatch(
- "external T test<T>();", "@patch T test<T>() { return null; } ");
- Element origin = ensure(
- compiler, "test", compiler.resolution.commonElements.coreLibrary.find,
- expectIsPatched: true, checkHasBody: true);
- ensure(compiler, "test",
- compiler.resolution.commonElements.coreLibrary.patch.find,
- expectIsPatch: true, checkHasBody: true);
- compiler.resolver.resolve(origin);
-
- DiagnosticCollector collector = compiler.diagnosticCollector;
- Expect.isTrue(
- collector.warnings.isEmpty, "Unexpected warnings: ${collector.warnings}");
- Expect.isTrue(
- collector.errors.isEmpty, "Unexpected errors: ${collector.errors}");
-}
-
-Future testPatchFunctionGenericExtraTypeVariable() async {
- dynamic compiler = await applyPatch(
- "external T test<T>();", "@patch T test<T, S>() { return null; } ");
- Element origin = ensure(
- compiler, "test", compiler.resolution.commonElements.coreLibrary.find,
- expectIsPatched: true, checkHasBody: true);
- ensure(compiler, "test",
- compiler.resolution.commonElements.coreLibrary.patch.find,
- expectIsPatch: true, checkHasBody: true);
- compiler.resolver.resolve(origin);
-
- DiagnosticCollector collector = compiler.diagnosticCollector;
- Expect.isTrue(
- collector.warnings.isEmpty, "Unexpected warnings: ${collector.warnings}");
- Expect.equals(1, collector.errors.length);
- Expect.isTrue(collector.errors.first.message.kind ==
- MessageKind.PATCH_TYPE_VARIABLES_MISMATCH);
-}
-
-Future testPatchFunctionGenericDifferentNames() async {
- dynamic compiler = await applyPatch(
- "external T test<T, S>();", "@patch T test<S, T>() { return null; } ");
- Element origin = ensure(
- compiler, "test", compiler.resolution.commonElements.coreLibrary.find,
- expectIsPatched: true, checkHasBody: true);
- ensure(compiler, "test",
- compiler.resolution.commonElements.coreLibrary.patch.find,
- expectIsPatch: true, checkHasBody: true);
- compiler.resolver.resolve(origin);
-
- DiagnosticCollector collector = compiler.diagnosticCollector;
- Expect.isTrue(
- collector.warnings.isEmpty, "Unexpected warnings: ${collector.warnings}");
- Expect.equals(1, collector.errors.length);
- Expect.isTrue(collector.errors.first.message.kind ==
- MessageKind.PATCH_TYPE_VARIABLES_MISMATCH);
-}
-
-Future testPatchConstructor() async {
- dynamic compiler = await applyPatch("""
- class Class {
- external Class();
- }
- """, """
- @patch class Class {
- @patch Class();
- }
- """);
- dynamic classOrigin = ensure(
- compiler, "Class", compiler.resolution.commonElements.coreLibrary.find,
- expectIsPatched: true);
- classOrigin.ensureResolved(compiler.resolution);
- dynamic classPatch = ensure(compiler, "Class",
- compiler.resolution.commonElements.coreLibrary.patch.find,
- expectIsPatch: true);
-
- Expect.equals(classPatch, classOrigin.patch);
- Expect.equals(classOrigin, classPatch.origin);
-
- dynamic constructorOrigin = ensure(
- compiler, "", (name) => classOrigin.localLookup(name),
- expectIsPatched: true);
- dynamic constructorPatch = ensure(
- compiler, "", (name) => classPatch.localLookup(name),
- expectIsPatch: true);
-
- Expect.equals(constructorPatch, constructorOrigin.patch);
- Expect.equals(constructorOrigin, constructorPatch.origin);
-
- DiagnosticCollector collector = compiler.diagnosticCollector;
- Expect.isTrue(
- collector.warnings.isEmpty, "Unexpected warnings: ${collector.warnings}");
- Expect.isTrue(
- collector.errors.isEmpty, "Unexpected errors: ${collector.errors}");
-}
-
-Future testPatchRedirectingConstructor() async {
- dynamic compiler = await applyPatch("""
- class Class {
- Class(x) : this._(x, false);
-
- external Class._(x, y);
- }
- """, r"""
- @patch class Class {
- @patch Class._(x, y) { print('$x,$y'); }
- }
- """);
- dynamic classOrigin = ensure(
- compiler, "Class", compiler.resolution.commonElements.coreLibrary.find,
- expectIsPatched: true);
- classOrigin.ensureResolved(compiler.resolution);
-
- dynamic classPatch = ensure(compiler, "Class",
- compiler.resolution.commonElements.coreLibrary.patch.find,
- expectIsPatch: true);
-
- Expect.equals(classOrigin, classPatch.origin);
- Expect.equals(classPatch, classOrigin.patch);
-
- dynamic constructorRedirecting =
- ensure(compiler, "", (name) => classOrigin.localLookup(name));
- dynamic constructorOrigin = ensure(
- compiler, "_", (name) => classOrigin.localLookup(name),
- expectIsPatched: true);
- dynamic constructorPatch = ensure(
- compiler, "_", (name) => classPatch.localLookup(name),
- expectIsPatch: true);
- Expect.equals(constructorOrigin, constructorPatch.origin);
- Expect.equals(constructorPatch, constructorOrigin.patch);
-
- compiler.resolver.resolve(constructorRedirecting);
-
- DiagnosticCollector collector = compiler.diagnosticCollector;
- Expect.isTrue(
- collector.warnings.isEmpty, "Unexpected warnings: ${collector.warnings}");
- Expect.isTrue(
- collector.errors.isEmpty, "Unexpected errors: ${collector.errors}");
-}
-
-Future testPatchMember() async {
- dynamic compiler = await applyPatch("""
- class Class {
- external String toString();
- }
- """, """
- @patch class Class {
- @patch String toString() => 'string';
- }
- """);
- dynamic container = ensure(
- compiler, "Class", compiler.resolution.commonElements.coreLibrary.find,
- expectIsPatched: true);
- container.parseNode(compiler.parsingContext);
- ensure(compiler, "Class",
- compiler.resolution.commonElements.coreLibrary.patch.find,
- expectIsPatch: true);
-
- ensure(compiler, "toString", container.lookupLocalMember,
- expectIsPatched: true, checkHasBody: true);
- ensure(compiler, "toString", container.patch.lookupLocalMember,
- expectIsPatch: true, checkHasBody: true);
-
- DiagnosticCollector collector = compiler.diagnosticCollector;
- Expect.isTrue(
- collector.warnings.isEmpty, "Unexpected warnings: ${collector.warnings}");
- Expect.isTrue(
- collector.errors.isEmpty, "Unexpected errors: ${collector.errors}");
-}
-
-Future testPatchGetter() async {
- dynamic compiler = await applyPatch("""
- class Class {
- external int get field;
- }
- """, """
- @patch class Class {
- @patch int get field => 5;
- }
- """);
- dynamic container = ensure(
- compiler, "Class", compiler.resolution.commonElements.coreLibrary.find,
- expectIsPatched: true);
- container.parseNode(compiler.parsingContext);
- ensure(compiler, "field", container.lookupLocalMember,
- expectIsGetter: true, expectIsPatched: true, checkHasBody: true);
- ensure(compiler, "field", container.patch.lookupLocalMember,
- expectIsGetter: true, expectIsPatch: true, checkHasBody: true);
-
- DiagnosticCollector collector = compiler.diagnosticCollector;
- Expect.isTrue(
- collector.warnings.isEmpty, "Unexpected warnings: ${collector.warnings}");
- Expect.isTrue(
- collector.errors.isEmpty, "Unexpected errors: ${collector.errors}");
-}
-
-Future testRegularMember() async {
- dynamic compiler = await applyPatch("""
- class Class {
- void regular() {}
- }
- """, """
- @patch class Class {
- }
- """);
- dynamic container = ensure(
- compiler, "Class", compiler.resolution.commonElements.coreLibrary.find,
- expectIsPatched: true);
- container.parseNode(compiler.parsingContext);
- ensure(compiler, "Class",
- compiler.resolution.commonElements.coreLibrary.patch.find,
- expectIsPatch: true);
-
- ensure(compiler, "regular", container.lookupLocalMember,
- checkHasBody: true, expectIsRegular: true);
- ensure(compiler, "regular", container.patch.lookupLocalMember,
- checkHasBody: true, expectIsRegular: true);
-
- DiagnosticCollector collector = compiler.diagnosticCollector;
- Expect.isTrue(
- collector.warnings.isEmpty, "Unexpected warnings: ${collector.warnings}");
- Expect.isTrue(
- collector.errors.isEmpty, "Unexpected errors: ${collector.errors}");
-}
-
-Future testInjectedMember() async {
- dynamic compiler = await applyPatch("""
- class Class {
- }
- """, """
- @patch class Class {
- void _injected() {}
- }
- """);
- dynamic container = ensure(
- compiler, "Class", compiler.resolution.commonElements.coreLibrary.find,
- expectIsPatched: true);
- container.parseNode(compiler.parsingContext);
- ensure(compiler, "Class",
- compiler.resolution.commonElements.coreLibrary.patch.find,
- expectIsPatch: true);
-
- ensure(compiler, "_injected", container.lookupLocalMember,
- expectIsFound: false);
- ensure(compiler, "_injected", container.patch.lookupLocalMember,
- checkHasBody: true, expectIsRegular: true);
-
- DiagnosticCollector collector = compiler.diagnosticCollector;
- Expect.isTrue(
- collector.warnings.isEmpty, "Unexpected warnings: ${collector.warnings}");
- Expect.isTrue(
- collector.errors.isEmpty, "Unexpected errors: ${collector.errors}");
-}
-
-Future testInjectedPublicMember() async {
- dynamic compiler = await applyPatch("""
- class Class {
- }
- """, """
- @patch class Class {
- void injected() {}
- }
- """);
- dynamic container = ensure(
- compiler, "Class", compiler.resolution.commonElements.coreLibrary.find,
- expectIsPatched: true);
- container.parseNode(compiler.parsingContext);
- ensure(compiler, "Class",
- compiler.resolution.commonElements.coreLibrary.patch.find,
- expectIsPatch: true);
-
- ensure(compiler, "injected", container.lookupLocalMember,
- expectIsFound: false);
- ensure(compiler, "injected", container.patch.lookupLocalMember,
- checkHasBody: true, expectIsRegular: true);
-
- DiagnosticCollector collector = compiler.diagnosticCollector;
- Expect.isTrue(
- collector.warnings.isEmpty, "Unexpected warnings: ${collector.warnings}");
- Expect.equals(
- 1, collector.errors.length, "Unexpected errors: ${collector.errors}");
- Expect.isTrue(collector.errors.first.message.kind ==
- MessageKind.INJECTED_PUBLIC_MEMBER);
-}
-
-Future testInjectedFunction() async {
- dynamic compiler = await applyPatch("", "int _function() => 5;");
- ensure(compiler, "_function",
- compiler.resolution.commonElements.coreLibrary.find,
- expectIsFound: false);
- ensure(compiler, "_function",
- compiler.resolution.commonElements.coreLibrary.patch.find,
- checkHasBody: true, expectIsRegular: true);
-
- DiagnosticCollector collector = compiler.diagnosticCollector;
- Expect.isTrue(
- collector.warnings.isEmpty, "Unexpected warnings: ${collector.warnings}");
- Expect.isTrue(
- collector.errors.isEmpty, "Unexpected errors: ${collector.errors}");
-}
-
-Future testInjectedPublicFunction() async {
- dynamic compiler = await applyPatch("", "int function() => 5;");
- ensure(
- compiler, "function", compiler.resolution.commonElements.coreLibrary.find,
- expectIsFound: false);
- ensure(compiler, "function",
- compiler.resolution.commonElements.coreLibrary.patch.find,
- checkHasBody: true, expectIsRegular: true);
-
- DiagnosticCollector collector = compiler.diagnosticCollector;
- Expect.isTrue(
- collector.warnings.isEmpty, "Unexpected warnings: ${collector.warnings}");
- Expect.equals(
- 1, collector.errors.length, "Unexpected errors: ${collector.errors}");
- Expect.isTrue(collector.errors.first.message.kind ==
- MessageKind.INJECTED_PUBLIC_MEMBER);
-}
-
-Future testPatchSignatureCheck() async {
- dynamic compiler = await applyPatch("""
- class Class {
- external String method1();
- external void method2(String str);
- external void method3(String s1);
- external void method4([String str]);
- external void method5({String str});
- external void method6({String str});
- external void method7([String s1]);
- external void method8({String s1});
- external void method9(String str);
- external void method10([String str]);
- external void method11({String str});
- }
- """, """
- @patch class Class {
- @patch int method1() => 0;
- @patch void method2() {}
- @patch void method3(String s2) {}
- @patch void method4([String str, int i]) {}
- @patch void method5() {}
- @patch void method6([String str]) {}
- @patch void method7([String s2]) {}
- @patch void method8({String s2}) {}
- @patch void method9(int str) {}
- @patch void method10([int str]) {}
- @patch void method11({int str}) {}
- }
- """);
- dynamic container = ensure(
- compiler, "Class", compiler.resolution.commonElements.coreLibrary.find,
- expectIsPatched: true);
- container.ensureResolved(compiler.resolution);
- container.parseNode(compiler.parsingContext);
- DiagnosticCollector collector = compiler.diagnosticCollector;
-
- void expect(String methodName, List infos, List errors) {
- collector.clear();
- compiler.resolver.resolveMethodElement(ensure(
- compiler, methodName, container.lookupLocalMember,
- expectIsPatched: true, checkHasBody: true));
- Expect.equals(0, collector.warnings.length);
- Expect.equals(infos.length, collector.infos.length,
- "Unexpected infos: ${collector.infos} on $methodName");
- for (int i = 0; i < infos.length; i++) {
- Expect.equals(infos[i], collector.infos.elementAt(i).message.kind);
- }
- Expect.equals(errors.length, collector.errors.length,
- "Unexpected errors: ${collector.errors} on $methodName");
- for (int i = 0; i < errors.length; i++) {
- Expect.equals(errors[i], collector.errors.elementAt(i).message.kind);
- }
- }
-
- expect("method1", [], [MessageKind.PATCH_RETURN_TYPE_MISMATCH]);
- expect("method2", [], [MessageKind.PATCH_REQUIRED_PARAMETER_COUNT_MISMATCH]);
- expect("method3", [MessageKind.PATCH_POINT_TO_PARAMETER],
- [MessageKind.PATCH_PARAMETER_MISMATCH]);
- expect("method4", [], [MessageKind.PATCH_OPTIONAL_PARAMETER_COUNT_MISMATCH]);
- expect("method5", [], [MessageKind.PATCH_OPTIONAL_PARAMETER_COUNT_MISMATCH]);
- expect("method6", [], [MessageKind.PATCH_OPTIONAL_PARAMETER_NAMED_MISMATCH]);
- expect("method7", [MessageKind.PATCH_POINT_TO_PARAMETER],
- [MessageKind.PATCH_PARAMETER_MISMATCH]);
- expect("method8", [MessageKind.PATCH_POINT_TO_PARAMETER],
- [MessageKind.PATCH_PARAMETER_MISMATCH]);
- expect("method9", [MessageKind.PATCH_POINT_TO_PARAMETER],
- [MessageKind.PATCH_PARAMETER_TYPE_MISMATCH]);
- expect("method10", [MessageKind.PATCH_POINT_TO_PARAMETER],
- [MessageKind.PATCH_PARAMETER_TYPE_MISMATCH]);
- expect("method11", [MessageKind.PATCH_POINT_TO_PARAMETER],
- [MessageKind.PATCH_PARAMETER_TYPE_MISMATCH]);
-}
-
-Future testExternalWithoutImplementationTopLevel() async {
- dynamic compiler = await applyPatch("""
- external void foo();
- """, """
- // @patch void foo() {}
- """);
- dynamic function = ensure(
- compiler, "foo", compiler.resolution.commonElements.coreLibrary.find);
- compiler.resolver.resolve(function);
- DiagnosticCollector collector = compiler.diagnosticCollector;
- Expect.isTrue(
- collector.warnings.isEmpty, "Unexpected warnings: ${collector.warnings}");
- print('testExternalWithoutImplementationTopLevel:${collector.errors}');
- Expect.equals(1, collector.errors.length);
- Expect.isTrue(collector.errors.first.message.kind ==
- MessageKind.PATCH_EXTERNAL_WITHOUT_IMPLEMENTATION);
- Expect.stringEquals('External method without an implementation.',
- collector.errors.first.message.toString());
-}
-
-Future testExternalWithoutImplementationMember() async {
- dynamic compiler = await applyPatch("""
- class Class {
- external void foo();
- }
- """, """
- @patch class Class {
- // @patch void foo() {}
- }
- """);
- dynamic container = ensure(
- compiler, "Class", compiler.resolution.commonElements.coreLibrary.find,
- expectIsPatched: true);
- container.parseNode(compiler.parsingContext);
- DiagnosticCollector collector = compiler.diagnosticCollector;
- collector.clear();
- compiler.resolver.resolveMethodElement(
- ensure(compiler, "foo", container.lookupLocalMember));
- Expect.isTrue(
- collector.warnings.isEmpty, "Unexpected warnings: ${collector.warnings}");
- print('testExternalWithoutImplementationMember:${collector.errors}');
- Expect.equals(1, collector.errors.length);
- Expect.isTrue(collector.errors.first.message.kind ==
- MessageKind.PATCH_EXTERNAL_WITHOUT_IMPLEMENTATION);
- Expect.stringEquals('External method without an implementation.',
- collector.errors.first.message.toString());
-}
-
-Future testIsSubclass() async {
- dynamic compiler = await applyPatch("""
- class A {}
- """, """
- @patch class A {}
- """);
- ClassElement cls = ensure(
- compiler, "A", compiler.resolution.commonElements.coreLibrary.find,
- expectIsPatched: true);
- ClassElement patch = cls.patch;
- Expect.isTrue(cls != patch);
- Expect.isTrue(cls.isSubclassOf(patch));
- Expect.isTrue(patch.isSubclassOf(cls));
-}
-
-Future testPatchNonExistingTopLevel() async {
- dynamic compiler = await applyPatch("""
- // class Class {}
- """, """
- @patch class Class {}
- """);
- DiagnosticCollector collector = compiler.diagnosticCollector;
- Expect.isTrue(
- collector.warnings.isEmpty, "Unexpected warnings: ${collector.warnings}");
- print('testPatchNonExistingTopLevel:${collector.errors}');
- Expect.equals(1, collector.errors.length);
- Expect.isTrue(
- collector.errors.first.message.kind == MessageKind.PATCH_NON_EXISTING);
-}
-
-Future testPatchNonExistingMember() async {
- dynamic compiler = await applyPatch("""
- class Class {}
- """, """
- @patch class Class {
- @patch void foo() {}
- }
- """);
- dynamic container = ensure(
- compiler, "Class", compiler.resolution.commonElements.coreLibrary.find,
- expectIsPatched: true);
- container.parseNode(compiler.parsingContext);
- DiagnosticCollector collector = compiler.diagnosticCollector;
-
- Expect.isTrue(
- collector.warnings.isEmpty, "Unexpected warnings: ${collector.warnings}");
- print('testPatchNonExistingMember:${collector.errors}');
- Expect.equals(1, collector.errors.length);
- Expect.isTrue(
- collector.errors.first.message.kind == MessageKind.PATCH_NON_EXISTING);
-}
-
-Future testPatchNonPatchablePatch() async {
- dynamic compiler = await applyPatch("""
- external get foo;
- """, """
- @patch var foo;
- """);
- ensure(compiler, "foo", compiler.resolution.commonElements.coreLibrary.find);
-
- DiagnosticCollector collector = compiler.diagnosticCollector;
- Expect.isTrue(
- collector.warnings.isEmpty, "Unexpected warnings: ${collector.warnings}");
- print('testPatchNonPatchablePatch:${collector.errors}');
- Expect.equals(1, collector.errors.length);
- Expect.isTrue(
- collector.errors.first.message.kind == MessageKind.PATCH_NONPATCHABLE);
-}
-
-Future testPatchNonPatchableOrigin() async {
- dynamic compiler = await applyPatch("""
- external var foo;
- """, """
- @patch get foo => 0;
- """);
- ensure(compiler, "foo", compiler.resolution.commonElements.coreLibrary.find);
-
- DiagnosticCollector collector = compiler.diagnosticCollector;
- Expect.isTrue(
- collector.warnings.isEmpty, "Unexpected warnings: ${collector.warnings}");
- print('testPatchNonPatchableOrigin:${collector.errors}');
- Expect.equals(2, collector.errors.length);
- Expect.equals(
- MessageKind.EXTRANEOUS_MODIFIER, collector.errors.first.message.kind);
- Expect.equals(
- // TODO(ahe): Eventually, this error should be removed as it will be
- // handled by the regular parser.
- MessageKind.PATCH_NONPATCHABLE,
- collector.errors.elementAt(1).message.kind);
-}
-
-Future testPatchNonExternalTopLevel() async {
- dynamic compiler = await applyPatch("""
- void foo() {}
- """, """
- @patch void foo() {}
- """);
- DiagnosticCollector collector = compiler.diagnosticCollector;
- print('testPatchNonExternalTopLevel.errors:${collector.errors}');
- print('testPatchNonExternalTopLevel.warnings:${collector.warnings}');
- Expect.equals(1, collector.errors.length);
- Expect.isTrue(
- collector.errors.first.message.kind == MessageKind.PATCH_NON_EXTERNAL);
- Expect.equals(0, collector.warnings.length);
- Expect.equals(1, collector.infos.length);
- Expect.isTrue(collector.infos.first.message.kind ==
- MessageKind.PATCH_POINT_TO_FUNCTION);
-}
-
-Future testPatchNonExternalMember() async {
- dynamic compiler = await applyPatch("""
- class Class {
- void foo() {}
- }
- """, """
- @patch class Class {
- @patch void foo() {}
- }
- """);
- dynamic container = ensure(
- compiler, "Class", compiler.resolution.commonElements.coreLibrary.find,
- expectIsPatched: true);
- container.parseNode(compiler.parsingContext);
-
- DiagnosticCollector collector = compiler.diagnosticCollector;
- print('testPatchNonExternalMember.errors:${collector.errors}');
- print('testPatchNonExternalMember.warnings:${collector.warnings}');
- Expect.equals(1, collector.errors.length);
- Expect.isTrue(
- collector.errors.first.message.kind == MessageKind.PATCH_NON_EXTERNAL);
- Expect.equals(0, collector.warnings.length);
- Expect.equals(1, collector.infos.length);
- Expect.isTrue(collector.infos.first.message.kind ==
- MessageKind.PATCH_POINT_TO_FUNCTION);
-}
-
-Future testPatchNonClass() async {
- dynamic compiler = await applyPatch("""
- external void Class() {}
- """, """
- @patch class Class {}
- """);
- DiagnosticCollector collector = compiler.diagnosticCollector;
- print('testPatchNonClass.errors:${collector.errors}');
- print('testPatchNonClass.warnings:${collector.warnings}');
- Expect.equals(1, collector.errors.length);
- Expect.isTrue(
- collector.errors.first.message.kind == MessageKind.PATCH_NON_CLASS);
- Expect.equals(0, collector.warnings.length);
- Expect.equals(1, collector.infos.length);
- Expect.isTrue(
- collector.infos.first.message.kind == MessageKind.PATCH_POINT_TO_CLASS);
-}
-
-Future testPatchNonGetter() async {
- dynamic compiler = await applyPatch("""
- external void foo() {}
- """, """
- @patch get foo => 0;
- """);
- DiagnosticCollector collector = compiler.diagnosticCollector;
- print('testPatchNonClass.errors:${collector.errors}');
- print('testPatchNonClass.warnings:${collector.warnings}');
- Expect.equals(1, collector.errors.length);
- Expect.isTrue(
- collector.errors.first.message.kind == MessageKind.PATCH_NON_GETTER);
- Expect.equals(0, collector.warnings.length);
- Expect.equals(1, collector.infos.length);
- Expect.isTrue(
- collector.infos.first.message.kind == MessageKind.PATCH_POINT_TO_GETTER);
-}
-
-Future testPatchNoGetter() async {
- dynamic compiler = await applyPatch("""
- external set foo(var value) {}
- """, """
- @patch get foo => 0;
- """);
- DiagnosticCollector collector = compiler.diagnosticCollector;
- print('testPatchNonClass.errors:${collector.errors}');
- print('testPatchNonClass.warnings:${collector.warnings}');
- Expect.equals(1, collector.errors.length);
- Expect.isTrue(
- collector.errors.first.message.kind == MessageKind.PATCH_NO_GETTER);
- Expect.equals(0, collector.warnings.length);
- Expect.equals(1, collector.infos.length);
- Expect.isTrue(
- collector.infos.first.message.kind == MessageKind.PATCH_POINT_TO_GETTER);
-}
-
-Future testPatchNonSetter() async {
- dynamic compiler = await applyPatch("""
- external void foo() {}
- """, """
- @patch set foo(var value) {}
- """);
- DiagnosticCollector collector = compiler.diagnosticCollector;
- print('testPatchNonClass.errors:${collector.errors}');
- print('testPatchNonClass.warnings:${collector.warnings}');
- Expect.equals(1, collector.errors.length);
- Expect.isTrue(
- collector.errors.first.message.kind == MessageKind.PATCH_NON_SETTER);
- Expect.equals(0, collector.warnings.length);
- Expect.equals(1, collector.infos.length);
- Expect.isTrue(
- collector.infos.first.message.kind == MessageKind.PATCH_POINT_TO_SETTER);
-}
-
-Future testPatchNoSetter() async {
- dynamic compiler = await applyPatch("""
- external get foo;
- """, """
- @patch set foo(var value) {}
- """);
- DiagnosticCollector collector = compiler.diagnosticCollector;
- print('testPatchNonClass.errors:${collector.errors}');
- print('testPatchNonClass.warnings:${collector.warnings}');
- Expect.equals(1, collector.errors.length);
- Expect.isTrue(
- collector.errors.first.message.kind == MessageKind.PATCH_NO_SETTER);
- Expect.equals(0, collector.warnings.length);
- Expect.equals(1, collector.infos.length);
- Expect.isTrue(
- collector.infos.first.message.kind == MessageKind.PATCH_POINT_TO_SETTER);
-}
-
-Future testPatchNonFunction() async {
- dynamic compiler = await applyPatch("""
- external get foo;
- """, """
- @patch void foo() {}
- """);
- DiagnosticCollector collector = compiler.diagnosticCollector;
- print('testPatchNonClass.errors:${collector.errors}');
- print('testPatchNonClass.warnings:${collector.warnings}');
- Expect.equals(1, collector.errors.length);
- Expect.isTrue(
- collector.errors.first.message.kind == MessageKind.PATCH_NON_FUNCTION);
- Expect.equals(0, collector.warnings.length);
- Expect.equals(1, collector.infos.length);
- Expect.isTrue(collector.infos.first.message.kind ==
- MessageKind.PATCH_POINT_TO_FUNCTION);
-}
-
-Future testPatchAndSelector() async {
- dynamic compiler = await applyPatch("""
- class A {
- external void clear();
- }
- class B extends A {
- }
- """, """
- @patch class A {
- int method() => 0;
- @patch void clear() {}
- }
- """, main: """
- main () {
- new A(); // ensure A and B are instantiated
- new B();
- }
- """, runCompiler: true, analyzeOnly: true);
- compiler.closeResolution(
- compiler.frontendStrategy.elementEnvironment.mainFunction);
- ClosedWorld world = compiler.resolutionWorldBuilder.closedWorldForTesting;
-
- ClassElement cls = ensure(
- compiler, "A", compiler.resolution.commonElements.coreLibrary.find,
- expectIsPatched: true);
- cls.ensureResolved(compiler.resolution);
-
- ensure(compiler, "method", cls.patch.lookupLocalMember,
- checkHasBody: true, expectIsRegular: true);
-
- ensure(compiler, "clear", cls.lookupLocalMember,
- checkHasBody: true, expectIsPatched: true);
-
- compiler.phase = Compiler.PHASE_DONE_RESOLVING;
-
- // Check that a method just in the patch class is a target for a
- // typed selector.
- Selector selector =
- new Selector.call(const PublicName('method'), CallStructure.NO_ARGS);
- TypeMask typeMask = new TypeMask.exact(cls, world);
- MethodElement method = cls.implementation.lookupLocalMember('method');
- method.computeType(compiler.resolution);
- Expect.isTrue(selector.applies(method));
- Expect.isTrue(typeMask.canHit(method, selector, world));
-
- // Check that the declaration method in the declaration class is a target
- // for a typed selector.
- selector =
- new Selector.call(const PublicName('clear'), CallStructure.NO_ARGS);
- typeMask = new TypeMask.exact(cls, world);
- method = cls.lookupLocalMember('clear');
- method.computeType(compiler.resolution);
- Expect.isTrue(selector.applies(method));
- Expect.isTrue(typeMask.canHit(method, selector, world));
-
- // Check that the declaration method in the declaration class is a target
- // for a typed selector on a subclass.
- cls = ensure(
- compiler, "B", compiler.resolution.commonElements.coreLibrary.find);
- cls.ensureResolved(compiler.resolution);
- typeMask = new TypeMask.exact(cls, world);
- Expect.isTrue(selector.applies(method));
- Expect.isTrue(typeMask.canHit(method, selector, world));
-}
-
-Future testAnalyzeAllInjectedMembers() async {
- Future expect(String patchText, [expectedWarnings]) async {
- if (expectedWarnings == null) expectedWarnings = [];
- if (expectedWarnings is! List) {
- expectedWarnings = <MessageKind>[expectedWarnings];
- }
-
- dynamic compiler =
- await applyPatch('', patchText, analyzeAll: true, analyzeOnly: true);
- compiler.librariesToAnalyzeWhenRun = [Uri.parse('dart:core')];
- await compiler.run(null);
- DiagnosticCollector collector = compiler.diagnosticCollector;
- compareWarningKinds(patchText, expectedWarnings, collector.warnings);
- }
-
- await expect('String s = 0;', MessageKind.NOT_ASSIGNABLE);
- await expect('void method() { String s = 0; }', MessageKind.NOT_ASSIGNABLE);
- await expect('''
- class Class {
- String s = 0;
- }
- ''', MessageKind.NOT_ASSIGNABLE);
- await expect('''
- class Class {
- void method() {
- String s = 0;
- }
- }
- ''', MessageKind.NOT_ASSIGNABLE);
-}
-
-Future testEffectiveTarget() async {
- String origin = """
- class A {
- A() : super();
- factory A.forward() = B.patchTarget;
- factory A.forwardOne() = B.patchFactory;
- factory A.forwardTwo() = B.reflectBack;
- factory A.forwardThree() = B.patchInjected;
- }
- class B extends A {
- B() : super();
- external B.patchTarget();
- external factory B.patchFactory();
- external factory B.reflectBack();
- B.originTarget() : super();
- external factory B.patchInjected();
- }
- """;
- String patch = """
- @patch class B {
- @patch
- B.patchTarget() : super();
- @patch
- factory B.patchFactory() => new B.patchTarget();
- @patch
- factory B.reflectBack() = B.originTarget;
- @patch
- factory B.patchInjected() = _C.injected;
- }
- class _C extends B {
- _C.injected() : super.patchTarget();
- }
- """;
-
- dynamic compiler = await applyPatch(origin, patch,
- analyzeAll: true, analyzeOnly: true, runCompiler: true);
- ClassElement clsA = compiler.resolution.commonElements.coreLibrary.find("A");
- ClassElement clsB = compiler.resolution.commonElements.coreLibrary.find("B");
- Expect.isNotNull(clsB);
-
- ConstructorElement forward = clsA.lookupConstructor("forward");
- ConstructorElement target = forward.effectiveTarget;
- Expect.isTrue(target.isPatched, "Unexpected target $target for $forward");
- Expect.isFalse(target.isPatch, "Unexpected target $target for $forward");
- Expect.equals("patchTarget", target.name);
-
- ConstructorElement forwardOne = clsA.lookupConstructor("forwardOne");
- target = forwardOne.effectiveTarget;
- Expect.isFalse(forwardOne.isMalformed);
- Expect.isFalse(target.isPatch, "Unexpected target $target for $forwardOne");
- Expect.equals("patchFactory", target.name);
-
- ConstructorElement forwardTwo = clsA.lookupConstructor("forwardTwo");
- target = forwardTwo.effectiveTarget;
- Expect.isFalse(forwardTwo.isMalformed);
- Expect.isFalse(target.isPatch, "Unexpected target $target for $forwardTwo");
- Expect.equals("originTarget", target.name);
-
- ConstructorElement forwardThree = clsA.lookupConstructor("forwardThree");
- target = forwardThree.effectiveTarget;
- Expect.isFalse(forwardThree.isMalformed);
- Expect.isTrue(
- target.isInjected, "Unexpected target $target for $forwardThree");
- Expect.equals("injected", target.name);
-}
-
-Future testTypecheckPatchedMembers() async {
- String originText = "external void method();";
- String patchText = """
- @patch void method() {
- String s = 0;
- }
- """;
- dynamic compiler = await applyPatch(originText, patchText,
- analyzeAll: true, analyzeOnly: true);
- compiler.librariesToAnalyzeWhenRun = [Uri.parse('dart:core')];
- await compiler.run(null);
- DiagnosticCollector collector = compiler.diagnosticCollector;
- compareWarningKinds(
- patchText, [MessageKind.NOT_ASSIGNABLE], collector.warnings);
-}
-
-main() {
- asyncTest(() async {
- await testPatchConstructor();
- await testPatchRedirectingConstructor();
- await testPatchFunction();
- await testPatchFunctionMetadata();
- await testPatchFunctionGeneric();
- await testPatchFunctionGenericExtraTypeVariable();
- await testPatchFunctionGenericDifferentNames();
- await testPatchMember();
- await testPatchGetter();
- await testRegularMember();
- await testInjectedMember();
- await testInjectedPublicMember();
- await testInjectedFunction();
- await testInjectedPublicFunction();
- await testPatchSignatureCheck();
-
- await testExternalWithoutImplementationTopLevel();
- await testExternalWithoutImplementationMember();
-
- await testIsSubclass();
-
- await testPatchNonExistingTopLevel();
- await testPatchNonExistingMember();
- await testPatchNonPatchablePatch();
- await testPatchNonPatchableOrigin();
- await testPatchNonExternalTopLevel();
- await testPatchNonExternalMember();
- await testPatchNonClass();
- await testPatchNonGetter();
- await testPatchNoGetter();
- await testPatchNonSetter();
- await testPatchNoSetter();
- await testPatchNonFunction();
-
- await testPatchAndSelector();
-
- await testEffectiveTarget();
-
- await testAnalyzeAllInjectedMembers();
- await testTypecheckPatchedMembers();
- });
-}
diff --git a/tests/compiler/dart2js/old_frontend/platform_consistency_test.dart b/tests/compiler/dart2js/old_frontend/platform_consistency_test.dart
deleted file mode 100644
index 59b257c..0000000
--- a/tests/compiler/dart2js/old_frontend/platform_consistency_test.dart
+++ /dev/null
@@ -1,32 +0,0 @@
-// Copyright (c) 2015, the Fletch 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.md file.
-
-import "package:compiler/src/platform_configuration.dart";
-import "package:compiler/src/source_file_provider.dart";
-import "package:compiler/compiler_new.dart";
-import "package:expect/expect.dart";
-
-main() async {
- CompilerInput input = new CompilerSourceFileProvider();
- Map<String, Uri> client =
- await load(Uri.base.resolve("sdk/lib/dart_client.platform"), input);
- Map<String, Uri> server =
- await load(Uri.base.resolve("sdk/lib/dart_server.platform"), input);
- Map<String, Uri> shared =
- await load(Uri.base.resolve("sdk/lib/dart_shared.platform"), input);
- Expect.setEquals(new Set.from(shared.keys), new Set.from(client.keys));
- Expect.setEquals(new Set.from(shared.keys), new Set.from(server.keys));
-
- for (String libraryName in shared.keys) {
- test(Map<String, Uri> m) {
- if (m[libraryName].scheme != 'unsupported' &&
- shared[libraryName].scheme != 'unsupported') {
- Expect.equals(shared[libraryName], m[libraryName]);
- }
- }
-
- test(client);
- test(server);
- }
-}
diff --git a/tests/compiler/dart2js/old_frontend/private_test.dart b/tests/compiler/dart2js/old_frontend/private_test.dart
deleted file mode 100644
index 569485d..0000000
--- a/tests/compiler/dart2js/old_frontend/private_test.dart
+++ /dev/null
@@ -1,170 +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:async';
-
-import 'package:async_helper/async_helper.dart';
-import 'package:compiler/src/diagnostics/messages.dart' show MessageKind;
-import 'package:compiler/src/io/source_file.dart';
-import 'package:compiler/src/old_to_new_api.dart';
-
-import 'mock_compiler.dart';
-
-const String PRIVATE_SOURCE_URI = 'src:private';
-const String PRIVATE_SOURCE = '''
-
-var _privateVariable;
-void _privateFunction() {}
-
-class _PrivateClass {
- _PrivateClass();
- _PrivateClass.publicConstructor();
- _PrivateClass._privateConstructor();
-
- var _privateField;
- get _privateGetter => null;
- void set _privateSetter(var value) {}
- void _privateMethod() {}
-
- var publicField;
- get publicGetter => null;
- void set publicSetter(var value) {}
- void publicMethod() {}
-}
-
-class PublicClass extends _PrivateClass {
- PublicClass() : super();
- PublicClass.publicConstructor() : super.publicConstructor();
- PublicClass._privateConstructor() : super._privateConstructor();
-
- _PrivateClass get private => this;
-}
-''';
-
-analyze(String text, [expectedWarnings]) {
- return () {
- if (expectedWarnings == null) expectedWarnings = [];
- if (expectedWarnings is! List) expectedWarnings = [expectedWarnings];
-
- MockCompiler compiler = new MockCompiler.internal(analyzeOnly: true);
- compiler.registerSource(Uri.parse(PRIVATE_SOURCE_URI), PRIVATE_SOURCE);
- compiler.diagnosticHandler = new LegacyCompilerDiagnostics(
- (uri, int begin, int end, String message, kind) {
- SourceFile sourceFile = compiler.sourceFiles[uri.toString()];
- if (sourceFile != null) {
- print(sourceFile.getLocationMessage(message, begin, end));
- } else {
- print(message);
- }
- });
-
- String source = '''
- library public;
-
- import '$PRIVATE_SOURCE_URI';
-
- void main() {
- PublicClass publicClass;
- $text
- }
- ''';
- Uri uri = Uri.parse('src:public');
- compiler.registerSource(uri, source);
- return compiler.run(uri).then((_) {
- DiagnosticCollector collector = compiler.diagnosticCollector;
- compareWarningKinds(text, expectedWarnings, collector.warnings);
- });
- };
-}
-
-void main() {
- asyncTest(() => Future.forEach([
- // Read from private variable.
- analyze('var value = _privateVariable;', MessageKind.CANNOT_RESOLVE),
- // Write to private variable.
- analyze('_privateVariable = 0;', MessageKind.CANNOT_RESOLVE),
- // Access private function.
- analyze('var value = _privateFunction;', MessageKind.CANNOT_RESOLVE),
- // Call private function.
- analyze('_privateFunction();', MessageKind.CANNOT_RESOLVE),
-
- // Call unnamed (public) constructor on private class.
- analyze('new _PrivateClass();', MessageKind.CANNOT_RESOLVE),
- // Call public constructor on private class.
- analyze('new _PrivateClass.publicConstructor();',
- MessageKind.CANNOT_RESOLVE),
- // Call private constructor on private class.
- analyze('new _PrivateClass._privateConstructor();',
- MessageKind.CANNOT_RESOLVE),
- // Call public getter of private type.
- analyze('var value = publicClass.private;'),
- // Read from private field on private class.
- analyze('var value = publicClass.private._privateField;',
- MessageKind.PRIVATE_ACCESS),
- // Write to private field on private class.
- analyze('publicClass.private._privateField = 0;',
- MessageKind.PRIVATE_ACCESS),
- // Call private getter on private class.
- analyze('var value = publicClass.private._privateGetter;',
- MessageKind.PRIVATE_ACCESS),
- // Call private setter on private class.
- analyze('publicClass.private._privateSetter = 0;',
- MessageKind.PRIVATE_ACCESS),
- // Access private method on private class.
- analyze('var value = publicClass.private._privateMethod;',
- MessageKind.PRIVATE_ACCESS),
- // Call private method on private class.
- analyze('publicClass.private._privateMethod();',
- MessageKind.PRIVATE_ACCESS),
-
- // Read from public field on private class.
- analyze('var value = publicClass.private.publicField;'),
- // Write to public field on private class.
- analyze('publicClass.private.publicField = 0;'),
- // Call public getter on private class.
- analyze('var value = publicClass.private.publicGetter;'),
- // Call public setter on private class.
- analyze('publicClass.private.publicSetter = 0;'),
- // Access public method on private class.
- analyze('var value = publicClass.private.publicMethod;'),
- // Call public method on private class.
- analyze('publicClass.private.publicMethod();'),
-
- // Call unnamed (public) constructor on public class.
- analyze('publicClass = new PublicClass();'),
- // Call public constructor on public class.
- analyze('publicClass = new PublicClass.publicConstructor();'),
- // Call private constructor on public class.
- analyze('publicClass = new PublicClass._privateConstructor();',
- MessageKind.CANNOT_FIND_CONSTRUCTOR),
- // Read from private field on public class.
- analyze('var value = publicClass._privateField;',
- MessageKind.PRIVATE_ACCESS),
- // Write to private field on public class.
- analyze('publicClass._privateField = 0;', MessageKind.PRIVATE_ACCESS),
- // Call private getter on public class.
- analyze('var value = publicClass._privateGetter;',
- MessageKind.PRIVATE_ACCESS),
- // Call private setter on public class.
- analyze('publicClass._privateSetter = 0;', MessageKind.PRIVATE_ACCESS),
- // Access private method on public class.
- analyze('var value = publicClass._privateMethod;',
- MessageKind.PRIVATE_ACCESS),
- // Call private method on public class.
- analyze('publicClass._privateMethod();', MessageKind.PRIVATE_ACCESS),
-
- // Read from public field on public class.
- analyze('var value = publicClass.publicField;'),
- // Write to public field on public class.
- analyze('publicClass.publicField = 0;'),
- // Call public getter on public class.
- analyze('var value = publicClass.publicGetter;'),
- // Call public setter on public class.
- analyze('publicClass.publicSetter = 0;'),
- // Access public method on public class.
- analyze('var value = publicClass.publicMethod;'),
- // Call public method on public class.
- analyze('publicClass.publicMethod();'),
- ], (f) => f()));
-}
diff --git a/tests/compiler/dart2js/old_frontend/proxy_test.dart b/tests/compiler/dart2js/old_frontend/proxy_test.dart
deleted file mode 100644
index 0131db9..0000000
--- a/tests/compiler/dart2js/old_frontend/proxy_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.
-
-// Test that dart2js produces the expected static type warnings for proxy
-// language tests. This ensures that the analyzer and dart2js agrees on these
-// tests.
-
-import 'warnings_checker.dart';
-
-/// Map from test files to a map of their expected status. If the status map is
-/// `null` no warnings must be missing or unexpected, otherwise the status map
-/// can contain a list of line numbers for keys 'missing' and 'unexpected' for
-/// the warnings of each category.
-const Map<String, dynamic> TESTS = const {
- 'language/proxy_test.dart': null,
- 'language/proxy2_test.dart': null,
- 'language/proxy3_test.dart': null,
- 'language/proxy4_test.dart': null,
- 'language/proxy5_test.dart': null,
-};
-
-void main(List<String> args) {
- checkWarnings(TESTS, args);
-}
diff --git a/tests/compiler/dart2js/old_frontend/reexport_handled_test.dart b/tests/compiler/dart2js/old_frontend/reexport_handled_test.dart
deleted file mode 100644
index c8c0ad4..0000000
--- a/tests/compiler/dart2js/old_frontend/reexport_handled_test.dart
+++ /dev/null
@@ -1,48 +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.
-
-library reexport_handled_test;
-
-import "package:expect/expect.dart";
-import "package:async_helper/async_helper.dart";
-import 'package:compiler/src/elements/elements.dart' show LibraryElement;
-import 'mock_compiler.dart';
-
-final exportingLibraryUri = Uri.parse('exporting.dart');
-const String EXPORTING_LIBRARY_SOURCE = '''
-library exporting;
-var foo;
-''';
-
-final reexportingLibraryUri = Uri.parse('reexporting.dart');
-const String REEXPORTING_LIBRARY_SOURCE = '''
-library reexporting;
-export 'exporting.dart';
-''';
-
-void main() {
- MockCompiler compiler;
- asyncTest(() => MockCompiler.create((MockCompiler c) {
- compiler = c;
- compiler.registerSource(exportingLibraryUri, EXPORTING_LIBRARY_SOURCE);
- compiler.registerSource(
- reexportingLibraryUri, REEXPORTING_LIBRARY_SOURCE);
- return compiler.libraryLoader.loadLibrary(exportingLibraryUri);
- }).then((loadedLibraries) {
- compiler.processLoadedLibraries(loadedLibraries);
- LibraryElement exportingLibrary = loadedLibraries.rootLibrary;
- Expect.isTrue(exportingLibrary.exportsHandled);
- var foo = exportingLibrary.findExported('foo');
- Expect.isNotNull(foo);
- Expect.isTrue(foo.isField);
-
- // Load reexporting library when exports are handled on the exporting library.
- return compiler.libraryLoader.loadLibrary(reexportingLibraryUri);
- }).then((dynamic loadedLibraries) {
- compiler.processLoadedLibraries(loadedLibraries);
- var foo = loadedLibraries.rootLibrary.findExported('foo');
- Expect.isNotNull(foo);
- Expect.isTrue(foo.isField);
- }));
-}
diff --git a/tests/compiler/dart2js/old_frontend/related_types.dart b/tests/compiler/dart2js/old_frontend/related_types.dart
deleted file mode 100644
index 26f9607..0000000
--- a/tests/compiler/dart2js/old_frontend/related_types.dart
+++ /dev/null
@@ -1,445 +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.
-
-library related_types;
-
-import 'package:compiler/src/commandline_options.dart';
-import 'package:compiler/src/compiler.dart';
-import 'package:compiler/src/common_elements.dart';
-import 'package:compiler/src/elements/resolution_types.dart';
-import 'package:compiler/src/diagnostics/diagnostic_listener.dart';
-import 'package:compiler/src/diagnostics/messages.dart';
-import 'package:compiler/src/elements/elements.dart';
-import 'package:compiler/src/elements/names.dart';
-import 'package:compiler/src/filenames.dart';
-import 'package:compiler/src/resolution/semantic_visitor.dart';
-import 'package:compiler/src/tree/tree.dart';
-import 'package:compiler/src/universe/call_structure.dart';
-import 'package:compiler/src/universe/selector.dart';
-import 'package:compiler/src/world.dart';
-import '../memory_compiler.dart';
-
-main(List<String> arguments) async {
- if (arguments.isNotEmpty) {
- Uri entryPoint = Uri.base.resolve(nativeToUriPath(arguments.last));
- CompilationResult result = await runCompiler(
- entryPoint: entryPoint,
- options: [
- Flags.analyzeOnly,
- '--categories=Client,Server',
- Flags.useOldFrontend
- ]);
- if (result.isSuccess) {
- checkRelatedTypes(result.compiler);
- }
- } else {
- print('Usage dart related_types.dart <entry-point>');
- }
-}
-
-/// Check all loaded libraries in [compiler] for unrelated types.
-void checkRelatedTypes(Compiler compiler) {
- compiler.closeResolution(
- compiler.frontendStrategy.elementEnvironment.mainFunction);
- for (LibraryElement library in compiler.libraryLoader.libraries) {
- checkLibraryElement(compiler, library);
- }
-}
-
-/// Check [library] for unrelated types.
-void checkLibraryElement(Compiler compiler, LibraryElement library) {
- library.forEachLocalMember((Element element) {
- if (element.isClass) {
- ClassElement cls = element;
- cls.forEachLocalMember((_member) {
- MemberElement member = _member;
- checkMemberElement(compiler, member);
- });
- } else if (!element.isTypedef) {
- checkMemberElement(compiler, element);
- }
- });
-}
-
-/// Check [member] for unrelated types.
-void checkMemberElement(Compiler compiler, MemberElement member) {
- if (!compiler.resolution.hasBeenResolved(member)) return;
-
- ResolvedAst resolvedAst = member.resolvedAst;
- if (resolvedAst.kind == ResolvedAstKind.PARSED) {
- RelatedTypesChecker relatedTypesChecker =
- new RelatedTypesChecker(compiler, resolvedAst);
- compiler.reporter.withCurrentElement(member.implementation, () {
- relatedTypesChecker.apply(resolvedAst.node);
- });
- }
-}
-
-class RelatedTypesChecker
- extends TraversalVisitor<ResolutionDartType, dynamic> {
- final Compiler compiler;
- final ResolvedAst resolvedAst;
-
- RelatedTypesChecker(this.compiler, ResolvedAst resolvedAst)
- : this.resolvedAst = resolvedAst,
- super(resolvedAst.elements);
-
- ClosedWorld get world =>
- compiler.resolutionWorldBuilder.closedWorldForTesting;
-
- CommonElements get commonElements => compiler.resolution.commonElements;
-
- DiagnosticReporter get reporter => compiler.reporter;
-
- ResolutionInterfaceType get thisType =>
- resolvedAst.element.enclosingClass.thisType;
-
- /// Returns `true` if there exists no common subtype of [left] and [right].
- bool hasEmptyIntersection(ResolutionDartType left, ResolutionDartType right) {
- if (left == right) return false;
- if (left == null || right == null) return false;
- ClassElement leftClass = const ClassFinder().findClass(left);
- ClassElement rightClass = const ClassFinder().findClass(right);
- if (leftClass != null && rightClass != null) {
- return !world.haveAnyCommonSubtypes(leftClass, rightClass);
- }
- return false;
- }
-
- /// Checks that there exists a common subtype of [left] and [right] or report
- /// a hint otherwise.
- void checkRelated(
- Node node, ResolutionDartType left, ResolutionDartType right) {
- if (hasEmptyIntersection(left, right)) {
- reporter.reportHintMessage(
- node, MessageKind.NO_COMMON_SUBTYPES, {'left': left, 'right': right});
- }
- }
-
- /// Check weakly typed collection methods, like `Map.containsKey`,
- /// `Map.containsValue` and `Iterable.contains`.
- void checkDynamicInvoke(Node node, ResolutionDartType receiverType,
- List<ResolutionDartType> argumentTypes, Selector selector) {
- if (selector.name == 'containsKey' &&
- selector.callStructure == CallStructure.ONE_ARG) {
- ResolutionInterfaceType mapType = findMapType(receiverType);
- if (mapType != null) {
- ResolutionDartType keyType = findMapKeyType(mapType);
- checkRelated(node, keyType, argumentTypes.first);
- }
- } else if (selector.name == 'containsValue' &&
- selector.callStructure == CallStructure.ONE_ARG) {
- ResolutionInterfaceType mapType = findMapType(receiverType);
- if (mapType != null) {
- ResolutionDartType valueType = findMapValueType(mapType);
- checkRelated(node, valueType, argumentTypes.first);
- }
- } else if (selector.name == 'contains' &&
- selector.callStructure == CallStructure.ONE_ARG) {
- ResolutionInterfaceType iterableType = findIterableType(receiverType);
- if (iterableType != null) {
- ResolutionDartType elementType = findIterableElementType(iterableType);
- checkRelated(node, elementType, argumentTypes.first);
- }
- } else if (selector.name == 'remove' &&
- selector.callStructure == CallStructure.ONE_ARG) {
- ResolutionInterfaceType mapType = findMapType(receiverType);
- if (mapType != null) {
- ResolutionDartType keyType = findMapKeyType(mapType);
- checkRelated(node, keyType, argumentTypes.first);
- }
- ResolutionInterfaceType listType = findListType(receiverType);
- if (listType != null) {
- ResolutionDartType valueType = findListElementType(listType);
- checkRelated(node, valueType, argumentTypes.first);
- }
- }
- }
-
- /// Return the interface type implemented by [type] or `null` if no interface
- /// type is implied by [type].
- ResolutionInterfaceType findInterfaceType(ResolutionDartType type) {
- return Types.computeInterfaceType(compiler.resolution, type);
- }
-
- /// Returns the supertype of [receiver] that implements [cls], if any.
- ResolutionInterfaceType findClassType(
- ResolutionDartType receiver, ClassElement cls) {
- ResolutionInterfaceType interfaceType = findInterfaceType(receiver);
- if (interfaceType == null) return null;
- ResolutionInterfaceType mapType = interfaceType.asInstanceOf(cls);
- if (mapType == null) return null;
- return mapType;
- }
-
- /// Returns the supertype of [receiver] that implements `Iterable`, if any.
- ResolutionInterfaceType findIterableType(ResolutionDartType receiver) {
- return findClassType(receiver, commonElements.iterableClass);
- }
-
- /// Returns the element type of the supertype of [receiver] that implements
- /// `Iterable`, if any.
- ResolutionDartType findIterableElementType(
- ResolutionInterfaceType iterableType) {
- if (iterableType == null) return null;
- return iterableType.typeArguments[0];
- }
-
- /// Returns the supertype of [receiver] that implements `Map`, if any.
- ResolutionInterfaceType findMapType(ResolutionDartType receiver) {
- return findClassType(receiver, commonElements.mapClass);
- }
-
- /// Returns the key type of the supertype of [receiver] that implements
- /// `Map`, if any.
- ResolutionDartType findMapKeyType(ResolutionInterfaceType mapType) {
- if (mapType == null) return null;
- return mapType.typeArguments[0];
- }
-
- /// Returns the value type of the supertype of [receiver] that implements
- /// `Map`, if any.
- ResolutionDartType findMapValueType(ResolutionInterfaceType mapType) {
- if (mapType == null) return null;
- return mapType.typeArguments[1];
- }
-
- /// Returns the supertype of [receiver] that implements `List`, if any.
- ResolutionInterfaceType findListType(ResolutionDartType receiver) {
- return findClassType(receiver, commonElements.listClass);
- }
-
- /// Returns the element type of the supertype of [receiver] that implements
- /// `List`, if any.
- ResolutionDartType findListElementType(ResolutionInterfaceType listType) {
- if (listType == null) return null;
- return listType.typeArguments[0];
- }
-
- /// Returns the implied return type of [type] or `dynamic` if no return type
- /// is implied.
- ResolutionDartType findReturnType(ResolutionDartType type) {
- if (type is ResolutionFunctionType) {
- return type.returnType;
- }
- return const ResolutionDynamicType();
- }
-
- /// Visits [arguments] and returns the list of their corresponding types.
- List<ResolutionDartType> findArgumentTypes(NodeList arguments) {
- List<ResolutionDartType> argumentTypes = <ResolutionDartType>[];
- for (Node argument in arguments) {
- argumentTypes.add(apply(argument));
- }
- return argumentTypes;
- }
-
- /// Finds the [MemberSignature] of the [name] property on [type], if any.
- MemberSignature lookupInterfaceMember(ResolutionDartType type, Name name) {
- ResolutionInterfaceType interfaceType = findInterfaceType(type);
- if (interfaceType == null) return null;
- return interfaceType.lookupInterfaceMember(name);
- }
-
- /// Returns the type of an access of the [name] property on [type], or
- /// `dynamic` if no property was found.
- ResolutionDartType lookupInterfaceMemberAccessType(
- ResolutionDartType type, Name name) {
- MemberSignature member = lookupInterfaceMember(type, name);
- if (member == null) return const ResolutionDynamicType();
- return member.type;
- }
-
- /// Returns the function type of the [name] property on [type], or
- /// `dynamic` if no property was found.
- ResolutionFunctionType lookupInterfaceMemberInvocationType(
- ResolutionDartType type, Name name) {
- MemberSignature member = lookupInterfaceMember(type, name);
- if (member == null) return null;
- return member.functionType;
- }
-
- ResolutionDartType apply(Node node, [_]) {
- ResolutionDartType type = node.accept(this);
- if (type == null) {
- type = const ResolutionDynamicType();
- }
- return type;
- }
-
- @override
- ResolutionInterfaceType visitEquals(Send node, Node left, Node right, _) {
- ResolutionDartType leftType = apply(left);
- ResolutionDartType rightType = apply(right);
- checkRelated(node, leftType, rightType);
- return commonElements.boolType;
- }
-
- @override
- ResolutionInterfaceType visitNotEquals(Send node, Node left, Node right, _) {
- ResolutionDartType leftType = apply(left);
- ResolutionDartType rightType = apply(right);
- checkRelated(node, leftType, rightType);
- return commonElements.boolType;
- }
-
- @override
- ResolutionDartType visitIndex(Send node, Node receiver, Node index, _) {
- ResolutionDartType receiverType = apply(receiver);
- ResolutionDartType indexType = apply(index);
- ResolutionInterfaceType mapType = findMapType(receiverType);
- ResolutionDartType keyType = findMapKeyType(mapType);
- ResolutionDartType valueType = findMapValueType(mapType);
- checkRelated(index, keyType, indexType);
- return valueType;
- }
-
- @override
- ResolutionInterfaceType visitLiteralInt(LiteralInt node) {
- return commonElements.intType;
- }
-
- @override
- ResolutionInterfaceType visitLiteralString(LiteralString node) {
- return commonElements.stringType;
- }
-
- @override
- ResolutionInterfaceType visitLiteralBool(LiteralBool node) {
- return commonElements.boolType;
- }
-
- @override
- ResolutionDartType visitLiteralMap(LiteralMap node) {
- return elements.getType(node);
- }
-
- @override
- ResolutionDartType visitLiteralList(LiteralList node) {
- return elements.getType(node);
- }
-
- @override
- ResolutionDartType visitLiteralNull(LiteralNull node) {
- return elements.getType(node);
- }
-
- @override
- ResolutionDartType visitLocalVariableGet(
- Send node, LocalVariableElement variable, _) {
- return variable.type;
- }
-
- @override
- ResolutionDartType visitLocalFunctionGet(
- Send node, LocalFunctionElement function, _) {
- return function.type;
- }
-
- @override
- ResolutionDartType visitParameterGet(
- Send node, ParameterElement parameter, _) {
- return parameter.type;
- }
-
- @override
- ResolutionDartType visitThisPropertyGet(Send node, Name name, _) {
- return lookupInterfaceMemberAccessType(thisType, name);
- }
-
- @override
- ResolutionDartType visitDynamicPropertyGet(
- Send node, Node receiver, Name name, _) {
- ResolutionDartType receiverType = apply(receiver);
- return lookupInterfaceMemberAccessType(receiverType, name);
- }
-
- @override
- ResolutionDartType visitIfNotNullDynamicPropertyGet(
- Send node, Node receiver, Name name, _) {
- ResolutionDartType receiverType = apply(receiver);
- return lookupInterfaceMemberAccessType(receiverType, name);
- }
-
- @override
- ResolutionDartType visitStaticFieldGet(Send node, FieldElement field, _) {
- return field.type;
- }
-
- @override
- ResolutionDartType visitTopLevelFieldGet(Send node, FieldElement field, _) {
- return field.type;
- }
-
- @override
- ResolutionDartType visitDynamicPropertyInvoke(
- Send node, Node receiver, NodeList arguments, Selector selector, _) {
- ResolutionDartType receiverType = apply(receiver);
- List<ResolutionDartType> argumentTypes = findArgumentTypes(arguments);
- ResolutionFunctionType methodType =
- lookupInterfaceMemberInvocationType(receiverType, selector.memberName);
- checkDynamicInvoke(node, receiverType, argumentTypes, selector);
- return findReturnType(methodType);
- }
-
- @override
- ResolutionDartType visitThisPropertyInvoke(
- Send node, NodeList arguments, Selector selector, _) {
- ResolutionDartType receiverType = thisType;
- List<ResolutionDartType> argumentTypes = findArgumentTypes(arguments);
- ResolutionFunctionType methodType =
- lookupInterfaceMemberInvocationType(receiverType, selector.memberName);
- checkDynamicInvoke(node, receiverType, argumentTypes, selector);
- return findReturnType(methodType);
- }
-
- @override
- ResolutionDartType visitIfNotNullDynamicPropertyInvoke(
- Send node, Node receiver, NodeList arguments, Selector selector, _) {
- ResolutionDartType receiverType = apply(receiver);
- List<ResolutionDartType> argumentTypes = findArgumentTypes(arguments);
- ResolutionFunctionType methodType =
- lookupInterfaceMemberInvocationType(receiverType, selector.memberName);
- checkDynamicInvoke(node, receiverType, argumentTypes, selector);
- return findReturnType(methodType);
- }
-
- @override
- ResolutionDartType visitTopLevelFunctionInvoke(
- Send node,
- MethodElement function,
- NodeList arguments,
- CallStructure callStructure,
- _) {
- apply(arguments);
- return findReturnType(function.type);
- }
-
- @override
- ResolutionDartType visitStaticFunctionInvoke(
- Send node,
- MethodElement function,
- NodeList arguments,
- CallStructure callStructure,
- _) {
- apply(arguments);
- return findReturnType(function.type);
- }
-}
-
-/// Computes the [ClassElement] implied by a type.
-// TODO(johnniwinther): Handle type variables, function types and typedefs.
-class ClassFinder extends BaseResolutionDartTypeVisitor<ClassElement, dynamic> {
- const ClassFinder();
-
- ClassElement findClass(ResolutionDartType type) => type.accept(this, null);
-
- @override
- ClassElement visitType(ResolutionDartType type, _) => null;
-
- @override
- ClassElement visitInterfaceType(ResolutionInterfaceType type, _) {
- return type.element;
- }
-}
diff --git a/tests/compiler/dart2js/old_frontend/related_types_test.dart b/tests/compiler/dart2js/old_frontend/related_types_test.dart
deleted file mode 100644
index 963afa2..0000000
--- a/tests/compiler/dart2js/old_frontend/related_types_test.dart
+++ /dev/null
@@ -1,300 +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.
-
-library related_types.test;
-
-import 'package:async_helper/async_helper.dart';
-import 'package:expect/expect.dart';
-import 'package:compiler/src/commandline_options.dart';
-import 'package:compiler/src/common_elements.dart';
-import 'package:compiler/src/compiler.dart';
-import 'package:compiler/src/diagnostics/messages.dart';
-import 'package:compiler/src/elements/elements.dart';
-import '../memory_compiler.dart';
-
-import 'related_types.dart';
-
-const String CODE = '''
-Map<String, int> topLevelMap;
-List<String> topLevelList;
-
-Map<String, int> getTopLevelMap() => null;
-List<String> getTopLevelList() => null;
-
-class Class {
- Map<String, int> instanceMap;
- List<String> instanceList;
-
- Map<String, int> getInstanceMap() => null;
- List<String> getInstanceList() => null;
-
- static Map<String, int> staticMap;
- static List<String> staticList;
-
- static Map<String, int> getStaticMap() => null;
- static List<String> getStaticList() => null;
-
- test_instanceMapIndex() {
- instanceMap[0];
- }
- test_instanceMapContainsKey() {
- instanceMap.containsKey(0);
- }
- test_instanceMapContainsValue() {
- instanceMap.containsValue('');
- }
- test_instanceMapRemove() {
- instanceMap.remove(0);
- }
- test_instanceListContains() {
- instanceList.contains(0);
- }
- test_instanceListRemove() {
- instanceList.remove(0);
- }
-
- test_getInstanceMapIndex() {
- getInstanceMap()[0];
- }
- test_getInstanceMapContainsKey() {
- getInstanceMap().containsKey(0);
- }
- test_getInstanceMapContainsValue() {
- getInstanceMap().containsValue('');
- }
- test_getInstanceMapRemove() {
- getInstanceMap().remove(0);
- }
- test_getInstanceListContains() {
- getInstanceList().contains(0);
- }
- test_getInstanceListRemove() {
- getInstanceList().remove(0);
- }
-
- static test_staticMapIndex() {
- staticMap[0];
- }
- static test_staticMapContainsKey() {
- staticMap.containsKey(0);
- }
- static test_staticMapContainsValue() {
- staticMap.containsValue('');
- }
- static test_staticMapRemove() {
- staticMap.remove(0);
- }
- static test_staticListContains() {
- staticList.contains(0);
- }
- static test_staticListRemove() {
- staticList.remove(0);
- }
-
- static test_getStaticMapIndex() {
- getStaticMap()[0];
- }
- static test_getStaticMapContainsKey() {
- getStaticMap().containsKey(0);
- }
- static test_getStaticMapContainsValue() {
- getStaticMap().containsValue('');
- }
- static test_getStaticMapRemove() {
- getStaticMap().remove(0);
- }
- static test_getStaticListContains() {
- getStaticList().contains(0);
- }
- static test_getStaticListRemove() {
- getStaticList().remove(0);
- }
-}
-
-main() {}
-
-test_equals() => 0 == '';
-test_notEquals() => 0 != '';
-test_index() => <String, int>{}[0];
-
-test_localMapIndex() {
- Map<String, int> map;
- map[0];
-}
-test_localMapContainsKey() {
- Map<String, int> map;
- map.containsKey(0);
-}
-test_localMapContainsValue() {
- Map<String, int> map;
- map.containsValue('');
-}
-test_localMapRemove() {
- Map<String, int> map;
- map.remove(0);
-}
-test_localListContains() {
- List<String> list;
- list.contains(0);
-}
-test_localListRemove() {
- List<String> list;
- list.remove(0);
-}
-
-test_topLevelMapIndex() {
- topLevelMap[0];
-}
-test_topLevelMapContainsKey() {
- topLevelMap.containsKey(0);
-}
-test_topLevelMapContainsValue() {
- topLevelMap.containsValue('');
-}
-test_topLevelMapRemove() {
- topLevelMap.remove(0);
-}
-test_topLevelListContains() {
- topLevelList.contains(0);
-}
-test_topLevelListRemove() {
- topLevelList.remove(0);
-}
-
-test_getTopLevelMapIndex() {
- getTopLevelMap()[0];
-}
-test_getTopLevelMapContainsKey() {
- getTopLevelMap().containsKey(0);
-}
-test_getTopLevelMapContainsValue() {
- getTopLevelMap().containsValue('');
-}
-test_getTopLevelMapRemove() {
- getTopLevelMap().remove(0);
-}
-test_getTopLevelListContains() {
- getTopLevelList().contains(0);
-}
-test_getTopLevelListRemove() {
- getTopLevelList().remove(0);
-}
-
-test_staticMapIndex() {
- Class.staticMap[0];
-}
-test_staticMapContainsKey() {
- Class.staticMap.containsKey(0);
-}
-test_staticMapContainsValue() {
- Class.staticMap.containsValue('');
-}
-test_staticMapRemove() {
- Class.staticMap.remove(0);
-}
-test_staticListContains() {
- Class.staticList.contains(0);
-}
-test_staticListRemove() {
- Class.staticList.remove(0);
-}
-
-test_getStaticMapIndex() {
- Class.getStaticMap()[0];
-}
-test_getStaticMapContainsKey() {
- Class.getStaticMap().containsKey(0);
-}
-test_getStaticMapContainsValue() {
- Class.getStaticMap().containsValue('');
-}
-test_getStaticMapRemove() {
- Class.getStaticMap().remove(0);
-}
-test_getStaticListContains() {
- Class.getStaticList().contains(0);
-}
-test_getStaticListRemove() {
- Class.getStaticList().remove(0);
-}
-
-test_instanceMapIndex(Class c) {
- c.instanceMap[0];
-}
-test_instanceMapContainsKey(Class c) {
- c.instanceMap.containsKey(0);
-}
-test_instanceMapContainsValue(Class c) {
- c.instanceMap.containsValue('');
-}
-test_instanceMapRemove(Class c) {
- c.instanceMap.remove(0);
-}
-test_instanceListContains(Class c) {
- c.instanceList.contains(0);
-}
-test_instanceListRemove(Class c) {
- c.instanceList.remove(0);
-}
-
-test_getInstanceMapIndex(Class c) {
- c.getInstanceMap()[0];
-}
-test_getInstanceMapContainsKey(Class c) {
- c.getInstanceMap().containsKey(0);
-}
-test_getInstanceMapContainsValue(Class c) {
- c.getInstanceMap().containsValue('');
-}
-test_getInstanceMapRemove(Class c) {
- c.getInstanceMap().remove(0);
-}
-test_getInstanceListContains(Class c) {
- c.getInstanceList().contains(0);
-}
-test_getInstanceListRemove(Class c) {
- c.getInstanceList().remove(0);
-}
-''';
-
-main(List<String> arguments) {
- asyncTest(() async {
- DiagnosticCollector collector = new DiagnosticCollector();
- CompilationResult result = await runCompiler(
- memorySourceFiles: {'main.dart': CODE},
- options: [Flags.analyzeOnly, Flags.analyzeMain, Flags.useOldFrontend],
- diagnosticHandler: collector);
- Expect.isFalse(
- collector.hasRegularMessages, "Unexpected analysis messages.");
- Compiler compiler = result.compiler;
- ElementEnvironment elementEnvironment =
- compiler.frontendStrategy.elementEnvironment;
- compiler.closeResolution(elementEnvironment.mainFunction);
-
- void checkMember(Element element) {
- MemberElement member = element;
- if (!member.name.startsWith('test_')) return;
-
- collector.clear();
- checkMemberElement(compiler, member);
- Expect.equals(
- 1, collector.hints.length, "Unexpected hint count for $member.");
- Expect.equals(
- MessageKind.NO_COMMON_SUBTYPES,
- collector.hints.first.message.kind,
- "Unexpected message kind ${collector.hints.first.message.kind} "
- "for $member.");
- }
-
- LibraryElement mainApp = elementEnvironment.mainLibrary;
- mainApp.forEachLocalMember((Element element) {
- if (element.isClass) {
- ClassElement cls = element;
- cls.forEachLocalMember(checkMember);
- } else {
- checkMember(element);
- }
- });
- });
-}
diff --git a/tests/compiler/dart2js/old_frontend/resolution_test.dart b/tests/compiler/dart2js/old_frontend/resolution_test.dart
deleted file mode 100644
index ed0c2c9..0000000
--- a/tests/compiler/dart2js/old_frontend/resolution_test.dart
+++ /dev/null
@@ -1,124 +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 resolution does not resolve things we know will not be
-// needed by the backend.
-
-import 'package:async_helper/async_helper.dart';
-import 'package:expect/expect.dart';
-import 'package:compiler/src/apiimpl.dart';
-import '../compiler_helper.dart';
-
-const String NO_RUNTIME_TYPE = r"""
-import 'dart:core' as prefix;
-class A {
- A();
- A.z();
- static var bar;
- static foo() {}
-}
-main() {
- var print = prefix.print;
- // Check when accessing a static field.
- print(A.bar);
- print(A.bar());
- // Check when calling a static method.
- print(A.foo());
- print(A.foo);
- // Check when using a constructor.
- print(new A());
- // Check when using a named constructor.
- print(new A.z());
- // Check when using a type annotation.
- A a = new A();
- // Check when using a prefix.
- print(prefix.double.nan);
- print(prefix.double.nan());
- print(prefix.double.parse(''));
- print(prefix.double.parse);
- print(new prefix.DateTime(0));
- print(new prefix.DateTime.utc(0));
- prefix.DateTime c = new prefix.DateTime(0);
- A.bar = 0;
-}
-""";
-
-const String HAS_RUNTIME_TYPE_1 = r"""
-class A {
-}
-main() {
- print(A);
-}
-""";
-
-const String HAS_RUNTIME_TYPE_2 = r"""
-class A {
-}
-main() {
- print(2 + A);
-}
-""";
-
-const String HAS_RUNTIME_TYPE_3 = r"""
-class A {
-}
-main() {
- print(A[0]);
-}
-""";
-
-const String HAS_RUNTIME_TYPE_4 = r"""
-class A {
-}
-main() {
- var c = A;
-}
-""";
-
-const String HAS_RUNTIME_TYPE_5 = r"""
-import 'dart:core' as prefix;
-main() {
- prefix.print(prefix.Object);
-}
-""";
-
-const String HAS_RUNTIME_TYPE_6 = r"""
-class A {
- static var foo;
-}
-main() {
- (A).foo;
-}
-""";
-
-void test(String code, void check(CompilerImpl compiler)) {
- Uri uri = new Uri(scheme: 'source');
- dynamic compiler = mockCompilerFor(code, uri);
- asyncTest(() => compiler.run(uri).then((_) {
- check(compiler);
- }));
-}
-
-void testHasRuntimeType(String code) {
- test(code, (compiler) {
- var element = compiler.resolution.commonElements.createRuntimeType;
- Expect.isTrue(
- compiler.enqueuer.resolution.processedEntities.contains(element));
- });
-}
-
-main() {
- test(NO_RUNTIME_TYPE, (compiler) {
- var element = compiler.resolution.commonElements.createRuntimeType;
- Expect.isFalse(
- compiler.enqueuer.resolution.processedEntities.contains(element));
- });
-
- testHasRuntimeType(HAS_RUNTIME_TYPE_1);
- testHasRuntimeType(HAS_RUNTIME_TYPE_2);
- testHasRuntimeType(HAS_RUNTIME_TYPE_3);
- testHasRuntimeType(HAS_RUNTIME_TYPE_4);
- testHasRuntimeType(HAS_RUNTIME_TYPE_5);
- testHasRuntimeType(HAS_RUNTIME_TYPE_6);
-}
diff --git a/tests/compiler/dart2js/old_frontend/resolver_test.dart b/tests/compiler/dart2js/old_frontend/resolver_test.dart
deleted file mode 100644
index 41a7f81..0000000
--- a/tests/compiler/dart2js/old_frontend/resolver_test.dart
+++ /dev/null
@@ -1,1530 +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:async';
-import 'dart:collection';
-
-import 'package:async_helper/async_helper.dart';
-import 'package:expect/expect.dart';
-import 'package:compiler/src/constants/expressions.dart';
-import 'package:compiler/src/elements/modelx.dart';
-import 'package:compiler/src/elements/resolution_types.dart';
-import 'package:compiler/src/elements/types.dart';
-import 'package:compiler/src/resolution/constructors.dart';
-import 'package:compiler/src/resolution/members.dart';
-import 'package:compiler/src/resolution/registry.dart';
-import 'package:compiler/src/resolution/resolution_result.dart';
-import 'package:compiler/src/resolution/scope.dart';
-import 'package:compiler/src/resolution/tree_elements.dart';
-import 'package:compiler/src/universe/use.dart';
-import 'package:compiler/src/universe/world_impact.dart';
-
-import '../compiler_helper.dart';
-import '../link_helper.dart';
-import 'parser_helper.dart';
-
-Node buildIdentifier(String name) => new Identifier(scan(name));
-
-Node buildInitialization(String name) => parseBodyCode(
- '$name = 1',
- (parser, tokens) => parser.parseOptionallyInitializedIdentifier(
- parser.syntheticPreviousToken(tokens)));
-
-createLocals(List variables) {
- var locals = <Node>[];
- for (final variable in variables) {
- String name = variable[0];
- bool init = variable[1];
- if (init) {
- locals.add(buildInitialization(name));
- } else {
- locals.add(buildIdentifier(name));
- }
- }
- var definitions = new NodeList(null, LinkFromList(locals), null, null);
- return new VariableDefinitions(null, Modifiers.EMPTY, definitions);
-}
-
-Future<MockCompiler> testLocals(List variables) {
- return MockCompiler.create((MockCompiler compiler) {
- ResolverVisitor visitor = compiler.resolverVisitor();
- ResolutionResult result = visitor.visit(createLocals(variables));
- // A VariableDefinitions does not have an element.
- Expect.equals(const NoneResult(), result);
- Expect.equals(variables.length, map(visitor).length);
-
- for (final variable in variables) {
- final name = variable[0];
- Identifier id = buildIdentifier(name);
- ResolutionResult result = visitor.visit(id);
- final VariableElement variableElement = result.element;
- MethodScope scope = visitor.scope;
- Expect.equals(variableElement, scope.elements[name]);
- }
- return compiler;
- });
-}
-
-main() {
- asyncTest(() => Future.forEach([
- testLocalsOne,
- testLocalsTwo,
- testLocalsThree,
- testLocalsFour,
- testLocalsFive,
- testParametersOne,
- testFor,
- testTypeAnnotation,
- testSuperclass,
- // testVarSuperclass, // The parser crashes with 'class Foo extends var'.
- // testOneInterface, // Generates unexpected error message.
- // testTwoInterfaces, // Generates unexpected error message.
- testFunctionExpression,
- testNewExpression,
- testTopLevelFields,
- testClassHierarchy,
- testEnumDeclaration,
- testInitializers,
- testThis,
- testSuperCalls,
- testSwitch,
- testTypeVariables,
- testToString,
- testIndexedOperator,
- testIncrementsAndDecrements,
- testOverrideHashCodeCheck,
- testSupertypeOrder,
- testConstConstructorAndNonFinalFields,
- testCantAssignMethods,
- testCantAssignFinalAndConsts,
- testAwaitHint,
- testConstantExpressions,
- ], (f) => f()));
-}
-
-Future testSupertypeOrder() {
- return Future.wait([
- MockCompiler.create((MockCompiler compiler) {
- compiler.parseScript("""
-class I1 {}
-class I2 {}
-class J1 extends K1 {}
-class J2 implements K2 {}
-class K1 {}
-class K2 {}
-class L1 {}
-class A implements I1, I2 {}
-class B extends A implements J1, J2 {}
-class C extends B implements L1 {}
-""");
- compiler.resolveStatement("C c;");
- LibraryElement mainApp = compiler.mainApp;
- ClassElement classA = mainApp.find("A");
- ClassElement classB = mainApp.find("B");
- ClassElement classC = mainApp.find("C");
- Expect.equals('[ I2, I1, Object ]', classA.allSupertypes.toString());
- Expect.equals('[ A, J2, J1, I2, I1, K2, K1, Object ]',
- classB.allSupertypes.toString());
- Expect.equals('[ B, L1, A, J2, J1, I2, I1, K2, K1, Object ]',
- classC.allSupertypes.toString());
- }),
- MockCompiler.create((MockCompiler compiler) {
- compiler.parseScript("""
-class X<T> {}
-class Foo extends X<Foo> {}
-class Bar extends Foo implements X<Bar> {}
-""");
- compiler.resolveStatement("Bar bar;");
- DiagnosticCollector collector = compiler.diagnosticCollector;
- Expect.equals(0, collector.warnings.length);
- Expect.equals(1, collector.errors.length);
- Expect.equals(
- MessageKind.MULTI_INHERITANCE, collector.errors.first.message.kind);
- Expect.equals(0, collector.crashes.length);
- }),
- ]);
-}
-
-Future testTypeVariables() {
- matchResolvedTypes(visitor, text, name, expectedElements) {
- VariableDefinitions definition = parseStatement(text);
- visitor.visit(definition.type);
- ResolutionInterfaceType type =
- visitor.registry.mapping.getType(definition.type);
- NominalTypeAnnotation annotation = definition.type;
- Expect.equals(
- annotation.typeArguments.slowLength(), type.typeArguments.length);
- int index = 0;
- for (ResolutionDartType argument in type.typeArguments) {
- Expect.equals(true, index < expectedElements.length);
- Expect.equals(expectedElements[index], argument.element);
- index++;
- }
- Expect.equals(index, expectedElements.length);
- }
-
- return Future.wait([
- MockCompiler.create((MockCompiler compiler) {
- ResolverVisitor visitor = compiler.resolverVisitor();
- compiler.parseScript('class Foo<T, U> {}');
- LibraryElement mainApp = compiler.mainApp;
- ClassElement foo = mainApp.find('Foo');
- matchResolvedTypes(visitor, 'Foo<int, String> x;', 'Foo', [
- compiler.resolution.commonElements.intClass,
- compiler.resolution.commonElements.stringClass
- ]);
- matchResolvedTypes(visitor, 'Foo<Foo, Foo> x;', 'Foo', [foo, foo]);
- }),
- MockCompiler.create((MockCompiler compiler) {
- compiler.parseScript('class Foo<T, U> {}');
- compiler.resolveStatement('Foo<notype, int> x;');
- DiagnosticCollector collector = compiler.diagnosticCollector;
- Expect.equals(1, collector.warnings.length);
- Expect.equals(MessageKind.CANNOT_RESOLVE_TYPE,
- collector.warnings.first.message.kind);
- Expect.equals(0, collector.errors.length);
- }),
- MockCompiler.create((MockCompiler compiler) {
- compiler.parseScript('class Foo<T, U> {}');
- compiler.resolveStatement('var x = new Foo<notype, int>();');
- DiagnosticCollector collector = compiler.diagnosticCollector;
- Expect.equals(1, collector.warnings.length);
- Expect.equals(0, collector.errors.length);
- Expect.equals(MessageKind.CANNOT_RESOLVE_TYPE,
- collector.warnings.first.message.kind);
- }),
- MockCompiler.create((MockCompiler compiler) {
- compiler.parseScript('class Foo<T> {'
- ' Foo<T> t;'
- ' foo(Foo<T> f) {}'
- ' bar() { g(Foo<T> f) {}; g(); }'
- '}');
- LibraryElement mainApp = compiler.mainApp;
- ClassElement foo = mainApp.find('Foo');
- foo.ensureResolved(compiler.resolution);
- MemberElement tMember = foo.lookupLocalMember('t');
- tMember.computeType(compiler.resolution);
- MemberElement fooMember = foo.lookupLocalMember('foo');
- fooMember.computeType(compiler.resolution);
- compiler.resolver.resolve(foo.lookupLocalMember('bar'));
- DiagnosticCollector collector = compiler.diagnosticCollector;
- Expect.equals(0, collector.warnings.length);
- Expect.equals(0, collector.errors.length);
- }),
- ]);
-}
-
-Future testSuperCalls() {
- return MockCompiler.create((MockCompiler compiler) {
- String script = """class A { foo() {} }
- class B extends A { foo() => super.foo(); }""";
- compiler.parseScript(script);
- compiler.resolveStatement("B b;");
-
- LibraryElement mainApp = compiler.mainApp;
- ClassElement classB = mainApp.find("B");
- FunctionElement fooB = classB.lookupLocalMember("foo");
- ClassElement classA = mainApp.find("A");
- FunctionElement fooA = classA.lookupLocalMember("foo");
-
- ResolverVisitor visitor = new ResolverVisitor(
- compiler.resolution,
- fooB,
- new ResolutionRegistry(
- compiler.backend.target, new CollectingTreeElements(fooB)),
- scope: new MockTypeVariablesScope(classB.buildScope()));
- FunctionExpression node =
- (fooB as FunctionElementX).parseNode(compiler.parsingContext);
- visitor.visit(node.body);
- Map mapping = map(visitor);
-
- Send superCall = node.body.asReturn().expression;
- FunctionElement called = mapping[superCall];
- Expect.isNotNull(called);
- Expect.equals(fooA, called);
- });
-}
-
-Future testSwitch() {
- return MockCompiler.create((MockCompiler compiler) {
- compiler.parseScript("class Foo { foo() {"
- "switch (null) { case '': break; case 2: break; } } }");
- compiler.resolveStatement("Foo foo;");
- LibraryElement mainApp = compiler.mainApp;
- ClassElement fooElement = mainApp.find("Foo");
- MethodElement funElement = fooElement.lookupLocalMember("foo");
- compiler.enqueuer.resolution.applyImpact(new WorldImpactBuilderImpl()
- ..registerStaticUse(new StaticUse.implicitInvoke(funElement)));
- compiler.processQueue(compiler.frontendStrategy.elementEnvironment,
- compiler.enqueuer.resolution, null, compiler.libraryLoader.libraries);
- DiagnosticCollector collector = compiler.diagnosticCollector;
- Expect.equals(0, collector.warnings.length);
- Expect.equals(1, collector.errors.length);
- Expect.equals(MessageKind.SWITCH_CASE_TYPES_NOT_EQUAL,
- collector.errors.first.message.kind);
- Expect.equals(2, collector.infos.length);
- Expect.equals(MessageKind.SWITCH_CASE_TYPES_NOT_EQUAL_CASE,
- collector.infos.first.message.kind);
- Expect.equals(MessageKind.SWITCH_CASE_TYPES_NOT_EQUAL_CASE,
- collector.infos.elementAt(1).message.kind);
- });
-}
-
-Future testThis() {
- return Future.wait([
- MockCompiler.create((MockCompiler compiler) {
- compiler.parseScript("class Foo { foo() { return this; } }");
- compiler.resolveStatement("Foo foo;");
- LibraryElement mainApp = compiler.mainApp;
- ClassElement fooElement = mainApp.find("Foo");
- FunctionElement funElement = fooElement.lookupLocalMember("foo");
- ResolverVisitor visitor = new ResolverVisitor(
- compiler.resolution,
- funElement,
- new ResolutionRegistry(
- compiler.backend.target, new CollectingTreeElements(funElement)),
- scope: new MockTypeVariablesScope(fooElement.buildScope()));
- FunctionExpression function =
- (funElement as FunctionElementX).parseNode(compiler.parsingContext);
- visitor.visit(function.body);
- Map mapping = map(visitor);
- DiagnosticCollector collector = compiler.diagnosticCollector;
- Expect.equals(0, mapping.length);
- Expect.equals(0, collector.warnings.length);
- }),
- MockCompiler.create((MockCompiler compiler) {
- compiler.resolveStatement("main() { return this; }");
- DiagnosticCollector collector = compiler.diagnosticCollector;
- Expect.equals(0, collector.warnings.length);
- Expect.equals(1, collector.errors.length);
- Expect.equals(MessageKind.NO_INSTANCE_AVAILABLE,
- collector.errors.first.message.kind);
- }),
- MockCompiler.create((MockCompiler compiler) {
- compiler.parseScript("class Foo { static foo() { return this; } }");
- compiler.resolveStatement("Foo foo;");
- LibraryElement mainApp = compiler.mainApp;
- ClassElement fooElement = mainApp.find("Foo");
- FunctionElement funElement = fooElement.lookupLocalMember("foo");
- ResolverVisitor visitor = new ResolverVisitor(
- compiler.resolution,
- funElement,
- new ResolutionRegistry(
- compiler.backend.target, new CollectingTreeElements(funElement)),
- scope: new MockTypeVariablesScope(fooElement.buildScope()));
- FunctionExpression function =
- (funElement as FunctionElementX).parseNode(compiler.parsingContext);
- visitor.visit(function.body);
- DiagnosticCollector collector = compiler.diagnosticCollector;
- Expect.equals(0, collector.warnings.length);
- Expect.equals(1, collector.errors.length);
- Expect.equals(MessageKind.NO_INSTANCE_AVAILABLE,
- collector.errors.first.message.kind);
- }),
- ]);
-}
-
-Future testLocalsOne() {
- return Future.forEach([
- () => testLocals([
- ["foo", false]
- ]),
- () => testLocals([
- ["foo", false],
- ["bar", false]
- ]),
- () => testLocals([
- ["foo", false],
- ["bar", false],
- ["foobar", false]
- ]),
- () => testLocals([
- ["foo", true]
- ]),
- () => testLocals([
- ["foo", false],
- ["bar", true]
- ]),
- () => testLocals([
- ["foo", true],
- ["bar", true]
- ]),
- () => testLocals([
- ["foo", false],
- ["bar", false],
- ["foobar", true]
- ]),
- () => testLocals([
- ["foo", false],
- ["bar", true],
- ["foobar", true]
- ]),
- () => testLocals([
- ["foo", true],
- ["bar", true],
- ["foobar", true]
- ]),
- () => testLocals([
- ["foo", false],
- ["foo", false]
- ]).then((MockCompiler compiler) {
- DiagnosticCollector collector = compiler.diagnosticCollector;
- Expect.equals(1, collector.errors.length);
- Expect.equals(
- new Message(
- MessageTemplate.TEMPLATES[MessageKind.DUPLICATE_DEFINITION],
- {'name': 'foo'},
- false),
- collector.errors.first.message);
- })
- ], (f) => f());
-}
-
-Future testLocalsTwo() {
- return MockCompiler.create((MockCompiler compiler) {
- ResolverVisitor visitor = compiler.resolverVisitor();
- Node tree = parseStatement("if (true) { var a = 1; var b = 2; }");
- ResolutionResult result = visitor.visit(tree);
- Expect.equals(const NoneResult(), result);
- MethodScope scope = visitor.scope;
- Expect.equals(0, scope.elements.length);
- Expect.equals(2, map(visitor).length);
-
- List<Element> elements = new List<Element>.from(map(visitor).values);
- Expect.notEquals(elements[0], elements[1]);
- });
-}
-
-Future testLocalsThree() {
- return MockCompiler.create((MockCompiler compiler) {
- ResolverVisitor visitor = compiler.resolverVisitor();
- Node tree = parseStatement("{ var a = 1; if (true) { a; } }");
- ResolutionResult result = visitor.visit(tree);
- Expect.equals(const NoneResult(), result);
- MethodScope scope = visitor.scope;
- Expect.equals(0, scope.elements.length);
- Expect.equals(2, map(visitor).length);
- List<Element> elements = map(visitor).values.toList();
- Expect.equals(elements[0], elements[1]);
- });
-}
-
-Future testLocalsFour() {
- return MockCompiler.create((MockCompiler compiler) {
- ResolverVisitor visitor = compiler.resolverVisitor();
- Node tree = parseStatement("{ var a = 1; if (true) { var a = 1; } }");
- ResolutionResult result = visitor.visit(tree);
- Expect.equals(const NoneResult(), result);
- MethodScope scope = visitor.scope;
- Expect.equals(0, scope.elements.length);
- Expect.equals(2, map(visitor).length);
- List<Element> elements = map(visitor).values.toList();
- Expect.notEquals(elements[0], elements[1]);
- });
-}
-
-Future testLocalsFive() {
- return MockCompiler.create((MockCompiler compiler) {
- ResolverVisitor visitor = compiler.resolverVisitor();
- If tree =
- parseStatement("if (true) { var a = 1; a; } else { var a = 2; a;}");
- ResolutionResult result = visitor.visit(tree);
- Expect.equals(const NoneResult(), result);
- MethodScope scope = visitor.scope;
- Expect.equals(0, scope.elements.length);
- Expect.equals(4, map(visitor).length);
-
- Block thenPart = tree.thenPart;
- List statements1 = thenPart.statements.nodes.toList();
- Node def1 = statements1[0].definitions.nodes.head;
- Node id1 = statements1[1].expression;
- Expect.equals(
- visitor.registry.mapping[def1], visitor.registry.mapping[id1]);
-
- Block elsePart = tree.elsePart;
- List statements2 = elsePart.statements.nodes.toList();
- Node def2 = statements2[0].definitions.nodes.head;
- Node id2 = statements2[1].expression;
- Expect.equals(
- visitor.registry.mapping[def2], visitor.registry.mapping[id2]);
-
- Expect.notEquals(
- visitor.registry.mapping[def1], visitor.registry.mapping[def2]);
- Expect.notEquals(
- visitor.registry.mapping[id1], visitor.registry.mapping[id2]);
- });
-}
-
-Future testParametersOne() {
- return MockCompiler.create((MockCompiler compiler) {
- ResolverVisitor visitor = compiler.resolverVisitor();
- FunctionExpression tree =
- parseFunction("void foo(int a) { return a; }", compiler);
- visitor.visit(tree);
-
- // Check that an element has been created for the parameter.
- VariableDefinitions vardef = tree.parameters.nodes.head;
- Node param = vardef.definitions.nodes.head;
- Expect.equals(ElementKind.PARAMETER, visitor.registry.mapping[param].kind);
-
- // Check that 'a' in 'return a' is resolved to the parameter.
- Block body = tree.body;
- Return ret = body.statements.nodes.head;
- Send use = ret.expression;
- Expect.equals(ElementKind.PARAMETER, visitor.registry.mapping[use].kind);
- Expect.equals(
- visitor.registry.mapping[param], visitor.registry.mapping[use]);
- });
-}
-
-Future testFor() {
- return MockCompiler.create((MockCompiler compiler) {
- ResolverVisitor visitor = compiler.resolverVisitor();
- For tree = parseStatement("for (int i = 0; i < 10; i = i + 1) { i = 5; }");
- visitor.visit(tree);
-
- MethodScope scope = visitor.scope;
- Expect.equals(0, scope.elements.length);
- Expect.equals(5, map(visitor).length);
-
- VariableDefinitions initializer = tree.initializer;
- Node iNode = initializer.definitions.nodes.head;
- Element iElement = visitor.registry.mapping[iNode];
-
- // Check that we have the expected nodes. This test relies on the mapping
- // field to be a linked hash map (preserving insertion order).
- Expect.isTrue(map(visitor) is LinkedHashMap);
- List<Node> nodes = map(visitor).keys.toList();
- List<Element> elements = map(visitor).values.toList();
-
- // for (int i = 0; i < 10; i = i + 1) { i = 5; };
- // ^^^^^
- checkSendSet(iElement, nodes[0], elements[0]);
-
- // for (int i = 0; i < 10; i = i + 1) { i = 5; };
- // ^
- checkSend(iElement, nodes[1], elements[1]);
-
- // for (int i = 0; i < 10; i = i + 1) { i = 5; };
- // ^
- checkSend(iElement, nodes[2], elements[2]);
-
- // for (int i = 0; i < 10; i = i + 1) { i = 5; };
- // ^^^^^^^^^
- checkSendSet(iElement, nodes[3], elements[3]);
-
- // for (int i = 0; i < 10; i = i + 1) { i = 5; };
- // ^^^^^
- checkSendSet(iElement, nodes[4], elements[4]);
- });
-}
-
-checkIdentifier(Element expected, Node node, Element actual) {
- Expect.isTrue(node is Identifier, node.toDebugString());
- Expect.equals(expected, actual);
-}
-
-checkSend(Element expected, Node node, Element actual) {
- Expect.isTrue(node is Send, node.toDebugString());
- Expect.isTrue(node is! SendSet, node.toDebugString());
- Expect.equals(expected, actual);
-}
-
-checkSendSet(Element expected, Node node, Element actual) {
- Expect.isTrue(node is SendSet, node.toDebugString());
- Expect.equals(expected, actual);
-}
-
-Future testTypeAnnotation() {
- return MockCompiler.create((MockCompiler compiler) {
- String statement = "Foo bar;";
-
- // Test that we get a warning when Foo is not defined.
- Map mapping = compiler.resolveStatement(statement).map;
-
- Expect.equals(1, mapping.length); // Only [bar] has an element.
- DiagnosticCollector collector = compiler.diagnosticCollector;
- Expect.equals(1, collector.warnings.length);
-
- Expect.equals(
- new Message(MessageTemplate.TEMPLATES[MessageKind.CANNOT_RESOLVE_TYPE],
- {'typeName': 'Foo'}, false),
- collector.warnings.first.message);
- collector.clear();
-
- // Test that there is no warning after defining Foo.
- compiler.parseScript("class Foo {}");
- mapping = compiler.resolveStatement(statement).map;
- Expect.equals(1, mapping.length);
- Expect.equals(0, collector.warnings.length);
-
- // Test that 'var' does not create a warning.
- mapping = compiler.resolveStatement("var foo;").map;
- Expect.equals(1, mapping.length);
- Expect.equals(0, collector.warnings.length);
- });
-}
-
-Future testSuperclass() {
- return Future.wait([
- MockCompiler.create((MockCompiler compiler) {
- compiler.parseScript("class Foo extends Bar {}");
- compiler.resolveStatement("Foo bar;");
- DiagnosticCollector collector = compiler.diagnosticCollector;
- Expect.equals(1, collector.errors.length);
- var cannotResolveBar = new Message(
- MessageTemplate.TEMPLATES[MessageKind.CANNOT_EXTEND_MALFORMED],
- {'className': 'Foo', 'malformedType': 'Bar'},
- false);
- Expect.equals(cannotResolveBar, collector.errors.first.message);
- collector.clear();
- }),
- MockCompiler.create((MockCompiler compiler) {
- compiler.parseScript("class Foo extends Bar {}");
- compiler.parseScript("class Bar {}");
- Map mapping = compiler.resolveStatement("Foo bar;").map;
- Expect.equals(1, mapping.length);
-
- LibraryElement mainApp = compiler.mainApp;
- ClassElement fooElement = mainApp.find('Foo');
- ClassElement barElement = mainApp.find('Bar');
- Expect.equals(
- barElement.computeType(compiler.resolution), fooElement.supertype);
- Expect.isTrue(fooElement.interfaces.isEmpty);
- Expect.isTrue(barElement.interfaces.isEmpty);
- }),
- ]);
-}
-
-Future testVarSuperclass() {
- return MockCompiler.create((MockCompiler compiler) {
- compiler.parseScript("class Foo extends var {}");
- compiler.resolveStatement("Foo bar;");
- DiagnosticCollector collector = compiler.diagnosticCollector;
- Expect.equals(1, collector.errors.length);
- Expect.equals(
- new Message(MessageTemplate.TEMPLATES[MessageKind.CANNOT_RESOLVE_TYPE],
- {'typeName': 'var'}, false),
- collector.errors.first.message);
- collector.clear();
- });
-}
-
-Future testOneInterface() {
- return MockCompiler.create((MockCompiler compiler) {
- compiler.parseScript("class Foo implements Bar {}");
- compiler.resolveStatement("Foo bar;");
- DiagnosticCollector collector = compiler.diagnosticCollector;
- Expect.equals(1, collector.errors.length);
- Expect.equals(
- new Message(MessageTemplate.TEMPLATES[MessageKind.CANNOT_RESOLVE_TYPE],
- {'typeName': 'bar'}, false),
- collector.errors.first.message);
- collector.clear();
-
- // Add the abstract class to the world and make sure everything is setup
- // correctly.
- compiler.parseScript("abstract class Bar {}");
-
- compiler.resolveStatement("Foo bar;");
-
- LibraryElement mainApp = compiler.mainApp;
- ClassElement fooElement = mainApp.find('Foo');
- ClassElement barElement = mainApp.find('Bar');
-
- Expect.equals(null, barElement.supertype);
- Expect.isTrue(barElement.interfaces.isEmpty);
-
- Expect.equals(barElement.computeType(compiler.resolution),
- fooElement.interfaces.head);
- Expect.equals(1, length(fooElement.interfaces));
- });
-}
-
-Future testTwoInterfaces() {
- return MockCompiler.create((MockCompiler compiler) {
- compiler.parseScript("""abstract class I1 {}
- abstract class I2 {}
- class C implements I1, I2 {}""");
- compiler.resolveStatement("Foo bar;");
-
- LibraryElement mainApp = compiler.mainApp;
- ClassElement c = mainApp.find('C');
- ClassElement i1 = mainApp.find('I1');
- ClassElement i2 = mainApp.find('I2');
-
- Expect.equals(2, length(c.interfaces));
- Expect.equals(i1.computeType(compiler.resolution), at(c.interfaces, 0));
- Expect.equals(i2.computeType(compiler.resolution), at(c.interfaces, 1));
- });
-}
-
-Future testFunctionExpression() {
- return MockCompiler.create((MockCompiler compiler) {
- var mapping = compiler.resolveStatement("int f() {}").map;
- Expect.equals(2, mapping.length);
- Element element;
- Node node;
- mapping.forEach((Node n, Element e) {
- if (n is FunctionExpression) {
- element = e;
- node = n;
- }
- });
- Expect.equals(ElementKind.FUNCTION, element.kind);
- Expect.equals('f', element.name);
- Expect.equals((element as FunctionElement).node, node);
- });
-}
-
-Future testNewExpression() {
- return MockCompiler.create((MockCompiler compiler) {
- compiler.parseScript("class A {} foo() { print(new A()); }");
- LibraryElement mainApp = compiler.mainApp;
- ClassElement aElement = mainApp.find('A');
-
- FunctionElement fooElement = mainApp.find('foo');
- compiler.resolver.resolve(fooElement);
-
- Expect.isNotNull(aElement);
- Expect.isNotNull(fooElement);
-
- fooElement.node;
- compiler.resolver.resolve(fooElement);
-
- TreeElements elements = compiler.resolveStatement("new A();");
- NewExpression expression =
- compiler.parsedTree.asExpressionStatement().expression;
- Element element = elements[expression.send];
- Expect.equals(ElementKind.GENERATIVE_CONSTRUCTOR, element.kind);
- Expect.isTrue(element.isSynthesized);
- });
-}
-
-Future testTopLevelFields() {
- return MockCompiler.create((MockCompiler compiler) {
- compiler.parseScript("int a;");
- LibraryElement mainApp = compiler.mainApp;
- VariableElementX element = mainApp.find("a");
- Expect.equals(ElementKind.FIELD, element.kind);
- VariableDefinitions node =
- element.variables.parseNode(element, compiler.parsingContext);
- NominalTypeAnnotation annotation = node.type;
- Identifier typeName = annotation.typeName;
- Expect.equals(typeName.source, 'int');
-
- compiler.parseScript("var b, c;");
- VariableElementX bElement = mainApp.find("b");
- VariableElementX cElement = mainApp.find("c");
- Expect.equals(ElementKind.FIELD, bElement.kind);
- Expect.equals(ElementKind.FIELD, cElement.kind);
- Expect.isTrue(bElement != cElement);
-
- VariableDefinitions bNode =
- bElement.variables.parseNode(bElement, compiler.parsingContext);
- VariableDefinitions cNode =
- cElement.variables.parseNode(cElement, compiler.parsingContext);
- Expect.equals(bNode, cNode);
- Expect.isNull(bNode.type);
- Expect.isTrue(bNode.modifiers.isVar);
- });
-}
-
-Future resolveConstructor(String script, String statement, String className,
- String constructor, int expectedElementCount,
- {List expectedWarnings: const [],
- List expectedErrors: const [],
- List expectedInfos: const [],
- Map<String, String> corelib}) {
- MockCompiler compiler = new MockCompiler.internal(coreSource: corelib);
- return compiler.init().then((_) {
- compiler.parseScript(script);
- compiler.resolveStatement(statement);
- LibraryElement mainApp = compiler.mainApp;
- ClassElement classElement = mainApp.find(className);
- Element element;
- element = classElement.lookupConstructor(constructor);
- FunctionExpression tree = (element as FunctionElement).node;
- ResolverVisitor visitor = new ResolverVisitor(
- compiler.resolution,
- element,
- new ResolutionRegistry(
- compiler.backend.target, new CollectingTreeElements(element)),
- scope: classElement.buildScope());
- new InitializerResolver(visitor, element, tree).resolveInitializers();
- visitor.visit(tree.body);
- Expect.equals(expectedElementCount, map(visitor).length,
- "${map(visitor).values} for '$statement' in context of `$script`");
-
- DiagnosticCollector collector = compiler.diagnosticCollector;
- compareWarningKinds(script, expectedWarnings, collector.warnings);
- compareWarningKinds(script, expectedErrors, collector.errors);
- compareWarningKinds(script, expectedInfos, collector.infos);
- });
-}
-
-Future testClassHierarchy() {
- final MAIN = "main";
- return Future.wait([
- MockCompiler.create((MockCompiler compiler) {
- compiler.parseScript("""class A extends A {}
- main() { return new A(); }""");
- LibraryElement mainApp = compiler.mainApp;
- FunctionElement mainElement = mainApp.find(MAIN);
- compiler.resolver.resolve(mainElement);
- DiagnosticCollector collector = compiler.diagnosticCollector;
- Expect.equals(0, collector.warnings.length);
- Expect.equals(1, collector.errors.length);
- Expect.equals(MessageKind.CYCLIC_CLASS_HIERARCHY,
- collector.errors.first.message.kind);
- }),
- MockCompiler.create((MockCompiler compiler) {
- compiler.parseScript("""class A extends B {}
- class B extends A {}
- main() { return new A(); }""");
- LibraryElement mainApp = compiler.mainApp;
- FunctionElement mainElement = mainApp.find(MAIN);
- compiler.resolver.resolve(mainElement);
- DiagnosticCollector collector = compiler.diagnosticCollector;
- Expect.equals(0, collector.warnings.length);
- Expect.equals(2, collector.errors.length);
- Expect.equals(MessageKind.CYCLIC_CLASS_HIERARCHY,
- collector.errors.first.message.kind);
- Expect.equals(MessageKind.CANNOT_FIND_UNNAMED_CONSTRUCTOR,
- collector.errors.elementAt(1).message.kind);
- }),
- MockCompiler.create((MockCompiler compiler) {
- compiler.parseScript("""abstract class A extends B {}
- abstract class B extends A {}
- class C implements A {}
- main() { return new C(); }""");
- LibraryElement mainApp = compiler.mainApp;
- FunctionElement mainElement = mainApp.find(MAIN);
- compiler.resolver.resolve(mainElement);
- DiagnosticCollector collector = compiler.diagnosticCollector;
- Expect.equals(0, collector.warnings.length);
- Expect.equals(1, collector.errors.length);
- Expect.equals(MessageKind.CYCLIC_CLASS_HIERARCHY,
- collector.errors.first.message.kind);
- }),
- MockCompiler.create((MockCompiler compiler) {
- compiler.parseScript("""class A extends B {}
- class B extends C {}
- class C {}
- main() { return new A(); }""");
- LibraryElement mainApp = compiler.mainApp;
- FunctionElement mainElement = mainApp.find(MAIN);
- compiler.resolver.resolve(mainElement);
- DiagnosticCollector collector = compiler.diagnosticCollector;
- Expect.equals(0, collector.warnings.length);
- Expect.equals(0, collector.errors.length);
- ClassElement aElement = mainApp.find("A");
- Link<InterfaceType> supertypes = aElement.allSupertypes;
- Expect.equals(<String>['B', 'C', 'Object'].toString(),
- asSortedStrings(supertypes).toString());
- }),
- MockCompiler.create((MockCompiler compiler) {
- compiler.parseScript("""class A<T> {}
- class B<Z,W> extends A<int>
- implements I<Z,List<W>> {}
- class I<X,Y> {}
- class C extends B<bool,String> {}
- main() { return new C(); }""");
- LibraryElement mainApp = compiler.mainApp;
- FunctionElement mainElement = mainApp.find(MAIN);
- compiler.resolver.resolve(mainElement);
- DiagnosticCollector collector = compiler.diagnosticCollector;
- Expect.equals(0, collector.warnings.length);
- Expect.equals(0, collector.errors.length);
- ClassElement aElement = mainApp.find("C");
- Link<InterfaceType> supertypes = aElement.allSupertypes;
- // Object is once per inheritance path, that is from both A and I.
- Expect.equals(
- <String>[
- 'A<int>',
- 'B<bool, String>',
- 'I<bool, List<String>>',
- 'Object'
- ].toString(),
- asSortedStrings(supertypes).toString());
- }),
- MockCompiler.create((MockCompiler compiler) {
- compiler.parseScript("""class A<T> {}
- class D extends A<E> {}
- class E extends D {}
- main() { return new E(); }""");
- LibraryElement mainApp = compiler.mainApp;
- FunctionElement mainElement = mainApp.find(MAIN);
- compiler.resolver.resolve(mainElement);
- DiagnosticCollector collector = compiler.diagnosticCollector;
- Expect.equals(0, collector.warnings.length);
- Expect.equals(0, collector.errors.length);
- ClassElement aElement = mainApp.find("E");
- Link<InterfaceType> supertypes = aElement.allSupertypes;
- Expect.equals(<String>['A<E>', 'D', 'Object'].toString(),
- asSortedStrings(supertypes).toString());
- }),
- MockCompiler.create((MockCompiler compiler) {
- compiler.parseScript("""class A<T> {}
- class D extends A<int> implements A<double> {}
- main() { return new D(); }""");
- LibraryElement mainApp = compiler.mainApp;
- FunctionElement mainElement = mainApp.find(MAIN);
- compiler.resolver.resolve(mainElement);
- DiagnosticCollector collector = compiler.diagnosticCollector;
- Expect.equals(0, collector.warnings.length);
- Expect.equals(1, collector.errors.length);
- Expect.equals(
- MessageKind.MULTI_INHERITANCE, collector.errors.first.message.kind);
- Expect.equals(0, collector.crashes.length);
- }),
- ]);
-}
-
-Future testEnumDeclaration() {
- final MAIN = "main";
- return Future.wait([
- MockCompiler.create((MockCompiler compiler) {
- compiler.parseScript("""enum Enum {}
- main() { Enum e; }""");
- LibraryElement mainApp = compiler.mainApp;
- FunctionElement mainElement = mainApp.find(MAIN);
- compiler.resolver.resolve(mainElement);
- DiagnosticCollector collector = compiler.diagnosticCollector;
- Expect.equals(0, collector.warnings.length,
- 'Unexpected warnings: ${collector.warnings}');
- Expect.equals(
- 1, collector.errors.length, 'Unexpected errors: ${collector.errors}');
- }),
- MockCompiler.create((MockCompiler compiler) {
- compiler.parseScript("""enum Enum { A }
- main() { Enum e = Enum.A; }""");
- LibraryElement mainApp = compiler.mainApp;
- FunctionElement mainElement = mainApp.find(MAIN);
- compiler.resolver.resolve(mainElement);
- DiagnosticCollector collector = compiler.diagnosticCollector;
- Expect.equals(0, collector.warnings.length,
- 'Unexpected warnings: ${collector.warnings}');
- Expect.equals(
- 0, collector.errors.length, 'Unexpected errors: ${collector.errors}');
- }),
- MockCompiler.create((MockCompiler compiler) {
- compiler.parseScript("""enum Enum { A }
- main() { Enum e = Enum.B; }""");
- LibraryElement mainApp = compiler.mainApp;
- FunctionElement mainElement = mainApp.find(MAIN);
- compiler.resolver.resolve(mainElement);
- DiagnosticCollector collector = compiler.diagnosticCollector;
- Expect.equals(1, collector.warnings.length,
- 'Unexpected warnings: ${collector.warnings}');
- Expect.equals(
- MessageKind.UNDEFINED_GETTER, collector.warnings.first.message.kind);
- Expect.equals(
- 0, collector.errors.length, 'Unexpected errors: ${collector.errors}');
- }),
- MockCompiler.create((MockCompiler compiler) {
- compiler.parseScript("""enum Enum { A }
- main() { List values = Enum.values; }""");
- LibraryElement mainApp = compiler.mainApp;
- FunctionElement mainElement = mainApp.find(MAIN);
- compiler.resolver.resolve(mainElement);
- DiagnosticCollector collector = compiler.diagnosticCollector;
- Expect.equals(0, collector.warnings.length,
- 'Unexpected warnings: ${collector.warnings}');
- Expect.equals(
- 0, collector.errors.length, 'Unexpected errors: ${collector.errors}');
- }),
- MockCompiler.create((MockCompiler compiler) {
- compiler.parseScript("""enum Enum { A }
- main() { new Enum(0, ''); }""");
- LibraryElement mainApp = compiler.mainApp;
- FunctionElement mainElement = mainApp.find(MAIN);
- compiler.resolver.resolve(mainElement);
- DiagnosticCollector collector = compiler.diagnosticCollector;
- Expect.equals(0, collector.warnings.length,
- 'Unexpected warnings: ${collector.warnings}');
- Expect.equals(
- 1, collector.errors.length, 'Unexpected errors: ${collector.errors}');
- Expect.equals(MessageKind.CANNOT_INSTANTIATE_ENUM,
- collector.errors.first.message.kind);
- }),
- MockCompiler.create((MockCompiler compiler) {
- compiler.parseScript("""enum Enum { A }
- main() { const Enum(0, ''); }""");
- LibraryElement mainApp = compiler.mainApp;
- FunctionElement mainElement = mainApp.find(MAIN);
- compiler.resolver.resolve(mainElement);
- DiagnosticCollector collector = compiler.diagnosticCollector;
- Expect.equals(0, collector.warnings.length,
- 'Unexpected warnings: ${collector.warnings}');
- Expect.equals(
- 1, collector.errors.length, 'Unexpected errors: ${collector.errors}');
- Expect.equals(MessageKind.CANNOT_INSTANTIATE_ENUM,
- collector.errors.first.message.kind);
- }),
- ]);
-}
-
-Future testInitializers() {
- return Future.forEach([
- () {
- String script = """class A {
- int foo; int bar;
- A() : this.foo = 1, bar = 2;
- }""";
- return resolveConstructor(script, "A a = new A();", "A", "", 2);
- },
- () {
- String script = """class A {
- int foo; A a;
- A() : a.foo = 1;
- }""";
- return resolveConstructor(script, "A a = new A();", "A", "", 0,
- expectedWarnings: [],
- expectedErrors: [MessageKind.INVALID_RECEIVER_IN_INITIALIZER]);
- },
- () {
- String script = """class A {
- int foo;
- A() : this.foo = 1, this.foo = 2;
- }""";
- return resolveConstructor(script, "A a = new A();", "A", "", 2,
- expectedInfos: [MessageKind.ALREADY_INITIALIZED],
- expectedErrors: [MessageKind.DUPLICATE_INITIALIZER]);
- },
- () {
- String script = """class A {
- A() : this.foo = 1;
- }""";
- return resolveConstructor(script, "A a = new A();", "A", "", 1,
- expectedWarnings: [], expectedErrors: [MessageKind.CANNOT_RESOLVE]);
- },
- () {
- String script = """class A {
- int foo;
- int bar;
- A() : this.foo = bar;
- }""";
- return resolveConstructor(script, "A a = new A();", "A", "", 2,
- expectedWarnings: [],
- expectedErrors: [MessageKind.NO_INSTANCE_AVAILABLE]);
- },
- () {
- String script = """class A {
- int foo() => 42;
- A() : foo();
- }""";
- return resolveConstructor(script, "A a = new A();", "A", "", 0,
- expectedWarnings: [],
- expectedErrors: [MessageKind.CONSTRUCTOR_CALL_EXPECTED]);
- },
- () {
- String script = """class A {
- int i;
- A.a() : this.b(0);
- A.b(int i);
- }""";
- return resolveConstructor(script, "A a = new A.a();", "A", "a", 1);
- },
- () {
- String script = """class A {
- int i;
- A.a() : i = 42, this(0);
- A(int i);
- }""";
- return resolveConstructor(script, "A a = new A.a();", "A", "a", 2,
- expectedWarnings: [],
- expectedErrors: [
- MessageKind.REDIRECTING_CONSTRUCTOR_HAS_INITIALIZER
- ]);
- },
- () {
- String script = """class A {
- int i;
- A(i);
- }
- class B extends A {
- B() : super(0);
- }""";
- return resolveConstructor(script, "B a = new B();", "B", "", 1);
- },
- () {
- String script = """class A {
- int i;
- A(i);
- }
- class B extends A {
- B() : super(0), super(1);
- }""";
- return resolveConstructor(script, "B b = new B();", "B", "", 2,
- expectedWarnings: [],
- expectedErrors: [MessageKind.DUPLICATE_SUPER_INITIALIZER]);
- },
- () {
- String script = "";
- final INVALID_OBJECT = const {
- 'Object': 'class Object { Object() : super(); }'
- };
- return resolveConstructor(
- script, "Object o = new Object();", "Object", "", 1,
- expectedWarnings: [],
- expectedErrors: [MessageKind.SUPER_INITIALIZER_IN_OBJECT],
- corelib: INVALID_OBJECT);
- },
- ], (f) => f());
-}
-
-Future testConstantExpressions() {
- const Map<String, List<String>> testedConstants = const {
- 'null': const ['null'],
- 'true': const ['true'],
- '0': const ['0'],
- '0.0': const ['0.0'],
- '"foo"': const ['"foo"'],
- '#a': const ['#a'],
- '0 + 1': const ['0', '1', '0 + 1'],
- '0 * 1': const ['0', '1', '0 * 1'],
- '0 * 1 + 2': const ['0', '1', '0 * 1', '2', '0 * 1 + 2'],
- '0 + 1 * 2': const ['0', '1', '2', '1 * 2', '0 + 1 * 2'],
- '-(1)': const ['1', '-1'],
- '-(1 * 4)': const ['1', '4', '1 * 4', '-(1 * 4)'],
- 'true ? 0 : 1': const ['true', '0', '1', 'true ? 0 : 1'],
- '"a" "b"': const ['"a"', '"b"', '"ab"'],
- '"a" "b" "c"': const ['"a"', '"b"', '"c"', '"bc"', r'"a${"bc"}"'],
- r'"a${0}b"': const ['"a"', '0', '"b"', r'"a${0}b"'],
- r'"a${0}b${1}"': const ['"a"', '0', '"b"', '1', '""', r'"a${0}b${1}"'],
- 'true || false': const ['true', 'false', 'true || false'],
- 'true && false': const ['true', 'false', 'true && false'],
- '!true': const ['true', '!true'],
- 'const []': const ['const []'],
- 'const <int>[]': const ['const <int>[]'],
- 'const [0, 1, 2]': const ['0', '1', '2', 'const [0, 1, 2]'],
- 'const <int>[0, 1, 2]': const ['0', '1', '2', 'const <int>[0, 1, 2]'],
- 'const {}': const ['const {}'],
- 'const <String, int>{}': const ['const <String, int>{}'],
- 'const {"a": 0, "b": 1, "c": 2}': const [
- '"a"',
- '0',
- '"b"',
- '1',
- '"c"',
- '2',
- 'const {"a": 0, "b": 1, "c": 2}'
- ],
- 'const <String, int>{"a": 0, "b": 1, "c": 2}': const [
- '"a"',
- '0',
- '"b"',
- '1',
- '"c"',
- '2',
- 'const <String, int>{"a": 0, "b": 1, "c": 2}'
- ],
- };
- return Future.forEach(testedConstants.keys, (String constant) {
- return MockCompiler.create((MockCompiler compiler) {
- CollectingTreeElements elements =
- compiler.resolveStatement("main() => $constant;");
- List<String> expectedConstants = testedConstants[constant];
- DiagnosticCollector collector = compiler.diagnosticCollector;
- Expect.equals(0, collector.warnings.length);
- Expect.equals(0, collector.errors.length);
- List<ConstantExpression> constants = elements.constants;
- String constantsText =
- '[${constants.map((c) => c.toDartText()).join(', ')}]';
- Expect.equals(
- expectedConstants.length,
- constants.length,
- "Expected ${expectedConstants.length} constants for `${constant}` "
- "found $constantsText.");
- for (int index = 0; index < expectedConstants.length; index++) {
- Expect.equals(
- expectedConstants[index],
- constants[index].toDartText(),
- "Expected ${expectedConstants} for `$constant`, "
- "found $constantsText.");
- }
- });
- });
-}
-
-map(ResolverVisitor visitor) {
- CollectingTreeElements elements = visitor.registry.mapping;
- return elements.map;
-}
-
-at(Link link, int index) => (index == 0) ? link.head : at(link.tail, index - 1);
-
-List<String> asSortedStrings(Link link) {
- List<String> result = <String>[];
- for (; !link.isEmpty; link = link.tail) result.add(link.head.toString());
- result.sort((s1, s2) => s1.compareTo(s2));
- return result;
-}
-
-Future compileScript(String source) {
- Uri uri = new Uri(scheme: 'source');
- MockCompiler compiler = mockCompilerFor(source, uri);
- compiler.diagnosticHandler = createHandler(compiler, source);
- return compiler.run(uri).then((_) {
- return compiler;
- });
-}
-
-checkMemberResolved(compiler, className, memberName) {
- ClassElement cls = findElement(compiler, className);
- MemberElement memberElement = cls.lookupLocalMember(memberName);
- Expect.isNotNull(memberElement);
- Expect.isTrue(compiler.resolutionWorldBuilder.isMemberUsed(memberElement));
-}
-
-testToString() {
- final script = r"class C { toString() => 'C'; } main() { '${new C()}'; }";
- asyncTest(() => compileScript(script).then((compiler) {
- checkMemberResolved(compiler, 'C', 'toString');
- }));
-}
-
-operatorName(op, isUnary) {
- return Elements.constructOperatorName(op, isUnary);
-}
-
-testIndexedOperator() {
- final script = r"""
- class C {
- operator[](ix) => ix;
- operator[]=(ix, v) {}
- }
- main() { var c = new C(); c[0]++; }""";
- asyncTest(() => compileScript(script).then((compiler) {
- checkMemberResolved(compiler, 'C', operatorName('[]', false));
- checkMemberResolved(compiler, 'C', operatorName('[]=', false));
- }));
-}
-
-testIncrementsAndDecrements() {
- final script = r"""
- class A { operator+(o)=>null; }
- class B { operator+(o)=>null; }
- class C { operator-(o)=>null; }
- class D { operator-(o)=>null; }
- main() {
- var a = new A();
- a++;
- var b = new B();
- ++b;
- var c = new C();
- c--;
- var d = new D();
- --d;
- }""";
- asyncTest(() => compileScript(script).then((compiler) {
- checkMemberResolved(compiler, 'A', operatorName('+', false));
- checkMemberResolved(compiler, 'B', operatorName('+', false));
- checkMemberResolved(compiler, 'C', operatorName('-', false));
- checkMemberResolved(compiler, 'D', operatorName('-', false));
- }));
-}
-
-testOverrideHashCodeCheck() {
- final script = r"""
- class A {
- operator==(other) => true;
- }
- class B {
- operator==(other) => true;
- get hashCode => 0;
- }
- main() {
- new A() == new B();
- }""";
- asyncTest(() => compileScript(script).then((compiler) {
- DiagnosticCollector collector = compiler.diagnosticCollector;
- Expect.equals(0, collector.warnings.length);
- Expect.equals(0, collector.infos.length);
- Expect.equals(1, collector.hints.length);
- Expect.equals(MessageKind.OVERRIDE_EQUALS_NOT_HASH_CODE,
- collector.hints.first.message.kind);
- Expect.equals(0, collector.errors.length);
- }));
-}
-
-testConstConstructorAndNonFinalFields() {
- void expect(compiler, List errors, List infos) {
- DiagnosticCollector collector = compiler.diagnosticCollector;
- Expect.equals(errors.length, collector.errors.length);
- for (int i = 0; i < errors.length; i++) {
- Expect.equals(errors[i], collector.errors.elementAt(i).message.kind);
- }
- Expect.equals(0, collector.warnings.length);
- Expect.equals(infos.length, collector.infos.length);
- for (int i = 0; i < infos.length; i++) {
- Expect.equals(infos[i], collector.infos.elementAt(i).message.kind);
- }
- }
-
- final script1 = r"""
- class A {
- var a;
- const A(this.a);
- }
- main() {
- new A(0);
- }""";
- asyncTest(() => compileScript(script1).then((compiler) {
- expect(compiler, [MessageKind.CONST_CONSTRUCTOR_WITH_NONFINAL_FIELDS],
- [MessageKind.CONST_CONSTRUCTOR_WITH_NONFINAL_FIELDS_FIELD]);
- }));
-
- final script2 = r"""
- class A {
- var a;
- var b;
- const A(this.a, this.b);
- const A.named(this.a, this.b);
- }
- main() {
- new A(0, 1);
- }""";
- asyncTest(() => compileScript(script2).then((compiler) {
- expect(compiler, [
- MessageKind.CONST_CONSTRUCTOR_WITH_NONFINAL_FIELDS
- ], [
- MessageKind.CONST_CONSTRUCTOR_WITH_NONFINAL_FIELDS_CONSTRUCTOR,
- MessageKind.CONST_CONSTRUCTOR_WITH_NONFINAL_FIELDS_CONSTRUCTOR,
- MessageKind.CONST_CONSTRUCTOR_WITH_NONFINAL_FIELDS_FIELD,
- MessageKind.CONST_CONSTRUCTOR_WITH_NONFINAL_FIELDS_FIELD
- ]);
- }));
-}
-
-testCantAssignMethods() {
- // Can't override local functions
- checkWarningOn('''
- main() {
- mname() { mname = 2; };
- mname();
- }
- ''', [MessageKind.ASSIGNING_METHOD]);
-
- checkWarningOn('''
- main() {
- mname() { };
- mname = 3;
- }
- ''', [MessageKind.ASSIGNING_METHOD]);
-
- // Can't override top-level functions
- checkWarningOn('''
- m() {}
- main() { m = 4; }
- ''', [
- MessageKind.ASSIGNING_METHOD,
- // TODO(johnniwinther): Avoid duplicate warnings.
- MessageKind.NOT_ASSIGNABLE
- ]);
-
- // Can't override instance methods
- checkWarningOn('''
- main() { new B().bar(); }
- class B {
- mname() {}
- bar() {
- mname = () => null;
- }
- }
- ''', [MessageKind.UNDEFINED_SETTER]);
- checkWarningOn('''
- main() { new B().bar(); }
- class B {
- mname() {}
- bar() {
- this.mname = () => null;
- }
- }
- ''', [MessageKind.UNDEFINED_SETTER]);
-
- // Can't override super methods
- checkWarningOn('''
- main() { new B().bar(); }
- class A {
- mname() {}
- }
- class B extends A {
- bar() {
- super.mname = () => 6;
- }
- }
- ''', [
- MessageKind.ASSIGNING_METHOD_IN_SUPER,
- // TODO(johnniwinther): Avoid duplicate warnings.
- MessageKind.UNDEFINED_SETTER
- ]);
-
- // But index operators should be OK
- checkWarningOn('''
- main() { new B().bar(); }
- class B {
- operator[]=(x, y) {}
- bar() {
- this[1] = 3; // This is OK
- }
- }
- ''', []);
- checkWarningOn('''
- main() { new B().bar(); }
- class A {
- operator[]=(x, y) {}
- }
- class B extends A {
- bar() {
- super[1] = 3; // This is OK
- }
- }
- ''', []);
-}
-
-testCantAssignFinalAndConsts() {
- // Can't write final or const locals.
- checkWarningOn('''
- main() {
- final x = 1;
- x = 2;
- }
- ''', [MessageKind.UNDEFINED_STATIC_SETTER_BUT_GETTER]);
- checkWarningOn('''
- main() {
- const x = 1;
- x = 2;
- }
- ''', [MessageKind.UNDEFINED_STATIC_SETTER_BUT_GETTER]);
- checkWarningOn('''
- final x = 1;
- main() { x = 3; }
- ''', [MessageKind.UNDEFINED_STATIC_SETTER_BUT_GETTER]);
-
- checkWarningOn('''
- const x = 1;
- main() { x = 3; }
- ''', [MessageKind.UNDEFINED_STATIC_SETTER_BUT_GETTER]);
-
- // Detect assignments to final fields:
- checkWarningOn('''
- main() => new B().m();
- class B {
- final x = 1;
- m() { x = 2; }
- }
- ''', [MessageKind.UNDEFINED_SETTER]);
-
- // ... even if 'this' is explicit:
- checkWarningOn('''
- main() => new B().m();
- class B {
- final x = 1;
- m() { this.x = 2; }
- }
- ''', [MessageKind.UNDEFINED_SETTER]);
-
- // ... and in super class:
- checkWarningOn('''
- main() => new B().m();
- class A {
- final x = 1;
- }
- class B extends A {
- m() { super.x = 2; }
- }
- ''', [
- MessageKind.ASSIGNING_FINAL_FIELD_IN_SUPER,
- // TODO(johnniwinther): Avoid duplicate warnings.
- MessageKind.UNDEFINED_SETTER
- ]);
-
- // But non-final fields are OK:
- checkWarningOn('''
- main() => new B().m();
- class A {
- int x = 1;
- }
- class B extends A {
- m() { super.x = 2; }
- }
- ''', []);
-
- // Check getter without setter.
- checkWarningOn('''
- main() => new B().m();
- class A {
- get x => 1;
- }
- class B extends A {
- m() { super.x = 2; }
- }
- ''', [
- MessageKind.UNDEFINED_SUPER_SETTER,
- // TODO(johnniwinther): Avoid duplicate warnings.
- MessageKind.UNDEFINED_SETTER
- ]);
-}
-
-/// Helper to test that [script] produces all the given [warnings].
-checkWarningOn(String script, List<MessageKind> warnings) {
- Expect.isTrue(warnings.length >= 0 && warnings.length <= 2);
- asyncTest(() => compileScript(script).then((compiler) {
- DiagnosticCollector collector = compiler.diagnosticCollector;
- Expect.equals(0, collector.errors.length,
- 'Unexpected errors in\n$script\n${collector.errors}');
- Expect.equals(
- warnings.length,
- collector.warnings.length,
- 'Unexpected warnings in\n$script\n'
- 'Expected:$warnings\nFound:${collector.warnings}');
- for (int i = 0; i < warnings.length; i++) {
- Expect.equals(
- warnings[i], collector.warnings.elementAt(i).message.kind);
- }
- }));
-}
-
-testAwaitHint() {
- check(String script, {String className, String functionName}) {
- var prefix = className == null
- ? "Cannot resolve 'await'"
- : "No member named 'await' in class '$className'";
- var where =
- functionName == null ? 'the enclosing function' : "'$functionName'";
- asyncTest(() => compileScript(script).then((compiler) {
- DiagnosticCollector collector = compiler.diagnosticCollector;
- Expect.equals(0, collector.errors.length);
- Expect.equals(1, collector.warnings.length);
- Expect.equals(
- "$prefix.\n"
- "Did you mean to add the 'async' marker to $where?",
- '${collector.warnings.first.message}');
- }));
- }
-
- check('main() { await -3; }', functionName: 'main');
- check('main() { () => await -3; }');
- check('foo() => await -3; main() => foo();', functionName: 'foo');
- check('''
- class A {
- m() => await - 3;
- }
- main() => new A().m();
- ''', className: 'A', functionName: 'm');
- check('''
- class A {
- static m() => await - 3;
- }
- main() => A.m();
- ''', functionName: 'm');
- check('''
- class A {
- m() => () => await - 3;
- }
- main() => new A().m();
- ''', className: 'A');
-}
diff --git a/tests/compiler/dart2js/old_frontend/scanner_offset_length_test.dart b/tests/compiler/dart2js/old_frontend/scanner_offset_length_test.dart
deleted file mode 100644
index fe30615..0000000
--- a/tests/compiler/dart2js/old_frontend/scanner_offset_length_test.dart
+++ /dev/null
@@ -1,50 +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 'package:front_end/src/fasta/scanner.dart';
-
-Token scan(String text) =>
- new StringScanner(text, includeComments: true).tokenize();
-
-check(String text) {
- Token token = scan(text);
- while (token.kind != EOF_TOKEN) {
- Expect.equals(token.lexeme.length, token.charCount);
-
- var start = token.charOffset;
- var end = token.charOffset + token.charCount;
-
- Expect.isTrue(start < text.length,
- 'start=$start < text.length=${text.length}: $text');
-
- Expect.isTrue(
- end <= text.length, 'end=$end <= text.length=${text.length}: $text');
-
- Expect.isTrue(start <= end, 'start=$end <= end=$end: $text');
-
- var substring = text.substring(start, end);
-
- Expect.stringEquals(
- token.lexeme,
- substring,
- 'token.value=${token.lexeme} == '
- 'text.substring(start,end)=${substring}: $text');
-
- print('$text: [$start,$end]:$token');
-
- token = token.next;
- }
-}
-
-main() {
- check('foo'); // identifier
- check('\'\''); // empty string
- check('\'foo\''); // simple string
- check('\'\$foo\''); // interpolation, identifier
- check('\'\${foo}\''); // interpolation, expression
-
- check('//'); // single line comment
- check('/**/'); // multi line comment
-}
diff --git a/tests/compiler/dart2js/old_frontend/scanner_test.dart b/tests/compiler/dart2js/old_frontend/scanner_test.dart
deleted file mode 100644
index 9cd8ba1..0000000
--- a/tests/compiler/dart2js/old_frontend/scanner_test.dart
+++ /dev/null
@@ -1,210 +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 'package:front_end/src/fasta/scanner.dart';
-import 'package:front_end/src/fasta/scanner/characters.dart';
-import 'package:front_end/src/scanner/token.dart' show TokenType;
-import 'dart:typed_data';
-
-Token scan(List<int> bytes) {
- List<int> zeroTerminated = new Uint8List(bytes.length + 1);
- zeroTerminated.setRange(0, bytes.length, bytes);
- zeroTerminated[bytes.length] = 0;
- return new Utf8BytesScanner(zeroTerminated).tokenize();
-}
-
-Token scanUTF8(List<int> bytes) {
- int l = bytes.length;
- List<int> stringLiteral = new Uint8List(l + 3);
- stringLiteral[0] = 0x27; // single quote
- stringLiteral[l + 1] = 0x27; // single quote
- // The bytes given to the scanner must be 0-terminated.
- stringLiteral[l + 2] = $EOF;
- for (int i = 0; i < l; i++) {
- stringLiteral[i + 1] = bytes[i];
- }
- return new Utf8BytesScanner(stringLiteral).tokenize();
-}
-
-bool isRunningOnJavaScript() => identical(1, 1.0);
-
-main() {
- // Google favorite: "Îñţérñåţîöñåļîžåţîờñ".
- Token token = scanUTF8([
- 0xc3,
- 0x8e,
- 0xc3,
- 0xb1,
- 0xc5,
- 0xa3,
- 0xc3,
- 0xa9,
- 0x72,
- 0xc3,
- 0xb1,
- 0xc3,
- 0xa5,
- 0xc5,
- 0xa3,
- 0xc3,
- 0xae,
- 0xc3,
- 0xb6,
- 0xc3,
- 0xb1,
- 0xc3,
- 0xa5,
- 0xc4,
- 0xbc,
- 0xc3,
- 0xae,
- 0xc5,
- 0xbe,
- 0xc3,
- 0xa5,
- 0xc5,
- 0xa3,
- 0xc3,
- 0xae,
- 0xe1,
- 0xbb,
- 0x9d,
- 0xc3,
- 0xb1
- ]);
- Expect.stringEquals("'Îñţérñåţîöñåļîžåţîờñ'", token.lexeme);
-
- // Blueberry porridge in Danish: "blåbærgrød".
- token = scanUTF8([
- 0x62,
- 0x6c,
- 0xc3,
- 0xa5,
- 0x62,
- 0xc3,
- 0xa6,
- 0x72,
- 0x67,
- 0x72,
- 0xc3,
- 0xb8,
- 0x64
- ]);
- Expect.stringEquals("'blåbærgrød'", token.lexeme);
-
- // "சிவா அணாமாைல", that is "Siva Annamalai" in Tamil.
- token = scanUTF8([
- 0xe0,
- 0xae,
- 0x9a,
- 0xe0,
- 0xae,
- 0xbf,
- 0xe0,
- 0xae,
- 0xb5,
- 0xe0,
- 0xae,
- 0xbe,
- 0x20,
- 0xe0,
- 0xae,
- 0x85,
- 0xe0,
- 0xae,
- 0xa3,
- 0xe0,
- 0xae,
- 0xbe,
- 0xe0,
- 0xae,
- 0xae,
- 0xe0,
- 0xae,
- 0xbe,
- 0xe0,
- 0xaf,
- 0x88,
- 0xe0,
- 0xae,
- 0xb2
- ]);
- Expect.stringEquals("'சிவா அணாமாைல'", token.lexeme);
-
- // "िसवा अणामालै", that is "Siva Annamalai" in Devanagari.
- token = scanUTF8([
- 0xe0,
- 0xa4,
- 0xbf,
- 0xe0,
- 0xa4,
- 0xb8,
- 0xe0,
- 0xa4,
- 0xb5,
- 0xe0,
- 0xa4,
- 0xbe,
- 0x20,
- 0xe0,
- 0xa4,
- 0x85,
- 0xe0,
- 0xa4,
- 0xa3,
- 0xe0,
- 0xa4,
- 0xbe,
- 0xe0,
- 0xa4,
- 0xae,
- 0xe0,
- 0xa4,
- 0xbe,
- 0xe0,
- 0xa4,
- 0xb2,
- 0xe0,
- 0xa5,
- 0x88
- ]);
- Expect.stringEquals("'िसवा अणामालै'", token.lexeme);
-
- if (!isRunningOnJavaScript()) {
- // DESERET CAPITAL LETTER BEE, unicode 0x10412(0xD801+0xDC12)
- // UTF-8: F0 90 90 92
- token = scanUTF8([0xf0, 0x90, 0x90, 0x92]);
- Expect.stringEquals("'𐐒'", token.lexeme);
- } else {
- print('Skipping non-BMP character test');
- }
-
- // Regression test for issue 1761.
- // "#!"
- token = scan([0x23, 0x21]);
- Expect.equals(token.type, TokenType.SCRIPT_TAG); // Treated as a comment.
-
- // Regression test for issue 1761.
- // "#! Hello, World!"
- token = scan([
- 0x23,
- 0x21,
- 0x20,
- 0x48,
- 0x65,
- 0x6c,
- 0x6c,
- 0x6f,
- 0x2c,
- 0x20,
- 0x57,
- 0x6f,
- 0x72,
- 0x6c,
- 0x64,
- 0x21
- ]);
- Expect.equals(token.type, TokenType.SCRIPT_TAG); // Treated as a comment.
-}
diff --git a/tests/compiler/dart2js/old_frontend/semantic_visitor_test.dart b/tests/compiler/dart2js/old_frontend/semantic_visitor_test.dart
deleted file mode 100644
index 3ce95aa..0000000
--- a/tests/compiler/dart2js/old_frontend/semantic_visitor_test.dart
+++ /dev/null
@@ -1,732 +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.
-
-library dart2js.semantics_visitor_test;
-
-import 'dart:async';
-import 'dart:mirrors';
-import 'package:async_helper/async_helper.dart';
-import 'package:expect/expect.dart';
-import 'package:compiler/src/commandline_options.dart';
-import 'package:compiler/src/constants/expressions.dart';
-import 'package:compiler/src/diagnostics/spannable.dart';
-import 'package:compiler/src/diagnostics/messages.dart' show MessageKind;
-import 'package:compiler/src/compiler.dart';
-import 'package:compiler/src/elements/elements.dart';
-import 'package:compiler/src/elements/names.dart';
-import 'package:compiler/src/elements/operators.dart';
-import 'package:compiler/src/elements/resolution_types.dart';
-import 'package:compiler/src/resolution/semantic_visitor.dart';
-import 'package:compiler/src/resolution/tree_elements.dart';
-import 'package:compiler/src/tree/tree.dart';
-import 'package:compiler/src/universe/call_structure.dart' show CallStructure;
-import 'package:compiler/src/universe/selector.dart' show Selector;
-import '../memory_compiler.dart';
-
-part 'semantic_visitor_test_send_data.dart';
-part 'semantic_visitor_test_send_visitor.dart';
-part 'semantic_visitor_test_decl_data.dart';
-part 'semantic_visitor_test_decl_visitor.dart';
-
-class Visit {
- final VisitKind method;
- final element;
- final rhs;
- final arguments;
- final receiver;
- final name;
- final expression;
- final left;
- final right;
- final type;
- final operator;
- final index;
- final getter;
- final setter;
- final constant;
- final selector;
- final parameters;
- final body;
- final target;
- final targetType;
- final initializers;
- final error;
-
- const Visit(this.method,
- {this.element,
- this.rhs,
- this.arguments,
- this.receiver,
- this.name,
- this.expression,
- this.left,
- this.right,
- this.type,
- this.operator,
- this.index,
- this.getter,
- this.setter,
- this.constant,
- this.selector,
- this.parameters,
- this.body,
- this.target,
- this.targetType,
- this.initializers,
- this.error});
-
- int get hashCode => toString().hashCode;
-
- bool operator ==(other) => '$this' == '$other';
-
- String toString() {
- StringBuffer sb = new StringBuffer();
- sb.write('method=$method');
- if (element != null) {
- sb.write(',element=$element');
- }
- if (rhs != null) {
- sb.write(',rhs=$rhs');
- }
- if (arguments != null) {
- sb.write(',arguments=$arguments');
- }
- if (receiver != null) {
- sb.write(',receiver=$receiver');
- }
- if (name != null) {
- sb.write(',name=$name');
- }
- if (expression != null) {
- sb.write(',expression=$expression');
- }
- if (left != null) {
- sb.write(',left=$left');
- }
- if (right != null) {
- sb.write(',right=$right');
- }
- if (type != null) {
- sb.write(',type=$type');
- }
- if (operator != null) {
- sb.write(',operator=$operator');
- }
- if (index != null) {
- sb.write(',index=$index');
- }
- if (getter != null) {
- sb.write(',getter=$getter');
- }
- if (setter != null) {
- sb.write(',setter=$setter');
- }
- if (constant != null) {
- sb.write(',constant=$constant');
- }
- if (selector != null) {
- sb.write(',selector=$selector');
- }
- if (parameters != null) {
- sb.write(',parameters=$parameters');
- }
- if (body != null) {
- sb.write(',body=$body');
- }
- if (target != null) {
- sb.write(',target=$target');
- }
- if (targetType != null) {
- sb.write(',targetType=$targetType');
- }
- if (initializers != null) {
- sb.write(',initializers=$initializers');
- }
- if (error != null) {
- sb.write(',error=$error');
- }
- return sb.toString();
- }
-}
-
-class Test {
- final String codeByPrefix;
- final bool isDeferred;
- final String code;
- final /*Visit | List<Visit>*/ expectedVisits;
- final String cls;
- final String method;
-
- const Test(this.code, this.expectedVisits)
- : cls = null,
- method = 'm',
- codeByPrefix = null,
- isDeferred = false;
- const Test.clazz(this.code, this.expectedVisits,
- {this.cls: 'C', this.method: 'm'})
- : codeByPrefix = null,
- isDeferred = false;
- const Test.prefix(this.codeByPrefix, this.code, this.expectedVisits,
- {this.isDeferred: false})
- : cls = null,
- method = 'm';
-
- String toString() {
- StringBuffer sb = new StringBuffer();
- sb.writeln();
- sb.writeln(code);
- if (codeByPrefix != null) {
- sb.writeln('imported by prefix:');
- sb.writeln(codeByPrefix);
- }
- return sb.toString();
- }
-}
-
-const List<VisitKind> UNTESTABLE_KINDS = const <VisitKind>[
- // A final field shadowing a non-final field is currently not supported in
- // resolution.
- VisitKind.VISIT_SUPER_FIELD_FIELD_COMPOUND,
- VisitKind.VISIT_SUPER_FIELD_FIELD_SET_IF_NULL,
- VisitKind.VISIT_SUPER_FIELD_FIELD_PREFIX,
- VisitKind.VISIT_SUPER_FIELD_FIELD_POSTFIX,
- // Combination of method and setter with the same name is currently not
- // supported by the element model.
- VisitKind.VISIT_STATIC_METHOD_SETTER_COMPOUND,
- VisitKind.VISIT_STATIC_METHOD_SETTER_SET_IF_NULL,
- VisitKind.VISIT_STATIC_METHOD_SETTER_PREFIX,
- VisitKind.VISIT_STATIC_METHOD_SETTER_POSTFIX,
- VisitKind.VISIT_TOP_LEVEL_METHOD_SETTER_COMPOUND,
- VisitKind.VISIT_TOP_LEVEL_METHOD_SETTER_SET_IF_NULL,
- VisitKind.VISIT_TOP_LEVEL_METHOD_SETTER_PREFIX,
- VisitKind.VISIT_TOP_LEVEL_METHOD_SETTER_POSTFIX,
- VisitKind.VISIT_SUPER_METHOD_SETTER_COMPOUND,
- VisitKind.VISIT_SUPER_METHOD_SETTER_SET_IF_NULL,
- VisitKind.VISIT_SUPER_METHOD_SETTER_PREFIX,
- VisitKind.VISIT_SUPER_METHOD_SETTER_POSTFIX,
- // The only undefined unary, `+`, is currently handled and skipped in the
- // parser.
- VisitKind.ERROR_UNDEFINED_UNARY_EXPRESSION,
- // Constant expression are currently not computed during resolution.
- VisitKind.VISIT_CONSTANT_GET,
- VisitKind.VISIT_CONSTANT_INVOKE,
-];
-
-main(List<String> arguments) {
- Set<VisitKind> kinds = new Set<VisitKind>.from(VisitKind.values);
- asyncTest(() => Future.forEach([
- () {
- return test(kinds, arguments, SEND_TESTS,
- (elements) => new SemanticSendTestVisitor(elements));
- },
- () {
- return test(kinds, arguments, DECL_TESTS,
- (elements) => new SemanticDeclarationTestVisitor(elements));
- },
- () {
- Set<VisitKind> unvisitedKindSet = kinds.toSet()
- ..removeAll(UNTESTABLE_KINDS);
- List<VisitKind> unvisitedKindList = unvisitedKindSet.toList();
- unvisitedKindList..sort((a, b) => a.index.compareTo(b.index));
-
- Expect.isTrue(unvisitedKindList.isEmpty,
- "Untested visit kinds:\n ${unvisitedKindList.join(',\n ')},\n");
-
- Set<VisitKind> testedUntestableKinds = UNTESTABLE_KINDS.toSet()
- ..removeAll(kinds);
- Expect.isTrue(
- testedUntestableKinds.isEmpty,
- "Tested untestable visit kinds (remove from UNTESTABLE_KINDS):\n "
- "${testedUntestableKinds.join(',\n ')},\n");
- },
- () {
- ClassMirror mirror1 = reflectType(SemanticSendTestVisitor);
- Set<Symbol> symbols1 = mirror1.declarations.keys.toSet();
- ClassMirror mirror2 = reflectType(SemanticSendVisitor);
- Set<Symbol> symbols2 = mirror2.declarations.values
- .where((m) =>
- m is MethodMirror &&
- !m.isConstructor &&
- m.simpleName != #apply)
- .map((m) => m.simpleName)
- .toSet();
- symbols2.removeAll(symbols1);
- Expect.isTrue(symbols2.isEmpty,
- "Untested visit methods:\n ${symbols2.join(',\n ')},\n");
- }
- ], (f) => f()));
-}
-
-Future test(
- Set<VisitKind> unvisitedKinds,
- List<String> arguments,
- Map<String, List<Test>> TESTS,
- SemanticTestVisitor createVisitor(TreeElements elements)) async {
- Map<String, String> sourceFiles = {};
- Map<String, Test> testMap = {};
- StringBuffer mainSource = new StringBuffer();
- int index = 0;
- TESTS.forEach((String group, List<Test> tests) {
- if (arguments.isNotEmpty && !arguments.contains(group)) return;
-
- tests.forEach((Test test) {
- StringBuffer testSource = new StringBuffer();
- if (test.codeByPrefix != null) {
- String prefixFilename = 'pre$index.dart';
- sourceFiles[prefixFilename] = test.codeByPrefix;
- if (test.isDeferred) {
- testSource.writeln("import '$prefixFilename' deferred as p;");
- } else {
- testSource.writeln("import '$prefixFilename' as p;");
- }
- }
-
- String filename = 'lib$index.dart';
- testSource.writeln(test.code);
- sourceFiles[filename] = testSource.toString();
- mainSource.writeln("import '$filename';");
- testMap[filename] = test;
- index++;
- });
- });
- mainSource.writeln("main() {}");
- sourceFiles['main.dart'] = mainSource.toString();
-
- CompilationResult result = await runCompiler(
- memorySourceFiles: sourceFiles,
- options: [Flags.analyzeAll, Flags.analyzeOnly, Flags.useOldFrontend]);
- Compiler compiler = result.compiler;
- testMap.forEach((String filename, Test test) {
- LibraryElement library =
- compiler.libraryLoader.lookupLibrary(Uri.parse('memory:$filename'));
- Element element;
- String cls = test.cls;
- String method = test.method;
- if (cls == null) {
- element = library.find(method);
- } else {
- ClassElement classElement = library.find(cls);
- Expect.isNotNull(
- classElement,
- "Class '$cls' not found in:\n"
- "${library.compilationUnit.script.text}");
- element = classElement.localLookup(method);
- }
- var expectedVisits = test.expectedVisits;
- if (expectedVisits == null) {
- Expect.isTrue(
- element.isMalformed,
- "Element '$method' expected to be have parse errors in:\n"
- "${library.compilationUnit.script.text}");
- return;
- } else if (expectedVisits is! List) {
- expectedVisits = [expectedVisits];
- }
- Expect.isFalse(
- element.isMalformed,
- "Element '$method' is not expected to be have parse errors in:\n"
- "${library.compilationUnit.script.text}");
-
- void testAstElement(AstElement astElement) {
- Expect.isNotNull(
- astElement,
- "Element '$method' not found in:\n"
- "${library.compilationUnit.script.text}");
- ResolvedAst resolvedAst = astElement.resolvedAst;
- SemanticTestVisitor visitor = createVisitor(resolvedAst.elements);
- try {
- compiler.reporter.withCurrentElement(resolvedAst.element, () {
- //print(resolvedAst.node.toDebugString());
- resolvedAst.node.accept(visitor);
- });
- } catch (e, s) {
- Expect.fail("$e:\n$s\nIn test:\n"
- "${library.compilationUnit.script.text}");
- }
- Expect.listEquals(
- expectedVisits,
- visitor.visits,
- "In test:\n"
- "${library.compilationUnit.script.text}\n\n"
- "Expected: $expectedVisits\n"
- "Found: ${visitor.visits}");
- unvisitedKinds.removeAll(visitor.visits.map((visit) => visit.method));
- }
-
- if (element.isAbstractField) {
- AbstractFieldElement abstractFieldElement = element;
- if (abstractFieldElement.getter != null) {
- testAstElement(abstractFieldElement.getter);
- } else if (abstractFieldElement.setter != null) {
- testAstElement(abstractFieldElement.setter);
- }
- } else {
- testAstElement(element);
- }
- });
-}
-
-abstract class SemanticTestVisitor extends TraversalVisitor {
- List<Visit> visits = <Visit>[];
-
- SemanticTestVisitor(TreeElements elements) : super(elements);
-
- apply(Node node, arg) => node.accept(this);
-
- internalError(Spannable spannable, String message) {
- throw new SpannableAssertionFailure(spannable, message);
- }
-}
-
-enum VisitKind {
- VISIT_PARAMETER_GET,
- VISIT_PARAMETER_SET,
- VISIT_PARAMETER_INVOKE,
- VISIT_PARAMETER_COMPOUND,
- VISIT_PARAMETER_SET_IF_NULL,
- VISIT_PARAMETER_PREFIX,
- VISIT_PARAMETER_POSTFIX,
- VISIT_FINAL_PARAMETER_SET,
- VISIT_FINAL_PARAMETER_COMPOUND,
- VISIT_FINAL_PARAMETER_SET_IF_NULL,
- VISIT_FINAL_PARAMETER_PREFIX,
- VISIT_FINAL_PARAMETER_POSTFIX,
- VISIT_LOCAL_VARIABLE_GET,
- VISIT_LOCAL_VARIABLE_SET,
- VISIT_LOCAL_VARIABLE_INVOKE,
- VISIT_LOCAL_VARIABLE_COMPOUND,
- VISIT_LOCAL_VARIABLE_SET_IF_NULL,
- VISIT_LOCAL_VARIABLE_PREFIX,
- VISIT_LOCAL_VARIABLE_POSTFIX,
- VISIT_LOCAL_VARIABLE_DECL,
- VISIT_LOCAL_CONSTANT_DECL,
- VISIT_FINAL_LOCAL_VARIABLE_SET,
- VISIT_FINAL_LOCAL_VARIABLE_COMPOUND,
- VISIT_FINAL_LOCAL_VARIABLE_SET_IF_NULL,
- VISIT_FINAL_LOCAL_VARIABLE_PREFIX,
- VISIT_FINAL_LOCAL_VARIABLE_POSTFIX,
- VISIT_LOCAL_FUNCTION_GET,
- VISIT_LOCAL_FUNCTION_INVOKE,
- VISIT_LOCAL_FUNCTION_INCOMPATIBLE_INVOKE,
- VISIT_LOCAL_FUNCTION_DECL,
- VISIT_CLOSURE_DECL,
- VISIT_LOCAL_FUNCTION_SET,
- VISIT_LOCAL_FUNCTION_COMPOUND,
- VISIT_LOCAL_FUNCTION_SET_IF_NULL,
- VISIT_LOCAL_FUNCTION_PREFIX,
- VISIT_LOCAL_FUNCTION_POSTFIX,
- VISIT_STATIC_FIELD_GET,
- VISIT_STATIC_FIELD_SET,
- VISIT_STATIC_FIELD_INVOKE,
- VISIT_STATIC_FIELD_COMPOUND,
- VISIT_STATIC_FIELD_SET_IF_NULL,
- VISIT_STATIC_FIELD_PREFIX,
- VISIT_STATIC_FIELD_POSTFIX,
- VISIT_STATIC_FIELD_DECL,
- VISIT_STATIC_CONSTANT_DECL,
- VISIT_STATIC_GETTER_GET,
- VISIT_STATIC_GETTER_SET,
- VISIT_STATIC_GETTER_INVOKE,
- VISIT_STATIC_SETTER_GET,
- VISIT_STATIC_SETTER_SET,
- VISIT_STATIC_SETTER_INVOKE,
- VISIT_STATIC_GETTER_SETTER_COMPOUND,
- VISIT_STATIC_GETTER_SETTER_SET_IF_NULL,
- VISIT_STATIC_METHOD_SETTER_COMPOUND,
- VISIT_STATIC_METHOD_SETTER_SET_IF_NULL,
- VISIT_STATIC_GETTER_SETTER_PREFIX,
- VISIT_STATIC_GETTER_SETTER_POSTFIX,
- VISIT_STATIC_GETTER_DECL,
- VISIT_STATIC_SETTER_DECL,
- VISIT_FINAL_STATIC_FIELD_SET,
- VISIT_STATIC_FINAL_FIELD_COMPOUND,
- VISIT_STATIC_FINAL_FIELD_SET_IF_NULL,
- VISIT_STATIC_FINAL_FIELD_POSTFIX,
- VISIT_STATIC_FINAL_FIELD_PREFIX,
- VISIT_STATIC_FUNCTION_GET,
- VISIT_STATIC_FUNCTION_SET,
- VISIT_STATIC_FUNCTION_INVOKE,
- VISIT_STATIC_FUNCTION_INCOMPATIBLE_INVOKE,
- VISIT_STATIC_FUNCTION_DECL,
- VISIT_STATIC_METHOD_SETTER_PREFIX,
- VISIT_STATIC_METHOD_SETTER_POSTFIX,
- VISIT_UNRESOLVED_STATIC_GETTER_COMPOUND,
- VISIT_UNRESOLVED_STATIC_GETTER_SET_IF_NULL,
- VISIT_UNRESOLVED_STATIC_SETTER_COMPOUND,
- VISIT_UNRESOLVED_STATIC_SETTER_SET_IF_NULL,
- VISIT_STATIC_METHOD_COMPOUND,
- VISIT_STATIC_METHOD_SET_IF_NULL,
- VISIT_UNRESOLVED_STATIC_GETTER_PREFIX,
- VISIT_UNRESOLVED_STATIC_SETTER_PREFIX,
- VISIT_STATIC_METHOD_PREFIX,
- VISIT_UNRESOLVED_STATIC_GETTER_POSTFIX,
- VISIT_UNRESOLVED_STATIC_SETTER_POSTFIX,
- VISIT_STATIC_METHOD_POSTFIX,
- VISIT_TOP_LEVEL_FIELD_GET,
- VISIT_TOP_LEVEL_FIELD_SET,
- VISIT_TOP_LEVEL_FIELD_INVOKE,
- VISIT_FINAL_TOP_LEVEL_FIELD_SET,
- VISIT_TOP_LEVEL_FIELD_COMPOUND,
- VISIT_TOP_LEVEL_FIELD_SET_IF_NULL,
- VISIT_TOP_LEVEL_FIELD_PREFIX,
- VISIT_TOP_LEVEL_FIELD_POSTFIX,
- VISIT_TOP_LEVEL_FIELD_DECL,
- VISIT_TOP_LEVEL_CONSTANT_DECL,
- VISIT_TOP_LEVEL_FINAL_FIELD_COMPOUND,
- VISIT_TOP_LEVEL_FINAL_FIELD_SET_IF_NULL,
- VISIT_TOP_LEVEL_FINAL_FIELD_POSTFIX,
- VISIT_TOP_LEVEL_FINAL_FIELD_PREFIX,
- VISIT_TOP_LEVEL_GETTER_GET,
- VISIT_TOP_LEVEL_GETTER_SET,
- VISIT_TOP_LEVEL_GETTER_INVOKE,
- VISIT_TOP_LEVEL_SETTER_GET,
- VISIT_TOP_LEVEL_SETTER_SET,
- VISIT_TOP_LEVEL_SETTER_INVOKE,
- VISIT_TOP_LEVEL_GETTER_SETTER_COMPOUND,
- VISIT_TOP_LEVEL_GETTER_SETTER_SET_IF_NULL,
- VISIT_TOP_LEVEL_GETTER_SETTER_PREFIX,
- VISIT_TOP_LEVEL_GETTER_SETTER_POSTFIX,
- VISIT_TOP_LEVEL_GETTER_DECL,
- VISIT_TOP_LEVEL_SETTER_DECL,
- VISIT_TOP_LEVEL_FUNCTION_GET,
- VISIT_TOP_LEVEL_FUNCTION_SET,
- VISIT_TOP_LEVEL_FUNCTION_INVOKE,
- VISIT_TOP_LEVEL_FUNCTION_INCOMPATIBLE_INVOKE,
- VISIT_TOP_LEVEL_FUNCTION_DECL,
- VISIT_TOP_LEVEL_METHOD_SETTER_COMPOUND,
- VISIT_TOP_LEVEL_METHOD_SETTER_SET_IF_NULL,
- VISIT_TOP_LEVEL_METHOD_SETTER_PREFIX,
- VISIT_TOP_LEVEL_METHOD_SETTER_POSTFIX,
- VISIT_UNRESOLVED_TOP_LEVEL_GETTER_COMPOUND,
- VISIT_UNRESOLVED_TOP_LEVEL_GETTER_SET_IF_NULL,
- VISIT_UNRESOLVED_TOP_LEVEL_SETTER_COMPOUND,
- VISIT_UNRESOLVED_TOP_LEVEL_SETTER_SET_IF_NULL,
- VISIT_TOP_LEVEL_METHOD_COMPOUND,
- VISIT_TOP_LEVEL_METHOD_SET_IF_NULL,
- VISIT_UNRESOLVED_TOP_LEVEL_GETTER_PREFIX,
- VISIT_UNRESOLVED_TOP_LEVEL_SETTER_PREFIX,
- VISIT_TOP_LEVEL_METHOD_PREFIX,
- VISIT_UNRESOLVED_TOP_LEVEL_GETTER_POSTFIX,
- VISIT_UNRESOLVED_TOP_LEVEL_SETTER_POSTFIX,
- VISIT_TOP_LEVEL_METHOD_POSTFIX,
- VISIT_DYNAMIC_PROPERTY_GET,
- VISIT_DYNAMIC_PROPERTY_SET,
- VISIT_DYNAMIC_PROPERTY_INVOKE,
- VISIT_DYNAMIC_PROPERTY_COMPOUND,
- VISIT_DYNAMIC_PROPERTY_SET_IF_NULL,
- VISIT_DYNAMIC_PROPERTY_PREFIX,
- VISIT_DYNAMIC_PROPERTY_POSTFIX,
- VISIT_THIS_GET,
- VISIT_THIS_INVOKE,
- VISIT_THIS_PROPERTY_GET,
- VISIT_THIS_PROPERTY_SET,
- VISIT_THIS_PROPERTY_INVOKE,
- VISIT_THIS_PROPERTY_COMPOUND,
- VISIT_THIS_PROPERTY_SET_IF_NULL,
- VISIT_THIS_PROPERTY_PREFIX,
- VISIT_THIS_PROPERTY_POSTFIX,
- VISIT_SUPER_FIELD_GET,
- VISIT_SUPER_FIELD_SET,
- VISIT_FINAL_SUPER_FIELD_SET,
- VISIT_SUPER_FIELD_INVOKE,
- VISIT_SUPER_FIELD_COMPOUND,
- VISIT_SUPER_FIELD_SET_IF_NULL,
- VISIT_SUPER_FIELD_PREFIX,
- VISIT_SUPER_FIELD_POSTFIX,
- VISIT_SUPER_FINAL_FIELD_COMPOUND,
- VISIT_SUPER_FINAL_FIELD_SET_IF_NULL,
- VISIT_SUPER_FINAL_FIELD_PREFIX,
- VISIT_SUPER_FINAL_FIELD_POSTFIX,
- VISIT_SUPER_FIELD_FIELD_COMPOUND,
- VISIT_SUPER_FIELD_FIELD_SET_IF_NULL,
- VISIT_SUPER_FIELD_FIELD_PREFIX,
- VISIT_SUPER_FIELD_FIELD_POSTFIX,
- VISIT_SUPER_GETTER_GET,
- VISIT_SUPER_GETTER_SET,
- VISIT_SUPER_GETTER_INVOKE,
- VISIT_SUPER_SETTER_GET,
- VISIT_SUPER_SETTER_SET,
- VISIT_SUPER_SETTER_INVOKE,
- VISIT_SUPER_GETTER_SETTER_COMPOUND,
- VISIT_SUPER_GETTER_SETTER_SET_IF_NULL,
- VISIT_SUPER_GETTER_FIELD_COMPOUND,
- VISIT_SUPER_GETTER_FIELD_SET_IF_NULL,
- VISIT_SUPER_FIELD_SETTER_COMPOUND,
- VISIT_SUPER_FIELD_SETTER_SET_IF_NULL,
- VISIT_SUPER_GETTER_SETTER_PREFIX,
- VISIT_SUPER_GETTER_FIELD_PREFIX,
- VISIT_SUPER_FIELD_SETTER_PREFIX,
- VISIT_SUPER_GETTER_SETTER_POSTFIX,
- VISIT_SUPER_GETTER_FIELD_POSTFIX,
- VISIT_SUPER_FIELD_SETTER_POSTFIX,
- VISIT_SUPER_METHOD_GET,
- VISIT_SUPER_METHOD_SET,
- VISIT_SUPER_METHOD_INVOKE,
- VISIT_SUPER_METHOD_INCOMPATIBLE_INVOKE,
- VISIT_SUPER_METHOD_SETTER_COMPOUND,
- VISIT_SUPER_METHOD_SETTER_SET_IF_NULL,
- VISIT_SUPER_METHOD_SETTER_PREFIX,
- VISIT_SUPER_METHOD_SETTER_POSTFIX,
- VISIT_SUPER_METHOD_COMPOUND,
- VISIT_SUPER_METHOD_SET_IF_NULL,
- VISIT_SUPER_METHOD_PREFIX,
- VISIT_SUPER_METHOD_POSTFIX,
- VISIT_UNRESOLVED_GET,
- VISIT_UNRESOLVED_SET,
- VISIT_UNRESOLVED_INVOKE,
- VISIT_UNRESOLVED_SUPER_GET,
- VISIT_UNRESOLVED_SUPER_INVOKE,
- VISIT_UNRESOLVED_SUPER_SET,
- VISIT_BINARY,
- VISIT_INDEX,
- VISIT_EQUALS,
- VISIT_NOT_EQUALS,
- VISIT_INDEX_PREFIX,
- VISIT_INDEX_POSTFIX,
- VISIT_SUPER_BINARY,
- VISIT_UNRESOLVED_SUPER_BINARY,
- VISIT_SUPER_INDEX,
- VISIT_UNRESOLVED_SUPER_INDEX,
- VISIT_SUPER_EQUALS,
- VISIT_SUPER_NOT_EQUALS,
- VISIT_SUPER_INDEX_PREFIX,
- VISIT_UNRESOLVED_SUPER_GETTER_COMPOUND,
- VISIT_UNRESOLVED_SUPER_GETTER_SET_IF_NULL,
- VISIT_UNRESOLVED_SUPER_SETTER_COMPOUND,
- VISIT_UNRESOLVED_SUPER_SETTER_SET_IF_NULL,
- VISIT_UNRESOLVED_SUPER_GETTER_PREFIX,
- VISIT_UNRESOLVED_SUPER_SETTER_PREFIX,
- VISIT_UNRESOLVED_SUPER_INDEX_PREFIX,
- VISIT_UNRESOLVED_SUPER_GETTER_INDEX_PREFIX,
- VISIT_UNRESOLVED_SUPER_SETTER_INDEX_PREFIX,
- VISIT_SUPER_INDEX_POSTFIX,
- VISIT_UNRESOLVED_SUPER_GETTER_POSTFIX,
- VISIT_UNRESOLVED_SUPER_SETTER_POSTFIX,
- VISIT_UNRESOLVED_SUPER_INDEX_POSTFIX,
- VISIT_UNRESOLVED_SUPER_GETTER_INDEX_POSTFIX,
- VISIT_UNRESOLVED_SUPER_SETTER_INDEX_POSTFIX,
- VISIT_UNRESOLVED_SUPER_COMPOUND,
- VISIT_UNRESOLVED_SUPER_SET_IF_NULL,
- VISIT_UNRESOLVED_SUPER_PREFIX,
- VISIT_UNRESOLVED_SUPER_POSTFIX,
- VISIT_UNARY,
- VISIT_SUPER_UNARY,
- VISIT_UNRESOLVED_SUPER_UNARY,
- VISIT_NOT,
- VISIT_EXPRESSION_INVOKE,
- VISIT_CLASS_TYPE_LITERAL_GET,
- VISIT_CLASS_TYPE_LITERAL_SET,
- VISIT_CLASS_TYPE_LITERAL_INVOKE,
- VISIT_CLASS_TYPE_LITERAL_COMPOUND,
- VISIT_CLASS_TYPE_LITERAL_SET_IF_NULL,
- VISIT_CLASS_TYPE_LITERAL_PREFIX,
- VISIT_CLASS_TYPE_LITERAL_POSTFIX,
- VISIT_TYPEDEF_TYPE_LITERAL_GET,
- VISIT_TYPEDEF_TYPE_LITERAL_SET,
- VISIT_TYPEDEF_TYPE_LITERAL_INVOKE,
- VISIT_TYPEDEF_TYPE_LITERAL_COMPOUND,
- VISIT_TYPEDEF_TYPE_LITERAL_SET_IF_NULL,
- VISIT_TYPEDEF_TYPE_LITERAL_PREFIX,
- VISIT_TYPEDEF_TYPE_LITERAL_POSTFIX,
- VISIT_TYPE_VARIABLE_TYPE_LITERAL_GET,
- VISIT_TYPE_VARIABLE_TYPE_LITERAL_SET,
- VISIT_TYPE_VARIABLE_TYPE_LITERAL_INVOKE,
- VISIT_TYPE_VARIABLE_TYPE_LITERAL_COMPOUND,
- VISIT_TYPE_VARIABLE_TYPE_LITERAL_SET_IF_NULL,
- VISIT_TYPE_VARIABLE_TYPE_LITERAL_PREFIX,
- VISIT_TYPE_VARIABLE_TYPE_LITERAL_POSTFIX,
- VISIT_DYNAMIC_TYPE_LITERAL_GET,
- VISIT_DYNAMIC_TYPE_LITERAL_SET,
- VISIT_DYNAMIC_TYPE_LITERAL_INVOKE,
- VISIT_DYNAMIC_TYPE_LITERAL_COMPOUND,
- VISIT_DYNAMIC_TYPE_LITERAL_SET_IF_NULL,
- VISIT_DYNAMIC_TYPE_LITERAL_PREFIX,
- VISIT_DYNAMIC_TYPE_LITERAL_POSTFIX,
- VISIT_INDEX_SET,
- VISIT_COMPOUND_INDEX_SET,
- VISIT_SUPER_INDEX_SET,
- VISIT_UNRESOLVED_SUPER_INDEX_SET,
- VISIT_SUPER_COMPOUND_INDEX_SET,
- VISIT_UNRESOLVED_SUPER_COMPOUND_INDEX_SET,
- VISIT_UNRESOLVED_SUPER_GETTER_COMPOUND_INDEX_SET,
- VISIT_UNRESOLVED_SUPER_SETTER_COMPOUND_INDEX_SET,
- VISIT_INDEX_SET_IF_NULL,
- VISIT_SUPER_INDEX_SET_IF_NULL,
- VISIT_UNRESOLVED_SUPER_INDEX_SET_IF_NULL,
- VISIT_UNRESOLVED_SUPER_GETTER_INDEX_SET_IF_NULL,
- VISIT_UNRESOLVED_SUPER_SETTER_INDEX_SET_IF_NULL,
- VISIT_LOGICAL_AND,
- VISIT_LOGICAL_OR,
- VISIT_IS,
- VISIT_IS_NOT,
- VISIT_AS,
- VISIT_CONST_CONSTRUCTOR_INVOKE,
- VISIT_BOOL_FROM_ENVIRONMENT_CONSTRUCTOR_INVOKE,
- VISIT_INT_FROM_ENVIRONMENT_CONSTRUCTOR_INVOKE,
- VISIT_STRING_FROM_ENVIRONMENT_CONSTRUCTOR_INVOKE,
- VISIT_GENERATIVE_CONSTRUCTOR_INVOKE,
- VISIT_REDIRECTING_GENERATIVE_CONSTRUCTOR_INVOKE,
- VISIT_FACTORY_CONSTRUCTOR_INVOKE,
- VISIT_REDIRECTING_FACTORY_CONSTRUCTOR_INVOKE,
- VISIT_CONSTRUCTOR_INCOMPATIBLE_INVOKE,
- ERROR_NON_CONSTANT_CONSTRUCTOR_INVOKE,
- VISIT_SUPER_CONSTRUCTOR_INVOKE,
- VISIT_IMPLICIT_SUPER_CONSTRUCTOR_INVOKE,
- VISIT_THIS_CONSTRUCTOR_INVOKE,
- VISIT_FIELD_INITIALIZER,
- VISIT_UNRESOLVED_CLASS_CONSTRUCTOR_INVOKE,
- VISIT_UNRESOLVED_CONSTRUCTOR_INVOKE,
- VISIT_ABSTRACT_CLASS_CONSTRUCTOR_INVOKE,
- VISIT_UNRESOLVED_REDIRECTING_FACTORY_CONSTRUCTOR_INVOKE,
- VISIT_INSTANCE_GETTER_DECL,
- VISIT_INSTANCE_SETTER_DECL,
- VISIT_INSTANCE_METHOD_DECL,
- VISIT_ABSTRACT_GETTER_DECL,
- VISIT_ABSTRACT_SETTER_DECL,
- VISIT_ABSTRACT_METHOD_DECL,
- VISIT_INSTANCE_FIELD_DECL,
- VISIT_GENERATIVE_CONSTRUCTOR_DECL,
- VISIT_REDIRECTING_GENERATIVE_CONSTRUCTOR_DECL,
- VISIT_FACTORY_CONSTRUCTOR_DECL,
- VISIT_REDIRECTING_FACTORY_CONSTRUCTOR_DECL,
- VISIT_REQUIRED_PARAMETER_DECL,
- VISIT_OPTIONAL_PARAMETER_DECL,
- VISIT_NAMED_PARAMETER_DECL,
- VISIT_REQUIRED_INITIALIZING_FORMAL_DECL,
- VISIT_OPTIONAL_INITIALIZING_FORMAL_DECL,
- VISIT_NAMED_INITIALIZING_FORMAL_DECL,
- VISIT_UNRESOLVED_COMPOUND,
- VISIT_UNRESOLVED_SET_IF_NULL,
- VISIT_UNRESOLVED_PREFIX,
- VISIT_UNRESOLVED_POSTFIX,
- VISIT_IF_NULL,
- VISIT_IF_NOT_NULL_DYNAMIC_PROPERTY_GET,
- VISIT_IF_NOT_NULL_DYNAMIC_PROPERTY_SET,
- VISIT_IF_NOT_NULL_DYNAMIC_PROPERTY_INVOKE,
- VISIT_IF_NOT_NULL_DYNAMIC_PROPERTY_COMPOUND,
- VISIT_IF_NOT_NULL_DYNAMIC_PROPERTY_SET_IF_NULL,
- VISIT_IF_NOT_NULL_DYNAMIC_PROPERTY_PREFIX,
- VISIT_IF_NOT_NULL_DYNAMIC_PROPERTY_POSTFIX,
- ERROR_UNDEFINED_UNARY_EXPRESSION,
- ERROR_UNDEFINED_BINARY_EXPRESSION,
- ERROR_INVALID_GET,
- ERROR_INVALID_INVOKE,
- ERROR_INVALID_SET,
- ERROR_INVALID_PREFIX,
- ERROR_INVALID_POSTFIX,
- ERROR_INVALID_COMPOUND,
- ERROR_INVALID_SET_IF_NULL,
- ERROR_INVALID_UNARY,
- ERROR_INVALID_EQUALS,
- ERROR_INVALID_NOT_EQUALS,
- ERROR_INVALID_BINARY,
- ERROR_INVALID_INDEX,
- ERROR_INVALID_INDEX_SET,
- ERROR_INVALID_COMPOUND_INDEX_SET,
- ERROR_INVALID_INDEX_PREFIX,
- ERROR_INVALID_INDEX_POSTFIX,
- VISIT_CONSTANT_GET,
- VISIT_CONSTANT_INVOKE,
- PREVISIT_DEFERRED_ACCESS,
-}
diff --git a/tests/compiler/dart2js/old_frontend/semantic_visitor_test_decl_data.dart b/tests/compiler/dart2js/old_frontend/semantic_visitor_test_decl_data.dart
deleted file mode 100644
index 6a51b43..0000000
--- a/tests/compiler/dart2js/old_frontend/semantic_visitor_test_decl_data.dart
+++ /dev/null
@@ -1,625 +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.
-
-part of dart2js.semantics_visitor_test;
-
-const Map<String, List<Test>> DECL_TESTS = const {
- 'Function declarations': const [
- const Test('''
- m(a, b) {}
- ''', const [
- const Visit(VisitKind.VISIT_TOP_LEVEL_FUNCTION_DECL,
- element: 'function(m)', parameters: '(a,b)', body: '{}'),
- const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
- element: 'parameter(m#a)', index: 0),
- const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
- element: 'parameter(m#b)', index: 1),
- ]),
- const Test('''
- m(a, [b]) {}
- ''', const [
- const Visit(VisitKind.VISIT_TOP_LEVEL_FUNCTION_DECL,
- element: 'function(m)', parameters: '(a,[b])', body: '{}'),
- const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
- element: 'parameter(m#a)', index: 0),
- const Visit(VisitKind.VISIT_OPTIONAL_PARAMETER_DECL,
- element: 'parameter(m#b)', index: 1, constant: 'null'),
- ]),
- const Test('''
- m(a, [b = null]) {}
- ''', const [
- const Visit(VisitKind.VISIT_TOP_LEVEL_FUNCTION_DECL,
- element: 'function(m)', parameters: '(a,[b=null])', body: '{}'),
- const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
- element: 'parameter(m#a)', index: 0),
- const Visit(VisitKind.VISIT_OPTIONAL_PARAMETER_DECL,
- element: 'parameter(m#b)', constant: 'null', index: 1),
- ]),
- const Test('''
- m(a, [b = 42]) {}
- ''', const [
- const Visit(VisitKind.VISIT_TOP_LEVEL_FUNCTION_DECL,
- element: 'function(m)', parameters: '(a,[b=42])', body: '{}'),
- const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
- element: 'parameter(m#a)', index: 0),
- const Visit(VisitKind.VISIT_OPTIONAL_PARAMETER_DECL,
- element: 'parameter(m#b)', constant: 42, index: 1),
- ]),
- const Test('''
- m(a, {b}) {}
- ''', const [
- const Visit(VisitKind.VISIT_TOP_LEVEL_FUNCTION_DECL,
- element: 'function(m)', parameters: '(a,{b})', body: '{}'),
- const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
- element: 'parameter(m#a)', index: 0),
- const Visit(VisitKind.VISIT_NAMED_PARAMETER_DECL,
- element: 'parameter(m#b)', constant: 'null'),
- ]),
- const Test('''
- m(a, {b: null}) {}
- ''', const [
- const Visit(VisitKind.VISIT_TOP_LEVEL_FUNCTION_DECL,
- element: 'function(m)', parameters: '(a,{b: null})', body: '{}'),
- const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
- element: 'parameter(m#a)', index: 0),
- const Visit(VisitKind.VISIT_NAMED_PARAMETER_DECL,
- element: 'parameter(m#b)', constant: 'null'),
- ]),
- const Test('''
- m(a, {b:42}) {}
- ''', const [
- const Visit(VisitKind.VISIT_TOP_LEVEL_FUNCTION_DECL,
- element: 'function(m)', parameters: '(a,{b: 42})', body: '{}'),
- const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
- element: 'parameter(m#a)', index: 0),
- const Visit(VisitKind.VISIT_NAMED_PARAMETER_DECL,
- element: 'parameter(m#b)', constant: 42),
- ]),
- const Test('''
- get m => null;
- ''', const [
- const Visit(VisitKind.VISIT_TOP_LEVEL_GETTER_DECL,
- element: 'getter(m)', body: '=>null;'),
- ]),
- const Test('''
- set m(a) {}
- ''', const [
- const Visit(VisitKind.VISIT_TOP_LEVEL_SETTER_DECL,
- element: 'setter(m)', parameters: '(a)', body: '{}'),
- const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
- element: 'parameter(m#a)', index: 0),
- ]),
- const Test.clazz('''
- class C {
- static m(a, b) {}
- }
- ''', const [
- const Visit(VisitKind.VISIT_STATIC_FUNCTION_DECL,
- element: 'function(C#m)', parameters: '(a,b)', body: '{}'),
- const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
- element: 'parameter(m#a)', index: 0),
- const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
- element: 'parameter(m#b)', index: 1),
- ]),
- const Test.clazz('''
- class C {
- static get m => null;
- }
- ''', const [
- const Visit(VisitKind.VISIT_STATIC_GETTER_DECL,
- element: 'getter(C#m)', body: '=>null;'),
- ]),
- const Test.clazz('''
- class C {
- static set m(a) {}
- }
- ''', const [
- const Visit(VisitKind.VISIT_STATIC_SETTER_DECL,
- element: 'setter(C#m)', parameters: '(a)', body: '{}'),
- const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
- element: 'parameter(m#a)', index: 0),
- ]),
- const Test.clazz('''
- class C {
- m(a, b) {}
- }
- ''', const [
- const Visit(VisitKind.VISIT_INSTANCE_METHOD_DECL,
- element: 'function(C#m)', parameters: '(a,b)', body: '{}'),
- const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
- element: 'parameter(m#a)', index: 0),
- const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
- element: 'parameter(m#b)', index: 1),
- ]),
- const Test.clazz('''
- class C {
- get m => null;
- }
- ''', const [
- const Visit(VisitKind.VISIT_INSTANCE_GETTER_DECL,
- element: 'getter(C#m)', body: '=>null;'),
- ]),
- const Test.clazz('''
- class C {
- set m(a) {}
- }
- ''', const [
- const Visit(VisitKind.VISIT_INSTANCE_SETTER_DECL,
- element: 'setter(C#m)', parameters: '(a)', body: '{}'),
- const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
- element: 'parameter(m#a)', index: 0),
- ]),
- const Test.clazz('''
- abstract class C {
- m(a, b);
- }
- ''', const [
- const Visit(VisitKind.VISIT_ABSTRACT_METHOD_DECL,
- element: 'function(C#m)', parameters: '(a,b)'),
- const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
- element: 'parameter(m#a)', index: 0),
- const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
- element: 'parameter(m#b)', index: 1),
- ]),
- const Test.clazz('''
- abstract class C {
- get m;
- }
- ''', const [
- const Visit(VisitKind.VISIT_ABSTRACT_GETTER_DECL, element: 'getter(C#m)'),
- ]),
- const Test.clazz('''
- abstract class C {
- set m(a);
- }
- ''', const [
- const Visit(VisitKind.VISIT_ABSTRACT_SETTER_DECL,
- element: 'setter(C#m)', parameters: '(a)'),
- const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
- element: 'parameter(m#a)', index: 0),
- ]),
- const Test('''
- m(a, b) {}
- ''', const [
- const Visit(VisitKind.VISIT_TOP_LEVEL_FUNCTION_DECL,
- element: 'function(m)', parameters: '(a,b)', body: '{}'),
- const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
- element: 'parameter(m#a)', index: 0),
- const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
- element: 'parameter(m#b)', index: 1),
- ]),
- const Test('''
- m() {
- local(a, b) {}
- }
- ''', const [
- const Visit(VisitKind.VISIT_TOP_LEVEL_FUNCTION_DECL,
- element: 'function(m)', parameters: '()', body: '{local(a,b){}}'),
- const Visit(VisitKind.VISIT_LOCAL_FUNCTION_DECL,
- element: 'function(m#local)', parameters: '(a,b)', body: '{}'),
- const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
- element: 'parameter(local#a)', index: 0),
- const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
- element: 'parameter(local#b)', index: 1),
- ]),
- const Test('''
- m() => (a, b) {};
- ''', const [
- const Visit(VisitKind.VISIT_TOP_LEVEL_FUNCTION_DECL,
- element: 'function(m)', parameters: '()', body: '=>(a,b){};'),
- const Visit(VisitKind.VISIT_CLOSURE_DECL,
- element: 'function(m#)', parameters: '(a,b)', body: '{}'),
- const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
- element: 'parameter(#a)', index: 0),
- const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
- element: 'parameter(#b)', index: 1),
- ]),
- ],
- 'Constructor declarations': const [
- const Test.clazz('''
- class C {
- C(a, b);
- }
- ''', const [
- const Visit(VisitKind.VISIT_GENERATIVE_CONSTRUCTOR_DECL,
- element: 'generative_constructor(C#)',
- parameters: '(a,b)',
- body: ';'),
- const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
- element: 'parameter(#a)', index: 0),
- const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
- element: 'parameter(#b)', index: 1),
- const Visit(VisitKind.VISIT_IMPLICIT_SUPER_CONSTRUCTOR_INVOKE,
- element: 'generative_constructor(Object#)', type: 'Object'),
- ], method: ''),
- const Test.clazz('''
- class C {
- var b;
- C(a, this.b);
- }
- ''', const [
- const Visit(VisitKind.VISIT_GENERATIVE_CONSTRUCTOR_DECL,
- element: 'generative_constructor(C#)',
- parameters: '(a,this.b)',
- body: ';'),
- const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
- element: 'parameter(#a)', index: 0),
- const Visit(VisitKind.VISIT_REQUIRED_INITIALIZING_FORMAL_DECL,
- element: 'initializing_formal(#b)', index: 1),
- const Visit(VisitKind.VISIT_IMPLICIT_SUPER_CONSTRUCTOR_INVOKE,
- element: 'generative_constructor(Object#)', type: 'Object'),
- ], method: ''),
- const Test.clazz('''
- class C {
- var b;
- C(a, [this.b = 42]);
- }
- ''', const [
- const Visit(VisitKind.VISIT_GENERATIVE_CONSTRUCTOR_DECL,
- element: 'generative_constructor(C#)',
- parameters: '(a,[this.b=42])',
- body: ';'),
- const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
- element: 'parameter(#a)', index: 0),
- const Visit(VisitKind.VISIT_OPTIONAL_INITIALIZING_FORMAL_DECL,
- element: 'initializing_formal(#b)', constant: 42, index: 1),
- const Visit(VisitKind.VISIT_IMPLICIT_SUPER_CONSTRUCTOR_INVOKE,
- element: 'generative_constructor(Object#)', type: 'Object'),
- ], method: ''),
- const Test.clazz('''
- class C {
- var b;
- C(a, {this.b: 42});
- }
- ''', const [
- const Visit(VisitKind.VISIT_GENERATIVE_CONSTRUCTOR_DECL,
- element: 'generative_constructor(C#)',
- parameters: '(a,{this.b: 42})',
- body: ';'),
- const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
- element: 'parameter(#a)', index: 0),
- const Visit(VisitKind.VISIT_NAMED_INITIALIZING_FORMAL_DECL,
- element: 'initializing_formal(#b)', constant: 42),
- const Visit(VisitKind.VISIT_IMPLICIT_SUPER_CONSTRUCTOR_INVOKE,
- element: 'generative_constructor(Object#)', type: 'Object'),
- ], method: ''),
- const Test.clazz('''
- class C {
- C(a, b) : super();
- }
- ''', const [
- const Visit(VisitKind.VISIT_GENERATIVE_CONSTRUCTOR_DECL,
- element: 'generative_constructor(C#)',
- parameters: '(a,b)',
- body: ';'),
- const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
- element: 'parameter(#a)', index: 0),
- const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
- element: 'parameter(#b)', index: 1),
- const Visit(VisitKind.VISIT_SUPER_CONSTRUCTOR_INVOKE,
- element: 'generative_constructor(Object#)',
- type: 'Object',
- arguments: '()',
- selector: 'CallStructure(arity=0)'),
- ], method: ''),
- const Test.clazz('''
- class C {
- var field;
- C(a, b) : this.field = a;
- }
- ''', const [
- const Visit(VisitKind.VISIT_GENERATIVE_CONSTRUCTOR_DECL,
- element: 'generative_constructor(C#)',
- parameters: '(a,b)',
- body: ';'),
- const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
- element: 'parameter(#a)', index: 0),
- const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
- element: 'parameter(#b)', index: 1),
- const Visit(VisitKind.VISIT_FIELD_INITIALIZER,
- element: 'field(C#field)', rhs: 'a'),
- const Visit(VisitKind.VISIT_IMPLICIT_SUPER_CONSTRUCTOR_INVOKE,
- element: 'generative_constructor(Object#)', type: 'Object'),
- ], method: ''),
- const Test.clazz('''
- class C {
- var field1;
- var field2;
- C(a, b) : this.field1 = a, this.field2 = b;
- }
- ''', const [
- const Visit(VisitKind.VISIT_GENERATIVE_CONSTRUCTOR_DECL,
- element: 'generative_constructor(C#)',
- parameters: '(a,b)',
- body: ';'),
- const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
- element: 'parameter(#a)', index: 0),
- const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
- element: 'parameter(#b)', index: 1),
- const Visit(VisitKind.VISIT_FIELD_INITIALIZER,
- element: 'field(C#field1)', rhs: 'a'),
- const Visit(VisitKind.VISIT_FIELD_INITIALIZER,
- element: 'field(C#field2)', rhs: 'b'),
- const Visit(VisitKind.VISIT_IMPLICIT_SUPER_CONSTRUCTOR_INVOKE,
- element: 'generative_constructor(Object#)', type: 'Object'),
- ], method: ''),
- const Test.clazz('''
- class C {
- C(a, b) : this._(a, b);
- C._(a, b);
- }
- ''', const [
- const Visit(VisitKind.VISIT_REDIRECTING_GENERATIVE_CONSTRUCTOR_DECL,
- element: 'generative_constructor(C#)',
- parameters: '(a,b)',
- initializers: ':this._(a,b)'),
- const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
- element: 'parameter(#a)', index: 0),
- const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
- element: 'parameter(#b)', index: 1),
- const Visit(VisitKind.VISIT_THIS_CONSTRUCTOR_INVOKE,
- element: 'generative_constructor(C#_)',
- arguments: '(a,b)',
- selector: 'CallStructure(arity=2)'),
- ], method: ''),
- const Test.clazz('''
- class C {
- factory C(a, b) => null;
- }
- ''', const [
- const Visit(VisitKind.VISIT_FACTORY_CONSTRUCTOR_DECL,
- element: 'factory_constructor(C#)',
- parameters: '(a,b)',
- body: '=>null;'),
- const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
- element: 'parameter(#a)', index: 0),
- const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
- element: 'parameter(#b)', index: 1),
- ], method: ''),
- const Test.clazz('''
- class C {
- factory C(a, b) = C._;
- C._(a, b);
- }
- ''', const [
- const Visit(VisitKind.VISIT_REDIRECTING_FACTORY_CONSTRUCTOR_DECL,
- element: 'factory_constructor(C#)',
- parameters: '(a,b)',
- target: 'generative_constructor(C#_)',
- type: 'C'),
- const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
- element: 'parameter(#a)', index: 0),
- const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
- element: 'parameter(#b)', index: 1),
- ], method: ''),
- const Test.clazz('''
- class C {
- factory C(a, b) = D;
- }
- class D<T> {
- D(a, b);
- }
- ''', const [
- const Visit(VisitKind.VISIT_REDIRECTING_FACTORY_CONSTRUCTOR_DECL,
- element: 'factory_constructor(C#)',
- parameters: '(a,b)',
- target: 'generative_constructor(D#)',
- type: 'D'),
- const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
- element: 'parameter(#a)', index: 0),
- const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
- element: 'parameter(#b)', index: 1),
- ], method: ''),
- const Test.clazz('''
- class C {
- factory C(a, b) = D<int>;
- }
- class D<T> {
- D(a, b);
- }
- ''', const [
- const Visit(VisitKind.VISIT_REDIRECTING_FACTORY_CONSTRUCTOR_DECL,
- element: 'factory_constructor(C#)',
- parameters: '(a,b)',
- target: 'generative_constructor(D#)',
- type: 'D<int>'),
- const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
- element: 'parameter(#a)', index: 0),
- const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
- element: 'parameter(#b)', index: 1),
- ], method: ''),
- const Test.clazz('''
- class C {
- factory C(a, b) = D<int>;
- }
- class D<T> {
- factory D(a, b) = E<D<T>>;
- }
- class E<S> {
- E(a, b);
- }
- ''', const [
- const Visit(VisitKind.VISIT_REDIRECTING_FACTORY_CONSTRUCTOR_DECL,
- element: 'factory_constructor(C#)',
- parameters: '(a,b)',
- target: 'factory_constructor(D#)',
- type: 'D<int>'),
- const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
- element: 'parameter(#a)', index: 0),
- const Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
- element: 'parameter(#b)', index: 1),
- ], method: ''),
- ],
- "Field declarations": const [
- const Test.clazz('''
- class C {
- var m;
- }
- ''', const [
- const Visit(VisitKind.VISIT_INSTANCE_FIELD_DECL, element: 'field(C#m)'),
- ]),
- const Test.clazz('''
- class C {
- var m, n;
- }
- ''', const [
- const Visit(VisitKind.VISIT_INSTANCE_FIELD_DECL, element: 'field(C#m)'),
- const Visit(VisitKind.VISIT_INSTANCE_FIELD_DECL, element: 'field(C#n)'),
- ]),
- const Test.clazz('''
- class C {
- var m = 42;
- }
- ''', const [
- const Visit(VisitKind.VISIT_INSTANCE_FIELD_DECL,
- element: 'field(C#m)', rhs: 42),
- ]),
- const Test('''
- m() {
- var local;
- }
- ''', const [
- const Visit(VisitKind.VISIT_TOP_LEVEL_FUNCTION_DECL,
- element: 'function(m)', parameters: '()', body: '{var local;}'),
- const Visit(VisitKind.VISIT_LOCAL_VARIABLE_DECL,
- element: 'variable(m#local)'),
- ]),
- const Test('''
- m() {
- var local = 42;
- }
- ''', const [
- const Visit(VisitKind.VISIT_TOP_LEVEL_FUNCTION_DECL,
- element: 'function(m)', parameters: '()', body: '{var local=42;}'),
- const Visit(VisitKind.VISIT_LOCAL_VARIABLE_DECL,
- element: 'variable(m#local)', rhs: 42),
- ]),
- const Test('''
- m() {
- const local = 42;
- }
- ''', const [
- const Visit(VisitKind.VISIT_TOP_LEVEL_FUNCTION_DECL,
- element: 'function(m)', parameters: '()', body: '{const local=42;}'),
- const Visit(VisitKind.VISIT_LOCAL_CONSTANT_DECL,
- element: 'variable(m#local)', constant: 42),
- ]),
- const Test('''
- m() {
- var local1, local2;
- }
- ''', const [
- const Visit(VisitKind.VISIT_TOP_LEVEL_FUNCTION_DECL,
- element: 'function(m)',
- parameters: '()',
- body: '{var local1,local2;}'),
- const Visit(VisitKind.VISIT_LOCAL_VARIABLE_DECL,
- element: 'variable(m#local1)'),
- const Visit(VisitKind.VISIT_LOCAL_VARIABLE_DECL,
- element: 'variable(m#local2)'),
- ]),
- const Test('''
- m() {
- var local1 = 42, local2 = true;
- }
- ''', const [
- const Visit(VisitKind.VISIT_TOP_LEVEL_FUNCTION_DECL,
- element: 'function(m)',
- parameters: '()',
- body: '{var local1=42,local2=true;}'),
- const Visit(VisitKind.VISIT_LOCAL_VARIABLE_DECL,
- element: 'variable(m#local1)', rhs: 42),
- const Visit(VisitKind.VISIT_LOCAL_VARIABLE_DECL,
- element: 'variable(m#local2)', rhs: true),
- ]),
- const Test('''
- m() {
- const local1 = 42, local2 = true;
- }
- ''', const [
- const Visit(VisitKind.VISIT_TOP_LEVEL_FUNCTION_DECL,
- element: 'function(m)',
- parameters: '()',
- body: '{const local1=42,local2=true;}'),
- const Visit(VisitKind.VISIT_LOCAL_CONSTANT_DECL,
- element: 'variable(m#local1)', constant: 42),
- const Visit(VisitKind.VISIT_LOCAL_CONSTANT_DECL,
- element: 'variable(m#local2)', constant: true),
- ]),
- const Test.clazz('''
- class C {
- static var m;
- }
- ''', const [
- const Visit(VisitKind.VISIT_STATIC_FIELD_DECL, element: 'field(C#m)'),
- ]),
- const Test.clazz('''
- class C {
- static var m, n;
- }
- ''', const [
- const Visit(VisitKind.VISIT_STATIC_FIELD_DECL, element: 'field(C#m)'),
- const Visit(VisitKind.VISIT_STATIC_FIELD_DECL, element: 'field(C#n)'),
- ]),
- const Test.clazz('''
- class C {
- static var k, l, m, n;
- }
- ''', const [
- const Visit(VisitKind.VISIT_STATIC_FIELD_DECL, element: 'field(C#k)'),
- const Visit(VisitKind.VISIT_STATIC_FIELD_DECL, element: 'field(C#l)'),
- const Visit(VisitKind.VISIT_STATIC_FIELD_DECL, element: 'field(C#m)'),
- const Visit(VisitKind.VISIT_STATIC_FIELD_DECL, element: 'field(C#n)'),
- ]),
- const Test.clazz('''
- class C {
- static var m = 42;
- }
- ''', const [
- const Visit(VisitKind.VISIT_STATIC_FIELD_DECL,
- element: 'field(C#m)', rhs: 42),
- ]),
- const Test.clazz('''
- class C {
- static var m = 42, n = true;
- }
- ''', const [
- const Visit(VisitKind.VISIT_STATIC_FIELD_DECL,
- element: 'field(C#m)', rhs: 42),
- const Visit(VisitKind.VISIT_STATIC_FIELD_DECL,
- element: 'field(C#n)', rhs: true),
- ]),
- const Test.clazz('''
- class C {
- static const m = 42;
- }
- ''', const [
- const Visit(VisitKind.VISIT_STATIC_CONSTANT_DECL,
- element: 'field(C#m)', constant: 42),
- ]),
- const Test('''
- var m;
- ''', const [
- const Visit(VisitKind.VISIT_TOP_LEVEL_FIELD_DECL, element: 'field(m)'),
- ]),
- const Test('''
- var m, n;
- ''', const [
- const Visit(VisitKind.VISIT_TOP_LEVEL_FIELD_DECL, element: 'field(m)'),
- const Visit(VisitKind.VISIT_TOP_LEVEL_FIELD_DECL, element: 'field(n)'),
- ]),
- const Test('''
- var m = 42;
- ''', const [
- const Visit(VisitKind.VISIT_TOP_LEVEL_FIELD_DECL,
- element: 'field(m)', rhs: 42),
- ]),
- const Test('''
- const m = 42;
- ''', const [
- const Visit(VisitKind.VISIT_TOP_LEVEL_CONSTANT_DECL,
- element: 'field(m)', constant: 42),
- ]),
- ],
-};
diff --git a/tests/compiler/dart2js/old_frontend/semantic_visitor_test_decl_visitor.dart b/tests/compiler/dart2js/old_frontend/semantic_visitor_test_decl_visitor.dart
deleted file mode 100644
index 41055c6..0000000
--- a/tests/compiler/dart2js/old_frontend/semantic_visitor_test_decl_visitor.dart
+++ /dev/null
@@ -1,370 +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.
-
-part of dart2js.semantics_visitor_test;
-
-class SemanticDeclarationTestVisitor extends SemanticTestVisitor {
- SemanticDeclarationTestVisitor(TreeElements elements) : super(elements);
-
- @override
- errorUnresolvedSuperConstructorInvoke(
- Send node, Element element, NodeList arguments, Selector selector, arg) {
- // TODO: implement errorUnresolvedSuperConstructorInvoke
- }
-
- @override
- errorUnresolvedThisConstructorInvoke(
- Send node, Element element, NodeList arguments, Selector selector, arg) {
- // TODO: implement errorUnresolvedThisConstructorInvoke
- }
-
- @override
- visitAbstractMethodDeclaration(
- FunctionExpression node, MethodElement method, NodeList parameters, arg) {
- visits.add(new Visit(VisitKind.VISIT_ABSTRACT_METHOD_DECL,
- element: method, parameters: parameters));
- applyParameters(parameters, arg);
- }
-
- @override
- visitClosureDeclaration(FunctionExpression node,
- LocalFunctionElement function, NodeList parameters, Node body, arg) {
- visits.add(new Visit(VisitKind.VISIT_CLOSURE_DECL,
- element: function, parameters: parameters, body: body));
- applyParameters(parameters, arg);
- apply(body, arg);
- }
-
- @override
- visitFactoryConstructorDeclaration(FunctionExpression node,
- ConstructorElement constructor, NodeList parameters, Node body, arg) {
- visits.add(new Visit(VisitKind.VISIT_FACTORY_CONSTRUCTOR_DECL,
- element: constructor, parameters: parameters, body: body));
- applyParameters(parameters, arg);
- apply(body, arg);
- }
-
- @override
- visitFieldInitializer(
- SendSet node, FieldElement field, Node initializer, arg) {
- visits.add(new Visit(VisitKind.VISIT_FIELD_INITIALIZER,
- element: field, rhs: initializer));
- apply(initializer, arg);
- }
-
- @override
- visitGenerativeConstructorDeclaration(
- FunctionExpression node,
- ConstructorElement constructor,
- NodeList parameters,
- NodeList initializers,
- Node body,
- arg) {
- visits.add(new Visit(VisitKind.VISIT_GENERATIVE_CONSTRUCTOR_DECL,
- element: constructor, parameters: parameters, body: body));
- applyParameters(parameters, arg);
- applyInitializers(node, arg);
- apply(body, arg);
- }
-
- @override
- visitInstanceMethodDeclaration(FunctionExpression node, MethodElement method,
- NodeList parameters, Node body, arg) {
- visits.add(new Visit(VisitKind.VISIT_INSTANCE_METHOD_DECL,
- element: method, parameters: parameters, body: body));
- applyParameters(parameters, arg);
- apply(body, arg);
- }
-
- @override
- visitLocalFunctionDeclaration(FunctionExpression node,
- LocalFunctionElement function, NodeList parameters, Node body, arg) {
- visits.add(new Visit(VisitKind.VISIT_LOCAL_FUNCTION_DECL,
- element: function, parameters: parameters, body: body));
- applyParameters(parameters, arg);
- apply(body, arg);
- }
-
- @override
- visitRedirectingFactoryConstructorDeclaration(
- FunctionExpression node,
- ConstructorElement constructor,
- NodeList parameters,
- ResolutionInterfaceType redirectionType,
- ConstructorElement redirectionTarget,
- arg) {
- visits.add(new Visit(VisitKind.VISIT_REDIRECTING_FACTORY_CONSTRUCTOR_DECL,
- element: constructor,
- parameters: parameters,
- target: redirectionTarget,
- type: redirectionType));
- applyParameters(parameters, arg);
- }
-
- @override
- visitRedirectingGenerativeConstructorDeclaration(
- FunctionExpression node,
- ConstructorElement constructor,
- NodeList parameters,
- NodeList initializers,
- arg) {
- visits.add(new Visit(
- VisitKind.VISIT_REDIRECTING_GENERATIVE_CONSTRUCTOR_DECL,
- element: constructor,
- parameters: parameters,
- initializers: initializers));
- applyParameters(parameters, arg);
- applyInitializers(node, arg);
- }
-
- @override
- visitStaticFunctionDeclaration(FunctionExpression node,
- MethodElement function, NodeList parameters, Node body, arg) {
- visits.add(new Visit(VisitKind.VISIT_STATIC_FUNCTION_DECL,
- element: function, parameters: parameters, body: body));
- applyParameters(parameters, arg);
- apply(body, arg);
- }
-
- @override
- visitSuperConstructorInvoke(
- Send node,
- ConstructorElement superConstructor,
- ResolutionInterfaceType type,
- NodeList arguments,
- CallStructure callStructure,
- arg) {
- visits.add(new Visit(VisitKind.VISIT_SUPER_CONSTRUCTOR_INVOKE,
- element: superConstructor,
- type: type,
- arguments: arguments,
- selector: callStructure));
- super.visitSuperConstructorInvoke(
- node, superConstructor, type, arguments, callStructure, arg);
- }
-
- @override
- visitImplicitSuperConstructorInvoke(FunctionExpression node,
- ConstructorElement superConstructor, ResolutionInterfaceType type, arg) {
- visits.add(new Visit(VisitKind.VISIT_IMPLICIT_SUPER_CONSTRUCTOR_INVOKE,
- element: superConstructor, type: type));
- super
- .visitImplicitSuperConstructorInvoke(node, superConstructor, type, arg);
- }
-
- @override
- visitThisConstructorInvoke(Send node, ConstructorElement thisConstructor,
- NodeList arguments, CallStructure callStructure, arg) {
- visits.add(new Visit(VisitKind.VISIT_THIS_CONSTRUCTOR_INVOKE,
- element: thisConstructor,
- arguments: arguments,
- selector: callStructure));
- super.visitThisConstructorInvoke(
- node, thisConstructor, arguments, callStructure, arg);
- }
-
- @override
- visitTopLevelFunctionDeclaration(FunctionExpression node,
- MethodElement function, NodeList parameters, Node body, arg) {
- visits.add(new Visit(VisitKind.VISIT_TOP_LEVEL_FUNCTION_DECL,
- element: function, parameters: parameters, body: body));
- applyParameters(parameters, arg);
- apply(body, arg);
- }
-
- @override
- errorUnresolvedFieldInitializer(
- SendSet node, Element element, Node initializer, arg) {
- // TODO: implement errorUnresolvedFieldInitializer
- }
-
- @override
- visitOptionalParameterDeclaration(
- VariableDefinitions node,
- Node definition,
- ParameterElement parameter,
- ConstantExpression defaultValue,
- int index,
- arg) {
- visits.add(new Visit(VisitKind.VISIT_OPTIONAL_PARAMETER_DECL,
- element: parameter,
- constant: defaultValue != null ? defaultValue.toDartText() : null,
- index: index));
- }
-
- @override
- visitParameterDeclaration(VariableDefinitions node, Node definition,
- ParameterElement parameter, int index, arg) {
- visits.add(new Visit(VisitKind.VISIT_REQUIRED_PARAMETER_DECL,
- element: parameter, index: index));
- }
-
- @override
- visitInitializingFormalDeclaration(VariableDefinitions node, Node definition,
- InitializingFormalElement initializingFormal, int index, arg) {
- visits.add(new Visit(VisitKind.VISIT_REQUIRED_INITIALIZING_FORMAL_DECL,
- element: initializingFormal, index: index));
- }
-
- @override
- visitLocalVariableDeclaration(VariableDefinitions node, Node definition,
- LocalVariableElement variable, Node initializer, arg) {
- visits.add(new Visit(VisitKind.VISIT_LOCAL_VARIABLE_DECL,
- element: variable, rhs: initializer));
- if (initializer != null) {
- apply(initializer, arg);
- }
- }
-
- @override
- visitLocalConstantDeclaration(VariableDefinitions node, Node definition,
- LocalVariableElement variable, ConstantExpression constant, arg) {
- visits.add(new Visit(VisitKind.VISIT_LOCAL_CONSTANT_DECL,
- element: variable, constant: constant.toDartText()));
- }
-
- @override
- visitNamedInitializingFormalDeclaration(
- VariableDefinitions node,
- Node definition,
- InitializingFormalElement initializingFormal,
- ConstantExpression defaultValue,
- arg) {
- visits.add(new Visit(VisitKind.VISIT_NAMED_INITIALIZING_FORMAL_DECL,
- element: initializingFormal,
- constant: defaultValue != null ? defaultValue.toDartText() : null));
- }
-
- @override
- visitNamedParameterDeclaration(VariableDefinitions node, Node definition,
- ParameterElement parameter, ConstantExpression defaultValue, arg) {
- visits.add(new Visit(VisitKind.VISIT_NAMED_PARAMETER_DECL,
- element: parameter,
- constant: defaultValue != null ? defaultValue.toDartText() : null));
- }
-
- @override
- visitOptionalInitializingFormalDeclaration(
- VariableDefinitions node,
- Node definition,
- InitializingFormalElement initializingFormal,
- ConstantExpression defaultValue,
- int index,
- arg) {
- visits.add(new Visit(VisitKind.VISIT_OPTIONAL_INITIALIZING_FORMAL_DECL,
- element: initializingFormal,
- constant: defaultValue != null ? defaultValue.toDartText() : null,
- index: index));
- }
-
- @override
- visitInstanceFieldDeclaration(VariableDefinitions node, Node definition,
- FieldElement field, Node initializer, arg) {
- visits.add(new Visit(VisitKind.VISIT_INSTANCE_FIELD_DECL,
- element: field, rhs: initializer));
- if (initializer != null) {
- apply(initializer, arg);
- }
- }
-
- @override
- visitStaticConstantDeclaration(VariableDefinitions node, Node definition,
- FieldElement field, ConstantExpression constant, arg) {
- visits.add(new Visit(VisitKind.VISIT_STATIC_CONSTANT_DECL,
- element: field, constant: constant.toDartText()));
- }
-
- @override
- visitStaticFieldDeclaration(VariableDefinitions node, Node definition,
- FieldElement field, Node initializer, arg) {
- visits.add(new Visit(VisitKind.VISIT_STATIC_FIELD_DECL,
- element: field, rhs: initializer));
- if (initializer != null) {
- apply(initializer, arg);
- }
- }
-
- @override
- visitTopLevelConstantDeclaration(VariableDefinitions node, Node definition,
- FieldElement field, ConstantExpression constant, arg) {
- visits.add(new Visit(VisitKind.VISIT_TOP_LEVEL_CONSTANT_DECL,
- element: field, constant: constant.toDartText()));
- }
-
- @override
- visitTopLevelFieldDeclaration(VariableDefinitions node, Node definition,
- FieldElement field, Node initializer, arg) {
- visits.add(new Visit(VisitKind.VISIT_TOP_LEVEL_FIELD_DECL,
- element: field, rhs: initializer));
- if (initializer != null) {
- apply(initializer, arg);
- }
- }
-
- @override
- visitAbstractGetterDeclaration(
- FunctionExpression node, MethodElement getter, arg) {
- visits
- .add(new Visit(VisitKind.VISIT_ABSTRACT_GETTER_DECL, element: getter));
- }
-
- @override
- visitAbstractSetterDeclaration(
- FunctionExpression node, MethodElement setter, NodeList parameters, arg) {
- visits.add(new Visit(VisitKind.VISIT_ABSTRACT_SETTER_DECL,
- element: setter, parameters: parameters));
- applyParameters(parameters, arg);
- }
-
- @override
- visitInstanceGetterDeclaration(
- FunctionExpression node, MethodElement getter, Node body, arg) {
- visits.add(new Visit(VisitKind.VISIT_INSTANCE_GETTER_DECL,
- element: getter, body: body));
- apply(body, arg);
- }
-
- @override
- visitInstanceSetterDeclaration(FunctionExpression node, MethodElement setter,
- NodeList parameters, Node body, arg) {
- visits.add(new Visit(VisitKind.VISIT_INSTANCE_SETTER_DECL,
- element: setter, parameters: parameters, body: body));
- applyParameters(parameters, arg);
- apply(body, arg);
- }
-
- @override
- visitTopLevelGetterDeclaration(
- FunctionExpression node, MethodElement getter, Node body, arg) {
- visits.add(new Visit(VisitKind.VISIT_TOP_LEVEL_GETTER_DECL,
- element: getter, body: body));
- apply(body, arg);
- }
-
- @override
- visitTopLevelSetterDeclaration(FunctionExpression node, MethodElement setter,
- NodeList parameters, Node body, arg) {
- visits.add(new Visit(VisitKind.VISIT_TOP_LEVEL_SETTER_DECL,
- element: setter, parameters: parameters, body: body));
- applyParameters(parameters, arg);
- apply(body, arg);
- }
-
- @override
- visitStaticGetterDeclaration(
- FunctionExpression node, MethodElement getter, Node body, arg) {
- visits.add(new Visit(VisitKind.VISIT_STATIC_GETTER_DECL,
- element: getter, body: body));
- apply(body, arg);
- }
-
- @override
- visitStaticSetterDeclaration(FunctionExpression node, MethodElement setter,
- NodeList parameters, Node body, arg) {
- visits.add(new Visit(VisitKind.VISIT_STATIC_SETTER_DECL,
- element: setter, parameters: parameters, body: body));
- applyParameters(parameters, arg);
- apply(body, arg);
- }
-}
diff --git a/tests/compiler/dart2js/old_frontend/semantic_visitor_test_send_data.dart b/tests/compiler/dart2js/old_frontend/semantic_visitor_test_send_data.dart
deleted file mode 100644
index b324d78..0000000
--- a/tests/compiler/dart2js/old_frontend/semantic_visitor_test_send_data.dart
+++ /dev/null
@@ -1,4184 +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.
-
-part of dart2js.semantics_visitor_test;
-
-const Map<String, List<Test>> SEND_TESTS = const {
- 'Parameters': const [
- // Parameters
- const Test('m(o) => o;',
- const Visit(VisitKind.VISIT_PARAMETER_GET, element: 'parameter(m#o)')),
- const Test(
- 'm(o) { o = 42; }',
- const Visit(VisitKind.VISIT_PARAMETER_SET,
- element: 'parameter(m#o)', rhs: '42')),
- const Test(
- 'm(o) { o(null, 42); }',
- const Visit(VisitKind.VISIT_PARAMETER_INVOKE,
- element: 'parameter(m#o)',
- arguments: '(null,42)',
- selector: 'CallStructure(arity=2)')),
- const Test(
- 'm(final o) { o = 42; }',
- const Visit(VisitKind.VISIT_FINAL_PARAMETER_SET,
- element: 'parameter(m#o)', rhs: '42')),
- ],
- 'Local variables': const [
- // Local variables
- const Test(
- 'm() { var o; return o; }',
- const Visit(VisitKind.VISIT_LOCAL_VARIABLE_GET,
- element: 'variable(m#o)')),
- const Test(
- 'm() { var o; o = 42; }',
- const Visit(VisitKind.VISIT_LOCAL_VARIABLE_SET,
- element: 'variable(m#o)', rhs: '42')),
- const Test(
- 'm() { var o; o(null, 42); }',
- const Visit(VisitKind.VISIT_LOCAL_VARIABLE_INVOKE,
- element: 'variable(m#o)',
- arguments: '(null,42)',
- selector: 'CallStructure(arity=2)')),
- const Test(
- 'm() { final o = 0; o = 42; }',
- const Visit(VisitKind.VISIT_FINAL_LOCAL_VARIABLE_SET,
- element: 'variable(m#o)', rhs: '42')),
- const Test(
- 'm() { const o = 0; o = 42; }',
- const Visit(VisitKind.VISIT_FINAL_LOCAL_VARIABLE_SET,
- element: 'variable(m#o)', rhs: '42')),
- ],
- 'Local functions': const [
- // Local functions
- const Test(
- 'm() { o(a, b) {}; return o; }',
- const Visit(VisitKind.VISIT_LOCAL_FUNCTION_GET,
- element: 'function(m#o)')),
- const Test(
- 'm() { o(a, b) {}; o(null, 42); }',
- const Visit(VisitKind.VISIT_LOCAL_FUNCTION_INVOKE,
- element: 'function(m#o)',
- arguments: '(null,42)',
- selector: 'CallStructure(arity=2)')),
- const Test(
- 'm() { o(a) {}; o(null, 42); }',
- const Visit(VisitKind.VISIT_LOCAL_FUNCTION_INCOMPATIBLE_INVOKE,
- element: 'function(m#o)',
- arguments: '(null,42)',
- selector: 'CallStructure(arity=2)')),
- const Test(
- 'm() { o(a, b) {}; o = 42; }',
- const Visit(VisitKind.VISIT_LOCAL_FUNCTION_SET,
- element: 'function(m#o)', rhs: '42')),
- ],
- 'Static fields': const [
- // Static fields
- const Test('''
- class C { static var o; }
- m() => C.o;
- ''',
- const Visit(VisitKind.VISIT_STATIC_FIELD_GET, element: 'field(C#o)')),
- const Test.clazz('''
- class C {
- static var o;
- m() => o;
- }
- ''',
- const Visit(VisitKind.VISIT_STATIC_FIELD_GET, element: 'field(C#o)')),
- const Test.clazz('''
- class C {
- static var o;
- m() => C.o;
- }
- ''',
- const Visit(VisitKind.VISIT_STATIC_FIELD_GET, element: 'field(C#o)')),
- const Test.prefix('''
- class C {
- static var o;
- }
- ''', 'm() => p.C.o;',
- const Visit(VisitKind.VISIT_STATIC_FIELD_GET, element: 'field(C#o)')),
- const Test.clazz(
- '''
- class C {
- var o;
- static m() => o;
- }
- ''',
- const Visit(VisitKind.ERROR_INVALID_GET,
- error: MessageKind.NO_INSTANCE_AVAILABLE)),
- const Test.prefix(
- '''
- class C {
- static var o;
- }
- ''',
- 'm() => p.C.o;',
- const [
- const Visit(VisitKind.PREVISIT_DEFERRED_ACCESS, element: 'prefix(p)'),
- const Visit(VisitKind.VISIT_STATIC_FIELD_GET, element: 'field(C#o)'),
- ],
- isDeferred: true),
- const Test('''
- class C {
- var o;
- }
- m() => C.o;
- ''', const Visit(VisitKind.VISIT_UNRESOLVED_GET, name: 'o')),
- const Test('''
- class C {
- var o;
- }
- m() { C.o = 42; }
- ''', const Visit(VisitKind.VISIT_UNRESOLVED_SET, name: 'o', rhs: '42')),
- const Test('''
- class C {
- C.o();
- }
- m() => C.o;
- ''', const Visit(VisitKind.VISIT_UNRESOLVED_GET, name: 'o')),
- const Test.prefix(
- '''
- ''',
- 'm() => p.C.o;',
- const [
- const Visit(VisitKind.VISIT_DYNAMIC_PROPERTY_GET,
- receiver: 'p.C', name: 'o'),
- const Visit(VisitKind.VISIT_UNRESOLVED_GET, name: 'C'),
- ]),
- const Test.prefix('''
- class C {
- }
- ''', 'm() => p.C.o;',
- const Visit(VisitKind.VISIT_UNRESOLVED_GET, name: 'o')),
- const Test.prefix(
- '''
- ''',
- 'm() => p.C.o;',
- const [
- const Visit(VisitKind.VISIT_DYNAMIC_PROPERTY_GET,
- receiver: 'p.C', name: 'o'),
- const Visit(VisitKind.PREVISIT_DEFERRED_ACCESS, element: 'prefix(p)'),
- const Visit(VisitKind.VISIT_UNRESOLVED_GET, name: 'C'),
- ],
- isDeferred: true),
- const Test.prefix(
- '''
- class C {
- }
- ''',
- 'm() => p.C.o;',
- const [
- const Visit(VisitKind.PREVISIT_DEFERRED_ACCESS, element: 'prefix(p)'),
- const Visit(VisitKind.VISIT_UNRESOLVED_GET, name: 'o'),
- ],
- isDeferred: true),
- const Test('''
- class C {}
- m() => C.this;
- ''', null),
- const Test(
- '''
- class C {
- static var o;
- }
- m() { C.o = 42; }
- ''',
- const Visit(VisitKind.VISIT_STATIC_FIELD_SET,
- element: 'field(C#o)', rhs: '42')),
- const Test.clazz(
- '''
- class C {
- static var o;
- m() { o = 42; }
- }
- ''',
- const Visit(VisitKind.VISIT_STATIC_FIELD_SET,
- element: 'field(C#o)', rhs: '42')),
- const Test.clazz(
- '''
- class C {
- static var o;
- m() { C.o = 42; }
- }
- ''',
- const Visit(VisitKind.VISIT_STATIC_FIELD_SET,
- element: 'field(C#o)', rhs: '42')),
- const Test.prefix(
- '''
- class C {
- static var o;
- }
- ''',
- 'm() { p.C.o = 42; }',
- const Visit(VisitKind.VISIT_STATIC_FIELD_SET,
- element: 'field(C#o)', rhs: '42')),
- const Test.clazz(
- '''
- class C {
- var o;
- static m() { o = 42; }
- }
- ''',
- const Visit(VisitKind.ERROR_INVALID_SET,
- error: MessageKind.NO_INSTANCE_AVAILABLE, rhs: '42')),
- const Test(
- '''
- class C {
- static var o;
- }
- m() { C.o(null, 42); }
- ''',
- const Visit(VisitKind.VISIT_STATIC_FIELD_INVOKE,
- element: 'field(C#o)', arguments: '(null,42)')),
- const Test.clazz(
- '''
- class C {
- static var o;
- m() { o(null, 42); }
- }
- ''',
- const Visit(VisitKind.VISIT_STATIC_FIELD_INVOKE,
- element: 'field(C#o)', arguments: '(null,42)')),
- const Test.clazz(
- '''
- class C {
- static var o;
- m() { C.o(null, 42); }
- }
- ''',
- const Visit(VisitKind.VISIT_STATIC_FIELD_INVOKE,
- element: 'field(C#o)', arguments: '(null,42)')),
- const Test.clazz(
- '''
- class C {
- var o;
- static m() { o(null, 42); }
- }
- ''',
- const Visit(VisitKind.ERROR_INVALID_INVOKE,
- error: MessageKind.NO_INSTANCE_AVAILABLE, arguments: '(null,42)')),
- const Test.prefix(
- '''
- class C {
- static var o;
- }
- ''',
- 'm() { p.C.o(null, 42); }',
- const Visit(VisitKind.VISIT_STATIC_FIELD_INVOKE,
- element: 'field(C#o)', arguments: '(null,42)')),
- const Test(
- '''
- class C {}
- m() => C.this(null, 42);
- ''',
- const Visit(VisitKind.ERROR_INVALID_INVOKE,
- error: MessageKind.THIS_PROPERTY, arguments: '(null,42)')),
- const Test(
- '''
- class C { static final o = 0; }
- m() { C.o = 42; }
- ''',
- const Visit(VisitKind.VISIT_FINAL_STATIC_FIELD_SET,
- element: 'field(C#o)', rhs: '42')),
- const Test.clazz(
- '''
- class C {
- static final o = 0;
- m() { o = 42; }
- }
- ''',
- const Visit(VisitKind.VISIT_FINAL_STATIC_FIELD_SET,
- element: 'field(C#o)', rhs: '42')),
- const Test.clazz(
- '''
- class C {
- static final o = 0;
- m() { C.o = 42; }
- }
- ''',
- const Visit(VisitKind.VISIT_FINAL_STATIC_FIELD_SET,
- element: 'field(C#o)', rhs: '42')),
- const Test.prefix(
- '''
- class C {
- static final o = 0;
- }
- ''',
- 'm() { p.C.o = 42; }',
- const Visit(VisitKind.VISIT_FINAL_STATIC_FIELD_SET,
- element: 'field(C#o)', rhs: '42')),
- const Test(
- '''
- class C { static const o = 0; }
- m() { C.o = 42; }
- ''',
- const Visit(VisitKind.VISIT_FINAL_STATIC_FIELD_SET,
- element: 'field(C#o)', rhs: '42')),
- const Test.clazz(
- '''
- class C {
- static const o = 0;
- m() { o = 42; }
- }
- ''',
- const Visit(VisitKind.VISIT_FINAL_STATIC_FIELD_SET,
- element: 'field(C#o)', rhs: '42')),
- const Test.clazz(
- '''
- class C {
- static const o = 0;
- m() { C.o = 42; }
- }
- ''',
- const Visit(VisitKind.VISIT_FINAL_STATIC_FIELD_SET,
- element: 'field(C#o)', rhs: '42')),
- const Test.prefix(
- '''
- class C {
- static const o = 0;
- }
- ''',
- 'm() { p.C.o = 42; }',
- const Visit(VisitKind.VISIT_FINAL_STATIC_FIELD_SET,
- element: 'field(C#o)', rhs: '42')),
- ],
- 'Static properties': const [
- // Static properties
- const Test('''
- class C {
- static get o => null;
- }
- m() => C.o;
- ''',
- const Visit(VisitKind.VISIT_STATIC_GETTER_GET, element: 'getter(C#o)')),
- const Test.clazz('''
- class C {
- static get o => null;
- m() => o;
- }
- ''',
- const Visit(VisitKind.VISIT_STATIC_GETTER_GET, element: 'getter(C#o)')),
- const Test.clazz('''
- class C {
- static get o => null;
- m() => C.o;
- }
- ''',
- const Visit(VisitKind.VISIT_STATIC_GETTER_GET, element: 'getter(C#o)')),
- const Test.prefix('''
- class C {
- static get o => null;
- }
- ''', 'm() => p.C.o;',
- const Visit(VisitKind.VISIT_STATIC_GETTER_GET, element: 'getter(C#o)')),
- const Test(
- '''
- class C { static get o => 42; }
- m() { C.o = 42; }
- ''',
- const Visit(VisitKind.VISIT_STATIC_GETTER_SET,
- element: 'getter(C#o)', rhs: '42')),
- const Test.clazz(
- '''
- class C {
- static get o => 42;
- m() { o = 42; }
- }
- ''',
- const Visit(VisitKind.VISIT_STATIC_GETTER_SET,
- element: 'getter(C#o)', rhs: '42')),
- const Test.clazz(
- '''
- class C {
- static get o => 42;
- m() { C.o = 42; }
- }
- ''',
- const Visit(VisitKind.VISIT_STATIC_GETTER_SET,
- element: 'getter(C#o)', rhs: '42')),
- const Test.prefix(
- '''
- class C {
- static get o => 42;
- }
- ''',
- 'm() { p.C.o = 42; }',
- const Visit(VisitKind.VISIT_STATIC_GETTER_SET,
- element: 'getter(C#o)', rhs: '42')),
- const Test('''
- class C {
- static set o(_) {}
- }
- m() => C.o;
- ''',
- const Visit(VisitKind.VISIT_STATIC_SETTER_GET, element: 'setter(C#o)')),
- const Test.clazz('''
- class C {
- static set o(_) {}
- m() => o;
- }
- ''',
- const Visit(VisitKind.VISIT_STATIC_SETTER_GET, element: 'setter(C#o)')),
-
- const Test.clazz('''
- class C {
- static set o(_) {}
- m() => C.o;
- }
- ''',
- const Visit(VisitKind.VISIT_STATIC_SETTER_GET, element: 'setter(C#o)')),
- const Test.prefix('''
- class C {
- static set o(_) {}
- }
- ''', 'm() => p.C.o;',
- const Visit(VisitKind.VISIT_STATIC_SETTER_GET, element: 'setter(C#o)')),
- const Test(
- '''
- class C { static set o(_) {} }
- m() { C.o = 42; }
- ''',
- const Visit(VisitKind.VISIT_STATIC_SETTER_SET,
- element: 'setter(C#o)', rhs: '42')),
- const Test.clazz(
- '''
- class C {
- static set o(_) {}
- m() { o = 42; }
- }
- ''',
- const Visit(VisitKind.VISIT_STATIC_SETTER_SET,
- element: 'setter(C#o)', rhs: '42')),
- const Test.clazz(
- '''
- class C {
- static set o(_) {}
- m() { C.o = 42; }
- }
- ''',
- const Visit(VisitKind.VISIT_STATIC_SETTER_SET,
- element: 'setter(C#o)', rhs: '42')),
- const Test.prefix(
- '''
- class C {
- static set o(_) {}
- }
- ''',
- 'm() { p.C.o = 42; }',
- const Visit(VisitKind.VISIT_STATIC_SETTER_SET,
- element: 'setter(C#o)', rhs: '42')),
- const Test(
- '''
- class C { static get o => null; }
- m() => C.o(null, 42);
- ''',
- const Visit(VisitKind.VISIT_STATIC_GETTER_INVOKE,
- element: 'getter(C#o)', arguments: '(null,42)')),
- const Test.clazz(
- '''
- class C {
- static get o => null;
- m() { o(null, 42); }
- }
- ''',
- const Visit(VisitKind.VISIT_STATIC_GETTER_INVOKE,
- element: 'getter(C#o)', arguments: '(null,42)')),
- const Test.clazz(
- '''
- class C {
- static get o => null;
- m() { C.o(null, 42); }
- }
- ''',
- const Visit(VisitKind.VISIT_STATIC_GETTER_INVOKE,
- element: 'getter(C#o)', arguments: '(null,42)')),
- const Test.prefix(
- '''
- class C {
- static get o => null;
- }
- ''',
- 'm() { p.C.o(null, 42); }',
- const Visit(VisitKind.VISIT_STATIC_GETTER_INVOKE,
- element: 'getter(C#o)', arguments: '(null,42)')),
- const Test(
- '''
- class C { static set o(_) {} }
- m() => C.o(null, 42);
- ''',
- const Visit(VisitKind.VISIT_STATIC_SETTER_INVOKE,
- element: 'setter(C#o)', arguments: '(null,42)')),
- const Test.clazz(
- '''
- class C {
- static set o(_) {}
- m() { o(null, 42); }
- }
- ''',
- const Visit(VisitKind.VISIT_STATIC_SETTER_INVOKE,
- element: 'setter(C#o)', arguments: '(null,42)')),
- const Test.clazz(
- '''
- class C {
- static set o(_) {}
- m() { C.o(null, 42); }
- }
- ''',
- const Visit(VisitKind.VISIT_STATIC_SETTER_INVOKE,
- element: 'setter(C#o)', arguments: '(null,42)')),
- const Test.prefix(
- '''
- class C {
- static set o(_) {}
- }
- ''',
- 'm() { p.C.o(null, 42); }',
- const Visit(VisitKind.VISIT_STATIC_SETTER_INVOKE,
- element: 'setter(C#o)', arguments: '(null,42)')),
- ],
- 'Static functions': const [
- // Static functions
- const Test(
- '''
- class C { static o(a, b) {} }
- m() => C.o;
- ''',
- const Visit(VisitKind.VISIT_STATIC_FUNCTION_GET,
- element: 'function(C#o)')),
- const Test.clazz(
- '''
- class C {
- static o(a, b) {}
- m() => o;
- }
- ''',
- const Visit(VisitKind.VISIT_STATIC_FUNCTION_GET,
- element: 'function(C#o)')),
- const Test.clazz(
- '''
- class C {
- static o(a, b) {}
- m() => C.o;
- }
- ''',
- const Visit(VisitKind.VISIT_STATIC_FUNCTION_GET,
- element: 'function(C#o)')),
- const Test.prefix(
- '''
- class C { static o(a, b) {} }
- ''',
- '''
- m() => p.C.o;
- ''',
- const Visit(VisitKind.VISIT_STATIC_FUNCTION_GET,
- element: 'function(C#o)')),
- const Test(
- '''
- class C { static o(a, b) {} }
- m() { C.o = 42; }
- ''',
- const Visit(VisitKind.VISIT_STATIC_FUNCTION_SET,
- element: 'function(C#o)', rhs: '42')),
- const Test.clazz(
- '''
- class C {
- static o(a, b) {}
- m() { o = 42; }
- }
- ''',
- const Visit(VisitKind.VISIT_STATIC_FUNCTION_SET,
- element: 'function(C#o)', rhs: '42')),
- const Test.clazz(
- '''
- class C {
- static o(a, b) {}
- m() { C.o = 42; }
- }
- ''',
- const Visit(VisitKind.VISIT_STATIC_FUNCTION_SET,
- element: 'function(C#o)', rhs: '42')),
- const Test.prefix(
- '''
- class C { static o(a, b) {} }
- ''',
- '''
- m() { p.C.o = 42; }
- ''',
- const Visit(VisitKind.VISIT_STATIC_FUNCTION_SET,
- element: 'function(C#o)', rhs: '42')),
- const Test(
- '''
- class C { static o(a, b) {} }
- m() => C.o(null, 42);
- ''',
- const Visit(VisitKind.VISIT_STATIC_FUNCTION_INVOKE,
- element: 'function(C#o)', arguments: '(null,42)')),
- const Test.clazz(
- '''
- class C {
- static o(a, b) {}
- m() { o(null, 42); }
- }
- ''',
- const Visit(VisitKind.VISIT_STATIC_FUNCTION_INVOKE,
- element: 'function(C#o)', arguments: '(null,42)')),
- const Test.clazz(
- '''
- class C {
- static o(a, b) {}
- m() { C.o(null, 42); }
- }
- ''',
- const Visit(VisitKind.VISIT_STATIC_FUNCTION_INVOKE,
- element: 'function(C#o)', arguments: '(null,42)')),
- const Test.prefix(
- '''
- class C {
- static o(a, b) {}
- }
- ''',
- 'm() { p.C.o(null, 42); }',
- const Visit(VisitKind.VISIT_STATIC_FUNCTION_INVOKE,
- element: 'function(C#o)', arguments: '(null,42)')),
- const Test(
- '''
- class C { static o(a, b) {} }
- m() => C.o(null);
- ''',
- const Visit(VisitKind.VISIT_STATIC_FUNCTION_INCOMPATIBLE_INVOKE,
- element: 'function(C#o)', arguments: '(null)')),
- ],
- 'Top level fields': const [
- // Top level fields
- const Test('''
- var o;
- m() => o;
- ''',
- const Visit(VisitKind.VISIT_TOP_LEVEL_FIELD_GET, element: 'field(o)')),
- const Test.prefix('''
- var o;
- ''', 'm() => p.o;',
- const Visit(VisitKind.VISIT_TOP_LEVEL_FIELD_GET, element: 'field(o)')),
- const Test.prefix(
- '''
- var o;
- ''',
- 'm() => p.o;',
- const [
- const Visit(VisitKind.PREVISIT_DEFERRED_ACCESS, element: 'prefix(p)'),
- const Visit(VisitKind.VISIT_TOP_LEVEL_FIELD_GET, element: 'field(o)'),
- ],
- isDeferred: true),
- const Test.prefix('''
- ''', 'm() => p.o;',
- const Visit(VisitKind.VISIT_UNRESOLVED_GET, name: 'o')),
- const Test.prefix(
- '''
- ''',
- 'm() => p.o;',
- const [
- const Visit(VisitKind.PREVISIT_DEFERRED_ACCESS, element: 'prefix(p)'),
- const Visit(VisitKind.VISIT_UNRESOLVED_GET, name: 'o'),
- ],
- isDeferred: true),
- const Test.prefix(
- '''
- ''',
- 'm() => p;',
- const Visit(VisitKind.ERROR_INVALID_GET,
- error: MessageKind.PREFIX_AS_EXPRESSION)),
- const Test(
- '''
- var o;
- m() { o = 42; }
- ''',
- const Visit(VisitKind.VISIT_TOP_LEVEL_FIELD_SET,
- element: 'field(o)', rhs: '42')),
- const Test.prefix(
- '''
- var o;
- ''',
- 'm() { p.o = 42; }',
- const Visit(VisitKind.VISIT_TOP_LEVEL_FIELD_SET,
- element: 'field(o)', rhs: '42')),
- const Test.prefix(
- '''
- ''',
- 'm() { p = 42; }',
- const Visit(VisitKind.ERROR_INVALID_SET,
- error: MessageKind.PREFIX_AS_EXPRESSION, rhs: '42')),
- const Test(
- '''
- final o = 0;
- m() { o = 42; }
- ''',
- const Visit(VisitKind.VISIT_FINAL_TOP_LEVEL_FIELD_SET,
- element: 'field(o)', rhs: '42')),
- const Test.prefix(
- '''
- final o = 0;
- ''',
- 'm() { p.o = 42; }',
- const Visit(VisitKind.VISIT_FINAL_TOP_LEVEL_FIELD_SET,
- element: 'field(o)', rhs: '42')),
- const Test(
- '''
- const o = 0;
- m() { o = 42; }
- ''',
- const Visit(VisitKind.VISIT_FINAL_TOP_LEVEL_FIELD_SET,
- element: 'field(o)', rhs: '42')),
- const Test.prefix(
- '''
- const o = 0;
- ''',
- 'm() { p.o = 42; }',
- const Visit(VisitKind.VISIT_FINAL_TOP_LEVEL_FIELD_SET,
- element: 'field(o)', rhs: '42')),
- const Test(
- '''
- var o;
- m() { o(null, 42); }
- ''',
- const Visit(VisitKind.VISIT_TOP_LEVEL_FIELD_INVOKE,
- element: 'field(o)', arguments: '(null,42)')),
- const Test.prefix(
- '''
- var o;
- ''',
- 'm() { p.o(null, 42); }',
- const Visit(VisitKind.VISIT_TOP_LEVEL_FIELD_INVOKE,
- element: 'field(o)', arguments: '(null,42)')),
- const Test.prefix(
- '''
- ''',
- 'm() { p(null, 42); }',
- const Visit(VisitKind.ERROR_INVALID_INVOKE,
- error: MessageKind.PREFIX_AS_EXPRESSION, arguments: '(null,42)')),
- const Test('''
- m() => o;
- ''', const Visit(VisitKind.VISIT_UNRESOLVED_GET, name: 'o')),
- const Test('''
- m() { o = 42; }
- ''', const Visit(VisitKind.VISIT_UNRESOLVED_SET, name: 'o', rhs: '42')),
- ],
- 'Top level properties': const [
- // Top level properties
- const Test(
- '''
- get o => null;
- m() => o;
- ''',
- const Visit(VisitKind.VISIT_TOP_LEVEL_GETTER_GET,
- element: 'getter(o)')),
- const Test.prefix(
- '''
- get o => null;
- ''',
- '''
- m() => p.o;
- ''',
- const Visit(VisitKind.VISIT_TOP_LEVEL_GETTER_GET,
- element: 'getter(o)')),
- const Test(
- '''
- set o(_) {}
- m() => o;
- ''',
- const Visit(VisitKind.VISIT_TOP_LEVEL_SETTER_GET,
- element: 'setter(o)')),
- const Test.prefix(
- '''
- set o(_) {}
- ''',
- '''
- m() => p.o;
- ''',
- const Visit(VisitKind.VISIT_TOP_LEVEL_SETTER_GET,
- element: 'setter(o)')),
- const Test(
- '''
- get o => null;
- m() { o = 42; }
- ''',
- const Visit(VisitKind.VISIT_TOP_LEVEL_GETTER_SET,
- element: 'getter(o)', rhs: '42')),
- const Test.prefix(
- '''
- get o => null;
- ''',
- 'm() { p.o = 42; }',
- const Visit(VisitKind.VISIT_TOP_LEVEL_GETTER_SET,
- element: 'getter(o)', rhs: '42')),
- const Test(
- '''
- set o(_) {}
- m() { o = 42; }
- ''',
- const Visit(VisitKind.VISIT_TOP_LEVEL_SETTER_SET,
- element: 'setter(o)', rhs: '42')),
- const Test.prefix(
- '''
- set o(_) {}
- ''',
- 'm() { p.o = 42; }',
- const Visit(VisitKind.VISIT_TOP_LEVEL_SETTER_SET,
- element: 'setter(o)', rhs: '42')),
- const Test(
- '''
- get o => null;
- m() => o(null, 42);
- ''',
- const Visit(VisitKind.VISIT_TOP_LEVEL_GETTER_INVOKE,
- element: 'getter(o)', arguments: '(null,42)')),
- const Test.prefix(
- '''
- get o => null;
- ''',
- 'm() { p.o(null, 42); }',
- const Visit(VisitKind.VISIT_TOP_LEVEL_GETTER_INVOKE,
- element: 'getter(o)', arguments: '(null,42)')),
- const Test(
- '''
- set o(_) {}
- m() => o(null, 42);
- ''',
- const Visit(VisitKind.VISIT_TOP_LEVEL_SETTER_INVOKE,
- element: 'setter(o)', arguments: '(null,42)')),
- const Test.prefix(
- '''
- set o(_) {}
- ''',
- 'm() { p.o(null, 42); }',
- const Visit(VisitKind.VISIT_TOP_LEVEL_SETTER_INVOKE,
- element: 'setter(o)', arguments: '(null,42)')),
- ],
- 'Top level functions': const [
- // Top level functions
- const Test(
- '''
- o(a, b) {}
- m() => o;
- ''',
- const Visit(VisitKind.VISIT_TOP_LEVEL_FUNCTION_GET,
- element: 'function(o)')),
- const Test(
- '''
- o(a, b) {}
- m() => o(null, 42);
- ''',
- const Visit(VisitKind.VISIT_TOP_LEVEL_FUNCTION_INVOKE,
- element: 'function(o)', arguments: '(null,42)')),
- const Test(
- '''
- o(a, b) {}
- m() => o(null);
- ''',
- const Visit(VisitKind.VISIT_TOP_LEVEL_FUNCTION_INCOMPATIBLE_INVOKE,
- element: 'function(o)', arguments: '(null)')),
- const Test.prefix(
- '''
- o(a, b) {}
- ''',
- 'm() { p.o(null, 42); }',
- const Visit(VisitKind.VISIT_TOP_LEVEL_FUNCTION_INVOKE,
- element: 'function(o)', arguments: '(null,42)')),
- const Test(
- '''
- m() => o(null, 42);
- ''',
- const Visit(VisitKind.VISIT_UNRESOLVED_INVOKE,
- name: 'o', arguments: '(null,42)')),
- const Test.prefix(
- '''
- o(a, b) {}
- ''',
- 'm() => p.o(null, 42);',
- const [
- const Visit(VisitKind.PREVISIT_DEFERRED_ACCESS, element: 'prefix(p)'),
- const Visit(VisitKind.VISIT_TOP_LEVEL_FUNCTION_INVOKE,
- element: 'function(o)', arguments: '(null,42)'),
- ],
- isDeferred: true),
- const Test.prefix(
- '''
- ''',
- 'm() => p.o(null, 42);',
- const Visit(VisitKind.VISIT_UNRESOLVED_INVOKE,
- name: 'o', arguments: '(null,42)')),
- const Test.prefix(
- '''
- ''',
- 'm() => p.o(null, 42);',
- const [
- const Visit(VisitKind.PREVISIT_DEFERRED_ACCESS, element: 'prefix(p)'),
- const Visit(VisitKind.VISIT_UNRESOLVED_INVOKE,
- name: 'o', arguments: '(null,42)'),
- ],
- isDeferred: true),
- const Test.prefix(
- '''
- ''',
- 'm() => p(null, 42);',
- const Visit(VisitKind.ERROR_INVALID_INVOKE,
- error: MessageKind.PREFIX_AS_EXPRESSION, arguments: '(null,42)')),
- const Test(
- '''
- o(a, b) {}
- m() { o = 42; }
- ''',
- const Visit(VisitKind.VISIT_TOP_LEVEL_FUNCTION_SET,
- element: 'function(o)', rhs: '42')),
- const Test.prefix(
- '''
- o(a, b) {}
- ''',
- 'm() { p.o = 42; }',
- const Visit(VisitKind.VISIT_TOP_LEVEL_FUNCTION_SET,
- element: 'function(o)', rhs: '42')),
- ],
- 'Dynamic properties': const [
- // Dynamic properties
- const Test('m(o) => o.foo;', const [
- const Visit(VisitKind.VISIT_DYNAMIC_PROPERTY_GET,
- receiver: 'o', name: 'foo'),
- const Visit(VisitKind.VISIT_PARAMETER_GET, element: 'parameter(m#o)'),
- ]),
- const Test('m(o) { o.foo = 42; }', const [
- const Visit(VisitKind.VISIT_DYNAMIC_PROPERTY_SET,
- receiver: 'o', name: 'foo', rhs: '42'),
- const Visit(VisitKind.VISIT_PARAMETER_GET, element: 'parameter(m#o)'),
- ]),
- const Test('m(o) { o.foo(null, 42); }', const [
- const Visit(VisitKind.VISIT_DYNAMIC_PROPERTY_INVOKE,
- receiver: 'o', name: 'foo', arguments: '(null,42)'),
- const Visit(VisitKind.VISIT_PARAMETER_GET, element: 'parameter(m#o)'),
- ]),
- ],
- 'This access': const [
- // This access
- const Test.clazz('''
- class C {
- m() => this;
- }
- ''', const Visit(VisitKind.VISIT_THIS_GET)),
- const Test.clazz('''
- class C {
- call(a, b) {}
- m() { this(null, 42); }
- }
- ''', const Visit(VisitKind.VISIT_THIS_INVOKE, arguments: '(null,42)')),
- const Test.clazz(
- '''
- class C {
- call(a, b) {}
- static m() { this(null, 42); }
- }
- ''',
- const Visit(VisitKind.ERROR_INVALID_INVOKE,
- error: MessageKind.NO_THIS_AVAILABLE, arguments: '(null,42)')),
- ],
- 'This properties': const [
- // This properties
- const Test.clazz('''
- class C {
- var foo;
- m() => foo;
- }
- ''', const Visit(VisitKind.VISIT_THIS_PROPERTY_GET, name: 'foo')),
- const Test.clazz('''
- class C {
- var foo;
- m() => this.foo;
- }
- ''', const Visit(VisitKind.VISIT_THIS_PROPERTY_GET, name: 'foo')),
- const Test.clazz('''
- class C {
- get foo => null;
- m() => foo;
- }
- ''', const Visit(VisitKind.VISIT_THIS_PROPERTY_GET, name: 'foo')),
- const Test.clazz(
- '''
- class C {
- var foo;
- static m() => this.foo;
- }
- ''',
- const Visit(VisitKind.ERROR_INVALID_GET,
- error: MessageKind.NO_THIS_AVAILABLE)),
- const Test.clazz('''
- class C {
- get foo => null;
- m() => this.foo;
- }
- ''', const Visit(VisitKind.VISIT_THIS_PROPERTY_GET, name: 'foo')),
- const Test.clazz('''
- class C {
- var foo;
- m() { foo = 42; }
- }
- ''',
- const Visit(VisitKind.VISIT_THIS_PROPERTY_SET, name: 'foo', rhs: '42')),
- const Test.clazz('''
- class C {
- var foo;
- m() { this.foo = 42; }
- }
- ''',
- const Visit(VisitKind.VISIT_THIS_PROPERTY_SET, name: 'foo', rhs: '42')),
- const Test.clazz('''
- class C {
- set foo(_) {}
- m() { foo = 42; }
- }
- ''',
- const Visit(VisitKind.VISIT_THIS_PROPERTY_SET, name: 'foo', rhs: '42')),
- const Test.clazz('''
- class C {
- set foo(_) {}
- m() { this.foo = 42; }
- }
- ''',
- const Visit(VisitKind.VISIT_THIS_PROPERTY_SET, name: 'foo', rhs: '42')),
- const Test.clazz(
- '''
- class C {
- var foo;
- m() { foo(null, 42); }
- }
- ''',
- const Visit(VisitKind.VISIT_THIS_PROPERTY_INVOKE,
- name: 'foo', arguments: '(null,42)')),
- const Test.clazz(
- '''
- class C {
- var foo;
- m() { this.foo(null, 42); }
- }
- ''',
- const Visit(VisitKind.VISIT_THIS_PROPERTY_INVOKE,
- name: 'foo', arguments: '(null,42)')),
- const Test.clazz(
- '''
- class C {
- var foo;
- static m() { this.foo(null, 42); }
- }
- ''',
- const Visit(VisitKind.ERROR_INVALID_INVOKE,
- error: MessageKind.NO_THIS_AVAILABLE, arguments: '(null,42)')),
- ],
- 'Super fields': const [
- // Super fields
- const Test.clazz('''
- class B {
- var o;
- }
- class C extends B {
- m() => super.o;
- }
- ''',
- const Visit(VisitKind.VISIT_SUPER_FIELD_GET, element: 'field(B#o)')),
- const Test.clazz(
- '''
- class B {
- var o;
- }
- class C extends B {
- m() { super.o = 42; }
- }
- ''',
- const Visit(VisitKind.VISIT_SUPER_FIELD_SET,
- element: 'field(B#o)', rhs: '42')),
- const Test.clazz(
- '''
- class B {
- final o = 0;
- }
- class C extends B {
- m() { super.o = 42; }
- }
- ''',
- const Visit(VisitKind.VISIT_FINAL_SUPER_FIELD_SET,
- element: 'field(B#o)', rhs: '42')),
- const Test.clazz(
- '''
- class B {
- var o;
- }
- class C extends B {
- m() { super.o(null, 42); }
- }
- ''',
- const Visit(VisitKind.VISIT_SUPER_FIELD_INVOKE,
- element: 'field(B#o)', arguments: '(null,42)')),
- const Test.clazz('''
- class B {
- }
- class C extends B {
- m() => super.o;
- }
- ''', const Visit(VisitKind.VISIT_UNRESOLVED_SUPER_GET)),
- const Test.clazz('''
- class B {
- }
- class C extends B {
- m() => super.o = 42;
- }
- ''', const Visit(VisitKind.VISIT_UNRESOLVED_SUPER_SET, rhs: '42')),
- ],
- 'Super properties': const [
- // Super properties
- const Test.clazz('''
- class B {
- get o => null;
- }
- class C extends B {
- m() => super.o;
- }
- ''',
- const Visit(VisitKind.VISIT_SUPER_GETTER_GET, element: 'getter(B#o)')),
- const Test.clazz('''
- class B {
- set o(_) {}
- }
- class C extends B {
- m() => super.o;
- }
- ''',
- const Visit(VisitKind.VISIT_SUPER_SETTER_GET, element: 'setter(B#o)')),
- const Test.clazz(
- '''
- class B {
- get o => 0;
- }
- class C extends B {
- m() { super.o = 42; }
- }
- ''',
- const Visit(VisitKind.VISIT_SUPER_GETTER_SET,
- element: 'getter(B#o)', rhs: '42')),
- const Test.clazz(
- '''
- class B {
- set o(_) {}
- }
- class C extends B {
- m() { super.o = 42; }
- }
- ''',
- const Visit(VisitKind.VISIT_SUPER_SETTER_SET,
- element: 'setter(B#o)', rhs: '42')),
- const Test.clazz(
- '''
- class B {
- get o => null;
- }
- class C extends B {
- m() { super.o(null, 42); }
- }
- ''',
- const Visit(VisitKind.VISIT_SUPER_GETTER_INVOKE,
- element: 'getter(B#o)', arguments: '(null,42)')),
- const Test.clazz(
- '''
- class B {
- set o(_) {}
- }
- class C extends B {
- m() { super.o(null, 42); }
- }
- ''',
- const Visit(VisitKind.VISIT_SUPER_SETTER_INVOKE,
- element: 'setter(B#o)', arguments: '(null,42)')),
- ],
- 'Super methods': const [
- // Super methods
- const Test.clazz(
- '''
- class B {
- o(a, b) {}
- }
- class C extends B {
- m() => super.o;
- }
- ''',
- const Visit(VisitKind.VISIT_SUPER_METHOD_GET,
- element: 'function(B#o)')),
- const Test.clazz(
- '''
- class B {
- o(a, b) {}
- }
- class C extends B {
- m() { super.o = 42; }
- }
- ''',
- const Visit(VisitKind.VISIT_SUPER_METHOD_SET,
- element: 'function(B#o)', rhs: '42')),
- const Test.clazz(
- '''
- class B {
- o(a, b) {}
- }
- class C extends B {
- m() { super.o(null, 42); }
- }
- ''',
- const Visit(VisitKind.VISIT_SUPER_METHOD_INVOKE,
- element: 'function(B#o)', arguments: '(null,42)')),
- const Test.clazz(
- '''
- class B {
- o(a, b) {}
- }
- class C extends B {
- m() { super.o(null); }
- }
- ''',
- const Visit(VisitKind.VISIT_SUPER_METHOD_INCOMPATIBLE_INVOKE,
- element: 'function(B#o)', arguments: '(null)')),
- const Test.clazz(
- '''
- class B {
- }
- class C extends B {
- m() => super.o(null, 42);
- }
- ''',
- const Visit(VisitKind.VISIT_UNRESOLVED_SUPER_INVOKE,
- arguments: '(null,42)')),
- ],
- 'Expression invoke': const [
- // Expression invoke
- const Test(
- 'm() => (a, b){}(null, 42);',
- const Visit(VisitKind.VISIT_EXPRESSION_INVOKE,
- receiver: '(a,b){}', arguments: '(null,42)')),
- ],
- 'Class type literals': const [
- // Class type literals
- const Test('''
- class C {}
- m() => C;
- ''',
- const Visit(VisitKind.VISIT_CLASS_TYPE_LITERAL_GET, constant: 'C')),
- const Test(
- '''
- class C {}
- m() => C(null, 42);
- ''',
- const Visit(VisitKind.VISIT_CLASS_TYPE_LITERAL_INVOKE,
- constant: 'C', arguments: '(null,42)')),
- const Test(
- '''
- class C {}
- m() => C = 42;
- ''',
- const Visit(VisitKind.VISIT_CLASS_TYPE_LITERAL_SET,
- constant: 'C', rhs: '42')),
- const Test(
- '''
- class C {}
- m() => C += 42;
- ''',
- const Visit(VisitKind.VISIT_CLASS_TYPE_LITERAL_COMPOUND,
- constant: 'C', operator: '+=', rhs: '42')),
- const Test(
- '''
- class C {}
- m() => C ??= 42;
- ''',
- const Visit(VisitKind.VISIT_CLASS_TYPE_LITERAL_SET_IF_NULL,
- constant: 'C', rhs: '42')),
- const Test(
- '''
- class C {}
- m() => ++C;
- ''',
- const Visit(VisitKind.VISIT_CLASS_TYPE_LITERAL_PREFIX,
- constant: 'C', operator: '++')),
- const Test(
- '''
- class C {}
- m() => C--;
- ''',
- const Visit(VisitKind.VISIT_CLASS_TYPE_LITERAL_POSTFIX,
- constant: 'C', operator: '--')),
- const Test('''
- class C {}
- m() => (C).hashCode;
- ''', const [
- const Visit(VisitKind.VISIT_DYNAMIC_PROPERTY_GET,
- receiver: '(C)', name: 'hashCode'),
- const Visit(VisitKind.VISIT_CLASS_TYPE_LITERAL_GET, constant: 'C'),
- ]),
- ],
- 'Typedef type literals': const [
- // Typedef type literals
- const Test('''
- typedef F();
- m() => F;
- ''',
- const Visit(VisitKind.VISIT_TYPEDEF_TYPE_LITERAL_GET, constant: 'F')),
- const Test(
- '''
- typedef F();
- m() => F(null, 42);
- ''',
- const Visit(VisitKind.VISIT_TYPEDEF_TYPE_LITERAL_INVOKE,
- constant: 'F', arguments: '(null,42)')),
- const Test(
- '''
- typedef F();
- m() => F = 42;
- ''',
- const Visit(VisitKind.VISIT_TYPEDEF_TYPE_LITERAL_SET,
- constant: 'F', rhs: '42')),
- const Test(
- '''
- typedef F();
- m() => F += 42;
- ''',
- const Visit(VisitKind.VISIT_TYPEDEF_TYPE_LITERAL_COMPOUND,
- constant: 'F', operator: '+=', rhs: '42')),
- const Test(
- '''
- typedef F();
- m() => F ??= 42;
- ''',
- const Visit(VisitKind.VISIT_TYPEDEF_TYPE_LITERAL_SET_IF_NULL,
- constant: 'F', rhs: '42')),
- const Test(
- '''
- typedef F();
- m() => ++F;
- ''',
- const Visit(VisitKind.VISIT_TYPEDEF_TYPE_LITERAL_PREFIX,
- constant: 'F', operator: '++')),
- const Test(
- '''
- typedef F();
- m() => F--;
- ''',
- const Visit(VisitKind.VISIT_TYPEDEF_TYPE_LITERAL_POSTFIX,
- constant: 'F', operator: '--')),
- ],
- 'Type variable type literals': const [
- // Type variable type literals
- const Test.clazz(
- '''
- class C<T> {
- m() => T;
- }
- ''',
- const Visit(VisitKind.VISIT_TYPE_VARIABLE_TYPE_LITERAL_GET,
- element: 'type_variable(C#T)')),
- const Test.clazz(
- '''
- class C<T> {
- m() => T(null, 42);
- }
- ''',
- const Visit(VisitKind.VISIT_TYPE_VARIABLE_TYPE_LITERAL_INVOKE,
- element: 'type_variable(C#T)', arguments: '(null,42)')),
- const Test.clazz(
- '''
- class C<T> {
- m() => T = 42;
- }
- ''',
- const Visit(VisitKind.VISIT_TYPE_VARIABLE_TYPE_LITERAL_SET,
- element: 'type_variable(C#T)', rhs: '42')),
- const Test.clazz(
- '''
- class C<T> {
- m() => T += 42;
- }
- ''',
- const Visit(VisitKind.VISIT_TYPE_VARIABLE_TYPE_LITERAL_COMPOUND,
- element: 'type_variable(C#T)', operator: '+=', rhs: '42')),
- const Test.clazz(
- '''
- class C<T> {
- m() => T ??= 42;
- }
- ''',
- const Visit(VisitKind.VISIT_TYPE_VARIABLE_TYPE_LITERAL_SET_IF_NULL,
- element: 'type_variable(C#T)', rhs: '42')),
- const Test.clazz(
- '''
- class C<T> {
- m() => ++T;
- }
- ''',
- const Visit(VisitKind.VISIT_TYPE_VARIABLE_TYPE_LITERAL_PREFIX,
- element: 'type_variable(C#T)', operator: '++')),
- const Test.clazz(
- '''
- class C<T> {
- m() => T--;
- }
- ''',
- const Visit(VisitKind.VISIT_TYPE_VARIABLE_TYPE_LITERAL_POSTFIX,
- element: 'type_variable(C#T)', operator: '--')),
- const Test.clazz(
- '''
- class C<T> {
- static m() => T;
- }
- ''',
- const Visit(VisitKind.ERROR_INVALID_GET,
- error: MessageKind.TYPE_VARIABLE_WITHIN_STATIC_MEMBER)),
- const Test.clazz(
- '''
- class C<T> {
- static m() => T(null, 42);
- }
- ''',
- const Visit(VisitKind.ERROR_INVALID_INVOKE,
- error: MessageKind.TYPE_VARIABLE_WITHIN_STATIC_MEMBER,
- arguments: '(null,42)')),
- const Test.clazz(
- '''
- class C<T> {
- static m() => T ??= 42;
- }
- ''',
- const Visit(VisitKind.ERROR_INVALID_SET_IF_NULL,
- error: MessageKind.TYPE_VARIABLE_WITHIN_STATIC_MEMBER, rhs: '42')),
- const Test.clazz(
- '''
- class C<T> {
- static m() => T ??= 42;
- }
- ''',
- const Visit(VisitKind.ERROR_INVALID_SET_IF_NULL,
- error: MessageKind.TYPE_VARIABLE_WITHIN_STATIC_MEMBER, rhs: '42')),
- const Test.clazz(
- '''
- class C<T> {
- static m() => ++T;
- }
- ''',
- const Visit(VisitKind.ERROR_INVALID_PREFIX,
- error: MessageKind.TYPE_VARIABLE_WITHIN_STATIC_MEMBER,
- operator: '++')),
- const Test.clazz(
- '''
- class C<T> {
- static m() => T--;
- }
- ''',
- const Visit(VisitKind.ERROR_INVALID_POSTFIX,
- error: MessageKind.TYPE_VARIABLE_WITHIN_STATIC_MEMBER,
- operator: '--')),
- ],
- 'Dynamic type literals': const [
- // Dynamic type literals
- const Test(
- '''
- m() => dynamic;
- ''',
- const Visit(VisitKind.VISIT_DYNAMIC_TYPE_LITERAL_GET,
- constant: 'dynamic')),
- const Test(
- '''
- m() { dynamic(null, 42); }
- ''',
- const Visit(VisitKind.VISIT_DYNAMIC_TYPE_LITERAL_INVOKE,
- constant: 'dynamic', arguments: '(null,42)')),
- const Test(
- '''
- m() => dynamic = 42;
- ''',
- const Visit(VisitKind.VISIT_DYNAMIC_TYPE_LITERAL_SET,
- constant: 'dynamic', rhs: '42')),
- const Test(
- '''
- m() => dynamic += 42;
- ''',
- const Visit(VisitKind.VISIT_DYNAMIC_TYPE_LITERAL_COMPOUND,
- constant: 'dynamic', operator: '+=', rhs: '42')),
- const Test(
- '''
- m() => dynamic ??= 42;
- ''',
- const Visit(VisitKind.VISIT_DYNAMIC_TYPE_LITERAL_SET_IF_NULL,
- constant: 'dynamic', rhs: '42')),
- const Test(
- '''
- m() => ++dynamic;
- ''',
- const Visit(VisitKind.VISIT_DYNAMIC_TYPE_LITERAL_PREFIX,
- constant: 'dynamic', operator: '++')),
- const Test(
- '''
- m() => dynamic--;
- ''',
- const Visit(VisitKind.VISIT_DYNAMIC_TYPE_LITERAL_POSTFIX,
- constant: 'dynamic', operator: '--')),
- ],
- 'Assert': const [
- // Assert
- const Test(
- '''
- m() { assert(m()); }
- ''',
- const Visit(VisitKind.VISIT_TOP_LEVEL_FUNCTION_INVOKE,
- element: 'function(m)', arguments: '()')),
- ],
- 'Logical and': const [
- // Logical and
- const Test('''
- m() => true && false;
- ''',
- const Visit(VisitKind.VISIT_LOGICAL_AND, left: 'true', right: 'false')),
- ],
- 'Logical or': const [
- // Logical or
- const Test('''
- m() => true || false;
- ''',
- const Visit(VisitKind.VISIT_LOGICAL_OR, left: 'true', right: 'false')),
- ],
- 'Is test': const [
- // Is test
- const Test('''
- class C {}
- m() => 0 is C;
- ''', const Visit(VisitKind.VISIT_IS, expression: '0', type: 'C')),
- ],
- 'Is not test': const [
- // Is not test
- const Test('''
- class C {}
- m() => 0 is! C;
- ''', const Visit(VisitKind.VISIT_IS_NOT, expression: '0', type: 'C')),
- ],
- 'As test': const [
- // As test
- const Test('''
- class C {}
- m() => 0 as C;
- ''', const Visit(VisitKind.VISIT_AS, expression: '0', type: 'C')),
- ],
- 'Binary operators': const [
- // Binary operators
- const Test(
- '''
- m() => 2 + 3;
- ''',
- const Visit(VisitKind.VISIT_BINARY,
- left: '2', operator: '+', right: '3')),
- const Test(
- '''
- m() => 2 - 3;
- ''',
- const Visit(VisitKind.VISIT_BINARY,
- left: '2', operator: '-', right: '3')),
- const Test(
- '''
- m() => 2 * 3;
- ''',
- const Visit(VisitKind.VISIT_BINARY,
- left: '2', operator: '*', right: '3')),
- const Test(
- '''
- m() => 2 / 3;
- ''',
- const Visit(VisitKind.VISIT_BINARY,
- left: '2', operator: '/', right: '3')),
- const Test(
- '''
- m() => 2 ~/ 3;
- ''',
- const Visit(VisitKind.VISIT_BINARY,
- left: '2', operator: '~/', right: '3')),
- const Test(
- '''
- m() => 2 % 3;
- ''',
- const Visit(VisitKind.VISIT_BINARY,
- left: '2', operator: '%', right: '3')),
- const Test(
- '''
- m() => 2 << 3;
- ''',
- const Visit(VisitKind.VISIT_BINARY,
- left: '2', operator: '<<', right: '3')),
- const Test(
- '''
- m() => 2 >> 3;
- ''',
- const Visit(VisitKind.VISIT_BINARY,
- left: '2', operator: '>>', right: '3')),
- const Test(
- '''
- m() => 2 <= 3;
- ''',
- const Visit(VisitKind.VISIT_BINARY,
- left: '2', operator: '<=', right: '3')),
- const Test(
- '''
- m() => 2 < 3;
- ''',
- const Visit(VisitKind.VISIT_BINARY,
- left: '2', operator: '<', right: '3')),
- const Test(
- '''
- m() => 2 >= 3;
- ''',
- const Visit(VisitKind.VISIT_BINARY,
- left: '2', operator: '>=', right: '3')),
- const Test(
- '''
- m() => 2 > 3;
- ''',
- const Visit(VisitKind.VISIT_BINARY,
- left: '2', operator: '>', right: '3')),
- const Test(
- '''
- m() => 2 & 3;
- ''',
- const Visit(VisitKind.VISIT_BINARY,
- left: '2', operator: '&', right: '3')),
- const Test(
- '''
- m() => 2 | 3;
- ''',
- const Visit(VisitKind.VISIT_BINARY,
- left: '2', operator: '|', right: '3')),
- const Test(
- '''
- m() => 2 ^ 3;
- ''',
- const Visit(VisitKind.VISIT_BINARY,
- left: '2', operator: '^', right: '3')),
- const Test.clazz(
- '''
- class B {
- operator +(_) => null;
- }
- class C extends B {
- m() => super + 42;
- }
- ''',
- const Visit(VisitKind.VISIT_SUPER_BINARY,
- element: 'function(B#+)', operator: '+', right: '42')),
- const Test.clazz(
- '''
- class B {}
- class C extends B {
- m() => super + 42;
- }
- ''',
- const Visit(VisitKind.VISIT_UNRESOLVED_SUPER_BINARY,
- operator: '+', right: '42')),
- const Test(
- '''
- m() => 2 === 3;
- ''',
- const Visit(VisitKind.ERROR_UNDEFINED_BINARY_EXPRESSION,
- left: '2', operator: '===', right: '3')),
- const Test(
- '''
- m() => 2 !== 3;
- ''',
- const Visit(VisitKind.ERROR_UNDEFINED_BINARY_EXPRESSION,
- left: '2', operator: '!==', right: '3')),
- const Test.clazz(
- '''
- class B {
- operator +(_) => null;
- }
- class C extends B {
- static m() => super + 42;
- }
- ''',
- const Visit(VisitKind.ERROR_INVALID_BINARY,
- error: MessageKind.NO_SUPER_IN_STATIC, operator: '+', right: '42')),
- ],
- 'Index': const [
- // Index
- const Test('''
- m() => 2[3];
- ''', const Visit(VisitKind.VISIT_INDEX, receiver: '2', index: '3')),
- const Test(
- '''
- m() => --2[3];
- ''',
- const Visit(VisitKind.VISIT_INDEX_PREFIX,
- receiver: '2', index: '3', operator: '--')),
- const Test(
- '''
- m() => 2[3]++;
- ''',
- const Visit(VisitKind.VISIT_INDEX_POSTFIX,
- receiver: '2', index: '3', operator: '++')),
- const Test.clazz(
- '''
- class B {
- operator [](_) => null;
- }
- class C extends B {
- m() => super[42];
- }
- ''',
- const Visit(VisitKind.VISIT_SUPER_INDEX,
- element: 'function(B#[])', index: '42')),
- const Test.clazz('''
- class B {
- }
- class C extends B {
- m() => super[42];
- }
- ''', const Visit(VisitKind.VISIT_UNRESOLVED_SUPER_INDEX, index: '42')),
- const Test.clazz(
- '''
- class B {
- operator [](_) => null;
- }
- class C extends B {
- static m() => super[42];
- }
- ''',
- const Visit(VisitKind.ERROR_INVALID_INDEX,
- error: MessageKind.NO_SUPER_IN_STATIC, index: '42')),
- const Test.clazz(
- '''
- class B {
- operator [](_) => null;
- operator []=(a, b) {}
- }
- class C extends B {
- m() => ++super[42];
- }
- ''',
- const Visit(VisitKind.VISIT_SUPER_INDEX_PREFIX,
- getter: 'function(B#[])',
- setter: 'function(B#[]=)',
- index: '42',
- operator: '++')),
- const Test.clazz(
- '''
- class B {
- operator []=(a, b) {}
- }
- class C extends B {
- m() => ++super[42];
- }
- ''',
- const Visit(VisitKind.VISIT_UNRESOLVED_SUPER_GETTER_INDEX_PREFIX,
- setter: 'function(B#[]=)', index: '42', operator: '++')),
- const Test.clazz(
- '''
- class B {
- }
- class C extends B {
- m() => ++super[42];
- }
- ''',
- const Visit(VisitKind.VISIT_UNRESOLVED_SUPER_INDEX_PREFIX,
- index: '42', operator: '++')),
- const Test.clazz(
- '''
- class B {
- operator [](_) => null;
- }
- class C extends B {
- m() => ++super[42];
- }
- ''',
- const Visit(VisitKind.VISIT_UNRESOLVED_SUPER_SETTER_INDEX_PREFIX,
- getter: 'function(B#[])', index: '42', operator: '++')),
- const Test.clazz(
- '''
- class B {
- operator [](_) => null;
- operator []=(a, b) {}
- }
- class C extends B {
- static m() => ++super[42];
- }
- ''',
- const Visit(VisitKind.ERROR_INVALID_INDEX_PREFIX,
- error: MessageKind.NO_SUPER_IN_STATIC,
- index: '42',
- operator: '++')),
- const Test.clazz(
- '''
- class B {
- operator [](_) => null;
- operator []=(a, b) {}
- }
- class C extends B {
- m() => super[42]--;
- }
- ''',
- const Visit(VisitKind.VISIT_SUPER_INDEX_POSTFIX,
- getter: 'function(B#[])',
- setter: 'function(B#[]=)',
- index: '42',
- operator: '--')),
- const Test.clazz(
- '''
- class B {
- operator []=(a, b) {}
- }
- class C extends B {
- m() => super[42]--;
- }
- ''',
- const Visit(VisitKind.VISIT_UNRESOLVED_SUPER_GETTER_INDEX_POSTFIX,
- setter: 'function(B#[]=)', index: '42', operator: '--')),
- const Test.clazz(
- '''
- class B {
- }
- class C extends B {
- m() => super[42]--;
- }
- ''',
- const Visit(VisitKind.VISIT_UNRESOLVED_SUPER_INDEX_POSTFIX,
- index: '42', operator: '--')),
- const Test.clazz(
- '''
- class B {
- operator [](_) => null;
- }
- class C extends B {
- m() => super[42]--;
- }
- ''',
- const Visit(VisitKind.VISIT_UNRESOLVED_SUPER_SETTER_INDEX_POSTFIX,
- getter: 'function(B#[])', index: '42', operator: '--')),
- const Test.clazz(
- '''
- class B {
- operator [](_) => null;
- operator []=(a, b) {}
- }
- class C extends B {
- static m() => super[42]--;
- }
- ''',
- const Visit(VisitKind.ERROR_INVALID_INDEX_POSTFIX,
- error: MessageKind.NO_SUPER_IN_STATIC,
- index: '42',
- operator: '--')),
- const Test(
- '''
- m() => [][42] ??= 0;
- ''',
- const Visit(VisitKind.VISIT_INDEX_SET_IF_NULL,
- receiver: '[] ', index: '42', rhs: '0')),
- const Test.clazz(
- '''
- class B {
- operator [](_) => null;
- operator []=(a, b) {}
- }
- class C extends B {
- m() => super[42] ??= 0;
- }
- ''',
- const Visit(VisitKind.VISIT_SUPER_INDEX_SET_IF_NULL,
- getter: 'function(B#[])',
- setter: 'function(B#[]=)',
- index: '42',
- rhs: '0')),
- const Test.clazz(
- '''
- class B {
- operator []=(a, b) {}
- }
- class C extends B {
- m() => super[42] ??= 0;
- }
- ''',
- const Visit(VisitKind.VISIT_UNRESOLVED_SUPER_GETTER_INDEX_SET_IF_NULL,
- setter: 'function(B#[]=)', index: '42', rhs: '0')),
- const Test.clazz(
- '''
- class B {
- operator [](_) => null;
- }
- class C extends B {
- m() => super[42] ??= 0;
- }
- ''',
- const Visit(VisitKind.VISIT_UNRESOLVED_SUPER_SETTER_INDEX_SET_IF_NULL,
- getter: 'function(B#[])', index: '42', rhs: '0')),
- const Test.clazz(
- '''
- class B {
- }
- class C extends B {
- m() => super[42] ??= 0;
- }
- ''',
- const Visit(VisitKind.VISIT_UNRESOLVED_SUPER_INDEX_SET_IF_NULL,
- index: '42', rhs: '0')),
- ],
- 'Equals': const [
- // Equals
- const Test('''
- m() => 2 == 3;
- ''', const Visit(VisitKind.VISIT_EQUALS, left: '2', right: '3')),
- const Test.clazz(
- '''
- class B {
- operator ==(_) => null;
- }
- class C extends B {
- m() => super == 42;
- }
- ''',
- const Visit(VisitKind.VISIT_SUPER_EQUALS,
- element: 'function(B#==)', right: '42')),
- const Test.clazz(
- '''
- class B {
- operator ==(_) => null;
- }
- class C extends B {
- static m() => super == 42;
- }
- ''',
- const Visit(VisitKind.ERROR_INVALID_EQUALS,
- error: MessageKind.NO_SUPER_IN_STATIC, right: '42')),
- ],
- 'Not equals': const [
- // Not equals
- const Test('''
- m() => 2 != 3;
- ''', const Visit(VisitKind.VISIT_NOT_EQUALS, left: '2', right: '3')),
- const Test.clazz(
- '''
- class B {
- operator ==(_) => null;
- }
- class C extends B {
- m() => super != 42;
- }
- ''',
- const Visit(VisitKind.VISIT_SUPER_NOT_EQUALS,
- element: 'function(B#==)', right: '42')),
- const Test.clazz(
- '''
- class B {
- operator ==(_) => null;
- }
- class C extends B {
- static m() => super != 42;
- }
- ''',
- const Visit(VisitKind.ERROR_INVALID_NOT_EQUALS,
- error: MessageKind.NO_SUPER_IN_STATIC, right: '42')),
- ],
- 'Unary expression': const [
- // Unary expression
- const Test('''
- m() => -false;
- ''',
- const Visit(VisitKind.VISIT_UNARY, expression: 'false', operator: '-')),
- const Test('''
- m() => ~false;
- ''',
- const Visit(VisitKind.VISIT_UNARY, expression: 'false', operator: '~')),
- const Test.clazz(
- '''
- class B {
- operator -() => null;
- }
- class C extends B {
- m() => -super;
- }
- ''',
- const Visit(VisitKind.VISIT_SUPER_UNARY,
- element: 'function(B#unary-)', operator: '-')),
- const Test.clazz('''
- class B {
- }
- class C extends B {
- m() => -super;
- }
- ''',
- const Visit(VisitKind.VISIT_UNRESOLVED_SUPER_UNARY, operator: '-')),
- const Test.clazz(
- '''
- class B {
- operator ~() => null;
- }
- class C extends B {
- m() => ~super;
- }
- ''',
- const Visit(VisitKind.VISIT_SUPER_UNARY,
- element: 'function(B#~)', operator: '~')),
- const Test.clazz(
- '''
- class B {
- operator -() => null;
- }
- class C extends B {
- static m() => -super;
- }
- ''',
- const Visit(VisitKind.ERROR_INVALID_UNARY,
- error: MessageKind.NO_SUPER_IN_STATIC, operator: '-')),
- const Test('''
- m() => !0;
- ''', const Visit(VisitKind.VISIT_NOT, expression: '0')),
- ],
- 'Index set': const [
- // Index set
- const Test(
- '''
- m() => 0[1] = 2;
- ''',
- const Visit(VisitKind.VISIT_INDEX_SET,
- receiver: '0', index: '1', rhs: '2')),
- const Test.clazz(
- '''
- class B {
- operator []=(a, b) {}
- }
- class C extends B {
- m() => super[1] = 2;
- }
- ''',
- const Visit(VisitKind.VISIT_SUPER_INDEX_SET,
- element: 'function(B#[]=)', index: '1', rhs: '2')),
- const Test.clazz(
- '''
- class B {
- }
- class C extends B {
- m() => super[1] = 2;
- }
- ''',
- const Visit(VisitKind.VISIT_UNRESOLVED_SUPER_INDEX_SET,
- index: '1', rhs: '2')),
- const Test.clazz(
- '''
- class B {
- operator []=(a, b) {}
- }
- class C extends B {
- static m() => super[1] = 2;
- }
- ''',
- const Visit(VisitKind.ERROR_INVALID_INDEX_SET,
- error: MessageKind.NO_SUPER_IN_STATIC, index: '1', rhs: '2')),
- ],
- 'Compound assignment': const [
- // Compound assignment
- const Test('''
- m(a) => a.b += 42;
- ''', const [
- const Visit(VisitKind.VISIT_DYNAMIC_PROPERTY_COMPOUND,
- receiver: 'a', name: 'b', operator: '+=', rhs: '42'),
- const Visit(VisitKind.VISIT_PARAMETER_GET, element: 'parameter(m#a)')
- ]),
- const Test(
- '''
- m(a) => a += 42;
- ''',
- const Visit(VisitKind.VISIT_PARAMETER_COMPOUND,
- element: 'parameter(m#a)', operator: '+=', rhs: '42')),
- const Test(
- '''
- m(final a) => a += 42;
- ''',
- const Visit(VisitKind.VISIT_FINAL_PARAMETER_COMPOUND,
- element: 'parameter(m#a)', operator: '+=', rhs: '42')),
- const Test(
- '''
- m() {
- var a;
- a += 42;
- }
- ''',
- const Visit(VisitKind.VISIT_LOCAL_VARIABLE_COMPOUND,
- element: 'variable(m#a)', operator: '+=', rhs: '42')),
- const Test(
- '''
- m() {
- final a = 0;
- a += 42;
- }
- ''',
- const Visit(VisitKind.VISIT_FINAL_LOCAL_VARIABLE_COMPOUND,
- element: 'variable(m#a)', operator: '+=', rhs: '42')),
- const Test(
- '''
- m() {
- a() {}
- a += 42;
- }
- ''',
- const Visit(VisitKind.VISIT_LOCAL_FUNCTION_COMPOUND,
- element: 'function(m#a)', operator: '+=', rhs: '42')),
- const Test(
- '''
- var a;
- m() => a += 42;
- ''',
- const Visit(VisitKind.VISIT_TOP_LEVEL_FIELD_COMPOUND,
- element: 'field(a)', operator: '+=', rhs: '42')),
- const Test(
- '''
- get a => 0;
- set a(_) {}
- m() => a += 42;
- ''',
- const Visit(VisitKind.VISIT_TOP_LEVEL_GETTER_SETTER_COMPOUND,
- getter: 'getter(a)',
- setter: 'setter(a)',
- operator: '+=',
- rhs: '42')),
- const Test(
- '''
- class C {
- static var a;
- }
- m() => C.a += 42;
- ''',
- const Visit(VisitKind.VISIT_STATIC_FIELD_COMPOUND,
- element: 'field(C#a)', operator: '+=', rhs: '42')),
- const Test.clazz(
- '''
- class C {
- static var a;
- m() => C.a += 42;
- }
- ''',
- const Visit(VisitKind.VISIT_STATIC_FIELD_COMPOUND,
- element: 'field(C#a)', operator: '+=', rhs: '42')),
- const Test.clazz(
- '''
- class C {
- static var a;
- m() => a += 42;
- }
- ''',
- const Visit(VisitKind.VISIT_STATIC_FIELD_COMPOUND,
- element: 'field(C#a)', operator: '+=', rhs: '42')),
- const Test.prefix(
- '''
- class C {
- static var a;
- }
- ''',
- '''
- m() => p.C.a += 42;
- ''',
- const Visit(VisitKind.VISIT_STATIC_FIELD_COMPOUND,
- element: 'field(C#a)', operator: '+=', rhs: '42')),
- const Test.clazz(
- '''
- class C {
- var o;
- static m() { o += 42; }
- }
- ''',
- const Visit(VisitKind.ERROR_INVALID_COMPOUND,
- error: MessageKind.NO_INSTANCE_AVAILABLE,
- operator: '+=',
- rhs: '42')),
- const Test.prefix(
- '''
- ''',
- '''
- m() { p += 42; }
- ''',
- const Visit(VisitKind.ERROR_INVALID_COMPOUND,
- error: MessageKind.PREFIX_AS_EXPRESSION,
- operator: '+=',
- rhs: '42')),
- const Test(
- '''
- class C {
- static get a => 0;
- static set a(_) {}
- }
- m() => C.a += 42;
- ''',
- const Visit(VisitKind.VISIT_STATIC_GETTER_SETTER_COMPOUND,
- getter: 'getter(C#a)',
- setter: 'setter(C#a)',
- operator: '+=',
- rhs: '42')),
- const Test.clazz(
- '''
- class C {
- static get a => 0;
- static set a(_) {}
- m() => C.a += 42;
- }
- ''',
- const Visit(VisitKind.VISIT_STATIC_GETTER_SETTER_COMPOUND,
- getter: 'getter(C#a)',
- setter: 'setter(C#a)',
- operator: '+=',
- rhs: '42')),
- const Test.clazz(
- '''
- class C {
- static get a => 0;
- static set a(_) {}
- m() => a += 42;
- }
- ''',
- const Visit(VisitKind.VISIT_STATIC_GETTER_SETTER_COMPOUND,
- getter: 'getter(C#a)',
- setter: 'setter(C#a)',
- operator: '+=',
- rhs: '42')),
- const Test.prefix(
- '''
- class C {
- static get a => 0;
- static set a(_) {}
- }
- ''',
- '''
- m() => p.C.a += 42;
- ''',
- const Visit(VisitKind.VISIT_STATIC_GETTER_SETTER_COMPOUND,
- getter: 'getter(C#a)',
- setter: 'setter(C#a)',
- operator: '+=',
- rhs: '42')),
- // TODO(johnniwinther): Enable these when dart2js supports method and setter
- // with the same name.
- /*const Test(
- '''
- class C {
- static a() {}
- static set a(_) {}
- }
- m() => C.a += 42;
- ''',
- const Visit(VisitKind.VISIT_STATIC_METHOD_SETTER_COMPOUND,
- getter: 'function(C#a)', setter: 'setter(C#a)',
- operator: '+=', rhs: '42')),
- const Test.clazz(
- '''
- class C {
- static a() {}
- static set a(_) {}
- m() => C.a += 42;
- }
- ''',
- const Visit(VisitKind.VISIT_STATIC_METHOD_SETTER_COMPOUND,
- getter: 'function(C#a)', setter: 'setter(C#a)',
- operator: '+=', rhs: '42')),
- const Test.clazz(
- '''
- class C {
- static a() {}
- static set a(_) {}
- m() => a += 42;
- }
- ''',
- const Visit(VisitKind.VISIT_STATIC_METHOD_SETTER_COMPOUND,
- getter: 'function(C#a)', setter: 'setter(C#a)',
- operator: '+=', rhs: '42')),
- const Test.prefix(
- '''
- class C {
- static a() {}
- static set a(_) {}
- }
- ''',
- '''
- m() => p.C.a += 42;
- ''',
- const Visit(VisitKind.VISIT_STATIC_METHOD_SETTER_COMPOUND,
- getter: 'function(C#a)', setter: 'setter(C#a)',
- operator: '+=', rhs: '42')),*/
- const Test.clazz(
- '''
- class C {
- var a;
- m() => a += 42;
- }
- ''',
- const Visit(VisitKind.VISIT_THIS_PROPERTY_COMPOUND,
- operator: '+=', name: 'a', rhs: '42')),
- const Test.clazz(
- '''
- class C {
- var a = 0;
- m() => this.a += 42;
- }
- ''',
- const Visit(VisitKind.VISIT_THIS_PROPERTY_COMPOUND,
- name: 'a', operator: '+=', rhs: '42')),
- const Test.clazz(
- '''
- class B {
- var a = 0;
- }
- class C extends B {
- m() => super.a += 42;
- }
- ''',
- const Visit(VisitKind.VISIT_SUPER_FIELD_COMPOUND,
- element: 'field(B#a)', operator: '+=', rhs: '42')),
- const Test.clazz(
- '''
- class B {
- final a = 0;
- }
- class C extends B {
- m() => super.a += 42;
- }
- ''',
- const Visit(VisitKind.VISIT_SUPER_FINAL_FIELD_COMPOUND,
- element: 'field(B#a)', operator: '+=', rhs: '42')),
- const Test.clazz(
- '''
- class B {
- get a => 0;
- set a (_) {}
- }
- class C extends B {
- m() => super.a += 42;
- }
- ''',
- const Visit(VisitKind.VISIT_SUPER_GETTER_SETTER_COMPOUND,
- getter: 'getter(B#a)',
- setter: 'setter(B#a)',
- operator: '+=',
- rhs: '42')),
- const Test.clazz(
- '''
- class A {
- get a => 0;
- }
- class B extends A {
- set a (_) {}
- }
- class C extends B {
- m() => super.a += 42;
- }
- ''',
- const Visit(VisitKind.VISIT_SUPER_GETTER_SETTER_COMPOUND,
- getter: 'getter(A#a)',
- setter: 'setter(B#a)',
- operator: '+=',
- rhs: '42')),
- const Test.clazz(
- '''
- class A {
- var a;
- }
- class B extends A {
- get a => 0;
- }
-
- class C extends B {
- m() => super.a += 42;
- }
- ''',
- const Visit(VisitKind.VISIT_SUPER_GETTER_FIELD_COMPOUND,
- getter: 'getter(B#a)',
- setter: 'field(A#a)',
- operator: '+=',
- rhs: '42')),
- const Test.clazz(
- '''
- class A {
- var a;
- }
- class B extends A {
- set a(_) {}
- }
-
- class C extends B {
- m() => super.a += 42;
- }
- ''',
- const Visit(VisitKind.VISIT_SUPER_FIELD_SETTER_COMPOUND,
- getter: 'field(A#a)',
- setter: 'setter(B#a)',
- operator: '+=',
- rhs: '42')),
- const Test.clazz(
- '''
- class A {
- var a;
- }
- class B extends A {
- final a = 0;
- }
-
- class C extends B {
- m() => super.a += 42;
- }
- ''',
- // TODO(johnniwinther): Change this to
- // [VISIT_SUPER_FIELD_FIELD_COMPOUND] when dart2js supports shadow
- // setters.
- const Visit(VisitKind.VISIT_SUPER_FINAL_FIELD_COMPOUND,
- element: 'field(B#a)', operator: '+=', rhs: '42')),
- const Test.clazz(
- '''
- class B {
- a() {}
- }
- class C extends B {
- m() => super.a += 42;
- }
- ''',
- const Visit(VisitKind.VISIT_SUPER_METHOD_COMPOUND,
- element: 'function(B#a)', operator: '+=', rhs: '42')),
- const Test.clazz(
- '''
- class B {
- }
- class C extends B {
- m() => super.a += 42;
- }
- ''',
- const Visit(VisitKind.VISIT_UNRESOLVED_SUPER_COMPOUND,
- operator: '+=', rhs: '42')),
- const Test.clazz(
- '''
- class B {
- set a(_) {}
- }
- class C extends B {
- m() => super.a += 42;
- }
- ''',
- const Visit(VisitKind.VISIT_UNRESOLVED_SUPER_GETTER_COMPOUND,
- setter: 'setter(B#a)', operator: '+=', rhs: '42')),
- const Test.clazz(
- '''
- class B {
- get a => 42;
- }
- class C extends B {
- m() => super.a += 42;
- }
- ''',
- const Visit(VisitKind.VISIT_UNRESOLVED_SUPER_SETTER_COMPOUND,
- getter: 'getter(B#a)', operator: '+=', rhs: '42')),
-
- const Test.clazz(
- '''
- class C {
- static set a(var value) { }
- m() => a += 42;
- }
- ''',
- const Visit(VisitKind.VISIT_UNRESOLVED_STATIC_GETTER_COMPOUND,
- setter: 'setter(C#a)', operator: '+=', rhs: '42')),
-
- const Test.clazz(
- '''
- class C {
- static get a => 42;
- m() => C.a += 42;
- }
- ''',
- const Visit(VisitKind.VISIT_UNRESOLVED_STATIC_SETTER_COMPOUND,
- getter: 'getter(C#a)', operator: '+=', rhs: '42')),
-
- const Test.clazz(
- '''
- class C {
- static final a = 42;
- m() => C.a += 42;
- }
- ''',
- const Visit(VisitKind.VISIT_STATIC_FINAL_FIELD_COMPOUND,
- element: 'field(C#a)', operator: '+=', rhs: '42')),
-
- const Test(
- '''
- class C {
- static a(var value) { }
- }
- m() => C.a += 42;
- ''',
- const Visit(VisitKind.VISIT_STATIC_METHOD_COMPOUND,
- element: 'function(C#a)', operator: '+=', rhs: '42')),
-
- const Test(
- '''
- set a(var value) { }
- m() => a += 42;
- ''',
- const Visit(VisitKind.VISIT_UNRESOLVED_TOP_LEVEL_GETTER_COMPOUND,
- setter: 'setter(a)', operator: '+=', rhs: '42')),
-
- const Test(
- '''
- get a => 42;
- m() => a += 42;
- ''',
- const Visit(VisitKind.VISIT_UNRESOLVED_TOP_LEVEL_SETTER_COMPOUND,
- getter: 'getter(a)', operator: '+=', rhs: '42')),
-
- const Test(
- '''
- a(var value) { }
- m() => a += 42;
- ''',
- const Visit(VisitKind.VISIT_TOP_LEVEL_METHOD_COMPOUND,
- element: 'function(a)', operator: '+=', rhs: '42')),
-
- const Test(
- '''
- final a = 42;
- m() => a += 42;
- ''',
- const Visit(VisitKind.VISIT_TOP_LEVEL_FINAL_FIELD_COMPOUND,
- element: 'field(a)', operator: '+=', rhs: '42')),
-
- const Test(
- '''
- m() => unresolved += 42;
- ''',
- const Visit(VisitKind.VISIT_UNRESOLVED_COMPOUND,
- operator: '+=', rhs: '42')),
- ],
- 'Compound index assignment': const [
- // Compound index assignment
- const Test(
- '''
- m() => 0[1] += 42;
- ''',
- const Visit(VisitKind.VISIT_COMPOUND_INDEX_SET,
- receiver: '0', index: '1', operator: '+=', rhs: '42')),
- const Test.clazz(
- '''
- class B {
- operator [](_) {}
- operator []=(a, b) {}
- }
- class C extends B {
- m() => super[1] += 42;
- }
- ''',
- const Visit(VisitKind.VISIT_SUPER_COMPOUND_INDEX_SET,
- getter: 'function(B#[])',
- setter: 'function(B#[]=)',
- index: '1',
- operator: '+=',
- rhs: '42')),
- const Test.clazz(
- '''
- class B {
- operator []=(a, b) {}
- }
- class C extends B {
- m() => super[1] += 42;
- }
- ''',
- const Visit(VisitKind.VISIT_UNRESOLVED_SUPER_GETTER_COMPOUND_INDEX_SET,
- setter: 'function(B#[]=)', index: '1', operator: '+=', rhs: '42')),
- const Test.clazz(
- '''
- class B {
- }
- class C extends B {
- m() => super[1] += 42;
- }
- ''',
- const Visit(VisitKind.VISIT_UNRESOLVED_SUPER_COMPOUND_INDEX_SET,
- index: '1', operator: '+=', rhs: '42')),
- const Test.clazz(
- '''
- class B {
- operator [](_) {}
- }
- class C extends B {
- m() => super[1] += 42;
- }
- ''',
- const Visit(VisitKind.VISIT_UNRESOLVED_SUPER_SETTER_COMPOUND_INDEX_SET,
- getter: 'function(B#[])', index: '1', operator: '+=', rhs: '42')),
- const Test.clazz(
- '''
- class B {
- operator [](_) {}
- operator []=(a, b) {}
- }
- class C extends B {
- static m() => super[1] += 42;
- }
- ''',
- const Visit(VisitKind.ERROR_INVALID_COMPOUND_INDEX_SET,
- error: MessageKind.NO_SUPER_IN_STATIC,
- index: '1',
- operator: '+=',
- rhs: '42')),
- ],
- 'Prefix expression': const [
- // Prefix expression
- const Test('''
- m(a) => --a.b;
- ''', const [
- const Visit(VisitKind.VISIT_DYNAMIC_PROPERTY_PREFIX,
- receiver: 'a', name: 'b', operator: '--'),
- const Visit(VisitKind.VISIT_PARAMETER_GET, element: 'parameter(m#a)')
- ]),
- const Test(
- '''
- m(a) => ++a;
- ''',
- const Visit(VisitKind.VISIT_PARAMETER_PREFIX,
- element: 'parameter(m#a)', operator: '++')),
- const Test(
- '''
- m(final a) => ++a;
- ''',
- const Visit(VisitKind.VISIT_FINAL_PARAMETER_PREFIX,
- element: 'parameter(m#a)', operator: '++')),
- const Test(
- '''
- m() {
- var a;
- --a;
- }
- ''',
- const Visit(VisitKind.VISIT_LOCAL_VARIABLE_PREFIX,
- element: 'variable(m#a)', operator: '--')),
- const Test(
- '''
- m() {
- final a = 42;
- --a;
- }
- ''',
- const Visit(VisitKind.VISIT_FINAL_LOCAL_VARIABLE_PREFIX,
- element: 'variable(m#a)', operator: '--')),
- const Test(
- '''
- m() {
- a() {}
- --a;
- }
- ''',
- const Visit(VisitKind.VISIT_LOCAL_FUNCTION_PREFIX,
- element: 'function(m#a)', operator: '--')),
- const Test(
- '''
- var a;
- m() => ++a;
- ''',
- const Visit(VisitKind.VISIT_TOP_LEVEL_FIELD_PREFIX,
- element: 'field(a)', operator: '++')),
- const Test(
- '''
- get a => 0;
- set a(_) {}
- m() => --a;
- ''',
- const Visit(VisitKind.VISIT_TOP_LEVEL_GETTER_SETTER_PREFIX,
- getter: 'getter(a)', setter: 'setter(a)', operator: '--')),
- const Test(
- '''
- class C {
- static var a;
- }
- m() => ++C.a;
- ''',
- const Visit(VisitKind.VISIT_STATIC_FIELD_PREFIX,
- element: 'field(C#a)', operator: '++')),
- const Test.clazz(
- '''
- class C {
- static var a;
- m() => ++C.a;
- }
- ''',
- const Visit(VisitKind.VISIT_STATIC_FIELD_PREFIX,
- element: 'field(C#a)', operator: '++')),
- const Test.clazz(
- '''
- class C {
- static var a;
- m() => --a;
- }
- ''',
- const Visit(VisitKind.VISIT_STATIC_FIELD_PREFIX,
- element: 'field(C#a)', operator: '--')),
- const Test.prefix(
- '''
- class C {
- static var a;
- }
- ''',
- '''
- m() => --p.C.a;
- ''',
- const Visit(VisitKind.VISIT_STATIC_FIELD_PREFIX,
- element: 'field(C#a)', operator: '--')),
- const Test.clazz(
- '''
- class C {
- var o;
- static m() { ++o; }
- }
- ''',
- const Visit(VisitKind.ERROR_INVALID_PREFIX,
- error: MessageKind.NO_INSTANCE_AVAILABLE, operator: '++')),
- const Test.prefix(
- '''
- ''',
- '''
- m() { ++p; }
- ''',
- const Visit(VisitKind.ERROR_INVALID_PREFIX,
- error: MessageKind.PREFIX_AS_EXPRESSION, operator: '++')),
- const Test(
- '''
- class C {
- static get a => 0;
- static set a(_) {}
- }
- m() => ++C.a;
- ''',
- const Visit(VisitKind.VISIT_STATIC_GETTER_SETTER_PREFIX,
- getter: 'getter(C#a)', setter: 'setter(C#a)', operator: '++')),
- const Test.clazz(
- '''
- class C {
- static get a => 0;
- static set a(_) {}
- m() => --C.a;
- }
- ''',
- const Visit(VisitKind.VISIT_STATIC_GETTER_SETTER_PREFIX,
- getter: 'getter(C#a)', setter: 'setter(C#a)', operator: '--')),
- const Test.clazz(
- '''
- class C {
- static get a => 0;
- static set a(_) {}
- m() => --a;
- }
- ''',
- const Visit(VisitKind.VISIT_STATIC_GETTER_SETTER_PREFIX,
- getter: 'getter(C#a)', setter: 'setter(C#a)', operator: '--')),
- const Test.prefix(
- '''
- class C {
- static get a => 0;
- static set a(_) {}
- }
- ''',
- '''
- m() => ++p.C.a;
- ''',
- const Visit(VisitKind.VISIT_STATIC_GETTER_SETTER_PREFIX,
- getter: 'getter(C#a)', setter: 'setter(C#a)', operator: '++')),
- const Test.clazz(
- '''
- class C {
- var a;
- m() => --a;
- }
- ''',
- const Visit(VisitKind.VISIT_THIS_PROPERTY_PREFIX,
- name: 'a', operator: '--')),
- const Test.clazz(
- '''
- class C {
- var a = 0;
- m() => ++this.a;
- }
- ''',
- const Visit(VisitKind.VISIT_THIS_PROPERTY_PREFIX,
- name: 'a', operator: '++')),
- const Test.clazz(
- '''
- class B {
- var a = 0;
- }
- class C extends B {
- m() => --super.a;
- }
- ''',
- const Visit(VisitKind.VISIT_SUPER_FIELD_PREFIX,
- element: 'field(B#a)', operator: '--')),
- const Test.clazz(
- '''
- class B {
- final a = 0;
- }
- class C extends B {
- m() => --super.a;
- }
- ''',
- const Visit(VisitKind.VISIT_SUPER_FINAL_FIELD_PREFIX,
- element: 'field(B#a)', operator: '--')),
- const Test.clazz(
- '''
- class B {
- get a => 0;
- set a (_) {}
- }
- class C extends B {
- m() => --super.a;
- }
- ''',
- const Visit(VisitKind.VISIT_SUPER_GETTER_SETTER_PREFIX,
- getter: 'getter(B#a)', setter: 'setter(B#a)', operator: '--')),
- const Test.clazz(
- '''
- class A {
- get a => 0;
- }
- class B extends A {
- set a (_) {}
- }
- class C extends B {
- m() => ++super.a;
- }
- ''',
- const Visit(VisitKind.VISIT_SUPER_GETTER_SETTER_PREFIX,
- getter: 'getter(A#a)', setter: 'setter(B#a)', operator: '++')),
- const Test.clazz(
- '''
- class A {
- var a;
- }
- class B extends A {
- get a => 0;
- }
-
- class C extends B {
- m() => --super.a;
- }
- ''',
- const Visit(VisitKind.VISIT_SUPER_GETTER_FIELD_PREFIX,
- getter: 'getter(B#a)', setter: 'field(A#a)', operator: '--')),
- const Test.clazz(
- '''
- class A {
- var a;
- }
- class B extends A {
- set a(_) {}
- }
-
- class C extends B {
- m() => ++super.a;
- }
- ''',
- const Visit(VisitKind.VISIT_SUPER_FIELD_SETTER_PREFIX,
- getter: 'field(A#a)', setter: 'setter(B#a)', operator: '++')),
- const Test.clazz(
- '''
- class B {
- a() {}
- }
- class C extends B {
- m() => ++super.a;
- }
- ''',
- const Visit(VisitKind.VISIT_SUPER_METHOD_PREFIX,
- element: 'function(B#a)', operator: '++')),
- const Test.clazz('''
- class B {
- }
- class C extends B {
- m() => ++super.a;
- }
- ''',
- const Visit(VisitKind.VISIT_UNRESOLVED_SUPER_PREFIX, operator: '++')),
- const Test.clazz(
- '''
- class B {
- set a(_) {}
- }
- class C extends B {
- m() => ++super.a;
- }
- ''',
- const Visit(VisitKind.VISIT_UNRESOLVED_SUPER_GETTER_PREFIX,
- setter: 'setter(B#a)', operator: '++')),
- const Test.clazz(
- '''
- class B {
- get a => 42;
- }
- class C extends B {
- m() => ++super.a;
- }
- ''',
- const Visit(VisitKind.VISIT_UNRESOLVED_SUPER_SETTER_PREFIX,
- getter: 'getter(B#a)', operator: '++')),
-
- const Test.clazz(
- '''
- class C {
- static set a(var value) { }
- m() => ++a;
- }
- ''',
- const Visit(VisitKind.VISIT_UNRESOLVED_STATIC_GETTER_PREFIX,
- setter: 'setter(C#a)', operator: '++')),
-
- const Test.clazz(
- '''
- class C {
- static get a => 42;
- m() => ++C.a;
- }
- ''',
- const Visit(VisitKind.VISIT_UNRESOLVED_STATIC_SETTER_PREFIX,
- getter: 'getter(C#a)', operator: '++')),
-
- const Test.clazz(
- '''
- class C {
- static final a = 42;
- m() => ++C.a;
- }
- ''',
- const Visit(VisitKind.VISIT_STATIC_FINAL_FIELD_PREFIX,
- element: 'field(C#a)', operator: '++')),
-
- const Test(
- '''
- class C {
- static a(var value) { }
- }
- m() => ++C.a;
- ''',
- const Visit(VisitKind.VISIT_STATIC_METHOD_PREFIX,
- element: 'function(C#a)', operator: '++')),
-
- const Test(
- '''
- set a(var value) { }
- m() => ++a;
- ''',
- const Visit(VisitKind.VISIT_UNRESOLVED_TOP_LEVEL_GETTER_PREFIX,
- setter: 'setter(a)', operator: '++')),
-
- const Test(
- '''
- get a => 42;
- m() => ++a;
- ''',
- const Visit(VisitKind.VISIT_UNRESOLVED_TOP_LEVEL_SETTER_PREFIX,
- getter: 'getter(a)', operator: '++')),
-
- const Test(
- '''
- a(var value) { }
- m() => ++a;
- ''',
- const Visit(VisitKind.VISIT_TOP_LEVEL_METHOD_PREFIX,
- element: 'function(a)', operator: '++')),
-
- const Test(
- '''
- final a = 42;
- m() => ++a;
- ''',
- const Visit(VisitKind.VISIT_TOP_LEVEL_FINAL_FIELD_PREFIX,
- element: 'field(a)', operator: '++')),
-
- const Test('''
- m() => ++unresolved;
- ''', const Visit(VisitKind.VISIT_UNRESOLVED_PREFIX, operator: '++')),
- ],
- 'Postfix expression': const [
- // Postfix expression
- const Test('''
- m(a) => a.b--;
- ''', const [
- const Visit(VisitKind.VISIT_DYNAMIC_PROPERTY_POSTFIX,
- receiver: 'a', name: 'b', operator: '--'),
- const Visit(VisitKind.VISIT_PARAMETER_GET, element: 'parameter(m#a)')
- ]),
- const Test(
- '''
- m(a) => a++;
- ''',
- const Visit(VisitKind.VISIT_PARAMETER_POSTFIX,
- element: 'parameter(m#a)', operator: '++')),
- const Test(
- '''
- m(final a) => a++;
- ''',
- const Visit(VisitKind.VISIT_FINAL_PARAMETER_POSTFIX,
- element: 'parameter(m#a)', operator: '++')),
- const Test(
- '''
- m() {
- var a;
- a--;
- }
- ''',
- const Visit(VisitKind.VISIT_LOCAL_VARIABLE_POSTFIX,
- element: 'variable(m#a)', operator: '--')),
- const Test(
- '''
- m() {
- final a = 42;
- a--;
- }
- ''',
- const Visit(VisitKind.VISIT_FINAL_LOCAL_VARIABLE_POSTFIX,
- element: 'variable(m#a)', operator: '--')),
- const Test(
- '''
- m() {
- a() {}
- a--;
- }
- ''',
- const Visit(VisitKind.VISIT_LOCAL_FUNCTION_POSTFIX,
- element: 'function(m#a)', operator: '--')),
- const Test(
- '''
- var a;
- m() => a++;
- ''',
- const Visit(VisitKind.VISIT_TOP_LEVEL_FIELD_POSTFIX,
- element: 'field(a)', operator: '++')),
- const Test(
- '''
- get a => 0;
- set a(_) {}
- m() => a--;
- ''',
- const Visit(VisitKind.VISIT_TOP_LEVEL_GETTER_SETTER_POSTFIX,
- getter: 'getter(a)', setter: 'setter(a)', operator: '--')),
- const Test(
- '''
- class C {
- static var a;
- }
- m() => C.a++;
- ''',
- const Visit(VisitKind.VISIT_STATIC_FIELD_POSTFIX,
- element: 'field(C#a)', operator: '++')),
- const Test.clazz(
- '''
- class C {
- static var a;
- m() => C.a++;
- }
- ''',
- const Visit(VisitKind.VISIT_STATIC_FIELD_POSTFIX,
- element: 'field(C#a)', operator: '++')),
- const Test.clazz(
- '''
- class C {
- static var a;
- m() => a--;
- }
- ''',
- const Visit(VisitKind.VISIT_STATIC_FIELD_POSTFIX,
- element: 'field(C#a)', operator: '--')),
- const Test.prefix(
- '''
- class C {
- static var a;
- }
- ''',
- '''
- m() => p.C.a--;
- ''',
- const Visit(VisitKind.VISIT_STATIC_FIELD_POSTFIX,
- element: 'field(C#a)', operator: '--')),
- const Test.clazz(
- '''
- class C {
- var o;
- static m() { o--; }
- }
- ''',
- const Visit(VisitKind.ERROR_INVALID_POSTFIX,
- error: MessageKind.NO_INSTANCE_AVAILABLE, operator: '--')),
- const Test.prefix(
- '''
- ''',
- '''
- m() { p--; }
- ''',
- const Visit(VisitKind.ERROR_INVALID_POSTFIX,
- error: MessageKind.PREFIX_AS_EXPRESSION, operator: '--')),
- const Test(
- '''
- class C {
- static get a => 0;
- static set a(_) {}
- }
- m() => C.a++;
- ''',
- const Visit(VisitKind.VISIT_STATIC_GETTER_SETTER_POSTFIX,
- getter: 'getter(C#a)', setter: 'setter(C#a)', operator: '++')),
- const Test.clazz(
- '''
- class C {
- static get a => 0;
- static set a(_) {}
- m() => C.a--;
- }
- ''',
- const Visit(VisitKind.VISIT_STATIC_GETTER_SETTER_POSTFIX,
- getter: 'getter(C#a)', setter: 'setter(C#a)', operator: '--')),
- const Test.clazz(
- '''
- class C {
- static get a => 0;
- static set a(_) {}
- m() => a--;
- }
- ''',
- const Visit(VisitKind.VISIT_STATIC_GETTER_SETTER_POSTFIX,
- getter: 'getter(C#a)', setter: 'setter(C#a)', operator: '--')),
- const Test.prefix(
- '''
- class C {
- static get a => 0;
- static set a(_) {}
- }
- ''',
- '''
- m() => p.C.a++;
- ''',
- const Visit(VisitKind.VISIT_STATIC_GETTER_SETTER_POSTFIX,
- getter: 'getter(C#a)', setter: 'setter(C#a)', operator: '++')),
- const Test.clazz(
- '''
- class C {
- var a;
- m() => a--;
- }
- ''',
- const Visit(VisitKind.VISIT_THIS_PROPERTY_POSTFIX,
- name: 'a', operator: '--')),
- const Test.clazz(
- '''
- class C {
- var a = 0;
- m() => this.a++;
- }
- ''',
- const Visit(VisitKind.VISIT_THIS_PROPERTY_POSTFIX,
- name: 'a', operator: '++')),
- const Test.clazz(
- '''
- class B {
- var a = 0;
- }
- class C extends B {
- m() => super.a--;
- }
- ''',
- const Visit(VisitKind.VISIT_SUPER_FIELD_POSTFIX,
- element: 'field(B#a)', operator: '--')),
- const Test.clazz(
- '''
- class B {
- final a = 0;
- }
- class C extends B {
- m() => super.a--;
- }
- ''',
- const Visit(VisitKind.VISIT_SUPER_FINAL_FIELD_POSTFIX,
- element: 'field(B#a)', operator: '--')),
- const Test.clazz(
- '''
- class B {
- get a => 0;
- set a (_) {}
- }
- class C extends B {
- m() => super.a--;
- }
- ''',
- const Visit(VisitKind.VISIT_SUPER_GETTER_SETTER_POSTFIX,
- getter: 'getter(B#a)', setter: 'setter(B#a)', operator: '--')),
- const Test.clazz(
- '''
- class A {
- get a => 0;
- }
- class B extends A {
- set a (_) {}
- }
- class C extends B {
- m() => super.a++;
- }
- ''',
- const Visit(VisitKind.VISIT_SUPER_GETTER_SETTER_POSTFIX,
- getter: 'getter(A#a)', setter: 'setter(B#a)', operator: '++')),
- const Test.clazz(
- '''
- class A {
- var a;
- }
- class B extends A {
- get a => 0;
- }
-
- class C extends B {
- m() => super.a--;
- }
- ''',
- const Visit(VisitKind.VISIT_SUPER_GETTER_FIELD_POSTFIX,
- getter: 'getter(B#a)', setter: 'field(A#a)', operator: '--')),
- const Test.clazz(
- '''
- class A {
- var a;
- }
- class B extends A {
- set a(_) {}
- }
-
- class C extends B {
- m() => super.a++;
- }
- ''',
- const Visit(VisitKind.VISIT_SUPER_FIELD_SETTER_POSTFIX,
- getter: 'field(A#a)', setter: 'setter(B#a)', operator: '++')),
- const Test.clazz(
- '''
- class B {
- a() {}
- }
- class C extends B {
- m() => super.a++;
- }
- ''',
- const Visit(VisitKind.VISIT_SUPER_METHOD_POSTFIX,
- element: 'function(B#a)', operator: '++')),
- const Test.clazz('''
- class B {
- }
- class C extends B {
- m() => super.a++;
- }
- ''',
- const Visit(VisitKind.VISIT_UNRESOLVED_SUPER_POSTFIX, operator: '++')),
- const Test.clazz(
- '''
- class B {
- set a(_) {}
- }
- class C extends B {
- m() => super.a++;
- }
- ''',
- const Visit(VisitKind.VISIT_UNRESOLVED_SUPER_GETTER_POSTFIX,
- setter: 'setter(B#a)', operator: '++')),
- const Test.clazz(
- '''
- class B {
- get a => 42;
- }
- class C extends B {
- m() => super.a++;
- }
- ''',
- const Visit(VisitKind.VISIT_UNRESOLVED_SUPER_SETTER_POSTFIX,
- getter: 'getter(B#a)', operator: '++')),
-
- const Test.clazz(
- '''
- class C {
- static set a(var value) { }
- m() => a++;
- }
- ''',
- const Visit(VisitKind.VISIT_UNRESOLVED_STATIC_GETTER_POSTFIX,
- setter: 'setter(C#a)', operator: '++')),
-
- const Test.clazz(
- '''
- class C {
- static get a => 42;
- m() => C.a++;
- }
- ''',
- const Visit(VisitKind.VISIT_UNRESOLVED_STATIC_SETTER_POSTFIX,
- getter: 'getter(C#a)', operator: '++')),
-
- const Test.clazz(
- '''
- class C {
- static final a = 42;
- m() => C.a++;
- }
- ''',
- const Visit(VisitKind.VISIT_STATIC_FINAL_FIELD_POSTFIX,
- element: 'field(C#a)', operator: '++')),
-
- const Test(
- '''
- class C {
- static a(var value) { }
- }
- m() => C.a++;
- ''',
- const Visit(VisitKind.VISIT_STATIC_METHOD_POSTFIX,
- element: 'function(C#a)', operator: '++')),
-
- const Test(
- '''
- set a(var value) { }
- m() => a++;
- ''',
- const Visit(VisitKind.VISIT_UNRESOLVED_TOP_LEVEL_GETTER_POSTFIX,
- setter: 'setter(a)', operator: '++')),
-
- const Test(
- '''
- get a => 42;
- m() => a++;
- ''',
- const Visit(VisitKind.VISIT_UNRESOLVED_TOP_LEVEL_SETTER_POSTFIX,
- getter: 'getter(a)', operator: '++')),
-
- const Test(
- '''
- a(var value) { }
- m() => a++;
- ''',
- const Visit(VisitKind.VISIT_TOP_LEVEL_METHOD_POSTFIX,
- element: 'function(a)', operator: '++')),
-
- const Test(
- '''
- final a = 42;
- m() => a++;
- ''',
- const Visit(VisitKind.VISIT_TOP_LEVEL_FINAL_FIELD_POSTFIX,
- element: 'field(a)', operator: '++')),
-
- const Test('''
- m() => unresolved++;
- ''', const Visit(VisitKind.VISIT_UNRESOLVED_POSTFIX, operator: '++')),
- ],
- 'Constructor invocations': const [
- const Test(
- '''
- class Class {
- const Class(a, b);
- }
- m() => const Class(true, 42);
- ''',
- const Visit(VisitKind.VISIT_CONST_CONSTRUCTOR_INVOKE,
- constant: 'const Class(true, 42)')),
- const Test(
- '''
- m() => const bool.fromEnvironment('foo');
- ''',
- const Visit(VisitKind.VISIT_BOOL_FROM_ENVIRONMENT_CONSTRUCTOR_INVOKE,
- constant: 'const bool.fromEnvironment("foo")')),
- const Test(
- '''
- m() => const bool.fromEnvironment('foo', defaultValue: true);
- ''',
- const Visit(VisitKind.VISIT_BOOL_FROM_ENVIRONMENT_CONSTRUCTOR_INVOKE,
- constant: 'const bool.fromEnvironment("foo", defaultValue: true)')),
- const Test(
- '''
- m() => const int.fromEnvironment('foo');
- ''',
- const Visit(VisitKind.VISIT_INT_FROM_ENVIRONMENT_CONSTRUCTOR_INVOKE,
- constant: 'const int.fromEnvironment("foo")')),
- const Test(
- '''
- m() => const String.fromEnvironment('foo');
- ''',
- const Visit(VisitKind.VISIT_STRING_FROM_ENVIRONMENT_CONSTRUCTOR_INVOKE,
- constant: 'const String.fromEnvironment("foo")')),
- const Test(
- '''
- class Class {
- Class(a, b);
- }
- m() => const Class(true, 42);
- ''',
- const Visit(VisitKind.ERROR_NON_CONSTANT_CONSTRUCTOR_INVOKE,
- element: 'generative_constructor(Class#)',
- arguments: '(true,42)',
- type: 'Class',
- selector: 'CallStructure(arity=2)')),
- const Test(
- '''
- class Class {}
- m() => new Class();
- ''',
- const Visit(VisitKind.VISIT_GENERATIVE_CONSTRUCTOR_INVOKE,
- element: 'generative_constructor(Class#)',
- arguments: '()',
- type: 'Class',
- selector: 'CallStructure(arity=0)')),
- const Test(
- '''
- class Class {
- Class(a, b);
- }
- m() => new Class(true, 42);
- ''',
- const Visit(VisitKind.VISIT_GENERATIVE_CONSTRUCTOR_INVOKE,
- element: 'generative_constructor(Class#)',
- arguments: '(true,42)',
- type: 'Class',
- selector: 'CallStructure(arity=2)')),
- const Test(
- '''
- class Class {
- Class.named(a, b);
- }
- m() => new Class.named(true, 42);
- ''',
- const Visit(VisitKind.VISIT_GENERATIVE_CONSTRUCTOR_INVOKE,
- element: 'generative_constructor(Class#named)',
- arguments: '(true,42)',
- type: 'Class',
- selector: 'CallStructure(arity=2)')),
- const Test(
- '''
- class Class {}
- m() => new Class(true, 42);
- ''',
- const Visit(VisitKind.VISIT_CONSTRUCTOR_INCOMPATIBLE_INVOKE,
- element: 'generative_constructor(Class#)',
- arguments: '(true,42)',
- type: 'Class',
- selector: 'CallStructure(arity=2)')),
- const Test(
- '''
- class Class {
- Class(a, b) : this._(a, b);
- Class._(a, b);
- }
- m() => new Class(true, 42);
- ''',
- const Visit(VisitKind.VISIT_REDIRECTING_GENERATIVE_CONSTRUCTOR_INVOKE,
- element: 'generative_constructor(Class#)',
- arguments: '(true,42)',
- type: 'Class',
- selector: 'CallStructure(arity=2)')),
- const Test(
- '''
- class Class {
- Class() : this._(true, 42);
- Class._(a, b);
- }
- m() => new Class(true, 42);
- ''',
- const Visit(VisitKind.VISIT_CONSTRUCTOR_INCOMPATIBLE_INVOKE,
- element: 'generative_constructor(Class#)',
- arguments: '(true,42)',
- type: 'Class',
- selector: 'CallStructure(arity=2)')),
- const Test(
- '''
- class Class {
- factory Class(a, b) => new Class._(a, b);
- Class._(a, b);
- }
- m() => new Class(true, 42);
- ''',
- const Visit(VisitKind.VISIT_FACTORY_CONSTRUCTOR_INVOKE,
- element: 'factory_constructor(Class#)',
- arguments: '(true,42)',
- type: 'Class',
- selector: 'CallStructure(arity=2)')),
- const Test(
- '''
- class Class {
- factory Class() => new Class._(true, 42);
- Class._(a, b);
- }
- m() => new Class(true, 42);
- ''',
- const Visit(VisitKind.VISIT_CONSTRUCTOR_INCOMPATIBLE_INVOKE,
- element: 'factory_constructor(Class#)',
- arguments: '(true,42)',
- type: 'Class',
- selector: 'CallStructure(arity=2)')),
- const Test(
- '''
- class Class<T> {
- factory Class(a, b) = Class<int>.a;
- factory Class.a(a, b) = Class<Class<T>>.b;
- Class.b(a, b);
- }
- m() => new Class<double>(true, 42);
- ''',
- const Visit(VisitKind.VISIT_REDIRECTING_FACTORY_CONSTRUCTOR_INVOKE,
- element: 'factory_constructor(Class#)',
- arguments: '(true,42)',
- type: 'Class<double>',
- target: 'generative_constructor(Class#b)',
- targetType: 'Class<Class<int>>',
- selector: 'CallStructure(arity=2)')),
- const Test(
- '''
- class Class<T> {
- factory Class(a) = Class<int>.a;
- factory Class.a(a, [b]) = Class<Class<T>>.b;
- Class.b(a, [b]);
- }
- m() => new Class<double>(true, 42);
- ''',
- const Visit(VisitKind.VISIT_REDIRECTING_FACTORY_CONSTRUCTOR_INVOKE,
- element: 'factory_constructor(Class#)',
- arguments: '(true,42)',
- type: 'Class<double>',
- target: 'generative_constructor(Class#b)',
- targetType: 'Class<Class<int>>',
- selector: 'CallStructure(arity=2)')),
- const Test(
- '''
- class Class {
- factory Class() = Class._;
- Class._();
- }
- m() => new Class(true, 42);
- ''',
- const Visit(
- VisitKind.VISIT_UNRESOLVED_REDIRECTING_FACTORY_CONSTRUCTOR_INVOKE,
- element: 'factory_constructor(Class#)',
- arguments: '(true,42)',
- type: 'Class',
- selector: 'CallStructure(arity=2)')),
- const Test(
- '''
- class Class<T> {
- factory Class(a, b) = Class<int>.a;
- factory Class.a(a, b) = Class<Class<T>>.b;
- Class.b(a);
- }
- m() => new Class<double>(true, 42);
- ''',
- const Visit(
- VisitKind.VISIT_UNRESOLVED_REDIRECTING_FACTORY_CONSTRUCTOR_INVOKE,
- element: 'factory_constructor(Class#)',
- arguments: '(true,42)',
- type: 'Class<double>',
- selector: 'CallStructure(arity=2)')),
- const Test(
- '''
- class Class {
- Class(a, b);
- }
- m() => new Class.unresolved(true, 42);
- ''',
- const Visit(VisitKind.VISIT_UNRESOLVED_CONSTRUCTOR_INVOKE,
- arguments: '(true,42)')),
- const Test(
- '''
- m() => new Unresolved(true, 42);
- ''',
- const Visit(VisitKind.VISIT_UNRESOLVED_CLASS_CONSTRUCTOR_INVOKE,
- arguments: '(true,42)')),
- const Test(
- '''
- abstract class AbstractClass {}
- m() => new AbstractClass();
- ''',
- const Visit(VisitKind.VISIT_ABSTRACT_CLASS_CONSTRUCTOR_INVOKE,
- element: 'generative_constructor(AbstractClass#)',
- type: 'AbstractClass',
- arguments: '()',
- selector: 'CallStructure(arity=0)')),
- const Test(
- '''
- class Class {
- factory Class(a, b) = Unresolved;
- }
- m() => new Class(true, 42);
- ''',
- const Visit(
- VisitKind.VISIT_UNRESOLVED_REDIRECTING_FACTORY_CONSTRUCTOR_INVOKE,
- element: 'factory_constructor(Class#)',
- arguments: '(true,42)',
- type: 'Class',
- selector: 'CallStructure(arity=2)')),
- const Test(
- '''
- class Class {
- factory Class(a, b) = Class.named;
- }
- m() => new Class(true, 42);
- ''',
- const Visit(
- VisitKind.VISIT_UNRESOLVED_REDIRECTING_FACTORY_CONSTRUCTOR_INVOKE,
- element: 'factory_constructor(Class#)',
- arguments: '(true,42)',
- type: 'Class',
- selector: 'CallStructure(arity=2)')),
- const Test(
- '''
- class Class {
- factory Class(a, b) = Class.named;
- factory Class.named(a, b) = Class.unresolved;
- }
- m() => new Class(true, 42);
- ''',
- const Visit(
- VisitKind.VISIT_UNRESOLVED_REDIRECTING_FACTORY_CONSTRUCTOR_INVOKE,
- element: 'factory_constructor(Class#)',
- arguments: '(true,42)',
- type: 'Class',
- selector: 'CallStructure(arity=2)')),
- const Test(
- '''
- abstract class AbstractClass {
- AbstractClass(a, b);
- }
- class Class {
- factory Class(a, b) = AbstractClass;
- }
- m() => new Class(true, 42);
- ''',
- const Visit(
- VisitKind.VISIT_UNRESOLVED_REDIRECTING_FACTORY_CONSTRUCTOR_INVOKE,
- element: 'factory_constructor(Class#)',
- arguments: '(true,42)',
- type: 'Class',
- selector: 'CallStructure(arity=2)')),
- ],
- 'If not null expressions': const [
- const Test('''
- m(a) => a?.b;
- ''', const [
- const Visit(VisitKind.VISIT_IF_NOT_NULL_DYNAMIC_PROPERTY_GET,
- receiver: 'a', name: 'b'),
- const Visit(VisitKind.VISIT_PARAMETER_GET, element: 'parameter(m#a)'),
- ]),
- const Test('''
- class C {
- static var b;
- }
- m(a) => C?.b;
- ''',
- const Visit(VisitKind.VISIT_STATIC_FIELD_GET, element: 'field(C#b)')),
- const Test('''
- m(a) => a?.b = 42;
- ''', const [
- const Visit(VisitKind.VISIT_IF_NOT_NULL_DYNAMIC_PROPERTY_SET,
- receiver: 'a', name: 'b', rhs: '42'),
- const Visit(VisitKind.VISIT_PARAMETER_GET, element: 'parameter(m#a)'),
- ]),
- const Test('''
- m(a) => a?.b(42, true);
- ''', const [
- const Visit(VisitKind.VISIT_IF_NOT_NULL_DYNAMIC_PROPERTY_INVOKE,
- receiver: 'a',
- arguments: '(42,true)',
- selector: 'Selector(call, b, arity=2)'),
- const Visit(VisitKind.VISIT_PARAMETER_GET, element: 'parameter(m#a)'),
- ]),
- const Test('''
- m(a) => ++a?.b;
- ''', const [
- const Visit(VisitKind.VISIT_IF_NOT_NULL_DYNAMIC_PROPERTY_PREFIX,
- receiver: 'a', name: 'b', operator: '++'),
- const Visit(VisitKind.VISIT_PARAMETER_GET, element: 'parameter(m#a)'),
- ]),
- const Test('''
- m(a) => a?.b--;
- ''', const [
- const Visit(VisitKind.VISIT_IF_NOT_NULL_DYNAMIC_PROPERTY_POSTFIX,
- receiver: 'a', name: 'b', operator: '--'),
- const Visit(VisitKind.VISIT_PARAMETER_GET, element: 'parameter(m#a)'),
- ]),
- const Test('''
- m(a) => a?.b *= 42;
- ''', const [
- const Visit(VisitKind.VISIT_IF_NOT_NULL_DYNAMIC_PROPERTY_COMPOUND,
- receiver: 'a', name: 'b', operator: '*=', rhs: '42'),
- const Visit(VisitKind.VISIT_PARAMETER_GET, element: 'parameter(m#a)'),
- ]),
- const Test('''
- m(a) => a?.b ??= 42;
- ''', const [
- const Visit(VisitKind.VISIT_IF_NOT_NULL_DYNAMIC_PROPERTY_SET_IF_NULL,
- receiver: 'a', name: 'b', rhs: '42'),
- const Visit(VisitKind.VISIT_PARAMETER_GET, element: 'parameter(m#a)'),
- ]),
- const Test('''
- m(a, b) => a ?? b;
- ''', const [
- const Visit(VisitKind.VISIT_IF_NULL, left: 'a', right: 'b'),
- const Visit(VisitKind.VISIT_PARAMETER_GET, element: 'parameter(m#a)'),
- const Visit(VisitKind.VISIT_PARAMETER_GET, element: 'parameter(m#b)'),
- ]),
- const Test(
- '''
- m(a) => a ??= 42;
- ''',
- const Visit(VisitKind.VISIT_PARAMETER_SET_IF_NULL,
- element: 'parameter(m#a)', rhs: '42')),
- const Test.prefix(
- '''
- var o;
- ''',
- 'm() => p?.o;',
- const Visit(VisitKind.ERROR_INVALID_GET,
- error: MessageKind.PREFIX_AS_EXPRESSION)),
- ],
- 'Set if null': const [
- const Test('''
- m(a) => a.b ??= 42;
- ''', const [
- const Visit(VisitKind.VISIT_DYNAMIC_PROPERTY_SET_IF_NULL,
- receiver: 'a', name: 'b', rhs: '42'),
- const Visit(VisitKind.VISIT_PARAMETER_GET, element: 'parameter(m#a)')
- ]),
- const Test(
- '''
- m(a) => a ??= 42;
- ''',
- const Visit(VisitKind.VISIT_PARAMETER_SET_IF_NULL,
- element: 'parameter(m#a)', rhs: '42')),
- const Test(
- '''
- m(final a) => a ??= 42;
- ''',
- const Visit(VisitKind.VISIT_FINAL_PARAMETER_SET_IF_NULL,
- element: 'parameter(m#a)', rhs: '42')),
- const Test(
- '''
- m() {
- var a;
- a ??= 42;
- }
- ''',
- const Visit(VisitKind.VISIT_LOCAL_VARIABLE_SET_IF_NULL,
- element: 'variable(m#a)', rhs: '42')),
- const Test(
- '''
- m() {
- final a = 0;
- a ??= 42;
- }
- ''',
- const Visit(VisitKind.VISIT_FINAL_LOCAL_VARIABLE_SET_IF_NULL,
- element: 'variable(m#a)', rhs: '42')),
- const Test(
- '''
- m() {
- a() {}
- a ??= 42;
- }
- ''',
- const Visit(VisitKind.VISIT_LOCAL_FUNCTION_SET_IF_NULL,
- element: 'function(m#a)', rhs: '42')),
- const Test(
- '''
- var a;
- m() => a ??= 42;
- ''',
- const Visit(VisitKind.VISIT_TOP_LEVEL_FIELD_SET_IF_NULL,
- element: 'field(a)', rhs: '42')),
- const Test(
- '''
- get a => 0;
- set a(_) {}
- m() => a ??= 42;
- ''',
- const Visit(VisitKind.VISIT_TOP_LEVEL_GETTER_SETTER_SET_IF_NULL,
- getter: 'getter(a)', setter: 'setter(a)', rhs: '42')),
- const Test(
- '''
- class C {
- static var a;
- }
- m() => C.a ??= 42;
- ''',
- const Visit(VisitKind.VISIT_STATIC_FIELD_SET_IF_NULL,
- element: 'field(C#a)', rhs: '42')),
- const Test.clazz(
- '''
- class C {
- static var a;
- m() => C.a ??= 42;
- }
- ''',
- const Visit(VisitKind.VISIT_STATIC_FIELD_SET_IF_NULL,
- element: 'field(C#a)', rhs: '42')),
- const Test.clazz(
- '''
- class C {
- static var a;
- m() => a ??= 42;
- }
- ''',
- const Visit(VisitKind.VISIT_STATIC_FIELD_SET_IF_NULL,
- element: 'field(C#a)', rhs: '42')),
- const Test.prefix(
- '''
- class C {
- static var a;
- }
- ''',
- '''
- m() => p.C.a ??= 42;
- ''',
- const Visit(VisitKind.VISIT_STATIC_FIELD_SET_IF_NULL,
- element: 'field(C#a)', rhs: '42')),
- const Test.clazz(
- '''
- class C {
- var o;
- static m() { o ??= 42; }
- }
- ''',
- const Visit(VisitKind.ERROR_INVALID_SET_IF_NULL,
- error: MessageKind.NO_INSTANCE_AVAILABLE, rhs: '42')),
- const Test.prefix(
- '''
- ''',
- '''
- m() { p ??= 42; }
- ''',
- const Visit(VisitKind.ERROR_INVALID_SET_IF_NULL,
- error: MessageKind.PREFIX_AS_EXPRESSION, rhs: '42')),
- const Test(
- '''
- class C {
- static get a => 0;
- static set a(_) {}
- }
- m() => C.a ??= 42;
- ''',
- const Visit(VisitKind.VISIT_STATIC_GETTER_SETTER_SET_IF_NULL,
- getter: 'getter(C#a)', setter: 'setter(C#a)', rhs: '42')),
- const Test.clazz(
- '''
- class C {
- static get a => 0;
- static set a(_) {}
- m() => C.a ??= 42;
- }
- ''',
- const Visit(VisitKind.VISIT_STATIC_GETTER_SETTER_SET_IF_NULL,
- getter: 'getter(C#a)', setter: 'setter(C#a)', rhs: '42')),
- const Test.clazz(
- '''
- class C {
- static get a => 0;
- static set a(_) {}
- m() => a ??= 42;
- }
- ''',
- const Visit(VisitKind.VISIT_STATIC_GETTER_SETTER_SET_IF_NULL,
- getter: 'getter(C#a)', setter: 'setter(C#a)', rhs: '42')),
- const Test.prefix(
- '''
- class C {
- static get a => 0;
- static set a(_) {}
- }
- ''',
- '''
- m() => p.C.a ??= 42;
- ''',
- const Visit(VisitKind.VISIT_STATIC_GETTER_SETTER_SET_IF_NULL,
- getter: 'getter(C#a)', setter: 'setter(C#a)', rhs: '42')),
- // TODO(johnniwinther): Enable these when dart2js supports method and setter
- // with the same name.
- /*const Test(
- '''
- class C {
- static a() {}
- static set a(_) {}
- }
- m() => C.a ??= 42;
- ''',
- const Visit(VisitKind.VISIT_STATIC_METHOD_SETTER_SET_IF_NULL,
- getter: 'function(C#a)', setter: 'setter(C#a)',
- rhs: '42')),
- const Test.clazz(
- '''
- class C {
- static a() {}
- static set a(_) {}
- m() => C.a ??= 42;
- }
- ''',
- const Visit(VisitKind.VISIT_STATIC_METHOD_SETTER_SET_IF_NULL,
- getter: 'function(C#a)', setter: 'setter(C#a)',
- rhs: '42')),
- const Test.clazz(
- '''
- class C {
- static a() {}
- static set a(_) {}
- m() => a ??= 42;
- }
- ''',
- const Visit(VisitKind.VISIT_STATIC_METHOD_SETTER_SET_IF_NULL,
- getter: 'function(C#a)', setter: 'setter(C#a)',
- rhs: '42')),
- const Test.prefix(
- '''
- class C {
- static a() {}
- static set a(_) {}
- }
- ''',
- '''
- m() => p.C.a ??= 42;
- ''',
- const Visit(VisitKind.VISIT_STATIC_METHOD_SETTER_SET_IF_NULL,
- getter: 'function(C#a)', setter: 'setter(C#a)',
- rhs: '42')),*/
- const Test.clazz(
- '''
- class C {
- var a;
- m() => a ??= 42;
- }
- ''',
- const Visit(VisitKind.VISIT_THIS_PROPERTY_SET_IF_NULL,
- name: 'a', rhs: '42')),
- const Test.clazz(
- '''
- class C {
- var a = 0;
- m() => this.a ??= 42;
- }
- ''',
- const Visit(VisitKind.VISIT_THIS_PROPERTY_SET_IF_NULL,
- name: 'a', rhs: '42')),
- const Test.clazz(
- '''
- class B {
- var a = 0;
- }
- class C extends B {
- m() => super.a ??= 42;
- }
- ''',
- const Visit(VisitKind.VISIT_SUPER_FIELD_SET_IF_NULL,
- element: 'field(B#a)', rhs: '42')),
- const Test.clazz(
- '''
- class B {
- final a = 0;
- }
- class C extends B {
- m() => super.a ??= 42;
- }
- ''',
- const Visit(VisitKind.VISIT_SUPER_FINAL_FIELD_SET_IF_NULL,
- element: 'field(B#a)', rhs: '42')),
- const Test.clazz(
- '''
- class B {
- get a => 0;
- set a (_) {}
- }
- class C extends B {
- m() => super.a ??= 42;
- }
- ''',
- const Visit(VisitKind.VISIT_SUPER_GETTER_SETTER_SET_IF_NULL,
- getter: 'getter(B#a)', setter: 'setter(B#a)', rhs: '42')),
- const Test.clazz(
- '''
- class A {
- get a => 0;
- }
- class B extends A {
- set a (_) {}
- }
- class C extends B {
- m() => super.a ??= 42;
- }
- ''',
- const Visit(VisitKind.VISIT_SUPER_GETTER_SETTER_SET_IF_NULL,
- getter: 'getter(A#a)', setter: 'setter(B#a)', rhs: '42')),
- const Test.clazz(
- '''
- class A {
- var a;
- }
- class B extends A {
- get a => 0;
- }
-
- class C extends B {
- m() => super.a ??= 42;
- }
- ''',
- const Visit(VisitKind.VISIT_SUPER_GETTER_FIELD_SET_IF_NULL,
- getter: 'getter(B#a)', setter: 'field(A#a)', rhs: '42')),
- const Test.clazz(
- '''
- class A {
- var a;
- }
- class B extends A {
- set a(_) {}
- }
-
- class C extends B {
- m() => super.a ??= 42;
- }
- ''',
- const Visit(VisitKind.VISIT_SUPER_FIELD_SETTER_SET_IF_NULL,
- getter: 'field(A#a)', setter: 'setter(B#a)', rhs: '42')),
- const Test.clazz(
- '''
- class A {
- var a;
- }
- class B extends A {
- final a = 0;
- }
-
- class C extends B {
- m() => super.a ??= 42;
- }
- ''',
- // TODO(johnniwinther): Change this to
- // [VISIT_SUPER_FIELD_FIELD_SET_IF_NULL] when dart2js supports shadow
- // setters.
- const Visit(VisitKind.VISIT_SUPER_FINAL_FIELD_SET_IF_NULL,
- element: 'field(B#a)', rhs: '42')),
- const Test.clazz(
- '''
- class B {
- a() {}
- }
- class C extends B {
- m() => super.a ??= 42;
- }
- ''',
- const Visit(VisitKind.VISIT_SUPER_METHOD_SET_IF_NULL,
- element: 'function(B#a)', rhs: '42')),
- const Test.clazz(
- '''
- class B {
- }
- class C extends B {
- m() => super.a ??= 42;
- }
- ''',
- const Visit(VisitKind.VISIT_UNRESOLVED_SUPER_SET_IF_NULL,
- name: 'a', rhs: '42')),
- const Test.clazz(
- '''
- class B {
- set a(_) {}
- }
- class C extends B {
- m() => super.a ??= 42;
- }
- ''',
- const Visit(VisitKind.VISIT_UNRESOLVED_SUPER_GETTER_SET_IF_NULL,
- setter: 'setter(B#a)', rhs: '42')),
- const Test.clazz(
- '''
- class B {
- get a => 42;
- }
- class C extends B {
- m() => super.a ??= 42;
- }
- ''',
- const Visit(VisitKind.VISIT_UNRESOLVED_SUPER_SETTER_SET_IF_NULL,
- getter: 'getter(B#a)', rhs: '42')),
-
- const Test.clazz(
- '''
- class C {
- static set a(var value) { }
- m() => a ??= 42;
- }
- ''',
- const Visit(VisitKind.VISIT_UNRESOLVED_STATIC_GETTER_SET_IF_NULL,
- setter: 'setter(C#a)', rhs: '42')),
-
- const Test.clazz(
- '''
- class C {
- static get a => 42;
- m() => C.a ??= 42;
- }
- ''',
- const Visit(VisitKind.VISIT_UNRESOLVED_STATIC_SETTER_SET_IF_NULL,
- getter: 'getter(C#a)', rhs: '42')),
-
- const Test.clazz(
- '''
- class C {
- static final a = 42;
- m() => C.a ??= 42;
- }
- ''',
- const Visit(VisitKind.VISIT_STATIC_FINAL_FIELD_SET_IF_NULL,
- element: 'field(C#a)', rhs: '42')),
-
- const Test(
- '''
- class C {
- static a(var value) { }
- }
- m() => C.a ??= 42;
- ''',
- const Visit(VisitKind.VISIT_STATIC_METHOD_SET_IF_NULL,
- element: 'function(C#a)', rhs: '42')),
-
- const Test(
- '''
- set a(var value) { }
- m() => a ??= 42;
- ''',
- const Visit(VisitKind.VISIT_UNRESOLVED_TOP_LEVEL_GETTER_SET_IF_NULL,
- setter: 'setter(a)', rhs: '42')),
-
- const Test(
- '''
- get a => 42;
- m() => a ??= 42;
- ''',
- const Visit(VisitKind.VISIT_UNRESOLVED_TOP_LEVEL_SETTER_SET_IF_NULL,
- getter: 'getter(a)', rhs: '42')),
-
- const Test(
- '''
- a(var value) { }
- m() => a ??= 42;
- ''',
- const Visit(VisitKind.VISIT_TOP_LEVEL_METHOD_SET_IF_NULL,
- element: 'function(a)', rhs: '42')),
-
- const Test(
- '''
- final a = 42;
- m() => a ??= 42;
- ''',
- const Visit(VisitKind.VISIT_TOP_LEVEL_FINAL_FIELD_SET_IF_NULL,
- element: 'field(a)', rhs: '42')),
-
- const Test(
- '''
- m() => unresolved ??= 42;
- ''',
- const Visit(VisitKind.VISIT_UNRESOLVED_SET_IF_NULL,
- name: 'unresolved', rhs: '42')),
- ],
-};
diff --git a/tests/compiler/dart2js/old_frontend/semantic_visitor_test_send_visitor.dart b/tests/compiler/dart2js/old_frontend/semantic_visitor_test_send_visitor.dart
deleted file mode 100644
index 4077d2d..0000000
--- a/tests/compiler/dart2js/old_frontend/semantic_visitor_test_send_visitor.dart
+++ /dev/null
@@ -1,2499 +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.
-
-part of dart2js.semantics_visitor_test;
-
-class SemanticSendTestVisitor extends SemanticTestVisitor {
- SemanticSendTestVisitor(TreeElements elements) : super(elements);
-
- @override
- visitAs(Send node, Node expression, ResolutionDartType type, arg) {
- visits
- .add(new Visit(VisitKind.VISIT_AS, expression: expression, type: type));
- apply(expression, arg);
- }
-
- @override
- errorInvalidCompound(Send node, ErroneousElement error,
- AssignmentOperator operator, Node rhs, arg) {
- visits.add(new Visit(VisitKind.ERROR_INVALID_COMPOUND,
- error: error.messageKind, operator: operator, rhs: rhs));
- super.errorInvalidCompound(node, error, operator, rhs, arg);
- }
-
- @override
- errorInvalidGet(Send node, ErroneousElement error, arg) {
- visits
- .add(new Visit(VisitKind.ERROR_INVALID_GET, error: error.messageKind));
- super.errorInvalidGet(node, error, arg);
- }
-
- @override
- errorInvalidInvoke(Send node, ErroneousElement error, NodeList arguments,
- Selector selector, arg) {
- visits.add(new Visit(VisitKind.ERROR_INVALID_INVOKE,
- error: error.messageKind, arguments: arguments));
- super.errorInvalidInvoke(node, error, arguments, selector, arg);
- }
-
- @override
- errorInvalidPostfix(
- Send node, ErroneousElement error, IncDecOperator operator, arg) {
- visits.add(new Visit(VisitKind.ERROR_INVALID_POSTFIX,
- error: error.messageKind, operator: operator));
- super.errorInvalidPostfix(node, error, operator, arg);
- }
-
- @override
- errorInvalidPrefix(
- Send node, ErroneousElement error, IncDecOperator operator, arg) {
- visits.add(new Visit(VisitKind.ERROR_INVALID_PREFIX,
- error: error.messageKind, operator: operator));
- super.errorInvalidPrefix(node, error, operator, arg);
- }
-
- @override
- errorInvalidSet(Send node, ErroneousElement error, Node rhs, arg) {
- visits.add(new Visit(VisitKind.ERROR_INVALID_SET,
- error: error.messageKind, rhs: rhs));
- super.errorInvalidSet(node, error, rhs, arg);
- }
-
- @override
- errorInvalidSetIfNull(Send node, ErroneousElement error, Node rhs, arg) {
- visits.add(new Visit(VisitKind.ERROR_INVALID_SET_IF_NULL,
- error: error.messageKind, rhs: rhs));
- super.errorInvalidSetIfNull(node, error, rhs, arg);
- }
-
- @override
- errorInvalidUnary(
- Send node, UnaryOperator operator, ErroneousElement error, arg) {
- visits.add(new Visit(VisitKind.ERROR_INVALID_UNARY,
- error: error.messageKind, operator: operator));
- super.errorInvalidUnary(node, operator, error, arg);
- }
-
- @override
- errorInvalidEquals(Send node, ErroneousElement error, Node right, arg) {
- visits.add(new Visit(VisitKind.ERROR_INVALID_EQUALS,
- error: error.messageKind, right: right));
- super.errorInvalidEquals(node, error, right, arg);
- }
-
- @override
- errorInvalidNotEquals(Send node, ErroneousElement error, Node right, arg) {
- visits.add(new Visit(VisitKind.ERROR_INVALID_NOT_EQUALS,
- error: error.messageKind, right: right));
- super.errorInvalidNotEquals(node, error, right, arg);
- }
-
- @override
- errorInvalidBinary(Send node, ErroneousElement error, BinaryOperator operator,
- Node right, arg) {
- visits.add(new Visit(VisitKind.ERROR_INVALID_BINARY,
- error: error.messageKind, operator: operator, right: right));
- super.errorInvalidBinary(node, error, operator, right, arg);
- }
-
- @override
- errorInvalidIndex(Send node, ErroneousElement error, Node index, arg) {
- visits.add(new Visit(VisitKind.ERROR_INVALID_INDEX,
- error: error.messageKind, index: index));
- super.errorInvalidIndex(node, error, index, arg);
- }
-
- @override
- errorInvalidIndexSet(
- Send node, ErroneousElement error, Node index, Node rhs, arg) {
- visits.add(new Visit(VisitKind.ERROR_INVALID_INDEX_SET,
- error: error.messageKind, index: index, rhs: rhs));
- super.errorInvalidIndexSet(node, error, index, rhs, arg);
- }
-
- @override
- errorInvalidCompoundIndexSet(Send node, ErroneousElement error, Node index,
- AssignmentOperator operator, Node rhs, arg) {
- visits.add(new Visit(VisitKind.ERROR_INVALID_COMPOUND_INDEX_SET,
- error: error.messageKind, index: index, operator: operator, rhs: rhs));
- super.errorInvalidCompoundIndexSet(node, error, index, operator, rhs, arg);
- }
-
- @override
- errorInvalidIndexPrefix(Send node, ErroneousElement error, Node index,
- IncDecOperator operator, arg) {
- visits.add(new Visit(VisitKind.ERROR_INVALID_INDEX_PREFIX,
- error: error.messageKind, index: index, operator: operator));
- super.errorInvalidIndexPrefix(node, error, index, operator, arg);
- }
-
- @override
- errorInvalidIndexPostfix(Send node, ErroneousElement error, Node index,
- IncDecOperator operator, arg) {
- visits.add(new Visit(VisitKind.ERROR_INVALID_INDEX_POSTFIX,
- error: error.messageKind, index: index, operator: operator));
- super.errorInvalidIndexPostfix(node, error, index, operator, arg);
- }
-
- @override
- visitBinary(Send node, Node left, BinaryOperator operator, Node right, arg) {
- visits.add(new Visit(VisitKind.VISIT_BINARY,
- left: left, operator: operator, right: right));
- super.visitBinary(node, left, operator, right, arg);
- }
-
- @override
- errorUndefinedBinaryExpression(
- Send node, Node left, Operator operator, Node right, arg) {
- visits.add(new Visit(VisitKind.ERROR_UNDEFINED_BINARY_EXPRESSION,
- left: left, operator: operator, right: right));
- super.errorUndefinedBinaryExpression(node, left, operator, right, arg);
- }
-
- @override
- visitIndex(Send node, Node receiver, Node index, arg) {
- visits.add(
- new Visit(VisitKind.VISIT_INDEX, receiver: receiver, index: index));
- apply(receiver, arg);
- apply(index, arg);
- }
-
- @override
- visitClassTypeLiteralGet(Send node, ConstantExpression constant, arg) {
- visits.add(new Visit(VisitKind.VISIT_CLASS_TYPE_LITERAL_GET,
- constant: constant.toDartText()));
- }
-
- @override
- visitClassTypeLiteralInvoke(Send node, ConstantExpression constant,
- NodeList arguments, CallStructure callStructure, arg) {
- visits.add(new Visit(VisitKind.VISIT_CLASS_TYPE_LITERAL_INVOKE,
- constant: constant.toDartText(), arguments: arguments));
- apply(arguments, arg);
- }
-
- @override
- visitClassTypeLiteralSet(
- SendSet node, ConstantExpression constant, Node rhs, arg) {
- visits.add(new Visit(VisitKind.VISIT_CLASS_TYPE_LITERAL_SET,
- constant: constant.toDartText(), rhs: rhs));
- super.visitClassTypeLiteralSet(node, constant, rhs, arg);
- }
-
- @override
- visitNotEquals(Send node, Node left, Node right, arg) {
- visits.add(new Visit(VisitKind.VISIT_NOT_EQUALS, left: left, right: right));
- apply(left, arg);
- apply(right, arg);
- }
-
- @override
- visitDynamicPropertyPrefix(
- Send node, Node receiver, Name name, IncDecOperator operator, arg) {
- visits.add(new Visit(VisitKind.VISIT_DYNAMIC_PROPERTY_PREFIX,
- receiver: receiver, operator: operator, name: name));
- super.visitDynamicPropertyPrefix(node, receiver, name, operator, arg);
- }
-
- @override
- visitDynamicPropertyPostfix(
- Send node, Node receiver, Name name, IncDecOperator operator, arg) {
- visits.add(new Visit(VisitKind.VISIT_DYNAMIC_PROPERTY_POSTFIX,
- receiver: receiver, operator: operator, name: name));
- super.visitDynamicPropertyPostfix(node, receiver, name, operator, arg);
- }
-
- @override
- visitDynamicPropertyGet(Send node, Node receiver, Name name, arg) {
- visits.add(new Visit(VisitKind.VISIT_DYNAMIC_PROPERTY_GET,
- receiver: receiver, name: name));
- super.visitDynamicPropertyGet(node, receiver, name, arg);
- }
-
- @override
- visitDynamicPropertyInvoke(
- Send node, Node receiver, NodeList arguments, Selector selector, arg) {
- visits.add(new Visit(VisitKind.VISIT_DYNAMIC_PROPERTY_INVOKE,
- receiver: receiver, name: selector.name, arguments: arguments));
- super.visitDynamicPropertyInvoke(node, receiver, arguments, selector, arg);
- }
-
- @override
- visitDynamicPropertySet(
- SendSet node, Node receiver, Name name, Node rhs, arg) {
- visits.add(new Visit(VisitKind.VISIT_DYNAMIC_PROPERTY_SET,
- receiver: receiver, name: name, rhs: rhs));
- super.visitDynamicPropertySet(node, receiver, name, rhs, arg);
- }
-
- @override
- visitDynamicTypeLiteralGet(Send node, ConstantExpression constant, arg) {
- visits.add(new Visit(VisitKind.VISIT_DYNAMIC_TYPE_LITERAL_GET,
- constant: constant.toDartText()));
- }
-
- @override
- visitDynamicTypeLiteralInvoke(Send node, ConstantExpression constant,
- NodeList arguments, CallStructure callStructure, arg) {
- visits.add(new Visit(VisitKind.VISIT_DYNAMIC_TYPE_LITERAL_INVOKE,
- constant: constant.toDartText(), arguments: arguments));
- }
-
- @override
- visitDynamicTypeLiteralSet(
- Send node, ConstantExpression constant, Node rhs, arg) {
- visits.add(new Visit(VisitKind.VISIT_DYNAMIC_TYPE_LITERAL_SET,
- constant: constant.toDartText(), rhs: rhs));
- super.visitDynamicTypeLiteralSet(node, constant, rhs, arg);
- }
-
- @override
- visitExpressionInvoke(Send node, Node expression, NodeList arguments,
- CallStructure callStructure, arg) {
- visits.add(new Visit(VisitKind.VISIT_EXPRESSION_INVOKE,
- receiver: expression, arguments: arguments));
- }
-
- @override
- visitIs(Send node, Node expression, ResolutionDartType type, arg) {
- visits
- .add(new Visit(VisitKind.VISIT_IS, expression: expression, type: type));
- apply(expression, arg);
- }
-
- @override
- visitIsNot(Send node, Node expression, ResolutionDartType type, arg) {
- visits.add(
- new Visit(VisitKind.VISIT_IS_NOT, expression: expression, type: type));
- apply(expression, arg);
- }
-
- @override
- visitLogicalAnd(Send node, Node left, Node right, arg) {
- visits
- .add(new Visit(VisitKind.VISIT_LOGICAL_AND, left: left, right: right));
- apply(left, arg);
- apply(right, arg);
- }
-
- @override
- visitLogicalOr(Send node, Node left, Node right, arg) {
- visits.add(new Visit(VisitKind.VISIT_LOGICAL_OR, left: left, right: right));
- apply(left, arg);
- apply(right, arg);
- }
-
- @override
- visitLocalFunctionGet(Send node, LocalFunctionElement function, arg) {
- visits
- .add(new Visit(VisitKind.VISIT_LOCAL_FUNCTION_GET, element: function));
- }
-
- @override
- visitLocalFunctionSet(
- SendSet node, LocalFunctionElement function, Node rhs, arg) {
- visits.add(new Visit(VisitKind.VISIT_LOCAL_FUNCTION_SET,
- element: function, rhs: rhs));
- super.visitLocalFunctionSet(node, function, rhs, arg);
- }
-
- @override
- visitLocalFunctionInvoke(Send node, LocalFunctionElement function,
- NodeList arguments, CallStructure callStructure, arg) {
- visits.add(new Visit(VisitKind.VISIT_LOCAL_FUNCTION_INVOKE,
- element: function, arguments: arguments, selector: callStructure));
- super.visitLocalFunctionInvoke(
- node, function, arguments, callStructure, arg);
- }
-
- @override
- visitLocalFunctionIncompatibleInvoke(Send node, LocalFunctionElement function,
- NodeList arguments, CallStructure callStructure, arg) {
- visits.add(new Visit(VisitKind.VISIT_LOCAL_FUNCTION_INCOMPATIBLE_INVOKE,
- element: function, arguments: arguments, selector: callStructure));
- super.visitLocalFunctionInvoke(
- node, function, arguments, callStructure, arg);
- }
-
- @override
- visitLocalVariableGet(Send node, LocalVariableElement variable, arg) {
- visits
- .add(new Visit(VisitKind.VISIT_LOCAL_VARIABLE_GET, element: variable));
- }
-
- @override
- visitLocalVariableInvoke(Send node, LocalVariableElement variable,
- NodeList arguments, CallStructure callStructure, arg) {
- visits.add(new Visit(VisitKind.VISIT_LOCAL_VARIABLE_INVOKE,
- element: variable, arguments: arguments, selector: callStructure));
- apply(arguments, arg);
- }
-
- @override
- visitLocalVariableSet(
- SendSet node, LocalVariableElement variable, Node rhs, arg) {
- visits.add(new Visit(VisitKind.VISIT_LOCAL_VARIABLE_SET,
- element: variable, rhs: rhs));
- super.visitLocalVariableSet(node, variable, rhs, arg);
- }
-
- @override
- visitFinalLocalVariableSet(
- SendSet node, LocalVariableElement variable, Node rhs, arg) {
- visits.add(new Visit(VisitKind.VISIT_FINAL_LOCAL_VARIABLE_SET,
- element: variable, rhs: rhs));
- super.visitFinalLocalVariableSet(node, variable, rhs, arg);
- }
-
- @override
- visitParameterGet(Send node, ParameterElement parameter, arg) {
- visits.add(new Visit(VisitKind.VISIT_PARAMETER_GET, element: parameter));
- }
-
- @override
- visitParameterInvoke(Send node, ParameterElement parameter,
- NodeList arguments, CallStructure callStructure, arg) {
- visits.add(new Visit(VisitKind.VISIT_PARAMETER_INVOKE,
- element: parameter, arguments: arguments, selector: callStructure));
- apply(arguments, arg);
- }
-
- @override
- visitParameterSet(SendSet node, ParameterElement parameter, Node rhs, arg) {
- visits.add(
- new Visit(VisitKind.VISIT_PARAMETER_SET, element: parameter, rhs: rhs));
- super.visitParameterSet(node, parameter, rhs, arg);
- }
-
- @override
- visitFinalParameterSet(
- SendSet node, ParameterElement parameter, Node rhs, arg) {
- visits.add(new Visit(VisitKind.VISIT_FINAL_PARAMETER_SET,
- element: parameter, rhs: rhs));
- super.visitFinalParameterSet(node, parameter, rhs, arg);
- }
-
- @override
- visitStaticFieldGet(Send node, FieldElement field, arg) {
- visits.add(new Visit(VisitKind.VISIT_STATIC_FIELD_GET, element: field));
- }
-
- @override
- visitStaticFieldInvoke(Send node, FieldElement field, NodeList arguments,
- CallStructure callStructure, arg) {
- visits.add(new Visit(VisitKind.VISIT_STATIC_FIELD_INVOKE,
- element: field, arguments: arguments));
- apply(arguments, arg);
- }
-
- @override
- visitStaticFieldSet(SendSet node, FieldElement field, Node rhs, arg) {
- visits.add(
- new Visit(VisitKind.VISIT_STATIC_FIELD_SET, element: field, rhs: rhs));
- super.visitStaticFieldSet(node, field, rhs, arg);
- }
-
- @override
- visitFinalStaticFieldSet(SendSet node, FieldElement field, Node rhs, arg) {
- visits.add(new Visit(VisitKind.VISIT_FINAL_STATIC_FIELD_SET,
- element: field, rhs: rhs));
- super.visitFinalStaticFieldSet(node, field, rhs, arg);
- }
-
- @override
- visitStaticFunctionGet(Send node, MethodElement function, arg) {
- visits
- .add(new Visit(VisitKind.VISIT_STATIC_FUNCTION_GET, element: function));
- }
-
- @override
- visitStaticFunctionSet(SendSet node, MethodElement function, Node rhs, arg) {
- visits.add(new Visit(VisitKind.VISIT_STATIC_FUNCTION_SET,
- element: function, rhs: rhs));
- super.visitStaticFunctionSet(node, function, rhs, arg);
- }
-
- @override
- visitStaticFunctionInvoke(Send node, MethodElement function,
- NodeList arguments, CallStructure callStructure, arg) {
- visits.add(new Visit(VisitKind.VISIT_STATIC_FUNCTION_INVOKE,
- element: function, arguments: arguments));
- super.visitStaticFunctionInvoke(
- node, function, arguments, callStructure, arg);
- }
-
- @override
- visitStaticFunctionIncompatibleInvoke(Send node, MethodElement function,
- NodeList arguments, CallStructure callStructure, arg) {
- visits.add(new Visit(VisitKind.VISIT_STATIC_FUNCTION_INCOMPATIBLE_INVOKE,
- element: function, arguments: arguments));
- apply(arguments, arg);
- }
-
- @override
- visitStaticGetterGet(Send node, FunctionElement getter, arg) {
- visits.add(new Visit(VisitKind.VISIT_STATIC_GETTER_GET, element: getter));
- super.visitStaticGetterGet(node, getter, arg);
- }
-
- @override
- visitStaticGetterSet(SendSet node, MethodElement getter, Node rhs, arg) {
- visits.add(new Visit(VisitKind.VISIT_STATIC_GETTER_SET,
- element: getter, rhs: rhs));
- super.visitStaticGetterSet(node, getter, rhs, arg);
- }
-
- @override
- visitStaticGetterInvoke(Send node, FunctionElement getter, NodeList arguments,
- CallStructure callStructure, arg) {
- visits.add(new Visit(VisitKind.VISIT_STATIC_GETTER_INVOKE,
- element: getter, arguments: arguments));
- super.visitStaticGetterInvoke(node, getter, arguments, callStructure, arg);
- }
-
- @override
- visitStaticSetterInvoke(Send node, FunctionElement setter, NodeList arguments,
- CallStructure callStructure, arg) {
- visits.add(new Visit(VisitKind.VISIT_STATIC_SETTER_INVOKE,
- element: setter, arguments: arguments));
- super.visitStaticSetterInvoke(node, setter, arguments, callStructure, arg);
- }
-
- @override
- visitStaticSetterGet(Send node, FunctionElement getter, arg) {
- visits.add(new Visit(VisitKind.VISIT_STATIC_SETTER_GET, element: getter));
- super.visitStaticSetterGet(node, getter, arg);
- }
-
- @override
- visitStaticSetterSet(SendSet node, FunctionElement setter, Node rhs, arg) {
- visits.add(new Visit(VisitKind.VISIT_STATIC_SETTER_SET,
- element: setter, rhs: rhs));
- super.visitStaticSetterSet(node, setter, rhs, arg);
- }
-
- @override
- visitSuperBinary(Send node, FunctionElement function, BinaryOperator operator,
- Node argument, arg) {
- visits.add(new Visit(VisitKind.VISIT_SUPER_BINARY,
- element: function, operator: operator, right: argument));
- apply(argument, arg);
- }
-
- @override
- visitUnresolvedSuperBinary(
- Send node, Element element, BinaryOperator operator, Node argument, arg) {
- visits.add(new Visit(VisitKind.VISIT_UNRESOLVED_SUPER_BINARY,
- operator: operator, right: argument));
- apply(argument, arg);
- }
-
- @override
- visitSuperIndex(Send node, FunctionElement function, Node index, arg) {
- visits.add(new Visit(VisitKind.VISIT_SUPER_INDEX,
- element: function, index: index));
- apply(index, arg);
- }
-
- @override
- visitUnresolvedSuperIndex(Send node, Element element, Node index, arg) {
- visits.add(new Visit(VisitKind.VISIT_UNRESOLVED_SUPER_INDEX, index: index));
- apply(index, arg);
- }
-
- @override
- visitSuperNotEquals(Send node, FunctionElement function, Node argument, arg) {
- visits.add(new Visit(VisitKind.VISIT_SUPER_NOT_EQUALS,
- element: function, right: argument));
- apply(argument, arg);
- }
-
- @override
- visitThisGet(Identifier node, arg) {
- visits.add(new Visit(VisitKind.VISIT_THIS_GET));
- }
-
- @override
- visitThisInvoke(
- Send node, NodeList arguments, CallStructure callStructure, arg) {
- visits.add(new Visit(VisitKind.VISIT_THIS_INVOKE, arguments: arguments));
- apply(arguments, arg);
- }
-
- @override
- visitThisPropertyGet(Send node, Name name, arg) {
- visits.add(new Visit(VisitKind.VISIT_THIS_PROPERTY_GET, name: name));
- super.visitThisPropertyGet(node, name, arg);
- }
-
- @override
- visitThisPropertyInvoke(
- Send node, NodeList arguments, Selector selector, arg) {
- visits.add(new Visit(VisitKind.VISIT_THIS_PROPERTY_INVOKE,
- name: selector.name, arguments: arguments));
- super.visitThisPropertyInvoke(node, arguments, selector, arg);
- }
-
- @override
- visitThisPropertySet(SendSet node, Name name, Node rhs, arg) {
- visits.add(
- new Visit(VisitKind.VISIT_THIS_PROPERTY_SET, name: name, rhs: rhs));
- super.visitThisPropertySet(node, name, rhs, arg);
- }
-
- @override
- visitTopLevelFieldGet(Send node, FieldElement field, arg) {
- visits.add(new Visit(VisitKind.VISIT_TOP_LEVEL_FIELD_GET, element: field));
- }
-
- @override
- visitTopLevelFieldInvoke(Send node, FieldElement field, NodeList arguments,
- CallStructure callStructure, arg) {
- visits.add(new Visit(VisitKind.VISIT_TOP_LEVEL_FIELD_INVOKE,
- element: field, arguments: arguments));
- apply(arguments, arg);
- }
-
- @override
- visitTopLevelFieldSet(SendSet node, FieldElement field, Node rhs, arg) {
- visits.add(new Visit(VisitKind.VISIT_TOP_LEVEL_FIELD_SET,
- element: field, rhs: rhs));
- super.visitTopLevelFieldSet(node, field, rhs, arg);
- }
-
- @override
- visitFinalTopLevelFieldSet(SendSet node, FieldElement field, Node rhs, arg) {
- visits.add(new Visit(VisitKind.VISIT_FINAL_TOP_LEVEL_FIELD_SET,
- element: field, rhs: rhs));
- super.visitFinalTopLevelFieldSet(node, field, rhs, arg);
- }
-
- @override
- visitTopLevelFunctionGet(Send node, MethodElement function, arg) {
- visits.add(
- new Visit(VisitKind.VISIT_TOP_LEVEL_FUNCTION_GET, element: function));
- }
-
- @override
- visitTopLevelFunctionSet(
- SendSet node, MethodElement function, Node rhs, arg) {
- visits.add(new Visit(VisitKind.VISIT_TOP_LEVEL_FUNCTION_SET,
- element: function, rhs: rhs));
- super.visitTopLevelFunctionSet(node, function, rhs, arg);
- }
-
- @override
- visitTopLevelFunctionInvoke(Send node, MethodElement function,
- NodeList arguments, CallStructure callStructure, arg) {
- visits.add(new Visit(VisitKind.VISIT_TOP_LEVEL_FUNCTION_INVOKE,
- element: function, arguments: arguments));
- apply(arguments, arg);
- }
-
- @override
- visitTopLevelFunctionIncompatibleInvoke(Send node, MethodElement function,
- NodeList arguments, CallStructure callStructure, arg) {
- visits.add(new Visit(VisitKind.VISIT_TOP_LEVEL_FUNCTION_INCOMPATIBLE_INVOKE,
- element: function, arguments: arguments));
- apply(arguments, arg);
- }
-
- @override
- visitTopLevelGetterGet(Send node, FunctionElement getter, arg) {
- visits
- .add(new Visit(VisitKind.VISIT_TOP_LEVEL_GETTER_GET, element: getter));
- super.visitTopLevelGetterGet(node, getter, arg);
- }
-
- @override
- visitTopLevelSetterGet(Send node, FunctionElement setter, arg) {
- visits
- .add(new Visit(VisitKind.VISIT_TOP_LEVEL_SETTER_GET, element: setter));
- super.visitTopLevelSetterGet(node, setter, arg);
- }
-
- @override
- visitTopLevelGetterInvoke(Send node, FunctionElement getter,
- NodeList arguments, CallStructure callStructure, arg) {
- visits.add(new Visit(VisitKind.VISIT_TOP_LEVEL_GETTER_INVOKE,
- element: getter, arguments: arguments));
- super
- .visitTopLevelGetterInvoke(node, getter, arguments, callStructure, arg);
- }
-
- @override
- visitTopLevelSetterInvoke(Send node, FunctionElement setter,
- NodeList arguments, CallStructure callStructure, arg) {
- visits.add(new Visit(VisitKind.VISIT_TOP_LEVEL_SETTER_INVOKE,
- element: setter, arguments: arguments));
- super
- .visitTopLevelSetterInvoke(node, setter, arguments, callStructure, arg);
- }
-
- @override
- visitTopLevelGetterSet(SendSet node, FunctionElement getter, Node rhs, arg) {
- visits.add(new Visit(VisitKind.VISIT_TOP_LEVEL_GETTER_SET,
- element: getter, rhs: rhs));
- super.visitTopLevelGetterSet(node, getter, rhs, arg);
- }
-
- @override
- visitTopLevelSetterSet(SendSet node, FunctionElement setter, Node rhs, arg) {
- visits.add(new Visit(VisitKind.VISIT_TOP_LEVEL_SETTER_SET,
- element: setter, rhs: rhs));
- super.visitTopLevelSetterSet(node, setter, rhs, arg);
- }
-
- @override
- visitTypeVariableTypeLiteralGet(Send node, TypeVariableElement element, arg) {
- visits.add(new Visit(VisitKind.VISIT_TYPE_VARIABLE_TYPE_LITERAL_GET,
- element: element));
- }
-
- @override
- visitTypeVariableTypeLiteralInvoke(Send node, TypeVariableElement element,
- NodeList arguments, CallStructure callStructure, arg) {
- visits.add(new Visit(VisitKind.VISIT_TYPE_VARIABLE_TYPE_LITERAL_INVOKE,
- element: element, arguments: arguments));
- apply(arguments, arg);
- }
-
- @override
- visitTypeVariableTypeLiteralSet(
- SendSet node, TypeVariableElement element, Node rhs, arg) {
- visits.add(new Visit(VisitKind.VISIT_TYPE_VARIABLE_TYPE_LITERAL_SET,
- element: element, rhs: rhs));
- super.visitTypeVariableTypeLiteralSet(node, element, rhs, arg);
- }
-
- @override
- visitTypedefTypeLiteralGet(Send node, ConstantExpression constant, arg) {
- visits.add(new Visit(VisitKind.VISIT_TYPEDEF_TYPE_LITERAL_GET,
- constant: constant.toDartText()));
- }
-
- @override
- visitTypedefTypeLiteralInvoke(Send node, ConstantExpression constant,
- NodeList arguments, CallStructure callStructure, arg) {
- visits.add(new Visit(VisitKind.VISIT_TYPEDEF_TYPE_LITERAL_INVOKE,
- constant: constant.toDartText(), arguments: arguments));
- apply(arguments, arg);
- }
-
- @override
- visitTypedefTypeLiteralSet(
- SendSet node, ConstantExpression constant, Node rhs, arg) {
- visits.add(new Visit(VisitKind.VISIT_TYPEDEF_TYPE_LITERAL_SET,
- constant: constant.toDartText(), rhs: rhs));
- super.visitTypedefTypeLiteralSet(node, constant, rhs, arg);
- }
-
- @override
- visitUnary(Send node, UnaryOperator operator, Node expression, arg) {
- visits.add(new Visit(VisitKind.VISIT_UNARY,
- expression: expression, operator: operator));
- super.visitUnary(node, operator, expression, arg);
- }
-
- @override
- errorUndefinedUnaryExpression(
- Send node, Operator operator, Node expression, arg) {
- visits.add(new Visit(VisitKind.ERROR_UNDEFINED_UNARY_EXPRESSION,
- expression: expression, operator: operator));
- super.errorUndefinedUnaryExpression(node, operator, expression, arg);
- }
-
- @override
- visitNot(Send node, Node expression, arg) {
- visits.add(new Visit(VisitKind.VISIT_NOT, expression: expression));
- apply(expression, arg);
- }
-
- @override
- visitSuperFieldGet(Send node, FieldElement field, arg) {
- visits.add(new Visit(VisitKind.VISIT_SUPER_FIELD_GET, element: field));
- }
-
- @override
- visitUnresolvedSuperGet(Send node, Element element, arg) {
- visits.add(new Visit(VisitKind.VISIT_UNRESOLVED_SUPER_GET));
- return super.visitUnresolvedSuperGet(node, element, arg);
- }
-
- @override
- visitUnresolvedSuperSet(Send node, Element element, Node rhs, arg) {
- visits.add(new Visit(VisitKind.VISIT_UNRESOLVED_SUPER_SET, rhs: rhs));
- return super.visitUnresolvedSuperSet(node, element, rhs, arg);
- }
-
- @override
- visitSuperFieldInvoke(Send node, FieldElement field, NodeList arguments,
- CallStructure callStructure, arg) {
- visits.add(new Visit(VisitKind.VISIT_SUPER_FIELD_INVOKE,
- element: field, arguments: arguments));
- apply(arguments, arg);
- }
-
- @override
- visitUnresolvedSuperInvoke(
- Send node, Element element, NodeList arguments, Selector selector, arg) {
- visits.add(new Visit(VisitKind.VISIT_UNRESOLVED_SUPER_INVOKE,
- arguments: arguments));
- apply(arguments, arg);
- }
-
- @override
- visitSuperFieldSet(SendSet node, FieldElement field, Node rhs, arg) {
- visits.add(
- new Visit(VisitKind.VISIT_SUPER_FIELD_SET, element: field, rhs: rhs));
- super.visitSuperFieldSet(node, field, rhs, arg);
- }
-
- @override
- visitFinalSuperFieldSet(SendSet node, FieldElement field, Node rhs, arg) {
- visits.add(new Visit(VisitKind.VISIT_FINAL_SUPER_FIELD_SET,
- element: field, rhs: rhs));
- super.visitFinalSuperFieldSet(node, field, rhs, arg);
- }
-
- @override
- visitSuperMethodGet(Send node, MethodElement method, arg) {
- visits.add(new Visit(VisitKind.VISIT_SUPER_METHOD_GET, element: method));
- }
-
- @override
- visitSuperMethodSet(SendSet node, MethodElement method, Node rhs, arg) {
- visits.add(
- new Visit(VisitKind.VISIT_SUPER_METHOD_SET, element: method, rhs: rhs));
- super.visitSuperMethodSet(node, method, rhs, arg);
- }
-
- @override
- visitSuperMethodInvoke(Send node, MethodElement method, NodeList arguments,
- CallStructure callStructure, arg) {
- visits.add(new Visit(VisitKind.VISIT_SUPER_METHOD_INVOKE,
- element: method, arguments: arguments));
- apply(arguments, arg);
- }
-
- @override
- visitSuperMethodIncompatibleInvoke(Send node, MethodElement method,
- NodeList arguments, CallStructure callStructure, arg) {
- visits.add(new Visit(VisitKind.VISIT_SUPER_METHOD_INCOMPATIBLE_INVOKE,
- element: method, arguments: arguments));
- apply(arguments, arg);
- }
-
- @override
- visitSuperGetterGet(Send node, FunctionElement getter, arg) {
- visits.add(new Visit(VisitKind.VISIT_SUPER_GETTER_GET, element: getter));
- super.visitSuperGetterGet(node, getter, arg);
- }
-
- @override
- visitSuperSetterGet(Send node, FunctionElement setter, arg) {
- visits.add(new Visit(VisitKind.VISIT_SUPER_SETTER_GET, element: setter));
- super.visitSuperSetterGet(node, setter, arg);
- }
-
- @override
- visitSuperGetterInvoke(Send node, FunctionElement getter, NodeList arguments,
- CallStructure callStructure, arg) {
- visits.add(new Visit(VisitKind.VISIT_SUPER_GETTER_INVOKE,
- element: getter, arguments: arguments));
- super.visitSuperGetterInvoke(node, getter, arguments, callStructure, arg);
- }
-
- @override
- visitSuperSetterInvoke(Send node, FunctionElement setter, NodeList arguments,
- CallStructure callStructure, arg) {
- visits.add(new Visit(VisitKind.VISIT_SUPER_SETTER_INVOKE,
- element: setter, arguments: arguments));
- super.visitSuperSetterInvoke(node, setter, arguments, callStructure, arg);
- }
-
- @override
- visitSuperGetterSet(SendSet node, FunctionElement getter, Node rhs, arg) {
- visits.add(
- new Visit(VisitKind.VISIT_SUPER_GETTER_SET, element: getter, rhs: rhs));
- super.visitSuperGetterSet(node, getter, rhs, arg);
- }
-
- @override
- visitSuperSetterSet(SendSet node, FunctionElement setter, Node rhs, arg) {
- visits.add(
- new Visit(VisitKind.VISIT_SUPER_SETTER_SET, element: setter, rhs: rhs));
- super.visitSuperSetterSet(node, setter, rhs, arg);
- }
-
- @override
- visitSuperUnary(
- Send node, UnaryOperator operator, FunctionElement function, arg) {
- visits.add(new Visit(VisitKind.VISIT_SUPER_UNARY,
- element: function, operator: operator));
- }
-
- @override
- visitUnresolvedSuperUnary(
- Send node, UnaryOperator operator, Element element, arg) {
- visits.add(
- new Visit(VisitKind.VISIT_UNRESOLVED_SUPER_UNARY, operator: operator));
- }
-
- @override
- visitEquals(Send node, Node left, Node right, arg) {
- visits.add(new Visit(VisitKind.VISIT_EQUALS, left: left, right: right));
- apply(left, arg);
- apply(right, arg);
- }
-
- @override
- visitSuperEquals(Send node, FunctionElement function, Node argument, arg) {
- visits.add(new Visit(VisitKind.VISIT_SUPER_EQUALS,
- element: function, right: argument));
- apply(argument, arg);
- }
-
- @override
- visitIndexSet(Send node, Node receiver, Node index, Node rhs, arg) {
- visits.add(new Visit(VisitKind.VISIT_INDEX_SET,
- receiver: receiver, index: index, rhs: rhs));
- apply(receiver, arg);
- apply(index, arg);
- apply(rhs, arg);
- }
-
- @override
- visitSuperIndexSet(
- Send node, FunctionElement function, Node index, Node rhs, arg) {
- visits.add(new Visit(VisitKind.VISIT_SUPER_INDEX_SET,
- element: function, index: index, rhs: rhs));
- apply(index, arg);
- apply(rhs, arg);
- }
-
- @override
- visitDynamicPropertyCompound(Send node, Node receiver, Name name,
- AssignmentOperator operator, Node rhs, arg) {
- visits.add(new Visit(VisitKind.VISIT_DYNAMIC_PROPERTY_COMPOUND,
- receiver: receiver, operator: operator, rhs: rhs, name: name));
- super
- .visitDynamicPropertyCompound(node, receiver, name, operator, rhs, arg);
- }
-
- @override
- visitFinalLocalVariableCompound(Send node, LocalVariableElement variable,
- AssignmentOperator operator, Node rhs, arg) {
- visits.add(new Visit(VisitKind.VISIT_FINAL_LOCAL_VARIABLE_COMPOUND,
- element: variable, operator: operator, rhs: rhs));
- apply(rhs, arg);
- }
-
- @override
- visitFinalLocalVariablePrefix(
- Send node, LocalVariableElement variable, IncDecOperator operator, arg) {
- visits.add(new Visit(VisitKind.VISIT_FINAL_LOCAL_VARIABLE_PREFIX,
- element: variable, operator: operator));
- }
-
- @override
- visitFinalLocalVariablePostfix(
- Send node, LocalVariableElement variable, IncDecOperator operator, arg) {
- visits.add(new Visit(VisitKind.VISIT_FINAL_LOCAL_VARIABLE_POSTFIX,
- element: variable, operator: operator));
- }
-
- @override
- visitFinalParameterCompound(Send node, ParameterElement parameter,
- AssignmentOperator operator, Node rhs, arg) {
- visits.add(new Visit(VisitKind.VISIT_FINAL_PARAMETER_COMPOUND,
- element: parameter, operator: operator, rhs: rhs));
- apply(rhs, arg);
- }
-
- @override
- visitFinalParameterPrefix(
- Send node, ParameterElement parameter, IncDecOperator operator, arg) {
- visits.add(new Visit(VisitKind.VISIT_FINAL_PARAMETER_PREFIX,
- element: parameter, operator: operator));
- }
-
- @override
- visitFinalParameterPostfix(
- Send node, ParameterElement parameter, IncDecOperator operator, arg) {
- visits.add(new Visit(VisitKind.VISIT_FINAL_PARAMETER_POSTFIX,
- element: parameter, operator: operator));
- }
-
- @override
- visitFinalStaticFieldCompound(Send node, FieldElement field,
- AssignmentOperator operator, Node rhs, arg) {
- visits.add(new Visit(VisitKind.VISIT_STATIC_FINAL_FIELD_COMPOUND,
- element: field, operator: operator, rhs: rhs));
- apply(rhs, arg);
- }
-
- @override
- visitFinalStaticFieldPostfix(
- Send node, FieldElement field, IncDecOperator operator, arg) {
- visits.add(new Visit(VisitKind.VISIT_STATIC_FINAL_FIELD_POSTFIX,
- element: field, operator: operator));
- }
-
- @override
- visitFinalStaticFieldPrefix(
- Send node, FieldElement field, IncDecOperator operator, arg) {
- visits.add(new Visit(VisitKind.VISIT_STATIC_FINAL_FIELD_PREFIX,
- element: field, operator: operator));
- }
-
- @override
- visitFinalSuperFieldCompound(Send node, FieldElement field,
- AssignmentOperator operator, Node rhs, arg) {
- visits.add(new Visit(VisitKind.VISIT_SUPER_FINAL_FIELD_COMPOUND,
- element: field, operator: operator, rhs: rhs));
- apply(rhs, arg);
- }
-
- @override
- visitFinalTopLevelFieldCompound(Send node, FieldElement field,
- AssignmentOperator operator, Node rhs, arg) {
- visits.add(new Visit(VisitKind.VISIT_TOP_LEVEL_FINAL_FIELD_COMPOUND,
- element: field, operator: operator, rhs: rhs));
- apply(rhs, arg);
- }
-
- @override
- visitFinalTopLevelFieldPostfix(
- Send node, FieldElement field, IncDecOperator operator, arg) {
- visits.add(new Visit(VisitKind.VISIT_TOP_LEVEL_FINAL_FIELD_POSTFIX,
- element: field, operator: operator));
- }
-
- @override
- visitFinalTopLevelFieldPrefix(
- Send node, FieldElement field, IncDecOperator operator, arg) {
- visits.add(new Visit(VisitKind.VISIT_TOP_LEVEL_FINAL_FIELD_PREFIX,
- element: field, operator: operator));
- }
-
- @override
- visitLocalFunctionCompound(Send node, LocalFunctionElement function,
- AssignmentOperator operator, Node rhs, arg) {
- visits.add(new Visit(VisitKind.VISIT_LOCAL_FUNCTION_COMPOUND,
- element: function, operator: operator, rhs: rhs));
- apply(rhs, arg);
- }
-
- @override
- visitLocalVariableCompound(Send node, LocalVariableElement variable,
- AssignmentOperator operator, Node rhs, arg) {
- visits.add(new Visit(VisitKind.VISIT_LOCAL_VARIABLE_COMPOUND,
- element: variable, operator: operator, rhs: rhs));
- apply(rhs, arg);
- }
-
- @override
- visitParameterCompound(Send node, ParameterElement parameter,
- AssignmentOperator operator, Node rhs, arg) {
- visits.add(new Visit(VisitKind.VISIT_PARAMETER_COMPOUND,
- element: parameter, operator: operator, rhs: rhs));
- apply(rhs, arg);
- }
-
- @override
- visitStaticFieldCompound(Send node, FieldElement field,
- AssignmentOperator operator, Node rhs, arg) {
- visits.add(new Visit(VisitKind.VISIT_STATIC_FIELD_COMPOUND,
- element: field, operator: operator, rhs: rhs));
- apply(rhs, arg);
- }
-
- @override
- visitStaticGetterSetterCompound(Send node, FunctionElement getter,
- FunctionElement setter, AssignmentOperator operator, Node rhs, arg) {
- visits.add(new Visit(VisitKind.VISIT_STATIC_GETTER_SETTER_COMPOUND,
- operator: operator, rhs: rhs, getter: getter, setter: setter));
- apply(rhs, arg);
- }
-
- @override
- visitSuperFieldCompound(Send node, FieldElement field,
- AssignmentOperator operator, Node rhs, arg) {
- visits.add(new Visit(VisitKind.VISIT_SUPER_FIELD_COMPOUND,
- element: field, operator: operator, rhs: rhs));
- apply(rhs, arg);
- }
-
- @override
- visitSuperGetterSetterCompound(Send node, FunctionElement getter,
- FunctionElement setter, AssignmentOperator operator, Node rhs, arg) {
- visits.add(new Visit(VisitKind.VISIT_SUPER_GETTER_SETTER_COMPOUND,
- operator: operator, rhs: rhs, getter: getter, setter: setter));
- apply(rhs, arg);
- }
-
- @override
- visitThisPropertyCompound(
- Send node, Name name, AssignmentOperator operator, Node rhs, arg) {
- visits.add(new Visit(VisitKind.VISIT_THIS_PROPERTY_COMPOUND,
- name: name, operator: operator, rhs: rhs));
- super.visitThisPropertyCompound(node, name, operator, rhs, arg);
- }
-
- @override
- visitTopLevelFieldCompound(Send node, FieldElement field,
- AssignmentOperator operator, Node rhs, arg) {
- visits.add(new Visit(VisitKind.VISIT_TOP_LEVEL_FIELD_COMPOUND,
- element: field, operator: operator, rhs: rhs));
- apply(rhs, arg);
- }
-
- @override
- visitTopLevelGetterSetterCompound(Send node, FunctionElement getter,
- FunctionElement setter, AssignmentOperator operator, Node rhs, arg) {
- visits.add(new Visit(VisitKind.VISIT_TOP_LEVEL_GETTER_SETTER_COMPOUND,
- operator: operator, rhs: rhs, getter: getter, setter: setter));
- apply(rhs, arg);
- }
-
- @override
- visitStaticMethodSetterCompound(Send node, FunctionElement method,
- FunctionElement setter, AssignmentOperator operator, Node rhs, arg) {
- visits.add(new Visit(VisitKind.VISIT_STATIC_METHOD_SETTER_COMPOUND,
- operator: operator, rhs: rhs, getter: method, setter: setter));
- apply(rhs, arg);
- }
-
- @override
- visitSuperFieldSetterCompound(Send node, FieldElement field,
- FunctionElement setter, AssignmentOperator operator, Node rhs, arg) {
- visits.add(new Visit(VisitKind.VISIT_SUPER_FIELD_SETTER_COMPOUND,
- operator: operator, rhs: rhs, getter: field, setter: setter));
- apply(rhs, arg);
- }
-
- @override
- visitSuperGetterFieldCompound(Send node, FunctionElement getter,
- FieldElement field, AssignmentOperator operator, Node rhs, arg) {
- visits.add(new Visit(VisitKind.VISIT_SUPER_GETTER_FIELD_COMPOUND,
- operator: operator, rhs: rhs, getter: getter, setter: field));
- apply(rhs, arg);
- }
-
- @override
- visitSuperMethodSetterCompound(Send node, FunctionElement method,
- FunctionElement setter, AssignmentOperator operator, Node rhs, arg) {
- visits.add(new Visit(VisitKind.VISIT_SUPER_METHOD_SETTER_COMPOUND,
- getter: method, setter: setter, operator: operator, rhs: rhs));
- apply(rhs, arg);
- }
-
- @override
- visitSuperMethodCompound(Send node, FunctionElement method,
- AssignmentOperator operator, Node rhs, arg) {
- visits.add(new Visit(VisitKind.VISIT_SUPER_METHOD_COMPOUND,
- element: method, operator: operator, rhs: rhs));
- apply(rhs, arg);
- }
-
- @override
- visitSuperMethodPrefix(
- Send node, FunctionElement method, IncDecOperator operator, arg) {
- visits.add(new Visit(VisitKind.VISIT_SUPER_METHOD_PREFIX,
- element: method, operator: operator));
- }
-
- @override
- visitSuperMethodPostfix(
- Send node, FunctionElement method, IncDecOperator operator, arg) {
- visits.add(new Visit(VisitKind.VISIT_SUPER_METHOD_POSTFIX,
- element: method, operator: operator));
- }
-
- @override
- visitUnresolvedSuperCompound(
- Send node, Element element, AssignmentOperator operator, Node rhs, arg) {
- visits.add(new Visit(VisitKind.VISIT_UNRESOLVED_SUPER_COMPOUND,
- operator: operator, rhs: rhs));
- apply(rhs, arg);
- }
-
- @override
- visitUnresolvedSuperPrefix(
- Send node, Element element, IncDecOperator operator, arg) {
- visits.add(
- new Visit(VisitKind.VISIT_UNRESOLVED_SUPER_PREFIX, operator: operator));
- }
-
- @override
- visitUnresolvedSuperPostfix(
- Send node, Element element, IncDecOperator operator, arg) {
- visits.add(new Visit(VisitKind.VISIT_UNRESOLVED_SUPER_POSTFIX,
- operator: operator));
- }
-
- @override
- visitTopLevelMethodSetterCompound(Send node, FunctionElement method,
- FunctionElement setter, AssignmentOperator operator, Node rhs, arg) {
- visits.add(new Visit(VisitKind.VISIT_TOP_LEVEL_METHOD_SETTER_COMPOUND,
- getter: method, setter: setter, operator: operator, rhs: rhs));
- apply(rhs, arg);
- }
-
- @override
- visitCompoundIndexSet(Send node, Node receiver, Node index,
- AssignmentOperator operator, Node rhs, arg) {
- visits.add(new Visit(VisitKind.VISIT_COMPOUND_INDEX_SET,
- receiver: receiver, index: index, rhs: rhs, operator: operator));
- apply(receiver, arg);
- apply(index, arg);
- apply(rhs, arg);
- }
-
- @override
- visitSuperCompoundIndexSet(
- Send node,
- FunctionElement getter,
- FunctionElement setter,
- Node index,
- AssignmentOperator operator,
- Node rhs,
- arg) {
- visits.add(new Visit(VisitKind.VISIT_SUPER_COMPOUND_INDEX_SET,
- getter: getter,
- setter: setter,
- index: index,
- rhs: rhs,
- operator: operator));
- apply(index, arg);
- apply(rhs, arg);
- }
-
- @override
- visitClassTypeLiteralCompound(Send node, ConstantExpression constant,
- AssignmentOperator operator, Node rhs, arg) {
- visits.add(new Visit(VisitKind.VISIT_CLASS_TYPE_LITERAL_COMPOUND,
- constant: constant.toDartText(), operator: operator, rhs: rhs));
- apply(rhs, arg);
- }
-
- @override
- visitDynamicTypeLiteralCompound(Send node, ConstantExpression constant,
- AssignmentOperator operator, Node rhs, arg) {
- visits.add(new Visit(VisitKind.VISIT_DYNAMIC_TYPE_LITERAL_COMPOUND,
- constant: constant.toDartText(), operator: operator, rhs: rhs));
- apply(rhs, arg);
- }
-
- @override
- visitTypeVariableTypeLiteralCompound(Send node, TypeVariableElement element,
- AssignmentOperator operator, Node rhs, arg) {
- visits.add(new Visit(VisitKind.VISIT_TYPE_VARIABLE_TYPE_LITERAL_COMPOUND,
- element: element, operator: operator, rhs: rhs));
- apply(rhs, arg);
- }
-
- @override
- visitTypedefTypeLiteralCompound(Send node, ConstantExpression constant,
- AssignmentOperator operator, Node rhs, arg) {
- visits.add(new Visit(VisitKind.VISIT_TYPEDEF_TYPE_LITERAL_COMPOUND,
- constant: constant.toDartText(), operator: operator, rhs: rhs));
- apply(rhs, arg);
- }
-
- @override
- visitLocalFunctionPrefix(
- Send node, LocalFunctionElement function, IncDecOperator operator, arg) {
- visits.add(new Visit(VisitKind.VISIT_LOCAL_FUNCTION_PREFIX,
- element: function, operator: operator));
- }
-
- @override
- visitClassTypeLiteralPrefix(
- Send node, ConstantExpression constant, IncDecOperator operator, arg) {
- visits.add(new Visit(VisitKind.VISIT_CLASS_TYPE_LITERAL_PREFIX,
- constant: constant.toDartText(), operator: operator));
- }
-
- @override
- visitDynamicTypeLiteralPrefix(
- Send node, ConstantExpression constant, IncDecOperator operator, arg) {
- visits.add(new Visit(VisitKind.VISIT_DYNAMIC_TYPE_LITERAL_PREFIX,
- constant: constant.toDartText(), operator: operator));
- }
-
- @override
- visitLocalVariablePrefix(
- Send node, LocalVariableElement variable, IncDecOperator operator, arg) {
- visits.add(new Visit(VisitKind.VISIT_LOCAL_VARIABLE_PREFIX,
- element: variable, operator: operator));
- }
-
- @override
- visitParameterPrefix(
- Send node, ParameterElement parameter, IncDecOperator operator, arg) {
- visits.add(new Visit(VisitKind.VISIT_PARAMETER_PREFIX,
- element: parameter, operator: operator));
- }
-
- @override
- visitStaticFieldPrefix(
- Send node, FieldElement field, IncDecOperator operator, arg) {
- visits.add(new Visit(VisitKind.VISIT_STATIC_FIELD_PREFIX,
- element: field, operator: operator));
- }
-
- @override
- visitStaticGetterSetterPrefix(Send node, FunctionElement getter,
- FunctionElement setter, IncDecOperator operator, arg) {
- visits.add(new Visit(VisitKind.VISIT_STATIC_GETTER_SETTER_PREFIX,
- getter: getter, setter: setter, operator: operator));
- }
-
- @override
- visitStaticMethodSetterPrefix(Send node, FunctionElement getter,
- FunctionElement setter, IncDecOperator operator, arg) {
- visits.add(new Visit(VisitKind.VISIT_STATIC_METHOD_SETTER_PREFIX,
- getter: getter, setter: setter, operator: operator));
- }
-
- @override
- visitSuperFieldFieldCompound(Send node, FieldElement readField,
- FieldElement writtenField, AssignmentOperator operator, Node rhs, arg) {
- visits.add(new Visit(VisitKind.VISIT_SUPER_FIELD_FIELD_COMPOUND,
- getter: readField, setter: writtenField, operator: operator, rhs: rhs));
- apply(rhs, arg);
- }
-
- @override
- visitSuperFieldFieldPrefix(Send node, FieldElement readField,
- FieldElement writtenField, IncDecOperator operator, arg) {
- visits.add(new Visit(VisitKind.VISIT_SUPER_FIELD_FIELD_PREFIX,
- getter: readField, setter: writtenField, operator: operator));
- }
-
- @override
- visitSuperFieldPrefix(
- Send node, FieldElement field, IncDecOperator operator, arg) {
- visits.add(new Visit(VisitKind.VISIT_SUPER_FIELD_PREFIX,
- element: field, operator: operator));
- }
-
- @override
- visitFinalSuperFieldPrefix(
- Send node, FieldElement field, IncDecOperator operator, arg) {
- visits.add(new Visit(VisitKind.VISIT_SUPER_FINAL_FIELD_PREFIX,
- element: field, operator: operator));
- }
-
- @override
- visitSuperFieldSetterPrefix(Send node, FieldElement field,
- FunctionElement setter, IncDecOperator operator, arg) {
- visits.add(new Visit(VisitKind.VISIT_SUPER_FIELD_SETTER_PREFIX,
- getter: field, setter: setter, operator: operator));
- }
-
- @override
- visitSuperGetterFieldPrefix(Send node, FunctionElement getter,
- FieldElement field, IncDecOperator operator, arg) {
- visits.add(new Visit(VisitKind.VISIT_SUPER_GETTER_FIELD_PREFIX,
- getter: getter, setter: field, operator: operator));
- }
-
- @override
- visitSuperGetterSetterPrefix(Send node, FunctionElement getter,
- FunctionElement setter, IncDecOperator operator, arg) {
- visits.add(new Visit(VisitKind.VISIT_SUPER_GETTER_SETTER_PREFIX,
- getter: getter, setter: setter, operator: operator));
- }
-
- @override
- visitSuperMethodSetterPrefix(Send node, FunctionElement method,
- FunctionElement setter, IncDecOperator operator, arg) {
- visits.add(new Visit(VisitKind.VISIT_SUPER_METHOD_SETTER_PREFIX,
- getter: method, setter: setter, operator: operator));
- }
-
- @override
- visitThisPropertyPrefix(Send node, Name name, IncDecOperator operator, arg) {
- visits.add(new Visit(VisitKind.VISIT_THIS_PROPERTY_PREFIX,
- name: name, operator: operator));
- super.visitThisPropertyPrefix(node, name, operator, arg);
- }
-
- @override
- visitTopLevelFieldPrefix(
- Send node, FieldElement field, IncDecOperator operator, arg) {
- visits.add(new Visit(VisitKind.VISIT_TOP_LEVEL_FIELD_PREFIX,
- element: field, operator: operator));
- }
-
- @override
- visitTopLevelGetterSetterPrefix(Send node, FunctionElement getter,
- FunctionElement setter, IncDecOperator operator, arg) {
- visits.add(new Visit(VisitKind.VISIT_TOP_LEVEL_GETTER_SETTER_PREFIX,
- getter: getter, setter: setter, operator: operator));
- }
-
- @override
- visitTopLevelMethodSetterPrefix(Send node, FunctionElement method,
- FunctionElement setter, IncDecOperator operator, arg) {
- visits.add(new Visit(VisitKind.VISIT_TOP_LEVEL_METHOD_SETTER_PREFIX,
- getter: method, setter: setter, operator: operator));
- }
-
- @override
- visitTypeVariableTypeLiteralPrefix(
- Send node, TypeVariableElement element, IncDecOperator operator, arg) {
- visits.add(new Visit(VisitKind.VISIT_TYPE_VARIABLE_TYPE_LITERAL_PREFIX,
- element: element, operator: operator));
- }
-
- @override
- visitTypedefTypeLiteralPrefix(
- Send node, ConstantExpression constant, IncDecOperator operator, arg) {
- visits.add(new Visit(VisitKind.VISIT_TYPEDEF_TYPE_LITERAL_PREFIX,
- constant: constant.toDartText(), operator: operator));
- }
-
- @override
- visitLocalFunctionPostfix(
- Send node, LocalFunctionElement function, IncDecOperator operator, arg) {
- visits.add(new Visit(VisitKind.VISIT_LOCAL_FUNCTION_POSTFIX,
- element: function, operator: operator));
- }
-
- @override
- visitClassTypeLiteralPostfix(
- Send node, ConstantExpression constant, IncDecOperator operator, arg) {
- visits.add(new Visit(VisitKind.VISIT_CLASS_TYPE_LITERAL_POSTFIX,
- constant: constant.toDartText(), operator: operator));
- }
-
- @override
- visitDynamicTypeLiteralPostfix(
- Send node, ConstantExpression constant, IncDecOperator operator, arg) {
- visits.add(new Visit(VisitKind.VISIT_DYNAMIC_TYPE_LITERAL_POSTFIX,
- constant: constant.toDartText(), operator: operator));
- }
-
- @override
- visitLocalVariablePostfix(
- Send node, LocalVariableElement variable, IncDecOperator operator, arg) {
- visits.add(new Visit(VisitKind.VISIT_LOCAL_VARIABLE_POSTFIX,
- element: variable, operator: operator));
- }
-
- @override
- visitParameterPostfix(
- Send node, ParameterElement parameter, IncDecOperator operator, arg) {
- visits.add(new Visit(VisitKind.VISIT_PARAMETER_POSTFIX,
- element: parameter, operator: operator));
- }
-
- @override
- visitStaticFieldPostfix(
- Send node, FieldElement field, IncDecOperator operator, arg) {
- visits.add(new Visit(VisitKind.VISIT_STATIC_FIELD_POSTFIX,
- element: field, operator: operator));
- }
-
- @override
- visitStaticGetterSetterPostfix(Send node, FunctionElement getter,
- FunctionElement setter, IncDecOperator operator, arg) {
- visits.add(new Visit(VisitKind.VISIT_STATIC_GETTER_SETTER_POSTFIX,
- getter: getter, setter: setter, operator: operator));
- }
-
- @override
- visitStaticMethodSetterPostfix(Send node, FunctionElement getter,
- FunctionElement setter, IncDecOperator operator, arg) {
- visits.add(new Visit(VisitKind.VISIT_STATIC_METHOD_SETTER_POSTFIX,
- getter: getter, setter: setter, operator: operator));
- }
-
- @override
- visitSuperFieldFieldPostfix(Send node, FieldElement readField,
- FieldElement writtenField, IncDecOperator operator, arg) {
- visits.add(new Visit(VisitKind.VISIT_SUPER_FIELD_FIELD_POSTFIX,
- getter: readField, setter: writtenField, operator: operator));
- }
-
- @override
- visitSuperFieldPostfix(
- Send node, FieldElement field, IncDecOperator operator, arg) {
- visits.add(new Visit(VisitKind.VISIT_SUPER_FIELD_POSTFIX,
- element: field, operator: operator));
- }
-
- @override
- visitFinalSuperFieldPostfix(
- Send node, FieldElement field, IncDecOperator operator, arg) {
- visits.add(new Visit(VisitKind.VISIT_SUPER_FINAL_FIELD_POSTFIX,
- element: field, operator: operator));
- }
-
- @override
- visitSuperFieldSetterPostfix(Send node, FieldElement field,
- FunctionElement setter, IncDecOperator operator, arg) {
- visits.add(new Visit(VisitKind.VISIT_SUPER_FIELD_SETTER_POSTFIX,
- getter: field, setter: setter, operator: operator));
- }
-
- @override
- visitSuperGetterFieldPostfix(Send node, FunctionElement getter,
- FieldElement field, IncDecOperator operator, arg) {
- visits.add(new Visit(VisitKind.VISIT_SUPER_GETTER_FIELD_POSTFIX,
- getter: getter, setter: field, operator: operator));
- }
-
- @override
- visitSuperGetterSetterPostfix(Send node, FunctionElement getter,
- FunctionElement setter, IncDecOperator operator, arg) {
- visits.add(new Visit(VisitKind.VISIT_SUPER_GETTER_SETTER_POSTFIX,
- getter: getter, setter: setter, operator: operator));
- }
-
- @override
- visitSuperMethodSetterPostfix(Send node, FunctionElement method,
- FunctionElement setter, IncDecOperator operator, arg) {
- visits.add(new Visit(VisitKind.VISIT_SUPER_METHOD_SETTER_POSTFIX,
- getter: method, setter: setter, operator: operator));
- }
-
- @override
- visitThisPropertyPostfix(Send node, Name name, IncDecOperator operator, arg) {
- visits.add(new Visit(VisitKind.VISIT_THIS_PROPERTY_POSTFIX,
- name: name, operator: operator));
- super.visitThisPropertyPostfix(node, name, operator, arg);
- }
-
- @override
- visitTopLevelFieldPostfix(
- Send node, FieldElement field, IncDecOperator operator, arg) {
- visits.add(new Visit(VisitKind.VISIT_TOP_LEVEL_FIELD_POSTFIX,
- element: field, operator: operator));
- }
-
- @override
- visitTopLevelGetterSetterPostfix(Send node, FunctionElement getter,
- FunctionElement setter, IncDecOperator operator, arg) {
- visits.add(new Visit(VisitKind.VISIT_TOP_LEVEL_GETTER_SETTER_POSTFIX,
- getter: getter, setter: setter, operator: operator));
- }
-
- @override
- visitTopLevelMethodSetterPostfix(Send node, FunctionElement method,
- FunctionElement setter, IncDecOperator operator, arg) {
- visits.add(new Visit(VisitKind.VISIT_TOP_LEVEL_METHOD_SETTER_POSTFIX,
- getter: method, setter: setter, operator: operator));
- }
-
- @override
- visitTypeVariableTypeLiteralPostfix(
- Send node, TypeVariableElement element, IncDecOperator operator, arg) {
- visits.add(new Visit(VisitKind.VISIT_TYPE_VARIABLE_TYPE_LITERAL_POSTFIX,
- element: element, operator: operator));
- }
-
- @override
- visitTypedefTypeLiteralPostfix(
- Send node, ConstantExpression constant, IncDecOperator operator, arg) {
- visits.add(new Visit(VisitKind.VISIT_TYPEDEF_TYPE_LITERAL_POSTFIX,
- constant: constant.toDartText(), operator: operator));
- }
-
- @override
- visitUnresolvedCompound(Send node, ErroneousElement element,
- AssignmentOperator operator, Node rhs, arg) {
- visits.add(new Visit(VisitKind.VISIT_UNRESOLVED_COMPOUND,
- operator: operator, rhs: rhs));
- apply(rhs, arg);
- }
-
- @override
- visitUnresolvedGet(Send node, Element element, arg) {
- visits.add(new Visit(VisitKind.VISIT_UNRESOLVED_GET, name: element.name));
- }
-
- @override
- visitUnresolvedSet(Send node, Element element, Node rhs, arg) {
- visits.add(new Visit(VisitKind.VISIT_UNRESOLVED_SET,
- name: element.name, rhs: rhs));
- super.visitUnresolvedSet(node, element, rhs, arg);
- }
-
- @override
- visitUnresolvedInvoke(
- Send node, Element element, NodeList arguments, Selector selector, arg) {
- visits.add(new Visit(VisitKind.VISIT_UNRESOLVED_INVOKE,
- name: element.name, arguments: arguments));
- super.visitUnresolvedInvoke(node, element, arguments, selector, arg);
- }
-
- @override
- visitUnresolvedPostfix(
- Send node, ErroneousElement element, IncDecOperator operator, arg) {
- visits
- .add(new Visit(VisitKind.VISIT_UNRESOLVED_POSTFIX, operator: operator));
- }
-
- @override
- visitUnresolvedPrefix(
- Send node, ErroneousElement element, IncDecOperator operator, arg) {
- visits
- .add(new Visit(VisitKind.VISIT_UNRESOLVED_PREFIX, operator: operator));
- }
-
- @override
- visitUnresolvedSuperCompoundIndexSet(Send node, Element element, Node index,
- AssignmentOperator operator, Node rhs, arg) {
- visits.add(new Visit(VisitKind.VISIT_UNRESOLVED_SUPER_COMPOUND_INDEX_SET,
- index: index, operator: operator, rhs: rhs));
- apply(index, arg);
- apply(rhs, arg);
- }
-
- @override
- visitUnresolvedSuperGetterCompoundIndexSet(
- Send node,
- Element element,
- MethodElement setter,
- Node index,
- AssignmentOperator operator,
- Node rhs,
- arg) {
- visits.add(new Visit(
- VisitKind.VISIT_UNRESOLVED_SUPER_GETTER_COMPOUND_INDEX_SET,
- setter: setter,
- index: index,
- operator: operator,
- rhs: rhs));
- apply(index, arg);
- apply(rhs, arg);
- }
-
- @override
- visitUnresolvedSuperSetterCompoundIndexSet(Send node, MethodElement getter,
- Element element, Node index, AssignmentOperator operator, Node rhs, arg) {
- visits.add(new Visit(
- VisitKind.VISIT_UNRESOLVED_SUPER_SETTER_COMPOUND_INDEX_SET,
- getter: getter,
- index: index,
- operator: operator,
- rhs: rhs));
- apply(index, arg);
- apply(rhs, arg);
- }
-
- @override
- visitUnresolvedSuperIndexSet(
- Send node, ErroneousElement element, Node index, Node rhs, arg) {
- visits.add(new Visit(VisitKind.VISIT_UNRESOLVED_SUPER_INDEX_SET,
- index: index, rhs: rhs));
- apply(index, arg);
- apply(rhs, arg);
- }
-
- @override
- visitUnresolvedSuperIndexPostfix(
- Send node, Element element, Node index, IncDecOperator operator, arg) {
- visits.add(new Visit(VisitKind.VISIT_UNRESOLVED_SUPER_INDEX_POSTFIX,
- index: index, operator: operator));
- apply(index, arg);
- }
-
- @override
- visitUnresolvedSuperGetterIndexPostfix(Send node, Element element,
- MethodElement setter, Node index, IncDecOperator operator, arg) {
- visits.add(new Visit(VisitKind.VISIT_UNRESOLVED_SUPER_GETTER_INDEX_POSTFIX,
- setter: setter, index: index, operator: operator));
- apply(index, arg);
- }
-
- @override
- visitUnresolvedSuperSetterIndexPostfix(Send node, MethodElement getter,
- Element element, Node index, IncDecOperator operator, arg) {
- visits.add(new Visit(VisitKind.VISIT_UNRESOLVED_SUPER_SETTER_INDEX_POSTFIX,
- getter: getter, index: index, operator: operator));
- apply(index, arg);
- }
-
- @override
- visitUnresolvedSuperIndexPrefix(
- Send node, Element element, Node index, IncDecOperator operator, arg) {
- visits.add(new Visit(VisitKind.VISIT_UNRESOLVED_SUPER_INDEX_PREFIX,
- index: index, operator: operator));
- apply(index, arg);
- }
-
- @override
- visitUnresolvedSuperGetterIndexPrefix(Send node, Element element,
- MethodElement setter, Node index, IncDecOperator operator, arg) {
- visits.add(new Visit(VisitKind.VISIT_UNRESOLVED_SUPER_GETTER_INDEX_PREFIX,
- setter: setter, index: index, operator: operator));
- apply(index, arg);
- }
-
- @override
- visitUnresolvedSuperSetterIndexPrefix(Send node, MethodElement getter,
- Element element, Node index, IncDecOperator operator, arg) {
- visits.add(new Visit(VisitKind.VISIT_UNRESOLVED_SUPER_SETTER_INDEX_PREFIX,
- getter: getter, index: index, operator: operator));
- apply(index, arg);
- }
-
- @override
- visitIndexPostfix(
- Send node, Node receiver, Node index, IncDecOperator operator, arg) {
- visits.add(new Visit(VisitKind.VISIT_INDEX_POSTFIX,
- receiver: receiver, index: index, operator: operator));
- apply(receiver, arg);
- apply(index, arg);
- }
-
- @override
- visitIndexPrefix(
- Send node, Node receiver, Node index, IncDecOperator operator, arg) {
- visits.add(new Visit(VisitKind.VISIT_INDEX_PREFIX,
- receiver: receiver, index: index, operator: operator));
- apply(receiver, arg);
- apply(index, arg);
- }
-
- @override
- visitSuperIndexPostfix(
- Send node,
- FunctionElement indexFunction,
- FunctionElement indexSetFunction,
- Node index,
- IncDecOperator operator,
- arg) {
- visits.add(new Visit(VisitKind.VISIT_SUPER_INDEX_POSTFIX,
- getter: indexFunction,
- setter: indexSetFunction,
- index: index,
- operator: operator));
- apply(index, arg);
- }
-
- @override
- visitSuperIndexPrefix(
- Send node,
- FunctionElement indexFunction,
- FunctionElement indexSetFunction,
- Node index,
- IncDecOperator operator,
- arg) {
- visits.add(new Visit(VisitKind.VISIT_SUPER_INDEX_PREFIX,
- getter: indexFunction,
- setter: indexSetFunction,
- index: index,
- operator: operator));
- apply(index, arg);
- }
-
- @override
- visitUnresolvedClassConstructorInvoke(NewExpression node, Element constructor,
- ResolutionDartType type, NodeList arguments, Selector selector, arg) {
- // TODO(johnniwinther): Test [type] when it is not `dynamic`.
- visits.add(new Visit(VisitKind.VISIT_UNRESOLVED_CLASS_CONSTRUCTOR_INVOKE,
- arguments: arguments));
- apply(arguments, arg);
- }
-
- @override
- visitUnresolvedConstructorInvoke(NewExpression node, Element constructor,
- ResolutionDartType type, NodeList arguments, Selector selector, arg) {
- // TODO(johnniwinther): Test [type] when it is not `dynamic`.
- visits.add(new Visit(VisitKind.VISIT_UNRESOLVED_CONSTRUCTOR_INVOKE,
- arguments: arguments));
- apply(arguments, arg);
- }
-
- @override
- visitConstConstructorInvoke(
- NewExpression node, ConstructedConstantExpression constant, arg) {
- visits.add(new Visit(VisitKind.VISIT_CONST_CONSTRUCTOR_INVOKE,
- constant: constant.toDartText()));
- super.visitConstConstructorInvoke(node, constant, arg);
- }
-
- @override
- visitBoolFromEnvironmentConstructorInvoke(
- NewExpression node, BoolFromEnvironmentConstantExpression constant, arg) {
- visits.add(new Visit(
- VisitKind.VISIT_BOOL_FROM_ENVIRONMENT_CONSTRUCTOR_INVOKE,
- constant: constant.toDartText()));
- super.visitBoolFromEnvironmentConstructorInvoke(node, constant, arg);
- }
-
- @override
- visitIntFromEnvironmentConstructorInvoke(
- NewExpression node, IntFromEnvironmentConstantExpression constant, arg) {
- visits.add(new Visit(
- VisitKind.VISIT_INT_FROM_ENVIRONMENT_CONSTRUCTOR_INVOKE,
- constant: constant.toDartText()));
- super.visitIntFromEnvironmentConstructorInvoke(node, constant, arg);
- }
-
- @override
- visitStringFromEnvironmentConstructorInvoke(NewExpression node,
- StringFromEnvironmentConstantExpression constant, arg) {
- visits.add(new Visit(
- VisitKind.VISIT_STRING_FROM_ENVIRONMENT_CONSTRUCTOR_INVOKE,
- constant: constant.toDartText()));
- super.visitStringFromEnvironmentConstructorInvoke(node, constant, arg);
- }
-
- @override
- errorNonConstantConstructorInvoke(
- NewExpression node,
- Element element,
- ResolutionDartType type,
- NodeList arguments,
- CallStructure callStructure,
- arg) {
- visits.add(new Visit(VisitKind.ERROR_NON_CONSTANT_CONSTRUCTOR_INVOKE,
- element: element,
- type: type,
- arguments: arguments,
- selector: callStructure));
- super.errorNonConstantConstructorInvoke(
- node, element, type, arguments, callStructure, arg);
- }
-
- @override
- visitConstructorIncompatibleInvoke(
- NewExpression node,
- ConstructorElement constructor,
- ResolutionInterfaceType type,
- NodeList arguments,
- CallStructure callStructure,
- arg) {
- visits.add(new Visit(VisitKind.VISIT_CONSTRUCTOR_INCOMPATIBLE_INVOKE,
- element: constructor,
- type: type,
- arguments: arguments,
- selector: callStructure));
- super.visitConstructorIncompatibleInvoke(
- node, constructor, type, arguments, callStructure, arg);
- }
-
- @override
- visitFactoryConstructorInvoke(
- NewExpression node,
- ConstructorElement constructor,
- ResolutionInterfaceType type,
- NodeList arguments,
- CallStructure callStructure,
- arg) {
- visits.add(new Visit(VisitKind.VISIT_FACTORY_CONSTRUCTOR_INVOKE,
- element: constructor,
- type: type,
- arguments: arguments,
- selector: callStructure));
- apply(arguments, arg);
- }
-
- @override
- visitGenerativeConstructorInvoke(
- NewExpression node,
- ConstructorElement constructor,
- ResolutionInterfaceType type,
- NodeList arguments,
- CallStructure callStructure,
- arg) {
- visits.add(new Visit(VisitKind.VISIT_GENERATIVE_CONSTRUCTOR_INVOKE,
- element: constructor,
- type: type,
- arguments: arguments,
- selector: callStructure));
- apply(arguments, arg);
- }
-
- @override
- visitRedirectingFactoryConstructorInvoke(
- NewExpression node,
- ConstructorElement constructor,
- ResolutionInterfaceType type,
- ConstructorElement effectiveTarget,
- ResolutionInterfaceType effectiveTargetType,
- NodeList arguments,
- CallStructure callStructure,
- arg) {
- visits.add(new Visit(VisitKind.VISIT_REDIRECTING_FACTORY_CONSTRUCTOR_INVOKE,
- element: constructor,
- type: type,
- target: effectiveTarget,
- targetType: effectiveTargetType,
- arguments: arguments,
- selector: callStructure));
- apply(arguments, arg);
- }
-
- @override
- visitRedirectingGenerativeConstructorInvoke(
- NewExpression node,
- ConstructorElement constructor,
- ResolutionInterfaceType type,
- NodeList arguments,
- CallStructure callStructure,
- arg) {
- visits.add(new Visit(
- VisitKind.VISIT_REDIRECTING_GENERATIVE_CONSTRUCTOR_INVOKE,
- element: constructor,
- type: type,
- arguments: arguments,
- selector: callStructure));
- apply(arguments, arg);
- }
-
- @override
- visitAbstractClassConstructorInvoke(
- NewExpression node,
- ConstructorElement constructor,
- ResolutionInterfaceType type,
- NodeList arguments,
- CallStructure callStructure,
- arg) {
- visits.add(new Visit(VisitKind.VISIT_ABSTRACT_CLASS_CONSTRUCTOR_INVOKE,
- element: constructor,
- type: type,
- arguments: arguments,
- selector: callStructure));
- apply(arguments, arg);
- }
-
- @override
- visitUnresolvedRedirectingFactoryConstructorInvoke(
- NewExpression node,
- ConstructorElement constructor,
- ResolutionInterfaceType type,
- NodeList arguments,
- CallStructure callStructure,
- arg) {
- visits.add(new Visit(
- VisitKind.VISIT_UNRESOLVED_REDIRECTING_FACTORY_CONSTRUCTOR_INVOKE,
- element: constructor,
- type: type,
- arguments: arguments,
- selector: callStructure));
- apply(arguments, arg);
- }
-
- @override
- visitUnresolvedStaticGetterCompound(Send node, Element element,
- MethodElement setter, AssignmentOperator operator, Node rhs, arg) {
- visits.add(new Visit(VisitKind.VISIT_UNRESOLVED_STATIC_GETTER_COMPOUND,
- setter: setter, operator: operator, rhs: rhs));
- apply(rhs, arg);
- }
-
- @override
- visitUnresolvedTopLevelGetterCompound(Send node, Element element,
- MethodElement setter, AssignmentOperator operator, Node rhs, arg) {
- visits.add(new Visit(VisitKind.VISIT_UNRESOLVED_TOP_LEVEL_GETTER_COMPOUND,
- setter: setter, operator: operator, rhs: rhs));
- apply(rhs, arg);
- }
-
- @override
- visitUnresolvedStaticSetterCompound(Send node, MethodElement getter,
- Element element, AssignmentOperator operator, Node rhs, arg) {
- visits.add(new Visit(VisitKind.VISIT_UNRESOLVED_STATIC_SETTER_COMPOUND,
- getter: getter, operator: operator, rhs: rhs));
- apply(rhs, arg);
- }
-
- @override
- visitUnresolvedTopLevelSetterCompound(Send node, MethodElement getter,
- Element element, AssignmentOperator operator, Node rhs, arg) {
- visits.add(new Visit(VisitKind.VISIT_UNRESOLVED_TOP_LEVEL_SETTER_COMPOUND,
- getter: getter, operator: operator, rhs: rhs));
- apply(rhs, arg);
- }
-
- @override
- visitStaticMethodCompound(Send node, MethodElement method,
- AssignmentOperator operator, Node rhs, arg) {
- visits.add(new Visit(VisitKind.VISIT_STATIC_METHOD_COMPOUND,
- element: method, operator: operator, rhs: rhs));
- apply(rhs, arg);
- }
-
- @override
- visitTopLevelMethodCompound(Send node, MethodElement method,
- AssignmentOperator operator, Node rhs, arg) {
- visits.add(new Visit(VisitKind.VISIT_TOP_LEVEL_METHOD_COMPOUND,
- element: method, operator: operator, rhs: rhs));
- apply(rhs, arg);
- }
-
- @override
- visitUnresolvedStaticGetterPrefix(Send node, Element element,
- MethodElement setter, IncDecOperator operator, arg) {
- visits.add(new Visit(VisitKind.VISIT_UNRESOLVED_STATIC_GETTER_PREFIX,
- setter: setter, operator: operator));
- }
-
- @override
- visitUnresolvedTopLevelGetterPrefix(Send node, Element element,
- MethodElement setter, IncDecOperator operator, arg) {
- visits.add(new Visit(VisitKind.VISIT_UNRESOLVED_TOP_LEVEL_GETTER_PREFIX,
- setter: setter, operator: operator));
- }
-
- @override
- visitUnresolvedStaticSetterPrefix(Send node, MethodElement getter,
- Element element, IncDecOperator operator, arg) {
- visits.add(new Visit(VisitKind.VISIT_UNRESOLVED_STATIC_SETTER_PREFIX,
- getter: getter, operator: operator));
- }
-
- @override
- visitUnresolvedTopLevelSetterPrefix(Send node, MethodElement getter,
- Element element, IncDecOperator operator, arg) {
- visits.add(new Visit(VisitKind.VISIT_UNRESOLVED_TOP_LEVEL_SETTER_PREFIX,
- getter: getter, operator: operator));
- }
-
- @override
- visitStaticMethodPrefix(
- Send node, MethodElement method, IncDecOperator operator, arg) {
- visits.add(new Visit(VisitKind.VISIT_STATIC_METHOD_PREFIX,
- element: method, operator: operator));
- }
-
- @override
- visitTopLevelMethodPrefix(
- Send node, MethodElement method, IncDecOperator operator, arg) {
- visits.add(new Visit(VisitKind.VISIT_TOP_LEVEL_METHOD_PREFIX,
- element: method, operator: operator));
- }
-
- @override
- visitUnresolvedStaticGetterPostfix(Send node, Element element,
- MethodElement setter, IncDecOperator operator, arg) {
- visits.add(new Visit(VisitKind.VISIT_UNRESOLVED_STATIC_GETTER_POSTFIX,
- setter: setter, operator: operator));
- }
-
- @override
- visitUnresolvedTopLevelGetterPostfix(Send node, Element element,
- MethodElement setter, IncDecOperator operator, arg) {
- visits.add(new Visit(VisitKind.VISIT_UNRESOLVED_TOP_LEVEL_GETTER_POSTFIX,
- setter: setter, operator: operator));
- }
-
- @override
- visitUnresolvedStaticSetterPostfix(Send node, MethodElement getter,
- Element element, IncDecOperator operator, arg) {
- visits.add(new Visit(VisitKind.VISIT_UNRESOLVED_STATIC_SETTER_POSTFIX,
- getter: getter, operator: operator));
- }
-
- @override
- visitUnresolvedTopLevelSetterPostfix(Send node, MethodElement getter,
- Element element, IncDecOperator operator, arg) {
- visits.add(new Visit(VisitKind.VISIT_UNRESOLVED_TOP_LEVEL_SETTER_POSTFIX,
- getter: getter, operator: operator));
- }
-
- @override
- visitStaticMethodPostfix(
- Send node, MethodElement method, IncDecOperator operator, arg) {
- visits.add(new Visit(VisitKind.VISIT_STATIC_METHOD_POSTFIX,
- element: method, operator: operator));
- }
-
- @override
- visitTopLevelMethodPostfix(
- Send node, MethodElement method, IncDecOperator operator, arg) {
- visits.add(new Visit(VisitKind.VISIT_TOP_LEVEL_METHOD_POSTFIX,
- element: method, operator: operator));
- }
-
- @override
- visitUnresolvedSuperGetterCompound(Send node, Element element,
- MethodElement setter, AssignmentOperator operator, Node rhs, arg) {
- visits.add(new Visit(VisitKind.VISIT_UNRESOLVED_SUPER_GETTER_COMPOUND,
- setter: setter, operator: operator, rhs: rhs));
- apply(rhs, arg);
- }
-
- @override
- visitUnresolvedSuperGetterPostfix(Send node, Element element,
- MethodElement setter, IncDecOperator operator, arg) {
- visits.add(new Visit(VisitKind.VISIT_UNRESOLVED_SUPER_GETTER_POSTFIX,
- setter: setter, operator: operator));
- }
-
- @override
- visitUnresolvedSuperGetterPrefix(Send node, Element element,
- MethodElement setter, IncDecOperator operator, arg) {
- visits.add(new Visit(VisitKind.VISIT_UNRESOLVED_SUPER_GETTER_PREFIX,
- setter: setter, operator: operator));
- }
-
- @override
- visitUnresolvedSuperSetterCompound(Send node, MethodElement getter,
- Element element, AssignmentOperator operator, Node rhs, arg) {
- visits.add(new Visit(VisitKind.VISIT_UNRESOLVED_SUPER_SETTER_COMPOUND,
- getter: getter, operator: operator, rhs: rhs));
- apply(rhs, arg);
- }
-
- @override
- visitUnresolvedSuperSetterPostfix(Send node, MethodElement getter,
- Element element, IncDecOperator operator, arg) {
- visits.add(new Visit(VisitKind.VISIT_UNRESOLVED_SUPER_SETTER_POSTFIX,
- getter: getter, operator: operator));
- }
-
- @override
- visitUnresolvedSuperSetterPrefix(Send node, MethodElement getter,
- Element element, IncDecOperator operator, arg) {
- visits.add(new Visit(VisitKind.VISIT_UNRESOLVED_SUPER_SETTER_PREFIX,
- getter: getter, operator: operator));
- }
-
- @override
- visitIfNotNullDynamicPropertyGet(Send node, Node receiver, Name name, arg) {
- visits.add(new Visit(VisitKind.VISIT_IF_NOT_NULL_DYNAMIC_PROPERTY_GET,
- receiver: receiver, name: name));
- super.visitIfNotNullDynamicPropertyGet(node, receiver, name, arg);
- }
-
- @override
- visitIfNotNullDynamicPropertySet(
- Send node, Node receiver, Name name, Node rhs, arg) {
- visits.add(new Visit(VisitKind.VISIT_IF_NOT_NULL_DYNAMIC_PROPERTY_SET,
- receiver: receiver, name: name, rhs: rhs));
- super.visitIfNotNullDynamicPropertySet(node, receiver, name, rhs, arg);
- }
-
- @override
- visitIfNotNullDynamicPropertyInvoke(
- Send node, Node receiver, NodeList arguments, Selector selector, arg) {
- visits.add(new Visit(VisitKind.VISIT_IF_NOT_NULL_DYNAMIC_PROPERTY_INVOKE,
- receiver: receiver, selector: selector, arguments: arguments));
- super.visitIfNotNullDynamicPropertyInvoke(
- node, receiver, arguments, selector, arg);
- }
-
- @override
- visitIfNotNullDynamicPropertyPrefix(
- Send node, Node receiver, Name name, IncDecOperator operator, arg) {
- visits.add(new Visit(VisitKind.VISIT_IF_NOT_NULL_DYNAMIC_PROPERTY_PREFIX,
- receiver: receiver, name: name, operator: operator));
- super.visitIfNotNullDynamicPropertyPrefix(
- node, receiver, name, operator, arg);
- }
-
- @override
- visitIfNotNullDynamicPropertyPostfix(
- Send node, Node receiver, Name name, IncDecOperator operator, arg) {
- visits.add(new Visit(VisitKind.VISIT_IF_NOT_NULL_DYNAMIC_PROPERTY_POSTFIX,
- receiver: receiver, name: name, operator: operator));
- super.visitIfNotNullDynamicPropertyPostfix(
- node, receiver, name, operator, arg);
- }
-
- @override
- visitIfNotNullDynamicPropertyCompound(Send node, Node receiver, Name name,
- AssignmentOperator operator, Node rhs, arg) {
- visits.add(new Visit(VisitKind.VISIT_IF_NOT_NULL_DYNAMIC_PROPERTY_COMPOUND,
- receiver: receiver, name: name, operator: operator, rhs: rhs));
- super.visitIfNotNullDynamicPropertyCompound(
- node, receiver, name, operator, rhs, arg);
- }
-
- @override
- visitIfNull(Send node, Node left, Node right, arg) {
- visits.add(new Visit(VisitKind.VISIT_IF_NULL, left: left, right: right));
- super.visitIfNull(node, left, right, arg);
- }
-
- @override
- visitConstantGet(Send node, ConstantExpression constant, arg) {
- visits.add(new Visit(VisitKind.VISIT_CONSTANT_GET,
- constant: constant.toDartText()));
- super.visitConstantGet(node, constant, arg);
- }
-
- @override
- visitConstantInvoke(Send node, ConstantExpression constant,
- NodeList arguments, CallStructure callStructure, arg) {
- visits.add(new Visit(VisitKind.VISIT_CONSTANT_INVOKE,
- constant: constant.toDartText()));
- super.visitConstantInvoke(node, constant, arguments, callStructure, arg);
- }
-
- @override
- previsitDeferredAccess(Send node, PrefixElement prefix, arg) {
- visits.add(new Visit(VisitKind.PREVISIT_DEFERRED_ACCESS, element: prefix));
- }
-
- @override
- visitClassTypeLiteralSetIfNull(
- Send node, ConstantExpression constant, Node rhs, arg) {
- visits.add(new Visit(VisitKind.VISIT_CLASS_TYPE_LITERAL_SET_IF_NULL,
- constant: constant.toDartText(), rhs: rhs));
- super.visitClassTypeLiteralSetIfNull(node, constant, rhs, arg);
- }
-
- @override
- visitDynamicPropertySetIfNull(
- Send node, Node receiver, Name name, Node rhs, arg) {
- visits.add(new Visit(VisitKind.VISIT_DYNAMIC_PROPERTY_SET_IF_NULL,
- receiver: receiver, name: name, rhs: rhs));
- super.visitDynamicPropertySetIfNull(node, receiver, name, rhs, arg);
- }
-
- @override
- visitDynamicTypeLiteralSetIfNull(
- Send node, ConstantExpression constant, Node rhs, arg) {
- visits.add(new Visit(VisitKind.VISIT_DYNAMIC_TYPE_LITERAL_SET_IF_NULL,
- constant: constant.toDartText(), rhs: rhs));
- super.visitDynamicTypeLiteralSetIfNull(node, constant, rhs, arg);
- }
-
- @override
- visitFinalLocalVariableSetIfNull(
- Send node, LocalVariableElement variable, Node rhs, arg) {
- visits.add(new Visit(VisitKind.VISIT_FINAL_LOCAL_VARIABLE_SET_IF_NULL,
- element: variable, rhs: rhs));
- super.visitFinalLocalVariableSetIfNull(node, variable, rhs, arg);
- }
-
- @override
- visitFinalParameterSetIfNull(
- Send node, ParameterElement parameter, Node rhs, arg) {
- visits.add(new Visit(VisitKind.VISIT_FINAL_PARAMETER_SET_IF_NULL,
- element: parameter, rhs: rhs));
- super.visitFinalParameterSetIfNull(node, parameter, rhs, arg);
- }
-
- @override
- visitFinalStaticFieldSetIfNull(Send node, FieldElement field, Node rhs, arg) {
- visits.add(new Visit(VisitKind.VISIT_STATIC_FINAL_FIELD_SET_IF_NULL,
- element: field, rhs: rhs));
- super.visitFinalStaticFieldSetIfNull(node, field, rhs, arg);
- }
-
- @override
- visitFinalSuperFieldSetIfNull(Send node, FieldElement field, Node rhs, arg) {
- visits.add(new Visit(VisitKind.VISIT_SUPER_FINAL_FIELD_SET_IF_NULL,
- element: field, rhs: rhs));
- super.visitFinalSuperFieldSetIfNull(node, field, rhs, arg);
- }
-
- @override
- visitFinalTopLevelFieldSetIfNull(
- Send node, FieldElement field, Node rhs, arg) {
- visits.add(new Visit(VisitKind.VISIT_TOP_LEVEL_FINAL_FIELD_SET_IF_NULL,
- element: field, rhs: rhs));
- super.visitFinalTopLevelFieldSetIfNull(node, field, rhs, arg);
- }
-
- @override
- visitIfNotNullDynamicPropertySetIfNull(
- Send node, Node receiver, Name name, Node rhs, arg) {
- visits.add(new Visit(
- VisitKind.VISIT_IF_NOT_NULL_DYNAMIC_PROPERTY_SET_IF_NULL,
- receiver: receiver,
- name: name,
- rhs: rhs));
- super
- .visitIfNotNullDynamicPropertySetIfNull(node, receiver, name, rhs, arg);
- }
-
- @override
- visitLocalFunctionSetIfNull(
- Send node, LocalFunctionElement function, Node rhs, arg) {
- visits.add(new Visit(VisitKind.VISIT_LOCAL_FUNCTION_SET_IF_NULL,
- element: function, rhs: rhs));
- super.visitLocalFunctionSetIfNull(node, function, rhs, arg);
- }
-
- @override
- visitLocalVariableSetIfNull(
- Send node, LocalVariableElement variable, Node rhs, arg) {
- visits.add(new Visit(VisitKind.VISIT_LOCAL_VARIABLE_SET_IF_NULL,
- element: variable, rhs: rhs));
- super.visitLocalVariableSetIfNull(node, variable, rhs, arg);
- }
-
- @override
- visitParameterSetIfNull(
- Send node, ParameterElement parameter, Node rhs, arg) {
- visits.add(new Visit(VisitKind.VISIT_PARAMETER_SET_IF_NULL,
- element: parameter, rhs: rhs));
- super.visitParameterSetIfNull(node, parameter, rhs, arg);
- }
-
- @override
- visitStaticFieldSetIfNull(Send node, FieldElement field, Node rhs, arg) {
- visits.add(new Visit(VisitKind.VISIT_STATIC_FIELD_SET_IF_NULL,
- element: field, rhs: rhs));
- super.visitStaticFieldSetIfNull(node, field, rhs, arg);
- }
-
- @override
- visitStaticGetterSetterSetIfNull(Send node, FunctionElement getter,
- FunctionElement setter, Node rhs, arg) {
- visits.add(new Visit(VisitKind.VISIT_STATIC_GETTER_SETTER_SET_IF_NULL,
- getter: getter, setter: setter, rhs: rhs));
- super.visitStaticGetterSetterSetIfNull(node, getter, setter, rhs, arg);
- }
-
- @override
- visitStaticMethodSetIfNull(Send node, FunctionElement method, Node rhs, arg) {
- visits.add(new Visit(VisitKind.VISIT_STATIC_METHOD_SET_IF_NULL,
- element: method, rhs: rhs));
- super.visitStaticMethodSetIfNull(node, method, rhs, arg);
- }
-
- @override
- visitStaticMethodSetterSetIfNull(
- Send node, MethodElement method, MethodElement setter, Node rhs, arg) {
- visits.add(new Visit(VisitKind.VISIT_STATIC_METHOD_SETTER_SET_IF_NULL,
- getter: method, setter: setter, rhs: rhs));
- super.visitStaticMethodSetterSetIfNull(node, method, setter, rhs, arg);
- }
-
- @override
- visitSuperFieldFieldSetIfNull(Send node, FieldElement readField,
- FieldElement writtenField, Node rhs, arg) {
- visits.add(new Visit(VisitKind.VISIT_SUPER_FIELD_FIELD_SET_IF_NULL,
- getter: readField, setter: writtenField, rhs: rhs));
- super
- .visitSuperFieldFieldSetIfNull(node, readField, writtenField, rhs, arg);
- }
-
- @override
- visitSuperFieldSetIfNull(Send node, FieldElement field, Node rhs, arg) {
- visits.add(new Visit(VisitKind.VISIT_SUPER_FIELD_SET_IF_NULL,
- element: field, rhs: rhs));
- super.visitSuperFieldSetIfNull(node, field, rhs, arg);
- }
-
- @override
- visitSuperFieldSetterSetIfNull(
- Send node, FieldElement field, FunctionElement setter, Node rhs, arg) {
- visits.add(new Visit(VisitKind.VISIT_SUPER_FIELD_SETTER_SET_IF_NULL,
- getter: field, setter: setter, rhs: rhs));
- super.visitSuperFieldSetterSetIfNull(node, field, setter, rhs, arg);
- }
-
- @override
- visitSuperGetterFieldSetIfNull(
- Send node, FunctionElement getter, FieldElement field, Node rhs, arg) {
- visits.add(new Visit(VisitKind.VISIT_SUPER_GETTER_FIELD_SET_IF_NULL,
- getter: getter, setter: field, rhs: rhs));
- super.visitSuperGetterFieldSetIfNull(node, getter, field, rhs, arg);
- }
-
- @override
- visitSuperGetterSetterSetIfNull(Send node, FunctionElement getter,
- FunctionElement setter, Node rhs, arg) {
- visits.add(new Visit(VisitKind.VISIT_SUPER_GETTER_SETTER_SET_IF_NULL,
- getter: getter, setter: setter, rhs: rhs));
- super.visitSuperGetterSetterSetIfNull(node, getter, setter, rhs, arg);
- }
-
- @override
- visitSuperMethodSetIfNull(Send node, FunctionElement method, Node rhs, arg) {
- visits.add(new Visit(VisitKind.VISIT_SUPER_METHOD_SET_IF_NULL,
- element: method, rhs: rhs));
- super.visitSuperMethodSetIfNull(node, method, rhs, arg);
- }
-
- @override
- visitSuperMethodSetterSetIfNull(Send node, FunctionElement method,
- FunctionElement setter, Node rhs, arg) {
- visits.add(new Visit(VisitKind.VISIT_SUPER_METHOD_SETTER_SET_IF_NULL,
- getter: method, setter: setter, rhs: rhs));
- super.visitSuperMethodSetterSetIfNull(node, method, setter, rhs, arg);
- }
-
- @override
- visitThisPropertySetIfNull(Send node, Name name, Node rhs, arg) {
- visits.add(new Visit(VisitKind.VISIT_THIS_PROPERTY_SET_IF_NULL,
- name: name, rhs: rhs));
- super.visitThisPropertySetIfNull(node, name, rhs, arg);
- }
-
- @override
- visitTopLevelFieldSetIfNull(Send node, FieldElement field, Node rhs, arg) {
- visits.add(new Visit(VisitKind.VISIT_TOP_LEVEL_FIELD_SET_IF_NULL,
- element: field, rhs: rhs));
- super.visitTopLevelFieldSetIfNull(node, field, rhs, arg);
- }
-
- @override
- visitTopLevelGetterSetterSetIfNull(Send node, FunctionElement getter,
- FunctionElement setter, Node rhs, arg) {
- visits.add(new Visit(VisitKind.VISIT_TOP_LEVEL_GETTER_SETTER_SET_IF_NULL,
- getter: getter, setter: setter, rhs: rhs));
- super.visitTopLevelGetterSetterSetIfNull(node, getter, setter, rhs, arg);
- }
-
- @override
- visitTopLevelMethodSetIfNull(
- Send node, FunctionElement method, Node rhs, arg) {
- visits.add(new Visit(VisitKind.VISIT_TOP_LEVEL_METHOD_SET_IF_NULL,
- element: method, rhs: rhs));
- super.visitTopLevelMethodSetIfNull(node, method, rhs, arg);
- }
-
- @override
- visitTopLevelMethodSetterSetIfNull(Send node, FunctionElement method,
- FunctionElement setter, Node rhs, arg) {
- visits.add(new Visit(VisitKind.VISIT_TOP_LEVEL_METHOD_SETTER_SET_IF_NULL,
- getter: method, setter: setter, rhs: rhs));
- super.visitTopLevelMethodSetterSetIfNull(node, method, setter, rhs, arg);
- }
-
- @override
- visitTypeVariableTypeLiteralSetIfNull(
- Send node, TypeVariableElement element, Node rhs, arg) {
- visits.add(new Visit(VisitKind.VISIT_TYPE_VARIABLE_TYPE_LITERAL_SET_IF_NULL,
- element: element, rhs: rhs));
- super.visitTypeVariableTypeLiteralSetIfNull(node, element, rhs, arg);
- }
-
- @override
- visitTypedefTypeLiteralSetIfNull(
- Send node, ConstantExpression constant, Node rhs, arg) {
- visits.add(new Visit(VisitKind.VISIT_TYPEDEF_TYPE_LITERAL_SET_IF_NULL,
- constant: constant.toDartText(), rhs: rhs));
- super.visitTypedefTypeLiteralSetIfNull(node, constant, rhs, arg);
- }
-
- @override
- visitUnresolvedSetIfNull(Send node, Element element, Node rhs, arg) {
- visits.add(new Visit(VisitKind.VISIT_UNRESOLVED_SET_IF_NULL,
- name: element.name, rhs: rhs));
- super.visitUnresolvedSetIfNull(node, element, rhs, arg);
- }
-
- @override
- visitUnresolvedStaticGetterSetIfNull(
- Send node, Element element, MethodElement setter, Node rhs, arg) {
- visits.add(new Visit(VisitKind.VISIT_UNRESOLVED_STATIC_GETTER_SET_IF_NULL,
- setter: setter, rhs: rhs));
- super.visitUnresolvedStaticGetterSetIfNull(node, element, setter, rhs, arg);
- }
-
- @override
- visitUnresolvedStaticSetterSetIfNull(
- Send node, MethodElement getter, Element element, Node rhs, arg) {
- visits.add(new Visit(VisitKind.VISIT_UNRESOLVED_STATIC_SETTER_SET_IF_NULL,
- getter: getter, rhs: rhs));
- super.visitUnresolvedStaticSetterSetIfNull(node, getter, element, rhs, arg);
- }
-
- @override
- visitUnresolvedSuperGetterSetIfNull(
- Send node, Element element, MethodElement setter, Node rhs, arg) {
- visits.add(new Visit(VisitKind.VISIT_UNRESOLVED_SUPER_GETTER_SET_IF_NULL,
- setter: setter, rhs: rhs));
- super.visitUnresolvedSuperGetterSetIfNull(node, element, setter, rhs, arg);
- }
-
- @override
- visitUnresolvedSuperSetIfNull(Send node, Element element, Node rhs, arg) {
- visits.add(new Visit(VisitKind.VISIT_UNRESOLVED_SUPER_SET_IF_NULL,
- name: element.name, rhs: rhs));
- super.visitUnresolvedSuperSetIfNull(node, element, rhs, arg);
- }
-
- @override
- visitUnresolvedSuperSetterSetIfNull(
- Send node, MethodElement getter, Element element, Node rhs, arg) {
- visits.add(new Visit(VisitKind.VISIT_UNRESOLVED_SUPER_SETTER_SET_IF_NULL,
- getter: getter, rhs: rhs));
- super.visitUnresolvedSuperSetterSetIfNull(node, getter, element, rhs, arg);
- }
-
- @override
- visitUnresolvedTopLevelGetterSetIfNull(
- Send node, Element element, MethodElement setter, Node rhs, arg) {
- visits.add(new Visit(
- VisitKind.VISIT_UNRESOLVED_TOP_LEVEL_GETTER_SET_IF_NULL,
- setter: setter,
- rhs: rhs));
- super.visitUnresolvedTopLevelGetterSetIfNull(
- node, element, setter, rhs, arg);
- }
-
- @override
- visitUnresolvedTopLevelSetterSetIfNull(
- Send node, MethodElement getter, Element element, Node rhs, arg) {
- visits.add(new Visit(
- VisitKind.VISIT_UNRESOLVED_TOP_LEVEL_SETTER_SET_IF_NULL,
- getter: getter,
- rhs: rhs));
- super.visitUnresolvedTopLevelSetterSetIfNull(
- node, getter, element, rhs, arg);
- }
-
- @override
- visitIndexSetIfNull(SendSet node, Node receiver, Node index, Node rhs, arg) {
- visits.add(new Visit(VisitKind.VISIT_INDEX_SET_IF_NULL,
- receiver: receiver, index: index, rhs: rhs));
- super.visitIndexSetIfNull(node, receiver, index, rhs, arg);
- }
-
- @override
- visitSuperIndexSetIfNull(SendSet node, MethodElement getter,
- MethodElement setter, Node index, Node rhs, arg) {
- visits.add(new Visit(VisitKind.VISIT_SUPER_INDEX_SET_IF_NULL,
- getter: getter, setter: setter, index: index, rhs: rhs));
- super.visitSuperIndexSetIfNull(node, getter, setter, index, rhs, arg);
- }
-
- @override
- visitUnresolvedSuperGetterIndexSetIfNull(Send node, Element element,
- MethodElement setter, Node index, Node rhs, arg) {
- visits.add(new Visit(
- VisitKind.VISIT_UNRESOLVED_SUPER_GETTER_INDEX_SET_IF_NULL,
- setter: setter,
- index: index,
- rhs: rhs));
- super.visitUnresolvedSuperGetterIndexSetIfNull(
- node, element, setter, index, rhs, arg);
- }
-
- @override
- visitUnresolvedSuperSetterIndexSetIfNull(Send node, MethodElement getter,
- Element element, Node index, Node rhs, arg) {
- visits.add(new Visit(
- VisitKind.VISIT_UNRESOLVED_SUPER_SETTER_INDEX_SET_IF_NULL,
- getter: getter,
- index: index,
- rhs: rhs));
- super.visitUnresolvedSuperSetterIndexSetIfNull(
- node, getter, element, index, rhs, arg);
- }
-
- @override
- visitUnresolvedSuperIndexSetIfNull(
- Send node, Element element, Node index, Node rhs, arg) {
- visits.add(new Visit(VisitKind.VISIT_UNRESOLVED_SUPER_INDEX_SET_IF_NULL,
- index: index, rhs: rhs));
- super.visitUnresolvedSuperIndexSetIfNull(node, element, index, rhs, arg);
- }
-
- @override
- errorInvalidIndexSetIfNull(
- SendSet node, ErroneousElement error, Node index, Node rhs, arg) {
- visits.add(
- new Visit(VisitKind.ERROR_INVALID_SET_IF_NULL, index: index, rhs: rhs));
- super.visitUnresolvedSuperIndexSetIfNull(node, error, index, rhs, arg);
- }
-}
diff --git a/tests/compiler/dart2js/old_frontend/size_test.dart b/tests/compiler/dart2js/old_frontend/size_test.dart
deleted file mode 100644
index 95a1946..0000000
--- a/tests/compiler/dart2js/old_frontend/size_test.dart
+++ /dev/null
@@ -1,36 +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';
-import "package:async_helper/async_helper.dart";
-import "../compiler_helper.dart";
-
-const String TEST = "main() => [];";
-
-const Map<String, String> DEFAULT_CORELIB_WITH_LIST = const <String, String>{
- 'Object': 'class Object { const Object(); }',
- 'bool': 'class bool {}',
- 'List': 'abstract class List<E> {}',
- 'num': 'class num {}',
- 'int': 'class int {}',
- 'double': 'class double {}',
- 'String': 'class String {}',
- 'Function': 'class Function {}',
- 'Null': 'class Null {}',
- 'Type': 'class Type {}',
- 'Map': 'class Map {}',
- 'StackTrace': 'class StackTrace {}',
- 'identical': 'identical(a, b) => true;',
- 'proxy': 'const proxy = 0;',
-};
-
-main() {
- asyncTest(() =>
- compileAll(TEST, coreSource: DEFAULT_CORELIB_WITH_LIST).then((generated) {
- return MockCompiler.create((MockCompiler compiler) {
- // Make sure no class is emitted.
- Expect.isFalse(generated.contains('finishClasses'), generated);
- });
- }));
-}
diff --git a/tests/compiler/dart2js/old_frontend/space_test.dart b/tests/compiler/dart2js/old_frontend/space_test.dart
deleted file mode 100644
index 8ffc6471..0000000
--- a/tests/compiler/dart2js/old_frontend/space_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 'dart:io';
-import 'package:compiler/src/dart2js.dart' as dart2js;
-import 'package:compiler/src/commandline_options.dart';
-
-main() {
- Uri currentDirectory = Uri.base;
- Uri script = currentDirectory.resolveUri(Platform.script);
- Uri libraryRoot = script.resolve('../../../../sdk/');
- Directory.current = script.resolve("../path with spaces").toFilePath();
-
- return dart2js.main([
- "--library-root=${libraryRoot.toFilePath()}",
- Flags.analyzeOnly,
- Flags.useOldFrontend,
- "file with spaces.dart"
- ]);
-}
diff --git a/tests/compiler/dart2js/old_frontend/tag_mapping_test.dart b/tests/compiler/dart2js/old_frontend/tag_mapping_test.dart
deleted file mode 100644
index 9eff042..0000000
--- a/tests/compiler/dart2js/old_frontend/tag_mapping_test.dart
+++ /dev/null
@@ -1,43 +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 of import tag to library mapping.
-
-import 'package:expect/expect.dart';
-import "package:async_helper/async_helper.dart";
-import '../compiler_helper.dart';
-
-const MAIN_CODE = """
-import 'library.dart';
-
-main() {
-}
-""";
-
-const LIB_CODE = """
-library lib;
-""";
-
-void main() {
- var sources = <String, String>{
- 'main.dart': MAIN_CODE,
- 'library.dart': LIB_CODE,
- };
-
- asyncTest(() => compileSources(sources, (MockCompiler compiler) {
- LibraryElement mainApp = compiler.libraryLoader
- .lookupLibrary(Uri.parse('source:/main.dart'));
- LibraryElement lib = compiler.libraryLoader
- .lookupLibrary(Uri.parse('source:/library.dart'));
- Expect.isNotNull(mainApp, 'Could not find main.dart library');
- Expect.isNotNull(lib, 'Could not find library.dart library');
-
- ImportElement import = mainApp.imports.single;
- Expect.isNotNull(import, 'Could not find import tag in $mainApp');
-
- // Test that we can get from the import tag in main.dart to the
- // library element representing library.dart.
- Expect.identical(lib, import.importedLibrary);
- }));
-}
diff --git a/tests/compiler/dart2js/old_frontend/type_checker_test.dart b/tests/compiler/dart2js/old_frontend/type_checker_test.dart
deleted file mode 100644
index 6f4bcd5..0000000
--- a/tests/compiler/dart2js/old_frontend/type_checker_test.dart
+++ /dev/null
@@ -1,2621 +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.
-
-import 'dart:async';
-
-import 'package:async_helper/async_helper.dart';
-import 'package:expect/expect.dart';
-
-import 'package:compiler/src/elements/resolution_types.dart';
-import 'package:compiler/src/diagnostics/messages.dart';
-import 'package:compiler/src/elements/elements.dart';
-import 'package:compiler/src/elements/modelx.dart'
- show ClassElementX, CompilationUnitElementX, ElementX;
-import 'package:compiler/src/io/source_file.dart';
-import 'package:compiler/src/resolution/tree_elements.dart'
- show TreeElements, TreeElementMapping;
-import 'package:compiler/src/parser/element_listener.dart';
-import 'package:compiler/src/tree/tree.dart';
-import 'package:compiler/src/typechecker.dart';
-import 'package:compiler/src/script.dart';
-import 'package:compiler/src/util/util.dart';
-
-import 'mock_compiler.dart';
-import 'parser_helper.dart';
-
-final MessageKind NOT_ASSIGNABLE = MessageKind.NOT_ASSIGNABLE;
-final MessageKind UNDEFINED_GETTER = MessageKind.UNDEFINED_GETTER;
-
-main() {
- List tests = [
- testSimpleTypes,
- testReturn,
- testFor,
- testSyncForIn,
- testAsyncForIn,
- testWhile,
- testTry,
- testSwitch,
- testEnumSwitch,
- testOperators,
- testConstructorInvocationArgumentCount,
- testConstructorInvocationArgumentTypes,
- testMethodInvocationArgumentCount,
- testMethodInvocations,
- testMethodInvocationsInClass,
- testGetterSetterInvocation,
- // testNewExpression,
- testConditionalExpression,
- testIfStatement,
- testThis,
- testSuper,
- testOperatorsAssignability,
- testFieldInitializers,
- testTypeVariableExpressions,
- testTypeVariableLookup1,
- testTypeVariableLookup2,
- testTypeVariableLookup3,
- testFunctionTypeLookup,
- testTypedefLookup,
- testTypeLiteral,
- testInitializers,
- testTypePromotionHints,
- testFunctionCall,
- testCascade,
- testAwait,
- testAsyncReturn
- ];
- asyncTest(() => Future.forEach(tests, (test) => setup(test)));
-}
-
-testSimpleTypes(MockCompiler compiler) {
- checkType(ResolutionInterfaceType type, String code) {
- Expect.equals(type, analyzeType(compiler, code));
- }
-
- checkType(compiler.resolution.commonElements.intType, "3");
- checkType(compiler.resolution.commonElements.boolType, "false");
- checkType(compiler.resolution.commonElements.boolType, "true");
- checkType(compiler.resolution.commonElements.stringType, "'hestfisk'");
-}
-
-Future testReturn(MockCompiler compiler) {
- Future check(String code, [expectedWarnings]) {
- return analyzeTopLevel(code, expectedWarnings);
- }
-
- return Future.wait([
- check("void foo() { return 3; }", MessageKind.RETURN_VALUE_IN_VOID),
- check("int bar() { return 'hest'; }", NOT_ASSIGNABLE),
- check("void baz() { var x; return x; }"),
- check(returnWithType("int", "'string'"), NOT_ASSIGNABLE),
- check(returnWithType("", "'string'")),
- check(returnWithType("Object", "'string'")),
- check(returnWithType("String", "'string'")),
- check(returnWithType("String", null)),
- check(returnWithType("int", null)),
- check(returnWithType("void", "")),
- check(returnWithType("void", 1), MessageKind.RETURN_VALUE_IN_VOID),
- check(returnWithType("void", null)),
- check(returnWithType("String", ""), MessageKind.RETURN_NOTHING),
- check(arrowReturnWithType("void", "4")),
- check("void set foo(x) => 5;"),
- // check("String foo() {};"), // Should probably fail.
- ]);
-}
-
-testFor(MockCompiler compiler) {
- check(String code, {warnings}) {
- analyze(compiler, code, warnings: warnings);
- }
-
- check("for (var x;true;x = x + 1) {}");
- check("for (var x;null;x = x + 1) {}");
- check("for (var x;0;x = x + 1) {}", warnings: NOT_ASSIGNABLE);
- check("for (var x;'';x = x + 1) {}", warnings: NOT_ASSIGNABLE);
-
- check("for (;true;) {}");
- check("for (;null;) {}");
- check("for (;0;) {}", warnings: NOT_ASSIGNABLE);
- check("for (;'';) {}", warnings: NOT_ASSIGNABLE);
-
- // Foreach tests
-// TODO(karlklose): for each is not yet implemented.
-// check("{ List<String> strings = ['1','2','3']; " +
-// "for (String s in strings) {} }");
-// check("{ List<int> ints = [1,2,3]; for (String s in ints) {} }",
-// NOT_ASSIGNABLE);
-// check("for (String s in true) {}", MessageKind.UNDEFINED_METHOD);
-}
-
-testSyncForIn(MockCompiler compiler) {
- String script = """
-class HasUntypedIterator {
- get iterator => null;
-}
-
-class HasIntIterator {
- Iterator<int> get iterator => null;
-}
-
-class HasNoIterator {
-}
-
-class HasCustomIntIterator {
- CustomIntIterator get iterator => null;
-}
-
-class CustomIntIterator {
- int current;
-}
-
-class HasCustomNoCurrentIterator {
- CustomNoCurrentIterator get iterator => null;
-}
-
-class CustomNoCurrentIterator {
-}
-
-var topLevelDyn;
-String topLevelString;
-int topLevelInt;
-
-class Class {
- void forIn() {}
-
- var instanceDyn;
- String instanceString;
- int instanceInt;
-
- static var staticDyn;
- static String staticString;
- static int staticInt;
-}
-""";
- compiler.parseScript(script);
- LibraryElement mainApp = compiler.mainApp;
- ClassElement foo = mainApp.find("Class");
- foo.ensureResolved(compiler.resolution);
- FunctionElement method = foo.lookupLocalMember('forIn');
-
- analyzeIn(compiler, method, """{
- for (var e in <String>[]) {}
- }""");
- analyzeIn(compiler, method, """{
- for (String e in <String>[]) {}
- }""");
- analyzeIn(
- compiler,
- method,
- """{
- for (int e in <String>[]) {}
- }""",
- hints: MessageKind.FORIN_NOT_ASSIGNABLE);
- analyzeIn(compiler, method, """{
- for (int e in []) {}
- }""");
-
- analyzeIn(compiler, method, """{
- for (var e in new HasUntypedIterator()) {}
- }""");
- analyzeIn(compiler, method, """{
- for (String e in new HasUntypedIterator()) {}
- }""");
- analyzeIn(compiler, method, """{
- for (int e in new HasUntypedIterator()) {}
- }""");
-
- analyzeIn(compiler, method, """{
- for (var e in new HasIntIterator()) {}
- }""");
- analyzeIn(
- compiler,
- method,
- """{
- for (String e in new HasIntIterator()) {}
- }""",
- hints: MessageKind.FORIN_NOT_ASSIGNABLE);
- analyzeIn(compiler, method, """{
- for (int e in new HasIntIterator()) {}
- }""");
-
- analyzeIn(
- compiler,
- method,
- """{
- for (var e in new HasNoIterator()) {}
- }""",
- warnings: MessageKind.UNDEFINED_GETTER);
- analyzeIn(
- compiler,
- method,
- """{
- for (String e in new HasNoIterator()) {}
- }""",
- warnings: MessageKind.UNDEFINED_GETTER);
- analyzeIn(
- compiler,
- method,
- """{
- for (int e in new HasNoIterator()) {}
- }""",
- warnings: MessageKind.UNDEFINED_GETTER);
-
- analyzeIn(compiler, method, """{
- for (var e in new HasCustomIntIterator()) {}
- }""");
- analyzeIn(
- compiler,
- method,
- """{
- for (String e in new HasCustomIntIterator()) {}
- }""",
- hints: MessageKind.FORIN_NOT_ASSIGNABLE);
- analyzeIn(compiler, method, """{
- for (int e in new HasCustomIntIterator()) {}
- }""");
-
- analyzeIn(
- compiler,
- method,
- """{
- for (var e in new HasCustomNoCurrentIterator()) {}
- }""",
- hints: MessageKind.UNDEFINED_GETTER);
- analyzeIn(
- compiler,
- method,
- """{
- for (String e in new HasCustomNoCurrentIterator()) {}
- }""",
- hints: MessageKind.UNDEFINED_GETTER);
- analyzeIn(
- compiler,
- method,
- """{
- for (int e in new HasCustomNoCurrentIterator()) {}
- }""",
- hints: MessageKind.UNDEFINED_GETTER);
-
- analyzeIn(compiler, method, """{
- var localDyn;
- for (localDyn in <String>[]) {}
- }""");
- analyzeIn(compiler, method, """{
- String localString;
- for (localString in <String>[]) {}
- }""");
- analyzeIn(
- compiler,
- method,
- """{
- int localInt;
- for (localInt in <String>[]) {}
- }""",
- hints: MessageKind.FORIN_NOT_ASSIGNABLE);
-
- analyzeIn(compiler, method, """{
- for (topLevelDyn in <String>[]) {}
- }""");
- analyzeIn(compiler, method, """{
- for (topLevelString in <String>[]) {}
- }""");
- analyzeIn(
- compiler,
- method,
- """{
- for (topLevelInt in <String>[]) {}
- }""",
- hints: MessageKind.FORIN_NOT_ASSIGNABLE);
-
- analyzeIn(compiler, method, """{
- for (instanceDyn in <String>[]) {}
- }""");
- analyzeIn(compiler, method, """{
- for (instanceString in <String>[]) {}
- }""");
- analyzeIn(
- compiler,
- method,
- """{
- for (instanceInt in <String>[]) {}
- }""",
- hints: MessageKind.FORIN_NOT_ASSIGNABLE);
-
- analyzeIn(compiler, method, """{
- for (staticDyn in <String>[]) {}
- }""");
- analyzeIn(compiler, method, """{
- for (staticString in <String>[]) {}
- }""");
- analyzeIn(
- compiler,
- method,
- """{
- for (staticInt in <String>[]) {}
- }""",
- hints: MessageKind.FORIN_NOT_ASSIGNABLE);
-}
-
-testAsyncForIn(MockCompiler compiler) {
- String script = """
-abstract class CustomStream<T> implements Stream<T> {}
-abstract class StringStream implements Stream<String> {}
-
-var topLevelDyn;
-String topLevelString;
-int topLevelInt;
-
-class Class {
- void forIn() async {}
-
- var instanceDyn;
- String instanceString;
- int instanceInt;
-
- static var staticDyn;
- static String staticString;
- static int staticInt;
-}
-""";
- compiler.parseScript(script);
- LibraryElement mainApp = compiler.mainApp;
- ClassElement foo = mainApp.find("Class");
- foo.ensureResolved(compiler.resolution);
- FunctionElement method = foo.lookupLocalMember('forIn');
-
- analyzeIn(compiler, method, """{
- var stream;
- await for (var e in stream) {}
- }""");
- analyzeIn(compiler, method, """{
- var stream;
- await for (String e in stream) {}
- }""");
- analyzeIn(compiler, method, """{
- var stream;
- await for (int e in stream) {}
- }""");
-
- analyzeIn(
- compiler,
- method,
- """{
- await for (var e in []) {}
- }""",
- hints: MessageKind.NOT_ASSIGNABLE);
-
- analyzeIn(compiler, method, """{
- Stream<String> stream;
- await for (var e in stream) {}
- }""");
- analyzeIn(compiler, method, """{
- Stream<String> stream;
- await for (String e in stream) {}
- }""");
- analyzeIn(
- compiler,
- method,
- """{
- Stream<String> stream;
- await for (int e in stream) {}
- }""",
- hints: MessageKind.FORIN_NOT_ASSIGNABLE);
-
- analyzeIn(compiler, method, """{
- CustomStream<String> stream;
- await for (var e in stream) {}
- }""");
- analyzeIn(compiler, method, """{
- CustomStream<String> stream;
- await for (String e in stream) {}
- }""");
- analyzeIn(
- compiler,
- method,
- """{
- CustomStream<String> stream;
- await for (int e in stream) {}
- }""",
- hints: MessageKind.FORIN_NOT_ASSIGNABLE);
-
- analyzeIn(compiler, method, """{
- StringStream stream;
- await for (var e in stream) {}
- }""");
- analyzeIn(compiler, method, """{
- StringStream stream;
- await for (String e in stream) {}
- }""");
- analyzeIn(
- compiler,
- method,
- """{
- StringStream stream;
- await for (int e in stream) {}
- }""",
- hints: MessageKind.FORIN_NOT_ASSIGNABLE);
-
- analyzeIn(compiler, method, """{
- Stream<String> stream;
- var localDyn;
- await for (localDyn in stream) {}
- }""");
- analyzeIn(compiler, method, """{
- Stream<String> stream;
- String localString;
- await for (localString in stream) {}
- }""");
- analyzeIn(
- compiler,
- method,
- """{
- Stream<String> stream;
- int localInt;
- await for (localInt in stream) {}
- }""",
- hints: MessageKind.FORIN_NOT_ASSIGNABLE);
-
- analyzeIn(compiler, method, """{
- Stream<String> stream;
- await for (topLevelDyn in stream) {}
- }""");
- analyzeIn(compiler, method, """{
- Stream<String> stream;
- await for (topLevelString in stream) {}
- }""");
- analyzeIn(
- compiler,
- method,
- """{
- Stream<String> stream;
- await for (topLevelInt in stream) {}
- }""",
- hints: MessageKind.FORIN_NOT_ASSIGNABLE);
-
- analyzeIn(compiler, method, """{
- Stream<String> stream;
- await for (instanceDyn in stream) {}
- }""");
- analyzeIn(compiler, method, """{
- Stream<String> stream;
- await for (instanceString in stream) {}
- }""");
- analyzeIn(
- compiler,
- method,
- """{
- Stream<String> stream;
- await for (instanceInt in stream) {}
- }""",
- hints: MessageKind.FORIN_NOT_ASSIGNABLE);
-
- analyzeIn(compiler, method, """{
- Stream<String> stream;
- await for (staticDyn in stream) {}
- }""");
- analyzeIn(compiler, method, """{
- Stream<String> stream;
- await for (staticString in stream) {}
- }""");
- analyzeIn(
- compiler,
- method,
- """{
- Stream<String> stream;
- await for (staticInt in stream) {}
- }""",
- hints: MessageKind.FORIN_NOT_ASSIGNABLE);
-}
-
-testWhile(MockCompiler compiler) {
- check(String code, {warnings}) {
- analyze(compiler, code, warnings: warnings);
- }
-
- check("while (true) {}");
- check("while (null) {}");
- check("while (0) {}", warnings: NOT_ASSIGNABLE);
- check("while ('') {}", warnings: NOT_ASSIGNABLE);
-
- check("do {} while (true);");
- check("do {} while (null);");
- check("do {} while (0);", warnings: NOT_ASSIGNABLE);
- check("do {} while ('');", warnings: NOT_ASSIGNABLE);
- check("do { int i = 0.5; } while (true);", warnings: NOT_ASSIGNABLE);
- check("do { int i = 0.5; } while (null);", warnings: NOT_ASSIGNABLE);
-}
-
-testTry(MockCompiler compiler) {
- check(String code, {warnings}) {
- analyze(compiler, code, warnings: warnings);
- }
-
- check("try {} finally {}");
- check("try {} catch (e) { int i = e;} finally {}");
- check("try {} catch (e, s) { int i = e; StackTrace j = s; } finally {}");
- check("try {} on String catch (e) {} finally {}");
- check("try { int i = ''; } finally {}", warnings: NOT_ASSIGNABLE);
- check("try {} finally { int i = ''; }", warnings: NOT_ASSIGNABLE);
- check("try {} on String catch (e) { int i = e; } finally {}",
- warnings: NOT_ASSIGNABLE);
- check("try {} catch (e, s) { int i = e; int j = s; } finally {}",
- warnings: NOT_ASSIGNABLE);
- check("try {} on String catch (e, s) { int i = e; int j = s; } finally {}",
- warnings: [NOT_ASSIGNABLE, NOT_ASSIGNABLE]);
-}
-
-testSwitch(MockCompiler compiler) {
- check(String code, {warnings}) {
- analyze(compiler, code, warnings: warnings);
- }
-
- check("switch (0) { case 1: break; case 2: break; }");
- check("switch (0) { case 1: int i = ''; break; case 2: break; }",
- warnings: NOT_ASSIGNABLE);
- check("switch (0) { case '': break; }", warnings: NOT_ASSIGNABLE);
- check("switch ('') { case 1: break; case 2: break; }",
- warnings: [NOT_ASSIGNABLE, NOT_ASSIGNABLE]);
- check("switch (1.5) { case 1: break; case 2: break; }",
- warnings: [NOT_ASSIGNABLE, NOT_ASSIGNABLE]);
-}
-
-testEnumSwitch(MockCompiler compiler) {
- String DECLARATIONS = """
-enum Enum { A, B, C }
-""";
-
- check(String code, {warnings}) {
- MockCompiler compiler = new MockCompiler.internal();
- return compiler.init(DECLARATIONS).then((_) {
- analyze(compiler, code, warnings: warnings, flushDeferred: true);
- });
- }
-
- check("""
-switch (Enum.A) {
-default: break;
-}""");
-
- check("""
-switch (Enum.A) {
-case Enum.A: break;
-default: break;
-}""");
-
- check("""
-switch (Enum.A) {
-case Enum.A: break;
-case Enum.B: break;
-default: break;
-}""");
-
- check("""
-switch (Enum.A) {
-case Enum.A: break;
-case Enum.B: break;
-case Enum.C: break;
-default: break;
-}""");
-
- check("""
-switch (Enum.A) {
-case Enum.A: break;
-case Enum.B: break;
-case Enum.C: break;
-}""");
-
- check("""
-switch (Enum.A) {
-case Enum.B: break;
-case Enum.C: break;
-}""", warnings: MessageKind.MISSING_ENUM_CASES);
-
- check("""
-switch (Enum.A) {
-case Enum.A: break;
-case Enum.C: break;
-}""", warnings: MessageKind.MISSING_ENUM_CASES);
-
- check("""
-switch (Enum.A) {
-case Enum.A: break;
-case Enum.B: break;
-}""", warnings: MessageKind.MISSING_ENUM_CASES);
-
- check("""
-switch (Enum.A) {
-case Enum.A: break;
-}""", warnings: MessageKind.MISSING_ENUM_CASES);
-
- check("""
-switch (Enum.A) {
-case Enum.B: break;
-}""", warnings: MessageKind.MISSING_ENUM_CASES);
-
- check("""
-switch (Enum.A) {
-case Enum.C: break;
-}""", warnings: MessageKind.MISSING_ENUM_CASES);
-
- check("""
-switch (Enum.A) {
-}""", warnings: MessageKind.MISSING_ENUM_CASES);
-}
-
-testOperators(MockCompiler compiler) {
- check(String code, {warnings}) {
- analyze(compiler, code, warnings: warnings);
- }
-
- // TODO(karlklose): add the DartC tests for operators when we can parse
- // classes with operators.
- for (final op in ['+', '-', '*', '/', '%', '~/', '|', '&']) {
- check("{ var i = 1 ${op} 2; }");
- check("{ var i = 1; i ${op}= 2; }");
- check("{ int i; var j = (i = true) ${op} 2; }",
- warnings: [NOT_ASSIGNABLE, MessageKind.UNDEFINED_OPERATOR]);
- check("{ int i; var j = 1 ${op} (i = true); }",
- warnings: [NOT_ASSIGNABLE, NOT_ASSIGNABLE]);
- }
- for (final op in ['-', '~']) {
- check("{ var i = ${op}1; }");
- check("{ int i; var j = ${op}(i = true); }",
- warnings: [NOT_ASSIGNABLE, MessageKind.UNDEFINED_OPERATOR]);
- }
- for (final op in ['++', '--']) {
- check("{ int i = 1; int j = i${op}; }");
- check("{ int i = 1; bool j = i${op}; }", warnings: NOT_ASSIGNABLE);
- check("{ bool b = true; bool j = b${op}; }",
- warnings: MessageKind.UNDEFINED_OPERATOR);
- check("{ bool b = true; int j = ${op}b; }",
- warnings: MessageKind.UNDEFINED_OPERATOR);
- }
- for (final op in ['||', '&&']) {
- check("{ bool b = (true ${op} false); }");
- check("{ int b = true ${op} false; }", warnings: NOT_ASSIGNABLE);
- check("{ bool b = (1 ${op} false); }", warnings: NOT_ASSIGNABLE);
- check("{ bool b = (true ${op} 2); }", warnings: NOT_ASSIGNABLE);
- }
- for (final op in ['>', '<', '<=', '>=']) {
- check("{ bool b = 1 ${op} 2; }");
- check("{ int i = 1 ${op} 2; }", warnings: NOT_ASSIGNABLE);
- check("{ int i; bool b = (i = true) ${op} 2; }",
- warnings: [NOT_ASSIGNABLE, MessageKind.UNDEFINED_OPERATOR]);
- check("{ int i; bool b = 1 ${op} (i = true); }",
- warnings: [NOT_ASSIGNABLE, NOT_ASSIGNABLE]);
- }
- for (final op in ['==', '!=']) {
- check("{ bool b = 1 ${op} 2; }");
- check("{ int i = 1 ${op} 2; }", warnings: NOT_ASSIGNABLE);
- check("{ int i; bool b = (i = true) ${op} 2; }", warnings: NOT_ASSIGNABLE);
- check("{ int i; bool b = 1 ${op} (i = true); }", warnings: NOT_ASSIGNABLE);
- }
-}
-
-void testConstructorInvocationArgumentCount(MockCompiler compiler) {
- compiler.parseScript("""
- class C1 { C1(x, y); }
- class C2 { C2(int x, int y); }
- """);
-
- check(String code, {warnings}) {
- analyze(compiler, code, warnings: warnings);
- }
-
- // calls to untyped constructor C1
- check("new C1(1, 2);");
- check("new C1();", warnings: MessageKind.MISSING_ARGUMENT);
- check("new C1(1);", warnings: MessageKind.MISSING_ARGUMENT);
- check("new C1(1, 2, 3);", warnings: MessageKind.ADDITIONAL_ARGUMENT);
- // calls to typed constructor C2
- check("new C2(1, 2);");
- check("new C2();", warnings: MessageKind.MISSING_ARGUMENT);
- check("new C2(1);", warnings: MessageKind.MISSING_ARGUMENT);
- check("new C2(1, 2, 3);", warnings: MessageKind.ADDITIONAL_ARGUMENT);
-}
-
-void testConstructorInvocationArgumentTypes(MockCompiler compiler) {
- compiler.parseScript("""
- class C1 { C1(x); }
- class C2 { C2(int x); }
- class C3 {
- int field;
- C3(this.field);
- C3.named(this.field);
- }
- """);
-
- check(String code, {warnings}) {
- analyze(compiler, code, warnings: warnings);
- }
-
- check("new C1(42);");
- check("new C1('string');");
- check("new C2(42);");
- check("new C2('string');", warnings: NOT_ASSIGNABLE);
- check("new C3(42);");
- check("new C3('string');", warnings: NOT_ASSIGNABLE);
- check("new C3.named(42);");
- check("new C3.named('string');", warnings: NOT_ASSIGNABLE);
-}
-
-void testMethodInvocationArgumentCount(MockCompiler compiler) {
- compiler.parseScript(CLASS_WITH_METHODS);
-
- check(String text, [expectedWarnings]) {
- analyze(compiler, "{ ClassWithMethods c; $text }",
- warnings: expectedWarnings);
- }
-
- check("c.untypedNoArgumentMethod(1);", MessageKind.ADDITIONAL_ARGUMENT);
- check("c.untypedOneArgumentMethod();", MessageKind.MISSING_ARGUMENT);
- check("c.untypedOneArgumentMethod(1, 1);", MessageKind.ADDITIONAL_ARGUMENT);
- check("c.untypedTwoArgumentMethod();", MessageKind.MISSING_ARGUMENT);
- check(
- "c.untypedTwoArgumentMethod(1, 2, 3);", MessageKind.ADDITIONAL_ARGUMENT);
- check("c.intNoArgumentMethod(1);", MessageKind.ADDITIONAL_ARGUMENT);
- check("c.intOneArgumentMethod();", MessageKind.MISSING_ARGUMENT);
- check("c.intOneArgumentMethod(1, 1);", MessageKind.ADDITIONAL_ARGUMENT);
- check("c.intTwoArgumentMethod();", MessageKind.MISSING_ARGUMENT);
- check("c.intTwoArgumentMethod(1, 2, 3);", MessageKind.ADDITIONAL_ARGUMENT);
- // check("c.untypedField();");
-
- check("c.intOneArgumentOneOptionalMethod();", [MessageKind.MISSING_ARGUMENT]);
- check("c.intOneArgumentOneOptionalMethod(0);");
- check("c.intOneArgumentOneOptionalMethod(0, 1);");
- check("c.intOneArgumentOneOptionalMethod(0, 1, 2);",
- [MessageKind.ADDITIONAL_ARGUMENT]);
- check("c.intOneArgumentOneOptionalMethod(0, 1, c: 2);",
- [MessageKind.NAMED_ARGUMENT_NOT_FOUND]);
- check("c.intOneArgumentOneOptionalMethod(0, b: 1);",
- [MessageKind.NAMED_ARGUMENT_NOT_FOUND]);
- check("c.intOneArgumentOneOptionalMethod(a: 0, b: 1);", [
- MessageKind.NAMED_ARGUMENT_NOT_FOUND,
- MessageKind.NAMED_ARGUMENT_NOT_FOUND,
- MessageKind.MISSING_ARGUMENT
- ]);
-
- check("c.intTwoOptionalMethod();");
- check("c.intTwoOptionalMethod(0);");
- check("c.intTwoOptionalMethod(0, 1);");
- check("c.intTwoOptionalMethod(0, 1, 2);", [MessageKind.ADDITIONAL_ARGUMENT]);
- check(
- "c.intTwoOptionalMethod(a: 0);", [MessageKind.NAMED_ARGUMENT_NOT_FOUND]);
- check("c.intTwoOptionalMethod(0, b: 1);",
- [MessageKind.NAMED_ARGUMENT_NOT_FOUND]);
-
- check("c.intOneArgumentOneNamedMethod();", [MessageKind.MISSING_ARGUMENT]);
- check("c.intOneArgumentOneNamedMethod(0);");
- check("c.intOneArgumentOneNamedMethod(0, b: 1);");
- check(
- "c.intOneArgumentOneNamedMethod(b: 1);", [MessageKind.MISSING_ARGUMENT]);
- check("c.intOneArgumentOneNamedMethod(0, b: 1, c: 2);",
- [MessageKind.NAMED_ARGUMENT_NOT_FOUND]);
- check("c.intOneArgumentOneNamedMethod(0, 1);",
- [MessageKind.ADDITIONAL_ARGUMENT]);
- check("c.intOneArgumentOneNamedMethod(0, 1, c: 2);",
- [MessageKind.ADDITIONAL_ARGUMENT, MessageKind.NAMED_ARGUMENT_NOT_FOUND]);
- check("c.intOneArgumentOneNamedMethod(a: 1, b: 1);",
- [MessageKind.NAMED_ARGUMENT_NOT_FOUND, MessageKind.MISSING_ARGUMENT]);
-
- check("c.intTwoNamedMethod();");
- check("c.intTwoNamedMethod(a: 0);");
- check("c.intTwoNamedMethod(b: 1);");
- check("c.intTwoNamedMethod(a: 0, b: 1);");
- check("c.intTwoNamedMethod(b: 1, a: 0);");
- check("c.intTwoNamedMethod(0);", [MessageKind.ADDITIONAL_ARGUMENT]);
- check("c.intTwoNamedMethod(c: 2);", [MessageKind.NAMED_ARGUMENT_NOT_FOUND]);
- check("c.intTwoNamedMethod(a: 0, c: 2);",
- [MessageKind.NAMED_ARGUMENT_NOT_FOUND]);
- check("c.intTwoNamedMethod(a: 0, b: 1, c: 2);",
- [MessageKind.NAMED_ARGUMENT_NOT_FOUND]);
- check("c.intTwoNamedMethod(c: 2, b: 1, a: 0);",
- [MessageKind.NAMED_ARGUMENT_NOT_FOUND]);
- check("c.intTwoNamedMethod(0, b: 1);", [MessageKind.ADDITIONAL_ARGUMENT]);
- check("c.intTwoNamedMethod(0, 1);",
- [MessageKind.ADDITIONAL_ARGUMENT, MessageKind.ADDITIONAL_ARGUMENT]);
- check("c.intTwoNamedMethod(0, c: 2);",
- [MessageKind.ADDITIONAL_ARGUMENT, MessageKind.NAMED_ARGUMENT_NOT_FOUND]);
-}
-
-void testMethodInvocations(MockCompiler compiler) {
- compiler.parseScript(CLASS_WITH_METHODS);
-
- check(String text, [expectedWarnings]) {
- analyze(
- compiler,
- """{
- ClassWithMethods c;
- SubClass d;
- var e;
- int i;
- int j;
- int localMethod(String str) { return 0; }
- $text
- }
- """,
- warnings: expectedWarnings);
- }
-
- check("int k = c.untypedNoArgumentMethod();");
- check("ClassWithMethods x = c.untypedNoArgumentMethod();");
- check("ClassWithMethods x = d.untypedNoArgumentMethod();");
- check("int k = d.intMethod();");
- check("int k = c.untypedOneArgumentMethod(c);");
- check("ClassWithMethods x = c.untypedOneArgumentMethod(1);");
- check("int k = c.untypedOneArgumentMethod('string');");
- check("int k = c.untypedOneArgumentMethod(i);");
- check("int k = d.untypedOneArgumentMethod(d);");
- check("ClassWithMethods x = d.untypedOneArgumentMethod(1);");
- check("int k = d.untypedOneArgumentMethod('string');");
- check("int k = d.untypedOneArgumentMethod(i);");
-
- check("int k = c.untypedTwoArgumentMethod(1, 'string');");
- check("int k = c.untypedTwoArgumentMethod(i, j);");
- check("ClassWithMethods x = c.untypedTwoArgumentMethod(i, c);");
- check("int k = d.untypedTwoArgumentMethod(1, 'string');");
- check("int k = d.untypedTwoArgumentMethod(i, j);");
- check("ClassWithMethods x = d.untypedTwoArgumentMethod(i, d);");
-
- check("int k = c.intNoArgumentMethod();");
- check("ClassWithMethods x = c.intNoArgumentMethod();", NOT_ASSIGNABLE);
-
- check("int k = c.intOneArgumentMethod(c);", NOT_ASSIGNABLE);
- check("ClassWithMethods x = c.intOneArgumentMethod(1);", NOT_ASSIGNABLE);
- check("int k = c.intOneArgumentMethod('string');", NOT_ASSIGNABLE);
- check("int k = c.intOneArgumentMethod(i);");
-
- check("int k = c.intTwoArgumentMethod(1, 'string');", NOT_ASSIGNABLE);
- check("int k = c.intTwoArgumentMethod(i, j);");
- check("ClassWithMethods x = c.intTwoArgumentMethod(i, j);", NOT_ASSIGNABLE);
-
- check("c.functionField();");
- check("d.functionField();");
- check("c.functionField(1);");
- check("d.functionField('string');");
-
- check("c.intField();", MessageKind.NOT_CALLABLE);
- check("d.intField();", MessageKind.NOT_CALLABLE);
-
- check("c.untypedField();");
- check("d.untypedField();");
- check("c.untypedField(1);");
- check("d.untypedField('string');");
-
- check("c.intOneArgumentOneOptionalMethod('');", NOT_ASSIGNABLE);
- check("c.intOneArgumentOneOptionalMethod('', '');",
- [NOT_ASSIGNABLE, NOT_ASSIGNABLE]);
-
- check("c.intTwoOptionalMethod('');", NOT_ASSIGNABLE);
- check("c.intTwoOptionalMethod('', '');", [NOT_ASSIGNABLE, NOT_ASSIGNABLE]);
-
- check("c.intOneArgumentOneNamedMethod('');", NOT_ASSIGNABLE);
- check("c.intOneArgumentOneNamedMethod('', b: '');",
- [NOT_ASSIGNABLE, NOT_ASSIGNABLE]);
-
- check("c.intTwoNamedMethod(a: '');", NOT_ASSIGNABLE);
- check("c.intTwoNamedMethod(b: '');", NOT_ASSIGNABLE);
- check("c.intTwoNamedMethod(a: '', b: '');", [NOT_ASSIGNABLE, NOT_ASSIGNABLE]);
- check("c.intTwoNamedMethod(b: '', a: '');", [NOT_ASSIGNABLE, NOT_ASSIGNABLE]);
-
- // Invocation of dynamic variable.
- check("e();");
- check("e(1);");
- check("e('string');");
-
- // Invocation on local method.
- check("localMethod();", MessageKind.MISSING_ARGUMENT);
- check("localMethod(1);", NOT_ASSIGNABLE);
- check("localMethod('string');");
- check("int k = localMethod('string');");
- check("String k = localMethod('string');", NOT_ASSIGNABLE);
-
- // Invocation on parenthesized expressions.
- check("(e)();");
- check("(e)(1);");
- check("(e)('string');");
- check("(foo)();");
- check("(foo)(1);");
- check("(foo)('string');");
-
- // Invocations on function expressions.
- check("(foo){}();", MessageKind.MISSING_ARGUMENT);
- check("(foo){}(1);");
- check("(foo){}('string');");
- check("(int foo){}('string');", NOT_ASSIGNABLE);
- check("(String foo){}('string');");
- check("int k = int bar(String foo){ return 0; }('string');");
- check("int k = String bar(String foo){ return foo; }('string');",
- NOT_ASSIGNABLE);
-
- // Static invocations.
- check("ClassWithMethods.staticMethod();", MessageKind.MISSING_ARGUMENT);
- check("ClassWithMethods.staticMethod(1);", NOT_ASSIGNABLE);
- check("ClassWithMethods.staticMethod('string');");
- check("int k = ClassWithMethods.staticMethod('string');");
- check("String k = ClassWithMethods.staticMethod('string');", NOT_ASSIGNABLE);
-
- // Invocation on dynamic variable.
- check("e.foo();");
- check("e.foo(1);");
- check("e.foo('string');");
-
- // Invocation on unresolved variable.
- check("foo();");
- check("foo(1);");
- check("foo('string');");
- check("foo(a: 'string');");
- check("foo(a: localMethod(1));", NOT_ASSIGNABLE);
-}
-
-Future testMethodInvocationsInClass(MockCompiler compiler) {
- MockCompiler compiler = new MockCompiler.internal();
- return compiler.init(CLASS_WITH_METHODS).then((_) {
- LibraryElement library = compiler.mainApp;
- compiler.parseScript(CLASS_WITH_METHODS, library);
- ClassElement ClassWithMethods = library.find("ClassWithMethods");
- ClassWithMethods.ensureResolved(compiler.resolution);
- Element c = ClassWithMethods.lookupLocalMember('method');
- assert(c != null);
- ClassElement SubClass = library.find("SubClass");
- SubClass.ensureResolved(compiler.resolution);
- Element d = SubClass.lookupLocalMember('method');
- assert(d != null);
-
- check(Element element, String text, [expectedWarnings]) {
- analyzeIn(
- compiler,
- element,
- """{
- var e;
- int i;
- int j;
- int localMethod(String str) { return 0; }
- $text
- }""",
- warnings: expectedWarnings);
- }
-
- check(c, "int k = untypedNoArgumentMethod();");
- check(c, "ClassWithMethods x = untypedNoArgumentMethod();");
- check(d, "ClassWithMethods x = untypedNoArgumentMethod();");
- check(d, "int k = intMethod();");
- check(c, "int k = untypedOneArgumentMethod(this);");
- check(c, "ClassWithMethods x = untypedOneArgumentMethod(1);");
- check(c, "int k = untypedOneArgumentMethod('string');");
- check(c, "int k = untypedOneArgumentMethod(i);");
- check(d, "int k = untypedOneArgumentMethod(this);");
- check(d, "ClassWithMethods x = untypedOneArgumentMethod(1);");
- check(d, "int k = untypedOneArgumentMethod('string');");
- check(d, "int k = untypedOneArgumentMethod(i);");
-
- check(c, "int k = untypedTwoArgumentMethod(1, 'string');");
- check(c, "int k = untypedTwoArgumentMethod(i, j);");
- check(c, "ClassWithMethods x = untypedTwoArgumentMethod(i, this);");
- check(d, "int k = untypedTwoArgumentMethod(1, 'string');");
- check(d, "int k = untypedTwoArgumentMethod(i, j);");
- check(d, "ClassWithMethods x = untypedTwoArgumentMethod(i, this);");
-
- check(c, "int k = intNoArgumentMethod();");
- check(c, "ClassWithMethods x = intNoArgumentMethod();", NOT_ASSIGNABLE);
-
- check(c, "int k = intOneArgumentMethod('');", NOT_ASSIGNABLE);
- check(c, "ClassWithMethods x = intOneArgumentMethod(1);", NOT_ASSIGNABLE);
- check(c, "int k = intOneArgumentMethod('string');", NOT_ASSIGNABLE);
- check(c, "int k = intOneArgumentMethod(i);");
-
- check(c, "int k = intTwoArgumentMethod(1, 'string');", NOT_ASSIGNABLE);
- check(c, "int k = intTwoArgumentMethod(i, j);");
- check(
- c, "ClassWithMethods x = intTwoArgumentMethod(i, j);", NOT_ASSIGNABLE);
-
- check(c, "functionField();");
- check(d, "functionField();");
- check(c, "functionField(1);");
- check(d, "functionField('string');");
-
- check(c, "intField();", MessageKind.NOT_CALLABLE);
- check(d, "intField();", MessageKind.NOT_CALLABLE);
-
- check(c, "untypedField();");
- check(d, "untypedField();");
- check(c, "untypedField(1);");
- check(d, "untypedField('string');");
-
- check(c, "intOneArgumentOneOptionalMethod('');", NOT_ASSIGNABLE);
- check(c, "intOneArgumentOneOptionalMethod('', '');",
- [NOT_ASSIGNABLE, NOT_ASSIGNABLE]);
-
- check(c, "intTwoOptionalMethod('');", NOT_ASSIGNABLE);
- check(c, "intTwoOptionalMethod('', '');", [NOT_ASSIGNABLE, NOT_ASSIGNABLE]);
-
- check(c, "intOneArgumentOneNamedMethod('');", NOT_ASSIGNABLE);
- check(c, "intOneArgumentOneNamedMethod('', b: '');",
- [NOT_ASSIGNABLE, NOT_ASSIGNABLE]);
-
- check(c, "intTwoNamedMethod(a: '');", NOT_ASSIGNABLE);
- check(c, "intTwoNamedMethod(b: '');", NOT_ASSIGNABLE);
- check(c, "intTwoNamedMethod(a: '', b: '');",
- [NOT_ASSIGNABLE, NOT_ASSIGNABLE]);
- check(c, "intTwoNamedMethod(b: '', a: '');",
- [NOT_ASSIGNABLE, NOT_ASSIGNABLE]);
-
- // Invocation of dynamic variable.
- check(c, "e();");
- check(c, "e(1);");
- check(c, "e('string');");
-
- // Invocation on local method.
- check(c, "localMethod();", MessageKind.MISSING_ARGUMENT);
- check(c, "localMethod(1);", NOT_ASSIGNABLE);
- check(c, "localMethod('string');");
- check(c, "int k = localMethod('string');");
- check(c, "String k = localMethod('string');", NOT_ASSIGNABLE);
-
- // Invocation on parenthesized expressions.
- check(c, "(e)();");
- check(c, "(e)(1);");
- check(c, "(e)('string');");
- check(c, "(foo)();", UNDEFINED_GETTER);
- check(c, "(foo)(1);", UNDEFINED_GETTER);
- check(c, "(foo)('string');", UNDEFINED_GETTER);
-
- // Invocations on function expressions.
- check(c, "(foo){}();", MessageKind.MISSING_ARGUMENT);
- check(c, "(foo){}(1);");
- check(c, "(foo){}('string');");
- check(c, "(int foo){}('string');", NOT_ASSIGNABLE);
- check(c, "(String foo){}('string');");
- check(c, "int k = int bar(String foo){ return 0; }('string');");
- check(c, "int k = String bar(String foo){ return foo; }('string');",
- NOT_ASSIGNABLE);
-
- // Static invocations.
- check(c, "staticMethod();", MessageKind.MISSING_ARGUMENT);
- check(c, "staticMethod(1);", NOT_ASSIGNABLE);
- check(c, "staticMethod('string');");
- check(c, "int k = staticMethod('string');");
- check(c, "String k = staticMethod('string');", NOT_ASSIGNABLE);
- check(d, "staticMethod();", MessageKind.UNDEFINED_METHOD);
- check(d, "staticMethod(1);", MessageKind.UNDEFINED_METHOD);
- check(d, "staticMethod('string');", MessageKind.UNDEFINED_METHOD);
- check(d, "int k = staticMethod('string');", MessageKind.UNDEFINED_METHOD);
- check(
- d, "String k = staticMethod('string');", MessageKind.UNDEFINED_METHOD);
-
- // Invocation on dynamic variable.
- check(c, "e.foo();");
- check(c, "e.foo(1);");
- check(c, "e.foo('string');");
-
- // Invocation on unresolved variable.
- check(c, "foo();", MessageKind.UNDEFINED_METHOD);
- check(c, "foo(1);", MessageKind.UNDEFINED_METHOD);
- check(c, "foo('string');", MessageKind.UNDEFINED_METHOD);
- check(c, "foo(a: 'string');", MessageKind.UNDEFINED_METHOD);
- check(c, "foo(a: localMethod(1));",
- [MessageKind.UNDEFINED_METHOD, NOT_ASSIGNABLE]);
- });
-}
-
-void testFunctionCall(MockCompiler compiler) {
- compiler.parseScript(CLASS_WITH_METHODS);
-
- check(String text, [expectedWarnings]) {
- analyze(
- compiler,
- """{
- ClassWithMethods x;
- int localMethod(String str) { return 0; }
- String2Int string2int;
- Function function;
- SubFunction subFunction;
- $text
- }
- """,
- warnings: expectedWarnings);
- }
-
- check("int k = localMethod.call('');");
- check("String k = localMethod.call('');", NOT_ASSIGNABLE);
- check("int k = localMethod.call(0);", NOT_ASSIGNABLE);
-
- check("int k = ClassWithMethods.staticMethod.call('');");
- check("String k = ClassWithMethods.staticMethod.call('');", NOT_ASSIGNABLE);
- check("int k = ClassWithMethods.staticMethod.call(0);", NOT_ASSIGNABLE);
-
- check("int k = x.instanceMethod.call('');");
- check("String k = x.instanceMethod.call('');", NOT_ASSIGNABLE);
- check("int k = x.instanceMethod.call(0);", NOT_ASSIGNABLE);
-
- check("int k = topLevelMethod.call('');");
- check("String k = topLevelMethod.call('');", NOT_ASSIGNABLE);
- check("int k = topLevelMethod.call(0);", NOT_ASSIGNABLE);
-
- check("((String s) { return 0; }).call('');");
- check("((String s) { return 0; }).call(0);", NOT_ASSIGNABLE);
-
- check("(int f(String x)) { int i = f.call(''); } (null);");
- check("(int f(String x)) { String s = f.call(''); } (null);", NOT_ASSIGNABLE);
- check("(int f(String x)) { int i = f.call(0); } (null);", NOT_ASSIGNABLE);
-
- check("int k = string2int.call('');");
- check("String k = string2int.call('');", NOT_ASSIGNABLE);
- check("int k = string2int.call(0);", NOT_ASSIGNABLE);
-
- check("int k = x.string2int.call('');");
- check("String k = x.string2int.call('');", NOT_ASSIGNABLE);
- check("int k = x.string2int.call(0);", NOT_ASSIGNABLE);
-
- check("int k = function.call('');");
- check("String k = function.call('');");
- check("int k = function.call(0);");
-
- check("int k = subFunction.call('');");
- check("String k = subFunction.call('');");
- check("int k = subFunction.call(0);");
-}
-
-testNewExpression(MockCompiler compiler) {
- compiler.parseScript("class A {}");
- analyze(compiler, "A a = new A();");
- analyze(compiler, "int i = new A();", warnings: NOT_ASSIGNABLE);
-
-// TODO(karlklose): constructors are not yet implemented.
-// compiler.parseScript(
-// "class Foo {\n" +
-// " Foo(int x) {}\n" +
-// " Foo.foo() {}\n" +
-// " Foo.bar([int i = null]) {}\n" +
-// "}\n" +
-// "abstract class Bar<T> {\n" +
-// " factory Bar.make() => new Baz<T>.make();\n" +
-// "}\n" +
-// "class Baz {\n" +
-// " factory Bar<S>.make(S x) { return null; }\n" +
-// "}");
-//
-// analyze("Foo x = new Foo(0);");
-// analyze("Foo x = new Foo();", MessageKind.MISSING_ARGUMENT);
-// analyze("Foo x = new Foo('');", NOT_ASSIGNABLE);
-// analyze("Foo x = new Foo(0, null);", MessageKind.ADDITIONAL_ARGUMENT);
-//
-// analyze("Foo x = new Foo.foo();");
-// analyze("Foo x = new Foo.foo(null);", MessageKind.ADDITIONAL_ARGUMENT);
-//
-// analyze("Foo x = new Foo.bar();");
-// analyze("Foo x = new Foo.bar(0);");
-// analyze("Foo x = new Foo.bar('');", NOT_ASSIGNABLE);
-// analyze("Foo x = new Foo.bar(0, null);",
-// MessageKind.ADDITIONAL_ARGUMENT);
-//
-// analyze("Bar<String> x = new Bar<String>.make('');");
-}
-
-testConditionalExpression(MockCompiler compiler) {
- check(String code, {warnings}) {
- analyze(compiler, code, warnings: warnings);
- }
-
- check("int i = true ? 2 : 1;");
- check("int i = true ? 'hest' : 1;");
- check("int i = true ? 'hest' : 'fisk';", warnings: NOT_ASSIGNABLE);
- check("String s = true ? 'hest' : 'fisk';");
-
- check("true ? 1 : 2;");
- check("null ? 1 : 2;");
- check("0 ? 1 : 2;", warnings: NOT_ASSIGNABLE);
- check("'' ? 1 : 2;", warnings: NOT_ASSIGNABLE);
- check("{ int i; true ? i = 2.7 : 2; }", warnings: NOT_ASSIGNABLE);
- check("{ int i; true ? 2 : i = 2.7; }", warnings: NOT_ASSIGNABLE);
- check("{ int i; i = true ? 2.7 : 2; }");
-
- compiler.parseScript("""
- bool cond() => true;
- void f1() {}
- void f2() {}""");
- check("{ cond() ? f1() : f2(); }");
-}
-
-testIfStatement(MockCompiler compiler) {
- check(String code, {warnings}) {
- analyze(compiler, code, warnings: warnings);
- }
-
- check("if (true) {}");
- check("if (null) {}");
- check("if (0) {}", warnings: NOT_ASSIGNABLE);
- check("if ('') {}", warnings: NOT_ASSIGNABLE);
- check("{ int i = 27; if (true) { i = 2.7; } else {} }",
- warnings: NOT_ASSIGNABLE);
- check("{ int i = 27; if (true) {} else { i = 2.7; } }",
- warnings: NOT_ASSIGNABLE);
-}
-
-testThis(MockCompiler compiler) {
- String script = """class Foo {
- void method() {}
- }""";
- compiler.parseScript(script);
- LibraryElement mainApp = compiler.mainApp;
- ClassElement foo = mainApp.find("Foo");
- foo.ensureResolved(compiler.resolution);
- Element method = foo.lookupLocalMember('method');
- analyzeIn(compiler, method, "{ int i = this; }", warnings: NOT_ASSIGNABLE);
- analyzeIn(compiler, method, "{ Object o = this; }");
- analyzeIn(compiler, method, "{ Foo f = this; }");
-}
-
-testSuper(MockCompiler compiler) {
- String script = r'''
- class A {
- String field = "42";
- }
-
- class B extends A {
- Object field = 42;
- void method() {}
- }
- ''';
- compiler.parseScript(script);
- LibraryElement mainApp = compiler.mainApp;
- ClassElement B = mainApp.find("B");
- B.ensureResolved(compiler.resolution);
- Element method = B.lookupLocalMember('method');
- analyzeIn(compiler, method, "{ int i = super.field; }",
- warnings: NOT_ASSIGNABLE);
- analyzeIn(compiler, method, "{ Object o = super.field; }");
- analyzeIn(compiler, method, "{ String s = super.field; }");
-}
-
-const String CLASSES_WITH_OPERATORS = '''
-class Operators {
- Operators operator +(Operators other) => this;
- Operators operator -(Operators other) => this;
- Operators operator -() => this;
- Operators operator *(Operators other) => this;
- Operators operator /(Operators other) => this;
- Operators operator %(Operators other) => this;
- Operators operator ~/(Operators other) => this;
-
- Operators operator &(Operators other) => this;
- Operators operator |(Operators other) => this;
- Operators operator ^(Operators other) => this;
-
- Operators operator ~() => this;
-
- Operators operator <(Operators other) => true;
- Operators operator >(Operators other) => false;
- Operators operator <=(Operators other) => this;
- Operators operator >=(Operators other) => this;
-
- Operators operator <<(Operators other) => this;
- Operators operator >>(Operators other) => this;
-
- bool operator ==(Operators other) => true;
-
- Operators operator [](Operators key) => this;
- void operator []=(Operators key, Operators value) {}
-}
-
-class MismatchA {
- int operator+(MismatchA other) => 0;
- MismatchA operator-(int other) => this;
-
- MismatchA operator[](int key) => this;
- void operator[]=(int key, MismatchA value) {}
-}
-
-class MismatchB {
- MismatchB operator+(MismatchB other) => this;
-
- MismatchB operator[](int key) => this;
- void operator[]=(String key, MismatchB value) {}
-}
-
-class MismatchC {
- MismatchC operator+(MismatchC other) => this;
-
- MismatchC operator[](int key) => this;
- void operator[]=(int key, String value) {}
-}
-''';
-
-testOperatorsAssignability(MockCompiler compiler) {
- compiler.parseScript(CLASSES_WITH_OPERATORS);
-
- // Tests against Operators.
-
- String header = """{
- bool z;
- Operators a;
- Operators b;
- Operators c;
- """;
-
- check(String text, [expectedWarnings]) {
- analyze(compiler, '$header $text }', warnings: expectedWarnings);
- }
-
- // Positive tests on operators.
-
- check('c = a + b;');
- check('c = a - b;');
- check('c = -a;');
- check('c = a * b;');
- check('c = a / b;');
- check('c = a % b;');
- check('c = a ~/ b;');
-
- check('c = a & b;');
- check('c = a | b;');
- check('c = a ^ b;');
-
- check('c = ~a;');
-
- check('c = a < b;');
- check('c = a > b;');
- check('c = a <= b;');
- check('c = a >= b;');
-
- check('c = a << b;');
- check('c = a >> b;');
-
- check('c = a[b];');
-
- check('a[b] = c;');
- check('a[b] += c;');
- check('a[b] -= c;');
- check('a[b] *= c;');
- check('a[b] /= c;');
- check('a[b] %= c;');
- check('a[b] ~/= c;');
- check('a[b] <<= c;');
- check('a[b] >>= c;');
- check('a[b] &= c;');
- check('a[b] |= c;');
- check('a[b] ^= c;');
-
- check('a += b;');
- check('a -= b;');
- check('a *= b;');
- check('a /= b;');
- check('a %= b;');
- check('a ~/= b;');
-
- check('a <<= b;');
- check('a >>= b;');
-
- check('a &= b;');
- check('a |= b;');
- check('a ^= b;');
-
- // Negative tests on operators.
-
- // For the sake of brevity we misuse the terminology in comments:
- // 'e1 is not assignable to e2' should be read as
- // 'the type of e1 is not assignable to the type of e2', and
- // 'e1 is not assignable to operator o on e2' should be read as
- // 'the type of e1 is not assignable to the argument type of operator o
- // on e2'.
-
- // `0` is not assignable to operator + on `a`.
- check('c = a + 0;', NOT_ASSIGNABLE);
- // `a + b` is not assignable to `z`.
- check('z = a + b;', NOT_ASSIGNABLE);
-
- // `-a` is not assignable to `z`.
- check('z = -a;', NOT_ASSIGNABLE);
-
- // `0` is not assignable to operator [] on `a`.
- check('c = a[0];', NOT_ASSIGNABLE);
- // `a[b]` is not assignable to `z`.
- check('z = a[b];', NOT_ASSIGNABLE);
-
- // `0` is not assignable to operator [] on `a`.
- // Warning suppressed for `0` is not assignable to operator []= on `a`.
- check('a[0] *= c;', NOT_ASSIGNABLE);
- // `z` is not assignable to operator * on `a[0]`.
- check('a[b] *= z;', NOT_ASSIGNABLE);
-
- check('b = a++;', NOT_ASSIGNABLE);
- check('b = ++a;', NOT_ASSIGNABLE);
- check('b = a--;', NOT_ASSIGNABLE);
- check('b = --a;', NOT_ASSIGNABLE);
-
- check('c = a[b]++;', NOT_ASSIGNABLE);
- check('c = ++a[b];', NOT_ASSIGNABLE);
- check('c = a[b]--;', NOT_ASSIGNABLE);
- check('c = --a[b];', NOT_ASSIGNABLE);
-
- check('z = a == b;');
- check('z = a != b;');
-
- for (String o in ['&&', '||']) {
- check('z = z $o z;');
- check('z = a $o z;', NOT_ASSIGNABLE);
- check('z = z $o b;', NOT_ASSIGNABLE);
- check('z = a $o b;', [NOT_ASSIGNABLE, NOT_ASSIGNABLE]);
- check('a = a $o b;', [NOT_ASSIGNABLE, NOT_ASSIGNABLE, NOT_ASSIGNABLE]);
- }
-
- check('z = !z;');
- check('z = !a;', NOT_ASSIGNABLE);
- check('a = !z;', NOT_ASSIGNABLE);
- check('a = !a;', [NOT_ASSIGNABLE, NOT_ASSIGNABLE]);
-
- // Tests against MismatchA.
-
- header = """{
- MismatchA a;
- MismatchA b;
- MismatchA c;
- """;
-
- // Tests against int operator +(MismatchA other) => 0;
-
- // `a + b` is not assignable to `c`.
- check('c = a + b;', NOT_ASSIGNABLE);
- // `a + b` is not assignable to `a`.
- check('a += b;', NOT_ASSIGNABLE);
- // `a[0] + b` is not assignable to `a[0]`.
- check('a[0] += b;', NOT_ASSIGNABLE);
-
- // 1 is not applicable to operator +.
- check('b = a++;', NOT_ASSIGNABLE);
- // 1 is not applicable to operator +.
- // `++a` of type int is not assignable to `b`.
- check('b = ++a;', [NOT_ASSIGNABLE, NOT_ASSIGNABLE]);
-
- // 1 is not applicable to operator +.
- check('b = a[0]++;', NOT_ASSIGNABLE);
- // 1 is not applicable to operator +.
- // `++a[0]` of type int is not assignable to `b`.
- check('b = ++a[0];', [NOT_ASSIGNABLE, NOT_ASSIGNABLE]);
-
- // Tests against: MismatchA operator -(int other) => this;
-
- // `a - b` is not assignable to `c`.
- check('c = a + b;', NOT_ASSIGNABLE);
- // `a - b` is not assignable to `a`.
- check('a += b;', NOT_ASSIGNABLE);
- // `a[0] - b` is not assignable to `a[0]`.
- check('a[0] += b;', NOT_ASSIGNABLE);
-
- check('b = a--;');
- check('b = --a;');
-
- check('b = a[0]--;');
- check('b = --a[0];');
-
- // Tests against MismatchB.
-
- header = """{
- MismatchB a;
- MismatchB b;
- MismatchB c;
- """;
-
- // Tests against:
- // MismatchB operator [](int key) => this;
- // void operator []=(String key, MismatchB value) {}
-
- // `0` is not applicable to operator []= on `a`.
- check('a[0] = b;', NOT_ASSIGNABLE);
-
- // `0` is not applicable to operator []= on `a`.
- check('a[0] += b;', NOT_ASSIGNABLE);
- // `""` is not applicable to operator [] on `a`.
- check('a[""] += b;', NOT_ASSIGNABLE);
- // `c` is not applicable to operator [] on `a`.
- // `c` is not applicable to operator []= on `a`.
- check('a[c] += b;', [NOT_ASSIGNABLE, NOT_ASSIGNABLE]);
-
- // Tests against MismatchB.
-
- header = """{
- MismatchC a;
- MismatchC b;
- MismatchC c;
- """;
-
- // Tests against:
- // MismatchC operator[](int key) => this;
- // void operator[]=(int key, String value) {}
-
- // `b` is not assignable to `a[0]`.
- check('a[0] += b;', NOT_ASSIGNABLE);
- // `0` is not applicable to operator + on `a[0]`.
- check('a[0] += "";', [NOT_ASSIGNABLE, NOT_ASSIGNABLE]);
- // `true` is not applicable to operator + on `a[0]`.
- // `true` is not assignable to `a[0]`.
- check('a[0] += true;', [NOT_ASSIGNABLE, NOT_ASSIGNABLE]);
-}
-
-Future testFieldInitializers(MockCompiler compiler) {
- Future check(String code, [expectedWarnings]) {
- return analyzeTopLevel(code, expectedWarnings);
- }
-
- return Future.wait([
- check("""int i = 0;"""),
- check("""int i = '';""", NOT_ASSIGNABLE),
- check("""class Class {
- int i = 0;
- }"""),
- check("""class Class {
- int i = '';
- }""", NOT_ASSIGNABLE),
- ]);
-}
-
-void testTypeVariableExpressions(MockCompiler compiler) {
- String script = """class Foo<T> {
- void method() {}
- }""";
- compiler.parseScript(script);
- LibraryElement mainApp = compiler.mainApp;
- ClassElement foo = mainApp.find("Foo");
- foo.ensureResolved(compiler.resolution);
- Element method = foo.lookupLocalMember('method');
-
- analyzeIn(compiler, method, "{ Type type = T; }");
- analyzeIn(compiler, method, "{ T type = T; }", warnings: NOT_ASSIGNABLE);
- analyzeIn(compiler, method, "{ int type = T; }", warnings: NOT_ASSIGNABLE);
-
- analyzeIn(compiler, method, "{ String typeName = T.toString(); }");
- analyzeIn(compiler, method, "{ T.foo; }", warnings: UNDEFINED_GETTER);
- analyzeIn(compiler, method, "{ T.foo = 0; }",
- warnings: MessageKind.UNDEFINED_SETTER);
- analyzeIn(compiler, method, "{ T.foo(); }",
- warnings: MessageKind.UNDEFINED_METHOD);
- analyzeIn(compiler, method, "{ T + 1; }",
- warnings: MessageKind.UNDEFINED_OPERATOR);
-}
-
-void testTypeVariableLookup1(MockCompiler compiler) {
- String script = """
-class Foo {
- int field;
- void method(int argument) {}
- int operator +(Foo foo) {}
- int get getter => 21;
-}
-
-class Test<S extends Foo, T> {
- S s;
- T t;
- test() {}
-}
-""";
-
- compiler.parseScript(script);
- LibraryElement mainApp = compiler.mainApp;
- ClassElement classTest = mainApp.find("Test");
- classTest.ensureResolved(compiler.resolution);
- FunctionElement methodTest = classTest.lookupLocalMember("test");
-
- test(String expression, [message]) {
- analyzeIn(compiler, methodTest, "{ $expression; }", warnings: message);
- }
-
- test('s.field');
- test('s.method(1)');
- test('s + s');
- test('s.getter');
-
- test('t.toString');
- test('t.field', UNDEFINED_GETTER);
- test('t.method(1)', MessageKind.UNDEFINED_METHOD);
- test('t + t', MessageKind.UNDEFINED_OPERATOR);
- test('t.getter', UNDEFINED_GETTER);
-
- test('s.field = "hest"', NOT_ASSIGNABLE);
- test('s.method("hest")', NOT_ASSIGNABLE);
- test('s + "hest"', NOT_ASSIGNABLE);
- test('String v = s.getter', NOT_ASSIGNABLE);
-}
-
-void testTypeVariableLookup2(MockCompiler compiler) {
- String script = """
-class Foo {
- int field;
- void method(int argument) {}
- int operator +(Foo foo) {}
- int get getter => 21;
-}
-
-class Test<S extends T, T extends Foo> {
- S s;
- test() {}
-}""";
-
- compiler.parseScript(script);
- LibraryElement mainApp = compiler.mainApp;
- ClassElement classTest = mainApp.find("Test");
- classTest.ensureResolved(compiler.resolution);
- FunctionElement methodTest = classTest.lookupLocalMember("test");
-
- test(String expression, [message]) {
- analyzeIn(compiler, methodTest, "{ $expression; }", warnings: message);
- }
-
- test('s.field');
- test('s.method(1)');
- test('s + s');
- test('s.getter');
-}
-
-void testTypeVariableLookup3(MockCompiler compiler) {
- String script = """
-class Test<S extends T, T extends S> {
- S s;
- test() {}
-}""";
-
- compiler.parseScript(script);
- LibraryElement mainApp = compiler.mainApp;
- ClassElement classTest = mainApp.find("Test");
- classTest.ensureResolved(compiler.resolution);
- FunctionElement methodTest = classTest.lookupLocalMember("test");
-
- test(String expression, [message]) {
- analyzeIn(compiler, methodTest, "{ $expression; }", warnings: message);
- }
-
- test('s.toString');
- test('s.field', UNDEFINED_GETTER);
- test('s.method(1)', MessageKind.UNDEFINED_METHOD);
- test('s + s', MessageKind.UNDEFINED_OPERATOR);
- test('s.getter', UNDEFINED_GETTER);
-}
-
-void testFunctionTypeLookup(MockCompiler compiler) {
- check(String code, {warnings}) {
- analyze(compiler, code, warnings: warnings);
- }
-
- check('(int f(int)) => f.toString;');
- check('(int f(int)) => f.toString();');
- check('(int f(int)) => f.foo;', warnings: UNDEFINED_GETTER);
- check('(int f(int)) => f.foo();', warnings: MessageKind.UNDEFINED_METHOD);
-}
-
-void testTypedefLookup(MockCompiler compiler) {
- check(String code, {warnings}) {
- analyze(compiler, code, warnings: warnings);
- }
-
- compiler.parseScript("typedef int F(int);");
- check('(F f) => f.toString;');
- check('(F f) => f.toString();');
- check('(F f) => f.foo;', warnings: UNDEFINED_GETTER);
- check('(F f) => f.foo();', warnings: MessageKind.UNDEFINED_METHOD);
-}
-
-void testTypeLiteral(MockCompiler compiler) {
- check(String code, {warnings}) {
- analyze(compiler, code, warnings: warnings);
- }
-
- final String source = r"""class Class {
- static var field = null;
- static method() {}
- }""";
- compiler.parseScript(source);
-
- // Check direct access.
- check('Type m() => int;');
- check('int m() => int;', warnings: NOT_ASSIGNABLE);
-
- // Check access in assignment.
- check('m(Type val) => val = Class;');
- check('m(int val) => val = Class;', warnings: NOT_ASSIGNABLE);
- check('m(Type val) => val = dynamic;');
- check('m(int val) => val = dynamic;', warnings: NOT_ASSIGNABLE);
-
- // Check access as argument.
- check('m(Type val) => m(int);');
- check('m(int val) => m(int);', warnings: NOT_ASSIGNABLE);
-
- // Check access as argument in member access.
- check('m(Type val) => m(int).foo;');
- check('m(int val) => m(int).foo;', warnings: NOT_ASSIGNABLE);
-
- // Check static property access.
- check('m() => Class.field;');
- check('m() => (Class).field;', warnings: UNDEFINED_GETTER);
-
- // Check static method access.
- check('m() => Class.method();');
- check('m() => (Class).method();', warnings: MessageKind.UNDEFINED_METHOD);
-
- // Check access in invocation.
- check('m() => Class();', warnings: MessageKind.NOT_CALLABLE);
- check('m() => dynamic();', warnings: MessageKind.NOT_CALLABLE);
-}
-
-Future testInitializers(MockCompiler compiler) {
- Future check(String text, [expectedWarnings]) {
- return analyzeTopLevel(text, expectedWarnings);
- }
-
- return Future.wait([
- // Check initializers.
- check(r'''class Class {
- var a;
- Class(this.a);
- }
- '''),
- check(r'''class Class {
- int a;
- Class(this.a);
- }
- '''),
- check(r'''class Class {
- var a;
- Class(int this.a);
- }
- '''),
- check(r'''class Class {
- String a;
- Class(int this.a);
- }
- ''', NOT_ASSIGNABLE),
- check(r'''class Class {
- var a;
- Class(int a) : this.a = a;
- }
- '''),
- check(r'''class Class {
- String a;
- Class(int a) : this.a = a;
- }
- ''', NOT_ASSIGNABLE),
-
- // Check this-calls.
- check(r'''class Class {
- var a;
- Class(this.a);
- Class.named(int a) : this(a);
- }
- '''),
- check(r'''class Class {
- String a;
- Class(this.a);
- Class.named(int a) : this(a);
- }
- ''', NOT_ASSIGNABLE),
- check(r'''class Class {
- String a;
- Class(var a) : this.a = a;
- Class.named(int a) : this(a);
- }
- '''),
- check(r'''class Class {
- String a;
- Class(String a) : this.a = a;
- Class.named(int a) : this(a);
- }
- ''', NOT_ASSIGNABLE),
-
- // Check super-calls.
- check(r'''class Super {
- var a;
- Super(this.a);
- }
- class Class extends Super {
- Class.named(int a) : super(a);
- }
- '''),
- check(r'''class Super {
- String a;
- Super(this.a);
- }
- class Class extends Super {
- Class.named(int a) : super(a);
- }
- ''', NOT_ASSIGNABLE),
- check(r'''class Super {
- String a;
- Super(var a) : this.a = a;
- }
- class Class extends Super {
- Class.named(int a) : super(a);
- }
- '''),
- check(r'''class Super {
- String a;
- Super(String a) : this.a = a;
- }
- class Class extends Super {
- Class.named(int a) : super(a);
- }
- ''', NOT_ASSIGNABLE),
-
- // Check super-calls involving generics.
- check(r'''class Super<T> {
- var a;
- Super(this.a);
- }
- class Class extends Super<String> {
- Class.named(int a) : super(a);
- }
- '''),
- check(r'''class Super<T> {
- T a;
- Super(this.a);
- }
- class Class extends Super<String> {
- Class.named(int a) : super(a);
- }
- ''', NOT_ASSIGNABLE),
- check(r'''class Super<T> {
- T a;
- Super(var a) : this.a = a;
- }
- class Class extends Super<String> {
- Class.named(int a) : super(a);
- }
- '''),
- check(r'''class Super<T> {
- T a;
- Super(T a) : this.a = a;
- }
- class Class extends Super<String> {
- Class.named(int a) : super(a);
- }
- ''', NOT_ASSIGNABLE),
-
- // Check instance creations.
- check(r'''class Class {
- var a;
- Class(this.a);
- }
- method(int a) => new Class(a);
- '''),
- check(r'''class Class {
- String a;
- Class(this.a);
- }
- method(int a) => new Class(a);
- ''', NOT_ASSIGNABLE),
- check(r'''class Class {
- String a;
- Class(var a) : this.a = a;
- }
- method(int a) => new Class(a);
- '''),
- check(r'''class Class {
- String a;
- Class(String a) : this.a = a;
- }
- method(int a) => new Class(a);
- ''', NOT_ASSIGNABLE),
-
- // Check instance creations involving generics.
- check(r'''class Class<T> {
- var a;
- Class(this.a);
- }
- method(int a) => new Class<String>(a);
- '''),
- check(r'''class Class<T> {
- T a;
- Class(this.a);
- }
- method(int a) => new Class<String>(a);
- ''', NOT_ASSIGNABLE),
- check(r'''class Class<T> {
- T a;
- Class(var a) : this.a = a;
- }
- method(int a) => new Class<String>(a);
- '''),
- check(r'''class Class<T> {
- T a;
- Class(String a) : this.a = a;
- }
- method(int a) => new Class<String>(a);
- ''', NOT_ASSIGNABLE),
- ]);
-}
-
-void testGetterSetterInvocation(MockCompiler compiler) {
- compiler.parseScript(r'''int get variable => 0;
- void set variable(String s) {}
-
- class Class {
- int get instanceField => 0;
- void set instanceField(String s) {}
-
- static int get staticField => 0;
- static void set staticField(String s) {}
-
- int overriddenField;
- int get getterField => 0;
- void set setterField(int v) {}
- }
-
- class GetterClass extends Class {
- int get overriddenField => super.overriddenField;
- int get setterField => 0;
- }
-
- class SetterClass extends Class {
- void set overriddenField(int v) {}
- void set getterField(int v) {}
- }
-
- Class c;
- GetterClass gc;
- SetterClass sc;
- ''');
-
- check(String text, [expectedWarnings]) {
- analyze(compiler, '{ $text }', warnings: expectedWarnings);
- }
-
- check("variable = '';");
- check("int v = variable;");
- check("variable = 0;", NOT_ASSIGNABLE);
- check("String v = variable;", NOT_ASSIGNABLE);
- // num is not assignable to String (the type of the setter).
- check("variable += 0;", NOT_ASSIGNABLE);
- // String is not assignable to int (the argument type of the operator + on the
- // getter) and num (the result type of the operation) is not assignable to
- // String (the type of the setter).
- check("variable += '';", [NOT_ASSIGNABLE, NOT_ASSIGNABLE]);
-
- check("c.instanceField = '';");
- check("int v = c.instanceField;");
- check("c.instanceField = 0;", NOT_ASSIGNABLE);
- check("String v = c.instanceField;", NOT_ASSIGNABLE);
-
- // num is not assignable to String (the type of the setter).
- check("c.instanceField += 0;", NOT_ASSIGNABLE);
- // String is not assignable to int (the argument type of the operator + on the
- // getter) and num (the result type of the operation) is not assignable to
- // String (the type of the setter).
- check("c.instanceField += '';", [NOT_ASSIGNABLE, NOT_ASSIGNABLE]);
-
- check("Class.staticField = '';");
- check("int v = Class.staticField;");
- check("Class.staticField = 0;", NOT_ASSIGNABLE);
- check("String v = Class.staticField;", NOT_ASSIGNABLE);
-
- // num is not assignable to String (the type of the setter).
- check("Class.staticField += 0;", NOT_ASSIGNABLE);
- // String is not assignable to int (the argument type of the operator + on the
- // getter) and num (the result type of the operation) is not assignable to
- // String (the type of the setter).
- check("Class.staticField += '';", [NOT_ASSIGNABLE, NOT_ASSIGNABLE]);
-
- check("int v = c.overriddenField;");
- check("c.overriddenField = 0;");
- check("int v = c.getterField;");
- check("c.getterField = 0;", MessageKind.UNDEFINED_SETTER);
- check("int v = c.setterField;",
- MessageKind.UNDEFINED_INSTANCE_GETTER_BUT_SETTER);
- check("c.setterField = 0;");
-
- check("int v = gc.overriddenField;");
- check("gc.overriddenField = 0;");
- check("int v = gc.setterField;");
- check("gc.setterField = 0;");
- check("int v = gc.getterField;");
- check("gc.getterField = 0;", MessageKind.UNDEFINED_SETTER);
-
- check("int v = sc.overriddenField;");
- check("sc.overriddenField = 0;");
- check("int v = sc.getterField;");
- check("sc.getterField = 0;");
- check("int v = sc.setterField;",
- MessageKind.UNDEFINED_INSTANCE_GETTER_BUT_SETTER);
- check("sc.setterField = 0;");
-}
-
-testTypePromotionHints(MockCompiler compiler) {
- compiler.parseScript(r'''class A {
- var a = "a";
- }
- class B extends A {
- var b = "b";
- }
- class C {
- var c = "c";
- }
- class D<T> {
- T d;
- }
- class E<T> extends D<T> {
- T e;
- }
- class F<S, U> extends E<S> {
- S f;
- }
- class G<V> extends F<V, V> {
- V g;
- }
- ''');
-
- check(String text, {warnings, hints, infos}) {
- analyze(compiler, '{ $text }',
- warnings: warnings, hints: hints, infos: infos);
- }
-
- check(r'''
- A a = new B();
- if (a is C) {
- var x = a.c;
- }''',
- warnings: [MessageKind.UNDEFINED_GETTER],
- hints: [MessageKind.NOT_MORE_SPECIFIC_SUBTYPE],
- infos: []);
-
- check(r'''
- A a = new B();
- if (a is C) {
- var x = '${a.c}${a.c}';
- }''',
- warnings: [MessageKind.UNDEFINED_GETTER, MessageKind.UNDEFINED_GETTER],
- hints: [MessageKind.NOT_MORE_SPECIFIC_SUBTYPE],
- infos: []);
-
- check(r'''
- A a = new B();
- if (a is C) {
- var x = '${a.d}${a.d}'; // Type promotion wouldn't help.
- }''',
- warnings: [MessageKind.UNDEFINED_GETTER, MessageKind.UNDEFINED_GETTER],
- hints: [],
- infos: []);
-
- check('''
- D<int> d = new E();
- if (d is E) { // Suggest E<int>.
- var x = d.e;
- }''', warnings: [
- MessageKind.UNDEFINED_GETTER
- ], hints: [
- checkMessage(MessageKind.NOT_MORE_SPECIFIC_SUGGESTION,
- {'shownTypeSuggestion': 'E<int>'})
- ], infos: []);
-
- check('''
- D<int> d = new F();
- if (d is F) { // Suggest F<int, dynamic>.
- var x = d.f;
- }''', warnings: [
- MessageKind.UNDEFINED_GETTER
- ], hints: [
- checkMessage(MessageKind.NOT_MORE_SPECIFIC_SUGGESTION,
- {'shownTypeSuggestion': 'F<int, dynamic>'})
- ], infos: []);
-
- check('''
- D<int> d = new G();
- if (d is G) { // Suggest G<int>.
- var x = d.f;
- }''', warnings: [
- MessageKind.UNDEFINED_GETTER
- ], hints: [
- checkMessage(MessageKind.NOT_MORE_SPECIFIC_SUGGESTION,
- {'shownTypeSuggestion': 'G<int>'})
- ], infos: []);
-
- check('''
- F<double, int> f = new G();
- if (f is G) { // Cannot suggest a more specific type.
- var x = f.g;
- }''',
- warnings: [MessageKind.UNDEFINED_GETTER],
- hints: [MessageKind.NOT_MORE_SPECIFIC],
- infos: []);
-
- check('''
- D<int> d = new E();
- if (d is E) {
- var x = d.f; // Type promotion wouldn't help.
- }''',
- warnings: [MessageKind.UNDEFINED_GETTER], hints: [], infos: []);
-
- check('''
- A a = new B();
- if (a is B) {
- a = null;
- var x = a.b;
- }''',
- warnings: [MessageKind.UNDEFINED_GETTER],
- hints: [MessageKind.POTENTIAL_MUTATION],
- infos: [MessageKind.POTENTIAL_MUTATION_HERE]);
-
- check('''
- A a = new B();
- if (a is B) {
- a = null;
- var x = a.c; // Type promotion wouldn't help.
- }''',
- warnings: [MessageKind.UNDEFINED_GETTER], hints: [], infos: []);
-
- check('''
- A a = new B();
- local() { a = new A(); }
- if (a is B) {
- var x = a.b;
- }''',
- warnings: [MessageKind.UNDEFINED_GETTER],
- hints: [MessageKind.POTENTIAL_MUTATION_IN_CLOSURE],
- infos: [MessageKind.POTENTIAL_MUTATION_IN_CLOSURE_HERE]);
-
- check('''
- A a = new B();
- local() { a = new A(); }
- if (a is B) {
- var x = a.c; // Type promotion wouldn't help.
- }''',
- warnings: [MessageKind.UNDEFINED_GETTER], hints: [], infos: []);
-
- check('''
- A a = new B();
- if (a is B) {
- var x = () => a;
- var y = a.b;
- }
- a = new A();''', warnings: [
- MessageKind.UNDEFINED_GETTER
- ], hints: [
- MessageKind.ACCESSED_IN_CLOSURE
- ], infos: [
- MessageKind.ACCESSED_IN_CLOSURE_HERE,
- MessageKind.POTENTIAL_MUTATION_HERE
- ]);
-
- check('''
- A a = new B();
- if (a is B) {
- var x = () => a;
- var y = a.c; // Type promotion wouldn't help.
- }
- a = new A();''',
- warnings: [MessageKind.UNDEFINED_GETTER], hints: [], infos: []);
-}
-
-void testCascade(MockCompiler compiler) {
- compiler.parseScript(r'''typedef A AFunc();
- typedef Function FuncFunc();
- class A {
- A a;
- B b;
- C c;
- AFunc afunc() => null;
- FuncFunc funcfunc() => null;
- C operator [](_) => null;
- void operator []=(_, C c) {}
- }
- class B {
- B b;
- C c;
- }
- class C {
- C c;
- AFunc afunc() => null;
- }
- ''');
-
- check(String text, {warnings, hints, infos}) {
- analyze(compiler, '{ $text }',
- warnings: warnings, hints: hints, infos: infos);
- }
-
- check('A a = new A()..a;');
-
- check('A a = new A()..b;');
-
- check('A a = new A()..a..b;');
-
- check('A a = new A()..b..c..a;');
-
- check('B b = new A()..a;', warnings: NOT_ASSIGNABLE);
-
- check('B b = new A()..b;', warnings: NOT_ASSIGNABLE);
-
- check('B b = new A().b;');
-
- check('new A().b..b;');
-
- check('new A().b..a;', warnings: UNDEFINED_GETTER);
-
- check('B b = new A().b..c;');
-
- check('C c = new A().b..c;', warnings: NOT_ASSIGNABLE);
-
- check('A a = new A()..a = new A();');
-
- check('A a = new A()..b = new B();');
-
- check('B b = new A()..b = new B();', warnings: NOT_ASSIGNABLE);
-
- check('A a = new A()..b = new A();', warnings: NOT_ASSIGNABLE);
-
- check('AFunc a = new C().afunc();');
-
- check('AFunc a = new C()..afunc();', warnings: NOT_ASSIGNABLE);
-
- check('C c = new C()..afunc();');
-
- check('A a = new C().afunc()();');
-
- check('A a = new C()..afunc()();', warnings: NOT_ASSIGNABLE);
-
- check('AFunc a = new C()..afunc()();', warnings: NOT_ASSIGNABLE);
-
- check('FuncFunc f = new A().funcfunc();');
-
- check('A a = new A().funcfunc();', warnings: NOT_ASSIGNABLE);
-
- check('FuncFunc f = new A()..funcfunc();', warnings: NOT_ASSIGNABLE);
-
- check('A a = new A()..funcfunc();');
-
- check('FuncFunc f = new A()..funcfunc()();', warnings: NOT_ASSIGNABLE);
-
- check('A a = new A()..funcfunc()();');
-
- check('FuncFunc f = new A()..funcfunc()()();', warnings: NOT_ASSIGNABLE);
-
- check('A a = new A()..funcfunc()()();');
-
- check('''A a;
- a = new A()..a = a = new A()..c.afunc();''');
-
- check('''A a = new A()..b = new B()..c.afunc();''');
-
- check('''A a = new A()..b = new A()..c.afunc();''', warnings: NOT_ASSIGNABLE);
-
- check('''A a = new A()..b = new A()..c.afunc()();''',
- warnings: NOT_ASSIGNABLE);
-
- check('''A a = new A()..b = new A()..c.afunc()().b;''',
- warnings: NOT_ASSIGNABLE);
-
- check('A a = new A().afunc()()[0].afunc();', warnings: NOT_ASSIGNABLE);
-
- check('C c = new A().afunc()()[0].afunc();', warnings: NOT_ASSIGNABLE);
-
- check('AFunc a = new A().afunc()()[0].afunc();');
-
- check('A a = new A()..afunc()()[0].afunc();');
-
- check('C c = new A()..afunc()()[0].afunc();', warnings: NOT_ASSIGNABLE);
-
- check('AFunc a = new A()..afunc()()[0].afunc();', warnings: NOT_ASSIGNABLE);
-
- check('A a = new A().afunc()()[0]..afunc();', warnings: NOT_ASSIGNABLE);
-
- check('C c = new A().afunc()()[0]..afunc();');
-
- check('AFunc a = new A().afunc()()[0]..afunc();', warnings: NOT_ASSIGNABLE);
-
- check('A a = new A()..afunc()()[0]..afunc();');
-
- check('C c = new A()..afunc()()[0]..afunc();', warnings: NOT_ASSIGNABLE);
-
- check('AFunc a = new A()..afunc()()[0]..afunc();', warnings: NOT_ASSIGNABLE);
-
- check('new A()[0] = new A();', warnings: NOT_ASSIGNABLE);
-
- check('new A()[0] = new C();');
-
- check('new A().a[0] = new A();', warnings: NOT_ASSIGNABLE);
-
- check('new A().a[0] = new C();');
-
- check('new A()..a[0] = new A();', warnings: NOT_ASSIGNABLE);
-
- check('new A()..a[0] = new C();');
-
- check('new A()..afunc()()[0] = new A();', warnings: NOT_ASSIGNABLE);
-
- check('new A()..afunc()()[0] = new C();');
-}
-
-testAwait(MockCompiler compiler) {
- String script = """class Foo {
- void method() async {}
- Future<int> asyncInt() => new Future<int>.value(0);
- Foo self() => this;
- }""";
- compiler.parseScript(script);
- LibraryElement mainApp = compiler.mainApp;
- ClassElement foo = mainApp.find("Foo");
- foo.ensureResolved(compiler.resolution);
- FunctionElement method = foo.lookupLocalMember('method');
- analyzeIn(compiler, method, "{ await 0; }");
- analyzeIn(compiler, method, "{ int i = await 0; }");
- analyzeIn(compiler, method, "{ String s = await 0; }",
- warnings: NOT_ASSIGNABLE);
- analyzeIn(compiler, method, "{ await asyncInt(); }");
- analyzeIn(compiler, method, "{ int i = await asyncInt(); }");
- analyzeIn(compiler, method, "{ String s = await asyncInt(); }",
- warnings: NOT_ASSIGNABLE);
- analyzeIn(compiler, method, "{ Foo f = self(); }");
- analyzeIn(compiler, method, "{ Foo f = await self(); }");
- analyzeIn(compiler, method, "{ Foo f = await self().asyncInt(); }",
- warnings: NOT_ASSIGNABLE);
- analyzeIn(compiler, method, "{ int i = await self().asyncInt(); }");
- analyzeIn(compiler, method, "{ String s = await self().asyncInt(); }",
- warnings: NOT_ASSIGNABLE);
-}
-
-testAsyncReturn(MockCompiler compiler) {
- Future check(String code, [expectedWarnings]) {
- return analyzeTopLevel(code, expectedWarnings);
- }
-
- return Future.wait([
- check("Future<int> foo() async { return; }"),
- check("Future<int> foo() async { return null; }"),
- check("Future<int> foo() async { return 0; }"),
- check("Future<int> foo() async { return ''; }", NOT_ASSIGNABLE),
- check("Future<int> foo() async { return new Future.value(); }"),
- check("Future<int> foo() async { return new Future<int>.value(); }"),
- check("Future<int> foo() async { return new Future<String>.value(); }",
- NOT_ASSIGNABLE),
- check("""
- Future<int> foo() async { return new Future<Future<int>>.value(); }
- """),
- check("void foo() async { return; }"),
- check("void foo() async { return 0; }", MessageKind.RETURN_VALUE_IN_VOID),
- check("void foo() async { return new Future.value(); }",
- MessageKind.RETURN_VALUE_IN_VOID),
- check("int foo() async { return; }"),
- check("int foo() async { return 0; }", NOT_ASSIGNABLE),
- check(
- "int foo() async { return new Future<int>.value(); }", NOT_ASSIGNABLE),
- check("Future<int> foo() async => null;"),
- check("Future<int> foo() async => 0;"),
- check("Future<int> foo() async => '';", NOT_ASSIGNABLE),
- check("Future<int> foo() async => new Future.value();"),
- check("Future<int> foo() async => new Future<int>.value();"),
- check("Future<int> foo() async => new Future<String>.value();",
- NOT_ASSIGNABLE),
- check("""
- Future<int> foo() async => new Future<Future<int>>.value();
- """),
- check("void foo() async { return 0; }", MessageKind.RETURN_VALUE_IN_VOID),
- check("void foo() async { return new Future.value(); }",
- MessageKind.RETURN_VALUE_IN_VOID),
- check("int foo() async => 0;", NOT_ASSIGNABLE),
- check("int foo() async => new Future<int>.value();", NOT_ASSIGNABLE),
- check("Iterable<int> foo() sync* { return; }"),
- check("Stream<int> foo() async* { return; }"),
- ]);
-}
-
-const CLASS_WITH_METHODS = '''
-typedef int String2Int(String s);
-
-int topLevelMethod(String s) {}
-
-class ClassWithMethods {
- untypedNoArgumentMethod() {}
- untypedOneArgumentMethod(argument) {}
- untypedTwoArgumentMethod(argument1, argument2) {}
-
- int intNoArgumentMethod() {}
- int intOneArgumentMethod(int argument) {}
- int intTwoArgumentMethod(int argument1, int argument2) {}
-
- void intOneArgumentOneOptionalMethod(int a, [int b]) {}
- void intTwoOptionalMethod([int a, int b]) {}
- void intOneArgumentOneNamedMethod(int a, {int b}) {}
- void intTwoNamedMethod({int a, int b}) {}
-
- Function functionField;
- var untypedField;
- int intField;
-
- static int staticMethod(String str) {}
- int instanceMethod(String str) {}
-
- void method() {}
-
- String2Int string2int;
-}
-class I {
- int intMethod();
-}
-class SubClass extends ClassWithMethods implements I {
- void method() {}
-}
-class SubFunction implements Function {}''';
-
-String returnWithType(String type, expression) {
- return "$type foo() { return $expression; }";
-}
-
-String arrowReturnWithType(String type, expression) {
- return "$type foo() => $expression;";
-}
-
-Node parseExpression(String text) => parseBodyCode(
- text,
- (parser, token) =>
- parser.parseExpression(parser.syntheticPreviousToken(token)).next);
-
-const Map<String, String> ALT_SOURCE = const <String, String>{
- 'num': r'''
- abstract class num {
- num operator +(num other);
- num operator -(num other);
- num operator *(num other);
- num operator %(num other);
- double operator /(num other);
- int operator ~/(num other);
- num operator -();
- bool operator <(num other);
- bool operator <=(num other);
- bool operator >(num other);
- bool operator >=(num other);
- }
- ''',
- 'int': r'''
- abstract class int extends num {
- int operator &(int other);
- int operator |(int other);
- int operator ^(int other);
- int operator ~();
- int operator <<(int shiftAmount);
- int operator >>(int shiftAmount);
- int operator -();
- }
- ''',
- 'String': r'''
- class String implements Pattern {
- String operator +(String other) => this;
- }
- ''',
-};
-
-Future setup(test(MockCompiler compiler)) {
- MockCompiler compiler =
- new MockCompiler.internal(coreSource: ALT_SOURCE, enableAsyncAwait: true);
- return compiler.init("import 'dart:async';").then((_) => test(compiler));
-}
-
-ResolutionDartType analyzeType(MockCompiler compiler, String text) {
- var node = parseExpression(text);
- TypeCheckerVisitor visitor = new TypeCheckerVisitor(
- compiler, new TreeElementMapping(null), compiler.resolution.types);
- return visitor.analyze(node);
-}
-
-analyzeTopLevel(String text, [expectedWarnings]) {
- if (expectedWarnings == null) expectedWarnings = [];
- if (expectedWarnings is! List) expectedWarnings = [expectedWarnings];
-
- MockCompiler compiler = new MockCompiler.internal(enableAsyncAwait: true);
- compiler.diagnosticHandler = createHandler(compiler, text);
-
- return compiler.init("import 'dart:async';").then((_) {
- LibraryElement library = compiler.mainApp;
-
- Link<Element> topLevelElements =
- parseUnit(text, compiler, library).reverse();
-
- ElementX element = null;
- Node node;
- TreeElements mapping;
- // Resolve all declarations and members.
- for (Link<Element> elements = topLevelElements;
- !elements.isEmpty;
- elements = elements.tail) {
- element = elements.head;
- if (element.isClass) {
- ClassElementX classElement = element;
- classElement.ensureResolved(compiler.resolution);
- classElement.forEachLocalMember((Element e) {
- if (!e.isSynthesized) {
- element = e;
- node = element.parseNode(compiler.parsingContext);
- compiler.resolver.resolve(element);
- mapping = element.treeElements;
- }
- });
- } else {
- node = element.parseNode(compiler.parsingContext);
- compiler.resolver.resolve(element);
- mapping = element.treeElements;
- }
- }
- // Type check last class declaration or member.
- TypeCheckerVisitor checker =
- new TypeCheckerVisitor(compiler, mapping, compiler.resolution.types);
- DiagnosticCollector collector = compiler.diagnosticCollector;
- collector.clear();
- checker.analyze(node, mustHaveType: false);
- compareWarningKinds(text, expectedWarnings, collector.warnings);
-
- compiler.diagnosticHandler = null;
- });
-}
-
-/**
- * Analyze the statement [text] and check messages from the type checker.
- * [errors] and [warnings] can be either [:null:], a single [MessageKind] or
- * a list of [MessageKind]s. If [hints] and [infos] are [:null:] the
- * corresponding message kinds are ignored.
- */
-analyze(MockCompiler compiler, String text,
- {errors, warnings, List hints, List infos, bool flushDeferred: false}) {
- if (warnings == null) warnings = [];
- if (warnings is! List) warnings = [warnings];
- if (errors == null) errors = [];
- if (errors is! List) errors = [errors];
-
- compiler.diagnosticHandler = createHandler(compiler, text);
-
- Token tokens = scan(text);
- NodeListener listener =
- new NodeListener(const ScannerOptions(), compiler.reporter, null);
- Parser parser = new Parser(listener);
- parser.parseStatement(parser.syntheticPreviousToken(tokens));
- Node node = listener.popNode();
- Element compilationUnit = new CompilationUnitElementX(
- new Script(null, null, null), compiler.mainApp);
- Element function = new MockElement(compilationUnit);
- TreeElements elements = compiler.resolveNodeStatement(node, function);
- compiler.enqueuer.resolution.emptyDeferredQueueForTesting();
- TypeCheckerVisitor checker =
- new TypeCheckerVisitor(compiler, elements, compiler.resolution.types);
- DiagnosticCollector collector = compiler.diagnosticCollector;
- collector.clear();
- checker.analyze(node, mustHaveType: false);
- if (flushDeferred) {
- compiler.enqueuer.resolution.emptyDeferredQueueForTesting();
- }
- compareWarningKinds(text, warnings, collector.warnings);
- compareWarningKinds(text, errors, collector.errors);
- if (hints != null) compareWarningKinds(text, hints, collector.hints);
- if (infos != null) compareWarningKinds(text, infos, collector.infos);
- compiler.diagnosticHandler = null;
-}
-
-void generateOutput(MockCompiler compiler, String text) {
- for (CollectedMessage message in compiler.diagnosticCollector.warnings) {
- int begin = message.begin;
- int end = message.end;
- SourceFile sourceFile = new StringSourceFile.fromName('analysis', text);
- print(
- sourceFile.getLocationMessage(message.message.toString(), begin, end));
- }
-}
-
-analyzeIn(MockCompiler compiler, FunctionElement element, String text,
- {warnings, hints}) {
- if (warnings == null) warnings = [];
- if (warnings is! List) warnings = [warnings];
- if (hints == null) hints = [];
- if (hints is! List) hints = [hints];
-
- compiler.resolver.resolve(element);
- Token tokens = scan(text);
- NodeListener listener =
- new NodeListener(const ScannerOptions(), compiler.reporter, null);
- Parser parser = new Parser(listener)
- ..asyncState = element.asyncMarker.asyncParserState;
- parser.parseStatement(parser.syntheticPreviousToken(tokens));
- Node node = listener.popNode();
- TreeElements elements = compiler.resolveNodeStatement(node, element);
- TypeCheckerVisitor checker =
- new TypeCheckerVisitor(compiler, elements, compiler.resolution.types);
- DiagnosticCollector collector = compiler.diagnosticCollector;
- collector.clear();
- checker.analyze(node, mustHaveType: false);
- generateOutput(compiler, text);
- compareWarningKinds(text, warnings, collector.warnings);
- compareWarningKinds(text, hints, collector.hints);
-}
diff --git a/tests/compiler/dart2js/old_frontend/type_equals_test.dart b/tests/compiler/dart2js/old_frontend/type_equals_test.dart
deleted file mode 100644
index f36b82e..0000000
--- a/tests/compiler/dart2js/old_frontend/type_equals_test.dart
+++ /dev/null
@@ -1,115 +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 "package:async_helper/async_helper.dart";
-import 'package:compiler/src/elements/resolution_types.dart';
-import "../compiler_helper.dart";
-
-test(compiler, String name1, String name2, {bool expect}) {
- Expect.isTrue((expect != null), 'required parameter "expect" not given');
- dynamic clazz = findElement(compiler, "Class");
- clazz.ensureResolved(compiler.resolution);
- dynamic element1 = clazz.buildScope().lookup(name1);
- dynamic element2 = clazz.buildScope().lookup(name2);
- Expect.isNotNull(element1);
- Expect.isNotNull(element2);
- Expect.equals(element1.kind, ElementKind.FUNCTION);
- Expect.equals(element2.kind, ElementKind.FUNCTION);
- element1.computeType(compiler.resolution);
- element2.computeType(compiler.resolution);
- FunctionSignature signature1 = element1.functionSignature;
- FunctionSignature signature2 = element2.functionSignature;
-
- // Function signatures are used to be to provide void types (only occurring as
- // as return types) and (inlined) function types (only occurring as method
- // parameter types).
- //
- // Only a single type is used from each signature. That is, it is not the
- // intention to check the whole signatures against eachother.
- ResolutionDartType type1;
- ResolutionDartType type2;
- if (signature1.requiredParameterCount == 0) {
- // If parameters is empty, use return type.
- type1 = signature1.type.returnType;
- } else {
- // Otherwise use the first argument type.
- type1 = signature1.requiredParameters.first.type;
- }
- if (signature2.requiredParameterCount == 0) {
- // If parameters is empty, use return type.
- type2 = signature2.type.returnType;
- } else {
- // Otherwise use the first argument type.
- type2 = signature2.requiredParameters.first.type;
- }
- if (expect) {
- Expect.equals(type1, type2, "$type1 != $type2");
- } else {
- Expect.notEquals(type1, type2, "$type1 == $type2");
- }
-}
-
-void main() {
- var uri = new Uri(scheme: 'source');
- var compiler = mockCompilerFor(r"""
- typedef int Typedef1<X,Y>(String s1);
- typedef void Typedef2<Z>(T t1, S s1);
-
- class Class<T,S> {
- void void1() {}
- void void2() {}
- void int1(int a) {}
- void int2(int b) {}
- void String1(String a) {}
- void String2(String b) {}
- void ListInt1(List<int> a) {}
- void ListInt2(List<int> b) {}
- void ListString1(List<String> a) {}
- void ListString2(List<String> b) {}
- void MapIntString1(Map<int,String> a) {}
- void MapIntString2(Map<int,String> b) {}
- void TypeVar1(T t1, S s1) {}
- void TypeVar2(T t2, S s2) {}
- void Function1a(int a(String s1)) {}
- void Function2a(int b(String s2)) {}
- void Function1b(void a(T t1, S s1)) {}
- void Function2b(void b(T t2, S s2)) {}
- void Typedef1a(Typedef1<int,String> a) {}
- void Typedef2a(Typedef1<int,String> b) {}
- void Typedef1b(Typedef2<T> a) {}
- void Typedef2b(Typedef2<T> b) {}
- void Typedef1c(Typedef2<S> a) {}
- void Typedef2c(Typedef2<S> b) {}
- }
-
- void main() {}
- """, uri, analyzeAll: true, analyzeOnly: true);
- asyncTest(() => compiler.run(uri).then((_) {
- test(compiler, "void1", "void2", expect: true);
- test(compiler, "int1", "int2", expect: true);
- test(compiler, "String1", "String2", expect: true);
- test(compiler, "ListInt1", "ListInt2", expect: true);
- test(compiler, "ListString1", "ListString2", expect: true);
- test(compiler, "MapIntString1", "MapIntString2", expect: true);
- test(compiler, "TypeVar1", "TypeVar2", expect: true);
- test(compiler, "Function1a", "Function2a", expect: true);
- test(compiler, "Function1b", "Function2b", expect: true);
- test(compiler, "Typedef1a", "Typedef2a", expect: true);
- test(compiler, "Typedef1b", "Typedef2b", expect: true);
- test(compiler, "Typedef1c", "Typedef2c", expect: true);
-
- test(compiler, "void1", "int1", expect: false);
- test(compiler, "int1", "String1", expect: false);
- test(compiler, "String1", "ListInt1", expect: false);
- test(compiler, "ListInt1", "ListString1", expect: false);
- test(compiler, "ListString1", "MapIntString1", expect: false);
- test(compiler, "MapIntString1", "TypeVar1", expect: false);
- test(compiler, "TypeVar1", "Function1a", expect: false);
- test(compiler, "Function1a", "Function1b", expect: false);
- test(compiler, "Function1b", "Typedef1a", expect: false);
- test(compiler, "Typedef1a", "Typedef1b", expect: false);
- test(compiler, "Typedef1b", "Typedef1c", expect: false);
- }));
-}
diff --git a/tests/compiler/dart2js/old_frontend/type_order_test.dart b/tests/compiler/dart2js/old_frontend/type_order_test.dart
deleted file mode 100644
index be592dc..0000000
--- a/tests/compiler/dart2js/old_frontend/type_order_test.dart
+++ /dev/null
@@ -1,89 +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.
-
-library type_order_test;
-
-import 'package:expect/expect.dart';
-import 'package:async_helper/async_helper.dart';
-import '../type_test_helper.dart';
-import 'package:compiler/src/elements/resolution_types.dart';
-import "package:compiler/src/elements/elements.dart"
- show ClassElement, TypedefElement;
-
-void main() {
- asyncTest(() => TypeEnvironment.create(r"""
- class A<AT, AS> {}
- typedef BS B<BT, BS>(BT t);
- class C<CT, CS> extends A<CS, CT> {}
- class X {}
- class Y {}
- class Z {}
- """).then((env) {
- var types = <ResolutionDartType>[];
- ResolutionDartType add(ResolutionDartType type) {
- types.add(type);
- return type;
- }
-
- ResolutionDartType dynamic_ = add(env['dynamic']);
- ResolutionDartType void_ = add(env['void']);
-
- ClassElement A = env.getElement('A');
- TypedefElement B = env.getElement('B');
- ClassElement C = env.getElement('C');
- ResolutionDartType X = add(env['X']);
- ResolutionDartType Y = add(env['Y']);
- ResolutionDartType Z = add(env['Z']);
-
- ResolutionInterfaceType A_this = add(A.thisType);
- ResolutionInterfaceType A_raw = add(A.rawType);
- ResolutionTypeVariableType AT = add(A_this.typeArguments[0]);
- ResolutionTypeVariableType AS = add(A_this.typeArguments[1]);
- ResolutionInterfaceType A_X_Y = add(instantiate(A, [X, Y]));
- ResolutionInterfaceType A_Y_X = add(instantiate(A, [Y, X]));
-
- ResolutionTypedefType B_this =
- add(B.computeType(env.compiler.resolution));
- ResolutionTypedefType B_raw = add(B.rawType);
- ResolutionTypeVariableType BT = add(B_this.typeArguments[0]);
- ResolutionTypeVariableType BS = add(B_this.typeArguments[1]);
- ResolutionFunctionType B_this_alias = add(B.alias);
- ResolutionTypedefType B_X_Y = add(instantiate(B, [X, Y]));
- ResolutionFunctionType B_X_Y_alias = add(B_X_Y.unaliased);
- ResolutionTypedefType B_Y_X = add(instantiate(B, [Y, X]));
- ResolutionFunctionType B_Y_X_alias = add(B_Y_X.unaliased);
-
- ResolutionInterfaceType C_this = add(C.thisType);
- ResolutionInterfaceType C_raw = add(C.rawType);
- ResolutionTypeVariableType CT = add(C_this.typeArguments[0]);
- ResolutionTypeVariableType CS = add(C_this.typeArguments[1]);
-
- Expect.listEquals(<ResolutionDartType>[
- void_,
- dynamic_,
- A_raw,
- A_this,
- A_X_Y,
- A_Y_X,
- AT,
- AS,
- B_raw,
- B_this,
- B_X_Y,
- B_Y_X,
- BT,
- BS,
- C_raw,
- C_this,
- CT,
- CS,
- X,
- Y,
- Z,
- B_this_alias,
- B_Y_X_alias,
- B_X_Y_alias,
- ], Types.sorted(types));
- }));
-}
diff --git a/tests/compiler/dart2js/old_frontend/type_promotion_test.dart b/tests/compiler/dart2js/old_frontend/type_promotion_test.dart
deleted file mode 100644
index c09089f..0000000
--- a/tests/compiler/dart2js/old_frontend/type_promotion_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 dart2js produces the expected static type warnings for type
-// promotion language tests. This ensures that the analyzer and dart2js agrees
-// on these tests.
-
-import 'warnings_checker.dart';
-
-/// Map from test files to a map of their expected status. If the status map is
-/// `null` no warnings must be missing or unexpected, otherwise the status map
-/// can contain a list of line numbers for keys 'missing' and 'unexpected' for
-/// the warnings of each category.
-const Map<String, dynamic> TESTS = const {
- 'language/type_promotion_assign_test.dart': null,
- 'language/type_promotion_closure_test.dart': null,
- 'language/type_promotion_functions_test.dart': const {
- 'missing': const [65, 66, 67]
- }, // Issue 14933.
- 'language/type_promotion_local_test.dart': null,
- 'language/type_promotion_logical_and_test.dart': null,
- 'language/type_promotion_more_specific_test.dart': null,
- 'language/type_promotion_multiple_test.dart': null,
- 'language/type_promotion_parameter_test.dart': null,
-};
-
-void main() {
- checkWarnings(TESTS);
-}
diff --git a/tests/compiler/dart2js/old_frontend/type_variable_bound_test.dart b/tests/compiler/dart2js/old_frontend/type_variable_bound_test.dart
deleted file mode 100644
index e01e18e..0000000
--- a/tests/compiler/dart2js/old_frontend/type_variable_bound_test.dart
+++ /dev/null
@@ -1,282 +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:async';
-import "package:async_helper/async_helper.dart";
-import '../compiler_helper.dart';
-import "package:expect/expect.dart";
-
-Future compile(String source) {
- Uri uri = Uri.parse('test:code');
- var compiler = mockCompilerFor(source, uri,
- analyzeOnly: true, enableTypeAssertions: true);
- compiler.diagnosticHandler = createHandler(compiler, source);
- return compiler.run(uri).then((_) {
- return compiler;
- });
-}
-
-Future test(String source, {var errors, var warnings}) async {
- if (errors == null) errors = [];
- if (errors is! List) errors = [errors];
- if (warnings == null) warnings = [];
- if (warnings is! List) warnings = [warnings];
- var compiler = await compile(source);
- DiagnosticCollector collector = compiler.diagnosticCollector;
- Expect.equals(!errors.isEmpty, compiler.compilationFailed);
- Expect.equals(
- errors.length,
- collector.errors.length,
- 'unexpected error count: ${collector.errors.length} '
- 'expected ${errors.length}');
- Expect.equals(
- warnings.length,
- collector.warnings.length,
- 'unexpected warning count: ${collector.warnings.length} '
- 'expected ${warnings.length}');
-
- for (int i = 0; i < errors.length; i++) {
- Expect.equals(errors[i], collector.errors.elementAt(i).message.kind);
- }
- for (int i = 0; i < warnings.length; i++) {
- Expect.equals(warnings[i], collector.warnings.elementAt(i).message.kind);
- }
-}
-
-Future test1() async {
- var compiler = await compile(r"""
-class A<T extends T> {}
-
-void main() {
- new A();
-}
-""");
- DiagnosticCollector collector = compiler.diagnosticCollector;
- Expect.isFalse(compiler.compilationFailed);
- Expect.isTrue(
- collector.errors.isEmpty, 'unexpected errors: ${collector.errors}');
- Expect.equals(1, collector.warnings.length,
- 'expected exactly one warning, but got ${collector.warnings}');
-
- print(collector.warnings.elementAt(0));
- Expect.equals(MessageKind.CYCLIC_TYPE_VARIABLE,
- collector.warnings.elementAt(0).message.kind);
- Expect.equals("T",
- collector.warnings.elementAt(0).message.arguments['typeVariableName']);
-}
-
-Future test2() async {
- var compiler = await compile(r"""
-class B<T extends S, S extends T> {}
-
-void main() {
- new B();
-}
-""");
- DiagnosticCollector collector = compiler.diagnosticCollector;
- Expect.isFalse(compiler.compilationFailed);
- print(collector.errors);
- Expect.isTrue(collector.errors.isEmpty, 'unexpected errors');
- Expect.equals(2, collector.warnings.length,
- 'expected exactly two errors, but got ${collector.warnings}');
-
- Expect.equals(MessageKind.CYCLIC_TYPE_VARIABLE,
- collector.warnings.elementAt(0).message.kind);
- Expect.equals("T",
- collector.warnings.elementAt(0).message.arguments['typeVariableName']);
-
- Expect.equals(MessageKind.CYCLIC_TYPE_VARIABLE,
- collector.warnings.elementAt(1).message.kind);
- Expect.equals("S",
- collector.warnings.elementAt(1).message.arguments['typeVariableName']);
-}
-
-Future test3() async {
- var compiler = await compile(r"""
-class C<T extends S, S extends U, U extends T> {}
-
-void main() {
- new C();
-}
-""");
- DiagnosticCollector collector = compiler.diagnosticCollector;
- Expect.isFalse(compiler.compilationFailed);
- print(collector.errors);
- Expect.isTrue(collector.errors.isEmpty, 'unexpected errors');
- Expect.equals(3, collector.warnings.length,
- 'expected exactly one error, but got ${collector.warnings}');
-
- Expect.equals(MessageKind.CYCLIC_TYPE_VARIABLE,
- collector.warnings.elementAt(0).message.kind);
- Expect.equals("T",
- collector.warnings.elementAt(0).message.arguments['typeVariableName']);
-
- Expect.equals(MessageKind.CYCLIC_TYPE_VARIABLE,
- collector.warnings.elementAt(1).message.kind);
- Expect.equals("S",
- collector.warnings.elementAt(1).message.arguments['typeVariableName']);
-
- Expect.equals(MessageKind.CYCLIC_TYPE_VARIABLE,
- collector.warnings.elementAt(2).message.kind);
- Expect.equals("U",
- collector.warnings.elementAt(2).message.arguments['typeVariableName']);
-}
-
-Future test4() async {
- var compiler = await compile(r"""
-class D<T extends S, S extends U, U extends S> {}
-
-void main() {
- new D();
-}
-""");
- DiagnosticCollector collector = compiler.diagnosticCollector;
- Expect.isFalse(compiler.compilationFailed);
- print(collector.errors);
- Expect.isTrue(collector.errors.isEmpty, 'unexpected errors');
- Expect.equals(2, collector.warnings.length,
- 'expected exactly one error, but got ${collector.warnings}');
-
- Expect.equals(MessageKind.CYCLIC_TYPE_VARIABLE,
- collector.warnings.elementAt(0).message.kind);
- Expect.equals("S",
- collector.warnings.elementAt(0).message.arguments['typeVariableName']);
-
- Expect.equals(MessageKind.CYCLIC_TYPE_VARIABLE,
- collector.warnings.elementAt(1).message.kind);
- Expect.equals("U",
- collector.warnings.elementAt(1).message.arguments['typeVariableName']);
-}
-
-Future test5() {
- return test(r"""
-class A<T extends num> {}
-
-void main() {
- new A();
- new A<num>();
- new A<dynamic>();
- new A<int>();
- new A<double>();
-}
-""");
-}
-
-Future test6() {
- return test(r"""
-class A<T extends num> {}
-
-void main() {
- new A<String>();
-}
-""", warnings: MessageKind.INVALID_TYPE_VARIABLE_BOUND);
-}
-
-Future test7() {
- return test(r"""
-class A<T extends num> {}
-class B<T> extends A<T> {} // Warning produced here.
-
-void main() {
- new B(); // No warning produced here.
- new B<String>(); // No warning produced here.
-}
-""", warnings: MessageKind.INVALID_TYPE_VARIABLE_BOUND);
-}
-
-Future test8() {
- return test(r"""
-class B<T extends B<T>> {}
-class C<T extends B<T>> extends B<T> {}
-class D<T extends C<T>> extends C<T> {}
-class E<T extends E<T>> extends D<T> {}
-class F extends E<F> {}
-
-void main() {
- new B();
- new B<dynamic>();
- new B<F>();
- new B<B<F>>();
- new C();
- new C<dynamic>();
- new C<B<F>>();
- new D();
- new D<dynamic>();
- new D<C<F>>();
- new E();
- new E<dynamic>();
- new E<E<F>>();
- new F();
-}
-""");
-}
-
-Future test9() {
- return test(r"""
-class B<T extends B<T>> {}
-class C<T extends B<T>> extends B<T> {}
-class D<T extends C<T>> extends C<T> {}
-class E<T extends E<T>> extends D<T> {}
-class F extends E<F> {}
-
-void main() {
- new D<B<F>>(); // Warning: B<F> is not a subtype of C<T>.
- new E<D<F>>(); // Warning: E<F> is not a subtype of E<T>.
-}
-""", warnings: [
- MessageKind.INVALID_TYPE_VARIABLE_BOUND,
- MessageKind.INVALID_TYPE_VARIABLE_BOUND
- ]);
-}
-
-Future test10() {
- return test(r"""
-class A {
- const A();
-}
-class Test<T extends A> {
- final T x = const A();
- const Test();
-}
-main() {
- print(const Test<A>());
-}
-""");
-}
-
-// TODO(het): The error is reported twice because both the Dart and JS constant
-// compilers are run on the const constructor, investigate why.
-Future test11() {
- return test(r"""
-class A {
- const A();
-}
-class B extends A {
- const B();
-}
-class Test<T extends A> {
- final T x = const A();
- const Test();
-}
-main() {
- print(const Test<B>());
-}
-""", errors: [MessageKind.NOT_ASSIGNABLE, MessageKind.NOT_ASSIGNABLE]);
-}
-
-main() {
- asyncTest(() async {
- await test1();
- await test2();
- await test3();
- await test4();
- await test5();
- await test6();
- await test7();
- await test8();
- await test9();
- await test10();
- await test11();
- });
-}
diff --git a/tests/compiler/dart2js/old_frontend/type_variable_occurrence_test.dart b/tests/compiler/dart2js/old_frontend/type_variable_occurrence_test.dart
deleted file mode 100644
index ac88d12..0000000
--- a/tests/compiler/dart2js/old_frontend/type_variable_occurrence_test.dart
+++ /dev/null
@@ -1,130 +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.
-
-library type_variable_occurrence_test;
-
-import 'package:async_helper/async_helper.dart';
-import 'package:compiler/src/elements/elements.dart' show ClassElement;
-import 'package:compiler/src/elements/resolution_types.dart';
-import 'package:compiler/src/elements/types.dart';
-import 'package:expect/expect.dart';
-
-import '../type_test_helper.dart';
-
-void main() {
- testTypeVariableOccurrence();
-}
-
-testTypeVariableOccurrence() {
- asyncTest(() => TypeEnvironment.create(r"""
- typedef S Typedef1<S>();
- typedef void Typedef2<S>(S s);
- typedef void Typedef3<S>(A<S> a);
-
- class A<T> {
- int field1;
- T field2;
- A<int> field3;
- A<T> field4;
- A<A<int>> field5;
- A<A<T>> field6;
-
- Typedef1 field7;
- Typedef1<int> field8;
- Typedef1<T> field9;
- Typedef1<Typedef1<T>> field10;
-
- Typedef2 field11;
- Typedef2<int> field12;
- Typedef2<T> field13;
- Typedef2<Typedef1<T>> field14;
-
- Typedef3 field15;
- Typedef3<int> field16;
- Typedef3<T> field17;
- Typedef3<Typedef1<T>> field18;
-
- void method1() {}
- T method2() => null;
- A<T> method3() => null;
- void method4(T t) {}
- void method5(A<T> t) {}
- void method6(void foo(T t)) {}
- void method7([T t]) {}
- void method8({T t}) {}
- }
- """).then((env) {
- ClassElement A = env.getElement('A');
-
- expect(bool expectResult, String memberName) {
- ResolutionDartType memberType = env.getMemberType(memberName, A);
- ResolutionTypeVariableType typeVariable =
- memberType.typeVariableOccurrence;
- if (expectResult) {
- Expect.isNotNull(typeVariable);
- Expect.equals(A, DartTypes.getClassContext(memberType));
- } else {
- Expect.isNull(typeVariable);
- Expect.isNull(DartTypes.getClassContext(memberType));
- }
- }
-
- // int field1;
- expect(false, 'field1');
- // T field2;
- expect(true, 'field2');
- // A<int> field3;
- expect(false, 'field3');
- // A<T> field4;
- expect(true, 'field4');
- // A<A<int>> field5;
- expect(false, 'field5');
- // A<A<T>> field6;
- expect(true, 'field6');
-
- // Typedef1 field7;
- expect(false, 'field7');
- // Typedef1<int> field8;
- expect(false, 'field8');
- // Typedef1<T> field9;
- expect(true, 'field9');
- // Typedef1<Typedef1<T>> field10;
- expect(true, 'field10');
-
- // Typedef2 field11;
- expect(false, 'field11');
- // Typedef2<int> field12;
- expect(false, 'field12');
- // Typedef2<T> field13;
- expect(true, 'field13');
- // Typedef2<Typedef1<T>> field14;
- expect(true, 'field14');
-
- // Typedef3 field15;
- expect(false, 'field15');
- // Typedef3<int> field16;
- expect(false, 'field16');
- // Typedef3<T> field17;
- expect(true, 'field17');
- // Typedef3<Typedef1<T>> field18;
- expect(true, 'field18');
-
- // void method1() {}
- expect(false, 'method1');
- // T method2() => null;
- expect(true, 'method2');
- // A<T> method3() => null;
- expect(true, 'method3');
- // void method4(T t) {}
- expect(true, 'method4');
- // void method5(A<T> t) {}
- expect(true, 'method5');
- // void method6(void foo(T t)) {}
- expect(true, 'method6');
- // void method7([T t]);
- expect(true, 'method7');
- // void method8({T t});
- expect(true, 'method8');
- }));
-}
diff --git a/tests/compiler/dart2js/old_frontend/unparser2_test.dart b/tests/compiler/dart2js/old_frontend/unparser2_test.dart
deleted file mode 100644
index 458b6f3..0000000
--- a/tests/compiler/dart2js/old_frontend/unparser2_test.dart
+++ /dev/null
@@ -1,115 +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 "package:compiler/src/parser/element_listener.dart";
-import "package:compiler/src/parser/node_listener.dart";
-import "package:front_end/src/fasta/parser.dart";
-import "package:front_end/src/fasta/scanner.dart";
-import "package:compiler/src/tree/tree.dart";
-
-import "package:compiler/src/diagnostics/diagnostic_listener.dart";
-import "package:compiler/src/elements/elements.dart"
- show CompilationUnitElement, LibraryElement;
-import "package:compiler/src/elements/modelx.dart"
- show CompilationUnitElementX, LibraryElementX;
-import "package:compiler/src/script.dart";
-
-main() {
- testClassDef();
- testClass1Field();
- testClass2Fields();
- testClass1Field1Method();
- testClass1Field2Method();
- testClassDefTypeParam();
- testEnumDef();
- testEnum1Value();
- testEnum2Value();
- testEnum3Value();
- testEnum3CommaValue();
-}
-
-testClassDef() {
- compareCode('class T{}');
-}
-
-testClass1Field() {
- compareCode('class T{var x;}');
-}
-
-testClass2Fields() {
- compareCode('class T{var x;var y;}');
-}
-
-testClass1Field1Method() {
- compareCode('class T{var x;m(){}}');
-}
-
-testClass1Field2Method() {
- compareCode('class T{a(){}b(){}}');
-}
-
-testClassDefTypeParam() {
- compareCode('class T<X>{}');
-}
-
-testEnumDef() {
- compareCode('enum T {}');
-}
-
-testEnum1Value() {
- compareCode('enum T {A}');
-}
-
-testEnum2Value() {
- compareCode('enum T {A,B}');
-}
-
-testEnum3Value() {
- compareCode('enum T {A,B,C}');
-}
-
-testEnum3CommaValue() {
- compareCode('enum T {A,B,C,}', expectedResult: 'enum T {A,B,C}');
-}
-
-void compareCode(String code, {String expectedResult}) {
- if (expectedResult == null) {
- expectedResult = code;
- }
- Expect.equals(expectedResult, doUnparse(code));
-}
-
-String doUnparse(String source) {
- MessageCollector diagnosticListener = new MessageCollector();
- Script script = new Script(null, null, null);
- LibraryElement lib = new LibraryElementX(script);
- CompilationUnitElement element = new CompilationUnitElementX(script, lib);
- StringScanner scanner = new StringScanner(source);
- Token beginToken = scanner.tokenize();
- NodeListener listener =
- new NodeListener(const ScannerOptions(), diagnosticListener, element);
- Parser parser = new Parser(listener);
- parser.parseUnit(beginToken);
- Node node = listener.popNode();
- Expect.isTrue(listener.nodes.isEmpty);
- return unparse(node);
-}
-
-class MessageCollector extends DiagnosticReporter {
- List<String> messages;
- MessageCollector() {
- messages = [];
- }
- void internalError(node, covariant String reason) {
- messages.add(reason);
- throw reason;
- }
-
- void log(message) {
- messages.add(message);
- }
-
- noSuchMethod(Invocation invocation) => throw 'unsupported operation';
-}
diff --git a/tests/compiler/dart2js/old_frontend/unparser_test.dart b/tests/compiler/dart2js/old_frontend/unparser_test.dart
deleted file mode 100644
index cd815c8..0000000
--- a/tests/compiler/dart2js/old_frontend/unparser_test.dart
+++ /dev/null
@@ -1,432 +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 'parser_helper.dart';
-import 'package:compiler/src/tree/tree.dart';
-
-testUnparse(String statement) {
- Node node = parseStatement(statement);
- Expect.equals(statement, unparse(node));
-}
-
-testUnparseMember(String member) {
- Node node = parseMember(member);
- Expect.equals(member, unparse(node));
-}
-
-testUnparseUnit(String code) {
- Node node = fullParseUnit(code);
- Expect.equals(code, unparse(node));
-}
-
-testUnparseTopLevelWithMetadata(String code) {
- testUnparseUnit(code);
- // TODO(ahe): Enable when supported.
- // testUnparseUnit('@foo $code');
-}
-
-testSignedConstants() {
- testUnparse('var x=-42;');
- testUnparse('var x=-.42;');
- testUnparse('var x=-0;');
- testUnparse('var x=-0.0;');
- testUnparse('var x=-.0;');
-}
-
-testGenericTypes() {
- testUnparse('var x=new List<List<int>>();');
- testUnparse('var x=new List<List<List<int>>>();');
- testUnparse('var x=new List<List<List<List<int>>>>();');
- testUnparse('var x=new List<List<List<List<List<int>>>>>();');
-}
-
-testForLoop() {
- testUnparse('for(;i<100;i++ ){}');
- testUnparse('for(i=0;i<100;i++ ){}');
-}
-
-testEmptyList() {
- testUnparse('var x=[] ;');
-}
-
-testClosure() {
- testUnparse('var x=(var x)=>x;');
-}
-
-testIndexedOperatorDecl() {
- testUnparseMember('operator[](int i)=>null;');
- testUnparseMember('operator[]=(int i,int j)=>null;');
-}
-
-testNativeMethods() {
- testUnparseMember('foo()native;');
- testUnparseMember('foo()native "bar";');
- testUnparseMember('foo()native "this.x = 41";');
-}
-
-testPrefixIncrements() {
- testUnparse(' ++i;');
- testUnparse(' ++a[i];');
- testUnparse(' ++a[ ++b[i]];');
-}
-
-testConstModifier() {
- testUnparse('foo([var a=const[] ]){}');
- testUnparse('foo([var a=const{}]){}');
- testUnparse('foo(){var a=const[] ;var b=const{};}');
- testUnparse('foo([var a=const[const{"a":const[1,2,3]}]]){}');
-}
-
-testSimpleObjectInstantiation() {
- testUnparse('main(){new Object();}');
-}
-
-testLibraryName() {
- testUnparseTopLevelWithMetadata('library com;');
- testUnparseTopLevelWithMetadata('library com.example;');
- testUnparseTopLevelWithMetadata('library com.example.dart;');
-}
-
-testImport() {
- testUnparseTopLevelWithMetadata('import "søhest";');
- testUnparseTopLevelWithMetadata('import "søhest" as fiskehest;');
-}
-
-testExport() {
- testUnparseTopLevelWithMetadata('export "søhest";');
-}
-
-testConditionalImport() {
- testUnparseTopLevelWithMetadata('import "søhest" if(some.dotted.id)"other";');
- testUnparseTopLevelWithMetadata('import "søhest" if(id=="some str")"other";');
- testUnparseTopLevelWithMetadata('import "søhest"'
- ' if(id=="some str")"other"'
- ' if(id)"other2";');
- testUnparseTopLevelWithMetadata(
- 'import "søhest" if(some.dotted.id)"other" as fiskehest;');
- testUnparseTopLevelWithMetadata(
- 'import "søhest" if(id=="some str")"other" as fiskehest;');
- testUnparseTopLevelWithMetadata('import "søhest"'
- ' if(id=="some str")"other"'
- ' if(id)"other2"'
- ' as fiskehest;');
- testUnparseTopLevelWithMetadata(
- 'import "søhest" if(some.dotted.id)"other" deferred as fiskehest;');
- testUnparseTopLevelWithMetadata(
- 'import "søhest" if(id=="some str")"other" deferred as fiskehest;');
- testUnparseTopLevelWithMetadata('import "søhest"'
- ' if(id=="some str")"other"'
- ' if(id)"other2"'
- ' deferred as fiskehest;');
- testUnparseTopLevelWithMetadata('import "søhest"'
- ' if(id=="some str")"other"'
- ' if(id)"other2"'
- ' deferred as fiskehest'
- ' show foo,bar;');
-}
-
-testConditionalExport() {
- testUnparseTopLevelWithMetadata('export "søhest" if(some.dotted.id)"other";');
- testUnparseTopLevelWithMetadata('export "søhest" if(id=="some str")"other";');
- testUnparseTopLevelWithMetadata('export "søhest"'
- ' if(id=="some str")"other"'
- ' if(id)"other2";');
- testUnparseTopLevelWithMetadata('export "søhest"'
- ' if(id=="some str")"other"'
- ' if(id)"other2"'
- ' show foo,bar;');
-}
-
-testPart() {
- testUnparseTopLevelWithMetadata('part "søhest";');
-}
-
-testPartOf() {
- testUnparseTopLevelWithMetadata('part of com;');
- testUnparseTopLevelWithMetadata('part of com.example;');
- testUnparseTopLevelWithMetadata('part of com.example.dart;');
-}
-
-testCombinators() {
- testUnparseTopLevelWithMetadata('import "søhest" as fiskehest show a;');
- testUnparseTopLevelWithMetadata('import "søhest" as fiskehest show hide;');
- testUnparseTopLevelWithMetadata('import "søhest" as fiskehest show show;');
- testUnparseTopLevelWithMetadata('import "søhest" as fiskehest show a,hide;');
- testUnparseTopLevelWithMetadata('import "søhest" as fiskehest show a,show;');
-
- testUnparseTopLevelWithMetadata('import "søhest" as fiskehest hide a;');
- testUnparseTopLevelWithMetadata('import "søhest" as fiskehest hide hide;');
- testUnparseTopLevelWithMetadata('import "søhest" as fiskehest hide show;');
- testUnparseTopLevelWithMetadata('import "søhest" as fiskehest hide a,hide;');
- testUnparseTopLevelWithMetadata('import "søhest" as fiskehest hide a,show;');
-
- testUnparseTopLevelWithMetadata(
- 'import "søhest" as fiskehest show a hide a;');
- testUnparseTopLevelWithMetadata(
- 'import "søhest" as fiskehest show hide hide hide;');
- testUnparseTopLevelWithMetadata(
- 'import "søhest" as fiskehest show show hide show;');
- testUnparseTopLevelWithMetadata(
- 'import "søhest" as fiskehest show a,hide hide a,hide;');
- testUnparseTopLevelWithMetadata(
- 'import "søhest" as fiskehest show a,show hide a,show;');
-
- testUnparseTopLevelWithMetadata(
- 'import "søhest" as fiskehest hide a show a;');
- testUnparseTopLevelWithMetadata(
- 'import "søhest" as fiskehest hide hide show hide;');
- testUnparseTopLevelWithMetadata(
- 'import "søhest" as fiskehest hide show show show;');
- testUnparseTopLevelWithMetadata(
- 'import "søhest" as fiskehest hide a,hide show a,hide;');
- testUnparseTopLevelWithMetadata(
- 'import "søhest" as fiskehest hide a,show show a,show;');
-
- testUnparseTopLevelWithMetadata(
- 'import "søhest" as fiskehest show a show a;');
- testUnparseTopLevelWithMetadata(
- 'import "søhest" as fiskehest show hide show hide;');
- testUnparseTopLevelWithMetadata(
- 'import "søhest" as fiskehest show show show show;');
- testUnparseTopLevelWithMetadata(
- 'import "søhest" as fiskehest show a,hide show a,hide;');
- testUnparseTopLevelWithMetadata(
- 'import "søhest" as fiskehest show a,show show a,show;');
-
- testUnparseTopLevelWithMetadata(
- 'import "søhest" as fiskehest hide a hide a;');
- testUnparseTopLevelWithMetadata(
- 'import "søhest" as fiskehest hide hide hide hide;');
- testUnparseTopLevelWithMetadata(
- 'import "søhest" as fiskehest hide show hide show;');
- testUnparseTopLevelWithMetadata(
- 'import "søhest" as fiskehest hide a,hide hide a,hide;');
- testUnparseTopLevelWithMetadata(
- 'import "søhest" as fiskehest hide a,show hide a,show;');
-
- testUnparseTopLevelWithMetadata('export "søhest" show a;');
- testUnparseTopLevelWithMetadata('export "søhest" show hide;');
- testUnparseTopLevelWithMetadata('export "søhest" show show;');
- testUnparseTopLevelWithMetadata('export "søhest" show a,hide;');
- testUnparseTopLevelWithMetadata('export "søhest" show a,show;');
-
- testUnparseTopLevelWithMetadata('export "søhest" hide a;');
- testUnparseTopLevelWithMetadata('export "søhest" hide hide;');
- testUnparseTopLevelWithMetadata('export "søhest" hide show;');
- testUnparseTopLevelWithMetadata('export "søhest" hide a,hide;');
- testUnparseTopLevelWithMetadata('export "søhest" hide a,show;');
-
- testUnparseTopLevelWithMetadata('export "søhest" show a hide a;');
- testUnparseTopLevelWithMetadata('export "søhest" show hide hide hide;');
- testUnparseTopLevelWithMetadata('export "søhest" show show hide show;');
- testUnparseTopLevelWithMetadata('export "søhest" show a,hide hide a,hide;');
- testUnparseTopLevelWithMetadata('export "søhest" show a,show hide a,show;');
-
- testUnparseTopLevelWithMetadata('export "søhest" hide a show a;');
- testUnparseTopLevelWithMetadata('export "søhest" hide hide show hide;');
- testUnparseTopLevelWithMetadata('export "søhest" hide show show show;');
- testUnparseTopLevelWithMetadata('export "søhest" hide a,hide show a,hide;');
- testUnparseTopLevelWithMetadata('export "søhest" hide a,show show a,show;');
-
- testUnparseTopLevelWithMetadata('export "søhest" show a show a;');
- testUnparseTopLevelWithMetadata('export "søhest" show hide show hide;');
- testUnparseTopLevelWithMetadata('export "søhest" show show show show;');
- testUnparseTopLevelWithMetadata('export "søhest" show a,hide show a,hide;');
- testUnparseTopLevelWithMetadata('export "søhest" show a,show show a,show;');
-
- testUnparseTopLevelWithMetadata('export "søhest" hide a hide a;');
- testUnparseTopLevelWithMetadata('export "søhest" hide hide hide hide;');
- testUnparseTopLevelWithMetadata('export "søhest" hide show hide show;');
- testUnparseTopLevelWithMetadata('export "søhest" hide a,hide hide a,hide;');
- testUnparseTopLevelWithMetadata('export "søhest" hide a,show hide a,show;');
-}
-
-testDeferredImport() {
- testUnparseTopLevelWithMetadata('import "lib.dart" as a;');
- testUnparseTopLevelWithMetadata('import "lib.dart" deferred as a;');
- testUnparseTopLevelWithMetadata('import "lib.dart" deferred as a show b;');
- testUnparseTopLevelWithMetadata('import "lib.dart" deferred as a hide b;');
-}
-
-testUnparseMemberAndAsMemberOfFoo(String code) {
- testUnparseMember(code);
- testUnparseTopLevelWithMetadata('class Foo{$code}');
-}
-
-testRedirectingFactoryConstructors() {
- testUnparseMemberAndAsMemberOfFoo("factory Foo()=Bar;");
- testUnparseMemberAndAsMemberOfFoo("factory Foo()=Bar.baz;");
- testUnparseMemberAndAsMemberOfFoo("factory Foo()=Bar<T>;");
- testUnparseMemberAndAsMemberOfFoo("factory Foo()=Bar<List<T>,T>;");
- testUnparseMemberAndAsMemberOfFoo("factory Foo()=Bar<T>.baz;");
- testUnparseMemberAndAsMemberOfFoo("factory Foo()=Bar<List<T>,T>.baz;");
- testUnparseMemberAndAsMemberOfFoo("factory Foo()=prefix.Bar;");
- testUnparseMemberAndAsMemberOfFoo("factory Foo()=prefix.Bar.baz;");
- testUnparseMemberAndAsMemberOfFoo("factory Foo()=prefix.Bar<T>;");
- testUnparseMemberAndAsMemberOfFoo("factory Foo()=prefix.Bar<List<T>,T>;");
- testUnparseMemberAndAsMemberOfFoo("factory Foo()=prefix.Bar<T>.baz;");
- testUnparseMemberAndAsMemberOfFoo("factory Foo()=prefix.Bar<List<T>,T>.baz;");
- testUnparseMemberAndAsMemberOfFoo("const factory Foo()=Bar;");
- testUnparseMemberAndAsMemberOfFoo("const factory Foo()=Bar.baz;");
- testUnparseMemberAndAsMemberOfFoo("const factory Foo()=Bar<T>;");
- testUnparseMemberAndAsMemberOfFoo("const factory Foo()=Bar<List<T>,T>;");
- testUnparseMemberAndAsMemberOfFoo("const factory Foo()=Bar<T>.baz;");
- testUnparseMemberAndAsMemberOfFoo("const factory Foo()=Bar<List<T>,T>.baz;");
- testUnparseMemberAndAsMemberOfFoo("const factory Foo()=prefix.Bar;");
- testUnparseMemberAndAsMemberOfFoo("const factory Foo()=prefix.Bar.baz;");
- testUnparseMemberAndAsMemberOfFoo("const factory Foo()=prefix.Bar<T>;");
- testUnparseMemberAndAsMemberOfFoo(
- "const factory Foo()=prefix.Bar<List<T>,T>;");
- testUnparseMemberAndAsMemberOfFoo("const factory Foo()=prefix.Bar<T>.baz;");
- testUnparseMemberAndAsMemberOfFoo(
- "const factory Foo()=prefix.Bar<List<T>,T>.baz;");
- testUnparseMemberAndAsMemberOfFoo("external factory Foo()=Bar;");
- testUnparseMemberAndAsMemberOfFoo("external factory Foo()=Bar.baz;");
- testUnparseMemberAndAsMemberOfFoo("external factory Foo()=Bar<T>;");
- testUnparseMemberAndAsMemberOfFoo("external factory Foo()=Bar<List<T>,T>;");
- testUnparseMemberAndAsMemberOfFoo("external factory Foo()=Bar<T>.baz;");
- testUnparseMemberAndAsMemberOfFoo(
- "external factory Foo()=Bar<List<T>,T>.baz;");
- testUnparseMemberAndAsMemberOfFoo("external factory Foo()=prefix.Bar;");
- testUnparseMemberAndAsMemberOfFoo("external factory Foo()=prefix.Bar.baz;");
- testUnparseMemberAndAsMemberOfFoo("external factory Foo()=prefix.Bar<T>;");
- testUnparseMemberAndAsMemberOfFoo(
- "external factory Foo()=prefix.Bar<List<T>,T>;");
- testUnparseMemberAndAsMemberOfFoo(
- "external factory Foo()=prefix.Bar<T>.baz;");
- testUnparseMemberAndAsMemberOfFoo(
- "external factory Foo()=prefix.Bar<List<T>,T>.baz;");
- testUnparseMemberAndAsMemberOfFoo("external const factory Foo()=Bar;");
- testUnparseMemberAndAsMemberOfFoo("external const factory Foo()=Bar.baz;");
- testUnparseMemberAndAsMemberOfFoo("external const factory Foo()=Bar<T>;");
- testUnparseMemberAndAsMemberOfFoo(
- "external const factory Foo()=Bar<List<T>,T>;");
- testUnparseMemberAndAsMemberOfFoo("external const factory Foo()=Bar<T>.baz;");
- testUnparseMemberAndAsMemberOfFoo(
- "external const factory Foo()=Bar<List<T>,T>.baz;");
- testUnparseMemberAndAsMemberOfFoo("external const factory Foo()=prefix.Bar;");
- testUnparseMemberAndAsMemberOfFoo(
- "external const factory Foo()=prefix.Bar.baz;");
- testUnparseMemberAndAsMemberOfFoo(
- "external const factory Foo()=prefix.Bar<T>;");
- testUnparseMemberAndAsMemberOfFoo(
- "external const factory Foo()=prefix.Bar<List<T>,T>;");
- testUnparseMemberAndAsMemberOfFoo(
- "external const factory Foo()=prefix.Bar<T>.baz;");
- testUnparseMemberAndAsMemberOfFoo(
- "external const factory Foo()=prefix.Bar<List<T>,T>.baz;");
-}
-
-testClassDeclarations() {
- testUnparseTopLevelWithMetadata('class Foo{}');
- testUnparseTopLevelWithMetadata('abstract class Foo{}');
- testUnparseTopLevelWithMetadata('class Fisk{operator-(x){}}');
-}
-
-testMixinApplications() {
- testUnparseTopLevelWithMetadata('class C = S with M;');
- testUnparseTopLevelWithMetadata('class C = S with M1,M2;');
- testUnparseTopLevelWithMetadata('class C = S with M1,M2,M3;');
-
- testUnparseTopLevelWithMetadata('class C<A> = S with M;');
- testUnparseTopLevelWithMetadata('class C<A,B> = S with M;');
-
- testUnparseTopLevelWithMetadata('class C = S<A> with M;');
- testUnparseTopLevelWithMetadata('class C = S<A,B> with M;');
-
- testUnparseTopLevelWithMetadata('class C = S with M<A>;');
- testUnparseTopLevelWithMetadata('class C = S with M<A,B>;');
- testUnparseTopLevelWithMetadata('class C = S with M1<A>,M2;');
- testUnparseTopLevelWithMetadata('class C = S with M1,M2<A,B>;');
-
- testUnparseTopLevelWithMetadata('abstract class C = S with M;');
- testUnparseTopLevelWithMetadata('abstract class C<A> = S<A> with M<A>;');
-}
-
-testUnparseParameters(List<String> variableDeclarations) {
- var sb = new StringBuffer();
- sb.write('Constructor(');
- int index = 0;
- for (String variableDeclaration in variableDeclarations) {
- if (index != 0) {
- sb.write(', ');
- }
- sb.write(variableDeclaration);
- index++;
- }
- sb.write(');');
-
- FunctionExpression node = parseMember(sb.toString());
- index = 0;
- for (VariableDefinitions parameter in node.parameters.nodes) {
- Expect.equals(variableDeclarations[index], unparse(parameter));
- index++;
- }
-}
-
-testParameters() {
- testUnparseParameters(["foo", "bar=0", "int baz", "int boz=0"]);
- testUnparseParameters(
- ["this.foo", "this.bar=0", "int this.baz", "int this.boz=0"]);
- testUnparseParameters(
- ["foo()", "void bar()", "int baz(a)", "int boz(int a,int b)=null"]);
- testUnparseParameters([
- "this.foo()",
- //"void this.bar()", // Commented out due to Issue 7852
- //"int this.baz(a)", // Commented out due to Issue 7852
- //"int this.boz(int a,int b)=null" // Commented out due to Issue 7852
- ]);
- testUnparseParameters(
- ["@a foo", "@b @c bar=0", "@D(0) int baz", "@E([f],{g:h}) int boz=0"]);
-}
-
-testSymbolLiterals() {
- testUnparse("#+;");
- testUnparse("#-;");
- testUnparse("#*;");
- testUnparse("#/;");
- testUnparse("#~/;");
- testUnparse("#%;");
- testUnparse("#<;");
- testUnparse("#<=;");
- testUnparse("#>;");
- testUnparse("#>=;");
- testUnparse("#==;");
- testUnparse("#&;");
- testUnparse("#|;");
- testUnparse("#^;");
-
- testUnparse("#a;");
- testUnparse("#a.b;");
- testUnparse("#a.b.c;");
- testUnparse("#aa.bb.cc.dd;");
-}
-
-main() {
- testSignedConstants();
- testGenericTypes();
- testForLoop();
- testEmptyList();
- testClosure();
- testIndexedOperatorDecl();
- testNativeMethods();
- testPrefixIncrements();
- testConstModifier();
- testSimpleObjectInstantiation();
- testLibraryName();
- testImport();
- testExport();
- testConditionalImport();
- testConditionalExport();
- testPart();
- testPartOf();
- testCombinators();
- testDeferredImport();
- testRedirectingFactoryConstructors();
- testClassDeclarations();
- testMixinApplications();
- testParameters();
- testSymbolLiterals();
-}
diff --git a/tests/compiler/dart2js/old_frontend/warnings_checker.dart b/tests/compiler/dart2js/old_frontend/warnings_checker.dart
deleted file mode 100644
index 2bb7c4e..0000000
--- a/tests/compiler/dart2js/old_frontend/warnings_checker.dart
+++ /dev/null
@@ -1,85 +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 dart2js produces the expected static type warnings to ensures that
-// the analyzer and dart2js agrees on the tests.
-
-import 'dart:async';
-import 'dart:io';
-import 'package:expect/expect.dart';
-import 'package:async_helper/async_helper.dart';
-import '../memory_compiler.dart';
-import 'package:compiler/src/commandline_options.dart';
-import 'package:compiler/src/filenames.dart';
-import 'package:compiler/src/io/source_file.dart';
-import 'package:compiler/src/source_file_provider.dart';
-import 'package:compiler/src/util/uri_extras.dart';
-import 'dart:convert';
-
-final _multiTestRegExpSeperator = new RegExp(r"//[#/]");
-
-void checkWarnings(Map<String, dynamic> tests, [List<String> arguments]) {
- bool isWindows = Platform.isWindows;
- bool warningsMismatch = false;
- bool verbose = arguments != null && arguments.contains('-v');
- asyncTest(() => Future.forEach(tests.keys, (String test) async {
- Uri uri = Uri.base.resolve('tests/$test');
- String source = utf8.decode(readAll(uriPathToNative(uri.path)));
- SourceFile file = new StringSourceFile(
- uri, relativize(currentDirectory, uri, isWindows), source);
- Map<int, String> expectedWarnings = {};
- int lineNo = 0;
- for (String line in source.split('\n')) {
- if (line.contains(_multiTestRegExpSeperator) &&
- (line.contains('static type warning') ||
- line.contains('static warning'))) {
- expectedWarnings[lineNo] = line;
- }
- lineNo++;
- }
- Set<int> unseenWarnings = new Set<int>.from(expectedWarnings.keys);
- DiagnosticCollector collector = new DiagnosticCollector();
- await runCompiler(
- entryPoint: uri,
- diagnosticHandler: collector,
- options: [Flags.analyzeOnly, Flags.useOldFrontend],
- showDiagnostics: verbose);
- Map<String, List<int>> statusMap = tests[test];
- // Line numbers with known unexpected warnings.
- List<int> unexpectedStatus = [];
- if (statusMap != null && statusMap.containsKey('unexpected')) {
- unexpectedStatus = statusMap['unexpected'];
- }
- // Line numbers with known missing warnings.
- List<int> missingStatus = [];
- if (statusMap != null && statusMap.containsKey('missing')) {
- missingStatus = statusMap['missing'];
- }
- for (CollectedMessage message in collector.warnings) {
- Expect.equals(uri, message.uri);
- int lineNo = file.getLocation(message.begin).line - 1;
- if (expectedWarnings.containsKey(lineNo)) {
- unseenWarnings.remove(lineNo);
- } else if (!unexpectedStatus.contains(lineNo + 1)) {
- warningsMismatch = true;
- print(file.getLocationMessage(
- 'Unexpected warning: ${message.message}',
- message.begin,
- message.end));
- }
- }
- if (!unseenWarnings.isEmpty) {
- for (int lineNo in unseenWarnings) {
- if (!missingStatus.contains(lineNo + 1)) {
- warningsMismatch = true;
- String line = expectedWarnings[lineNo];
- print('$uri [${lineNo+1}]: Missing static type warning.');
- print(line);
- }
- }
- }
- }).then((_) {
- Expect.isFalse(warningsMismatch);
- }));
-}
diff --git a/tests/compiler/dart2js/old_frontend/zero_termination_test.dart b/tests/compiler/dart2js/old_frontend/zero_termination_test.dart
deleted file mode 100644
index 0165af1..0000000
--- a/tests/compiler/dart2js/old_frontend/zero_termination_test.dart
+++ /dev/null
@@ -1,118 +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.
-
-// A regression test for issue 22667.
-//
-// Makes sure that we don't print a '\0' character for files that are not
-// properly new-line terminated.
-library zero_termination_test;
-
-import 'dart:async';
-import 'dart:convert';
-import 'dart:io';
-import 'package:async_helper/async_helper.dart';
-import 'package:compiler/src/commandline_options.dart';
-import 'package:expect/expect.dart';
-import 'package:path/path.dart' as path;
-
-import '../end_to_end/launch_helper.dart' show launchDart2Js;
-
-Uri pathOfData = Platform.script;
-Directory tempDir;
-String outFilePath;
-
-_sendNotFound(HttpResponse response) {
- response.statusCode = HttpStatus.NOT_FOUND;
- response.close();
-}
-
-Future handleRequest(HttpRequest request) {
- final String path = request.uri.path.substring(1);
- final Uri requestPath = pathOfData.resolve(path);
- final File file = new File(requestPath.toFilePath());
- return file.exists().then((bool found) {
- if (found) {
- file.openRead().pipe(request.response).catchError((e) {
- _sendNotFound(request.response);
- });
- } else {
- _sendNotFound(request.response);
- }
- });
-}
-
-void cleanup() {
- File outFile = new File(outFilePath);
- if (outFile.existsSync()) {
- outFile.deleteSync();
- }
-}
-
-void check(ProcessResult result) {
- Expect.notEquals(0, result.exitCode);
- List<int> stdout = result.stdout;
- String stdoutString = utf8.decode(stdout);
- Expect.isTrue(stdoutString.contains("Error"), "stdout:\n$stdoutString");
- // Make sure the "499" from the last line is in the output.
- Expect.isTrue(stdoutString.contains("499"), "stdout:\n$stdoutString");
-
- // Make sure that the output does not contain any 0 character.
- Expect.isFalse(stdout.contains(0));
-}
-
-Future testFile() async {
- String inFilePath =
- pathOfData.resolve('data/one_line_dart_program.dart').path;
- List<String> args = [
- inFilePath,
- "--out=" + outFilePath,
- Flags.useOldFrontend
- ];
- await cleanup();
- check(await launchDart2Js(args, noStdoutEncoding: true));
- await cleanup();
-}
-
-Future serverRunning(HttpServer server) async {
- int port = server.port;
- String inFilePath = "http://127.0.0.1:$port/data/one_line_dart_program.dart";
- List<String> args = [
- inFilePath,
- "--out=" + outFilePath,
- Flags.useOldFrontend
- ];
-
- server.listen(handleRequest);
- try {
- await cleanup();
- check(await launchDart2Js(args, noStdoutEncoding: true));
- } finally {
- await server.close();
- await cleanup();
- }
-}
-
-Future testHttp() {
- return HttpServer
- .bind(InternetAddress.LOOPBACK_IP_V4, 0)
- .then((HttpServer server) => serverRunning(server));
-}
-
-runTests() async {
- tempDir = Directory.systemTemp.createTempSync('directory_test');
- outFilePath = path.join(tempDir.path, "out.js");
-
- try {
- await testFile();
- await testHttp();
- } finally {
- await tempDir.delete(recursive: true);
- }
-}
-
-main() {
- asyncTest(() async {
- await runTests();
- });
-}
diff --git a/tests/compiler/dart2js/output_type_test.dart b/tests/compiler/dart2js/output_type_test.dart
index ae79f4e..4217edc 100644
--- a/tests/compiler/dart2js/output_type_test.dart
+++ b/tests/compiler/dart2js/output_type_test.dart
@@ -37,12 +37,9 @@
CompileFunc oldCompileFunc;
Future<Null> test(List<String> arguments, List<String> expectedOutput,
- {List<String> groupOutputs: const <String>[], bool useKernel}) async {
+ {List<String> groupOutputs: const <String>[]}) async {
List<String> options = new List<String>.from(arguments)
..add("--library-root=${Uri.base.resolve('sdk/')}");
- if (!useKernel) {
- options.add(Flags.useOldFrontend);
- }
print('--------------------------------------------------------------------');
print('dart2js ${options.join(' ')}');
TestRandomAccessFileOutputProvider outputProvider;
@@ -75,7 +72,7 @@
enableWriteString = false;
oldCompileFunc = compileFunc;
- runTests({bool useKernel}) async {
+ runTests() async {
PRINT_GRAPH = true;
TRACE_FILTER_PATTERN_FOR_TEST = 'x';
await test([
@@ -91,7 +88,7 @@
'dart.cfg', // From TRACE_FILTER_PATTERN_FOR_TEST
], groupOutputs: [
'.dot', // From PRINT_GRAPH
- ], useKernel: useKernel);
+ ]);
PRINT_GRAPH = false;
TRACE_FILTER_PATTERN_FOR_TEST = null;
@@ -102,26 +99,17 @@
'out.js_1.part.js',
'out.js_1.part.js.map',
];
- if (!useKernel) {
- // Option --use-multi-source-info is only supported for the old frontend.
- expectedOutput.add('out.js.map.v2');
- expectedOutput.add('out.js_1.part.js.map.v2');
- additionOptionals.add(Flags.useMultiSourceInfo);
- }
await test(
[
'tests/compiler/dart2js/deferred/data/deferred_helper.dart',
Flags.useContentSecurityPolicy,
]..addAll(additionOptionals),
- expectedOutput,
- useKernel: useKernel);
+ expectedOutput);
}
asyncTest(() async {
- print('--test from ast---------------------------------------------------');
- await runTests(useKernel: false);
print('--test from kernel------------------------------------------------');
- await runTests(useKernel: true);
+ await runTests();
});
}
diff --git a/tests/compiler/dart2js/path with spaces/file with spaces.dart b/tests/compiler/dart2js/path with spaces/file with spaces.dart
deleted file mode 100644
index b0cc204..0000000
--- a/tests/compiler/dart2js/path with spaces/file with spaces.dart
+++ /dev/null
@@ -1,9 +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 'library space/lib with spaces.dart';
-
-main() {
- if (foo() != 499) throw "bad value";
-}
diff --git a/tests/compiler/dart2js/path with spaces/library space/lib with spaces.dart b/tests/compiler/dart2js/path with spaces/library space/lib with spaces.dart
deleted file mode 100644
index 16da6e3..0000000
--- a/tests/compiler/dart2js/path with spaces/library space/lib with spaces.dart
+++ /dev/null
@@ -1,9 +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 spaces;
-
-part "part space/part space.dart";
-
-foo() => bar();
diff --git a/tests/compiler/dart2js/path with spaces/library space/part space/part space.dart b/tests/compiler/dart2js/path with spaces/library space/part space/part space.dart
deleted file mode 100644
index 58aff0f..0000000
--- a/tests/compiler/dart2js/path with spaces/library space/part space/part space.dart
+++ /dev/null
@@ -1,7 +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.
-
-part of spaces;
-
-bar() => 499;
diff --git a/tests/compiler/dart2js/quarantined/http_launch_data/http_launch_main.dart b/tests/compiler/dart2js/quarantined/http_launch_data/http_launch_main.dart
deleted file mode 100644
index b2359a9..0000000
--- a/tests/compiler/dart2js/quarantined/http_launch_data/http_launch_main.dart
+++ /dev/null
@@ -1,9 +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 'lib1.dart';
-
-main() {
- print(foo());
-}
diff --git a/tests/compiler/dart2js/quarantined/http_launch_data/http_launch_main_package.dart b/tests/compiler/dart2js/quarantined/http_launch_data/http_launch_main_package.dart
deleted file mode 100644
index 03ffa18..0000000
--- a/tests/compiler/dart2js/quarantined/http_launch_data/http_launch_main_package.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.
-
-// ignore: URI_DOES_NOT_EXIST
-import 'package:simple/simple.dart';
-
-main() {
- // ignore: UNDEFINED_FUNCTION
- print(foo());
-}
diff --git a/tests/compiler/dart2js/quarantined/http_launch_data/lib1.dart b/tests/compiler/dart2js/quarantined/http_launch_data/lib1.dart
deleted file mode 100644
index 7e4ab7e..0000000
--- a/tests/compiler/dart2js/quarantined/http_launch_data/lib1.dart
+++ /dev/null
@@ -1,5 +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.
-
-foo() => "hello http tester";
diff --git a/tests/compiler/dart2js/quarantined/http_launch_data/packages/simple/simple.dart b/tests/compiler/dart2js/quarantined/http_launch_data/packages/simple/simple.dart
deleted file mode 100644
index 7e4ab7e..0000000
--- a/tests/compiler/dart2js/quarantined/http_launch_data/packages/simple/simple.dart
+++ /dev/null
@@ -1,5 +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.
-
-foo() => "hello http tester";
diff --git a/tests/compiler/dart2js/quarantined/http_launch_data/pkcert/README b/tests/compiler/dart2js/quarantined/http_launch_data/pkcert/README
deleted file mode 100644
index fe764a9..0000000
--- a/tests/compiler/dart2js/quarantined/http_launch_data/pkcert/README
+++ /dev/null
@@ -1,16 +0,0 @@
-This is a certificate database used by Dart for testing purposes.
-
-It is created as a certificate database by NSS (Network Security Services),
-a library from Mozilla, using the certutil tool. It uses a cert9.db file,
-rather than a cert8.db file, so the database directory must be specified with
-"sql:" in front of the directory path, or the environment variable
-NSS_DEFAULT_DB_TYPE must be set to "sql".
-
-The password for the key database is "dartdart".
-
-The database contains a root certificate from Equifax, used to verify the
-client https connection to www.google.dk. It contains a self-signed
-certificate for a local certificate authority myauthority_cert, and a
-server certificate for localhost called localhost_cert, signed by
-myauthority_cert. It contains the key for localhost_cert, but
-not the key for myauthority_cert.
diff --git a/tests/compiler/dart2js/quarantined/http_launch_data/pkcert/cert9.db b/tests/compiler/dart2js/quarantined/http_launch_data/pkcert/cert9.db
deleted file mode 100644
index 497fca6..0000000
--- a/tests/compiler/dart2js/quarantined/http_launch_data/pkcert/cert9.db
+++ /dev/null
Binary files differ
diff --git a/tests/compiler/dart2js/quarantined/http_launch_data/pkcert/key4.db b/tests/compiler/dart2js/quarantined/http_launch_data/pkcert/key4.db
deleted file mode 100644
index fc06432..0000000
--- a/tests/compiler/dart2js/quarantined/http_launch_data/pkcert/key4.db
+++ /dev/null
Binary files differ
diff --git a/tests/compiler/dart2js/quarantined/http_test.dart b/tests/compiler/dart2js/quarantined/http_test.dart
deleted file mode 100644
index 309fc5f..0000000
--- a/tests/compiler/dart2js/quarantined/http_test.dart
+++ /dev/null
@@ -1,186 +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:
-// *) Compiling a script fetched over HTTP.
-// *) Importing a library fetched over HTTP.
-// *) Automatically resolving package_root when script is fetched over HTTP.
-
-library http_launch_test;
-
-import 'dart:async';
-import 'dart:io';
-import 'package:async_helper/async_helper.dart';
-import 'package:expect/expect.dart';
-import 'package:path/path.dart' as path;
-
-import '../end_to_end/launch_helper.dart' show launchDart2Js;
-
-Uri pathOfData = Platform.script.resolve('http_launch_data/');
-Directory tempDir;
-String outFilePath;
-
-_sendNotFound(HttpResponse response) {
- response.statusCode = HttpStatus.NOT_FOUND;
- response.close();
-}
-
-Future handleRequest(HttpRequest request) {
- final String path = request.uri.path.substring(1);
- final Uri requestPath = pathOfData.resolve(path);
- final File file = new File(requestPath.toFilePath());
- return file.exists().then((bool found) {
- if (found) {
- file.openRead().pipe(request.response).catchError((e) {
- _sendNotFound(request.response);
- });
- } else {
- _sendNotFound(request.response);
- }
- });
-}
-
-void check(ProcessResult result) {
- Expect.equals(0, result.exitCode);
- File outFile = new File(outFilePath);
- Expect.isTrue(outFile.existsSync());
- Expect.isTrue(outFile.readAsStringSync().contains("hello http tester"));
-}
-
-void checkNotFound(ProcessResult result, String filename) {
- Expect.notEquals(0, result.exitCode);
- Expect.isTrue(result.stdout.contains("404"));
- Expect.isTrue(result.stdout.contains(filename));
-}
-
-cleanup() {
- File outFile = new File(outFilePath);
- if (outFile.existsSync()) {
- outFile.deleteSync();
- }
-}
-
-Future testNonHttp() {
- String inFilePath = pathOfData.resolve('http_launch_main.dart').toFilePath();
- List<String> args = [inFilePath, "--out=" + outFilePath];
- return launchDart2Js(args).then(check).then((_) {
- cleanup();
- });
-}
-
-Future testHttpMain(String serverUrl) {
- String inFilePath = '$serverUrl/http_launch_main.dart';
- List<String> args = [inFilePath, "--out=" + outFilePath];
- return launchDart2Js(args).then(check).then((_) {
- cleanup();
- });
-}
-
-Future testHttpLib(String serverUrl) {
- File file = new File(path.join(tempDir.path, "in.dart"));
- file.writeAsStringSync("""
- import '$serverUrl/lib1.dart';
- main() { print(foo()); }
- """);
- String inFilePath = file.path;
- List<String> args = [inFilePath, "--out=" + outFilePath];
- return launchDart2Js(args)
- .then(check)
- .whenComplete(file.deleteSync)
- .then((_) {
- cleanup();
- });
-}
-
-Future testHttpPackage(String serverUrl) {
- String inFilePath =
- pathOfData.resolve('http_launch_main_package.dart').toFilePath();
- String packageRoot = '$serverUrl/packages/';
- List<String> args = [
- inFilePath,
- "--out=" + outFilePath,
- "--package-root=" + packageRoot
- ];
- return launchDart2Js(args).then(check).then((_) {
- cleanup();
- });
-}
-
-Future testBadHttp(String serverUrl) {
- File file = new File(path.join(tempDir.path, "in_bad.dart"));
- file.writeAsStringSync("""
- import '$serverUrl/not_existing.dart';
- main() { print(foo()); }
- """);
- String inFilePath = file.path;
- List<String> args = [inFilePath, "--out=" + outFilePath];
- return launchDart2Js(args)
- .then((pr) => checkNotFound(pr, "not_existing.dart"))
- .whenComplete(file.deleteSync)
- .then((_) {
- cleanup();
- });
-}
-
-Future testBadHttp2(String serverUrl) {
- String inFilePath = '$serverUrl/not_found.dart';
- List<String> args = [inFilePath, "--out=" + outFilePath];
- return launchDart2Js(args)
- .then((processResult) => checkNotFound(processResult, "not_found.dart"))
- .then((_) {
- cleanup();
- });
-}
-
-serverRunning(HttpServer server, String scheme) {
- tempDir = Directory.systemTemp.createTempSync('directory_test');
- outFilePath = path.join(tempDir.path, "out.js");
- int port = server.port;
- String serverUrl = "$scheme://127.0.0.1:$port";
-
- asyncStart();
- server.listen(handleRequest);
- return new Future.value()
- .then((_) => cleanup()) // Make sure we start fresh.
- .then((_) => testNonHttp())
- .then((_) => testHttpMain(serverUrl))
- .then((_) => testHttpLib(serverUrl))
- .then((_) => testHttpPackage(serverUrl))
- .then((_) => testBadHttp(serverUrl))
- .then((_) => testBadHttp2(serverUrl))
- .whenComplete(() => tempDir.delete(recursive: true))
- .whenComplete(server.close)
- .then((_) => asyncEnd());
-}
-
-Future testHttp() {
- return HttpServer
- .bind(InternetAddress.LOOPBACK_IP_V4, 0)
- .then((HttpServer server) => serverRunning(server, "http"));
-}
-
-void initializeSSL() {
- Uri pathOfPkcert = pathOfData.resolve('pkcert');
- String testPkcertDatabase = pathOfPkcert.toFilePath();
- // Issue 29926.
- // ignore: UNDEFINED_METHOD
- SecureSocket.initialize(database: testPkcertDatabase, password: 'dartdart');
-}
-
-Future testHttps() {
- initializeSSL();
- return HttpServer
- // Issue 29926.
- // ignore: NOT_ENOUGH_REQUIRED_ARGUMENTS
- .bindSecure(InternetAddress.LOOPBACK_IP_V4, 0,
- // Issue 29926.
- // ignore: UNDEFINED_NAMED_PARAMETER
- certificateName: 'localhost_cert')
- .then((HttpServer server) => serverRunning(server, "https"));
-}
-
-main() {
- asyncStart();
- testHttp().then((_) => testHttps).whenComplete(asyncEnd);
-}
diff --git a/tests/compiler/dart2js/receiver_type_test.dart b/tests/compiler/dart2js/receiver_type_test.dart
index 711633f..da0a7a2 100644
--- a/tests/compiler/dart2js/receiver_type_test.dart
+++ b/tests/compiler/dart2js/receiver_type_test.dart
@@ -13,14 +13,12 @@
main() {
asyncTest(() async {
- print('--test from ast---------------------------------------------------');
- await runTest(CompileMode.memory);
print('--test from kernel------------------------------------------------');
- await runTest(CompileMode.kernel);
+ await runTest();
});
}
-Future runTest(CompileMode mode) async {
+Future runTest() async {
var env = await TypeEnvironment.create("""
class A {
call() {}
@@ -38,7 +36,7 @@
localFunction() {}
() {};
}
- """, compileMode: mode, testBackendWorld: true);
+ """, testBackendWorld: true);
Map<String, String> expectedMap = const {
'A': '[exact=A]',
diff --git a/tests/compiler/dart2js/rti/backend_type_helper_test.dart b/tests/compiler/dart2js/rti/backend_type_helper_test.dart
index 9c72330..2549436 100644
--- a/tests/compiler/dart2js/rti/backend_type_helper_test.dart
+++ b/tests/compiler/dart2js/rti/backend_type_helper_test.dart
@@ -5,7 +5,6 @@
import 'dart:io';
import 'package:async_helper/async_helper.dart';
-import 'package:compiler/src/commandline_options.dart';
import 'package:compiler/src/compiler.dart';
import 'package:compiler/src/elements/entities.dart';
import 'package:compiler/src/js_emitter/program_builder/program_builder.dart';
@@ -15,10 +14,9 @@
import '../memory_compiler.dart';
main() {
- runTest({bool useKernel}) async {
+ runTest() async {
CompilationResult result = await runCompiler(
- entryPoint: Platform.script.resolve('data/subtype_named_args.dart'),
- options: useKernel ? [] : [Flags.useOldFrontend]);
+ entryPoint: Platform.script.resolve('data/subtype_named_args.dart'));
Expect.isTrue(result.isSuccess);
Compiler compiler = result.compiler;
ClosedWorld closedWorld = compiler.backendClosedWorldForTesting;
@@ -35,9 +33,7 @@
}
asyncTest(() async {
- print('--test from ast---------------------------------------------------');
- await runTest(useKernel: false);
print('--test from kernel------------------------------------------------');
- await runTest(useKernel: true);
+ await runTest();
});
}
diff --git a/tests/compiler/dart2js/rti/disable_rti_test.dart b/tests/compiler/dart2js/rti/disable_rti_test.dart
index 67b3e3d..c420f57 100644
--- a/tests/compiler/dart2js/rti/disable_rti_test.dart
+++ b/tests/compiler/dart2js/rti/disable_rti_test.dart
@@ -56,11 +56,10 @@
};
main() {
- runTest({bool useKernel}) async {
+ runTest() async {
CompilationResult result = await runCompiler(
memorySourceFiles: {'main.dart': code},
- options: [Flags.disableRtiOptimization, Flags.disableInlining]
- ..addAll(useKernel ? [] : [Flags.useOldFrontend]));
+ options: [Flags.disableRtiOptimization, Flags.disableInlining]);
Expect.isTrue(result.isSuccess);
Compiler compiler = result.compiler;
ClosedWorld closedWorld = compiler.backendClosedWorldForTesting;
@@ -100,9 +99,7 @@
}
asyncTest(() async {
- print('--test from ast---------------------------------------------------');
- await runTest(useKernel: false);
print('--test from kernel------------------------------------------------');
- await runTest(useKernel: true);
+ await runTest();
});
}
diff --git a/tests/compiler/dart2js/rti/type_representation_test.dart b/tests/compiler/dart2js/rti/type_representation_test.dart
index 80647d9..167ab47 100644
--- a/tests/compiler/dart2js/rti/type_representation_test.dart
+++ b/tests/compiler/dart2js/rti/type_representation_test.dart
@@ -24,17 +24,15 @@
void main() {
asyncTest(() async {
- print('--test from ast---------------------------------------------------');
- await testAll(useKernel: false);
print('--test from kernel------------------------------------------------');
- await testAll(useKernel: true);
+ await testAll();
print('--test from kernel (strong)---------------------------------------');
- await testAll(useKernel: true, strongMode: true);
+ await testAll(strongMode: true);
});
}
-testAll({bool useKernel, bool strongMode: false}) async {
- await testTypeRepresentations(useKernel: useKernel, strongMode: strongMode);
+testAll({bool strongMode: false}) async {
+ await testTypeRepresentations(strongMode: strongMode);
}
List<FunctionTypeData> signatures = const <FunctionTypeData>[
@@ -55,7 +53,7 @@
"<T extends num, S>(FutureOr<T> a, S b, List<void> c)"),
];
-testTypeRepresentations({bool useKernel, bool strongMode}) async {
+testTypeRepresentations({bool strongMode}) async {
String source = '''
import 'dart:async';
@@ -69,9 +67,7 @@
''';
CompilationResult result = await runCompiler(
memorySourceFiles: {'main.dart': source},
- options: useKernel
- ? (strongMode ? [Flags.strongMode] : [])
- : [Flags.useOldFrontend]);
+ options: strongMode ? [Flags.strongMode] : []);
Expect.isTrue(result.isSuccess);
Compiler compiler = result.compiler;
JavaScriptBackend backend = compiler.backend;
@@ -126,7 +122,6 @@
String bounds = backend.namer.functionTypeGenericBoundsTag;
String futureOr = backend.namer.futureOrTag;
String futureOrType = backend.namer.futureOrTypeTag;
- String typedefTag = backend.namer.typedefTag;
ClassEntity List_ = findClass(closedWorld, 'List');
TypeVariableType List_E =
@@ -166,12 +161,11 @@
String String_rep = getJsName(String_.element);
String getTypedefTag(DartType type) {
- if (useKernel) {
- // TODO(johnniwinther): Should/can we preserve typedef names from kernel?
- return '';
- }
- TypedefType typedef = type;
- return ', $typedefTag: ${getJsName(typedef.element)}';
+ // TODO(johnniwinther): Should/can we preserve typedef names from kernel?
+ //String typedefTag = backend.namer.typedefTag;
+ //TypedefType typedef = type;
+ //return ', $typedefTag: ${getJsName(typedef.element)}';
+ return '';
}
String Typedef1_tag = getTypedefTag(Typedef1_);
diff --git a/tests/compiler/dart2js/sourcemaps/multi_source_info_test.dart b/tests/compiler/dart2js/sourcemaps/multi_source_info_test.dart
deleted file mode 100644
index a1c654c..0000000
--- a/tests/compiler/dart2js/sourcemaps/multi_source_info_test.dart
+++ /dev/null
@@ -1,47 +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.
-
-import 'dart:async';
-import 'package:async_helper/async_helper.dart';
-import 'package:compiler/compiler_new.dart';
-import 'package:compiler/src/commandline_options.dart';
-import 'package:expect/expect.dart';
-import '../memory_compiler.dart';
-
-main() {
- asyncTest(() async {
- String oldMap = (await compile([Flags.useOldFrontend]))
- .getOutput('', OutputType.sourceMap);
- String newMap =
- (await compile([Flags.useOldFrontend, Flags.useNewSourceInfo]))
- .getOutput('', OutputType.sourceMap);
- OutputCollector multiCollector1 =
- await compile([Flags.useOldFrontend, Flags.useMultiSourceInfo]);
- String multiMap1a = multiCollector1.getOutput('', OutputType.sourceMap);
- String multiMap1b =
- multiCollector1.getOutput('out.js', OutputType.sourceMap);
- Expect.equals(oldMap, multiMap1a);
- Expect.equals(newMap, multiMap1b);
- OutputCollector multiCollector2 = await compile([
- Flags.useOldFrontend,
- Flags.useMultiSourceInfo,
- Flags.useNewSourceInfo
- ]);
- String multiMap2a = multiCollector2.getOutput('', OutputType.sourceMap);
- String multiMap2b =
- multiCollector2.getOutput('out.js', OutputType.sourceMap);
- Expect.equals(newMap, multiMap2a);
- Expect.equals(oldMap, multiMap2b);
- });
-}
-
-Future<OutputCollector> compile(List<String> options) async {
- OutputCollector collector = new OutputCollector();
- await runCompiler(
- entryPoint: Uri.parse('memory:main.dart'),
- memorySourceFiles: const {'main.dart': 'main() {}'},
- outputProvider: collector,
- options: options);
- return collector;
-}
diff --git a/tests/compiler/dart2js/sourcemaps/source_mapping2_test.dart b/tests/compiler/dart2js/sourcemaps/source_mapping2_test.dart
deleted file mode 100644
index bd74cbe..0000000
--- a/tests/compiler/dart2js/sourcemaps/source_mapping2_test.dart
+++ /dev/null
@@ -1,124 +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:async';
-import 'package:expect/expect.dart';
-import 'package:async_helper/async_helper.dart';
-import 'package:compiler/src/io/code_output.dart';
-import 'package:compiler/src/io/source_file.dart';
-import 'package:compiler/src/io/source_information.dart';
-import 'package:compiler/src/js_backend/js_backend.dart';
-import 'package:compiler/src/js_emitter/full_emitter/emitter.dart' as full
- show Emitter;
-
-import '../old_frontend/mock_compiler.dart';
-
-Future<CodeOutput> compileAll(SourceFile sourceFile) {
- MockCompiler compiler = new MockCompiler.internal();
- Uri uri = new Uri(path: sourceFile.filename);
- compiler.sourceFiles[uri.toString()] = sourceFile;
- JavaScriptBackend backend = compiler.backend;
- return compiler.run(uri).then((_) {
- // TODO(floitsch): the outputBuffers are only accessible in the full
- // emitter.
- full.Emitter fullEmitter = backend.emitter.emitter;
- return fullEmitter
- .outputBuffers[compiler.backend.outputUnitData.mainOutputUnit];
- });
-}
-
-void testSourceMapLocations(String codeWithMarkers) {
- List<int> expectedLocations = new List<int>();
- for (int i = 0; i < codeWithMarkers.length; ++i) {
- if (codeWithMarkers[i] == '@') {
- expectedLocations.add(i - expectedLocations.length);
- }
- }
- String code = codeWithMarkers.replaceAll('@', '');
-
- SourceFile sourceFile = new StringSourceFile.fromName('<test script>', code);
- asyncTest(() => compileAll(sourceFile).then((CodeOutput output) {
- Set<int> locations = new Set<int>();
- SourceLocations sourceLocations = output.sourceLocations.single;
- sourceLocations
- .forEachSourceLocation((int offset, SourceLocation sourcePosition) {
- if (sourcePosition != null &&
- sourcePosition.sourceUri == sourceFile.uri) {
- locations.add(sourcePosition.offset);
- }
- });
-
- for (int i = 0; i < expectedLocations.length; ++i) {
- int expectedLocation = expectedLocations[i];
- if (!locations.contains(expectedLocation)) {
- int originalLocation = expectedLocation + i;
- SourceFile sourceFileWithMarkers =
- new StringSourceFile.fromName('<test script>', codeWithMarkers);
- String message = sourceFileWithMarkers.getLocationMessage(
- 'Missing location', originalLocation, originalLocation + 1);
- Expect.fail(message);
- }
- }
- }));
-}
-
-String FUNCTIONS_TEST = '''
-@void main() { print(test(15)); @}
-// The 'if' has been added to avoid inlining of 'test'.
-@int test(int x) { if (x != null) return x; else return null; @}''';
-
-String RETURN_TEST = 'void main() { print(((x) { @return x; })(0)); }';
-
-String NOT_TEST = 'void main() { ((x) { if (@!x) print(x); })(1==2); }';
-
-String UNARY_TEST = 'void main() { ((x, y) { print(@-x + @~y); })(1,2); }';
-
-String BINARY_TEST =
- 'void main() { ((x, y) { if (x @!= y) print(x @* y); })(1,2); }';
-
-String SEND_TEST = '''
-void main() {
- @staticSend(0);
- NewSend o = @new NewSend();
- @o.dynamicSend(0);
- var closureSend = (x) { print(x); };
- @closureSend(0);
-}
-// The 'if' has been added to avoid inlining of 'staticSend'.
-void staticSend(x) { if (x == null) return; print(x); }
-class NewSend { void dynamicSend(x) { print(x); } }
-''';
-
-String SEND_SET_TEST = '''
-String global;
-void main() { @global = ''; print(new A().foo()); }
-class A { int x; foo() { @x = 3; } }''';
-
-String LOOP_TEST = '''
-void main() {
- @for (int i = 0; i < 100; ++i) { print(test(13)); @}
-}
-int test(int x) {
- int result = 1; @while (result < x) { result <<= 1; @} return result;
-}''';
-
-String INTERCEPTOR_TEST = '''void main() { var l = []; @l.add(0); print(l); }
-''';
-
-main() {
- // These tests are fragile, since mappings for specific source locations
- // could disappear due to various optimizations like code elimination,
- // function inlining, etc. If you broke the test, please try to rewrite it
- // so that the new code is not optimized, otherwise just remove the marker
- // from problematic location.
- testSourceMapLocations(FUNCTIONS_TEST);
- testSourceMapLocations(RETURN_TEST);
- testSourceMapLocations(NOT_TEST);
- testSourceMapLocations(UNARY_TEST);
- testSourceMapLocations(BINARY_TEST);
- testSourceMapLocations(SEND_TEST);
- testSourceMapLocations(SEND_SET_TEST);
- testSourceMapLocations(LOOP_TEST);
- testSourceMapLocations(INTERCEPTOR_TEST);
-}
diff --git a/tests/compiler/dart2js/type_test_helper.dart b/tests/compiler/dart2js/type_test_helper.dart
index 95e82a0..9705244 100644
--- a/tests/compiler/dart2js/type_test_helper.dart
+++ b/tests/compiler/dart2js/type_test_helper.dart
@@ -17,13 +17,9 @@
show ClassElement, LibraryElement, TypedefElement;
import 'package:compiler/src/kernel/kernel_strategy.dart';
import 'package:compiler/src/world.dart' show ClosedWorld;
-import 'compiler_helper.dart' as mock;
-import 'compiler_helper.dart' show CompileMode;
import 'memory_compiler.dart' as memory;
import 'kernel/compiler_helper.dart' as dill;
-export 'compiler_helper.dart' show CompileMode;
-
DartType instantiate(Entity element, List<DartType> arguments) {
if (element is ClassElement) {
return new ResolutionInterfaceType(element, arguments);
@@ -42,8 +38,7 @@
Resolution get resolution => compiler.resolution;
static Future<TypeEnvironment> create(String source,
- {CompileMode compileMode: CompileMode.mock,
- bool useDillCompiler: false,
+ {bool useDillCompiler: false,
bool expectNoErrors: false,
bool expectNoWarningsOrErrors: false,
bool stopAfterTypeInference: false,
@@ -68,52 +63,19 @@
source = '$mainSource\n$source';
}
memory.DiagnosticCollector collector;
- if (compileMode == CompileMode.kernel) {
- collector = new memory.DiagnosticCollector();
- uri = Uri.parse('memory:main.dart');
- compiler = await dill.compileWithDill(
- entryPoint: uri,
- memorySourceFiles: {'main.dart': source},
- diagnosticHandler: collector,
- options: stopAfterTypeInference
- ? ([Flags.disableTypeInference]..addAll(options))
- : ([
- Flags.disableTypeInference,
- Flags.analyzeAll,
- Flags.analyzeOnly
- ]..addAll(options)),
- beforeRun: (Compiler compiler) {
- compiler.stopAfterTypeInference = stopAfterTypeInference;
- });
- } else {
- if (compileMode == CompileMode.mock) {
- uri = new Uri(scheme: 'source');
- mock.MockCompiler mockCompiler = mock.mockCompilerFor(source, uri,
- analyzeAll: !stopAfterTypeInference,
- analyzeOnly: !stopAfterTypeInference);
- mockCompiler.diagnosticHandler =
- mock.createHandler(mockCompiler, source);
- collector = mockCompiler.diagnosticCollector;
- compiler = mockCompiler;
- compiler.stopAfterTypeInference = stopAfterTypeInference;
- await compiler.run(uri);
- } else {
- collector = new memory.DiagnosticCollector();
- uri = Uri.parse('memory:main.dart');
- memory.CompilationResult result = await memory.runCompiler(
- entryPoint: uri,
- memorySourceFiles: {'main.dart': source},
- diagnosticHandler: collector,
- options: stopAfterTypeInference
- ? ([Flags.useOldFrontend]..addAll(options))
- : ([Flags.useOldFrontend, Flags.analyzeAll, Flags.analyzeOnly]
- ..addAll(options)),
- beforeRun: (compiler) {
- compiler.stopAfterTypeInference = stopAfterTypeInference;
- });
- compiler = result.compiler;
- }
- }
+ collector = new memory.DiagnosticCollector();
+ uri = Uri.parse('memory:main.dart');
+ compiler = await dill.compileWithDill(
+ entryPoint: uri,
+ memorySourceFiles: {'main.dart': source},
+ diagnosticHandler: collector,
+ options: stopAfterTypeInference
+ ? ([Flags.disableTypeInference]..addAll(options))
+ : ([Flags.disableTypeInference, Flags.analyzeAll, Flags.analyzeOnly]
+ ..addAll(options)),
+ beforeRun: (Compiler compiler) {
+ compiler.stopAfterTypeInference = stopAfterTypeInference;
+ });
if (expectNoErrors || expectNoWarningsOrErrors) {
var errors = collector.errors;
Expect.isTrue(errors.isEmpty, 'Unexpected errors: ${errors}');
diff --git a/tests/compiler/dart2js/uri_retention_test.dart b/tests/compiler/dart2js/uri_retention_test.dart
index 782e0f7..eaa6b35 100644
--- a/tests/compiler/dart2js/uri_retention_test.dart
+++ b/tests/compiler/dart2js/uri_retention_test.dart
@@ -12,10 +12,9 @@
import 'package:expect/expect.dart';
import 'memory_compiler.dart' show runCompiler, OutputCollector;
-Future<String> compileSources(sources, {bool minify, bool useKernel}) async {
+Future<String> compileSources(sources, {bool minify}) async {
var options = [];
if (minify) options.add(Flags.minify);
- if (!useKernel) options.add(Flags.useOldFrontend);
OutputCollector outputCollector = new OutputCollector();
await runCompiler(
memorySourceFiles: sources,
@@ -24,15 +23,14 @@
return outputCollector.getOutput('', OutputType.js);
}
-Future test(sources, {bool libName, bool fileName, bool useKernel}) {
- return compileSources(sources, minify: false, useKernel: useKernel)
- .then((output) {
+Future test(sources, {bool libName, bool fileName}) {
+ return compileSources(sources, minify: false).then((output) {
// Unminified the sources should always contain the library name and the
// file name.
Expect.isTrue(output.contains("main_lib"));
Expect.isTrue(output.contains("main.dart"));
}).then((_) {
- compileSources(sources, minify: true, useKernel: useKernel).then((output) {
+ compileSources(sources, minify: true).then((output) {
Expect.equals(libName, output.contains("main_lib"));
Expect.isFalse(output.contains("main.dart"));
});
@@ -40,22 +38,13 @@
}
void main() {
- runTests({bool useKernel}) async {
- await test(MEMORY_SOURCE_FILES1,
- libName: false, fileName: false, useKernel: useKernel);
- if (!useKernel) {
- await test(MEMORY_SOURCE_FILES2,
- libName: true, fileName: false, useKernel: useKernel);
- await test(MEMORY_SOURCE_FILES3,
- libName: true, fileName: true, useKernel: useKernel);
- }
+ runTests() async {
+ await test(MEMORY_SOURCE_FILES1, libName: false, fileName: false);
}
asyncTest(() async {
- print('--test from ast---------------------------------------------------');
- await runTests(useKernel: false);
print('--test from kernel------------------------------------------------');
- await runTests(useKernel: true);
+ await runTests();
});
}
@@ -73,46 +62,3 @@
}
""",
};
-
-// Requires the library name, but not the URIs.
-const MEMORY_SOURCE_FILES2 = const <String, String>{
- 'main.dart': """
-library main_lib;
-
-@MirrorsUsed(targets: 'main_lib')
-import 'dart:mirrors';
-import 'file2.dart';
-
-class A {
-}
-
-main() {
- print(Uri.base);
- // Unfortunately we can't use new B().uri yet, because that would require
- // some type-feedback to know that the '.uri' is not the one from the library.
- print(new B());
- print(reflectClass(A).declarations.length);
-}
-""",
- 'file2.dart': """
-library other_lib;
-
-class B {
- final uri = "xyz";
-}
-""",
-};
-
-// Requires the uri (and will contain the library-name, too).
-const MEMORY_SOURCE_FILES3 = const <String, String>{
- 'main.dart': """
-library main_lib;
-
-@MirrorsUsed(targets: 'main_lib')
-import 'dart:mirrors';
-
-main() {
- print(currentMirrorSystem().findLibrary(#main_lib).uri);
-}
-""",
-};
diff --git a/tests/compiler/dart2js/user_crash_test.dart b/tests/compiler/dart2js/user_crash_test.dart
index 250f4cb..d70695f 100644
--- a/tests/compiler/dart2js/user_crash_test.dart
+++ b/tests/compiler/dart2js/user_crash_test.dart
@@ -6,16 +6,14 @@
import 'package:async_helper/async_helper.dart';
import 'package:expect/expect.dart';
import 'package:compiler/compiler_new.dart';
-import 'package:compiler/src/commandline_options.dart';
import 'memory_compiler.dart';
final EXCEPTION = 'Crash-marker';
main() {
- runTests({bool useKernel}) async {
- test('Empty program', await run(useKernel: useKernel));
- test('Crash diagnostics',
- await run(useKernel: useKernel, diagnostics: new CrashingDiagnostics()),
+ runTests() async {
+ test('Empty program', await run());
+ test('Crash diagnostics', await run(diagnostics: new CrashingDiagnostics()),
expectedLines: [
'Uncaught exception in diagnostic handler: $EXCEPTION',
null /* Stack trace*/
@@ -25,11 +23,9 @@
]);
test(
'Throw in package discovery',
- await run(
- useKernel: useKernel,
- packagesDiscoveryProvider: (_) {
- throw EXCEPTION;
- }),
+ await run(packagesDiscoveryProvider: (_) {
+ throw EXCEPTION;
+ }),
expectedLines: [
'Uncaught exception in package discovery: $EXCEPTION',
null /* Stack trace*/
@@ -40,30 +36,20 @@
test(
'new Future.error in package discovery',
await run(
- useKernel: useKernel,
packagesDiscoveryProvider: (_) => new Future.error(EXCEPTION)),
expectedExceptions: [EXCEPTION]);
- List<String> expectedLines;
- if (useKernel) {
- expectedLines = ['Error: Input file not found: memory:main.dart.'];
- } else {
- expectedLines = [
- 'Uncaught exception in input provider: $EXCEPTION',
- null, // Stack trace
- 'memory:main.dart:\nError: $EXCEPTION' /* READ_SELF_ERROR */
- ];
- }
+ List<String> expectedLines = [
+ 'Error: Input file not found: memory:main.dart.'
+ ];
test('Throw in input provider',
- await run(useKernel: useKernel, memorySourceFiles: new CrashingMap()),
+ await run(memorySourceFiles: new CrashingMap()),
expectedLines: expectedLines);
}
asyncTest(() async {
- print('--test from ast---------------------------------------------------');
- await runTests(useKernel: false);
print('--test from kernel------------------------------------------------');
- await runTests(useKernel: true);
+ await runTests();
});
}
@@ -90,8 +76,7 @@
Future<RunResult> run(
{Map<String, String> memorySourceFiles: const {'main.dart': 'main() {}'},
CompilerDiagnostics diagnostics,
- PackagesDiscoveryProvider packagesDiscoveryProvider,
- bool useKernel}) async {
+ PackagesDiscoveryProvider packagesDiscoveryProvider}) async {
RunResult result = new RunResult();
await runZoned(() async {
try {
@@ -99,8 +84,7 @@
entryPoint: Uri.parse('memory:main.dart'),
memorySourceFiles: memorySourceFiles,
diagnosticHandler: diagnostics,
- packagesDiscoveryProvider: packagesDiscoveryProvider,
- options: useKernel ? [] : [Flags.useOldFrontend]);
+ packagesDiscoveryProvider: packagesDiscoveryProvider);
} catch (e) {
result.exceptions.add(e);
}
diff --git a/tests/compiler/dart2js_extra/dummy_compiler_test.dart b/tests/compiler/dart2js_extra/dummy_compiler_test.dart
index 09c60e4..3e3a64f 100644
--- a/tests/compiler/dart2js_extra/dummy_compiler_test.dart
+++ b/tests/compiler/dart2js_extra/dummy_compiler_test.dart
@@ -11,7 +11,7 @@
import 'package:async_helper/async_helper.dart';
import 'package:compiler/compiler.dart';
-import '../dart2js/old_frontend/mock_libraries.dart';
+import 'mock_libraries.dart';
String libProvider(Uri uri) {
if (uri.path.endsWith(".platform")) {
diff --git a/tests/compiler/dart2js_extra/instantiation_stub_test.dart b/tests/compiler/dart2js_extra/instantiation_stub_test.dart
new file mode 100644
index 0000000..d62266f
--- /dev/null
+++ b/tests/compiler/dart2js_extra/instantiation_stub_test.dart
@@ -0,0 +1,53 @@
+// 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
+
+import 'package:expect/expect.dart';
+
+// This needs one-arg instantiation.
+@NoInline()
+T f1a<T>(T t) => t;
+
+// This needs no instantiation because it is not closurized.
+@NoInline()
+T f1b<T>(T t1, T t2) => t1;
+
+class Class {
+ // This needs two-arg instantiation.
+ @NoInline()
+ bool f2a<T, S>(T t, S s) => t == s;
+
+ // This needs no instantiation because it is not closurized.
+ @NoInline()
+ bool f2b<T, S>(T t, S s1, S s2) => t == s1;
+}
+
+@NoInline()
+int method1(int i, int Function(int) f) => f(i);
+
+@NoInline()
+bool method2(int a, int b, bool Function(int, int) f) => f(a, b);
+
+@NoInline()
+int method3(int a, int b, int c, int Function(int, int, int) f) => f(a, b, c);
+
+main() {
+ // This needs three-arg instantiation.
+ T local1<T, S, U>(T t, S s, U u) => t;
+
+ // This needs no instantiation because but a local function is always
+ // closurized so we assume it does.
+ T local2<T, S, U>(T t, S s, U u1, U u2) => t;
+
+ Expect.equals(42, method1(42, f1a));
+ Expect.equals(f1b(42, 87), 42);
+
+ Class c = new Class();
+ Expect.isFalse(method2(0, 1, c.f2a));
+ Expect.isFalse(c.f2b(42, 87, 123));
+
+ Expect.equals(0, method3(0, 1, 2, local1));
+ Expect.equals(42, local2(42, 87, 123, 256));
+}
diff --git a/tests/compiler/dart2js/old_frontend/mock_libraries.dart b/tests/compiler/dart2js_extra/mock_libraries.dart
similarity index 100%
rename from tests/compiler/dart2js/old_frontend/mock_libraries.dart
rename to tests/compiler/dart2js_extra/mock_libraries.dart
diff --git a/tests/corelib_2/apply3_test.dart b/tests/corelib_2/apply3_test.dart
index d96fa0d..5bf1bce 100644
--- a/tests/corelib_2/apply3_test.dart
+++ b/tests/corelib_2/apply3_test.dart
@@ -5,7 +5,6 @@
// Test [Function.apply] on user-defined classes that implement [noSuchMethod].
import "package:expect/expect.dart";
-import 'dart:mirrors';
class F {
call([p1]) => "call";
@@ -24,46 +23,12 @@
main() {
Expect.equals('call', Function.apply(new F(), []));
Expect.equals('call', Function.apply(new F(), [1]));
- Expect.equals('NSM', Function.apply(new F(), [1, 2]));
- Expect.equals('NSM', Function.apply(new F(), [1, 2, 3]));
+ Expect.throwsNoSuchMethodError(() => Function.apply(new F(), [1, 2]));
+ Expect.throwsNoSuchMethodError(() => Function.apply(new F(), [1, 2, 3]));
- var symbol = const Symbol('a');
- var requiredParameters = [1];
- var optionalParameters = new Map<Symbol, int>()..[symbol] = 42;
- Invocation i =
- Function.apply(new G(), requiredParameters, optionalParameters);
-
- Expect.equals(const Symbol('call'), i.memberName);
- Expect.listEquals(requiredParameters, i.positionalArguments);
- Expect.mapEquals(optionalParameters, i.namedArguments);
- Expect.isTrue(i.isMethod);
- Expect.isFalse(i.isGetter);
- Expect.isFalse(i.isSetter);
- Expect.isFalse(i.isAccessor);
-
- // Check that changing the passed list and map for parameters does
- // not affect [i].
- requiredParameters[0] = 42;
- optionalParameters[symbol] = 12;
- Expect.listEquals([1], i.positionalArguments);
- Expect.mapEquals(new Map()..[symbol] = 42, i.namedArguments);
-
- // Check that using [i] for invocation yields the same [Invocation]
- // object.
- var mirror = reflect(new G());
- Invocation other = mirror.delegate(i);
- Expect.equals(i.memberName, other.memberName);
- Expect.listEquals(i.positionalArguments, other.positionalArguments);
- Expect.mapEquals(i.namedArguments, other.namedArguments);
- Expect.equals(i.isMethod, other.isMethod);
- Expect.equals(i.isGetter, other.isGetter);
- Expect.equals(i.isSetter, other.isSetter);
- Expect.equals(i.isAccessor, other.isAccessor);
+ Expect.throwsNoSuchMethodError(() => Function.apply(new G(), [1], {#a: 42}));
// Test that [i] can be used to hit an existing method.
Expect.equals(43, new H().call(1, a: 42));
- Expect.equals(43, Function.apply(new H(), [1], new Map()..[symbol] = 42));
- mirror = reflect(new H());
- Expect.equals(43, mirror.delegate(i));
- Expect.equals(43, mirror.delegate(other));
+ Expect.equals(43, Function.apply(new H(), [1], {#a: 42}));
}
diff --git a/tests/corelib_2/bigint_test.dart b/tests/corelib_2/bigint_test.dart
index e6845d0..290e477 100644
--- a/tests/corelib_2/bigint_test.dart
+++ b/tests/corelib_2/bigint_test.dart
@@ -484,6 +484,29 @@
e = BigInt.parse("123456789012345678901234567890");
m = BigInt.parse("123456789012345678901234567899");
Expect.equals(BigInt.parse("40128068573873018143207285483"), x.modPow(e, m));
+ x = BigInt.parse(
+ "142223781135477974841804437037182877109549636480215350570761436386728140"
+ "00321219503871352719175100865184619168128345594681547640115731246638");
+ e = BigInt.parse(
+ "688057170495263083245752731085731160016625265771524738691797062279575950"
+ "919479651156310413084174304361991240273181430924411258203766946639349880"
+ "404106504114953688890200429043051936362182997575167191584461538746041795"
+ "019663740246921124383173799957296515067912829778249931473903780958741032"
+ "64534184571632120755");
+ m = BigInt.parse(
+ "144173682842817587002196172066264549138375068078359231382946906898412792"
+ "452632726597279520229873489736777248181678202636100459215718497240474064"
+ "366927544074501134727745837254834206456400508719134610847814227274992298"
+ "238973375146473350157304285346424982280927848339601514720098577525635486"
+ "320547905945936448443");
+ Expect.equals(
+ BigInt.parse(
+ "41228476947144730491819644448449646627743926889389391986712371102685"
+ "14984467753960109321610008533258676279344318597060690521027646613453"
+ "25674994677820913027869835916005689276806408148698486814119894325284"
+ "18918299321385420296108046942018595594076729397423805685944237555128"
+ "652606412065971965116137839721723231"),
+ x.modPow(e, m));
}
testBigintModInverse() {
diff --git a/tests/corelib_2/corelib_2.status b/tests/corelib_2/corelib_2.status
index 6c66c0c..485d97c 100644
--- a/tests/corelib_2/corelib_2.status
+++ b/tests/corelib_2/corelib_2.status
@@ -22,7 +22,6 @@
error_stack_trace_test/static: MissingCompileTimeError
[ $compiler == dartdevk ]
-apply3_test: RuntimeError
bigint_from_test: RuntimeError # Issue 32589
bool_from_environment2_test/03: Crash
int_modulo_arith_test/modPow: RuntimeError
@@ -39,7 +38,7 @@
regexp/pcre_test: Pass, Slow # Issue 22008
[ $runtime == flutter ]
-apply3_test: CompileTimeError # mirrors not supported
+apply3_test: RuntimeError
bool_from_environment_test: Fail # Flutter Issue 9111
format_exception_test: RuntimeError # Flutter Issue 9111
from_environment_const_type_test/01: Fail # Flutter Issue 9111
@@ -94,6 +93,10 @@
[ $arch == x64 && $system == windows ]
stopwatch_test: Skip # Flaky test due to expected performance behaviour.
+[ $arch == simarm || $arch == simarm64 || $arch == simdbc64 ]
+bigint_parse_radix_test: Pass, Slow # Bigint computations are slow on simulated architectures.
+bigint_test: Pass, Slow # Bigint computations are slow on simulated architectures.
+
[ $compiler == dart2analyzer && !$checked && !$strong ]
from_environment_const_type_test/02: MissingCompileTimeError
from_environment_const_type_test/03: MissingCompileTimeError
@@ -193,8 +196,8 @@
symbol_reserved_word_test/03: RuntimeError # Issue 19972, new Symbol('void') should be allowed.
[ $compiler == dart2js && $fast_startup ]
-apply3_test: Fail # mirrors not supported
-dynamic_nosuchmethod_test: Fail # mirrors not supported
+apply3_test: RuntimeError
+dynamic_nosuchmethod_test: RuntimeError
[ $compiler == dart2js && $fast_startup && $fasta && $strong ]
cast_test: RuntimeError
@@ -222,9 +225,7 @@
map_entry_test: RuntimeError
[ $compiler == dart2js && $fasta && $host_checked && $strong ]
-apply3_test: RuntimeError
cast_test: RuntimeError
-dynamic_nosuchmethod_test: RuntimeError
error_stack_trace1_test: RuntimeError # Issue 12399
growable_list_test: RuntimeError # Concurrent modifications test always runs
int_parse_radix_test/01: RuntimeError
@@ -246,7 +247,6 @@
uri_test: RuntimeError
[ $compiler == dart2js && $fasta && $minified && $strong ]
-apply3_test: RuntimeError
cast_test: RuntimeError
dynamic_nosuchmethod_test: RuntimeError
error_stack_trace1_test: RuntimeError # Issue 12399
@@ -305,16 +305,8 @@
string_replace_static_test: MissingCompileTimeError
string_static_test: MissingCompileTimeError
-# Enabling of dartk for sim{arm,arm64,dbc64} revelaed these test failures, which
-# are to be triaged. Isolate tests are skipped on purpose due to the usage of
-# batch mode.
-[ $compiler == dartk && $mode == debug && $strong && ($arch == simarm || $arch == simarm64 || $arch == simdbc64) ]
-bigint_parse_radix_test: Pass, Timeout # Please triage.
-bigint_test: Pass, Timeout # Please triage.
-
# ===== dartk + vm status lines =====
[ $compiler == dartk && $runtime == vm && $strong ]
-apply3_test: RuntimeError
apply_generic_function_test: RuntimeError
iterable_fold_test/02: RuntimeError
iterable_reduce_test/01: CompileTimeError # Issue 31533
@@ -329,9 +321,6 @@
[ $compiler != dartk && $runtime == vm && $checked ]
apply_test/01: RuntimeError
-[ $compiler == dartkp && $mode == debug && $runtime == dart_precompiled && $strong ]
-growable_list_test: Crash
-
[ $compiler == dartkp && $runtime == dart_precompiled && $strong ]
apply_generic_function_test: RuntimeError
iterable_fold_test/02: RuntimeError
@@ -416,7 +405,6 @@
typed_data_with_limited_ints_test: Skip # dart2js and dartdevc don't know about --limit-ints-to-64-bits
[ $runtime != none && ($compiler == dartdevc || $compiler == dartdevk) ]
-apply3_test: RuntimeError # Issue 29921
bigint_test: Pass, Slow
compare_to2_test: RuntimeError # Issue 30170
date_time10_test: RuntimeError # Issue 29921
@@ -597,13 +585,12 @@
from_environment_const_type_undefined_test/16: MissingCompileTimeError
iterable_to_set_test: RuntimeError # is-checks do not implement strong mode type system
-[ $compiler == dartkp || $compiler == precompiler ]
-apply3_test: SkipByDesign
-dynamic_nosuchmethod_test: SkipByDesign
-
[ $compiler == precompiler || $runtime == vm && !$checked && !$strong ]
int_parse_radix_test/badTypes: RuntimeError # wrong exception returned
+[ $compiler == precompiler || $runtime == vm && !$strong ]
+apply3_test: RuntimeError
+
[ $runtime == dart_precompiled || $runtime == flutter || $runtime == vm ]
regexp/global_test: Skip # Issue 21709
regexp/pcre_test: Pass, Slow, Timeout
@@ -617,4 +604,5 @@
[ $hot_reload || $hot_reload_rollback ]
bigint_parse_radix_test: Pass, Timeout # Issue 31659
+bigint_test: Pass, Crash # Issue 31660
integer_parsed_mul_div_vm_test: Pass, Slow # Slow
diff --git a/tests/corelib_2/dynamic_nosuchmethod_test.dart b/tests/corelib_2/dynamic_nosuchmethod_test.dart
index 730cdbb..2577b48 100644
--- a/tests/corelib_2/dynamic_nosuchmethod_test.dart
+++ b/tests/corelib_2/dynamic_nosuchmethod_test.dart
@@ -3,7 +3,6 @@
// BSD-style license that can be found in the LICENSE file.
import "package:expect/expect.dart";
-import 'dart:mirrors';
// Test that noSuchMethod calls behave as expected for dynamic object invocations.
class BaseClass {
@@ -19,7 +18,9 @@
ReturnInvocationName(this._bar);
noSuchMethod(Invocation invocation) {
- return MirrorSystem.getName(invocation.memberName);
+ var name = invocation.memberName.toString();
+ var match = new RegExp(r'Symbol\("([^"]+)"\)').matchAsPrefix(name);
+ return match != null ? match.group(1) : name;
}
bar() {
diff --git a/tests/language_2/async_covariant_type_test.dart b/tests/language_2/async_covariant_type_test.dart
new file mode 100644
index 0000000..c619673
--- /dev/null
+++ b/tests/language_2/async_covariant_type_test.dart
@@ -0,0 +1,20 @@
+// 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.
+
+// Test that TypeErrors happen for async methods without using returned Future.
+
+import 'dart:async';
+import 'package:expect/expect.dart';
+
+class D<T> {
+ // Parametric covariance check is usually compiled into method.
+ Future<T> add(T n) async {
+ return n;
+ }
+}
+
+main() async {
+ D<num> d = new D<int>();
+ Expect.throwsTypeError(() => d.add(4.6));
+}
diff --git a/tests/language_2/async_dcall_type_test.dart b/tests/language_2/async_dcall_type_test.dart
new file mode 100644
index 0000000..b3ffbe6
--- /dev/null
+++ b/tests/language_2/async_dcall_type_test.dart
@@ -0,0 +1,30 @@
+// 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.
+
+// Test that TypeErrors happen for async methods without using returned Future.
+
+import 'dart:async';
+import 'package:expect/expect.dart';
+
+Future<int> iota(int n) async {
+ await null;
+ return n;
+}
+
+class C {
+ Future<int> add(int n) async {
+ await null;
+ return n;
+ }
+}
+
+main() async {
+ dynamic f = iota;
+ Expect.throwsTypeError(() => f('ten'));
+ Expect.throwsTypeError(() => f(4.7));
+
+ dynamic o = new C();
+ Expect.throwsTypeError(() => o.add('ten'));
+ Expect.throwsTypeError(() => o.add(4.7));
+}
diff --git a/tests/language_2/asyncstar_covariant_type_test.dart b/tests/language_2/asyncstar_covariant_type_test.dart
new file mode 100644
index 0000000..836daf0
--- /dev/null
+++ b/tests/language_2/asyncstar_covariant_type_test.dart
@@ -0,0 +1,20 @@
+// 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.
+
+// Test that TypeErrors for async* methods happen without using returned Stream.
+
+import 'dart:async';
+import 'package:expect/expect.dart';
+
+class D<T> {
+ // Parametric covariance check is usually compiled into method.
+ Stream<T> add(T n) async* {
+ yield n;
+ }
+}
+
+main() async {
+ D<num> d = new D<int>();
+ Expect.throwsTypeError(() => d.add(4.6));
+}
diff --git a/tests/language_2/asyncstar_dcall_type_test.dart b/tests/language_2/asyncstar_dcall_type_test.dart
new file mode 100644
index 0000000..1330a6d
--- /dev/null
+++ b/tests/language_2/asyncstar_dcall_type_test.dart
@@ -0,0 +1,28 @@
+// 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.
+
+// Test that TypeErrors for async* methods happen without using returned Stream.
+
+import 'dart:async';
+import 'package:expect/expect.dart';
+
+Stream<int> iota(int n) async* {
+ yield n;
+}
+
+class C {
+ Stream<int> add(int n) async* {
+ yield n;
+ }
+}
+
+main() async {
+ dynamic f = iota;
+ Expect.throwsTypeError(() => f('ten'));
+ Expect.throwsTypeError(() => f(4.7));
+
+ dynamic o = new C();
+ Expect.throwsTypeError(() => o.add('ten'));
+ Expect.throwsTypeError(() => o.add(4.7));
+}
diff --git a/tests/language_2/bug32305_test.dart b/tests/language_2/bug32305_test.dart
new file mode 100644
index 0000000..5943764
--- /dev/null
+++ b/tests/language_2/bug32305_test.dart
@@ -0,0 +1,10 @@
+// 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.
+
+void main() {
+ int Function(int) f;
+
+ List<num> l = [];
+ /*@compile-error=unspecified*/ var a = l.map(f);
+}
diff --git a/tests/language_2/call_method_must_not_be_getter_test.dart b/tests/language_2/call_method_must_not_be_getter_test.dart
index d21132b..ac070dd 100644
--- a/tests/language_2/call_method_must_not_be_getter_test.dart
+++ b/tests/language_2/call_method_must_not_be_getter_test.dart
@@ -9,6 +9,16 @@
void Function() get call => () {};
}
+class D {
+ get call => this;
+}
+
+// Recurs outside the try-block to avoid disabling inlining.
+callD() {
+ dynamic d = new D();
+ d();
+}
+
main() {
C c = new C();
dynamic d = c;
@@ -20,6 +30,9 @@
void Function() f = c; //# 02: compile-time error
// Nor does it permit a dynamic invocation of `call`.
Expect.throws(() => d()); //# 03: ok
+ // Same as previous line, but with a getter that can stack overflow if
+ // incorrect behavior is present. Merged from issue21159_test.
+ Expect.throwsNoSuchMethodError(() => callD()); //# 03: ok
// However, all these things are possible if `call` is mentioned explicitly.
c.call(); //# 04: ok
diff --git a/tests/language_2/const_evaluation_test.dart b/tests/language_2/const_evaluation_test.dart
index e176c16..cd0353e 100644
--- a/tests/language_2/const_evaluation_test.dart
+++ b/tests/language_2/const_evaluation_test.dart
@@ -5,8 +5,6 @@
// Check that compile-time evaluation of constants is consistent with runtime
// evaluation.
-import 'dart:mirrors';
-
import 'package:expect/expect.dart';
const top_const = identical(-0.0, 0);
@@ -38,9 +36,6 @@
Expect.equals(instance_var, local_const);
Expect.equals(local_const, local_final);
Expect.equals(local_final, local_var);
- var metadata = reflectClass(C).metadata[0].reflectee; //# 01: ok
- Expect.equals(top_const, metadata); // //# 01: continued
- Expect.equals(local_var, metadata); // //# 01: continued
}
}
diff --git a/tests/language_2/field_increment_bailout_test.dart b/tests/language_2/field_increment_bailout_test.dart
index 7275f67..cddb38c 100644
--- a/tests/language_2/field_increment_bailout_test.dart
+++ b/tests/language_2/field_increment_bailout_test.dart
@@ -4,7 +4,6 @@
// dart2js regression test for issue 8781.
-import "dart:mirrors" show reflect;
import "package:expect/expect.dart";
class N {
@@ -37,17 +36,17 @@
}
}
-class L {
- final list;
- L(this.list);
- // Use noSuchMethod to defeat type inferencing.
- noSuchMethod(mirror) => reflect(list).delegate(mirror);
-}
-
main() {
- var o = new A(new N(new L([1]), new L([2])));
+ var o = new A(new N(confuse([1]), confuse([2])));
for (var i = 1; i <= 2; i++) Expect.equals(i, o.next());
Expect.equals(null, o.list);
}
+
+// Use confuse to defeat type inferencing.
+@NoInline()
+@AssumeDynamic()
+confuse(x) {
+ return x;
+}
diff --git a/tests/language_2/instantiate_tearoff_test.dart b/tests/language_2/instantiate_tearoff_test.dart
index 254949e..6a551f6 100644
--- a/tests/language_2/instantiate_tearoff_test.dart
+++ b/tests/language_2/instantiate_tearoff_test.dart
@@ -58,6 +58,7 @@
String Function(X, int) x = foo;
return x;
}
+
dynamic fn = bar<String>();
Expect.equals("${fn.runtimeType}", "${stringAndIntToString.runtimeType}");
Expect.equals(fn("a", 1), "String, int");
diff --git a/tests/language_2/invocation_mirror2_test.dart b/tests/language_2/invocation_mirror2_test.dart
index c8264ec..6f62d6e 100644
--- a/tests/language_2/invocation_mirror2_test.dart
+++ b/tests/language_2/invocation_mirror2_test.dart
@@ -2,17 +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 "dart:mirrors" show reflect;
import "package:expect/expect.dart";
-class GetName {
- set flif(_) => "flif=";
-}
-
-int getName(im) => reflect(new GetName()).delegate(im);
-
class C {
- var im;
+ Invocation im;
noSuchMethod(im) => this.im = im;
flif() {}
}
@@ -20,6 +13,6 @@
main() {
dynamic c = new C();
c.flif = 42;
- Expect.equals(42, getName(c.im));
+ Expect.equals(const Symbol("flif="), c.im.memberName);
Expect.equals(42, c.im.positionalArguments[0]);
}
diff --git a/tests/language_2/issue21159_test.dart b/tests/language_2/issue21159_test.dart
deleted file mode 100644
index 62227c6..0000000
--- a/tests/language_2/issue21159_test.dart
+++ /dev/null
@@ -1,25 +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:expect/expect.dart";
-
-class C {
- get call => this;
-}
-
-// Recurs outside the try-block to avoid disabling inlining.
-foo() {
- dynamic c = new C();
- c();
-}
-
-main() {
- bool exceptionCaught = false;
- try {
- foo();
- } on StackOverflowError catch (e) {
- exceptionCaught = true;
- }
- Expect.equals(true, exceptionCaught);
-}
diff --git a/tests/language_2/language_2.status b/tests/language_2/language_2.status
index e4180aa..bdfe9cd 100644
--- a/tests/language_2/language_2.status
+++ b/tests/language_2/language_2.status
@@ -57,7 +57,6 @@
# errors aren't detected by fasta, but reported by back ends as compile-time
# errors.
[ $compiler != dart2js && $runtime != dart_precompiled && $runtime != vm && $fasta ]
-deferred_constraints_constants_test/default_argument2: MissingCompileTimeError
function_type_parameter2_negative_test: Fail
function_type_parameter_negative_test: Fail
implicit_creation/implicit_const_not_default_values_test/e12: MissingCompileTimeError
@@ -279,6 +278,7 @@
implicit_creation/implicit_new_or_const_test: Fail # No support for implicit creation.
implicit_creation/implicit_new_prefix_constructor_generic_named_test: Fail # No support for implicit creation.
implicit_creation/implicit_new_prefix_constructor_named_test: Fail # No support for implicit creation.
+setter_override2_test/02: MissingCompileTimeError # Issue 14736
[ $compiler == app_jit || $compiler == none ]
library_env_test/has_no_mirror_support: RuntimeError, OK
@@ -315,7 +315,6 @@
deferred_static_seperate_test: Crash # Requires deferred libraries
deferred_super_dependency_test: Pass, Crash # Requires deferred libraries
deferred_type_dependency_test: Crash # Requires deferred libraries
-issue21159_test: Pass, Crash # Issue 29094
issue_1751477_test: Crash # Requires deferred libraries
issue_22780_test/01: Pass, Crash # Issue 29094
regress_22443_test: Crash # Requires deferred libraries
diff --git a/tests/language_2/language_2_analyzer.status b/tests/language_2/language_2_analyzer.status
index 790afc0..c9ddf1c 100644
--- a/tests/language_2/language_2_analyzer.status
+++ b/tests/language_2/language_2_analyzer.status
@@ -120,6 +120,7 @@
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
@@ -1159,6 +1160,7 @@
regress_30121_test: CompileTimeError # Issue 31087
regress_30339_test: CompileTimeError
reify_typevar_static_test/00: MissingCompileTimeError # Issue 28823
+setter_override2_test/02: MissingCompileTimeError # Issue 14736
string_interpolate_test: CompileTimeError
string_split_test: CompileTimeError
string_supertype_checked_test: CompileTimeError
@@ -1203,6 +1205,7 @@
async_congruence_unnamed_test/01: MissingCompileTimeError
async_congruence_unnamed_test/02: MissingCompileTimeError
black_listed_test/none: Fail # Issue 14228
+bug32305_test: MissingCompileTimeError
built_in_identifier_type_annotation_test/35: MissingCompileTimeError # Issue 28813
built_in_identifier_type_annotation_test/36: MissingCompileTimeError # Issue 28813
built_in_identifier_type_annotation_test/37: MissingCompileTimeError # Issue 28813
diff --git a/tests/language_2/language_2_dart2js.status b/tests/language_2/language_2_dart2js.status
index 9a340bb..4b7d3be 100644
--- a/tests/language_2/language_2_dart2js.status
+++ b/tests/language_2/language_2_dart2js.status
@@ -12,7 +12,6 @@
issue23244_test: RuntimeError # Isolates - enum canonicalization - Issue 23244
library_env_test/has_mirror_support: RuntimeError, OK
library_env_test/has_no_html_support: RuntimeError, OK
-null_test/mirrors: SkipByDesign # Uses mirrors.
vm/*: SkipByDesign # Tests for the VM.
[ $compiler != dart2js ]
@@ -146,6 +145,8 @@
function_type/function_type9_test: RuntimeError # Issue 30476
function_type_alias2_test: RuntimeError
function_type_alias4_test: RuntimeError
+syncstar_covariant_type_test: RuntimeError # dart2js misplaces check in Iterator, not Iterable.
+syncstar_dcall_type_test: RuntimeError # dart2js misplaces check in Iterator, not Iterable.
[ $compiler == dart2js && $runtime == safari ]
field_override_optimization_test: RuntimeError
@@ -181,8 +182,6 @@
async_star_test/02: RuntimeError
await_test: RuntimeError
bad_override_test/03: MissingCompileTimeError
-bad_override_test/04: MissingCompileTimeError
-bad_override_test/05: MissingCompileTimeError
bit_operations_test/03: RuntimeError
bit_operations_test/04: RuntimeError
bit_operations_test/none: RuntimeError
@@ -282,9 +281,6 @@
covariant_override/runtime_check_test: RuntimeError
covariant_subtyping_test: RuntimeError
cyclic_constructor_test/01: Crash # Stack Overflow
-deferred_constraints_constants_test/default_argument2: Crash # Unsupported operation: KernelDeferredLoadTask.addMirrorElementsForLibrary
-deferred_constraints_constants_test/none: Crash # Unsupported operation: KernelDeferredLoadTask.addMirrorElementsForLibrary
-deferred_constraints_constants_test/reference_after_load: Crash # Unsupported operation: KernelDeferredLoadTask.addMirrorElementsForLibrary
deferred_constraints_type_annotation_test/as_operation: MissingCompileTimeError
deferred_constraints_type_annotation_test/catch_check: MissingCompileTimeError
deferred_constraints_type_annotation_test/is_check: MissingCompileTimeError
@@ -323,7 +319,6 @@
field_override3_test/01: MissingCompileTimeError
field_override3_test/02: MissingCompileTimeError
field_override3_test/03: MissingCompileTimeError
-field_override4_test/02: MissingCompileTimeError
final_attempt_reinitialization_test/01: MissingCompileTimeError
final_attempt_reinitialization_test/02: MissingCompileTimeError
full_stacktrace1_test: RuntimeError # Issue 12698
@@ -335,7 +330,6 @@
generic_function_dcall_test: Crash # Unsupported operation: Unsupported type parameter type node T.
generic_tearoff_test: Crash # Unsupported operation: Unsupported type parameter type node T.
generic_typedef_test: RuntimeError
-getter_override2_test/02: MissingCompileTimeError
getter_override_test/00: MissingCompileTimeError
getter_override_test/01: MissingCompileTimeError
getter_override_test/02: MissingCompileTimeError
@@ -368,8 +362,6 @@
method_override7_test/00: MissingCompileTimeError
method_override7_test/01: MissingCompileTimeError
method_override7_test/02: MissingCompileTimeError
-method_override8_test/00: MissingCompileTimeError
-method_override8_test/01: MissingCompileTimeError
mint_arithmetic_test: RuntimeError # non JS number semantics
mixin_forwarding_constructor4_test/01: MissingCompileTimeError
mixin_forwarding_constructor4_test/02: MissingCompileTimeError
@@ -467,22 +459,9 @@
not_enough_positional_arguments_test/05: MissingCompileTimeError
not_enough_positional_arguments_test/06: MissingCompileTimeError
not_enough_positional_arguments_test/07: MissingCompileTimeError
-null_test/mirrors: RuntimeError
-null_test/none: RuntimeError
number_identity2_test: RuntimeError
numbers_test: RuntimeError, OK # non JS number semantics
-override_field_method1_negative_test: Fail
-override_field_method2_negative_test: Fail
-override_field_method4_negative_test: Fail
-override_field_method5_negative_test: Fail
override_field_test/01: MissingCompileTimeError
-override_inheritance_mixed_test/01: MissingCompileTimeError
-override_inheritance_mixed_test/02: MissingCompileTimeError
-override_inheritance_mixed_test/03: MissingCompileTimeError
-override_inheritance_mixed_test/04: MissingCompileTimeError
-override_inheritance_mixed_test/08: MissingCompileTimeError
-override_inheritance_mixed_test/09: MissingCompileTimeError
-override_method_with_field_test/01: MissingCompileTimeError
positional_parameters_type_test/01: MissingCompileTimeError
positional_parameters_type_test/02: MissingCompileTimeError
private_super_constructor_test/01: MissingCompileTimeError
@@ -532,11 +511,17 @@
type_variable_scope_test/03: Crash # Internal Error: Unexpected type variable in static context.
[ $compiler == dart2js && !$checked ]
+async_covariant_type_test: RuntimeError # checked / strong mode test
+async_dcall_type_test: RuntimeError # checked / strong mode test
+asyncstar_covariant_type_test: RuntimeError # checked / strong mode test
+asyncstar_dcall_type_test: RuntimeError # checked / strong mode test
covariance_field_test/01: RuntimeError
covariance_field_test/02: RuntimeError
covariance_field_test/03: RuntimeError
covariance_field_test/04: RuntimeError
covariance_field_test/05: RuntimeError
+syncstar_covariant_type_test: RuntimeError # checked / strong mode test
+syncstar_dcall_type_test: RuntimeError # checked / strong mode test
[ $compiler == dart2js && !$checked && !$enable_asserts ]
assertion_test: RuntimeError, OK
@@ -553,31 +538,8 @@
issue31596_test: RuntimeError
[ $compiler == dart2js && $fast_startup ]
-const_evaluation_test/*: Fail # mirrors not supported
-deferred_constraints_constants_test: Pass # mirrors not supported, passes for the wrong reason
-deferred_constraints_constants_test/none: Fail # mirrors not supported
-deferred_constraints_constants_test/reference_after_load: Fail # mirrors not supported
-enum_mirror_test: Fail # mirrors not supported
-field_increment_bailout_test: Fail # mirrors not supported
-instance_creation_in_function_annotation_test: Fail # mirrors not supported
-invocation_mirror2_test: Fail # mirrors not supported
-invocation_mirror_invoke_on2_test: Fail # mirrors not supported
-invocation_mirror_invoke_on_test: Fail # mirrors not supported
-issue21079_test: Fail # mirrors not supported
library_env_test/has_mirror_support: Fail # mirrors not supported
library_env_test/has_no_mirror_support: Pass # fails for the wrong reason.
-many_overridden_no_such_method_test: Fail # mirrors not supported
-no_such_method_test: Fail # mirrors not supported
-null_test/0*: Pass # mirrors not supported, fails for the wrong reason
-null_test/none: Fail # mirrors not supported
-overridden_no_such_method_test: Fail # mirrors not supported
-redirecting_factory_reflection_test: Fail # mirrors not supported
-regress_13462_0_test: Fail # mirrors not supported
-regress_13462_1_test: Fail # mirrors not supported
-regress_18535_test: Fail # mirrors not supported
-regress_28255_test: Fail # mirrors not supported
-super_call4_test: Fail # mirrors not supported
-super_getter_setter_test: CompileTimeError
vm/reflect_core_vm_test: Fail # mirrors not supported
[ $compiler == dart2js && $fast_startup && $fasta && $strong ]
@@ -593,8 +555,6 @@
async_star_test/05: RuntimeError
async_star_test/none: RuntimeError
bad_override_test/03: MissingCompileTimeError
-bad_override_test/04: MissingCompileTimeError
-bad_override_test/05: MissingCompileTimeError
bit_operations_test: RuntimeError
branch_canonicalization_test: RuntimeError
call_method_implicit_tear_off_implements_function_test/02: RuntimeError
@@ -641,9 +601,6 @@
cyclic_type_test/04: RuntimeError
cyclic_typedef_test/10: Crash # Crash when compiling file:///usr/local/google/home/sra/Dart/sdk/out/ReleaseX64/generated_tests/language_2/cyclic_typedef_test_10.dart,
cyclic_typedef_test/11: Crash # Crash when compiling file:///usr/local/google/home/sra/Dart/sdk/out/ReleaseX64/generated_tests/language_2/cyclic_typedef_test_11.dart,
-deferred_constraints_constants_test/default_argument2: Crash # Unsupported operation: KernelDeferredLoadTask.addMirrorElementsForLibrary
-deferred_constraints_constants_test/none: Crash # Unsupported operation: KernelDeferredLoadTask.addMirrorElementsForLibrary
-deferred_constraints_constants_test/reference_after_load: Crash # Unsupported operation: KernelDeferredLoadTask.addMirrorElementsForLibrary
deferred_inheritance_constraints_test/extends: MissingCompileTimeError
deferred_inheritance_constraints_test/implements: MissingCompileTimeError
deferred_inheritance_constraints_test/mixin: MissingCompileTimeError
@@ -668,14 +625,12 @@
f_bounded_quantification4_test: RuntimeError
fauxverride_test/03: MissingCompileTimeError
fauxverride_test/05: MissingCompileTimeError
-field_increment_bailout_test: RuntimeError
field_initialization_order_test/01: MissingCompileTimeError
field_initialization_order_test/none: RuntimeError
field_override3_test/00: MissingCompileTimeError
field_override3_test/01: MissingCompileTimeError
field_override3_test/02: MissingCompileTimeError
field_override3_test/03: MissingCompileTimeError
-field_override4_test/02: MissingCompileTimeError
flatten_test/05: MissingRuntimeError
flatten_test/08: MissingRuntimeError
flatten_test/09: MissingRuntimeError
@@ -714,7 +669,6 @@
generic_no_such_method_dispatcher_simple_test: CompileTimeError
generic_no_such_method_dispatcher_test: CompileTimeError
generic_tearoff_test: CompileTimeError
-getter_override2_test/02: MissingCompileTimeError
getter_override_test/00: MissingCompileTimeError
getter_override_test/01: MissingCompileTimeError
getter_override_test/02: MissingCompileTimeError
@@ -752,8 +706,6 @@
method_override7_test/00: MissingCompileTimeError
method_override7_test/01: MissingCompileTimeError
method_override7_test/02: MissingCompileTimeError
-method_override8_test/00: MissingCompileTimeError
-method_override8_test/01: MissingCompileTimeError
method_override_test: CompileTimeError
minify_closure_variable_collision_test: CompileTimeError
mint_arithmetic_test: RuntimeError # non JS number semantics
@@ -843,15 +795,9 @@
nosuchmethod_forwarding/nosuchmethod_forwarding_test/05: RuntimeError
nosuchmethod_forwarding/nosuchmethod_forwarding_test/06: RuntimeError
null_no_such_method_test: CompileTimeError
-null_test/mirrors: RuntimeError
-null_test/none: RuntimeError
number_identity2_test: RuntimeError
numbers_test: RuntimeError, OK # non JS number semantics
overridden_no_such_method_test: RuntimeError
-override_field_method1_negative_test: Fail
-override_field_method2_negative_test: Fail
-override_field_method4_negative_test: Fail
-override_field_method5_negative_test: Fail
override_field_test/01: MissingCompileTimeError
override_inheritance_field_test/04: CompileTimeError
override_inheritance_field_test/06: CompileTimeError
@@ -860,13 +806,6 @@
override_inheritance_generic_test/02: CompileTimeError
override_inheritance_method_test/28: CompileTimeError
override_inheritance_method_test/29: CompileTimeError
-override_inheritance_mixed_test/01: MissingCompileTimeError
-override_inheritance_mixed_test/02: MissingCompileTimeError
-override_inheritance_mixed_test/03: MissingCompileTimeError
-override_inheritance_mixed_test/04: MissingCompileTimeError
-override_inheritance_mixed_test/08: MissingCompileTimeError
-override_inheritance_mixed_test/09: MissingCompileTimeError
-override_method_with_field_test/01: MissingCompileTimeError
parser_quirks_test: CompileTimeError
redirecting_factory_default_values_test/01: MissingCompileTimeError
redirecting_factory_default_values_test/02: MissingCompileTimeError
@@ -998,8 +937,6 @@
bad_override_test/01: MissingCompileTimeError
bad_override_test/02: MissingCompileTimeError
bad_override_test/03: MissingCompileTimeError
-bad_override_test/04: MissingCompileTimeError
-bad_override_test/05: MissingCompileTimeError
bit_operations_test: RuntimeError
branch_canonicalization_test: RuntimeError
call_method_implicit_tear_off_implements_function_test/02: RuntimeError
@@ -1065,8 +1002,6 @@
cyclic_typedef_test/11: Crash # Stack Overflow
default_factory2_test/01: MissingCompileTimeError
default_factory_test/01: MissingCompileTimeError
-deferred_constraints_constants_test/none: RuntimeError
-deferred_constraints_constants_test/reference_after_load: RuntimeError
deferred_inheritance_constraints_test/extends: MissingCompileTimeError
deferred_inheritance_constraints_test/implements: MissingCompileTimeError
deferred_inheritance_constraints_test/mixin: MissingCompileTimeError
@@ -1096,14 +1031,12 @@
fauxverride_test/03: MissingCompileTimeError
fauxverride_test/05: MissingCompileTimeError
field3_test/01: MissingCompileTimeError
-field_increment_bailout_test: RuntimeError
field_initialization_order_test/01: MissingCompileTimeError
field_initialization_order_test/none: RuntimeError
field_override3_test/00: MissingCompileTimeError
field_override3_test/01: MissingCompileTimeError
field_override3_test/02: MissingCompileTimeError
field_override3_test/03: MissingCompileTimeError
-field_override4_test/02: MissingCompileTimeError
field_override_test/00: MissingCompileTimeError
field_override_test/01: MissingCompileTimeError
flatten_test/05: MissingRuntimeError
@@ -1124,6 +1057,7 @@
function_subtype_setter0_test: RuntimeError
function_type_alias2_test: RuntimeError
function_type_alias4_test: RuntimeError
+generic_async_star_test: RuntimeError
generic_closure_test/01: RuntimeError
generic_closure_test/none: RuntimeError
generic_function_bounds_test: RuntimeError
@@ -1147,7 +1081,6 @@
generic_no_such_method_dispatcher_simple_test: CompileTimeError
generic_no_such_method_dispatcher_test: CompileTimeError
generic_tearoff_test: CompileTimeError
-getter_override2_test/02: MissingCompileTimeError
getter_override_test/00: MissingCompileTimeError
getter_override_test/01: MissingCompileTimeError
getter_override_test/02: MissingCompileTimeError
@@ -1176,7 +1109,6 @@
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_mirror2_test: RuntimeError # mirrors not supported
invocation_mirror_invoke_on2_test: RuntimeError
invocation_mirror_invoke_on_test: RuntimeError
issue18628_2_test/01: MissingCompileTimeError
@@ -1210,7 +1142,6 @@
malbounded_type_test_test/00: MissingCompileTimeError
malbounded_type_test_test/01: MissingCompileTimeError
malbounded_type_test_test/02: MissingCompileTimeError
-many_overridden_no_such_method_test: RuntimeError
map_literal3_test/01: MissingCompileTimeError
map_literal3_test/02: MissingCompileTimeError
map_literal3_test/03: MissingCompileTimeError
@@ -1218,9 +1149,6 @@
method_override7_test/01: MissingCompileTimeError
method_override7_test/02: MissingCompileTimeError
method_override7_test/03: MissingCompileTimeError
-method_override8_test/00: MissingCompileTimeError
-method_override8_test/01: MissingCompileTimeError
-method_override8_test/03: MissingCompileTimeError
method_override_test: CompileTimeError
minify_closure_variable_collision_test: CompileTimeError
mint_arithmetic_test: RuntimeError # non JS number semantics
@@ -1333,21 +1261,13 @@
nested_generic_closure_test: RuntimeError
no_main_test/01: CompileTimeError
no_such_method_mock_test: RuntimeError
-no_such_method_test: RuntimeError
nosuchmethod_forwarding/nosuchmethod_forwarding_arguments_test: RuntimeError
nosuchmethod_forwarding/nosuchmethod_forwarding_test/05: RuntimeError
nosuchmethod_forwarding/nosuchmethod_forwarding_test/06: RuntimeError
null_no_such_method_test: CompileTimeError
-null_test/mirrors: RuntimeError
-null_test/none: RuntimeError
number_identity2_test: RuntimeError
numbers_test: RuntimeError, OK # non JS number semantics
operator2_negative_test: Crash # 'file:*/pkg/compiler/lib/src/kernel/env.dart': Failed assertion: line 322 pos 16: '!name.contains('#')': is not true.
-overridden_no_such_method_test: RuntimeError
-override_field_method1_negative_test: Fail
-override_field_method2_negative_test: Fail
-override_field_method4_negative_test: Fail
-override_field_method5_negative_test: Fail
override_field_test/01: MissingCompileTimeError
override_field_test/02: MissingCompileTimeError
override_field_test/03: MissingCompileTimeError
@@ -1363,13 +1283,6 @@
override_inheritance_generic_test/02: CompileTimeError
override_inheritance_method_test/28: CompileTimeError
override_inheritance_method_test/29: CompileTimeError
-override_inheritance_mixed_test/01: MissingCompileTimeError
-override_inheritance_mixed_test/02: MissingCompileTimeError
-override_inheritance_mixed_test/03: MissingCompileTimeError
-override_inheritance_mixed_test/04: MissingCompileTimeError
-override_inheritance_mixed_test/08: MissingCompileTimeError
-override_inheritance_mixed_test/09: MissingCompileTimeError
-override_method_with_field_test/01: MissingCompileTimeError
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)
@@ -1409,8 +1322,6 @@
string_split_test: CompileTimeError
string_supertype_checked_test: CompileTimeError
super_bound_closure_test/none: CompileTimeError
-super_call4_test: CompileTimeError
-super_getter_setter_test: CompileTimeError
super_no_such_method1_test: CompileTimeError
super_no_such_method2_test: CompileTimeError
super_no_such_method3_test: CompileTimeError
@@ -1583,8 +1494,6 @@
bad_override_test/01: MissingCompileTimeError
bad_override_test/02: MissingCompileTimeError
bad_override_test/03: MissingCompileTimeError
-bad_override_test/04: MissingCompileTimeError
-bad_override_test/05: MissingCompileTimeError
bit_operations_test: RuntimeError
branch_canonicalization_test: RuntimeError
call_method_implicit_tear_off_implements_function_test/02: RuntimeError
@@ -1646,8 +1555,6 @@
cyclic_typedef_test/11: Crash # Stack Overflow
default_factory2_test/01: MissingCompileTimeError
default_factory_test/01: MissingCompileTimeError
-deferred_constraints_constants_test/none: RuntimeError
-deferred_constraints_constants_test/reference_after_load: RuntimeError
deferred_inheritance_constraints_test/extends: MissingCompileTimeError
deferred_inheritance_constraints_test/implements: MissingCompileTimeError
deferred_inheritance_constraints_test/mixin: MissingCompileTimeError
@@ -1677,14 +1584,12 @@
fauxverride_test/03: MissingCompileTimeError
fauxverride_test/05: MissingCompileTimeError
field3_test/01: MissingCompileTimeError
-field_increment_bailout_test: RuntimeError
field_initialization_order_test/01: MissingCompileTimeError
field_initialization_order_test/none: RuntimeError
field_override3_test/00: MissingCompileTimeError
field_override3_test/01: MissingCompileTimeError
field_override3_test/02: MissingCompileTimeError
field_override3_test/03: MissingCompileTimeError
-field_override4_test/02: MissingCompileTimeError
field_override_test/00: MissingCompileTimeError
field_override_test/01: MissingCompileTimeError
flatten_test/05: MissingRuntimeError
@@ -1705,6 +1610,7 @@
function_subtype_setter0_test: RuntimeError
function_type_alias2_test: RuntimeError
function_type_alias4_test: RuntimeError
+generic_async_star_test: RuntimeError
generic_function_bounds_test: RuntimeError
generic_function_dcall_test: RuntimeError
generic_function_type_as_type_argument_test/01: MissingCompileTimeError
@@ -1726,7 +1632,6 @@
generic_no_such_method_dispatcher_simple_test: CompileTimeError
generic_no_such_method_dispatcher_test: CompileTimeError
generic_tearoff_test: CompileTimeError
-getter_override2_test/02: MissingCompileTimeError
getter_override_test/00: MissingCompileTimeError
getter_override_test/01: MissingCompileTimeError
getter_override_test/02: MissingCompileTimeError
@@ -1797,9 +1702,6 @@
method_override7_test/01: MissingCompileTimeError
method_override7_test/02: MissingCompileTimeError
method_override7_test/03: MissingCompileTimeError
-method_override8_test/00: MissingCompileTimeError
-method_override8_test/01: MissingCompileTimeError
-method_override8_test/03: MissingCompileTimeError
method_override_test: CompileTimeError
minify_closure_variable_collision_test: CompileTimeError
mint_arithmetic_test: RuntimeError # non JS number semantics
@@ -1921,15 +1823,9 @@
nosuchmethod_forwarding/nosuchmethod_forwarding_test/05: RuntimeError
nosuchmethod_forwarding/nosuchmethod_forwarding_test/06: RuntimeError
null_no_such_method_test: CompileTimeError
-null_test/mirrors: RuntimeError
-null_test/none: RuntimeError
number_identity2_test: RuntimeError
numbers_test: RuntimeError, OK # non JS number semantics
overridden_no_such_method_test: RuntimeError
-override_field_method1_negative_test: Fail
-override_field_method2_negative_test: Fail
-override_field_method4_negative_test: Fail
-override_field_method5_negative_test: Fail
override_field_test/01: MissingCompileTimeError
override_field_test/02: MissingCompileTimeError
override_field_test/03: MissingCompileTimeError
@@ -1945,13 +1841,6 @@
override_inheritance_generic_test/02: CompileTimeError
override_inheritance_method_test/28: CompileTimeError
override_inheritance_method_test/29: CompileTimeError
-override_inheritance_mixed_test/01: MissingCompileTimeError
-override_inheritance_mixed_test/02: MissingCompileTimeError
-override_inheritance_mixed_test/03: MissingCompileTimeError
-override_inheritance_mixed_test/04: MissingCompileTimeError
-override_inheritance_mixed_test/08: MissingCompileTimeError
-override_inheritance_mixed_test/09: MissingCompileTimeError
-override_method_with_field_test/01: MissingCompileTimeError
parser_quirks_test: CompileTimeError
recursive_generic_test: RuntimeError
redirecting_factory_default_values_test/01: MissingCompileTimeError
@@ -1990,8 +1879,6 @@
string_split_test: CompileTimeError
string_supertype_checked_test: CompileTimeError
super_bound_closure_test/none: CompileTimeError
-super_call4_test: CompileTimeError
-super_getter_setter_test: CompileTimeError
super_no_such_method1_test: CompileTimeError
super_no_such_method2_test: CompileTimeError
super_no_such_method3_test: CompileTimeError
diff --git a/tests/language_2/language_2_dartdevc.status b/tests/language_2/language_2_dartdevc.status
index ed5dedb..96bed6a 100644
--- a/tests/language_2/language_2_dartdevc.status
+++ b/tests/language_2/language_2_dartdevc.status
@@ -152,12 +152,13 @@
regress_30121_test: CompileTimeError # Issue 31087
regress_30339_test: CompileTimeError # As expected. Should we make this a multi test?
reify_typevar_static_test/00: MissingCompileTimeError # Issue 29920
+setter_override2_test/02: MissingCompileTimeError # Issue 14736
stacktrace_test: RuntimeError # Issue 29920
string_interpolate_test: CompileTimeError
string_split_test: CompileTimeError
string_supertype_checked_test: CompileTimeError
super_bound_closure_test/none: CompileTimeError
-super_call4_test: RuntimeError
+super_call4_test/01: MissingCompileTimeError
super_no_such_method1_test: RuntimeError
super_no_such_method2_test: RuntimeError
super_no_such_method3_test: RuntimeError
@@ -294,8 +295,6 @@
bad_override_test/01: MissingCompileTimeError
bad_override_test/02: MissingCompileTimeError
bad_override_test/03: MissingCompileTimeError
-bad_override_test/04: MissingCompileTimeError
-bad_override_test/05: MissingCompileTimeError
built_in_identifier_type_annotation_test/05: RuntimeError # Issue 32194
built_in_identifier_type_annotation_test/none: RuntimeError # Issue 32194
call_method_as_cast_test/06: RuntimeError # Kernel allows classes to subtype `Function` so DDK elides the explicit cast.
@@ -378,7 +377,6 @@
field_override3_test/01: MissingCompileTimeError
field_override3_test/02: MissingCompileTimeError
field_override3_test/03: MissingCompileTimeError
-field_override4_test/02: MissingCompileTimeError
field_override_test/00: MissingCompileTimeError
field_override_test/01: MissingCompileTimeError
function_propagation_test: RuntimeError
@@ -390,7 +388,6 @@
generic_no_such_method_dispatcher_simple_test: CompileTimeError # Warning: Superclass has no method named 'foo'.
generic_no_such_method_dispatcher_test: CompileTimeError # Issue 31533
generic_test/01: MissingCompileTimeError # front end does not validate `extends`
-getter_override2_test/02: MissingCompileTimeError
getter_override_test/00: MissingCompileTimeError
getter_override_test/01: MissingCompileTimeError
getter_override_test/02: MissingCompileTimeError
@@ -443,9 +440,6 @@
method_override7_test/00: MissingCompileTimeError
method_override7_test/01: MissingCompileTimeError
method_override7_test/02: MissingCompileTimeError
-method_override8_test/00: MissingCompileTimeError
-method_override8_test/01: MissingCompileTimeError
-method_override8_test/03: MissingCompileTimeError
method_override_test: CompileTimeError # Issue 31616
mixin_forwarding_constructor4_test/01: MissingCompileTimeError
mixin_forwarding_constructor4_test/02: MissingCompileTimeError
@@ -530,10 +524,6 @@
null_no_such_method_test: CompileTimeError # Issue 31533
null_test/none: RuntimeError # Issue 32194
null_to_string_test: RuntimeError # Issue 32194
-override_field_method1_negative_test: Fail
-override_field_method2_negative_test: Fail
-override_field_method4_negative_test: Fail
-override_field_method5_negative_test: Fail
override_field_test/01: MissingCompileTimeError
override_field_test/02: MissingCompileTimeError
override_inheritance_field_test/04: CompileTimeError # Issue 31616
@@ -548,13 +538,6 @@
override_inheritance_generic_test/02: CompileTimeError # Issue 31616
override_inheritance_method_test/28: CompileTimeError # Issue 31616
override_inheritance_method_test/29: CompileTimeError # Issue 31616
-override_inheritance_mixed_test/01: MissingCompileTimeError
-override_inheritance_mixed_test/02: MissingCompileTimeError
-override_inheritance_mixed_test/03: MissingCompileTimeError
-override_inheritance_mixed_test/04: MissingCompileTimeError
-override_inheritance_mixed_test/08: MissingCompileTimeError
-override_inheritance_mixed_test/09: MissingCompileTimeError
-override_method_with_field_test/01: MissingCompileTimeError
redirecting_factory_default_values_test/01: MissingCompileTimeError
redirecting_factory_default_values_test/02: MissingCompileTimeError
redirecting_factory_infinite_steps_test/01: MissingCompileTimeError
@@ -580,8 +563,6 @@
string_split_test: CompileTimeError # Issue 31616
string_supertype_checked_test: CompileTimeError # Issue 31616
super_bound_closure_test/none: CompileTimeError # Issue 31533
-super_call4_test: CompileTimeError
-super_getter_setter_test: CompileTimeError
super_no_such_method1_test: CompileTimeError
super_no_such_method2_test: CompileTimeError
super_no_such_method3_test: CompileTimeError
@@ -640,9 +621,11 @@
[ $compiler == dartdevc || $compiler == dartdevk ]
abstract_override_adds_optional_args_concrete_subclass_test: MissingCompileTimeError # Issue #30568
abstract_override_adds_optional_args_concrete_test: MissingCompileTimeError # Issue #30568
+async_covariant_type_test: RuntimeError # Check too late
async_star_cancel_while_paused_test: RuntimeError # Issue 29920; Uncaught Expect.listEquals(list length, expected: <4>, actual: <3>) fails: Next element <*3>
async_star_pause_test: RuntimeError # Uncaught Expect.listEquals(at index 2, expected: <0+>, actual: <0!>) fails
async_star_test/02: RuntimeError
+asyncstar_covariant_type_test: RuntimeError # Check too late
asyncstar_throw_in_catch_test: Skip # Times out. Issue 29920
bit_operations_test: RuntimeError # No bigints on web.; Expect.equals(expected: <-25>, actual: <4294967271>) fails.
bit_operations_test/01: MissingCompileTimeError
@@ -681,7 +664,6 @@
expect_test: RuntimeError # Issue 29920; Expect.identical did not fail
f_bounded_quantification3_test: RuntimeError # Issue 29920; Uncaught Error: type arguments should not be null: (F1, F2) => {
field3_test/01: MissingCompileTimeError
-field_increment_bailout_test: RuntimeError # Issue 29920; UnimplementedError: JsInstanceMirror.delegate unimplemented
field_initialization_order_test/none: RuntimeError # Expect.equals(expected: <b.a.ai.bi.>, actual: <b.bi.a.ai.>) fails.
flatten_test/05: MissingRuntimeError # Issue 29920
flatten_test/08: MissingRuntimeError # Issue 29920
@@ -702,21 +684,18 @@
int64_literal_test/*: Skip # This is testing Dart 2.0 int64 semantics.
integer_division_by_zero_test: RuntimeError # Issue 29920; Expect.throws: Unexpected 'Unsupported operation: Infinity'
internal_library_test/02: Crash
-invocation_mirror2_test: RuntimeError # UnimplementedError: JsInstanceMirror.delegate unimplemented
invocation_mirror_invoke_on2_test: RuntimeError # UnimplementedError: JsInstanceMirror.delegate unimplemented
invocation_mirror_invoke_on_test: RuntimeError # UnimplementedError: JsInstanceMirror.delegate unimplemented
invocation_mirror_test: RuntimeError # Type 'NativeJavaScriptObject' is not a subtype of type 'int' in strong mode
-issue21159_test: RuntimeError # Issue 30701; TypeError: method.bind is not a function
issue23244_test: RuntimeError # Issue 29920; Uncaught Unsupported operation: only top-level functions can be spawned.
least_upper_bound_expansive_test/none: RuntimeError # 30908; Uncaught RangeError: Maximum call stack size exceeded
left_shift_test: RuntimeError # Ints and doubles are unified.; Expect.equals(expected: <1>, actual: <-4294967295>) fails.
library_env_test/has_io_support: RuntimeError, OK # Intended to fail, bool.fromEnvironment("dart.library.async") is false
-library_env_test/has_mirror_support: RuntimeError, OK # Intended to fail, bool.fromEnvironment("dart.library.async") is false
-library_env_test/has_no_html_support: RuntimeError, OK # Intended to fail, bool.fromEnvironment("dart.library.async") is false
+library_env_test/has_mirror_support: RuntimeError, OK # Intended to fail, bool.fromEnvironment("dart.library.async") is false
+library_env_test/has_no_html_support: RuntimeError, OK # Intended to fail, bool.fromEnvironment("dart.library.async") is false
local_function2_test/none: RuntimeError # ReferenceError: TToNull is not defined
local_function3_test/none: RuntimeError # Expect.equals(expected: <true>, actual: <false>) fails.
local_function_test/none: RuntimeError # Expect.equals(expected: <true>, actual: <false>) fails.
-many_overridden_no_such_method_test: RuntimeError # UnimplementedError: JsInstanceMirror.delegate unimplemented; UnimplementedError: JsInstanceMirror.delegate unimplemented
method_override7_test/03: MissingCompileTimeError # Issue 30514
mint_arithmetic_test: RuntimeError # Issue 29920; Expect.equals(expected: <4294967297>, actual: <1>) fails.
modulo_test: RuntimeError # Ints and doubles are unified.; Expect.throws fails: Did not throw
@@ -727,14 +706,11 @@
named_parameters_default_eq_test/none: RuntimeError # Expect.isTrue(false) fails.
nan_identical_test: RuntimeError # Issue 29920; Unsupported operation: Uint64 accessor not supported by dart2js.
nested_switch_label_test: RuntimeError # Issue 29920; UnimplementedError: node <ShadowContinueSwitchStatement> see https://github.com/dart-lang/sdk/issues/29352 `continue #L1;
-no_such_method_test: RuntimeError # UnimplementedError: JsInstanceMirror.delegate unimplemented
null_test/mirrors: RuntimeError # Uses mirrors.; ReferenceError: GenericOfT is not defined
number_identity2_test: RuntimeError # Issue 29920; Expect.isTrue(false) fails.
numbers_test: RuntimeError # Issue 29920; Expect.equals(expected: <false>, actual: <true>) fails.
-overridden_no_such_method_test: RuntimeError # UnimplementedError: JsInstanceMirror.delegate unimplemented; UnimplementedError: JsInstanceMirror.delegate unimplemented
override_field_test/03: MissingCompileTimeError
parser_quirks_test: CompileTimeError
-private3_test: RuntimeError # Type 'PrivateSymbol' is not a subtype of type 'Symbol' in strong mode
regress_16640_test: RuntimeError # Issue 29920; Uncaught Error: type arguments should not be null: E => {
regress_22443_test: RuntimeError # Uncaught Expect.isTrue(false) fails.
regress_27617_test/1: MissingCompileTimeError
@@ -748,6 +724,7 @@
switch_label2_test: RuntimeError # Issue 29920; UnimplementedError: node <ShadowContinueSwitchStatement> see https://github.com/dart-lang/sdk/issues/29352 `continue #L1;
switch_label_test: RuntimeError # Issue 29920; UnimplementedError: node <ShadowContinueSwitchStatement> see https://github.com/dart-lang/sdk/issues/29352 `continue #L1;
switch_try_catch_test: RuntimeError # Issue 29920; Expect.throws: Unexpected 'UnimplementedError: node <ShadowContinueSwitchStatement> see https://github.com/dart-lang/sdk/issues/29352 `continue #L1;
+syncstar_covariant_type_test: RuntimeError # Check too late
syntax_test/60: MissingCompileTimeError
syntax_test/61: MissingCompileTimeError
truncdiv_test: RuntimeError # Issue 29920; Expect.throws fails: Did not throw
diff --git a/tests/language_2/language_2_kernel.status b/tests/language_2/language_2_kernel.status
index b58c2c8..6dc969f 100644
--- a/tests/language_2/language_2_kernel.status
+++ b/tests/language_2/language_2_kernel.status
@@ -129,7 +129,6 @@
malbounded_type_test_test/01: MissingCompileTimeError
malbounded_type_test_test/02: MissingCompileTimeError
method_override7_test/03: MissingCompileTimeError
-method_override8_test/03: MissingCompileTimeError
mixin_forwarding_constructor4_test/01: MissingCompileTimeError # KernelVM bug: Issue 15101
mixin_forwarding_constructor4_test/02: MissingCompileTimeError # KernelVM bug: Issue 15101
mixin_forwarding_constructor4_test/03: MissingCompileTimeError # KernelVM bug: Issue 15101
@@ -171,8 +170,6 @@
override_inheritance_field_test/48: MissingCompileTimeError
override_inheritance_field_test/53: MissingCompileTimeError
override_inheritance_field_test/54: MissingCompileTimeError
-override_inheritance_mixed_test/07: MissingCompileTimeError # Issue 32613
-override_inheritance_mixed_test/09: MissingCompileTimeError
partial_tearoff_instantiation_test/05: MissingCompileTimeError
partial_tearoff_instantiation_test/06: MissingCompileTimeError
partial_tearoff_instantiation_test/07: MissingCompileTimeError
@@ -665,8 +662,6 @@
string_split_test: CompileTimeError # Issue 31616
string_supertype_checked_test: CompileTimeError # Issue 31616
super_bound_closure_test/none: CompileTimeError # Issue 31533
-super_call4_test: CompileTimeError
-super_getter_setter_test: CompileTimeError
super_no_such_method1_test: CompileTimeError
super_no_such_method2_test: CompileTimeError
super_no_such_method3_test: CompileTimeError
@@ -727,7 +722,6 @@
[ $compiler == dartkp && $mode == debug && $runtime == dart_precompiled && $strong ]
const_instance_field_test/01: Crash # Issue 32326.
external_test/13: Crash
-extract_type_arguments_test: Crash # Issue 33029
type_promotion_functions_test/05: Pass
type_promotion_functions_test/06: Pass
type_promotion_functions_test/07: Pass
@@ -854,8 +848,6 @@
async_star_pause_test: Fail, OK
async_star_test/02: RuntimeError, CompileTimeError # Issue 31402 (Invocation arguments)
bad_override_test/03: MissingCompileTimeError # Issue 32613: override check is missing in CFE.
-bad_override_test/04: MissingCompileTimeError # Issue 32613: override check is missing in CFE.
-bad_override_test/05: MissingCompileTimeError # Issue 32613: override check is missing in CFE.
built_in_identifier_prefix_test: CompileTimeError
call_method_implicit_tear_off_implements_function_test/05: RuntimeError
call_method_implicit_tear_off_implements_function_test/06: RuntimeError
@@ -895,10 +887,6 @@
deep_nesting1_negative_test: Skip # Issue 31158
deep_nesting2_negative_test: Skip # Issue 31158
deferred_call_empty_before_load_test: RuntimeError # Fasta/KernelVM bug: Deferred loading kernel issue 30273.
-deferred_constraints_constants_test: SkipByDesign
-deferred_constraints_constants_test/default_argument2: Pass # Passes by mistake. KernelVM bug: Deferred loading kernel issue 30273.
-deferred_constraints_constants_test/none: CompileTimeError # KernelVM bug: Deferred loading kernel issue 30273.
-deferred_constraints_constants_test/reference_after_load: CompileTimeError # KernelVM bug: Deferred loading kernel issue 30273.
deferred_load_constants_test/none: RuntimeError # KernelVM bug: Deferred loading kernel issue 30273.
deferred_load_library_wrong_args_test/01: Pass # Passes by mistake. KernelVM bug: Deferred loading kernel issue 30273.
deferred_not_loaded_check_test: RuntimeError # Fasta/KernelVM bug: Deferred loading kernel issue 30273.
@@ -923,7 +911,6 @@
field_override3_test/01: MissingCompileTimeError # Issue 32613: override check is missing in CFE.
field_override3_test/02: MissingCompileTimeError # Issue 32613: override check is missing in CFE.
field_override3_test/03: MissingCompileTimeError # Issue 32613: override check is missing in CFE.
-field_override4_test/02: MissingCompileTimeError # Issue 32613: override check is missing in CFE.
flatten_test/05: MissingRuntimeError
flatten_test/08: MissingRuntimeError
flatten_test/09: MissingRuntimeError
@@ -940,7 +927,6 @@
generic_no_such_method_dispatcher_simple_test: CompileTimeError # Issue 31533
generic_no_such_method_dispatcher_test: CompileTimeError # Issue 31533
generic_tearoff_test: CompileTimeError
-getter_override2_test/02: MissingCompileTimeError # Issue 32613: override check is missing in CFE.
getter_override_test/00: MissingCompileTimeError # Issue 32613: override check is missing in CFE.
getter_override_test/01: MissingCompileTimeError # Issue 32613: override check is missing in CFE.
getter_override_test/02: MissingCompileTimeError # Issue 32613: override check is missing in CFE.
@@ -1003,7 +989,6 @@
method_override7_test/00: MissingCompileTimeError # Issue 32613: override check is missing in CFE.
method_override7_test/01: MissingCompileTimeError # Issue 32613: override check is missing in CFE.
method_override7_test/02: MissingCompileTimeError # Issue 32613: override check is missing in CFE.
-method_override8_test/01: MissingCompileTimeError # Issue 32613: override check is missing in CFE.
method_override_test: CompileTimeError # Issue 31616
mixin_illegal_super_use_test: Skip # Issues 24478 and 23773
mixin_illegal_superclass_test: Skip # Issues 24478 and 23773
@@ -1017,9 +1002,6 @@
null_test/mirrors: Skip # Uses mirrors.
null_test/none: SkipByDesign
overridden_no_such_method_test: SkipByDesign
-override_field_method2_negative_test: Fail # Issue 32613: override check is missing in CFE.
-override_field_method4_negative_test: Fail # Issue 32613: override check is missing in CFE.
-override_field_method5_negative_test: Fail # Issue 32613: override check is missing in CFE.
override_field_test/01: MissingCompileTimeError # Issue 32613: override check is missing in CFE.
override_inheritance_field_test/04: CompileTimeError # Issue 31616
override_inheritance_field_test/06: CompileTimeError # Issue 31616
@@ -1028,12 +1010,6 @@
override_inheritance_generic_test/02: CompileTimeError
override_inheritance_method_test/28: CompileTimeError
override_inheritance_method_test/29: CompileTimeError
-override_inheritance_mixed_test/01: MissingCompileTimeError # Issue 32613: override check is missing in CFE.
-override_inheritance_mixed_test/02: MissingCompileTimeError # Issue 32613: override check is missing in CFE.
-override_inheritance_mixed_test/03: MissingCompileTimeError # Issue 32613: override check is missing in CFE.
-override_inheritance_mixed_test/04: MissingCompileTimeError # Issue 32613: override check is missing in CFE.
-override_inheritance_mixed_test/08: MissingCompileTimeError # Issue 32613: override check is missing in CFE.
-override_inheritance_mixed_test/08: Pass # Correctly passes.
parser_quirks_test: CompileTimeError # Issue 31533
redirecting_factory_infinite_steps_test/01: MissingCompileTimeError
redirecting_factory_malbounded_test/01: MissingCompileTimeError
@@ -1058,8 +1034,6 @@
string_split_test: CompileTimeError # Issue 31616
string_supertype_checked_test: CompileTimeError # Issue 31616
super_bound_closure_test/none: CompileTimeError # Issue 31533
-super_call4_test: CompileTimeError
-super_getter_setter_test: CompileTimeError
super_no_such_method1_test: CompileTimeError
super_no_such_method2_test: CompileTimeError
super_no_such_method3_test: CompileTimeError
@@ -1131,8 +1105,6 @@
[ $compiler == fasta && $strong ]
bad_override_test/03: MissingCompileTimeError
-bad_override_test/04: MissingCompileTimeError
-bad_override_test/05: MissingCompileTimeError
check_member_static_test/02: MissingCompileTimeError
class_cycle_test/02: MissingCompileTimeError
class_cycle_test/03: MissingCompileTimeError
@@ -1165,14 +1137,12 @@
field_override3_test/01: MissingCompileTimeError
field_override3_test/02: MissingCompileTimeError
field_override3_test/03: MissingCompileTimeError
-field_override4_test/02: MissingCompileTimeError
generic_function_type_as_type_argument_test/01: MissingCompileTimeError
generic_function_type_as_type_argument_test/02: MissingCompileTimeError
generic_methods_generic_function_result_test/01: MissingCompileTimeError
generic_no_such_method_dispatcher_simple_test: CompileTimeError
generic_no_such_method_dispatcher_test: CompileTimeError
generic_tearoff_test: CompileTimeError
-getter_override2_test/02: MissingCompileTimeError
getter_override_test/00: MissingCompileTimeError
getter_override_test/01: MissingCompileTimeError
getter_override_test/02: MissingCompileTimeError
@@ -1182,8 +1152,6 @@
method_override7_test/00: MissingCompileTimeError
method_override7_test/01: MissingCompileTimeError
method_override7_test/02: MissingCompileTimeError
-method_override8_test/00: MissingCompileTimeError
-method_override8_test/01: MissingCompileTimeError
method_override_test: CompileTimeError
mixin_illegal_super_use_test/01: MissingCompileTimeError
mixin_illegal_super_use_test/04: MissingCompileTimeError
@@ -1227,10 +1195,6 @@
multiline_newline_test/06: MissingCompileTimeError
multiline_newline_test/06r: MissingCompileTimeError
null_no_such_method_test: CompileTimeError
-override_field_method1_negative_test: Fail
-override_field_method2_negative_test: Fail
-override_field_method4_negative_test: Fail
-override_field_method5_negative_test: Fail
override_field_test/01: MissingCompileTimeError
override_inheritance_field_test/04: CompileTimeError
override_inheritance_field_test/06: CompileTimeError
@@ -1239,12 +1203,6 @@
override_inheritance_generic_test/02: CompileTimeError
override_inheritance_method_test/28: CompileTimeError
override_inheritance_method_test/29: CompileTimeError
-override_inheritance_mixed_test/01: MissingCompileTimeError
-override_inheritance_mixed_test/02: MissingCompileTimeError
-override_inheritance_mixed_test/03: MissingCompileTimeError
-override_inheritance_mixed_test/04: MissingCompileTimeError
-override_inheritance_mixed_test/08: MissingCompileTimeError
-override_method_with_field_test/01: MissingCompileTimeError
parser_quirks_test: CompileTimeError
regress_23089_test: Crash
regress_23408_test: CompileTimeError
@@ -1258,8 +1216,6 @@
string_split_test: CompileTimeError
string_supertype_checked_test: CompileTimeError
super_bound_closure_test/none: CompileTimeError
-super_call4_test: CompileTimeError
-super_getter_setter_test: CompileTimeError
super_no_such_method1_test: CompileTimeError
super_no_such_method2_test: CompileTimeError
super_no_such_method3_test: CompileTimeError
@@ -1285,14 +1241,22 @@
abstract_factory_constructor_test/00: MissingCompileTimeError
abstract_getter_test/01: MissingCompileTimeError
abstract_syntax_test/00: MissingCompileTimeError
+bad_override_test/04: MissingCompileTimeError
+bad_override_test/05: MissingCompileTimeError
+bug32305_test: MissingCompileTimeError
call_method_implicit_invoke_local_test/05: MissingCompileTimeError
closure_invoked_through_interface_target_field_test: MissingCompileTimeError
closure_invoked_through_interface_target_getter_test: MissingCompileTimeError
factory2_test/03: MissingCompileTimeError
+field_override4_test/02: MissingCompileTimeError
+getter_override2_test/02: MissingCompileTimeError
implicit_this_test/01: MissingCompileTimeError
implicit_this_test/04: MissingCompileTimeError
invalid_override_in_mixin_test/01: MissingCompileTimeError
map_literal1_test/01: MissingCompileTimeError
+method_override8_test/00: MissingCompileTimeError
+method_override8_test/01: MissingCompileTimeError
+method_override8_test/03: MissingCompileTimeError
mixin_of_mixin_test/01: MissingCompileTimeError
mixin_of_mixin_test/02: MissingCompileTimeError
mixin_of_mixin_test/03: MissingCompileTimeError
@@ -1300,8 +1264,18 @@
mixin_of_mixin_test/05: MissingCompileTimeError
mixin_of_mixin_test/06: MissingCompileTimeError
nsm5_test: MissingCompileTimeError
+override_field_method1_negative_test: Fail
+override_field_method2_negative_test: Fail
+override_field_method4_negative_test: Fail
+override_field_method5_negative_test: Fail
+override_inheritance_mixed_test/01: MissingCompileTimeError
+override_inheritance_mixed_test/02: MissingCompileTimeError
+override_inheritance_mixed_test/03: MissingCompileTimeError
+override_inheritance_mixed_test/04: MissingCompileTimeError
override_inheritance_mixed_test/06: MissingCompileTimeError
override_inheritance_mixed_test/07: MissingCompileTimeError
+override_inheritance_mixed_test/08: MissingCompileTimeError
+override_inheritance_mixed_test/09: MissingCompileTimeError
override_inheritance_no_such_method_test/01: MissingCompileTimeError
override_inheritance_no_such_method_test/05: MissingCompileTimeError
override_inheritance_no_such_method_test/06: MissingCompileTimeError
@@ -1309,6 +1283,7 @@
override_inheritance_no_such_method_test/09: MissingCompileTimeError
override_inheritance_no_such_method_test/10: MissingCompileTimeError
override_inheritance_no_such_method_test/12: MissingCompileTimeError
+override_method_with_field_test/01: MissingCompileTimeError
prefix_import_collision_test/01: MissingCompileTimeError
prefix_shadow_test/01: MissingCompileTimeError
prefix_shadow_test/02: MissingCompileTimeError
@@ -1317,6 +1292,7 @@
prefix_transitive_import_prefix_test/03: MissingCompileTimeError
prefix_transitive_import_test/01: MissingCompileTimeError
prefix_transitive_import_test/02: MissingCompileTimeError
+setter_override2_test/02: MissingCompileTimeError
variable_shadow_class_test/01: MissingCompileTimeError
[ $fasta && $strong ]
@@ -1378,8 +1354,6 @@
bad_named_parameters_test/04: MissingCompileTimeError
bad_named_parameters_test/05: MissingCompileTimeError
bad_override_test/03: MissingCompileTimeError
-bad_override_test/04: MissingCompileTimeError
-bad_override_test/05: MissingCompileTimeError
bad_override_test/06: MissingCompileTimeError
built_in_identifier_type_annotation_test/22: MissingCompileTimeError
call_constructor_on_unresolvable_class_test/01: MissingCompileTimeError
@@ -1572,7 +1546,6 @@
field_override3_test/01: MissingCompileTimeError
field_override3_test/02: MissingCompileTimeError
field_override3_test/03: MissingCompileTimeError
-field_override4_test/02: MissingCompileTimeError
field_override_test/02: MissingCompileTimeError
field_override_test/none: MissingCompileTimeError
field_type_check_test/01: MissingCompileTimeError
@@ -1622,7 +1595,6 @@
getter_no_setter_test/00: MissingCompileTimeError
getter_no_setter_test/01: MissingCompileTimeError
getter_no_setter_test/03: MissingCompileTimeError
-getter_override2_test/02: MissingCompileTimeError
getter_override_test/00: MissingCompileTimeError
getter_override_test/01: MissingCompileTimeError
getter_override_test/02: MissingCompileTimeError
@@ -1782,8 +1754,6 @@
method_override7_test/00: MissingCompileTimeError
method_override7_test/01: MissingCompileTimeError
method_override7_test/02: MissingCompileTimeError
-method_override8_test/00: MissingCompileTimeError
-method_override8_test/01: MissingCompileTimeError
mixin_illegal_constructor_test/13: MissingCompileTimeError
mixin_illegal_constructor_test/14: MissingCompileTimeError
mixin_illegal_constructor_test/15: MissingCompileTimeError
@@ -1896,10 +1866,6 @@
optional_named_parameters_test/07: MissingCompileTimeError
optional_named_parameters_test/08: MissingCompileTimeError
optional_named_parameters_test/09: MissingCompileTimeError
-override_field_method1_negative_test: Fail
-override_field_method2_negative_test: Fail
-override_field_method4_negative_test: Fail
-override_field_method5_negative_test: Fail
override_field_test/01: MissingCompileTimeError
override_inheritance_abstract_test/*: Skip # Tests Dart 2 semantics
override_inheritance_field_test/05: MissingCompileTimeError
@@ -1936,12 +1902,6 @@
override_inheritance_method_test/31: MissingCompileTimeError
override_inheritance_method_test/32: MissingCompileTimeError
override_inheritance_method_test/33: MissingCompileTimeError
-override_inheritance_mixed_test/01: MissingCompileTimeError
-override_inheritance_mixed_test/02: MissingCompileTimeError
-override_inheritance_mixed_test/03: MissingCompileTimeError
-override_inheritance_mixed_test/04: MissingCompileTimeError
-override_inheritance_mixed_test/08: MissingCompileTimeError
-override_method_with_field_test/01: MissingCompileTimeError
override_method_with_field_test/02: MissingCompileTimeError
part2_test/01: MissingCompileTimeError
partial_tearoff_instantiation_test/01: MissingCompileTimeError
@@ -2020,6 +1980,7 @@
substring_test/01: MissingCompileTimeError
super_assign_test/01: MissingCompileTimeError
super_bound_closure_test/01: MissingCompileTimeError
+super_call4_test/01: MissingCompileTimeError
super_operator_index_test/01: MissingCompileTimeError
super_operator_index_test/02: MissingCompileTimeError
super_operator_index_test/03: MissingCompileTimeError
diff --git a/tests/language_2/language_2_precompiled.status b/tests/language_2/language_2_precompiled.status
index a771e2d..58fc4e0 100644
--- a/tests/language_2/language_2_precompiled.status
+++ b/tests/language_2/language_2_precompiled.status
@@ -87,6 +87,7 @@
bool_check_test: RuntimeError
bool_condition_check_test: RuntimeError
bug31436_test: RuntimeError
+bug32305_test: MissingCompileTimeError
bug32372_test: RuntimeError
built_in_identifier_prefix_test: CompileTimeError
call_constructor_on_unresolvable_class_test/01: MissingCompileTimeError
@@ -910,8 +911,6 @@
substring_test/01: MissingCompileTimeError
super_assign_test/01: MissingCompileTimeError
super_bound_closure_test/01: MissingCompileTimeError
-super_call4_test: CompileTimeError
-super_getter_setter_test: CompileTimeError
super_operator_index_test/01: MissingCompileTimeError
super_operator_index_test/02: MissingCompileTimeError
super_operator_index_test/03: MissingCompileTimeError
diff --git a/tests/language_2/language_2_vm.status b/tests/language_2/language_2_vm.status
index b86d7b2..eb0dd41 100644
--- a/tests/language_2/language_2_vm.status
+++ b/tests/language_2/language_2_vm.status
@@ -171,6 +171,7 @@
bad_override_test/02: MissingCompileTimeError
bad_override_test/06: MissingCompileTimeError
bug31436_test: RuntimeError
+bug32305_test: MissingCompileTimeError
bug32372_test: RuntimeError
built_in_identifier_prefix_test: CompileTimeError
call_constructor_on_unresolvable_class_test/01: MissingCompileTimeError
@@ -918,6 +919,7 @@
substring_test/01: MissingCompileTimeError
super_assign_test/01: MissingCompileTimeError
super_bound_closure_test/01: MissingCompileTimeError
+super_call4_test/01: MissingCompileTimeError
super_operator_index_test/01: MissingCompileTimeError
super_operator_index_test/02: MissingCompileTimeError
super_operator_index_test/03: MissingCompileTimeError
@@ -1134,6 +1136,7 @@
function_type_alias6_test/none: RuntimeError
invalid_override_in_mixin_test/01: MissingCompileTimeError
type_literal_prefix_call_test: RuntimeError
+vm/regress_33040_instantiation_test: RuntimeError
# The VM and does not implement the Dart 2.0 runtime checks yet unless
# --checked is explicitly passed).
diff --git a/tests/language_2/many_overridden_no_such_method_test.dart b/tests/language_2/many_overridden_no_such_method_test.dart
index a9eb62e..d1230e6 100644
--- a/tests/language_2/many_overridden_no_such_method_test.dart
+++ b/tests/language_2/many_overridden_no_such_method_test.dart
@@ -5,7 +5,6 @@
library OverriddenNoSuchMethodTest.dart;
-import "dart:mirrors" show reflect;
import "package:expect/expect.dart";
part "overridden_no_such_method.dart";
diff --git a/tests/language_2/no_such_method_test.dart b/tests/language_2/no_such_method_test.dart
index f9a52b1..f38285a 100644
--- a/tests/language_2/no_such_method_test.dart
+++ b/tests/language_2/no_such_method_test.dart
@@ -3,34 +3,22 @@
// BSD-style license that can be found in the LICENSE file.
// Dart test program testing that NoSuchMethod is properly called.
-import "dart:mirrors" show reflect;
import "package:expect/expect.dart";
-class GetName {
- foo({a, b}) => "foo";
- moo({b}) => "moo";
-}
-
-String getName(im) => reflect(new GetName()).delegate(im);
-
class NoSuchMethodTest {
foo({a: 10, b: 20}) {
return (10 * a) + b;
}
noSuchMethod(Invocation im) {
- Expect.equals("moo", getName(im));
+ Expect.equals(#moo, im.memberName);
Expect.equals(0, im.positionalArguments.length);
Expect.equals(1, im.namedArguments.length);
return foo(b: im.namedArguments[const Symbol("b")]);
}
-
- static testMain() {
- var obj = new NoSuchMethodTest() as dynamic;
- Expect.equals(199, obj.moo(b: 99)); // obj.NoSuchMethod called here.
- }
}
main() {
- NoSuchMethodTest.testMain();
+ var obj = new NoSuchMethodTest() as dynamic;
+ Expect.equals(199, obj.moo(b: 99)); // obj.NoSuchMethod called here.
}
diff --git a/tests/language_2/null_test.dart b/tests/language_2/null_test.dart
index ba3459d..10e37fa 100644
--- a/tests/language_2/null_test.dart
+++ b/tests/language_2/null_test.dart
@@ -5,7 +5,6 @@
// VMOptions=--optimization-counter-threshold=5
-import "dart:mirrors";
import "package:expect/expect.dart";
class BadInherit
@@ -171,18 +170,6 @@
Expect.isFalse(compareWithNull(val));
Expect.isTrue(compareWithNull(obj));
- ClassMirror cm = reflectClass(Null);
-
- InstanceMirror im1 = reflect(null);
- Expect.equals(cm, im1.type);
- Expect.isTrue(im1.invoke(const Symbol("=="), [null]).reflectee);//# mirrors: ok
- Expect.isFalse(im1.invoke(const Symbol("=="), [42]).reflectee); //# mirrors: ok
-
- InstanceMirror im2 = reflect(obj);
- Expect.equals(cm, im2.type);
- Expect.isTrue(im2.invoke(const Symbol("=="), [null]).reflectee);//# mirrors: ok
- Expect.isFalse(im2.invoke(const Symbol("=="), [42]).reflectee); //# mirrors: ok
-
// Method/value extraction. The runtimeType was checked above, and operator==
// cannot be extracted.
// Currently fails in VM.
diff --git a/tests/language_2/overridden_no_such_method.dart b/tests/language_2/overridden_no_such_method.dart
index c9a98bc..9e86672 100644
--- a/tests/language_2/overridden_no_such_method.dart
+++ b/tests/language_2/overridden_no_such_method.dart
@@ -5,17 +5,11 @@
part of OverriddenNoSuchMethodTest.dart;
-class GetName {
- foo(a, b) => "foo";
-}
-
-String getName(im) => reflect(new GetName()).delegate(im);
-
class OverriddenNoSuchMethod {
OverriddenNoSuchMethod() {}
noSuchMethod(Invocation mirror) {
- Expect.equals("foo", getName(mirror));
+ Expect.equals(#foo, mirror.memberName);
// 'foo' was called with two parameters (not counting receiver).
List args = mirror.positionalArguments;
Expect.equals(2, args.length);
diff --git a/tests/language_2/overridden_no_such_method_test.dart b/tests/language_2/overridden_no_such_method_test.dart
index 9c7fe12..3aa37be 100644
--- a/tests/language_2/overridden_no_such_method_test.dart
+++ b/tests/language_2/overridden_no_such_method_test.dart
@@ -5,7 +5,6 @@
library OverriddenNoSuchMethodTest.dart;
-import "dart:mirrors" show reflect;
import "package:expect/expect.dart";
part "overridden_no_such_method.dart";
diff --git a/tests/language_2/setter_override2_test.dart b/tests/language_2/setter_override2_test.dart
index 6249764..80902b7 100644
--- a/tests/language_2/setter_override2_test.dart
+++ b/tests/language_2/setter_override2_test.dart
@@ -12,7 +12,7 @@
class A {
var foo = 42; // //# 00: ok
get foo => 42; // //# 01: ok
- foo() => 42; // //# 02: ok
+ foo() => 42; // //# 02: compile-time error
set foo(value) {} // //# 03: ok
}
diff --git a/tests/language_2/super_call4_test.dart b/tests/language_2/super_call4_test.dart
index 239339a..dbff2ea 100644
--- a/tests/language_2/super_call4_test.dart
+++ b/tests/language_2/super_call4_test.dart
@@ -2,7 +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:mirrors" show reflect;
import "package:expect/expect.dart";
// Checks that noSuchMethod is resolved in the super class and not in the
@@ -16,50 +15,26 @@
bool baz({int b});
bool boz(int a, {int c});
- bool noSuchMethod(Invocation im) {
- if (im.memberName == const Symbol('foo')) {
- return im.positionalArguments.isEmpty &&
- im.namedArguments.isEmpty &&
- reflect(e).delegate(im);
- }
- if (im.memberName == const Symbol('bar')) {
- return im.positionalArguments.length == 1 &&
- im.namedArguments.isEmpty &&
- reflect(e).delegate(im);
- }
- if (im.memberName == const Symbol('baz')) {
- return im.positionalArguments.isEmpty &&
- im.namedArguments.length == 1 &&
- reflect(e).delegate(im);
- }
- if (im.memberName == const Symbol('boz')) {
- return im.positionalArguments.length == 1 &&
- im.namedArguments.length == 1 &&
- reflect(e).delegate(im);
- }
- return false;
- }
+ bool noSuchMethod(Invocation im) => true;
}
class D extends C {
- bool noSuchMethod(Invocation im) {
- return false;
- }
+ bool noSuchMethod(Invocation im) => false;
test1() {
- return super.foo();
+ return super.foo(); //# 01: compile-time error
}
test2() {
- return super.bar(1);
+ return super.bar(1); //# 01: compile-time error
}
test3() {
- return super.baz(b: 2);
+ return super.baz(b: 2); //# 01: compile-time error
}
test4() {
- return super.boz(1, c: 2);
+ return super.boz(1, c: 2); //# 01: compile-time error
}
}
@@ -72,8 +47,8 @@
main() {
var d = new D();
- Expect.isTrue(d.test1());
- Expect.isTrue(d.test2());
- Expect.isTrue(d.test3());
- Expect.isTrue(d.test4());
+ Expect.isNull(d.test1());
+ Expect.isNull(d.test2());
+ Expect.isNull(d.test3());
+ Expect.isNull(d.test4());
}
diff --git a/tests/language_2/super_getter_setter_test.dart b/tests/language_2/super_getter_setter_test.dart
deleted file mode 100644
index 736957a..0000000
--- a/tests/language_2/super_getter_setter_test.dart
+++ /dev/null
@@ -1,126 +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 {
- var missingSetterField;
- var missingGetterField;
- var getterInSuperClassField;
- var setterInSuperClassField;
- var getterSetterField;
- var missingAllField;
- var indexField = new List(2);
-
- set setterInSuperClass(a) {
- setterInSuperClassField = a;
- }
-
- get getterInSuperClass => getterInSuperClassField;
-}
-
-class B extends A {
- get missingSetter => missingSetterField;
- get setterInSuperClass => setterInSuperClassField;
-
- set missingGetter(a) {
- missingGetterField = a;
- }
-
- set getterInSuperClass(a) {
- getterInSuperClassField = a;
- }
-
- get getterSetter => getterSetterField;
- set getterSetter(a) {
- getterSetterField = a;
- }
-
- operator [](index) => indexField[index];
- operator []=(index, value) {
- indexField[index] = value;
- }
-
- set missingSetter(a);
- get missingGetter;
-
- set missingAll(a);
- get missingAll;
-
- noSuchMethod(Invocation im) {
- String name = MirrorSystem.getName(im.memberName);
- if (name.startsWith('missingSetter')) {
- Expect.isTrue(im.isSetter);
- missingSetterField = im.positionalArguments[0];
- } else if (name.startsWith('missingGetter')) {
- Expect.isTrue(im.isGetter);
- return missingGetterField;
- } else if (name.startsWith('missingAll') && im.isGetter) {
- return missingAllField;
- } else if (name.startsWith('missingAll') && im.isSetter) {
- missingAllField = im.positionalArguments[0];
- } else {
- Expect.fail('Should not reach here');
- }
- }
-}
-
-class C extends B {
- test() {
- Expect.equals(42, super.missingSetter = 42);
- Expect.equals(42, super.missingSetter);
- Expect.equals(43, super.missingSetter += 1);
- Expect.equals(43, super.missingSetter);
- Expect.equals(43, super.missingSetter++);
- Expect.equals(44, super.missingSetter);
-
- Expect.equals(42, super.missingGetter = 42);
- Expect.equals(42, super.missingGetter);
- Expect.equals(43, super.missingGetter += 1);
- Expect.equals(43, super.missingGetter);
- Expect.equals(43, super.missingGetter++);
- Expect.equals(44, super.missingGetter);
-
- Expect.equals(42, super.setterInSuperClass = 42);
- Expect.equals(42, super.setterInSuperClass);
- Expect.equals(43, super.setterInSuperClass += 1);
- Expect.equals(43, super.setterInSuperClass);
- Expect.equals(43, super.setterInSuperClass++);
- Expect.equals(44, super.setterInSuperClass);
-
- Expect.equals(42, super.getterInSuperClass = 42);
- Expect.equals(42, super.getterInSuperClass);
- Expect.equals(43, super.getterInSuperClass += 1);
- Expect.equals(43, super.getterInSuperClass);
- Expect.equals(43, super.getterInSuperClass++);
- Expect.equals(44, super.getterInSuperClass);
-
- Expect.equals(42, super.missingAll = 42);
- Expect.equals(42, super.missingAll);
- Expect.equals(43, super.missingAll += 1);
- Expect.equals(43, super.missingAll);
- Expect.equals(43, super.missingAll++);
- Expect.equals(44, super.missingAll);
-
- Expect.equals(42, super[0] = 42);
- Expect.equals(42, super[0]);
- Expect.equals(43, super[0] += 1);
- Expect.equals(43, super[0]);
- Expect.equals(43, super[0]++);
- Expect.equals(44, super[0]);
-
- Expect.equals(2, super[0] = 2);
- Expect.equals(2, super[0]);
- Expect.equals(3, super[0] += 1);
- Expect.equals(3, super[0]);
- Expect.equals(3, super[0]++);
- Expect.equals(4, super[0]);
- }
-}
-
-main() {
- new C().test();
-}
diff --git a/tests/language_2/syncstar_covariant_type_test.dart b/tests/language_2/syncstar_covariant_type_test.dart
new file mode 100644
index 0000000..efae12a
--- /dev/null
+++ b/tests/language_2/syncstar_covariant_type_test.dart
@@ -0,0 +1,19 @@
+// 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.
+
+// Test that TypeErrors happen for sync* methods without creating iterator.
+
+import 'package:expect/expect.dart';
+
+class D<T> {
+ // Parametric covariance check is usually compiled into method.
+ Iterable<T> add(T n) sync* {
+ yield n;
+ }
+}
+
+main() {
+ D<num> d = new D<int>();
+ Expect.throwsTypeError(() => d.add(4.6));
+}
diff --git a/tests/language_2/syncstar_dcall_type_test.dart b/tests/language_2/syncstar_dcall_type_test.dart
new file mode 100644
index 0000000..5561419
--- /dev/null
+++ b/tests/language_2/syncstar_dcall_type_test.dart
@@ -0,0 +1,27 @@
+// 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.
+
+// Test that TypeErrors happen for sync* methods without creating iterator.
+
+import 'package:expect/expect.dart';
+
+Iterable<int> iota(int n) sync* {
+ for (int i = 0; i < n; i++) yield i;
+}
+
+class C {
+ Iterable<int> add(int n) sync* {
+ yield n;
+ }
+}
+
+main() {
+ dynamic f = iota;
+ Expect.throwsTypeError(() => f('ten'));
+ Expect.throwsTypeError(() => f(4.7));
+
+ dynamic o = new C();
+ Expect.throwsTypeError(() => o.add('ten'));
+ Expect.throwsTypeError(() => o.add(4.7));
+}
diff --git a/tests/language_2/vm/regress_33025_test.dart b/tests/language_2/vm/regress_33025_test.dart
new file mode 100644
index 0000000..4b083c3
--- /dev/null
+++ b/tests/language_2/vm/regress_33025_test.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.
+
+// Verify that VM correctly handles function type arguments across
+// yield points.
+
+import "package:expect/expect.dart";
+
+void main() {
+ doStuff<String>();
+}
+
+doStuff<T>() async {
+ Expect.equals(String, T);
+ await null;
+ Expect.equals(String, T);
+}
diff --git a/tests/language_2/vm/regress_33040_instantiation_test.dart b/tests/language_2/vm/regress_33040_instantiation_test.dart
new file mode 100644
index 0000000..0b15de0
--- /dev/null
+++ b/tests/language_2/vm/regress_33040_instantiation_test.dart
@@ -0,0 +1,35 @@
+// 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.
+//
+// Exact regression test for issue #33040.
+
+import 'dart:async';
+
+class Optional<T> {}
+
+typedef T ConvertFunction<T>();
+
+T blockingLatest<T>() {
+ return null;
+}
+
+abstract class ObservableModel<T> {}
+
+abstract class AsyncValueMixin<T> {
+ Future<T> get asyncValue {
+ ConvertFunction<T> f = blockingLatest;
+ if (f is! ConvertFunction<T>) throw "error";
+ return null;
+ }
+}
+
+abstract class OptionalSettableObservableModel<T>
+ extends ObservableModel<Optional<T>> with AsyncValueMixin<Optional<T>> {}
+
+class FooObservableModel extends OptionalSettableObservableModel<int> {}
+
+Future<void> main() async {
+ var model = new FooObservableModel();
+ await model.asyncValue;
+}
diff --git a/tests/language_2/vm/regress_33040_test.dart b/tests/language_2/vm/regress_33040_test.dart
new file mode 100644
index 0000000..8b595bf
--- /dev/null
+++ b/tests/language_2/vm/regress_33040_test.dart
@@ -0,0 +1,39 @@
+// 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.
+
+// Verify that prefix sharing optimization is taken into account when
+// concatenating type arguments vectors.
+
+import "package:expect/expect.dart";
+
+class C0 {}
+
+class C1 {}
+
+class C2 {}
+
+class C3 {}
+
+class Wrong {}
+
+void bar<T0, T1>() {
+ void baz<T2, T3>() {
+ Expect.equals(C0, T0);
+ Expect.equals(C1, T1);
+ Expect.equals(C2, T2);
+ Expect.equals(C3, T3);
+ }
+
+ baz<C2, C3>();
+}
+
+class A<X, Y, Z> {
+ void foo() {
+ bar<X, Y>();
+ }
+}
+
+void main() {
+ new A<C0, C1, Wrong>().foo();
+}
diff --git a/tests/lib_2/html/mirrors_js_typed_interop_test.dart b/tests/lib_2/html/mirrors_js_typed_interop_test.dart
index e877295..e4358a7 100644
--- a/tests/lib_2/html/mirrors_js_typed_interop_test.dart
+++ b/tests/lib_2/html/mirrors_js_typed_interop_test.dart
@@ -1,6 +1,10 @@
// 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.
+// dartdevcOptions=--emit-metadata
+
+// TODO(jmesserly): delete this test file once `dart:mirrors` is fully diabled
+// in dart4web compilers.
@JS()
library tests.html.mirrors_js_typed_interop_test;
diff --git a/tests/lib_2/lib_2.status b/tests/lib_2/lib_2.status
index 879596b..570bc93 100644
--- a/tests/lib_2/lib_2.status
+++ b/tests/lib_2/lib_2.status
@@ -250,6 +250,7 @@
isolate/message3_test/fun: Pass, Fail # Closure identity
isolate/spawn_uri_nested_vm_test: Pass, Crash # Issue 28192
mirrors/closurization_equivalence_test: SkipByDesign # Method equality
+mirrors/deferred_constraints_constants_test: Crash # Requires deferred libraries
mirrors/deferred_mirrors_metadata_test: Crash # Deferred loading
mirrors/deferred_mirrors_metatarget_test: Crash # Deferred loading
mirrors/deferred_mirrors_update_test: Crash # Deferred loading
diff --git a/tests/lib_2/lib_2_kernel.status b/tests/lib_2/lib_2_kernel.status
index db296c2..e9c9f60 100644
--- a/tests/lib_2/lib_2_kernel.status
+++ b/tests/lib_2/lib_2_kernel.status
@@ -17,6 +17,7 @@
[ $fasta ]
isolate/compile_time_error_test/01: MissingCompileTimeError
+mirrors/deferred_constraints_constants_test/default_argument2: MissingCompileTimeError
mirrors/generic_bounded_by_type_parameter_test/02: MissingCompileTimeError
mirrors/generic_bounded_test/01: MissingCompileTimeError
mirrors/generic_bounded_test/02: MissingCompileTimeError
@@ -95,6 +96,7 @@
isolate/spawn_uri_nested_vm_test: Pass, Timeout
isolate/static_function_test: Skip # Times out. Issue 31855. CompileTimeError. Issue 31402
mirrors/abstract_class_test: RuntimeError
+mirrors/apply3_test: RuntimeError
mirrors/class_declarations_test/01: RuntimeError # Issue 31402 (Invocation arguments)
mirrors/class_declarations_test/none: RuntimeError # Issue 31402 (Invocation arguments)
mirrors/class_mirror_location_test: RuntimeError
@@ -118,14 +120,11 @@
mirrors/generic_interface_test/none: RuntimeError
mirrors/generic_mixin_applications_test: RuntimeError
mirrors/generic_mixin_test: RuntimeError
-mirrors/generics_double_substitution_test/01: RuntimeError
-mirrors/generics_double_substitution_test/none: RuntimeError
mirrors/generics_dynamic_test: RuntimeError
-mirrors/generics_substitution_test: RuntimeError
-mirrors/generics_test/none: RuntimeError
mirrors/hot_get_field_test: RuntimeError
mirrors/hot_set_field_test: RuntimeError
mirrors/intercepted_object_test: RuntimeError # Issue 31402 (Invocation arguments)
+mirrors/invocation_fuzz_test: RuntimeError, Crash
mirrors/invoke_private_test: RuntimeError
mirrors/invoke_private_wrong_library_test: RuntimeError
mirrors/library_declarations_test/none: RuntimeError # Issue 31402 (Invocation arguments)
@@ -165,10 +164,7 @@
mirrors/other_declarations_location_test: RuntimeError
mirrors/parameter_annotation_mirror_test: RuntimeError
mirrors/parameter_metadata_test: RuntimeError
-mirrors/parameter_metadata_test: Crash
mirrors/parameter_of_mixin_app_constructor_test: RuntimeError # Issue 31402 (Invocation arguments)
-mirrors/parameter_test/01: CompileTimeError # Issue 31402 (Invocation arguments)
-mirrors/parameter_test/none: CompileTimeError # Issue 31402 (Invocation arguments)
mirrors/private_class_field_test: RuntimeError
mirrors/private_field_test: RuntimeError
mirrors/private_symbol_test: RuntimeError
@@ -194,7 +190,6 @@
mirrors/symbol_validation_test/none: RuntimeError # Issue 31537
mirrors/type_variable_is_static_test: RuntimeError
mirrors/type_variable_owner_test/01: RuntimeError
-mirrors/typearguments_mirror_test: CompileTimeError # Issue 31402 (Invocation arguments)
mirrors/typedef_deferred_library_test: CompileTimeError # Deferred loading kernel issue 28335.
mirrors/typedef_deferred_library_test: RuntimeError
mirrors/typedef_in_signature_test: RuntimeError
@@ -223,44 +218,29 @@
isolate/ping_pause_test: RuntimeError
isolate/request_reply_test: Pass, Timeout
isolate/stacktrace_message_test: RuntimeError
-mirrors/class_mirror_type_variables_test: RuntimeError
mirrors/constructor_optional_args_test: RuntimeError
mirrors/constructors_test: RuntimeError
+mirrors/deferred_constraints_constants_test/default_argument2: Pass
mirrors/fake_function_with_call_test: RuntimeError
-mirrors/generic_bounded_by_type_parameter_test/none: RuntimeError
-mirrors/generic_bounded_test/none: RuntimeError
-mirrors/generic_f_bounded_test/01: RuntimeError
-mirrors/generic_f_bounded_test/none: RuntimeError
-mirrors/generic_local_function_test: RuntimeError
mirrors/generic_superclass_test/01: RuntimeError
mirrors/generic_superclass_test/none: RuntimeError
-mirrors/generic_type_mirror_test: RuntimeError
mirrors/hierarchy_invariants_test: RuntimeError
mirrors/immutable_collections_test: RuntimeError
-mirrors/initializing_formals_test/01: RuntimeError
-mirrors/initializing_formals_test/03: RuntimeError
-mirrors/initializing_formals_test/none: RuntimeError
mirrors/instance_members_easier_test: RuntimeError
mirrors/instance_members_test: RuntimeError
mirrors/instance_members_unimplemented_interface_test: RuntimeError
mirrors/instance_members_with_override_test: RuntimeError
-mirrors/instantiate_abstract_class_test: RuntimeError
mirrors/invoke_closurization2_test: RuntimeError
mirrors/invoke_throws_test: RuntimeError
-mirrors/library_imports_bad_metadata_test/none: RuntimeError, Crash # Issue 32879
mirrors/metadata_const_map_test: Crash
mirrors/mixin_members_test: RuntimeError
mirrors/null_test: RuntimeError
mirrors/operator_test: RuntimeError
-mirrors/parameter_is_const_test/none: RuntimeError
-mirrors/parameter_test/01: RuntimeError
-mirrors/parameter_test/none: RuntimeError
mirrors/redirecting_factory_different_type_test/02: MissingCompileTimeError
mirrors/redirecting_factory_different_type_test/none: RuntimeError
+mirrors/redirecting_factory_reflection_test: RuntimeError
mirrors/regress_16321_test/none: Crash
mirrors/top_level_accessors_test/01: MissingCompileTimeError
-mirrors/type_argument_is_type_variable_test: RuntimeError
-mirrors/typearguments_mirror_test: RuntimeError
# Enabling of dartk for sim{arm,arm64,dbc64} revealed these test failures, which
# are to be triaged. Isolate tests are skipped on purpose due to the usage of
diff --git a/tests/lib_2/mirrors/apply3_test.dart b/tests/lib_2/mirrors/apply3_test.dart
new file mode 100644
index 0000000..d96fa0d
--- /dev/null
+++ b/tests/lib_2/mirrors/apply3_test.dart
@@ -0,0 +1,69 @@
+// 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 [Function.apply] on user-defined classes that implement [noSuchMethod].
+
+import "package:expect/expect.dart";
+import 'dart:mirrors';
+
+class F {
+ call([p1]) => "call";
+ noSuchMethod(Invocation invocation) => "NSM";
+}
+
+class G {
+ call() => '42';
+ noSuchMethod(Invocation invocation) => invocation;
+}
+
+class H {
+ call(required, {a}) => required + a;
+}
+
+main() {
+ Expect.equals('call', Function.apply(new F(), []));
+ Expect.equals('call', Function.apply(new F(), [1]));
+ Expect.equals('NSM', Function.apply(new F(), [1, 2]));
+ Expect.equals('NSM', Function.apply(new F(), [1, 2, 3]));
+
+ var symbol = const Symbol('a');
+ var requiredParameters = [1];
+ var optionalParameters = new Map<Symbol, int>()..[symbol] = 42;
+ Invocation i =
+ Function.apply(new G(), requiredParameters, optionalParameters);
+
+ Expect.equals(const Symbol('call'), i.memberName);
+ Expect.listEquals(requiredParameters, i.positionalArguments);
+ Expect.mapEquals(optionalParameters, i.namedArguments);
+ Expect.isTrue(i.isMethod);
+ Expect.isFalse(i.isGetter);
+ Expect.isFalse(i.isSetter);
+ Expect.isFalse(i.isAccessor);
+
+ // Check that changing the passed list and map for parameters does
+ // not affect [i].
+ requiredParameters[0] = 42;
+ optionalParameters[symbol] = 12;
+ Expect.listEquals([1], i.positionalArguments);
+ Expect.mapEquals(new Map()..[symbol] = 42, i.namedArguments);
+
+ // Check that using [i] for invocation yields the same [Invocation]
+ // object.
+ var mirror = reflect(new G());
+ Invocation other = mirror.delegate(i);
+ Expect.equals(i.memberName, other.memberName);
+ Expect.listEquals(i.positionalArguments, other.positionalArguments);
+ Expect.mapEquals(i.namedArguments, other.namedArguments);
+ Expect.equals(i.isMethod, other.isMethod);
+ Expect.equals(i.isGetter, other.isGetter);
+ Expect.equals(i.isSetter, other.isSetter);
+ Expect.equals(i.isAccessor, other.isAccessor);
+
+ // Test that [i] can be used to hit an existing method.
+ Expect.equals(43, new H().call(1, a: 42));
+ Expect.equals(43, Function.apply(new H(), [1], new Map()..[symbol] = 42));
+ mirror = reflect(new H());
+ Expect.equals(43, mirror.delegate(i));
+ Expect.equals(43, mirror.delegate(other));
+}
diff --git a/tests/lib_2/mirrors/const_evaluation_test.dart b/tests/lib_2/mirrors/const_evaluation_test.dart
new file mode 100644
index 0000000..be27133
--- /dev/null
+++ b/tests/lib_2/mirrors/const_evaluation_test.dart
@@ -0,0 +1,21 @@
+// 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.
+
+// Check that compile-time evaluation of constants is consistent with runtime
+// evaluation.
+
+import 'dart:mirrors';
+import 'package:expect/expect.dart';
+
+const top_const = identical(-0.0, 0);
+
+@top_const
+class C {}
+
+void main() {
+ var local_var = identical(-0.0, 0);
+ var metadata = reflectClass(C).metadata[0].reflectee;
+ Expect.equals(top_const, metadata);
+ Expect.equals(local_var, metadata);
+}
diff --git a/tests/language_2/deferred_constraints_constants_lib.dart b/tests/lib_2/mirrors/deferred_constraints_constants_lib.dart
similarity index 100%
rename from tests/language_2/deferred_constraints_constants_lib.dart
rename to tests/lib_2/mirrors/deferred_constraints_constants_lib.dart
diff --git a/tests/language_2/deferred_constraints_constants_test.dart b/tests/lib_2/mirrors/deferred_constraints_constants_test.dart
similarity index 91%
rename from tests/language_2/deferred_constraints_constants_test.dart
rename to tests/lib_2/mirrors/deferred_constraints_constants_test.dart
index c975f51..053bb81 100644
--- a/tests/language_2/deferred_constraints_constants_test.dart
+++ b/tests/lib_2/mirrors/deferred_constraints_constants_test.dart
@@ -61,9 +61,9 @@
var h3 = new H3();
// Need to access the metadata to trigger the expected compilation error.
- reflectClass(H1).metadata; // metadata1: continued
- reflectClass(H2).metadata; // metadata2: continued
- reflectClass(H3).metadata; // metadata3: continued
+ reflectClass(H1).metadata; //# metadata1: continued
+ reflectClass(H2).metadata; //# metadata2: continued
+ reflectClass(H3).metadata; //# metadata3: continued
asyncEnd();
});
diff --git a/tests/language_2/enum_mirror_test.dart b/tests/lib_2/mirrors/enum_mirror_test.dart
similarity index 100%
rename from tests/language_2/enum_mirror_test.dart
rename to tests/lib_2/mirrors/enum_mirror_test.dart
diff --git a/tests/language_2/instance_creation_in_function_annotation_test.dart b/tests/lib_2/mirrors/instance_creation_in_function_annotation_test.dart
similarity index 100%
rename from tests/language_2/instance_creation_in_function_annotation_test.dart
rename to tests/lib_2/mirrors/instance_creation_in_function_annotation_test.dart
diff --git a/tests/language_2/invocation_mirror_invoke_on2_test.dart b/tests/lib_2/mirrors/invocation_mirror_invoke_on2_test.dart
similarity index 100%
rename from tests/language_2/invocation_mirror_invoke_on2_test.dart
rename to tests/lib_2/mirrors/invocation_mirror_invoke_on2_test.dart
diff --git a/tests/language_2/invocation_mirror_invoke_on_test.dart b/tests/lib_2/mirrors/invocation_mirror_invoke_on_test.dart
similarity index 100%
rename from tests/language_2/invocation_mirror_invoke_on_test.dart
rename to tests/lib_2/mirrors/invocation_mirror_invoke_on_test.dart
diff --git a/tests/language_2/issue21079_test.dart b/tests/lib_2/mirrors/issue21079_test.dart
similarity index 100%
rename from tests/language_2/issue21079_test.dart
rename to tests/lib_2/mirrors/issue21079_test.dart
diff --git a/tests/lib_2/mirrors/null_test.dart b/tests/lib_2/mirrors/null_test.dart
index a194656..de6b459 100644
--- a/tests/lib_2/mirrors/null_test.dart
+++ b/tests/lib_2/mirrors/null_test.dart
@@ -2,13 +2,31 @@
// 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 test.null_test;
+// VMOptions=--optimization-counter-threshold=5
-import 'dart:mirrors';
+import "dart:mirrors";
+import "package:expect/expect.dart";
-import 'package:expect/expect.dart';
+void main() {
+ for (int i = 0; i < 10; i++) {
+ test();
+ }
+}
-main() {
+void test() {
+ ClassMirror cm = reflectClass(Null);
+
+ InstanceMirror im1 = reflect(null);
+ Expect.equals(cm, im1.type);
+ Expect.isTrue(im1.invoke(const Symbol("=="), [null]).reflectee);
+ Expect.isFalse(im1.invoke(const Symbol("=="), [42]).reflectee);
+
+ var obj = confuse(null); // Null value that isn't known at compile-time.
+ InstanceMirror im2 = reflect(obj);
+ Expect.equals(cm, im2.type);
+ Expect.isTrue(im2.invoke(const Symbol("=="), [null]).reflectee);
+ Expect.isFalse(im2.invoke(const Symbol("=="), [42]).reflectee);
+
InstanceMirror nullMirror = reflect(null);
Expect.isTrue(nullMirror.getField(#hashCode).reflectee is int);
Expect.equals(null.hashCode, nullMirror.getField(#hashCode).reflectee);
@@ -16,8 +34,8 @@
Expect.isTrue(nullMirror.invoke(#==, [null]).reflectee);
Expect.isFalse(nullMirror.invoke(#==, [new Object()]).reflectee);
Expect.equals('null', nullMirror.invoke(#toString, []).reflectee);
- Expect.throwsNoSuchMethodError(() => nullMirror.invoke(#notDefined, []),
- 'noSuchMethod');
+ Expect.throwsNoSuchMethodError(
+ () => nullMirror.invoke(#notDefined, []), 'noSuchMethod');
ClassMirror NullMirror = nullMirror.type;
Expect.equals(reflectClass(Null), NullMirror);
@@ -38,3 +56,16 @@
}
Expect.equals(coreLibrary, NullMirror.owner);
}
+
+// Magic incantation to avoid the compiler recognizing the constant values
+// at compile time. If the result is computed at compile time, the dynamic code
+// will not be tested.
+confuse(x) {
+ try {
+ if (new DateTime.now().millisecondsSinceEpoch == 42) x = 42;
+ throw [x];
+ } on dynamic catch (e) {
+ return e[0];
+ }
+ return 42;
+}
diff --git a/tests/language_2/redirecting_factory_reflection_test.dart b/tests/lib_2/mirrors/redirecting_factory_reflection_test.dart
similarity index 100%
rename from tests/language_2/redirecting_factory_reflection_test.dart
rename to tests/lib_2/mirrors/redirecting_factory_reflection_test.dart
diff --git a/tests/language_2/regress_13462_0_test.dart b/tests/lib_2/mirrors/regress_13462_0_test.dart
similarity index 100%
rename from tests/language_2/regress_13462_0_test.dart
rename to tests/lib_2/mirrors/regress_13462_0_test.dart
diff --git a/tests/language_2/regress_13462_1_test.dart b/tests/lib_2/mirrors/regress_13462_1_test.dart
similarity index 100%
rename from tests/language_2/regress_13462_1_test.dart
rename to tests/lib_2/mirrors/regress_13462_1_test.dart
diff --git a/tests/language_2/regress_18535_test.dart b/tests/lib_2/mirrors/regress_18535_test.dart
similarity index 100%
rename from tests/language_2/regress_18535_test.dart
rename to tests/lib_2/mirrors/regress_18535_test.dart
diff --git a/tests/language_2/regress_28255_test.dart b/tests/lib_2/mirrors/regress_28255_test.dart
similarity index 100%
rename from tests/language_2/regress_28255_test.dart
rename to tests/lib_2/mirrors/regress_28255_test.dart
diff --git a/tests/standalone/io/file_invalid_arguments_test.dart b/tests/standalone/io/file_invalid_arguments_test.dart
index 1c467f0..94e3a22 100644
--- a/tests/standalone/io/file_invalid_arguments_test.dart
+++ b/tests/standalone/io/file_invalid_arguments_test.dart
@@ -32,7 +32,7 @@
void testWriteByteInvalidArgs(value) {
String filename = getFilename("fixed_length_file_invalid_arguments");
- var file = (new File("${filename}_out")).openSync(mode: FileMode.WRITE);
+ var file = (new File("${filename}_out")).openSync(mode: FileMode.write);
Expect.throws(() => file.writeByteSync(value), (e) => e is ArgumentError);
Expect.throws(() => file.writeByte(value), (e) => e is ArgumentError);
@@ -41,7 +41,7 @@
void testWriteFromInvalidArgs(buffer, start, end) {
String filename = getFilename("fixed_length_file_invalid_arguments");
- var file = (new File("${filename}_out")).openSync(mode: FileMode.WRITE);
+ var file = (new File("${filename}_out")).openSync(mode: FileMode.write);
Expect.throws(
() => file.writeFromSync(buffer, start, end), (e) => e is ArgumentError);
@@ -52,7 +52,7 @@
void testWriteStringInvalidArgs(string, encoding) {
String filename = getFilename("fixed_length_file_invalid_arguments");
- var file = new File("${filename}_out").openSync(mode: FileMode.WRITE);
+ var file = new File("${filename}_out").openSync(mode: FileMode.write);
Expect.throws(() => file.writeStringSync(string, encoding: encoding),
(e) => e is ArgumentError);
diff --git a/tests/standalone/io/io_override_test.dart b/tests/standalone/io/io_override_test.dart
index 1d6abb2..012e7ff 100644
--- a/tests/standalone/io/io_override_test.dart
+++ b/tests/standalone/io/io_override_test.dart
@@ -64,30 +64,30 @@
DateTime lastModifiedSync() => null;
Future setLastModified(DateTime time) => null;
void setLastModifiedSync(DateTime time) {}
- Future<RandomAccessFile> open({FileMode mode: FileMode.READ}) => null;
- RandomAccessFile openSync({FileMode mode: FileMode.READ}) => null;
+ Future<RandomAccessFile> open({FileMode mode: FileMode.read}) => null;
+ RandomAccessFile openSync({FileMode mode: FileMode.read}) => null;
Stream<List<int>> openRead([int start, int end]) => null;
- IOSink openWrite({FileMode mode: FileMode.WRITE, Encoding encoding: UTF8}) =>
+ IOSink openWrite({FileMode mode: FileMode.write, Encoding encoding: utf8}) =>
null;
Future<List<int>> readAsBytes() => null;
List<int> readAsBytesSync() => null;
- Future<String> readAsString({Encoding encoding: UTF8}) => null;
- String readAsStringSync({Encoding encoding: UTF8}) => null;
- Future<List<String>> readAsLines({Encoding encoding: UTF8}) => null;
- List<String> readAsLinesSync({Encoding encoding: UTF8}) => null;
+ Future<String> readAsString({Encoding encoding: utf8}) => null;
+ String readAsStringSync({Encoding encoding: utf8}) => null;
+ Future<List<String>> readAsLines({Encoding encoding: utf8}) => null;
+ List<String> readAsLinesSync({Encoding encoding: utf8}) => null;
Future<File> writeAsBytes(List<int> bytes,
- {FileMode mode: FileMode.WRITE, bool flush: false}) =>
+ {FileMode mode: FileMode.write, bool flush: false}) =>
null;
void writeAsBytesSync(List<int> bytes,
- {FileMode mode: FileMode.WRITE, bool flush: false}) {}
+ {FileMode mode: FileMode.write, bool flush: false}) {}
Future<File> writeAsString(String contents,
- {FileMode mode: FileMode.WRITE,
- Encoding encoding: UTF8,
+ {FileMode mode: FileMode.write,
+ Encoding encoding: utf8,
bool flush: false}) =>
null;
void writeAsStringSync(String contents,
- {FileMode mode: FileMode.WRITE,
- Encoding encoding: UTF8,
+ {FileMode mode: FileMode.write,
+ Encoding encoding: utf8,
bool flush: false}) {}
}
@@ -118,11 +118,11 @@
static bool identicalSync(String path1, String path2) => false;
static Future<FileSystemEntityType> getType(String path, bool followLinks) {
- return new Future.value(FileSystemEntityType.FILE);
+ return new Future.value(FileSystemEntityType.file);
}
static FileSystemEntityType getTypeSync(String path, bool followLinks) {
- return FileSystemEntityType.FILE;
+ return FileSystemEntityType.file;
}
}
@@ -174,9 +174,9 @@
Expect.isFalse(await FileSystemEntity.identical("file", "file"));
Expect.isFalse(FileSystemEntity.identicalSync("file", "file"));
Expect.equals(
- await FileSystemEntity.type("file"), FileSystemEntityType.FILE);
+ await FileSystemEntity.type("file"), FileSystemEntityType.file);
Expect.equals(
- FileSystemEntity.typeSync("file"), FileSystemEntityType.FILE);
+ FileSystemEntity.typeSync("file"), FileSystemEntityType.file);
Expect.isFalse(FileSystemEntity.isWatchSupported);
Expect.isNull(new Directory("directory").watch());
Expect.isTrue(new Link("link") is LinkMock);
diff --git a/tests/standalone/io/raw_datagram_socket_test.dart b/tests/standalone/io/raw_datagram_socket_test.dart
index 2a08b0c..5fe68e4 100644
--- a/tests/standalone/io/raw_datagram_socket_test.dart
+++ b/tests/standalone/io/raw_datagram_socket_test.dart
@@ -33,8 +33,8 @@
});
}
- test(InternetAddress.LOOPBACK_IP_V4);
- test(InternetAddress.ANY_IP_V4);
+ test(InternetAddress.loopbackIPv4);
+ test(InternetAddress.anyIPv4);
}
testDatagramMulticastOptions() {
@@ -61,10 +61,10 @@
});
}
- test(InternetAddress.LOOPBACK_IP_V4);
- test(InternetAddress.ANY_IP_V4);
- test(InternetAddress.LOOPBACK_IP_V6);
- test(InternetAddress.ANY_IP_V6);
+ test(InternetAddress.loopbackIPv4);
+ test(InternetAddress.anyIPv4);
+ test(InternetAddress.loopbackIPv6);
+ test(InternetAddress.anyIPv6);
}
testDatagramSocketReuseAddress() {
@@ -86,10 +86,10 @@
});
}
- test(InternetAddress.LOOPBACK_IP_V4, true);
- test(InternetAddress.LOOPBACK_IP_V4, false);
- test(InternetAddress.LOOPBACK_IP_V6, true);
- test(InternetAddress.LOOPBACK_IP_V6, false);
+ test(InternetAddress.loopbackIPv4, true);
+ test(InternetAddress.loopbackIPv4, false);
+ test(InternetAddress.loopbackIPv6, true);
+ test(InternetAddress.loopbackIPv6, false);
}
testBroadcast() {
@@ -107,7 +107,7 @@
receiver.broadcastEnabled = enabled;
sender.broadcastEnabled = enabled;
receiver.listen((event) {
- if (event == RawSocketEvent.READ) {
+ if (event == RawSocketEvent.read) {
Expect.isTrue(enabled);
sender.close();
receiver.close();
@@ -135,8 +135,8 @@
}
var broadcast = new InternetAddress("255.255.255.255");
- test(InternetAddress.ANY_IP_V4, broadcast, false);
- test(InternetAddress.ANY_IP_V4, broadcast, true);
+ test(InternetAddress.anyIPv4, broadcast, false);
+ test(InternetAddress.anyIPv4, broadcast, true);
}
testLoopbackMulticast() {
@@ -158,7 +158,7 @@
sender.multicastLoopback = enabled;
receiver.listen((event) {
- if (event == RawSocketEvent.READ) {
+ if (event == RawSocketEvent.read) {
if (!enabled) {
var data = receiver.receive();
print(data.port);
@@ -190,17 +190,17 @@
});
}
- test(InternetAddress.ANY_IP_V4, new InternetAddress("228.0.0.4"), true);
- test(InternetAddress.ANY_IP_V4, new InternetAddress("224.0.0.0"), false);
+ test(InternetAddress.anyIPv4, new InternetAddress("228.0.0.4"), true);
+ test(InternetAddress.anyIPv4, new InternetAddress("224.0.0.0"), false);
// TODO(30306): Reenable for Linux
if (!Platform.isMacOS && !Platform.isLinux) {
- test(InternetAddress.ANY_IP_V6, new InternetAddress("ff11::0"), true);
- test(InternetAddress.ANY_IP_V6, new InternetAddress("ff11::0"), false);
+ test(InternetAddress.anyIPv6, new InternetAddress("ff11::0"), true);
+ test(InternetAddress.anyIPv6, new InternetAddress("ff11::0"), false);
}
}
testLoopbackMulticastError() {
- var bindAddress = InternetAddress.ANY_IP_V4;
+ var bindAddress = InternetAddress.anyIPv4;
var multicastAddress = new InternetAddress("228.0.0.4");
asyncStart();
Future.wait([
@@ -275,7 +275,7 @@
sender.listen((event) {
switch (event) {
- case RawSocketEvent.READ:
+ case RawSocketEvent.read:
var datagram = sender.receive();
if (datagram != null) {
Expect.equals(datagram.port, receiver.port);
@@ -293,11 +293,11 @@
}
}
break;
- case RawSocketEvent.WRITE:
+ case RawSocketEvent.write:
// Send the next package.
sendData(ackSeq + 1);
break;
- case RawSocketEvent.CLOSED:
+ case RawSocketEvent.closed:
break;
default:
throw "Unexpected event $event";
@@ -307,7 +307,7 @@
receiver.writeEventsEnabled = false;
receiver.listen((event) {
switch (event) {
- case RawSocketEvent.READ:
+ case RawSocketEvent.read:
var datagram = receiver.receive();
if (datagram != null) {
Expect.equals(datagram.port, sender.port);
@@ -322,10 +322,10 @@
}
}
break;
- case RawSocketEvent.WRITE:
- throw "Unexpected WRITE";
+ case RawSocketEvent.write:
+ throw "Unexpected.write";
break;
- case RawSocketEvent.CLOSED:
+ case RawSocketEvent.closed:
break;
default:
throw "Unexpected event $event";
@@ -343,12 +343,12 @@
testBroadcast();
testLoopbackMulticast();
testLoopbackMulticastError();
- testSendReceive(InternetAddress.LOOPBACK_IP_V4, 1000);
- testSendReceive(InternetAddress.LOOPBACK_IP_V6, 1000);
+ testSendReceive(InternetAddress.loopbackIPv4, 1000);
+ testSendReceive(InternetAddress.loopbackIPv6, 1000);
if (!Platform.isMacOS) {
- testSendReceive(InternetAddress.LOOPBACK_IP_V4, 32 * 1024);
- testSendReceive(InternetAddress.LOOPBACK_IP_V6, 32 * 1024);
- testSendReceive(InternetAddress.LOOPBACK_IP_V4, 64 * 1024 - 32);
- testSendReceive(InternetAddress.LOOPBACK_IP_V6, 64 * 1024 - 32);
+ testSendReceive(InternetAddress.loopbackIPv4, 32 * 1024);
+ testSendReceive(InternetAddress.loopbackIPv6, 32 * 1024);
+ testSendReceive(InternetAddress.loopbackIPv4, 64 * 1024 - 32);
+ testSendReceive(InternetAddress.loopbackIPv6, 64 * 1024 - 32);
}
}
diff --git a/tests/standalone/io/raw_secure_server_socket_test.dart b/tests/standalone/io/raw_secure_server_socket_test.dart
index fb1b333..a2a1d05 100644
--- a/tests/standalone/io/raw_secure_server_socket_test.dart
+++ b/tests/standalone/io/raw_secure_server_socket_test.dart
@@ -91,8 +91,8 @@
server.listen((serverEnd) {
clientEndFuture.then((clientEnd) {
// TODO(whesse): Shutdown(SEND) not supported on secure sockets.
- clientEnd.shutdown(SocketDirection.SEND);
- serverEnd.shutdown(SocketDirection.SEND);
+ clientEnd.shutdown(SocketDirection.send);
+ serverEnd.shutdown(SocketDirection.send);
server.close();
print("asyncEnd testSimpleConnect");
asyncEnd();
@@ -137,8 +137,8 @@
new Timer(const Duration(milliseconds: 500), () {
server.listen((serverEnd) {
clientEndFuture.then((clientEnd) {
- clientEnd.shutdown(SocketDirection.SEND);
- serverEnd.shutdown(SocketDirection.SEND);
+ clientEnd.shutdown(SocketDirection.send);
+ serverEnd.shutdown(SocketDirection.send);
server.close();
print("asyncEnd testServerListenAfterConnect");
asyncEnd();
@@ -239,7 +239,7 @@
var subscription;
subscription = client.listen((event) {
switch (event) {
- case RawSocketEvent.READ:
+ case RawSocketEvent.read:
if (dropReads) {
if (serverReads != 10) {
++serverReads;
@@ -264,7 +264,7 @@
client.writeEventsEnabled = true;
}
break;
- case RawSocketEvent.WRITE:
+ case RawSocketEvent.write:
Expect.isFalse(client.writeEventsEnabled);
Expect.equals(bytesRead, data.length);
for (int i = bytesWritten; i < data.length; ++i) {
@@ -280,7 +280,7 @@
client.shutdown(SocketDirection.SEND);
}
break;
- case RawSocketEvent.READ_CLOSED:
+ case RawSocketEvent.readClosed:
completer.complete(null);
break;
default:
@@ -298,7 +298,7 @@
List<int> dataReceived = new List<int>(dataSent.length);
socket.listen((event) {
switch (event) {
- case RawSocketEvent.READ:
+ case RawSocketEvent.read:
Expect.isTrue(socket.available() > 0);
if (dropReads) {
if (clientReads != 10) {
@@ -314,7 +314,7 @@
bytesRead += buffer.length;
}
break;
- case RawSocketEvent.WRITE:
+ case RawSocketEvent.write:
Expect.isTrue(bytesRead == 0);
Expect.isFalse(socket.writeEventsEnabled);
bytesWritten += socket.write(
@@ -323,7 +323,7 @@
socket.writeEventsEnabled = true;
}
break;
- case RawSocketEvent.READ_CLOSED:
+ case RawSocketEvent.readClosed:
verifyTestData(dataReceived);
completer.complete(socket);
break;
@@ -343,7 +343,7 @@
var subscription;
subscription = client.listen((event) {
switch (event) {
- case RawSocketEvent.READ:
+ case RawSocketEvent.read:
if (bytesRead < data.length) {
Expect.isTrue(bytesWritten == 0);
}
@@ -377,7 +377,7 @@
client.writeEventsEnabled = true;
}
break;
- case RawSocketEvent.WRITE:
+ case RawSocketEvent.write:
Expect.isFalse(client.writeEventsEnabled);
Expect.equals(bytesRead, data.length);
for (int i = bytesWritten; i < data.length; ++i) {
@@ -395,7 +395,7 @@
}
}
break;
- case RawSocketEvent.READ_CLOSED:
+ case RawSocketEvent.readClosed:
Expect.fail("Unexpected close");
break;
default:
@@ -414,7 +414,7 @@
var subscription;
subscription = socket.listen((event) {
switch (event) {
- case RawSocketEvent.READ:
+ case RawSocketEvent.read:
if (dropReads) {
if (clientReads != 10) {
++clientReads;
@@ -434,7 +434,7 @@
}
}
break;
- case RawSocketEvent.WRITE:
+ case RawSocketEvent.write:
Expect.isTrue(bytesRead == 0);
Expect.isFalse(socket.writeEventsEnabled);
bytesWritten += socket.write(
@@ -443,7 +443,7 @@
socket.writeEventsEnabled = true;
}
break;
- case RawSocketEvent.READ_CLOSED:
+ case RawSocketEvent.readClosed:
Expect.fail("Unexpected close");
break;
default:
diff --git a/tests/standalone/io/secure_socket_bad_data_test.dart b/tests/standalone/io/secure_socket_bad_data_test.dart
index 1b8d386..2cf5777 100644
--- a/tests/standalone/io/secure_socket_bad_data_test.dart
+++ b/tests/standalone/io/secure_socket_bad_data_test.dart
@@ -55,7 +55,7 @@
client.writeEventsEnabled = false;
client.listen((event) {
switch (event) {
- case RawSocketEvent.READ:
+ case RawSocketEvent.read:
Expect.isTrue(client.available() > 0);
var buffer = client.read(200);
dataReceived.setRange(bytesRead, bytesRead + buffer.length, buffer);
@@ -64,12 +64,12 @@
verifyTestData(dataReceived);
}
break;
- case RawSocketEvent.WRITE:
+ case RawSocketEvent.write:
Expect.fail('WRITE event received');
break;
- case RawSocketEvent.READ_CLOSED:
+ case RawSocketEvent.readClosed:
Expect.fail('READ_CLOSED event received');
- client.shutdown(SocketDirection.SEND);
+ client.shutdown(SocketDirection.send);
completer.complete(null);
break;
}
@@ -97,10 +97,10 @@
int bytesWritten = 0;
socket.listen((event) {
switch (event) {
- case RawSocketEvent.READ:
+ case RawSocketEvent.read:
Expect.fail('READ event received');
break;
- case RawSocketEvent.WRITE:
+ case RawSocketEvent.write:
if (bytesWritten < data.length) {
bytesWritten += socket.write(data, bytesWritten);
}
@@ -109,10 +109,10 @@
}
if (bytesWritten == data.length) {
baseSocket.write(data, 0, 300);
- socket.shutdown(SocketDirection.SEND);
+ socket.shutdown(SocketDirection.send);
}
break;
- case RawSocketEvent.READ_CLOSED:
+ case RawSocketEvent.readClosed:
tryComplete();
break;
}
diff --git a/tests/standalone_2/io/file_blocking_lock_script.dart b/tests/standalone_2/io/file_blocking_lock_script.dart
index 9ba2feb..00f8bb5 100644
--- a/tests/standalone_2/io/file_blocking_lock_script.dart
+++ b/tests/standalone_2/io/file_blocking_lock_script.dart
@@ -8,10 +8,10 @@
import "dart:io";
Future<int> testLockWholeFile(File file, int len) async {
- var raf = await file.open(mode: APPEND);
+ var raf = await file.open(mode: FileMode.append);
await raf.setPosition(0);
int nextToWrite = 1;
- await raf.lock(FileLock.BLOCKING_EXCLUSIVE, 0, len);
+ await raf.lock(FileLock.blockingExclusive, 0, len);
// Make sure the peer fails a non-blocking lock at some point.
await new Future.delayed(const Duration(seconds: 1));
diff --git a/tests/standalone_2/io/file_blocking_lock_test.dart b/tests/standalone_2/io/file_blocking_lock_test.dart
index 923710c..8896fb3 100644
--- a/tests/standalone_2/io/file_blocking_lock_test.dart
+++ b/tests/standalone_2/io/file_blocking_lock_test.dart
@@ -51,9 +51,9 @@
return false;
}
try {
- await raf.lock(FileLock.EXCLUSIVE, 0, length);
+ await raf.lock(FileLock.exclusive, 0, length);
} on dynamic {
- await raf.lock(FileLock.BLOCKING_EXCLUSIVE, 0, length);
+ await raf.lock(FileLock.blockingExclusive, 0, length);
break;
}
}
@@ -66,9 +66,9 @@
Directory directory = await Directory.systemTemp.createTemp('dart_file_lock');
File file = new File(join(directory.path, "file"));
await file.writeAsBytes(new List.filled(length, 0));
- var raf = await file.open(mode: APPEND);
- await raf.lock(FileLock.BLOCKING_EXCLUSIVE, 0, length);
- Process peer = await runPeer(file.path, length, FileLock.BLOCKING_EXCLUSIVE);
+ var raf = await file.open(mode: FileMode.append);
+ await raf.lock(FileLock.blockingExclusive, 0, length);
+ Process peer = await runPeer(file.path, length, FileLock.blockingExclusive);
// If the peer doesn't come up within the timeout, then give up on the test
// to avoid the test being flaky.
diff --git a/tests/standalone_2/io/file_error_test.dart b/tests/standalone_2/io/file_error_test.dart
index 5a3d381..27733f7 100644
--- a/tests/standalone_2/io/file_error_test.dart
+++ b/tests/standalone_2/io/file_error_test.dart
@@ -45,7 +45,7 @@
Expect.throws(
() => file.openSync(), (e) => checkOpenNonExistentFileSystemException(e));
- var openFuture = file.open(mode: FileMode.READ);
+ var openFuture = file.open(mode: FileMode.read);
openFuture.then((raf) => Expect.fail("Unreachable code")).catchError((error) {
checkOpenNonExistentFileSystemException(error);
temp.deleteSync(recursive: true);
@@ -228,7 +228,7 @@
testWriteByteToReadOnlyFile() {
createTestFile((file, done) {
- var openedFile = file.openSync(mode: FileMode.READ);
+ var openedFile = file.openSync(mode: FileMode.read);
// Writing to read only file should throw an exception.
Expect.throws(() => openedFile.writeByteSync(0),
@@ -244,7 +244,7 @@
testWriteFromToReadOnlyFile() {
createTestFile((file, done) {
- var openedFile = file.openSync(mode: FileMode.READ);
+ var openedFile = file.openSync(mode: FileMode.read);
List data = [0, 1, 2, 3];
// Writing to read only file should throw an exception.
@@ -261,10 +261,10 @@
testTruncateReadOnlyFile() {
createTestFile((file, done) {
- var openedFile = file.openSync(mode: FileMode.WRITE);
+ var openedFile = file.openSync(mode: FileMode.write);
openedFile.writeByteSync(0);
openedFile.closeSync();
- openedFile = file.openSync(mode: FileMode.READ);
+ openedFile = file.openSync(mode: FileMode.read);
// Truncating read only file should throw an exception.
Expect.throws(() => openedFile.truncateSync(0),
@@ -289,7 +289,7 @@
testOperateOnClosedFile() {
createTestFile((file, done) {
- var openedFile = file.openSync(mode: FileMode.READ);
+ var openedFile = file.openSync(mode: FileMode.read);
openedFile.closeSync();
List data = [0, 1, 2, 3];
diff --git a/tests/standalone_2/io/file_fuzz_test.dart b/tests/standalone_2/io/file_fuzz_test.dart
index 4a3637a..21c09c4 100644
--- a/tests/standalone_2/io/file_fuzz_test.dart
+++ b/tests/standalone_2/io/file_fuzz_test.dart
@@ -66,7 +66,7 @@
var temp = Directory.systemTemp.createTempSync('dart_file_fuzz');
var file = new File('${temp.path}/x');
file.createSync();
- var modes = [FileMode.READ, FileMode.WRITE, FileMode.APPEND];
+ var modes = [FileMode.read, FileMode.write, FileMode.append];
for (var m in modes) {
var opened = file.openSync(mode: m);
typeMapping.forEach((k, v) {
@@ -90,7 +90,7 @@
var temp = Directory.systemTemp.createTempSync('dart_file_fuzz');
var file = new File('${temp.path}/x');
file.createSync();
- var modes = [FileMode.READ, FileMode.WRITE, FileMode.APPEND];
+ var modes = [FileMode.read, FileMode.write, FileMode.append];
var futures = <Future>[];
var openedFiles = [];
for (var m in modes) {
diff --git a/tests/standalone_2/io/file_input_stream_test.dart b/tests/standalone_2/io/file_input_stream_test.dart
index e4087e8..4d48549 100644
--- a/tests/standalone_2/io/file_input_stream_test.dart
+++ b/tests/standalone_2/io/file_input_stream_test.dart
@@ -77,7 +77,7 @@
if (streamedBytes == 0) {
subscription.pause();
// Truncate the file by opening it for writing.
- file.open(mode: FileMode.WRITE).then((opened) {
+ file.open(mode: FileMode.write).then((opened) {
opened.close().then((_) {
Expect.equals(0, file.lengthSync());
subscription.resume();
@@ -141,7 +141,7 @@
subscription.pause();
// Double the length of the underlying file.
file.readAsBytes().then((bytes) {
- file.writeAsBytes(bytes, mode: FileMode.APPEND).then((_) {
+ file.writeAsBytes(bytes, mode: FileMode.append).then((_) {
Expect.equals(2 * originalLength, file.lengthSync());
subscription.resume();
});
diff --git a/tests/standalone_2/io/file_lock_script.dart b/tests/standalone_2/io/file_lock_script.dart
index 6c66c59..071f594 100644
--- a/tests/standalone_2/io/file_lock_script.dart
+++ b/tests/standalone_2/io/file_lock_script.dart
@@ -10,9 +10,9 @@
File file = new File(args[0]);
int start = null;
int end = null;
- var mode = FileLock.EXCLUSIVE;
+ var mode = FileLock.exclusive;
if (args[1] == 'SHARED') {
- mode = FileLock.SHARED;
+ mode = FileLock.shared;
}
if (args[2] != 'null') {
start = int.parse(args[2]);
@@ -20,7 +20,7 @@
if (args[3] != 'null') {
end = int.parse(args[3]);
}
- var raf = file.openSync(mode: WRITE);
+ var raf = file.openSync(mode: FileMode.write);
try {
raf.lockSync(mode, start, end);
print('LOCK SUCCEEDED');
diff --git a/tests/standalone_2/io/file_lock_test.dart b/tests/standalone_2/io/file_lock_test.dart
index f2f39fa..413288c 100644
--- a/tests/standalone_2/io/file_lock_test.dart
+++ b/tests/standalone_2/io/file_lock_test.dart
@@ -19,7 +19,7 @@
..addAll(Platform.executableArguments)
..add(Platform.script.resolve('file_lock_script.dart').toFilePath())
..add(path)
- ..add(mode == FileLock.EXCLUSIVE ? 'EXCLUSIVE' : 'SHARED')
+ ..add(mode == FileLock.exclusive ? 'EXCLUSIVE' : 'SHARED')
..add('$start')
..add('$end');
return Process
@@ -39,18 +39,18 @@
}
checkLocked(String path,
- [int start = 0, int end = -1, FileLock mode = FileLock.EXCLUSIVE]) =>
+ [int start = 0, int end = -1, FileLock mode = FileLock.exclusive]) =>
check(path, start, end, mode, locked: true);
checkNotLocked(String path,
- [int start = 0, int end = -1, FileLock mode = FileLock.EXCLUSIVE]) =>
+ [int start = 0, int end = -1, FileLock mode = FileLock.exclusive]) =>
check(path, start, end, mode, locked: false);
void testLockWholeFile() {
Directory directory = Directory.systemTemp.createTempSync('dart_file_lock');
File file = new File(join(directory.path, "file"));
file.writeAsBytesSync(new List.filled(10, 0));
- var raf = file.openSync(mode: WRITE);
+ var raf = file.openSync(mode: FileMode.write);
raf.lockSync();
asyncStart();
checkLocked(file.path).then((_) {
@@ -69,7 +69,7 @@
Directory directory = Directory.systemTemp.createTempSync('dart_file_lock');
File file = new File(join(directory.path, "file"));
file.writeAsBytesSync(new List.filled(10, 0));
- var raf = file.openSync(mode: WRITE);
+ var raf = file.openSync(mode: FileMode.write);
asyncStart();
Future.forEach([
() => raf.lock(),
@@ -88,12 +88,12 @@
Directory directory = Directory.systemTemp.createTempSync('dart_file_lock');
File file = new File(join(directory.path, "file"));
file.writeAsBytesSync(new List.filled(10, 0));
- var raf1 = file.openSync(mode: WRITE);
- var raf2 = file.openSync(mode: WRITE);
+ var raf1 = file.openSync(mode: FileMode.write);
+ var raf2 = file.openSync(mode: FileMode.write);
asyncStart();
var tests = [
- () => raf1.lockSync(FileLock.EXCLUSIVE, 2, 3),
- () => raf2.lockSync(FileLock.EXCLUSIVE, 5, 7),
+ () => raf1.lockSync(FileLock.exclusive, 2, 3),
+ () => raf2.lockSync(FileLock.exclusive, 5, 7),
() => checkNotLocked(file.path, 0, 2),
() => checkLocked(file.path, 0, 3),
() => checkNotLocked(file.path, 4, 5),
@@ -132,12 +132,12 @@
Directory directory = Directory.systemTemp.createTempSync('dart_file_lock');
File file = new File(join(directory.path, "file"));
file.writeAsBytesSync(new List.filled(10, 0));
- var raf1 = file.openSync(mode: WRITE);
- var raf2 = file.openSync(mode: WRITE);
+ var raf1 = file.openSync(mode: FileMode.write);
+ var raf2 = file.openSync(mode: FileMode.write);
asyncStart();
var tests = [
- () => raf1.lock(FileLock.EXCLUSIVE, 2, 3),
- () => raf2.lock(FileLock.EXCLUSIVE, 5, 7),
+ () => raf1.lock(FileLock.exclusive, 2, 3),
+ () => raf2.lock(FileLock.exclusive, 5, 7),
() => checkNotLocked(file.path, 0, 2),
() => checkLocked(file.path, 0, 3),
() => checkNotLocked(file.path, 4, 5),
@@ -175,10 +175,10 @@
Directory directory = Directory.systemTemp.createTempSync('dart_file_lock');
File file = new File(join(directory.path, "file"));
file.writeAsBytesSync(new List.filled(10, 0));
- var raf = file.openSync(mode: APPEND);
+ var raf = file.openSync(mode: FileMode.append);
asyncStart();
Future.forEach([
- () => raf.lockSync(FileLock.EXCLUSIVE, 2),
+ () => raf.lockSync(FileLock.exclusive, 2),
() => checkNotLocked(file.path, 0, 2),
() => checkLocked(file.path, 0, 3),
() => checkLocked(file.path, 9),
@@ -198,10 +198,10 @@
Directory directory = Directory.systemTemp.createTempSync('dart_file_lock');
File file = new File(join(directory.path, "file"));
file.writeAsBytesSync(new List.filled(10, 0));
- var raf = file.openSync(mode: APPEND);
+ var raf = file.openSync(mode: FileMode.append);
asyncStart();
Future.forEach([
- () => raf.lock(FileLock.EXCLUSIVE, 2),
+ () => raf.lock(FileLock.exclusive, 2),
() => checkNotLocked(file.path, 0, 2),
() => checkLocked(file.path, 0, 3),
() => checkLocked(file.path, 9),
@@ -224,10 +224,10 @@
var raf = file.openSync();
asyncStart();
Future.forEach([
- () => raf.lock(FileLock.SHARED),
+ () => raf.lock(FileLock.shared),
() => checkLocked(file.path),
() => checkLocked(file.path, 0, 2),
- () => checkNotLocked(file.path, 0, 2, FileLock.SHARED)
+ () => checkNotLocked(file.path, 0, 2, FileLock.shared)
], (f) => f()).then((_) {
raf.closeSync();
directory.deleteSync(recursive: true);
@@ -242,10 +242,10 @@
var raf = file.openSync();
asyncStart();
Future.forEach([
- () => raf.lock(FileLock.SHARED),
+ () => raf.lock(FileLock.shared),
() => checkLocked(file.path),
() => checkLocked(file.path, 0, 2),
- () => checkNotLocked(file.path, 0, 2, FileLock.SHARED)
+ () => checkNotLocked(file.path, 0, 2, FileLock.shared)
], (f) => f()).whenComplete(() {
raf.closeSync();
directory.deleteSync(recursive: true);
@@ -257,10 +257,10 @@
Directory directory = Directory.systemTemp.createTempSync('dart_file_lock');
File file = new File(join(directory.path, "file"));
file.writeAsBytesSync(new List.filled(10, 0));
- var raf = file.openSync(mode: APPEND);
+ var raf = file.openSync(mode: FileMode.append);
asyncStart();
Future.forEach([
- () => raf.lockSync(FileLock.EXCLUSIVE, 2, 15),
+ () => raf.lockSync(FileLock.exclusive, 2, 15),
() => checkNotLocked(file.path, 0, 2),
() => checkLocked(file.path, 0, 3),
() => checkLocked(file.path, 9),
@@ -281,10 +281,10 @@
Directory directory = Directory.systemTemp.createTempSync('dart_file_lock');
File file = new File(join(directory.path, "file"));
file.writeAsBytesSync(new List.filled(10, 0));
- var raf = file.openSync(mode: APPEND);
+ var raf = file.openSync(mode: FileMode.append);
asyncStart();
Future.forEach([
- () => raf.lock(FileLock.EXCLUSIVE, 2, 15),
+ () => raf.lock(FileLock.exclusive, 2, 15),
() => checkNotLocked(file.path, 0, 2),
() => checkLocked(file.path, 0, 3),
() => checkLocked(file.path, 9),
diff --git a/tests/standalone_2/io/file_stat_test.dart b/tests/standalone_2/io/file_stat_test.dart
index d7e134d..d7f6839 100644
--- a/tests/standalone_2/io/file_stat_test.dart
+++ b/tests/standalone_2/io/file_stat_test.dart
@@ -16,17 +16,17 @@
File file = new File(join(directory.path, "file"));
FileStat fileStat = FileStat.statSync(file.path);
FileStat fileStatDirect = file.statSync();
- Expect.equals(FileSystemEntityType.NOT_FOUND, fileStat.type);
- Expect.equals(FileSystemEntityType.NOT_FOUND, fileStatDirect.type);
+ Expect.equals(FileSystemEntityType.notFound, fileStat.type);
+ Expect.equals(FileSystemEntityType.notFound, fileStatDirect.type);
file.writeAsStringSync("Dart IO library test of FileStat");
new Timer(const Duration(seconds: 2), () {
file.readAsStringSync();
directory.listSync();
FileStat fileStat = FileStat.statSync(file.path);
FileStat fileStatDirect = file.statSync();
- Expect.equals(FileSystemEntityType.FILE, fileStat.type);
+ Expect.equals(FileSystemEntityType.file, fileStat.type);
Expect.equals(32, fileStat.size);
- Expect.equals(FileSystemEntityType.FILE, fileStatDirect.type);
+ Expect.equals(FileSystemEntityType.file, fileStatDirect.type);
Expect.equals(32, fileStatDirect.size);
if (Platform.operatingSystem != 'windows') {
Expect.isTrue(fileStat.modified.compareTo(fileStat.accessed) < 0);
@@ -35,8 +35,8 @@
Expect.equals(6 << 6, fileStat.mode & (6 << 6)); // Mode includes +urw.
FileStat directoryStat = FileStat.statSync(directory.path);
FileStat directoryStatDirect = directory.statSync();
- Expect.equals(FileSystemEntityType.DIRECTORY, directoryStat.type);
- Expect.equals(FileSystemEntityType.DIRECTORY, directoryStatDirect.type);
+ Expect.equals(FileSystemEntityType.directory, directoryStat.type);
+ Expect.equals(FileSystemEntityType.directory, directoryStatDirect.type);
if (Platform.operatingSystem != 'windows') {
Expect
.isTrue(directoryStat.modified.compareTo(directoryStat.accessed) < 0);
@@ -54,17 +54,17 @@
return FileStat
.stat(file.path)
.then((fileStat) =>
- Expect.equals(FileSystemEntityType.NOT_FOUND, fileStat.type))
+ Expect.equals(FileSystemEntityType.notFound, fileStat.type))
.then((_) => file.stat())
.then((fileStat) =>
- Expect.equals(FileSystemEntityType.NOT_FOUND, fileStat.type))
+ Expect.equals(FileSystemEntityType.notFound, fileStat.type))
.then((_) => file.writeAsString("Dart IO library test of FileStat"))
.then((_) => new Future.delayed(const Duration(seconds: 2)))
.then((_) => file.readAsString())
.then((_) => directory.list().last)
.then((_) => FileStat.stat(file.path))
.then((FileStat fileStat) {
- Expect.equals(FileSystemEntityType.FILE, fileStat.type);
+ Expect.equals(FileSystemEntityType.file, fileStat.type);
Expect.equals(32, fileStat.size);
if (Platform.operatingSystem != 'windows') {
Expect.isTrue(fileStat.modified.compareTo(fileStat.accessed) < 0);
@@ -73,7 +73,7 @@
Expect.equals(6 << 6, fileStat.mode & (6 << 6)); // Mode includes +urw.
return file.stat();
}).then((FileStat fileStat) {
- Expect.equals(FileSystemEntityType.FILE, fileStat.type);
+ Expect.equals(FileSystemEntityType.file, fileStat.type);
Expect.equals(32, fileStat.size);
if (Platform.operatingSystem != 'windows') {
Expect.isTrue(fileStat.modified.compareTo(fileStat.accessed) < 0);
@@ -82,7 +82,7 @@
Expect.equals(6 << 6, fileStat.mode & (6 << 6)); // Mode includes +urw.
return FileStat.stat(directory.path);
}).then((FileStat directoryStat) {
- Expect.equals(FileSystemEntityType.DIRECTORY, directoryStat.type);
+ Expect.equals(FileSystemEntityType.directory, directoryStat.type);
if (Platform.operatingSystem != 'windows') {
Expect.isTrue(
directoryStat.modified.compareTo(directoryStat.accessed) < 0);
@@ -92,7 +92,7 @@
Expect.equals(7 << 6, directoryStat.mode & (7 << 6)); // Includes +urwx.
return directory.stat();
}).then((FileStat directoryStat) {
- Expect.equals(FileSystemEntityType.DIRECTORY, directoryStat.type);
+ Expect.equals(FileSystemEntityType.directory, directoryStat.type);
if (Platform.operatingSystem != 'windows') {
Expect.isTrue(
directoryStat.modified.compareTo(directoryStat.accessed) < 0);
@@ -102,7 +102,7 @@
Expect.equals(7 << 6, directoryStat.mode & (7 << 6)); // Includes +urwx.
return new Link(directory.path).stat();
}).then((FileStat linkStat) {
- Expect.equals(FileSystemEntityType.DIRECTORY, linkStat.type);
+ Expect.equals(FileSystemEntityType.directory, linkStat.type);
if (Platform.operatingSystem != 'windows') {
Expect.isTrue(linkStat.modified.compareTo(linkStat.accessed) < 0);
Expect.isTrue(linkStat.changed.compareTo(linkStat.accessed) < 0);
diff --git a/tests/standalone_2/io/file_system_async_links_test.dart b/tests/standalone_2/io/file_system_async_links_test.dart
index c7e42c1..af62ca8 100644
--- a/tests/standalone_2/io/file_system_async_links_test.dart
+++ b/tests/standalone_2/io/file_system_async_links_test.dart
@@ -35,12 +35,12 @@
.then((_) => FutureExpect.isTrue(FileSystemEntity.isLink(y)))
.then((_) => FutureExpect.isFalse(FileSystemEntity.isLink(x)))
.then((_) => FutureExpect.equals(
- FileSystemEntityType.NOT_FOUND, FileSystemEntity.type(y)))
+ FileSystemEntityType.notFound, FileSystemEntity.type(y)))
.then((_) => FutureExpect.equals(
- FileSystemEntityType.NOT_FOUND, FileSystemEntity.type(x)))
- .then((_) => FutureExpect.equals(FileSystemEntityType.LINK,
+ FileSystemEntityType.notFound, FileSystemEntity.type(x)))
+ .then((_) => FutureExpect.equals(FileSystemEntityType.link,
FileSystemEntity.type(y, followLinks: false)))
- .then((_) => FutureExpect.equals(FileSystemEntityType.NOT_FOUND,
+ .then((_) => FutureExpect.equals(FileSystemEntityType.notFound,
FileSystemEntity.type(x, followLinks: false)))
.then((_) => FutureExpect.equals(x, new Link(y).target()))
.then((_) => new File(y).create())
@@ -52,12 +52,12 @@
.then((_) => FutureExpect.isTrue(FileSystemEntity.isFile(y)))
.then((_) => FutureExpect.isTrue(FileSystemEntity.isFile(x)))
.then((_) => FutureExpect.equals(
- FileSystemEntityType.FILE, FileSystemEntity.type(y)))
+ FileSystemEntityType.file, FileSystemEntity.type(y)))
.then((_) => FutureExpect.equals(
- FileSystemEntityType.FILE, FileSystemEntity.type(x)))
- .then((_) => FutureExpect.equals(FileSystemEntityType.LINK,
+ FileSystemEntityType.file, FileSystemEntity.type(x)))
+ .then((_) => FutureExpect.equals(FileSystemEntityType.link,
FileSystemEntity.type(y, followLinks: false)))
- .then((_) => FutureExpect.equals(FileSystemEntityType.FILE,
+ .then((_) => FutureExpect.equals(FileSystemEntityType.file,
FileSystemEntity.type(x, followLinks: false)))
.then((_) => FutureExpect.equals(x, new Link(y).target()))
.then((_) => new File(x).delete())
@@ -69,21 +69,21 @@
.then((_) => FutureExpect.isTrue(FileSystemEntity.isDirectory(y)))
.then((_) => FutureExpect.isTrue(FileSystemEntity.isDirectory(x)))
.then((_) => FutureExpect.equals(
- FileSystemEntityType.DIRECTORY, FileSystemEntity.type(y)))
+ FileSystemEntityType.directory, FileSystemEntity.type(y)))
.then((_) => FutureExpect.equals(
- FileSystemEntityType.DIRECTORY, FileSystemEntity.type(x)))
- .then((_) => FutureExpect.equals(FileSystemEntityType.LINK,
+ FileSystemEntityType.directory, FileSystemEntity.type(x)))
+ .then((_) => FutureExpect.equals(FileSystemEntityType.link,
FileSystemEntity.type(y, followLinks: false)))
- .then((_) => FutureExpect.equals(FileSystemEntityType.DIRECTORY,
+ .then((_) => FutureExpect.equals(FileSystemEntityType.directory,
FileSystemEntity.type(x, followLinks: false)))
.then((_) => FutureExpect.equals(x, new Link(y).target()))
.then((_) => new Link(y).delete())
.then((_) => FutureExpect.isFalse(FileSystemEntity.isLink(y)))
.then((_) => FutureExpect.isFalse(FileSystemEntity.isLink(x)))
.then((_) => FutureExpect.equals(
- FileSystemEntityType.NOT_FOUND, FileSystemEntity.type(y)))
+ FileSystemEntityType.notFound, FileSystemEntity.type(y)))
.then((_) => FutureExpect.equals(
- FileSystemEntityType.DIRECTORY, FileSystemEntity.type(x)))
+ FileSystemEntityType.directory, FileSystemEntity.type(x)))
.then((_) => FutureExpect.throws(new Link(y).target()))
.then((_) => temp.delete(recursive: true));
});
@@ -120,7 +120,7 @@
.create()
.then((_) => new Link(y).create(x))
.then((_) =>
- (new File(y).openWrite(mode: FileMode.WRITE)..add(data)).close())
+ (new File(y).openWrite(mode: FileMode.write)..add(data)).close())
.then((_) => FutureExpect.listEquals(data, new File(y).readAsBytes()))
.then((_) => FutureExpect.listEquals(data, new File(x).readAsBytes()))
.then((_) => temp.delete(recursive: true));
diff --git a/tests/standalone_2/io/file_system_links_test.dart b/tests/standalone_2/io/file_system_links_test.dart
index 231401c..9af7296 100644
--- a/tests/standalone_2/io/file_system_links_test.dart
+++ b/tests/standalone_2/io/file_system_links_test.dart
@@ -20,11 +20,11 @@
Expect.isFalse(new File(x).existsSync());
Expect.isTrue(FileSystemEntity.isLinkSync(y));
Expect.isFalse(FileSystemEntity.isLinkSync(x));
- Expect.equals(FileSystemEntityType.NOT_FOUND, FileSystemEntity.typeSync(y));
- Expect.equals(FileSystemEntityType.NOT_FOUND, FileSystemEntity.typeSync(x));
- Expect.equals(FileSystemEntityType.LINK,
+ Expect.equals(FileSystemEntityType.notFound, FileSystemEntity.typeSync(y));
+ Expect.equals(FileSystemEntityType.notFound, FileSystemEntity.typeSync(x));
+ Expect.equals(FileSystemEntityType.link,
FileSystemEntity.typeSync(y, followLinks: false));
- Expect.equals(FileSystemEntityType.NOT_FOUND,
+ Expect.equals(FileSystemEntityType.notFound,
FileSystemEntity.typeSync(x, followLinks: false));
Expect.equals(x, new Link(y).targetSync());
@@ -35,11 +35,11 @@
Expect.isFalse(FileSystemEntity.isLinkSync(x));
Expect.isTrue(FileSystemEntity.isFileSync(y));
Expect.isTrue(FileSystemEntity.isFileSync(x));
- Expect.equals(FileSystemEntityType.FILE, FileSystemEntity.typeSync(y));
- Expect.equals(FileSystemEntityType.FILE, FileSystemEntity.typeSync(x));
- Expect.equals(FileSystemEntityType.LINK,
+ Expect.equals(FileSystemEntityType.file, FileSystemEntity.typeSync(y));
+ Expect.equals(FileSystemEntityType.file, FileSystemEntity.typeSync(x));
+ Expect.equals(FileSystemEntityType.link,
FileSystemEntity.typeSync(y, followLinks: false));
- Expect.equals(FileSystemEntityType.FILE,
+ Expect.equals(FileSystemEntityType.file,
FileSystemEntity.typeSync(x, followLinks: false));
Expect.equals(x, new Link(y).targetSync());
@@ -49,19 +49,19 @@
Expect.isFalse(FileSystemEntity.isLinkSync(x));
Expect.isTrue(FileSystemEntity.isDirectorySync(y));
Expect.isTrue(FileSystemEntity.isDirectorySync(x));
- Expect.equals(FileSystemEntityType.DIRECTORY, FileSystemEntity.typeSync(y));
- Expect.equals(FileSystemEntityType.DIRECTORY, FileSystemEntity.typeSync(x));
- Expect.equals(FileSystemEntityType.LINK,
+ Expect.equals(FileSystemEntityType.directory, FileSystemEntity.typeSync(y));
+ Expect.equals(FileSystemEntityType.directory, FileSystemEntity.typeSync(x));
+ Expect.equals(FileSystemEntityType.link,
FileSystemEntity.typeSync(y, followLinks: false));
- Expect.equals(FileSystemEntityType.DIRECTORY,
+ Expect.equals(FileSystemEntityType.directory,
FileSystemEntity.typeSync(x, followLinks: false));
Expect.equals(x, new Link(y).targetSync());
new Link(y).deleteSync();
Expect.isFalse(FileSystemEntity.isLinkSync(y));
Expect.isFalse(FileSystemEntity.isLinkSync(x));
- Expect.equals(FileSystemEntityType.NOT_FOUND, FileSystemEntity.typeSync(y));
- Expect.equals(FileSystemEntityType.DIRECTORY, FileSystemEntity.typeSync(x));
+ Expect.equals(FileSystemEntityType.notFound, FileSystemEntity.typeSync(y));
+ Expect.equals(FileSystemEntityType.directory, FileSystemEntity.typeSync(x));
Expect.throws(() => new Link(y).targetSync());
temp.deleteSync(recursive: true);
@@ -97,7 +97,7 @@
new File(x).createSync();
createLink(x, y, () {
var data = "asdf".codeUnits;
- var output = new File(y).openWrite(mode: FileMode.WRITE);
+ var output = new File(y).openWrite(mode: FileMode.write);
output.add(data);
output.close();
output.done.then((_) {
diff --git a/tests/standalone_2/io/file_system_watcher_test.dart b/tests/standalone_2/io/file_system_watcher_test.dart
index 2a71f05..00b6a60 100644
--- a/tests/standalone_2/io/file_system_watcher_test.dart
+++ b/tests/standalone_2/io/file_system_watcher_test.dart
@@ -156,7 +156,7 @@
var dir = Directory.systemTemp.createTempSync('dart_file_system_watcher');
var file = new File(join(dir.path, 'file'));
- var watcher = dir.watch(events: FileSystemEvent.MODIFY);
+ var watcher = dir.watch(events: FileSystemEvent.modify);
asyncStart();
var sub;
@@ -188,19 +188,19 @@
sub = watcher.listen((event) {
int newState = 0;
switch (event.type) {
- case FileSystemEvent.CREATE:
+ case FileSystemEvent.create:
newState = 1;
break;
- case FileSystemEvent.MODIFY:
+ case FileSystemEvent.modify:
newState = 2;
break;
- case FileSystemEvent.MOVE:
+ case FileSystemEvent.move:
newState = 3;
break;
- case FileSystemEvent.DELETE:
+ case FileSystemEvent.delete:
newState = 4;
sub.cancel();
asyncEnd();
diff --git a/tests/standalone_2/io/file_test.dart b/tests/standalone_2/io/file_test.dart
index da550d8..3715504 100644
--- a/tests/standalone_2/io/file_test.dart
+++ b/tests/standalone_2/io/file_test.dart
@@ -232,7 +232,7 @@
// Read a file and check part of it's contents.
String filename = getFilename("file_test.txt");
File file = new File(filename);
- file.open(mode: READ).then((RandomAccessFile file) {
+ file.open(mode: FileMode.read).then((RandomAccessFile file) {
List<int> buffer = new List<int>(10);
file.readInto(buffer, 0, 5).then((bytes_read) {
Expect.equals(5, bytes_read);
@@ -303,7 +303,7 @@
// Read a file.
String inFilename = getFilename("fixed_length_file");
final File file = new File(inFilename);
- file.open(mode: READ).then((openedFile) {
+ file.open(mode: FileMode.read).then((openedFile) {
List<int> buffer1 = new List<int>(42);
openedFile.readInto(buffer1, 0, 42).then((bytes_read) {
Expect.equals(42, bytes_read);
@@ -317,12 +317,12 @@
if (s[0] != '/' && s[0] != '\\' && s[1] != ':') {
Expect.fail("Not a full path");
}
- file2.open(mode: WRITE).then((openedFile2) {
+ file2.open(mode: FileMode.write).then((openedFile2) {
openedFile2.writeFrom(buffer1, 0, bytes_read).then((ignore) {
openedFile2.close().then((ignore) {
List<int> buffer2 = new List<int>(bytes_read);
final File file3 = new File(outFilename);
- file3.open(mode: READ).then((openedFile3) {
+ file3.open(mode: FileMode.read).then((openedFile3) {
openedFile3.readInto(buffer2, 0, 42).then((bytes_read) {
Expect.equals(42, bytes_read);
openedFile3.close().then((ignore) {
@@ -360,17 +360,17 @@
file.createSync();
Expect.isTrue(new File(filename).existsSync());
List<int> buffer = content.codeUnits;
- RandomAccessFile openedFile = file.openSync(mode: WRITE);
+ RandomAccessFile openedFile = file.openSync(mode: FileMode.write);
openedFile.writeFromSync(buffer, 0, buffer.length);
openedFile.closeSync();
// Reopen the file in write mode to ensure that we overwrite the content.
- openedFile = (new File(filename)).openSync(mode: WRITE);
+ openedFile = (new File(filename)).openSync(mode: FileMode.write);
openedFile.writeFromSync(buffer, 0, buffer.length);
Expect.equals(content.length, openedFile.lengthSync());
openedFile.closeSync();
// Open the file in append mode and ensure that we do not overwrite
// the existing content.
- openedFile = (new File(filename)).openSync(mode: APPEND);
+ openedFile = (new File(filename)).openSync(mode: FileMode.append);
openedFile.writeFromSync(buffer, 2, buffer.length - 2);
Expect.equals(content.length + content.length - 4, openedFile.lengthSync());
Expect.equals(content + content.substring(2, content.length - 2),
@@ -391,12 +391,12 @@
output.close();
output.done.then((_) {
File file2 = new File(filename);
- var appendingOutput = file2.openWrite(mode: APPEND);
+ var appendingOutput = file2.openWrite(mode: FileMode.append);
appendingOutput.add(buffer);
appendingOutput.close();
appendingOutput.done.then((_) {
File file3 = new File(filename);
- file3.open(mode: READ).then((RandomAccessFile openedFile) {
+ file3.open(mode: FileMode.read).then((RandomAccessFile openedFile) {
openedFile.length().then((int length) {
Expect.equals(content.length * 2, length);
openedFile.close().then((ignore) {
@@ -457,7 +457,7 @@
Expect.fail("Not a full path");
}
Expect.isTrue(new File(path).existsSync());
- RandomAccessFile openedFile = outFile.openSync(mode: WRITE);
+ RandomAccessFile openedFile = outFile.openSync(mode: FileMode.write);
openedFile.writeFromSync(buffer1, 0, bytes_read);
openedFile.closeSync();
// Now read the contents of the file just written.
@@ -495,7 +495,7 @@
Expect.fail("Not a full path");
}
Expect.isTrue(new File(path).existsSync());
- RandomAccessFile openedFile = outFile.openSync(mode: WRITE);
+ RandomAccessFile openedFile = outFile.openSync(mode: FileMode.write);
openedFile.writeFromSync(buffer1);
openedFile.closeSync();
// Now read the contents of the file just written.
@@ -529,7 +529,7 @@
File file = new File(fileName);
asyncTestStarted();
file.create().then((ignore) {
- file.open(mode: READ).then((RandomAccessFile openedFile) {
+ file.open(mode: FileMode.read).then((RandomAccessFile openedFile) {
var readByteFuture = openedFile.readByte();
readByteFuture.then((int byte) {
Expect.equals(-1, byte);
@@ -547,7 +547,7 @@
final String fileName = "${tempDirectory.path}/testWriteVariousLists";
final File file = new File(fileName);
file.create().then((ignore) {
- file.open(mode: WRITE).then((RandomAccessFile openedFile) {
+ file.open(mode: FileMode.write).then((RandomAccessFile openedFile) {
// Write bytes from 0 to 7.
openedFile.writeFromSync([0], 0, 1);
openedFile.writeFromSync(const [1], 0, 1);
@@ -588,7 +588,7 @@
tmp = tempDirectory.createTempSync('write_from_offset_test_');
File f = new File('${tmp.path}/file')..createSync();
f.writeAsStringSync('pre-existing content\n', flush: true);
- raf = f.openSync(mode: FileMode.APPEND);
+ raf = f.openSync(mode: FileMode.append);
String truth = "Hello world";
raf.writeFromSync(utf8.encode('Hello world'), 2, 5);
raf.flushSync();
@@ -723,7 +723,7 @@
asyncTestStarted();
File file = new File(tempDirectory.path + "/out_truncate");
List<int> buffer = const [65, 65, 65, 65, 65, 65, 65, 65, 65, 65];
- file.open(mode: WRITE).then((RandomAccessFile openedFile) {
+ file.open(mode: FileMode.write).then((RandomAccessFile openedFile) {
openedFile.writeFrom(buffer, 0, 10).then((ignore) {
openedFile.length().then((length) {
Expect.equals(10, length);
@@ -748,7 +748,7 @@
static void testTruncateSync() {
File file = new File(tempDirectory.path + "/out_truncate_sync");
List<int> buffer = const [65, 65, 65, 65, 65, 65, 65, 65, 65, 65];
- RandomAccessFile openedFile = file.openSync(mode: WRITE);
+ RandomAccessFile openedFile = file.openSync(mode: FileMode.write);
openedFile.writeFromSync(buffer, 0, 10);
Expect.equals(10, openedFile.lengthSync());
openedFile.truncateSync(5);
@@ -773,7 +773,7 @@
asyncTestStarted();
File file = new File(tempDirectory.path + "/out_read_into");
- var openedFile = await file.open(mode: WRITE);
+ var openedFile = await file.open(mode: FileMode.write);
await openedFile.writeFrom(const [1, 2, 3]);
await openedFile.setPosition(0);
@@ -804,7 +804,7 @@
static void testReadIntoSync() {
File file = new File(tempDirectory.path + "/out_read_into_sync");
- var openedFile = file.openSync(mode: WRITE);
+ var openedFile = file.openSync(mode: FileMode.write);
openedFile.writeFromSync(const [1, 2, 3]);
openedFile.setPositionSync(0);
@@ -835,7 +835,7 @@
File file = new File(tempDirectory.path + "/out_write_from");
var buffer = const [1, 2, 3];
- var openedFile = await file.open(mode: WRITE);
+ var openedFile = await file.open(mode: FileMode.write);
await openedFile.writeFrom(buffer);
var result = []..addAll(buffer);
@@ -866,7 +866,7 @@
File file = new File(tempDirectory.path + "/out_write_from_sync");
var buffer = const [1, 2, 3];
- var openedFile = file.openSync(mode: WRITE);
+ var openedFile = file.openSync(mode: FileMode.write);
openedFile.writeFromSync(buffer);
var result = []..addAll(buffer);
@@ -894,7 +894,7 @@
bool exceptionCaught = false;
bool wrongExceptionCaught = false;
File input = new File(tempDirectory.path + "/out_close_exception");
- RandomAccessFile openedFile = input.openSync(mode: WRITE);
+ RandomAccessFile openedFile = input.openSync(mode: FileMode.write);
openedFile.closeSync();
try {
openedFile.readByteSync();
@@ -1000,7 +1000,7 @@
bool exceptionCaught = false;
bool wrongExceptionCaught = false;
File file = new File(tempDirectory.path + "/out_buffer_out_of_bounds");
- RandomAccessFile openedFile = file.openSync(mode: WRITE);
+ RandomAccessFile openedFile = file.openSync(mode: FileMode.write);
try {
List<int> buffer = new List<int>(10);
openedFile.readIntoSync(buffer, 0, 12);
@@ -1094,7 +1094,7 @@
static void testOpenDirectoryAsFile() {
var f = new File('.');
- var future = f.open(mode: READ);
+ var future = f.open(mode: FileMode.read);
future
.then((r) => Expect.fail('Directory opened as file'))
.catchError((e) {});
@@ -1452,10 +1452,10 @@
static void testAppend() {
asyncTestStarted();
var file = new File('${tempDirectory.path}/out_append');
- file.open(mode: WRITE).then((openedFile) {
+ file.open(mode: FileMode.write).then((openedFile) {
openedFile.writeString("asdf").then((ignore) {
openedFile.close().then((ignore) {
- file.open(mode: APPEND).then((openedFile) {
+ file.open(mode: FileMode.append).then((openedFile) {
openedFile.length().then((length) {
Expect.equals(4, length);
openedFile.writeString("asdf").then((ignore) {
@@ -1480,11 +1480,11 @@
static void testAppendSync() {
var file = new File('${tempDirectory.path}/out_append_sync');
- var openedFile = file.openSync(mode: WRITE);
+ var openedFile = file.openSync(mode: FileMode.write);
openedFile.writeStringSync("asdf");
Expect.equals(4, openedFile.lengthSync());
openedFile.closeSync();
- openedFile = file.openSync(mode: WRITE);
+ openedFile = file.openSync(mode: FileMode.write);
openedFile.setPositionSync(4);
openedFile.writeStringSync("asdf");
Expect.equals(8, openedFile.lengthSync());
@@ -1497,12 +1497,12 @@
asyncTestStarted();
var file = new File('${tempDirectory.path}/out_write_string');
var string = new String.fromCharCodes([0x192]);
- file.open(mode: WRITE).then((openedFile) {
+ file.open(mode: FileMode.write).then((openedFile) {
openedFile.writeString(string).then((_) {
openedFile.length().then((l) {
Expect.equals(2, l);
openedFile.close().then((_) {
- file.open(mode: APPEND).then((openedFile) {
+ file.open(mode: FileMode.append).then((openedFile) {
openedFile.setPosition(2).then((_) {
openedFile.writeString(string).then((_) {
openedFile.length().then((l) {
@@ -1531,11 +1531,11 @@
static void testWriteStringUtf8Sync() {
var file = new File('${tempDirectory.path}/out_write_string_sync');
var string = new String.fromCharCodes([0x192]);
- var openedFile = file.openSync(mode: WRITE);
+ var openedFile = file.openSync(mode: FileMode.write);
openedFile.writeStringSync(string);
Expect.equals(2, openedFile.lengthSync());
openedFile.closeSync();
- openedFile = file.openSync(mode: APPEND);
+ openedFile = file.openSync(mode: FileMode.append);
openedFile.setPositionSync(2);
openedFile.writeStringSync(string);
Expect.equals(4, openedFile.lengthSync());
diff --git a/tests/standalone_2/io/file_typed_data_test.dart b/tests/standalone_2/io/file_typed_data_test.dart
index 4ef1612..d10307d 100644
--- a/tests/standalone_2/io/file_typed_data_test.dart
+++ b/tests/standalone_2/io/file_typed_data_test.dart
@@ -23,7 +23,7 @@
Directory.systemTemp.createTemp('dart_file_typed_data').then((temp) {
var file = new File("${temp.path}/test");
- file.open(mode: FileMode.WRITE).then((raf) {
+ file.open(mode: FileMode.write).then((raf) {
return raf.writeFrom(list, 0, LIST_LENGTH);
}).then((raf) {
return raf.writeFrom(view, 0, VIEW_LENGTH);
@@ -53,7 +53,7 @@
Directory.systemTemp.createTemp('dart_file_typed_data').then((temp) {
var file = new File("${temp.path}/test");
- file.open(mode: FileMode.WRITE).then((raf) {
+ file.open(mode: FileMode.write).then((raf) {
return raf.writeFrom(list, 0, LIST_LENGTH);
}).then((raf) {
return raf.writeFrom(view, 0, VIEW_LENGTH);
@@ -83,7 +83,7 @@
Directory.systemTemp.createTemp('dart_file_typed_data').then((temp) {
var file = new File("${temp.path}/test");
- file.open(mode: FileMode.WRITE).then((raf) {
+ file.open(mode: FileMode.write).then((raf) {
return raf.writeFrom(list, 0, LIST_LENGTH);
}).then((raf) {
return raf.writeFrom(view, 0, VIEW_LENGTH);
@@ -115,7 +115,7 @@
Directory.systemTemp.createTemp('dart_file_typed_data').then((temp) {
var file = new File("${temp.path}/test");
- file.open(mode: FileMode.WRITE).then((raf) {
+ file.open(mode: FileMode.write).then((raf) {
return raf.writeFrom(
new Uint8List.view(list.buffer), 0, LIST_LENGTH_IN_BYTES);
}).then((raf) {
@@ -157,7 +157,7 @@
Directory.systemTemp.createTemp('dart_file_typed_data').then((temp) {
var file = new File("${temp.path}/test");
- file.open(mode: FileMode.WRITE).then((raf) {
+ file.open(mode: FileMode.write).then((raf) {
return raf.writeFrom(
new Uint8List.view(list.buffer), 0, LIST_LENGTH_IN_BYTES);
}).then((raf) {
@@ -199,7 +199,7 @@
Directory.systemTemp.createTemp('dart_file_typed_data').then((temp) {
var file = new File("${temp.path}/test");
- file.open(mode: FileMode.WRITE).then((raf) {
+ file.open(mode: FileMode.write).then((raf) {
return raf.writeFrom(
new Uint8List.view(list.buffer), 0, LIST_LENGTH_IN_BYTES);
}).then((raf) {
@@ -241,7 +241,7 @@
Directory.systemTemp.createTemp('dart_file_typed_data').then((temp) {
var file = new File("${temp.path}/test");
- file.open(mode: FileMode.WRITE).then((raf) {
+ file.open(mode: FileMode.write).then((raf) {
return raf.writeFrom(
new Uint8List.view(list.buffer), 0, LIST_LENGTH_IN_BYTES);
}).then((raf) {
@@ -283,7 +283,7 @@
Directory.systemTemp.createTemp('dart_file_typed_data').then((temp) {
var file = new File("${temp.path}/test");
- file.open(mode: FileMode.WRITE).then((raf) {
+ file.open(mode: FileMode.write).then((raf) {
return raf.writeFrom(
new Uint8List.view(list.buffer), 0, LIST_LENGTH_IN_BYTES);
}).then((raf) {
@@ -325,7 +325,7 @@
Directory.systemTemp.createTemp('dart_file_typed_data').then((temp) {
var file = new File("${temp.path}/test");
- file.open(mode: FileMode.WRITE).then((raf) {
+ file.open(mode: FileMode.write).then((raf) {
return raf.writeFrom(
new Uint8List.view(list.buffer), 0, LIST_LENGTH_IN_BYTES);
}).then((raf) {
diff --git a/tests/standalone_2/io/file_write_as_test.dart b/tests/standalone_2/io/file_write_as_test.dart
index efbe0a7..ce13ebd 100644
--- a/tests/standalone_2/io/file_write_as_test.dart
+++ b/tests/standalone_2/io/file_write_as_test.dart
@@ -13,7 +13,7 @@
var data = [50, 50, 50];
f.writeAsBytesSync(data);
Expect.listEquals(data, f.readAsBytesSync());
- f.writeAsBytesSync(data, mode: FileMode.APPEND, flush: true);
+ f.writeAsBytesSync(data, mode: FileMode.append, flush: true);
var expected = [50, 50, 50, 50, 50, 50];
Expect.listEquals(expected, f.readAsBytesSync());
}
@@ -23,7 +23,7 @@
var data = 'asdf';
f.writeAsStringSync(data);
Expect.equals(data, f.readAsStringSync());
- f.writeAsStringSync(data, mode: FileMode.APPEND, flush: true);
+ f.writeAsStringSync(data, mode: FileMode.append, flush: true);
Expect.equals('$data$data', f.readAsStringSync());
}
@@ -35,7 +35,7 @@
Expect.equals(f, file);
f.readAsBytes().then((bytes) {
Expect.listEquals(data, bytes);
- f.writeAsBytes(data, mode: FileMode.APPEND, flush: true).then((file) {
+ f.writeAsBytes(data, mode: FileMode.append, flush: true).then((file) {
Expect.equals(f, file);
f.readAsBytes().then((bytes) {
var expected = [50, 50, 50, 50, 50, 50];
@@ -56,7 +56,7 @@
Expect.equals(f, file);
f.readAsString().then((str) {
Expect.equals(data, str);
- f.writeAsString(data, mode: FileMode.APPEND, flush: true).then((file) {
+ f.writeAsString(data, mode: FileMode.append, flush: true).then((file) {
Expect.equals(f, file);
f.readAsString().then((str) {
Expect.equals('$data$data', str);
diff --git a/tests/standalone_2/io/file_write_only_test.dart b/tests/standalone_2/io/file_write_only_test.dart
index 6cb5842..a4e571e 100644
--- a/tests/standalone_2/io/file_write_only_test.dart
+++ b/tests/standalone_2/io/file_write_only_test.dart
@@ -34,7 +34,7 @@
Future write(Directory dir) async {
var f = new File("${dir.path}${Platform.pathSeparator}write");
- var raf = await f.open(mode: WRITE_ONLY);
+ var raf = await f.open(mode: FileMode.writeOnly);
await raf.writeString('Hello');
await raf.setPosition(0);
await raf.writeString('Hello');
@@ -42,7 +42,7 @@
await expectThrowsAsync(
raf.readByte(), 'Read from write only file succeeded');
await raf.close();
- raf = await f.open(mode: WRITE_ONLY_APPEND);
+ raf = await f.open(mode: FileMode.writeOnlyAppend);
await raf.writeString('Hello');
await expectThrowsAsync(
raf.readByte(), 'Read from write only file succeeded');
@@ -54,7 +54,7 @@
void writeSync(Directory dir) {
var f = new File("${dir.path}${Platform.pathSeparator}write_sync");
- var raf = f.openSync(mode: WRITE_ONLY);
+ var raf = f.openSync(mode: FileMode.writeOnly);
raf.writeStringSync('Hello');
raf.setPositionSync(0);
raf.writeStringSync('Hello');
@@ -65,10 +65,10 @@
Future openWrite(Directory dir) async {
var f = new File("${dir.path}${Platform.pathSeparator}open_write");
- var sink = f.openWrite(mode: WRITE_ONLY);
+ var sink = f.openWrite(mode: FileMode.writeOnly);
sink.write('Hello');
await sink.close();
- sink = await f.openWrite(mode: WRITE_ONLY_APPEND);
+ sink = await f.openWrite(mode: FileMode.writeOnlyAppend);
sink.write('Hello');
await sink.close();
Expect.equals(f.lengthSync(), 10);
diff --git a/tests/standalone_2/io/fuzz_support.dart b/tests/standalone_2/io/fuzz_support.dart
index 7d0e4aa..4b9d59d 100644
--- a/tests/standalone_2/io/fuzz_support.dart
+++ b/tests/standalone_2/io/fuzz_support.dart
@@ -13,7 +13,7 @@
'int': 0,
'int64': -9000000000000000000,
'String': 'a',
- 'FileMode': FileMode.READ,
+ 'FileMode': FileMode.read,
'num': 0.50,
'List<int>': const [1, 2, 3],
'Map<String, int>': const {"a": 23}
diff --git a/tests/standalone_2/io/internet_address_test.dart b/tests/standalone_2/io/internet_address_test.dart
index a7ffa18..1832207 100644
--- a/tests/standalone_2/io/internet_address_test.dart
+++ b/tests/standalone_2/io/internet_address_test.dart
@@ -7,65 +7,65 @@
import "package:expect/expect.dart";
void testDefaultAddresses() {
- var loopback4 = InternetAddress.LOOPBACK_IP_V4;
+ var loopback4 = InternetAddress.loopbackIPv4;
Expect.isNotNull(loopback4);
- Expect.equals(InternetAddressType.IP_V4, loopback4.type);
+ Expect.equals(InternetAddressType.IPv4, loopback4.type);
Expect.equals("127.0.0.1", loopback4.host);
Expect.equals("127.0.0.1", loopback4.address);
Expect.listEquals([127, 0, 0, 1], loopback4.rawAddress);
- var loopback6 = InternetAddress.LOOPBACK_IP_V6;
+ var loopback6 = InternetAddress.loopbackIPv6;
Expect.isNotNull(loopback6);
- Expect.equals(InternetAddressType.IP_V6, loopback6.type);
+ Expect.equals(InternetAddressType.IPv6, loopback6.type);
Expect.equals("::1", loopback6.host);
Expect.equals("::1", loopback6.address);
Expect.listEquals(
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1], loopback6.rawAddress);
- var any4 = InternetAddress.ANY_IP_V4;
+ var any4 = InternetAddress.anyIPv4;
Expect.isNotNull(any4);
- Expect.equals(InternetAddressType.IP_V4, any4.type);
+ Expect.equals(InternetAddressType.IPv4, any4.type);
Expect.equals("0.0.0.0", any4.host);
Expect.equals("0.0.0.0", any4.address);
- var any6 = InternetAddress.ANY_IP_V6;
+ var any6 = InternetAddress.anyIPv6;
Expect.isNotNull(any6);
- Expect.equals(InternetAddressType.IP_V6, any6.type);
+ Expect.equals(InternetAddressType.IPv6, any6.type);
Expect.equals("::", any6.host);
Expect.equals("::", any6.address);
}
void testConstructor() {
var loopback4 = new InternetAddress("127.0.0.1");
- Expect.equals(InternetAddressType.IP_V4, loopback4.type);
+ Expect.equals(InternetAddressType.IPv4, loopback4.type);
Expect.equals("127.0.0.1", loopback4.host);
Expect.equals("127.0.0.1", loopback4.address);
Expect.isFalse(loopback4.isMulticast);
var loopback6 = new InternetAddress("::1");
- Expect.equals(InternetAddressType.IP_V6, loopback6.type);
+ Expect.equals(InternetAddressType.IPv6, loopback6.type);
Expect.equals("::1", loopback6.host);
Expect.equals("::1", loopback6.address);
Expect.isFalse(loopback6.isMulticast);
var ip4 = new InternetAddress("10.20.30.40");
- Expect.equals(InternetAddressType.IP_V4, ip4.type);
+ Expect.equals(InternetAddressType.IPv4, ip4.type);
Expect.equals("10.20.30.40", ip4.host);
Expect.equals("10.20.30.40", ip4.address);
Expect.isFalse(ip4.isMulticast);
var ip6 = new InternetAddress("10:20::30:40");
- Expect.equals(InternetAddressType.IP_V6, ip6.type);
+ Expect.equals(InternetAddressType.IPv6, ip6.type);
Expect.equals("10:20::30:40", ip6.host);
Expect.equals("10:20::30:40", ip6.address);
Expect.isFalse(ip6.isMulticast);
var multicast4 = new InternetAddress("224.1.2.3");
- Expect.equals(InternetAddressType.IP_V4, multicast4.type);
+ Expect.equals(InternetAddressType.IPv4, multicast4.type);
Expect.isTrue(multicast4.isMulticast);
var multicast6 = new InternetAddress("FF00::1:2:3");
- Expect.equals(InternetAddressType.IP_V6, multicast6.type);
+ Expect.equals(InternetAddressType.IPv6, multicast6.type);
Expect.isTrue(multicast6.isMulticast);
Expect.throwsArgumentError(() => new InternetAddress("1.2.3"));
@@ -75,10 +75,9 @@
void testEquality() {
Expect.equals(
new InternetAddress("127.0.0.1"), new InternetAddress("127.0.0.1"));
- Expect.equals(
- new InternetAddress("127.0.0.1"), InternetAddress.LOOPBACK_IP_V4);
+ Expect.equals(new InternetAddress("127.0.0.1"), InternetAddress.loopbackIPv4);
Expect.equals(new InternetAddress("::1"), new InternetAddress("::1"));
- Expect.equals(new InternetAddress("::1"), InternetAddress.LOOPBACK_IP_V6);
+ Expect.equals(new InternetAddress("::1"), InternetAddress.loopbackIPv6);
Expect.equals(new InternetAddress("1:2:3:4:5:6:7:8"),
new InternetAddress("1:2:3:4:5:6:7:8"));
Expect.equals(
@@ -91,10 +90,10 @@
set.add(new InternetAddress("::1"));
set.add(new InternetAddress("1:2:3:4:5:6:7:8"));
Expect.isTrue(set.contains(new InternetAddress("127.0.0.1")));
- Expect.isTrue(set.contains(InternetAddress.LOOPBACK_IP_V4));
+ Expect.isTrue(set.contains(InternetAddress.loopbackIPv4));
Expect.isFalse(set.contains(new InternetAddress("127.0.0.2")));
Expect.isTrue(set.contains(new InternetAddress("::1")));
- Expect.isTrue(set.contains(InternetAddress.LOOPBACK_IP_V6));
+ Expect.isTrue(set.contains(InternetAddress.loopbackIPv6));
Expect.isFalse(set.contains(new InternetAddress("::2")));
Expect.isTrue(set.contains(new InternetAddress("1:2:3:4:5:6:7:8")));
Expect.isFalse(set.contains(new InternetAddress("1:2:3:4:5:6:7:9")));
diff --git a/tests/standalone_2/io/issue_22636_test.dart b/tests/standalone_2/io/issue_22636_test.dart
index 3289d49..4bfa9dc 100644
--- a/tests/standalone_2/io/issue_22636_test.dart
+++ b/tests/standalone_2/io/issue_22636_test.dart
@@ -20,7 +20,7 @@
void serverListen(RawSocket serverSide) {
void serveData(RawSocketEvent event) {
switch (event) {
- case RawSocketEvent.WRITE:
+ case RawSocketEvent.write:
serverSide.write(data);
if (serverFirstWrite) {
serverFirstWrite = false;
@@ -30,12 +30,12 @@
} else {
new Future.delayed(delay, () {
Expect.isTrue(serverReadClosedReceived);
- serverSide.shutdown(SocketDirection.SEND);
+ serverSide.shutdown(SocketDirection.send);
server.close();
});
}
break;
- case RawSocketEvent.READ_CLOSED:
+ case RawSocketEvent.readClosed:
Expect.isFalse(serverReadClosedReceived);
serverReadClosedReceived = true;
break;
@@ -46,12 +46,12 @@
}
test() async {
- server = await RawServerSocket.bind(InternetAddress.LOOPBACK_IP_V4, 0);
+ server = await RawServerSocket.bind(InternetAddress.loopbackIPv4, 0);
server.listen(serverListen);
- client = await RawSocket.connect(InternetAddress.LOOPBACK_IP_V4, server.port);
- client.shutdown(SocketDirection.SEND);
+ client = await RawSocket.connect(InternetAddress.loopbackIPv4, server.port);
+ client.shutdown(SocketDirection.send);
client.listen((RawSocketEvent event) {
- if (event == RawSocketEvent.READ) {
+ if (event == RawSocketEvent.read) {
client.read();
}
});
diff --git a/tests/standalone_2/io/issue_22637_test.dart b/tests/standalone_2/io/issue_22637_test.dart
index 2eba30b..c464e56 100644
--- a/tests/standalone_2/io/issue_22637_test.dart
+++ b/tests/standalone_2/io/issue_22637_test.dart
@@ -18,7 +18,7 @@
var data = new List.generate(200, (i) => i % 20 + 65);
var offset = 0;
void serveData(RawSocketEvent event) {
- if (event == RawSocketEvent.WRITE) {
+ if (event == RawSocketEvent.write) {
while (offset < data.length) {
var written = serverSide.write(data, offset);
offset += written;
@@ -36,7 +36,7 @@
}
void clientListen(RawSocketEvent event) {
- if (event == RawSocketEvent.READ) {
+ if (event == RawSocketEvent.read) {
client.readEventsEnabled = false;
new Future.delayed(delay, () {
var data = client.read(100);
@@ -46,7 +46,7 @@
client.readEventsEnabled = true;
return;
}
- client.shutdown(SocketDirection.SEND);
+ client.shutdown(SocketDirection.send);
data = client.read(100);
Expect.isNotNull(data);
client.close();
@@ -55,9 +55,9 @@
}
test() async {
- server = await RawServerSocket.bind(InternetAddress.LOOPBACK_IP_V4, 0);
+ server = await RawServerSocket.bind(InternetAddress.loopbackIPv4, 0);
server.listen(serverListen);
- client = await RawSocket.connect(InternetAddress.LOOPBACK_IP_V4, server.port);
+ client = await RawSocket.connect(InternetAddress.loopbackIPv4, server.port);
client.listen(clientListen);
}
diff --git a/tests/standalone_2/io/link_async_test.dart b/tests/standalone_2/io/link_async_test.dart
index 21118e7..1884abc 100644
--- a/tests/standalone_2/io/link_async_test.dart
+++ b/tests/standalone_2/io/link_async_test.dart
@@ -40,12 +40,12 @@
.create()
.then((_) => new Link(link).create(target))
.then((_) => FutureExpect.equals(
- FileSystemEntityType.DIRECTORY, FileSystemEntity.type(link)))
+ FileSystemEntityType.directory, FileSystemEntity.type(link)))
.then((_) => FutureExpect.equals(
- FileSystemEntityType.DIRECTORY, FileSystemEntity.type(target)))
- .then((_) => FutureExpect.equals(FileSystemEntityType.LINK,
+ FileSystemEntityType.directory, FileSystemEntity.type(target)))
+ .then((_) => FutureExpect.equals(FileSystemEntityType.link,
FileSystemEntity.type(link, followLinks: false)))
- .then((_) => FutureExpect.equals(FileSystemEntityType.DIRECTORY,
+ .then((_) => FutureExpect.equals(FileSystemEntityType.directory,
FileSystemEntity.type(target, followLinks: false)))
.then((_) => FutureExpect.isTrue(FileSystemEntity.isLink(link)))
.then((_) => FutureExpect.isFalse(FileSystemEntity.isLink(target)))
@@ -72,9 +72,9 @@
.then((_) => FutureExpect.isTrue(
new Directory(join(base, 'target', 'createdThroughLink'))
.exists()))
- .then((_) => FutureExpect.equals(FileSystemEntityType.DIRECTORY,
+ .then((_) => FutureExpect.equals(FileSystemEntityType.directory,
FileSystemEntity.type(createdThroughLink, followLinks: false)))
- .then((_) => FutureExpect.equals(FileSystemEntityType.DIRECTORY,
+ .then((_) => FutureExpect.equals(FileSystemEntityType.directory,
FileSystemEntity.type(createdDirectly, followLinks: false)))
// Test FileSystemEntity.identical on files, directories, and links,
diff --git a/tests/standalone_2/io/link_test.dart b/tests/standalone_2/io/link_test.dart
index 8292632..afc0f73 100644
--- a/tests/standalone_2/io/link_test.dart
+++ b/tests/standalone_2/io/link_test.dart
@@ -24,12 +24,12 @@
new Directory(target).createSync();
new Link(link).createSync(target);
Expect.equals(
- FileSystemEntityType.DIRECTORY, FileSystemEntity.typeSync(link));
+ FileSystemEntityType.directory, FileSystemEntity.typeSync(link));
Expect.equals(
- FileSystemEntityType.DIRECTORY, FileSystemEntity.typeSync(target));
- Expect.equals(FileSystemEntityType.LINK,
+ FileSystemEntityType.directory, FileSystemEntity.typeSync(target));
+ Expect.equals(FileSystemEntityType.link,
FileSystemEntity.typeSync(link, followLinks: false));
- Expect.equals(FileSystemEntityType.DIRECTORY,
+ Expect.equals(FileSystemEntityType.directory,
FileSystemEntity.typeSync(target, followLinks: false));
Expect.isTrue(FileSystemEntity.isLinkSync(link));
Expect.isFalse(FileSystemEntity.isLinkSync(target));
@@ -50,9 +50,9 @@
new Directory(join(base, 'link', 'createdDirectly')).existsSync());
Expect.isTrue(
new Directory(join(base, 'target', 'createdThroughLink')).existsSync());
- Expect.equals(FileSystemEntityType.DIRECTORY,
+ Expect.equals(FileSystemEntityType.directory,
FileSystemEntity.typeSync(createdThroughLink, followLinks: false));
- Expect.equals(FileSystemEntityType.DIRECTORY,
+ Expect.equals(FileSystemEntityType.directory,
FileSystemEntity.typeSync(createdDirectly, followLinks: false));
// Test FileSystemEntity.identical on files, directories, and links,
diff --git a/tests/standalone_2/io/process_detached_test.dart b/tests/standalone_2/io/process_detached_test.dart
index 66d1b19..55aeb06 100644
--- a/tests/standalone_2/io/process_detached_test.dart
+++ b/tests/standalone_2/io/process_detached_test.dart
@@ -19,7 +19,7 @@
var script =
Platform.script.resolve('process_detached_script.dart').toFilePath();
var future = Process.start(Platform.executable, [script],
- mode: ProcessStartMode.DETACHED);
+ mode: ProcessStartMode.detached);
future.then((process) {
Expect.isNotNull(process.pid);
Expect.isTrue(process.pid is int);
@@ -38,7 +38,7 @@
var script =
Platform.script.resolve('process_detached_script.dart').toFilePath();
var future = Process.start(Platform.executable, [script, 'echo'],
- mode: ProcessStartMode.DETACHED_WITH_STDIO);
+ mode: ProcessStartMode.detachedWithStdio);
future.then((process) {
Expect.isNotNull(process.pid);
Expect.isTrue(process.pid is int);
@@ -63,7 +63,7 @@
asyncStart();
Directory.systemTemp.createTemp('dart_detached_process').then((temp) {
var future =
- Process.start(temp.path, ['a', 'b'], mode: ProcessStartMode.DETACHED);
+ Process.start(temp.path, ['a', 'b'], mode: ProcessStartMode.detached);
future.then((process) {
Expect.fail('Starting process from invalid executable succeeded');
}, onError: (e) {
diff --git a/tests/standalone_2/io/process_inherit_stdio_script.dart b/tests/standalone_2/io/process_inherit_stdio_script.dart
index 7c8b648..0fa1e0b 100644
--- a/tests/standalone_2/io/process_inherit_stdio_script.dart
+++ b/tests/standalone_2/io/process_inherit_stdio_script.dart
@@ -18,7 +18,7 @@
var script =
Platform.script.resolve('process_inherit_stdio_script.dart').toFilePath();
var future = Process.start(Platform.executable, [script, "--child", "foo"],
- mode: ProcessStartMode.INHERIT_STDIO);
+ mode: ProcessStartMode.inheritStdio);
future.then((process) {
process.exitCode.then((c) {
asyncEnd();
diff --git a/tests/standalone_2/io/process_inherit_stdio_test.dart b/tests/standalone_2/io/process_inherit_stdio_test.dart
index 375f87e..090132a 100644
--- a/tests/standalone_2/io/process_inherit_stdio_test.dart
+++ b/tests/standalone_2/io/process_inherit_stdio_test.dart
@@ -17,7 +17,7 @@
main() {
asyncStart();
- // process_inherit_stdio_script.dart spawns a process in INHERIT_STDIO mode
+ // process_inherit_stdio_script.dart spawns a process in inheritStdio mode
// that prints to its stdout. Since that child process inherits the stdout
// of the process spawned here, we should see it.
var script =
diff --git a/tests/standalone_2/io/raw_datagram_read_all_test.dart b/tests/standalone_2/io/raw_datagram_read_all_test.dart
index 41bae16..9d3b8ef 100644
--- a/tests/standalone_2/io/raw_datagram_read_all_test.dart
+++ b/tests/standalone_2/io/raw_datagram_read_all_test.dart
@@ -11,7 +11,7 @@
main() {
asyncStart();
- var address = InternetAddress.LOOPBACK_IP_V4;
+ var address = InternetAddress.loopbackIPv4;
RawDatagramSocket.bind(address, 0).then((producer) {
RawDatagramSocket.bind(address, 0).then((receiver) {
int sent = 0;
@@ -25,7 +25,7 @@
});
var timer;
receiver.listen((event) {
- if (event != RawSocketEvent.READ) return;
+ if (event != RawSocketEvent.read) return;
var datagram = receiver.receive();
Expect.listEquals([0], datagram.data);
if (timer != null) timer.cancel();
diff --git a/tests/standalone_2/io/raw_secure_server_closing_test.dart b/tests/standalone_2/io/raw_secure_server_closing_test.dart
index 9bae586..8ad7c10 100644
--- a/tests/standalone_2/io/raw_secure_server_closing_test.dart
+++ b/tests/standalone_2/io/raw_secure_server_closing_test.dart
@@ -42,8 +42,8 @@
RawSecureServerSocket.bind(HOST, 0, serverContext).then((server) {
server.listen((serverConnection) {
serverConnection.listen((event) {
- if (toClose == "server" || event == RawSocketEvent.READ_CLOSED) {
- serverConnection.shutdown(SocketDirection.SEND);
+ if (toClose == "server" || event == RawSocketEvent.readClosed) {
+ serverConnection.shutdown(SocketDirection.send);
}
}, onDone: () {
serverEndDone.complete(null);
@@ -55,8 +55,8 @@
.connect(HOST, server.port, context: clientContext)
.then((clientConnection) {
clientConnection.listen((event) {
- if (toClose == "client" || event == RawSocketEvent.READ_CLOSED) {
- clientConnection.shutdown(SocketDirection.SEND);
+ if (toClose == "client" || event == RawSocketEvent.readClosed) {
+ clientConnection.shutdown(SocketDirection.send);
}
}, onDone: () {
clientEndDone.complete(null);
@@ -96,7 +96,7 @@
var subscription;
subscription = server.listen((connection) {
Expect.isTrue(resumed);
- connection.shutdown(SocketDirection.SEND);
+ connection.shutdown(SocketDirection.send);
if (++acceptCount == 2 * socketCount) {
server.close();
asyncEnd();
@@ -112,7 +112,7 @@
RawSecureSocket
.connect(HOST, server.port, context: clientContext)
.then((connection) {
- connection.shutdown(SocketDirection.SEND);
+ connection.shutdown(SocketDirection.send);
});
}
new Timer(const Duration(milliseconds: 500), () {
@@ -122,7 +122,7 @@
RawSecureSocket
.connect(HOST, server.port, context: clientContext)
.then((connection) {
- connection.shutdown(SocketDirection.SEND);
+ connection.shutdown(SocketDirection.send);
});
}
});
diff --git a/tests/standalone_2/io/raw_secure_socket_pause_test.dart b/tests/standalone_2/io/raw_secure_socket_pause_test.dart
index 9bcf421..34cbfe4 100644
--- a/tests/standalone_2/io/raw_secure_socket_pause_test.dart
+++ b/tests/standalone_2/io/raw_secure_socket_pause_test.dart
@@ -78,21 +78,21 @@
void handleRawEvent(RawSocketEvent event) {
Expect.isFalse(paused);
switch (event) {
- case RawSocketEvent.READ:
+ case RawSocketEvent.read:
Expect.isFalse(readEventsPaused);
runReadEventTest();
body.addAll(socket.read());
break;
- case RawSocketEvent.WRITE:
+ case RawSocketEvent.write:
written += socket.write(message, written, message.length - written);
if (written < message.length) {
socket.writeEventsEnabled = true;
} else {
- socket.shutdown(SocketDirection.SEND);
+ socket.shutdown(SocketDirection.send);
runPauseTest();
}
break;
- case RawSocketEvent.READ_CLOSED:
+ case RawSocketEvent.readClosed:
Expect.isTrue(body.length > 100);
Expect.equals(72, body.first);
Expect.equals(9, body.last);
diff --git a/tests/standalone_2/io/raw_secure_socket_test.dart b/tests/standalone_2/io/raw_secure_socket_test.dart
index 4689a50..c2ab9fc 100644
--- a/tests/standalone_2/io/raw_secure_socket_test.dart
+++ b/tests/standalone_2/io/raw_secure_socket_test.dart
@@ -44,18 +44,18 @@
context: clientContext);
socket.listen((RawSocketEvent event) {
switch (event) {
- case RawSocketEvent.READ:
+ case RawSocketEvent.read:
body.addAll(socket.read());
break;
- case RawSocketEvent.WRITE:
+ case RawSocketEvent.write:
written += socket.write(message, written, message.length - written);
if (written < message.length) {
socket.writeEventsEnabled = true;
} else {
- socket.shutdown(SocketDirection.SEND);
+ socket.shutdown(SocketDirection.send);
}
break;
- case RawSocketEvent.READ_CLOSED:
+ case RawSocketEvent.readClosed:
Expect.isTrue(body.length > 100, "$body\n${body.length}");
Expect.equals(72, body[0]);
Expect.equals(9, body[body.length - 1]);
diff --git a/tests/standalone_2/io/raw_server_socket_cancel_test.dart b/tests/standalone_2/io/raw_server_socket_cancel_test.dart
index 0c74a16..ccdb93b 100644
--- a/tests/standalone_2/io/raw_server_socket_cancel_test.dart
+++ b/tests/standalone_2/io/raw_server_socket_cancel_test.dart
@@ -38,13 +38,13 @@
client.writeEventsEnabled = false;
client.listen((event) {
switch (event) {
- case RawSocketEvent.READ:
+ case RawSocketEvent.read:
client.read();
break;
- case RawSocketEvent.READ_CLOSED:
- client.shutdown(SocketDirection.SEND);
+ case RawSocketEvent.readClosed:
+ client.shutdown(SocketDirection.send);
break;
- case RawSocketEvent.WRITE:
+ case RawSocketEvent.write:
Expect.fail("No write event expected");
break;
}
@@ -71,19 +71,19 @@
var subscription;
subscription = socket.listen((event) {
switch (event) {
- case RawSocketEvent.READ:
+ case RawSocketEvent.read:
Expect.fail("No read event expected");
break;
- case RawSocketEvent.READ_CLOSED:
+ case RawSocketEvent.readClosed:
done = true;
doneCount++;
checkDone();
break;
- case RawSocketEvent.WRITE:
+ case RawSocketEvent.write:
// We don't care if this write succeeds, so we don't check
// the return value (number of bytes written).
socket.write([1, 2, 3]);
- socket.shutdown(SocketDirection.SEND);
+ socket.shutdown(SocketDirection.send);
break;
}
}, onDone: () {
diff --git a/tests/standalone_2/io/raw_socket_cross_process_test.dart b/tests/standalone_2/io/raw_socket_cross_process_test.dart
index 86c7b3c..4ad4d04 100644
--- a/tests/standalone_2/io/raw_socket_cross_process_test.dart
+++ b/tests/standalone_2/io/raw_socket_cross_process_test.dart
@@ -7,11 +7,11 @@
import 'dart:io';
import "package:expect/expect.dart";
-const int NUM_SERVERS = 10;
+const int serversCount = 10;
void main(List<String> args) {
if (args.isEmpty) {
- for (int i = 0; i < NUM_SERVERS; ++i) {
+ for (int i = 0; i < serversCount; ++i) {
makeServer().then((server) {
runClientProcess(server.port).then((_) => server.close());
});
@@ -25,18 +25,18 @@
}
Future makeServer() {
- return RawServerSocket.bind(InternetAddress.LOOPBACK_IP_V4, 0).then((server) {
+ return RawServerSocket.bind(InternetAddress.loopbackIPv4, 0).then((server) {
server.listen((connection) {
connection.writeEventsEnabled = false;
connection.listen((event) {
switch (event) {
- case RawSocketEvent.READ:
+ case RawSocketEvent.read:
Expect.fail("No read event expected");
break;
- case RawSocketEvent.READ_CLOSED:
- connection.shutdown(SocketDirection.SEND);
+ case RawSocketEvent.readClosed:
+ connection.shutdown(SocketDirection.send);
break;
- case RawSocketEvent.WRITE:
+ case RawSocketEvent.write:
Expect.fail("No write event expected");
break;
}
@@ -68,8 +68,8 @@
}
runClient(int port) {
- RawSocket.connect(InternetAddress.LOOPBACK_IP_V4, port).then((connection) {
+ RawSocket.connect(InternetAddress.loopbackIPv4, port).then((connection) {
connection.listen((_) {}, onDone: () => print('SUCCESS'));
- connection.shutdown(SocketDirection.SEND);
+ connection.shutdown(SocketDirection.send);
});
}
diff --git a/tests/standalone_2/io/raw_socket_test.dart b/tests/standalone_2/io/raw_socket_test.dart
index 4f3eb57..27ad20c 100644
--- a/tests/standalone_2/io/raw_socket_test.dart
+++ b/tests/standalone_2/io/raw_socket_test.dart
@@ -21,7 +21,7 @@
void testSimpleBind() {
asyncStart();
- RawServerSocket.bind(InternetAddress.LOOPBACK_IP_V4, 0).then((s) {
+ RawServerSocket.bind(InternetAddress.loopbackIPv4, 0).then((s) {
Expect.isTrue(s.port > 0);
s.close();
asyncEnd();
@@ -49,8 +49,8 @@
// Bind to a port already in use.
asyncStart();
- RawServerSocket.bind(InternetAddress.LOOPBACK_IP_V4, 0).then((s) {
- RawServerSocket.bind(InternetAddress.LOOPBACK_IP_V4, s.port).then((t) {
+ RawServerSocket.bind(InternetAddress.loopbackIPv4, 0).then((s) {
+ RawServerSocket.bind(InternetAddress.loopbackIPv4, s.port).then((t) {
Expect.fail("Multiple listens on same port");
}).catchError((error) {
Expect.isTrue(error is SocketException);
@@ -62,7 +62,7 @@
void testSimpleConnect() {
asyncStart();
- RawServerSocket.bind(InternetAddress.LOOPBACK_IP_V4, 0).then((server) {
+ RawServerSocket.bind(InternetAddress.loopbackIPv4, 0).then((server) {
server.listen((socket) {
socket.close();
});
@@ -86,10 +86,10 @@
]).then((_) {
asyncEnd();
});
- RawServerSocket.bind(InternetAddress.LOOPBACK_IP_V4, 0).then((server) {
+ RawServerSocket.bind(InternetAddress.loopbackIPv4, 0).then((server) {
server.listen((serverConnection) {
serverConnection.listen((event) {
- if (toClose == "server" || event == RawSocketEvent.READ_CLOSED) {
+ if (toClose == "server" || event == RawSocketEvent.readClosed) {
serverConnection.shutdown(SocketDirection.SEND);
}
}, onDone: () {
@@ -100,7 +100,7 @@
});
RawSocket.connect("127.0.0.1", server.port).then((clientConnection) {
clientConnection.listen((event) {
- if (toClose == "client" || event == RawSocketEvent.READ_CLOSED) {
+ if (toClose == "client" || event == RawSocketEvent.readClosed) {
clientConnection.shutdown(SocketDirection.SEND);
}
}, onDone: () {
@@ -113,7 +113,7 @@
void testServerListenAfterConnect() {
asyncStart();
- RawServerSocket.bind(InternetAddress.LOOPBACK_IP_V4, 0).then((server) {
+ RawServerSocket.bind(InternetAddress.loopbackIPv4, 0).then((server) {
Expect.isTrue(server.port > 0);
RawSocket.connect("127.0.0.1", server.port).then((client) {
server.listen((socket) {
@@ -149,7 +149,7 @@
}
}
- RawServerSocket.bind(InternetAddress.LOOPBACK_IP_V4, 0).then((server) {
+ RawServerSocket.bind(InternetAddress.loopbackIPv4, 0).then((server) {
server.listen((client) {
int bytesRead = 0;
int bytesWritten = 0;
@@ -159,7 +159,7 @@
client.writeEventsEnabled = false;
client.listen((event) {
switch (event) {
- case RawSocketEvent.READ:
+ case RawSocketEvent.read:
if (dropReads) {
if (serverReadCount != 10) {
serverReadCount++;
@@ -178,7 +178,7 @@
client.writeEventsEnabled = true;
}
break;
- case RawSocketEvent.WRITE:
+ case RawSocketEvent.write:
Expect.isFalse(client.writeEventsEnabled);
bytesWritten +=
client.write(data, bytesWritten, data.length - bytesWritten);
@@ -189,10 +189,10 @@
client.shutdown(SocketDirection.SEND);
}
break;
- case RawSocketEvent.READ_CLOSED:
+ case RawSocketEvent.readClosed:
server.close();
break;
- case RawSocketEvent.CLOSED:
+ case RawSocketEvent.closed:
Expect.isFalse(closedEventReceived);
closedEventReceived = true;
break;
@@ -210,7 +210,7 @@
socket.listen((event) {
switch (event) {
- case RawSocketEvent.READ:
+ case RawSocketEvent.read:
Expect.isTrue(socket.available() > 0);
if (dropReads) {
if (clientReadCount != 10) {
@@ -224,7 +224,7 @@
data.setRange(bytesRead, bytesRead + buffer.length, buffer);
bytesRead += buffer.length;
break;
- case RawSocketEvent.WRITE:
+ case RawSocketEvent.write:
Expect.isTrue(bytesRead == 0);
Expect.isFalse(socket.writeEventsEnabled);
bytesWritten +=
@@ -235,11 +235,11 @@
data = new List<int>(messageSize);
}
break;
- case RawSocketEvent.READ_CLOSED:
+ case RawSocketEvent.readClosed:
verifyTestData(data);
socket.close();
break;
- case RawSocketEvent.CLOSED:
+ case RawSocketEvent.closed:
Expect.isFalse(closedEventReceived);
closedEventReceived = true;
break;
@@ -260,7 +260,7 @@
var resumed = false;
asyncStart();
- RawServerSocket.bind(InternetAddress.LOOPBACK_IP_V4, 0).then((server) {
+ RawServerSocket.bind(InternetAddress.loopbackIPv4, 0).then((server) {
Expect.isTrue(server.port > 0);
var subscription = server.listen((socket) {
socket.close();
@@ -304,16 +304,16 @@
var readSubscription;
asyncStart();
- RawServerSocket.bind(InternetAddress.LOOPBACK_IP_V4, 0).then((server) {
+ RawServerSocket.bind(InternetAddress.loopbackIPv4, 0).then((server) {
Expect.isTrue(server.port > 0);
server.listen((client) {
bool closedEventReceived = false;
List<int> data = new List<int>.filled(messageSize, 0);
writeSubscription = client.listen((event) {
switch (event) {
- case RawSocketEvent.READ:
+ case RawSocketEvent.read:
throw "Unexpected read event";
- case RawSocketEvent.WRITE:
+ case RawSocketEvent.write:
if (pauseResumeCount == loopCount) return;
Expect.isFalse(client.writeEventsEnabled);
Expect.equals(0, bytesRead); // Checks that reader is paused.
@@ -330,11 +330,11 @@
}
client.writeEventsEnabled = true;
break;
- case RawSocketEvent.READ_CLOSED:
+ case RawSocketEvent.readClosed:
client.close();
server.close();
break;
- case RawSocketEvent.CLOSED:
+ case RawSocketEvent.closed:
Expect.isFalse(closedEventReceived);
closedEventReceived = true;
break;
@@ -349,7 +349,7 @@
socket.writeEventsEnabled = false;
readSubscription = socket.listen((event) {
switch (event) {
- case RawSocketEvent.READ:
+ case RawSocketEvent.read:
Expect.equals(0, bytesWritten); // Checks that writer is paused.
Expect.isTrue(socket.available() > 0);
var buffer = socket.read();
@@ -368,11 +368,11 @@
writeSubscription.resume();
}
break;
- case RawSocketEvent.WRITE:
+ case RawSocketEvent.write:
throw "Unexpected write event";
- case RawSocketEvent.READ_CLOSED:
+ case RawSocketEvent.readClosed:
throw "Unexpected read closed event";
- case RawSocketEvent.CLOSED:
+ case RawSocketEvent.closed:
Expect.isFalse(closedEventReceived);
closedEventReceived = true;
break;
@@ -388,19 +388,19 @@
void testSocketZone() {
asyncStart();
- Expect.equals(Zone.ROOT, Zone.current);
+ Expect.equals(Zone.root, Zone.current);
runZoned(() {
- Expect.notEquals(Zone.ROOT, Zone.current);
- RawServerSocket.bind(InternetAddress.LOOPBACK_IP_V4, 0).then((server) {
- Expect.notEquals(Zone.ROOT, Zone.current);
+ Expect.notEquals(Zone.root, Zone.current);
+ RawServerSocket.bind(InternetAddress.loopbackIPv4, 0).then((server) {
+ Expect.notEquals(Zone.root, Zone.current);
server.listen((socket) {
- Expect.notEquals(Zone.ROOT, Zone.current);
+ Expect.notEquals(Zone.root, Zone.current);
socket.close();
server.close();
});
RawSocket.connect("127.0.0.1", server.port).then((socket) {
socket.listen((event) {
- if (event == RawSocketEvent.READ_CLOSED) {
+ if (event == RawSocketEvent.readClosed) {
socket.close();
asyncEnd();
}
@@ -412,13 +412,13 @@
void testSocketZoneError() {
asyncStart();
- Expect.equals(Zone.ROOT, Zone.current);
+ Expect.equals(Zone.root, Zone.current);
runZoned(() {
- Expect.notEquals(Zone.ROOT, Zone.current);
- RawServerSocket.bind(InternetAddress.LOOPBACK_IP_V4, 0).then((server) {
- Expect.notEquals(Zone.ROOT, Zone.current);
+ Expect.notEquals(Zone.root, Zone.current);
+ RawServerSocket.bind(InternetAddress.loopbackIPv4, 0).then((server) {
+ Expect.notEquals(Zone.root, Zone.current);
server.listen((socket) {
- Expect.notEquals(Zone.ROOT, Zone.current);
+ Expect.notEquals(Zone.root, Zone.current);
var timer;
void write() {
socket.write(const [0]);
@@ -428,7 +428,7 @@
write();
socket.listen((_) {}, onError: (error) {
timer.cancel();
- Expect.notEquals(Zone.ROOT, Zone.current);
+ Expect.notEquals(Zone.root, Zone.current);
socket.close();
server.close();
throw error;
@@ -445,7 +445,7 @@
void testClosedError() {
asyncStart();
- RawServerSocket.bind(InternetAddress.LOOPBACK_IP_V4, 0).then((server) {
+ RawServerSocket.bind(InternetAddress.loopbackIPv4, 0).then((server) {
server.listen((socket) {
socket.close();
});
diff --git a/tests/standalone_2/io/raw_socket_typed_data_test.dart b/tests/standalone_2/io/raw_socket_typed_data_test.dart
index 74ffd73..df31f73 100644
--- a/tests/standalone_2/io/raw_socket_typed_data_test.dart
+++ b/tests/standalone_2/io/raw_socket_typed_data_test.dart
@@ -16,21 +16,21 @@
testOutOfRange() {
asyncStart();
- RawServerSocket.bind(InternetAddress.LOOPBACK_IP_V4, 0).then((server) {
+ RawServerSocket.bind(InternetAddress.loopbackIPv4, 0).then((server) {
server.listen((client) {
client.writeEventsEnabled = false;
client.listen((event) {
switch (event) {
- case RawSocketEvent.READ:
+ case RawSocketEvent.read:
Expect.fail("No data expected");
break;
- case RawSocketEvent.WRITE:
+ case RawSocketEvent.write:
break;
- case RawSocketEvent.READ_CLOSED:
+ case RawSocketEvent.readClosed:
client.close();
server.close();
break;
- case RawSocketEvent.CLOSED:
+ case RawSocketEvent.closed:
break;
default:
throw "Unexpected event $event";
@@ -41,9 +41,9 @@
RawSocket.connect("127.0.0.1", server.port).then((socket) {
socket.listen((event) {
switch (event) {
- case RawSocketEvent.READ:
+ case RawSocketEvent.read:
break;
- case RawSocketEvent.WRITE:
+ case RawSocketEvent.write:
Expect.isFalse(socket.writeEventsEnabled);
var data;
data = new Uint16List(1);
@@ -74,9 +74,9 @@
Expect.throws(() => socket.write([256]));
socket.close();
break;
- case RawSocketEvent.READ_CLOSED:
+ case RawSocketEvent.readClosed:
break;
- case RawSocketEvent.CLOSED:
+ case RawSocketEvent.closed:
break;
default:
throw "Unexpected event $event";
@@ -120,7 +120,7 @@
Expect.listEquals(expected, data);
}
- RawServerSocket.bind(InternetAddress.LOOPBACK_IP_V4, 0).then((server) {
+ RawServerSocket.bind(InternetAddress.loopbackIPv4, 0).then((server) {
server.listen((client) {
int bytesRead = 0;
int bytesWritten = 0;
@@ -131,7 +131,7 @@
client.writeEventsEnabled = false;
client.listen((event) {
switch (event) {
- case RawSocketEvent.READ:
+ case RawSocketEvent.read:
Expect.isTrue(bytesWritten == 0);
Expect.isTrue(client.available() > 0);
var buffer = client.read();
@@ -142,7 +142,7 @@
client.writeEventsEnabled = true;
}
break;
- case RawSocketEvent.WRITE:
+ case RawSocketEvent.write:
Expect.isTrue(bytesRead == messageSize);
Expect.isFalse(client.writeEventsEnabled);
bytesWritten += client.write(
@@ -155,14 +155,14 @@
if (index < data.length) {
client.writeEventsEnabled = true;
} else {
- client.shutdown(SocketDirection.SEND);
+ client.shutdown(SocketDirection.send);
}
}
break;
- case RawSocketEvent.READ_CLOSED:
+ case RawSocketEvent.readClosed:
server.close();
break;
- case RawSocketEvent.CLOSED:
+ case RawSocketEvent.closed:
break;
default:
throw "Unexpected event $event";
@@ -179,13 +179,13 @@
socket.listen((event) {
switch (event) {
- case RawSocketEvent.READ:
+ case RawSocketEvent.read:
Expect.isTrue(socket.available() > 0);
var buffer = socket.read();
received.setRange(bytesRead, bytesRead + buffer.length, buffer);
bytesRead += buffer.length;
break;
- case RawSocketEvent.WRITE:
+ case RawSocketEvent.write:
Expect.isTrue(bytesRead == 0);
Expect.isFalse(socket.writeEventsEnabled);
bytesWritten += socket.write(
@@ -200,11 +200,11 @@
}
}
break;
- case RawSocketEvent.READ_CLOSED:
+ case RawSocketEvent.readClosed:
verifyTestData(received);
socket.close();
break;
- case RawSocketEvent.CLOSED:
+ case RawSocketEvent.closed:
break;
default:
throw "Unexpected event $event";
diff --git a/tests/standalone_2/io/raw_socket_write_destroy_test.dart b/tests/standalone_2/io/raw_socket_write_destroy_test.dart
index 1ef85a2..557163e 100644
--- a/tests/standalone_2/io/raw_socket_write_destroy_test.dart
+++ b/tests/standalone_2/io/raw_socket_write_destroy_test.dart
@@ -29,7 +29,7 @@
}
socket.listen((e) {
- if (e == RawSocketEvent.WRITE) {
+ if (e == RawSocketEvent.write) {
if (offset == buffer.length) {
socket.close();
} else {
@@ -42,9 +42,9 @@
RawSocket.connect(SERVER_ADDRESS, server.port).then((socket) {
var bytes = 0;
socket.listen((e) {
- if (e == RawSocketEvent.READ) {
+ if (e == RawSocketEvent.read) {
bytes += socket.read().length;
- } else if (e == RawSocketEvent.READ_CLOSED) {
+ } else if (e == RawSocketEvent.readClosed) {
Expect.equals(WROTE, bytes);
socket.close();
server.close();
@@ -60,9 +60,9 @@
server.listen((socket) {
var bytes = 0;
socket.listen((e) {
- if (e == RawSocketEvent.READ) {
+ if (e == RawSocketEvent.read) {
bytes += socket.read().length;
- } else if (e == RawSocketEvent.READ_CLOSED) {
+ } else if (e == RawSocketEvent.readClosed) {
Expect.equals(WROTE, bytes);
socket.close();
server.close();
@@ -81,7 +81,7 @@
}
socket.listen((e) {
- if (e == RawSocketEvent.WRITE) {
+ if (e == RawSocketEvent.write) {
if (offset == buffer.length) {
socket.close();
} else {
diff --git a/tests/standalone_2/io/raw_synchronous_socket_test.dart b/tests/standalone_2/io/raw_synchronous_socket_test.dart
index 5492b69..ba89758 100644
--- a/tests/standalone_2/io/raw_synchronous_socket_test.dart
+++ b/tests/standalone_2/io/raw_synchronous_socket_test.dart
@@ -10,16 +10,15 @@
import "package:async_helper/async_helper.dart";
import "package:expect/expect.dart";
-const String LOOPBACK_IP_V4_STRING = "127.0.0.1";
+const String loopbackIPv4String = "127.0.0.1";
void testArguments() {
Expect.throws(() => RawSynchronousSocket.connectSync(null, 0));
+ Expect
+ .throws(() => RawSynchronousSocket.connectSync(loopbackIPv4String, null));
Expect.throws(
- () => RawSynchronousSocket.connectSync(LOOPBACK_IP_V4_STRING, null));
- Expect.throws(
- () => RawSynchronousSocket.connectSync(LOOPBACK_IP_V4_STRING, 65536));
- Expect.throws(
- () => RawSynchronousSocket.connectSync(LOOPBACK_IP_V4_STRING, -1));
+ () => RawSynchronousSocket.connectSync(loopbackIPv4String, 65536));
+ Expect.throws(() => RawSynchronousSocket.connectSync(loopbackIPv4String, -1));
}
// The connection attempt happens on the main Dart thread and the OS timeout can
@@ -48,9 +47,9 @@
void testSimpleConnect() {
asyncStart();
- RawServerSocket.bind(InternetAddress.LOOPBACK_IP_V4, 0).then((server) {
+ RawServerSocket.bind(InternetAddress.loopbackIPv4, 0).then((server) {
var socket =
- RawSynchronousSocket.connectSync(LOOPBACK_IP_V4_STRING, server.port);
+ RawSynchronousSocket.connectSync(loopbackIPv4String, server.port);
server.listen((serverSocket) {
Expect.equals(socket.address, serverSocket.remoteAddress);
Expect.equals(socket.port, serverSocket.remotePort);
@@ -65,10 +64,10 @@
void testServerListenAfterConnect() {
asyncStart();
- RawServerSocket.bind(InternetAddress.LOOPBACK_IP_V4, 0).then((server) {
+ RawServerSocket.bind(InternetAddress.loopbackIPv4, 0).then((server) {
Expect.isTrue(server.port > 0);
var client =
- RawSynchronousSocket.connectSync(LOOPBACK_IP_V4_STRING, server.port);
+ RawSynchronousSocket.connectSync(loopbackIPv4String, server.port);
server.listen((socket) {
client.closeSync();
server.close();
@@ -119,7 +118,7 @@
// sender. The server should shutdown automatically after a specified number of
// socket disconnections (default: 1).
Future echoServer(var sendPort) async {
- RawServerSocket.bind(InternetAddress.LOOPBACK_IP_V4, 0).then((server) async {
+ RawServerSocket.bind(InternetAddress.loopbackIPv4, 0).then((server) async {
ReceivePort receivePort = new ReceivePort();
Map response = {
EchoServerTypes.ISOLATE_SEND_PORT: receivePort.sendPort,
@@ -141,7 +140,7 @@
client.writeEventsEnabled = false;
client.listen((event) {
switch (event) {
- case RawSocketEvent.READ:
+ case RawSocketEvent.read:
Expect.isTrue(bytesWritten == 0);
Expect.isTrue(client.available() > 0);
var buffer = client.read(client.available());
@@ -154,7 +153,7 @@
client.writeEventsEnabled = true;
}
break;
- case RawSocketEvent.WRITE:
+ case RawSocketEvent.write:
Expect.isFalse(client.writeEventsEnabled);
bytesWritten +=
client.write(data, bytesWritten, data.length - bytesWritten);
@@ -164,13 +163,13 @@
// Close the socket for writing from the server since we're done
// writing to this socket. The connection is closed completely
// after the client closes the socket for reading from the server.
- client.shutdown(SocketDirection.SEND);
+ client.shutdown(SocketDirection.send);
}
break;
- case RawSocketEvent.READ_CLOSED:
+ case RawSocketEvent.readClosed:
client.close();
break;
- case RawSocketEvent.CLOSED:
+ case RawSocketEvent.closed:
Expect.isFalse(closedEventReceived);
closedEventReceived = true;
break;
@@ -221,12 +220,12 @@
try {
var socket = RawSynchronousSocket.connectSync(
- LOOPBACK_IP_V4_STRING, serverInternetPort);
+ loopbackIPv4String, serverInternetPort);
List<int> data = createTestData();
socket.writeFromSync(data);
List<int> result = socket.readSync(data.length);
verifyTestData(result);
- socket.shutdown(SocketDirection.SEND);
+ socket.shutdown(SocketDirection.send);
socket.closeSync();
} catch (e, stack) {
print("Echo test failed in the client");
@@ -265,7 +264,7 @@
try {
var socket = RawSynchronousSocket.connectSync(
- LOOPBACK_IP_V4_STRING, serverInternetPort);
+ loopbackIPv4String, serverInternetPort);
int half_length = (data.length / 2).toInt();
// Send the full data list to the server.
@@ -322,7 +321,7 @@
sendPort.send(limits);
try {
var socket = RawSynchronousSocket.connectSync(
- LOOPBACK_IP_V4_STRING, serverInternetPort);
+ loopbackIPv4String, serverInternetPort);
List<int> data = createTestData();
// Write a subset of data to the server.
@@ -377,11 +376,11 @@
try {
var socket = RawSynchronousSocket.connectSync(
- LOOPBACK_IP_V4_STRING, serverInternetPort);
+ loopbackIPv4String, serverInternetPort);
// Close from both directions. Shouldn't be able to read/write to the
// socket.
- socket.shutdown(SocketDirection.BOTH);
+ socket.shutdown(SocketDirection.both);
Expect.throws(
() => socket.writeFromSync(data), (e) => e is SocketException);
Expect.throws(
@@ -391,8 +390,8 @@
// Close the socket for reading then try and perform a read. This should
// cause a SocketException.
socket = RawSynchronousSocket.connectSync(
- LOOPBACK_IP_V4_STRING, serverInternetPort);
- socket.shutdown(SocketDirection.RECEIVE);
+ loopbackIPv4String, serverInternetPort);
+ socket.shutdown(SocketDirection.receive);
// Throws exception when the socket is closed for RECEIVE.
Expect.throws(
() => socket.readSync(data.length), (e) => e is SocketException);
@@ -401,8 +400,8 @@
// Close the socket for writing and try to do a write. This should cause an
// OSError to be throw as the pipe is closed for writing.
socket = RawSynchronousSocket.connectSync(
- LOOPBACK_IP_V4_STRING, serverInternetPort);
- socket.shutdown(SocketDirection.SEND);
+ loopbackIPv4String, serverInternetPort);
+ socket.shutdown(SocketDirection.send);
Expect.throws(
() => socket.writeFromSync(data), (e) => e is SocketException);
socket.closeSync();
@@ -421,11 +420,11 @@
Future testInvalidReadWriteOperations() {
asyncStart();
- RawServerSocket.bind(InternetAddress.LOOPBACK_IP_V4, 0).then((server) {
+ RawServerSocket.bind(InternetAddress.loopbackIPv4, 0).then((server) {
server.listen((socket) {});
List<int> data = createTestData();
var socket =
- RawSynchronousSocket.connectSync(LOOPBACK_IP_V4_STRING, server.port);
+ RawSynchronousSocket.connectSync(loopbackIPv4String, server.port);
// Invalid writeFromSync invocations
Expect.throwsRangeError(() => socket.writeFromSync(data, data.length + 1));
@@ -454,12 +453,12 @@
void testClosedError() {
asyncStart();
- RawServerSocket.bind(InternetAddress.LOOPBACK_IP_V4, 0).then((server) {
+ RawServerSocket.bind(InternetAddress.loopbackIPv4, 0).then((server) {
server.listen((socket) {
socket.close();
});
var socket =
- RawSynchronousSocket.connectSync(LOOPBACK_IP_V4_STRING, server.port);
+ RawSynchronousSocket.connectSync(loopbackIPv4String, server.port);
server.close();
socket.closeSync();
Expect.throws(() => socket.remotePort, (e) => e is SocketException);
diff --git a/tests/standalone_2/io/regress_10026_test.dart b/tests/standalone_2/io/regress_10026_test.dart
index ff7c2e4..3a527a3 100644
--- a/tests/standalone_2/io/regress_10026_test.dart
+++ b/tests/standalone_2/io/regress_10026_test.dart
@@ -14,7 +14,7 @@
asyncStart();
var controller = new StreamController(sync: true);
controller.stream
- .transform(ZLIB.decoder)
+ .transform(zlib.decoder)
.transform(utf8.decoder)
.fold(new StringBuffer(), (buffer, s) {
buffer.write(s);
diff --git a/tests/standalone_2/io/regress_21160_test.dart b/tests/standalone_2/io/regress_21160_test.dart
index 762e860..94d5f6c 100644
--- a/tests/standalone_2/io/regress_21160_test.dart
+++ b/tests/standalone_2/io/regress_21160_test.dart
@@ -54,11 +54,11 @@
context: clientContext);
List<int> body = <int>[];
// Close our end, since we're not sending data.
- socket.shutdown(SocketDirection.SEND);
+ socket.shutdown(SocketDirection.send);
socket.listen((RawSocketEvent event) {
switch (event) {
- case RawSocketEvent.READ:
+ case RawSocketEvent.read:
// NOTE: We have a very low prime number here. The internal
// ring buffers will not have a size of 3. This means that
// we'll reach the point where we would like to read 1/2 bytes
@@ -66,9 +66,9 @@
// [This will ensure we trigger the bug.]
body.addAll(socket.read(3));
break;
- case RawSocketEvent.WRITE:
+ case RawSocketEvent.write:
break;
- case RawSocketEvent.READ_CLOSED:
+ case RawSocketEvent.readClosed:
break;
default:
throw "Unexpected event $event";
diff --git a/tests/standalone_2/io/regress_7191_script.dart b/tests/standalone_2/io/regress_7191_script.dart
index acdd143..4387bb8 100644
--- a/tests/standalone_2/io/regress_7191_script.dart
+++ b/tests/standalone_2/io/regress_7191_script.dart
@@ -20,7 +20,7 @@
// If a SIGTERM is sent before the child-process's main is invoked,
// there is a change that the SIGTERM is ignore on Mac OS X. Use
// SIGKILL to get around the issue.
- p.kill(ProcessSignal.SIGKILL);
+ p.kill(ProcessSignal.sigkill);
p.exitCode.then((_) => exit(0));
});
// Close stdout. If handles are incorrectly inherited this will
diff --git a/tests/standalone_2/io/secure_client_raw_server_test.dart b/tests/standalone_2/io/secure_client_raw_server_test.dart
index 0f13169..6f3a6bf 100644
--- a/tests/standalone_2/io/secure_client_raw_server_test.dart
+++ b/tests/standalone_2/io/secure_client_raw_server_test.dart
@@ -36,12 +36,12 @@
client.writeEventsEnabled = false;
client.listen((event) {
switch (event) {
- case RawSocketEvent.READ:
+ case RawSocketEvent.read:
Expect.isTrue(bytesWritten == 0);
Expect.isTrue(client.available() > 0);
readChunks.add(client.read());
break;
- case RawSocketEvent.WRITE:
+ case RawSocketEvent.write:
Expect.isFalse(client.writeEventsEnabled);
Expect.isNotNull(dataToWrite);
bytesWritten += client.write(
@@ -50,10 +50,10 @@
client.writeEventsEnabled = true;
}
if (bytesWritten == dataToWrite.length) {
- client.shutdown(SocketDirection.SEND);
+ client.shutdown(SocketDirection.send);
}
break;
- case RawSocketEvent.READ_CLOSED:
+ case RawSocketEvent.readClosed:
dataToWrite = readChunks.fold(<int>[], (list, x) {
list.addAll(x);
return list;
diff --git a/tests/standalone_2/io/signal_test_script.dart b/tests/standalone_2/io/signal_test_script.dart
index 31e17de..772c2af 100644
--- a/tests/standalone_2/io/signal_test_script.dart
+++ b/tests/standalone_2/io/signal_test_script.dart
@@ -12,22 +12,22 @@
var signal;
switch (arg) {
case 'SIGHUP':
- signal = ProcessSignal.SIGHUP;
+ signal = ProcessSignal.sighup;
break;
case 'SIGINT':
- signal = ProcessSignal.SIGINT;
+ signal = ProcessSignal.sigint;
break;
case 'SIGTERM':
- signal = ProcessSignal.SIGTERM;
+ signal = ProcessSignal.sigterm;
break;
case 'SIGUSR1':
- signal = ProcessSignal.SIGUSR1;
+ signal = ProcessSignal.sigusr1;
break;
case 'SIGUSR2':
- signal = ProcessSignal.SIGUSR2;
+ signal = ProcessSignal.sigusr2;
break;
case 'SIGWINCH':
- signal = ProcessSignal.SIGWINCH;
+ signal = ProcessSignal.sigwinch;
break;
}
signal.watch().first.then((s) {
diff --git a/tests/standalone_2/io/signals_exception_test.dart b/tests/standalone_2/io/signals_exception_test.dart
index 5c3b926..28f552e 100644
--- a/tests/standalone_2/io/signals_exception_test.dart
+++ b/tests/standalone_2/io/signals_exception_test.dart
@@ -7,7 +7,7 @@
import "package:expect/expect.dart";
main() {
- var ps = ProcessSignal.SIGINT.watch().listen((signal) {
+ var ps = ProcessSignal.sigint.watch().listen((signal) {
Expect.fail("Unreachable");
});
throw "Death"; //# 01: runtime error
diff --git a/tests/standalone_2/io/signals_test.dart b/tests/standalone_2/io/signals_test.dart
index 7649f1f..79e0ddf 100644
--- a/tests/standalone_2/io/signals_test.dart
+++ b/tests/standalone_2/io/signals_test.dart
@@ -29,9 +29,9 @@
int count = out.where((c) => c == '\n'.codeUnitAt(0)).length;
for (int i = 0; i < count; i++) {
if (v < usr1Send) {
- process.kill(ProcessSignal.SIGUSR1);
+ process.kill(ProcessSignal.sigusr1);
} else if (v < usr1Send + usr2Send) {
- process.kill(ProcessSignal.SIGUSR2);
+ process.kill(ProcessSignal.sigusr2);
}
v++;
}
@@ -99,7 +99,7 @@
void testListenCancel() {
for (int i = 0; i < 10; i++) {
- ProcessSignal.SIGINT.watch().listen(null).cancel();
+ ProcessSignal.sigint.watch().listen(null).cancel();
}
}
@@ -116,19 +116,19 @@
testSignals(1, 0, 0, 1, true);
testSignals(0, 1, 1, 0, true);
- testSignal(ProcessSignal.SIGHUP);
- testSignal(ProcessSignal.SIGINT);
- testSignal(ProcessSignal.SIGTERM);
- testSignal(ProcessSignal.SIGUSR1);
- testSignal(ProcessSignal.SIGUSR2);
- testSignal(ProcessSignal.SIGWINCH);
+ testSignal(ProcessSignal.sighup);
+ testSignal(ProcessSignal.sigint);
+ testSignal(ProcessSignal.sigterm);
+ testSignal(ProcessSignal.sigusr1);
+ testSignal(ProcessSignal.sigusr2);
+ testSignal(ProcessSignal.sigwinch);
testMultipleSignals([
- ProcessSignal.SIGHUP,
- ProcessSignal.SIGINT,
- ProcessSignal.SIGTERM,
- ProcessSignal.SIGUSR1,
- ProcessSignal.SIGUSR2,
- ProcessSignal.SIGWINCH
+ ProcessSignal.sighup,
+ ProcessSignal.sigint,
+ ProcessSignal.sigterm,
+ ProcessSignal.sigusr1,
+ ProcessSignal.sigusr2,
+ ProcessSignal.sigwinch,
]);
}
diff --git a/tests/standalone_2/io/signals_test_script.dart b/tests/standalone_2/io/signals_test_script.dart
index 2cb9c5b..b5b5210 100644
--- a/tests/standalone_2/io/signals_test_script.dart
+++ b/tests/standalone_2/io/signals_test_script.dart
@@ -18,13 +18,13 @@
print("ready");
}
- sub1 = ProcessSignal.SIGUSR1.watch().listen((signal) {
- if (signal != ProcessSignal.SIGUSR1) exit(1);
+ sub1 = ProcessSignal.sigusr1.watch().listen((signal) {
+ if (signal != ProcessSignal.sigusr1) exit(1);
usr1Count--;
check();
});
- sub2 = ProcessSignal.SIGUSR2.watch().listen((signal) {
- if (signal != ProcessSignal.SIGUSR2) exit(1);
+ sub2 = ProcessSignal.sigusr2.watch().listen((signal) {
+ if (signal != ProcessSignal.sigusr2) exit(1);
usr2Count--;
check();
});
diff --git a/tests/standalone_2/io/skipping_dart2js_compilations_test.dart b/tests/standalone_2/io/skipping_dart2js_compilations_test.dart
index 66d97cb..96649d1 100644
--- a/tests/standalone_2/io/skipping_dart2js_compilations_test.dart
+++ b/tests/standalone_2/io/skipping_dart2js_compilations_test.dart
@@ -106,7 +106,7 @@
void _writeToFile(File file, String content) {
if (content != null) {
var fd = new File(file.resolveSymbolicLinksSync())
- .openSync(mode: FileMode.WRITE);
+ .openSync(mode: FileMode.write);
fd.writeStringSync(content);
fd.closeSync();
}
diff --git a/tests/standalone_2/io/socket_bind_test.dart b/tests/standalone_2/io/socket_bind_test.dart
index 1345eba..6e6db8c 100644
--- a/tests/standalone_2/io/socket_bind_test.dart
+++ b/tests/standalone_2/io/socket_bind_test.dart
@@ -121,11 +121,11 @@
await retry(() async {
await testBindDifferentAddresses(
- InternetAddress.ANY_IP_V6, InternetAddress.ANY_IP_V4, true, false);
+ InternetAddress.anyIPv6, InternetAddress.anyIPv4, true, false);
});
await retry(() async {
await testBindDifferentAddresses(
- InternetAddress.ANY_IP_V4, InternetAddress.ANY_IP_V6, false, true);
+ InternetAddress.anyIPv4, InternetAddress.anyIPv6, false, true);
});
for (var host in ['127.0.0.1', '::1']) {
diff --git a/tests/standalone_2/io/socket_connect_consume_close_test.dart b/tests/standalone_2/io/socket_connect_consume_close_test.dart
index 0eeb410..20a078e 100644
--- a/tests/standalone_2/io/socket_connect_consume_close_test.dart
+++ b/tests/standalone_2/io/socket_connect_consume_close_test.dart
@@ -17,7 +17,7 @@
// Connect socket then immediate close the consumer without
// listening on the stream.
asyncStart();
- ServerSocket.bind(InternetAddress.LOOPBACK_IP_V4, 0).then((server) {
+ ServerSocket.bind(InternetAddress.loopbackIPv4, 0).then((server) {
server.listen((_) {});
Socket.connect("127.0.0.1", server.port).then((socket) {
socket.close();
diff --git a/tests/standalone_2/io/socket_connect_consume_write_close_test.dart b/tests/standalone_2/io/socket_connect_consume_write_close_test.dart
index de2d958..8b021abd 100644
--- a/tests/standalone_2/io/socket_connect_consume_write_close_test.dart
+++ b/tests/standalone_2/io/socket_connect_consume_write_close_test.dart
@@ -17,7 +17,7 @@
// Connect socket write some data immediate close the consumer
// without listening on the stream.
asyncStart();
- ServerSocket.bind(InternetAddress.LOOPBACK_IP_V4, 0).then((server) {
+ ServerSocket.bind(InternetAddress.loopbackIPv4, 0).then((server) {
server.listen((_) {});
Socket.connect("127.0.0.1", server.port).then((socket) {
socket.add([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]);
diff --git a/tests/standalone_2/io/socket_connect_immediate_destory_test.dart b/tests/standalone_2/io/socket_connect_immediate_destory_test.dart
index 8a9a379..955f373 100644
--- a/tests/standalone_2/io/socket_connect_immediate_destory_test.dart
+++ b/tests/standalone_2/io/socket_connect_immediate_destory_test.dart
@@ -15,7 +15,7 @@
void main() {
asyncStart();
- ServerSocket.bind(InternetAddress.LOOPBACK_IP_V4, 0).then((server) {
+ ServerSocket.bind(InternetAddress.loopbackIPv4, 0).then((server) {
server.listen((_) {});
Socket.connect("127.0.0.1", server.port).then((socket) {
socket.destroy();
diff --git a/tests/standalone_2/io/socket_connect_stream_close_test.dart b/tests/standalone_2/io/socket_connect_stream_close_test.dart
index b5899ae..6c9fcc2 100644
--- a/tests/standalone_2/io/socket_connect_stream_close_test.dart
+++ b/tests/standalone_2/io/socket_connect_stream_close_test.dart
@@ -17,7 +17,7 @@
// Connect socket and listen on the stream. The server closes
// immediately so only a done event is received.
asyncStart();
- ServerSocket.bind(InternetAddress.LOOPBACK_IP_V4, 0).then((server) {
+ ServerSocket.bind(InternetAddress.loopbackIPv4, 0).then((server) {
server.listen((client) {
client.close();
client.done.then((_) => client.destroy());
diff --git a/tests/standalone_2/io/socket_connect_stream_data_close_cancel_test.dart b/tests/standalone_2/io/socket_connect_stream_data_close_cancel_test.dart
index 7c2c833..fa921d7 100644
--- a/tests/standalone_2/io/socket_connect_stream_data_close_cancel_test.dart
+++ b/tests/standalone_2/io/socket_connect_stream_data_close_cancel_test.dart
@@ -16,7 +16,7 @@
void testConnectStreamDataCloseCancel(bool useDestroy) {
List<int> sendData = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9];
asyncStart();
- ServerSocket.bind(InternetAddress.LOOPBACK_IP_V4, 0).then((server) {
+ ServerSocket.bind(InternetAddress.loopbackIPv4, 0).then((server) {
server.listen((client) {
client.add(sendData);
if (useDestroy) {
diff --git a/tests/standalone_2/io/socket_connect_stream_data_close_test.dart b/tests/standalone_2/io/socket_connect_stream_data_close_test.dart
index fbfb7e7..ddce584 100644
--- a/tests/standalone_2/io/socket_connect_stream_data_close_test.dart
+++ b/tests/standalone_2/io/socket_connect_stream_data_close_test.dart
@@ -18,7 +18,7 @@
// and then closes so both data and a done event is received.
List<int> sendData = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9];
asyncStart();
- ServerSocket.bind(InternetAddress.LOOPBACK_IP_V4, 0).then((server) {
+ ServerSocket.bind(InternetAddress.loopbackIPv4, 0).then((server) {
server.listen((client) {
client.add(sendData);
if (useDestroy) {
diff --git a/tests/standalone_2/io/socket_cross_process_test.dart b/tests/standalone_2/io/socket_cross_process_test.dart
index 66798ad..bdf8e2d 100644
--- a/tests/standalone_2/io/socket_cross_process_test.dart
+++ b/tests/standalone_2/io/socket_cross_process_test.dart
@@ -7,11 +7,11 @@
import 'dart:async';
import 'dart:io';
-const int NUM_SERVERS = 10;
+const int serversCount = 10;
void main(List<String> args) {
if (args.isEmpty) {
- for (int i = 0; i < NUM_SERVERS; ++i) {
+ for (int i = 0; i < serversCount; ++i) {
makeServer().then((server) {
runClientProcess(server.port).then((_) => server.close());
});
@@ -25,7 +25,7 @@
}
Future makeServer() {
- return ServerSocket.bind(InternetAddress.LOOPBACK_IP_V4, 0).then((server) {
+ return ServerSocket.bind(InternetAddress.loopbackIPv4, 0).then((server) {
server.listen((request) {
request.pipe(request);
});
@@ -55,7 +55,7 @@
}
runClient(int port) {
- Socket.connect(InternetAddress.LOOPBACK_IP_V4, port).then((connection) {
+ Socket.connect(InternetAddress.loopbackIPv4, port).then((connection) {
connection.listen((_) {}, onDone: () => print('SUCCESS'));
connection.close();
});
diff --git a/tests/standalone_2/io/socket_info_ipv4_test.dart b/tests/standalone_2/io/socket_info_ipv4_test.dart
index 9d869f0..bce4f78 100644
--- a/tests/standalone_2/io/socket_info_ipv4_test.dart
+++ b/tests/standalone_2/io/socket_info_ipv4_test.dart
@@ -17,7 +17,7 @@
Expect.listEquals(socket.remoteAddress.rawAddress, [127, 0, 0, 1]);
Expect.equals(clientSocket.remoteAddress.address, "127.0.0.1");
Expect.equals(
- clientSocket.remoteAddress.type, InternetAddressType.IP_V4);
+ clientSocket.remoteAddress.type, InternetAddressType.IPv4);
Expect
.listEquals(clientSocket.remoteAddress.rawAddress, [127, 0, 0, 1]);
socket.destroy();
diff --git a/tests/standalone_2/io/socket_info_ipv6_test.dart b/tests/standalone_2/io/socket_info_ipv6_test.dart
index 016c582..11920fb 100644
--- a/tests/standalone_2/io/socket_info_ipv6_test.dart
+++ b/tests/standalone_2/io/socket_info_ipv6_test.dart
@@ -13,12 +13,12 @@
Expect.equals(clientSocket.port, socket.remotePort);
Expect.equals(clientSocket.remotePort, socket.port);
Expect.equals(socket.remoteAddress.address, "::1");
- Expect.equals(socket.remoteAddress.type, InternetAddressType.IP_V6);
+ Expect.equals(socket.remoteAddress.type, InternetAddressType.IPv6);
Expect.listEquals(socket.remoteAddress.rawAddress,
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1]);
Expect.equals(clientSocket.remoteAddress.address, "::1");
Expect.equals(
- clientSocket.remoteAddress.type, InternetAddressType.IP_V6);
+ clientSocket.remoteAddress.type, InternetAddressType.IPv6);
Expect.listEquals(clientSocket.remoteAddress.rawAddress,
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1]);
socket.destroy();
diff --git a/tests/standalone_2/io/socket_ipv6_test.dart b/tests/standalone_2/io/socket_ipv6_test.dart
index f7176a5..769506f 100644
--- a/tests/standalone_2/io/socket_ipv6_test.dart
+++ b/tests/standalone_2/io/socket_ipv6_test.dart
@@ -9,7 +9,7 @@
import "package:expect/expect.dart";
import "test_utils.dart" show retry;
-const ANY = InternetAddressType.ANY;
+const ANY = InternetAddressType.any;
Future testIPv6toIPv6() {
asyncStart();
@@ -90,7 +90,7 @@
return InternetAddress.lookup("::0", type: ANY).then((list) {
if (list.length < 0) throw "no address";
for (var entry in list) {
- if (entry.type != InternetAddressType.IP_V6) {
+ if (entry.type != InternetAddressType.IPv6) {
throw "Wrong IP type";
}
}
@@ -103,7 +103,7 @@
return InternetAddress.lookup("127.0.0.1").then((list) {
if (list.length < 0) throw "no address";
for (var entry in list) {
- if (entry.type != InternetAddressType.IP_V4) {
+ if (entry.type != InternetAddressType.IPv4) {
throw "Wrong IP type";
}
}
diff --git a/tests/standalone_2/io/socket_many_connections_test.dart b/tests/standalone_2/io/socket_many_connections_test.dart
index 70d4e66..9166168 100644
--- a/tests/standalone_2/io/socket_many_connections_test.dart
+++ b/tests/standalone_2/io/socket_many_connections_test.dart
@@ -12,27 +12,27 @@
import "dart:isolate";
part "testing_server.dart";
-const CONNECTIONS = 200;
+const connectionsCount = 200;
class SocketManyConnectionsTest {
SocketManyConnectionsTest.start()
: _connections = 0,
- _sockets = new List<Socket>(CONNECTIONS) {
+ _sockets = new List<Socket>(connectionsCount) {
initialize();
}
void run() {
void connectHandler() {
_connections++;
- if (_connections == CONNECTIONS) {
- for (int i = 0; i < CONNECTIONS; i++) {
+ if (_connections == connectionsCount) {
+ for (int i = 0; i < connectionsCount; i++) {
_sockets[i].destroy();
}
close();
}
}
- for (int i = 0; i < CONNECTIONS; i++) {
+ for (int i = 0; i < connectionsCount; i++) {
Socket.connect(TestingServer.HOST, _port).then((socket) {
Expect.isNotNull(socket);
_sockets[i] = socket;
diff --git a/tests/standalone_2/io/socket_simple_bind_test.dart b/tests/standalone_2/io/socket_simple_bind_test.dart
index fad63df..661815d 100644
--- a/tests/standalone_2/io/socket_simple_bind_test.dart
+++ b/tests/standalone_2/io/socket_simple_bind_test.dart
@@ -15,7 +15,7 @@
void main() {
asyncStart();
- ServerSocket.bind(InternetAddress.LOOPBACK_IP_V4, 0).then((s) {
+ ServerSocket.bind(InternetAddress.loopbackIPv4, 0).then((s) {
Expect.isTrue(s.port > 0);
s.close();
asyncEnd();
diff --git a/tests/standalone_2/io/socket_source_address_test.dart b/tests/standalone_2/io/socket_source_address_test.dart
index f14d6ae..236733a 100644
--- a/tests/standalone_2/io/socket_source_address_test.dart
+++ b/tests/standalone_2/io/socket_source_address_test.dart
@@ -30,7 +30,7 @@
var sourceAddress;
asyncStart();
var server =
- await ServerSocket.bind(InternetAddress.LOOPBACK_IP_V4, freePort);
+ await ServerSocket.bind(InternetAddress.loopbackIPv4, freePort);
server.listen((_) {
throw 'Unexpected connection from address $sourceAddress';
}, onDone: () => asyncEnd());
@@ -52,7 +52,7 @@
e.address == new InternetAddress('8.8.8.8'));
}
// Address family mismatch.
- for (sourceAddress in ['::1', InternetAddress.LOOPBACK_IP_V6]) {
+ for (sourceAddress in ['::1', InternetAddress.loopbackIPv6]) {
await throws(
() => connectFunction('127.0.0.1', server.port,
sourceAddress: sourceAddress),
@@ -64,16 +64,16 @@
// IPv4 addresses to use as source address when connecting locally.
var ipV4SourceAddresses = [
- InternetAddress.LOOPBACK_IP_V4,
- InternetAddress.ANY_IP_V4,
+ InternetAddress.loopbackIPv4,
+ InternetAddress.anyIPv4,
'127.0.0.1',
'0.0.0.0'
];
// IPv6 addresses to use as source address when connecting locally.
var ipV6SourceAddresses = [
- InternetAddress.LOOPBACK_IP_V6,
- InternetAddress.ANY_IP_V6,
+ InternetAddress.loopbackIPv6,
+ InternetAddress.anyIPv6,
'::1',
'::'
];
@@ -84,7 +84,7 @@
var successCount = 0;
if (!v6Only) successCount += ipV4SourceAddresses.length;
- if (bindAddress.type == InternetAddressType.IP_V6) {
+ if (bindAddress.type == InternetAddressType.IPv6) {
successCount += ipV6SourceAddresses.length;
}
var count = 0;
@@ -104,14 +104,14 @@
// Connect with IPv4 source addesses.
for (var sourceAddress in ipV4SourceAddresses) {
if (!v6Only) {
- var s = await connectFunction(InternetAddress.LOOPBACK_IP_V4, server.port,
+ var s = await connectFunction(InternetAddress.loopbackIPv4, server.port,
sourceAddress: sourceAddress);
closeDestroyFunction(s);
} else {
// Cannot use an IPv4 source address to connect to IPv6 if
// v6Only is specified.
await throws(
- () => connectFunction(InternetAddress.LOOPBACK_IP_V6, server.port,
+ () => connectFunction(InternetAddress.loopbackIPv6, server.port,
sourceAddress: sourceAddress),
(e) => e is SocketException);
}
@@ -119,14 +119,14 @@
// Connect with IPv6 source addesses.
for (var sourceAddress in ipV6SourceAddresses) {
- if (bindAddress.type == InternetAddressType.IP_V6) {
- var s = await connectFunction(InternetAddress.LOOPBACK_IP_V6, server.port,
+ if (bindAddress.type == InternetAddressType.IPv6) {
+ var s = await connectFunction(InternetAddress.loopbackIPv6, server.port,
sourceAddress: sourceAddress);
closeDestroyFunction(s);
} else {
// Cannot use an IPv6 source address to connect to IPv4.
await throws(
- () => connectFunction(InternetAddress.LOOPBACK_IP_V4, server.port,
+ () => connectFunction(InternetAddress.loopbackIPv4, server.port,
sourceAddress: sourceAddress),
(e) => e is SocketException);
}
@@ -149,27 +149,27 @@
await retry(() async {
await testConnect(
- InternetAddress.ANY_IP_V4, false, RawSocket.connect, (s) => s.close());
+ InternetAddress.anyIPv4, false, RawSocket.connect, (s) => s.close());
});
await retry(() async {
await testConnect(
- InternetAddress.ANY_IP_V4, false, Socket.connect, (s) => s.destroy());
+ InternetAddress.anyIPv4, false, Socket.connect, (s) => s.destroy());
});
await retry(() async {
await testConnect(
- InternetAddress.ANY_IP_V6, false, RawSocket.connect, (s) => s.close());
+ InternetAddress.anyIPv6, false, RawSocket.connect, (s) => s.close());
});
await retry(() async {
await testConnect(
- InternetAddress.ANY_IP_V6, false, Socket.connect, (s) => s.destroy());
+ InternetAddress.anyIPv6, false, Socket.connect, (s) => s.destroy());
});
await retry(() async {
await testConnect(
- InternetAddress.ANY_IP_V6, true, RawSocket.connect, (s) => s.close());
+ InternetAddress.anyIPv6, true, RawSocket.connect, (s) => s.close());
});
await retry(() async {
await testConnect(
- InternetAddress.ANY_IP_V6, true, Socket.connect, (s) => s.destroy());
+ InternetAddress.anyIPv6, true, Socket.connect, (s) => s.destroy());
});
asyncEnd();
diff --git a/tests/standalone_2/io/stdout_close_test.dart b/tests/standalone_2/io/stdout_close_test.dart
index 9a117b5..128c230 100644
--- a/tests/standalone_2/io/stdout_close_test.dart
+++ b/tests/standalone_2/io/stdout_close_test.dart
@@ -9,7 +9,7 @@
var dir = Directory.systemTemp.createTempSync('dart_stdout_close');
stdout.close().then((_) {
var file = new File('${dir.path}/file');
- var io = file.openSync(mode: FileMode.WRITE);
+ var io = file.openSync(mode: FileMode.write);
print("to file");
io.closeSync();
var content = file.readAsStringSync();
diff --git a/tests/standalone_2/io/system_encoding_test.dart b/tests/standalone_2/io/system_encoding_test.dart
index 4306a68..40a6bf6 100644
--- a/tests/standalone_2/io/system_encoding_test.dart
+++ b/tests/standalone_2/io/system_encoding_test.dart
@@ -10,21 +10,20 @@
// This only works reliabily for "ASCII" cross platform as that is the only
// well known part of the default Windows code page.
void testEncodeDecode(String str) {
- Expect.equals(SYSTEM_ENCODING.decode(SYSTEM_ENCODING.encode(str)), str);
+ Expect.equals(systemEncoding.decode(systemEncoding.encode(str)), str);
}
// This only works reliabily for "ASCII" cross platform as that is the only
// common set of bytes between UTF-8 Windows code pages that convert back
// and forth.
void testDecodeEncode(List<int> bytes) {
- Expect.listEquals(
- SYSTEM_ENCODING.encode(SYSTEM_ENCODING.decode(bytes)), bytes);
+ Expect.listEquals(systemEncoding.encode(systemEncoding.decode(bytes)), bytes);
}
void test(List<int> bytes) {
var str = new String.fromCharCodes(bytes);
- Expect.equals(SYSTEM_ENCODING.decode(bytes), str);
- Expect.listEquals(SYSTEM_ENCODING.encode(str), bytes);
+ Expect.equals(systemEncoding.decode(bytes), str);
+ Expect.listEquals(systemEncoding.encode(str), bytes);
testDecodeEncode(bytes);
testEncodeDecode(str);
}
@@ -39,11 +38,11 @@
// On Windows the default Windows code page cannot encode these
// Unicode characters and the ? character is used.
Expect.listEquals(
- SYSTEM_ENCODING.encode('\u1234\u5678\u9abc'), '???'.codeUnits);
+ systemEncoding.encode('\u1234\u5678\u9abc'), '???'.codeUnits);
} else {
// On all systems except for Windows UTF-8 is used as the system
// encoding.
- Expect.listEquals(SYSTEM_ENCODING.encode('\u1234\u5678\u9abc'),
+ Expect.listEquals(systemEncoding.encode('\u1234\u5678\u9abc'),
utf8.encode('\u1234\u5678\u9abc'));
}
}
diff --git a/tests/standalone_2/io/test_utils.dart b/tests/standalone_2/io/test_utils.dart
index c9c2940..d92a372 100644
--- a/tests/standalone_2/io/test_utils.dart
+++ b/tests/standalone_2/io/test_utils.dart
@@ -7,7 +7,7 @@
Future<int> freeIPv4AndIPv6Port() async {
var socket =
- await ServerSocket.bind(InternetAddress.ANY_IP_V6, 0, v6Only: false);
+ await ServerSocket.bind(InternetAddress.anyIPv6, 0, v6Only: false);
int port = socket.port;
await socket.close();
return port;
diff --git a/tests/standalone_2/io/windows_file_system_async_links_test.dart b/tests/standalone_2/io/windows_file_system_async_links_test.dart
index 71634ae..4810d25 100644
--- a/tests/standalone_2/io/windows_file_system_async_links_test.dart
+++ b/tests/standalone_2/io/windows_file_system_async_links_test.dart
@@ -39,12 +39,12 @@
.then((_) => FutureExpect.isTrue(FileSystemEntity.isDirectory(y)))
.then((_) => FutureExpect.isTrue(FileSystemEntity.isDirectory(x)))
.then((_) => FutureExpect.equals(
- FileSystemEntityType.DIRECTORY, FileSystemEntity.type(y)))
+ FileSystemEntityType.directory, FileSystemEntity.type(y)))
.then((_) => FutureExpect.equals(
- FileSystemEntityType.DIRECTORY, FileSystemEntity.type(x)))
- .then((_) => FutureExpect.equals(FileSystemEntityType.LINK,
+ FileSystemEntityType.directory, FileSystemEntity.type(x)))
+ .then((_) => FutureExpect.equals(FileSystemEntityType.link,
FileSystemEntity.type(y, followLinks: false)))
- .then((_) => FutureExpect.equals(FileSystemEntityType.DIRECTORY,
+ .then((_) => FutureExpect.equals(FileSystemEntityType.directory,
FileSystemEntity.type(x, followLinks: false)))
.then((_) => FutureExpect.equals(x, new Link(y).target()))
@@ -57,12 +57,12 @@
.then((_) => FutureExpect.isFalse(FileSystemEntity.isDirectory(y)))
.then((_) => FutureExpect.isFalse(FileSystemEntity.isDirectory(x)))
.then((_) => FutureExpect.equals(
- FileSystemEntityType.LINK, FileSystemEntity.type(y)))
+ FileSystemEntityType.link, FileSystemEntity.type(y)))
.then((_) => FutureExpect.equals(
- FileSystemEntityType.NOT_FOUND, FileSystemEntity.type(x)))
- .then((_) => FutureExpect.equals(FileSystemEntityType.LINK,
+ FileSystemEntityType.notFound, FileSystemEntity.type(x)))
+ .then((_) => FutureExpect.equals(FileSystemEntityType.link,
FileSystemEntity.type(y, followLinks: false)))
- .then((_) => FutureExpect.equals(FileSystemEntityType.NOT_FOUND,
+ .then((_) => FutureExpect.equals(FileSystemEntityType.notFound,
FileSystemEntity.type(x, followLinks: false)))
.then((_) => FutureExpect.equals(x, new Link(y).target()))
@@ -70,25 +70,25 @@
.then((_) => new Link(y).delete())
.then((_) => FutureExpect.isFalse(FileSystemEntity.isLink(y)))
.then((_) => FutureExpect.equals(
- FileSystemEntityType.NOT_FOUND, FileSystemEntity.type(y)))
+ FileSystemEntityType.notFound, FileSystemEntity.type(y)))
.then((_) => FutureExpect.throws(new Link(y).target()))
.then((_) => new Directory(x).create())
.then((_) => new Link(y).create(x))
- .then((_) => FutureExpect.equals(FileSystemEntityType.LINK,
+ .then((_) => FutureExpect.equals(FileSystemEntityType.link,
FileSystemEntity.type(y, followLinks: false)))
- .then((_) => FutureExpect.equals(FileSystemEntityType.DIRECTORY,
+ .then((_) => FutureExpect.equals(FileSystemEntityType.directory,
FileSystemEntity.type(x, followLinks: false)))
.then((_) => FutureExpect.equals(x, new Link(y).target()))
// Delete Junction pointing to an existing directory.
.then((_) => new Directory(y).delete())
.then((_) => FutureExpect.equals(
- FileSystemEntityType.NOT_FOUND, FileSystemEntity.type(y)))
- .then((_) => FutureExpect.equals(FileSystemEntityType.NOT_FOUND,
+ FileSystemEntityType.notFound, FileSystemEntity.type(y)))
+ .then((_) => FutureExpect.equals(FileSystemEntityType.notFound,
FileSystemEntity.type(y, followLinks: false)))
.then((_) => FutureExpect.equals(
- FileSystemEntityType.DIRECTORY, FileSystemEntity.type(x)))
- .then((_) => FutureExpect.equals(FileSystemEntityType.DIRECTORY,
+ FileSystemEntityType.directory, FileSystemEntity.type(x)))
+ .then((_) => FutureExpect.equals(FileSystemEntityType.directory,
FileSystemEntity.type(x, followLinks: false)))
.then((_) => FutureExpect.throws(new Link(y).target()))
.then((_) => temp.delete(recursive: true));
diff --git a/tests/standalone_2/io/windows_file_system_links_test.dart b/tests/standalone_2/io/windows_file_system_links_test.dart
index 5268ccf..ccf38e5 100644
--- a/tests/standalone_2/io/windows_file_system_links_test.dart
+++ b/tests/standalone_2/io/windows_file_system_links_test.dart
@@ -20,11 +20,11 @@
Expect.isFalse(FileSystemEntity.isLinkSync(x));
Expect.isTrue(FileSystemEntity.isDirectorySync(y));
Expect.isTrue(FileSystemEntity.isDirectorySync(x));
- Expect.equals(FileSystemEntityType.DIRECTORY, FileSystemEntity.typeSync(y));
- Expect.equals(FileSystemEntityType.DIRECTORY, FileSystemEntity.typeSync(x));
- Expect.equals(FileSystemEntityType.LINK,
+ Expect.equals(FileSystemEntityType.directory, FileSystemEntity.typeSync(y));
+ Expect.equals(FileSystemEntityType.directory, FileSystemEntity.typeSync(x));
+ Expect.equals(FileSystemEntityType.link,
FileSystemEntity.typeSync(y, followLinks: false));
- Expect.equals(FileSystemEntityType.DIRECTORY,
+ Expect.equals(FileSystemEntityType.directory,
FileSystemEntity.typeSync(x, followLinks: false));
Expect.equals(x, new Link(y).targetSync());
@@ -36,37 +36,37 @@
Expect.isFalse(FileSystemEntity.isLinkSync(x));
Expect.isFalse(FileSystemEntity.isDirectorySync(y));
Expect.isFalse(FileSystemEntity.isDirectorySync(x));
- Expect.equals(FileSystemEntityType.LINK, FileSystemEntity.typeSync(y));
- Expect.equals(FileSystemEntityType.NOT_FOUND, FileSystemEntity.typeSync(x));
- Expect.equals(FileSystemEntityType.LINK,
+ Expect.equals(FileSystemEntityType.link, FileSystemEntity.typeSync(y));
+ Expect.equals(FileSystemEntityType.notFound, FileSystemEntity.typeSync(x));
+ Expect.equals(FileSystemEntityType.link,
FileSystemEntity.typeSync(y, followLinks: false));
- Expect.equals(FileSystemEntityType.NOT_FOUND,
+ Expect.equals(FileSystemEntityType.notFound,
FileSystemEntity.typeSync(x, followLinks: false));
Expect.equals(x, new Link(y).targetSync());
// Delete Junction pointing to a missing directory.
new Link(y).deleteSync();
Expect.isFalse(FileSystemEntity.isLinkSync(y));
- Expect.equals(FileSystemEntityType.NOT_FOUND, FileSystemEntity.typeSync(y));
+ Expect.equals(FileSystemEntityType.notFound, FileSystemEntity.typeSync(y));
Expect.throws(() => new Link(y).targetSync());
new Directory(x).createSync();
new Link(y).create(x).then((_) {
- Expect.equals(FileSystemEntityType.LINK,
+ Expect.equals(FileSystemEntityType.link,
FileSystemEntity.typeSync(y, followLinks: false));
- Expect.equals(FileSystemEntityType.DIRECTORY,
+ Expect.equals(FileSystemEntityType.directory,
FileSystemEntity.typeSync(x, followLinks: false));
Expect.equals(x, new Link(y).targetSync());
// Delete Junction pointing to an existing directory.
new Directory(y).deleteSync();
Expect.equals(
- FileSystemEntityType.NOT_FOUND, FileSystemEntity.typeSync(y));
- Expect.equals(FileSystemEntityType.NOT_FOUND,
+ FileSystemEntityType.notFound, FileSystemEntity.typeSync(y));
+ Expect.equals(FileSystemEntityType.notFound,
FileSystemEntity.typeSync(y, followLinks: false));
Expect.equals(
- FileSystemEntityType.DIRECTORY, FileSystemEntity.typeSync(x));
- Expect.equals(FileSystemEntityType.DIRECTORY,
+ FileSystemEntityType.directory, FileSystemEntity.typeSync(x));
+ Expect.equals(FileSystemEntityType.directory,
FileSystemEntity.typeSync(x, followLinks: false));
Expect.throws(() => new Link(y).targetSync());
diff --git a/tests/standalone_2/io/zlib_test.dart b/tests/standalone_2/io/zlib_test.dart
index 614945e..55dc44d 100644
--- a/tests/standalone_2/io/zlib_test.dart
+++ b/tests/standalone_2/io/zlib_test.dart
@@ -146,11 +146,11 @@
void testZLibInflate(List<int> data) {
[true, false].forEach((gzip) {
[
- ZLibOption.STRATEGY_FILTERED,
- ZLibOption.STRATEGY_HUFFMAN_ONLY,
- ZLibOption.STRATEGY_RLE,
- ZLibOption.STRATEGY_FIXED,
- ZLibOption.STRATEGY_DEFAULT
+ ZLibOption.strategyFiltered,
+ ZLibOption.strategyHuffmanOnly,
+ ZLibOption.strategyRle,
+ ZLibOption.strategyFixed,
+ ZLibOption.strategyDefault,
].forEach((strategy) {
[3, 6, 9].forEach((level) {
asyncStart();
diff --git a/tests/standalone_2/standalone_2.status b/tests/standalone_2/standalone_2.status
index 6c02786..eb1b3b2 100644
--- a/tests/standalone_2/standalone_2.status
+++ b/tests/standalone_2/standalone_2.status
@@ -105,7 +105,6 @@
io/dependency_graph_test: CompileTimeError
io/directory_test: RuntimeError
io/file_error_test: RuntimeError
-io/file_system_watcher_test: RuntimeError
io/file_test: RuntimeError
io/http_auth_digest_test: RuntimeError
io/http_auth_test: RuntimeError
diff --git a/tests/standalone_2/standalone_2_kernel.status b/tests/standalone_2/standalone_2_kernel.status
index 24ec65b..dcf6699 100644
--- a/tests/standalone_2/standalone_2_kernel.status
+++ b/tests/standalone_2/standalone_2_kernel.status
@@ -66,6 +66,7 @@
io/directory_list_sync_test: Timeout, Pass # Please triage.
io/file_blocking_lock_test: Pass, Crash # Please triage.
io/file_lock_test: Slow, Pass
+io/platform_resolved_executable_test/01: Pass, RuntimeError # Issue 32134
io/platform_resolved_executable_test/05: Pass, RuntimeError # Issue 32134
io/platform_test: RuntimeError # Please triage.
io/test_extension_fail_test: RuntimeError # Please traige.
diff --git a/tools/VERSION b/tools/VERSION
index 0e39300..cf7a0c4 100644
--- a/tools/VERSION
+++ b/tools/VERSION
@@ -27,5 +27,5 @@
MAJOR 2
MINOR 0
PATCH 0
-PRERELEASE 53
+PRERELEASE 54
PRERELEASE_PATCH 0
diff --git a/tools/generate_buildfiles.py b/tools/generate_buildfiles.py
index 27f6b7e..6118957 100755
--- a/tools/generate_buildfiles.py
+++ b/tools/generate_buildfiles.py
@@ -48,7 +48,7 @@
'python',
os.path.join(DART_ROOT, 'tools', 'gn.py'),
'-m', 'all',
- '-a', 'arm,arm64',
+ '-a', 'arm,armsimdbc,arm64,armsimdbc64',
]
if options.verbose:
gn_command.append('-v')
diff --git a/tools/testing/dart/compiler_configuration.dart b/tools/testing/dart/compiler_configuration.dart
index 0b5b805..4bc4061 100644
--- a/tools/testing/dart/compiler_configuration.dart
+++ b/tools/testing/dart/compiler_configuration.dart
@@ -135,6 +135,7 @@
List<String> vmOptions,
List<String> sharedOptions,
List<String> dart2jsOptions,
+ List<String> ddcOptions,
List<String> args) {
return sharedOptions.toList()..addAll(args);
}
@@ -350,7 +351,7 @@
}
List<String> computeCompilerArguments(
- vmOptions, sharedOptions, dart2jsOptions, args) {
+ vmOptions, sharedOptions, dart2jsOptions, ddcOptions, args) {
// The result will be passed as an input to [extractArguments]
// (i.e. the arguments to the [PipelineCommand]).
return <String>[]..addAll(vmOptions)..addAll(sharedOptions)..addAll(args);
@@ -446,6 +447,7 @@
List<String> vmOptions,
List<String> sharedOptions,
List<String> dart2jsOptions,
+ List<String> ddcOptions,
List<String> args) {
return <String>[]
..addAll(sharedOptions)
@@ -493,8 +495,9 @@
List<String> vmOptions,
List<String> sharedOptions,
List<String> dart2jsOptions,
+ List<String> ddcOptions,
List<String> args) {
- var result = sharedOptions.toList();
+ var result = sharedOptions.toList()..addAll(ddcOptions);
// The file being compiled is the last argument.
result.add(args.last);
@@ -580,8 +583,9 @@
List<String> vmOptions,
List<String> sharedOptions,
List<String> dart2jsOptions,
+ List<String> ddcOptions,
List<String> args) {
- var result = sharedOptions.toList();
+ var result = sharedOptions.toList()..addAll(ddcOptions);
// The file being compiled is the last argument.
result.add(args.last);
@@ -863,7 +867,7 @@
}
List<String> computeCompilerArguments(
- vmOptions, sharedOptions, dart2jsOptions, originalArguments) {
+ vmOptions, sharedOptions, dart2jsOptions, ddcOptions, originalArguments) {
List<String> args = [];
if (_isChecked) {
args.add('--enable_asserts');
@@ -939,7 +943,7 @@
}
List<String> computeCompilerArguments(
- vmOptions, sharedOptions, dart2jsOptions, originalArguments) {
+ vmOptions, sharedOptions, dart2jsOptions, ddcOptions, originalArguments) {
var args = <String>[];
if (_isChecked) {
args.add('--enable_asserts');
@@ -1194,6 +1198,7 @@
List<String> vmOptions,
List<String> sharedOptions,
List<String> dart2jsOptions,
+ List<String> ddcOptions,
List<String> args) {
var arguments = <String>[];
for (var argument in args) {
diff --git a/tools/testing/dart/test_suite.dart b/tools/testing/dart/test_suite.dart
index 479c94f..8260858 100644
--- a/tools/testing/dart/test_suite.dart
+++ b/tools/testing/dart/test_suite.dart
@@ -883,12 +883,13 @@
var compilerConfiguration = configuration.compilerConfiguration;
var sharedOptions = info.optionsFromFile['sharedOptions'] as List<String>;
var dart2jsOptions = info.optionsFromFile['dart2jsOptions'] as List<String>;
+ var ddcOptions = info.optionsFromFile['ddcOptions'] as List<String>;
var compileTimeArguments = <String>[];
String tempDir;
if (compilerConfiguration.hasCompiler) {
compileTimeArguments = compilerConfiguration.computeCompilerArguments(
- vmOptions, sharedOptions, dart2jsOptions, args);
+ vmOptions, sharedOptions, dart2jsOptions, ddcOptions, args);
// Avoid doing this for analyzer.
var path = info.filePath;
if (vmOptionsVariant != 0) {
@@ -1460,6 +1461,7 @@
List<String> dartOptions;
List<String> sharedOptions;
List<String> dart2jsOptions;
+ List<String> ddcOptions;
Map<String, String> environment;
String packageRoot;
String packages;
@@ -1489,6 +1491,7 @@
dartOptions = singleListOfOptions('DartOptions');
sharedOptions = singleListOfOptions('SharedOptions');
dart2jsOptions = singleListOfOptions('dart2jsOptions');
+ ddcOptions = singleListOfOptions('dartdevcOptions');
matches = environmentRegExp.allMatches(contents);
for (var match in matches) {
@@ -1587,6 +1590,7 @@
"vmOptions": result,
"sharedOptions": sharedOptions ?? <String>[],
"dart2jsOptions": dart2jsOptions ?? <String>[],
+ "ddcOptions": ddcOptions ?? <String>[],
"dartOptions": dartOptions,
"environment": environment,
"packageRoot": packageRoot,
diff --git a/utils/application_snapshot.gni b/utils/application_snapshot.gni
index d078775..096b944 100644
--- a/utils/application_snapshot.gni
+++ b/utils/application_snapshot.gni
@@ -2,7 +2,7 @@
# 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("../build/compiled_action.gni")
+import("../build/dart/dart_action.gni")
_dart_root = get_path_info("..", "abspath")
@@ -18,9 +18,9 @@
template("application_snapshot") {
assert(defined(invoker.main_dart), "Must specify 'main_dart'")
assert(defined(invoker.training_args), "Must specify 'training_args'")
- vm_args = []
+ snapshot_vm_args = []
if (defined(invoker.vm_args)) {
- vm_args = invoker.vm_args
+ snapshot_vm_args = invoker.vm_args
}
main_dart = invoker.main_dart
training_args = invoker.training_args
@@ -45,14 +45,13 @@
if (defined(invoker.output)) {
output = invoker.output
}
- compiled_action(target_name) {
- tool = "$_dart_root/runtime/bin:dart"
+ dart_action(target_name) {
deps = extra_deps
depfile = "$output.d"
- main_file = rebase_path(main_dart)
+ script = main_dart
- inputs = extra_inputs + [ main_file ]
+ inputs = extra_inputs
outputs = [
output,
@@ -61,24 +60,22 @@
abs_depfile = rebase_path(depfile)
abs_output = rebase_path(output, root_build_dir)
- args = [
+ vm_args = [
"--deterministic",
"--packages=$dot_packages",
"--snapshot=$abs_output",
"--snapshot-depfile=$abs_depfile",
- ] + vm_args
+ ] + snapshot_vm_args
if (dart_snapshot_kind == "script") {
- args += [
+ vm_args += [
"--snapshot-kind=script",
- main_file,
]
assert(training_args != "", "Ignoring unused argument")
+ args = []
} else if (dart_snapshot_kind == "app-jit") {
- args += [
- "--snapshot-kind=app-jit",
- main_file,
- ] + training_args
+ vm_args += [ "--snapshot-kind=app-jit" ]
+ args = training_args
} else {
assert(false, "Bad dart_snapshot_kind: $dart_snapshot_kind")
}
@@ -87,9 +84,9 @@
template("aot_assembly") {
assert(defined(invoker.main_dart), "Must specify 'main_dart'")
- vm_args = []
+ aot_vm_args = []
if (defined(invoker.vm_args)) {
- vm_args = invoker.vm_args
+ aot_vm_args = invoker.vm_args
}
main_dart = invoker.main_dart
name = target_name
@@ -113,14 +110,12 @@
if (defined(invoker.output)) {
output = invoker.output
}
- compiled_action(target_name) {
- tool = "$_dart_root/runtime/bin:dart_bootstrap"
+ dart_bootstrap_action(target_name) {
deps = extra_deps
depfile = "$output.d"
- main_file = rebase_path(main_dart)
-
- inputs = extra_inputs + [ main_file ]
+ script = main_dart
+ inputs = extra_inputs
outputs = [
output,
@@ -129,12 +124,14 @@
abs_depfile = rebase_path(depfile)
abs_output = rebase_path(output, root_build_dir)
- args = [
+ vm_args = [
"--deterministic",
"--packages=$dot_packages",
"--snapshot-kind=app-aot",
"--snapshot=$abs_output",
"--snapshot-depfile=$abs_depfile",
- ] + vm_args + [ main_file ]
+ ] + aot_vm_args
+
+ args = []
}
}
diff --git a/utils/compile_platform.gni b/utils/compile_platform.gni
index 89169eb..8c933ce 100644
--- a/utils/compile_platform.gni
+++ b/utils/compile_platform.gni
@@ -2,8 +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.
-import("../build/dart_host_sdk_toolchain.gni")
-import("../build/prebuilt_dart_sdk.gni")
+import("../build/dart/dart_host_sdk_toolchain.gni")
+import("../build/dart/prebuilt_dart_sdk.gni")
_dart_root = get_path_info("..", "abspath")
diff --git a/utils/compiler/BUILD.gn b/utils/compiler/BUILD.gn
index a279e9e..6b8d88f 100644
--- a/utils/compiler/BUILD.gn
+++ b/utils/compiler/BUILD.gn
@@ -2,9 +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("../../build/compiled_action.gni")
-import("../../build/dart_host_sdk_toolchain.gni")
-import("../../build/prebuilt_dart_sdk.gni")
import("../../utils/compile_platform.gni")
import("../../utils/generate_patch_sdk.gni")
import("../create_timestamp.gni")
@@ -25,21 +22,19 @@
output = "$target_gen_dir/dartdoc_files.stamp"
}
-compiled_action("dart2js_create_snapshot_entry") {
- tool = "../../runtime/bin:dart"
+dart_action("dart2js_create_snapshot_entry") {
deps = [
":dart2js_files_stamp",
":dartdoc_files_stamp",
":runtime_lib_files_stamp",
]
- dot_packages = rebase_path("../../.packages")
- create_snapshot_entry = rebase_path("create_snapshot_entry.dart")
output_dir = rebase_path(target_gen_dir)
+ script = "create_snapshot_entry.dart"
+
inputs = [
"../../sdk/lib/_internal/sdk_library_metadata/lib/libraries.dart",
- create_snapshot_entry,
"$target_gen_dir/dart2js_files.stamp",
"../../tools/VERSION",
]
@@ -48,9 +43,9 @@
"$target_gen_dir/dart2js.dart",
]
+ packages = "../../.packages"
+
args = [
- "--packages=$dot_packages",
- create_snapshot_entry,
"--output_dir=$output_dir",
"--dart2js_main=pkg/compiler/lib/src/dart2js.dart",
]
diff --git a/utils/dartanalyzer/BUILD.gn b/utils/dartanalyzer/BUILD.gn
index 3a9f0ee..e41c7f6 100644
--- a/utils/dartanalyzer/BUILD.gn
+++ b/utils/dartanalyzer/BUILD.gn
@@ -2,7 +2,7 @@
# 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("../../build/dart_action.gni")
+import("../../build/dart/dart_action.gni")
import("../application_snapshot.gni")
group("dartanalyzer") {
@@ -59,7 +59,7 @@
type = invoker.type
assert(type == "spec" || type == "strong")
- dart_action(target_name) {
+ prebuilt_dart_action(target_name) {
script = "../../pkg/analyzer/tool/summary/build_sdk_summaries.dart"
packages = "../../.packages"
inputs = sdk_lib_files + analyzer_files
diff --git a/utils/dartdevc/BUILD.gn b/utils/dartdevc/BUILD.gn
index e9a6160..0350464 100644
--- a/utils/dartdevc/BUILD.gn
+++ b/utils/dartdevc/BUILD.gn
@@ -2,8 +2,7 @@
# 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("../../build/dart_action.gni")
-import("../../build/prebuilt_dart_sdk.gni")
+import("../../build/dart/dart_action.gni")
import("../application_snapshot.gni")
import("../create_timestamp.gni")
@@ -81,8 +80,7 @@
abs_main = rebase_path(main)
abs_output = rebase_path(out)
- compiled_action(target_name) {
- tool = "../../runtime/bin:dart"
+ dart_action(target_name) {
deps = [
"../compiler:compile_dart2js_platform",
"../compiler:compile_dart2js_platform_strong",
@@ -97,13 +95,11 @@
out,
]
- dot_packages = rebase_path("../../.packages")
- compiler = rebase_path("../../pkg/compiler/lib/src/dart2js.dart")
+ script = "../../pkg/compiler/lib/src/dart2js.dart"
+
+ packages = "../../.packages"
args = [
- "--packages=$dot_packages",
- compiler,
- "--packages=$dot_packages",
"$abs_main",
"-m",
"-o$abs_output",
@@ -123,7 +119,7 @@
# Apply dev_compiler's patch files to create the Dart version of the dartdevc
# SDK.
-dart_action("dartdevc_patch_sdk") {
+prebuilt_dart_action("dartdevc_patch_sdk") {
# TODO(rnystrom): Unfork DDC's patch_sdk.dart script with the
# tools/patch_sdk.dart and then change this to use generate_patch_sdk().
deps = [
@@ -163,7 +159,7 @@
# Compiles the Dart core libraries and DDC runtime to an analyzer summary and
# JS.
-dart_action("dartdevc_sdk") {
+prebuilt_dart_action("dartdevc_sdk") {
deps = [
":dartdevc_files_stamp",
":dartdevc_patch_sdk",
@@ -243,9 +239,7 @@
# Compiles the packages used by the tests to JS with dartdevc so that they are
# available for loading by the tests.
-compiled_action("dartdevc_test_pkg") {
- tool = "../../runtime/bin:dart"
-
+dart_action("dartdevc_test_pkg") {
deps = [
":dartdevc_files_stamp",
":dartdevc_sdk",
@@ -293,8 +287,9 @@
"$target_gen_dir/pkg/unittest.sum",
]
+ script = "../../pkg/dev_compiler/tool/build_pkgs.dart"
+
args = [
- rebase_path("../../pkg/dev_compiler/tool/build_pkgs.dart"),
"--analyzer-sdk",
rebase_path(sdk_summary),
"--kernel-sdk",
@@ -305,9 +300,7 @@
}
# Compiles the DDC SDK's kernel summary and JS code.
-compiled_action("dartdevc_sdk_kernel_summary") {
- tool = "../../runtime/bin:dart"
-
+dart_action("dartdevc_sdk_kernel_summary") {
deps = [
":dartdevc_files_stamp",
]
@@ -328,8 +321,9 @@
"$target_gen_dir/kernel/legacy/dart_sdk.js.map",
]
+ script = "../../pkg/dev_compiler/tool/kernel_sdk.dart"
+
args = [
- rebase_path("../../pkg/dev_compiler/tool/kernel_sdk.dart"),
rebase_path(sdk_dill),
]
}
diff --git a/utils/generate_entry_points_json.gni b/utils/generate_entry_points_json.gni
index 63684c9..04fc0fc 100644
--- a/utils/generate_entry_points_json.gni
+++ b/utils/generate_entry_points_json.gni
@@ -2,8 +2,7 @@
# 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("../build/compiled_action.gni")
-import("../build/dart_host_sdk_toolchain.gni")
+import("../build/dart/dart_action.gni")
_dart_root = get_path_info("..", "abspath")
@@ -22,76 +21,22 @@
if (defined(invoker.extra_args)) {
extra_args += invoker.extra_args
}
- compiled_action(target_name) {
+ dart_bootstrap_action(target_name) {
# Printing precompiler entry points is folded into precompilation, so dart_bootstrap is invoked
# with correct arguments to generate app-aot snapshot.
-
- input = invoker.input
+ script = invoker.input
output = invoker.output
-
- tool = "$_dart_root/runtime/bin:dart_bootstrap"
- inputs = [
- input,
- ]
outputs = [
output,
]
- args = [
+ vm_args = [
"--print-precompiler-entry-points=" + rebase_path(output),
"--snapshot=" + rebase_path("$target_gen_dir/dummy.snapshot"),
"--snapshot-kind=app-aot",
"--use-blobs",
"--snapshot-kind=app-aot",
- ] + extra_args + [
- rebase_path(input),
- ]
- }
-}
-
-# Template to generate entry points JSON file using gen_snapshot tool.
-# List of entry points is generated as a by-product while doing precompilation.
-#
-# This template expects the following arguments:
-# - input: Name of the input dart script for precompilation.
-# - output: Name of the output entry points JSON file.
-# - extra_args: Extra arguments to pass to dart_bootstrap (optional).
-# - extra_inputs: Extra input dependencies (optional).
-#
-template("generate_entry_points_json_with_gen_snapshot") {
- assert(defined(invoker.input), "Must define input dart script")
- assert(defined(invoker.output), "Must define output json file")
- extra_args = []
- if (defined(invoker.extra_args)) {
- extra_args += invoker.extra_args
- }
- extra_inputs = []
- if (defined(invoker.extra_inputs)) {
- extra_inputs += invoker.extra_inputs
- }
- compiled_action(target_name) {
- # Printing precompiler entry points is folded into precompilation, so gen_snapshot is invoked
- # with correct arguments to generate app-aot snapshot.
-
- input = invoker.input
- output = invoker.output
-
- tool = "$_dart_root/runtime/bin:gen_snapshot"
- inputs = [
- input,
- ] + extra_inputs
- outputs = [
- output,
- ]
- args = [
- "--print-precompiler-entry-points=" + rebase_path(output),
- "--snapshot-kind=app-aot-blobs",
- "--vm_snapshot_data=" + rebase_path("$target_gen_dir/dummy.vm_data.snapshot"),
- "--vm_snapshot_instructions=" + rebase_path("$target_gen_dir/dummy.vm_instr.snapshot"),
- "--isolate_snapshot_data=" + rebase_path("$target_gen_dir/dummy.isolate_data.snapshot"),
- "--isolate_snapshot_instructions=" + rebase_path("$target_gen_dir/dummy.isolate_instr.snapshot"),
- ] + extra_args + [
- rebase_path(input),
- ]
+ ] + extra_args
+ args = []
}
}
diff --git a/utils/generate_patch_sdk.gni b/utils/generate_patch_sdk.gni
index 3130eec..f947fb9 100644
--- a/utils/generate_patch_sdk.gni
+++ b/utils/generate_patch_sdk.gni
@@ -2,9 +2,7 @@
# 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("../build/dart_action.gni")
-import("../build/dart_host_sdk_toolchain.gni")
-import("../build/prebuilt_dart_sdk.gni")
+import("../build/dart/dart_action.gni")
_dart_root = get_path_info("..", "abspath")
@@ -22,7 +20,7 @@
"Need patched_sdk_dir in $target_name")
assert(defined(invoker.mode), "Need mode in $target_name")
- dart_action(target_name) {
+ prebuilt_dart_action(target_name) {
forward_variables_from(invoker, [
"deps",
])
diff --git a/utils/kernel-service/BUILD.gn b/utils/kernel-service/BUILD.gn
index ad61e49..75c2bf7 100644
--- a/utils/kernel-service/BUILD.gn
+++ b/utils/kernel-service/BUILD.gn
@@ -2,8 +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.
-import("../../build/dart_action.gni")
-import("../../build/dart_host_sdk_toolchain.gni")
+import("../../build/dart/dart_action.gni")
+import("../../build/dart/dart_host_sdk_toolchain.gni")
import("../application_snapshot.gni")
# TODO: Switch this to use kernel based app-jit snapshot
@@ -45,7 +45,7 @@
output = "$root_out_dir/frontend_server.dart.snapshot"
}
-dart_action("kernel_service_dill") {
+prebuilt_dart_action("kernel_service_dill") {
deps = [
"../../runtime/vm:vm_legacy_platform",
]