Version 2.0.0-dev.48.0
Merge commit 'f76dad0adcf6766d73351354da653d6a793b5abc' into dev
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 4d96f13..c593158 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,13 @@
+## 2.0.0-dev.48.0
+
+### Core library changes
+
+* `dart:core`
+ * Added `tryParse` static method to `int`, `double`, `num`, `BigInt`,
+ `Uri` and `DateTime`.
+ * Deprecated `onError` parameter on `int.parse`, `double.parse`
+ and `num.parse`.
+
## 2.0.0-dev.47.0
### Tool Changes
diff --git a/DEPS b/DEPS
index ebe2a9d..82394f1 100644
--- a/DEPS
+++ b/DEPS
@@ -67,7 +67,7 @@
"convert_tag": "@2.0.1",
"crypto_tag" : "@2.0.2+1",
"csslib_tag" : "@0.14.1",
- "dart2js_info_tag" : "@0.5.6",
+ "dart2js_info_tag" : "@0.5.6+2",
# Note: updates to dart_style have to be coordinated carefully with
# the infrastructure-team so that the internal formatter in
diff --git a/docs/language/informal/implicit-creation.md b/docs/language/informal/implicit-creation.md
index af5069c..d5fe36e 100644
--- a/docs/language/informal/implicit-creation.md
+++ b/docs/language/informal/implicit-creation.md
@@ -2,13 +2,13 @@
Author: eernst@.
-Version: 0.5 (2018-01-04)
+Version: 0.7 (2018-04-10)
Status: Under implementation.
-**This document** is an informal specification of the *implicit creation* feature.
-**The feature** adds support for omitting some occurrences of the reserved words
-`new` and `const` in instance creation expressions.
+**This document** is an informal specification of the *implicit creation*
+feature. **The feature** adds support for omitting some occurrences of the
+reserved words `new` and `const` in instance creation expressions.
This feature specification was written with a
[combined proposal](https://github.com/dart-lang/sdk/blob/master/docs/language/informal/optional-new-const.md)
@@ -68,49 +68,19 @@
developers to make many expressions considerably more concise, and they can
still enforce the desired semantics as needed.
-Obviously, this underscores the importance of the default: When a given instance
-creation expression omits the keyword, should it be `const` or `new`?
+Obviously, this underscores the importance of the default: When a given
+instance creation expression omits the keyword, should it be `const` or
+`new`?
-**For instance creation expressions we have chosen** to use `const` whenever
-possible, and otherwise `new`.
+**As a general rule** `const` is used whenever it is required, and
+otherwise `new` is used. This requirement arises from the syntactic
+context, based on the fact that a non-constant expression would be a
+compile-time error.
-This implies that `const` is the preferred choice for instance creation. There
-is a danger that `const` is chosen by default in some cases where this is not
-intended by the developer, and the affected software will have bugs which are
-hard to spot. In particular, `e1 == e2` may evaluate to true in cases where it
-would have yielded false with `new` objects.
-
-We consider that danger to be rather small, because `const` can only be chosen
-in cases where the denoted constructor is constant, and with a class with a
-constant constructor it is necessary for developers to treat all accesses to its
-instances in such a way that the software will still work correctly even when
-any given instance was obtained by evaluation of a constant expression. The
-point is that, for such a class, we can never know for sure that any given
-instance is _not_ a constant object.
-
-With composite literals such as lists and maps, a `const` modifier may be
-included in order to make it a constant expression (which will of course fail if
-it contains something which is not a constant expression). In this case the
-presence of `const` may again be crucial, for the same reasons as with an
-instance creation expression, but it may also be crucial that `const` is _not_
-present, because the list or map will be mutated.
-
-**For composite literals we have chosen** to implicitly introduce `const`
-whenever it is required by the context.
-
-The choice to include `const` only when required by context (rather than
-whenever possible) is strictly less aggressive than the approach with instance
-creations. This choice is necessary because there is no way for developers to
-ensure that a literal like `[1, 2]` is mutable, if permitted by the context,
-other than omitting `const`. Furthermore, we expect this choice to be
-convenient in practice, because mutable data structures are used frequently. So
-developers must expect to write an explicit `const` on composite literals now
-and then.
-
-In summary, the implicit creation feature allows for concise construction of
-objects, with a slight preference for constant expressions, and it still allows
-developers to explicitly specify `new` or `const`, whenever needed and whenever
-it is considered to be good documentation.
+In summary, the implicit creation feature allows for concise construction
+of objects, and it still allows developers to explicitly specify `new` or
+`const`, whenever needed and whenever it is considered to be good
+documentation.
## Syntax
@@ -159,43 +129,57 @@
literal.
*This roughly means that everything which is inside a syntactically
-constant expression is in a constant context. Note that a `const` modifier
-which is introduced by the source code transformation does not create a
-constant context, it is only the explicit occurrences of `const` in the
-program that create a constant context. Also note that a `throw` expression
-is currently not allowed in a constant expression, but extensions affecting
-that status may be considered. A similar situation arises for function
-literals.*
+constant expression or declaration is in a constant context. Note that a
+`const` modifier which is introduced by the source code transformation does
+not create a constant context, it is only the explicit occurrences of
+`const` in the program that create a constant context. Also note that a
+`throw` expression is currently not allowed in a constant expression, but
+extensions affecting that status may be considered. A similar situation
+arises for function literals.*
-The transformation consists of two steps. In the first step, every literal
-list and literal map _e_ which occurs in a constant context and does not
-have the modifier `const` is replaced by `const` _e_.
+*A formal parameter may have a default value, which must be a constant
+expression. We have chosen to not put such default values into a constant
+context. They must be constant, and it may be necessary to add the keyword
+`const` in order to make them so. This may seem inconvenient at times, but
+the rationale is that it allows for future generalizations of default value
+expressions allowing them to be non-constant. Still, there is no guarantee
+that such features will be added to Dart.*
+
+*For a class which contains a constant constructor and an instance variable
+which is initialized by an expression _e_, it is a compile-time error if
+_e_ is not constant. We have chosen to not put such initializers into a
+constant context, and hence an explicit `const` may be required. This may
+again seem inconvenient at times, but the rationale is that the reason for
+the constancy requirement is non-local (the constant constructor
+declaration may be many lines away from the instance variable declaration);
+it may break programs in surprising and confusing ways if a constructor is
+changed to be constant; and it may cause subtle bugs at run time due to the
+change in identity, if such a change is made and it does not cause any
+compile-time errors.*
We define *new/const insertion* as the following transformation, which will
be applied to specific parts of the program as specified below:
- if the expression _e_ occurs in a constant context, replace _e_ by
`const` _e_,
-- if the expression _e_ does not occur in a constant context, but `const`
- _e_ is a correct constant expression, replace _e_ by `const` _e_,
- otherwise replace _e_ by `new` _e_.
-*Note that this transformation is applied in a bottom-up order which implies
-that all relevant transformations have already been applied on subexpressions
-of _e_. Also note that this transformation is only applied to syntactic
-constructs where the outcome is a syntactically correct instance creation
-expression. On the other hand, the outcome may have static semantic errors,
-e.g., actual arguments to a constructor invocation may have wrong types
-because that's how the program was written.*
+*Note that new/const insertion is just a syntactic transformation, it is
+specified below where to apply it, including which syntactic constructs may
+play the role of _e_.*
-We define *new insertion* as the following transformation, which will be
-applied as specified below:
+*Also note that the outcome of new/const insertion may have static semantic
+errors, e.g., actual arguments to a constructor invocation may have wrong
+types because that's how the program was written, or a `const` list may
+have elements which are not constant expressions. In such cases, tools like
+analyzers and compilers should emit diagnostic messages that are meaningful
+in relation to the original source of the program, which might mean that
+the blame is assigned to a larger syntactic construct than the one that
+directly has a compile-time error after the transformation.*
-- replace _e_ by `new` _e_.
-
-*We specify the second step of the transformation as based on a depth-first
-traversal of an abstract syntax tree (AST). This means that the program is
-assumed to be free of syntax errors, and when the current AST is, e.g., a
+*We specify the transformation as based on a depth-first traversal of an
+abstract syntax tree (AST). This means that the program is assumed to be
+free of syntax errors, and when the current AST is, e.g., a
`postfixExpression`, the program as a whole has such a structure that the
current location was parsed as a `postfixExpression`. This is different
from the situation where we just require that a given subsequence of the
@@ -214,29 +198,6 @@
may prefer to view the transformation in that light, and we would then say
that we have omitted all the congruence rules.*
-An expression of one of the following forms must be modified in bottom-up
-order to be or contain a `constantObjectExpression` or `newExpression`
-as described:
-
-With a `postfixExpression` _e_,
-
-- if _e_ is of the form `constructorInvocation selector*`, i.e.,
- `typeName typeArguments '.' identifier arguments selector*` then perform
- new/const insertion on the initial `constructorInvocation`.
-- if _e_ is of the form
- `typeIdentifier arguments` where `typeIdentifier` denotes a class then
- perform new/const insertion on _e_.
-- if _e_ is of the form
- `identifier1 '.' identifier2 arguments` where `identifier1` denotes
- a class and `identifier2` is the name of a named constructor in that class,
- or `identifier1` denotes a prefix for a library _L_ and `identifier2` denotes
- a class exported by _L_, perform new/const insertion on _e_.
-- if _e_ is of the form
- `identifier1 '.' typeIdentifier '.' identifier2 arguments` where
- `identifier1` denotes a library prefix for a library _L_, `typeIdentifier`
- denotes a class _C_ exported by _L_, and `identifier2` is the name of a named
- constructor in _C_, perform new/const insertion on _e_.
-
For the purposes of describing the transformation on assignable expressions
we need the following syntactic entity:
@@ -245,46 +206,82 @@
arguments assignableSelector assignableSelectorPart*
```
-With an `assignableExpression` _e_,
+The transformation proceeds as follows, with three groups of situations
+where a transformation is applied:
-- if _e_ is of the form
- `constructorInvocation assignableSelectorPart+`
- then perform new/const insertion on the initial
- `constructorInvocation`.
-- if _e_ is of the form
- `typeIdentifier assignableExpressionTail`
- where `typeIdentifier` denotes a class then perform new/const insertion on
- the initial `typeIdentifier arguments`.
-- if _e_ is of the form
- `typeIdentifier '.' identifier assignableExpressionTail`
- where `typeIdentifier` denotes a class and `identifier` is the name of
- a named constructor in that class, or `typeIdentifier` denotes a prefix
- for a library _L_ and `identifier` denotes a class exported by _L_
- then perform new/const insertion on the initial
- `typeIdentifier '.' identifier arguments`.
-- if _e_ is of the form
- `typeIdentifier1 '.' typeIdentifier2 '.' identifier assignableExpressionTail`
- Where `typeIdentifier1` denotes a library prefix for a library _L_,
- `typeIdentifier2` denotes a class _C_ exported by _L_, and `identifier`
- is the name of a named constructor in _C_ then perform new/const insertion
- on the initial
- `typeIdentifier1 '.' typeIdentifier2 '.' identifier arguments`.
+1. With a `postfixExpression` _e_,
-*In short, add `const` wherever possible on terms that invoke a
-constructor, and otherwise add `new`. It is easy to verify that each of the
-replacements can be derived from `postfixExpression` via `primary
-selector*` and similarly for `assignableExpression`. Hence, the
-transformation preserves syntactic correctness.*
+ - if _e_ is of the form `constructorInvocation selector*`, i.e.,
+ `typeName typeArguments '.' identifier arguments selector*` then
+ perform new/const insertion on the initial `constructorInvocation`.
+ - if _e_ is of the form `typeIdentifier arguments` where
+ `typeIdentifier` denotes a class then perform new/const insertion on
+ _e_.
+ - if _e_ is of the form `identifier1 '.' identifier2 arguments` where
+ `identifier1` denotes a class and `identifier2` is the name of a
+ named constructor in that class, or `identifier1` denotes a prefix
+ for a library _L_ and `identifier2` denotes a class exported by _L_,
+ perform new/const insertion on _e_.
+ - if _e_ is of the form
+ `identifier1 '.' typeIdentifier '.' identifier2 arguments`
+ where `identifier1` denotes a library prefix for a library _L_,
+ `typeIdentifier` denotes a class _C_ exported by _L_, and
+ `identifier2` is the name of a named constructor in _C_, perform
+ new/const insertion on _e_.
+
+2. With an `assignableExpression` _e_,
+
+ - if _e_ is of the form
+ `constructorInvocation assignableSelectorPart+`
+ then perform new/const insertion on the initial
+ `constructorInvocation`.
+ - if _e_ is of the form `typeIdentifier assignableExpressionTail` where
+ `typeIdentifier` denotes a class then perform new/const insertion on
+ the initial `typeIdentifier arguments`.
+ - if _e_ is of the form
+ `typeIdentifier '.' identifier assignableExpressionTail`
+ where `typeIdentifier` denotes a class and `identifier` is the name
+ of a named constructor in that class, or `typeIdentifier` denotes a
+ prefix for a library _L_ and `identifier` denotes a class exported by
+ _L_ then perform new/const insertion on the initial
+ `typeIdentifier '.' identifier arguments`.
+ - if _e_ is of the form
+ `typeIdentifier1 '.' typeIdentifier2 '.' identifier
+ assignableExpressionTail`
+ where `typeIdentifier1` denotes a library prefix for a library _L_,
+ `typeIdentifier2` denotes a class _C_ exported by _L_, and
+ `identifier` is the name of a named constructor in _C_ then perform
+ new/const insertion on the initial
+ `typeIdentifier1 '.' typeIdentifier2 '.' identifier arguments`.
+
+3. If _e_ is a literal list or a literal map which occurs in a constant
+ context and does not have the modifier `const`, it is replaced by
+ `const` _e_.
+
+*In short, `const` is added implicitly in almost all situations where it is
+required by the context, and in other situations `new` is added on instance
+creations. It is easy to verify that each of the replacements can be
+derived from `postfixExpression` via `primary selector*` and similarly for
+`assignableExpression`. Hence, the transformation preserves syntactic
+correctness.*
## Dynamic Semantics
-There is no dynamic semantics to specify for this feature because it is
-eliminated by code transformation.
+There is no dynamic semantics to specify for this feature, because it is
+eliminated by the code transformation.
## Revisions
+- 0.7 (2018-04-10) Clarified the structure of the algorithm. Added
+ commentary about cases where there is no constant context even though a
+ constant expression is required, with a motivation for why it is so.
+
+- 0.6 (2018-04-06) Removed "magic const" again, due to the risks
+ associated with this feature (getting it specified and implemented
+ robustly, in time).
+
- 0.5 (2018-01-04) Rewritten to use `const` whenever possible (aka "magic
const") and adjusted to specify optional const as well as optional new
together, because they are now very closely connected. This document was
diff --git a/pkg/analysis_server/lib/src/plugin/plugin_manager.dart b/pkg/analysis_server/lib/src/plugin/plugin_manager.dart
index cde471e..36980eb 100644
--- a/pkg/analysis_server/lib/src/plugin/plugin_manager.dart
+++ b/pkg/analysis_server/lib/src/plugin/plugin_manager.dart
@@ -679,34 +679,36 @@
}
String reason;
File packagesFile = pluginFolder.getChildAssumingFile('.packages');
- if (!packagesFile.exists) {
- if (runPub) {
- String vmPath = Platform.executable;
- String pubPath = path.join(path.dirname(vmPath), 'pub');
- if (Platform.isWindows) {
- // Process.run requires the `.bat` suffix on Windows
- pubPath = '$pubPath.bat';
- }
- ProcessResult result = Process.runSync(pubPath, <String>['get'],
- stderrEncoding: utf8,
- stdoutEncoding: utf8,
- workingDirectory: pluginFolder.path,
- environment: {_pubEnvironmentKey: _getPubEnvironmentValue()});
- if (result.exitCode != 0) {
- StringBuffer buffer = new StringBuffer();
- buffer.writeln('Failed to run pub get');
- buffer.writeln(' pluginFolder = ${pluginFolder.path}');
- buffer.writeln(' exitCode = ${result.exitCode}');
- buffer.writeln(' stdout = ${result.stdout}');
- buffer.writeln(' stderr = ${result.stderr}');
- reason = buffer.toString();
- instrumentationService.logError(reason);
- }
- if (!packagesFile.exists) {
- reason ??= 'File "${packagesFile.path}" does not exist.';
- packagesFile = null;
- }
- } else if (workspace != null) {
+ bool packagesFilePreExists = packagesFile.exists;
+ if (runPub) {
+ String vmPath = Platform.executable;
+ String pubPath = path.join(path.dirname(vmPath), 'pub');
+ if (Platform.isWindows) {
+ // Process.run requires the `.bat` suffix on Windows
+ pubPath = '$pubPath.bat';
+ }
+ String pubSubcommand = packagesFilePreExists ? 'upgrade' : 'get';
+ ProcessResult result = Process.runSync(pubPath, <String>[pubSubcommand],
+ stderrEncoding: utf8,
+ stdoutEncoding: utf8,
+ workingDirectory: pluginFolder.path,
+ environment: {_pubEnvironmentKey: _getPubEnvironmentValue()});
+ if (result.exitCode != 0) {
+ StringBuffer buffer = new StringBuffer();
+ buffer.writeln('Failed to run pub get');
+ buffer.writeln(' pluginFolder = ${pluginFolder.path}');
+ buffer.writeln(' exitCode = ${result.exitCode}');
+ buffer.writeln(' stdout = ${result.stdout}');
+ buffer.writeln(' stderr = ${result.stderr}');
+ reason = buffer.toString();
+ instrumentationService.logError(reason);
+ }
+ if (!packagesFile.exists) {
+ reason ??= 'File "${packagesFile.path}" does not exist.';
+ packagesFile = null;
+ }
+ } else if (!packagesFilePreExists) {
+ if (workspace != null) {
packagesFile =
_createPackagesFile(pluginFolder, workspace.packageUriResolver);
if (packagesFile == null) {
diff --git a/pkg/analysis_server/lib/src/status/diagnostics.dart b/pkg/analysis_server/lib/src/status/diagnostics.dart
index de63862..51249a4 100644
--- a/pkg/analysis_server/lib/src/status/diagnostics.dart
+++ b/pkg/analysis_server/lib/src/status/diagnostics.dart
@@ -4,6 +4,7 @@
import 'dart:async';
import 'dart:convert';
+import 'dart:developer' as developer;
import 'dart:io';
import 'package:analysis_server/protocol/protocol_generated.dart';
@@ -214,7 +215,7 @@
'Latency statistics for analysis server communications.');
@override
- void generateContent(Map<String, String> params) {
+ Future generateContent(Map<String, String> params) async {
void writeRow(List<String> data, {List<String> classes}) {
buf.write("<tr>");
for (int i = 0; i < data.length; i++) {
@@ -302,7 +303,7 @@
description: 'Latency statistics for code completion.');
@override
- void generateContent(Map<String, String> params) {
+ Future generateContent(Map<String, String> params) async {
CompletionDomainHandler completionDomain = server.handlers
.firstWhere((handler) => handler is CompletionDomainHandler);
@@ -391,7 +392,7 @@
}
@override
- void generateContent(Map<String, String> params) {
+ Future generateContent(Map<String, String> params) async {
Map<Folder, AnalysisDriver> driverMap = server.driverMap;
if (driverMap.isEmpty) {
blankslate('No contexts.');
@@ -583,7 +584,7 @@
buf.writeln('</div>');
}
- void generateContent(Map<String, String> params);
+ Future generateContent(Map<String, String> params);
void generateFooter() {
buf.writeln('''
@@ -790,7 +791,7 @@
'System environment variables as seen from the analysis server.');
@override
- void generateContent(Map<String, String> params) {
+ Future generateContent(Map<String, String> params) async {
buf.writeln('<table>');
buf.writeln('<tr><th>Variable</th><th>Value</th></tr>');
for (String key in Platform.environment.keys.toList()..sort()) {
@@ -807,7 +808,7 @@
ExceptionPage(Site site, String message, this.trace)
: super(site, '', '500 Oops', description: message);
- void generateContent(Map<String, String> params) {
+ Future generateContent(Map<String, String> params) async {
p(trace.toString(), style: 'white-space: pre');
}
}
@@ -822,7 +823,7 @@
String get navDetail => printInteger(exceptions.length);
@override
- void generateContent(Map<String, String> params) {
+ Future generateContent(Map<String, String> params) async {
if (exceptions.isEmpty) {
blankslate('No exceptions encountered!');
} else {
@@ -844,7 +845,7 @@
description: 'Providing feedback and filing issues.');
@override
- void generateContent(Map<String, String> params) {
+ Future generateContent(Map<String, String> params) async {
final String issuesUrl = 'https://github.com/dart-lang/sdk/issues';
p(
'To file issues or feature requests, see our '
@@ -887,7 +888,7 @@
'Verbose instrumentation data from the analysis server.');
@override
- void generateContent(Map<String, String> params) {
+ Future generateContent(Map<String, String> params) async {
p(
'Instrumentation can be enabled by starting the analysis server with the '
'<code>--instrumentation-log-file=path/to/file</code> flag.',
@@ -929,15 +930,59 @@
}
@override
- void generateContent(Map<String, String> params) {
- UsageInfo usage = profiler.getProcessUsageSync(pid);
+ Future generateContent(Map<String, String> params) async {
+ UsageInfo usage = await profiler.getProcessUsage(pid);
+
+ developer.ServiceProtocolInfo serviceProtocolInfo =
+ await developer.Service.getInfo();
+
if (usage != null) {
buf.writeln(
writeOption('CPU', printPercentage(usage.cpuPercentage / 100.0)));
buf.writeln(
writeOption('Memory', '${printInteger(usage.memoryMB.round())} MB'));
+
+ h3('VM');
+
+ if (serviceProtocolInfo.serverUri == null) {
+ p('Service protocol not enabled.');
+ } else {
+ p(serviceProtocolInfo.toString());
+
+ // http://127.0.0.1:8181/ ==> ws://127.0.0.1:8181/ws
+ Uri uri = serviceProtocolInfo.serverUri;
+ uri = uri.replace(scheme: 'ws', path: 'ws');
+
+ final ServiceProtocol service = await ServiceProtocol.connect(uri);
+ final Map vm = await service.call('getVM');
+
+ h3('Isolates');
+
+ List isolateRefs = vm['isolates'];
+ for (Map isolateRef in isolateRefs) {
+ Map isolate =
+ await service.call('getIsolate', {'isolateId': isolateRef['id']});
+
+ Map _heaps = isolate['_heaps'];
+
+ int used = 0;
+ used = _heaps['new']['used'] + _heaps['new']['external'];
+ used = _heaps['old']['used'] + _heaps['old']['external'];
+ double usedMB = used / (1024.0 * 1024.0);
+
+ int capacity = 0;
+ capacity = _heaps['new']['capacity'] + _heaps['new']['external'];
+ capacity = _heaps['old']['capacity'] + _heaps['old']['external'];
+ double capacityMB = capacity / (1024.0 * 1024.0);
+
+ buf.writeln(writeOption(isolate['name'],
+ '${usedMB.round()} MB of ${capacityMB.round()} MB'));
+ }
+
+ service.dispose();
+ }
} else {
- p('Error retreiving the memory and cpu usage information.');
+ p('Error retrieving the memory and cpu usage information.');
}
}
}
@@ -948,7 +993,7 @@
NotFoundPage(Site site, this.path)
: super(site, '', '404 Not found', description: "'$path' not found.");
- void generateContent(Map<String, String> params) {}
+ Future generateContent(Map<String, String> params) async {}
}
class OverlaysPage extends DiagnosticPageWithNav {
@@ -957,7 +1002,7 @@
description: 'Editing overlays - unsaved file changes.');
@override
- void generateContent(Map<String, String> params) {
+ Future generateContent(Map<String, String> params) async {
FileContentOverlay overlays = server.fileContentOverlay;
List<String> paths = overlays.paths.toList()..sort();
@@ -1000,7 +1045,7 @@
: super(site, 'plugins', 'Plugins', description: 'Plugins in use.');
@override
- void generateContent(Map<String, String> params) {
+ Future generateContent(Map<String, String> params) async {
h3('Analysis plugins');
List<PluginInfo> analysisPlugins = server.pluginManager.plugins;
@@ -1061,7 +1106,7 @@
description: 'Profiling performance tag data.');
@override
- void generateContent(Map<String, String> params) {
+ Future generateContent(Map<String, String> params) async {
h3('Profiling performance tag data');
// prepare sorted tags
@@ -1162,7 +1207,7 @@
'General status and diagnostics for the analysis server.');
@override
- void generateContent(Map<String, String> params) {
+ Future generateContent(Map<String, String> params) async {
DiagnosticsSite diagnosticsSite = site;
buf.writeln('<div class="columns">');
@@ -1200,7 +1245,7 @@
description: 'Registered subscriptions to analysis server events.');
@override
- void generateContent(Map<String, String> params) {
+ Future generateContent(Map<String, String> params) async {
// server domain
h3('Server domain subscriptions');
ul(ServerService.VALUES, (item) {
@@ -1235,3 +1280,49 @@
});
}
}
+
+class ServiceProtocol {
+ final WebSocket socket;
+
+ int _id = 0;
+ Map<String, Completer> _completers = {};
+
+ static Future<ServiceProtocol> connect(Uri uri) async {
+ WebSocket socket = await WebSocket.connect(uri.toString());
+ return new ServiceProtocol._(socket);
+ }
+
+ ServiceProtocol._(this.socket) {
+ socket.listen(_handleMessage);
+ }
+
+ Future<Map> call(String method, [Map args]) {
+ String id = '${++_id}';
+ Completer completer = new Completer();
+ _completers[id] = completer;
+ Map m = {'id': id, 'method': method};
+ if (args != null) m['params'] = args;
+ String message = jsonEncode(m);
+ socket.add(message);
+ return completer.future;
+ }
+
+ void _handleMessage(dynamic message) {
+ if (message is! String) {
+ return;
+ }
+
+ try {
+ dynamic json = jsonDecode(message);
+ if (json.containsKey('id')) {
+ dynamic id = json['id'];
+ _completers[id]?.complete(json['result']);
+ _completers.remove(id);
+ }
+ } catch (e) {
+ // ignore
+ }
+ }
+
+ Future dispose() => socket.close();
+}
diff --git a/pkg/analyzer/lib/context/declared_variables.dart b/pkg/analyzer/lib/context/declared_variables.dart
index add4797..c0d7fdf 100644
--- a/pkg/analyzer/lib/context/declared_variables.dart
+++ b/pkg/analyzer/lib/context/declared_variables.dart
@@ -2,105 +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.
+@deprecated
library analyzer.context.declared_variables;
-import 'dart:collection';
-
-import 'package:analyzer/dart/constant/value.dart';
-import 'package:analyzer/src/dart/constant/value.dart';
-import 'package:analyzer/src/generated/resolver.dart' show TypeProvider;
-
-/**
- * An object used to provide access to the values of variables that have been
- * defined on the command line using the `-D` option.
- *
- * Clients may not extend, implement or mix-in this class.
- */
-class DeclaredVariables {
- /**
- * A table mapping the names of declared variables to their values.
- */
- Map<String, String> _declaredVariables = new HashMap<String, String>();
-
- /**
- * Return the names of the variables for which a value has been defined.
- */
- Iterable<String> get variableNames => _declaredVariables.keys;
-
- /**
- * Add all variables of [other] to this object.
- */
- void addAll(DeclaredVariables other) {
- _declaredVariables.addAll(other._declaredVariables);
- }
-
- /**
- * Define a variable with the given [name] to have the given [value].
- */
- void define(String name, String value) {
- _declaredVariables[name] = value;
- }
-
- /**
- * Return the raw string value of the variable with the given [name],
- * or `null` of the variable is not defined.
- */
- String get(String name) => _declaredVariables[name];
-
- /**
- * Return the value of the variable with the given [name] interpreted as a
- * 'boolean' value. If the variable is not defined (or [name] is `null`), a
- * DartObject representing "unknown" is returned. If the value cannot be
- * parsed as a boolean, a DartObject representing 'null' is returned. The
- * [typeProvider] is the type provider used to find the type 'bool'.
- */
- DartObject getBool(TypeProvider typeProvider, String name) {
- String value = _declaredVariables[name];
- if (value == null) {
- return new DartObjectImpl(typeProvider.boolType, BoolState.UNKNOWN_VALUE);
- }
- if (value == "true") {
- return new DartObjectImpl(typeProvider.boolType, BoolState.TRUE_STATE);
- } else if (value == "false") {
- return new DartObjectImpl(typeProvider.boolType, BoolState.FALSE_STATE);
- }
- return new DartObjectImpl(typeProvider.nullType, NullState.NULL_STATE);
- }
-
- /**
- * Return the value of the variable with the given [name] interpreted as an
- * integer value. If the variable is not defined (or [name] is `null`), a
- * DartObject representing "unknown" is returned. If the value cannot be
- * parsed as an integer, a DartObject representing 'null' is returned.
- */
- DartObject getInt(TypeProvider typeProvider, String name) {
- String value = _declaredVariables[name];
- if (value == null) {
- return new DartObjectImpl(typeProvider.intType, IntState.UNKNOWN_VALUE);
- }
- int bigInteger;
- try {
- bigInteger = int.parse(value);
- } on FormatException {
- return new DartObjectImpl(typeProvider.nullType, NullState.NULL_STATE);
- }
- return new DartObjectImpl(typeProvider.intType, new IntState(bigInteger));
- }
-
- /**
- * Return the value of the variable with the given [name] interpreted as a
- * String value, or `null` if the variable is not defined. Return the value of
- * the variable with the given name interpreted as a String value. If the
- * variable is not defined (or [name] is `null`), a DartObject representing
- * "unknown" is returned. The [typeProvider] is the type provider used to find
- * the type 'String'.
- */
- DartObject getString(TypeProvider typeProvider, String name) {
- String value = _declaredVariables[name];
- if (value == null) {
- return new DartObjectImpl(
- typeProvider.stringType, StringState.UNKNOWN_VALUE);
- }
- return new DartObjectImpl(typeProvider.stringType, new StringState(value));
- }
-}
+export 'package:analyzer/dart/analysis/declared_variables.dart';
diff --git a/pkg/analyzer/lib/dart/analysis/context_builder.dart b/pkg/analyzer/lib/dart/analysis/context_builder.dart
new file mode 100644
index 0000000..69ef376
--- /dev/null
+++ b/pkg/analyzer/lib/dart/analysis/context_builder.dart
@@ -0,0 +1,42 @@
+// 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/analysis/analysis_context.dart';
+import 'package:analyzer/dart/analysis/context_root.dart';
+import 'package:analyzer/dart/analysis/declared_variables.dart';
+import 'package:analyzer/file_system/file_system.dart';
+import 'package:analyzer/src/dart/analysis/context_builder.dart';
+import 'package:meta/meta.dart';
+
+/**
+ * A utility class used to build an analysis context based on a context root.
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+abstract class ContextBuilder {
+ /**
+ * Initialize a newly created context builder. If a [resourceProvider] is
+ * given, then it will be used to access the file system, otherwise the
+ * default resource provider will be used.
+ */
+ factory ContextBuilder({ResourceProvider resourceProvider}) =
+ ContextBuilderImpl;
+
+ /**
+ * Return an analysis context corresponding to the given [contextRoot].
+ *
+ * If a set of [declaredVariables] is provided, the values will be used to map
+ * the the variable names found in `fromEnvironment` invocations to the
+ * constant value that will be returned. If none is given, then no variables
+ * will be defined.
+ *
+ * If an [sdkPath] is provided, and if it is a valid path to a directory
+ * containing a valid SDK, then the SDK in the referenced directory will be
+ * used when analyzing the code in the context.
+ */
+ AnalysisContext createContext(
+ {@required ContextRoot contextRoot,
+ DeclaredVariables declaredVariables,
+ String sdkPath});
+}
diff --git a/pkg/analyzer/lib/dart/analysis/declared_variables.dart b/pkg/analyzer/lib/dart/analysis/declared_variables.dart
new file mode 100644
index 0000000..a517582
--- /dev/null
+++ b/pkg/analyzer/lib/dart/analysis/declared_variables.dart
@@ -0,0 +1,119 @@
+// 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:analyzer/dart/constant/value.dart';
+import 'package:analyzer/src/dart/constant/value.dart';
+import 'package:analyzer/src/generated/resolver.dart' show TypeProvider;
+
+/**
+ * An object used to provide access to the values of variables that have been
+ * defined on the command line using the `-D` option.
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class DeclaredVariables {
+ /**
+ * A table mapping the names of declared variables to their values.
+ */
+ Map<String, String> _declaredVariables = <String, String>{};
+
+ /**
+ * Initialize a newly created set of declared variables in which there are no
+ * variables.
+ */
+ DeclaredVariables();
+
+ /**
+ * Initialize a newly created set of declared variables to define variables
+ * whose names are the keys in the give [variableMap] and whose values are the
+ * corresponding values from the map.
+ */
+ DeclaredVariables.fromMap(Map<String, String> variableMap) {
+ _declaredVariables.addAll(variableMap);
+ }
+
+ /**
+ * Return the names of the variables for which a value has been defined.
+ */
+ Iterable<String> get variableNames => _declaredVariables.keys;
+
+ /**
+ * Add all variables of [other] to this object.
+ */
+ @deprecated
+ void addAll(DeclaredVariables other) {
+ _declaredVariables.addAll(other._declaredVariables);
+ }
+
+ /**
+ * Define a variable with the given [name] to have the given [value].
+ */
+ @deprecated
+ void define(String name, String value) {
+ _declaredVariables[name] = value;
+ }
+
+ /**
+ * Return the raw string value of the variable with the given [name],
+ * or `null` of the variable is not defined.
+ */
+ String get(String name) => _declaredVariables[name];
+
+ /**
+ * Return the value of the variable with the given [name] interpreted as a
+ * 'boolean' value. If the variable is not defined (or [name] is `null`), a
+ * DartObject representing "unknown" is returned. If the value cannot be
+ * parsed as a boolean, a DartObject representing 'null' is returned. The
+ * [typeProvider] is the type provider used to find the type 'bool'.
+ */
+ DartObject getBool(TypeProvider typeProvider, String name) {
+ String value = _declaredVariables[name];
+ if (value == null) {
+ return new DartObjectImpl(typeProvider.boolType, BoolState.UNKNOWN_VALUE);
+ }
+ if (value == "true") {
+ return new DartObjectImpl(typeProvider.boolType, BoolState.TRUE_STATE);
+ } else if (value == "false") {
+ return new DartObjectImpl(typeProvider.boolType, BoolState.FALSE_STATE);
+ }
+ return new DartObjectImpl(typeProvider.nullType, NullState.NULL_STATE);
+ }
+
+ /**
+ * Return the value of the variable with the given [name] interpreted as an
+ * integer value. If the variable is not defined (or [name] is `null`), a
+ * DartObject representing "unknown" is returned. If the value cannot be
+ * parsed as an integer, a DartObject representing 'null' is returned.
+ */
+ DartObject getInt(TypeProvider typeProvider, String name) {
+ String value = _declaredVariables[name];
+ if (value == null) {
+ return new DartObjectImpl(typeProvider.intType, IntState.UNKNOWN_VALUE);
+ }
+ int bigInteger;
+ try {
+ bigInteger = int.parse(value);
+ } on FormatException {
+ return new DartObjectImpl(typeProvider.nullType, NullState.NULL_STATE);
+ }
+ return new DartObjectImpl(typeProvider.intType, new IntState(bigInteger));
+ }
+
+ /**
+ * Return the value of the variable with the given [name] interpreted as a
+ * String value, or `null` if the variable is not defined. Return the value of
+ * the variable with the given name interpreted as a String value. If the
+ * variable is not defined (or [name] is `null`), a DartObject representing
+ * "unknown" is returned. The [typeProvider] is the type provider used to find
+ * the type 'String'.
+ */
+ DartObject getString(TypeProvider typeProvider, String name) {
+ String value = _declaredVariables[name];
+ if (value == null) {
+ return new DartObjectImpl(
+ typeProvider.stringType, StringState.UNKNOWN_VALUE);
+ }
+ return new DartObjectImpl(typeProvider.stringType, new StringState(value));
+ }
+}
diff --git a/pkg/analyzer/lib/src/context/builder.dart b/pkg/analyzer/lib/src/context/builder.dart
index f81e3a7..29d84ce 100644
--- a/pkg/analyzer/lib/src/context/builder.dart
+++ b/pkg/analyzer/lib/src/context/builder.dart
@@ -6,7 +6,7 @@
import 'dart:core';
import 'package:analyzer/context/context_root.dart';
-import 'package:analyzer/context/declared_variables.dart';
+import 'package:analyzer/dart/analysis/declared_variables.dart';
import 'package:analyzer/file_system/file_system.dart';
import 'package:analyzer/plugin/resolver_provider.dart';
import 'package:analyzer/source/analysis_options_provider.dart';
@@ -16,6 +16,7 @@
applyAnalysisOptionFlags,
bazelAnalysisOptionsPath,
flutterAnalysisOptionsPath;
+import 'package:analyzer/src/context/context.dart';
import 'package:analyzer/src/dart/analysis/driver.dart'
show AnalysisDriver, AnalysisDriverScheduler;
import 'package:analyzer/src/dart/analysis/file_state.dart';
@@ -292,13 +293,10 @@
* Add any [declaredVariables] to the list of declared variables used by the
* given [context].
*/
- void declareVariables(InternalAnalysisContext context) {
+ void declareVariables(AnalysisContextImpl context) {
Map<String, String> variables = builderOptions.declaredVariables;
if (variables != null && variables.isNotEmpty) {
- DeclaredVariables contextVariables = context.declaredVariables;
- variables.forEach((String variableName, String value) {
- contextVariables.define(variableName, value);
- });
+ context.declaredVariables = new DeclaredVariables.fromMap(variables);
}
}
@@ -309,10 +307,7 @@
void declareVariablesInDriver(AnalysisDriver driver) {
Map<String, String> variables = builderOptions.declaredVariables;
if (variables != null && variables.isNotEmpty) {
- DeclaredVariables contextVariables = driver.declaredVariables;
- variables.forEach((String variableName, String value) {
- contextVariables.define(variableName, value);
- });
+ driver.declaredVariables = new DeclaredVariables.fromMap(variables);
}
}
diff --git a/pkg/analyzer/lib/src/context/context.dart b/pkg/analyzer/lib/src/context/context.dart
index 558a61c..200ed96 100644
--- a/pkg/analyzer/lib/src/context/context.dart
+++ b/pkg/analyzer/lib/src/context/context.dart
@@ -369,6 +369,13 @@
@override
DeclaredVariables get declaredVariables => _declaredVariables;
+ /**
+ * Set the declared variables to the give collection of declared [variables].
+ */
+ void set declaredVariables(DeclaredVariables variables) {
+ _declaredVariables = variables;
+ }
+
@deprecated
@override
EmbedderYamlLocator get embedderYamlLocator => _embedderYamlLocator;
diff --git a/pkg/analyzer/lib/src/dart/analysis/context_builder.dart b/pkg/analyzer/lib/src/dart/analysis/context_builder.dart
new file mode 100644
index 0000000..ff0ecb0
--- /dev/null
+++ b/pkg/analyzer/lib/src/dart/analysis/context_builder.dart
@@ -0,0 +1,101 @@
+// 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/context/context_root.dart' as old;
+import 'package:analyzer/dart/analysis/analysis_context.dart';
+import 'package:analyzer/dart/analysis/context_builder.dart';
+import 'package:analyzer/dart/analysis/context_root.dart';
+import 'package:analyzer/dart/analysis/declared_variables.dart';
+import 'package:analyzer/file_system/file_system.dart';
+import 'package:analyzer/file_system/physical_file_system.dart';
+import 'package:analyzer/src/context/builder.dart' as old
+ show ContextBuilder, ContextBuilderOptions;
+import 'package:analyzer/src/dart/analysis/driver.dart'
+ show AnalysisDriver, AnalysisDriverScheduler;
+import 'package:analyzer/src/dart/analysis/driver_based_analysis_context.dart';
+import 'package:analyzer/src/dart/analysis/file_state.dart'
+ show FileContentOverlay;
+import 'package:analyzer/src/dart/sdk/sdk.dart';
+import 'package:analyzer/src/generated/sdk.dart' show DartSdkManager;
+import 'package:analyzer/src/generated/source.dart' show ContentCache;
+import 'package:front_end/src/base/performance_logger.dart' show PerformanceLog;
+import 'package:front_end/src/byte_store/byte_store.dart' show MemoryByteStore;
+import 'package:meta/meta.dart';
+
+/**
+ * An implementation of a context builder.
+ */
+class ContextBuilderImpl implements ContextBuilder {
+ /**
+ * The resource provider used to access the file system.
+ */
+ final ResourceProvider resourceProvider;
+
+ /**
+ * Initialize a newly created context builder. If a [resourceProvider] is
+ * given, then it will be used to access the file system, otherwise the
+ * default resource provider will be used.
+ */
+ ContextBuilderImpl({ResourceProvider resourceProvider})
+ : resourceProvider =
+ resourceProvider ?? PhysicalResourceProvider.INSTANCE;
+
+ /**
+ * Return the path to the default location of the SDK, or `null` if the sdk
+ * cannot be found.
+ */
+ String get _defaultSdkPath =>
+ FolderBasedDartSdk.defaultSdkDirectory(resourceProvider)?.path;
+
+ @override
+ AnalysisContext createContext(
+ {@required ContextRoot contextRoot,
+ DeclaredVariables declaredVariables,
+ String sdkPath}) {
+ PerformanceLog performanceLog = new PerformanceLog(new StringBuffer());
+ AnalysisDriverScheduler scheduler =
+ new AnalysisDriverScheduler(performanceLog);
+ sdkPath ??= _defaultSdkPath;
+ if (sdkPath == null) {
+ throw new ArgumentError('Cannot find path to the SDK');
+ }
+ DartSdkManager sdkManager = new DartSdkManager(sdkPath, true);
+ scheduler.start();
+
+ // TODO(brianwilkerson) Move the required implementation from the old
+ // ContextBuilder to this class and remove the old class.
+ old.ContextBuilderOptions options = new old.ContextBuilderOptions();
+ if (declaredVariables != null) {
+ options.declaredVariables = _toMap(declaredVariables);
+ }
+ options.defaultPackageFilePath = contextRoot.packagesFile?.path;
+
+ old.ContextBuilder builder = new old.ContextBuilder(
+ resourceProvider, sdkManager, new ContentCache(),
+ options: options);
+ builder.analysisDriverScheduler = scheduler;
+ builder.byteStore = new MemoryByteStore();
+ builder.fileContentOverlay = new FileContentOverlay();
+ builder.performanceLog = performanceLog;
+
+ old.ContextRoot oldContextRoot = new old.ContextRoot(
+ contextRoot.root.path, contextRoot.excludedPaths.toList());
+ AnalysisDriver driver = builder.buildDriver(oldContextRoot);
+ DriverBasedAnalysisContext context =
+ new DriverBasedAnalysisContext(resourceProvider, contextRoot, driver);
+ return context;
+ }
+
+ /**
+ * Convert the [declaredVariables] into a map for use with the old context
+ * builder.
+ */
+ Map<String, String> _toMap(DeclaredVariables declaredVariables) {
+ Map<String, String> map = <String, String>{};
+ for (String name in declaredVariables.variableNames) {
+ map[name] = declaredVariables.get(name);
+ }
+ return map;
+ }
+}
diff --git a/pkg/analyzer/lib/src/dart/analysis/driver.dart b/pkg/analyzer/lib/src/dart/analysis/driver.dart
index 88f8525..da83c22 100644
--- a/pkg/analyzer/lib/src/dart/analysis/driver.dart
+++ b/pkg/analyzer/lib/src/dart/analysis/driver.dart
@@ -7,7 +7,7 @@
import 'dart:typed_data';
import 'package:analyzer/context/context_root.dart';
-import 'package:analyzer/context/declared_variables.dart';
+import 'package:analyzer/dart/analysis/declared_variables.dart';
import 'package:analyzer/dart/analysis/results.dart' as results;
import 'package:analyzer/dart/analysis/session.dart';
import 'package:analyzer/dart/ast/ast.dart';
@@ -171,7 +171,7 @@
/**
* The declared environment variables.
*/
- final DeclaredVariables declaredVariables = new DeclaredVariables();
+ DeclaredVariables declaredVariables = new DeclaredVariables();
/**
* Information about the context root being analyzed by this driver.
diff --git a/pkg/analyzer/lib/src/dart/analysis/kernel_context.dart b/pkg/analyzer/lib/src/dart/analysis/kernel_context.dart
index 0ce8c48..5079277 100644
--- a/pkg/analyzer/lib/src/dart/analysis/kernel_context.dart
+++ b/pkg/analyzer/lib/src/dart/analysis/kernel_context.dart
@@ -4,7 +4,7 @@
import 'dart:async';
-import 'package:analyzer/context/declared_variables.dart';
+import 'package:analyzer/dart/analysis/declared_variables.dart';
import 'package:analyzer/dart/element/element.dart' show CompilationUnitElement;
import 'package:analyzer/src/context/context.dart';
import 'package:analyzer/src/dart/analysis/file_state.dart';
@@ -107,7 +107,7 @@
AnalysisEngine.instance.createAnalysisContext();
analysisContext.useSdkCachePartition = false;
analysisContext.analysisOptions = analysisOptions;
- analysisContext.declaredVariables.addAll(declaredVariables);
+ analysisContext.declaredVariables = declaredVariables;
analysisContext.sourceFactory = sourceFactory.clone();
analysisContext.contentCache = new _ContentCacheWrapper(fsState);
diff --git a/pkg/analyzer/lib/src/dart/analysis/library_analyzer.dart b/pkg/analyzer/lib/src/dart/analysis/library_analyzer.dart
index 93b51a3..89b8073 100644
--- a/pkg/analyzer/lib/src/dart/analysis/library_analyzer.dart
+++ b/pkg/analyzer/lib/src/dart/analysis/library_analyzer.dart
@@ -5,7 +5,7 @@
import 'dart:async';
import 'dart:collection';
-import 'package:analyzer/context/declared_variables.dart';
+import 'package:analyzer/dart/analysis/declared_variables.dart';
import 'package:analyzer/dart/ast/ast.dart';
import 'package:analyzer/dart/ast/visitor.dart';
import 'package:analyzer/dart/element/element.dart';
diff --git a/pkg/analyzer/lib/src/dart/analysis/library_context.dart b/pkg/analyzer/lib/src/dart/analysis/library_context.dart
index fa670bb..5d5c629 100644
--- a/pkg/analyzer/lib/src/dart/analysis/library_context.dart
+++ b/pkg/analyzer/lib/src/dart/analysis/library_context.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 'package:analyzer/context/declared_variables.dart';
+import 'package:analyzer/dart/analysis/declared_variables.dart';
import 'package:analyzer/dart/element/element.dart'
show CompilationUnitElement, LibraryElement;
import 'package:analyzer/src/context/context.dart';
@@ -203,7 +203,7 @@
AnalysisEngine.instance.createAnalysisContext();
analysisContext.useSdkCachePartition = false;
analysisContext.analysisOptions = analysisOptions;
- analysisContext.declaredVariables.addAll(declaredVariables);
+ analysisContext.declaredVariables = declaredVariables;
analysisContext.sourceFactory = sourceFactory.clone();
var provider = new InputPackagesResultProvider(analysisContext, store);
analysisContext.resultProvider = provider;
diff --git a/pkg/analyzer/lib/src/dart/constant/evaluation.dart b/pkg/analyzer/lib/src/dart/constant/evaluation.dart
index 2951395..410a1f0 100644
--- a/pkg/analyzer/lib/src/dart/constant/evaluation.dart
+++ b/pkg/analyzer/lib/src/dart/constant/evaluation.dart
@@ -4,7 +4,7 @@
import 'dart:collection';
-import 'package:analyzer/context/declared_variables.dart';
+import 'package:analyzer/dart/analysis/declared_variables.dart';
import 'package:analyzer/dart/ast/ast.dart';
import 'package:analyzer/dart/ast/standard_ast_factory.dart';
import 'package:analyzer/dart/ast/token.dart';
diff --git a/pkg/analyzer/lib/src/fasta/ast_builder.dart b/pkg/analyzer/lib/src/fasta/ast_builder.dart
index 1b56f66..742643d 100644
--- a/pkg/analyzer/lib/src/fasta/ast_builder.dart
+++ b/pkg/analyzer/lib/src/fasta/ast_builder.dart
@@ -43,7 +43,7 @@
templateDuplicateLabelInSwitchStatement,
templateExpectedType;
import 'package:front_end/src/fasta/kernel/kernel_builder.dart'
- show Builder, KernelLibraryBuilder, Scope;
+ show Builder, Scope;
import 'package:front_end/src/fasta/quote.dart';
import 'package:front_end/src/fasta/scanner/token_constants.dart';
import 'package:front_end/src/fasta/source/scope_listener.dart'
@@ -55,7 +55,7 @@
final AstFactory ast = standard.astFactory;
final FastaErrorReporter errorReporter;
- final KernelLibraryBuilder library;
+ final Uri fileUri;
final Builder member;
ScriptTag scriptTag;
@@ -91,11 +91,11 @@
StringLiteral nativeName;
- AstBuilder(ErrorReporter errorReporter, this.library, this.member,
+ AstBuilder(ErrorReporter errorReporter, this.fileUri, this.member,
Scope scope, this.isFullAst,
[Uri uri])
: this.errorReporter = new FastaErrorReporter(errorReporter),
- uri = uri ?? library.fileUri,
+ uri = uri ?? fileUri,
super(scope);
createJumpTarget(JumpTargetKind kind, int charOffset) {
diff --git a/pkg/analyzer/lib/src/fasta/error_converter.dart b/pkg/analyzer/lib/src/fasta/error_converter.dart
index 2b1db80..5032154 100644
--- a/pkg/analyzer/lib/src/fasta/error_converter.dart
+++ b/pkg/analyzer/lib/src/fasta/error_converter.dart
@@ -134,7 +134,14 @@
ParserErrorCode.DUPLICATE_LABEL_IN_SWITCH_STATEMENT,
offset,
length,
- [arguments['string']]);
+ [arguments['name']]);
+ return;
+ case "LABEL_UNDEFINED":
+ errorReporter?.reportErrorForOffset(
+ CompileTimeErrorCode.LABEL_UNDEFINED,
+ offset,
+ length,
+ [arguments['name']]);
return;
case "COVARIANT_MEMBER":
errorReporter?.reportErrorForOffset(
diff --git a/pkg/analyzer/lib/src/generated/constant.dart b/pkg/analyzer/lib/src/generated/constant.dart
index dfa5310..bb3a55c 100644
--- a/pkg/analyzer/lib/src/generated/constant.dart
+++ b/pkg/analyzer/lib/src/generated/constant.dart
@@ -4,7 +4,7 @@
library analyzer.src.generated.constant;
-import 'package:analyzer/context/declared_variables.dart';
+import 'package:analyzer/dart/analysis/declared_variables.dart';
import 'package:analyzer/dart/ast/ast.dart';
import 'package:analyzer/error/listener.dart';
import 'package:analyzer/src/dart/constant/evaluation.dart';
@@ -16,7 +16,7 @@
import 'package:analyzer/src/generated/type_system.dart'
show TypeSystem, TypeSystemImpl;
-export 'package:analyzer/context/declared_variables.dart';
+export 'package:analyzer/dart/analysis/declared_variables.dart';
export 'package:analyzer/dart/constant/value.dart';
export 'package:analyzer/src/dart/constant/evaluation.dart';
export 'package:analyzer/src/dart/constant/utilities.dart';
diff --git a/pkg/analyzer/lib/src/generated/parser.dart b/pkg/analyzer/lib/src/generated/parser.dart
index b7b109d..a96b872 100644
--- a/pkg/analyzer/lib/src/generated/parser.dart
+++ b/pkg/analyzer/lib/src/generated/parser.dart
@@ -25,7 +25,6 @@
import 'package:analyzer/src/generated/source.dart';
import 'package:analyzer/src/generated/utilities_dart.dart';
import 'package:front_end/src/fasta/kernel/kernel_builder.dart';
-import 'package:front_end/src/fasta/kernel/kernel_library_builder.dart';
import 'package:front_end/src/fasta/parser/identifier_context.dart' as fasta;
import 'package:front_end/src/fasta/parser/member_kind.dart' as fasta;
import 'package:front_end/src/fasta/parser/parser.dart' as fasta;
diff --git a/pkg/analyzer/lib/src/generated/parser_fasta.dart b/pkg/analyzer/lib/src/generated/parser_fasta.dart
index fa6527c..2a7322b 100644
--- a/pkg/analyzer/lib/src/generated/parser_fasta.dart
+++ b/pkg/analyzer/lib/src/generated/parser_fasta.dart
@@ -23,12 +23,12 @@
*/
final AstBuilder astBuilder;
- ParserAdapter(this.currentToken, ErrorReporter errorReporter,
- KernelLibraryBuilder library, Builder member, Scope scope,
+ ParserAdapter(this.currentToken, ErrorReporter errorReporter, Uri fileUri,
+ Builder member, Scope scope,
{bool allowNativeClause: false, bool enableGenericMethodComments: false})
: fastaParser = new fasta.Parser(null),
astBuilder =
- new AstBuilder(errorReporter, library, member, scope, true) {
+ new AstBuilder(errorReporter, fileUri, member, scope, true) {
fastaParser.listener = astBuilder;
astBuilder.parser = fastaParser;
astBuilder.allowNativeClause = allowNativeClause;
@@ -329,18 +329,6 @@
noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation);
}
-class _KernelLibraryBuilder implements KernelLibraryBuilder {
- @override
- final uri;
-
- _KernelLibraryBuilder(this.uri);
-
- @override
- Uri get fileUri => uri;
-
- noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation);
-}
-
/**
* Replacement parser based on Fasta.
*/
@@ -359,17 +347,15 @@
factory _Parser2(Source source, AnalysisErrorListener errorListener,
{bool allowNativeClause: false}) {
var errorReporter = new ErrorReporter(errorListener, source);
- var library = new _KernelLibraryBuilder(source.uri);
var member = new _Builder();
var scope = new Scope.top(isModifiable: true);
- return new _Parser2._(source, errorReporter, library, member, scope,
+ return new _Parser2._(source, errorReporter, source.uri, member, scope,
allowNativeClause: allowNativeClause);
}
- _Parser2._(this._source, ErrorReporter errorReporter,
- KernelLibraryBuilder library, Builder member, Scope scope,
- {bool allowNativeClause: false})
- : super(null, errorReporter, library, member, scope,
+ _Parser2._(this._source, ErrorReporter errorReporter, Uri fileUri,
+ Builder member, Scope scope, {bool allowNativeClause: false})
+ : super(null, errorReporter, fileUri, member, scope,
allowNativeClause: allowNativeClause);
noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation);
diff --git a/pkg/analyzer/lib/src/generated/source.dart b/pkg/analyzer/lib/src/generated/source.dart
index f930bcd..de9c88f 100644
--- a/pkg/analyzer/lib/src/generated/source.dart
+++ b/pkg/analyzer/lib/src/generated/source.dart
@@ -218,20 +218,7 @@
* Initialize a newly created set of line information to represent the data
* encoded in the given list of [lineStarts].
*/
- factory LineInfo(List<int> lineStarts) => new LineInfoWithCount(lineStarts);
-
- /**
- * Initialize a newly created set of line information corresponding to the
- * given file [content].
- */
- factory LineInfo.fromContent(String content) =>
- new LineInfoWithCount(StringUtilities.computeLineStarts(content));
-
- /**
- * Initialize a newly created set of line information to represent the data
- * encoded in the given list of [lineStarts].
- */
- LineInfo._(this.lineStarts) {
+ LineInfo(this.lineStarts) {
if (lineStarts == null) {
throw new ArgumentError("lineStarts must be non-null");
} else if (lineStarts.length < 1) {
@@ -240,6 +227,13 @@
}
/**
+ * Initialize a newly created set of line information corresponding to the
+ * given file [content].
+ */
+ factory LineInfo.fromContent(String content) =>
+ new LineInfo(StringUtilities.computeLineStarts(content));
+
+ /**
* The number of lines.
*/
int get lineCount => lineStarts.length;
@@ -331,21 +325,6 @@
}
/**
- * Information about line and column information within a source file,
- * including a count of the total number of lines.
- *
- * TODO(paulberry): in the next major version roll of analyzer, merge this
- * class into [LineInfo].
- */
-class LineInfoWithCount extends LineInfo {
- /**
- * Initialize a newly created set of line information to represent the data
- * encoded in the given list of [lineStarts].
- */
- LineInfoWithCount(List<int> lineStarts) : super._(lineStarts);
-}
-
-/**
* Instances of interface `LocalSourcePredicate` are used to determine if the given
* [Source] is "local" in some sense, so can be updated.
*/
diff --git a/pkg/analyzer/lib/src/generated/type_system.dart b/pkg/analyzer/lib/src/generated/type_system.dart
index 3754221..06b9b36 100644
--- a/pkg/analyzer/lib/src/generated/type_system.dart
+++ b/pkg/analyzer/lib/src/generated/type_system.dart
@@ -63,8 +63,6 @@
identical(t, UnknownInferredType.instance);
}
-typedef bool _GuardedSubtypeChecker<T>(T t1, T t2, Set<DartType> visitedTypes);
-
/**
* Implementation of [TypeSystem] using the strong mode rules.
* https://github.com/dart-lang/dev_compiler/blob/master/STRONG_MODE.md
@@ -434,18 +432,19 @@
@override
bool isAssignableTo(DartType fromType, DartType toType,
{bool isDeclarationCast = false}) {
- if (fromType is InterfaceType) {
+ // An actual subtype
+ if (isSubtypeOf(fromType, toType)) {
+ return true;
+ }
+
+ // A call method tearoff
+ if (fromType is InterfaceType && acceptsFunctionType(toType)) {
var callMethodType = getCallMethodType(fromType);
if (callMethodType != null && isAssignableTo(callMethodType, toType)) {
return true;
}
}
- // An actual subtype
- if (isSubtypeOf(fromType, toType)) {
- return true;
- }
-
// A fuzzy arrow subtype
if (toType is FunctionType &&
isSubtypeOf(fromType, functionTypeToFuzzyType(toType))) {
@@ -565,11 +564,6 @@
p1.isCovariant && isSubtypeOf(p1.type, p2.type);
}
- @override
- bool isSubtypeOf(DartType leftType, DartType rightType) {
- return _isSubtypeOf(leftType, rightType, null);
- }
-
/// Given a [type] T that may have an unknown type `?`, returns a type
/// R such that R <: T for any type substituted for `?`.
///
@@ -761,22 +755,6 @@
return "${type?.element?.library?.identifier},$type";
}
- /// Guard against loops in the class hierarchy.
- _GuardedSubtypeChecker<T> _guard<T extends DartType>(
- _GuardedSubtypeChecker<T> check) {
- return (T t1, T t2, Set<DartType> visitedTypes) {
- visitedTypes ??= new HashSet<DartType>();
- if (t1 == null || !visitedTypes.add(t1)) {
- return false;
- }
- try {
- return check(t1, t2, visitedTypes);
- } finally {
- visitedTypes.remove(t1);
- }
- };
- }
-
/**
* This currently does not implement a very complete least upper bound
* algorithm, but handles a couple of the very common cases that are
@@ -829,15 +807,13 @@
///
/// This will always assume function types use fuzzy arrows, in other words
/// that dynamic parameters of f1 and f2 are treated as bottom.
- bool _isFunctionSubtypeOf(
- FunctionType f1, FunctionType f2, Set<DartType> visitedTypes) {
+ bool _isFunctionSubtypeOf(FunctionType f1, FunctionType f2) {
return FunctionTypeImpl.relate(f1, f2, isSubtypeOf, instantiateToBounds,
- parameterRelation: (p1, p2) =>
- _isSubtypeOf(p2.type, p1.type, visitedTypes));
+ parameterRelation: (p1, p2) => isSubtypeOf(p2.type, p1.type));
}
bool _isInterfaceSubtypeOf(
- InterfaceType i1, InterfaceType i2, Set<DartType> visitedTypes) {
+ InterfaceType i1, InterfaceType i2, Set<ClassElement> visitedTypes) {
// Note: we should never reach `_isInterfaceSubtypeOf` with `i2 == Object`,
// because top types are eliminated before `isSubtypeOf` calls this.
if (identical(i1, i2) || i2.isObject) {
@@ -849,7 +825,8 @@
return false;
}
- if (i1.element == i2.element) {
+ ClassElement i1Element = i1.element;
+ if (i1Element == i2.element) {
List<DartType> tArgs1 = i1.typeArguments;
List<DartType> tArgs2 = i2.typeArguments;
@@ -870,22 +847,26 @@
return false;
}
- // Guard recursive calls
- _GuardedSubtypeChecker<InterfaceType> guardedInterfaceSubtype =
- _guard(_isInterfaceSubtypeOf);
+ // Guard against loops in the class hierarchy.
+ //
+ // Dart 2 does not allow multiple implementations of the same generic type
+ // with different type arguments. So we can track just the class element
+ // to find cycles, rather than tracking the full interface type.
+ visitedTypes ??= new HashSet<ClassElement>();
+ if (!visitedTypes.add(i1Element)) return false;
- if (guardedInterfaceSubtype(i1.superclass, i2, visitedTypes)) {
+ if (_isInterfaceSubtypeOf(i1.superclass, i2, visitedTypes)) {
return true;
}
for (final parent in i1.interfaces) {
- if (guardedInterfaceSubtype(parent, i2, visitedTypes)) {
+ if (_isInterfaceSubtypeOf(parent, i2, visitedTypes)) {
return true;
}
}
for (final parent in i1.mixins) {
- if (guardedInterfaceSubtype(parent, i2, visitedTypes)) {
+ if (_isInterfaceSubtypeOf(parent, i2, visitedTypes)) {
return true;
}
}
@@ -893,7 +874,8 @@
return false;
}
- bool _isSubtypeOf(DartType t1, DartType t2, Set<DartType> visitedTypes) {
+ @override
+ bool isSubtypeOf(DartType t1, DartType t2) {
if (identical(t1, t2)) {
return true;
}
@@ -967,18 +949,14 @@
return t2.isDartCoreFunction;
}
- // Guard recursive calls
- _GuardedSubtypeChecker<FunctionType> guardedIsFunctionSubtype =
- _guard(_isFunctionSubtypeOf);
-
if (t1 is InterfaceType && t2 is FunctionType) return false;
// Two interface types
if (t1 is InterfaceType && t2 is InterfaceType) {
- return _isInterfaceSubtypeOf(t1, t2, visitedTypes);
+ return _isInterfaceSubtypeOf(t1, t2, null);
}
- return guardedIsFunctionSubtype(t1, t2, visitedTypes);
+ return _isFunctionSubtypeOf(t1, t2);
}
FunctionType _replaceDynamicParameters(FunctionType t, DartType replaceWith) {
@@ -2106,6 +2084,16 @@
}
// 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)) {
@@ -2211,6 +2199,9 @@
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)) {
diff --git a/pkg/analyzer/test/context/declared_variables_test.dart b/pkg/analyzer/test/dart/analysis/declared_variables_test.dart
similarity index 81%
rename from pkg/analyzer/test/context/declared_variables_test.dart
rename to pkg/analyzer/test/dart/analysis/declared_variables_test.dart
index 1d131c6..b9465f3 100644
--- a/pkg/analyzer/test/context/declared_variables_test.dart
+++ b/pkg/analyzer/test/dart/analysis/declared_variables_test.dart
@@ -2,16 +2,14 @@
// 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 analyzer.test.context.declared_variables_test;
-
-import 'package:analyzer/context/declared_variables.dart';
+import 'package:analyzer/dart/analysis/declared_variables.dart';
import 'package:analyzer/dart/element/type.dart';
import 'package:analyzer/src/generated/constant.dart';
import 'package:analyzer/src/generated/testing/test_type_provider.dart';
import 'package:test/test.dart';
import 'package:test_reflective_loader/test_reflective_loader.dart';
-import '../generated/test_support.dart';
+import '../../generated/test_support.dart';
main() {
defineReflectiveSuite(() {
@@ -24,8 +22,8 @@
void test_getBool_false() {
TestTypeProvider typeProvider = new TestTypeProvider();
String variableName = "var";
- DeclaredVariables variables = new DeclaredVariables();
- variables.define(variableName, "false");
+ DeclaredVariables variables =
+ new DeclaredVariables.fromMap({variableName: 'false'});
DartObject object = variables.getBool(typeProvider, variableName);
expect(object, isNotNull);
expect(object.toBoolValue(), false);
@@ -34,8 +32,8 @@
void test_getBool_invalid() {
TestTypeProvider typeProvider = new TestTypeProvider();
String variableName = "var";
- DeclaredVariables variables = new DeclaredVariables();
- variables.define(variableName, "not true");
+ DeclaredVariables variables =
+ new DeclaredVariables.fromMap({variableName: 'not true'});
_assertNullDartObject(
typeProvider, variables.getBool(typeProvider, variableName));
}
@@ -43,8 +41,8 @@
void test_getBool_true() {
TestTypeProvider typeProvider = new TestTypeProvider();
String variableName = "var";
- DeclaredVariables variables = new DeclaredVariables();
- variables.define(variableName, "true");
+ DeclaredVariables variables =
+ new DeclaredVariables.fromMap({variableName: 'true'});
DartObject object = variables.getBool(typeProvider, variableName);
expect(object, isNotNull);
expect(object.toBoolValue(), true);
@@ -61,8 +59,8 @@
void test_getInt_invalid() {
TestTypeProvider typeProvider = new TestTypeProvider();
String variableName = "var";
- DeclaredVariables variables = new DeclaredVariables();
- variables.define(variableName, "four score and seven years");
+ DeclaredVariables variables = new DeclaredVariables.fromMap(
+ {variableName: 'four score and seven years'});
_assertNullDartObject(
typeProvider, variables.getInt(typeProvider, variableName));
}
@@ -78,8 +76,8 @@
void test_getInt_valid() {
TestTypeProvider typeProvider = new TestTypeProvider();
String variableName = "var";
- DeclaredVariables variables = new DeclaredVariables();
- variables.define(variableName, "23");
+ DeclaredVariables variables =
+ new DeclaredVariables.fromMap({variableName: '23'});
DartObject object = variables.getInt(typeProvider, variableName);
expect(object, isNotNull);
expect(object.toIntValue(), 23);
@@ -89,8 +87,8 @@
TestTypeProvider typeProvider = new TestTypeProvider();
String variableName = "var";
String value = "value";
- DeclaredVariables variables = new DeclaredVariables();
- variables.define(variableName, value);
+ DeclaredVariables variables =
+ new DeclaredVariables.fromMap({variableName: value});
DartObject object = variables.getString(typeProvider, variableName);
expect(object, isNotNull);
expect(object.toStringValue(), value);
diff --git a/pkg/analyzer/test/context/test_all.dart b/pkg/analyzer/test/dart/analysis/test_all.dart
similarity index 79%
rename from pkg/analyzer/test/context/test_all.dart
rename to pkg/analyzer/test/dart/analysis/test_all.dart
index af0e8b8..b17fcd8 100644
--- a/pkg/analyzer/test/context/test_all.dart
+++ b/pkg/analyzer/test/dart/analysis/test_all.dart
@@ -2,15 +2,12 @@
// 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 analyzer.test.context.test_all;
-
import 'package:test_reflective_loader/test_reflective_loader.dart';
import 'declared_variables_test.dart' as declared_variables;
-/// Utility for manually running all tests.
main() {
defineReflectiveSuite(() {
declared_variables.main();
- }, name: 'context');
+ }, name: 'analysis');
}
diff --git a/pkg/analyzer/test/dart/test_all.dart b/pkg/analyzer/test/dart/test_all.dart
index b1276fe..3575edb 100644
--- a/pkg/analyzer/test/dart/test_all.dart
+++ b/pkg/analyzer/test/dart/test_all.dart
@@ -2,16 +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.
-library analyzer.test.dart.test_all;
-
import 'package:test_reflective_loader/test_reflective_loader.dart';
+import 'analysis/test_all.dart' as analysis;
import 'ast/test_all.dart' as ast;
import 'element/test_all.dart' as element;
-/// Utility for manually running all tests.
main() {
defineReflectiveSuite(() {
+ analysis.main();
ast.main();
element.main();
}, name: 'dart');
diff --git a/pkg/analyzer/test/generated/compile_time_error_code_test.dart b/pkg/analyzer/test/generated/compile_time_error_code_test.dart
index 95eb753..1a09f69 100644
--- a/pkg/analyzer/test/generated/compile_time_error_code_test.dart
+++ b/pkg/analyzer/test/generated/compile_time_error_code_test.dart
@@ -6,7 +6,9 @@
import 'dart:async';
+import 'package:analyzer/dart/analysis/declared_variables.dart';
import 'package:analyzer/error/error.dart';
+import 'package:analyzer/src/context/context.dart';
import 'package:analyzer/src/error/codes.dart';
import 'package:analyzer/src/generated/engine.dart';
import 'package:analyzer/src/generated/parser.dart' show ParserErrorCode;
@@ -2597,9 +2599,10 @@
// The type of the defaultValue needs to be correct even when the default
// value isn't used (because the variable is defined in the environment).
if (enableNewAnalysisDriver) {
- driver.declaredVariables.define("x", "true");
+ driver.declaredVariables = new DeclaredVariables.fromMap({'x': 'true'});
} else {
- analysisContext2.declaredVariables.define("x", "true");
+ (analysisContext2 as AnalysisContextImpl).declaredVariables =
+ new DeclaredVariables.fromMap({'x': 'true'});
}
Source source =
addSource("var b = const bool.fromEnvironment('x', defaultValue: 1);");
diff --git a/pkg/analyzer/test/generated/parser_fasta_test.dart b/pkg/analyzer/test/generated/parser_fasta_test.dart
index 1ab766a..8190532 100644
--- a/pkg/analyzer/test/generated/parser_fasta_test.dart
+++ b/pkg/analyzer/test/generated/parser_fasta_test.dart
@@ -11,10 +11,7 @@
import 'package:analyzer/src/generated/parser.dart' as analyzer;
import 'package:analyzer/src/generated/utilities_dart.dart';
import 'package:analyzer/src/string_source.dart';
-import 'package:front_end/src/fasta/fasta_codes.dart'
- show LocatedMessage, Message;
import 'package:front_end/src/fasta/kernel/kernel_builder.dart';
-import 'package:front_end/src/fasta/kernel/kernel_library_builder.dart';
import 'package:front_end/src/fasta/scanner/error_token.dart' show ErrorToken;
import 'package:front_end/src/fasta/scanner/string_scanner.dart';
import 'package:test/test.dart';
@@ -1178,28 +1175,6 @@
}
/**
- * Proxy implementation of [KernelLibraryBuilderProxy] used by Fasta parser
- * tests.
- */
-class KernelLibraryBuilderProxy implements KernelLibraryBuilder {
- @override
- final uri = Uri.parse('file:///test.dart');
-
- @override
- Uri get fileUri => uri;
-
- @override
- void addCompileTimeError(Message message, int charOffset, int length, Uri uri,
- {bool silent: false,
- bool wasHandled: false,
- List<LocatedMessage> context}) {
- fail('${message.message}');
- }
-
- noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation);
-}
-
-/**
* Proxy implementation of the analyzer parser, implemented in terms of the
* Fasta parser.
*
@@ -1224,30 +1199,24 @@
{bool allowNativeClause: false,
bool enableGenericMethodComments: false,
int expectedEndOffset}) {
- var library = new KernelLibraryBuilderProxy();
var member = new BuilderProxy();
var scope = new ScopeProxy();
TestSource source = new TestSource();
var errorListener = new GatheringErrorListener(checkRanges: true);
var errorReporter = new ErrorReporter(errorListener, source);
return new ParserProxy._(
- firstToken, errorReporter, library, member, scope, errorListener,
+ firstToken, errorReporter, null, member, scope, errorListener,
allowNativeClause: allowNativeClause,
enableGenericMethodComments: enableGenericMethodComments,
expectedEndOffset: expectedEndOffset);
}
- ParserProxy._(
- analyzer.Token firstToken,
- ErrorReporter errorReporter,
- KernelLibraryBuilder library,
- Builder member,
- Scope scope,
- this._errorListener,
+ ParserProxy._(analyzer.Token firstToken, ErrorReporter errorReporter,
+ Uri fileUri, Builder member, Scope scope, this._errorListener,
{bool allowNativeClause: false,
bool enableGenericMethodComments: false,
this.expectedEndOffset})
- : super(firstToken, errorReporter, library, member, scope,
+ : super(firstToken, errorReporter, fileUri, member, scope,
allowNativeClause: allowNativeClause,
enableGenericMethodComments: enableGenericMethodComments) {
_eventListener = new ForwardingTestListener(astBuilder);
@@ -1400,10 +1369,8 @@
with RecoveryParserTestMixin {
@override
void test_equalityExpression_precedence_relational_right() {
- // Fasta recovers differently. It takes the `is` to be an identifier and
- // assumes that it is the right operand of the `==`.
parseExpression("== is", codes: [
-// ParserErrorCode.EXPECTED_TYPE_NAME,
+ ParserErrorCode.EXPECTED_TYPE_NAME,
ParserErrorCode.MISSING_IDENTIFIER,
ParserErrorCode.MISSING_IDENTIFIER
]);
@@ -1455,19 +1422,16 @@
@override
void test_relationalExpression_missing_LHS_RHS() {
- // Fasta recovers differently. It takes the `is` to be an identifier.
parseExpression("is", codes: [
-// ParserErrorCode.EXPECTED_TYPE_NAME,
+ ParserErrorCode.EXPECTED_TYPE_NAME,
ParserErrorCode.MISSING_IDENTIFIER
]);
}
@override
void test_relationalExpression_precedence_shift_right() {
- // Fasta recovers differently. It takes the `is` to be an identifier and
- // assumes that it is the right operand of the `<<`.
parseExpression("<< is", codes: [
-// ParserErrorCode.EXPECTED_TYPE_NAME,
+ ParserErrorCode.EXPECTED_TYPE_NAME,
ParserErrorCode.MISSING_IDENTIFIER,
ParserErrorCode.MISSING_IDENTIFIER
]);
diff --git a/pkg/analyzer/test/generated/parser_test.dart b/pkg/analyzer/test/generated/parser_test.dart
index 9a06e00..c979ff2 100644
--- a/pkg/analyzer/test/generated/parser_test.dart
+++ b/pkg/analyzer/test/generated/parser_test.dart
@@ -4699,7 +4699,7 @@
listener.assertErrors(usingFastaParser
? [
expectedError(ParserErrorCode.MISSING_IDENTIFIER, 0, 2),
- expectedError(ParserErrorCode.MISSING_STATEMENT, 0, 2),
+ expectedError(ParserErrorCode.EXPECTED_TYPE_NAME, 2, 0),
expectedError(ParserErrorCode.EXPECTED_TOKEN, 2, 0)
]
: [expectedError(ParserErrorCode.MISSING_STATEMENT, 2, 0)]);
@@ -9147,7 +9147,12 @@
void test_parseFormalParameterList_prefixedType_partial() {
FormalParameterList list = parseFormalParameterList('(io.)', errors: [
- expectedError(ParserErrorCode.MISSING_IDENTIFIER, 4, 1),
+ expectedError(
+ usingFastaParser
+ ? ParserErrorCode.EXPECTED_TYPE_NAME
+ : ParserErrorCode.MISSING_IDENTIFIER,
+ 4,
+ 1),
expectedError(ParserErrorCode.MISSING_IDENTIFIER, 4, 1)
]);
expect(list, isNotNull);
@@ -9169,7 +9174,12 @@
void test_parseFormalParameterList_prefixedType_partial2() {
int errorOffset = usingFastaParser ? 4 : 3;
FormalParameterList list = parseFormalParameterList('(io.,a)', errors: [
- expectedError(ParserErrorCode.MISSING_IDENTIFIER, errorOffset, 1),
+ expectedError(
+ usingFastaParser
+ ? ParserErrorCode.EXPECTED_TYPE_NAME
+ : ParserErrorCode.MISSING_IDENTIFIER,
+ errorOffset,
+ 1),
expectedError(ParserErrorCode.MISSING_IDENTIFIER, errorOffset, 1)
]);
expect(list, isNotNull);
@@ -10675,20 +10685,11 @@
}
void test_equalityExpression_precedence_relational_left() {
- // Fasta recovers differently. It takes the `is` to be an identifier and
- // assumes that the right operand of `==` is the only missing identifier.
- BinaryExpression expression = parseExpression("is ==",
- codes: usingFastaParser
- ? [
- //ParserErrorCode.EXPECTED_TYPE_NAME,
- ParserErrorCode.MISSING_IDENTIFIER,
- ParserErrorCode.MISSING_IDENTIFIER
- ]
- : [
- ParserErrorCode.EXPECTED_TYPE_NAME,
- ParserErrorCode.MISSING_IDENTIFIER,
- ParserErrorCode.MISSING_IDENTIFIER
- ]);
+ BinaryExpression expression = parseExpression("is ==", codes: [
+ ParserErrorCode.EXPECTED_TYPE_NAME,
+ ParserErrorCode.MISSING_IDENTIFIER,
+ ParserErrorCode.MISSING_IDENTIFIER
+ ]);
if (!usingFastaParser) {
EngineTestCase.assertInstanceOf(
(obj) => obj is IsExpression, IsExpression, expression.leftOperand);
diff --git a/pkg/analyzer/test/src/dart/analysis/context_builder_test.dart b/pkg/analyzer/test/src/dart/analysis/context_builder_test.dart
new file mode 100644
index 0000000..86c3094
--- /dev/null
+++ b/pkg/analyzer/test/src/dart/analysis/context_builder_test.dart
@@ -0,0 +1,91 @@
+// Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'dart:io' as io;
+
+import 'package:analyzer/dart/analysis/analysis_context.dart';
+import 'package:analyzer/dart/analysis/context_root.dart';
+import 'package:analyzer/dart/analysis/declared_variables.dart';
+import 'package:analyzer/file_system/file_system.dart';
+import 'package:analyzer/src/dart/analysis/context_builder.dart';
+import 'package:analyzer/src/dart/analysis/context_root.dart';
+import 'package:analyzer/src/dart/analysis/driver_based_analysis_context.dart';
+import 'package:analyzer/src/test_utilities/resource_provider_mixin.dart';
+import 'package:test/test.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
+
+import '../../context/mock_sdk.dart';
+
+main() {
+ defineReflectiveSuite(() {
+ defineReflectiveTests(ContextBuilderImplTest);
+ });
+}
+
+@reflectiveTest
+class ContextBuilderImplTest extends Object with ResourceProviderMixin {
+ ContextBuilderImpl contextBuilder;
+ ContextRoot contextRoot;
+
+ void assertEquals(DeclaredVariables actual, DeclaredVariables expected) {
+ Iterable<String> actualNames = actual.variableNames;
+ Iterable<String> expectedNames = expected.variableNames;
+ expect(actualNames, expectedNames);
+ for (String name in expectedNames) {
+ expect(actual.get(name), expected.get(name));
+ }
+ }
+
+ void setUp() {
+ resourceProvider.newFolder(resourceProvider.pathContext.dirname(
+ resourceProvider.pathContext.dirname(io.Platform.resolvedExecutable)));
+ contextBuilder = new ContextBuilderImpl(resourceProvider: resourceProvider);
+ String path = resourceProvider.convertPath('/temp/root');
+ Folder folder = resourceProvider.newFolder(path);
+ contextRoot = new ContextRootImpl(resourceProvider, folder);
+ }
+
+ test_createContext_declaredVariables() {
+ DeclaredVariables declaredVariables =
+ new DeclaredVariables.fromMap({'foo': 'true'});
+ DriverBasedAnalysisContext context = contextBuilder.createContext(
+ contextRoot: contextRoot, declaredVariables: declaredVariables);
+ expect(context.analysisOptions, isNotNull);
+ expect(context.contextRoot, contextRoot);
+ assertEquals(context.driver.declaredVariables, declaredVariables);
+ }
+
+ test_createContext_declaredVariables_sdkPath() {
+ DeclaredVariables declaredVariables =
+ new DeclaredVariables.fromMap({'bar': 'true'});
+ MockSdk sdk = new MockSdk(resourceProvider: resourceProvider);
+ DriverBasedAnalysisContext context = contextBuilder.createContext(
+ contextRoot: contextRoot,
+ declaredVariables: declaredVariables,
+ sdkPath: resourceProvider.convertPath(sdkRoot));
+ expect(context.analysisOptions, isNotNull);
+ expect(context.contextRoot, contextRoot);
+ assertEquals(context.driver.declaredVariables, declaredVariables);
+ expect(context.driver.sourceFactory.dartSdk.mapDartUri('dart:core'),
+ sdk.mapDartUri('dart:core'));
+ }
+
+ test_createContext_defaults() {
+ AnalysisContext context =
+ contextBuilder.createContext(contextRoot: contextRoot);
+ expect(context.analysisOptions, isNotNull);
+ expect(context.contextRoot, contextRoot);
+ }
+
+ test_createContext_sdkPath() {
+ MockSdk sdk = new MockSdk(resourceProvider: resourceProvider);
+ DriverBasedAnalysisContext context = contextBuilder.createContext(
+ contextRoot: contextRoot,
+ sdkPath: resourceProvider.convertPath(sdkRoot));
+ expect(context.analysisOptions, isNotNull);
+ expect(context.contextRoot, contextRoot);
+ expect(context.driver.sourceFactory.dartSdk.mapDartUri('dart:core'),
+ sdk.mapDartUri('dart:core'));
+ }
+}
diff --git a/pkg/analyzer/test/src/dart/analysis/test_all.dart b/pkg/analyzer/test/src/dart/analysis/test_all.dart
index 527afbf..f452ede 100644
--- a/pkg/analyzer/test/src/dart/analysis/test_all.dart
+++ b/pkg/analyzer/test/src/dart/analysis/test_all.dart
@@ -4,6 +4,7 @@
import 'package:test_reflective_loader/test_reflective_loader.dart';
+import 'context_builder_test.dart' as context_builder_test;
import 'context_locator_test.dart' as context_locator_test;
import 'context_root_test.dart' as context_root_test;
import 'defined_names_test.dart' as defined_names_test;
@@ -21,6 +22,7 @@
main() {
defineReflectiveSuite(() {
+ context_builder_test.main();
context_locator_test.main();
context_root_test.main();
defined_names_test.main();
diff --git a/pkg/analyzer/test/src/dart/constant/evaluation_test.dart b/pkg/analyzer/test/src/dart/constant/evaluation_test.dart
index ba4fa96..ab82e9a 100644
--- a/pkg/analyzer/test/src/dart/constant/evaluation_test.dart
+++ b/pkg/analyzer/test/src/dart/constant/evaluation_test.dart
@@ -6,13 +6,14 @@
import 'dart:async';
-import 'package:analyzer/context/declared_variables.dart';
+import 'package:analyzer/dart/analysis/declared_variables.dart';
import 'package:analyzer/dart/ast/ast.dart';
import 'package:analyzer/dart/ast/standard_resolution_map.dart';
import 'package:analyzer/dart/ast/token.dart';
import 'package:analyzer/dart/element/element.dart';
import 'package:analyzer/error/error.dart';
import 'package:analyzer/error/listener.dart';
+import 'package:analyzer/src/context/context.dart';
import 'package:analyzer/src/dart/element/element.dart';
import 'package:analyzer/src/error/codes.dart';
import 'package:analyzer/src/generated/constant.dart';
@@ -1330,10 +1331,11 @@
String varName = "foo";
if (valueInEnvironment != null) {
if (enableNewAnalysisDriver) {
- driver.declaredVariables.define(envVarName, valueInEnvironment);
+ driver.declaredVariables =
+ new DeclaredVariables.fromMap({envVarName: valueInEnvironment});
} else {
- analysisContext2.declaredVariables
- .define(envVarName, valueInEnvironment);
+ (analysisContext2 as AnalysisContextImpl).declaredVariables =
+ new DeclaredVariables.fromMap({envVarName: valueInEnvironment});
}
}
String defaultArg =
@@ -1349,10 +1351,11 @@
String varName = "foo";
if (valueInEnvironment != null) {
if (enableNewAnalysisDriver) {
- driver.declaredVariables.define(envVarName, valueInEnvironment);
+ driver.declaredVariables =
+ new DeclaredVariables.fromMap({envVarName: valueInEnvironment});
} else {
- analysisContext2.declaredVariables
- .define(envVarName, valueInEnvironment);
+ (analysisContext2 as AnalysisContextImpl).declaredVariables =
+ new DeclaredVariables.fromMap({envVarName: valueInEnvironment});
}
}
String defaultArg =
@@ -1368,10 +1371,11 @@
String varName = "foo";
if (valueInEnvironment != null) {
if (enableNewAnalysisDriver) {
- driver.declaredVariables.define(envVarName, valueInEnvironment);
+ driver.declaredVariables =
+ new DeclaredVariables.fromMap({envVarName: valueInEnvironment});
} else {
- analysisContext2.declaredVariables
- .define(envVarName, valueInEnvironment);
+ (analysisContext2 as AnalysisContextImpl).declaredVariables =
+ new DeclaredVariables.fromMap({envVarName: valueInEnvironment});
}
}
String defaultArg =
diff --git a/pkg/analyzer/test/src/summary/resynthesize_common.dart b/pkg/analyzer/test/src/summary/resynthesize_common.dart
index f707999..5961afb 100644
--- a/pkg/analyzer/test/src/summary/resynthesize_common.dart
+++ b/pkg/analyzer/test/src/summary/resynthesize_common.dart
@@ -6,6 +6,7 @@
import 'dart:async';
+import 'package:analyzer/dart/analysis/declared_variables.dart';
import 'package:analyzer/dart/ast/ast.dart';
import 'package:analyzer/dart/ast/standard_resolution_map.dart';
import 'package:analyzer/dart/ast/token.dart';
@@ -5514,7 +5515,8 @@
}
test_export_configurations_useDefault() async {
- context.declaredVariables.define('dart.library.io', 'false');
+ context.declaredVariables =
+ new DeclaredVariables.fromMap({'dart.library.io': 'false'});
addLibrarySource('/foo.dart', 'class A {}');
addLibrarySource('/foo_io.dart', 'class A {}');
addLibrarySource('/foo_html.dart', 'class A {}');
@@ -5530,8 +5532,8 @@
}
test_export_configurations_useFirst() async {
- context.declaredVariables.define('dart.library.io', 'true');
- context.declaredVariables.define('dart.library.html', 'true');
+ context.declaredVariables = new DeclaredVariables.fromMap(
+ {'dart.library.io': 'true', 'dart.library.html': 'true'});
addLibrarySource('/foo.dart', 'class A {}');
addLibrarySource('/foo_io.dart', 'class A {}');
addLibrarySource('/foo_html.dart', 'class A {}');
@@ -5547,8 +5549,8 @@
}
test_export_configurations_useSecond() async {
- context.declaredVariables.define('dart.library.io', 'false');
- context.declaredVariables.define('dart.library.html', 'true');
+ context.declaredVariables = new DeclaredVariables.fromMap(
+ {'dart.library.io': 'false', 'dart.library.html': 'true'});
addLibrarySource('/foo.dart', 'class A {}');
addLibrarySource('/foo_io.dart', 'class A {}');
addLibrarySource('/foo_html.dart', 'class A {}');
@@ -5648,7 +5650,8 @@
}
test_exportImport_configurations_useDefault() async {
- context.declaredVariables.define('dart.library.io', 'false');
+ context.declaredVariables =
+ new DeclaredVariables.fromMap({'dart.library.io': 'false'});
addLibrarySource('/foo.dart', 'class A {}');
addLibrarySource('/foo_io.dart', 'class A {}');
addLibrarySource('/foo_html.dart', 'class A {}');
@@ -5671,8 +5674,8 @@
}
test_exportImport_configurations_useFirst() async {
- context.declaredVariables.define('dart.library.io', 'true');
- context.declaredVariables.define('dart.library.html', 'true');
+ context.declaredVariables = new DeclaredVariables.fromMap(
+ {'dart.library.io': 'true', 'dart.library.html': 'true'});
addLibrarySource('/foo.dart', 'class A {}');
addLibrarySource('/foo_io.dart', 'class A {}');
addLibrarySource('/foo_html.dart', 'class A {}');
@@ -6440,7 +6443,8 @@
}
test_import_configurations_useDefault() async {
- context.declaredVariables.define('dart.library.io', 'false');
+ context.declaredVariables =
+ new DeclaredVariables.fromMap({'dart.library.io': 'false'});
addLibrarySource('/foo.dart', 'class A {}');
addLibrarySource('/foo_io.dart', 'class A {}');
addLibrarySource('/foo_html.dart', 'class A {}');
@@ -6461,8 +6465,8 @@
}
test_import_configurations_useFirst() async {
- context.declaredVariables.define('dart.library.io', 'true');
- context.declaredVariables.define('dart.library.html', 'true');
+ context.declaredVariables = new DeclaredVariables.fromMap(
+ {'dart.library.io': 'true', 'dart.library.html': 'true'});
addLibrarySource('/foo.dart', 'class A {}');
addLibrarySource('/foo_io.dart', 'class A {}');
addLibrarySource('/foo_html.dart', 'class A {}');
diff --git a/pkg/analyzer/test/src/task/dart_test.dart b/pkg/analyzer/test/src/task/dart_test.dart
index b4454ab..7e36ed3 100644
--- a/pkg/analyzer/test/src/task/dart_test.dart
+++ b/pkg/analyzer/test/src/task/dart_test.dart
@@ -351,8 +351,8 @@
}
test_perform_configurations_export() {
- context.declaredVariables.define('dart.library.io', 'true');
- context.declaredVariables.define('dart.library.html', 'true');
+ context.declaredVariables = new DeclaredVariables.fromMap(
+ {'dart.library.io': 'true', 'dart.library.html': 'true'});
newSource('/foo.dart', '');
var foo_io = newSource('/foo_io.dart', '');
newSource('/foo_html.dart', '');
@@ -371,8 +371,8 @@
}
test_perform_configurations_import() {
- context.declaredVariables.define('dart.library.io', 'true');
- context.declaredVariables.define('dart.library.html', 'true');
+ context.declaredVariables = new DeclaredVariables.fromMap(
+ {'dart.library.io': 'true', 'dart.library.html': 'true'});
newSource('/foo.dart', '');
var foo_io = newSource('/foo_io.dart', '');
newSource('/foo_html.dart', '');
@@ -3041,7 +3041,8 @@
}
test_perform_library_configurations_bool1() {
- context.declaredVariables.define('dart.library.io', 'true');
+ context.declaredVariables =
+ new DeclaredVariables.fromMap({'dart.library.io': 'true'});
newSource('/foo.dart', '');
newSource('/foo_io.dart', '');
newSource('/foo_html.dart', '');
@@ -3088,7 +3089,8 @@
}
test_perform_library_configurations_bool2() {
- context.declaredVariables.define('dart.library.html', 'true');
+ context.declaredVariables =
+ new DeclaredVariables.fromMap({'dart.library.html': 'true'});
newSource('/foo.dart', '');
newSource('/foo_io.dart', '');
newSource('/foo_html.dart', '');
@@ -3102,7 +3104,8 @@
}
test_perform_library_configurations_default() {
- context.declaredVariables.define('dart.library.io', 'false');
+ context.declaredVariables =
+ new DeclaredVariables.fromMap({'dart.library.io': 'false'});
newSource('/foo.dart', '');
newSource('/foo_io.dart', '');
newSource('/foo_html.dart', '');
@@ -3116,8 +3119,8 @@
}
test_perform_library_configurations_preferFirst() {
- context.declaredVariables.define('dart.library.io', 'true');
- context.declaredVariables.define('dart.library.html', 'true');
+ context.declaredVariables = new DeclaredVariables.fromMap(
+ {'dart.library.io': 'true', 'dart.library.html': 'true'});
newSource('/foo.dart', '');
newSource('/foo_io.dart', '');
newSource('/foo_html.dart', '');
@@ -3139,7 +3142,8 @@
}
test_perform_library_configurations_value() {
- context.declaredVariables.define('dart.platform', 'Windows');
+ context.declaredVariables =
+ new DeclaredVariables.fromMap({'dart.platform': 'Windows'});
newSource('/foo.dart', '');
newSource('/foo_posix.dart', '');
newSource('/foo_windows.dart', '');
diff --git a/pkg/analyzer/test/src/task/strong/inferred_type_test.dart b/pkg/analyzer/test/src/task/strong/inferred_type_test.dart
index b30d121..cb9db3a 100644
--- a/pkg/analyzer/test/src/task/strong/inferred_type_test.dart
+++ b/pkg/analyzer/test/src/task/strong/inferred_type_test.dart
@@ -1097,6 +1097,9 @@
class F4<T> {
F4({Iterable<Iterable<T>> a}) {}
}
+class F5<T> {
+ F5(Iterable<Iterable<Iterable<T>>> a) {}
+}
void main() {
new F0<int>(/*info:INFERRED_TYPE_LITERAL*/[]);
new F0<int>(/*info:INFERRED_TYPE_LITERAL*/[3]);
@@ -1137,6 +1140,9 @@
/*info:INFERRED_TYPE_ALLOCATION*/new F4(a: /*info:INFERRED_TYPE_LITERAL*/[/*info:INFERRED_TYPE_LITERAL*/["hello"]]);
/*info:INFERRED_TYPE_ALLOCATION*/new F4(a: /*info:INFERRED_TYPE_LITERAL*/[/*info:INFERRED_TYPE_LITERAL*/["hello"],
/*info:INFERRED_TYPE_LITERAL*/[3]]);
+
+ /*info:INFERRED_TYPE_ALLOCATION*/new F5(/*info:INFERRED_TYPE_LITERAL*/[/*info:INFERRED_TYPE_LITERAL*/[
+ /*info:INFERRED_TYPE_LITERAL*/[3]]]);
}
''');
}
diff --git a/pkg/analyzer/test/test_all.dart b/pkg/analyzer/test/test_all.dart
index c2573fb..d0c8dfd 100644
--- a/pkg/analyzer/test/test_all.dart
+++ b/pkg/analyzer/test/test_all.dart
@@ -5,7 +5,6 @@
import 'package:test_reflective_loader/test_reflective_loader.dart';
import 'cancelable_future_test.dart' as cancelable_future_test;
-import 'context/test_all.dart' as context;
import 'dart/test_all.dart' as dart;
import 'error/test_all.dart' as error;
import 'file_system/test_all.dart' as file_system;
@@ -19,7 +18,6 @@
main() {
defineReflectiveSuite(() {
cancelable_future_test.main();
- context.main();
dart.main();
error.main();
file_system.main();
diff --git a/pkg/analyzer_cli/lib/src/build_mode.dart b/pkg/analyzer_cli/lib/src/build_mode.dart
index fc289ee..41ecfab8 100644
--- a/pkg/analyzer_cli/lib/src/build_mode.dart
+++ b/pkg/analyzer_cli/lib/src/build_mode.dart
@@ -7,6 +7,7 @@
import 'dart:async';
import 'dart:io' as io;
+import 'package:analyzer/dart/analysis/declared_variables.dart';
import 'package:analyzer/error/error.dart';
import 'package:analyzer/file_system/file_system.dart';
import 'package:analyzer/src/dart/analysis/driver.dart';
@@ -414,7 +415,8 @@
sourceFactory,
analysisOptions,
externalSummaries: summaryDataStore);
- Driver.declareVariables(analysisDriver.declaredVariables, options);
+ analysisDriver.declaredVariables =
+ new DeclaredVariables.fromMap(options.definedVariables);
scheduler.start();
}
diff --git a/pkg/analyzer_cli/lib/src/driver.dart b/pkg/analyzer_cli/lib/src/driver.dart
index c306703..9dcf36b 100644
--- a/pkg/analyzer_cli/lib/src/driver.dart
+++ b/pkg/analyzer_cli/lib/src/driver.dart
@@ -16,6 +16,7 @@
import 'package:analyzer/source/pub_package_map_provider.dart';
import 'package:analyzer/source/sdk_ext.dart';
import 'package:analyzer/src/context/builder.dart';
+import 'package:analyzer/src/context/context.dart';
import 'package:analyzer/src/dart/analysis/driver.dart';
import 'package:analyzer/src/dart/analysis/file_state.dart';
import 'package:analyzer/src/dart/sdk/sdk.dart';
@@ -701,7 +702,8 @@
_context = AnalysisEngine.instance.createAnalysisContext();
_context.analysisOptions = analysisOptions;
_context.sourceFactory = sourceFactory;
- declareVariables(context.declaredVariables, options);
+ (context as AnalysisContextImpl).declaredVariables =
+ new DeclaredVariables.fromMap(options.definedVariables);
if (options.enableNewAnalysisDriver) {
PerformanceLog log = new PerformanceLog(null);
@@ -886,17 +888,6 @@
}
}
- /// Copy variables defined in the [options] into [declaredVariables].
- static void declareVariables(
- DeclaredVariables declaredVariables, CommandLineOptions options) {
- Map<String, String> definedVariables = options.definedVariables;
- if (definedVariables.isNotEmpty) {
- definedVariables.forEach((String variableName, String value) {
- declaredVariables.define(variableName, value);
- });
- }
- }
-
static void verbosePrint(String text) {
outSink.writeln(text);
}
diff --git a/pkg/compiler/lib/src/common_elements.dart b/pkg/compiler/lib/src/common_elements.dart
index 7efe777..140d9e8 100644
--- a/pkg/compiler/lib/src/common_elements.dart
+++ b/pkg/compiler/lib/src/common_elements.dart
@@ -1010,6 +1010,9 @@
FunctionEntity get getRuntimeTypeArgument =>
_findHelperFunction('getRuntimeTypeArgument');
+ FunctionEntity get getRuntimeTypeArgumentIntercepted =>
+ _findHelperFunction('getRuntimeTypeArgumentIntercepted');
+
FunctionEntity get runtimeTypeToString =>
_findHelperFunction('runtimeTypeToString');
diff --git a/pkg/compiler/lib/src/js_backend/backend_impact.dart b/pkg/compiler/lib/src/js_backend/backend_impact.dart
index 90bc364..8424c42 100644
--- a/pkg/compiler/lib/src/js_backend/backend_impact.dart
+++ b/pkg/compiler/lib/src/js_backend/backend_impact.dart
@@ -98,6 +98,7 @@
BackendImpact get getRuntimeTypeArgument {
return _getRuntimeTypeArgument ??= new BackendImpact(globalUses: [
+ _commonElements.getRuntimeTypeArgumentIntercepted,
_commonElements.getRuntimeTypeArgument,
_commonElements.getTypeArgumentByIndex,
]);
diff --git a/pkg/compiler/lib/src/js_emitter/class_stub_generator.dart b/pkg/compiler/lib/src/js_emitter/class_stub_generator.dart
index 7f65831..3240b46 100644
--- a/pkg/compiler/lib/src/js_emitter/class_stub_generator.dart
+++ b/pkg/compiler/lib/src/js_emitter/class_stub_generator.dart
@@ -183,7 +183,8 @@
// Values match JSInvocationMirror in js-helper library.
int type = selector.invocationMirrorKind;
List<String> parameterNames =
- new List.generate(selector.argumentCount, (i) => '\$$i');
+ new List.generate(selector.argumentCount, (i) => '\$$i') +
+ new List.generate(selector.typeArgumentCount, (i) => '\$T${i + 1}');
List<jsAst.Expression> argNames = selector.callStructure
.getOrderedNamedArguments()
@@ -200,7 +201,8 @@
#internalName,
#type,
#arguments,
- #namedArguments))''', {
+ #namedArguments,
+ #typeArgumentCount))''', {
'receiver': isIntercepted ? r'$receiver' : 'this',
'noSuchMethodName': _namer.noSuchMethodName,
'createInvocationMirror':
@@ -210,7 +212,8 @@
'internalName': js.quoteName(internalName),
'type': js.number(type),
'arguments': new jsAst.ArrayInitializer(parameterNames.map(js).toList()),
- 'namedArguments': new jsAst.ArrayInitializer(argNames)
+ 'namedArguments': new jsAst.ArrayInitializer(argNames),
+ 'typeArgumentCount': js.number(selector.typeArgumentCount)
});
jsAst.Expression function;
diff --git a/pkg/compiler/lib/src/js_emitter/full_emitter/nsm_emitter.dart b/pkg/compiler/lib/src/js_emitter/full_emitter/nsm_emitter.dart
index ec21bb7..9e194b88 100644
--- a/pkg/compiler/lib/src/js_emitter/full_emitter/nsm_emitter.dart
+++ b/pkg/compiler/lib/src/js_emitter/full_emitter/nsm_emitter.dart
@@ -89,6 +89,7 @@
if (!generateTrivialNsmHandlers) return false;
// Check for named arguments.
if (argNames.length != 0) return false;
+ if (selector.typeArgumentCount > 0) return false;
// Check for unexpected name (this doesn't really happen).
if (internalName is GetterName) return type == 1;
if (internalName is SetterName) return type == 2;
@@ -261,7 +262,7 @@
// Generate call to:
//
// createInvocationMirror(String name, internalName, type,
- // arguments, argumentNames)
+ // arguments, argumentNames, typeArgumentCount)
//
// This 'if' is either a static choice or dynamic choice depending on
@@ -276,7 +277,8 @@
// Create proper Array with all arguments except first
// (receiver).
Array.prototype.slice.call(arguments, 1),
- []));
+ [],
+ 0));
}
})(#names[j], shortName, type);
} else {
@@ -290,7 +292,8 @@
#createInvocationMirror(name, shortName, type,
// Create proper Array with all arguments.
Array.prototype.slice.call(arguments, 0),
- []));
+ [],
+ 0));
}
})(#names[j], shortName, type);
}
diff --git a/pkg/compiler/lib/src/ssa/builder.dart b/pkg/compiler/lib/src/ssa/builder.dart
index 757b81d..f16c027 100644
--- a/pkg/compiler/lib/src/ssa/builder.dart
+++ b/pkg/compiler/lib/src/ssa/builder.dart
@@ -3198,7 +3198,8 @@
graph.addConstantStringFromName(internalName, closedWorld),
graph.addConstant(kindConstant, closedWorld),
argumentsInstruction,
- argumentNamesInstruction
+ argumentNamesInstruction,
+ graph.addConstantInt(0, closedWorld), // type argument count.
],
typeMask: commonMasks.dynamicType);
diff --git a/pkg/compiler/lib/src/ssa/builder_kernel.dart b/pkg/compiler/lib/src/ssa/builder_kernel.dart
index 1d1b98d..ff53f88 100644
--- a/pkg/compiler/lib/src/ssa/builder_kernel.dart
+++ b/pkg/compiler/lib/src/ssa/builder_kernel.dart
@@ -36,6 +36,7 @@
import '../resolution/tree_elements.dart';
import '../types/masks.dart';
import '../types/types.dart';
+import '../universe/call_structure.dart';
import '../universe/selector.dart';
import '../universe/side_effects.dart' show SideEffects;
import '../universe/use.dart'
@@ -4114,7 +4115,8 @@
graph.addConstantStringFromName(internalName, closedWorld),
graph.addConstant(kindConstant, closedWorld),
argumentsInstruction,
- argumentNamesInstruction
+ argumentNamesInstruction,
+ graph.addConstantInt(typeArguments.length, closedWorld),
],
commonMasks.dynamicType,
typeArguments);
@@ -4830,6 +4832,7 @@
List<HInstruction> _completeDynamicCallArgumentsList(Selector selector,
FunctionEntity function, List<HInstruction> providedArguments) {
assert(selector.applies(function));
+ CallStructure callStructure = selector.callStructure;
ParameterStructure parameterStructure = function.parameterStructure;
List<String> selectorArgumentNames =
selector.callStructure.getOrderedNamedArguments();
@@ -4838,19 +4841,30 @@
parameterStructure.typeParameters +
1); // Plus one for receiver.
- compiledArguments[0] = providedArguments[0]; // Receiver.
- int index = 1;
+ int compiledArgumentIndex = 0;
+
+ // Copy receiver.
+ compiledArguments[compiledArgumentIndex++] = providedArguments[0];
+
+ /// Offset of positional arguments in [providedArguments].
+ int positionalArgumentOffset = 1;
+
+ /// Offset of named arguments in [providedArguments].
+ int namedArgumentOffset = callStructure.positionalArgumentCount + 1;
+
+ int positionalArgumentIndex = 0;
int namedArgumentIndex = 0;
- int firstProvidedNamedArgument;
+
_worldBuilder.forEachParameter(function,
(DartType type, String name, ConstantValue defaultValue) {
- if (index <= parameterStructure.positionalParameters) {
- if (index < providedArguments.length) {
- compiledArguments[index] = providedArguments[index];
+ if (positionalArgumentIndex < parameterStructure.positionalParameters) {
+ if (positionalArgumentIndex < callStructure.positionalArgumentCount) {
+ compiledArguments[compiledArgumentIndex++] = providedArguments[
+ positionalArgumentOffset + positionalArgumentIndex++];
} else {
assert(defaultValue != null,
failedAt(function, 'No constant computed for parameter $name'));
- compiledArguments[index] =
+ compiledArguments[compiledArgumentIndex++] =
graph.addConstant(defaultValue, closedWorld);
}
} else {
@@ -4865,36 +4879,38 @@
// For each parameter name in the signature, if the argument name
// matches we use the next provided argument, otherwise we get the
// default.
- firstProvidedNamedArgument ??= index;
if (namedArgumentIndex < selectorArgumentNames.length &&
name == selectorArgumentNames[namedArgumentIndex]) {
// The named argument was provided in the function invocation.
- compiledArguments[index] = providedArguments[
- firstProvidedNamedArgument + namedArgumentIndex++];
+ compiledArguments[compiledArgumentIndex++] =
+ providedArguments[namedArgumentOffset + namedArgumentIndex++];
} else {
assert(defaultValue != null,
failedAt(function, 'No constant computed for parameter $name'));
- compiledArguments[index] =
+ compiledArguments[compiledArgumentIndex++] =
graph.addConstant(defaultValue, closedWorld);
}
}
- index++;
});
if (rtiNeed.methodNeedsTypeArguments(function)) {
- if (selector.callStructure.typeArgumentCount ==
+ if (callStructure.typeArgumentCount ==
parameterStructure.typeParameters) {
+ /// Offset of type arguments in [providedArguments].
+ int typeArgumentOffset = callStructure.argumentCount + 1;
// Pass explicit type arguments.
- for (int i = 0; i < parameterStructure.typeParameters; i++) {
- compiledArguments[index] = providedArguments[index];
- index++;
+ for (int typeArgumentIndex = 0;
+ typeArgumentIndex < callStructure.typeArgumentCount;
+ typeArgumentIndex++) {
+ compiledArguments[compiledArgumentIndex++] =
+ providedArguments[typeArgumentOffset + typeArgumentIndex];
}
} else {
- assert(selector.callStructure.typeArgumentCount == 0);
+ assert(callStructure.typeArgumentCount == 0);
// Pass type variable bounds as type arguments.
for (int i = 0; i < parameterStructure.typeParameters; i++) {
// TODO(johnniwinther): Pass type variable bounds.
- compiledArguments[index] = graph.addConstantNull(closedWorld);
- index++;
+ compiledArguments[compiledArgumentIndex++] =
+ graph.addConstantNull(closedWorld);
}
}
}
diff --git a/pkg/compiler/lib/src/ssa/codegen.dart b/pkg/compiler/lib/src/ssa/codegen.dart
index fed6eaf..24193c7 100644
--- a/pkg/compiler/lib/src/ssa/codegen.dart
+++ b/pkg/compiler/lib/src/ssa/codegen.dart
@@ -3016,8 +3016,13 @@
void visitTypeInfoReadVariable(HTypeInfoReadVariable node) {
TypeVariableEntity element = node.variable.element;
-
int index = element.index;
+
+ js.Expression interceptor;
+ if (node.isIntercepted) {
+ use(node.interceptor);
+ interceptor = pop();
+ }
HInstruction object = node.object;
use(object);
js.Expression receiver = pop();
@@ -3025,16 +3030,31 @@
if (typeVariableAccessNeedsSubstitution(element, object.instructionType)) {
js.Expression typeName =
js.quoteName(_namer.runtimeTypeName(element.typeDeclaration));
- FunctionEntity helperElement = _commonElements.getRuntimeTypeArgument;
- _registry.registerStaticUse(
- new StaticUse.staticInvoke(helperElement, CallStructure.THREE_ARGS));
- js.Expression helper = _emitter.staticFunctionAccess(helperElement);
- push(js.js(r'#(#, #, #)', [
- helper,
- receiver,
- typeName,
- js.js.number(index)
- ]).withSourceInformation(node.sourceInformation));
+ if (node.isIntercepted) {
+ FunctionEntity helperElement =
+ _commonElements.getRuntimeTypeArgumentIntercepted;
+ _registry.registerStaticUse(
+ new StaticUse.staticInvoke(helperElement, CallStructure.FOUR_ARGS));
+ js.Expression helper = _emitter.staticFunctionAccess(helperElement);
+ push(js.js(r'#(#, #, #, #)', [
+ helper,
+ interceptor,
+ receiver,
+ typeName,
+ js.js.number(index)
+ ]).withSourceInformation(node.sourceInformation));
+ } else {
+ FunctionEntity helperElement = _commonElements.getRuntimeTypeArgument;
+ _registry.registerStaticUse(new StaticUse.staticInvoke(
+ helperElement, CallStructure.THREE_ARGS));
+ js.Expression helper = _emitter.staticFunctionAccess(helperElement);
+ push(js.js(r'#(#, #, #)', [
+ helper,
+ receiver,
+ typeName,
+ js.js.number(index)
+ ]).withSourceInformation(node.sourceInformation));
+ }
} else {
FunctionEntity helperElement = _commonElements.getTypeArgumentByIndex;
_registry.registerStaticUse(
diff --git a/pkg/compiler/lib/src/ssa/nodes.dart b/pkg/compiler/lib/src/ssa/nodes.dart
index 92be4c8..9960352 100644
--- a/pkg/compiler/lib/src/ssa/nodes.dart
+++ b/pkg/compiler/lib/src/ssa/nodes.dart
@@ -3577,18 +3577,33 @@
}
/// Reads a type variable from an object. The read may be a simple indexing of
-/// the type parameters or it may require 'substitution'.
+/// the type parameters or it may require 'substitution'. There may be an
+/// interceptor argument to access the substitution of native classes.
class HTypeInfoReadVariable extends HInstruction {
/// The type variable being read.
final TypeVariableType variable;
+ final bool isIntercepted;
- HTypeInfoReadVariable(
- this.variable, HInstruction receiver, TypeMask instructionType)
- : super(<HInstruction>[receiver], instructionType) {
+ HTypeInfoReadVariable.intercepted(this.variable, HInstruction interceptor,
+ HInstruction receiver, TypeMask instructionType)
+ : isIntercepted = true,
+ super(<HInstruction>[interceptor, receiver], instructionType) {
setUseGvn();
}
- HInstruction get object => inputs.single;
+ HTypeInfoReadVariable.noInterceptor(
+ this.variable, HInstruction receiver, TypeMask instructionType)
+ : isIntercepted = false,
+ super(<HInstruction>[receiver], instructionType) {
+ setUseGvn();
+ }
+
+ HInstruction get interceptor {
+ assert(isIntercepted);
+ return inputs.first;
+ }
+
+ HInstruction get object => inputs.last;
accept(HVisitor visitor) => visitor.visitTypeInfoReadVariable(this);
diff --git a/pkg/compiler/lib/src/ssa/optimize.dart b/pkg/compiler/lib/src/ssa/optimize.dart
index 6f4f726..889cddf 100644
--- a/pkg/compiler/lib/src/ssa/optimize.dart
+++ b/pkg/compiler/lib/src/ssa/optimize.dart
@@ -1507,6 +1507,27 @@
// arguments. The [selectTypeArgumentFromObjectCreation] argument of
// [finishSubstituted] indexes into these type arguments.
+ // Try to remove the interceptor. The interceptor is used for accessing the
+ // substitution methods.
+ if (node.isIntercepted) {
+ // If we don't need the substitution methods then we don't need the
+ // interceptor to access them.
+ if (!needsSubstitutionForTypeVariableAccess(contextClass)) {
+ return new HTypeInfoReadVariable.noInterceptor(
+ variable, object, node.instructionType);
+ }
+ // All intercepted classes extend `Interceptor`, so if the receiver can't
+ // be a class extending `Interceptor` then the substitution methods can be
+ // called directly. (We don't care about Null since contexts reading class
+ // type variables originate from instance methods.)
+ if (new TypeMask.nonNullSubclass(
+ commonElements.jsInterceptorClass, _closedWorld)
+ .isDisjoint(object.instructionType, _closedWorld)) {
+ return new HTypeInfoReadVariable.noInterceptor(
+ variable, object, node.instructionType);
+ }
+ }
+
return node;
}
}
diff --git a/pkg/compiler/lib/src/ssa/ssa_tracer.dart b/pkg/compiler/lib/src/ssa/ssa_tracer.dart
index c05bf1f..6c0df7e 100644
--- a/pkg/compiler/lib/src/ssa/ssa_tracer.dart
+++ b/pkg/compiler/lib/src/ssa/ssa_tracer.dart
@@ -531,8 +531,8 @@
}
String visitTypeInfoReadVariable(HTypeInfoReadVariable node) {
- return "TypeInfoReadVariable: "
- "${temporaryId(node.inputs.single)}.${node.variable}";
+ var inputs = node.inputs.map(temporaryId).join(', ');
+ return "TypeInfoReadVariable: ${node.variable} $inputs";
}
String visitTypeInfoExpression(HTypeInfoExpression node) {
diff --git a/pkg/compiler/lib/src/ssa/type_builder.dart b/pkg/compiler/lib/src/ssa/type_builder.dart
index 0992bb1..ac340805 100644
--- a/pkg/compiler/lib/src/ssa/type_builder.dart
+++ b/pkg/compiler/lib/src/ssa/type_builder.dart
@@ -172,8 +172,12 @@
assert(variable.element.typeDeclaration is ClassEntity);
HInstruction target =
builder.localsHandler.readThis(sourceInformation: sourceInformation);
- builder.push(new HTypeInfoReadVariable(
- variable, target, builder.commonMasks.dynamicType)
+ HInstruction interceptor =
+ new HInterceptor(target, builder.commonMasks.nonNullType)
+ ..sourceInformation = sourceInformation;
+ builder.add(interceptor);
+ builder.push(new HTypeInfoReadVariable.intercepted(
+ variable, interceptor, target, builder.commonMasks.dynamicType)
..sourceInformation = sourceInformation);
return builder.pop();
}
diff --git a/pkg/compiler/lib/src/universe/call_structure.dart b/pkg/compiler/lib/src/universe/call_structure.dart
index 38476a9..0ca8c4d 100644
--- a/pkg/compiler/lib/src/universe/call_structure.dart
+++ b/pkg/compiler/lib/src/universe/call_structure.dart
@@ -18,6 +18,7 @@
static const CallStructure ONE_ARG = const CallStructure.unnamed(1);
static const CallStructure TWO_ARGS = const CallStructure.unnamed(2);
static const CallStructure THREE_ARGS = const CallStructure.unnamed(3);
+ static const CallStructure FOUR_ARGS = const CallStructure.unnamed(4);
/// The number of type arguments of the call.
final int typeArgumentCount;
diff --git a/pkg/dev_compiler/lib/src/analyzer/code_generator.dart b/pkg/dev_compiler/lib/src/analyzer/code_generator.dart
index 508e4b1..9c93e2c 100644
--- a/pkg/dev_compiler/lib/src/analyzer/code_generator.dart
+++ b/pkg/dev_compiler/lib/src/analyzer/code_generator.dart
@@ -1733,31 +1733,34 @@
invocationProps.add(new JS.Property(js.string(name), value));
}
- var args = new JS.TemporaryId('args');
+ var args = _emitParametersForElement(method);
var typeParams = _emitTypeFormals(method.type.typeFormals);
- var fnArgs = new List<JS.Parameter>.from(typeParams);
- JS.Expression positionalArgs;
+ var fnArgs = new List<JS.Parameter>.from(typeParams)..addAll(args);
- if (method.type.namedParameterTypes.isNotEmpty) {
- addProperty('namedArguments', _callHelper('extractNamedArgs(#)', [args]));
+ JS.Expression positionalArgs;
+ List<JS.Statement> optionalArgInit = [];
+ if (method.type.optionalParameterTypes.isNotEmpty) {
+ positionalArgs = new JS.TemporaryId('args');
+ var requiredParameterCount = method.type.normalParameterTypes.length;
+ optionalArgInit.add(js.statement(
+ 'let # = [#]', [positionalArgs, args.take(requiredParameterCount)]));
+ optionalArgInit.addAll(args.skip(requiredParameterCount).map((p) =>
+ js.statement('if (# !== void 0) #.push(#)', [p, positionalArgs, p])));
+ } else {
+ if (method.type.namedParameterTypes.isNotEmpty) {
+ addProperty('namedArguments', args.removeLast());
+ }
+ positionalArgs = new JS.ArrayInitializer(args);
}
if (method is MethodElement) {
addProperty('isMethod', js.boolean(true));
-
- fnArgs.add(new JS.RestParameter(args));
- positionalArgs = args;
} else {
var property = method as PropertyAccessorElement;
if (property.isGetter) {
addProperty('isGetter', js.boolean(true));
-
- positionalArgs = new JS.ArrayInitializer([]);
} else if (property.isSetter) {
addProperty('isSetter', js.boolean(true));
-
- fnArgs.add(args);
- positionalArgs = new JS.ArrayInitializer([args]);
}
}
@@ -1777,7 +1780,8 @@
fnBody = js.call('#._check(#)', [_emitType(method.returnType), fnBody]);
}
- var fn = new JS.Fun(fnArgs, js.block('{ return #; }', [fnBody]),
+ var fn = new JS.Fun(
+ fnArgs, js.block('{ #; return #; }', [optionalArgInit, fnBody]),
typeParams: typeParams);
return new JS.Method(
@@ -2137,13 +2141,15 @@
var extMembers = _classProperties.extensionMethods;
var staticMethods = <JS.Property>[];
var instanceMethods = <JS.Property>[];
-
var classMethods = classElem.methods.where((m) => !m.isAbstract).toList();
for (var m in mockMembers.values) {
if (m is MethodElement) classMethods.add(m);
}
for (var method in classMethods) {
+ var isStatic = method.isStatic;
+ if (isStatic && !options.emitMetadata) continue;
+
var name = method.name;
var reifiedType = _getMemberRuntimeType(method);
var memberOverride =
@@ -2164,7 +2170,7 @@
reifiedType, annotationNode?.metadata,
parameters: annotationNode?.parameters?.parameters);
var property = new JS.Property(_declareMemberName(method), type);
- if (method.isStatic) {
+ if (isStatic) {
staticMethods.add(property);
} else {
instanceMethods.add(property);
@@ -2197,14 +2203,8 @@
for (var accessor in classAccessors) {
// Static getters/setters cannot be called with dynamic dispatch, nor
// can they be torn off.
- // TODO(jmesserly): can we attach static method type info at the tearoff
- // point, and avoid saving the information otherwise? Same trick would
- // work for top-level functions.
-
var isStatic = accessor.isStatic;
- if (!options.emitMetadata && accessor.isStatic) {
- continue;
- }
+ if (isStatic && !options.emitMetadata) continue;
var name = accessor.name;
var isGetter = accessor.isGetter;
@@ -2223,12 +2223,14 @@
memberOverride.type != reifiedType;
if (needsSignature) {
- // TODO(jmesserly): we could reduce work by not saving a full function
- // type for getters/setters. These only need 1 type to be saved.
var annotationNode = annotatedMembers[accessor] as MethodDeclaration;
- var type = _emitAnnotatedFunctionType(
- reifiedType, annotationNode?.metadata,
- parameters: annotationNode?.parameters?.parameters);
+ var type = _emitAnnotatedResult(
+ _emitType(
+ isGetter
+ ? reifiedType.returnType
+ : reifiedType.parameters[0].type,
+ nameType: false),
+ annotationNode?.metadata);
var property = new JS.Property(_declareMemberName(accessor), type);
if (isStatic) {
@@ -2257,9 +2259,7 @@
if (field.isSynthetic && !classElem.isEnum) continue;
// Only instance fields need to be saved for dynamic dispatch.
var isStatic = field.isStatic;
- if (!options.emitMetadata && isStatic) {
- continue;
- }
+ if (isStatic && !options.emitMetadata) continue;
var fieldNode = annotatedMembers[field] as VariableDeclaration;
var metadata = fieldNode != null
@@ -2276,20 +2276,20 @@
emitSignature('StaticField', staticFields);
}
- {
+ if (options.emitMetadata) {
var constructors = <JS.Property>[];
- if (options.emitMetadata) {
- for (var ctor in classElem.constructors) {
- var annotationNode = annotatedMembers[ctor] as ConstructorDeclaration;
- var memberName = _constructorName(ctor.name);
- var type = _emitAnnotatedFunctionType(
- ctor.type, annotationNode?.metadata,
- parameters: annotationNode?.parameters?.parameters);
- constructors.add(new JS.Property(memberName, type));
- }
+ for (var ctor in classElem.constructors) {
+ var annotationNode = annotatedMembers[ctor] as ConstructorDeclaration;
+ var memberName = _constructorName(ctor.name);
+ var type = _emitAnnotatedFunctionType(
+ ctor.type, annotationNode?.metadata,
+ parameters: annotationNode?.parameters?.parameters);
+ constructors.add(new JS.Property(memberName, type));
}
+
emitSignature('Constructor', constructors);
}
+
// Add static property dart._runtimeType to Object.
// All other Dart classes will (statically) inherit this property.
if (classElem == objectClass) {
@@ -2686,7 +2686,11 @@
var nameExpr = _emitTopLevelName(element);
body.add(
closureAnnotate(js.statement('# = #', [nameExpr, fn]), element, node));
- if (_reifyFunctionType(element)) {
+ // Function types of top-level/static functions are only needed when
+ // dart:mirrors is enabled.
+ // TODO(jmesserly): do we even need this for mirrors, since statics are not
+ // commonly reflected on?
+ if (options.emitMetadata && _reifyFunctionType(element)) {
body.add(_emitFunctionTagged(nameExpr, element.type, topLevel: true)
.toStatement());
}
@@ -3003,16 +3007,16 @@
/// function instantiation.
@override
JS.Expression visitSimpleIdentifier(SimpleIdentifier node,
- [SimpleIdentifier libraryPrefix]) {
+ [PrefixedIdentifier prefix]) {
var typeArgs = _getTypeArgs(node.staticElement, node.staticType);
- var simpleId = _emitSimpleIdentifier(node)
+ var simpleId = _emitSimpleIdentifier(node, prefix)
..sourceInformation = _nodeSpan(node);
- if (libraryPrefix != null &&
+ if (prefix != null &&
// Check that the JS AST is for a Dart property and not JS interop.
simpleId is JS.PropertyAccess &&
simpleId.receiver is JS.Identifier) {
// Attach the span to the library prefix.
- simpleId.receiver.sourceInformation = _nodeSpan(libraryPrefix);
+ simpleId.receiver.sourceInformation = _nodeSpan(prefix.prefix);
}
if (typeArgs == null) return simpleId;
return _callHelper('gbind(#, #)', [simpleId, typeArgs]);
@@ -3021,7 +3025,8 @@
/// Emits a simple identifier, handling implicit `this` as well as
/// going through the qualified library name if necessary, but *not* handling
/// inferred generic function instantiation.
- JS.Expression _emitSimpleIdentifier(SimpleIdentifier node) {
+ JS.Expression _emitSimpleIdentifier(SimpleIdentifier node,
+ [PrefixedIdentifier prefix]) {
var accessor = resolutionMap.staticElementForIdentifier(node);
if (accessor == null) {
return _throwUnsafe('unresolved identifier: ' + (node.name ?? '<null>'));
@@ -3062,7 +3067,12 @@
// library member
if (element.enclosingElement is CompilationUnitElement) {
- return _emitTopLevelName(accessor);
+ var result = _emitTopLevelName(accessor);
+ if (element is FunctionElement &&
+ _reifyTearoff(element, prefix ?? node)) {
+ return _emitFunctionTagged(result, element.type);
+ }
+ return result;
}
var name = element.name;
@@ -3097,18 +3107,17 @@
// For instance members, we add implicit-this.
// For method tear-offs, we ensure it's a bound method.
- if (element is MethodElement &&
- !inInvocationContext(node) &&
- !_hasJSInteropAnnotation(classElem)) {
- if (isStatic) {
- // TODO(jmesserly): instead of looking up the function type, we could
- // simply emit it here.
- return _callHelper(
- 'tagStatic(#, #)', [_emitStaticClassName(classElem), member]);
- }
- return _callHelper('bind(this, #)', member);
- }
var target = isStatic ? _emitStaticClassName(classElem) : new JS.This();
+ if (element is MethodElement && _reifyTearoff(element, prefix ?? node)) {
+ if (isStatic) {
+ // TODO(jmesserly): we could tag static/top-level function types once
+ // in the module initialization, rather than at the point where they
+ // escape.
+ return _emitFunctionTagged(
+ new JS.PropertyAccess(target, member), element.type);
+ }
+ return _callHelper('bind(#, #)', [target, member]);
+ }
return new JS.PropertyAccess(target, member);
}
@@ -3445,7 +3454,8 @@
_visitExpression(right)
]);
}
- return _emitSend(target, '[]=', [left.index, right], left.staticElement);
+ return _emitOperatorCall(
+ target, '[]=', [left.index, right], left.staticElement);
}
if (left is SimpleIdentifier) {
@@ -3471,8 +3481,7 @@
}
if (isDynamicInvoke(target)) {
- return _callHelper('#(#, #, #)', [
- _emitDynamicOperationName('dput'),
+ return _callHelper('dput$_replSuffix(#, #, #)', [
_visitExpression(target),
_emitMemberName(id.name),
_visitExpression(right)
@@ -3490,6 +3499,11 @@
return _badAssignment('Unhandled assignment', left, right);
}
+ // TODO(jmesserly): remove this. Instead handle REPL private name lookups in
+ // _emitMemberName (by using `dart.privateName` if we're in REPL mode,
+ // refactored from the current `dart._dhelperRepl`).
+ String get _replSuffix => options.replCompile ? 'Repl' : '';
+
JS.Expression _badAssignment(String problem, Expression lhs, Expression rhs) {
// TODO(sra): We should get here only for compiler bugs or weirdness due to
// --unsafe-force-compile. Once those paths have been addressed, throw at
@@ -3740,30 +3754,23 @@
var jsName =
_emitMemberName(name, type: type, isStatic: isStatic, element: element);
- JS.Expression jsTarget = _emitTarget(target, element, isStatic);
if (isDynamicInvoke(target) || isDynamicInvoke(node.methodName)) {
+ JS.Expression jsTarget = _emitTarget(target, element, isStatic);
if (jsTarget is JS.Super) {
jsTarget =
_emitTargetAccess(jsTarget, jsName, element, node.methodName);
- return _emitDynamicInvoke(jsTarget, typeArgs, args);
+ jsName = null;
}
- if (typeArgs != null) {
- return _callHelper('#(#, [#], #, #)', [
- _emitDynamicOperationName('dgsend'),
- jsTarget,
- typeArgs,
- jsName,
- args
- ]);
- } else {
- return _callHelper('#(#, #, #)',
- [_emitDynamicOperationName('dsend'), jsTarget, jsName, args]);
- }
+ return _emitDynamicInvoke(
+ jsTarget, typeArgs, jsName, args, node.argumentList);
}
+
+ JS.Expression jsTarget = _emitTarget(target, element, isStatic);
if (_isObjectMemberCall(target, name)) {
assert(typeArgs == null); // Object methods don't take type args.
return _callHelper('#(#, #)', [name, jsTarget, args]);
}
+
jsTarget = _emitTargetAccess(jsTarget, jsName, element, node.methodName);
// Handle `o.m(a)` where `o.m` is a getter returning a class with `call`.
if (element is PropertyAccessorElement) {
@@ -3783,13 +3790,40 @@
return new JS.Call(jsTarget, args);
}
- JS.Expression _emitDynamicInvoke(JS.Expression fn,
- List<JS.Expression> typeArgs, List<JS.Expression> args) {
+ JS.Expression _emitDynamicInvoke(
+ JS.Expression fn,
+ List<JS.Expression> typeArgs,
+ JS.Expression methodName,
+ List<JS.Expression> args,
+ ArgumentList argumentList) {
+ var jsArgs = <Object>[fn];
+ String jsCode;
if (typeArgs != null) {
- return _callHelper('dgcall(#, [#], #)', [fn, typeArgs, args]);
+ jsArgs.add(typeArgs);
+ if (methodName != null) {
+ jsCode = 'dgsend$_replSuffix(#, [#], #';
+ jsArgs.add(methodName);
+ } else {
+ jsCode = 'dgcall(#, [#]';
+ }
+ } else if (methodName != null) {
+ jsCode = 'dsend$_replSuffix(#, #';
+ jsArgs.add(methodName);
} else {
- return _callHelper('dcall(#, #)', [fn, args]);
+ jsCode = 'dcall(#';
}
+
+ var hasNamed = argumentList.arguments.any((a) => a is NamedExpression);
+ if (hasNamed) {
+ jsCode += ', [#], #)';
+ jsArgs.add(args.take(args.length - 1));
+ jsArgs.add(args.last);
+ } else {
+ jsArgs.add(args);
+ jsCode += ', [#])';
+ }
+
+ return _callHelper(jsCode, jsArgs);
}
bool _doubleEqIsIdentity(Expression left, Expression right) {
@@ -3858,11 +3892,12 @@
return _emitDebuggerCall(node);
}
}
- var fn = _visitExpression(function);
+
var args = _emitArgumentList(node.argumentList);
var typeArgs = _emitInvokeTypeArguments(node);
+ var fn = _visitExpression(function);
if (isDynamicInvoke(function)) {
- return _emitDynamicInvoke(fn, typeArgs, args);
+ return _emitDynamicInvoke(fn, typeArgs, null, args, node.argumentList);
}
if (typeArgs != null) args.insertAll(0, typeArgs);
@@ -4567,7 +4602,7 @@
var negated = op.type == TokenType.BANG_EQ;
if (left is SuperExpression) {
- return _emitSend(left, op.lexeme, [right], node.staticElement);
+ return _emitOperatorCall(left, op.lexeme, [right], node.staticElement);
}
// Conceptually `x == y` in Dart is defined as:
@@ -4649,7 +4684,7 @@
var rightType = getStaticType(right);
JS.Expression operatorCall() {
- return _emitSend(left, op.lexeme, [right])
+ return _emitOperatorCall(left, op.lexeme, [right])
..sourceInformation = _getLocation(node.operator.offset);
}
@@ -4673,7 +4708,7 @@
// `a ~/ b` is equivalent to `(a / b).truncate()`
var div = ast.binaryExpression(left, '/', right)
..staticType = node.staticType;
- return _emitSend(div, 'truncate', [])
+ return _emitOperatorCall(div, 'truncate', [])
..sourceInformation = _getLocation(node.operator.offset);
case TokenType.PERCENT:
@@ -5084,7 +5119,7 @@
JS.Expression jsExpr = js.call('~#', notNull(expr));
return _coerceBitOperationResultToUnsigned(node, jsExpr);
}
- return _emitSend(expr, op.lexeme[0], []);
+ return _emitOperatorCall(expr, op.lexeme[0], []);
}
if (!isNullable(expr)) {
return js.call('$op#', _visitExpression(expr));
@@ -5116,7 +5151,7 @@
var operatorName = op.lexeme;
// Use the name from the Dart spec.
if (operatorName == '-') operatorName = 'unary-';
- return _emitSend(expr, operatorName, []);
+ return _emitOperatorCall(expr, operatorName, []);
}
// Cascades can contain [IndexExpression], [MethodInvocation] and
@@ -5162,9 +5197,9 @@
}
if (isLibraryPrefix(node.prefix)) {
- return visitSimpleIdentifier(node.identifier, node.prefix);
+ return visitSimpleIdentifier(node.identifier, node);
} else {
- return _emitPropertyGet(node.prefix, node.identifier, node.staticType);
+ return _emitPropertyGet(node.prefix, node.identifier, node);
}
}
@@ -5173,8 +5208,7 @@
if (node.operator.lexeme == '?.' && isNullable(node.target)) {
return _emitNullSafe(node);
}
- return _emitPropertyGet(
- _getTarget(node), node.propertyName, node.staticType);
+ return _emitPropertyGet(_getTarget(node), node.propertyName, node);
}
JS.Expression _emitNullSafe(Expression node) {
@@ -5182,9 +5216,11 @@
var target = _getTarget(node);
var vars = <JS.MetaLetVariable, JS.Expression>{};
var t = _bindValue(vars, 't', target, context: target);
+
+ var desugared = _stripNullAwareOp(node, t);
return new JS.MetaLet(vars, [
js.call('# == null ? null : #',
- [_visitExpression(t), _visitExpression(_stripNullAwareOp(node, t))])
+ [_visitExpression(t), _visitExpression(desugared)])
]);
}
@@ -5225,7 +5261,8 @@
/// Shared code for [PrefixedIdentifier] and [PropertyAccess].
JS.Expression _emitPropertyGet(
- Expression receiver, SimpleIdentifier memberId, DartType resultType) {
+ Expression receiver, SimpleIdentifier memberId, Expression accessNode) {
+ var resultType = accessNode.staticType;
var accessor = memberId.staticElement;
var memberName = memberId.name;
var receiverType = getStaticType(receiver);
@@ -5240,11 +5277,8 @@
var jsName = _emitMemberName(memberName,
type: receiverType, isStatic: isStatic, element: accessor);
if (isDynamicInvoke(receiver)) {
- return _callHelper('#(#, #)', [
- _emitDynamicOperationName('dload'),
- _visitExpression(receiver),
- jsName
- ]);
+ return _callHelper(
+ 'dload$_replSuffix(#, #)', [_visitExpression(receiver), jsName]);
}
var jsTarget = _emitTarget(receiver, accessor, isStatic);
@@ -5266,9 +5300,11 @@
result = _callHelper('#(#)', [memberName, jsTarget]);
}
} else if (accessor is MethodElement &&
- !_hasJSInteropAnnotation(accessor.enclosingElement)) {
+ _reifyTearoff(accessor, accessNode)) {
if (isStatic) {
- result = _callHelper('tagStatic(#, #)', [jsTarget, jsName]);
+ result = _emitFunctionTagged(
+ _emitTargetAccess(jsTarget, jsName, accessor, memberId),
+ accessor.type);
} else if (isSuper) {
result = _callHelper('bind(this, #, #)',
[jsName, _emitTargetAccess(jsTarget, jsName, accessor, memberId)]);
@@ -5285,6 +5321,13 @@
: _callHelper('gbind(#, #)', [result, typeArgs]);
}
+ bool _reifyTearoff(ExecutableElement element, Expression node) {
+ return !inInvocationContext(node) &&
+ !_usesJSInterop(element) &&
+ !_isInForeignJS &&
+ _reifyFunctionType(element);
+ }
+
bool _isDirectCallable(DartType t) =>
t is FunctionType || t is InterfaceType && _usesJSInterop(t.element);
@@ -5294,15 +5337,13 @@
return _emitMemberName('call', type: fromType, element: callMethod);
}
- JS.LiteralString _emitDynamicOperationName(String name) =>
- js.string(options.replCompile ? '${name}Repl' : name);
-
/// Emits a generic send, like an operator method.
///
/// **Please note** this function does not support method invocation syntax
/// `obj.name(args)` because that could be a getter followed by a call.
/// See [visitMethodInvocation].
- JS.Expression _emitSend(Expression target, String name, List<Expression> args,
+ JS.Expression _emitOperatorCall(
+ Expression target, String name, List<Expression> args,
[Element element]) {
// TODO(jmesserly): calls that don't pass `element` are probably broken for
// `super` calls from disallowed super locations.
@@ -5315,7 +5356,7 @@
return _callHelper('$dynamicHelper(#, #)',
[_visitExpression(target), _visitExpressionList(args)]);
} else {
- return _callHelper('dsend(#, #, #)',
+ return _callHelper('dsend(#, #, [#])',
[_visitExpression(target), memberName, _visitExpressionList(args)]);
}
}
@@ -5334,7 +5375,7 @@
return new JS.PropertyAccess(
_visitExpression(target), _visitExpression(node.index));
}
- return _emitSend(target, '[]', [node.index], node.staticElement);
+ return _emitOperatorCall(target, '[]', [node.index], node.staticElement);
}
// TODO(jmesserly): ideally we'd check the method and see if it is marked
@@ -6472,9 +6513,6 @@
bool operator ==(Object other) => identical(this, other);
}
-bool isLibraryPrefix(Expression node) =>
- node is SimpleIdentifier && node.staticElement is PrefixElement;
-
LibraryElement _getLibrary(AnalysisContext c, String uri) =>
c.computeLibraryElement(c.sourceFactory.forUri(uri));
diff --git a/pkg/dev_compiler/lib/src/analyzer/element_helpers.dart b/pkg/dev_compiler/lib/src/analyzer/element_helpers.dart
index 9a6ea0d..d855eb6 100644
--- a/pkg/dev_compiler/lib/src/analyzer/element_helpers.dart
+++ b/pkg/dev_compiler/lib/src/analyzer/element_helpers.dart
@@ -75,9 +75,16 @@
/// Similar to [SimpleIdentifier] inGetterContext, inSetterContext, and
/// inDeclarationContext, this method returns true if [node] is used in an
/// invocation context such as a MethodInvocation.
-bool inInvocationContext(SimpleIdentifier node) {
+bool inInvocationContext(Expression node) {
var parent = node.parent;
- return parent is MethodInvocation && parent.methodName == node;
+ while (parent is ParenthesizedExpression) {
+ node = parent;
+ parent = node.parent;
+ }
+ return parent is InvocationExpression && identical(node, parent.function) ||
+ parent is MethodInvocation &&
+ parent.methodName.name == 'call' &&
+ identical(node, parent.target);
}
bool isInlineJS(Element e) {
@@ -88,6 +95,9 @@
return false;
}
+bool isLibraryPrefix(Expression node) =>
+ node is SimpleIdentifier && node.staticElement is PrefixElement;
+
ExecutableElement getFunctionBodyElement(FunctionBody body) {
var f = body.parent;
if (f is FunctionExpression) {
diff --git a/pkg/dev_compiler/lib/src/kernel/compiler.dart b/pkg/dev_compiler/lib/src/kernel/compiler.dart
index 8e64b1d..a6e12f2 100644
--- a/pkg/dev_compiler/lib/src/kernel/compiler.dart
+++ b/pkg/dev_compiler/lib/src/kernel/compiler.dart
@@ -206,6 +206,7 @@
final NullableInference _nullableInference;
factory ProgramCompiler(Component component,
+ // TODO(jmesserly): emitMetadata should default to false
{bool emitMetadata: true,
bool replCompile: false,
Map<String, String> declaredVariables: const {}}) {
@@ -1213,14 +1214,9 @@
if (m is Procedure) classProcedures.add(m);
}
for (var member in classProcedures) {
- // Static getters/setters cannot be called with dynamic dispatch, nor
- // can they be torn off.
- // TODO(jmesserly): can we attach static method type info at the tearoff
- // point, and avoid saving the information otherwise? Same trick would
- // work for top-level functions.
- if (!emitMetadata && member.isAccessor && member.isStatic) {
- continue;
- }
+ // Static getters/setters/methods cannot be called with dynamic dispatch,
+ // nor can they be torn off.
+ if (!emitMetadata && member.isStatic) continue;
var name = member.name.name;
var reifiedType = _getMemberRuntimeType(member, c);
@@ -1239,7 +1235,17 @@
reifiedType != _getMemberRuntimeType(memberOverride, c);
if (needsSignature) {
- var type = _emitAnnotatedFunctionType(reifiedType, member);
+ JS.Expression type;
+ if (member.isAccessor) {
+ type = _emitAnnotatedResult(
+ _emitType(member.isGetter
+ ? reifiedType.returnType
+ : reifiedType.positionalParameters[0]),
+ member.annotations,
+ member);
+ } else {
+ type = _emitAnnotatedFunctionType(reifiedType, member);
+ }
var property = new JS.Property(_declareMemberName(member), type);
var signatures = getSignatureList(member);
signatures.add(property);
@@ -1277,16 +1283,16 @@
emitSignature('Field', instanceFields);
emitSignature('StaticField', staticFields);
- var constructors = <JS.Property>[];
if (emitMetadata) {
+ var constructors = <JS.Property>[];
for (var ctor in c.constructors) {
var memberName = _constructorName(ctor.name.name);
var type = _emitAnnotatedFunctionType(
ctor.function.functionType.withoutTypeParameters, ctor);
constructors.add(new JS.Property(memberName, type));
}
+ emitSignature('Constructor', constructors);
}
- emitSignature('Constructor', constructors);
// Add static property dart._runtimeType to Object.
// All other Dart classes will (statically) inherit this property.
@@ -1815,7 +1821,9 @@
void _addMockMembers(Member member, Class c, List<JS.Method> jsMethods) {
JS.Method implementMockMember(
List<TypeParameter> typeParameters,
+ List<JS.Parameter> positionalParameters,
List<VariableDeclaration> namedParameters,
+ int requiredParameterCount,
ProcedureKind mockMemberKind,
DartType returnType) {
assert(mockMemberKind != ProcedureKind.Factory);
@@ -1825,32 +1833,34 @@
invocationProps.add(new JS.Property(js.string(name), value));
}
- var args = new JS.TemporaryId('args');
+ var args = positionalParameters;
var typeParams = _emitTypeFormals(typeParameters);
- var fnArgs = new List<JS.Parameter>.from(typeParams);
- JS.Expression positionalArgs;
+ var fnArgs = new List<JS.Parameter>.from(typeParams)..addAll(args);
- if (namedParameters.isNotEmpty) {
- addProperty(
- 'namedArguments', _callHelper('extractNamedArgs(#)', [args]));
+ JS.Expression positionalArgs;
+ List<JS.Statement> optionalArgInit = [];
+ if (positionalParameters.length != requiredParameterCount) {
+ positionalArgs = new JS.TemporaryId('args');
+ optionalArgInit.add(js.statement('let # = [#]',
+ [positionalArgs, args.take(requiredParameterCount)]));
+ optionalArgInit.addAll(args.skip(requiredParameterCount).map((p) => js
+ .statement('if (# !== void 0) #.push(#)', [p, positionalArgs, p])));
+ } else {
+ positionalArgs = new JS.ArrayInitializer(args);
+ if (namedParameters.isNotEmpty) {
+ fnArgs.add(namedArgumentTemp);
+ addProperty('namedArguments', namedArgumentTemp);
+ }
}
if (mockMemberKind != ProcedureKind.Getter &&
mockMemberKind != ProcedureKind.Setter) {
addProperty('isMethod', js.boolean(true));
-
- fnArgs.add(new JS.RestParameter(args));
- positionalArgs = args;
} else {
if (mockMemberKind == ProcedureKind.Getter) {
addProperty('isGetter', js.boolean(true));
-
- positionalArgs = new JS.ArrayInitializer([]);
} else if (mockMemberKind == ProcedureKind.Setter) {
addProperty('isSetter', js.boolean(true));
-
- fnArgs.add(args);
- positionalArgs = new JS.ArrayInitializer([args]);
}
}
@@ -1871,7 +1881,8 @@
fnBody = js.call('#._check(#)', [_emitType(returnType), fnBody]);
}
- var fn = new JS.Fun(fnArgs, js.block('{ return #; }', [fnBody]),
+ var fn = new JS.Fun(
+ fnArgs, js.block('{ #; return #; }', [optionalArgInit, fnBody]),
typeParams: typeParams);
return new JS.Method(
@@ -1884,17 +1895,22 @@
}
if (member is Field) {
- jsMethods
- .add(implementMockMember([], [], ProcedureKind.Getter, member.type));
+ jsMethods.add(implementMockMember(
+ [], [], [], 0, ProcedureKind.Getter, member.type));
if (!member.isFinal) {
- jsMethods.add(implementMockMember(
- [], [], ProcedureKind.Setter, new DynamicType()));
+ jsMethods.add(implementMockMember([], [new JS.TemporaryId('value')], [],
+ 1, ProcedureKind.Setter, new VoidType()));
}
} else {
var procedure = member as Procedure;
var f = procedure.function;
jsMethods.add(implementMockMember(
- f.typeParameters, f.namedParameters, procedure.kind, f.returnType));
+ f.typeParameters,
+ f.positionalParameters.map(_emitVariableRef).toList(),
+ f.namedParameters,
+ f.requiredParameterCount,
+ procedure.kind,
+ f.returnType));
}
}
@@ -2604,9 +2620,10 @@
visitVectorType(type) => defaultDartType(type);
@override
- visitFunctionType(type, {FunctionNode function, bool lazy: false}) {
+ visitFunctionType(type, {Member member, bool lazy: false}) {
var requiredTypes =
type.positionalParameters.take(type.requiredParameterCount).toList();
+ var function = member?.function;
var requiredParams = function?.positionalParameters
?.take(type.requiredParameterCount)
?.toList();
@@ -2618,7 +2635,7 @@
var namedTypes = type.namedParameters;
var rt = _emitType(type.returnType);
- var ra = _emitTypeNames(requiredTypes, requiredParams);
+ var ra = _emitTypeNames(requiredTypes, requiredParams, member);
List<JS.Expression> typeParts;
if (namedTypes.isNotEmpty) {
@@ -2628,7 +2645,7 @@
typeParts = [rt, ra, na];
} else if (optionalTypes.isNotEmpty) {
assert(namedTypes.isEmpty);
- var oa = _emitTypeNames(optionalTypes, optionalParams);
+ var oa = _emitTypeNames(optionalTypes, optionalParams, member);
typeParts = [rt, ra, oa];
} else {
typeParts = [rt, ra];
@@ -2664,10 +2681,10 @@
}
JS.Expression _emitAnnotatedFunctionType(FunctionType type, Member member) {
- var result = visitFunctionType(type, function: member.function);
+ var result = visitFunctionType(type, member: member);
var annotations = member.annotations;
- if (emitMetadata && annotations != null && annotations.isNotEmpty) {
+ if (emitMetadata && annotations.isNotEmpty) {
// TODO(jmesserly): should we disable source info for annotations?
var savedUri = _currentUri;
_currentUri = member.enclosingClass.fileUri;
@@ -2698,10 +2715,14 @@
// Wrap a result - usually a type - with its metadata. The runtime is
// responsible for unpacking this.
JS.Expression _emitAnnotatedResult(
- JS.Expression result, List<Expression> metadata) {
- if (emitMetadata && metadata != null && metadata.isNotEmpty) {
+ JS.Expression result, List<Expression> metadata, Member member) {
+ if (emitMetadata && metadata.isNotEmpty) {
+ // TODO(jmesserly): should we disable source info for annotations?
+ var savedUri = _currentUri;
+ _currentUri = member.enclosingClass.fileUri;
result = new JS.ArrayInitializer(
[result]..addAll(metadata.map(_instantiateAnnotation)));
+ _currentUri = savedUri;
}
return result;
}
@@ -2712,12 +2733,15 @@
.toList());
}
- JS.ArrayInitializer _emitTypeNames(
- List<DartType> types, List<VariableDeclaration> parameters) {
+ JS.ArrayInitializer _emitTypeNames(List<DartType> types,
+ List<VariableDeclaration> parameters, Member member) {
var result = <JS.Expression>[];
for (int i = 0; i < types.length; ++i) {
- var metadata = parameters != null ? parameters[i].annotations : null;
- result.add(_emitAnnotatedResult(_emitType(types[i]), metadata));
+ var type = _emitType(types[i]);
+ if (parameters != null) {
+ type = _emitAnnotatedResult(type, parameters[i].annotations, member);
+ }
+ result.add(type);
}
return new JS.ArrayInitializer(result);
}
@@ -3034,9 +3058,6 @@
}
}
- JS.LiteralString _emitDynamicOperationName(String name) =>
- js.string(replCompile ? '${name}Repl' : name);
-
JS.Expression _callHelper(String code, [args]) {
if (args is List) {
args.insert(0, _runtimeModule);
@@ -3670,7 +3691,11 @@
} else {
declareFn = new JS.FunctionDeclaration(name, fn);
}
- if (_reifyFunctionType(func)) {
+ // Function types of top-level/static functions are only needed when
+ // dart:mirrors is enabled.
+ // TODO(jmesserly): do we even need this for mirrors, since statics are not
+ // commonly reflected on?
+ if (emitMetadata && _reifyFunctionType(func)) {
declareFn = new JS.Block([
declareFn,
_emitFunctionTagged(_emitVariableRef(node.variable), func.functionType)
@@ -3779,8 +3804,7 @@
// they can be hovered. Unfortunately this is not possible as Kernel does
// not store this data.
if (member == null) {
- return _callHelper(
- '#(#, #)', [_emitDynamicOperationName('dload'), jsReceiver, jsName]);
+ return _callHelper('dload$_replSuffix(#, #)', [jsReceiver, jsName]);
}
if (_isObjectMemberCall(receiver, memberName)) {
@@ -3789,15 +3813,18 @@
} else {
return _callHelper('#(#)', [memberName, jsReceiver]);
}
- } else if (member is Procedure &&
- !member.isAccessor &&
- !hasJSInteropAnnotation(member.enclosingClass)) {
+ } else if (_reifyTearoff(member)) {
return _callHelper('bind(#, #)', [jsReceiver, jsName]);
} else {
return new JS.PropertyAccess(jsReceiver, jsName);
}
}
+ // TODO(jmesserly): remove this. Instead handle REPL private name lookups in
+ // _emitMemberName (by using `dart.privateName` if we're in REPL mode,
+ // refactored from the current `dart._dhelperRepl`).
+ String get _replSuffix => replCompile ? 'Repl' : '';
+
JS.Expression _emitPropertySet(
Expression receiver, Member member, Expression value,
[String memberName]) {
@@ -3808,8 +3835,8 @@
var jsValue = _visitExpression(value);
if (member == null) {
- return _callHelper('#(#, #, #)',
- [_emitDynamicOperationName('dput'), jsReceiver, jsName, jsValue]);
+ return _callHelper(
+ 'dput$_replSuffix(#, #, #)', [jsReceiver, jsName, jsValue]);
}
return js.call('#.# = #', [jsReceiver, jsName, jsValue]);
}
@@ -3818,9 +3845,7 @@
visitSuperPropertyGet(SuperPropertyGet node) {
var target = node.interfaceTarget;
var jsTarget = _emitSuperTarget(target);
- if (target is Procedure &&
- !target.isAccessor &&
- !hasJSInteropAnnotation(target.enclosingClass)) {
+ if (_reifyTearoff(target)) {
return _callHelper('bind(this, #, #)', [jsTarget.selector, jsTarget]);
}
return jsTarget;
@@ -3835,7 +3860,15 @@
@override
visitStaticGet(StaticGet node) {
- return _emitStaticTarget(node.target);
+ var target = node.target;
+ var result = _emitStaticTarget(target);
+ if (_reifyTearoff(target)) {
+ // TODO(jmesserly): we could tag static/top-level function types once
+ // in the module initialization, rather than at the point where they
+ // escape.
+ return _emitFunctionTagged(result, target.function.functionType);
+ }
+ return result;
}
@override
@@ -3872,21 +3905,13 @@
var jsReceiver = _visitExpression(receiver);
var args = _emitArgumentList(arguments);
var receiverType = receiver.getStaticType(types);
- var typeArgs = arguments.types;
bool isCallingDynamicField = target is Member &&
target.hasGetter &&
_isDynamicOrFunction(target.getterType);
if (name == 'call') {
if (isCallingDynamicField || _isDynamicOrFunction(receiverType)) {
- if (typeArgs.isNotEmpty) {
- return _callHelper('dgcall(#, [#], #)', [
- jsReceiver,
- args.take(typeArgs.length),
- args.skip(typeArgs.length)
- ]);
- }
- return _callHelper('dcall(#, #)', [jsReceiver, args]);
+ return _emitDynamicInvoke(jsReceiver, null, args, arguments);
} else if (_isDirectCallable(receiverType)) {
// Call methods on function types should be handled as function calls.
return new JS.Call(jsReceiver, args);
@@ -3895,21 +3920,10 @@
var jsName = _emitMemberName(name, type: receiverType, member: target);
if (target == null || isCallingDynamicField) {
- if (typeArgs.isNotEmpty) {
- return _callHelper('#(#, [#], #, #)', [
- _emitDynamicOperationName('dgsend'),
- jsReceiver,
- args.take(typeArgs.length),
- jsName,
- args.skip(typeArgs.length)
- ]);
- } else {
- return _callHelper('#(#, #, #)',
- [_emitDynamicOperationName('dsend'), jsReceiver, jsName, args]);
- }
+ return _emitDynamicInvoke(jsReceiver, jsName, args, arguments);
}
if (_isObjectMemberCall(receiver, name)) {
- assert(typeArgs.isEmpty); // Object methods don't take type args.
+ assert(arguments.types.isEmpty); // Object methods don't take type args.
return _callHelper('#(#, #)', [name, jsReceiver, args]);
}
// TODO(jmesserly): remove when Kernel desugars this for us.
@@ -3926,6 +3940,41 @@
return js.call('#.#(#)', [jsReceiver, jsName, args]);
}
+ JS.Expression _emitDynamicInvoke(JS.Expression fn, JS.Expression methodName,
+ Iterable<JS.Expression> args, Arguments arguments) {
+ var jsArgs = <Object>[fn];
+ String jsCode;
+
+ var typeArgs = arguments.types;
+ if (typeArgs.isNotEmpty) {
+ jsArgs.add(args.take(typeArgs.length));
+ args = args.skip(typeArgs.length);
+ if (methodName != null) {
+ jsCode = 'dgsend$_replSuffix(#, [#], #';
+ jsArgs.add(methodName);
+ } else {
+ jsCode = 'dgcall(#, [#]';
+ }
+ } else if (methodName != null) {
+ jsCode = 'dsend$_replSuffix(#, #';
+ jsArgs.add(methodName);
+ } else {
+ jsCode = 'dcall(#';
+ }
+
+ var hasNamed = arguments.named.isNotEmpty;
+ if (hasNamed) {
+ jsCode += ', [#], #)';
+ jsArgs.add(args.take(args.length - 1));
+ jsArgs.add(args.last);
+ } else {
+ jsArgs.add(args);
+ jsCode += ', [#])';
+ }
+
+ return _callHelper(jsCode, jsArgs);
+ }
+
bool _isDirectCallable(DartType t) =>
t is FunctionType || t is InterfaceType && usesJSInterop(t.classNode);
@@ -3951,13 +4000,13 @@
return _coerceBitOperationResultToUnsigned(
node, js.call('~#', notNull(expr)));
}
- return _emitSend(expr, target, op, []);
+ return _emitOperatorCall(expr, target, op, []);
}
if (op == 'unary-') op = '-';
return js.call('$op#', notNull(expr));
}
- return _emitSend(expr, target, op, []);
+ return _emitOperatorCall(expr, target, op, []);
}
/// Bit operations are coerced to values on [0, 2^32). The coercion changes
@@ -4136,7 +4185,7 @@
case '%':
// TODO(sra): We can generate `a % b + 0` if both are non-negative
// (the `+ 0` is to coerce -0.0 to 0).
- return _emitSend(left, target, op, [right]);
+ return _emitOperatorCall(left, target, op, [right]);
case '&':
return bitwise('# & #');
@@ -4161,7 +4210,7 @@
_parentMasksToWidth(node, 31 - shiftCount)) {
return binary('# >> #');
}
- return _emitSend(left, target, op, [right]);
+ return _emitOperatorCall(left, target, op, [right]);
case '<<':
if (_is31BitUnsigned(node)) {
@@ -4172,7 +4221,7 @@
if (_asIntInRange(right, 0, 31) != null) {
return _coerceBitOperationResultToUnsigned(node, binary('# << #'));
}
- return _emitSend(left, target, op, [right]);
+ return _emitOperatorCall(left, target, op, [right]);
default:
// TODO(vsm): When do Dart ops not map to JS?
@@ -4180,7 +4229,7 @@
}
}
- return _emitSend(left, target, op, [right]);
+ return _emitOperatorCall(left, target, op, [right]);
}
JS.Expression _emitEqualityOperator(
@@ -4237,7 +4286,7 @@
/// **Please note** this function does not support method invocation syntax
/// `obj.name(args)` because that could be a getter followed by a call.
/// See [visitMethodInvocation].
- JS.Expression _emitSend(
+ JS.Expression _emitOperatorCall(
Expression receiver, Member target, String name, List<Expression> args) {
// TODO(jmesserly): calls that don't pass `element` are probably broken for
// `super` calls from disallowed super locations.
@@ -4250,7 +4299,7 @@
return _callHelper('$dynamicHelper(#, #)',
[_visitExpression(receiver), _visitExpressionList(args)]);
} else {
- return _callHelper('dsend(#, #, #)', [
+ return _callHelper('dsend(#, #, [#])', [
_visitExpression(receiver),
memberName,
_visitExpressionList(args)
@@ -5071,6 +5120,14 @@
return true;
}
+ bool _reifyTearoff(Member member) {
+ return member is Procedure &&
+ !member.isAccessor &&
+ !_isInForeignJS &&
+ !usesJSInterop(member) &&
+ _reifyFunctionType(member.function);
+ }
+
/// Everything in Dart is an Object and supports the 4 members on Object,
/// so we have to use a runtime helper to handle values such as `null` and
/// native types.
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 d180abd..21da3ab 100644
--- a/pkg/dev_compiler/tool/input_sdk/patch/core_patch.dart
+++ b/pkg/dev_compiler/tool/input_sdk/patch/core_patch.dart
@@ -83,10 +83,9 @@
namedArguments.forEach((symbol, arg) {
JS('', '#[#] = #', map, _symbolToString(symbol), arg);
});
- positionalArguments = new List.from(positionalArguments)..add(map);
+ return dart.dcall(f, positionalArguments, map);
}
- return JS(
- '', '#.apply(null, [#].concat(#))', dart.dcall, f, positionalArguments);
+ return dart.dcall(f, positionalArguments);
}
static Map<String, dynamic> _toMangledNames(
@@ -136,14 +135,22 @@
static int _keyCount = 0;
}
+Null _kNull(_) => null;
+
@patch
class int {
@patch
- static int parse(String source, {int radix, int onError(String source)}) {
+ static int parse(String source,
+ {int radix, @deprecated int onError(String source)}) {
return Primitives.parseInt(source, radix, onError);
}
@patch
+ static int tryParse(String source, {int radix}) {
+ return Primitives.parseInt(source, radix, _kNull);
+ }
+
+ @patch
factory int.fromEnvironment(String name, {int defaultValue}) {
// ignore: const_constructor_throws_exception
throw new UnsupportedError(
@@ -154,9 +161,15 @@
@patch
class double {
@patch
- static double parse(String source, [double onError(String source)]) {
+ static double parse(String source,
+ [@deprecated double onError(String source)]) {
return Primitives.parseDouble(source, onError);
}
+
+ @patch
+ static double tryParse(String source) {
+ return Primitives.parseDouble(source, _kNull);
+ }
}
@patch
@@ -173,6 +186,10 @@
_BigIntImpl.parse(source, radix: radix);
@patch
+ static BigInt tryParse(String source, {int radix}) =>
+ _BigIntImpl._tryParse(source, radix: radix);
+
+ @patch
factory BigInt.from(num value) = _BigIntImpl.from;
}
diff --git a/pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/classes.dart b/pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/classes.dart
index b742f40..48ef1ea 100644
--- a/pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/classes.dart
+++ b/pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/classes.dart
@@ -20,10 +20,10 @@
var toProto = JS('', '#.prototype', to);
var fromProto = JS('', '#.prototype', from);
_copyMembers(toProto, fromProto);
- copySignature(to, from, _methodSig);
- copySignature(to, from, _fieldSig);
- copySignature(to, from, _getterSig);
- copySignature(to, from, _setterSig);
+ _mixinSignature(to, from, _methodSig);
+ _mixinSignature(to, from, _fieldSig);
+ _mixinSignature(to, from, _getterSig);
+ _mixinSignature(to, from, _setterSig);
}
void _copyMembers(to, from) {
@@ -81,18 +81,15 @@
defineProperty(to, name, desc);
}
-void copySignature(to, from, signatureField) {
- defineLazyField(
- to,
- signatureField,
- JS('', '{ get: # }', () {
- var baseSignature = JS('', '#.__proto__[#]', to, signatureField);
- var fromSignature = JS('', '#[#]', from, signatureField);
- if (fromSignature == null) return baseSignature;
- var toSignature = JS('', '{ __proto__: # }', baseSignature);
- copyProperties(toSignature, fromSignature);
- return toSignature;
- }));
+void _mixinSignature(to, from, kind) {
+ JS('', '#[#] = #', to, kind, () {
+ var baseMembers = _getMembers(JS('', '#.__proto__', to), kind);
+ var fromMembers = _getMembers(from, kind);
+ if (fromMembers == null) return baseMembers;
+ var toSignature = JS('', '{ __proto__: # }', baseMembers);
+ copyProperties(toSignature, fromMembers);
+ return toSignature;
+ });
}
final _mixin = JS('', 'Symbol("mixin")');
@@ -162,7 +159,6 @@
List getGenericArgs(type) =>
JS('List', '#', safeGetOwnProperty(type, _typeArguments));
-// TODO(vsm): Collapse into one expando.
final _constructorSig = JS('', 'Symbol("sigCtor")');
final _methodSig = JS('', 'Symbol("sigMethod")');
final _fieldSig = JS('', 'Symbol("sigField")');
@@ -174,17 +170,15 @@
final _staticSetterSig = JS('', 'Symbol("sigStaticSetter")');
final _genericTypeCtor = JS('', 'Symbol("genericType")');
-// TODO(vsm): Collapse this as well - just provide a dart map to mirrors code.
-// These are queried by mirrors code.
-getConstructors(value) => JS('', '#[#]', value, _constructorSig);
-getMethods(value) => JS('', '#[#]', value, _methodSig);
-getFields(value) => JS('', '#[#]', value, _fieldSig);
-getGetters(value) => JS('', '#[#]', value, _getterSig);
-getSetters(value) => JS('', '#[#]', value, _setterSig);
-getStaticMethods(value) => JS('', '#[#]', value, _staticMethodSig);
-getStaticFields(value) => JS('', '#[#]', value, _staticFieldSig);
-getStaticGetters(value) => JS('', '#[#]', value, _staticGetterSig);
-getStaticSetters(value) => JS('', '#[#]', value, _staticSetterSig);
+getConstructors(value) => _getMembers(value, _constructorSig);
+getMethods(value) => _getMembers(value, _methodSig);
+getFields(value) => _getMembers(value, _fieldSig);
+getGetters(value) => _getMembers(value, _getterSig);
+getSetters(value) => _getMembers(value, _setterSig);
+getStaticMethods(value) => _getMembers(value, _staticMethodSig);
+getStaticFields(value) => _getMembers(value, _staticFieldSig);
+getStaticGetters(value) => _getMembers(value, _staticGetterSig);
+getStaticSetters(value) => _getMembers(value, _staticSetterSig);
getGenericTypeCtor(value) => JS('', '#[#]', value, _genericTypeCtor);
@@ -210,32 +204,27 @@
/// Get the type of a method from a type using the stored signature
getMethodType(type, name) {
- var m = JS('', '#[#]', type, _methodSig);
+ var m = getMethods(type);
return m != null ? JS('', '#[#]', m, name) : null;
}
/// Gets the type of the corresponding setter (this includes writable fields).
getSetterType(type, name) {
- var signature = JS('', '#[#]', type, _setterSig);
- if (signature != null) {
- var type = JS('', '#[#]', signature, name);
+ var setters = getSetters(type);
+ if (setters != null) {
+ var type = JS('', '#[#]', setters, name);
if (type != null) {
- // TODO(jmesserly): it would be nice not to encode setters with a full
- // function type.
if (JS('bool', '# instanceof Array', type)) {
// The type has metadata attached. Pull out just the type.
- // TODO(vsm): Come up with a more robust encoding for this or remove
- // if we can deprecate mirrors.
- // Essentially, we've got a FunctionType or a
- // [FunctionType, metadata1, ..., metadataN].
- type = JS('', '#[0]', type);
+ // TODO(jmesserly): remove when we remove mirrors
+ return JS('', '#[0]', type);
}
- return JS('', '#.args[0]', type);
+ return type;
}
}
- signature = JS('', '#[#]', type, _fieldSig);
- if (signature != null) {
- var fieldInfo = JS('', '#[#]', signature, name);
+ var fields = getFields(type);
+ if (fields != null) {
+ var fieldInfo = JS('', '#[#]', fields, name);
if (fieldInfo != null && JS('bool', '!#.isFinal', fieldInfo)) {
return JS('', '#.type', fieldInfo);
}
@@ -252,46 +241,51 @@
/// Get the type of a constructor from a class using the stored signature
/// If name is undefined, returns the type of the default constructor
/// Returns undefined if the constructor is not found.
-classGetConstructorType(cls, name) => JS('', '''(() => {
- if(!$name) $name = 'new';
- if ($cls === void 0) return void 0;
- if ($cls == null) return void 0;
- let sigCtor = $cls[$_constructorSig];
- if (sigCtor === void 0) return void 0;
- return sigCtor[$name];
-})()''');
+classGetConstructorType(cls, name) {
+ if (cls == null) return null;
+ if (name == null) name = 'new';
+ var ctors = getConstructors(cls);
+ return ctors != null ? JS('', '#[#]', ctors, name) : null;
+}
-void setMethodSignature(f, sigF) => defineLazyGetter(f, _methodSig, sigF);
-void setFieldSignature(f, sigF) => defineLazyGetter(f, _fieldSig, sigF);
-void setGetterSignature(f, sigF) => defineLazyGetter(f, _getterSig, sigF);
-void setSetterSignature(f, sigF) => defineLazyGetter(f, _setterSig, sigF);
+void setMethodSignature(f, sigF) => JS('', '#[#] = #', f, _methodSig, sigF);
+void setFieldSignature(f, sigF) => JS('', '#[#] = #', f, _fieldSig, sigF);
+void setGetterSignature(f, sigF) => JS('', '#[#] = #', f, _getterSig, sigF);
+void setSetterSignature(f, sigF) => JS('', '#[#] = #', f, _setterSig, sigF);
// Set up the constructor signature field on the constructor
void setConstructorSignature(f, sigF) =>
- defineLazyGetter(f, _constructorSig, sigF);
+ JS('', '#[#] = #', f, _constructorSig, sigF);
// Set up the static signature field on the constructor
void setStaticMethodSignature(f, sigF) =>
- defineLazyGetter(f, _staticMethodSig, sigF);
+ JS('', '#[#] = #', f, _staticMethodSig, sigF);
void setStaticFieldSignature(f, sigF) =>
- defineLazyGetter(f, _staticFieldSig, sigF);
+ JS('', '#[#] = #', f, _staticFieldSig, sigF);
void setStaticGetterSignature(f, sigF) =>
- defineLazyGetter(f, _staticGetterSig, sigF);
+ JS('', '#[#] = #', f, _staticGetterSig, sigF);
void setStaticSetterSignature(f, sigF) =>
- defineLazyGetter(f, _staticSetterSig, sigF);
+ JS('', '#[#] = #', f, _staticSetterSig, sigF);
-bool _hasSigEntry(type, kind, name) {
+_getMembers(type, kind) {
var sig = JS('', '#[#]', type, kind);
+ return JS('bool', 'typeof # == "function"', sig)
+ ? JS('', '#[#] = #', type, kind, sig())
+ : sig;
+}
+
+bool _hasMember(type, kind, name) {
+ var sig = _getMembers(type, kind);
return sig != null && JS('bool', '# in #', name, sig);
}
-bool hasMethod(type, name) => _hasSigEntry(type, _methodSig, name);
-bool hasGetter(type, name) => _hasSigEntry(type, _getterSig, name);
-bool hasSetter(type, name) => _hasSigEntry(type, _setterSig, name);
-bool hasField(type, name) => _hasSigEntry(type, _fieldSig, name);
+bool hasMethod(type, name) => _hasMember(type, _methodSig, name);
+bool hasGetter(type, name) => _hasMember(type, _getterSig, name);
+bool hasSetter(type, name) => _hasMember(type, _setterSig, name);
+bool hasField(type, name) => _hasMember(type, _fieldSig, name);
final _extensionType = JS('', 'Symbol("extensionType")');
@@ -355,15 +349,10 @@
if (JS('bool', '# !== #', dartExtType, JSFunction)) {
JS('', '#[#] = #', jsProto, _extensionType, dartExtType);
}
-
- defineLazyGetter(
- jsType, _methodSig, JS('', '() => #[#]', dartExtType, _methodSig));
- defineLazyGetter(
- jsType, _fieldSig, JS('', '() => #[#]', dartExtType, _fieldSig));
- defineLazyGetter(
- jsType, _getterSig, JS('', '() => #[#]', dartExtType, _getterSig));
- defineLazyGetter(
- jsType, _setterSig, JS('', '() => #[#]', dartExtType, _setterSig));
+ JS('', '#[#] = #[#]', jsType, _methodSig, dartExtType, _methodSig);
+ JS('', '#[#] = #[#]', jsType, _fieldSig, dartExtType, _fieldSig);
+ JS('', '#[#] = #[#]', jsType, _getterSig, dartExtType, _getterSig);
+ JS('', '#[#] = #[#]', jsType, _setterSig, dartExtType, _setterSig);
}
/// Apply the previously registered extension to the type of [nativeObject].
diff --git a/pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/operations.dart b/pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/operations.dart
index ecdc27c..f094a48 100644
--- a/pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/operations.dart
+++ b/pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/operations.dart
@@ -79,14 +79,6 @@
return f;
}
-tagStatic(type, name) {
- var f = JS('', '#.#', type, name);
- if (JS('', '#[#]', f, _runtimeType) == null) {
- JS('', '#[#] = #[#][#]', f, _runtimeType, type, _staticMethodSig, name);
- }
- return f;
-}
-
/// Instantiate a generic method.
///
/// We need to apply the type arguments both to the function, as well as its
@@ -95,7 +87,7 @@
var result =
JS('', '(...args) => #.apply(null, #.concat(args))', f, typeArgs);
var sig = JS('', '#[#].instantiate(#)', f, _runtimeType, typeArgs);
- tag(result, sig);
+ fn(result, sig);
return result;
}
@@ -161,45 +153,46 @@
/// Check that a function of a given type can be applied to
/// actuals.
-_checkApply(type, actuals) => JS('', '''(() => {
+bool _checkApply(ftype, List actuals, namedActuals) {
// TODO(vsm): Remove when we no longer need mirrors metadata.
// An array is used to encode annotations attached to the type.
- if ($type instanceof Array) {
- $type = type[0];
- }
- if ($actuals.length < $type.args.length) return false;
- let index = 0;
- for(let i = 0; i < $type.args.length; ++i) {
- $type.args[i]._check($actuals[i]);
- ++index;
- }
- if ($actuals.length == $type.args.length) return true;
- let extras = $actuals.length - $type.args.length;
- if ($type.optionals.length > 0) {
- if (extras > $type.optionals.length) return false;
- for(let i = 0, j=index; i < extras; ++i, ++j) {
- $type.optionals[i]._check($actuals[j]);
- }
- return true;
- }
- // TODO(leafp): We can't tell when someone might be calling
- // something expecting an optional argument with named arguments
+ FunctionType type =
+ JS('!', '# instanceof Array ? #[0] : #', ftype, ftype, ftype);
- if (extras != 1) return false;
- // An empty named list means no named arguments
- if ($getOwnPropertyNames($type.named).length == 0) return false;
- let opts = $actuals[index];
- let names = $getOwnPropertyNames(opts);
- // Type is something other than a map
- if (names.length == 0) return false;
- for (var name of names) {
- if (!($hasOwnProperty.call($type.named, name))) {
- return false;
+ // Check for too few required arguments.
+ var actualsCount = JS('int', '#.length', actuals);
+ var required = type.args;
+ var requiredCount = JS('int', '#.length', required);
+ if (actualsCount < requiredCount) return false;
+
+ // Check for too many postional arguments.
+ var extras = actualsCount - requiredCount;
+ var optionals = type.optionals;
+ if (extras > JS('int', '#.length', optionals)) return false;
+
+ // Check if we have invalid named arguments.
+ Iterable names;
+ var named = type.named;
+ if (namedActuals != null) {
+ names = getOwnPropertyNames(namedActuals);
+ for (var name in names) {
+ if (!JS('bool', '#.hasOwnProperty(#)', named, name)) return false;
}
- $type.named[name]._check(opts[name]);
+ }
+ // Now that we know the signature matches, we can perform type checks.
+ for (var i = 0; i < requiredCount; ++i) {
+ JS('', '#[#]._check(#[#])', required, i, actuals, i);
+ }
+ for (var i = 0; i < extras; ++i) {
+ JS('', '#[#]._check(#[#])', optionals, i, actuals, i + requiredCount);
+ }
+ if (names != null) {
+ for (var name in names) {
+ JS('', '#[#]._check(#[#])', named, name, namedActuals, name);
+ }
}
return true;
-})()''');
+}
_toSymbolName(symbol) => JS('', '''(() => {
let str = $symbol.toString();
@@ -241,28 +234,16 @@
: JS('Symbol', '#(#.new(# + "="))', const_, Symbol, _toDisplayName(name));
}
-/// Extracts the named argument array from a list of arguments, and returns it.
-// TODO(jmesserly): we need to handle named arguments better.
-extractNamedArgs(args) {
- if (JS('bool', '#.length > 0', args)) {
- var last = JS('', '#[#.length - 1]', args, args);
- if (JS(
- 'bool', '# != null && #.__proto__ === Object.prototype', last, last)) {
- return JS('', '#.pop()', args);
- }
- }
- return null;
-}
-
-_checkAndCall(f, ftype, obj, typeArgs, args, name) => JS('', '''(() => {
+_checkAndCall(f, ftype, obj, typeArgs, args, named, displayName) =>
+ JS('', '''(() => {
$trackCall($obj);
let originalTarget = obj === void 0 ? f : obj;
function callNSM() {
return $noSuchMethod(originalTarget, new $InvocationImpl.new(
- $name, $args, {
- namedArguments: ${extractNamedArgs(args)},
+ $displayName, $args, {
+ namedArguments: $named,
typeArguments: $typeArgs,
isMethod: true
}));
@@ -288,6 +269,8 @@
$throwTypeError('call to JS object `' + $obj +
'` with type arguments <' + $typeArgs + '> is not supported.');
}
+
+ if ($named != null) $args.push($named);
return $f.apply($obj, $args);
}
@@ -307,26 +290,19 @@
return callNSM();
}
- if ($_checkApply($ftype, $args)) {
- if ($typeArgs != null) {
- return $f.apply($obj, $typeArgs.concat($args));
- }
+ if (${_checkApply(ftype, args, named)}) {
+ if ($typeArgs != null) $args = $typeArgs.concat($args);
+ if ($named != null) $args.push($named);
return $f.apply($obj, $args);
}
-
- // TODO(leafp): throw a type error (rather than NSM)
- // if the arity matches but the types are wrong.
- // TODO(jmesserly): nSM should include type args?
return callNSM();
})()''');
-dcall(f, @rest args) => callFunction(f, null, args);
+dcall(f, args, [named = undefined]) =>
+ _checkAndCall(f, null, JS('', 'void 0'), null, args, named, 'call');
-dgcall(f, typeArgs, @rest args) => callFunction(f, typeArgs, args);
-
-callFunction(f, typeArgs, args) {
- return _checkAndCall(f, null, JS('', 'void 0'), typeArgs, args, 'call');
-}
+dgcall(f, typeArgs, args, [named = undefined]) =>
+ _checkAndCall(f, null, JS('', 'void 0'), typeArgs, args, named, 'call');
/// Helper for REPL dynamic invocation variants that make a best effort to
/// enable accessing private members across library boundaries.
@@ -373,18 +349,19 @@
dputRepl(obj, field, value) =>
_dhelperRepl(obj, field, (f) => dput(obj, f, value, false));
-callMethodRepl(obj, method, typeArgs, args) => _dhelperRepl(
- obj, method, (f) => callMethod(obj, f, typeArgs, args, method));
+callMethodRepl(obj, method, typeArgs, args, named) => _dhelperRepl(
+ obj, method, (f) => callMethod(obj, f, typeArgs, args, method, named));
-dsendRepl(obj, method, @rest args) => callMethodRepl(obj, method, null, args);
+dsendRepl(obj, method, args, [named = undefined]) =>
+ callMethodRepl(obj, method, null, args, named);
-dgsendRepl(obj, typeArgs, method, @rest args) =>
- callMethodRepl(obj, method, typeArgs, args);
+dgsendRepl(obj, typeArgs, method, args, [named = undefined]) =>
+ callMethodRepl(obj, method, typeArgs, args, named);
/// Shared code for dsend, dindex, and dsetindex.
-callMethod(obj, name, typeArgs, args, displayName) {
+callMethod(obj, name, typeArgs, args, named, displayName) {
if (JS('bool', 'typeof # == "function" && # == "call"', obj, name)) {
- return callFunction(obj, typeArgs, args);
+ return dgcall(obj, typeArgs, args, named);
}
var symbol = _canonicalMember(obj, name);
if (symbol == null) {
@@ -395,18 +372,19 @@
var type = getType(obj);
var ftype = getMethodType(type, symbol);
// No such method if dart object and ftype is missing.
- return _checkAndCall(f, ftype, obj, typeArgs, args, displayName);
+ return _checkAndCall(f, ftype, obj, typeArgs, args, named, displayName);
}
-dsend(obj, method, @rest args) => callMethod(obj, method, null, args, method);
+dsend(obj, method, args, [named = undefined]) =>
+ callMethod(obj, method, null, args, named, method);
-dgsend(obj, typeArgs, method, @rest args) =>
- callMethod(obj, method, typeArgs, args, method);
+dgsend(obj, typeArgs, method, args, [named = undefined]) =>
+ callMethod(obj, method, typeArgs, args, named, method);
-dindex(obj, index) => callMethod(obj, '_get', null, JS('', '[#]', index), '[]');
+dindex(obj, index) => callMethod(obj, '_get', null, [index], null, '[]');
dsetindex(obj, index, value) =>
- callMethod(obj, '_set', null, JS('', '[#, #]', index, value), '[]=');
+ callMethod(obj, '_set', null, [index, value], null, '[]=');
/// TODO(leafp): This duplicates code in types.dart.
/// I haven't found a way to factor it out that makes the
@@ -564,7 +542,7 @@
bool dassert(value) {
if (JS('bool', '# != null && #[#] instanceof #', value, value, _runtimeType,
AbstractFunctionType)) {
- value = JS('', '#(#)', dcall, value);
+ value = dcall(value, []);
}
return dtest(value);
}
diff --git a/pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/rtti.dart b/pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/rtti.dart
index feb98ad..b1db5b6 100644
--- a/pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/rtti.dart
+++ b/pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/rtti.dart
@@ -44,29 +44,16 @@
/// different from the above objects, and are created by calling `wrapType()`
/// on a runtime type.
-/// Tag a closure with a type, using one of two forms:
+/// Tag a closure with a type:
///
-/// `dart.fn(cls)` marks cls has having no optional or named
-/// parameters, with all argument and return types as dynamic.
-///
-/// `dart.fn(cls, rType, argsT, extras)` marks cls as having the
-/// runtime type dart.functionType(rType, argsT, extras).
-///
-/// Note that since we are producing a type for a concrete function,
-/// it is sound to use the definite arrow type.
-///
+/// `dart.fn(closure, t)` marks [closure] has having the runtime type [t].
fn(closure, t) {
- if (t == null) {
- // No type arguments, it's all dynamic
- t = fnType(JS('', '#', dynamic),
- JS('', 'Array(#.length).fill(#)', closure, dynamic), JS('', 'void 0'));
- }
- tag(closure, t);
+ JS('', '#[#] = #', closure, _runtimeType, t);
return closure;
}
lazyFn(closure, computeType) {
- tagLazy(closure, computeType);
+ defineLazyGetter(closure, _runtimeType, computeType);
return closure;
}
@@ -132,19 +119,10 @@
/// Return the module name for a raw library object.
getModuleName(value) => JS('', '#[#]', value, _moduleName);
-/// Tag the runtime type of [value] to be type [t].
-void tag(value, t) {
- JS('', '#[#] = #', value, _runtimeType, t);
-}
-
void tagComputed(value, compute) {
defineGetter(value, _runtimeType, compute);
}
-void tagLazy(value, compute) {
- defineLazyGetter(value, _runtimeType, compute);
-}
-
var _loadedModules = JS('', 'new Map()');
var _loadedSourceMaps = JS('', 'new Map()');
diff --git a/pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/types.dart b/pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/types.dart
index 3352609..e9b6a27 100644
--- a/pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/types.dart
+++ b/pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/types.dart
@@ -175,7 +175,7 @@
}
@JSExportName('void')
-final _void = new Void();
+final void_ = new Void();
class Bottom extends TypeRep {
toString() => 'bottom';
@@ -812,7 +812,7 @@
// definitively rejected.
// For `void` we will give the same answer as the VM, so don't return null.
- if (ret1 === $_void) return $_isTop(ret2);
+ if (ret1 === $void_) return $_isTop(ret2);
if (!$_isSubtype(ret1, ret2, $isCovariant)) return null;
return true;
@@ -850,7 +850,7 @@
return _isTop(JS('', '#[0]', getGenericArgs(type)));
}
return JS('bool', '# == # || # == # || # == #', type, Object, type, dynamic,
- type, _void);
+ type, void_);
}
bool _isFutureOr(type) =>
@@ -1070,7 +1070,7 @@
// The signature of this method guarantees that instance is a T, so we
// should have a valid non-empty list at this point.
assert(typeArgs != null && typeArgs.isNotEmpty);
- return callFunction(f, typeArgs, []);
+ return dgcall(f, typeArgs, []);
}
// Let t2 = T<T1, ..., Tn>
diff --git a/pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/utils.dart b/pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/utils.dart
index 44f9f8b..590f850 100644
--- a/pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/utils.dart
+++ b/pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/utils.dart
@@ -43,8 +43,6 @@
final Function(Object) getOwnPropertySymbols =
JS('', 'Object.getOwnPropertySymbols');
-final hasOwnProperty = JS('', 'Object.prototype.hasOwnProperty');
-
/// This error indicates a strong mode specific failure, other than a type
/// assertion failure (TypeError) or CastError.
void throwTypeError(String message) {
diff --git a/pkg/dev_compiler/tool/input_sdk/private/debugger.dart b/pkg/dev_compiler/tool/input_sdk/private/debugger.dart
index 96879ad..42128b2 100644
--- a/pkg/dev_compiler/tool/input_sdk/private/debugger.dart
+++ b/pkg/dev_compiler/tool/input_sdk/private/debugger.dart
@@ -89,7 +89,7 @@
var value = safeGetProperty(object, symbol);
// Tag the function with its runtime type.
if (tagTypes && _typeof(value) == 'function') {
- dart.tag(value, JS('', '#[#]', sig, symbol));
+ dart.fn(value, JS('', '#[#]', sig, symbol));
}
properties.add(new NameValuePair(name: dartName, value: value));
}
@@ -99,7 +99,7 @@
if (skippedNames.contains(name)) continue;
// Tag the function with its runtime type.
if (tagTypes && _typeof(value) == 'function') {
- dart.tag(value, JS('', '#[#]', sig, name));
+ dart.fn(value, JS('', '#[#]', sig, name));
}
properties.add(new NameValuePair(name: name, value: value));
}
diff --git a/pkg/dev_compiler/tool/input_sdk/private/js_mirrors.dart b/pkg/dev_compiler/tool/input_sdk/private/js_mirrors.dart
index ccedc0f..1694f8e 100644
--- a/pkg/dev_compiler/tool/input_sdk/private/js_mirrors.dart
+++ b/pkg/dev_compiler/tool/input_sdk/private/js_mirrors.dart
@@ -128,6 +128,7 @@
}
dynamic _toJsMap(Map<Symbol, dynamic> map) {
+ if (map == null) return null;
var obj = JS('', '{}');
map.forEach((Symbol key, value) {
JS('', '#[#] = #', obj, getName(key), value);
@@ -199,11 +200,8 @@
InstanceMirror invoke(Symbol symbol, List<dynamic> args,
[Map<Symbol, dynamic> namedArgs]) {
var name = _getMember(symbol);
- if (namedArgs != null) {
- args = new List.from(args);
- args.add(_toJsMap(namedArgs));
- }
- var result = dart.callMethod(reflectee, name, null, args, name);
+ var result =
+ dart.callMethod(reflectee, name, null, args, _toJsMap(namedArgs), name);
return reflect(result);
}
@@ -214,11 +212,7 @@
JsClosureMirror._(reflectee) : super._(reflectee);
InstanceMirror apply(List<dynamic> args, [Map<Symbol, dynamic> namedArgs]) {
- if (namedArgs != null) {
- args = new List.from(args);
- args.add(_toJsMap(namedArgs));
- }
- var result = dart.dcall(reflectee, args);
+ var result = dart.dcall(reflectee, args, _toJsMap(namedArgs));
return reflect(result);
}
}
@@ -295,16 +289,22 @@
new JsMethodMirror._instanceMethod(this, symbol, ft);
});
var getters = _toDartMap(dart.getGetters(unwrapped));
- getters.forEach((symbol, ft) {
+ getters.forEach((symbol, type) {
var name = getName(symbol);
+ if (JS('bool', '# instanceof Array', type)) {
+ JS('', '#[0] = #(#[0], [])', type, dart.fnType, type);
+ } else {
+ type = dart.fnType(type, []);
+ }
_declarations[symbol] =
- new JsMethodMirror._instanceMethod(this, symbol, ft);
+ new JsMethodMirror._instanceMethod(this, symbol, type);
});
var setters = _toDartMap(dart.getSetters(unwrapped));
- setters.forEach((symbol, ft) {
+ setters.forEach((symbol, type) {
var name = getName(symbol) + '=';
// Create a separate symbol for the setter.
symbol = new PrivateSymbol(name, _getESSymbol(symbol));
+ var ft = dart.fnType(dart.void_, [type]);
_declarations[symbol] =
new JsMethodMirror._instanceMethod(this, symbol, ft);
});
@@ -319,14 +319,20 @@
new JsMethodMirror._staticMethod(this, symbol, ft);
});
var staticGetters = _toDartMap(dart.getStaticGetters(unwrapped));
- staticGetters.forEach((symbol, ft) {
+ staticGetters.forEach((symbol, type) {
var name = getName(symbol);
+ if (JS('bool', '# instanceof Array', type)) {
+ JS('', '#[0] = #(#[0], [])', type, dart.fnType, type);
+ } else {
+ type = dart.fnType(type, []);
+ }
_declarations[symbol] =
- new JsMethodMirror._staticMethod(this, symbol, ft);
+ new JsMethodMirror._staticMethod(this, symbol, type);
});
var staticSetters = _toDartMap(dart.getStaticSetters(unwrapped));
- staticSetters.forEach((symbol, ft) {
+ staticSetters.forEach((symbol, type) {
var name = getName(symbol);
+ var ft = dart.fnType(dart.void_, [type]);
_declarations[symbol] =
new JsMethodMirror._staticMethod(this, symbol, ft);
});
diff --git a/pkg/expect/lib/expect.dart b/pkg/expect/lib/expect.dart
index c8e0013..eea2ab4 100644
--- a/pkg/expect/lib/expect.dart
+++ b/pkg/expect/lib/expect.dart
@@ -179,22 +179,16 @@
}
/**
- * Checks whether the expected and actual values are *not* identical
- * (using `identical`).
+ * Finds equivalence classes of objects (by index) wrt. identity.
+ *
+ * Returns a list of lists of identical object indices per object.
+ * That is, `objects[i]` is identical to objects with indices in
+ * `_findEquivalences(objects)[i]`.
+ *
+ * Uses `null` for objects that are only identical to themselves.
*/
- static void notIdentical(var unexpected, var actual, [String reason = null]) {
- if (!_identical(unexpected, actual)) return;
- String msg = _getMessage(reason);
- _fail("Expect.notIdentical(expected and actual: <$actual>$msg) fails.");
- }
-
- /**
- * Checks that no two [objects] are `identical`.
- */
- static void allDistinct(List<Object> objects, [String reason = null]) {
- String msg = _getMessage(reason);
+ static List<List<int>> _findEquivalences(List<Object> objects) {
var equivalences = new List<List<int>>(objects.length);
- bool hasEquivalence = false;
for (int i = 0; i < objects.length; i++) {
if (equivalences[i] != null) continue;
var o = objects[i];
@@ -202,12 +196,14 @@
if (equivalences[j] != null) continue;
if (_identical(o, objects[j])) {
equivalences[j] = (equivalences[i] ??= <int>[i])..add(j);
- hasEquivalence = true;
}
}
}
- if (!hasEquivalence) return;
- var buffer = new StringBuffer("Expect.allDistinct([");
+ return equivalences;
+ }
+
+ static void _writeEquivalences(
+ List<Object> objects, List<List<int>> equivalences, StringBuffer buffer) {
var separator = "";
for (int i = 0; i < objects.length; i++) {
buffer.write(separator);
@@ -223,6 +219,47 @@
}
}
}
+ }
+
+ static void allIdentical(Iterable<Object> objects, [String reason]) {
+ if (objects.length <= 1) return;
+ String msg = _getMessage(reason);
+ var equivalences = _findEquivalences(objects);
+ var first = equivalences[0];
+ if (first != null && first.length == objects.length) return;
+ var buffer = new StringBuffer("Expect.allIdentical([");
+ _writeEquivalences(objects, equivalences, buffer);
+ buffer..write("]")..write(msg)..write(")");
+ _fail(buffer.toString());
+ }
+
+ /**
+ * Checks whether the expected and actual values are *not* identical
+ * (using `identical`).
+ */
+ static void notIdentical(var unexpected, var actual, [String reason = null]) {
+ if (!_identical(unexpected, actual)) return;
+ String msg = _getMessage(reason);
+ _fail("Expect.notIdentical(expected and actual: <$actual>$msg) fails.");
+ }
+
+ /**
+ * Checks that no two [objects] are `identical`.
+ */
+ static void allDistinct(List<Object> objects, [String reason = null]) {
+ String msg = _getMessage(reason);
+ var equivalences = _findEquivalences(objects);
+
+ bool hasEquivalence = false;
+ for (int i = 0; i < equivalences.length; i++) {
+ if (equivalences[i] != null) {
+ hasEquivalence = true;
+ break;
+ }
+ }
+ if (!hasEquivalence) return;
+ var buffer = new StringBuffer("Expect.allDistinct([");
+ _writeEquivalences(objects, equivalences, buffer);
buffer..write("]")..write(msg)..write(")");
_fail(buffer.toString());
}
diff --git a/pkg/front_end/lib/src/base/processed_options.dart b/pkg/front_end/lib/src/base/processed_options.dart
index 02f7650..0c0dc02 100644
--- a/pkg/front_end/lib/src/base/processed_options.dart
+++ b/pkg/front_end/lib/src/base/processed_options.dart
@@ -93,6 +93,11 @@
/// not been computed yet.
Packages _packages;
+ /// The uri for .packages derived from the options, or `null` if the package
+ /// map has not been computed yet or there is no .packages in effect.
+ Uri _packagesUri;
+ Uri get packagesUri => _packagesUri;
+
/// The object that knows how to resolve "package:" and "dart:" URIs,
/// or `null` if it has not been computed yet.
UriTranslatorImpl _uriTranslator;
@@ -445,6 +450,7 @@
/// required to locate/read the packages file.
Future<Packages> _getPackages() async {
if (_packages != null) return _packages;
+ _packagesUri = null;
if (_raw.packagesFileUri != null) {
return _packages = await createPackagesFromFile(_raw.packagesFileUri);
}
@@ -478,8 +484,10 @@
try {
List<int> contents = await fileSystem.entityForUri(file).readAsBytes();
Map<String, Uri> map = package_config.parse(contents, file);
+ _packagesUri = file;
return new MapPackages(map);
} catch (e) {
+ _packagesUri = null;
report(
templateCannotReadPackagesFile
.withArguments("$e")
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 f1d773d..55c6075 100644
--- a/pkg/front_end/lib/src/fasta/fasta_codes_generated.dart
+++ b/pkg/front_end/lib/src/fasta/fasta_codes_generated.dart
@@ -1121,32 +1121,28 @@
tip: r"""Try removing all but one 'deferred' keyword.""");
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
-const Template<
- Message Function(
- String
- string)> templateDuplicateLabelInSwitchStatement = const Template<
- Message Function(String string)>(
- messageTemplate:
- r"""The label '#string' was already used in this switch statement.""",
- tipTemplate: r"""Try choosing a different name for this label.""",
- withArguments: _withArgumentsDuplicateLabelInSwitchStatement);
+const Template<Message Function(String name)>
+ templateDuplicateLabelInSwitchStatement =
+ const Template<Message Function(String name)>(
+ messageTemplate:
+ r"""The label '#name' was already used in this switch statement.""",
+ tipTemplate: r"""Try choosing a different name for this label.""",
+ withArguments: _withArgumentsDuplicateLabelInSwitchStatement);
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
-const Code<Message Function(String string)>
- codeDuplicateLabelInSwitchStatement =
- const Code<Message Function(String string)>(
- "DuplicateLabelInSwitchStatement",
+const Code<Message Function(String name)> codeDuplicateLabelInSwitchStatement =
+ const Code<Message Function(String name)>("DuplicateLabelInSwitchStatement",
templateDuplicateLabelInSwitchStatement,
analyzerCode: "DUPLICATE_LABEL_IN_SWITCH_STATEMENT",
dart2jsCode: "*fatal*");
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
-Message _withArgumentsDuplicateLabelInSwitchStatement(String string) {
+Message _withArgumentsDuplicateLabelInSwitchStatement(String name) {
return new Message(codeDuplicateLabelInSwitchStatement,
message:
- """The label '$string' was already used in this switch statement.""",
+ """The label '$name' was already used in this switch statement.""",
tip: """Try choosing a different name for this label.""",
- arguments: {'string': string});
+ arguments: {'name': name});
}
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
@@ -3326,6 +3322,30 @@
r"""Try removing 'void' keyword or replace it with 'var', 'final', or a type.""");
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
+const Template<
+ Message Function(String name)> templateLabelNotFound = const Template<
+ Message Function(String name)>(
+ messageTemplate: r"""Can't find label '#name'.""",
+ tipTemplate:
+ r"""Try defining the label, or correcting the name to match an existing label.""",
+ withArguments: _withArgumentsLabelNotFound);
+
+// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
+const Code<Message Function(String name)> codeLabelNotFound =
+ const Code<Message Function(String name)>(
+ "LabelNotFound", templateLabelNotFound,
+ analyzerCode: "LABEL_UNDEFINED", dart2jsCode: "*fatal*");
+
+// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
+Message _withArgumentsLabelNotFound(String name) {
+ return new Message(codeLabelNotFound,
+ message: """Can't find label '$name'.""",
+ tip:
+ """Try defining the label, or correcting the name to match an existing label.""",
+ arguments: {'name': name});
+}
+
+// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
const Code<Null> codeLibraryDirectiveNotFirst = messageLibraryDirectiveNotFirst;
// DO NOT EDIT. THIS FILE IS GENERATED. SEE TOP OF FILE.
diff --git a/pkg/front_end/lib/src/fasta/incremental_compiler.dart b/pkg/front_end/lib/src/fasta/incremental_compiler.dart
index 9af08b2..0ad547e 100644
--- a/pkg/front_end/lib/src/fasta/incremental_compiler.dart
+++ b/pkg/front_end/lib/src/fasta/incremental_compiler.dart
@@ -42,7 +42,7 @@
final Ticker ticker;
- List<Uri> invalidatedUris = <Uri>[];
+ Set<Uri> invalidatedUris = new Set<Uri>();
DillTarget dillLoadedData;
Map<Uri, Source> dillLoadedDataUriToSource = <Uri, Source>{};
@@ -64,10 +64,12 @@
return context.runInContext<Future<Component>>((CompilerContext c) async {
IncrementalCompilerData data = new IncrementalCompilerData();
- // TODO(jensj): We should only bypass the cache if .packages has been
- // invalidated, but Flutter does not currently invalidate .packages.
+ bool bypassCache = false;
+ if (this.invalidatedUris.contains(c.options.packagesUri)) {
+ bypassCache = true;
+ }
UriTranslator uriTranslator =
- await c.options.getUriTranslator(bypassCache: true);
+ await c.options.getUriTranslator(bypassCache: bypassCache);
ticker.logMs("Read packages file");
if (dillLoadedData == null) {
@@ -101,7 +103,7 @@
userBuilders = <Uri, LibraryBuilder>{};
platformBuilders = <LibraryBuilder>[];
dillLoadedData.loader.builders.forEach((uri, builder) {
- if (builder.fileUri.scheme == "dart") {
+ if (builder.uri.scheme == "dart") {
platformBuilders.add(builder);
} else {
userBuilders[uri] = builder;
@@ -110,7 +112,7 @@
if (userBuilders.isEmpty) userBuilders = null;
}
- List<Uri> invalidatedUris = this.invalidatedUris.toList();
+ Set<Uri> invalidatedUris = this.invalidatedUris.toSet();
this.invalidatedUris.clear();
if (fullComponent) {
invalidatedUris.add(entryPoint);
@@ -123,6 +125,7 @@
for (Uri uri in new Set<Uri>.from(dillLoadedData.loader.builders.keys)
..removeAll(reusedLibraryUris)) {
dillLoadedData.loader.builders.remove(uri);
+ userBuilders?.remove(uri);
}
if (userCode != null) {
@@ -156,7 +159,7 @@
List<Library> librariesWithSdk = userCode.component.libraries;
List<Library> libraries = <Library>[];
for (Library lib in librariesWithSdk) {
- if (lib.fileUri.scheme == "dart") continue;
+ if (lib.importUri.scheme == "dart") continue;
libraries.add(lib);
break;
}
@@ -199,20 +202,20 @@
IncrementalCompilerData data) {
Map<Uri, Library> libraryMap = <Uri, Library>{};
for (Library library in libraries) {
- libraryMap[library.fileUri] = library;
+ libraryMap[library.importUri] = library;
}
List<Uri> worklist = new List<Uri>.from(libraryMap.keys);
- worklist.add(mainMethod?.enclosingLibrary?.fileUri);
+ worklist.add(mainMethod?.enclosingLibrary?.importUri);
if (entry != null) {
worklist.add(entry);
}
Map<Uri, Library> potentiallyReferencedLibraries = <Uri, Library>{};
for (LibraryBuilder library in reusedLibraries) {
- if (library.fileUri.scheme == "dart") continue;
+ if (library.uri.scheme == "dart") continue;
Library lib = library.target;
- potentiallyReferencedLibraries[library.fileUri] = lib;
- libraryMap[library.fileUri] = lib;
+ potentiallyReferencedLibraries[library.uri] = lib;
+ libraryMap[library.uri] = lib;
}
LibraryGraph graph = new LibraryGraph(libraryMap);
@@ -229,7 +232,9 @@
}
}
}
+
for (Uri uri in potentiallyReferencedLibraries.keys) {
+ if (uri.scheme == "package") continue;
userCode.loader.builders.remove(uri);
}
@@ -325,14 +330,11 @@
}
List<LibraryBuilder> computeReusedLibraries(
- Iterable<Uri> invalidatedUris, UriTranslator uriTranslator) {
+ Set<Uri> invalidatedUris, UriTranslator uriTranslator) {
if (userCode == null && userBuilders == null) {
return <LibraryBuilder>[];
}
- // [invalidatedUris] converted to a set.
- Set<Uri> invalidatedFileUris = invalidatedUris.toSet();
-
// Maps all non-platform LibraryBuilders from their import URI.
Map<Uri, LibraryBuilder> builders = <Uri, LibraryBuilder>{};
@@ -340,30 +342,40 @@
// etc.).
List<Uri> invalidatedImportUris = <Uri>[];
+ bool isInvalidated(Uri importUri, Uri fileUri) {
+ if (invalidatedUris.contains(importUri) ||
+ (importUri != fileUri && invalidatedUris.contains(fileUri))) {
+ return true;
+ }
+ if (importUri.scheme == "package" &&
+ uriTranslator.translate(importUri, false) != fileUri) {
+ return true;
+ }
+ return false;
+ }
+
// Compute [builders] and [invalidatedImportUris].
addBuilderAndInvalidateUris(Uri uri, LibraryBuilder library,
[bool recursive = true]) {
builders[uri] = library;
- if (invalidatedFileUris.contains(uri) ||
- (uri != library.fileUri &&
- invalidatedFileUris.contains(library.fileUri)) ||
- (library is DillLibraryBuilder &&
- uri != library.library.fileUri &&
- invalidatedFileUris.contains(library.library.fileUri)) ||
- (library.uri.scheme == "package" &&
- uriTranslator.translate(library.uri, false) !=
- library.target.fileUri)) {
+ if (isInvalidated(uri, library.target.fileUri)) {
invalidatedImportUris.add(uri);
}
- if (!recursive) return;
if (library is SourceLibraryBuilder) {
for (LibraryBuilder part in library.parts) {
- addBuilderAndInvalidateUris(part.uri, part, false);
+ if (isInvalidated(part.uri, part.fileUri)) {
+ invalidatedImportUris.add(part.uri);
+ builders[part.uri] = part;
+ }
}
} else if (library is DillLibraryBuilder) {
- for (LibraryPart part in library.library.parts) {
+ for (LibraryPart part in library.target.parts) {
Uri partUri = library.uri.resolve(part.partUri);
- addBuilderAndInvalidateUris(partUri, library, false);
+ Uri fileUri = library.library.fileUri.resolve(part.partUri);
+ if (isInvalidated(partUri, fileUri)) {
+ invalidatedImportUris.add(partUri);
+ builders[partUri] = library;
+ }
}
}
}
@@ -417,7 +429,10 @@
List<LibraryBuilder> result = <LibraryBuilder>[];
for (LibraryBuilder builder in builders.values) {
if (builder.isPart) continue;
- if (!seenUris.add(builder.fileUri)) continue;
+ // TODO(jensj/ahe): This line can probably go away once
+ // https://dart-review.googlesource.com/47442 lands.
+ if (builder.isPatch) continue;
+ if (!seenUris.add(builder.uri)) continue;
result.add(builder);
}
return result;
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 b3df16c..d446340 100644
--- a/pkg/front_end/lib/src/fasta/kernel/body_builder.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/body_builder.dart
@@ -325,7 +325,13 @@
switchScope.unclaimedForwardDeclarations
.forEach((String name, Builder builder) {
if (outerSwitchScope == null) {
- deprecated_addCompileTimeError(-1, "Label not found: '$name'.");
+ JumpTarget target = builder;
+ for (Statement statement in target.users) {
+ statement.parent.replaceChild(
+ statement,
+ wrapInCompileTimeErrorStatement(statement,
+ fasta.templateLabelNotFound.withArguments(name)));
+ }
} else {
outerSwitchScope.forwardDeclareLabel(name, builder);
}
@@ -3572,13 +3578,28 @@
.buildCompileTimeError(message, charOffset, length, uri)));
}
- Expression wrapInCompileTimeError(Expression expression, Message message) {
+ Expression wrapInCompileTimeError(Expression expression, Message message,
+ {List<LocatedMessage> context}) {
+ return wrapInLocatedCompileTimeError(
+ expression, message.withLocation(uri, expression.fileOffset, noLength),
+ context: context);
+ }
+
+ Expression wrapInLocatedCompileTimeError(
+ Expression expression, LocatedMessage message,
+ {List<LocatedMessage> context}) {
// TODO(askesc): Produce explicit error expression wrapping the original.
// See [issue 29717](https://github.com/dart-lang/sdk/issues/29717)
return new Let(
- new VariableDeclaration.forValue(expression)
+ new VariableDeclaration.forValue(buildCompileTimeError(
+ message.messageObject, message.charOffset, message.length,
+ context: context))
..fileOffset = expression.fileOffset,
- buildCompileTimeError(message, expression.fileOffset, noLength))
+ new Let(
+ new VariableDeclaration.forValue(expression)
+ ..fileOffset = expression.fileOffset,
+ storeOffset(forest.literalNull(null), expression.fileOffset))
+ ..fileOffset = expression.fileOffset)
..fileOffset = expression.fileOffset;
}
diff --git a/pkg/front_end/lib/src/fasta/kernel/constness_evaluator.dart b/pkg/front_end/lib/src/fasta/kernel/constness_evaluator.dart
deleted file mode 100644
index 8322954..0000000
--- a/pkg/front_end/lib/src/fasta/kernel/constness_evaluator.dart
+++ /dev/null
@@ -1,423 +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 'package:kernel/ast.dart' hide MapEntry;
-
-import 'package:kernel/core_types.dart' show CoreTypes;
-
-import 'package:kernel/visitor.dart' show ExpressionVisitor, DartTypeVisitor;
-
-import '../names.dart'
- show
- ampersandName,
- barName,
- caretName,
- divisionName,
- equalsName,
- greaterThanName,
- greaterThanOrEqualsName,
- identicalName,
- leftShiftName,
- lengthName,
- lessThanName,
- lessThanOrEqualsName,
- minusName,
- multiplyName,
- mustacheName,
- negationName,
- percentName,
- plusName,
- rightShiftName,
- tildeName,
- unaryMinusName;
-
-import '../fasta_codes.dart' show templateInternalVisitorUnsupportedDefault;
-
-import '../problems.dart' show unsupported;
-
-/// Evaluates constness of the given constructor invocation.
-///
-/// TODO(dmitryas): Share code with the constant evaluator from
-/// pkg/kernel/lib/transformations/constants.dart.
-class ConstnessEvaluator
- implements ExpressionVisitor<bool>, DartTypeVisitor<bool> {
- final CoreTypes coreTypes;
-
- /// [Uri] of the file containing the expressions that are to be evaluated.
- final Uri uri;
-
- ConstnessEvaluator(this.coreTypes, this.uri);
-
- @override
- defaultExpression(Expression node) {
- return unsupported(
- templateInternalVisitorUnsupportedDefault
- .withArguments("${node.runtimeType}")
- .message,
- node?.fileOffset ?? -1,
- uri);
- }
-
- @override
- defaultBasicLiteral(BasicLiteral node) {
- return defaultExpression(node);
- }
-
- @override
- defaultDartType(DartType node) {
- return unsupported(
- templateInternalVisitorUnsupportedDefault
- .withArguments("${node.runtimeType}")
- .message,
- -1,
- uri);
- }
-
- @override
- visitInvalidType(InvalidType node) => false;
-
- @override
- visitDynamicType(DynamicType node) => true;
-
- @override
- visitVoidType(VoidType node) => true;
-
- @override
- visitBottomType(BottomType node) => true;
-
- @override
- visitInterfaceType(InterfaceType node) {
- for (var type in node.typeArguments) {
- if (!type.accept(this)) return false;
- }
- return true;
- }
-
- @override
- visitVectorType(VectorType node) => true;
-
- @override
- visitFunctionType(FunctionType node) {
- if (!node.returnType.accept(this)) return false;
- for (var parameter in node.positionalParameters) {
- if (!parameter.accept(this)) return false;
- }
- for (var parameter in node.namedParameters) {
- if (!parameter.type.accept(this)) return false;
- }
- for (var typeParameter in node.typeParameters) {
- if (!typeParameter.bound.accept(this)) return false;
- }
- return true;
- }
-
- @override
- visitTypeParameterType(TypeParameterType node) => false;
-
- @override
- visitTypedefType(TypedefType node) {
- for (var type in node.typeArguments) {
- if (!type.accept(this)) return false;
- }
- return true;
- }
-
- bool evaluate(Expression node) {
- return node.accept(this);
- }
-
- @override
- visitNullLiteral(NullLiteral node) {
- return true;
- }
-
- @override
- visitBoolLiteral(BoolLiteral node) {
- return true;
- }
-
- @override
- visitIntLiteral(IntLiteral node) {
- return true;
- }
-
- @override
- visitDoubleLiteral(DoubleLiteral node) {
- return true;
- }
-
- @override
- visitStringLiteral(StringLiteral node) {
- return true;
- }
-
- @override
- visitSymbolLiteral(SymbolLiteral node) {
- return true;
- }
-
- @override
- visitTypeLiteral(TypeLiteral node) {
- // TODO(dmitryas): Figure out how to handle deferred types.
- return node.type.accept(this);
- }
-
- @override
- visitListLiteral(ListLiteral node) {
- return node.isConst;
- }
-
- @override
- visitMapLiteral(MapLiteral node) {
- return node.isConst;
- }
-
- @override
- visitConstructorInvocation(ConstructorInvocation node) {
- if (!node.target.isConst) {
- return false;
- }
-
- for (var type in node.arguments.types) {
- if (!type.accept(this)) return false;
- }
- for (var expression in node.arguments.positional) {
- if (!expression.accept(this)) return false;
- }
- for (var namedExpression in node.arguments.named) {
- if (!namedExpression.value.accept(this)) return false;
- }
-
- return true;
- }
-
- @override
- visitMethodInvocation(MethodInvocation node) {
- if (node.arguments.named.isNotEmpty ||
- node.arguments.types.isNotEmpty ||
- !isConstantMethodName(node.name, node.arguments.positional.length)) {
- return false;
- }
-
- if (!node.receiver.accept(this)) return false;
- for (var expression in node.arguments.positional) {
- if (!expression.accept(this)) return false;
- }
-
- return true;
- }
-
- @override
- visitLogicalExpression(LogicalExpression node) {
- return node.left.accept(this) && node.right.accept(this);
- }
-
- @override
- visitConditionalExpression(ConditionalExpression node) {
- return node.condition.accept(this) &&
- node.then.accept(this) &&
- node.otherwise.accept(this);
- }
-
- @override
- visitPropertyGet(PropertyGet node) {
- if (!isConstantPropertyName(node.name)) return false;
- return node.receiver.accept(this);
- }
-
- @override
- visitLet(Let node) {
- return node.variable.initializer.accept(this) && node.body.accept(this);
- }
-
- @override
- visitVariableGet(VariableGet node) {
- return node.variable.isConst;
- }
-
- @override
- visitStaticGet(StaticGet node) {
- Member target = node.target;
- if (target is Field) {
- return target.isConst;
- } else {
- // TODO(dmitryas): Figure out how to deal with deferred functions.
- return true;
- }
- }
-
- @override
- visitStringConcatenation(StringConcatenation node) {
- for (var expression in node.expressions) {
- if (!expression.accept(this)) return false;
- }
- return true;
- }
-
- @override
- visitStaticInvocation(StaticInvocation node) {
- Member target = node.target;
- if (target is Procedure) {
- if (target.isConst && target.isFactory) {
- for (var type in node.arguments.types) {
- if (!type.accept(this)) return false;
- }
- for (var expression in node.arguments.positional) {
- if (!expression.accept(this)) return false;
- }
- for (var namedExpression in node.arguments.named) {
- if (!namedExpression.value.accept(this)) return false;
- }
- return true;
- } else if (target.name == identicalName) {
- final TreeNode parent = target.parent;
- if (parent is Library && parent == coreTypes.coreLibrary) {
- assert(node.arguments.positional.length == 2);
- return node.arguments.positional[0].accept(this) &&
- node.arguments.positional[1].accept(this);
- }
- }
- }
- return false;
- }
-
- @override
- visitAsExpression(AsExpression node) {
- return node.operand.accept(this) && node.type.accept(this);
- }
-
- @override
- visitNot(Not node) {
- return node.operand.accept(this);
- }
-
- @override
- visitInvalidExpression(InvalidExpression node) => false;
-
- @override
- visitVariableSet(VariableSet node) => false;
-
- @override
- visitPropertySet(PropertySet node) => false;
-
- @override
- visitDirectPropertyGet(DirectPropertyGet node) {
- if (!isConstantPropertyName(node.target.name)) return false;
- return node.receiver.accept(this);
- }
-
- @override
- visitDirectPropertySet(DirectPropertySet node) => false;
-
- @override
- visitSuperPropertyGet(SuperPropertyGet node) => false;
-
- @override
- visitSuperPropertySet(SuperPropertySet node) => false;
-
- @override
- visitStaticSet(StaticSet node) => false;
-
- @override
- visitDirectMethodInvocation(DirectMethodInvocation node) {
- if (node.arguments.named.isNotEmpty ||
- node.arguments.types.isNotEmpty ||
- !isConstantMethodName(node.name, node.arguments.positional.length)) {
- return false;
- }
-
- if (!node.receiver.accept(this)) return false;
- for (var expression in node.arguments.positional) {
- if (!expression.accept(this)) return false;
- }
-
- return true;
- }
-
- @override
- visitSuperMethodInvocation(SuperMethodInvocation node) => false;
-
- @override
- visitIsExpression(IsExpression node) {
- return node.operand.accept(this) && node.type.accept(this);
- }
-
- @override
- visitThisExpression(ThisExpression node) => false;
-
- @override
- visitRethrow(Rethrow node) => false;
-
- @override
- visitThrow(Throw node) => false;
-
- @override
- visitAwaitExpression(AwaitExpression node) => false;
-
- @override
- visitFunctionExpression(FunctionExpression node) => false;
-
- @override
- visitConstantExpression(ConstantExpression node) => true;
-
- @override
- visitInstantiation(Instantiation node) => false;
-
- @override
- visitLoadLibrary(LoadLibrary node) => false;
-
- @override
- visitCheckLibraryIsLoaded(CheckLibraryIsLoaded node) => false;
-
- @override
- visitVectorCreation(VectorCreation node) => false;
-
- @override
- visitVectorGet(VectorGet node) => false;
-
- @override
- visitVectorSet(VectorSet node) => false;
-
- @override
- visitVectorCopy(VectorCopy node) => false;
-
- @override
- visitClosureCreation(ClosureCreation node) => false;
-
- /// Returns null if `receiver.name(arguments)` is not a constant.
- static bool isConstantMethodName(Name name, int argumentCount) {
- if (argumentCount == 0) {
- if (name == tildeName) return true;
- if (name == unaryMinusName) return true;
- } else if (argumentCount == 1) {
- if (name == ampersandName) return true;
- if (name == barName) return true;
- if (name == caretName) return true;
- if (name == divisionName) return true;
- if (name == equalsName) return true;
- if (name == greaterThanName) return true;
- if (name == greaterThanOrEqualsName) return true;
- if (name == leftShiftName) return true;
- if (name == lessThanName) return true;
- if (name == lessThanOrEqualsName) return true;
- if (name == minusName) return true;
- if (name == multiplyName) return true;
- if (name == mustacheName) return true;
- if (name == negationName) return true;
- if (name == percentName) return true;
- if (name == plusName) return true;
- if (name == rightShiftName) return true;
- }
- return false;
- }
-
- static bool isConstantPropertyName(Name name) {
- return name == lengthName;
- }
-}
-
-// TODO(32717): Remove this helper function when the issue is resolved.
-bool evaluateConstness(Expression expression, CoreTypes coreTypes, Uri uri) {
- return new ConstnessEvaluator(coreTypes, uri).evaluate(expression);
-}
diff --git a/pkg/front_end/lib/src/fasta/kernel/kernel_shadow_ast.dart b/pkg/front_end/lib/src/fasta/kernel/kernel_shadow_ast.dart
index 11440d4..ecd17f9 100644
--- a/pkg/front_end/lib/src/fasta/kernel/kernel_shadow_ast.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/kernel_shadow_ast.dart
@@ -1588,10 +1588,7 @@
Object _handleWriteContravariance(
ShadowTypeInferrer inferrer, DartType receiverType) {
- var writeMember = inferrer.findPropertySetMember(receiverType, write);
- inferrer.handlePropertySetContravariance(
- receiver, writeMember, write is PropertySet ? write : null, write);
- return writeMember;
+ return inferrer.findPropertySetMember(receiverType, write);
}
@override
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 c22e78d..aa0a7be 100644
--- a/pkg/front_end/lib/src/fasta/parser/identifier_context.dart
+++ b/pkg/front_end/lib/src/fasta/parser/identifier_context.dart
@@ -4,8 +4,7 @@
import '../../scanner/token.dart' show Token;
-import '../fasta_codes.dart'
- show Message, Template, templateExpectedIdentifier, templateExpectedType;
+import '../fasta_codes.dart' show Message, Template, templateExpectedIdentifier;
import '../scanner/token_constants.dart' show IDENTIFIER_TOKEN;
@@ -119,21 +118,16 @@
isBuiltInIdentifierAllowed: false);
/// Identifier is the start of a reference to a type that starts with prefix.
- static const prefixedTypeReference = const IdentifierContext(
- 'prefixedTypeReference',
- isScopeReference: true,
- isBuiltInIdentifierAllowed: true,
- recoveryTemplate: templateExpectedType);
+ static const prefixedTypeReference =
+ const TypeReferenceIdentifierContext.prefixed();
/// Identifier is the start of a reference to a type declared elsewhere.
static const typeReference = const TypeReferenceIdentifierContext();
/// Identifier is part of a reference to a type declared elsewhere, but it's
/// not the first identifier of the reference.
- static const typeReferenceContinuation = const IdentifierContext(
- 'typeReferenceContinuation',
- isContinuation: true,
- isBuiltInIdentifierAllowed: false);
+ static const typeReferenceContinuation =
+ const TypeReferenceIdentifierContext.continuation();
/// Identifier is a name being declared by a top level variable declaration.
static const topLevelVariableDeclaration = const IdentifierContext(
@@ -240,12 +234,11 @@
/// Identifier appears in an expression, and it does not immediately follow a
/// `.`.
- static const expression =
- const IdentifierContext('expression', isScopeReference: true);
+ static const expression = const ExpressionIdentifierContext();
/// Identifier appears in an expression, and it immediately follows a `.`.
static const expressionContinuation =
- const IdentifierContext('expressionContinuation', isContinuation: true);
+ const ExpressionIdentifierContext.continuation();
/// Identifier is a reference to a named argument of a function or method
/// invocation (e.g. `foo` in `f(foo: 0);`.
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 92bb8c2..0f22616 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
@@ -17,6 +17,60 @@
import 'util.dart' show optional;
+/// See [IdentifierContext].expression
+class ExpressionIdentifierContext extends IdentifierContext {
+ const ExpressionIdentifierContext()
+ : super('expression', isScopeReference: true);
+
+ const ExpressionIdentifierContext.continuation()
+ : super('expressionContinuation', isContinuation: true);
+
+ @override
+ Token ensureIdentifier(Token token, Parser parser) {
+ Token next = token.next;
+ assert(next.kind != IDENTIFIER_TOKEN);
+ if (next.isIdentifier) {
+ if (optional('await', next) && next.next.isIdentifier) {
+ // Although the `await` can be used in an expression,
+ // it is followed by another identifier which does not form
+ // a valid expression. Report an error on the `await` token
+ // rather than the token following it.
+ parser.reportRecoverableErrorWithToken(
+ next, fasta.templateUnexpectedToken);
+
+ // TODO(danrubel) Consider a new listener event so that analyzer
+ // can represent this as an await expression in a context that does
+ // not allow await.
+ return next.next;
+ } else if (!parser.inPlainSync && next.type.isPseudo) {
+ if (optional('await', next)) {
+ parser.reportRecoverableError(next, fasta.messageAwaitAsIdentifier);
+ } else if (optional('yield', next)) {
+ parser.reportRecoverableError(next, fasta.messageYieldAsIdentifier);
+ } else if (optional('async', next)) {
+ parser.reportRecoverableError(next, fasta.messageAsyncAsIdentifier);
+ }
+ }
+ return next;
+ }
+ parser.reportRecoverableErrorWithToken(
+ next, fasta.templateExpectedIdentifier);
+ if (next.isKeywordOrIdentifier) {
+ if (!isOneOfOrEof(next, ['as', 'is'])) {
+ return next;
+ }
+ } else if (!next.isOperator &&
+ !isOneOfOrEof(
+ next, const ['.', ',', '(', ')', '[', ']', '}', '?', ':', ';'])) {
+ // When in doubt, consume the token to ensure we make progress
+ token = next;
+ next = token.next;
+ }
+ // Insert a synthetic identifier to satisfy listeners.
+ return insertSyntheticIdentifierAfter(token, parser);
+ }
+}
+
/// See [IdentifierContext].libraryName
class LibraryIdentifierContext extends IdentifierContext {
const LibraryIdentifierContext()
@@ -32,8 +86,7 @@
assert(identifier.kind != IDENTIFIER_TOKEN);
if (identifier.isIdentifier) {
Token next = identifier.next;
- if (optional('.', next) ||
- optional(';', next) ||
+ if (isOneOfOrEof(next, const ['.', ';']) ||
!looksLikeStartOfNextDeclaration(identifier)) {
return identifier;
}
@@ -41,8 +94,7 @@
// is invalid and this looks like the start of the next declaration.
// In this situation, fall through to insert a synthetic library name.
}
- if (optional('.', identifier) ||
- optional(';', identifier) ||
+ if (isOneOfOrEof(identifier, const ['.', ';']) ||
looksLikeStartOfNextDeclaration(identifier)) {
identifier = parser.insertSyntheticIdentifier(token, this,
message: fasta.templateExpectedIdentifier.withArguments(identifier));
@@ -68,6 +120,7 @@
optional('void', token);
}
+/// See [IdentifierContext].typeReference
class TypeReferenceIdentifierContext extends IdentifierContext {
const TypeReferenceIdentifierContext()
: super('typeReference',
@@ -75,6 +128,16 @@
isBuiltInIdentifierAllowed: false,
recoveryTemplate: fasta.templateExpectedType);
+ const TypeReferenceIdentifierContext.continuation()
+ : super('typeReferenceContinuation',
+ isContinuation: true, isBuiltInIdentifierAllowed: false);
+
+ const TypeReferenceIdentifierContext.prefixed()
+ : super('prefixedTypeReference',
+ isScopeReference: true,
+ isBuiltInIdentifierAllowed: true,
+ recoveryTemplate: fasta.templateExpectedType);
+
@override
Token ensureIdentifier(Token token, Parser parser) {
Token next = token.next;
@@ -109,8 +172,10 @@
if (optional("void", next)) {
parser.reportRecoverableError(next, fasta.messageInvalidVoid);
} else if (next.type.isBuiltIn) {
- parser.reportRecoverableErrorWithToken(
- next, fasta.templateBuiltInIdentifierAsType);
+ if (!isBuiltInIdentifierAllowed) {
+ parser.reportRecoverableErrorWithToken(
+ next, fasta.templateBuiltInIdentifierAsType);
+ }
} else {
parser.reportRecoverableErrorWithToken(
next, fasta.templateExpectedType);
@@ -118,7 +183,7 @@
return next;
}
parser.reportRecoverableErrorWithToken(next, fasta.templateExpectedType);
- if (!isOneOfOrEof(next, ['>', ')', ']', '{', '}', ',', ';'])) {
+ if (!isOneOfOrEof(next, const ['>', ')', ']', '{', '}', ',', ';'])) {
// When in doubt, consume the token to ensure we make progress
token = next;
next = token.next;
diff --git a/pkg/front_end/lib/src/fasta/parser/parser.dart b/pkg/front_end/lib/src/fasta/parser/parser.dart
index f282ad6..4d9aac8 100644
--- a/pkg/front_end/lib/src/fasta/parser/parser.dart
+++ b/pkg/front_end/lib/src/fasta/parser/parser.dart
@@ -1964,25 +1964,6 @@
followingValues = ['{'];
} else if (context == IdentifierContext.enumValueDeclaration) {
followingValues = [',', '}'];
- } else if (context == IdentifierContext.expression ||
- context == IdentifierContext.expressionContinuation) {
- if (token.isOperator) {
- return true;
- }
- followingValues = [
- '.',
- ',',
- '(',
- ')',
- '[',
- ']',
- '}',
- '?',
- ':',
- 'as',
- 'is',
- ';'
- ];
} else if (context == IdentifierContext.formalParameterDeclaration) {
followingValues = [':', '=', ',', '(', ')', '[', ']', '{', '}'];
} else if (context == IdentifierContext.importPrefixDeclaration) {
@@ -2008,8 +1989,6 @@
followingValues = [';', '=', ','];
} else if (context == IdentifierContext.typedefDeclaration) {
followingValues = ['(', '<', ';'];
- } else if (context == IdentifierContext.typeReferenceContinuation) {
- followingValues = ['>', ')', ']', '}', ',', ';'];
} else if (context == IdentifierContext.typeVariableDeclaration) {
followingValues = ['<', '>', ';', '}'];
} else {
diff --git a/pkg/front_end/lib/src/fasta/testing/validating_instrumentation.dart b/pkg/front_end/lib/src/fasta/testing/validating_instrumentation.dart
index f16d6af..e392ed6 100644
--- a/pkg/front_end/lib/src/fasta/testing/validating_instrumentation.dart
+++ b/pkg/front_end/lib/src/fasta/testing/validating_instrumentation.dart
@@ -39,7 +39,6 @@
'target',
],
'checks': const [
- 'callKind',
'covariance',
'checkGetterReturn',
'checkReturn',
diff --git a/pkg/front_end/lib/src/fasta/type_inference/type_inferrer.dart b/pkg/front_end/lib/src/fasta/type_inference/type_inferrer.dart
index b2e71fc..47471e5 100644
--- a/pkg/front_end/lib/src/fasta/type_inference/type_inferrer.dart
+++ b/pkg/front_end/lib/src/fasta/type_inference/type_inferrer.dart
@@ -12,7 +12,6 @@
ConditionalExpression,
ConstructorInvocation,
DartType,
- DispatchCategory,
DynamicType,
Expression,
Field,
@@ -59,8 +58,7 @@
Instrumentation,
InstrumentationValueForMember,
InstrumentationValueForType,
- InstrumentationValueForTypeArgs,
- InstrumentationValueLiteral;
+ InstrumentationValueForTypeArgs;
import '../fasta_codes.dart';
@@ -853,8 +851,7 @@
return expressionToReplace;
}
- /// Determines the dispatch category of a [PropertyGet] and adds an "as" check
- /// if necessary due to contravariance.
+ /// Add an "as" check if necessary due to contravariance.
///
/// Returns the "as" check if it was added; otherwise returns the original
/// expression.
@@ -865,17 +862,10 @@
Expression expression,
DartType inferredType,
int fileOffset) {
- DispatchCategory callKind;
- if (receiver is ThisExpression || receiver == null) {
- callKind = DispatchCategory.viaThis;
- } else if (interfaceMember == null) {
- callKind = DispatchCategory.dynamicDispatch;
- } else {
- callKind = DispatchCategory.interface;
- }
- desugaredGet?.dispatchCategory = callKind;
bool checkReturn = false;
- if (callKind == DispatchCategory.interface) {
+ if (receiver != null &&
+ interfaceMember != null &&
+ receiver is! ThisExpression) {
if (interfaceMember is Procedure) {
checkReturn = interfaceMember.isGenericContravariant;
} else if (interfaceMember is Field) {
@@ -891,57 +881,13 @@
..fileOffset = fileOffset;
parent.replaceChild(expressionToReplace, replacedExpression);
}
- if (instrumentation != null) {
- int offset = expression.fileOffset;
- switch (callKind) {
- case DispatchCategory.dynamicDispatch:
- instrumentation.record(uri, offset, 'callKind',
- new InstrumentationValueLiteral('dynamic'));
- break;
- case DispatchCategory.viaThis:
- instrumentation.record(
- uri, offset, 'callKind', new InstrumentationValueLiteral('this'));
- break;
- default:
- break;
- }
- if (checkReturn) {
- instrumentation.record(uri, offset, 'checkReturn',
- new InstrumentationValueForType(inferredType));
- }
+ if (instrumentation != null && checkReturn) {
+ instrumentation.record(uri, expression.fileOffset, 'checkReturn',
+ new InstrumentationValueForType(inferredType));
}
return replacedExpression;
}
- /// Determines the dispatch category of a [PropertySet].
- void handlePropertySetContravariance(Expression receiver,
- Object interfaceMember, PropertySet desugaredSet, Expression expression) {
- DispatchCategory callKind;
- if (receiver is ThisExpression || receiver == null) {
- callKind = DispatchCategory.viaThis;
- } else if (interfaceMember == null) {
- callKind = DispatchCategory.dynamicDispatch;
- } else {
- callKind = DispatchCategory.interface;
- }
- desugaredSet?.dispatchCategory = callKind;
- if (instrumentation != null) {
- int offset = expression.fileOffset;
- switch (callKind) {
- case DispatchCategory.dynamicDispatch:
- instrumentation.record(uri, offset, 'callKind',
- new InstrumentationValueLiteral('dynamic'));
- break;
- case DispatchCategory.viaThis:
- instrumentation.record(
- uri, offset, 'callKind', new InstrumentationValueLiteral('this'));
- break;
- default:
- break;
- }
- }
- }
-
/// Modifies a type as appropriate when inferring a declared variable's type.
DartType inferDeclarationType(DartType initializerType) {
if (initializerType is BottomType ||
@@ -1389,7 +1335,7 @@
receiverType, propertyName, fileOffset,
errorTemplate: templateUndefinedGetter,
expression: expression,
- receiver: desugaredGet.receiver);
+ receiver: receiver);
if (interfaceMember is Member) {
desugaredGet.interfaceTarget = interfaceMember;
}
@@ -1461,62 +1407,28 @@
MethodInvocation desugaredInvocation,
Arguments arguments,
Expression expression) {
- DispatchCategory callKind;
- var checkKind = MethodContravarianceCheckKind.none;
if (interfaceMember is Field ||
interfaceMember is Procedure &&
interfaceMember.kind == ProcedureKind.Getter) {
var getType = getCalleeType(interfaceMember, receiverType);
if (getType is DynamicType) {
- callKind = DispatchCategory.dynamicDispatch;
- } else {
- callKind = DispatchCategory.closure;
- if (receiver is! ThisExpression && receiver != null) {
- if (interfaceMember is Field &&
- interfaceMember.isGenericContravariant) {
- checkKind = MethodContravarianceCheckKind.checkGetterReturn;
- } else if (interfaceMember is Procedure &&
- interfaceMember.isGenericContravariant) {
- checkKind = MethodContravarianceCheckKind.checkGetterReturn;
- }
+ return MethodContravarianceCheckKind.none;
+ }
+ if (receiver != null && receiver is! ThisExpression) {
+ if ((interfaceMember is Field &&
+ interfaceMember.isGenericContravariant) ||
+ (interfaceMember is Procedure &&
+ interfaceMember.isGenericContravariant)) {
+ return MethodContravarianceCheckKind.checkGetterReturn;
}
}
- } else if (receiver is ThisExpression || receiver == null) {
- callKind = DispatchCategory.viaThis;
- } else if (identical(interfaceMember, 'call')) {
- callKind = DispatchCategory.closure;
- } else if (interfaceMember == null) {
- callKind = DispatchCategory.dynamicDispatch;
- } else {
- callKind = DispatchCategory.interface;
- if (interfaceMember is Procedure &&
- interfaceMember.isGenericContravariant) {
- checkKind = MethodContravarianceCheckKind.checkMethodReturn;
- }
+ } else if (receiver != null &&
+ receiver is! ThisExpression &&
+ interfaceMember is Procedure &&
+ interfaceMember.isGenericContravariant) {
+ return MethodContravarianceCheckKind.checkMethodReturn;
}
- desugaredInvocation?.dispatchCategory = callKind;
- if (instrumentation != null) {
- int offset = arguments.fileOffset == -1
- ? expression.fileOffset
- : arguments.fileOffset;
- switch (callKind) {
- case DispatchCategory.closure:
- instrumentation.record(uri, offset, 'callKind',
- new InstrumentationValueLiteral('closure'));
- break;
- case DispatchCategory.dynamicDispatch:
- instrumentation.record(uri, offset, 'callKind',
- new InstrumentationValueLiteral('dynamic'));
- break;
- case DispatchCategory.viaThis:
- instrumentation.record(
- uri, offset, 'callKind', new InstrumentationValueLiteral('this'));
- break;
- default:
- break;
- }
- }
- return checkKind;
+ return MethodContravarianceCheckKind.none;
}
/// If the given [type] is a [TypeParameterType], resolve it to its bound.
diff --git a/pkg/front_end/messages.yaml b/pkg/front_end/messages.yaml
index dc8a017..f1273f6 100644
--- a/pkg/front_end/messages.yaml
+++ b/pkg/front_end/messages.yaml
@@ -630,13 +630,21 @@
- "main() { switch (x) {case 1: continue;} }"
DuplicateLabelInSwitchStatement:
- template: "The label '#string' was already used in this switch statement."
+ template: "The label '#name' was already used in this switch statement."
tip: "Try choosing a different name for this label."
analyzerCode: DUPLICATE_LABEL_IN_SWITCH_STATEMENT
dart2jsCode: "*fatal*"
statement:
- "switch (0) {l1: case 0: break; l1: case 1: break;}"
+LabelNotFound:
+ template: "Can't find label '#name'."
+ tip: "Try defining the label, or correcting the name to match an existing label."
+ analyzerCode: LABEL_UNDEFINED
+ dart2jsCode: "*fatal*"
+ statement:
+ - "switch (0) {case 0: continue L;}"
+
InitializedVariableInForEach:
template: "The loop variable in a for-each loop can't be initialized."
tip: "Try removing the initializer, or using a different kind of loop."
diff --git a/pkg/front_end/test/fasta/testing/analyzer_diet_listener.dart b/pkg/front_end/test/fasta/testing/analyzer_diet_listener.dart
index a09b51d..e0f5f3e 100644
--- a/pkg/front_end/test/fasta/testing/analyzer_diet_listener.dart
+++ b/pkg/front_end/test/fasta/testing/analyzer_diet_listener.dart
@@ -111,7 +111,8 @@
StackListener createListener(
ModifierBuilder builder, Scope memberScope, bool isInstanceMember,
[Scope formalParameterScope]) {
- return new AstBuilder(null, library, builder, memberScope, false, uri);
+ return new AstBuilder(
+ null, library.fileUri, builder, memberScope, false, uri);
}
@override
diff --git a/pkg/front_end/test/incremental_load_from_dill_test.dart b/pkg/front_end/test/incremental_load_from_dill_test.dart
index 610c148..147487c 100644
--- a/pkg/front_end/test/incremental_load_from_dill_test.dart
+++ b/pkg/front_end/test/incremental_load_from_dill_test.dart
@@ -117,14 +117,16 @@
void basicTest(Map<String, String> sourceFiles, String entryPoint, bool strong,
List<String> invalidate, Directory outDir) async {
- Uri entryPointUri;
+ Uri entryPointUri = outDir.uri.resolve(entryPoint);
Set<String> invalidateFilenames = invalidate?.toSet() ?? new Set<String>();
List<Uri> invalidateUris = <Uri>[];
Uri packagesUri;
for (String filename in sourceFiles.keys) {
Uri uri = outDir.uri.resolve(filename);
- if (filename == entryPoint) entryPointUri = uri;
- if (invalidateFilenames.contains(filename)) invalidateUris.add(uri);
+ if (invalidateFilenames.contains(filename)) {
+ invalidateUris.add(uri);
+ invalidateFilenames.remove(filename);
+ }
String source = sourceFiles[filename];
if (filename == ".packages") {
source = substituteVariables(source, outDir.uri);
@@ -132,6 +134,13 @@
}
new File.fromUri(uri).writeAsStringSync(source);
}
+ for (String invalidateFilename in invalidateFilenames) {
+ if (invalidateFilename.startsWith('package:')) {
+ invalidateUris.add(Uri.parse(invalidateFilename));
+ } else {
+ throw "Error in test yaml: $invalidateFilename was not recognized.";
+ }
+ }
Uri output = outDir.uri.resolve("full.dill");
Uri initializedOutput = outDir.uri.resolve("full_from_initialized.dill");
@@ -145,9 +154,13 @@
print("Normal compile took ${stopwatch.elapsedMilliseconds} ms");
stopwatch.reset();
+ options = getOptions(strong);
+ if (packagesUri != null) {
+ options.packagesFileUri = packagesUri;
+ }
bool initializedResult = await initializedCompile(
entryPointUri, initializedOutput, output, invalidateUris,
- options: getOptions(strong));
+ options: options);
print("Initialized compile(s) from ${output.pathSegments.last} "
"took ${stopwatch.elapsedMilliseconds} ms");
Expect.isTrue(initializedResult);
@@ -249,7 +262,8 @@
}
Stopwatch stopwatch = new Stopwatch()..start();
- Component component = await compiler.computeDelta(fullComponent: true);
+ Component component = await compiler.computeDelta(
+ fullComponent: brandNewWorld ? false : true);
if (world["errors"] == true && !gotError) {
throw "Expected error, but didn't get any.";
} else if (world["errors"] != true && gotError) {
@@ -278,7 +292,7 @@
if (world["checkInvalidatedFiles"] != false) {
if (world["invalidate"] != null) {
Expect.equals(world["invalidate"].length,
- compiler.invalidatedImportUrisForTesting.length);
+ compiler.invalidatedImportUrisForTesting?.length ?? 0);
List expectedInvalidatedUri = world["expectedInvalidatedUri"];
if (expectedInvalidatedUri != null) {
Expect.setEquals(
@@ -357,6 +371,12 @@
throwOnEmptyMixinBodies(initializedComponent);
bool result = compiler.initializedFromDill;
await writeComponentToFile(initializedComponent, output);
+ int actuallyInvalidatedCount =
+ compiler.invalidatedImportUrisForTesting?.length ?? 0;
+ if (result && actuallyInvalidatedCount < invalidateUris.length) {
+ Expect.fail("Expected at least ${invalidateUris.length} invalidated uris, "
+ "got $actuallyInvalidatedCount");
+ }
var initializedComponent2 = await compiler.computeDelta(fullComponent: true);
throwOnEmptyMixinBodies(initializedComponent2);
@@ -371,6 +391,13 @@
var partialComponent = await compiler.computeDelta();
throwOnEmptyMixinBodies(partialComponent);
+ actuallyInvalidatedCount =
+ (compiler.invalidatedImportUrisForTesting?.length ?? 0);
+ if (actuallyInvalidatedCount < invalidateUris.length) {
+ Expect.fail("Expected at least ${invalidateUris.length} invalidated uris, "
+ "got $actuallyInvalidatedCount");
+ }
+
var emptyComponent = await compiler.computeDelta();
throwOnEmptyMixinBodies(emptyComponent);
@@ -384,6 +411,7 @@
Expect.isTrue(fullLibUris.length > partialLibUris.length ||
partialLibUris.length == invalidateUris.length);
Expect.isTrue(partialLibUris.isNotEmpty || invalidateUris.isEmpty);
+
Expect.isTrue(emptyLibUris.isEmpty);
return result;
@@ -417,7 +445,7 @@
}
class TestIncrementalCompiler extends IncrementalCompiler {
- List<Uri> invalidatedImportUrisForTesting;
+ Set<Uri> invalidatedImportUrisForTesting;
TestIncrementalCompiler(CompilerOptions options, Uri entryPoint,
[Uri initializeFrom])
@@ -428,6 +456,6 @@
@override
void recordInvalidatedImportUrisForTesting(List<Uri> uris) {
- invalidatedImportUrisForTesting = uris.isEmpty ? null : uris.toList();
+ invalidatedImportUrisForTesting = uris.isEmpty ? null : uris.toSet();
}
}
diff --git a/pkg/front_end/testcases/incremental_initialize_from_dill/deleting_file.yaml b/pkg/front_end/testcases/incremental_initialize_from_dill/deleting_file.yaml
new file mode 100644
index 0000000..970db47
--- /dev/null
+++ b/pkg/front_end/testcases/incremental_initialize_from_dill/deleting_file.yaml
@@ -0,0 +1,67 @@
+# 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.md file.
+
+# Compile an application, then, initializing from that dill, delete a file that
+# we use, and retry a few times. The deleted file should remain deleted and
+# we should keep getting an error.
+
+type: newworld
+strong: false
+worlds:
+ - entry: main.dart
+ sources:
+ main.dart: |
+ import "b.dart";
+ main() {
+ print("Hello no. 0");
+ b();
+ }
+ b.dart: |
+ b() {
+ print("b");
+ }
+ expectedLibraryCount: 2
+ - entry: main.dart
+ errors: true
+ warnings: false
+ invalidate:
+ - b.dart
+ sources:
+ main.dart: |
+ import "b.dart";
+ main() {
+ print("Hello no. 0");
+ b();
+ }
+ expectedLibraryCount: 1
+ - entry: main.dart
+ errors: true
+ warnings: false
+ checkInvalidatedFiles: false
+ worldType: updated
+ invalidate:
+ - main.dart
+ sources:
+ main.dart: |
+ import "b.dart";
+ main() {
+ print("Hello no. 1");
+ b();
+ }
+ expectedLibraryCount: 1
+ - entry: main.dart
+ errors: true
+ warnings: false
+ checkInvalidatedFiles: false
+ worldType: updated
+ invalidate:
+ - main.dart
+ sources:
+ main.dart: |
+ import "b.dart";
+ main() {
+ print("Hello no. 1");
+ b();
+ }
+ expectedLibraryCount: 1
\ No newline at end of file
diff --git a/pkg/front_end/testcases/incremental_initialize_from_dill/invalidate_package_part_as_file.yaml b/pkg/front_end/testcases/incremental_initialize_from_dill/invalidate_package_part_as_file.yaml
index 43eb78b..e2c631e 100644
--- a/pkg/front_end/testcases/incremental_initialize_from_dill/invalidate_package_part_as_file.yaml
+++ b/pkg/front_end/testcases/incremental_initialize_from_dill/invalidate_package_part_as_file.yaml
@@ -8,6 +8,7 @@
entry: "package:dummy/main.dart"
strong: false
invalidate:
+ - b.dart
sources:
main.dart: |
part "b.dart";
diff --git a/pkg/front_end/testcases/incremental_initialize_from_dill/invalidate_package_part_as_package.yaml b/pkg/front_end/testcases/incremental_initialize_from_dill/invalidate_package_part_as_package.yaml
index 43eb78b..90d13ac 100644
--- a/pkg/front_end/testcases/incremental_initialize_from_dill/invalidate_package_part_as_package.yaml
+++ b/pkg/front_end/testcases/incremental_initialize_from_dill/invalidate_package_part_as_package.yaml
@@ -2,12 +2,13 @@
# for details. All rights reserved. Use of this source code is governed by a
# BSD-style license that can be found in the LICENSE.md file.
-# Test that invalidating a part of a package works with file URI.
+# Test that invalidating a part of a package works with package URI.
type: basic
entry: "package:dummy/main.dart"
strong: false
invalidate:
+ - "package:dummy/b.dart"
sources:
main.dart: |
part "b.dart";
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 2dcebd2..656e437 100644
--- a/pkg/front_end/testcases/incremental_initialize_from_dill/status.status
+++ b/pkg/front_end/testcases/incremental_initialize_from_dill/status.status
@@ -5,7 +5,4 @@
# Status file for the test suite ../test/incremental_load_from_dill_yaml_test.dart.
calculated_bounds_no_strongmode: Crash
-invalidate_package_part: Crash
-invalidate_package_part_as_file: Crash
-invalidate_package_part_as_package: Crash
strongmode_mixins_2: Crash
diff --git a/pkg/front_end/testcases/incremental_initialize_from_dill/updated_package.yaml b/pkg/front_end/testcases/incremental_initialize_from_dill/updated_package_1.yaml
similarity index 100%
rename from pkg/front_end/testcases/incremental_initialize_from_dill/updated_package.yaml
rename to pkg/front_end/testcases/incremental_initialize_from_dill/updated_package_1.yaml
diff --git a/pkg/front_end/testcases/incremental_initialize_from_dill/updated_package_3.yaml b/pkg/front_end/testcases/incremental_initialize_from_dill/updated_package_3.yaml
index 2516191..1af84c1 100644
--- a/pkg/front_end/testcases/incremental_initialize_from_dill/updated_package_3.yaml
+++ b/pkg/front_end/testcases/incremental_initialize_from_dill/updated_package_3.yaml
@@ -36,6 +36,8 @@
worldType: updated
expectInitializeFromDill: false
checkInvalidatedFiles: false
+ invalidate:
+ - .packages
sources:
package_0.1.1/b.dart: |
b() {
diff --git a/pkg/front_end/testcases/incremental_initialize_from_dill/updated_package_4.yaml b/pkg/front_end/testcases/incremental_initialize_from_dill/updated_package_4.yaml
new file mode 100644
index 0000000..84a4e54
--- /dev/null
+++ b/pkg/front_end/testcases/incremental_initialize_from_dill/updated_package_4.yaml
@@ -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.md file.
+
+# Compile an application with a .packages.
+# Then delete the content of .packages, still using the package in code.
+# This should be an error.
+
+type: newworld
+strong: false
+worlds:
+ - entry: main.dart
+ sources:
+ main.dart: |
+ import "package:dummy/b.dart";
+ main() {
+ print("hello");
+ b();
+ }
+ package/b.dart: |
+ b() {
+ print("hello from package");
+ }
+ .packages: dummy:${outDirUri}package
+ expectedLibraryCount: 2
+ - entry: main.dart
+ worldType: updated
+ expectInitializeFromDill: false
+ checkInvalidatedFiles: false
+ invalidate:
+ - .packages
+ sources:
+ .packages:
+ errors: true
+ expectedLibraryCount: 1
\ No newline at end of file
diff --git a/pkg/front_end/testcases/inference/block_bodied_lambdas_downwards_incompatible_with_upwards_inference.dart.strong.expect b/pkg/front_end/testcases/inference/block_bodied_lambdas_downwards_incompatible_with_upwards_inference.dart.strong.expect
index 30dae6e..66d9ec3 100644
--- a/pkg/front_end/testcases/inference/block_bodied_lambdas_downwards_incompatible_with_upwards_inference.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/block_bodied_lambdas_downwards_incompatible_with_upwards_inference.dart.strong.expect
@@ -7,9 +7,9 @@
return null;
() → core::String g = f;
g = () → core::String {
- return let final dynamic #t1 = 1 in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/block_bodied_lambdas_downwards_incompatible_with_upwards_inference.dart:12:45: Error: A value of type 'dart.core::int' can't be assigned to a variable of type 'dart.core::String'.
+ return let final dynamic #t1 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/block_bodied_lambdas_downwards_incompatible_with_upwards_inference.dart:12:45: 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*/ 1;
- ^";
+ ^" in let final dynamic #t2 = 1 in null;
};
}
diff --git a/pkg/front_end/testcases/inference/block_bodied_lambdas_downwards_incompatible_with_upwards_inference.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/block_bodied_lambdas_downwards_incompatible_with_upwards_inference.dart.strong.transformed.expect
index 33fd7df..324afbd 100644
--- a/pkg/front_end/testcases/inference/block_bodied_lambdas_downwards_incompatible_with_upwards_inference.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/block_bodied_lambdas_downwards_incompatible_with_upwards_inference.dart.strong.transformed.expect
@@ -7,9 +7,9 @@
return null;
() → core::String g = f;
g = () → core::String {
- return let final core::int #t1 = 1 in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/block_bodied_lambdas_downwards_incompatible_with_upwards_inference.dart:12:45: Error: A value of type 'dart.core::int' can't be assigned to a variable of type 'dart.core::String'.
+ return let final dynamic #t1 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/block_bodied_lambdas_downwards_incompatible_with_upwards_inference.dart:12:45: 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*/ 1;
- ^";
+ ^" in let final core::int #t2 = 1 in null;
};
}
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 fa4e2f9..b902c2a 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
@@ -15,9 +15,9 @@
self::C<core::num> c_num = new self::C::•<core::num>(123);
self::C<core::num> c_num2 = let final self::C<core::num> #t1 = new self::C::•<core::num>(456) in let final dynamic #t2 = #t1.{self::C::t} = 1.0 in #t1;
self::C<dynamic> c_dynamic = new self::C::•<dynamic>(42);
- x.{self::C::t} = let final dynamic #t3 = "hello" in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/constructors_infer_from_arguments.dart:26:56: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ x.{self::C::t} = let final dynamic #t3 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/constructors_infer_from_arguments.dart:26:56: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
x. /*@target=C::t*/ t = /*error:INVALID_ASSIGNMENT*/ 'hello';
- ^";
+ ^" in let final dynamic #t4 = "hello" in null;
}
static method main() → dynamic {}
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 ac8f929..d6841ff 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
@@ -15,9 +15,9 @@
self::C<core::num> c_num = new self::C::•<core::num>(123);
self::C<core::num> c_num2 = let final self::C<core::num> #t1 = new self::C::•<core::num>(456) in let final core::double #t2 = #t1.{self::C::t} = 1.0 in #t1;
self::C<dynamic> c_dynamic = new self::C::•<dynamic>(42);
- x.{self::C::t} = let final core::String #t3 = "hello" in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/constructors_infer_from_arguments.dart:26:56: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ x.{self::C::t} = let final dynamic #t3 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/constructors_infer_from_arguments.dart:26:56: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
x. /*@target=C::t*/ t = /*error:INVALID_ASSIGNMENT*/ 'hello';
- ^";
+ ^" in let final core::String #t4 = "hello" in null;
}
static method main() → dynamic {}
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 e36424d..835b191 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
@@ -15,9 +15,9 @@
}
static method test() → dynamic {
self::C<core::int> x = self::C::•<core::int>(42);
- x.{self::C::t} = let final dynamic #t1 = "hello" in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/constructors_infer_from_arguments_factory.dart:22:56: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ x.{self::C::t} = let final dynamic #t1 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/constructors_infer_from_arguments_factory.dart:22:56: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
x. /*@target=C::t*/ t = /*error:INVALID_ASSIGNMENT*/ 'hello';
- ^";
+ ^" in let final dynamic #t2 = "hello" in null;
}
static method main() → dynamic {}
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 5d9e9d6..65a3466 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
@@ -15,9 +15,9 @@
}
static method test() → dynamic {
self::C<core::int> x = self::C::•<core::int>(42);
- x.{self::C::t} = let final core::String #t1 = "hello" in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/constructors_infer_from_arguments_factory.dart:22:56: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ x.{self::C::t} = let final dynamic #t1 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/constructors_infer_from_arguments_factory.dart:22:56: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
x. /*@target=C::t*/ t = /*error:INVALID_ASSIGNMENT*/ 'hello';
- ^";
+ ^" in let final core::String #t2 = "hello" in null;
}
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/downwards_inference_assignment_statements.dart.strong.expect b/pkg/front_end/testcases/inference/downwards_inference_assignment_statements.dart.strong.expect
index 48f74f8..6e8738f 100644
--- a/pkg/front_end/testcases/inference/downwards_inference_assignment_statements.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/downwards_inference_assignment_statements.dart.strong.expect
@@ -4,10 +4,10 @@
static method test() → void {
core::List<core::int> l;
- l = <core::int>[let final dynamic #t1 = "hello" in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_assignment_statements.dart:10:69: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ l = <core::int>[let final dynamic #t1 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_assignment_statements.dart:10:69: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
l = /*@typeArgs=int*/ [/*error:LIST_ELEMENT_TYPE_NOT_ASSIGNABLE*/ \"hello\"];
- ^"];
+ ^" in let final dynamic #t2 = "hello" in null];
l = l = <core::int>[1];
}
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/downwards_inference_assignment_statements.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/downwards_inference_assignment_statements.dart.strong.transformed.expect
index f630d02..9964842 100644
--- a/pkg/front_end/testcases/inference/downwards_inference_assignment_statements.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/downwards_inference_assignment_statements.dart.strong.transformed.expect
@@ -4,10 +4,10 @@
static method test() → void {
core::List<core::int> l;
- l = <core::int>[let final core::String #t1 = "hello" in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_assignment_statements.dart:10:69: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ l = <core::int>[let final dynamic #t1 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_assignment_statements.dart:10:69: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
l = /*@typeArgs=int*/ [/*error:LIST_ELEMENT_TYPE_NOT_ASSIGNABLE*/ \"hello\"];
- ^"];
+ ^" in let final core::String #t2 = "hello" in null];
l = l = <core::int>[1];
}
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/downwards_inference_on_constructor_arguments_infer_downwards.dart.strong.expect b/pkg/front_end/testcases/inference/downwards_inference_on_constructor_arguments_infer_downwards.dart.strong.expect
index ef16127..c8f23f9 100644
--- a/pkg/front_end/testcases/inference/downwards_inference_on_constructor_arguments_infer_downwards.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/downwards_inference_on_constructor_arguments_infer_downwards.dart.strong.expect
@@ -25,53 +25,53 @@
static method test() → void {
new self::F0::•(<core::int>[]);
new self::F0::•(<core::int>[3]);
- new self::F0::•(<core::int>[let final dynamic #t1 = "hello" in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_constructor_arguments_infer_downwards.dart:32:69: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ new self::F0::•(<core::int>[let final dynamic #t1 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_constructor_arguments_infer_downwards.dart:32:69: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
/*@typeArgs=int*/ [/*error:LIST_ELEMENT_TYPE_NOT_ASSIGNABLE*/ \"hello\"]);
- ^"]);
- new self::F0::•(<core::int>[let final dynamic #t2 = "hello" in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_constructor_arguments_infer_downwards.dart:34:48: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ ^" in let final dynamic #t2 = "hello" in null]);
+ new self::F0::•(<core::int>[let final dynamic #t3 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_constructor_arguments_infer_downwards.dart:34:48: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
/*error:LIST_ELEMENT_TYPE_NOT_ASSIGNABLE*/ \"hello\",
- ^", 3]);
+ ^" in let final dynamic #t4 = "hello" in null, 3]);
new self::F1::•(a: <core::int>[]);
new self::F1::•(a: <core::int>[3]);
- new self::F1::•(a: <core::int>[let final dynamic #t3 = "hello" in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_constructor_arguments_infer_downwards.dart:41:48: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ new self::F1::•(a: <core::int>[let final dynamic #t5 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_constructor_arguments_infer_downwards.dart:41:48: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
/*error:LIST_ELEMENT_TYPE_NOT_ASSIGNABLE*/ \"hello\"
- ^"]);
- new self::F1::•(a: <core::int>[let final dynamic #t4 = "hello" in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_constructor_arguments_infer_downwards.dart:44:48: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ ^" in let final dynamic #t6 = "hello" in null]);
+ new self::F1::•(a: <core::int>[let final dynamic #t7 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_constructor_arguments_infer_downwards.dart:44:48: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
/*error:LIST_ELEMENT_TYPE_NOT_ASSIGNABLE*/ \"hello\",
- ^", 3]);
+ ^" in let final dynamic #t8 = "hello" in null, 3]);
new self::F2::•(<core::int>[]);
new self::F2::•(<core::int>[3]);
- new self::F2::•(<core::int>[let final dynamic #t5 = "hello" in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_constructor_arguments_infer_downwards.dart:51:69: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ new self::F2::•(<core::int>[let final dynamic #t9 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_constructor_arguments_infer_downwards.dart:51:69: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
/*@typeArgs=int*/ [/*error:LIST_ELEMENT_TYPE_NOT_ASSIGNABLE*/ \"hello\"]);
- ^"]);
- new self::F2::•(<core::int>[let final dynamic #t6 = "hello" in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_constructor_arguments_infer_downwards.dart:53:48: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ ^" in let final dynamic #t10 = "hello" in null]);
+ new self::F2::•(<core::int>[let final dynamic #t11 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_constructor_arguments_infer_downwards.dart:53:48: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
/*error:LIST_ELEMENT_TYPE_NOT_ASSIGNABLE*/ \"hello\",
- ^", 3]);
+ ^" in let final dynamic #t12 = "hello" in null, 3]);
new self::F3::•(<core::Iterable<core::int>>[]);
new self::F3::•(<core::Iterable<core::int>>[<core::int>[3]]);
- new self::F3::•(<core::Iterable<core::int>>[<core::int>[let final dynamic #t7 = "hello" in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_constructor_arguments_infer_downwards.dart:62:67: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ new self::F3::•(<core::Iterable<core::int>>[<core::int>[let final dynamic #t13 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_constructor_arguments_infer_downwards.dart:62:67: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
/*@typeArgs=int*/ [/*error:LIST_ELEMENT_TYPE_NOT_ASSIGNABLE*/ \"hello\"]
- ^"]]);
- new self::F3::•(<core::Iterable<core::int>>[<core::int>[let final dynamic #t8 = "hello" in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_constructor_arguments_infer_downwards.dart:65:67: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ ^" in let final dynamic #t14 = "hello" in null]]);
+ new self::F3::•(<core::Iterable<core::int>>[<core::int>[let final dynamic #t15 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_constructor_arguments_infer_downwards.dart:65:67: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
/*@typeArgs=int*/ [/*error:LIST_ELEMENT_TYPE_NOT_ASSIGNABLE*/ \"hello\"],
- ^"], <core::int>[3]]);
+ ^" in let final dynamic #t16 = "hello" in null], <core::int>[3]]);
new self::F4::•(a: <core::Iterable<core::int>>[]);
new self::F4::•(a: <core::Iterable<core::int>>[<core::int>[3]]);
- new self::F4::•(a: <core::Iterable<core::int>>[<core::int>[let final dynamic #t9 = "hello" in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_constructor_arguments_infer_downwards.dart:74:67: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ new self::F4::•(a: <core::Iterable<core::int>>[<core::int>[let final dynamic #t17 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_constructor_arguments_infer_downwards.dart:74:67: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
/*@typeArgs=int*/ [/*error:LIST_ELEMENT_TYPE_NOT_ASSIGNABLE*/ \"hello\"]
- ^"]]);
- new self::F4::•(a: <core::Iterable<core::int>>[<core::int>[let final dynamic #t10 = "hello" in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_constructor_arguments_infer_downwards.dart:77:67: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ ^" in let final dynamic #t18 = "hello" in null]]);
+ new self::F4::•(a: <core::Iterable<core::int>>[<core::int>[let final dynamic #t19 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_constructor_arguments_infer_downwards.dart:77:67: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
/*@typeArgs=int*/ [/*error:LIST_ELEMENT_TYPE_NOT_ASSIGNABLE*/ \"hello\"],
- ^"], <core::int>[3]]);
+ ^" in let final dynamic #t20 = "hello" in null], <core::int>[3]]);
}
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/downwards_inference_on_constructor_arguments_infer_downwards.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/downwards_inference_on_constructor_arguments_infer_downwards.dart.strong.transformed.expect
index e235fe9..0606923 100644
--- a/pkg/front_end/testcases/inference/downwards_inference_on_constructor_arguments_infer_downwards.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/downwards_inference_on_constructor_arguments_infer_downwards.dart.strong.transformed.expect
@@ -25,53 +25,53 @@
static method test() → void {
new self::F0::•(<core::int>[]);
new self::F0::•(<core::int>[3]);
- new self::F0::•(<core::int>[let final core::String #t1 = "hello" in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_constructor_arguments_infer_downwards.dart:32:69: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ new self::F0::•(<core::int>[let final dynamic #t1 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_constructor_arguments_infer_downwards.dart:32:69: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
/*@typeArgs=int*/ [/*error:LIST_ELEMENT_TYPE_NOT_ASSIGNABLE*/ \"hello\"]);
- ^"]);
- new self::F0::•(<core::int>[let final core::String #t2 = "hello" in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_constructor_arguments_infer_downwards.dart:34:48: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ ^" in let final core::String #t2 = "hello" in null]);
+ new self::F0::•(<core::int>[let final dynamic #t3 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_constructor_arguments_infer_downwards.dart:34:48: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
/*error:LIST_ELEMENT_TYPE_NOT_ASSIGNABLE*/ \"hello\",
- ^", 3]);
+ ^" in let final core::String #t4 = "hello" in null, 3]);
new self::F1::•(a: <core::int>[]);
new self::F1::•(a: <core::int>[3]);
- new self::F1::•(a: <core::int>[let final core::String #t3 = "hello" in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_constructor_arguments_infer_downwards.dart:41:48: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ new self::F1::•(a: <core::int>[let final dynamic #t5 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_constructor_arguments_infer_downwards.dart:41:48: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
/*error:LIST_ELEMENT_TYPE_NOT_ASSIGNABLE*/ \"hello\"
- ^"]);
- new self::F1::•(a: <core::int>[let final core::String #t4 = "hello" in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_constructor_arguments_infer_downwards.dart:44:48: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ ^" in let final core::String #t6 = "hello" in null]);
+ new self::F1::•(a: <core::int>[let final dynamic #t7 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_constructor_arguments_infer_downwards.dart:44:48: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
/*error:LIST_ELEMENT_TYPE_NOT_ASSIGNABLE*/ \"hello\",
- ^", 3]);
+ ^" in let final core::String #t8 = "hello" in null, 3]);
new self::F2::•(<core::int>[]);
new self::F2::•(<core::int>[3]);
- new self::F2::•(<core::int>[let final core::String #t5 = "hello" in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_constructor_arguments_infer_downwards.dart:51:69: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ new self::F2::•(<core::int>[let final dynamic #t9 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_constructor_arguments_infer_downwards.dart:51:69: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
/*@typeArgs=int*/ [/*error:LIST_ELEMENT_TYPE_NOT_ASSIGNABLE*/ \"hello\"]);
- ^"]);
- new self::F2::•(<core::int>[let final core::String #t6 = "hello" in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_constructor_arguments_infer_downwards.dart:53:48: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ ^" in let final core::String #t10 = "hello" in null]);
+ new self::F2::•(<core::int>[let final dynamic #t11 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_constructor_arguments_infer_downwards.dart:53:48: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
/*error:LIST_ELEMENT_TYPE_NOT_ASSIGNABLE*/ \"hello\",
- ^", 3]);
+ ^" in let final core::String #t12 = "hello" in null, 3]);
new self::F3::•(<core::Iterable<core::int>>[]);
new self::F3::•(<core::Iterable<core::int>>[<core::int>[3]]);
- new self::F3::•(<core::Iterable<core::int>>[<core::int>[let final core::String #t7 = "hello" in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_constructor_arguments_infer_downwards.dart:62:67: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ new self::F3::•(<core::Iterable<core::int>>[<core::int>[let final dynamic #t13 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_constructor_arguments_infer_downwards.dart:62:67: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
/*@typeArgs=int*/ [/*error:LIST_ELEMENT_TYPE_NOT_ASSIGNABLE*/ \"hello\"]
- ^"]]);
- new self::F3::•(<core::Iterable<core::int>>[<core::int>[let final core::String #t8 = "hello" in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_constructor_arguments_infer_downwards.dart:65:67: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ ^" in let final core::String #t14 = "hello" in null]]);
+ new self::F3::•(<core::Iterable<core::int>>[<core::int>[let final dynamic #t15 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_constructor_arguments_infer_downwards.dart:65:67: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
/*@typeArgs=int*/ [/*error:LIST_ELEMENT_TYPE_NOT_ASSIGNABLE*/ \"hello\"],
- ^"], <core::int>[3]]);
+ ^" in let final core::String #t16 = "hello" in null], <core::int>[3]]);
new self::F4::•(a: <core::Iterable<core::int>>[]);
new self::F4::•(a: <core::Iterable<core::int>>[<core::int>[3]]);
- new self::F4::•(a: <core::Iterable<core::int>>[<core::int>[let final core::String #t9 = "hello" in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_constructor_arguments_infer_downwards.dart:74:67: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ new self::F4::•(a: <core::Iterable<core::int>>[<core::int>[let final dynamic #t17 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_constructor_arguments_infer_downwards.dart:74:67: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
/*@typeArgs=int*/ [/*error:LIST_ELEMENT_TYPE_NOT_ASSIGNABLE*/ \"hello\"]
- ^"]]);
- new self::F4::•(a: <core::Iterable<core::int>>[<core::int>[let final core::String #t10 = "hello" in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_constructor_arguments_infer_downwards.dart:77:67: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ ^" in let final core::String #t18 = "hello" in null]]);
+ new self::F4::•(a: <core::Iterable<core::int>>[<core::int>[let final dynamic #t19 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_constructor_arguments_infer_downwards.dart:77:67: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
/*@typeArgs=int*/ [/*error:LIST_ELEMENT_TYPE_NOT_ASSIGNABLE*/ \"hello\"],
- ^"], <core::int>[3]]);
+ ^" in let final core::String #t20 = "hello" in null], <core::int>[3]]);
}
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/downwards_inference_on_function_arguments_infer_downwards.dart.strong.expect b/pkg/front_end/testcases/inference/downwards_inference_on_function_arguments_infer_downwards.dart.strong.expect
index 039b9a5..bd9133d 100644
--- a/pkg/front_end/testcases/inference/downwards_inference_on_function_arguments_infer_downwards.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/downwards_inference_on_function_arguments_infer_downwards.dart.strong.expect
@@ -10,53 +10,53 @@
static method test() → void {
self::f0(<core::int>[]);
self::f0(<core::int>[3]);
- self::f0(<core::int>[let final dynamic #t1 = "hello" in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_function_arguments_infer_downwards.dart:16:68: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ self::f0(<core::int>[let final dynamic #t1 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_function_arguments_infer_downwards.dart:16:68: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
f0(/*@typeArgs=int*/ [/*error:LIST_ELEMENT_TYPE_NOT_ASSIGNABLE*/ \"hello\"]);
- ^"]);
- self::f0(<core::int>[let final dynamic #t2 = "hello" in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_function_arguments_infer_downwards.dart:17:68: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ ^" in let final dynamic #t2 = "hello" in null]);
+ self::f0(<core::int>[let final dynamic #t3 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_function_arguments_infer_downwards.dart:17:68: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
f0(/*@typeArgs=int*/ [/*error:LIST_ELEMENT_TYPE_NOT_ASSIGNABLE*/ \"hello\", 3]);
- ^", 3]);
+ ^" in let final dynamic #t4 = "hello" in null, 3]);
self::f1(a: <core::int>[]);
self::f1(a: <core::int>[3]);
- self::f1(a: <core::int>[let final dynamic #t3 = "hello" in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_function_arguments_infer_downwards.dart:21:71: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ self::f1(a: <core::int>[let final dynamic #t5 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_function_arguments_infer_downwards.dart:21:71: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
f1(a: /*@typeArgs=int*/ [/*error:LIST_ELEMENT_TYPE_NOT_ASSIGNABLE*/ \"hello\"]);
- ^"]);
- self::f1(a: <core::int>[let final dynamic #t4 = "hello" in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_function_arguments_infer_downwards.dart:23:48: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ ^" in let final dynamic #t6 = "hello" in null]);
+ self::f1(a: <core::int>[let final dynamic #t7 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_function_arguments_infer_downwards.dart:23:48: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
/*error:LIST_ELEMENT_TYPE_NOT_ASSIGNABLE*/ \"hello\",
- ^", 3]);
+ ^" in let final dynamic #t8 = "hello" in null, 3]);
self::f2(<core::int>[]);
self::f2(<core::int>[3]);
- self::f2(<core::int>[let final dynamic #t5 = "hello" in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_function_arguments_infer_downwards.dart:29:68: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ self::f2(<core::int>[let final dynamic #t9 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_function_arguments_infer_downwards.dart:29:68: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
f2(/*@typeArgs=int*/ [/*error:LIST_ELEMENT_TYPE_NOT_ASSIGNABLE*/ \"hello\"]);
- ^"]);
- self::f2(<core::int>[let final dynamic #t6 = "hello" in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_function_arguments_infer_downwards.dart:30:68: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ ^" in let final dynamic #t10 = "hello" in null]);
+ self::f2(<core::int>[let final dynamic #t11 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_function_arguments_infer_downwards.dart:30:68: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
f2(/*@typeArgs=int*/ [/*error:LIST_ELEMENT_TYPE_NOT_ASSIGNABLE*/ \"hello\", 3]);
- ^", 3]);
+ ^" in let final dynamic #t12 = "hello" in null, 3]);
self::f3(<core::Iterable<core::int>>[]);
self::f3(<core::Iterable<core::int>>[<core::int>[3]]);
- self::f3(<core::Iterable<core::int>>[<core::int>[let final dynamic #t7 = "hello" in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_function_arguments_infer_downwards.dart:37:67: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ self::f3(<core::Iterable<core::int>>[<core::int>[let final dynamic #t13 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_function_arguments_infer_downwards.dart:37:67: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
/*@typeArgs=int*/ [/*error:LIST_ELEMENT_TYPE_NOT_ASSIGNABLE*/ \"hello\"]
- ^"]]);
- self::f3(<core::Iterable<core::int>>[<core::int>[let final dynamic #t8 = "hello" in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_function_arguments_infer_downwards.dart:40:67: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ ^" in let final dynamic #t14 = "hello" in null]]);
+ self::f3(<core::Iterable<core::int>>[<core::int>[let final dynamic #t15 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_function_arguments_infer_downwards.dart:40:67: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
/*@typeArgs=int*/ [/*error:LIST_ELEMENT_TYPE_NOT_ASSIGNABLE*/ \"hello\"],
- ^"], <core::int>[3]]);
+ ^" in let final dynamic #t16 = "hello" in null], <core::int>[3]]);
self::f4(a: <core::Iterable<core::int>>[]);
self::f4(a: <core::Iterable<core::int>>[<core::int>[3]]);
- self::f4(a: <core::Iterable<core::int>>[<core::int>[let final dynamic #t9 = "hello" in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_function_arguments_infer_downwards.dart:49:67: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ self::f4(a: <core::Iterable<core::int>>[<core::int>[let final dynamic #t17 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_function_arguments_infer_downwards.dart:49:67: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
/*@typeArgs=int*/ [/*error:LIST_ELEMENT_TYPE_NOT_ASSIGNABLE*/ \"hello\"]
- ^"]]);
- self::f4(a: <core::Iterable<core::int>>[<core::int>[let final dynamic #t10 = "hello" in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_function_arguments_infer_downwards.dart:52:67: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ ^" in let final dynamic #t18 = "hello" in null]]);
+ self::f4(a: <core::Iterable<core::int>>[<core::int>[let final dynamic #t19 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_function_arguments_infer_downwards.dart:52:67: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
/*@typeArgs=int*/ [/*error:LIST_ELEMENT_TYPE_NOT_ASSIGNABLE*/ \"hello\"],
- ^"], <core::int>[3]]);
+ ^" in let final dynamic #t20 = "hello" in null], <core::int>[3]]);
}
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/downwards_inference_on_function_arguments_infer_downwards.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/downwards_inference_on_function_arguments_infer_downwards.dart.strong.transformed.expect
index 9e5a69c..52a7af1 100644
--- a/pkg/front_end/testcases/inference/downwards_inference_on_function_arguments_infer_downwards.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/downwards_inference_on_function_arguments_infer_downwards.dart.strong.transformed.expect
@@ -10,53 +10,53 @@
static method test() → void {
self::f0(<core::int>[]);
self::f0(<core::int>[3]);
- self::f0(<core::int>[let final core::String #t1 = "hello" in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_function_arguments_infer_downwards.dart:16:68: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ self::f0(<core::int>[let final dynamic #t1 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_function_arguments_infer_downwards.dart:16:68: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
f0(/*@typeArgs=int*/ [/*error:LIST_ELEMENT_TYPE_NOT_ASSIGNABLE*/ \"hello\"]);
- ^"]);
- self::f0(<core::int>[let final core::String #t2 = "hello" in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_function_arguments_infer_downwards.dart:17:68: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ ^" in let final core::String #t2 = "hello" in null]);
+ self::f0(<core::int>[let final dynamic #t3 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_function_arguments_infer_downwards.dart:17:68: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
f0(/*@typeArgs=int*/ [/*error:LIST_ELEMENT_TYPE_NOT_ASSIGNABLE*/ \"hello\", 3]);
- ^", 3]);
+ ^" in let final core::String #t4 = "hello" in null, 3]);
self::f1(a: <core::int>[]);
self::f1(a: <core::int>[3]);
- self::f1(a: <core::int>[let final core::String #t3 = "hello" in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_function_arguments_infer_downwards.dart:21:71: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ self::f1(a: <core::int>[let final dynamic #t5 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_function_arguments_infer_downwards.dart:21:71: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
f1(a: /*@typeArgs=int*/ [/*error:LIST_ELEMENT_TYPE_NOT_ASSIGNABLE*/ \"hello\"]);
- ^"]);
- self::f1(a: <core::int>[let final core::String #t4 = "hello" in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_function_arguments_infer_downwards.dart:23:48: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ ^" in let final core::String #t6 = "hello" in null]);
+ self::f1(a: <core::int>[let final dynamic #t7 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_function_arguments_infer_downwards.dart:23:48: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
/*error:LIST_ELEMENT_TYPE_NOT_ASSIGNABLE*/ \"hello\",
- ^", 3]);
+ ^" in let final core::String #t8 = "hello" in null, 3]);
self::f2(<core::int>[]);
self::f2(<core::int>[3]);
- self::f2(<core::int>[let final core::String #t5 = "hello" in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_function_arguments_infer_downwards.dart:29:68: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ self::f2(<core::int>[let final dynamic #t9 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_function_arguments_infer_downwards.dart:29:68: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
f2(/*@typeArgs=int*/ [/*error:LIST_ELEMENT_TYPE_NOT_ASSIGNABLE*/ \"hello\"]);
- ^"]);
- self::f2(<core::int>[let final core::String #t6 = "hello" in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_function_arguments_infer_downwards.dart:30:68: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ ^" in let final core::String #t10 = "hello" in null]);
+ self::f2(<core::int>[let final dynamic #t11 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_function_arguments_infer_downwards.dart:30:68: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
f2(/*@typeArgs=int*/ [/*error:LIST_ELEMENT_TYPE_NOT_ASSIGNABLE*/ \"hello\", 3]);
- ^", 3]);
+ ^" in let final core::String #t12 = "hello" in null, 3]);
self::f3(<core::Iterable<core::int>>[]);
self::f3(<core::Iterable<core::int>>[<core::int>[3]]);
- self::f3(<core::Iterable<core::int>>[<core::int>[let final core::String #t7 = "hello" in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_function_arguments_infer_downwards.dart:37:67: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ self::f3(<core::Iterable<core::int>>[<core::int>[let final dynamic #t13 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_function_arguments_infer_downwards.dart:37:67: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
/*@typeArgs=int*/ [/*error:LIST_ELEMENT_TYPE_NOT_ASSIGNABLE*/ \"hello\"]
- ^"]]);
- self::f3(<core::Iterable<core::int>>[<core::int>[let final core::String #t8 = "hello" in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_function_arguments_infer_downwards.dart:40:67: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ ^" in let final core::String #t14 = "hello" in null]]);
+ self::f3(<core::Iterable<core::int>>[<core::int>[let final dynamic #t15 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_function_arguments_infer_downwards.dart:40:67: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
/*@typeArgs=int*/ [/*error:LIST_ELEMENT_TYPE_NOT_ASSIGNABLE*/ \"hello\"],
- ^"], <core::int>[3]]);
+ ^" in let final core::String #t16 = "hello" in null], <core::int>[3]]);
self::f4(a: <core::Iterable<core::int>>[]);
self::f4(a: <core::Iterable<core::int>>[<core::int>[3]]);
- self::f4(a: <core::Iterable<core::int>>[<core::int>[let final core::String #t9 = "hello" in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_function_arguments_infer_downwards.dart:49:67: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ self::f4(a: <core::Iterable<core::int>>[<core::int>[let final dynamic #t17 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_function_arguments_infer_downwards.dart:49:67: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
/*@typeArgs=int*/ [/*error:LIST_ELEMENT_TYPE_NOT_ASSIGNABLE*/ \"hello\"]
- ^"]]);
- self::f4(a: <core::Iterable<core::int>>[<core::int>[let final core::String #t10 = "hello" in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_function_arguments_infer_downwards.dart:52:67: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ ^" in let final core::String #t18 = "hello" in null]]);
+ self::f4(a: <core::Iterable<core::int>>[<core::int>[let final dynamic #t19 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_function_arguments_infer_downwards.dart:52:67: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
/*@typeArgs=int*/ [/*error:LIST_ELEMENT_TYPE_NOT_ASSIGNABLE*/ \"hello\"],
- ^"], <core::int>[3]]);
+ ^" in let final core::String #t20 = "hello" in null], <core::int>[3]]);
}
static method main() → dynamic {}
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 e11e0c0..419a2d6 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
@@ -7,67 +7,67 @@
{
(core::int) → core::String l0 = (core::int x) → core::Null => null;
(core::int) → core::String l1 = (core::int x) → core::String => "hello";
- (core::int) → core::String l2 = let final dynamic #t1 = (core::String x) → core::String => "hello" in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_function_expressions.dart:15:66: Error: A value of type '(dart.core::String) \u8594 dart.core::String' can't be assigned to a variable of type '(dart.core::int) \u8594 dart.core::String'.
+ (core::int) → core::String l2 = let final dynamic #t1 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_function_expressions.dart:15:66: Error: A value of type '(dart.core::String) \u8594 dart.core::String' can't be assigned to a variable of type '(dart.core::int) \u8594 dart.core::String'.
Try changing the type of the left hand side, or casting the right hand side to '(dart.core::int) \u8594 dart.core::String'.
l2 = /*error:INVALID_ASSIGNMENT*/ /*@returnType=String*/ (String x) =>
- ^";
- (core::int) → core::String l3 = (core::int x) → core::String => let final dynamic #t2 = 3 in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_function_expressions.dart:18:77: 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 = (core::String x) → core::String => "hello" in null;
+ (core::int) → core::String l3 = (core::int x) → core::String => let final dynamic #t3 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_function_expressions.dart:18:77: 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'.
l3 = /*error:INVALID_ASSIGNMENT*/ /*@returnType=String*/ (int x) => 3;
- ^";
+ ^" in let final dynamic #t4 = 3 in null;
(core::int) → core::String l4 = (core::int x) → core::String {
- return let final dynamic #t3 = 3 in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_function_expressions.dart:20:47: Error: A value of type 'dart.core::int' can't be assigned to a variable of type 'dart.core::String'.
+ return let final dynamic #t5 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_function_expressions.dart:20: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 #t6 = 3 in null;
};
}
{
(core::int) → core::String l0 = (core::int x) → core::Null => null;
(core::int) → core::String l1 = (core::int x) → core::String => "hello";
- (core::int) → core::String l2 = (core::int x) → core::String => let final dynamic #t4 = 3 in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_function_expressions.dart:29:13: Error: A value of type 'dart.core::int' can't be assigned to a variable of type 'dart.core::String'.
+ (core::int) → core::String l2 = (core::int x) → core::String => let final dynamic #t7 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_function_expressions.dart:29:13: 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;
(core::int) → core::String l3 = (core::int x) → core::String {
- return let final dynamic #t5 = 3 in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_function_expressions.dart:31:47: Error: A value of type 'dart.core::int' can't be assigned to a variable of type 'dart.core::String'.
+ return let final dynamic #t9 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_function_expressions.dart:31: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;
};
(core::int) → core::String l4 = (core::int x) → core::String {
- return let final dynamic #t6 = x in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_function_expressions.dart:34:47: Error: A value of type 'dart.core::int' can't be assigned to a variable of type 'dart.core::String'.
+ return let final dynamic #t11 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_function_expressions.dart:34: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;
- ^";
+ ^" in let final dynamic #t12 = x in null;
};
}
{
(core::int) → core::List<core::String> l0 = (core::int x) → core::Null => null;
(core::int) → core::List<core::String> l1 = (core::int x) → core::List<core::String> => <core::String>["hello"];
- (core::int) → core::List<core::String> l2 = let final dynamic #t7 = (core::String x) → core::List<core::String> => <core::String>["hello"] in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_function_expressions.dart:42:72: Error: A value of type '(dart.core::String) \u8594 dart.core::List<dart.core::String>' can't be assigned to a variable of type '(dart.core::int) \u8594 dart.core::List<dart.core::String>'.
+ (core::int) → core::List<core::String> l2 = let final dynamic #t13 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_function_expressions.dart:42:72: Error: A value of type '(dart.core::String) \u8594 dart.core::List<dart.core::String>' can't be assigned to a variable of type '(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 '(dart.core::int) \u8594 dart.core::List<dart.core::String>'.
l2 = /*error:INVALID_ASSIGNMENT*/ /*@returnType=List<String>*/ (String
- ^";
- (core::int) → core::List<core::String> l3 = (core::int x) → core::List<core::String> => <core::String>[let final dynamic #t8 = 3 in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_function_expressions.dart:46:58: 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 = (core::String x) → core::List<core::String> => <core::String>["hello"] in null;
+ (core::int) → core::List<core::String> l3 = (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_function_expressions.dart:46:58: 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];
(core::int) → core::List<core::String> l4 = (core::int x) → core::List<core::String> {
- return <core::String>[let final dynamic #t9 = 3 in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_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'.
+ return <core::String>[let final dynamic #t17 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_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
- ^"];
+ ^" in let final dynamic #t18 = 3 in null];
};
}
{
(core::int) → core::int l0 = (core::int x) → core::int => x;
(core::int) → core::int l1 = (core::int x) → core::int => x.{core::num::+}(1);
- (core::int) → core::String l2 = (core::int x) → core::String => let final dynamic #t10 = x in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_function_expressions.dart:60:13: Error: A value of type 'dart.core::int' can't be assigned to a variable of type 'dart.core::String'.
+ (core::int) → core::String l2 = (core::int x) → core::String => let final dynamic #t19 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_function_expressions.dart:60:13: 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;
- ^";
- (core::int) → core::String l3 = (core::int x) → core::String => (let final dynamic #t11 = x in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_function_expressions.dart:63:14: Error: The method 'substring' isn't defined for the class 'dart.core::int'.
+ ^" in let final dynamic #t20 = x in null;
+ (core::int) → core::String l3 = (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_function_expressions.dart:63:14: 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;
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 d8951be..7e72e90 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
@@ -7,67 +7,67 @@
{
(core::int) → core::String l0 = (core::int x) → core::Null => null;
(core::int) → core::String l1 = (core::int x) → core::String => "hello";
- (core::int) → core::String l2 = let final (core::String) → core::String #t1 = (core::String x) → core::String => "hello" in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_function_expressions.dart:15:66: Error: A value of type '(dart.core::String) \u8594 dart.core::String' can't be assigned to a variable of type '(dart.core::int) \u8594 dart.core::String'.
+ (core::int) → core::String l2 = let final dynamic #t1 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_function_expressions.dart:15:66: Error: A value of type '(dart.core::String) \u8594 dart.core::String' can't be assigned to a variable of type '(dart.core::int) \u8594 dart.core::String'.
Try changing the type of the left hand side, or casting the right hand side to '(dart.core::int) \u8594 dart.core::String'.
l2 = /*error:INVALID_ASSIGNMENT*/ /*@returnType=String*/ (String x) =>
- ^";
- (core::int) → core::String l3 = (core::int x) → core::String => let final core::int #t2 = 3 in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_function_expressions.dart:18:77: Error: A value of type 'dart.core::int' can't be assigned to a variable of type 'dart.core::String'.
+ ^" in let final (core::String) → core::String #t2 = (core::String x) → core::String => "hello" in null;
+ (core::int) → core::String l3 = (core::int x) → core::String => let final dynamic #t3 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_function_expressions.dart:18:77: 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'.
l3 = /*error:INVALID_ASSIGNMENT*/ /*@returnType=String*/ (int x) => 3;
- ^";
+ ^" in let final core::int #t4 = 3 in null;
(core::int) → core::String l4 = (core::int x) → core::String {
- return let final core::int #t3 = 3 in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_function_expressions.dart:20:47: Error: A value of type 'dart.core::int' can't be assigned to a variable of type 'dart.core::String'.
+ return let final dynamic #t5 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_function_expressions.dart:20: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 #t6 = 3 in null;
};
}
{
(core::int) → core::String l0 = (core::int x) → core::Null => null;
(core::int) → core::String l1 = (core::int x) → core::String => "hello";
- (core::int) → core::String l2 = (core::int x) → core::String => let final core::int #t4 = 3 in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_function_expressions.dart:29:13: Error: A value of type 'dart.core::int' can't be assigned to a variable of type 'dart.core::String'.
+ (core::int) → core::String l2 = (core::int x) → core::String => let final dynamic #t7 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_function_expressions.dart:29:13: 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;
(core::int) → core::String l3 = (core::int x) → core::String {
- return let final core::int #t5 = 3 in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_function_expressions.dart:31:47: Error: A value of type 'dart.core::int' can't be assigned to a variable of type 'dart.core::String'.
+ return let final dynamic #t9 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_function_expressions.dart:31: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;
};
(core::int) → core::String l4 = (core::int x) → core::String {
- return let final core::int #t6 = x in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_function_expressions.dart:34:47: Error: A value of type 'dart.core::int' can't be assigned to a variable of type 'dart.core::String'.
+ return let final dynamic #t11 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_function_expressions.dart:34: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;
- ^";
+ ^" in let final core::int #t12 = x in null;
};
}
{
(core::int) → core::List<core::String> l0 = (core::int x) → core::Null => null;
(core::int) → core::List<core::String> l1 = (core::int x) → core::List<core::String> => <core::String>["hello"];
- (core::int) → core::List<core::String> l2 = let final (core::String) → core::List<core::String> #t7 = (core::String x) → core::List<core::String> => <core::String>["hello"] in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_function_expressions.dart:42:72: Error: A value of type '(dart.core::String) \u8594 dart.core::List<dart.core::String>' can't be assigned to a variable of type '(dart.core::int) \u8594 dart.core::List<dart.core::String>'.
+ (core::int) → core::List<core::String> l2 = let final dynamic #t13 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_function_expressions.dart:42:72: Error: A value of type '(dart.core::String) \u8594 dart.core::List<dart.core::String>' can't be assigned to a variable of type '(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 '(dart.core::int) \u8594 dart.core::List<dart.core::String>'.
l2 = /*error:INVALID_ASSIGNMENT*/ /*@returnType=List<String>*/ (String
- ^";
- (core::int) → core::List<core::String> l3 = (core::int x) → core::List<core::String> => <core::String>[let final core::int #t8 = 3 in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_function_expressions.dart:46:58: Error: A value of type 'dart.core::int' can't be assigned to a variable of type 'dart.core::String'.
+ ^" in let final (core::String) → core::List<core::String> #t14 = (core::String x) → core::List<core::String> => <core::String>["hello"] in null;
+ (core::int) → core::List<core::String> l3 = (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_function_expressions.dart:46:58: 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];
(core::int) → core::List<core::String> l4 = (core::int x) → core::List<core::String> {
- return <core::String>[let final core::int #t9 = 3 in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_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'.
+ return <core::String>[let final dynamic #t17 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_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
- ^"];
+ ^" in let final core::int #t18 = 3 in null];
};
}
{
(core::int) → core::int l0 = (core::int x) → core::int => x;
(core::int) → core::int l1 = (core::int x) → core::int => x.{core::num::+}(1);
- (core::int) → core::String l2 = (core::int x) → core::String => let final core::int #t10 = x in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_function_expressions.dart:60:13: Error: A value of type 'dart.core::int' can't be assigned to a variable of type 'dart.core::String'.
+ (core::int) → core::String l2 = (core::int x) → core::String => let final dynamic #t19 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_function_expressions.dart:60:13: 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;
- ^";
- (core::int) → core::String l3 = (core::int x) → core::String => (let final core::int #t11 = x in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_function_expressions.dart:63:14: Error: The method 'substring' isn't defined for the class 'dart.core::int'.
+ ^" in let final core::int #t20 = x in null;
+ (core::int) → core::String l3 = (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_function_expressions.dart:63:14: 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;
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 4d7dbdf..2984bb7 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
@@ -25,54 +25,54 @@
static method test() → void {
new self::F0::•<core::int>(<core::int>[]);
new self::F0::•<core::int>(<core::int>[3]);
- new self::F0::•<core::int>(<core::int>[let final dynamic #t1 = "hello" in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_generic_constructor_arguments_infer_downwards.dart:32:69: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ new self::F0::•<core::int>(<core::int>[let final dynamic #t1 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_generic_constructor_arguments_infer_downwards.dart:32:69: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
/*@typeArgs=int*/ [/*error:LIST_ELEMENT_TYPE_NOT_ASSIGNABLE*/ \"hello\"]);
- ^"]);
- new self::F0::•<core::int>(<core::int>[let final dynamic #t2 = "hello" in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_generic_constructor_arguments_infer_downwards.dart:34:48: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ ^" in let final dynamic #t2 = "hello" in null]);
+ new self::F0::•<core::int>(<core::int>[let final dynamic #t3 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_generic_constructor_arguments_infer_downwards.dart:34:48: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
/*error:LIST_ELEMENT_TYPE_NOT_ASSIGNABLE*/ \"hello\",
- ^", 3]);
+ ^" in let final dynamic #t4 = "hello" in null, 3]);
new self::F1::•<core::int>(a: <core::int>[]);
new self::F1::•<core::int>(a: <core::int>[3]);
- new self::F1::•<core::int>(a: <core::int>[let final dynamic #t3 = "hello" in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_generic_constructor_arguments_infer_downwards.dart:41:48: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ new self::F1::•<core::int>(a: <core::int>[let final dynamic #t5 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_generic_constructor_arguments_infer_downwards.dart:41:48: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
/*error:LIST_ELEMENT_TYPE_NOT_ASSIGNABLE*/ \"hello\"
- ^"]);
- new self::F1::•<core::int>(a: <core::int>[let final dynamic #t4 = "hello" in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_generic_constructor_arguments_infer_downwards.dart:44:48: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ ^" in let final dynamic #t6 = "hello" in null]);
+ new self::F1::•<core::int>(a: <core::int>[let final dynamic #t7 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_generic_constructor_arguments_infer_downwards.dart:44:48: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
/*error:LIST_ELEMENT_TYPE_NOT_ASSIGNABLE*/ \"hello\",
- ^", 3]);
+ ^" in let final dynamic #t8 = "hello" in null, 3]);
new self::F2::•<core::int>(<core::int>[]);
new self::F2::•<core::int>(<core::int>[3]);
- new self::F2::•<core::int>(<core::int>[let final dynamic #t5 = "hello" in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_generic_constructor_arguments_infer_downwards.dart:51:69: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ new self::F2::•<core::int>(<core::int>[let final dynamic #t9 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_generic_constructor_arguments_infer_downwards.dart:51:69: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
/*@typeArgs=int*/ [/*error:LIST_ELEMENT_TYPE_NOT_ASSIGNABLE*/ \"hello\"]);
- ^"]);
- new self::F2::•<core::int>(<core::int>[let final dynamic #t6 = "hello" in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_generic_constructor_arguments_infer_downwards.dart:53:48: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ ^" in let final dynamic #t10 = "hello" in null]);
+ new self::F2::•<core::int>(<core::int>[let final dynamic #t11 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_generic_constructor_arguments_infer_downwards.dart:53:48: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
/*error:LIST_ELEMENT_TYPE_NOT_ASSIGNABLE*/ \"hello\",
- ^", 3]);
+ ^" in let final dynamic #t12 = "hello" in null, 3]);
new self::F3::•<core::int>(<core::Iterable<core::int>>[]);
new self::F3::•<core::int>(<core::Iterable<core::int>>[<core::int>[3]]);
- new self::F3::•<core::int>(<core::Iterable<core::int>>[<core::int>[let final dynamic #t7 = "hello" in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_generic_constructor_arguments_infer_downwards.dart:62:67: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ new self::F3::•<core::int>(<core::Iterable<core::int>>[<core::int>[let final dynamic #t13 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_generic_constructor_arguments_infer_downwards.dart:62:67: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
/*@typeArgs=int*/ [/*error:LIST_ELEMENT_TYPE_NOT_ASSIGNABLE*/ \"hello\"]
- ^"]]);
- new self::F3::•<core::int>(<core::Iterable<core::int>>[<core::int>[let final dynamic #t8 = "hello" in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_generic_constructor_arguments_infer_downwards.dart:65:67: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ ^" in let final dynamic #t14 = "hello" in null]]);
+ new self::F3::•<core::int>(<core::Iterable<core::int>>[<core::int>[let final dynamic #t15 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_generic_constructor_arguments_infer_downwards.dart:65:67: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
/*@typeArgs=int*/ [/*error:LIST_ELEMENT_TYPE_NOT_ASSIGNABLE*/ \"hello\"],
- ^"], <core::int>[3]]);
+ ^" in let final dynamic #t16 = "hello" in null], <core::int>[3]]);
new self::F4::•<core::int>(a: <core::Iterable<core::int>>[]);
new self::F4::•<core::int>(a: <core::Iterable<core::int>>[<core::int>[3]]);
- new self::F4::•<core::int>(a: <core::Iterable<core::int>>[<core::int>[let final dynamic #t9 = "hello" in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_generic_constructor_arguments_infer_downwards.dart:74:67: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ new self::F4::•<core::int>(a: <core::Iterable<core::int>>[<core::int>[let final dynamic #t17 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_generic_constructor_arguments_infer_downwards.dart:74:67: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
/*@typeArgs=int*/ [/*error:LIST_ELEMENT_TYPE_NOT_ASSIGNABLE*/ \"hello\"]
- ^"]]);
- new self::F4::•<core::int>(a: <core::Iterable<core::int>>[<core::int>[let final dynamic #t10 = "hello" in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_generic_constructor_arguments_infer_downwards.dart:77:67: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ ^" in let final dynamic #t18 = "hello" in null]]);
+ new self::F4::•<core::int>(a: <core::Iterable<core::int>>[<core::int>[let final dynamic #t19 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_generic_constructor_arguments_infer_downwards.dart:77:67: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
/*@typeArgs=int*/ [/*error:LIST_ELEMENT_TYPE_NOT_ASSIGNABLE*/ \"hello\"],
- ^"], <core::int>[3]]);
+ ^" in let final dynamic #t20 = "hello" in null], <core::int>[3]]);
new self::F3::•<dynamic>(<core::Iterable<dynamic>>[]);
self::F3<core::int> f31 = new self::F3::•<core::int>(<core::List<core::int>>[<core::int>[3]]);
self::F3<core::String> f32 = new self::F3::•<core::String>(<core::List<core::String>>[<core::String>["hello"]]);
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 6a665cc..5aa4f1e 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
@@ -25,54 +25,54 @@
static method test() → void {
new self::F0::•<core::int>(<core::int>[]);
new self::F0::•<core::int>(<core::int>[3]);
- new self::F0::•<core::int>(<core::int>[let final core::String #t1 = "hello" in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_generic_constructor_arguments_infer_downwards.dart:32:69: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ new self::F0::•<core::int>(<core::int>[let final dynamic #t1 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_generic_constructor_arguments_infer_downwards.dart:32:69: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
/*@typeArgs=int*/ [/*error:LIST_ELEMENT_TYPE_NOT_ASSIGNABLE*/ \"hello\"]);
- ^"]);
- new self::F0::•<core::int>(<core::int>[let final core::String #t2 = "hello" in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_generic_constructor_arguments_infer_downwards.dart:34:48: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ ^" in let final core::String #t2 = "hello" in null]);
+ new self::F0::•<core::int>(<core::int>[let final dynamic #t3 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_generic_constructor_arguments_infer_downwards.dart:34:48: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
/*error:LIST_ELEMENT_TYPE_NOT_ASSIGNABLE*/ \"hello\",
- ^", 3]);
+ ^" in let final core::String #t4 = "hello" in null, 3]);
new self::F1::•<core::int>(a: <core::int>[]);
new self::F1::•<core::int>(a: <core::int>[3]);
- new self::F1::•<core::int>(a: <core::int>[let final core::String #t3 = "hello" in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_generic_constructor_arguments_infer_downwards.dart:41:48: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ new self::F1::•<core::int>(a: <core::int>[let final dynamic #t5 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_generic_constructor_arguments_infer_downwards.dart:41:48: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
/*error:LIST_ELEMENT_TYPE_NOT_ASSIGNABLE*/ \"hello\"
- ^"]);
- new self::F1::•<core::int>(a: <core::int>[let final core::String #t4 = "hello" in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_generic_constructor_arguments_infer_downwards.dart:44:48: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ ^" in let final core::String #t6 = "hello" in null]);
+ new self::F1::•<core::int>(a: <core::int>[let final dynamic #t7 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_generic_constructor_arguments_infer_downwards.dart:44:48: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
/*error:LIST_ELEMENT_TYPE_NOT_ASSIGNABLE*/ \"hello\",
- ^", 3]);
+ ^" in let final core::String #t8 = "hello" in null, 3]);
new self::F2::•<core::int>(<core::int>[]);
new self::F2::•<core::int>(<core::int>[3]);
- new self::F2::•<core::int>(<core::int>[let final core::String #t5 = "hello" in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_generic_constructor_arguments_infer_downwards.dart:51:69: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ new self::F2::•<core::int>(<core::int>[let final dynamic #t9 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_generic_constructor_arguments_infer_downwards.dart:51:69: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
/*@typeArgs=int*/ [/*error:LIST_ELEMENT_TYPE_NOT_ASSIGNABLE*/ \"hello\"]);
- ^"]);
- new self::F2::•<core::int>(<core::int>[let final core::String #t6 = "hello" in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_generic_constructor_arguments_infer_downwards.dart:53:48: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ ^" in let final core::String #t10 = "hello" in null]);
+ new self::F2::•<core::int>(<core::int>[let final dynamic #t11 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_generic_constructor_arguments_infer_downwards.dart:53:48: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
/*error:LIST_ELEMENT_TYPE_NOT_ASSIGNABLE*/ \"hello\",
- ^", 3]);
+ ^" in let final core::String #t12 = "hello" in null, 3]);
new self::F3::•<core::int>(<core::Iterable<core::int>>[]);
new self::F3::•<core::int>(<core::Iterable<core::int>>[<core::int>[3]]);
- new self::F3::•<core::int>(<core::Iterable<core::int>>[<core::int>[let final core::String #t7 = "hello" in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_generic_constructor_arguments_infer_downwards.dart:62:67: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ new self::F3::•<core::int>(<core::Iterable<core::int>>[<core::int>[let final dynamic #t13 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_generic_constructor_arguments_infer_downwards.dart:62:67: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
/*@typeArgs=int*/ [/*error:LIST_ELEMENT_TYPE_NOT_ASSIGNABLE*/ \"hello\"]
- ^"]]);
- new self::F3::•<core::int>(<core::Iterable<core::int>>[<core::int>[let final core::String #t8 = "hello" in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_generic_constructor_arguments_infer_downwards.dart:65:67: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ ^" in let final core::String #t14 = "hello" in null]]);
+ new self::F3::•<core::int>(<core::Iterable<core::int>>[<core::int>[let final dynamic #t15 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_generic_constructor_arguments_infer_downwards.dart:65:67: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
/*@typeArgs=int*/ [/*error:LIST_ELEMENT_TYPE_NOT_ASSIGNABLE*/ \"hello\"],
- ^"], <core::int>[3]]);
+ ^" in let final core::String #t16 = "hello" in null], <core::int>[3]]);
new self::F4::•<core::int>(a: <core::Iterable<core::int>>[]);
new self::F4::•<core::int>(a: <core::Iterable<core::int>>[<core::int>[3]]);
- new self::F4::•<core::int>(a: <core::Iterable<core::int>>[<core::int>[let final core::String #t9 = "hello" in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_generic_constructor_arguments_infer_downwards.dart:74:67: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ new self::F4::•<core::int>(a: <core::Iterable<core::int>>[<core::int>[let final dynamic #t17 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_generic_constructor_arguments_infer_downwards.dart:74:67: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
/*@typeArgs=int*/ [/*error:LIST_ELEMENT_TYPE_NOT_ASSIGNABLE*/ \"hello\"]
- ^"]]);
- new self::F4::•<core::int>(a: <core::Iterable<core::int>>[<core::int>[let final core::String #t10 = "hello" in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_generic_constructor_arguments_infer_downwards.dart:77:67: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ ^" in let final core::String #t18 = "hello" in null]]);
+ new self::F4::•<core::int>(a: <core::Iterable<core::int>>[<core::int>[let final dynamic #t19 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_generic_constructor_arguments_infer_downwards.dart:77:67: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
/*@typeArgs=int*/ [/*error:LIST_ELEMENT_TYPE_NOT_ASSIGNABLE*/ \"hello\"],
- ^"], <core::int>[3]]);
+ ^" in let final core::String #t20 = "hello" in null], <core::int>[3]]);
new self::F3::•<dynamic>(<core::Iterable<dynamic>>[]);
self::F3<core::int> f31 = new self::F3::•<core::int>(<core::List<core::int>>[<core::int>[3]]);
self::F3<core::String> f32 = new self::F3::•<core::String>(<core::List<core::String>>[<core::String>["hello"]]);
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 024b075..4565308 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
@@ -9,19 +9,19 @@
<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 = <T extends core::Object>(core::String x) → core::String => "hello" in 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'.
+ 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'.
v = /*error:INVALID_ASSIGNMENT*/ <T> /*@returnType=String*/ (String x) =>
- ^";
- v = <T extends core::Object>(core::int x) → core::String => let final dynamic #t2 = 3 in 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>(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'.
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 {
- return let final dynamic #t3 = 3 in 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'.
+ 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;
- ^";
+ ^" in let final dynamic #t6 = 3 in null;
};
}
{
@@ -30,21 +30,21 @@
<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 #t4 = 3 in 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'.
+ 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'.
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 {
- return let final dynamic #t5 = 3 in 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'.
+ 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 {
- return let final dynamic #t6 = x in 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'.
+ 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;
- ^";
+ ^" in let final dynamic #t12 = x in null;
};
}
{
@@ -53,19 +53,19 @@
<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 #t7 = <T extends core::Object>(core::String x) → core::List<core::String> => <core::String>["hello"] in 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>'.
+ 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>'.
v = /*error:INVALID_ASSIGNMENT*/ <T> /*@returnType=List<String>*/ (String
- ^";
- v = <T extends core::Object>(core::int x) → core::List<core::String> => <core::String>[let final dynamic #t8 = 3 in 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>(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'.
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> {
- return <core::String>[let final dynamic #t9 = 3 in 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'.
+ 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
- ^"];
+ ^" in let final dynamic #t18 = 3 in null];
};
}
{
@@ -79,11 +79,11 @@
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 #t10 = x in 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'.
+ 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'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::String'.
x;
- ^";
- y = <T extends core::Object>(core::int x) → core::String => (let final dynamic #t11 = 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'.
+ ^" 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'.
Try correcting the name to the name of an existing method, or defining a method named 'substring'.
.substring(3);
^") as{TypeError} core::String;
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 4298e7b..c9bbbdd 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
@@ -9,19 +9,19 @@
<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 <T extends core::Object>(core::String) → core::String #t1 = <T extends core::Object>(core::String x) → core::String => "hello" in 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'.
+ 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'.
v = /*error:INVALID_ASSIGNMENT*/ <T> /*@returnType=String*/ (String x) =>
- ^";
- v = <T extends core::Object>(core::int x) → core::String => let final core::int #t2 = 3 in 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>(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'.
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 {
- return let final core::int #t3 = 3 in 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'.
+ 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;
- ^";
+ ^" in let final core::int #t6 = 3 in null;
};
}
{
@@ -30,21 +30,21 @@
<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 core::int #t4 = 3 in 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'.
+ 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'.
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 {
- return let final core::int #t5 = 3 in 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'.
+ 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 {
- return let final core::int #t6 = x in 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'.
+ 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;
- ^";
+ ^" in let final core::int #t12 = x in null;
};
}
{
@@ -53,19 +53,19 @@
<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 <T extends core::Object>(core::String) → core::List<core::String> #t7 = <T extends core::Object>(core::String x) → core::List<core::String> => <core::String>["hello"] in 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>'.
+ 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>'.
v = /*error:INVALID_ASSIGNMENT*/ <T> /*@returnType=List<String>*/ (String
- ^";
- v = <T extends core::Object>(core::int x) → core::List<core::String> => <core::String>[let final core::int #t8 = 3 in 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>(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'.
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> {
- return <core::String>[let final core::int #t9 = 3 in 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'.
+ 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
- ^"];
+ ^" in let final core::int #t18 = 3 in null];
};
}
{
@@ -79,11 +79,11 @@
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 core::int #t10 = x in 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'.
+ 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'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::String'.
x;
- ^";
- y = <T extends core::Object>(core::int x) → core::String => (let final core::int #t11 = 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'.
+ ^" 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'.
Try correcting the name to the name of an existing method, or defining a method named 'substring'.
.substring(3);
^") as{TypeError} core::String;
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 58de7fb..b3047dd 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
@@ -56,134 +56,134 @@
self::A<core::int, core::String> a1 = new self::A::named<core::int, core::String>(3, "hello");
self::A<core::int, core::String> a2 = new self::A::•<core::int, core::String>(3, "hello");
self::A<core::int, core::String> a3 = new self::A::named<core::int, core::String>(3, "hello");
- self::A<core::int, core::String> a4 = let final dynamic #t1 = new self::A::•<core::int, dynamic>(3, "hello") in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_instance_creations_infer_downwards.dart:46:50: Error: The constructor returns type 'test::A<dart.core::int, dynamic>' that isn't of expected type 'test::A<dart.core::int, dart.core::String>'.
+ self::A<core::int, core::String> a4 = let final dynamic #t1 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_instance_creations_infer_downwards.dart:46:50: Error: The constructor returns type 'test::A<dart.core::int, dynamic>' that isn't of expected type 'test::A<dart.core::int, dart.core::String>'.
Change the type of the object being constructed or the context in which it is used.
a4 = /*error:INVALID_CAST_NEW_EXPR*/ new A<int, dynamic>(3, \"hello\");
- ^";
- self::A<core::int, core::String> a5 = let final dynamic #t2 = new self::A::named<dynamic, dynamic>(3, "hello") in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_instance_creations_infer_downwards.dart:48:50: Error: The constructor returns type 'test::A<dynamic, dynamic>' that isn't of expected type 'test::A<dart.core::int, dart.core::String>'.
+ ^" in let final dynamic #t2 = new self::A::•<core::int, dynamic>(3, "hello") in null;
+ self::A<core::int, core::String> a5 = let final dynamic #t3 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_instance_creations_infer_downwards.dart:48:50: Error: The constructor returns type 'test::A<dynamic, dynamic>' that isn't of expected type 'test::A<dart.core::int, dart.core::String>'.
Change the type of the object being constructed or the context in which it is used.
a5 = /*error:INVALID_CAST_NEW_EXPR*/ new A<dynamic, dynamic>.named(
- ^";
+ ^" in let final dynamic #t4 = new self::A::named<dynamic, dynamic>(3, "hello") in null;
}
{
- self::A<core::int, core::String> a0 = new self::A::•<core::int, core::String>(let final dynamic #t3 = "hello" in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_instance_creations_infer_downwards.dart:53:48: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ self::A<core::int, core::String> a0 = new self::A::•<core::int, core::String>(let final dynamic #t5 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_instance_creations_infer_downwards.dart:53:48: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
/*error:ARGUMENT_TYPE_NOT_ASSIGNABLE*/ \"hello\",
- ^", let final dynamic #t4 = 3 in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_instance_creations_infer_downwards.dart:54:48: Error: A value of type 'dart.core::int' can't be assigned to a variable of type 'dart.core::String'.
+ ^" in let final dynamic #t6 = "hello" in null, let final dynamic #t7 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_instance_creations_infer_downwards.dart:54:48: 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:ARGUMENT_TYPE_NOT_ASSIGNABLE*/ 3);
- ^");
- self::A<core::int, core::String> a1 = new self::A::named<core::int, core::String>(let final dynamic #t5 = "hello" in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_instance_creations_infer_downwards.dart:56:48: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ ^" in let final dynamic #t8 = 3 in null);
+ self::A<core::int, core::String> a1 = new self::A::named<core::int, core::String>(let final dynamic #t9 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_instance_creations_infer_downwards.dart:56:48: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
/*error:ARGUMENT_TYPE_NOT_ASSIGNABLE*/ \"hello\",
- ^", let final dynamic #t6 = 3 in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_instance_creations_infer_downwards.dart:57:48: Error: A value of type 'dart.core::int' can't be assigned to a variable of type 'dart.core::String'.
+ ^" in let final dynamic #t10 = "hello" in null, let final dynamic #t11 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_instance_creations_infer_downwards.dart:57:48: 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:ARGUMENT_TYPE_NOT_ASSIGNABLE*/ 3);
- ^");
+ ^" in let final dynamic #t12 = 3 in null);
}
{
self::A<core::int, core::String> a0 = new self::B::•<core::String, core::int>("hello", 3);
self::A<core::int, core::String> a1 = new self::B::named<core::String, core::int>("hello", 3);
self::A<core::int, core::String> a2 = new self::B::•<core::String, core::int>("hello", 3);
self::A<core::int, core::String> a3 = new self::B::named<core::String, core::int>("hello", 3);
- self::A<core::int, core::String> a4 = let final dynamic #t7 = new self::B::•<core::String, dynamic>("hello", 3) in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_instance_creations_infer_downwards.dart:65:47: Error: A value of type 'test::B<dart.core::String, dynamic>' can't be assigned to a variable of type 'test::A<dart.core::int, dart.core::String>'.
+ self::A<core::int, core::String> a4 = let final dynamic #t13 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_instance_creations_infer_downwards.dart:65:47: Error: A value of type 'test::B<dart.core::String, dynamic>' can't be assigned to a variable of type 'test::A<dart.core::int, dart.core::String>'.
Try changing the type of the left hand side, or casting the right hand side to 'test::A<dart.core::int, dart.core::String>'.
a4 = /*error:INVALID_ASSIGNMENT*/ new B<String, dynamic>(\"hello\", 3);
- ^";
- self::A<core::int, core::String> a5 = let final dynamic #t8 = new self::B::named<dynamic, dynamic>("hello", 3) in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_instance_creations_infer_downwards.dart:67:47: Error: A value of type 'test::B<dynamic, dynamic>' can't be assigned to a variable of type 'test::A<dart.core::int, dart.core::String>'.
+ ^" in let final dynamic #t14 = new self::B::•<core::String, dynamic>("hello", 3) in null;
+ self::A<core::int, core::String> a5 = let final dynamic #t15 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_instance_creations_infer_downwards.dart:67:47: Error: A value of type 'test::B<dynamic, dynamic>' can't be assigned to a variable of type 'test::A<dart.core::int, dart.core::String>'.
Try changing the type of the left hand side, or casting the right hand side to 'test::A<dart.core::int, dart.core::String>'.
a5 = /*error:INVALID_ASSIGNMENT*/ new B<dynamic, dynamic>.named(
- ^";
+ ^" in let final dynamic #t16 = new self::B::named<dynamic, dynamic>("hello", 3) in null;
}
{
- self::A<core::int, core::String> a0 = new self::B::•<core::String, core::int>(let final dynamic #t9 = 3 in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_instance_creations_infer_downwards.dart:72:48: Error: A value of type 'dart.core::int' can't be assigned to a variable of type 'dart.core::String'.
+ self::A<core::int, core::String> a0 = new self::B::•<core::String, core::int>(let final dynamic #t17 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_instance_creations_infer_downwards.dart:72:48: 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:ARGUMENT_TYPE_NOT_ASSIGNABLE*/ 3,
- ^", let final dynamic #t10 = "hello" in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_instance_creations_infer_downwards.dart:73:48: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ ^" in let final dynamic #t18 = 3 in null, let final dynamic #t19 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_instance_creations_infer_downwards.dart:73:48: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
/*error:ARGUMENT_TYPE_NOT_ASSIGNABLE*/ \"hello\");
- ^");
- self::A<core::int, core::String> a1 = new self::B::named<core::String, core::int>(let final dynamic #t11 = 3 in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_instance_creations_infer_downwards.dart:75:48: Error: A value of type 'dart.core::int' can't be assigned to a variable of type 'dart.core::String'.
+ ^" in let final dynamic #t20 = "hello" in null);
+ self::A<core::int, core::String> a1 = new self::B::named<core::String, core::int>(let final dynamic #t21 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_instance_creations_infer_downwards.dart:75:48: 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:ARGUMENT_TYPE_NOT_ASSIGNABLE*/ 3,
- ^", let final dynamic #t12 = "hello" in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_instance_creations_infer_downwards.dart:76:48: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ ^" in let final dynamic #t22 = 3 in null, let final dynamic #t23 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_instance_creations_infer_downwards.dart:76:48: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
/*error:ARGUMENT_TYPE_NOT_ASSIGNABLE*/ \"hello\");
- ^");
+ ^" in let final dynamic #t24 = "hello" in null);
}
{
self::A<core::int, core::int> a0 = new self::C::•<core::int>(3);
self::A<core::int, core::int> a1 = new self::C::named<core::int>(3);
self::A<core::int, core::int> a2 = new self::C::•<core::int>(3);
self::A<core::int, core::int> a3 = new self::C::named<core::int>(3);
- self::A<core::int, core::int> a4 = let final dynamic #t13 = new self::C::•<dynamic>(3) in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_instance_creations_infer_downwards.dart:83:55: Error: A value of type 'test::C<dynamic>' can't be assigned to a variable of type 'test::A<dart.core::int, dart.core::int>'.
+ self::A<core::int, core::int> a4 = let final dynamic #t25 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_instance_creations_infer_downwards.dart:83:55: Error: A value of type 'test::C<dynamic>' can't be assigned to a variable of type 'test::A<dart.core::int, dart.core::int>'.
Try changing the type of the left hand side, or casting the right hand side to 'test::A<dart.core::int, dart.core::int>'.
A<int, int> a4 = /*error:INVALID_ASSIGNMENT*/ new C<dynamic>(3);
- ^";
- self::A<core::int, core::int> a5 = let final dynamic #t14 = new self::C::named<dynamic>(3) in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_instance_creations_infer_downwards.dart:84:55: Error: A value of type 'test::C<dynamic>' can't be assigned to a variable of type 'test::A<dart.core::int, dart.core::int>'.
+ ^" in let final dynamic #t26 = new self::C::•<dynamic>(3) in null;
+ self::A<core::int, core::int> a5 = let final dynamic #t27 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_instance_creations_infer_downwards.dart:84:55: Error: A value of type 'test::C<dynamic>' can't be assigned to a variable of type 'test::A<dart.core::int, dart.core::int>'.
Try changing the type of the left hand side, or casting the right hand side to 'test::A<dart.core::int, dart.core::int>'.
A<int, int> a5 = /*error:INVALID_ASSIGNMENT*/ new C<dynamic>.named(3);
- ^";
+ ^" in let final dynamic #t28 = new self::C::named<dynamic>(3) in null;
}
{
- self::A<core::int, core::int> a0 = new self::C::•<core::int>(let final dynamic #t15 = "hello" in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_instance_creations_infer_downwards.dart:88:48: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ self::A<core::int, core::int> a0 = new self::C::•<core::int>(let final dynamic #t29 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_instance_creations_infer_downwards.dart:88:48: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
/*error:ARGUMENT_TYPE_NOT_ASSIGNABLE*/ \"hello\");
- ^");
- self::A<core::int, core::int> a1 = new self::C::named<core::int>(let final dynamic #t16 = "hello" in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_instance_creations_infer_downwards.dart:90:48: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ ^" in let final dynamic #t30 = "hello" in null);
+ self::A<core::int, core::int> a1 = new self::C::named<core::int>(let final dynamic #t31 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_instance_creations_infer_downwards.dart:90:48: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
/*error:ARGUMENT_TYPE_NOT_ASSIGNABLE*/ \"hello\");
- ^");
+ ^" in let final dynamic #t32 = "hello" in null);
}
{
self::A<core::int, core::String> a0 = new self::D::•<dynamic, core::String>("hello");
self::A<core::int, core::String> a1 = new self::D::named<dynamic, core::String>("hello");
self::A<core::int, core::String> a2 = new self::D::•<core::int, core::String>("hello");
self::A<core::int, core::String> a3 = new self::D::named<core::String, core::String>("hello");
- self::A<core::int, core::String> a4 = let final dynamic #t17 = new self::D::•<core::num, dynamic>("hello") in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_instance_creations_infer_downwards.dart:98:47: Error: A value of type 'test::D<dart.core::num, dynamic>' can't be assigned to a variable of type 'test::A<dart.core::int, dart.core::String>'.
+ self::A<core::int, core::String> a4 = let final dynamic #t33 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_instance_creations_infer_downwards.dart:98:47: Error: A value of type 'test::D<dart.core::num, dynamic>' can't be assigned to a variable of type 'test::A<dart.core::int, dart.core::String>'.
Try changing the type of the left hand side, or casting the right hand side to 'test::A<dart.core::int, dart.core::String>'.
a4 = /*error:INVALID_ASSIGNMENT*/ new D<num, dynamic>(\"hello\");
- ^";
- self::A<core::int, core::String> a5 = let final dynamic #t18 = new self::D::named<dynamic, dynamic>("hello") in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_instance_creations_infer_downwards.dart:100:47: Error: A value of type 'test::D<dynamic, dynamic>' can't be assigned to a variable of type 'test::A<dart.core::int, dart.core::String>'.
+ ^" in let final dynamic #t34 = new self::D::•<core::num, dynamic>("hello") in null;
+ self::A<core::int, core::String> a5 = let final dynamic #t35 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_instance_creations_infer_downwards.dart:100:47: Error: A value of type 'test::D<dynamic, dynamic>' can't be assigned to a variable of type 'test::A<dart.core::int, dart.core::String>'.
Try changing the type of the left hand side, or casting the right hand side to 'test::A<dart.core::int, dart.core::String>'.
a5 = /*error:INVALID_ASSIGNMENT*/ new D<dynamic, dynamic>.named(
- ^";
+ ^" in let final dynamic #t36 = new self::D::named<dynamic, dynamic>("hello") in null;
}
{
- self::A<core::int, core::String> a0 = new self::D::•<dynamic, core::String>(let final dynamic #t19 = 3 in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_instance_creations_infer_downwards.dart:105:48: Error: A value of type 'dart.core::int' can't be assigned to a variable of type 'dart.core::String'.
+ self::A<core::int, core::String> a0 = new self::D::•<dynamic, core::String>(let final dynamic #t37 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_instance_creations_infer_downwards.dart:105:48: 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:ARGUMENT_TYPE_NOT_ASSIGNABLE*/ 3);
- ^");
- self::A<core::int, core::String> a1 = new self::D::named<dynamic, core::String>(let final dynamic #t20 = 3 in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_instance_creations_infer_downwards.dart:107:48: Error: A value of type 'dart.core::int' can't be assigned to a variable of type 'dart.core::String'.
+ ^" in let final dynamic #t38 = 3 in null);
+ self::A<core::int, core::String> a1 = new self::D::named<dynamic, core::String>(let final dynamic #t39 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_instance_creations_infer_downwards.dart:107:48: 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:ARGUMENT_TYPE_NOT_ASSIGNABLE*/ 3);
- ^");
+ ^" in let final dynamic #t40 = 3 in null);
}
{
self::A<self::C<core::int>, core::String> a0 = new self::E::•<core::int, core::String>("hello");
}
{
self::A<core::int, core::String> a0 = new self::F::•<core::int, core::String>(3, "hello", a: <core::int>[3], b: <core::String>["hello"]);
- self::A<core::int, core::String> a1 = new self::F::•<core::int, core::String>(3, "hello", a: <core::int>[let final dynamic #t21 = "hello" in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_instance_creations_infer_downwards.dart:118:54: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ self::A<core::int, core::String> a1 = new self::F::•<core::int, core::String>(3, "hello", a: <core::int>[let final dynamic #t41 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_instance_creations_infer_downwards.dart:118:54: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
/*error:LIST_ELEMENT_TYPE_NOT_ASSIGNABLE*/ \"hello\"
- ^"], b: <core::String>[let final dynamic #t22 = 3 in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_instance_creations_infer_downwards.dart:121: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 #t42 = "hello" in null], b: <core::String>[let final dynamic #t43 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_instance_creations_infer_downwards.dart:121: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 #t44 = 3 in null]);
self::A<core::int, core::String> a2 = new self::F::named<core::int, core::String>(3, "hello", 3, "hello");
self::A<core::int, core::String> a3 = new self::F::named<core::int, core::String>(3, "hello");
- self::A<core::int, core::String> a4 = new self::F::named<core::int, core::String>(3, "hello", let final dynamic #t23 = "hello" in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_instance_creations_infer_downwards.dart:129:48: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ self::A<core::int, core::String> a4 = new self::F::named<core::int, core::String>(3, "hello", let final dynamic #t45 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_instance_creations_infer_downwards.dart:129:48: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
/*error:ARGUMENT_TYPE_NOT_ASSIGNABLE*/ \"hello\",
- ^", let final dynamic #t24 = 3 in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_instance_creations_infer_downwards.dart:130:48: Error: A value of type 'dart.core::int' can't be assigned to a variable of type 'dart.core::String'.
+ ^" in let final dynamic #t46 = "hello" in null, let final dynamic #t47 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_instance_creations_infer_downwards.dart:130:48: 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:ARGUMENT_TYPE_NOT_ASSIGNABLE*/ 3);
- ^");
- self::A<core::int, core::String> a5 = new self::F::named<core::int, core::String>(3, "hello", let final dynamic #t25 = "hello" in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_instance_creations_infer_downwards.dart:134:48: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ ^" in let final dynamic #t48 = 3 in null);
+ self::A<core::int, core::String> a5 = new self::F::named<core::int, core::String>(3, "hello", let final dynamic #t49 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_instance_creations_infer_downwards.dart:134:48: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
/*error:ARGUMENT_TYPE_NOT_ASSIGNABLE*/ \"hello\");
- ^");
+ ^" in let final dynamic #t50 = "hello" in null);
}
}
static method main() → dynamic {}
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 4c00155..97104e0 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
@@ -56,134 +56,134 @@
self::A<core::int, core::String> a1 = new self::A::named<core::int, core::String>(3, "hello");
self::A<core::int, core::String> a2 = new self::A::•<core::int, core::String>(3, "hello");
self::A<core::int, core::String> a3 = new self::A::named<core::int, core::String>(3, "hello");
- self::A<core::int, core::String> a4 = let final self::A<core::int, dynamic> #t1 = new self::A::•<core::int, dynamic>(3, "hello") in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_instance_creations_infer_downwards.dart:46:50: Error: The constructor returns type 'test::A<dart.core::int, dynamic>' that isn't of expected type 'test::A<dart.core::int, dart.core::String>'.
+ self::A<core::int, core::String> a4 = let final dynamic #t1 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_instance_creations_infer_downwards.dart:46:50: Error: The constructor returns type 'test::A<dart.core::int, dynamic>' that isn't of expected type 'test::A<dart.core::int, dart.core::String>'.
Change the type of the object being constructed or the context in which it is used.
a4 = /*error:INVALID_CAST_NEW_EXPR*/ new A<int, dynamic>(3, \"hello\");
- ^";
- self::A<core::int, core::String> a5 = let final self::A<dynamic, dynamic> #t2 = new self::A::named<dynamic, dynamic>(3, "hello") in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_instance_creations_infer_downwards.dart:48:50: Error: The constructor returns type 'test::A<dynamic, dynamic>' that isn't of expected type 'test::A<dart.core::int, dart.core::String>'.
+ ^" in let final self::A<core::int, dynamic> #t2 = new self::A::•<core::int, dynamic>(3, "hello") in null;
+ self::A<core::int, core::String> a5 = let final dynamic #t3 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_instance_creations_infer_downwards.dart:48:50: Error: The constructor returns type 'test::A<dynamic, dynamic>' that isn't of expected type 'test::A<dart.core::int, dart.core::String>'.
Change the type of the object being constructed or the context in which it is used.
a5 = /*error:INVALID_CAST_NEW_EXPR*/ new A<dynamic, dynamic>.named(
- ^";
+ ^" in let final self::A<dynamic, dynamic> #t4 = new self::A::named<dynamic, dynamic>(3, "hello") in null;
}
{
- self::A<core::int, core::String> a0 = new self::A::•<core::int, core::String>(let final core::String #t3 = "hello" in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_instance_creations_infer_downwards.dart:53:48: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ self::A<core::int, core::String> a0 = new self::A::•<core::int, core::String>(let final dynamic #t5 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_instance_creations_infer_downwards.dart:53:48: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
/*error:ARGUMENT_TYPE_NOT_ASSIGNABLE*/ \"hello\",
- ^", let final core::int #t4 = 3 in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_instance_creations_infer_downwards.dart:54:48: Error: A value of type 'dart.core::int' can't be assigned to a variable of type 'dart.core::String'.
+ ^" in let final core::String #t6 = "hello" in null, let final dynamic #t7 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_instance_creations_infer_downwards.dart:54:48: 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:ARGUMENT_TYPE_NOT_ASSIGNABLE*/ 3);
- ^");
- self::A<core::int, core::String> a1 = new self::A::named<core::int, core::String>(let final core::String #t5 = "hello" in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_instance_creations_infer_downwards.dart:56:48: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ ^" in let final core::int #t8 = 3 in null);
+ self::A<core::int, core::String> a1 = new self::A::named<core::int, core::String>(let final dynamic #t9 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_instance_creations_infer_downwards.dart:56:48: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
/*error:ARGUMENT_TYPE_NOT_ASSIGNABLE*/ \"hello\",
- ^", let final core::int #t6 = 3 in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_instance_creations_infer_downwards.dart:57:48: Error: A value of type 'dart.core::int' can't be assigned to a variable of type 'dart.core::String'.
+ ^" in let final core::String #t10 = "hello" in null, let final dynamic #t11 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_instance_creations_infer_downwards.dart:57:48: 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:ARGUMENT_TYPE_NOT_ASSIGNABLE*/ 3);
- ^");
+ ^" in let final core::int #t12 = 3 in null);
}
{
self::A<core::int, core::String> a0 = new self::B::•<core::String, core::int>("hello", 3);
self::A<core::int, core::String> a1 = new self::B::named<core::String, core::int>("hello", 3);
self::A<core::int, core::String> a2 = new self::B::•<core::String, core::int>("hello", 3);
self::A<core::int, core::String> a3 = new self::B::named<core::String, core::int>("hello", 3);
- self::A<core::int, core::String> a4 = let final self::B<core::String, dynamic> #t7 = new self::B::•<core::String, dynamic>("hello", 3) in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_instance_creations_infer_downwards.dart:65:47: Error: A value of type 'test::B<dart.core::String, dynamic>' can't be assigned to a variable of type 'test::A<dart.core::int, dart.core::String>'.
+ self::A<core::int, core::String> a4 = let final dynamic #t13 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_instance_creations_infer_downwards.dart:65:47: Error: A value of type 'test::B<dart.core::String, dynamic>' can't be assigned to a variable of type 'test::A<dart.core::int, dart.core::String>'.
Try changing the type of the left hand side, or casting the right hand side to 'test::A<dart.core::int, dart.core::String>'.
a4 = /*error:INVALID_ASSIGNMENT*/ new B<String, dynamic>(\"hello\", 3);
- ^";
- self::A<core::int, core::String> a5 = let final self::B<dynamic, dynamic> #t8 = new self::B::named<dynamic, dynamic>("hello", 3) in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_instance_creations_infer_downwards.dart:67:47: Error: A value of type 'test::B<dynamic, dynamic>' can't be assigned to a variable of type 'test::A<dart.core::int, dart.core::String>'.
+ ^" in let final self::B<core::String, dynamic> #t14 = new self::B::•<core::String, dynamic>("hello", 3) in null;
+ self::A<core::int, core::String> a5 = let final dynamic #t15 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_instance_creations_infer_downwards.dart:67:47: Error: A value of type 'test::B<dynamic, dynamic>' can't be assigned to a variable of type 'test::A<dart.core::int, dart.core::String>'.
Try changing the type of the left hand side, or casting the right hand side to 'test::A<dart.core::int, dart.core::String>'.
a5 = /*error:INVALID_ASSIGNMENT*/ new B<dynamic, dynamic>.named(
- ^";
+ ^" in let final self::B<dynamic, dynamic> #t16 = new self::B::named<dynamic, dynamic>("hello", 3) in null;
}
{
- self::A<core::int, core::String> a0 = new self::B::•<core::String, core::int>(let final core::int #t9 = 3 in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_instance_creations_infer_downwards.dart:72:48: Error: A value of type 'dart.core::int' can't be assigned to a variable of type 'dart.core::String'.
+ self::A<core::int, core::String> a0 = new self::B::•<core::String, core::int>(let final dynamic #t17 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_instance_creations_infer_downwards.dart:72:48: 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:ARGUMENT_TYPE_NOT_ASSIGNABLE*/ 3,
- ^", let final core::String #t10 = "hello" in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_instance_creations_infer_downwards.dart:73:48: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ ^" in let final core::int #t18 = 3 in null, let final dynamic #t19 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_instance_creations_infer_downwards.dart:73:48: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
/*error:ARGUMENT_TYPE_NOT_ASSIGNABLE*/ \"hello\");
- ^");
- self::A<core::int, core::String> a1 = new self::B::named<core::String, core::int>(let final core::int #t11 = 3 in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_instance_creations_infer_downwards.dart:75:48: Error: A value of type 'dart.core::int' can't be assigned to a variable of type 'dart.core::String'.
+ ^" in let final core::String #t20 = "hello" in null);
+ self::A<core::int, core::String> a1 = new self::B::named<core::String, core::int>(let final dynamic #t21 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_instance_creations_infer_downwards.dart:75:48: 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:ARGUMENT_TYPE_NOT_ASSIGNABLE*/ 3,
- ^", let final core::String #t12 = "hello" in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_instance_creations_infer_downwards.dart:76:48: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ ^" in let final core::int #t22 = 3 in null, let final dynamic #t23 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_instance_creations_infer_downwards.dart:76:48: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
/*error:ARGUMENT_TYPE_NOT_ASSIGNABLE*/ \"hello\");
- ^");
+ ^" in let final core::String #t24 = "hello" in null);
}
{
self::A<core::int, core::int> a0 = new self::C::•<core::int>(3);
self::A<core::int, core::int> a1 = new self::C::named<core::int>(3);
self::A<core::int, core::int> a2 = new self::C::•<core::int>(3);
self::A<core::int, core::int> a3 = new self::C::named<core::int>(3);
- self::A<core::int, core::int> a4 = let final self::C<dynamic> #t13 = new self::C::•<dynamic>(3) in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_instance_creations_infer_downwards.dart:83:55: Error: A value of type 'test::C<dynamic>' can't be assigned to a variable of type 'test::A<dart.core::int, dart.core::int>'.
+ self::A<core::int, core::int> a4 = let final dynamic #t25 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_instance_creations_infer_downwards.dart:83:55: Error: A value of type 'test::C<dynamic>' can't be assigned to a variable of type 'test::A<dart.core::int, dart.core::int>'.
Try changing the type of the left hand side, or casting the right hand side to 'test::A<dart.core::int, dart.core::int>'.
A<int, int> a4 = /*error:INVALID_ASSIGNMENT*/ new C<dynamic>(3);
- ^";
- self::A<core::int, core::int> a5 = let final self::C<dynamic> #t14 = new self::C::named<dynamic>(3) in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_instance_creations_infer_downwards.dart:84:55: Error: A value of type 'test::C<dynamic>' can't be assigned to a variable of type 'test::A<dart.core::int, dart.core::int>'.
+ ^" in let final self::C<dynamic> #t26 = new self::C::•<dynamic>(3) in null;
+ self::A<core::int, core::int> a5 = let final dynamic #t27 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_instance_creations_infer_downwards.dart:84:55: Error: A value of type 'test::C<dynamic>' can't be assigned to a variable of type 'test::A<dart.core::int, dart.core::int>'.
Try changing the type of the left hand side, or casting the right hand side to 'test::A<dart.core::int, dart.core::int>'.
A<int, int> a5 = /*error:INVALID_ASSIGNMENT*/ new C<dynamic>.named(3);
- ^";
+ ^" in let final self::C<dynamic> #t28 = new self::C::named<dynamic>(3) in null;
}
{
- self::A<core::int, core::int> a0 = new self::C::•<core::int>(let final core::String #t15 = "hello" in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_instance_creations_infer_downwards.dart:88:48: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ self::A<core::int, core::int> a0 = new self::C::•<core::int>(let final dynamic #t29 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_instance_creations_infer_downwards.dart:88:48: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
/*error:ARGUMENT_TYPE_NOT_ASSIGNABLE*/ \"hello\");
- ^");
- self::A<core::int, core::int> a1 = new self::C::named<core::int>(let final core::String #t16 = "hello" in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_instance_creations_infer_downwards.dart:90:48: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ ^" in let final core::String #t30 = "hello" in null);
+ self::A<core::int, core::int> a1 = new self::C::named<core::int>(let final dynamic #t31 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_instance_creations_infer_downwards.dart:90:48: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
/*error:ARGUMENT_TYPE_NOT_ASSIGNABLE*/ \"hello\");
- ^");
+ ^" in let final core::String #t32 = "hello" in null);
}
{
self::A<core::int, core::String> a0 = new self::D::•<dynamic, core::String>("hello");
self::A<core::int, core::String> a1 = new self::D::named<dynamic, core::String>("hello");
self::A<core::int, core::String> a2 = new self::D::•<core::int, core::String>("hello");
self::A<core::int, core::String> a3 = new self::D::named<core::String, core::String>("hello");
- self::A<core::int, core::String> a4 = let final self::D<core::num, dynamic> #t17 = new self::D::•<core::num, dynamic>("hello") in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_instance_creations_infer_downwards.dart:98:47: Error: A value of type 'test::D<dart.core::num, dynamic>' can't be assigned to a variable of type 'test::A<dart.core::int, dart.core::String>'.
+ self::A<core::int, core::String> a4 = let final dynamic #t33 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_instance_creations_infer_downwards.dart:98:47: Error: A value of type 'test::D<dart.core::num, dynamic>' can't be assigned to a variable of type 'test::A<dart.core::int, dart.core::String>'.
Try changing the type of the left hand side, or casting the right hand side to 'test::A<dart.core::int, dart.core::String>'.
a4 = /*error:INVALID_ASSIGNMENT*/ new D<num, dynamic>(\"hello\");
- ^";
- self::A<core::int, core::String> a5 = let final self::D<dynamic, dynamic> #t18 = new self::D::named<dynamic, dynamic>("hello") in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_instance_creations_infer_downwards.dart:100:47: Error: A value of type 'test::D<dynamic, dynamic>' can't be assigned to a variable of type 'test::A<dart.core::int, dart.core::String>'.
+ ^" in let final self::D<core::num, dynamic> #t34 = new self::D::•<core::num, dynamic>("hello") in null;
+ self::A<core::int, core::String> a5 = let final dynamic #t35 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_instance_creations_infer_downwards.dart:100:47: Error: A value of type 'test::D<dynamic, dynamic>' can't be assigned to a variable of type 'test::A<dart.core::int, dart.core::String>'.
Try changing the type of the left hand side, or casting the right hand side to 'test::A<dart.core::int, dart.core::String>'.
a5 = /*error:INVALID_ASSIGNMENT*/ new D<dynamic, dynamic>.named(
- ^";
+ ^" in let final self::D<dynamic, dynamic> #t36 = new self::D::named<dynamic, dynamic>("hello") in null;
}
{
- self::A<core::int, core::String> a0 = new self::D::•<dynamic, core::String>(let final core::int #t19 = 3 in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_instance_creations_infer_downwards.dart:105:48: Error: A value of type 'dart.core::int' can't be assigned to a variable of type 'dart.core::String'.
+ self::A<core::int, core::String> a0 = new self::D::•<dynamic, core::String>(let final dynamic #t37 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_instance_creations_infer_downwards.dart:105:48: 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:ARGUMENT_TYPE_NOT_ASSIGNABLE*/ 3);
- ^");
- self::A<core::int, core::String> a1 = new self::D::named<dynamic, core::String>(let final core::int #t20 = 3 in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_instance_creations_infer_downwards.dart:107:48: Error: A value of type 'dart.core::int' can't be assigned to a variable of type 'dart.core::String'.
+ ^" in let final core::int #t38 = 3 in null);
+ self::A<core::int, core::String> a1 = new self::D::named<dynamic, core::String>(let final dynamic #t39 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_instance_creations_infer_downwards.dart:107:48: 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:ARGUMENT_TYPE_NOT_ASSIGNABLE*/ 3);
- ^");
+ ^" in let final core::int #t40 = 3 in null);
}
{
self::A<self::C<core::int>, core::String> a0 = new self::E::•<core::int, core::String>("hello");
}
{
self::A<core::int, core::String> a0 = new self::F::•<core::int, core::String>(3, "hello", a: <core::int>[3], b: <core::String>["hello"]);
- self::A<core::int, core::String> a1 = new self::F::•<core::int, core::String>(3, "hello", a: <core::int>[let final core::String #t21 = "hello" in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_instance_creations_infer_downwards.dart:118:54: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ self::A<core::int, core::String> a1 = new self::F::•<core::int, core::String>(3, "hello", a: <core::int>[let final dynamic #t41 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_instance_creations_infer_downwards.dart:118:54: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
/*error:LIST_ELEMENT_TYPE_NOT_ASSIGNABLE*/ \"hello\"
- ^"], b: <core::String>[let final core::int #t22 = 3 in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_instance_creations_infer_downwards.dart:121:54: Error: A value of type 'dart.core::int' can't be assigned to a variable of type 'dart.core::String'.
+ ^" in let final core::String #t42 = "hello" in null], b: <core::String>[let final dynamic #t43 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_instance_creations_infer_downwards.dart:121: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 #t44 = 3 in null]);
self::A<core::int, core::String> a2 = new self::F::named<core::int, core::String>(3, "hello", 3, "hello");
self::A<core::int, core::String> a3 = new self::F::named<core::int, core::String>(3, "hello");
- self::A<core::int, core::String> a4 = new self::F::named<core::int, core::String>(3, "hello", let final core::String #t23 = "hello" in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_instance_creations_infer_downwards.dart:129:48: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ self::A<core::int, core::String> a4 = new self::F::named<core::int, core::String>(3, "hello", let final dynamic #t45 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_instance_creations_infer_downwards.dart:129:48: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
/*error:ARGUMENT_TYPE_NOT_ASSIGNABLE*/ \"hello\",
- ^", let final core::int #t24 = 3 in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_instance_creations_infer_downwards.dart:130:48: Error: A value of type 'dart.core::int' can't be assigned to a variable of type 'dart.core::String'.
+ ^" in let final core::String #t46 = "hello" in null, let final dynamic #t47 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_instance_creations_infer_downwards.dart:130:48: 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:ARGUMENT_TYPE_NOT_ASSIGNABLE*/ 3);
- ^");
- self::A<core::int, core::String> a5 = new self::F::named<core::int, core::String>(3, "hello", let final core::String #t25 = "hello" in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_instance_creations_infer_downwards.dart:134:48: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ ^" in let final core::int #t48 = 3 in null);
+ self::A<core::int, core::String> a5 = new self::F::named<core::int, core::String>(3, "hello", let final dynamic #t49 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_instance_creations_infer_downwards.dart:134:48: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
/*error:ARGUMENT_TYPE_NOT_ASSIGNABLE*/ \"hello\");
- ^");
+ ^" in let final core::String #t50 = "hello" in null);
}
}
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/downwards_inference_on_list_literals_infer_downwards.dart.strong.expect b/pkg/front_end/testcases/inference/downwards_inference_on_list_literals_infer_downwards.dart.strong.expect
index 741fe3a..d5b5aa9 100644
--- a/pkg/front_end/testcases/inference/downwards_inference_on_list_literals_infer_downwards.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/downwards_inference_on_list_literals_infer_downwards.dart.strong.expect
@@ -2,22 +2,22 @@
import self as self;
import "dart:core" as core;
-static method foo([core::List<core::String> list1 = const <core::String>[], core::List<core::String> list2 = const <core::String>[let final dynamic #t1 = 42 in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_list_literals_infer_downwards.dart:11:89: Error: A value of type 'dart.core::int' can't be assigned to a variable of type 'dart.core::String'.
+static method foo([core::List<core::String> list1 = const <core::String>[], core::List<core::String> list2 = const <core::String>[let final dynamic #t1 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_list_literals_infer_downwards.dart:11:89: 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,error:LIST_ELEMENT_TYPE_NOT_ASSIGNABLE*/ 42
- ^"]]) → void {}
+ ^" in let final dynamic #t2 = 42 in null]]) → void {}
static method main() → void {
{
core::List<core::int> l0 = <core::int>[];
core::List<core::int> l1 = <core::int>[3];
- core::List<core::int> l2 = <core::int>[let final dynamic #t2 = "hello" in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_list_literals_infer_downwards.dart:19:50: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ core::List<core::int> l2 = <core::int>[let final dynamic #t3 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_list_literals_infer_downwards.dart:19:50: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
/*error:LIST_ELEMENT_TYPE_NOT_ASSIGNABLE*/ \"hello\"
- ^"];
- core::List<core::int> l3 = <core::int>[let final dynamic #t3 = "hello" in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_list_literals_infer_downwards.dart:22:50: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ ^" in let final dynamic #t4 = "hello" in null];
+ core::List<core::int> l3 = <core::int>[let final dynamic #t5 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_list_literals_infer_downwards.dart:22:50: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
/*error:LIST_ELEMENT_TYPE_NOT_ASSIGNABLE*/ \"hello\",
- ^", 3];
+ ^" in let final dynamic #t6 = "hello" in null, 3];
}
{
core::List<dynamic> l0 = <dynamic>[];
@@ -26,51 +26,51 @@
core::List<dynamic> l3 = <dynamic>["hello", 3];
}
{
- core::List<core::int> l0 = let final dynamic #t4 = <core::num>[] in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_list_literals_infer_downwards.dart:33:61: Error: The list literal type 'dart.core::List<dart.core::num>' isn't of expected type 'dart.core::List<dart.core::int>'.
+ core::List<core::int> l0 = let final dynamic #t7 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_list_literals_infer_downwards.dart:33:61: Error: The list literal type 'dart.core::List<dart.core::num>' isn't of expected type 'dart.core::List<dart.core::int>'.
Change the type of the list literal or the context in which it is used.
List<int> l0 = /*error:INVALID_CAST_LITERAL_LIST*/ <num>[];
- ^";
- core::List<core::int> l1 = let final dynamic #t5 = <core::num>[3] in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_list_literals_infer_downwards.dart:34:61: Error: The list literal type 'dart.core::List<dart.core::num>' isn't of expected type 'dart.core::List<dart.core::int>'.
+ ^" in let final dynamic #t8 = <core::num>[] in null;
+ core::List<core::int> l1 = let final dynamic #t9 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_list_literals_infer_downwards.dart:34:61: Error: The list literal type 'dart.core::List<dart.core::num>' isn't of expected type 'dart.core::List<dart.core::int>'.
Change the type of the list literal or the context in which it is used.
List<int> l1 = /*error:INVALID_CAST_LITERAL_LIST*/ <num>[3];
- ^";
- core::List<core::int> l2 = let final dynamic #t6 = <core::num>[let final dynamic #t7 = "hello" in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_list_literals_infer_downwards.dart:36:50: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::num'.
-Try changing the type of the left hand side, or casting the right hand side to 'dart.core::num'.
- /*error:LIST_ELEMENT_TYPE_NOT_ASSIGNABLE*/ \"hello\"
- ^"] in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_list_literals_infer_downwards.dart:35:61: Error: The list literal type 'dart.core::List<dart.core::num>' isn't of expected type 'dart.core::List<dart.core::int>'.
+ ^" in let final dynamic #t10 = <core::num>[3] in null;
+ core::List<core::int> l2 = let final dynamic #t11 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_list_literals_infer_downwards.dart:35:61: Error: The list literal type 'dart.core::List<dart.core::num>' isn't of expected type 'dart.core::List<dart.core::int>'.
Change the type of the list literal or the context in which it is used.
List<int> l2 = /*error:INVALID_CAST_LITERAL_LIST*/ <num>[
- ^";
- core::List<core::int> l3 = let final dynamic #t8 = <core::num>[let final dynamic #t9 = "hello" in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_list_literals_infer_downwards.dart:39:50: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::num'.
+ ^" in let final dynamic #t12 = <core::num>[let final dynamic #t13 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_list_literals_infer_downwards.dart:36:50: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::num'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::num'.
- /*error:LIST_ELEMENT_TYPE_NOT_ASSIGNABLE*/ \"hello\",
- ^", 3] in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_list_literals_infer_downwards.dart:38:61: Error: The list literal type 'dart.core::List<dart.core::num>' isn't of expected type 'dart.core::List<dart.core::int>'.
+ /*error:LIST_ELEMENT_TYPE_NOT_ASSIGNABLE*/ \"hello\"
+ ^" in let final dynamic #t14 = "hello" in null] in null;
+ core::List<core::int> l3 = let final dynamic #t15 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_list_literals_infer_downwards.dart:38:61: Error: The list literal type 'dart.core::List<dart.core::num>' isn't of expected type 'dart.core::List<dart.core::int>'.
Change the type of the list literal or the context in which it is used.
List<int> l3 = /*error:INVALID_CAST_LITERAL_LIST*/ <num>[
- ^";
+ ^" in let final dynamic #t16 = <core::num>[let final dynamic #t17 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_list_literals_infer_downwards.dart:39:50: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::num'.
+Try changing the type of the left hand side, or casting the right hand side to 'dart.core::num'.
+ /*error:LIST_ELEMENT_TYPE_NOT_ASSIGNABLE*/ \"hello\",
+ ^" in let final dynamic #t18 = "hello" in null, 3] in null;
}
{
core::Iterable<core::int> i0 = <core::int>[];
core::Iterable<core::int> i1 = <core::int>[3];
- core::Iterable<core::int> i2 = <core::int>[let final dynamic #t10 = "hello" in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_list_literals_infer_downwards.dart:47:50: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ core::Iterable<core::int> i2 = <core::int>[let final dynamic #t19 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_list_literals_infer_downwards.dart:47:50: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
/*error:LIST_ELEMENT_TYPE_NOT_ASSIGNABLE*/ \"hello\"
- ^"];
- core::Iterable<core::int> i3 = <core::int>[let final dynamic #t11 = "hello" in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_list_literals_infer_downwards.dart:50:50: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ ^" in let final dynamic #t20 = "hello" in null];
+ core::Iterable<core::int> i3 = <core::int>[let final dynamic #t21 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_list_literals_infer_downwards.dart:50:50: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
/*error:LIST_ELEMENT_TYPE_NOT_ASSIGNABLE*/ \"hello\",
- ^", 3];
+ ^" in let final dynamic #t22 = "hello" in null, 3];
}
{
const core::List<core::int> c0 = const <core::int>[];
const core::List<core::int> c1 = const <core::int>[3];
- const core::List<core::int> c2 = const <core::int>[let final dynamic #t12 = "hello" in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_list_literals_infer_downwards.dart:58:89: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ const core::List<core::int> c2 = const <core::int>[let final dynamic #t23 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_list_literals_infer_downwards.dart:58:89: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
/*error:LIST_ELEMENT_TYPE_NOT_ASSIGNABLE,error:LIST_ELEMENT_TYPE_NOT_ASSIGNABLE*/ \"hello\"
- ^"];
- const core::List<core::int> c3 = const <core::int>[let final dynamic #t13 = "hello" in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_list_literals_infer_downwards.dart:61:89: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ ^" in let final dynamic #t24 = "hello" in null];
+ const core::List<core::int> c3 = const <core::int>[let final dynamic #t25 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_list_literals_infer_downwards.dart:61:89: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
/*error:LIST_ELEMENT_TYPE_NOT_ASSIGNABLE,error:LIST_ELEMENT_TYPE_NOT_ASSIGNABLE*/ \"hello\",
- ^", 3];
+ ^" in let final dynamic #t26 = "hello" in null, 3];
}
}
diff --git a/pkg/front_end/testcases/inference/downwards_inference_on_list_literals_infer_downwards.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/downwards_inference_on_list_literals_infer_downwards.dart.strong.transformed.expect
index f2d123f..f2e0116 100644
--- a/pkg/front_end/testcases/inference/downwards_inference_on_list_literals_infer_downwards.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/downwards_inference_on_list_literals_infer_downwards.dart.strong.transformed.expect
@@ -2,22 +2,22 @@
import self as self;
import "dart:core" as core;
-static method foo([core::List<core::String> list1 = const <core::String>[], core::List<core::String> list2 = const <core::String>[let final core::int #t1 = 42 in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_list_literals_infer_downwards.dart:11:89: Error: A value of type 'dart.core::int' can't be assigned to a variable of type 'dart.core::String'.
+static method foo([core::List<core::String> list1 = const <core::String>[], core::List<core::String> list2 = const <core::String>[let final dynamic #t1 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_list_literals_infer_downwards.dart:11:89: 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,error:LIST_ELEMENT_TYPE_NOT_ASSIGNABLE*/ 42
- ^"]]) → void {}
+ ^" in let final core::int #t2 = 42 in null]]) → void {}
static method main() → void {
{
core::List<core::int> l0 = <core::int>[];
core::List<core::int> l1 = <core::int>[3];
- core::List<core::int> l2 = <core::int>[let final core::String #t2 = "hello" in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_list_literals_infer_downwards.dart:19:50: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ core::List<core::int> l2 = <core::int>[let final dynamic #t3 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_list_literals_infer_downwards.dart:19:50: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
/*error:LIST_ELEMENT_TYPE_NOT_ASSIGNABLE*/ \"hello\"
- ^"];
- core::List<core::int> l3 = <core::int>[let final core::String #t3 = "hello" in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_list_literals_infer_downwards.dart:22:50: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ ^" in let final core::String #t4 = "hello" in null];
+ core::List<core::int> l3 = <core::int>[let final dynamic #t5 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_list_literals_infer_downwards.dart:22:50: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
/*error:LIST_ELEMENT_TYPE_NOT_ASSIGNABLE*/ \"hello\",
- ^", 3];
+ ^" in let final core::String #t6 = "hello" in null, 3];
}
{
core::List<dynamic> l0 = <dynamic>[];
@@ -26,51 +26,51 @@
core::List<dynamic> l3 = <dynamic>["hello", 3];
}
{
- core::List<core::int> l0 = let final core::List<core::num> #t4 = <core::num>[] in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_list_literals_infer_downwards.dart:33:61: Error: The list literal type 'dart.core::List<dart.core::num>' isn't of expected type 'dart.core::List<dart.core::int>'.
+ core::List<core::int> l0 = let final dynamic #t7 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_list_literals_infer_downwards.dart:33:61: Error: The list literal type 'dart.core::List<dart.core::num>' isn't of expected type 'dart.core::List<dart.core::int>'.
Change the type of the list literal or the context in which it is used.
List<int> l0 = /*error:INVALID_CAST_LITERAL_LIST*/ <num>[];
- ^";
- core::List<core::int> l1 = let final core::List<core::num> #t5 = <core::num>[3] in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_list_literals_infer_downwards.dart:34:61: Error: The list literal type 'dart.core::List<dart.core::num>' isn't of expected type 'dart.core::List<dart.core::int>'.
+ ^" in let final core::List<core::num> #t8 = <core::num>[] in null;
+ core::List<core::int> l1 = let final dynamic #t9 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_list_literals_infer_downwards.dart:34:61: Error: The list literal type 'dart.core::List<dart.core::num>' isn't of expected type 'dart.core::List<dart.core::int>'.
Change the type of the list literal or the context in which it is used.
List<int> l1 = /*error:INVALID_CAST_LITERAL_LIST*/ <num>[3];
- ^";
- core::List<core::int> l2 = let final core::List<core::num> #t6 = <core::num>[let final core::String #t7 = "hello" in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_list_literals_infer_downwards.dart:36:50: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::num'.
-Try changing the type of the left hand side, or casting the right hand side to 'dart.core::num'.
- /*error:LIST_ELEMENT_TYPE_NOT_ASSIGNABLE*/ \"hello\"
- ^"] in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_list_literals_infer_downwards.dart:35:61: Error: The list literal type 'dart.core::List<dart.core::num>' isn't of expected type 'dart.core::List<dart.core::int>'.
+ ^" in let final core::List<core::num> #t10 = <core::num>[3] in null;
+ core::List<core::int> l2 = let final dynamic #t11 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_list_literals_infer_downwards.dart:35:61: Error: The list literal type 'dart.core::List<dart.core::num>' isn't of expected type 'dart.core::List<dart.core::int>'.
Change the type of the list literal or the context in which it is used.
List<int> l2 = /*error:INVALID_CAST_LITERAL_LIST*/ <num>[
- ^";
- core::List<core::int> l3 = let final core::List<core::num> #t8 = <core::num>[let final core::String #t9 = "hello" in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_list_literals_infer_downwards.dart:39:50: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::num'.
+ ^" in let final core::List<core::num> #t12 = <core::num>[let final dynamic #t13 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_list_literals_infer_downwards.dart:36:50: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::num'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::num'.
- /*error:LIST_ELEMENT_TYPE_NOT_ASSIGNABLE*/ \"hello\",
- ^", 3] in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_list_literals_infer_downwards.dart:38:61: Error: The list literal type 'dart.core::List<dart.core::num>' isn't of expected type 'dart.core::List<dart.core::int>'.
+ /*error:LIST_ELEMENT_TYPE_NOT_ASSIGNABLE*/ \"hello\"
+ ^" in let final core::String #t14 = "hello" in null] in null;
+ core::List<core::int> l3 = let final dynamic #t15 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_list_literals_infer_downwards.dart:38:61: Error: The list literal type 'dart.core::List<dart.core::num>' isn't of expected type 'dart.core::List<dart.core::int>'.
Change the type of the list literal or the context in which it is used.
List<int> l3 = /*error:INVALID_CAST_LITERAL_LIST*/ <num>[
- ^";
+ ^" in let final core::List<core::num> #t16 = <core::num>[let final dynamic #t17 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_list_literals_infer_downwards.dart:39:50: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::num'.
+Try changing the type of the left hand side, or casting the right hand side to 'dart.core::num'.
+ /*error:LIST_ELEMENT_TYPE_NOT_ASSIGNABLE*/ \"hello\",
+ ^" in let final core::String #t18 = "hello" in null, 3] in null;
}
{
core::Iterable<core::int> i0 = <core::int>[];
core::Iterable<core::int> i1 = <core::int>[3];
- core::Iterable<core::int> i2 = <core::int>[let final core::String #t10 = "hello" in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_list_literals_infer_downwards.dart:47:50: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ core::Iterable<core::int> i2 = <core::int>[let final dynamic #t19 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_list_literals_infer_downwards.dart:47:50: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
/*error:LIST_ELEMENT_TYPE_NOT_ASSIGNABLE*/ \"hello\"
- ^"];
- core::Iterable<core::int> i3 = <core::int>[let final core::String #t11 = "hello" in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_list_literals_infer_downwards.dart:50:50: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ ^" in let final core::String #t20 = "hello" in null];
+ core::Iterable<core::int> i3 = <core::int>[let final dynamic #t21 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_list_literals_infer_downwards.dart:50:50: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
/*error:LIST_ELEMENT_TYPE_NOT_ASSIGNABLE*/ \"hello\",
- ^", 3];
+ ^" in let final core::String #t22 = "hello" in null, 3];
}
{
const core::List<core::int> c0 = const <core::int>[];
const core::List<core::int> c1 = const <core::int>[3];
- const core::List<core::int> c2 = const <core::int>[let final core::String #t12 = "hello" in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_list_literals_infer_downwards.dart:58:89: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ const core::List<core::int> c2 = const <core::int>[let final dynamic #t23 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_list_literals_infer_downwards.dart:58:89: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
/*error:LIST_ELEMENT_TYPE_NOT_ASSIGNABLE,error:LIST_ELEMENT_TYPE_NOT_ASSIGNABLE*/ \"hello\"
- ^"];
- const core::List<core::int> c3 = const <core::int>[let final core::String #t13 = "hello" in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_list_literals_infer_downwards.dart:61:89: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ ^" in let final core::String #t24 = "hello" in null];
+ const core::List<core::int> c3 = const <core::int>[let final dynamic #t25 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_list_literals_infer_downwards.dart:61:89: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
/*error:LIST_ELEMENT_TYPE_NOT_ASSIGNABLE,error:LIST_ELEMENT_TYPE_NOT_ASSIGNABLE*/ \"hello\",
- ^", 3];
+ ^" in let final core::String #t26 = "hello" in null, 3];
}
}
diff --git a/pkg/front_end/testcases/inference/downwards_inference_on_map_literals.dart.strong.expect b/pkg/front_end/testcases/inference/downwards_inference_on_map_literals.dart.strong.expect
index d56b390..fc58e8e 100644
--- a/pkg/front_end/testcases/inference/downwards_inference_on_map_literals.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/downwards_inference_on_map_literals.dart.strong.expect
@@ -2,29 +2,29 @@
import self as self;
import "dart:core" as core;
-static method foo([core::Map<core::int, core::String> m1 = const <core::int, core::String>{1: "hello"}, core::Map<core::int, core::String> m2 = const <core::int, core::String>{let final dynamic #t1 = "hello" in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_map_literals.dart:12:79: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+static method foo([core::Map<core::int, core::String> m1 = const <core::int, core::String>{1: "hello"}, core::Map<core::int, core::String> m2 = const <core::int, core::String>{let final dynamic #t1 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_map_literals.dart:12:79: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
/*error:MAP_KEY_TYPE_NOT_ASSIGNABLE,error:MAP_KEY_TYPE_NOT_ASSIGNABLE*/ \"hello\":
- ^": "world"}]) → void {}
+ ^" in let final dynamic #t2 = "hello" in null: "world"}]) → void {}
static method test() → void {
{
core::Map<core::int, core::String> l0 = <core::int, core::String>{};
core::Map<core::int, core::String> l1 = <core::int, core::String>{3: "hello"};
- core::Map<core::int, core::String> l2 = <core::int, core::String>{let final dynamic #t2 = "hello" in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_map_literals.dart:20:45: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ core::Map<core::int, core::String> l2 = <core::int, core::String>{let final dynamic #t3 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_map_literals.dart:20:45: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
/*error:MAP_KEY_TYPE_NOT_ASSIGNABLE*/ \"hello\": \"hello\"
- ^": "hello"};
- core::Map<core::int, core::String> l3 = <core::int, core::String>{3: let final dynamic #t3 = 3 in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_map_literals.dart:23:50: Error: A value of type 'dart.core::int' can't be assigned to a variable of type 'dart.core::String'.
+ ^" in let final dynamic #t4 = "hello" in null: "hello"};
+ core::Map<core::int, core::String> l3 = <core::int, core::String>{3: let final dynamic #t5 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_map_literals.dart:23:50: 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: /*error:MAP_VALUE_TYPE_NOT_ASSIGNABLE*/ 3
- ^"};
- core::Map<core::int, core::String> l4 = <core::int, core::String>{3: "hello", let final dynamic #t4 = "hello" in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_map_literals.dart:27:45: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ ^" in let final dynamic #t6 = 3 in null};
+ core::Map<core::int, core::String> l4 = <core::int, core::String>{3: "hello", let final dynamic #t7 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_map_literals.dart:27:45: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
/*error:MAP_KEY_TYPE_NOT_ASSIGNABLE*/ \"hello\":
- ^": let final dynamic #t5 = 3 in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_map_literals.dart:28:51: Error: A value of type 'dart.core::int' can't be assigned to a variable of type 'dart.core::String'.
+ ^" in let final dynamic #t8 = "hello" in null: let final dynamic #t9 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_map_literals.dart:28:51: 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:MAP_VALUE_TYPE_NOT_ASSIGNABLE*/ 3
- ^"};
+ ^" in let final dynamic #t10 = 3 in null};
}
{
core::Map<dynamic, dynamic> l0 = <dynamic, dynamic>{};
@@ -37,60 +37,60 @@
core::Map<dynamic, core::String> l0 = <dynamic, core::String>{};
core::Map<dynamic, core::String> l1 = <dynamic, core::String>{3: "hello"};
core::Map<dynamic, core::String> l2 = <dynamic, core::String>{"hello": "hello"};
- core::Map<dynamic, core::String> l3 = <dynamic, core::String>{3: let final dynamic #t6 = 3 in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_map_literals.dart:48:50: Error: A value of type 'dart.core::int' can't be assigned to a variable of type 'dart.core::String'.
+ core::Map<dynamic, core::String> l3 = <dynamic, core::String>{3: let final dynamic #t11 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_map_literals.dart:48:50: 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: /*error:MAP_VALUE_TYPE_NOT_ASSIGNABLE*/ 3
- ^"};
- core::Map<dynamic, core::String> l4 = <dynamic, core::String>{3: "hello", "hello": let final dynamic #t7 = 3 in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_map_literals.dart:52:56: Error: A value of type 'dart.core::int' can't be assigned to a variable of type 'dart.core::String'.
+ ^" in let final dynamic #t12 = 3 in null};
+ core::Map<dynamic, core::String> l4 = <dynamic, core::String>{3: "hello", "hello": let final dynamic #t13 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_map_literals.dart:52:56: 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'.
\"hello\": /*error:MAP_VALUE_TYPE_NOT_ASSIGNABLE*/ 3
- ^"};
+ ^" in let final dynamic #t14 = 3 in null};
}
{
core::Map<core::int, dynamic> l0 = <core::int, dynamic>{};
core::Map<core::int, dynamic> l1 = <core::int, dynamic>{3: "hello"};
- core::Map<core::int, dynamic> l2 = <core::int, dynamic>{let final dynamic #t8 = "hello" in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_map_literals.dart:59:45: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ core::Map<core::int, dynamic> l2 = <core::int, dynamic>{let final dynamic #t15 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_map_literals.dart:59:45: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
/*error:MAP_KEY_TYPE_NOT_ASSIGNABLE*/ \"hello\": \"hello\"
- ^": "hello"};
+ ^" in let final dynamic #t16 = "hello" in null: "hello"};
core::Map<core::int, dynamic> l3 = <core::int, dynamic>{3: 3};
- core::Map<core::int, dynamic> l4 = <core::int, dynamic>{3: "hello", let final dynamic #t9 = "hello" in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_map_literals.dart:64:45: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ core::Map<core::int, dynamic> l4 = <core::int, dynamic>{3: "hello", let final dynamic #t17 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_map_literals.dart:64:45: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
/*error:MAP_KEY_TYPE_NOT_ASSIGNABLE*/ \"hello\": 3
- ^": 3};
+ ^" in let final dynamic #t18 = "hello" in null: 3};
}
{
- core::Map<core::int, core::String> l0 = let final dynamic #t10 = <core::num, dynamic>{} in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_map_literals.dart:68:76: Error: The map literal type 'dart.core::Map<dart.core::num, dynamic>' isn't of expected type 'dart.core::Map<dart.core::int, dart.core::String>'.
+ core::Map<core::int, core::String> l0 = let final dynamic #t19 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_map_literals.dart:68:76: Error: The map literal type 'dart.core::Map<dart.core::num, dynamic>' isn't of expected type 'dart.core::Map<dart.core::int, dart.core::String>'.
Change the type of the map literal or the context in which it is used.
Map<int, String> l0 = /*error:INVALID_CAST_LITERAL_MAP*/ <num, dynamic>{};
- ^";
- core::Map<core::int, core::String> l1 = let final dynamic #t11 = <core::num, dynamic>{3: "hello"} in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_map_literals.dart:69:76: Error: The map literal type 'dart.core::Map<dart.core::num, dynamic>' isn't of expected type 'dart.core::Map<dart.core::int, dart.core::String>'.
+ ^" in let final dynamic #t20 = <core::num, dynamic>{} in null;
+ core::Map<core::int, core::String> l1 = let final dynamic #t21 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_map_literals.dart:69:76: Error: The map literal type 'dart.core::Map<dart.core::num, dynamic>' isn't of expected type 'dart.core::Map<dart.core::int, dart.core::String>'.
Change the type of the map literal or the context in which it is used.
Map<int, String> l1 = /*error:INVALID_CAST_LITERAL_MAP*/ <num, dynamic>{
- ^";
- core::Map<core::int, core::String> l3 = let final dynamic #t12 = <core::num, dynamic>{3: 3} in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_map_literals.dart:72:76: Error: The map literal type 'dart.core::Map<dart.core::num, dynamic>' isn't of expected type 'dart.core::Map<dart.core::int, dart.core::String>'.
+ ^" in let final dynamic #t22 = <core::num, dynamic>{3: "hello"} in null;
+ core::Map<core::int, core::String> l3 = let final dynamic #t23 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_map_literals.dart:72:76: Error: The map literal type 'dart.core::Map<dart.core::num, dynamic>' isn't of expected type 'dart.core::Map<dart.core::int, dart.core::String>'.
Change the type of the map literal or the context in which it is used.
Map<int, String> l3 = /*error:INVALID_CAST_LITERAL_MAP*/ <num, dynamic>{
- ^";
+ ^" in let final dynamic #t24 = <core::num, dynamic>{3: 3} in null;
}
{
const core::Map<core::int, core::String> l0 = const <core::int, core::String>{};
const core::Map<core::int, core::String> l1 = const <core::int, core::String>{3: "hello"};
- const core::Map<core::int, core::String> l2 = const <core::int, core::String>{let final dynamic #t13 = "hello" in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_map_literals.dart:80:79: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ const core::Map<core::int, core::String> l2 = const <core::int, core::String>{let final dynamic #t25 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_map_literals.dart:80:79: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
/*error:MAP_KEY_TYPE_NOT_ASSIGNABLE,error:MAP_KEY_TYPE_NOT_ASSIGNABLE*/ \"hello\":
- ^": "hello"};
- const core::Map<core::int, core::String> l3 = const <core::int, core::String>{3: let final dynamic #t14 = 3 in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_map_literals.dart:84:86: Error: A value of type 'dart.core::int' can't be assigned to a variable of type 'dart.core::String'.
+ ^" in let final dynamic #t26 = "hello" in null: "hello"};
+ const core::Map<core::int, core::String> l3 = const <core::int, core::String>{3: let final dynamic #t27 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_map_literals.dart:84:86: 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: /*error:MAP_VALUE_TYPE_NOT_ASSIGNABLE,error:MAP_VALUE_TYPE_NOT_ASSIGNABLE*/ 3
- ^"};
- const core::Map<core::int, core::String> l4 = const <core::int, core::String>{3: "hello", let final dynamic #t15 = "hello" in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_map_literals.dart:88:79: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ ^" in let final dynamic #t28 = 3 in null};
+ const core::Map<core::int, core::String> l4 = const <core::int, core::String>{3: "hello", let final dynamic #t29 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_map_literals.dart:88:79: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
/*error:MAP_KEY_TYPE_NOT_ASSIGNABLE,error:MAP_KEY_TYPE_NOT_ASSIGNABLE*/ \"hello\":
- ^": let final dynamic #t16 = 3 in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_map_literals.dart:89:87: Error: A value of type 'dart.core::int' can't be assigned to a variable of type 'dart.core::String'.
+ ^" in let final dynamic #t30 = "hello" in null: let final dynamic #t31 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_map_literals.dart:89:87: 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:MAP_VALUE_TYPE_NOT_ASSIGNABLE,error:MAP_VALUE_TYPE_NOT_ASSIGNABLE*/ 3
- ^"};
+ ^" in let final dynamic #t32 = 3 in null};
}
}
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/downwards_inference_on_map_literals.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/downwards_inference_on_map_literals.dart.strong.transformed.expect
index 0669aef..1364e2d 100644
--- a/pkg/front_end/testcases/inference/downwards_inference_on_map_literals.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/downwards_inference_on_map_literals.dart.strong.transformed.expect
@@ -2,29 +2,29 @@
import self as self;
import "dart:core" as core;
-static method foo([core::Map<core::int, core::String> m1 = const <core::int, core::String>{1: "hello"}, core::Map<core::int, core::String> m2 = const <core::int, core::String>{let final core::String #t1 = "hello" in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_map_literals.dart:12:79: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+static method foo([core::Map<core::int, core::String> m1 = const <core::int, core::String>{1: "hello"}, core::Map<core::int, core::String> m2 = const <core::int, core::String>{let final dynamic #t1 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_map_literals.dart:12:79: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
/*error:MAP_KEY_TYPE_NOT_ASSIGNABLE,error:MAP_KEY_TYPE_NOT_ASSIGNABLE*/ \"hello\":
- ^": "world"}]) → void {}
+ ^" in let final core::String #t2 = "hello" in null: "world"}]) → void {}
static method test() → void {
{
core::Map<core::int, core::String> l0 = <core::int, core::String>{};
core::Map<core::int, core::String> l1 = <core::int, core::String>{3: "hello"};
- core::Map<core::int, core::String> l2 = <core::int, core::String>{let final core::String #t2 = "hello" in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_map_literals.dart:20:45: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ core::Map<core::int, core::String> l2 = <core::int, core::String>{let final dynamic #t3 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_map_literals.dart:20:45: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
/*error:MAP_KEY_TYPE_NOT_ASSIGNABLE*/ \"hello\": \"hello\"
- ^": "hello"};
- core::Map<core::int, core::String> l3 = <core::int, core::String>{3: let final core::int #t3 = 3 in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_map_literals.dart:23:50: Error: A value of type 'dart.core::int' can't be assigned to a variable of type 'dart.core::String'.
+ ^" in let final core::String #t4 = "hello" in null: "hello"};
+ core::Map<core::int, core::String> l3 = <core::int, core::String>{3: let final dynamic #t5 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_map_literals.dart:23:50: 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: /*error:MAP_VALUE_TYPE_NOT_ASSIGNABLE*/ 3
- ^"};
- core::Map<core::int, core::String> l4 = <core::int, core::String>{3: "hello", let final core::String #t4 = "hello" in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_map_literals.dart:27:45: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ ^" in let final core::int #t6 = 3 in null};
+ core::Map<core::int, core::String> l4 = <core::int, core::String>{3: "hello", let final dynamic #t7 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_map_literals.dart:27:45: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
/*error:MAP_KEY_TYPE_NOT_ASSIGNABLE*/ \"hello\":
- ^": let final core::int #t5 = 3 in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_map_literals.dart:28:51: Error: A value of type 'dart.core::int' can't be assigned to a variable of type 'dart.core::String'.
+ ^" in let final core::String #t8 = "hello" in null: let final dynamic #t9 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_map_literals.dart:28:51: 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:MAP_VALUE_TYPE_NOT_ASSIGNABLE*/ 3
- ^"};
+ ^" in let final core::int #t10 = 3 in null};
}
{
core::Map<dynamic, dynamic> l0 = <dynamic, dynamic>{};
@@ -37,60 +37,60 @@
core::Map<dynamic, core::String> l0 = <dynamic, core::String>{};
core::Map<dynamic, core::String> l1 = <dynamic, core::String>{3: "hello"};
core::Map<dynamic, core::String> l2 = <dynamic, core::String>{"hello": "hello"};
- core::Map<dynamic, core::String> l3 = <dynamic, core::String>{3: let final core::int #t6 = 3 in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_map_literals.dart:48:50: Error: A value of type 'dart.core::int' can't be assigned to a variable of type 'dart.core::String'.
+ core::Map<dynamic, core::String> l3 = <dynamic, core::String>{3: let final dynamic #t11 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_map_literals.dart:48:50: 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: /*error:MAP_VALUE_TYPE_NOT_ASSIGNABLE*/ 3
- ^"};
- core::Map<dynamic, core::String> l4 = <dynamic, core::String>{3: "hello", "hello": let final core::int #t7 = 3 in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_map_literals.dart:52:56: Error: A value of type 'dart.core::int' can't be assigned to a variable of type 'dart.core::String'.
+ ^" in let final core::int #t12 = 3 in null};
+ core::Map<dynamic, core::String> l4 = <dynamic, core::String>{3: "hello", "hello": let final dynamic #t13 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_map_literals.dart:52:56: 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'.
\"hello\": /*error:MAP_VALUE_TYPE_NOT_ASSIGNABLE*/ 3
- ^"};
+ ^" in let final core::int #t14 = 3 in null};
}
{
core::Map<core::int, dynamic> l0 = <core::int, dynamic>{};
core::Map<core::int, dynamic> l1 = <core::int, dynamic>{3: "hello"};
- core::Map<core::int, dynamic> l2 = <core::int, dynamic>{let final core::String #t8 = "hello" in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_map_literals.dart:59:45: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ core::Map<core::int, dynamic> l2 = <core::int, dynamic>{let final dynamic #t15 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_map_literals.dart:59:45: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
/*error:MAP_KEY_TYPE_NOT_ASSIGNABLE*/ \"hello\": \"hello\"
- ^": "hello"};
+ ^" in let final core::String #t16 = "hello" in null: "hello"};
core::Map<core::int, dynamic> l3 = <core::int, dynamic>{3: 3};
- core::Map<core::int, dynamic> l4 = <core::int, dynamic>{3: "hello", let final core::String #t9 = "hello" in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_map_literals.dart:64:45: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ core::Map<core::int, dynamic> l4 = <core::int, dynamic>{3: "hello", let final dynamic #t17 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_map_literals.dart:64:45: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
/*error:MAP_KEY_TYPE_NOT_ASSIGNABLE*/ \"hello\": 3
- ^": 3};
+ ^" in let final core::String #t18 = "hello" in null: 3};
}
{
- core::Map<core::int, core::String> l0 = let final core::Map<core::num, dynamic> #t10 = <core::num, dynamic>{} in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_map_literals.dart:68:76: Error: The map literal type 'dart.core::Map<dart.core::num, dynamic>' isn't of expected type 'dart.core::Map<dart.core::int, dart.core::String>'.
+ core::Map<core::int, core::String> l0 = let final dynamic #t19 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_map_literals.dart:68:76: Error: The map literal type 'dart.core::Map<dart.core::num, dynamic>' isn't of expected type 'dart.core::Map<dart.core::int, dart.core::String>'.
Change the type of the map literal or the context in which it is used.
Map<int, String> l0 = /*error:INVALID_CAST_LITERAL_MAP*/ <num, dynamic>{};
- ^";
- core::Map<core::int, core::String> l1 = let final core::Map<core::num, dynamic> #t11 = <core::num, dynamic>{3: "hello"} in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_map_literals.dart:69:76: Error: The map literal type 'dart.core::Map<dart.core::num, dynamic>' isn't of expected type 'dart.core::Map<dart.core::int, dart.core::String>'.
+ ^" in let final core::Map<core::num, dynamic> #t20 = <core::num, dynamic>{} in null;
+ core::Map<core::int, core::String> l1 = let final dynamic #t21 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_map_literals.dart:69:76: Error: The map literal type 'dart.core::Map<dart.core::num, dynamic>' isn't of expected type 'dart.core::Map<dart.core::int, dart.core::String>'.
Change the type of the map literal or the context in which it is used.
Map<int, String> l1 = /*error:INVALID_CAST_LITERAL_MAP*/ <num, dynamic>{
- ^";
- core::Map<core::int, core::String> l3 = let final core::Map<core::num, dynamic> #t12 = <core::num, dynamic>{3: 3} in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_map_literals.dart:72:76: Error: The map literal type 'dart.core::Map<dart.core::num, dynamic>' isn't of expected type 'dart.core::Map<dart.core::int, dart.core::String>'.
+ ^" in let final core::Map<core::num, dynamic> #t22 = <core::num, dynamic>{3: "hello"} in null;
+ core::Map<core::int, core::String> l3 = let final dynamic #t23 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_map_literals.dart:72:76: Error: The map literal type 'dart.core::Map<dart.core::num, dynamic>' isn't of expected type 'dart.core::Map<dart.core::int, dart.core::String>'.
Change the type of the map literal or the context in which it is used.
Map<int, String> l3 = /*error:INVALID_CAST_LITERAL_MAP*/ <num, dynamic>{
- ^";
+ ^" in let final core::Map<core::num, dynamic> #t24 = <core::num, dynamic>{3: 3} in null;
}
{
const core::Map<core::int, core::String> l0 = const <core::int, core::String>{};
const core::Map<core::int, core::String> l1 = const <core::int, core::String>{3: "hello"};
- const core::Map<core::int, core::String> l2 = const <core::int, core::String>{let final core::String #t13 = "hello" in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_map_literals.dart:80:79: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ const core::Map<core::int, core::String> l2 = const <core::int, core::String>{let final dynamic #t25 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_map_literals.dart:80:79: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
/*error:MAP_KEY_TYPE_NOT_ASSIGNABLE,error:MAP_KEY_TYPE_NOT_ASSIGNABLE*/ \"hello\":
- ^": "hello"};
- const core::Map<core::int, core::String> l3 = const <core::int, core::String>{3: let final core::int #t14 = 3 in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_map_literals.dart:84:86: Error: A value of type 'dart.core::int' can't be assigned to a variable of type 'dart.core::String'.
+ ^" in let final core::String #t26 = "hello" in null: "hello"};
+ const core::Map<core::int, core::String> l3 = const <core::int, core::String>{3: let final dynamic #t27 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_map_literals.dart:84:86: 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: /*error:MAP_VALUE_TYPE_NOT_ASSIGNABLE,error:MAP_VALUE_TYPE_NOT_ASSIGNABLE*/ 3
- ^"};
- const core::Map<core::int, core::String> l4 = const <core::int, core::String>{3: "hello", let final core::String #t15 = "hello" in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_map_literals.dart:88:79: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ ^" in let final core::int #t28 = 3 in null};
+ const core::Map<core::int, core::String> l4 = const <core::int, core::String>{3: "hello", let final dynamic #t29 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_map_literals.dart:88:79: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
/*error:MAP_KEY_TYPE_NOT_ASSIGNABLE,error:MAP_KEY_TYPE_NOT_ASSIGNABLE*/ \"hello\":
- ^": let final core::int #t16 = 3 in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_map_literals.dart:89:87: Error: A value of type 'dart.core::int' can't be assigned to a variable of type 'dart.core::String'.
+ ^" in let final core::String #t30 = "hello" in null: let final dynamic #t31 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_on_map_literals.dart:89:87: 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:MAP_VALUE_TYPE_NOT_ASSIGNABLE,error:MAP_VALUE_TYPE_NOT_ASSIGNABLE*/ 3
- ^"};
+ ^" in let final core::int #t32 = 3 in null};
}
}
static method main() → dynamic {}
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 1e89b94..67bbde6 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
@@ -9,26 +9,26 @@
}
static method foo() → asy::Stream<core::List<core::int>> async* {
yield<core::int>[];
- yield let final dynamic #t1 = self::MyStream::•<dynamic>() in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_yield_yield_star.dart:16:67: Error: A value of type 'test::MyStream<dynamic>' can't be assigned to a variable of type 'dart.core::List<dart.core::int>'.
+ yield let final dynamic #t1 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_yield_yield_star.dart:16:67: Error: A value of type 'test::MyStream<dynamic>' can't be assigned to a variable of type 'dart.core::List<dart.core::int>'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::List<dart.core::int>'.
yield /*error:YIELD_OF_INVALID_TYPE*/ new /*@typeArgs=dynamic*/ MyStream();
- ^";
- yield* let final dynamic #t2 = <dynamic>[] in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_yield_yield_star.dart:17:64: Error: A value of type 'dart.core::List<dynamic>' can't be assigned to a variable of type 'dart.async::Stream<dart.core::List<dart.core::int>>'.
+ ^" in let final dynamic #t2 = self::MyStream::•<dynamic>() in null;
+ yield* let final dynamic #t3 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_yield_yield_star.dart:17:64: Error: A value of type 'dart.core::List<dynamic>' can't be assigned to a variable of type 'dart.async::Stream<dart.core::List<dart.core::int>>'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.async::Stream<dart.core::List<dart.core::int>>'.
yield* /*error:YIELD_OF_INVALID_TYPE*/ /*@typeArgs=dynamic*/ [];
- ^";
+ ^" in let final dynamic #t4 = <dynamic>[] in null;
yield* self::MyStream::•<core::List<core::int>>();
}
static method bar() → core::Iterable<core::Map<core::int, core::int>> sync* {
yield<core::int, core::int>{};
- yield let final dynamic #t3 = core::List::•<dynamic>() in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_yield_yield_star.dart:23:67: Error: A value of type 'dart.core::List<dynamic>' can't be assigned to a variable of type 'dart.core::Map<dart.core::int, dart.core::int>'.
+ yield let final dynamic #t5 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_yield_yield_star.dart:23:67: Error: A value of type 'dart.core::List<dynamic>' can't be assigned to a variable of type 'dart.core::Map<dart.core::int, dart.core::int>'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::Map<dart.core::int, dart.core::int>'.
yield /*error:YIELD_OF_INVALID_TYPE*/ new /*@typeArgs=dynamic*/ List();
- ^";
- yield* let final dynamic #t4 = <dynamic, dynamic>{} in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_yield_yield_star.dart:24:73: Error: A value of type 'dart.core::Map<dynamic, dynamic>' can't be assigned to a variable of type 'dart.core::Iterable<dart.core::Map<dart.core::int, dart.core::int>>'.
+ ^" in let final dynamic #t6 = core::List::•<dynamic>() in null;
+ yield* let final dynamic #t7 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/downwards_inference_yield_yield_star.dart:24:73: Error: A value of type 'dart.core::Map<dynamic, dynamic>' can't be assigned to a variable of type 'dart.core::Iterable<dart.core::Map<dart.core::int, dart.core::int>>'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::Iterable<dart.core::Map<dart.core::int, dart.core::int>>'.
yield* /*error:YIELD_OF_INVALID_TYPE*/ /*@typeArgs=dynamic, dynamic*/ {};
- ^";
+ ^" in let final dynamic #t8 = <dynamic, dynamic>{} in null;
yield* core::List::•<core::Map<core::int, core::int>>();
}
static method main() → dynamic {}
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 bdb3e4c..82a1eea 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
@@ -14,10 +14,10 @@
}
static method main() → void {
self::MyFuture<core::double> f = self::foo().{self::MyFuture::then}<core::double>((dynamic _) → core::double => 2.3);
- asy::Future<core::int> f2 = let final dynamic #t1 = f in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/future_then_upwards.dart:21:49: Error: A value of type 'test::MyFuture<dart.core::double>' can't be assigned to a variable of type 'dart.async::Future<dart.core::int>'.
+ asy::Future<core::int> f2 = let final dynamic #t1 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/future_then_upwards.dart:21:49: Error: A value of type 'test::MyFuture<dart.core::double>' can't be assigned to a variable of type 'dart.async::Future<dart.core::int>'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.async::Future<dart.core::int>'.
Future<int> f2 = /*error:INVALID_ASSIGNMENT*/ f;
- ^";
+ ^" in let final dynamic #t2 = f in null;
asy::Future<core::num> f3 = self::foo().{self::MyFuture::then}<core::double>((dynamic _) → core::double => 2.3) as asy::Future<core::double>;
}
static method foo() → self::MyFuture<dynamic>
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 c6a2773..d15cb1a 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
@@ -14,10 +14,10 @@
}
static method main() → void {
self::MyFuture<core::double> f = self::foo().{self::MyFuture::then}<core::double>((dynamic _) → core::double => 2.3);
- asy::Future<core::int> f2 = let final self::MyFuture<core::double> #t1 = f in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/future_then_upwards.dart:21:49: Error: A value of type 'test::MyFuture<dart.core::double>' can't be assigned to a variable of type 'dart.async::Future<dart.core::int>'.
+ asy::Future<core::int> f2 = let final dynamic #t1 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/future_then_upwards.dart:21:49: Error: A value of type 'test::MyFuture<dart.core::double>' can't be assigned to a variable of type 'dart.async::Future<dart.core::int>'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.async::Future<dart.core::int>'.
Future<int> f2 = /*error:INVALID_ASSIGNMENT*/ f;
- ^";
+ ^" in let final self::MyFuture<core::double> #t2 = f in null;
asy::Future<core::num> f3 = self::foo().{self::MyFuture::then}<core::double>((dynamic _) → core::double => 2.3) as asy::Future<core::double>;
}
static method foo() → self::MyFuture<dynamic>
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 ac234d7..93e4a01 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
@@ -14,10 +14,10 @@
}
static method main() → void {
self::MyFuture<core::double> f = self::foo().{self::MyFuture::then}<core::double>((dynamic _) → core::double => 2.3);
- self::MyFuture<core::int> f2 = let final dynamic #t1 = f in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/future_then_upwards_2.dart:21:51: Error: A value of type 'test::MyFuture<dart.core::double>' can't be assigned to a variable of type 'test::MyFuture<dart.core::int>'.
+ self::MyFuture<core::int> f2 = let final dynamic #t1 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/future_then_upwards_2.dart:21:51: Error: A value of type 'test::MyFuture<dart.core::double>' can't be assigned to a variable of type 'test::MyFuture<dart.core::int>'.
Try changing the type of the left hand side, or casting the right hand side to 'test::MyFuture<dart.core::int>'.
MyFuture<int> f2 = /*error:INVALID_ASSIGNMENT*/ f;
- ^";
+ ^" in let final dynamic #t2 = f in null;
self::MyFuture<core::num> f3 = self::foo().{self::MyFuture::then}<core::double>((dynamic _) → core::double => 2.3) as self::MyFuture<core::double>;
}
static method foo() → self::MyFuture<dynamic>
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 8301b6c..3ff32da 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
@@ -14,10 +14,10 @@
}
static method main() → void {
self::MyFuture<core::double> f = self::foo().{self::MyFuture::then}<core::double>((dynamic _) → core::double => 2.3);
- self::MyFuture<core::int> f2 = let final self::MyFuture<core::double> #t1 = f in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/future_then_upwards_2.dart:21:51: Error: A value of type 'test::MyFuture<dart.core::double>' can't be assigned to a variable of type 'test::MyFuture<dart.core::int>'.
+ self::MyFuture<core::int> f2 = let final dynamic #t1 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/future_then_upwards_2.dart:21:51: Error: A value of type 'test::MyFuture<dart.core::double>' can't be assigned to a variable of type 'test::MyFuture<dart.core::int>'.
Try changing the type of the left hand side, or casting the right hand side to 'test::MyFuture<dart.core::int>'.
MyFuture<int> f2 = /*error:INVALID_ASSIGNMENT*/ f;
- ^";
+ ^" in let final self::MyFuture<core::double> #t2 = f in null;
self::MyFuture<core::num> f3 = self::foo().{self::MyFuture::then}<core::double>((dynamic _) → core::double => 2.3) as self::MyFuture<core::double>;
}
static method foo() → self::MyFuture<dynamic>
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 8218490..d31aa187 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
@@ -14,10 +14,10 @@
}
static method test() → void {
asy::Future<core::double> f = self::foo().{asy::Future::then}<core::double>((dynamic _) → core::double => 2.3);
- asy::Future<core::int> f2 = let final dynamic #t1 = f in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/future_then_upwards_3.dart:21:49: Error: A value of type 'dart.async::Future<dart.core::double>' can't be assigned to a variable of type 'dart.async::Future<dart.core::int>'.
+ asy::Future<core::int> f2 = let final dynamic #t1 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/future_then_upwards_3.dart:21:49: Error: A value of type 'dart.async::Future<dart.core::double>' can't be assigned to a variable of type 'dart.async::Future<dart.core::int>'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.async::Future<dart.core::int>'.
Future<int> f2 = /*error:INVALID_ASSIGNMENT*/ f;
- ^";
+ ^" in let final dynamic #t2 = f in null;
asy::Future<core::num> f3 = self::foo().{asy::Future::then}<core::double>((dynamic _) → core::double => 2.3) as asy::Future<core::double>;
}
static method foo() → asy::Future<dynamic>
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 bd5c8d5..87ba016 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
@@ -14,10 +14,10 @@
}
static method test() → void {
asy::Future<core::double> f = self::foo().{asy::Future::then}<core::double>((dynamic _) → core::double => 2.3);
- asy::Future<core::int> f2 = let final asy::Future<core::double> #t1 = f in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/future_then_upwards_3.dart:21:49: Error: A value of type 'dart.async::Future<dart.core::double>' can't be assigned to a variable of type 'dart.async::Future<dart.core::int>'.
+ asy::Future<core::int> f2 = let final dynamic #t1 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/future_then_upwards_3.dart:21:49: Error: A value of type 'dart.async::Future<dart.core::double>' can't be assigned to a variable of type 'dart.async::Future<dart.core::int>'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.async::Future<dart.core::int>'.
Future<int> f2 = /*error:INVALID_ASSIGNMENT*/ f;
- ^";
+ ^" in let final asy::Future<core::double> #t2 = f in null;
asy::Future<core::num> f3 = self::foo().{asy::Future::then}<core::double>((dynamic _) → core::double => 2.3) as asy::Future<core::double>;
}
static method foo() → asy::Future<dynamic>
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 8cdf437..68b4bb8 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
@@ -13,10 +13,10 @@
return null;
}
static field self::MyFuture<dynamic> f;
-static field asy::Future<core::int> t1 = self::f.{self::MyFuture::then}<core::int>((dynamic _) → asy::Future<core::int> => asy::Future::value<core::int>(let final dynamic #t1 = "hi" in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/future_union_downwards.dart:21:44: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.async::FutureOr<dart.core::int>'.
+static field asy::Future<core::int> t1 = self::f.{self::MyFuture::then}<core::int>((dynamic _) → asy::Future<core::int> => asy::Future::value<core::int>(let final dynamic #t1 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/future_union_downwards.dart:21:44: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.async::FutureOr<dart.core::int>'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.async::FutureOr<dart.core::int>'.
new /*@typeArgs=int*/ Future.value('hi'));
- ^"));
+ ^" in let final dynamic #t2 = "hi" in null));
static field asy::Future<core::List<core::int>> t2 = self::f.{self::MyFuture::then}<core::List<core::int>>((dynamic _) → core::List<core::int> => <core::int>[3]);
static method g2() → asy::Future<core::List<core::int>> async {
return <core::int>[3];
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 c4d07ac..2081070 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
@@ -13,10 +13,10 @@
return null;
}
static field self::MyFuture<dynamic> f;
-static field asy::Future<core::int> t1 = self::f.{self::MyFuture::then}<core::int>((dynamic _) → asy::Future<core::int> => asy::Future::value<core::int>(let final core::String #t1 = "hi" in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/future_union_downwards.dart:21:44: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.async::FutureOr<dart.core::int>'.
+static field asy::Future<core::int> t1 = self::f.{self::MyFuture::then}<core::int>((dynamic _) → asy::Future<core::int> => asy::Future::value<core::int>(let final dynamic #t1 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/future_union_downwards.dart:21:44: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.async::FutureOr<dart.core::int>'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.async::FutureOr<dart.core::int>'.
new /*@typeArgs=int*/ Future.value('hi'));
- ^"));
+ ^" in let final core::String #t2 = "hi" in null));
static field asy::Future<core::List<core::int>> t2 = self::f.{self::MyFuture::then}<core::List<core::int>>((dynamic _) → core::List<core::int> => <core::int>[3]);
static method g2() → asy::Future<core::List<core::int>> /* originally async */ {
final asy::Completer<core::List<core::int>> :completer = asy::Completer::sync<core::List<core::int>>();
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 9ab33f7..4faa367 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
@@ -13,10 +13,10 @@
return null;
}
static field asy::Future<dynamic> f;
-static field asy::Future<core::int> t1 = self::f.{asy::Future::then}<core::int>((dynamic _) → asy::Future<core::int> => asy::Future::value<core::int>(let final dynamic #t1 = "hi" in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/future_union_downwards_3.dart:21:44: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.async::FutureOr<dart.core::int>'.
+static field asy::Future<core::int> t1 = self::f.{asy::Future::then}<core::int>((dynamic _) → asy::Future<core::int> => asy::Future::value<core::int>(let final dynamic #t1 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/future_union_downwards_3.dart:21:44: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.async::FutureOr<dart.core::int>'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.async::FutureOr<dart.core::int>'.
new /*@typeArgs=int*/ Future.value('hi'));
- ^"));
+ ^" in let final dynamic #t2 = "hi" in null));
static field asy::Future<core::List<core::int>> t2 = self::f.{asy::Future::then}<core::List<core::int>>((dynamic _) → core::List<core::int> => <core::int>[3]);
static method g2() → asy::Future<core::List<core::int>> async {
return <core::int>[3];
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 747af63..8f591b2 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
@@ -13,10 +13,10 @@
return null;
}
static field asy::Future<dynamic> f;
-static field asy::Future<core::int> t1 = self::f.{asy::Future::then}<core::int>((dynamic _) → asy::Future<core::int> => asy::Future::value<core::int>(let final core::String #t1 = "hi" in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/future_union_downwards_3.dart:21:44: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.async::FutureOr<dart.core::int>'.
+static field asy::Future<core::int> t1 = self::f.{asy::Future::then}<core::int>((dynamic _) → asy::Future<core::int> => asy::Future::value<core::int>(let final dynamic #t1 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/future_union_downwards_3.dart:21:44: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.async::FutureOr<dart.core::int>'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.async::FutureOr<dart.core::int>'.
new /*@typeArgs=int*/ Future.value('hi'));
- ^"));
+ ^" in let final core::String #t2 = "hi" in null));
static field asy::Future<core::List<core::int>> t2 = self::f.{asy::Future::then}<core::List<core::int>>((dynamic _) → core::List<core::int> => <core::int>[3]);
static method g2() → asy::Future<core::List<core::int>> /* originally async */ {
final asy::Completer<core::List<core::int>> :completer = asy::Completer::sync<core::List<core::int>>();
diff --git a/pkg/front_end/testcases/inference/generic_methods_dart_math_min_max.dart.strong.expect b/pkg/front_end/testcases/inference/generic_methods_dart_math_min_max.dart.strong.expect
index 0b1e57b..f83fde4 100644
--- a/pkg/front_end/testcases/inference/generic_methods_dart_math_min_max.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/generic_methods_dart_math_min_max.dart.strong.expect
@@ -16,28 +16,28 @@
self::printDouble(math::min<core::double>(1.0, 2.0));
self::printInt(self::myMax(1, 2) as{TypeError} core::int);
self::printInt(self::myMax(1, 2) as core::int);
- self::printInt(math::max<core::int>(1, let final dynamic #t1 = 2.0 in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/generic_methods_dart_math_min_max.dart:29:71: Error: A value of type 'dart.core::double' can't be assigned to a variable of type 'dart.core::int'.
+ self::printInt(math::max<core::int>(1, let final dynamic #t1 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/generic_methods_dart_math_min_max.dart:29:71: Error: A value of type 'dart.core::double' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
/*@typeArgs=int*/ max(1, /*error:ARGUMENT_TYPE_NOT_ASSIGNABLE*/ 2.0));
- ^"));
- self::printInt(math::min<core::int>(1, let final dynamic #t2 = 2.0 in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/generic_methods_dart_math_min_max.dart:31:71: Error: A value of type 'dart.core::double' can't be assigned to a variable of type 'dart.core::int'.
+ ^" in let final dynamic #t2 = 2.0 in null));
+ self::printInt(math::min<core::int>(1, let final dynamic #t3 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/generic_methods_dart_math_min_max.dart:31:71: Error: A value of type 'dart.core::double' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
/*@typeArgs=int*/ min(1, /*error:ARGUMENT_TYPE_NOT_ASSIGNABLE*/ 2.0));
- ^"));
- self::printDouble(math::max<core::double>(let final dynamic #t3 = 1 in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/generic_methods_dart_math_min_max.dart:33:71: Error: A value of type 'dart.core::int' can't be assigned to a variable of type 'dart.core::double'.
+ ^" in let final dynamic #t4 = 2.0 in null));
+ self::printDouble(math::max<core::double>(let final dynamic #t5 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/generic_methods_dart_math_min_max.dart:33:71: Error: A value of type 'dart.core::int' can't be assigned to a variable of type 'dart.core::double'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::double'.
/*@typeArgs=double*/ max(/*error:ARGUMENT_TYPE_NOT_ASSIGNABLE*/ 1, 2.0));
- ^", 2.0));
- self::printDouble(math::min<core::double>(let final dynamic #t4 = 1 in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/generic_methods_dart_math_min_max.dart:35:71: Error: A value of type 'dart.core::int' can't be assigned to a variable of type 'dart.core::double'.
+ ^" in let final dynamic #t6 = 1 in null, 2.0));
+ self::printDouble(math::min<core::double>(let final dynamic #t7 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/generic_methods_dart_math_min_max.dart:35:71: Error: A value of type 'dart.core::int' can't be assigned to a variable of type 'dart.core::double'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::double'.
/*@typeArgs=double*/ min(/*error:ARGUMENT_TYPE_NOT_ASSIGNABLE*/ 1, 2.0));
- ^", 2.0));
- self::printInt(math::min<core::int>(let final dynamic #t5 = "hi" in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/generic_methods_dart_math_min_max.dart:39:46: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ ^" in let final dynamic #t8 = 1 in null, 2.0));
+ self::printInt(math::min<core::int>(let final dynamic #t9 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/generic_methods_dart_math_min_max.dart:39:46: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
/*error:ARGUMENT_TYPE_NOT_ASSIGNABLE*/ \"hi\",
- ^", let final dynamic #t6 = "there" in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/generic_methods_dart_math_min_max.dart:40:46: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ ^" in let final dynamic #t10 = "hi" in null, let final dynamic #t11 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/generic_methods_dart_math_min_max.dart:40:46: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
/*error:ARGUMENT_TYPE_NOT_ASSIGNABLE*/ \"there\"));
- ^"));
+ ^" in let final dynamic #t12 = "there" in null));
}
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/generic_methods_dart_math_min_max.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/generic_methods_dart_math_min_max.dart.strong.transformed.expect
index 6f7a974..dd3c578 100644
--- a/pkg/front_end/testcases/inference/generic_methods_dart_math_min_max.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/generic_methods_dart_math_min_max.dart.strong.transformed.expect
@@ -16,28 +16,28 @@
self::printDouble(math::min<core::double>(1.0, 2.0));
self::printInt(self::myMax(1, 2) as{TypeError} core::int);
self::printInt(self::myMax(1, 2) as core::int);
- self::printInt(math::max<core::int>(1, let final core::double #t1 = 2.0 in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/generic_methods_dart_math_min_max.dart:29:71: Error: A value of type 'dart.core::double' can't be assigned to a variable of type 'dart.core::int'.
+ self::printInt(math::max<core::int>(1, let final dynamic #t1 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/generic_methods_dart_math_min_max.dart:29:71: Error: A value of type 'dart.core::double' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
/*@typeArgs=int*/ max(1, /*error:ARGUMENT_TYPE_NOT_ASSIGNABLE*/ 2.0));
- ^"));
- self::printInt(math::min<core::int>(1, let final core::double #t2 = 2.0 in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/generic_methods_dart_math_min_max.dart:31:71: Error: A value of type 'dart.core::double' can't be assigned to a variable of type 'dart.core::int'.
+ ^" in let final core::double #t2 = 2.0 in null));
+ self::printInt(math::min<core::int>(1, let final dynamic #t3 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/generic_methods_dart_math_min_max.dart:31:71: Error: A value of type 'dart.core::double' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
/*@typeArgs=int*/ min(1, /*error:ARGUMENT_TYPE_NOT_ASSIGNABLE*/ 2.0));
- ^"));
- self::printDouble(math::max<core::double>(let final core::int #t3 = 1 in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/generic_methods_dart_math_min_max.dart:33:71: Error: A value of type 'dart.core::int' can't be assigned to a variable of type 'dart.core::double'.
+ ^" in let final core::double #t4 = 2.0 in null));
+ self::printDouble(math::max<core::double>(let final dynamic #t5 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/generic_methods_dart_math_min_max.dart:33:71: Error: A value of type 'dart.core::int' can't be assigned to a variable of type 'dart.core::double'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::double'.
/*@typeArgs=double*/ max(/*error:ARGUMENT_TYPE_NOT_ASSIGNABLE*/ 1, 2.0));
- ^", 2.0));
- self::printDouble(math::min<core::double>(let final core::int #t4 = 1 in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/generic_methods_dart_math_min_max.dart:35:71: Error: A value of type 'dart.core::int' can't be assigned to a variable of type 'dart.core::double'.
+ ^" in let final core::int #t6 = 1 in null, 2.0));
+ self::printDouble(math::min<core::double>(let final dynamic #t7 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/generic_methods_dart_math_min_max.dart:35:71: Error: A value of type 'dart.core::int' can't be assigned to a variable of type 'dart.core::double'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::double'.
/*@typeArgs=double*/ min(/*error:ARGUMENT_TYPE_NOT_ASSIGNABLE*/ 1, 2.0));
- ^", 2.0));
- self::printInt(math::min<core::int>(let final core::String #t5 = "hi" in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/generic_methods_dart_math_min_max.dart:39:46: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ ^" in let final core::int #t8 = 1 in null, 2.0));
+ self::printInt(math::min<core::int>(let final dynamic #t9 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/generic_methods_dart_math_min_max.dart:39:46: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
/*error:ARGUMENT_TYPE_NOT_ASSIGNABLE*/ \"hi\",
- ^", let final core::String #t6 = "there" in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/generic_methods_dart_math_min_max.dart:40:46: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ ^" in let final core::String #t10 = "hi" in null, let final dynamic #t11 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/generic_methods_dart_math_min_max.dart:40:46: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
/*error:ARGUMENT_TYPE_NOT_ASSIGNABLE*/ \"there\"));
- ^"));
+ ^" in let final core::String #t12 = "there" in null));
}
static method main() → dynamic {}
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 71d37ab..5ac5390 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
@@ -6,9 +6,9 @@
return null;
static method test() → dynamic {
core::String x = self::f<core::String>(<core::String>["hi"]);
- core::String y = self::f<core::String>(<core::String>[let final dynamic #t1 = 42 in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/generic_methods_downwards_inference_affects_arguments.dart:13:76: Error: A value of type 'dart.core::int' can't be assigned to a variable of type 'dart.core::String'.
+ core::String y = self::f<core::String>(<core::String>[let final dynamic #t1 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/generic_methods_downwards_inference_affects_arguments.dart:13: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'.
/*@typeArgs=String*/ [/*error:LIST_ELEMENT_TYPE_NOT_ASSIGNABLE*/ 42]);
- ^"]);
+ ^" in let final dynamic #t2 = 42 in null]);
}
static method main() → dynamic {}
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 4b349ed..4722ed3 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
@@ -6,9 +6,9 @@
return null;
static method test() → dynamic {
core::String x = self::f<core::String>(<core::String>["hi"]);
- core::String y = self::f<core::String>(<core::String>[let final core::int #t1 = 42 in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/generic_methods_downwards_inference_affects_arguments.dart:13:76: Error: A value of type 'dart.core::int' can't be assigned to a variable of type 'dart.core::String'.
+ core::String y = self::f<core::String>(<core::String>[let final dynamic #t1 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/generic_methods_downwards_inference_affects_arguments.dart:13: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'.
/*@typeArgs=String*/ [/*error:LIST_ELEMENT_TYPE_NOT_ASSIGNABLE*/ 42]);
- ^"]);
+ ^" in let final core::int #t2 = 42 in null]);
}
static method main() → 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 138df56..7774f17 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
@@ -21,14 +21,14 @@
self::takeIIO(math::max<core::int>);
self::takeDDO(math::max<core::double>);
self::takeOOI((math::max<core::Object>) as{TypeError} (core::Object, core::Object) → core::int);
- self::takeIDI(let final dynamic #t1 = math::max<core::num> in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/generic_methods_infer_generic_instantiation.dart:28:73: Error: A value of type '(dart.core::num, dart.core::num) \u8594 dart.core::num' can't be assigned to a variable of type '(dart.core::double, dart.core::int) \u8594 dart.core::int'.
+ self::takeIDI(let final dynamic #t1 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/generic_methods_infer_generic_instantiation.dart:28:73: Error: A value of type '(dart.core::num, dart.core::num) \u8594 dart.core::num' can't be assigned to a variable of type '(dart.core::double, dart.core::int) \u8594 dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to '(dart.core::double, dart.core::int) \u8594 dart.core::int'.
/*error:COULD_NOT_INFER,error:ARGUMENT_TYPE_NOT_ASSIGNABLE*/ math.max);
- ^");
- self::takeDID(let final dynamic #t2 = math::max<core::num> in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/generic_methods_infer_generic_instantiation.dart:30:73: Error: A value of type '(dart.core::num, dart.core::num) \u8594 dart.core::num' can't be assigned to a variable of type '(dart.core::int, dart.core::double) \u8594 dart.core::double'.
+ ^" in let final dynamic #t2 = math::max<core::num> in null);
+ self::takeDID(let final dynamic #t3 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/generic_methods_infer_generic_instantiation.dart:30:73: Error: A value of type '(dart.core::num, dart.core::num) \u8594 dart.core::num' can't be assigned to a variable of type '(dart.core::int, dart.core::double) \u8594 dart.core::double'.
Try changing the type of the left hand side, or casting the right hand side to '(dart.core::int, dart.core::double) \u8594 dart.core::double'.
/*error:COULD_NOT_INFER,error:ARGUMENT_TYPE_NOT_ASSIGNABLE*/ math.max);
- ^");
+ ^" in let final dynamic #t4 = math::max<core::num> in null);
self::takeOON((math::max<core::Object>) as{TypeError} (core::Object, core::Object) → core::num);
self::takeOOO((math::max<core::Object>) as{TypeError} (core::Object, core::Object) → core::num);
self::takeIII(math::min<core::int>);
@@ -41,14 +41,14 @@
self::takeIIO(math::min<core::int>);
self::takeDDO(math::min<core::double>);
self::takeOOI((math::min<core::Object>) as{TypeError} (core::Object, core::Object) → core::int);
- self::takeIDI(let final dynamic #t3 = math::min<core::num> in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/generic_methods_infer_generic_instantiation.dart:46:72: Error: A value of type '(dart.core::num, dart.core::num) \u8594 dart.core::num' can't be assigned to a variable of type '(dart.core::double, dart.core::int) \u8594 dart.core::int'.
+ self::takeIDI(let final dynamic #t5 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/generic_methods_infer_generic_instantiation.dart:46:72: Error: A value of type '(dart.core::num, dart.core::num) \u8594 dart.core::num' can't be assigned to a variable of type '(dart.core::double, dart.core::int) \u8594 dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to '(dart.core::double, dart.core::int) \u8594 dart.core::int'.
takeIDI(/*error:COULD_NOT_INFER,error:ARGUMENT_TYPE_NOT_ASSIGNABLE*/ min);
- ^");
- self::takeDID(let final dynamic #t4 = math::min<core::num> in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/generic_methods_infer_generic_instantiation.dart:47:72: Error: A value of type '(dart.core::num, dart.core::num) \u8594 dart.core::num' can't be assigned to a variable of type '(dart.core::int, dart.core::double) \u8594 dart.core::double'.
+ ^" in let final dynamic #t6 = math::min<core::num> in null);
+ self::takeDID(let final dynamic #t7 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/generic_methods_infer_generic_instantiation.dart:47:72: Error: A value of type '(dart.core::num, dart.core::num) \u8594 dart.core::num' can't be assigned to a variable of type '(dart.core::int, dart.core::double) \u8594 dart.core::double'.
Try changing the type of the left hand side, or casting the right hand side to '(dart.core::int, dart.core::double) \u8594 dart.core::double'.
takeDID(/*error:COULD_NOT_INFER,error:ARGUMENT_TYPE_NOT_ASSIGNABLE*/ min);
- ^");
+ ^" in let final dynamic #t8 = math::min<core::num> in null);
self::takeOON((math::min<core::Object>) as{TypeError} (core::Object, core::Object) → core::num);
self::takeOOO((math::min<core::Object>) as{TypeError} (core::Object, core::Object) → core::num);
self::takeIII(new self::C::•().{self::C::m}<core::int>);
@@ -63,14 +63,14 @@
self::takeOON((new self::C::•().{self::C::m}<core::Object>) as{TypeError} (core::Object, core::Object) → core::num);
self::takeOOO((new self::C::•().{self::C::m}<core::Object>) as{TypeError} (core::Object, core::Object) → core::num);
self::takeOOI((new self::C::•().{self::C::m}<core::Object>) as{TypeError} (core::Object, core::Object) → core::int);
- self::takeIDI(let final dynamic #t5 = new self::C::•().{self::C::m}<core::num> in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/generic_methods_infer_generic_instantiation.dart:86:30: Error: A value of type '(dart.core::num, dart.core::num) \u8594 dart.core::num' can't be assigned to a variable of type '(dart.core::double, dart.core::int) \u8594 dart.core::int'.
+ self::takeIDI(let final dynamic #t9 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/generic_methods_infer_generic_instantiation.dart:86:30: Error: A value of type '(dart.core::num, dart.core::num) \u8594 dart.core::num' can't be assigned to a variable of type '(dart.core::double, dart.core::int) \u8594 dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to '(dart.core::double, dart.core::int) \u8594 dart.core::int'.
. /*@target=C::m*/ m);
- ^");
- self::takeDID(let final dynamic #t6 = new self::C::•().{self::C::m}<core::num> in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/generic_methods_infer_generic_instantiation.dart:89:30: Error: A value of type '(dart.core::num, dart.core::num) \u8594 dart.core::num' can't be assigned to a variable of type '(dart.core::int, dart.core::double) \u8594 dart.core::double'.
+ ^" in let final dynamic #t10 = new self::C::•().{self::C::m}<core::num> in null);
+ self::takeDID(let final dynamic #t11 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/generic_methods_infer_generic_instantiation.dart:89:30: Error: A value of type '(dart.core::num, dart.core::num) \u8594 dart.core::num' can't be assigned to a variable of type '(dart.core::int, dart.core::double) \u8594 dart.core::double'.
Try changing the type of the left hand side, or casting the right hand side to '(dart.core::int, dart.core::double) \u8594 dart.core::double'.
. /*@target=C::m*/ m);
- ^");
+ ^" in let final dynamic #t12 = new self::C::•().{self::C::m}<core::num> in null);
}
static method takeIII((core::int, core::int) → core::int fn) → void {}
static method takeDDD((core::double, core::double) → core::double fn) → void {}
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 676fa226..a11c923 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
@@ -21,14 +21,14 @@
self::takeIIO(math::max<core::int>);
self::takeDDO(math::max<core::double>);
self::takeOOI((math::max<core::Object>) as{TypeError} (core::Object, core::Object) → core::int);
- self::takeIDI(let final (core::num, core::num) → core::num #t1 = math::max<core::num> in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/generic_methods_infer_generic_instantiation.dart:28:73: Error: A value of type '(dart.core::num, dart.core::num) \u8594 dart.core::num' can't be assigned to a variable of type '(dart.core::double, dart.core::int) \u8594 dart.core::int'.
+ self::takeIDI(let final dynamic #t1 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/generic_methods_infer_generic_instantiation.dart:28:73: Error: A value of type '(dart.core::num, dart.core::num) \u8594 dart.core::num' can't be assigned to a variable of type '(dart.core::double, dart.core::int) \u8594 dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to '(dart.core::double, dart.core::int) \u8594 dart.core::int'.
/*error:COULD_NOT_INFER,error:ARGUMENT_TYPE_NOT_ASSIGNABLE*/ math.max);
- ^");
- self::takeDID(let final (core::num, core::num) → core::num #t2 = math::max<core::num> in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/generic_methods_infer_generic_instantiation.dart:30:73: Error: A value of type '(dart.core::num, dart.core::num) \u8594 dart.core::num' can't be assigned to a variable of type '(dart.core::int, dart.core::double) \u8594 dart.core::double'.
+ ^" in let final (core::num, core::num) → core::num #t2 = math::max<core::num> in null);
+ self::takeDID(let final dynamic #t3 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/generic_methods_infer_generic_instantiation.dart:30:73: Error: A value of type '(dart.core::num, dart.core::num) \u8594 dart.core::num' can't be assigned to a variable of type '(dart.core::int, dart.core::double) \u8594 dart.core::double'.
Try changing the type of the left hand side, or casting the right hand side to '(dart.core::int, dart.core::double) \u8594 dart.core::double'.
/*error:COULD_NOT_INFER,error:ARGUMENT_TYPE_NOT_ASSIGNABLE*/ math.max);
- ^");
+ ^" in let final (core::num, core::num) → core::num #t4 = math::max<core::num> in null);
self::takeOON((math::max<core::Object>) as{TypeError} (core::Object, core::Object) → core::num);
self::takeOOO((math::max<core::Object>) as{TypeError} (core::Object, core::Object) → core::num);
self::takeIII(math::min<core::int>);
@@ -41,14 +41,14 @@
self::takeIIO(math::min<core::int>);
self::takeDDO(math::min<core::double>);
self::takeOOI((math::min<core::Object>) as{TypeError} (core::Object, core::Object) → core::int);
- self::takeIDI(let final (core::num, core::num) → core::num #t3 = math::min<core::num> in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/generic_methods_infer_generic_instantiation.dart:46:72: Error: A value of type '(dart.core::num, dart.core::num) \u8594 dart.core::num' can't be assigned to a variable of type '(dart.core::double, dart.core::int) \u8594 dart.core::int'.
+ self::takeIDI(let final dynamic #t5 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/generic_methods_infer_generic_instantiation.dart:46:72: Error: A value of type '(dart.core::num, dart.core::num) \u8594 dart.core::num' can't be assigned to a variable of type '(dart.core::double, dart.core::int) \u8594 dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to '(dart.core::double, dart.core::int) \u8594 dart.core::int'.
takeIDI(/*error:COULD_NOT_INFER,error:ARGUMENT_TYPE_NOT_ASSIGNABLE*/ min);
- ^");
- self::takeDID(let final (core::num, core::num) → core::num #t4 = math::min<core::num> in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/generic_methods_infer_generic_instantiation.dart:47:72: Error: A value of type '(dart.core::num, dart.core::num) \u8594 dart.core::num' can't be assigned to a variable of type '(dart.core::int, dart.core::double) \u8594 dart.core::double'.
+ ^" in let final (core::num, core::num) → core::num #t6 = math::min<core::num> in null);
+ self::takeDID(let final dynamic #t7 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/generic_methods_infer_generic_instantiation.dart:47:72: Error: A value of type '(dart.core::num, dart.core::num) \u8594 dart.core::num' can't be assigned to a variable of type '(dart.core::int, dart.core::double) \u8594 dart.core::double'.
Try changing the type of the left hand side, or casting the right hand side to '(dart.core::int, dart.core::double) \u8594 dart.core::double'.
takeDID(/*error:COULD_NOT_INFER,error:ARGUMENT_TYPE_NOT_ASSIGNABLE*/ min);
- ^");
+ ^" in let final (core::num, core::num) → core::num #t8 = math::min<core::num> in null);
self::takeOON((math::min<core::Object>) as{TypeError} (core::Object, core::Object) → core::num);
self::takeOOO((math::min<core::Object>) as{TypeError} (core::Object, core::Object) → core::num);
self::takeIII(new self::C::•().{self::C::m}<core::int>);
@@ -63,14 +63,14 @@
self::takeOON((new self::C::•().{self::C::m}<core::Object>) as{TypeError} (core::Object, core::Object) → core::num);
self::takeOOO((new self::C::•().{self::C::m}<core::Object>) as{TypeError} (core::Object, core::Object) → core::num);
self::takeOOI((new self::C::•().{self::C::m}<core::Object>) as{TypeError} (core::Object, core::Object) → core::int);
- self::takeIDI(let final (core::num, core::num) → core::num #t5 = new self::C::•().{self::C::m}<core::num> in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/generic_methods_infer_generic_instantiation.dart:86:30: Error: A value of type '(dart.core::num, dart.core::num) \u8594 dart.core::num' can't be assigned to a variable of type '(dart.core::double, dart.core::int) \u8594 dart.core::int'.
+ self::takeIDI(let final dynamic #t9 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/generic_methods_infer_generic_instantiation.dart:86:30: Error: A value of type '(dart.core::num, dart.core::num) \u8594 dart.core::num' can't be assigned to a variable of type '(dart.core::double, dart.core::int) \u8594 dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to '(dart.core::double, dart.core::int) \u8594 dart.core::int'.
. /*@target=C::m*/ m);
- ^");
- self::takeDID(let final (core::num, core::num) → core::num #t6 = new self::C::•().{self::C::m}<core::num> in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/generic_methods_infer_generic_instantiation.dart:89:30: Error: A value of type '(dart.core::num, dart.core::num) \u8594 dart.core::num' can't be assigned to a variable of type '(dart.core::int, dart.core::double) \u8594 dart.core::double'.
+ ^" in let final (core::num, core::num) → core::num #t10 = new self::C::•().{self::C::m}<core::num> in null);
+ self::takeDID(let final dynamic #t11 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/generic_methods_infer_generic_instantiation.dart:89:30: Error: A value of type '(dart.core::num, dart.core::num) \u8594 dart.core::num' can't be assigned to a variable of type '(dart.core::int, dart.core::double) \u8594 dart.core::double'.
Try changing the type of the left hand side, or casting the right hand side to '(dart.core::int, dart.core::double) \u8594 dart.core::double'.
. /*@target=C::m*/ m);
- ^");
+ ^" in let final (core::num, core::num) → core::num #t12 = new self::C::•().{self::C::m}<core::num> in null);
}
static method takeIII((core::int, core::int) → core::int fn) → void {}
static method takeDDD((core::double, core::double) → core::double fn) → void {}
diff --git a/pkg/front_end/testcases/inference/generic_methods_inference_error.dart.strong.expect b/pkg/front_end/testcases/inference/generic_methods_inference_error.dart.strong.expect
index a11e34a..e215e2a 100644
--- a/pkg/front_end/testcases/inference/generic_methods_inference_error.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/generic_methods_inference_error.dart.strong.expect
@@ -4,9 +4,9 @@
static method f() → void {
core::List<core::String> y;
- core::Iterable<core::String> x = y.{core::Iterable::map}<core::String>((core::String z) → core::String => let final dynamic #t1 = 1.0 in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/generic_methods_inference_error.dart:13:11: Error: A value of type 'dart.core::double' can't be assigned to a variable of type 'dart.core::String'.
+ core::Iterable<core::String> x = y.{core::Iterable::map}<core::String>((core::String z) → core::String => let final dynamic #t1 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/generic_methods_inference_error.dart:13:11: Error: A value of type 'dart.core::double' 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'.
1.0);
- ^");
+ ^" in let final dynamic #t2 = 1.0 in null);
}
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/generic_methods_inference_error.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/generic_methods_inference_error.dart.strong.transformed.expect
index 9d59ac7..3693a73 100644
--- a/pkg/front_end/testcases/inference/generic_methods_inference_error.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/generic_methods_inference_error.dart.strong.transformed.expect
@@ -4,9 +4,9 @@
static method f() → void {
core::List<core::String> y;
- core::Iterable<core::String> x = y.{core::Iterable::map}<core::String>((core::String z) → core::String => let final core::double #t1 = 1.0 in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/generic_methods_inference_error.dart:13:11: Error: A value of type 'dart.core::double' can't be assigned to a variable of type 'dart.core::String'.
+ core::Iterable<core::String> x = y.{core::Iterable::map}<core::String>((core::String z) → core::String => let final dynamic #t1 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/generic_methods_inference_error.dart:13:11: Error: A value of type 'dart.core::double' 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'.
1.0);
- ^");
+ ^" in let final core::double #t2 = 1.0 in null);
}
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/generic_methods_iterable_and_future.dart.strong.expect b/pkg/front_end/testcases/inference/generic_methods_iterable_and_future.dart.strong.expect
index 478b5a6..459700d 100644
--- a/pkg/front_end/testcases/inference/generic_methods_iterable_and_future.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/generic_methods_iterable_and_future.dart.strong.expect
@@ -12,10 +12,10 @@
Try correcting the name to the name of an existing method, or defining a method named '+'.
/*@type=int*/ y) => /*info:DYNAMIC_CAST,info:DYNAMIC_INVOKE*/ x /*error:UNDEFINED_OPERATOR*/ +
^") as{TypeError} asy::FutureOr<core::String>));
- asy::Future<core::String> results3 = results.{asy::Future::then}<core::String>((core::List<core::int> list) → asy::FutureOr<core::String> => list.{core::Iterable::fold}<asy::FutureOr<core::String>>("", let final dynamic #t2 = (core::String x, core::int y) → core::String => x.{core::String::+}(y.{core::int::toString}()) in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/generic_methods_iterable_and_future.dart:31:108: Error: A value of type '(dart.core::String, dart.core::int) \u8594 dart.core::String' can't be assigned to a variable of type '(dart.async::FutureOr<dart.core::String>, dart.core::int) \u8594 dart.async::FutureOr<dart.core::String>'.
+ asy::Future<core::String> results3 = results.{asy::Future::then}<core::String>((core::List<core::int> list) → asy::FutureOr<core::String> => list.{core::Iterable::fold}<asy::FutureOr<core::String>>("", let final dynamic #t2 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/generic_methods_iterable_and_future.dart:31:108: Error: A value of type '(dart.core::String, dart.core::int) \u8594 dart.core::String' can't be assigned to a variable of type '(dart.async::FutureOr<dart.core::String>, dart.core::int) \u8594 dart.async::FutureOr<dart.core::String>'.
Try changing the type of the left hand side, or casting the right hand side to '(dart.async::FutureOr<dart.core::String>, dart.core::int) \u8594 dart.async::FutureOr<dart.core::String>'.
/*info:INFERRED_TYPE_CLOSURE,error:ARGUMENT_TYPE_NOT_ASSIGNABLE*/ /*@returnType=String*/ (String
- ^"));
+ ^" in let final dynamic #t3 = (core::String x, core::int y) → core::String => x.{core::String::+}(y.{core::int::toString}()) in null));
asy::Future<core::String> results4 = results.{asy::Future::then}<core::String>((core::List<core::int> list) → core::String => list.{core::Iterable::fold}<core::String>("", (core::String x, core::int y) → core::String => x.{core::String::+}(y.{core::int::toString}())));
}
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/generic_methods_iterable_and_future.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/generic_methods_iterable_and_future.dart.strong.transformed.expect
index fd713bd..6be431f 100644
--- a/pkg/front_end/testcases/inference/generic_methods_iterable_and_future.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/generic_methods_iterable_and_future.dart.strong.transformed.expect
@@ -12,10 +12,10 @@
Try correcting the name to the name of an existing method, or defining a method named '+'.
/*@type=int*/ y) => /*info:DYNAMIC_CAST,info:DYNAMIC_INVOKE*/ x /*error:UNDEFINED_OPERATOR*/ +
^") as{TypeError} asy::FutureOr<core::String>));
- asy::Future<core::String> results3 = results.{asy::Future::then}<core::String>((core::List<core::int> list) → asy::FutureOr<core::String> => list.{core::Iterable::fold}<asy::FutureOr<core::String>>("", let final (core::String, core::int) → core::String #t2 = (core::String x, core::int y) → core::String => x.{core::String::+}(y.{core::int::toString}()) in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/generic_methods_iterable_and_future.dart:31:108: Error: A value of type '(dart.core::String, dart.core::int) \u8594 dart.core::String' can't be assigned to a variable of type '(dart.async::FutureOr<dart.core::String>, dart.core::int) \u8594 dart.async::FutureOr<dart.core::String>'.
+ asy::Future<core::String> results3 = results.{asy::Future::then}<core::String>((core::List<core::int> list) → asy::FutureOr<core::String> => list.{core::Iterable::fold}<asy::FutureOr<core::String>>("", let final dynamic #t2 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/generic_methods_iterable_and_future.dart:31:108: Error: A value of type '(dart.core::String, dart.core::int) \u8594 dart.core::String' can't be assigned to a variable of type '(dart.async::FutureOr<dart.core::String>, dart.core::int) \u8594 dart.async::FutureOr<dart.core::String>'.
Try changing the type of the left hand side, or casting the right hand side to '(dart.async::FutureOr<dart.core::String>, dart.core::int) \u8594 dart.async::FutureOr<dart.core::String>'.
/*info:INFERRED_TYPE_CLOSURE,error:ARGUMENT_TYPE_NOT_ASSIGNABLE*/ /*@returnType=String*/ (String
- ^"));
+ ^" in let final (core::String, core::int) → core::String #t3 = (core::String x, core::int y) → core::String => x.{core::String::+}(y.{core::int::toString}()) in null));
asy::Future<core::String> results4 = results.{asy::Future::then}<core::String>((core::List<core::int> list) → core::String => list.{core::Iterable::fold}<core::String>("", (core::String x, core::int y) → core::String => x.{core::String::+}(y.{core::int::toString}())));
}
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/infer_correctly_on_multiple_variables_declared_together.dart.strong.expect b/pkg/front_end/testcases/inference/infer_correctly_on_multiple_variables_declared_together.dart.strong.expect
index c82ec9e..285f89e 100644
--- a/pkg/front_end/testcases/inference/infer_correctly_on_multiple_variables_declared_together.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/infer_correctly_on_multiple_variables_declared_together.dart.strong.expect
@@ -23,21 +23,21 @@
core::String s;
core::int i;
s = new self::B::•().{self::B::x} as{TypeError} core::String;
- s = let final dynamic #t1 = new self::B::•().{self::B::y} in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_correctly_on_multiple_variables_declared_together.dart:26:62: Error: A value of type 'dart.core::int' can't be assigned to a variable of type 'dart.core::String'.
+ s = let final dynamic #t1 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_correctly_on_multiple_variables_declared_together.dart:26:62: 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'.
s = /*error:INVALID_ASSIGNMENT*/ new B(). /*@target=B::y*/ y;
- ^";
+ ^" in let final dynamic #t2 = new self::B::•().{self::B::y} in null;
s = new self::B::•().{self::B::z};
- s = let final dynamic #t2 = new self::B::•().{self::B::w} in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_correctly_on_multiple_variables_declared_together.dart:28:62: Error: A value of type 'dart.core::int' can't be assigned to a variable of type 'dart.core::String'.
+ s = let final dynamic #t3 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_correctly_on_multiple_variables_declared_together.dart:28:62: 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'.
s = /*error:INVALID_ASSIGNMENT*/ new B(). /*@target=B::w*/ w;
- ^";
+ ^" in let final dynamic #t4 = new self::B::•().{self::B::w} in null;
i = new self::B::•().{self::B::x} as{TypeError} core::int;
i = new self::B::•().{self::B::y};
- i = let final dynamic #t3 = new self::B::•().{self::B::z} in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_correctly_on_multiple_variables_declared_together.dart:32:62: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ i = let final dynamic #t5 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_correctly_on_multiple_variables_declared_together.dart:32:62: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
i = /*error:INVALID_ASSIGNMENT*/ new B(). /*@target=B::z*/ z;
- ^";
+ ^" in let final dynamic #t6 = new self::B::•().{self::B::z} in null;
i = new self::B::•().{self::B::w};
}
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/infer_correctly_on_multiple_variables_declared_together.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/infer_correctly_on_multiple_variables_declared_together.dart.strong.transformed.expect
index b4bc4025..81a68df 100644
--- a/pkg/front_end/testcases/inference/infer_correctly_on_multiple_variables_declared_together.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/infer_correctly_on_multiple_variables_declared_together.dart.strong.transformed.expect
@@ -23,21 +23,21 @@
core::String s;
core::int i;
s = new self::B::•().{self::B::x} as{TypeError} core::String;
- s = let final core::int #t1 = new self::B::•().{self::B::y} in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_correctly_on_multiple_variables_declared_together.dart:26:62: Error: A value of type 'dart.core::int' can't be assigned to a variable of type 'dart.core::String'.
+ s = let final dynamic #t1 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_correctly_on_multiple_variables_declared_together.dart:26:62: 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'.
s = /*error:INVALID_ASSIGNMENT*/ new B(). /*@target=B::y*/ y;
- ^";
+ ^" in let final core::int #t2 = new self::B::•().{self::B::y} in null;
s = new self::B::•().{self::B::z};
- s = let final core::int #t2 = new self::B::•().{self::B::w} in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_correctly_on_multiple_variables_declared_together.dart:28:62: Error: A value of type 'dart.core::int' can't be assigned to a variable of type 'dart.core::String'.
+ s = let final dynamic #t3 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_correctly_on_multiple_variables_declared_together.dart:28:62: 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'.
s = /*error:INVALID_ASSIGNMENT*/ new B(). /*@target=B::w*/ w;
- ^";
+ ^" in let final core::int #t4 = new self::B::•().{self::B::w} in null;
i = new self::B::•().{self::B::x} as{TypeError} core::int;
i = new self::B::•().{self::B::y};
- i = let final core::String #t3 = new self::B::•().{self::B::z} in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_correctly_on_multiple_variables_declared_together.dart:32:62: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ i = let final dynamic #t5 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_correctly_on_multiple_variables_declared_together.dart:32:62: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
i = /*error:INVALID_ASSIGNMENT*/ new B(). /*@target=B::z*/ z;
- ^";
+ ^" in let final core::String #t6 = new self::B::•().{self::B::z} in null;
i = new self::B::•().{self::B::w};
}
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/infer_from_complex_expressions_if_outer_most_value_is_precise.dart.strong.expect b/pkg/front_end/testcases/inference/infer_from_complex_expressions_if_outer_most_value_is_precise.dart.strong.expect
index f10837a..7a49ccd 100644
--- a/pkg/front_end/testcases/inference/infer_from_complex_expressions_if_outer_most_value_is_precise.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/infer_from_complex_expressions_if_outer_most_value_is_precise.dart.strong.expect
@@ -35,60 +35,60 @@
/*error:UNDEFINED_IDENTIFIER*/ x
^"]/* from null */;
static method test1() → dynamic {
- self::a = let final dynamic #t4 = "hi" in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_from_complex_expressions_if_outer_most_value_is_precise.dart:38:36: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'test::A'.
+ self::a = let final dynamic #t4 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_from_complex_expressions_if_outer_most_value_is_precise.dart:38:36: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'test::A'.
Try changing the type of the left hand side, or casting the right hand side to 'test::A'.
a = /*error:INVALID_ASSIGNMENT*/ \"hi\";
- ^";
+ ^" in let final dynamic #t5 = "hi" in null;
self::a = new self::B::•(3);
- self::b = let final dynamic #t5 = "hi" in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_from_complex_expressions_if_outer_most_value_is_precise.dart:40:36: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'test::B'.
+ self::b = let final dynamic #t6 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_from_complex_expressions_if_outer_most_value_is_precise.dart:40:36: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'test::B'.
Try changing the type of the left hand side, or casting the right hand side to 'test::B'.
b = /*error:INVALID_ASSIGNMENT*/ \"hi\";
- ^";
+ ^" in let final dynamic #t7 = "hi" in null;
self::b = new self::B::•(3);
self::c1 = <dynamic>[];
- self::c1 = let final dynamic #t6 = <dynamic, dynamic>{} in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_from_complex_expressions_if_outer_most_value_is_precise.dart:43:68: Error: A value of type 'dart.core::Map<dynamic, dynamic>' can't be assigned to a variable of type 'dart.core::List<dynamic>'.
+ self::c1 = let final dynamic #t8 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_from_complex_expressions_if_outer_most_value_is_precise.dart:43:68: Error: A value of type 'dart.core::Map<dynamic, dynamic>' can't be assigned to a variable of type 'dart.core::List<dynamic>'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::List<dynamic>'.
c1 = /*error:INVALID_ASSIGNMENT*/ /*@typeArgs=dynamic, dynamic*/ {};
- ^";
+ ^" in let final dynamic #t9 = <dynamic, dynamic>{} in null;
self::c2 = <dynamic>[];
- self::c2 = let final dynamic #t7 = <dynamic, dynamic>{} in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_from_complex_expressions_if_outer_most_value_is_precise.dart:45:68: Error: A value of type 'dart.core::Map<dynamic, dynamic>' can't be assigned to a variable of type 'dart.core::List<dynamic>'.
+ self::c2 = let final dynamic #t10 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_from_complex_expressions_if_outer_most_value_is_precise.dart:45:68: Error: A value of type 'dart.core::Map<dynamic, dynamic>' can't be assigned to a variable of type 'dart.core::List<dynamic>'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::List<dynamic>'.
c2 = /*error:INVALID_ASSIGNMENT*/ /*@typeArgs=dynamic, dynamic*/ {};
- ^";
+ ^" in let final dynamic #t11 = <dynamic, dynamic>{} in null;
self::d = <dynamic, dynamic>{};
- self::d = let final dynamic #t8 = 3 in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_from_complex_expressions_if_outer_most_value_is_precise.dart:47:36: Error: A value of type 'dart.core::int' can't be assigned to a variable of type 'dart.core::Map<dynamic, dynamic>'.
+ self::d = let final dynamic #t12 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_from_complex_expressions_if_outer_most_value_is_precise.dart:47:36: Error: A value of type 'dart.core::int' can't be assigned to a variable of type 'dart.core::Map<dynamic, dynamic>'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::Map<dynamic, dynamic>'.
d = /*error:INVALID_ASSIGNMENT*/ 3;
- ^";
+ ^" in let final dynamic #t13 = 3 in null;
self::e = new self::A::•();
- self::e = let final dynamic #t9 = <dynamic, dynamic>{} in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_from_complex_expressions_if_outer_most_value_is_precise.dart:49:67: Error: A value of type 'dart.core::Map<dynamic, dynamic>' can't be assigned to a variable of type 'test::A'.
+ self::e = let final dynamic #t14 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_from_complex_expressions_if_outer_most_value_is_precise.dart:49:67: Error: A value of type 'dart.core::Map<dynamic, dynamic>' can't be assigned to a variable of type 'test::A'.
Try changing the type of the left hand side, or casting the right hand side to 'test::A'.
e = /*error:INVALID_ASSIGNMENT*/ /*@typeArgs=dynamic, dynamic*/ {};
- ^";
+ ^" in let final dynamic #t15 = <dynamic, dynamic>{} in null;
self::f = 3;
- self::f = let final dynamic #t10 = false in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_from_complex_expressions_if_outer_most_value_is_precise.dart:51:36: Error: A value of type 'dart.core::bool' can't be assigned to a variable of type 'dart.core::int'.
+ self::f = let final dynamic #t16 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_from_complex_expressions_if_outer_most_value_is_precise.dart:51:36: Error: A value of type 'dart.core::bool' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
f = /*error:INVALID_ASSIGNMENT*/ false;
- ^";
+ ^" in let final dynamic #t17 = false in null;
self::g = 1;
- self::g = let final dynamic #t11 = false in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_from_complex_expressions_if_outer_most_value_is_precise.dart:53:36: Error: A value of type 'dart.core::bool' can't be assigned to a variable of type 'dart.core::int'.
+ self::g = let final dynamic #t18 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_from_complex_expressions_if_outer_most_value_is_precise.dart:53:36: Error: A value of type 'dart.core::bool' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
g = /*error:INVALID_ASSIGNMENT*/ false;
- ^";
- self::h = let final dynamic #t12 = false in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_from_complex_expressions_if_outer_most_value_is_precise.dart:54:36: Error: A value of type 'dart.core::bool' can't be assigned to a variable of type 'test::B'.
+ ^" in let final dynamic #t19 = false in null;
+ self::h = let final dynamic #t20 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_from_complex_expressions_if_outer_most_value_is_precise.dart:54:36: Error: A value of type 'dart.core::bool' can't be assigned to a variable of type 'test::B'.
Try changing the type of the left hand side, or casting the right hand side to 'test::B'.
h = /*error:INVALID_ASSIGNMENT*/ false;
- ^";
+ ^" in let final dynamic #t21 = false in null;
self::h = new self::B::•("b");
self::i = false;
self::j = new self::B::•("b");
- self::j = let final dynamic #t13 = false in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_from_complex_expressions_if_outer_most_value_is_precise.dart:58:36: Error: A value of type 'dart.core::bool' can't be assigned to a variable of type 'test::B'.
+ self::j = let final dynamic #t22 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_from_complex_expressions_if_outer_most_value_is_precise.dart:58:36: Error: A value of type 'dart.core::bool' can't be assigned to a variable of type 'test::B'.
Try changing the type of the left hand side, or casting the right hand side to 'test::B'.
j = /*error:INVALID_ASSIGNMENT*/ false;
- ^";
- self::j = let final dynamic #t14 = <dynamic>[] in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_from_complex_expressions_if_outer_most_value_is_precise.dart:59:58: Error: A value of type 'dart.core::List<dynamic>' can't be assigned to a variable of type 'test::B'.
+ ^" in let final dynamic #t23 = false in null;
+ self::j = let final dynamic #t24 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_from_complex_expressions_if_outer_most_value_is_precise.dart:59:58: Error: A value of type 'dart.core::List<dynamic>' can't be assigned to a variable of type 'test::B'.
Try changing the type of the left hand side, or casting the right hand side to 'test::B'.
j = /*error:INVALID_ASSIGNMENT*/ /*@typeArgs=dynamic*/ [];
- ^";
+ ^" in let final dynamic #t25 = <dynamic>[] in null;
}
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/infer_from_complex_expressions_if_outer_most_value_is_precise.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/infer_from_complex_expressions_if_outer_most_value_is_precise.dart.strong.transformed.expect
index 3038e65..664191e 100644
--- a/pkg/front_end/testcases/inference/infer_from_complex_expressions_if_outer_most_value_is_precise.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/infer_from_complex_expressions_if_outer_most_value_is_precise.dart.strong.transformed.expect
@@ -35,60 +35,60 @@
/*error:UNDEFINED_IDENTIFIER*/ x
^"]/* from null */;
static method test1() → dynamic {
- self::a = let final core::String #t4 = "hi" in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_from_complex_expressions_if_outer_most_value_is_precise.dart:38:36: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'test::A'.
+ self::a = let final dynamic #t4 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_from_complex_expressions_if_outer_most_value_is_precise.dart:38:36: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'test::A'.
Try changing the type of the left hand side, or casting the right hand side to 'test::A'.
a = /*error:INVALID_ASSIGNMENT*/ \"hi\";
- ^";
+ ^" in let final core::String #t5 = "hi" in null;
self::a = new self::B::•(3);
- self::b = let final core::String #t5 = "hi" in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_from_complex_expressions_if_outer_most_value_is_precise.dart:40:36: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'test::B'.
+ self::b = let final dynamic #t6 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_from_complex_expressions_if_outer_most_value_is_precise.dart:40:36: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'test::B'.
Try changing the type of the left hand side, or casting the right hand side to 'test::B'.
b = /*error:INVALID_ASSIGNMENT*/ \"hi\";
- ^";
+ ^" in let final core::String #t7 = "hi" in null;
self::b = new self::B::•(3);
self::c1 = <dynamic>[];
- self::c1 = let final core::Map<dynamic, dynamic> #t6 = <dynamic, dynamic>{} in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_from_complex_expressions_if_outer_most_value_is_precise.dart:43:68: Error: A value of type 'dart.core::Map<dynamic, dynamic>' can't be assigned to a variable of type 'dart.core::List<dynamic>'.
+ self::c1 = let final dynamic #t8 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_from_complex_expressions_if_outer_most_value_is_precise.dart:43:68: Error: A value of type 'dart.core::Map<dynamic, dynamic>' can't be assigned to a variable of type 'dart.core::List<dynamic>'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::List<dynamic>'.
c1 = /*error:INVALID_ASSIGNMENT*/ /*@typeArgs=dynamic, dynamic*/ {};
- ^";
+ ^" in let final core::Map<dynamic, dynamic> #t9 = <dynamic, dynamic>{} in null;
self::c2 = <dynamic>[];
- self::c2 = let final core::Map<dynamic, dynamic> #t7 = <dynamic, dynamic>{} in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_from_complex_expressions_if_outer_most_value_is_precise.dart:45:68: Error: A value of type 'dart.core::Map<dynamic, dynamic>' can't be assigned to a variable of type 'dart.core::List<dynamic>'.
+ self::c2 = let final dynamic #t10 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_from_complex_expressions_if_outer_most_value_is_precise.dart:45:68: Error: A value of type 'dart.core::Map<dynamic, dynamic>' can't be assigned to a variable of type 'dart.core::List<dynamic>'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::List<dynamic>'.
c2 = /*error:INVALID_ASSIGNMENT*/ /*@typeArgs=dynamic, dynamic*/ {};
- ^";
+ ^" in let final core::Map<dynamic, dynamic> #t11 = <dynamic, dynamic>{} in null;
self::d = <dynamic, dynamic>{};
- self::d = let final core::int #t8 = 3 in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_from_complex_expressions_if_outer_most_value_is_precise.dart:47:36: Error: A value of type 'dart.core::int' can't be assigned to a variable of type 'dart.core::Map<dynamic, dynamic>'.
+ self::d = let final dynamic #t12 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_from_complex_expressions_if_outer_most_value_is_precise.dart:47:36: Error: A value of type 'dart.core::int' can't be assigned to a variable of type 'dart.core::Map<dynamic, dynamic>'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::Map<dynamic, dynamic>'.
d = /*error:INVALID_ASSIGNMENT*/ 3;
- ^";
+ ^" in let final core::int #t13 = 3 in null;
self::e = new self::A::•();
- self::e = let final core::Map<dynamic, dynamic> #t9 = <dynamic, dynamic>{} in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_from_complex_expressions_if_outer_most_value_is_precise.dart:49:67: Error: A value of type 'dart.core::Map<dynamic, dynamic>' can't be assigned to a variable of type 'test::A'.
+ self::e = let final dynamic #t14 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_from_complex_expressions_if_outer_most_value_is_precise.dart:49:67: Error: A value of type 'dart.core::Map<dynamic, dynamic>' can't be assigned to a variable of type 'test::A'.
Try changing the type of the left hand side, or casting the right hand side to 'test::A'.
e = /*error:INVALID_ASSIGNMENT*/ /*@typeArgs=dynamic, dynamic*/ {};
- ^";
+ ^" in let final core::Map<dynamic, dynamic> #t15 = <dynamic, dynamic>{} in null;
self::f = 3;
- self::f = let final core::bool #t10 = false in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_from_complex_expressions_if_outer_most_value_is_precise.dart:51:36: Error: A value of type 'dart.core::bool' can't be assigned to a variable of type 'dart.core::int'.
+ self::f = let final dynamic #t16 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_from_complex_expressions_if_outer_most_value_is_precise.dart:51:36: Error: A value of type 'dart.core::bool' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
f = /*error:INVALID_ASSIGNMENT*/ false;
- ^";
+ ^" in let final core::bool #t17 = false in null;
self::g = 1;
- self::g = let final core::bool #t11 = false in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_from_complex_expressions_if_outer_most_value_is_precise.dart:53:36: Error: A value of type 'dart.core::bool' can't be assigned to a variable of type 'dart.core::int'.
+ self::g = let final dynamic #t18 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_from_complex_expressions_if_outer_most_value_is_precise.dart:53:36: Error: A value of type 'dart.core::bool' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
g = /*error:INVALID_ASSIGNMENT*/ false;
- ^";
- self::h = let final core::bool #t12 = false in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_from_complex_expressions_if_outer_most_value_is_precise.dart:54:36: Error: A value of type 'dart.core::bool' can't be assigned to a variable of type 'test::B'.
+ ^" in let final core::bool #t19 = false in null;
+ self::h = let final dynamic #t20 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_from_complex_expressions_if_outer_most_value_is_precise.dart:54:36: Error: A value of type 'dart.core::bool' can't be assigned to a variable of type 'test::B'.
Try changing the type of the left hand side, or casting the right hand side to 'test::B'.
h = /*error:INVALID_ASSIGNMENT*/ false;
- ^";
+ ^" in let final core::bool #t21 = false in null;
self::h = new self::B::•("b");
self::i = false;
self::j = new self::B::•("b");
- self::j = let final core::bool #t13 = false in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_from_complex_expressions_if_outer_most_value_is_precise.dart:58:36: Error: A value of type 'dart.core::bool' can't be assigned to a variable of type 'test::B'.
+ self::j = let final dynamic #t22 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_from_complex_expressions_if_outer_most_value_is_precise.dart:58:36: Error: A value of type 'dart.core::bool' can't be assigned to a variable of type 'test::B'.
Try changing the type of the left hand side, or casting the right hand side to 'test::B'.
j = /*error:INVALID_ASSIGNMENT*/ false;
- ^";
- self::j = let final core::List<dynamic> #t14 = <dynamic>[] in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_from_complex_expressions_if_outer_most_value_is_precise.dart:59:58: Error: A value of type 'dart.core::List<dynamic>' can't be assigned to a variable of type 'test::B'.
+ ^" in let final core::bool #t23 = false in null;
+ self::j = let final dynamic #t24 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_from_complex_expressions_if_outer_most_value_is_precise.dart:59:58: Error: A value of type 'dart.core::List<dynamic>' can't be assigned to a variable of type 'test::B'.
Try changing the type of the left hand side, or casting the right hand side to 'test::B'.
j = /*error:INVALID_ASSIGNMENT*/ /*@typeArgs=dynamic*/ [];
- ^";
+ ^" in let final core::List<dynamic> #t25 = <dynamic>[] in null;
}
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/infer_from_variables_in_non_cycle_imports_with_flag.dart.strong.expect b/pkg/front_end/testcases/inference/infer_from_variables_in_non_cycle_imports_with_flag.dart.strong.expect
index 9a2fd7b..708d7f1 100644
--- a/pkg/front_end/testcases/inference/infer_from_variables_in_non_cycle_imports_with_flag.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/infer_from_variables_in_non_cycle_imports_with_flag.dart.strong.expect
@@ -5,13 +5,13 @@
static field core::int y = inf::x;
static method test1() → dynamic {
- inf::x = let final dynamic #t1 = "hi" in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_from_variables_in_non_cycle_imports_with_flag.dart:13:36: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ inf::x = let final dynamic #t1 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_from_variables_in_non_cycle_imports_with_flag.dart:13:36: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
x = /*error:INVALID_ASSIGNMENT*/ \"hi\";
- ^";
- self::y = let final dynamic #t2 = "hi" in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_from_variables_in_non_cycle_imports_with_flag.dart:14:36: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ ^" in let final dynamic #t2 = "hi" in null;
+ self::y = let final dynamic #t3 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_from_variables_in_non_cycle_imports_with_flag.dart:14:36: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
y = /*error:INVALID_ASSIGNMENT*/ \"hi\";
- ^";
+ ^" in let final dynamic #t4 = "hi" in null;
}
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/infer_from_variables_in_non_cycle_imports_with_flag.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/infer_from_variables_in_non_cycle_imports_with_flag.dart.strong.transformed.expect
index db59943..cd6e0c2 100644
--- a/pkg/front_end/testcases/inference/infer_from_variables_in_non_cycle_imports_with_flag.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/infer_from_variables_in_non_cycle_imports_with_flag.dart.strong.transformed.expect
@@ -5,13 +5,13 @@
static field core::int y = inf::x;
static method test1() → dynamic {
- inf::x = let final core::String #t1 = "hi" in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_from_variables_in_non_cycle_imports_with_flag.dart:13:36: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ inf::x = let final dynamic #t1 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_from_variables_in_non_cycle_imports_with_flag.dart:13:36: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
x = /*error:INVALID_ASSIGNMENT*/ \"hi\";
- ^";
- self::y = let final core::String #t2 = "hi" in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_from_variables_in_non_cycle_imports_with_flag.dart:14:36: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ ^" in let final core::String #t2 = "hi" in null;
+ self::y = let final dynamic #t3 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_from_variables_in_non_cycle_imports_with_flag.dart:14:36: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
y = /*error:INVALID_ASSIGNMENT*/ \"hi\";
- ^";
+ ^" in let final core::String #t4 = "hi" in null;
}
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/infer_from_variables_in_non_cycle_imports_with_flag2.dart.strong.expect b/pkg/front_end/testcases/inference/infer_from_variables_in_non_cycle_imports_with_flag2.dart.strong.expect
index ec6bb1e..c3efe0d 100644
--- a/pkg/front_end/testcases/inference/infer_from_variables_in_non_cycle_imports_with_flag2.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/infer_from_variables_in_non_cycle_imports_with_flag2.dart.strong.expect
@@ -10,13 +10,13 @@
;
}
static method test1() → dynamic {
- inf::A::x = let final dynamic #t1 = "hi" in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_from_variables_in_non_cycle_imports_with_flag2.dart:15:38: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ inf::A::x = let final dynamic #t1 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_from_variables_in_non_cycle_imports_with_flag2.dart:15:38: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
A.x = /*error:INVALID_ASSIGNMENT*/ \"hi\";
- ^";
- self::B::y = let final dynamic #t2 = "hi" in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_from_variables_in_non_cycle_imports_with_flag2.dart:16:38: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ ^" in let final dynamic #t2 = "hi" in null;
+ self::B::y = let final dynamic #t3 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_from_variables_in_non_cycle_imports_with_flag2.dart:16:38: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
B.y = /*error:INVALID_ASSIGNMENT*/ \"hi\";
- ^";
+ ^" in let final dynamic #t4 = "hi" in null;
}
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/infer_from_variables_in_non_cycle_imports_with_flag2.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/infer_from_variables_in_non_cycle_imports_with_flag2.dart.strong.transformed.expect
index dbef01c..5932bf8 100644
--- a/pkg/front_end/testcases/inference/infer_from_variables_in_non_cycle_imports_with_flag2.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/infer_from_variables_in_non_cycle_imports_with_flag2.dart.strong.transformed.expect
@@ -10,13 +10,13 @@
;
}
static method test1() → dynamic {
- inf::A::x = let final core::String #t1 = "hi" in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_from_variables_in_non_cycle_imports_with_flag2.dart:15:38: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ inf::A::x = let final dynamic #t1 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_from_variables_in_non_cycle_imports_with_flag2.dart:15:38: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
A.x = /*error:INVALID_ASSIGNMENT*/ \"hi\";
- ^";
- self::B::y = let final core::String #t2 = "hi" in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_from_variables_in_non_cycle_imports_with_flag2.dart:16:38: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ ^" in let final core::String #t2 = "hi" in null;
+ self::B::y = let final dynamic #t3 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_from_variables_in_non_cycle_imports_with_flag2.dart:16:38: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
B.y = /*error:INVALID_ASSIGNMENT*/ \"hi\";
- ^";
+ ^" in let final core::String #t4 = "hi" in null;
}
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/infer_type_on_overridden_fields2.dart.strong.expect b/pkg/front_end/testcases/inference/infer_type_on_overridden_fields2.dart.strong.expect
index fa17ad2..ab767ce 100644
--- a/pkg/front_end/testcases/inference/infer_type_on_overridden_fields2.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/infer_type_on_overridden_fields2.dart.strong.expect
@@ -16,10 +16,10 @@
return 3;
}
static method foo() → dynamic {
- core::String y = let final dynamic #t1 = new self::B::•().{self::B::x} in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_type_on_overridden_fields2.dart:17:69: Error: A value of type 'dart.core::int' can't be assigned to a variable of type 'dart.core::String'.
+ core::String y = let final dynamic #t1 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_type_on_overridden_fields2.dart:17:69: 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'.
String y = /*error:INVALID_ASSIGNMENT*/ new B(). /*@target=B::x*/ x;
- ^";
+ ^" in let final dynamic #t2 = new self::B::•().{self::B::x} in null;
core::int z = new self::B::•().{self::B::x};
}
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/infer_type_on_overridden_fields2.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/infer_type_on_overridden_fields2.dart.strong.transformed.expect
index 31064b9..e8028b4 100644
--- a/pkg/front_end/testcases/inference/infer_type_on_overridden_fields2.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/infer_type_on_overridden_fields2.dart.strong.transformed.expect
@@ -16,10 +16,10 @@
return 3;
}
static method foo() → dynamic {
- core::String y = let final core::int #t1 = new self::B::•().{self::B::x} in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_type_on_overridden_fields2.dart:17:69: Error: A value of type 'dart.core::int' can't be assigned to a variable of type 'dart.core::String'.
+ core::String y = let final dynamic #t1 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_type_on_overridden_fields2.dart:17:69: 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'.
String y = /*error:INVALID_ASSIGNMENT*/ new B(). /*@target=B::x*/ x;
- ^";
+ ^" in let final core::int #t2 = new self::B::•().{self::B::x} in null;
core::int z = new self::B::•().{self::B::x};
}
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/infer_type_on_overridden_fields4.dart.strong.expect b/pkg/front_end/testcases/inference/infer_type_on_overridden_fields4.dart.strong.expect
index 45ce781..d61fe5e 100644
--- a/pkg/front_end/testcases/inference/infer_type_on_overridden_fields4.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/infer_type_on_overridden_fields4.dart.strong.expect
@@ -16,10 +16,10 @@
return 3;
}
static method foo() → dynamic {
- core::String y = let final dynamic #t1 = new self::B::•().{self::B::x} in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_type_on_overridden_fields4.dart:17:69: Error: A value of type 'dart.core::int' can't be assigned to a variable of type 'dart.core::String'.
+ core::String y = let final dynamic #t1 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_type_on_overridden_fields4.dart:17:69: 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'.
String y = /*error:INVALID_ASSIGNMENT*/ new B(). /*@target=B::x*/ x;
- ^";
+ ^" in let final dynamic #t2 = new self::B::•().{self::B::x} in null;
core::int z = new self::B::•().{self::B::x};
}
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/infer_type_on_overridden_fields4.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/infer_type_on_overridden_fields4.dart.strong.transformed.expect
index 6b2f6fb..d476ef7 100644
--- a/pkg/front_end/testcases/inference/infer_type_on_overridden_fields4.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/infer_type_on_overridden_fields4.dart.strong.transformed.expect
@@ -16,10 +16,10 @@
return 3;
}
static method foo() → dynamic {
- core::String y = let final core::int #t1 = new self::B::•().{self::B::x} in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_type_on_overridden_fields4.dart:17:69: Error: A value of type 'dart.core::int' can't be assigned to a variable of type 'dart.core::String'.
+ core::String y = let final dynamic #t1 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_type_on_overridden_fields4.dart:17:69: 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'.
String y = /*error:INVALID_ASSIGNMENT*/ new B(). /*@target=B::x*/ x;
- ^";
+ ^" in let final core::int #t2 = new self::B::•().{self::B::x} in null;
core::int z = new self::B::•().{self::B::x};
}
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/infer_type_on_var.dart.strong.expect b/pkg/front_end/testcases/inference/infer_type_on_var.dart.strong.expect
index 66fe036..a43d1ae 100644
--- a/pkg/front_end/testcases/inference/infer_type_on_var.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/infer_type_on_var.dart.strong.expect
@@ -4,9 +4,9 @@
static method test1() → dynamic {
core::int x = 3;
- x = let final dynamic #t1 = "hi" in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_type_on_var.dart:10:36: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ x = let final dynamic #t1 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_type_on_var.dart:10:36: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
x = /*error:INVALID_ASSIGNMENT*/ \"hi\";
- ^";
+ ^" in let final dynamic #t2 = "hi" in null;
}
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/infer_type_on_var.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/infer_type_on_var.dart.strong.transformed.expect
index 801f0ec..58d47dd 100644
--- a/pkg/front_end/testcases/inference/infer_type_on_var.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/infer_type_on_var.dart.strong.transformed.expect
@@ -4,9 +4,9 @@
static method test1() → dynamic {
core::int x = 3;
- x = let final core::String #t1 = "hi" in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_type_on_var.dart:10:36: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ x = let final dynamic #t1 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_type_on_var.dart:10:36: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
x = /*error:INVALID_ASSIGNMENT*/ \"hi\";
- ^";
+ ^" in let final core::String #t2 = "hi" in null;
}
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/infer_type_on_var2.dart.strong.expect b/pkg/front_end/testcases/inference/infer_type_on_var2.dart.strong.expect
index 147a582..f1715e6 100644
--- a/pkg/front_end/testcases/inference/infer_type_on_var2.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/infer_type_on_var2.dart.strong.expect
@@ -4,9 +4,9 @@
static method test2() → dynamic {
core::int x = 3;
- x = let final dynamic #t1 = "hi" in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_type_on_var2.dart:10:36: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ x = let final dynamic #t1 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_type_on_var2.dart:10:36: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
x = /*error:INVALID_ASSIGNMENT*/ \"hi\";
- ^";
+ ^" in let final dynamic #t2 = "hi" in null;
}
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/infer_type_on_var2.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/infer_type_on_var2.dart.strong.transformed.expect
index 5ff04c6..fd663a6 100644
--- a/pkg/front_end/testcases/inference/infer_type_on_var2.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/infer_type_on_var2.dart.strong.transformed.expect
@@ -4,9 +4,9 @@
static method test2() → dynamic {
core::int x = 3;
- x = let final core::String #t1 = "hi" in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_type_on_var2.dart:10:36: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ x = let final dynamic #t1 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_type_on_var2.dart:10:36: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
x = /*error:INVALID_ASSIGNMENT*/ \"hi\";
- ^";
+ ^" in let final core::String #t2 = "hi" in null;
}
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/infer_type_on_var_from_field.dart.strong.expect b/pkg/front_end/testcases/inference/infer_type_on_var_from_field.dart.strong.expect
index 1ed7c28..f583bb8 100644
--- a/pkg/front_end/testcases/inference/infer_type_on_var_from_field.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/infer_type_on_var_from_field.dart.strong.expect
@@ -11,22 +11,22 @@
;
method test1() → dynamic {
core::int a = this.{self::A::x};
- a = let final dynamic #t1 = "hi" in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_type_on_var_from_field.dart:13:38: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ a = let final dynamic #t1 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_type_on_var_from_field.dart:13:38: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
a = /*error:INVALID_ASSIGNMENT*/ \"hi\";
- ^";
+ ^" in let final dynamic #t2 = "hi" in null;
a = 3;
core::int b = this.{self::A::y};
- b = let final dynamic #t2 = "hi" in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_type_on_var_from_field.dart:16:38: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ b = let final dynamic #t3 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_type_on_var_from_field.dart:16:38: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
b = /*error:INVALID_ASSIGNMENT*/ \"hi\";
- ^";
+ ^" in let final dynamic #t4 = "hi" in null;
b = 4;
core::int c = this.{self::A::z};
- c = let final dynamic #t3 = "hi" in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_type_on_var_from_field.dart:19:38: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ c = let final dynamic #t5 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_type_on_var_from_field.dart:19:38: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
c = /*error:INVALID_ASSIGNMENT*/ \"hi\";
- ^";
+ ^" in let final dynamic #t6 = "hi" in null;
c = 4;
}
}
diff --git a/pkg/front_end/testcases/inference/infer_type_on_var_from_field.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/infer_type_on_var_from_field.dart.strong.transformed.expect
index 89f651c..025bb0b 100644
--- a/pkg/front_end/testcases/inference/infer_type_on_var_from_field.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/infer_type_on_var_from_field.dart.strong.transformed.expect
@@ -11,22 +11,22 @@
;
method test1() → dynamic {
core::int a = this.{self::A::x};
- a = let final core::String #t1 = "hi" in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_type_on_var_from_field.dart:13:38: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ a = let final dynamic #t1 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_type_on_var_from_field.dart:13:38: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
a = /*error:INVALID_ASSIGNMENT*/ \"hi\";
- ^";
+ ^" in let final core::String #t2 = "hi" in null;
a = 3;
core::int b = this.{self::A::y};
- b = let final core::String #t2 = "hi" in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_type_on_var_from_field.dart:16:38: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ b = let final dynamic #t3 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_type_on_var_from_field.dart:16:38: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
b = /*error:INVALID_ASSIGNMENT*/ \"hi\";
- ^";
+ ^" in let final core::String #t4 = "hi" in null;
b = 4;
core::int c = this.{self::A::z};
- c = let final core::String #t3 = "hi" in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_type_on_var_from_field.dart:19:38: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ c = let final dynamic #t5 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_type_on_var_from_field.dart:19:38: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
c = /*error:INVALID_ASSIGNMENT*/ \"hi\";
- ^";
+ ^" in let final core::String #t6 = "hi" in null;
c = 4;
}
}
diff --git a/pkg/front_end/testcases/inference/infer_type_on_var_from_top_level.dart.strong.expect b/pkg/front_end/testcases/inference/infer_type_on_var_from_top_level.dart.strong.expect
index 637a3da..13b5afa 100644
--- a/pkg/front_end/testcases/inference/infer_type_on_var_from_top_level.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/infer_type_on_var_from_top_level.dart.strong.expect
@@ -7,22 +7,22 @@
static final field core::int z = 42;
static method test1() → dynamic {
core::int a = self::x;
- a = let final dynamic #t1 = "hi" in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_type_on_var_from_top_level.dart:12:36: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ a = let final dynamic #t1 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_type_on_var_from_top_level.dart:12:36: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
a = /*error:INVALID_ASSIGNMENT*/ \"hi\";
- ^";
+ ^" in let final dynamic #t2 = "hi" in null;
a = 3;
core::int b = self::y;
- b = let final dynamic #t2 = "hi" in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_type_on_var_from_top_level.dart:15:36: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ b = let final dynamic #t3 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_type_on_var_from_top_level.dart:15:36: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
b = /*error:INVALID_ASSIGNMENT*/ \"hi\";
- ^";
+ ^" in let final dynamic #t4 = "hi" in null;
b = 4;
core::int c = self::z;
- c = let final dynamic #t3 = "hi" in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_type_on_var_from_top_level.dart:18:36: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ c = let final dynamic #t5 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_type_on_var_from_top_level.dart:18:36: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
c = /*error:INVALID_ASSIGNMENT*/ \"hi\";
- ^";
+ ^" in let final dynamic #t6 = "hi" in null;
c = 4;
}
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/infer_type_on_var_from_top_level.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/infer_type_on_var_from_top_level.dart.strong.transformed.expect
index 6fc3b5d..3bb751c 100644
--- a/pkg/front_end/testcases/inference/infer_type_on_var_from_top_level.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/infer_type_on_var_from_top_level.dart.strong.transformed.expect
@@ -7,22 +7,22 @@
static final field core::int z = 42;
static method test1() → dynamic {
core::int a = self::x;
- a = let final core::String #t1 = "hi" in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_type_on_var_from_top_level.dart:12:36: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ a = let final dynamic #t1 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_type_on_var_from_top_level.dart:12:36: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
a = /*error:INVALID_ASSIGNMENT*/ \"hi\";
- ^";
+ ^" in let final core::String #t2 = "hi" in null;
a = 3;
core::int b = self::y;
- b = let final core::String #t2 = "hi" in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_type_on_var_from_top_level.dart:15:36: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ b = let final dynamic #t3 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_type_on_var_from_top_level.dart:15:36: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
b = /*error:INVALID_ASSIGNMENT*/ \"hi\";
- ^";
+ ^" in let final core::String #t4 = "hi" in null;
b = 4;
core::int c = self::z;
- c = let final core::String #t3 = "hi" in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_type_on_var_from_top_level.dart:18:36: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ c = let final dynamic #t5 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_type_on_var_from_top_level.dart:18:36: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
c = /*error:INVALID_ASSIGNMENT*/ \"hi\";
- ^";
+ ^" in let final core::String #t6 = "hi" in null;
c = 4;
}
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/infer_type_regardless_of_declaration_order_or_cycles.dart.strong.expect b/pkg/front_end/testcases/inference/infer_type_regardless_of_declaration_order_or_cycles.dart.strong.expect
index a1338de..1f67d46 100644
--- a/pkg/front_end/testcases/inference/infer_type_regardless_of_declaration_order_or_cycles.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/infer_type_regardless_of_declaration_order_or_cycles.dart.strong.expect
@@ -19,10 +19,10 @@
}
static method foo() → dynamic {
core::int y = new self::C::•().{self::C::x};
- core::String z = let final dynamic #t1 = new self::C::•().{self::C::x} in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_type_regardless_of_declaration_order_or_cycles.dart:20:69: Error: A value of type 'dart.core::int' can't be assigned to a variable of type 'dart.core::String'.
+ core::String z = let final dynamic #t1 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_type_regardless_of_declaration_order_or_cycles.dart:20:69: 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'.
String z = /*error:INVALID_ASSIGNMENT*/ new C(). /*@target=C::x*/ x;
- ^";
+ ^" in let final dynamic #t2 = new self::C::•().{self::C::x} in null;
}
static method main() → dynamic {
self::foo();
diff --git a/pkg/front_end/testcases/inference/infer_type_regardless_of_declaration_order_or_cycles.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/infer_type_regardless_of_declaration_order_or_cycles.dart.strong.transformed.expect
index 59c8d66..76508fd 100644
--- a/pkg/front_end/testcases/inference/infer_type_regardless_of_declaration_order_or_cycles.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/infer_type_regardless_of_declaration_order_or_cycles.dart.strong.transformed.expect
@@ -19,10 +19,10 @@
}
static method foo() → dynamic {
core::int y = new self::C::•().{self::C::x};
- core::String z = let final core::int #t1 = new self::C::•().{self::C::x} in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_type_regardless_of_declaration_order_or_cycles.dart:20:69: Error: A value of type 'dart.core::int' can't be assigned to a variable of type 'dart.core::String'.
+ core::String z = let final dynamic #t1 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_type_regardless_of_declaration_order_or_cycles.dart:20:69: 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'.
String z = /*error:INVALID_ASSIGNMENT*/ new C(). /*@target=C::x*/ x;
- ^";
+ ^" in let final core::int #t2 = new self::C::•().{self::C::x} in null;
}
static method main() → dynamic {
self::foo();
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 0fce35c..f6f271d 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
@@ -16,16 +16,16 @@
get x() → core::int
return 3;
get w() → core::int
- return let final dynamic #t1 = "hello" in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_types_on_generic_instantiations_3.dart:15:62: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ return let final dynamic #t1 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_types_on_generic_instantiations_3.dart:15:62: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
get /*@topType=int*/ w => /*error:RETURN_OF_INVALID_TYPE*/ \"hello\";
- ^";
+ ^" in let final dynamic #t2 = "hello" in null;
}
static method foo() → dynamic {
- core::String y = let final dynamic #t2 = new self::B::•().{self::B::x} in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_types_on_generic_instantiations_3.dart:19:69: Error: A value of type 'dart.core::int' can't be assigned to a variable of type 'dart.core::String'.
+ core::String y = let final dynamic #t3 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_types_on_generic_instantiations_3.dart:19:69: 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'.
String y = /*error:INVALID_ASSIGNMENT*/ new B(). /*@target=B::x*/ x;
- ^";
+ ^" in let final dynamic #t4 = new self::B::•().{self::B::x} in null;
core::int z = new self::B::•().{self::B::x};
}
static method main() → dynamic {}
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 a834f75..b41ed11 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
@@ -16,16 +16,16 @@
get x() → core::int
return 3;
get w() → core::int
- return let final core::String #t1 = "hello" in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_types_on_generic_instantiations_3.dart:15:62: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ return let final dynamic #t1 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_types_on_generic_instantiations_3.dart:15:62: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
get /*@topType=int*/ w => /*error:RETURN_OF_INVALID_TYPE*/ \"hello\";
- ^";
+ ^" in let final core::String #t2 = "hello" in null;
}
static method foo() → dynamic {
- core::String y = let final core::int #t2 = new self::B::•().{self::B::x} in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_types_on_generic_instantiations_3.dart:19:69: Error: A value of type 'dart.core::int' can't be assigned to a variable of type 'dart.core::String'.
+ core::String y = let final dynamic #t3 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_types_on_generic_instantiations_3.dart:19:69: 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'.
String y = /*error:INVALID_ASSIGNMENT*/ new B(). /*@target=B::x*/ x;
- ^";
+ ^" in let final core::int #t4 = new self::B::•().{self::B::x} in null;
core::int z = new self::B::•().{self::B::x};
}
static method main() → dynamic {}
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 81eb021..870f4ed 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
@@ -17,10 +17,10 @@
return this.{self::B::y};
}
static method foo() → dynamic {
- core::int y = let final dynamic #t1 = new self::B::•<core::String>().{self::B::x} in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_types_on_generic_instantiations_4.dart:18:74: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ core::int y = let final dynamic #t1 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_types_on_generic_instantiations_4.dart:18:74: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
int y = /*error:INVALID_ASSIGNMENT*/ new B<String>(). /*@target=B::x*/ x;
- ^";
+ ^" in let final dynamic #t2 = new self::B::•<core::String>().{self::B::x} in null;
core::String z = new self::B::•<core::String>().{self::B::x};
}
static method main() → dynamic {
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 19f61cc..30e1bb6 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
@@ -17,10 +17,10 @@
return this.{self::B::y};
}
static method foo() → dynamic {
- core::int y = let final core::String #t1 = new self::B::•<core::String>().{self::B::x} in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_types_on_generic_instantiations_4.dart:18:74: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ core::int y = let final dynamic #t1 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_types_on_generic_instantiations_4.dart:18:74: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
int y = /*error:INVALID_ASSIGNMENT*/ new B<String>(). /*@target=B::x*/ x;
- ^";
+ ^" in let final core::String #t2 = new self::B::•<core::String>().{self::B::x} in null;
core::String z = new self::B::•<core::String>().{self::B::x};
}
static method main() → dynamic {
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 e9d2281..7c59a35 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
@@ -29,10 +29,10 @@
method m(dynamic a, (dynamic, self::B::E) → dynamic f) → core::String {}
}
static method foo() → dynamic {
- core::int y = let final dynamic #t1 = new self::B::•<dynamic>().{self::B::m}(null, null) in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_types_on_generic_instantiations_5.dart:30:26: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ core::int y = let final dynamic #t1 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_types_on_generic_instantiations_5.dart:30:26: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
. /*@target=B::m*/ m(null, null);
- ^";
+ ^" in let final dynamic #t2 = new self::B::•<dynamic>().{self::B::m}(null, null) in null;
core::String z = new self::B::•<dynamic>().{self::B::m}(null, null);
}
static method main() → dynamic {}
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 183e897..9d7b98a 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
@@ -29,10 +29,10 @@
method m(dynamic a, (dynamic, self::B::E) → dynamic f) → core::String {}
}
static method foo() → dynamic {
- core::int y = let final core::String #t1 = new self::B::•<dynamic>().{self::B::m}(null, null) in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_types_on_generic_instantiations_5.dart:30:26: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ core::int y = let final dynamic #t1 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_types_on_generic_instantiations_5.dart:30:26: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
. /*@target=B::m*/ m(null, null);
- ^";
+ ^" in let final core::String #t2 = new self::B::•<dynamic>().{self::B::m}(null, null) in null;
core::String z = new self::B::•<dynamic>().{self::B::m}(null, null);
}
static method main() → dynamic {}
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 6cc6701..33ef878 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
@@ -24,10 +24,10 @@
method m(dynamic a, (dynamic, core::int) → dynamic f) → self::A<self::B::E> {}
}
static method foo() → dynamic {
- core::int y = let final dynamic #t1 = new self::B::•<core::String>().{self::B::m}(null, null).{self::A::value} in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_types_on_generic_instantiations_in_library_cycle.dart:30:30: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ core::int y = let final dynamic #t1 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_types_on_generic_instantiations_in_library_cycle.dart:30:30: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
. /*@target=A::value*/ value;
- ^";
+ ^" in let final dynamic #t2 = new self::B::•<core::String>().{self::B::m}(null, null).{self::A::value} in null;
core::String z = new self::B::•<core::String>().{self::B::m}(null, null).{self::A::value};
}
static method main() → dynamic {}
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 8c026b3..e7bb4e0 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
@@ -24,10 +24,10 @@
method m(dynamic a, (dynamic, core::int) → dynamic f) → self::A<self::B::E> {}
}
static method foo() → dynamic {
- core::int y = let final core::String #t1 = new self::B::•<core::String>().{self::B::m}(null, null).{self::A::value} in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_types_on_generic_instantiations_in_library_cycle.dart:30:30: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ core::int y = let final dynamic #t1 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_types_on_generic_instantiations_in_library_cycle.dart:30:30: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
. /*@target=A::value*/ value;
- ^";
+ ^" in let final core::String #t2 = new self::B::•<core::String>().{self::B::m}(null, null).{self::A::value} in null;
core::String z = new self::B::•<core::String>().{self::B::m}(null, null).{self::A::value};
}
static method main() → dynamic {}
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 32d9436..e02a9c4 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
@@ -14,10 +14,10 @@
;
method foo(generic-covariant-impl generic-covariant-interface self::Bar::T t) → void {
for (core::String i in t) {
- core::int x = let final dynamic #t1 = i in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_types_on_loop_indices_for_each_loop.dart:15:44: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ core::int x = let final dynamic #t1 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_types_on_loop_indices_for_each_loop.dart:15:44: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
int x = /*error:INVALID_ASSIGNMENT*/ i;
- ^";
+ ^" in let final dynamic #t2 = i in null;
}
}
}
@@ -27,10 +27,10 @@
;
method foo(generic-covariant-impl generic-covariant-interface self::Baz::S t) → void {
for (self::Baz::T i in t) {
- core::int x = let final dynamic #t2 = i in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_types_on_loop_indices_for_each_loop.dart:23:44: Error: A value of type 'test::Baz::T' can't be assigned to a variable of type 'dart.core::int'.
+ core::int x = let final dynamic #t3 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_types_on_loop_indices_for_each_loop.dart:23:44: Error: A value of type 'test::Baz::T' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
int x = /*error:INVALID_ASSIGNMENT*/ i;
- ^";
+ ^" in let final dynamic #t4 = i in null;
self::Baz::T y = i;
}
}
@@ -38,41 +38,41 @@
static method test() → dynamic {
core::List<self::Foo> list = <self::Foo>[];
for (self::Foo x in list) {
- core::String y = let final dynamic #t3 = x in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_types_on_loop_indices_for_each_loop.dart:32:45: Error: A value of type 'test::Foo' can't be assigned to a variable of type 'dart.core::String'.
+ core::String y = let final dynamic #t5 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_types_on_loop_indices_for_each_loop.dart:32:45: Error: A value of type 'test::Foo' 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'.
String y = /*error:INVALID_ASSIGNMENT*/ x;
- ^";
+ ^" in let final dynamic #t6 = x in null;
}
for (dynamic x in list) {
core::String y = x as{TypeError} core::String;
}
- for (final self::Foo #t4 in list) {
- core::String x = let final dynamic #t5 = #t4 in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_types_on_loop_indices_for_each_loop.dart:39:15: Error: A value of type 'test::Foo' can't be assigned to a variable of type 'dart.core::String'.
+ for (final self::Foo #t7 in list) {
+ core::String x = let final dynamic #t8 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_types_on_loop_indices_for_each_loop.dart:39:15: Error: A value of type 'test::Foo' 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'.
for (String x in /*error:FOR_IN_OF_INVALID_ELEMENT_TYPE*/ list) {
- ^";
+ ^" in let final dynamic #t9 = #t7 in null;
core::String y = x;
}
dynamic z;
- for (final self::Foo #t6 in list) {
- z = #t6;
+ for (final self::Foo #t10 in list) {
+ z = #t10;
core::String y = z as{TypeError} core::String;
}
core::Iterable<dynamic> iter = list;
- for (final dynamic #t7 in iter) {
- self::Foo x = #t7 as{TypeError} self::Foo;
+ for (final dynamic #t11 in iter) {
+ self::Foo x = #t11 as{TypeError} self::Foo;
self::Foo y = x;
}
dynamic iter2 = list;
- for (final dynamic #t8 in iter2 as{TypeError} core::Iterable<dynamic>) {
- self::Foo x = #t8 as{TypeError} self::Foo;
+ for (final dynamic #t12 in iter2 as{TypeError} core::Iterable<dynamic>) {
+ self::Foo x = #t12 as{TypeError} self::Foo;
self::Foo y = x;
}
core::Map<core::String, self::Foo> map = <core::String, self::Foo>{};
- for (dynamic x in let final dynamic #t9 = map in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_types_on_loop_indices_for_each_loop.dart:60:68: Error: A value of type 'dart.core::Map<dart.core::String, test::Foo>' can't be assigned to a variable of type 'dart.core::Iterable<dynamic>'.
+ for (dynamic x in let final dynamic #t13 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_types_on_loop_indices_for_each_loop.dart:60:68: Error: A value of type 'dart.core::Map<dart.core::String, test::Foo>' can't be assigned to a variable of type 'dart.core::Iterable<dynamic>'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::Iterable<dynamic>'.
for (var /*@type=dynamic*/ x in /*error:FOR_IN_OF_INVALID_TYPE*/ map) {
- ^") {
+ ^" in let final dynamic #t14 = map in null) {
core::String y = x as{TypeError} core::String;
}
for (core::String x in map.{core::Map::keys}) {
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 450c3b5..a4e6e95 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
@@ -14,10 +14,10 @@
;
method foo(generic-covariant-impl generic-covariant-interface self::Bar::T t) → void {
for (core::String i in t) {
- core::int x = let final core::String #t1 = i in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_types_on_loop_indices_for_each_loop.dart:15:44: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ core::int x = let final dynamic #t1 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_types_on_loop_indices_for_each_loop.dart:15:44: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
int x = /*error:INVALID_ASSIGNMENT*/ i;
- ^";
+ ^" in let final core::String #t2 = i in null;
}
}
}
@@ -27,10 +27,10 @@
;
method foo(generic-covariant-impl generic-covariant-interface self::Baz::S t) → void {
for (self::Baz::T i in t) {
- core::int x = let final self::Baz::T #t2 = i in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_types_on_loop_indices_for_each_loop.dart:23:44: Error: A value of type 'test::Baz::T' can't be assigned to a variable of type 'dart.core::int'.
+ core::int x = let final dynamic #t3 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_types_on_loop_indices_for_each_loop.dart:23:44: Error: A value of type 'test::Baz::T' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
int x = /*error:INVALID_ASSIGNMENT*/ i;
- ^";
+ ^" in let final self::Baz::T #t4 = i in null;
self::Baz::T y = i;
}
}
@@ -38,41 +38,41 @@
static method test() → dynamic {
core::List<self::Foo> list = <self::Foo>[];
for (self::Foo x in list) {
- core::String y = let final self::Foo #t3 = x in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_types_on_loop_indices_for_each_loop.dart:32:45: Error: A value of type 'test::Foo' can't be assigned to a variable of type 'dart.core::String'.
+ core::String y = let final dynamic #t5 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_types_on_loop_indices_for_each_loop.dart:32:45: Error: A value of type 'test::Foo' 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'.
String y = /*error:INVALID_ASSIGNMENT*/ x;
- ^";
+ ^" in let final self::Foo #t6 = x in null;
}
for (dynamic x in list) {
core::String y = x as{TypeError} core::String;
}
- for (final self::Foo #t4 in list) {
- core::String x = let final self::Foo #t5 = #t4 in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_types_on_loop_indices_for_each_loop.dart:39:15: Error: A value of type 'test::Foo' can't be assigned to a variable of type 'dart.core::String'.
+ for (final self::Foo #t7 in list) {
+ core::String x = let final dynamic #t8 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_types_on_loop_indices_for_each_loop.dart:39:15: Error: A value of type 'test::Foo' 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'.
for (String x in /*error:FOR_IN_OF_INVALID_ELEMENT_TYPE*/ list) {
- ^";
+ ^" in let final self::Foo #t9 = #t7 in null;
core::String y = x;
}
dynamic z;
- for (final self::Foo #t6 in list) {
- z = #t6;
+ for (final self::Foo #t10 in list) {
+ z = #t10;
core::String y = z as{TypeError} core::String;
}
core::Iterable<dynamic> iter = list;
- for (final dynamic #t7 in iter) {
- self::Foo x = #t7 as{TypeError} self::Foo;
+ for (final dynamic #t11 in iter) {
+ self::Foo x = #t11 as{TypeError} self::Foo;
self::Foo y = x;
}
dynamic iter2 = list;
- for (final dynamic #t8 in iter2 as{TypeError} core::Iterable<dynamic>) {
- self::Foo x = #t8 as{TypeError} self::Foo;
+ for (final dynamic #t12 in iter2 as{TypeError} core::Iterable<dynamic>) {
+ self::Foo x = #t12 as{TypeError} self::Foo;
self::Foo y = x;
}
core::Map<core::String, self::Foo> map = <core::String, self::Foo>{};
- for (dynamic x in let final core::Map<core::String, self::Foo> #t9 = map in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_types_on_loop_indices_for_each_loop.dart:60:68: Error: A value of type 'dart.core::Map<dart.core::String, test::Foo>' can't be assigned to a variable of type 'dart.core::Iterable<dynamic>'.
+ for (dynamic x in let final dynamic #t13 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_types_on_loop_indices_for_each_loop.dart:60:68: Error: A value of type 'dart.core::Map<dart.core::String, test::Foo>' can't be assigned to a variable of type 'dart.core::Iterable<dynamic>'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::Iterable<dynamic>'.
for (var /*@type=dynamic*/ x in /*error:FOR_IN_OF_INVALID_TYPE*/ map) {
- ^") {
+ ^" in let final core::Map<core::String, self::Foo> #t14 = map in null) {
core::String y = x as{TypeError} core::String;
}
for (core::String x in map.{core::Map::keys}) {
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 50cce8f..98d998a 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
@@ -15,10 +15,10 @@
;
method foo(generic-covariant-impl generic-covariant-interface self::Bar::T t) → dynamic async {
await for (core::String i in t) {
- core::int x = let final dynamic #t1 = i in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_types_on_loop_indices_for_each_loop_async.dart:17:44: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ core::int x = let final dynamic #t1 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_types_on_loop_indices_for_each_loop_async.dart:17:44: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
int x = /*error:INVALID_ASSIGNMENT*/ i;
- ^";
+ ^" in let final dynamic #t2 = i in null;
}
}
}
@@ -28,10 +28,10 @@
;
method foo(generic-covariant-impl generic-covariant-interface self::Baz::S t) → dynamic async {
await for (self::Baz::T i in t) {
- core::int x = let final dynamic #t2 = i in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_types_on_loop_indices_for_each_loop_async.dart:25:44: Error: A value of type 'test::Baz::T' can't be assigned to a variable of type 'dart.core::int'.
+ core::int x = let final dynamic #t3 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_types_on_loop_indices_for_each_loop_async.dart:25:44: Error: A value of type 'test::Baz::T' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
int x = /*error:INVALID_ASSIGNMENT*/ i;
- ^";
+ ^" in let final dynamic #t4 = i in null;
self::Baz::T y = i;
}
}
@@ -43,41 +43,41 @@
static method test() → dynamic async {
self::MyStream<self::Foo> myStream = self::MyStream::•<self::Foo>();
await for (self::Foo x in myStream) {
- core::String y = let final dynamic #t3 = x in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_types_on_loop_indices_for_each_loop_async.dart:38:45: Error: A value of type 'test::Foo' can't be assigned to a variable of type 'dart.core::String'.
+ core::String y = let final dynamic #t5 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_types_on_loop_indices_for_each_loop_async.dart:38:45: Error: A value of type 'test::Foo' 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'.
String y = /*error:INVALID_ASSIGNMENT*/ x;
- ^";
+ ^" in let final dynamic #t6 = x in null;
}
await for (dynamic x in myStream) {
core::String y = x as{TypeError} core::String;
}
- await for (final self::Foo #t4 in myStream) {
- core::String x = let final dynamic #t5 = #t4 in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_types_on_loop_indices_for_each_loop_async.dart:45:21: Error: A value of type 'test::Foo' can't be assigned to a variable of type 'dart.core::String'.
+ await for (final self::Foo #t7 in myStream) {
+ core::String x = let final dynamic #t8 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_types_on_loop_indices_for_each_loop_async.dart:45:21: Error: A value of type 'test::Foo' 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'.
await for (String x in /*error:FOR_IN_OF_INVALID_ELEMENT_TYPE*/ myStream) {
- ^";
+ ^" in let final dynamic #t9 = #t7 in null;
core::String y = x;
}
dynamic z;
- await for (final self::Foo #t6 in myStream) {
- z = #t6;
+ await for (final self::Foo #t10 in myStream) {
+ z = #t10;
core::String y = z as{TypeError} core::String;
}
asy::Stream<dynamic> stream = myStream;
- await for (final dynamic #t7 in stream) {
- self::Foo x = #t7 as{TypeError} self::Foo;
+ await for (final dynamic #t11 in stream) {
+ self::Foo x = #t11 as{TypeError} self::Foo;
self::Foo y = x;
}
dynamic stream2 = myStream;
- await for (final dynamic #t8 in stream2 as{TypeError} asy::Stream<dynamic>) {
- self::Foo x = #t8 as{TypeError} self::Foo;
+ await for (final dynamic #t12 in stream2 as{TypeError} asy::Stream<dynamic>) {
+ self::Foo x = #t12 as{TypeError} self::Foo;
self::Foo y = x;
}
core::Map<core::String, self::Foo> map = <core::String, self::Foo>{};
- await for (dynamic x in let final dynamic #t9 = map in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_types_on_loop_indices_for_each_loop_async.dart:66:74: Error: A value of type 'dart.core::Map<dart.core::String, test::Foo>' can't be assigned to a variable of type 'dart.async::Stream<dynamic>'.
+ await for (dynamic x in let final dynamic #t13 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_types_on_loop_indices_for_each_loop_async.dart:66:74: Error: A value of type 'dart.core::Map<dart.core::String, test::Foo>' can't be assigned to a variable of type 'dart.async::Stream<dynamic>'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.async::Stream<dynamic>'.
await for (var /*@type=dynamic*/ x in /*error:FOR_IN_OF_INVALID_TYPE*/ map) {
- ^") {
+ ^" in let final dynamic #t14 = map in null) {
core::String y = x as{TypeError} core::String;
}
}
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 86d23fa..cf338e2 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
@@ -38,10 +38,10 @@
if(:result) {
core::String i = :for-iterator.{asy::_StreamIterator::current};
{
- core::int x = let final core::String #t2 = i in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_types_on_loop_indices_for_each_loop_async.dart:17:44: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ core::int x = let final dynamic #t2 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_types_on_loop_indices_for_each_loop_async.dart:17:44: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
int x = /*error:INVALID_ASSIGNMENT*/ i;
- ^";
+ ^" in let final core::String #t3 = i in null;
}
}
else
@@ -49,7 +49,7 @@
}
finally
if(!:for-iterator.{asy::_StreamIterator::_subscription}.{core::Object::==}(null)) {
- [yield] let dynamic #t3 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::cancel}(), :async_op_then, :async_op_error, :async_op) in null;
+ [yield] let dynamic #t4 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::cancel}(), :async_op_then, :async_op_error, :async_op) in null;
:result;
}
}
@@ -92,14 +92,14 @@
try
#L4:
while (true) {
- [yield] let dynamic #t4 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::moveNext}(), :async_op_then, :async_op_error, :async_op) in null;
+ [yield] let dynamic #t5 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::moveNext}(), :async_op_then, :async_op_error, :async_op) in null;
if(:result) {
self::Baz::T i = :for-iterator.{asy::_StreamIterator::current};
{
- core::int x = let final self::Baz::T #t5 = i in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_types_on_loop_indices_for_each_loop_async.dart:25:44: Error: A value of type 'test::Baz::T' can't be assigned to a variable of type 'dart.core::int'.
+ core::int x = let final dynamic #t6 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_types_on_loop_indices_for_each_loop_async.dart:25:44: Error: A value of type 'test::Baz::T' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
int x = /*error:INVALID_ASSIGNMENT*/ i;
- ^";
+ ^" in let final self::Baz::T #t7 = i in null;
self::Baz::T y = i;
}
}
@@ -108,7 +108,7 @@
}
finally
if(!:for-iterator.{asy::_StreamIterator::_subscription}.{core::Object::==}(null)) {
- [yield] let dynamic #t6 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::cancel}(), :async_op_then, :async_op_error, :async_op) in null;
+ [yield] let dynamic #t8 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::cancel}(), :async_op_then, :async_op_error, :async_op) in null;
:result;
}
}
@@ -152,14 +152,14 @@
try
#L6:
while (true) {
- [yield] let dynamic #t7 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::moveNext}(), :async_op_then, :async_op_error, :async_op) in null;
+ [yield] let dynamic #t9 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::moveNext}(), :async_op_then, :async_op_error, :async_op) in null;
if(:result) {
self::Foo x = :for-iterator.{asy::_StreamIterator::current};
{
- core::String y = let final self::Foo #t8 = x in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_types_on_loop_indices_for_each_loop_async.dart:38:45: Error: A value of type 'test::Foo' can't be assigned to a variable of type 'dart.core::String'.
+ core::String y = let final dynamic #t10 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_types_on_loop_indices_for_each_loop_async.dart:38:45: Error: A value of type 'test::Foo' 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'.
String y = /*error:INVALID_ASSIGNMENT*/ x;
- ^";
+ ^" in let final self::Foo #t11 = x in null;
}
}
else
@@ -167,7 +167,7 @@
}
finally
if(!:for-iterator.{asy::_StreamIterator::_subscription}.{core::Object::==}(null)) {
- [yield] let dynamic #t9 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::cancel}(), :async_op_then, :async_op_error, :async_op) in null;
+ [yield] let dynamic #t12 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::cancel}(), :async_op_then, :async_op_error, :async_op) in null;
:result;
}
}
@@ -176,7 +176,7 @@
try
#L7:
while (true) {
- [yield] let dynamic #t10 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::moveNext}(), :async_op_then, :async_op_error, :async_op) in null;
+ [yield] let dynamic #t13 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::moveNext}(), :async_op_then, :async_op_error, :async_op) in null;
if(:result) {
dynamic x = :for-iterator.{asy::_StreamIterator::current};
{
@@ -188,7 +188,7 @@
}
finally
if(!:for-iterator.{asy::_StreamIterator::_subscription}.{core::Object::==}(null)) {
- [yield] let dynamic #t11 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::cancel}(), :async_op_then, :async_op_error, :async_op) in null;
+ [yield] let dynamic #t14 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::cancel}(), :async_op_then, :async_op_error, :async_op) in null;
:result;
}
}
@@ -197,14 +197,14 @@
try
#L8:
while (true) {
- [yield] let dynamic #t12 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::moveNext}(), :async_op_then, :async_op_error, :async_op) in null;
+ [yield] let dynamic #t15 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::moveNext}(), :async_op_then, :async_op_error, :async_op) in null;
if(:result) {
- final self::Foo #t13 = :for-iterator.{asy::_StreamIterator::current};
+ final self::Foo #t16 = :for-iterator.{asy::_StreamIterator::current};
{
- core::String x = let final self::Foo #t14 = #t13 in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_types_on_loop_indices_for_each_loop_async.dart:45:21: Error: A value of type 'test::Foo' can't be assigned to a variable of type 'dart.core::String'.
+ core::String x = let final dynamic #t17 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_types_on_loop_indices_for_each_loop_async.dart:45:21: Error: A value of type 'test::Foo' 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'.
await for (String x in /*error:FOR_IN_OF_INVALID_ELEMENT_TYPE*/ myStream) {
- ^";
+ ^" in let final self::Foo #t18 = #t16 in null;
core::String y = x;
}
}
@@ -213,7 +213,7 @@
}
finally
if(!:for-iterator.{asy::_StreamIterator::_subscription}.{core::Object::==}(null)) {
- [yield] let dynamic #t15 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::cancel}(), :async_op_then, :async_op_error, :async_op) in null;
+ [yield] let dynamic #t19 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::cancel}(), :async_op_then, :async_op_error, :async_op) in null;
:result;
}
}
@@ -223,11 +223,11 @@
try
#L9:
while (true) {
- [yield] let dynamic #t16 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::moveNext}(), :async_op_then, :async_op_error, :async_op) in null;
+ [yield] let dynamic #t20 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::moveNext}(), :async_op_then, :async_op_error, :async_op) in null;
if(:result) {
- final self::Foo #t17 = :for-iterator.{asy::_StreamIterator::current};
+ final self::Foo #t21 = :for-iterator.{asy::_StreamIterator::current};
{
- z = #t17;
+ z = #t21;
core::String y = z as{TypeError} core::String;
}
}
@@ -236,7 +236,7 @@
}
finally
if(!:for-iterator.{asy::_StreamIterator::_subscription}.{core::Object::==}(null)) {
- [yield] let dynamic #t18 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::cancel}(), :async_op_then, :async_op_error, :async_op) in null;
+ [yield] let dynamic #t22 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::cancel}(), :async_op_then, :async_op_error, :async_op) in null;
:result;
}
}
@@ -246,11 +246,11 @@
try
#L10:
while (true) {
- [yield] let dynamic #t19 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::moveNext}(), :async_op_then, :async_op_error, :async_op) in null;
+ [yield] let dynamic #t23 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::moveNext}(), :async_op_then, :async_op_error, :async_op) in null;
if(:result) {
- final dynamic #t20 = :for-iterator.{asy::_StreamIterator::current};
+ final dynamic #t24 = :for-iterator.{asy::_StreamIterator::current};
{
- self::Foo x = #t20 as{TypeError} self::Foo;
+ self::Foo x = #t24 as{TypeError} self::Foo;
self::Foo y = x;
}
}
@@ -259,7 +259,7 @@
}
finally
if(!:for-iterator.{asy::_StreamIterator::_subscription}.{core::Object::==}(null)) {
- [yield] let dynamic #t21 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::cancel}(), :async_op_then, :async_op_error, :async_op) in null;
+ [yield] let dynamic #t25 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::cancel}(), :async_op_then, :async_op_error, :async_op) in null;
:result;
}
}
@@ -269,11 +269,11 @@
try
#L11:
while (true) {
- [yield] let dynamic #t22 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::moveNext}(), :async_op_then, :async_op_error, :async_op) in null;
+ [yield] let dynamic #t26 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::moveNext}(), :async_op_then, :async_op_error, :async_op) in null;
if(:result) {
- final dynamic #t23 = :for-iterator.{asy::_StreamIterator::current};
+ final dynamic #t27 = :for-iterator.{asy::_StreamIterator::current};
{
- self::Foo x = #t23 as{TypeError} self::Foo;
+ self::Foo x = #t27 as{TypeError} self::Foo;
self::Foo y = x;
}
}
@@ -282,20 +282,20 @@
}
finally
if(!:for-iterator.{asy::_StreamIterator::_subscription}.{core::Object::==}(null)) {
- [yield] let dynamic #t24 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::cancel}(), :async_op_then, :async_op_error, :async_op) in null;
+ [yield] let dynamic #t28 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::cancel}(), :async_op_then, :async_op_error, :async_op) in null;
:result;
}
}
core::Map<core::String, self::Foo> map = <core::String, self::Foo>{};
{
- asy::_StreamIterator<dynamic> :for-iterator = new asy::_StreamIterator::•<dynamic>(let final core::Map<core::String, self::Foo> #t25 = map in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_types_on_loop_indices_for_each_loop_async.dart:66:74: Error: A value of type 'dart.core::Map<dart.core::String, test::Foo>' can't be assigned to a variable of type 'dart.async::Stream<dynamic>'.
+ asy::_StreamIterator<dynamic> :for-iterator = new asy::_StreamIterator::•<dynamic>(let final dynamic #t29 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/infer_types_on_loop_indices_for_each_loop_async.dart:66:74: Error: A value of type 'dart.core::Map<dart.core::String, test::Foo>' can't be assigned to a variable of type 'dart.async::Stream<dynamic>'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.async::Stream<dynamic>'.
await for (var /*@type=dynamic*/ x in /*error:FOR_IN_OF_INVALID_TYPE*/ map) {
- ^");
+ ^" in let final core::Map<core::String, self::Foo> #t30 = map in null);
try
#L12:
while (true) {
- [yield] let dynamic #t26 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::moveNext}(), :async_op_then, :async_op_error, :async_op) in null;
+ [yield] let dynamic #t31 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::moveNext}(), :async_op_then, :async_op_error, :async_op) in null;
if(:result) {
dynamic x = :for-iterator.{asy::_StreamIterator::current};
{
@@ -307,7 +307,7 @@
}
finally
if(!:for-iterator.{asy::_StreamIterator::_subscription}.{core::Object::==}(null)) {
- [yield] let dynamic #t27 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::cancel}(), :async_op_then, :async_op_error, :async_op) in null;
+ [yield] let dynamic #t32 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::cancel}(), :async_op_then, :async_op_error, :async_op) in null;
:result;
}
}
diff --git a/pkg/front_end/testcases/inference/inferred_initializing_formal_checks_default_value.dart.strong.expect b/pkg/front_end/testcases/inference/inferred_initializing_formal_checks_default_value.dart.strong.expect
index 77bf377..14cb11c 100644
--- a/pkg/front_end/testcases/inference/inferred_initializing_formal_checks_default_value.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/inferred_initializing_formal_checks_default_value.dart.strong.expect
@@ -4,10 +4,10 @@
class Foo extends core::Object {
field core::int x = 1;
- constructor •([core::int x = let final dynamic #t1 = "1" in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/inferred_initializing_formal_checks_default_value.dart:10:46: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ constructor •([core::int x = let final dynamic #t1 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/inferred_initializing_formal_checks_default_value.dart:10:46: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
Foo([this.x = /*error:INVALID_ASSIGNMENT*/ \"1\"]);
- ^"]) → void
+ ^" in let final dynamic #t2 = "1" in null]) → void
: self::Foo::x = x, super core::Object::•()
;
}
diff --git a/pkg/front_end/testcases/inference/inferred_initializing_formal_checks_default_value.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/inferred_initializing_formal_checks_default_value.dart.strong.transformed.expect
index ecee299..d5a62d4 100644
--- a/pkg/front_end/testcases/inference/inferred_initializing_formal_checks_default_value.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/inferred_initializing_formal_checks_default_value.dart.strong.transformed.expect
@@ -4,10 +4,10 @@
class Foo extends core::Object {
field core::int x = 1;
- constructor •([core::int x = let final core::String #t1 = "1" in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/inferred_initializing_formal_checks_default_value.dart:10:46: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ constructor •([core::int x = let final dynamic #t1 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/inferred_initializing_formal_checks_default_value.dart:10:46: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
Foo([this.x = /*error:INVALID_ASSIGNMENT*/ \"1\"]);
- ^"]) → void
+ ^" in let final core::String #t2 = "1" in null]) → void
: self::Foo::x = x, super core::Object::•()
;
}
diff --git a/pkg/front_end/testcases/inference/list_literals.dart.strong.expect b/pkg/front_end/testcases/inference/list_literals.dart.strong.expect
index d2cd058..83da1c81 100644
--- a/pkg/front_end/testcases/inference/list_literals.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/list_literals.dart.strong.expect
@@ -4,23 +4,23 @@
static method test1() → dynamic {
core::List<core::int> x = <core::int>[1, 2, 3];
- x.{core::List::add}(let final dynamic #t1 = "hi" in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/list_literals.dart:10:71: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ x.{core::List::add}(let final dynamic #t1 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/list_literals.dart:10:71: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
x. /*@target=List::add*/ add(/*error:ARGUMENT_TYPE_NOT_ASSIGNABLE*/ 'hi');
- ^");
- x.{core::List::add}(let final dynamic #t2 = 4.0 in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/list_literals.dart:11:71: Error: A value of type 'dart.core::double' can't be assigned to a variable of type 'dart.core::int'.
+ ^" in let final dynamic #t2 = "hi" in null);
+ x.{core::List::add}(let final dynamic #t3 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/list_literals.dart:11:71: Error: A value of type 'dart.core::double' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
x. /*@target=List::add*/ add(/*error:ARGUMENT_TYPE_NOT_ASSIGNABLE*/ 4.0);
- ^");
+ ^" in let final dynamic #t4 = 4.0 in null);
x.{core::List::add}(4);
core::List<core::num> y = x;
}
static method test2() → dynamic {
core::List<core::num> x = <core::num>[1, 2.0, 3];
- x.{core::List::add}(let final dynamic #t3 = "hi" in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/list_literals.dart:18:71: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::num'.
+ x.{core::List::add}(let final dynamic #t5 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/list_literals.dart:18:71: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::num'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::num'.
x. /*@target=List::add*/ add(/*error:ARGUMENT_TYPE_NOT_ASSIGNABLE*/ 'hi');
- ^");
+ ^" in let final dynamic #t6 = "hi" in null);
x.{core::List::add}(4.0);
core::List<core::int> y = x as{TypeError} core::List<core::int>;
}
diff --git a/pkg/front_end/testcases/inference/list_literals.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/list_literals.dart.strong.transformed.expect
index 661fec7..956676b 100644
--- a/pkg/front_end/testcases/inference/list_literals.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/list_literals.dart.strong.transformed.expect
@@ -4,23 +4,23 @@
static method test1() → dynamic {
core::List<core::int> x = <core::int>[1, 2, 3];
- x.{core::List::add}(let final core::String #t1 = "hi" in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/list_literals.dart:10:71: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ x.{core::List::add}(let final dynamic #t1 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/list_literals.dart:10:71: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
x. /*@target=List::add*/ add(/*error:ARGUMENT_TYPE_NOT_ASSIGNABLE*/ 'hi');
- ^");
- x.{core::List::add}(let final core::double #t2 = 4.0 in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/list_literals.dart:11:71: Error: A value of type 'dart.core::double' can't be assigned to a variable of type 'dart.core::int'.
+ ^" in let final core::String #t2 = "hi" in null);
+ x.{core::List::add}(let final dynamic #t3 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/list_literals.dart:11:71: Error: A value of type 'dart.core::double' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
x. /*@target=List::add*/ add(/*error:ARGUMENT_TYPE_NOT_ASSIGNABLE*/ 4.0);
- ^");
+ ^" in let final core::double #t4 = 4.0 in null);
x.{core::List::add}(4);
core::List<core::num> y = x;
}
static method test2() → dynamic {
core::List<core::num> x = <core::num>[1, 2.0, 3];
- x.{core::List::add}(let final core::String #t3 = "hi" in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/list_literals.dart:18:71: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::num'.
+ x.{core::List::add}(let final dynamic #t5 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/list_literals.dart:18:71: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::num'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::num'.
x. /*@target=List::add*/ add(/*error:ARGUMENT_TYPE_NOT_ASSIGNABLE*/ 'hi');
- ^");
+ ^" in let final core::String #t6 = "hi" in null);
x.{core::List::add}(4.0);
core::List<core::int> y = x as{TypeError} core::List<core::int>;
}
diff --git a/pkg/front_end/testcases/inference/list_literals_top_level.dart.strong.expect b/pkg/front_end/testcases/inference/list_literals_top_level.dart.strong.expect
index a66913c..a30cdb4 100644
--- a/pkg/front_end/testcases/inference/list_literals_top_level.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/list_literals_top_level.dart.strong.expect
@@ -5,22 +5,22 @@
static field core::List<core::int> x1 = <core::int>[1, 2, 3];
static field core::List<core::num> x2 = <core::num>[1, 2.0, 3];
static method test1() → dynamic {
- self::x1.{core::List::add}(let final dynamic #t1 = "hi" in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/list_literals_top_level.dart:10:72: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ self::x1.{core::List::add}(let final dynamic #t1 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/list_literals_top_level.dart:10:72: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
x1. /*@target=List::add*/ add(/*error:ARGUMENT_TYPE_NOT_ASSIGNABLE*/ 'hi');
- ^");
- self::x1.{core::List::add}(let final dynamic #t2 = 4.0 in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/list_literals_top_level.dart:11:72: Error: A value of type 'dart.core::double' can't be assigned to a variable of type 'dart.core::int'.
+ ^" in let final dynamic #t2 = "hi" in null);
+ self::x1.{core::List::add}(let final dynamic #t3 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/list_literals_top_level.dart:11:72: Error: A value of type 'dart.core::double' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
x1. /*@target=List::add*/ add(/*error:ARGUMENT_TYPE_NOT_ASSIGNABLE*/ 4.0);
- ^");
+ ^" in let final dynamic #t4 = 4.0 in null);
self::x1.{core::List::add}(4);
core::List<core::num> y = self::x1;
}
static method test2() → dynamic {
- self::x2.{core::List::add}(let final dynamic #t3 = "hi" in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/list_literals_top_level.dart:18:72: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::num'.
+ self::x2.{core::List::add}(let final dynamic #t5 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/list_literals_top_level.dart:18:72: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::num'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::num'.
x2. /*@target=List::add*/ add(/*error:ARGUMENT_TYPE_NOT_ASSIGNABLE*/ 'hi');
- ^");
+ ^" in let final dynamic #t6 = "hi" in null);
self::x2.{core::List::add}(4.0);
core::List<core::int> y = self::x2 as{TypeError} core::List<core::int>;
}
diff --git a/pkg/front_end/testcases/inference/list_literals_top_level.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/list_literals_top_level.dart.strong.transformed.expect
index d9d73c0..6972b2e 100644
--- a/pkg/front_end/testcases/inference/list_literals_top_level.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/list_literals_top_level.dart.strong.transformed.expect
@@ -5,22 +5,22 @@
static field core::List<core::int> x1 = <core::int>[1, 2, 3];
static field core::List<core::num> x2 = <core::num>[1, 2.0, 3];
static method test1() → dynamic {
- self::x1.{core::List::add}(let final core::String #t1 = "hi" in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/list_literals_top_level.dart:10:72: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ self::x1.{core::List::add}(let final dynamic #t1 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/list_literals_top_level.dart:10:72: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
x1. /*@target=List::add*/ add(/*error:ARGUMENT_TYPE_NOT_ASSIGNABLE*/ 'hi');
- ^");
- self::x1.{core::List::add}(let final core::double #t2 = 4.0 in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/list_literals_top_level.dart:11:72: Error: A value of type 'dart.core::double' can't be assigned to a variable of type 'dart.core::int'.
+ ^" in let final core::String #t2 = "hi" in null);
+ self::x1.{core::List::add}(let final dynamic #t3 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/list_literals_top_level.dart:11:72: Error: A value of type 'dart.core::double' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
x1. /*@target=List::add*/ add(/*error:ARGUMENT_TYPE_NOT_ASSIGNABLE*/ 4.0);
- ^");
+ ^" in let final core::double #t4 = 4.0 in null);
self::x1.{core::List::add}(4);
core::List<core::num> y = self::x1;
}
static method test2() → dynamic {
- self::x2.{core::List::add}(let final core::String #t3 = "hi" in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/list_literals_top_level.dart:18:72: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::num'.
+ self::x2.{core::List::add}(let final dynamic #t5 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/list_literals_top_level.dart:18:72: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::num'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::num'.
x2. /*@target=List::add*/ add(/*error:ARGUMENT_TYPE_NOT_ASSIGNABLE*/ 'hi');
- ^");
+ ^" in let final core::String #t6 = "hi" in null);
self::x2.{core::List::add}(4.0);
core::List<core::int> y = self::x2 as{TypeError} core::List<core::int>;
}
diff --git a/pkg/front_end/testcases/inference/local_return_and_yield.dart.strong.expect b/pkg/front_end/testcases/inference/local_return_and_yield.dart.strong.expect
index 1627953..0105a3f 100644
--- a/pkg/front_end/testcases/inference/local_return_and_yield.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/local_return_and_yield.dart.strong.expect
@@ -9,10 +9,10 @@
return (core::int x) → core::int => x;
}
function b() → asy::Future<(core::int) → core::int> async {
- return let final dynamic #t1 = (dynamic x) → dynamic => x in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/local_return_and_yield.dart:19:36: Error: A value of type '(dynamic) \u8594 dynamic' can't be assigned to a variable of type 'dart.async::FutureOr<(dart.core::int) \u8594 dart.core::int>'.
+ return let final dynamic #t1 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/local_return_and_yield.dart:19:36: Error: A value of type '(dynamic) \u8594 dynamic' can't be assigned to a variable of type 'dart.async::FutureOr<(dart.core::int) \u8594 dart.core::int>'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.async::FutureOr<(dart.core::int) \u8594 dart.core::int>'.
return /*@returnType=dynamic*/ (/*@type=dynamic*/ x) => x;
- ^";
+ ^" in let final dynamic #t2 = (dynamic x) → dynamic => x in null;
}
function c() → core::Iterable<(core::int) → core::int> sync* {
yield(core::int x) → core::int => x;
diff --git a/pkg/front_end/testcases/inference/local_return_and_yield.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/local_return_and_yield.dart.strong.transformed.expect
index 001a311..3710faf 100644
--- a/pkg/front_end/testcases/inference/local_return_and_yield.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/local_return_and_yield.dart.strong.transformed.expect
@@ -20,10 +20,10 @@
try {
#L1:
{
- :return_value = let final (dynamic) → dynamic #t1 = (dynamic x) → dynamic => x in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/local_return_and_yield.dart:19:36: Error: A value of type '(dynamic) \u8594 dynamic' can't be assigned to a variable of type 'dart.async::FutureOr<(dart.core::int) \u8594 dart.core::int>'.
+ :return_value = let final dynamic #t1 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/local_return_and_yield.dart:19:36: Error: A value of type '(dynamic) \u8594 dynamic' can't be assigned to a variable of type 'dart.async::FutureOr<(dart.core::int) \u8594 dart.core::int>'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.async::FutureOr<(dart.core::int) \u8594 dart.core::int>'.
return /*@returnType=dynamic*/ (/*@type=dynamic*/ x) => x;
- ^";
+ ^" in let final (dynamic) → dynamic #t2 = (dynamic x) → dynamic => x in null;
break #L1;
}
:completer.{asy::Completer::complete}(:return_value);
diff --git a/pkg/front_end/testcases/inference/map_literals.dart.strong.expect b/pkg/front_end/testcases/inference/map_literals.dart.strong.expect
index cd3c271..e4f4c9b 100644
--- a/pkg/front_end/testcases/inference/map_literals.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/map_literals.dart.strong.expect
@@ -5,32 +5,32 @@
static method test1() → dynamic {
core::Map<core::int, core::String> x = <core::int, core::String>{1: "x", 2: "y"};
x.{core::Map::[]=}(3, "z");
- x.{core::Map::[]=}(let final dynamic #t1 = "hi" in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/map_literals.dart:12:46: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ x.{core::Map::[]=}(let final dynamic #t1 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/map_literals.dart:12:46: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
/*error:ARGUMENT_TYPE_NOT_ASSIGNABLE*/ 'hi'] = 'w';
- ^", "w");
- x.{core::Map::[]=}(let final dynamic #t2 = 4.0 in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/map_literals.dart:14:46: Error: A value of type 'dart.core::double' can't be assigned to a variable of type 'dart.core::int'.
+ ^" in let final dynamic #t2 = "hi" in null, "w");
+ x.{core::Map::[]=}(let final dynamic #t3 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/map_literals.dart:14:46: Error: A value of type 'dart.core::double' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
/*error:ARGUMENT_TYPE_NOT_ASSIGNABLE*/ 4.0] = 'u';
- ^", "u");
- x.{core::Map::[]=}(3, let final dynamic #t3 = 42 in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/map_literals.dart:15:61: Error: A value of type 'dart.core::int' can't be assigned to a variable of type 'dart.core::String'.
+ ^" in let final dynamic #t4 = 4.0 in null, "u");
+ x.{core::Map::[]=}(3, let final dynamic #t5 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/map_literals.dart:15:61: 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 /*@target=Map::[]=*/ [3] = /*error:INVALID_ASSIGNMENT*/ 42;
- ^");
+ ^" in let final dynamic #t6 = 42 in null);
core::Map<core::num, core::String> y = x;
}
static method test2() → dynamic {
core::Map<core::num, core::Pattern> x = <core::num, core::Pattern>{1: "x", 2: "y", 3.0: core::RegExp::•(".")};
x.{core::Map::[]=}(3, "z");
- x.{core::Map::[]=}(let final dynamic #t4 = "hi" in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/map_literals.dart:27:46: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::num'.
+ x.{core::Map::[]=}(let final dynamic #t7 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/map_literals.dart:27:46: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::num'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::num'.
/*error:ARGUMENT_TYPE_NOT_ASSIGNABLE*/ 'hi'] = 'w';
- ^", "w");
+ ^" in let final dynamic #t8 = "hi" in null, "w");
x.{core::Map::[]=}(4.0, "u");
- x.{core::Map::[]=}(3, let final dynamic #t5 = 42 in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/map_literals.dart:29:61: Error: A value of type 'dart.core::int' can't be assigned to a variable of type 'dart.core::Pattern'.
+ x.{core::Map::[]=}(3, let final dynamic #t9 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/map_literals.dart:29:61: Error: A value of type 'dart.core::int' can't be assigned to a variable of type 'dart.core::Pattern'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::Pattern'.
x /*@target=Map::[]=*/ [3] = /*error:INVALID_ASSIGNMENT*/ 42;
- ^");
+ ^" in let final dynamic #t10 = 42 in null);
core::Pattern p = null;
x.{core::Map::[]=}(2, p);
core::Map<core::int, core::String> y = x as{TypeError} core::Map<core::int, core::String>;
diff --git a/pkg/front_end/testcases/inference/map_literals.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/map_literals.dart.strong.transformed.expect
index cd5924f0..512d00e 100644
--- a/pkg/front_end/testcases/inference/map_literals.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/map_literals.dart.strong.transformed.expect
@@ -5,32 +5,32 @@
static method test1() → dynamic {
core::Map<core::int, core::String> x = <core::int, core::String>{1: "x", 2: "y"};
x.{core::Map::[]=}(3, "z");
- x.{core::Map::[]=}(let final core::String #t1 = "hi" in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/map_literals.dart:12:46: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ x.{core::Map::[]=}(let final dynamic #t1 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/map_literals.dart:12:46: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
/*error:ARGUMENT_TYPE_NOT_ASSIGNABLE*/ 'hi'] = 'w';
- ^", "w");
- x.{core::Map::[]=}(let final core::double #t2 = 4.0 in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/map_literals.dart:14:46: Error: A value of type 'dart.core::double' can't be assigned to a variable of type 'dart.core::int'.
+ ^" in let final core::String #t2 = "hi" in null, "w");
+ x.{core::Map::[]=}(let final dynamic #t3 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/map_literals.dart:14:46: Error: A value of type 'dart.core::double' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
/*error:ARGUMENT_TYPE_NOT_ASSIGNABLE*/ 4.0] = 'u';
- ^", "u");
- x.{core::Map::[]=}(3, let final core::int #t3 = 42 in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/map_literals.dart:15:61: Error: A value of type 'dart.core::int' can't be assigned to a variable of type 'dart.core::String'.
+ ^" in let final core::double #t4 = 4.0 in null, "u");
+ x.{core::Map::[]=}(3, let final dynamic #t5 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/map_literals.dart:15:61: 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 /*@target=Map::[]=*/ [3] = /*error:INVALID_ASSIGNMENT*/ 42;
- ^");
+ ^" in let final core::int #t6 = 42 in null);
core::Map<core::num, core::String> y = x;
}
static method test2() → dynamic {
core::Map<core::num, core::Pattern> x = <core::num, core::Pattern>{1: "x", 2: "y", 3.0: core::RegExp::•(".")};
x.{core::Map::[]=}(3, "z");
- x.{core::Map::[]=}(let final core::String #t4 = "hi" in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/map_literals.dart:27:46: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::num'.
+ x.{core::Map::[]=}(let final dynamic #t7 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/map_literals.dart:27:46: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::num'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::num'.
/*error:ARGUMENT_TYPE_NOT_ASSIGNABLE*/ 'hi'] = 'w';
- ^", "w");
+ ^" in let final core::String #t8 = "hi" in null, "w");
x.{core::Map::[]=}(4.0, "u");
- x.{core::Map::[]=}(3, let final core::int #t5 = 42 in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/map_literals.dart:29:61: Error: A value of type 'dart.core::int' can't be assigned to a variable of type 'dart.core::Pattern'.
+ x.{core::Map::[]=}(3, let final dynamic #t9 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/map_literals.dart:29:61: Error: A value of type 'dart.core::int' can't be assigned to a variable of type 'dart.core::Pattern'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::Pattern'.
x /*@target=Map::[]=*/ [3] = /*error:INVALID_ASSIGNMENT*/ 42;
- ^");
+ ^" in let final core::int #t10 = 42 in null);
core::Pattern p = null;
x.{core::Map::[]=}(2, p);
core::Map<core::int, core::String> y = x as{TypeError} core::Map<core::int, core::String>;
diff --git a/pkg/front_end/testcases/inference/map_literals_top_level.dart.strong.expect b/pkg/front_end/testcases/inference/map_literals_top_level.dart.strong.expect
index 8e54198..c9dd74e 100644
--- a/pkg/front_end/testcases/inference/map_literals_top_level.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/map_literals_top_level.dart.strong.expect
@@ -6,31 +6,31 @@
static field core::Map<core::num, core::Pattern> x2 = <core::num, core::Pattern>{1: "x", 2: "y", 3.0: core::RegExp::•(".")};
static method test1() → dynamic {
self::x1.{core::Map::[]=}(3, "z");
- self::x1.{core::Map::[]=}(let final dynamic #t1 = "hi" in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/map_literals_top_level.dart:14:67: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ self::x1.{core::Map::[]=}(let final dynamic #t1 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/map_literals_top_level.dart:14:67: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
x1 /*@target=Map::[]=*/ [/*error:ARGUMENT_TYPE_NOT_ASSIGNABLE*/ 'hi'] = 'w';
- ^", "w");
- self::x1.{core::Map::[]=}(let final dynamic #t2 = 4.0 in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/map_literals_top_level.dart:15:67: Error: A value of type 'dart.core::double' can't be assigned to a variable of type 'dart.core::int'.
+ ^" in let final dynamic #t2 = "hi" in null, "w");
+ self::x1.{core::Map::[]=}(let final dynamic #t3 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/map_literals_top_level.dart:15:67: Error: A value of type 'dart.core::double' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
x1 /*@target=Map::[]=*/ [/*error:ARGUMENT_TYPE_NOT_ASSIGNABLE*/ 4.0] = 'u';
- ^", "u");
- self::x1.{core::Map::[]=}(3, let final dynamic #t3 = 42 in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/map_literals_top_level.dart:16:62: Error: A value of type 'dart.core::int' can't be assigned to a variable of type 'dart.core::String'.
+ ^" in let final dynamic #t4 = 4.0 in null, "u");
+ self::x1.{core::Map::[]=}(3, let final dynamic #t5 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/map_literals_top_level.dart:16:62: 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'.
x1 /*@target=Map::[]=*/ [3] = /*error:INVALID_ASSIGNMENT*/ 42;
- ^");
+ ^" in let final dynamic #t6 = 42 in null);
core::Map<core::num, core::String> y = self::x1;
}
static method test2() → dynamic {
self::x2.{core::Map::[]=}(3, "z");
- self::x2.{core::Map::[]=}(let final dynamic #t4 = "hi" in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/map_literals_top_level.dart:27:67: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::num'.
+ self::x2.{core::Map::[]=}(let final dynamic #t7 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/map_literals_top_level.dart:27:67: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::num'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::num'.
x2 /*@target=Map::[]=*/ [/*error:ARGUMENT_TYPE_NOT_ASSIGNABLE*/ 'hi'] = 'w';
- ^", "w");
+ ^" in let final dynamic #t8 = "hi" in null, "w");
self::x2.{core::Map::[]=}(4.0, "u");
- self::x2.{core::Map::[]=}(3, let final dynamic #t5 = 42 in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/map_literals_top_level.dart:29:62: Error: A value of type 'dart.core::int' can't be assigned to a variable of type 'dart.core::Pattern'.
+ self::x2.{core::Map::[]=}(3, let final dynamic #t9 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/map_literals_top_level.dart:29:62: Error: A value of type 'dart.core::int' can't be assigned to a variable of type 'dart.core::Pattern'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::Pattern'.
x2 /*@target=Map::[]=*/ [3] = /*error:INVALID_ASSIGNMENT*/ 42;
- ^");
+ ^" in let final dynamic #t10 = 42 in null);
core::Pattern p = null;
self::x2.{core::Map::[]=}(2, p);
core::Map<core::int, core::String> y = self::x2 as{TypeError} core::Map<core::int, core::String>;
diff --git a/pkg/front_end/testcases/inference/map_literals_top_level.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/map_literals_top_level.dart.strong.transformed.expect
index bf1d957..28834d9 100644
--- a/pkg/front_end/testcases/inference/map_literals_top_level.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/map_literals_top_level.dart.strong.transformed.expect
@@ -6,31 +6,31 @@
static field core::Map<core::num, core::Pattern> x2 = <core::num, core::Pattern>{1: "x", 2: "y", 3.0: core::RegExp::•(".")};
static method test1() → dynamic {
self::x1.{core::Map::[]=}(3, "z");
- self::x1.{core::Map::[]=}(let final core::String #t1 = "hi" in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/map_literals_top_level.dart:14:67: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ self::x1.{core::Map::[]=}(let final dynamic #t1 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/map_literals_top_level.dart:14:67: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
x1 /*@target=Map::[]=*/ [/*error:ARGUMENT_TYPE_NOT_ASSIGNABLE*/ 'hi'] = 'w';
- ^", "w");
- self::x1.{core::Map::[]=}(let final core::double #t2 = 4.0 in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/map_literals_top_level.dart:15:67: Error: A value of type 'dart.core::double' can't be assigned to a variable of type 'dart.core::int'.
+ ^" in let final core::String #t2 = "hi" in null, "w");
+ self::x1.{core::Map::[]=}(let final dynamic #t3 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/map_literals_top_level.dart:15:67: Error: A value of type 'dart.core::double' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
x1 /*@target=Map::[]=*/ [/*error:ARGUMENT_TYPE_NOT_ASSIGNABLE*/ 4.0] = 'u';
- ^", "u");
- self::x1.{core::Map::[]=}(3, let final core::int #t3 = 42 in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/map_literals_top_level.dart:16:62: Error: A value of type 'dart.core::int' can't be assigned to a variable of type 'dart.core::String'.
+ ^" in let final core::double #t4 = 4.0 in null, "u");
+ self::x1.{core::Map::[]=}(3, let final dynamic #t5 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/map_literals_top_level.dart:16:62: 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'.
x1 /*@target=Map::[]=*/ [3] = /*error:INVALID_ASSIGNMENT*/ 42;
- ^");
+ ^" in let final core::int #t6 = 42 in null);
core::Map<core::num, core::String> y = self::x1;
}
static method test2() → dynamic {
self::x2.{core::Map::[]=}(3, "z");
- self::x2.{core::Map::[]=}(let final core::String #t4 = "hi" in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/map_literals_top_level.dart:27:67: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::num'.
+ self::x2.{core::Map::[]=}(let final dynamic #t7 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/map_literals_top_level.dart:27:67: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::num'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::num'.
x2 /*@target=Map::[]=*/ [/*error:ARGUMENT_TYPE_NOT_ASSIGNABLE*/ 'hi'] = 'w';
- ^", "w");
+ ^" in let final core::String #t8 = "hi" in null, "w");
self::x2.{core::Map::[]=}(4.0, "u");
- self::x2.{core::Map::[]=}(3, let final core::int #t5 = 42 in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/map_literals_top_level.dart:29:62: Error: A value of type 'dart.core::int' can't be assigned to a variable of type 'dart.core::Pattern'.
+ self::x2.{core::Map::[]=}(3, let final dynamic #t9 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/map_literals_top_level.dart:29:62: Error: A value of type 'dart.core::int' can't be assigned to a variable of type 'dart.core::Pattern'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::Pattern'.
x2 /*@target=Map::[]=*/ [3] = /*error:INVALID_ASSIGNMENT*/ 42;
- ^");
+ ^" in let final core::int #t10 = 42 in null);
core::Pattern p = null;
self::x2.{core::Map::[]=}(2, p);
core::Map<core::int, core::String> y = self::x2 as{TypeError} core::Map<core::int, core::String>;
diff --git a/pkg/front_end/testcases/inference/propagate_inference_transitively.dart.strong.expect b/pkg/front_end/testcases/inference/propagate_inference_transitively.dart.strong.expect
index 89082f3..800802c 100644
--- a/pkg/front_end/testcases/inference/propagate_inference_transitively.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/propagate_inference_transitively.dart.strong.expect
@@ -10,14 +10,14 @@
}
static method test5() → dynamic {
self::A a1 = new self::A::•();
- a1.{self::A::x} = let final dynamic #t1 = "hi" in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/propagate_inference_transitively.dart:14:57: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ a1.{self::A::x} = let final dynamic #t1 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/propagate_inference_transitively.dart:14:57: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
a1. /*@target=A::x*/ x = /*error:INVALID_ASSIGNMENT*/ \"hi\";
- ^";
+ ^" in let final dynamic #t2 = "hi" in null;
self::A a2 = new self::A::•();
- a2.{self::A::x} = let final dynamic #t2 = "hi" in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/propagate_inference_transitively.dart:17:57: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ a2.{self::A::x} = let final dynamic #t3 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/propagate_inference_transitively.dart:17:57: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
a2. /*@target=A::x*/ x = /*error:INVALID_ASSIGNMENT*/ \"hi\";
- ^";
+ ^" in let final dynamic #t4 = "hi" in null;
}
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/propagate_inference_transitively.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/propagate_inference_transitively.dart.strong.transformed.expect
index d0aa09b..4f04d5a 100644
--- a/pkg/front_end/testcases/inference/propagate_inference_transitively.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/propagate_inference_transitively.dart.strong.transformed.expect
@@ -10,14 +10,14 @@
}
static method test5() → dynamic {
self::A a1 = new self::A::•();
- a1.{self::A::x} = let final core::String #t1 = "hi" in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/propagate_inference_transitively.dart:14:57: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ a1.{self::A::x} = let final dynamic #t1 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/propagate_inference_transitively.dart:14:57: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
a1. /*@target=A::x*/ x = /*error:INVALID_ASSIGNMENT*/ \"hi\";
- ^";
+ ^" in let final core::String #t2 = "hi" in null;
self::A a2 = new self::A::•();
- a2.{self::A::x} = let final core::String #t2 = "hi" in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/propagate_inference_transitively.dart:17:57: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ a2.{self::A::x} = let final dynamic #t3 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/propagate_inference_transitively.dart:17:57: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
a2. /*@target=A::x*/ x = /*error:INVALID_ASSIGNMENT*/ \"hi\";
- ^";
+ ^" in let final core::String #t4 = "hi" in null;
}
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference/top_level_return_and_yield.dart.strong.expect b/pkg/front_end/testcases/inference/top_level_return_and_yield.dart.strong.expect
index 6b890da..c0b6fc9 100644
--- a/pkg/front_end/testcases/inference/top_level_return_and_yield.dart.strong.expect
+++ b/pkg/front_end/testcases/inference/top_level_return_and_yield.dart.strong.expect
@@ -8,10 +8,10 @@
return (core::int x) → core::int => x;
}
static method b() → asy::Future<(core::int) → core::int> async {
- return let final dynamic #t1 = (dynamic x) → dynamic => x in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/top_level_return_and_yield.dart:18:34: Error: A value of type '(dynamic) \u8594 dynamic' can't be assigned to a variable of type 'dart.async::FutureOr<(dart.core::int) \u8594 dart.core::int>'.
+ return let final dynamic #t1 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference/top_level_return_and_yield.dart:18:34: Error: A value of type '(dynamic) \u8594 dynamic' can't be assigned to a variable of type 'dart.async::FutureOr<(dart.core::int) \u8594 dart.core::int>'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.async::FutureOr<(dart.core::int) \u8594 dart.core::int>'.
return /*@returnType=dynamic*/ (/*@type=dynamic*/ x) => x;
- ^";
+ ^" in let final dynamic #t2 = (dynamic x) → dynamic => x in null;
}
static method c() → core::Iterable<(core::int) → core::int> sync* {
yield(core::int x) → core::int => x;
diff --git a/pkg/front_end/testcases/inference/top_level_return_and_yield.dart.strong.transformed.expect b/pkg/front_end/testcases/inference/top_level_return_and_yield.dart.strong.transformed.expect
index a683365..02edb72 100644
--- a/pkg/front_end/testcases/inference/top_level_return_and_yield.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference/top_level_return_and_yield.dart.strong.transformed.expect
@@ -19,10 +19,10 @@
try {
#L1:
{
- :return_value = let final (dynamic) → dynamic #t1 = (dynamic x) → dynamic => x in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/top_level_return_and_yield.dart:18:34: Error: A value of type '(dynamic) \u8594 dynamic' can't be assigned to a variable of type 'dart.async::FutureOr<(dart.core::int) \u8594 dart.core::int>'.
+ :return_value = let final dynamic #t1 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference/top_level_return_and_yield.dart:18:34: Error: A value of type '(dynamic) \u8594 dynamic' can't be assigned to a variable of type 'dart.async::FutureOr<(dart.core::int) \u8594 dart.core::int>'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.async::FutureOr<(dart.core::int) \u8594 dart.core::int>'.
return /*@returnType=dynamic*/ (/*@type=dynamic*/ x) => x;
- ^";
+ ^" in let final (dynamic) → dynamic #t2 = (dynamic x) → dynamic => x in null;
break #L1;
}
:completer.{asy::Completer::complete}(:return_value);
diff --git a/pkg/front_end/testcases/inference_new/for_each_invalid_iterable.dart.strong.expect b/pkg/front_end/testcases/inference_new/for_each_invalid_iterable.dart.strong.expect
index 8a74bfc..bb7f27f 100644
--- a/pkg/front_end/testcases/inference_new/for_each_invalid_iterable.dart.strong.expect
+++ b/pkg/front_end/testcases/inference_new/for_each_invalid_iterable.dart.strong.expect
@@ -4,30 +4,30 @@
static method test() → dynamic async {
core::String s;
- for (final dynamic #t1 in let final dynamic #t2 = s in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference_new/for_each_invalid_iterable.dart:10:46: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::Iterable<dynamic>'.
+ for (final dynamic #t1 in let final dynamic #t2 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference_new/for_each_invalid_iterable.dart:10:46: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::Iterable<dynamic>'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::Iterable<dynamic>'.
for (int x in /*@error=InvalidAssignment*/ s) {}
- ^") {
+ ^" in let final dynamic #t3 = s in null) {
core::int x = #t1 as{TypeError} core::int;
}
- await for (final dynamic #t3 in let final dynamic #t4 = s in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference_new/for_each_invalid_iterable.dart:11:52: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.async::Stream<dynamic>'.
+ await for (final dynamic #t4 in let final dynamic #t5 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference_new/for_each_invalid_iterable.dart:11:52: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.async::Stream<dynamic>'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.async::Stream<dynamic>'.
await for (int x in /*@error=InvalidAssignment*/ s) {}
- ^") {
- core::int x = #t3 as{TypeError} core::int;
+ ^" in let final dynamic #t6 = s in null) {
+ core::int x = #t4 as{TypeError} core::int;
}
core::int y;
- for (final dynamic #t5 in let final dynamic #t6 = s in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference_new/for_each_invalid_iterable.dart:13:42: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::Iterable<dynamic>'.
+ for (final dynamic #t7 in let final dynamic #t8 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference_new/for_each_invalid_iterable.dart:13:42: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::Iterable<dynamic>'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::Iterable<dynamic>'.
for (y in /*@error=InvalidAssignment*/ s) {}
- ^") {
- y = #t5 as{TypeError} core::int;
+ ^" in let final dynamic #t9 = s in null) {
+ y = #t7 as{TypeError} core::int;
}
- await for (final dynamic #t7 in let final dynamic #t8 = s in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference_new/for_each_invalid_iterable.dart:14:48: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.async::Stream<dynamic>'.
+ await for (final dynamic #t10 in let final dynamic #t11 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference_new/for_each_invalid_iterable.dart:14:48: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.async::Stream<dynamic>'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.async::Stream<dynamic>'.
await for (y in /*@error=InvalidAssignment*/ s) {}
- ^") {
- y = #t7 as{TypeError} core::int;
+ ^" in let final dynamic #t12 = s in null) {
+ y = #t10 as{TypeError} core::int;
}
}
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference_new/for_each_invalid_iterable.dart.strong.transformed.expect b/pkg/front_end/testcases/inference_new/for_each_invalid_iterable.dart.strong.transformed.expect
index 204c5b3..a61a3ed 100644
--- a/pkg/front_end/testcases/inference_new/for_each_invalid_iterable.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference_new/for_each_invalid_iterable.dart.strong.transformed.expect
@@ -20,25 +20,25 @@
#L1:
{
core::String s;
- for (final dynamic #t1 in let final core::String #t2 = s in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference_new/for_each_invalid_iterable.dart:10:46: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::Iterable<dynamic>'.
+ for (final dynamic #t1 in let final dynamic #t2 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference_new/for_each_invalid_iterable.dart:10:46: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::Iterable<dynamic>'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::Iterable<dynamic>'.
for (int x in /*@error=InvalidAssignment*/ s) {}
- ^") {
+ ^" in let final core::String #t3 = s in null) {
core::int x = #t1 as{TypeError} core::int;
}
{
- asy::_StreamIterator<dynamic> :for-iterator = new asy::_StreamIterator::•<dynamic>(let final core::String #t3 = s in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference_new/for_each_invalid_iterable.dart:11:52: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.async::Stream<dynamic>'.
+ asy::_StreamIterator<dynamic> :for-iterator = new asy::_StreamIterator::•<dynamic>(let final dynamic #t4 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference_new/for_each_invalid_iterable.dart:11:52: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.async::Stream<dynamic>'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.async::Stream<dynamic>'.
await for (int x in /*@error=InvalidAssignment*/ s) {}
- ^");
+ ^" in let final core::String #t5 = s in null);
try
#L2:
while (true) {
- [yield] let dynamic #t4 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::moveNext}(), :async_op_then, :async_op_error, :async_op) in null;
+ [yield] let dynamic #t6 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::moveNext}(), :async_op_then, :async_op_error, :async_op) in null;
if(:result) {
- final dynamic #t5 = :for-iterator.{asy::_StreamIterator::current};
+ final dynamic #t7 = :for-iterator.{asy::_StreamIterator::current};
{
- core::int x = #t5 as{TypeError} core::int;
+ core::int x = #t7 as{TypeError} core::int;
}
}
else
@@ -46,30 +46,30 @@
}
finally
if(!:for-iterator.{asy::_StreamIterator::_subscription}.{core::Object::==}(null)) {
- [yield] let dynamic #t6 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::cancel}(), :async_op_then, :async_op_error, :async_op) in null;
+ [yield] let dynamic #t8 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::cancel}(), :async_op_then, :async_op_error, :async_op) in null;
:result;
}
}
core::int y;
- for (final dynamic #t7 in let final core::String #t8 = s in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference_new/for_each_invalid_iterable.dart:13:42: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::Iterable<dynamic>'.
+ for (final dynamic #t9 in let final dynamic #t10 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference_new/for_each_invalid_iterable.dart:13:42: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::Iterable<dynamic>'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::Iterable<dynamic>'.
for (y in /*@error=InvalidAssignment*/ s) {}
- ^") {
- y = #t7 as{TypeError} core::int;
+ ^" in let final core::String #t11 = s in null) {
+ y = #t9 as{TypeError} core::int;
}
{
- asy::_StreamIterator<dynamic> :for-iterator = new asy::_StreamIterator::•<dynamic>(let final core::String #t9 = s in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference_new/for_each_invalid_iterable.dart:14:48: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.async::Stream<dynamic>'.
+ asy::_StreamIterator<dynamic> :for-iterator = new asy::_StreamIterator::•<dynamic>(let final dynamic #t12 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference_new/for_each_invalid_iterable.dart:14:48: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.async::Stream<dynamic>'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.async::Stream<dynamic>'.
await for (y in /*@error=InvalidAssignment*/ s) {}
- ^");
+ ^" in let final core::String #t13 = s in null);
try
#L3:
while (true) {
- [yield] let dynamic #t10 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::moveNext}(), :async_op_then, :async_op_error, :async_op) in null;
+ [yield] let dynamic #t14 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::moveNext}(), :async_op_then, :async_op_error, :async_op) in null;
if(:result) {
- final dynamic #t11 = :for-iterator.{asy::_StreamIterator::current};
+ final dynamic #t15 = :for-iterator.{asy::_StreamIterator::current};
{
- y = #t11 as{TypeError} core::int;
+ y = #t15 as{TypeError} core::int;
}
}
else
@@ -77,7 +77,7 @@
}
finally
if(!:for-iterator.{asy::_StreamIterator::_subscription}.{core::Object::==}(null)) {
- [yield] let dynamic #t12 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::cancel}(), :async_op_then, :async_op_error, :async_op) in null;
+ [yield] let dynamic #t16 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::cancel}(), :async_op_then, :async_op_error, :async_op) in null;
:result;
}
}
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 665b8a5..60f704bb 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
@@ -34,22 +34,22 @@
b = #t4 as{TypeError} self::B;
}
for (final self::A #t5 in iterable) {
- i = let final dynamic #t6 = #t5 in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference_new/for_each_outer_var_type.dart:26:39: Error: A value of type 'test::A' can't be assigned to a variable of type 'dart.core::int'.
+ i = let final dynamic #t6 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference_new/for_each_outer_var_type.dart:26:39: Error: A value of type 'test::A' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
for (i /*@error=InvalidAssignment*/ in iterable) {}
- ^";
+ ^" in let final dynamic #t7 = #t5 in null;
}
- await for (final self::A #t7 in stream) {
- i = let final dynamic #t8 = #t7 in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference_new/for_each_outer_var_type.dart:27:45: Error: A value of type 'test::A' can't be assigned to a variable of type 'dart.core::int'.
+ await for (final self::A #t8 in stream) {
+ i = let final dynamic #t9 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference_new/for_each_outer_var_type.dart:27:45: Error: A value of type 'test::A' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
await for (i /*@error=InvalidAssignment*/ in stream) {}
- ^";
+ ^" in let final dynamic #t10 = #t8 in null;
}
- for (final self::A #t9 in self::f<core::Iterable<self::A>>()) {
- a = #t9;
+ for (final self::A #t11 in self::f<core::Iterable<self::A>>()) {
+ a = #t11;
}
- await for (final self::A #t10 in self::f<asy::Stream<self::A>>()) {
- a = #t10;
+ await for (final self::A #t12 in self::f<asy::Stream<self::A>>()) {
+ a = #t12;
}
}
static method main() → dynamic {}
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 b5801f0..cd0a0a7 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
@@ -85,24 +85,24 @@
}
}
for (final self::A #t9 in iterable) {
- i = let final self::A #t10 = #t9 in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference_new/for_each_outer_var_type.dart:26:39: Error: A value of type 'test::A' can't be assigned to a variable of type 'dart.core::int'.
+ i = let final dynamic #t10 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference_new/for_each_outer_var_type.dart:26:39: Error: A value of type 'test::A' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
for (i /*@error=InvalidAssignment*/ in iterable) {}
- ^";
+ ^" in let final self::A #t11 = #t9 in null;
}
{
asy::_StreamIterator<self::A> :for-iterator = new asy::_StreamIterator::•<self::A>(stream);
try
#L4:
while (true) {
- [yield] let dynamic #t11 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::moveNext}(), :async_op_then, :async_op_error, :async_op) in null;
+ [yield] let dynamic #t12 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::moveNext}(), :async_op_then, :async_op_error, :async_op) in null;
if(:result) {
- final self::A #t12 = :for-iterator.{asy::_StreamIterator::current};
+ final self::A #t13 = :for-iterator.{asy::_StreamIterator::current};
{
- i = let final self::A #t13 = #t12 in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference_new/for_each_outer_var_type.dart:27:45: Error: A value of type 'test::A' can't be assigned to a variable of type 'dart.core::int'.
+ i = let final dynamic #t14 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference_new/for_each_outer_var_type.dart:27:45: Error: A value of type 'test::A' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
await for (i /*@error=InvalidAssignment*/ in stream) {}
- ^";
+ ^" in let final self::A #t15 = #t13 in null;
}
}
else
@@ -110,23 +110,23 @@
}
finally
if(!:for-iterator.{asy::_StreamIterator::_subscription}.{core::Object::==}(null)) {
- [yield] let dynamic #t14 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::cancel}(), :async_op_then, :async_op_error, :async_op) in null;
+ [yield] let dynamic #t16 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::cancel}(), :async_op_then, :async_op_error, :async_op) in null;
:result;
}
}
- for (final self::A #t15 in self::f<core::Iterable<self::A>>()) {
- a = #t15;
+ for (final self::A #t17 in self::f<core::Iterable<self::A>>()) {
+ a = #t17;
}
{
asy::_StreamIterator<self::A> :for-iterator = new asy::_StreamIterator::•<self::A>(self::f<asy::Stream<self::A>>());
try
#L5:
while (true) {
- [yield] let dynamic #t16 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::moveNext}(), :async_op_then, :async_op_error, :async_op) in null;
+ [yield] let dynamic #t18 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::moveNext}(), :async_op_then, :async_op_error, :async_op) in null;
if(:result) {
- final self::A #t17 = :for-iterator.{asy::_StreamIterator::current};
+ final self::A #t19 = :for-iterator.{asy::_StreamIterator::current};
{
- a = #t17;
+ a = #t19;
}
}
else
@@ -134,7 +134,7 @@
}
finally
if(!:for-iterator.{asy::_StreamIterator::_subscription}.{core::Object::==}(null)) {
- [yield] let dynamic #t18 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::cancel}(), :async_op_then, :async_op_error, :async_op) in null;
+ [yield] let dynamic #t20 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::cancel}(), :async_op_then, :async_op_error, :async_op) in null;
:result;
}
}
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 d51204e..7d69433 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
@@ -59,20 +59,20 @@
core::double v3 = let final core::String #t66 = "x" in let final core::double #t67 = self::getDouble() in let final void #t68 = super.{self::Base::[]=}(#t66, #t67) in #t67;
core::num v5 = let final core::String #t69 = "x" in let final core::int #t70 = super.{self::Base::[]}(#t69) in #t70.{core::num::==}(null) ?{core::num} let final core::num #t71 = self::getNum() as{TypeError} core::double in let final void #t72 = super.{self::Base::[]=}(#t69, #t71) in #t71 : #t70;
core::num v6 = let final core::String #t73 = "x" in let final core::int #t74 = super.{self::Base::[]}(#t73) in #t74.{core::num::==}(null) ?{core::num} let final core::double #t75 = self::getDouble() in let final void #t76 = super.{self::Base::[]=}(#t73, #t75) in #t75 : #t74;
- core::int v7 = let final core::String #t77 = "x" in let final core::int #t78 = let final dynamic #t79 = super.{self::Base::[]}(#t77).{core::num::+}(self::getInt()) in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference_new/infer_assign_to_index_super_upwards.dart:55:62: Error: A value of type 'dart.core::int' can't be assigned to a variable of type 'dart.core::double'.
+ core::int v7 = let final core::String #t77 = "x" in let final core::int #t78 = let final dynamic #t79 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference_new/infer_assign_to_index_super_upwards.dart:55:62: Error: A value of type 'dart.core::int' can't be assigned to a variable of type 'dart.core::double'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::double'.
var /*@type=int*/ v7 = super /*@target=Base::[]=*/ ['x'] += getInt();
- ^" in let final void #t80 = super.{self::Base::[]=}(#t77, #t78) in #t78;
- core::num v8 = let final core::String #t81 = "x" in let final core::num #t82 = super.{self::Base::[]}(#t81).{core::num::+}(self::getNum()) as{TypeError} core::double in let final void #t83 = super.{self::Base::[]=}(#t81, #t82) in #t82;
- core::double v9 = let final core::String #t84 = "x" in let final core::double #t85 = super.{self::Base::[]}(#t84).{core::num::+}(self::getDouble()) in let final void #t86 = super.{self::Base::[]=}(#t84, #t85) in #t85;
- core::int v10 = let final core::String #t87 = "x" in let final core::int #t88 = let final dynamic #t89 = super.{self::Base::[]}(#t87).{core::num::+}(1) in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference_new/infer_assign_to_index_super_upwards.dart:58:29: Error: A value of type 'dart.core::int' can't be assigned to a variable of type 'dart.core::double'.
+ ^" in let final dynamic #t80 = super.{self::Base::[]}(#t77).{core::num::+}(self::getInt()) in null in let final void #t81 = super.{self::Base::[]=}(#t77, #t78) in #t78;
+ core::num v8 = let final core::String #t82 = "x" in let final core::num #t83 = super.{self::Base::[]}(#t82).{core::num::+}(self::getNum()) as{TypeError} core::double in let final void #t84 = super.{self::Base::[]=}(#t82, #t83) in #t83;
+ core::double v9 = let final core::String #t85 = "x" in let final core::double #t86 = super.{self::Base::[]}(#t85).{core::num::+}(self::getDouble()) in let final void #t87 = super.{self::Base::[]=}(#t85, #t86) in #t86;
+ core::int v10 = let final core::String #t88 = "x" in let final core::int #t89 = let final dynamic #t90 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference_new/infer_assign_to_index_super_upwards.dart:58:29: Error: A value of type 'dart.core::int' can't be assigned to a variable of type 'dart.core::double'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::double'.
var /*@type=int*/ v10 = ++super /*@target=Base::[]=*/ ['x'];
- ^" in let final void #t90 = super.{self::Base::[]=}(#t87, #t88) in #t88;
- core::int v11 = let final core::String #t91 = "x" in let final core::int #t92 = super.{self::Base::[]}(#t91) in let final void #t93 = super.{self::Base::[]=}(#t91, let final dynamic #t94 = #t92.{core::num::+}(1) in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference_new/infer_assign_to_index_super_upwards.dart:59:62: Error: A value of type 'dart.core::int' can't be assigned to a variable of type 'dart.core::double'.
+ ^" in let final dynamic #t91 = super.{self::Base::[]}(#t88).{core::num::+}(1) in null in let final void #t92 = super.{self::Base::[]=}(#t88, #t89) in #t89;
+ core::int v11 = let final core::String #t93 = "x" in let final core::int #t94 = super.{self::Base::[]}(#t93) in let final void #t95 = super.{self::Base::[]=}(#t93, let final dynamic #t96 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference_new/infer_assign_to_index_super_upwards.dart:59:62: Error: A value of type 'dart.core::int' can't be assigned to a variable of type 'dart.core::double'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::double'.
var /*@type=int*/ v11 = super /*@target=Base::[]=*/ ['x']++;
- ^") in #t92;
+ ^" in let final dynamic #t97 = #t94.{core::num::+}(1) in null) in #t94;
}
abstract forwarding-stub operator []=(core::String s, generic-covariant-impl core::double v) → void;
abstract forwarding-stub method setValue(core::String s, generic-covariant-impl core::double v) → void;
@@ -82,14 +82,14 @@
: super self::Base::•()
;
method test() → void {
- core::int v1 = let final core::String #t95 = "x" in let final core::int #t96 = self::getInt() in let final void #t97 = super.{self::Base::[]=}(#t95, #t96) in #t96;
- core::num v2 = let final core::String #t98 = "x" in let final core::num #t99 = self::getNum() as{TypeError} core::int in let final void #t100 = super.{self::Base::[]=}(#t98, #t99) in #t99;
- core::num v4 = let final core::String #t101 = "x" in let final core::num #t102 = super.{self::Base::[]}(#t101) in #t102.{core::num::==}(null) ?{core::num} let final core::int #t103 = self::getInt() in let final void #t104 = super.{self::Base::[]=}(#t101, #t103) in #t103 : #t102;
- core::num v5 = let final core::String #t105 = "x" in let final core::num #t106 = super.{self::Base::[]}(#t105) in #t106.{core::num::==}(null) ?{core::num} let final core::num #t107 = self::getNum() as{TypeError} core::int in let final void #t108 = super.{self::Base::[]=}(#t105, #t107) in #t107 : #t106;
- core::num v7 = let final core::String #t109 = "x" in let final core::num #t110 = super.{self::Base::[]}(#t109).{core::num::+}(self::getInt()) as{TypeError} core::int in let final void #t111 = super.{self::Base::[]=}(#t109, #t110) in #t110;
- core::num v8 = let final core::String #t112 = "x" in let final core::num #t113 = super.{self::Base::[]}(#t112).{core::num::+}(self::getNum()) as{TypeError} core::int in let final void #t114 = super.{self::Base::[]=}(#t112, #t113) in #t113;
- core::num v10 = let final core::String #t115 = "x" in let final core::num #t116 = super.{self::Base::[]}(#t115).{core::num::+}(1) as{TypeError} core::int in let final void #t117 = super.{self::Base::[]=}(#t115, #t116) in #t116;
- core::num v11 = let final core::String #t118 = "x" in let final core::num #t119 = super.{self::Base::[]}(#t118) in let final void #t120 = super.{self::Base::[]=}(#t118, #t119.{core::num::+}(1) as{TypeError} core::int) in #t119;
+ core::int v1 = let final core::String #t98 = "x" in let final core::int #t99 = self::getInt() in let final void #t100 = super.{self::Base::[]=}(#t98, #t99) in #t99;
+ core::num v2 = let final core::String #t101 = "x" in let final core::num #t102 = self::getNum() as{TypeError} core::int in let final void #t103 = super.{self::Base::[]=}(#t101, #t102) in #t102;
+ core::num v4 = let final core::String #t104 = "x" in let final core::num #t105 = super.{self::Base::[]}(#t104) in #t105.{core::num::==}(null) ?{core::num} let final core::int #t106 = self::getInt() in let final void #t107 = super.{self::Base::[]=}(#t104, #t106) in #t106 : #t105;
+ core::num v5 = let final core::String #t108 = "x" in let final core::num #t109 = super.{self::Base::[]}(#t108) in #t109.{core::num::==}(null) ?{core::num} let final core::num #t110 = self::getNum() as{TypeError} core::int in let final void #t111 = super.{self::Base::[]=}(#t108, #t110) in #t110 : #t109;
+ core::num v7 = let final core::String #t112 = "x" in let final core::num #t113 = super.{self::Base::[]}(#t112).{core::num::+}(self::getInt()) as{TypeError} core::int in let final void #t114 = super.{self::Base::[]=}(#t112, #t113) in #t113;
+ core::num v8 = let final core::String #t115 = "x" in let final core::num #t116 = super.{self::Base::[]}(#t115).{core::num::+}(self::getNum()) as{TypeError} core::int in let final void #t117 = super.{self::Base::[]=}(#t115, #t116) in #t116;
+ core::num v10 = let final core::String #t118 = "x" in let final core::num #t119 = super.{self::Base::[]}(#t118).{core::num::+}(1) as{TypeError} core::int in let final void #t120 = super.{self::Base::[]=}(#t118, #t119) in #t119;
+ core::num v11 = let final core::String #t121 = "x" in let final core::num #t122 = super.{self::Base::[]}(#t121) in let final void #t123 = super.{self::Base::[]=}(#t121, #t122.{core::num::+}(1) as{TypeError} core::int) in #t122;
}
abstract forwarding-stub operator []=(core::String s, generic-covariant-impl core::int v) → void;
abstract forwarding-stub method setValue(core::String s, generic-covariant-impl core::int v) → void;
@@ -99,17 +99,17 @@
: super self::Base::•()
;
method test() → void {
- core::int v1 = let final core::String #t121 = "x" in let final core::int #t122 = self::getInt() in let final void #t123 = super.{self::Base::[]=}(#t121, #t122) in #t122;
- core::num v2 = let final core::String #t124 = "x" in let final core::num #t125 = self::getNum() in let final void #t126 = super.{self::Base::[]=}(#t124, #t125) in #t125;
- core::double v3 = let final core::String #t127 = "x" in let final core::double #t128 = self::getDouble() in let final void #t129 = super.{self::Base::[]=}(#t127, #t128) in #t128;
- core::num v4 = let final core::String #t130 = "x" in let final core::num #t131 = super.{self::Base::[]}(#t130) in #t131.{core::num::==}(null) ?{core::num} let final core::int #t132 = self::getInt() in let final void #t133 = super.{self::Base::[]=}(#t130, #t132) in #t132 : #t131;
- core::num v5 = let final core::String #t134 = "x" in let final core::num #t135 = super.{self::Base::[]}(#t134) in #t135.{core::num::==}(null) ?{core::num} let final core::num #t136 = self::getNum() in let final void #t137 = super.{self::Base::[]=}(#t134, #t136) in #t136 : #t135;
- core::num v6 = let final core::String #t138 = "x" in let final core::num #t139 = super.{self::Base::[]}(#t138) in #t139.{core::num::==}(null) ?{core::num} let final core::double #t140 = self::getDouble() in let final void #t141 = super.{self::Base::[]=}(#t138, #t140) in #t140 : #t139;
- core::num v7 = let final core::String #t142 = "x" in let final core::num #t143 = super.{self::Base::[]}(#t142).{core::num::+}(self::getInt()) in let final void #t144 = super.{self::Base::[]=}(#t142, #t143) in #t143;
- core::num v8 = let final core::String #t145 = "x" in let final core::num #t146 = super.{self::Base::[]}(#t145).{core::num::+}(self::getNum()) in let final void #t147 = super.{self::Base::[]=}(#t145, #t146) in #t146;
- core::num v9 = let final core::String #t148 = "x" in let final core::num #t149 = super.{self::Base::[]}(#t148).{core::num::+}(self::getDouble()) in let final void #t150 = super.{self::Base::[]=}(#t148, #t149) in #t149;
- core::num v10 = let final core::String #t151 = "x" in let final core::num #t152 = super.{self::Base::[]}(#t151).{core::num::+}(1) in let final void #t153 = super.{self::Base::[]=}(#t151, #t152) in #t152;
- core::num v11 = let final core::String #t154 = "x" in let final core::num #t155 = super.{self::Base::[]}(#t154) in let final void #t156 = super.{self::Base::[]=}(#t154, #t155.{core::num::+}(1)) in #t155;
+ core::int v1 = let final core::String #t124 = "x" in let final core::int #t125 = self::getInt() in let final void #t126 = super.{self::Base::[]=}(#t124, #t125) in #t125;
+ core::num v2 = let final core::String #t127 = "x" in let final core::num #t128 = self::getNum() in let final void #t129 = super.{self::Base::[]=}(#t127, #t128) in #t128;
+ core::double v3 = let final core::String #t130 = "x" in let final core::double #t131 = self::getDouble() in let final void #t132 = super.{self::Base::[]=}(#t130, #t131) in #t131;
+ core::num v4 = let final core::String #t133 = "x" in let final core::num #t134 = super.{self::Base::[]}(#t133) in #t134.{core::num::==}(null) ?{core::num} let final core::int #t135 = self::getInt() in let final void #t136 = super.{self::Base::[]=}(#t133, #t135) in #t135 : #t134;
+ core::num v5 = let final core::String #t137 = "x" in let final core::num #t138 = super.{self::Base::[]}(#t137) in #t138.{core::num::==}(null) ?{core::num} let final core::num #t139 = self::getNum() in let final void #t140 = super.{self::Base::[]=}(#t137, #t139) in #t139 : #t138;
+ core::num v6 = let final core::String #t141 = "x" in let final core::num #t142 = super.{self::Base::[]}(#t141) in #t142.{core::num::==}(null) ?{core::num} let final core::double #t143 = self::getDouble() in let final void #t144 = super.{self::Base::[]=}(#t141, #t143) in #t143 : #t142;
+ core::num v7 = let final core::String #t145 = "x" in let final core::num #t146 = super.{self::Base::[]}(#t145).{core::num::+}(self::getInt()) in let final void #t147 = super.{self::Base::[]=}(#t145, #t146) in #t146;
+ core::num v8 = let final core::String #t148 = "x" in let final core::num #t149 = super.{self::Base::[]}(#t148).{core::num::+}(self::getNum()) in let final void #t150 = super.{self::Base::[]=}(#t148, #t149) in #t149;
+ core::num v9 = let final core::String #t151 = "x" in let final core::num #t152 = super.{self::Base::[]}(#t151).{core::num::+}(self::getDouble()) in let final void #t153 = super.{self::Base::[]=}(#t151, #t152) in #t152;
+ core::num v10 = let final core::String #t154 = "x" in let final core::num #t155 = super.{self::Base::[]}(#t154).{core::num::+}(1) in let final void #t156 = super.{self::Base::[]=}(#t154, #t155) in #t155;
+ core::num v11 = let final core::String #t157 = "x" in let final core::num #t158 = super.{self::Base::[]}(#t157) in let final void #t159 = super.{self::Base::[]=}(#t157, #t158.{core::num::+}(1)) in #t158;
}
abstract forwarding-stub operator []=(core::String s, generic-covariant-impl core::num v) → void;
abstract forwarding-stub method setValue(core::String s, generic-covariant-impl core::num v) → void;
@@ -119,15 +119,15 @@
: super self::Base::•()
;
method test() → void {
- core::num v2 = let final core::String #t157 = "x" in let final core::num #t158 = self::getNum() as{TypeError} core::double in let final void #t159 = super.{self::Base::[]=}(#t157, #t158) in #t158;
- core::double v3 = let final core::String #t160 = "x" in let final core::double #t161 = self::getDouble() in let final void #t162 = super.{self::Base::[]=}(#t160, #t161) in #t161;
- core::num v5 = let final core::String #t163 = "x" in let final core::num #t164 = super.{self::Base::[]}(#t163) in #t164.{core::num::==}(null) ?{core::num} let final core::num #t165 = self::getNum() as{TypeError} core::double in let final void #t166 = super.{self::Base::[]=}(#t163, #t165) in #t165 : #t164;
- core::num v6 = let final core::String #t167 = "x" in let final core::num #t168 = super.{self::Base::[]}(#t167) in #t168.{core::num::==}(null) ?{core::num} let final core::double #t169 = self::getDouble() in let final void #t170 = super.{self::Base::[]=}(#t167, #t169) in #t169 : #t168;
- core::num v7 = let final core::String #t171 = "x" in let final core::num #t172 = super.{self::Base::[]}(#t171).{core::num::+}(self::getInt()) as{TypeError} core::double in let final void #t173 = super.{self::Base::[]=}(#t171, #t172) in #t172;
- core::num v8 = let final core::String #t174 = "x" in let final core::num #t175 = super.{self::Base::[]}(#t174).{core::num::+}(self::getNum()) as{TypeError} core::double in let final void #t176 = super.{self::Base::[]=}(#t174, #t175) in #t175;
- core::num v9 = let final core::String #t177 = "x" in let final core::num #t178 = super.{self::Base::[]}(#t177).{core::num::+}(self::getDouble()) as{TypeError} core::double in let final void #t179 = super.{self::Base::[]=}(#t177, #t178) in #t178;
- core::num v10 = let final core::String #t180 = "x" in let final core::num #t181 = super.{self::Base::[]}(#t180).{core::num::+}(1) as{TypeError} core::double in let final void #t182 = super.{self::Base::[]=}(#t180, #t181) in #t181;
- core::num v11 = let final core::String #t183 = "x" in let final core::num #t184 = super.{self::Base::[]}(#t183) in let final void #t185 = super.{self::Base::[]=}(#t183, #t184.{core::num::+}(1) as{TypeError} core::double) in #t184;
+ core::num v2 = let final core::String #t160 = "x" in let final core::num #t161 = self::getNum() as{TypeError} core::double in let final void #t162 = super.{self::Base::[]=}(#t160, #t161) in #t161;
+ core::double v3 = let final core::String #t163 = "x" in let final core::double #t164 = self::getDouble() in let final void #t165 = super.{self::Base::[]=}(#t163, #t164) in #t164;
+ core::num v5 = let final core::String #t166 = "x" in let final core::num #t167 = super.{self::Base::[]}(#t166) in #t167.{core::num::==}(null) ?{core::num} let final core::num #t168 = self::getNum() as{TypeError} core::double in let final void #t169 = super.{self::Base::[]=}(#t166, #t168) in #t168 : #t167;
+ core::num v6 = let final core::String #t170 = "x" in let final core::num #t171 = super.{self::Base::[]}(#t170) in #t171.{core::num::==}(null) ?{core::num} let final core::double #t172 = self::getDouble() in let final void #t173 = super.{self::Base::[]=}(#t170, #t172) in #t172 : #t171;
+ core::num v7 = let final core::String #t174 = "x" in let final core::num #t175 = super.{self::Base::[]}(#t174).{core::num::+}(self::getInt()) as{TypeError} core::double in let final void #t176 = super.{self::Base::[]=}(#t174, #t175) in #t175;
+ core::num v8 = let final core::String #t177 = "x" in let final core::num #t178 = super.{self::Base::[]}(#t177).{core::num::+}(self::getNum()) as{TypeError} core::double in let final void #t179 = super.{self::Base::[]=}(#t177, #t178) in #t178;
+ core::num v9 = let final core::String #t180 = "x" in let final core::num #t181 = super.{self::Base::[]}(#t180).{core::num::+}(self::getDouble()) as{TypeError} core::double in let final void #t182 = super.{self::Base::[]=}(#t180, #t181) in #t181;
+ core::num v10 = let final core::String #t183 = "x" in let final core::num #t184 = super.{self::Base::[]}(#t183).{core::num::+}(1) as{TypeError} core::double in let final void #t185 = super.{self::Base::[]=}(#t183, #t184) in #t184;
+ core::num v11 = let final core::String #t186 = "x" in let final core::num #t187 = super.{self::Base::[]}(#t186) in let final void #t188 = super.{self::Base::[]=}(#t186, #t187.{core::num::+}(1) as{TypeError} core::double) in #t187;
}
abstract forwarding-stub operator []=(core::String s, generic-covariant-impl core::double v) → void;
abstract forwarding-stub method setValue(core::String s, generic-covariant-impl core::double v) → void;
@@ -137,26 +137,26 @@
: super self::Base::•()
;
method test() → void {
- core::int v1 = let final core::String #t186 = "x" in let final core::int #t187 = self::getInt() in let final void #t188 = super.{self::Base::[]=}(#t186, #t187) in #t187;
- core::num v2 = let final core::String #t189 = "x" in let final core::num #t190 = self::getNum() as{TypeError} core::int in let final void #t191 = super.{self::Base::[]=}(#t189, #t190) in #t190;
- core::num v4 = let final core::String #t192 = "x" in let final core::double #t193 = super.{self::Base::[]}(#t192) in #t193.{core::num::==}(null) ?{core::num} let final core::int #t194 = self::getInt() in let final void #t195 = super.{self::Base::[]=}(#t192, #t194) in #t194 : #t193;
- core::num v5 = let final core::String #t196 = "x" in let final core::double #t197 = super.{self::Base::[]}(#t196) in #t197.{core::num::==}(null) ?{core::num} let final core::num #t198 = self::getNum() as{TypeError} core::int in let final void #t199 = super.{self::Base::[]=}(#t196, #t198) in #t198 : #t197;
- core::double v7 = let final core::String #t200 = "x" in let final core::double #t201 = let final dynamic #t202 = super.{self::Base::[]}(#t200).{core::double::+}(self::getInt()) in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference_new/infer_assign_to_index_super_upwards.dart:112:65: Error: A value of type 'dart.core::double' can't be assigned to a variable of type 'dart.core::int'.
+ core::int v1 = let final core::String #t189 = "x" in let final core::int #t190 = self::getInt() in let final void #t191 = super.{self::Base::[]=}(#t189, #t190) in #t190;
+ core::num v2 = let final core::String #t192 = "x" in let final core::num #t193 = self::getNum() as{TypeError} core::int in let final void #t194 = super.{self::Base::[]=}(#t192, #t193) in #t193;
+ core::num v4 = let final core::String #t195 = "x" in let final core::double #t196 = super.{self::Base::[]}(#t195) in #t196.{core::num::==}(null) ?{core::num} let final core::int #t197 = self::getInt() in let final void #t198 = super.{self::Base::[]=}(#t195, #t197) in #t197 : #t196;
+ core::num v5 = let final core::String #t199 = "x" in let final core::double #t200 = super.{self::Base::[]}(#t199) in #t200.{core::num::==}(null) ?{core::num} let final core::num #t201 = self::getNum() as{TypeError} core::int in let final void #t202 = super.{self::Base::[]=}(#t199, #t201) in #t201 : #t200;
+ core::double v7 = let final core::String #t203 = "x" in let final core::double #t204 = let final dynamic #t205 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference_new/infer_assign_to_index_super_upwards.dart:112:65: Error: A value of type 'dart.core::double' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
var /*@type=double*/ v7 = super /*@target=Base::[]=*/ ['x'] += getInt();
- ^" in let final void #t203 = super.{self::Base::[]=}(#t200, #t201) in #t201;
- core::double v8 = let final core::String #t204 = "x" in let final core::double #t205 = let final dynamic #t206 = super.{self::Base::[]}(#t204).{core::double::+}(self::getNum()) in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference_new/infer_assign_to_index_super_upwards.dart:113:65: Error: A value of type 'dart.core::double' can't be assigned to a variable of type 'dart.core::int'.
+ ^" in let final dynamic #t206 = super.{self::Base::[]}(#t203).{core::double::+}(self::getInt()) in null in let final void #t207 = super.{self::Base::[]=}(#t203, #t204) in #t204;
+ core::double v8 = let final core::String #t208 = "x" in let final core::double #t209 = let final dynamic #t210 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference_new/infer_assign_to_index_super_upwards.dart:113:65: Error: A value of type 'dart.core::double' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
var /*@type=double*/ v8 = super /*@target=Base::[]=*/ ['x'] += getNum();
- ^" in let final void #t207 = super.{self::Base::[]=}(#t204, #t205) in #t205;
- core::double v10 = let final core::String #t208 = "x" in let final core::double #t209 = let final dynamic #t210 = super.{self::Base::[]}(#t208).{core::double::+}(1) in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference_new/infer_assign_to_index_super_upwards.dart:114:32: Error: A value of type 'dart.core::double' can't be assigned to a variable of type 'dart.core::int'.
+ ^" in let final dynamic #t211 = super.{self::Base::[]}(#t208).{core::double::+}(self::getNum()) in null in let final void #t212 = super.{self::Base::[]=}(#t208, #t209) in #t209;
+ core::double v10 = let final core::String #t213 = "x" in let final core::double #t214 = let final dynamic #t215 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference_new/infer_assign_to_index_super_upwards.dart:114:32: Error: A value of type 'dart.core::double' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
var /*@type=double*/ v10 = ++super /*@target=Base::[]=*/ ['x'];
- ^" in let final void #t211 = super.{self::Base::[]=}(#t208, #t209) in #t209;
- core::double v11 = let final core::String #t212 = "x" in let final core::double #t213 = super.{self::Base::[]}(#t212) in let final void #t214 = super.{self::Base::[]=}(#t212, let final dynamic #t215 = #t213.{core::double::+}(1) in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference_new/infer_assign_to_index_super_upwards.dart:115:65: Error: A value of type 'dart.core::double' can't be assigned to a variable of type 'dart.core::int'.
+ ^" in let final dynamic #t216 = super.{self::Base::[]}(#t213).{core::double::+}(1) in null in let final void #t217 = super.{self::Base::[]=}(#t213, #t214) in #t214;
+ core::double v11 = let final core::String #t218 = "x" in let final core::double #t219 = super.{self::Base::[]}(#t218) in let final void #t220 = super.{self::Base::[]=}(#t218, let final dynamic #t221 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference_new/infer_assign_to_index_super_upwards.dart:115:65: Error: A value of type 'dart.core::double' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
var /*@type=double*/ v11 = super /*@target=Base::[]=*/ ['x']++;
- ^") in #t213;
+ ^" in let final dynamic #t222 = #t219.{core::double::+}(1) in null) in #t219;
}
abstract forwarding-stub operator []=(core::String s, generic-covariant-impl core::int v) → void;
abstract forwarding-stub method setValue(core::String s, generic-covariant-impl core::int v) → void;
@@ -166,17 +166,17 @@
: super self::Base::•()
;
method test() → void {
- core::int v1 = let final core::String #t216 = "x" in let final core::int #t217 = self::getInt() in let final void #t218 = super.{self::Base::[]=}(#t216, #t217) in #t217;
- core::num v2 = let final core::String #t219 = "x" in let final core::num #t220 = self::getNum() in let final void #t221 = super.{self::Base::[]=}(#t219, #t220) in #t220;
- core::double v3 = let final core::String #t222 = "x" in let final core::double #t223 = self::getDouble() in let final void #t224 = super.{self::Base::[]=}(#t222, #t223) in #t223;
- core::num v4 = let final core::String #t225 = "x" in let final core::double #t226 = super.{self::Base::[]}(#t225) in #t226.{core::num::==}(null) ?{core::num} let final core::int #t227 = self::getInt() in let final void #t228 = super.{self::Base::[]=}(#t225, #t227) in #t227 : #t226;
- core::num v5 = let final core::String #t229 = "x" in let final core::double #t230 = super.{self::Base::[]}(#t229) in #t230.{core::num::==}(null) ?{core::num} let final core::num #t231 = self::getNum() in let final void #t232 = super.{self::Base::[]=}(#t229, #t231) in #t231 : #t230;
- core::double v6 = let final core::String #t233 = "x" in let final core::double #t234 = super.{self::Base::[]}(#t233) in #t234.{core::num::==}(null) ?{core::double} let final core::double #t235 = self::getDouble() in let final void #t236 = super.{self::Base::[]=}(#t233, #t235) in #t235 : #t234;
- core::double v7 = let final core::String #t237 = "x" in let final core::double #t238 = super.{self::Base::[]}(#t237).{core::double::+}(self::getInt()) in let final void #t239 = super.{self::Base::[]=}(#t237, #t238) in #t238;
- core::double v8 = let final core::String #t240 = "x" in let final core::double #t241 = super.{self::Base::[]}(#t240).{core::double::+}(self::getNum()) in let final void #t242 = super.{self::Base::[]=}(#t240, #t241) in #t241;
- core::double v9 = let final core::String #t243 = "x" in let final core::double #t244 = super.{self::Base::[]}(#t243).{core::double::+}(self::getDouble()) in let final void #t245 = super.{self::Base::[]=}(#t243, #t244) in #t244;
- core::double v10 = let final core::String #t246 = "x" in let final core::double #t247 = super.{self::Base::[]}(#t246).{core::double::+}(1) in let final void #t248 = super.{self::Base::[]=}(#t246, #t247) in #t247;
- core::double v11 = let final core::String #t249 = "x" in let final core::double #t250 = super.{self::Base::[]}(#t249) in let final void #t251 = super.{self::Base::[]=}(#t249, #t250.{core::double::+}(1)) in #t250;
+ core::int v1 = let final core::String #t223 = "x" in let final core::int #t224 = self::getInt() in let final void #t225 = super.{self::Base::[]=}(#t223, #t224) in #t224;
+ core::num v2 = let final core::String #t226 = "x" in let final core::num #t227 = self::getNum() in let final void #t228 = super.{self::Base::[]=}(#t226, #t227) in #t227;
+ core::double v3 = let final core::String #t229 = "x" in let final core::double #t230 = self::getDouble() in let final void #t231 = super.{self::Base::[]=}(#t229, #t230) in #t230;
+ core::num v4 = let final core::String #t232 = "x" in let final core::double #t233 = super.{self::Base::[]}(#t232) in #t233.{core::num::==}(null) ?{core::num} let final core::int #t234 = self::getInt() in let final void #t235 = super.{self::Base::[]=}(#t232, #t234) in #t234 : #t233;
+ core::num v5 = let final core::String #t236 = "x" in let final core::double #t237 = super.{self::Base::[]}(#t236) in #t237.{core::num::==}(null) ?{core::num} let final core::num #t238 = self::getNum() in let final void #t239 = super.{self::Base::[]=}(#t236, #t238) in #t238 : #t237;
+ core::double v6 = let final core::String #t240 = "x" in let final core::double #t241 = super.{self::Base::[]}(#t240) in #t241.{core::num::==}(null) ?{core::double} let final core::double #t242 = self::getDouble() in let final void #t243 = super.{self::Base::[]=}(#t240, #t242) in #t242 : #t241;
+ core::double v7 = let final core::String #t244 = "x" in let final core::double #t245 = super.{self::Base::[]}(#t244).{core::double::+}(self::getInt()) in let final void #t246 = super.{self::Base::[]=}(#t244, #t245) in #t245;
+ core::double v8 = let final core::String #t247 = "x" in let final core::double #t248 = super.{self::Base::[]}(#t247).{core::double::+}(self::getNum()) in let final void #t249 = super.{self::Base::[]=}(#t247, #t248) in #t248;
+ core::double v9 = let final core::String #t250 = "x" in let final core::double #t251 = super.{self::Base::[]}(#t250).{core::double::+}(self::getDouble()) in let final void #t252 = super.{self::Base::[]=}(#t250, #t251) in #t251;
+ core::double v10 = let final core::String #t253 = "x" in let final core::double #t254 = super.{self::Base::[]}(#t253).{core::double::+}(1) in let final void #t255 = super.{self::Base::[]=}(#t253, #t254) in #t254;
+ core::double v11 = let final core::String #t256 = "x" in let final core::double #t257 = super.{self::Base::[]}(#t256) in let final void #t258 = super.{self::Base::[]=}(#t256, #t257.{core::double::+}(1)) in #t257;
}
abstract forwarding-stub operator []=(core::String s, generic-covariant-impl core::num v) → void;
abstract forwarding-stub method setValue(core::String s, generic-covariant-impl core::num v) → void;
@@ -186,15 +186,15 @@
: super self::Base::•()
;
method test() → void {
- core::num v2 = let final core::String #t252 = "x" in let final core::num #t253 = self::getNum() as{TypeError} core::double in let final void #t254 = super.{self::Base::[]=}(#t252, #t253) in #t253;
- core::double v3 = let final core::String #t255 = "x" in let final core::double #t256 = self::getDouble() in let final void #t257 = super.{self::Base::[]=}(#t255, #t256) in #t256;
- core::num v5 = let final core::String #t258 = "x" in let final core::double #t259 = super.{self::Base::[]}(#t258) in #t259.{core::num::==}(null) ?{core::num} let final core::num #t260 = self::getNum() as{TypeError} core::double in let final void #t261 = super.{self::Base::[]=}(#t258, #t260) in #t260 : #t259;
- core::double v6 = let final core::String #t262 = "x" in let final core::double #t263 = super.{self::Base::[]}(#t262) in #t263.{core::num::==}(null) ?{core::double} let final core::double #t264 = self::getDouble() in let final void #t265 = super.{self::Base::[]=}(#t262, #t264) in #t264 : #t263;
- core::double v7 = let final core::String #t266 = "x" in let final core::double #t267 = super.{self::Base::[]}(#t266).{core::double::+}(self::getInt()) in let final void #t268 = super.{self::Base::[]=}(#t266, #t267) in #t267;
- core::double v8 = let final core::String #t269 = "x" in let final core::double #t270 = super.{self::Base::[]}(#t269).{core::double::+}(self::getNum()) in let final void #t271 = super.{self::Base::[]=}(#t269, #t270) in #t270;
- core::double v9 = let final core::String #t272 = "x" in let final core::double #t273 = super.{self::Base::[]}(#t272).{core::double::+}(self::getDouble()) in let final void #t274 = super.{self::Base::[]=}(#t272, #t273) in #t273;
- core::double v10 = let final core::String #t275 = "x" in let final core::double #t276 = super.{self::Base::[]}(#t275).{core::double::+}(1) in let final void #t277 = super.{self::Base::[]=}(#t275, #t276) in #t276;
- core::double v11 = let final core::String #t278 = "x" in let final core::double #t279 = super.{self::Base::[]}(#t278) in let final void #t280 = super.{self::Base::[]=}(#t278, #t279.{core::double::+}(1)) in #t279;
+ core::num v2 = let final core::String #t259 = "x" in let final core::num #t260 = self::getNum() as{TypeError} core::double in let final void #t261 = super.{self::Base::[]=}(#t259, #t260) in #t260;
+ core::double v3 = let final core::String #t262 = "x" in let final core::double #t263 = self::getDouble() in let final void #t264 = super.{self::Base::[]=}(#t262, #t263) in #t263;
+ core::num v5 = let final core::String #t265 = "x" in let final core::double #t266 = super.{self::Base::[]}(#t265) in #t266.{core::num::==}(null) ?{core::num} let final core::num #t267 = self::getNum() as{TypeError} core::double in let final void #t268 = super.{self::Base::[]=}(#t265, #t267) in #t267 : #t266;
+ core::double v6 = let final core::String #t269 = "x" in let final core::double #t270 = super.{self::Base::[]}(#t269) in #t270.{core::num::==}(null) ?{core::double} let final core::double #t271 = self::getDouble() in let final void #t272 = super.{self::Base::[]=}(#t269, #t271) in #t271 : #t270;
+ core::double v7 = let final core::String #t273 = "x" in let final core::double #t274 = super.{self::Base::[]}(#t273).{core::double::+}(self::getInt()) in let final void #t275 = super.{self::Base::[]=}(#t273, #t274) in #t274;
+ core::double v8 = let final core::String #t276 = "x" in let final core::double #t277 = super.{self::Base::[]}(#t276).{core::double::+}(self::getNum()) in let final void #t278 = super.{self::Base::[]=}(#t276, #t277) in #t277;
+ core::double v9 = let final core::String #t279 = "x" in let final core::double #t280 = super.{self::Base::[]}(#t279).{core::double::+}(self::getDouble()) in let final void #t281 = super.{self::Base::[]=}(#t279, #t280) in #t280;
+ core::double v10 = let final core::String #t282 = "x" in let final core::double #t283 = super.{self::Base::[]}(#t282).{core::double::+}(1) in let final void #t284 = super.{self::Base::[]=}(#t282, #t283) in #t283;
+ core::double v11 = let final core::String #t285 = "x" in let final core::double #t286 = super.{self::Base::[]}(#t285) in let final void #t287 = super.{self::Base::[]=}(#t285, #t286.{core::double::+}(1)) in #t286;
}
abstract forwarding-stub operator []=(core::String s, generic-covariant-impl core::double v) → void;
abstract forwarding-stub method setValue(core::String s, generic-covariant-impl core::double v) → void;
diff --git a/pkg/front_end/testcases/inference_new/infer_assign_to_index_this_upwards.dart.strong.expect b/pkg/front_end/testcases/inference_new/infer_assign_to_index_this_upwards.dart.strong.expect
index 1905286..c520d9b 100644
--- a/pkg/front_end/testcases/inference_new/infer_assign_to_index_this_upwards.dart.strong.expect
+++ b/pkg/front_end/testcases/inference_new/infer_assign_to_index_this_upwards.dart.strong.expect
@@ -50,20 +50,20 @@
core::double v3 = let final core::String #t66 = "x" in let final core::double #t67 = self::getDouble() in let final void #t68 = this.{self::Test3::[]=}(#t66, #t67) in #t67;
core::num v5 = let final core::String #t69 = "x" in let final core::int #t70 = this.{self::Test3::[]}(#t69) in #t70.{core::num::==}(null) ?{core::num} let final core::num #t71 = self::getNum() as{TypeError} core::double in let final void #t72 = this.{self::Test3::[]=}(#t69, #t71) in #t71 : #t70;
core::num v6 = let final core::String #t73 = "x" in let final core::int #t74 = this.{self::Test3::[]}(#t73) in #t74.{core::num::==}(null) ?{core::num} let final core::double #t75 = self::getDouble() in let final void #t76 = this.{self::Test3::[]=}(#t73, #t75) in #t75 : #t74;
- core::int v7 = let final core::String #t77 = "x" in let final core::int #t78 = let final dynamic #t79 = this.{self::Test3::[]}(#t77).{core::num::+}(self::getInt()) in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference_new/infer_assign_to_index_this_upwards.dart:56:62: Error: A value of type 'dart.core::int' can't be assigned to a variable of type 'dart.core::double'.
+ core::int v7 = let final core::String #t77 = "x" in let final core::int #t78 = let final dynamic #t79 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference_new/infer_assign_to_index_this_upwards.dart:56:62: Error: A value of type 'dart.core::int' can't be assigned to a variable of type 'dart.core::double'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::double'.
var /*@type=int*/ v7 = this /*@target=Test3::[]=*/ ['x'] += getInt();
- ^" in let final void #t80 = this.{self::Test3::[]=}(#t77, #t78) in #t78;
- core::num v8 = let final core::String #t81 = "x" in let final core::num #t82 = this.{self::Test3::[]}(#t81).{core::num::+}(self::getNum()) as{TypeError} core::double in let final void #t83 = this.{self::Test3::[]=}(#t81, #t82) in #t82;
- core::double v9 = let final core::String #t84 = "x" in let final core::double #t85 = this.{self::Test3::[]}(#t84).{core::num::+}(self::getDouble()) in let final void #t86 = this.{self::Test3::[]=}(#t84, #t85) in #t85;
- core::int v10 = let final core::String #t87 = "x" in let final core::int #t88 = let final dynamic #t89 = this.{self::Test3::[]}(#t87).{core::num::+}(1) in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference_new/infer_assign_to_index_this_upwards.dart:59:29: Error: A value of type 'dart.core::int' can't be assigned to a variable of type 'dart.core::double'.
+ ^" in let final dynamic #t80 = this.{self::Test3::[]}(#t77).{core::num::+}(self::getInt()) in null in let final void #t81 = this.{self::Test3::[]=}(#t77, #t78) in #t78;
+ core::num v8 = let final core::String #t82 = "x" in let final core::num #t83 = this.{self::Test3::[]}(#t82).{core::num::+}(self::getNum()) as{TypeError} core::double in let final void #t84 = this.{self::Test3::[]=}(#t82, #t83) in #t83;
+ core::double v9 = let final core::String #t85 = "x" in let final core::double #t86 = this.{self::Test3::[]}(#t85).{core::num::+}(self::getDouble()) in let final void #t87 = this.{self::Test3::[]=}(#t85, #t86) in #t86;
+ core::int v10 = let final core::String #t88 = "x" in let final core::int #t89 = let final dynamic #t90 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference_new/infer_assign_to_index_this_upwards.dart:59:29: Error: A value of type 'dart.core::int' can't be assigned to a variable of type 'dart.core::double'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::double'.
var /*@type=int*/ v10 = ++this /*@target=Test3::[]=*/ ['x'];
- ^" in let final void #t90 = this.{self::Test3::[]=}(#t87, #t88) in #t88;
- core::int v11 = let final core::String #t91 = "x" in let final core::int #t92 = this.{self::Test3::[]}(#t91) in let final void #t93 = this.{self::Test3::[]=}(#t91, let final dynamic #t94 = #t92.{core::num::+}(1) in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference_new/infer_assign_to_index_this_upwards.dart:60:62: Error: A value of type 'dart.core::int' can't be assigned to a variable of type 'dart.core::double'.
+ ^" in let final dynamic #t91 = this.{self::Test3::[]}(#t88).{core::num::+}(1) in null in let final void #t92 = this.{self::Test3::[]=}(#t88, #t89) in #t89;
+ core::int v11 = let final core::String #t93 = "x" in let final core::int #t94 = this.{self::Test3::[]}(#t93) in let final void #t95 = this.{self::Test3::[]=}(#t93, let final dynamic #t96 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference_new/infer_assign_to_index_this_upwards.dart:60:62: Error: A value of type 'dart.core::int' can't be assigned to a variable of type 'dart.core::double'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::double'.
var /*@type=int*/ v11 = this /*@target=Test3::[]=*/ ['x']++;
- ^") in #t92;
+ ^" in let final dynamic #t97 = #t94.{core::num::+}(1) in null) in #t94;
}
}
abstract class Test4 extends core::Object {
@@ -73,14 +73,14 @@
abstract operator [](core::String s) → core::num;
abstract operator []=(core::String s, core::int v) → void;
method test() → void {
- core::int v1 = let final core::String #t95 = "x" in let final core::int #t96 = self::getInt() in let final void #t97 = this.{self::Test4::[]=}(#t95, #t96) in #t96;
- core::num v2 = let final core::String #t98 = "x" in let final core::num #t99 = self::getNum() as{TypeError} core::int in let final void #t100 = this.{self::Test4::[]=}(#t98, #t99) in #t99;
- core::num v4 = let final core::String #t101 = "x" in let final core::num #t102 = this.{self::Test4::[]}(#t101) in #t102.{core::num::==}(null) ?{core::num} let final core::int #t103 = self::getInt() in let final void #t104 = this.{self::Test4::[]=}(#t101, #t103) in #t103 : #t102;
- core::num v5 = let final core::String #t105 = "x" in let final core::num #t106 = this.{self::Test4::[]}(#t105) in #t106.{core::num::==}(null) ?{core::num} let final core::num #t107 = self::getNum() as{TypeError} core::int in let final void #t108 = this.{self::Test4::[]=}(#t105, #t107) in #t107 : #t106;
- core::num v7 = let final core::String #t109 = "x" in let final core::num #t110 = this.{self::Test4::[]}(#t109).{core::num::+}(self::getInt()) as{TypeError} core::int in let final void #t111 = this.{self::Test4::[]=}(#t109, #t110) in #t110;
- core::num v8 = let final core::String #t112 = "x" in let final core::num #t113 = this.{self::Test4::[]}(#t112).{core::num::+}(self::getNum()) as{TypeError} core::int in let final void #t114 = this.{self::Test4::[]=}(#t112, #t113) in #t113;
- core::num v10 = let final core::String #t115 = "x" in let final core::num #t116 = this.{self::Test4::[]}(#t115).{core::num::+}(1) as{TypeError} core::int in let final void #t117 = this.{self::Test4::[]=}(#t115, #t116) in #t116;
- core::num v11 = let final core::String #t118 = "x" in let final core::num #t119 = this.{self::Test4::[]}(#t118) in let final void #t120 = this.{self::Test4::[]=}(#t118, #t119.{core::num::+}(1) as{TypeError} core::int) in #t119;
+ core::int v1 = let final core::String #t98 = "x" in let final core::int #t99 = self::getInt() in let final void #t100 = this.{self::Test4::[]=}(#t98, #t99) in #t99;
+ core::num v2 = let final core::String #t101 = "x" in let final core::num #t102 = self::getNum() as{TypeError} core::int in let final void #t103 = this.{self::Test4::[]=}(#t101, #t102) in #t102;
+ core::num v4 = let final core::String #t104 = "x" in let final core::num #t105 = this.{self::Test4::[]}(#t104) in #t105.{core::num::==}(null) ?{core::num} let final core::int #t106 = self::getInt() in let final void #t107 = this.{self::Test4::[]=}(#t104, #t106) in #t106 : #t105;
+ core::num v5 = let final core::String #t108 = "x" in let final core::num #t109 = this.{self::Test4::[]}(#t108) in #t109.{core::num::==}(null) ?{core::num} let final core::num #t110 = self::getNum() as{TypeError} core::int in let final void #t111 = this.{self::Test4::[]=}(#t108, #t110) in #t110 : #t109;
+ core::num v7 = let final core::String #t112 = "x" in let final core::num #t113 = this.{self::Test4::[]}(#t112).{core::num::+}(self::getInt()) as{TypeError} core::int in let final void #t114 = this.{self::Test4::[]=}(#t112, #t113) in #t113;
+ core::num v8 = let final core::String #t115 = "x" in let final core::num #t116 = this.{self::Test4::[]}(#t115).{core::num::+}(self::getNum()) as{TypeError} core::int in let final void #t117 = this.{self::Test4::[]=}(#t115, #t116) in #t116;
+ core::num v10 = let final core::String #t118 = "x" in let final core::num #t119 = this.{self::Test4::[]}(#t118).{core::num::+}(1) as{TypeError} core::int in let final void #t120 = this.{self::Test4::[]=}(#t118, #t119) in #t119;
+ core::num v11 = let final core::String #t121 = "x" in let final core::num #t122 = this.{self::Test4::[]}(#t121) in let final void #t123 = this.{self::Test4::[]=}(#t121, #t122.{core::num::+}(1) as{TypeError} core::int) in #t122;
}
}
abstract class Test5 extends core::Object {
@@ -90,17 +90,17 @@
abstract operator [](core::String s) → core::num;
abstract operator []=(core::String s, core::num v) → void;
method test() → void {
- core::int v1 = let final core::String #t121 = "x" in let final core::int #t122 = self::getInt() in let final void #t123 = this.{self::Test5::[]=}(#t121, #t122) in #t122;
- core::num v2 = let final core::String #t124 = "x" in let final core::num #t125 = self::getNum() in let final void #t126 = this.{self::Test5::[]=}(#t124, #t125) in #t125;
- core::double v3 = let final core::String #t127 = "x" in let final core::double #t128 = self::getDouble() in let final void #t129 = this.{self::Test5::[]=}(#t127, #t128) in #t128;
- core::num v4 = let final core::String #t130 = "x" in let final core::num #t131 = this.{self::Test5::[]}(#t130) in #t131.{core::num::==}(null) ?{core::num} let final core::int #t132 = self::getInt() in let final void #t133 = this.{self::Test5::[]=}(#t130, #t132) in #t132 : #t131;
- core::num v5 = let final core::String #t134 = "x" in let final core::num #t135 = this.{self::Test5::[]}(#t134) in #t135.{core::num::==}(null) ?{core::num} let final core::num #t136 = self::getNum() in let final void #t137 = this.{self::Test5::[]=}(#t134, #t136) in #t136 : #t135;
- core::num v6 = let final core::String #t138 = "x" in let final core::num #t139 = this.{self::Test5::[]}(#t138) in #t139.{core::num::==}(null) ?{core::num} let final core::double #t140 = self::getDouble() in let final void #t141 = this.{self::Test5::[]=}(#t138, #t140) in #t140 : #t139;
- core::num v7 = let final core::String #t142 = "x" in let final core::num #t143 = this.{self::Test5::[]}(#t142).{core::num::+}(self::getInt()) in let final void #t144 = this.{self::Test5::[]=}(#t142, #t143) in #t143;
- core::num v8 = let final core::String #t145 = "x" in let final core::num #t146 = this.{self::Test5::[]}(#t145).{core::num::+}(self::getNum()) in let final void #t147 = this.{self::Test5::[]=}(#t145, #t146) in #t146;
- core::num v9 = let final core::String #t148 = "x" in let final core::num #t149 = this.{self::Test5::[]}(#t148).{core::num::+}(self::getDouble()) in let final void #t150 = this.{self::Test5::[]=}(#t148, #t149) in #t149;
- core::num v10 = let final core::String #t151 = "x" in let final core::num #t152 = this.{self::Test5::[]}(#t151).{core::num::+}(1) in let final void #t153 = this.{self::Test5::[]=}(#t151, #t152) in #t152;
- core::num v11 = let final core::String #t154 = "x" in let final core::num #t155 = this.{self::Test5::[]}(#t154) in let final void #t156 = this.{self::Test5::[]=}(#t154, #t155.{core::num::+}(1)) in #t155;
+ core::int v1 = let final core::String #t124 = "x" in let final core::int #t125 = self::getInt() in let final void #t126 = this.{self::Test5::[]=}(#t124, #t125) in #t125;
+ core::num v2 = let final core::String #t127 = "x" in let final core::num #t128 = self::getNum() in let final void #t129 = this.{self::Test5::[]=}(#t127, #t128) in #t128;
+ core::double v3 = let final core::String #t130 = "x" in let final core::double #t131 = self::getDouble() in let final void #t132 = this.{self::Test5::[]=}(#t130, #t131) in #t131;
+ core::num v4 = let final core::String #t133 = "x" in let final core::num #t134 = this.{self::Test5::[]}(#t133) in #t134.{core::num::==}(null) ?{core::num} let final core::int #t135 = self::getInt() in let final void #t136 = this.{self::Test5::[]=}(#t133, #t135) in #t135 : #t134;
+ core::num v5 = let final core::String #t137 = "x" in let final core::num #t138 = this.{self::Test5::[]}(#t137) in #t138.{core::num::==}(null) ?{core::num} let final core::num #t139 = self::getNum() in let final void #t140 = this.{self::Test5::[]=}(#t137, #t139) in #t139 : #t138;
+ core::num v6 = let final core::String #t141 = "x" in let final core::num #t142 = this.{self::Test5::[]}(#t141) in #t142.{core::num::==}(null) ?{core::num} let final core::double #t143 = self::getDouble() in let final void #t144 = this.{self::Test5::[]=}(#t141, #t143) in #t143 : #t142;
+ core::num v7 = let final core::String #t145 = "x" in let final core::num #t146 = this.{self::Test5::[]}(#t145).{core::num::+}(self::getInt()) in let final void #t147 = this.{self::Test5::[]=}(#t145, #t146) in #t146;
+ core::num v8 = let final core::String #t148 = "x" in let final core::num #t149 = this.{self::Test5::[]}(#t148).{core::num::+}(self::getNum()) in let final void #t150 = this.{self::Test5::[]=}(#t148, #t149) in #t149;
+ core::num v9 = let final core::String #t151 = "x" in let final core::num #t152 = this.{self::Test5::[]}(#t151).{core::num::+}(self::getDouble()) in let final void #t153 = this.{self::Test5::[]=}(#t151, #t152) in #t152;
+ core::num v10 = let final core::String #t154 = "x" in let final core::num #t155 = this.{self::Test5::[]}(#t154).{core::num::+}(1) in let final void #t156 = this.{self::Test5::[]=}(#t154, #t155) in #t155;
+ core::num v11 = let final core::String #t157 = "x" in let final core::num #t158 = this.{self::Test5::[]}(#t157) in let final void #t159 = this.{self::Test5::[]=}(#t157, #t158.{core::num::+}(1)) in #t158;
}
}
abstract class Test6 extends core::Object {
@@ -110,15 +110,15 @@
abstract operator [](core::String s) → core::num;
abstract operator []=(core::String s, core::double v) → void;
method test() → void {
- core::num v2 = let final core::String #t157 = "x" in let final core::num #t158 = self::getNum() as{TypeError} core::double in let final void #t159 = this.{self::Test6::[]=}(#t157, #t158) in #t158;
- core::double v3 = let final core::String #t160 = "x" in let final core::double #t161 = self::getDouble() in let final void #t162 = this.{self::Test6::[]=}(#t160, #t161) in #t161;
- core::num v5 = let final core::String #t163 = "x" in let final core::num #t164 = this.{self::Test6::[]}(#t163) in #t164.{core::num::==}(null) ?{core::num} let final core::num #t165 = self::getNum() as{TypeError} core::double in let final void #t166 = this.{self::Test6::[]=}(#t163, #t165) in #t165 : #t164;
- core::num v6 = let final core::String #t167 = "x" in let final core::num #t168 = this.{self::Test6::[]}(#t167) in #t168.{core::num::==}(null) ?{core::num} let final core::double #t169 = self::getDouble() in let final void #t170 = this.{self::Test6::[]=}(#t167, #t169) in #t169 : #t168;
- core::num v7 = let final core::String #t171 = "x" in let final core::num #t172 = this.{self::Test6::[]}(#t171).{core::num::+}(self::getInt()) as{TypeError} core::double in let final void #t173 = this.{self::Test6::[]=}(#t171, #t172) in #t172;
- core::num v8 = let final core::String #t174 = "x" in let final core::num #t175 = this.{self::Test6::[]}(#t174).{core::num::+}(self::getNum()) as{TypeError} core::double in let final void #t176 = this.{self::Test6::[]=}(#t174, #t175) in #t175;
- core::num v9 = let final core::String #t177 = "x" in let final core::num #t178 = this.{self::Test6::[]}(#t177).{core::num::+}(self::getDouble()) as{TypeError} core::double in let final void #t179 = this.{self::Test6::[]=}(#t177, #t178) in #t178;
- core::num v10 = let final core::String #t180 = "x" in let final core::num #t181 = this.{self::Test6::[]}(#t180).{core::num::+}(1) as{TypeError} core::double in let final void #t182 = this.{self::Test6::[]=}(#t180, #t181) in #t181;
- core::num v11 = let final core::String #t183 = "x" in let final core::num #t184 = this.{self::Test6::[]}(#t183) in let final void #t185 = this.{self::Test6::[]=}(#t183, #t184.{core::num::+}(1) as{TypeError} core::double) in #t184;
+ core::num v2 = let final core::String #t160 = "x" in let final core::num #t161 = self::getNum() as{TypeError} core::double in let final void #t162 = this.{self::Test6::[]=}(#t160, #t161) in #t161;
+ core::double v3 = let final core::String #t163 = "x" in let final core::double #t164 = self::getDouble() in let final void #t165 = this.{self::Test6::[]=}(#t163, #t164) in #t164;
+ core::num v5 = let final core::String #t166 = "x" in let final core::num #t167 = this.{self::Test6::[]}(#t166) in #t167.{core::num::==}(null) ?{core::num} let final core::num #t168 = self::getNum() as{TypeError} core::double in let final void #t169 = this.{self::Test6::[]=}(#t166, #t168) in #t168 : #t167;
+ core::num v6 = let final core::String #t170 = "x" in let final core::num #t171 = this.{self::Test6::[]}(#t170) in #t171.{core::num::==}(null) ?{core::num} let final core::double #t172 = self::getDouble() in let final void #t173 = this.{self::Test6::[]=}(#t170, #t172) in #t172 : #t171;
+ core::num v7 = let final core::String #t174 = "x" in let final core::num #t175 = this.{self::Test6::[]}(#t174).{core::num::+}(self::getInt()) as{TypeError} core::double in let final void #t176 = this.{self::Test6::[]=}(#t174, #t175) in #t175;
+ core::num v8 = let final core::String #t177 = "x" in let final core::num #t178 = this.{self::Test6::[]}(#t177).{core::num::+}(self::getNum()) as{TypeError} core::double in let final void #t179 = this.{self::Test6::[]=}(#t177, #t178) in #t178;
+ core::num v9 = let final core::String #t180 = "x" in let final core::num #t181 = this.{self::Test6::[]}(#t180).{core::num::+}(self::getDouble()) as{TypeError} core::double in let final void #t182 = this.{self::Test6::[]=}(#t180, #t181) in #t181;
+ core::num v10 = let final core::String #t183 = "x" in let final core::num #t184 = this.{self::Test6::[]}(#t183).{core::num::+}(1) as{TypeError} core::double in let final void #t185 = this.{self::Test6::[]=}(#t183, #t184) in #t184;
+ core::num v11 = let final core::String #t186 = "x" in let final core::num #t187 = this.{self::Test6::[]}(#t186) in let final void #t188 = this.{self::Test6::[]=}(#t186, #t187.{core::num::+}(1) as{TypeError} core::double) in #t187;
}
}
abstract class Test7 extends core::Object {
@@ -128,26 +128,26 @@
abstract operator [](core::String s) → core::double;
abstract operator []=(core::String s, core::int v) → void;
method test() → void {
- core::int v1 = let final core::String #t186 = "x" in let final core::int #t187 = self::getInt() in let final void #t188 = this.{self::Test7::[]=}(#t186, #t187) in #t187;
- core::num v2 = let final core::String #t189 = "x" in let final core::num #t190 = self::getNum() as{TypeError} core::int in let final void #t191 = this.{self::Test7::[]=}(#t189, #t190) in #t190;
- core::num v4 = let final core::String #t192 = "x" in let final core::double #t193 = this.{self::Test7::[]}(#t192) in #t193.{core::num::==}(null) ?{core::num} let final core::int #t194 = self::getInt() in let final void #t195 = this.{self::Test7::[]=}(#t192, #t194) in #t194 : #t193;
- core::num v5 = let final core::String #t196 = "x" in let final core::double #t197 = this.{self::Test7::[]}(#t196) in #t197.{core::num::==}(null) ?{core::num} let final core::num #t198 = self::getNum() as{TypeError} core::int in let final void #t199 = this.{self::Test7::[]=}(#t196, #t198) in #t198 : #t197;
- core::double v7 = let final core::String #t200 = "x" in let final core::double #t201 = let final dynamic #t202 = this.{self::Test7::[]}(#t200).{core::double::+}(self::getInt()) in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference_new/infer_assign_to_index_this_upwards.dart:125:65: Error: A value of type 'dart.core::double' can't be assigned to a variable of type 'dart.core::int'.
+ core::int v1 = let final core::String #t189 = "x" in let final core::int #t190 = self::getInt() in let final void #t191 = this.{self::Test7::[]=}(#t189, #t190) in #t190;
+ core::num v2 = let final core::String #t192 = "x" in let final core::num #t193 = self::getNum() as{TypeError} core::int in let final void #t194 = this.{self::Test7::[]=}(#t192, #t193) in #t193;
+ core::num v4 = let final core::String #t195 = "x" in let final core::double #t196 = this.{self::Test7::[]}(#t195) in #t196.{core::num::==}(null) ?{core::num} let final core::int #t197 = self::getInt() in let final void #t198 = this.{self::Test7::[]=}(#t195, #t197) in #t197 : #t196;
+ core::num v5 = let final core::String #t199 = "x" in let final core::double #t200 = this.{self::Test7::[]}(#t199) in #t200.{core::num::==}(null) ?{core::num} let final core::num #t201 = self::getNum() as{TypeError} core::int in let final void #t202 = this.{self::Test7::[]=}(#t199, #t201) in #t201 : #t200;
+ core::double v7 = let final core::String #t203 = "x" in let final core::double #t204 = let final dynamic #t205 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference_new/infer_assign_to_index_this_upwards.dart:125:65: Error: A value of type 'dart.core::double' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
var /*@type=double*/ v7 = this /*@target=Test7::[]=*/ ['x'] += getInt();
- ^" in let final void #t203 = this.{self::Test7::[]=}(#t200, #t201) in #t201;
- core::double v8 = let final core::String #t204 = "x" in let final core::double #t205 = let final dynamic #t206 = this.{self::Test7::[]}(#t204).{core::double::+}(self::getNum()) in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference_new/infer_assign_to_index_this_upwards.dart:126:65: Error: A value of type 'dart.core::double' can't be assigned to a variable of type 'dart.core::int'.
+ ^" in let final dynamic #t206 = this.{self::Test7::[]}(#t203).{core::double::+}(self::getInt()) in null in let final void #t207 = this.{self::Test7::[]=}(#t203, #t204) in #t204;
+ core::double v8 = let final core::String #t208 = "x" in let final core::double #t209 = let final dynamic #t210 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference_new/infer_assign_to_index_this_upwards.dart:126:65: Error: A value of type 'dart.core::double' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
var /*@type=double*/ v8 = this /*@target=Test7::[]=*/ ['x'] += getNum();
- ^" in let final void #t207 = this.{self::Test7::[]=}(#t204, #t205) in #t205;
- core::double v10 = let final core::String #t208 = "x" in let final core::double #t209 = let final dynamic #t210 = this.{self::Test7::[]}(#t208).{core::double::+}(1) in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference_new/infer_assign_to_index_this_upwards.dart:127:32: Error: A value of type 'dart.core::double' can't be assigned to a variable of type 'dart.core::int'.
+ ^" in let final dynamic #t211 = this.{self::Test7::[]}(#t208).{core::double::+}(self::getNum()) in null in let final void #t212 = this.{self::Test7::[]=}(#t208, #t209) in #t209;
+ core::double v10 = let final core::String #t213 = "x" in let final core::double #t214 = let final dynamic #t215 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference_new/infer_assign_to_index_this_upwards.dart:127:32: Error: A value of type 'dart.core::double' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
var /*@type=double*/ v10 = ++this /*@target=Test7::[]=*/ ['x'];
- ^" in let final void #t211 = this.{self::Test7::[]=}(#t208, #t209) in #t209;
- core::double v11 = let final core::String #t212 = "x" in let final core::double #t213 = this.{self::Test7::[]}(#t212) in let final void #t214 = this.{self::Test7::[]=}(#t212, let final dynamic #t215 = #t213.{core::double::+}(1) in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference_new/infer_assign_to_index_this_upwards.dart:128:65: Error: A value of type 'dart.core::double' can't be assigned to a variable of type 'dart.core::int'.
+ ^" in let final dynamic #t216 = this.{self::Test7::[]}(#t213).{core::double::+}(1) in null in let final void #t217 = this.{self::Test7::[]=}(#t213, #t214) in #t214;
+ core::double v11 = let final core::String #t218 = "x" in let final core::double #t219 = this.{self::Test7::[]}(#t218) in let final void #t220 = this.{self::Test7::[]=}(#t218, let final dynamic #t221 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference_new/infer_assign_to_index_this_upwards.dart:128:65: Error: A value of type 'dart.core::double' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
var /*@type=double*/ v11 = this /*@target=Test7::[]=*/ ['x']++;
- ^") in #t213;
+ ^" in let final dynamic #t222 = #t219.{core::double::+}(1) in null) in #t219;
}
}
abstract class Test8 extends core::Object {
@@ -157,17 +157,17 @@
abstract operator [](core::String s) → core::double;
abstract operator []=(core::String s, core::num v) → void;
method test() → void {
- core::int v1 = let final core::String #t216 = "x" in let final core::int #t217 = self::getInt() in let final void #t218 = this.{self::Test8::[]=}(#t216, #t217) in #t217;
- core::num v2 = let final core::String #t219 = "x" in let final core::num #t220 = self::getNum() in let final void #t221 = this.{self::Test8::[]=}(#t219, #t220) in #t220;
- core::double v3 = let final core::String #t222 = "x" in let final core::double #t223 = self::getDouble() in let final void #t224 = this.{self::Test8::[]=}(#t222, #t223) in #t223;
- core::num v4 = let final core::String #t225 = "x" in let final core::double #t226 = this.{self::Test8::[]}(#t225) in #t226.{core::num::==}(null) ?{core::num} let final core::int #t227 = self::getInt() in let final void #t228 = this.{self::Test8::[]=}(#t225, #t227) in #t227 : #t226;
- core::num v5 = let final core::String #t229 = "x" in let final core::double #t230 = this.{self::Test8::[]}(#t229) in #t230.{core::num::==}(null) ?{core::num} let final core::num #t231 = self::getNum() in let final void #t232 = this.{self::Test8::[]=}(#t229, #t231) in #t231 : #t230;
- core::double v6 = let final core::String #t233 = "x" in let final core::double #t234 = this.{self::Test8::[]}(#t233) in #t234.{core::num::==}(null) ?{core::double} let final core::double #t235 = self::getDouble() in let final void #t236 = this.{self::Test8::[]=}(#t233, #t235) in #t235 : #t234;
- core::double v7 = let final core::String #t237 = "x" in let final core::double #t238 = this.{self::Test8::[]}(#t237).{core::double::+}(self::getInt()) in let final void #t239 = this.{self::Test8::[]=}(#t237, #t238) in #t238;
- core::double v8 = let final core::String #t240 = "x" in let final core::double #t241 = this.{self::Test8::[]}(#t240).{core::double::+}(self::getNum()) in let final void #t242 = this.{self::Test8::[]=}(#t240, #t241) in #t241;
- core::double v9 = let final core::String #t243 = "x" in let final core::double #t244 = this.{self::Test8::[]}(#t243).{core::double::+}(self::getDouble()) in let final void #t245 = this.{self::Test8::[]=}(#t243, #t244) in #t244;
- core::double v10 = let final core::String #t246 = "x" in let final core::double #t247 = this.{self::Test8::[]}(#t246).{core::double::+}(1) in let final void #t248 = this.{self::Test8::[]=}(#t246, #t247) in #t247;
- core::double v11 = let final core::String #t249 = "x" in let final core::double #t250 = this.{self::Test8::[]}(#t249) in let final void #t251 = this.{self::Test8::[]=}(#t249, #t250.{core::double::+}(1)) in #t250;
+ core::int v1 = let final core::String #t223 = "x" in let final core::int #t224 = self::getInt() in let final void #t225 = this.{self::Test8::[]=}(#t223, #t224) in #t224;
+ core::num v2 = let final core::String #t226 = "x" in let final core::num #t227 = self::getNum() in let final void #t228 = this.{self::Test8::[]=}(#t226, #t227) in #t227;
+ core::double v3 = let final core::String #t229 = "x" in let final core::double #t230 = self::getDouble() in let final void #t231 = this.{self::Test8::[]=}(#t229, #t230) in #t230;
+ core::num v4 = let final core::String #t232 = "x" in let final core::double #t233 = this.{self::Test8::[]}(#t232) in #t233.{core::num::==}(null) ?{core::num} let final core::int #t234 = self::getInt() in let final void #t235 = this.{self::Test8::[]=}(#t232, #t234) in #t234 : #t233;
+ core::num v5 = let final core::String #t236 = "x" in let final core::double #t237 = this.{self::Test8::[]}(#t236) in #t237.{core::num::==}(null) ?{core::num} let final core::num #t238 = self::getNum() in let final void #t239 = this.{self::Test8::[]=}(#t236, #t238) in #t238 : #t237;
+ core::double v6 = let final core::String #t240 = "x" in let final core::double #t241 = this.{self::Test8::[]}(#t240) in #t241.{core::num::==}(null) ?{core::double} let final core::double #t242 = self::getDouble() in let final void #t243 = this.{self::Test8::[]=}(#t240, #t242) in #t242 : #t241;
+ core::double v7 = let final core::String #t244 = "x" in let final core::double #t245 = this.{self::Test8::[]}(#t244).{core::double::+}(self::getInt()) in let final void #t246 = this.{self::Test8::[]=}(#t244, #t245) in #t245;
+ core::double v8 = let final core::String #t247 = "x" in let final core::double #t248 = this.{self::Test8::[]}(#t247).{core::double::+}(self::getNum()) in let final void #t249 = this.{self::Test8::[]=}(#t247, #t248) in #t248;
+ core::double v9 = let final core::String #t250 = "x" in let final core::double #t251 = this.{self::Test8::[]}(#t250).{core::double::+}(self::getDouble()) in let final void #t252 = this.{self::Test8::[]=}(#t250, #t251) in #t251;
+ core::double v10 = let final core::String #t253 = "x" in let final core::double #t254 = this.{self::Test8::[]}(#t253).{core::double::+}(1) in let final void #t255 = this.{self::Test8::[]=}(#t253, #t254) in #t254;
+ core::double v11 = let final core::String #t256 = "x" in let final core::double #t257 = this.{self::Test8::[]}(#t256) in let final void #t258 = this.{self::Test8::[]=}(#t256, #t257.{core::double::+}(1)) in #t257;
}
}
abstract class Test9 extends core::Object {
@@ -177,15 +177,15 @@
abstract operator [](core::String s) → core::double;
abstract operator []=(core::String s, core::double v) → void;
method test() → void {
- core::num v2 = let final core::String #t252 = "x" in let final core::num #t253 = self::getNum() as{TypeError} core::double in let final void #t254 = this.{self::Test9::[]=}(#t252, #t253) in #t253;
- core::double v3 = let final core::String #t255 = "x" in let final core::double #t256 = self::getDouble() in let final void #t257 = this.{self::Test9::[]=}(#t255, #t256) in #t256;
- core::num v5 = let final core::String #t258 = "x" in let final core::double #t259 = this.{self::Test9::[]}(#t258) in #t259.{core::num::==}(null) ?{core::num} let final core::num #t260 = self::getNum() as{TypeError} core::double in let final void #t261 = this.{self::Test9::[]=}(#t258, #t260) in #t260 : #t259;
- core::double v6 = let final core::String #t262 = "x" in let final core::double #t263 = this.{self::Test9::[]}(#t262) in #t263.{core::num::==}(null) ?{core::double} let final core::double #t264 = self::getDouble() in let final void #t265 = this.{self::Test9::[]=}(#t262, #t264) in #t264 : #t263;
- core::double v7 = let final core::String #t266 = "x" in let final core::double #t267 = this.{self::Test9::[]}(#t266).{core::double::+}(self::getInt()) in let final void #t268 = this.{self::Test9::[]=}(#t266, #t267) in #t267;
- core::double v8 = let final core::String #t269 = "x" in let final core::double #t270 = this.{self::Test9::[]}(#t269).{core::double::+}(self::getNum()) in let final void #t271 = this.{self::Test9::[]=}(#t269, #t270) in #t270;
- core::double v9 = let final core::String #t272 = "x" in let final core::double #t273 = this.{self::Test9::[]}(#t272).{core::double::+}(self::getDouble()) in let final void #t274 = this.{self::Test9::[]=}(#t272, #t273) in #t273;
- core::double v10 = let final core::String #t275 = "x" in let final core::double #t276 = this.{self::Test9::[]}(#t275).{core::double::+}(1) in let final void #t277 = this.{self::Test9::[]=}(#t275, #t276) in #t276;
- core::double v11 = let final core::String #t278 = "x" in let final core::double #t279 = this.{self::Test9::[]}(#t278) in let final void #t280 = this.{self::Test9::[]=}(#t278, #t279.{core::double::+}(1)) in #t279;
+ core::num v2 = let final core::String #t259 = "x" in let final core::num #t260 = self::getNum() as{TypeError} core::double in let final void #t261 = this.{self::Test9::[]=}(#t259, #t260) in #t260;
+ core::double v3 = let final core::String #t262 = "x" in let final core::double #t263 = self::getDouble() in let final void #t264 = this.{self::Test9::[]=}(#t262, #t263) in #t263;
+ core::num v5 = let final core::String #t265 = "x" in let final core::double #t266 = this.{self::Test9::[]}(#t265) in #t266.{core::num::==}(null) ?{core::num} let final core::num #t267 = self::getNum() as{TypeError} core::double in let final void #t268 = this.{self::Test9::[]=}(#t265, #t267) in #t267 : #t266;
+ core::double v6 = let final core::String #t269 = "x" in let final core::double #t270 = this.{self::Test9::[]}(#t269) in #t270.{core::num::==}(null) ?{core::double} let final core::double #t271 = self::getDouble() in let final void #t272 = this.{self::Test9::[]=}(#t269, #t271) in #t271 : #t270;
+ core::double v7 = let final core::String #t273 = "x" in let final core::double #t274 = this.{self::Test9::[]}(#t273).{core::double::+}(self::getInt()) in let final void #t275 = this.{self::Test9::[]=}(#t273, #t274) in #t274;
+ core::double v8 = let final core::String #t276 = "x" in let final core::double #t277 = this.{self::Test9::[]}(#t276).{core::double::+}(self::getNum()) in let final void #t278 = this.{self::Test9::[]=}(#t276, #t277) in #t277;
+ core::double v9 = let final core::String #t279 = "x" in let final core::double #t280 = this.{self::Test9::[]}(#t279).{core::double::+}(self::getDouble()) in let final void #t281 = this.{self::Test9::[]=}(#t279, #t280) in #t280;
+ core::double v10 = let final core::String #t282 = "x" in let final core::double #t283 = this.{self::Test9::[]}(#t282).{core::double::+}(1) in let final void #t284 = this.{self::Test9::[]=}(#t282, #t283) in #t283;
+ core::double v11 = let final core::String #t285 = "x" in let final core::double #t286 = this.{self::Test9::[]}(#t285) in let final void #t287 = this.{self::Test9::[]=}(#t285, #t286.{core::double::+}(1)) in #t286;
}
}
static method getInt() → core::int
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 7be767f..8a8c568 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
@@ -43,99 +43,99 @@
core::double v3 = let final self::Test<core::int, core::double> #t86 = t in let final core::String #t87 = "x" in let final core::double #t88 = self::getDouble() in let final void #t89 = #t86.{self::Test::[]=}(#t87, #t88) in #t88;
core::num v5 = let final self::Test<core::int, core::double> #t90 = t in let final core::String #t91 = "x" in let final core::int #t92 = #t90.{self::Test::[]}(#t91) in #t92.{core::num::==}(null) ?{core::num} let final core::num #t93 = self::getNum() as{TypeError} core::double in let final void #t94 = #t90.{self::Test::[]=}(#t91, #t93) in #t93 : #t92;
core::num v6 = let final self::Test<core::int, core::double> #t95 = t in let final core::String #t96 = "x" in let final core::int #t97 = #t95.{self::Test::[]}(#t96) in #t97.{core::num::==}(null) ?{core::num} let final core::double #t98 = self::getDouble() in let final void #t99 = #t95.{self::Test::[]=}(#t96, #t98) in #t98 : #t97;
- core::int v7 = let final self::Test<core::int, core::double> #t100 = t in let final core::String #t101 = "x" in let final core::int #t102 = let final dynamic #t103 = #t100.{self::Test::[]}(#t101).{core::num::+}(self::getInt()) in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference_new/infer_assign_to_index_upwards.dart:47:56: Error: A value of type 'dart.core::int' can't be assigned to a variable of type 'dart.core::double'.
+ core::int v7 = let final self::Test<core::int, core::double> #t100 = t in let final core::String #t101 = "x" in let final core::int #t102 = let final dynamic #t103 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference_new/infer_assign_to_index_upwards.dart:47:56: Error: A value of type 'dart.core::int' can't be assigned to a variable of type 'dart.core::double'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::double'.
var /*@type=int*/ v7 = t /*@target=Test::[]=*/ ['x'] += getInt();
- ^" in let final void #t104 = #t100.{self::Test::[]=}(#t101, #t102) in #t102;
- core::num v8 = let final self::Test<core::int, core::double> #t105 = t in let final core::String #t106 = "x" in let final core::num #t107 = #t105.{self::Test::[]}(#t106).{core::num::+}(self::getNum()) as{TypeError} core::double in let final void #t108 = #t105.{self::Test::[]=}(#t106, #t107) in #t107;
- core::double v9 = let final self::Test<core::int, core::double> #t109 = t in let final core::String #t110 = "x" in let final core::double #t111 = #t109.{self::Test::[]}(#t110).{core::num::+}(self::getDouble()) in let final void #t112 = #t109.{self::Test::[]=}(#t110, #t111) in #t111;
- core::int v10 = let final self::Test<core::int, core::double> #t113 = t in let final core::String #t114 = "x" in let final core::int #t115 = let final dynamic #t116 = #t113.{self::Test::[]}(#t114).{core::num::+}(1) in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference_new/infer_assign_to_index_upwards.dart:50:27: Error: A value of type 'dart.core::int' can't be assigned to a variable of type 'dart.core::double'.
+ ^" in let final dynamic #t104 = #t100.{self::Test::[]}(#t101).{core::num::+}(self::getInt()) in null in let final void #t105 = #t100.{self::Test::[]=}(#t101, #t102) in #t102;
+ core::num v8 = let final self::Test<core::int, core::double> #t106 = t in let final core::String #t107 = "x" in let final core::num #t108 = #t106.{self::Test::[]}(#t107).{core::num::+}(self::getNum()) as{TypeError} core::double in let final void #t109 = #t106.{self::Test::[]=}(#t107, #t108) in #t108;
+ core::double v9 = let final self::Test<core::int, core::double> #t110 = t in let final core::String #t111 = "x" in let final core::double #t112 = #t110.{self::Test::[]}(#t111).{core::num::+}(self::getDouble()) in let final void #t113 = #t110.{self::Test::[]=}(#t111, #t112) in #t112;
+ core::int v10 = let final self::Test<core::int, core::double> #t114 = t in let final core::String #t115 = "x" in let final core::int #t116 = let final dynamic #t117 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference_new/infer_assign_to_index_upwards.dart:50:27: Error: A value of type 'dart.core::int' can't be assigned to a variable of type 'dart.core::double'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::double'.
var /*@type=int*/ v10 = ++t /*@target=Test::[]=*/ ['x'];
- ^" in let final void #t117 = #t113.{self::Test::[]=}(#t114, #t115) in #t115;
- core::int v11 = let final self::Test<core::int, core::double> #t118 = t in let final core::String #t119 = "x" in let final core::int #t120 = #t118.{self::Test::[]}(#t119) in let final void #t121 = #t118.{self::Test::[]=}(#t119, let final dynamic #t122 = #t120.{core::num::+}(1) in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference_new/infer_assign_to_index_upwards.dart:51:56: Error: A value of type 'dart.core::int' can't be assigned to a variable of type 'dart.core::double'.
+ ^" in let final dynamic #t118 = #t114.{self::Test::[]}(#t115).{core::num::+}(1) in null in let final void #t119 = #t114.{self::Test::[]=}(#t115, #t116) in #t116;
+ core::int v11 = let final self::Test<core::int, core::double> #t120 = t in let final core::String #t121 = "x" in let final core::int #t122 = #t120.{self::Test::[]}(#t121) in let final void #t123 = #t120.{self::Test::[]=}(#t121, let final dynamic #t124 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference_new/infer_assign_to_index_upwards.dart:51:56: Error: A value of type 'dart.core::int' can't be assigned to a variable of type 'dart.core::double'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::double'.
var /*@type=int*/ v11 = t /*@target=Test::[]=*/ ['x']++;
- ^") in #t120;
+ ^" in let final dynamic #t125 = #t122.{core::num::+}(1) in null) in #t122;
}
static method test4(self::Test<core::num, core::int> t) → void {
- core::int v1 = let final self::Test<core::num, core::int> #t123 = t in let final core::String #t124 = "x" in let final core::int #t125 = self::getInt() in let final void #t126 = #t123.{self::Test::[]=}(#t124, #t125) in #t125;
- core::num v2 = let final self::Test<core::num, core::int> #t127 = t in let final core::String #t128 = "x" in let final core::num #t129 = self::getNum() as{TypeError} core::int in let final void #t130 = #t127.{self::Test::[]=}(#t128, #t129) in #t129;
- core::num v4 = let final self::Test<core::num, core::int> #t131 = t in let final core::String #t132 = "x" in let final core::num #t133 = #t131.{self::Test::[]}(#t132) in #t133.{core::num::==}(null) ?{core::num} let final core::int #t134 = self::getInt() in let final void #t135 = #t131.{self::Test::[]=}(#t132, #t134) in #t134 : #t133;
- core::num v5 = let final self::Test<core::num, core::int> #t136 = t in let final core::String #t137 = "x" in let final core::num #t138 = #t136.{self::Test::[]}(#t137) in #t138.{core::num::==}(null) ?{core::num} let final core::num #t139 = self::getNum() as{TypeError} core::int in let final void #t140 = #t136.{self::Test::[]=}(#t137, #t139) in #t139 : #t138;
- core::num v7 = let final self::Test<core::num, core::int> #t141 = t in let final core::String #t142 = "x" in let final core::num #t143 = #t141.{self::Test::[]}(#t142).{core::num::+}(self::getInt()) as{TypeError} core::int in let final void #t144 = #t141.{self::Test::[]=}(#t142, #t143) in #t143;
- core::num v8 = let final self::Test<core::num, core::int> #t145 = t in let final core::String #t146 = "x" in let final core::num #t147 = #t145.{self::Test::[]}(#t146).{core::num::+}(self::getNum()) as{TypeError} core::int in let final void #t148 = #t145.{self::Test::[]=}(#t146, #t147) in #t147;
- core::num v10 = let final self::Test<core::num, core::int> #t149 = t in let final core::String #t150 = "x" in let final core::num #t151 = #t149.{self::Test::[]}(#t150).{core::num::+}(1) as{TypeError} core::int in let final void #t152 = #t149.{self::Test::[]=}(#t150, #t151) in #t151;
- core::num v11 = let final self::Test<core::num, core::int> #t153 = t in let final core::String #t154 = "x" in let final core::num #t155 = #t153.{self::Test::[]}(#t154) in let final void #t156 = #t153.{self::Test::[]=}(#t154, #t155.{core::num::+}(1) as{TypeError} core::int) in #t155;
+ core::int v1 = let final self::Test<core::num, core::int> #t126 = t in let final core::String #t127 = "x" in let final core::int #t128 = self::getInt() in let final void #t129 = #t126.{self::Test::[]=}(#t127, #t128) in #t128;
+ core::num v2 = let final self::Test<core::num, core::int> #t130 = t in let final core::String #t131 = "x" in let final core::num #t132 = self::getNum() as{TypeError} core::int in let final void #t133 = #t130.{self::Test::[]=}(#t131, #t132) in #t132;
+ core::num v4 = let final self::Test<core::num, core::int> #t134 = t in let final core::String #t135 = "x" in let final core::num #t136 = #t134.{self::Test::[]}(#t135) in #t136.{core::num::==}(null) ?{core::num} let final core::int #t137 = self::getInt() in let final void #t138 = #t134.{self::Test::[]=}(#t135, #t137) in #t137 : #t136;
+ core::num v5 = let final self::Test<core::num, core::int> #t139 = t in let final core::String #t140 = "x" in let final core::num #t141 = #t139.{self::Test::[]}(#t140) in #t141.{core::num::==}(null) ?{core::num} let final core::num #t142 = self::getNum() as{TypeError} core::int in let final void #t143 = #t139.{self::Test::[]=}(#t140, #t142) in #t142 : #t141;
+ core::num v7 = let final self::Test<core::num, core::int> #t144 = t in let final core::String #t145 = "x" in let final core::num #t146 = #t144.{self::Test::[]}(#t145).{core::num::+}(self::getInt()) as{TypeError} core::int in let final void #t147 = #t144.{self::Test::[]=}(#t145, #t146) in #t146;
+ core::num v8 = let final self::Test<core::num, core::int> #t148 = t in let final core::String #t149 = "x" in let final core::num #t150 = #t148.{self::Test::[]}(#t149).{core::num::+}(self::getNum()) as{TypeError} core::int in let final void #t151 = #t148.{self::Test::[]=}(#t149, #t150) in #t150;
+ core::num v10 = let final self::Test<core::num, core::int> #t152 = t in let final core::String #t153 = "x" in let final core::num #t154 = #t152.{self::Test::[]}(#t153).{core::num::+}(1) as{TypeError} core::int in let final void #t155 = #t152.{self::Test::[]=}(#t153, #t154) in #t154;
+ core::num v11 = let final self::Test<core::num, core::int> #t156 = t in let final core::String #t157 = "x" in let final core::num #t158 = #t156.{self::Test::[]}(#t157) in let final void #t159 = #t156.{self::Test::[]=}(#t157, #t158.{core::num::+}(1) as{TypeError} core::int) in #t158;
}
static method test5(self::Test<core::num, core::num> t) → void {
- core::int v1 = let final self::Test<core::num, core::num> #t157 = t in let final core::String #t158 = "x" in let final core::int #t159 = self::getInt() in let final void #t160 = #t157.{self::Test::[]=}(#t158, #t159) in #t159;
- core::num v2 = let final self::Test<core::num, core::num> #t161 = t in let final core::String #t162 = "x" in let final core::num #t163 = self::getNum() in let final void #t164 = #t161.{self::Test::[]=}(#t162, #t163) in #t163;
- core::double v3 = let final self::Test<core::num, core::num> #t165 = t in let final core::String #t166 = "x" in let final core::double #t167 = self::getDouble() in let final void #t168 = #t165.{self::Test::[]=}(#t166, #t167) in #t167;
- core::num v4 = let final self::Test<core::num, core::num> #t169 = t in let final core::String #t170 = "x" in let final core::num #t171 = #t169.{self::Test::[]}(#t170) in #t171.{core::num::==}(null) ?{core::num} let final core::int #t172 = self::getInt() in let final void #t173 = #t169.{self::Test::[]=}(#t170, #t172) in #t172 : #t171;
- core::num v5 = let final self::Test<core::num, core::num> #t174 = t in let final core::String #t175 = "x" in let final core::num #t176 = #t174.{self::Test::[]}(#t175) in #t176.{core::num::==}(null) ?{core::num} let final core::num #t177 = self::getNum() in let final void #t178 = #t174.{self::Test::[]=}(#t175, #t177) in #t177 : #t176;
- core::num v6 = let final self::Test<core::num, core::num> #t179 = t in let final core::String #t180 = "x" in let final core::num #t181 = #t179.{self::Test::[]}(#t180) in #t181.{core::num::==}(null) ?{core::num} let final core::double #t182 = self::getDouble() in let final void #t183 = #t179.{self::Test::[]=}(#t180, #t182) in #t182 : #t181;
- core::num v7 = let final self::Test<core::num, core::num> #t184 = t in let final core::String #t185 = "x" in let final core::num #t186 = #t184.{self::Test::[]}(#t185).{core::num::+}(self::getInt()) in let final void #t187 = #t184.{self::Test::[]=}(#t185, #t186) in #t186;
- core::num v8 = let final self::Test<core::num, core::num> #t188 = t in let final core::String #t189 = "x" in let final core::num #t190 = #t188.{self::Test::[]}(#t189).{core::num::+}(self::getNum()) in let final void #t191 = #t188.{self::Test::[]=}(#t189, #t190) in #t190;
- core::num v9 = let final self::Test<core::num, core::num> #t192 = t in let final core::String #t193 = "x" in let final core::num #t194 = #t192.{self::Test::[]}(#t193).{core::num::+}(self::getDouble()) in let final void #t195 = #t192.{self::Test::[]=}(#t193, #t194) in #t194;
- core::num v10 = let final self::Test<core::num, core::num> #t196 = t in let final core::String #t197 = "x" in let final core::num #t198 = #t196.{self::Test::[]}(#t197).{core::num::+}(1) in let final void #t199 = #t196.{self::Test::[]=}(#t197, #t198) in #t198;
- core::num v11 = let final self::Test<core::num, core::num> #t200 = t in let final core::String #t201 = "x" in let final core::num #t202 = #t200.{self::Test::[]}(#t201) in let final void #t203 = #t200.{self::Test::[]=}(#t201, #t202.{core::num::+}(1)) in #t202;
+ core::int v1 = let final self::Test<core::num, core::num> #t160 = t in let final core::String #t161 = "x" in let final core::int #t162 = self::getInt() in let final void #t163 = #t160.{self::Test::[]=}(#t161, #t162) in #t162;
+ core::num v2 = let final self::Test<core::num, core::num> #t164 = t in let final core::String #t165 = "x" in let final core::num #t166 = self::getNum() in let final void #t167 = #t164.{self::Test::[]=}(#t165, #t166) in #t166;
+ core::double v3 = let final self::Test<core::num, core::num> #t168 = t in let final core::String #t169 = "x" in let final core::double #t170 = self::getDouble() in let final void #t171 = #t168.{self::Test::[]=}(#t169, #t170) in #t170;
+ core::num v4 = let final self::Test<core::num, core::num> #t172 = t in let final core::String #t173 = "x" in let final core::num #t174 = #t172.{self::Test::[]}(#t173) in #t174.{core::num::==}(null) ?{core::num} let final core::int #t175 = self::getInt() in let final void #t176 = #t172.{self::Test::[]=}(#t173, #t175) in #t175 : #t174;
+ core::num v5 = let final self::Test<core::num, core::num> #t177 = t in let final core::String #t178 = "x" in let final core::num #t179 = #t177.{self::Test::[]}(#t178) in #t179.{core::num::==}(null) ?{core::num} let final core::num #t180 = self::getNum() in let final void #t181 = #t177.{self::Test::[]=}(#t178, #t180) in #t180 : #t179;
+ core::num v6 = let final self::Test<core::num, core::num> #t182 = t in let final core::String #t183 = "x" in let final core::num #t184 = #t182.{self::Test::[]}(#t183) in #t184.{core::num::==}(null) ?{core::num} let final core::double #t185 = self::getDouble() in let final void #t186 = #t182.{self::Test::[]=}(#t183, #t185) in #t185 : #t184;
+ core::num v7 = let final self::Test<core::num, core::num> #t187 = t in let final core::String #t188 = "x" in let final core::num #t189 = #t187.{self::Test::[]}(#t188).{core::num::+}(self::getInt()) in let final void #t190 = #t187.{self::Test::[]=}(#t188, #t189) in #t189;
+ core::num v8 = let final self::Test<core::num, core::num> #t191 = t in let final core::String #t192 = "x" in let final core::num #t193 = #t191.{self::Test::[]}(#t192).{core::num::+}(self::getNum()) in let final void #t194 = #t191.{self::Test::[]=}(#t192, #t193) in #t193;
+ core::num v9 = let final self::Test<core::num, core::num> #t195 = t in let final core::String #t196 = "x" in let final core::num #t197 = #t195.{self::Test::[]}(#t196).{core::num::+}(self::getDouble()) in let final void #t198 = #t195.{self::Test::[]=}(#t196, #t197) in #t197;
+ core::num v10 = let final self::Test<core::num, core::num> #t199 = t in let final core::String #t200 = "x" in let final core::num #t201 = #t199.{self::Test::[]}(#t200).{core::num::+}(1) in let final void #t202 = #t199.{self::Test::[]=}(#t200, #t201) in #t201;
+ core::num v11 = let final self::Test<core::num, core::num> #t203 = t in let final core::String #t204 = "x" in let final core::num #t205 = #t203.{self::Test::[]}(#t204) in let final void #t206 = #t203.{self::Test::[]=}(#t204, #t205.{core::num::+}(1)) in #t205;
}
static method test6(self::Test<core::num, core::double> t) → void {
- core::num v2 = let final self::Test<core::num, core::double> #t204 = t in let final core::String #t205 = "x" in let final core::num #t206 = self::getNum() as{TypeError} core::double in let final void #t207 = #t204.{self::Test::[]=}(#t205, #t206) in #t206;
- core::double v3 = let final self::Test<core::num, core::double> #t208 = t in let final core::String #t209 = "x" in let final core::double #t210 = self::getDouble() in let final void #t211 = #t208.{self::Test::[]=}(#t209, #t210) in #t210;
- core::num v5 = let final self::Test<core::num, core::double> #t212 = t in let final core::String #t213 = "x" in let final core::num #t214 = #t212.{self::Test::[]}(#t213) in #t214.{core::num::==}(null) ?{core::num} let final core::num #t215 = self::getNum() as{TypeError} core::double in let final void #t216 = #t212.{self::Test::[]=}(#t213, #t215) in #t215 : #t214;
- core::num v6 = let final self::Test<core::num, core::double> #t217 = t in let final core::String #t218 = "x" in let final core::num #t219 = #t217.{self::Test::[]}(#t218) in #t219.{core::num::==}(null) ?{core::num} let final core::double #t220 = self::getDouble() in let final void #t221 = #t217.{self::Test::[]=}(#t218, #t220) in #t220 : #t219;
- core::num v7 = let final self::Test<core::num, core::double> #t222 = t in let final core::String #t223 = "x" in let final core::num #t224 = #t222.{self::Test::[]}(#t223).{core::num::+}(self::getInt()) as{TypeError} core::double in let final void #t225 = #t222.{self::Test::[]=}(#t223, #t224) in #t224;
- core::num v8 = let final self::Test<core::num, core::double> #t226 = t in let final core::String #t227 = "x" in let final core::num #t228 = #t226.{self::Test::[]}(#t227).{core::num::+}(self::getNum()) as{TypeError} core::double in let final void #t229 = #t226.{self::Test::[]=}(#t227, #t228) in #t228;
- core::num v9 = let final self::Test<core::num, core::double> #t230 = t in let final core::String #t231 = "x" in let final core::num #t232 = #t230.{self::Test::[]}(#t231).{core::num::+}(self::getDouble()) as{TypeError} core::double in let final void #t233 = #t230.{self::Test::[]=}(#t231, #t232) in #t232;
- core::num v10 = let final self::Test<core::num, core::double> #t234 = t in let final core::String #t235 = "x" in let final core::num #t236 = #t234.{self::Test::[]}(#t235).{core::num::+}(1) as{TypeError} core::double in let final void #t237 = #t234.{self::Test::[]=}(#t235, #t236) in #t236;
- core::num v11 = let final self::Test<core::num, core::double> #t238 = t in let final core::String #t239 = "x" in let final core::num #t240 = #t238.{self::Test::[]}(#t239) in let final void #t241 = #t238.{self::Test::[]=}(#t239, #t240.{core::num::+}(1) as{TypeError} core::double) in #t240;
+ core::num v2 = let final self::Test<core::num, core::double> #t207 = t in let final core::String #t208 = "x" in let final core::num #t209 = self::getNum() as{TypeError} core::double in let final void #t210 = #t207.{self::Test::[]=}(#t208, #t209) in #t209;
+ core::double v3 = let final self::Test<core::num, core::double> #t211 = t in let final core::String #t212 = "x" in let final core::double #t213 = self::getDouble() in let final void #t214 = #t211.{self::Test::[]=}(#t212, #t213) in #t213;
+ core::num v5 = let final self::Test<core::num, core::double> #t215 = t in let final core::String #t216 = "x" in let final core::num #t217 = #t215.{self::Test::[]}(#t216) in #t217.{core::num::==}(null) ?{core::num} let final core::num #t218 = self::getNum() as{TypeError} core::double in let final void #t219 = #t215.{self::Test::[]=}(#t216, #t218) in #t218 : #t217;
+ core::num v6 = let final self::Test<core::num, core::double> #t220 = t in let final core::String #t221 = "x" in let final core::num #t222 = #t220.{self::Test::[]}(#t221) in #t222.{core::num::==}(null) ?{core::num} let final core::double #t223 = self::getDouble() in let final void #t224 = #t220.{self::Test::[]=}(#t221, #t223) in #t223 : #t222;
+ core::num v7 = let final self::Test<core::num, core::double> #t225 = t in let final core::String #t226 = "x" in let final core::num #t227 = #t225.{self::Test::[]}(#t226).{core::num::+}(self::getInt()) as{TypeError} core::double in let final void #t228 = #t225.{self::Test::[]=}(#t226, #t227) in #t227;
+ core::num v8 = let final self::Test<core::num, core::double> #t229 = t in let final core::String #t230 = "x" in let final core::num #t231 = #t229.{self::Test::[]}(#t230).{core::num::+}(self::getNum()) as{TypeError} core::double in let final void #t232 = #t229.{self::Test::[]=}(#t230, #t231) in #t231;
+ core::num v9 = let final self::Test<core::num, core::double> #t233 = t in let final core::String #t234 = "x" in let final core::num #t235 = #t233.{self::Test::[]}(#t234).{core::num::+}(self::getDouble()) as{TypeError} core::double in let final void #t236 = #t233.{self::Test::[]=}(#t234, #t235) in #t235;
+ core::num v10 = let final self::Test<core::num, core::double> #t237 = t in let final core::String #t238 = "x" in let final core::num #t239 = #t237.{self::Test::[]}(#t238).{core::num::+}(1) as{TypeError} core::double in let final void #t240 = #t237.{self::Test::[]=}(#t238, #t239) in #t239;
+ core::num v11 = let final self::Test<core::num, core::double> #t241 = t in let final core::String #t242 = "x" in let final core::num #t243 = #t241.{self::Test::[]}(#t242) in let final void #t244 = #t241.{self::Test::[]=}(#t242, #t243.{core::num::+}(1) as{TypeError} core::double) in #t243;
}
static method test7(self::Test<core::double, core::int> t) → void {
- core::int v1 = let final self::Test<core::double, core::int> #t242 = t in let final core::String #t243 = "x" in let final core::int #t244 = self::getInt() in let final void #t245 = #t242.{self::Test::[]=}(#t243, #t244) in #t244;
- core::num v2 = let final self::Test<core::double, core::int> #t246 = t in let final core::String #t247 = "x" in let final core::num #t248 = self::getNum() as{TypeError} core::int in let final void #t249 = #t246.{self::Test::[]=}(#t247, #t248) in #t248;
- core::num v4 = let final self::Test<core::double, core::int> #t250 = t in let final core::String #t251 = "x" in let final core::double #t252 = #t250.{self::Test::[]}(#t251) in #t252.{core::num::==}(null) ?{core::num} let final core::int #t253 = self::getInt() in let final void #t254 = #t250.{self::Test::[]=}(#t251, #t253) in #t253 : #t252;
- core::num v5 = let final self::Test<core::double, core::int> #t255 = t in let final core::String #t256 = "x" in let final core::double #t257 = #t255.{self::Test::[]}(#t256) in #t257.{core::num::==}(null) ?{core::num} let final core::num #t258 = self::getNum() as{TypeError} core::int in let final void #t259 = #t255.{self::Test::[]=}(#t256, #t258) in #t258 : #t257;
- core::double v7 = let final self::Test<core::double, core::int> #t260 = t in let final core::String #t261 = "x" in let final core::double #t262 = let final dynamic #t263 = #t260.{self::Test::[]}(#t261).{core::double::+}(self::getInt()) in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference_new/infer_assign_to_index_upwards.dart:96:59: Error: A value of type 'dart.core::double' can't be assigned to a variable of type 'dart.core::int'.
+ core::int v1 = let final self::Test<core::double, core::int> #t245 = t in let final core::String #t246 = "x" in let final core::int #t247 = self::getInt() in let final void #t248 = #t245.{self::Test::[]=}(#t246, #t247) in #t247;
+ core::num v2 = let final self::Test<core::double, core::int> #t249 = t in let final core::String #t250 = "x" in let final core::num #t251 = self::getNum() as{TypeError} core::int in let final void #t252 = #t249.{self::Test::[]=}(#t250, #t251) in #t251;
+ core::num v4 = let final self::Test<core::double, core::int> #t253 = t in let final core::String #t254 = "x" in let final core::double #t255 = #t253.{self::Test::[]}(#t254) in #t255.{core::num::==}(null) ?{core::num} let final core::int #t256 = self::getInt() in let final void #t257 = #t253.{self::Test::[]=}(#t254, #t256) in #t256 : #t255;
+ core::num v5 = let final self::Test<core::double, core::int> #t258 = t in let final core::String #t259 = "x" in let final core::double #t260 = #t258.{self::Test::[]}(#t259) in #t260.{core::num::==}(null) ?{core::num} let final core::num #t261 = self::getNum() as{TypeError} core::int in let final void #t262 = #t258.{self::Test::[]=}(#t259, #t261) in #t261 : #t260;
+ core::double v7 = let final self::Test<core::double, core::int> #t263 = t in let final core::String #t264 = "x" in let final core::double #t265 = let final dynamic #t266 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference_new/infer_assign_to_index_upwards.dart:96:59: Error: A value of type 'dart.core::double' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
var /*@type=double*/ v7 = t /*@target=Test::[]=*/ ['x'] += getInt();
- ^" in let final void #t264 = #t260.{self::Test::[]=}(#t261, #t262) in #t262;
- core::double v8 = let final self::Test<core::double, core::int> #t265 = t in let final core::String #t266 = "x" in let final core::double #t267 = let final dynamic #t268 = #t265.{self::Test::[]}(#t266).{core::double::+}(self::getNum()) in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference_new/infer_assign_to_index_upwards.dart:97:59: Error: A value of type 'dart.core::double' can't be assigned to a variable of type 'dart.core::int'.
+ ^" in let final dynamic #t267 = #t263.{self::Test::[]}(#t264).{core::double::+}(self::getInt()) in null in let final void #t268 = #t263.{self::Test::[]=}(#t264, #t265) in #t265;
+ core::double v8 = let final self::Test<core::double, core::int> #t269 = t in let final core::String #t270 = "x" in let final core::double #t271 = let final dynamic #t272 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference_new/infer_assign_to_index_upwards.dart:97:59: Error: A value of type 'dart.core::double' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
var /*@type=double*/ v8 = t /*@target=Test::[]=*/ ['x'] += getNum();
- ^" in let final void #t269 = #t265.{self::Test::[]=}(#t266, #t267) in #t267;
- core::double v10 = let final self::Test<core::double, core::int> #t270 = t in let final core::String #t271 = "x" in let final core::double #t272 = let final dynamic #t273 = #t270.{self::Test::[]}(#t271).{core::double::+}(1) in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference_new/infer_assign_to_index_upwards.dart:98:30: Error: A value of type 'dart.core::double' can't be assigned to a variable of type 'dart.core::int'.
+ ^" in let final dynamic #t273 = #t269.{self::Test::[]}(#t270).{core::double::+}(self::getNum()) in null in let final void #t274 = #t269.{self::Test::[]=}(#t270, #t271) in #t271;
+ core::double v10 = let final self::Test<core::double, core::int> #t275 = t in let final core::String #t276 = "x" in let final core::double #t277 = let final dynamic #t278 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference_new/infer_assign_to_index_upwards.dart:98:30: Error: A value of type 'dart.core::double' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
var /*@type=double*/ v10 = ++t /*@target=Test::[]=*/ ['x'];
- ^" in let final void #t274 = #t270.{self::Test::[]=}(#t271, #t272) in #t272;
- core::double v11 = let final self::Test<core::double, core::int> #t275 = t in let final core::String #t276 = "x" in let final core::double #t277 = #t275.{self::Test::[]}(#t276) in let final void #t278 = #t275.{self::Test::[]=}(#t276, let final dynamic #t279 = #t277.{core::double::+}(1) in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference_new/infer_assign_to_index_upwards.dart:99:59: Error: A value of type 'dart.core::double' can't be assigned to a variable of type 'dart.core::int'.
+ ^" in let final dynamic #t279 = #t275.{self::Test::[]}(#t276).{core::double::+}(1) in null in let final void #t280 = #t275.{self::Test::[]=}(#t276, #t277) in #t277;
+ core::double v11 = let final self::Test<core::double, core::int> #t281 = t in let final core::String #t282 = "x" in let final core::double #t283 = #t281.{self::Test::[]}(#t282) in let final void #t284 = #t281.{self::Test::[]=}(#t282, let final dynamic #t285 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference_new/infer_assign_to_index_upwards.dart:99:59: Error: A value of type 'dart.core::double' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
var /*@type=double*/ v11 = t /*@target=Test::[]=*/ ['x']++;
- ^") in #t277;
+ ^" in let final dynamic #t286 = #t283.{core::double::+}(1) in null) in #t283;
}
static method test8(self::Test<core::double, core::num> t) → void {
- core::int v1 = let final self::Test<core::double, core::num> #t280 = t in let final core::String #t281 = "x" in let final core::int #t282 = self::getInt() in let final void #t283 = #t280.{self::Test::[]=}(#t281, #t282) in #t282;
- core::num v2 = let final self::Test<core::double, core::num> #t284 = t in let final core::String #t285 = "x" in let final core::num #t286 = self::getNum() in let final void #t287 = #t284.{self::Test::[]=}(#t285, #t286) in #t286;
- core::double v3 = let final self::Test<core::double, core::num> #t288 = t in let final core::String #t289 = "x" in let final core::double #t290 = self::getDouble() in let final void #t291 = #t288.{self::Test::[]=}(#t289, #t290) in #t290;
- core::num v4 = let final self::Test<core::double, core::num> #t292 = t in let final core::String #t293 = "x" in let final core::double #t294 = #t292.{self::Test::[]}(#t293) in #t294.{core::num::==}(null) ?{core::num} let final core::int #t295 = self::getInt() in let final void #t296 = #t292.{self::Test::[]=}(#t293, #t295) in #t295 : #t294;
- core::num v5 = let final self::Test<core::double, core::num> #t297 = t in let final core::String #t298 = "x" in let final core::double #t299 = #t297.{self::Test::[]}(#t298) in #t299.{core::num::==}(null) ?{core::num} let final core::num #t300 = self::getNum() in let final void #t301 = #t297.{self::Test::[]=}(#t298, #t300) in #t300 : #t299;
- core::double v6 = let final self::Test<core::double, core::num> #t302 = t in let final core::String #t303 = "x" in let final core::double #t304 = #t302.{self::Test::[]}(#t303) in #t304.{core::num::==}(null) ?{core::double} let final core::double #t305 = self::getDouble() in let final void #t306 = #t302.{self::Test::[]=}(#t303, #t305) in #t305 : #t304;
- core::double v7 = let final self::Test<core::double, core::num> #t307 = t in let final core::String #t308 = "x" in let final core::double #t309 = #t307.{self::Test::[]}(#t308).{core::double::+}(self::getInt()) in let final void #t310 = #t307.{self::Test::[]=}(#t308, #t309) in #t309;
- core::double v8 = let final self::Test<core::double, core::num> #t311 = t in let final core::String #t312 = "x" in let final core::double #t313 = #t311.{self::Test::[]}(#t312).{core::double::+}(self::getNum()) in let final void #t314 = #t311.{self::Test::[]=}(#t312, #t313) in #t313;
- core::double v9 = let final self::Test<core::double, core::num> #t315 = t in let final core::String #t316 = "x" in let final core::double #t317 = #t315.{self::Test::[]}(#t316).{core::double::+}(self::getDouble()) in let final void #t318 = #t315.{self::Test::[]=}(#t316, #t317) in #t317;
- core::double v10 = let final self::Test<core::double, core::num> #t319 = t in let final core::String #t320 = "x" in let final core::double #t321 = #t319.{self::Test::[]}(#t320).{core::double::+}(1) in let final void #t322 = #t319.{self::Test::[]=}(#t320, #t321) in #t321;
- core::double v11 = let final self::Test<core::double, core::num> #t323 = t in let final core::String #t324 = "x" in let final core::double #t325 = #t323.{self::Test::[]}(#t324) in let final void #t326 = #t323.{self::Test::[]=}(#t324, #t325.{core::double::+}(1)) in #t325;
+ core::int v1 = let final self::Test<core::double, core::num> #t287 = t in let final core::String #t288 = "x" in let final core::int #t289 = self::getInt() in let final void #t290 = #t287.{self::Test::[]=}(#t288, #t289) in #t289;
+ core::num v2 = let final self::Test<core::double, core::num> #t291 = t in let final core::String #t292 = "x" in let final core::num #t293 = self::getNum() in let final void #t294 = #t291.{self::Test::[]=}(#t292, #t293) in #t293;
+ core::double v3 = let final self::Test<core::double, core::num> #t295 = t in let final core::String #t296 = "x" in let final core::double #t297 = self::getDouble() in let final void #t298 = #t295.{self::Test::[]=}(#t296, #t297) in #t297;
+ core::num v4 = let final self::Test<core::double, core::num> #t299 = t in let final core::String #t300 = "x" in let final core::double #t301 = #t299.{self::Test::[]}(#t300) in #t301.{core::num::==}(null) ?{core::num} let final core::int #t302 = self::getInt() in let final void #t303 = #t299.{self::Test::[]=}(#t300, #t302) in #t302 : #t301;
+ core::num v5 = let final self::Test<core::double, core::num> #t304 = t in let final core::String #t305 = "x" in let final core::double #t306 = #t304.{self::Test::[]}(#t305) in #t306.{core::num::==}(null) ?{core::num} let final core::num #t307 = self::getNum() in let final void #t308 = #t304.{self::Test::[]=}(#t305, #t307) in #t307 : #t306;
+ core::double v6 = let final self::Test<core::double, core::num> #t309 = t in let final core::String #t310 = "x" in let final core::double #t311 = #t309.{self::Test::[]}(#t310) in #t311.{core::num::==}(null) ?{core::double} let final core::double #t312 = self::getDouble() in let final void #t313 = #t309.{self::Test::[]=}(#t310, #t312) in #t312 : #t311;
+ core::double v7 = let final self::Test<core::double, core::num> #t314 = t in let final core::String #t315 = "x" in let final core::double #t316 = #t314.{self::Test::[]}(#t315).{core::double::+}(self::getInt()) in let final void #t317 = #t314.{self::Test::[]=}(#t315, #t316) in #t316;
+ core::double v8 = let final self::Test<core::double, core::num> #t318 = t in let final core::String #t319 = "x" in let final core::double #t320 = #t318.{self::Test::[]}(#t319).{core::double::+}(self::getNum()) in let final void #t321 = #t318.{self::Test::[]=}(#t319, #t320) in #t320;
+ core::double v9 = let final self::Test<core::double, core::num> #t322 = t in let final core::String #t323 = "x" in let final core::double #t324 = #t322.{self::Test::[]}(#t323).{core::double::+}(self::getDouble()) in let final void #t325 = #t322.{self::Test::[]=}(#t323, #t324) in #t324;
+ core::double v10 = let final self::Test<core::double, core::num> #t326 = t in let final core::String #t327 = "x" in let final core::double #t328 = #t326.{self::Test::[]}(#t327).{core::double::+}(1) in let final void #t329 = #t326.{self::Test::[]=}(#t327, #t328) in #t328;
+ core::double v11 = let final self::Test<core::double, core::num> #t330 = t in let final core::String #t331 = "x" in let final core::double #t332 = #t330.{self::Test::[]}(#t331) in let final void #t333 = #t330.{self::Test::[]=}(#t331, #t332.{core::double::+}(1)) in #t332;
}
static method test9(self::Test<core::double, core::double> t) → void {
- core::num v2 = let final self::Test<core::double, core::double> #t327 = t in let final core::String #t328 = "x" in let final core::num #t329 = self::getNum() as{TypeError} core::double in let final void #t330 = #t327.{self::Test::[]=}(#t328, #t329) in #t329;
- core::double v3 = let final self::Test<core::double, core::double> #t331 = t in let final core::String #t332 = "x" in let final core::double #t333 = self::getDouble() in let final void #t334 = #t331.{self::Test::[]=}(#t332, #t333) in #t333;
- core::num v5 = let final self::Test<core::double, core::double> #t335 = t in let final core::String #t336 = "x" in let final core::double #t337 = #t335.{self::Test::[]}(#t336) in #t337.{core::num::==}(null) ?{core::num} let final core::num #t338 = self::getNum() as{TypeError} core::double in let final void #t339 = #t335.{self::Test::[]=}(#t336, #t338) in #t338 : #t337;
- core::double v6 = let final self::Test<core::double, core::double> #t340 = t in let final core::String #t341 = "x" in let final core::double #t342 = #t340.{self::Test::[]}(#t341) in #t342.{core::num::==}(null) ?{core::double} let final core::double #t343 = self::getDouble() in let final void #t344 = #t340.{self::Test::[]=}(#t341, #t343) in #t343 : #t342;
- core::double v7 = let final self::Test<core::double, core::double> #t345 = t in let final core::String #t346 = "x" in let final core::double #t347 = #t345.{self::Test::[]}(#t346).{core::double::+}(self::getInt()) in let final void #t348 = #t345.{self::Test::[]=}(#t346, #t347) in #t347;
- core::double v8 = let final self::Test<core::double, core::double> #t349 = t in let final core::String #t350 = "x" in let final core::double #t351 = #t349.{self::Test::[]}(#t350).{core::double::+}(self::getNum()) in let final void #t352 = #t349.{self::Test::[]=}(#t350, #t351) in #t351;
- core::double v9 = let final self::Test<core::double, core::double> #t353 = t in let final core::String #t354 = "x" in let final core::double #t355 = #t353.{self::Test::[]}(#t354).{core::double::+}(self::getDouble()) in let final void #t356 = #t353.{self::Test::[]=}(#t354, #t355) in #t355;
- core::double v10 = let final self::Test<core::double, core::double> #t357 = t in let final core::String #t358 = "x" in let final core::double #t359 = #t357.{self::Test::[]}(#t358).{core::double::+}(1) in let final void #t360 = #t357.{self::Test::[]=}(#t358, #t359) in #t359;
- core::double v11 = let final self::Test<core::double, core::double> #t361 = t in let final core::String #t362 = "x" in let final core::double #t363 = #t361.{self::Test::[]}(#t362) in let final void #t364 = #t361.{self::Test::[]=}(#t362, #t363.{core::double::+}(1)) in #t363;
+ core::num v2 = let final self::Test<core::double, core::double> #t334 = t in let final core::String #t335 = "x" in let final core::num #t336 = self::getNum() as{TypeError} core::double in let final void #t337 = #t334.{self::Test::[]=}(#t335, #t336) in #t336;
+ core::double v3 = let final self::Test<core::double, core::double> #t338 = t in let final core::String #t339 = "x" in let final core::double #t340 = self::getDouble() in let final void #t341 = #t338.{self::Test::[]=}(#t339, #t340) in #t340;
+ core::num v5 = let final self::Test<core::double, core::double> #t342 = t in let final core::String #t343 = "x" in let final core::double #t344 = #t342.{self::Test::[]}(#t343) in #t344.{core::num::==}(null) ?{core::num} let final core::num #t345 = self::getNum() as{TypeError} core::double in let final void #t346 = #t342.{self::Test::[]=}(#t343, #t345) in #t345 : #t344;
+ core::double v6 = let final self::Test<core::double, core::double> #t347 = t in let final core::String #t348 = "x" in let final core::double #t349 = #t347.{self::Test::[]}(#t348) in #t349.{core::num::==}(null) ?{core::double} let final core::double #t350 = self::getDouble() in let final void #t351 = #t347.{self::Test::[]=}(#t348, #t350) in #t350 : #t349;
+ core::double v7 = let final self::Test<core::double, core::double> #t352 = t in let final core::String #t353 = "x" in let final core::double #t354 = #t352.{self::Test::[]}(#t353).{core::double::+}(self::getInt()) in let final void #t355 = #t352.{self::Test::[]=}(#t353, #t354) in #t354;
+ core::double v8 = let final self::Test<core::double, core::double> #t356 = t in let final core::String #t357 = "x" in let final core::double #t358 = #t356.{self::Test::[]}(#t357).{core::double::+}(self::getNum()) in let final void #t359 = #t356.{self::Test::[]=}(#t357, #t358) in #t358;
+ core::double v9 = let final self::Test<core::double, core::double> #t360 = t in let final core::String #t361 = "x" in let final core::double #t362 = #t360.{self::Test::[]}(#t361).{core::double::+}(self::getDouble()) in let final void #t363 = #t360.{self::Test::[]=}(#t361, #t362) in #t362;
+ core::double v10 = let final self::Test<core::double, core::double> #t364 = t in let final core::String #t365 = "x" in let final core::double #t366 = #t364.{self::Test::[]}(#t365).{core::double::+}(1) in let final void #t367 = #t364.{self::Test::[]=}(#t365, #t366) in #t366;
+ core::double v11 = let final self::Test<core::double, core::double> #t368 = t in let final core::String #t369 = "x" in let final core::double #t370 = #t368.{self::Test::[]}(#t369) in let final void #t371 = #t368.{self::Test::[]=}(#t369, #t370.{core::double::+}(1)) in #t370;
}
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference_new/infer_assign_to_property_custom.dart.strong.expect b/pkg/front_end/testcases/inference_new/infer_assign_to_property_custom.dart.strong.expect
index c9f0f9a..45bad0d 100644
--- a/pkg/front_end/testcases/inference_new/infer_assign_to_property_custom.dart.strong.expect
+++ b/pkg/front_end/testcases/inference_new/infer_assign_to_property_custom.dart.strong.expect
@@ -17,20 +17,20 @@
: super core::Object::•()
;
}
-static field core::int v_prefix_pp = let final self::B #t1 = new self::B::•() in #t1.{self::B::a} = let final dynamic #t2 = #t1.{self::B::a}.{self::A::+}(1) in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference_new/infer_assign_to_property_custom.dart:17:37: Error: A value of type 'dart.core::int' can't be assigned to a variable of type 'test::A'.
+static field core::int v_prefix_pp = let final self::B #t1 = new self::B::•() in #t1.{self::B::a} = let final dynamic #t2 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference_new/infer_assign_to_property_custom.dart:17:37: Error: A value of type 'dart.core::int' can't be assigned to a variable of type 'test::A'.
Try changing the type of the left hand side, or casting the right hand side to 'test::A'.
var /*@topType=int*/ v_prefix_pp = (++new B(). /*@target=B::a*/ a);
- ^";
-static field core::double v_prefix_mm = let final self::B #t3 = new self::B::•() in #t3.{self::B::a} = let final dynamic #t4 = #t3.{self::B::a}.{self::A::-}(1) in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference_new/infer_assign_to_property_custom.dart:18:40: Error: A value of type 'dart.core::double' can't be assigned to a variable of type 'test::A'.
+ ^" in let final dynamic #t3 = #t1.{self::B::a}.{self::A::+}(1) in null;
+static field core::double v_prefix_mm = let final self::B #t4 = new self::B::•() in #t4.{self::B::a} = let final dynamic #t5 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference_new/infer_assign_to_property_custom.dart:18:40: Error: A value of type 'dart.core::double' can't be assigned to a variable of type 'test::A'.
Try changing the type of the left hand side, or casting the right hand side to 'test::A'.
var /*@topType=double*/ v_prefix_mm = (--new B(). /*@target=B::a*/ a);
- ^";
-static field self::A v_postfix_pp = let final self::B #t5 = new self::B::•() in let final self::A #t6 = #t5.{self::B::a} in let final core::int #t7 = #t5.{self::B::a} = let final dynamic #t8 = #t6.{self::A::+}(1) in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference_new/infer_assign_to_property_custom.dart:19:63: Error: A value of type 'dart.core::int' can't be assigned to a variable of type 'test::A'.
+ ^" in let final dynamic #t6 = #t4.{self::B::a}.{self::A::-}(1) in null;
+static field self::A v_postfix_pp = let final self::B #t7 = new self::B::•() in let final self::A #t8 = #t7.{self::B::a} in let final core::int #t9 = #t7.{self::B::a} = let final dynamic #t10 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference_new/infer_assign_to_property_custom.dart:19:63: Error: A value of type 'dart.core::int' can't be assigned to a variable of type 'test::A'.
Try changing the type of the left hand side, or casting the right hand side to 'test::A'.
var /*@topType=A*/ v_postfix_pp = (new B(). /*@target=B::a*/ a++);
- ^" in #t6;
-static field self::A v_postfix_mm = let final self::B #t9 = new self::B::•() in let final self::A #t10 = #t9.{self::B::a} in let final core::double #t11 = #t9.{self::B::a} = let final dynamic #t12 = #t10.{self::A::-}(1) in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference_new/infer_assign_to_property_custom.dart:20:63: Error: A value of type 'dart.core::double' can't be assigned to a variable of type 'test::A'.
+ ^" in let final dynamic #t11 = #t8.{self::A::+}(1) in null in #t8;
+static field self::A v_postfix_mm = let final self::B #t12 = new self::B::•() in let final self::A #t13 = #t12.{self::B::a} in let final core::double #t14 = #t12.{self::B::a} = let final dynamic #t15 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference_new/infer_assign_to_property_custom.dart:20:63: Error: A value of type 'dart.core::double' can't be assigned to a variable of type 'test::A'.
Try changing the type of the left hand side, or casting the right hand side to 'test::A'.
var /*@topType=A*/ v_postfix_mm = (new B(). /*@target=B::a*/ a--);
- ^" in #t10;
+ ^" in let final dynamic #t16 = #t13.{self::A::-}(1) in null in #t13;
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference_new/infer_assign_to_property_custom.dart.strong.transformed.expect b/pkg/front_end/testcases/inference_new/infer_assign_to_property_custom.dart.strong.transformed.expect
index 0f3475e..ce574ee 100644
--- a/pkg/front_end/testcases/inference_new/infer_assign_to_property_custom.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference_new/infer_assign_to_property_custom.dart.strong.transformed.expect
@@ -17,20 +17,20 @@
: super core::Object::•()
;
}
-static field core::int v_prefix_pp = let final self::B #t1 = new self::B::•() in #t1.{self::B::a} = let final core::int #t2 = #t1.{self::B::a}.{self::A::+}(1) in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference_new/infer_assign_to_property_custom.dart:17:37: Error: A value of type 'dart.core::int' can't be assigned to a variable of type 'test::A'.
+static field core::int v_prefix_pp = let final self::B #t1 = new self::B::•() in #t1.{self::B::a} = let final dynamic #t2 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference_new/infer_assign_to_property_custom.dart:17:37: Error: A value of type 'dart.core::int' can't be assigned to a variable of type 'test::A'.
Try changing the type of the left hand side, or casting the right hand side to 'test::A'.
var /*@topType=int*/ v_prefix_pp = (++new B(). /*@target=B::a*/ a);
- ^";
-static field core::double v_prefix_mm = let final self::B #t3 = new self::B::•() in #t3.{self::B::a} = let final core::double #t4 = #t3.{self::B::a}.{self::A::-}(1) in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference_new/infer_assign_to_property_custom.dart:18:40: Error: A value of type 'dart.core::double' can't be assigned to a variable of type 'test::A'.
+ ^" in let final core::int #t3 = #t1.{self::B::a}.{self::A::+}(1) in null;
+static field core::double v_prefix_mm = let final self::B #t4 = new self::B::•() in #t4.{self::B::a} = let final dynamic #t5 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference_new/infer_assign_to_property_custom.dart:18:40: Error: A value of type 'dart.core::double' can't be assigned to a variable of type 'test::A'.
Try changing the type of the left hand side, or casting the right hand side to 'test::A'.
var /*@topType=double*/ v_prefix_mm = (--new B(). /*@target=B::a*/ a);
- ^";
-static field self::A v_postfix_pp = let final self::B #t5 = new self::B::•() in let final self::A #t6 = #t5.{self::B::a} in let final core::int #t7 = #t5.{self::B::a} = let final core::int #t8 = #t6.{self::A::+}(1) in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference_new/infer_assign_to_property_custom.dart:19:63: Error: A value of type 'dart.core::int' can't be assigned to a variable of type 'test::A'.
+ ^" in let final core::double #t6 = #t4.{self::B::a}.{self::A::-}(1) in null;
+static field self::A v_postfix_pp = let final self::B #t7 = new self::B::•() in let final self::A #t8 = #t7.{self::B::a} in let final core::int #t9 = #t7.{self::B::a} = let final dynamic #t10 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference_new/infer_assign_to_property_custom.dart:19:63: Error: A value of type 'dart.core::int' can't be assigned to a variable of type 'test::A'.
Try changing the type of the left hand side, or casting the right hand side to 'test::A'.
var /*@topType=A*/ v_postfix_pp = (new B(). /*@target=B::a*/ a++);
- ^" in #t6;
-static field self::A v_postfix_mm = let final self::B #t9 = new self::B::•() in let final self::A #t10 = #t9.{self::B::a} in let final core::double #t11 = #t9.{self::B::a} = let final core::double #t12 = #t10.{self::A::-}(1) in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference_new/infer_assign_to_property_custom.dart:20:63: Error: A value of type 'dart.core::double' can't be assigned to a variable of type 'test::A'.
+ ^" in let final core::int #t11 = #t8.{self::A::+}(1) in null in #t8;
+static field self::A v_postfix_mm = let final self::B #t12 = new self::B::•() in let final self::A #t13 = #t12.{self::B::a} in let final core::double #t14 = #t12.{self::B::a} = let final dynamic #t15 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference_new/infer_assign_to_property_custom.dart:20:63: Error: A value of type 'dart.core::double' can't be assigned to a variable of type 'test::A'.
Try changing the type of the left hand side, or casting the right hand side to 'test::A'.
var /*@topType=A*/ v_postfix_mm = (new B(). /*@target=B::a*/ a--);
- ^" in #t10;
+ ^" in let final core::double #t16 = #t13.{self::A::-}(1) in null in #t13;
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference_new/invalid_assignment_during_toplevel_inference.dart.strong.expect b/pkg/front_end/testcases/inference_new/invalid_assignment_during_toplevel_inference.dart.strong.expect
index 517380a..0be91a6 100644
--- a/pkg/front_end/testcases/inference_new/invalid_assignment_during_toplevel_inference.dart.strong.expect
+++ b/pkg/front_end/testcases/inference_new/invalid_assignment_during_toplevel_inference.dart.strong.expect
@@ -4,8 +4,8 @@
static field core::int i;
static field core::String s;
-static field core::String x = self::i = let final dynamic #t1 = self::s in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference_new/invalid_assignment_during_toplevel_inference.dart:9:62: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+static field core::String x = self::i = let final dynamic #t1 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/inference_new/invalid_assignment_during_toplevel_inference.dart:9:62: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
var /*@topType=String*/ x = i = /*@error=InvalidAssignment*/ s;
- ^";
+ ^" in let final dynamic #t2 = self::s in null;
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/inference_new/invalid_assignment_during_toplevel_inference.dart.strong.transformed.expect b/pkg/front_end/testcases/inference_new/invalid_assignment_during_toplevel_inference.dart.strong.transformed.expect
index 47d5c06..85fba5a 100644
--- a/pkg/front_end/testcases/inference_new/invalid_assignment_during_toplevel_inference.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/inference_new/invalid_assignment_during_toplevel_inference.dart.strong.transformed.expect
@@ -4,8 +4,8 @@
static field core::int i;
static field core::String s;
-static field core::String x = self::i = let final core::String #t1 = self::s in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference_new/invalid_assignment_during_toplevel_inference.dart:9:62: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+static field core::String x = self::i = let final dynamic #t1 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference_new/invalid_assignment_during_toplevel_inference.dart:9:62: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
var /*@topType=String*/ x = i = /*@error=InvalidAssignment*/ s;
- ^";
+ ^" in let final core::String #t2 = self::s in null;
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/invalid_assignment.dart.strong.expect b/pkg/front_end/testcases/invalid_assignment.dart.strong.expect
index 3d764da..f7f07a4 100644
--- a/pkg/front_end/testcases/invalid_assignment.dart.strong.expect
+++ b/pkg/front_end/testcases/invalid_assignment.dart.strong.expect
@@ -11,19 +11,19 @@
}
static method test(core::int i, core::String s, self::A a) → dynamic {
i = 1;
- i = let final dynamic #t1 = s in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/invalid_assignment.dart:13:36: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ i = let final dynamic #t1 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/invalid_assignment.dart:13:36: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
i = /*@error=InvalidAssignment*/ s;
- ^";
+ ^" in let final dynamic #t2 = s in null;
i.{core::num::==}(null) ?{core::int} i = 1 : null;
- i.{core::num::==}(null) ?{core::Object} i = let final dynamic #t2 = s in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/invalid_assignment.dart:15:38: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ i.{core::num::==}(null) ?{core::Object} i = let final dynamic #t3 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/invalid_assignment.dart:15:38: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
i ??= /*@error=InvalidAssignment*/ s;
- ^" : null;
+ ^" in let final dynamic #t4 = s in null : null;
a = new self::A::•();
- a = let final dynamic #t3 = a.{self::A::+}(1) in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/invalid_assignment.dart:17:34: Error: A value of type 'dart.core::String' can't be assigned to a variable of type '#lib1::A'.
+ a = let final dynamic #t5 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/invalid_assignment.dart:17:34: Error: A value of type 'dart.core::String' can't be assigned to a variable of type '#lib1::A'.
Try changing the type of the left hand side, or casting the right hand side to '#lib1::A'.
a /*@error=InvalidAssignment*/ += 1;
- ^";
+ ^" in let final dynamic #t6 = a.{self::A::+}(1) in null;
}
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/invalid_assignment.dart.strong.transformed.expect b/pkg/front_end/testcases/invalid_assignment.dart.strong.transformed.expect
index a29230a..dcb2006 100644
--- a/pkg/front_end/testcases/invalid_assignment.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/invalid_assignment.dart.strong.transformed.expect
@@ -11,19 +11,19 @@
}
static method test(core::int i, core::String s, self::A a) → dynamic {
i = 1;
- i = let final core::String #t1 = s in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/invalid_assignment.dart:13:36: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ i = let final dynamic #t1 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/invalid_assignment.dart:13:36: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
i = /*@error=InvalidAssignment*/ s;
- ^";
+ ^" in let final core::String #t2 = s in null;
i.{core::num::==}(null) ?{core::int} i = 1 : null;
- i.{core::num::==}(null) ?{core::Object} i = let final core::String #t2 = s in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/invalid_assignment.dart:15:38: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
+ i.{core::num::==}(null) ?{core::Object} i = let final dynamic #t3 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/invalid_assignment.dart:15:38: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
i ??= /*@error=InvalidAssignment*/ s;
- ^" : null;
+ ^" in let final core::String #t4 = s in null : null;
a = new self::A::•();
- a = let final core::String #t3 = a.{self::A::+}(1) in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/invalid_assignment.dart:17:34: Error: A value of type 'dart.core::String' can't be assigned to a variable of type '#lib1::A'.
+ a = let final dynamic #t5 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/invalid_assignment.dart:17:34: Error: A value of type 'dart.core::String' can't be assigned to a variable of type '#lib1::A'.
Try changing the type of the left hand side, or casting the right hand side to '#lib1::A'.
a /*@error=InvalidAssignment*/ += 1;
- ^";
+ ^" in let final core::String #t6 = a.{self::A::+}(1) in null;
}
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/invalid_cast.dart.strong.expect b/pkg/front_end/testcases/invalid_cast.dart.strong.expect
index 502c68ac..df83aa8 100644
--- a/pkg/front_end/testcases/invalid_cast.dart.strong.expect
+++ b/pkg/front_end/testcases/invalid_cast.dart.strong.expect
@@ -27,44 +27,44 @@
static method topLevelFunction(core::int i) → void {}
static method bad() → dynamic {
function localFunction(core::int i) → void {}
- core::List<core::int> a = let final dynamic #t1 = <core::Object>[] in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/invalid_cast.dart:22:60: Error: The list literal type 'dart.core::List<dart.core::Object>' isn't of expected type 'dart.core::List<dart.core::int>'.
+ core::List<core::int> a = let final dynamic #t1 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/invalid_cast.dart:22:60: Error: The list literal type 'dart.core::List<dart.core::Object>' isn't of expected type 'dart.core::List<dart.core::int>'.
Change the type of the list literal or the context in which it is used.
List<int> a = <Object> /*@error=InvalidCastLiteralList*/ [];
- ^";
- core::Map<core::int, core::String> b = let final dynamic #t2 = <core::Object, core::String>{} in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/invalid_cast.dart:23:74: Error: The map literal type 'dart.core::Map<dart.core::Object, dart.core::String>' isn't of expected type 'dart.core::Map<dart.core::int, dart.core::String>'.
+ ^" in let final dynamic #t2 = <core::Object>[] in null;
+ core::Map<core::int, core::String> b = let final dynamic #t3 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/invalid_cast.dart:23:74: Error: The map literal type 'dart.core::Map<dart.core::Object, dart.core::String>' isn't of expected type 'dart.core::Map<dart.core::int, dart.core::String>'.
Change the type of the map literal or the context in which it is used.
Map<int, String> b = <Object, String> /*@error=InvalidCastLiteralMap*/ {};
- ^";
- core::Map<core::int, core::String> c = let final dynamic #t3 = <core::int, core::Object>{} in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/invalid_cast.dart:24:71: Error: The map literal type 'dart.core::Map<dart.core::int, dart.core::Object>' isn't of expected type 'dart.core::Map<dart.core::int, dart.core::String>'.
+ ^" in let final dynamic #t4 = <core::Object, core::String>{} in null;
+ core::Map<core::int, core::String> c = let final dynamic #t5 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/invalid_cast.dart:24:71: Error: The map literal type 'dart.core::Map<dart.core::int, dart.core::Object>' isn't of expected type 'dart.core::Map<dart.core::int, dart.core::String>'.
Change the type of the map literal or the context in which it is used.
Map<int, String> c = <int, Object> /*@error=InvalidCastLiteralMap*/ {};
- ^";
- (core::Object) → core::int d = let final dynamic #t4 = (core::int i) → core::int => i in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/invalid_cast.dart:25:63: Error: The function expression type '(dart.core::int) \u8594 dart.core::int' isn't of expected type '(dart.core::Object) \u8594 dart.core::int'.
+ ^" in let final dynamic #t6 = <core::int, core::Object>{} in null;
+ (core::Object) → core::int d = let final dynamic #t7 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/invalid_cast.dart:25:63: Error: The function expression type '(dart.core::int) \u8594 dart.core::int' isn't of expected type '(dart.core::Object) \u8594 dart.core::int'.
Change the type of the function expression or the context in which it is used.
int Function(Object) d = /*@error=InvalidCastFunctionExpr*/ (int i) => i;
- ^";
+ ^" in let final dynamic #t8 = (core::int i) → core::int => i in null;
self::D e = self::C::fact() as{TypeError} self::D;
self::D f = new self::D::•() as{TypeError} self::D;
- self::D g = let final dynamic #t5 = new self::C::nonFact() in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/invalid_cast.dart:28:43: Error: The constructor returns type '#lib1::C' that isn't of expected type '#lib1::D'.
+ self::D g = let final dynamic #t9 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/invalid_cast.dart:28:43: Error: The constructor returns type '#lib1::C' that isn't of expected type '#lib1::D'.
Change the type of the object being constructed or the context in which it is used.
D g = new /*@error=InvalidCastNewExpr*/ C.nonFact();
- ^";
- self::D h = let final dynamic #t6 = new self::C::nonFact2() in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/invalid_cast.dart:29:43: Error: The constructor returns type '#lib1::C' that isn't of expected type '#lib1::D'.
+ ^" in let final dynamic #t10 = new self::C::nonFact() in null;
+ self::D h = let final dynamic #t11 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/invalid_cast.dart:29:43: Error: The constructor returns type '#lib1::C' that isn't of expected type '#lib1::D'.
Change the type of the object being constructed or the context in which it is used.
D h = new /*@error=InvalidCastNewExpr*/ C.nonFact2();
- ^";
- (core::Object) → void i = let final dynamic #t7 = self::C::staticFunction in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/invalid_cast.dart:31:45: Error: The static method has type '(dart.core::int) \u8594 void' that isn't of expected type '(dart.core::Object) \u8594 void'.
+ ^" in let final dynamic #t12 = new self::C::nonFact2() in null;
+ (core::Object) → void i = let final dynamic #t13 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/invalid_cast.dart:31:45: Error: The static method has type '(dart.core::int) \u8594 void' that isn't of expected type '(dart.core::Object) \u8594 void'.
Change the type of the method or the context in which it is used.
C. /*@error=InvalidCastStaticMethod*/ staticFunction;
- ^";
- (core::Object) → void j = let final dynamic #t8 = self::topLevelFunction in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/invalid_cast.dart:33:50: Error: The top level function has type '(dart.core::int) \u8594 void' that isn't of expected type '(dart.core::Object) \u8594 void'.
+ ^" in let final dynamic #t14 = self::C::staticFunction in null;
+ (core::Object) → void j = let final dynamic #t15 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/invalid_cast.dart:33:50: Error: The top level function has type '(dart.core::int) \u8594 void' that isn't of expected type '(dart.core::Object) \u8594 void'.
Change the type of the function or the context in which it is used.
j = /*@error=InvalidCastTopLevelFunction*/ topLevelFunction;
- ^";
- (core::Object) → void k = let final dynamic #t9 = localFunction in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/invalid_cast.dart:34:65: Error: The local function has type '(dart.core::int) \u8594 void' that isn't of expected type '(dart.core::Object) \u8594 void'.
+ ^" in let final dynamic #t16 = self::topLevelFunction in null;
+ (core::Object) → void k = let final dynamic #t17 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/invalid_cast.dart:34:65: Error: The local function has type '(dart.core::int) \u8594 void' that isn't of expected type '(dart.core::Object) \u8594 void'.
Change the type of the function or the context in which it is used.
void Function(Object) k = /*@error=InvalidCastLocalFunction*/ localFunction;
- ^";
+ ^" in let final dynamic #t18 = localFunction in null;
}
static method ok() → dynamic {
function localFunction(core::int i) → void {}
diff --git a/pkg/front_end/testcases/invalid_cast.dart.strong.transformed.expect b/pkg/front_end/testcases/invalid_cast.dart.strong.transformed.expect
index 1fe3674..858df4a 100644
--- a/pkg/front_end/testcases/invalid_cast.dart.strong.transformed.expect
+++ b/pkg/front_end/testcases/invalid_cast.dart.strong.transformed.expect
@@ -27,44 +27,44 @@
static method topLevelFunction(core::int i) → void {}
static method bad() → dynamic {
function localFunction(core::int i) → void {}
- core::List<core::int> a = let final core::List<core::Object> #t1 = <core::Object>[] in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/invalid_cast.dart:22:60: Error: The list literal type 'dart.core::List<dart.core::Object>' isn't of expected type 'dart.core::List<dart.core::int>'.
+ core::List<core::int> a = let final dynamic #t1 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/invalid_cast.dart:22:60: Error: The list literal type 'dart.core::List<dart.core::Object>' isn't of expected type 'dart.core::List<dart.core::int>'.
Change the type of the list literal or the context in which it is used.
List<int> a = <Object> /*@error=InvalidCastLiteralList*/ [];
- ^";
- core::Map<core::int, core::String> b = let final core::Map<core::Object, core::String> #t2 = <core::Object, core::String>{} in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/invalid_cast.dart:23:74: Error: The map literal type 'dart.core::Map<dart.core::Object, dart.core::String>' isn't of expected type 'dart.core::Map<dart.core::int, dart.core::String>'.
+ ^" in let final core::List<core::Object> #t2 = <core::Object>[] in null;
+ core::Map<core::int, core::String> b = let final dynamic #t3 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/invalid_cast.dart:23:74: Error: The map literal type 'dart.core::Map<dart.core::Object, dart.core::String>' isn't of expected type 'dart.core::Map<dart.core::int, dart.core::String>'.
Change the type of the map literal or the context in which it is used.
Map<int, String> b = <Object, String> /*@error=InvalidCastLiteralMap*/ {};
- ^";
- core::Map<core::int, core::String> c = let final core::Map<core::int, core::Object> #t3 = <core::int, core::Object>{} in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/invalid_cast.dart:24:71: Error: The map literal type 'dart.core::Map<dart.core::int, dart.core::Object>' isn't of expected type 'dart.core::Map<dart.core::int, dart.core::String>'.
+ ^" in let final core::Map<core::Object, core::String> #t4 = <core::Object, core::String>{} in null;
+ core::Map<core::int, core::String> c = let final dynamic #t5 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/invalid_cast.dart:24:71: Error: The map literal type 'dart.core::Map<dart.core::int, dart.core::Object>' isn't of expected type 'dart.core::Map<dart.core::int, dart.core::String>'.
Change the type of the map literal or the context in which it is used.
Map<int, String> c = <int, Object> /*@error=InvalidCastLiteralMap*/ {};
- ^";
- (core::Object) → core::int d = let final (core::int) → core::int #t4 = (core::int i) → core::int => i in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/invalid_cast.dart:25:63: Error: The function expression type '(dart.core::int) \u8594 dart.core::int' isn't of expected type '(dart.core::Object) \u8594 dart.core::int'.
+ ^" in let final core::Map<core::int, core::Object> #t6 = <core::int, core::Object>{} in null;
+ (core::Object) → core::int d = let final dynamic #t7 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/invalid_cast.dart:25:63: Error: The function expression type '(dart.core::int) \u8594 dart.core::int' isn't of expected type '(dart.core::Object) \u8594 dart.core::int'.
Change the type of the function expression or the context in which it is used.
int Function(Object) d = /*@error=InvalidCastFunctionExpr*/ (int i) => i;
- ^";
+ ^" in let final (core::int) → core::int #t8 = (core::int i) → core::int => i in null;
self::D e = self::C::fact() as{TypeError} self::D;
self::D f = new self::D::•() as{TypeError} self::D;
- self::D g = let final self::C #t5 = new self::C::nonFact() in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/invalid_cast.dart:28:43: Error: The constructor returns type '#lib1::C' that isn't of expected type '#lib1::D'.
+ self::D g = let final dynamic #t9 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/invalid_cast.dart:28:43: Error: The constructor returns type '#lib1::C' that isn't of expected type '#lib1::D'.
Change the type of the object being constructed or the context in which it is used.
D g = new /*@error=InvalidCastNewExpr*/ C.nonFact();
- ^";
- self::D h = let final self::C #t6 = new self::C::nonFact2() in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/invalid_cast.dart:29:43: Error: The constructor returns type '#lib1::C' that isn't of expected type '#lib1::D'.
+ ^" in let final self::C #t10 = new self::C::nonFact() in null;
+ self::D h = let final dynamic #t11 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/invalid_cast.dart:29:43: Error: The constructor returns type '#lib1::C' that isn't of expected type '#lib1::D'.
Change the type of the object being constructed or the context in which it is used.
D h = new /*@error=InvalidCastNewExpr*/ C.nonFact2();
- ^";
- (core::Object) → void i = let final (core::int) → void #t7 = self::C::staticFunction in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/invalid_cast.dart:31:45: Error: The static method has type '(dart.core::int) \u8594 void' that isn't of expected type '(dart.core::Object) \u8594 void'.
+ ^" in let final self::C #t12 = new self::C::nonFact2() in null;
+ (core::Object) → void i = let final dynamic #t13 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/invalid_cast.dart:31:45: Error: The static method has type '(dart.core::int) \u8594 void' that isn't of expected type '(dart.core::Object) \u8594 void'.
Change the type of the method or the context in which it is used.
C. /*@error=InvalidCastStaticMethod*/ staticFunction;
- ^";
- (core::Object) → void j = let final (core::int) → void #t8 = self::topLevelFunction in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/invalid_cast.dart:33:50: Error: The top level function has type '(dart.core::int) \u8594 void' that isn't of expected type '(dart.core::Object) \u8594 void'.
+ ^" in let final (core::int) → void #t14 = self::C::staticFunction in null;
+ (core::Object) → void j = let final dynamic #t15 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/invalid_cast.dart:33:50: Error: The top level function has type '(dart.core::int) \u8594 void' that isn't of expected type '(dart.core::Object) \u8594 void'.
Change the type of the function or the context in which it is used.
j = /*@error=InvalidCastTopLevelFunction*/ topLevelFunction;
- ^";
- (core::Object) → void k = let final (core::int) → void #t9 = localFunction in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/invalid_cast.dart:34:65: Error: The local function has type '(dart.core::int) \u8594 void' that isn't of expected type '(dart.core::Object) \u8594 void'.
+ ^" in let final (core::int) → void #t16 = self::topLevelFunction in null;
+ (core::Object) → void k = let final dynamic #t17 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/invalid_cast.dart:34:65: Error: The local function has type '(dart.core::int) \u8594 void' that isn't of expected type '(dart.core::Object) \u8594 void'.
Change the type of the function or the context in which it is used.
void Function(Object) k = /*@error=InvalidCastLocalFunction*/ localFunction;
- ^";
+ ^" in let final (core::int) → void #t18 = localFunction in null;
}
static method ok() → dynamic {
function localFunction(core::int i) → 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 910fa36..db3b854 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
@@ -5,10 +5,10 @@
class Foo<T extends core::Object> 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 = _init in 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'.
+ : 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'.
Try changing the type of the left hand side, or casting the right hand side to '#lib1::Foo::T'.
Foo.from(String _init) : this._internal(x: _init);
- ^")
+ ^" in let final dynamic #t2 = _init in null)
;
constructor _internal({self::Foo::T x = null}) → void
: self::Foo::x = x, super core::Object::•()
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 910fa36..db3b854 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
@@ -5,10 +5,10 @@
class Foo<T extends core::Object> 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 = _init in 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'.
+ : 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'.
Try changing the type of the left hand side, or casting the right hand side to '#lib1::Foo::T'.
Foo.from(String _init) : this._internal(x: _init);
- ^")
+ ^" in let final dynamic #t2 = _init in null)
;
constructor _internal({self::Foo::T x = null}) → void
: self::Foo::x = x, super core::Object::•()
diff --git a/pkg/front_end/testcases/runtime_checks/call_kinds.dart b/pkg/front_end/testcases/runtime_checks/call_kinds.dart
index 3a11fdf..b0006ce 100644
--- a/pkg/front_end/testcases/runtime_checks/call_kinds.dart
+++ b/pkg/front_end/testcases/runtime_checks/call_kinds.dart
@@ -13,16 +13,16 @@
dynamic get h => null;
void test() {
// Call via this
- f /*@callKind=this*/ ();
- this.f /*@callKind=this*/ ();
+ f();
+ this.f();
// Get via this, then closure invocation
- g /*@callKind=closure*/ ();
- this.g /*@callKind=closure*/ ();
+ g();
+ this.g();
// Get via this, then dynamic invocation
- h /*@callKind=dynamic*/ ();
- this.h /*@callKind=dynamic*/ ();
+ h();
+ this.h();
}
}
@@ -31,19 +31,19 @@
c.f();
// Closure invocation
- f /*@callKind=closure*/ ();
+ f();
// Dynamic call
- d /*@callKind=dynamic*/ ();
+ d();
// Dynamic call
- d.f /*@callKind=dynamic*/ ();
+ d.f();
// Get via interface, then closure invocation
- c.g /*@callKind=closure*/ ();
+ c.g();
// Get via interface, then dynamic invocation
- c.h /*@callKind=dynamic*/ ();
+ c.h();
}
main() {}
diff --git a/pkg/front_end/testcases/runtime_checks/call_kinds_get.dart b/pkg/front_end/testcases/runtime_checks/call_kinds_get.dart
index 17701d5..ed8556e 100644
--- a/pkg/front_end/testcases/runtime_checks/call_kinds_get.dart
+++ b/pkg/front_end/testcases/runtime_checks/call_kinds_get.dart
@@ -10,10 +10,10 @@
dynamic y;
void test() {
// Get via this
- var v1 = /*@callKind=this*/ x;
- var v2 = this. /*@callKind=this*/ x;
- var v3 = /*@callKind=this*/ y;
- var v4 = this. /*@callKind=this*/ y;
+ var v1 = x;
+ var v2 = this.x;
+ var v3 = y;
+ var v4 = this.y;
}
}
@@ -23,7 +23,7 @@
var v2 = c.y;
// Dynamic get
- var v3 = d. /*@callKind=dynamic*/ x;
+ var v3 = d.x;
}
main() {}
diff --git a/pkg/front_end/testcases/runtime_checks/call_kinds_set.dart b/pkg/front_end/testcases/runtime_checks/call_kinds_set.dart
index 7b2a695..2072ab6 100644
--- a/pkg/front_end/testcases/runtime_checks/call_kinds_set.dart
+++ b/pkg/front_end/testcases/runtime_checks/call_kinds_set.dart
@@ -10,10 +10,10 @@
dynamic y;
void test() {
// Set via this
- /*@callKind=this*/ x = null;
- this. /*@callKind=this*/ x = null;
- /*@callKind=this*/ y = null;
- this. /*@callKind=this*/ y = null;
+ x = null;
+ this.x = null;
+ y = null;
+ this.y = null;
}
}
@@ -23,7 +23,7 @@
c.y = null;
// Dynamic set
- d. /*@callKind=dynamic*/ x = null;
+ d.x = null;
}
main() {}
diff --git a/pkg/front_end/testcases/runtime_checks/contravariant_field.dart b/pkg/front_end/testcases/runtime_checks/contravariant_field.dart
index 73392ad..c730901 100644
--- a/pkg/front_end/testcases/runtime_checks/contravariant_field.dart
+++ b/pkg/front_end/testcases/runtime_checks/contravariant_field.dart
@@ -10,7 +10,7 @@
class C<T> {
F<T> /*@genericContravariant=true*/ y;
void f() {
- var x = this. /*@callKind=this*/ y;
+ var x = this.y;
}
}
diff --git a/pkg/front_end/testcases/runtime_checks/contravariant_generic_return.dart b/pkg/front_end/testcases/runtime_checks/contravariant_generic_return.dart
index 2909fad..12df74a 100644
--- a/pkg/front_end/testcases/runtime_checks/contravariant_generic_return.dart
+++ b/pkg/front_end/testcases/runtime_checks/contravariant_generic_return.dart
@@ -10,19 +10,19 @@
class C<T> {
F<T> /*@genericContravariant=true*/ f1() {}
List<F<T>> /*@genericContravariant=true*/ f2() {
- return [this.f1 /*@callKind=this*/ ()];
+ return [this.f1()];
}
}
void g1(C<num> c) {
var x = c.f1 /*@checkReturn=(num) -> void*/ ();
print('hello');
- x /*@callKind=closure*/ (1.5);
+ x(1.5);
}
void g2(C<num> c) {
F<int> x = c.f1 /*@checkReturn=(num) -> void*/ ();
- x /*@callKind=closure*/ (1);
+ x(1);
}
void g3(C<num> c) {
diff --git a/pkg/front_end/testcases/runtime_checks/contravariant_generic_return_null_aware.dart b/pkg/front_end/testcases/runtime_checks/contravariant_generic_return_null_aware.dart
index 1a30794..0531ccf 100644
--- a/pkg/front_end/testcases/runtime_checks/contravariant_generic_return_null_aware.dart
+++ b/pkg/front_end/testcases/runtime_checks/contravariant_generic_return_null_aware.dart
@@ -10,19 +10,19 @@
class C<T> {
F<T> /*@genericContravariant=true*/ f1() {}
List<F<T>> /*@genericContravariant=true*/ f2() {
- return [this?.f1 /*@callKind=this*/ ()];
+ return [this?.f1()];
}
}
void g1(C<num> c) {
var x = c?.f1 /*@checkReturn=(num) -> void*/ ();
print('hello');
- x /*@callKind=closure*/ (1.5);
+ x(1.5);
}
void g2(C<num> c) {
F<int> x = c?.f1 /*@checkReturn=(num) -> void*/ ();
- x /*@callKind=closure*/ (1);
+ x(1);
}
void g3(C<num> c) {
diff --git a/pkg/front_end/testcases/runtime_checks/contravariant_generic_return_tear_off.dart b/pkg/front_end/testcases/runtime_checks/contravariant_generic_return_tear_off.dart
index 18a5a6c..e0de24f 100644
--- a/pkg/front_end/testcases/runtime_checks/contravariant_generic_return_tear_off.dart
+++ b/pkg/front_end/testcases/runtime_checks/contravariant_generic_return_tear_off.dart
@@ -11,7 +11,7 @@
class C<T> {
F<T> /*@genericContravariant=true*/ _x;
C(this._x);
- F<T> /*@genericContravariant=true*/ f() => /*@callKind=this*/ _x;
+ F<T> /*@genericContravariant=true*/ f() => _x;
}
G<num> g(C<num> c) {
diff --git a/pkg/front_end/testcases/runtime_checks/contravariant_getter.dart b/pkg/front_end/testcases/runtime_checks/contravariant_getter.dart
index fd31eb2..cebae23 100644
--- a/pkg/front_end/testcases/runtime_checks/contravariant_getter.dart
+++ b/pkg/front_end/testcases/runtime_checks/contravariant_getter.dart
@@ -10,12 +10,12 @@
class C<T> {
F<T> /*@genericContravariant=true*/ y;
void f(T /*@covariance=genericInterface, genericImpl*/ value) {
- this.y /*@callKind=closure*/ (value);
+ this.y(value);
}
}
void g(C<num> c) {
- c.y /*@checkGetterReturn=(num) -> void*/ /*@callKind=closure*/ (1.5);
+ c.y /*@checkGetterReturn=(num) -> void*/ (1.5);
}
void main() {}
diff --git a/pkg/front_end/testcases/runtime_checks/contravariant_getter_return.dart b/pkg/front_end/testcases/runtime_checks/contravariant_getter_return.dart
index cd22b0e..9f1f536 100644
--- a/pkg/front_end/testcases/runtime_checks/contravariant_getter_return.dart
+++ b/pkg/front_end/testcases/runtime_checks/contravariant_getter_return.dart
@@ -10,19 +10,19 @@
class C<T> {
F<T> get /*@genericContravariant=true*/ f1 => null;
List<F<T>> get /*@genericContravariant=true*/ f2 {
- return [this. /*@callKind=this*/ f1];
+ return [this.f1];
}
}
void g1(C<num> c) {
var x = c. /*@checkReturn=(num) -> void*/ f1;
print('hello');
- x /*@callKind=closure*/ (1.5);
+ x(1.5);
}
void g2(C<num> c) {
F<int> x = c. /*@checkReturn=(num) -> void*/ f1;
- x /*@callKind=closure*/ (1);
+ x(1);
}
void g3(C<num> c) {
diff --git a/pkg/front_end/testcases/runtime_checks/contravariant_getter_return_null_aware.dart b/pkg/front_end/testcases/runtime_checks/contravariant_getter_return_null_aware.dart
index 183818d..546563d 100644
--- a/pkg/front_end/testcases/runtime_checks/contravariant_getter_return_null_aware.dart
+++ b/pkg/front_end/testcases/runtime_checks/contravariant_getter_return_null_aware.dart
@@ -10,19 +10,19 @@
class C<T> {
F<T> get /*@genericContravariant=true*/ f1 => null;
List<F<T>> get /*@genericContravariant=true*/ f2 {
- return [this?. /*@callKind=this*/ f1];
+ return [this?.f1];
}
}
void g1(C<num> c) {
var x = c?. /*@checkReturn=(num) -> void*/ f1;
print('hello');
- x /*@callKind=closure*/ (1.5);
+ x(1.5);
}
void g2(C<num> c) {
F<int> x = c?. /*@checkReturn=(num) -> void*/ f1;
- x /*@callKind=closure*/ (1);
+ x(1);
}
void g3(C<num> c) {
diff --git a/pkg/front_end/testcases/runtime_checks/covariant_generic_method_type_parameter.dart b/pkg/front_end/testcases/runtime_checks/covariant_generic_method_type_parameter.dart
index 4c73719..c3749e6 100644
--- a/pkg/front_end/testcases/runtime_checks/covariant_generic_method_type_parameter.dart
+++ b/pkg/front_end/testcases/runtime_checks/covariant_generic_method_type_parameter.dart
@@ -8,7 +8,7 @@
class C<T> {
void f< /*@covariance=genericInterface, genericImpl*/ U extends T>(U x) {}
void g1< /*@covariance=genericInterface, genericImpl*/ U extends T>() {
- this.f<U> /*@callKind=this*/ (1.5);
+ this.f<U>(1.5);
}
}
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 2c32b19..73a7f87 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
@@ -8,10 +8,10 @@
;
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 {
- this.{self::C::f}<self::C::g1::U>(let final dynamic #t1 = 1.5 in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/runtime_checks/covariant_generic_method_type_parameter.dart:11:35: Error: A value of type 'dart.core::double' can't be assigned to a variable of type 'test::C::g1::U'.
+ 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> /*@callKind=this*/ (1.5);
- ^");
+ this.f<U>(1.5);
+ ^" in let final dynamic #t2 = 1.5 in null);
}
}
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.transformed.expect b/pkg/front_end/testcases/runtime_checks/covariant_generic_method_type_parameter.dart.strong.transformed.expect
index f17aa36..25a05fa 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
@@ -8,10 +8,10 @@
;
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 {
- this.{self::C::f}<self::C::g1::U>(let final core::double #t1 = 1.5 in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/runtime_checks/covariant_generic_method_type_parameter.dart:11:35: Error: A value of type 'dart.core::double' can't be assigned to a variable of type 'test::C::g1::U'.
+ 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> /*@callKind=this*/ (1.5);
- ^");
+ this.f<U>(1.5);
+ ^" in let final core::double #t2 = 1.5 in null);
}
}
static method g2(self::C<core::Object> c) → void {
diff --git a/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter_tear_off.dart b/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter_tear_off.dart
index 7a326e8..4c4138d 100644
--- a/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter_tear_off.dart
+++ b/pkg/front_end/testcases/runtime_checks/covariant_generic_parameter_tear_off.dart
@@ -20,7 +20,7 @@
void g2(C<int> c, Object x) {
F<Object> f = g1(c) as F<Object>;
- f /*@callKind=closure*/ (x);
+ f(x);
}
G<List<num>, num> g3(C<num> c) {
@@ -29,7 +29,7 @@
void test() {
var x = g1(new C<int>());
- x /*@callKind=closure*/ (1.5);
+ x(1.5);
g3(new C<int>());
}
diff --git a/pkg/front_end/testcases/runtime_checks/covariant_setter.dart b/pkg/front_end/testcases/runtime_checks/covariant_setter.dart
index bd9c289..219d715 100644
--- a/pkg/front_end/testcases/runtime_checks/covariant_setter.dart
+++ b/pkg/front_end/testcases/runtime_checks/covariant_setter.dart
@@ -11,8 +11,8 @@
T /*@covariance=genericInterface, genericImpl*/ x;
void set y(T /*@covariance=genericInterface, genericImpl*/ value) {}
void f(T /*@covariance=genericInterface, genericImpl*/ value) {
- this. /*@callKind=this*/ x = value;
- this. /*@callKind=this*/ y = value;
+ this.x = value;
+ this.y = value;
}
}
diff --git a/pkg/front_end/testcases/runtime_checks/dynamic_invocation.dart b/pkg/front_end/testcases/runtime_checks/dynamic_invocation.dart
index 79e90e8..e8d1ea9 100644
--- a/pkg/front_end/testcases/runtime_checks/dynamic_invocation.dart
+++ b/pkg/front_end/testcases/runtime_checks/dynamic_invocation.dart
@@ -15,11 +15,11 @@
}
void g1(dynamic d) {
- d.f1 /*@callKind=dynamic*/ (1.5);
+ d.f1(1.5);
}
void g2(dynamic d) {
- d.f2 /*@callKind=dynamic*/ (1.5);
+ d.f2(1.5);
}
void test() {
diff --git a/pkg/front_end/testcases/runtime_checks/dynamic_invocation_generic.dart b/pkg/front_end/testcases/runtime_checks/dynamic_invocation_generic.dart
index 5da529b..803cd00 100644
--- a/pkg/front_end/testcases/runtime_checks/dynamic_invocation_generic.dart
+++ b/pkg/front_end/testcases/runtime_checks/dynamic_invocation_generic.dart
@@ -10,11 +10,11 @@
}
void g1(dynamic d) {
- d.f<num> /*@callKind=dynamic*/ (1.5);
+ d.f<num>(1.5);
}
void g2(dynamic d) {
- d.f /*@callKind=dynamic*/ (1.5);
+ d.f(1.5);
}
void test() {
diff --git a/pkg/front_end/testcases/runtime_checks/dynamic_invocation_of_getter.dart b/pkg/front_end/testcases/runtime_checks/dynamic_invocation_of_getter.dart
index 0cd7fbe..7c7fe48 100644
--- a/pkg/front_end/testcases/runtime_checks/dynamic_invocation_of_getter.dart
+++ b/pkg/front_end/testcases/runtime_checks/dynamic_invocation_of_getter.dart
@@ -11,7 +11,7 @@
}
void g(C c) {
- c.f /*@callKind=dynamic*/ (1.5);
+ c.f(1.5);
}
void h(int i) {}
diff --git a/pkg/front_end/testcases/runtime_checks/forwarding_stub_with_default_values.dart b/pkg/front_end/testcases/runtime_checks/forwarding_stub_with_default_values.dart
index 6adf661..89615d8 100644
--- a/pkg/front_end/testcases/runtime_checks/forwarding_stub_with_default_values.dart
+++ b/pkg/front_end/testcases/runtime_checks/forwarding_stub_with_default_values.dart
@@ -8,16 +8,16 @@
class B {
Object _x;
void f([num x = 10]) {
- /*@callKind=this*/ _x = x;
+ _x = x;
}
void g({num x = 20}) {
- /*@callKind=this*/ _x = x;
+ _x = x;
}
void check(Object expectedValue) {
- if (/*@callKind=this*/ _x != expectedValue) {
- throw 'Expected _x == $expectedValue; got ${/*@callKind=this*/_x}';
+ if (_x != expectedValue) {
+ throw 'Expected _x == $expectedValue; got ${_x}';
}
}
}
diff --git a/pkg/front_end/testcases/runtime_checks_new/call_through_this.dart b/pkg/front_end/testcases/runtime_checks_new/call_through_this.dart
index 17066cb..4f77378 100644
--- a/pkg/front_end/testcases/runtime_checks_new/call_through_this.dart
+++ b/pkg/front_end/testcases/runtime_checks_new/call_through_this.dart
@@ -10,11 +10,11 @@
class C<T> {
void f(T /*@covariance=genericInterface, genericImpl*/ x) {}
void g1(T /*@covariance=genericInterface, genericImpl*/ x) {
- this.f /*@callKind=this*/ (x);
+ this.f(x);
}
void g2(T /*@covariance=genericInterface, genericImpl*/ x) {
- f /*@callKind=this*/ (x);
+ f(x);
}
void g3(C<T> /*@covariance=genericInterface, genericImpl*/ c,
@@ -22,7 +22,7 @@
c.f(x);
}
- F<T> /*@genericContravariant=true*/ g4() => this. /*@callKind=this*/ f;
+ F<T> /*@genericContravariant=true*/ g4() => this.f;
}
class
@@ -43,7 +43,7 @@
test() {
var x = new D().g4() as F<Object>;
- x /*@callKind=closure*/ ('hi');
+ x('hi');
new E().g1(1.5);
}
diff --git a/pkg/front_end/testcases/runtime_checks_new/contravariant_generic_return_with_compound_assign_implicit_downcast.dart b/pkg/front_end/testcases/runtime_checks_new/contravariant_generic_return_with_compound_assign_implicit_downcast.dart
index 5ac5bbb..ea84715 100644
--- a/pkg/front_end/testcases/runtime_checks_new/contravariant_generic_return_with_compound_assign_implicit_downcast.dart
+++ b/pkg/front_end/testcases/runtime_checks_new/contravariant_generic_return_with_compound_assign_implicit_downcast.dart
@@ -7,7 +7,7 @@
void expectTypeError(void callback()) {
try {
- callback /*@callKind=closure*/ ();
+ callback();
throw 'Expected TypeError, did not occur';
} on TypeError {}
}
@@ -21,17 +21,17 @@
class C<T> {
C(this.plusResult);
final num Function(T) /*@genericContravariant=true*/ plusResult;
- num Function(T) operator /*@genericContravariant=true*/ +(
- int i) => /*@callKind=this*/ plusResult;
+ num Function(T) operator /*@genericContravariant=true*/ +(int i) =>
+ plusResult;
}
class D {
D(this.getValue);
final C<num> getValue;
- C<num> get value => /*@callKind=this*/ getValue;
+ C<num> get value => getValue;
int Function(int) setValue;
void set value(int Function(int) value) {
- /*@callKind=this*/ setValue = value;
+ setValue = value;
}
}
@@ -48,7 +48,7 @@
// (num)->num
D d = new D(new C(numToInt));
d.value /*@checkReturn=(num) -> num*/ += 1;
- expect(d.setValue /*@callKind=closure*/ (0), 1);
+ expect(d.setValue(0), 1);
d = new D(new C(numToNum));
expectTypeError(() {
d.value /*@checkReturn=(num) -> num*/ += 1;
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 366750a..3a6e93a 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
@@ -41,17 +41,17 @@
return 2;
static method main() → void {
self::D d = new self::D::•(new self::C::•<core::num>(self::numToInt));
- let final self::D #t1 = d in #t1.{self::D::value} = let final dynamic #t2 = #t1.{self::D::value}.{self::C::+}(1) as{TypeError} (core::num) → core::num in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/runtime_checks_new/contravariant_generic_return_with_compound_assign_implicit_downcast.dart:50:41: Error: A value of type '(dart.core::num) \u8594 dart.core::num' can't be assigned to a variable of type '(dart.core::int) \u8594 dart.core::int'.
+ let final self::D #t1 = d in #t1.{self::D::value} = let final dynamic #t2 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/runtime_checks_new/contravariant_generic_return_with_compound_assign_implicit_downcast.dart:50:41: Error: A value of type '(dart.core::num) \u8594 dart.core::num' can't be assigned to a variable of type '(dart.core::int) \u8594 dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to '(dart.core::int) \u8594 dart.core::int'.
d.value /*@checkReturn=(num) -> num*/ += 1;
- ^";
+ ^" in let final dynamic #t3 = #t1.{self::D::value}.{self::C::+}(1) as{TypeError} (core::num) → core::num in null;
self::expect(d.{self::D::setValue}(0), 1);
d = new self::D::•(new self::C::•<core::num>(self::numToNum));
self::expectTypeError(() → core::Null {
- let final self::D #t3 = d in #t3.{self::D::value} = let final dynamic #t4 = #t3.{self::D::value}.{self::C::+}(1) as{TypeError} (core::num) → core::num in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/runtime_checks_new/contravariant_generic_return_with_compound_assign_implicit_downcast.dart:54:43: Error: A value of type '(dart.core::num) \u8594 dart.core::num' can't be assigned to a variable of type '(dart.core::int) \u8594 dart.core::int'.
+ let final self::D #t4 = d in #t4.{self::D::value} = let final dynamic #t5 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/runtime_checks_new/contravariant_generic_return_with_compound_assign_implicit_downcast.dart:54:43: Error: A value of type '(dart.core::num) \u8594 dart.core::num' can't be assigned to a variable of type '(dart.core::int) \u8594 dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to '(dart.core::int) \u8594 dart.core::int'.
d.value /*@checkReturn=(num) -> num*/ += 1;
- ^";
+ ^" in let final dynamic #t6 = #t4.{self::D::value}.{self::C::+}(1) as{TypeError} (core::num) → core::num in null;
});
self::expect(d.{self::D::setValue}, null);
}
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 e07ce12..9a89e10 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
@@ -41,17 +41,17 @@
return 2;
static method main() → void {
self::D d = new self::D::•(new self::C::•<core::num>(self::numToInt));
- let final self::D #t1 = d in #t1.{self::D::value} = let final (core::num) → core::num #t2 = #t1.{self::D::value}.{self::C::+}(1) as{TypeError} (core::num) → core::num in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/runtime_checks_new/contravariant_generic_return_with_compound_assign_implicit_downcast.dart:50:41: Error: A value of type '(dart.core::num) \u8594 dart.core::num' can't be assigned to a variable of type '(dart.core::int) \u8594 dart.core::int'.
+ let final self::D #t1 = d in #t1.{self::D::value} = let final dynamic #t2 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/runtime_checks_new/contravariant_generic_return_with_compound_assign_implicit_downcast.dart:50:41: Error: A value of type '(dart.core::num) \u8594 dart.core::num' can't be assigned to a variable of type '(dart.core::int) \u8594 dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to '(dart.core::int) \u8594 dart.core::int'.
d.value /*@checkReturn=(num) -> num*/ += 1;
- ^";
+ ^" in let final (core::num) → core::num #t3 = #t1.{self::D::value}.{self::C::+}(1) as{TypeError} (core::num) → core::num in null;
self::expect(d.{self::D::setValue}(0), 1);
d = new self::D::•(new self::C::•<core::num>(self::numToNum));
self::expectTypeError(() → core::Null {
- let final self::D #t3 = d in #t3.{self::D::value} = let final (core::num) → core::num #t4 = #t3.{self::D::value}.{self::C::+}(1) as{TypeError} (core::num) → core::num in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/runtime_checks_new/contravariant_generic_return_with_compound_assign_implicit_downcast.dart:54:43: Error: A value of type '(dart.core::num) \u8594 dart.core::num' can't be assigned to a variable of type '(dart.core::int) \u8594 dart.core::int'.
+ let final self::D #t4 = d in #t4.{self::D::value} = let final dynamic #t5 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/runtime_checks_new/contravariant_generic_return_with_compound_assign_implicit_downcast.dart:54:43: Error: A value of type '(dart.core::num) \u8594 dart.core::num' can't be assigned to a variable of type '(dart.core::int) \u8594 dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to '(dart.core::int) \u8594 dart.core::int'.
d.value /*@checkReturn=(num) -> num*/ += 1;
- ^";
+ ^" in let final (core::num) → core::num #t6 = #t4.{self::D::value}.{self::C::+}(1) as{TypeError} (core::num) → core::num in null;
});
self::expect(d.{self::D::setValue}, null);
}
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 df54981..ee09fb4 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
@@ -19,21 +19,21 @@
set x(self::B<(self::C::T) → void> value) → void {}
}
static method test(self::C<core::num> c) → void {
- let final self::C<core::num> #t1 = c in #t1.{self::C::x} = (#t1.{self::C::x} as{TypeError} self::B<(core::num) → void>).{self::B::+}(let final dynamic #t2 = new self::B::•<core::num>() in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/runtime_checks_new/contravariant_getter_return_compound_assign.dart:21:49: Error: A value of type 'test::B<dart.core::num>' can't be assigned to a variable of type 'test::B<(dart.core::num) \u8594 void>'.
+ let final self::C<core::num> #t1 = c in #t1.{self::C::x} = (#t1.{self::C::x} as{TypeError} self::B<(core::num) → void>).{self::B::+}(let final dynamic #t2 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/runtime_checks_new/contravariant_getter_return_compound_assign.dart:21:49: Error: A value of type 'test::B<dart.core::num>' can't be assigned to a variable of type 'test::B<(dart.core::num) \u8594 void>'.
Try changing the type of the left hand side, or casting the right hand side to 'test::B<(dart.core::num) \u8594 void>'.
c. /*@checkReturn=B<(num) -> void>*/ x += new B<num>();
- ^");
- self::B<(core::num) → void> y = let final self::C<core::num> #t3 = c in #t3.{self::C::x} = (#t3.{self::C::x} as{TypeError} self::B<(core::num) → void>).{self::B::+}(let final dynamic #t4 = new self::B::•<core::num>() in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/runtime_checks_new/contravariant_getter_return_compound_assign.dart:22:57: Error: A value of type 'test::B<dart.core::num>' can't be assigned to a variable of type 'test::B<(dart.core::num) \u8594 void>'.
+ ^" in let final dynamic #t3 = new self::B::•<core::num>() in null);
+ self::B<(core::num) → void> y = let final self::C<core::num> #t4 = c in #t4.{self::C::x} = (#t4.{self::C::x} as{TypeError} self::B<(core::num) → void>).{self::B::+}(let final dynamic #t5 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/runtime_checks_new/contravariant_getter_return_compound_assign.dart:22:57: Error: A value of type 'test::B<dart.core::num>' can't be assigned to a variable of type 'test::B<(dart.core::num) \u8594 void>'.
Try changing the type of the left hand side, or casting the right hand side to 'test::B<(dart.core::num) \u8594 void>'.
var y = c. /*@checkReturn=B<(num) -> void>*/ x += new B<num>();
- ^");
- let final self::C<core::num> #t5 = c in (#t5.{self::C::x} as{TypeError} self::B<(core::num) → void>).{core::Object::==}(null) ?{self::B<core::Object>} #t5.{self::C::x} = let final dynamic #t6 = new self::B::•<core::num>() in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/runtime_checks_new/contravariant_getter_return_compound_assign.dart:23:50: Error: A value of type 'test::B<dart.core::num>' can't be assigned to a variable of type 'test::B<(dart.core::num) \u8594 void>'.
+ ^" in let final dynamic #t6 = new self::B::•<core::num>() in null);
+ let final self::C<core::num> #t7 = c in (#t7.{self::C::x} as{TypeError} self::B<(core::num) → void>).{core::Object::==}(null) ?{self::B<core::Object>} #t7.{self::C::x} = let final dynamic #t8 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/runtime_checks_new/contravariant_getter_return_compound_assign.dart:23:50: Error: A value of type 'test::B<dart.core::num>' can't be assigned to a variable of type 'test::B<(dart.core::num) \u8594 void>'.
Try changing the type of the left hand side, or casting the right hand side to 'test::B<(dart.core::num) \u8594 void>'.
c. /*@checkReturn=B<(num) -> void>*/ x ??= new B<num>();
- ^" : null;
- self::B<core::Object> z = let final self::C<core::num> #t7 = c in let final dynamic #t8 = #t7.{self::C::x} as{TypeError} self::B<(core::num) → void> in #t8.{core::Object::==}(null) ?{self::B<core::Object>} #t7.{self::C::x} = let final dynamic #t9 = new self::B::•<core::num>() in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/runtime_checks_new/contravariant_getter_return_compound_assign.dart:24:58: Error: A value of type 'test::B<dart.core::num>' can't be assigned to a variable of type 'test::B<(dart.core::num) \u8594 void>'.
+ ^" in let final dynamic #t9 = new self::B::•<core::num>() in null : null;
+ self::B<core::Object> z = let final self::C<core::num> #t10 = c in let final dynamic #t11 = #t10.{self::C::x} as{TypeError} self::B<(core::num) → void> in #t11.{core::Object::==}(null) ?{self::B<core::Object>} #t10.{self::C::x} = let final dynamic #t12 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/runtime_checks_new/contravariant_getter_return_compound_assign.dart:24:58: Error: A value of type 'test::B<dart.core::num>' can't be assigned to a variable of type 'test::B<(dart.core::num) \u8594 void>'.
Try changing the type of the left hand side, or casting the right hand side to 'test::B<(dart.core::num) \u8594 void>'.
var z = c. /*@checkReturn=B<(num) -> void>*/ x ??= new B<num>();
- ^" : #t8;
+ ^" in let final dynamic #t13 = new self::B::•<core::num>() in null : #t11;
}
static method main() → dynamic {}
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 a61408f..f379cd8 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
@@ -19,21 +19,21 @@
set x(self::B<(self::C::T) → void> value) → void {}
}
static method test(self::C<core::num> c) → void {
- let final self::C<core::num> #t1 = c in #t1.{self::C::x} = (#t1.{self::C::x} as{TypeError} self::B<(core::num) → void>).{self::B::+}(let final self::B<core::num> #t2 = new self::B::•<core::num>() in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/runtime_checks_new/contravariant_getter_return_compound_assign.dart:21:49: Error: A value of type 'test::B<dart.core::num>' can't be assigned to a variable of type 'test::B<(dart.core::num) \u8594 void>'.
+ let final self::C<core::num> #t1 = c in #t1.{self::C::x} = (#t1.{self::C::x} as{TypeError} self::B<(core::num) → void>).{self::B::+}(let final dynamic #t2 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/runtime_checks_new/contravariant_getter_return_compound_assign.dart:21:49: Error: A value of type 'test::B<dart.core::num>' can't be assigned to a variable of type 'test::B<(dart.core::num) \u8594 void>'.
Try changing the type of the left hand side, or casting the right hand side to 'test::B<(dart.core::num) \u8594 void>'.
c. /*@checkReturn=B<(num) -> void>*/ x += new B<num>();
- ^");
- self::B<(core::num) → void> y = let final self::C<core::num> #t3 = c in #t3.{self::C::x} = (#t3.{self::C::x} as{TypeError} self::B<(core::num) → void>).{self::B::+}(let final self::B<core::num> #t4 = new self::B::•<core::num>() in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/runtime_checks_new/contravariant_getter_return_compound_assign.dart:22:57: Error: A value of type 'test::B<dart.core::num>' can't be assigned to a variable of type 'test::B<(dart.core::num) \u8594 void>'.
+ ^" in let final self::B<core::num> #t3 = new self::B::•<core::num>() in null);
+ self::B<(core::num) → void> y = let final self::C<core::num> #t4 = c in #t4.{self::C::x} = (#t4.{self::C::x} as{TypeError} self::B<(core::num) → void>).{self::B::+}(let final dynamic #t5 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/runtime_checks_new/contravariant_getter_return_compound_assign.dart:22:57: Error: A value of type 'test::B<dart.core::num>' can't be assigned to a variable of type 'test::B<(dart.core::num) \u8594 void>'.
Try changing the type of the left hand side, or casting the right hand side to 'test::B<(dart.core::num) \u8594 void>'.
var y = c. /*@checkReturn=B<(num) -> void>*/ x += new B<num>();
- ^");
- let final self::C<core::num> #t5 = c in (#t5.{self::C::x} as{TypeError} self::B<(core::num) → void>).{core::Object::==}(null) ?{self::B<core::Object>} #t5.{self::C::x} = let final self::B<core::num> #t6 = new self::B::•<core::num>() in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/runtime_checks_new/contravariant_getter_return_compound_assign.dart:23:50: Error: A value of type 'test::B<dart.core::num>' can't be assigned to a variable of type 'test::B<(dart.core::num) \u8594 void>'.
+ ^" in let final self::B<core::num> #t6 = new self::B::•<core::num>() in null);
+ let final self::C<core::num> #t7 = c in (#t7.{self::C::x} as{TypeError} self::B<(core::num) → void>).{core::Object::==}(null) ?{self::B<core::Object>} #t7.{self::C::x} = let final dynamic #t8 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/runtime_checks_new/contravariant_getter_return_compound_assign.dart:23:50: Error: A value of type 'test::B<dart.core::num>' can't be assigned to a variable of type 'test::B<(dart.core::num) \u8594 void>'.
Try changing the type of the left hand side, or casting the right hand side to 'test::B<(dart.core::num) \u8594 void>'.
c. /*@checkReturn=B<(num) -> void>*/ x ??= new B<num>();
- ^" : null;
- self::B<core::Object> z = let final self::C<core::num> #t7 = c in let final self::B<(core::num) → void> #t8 = #t7.{self::C::x} as{TypeError} self::B<(core::num) → void> in #t8.{core::Object::==}(null) ?{self::B<core::Object>} #t7.{self::C::x} = let final self::B<core::num> #t9 = new self::B::•<core::num>() in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/runtime_checks_new/contravariant_getter_return_compound_assign.dart:24:58: Error: A value of type 'test::B<dart.core::num>' can't be assigned to a variable of type 'test::B<(dart.core::num) \u8594 void>'.
+ ^" in let final self::B<core::num> #t9 = new self::B::•<core::num>() in null : null;
+ self::B<core::Object> z = let final self::C<core::num> #t10 = c in let final self::B<(core::num) → void> #t11 = #t10.{self::C::x} as{TypeError} self::B<(core::num) → void> in #t11.{core::Object::==}(null) ?{self::B<core::Object>} #t10.{self::C::x} = let final dynamic #t12 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/runtime_checks_new/contravariant_getter_return_compound_assign.dart:24:58: Error: A value of type 'test::B<dart.core::num>' can't be assigned to a variable of type 'test::B<(dart.core::num) \u8594 void>'.
Try changing the type of the left hand side, or casting the right hand side to 'test::B<(dart.core::num) \u8594 void>'.
var z = c. /*@checkReturn=B<(num) -> void>*/ x ??= new B<num>();
- ^" : #t8;
+ ^" in let final self::B<core::num> #t13 = new self::B::•<core::num>() in null : #t11;
}
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/runtime_checks_new/for_in_call_kinds.dart b/pkg/front_end/testcases/runtime_checks_new/for_in_call_kinds.dart
index a7ea1eb..fcb5d83 100644
--- a/pkg/front_end/testcases/runtime_checks_new/for_in_call_kinds.dart
+++ b/pkg/front_end/testcases/runtime_checks_new/for_in_call_kinds.dart
@@ -19,8 +19,8 @@
for (topLevelSetter in []) {}
for (staticField in []) {}
for (staticSetter in []) {}
- for (/*@callKind=this*/ instanceField in []) {}
- for (/*@callKind=this*/ instanceSetter in []) {}
+ for (instanceField in []) {}
+ for (instanceSetter in []) {}
for (localVar in []) {}
}
}
diff --git a/pkg/front_end/testcases/runtime_checks_new/mixin_forwarding_stub_field.dart b/pkg/front_end/testcases/runtime_checks_new/mixin_forwarding_stub_field.dart
index 2b594d7..17749bb 100644
--- a/pkg/front_end/testcases/runtime_checks_new/mixin_forwarding_stub_field.dart
+++ b/pkg/front_end/testcases/runtime_checks_new/mixin_forwarding_stub_field.dart
@@ -7,7 +7,7 @@
void expectTypeError(void callback()) {
try {
- callback /*@callKind=closure*/ ();
+ callback();
throw 'Expected TypeError, did not occur';
} on TypeError {}
}
diff --git a/pkg/front_end/testcases/runtime_checks_new/mixin_forwarding_stub_getter.dart b/pkg/front_end/testcases/runtime_checks_new/mixin_forwarding_stub_getter.dart
index dca4eca..a1739c5 100644
--- a/pkg/front_end/testcases/runtime_checks_new/mixin_forwarding_stub_getter.dart
+++ b/pkg/front_end/testcases/runtime_checks_new/mixin_forwarding_stub_getter.dart
@@ -9,7 +9,7 @@
void expectTypeError(void callback()) {
try {
- callback /*@callKind=closure*/ ();
+ callback();
throw 'Expected TypeError, did not occur';
} on TypeError {}
}
@@ -36,7 +36,7 @@
}
abstract class M<T> {
- T get x => f /*@callKind=this*/ ();
+ T get x => f();
void set x(Object value) {
throw 'Should not be reached';
}
@@ -64,7 +64,7 @@
});
// iInt.x is expected to return type (int) -> void, and it does.
var x = iInt. /*@checkReturn=(int) -> void*/ x;
- x /*@callKind=closure*/ (1);
+ x(1);
}
void main() {
diff --git a/pkg/front_end/testcases/runtime_checks_new/mixin_forwarding_stub_setter.dart b/pkg/front_end/testcases/runtime_checks_new/mixin_forwarding_stub_setter.dart
index 3c909f0..68558fd 100644
--- a/pkg/front_end/testcases/runtime_checks_new/mixin_forwarding_stub_setter.dart
+++ b/pkg/front_end/testcases/runtime_checks_new/mixin_forwarding_stub_setter.dart
@@ -7,7 +7,7 @@
void expectTypeError(void callback()) {
try {
- callback /*@callKind=closure*/ ();
+ callback();
throw 'Expected TypeError, did not occur';
} on TypeError {}
}
diff --git a/pkg/front_end/testcases/runtime_checks_new/stub_checked_via_target.dart b/pkg/front_end/testcases/runtime_checks_new/stub_checked_via_target.dart
index 98ad30f..0a8e34b 100644
--- a/pkg/front_end/testcases/runtime_checks_new/stub_checked_via_target.dart
+++ b/pkg/front_end/testcases/runtime_checks_new/stub_checked_via_target.dart
@@ -7,7 +7,7 @@
void expectTypeError(void callback()) {
try {
- callback /*@callKind=closure*/ ();
+ callback();
throw 'Expected TypeError, did not occur';
} on TypeError {}
}
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 455a17a..862b7b7 100644
--- a/pkg/front_end/testcases/type_variable_prefix.dart.strong.expect
+++ b/pkg/front_end/testcases/type_variable_prefix.dart.strong.expect
@@ -7,18 +7,18 @@
: super core::Object::•()
;
method method() → invalid-type
- return let final dynamic #t1 = "Hello, World!" in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/type_variable_prefix.dart:8:24: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'invalid-type'.
+ return let final dynamic #t1 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/type_variable_prefix.dart:8:24: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'invalid-type'.
Try changing the type of the left hand side, or casting the right hand side to 'invalid-type'.
T.String method() => \"Hello, World!\";
- ^";
+ ^" in let final dynamic #t2 = "Hello, World!" in null;
}
static const field dynamic #errors = const <dynamic>["pkg/front_end/testcases/type_variable_prefix.dart:8:3: Error: Type 'T.String' not found.
T.String method() => \"Hello, World!\";
^"]/* from null */;
static method main() → dynamic {
- core::String s = let final dynamic #t2 = new self::C::•<dynamic>().{self::C::method}() in let dynamic _ = null in invalid-expression "pkg/front_end/testcases/type_variable_prefix.dart:12:24: Error: A value of type 'invalid-type' can't be assigned to a variable of type 'dart.core::String'.
+ core::String s = let final dynamic #t3 = let dynamic _ = null in invalid-expression "pkg/front_end/testcases/type_variable_prefix.dart:12:24: Error: A value of type 'invalid-type' 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'.
T.String s = new C().method();
- ^";
+ ^" in let final dynamic #t4 = new self::C::•<dynamic>().{self::C::method}() in null;
core::print(s);
}
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 221c1b2..bd3a6bd 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
@@ -7,18 +7,18 @@
: super core::Object::•()
;
method method() → invalid-type
- return let final core::String #t1 = "Hello, World!" in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/type_variable_prefix.dart:8:24: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'invalid-type'.
+ return let final dynamic #t1 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/type_variable_prefix.dart:8:24: Error: A value of type 'dart.core::String' can't be assigned to a variable of type 'invalid-type'.
Try changing the type of the left hand side, or casting the right hand side to 'invalid-type'.
T.String method() => \"Hello, World!\";
- ^";
+ ^" in let final core::String #t2 = "Hello, World!" in null;
}
static const field dynamic #errors = const <dynamic>["pkg/front_end/testcases/type_variable_prefix.dart:8:3: Error: Type 'T.String' not found.
T.String method() => \"Hello, World!\";
^"]/* from null */;
static method main() → dynamic {
- core::String s = let final invalid-type #t2 = new self::C::•<dynamic>().{self::C::method}() in let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/type_variable_prefix.dart:12:24: Error: A value of type 'invalid-type' can't be assigned to a variable of type 'dart.core::String'.
+ core::String s = let final dynamic #t3 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/type_variable_prefix.dart:12:24: Error: A value of type 'invalid-type' 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'.
T.String s = new C().method();
- ^";
+ ^" in let final invalid-type #t4 = new self::C::•<dynamic>().{self::C::method}() in null;
core::print(s);
}
diff --git a/pkg/kernel/binary.md b/pkg/kernel/binary.md
index 2806388..0cfe661 100644
--- a/pkg/kernel/binary.md
+++ b/pkg/kernel/binary.md
@@ -515,7 +515,6 @@
type PropertyGet extends Expression {
Byte tag = 22;
FileOffset fileOffset;
- Byte flags (dispatchCategoryLowBit, dispatchCategoryHighBit);
Expression receiver;
Name name;
MemberReference interfaceTarget; // May be NullReference.
@@ -524,7 +523,6 @@
type PropertySet extends Expression {
Byte tag = 23;
FileOffset fileOffset;
- Byte flags (dispatchCategoryLowBit, dispatchCategoryHighBit);
Expression receiver;
Name name;
Expression value;
@@ -549,7 +547,6 @@
type DirectPropertyGet extends Expression {
Byte tag = 15; // Note: tag is out of order
FileOffset fileOffset;
- Byte flags (dispatchCategoryLowBit, dispatchCategoryHighBit);
Expression receiver;
MemberReference target;
}
@@ -557,7 +554,6 @@
type DirectPropertySet extends Expression {
Byte tag = 16; // Note: tag is out of order
FileOffset fileOffset;
- Byte flags (dispatchCategoryLowBit, dispatchCategoryHighBit);
Expression receiver;
MemberReference target;
Expression value;
@@ -593,7 +589,6 @@
type MethodInvocation extends Expression {
Byte tag = 28;
FileOffset fileOffset;
- Byte flags (dispatchCategoryLowBit, dispatchCategoryHighBit);
Expression receiver;
Name name;
Arguments arguments;
@@ -611,7 +606,6 @@
type DirectMethodInvocation extends Expression {
Byte tag = 17; // Note: tag is out of order
FileOffset fileOffset;
- Byte flags (dispatchCategoryLowBit, dispatchCategoryHighBit);
Expression receiver;
MemberReference target;
Arguments arguments;
diff --git a/pkg/kernel/lib/ast.dart b/pkg/kernel/lib/ast.dart
index dcb6c66..e50b62d 100644
--- a/pkg/kernel/lib/ast.dart
+++ b/pkg/kernel/lib/ast.dart
@@ -2185,7 +2185,6 @@
Expression receiver;
@coq
Name name;
- int flags = 0;
@nocoq
Reference interfaceTargetReference;
@@ -2196,19 +2195,6 @@
PropertyGet.byReference(
this.receiver, this.name, this.interfaceTargetReference) {
receiver?.parent = this;
- this.dispatchCategory = DispatchCategory.dynamicDispatch;
- }
-
- // Must match serialized bit positions
- static const int ShiftDispatchCategory = 0;
- static const int FlagDispatchCategory = 3 << ShiftDispatchCategory;
-
- DispatchCategory get dispatchCategory => DispatchCategory
- .values[(flags & FlagDispatchCategory) >> ShiftDispatchCategory];
-
- void set dispatchCategory(DispatchCategory value) {
- flags = (flags & ~FlagDispatchCategory) |
- (value.index << ShiftDispatchCategory);
}
Member get interfaceTarget => interfaceTargetReference?.asMember;
@@ -2261,7 +2247,6 @@
Expression receiver;
Name name;
Expression value;
- int flags = 0;
Reference interfaceTargetReference;
@@ -2274,19 +2259,6 @@
this.receiver, this.name, this.value, this.interfaceTargetReference) {
receiver?.parent = this;
value?.parent = this;
- this.dispatchCategory = DispatchCategory.dynamicDispatch;
- }
-
- // Must match serialized bit positions.
- static const int ShiftDispatchCategory = 0;
- static const int FlagDispatchCategory = 3 << ShiftDispatchCategory;
-
- DispatchCategory get dispatchCategory => DispatchCategory
- .values[(flags & FlagDispatchCategory) >> ShiftDispatchCategory];
-
- void set dispatchCategory(DispatchCategory value) {
- flags = (flags & ~FlagDispatchCategory) |
- (value.index << ShiftDispatchCategory);
}
Member get interfaceTarget => interfaceTargetReference?.asMember;
@@ -2322,26 +2294,12 @@
class DirectPropertyGet extends Expression {
Expression receiver;
Reference targetReference;
- int flags = 0;
DirectPropertyGet(Expression receiver, Member target)
: this.byReference(receiver, getMemberReference(target));
DirectPropertyGet.byReference(this.receiver, this.targetReference) {
receiver?.parent = this;
- this.dispatchCategory = DispatchCategory.dynamicDispatch;
- }
-
- // Must match serialized bit positions
- static const int ShiftDispatchCategory = 0;
- static const int FlagDispatchCategory = 3 << ShiftDispatchCategory;
-
- DispatchCategory get dispatchCategory => DispatchCategory
- .values[(flags & FlagDispatchCategory) >> ShiftDispatchCategory];
-
- void set dispatchCategory(DispatchCategory value) {
- flags = (flags & ~FlagDispatchCategory) |
- (value.index << ShiftDispatchCategory);
}
Member get target => targetReference?.asMember;
@@ -2381,7 +2339,6 @@
Expression receiver;
Reference targetReference;
Expression value;
- int flags = 0;
DirectPropertySet(Expression receiver, Member target, Expression value)
: this.byReference(receiver, getMemberReference(target), value);
@@ -2392,18 +2349,6 @@
value?.parent = this;
}
- // Must match serialized bit positions
- static const int ShiftDispatchCategory = 0;
- static const int FlagDispatchCategory = 3 << ShiftDispatchCategory;
-
- DispatchCategory get dispatchCategory => DispatchCategory
- .values[(flags & FlagDispatchCategory) >> ShiftDispatchCategory];
-
- void set dispatchCategory(DispatchCategory value) {
- flags = (flags & ~FlagDispatchCategory) |
- (value.index << ShiftDispatchCategory);
- }
-
Member get target => targetReference?.asMember;
void set target(Member target) {
@@ -2438,7 +2383,6 @@
Expression receiver;
Reference targetReference;
Arguments arguments;
- int flags = 0;
DirectMethodInvocation(
Expression receiver, Procedure target, Arguments arguments)
@@ -2448,19 +2392,6 @@
this.receiver, this.targetReference, this.arguments) {
receiver?.parent = this;
arguments?.parent = this;
- this.dispatchCategory = DispatchCategory.dynamicDispatch;
- }
-
- // Must match serialized bit positions
- static const int ShiftDispatchCategory = 0;
- static const int FlagDispatchCategory = 3 << ShiftDispatchCategory;
-
- DispatchCategory get dispatchCategory => DispatchCategory
- .values[(flags & FlagDispatchCategory) >> ShiftDispatchCategory];
-
- void set dispatchCategory(DispatchCategory value) {
- flags = (flags & ~FlagDispatchCategory) |
- (value.index << ShiftDispatchCategory);
}
Procedure get target => targetReference?.asProcedure;
@@ -2516,8 +2447,6 @@
Reference interfaceTargetReference;
- DispatchCategory get dispatchCategory => DispatchCategory.viaThis;
-
SuperPropertyGet(Name name, [Member interfaceTarget])
: this.byReference(name, getMemberReference(interfaceTarget));
@@ -2740,7 +2669,6 @@
Expression receiver;
Name name;
Arguments arguments;
- int flags = 0;
Reference interfaceTargetReference;
@@ -2753,19 +2681,6 @@
this.receiver, this.name, this.arguments, this.interfaceTargetReference) {
receiver?.parent = this;
arguments?.parent = this;
- this.dispatchCategory = DispatchCategory.dynamicDispatch;
- }
-
- // Must match serialized bit positions
- static const int ShiftDispatchCategory = 0;
- static const int FlagDispatchCategory = 3 << ShiftDispatchCategory;
-
- DispatchCategory get dispatchCategory => DispatchCategory
- .values[(flags & FlagDispatchCategory) >> ShiftDispatchCategory];
-
- void set dispatchCategory(DispatchCategory value) {
- flags = (flags & ~FlagDispatchCategory) |
- (value.index << ShiftDispatchCategory);
}
Member get interfaceTarget => interfaceTargetReference?.asMember;
@@ -2841,7 +2756,6 @@
class SuperMethodInvocation extends InvocationExpression {
Name name;
Arguments arguments;
- DispatchCategory get dispatchCategory => DispatchCategory.viaThis;
Reference interfaceTargetReference;
@@ -4404,96 +4318,6 @@
}
}
-/// Categorization of a call site indicating its effect on type guarantees.
-enum DispatchCategory {
- /// This call site binds to its callee through a specific interface.
- ///
- /// The front end guarantees that the target of the call exists, has the
- /// correct arity, and accepts all of the supplied named parameters. Further,
- /// it guarantees that the number of type parameters supplied matches the
- /// number of type parameters expected by the target of the call.
- ///
- /// Due to parameter covariance, it is not necessarily guaranteed that the
- /// actual values of parameters will match the declared types of those
- /// parameters in the method actually being called. A runtime type check is
- /// required for any parameter meeting one of the following conditions:
- ///
- /// - The parameter in the interface target is tagged with
- /// `isGenericCovariantInterface`, and the corresponding parameter in the
- /// method actually being called is tagged with `isGenericCovariantImpl`.
- ///
- /// - The parameter in the method actually being called is tagged with
- /// `isCovariant`.
- ///
- /// Note: type parameters of generic methods require similar checks; the
- /// flags `isGenericCovariantInterface` and `isGenericCovariantImpl` are found
- /// in [TypeParameter], and the implementation must check that the actual
- /// type is a subtype of the type parameter bound declared in the actual
- /// method being called. For type parameter checks, there is no `isCovariant`
- /// tag.
- ///
- /// Note: if the interface target or the method actually being called is a
- /// field, then the tags `isGenericCovariantInterface`,
- /// `isGenericCovariantImpl`, and `isCovariant` are found in [Field].
- interface,
-
- /// This call site binds to its callee via a call on `this`.
- ///
- /// Similar to [interface], however the target of the call is a method on
- /// `this` or `super`, therefore all of the class's type parameters are known
- /// to match exactly.
- ///
- /// Due to parameter covariance, it is not necessarily guaranteed that the
- /// actual values of parameters will match the declared types of those
- /// parameters in the method actually being called. A runtime type check is
- /// required for any parameter meeting one of the following condition:
- ///
- /// - The parameter in the method actually being called is tagged with
- /// `isCovariant`.
- ///
- /// Note: type parameters of generic methods do not require a check when the
- /// call is via `this`.
- ///
- /// Note: if the interface target or the method actually being called is a
- /// field, then the tag `isCovariant` is found in [Field].
- viaThis,
-
- /// This call site is an invocation of a function object (formed either by a
- /// tear off or a function literal).
- ///
- /// Similar to [interface], however the interface target of the call is not
- /// known.
- ///
- /// Due to parameter covariance, it is not necessarily guaranteed that the
- /// actual values of parameters will match the declared types of those
- /// parameters in the method actually being called. A runtime type check is
- /// required for any parameter meeting one of the following conditions:
- ///
- /// - The parameter in the method actually being called is tagged with
- /// `isGenericCovariantImpl`.
- ///
- /// - The parameter in the method actually being called is tagged with
- /// `isCovariant`.
- ///
- /// Note: type parameters of generic methods require similar checks; the
- /// flag `isGenericCovariantImpl` is found in [TypeParameter], and the
- /// implementation must check that the actual type is a subtype of the type
- /// parameter bound declared in the actual method being called. For type
- /// parameter checks, there is no `isCovariant` tag.
- ///
- /// Note: if the interface target or the method actually being called is a
- /// field, then the tags `isGenericCovariantImpl` and `isCovariant` are found
- /// in [Field].
- closure,
-
- /// The call site is dynamic.
- ///
- /// The front end makes no guarantees that the target of the call will accept
- /// the actual runtime types of the parameters, nor that the target of the
- /// call even exists. Everything must be checked at runtime.
- dynamicDispatch,
-}
-
/// Declaration of a local variable.
///
/// This may occur as a statement, but is also used in several non-statement
diff --git a/pkg/kernel/lib/binary/ast_from_binary.dart b/pkg/kernel/lib/binary/ast_from_binary.dart
index 97fd9dd..ae840c7 100644
--- a/pkg/kernel/lib/binary/ast_from_binary.dart
+++ b/pkg/kernel/lib/binary/ast_from_binary.dart
@@ -1212,18 +1212,14 @@
..fileOffset = offset;
case Tag.PropertyGet:
int offset = readOffset();
- int flags = readByte();
return new PropertyGet.byReference(
readExpression(), readName(), readMemberReference(allowNull: true))
- ..fileOffset = offset
- ..flags = flags;
+ ..fileOffset = offset;
case Tag.PropertySet:
int offset = readOffset();
- int flags = readByte();
return new PropertySet.byReference(readExpression(), readName(),
readExpression(), readMemberReference(allowNull: true))
- ..fileOffset = offset
- ..flags = flags;
+ ..fileOffset = offset;
case Tag.SuperPropertyGet:
int offset = readOffset();
addTransformerFlag(TransformerFlag.superCalls);
@@ -1238,18 +1234,14 @@
..fileOffset = offset;
case Tag.DirectPropertyGet:
int offset = readOffset();
- int flags = readByte();
return new DirectPropertyGet.byReference(
readExpression(), readMemberReference())
- ..fileOffset = offset
- ..flags = flags;
+ ..fileOffset = offset;
case Tag.DirectPropertySet:
int offset = readOffset();
- int flags = readByte();
return new DirectPropertySet.byReference(
readExpression(), readMemberReference(), readExpression())
- ..fileOffset = offset
- ..flags = flags;
+ ..fileOffset = offset;
case Tag.StaticGet:
int offset = readOffset();
return new StaticGet.byReference(readMemberReference())
@@ -1261,11 +1253,9 @@
..fileOffset = offset;
case Tag.MethodInvocation:
int offset = readOffset();
- int flags = readByte();
return new MethodInvocation.byReference(readExpression(), readName(),
readArguments(), readMemberReference(allowNull: true))
- ..fileOffset = offset
- ..flags = flags;
+ ..fileOffset = offset;
case Tag.SuperMethodInvocation:
int offset = readOffset();
addTransformerFlag(TransformerFlag.superCalls);
@@ -1274,11 +1264,9 @@
..fileOffset = offset;
case Tag.DirectMethodInvocation:
int offset = readOffset();
- int flags = readByte();
return new DirectMethodInvocation.byReference(
readExpression(), readMemberReference(), readArguments())
- ..fileOffset = offset
- ..flags = flags;
+ ..fileOffset = offset;
case Tag.StaticInvocation:
int offset = readOffset();
return new StaticInvocation.byReference(
diff --git a/pkg/kernel/lib/binary/ast_to_binary.dart b/pkg/kernel/lib/binary/ast_to_binary.dart
index ec68922..de480d6 100644
--- a/pkg/kernel/lib/binary/ast_to_binary.dart
+++ b/pkg/kernel/lib/binary/ast_to_binary.dart
@@ -1002,7 +1002,6 @@
void visitPropertyGet(PropertyGet node) {
writeByte(Tag.PropertyGet);
writeOffset(node.fileOffset);
- writeByte(node.flags);
writeNode(node.receiver);
writeName(node.name);
writeReference(node.interfaceTargetReference);
@@ -1012,7 +1011,6 @@
void visitPropertySet(PropertySet node) {
writeByte(Tag.PropertySet);
writeOffset(node.fileOffset);
- writeByte(node.flags);
writeNode(node.receiver);
writeName(node.name);
writeNode(node.value);
@@ -1040,7 +1038,6 @@
void visitDirectPropertyGet(DirectPropertyGet node) {
writeByte(Tag.DirectPropertyGet);
writeOffset(node.fileOffset);
- writeByte(node.flags);
writeNode(node.receiver);
writeReference(node.targetReference);
}
@@ -1049,7 +1046,6 @@
void visitDirectPropertySet(DirectPropertySet node) {
writeByte(Tag.DirectPropertySet);
writeOffset(node.fileOffset);
- writeByte(node.flags);
writeNode(node.receiver);
writeReference(node.targetReference);
writeNode(node.value);
@@ -1074,7 +1070,6 @@
void visitMethodInvocation(MethodInvocation node) {
writeByte(Tag.MethodInvocation);
writeOffset(node.fileOffset);
- writeByte(node.flags);
writeNode(node.receiver);
writeName(node.name);
writeNode(node.arguments);
@@ -1094,7 +1089,6 @@
void visitDirectMethodInvocation(DirectMethodInvocation node) {
writeByte(Tag.DirectMethodInvocation);
writeOffset(node.fileOffset);
- writeByte(node.flags);
writeNode(node.receiver);
writeReference(node.targetReference);
writeNode(node.arguments);
diff --git a/pkg/kernel/lib/clone.dart b/pkg/kernel/lib/clone.dart
index 9c1db32..b70521e 100644
--- a/pkg/kernel/lib/clone.dart
+++ b/pkg/kernel/lib/clone.dart
@@ -98,26 +98,22 @@
visitPropertyGet(PropertyGet node) {
return new PropertyGet.byReference(
- clone(node.receiver), node.name, node.interfaceTargetReference)
- ..flags = node.flags;
+ clone(node.receiver), node.name, node.interfaceTargetReference);
}
visitPropertySet(PropertySet node) {
return new PropertySet.byReference(clone(node.receiver), node.name,
- clone(node.value), node.interfaceTargetReference)
- ..flags = node.flags;
+ clone(node.value), node.interfaceTargetReference);
}
visitDirectPropertyGet(DirectPropertyGet node) {
return new DirectPropertyGet.byReference(
- clone(node.receiver), node.targetReference)
- ..flags = node.flags;
+ clone(node.receiver), node.targetReference);
}
visitDirectPropertySet(DirectPropertySet node) {
return new DirectPropertySet.byReference(
- clone(node.receiver), node.targetReference, clone(node.value))
- ..flags = node.flags;
+ clone(node.receiver), node.targetReference, clone(node.value));
}
visitSuperPropertyGet(SuperPropertyGet node) {
@@ -140,14 +136,12 @@
visitMethodInvocation(MethodInvocation node) {
return new MethodInvocation.byReference(clone(node.receiver), node.name,
- clone(node.arguments), node.interfaceTargetReference)
- ..flags = node.flags;
+ clone(node.arguments), node.interfaceTargetReference);
}
visitDirectMethodInvocation(DirectMethodInvocation node) {
return new DirectMethodInvocation.byReference(
- clone(node.receiver), node.targetReference, clone(node.arguments))
- ..flags = node.flags;
+ clone(node.receiver), node.targetReference, clone(node.arguments));
}
visitSuperMethodInvocation(SuperMethodInvocation node) {
diff --git a/pkg/kernel/lib/target/targets.dart b/pkg/kernel/lib/target/targets.dart
index ec9a8aa..c7efa89 100644
--- a/pkg/kernel/lib/target/targets.dart
+++ b/pkg/kernel/lib/target/targets.dart
@@ -22,11 +22,13 @@
final bool syncAsync;
final List<ProgramRoot> programRoots;
final Uri kernelRuntime;
+ final bool allowDartInternalImport;
TargetFlags(
{this.strongMode: false,
this.treeShake: false,
this.syncAsync: false,
+ this.allowDartInternalImport: false,
this.programRoots: const <ProgramRoot>[],
this.kernelRuntime});
}
diff --git a/pkg/kernel/lib/target/vm.dart b/pkg/kernel/lib/target/vm.dart
index 322d2c5..7fa5ec3 100644
--- a/pkg/kernel/lib/target/vm.dart
+++ b/pkg/kernel/lib/target/vm.dart
@@ -58,6 +58,16 @@
];
@override
+ bool allowPlatformPrivateLibraryAccess(Uri importer, Uri imported) {
+ if (flags.allowDartInternalImport &&
+ (imported.scheme == 'dart') &&
+ (imported.path == '_internal')) {
+ return true;
+ }
+ return super.allowPlatformPrivateLibraryAccess(importer, imported);
+ }
+
+ @override
void performModularTransformationsOnLibraries(
CoreTypes coreTypes, ClassHierarchy hierarchy, List<Library> libraries,
{void logger(String msg)}) {
diff --git a/pkg/pkg.status b/pkg/pkg.status
index a03128c..2ae5e58 100644
--- a/pkg/pkg.status
+++ b/pkg/pkg.status
@@ -231,4 +231,3 @@
[ $mode != release || $runtime != vm || $system == windows ]
kernel/test/closures_test: Skip
-
diff --git a/pkg/status_file/lib/canonical_status_file.dart b/pkg/status_file/lib/canonical_status_file.dart
index 3d40d9c..148b4ca 100644
--- a/pkg/status_file/lib/canonical_status_file.dart
+++ b/pkg/status_file/lib/canonical_status_file.dart
@@ -70,7 +70,7 @@
final String path;
final List<StatusSection> sections = [];
- int _lineCount = 0;
+ int _lineCount = 1;
/// Constructor for creating a new [StatusFile]. Will not create the default
/// section that status files have.
@@ -87,7 +87,7 @@
///
/// Throws a [SyntaxError] if the file could not be parsed.
StatusFile.parse(this.path, List<String> lines) {
- _parse(lines);
+ _parse(lines.map((line) => line.trim()).toList());
}
void _parse(List<String> lines) {
@@ -141,23 +141,56 @@
commentBelongsToNextSectionHeader(currentLine + 1);
}
+ // List of comments added before the next section's header.
+ List<Entry> sectionHeaderComments = [];
+
+ // Parse file comments
+ var lastEmptyLine = 0;
+ for (; _lineCount <= lines.length; _lineCount++) {
+ var line = lines[_lineCount - 1];
+ if (!line.startsWith("#") && line.isNotEmpty) {
+ break;
+ }
+ if (line.isEmpty) {
+ sectionHeaderComments.add(new EmptyEntry(_lineCount));
+ lastEmptyLine = _lineCount;
+ } else {
+ sectionHeaderComments
+ .add(new CommentEntry(_lineCount, new Comment(line)));
+ }
+ }
+
+ var implicitSectionHeaderComments = sectionHeaderComments;
+ var entries = [];
+ if (lastEmptyLine > 0 && sectionHeaderMatch(_lineCount) != null) {
+ // Comments after the last empty line belong to the next section's header.
+ // The empty line is not added to the section header, because it will be
+ // added to the section's entries.
+ implicitSectionHeaderComments =
+ implicitSectionHeaderComments.sublist(0, lastEmptyLine - 1);
+ entries.add(sectionHeaderComments[lastEmptyLine - 1]);
+ sectionHeaderComments = sectionHeaderComments.sublist(lastEmptyLine);
+ } else {
+ // Reset section header comments.
+ sectionHeaderComments = [];
+ }
+
// The current section whose rules are being parsed. Initalized to an
// implicit section that matches everything.
- StatusSection section = new StatusSection(null, -1, []);
+ StatusSection section =
+ new StatusSection(null, -1, implicitSectionHeaderComments);
+ section.entries.addAll(entries);
sections.add(section);
- // Placeholder for comments that should be added to a section.
- List<CommentEntry> sectionHeaderComments = [];
-
- for (var line in lines) {
- _lineCount++;
+ for (; _lineCount <= lines.length; _lineCount++) {
+ var line = lines[_lineCount - 1];
fail(String message, [List<String> errors]) {
throw new SyntaxError(_shortPath, _lineCount, line, message, errors);
}
// If it is an empty line
- if (line.trim().isEmpty) {
+ if (line.isEmpty) {
section.entries.add(new EmptyEntry(_lineCount));
continue;
}
@@ -275,7 +308,7 @@
/// Collection of all comment and status line entries.
final List<Entry> entries = [];
- final List<CommentEntry> sectionHeaderComments;
+ final List<Entry> sectionHeaderComments;
/// Returns true if this section should apply in the given [environment].
bool isEnabled(Environment environment) =>
diff --git a/pkg/status_file/lib/status_file_normalizer.dart b/pkg/status_file/lib/status_file_normalizer.dart
index 99898e9..71d90e3 100644
--- a/pkg/status_file/lib/status_file_normalizer.dart
+++ b/pkg/status_file/lib/status_file_normalizer.dart
@@ -3,6 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
import 'canonical_status_file.dart';
+import 'dart:convert';
StatusFile normalizeStatusFile(StatusFile statusFile) {
StatusFile newStatusFile = _sortSectionsAndCombine(statusFile);
@@ -10,6 +11,8 @@
_sortEntriesInSection(section);
_oneLineBetweenSections(section);
});
+ // Remove empty line at the end of the file
+ newStatusFile.sections.last.entries.removeLast();
return newStatusFile;
}
@@ -44,8 +47,8 @@
StatusFile _sortSectionsAndCombine(StatusFile statusFile) {
// Create the new status file to be returned.
- StatusFile oldStatusFile =
- new StatusFile.parse(statusFile.path, statusFile.toString().split('\n'));
+ StatusFile oldStatusFile = new StatusFile.parse(
+ statusFile.path, LineSplitter.split(statusFile.toString()).toList());
List<StatusSection> newSections = [];
// Copy over all sections and normalize all the expressions.
oldStatusFile.sections.forEach((section) {
diff --git a/pkg/status_file/test/data/header.status b/pkg/status_file/test/data/header.status
new file mode 100644
index 0000000..c120c8c
--- /dev/null
+++ b/pkg/status_file/test/data/header.status
@@ -0,0 +1,6 @@
+# LICENSE
+
+# Implicit section comment
+
+# Section header comment
+[ $browser ]
diff --git a/pkg/status_file/test/data/header2.status b/pkg/status_file/test/data/header2.status
new file mode 100644
index 0000000..c94cc2a2
--- /dev/null
+++ b/pkg/status_file/test/data/header2.status
@@ -0,0 +1,10 @@
+# LICENSE
+
+# Implicit section comment
+
+# Comment
+[ $browser ]
+test1: Fail
+
+[ $compiler == dart2js ]
+test2: Crash
\ No newline at end of file
diff --git a/pkg/status_file/test/linter_test.dart b/pkg/status_file/test/linter_test.dart
index db340c0..dcd6e06 100644
--- a/pkg/status_file/test/linter_test.dart
+++ b/pkg/status_file/test/linter_test.dart
@@ -51,6 +51,17 @@
Expect.listEquals([], errors);
}
+void testEmptyLinesInHeader() {
+ expectNoError(r"""# LICENSE
+
+# valid comment after empty line on default section
+suite/tests: Skip
+
+# valid comment
+[ $mode == debug ]
+""");
+}
+
void testCommentLinesInSection_invalidCommentInSection() {
expectError(r"""[ $mode == debug ]
# this comment is invalid
diff --git a/pkg/status_file/test/normalize_test.dart b/pkg/status_file/test/normalize_test.dart
index 6fde746..92869c3 100644
--- a/pkg/status_file/test/normalize_test.dart
+++ b/pkg/status_file/test/normalize_test.dart
@@ -29,6 +29,7 @@
var statusFileOther = normalizeStatusFile(new StatusFile.read(file.path));
checkSemanticallyEqual(statusFile, statusFileOther,
warnOnDuplicateHeader: true);
+ checkFileHeaderIntact(statusFile, statusFileOther);
print("------- " + file.path + " -------");
}
}
@@ -41,6 +42,7 @@
var statusFileOther = new StatusFile.read(file.path);
checkSemanticallyEqual(statusFile, statusFileOther,
warnOnDuplicateHeader: true);
+ checkFileHeaderIntact(statusFile, statusFileOther);
print("------- " + file.path + " -------");
}
}
@@ -126,6 +128,16 @@
}
}
+void checkFileHeaderIntact(StatusFile original, StatusFile normalized) {
+ var originalHeader = original.sections.first.sectionHeaderComments.toString();
+ var normalizedHeader =
+ normalized.sections.first.sectionHeaderComments.toString();
+ if (originalHeader != normalizedHeader) {
+ throw new Exception(
+ "File headers changed.\nExpected:\n$originalHeader\n\nActual:\n$normalizedHeader");
+ }
+}
+
bool listEqual<T>(List<T> first, List<T> second) {
if (first.length != second.length) {
return false;
diff --git a/pkg/vm/bin/kernel_service.dart b/pkg/vm/bin/kernel_service.dart
index de93109..e146590 100644
--- a/pkg/vm/bin/kernel_service.dart
+++ b/pkg/vm/bin/kernel_service.dart
@@ -49,10 +49,14 @@
// 1 - Update in-memory file system with in-memory sources (used by tests).
// 2 - Accept last compilation result.
// 3 - APP JIT snapshot training run for kernel_service.
+// 4 - Allows for `dart:_internal` to be imported (used by tests).
const int kCompileTag = 0;
const int kUpdateSourcesTag = 1;
const int kAcceptTag = 2;
const int kTrainTag = 3;
+const int kAllowDartInternalImportTag = 4;
+
+bool allowDartInternalImport = false;
abstract class Compiler {
final FileSystem fileSystem;
@@ -76,13 +80,16 @@
print("DFE: platformKernelPath: ${platformKernelPath}");
print("DFE: strongMode: ${strongMode}");
print("DFE: syncAsync: ${syncAsync}");
+ print("DFE: allowDartInternalImport: ${allowDartInternalImport}");
}
options = new CompilerOptions()
..strongMode = strongMode
..fileSystem = fileSystem
- ..target = new VmTarget(
- new TargetFlags(strongMode: strongMode, syncAsync: syncAsync))
+ ..target = new VmTarget(new TargetFlags(
+ strongMode: strongMode,
+ syncAsync: syncAsync,
+ allowDartInternalImport: allowDartInternalImport))
..packagesFileUri = packagesUri
..sdkSummary = platformKernelPath
..verbose = verbose
@@ -281,6 +288,15 @@
}
port.send(new CompilationResult.ok(null).toResponse());
return;
+ } else if (tag == kAllowDartInternalImportTag) {
+ compiler = lookupIncrementalCompiler(isolateId);
+ assert(
+ lookupIncrementalCompiler(isolateId) == null,
+ "allowDartInternalImport must be set before creating a compiler"
+ " instance.");
+ allowDartInternalImport = true;
+ port.send(new CompilationResult.ok(null).toResponse());
+ return;
}
// script should only be null for kUpdateSourcesTag.
diff --git a/pkg/vm/bin/run_binary_size_analysis.dart b/pkg/vm/bin/run_binary_size_analysis.dart
new file mode 100644
index 0000000..512e56f
--- /dev/null
+++ b/pkg/vm/bin/run_binary_size_analysis.dart
@@ -0,0 +1,146 @@
+// 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 tool creates interactive navigatable binary size reports from
+// JSON file generated by the AOT compiler's --print-instructions-sizes-to
+// flag.
+//
+// It used the same visualization framework as Chromium's binary_size tool
+// located in runtime/third_party/binary_size.
+
+import 'dart:async';
+import 'dart:convert';
+import 'dart:io';
+import 'dart:math' show max;
+
+import 'package:path/path.dart' as p;
+
+void main(List<String> args) async {
+ if (args.length != 2) {
+ print(r"""
+Usage: run_binary_size_analysis.dart <symbol-sizes.json> <output-directory>
+
+This tool is used to process snapshot size reports produced by
+--print-instructions-sizes-to=symbol-sizes.json.
+
+It will create an interactive web-page in the output-directory which can be
+viewed in a browser:
+
+$ google-chrome <output-directory>/index.html
+""");
+ exit(-1);
+ }
+
+ final input = new File(args[0]);
+ final outputDir = new Directory(args[1]);
+
+ // Load symbols data produced by the AOT compiler and convert it to
+ // a tree.
+ final symbols = await input
+ .openRead()
+ .transform(utf8.decoder)
+ .transform(json.decoder)
+ .first;
+
+ final root = {'n': '', 'children': {}, 'k': kindPath, 'maxDepth': 0};
+ for (var symbol in symbols) {
+ final name = symbol['n'];
+ final size = symbol['s'];
+
+ if (symbol.containsKey('c')) {
+ final libraryUri = symbol['l'];
+ final className = symbol['c'];
+ addSymbol(root, '${libraryUri}/${className}', name, size);
+ } else {
+ addSymbol(root, '@stubs', name, size);
+ }
+ }
+ final tree = flatten(root);
+
+ // Create output directory and copy all auxiliary files from binary_size tool.
+ await outputDir.create(recursive: true);
+
+ final scriptLocation = p.dirname(Platform.script.toFilePath());
+ final sdkRoot = p.join(scriptLocation, '..', '..', '..');
+ final d3SrcDir = p.join(sdkRoot, 'runtime', 'third_party', 'd3', 'src');
+ final templateDir = p.join(
+ sdkRoot, 'runtime', 'third_party', 'binary_size', 'src', 'template');
+
+ final d3OutDir = p.join(outputDir.path, 'd3');
+ await new Directory(d3OutDir).create(recursive: true);
+
+ for (var file in ['LICENSE', 'd3.js']) {
+ await copyFile(d3SrcDir, file, d3OutDir);
+ }
+ for (var file in ['index.html', 'D3SymbolTreeMap.js']) {
+ await copyFile(templateDir, file, outputDir.path);
+ }
+
+ // Serialize symbol size tree as JSON.
+ final dataJsPath = p.join(outputDir.path, 'data.js');
+ final sink = new File(dataJsPath).openWrite();
+ sink.write('var tree_data=');
+ await sink.addStream(new Stream<Object>.fromIterable([tree])
+ .transform(json.encoder.fuse(utf8.encoder)));
+ await sink.close();
+
+ // Done.
+ print('Generated ${p.toUri(p.absolute(outputDir.path, 'index.html'))}');
+}
+
+const kindSymbol = 's';
+const kindPath = 'p';
+const kindBucket = 'b';
+const symbolTypeGlobalText = 'T';
+
+/// Create a child with the given name within the given node or return
+/// an existing child.
+Map<String, dynamic> addChild(
+ Map<String, dynamic> node, String kind, String name) {
+ return node['children'].putIfAbsent(name, () {
+ final n = <String, dynamic>{'n': name, 'k': kind};
+ if (kind != kindSymbol) {
+ n['children'] = {};
+ }
+ return n;
+ });
+}
+
+/// Add the given symbol to the tree.
+void addSymbol(Map<String, dynamic> root, String path, String name, int size) {
+ var node = root;
+ var depth = 0;
+ for (var part in path.split('/')) {
+ node = addChild(node, kindPath, part);
+ depth++;
+ }
+ node['lastPathElement'] = true;
+ node = addChild(node, kindBucket, symbolTypeGlobalText);
+ node['t'] = symbolTypeGlobalText;
+ node = addChild(node, kindSymbol, name);
+ node['t'] = symbolTypeGlobalText;
+ node['value'] = size;
+ depth += 2;
+ root['maxDepth'] = max(root['maxDepth'], depth);
+}
+
+/// Convert all children entries from maps to lists.
+Map<String, dynamic> flatten(Map<String, dynamic> node) {
+ dynamic children = node['children'];
+ if (children != null) {
+ children = children.values.map((dynamic v) => flatten(v)).toList();
+ node['children'] = children;
+ if (children.length == 1 && children.first['k'] == 'p') {
+ final singleChild = children.first;
+ singleChild['n'] = '${node['n']}/${singleChild['n']}';
+ return singleChild;
+ }
+ }
+ return node;
+}
+
+/// Copy file with the given name from [fromDir] to [toDir].
+Future<void> copyFile(String fromDir, String name, String toDir) async {
+ await new File(p.join(fromDir, name)).copy(p.join(toDir, name));
+}
diff --git a/pkg/vm/lib/frontend_server.dart b/pkg/vm/lib/frontend_server.dart
index d8644fa..fe7e529 100644
--- a/pkg/vm/lib/frontend_server.dart
+++ b/pkg/vm/lib/frontend_server.dart
@@ -48,6 +48,8 @@
..addFlag('strong',
help: 'Run compiler in strong mode (uses strong mode semantics)',
defaultsTo: false)
+ ..addFlag('sync-async',
+ help: 'Start `async` functions synchronously.', defaultsTo: false)
..addFlag('tfa',
help:
'Enable global type flow analysis and related transformations in AOT mode.',
@@ -250,8 +252,8 @@
}
}
- final TargetFlags targetFlags =
- new TargetFlags(strongMode: options['strong']);
+ final TargetFlags targetFlags = new TargetFlags(
+ strongMode: options['strong'], syncAsync: options['sync-async']);
compilerOptions.target = getTarget(options['target'], targetFlags);
Component component;
@@ -284,7 +286,8 @@
final BinaryPrinter printer = printerFactory.newBinaryPrinter(sink);
printer.writeComponentFile(component);
await sink.close();
- _outputStream.writeln('$boundaryKey $_kernelBinaryFilename');
+ _outputStream
+ .writeln('$boundaryKey $_kernelBinaryFilename ${errors.length}');
final String depfile = options['depfile'];
if (depfile != null) {
await _writeDepfile(component, _kernelBinaryFilename, depfile);
@@ -346,6 +349,7 @@
if (filename != null) {
setMainSourceFilename(filename);
}
+ errors.clear();
final Component deltaProgram =
await _generator.compile(entryPoint: _mainSource);
@@ -357,7 +361,8 @@
final BinaryPrinter printer = printerFactory.newBinaryPrinter(sink);
printer.writeComponentFile(deltaProgram);
await sink.close();
- _outputStream.writeln('$boundaryKey $_kernelBinaryFilename');
+ _outputStream
+ .writeln('$boundaryKey $_kernelBinaryFilename ${errors.length}');
_kernelBinaryFilename = _kernelBinaryFilenameIncremental;
return null;
}
diff --git a/pkg/vm/lib/transformations/no_dynamic_invocations_annotator.dart b/pkg/vm/lib/transformations/no_dynamic_invocations_annotator.dart
index 00e93ff..9806c89 100644
--- a/pkg/vm/lib/transformations/no_dynamic_invocations_annotator.dart
+++ b/pkg/vm/lib/transformations/no_dynamic_invocations_annotator.dart
@@ -168,7 +168,7 @@
super.visitMethodInvocation(node);
Selector selector;
- if (node.dispatchCategory == DispatchCategory.dynamicDispatch) {
+ if (node.interfaceTarget == null) {
dynamicSelectors.add(new Selector.doInvoke(node.name));
} else {
if (node.receiver is! ThisExpression) {
@@ -182,13 +182,9 @@
super.visitDirectMethodInvocation(node);
Selector selector;
- if (node.dispatchCategory == DispatchCategory.dynamicDispatch) {
- dynamicSelectors.add(selector = new Selector.doInvoke(node.target.name));
- } else {
- if (node.receiver is! ThisExpression) {
- nonThisSelectors
- .add(selector ??= new Selector.doInvoke(node.target.name));
- }
+ if (node.receiver is! ThisExpression) {
+ nonThisSelectors
+ .add(selector ??= new Selector.doInvoke(node.target.name));
}
}
@@ -197,7 +193,7 @@
super.visitPropertyGet(node);
Selector selector;
- if (node.dispatchCategory == DispatchCategory.dynamicDispatch) {
+ if (node.interfaceTarget == null) {
dynamicSelectors.add(selector = new Selector.doGet(node.name));
} else {
if (node.receiver is! ThisExpression) {
@@ -215,17 +211,13 @@
visitDirectPropertyGet(DirectPropertyGet node) {
super.visitDirectPropertyGet(node);
- if (node.dispatchCategory == DispatchCategory.dynamicDispatch) {
- dynamicSelectors.add(new Selector.doGet(node.target.name));
- } else {
- if (node.receiver is! ThisExpression) {
- nonThisSelectors.add(new Selector.doGet(node.target.name));
- }
+ if (node.receiver is! ThisExpression) {
+ nonThisSelectors.add(new Selector.doGet(node.target.name));
+ }
- final target = node.target;
- if (target is Procedure && target.kind == ProcedureKind.Method) {
- tearOffSelectors.add(new Selector.doInvoke(target.name));
- }
+ final target = node.target;
+ if (target is Procedure && target.kind == ProcedureKind.Method) {
+ tearOffSelectors.add(new Selector.doInvoke(target.name));
}
}
@@ -234,7 +226,7 @@
super.visitPropertySet(node);
Selector selector;
- if (node.dispatchCategory == DispatchCategory.dynamicDispatch) {
+ if (node.interfaceTarget == null) {
dynamicSelectors.add(selector = new Selector.doSet(node.name));
} else {
if (node.receiver is! ThisExpression) {
@@ -248,12 +240,8 @@
super.visitDirectPropertySet(node);
Selector selector;
- if (node.dispatchCategory == DispatchCategory.dynamicDispatch) {
- dynamicSelectors.add(selector = new Selector.doSet(node.target.name));
- } else {
- if (node.receiver is! ThisExpression) {
- nonThisSelectors.add(selector ??= new Selector.doSet(node.target.name));
- }
+ if (node.receiver is! ThisExpression) {
+ nonThisSelectors.add(selector ??= new Selector.doSet(node.target.name));
}
}
}
diff --git a/pkg/vm/lib/transformations/type_flow/analysis.dart b/pkg/vm/lib/transformations/type_flow/analysis.dart
index 227ba12..99a885c 100644
--- a/pkg/vm/lib/transformations/type_flow/analysis.dart
+++ b/pkg/vm/lib/transformations/type_flow/analysis.dart
@@ -161,6 +161,12 @@
// Call via field.
// TODO(alexmarkov): support function types and use inferred type
// to get more precise return type.
+ final receiver = fieldValue.getValue(typeFlowAnalysis);
+ if (receiver != const EmptyType()) {
+ typeFlowAnalysis.applyCall(/* callSite = */ null,
+ DynamicSelector.kCall, new Args.withReceiver(args, receiver),
+ isResultUsed: false, processImmediately: false);
+ }
return new Type.nullableAny();
case CallKind.FieldInitializer:
@@ -212,6 +218,9 @@
member.isGetter);
typeFlowAnalysis.addRawCall(
new DirectSelector(member, callKind: CallKind.PropertyGet));
+ typeFlowAnalysis.applyCall(/* callSite = */ null, DynamicSelector.kCall,
+ new Args.withReceiver(args, new Type.nullableAny()),
+ isResultUsed: false, processImmediately: false);
return new Type.nullableAny();
}
}
@@ -1098,9 +1107,8 @@
/// ---- Implementation of [CallHandler] interface. ----
@override
- Type applyCall(
- Call callSite, Selector selector, Args<Type> args, bool isResultUsed,
- {bool processImmediately: true}) {
+ Type applyCall(Call callSite, Selector selector, Args<Type> args,
+ {bool isResultUsed: true, bool processImmediately: true}) {
_Invocation invocation = _invocationsCache.getInvocation(selector, args);
// Test if tracing is enabled to avoid expensive message formatting.
@@ -1140,8 +1148,8 @@
debugPrint("ADD RAW CALL: $selector");
assertx(selector is! DynamicSelector); // TODO(alexmarkov)
- applyCall(null, selector, summaryCollector.rawArguments(selector), false,
- processImmediately: false);
+ applyCall(null, selector, summaryCollector.rawArguments(selector),
+ isResultUsed: false, processImmediately: false);
}
@override
diff --git a/pkg/vm/lib/transformations/type_flow/calls.dart b/pkg/vm/lib/transformations/type_flow/calls.dart
index 02166f9..ac69128 100644
--- a/pkg/vm/lib/transformations/type_flow/calls.dart
+++ b/pkg/vm/lib/transformations/type_flow/calls.dart
@@ -138,6 +138,8 @@
@override
final Name name;
+ static final kCall = new DynamicSelector(CallKind.Method, new Name('call'));
+
DynamicSelector(CallKind callKind, this.name) : super(callKind);
@override
diff --git a/pkg/vm/lib/transformations/type_flow/summary.dart b/pkg/vm/lib/transformations/type_flow/summary.dart
index 7c23deb..e918a6d 100644
--- a/pkg/vm/lib/transformations/type_flow/summary.dart
+++ b/pkg/vm/lib/transformations/type_flow/summary.dart
@@ -14,8 +14,8 @@
import 'utils.dart';
abstract class CallHandler {
- Type applyCall(
- Call callSite, Selector selector, Args<Type> args, bool isResultUsed);
+ Type applyCall(Call callSite, Selector selector, Args<Type> args,
+ {bool isResultUsed});
}
/// Base class for all statements in a summary.
@@ -183,8 +183,9 @@
if (selector is! DirectSelector) {
_observeReceiverType(argTypes[0]);
}
- final Type result = callHandler.applyCall(this, selector,
- new Args<Type>(argTypes, names: args.names), isResultUsed);
+ final Type result = callHandler.applyCall(
+ this, selector, new Args<Type>(argTypes, names: args.names),
+ isResultUsed: isResultUsed);
if (isResultUsed) {
_observeResultType(result, typeHierarchy);
}
diff --git a/pkg/vm/lib/transformations/type_flow/summary_collector.dart b/pkg/vm/lib/transformations/type_flow/summary_collector.dart
index 8d48f99..01e6738 100644
--- a/pkg/vm/lib/transformations/type_flow/summary_collector.dart
+++ b/pkg/vm/lib/transformations/type_flow/summary_collector.dart
@@ -476,7 +476,9 @@
Call _makeCall(TreeNode node, Selector selector, Args<TypeExpr> args) {
Call call = new Call(selector, args);
_summary.add(call);
- callSites[node] = call;
+ if (node != null) {
+ callSites[node] = call;
+ }
return call;
}
@@ -714,10 +716,12 @@
}
if ((target is Field) || ((target is Procedure) && target.isGetter)) {
// Call via field.
- _makeCall(
+ final fieldValue = _makeCall(
node,
new InterfaceSelector(target, callKind: CallKind.PropertyGet),
new Args<TypeExpr>([receiver]));
+ _makeCall(
+ null, DynamicSelector.kCall, new Args.withReceiver(args, fieldValue));
return _staticType(node);
} else {
// TODO(alexmarkov): overloaded arithmetic operators
@@ -777,10 +781,12 @@
// Call via field.
// TODO(alexmarkov): Consider cleaning up this code as it duplicates
// processing in DirectInvocation.
- _makeCall(
+ final fieldValue = _makeCall(
node,
new DirectSelector(target, callKind: CallKind.PropertyGet),
new Args<TypeExpr>([_receiver]));
+ _makeCall(null, DynamicSelector.kCall,
+ new Args.withReceiver(args, fieldValue));
return _staticType(node);
} else {
return _makeCall(node, new DirectSelector(target), args);
diff --git a/pkg/vm/test/frontend_server_test.dart b/pkg/vm/test/frontend_server_test.dart
index f0f9159..bac3e69 100644
--- a/pkg/vm/test/frontend_server_test.dart
+++ b/pkg/vm/test/frontend_server_test.dart
@@ -67,6 +67,27 @@
)).captured;
expect(capturedArgs.single['sdk-root'], equals('sdkroot'));
expect(capturedArgs.single['strong'], equals(true));
+ expect(capturedArgs.single['sync-async'], equals(false));
+ });
+
+ test('compile from command line (sync-async)', () async {
+ final List<String> args = <String>[
+ 'server.dart',
+ '--sdk-root',
+ 'sdkroot',
+ '--strong',
+ '--sync-async',
+ ];
+ final int exitcode = await starter(args, compiler: compiler);
+ expect(exitcode, equals(0));
+ final List<ArgResults> capturedArgs = verify(compiler.compile(
+ argThat(equals('server.dart')),
+ captureAny,
+ generator: any,
+ )).captured;
+ expect(capturedArgs.single['sdk-root'], equals('sdkroot'));
+ expect(capturedArgs.single['strong'], equals(true));
+ expect(capturedArgs.single['sync-async'], equals(true));
});
test('compile from command line with link platform', () async {
@@ -491,11 +512,17 @@
streamController.add('compile ${file.path}\n'.codeUnits);
int count = 0;
Completer<bool> allDone = new Completer<bool>();
- receivedResults.stream.listen((String outputFilename) {
+ receivedResults.stream.listen((String outputFilenameAndErrorCount) {
+ int delim = outputFilenameAndErrorCount.lastIndexOf(' ');
+ expect(delim > 0, equals(true));
+ String outputFilename = outputFilenameAndErrorCount.substring(0, delim);
+ int errorsCount =
+ int.parse(outputFilenameAndErrorCount.substring(delim + 1).trim());
if (count == 0) {
// First request is to 'compile', which results in full kernel file.
expect(dillFile.existsSync(), equals(true));
expect(outputFilename, dillFile.path);
+ expect(errorsCount, 0);
count += 1;
streamController.add('accept\n'.codeUnits);
var file2 = new File('${tempDir.path}/bar.dart')..createSync();
@@ -510,6 +537,7 @@
// kernel file.
var dillIncFile = new File('${dillFile.path}.incremental.dill');
expect(outputFilename, dillIncFile.path);
+ expect(errorsCount, 0);
expect(dillIncFile.existsSync(), equals(true));
allDone.complete(true);
}
@@ -517,6 +545,93 @@
expect(await allDone.future, true);
});
+ test('compile and recompile report non-zero error count', () async {
+ var file = new File('${tempDir.path}/foo.dart')..createSync();
+ file.writeAsStringSync("main() { foo(); bar(); }\n");
+ var dillFile = new File('${tempDir.path}/app.dill');
+ expect(dillFile.existsSync(), equals(false));
+ final List<String> args = <String>[
+ '--sdk-root=${sdkRoot.toFilePath()}',
+ '--strong',
+ '--incremental',
+ '--platform=${platformKernel.path}',
+ '--output-dill=${dillFile.path}'
+ ];
+
+ final StreamController<List<int>> streamController =
+ new StreamController<List<int>>();
+ final StreamController<List<int>> stdoutStreamController =
+ new StreamController<List<int>>();
+ final IOSink ioSink = new IOSink(stdoutStreamController.sink);
+ StreamController<String> receivedResults = new StreamController<String>();
+
+ String boundaryKey;
+ stdoutStreamController.stream
+ .transform(utf8.decoder)
+ .transform(const LineSplitter())
+ .listen((String s) {
+ const String RESULT_OUTPUT_SPACE = 'result ';
+ if (boundaryKey == null) {
+ if (s.startsWith(RESULT_OUTPUT_SPACE)) {
+ boundaryKey = s.substring(RESULT_OUTPUT_SPACE.length);
+ }
+ } else {
+ if (s.startsWith(boundaryKey)) {
+ receivedResults.add(s.substring(boundaryKey.length + 1));
+ boundaryKey = null;
+ }
+ }
+ });
+ int exitcode =
+ await starter(args, input: streamController.stream, output: ioSink);
+ expect(exitcode, equals(0));
+ streamController.add('compile ${file.path}\n'.codeUnits);
+ int count = 0;
+ Completer<bool> allDone = new Completer<bool>();
+ receivedResults.stream.listen((String outputFilenameAndErrorCount) {
+ int delim = outputFilenameAndErrorCount.lastIndexOf(' ');
+ expect(delim > 0, equals(true));
+ String outputFilename = outputFilenameAndErrorCount.substring(0, delim);
+ int errorsCount =
+ int.parse(outputFilenameAndErrorCount.substring(delim + 1).trim());
+ switch (count) {
+ case 0:
+ expect(dillFile.existsSync(), equals(true));
+ expect(outputFilename, dillFile.path);
+ expect(errorsCount, 2);
+ count += 1;
+ streamController.add('accept\n'.codeUnits);
+ var file2 = new File('${tempDir.path}/bar.dart')..createSync();
+ file2.writeAsStringSync("main() { baz(); }\n");
+ streamController.add('recompile ${file2.path} abc\n'
+ '${file2.path}\n'
+ 'abc\n'
+ .codeUnits);
+ break;
+ case 1:
+ var dillIncFile = new File('${dillFile.path}.incremental.dill');
+ expect(outputFilename, dillIncFile.path);
+ expect(errorsCount, 1);
+ count += 1;
+ streamController.add('accept\n'.codeUnits);
+ var file2 = new File('${tempDir.path}/bar.dart')..createSync();
+ file2.writeAsStringSync("main() { }\n");
+ streamController.add('recompile ${file2.path} abc\n'
+ '${file2.path}\n'
+ 'abc\n'
+ .codeUnits);
+ break;
+ case 2:
+ var dillIncFile = new File('${dillFile.path}.incremental.dill');
+ expect(outputFilename, dillIncFile.path);
+ expect(errorsCount, 0);
+ expect(dillIncFile.existsSync(), equals(true));
+ allDone.complete(true);
+ }
+ });
+ expect(await allDone.future, true);
+ });
+
test('compile and recompile with MultiRootFileSystem', () async {
var file = new File('${tempDir.path}/foo.dart')..createSync();
file.writeAsStringSync("main() {}\n");
diff --git a/pkg/vm/testcases/transformations/type_flow/summary_collector/calls.dart.expect b/pkg/vm/testcases/transformations/type_flow/summary_collector/calls.dart.expect
index 3b59fa8..4deba6d 100644
--- a/pkg/vm/testcases/transformations/type_flow/summary_collector/calls.dart.expect
+++ b/pkg/vm/testcases/transformations/type_flow/summary_collector/calls.dart.expect
@@ -39,7 +39,8 @@
t7* = _Call get [#lib::A::foo2] (%aa)
t8 = _Narrow (t7 to _T (dart.core::int)+?)
t9 = _Call set [#lib::A::foo3] (%aa, t8)
-t10 = _Call get [#lib::A::foo2] (%aa)
+t10* = _Call get [#lib::A::foo2] (%aa)
+t11 = _Call dynamic [call] (t10, %a2, %a3, _T ANY?)
a4 = _Join [dart.core::Object] (%a4, _T ANY?)
RESULT: a4
------------ #lib::C::dynamicCalls ------------
diff --git a/pkg/vm/testcases/transformations/type_flow/transformer/regress_flutter16182.dart b/pkg/vm/testcases/transformations/type_flow/transformer/regress_flutter16182.dart
new file mode 100644
index 0000000..81c386e
--- /dev/null
+++ b/pkg/vm/testcases/transformations/type_flow/transformer/regress_flutter16182.dart
@@ -0,0 +1,143 @@
+// Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+// Regression test for https://github.com/flutter/flutter/issues/16182
+// Verifies that TFA correctly handles calls via fields/getters.
+
+import "package:expect/expect.dart";
+
+bool ok;
+
+class T1 {
+ // Should be reachable.
+ void doTest1() {
+ ok = true;
+ }
+}
+
+class A1 {
+ T1 foo;
+
+ void call([a1, a2, a3, a4, a5]) {
+ foo = a5;
+ }
+}
+
+class B1 {
+ A1 aa1 = new A1();
+}
+
+void test1() {
+ B1 bb = new B1();
+ bb.aa1(1, 2, 3, 4, new T1());
+
+ ok = false;
+ bb.aa1.foo.doTest1();
+ Expect.isTrue(ok);
+}
+
+class T2 {
+ // Should be reachable.
+ void doTest2() {
+ ok = true;
+ }
+}
+
+class A2 {
+ dynamic foo;
+
+ void call([a1, a2, a3, a4, a5, a6]) {
+ foo = a6;
+ }
+}
+
+class B2Base {
+ dynamic _aa = new A2();
+ dynamic get aa2 => _aa;
+}
+
+class B2 extends B2Base {
+ void doSuperCall() {
+ super.aa2(1, 2, 3, 4, 5, new T2());
+ }
+}
+
+void test2() {
+ var bb = new B2();
+ bb.doSuperCall();
+
+ ok = false;
+ bb.aa2.foo.doTest2();
+ Expect.isTrue(ok);
+}
+
+class T3 {
+ // Should be reachable.
+ void doTest3() {
+ ok = true;
+ }
+}
+
+class A3 {
+ dynamic foo;
+
+ void call([a1, a2, a3, a4, a5, a6, a7]) {
+ foo = a7;
+ }
+}
+
+class B3 {
+ A3 aa3 = new A3();
+}
+
+dynamic bb3 = new B3();
+Function unknown3 = () => bb3;
+getDynamic3() => unknown3.call();
+
+void test3() {
+ getDynamic3().aa3(1, 2, 3, 4, 5, 6, new T3());
+
+ ok = false;
+ bb3.aa3.foo.doTest3();
+ Expect.isTrue(ok);
+}
+
+class T4 {
+ // Should be reachable.
+ void doTest4() {
+ ok = true;
+ }
+}
+
+class A4 {
+ dynamic foo;
+
+ void call([a1, a2, a3, a4, a5, a6, a7, a8]) {
+ foo = a8;
+ }
+}
+
+class B4 {
+ dynamic _aa = new A4();
+ dynamic get aa4 => _aa;
+}
+
+dynamic bb4 = new B4();
+Function unknown4 = () => bb4;
+getDynamic4() => unknown4.call();
+
+void test4() {
+ getDynamic4().aa4(1, 2, 3, 4, 5, 6, 7, new T4());
+
+ ok = false;
+ getDynamic4().aa4.foo.doTest4();
+ Expect.isTrue(ok);
+}
+
+void main() {
+ test1();
+ test2();
+ test3();
+ test4();
+}
diff --git a/pkg/vm/testcases/transformations/type_flow/transformer/regress_flutter16182.dart.expect b/pkg/vm/testcases/transformations/type_flow/transformer/regress_flutter16182.dart.expect
new file mode 100644
index 0000000..18cbd9d4
--- /dev/null
+++ b/pkg/vm/testcases/transformations/type_flow/transformer/regress_flutter16182.dart.expect
@@ -0,0 +1,150 @@
+library #lib;
+import self as self;
+import "dart:core" as core;
+import "package:expect/expect.dart" as exp;
+
+class T1 extends core::Object {
+ synthetic constructor •() → void
+ : super core::Object::•()
+ ;
+ method doTest1() → void {
+ self::ok = true;
+ }
+}
+class A1 extends core::Object {
+[@vm.inferred-type.metadata=#lib::T1?] field self::T1 foo = null;
+ synthetic constructor •() → void
+ : super core::Object::•()
+ ;
+ method call([dynamic a1 = null, dynamic a2 = null, dynamic a3 = null, dynamic a4 = null, [@vm.inferred-type.metadata=#lib::T1?] dynamic a5 = null]) → void {
+ [@vm.direct-call.metadata=#lib::A1::foo] this.{self::A1::foo} = a5 as{TypeError} self::T1;
+ }
+}
+class B1 extends core::Object {
+[@vm.inferred-type.metadata=#lib::A1] field self::A1 aa1 = new self::A1::•();
+ synthetic constructor •() → void
+ : super core::Object::•()
+ ;
+}
+class T2 extends core::Object {
+ synthetic constructor •() → void
+ : super core::Object::•()
+ ;
+ method doTest2() → void {
+ self::ok = true;
+ }
+}
+class A2 extends core::Object {
+[@vm.inferred-type.metadata=#lib::T2?] field dynamic foo = null;
+ synthetic constructor •() → void
+ : super core::Object::•()
+ ;
+ method call([dynamic a1 = null, dynamic a2 = null, dynamic a3 = null, dynamic a4 = null, dynamic a5 = null, [@vm.inferred-type.metadata=#lib::T2?] dynamic a6 = null]) → void {
+ [@vm.direct-call.metadata=#lib::A2::foo] this.{self::A2::foo} = a6;
+ }
+}
+abstract class B2Base extends core::Object {
+[@vm.inferred-type.metadata=#lib::A2] field dynamic _aa = new self::A2::•();
+ synthetic constructor •() → void
+ : super core::Object::•()
+ ;
+ get aa2() → dynamic
+ return [@vm.direct-call.metadata=#lib::B2Base::_aa] [@vm.inferred-type.metadata=#lib::A2] this.{self::B2Base::_aa};
+}
+class B2 extends self::B2Base {
+ synthetic constructor •() → void
+ : super self::B2Base::•()
+ ;
+ method doSuperCall() → void {
+ [@vm.inferred-type.metadata=#lib::A2] super.{self::B2Base::aa2}.call(1, 2, 3, 4, 5, new self::T2::•());
+ }
+}
+class T3 extends core::Object {
+ synthetic constructor •() → void
+ : super core::Object::•()
+ ;
+ method doTest3() → void {
+ self::ok = true;
+ }
+}
+class A3 extends core::Object {
+[@vm.inferred-type.metadata=#lib::T3?] field dynamic foo = null;
+ synthetic constructor •() → void
+ : super core::Object::•()
+ ;
+ method call([dynamic a1 = null, dynamic a2 = null, dynamic a3 = null, dynamic a4 = null, dynamic a5 = null, dynamic a6 = null, [@vm.inferred-type.metadata=#lib::T3?] dynamic a7 = null]) → void {
+ [@vm.direct-call.metadata=#lib::A3::foo] this.{self::A3::foo} = a7;
+ }
+}
+class B3 extends core::Object {
+[@vm.inferred-type.metadata=#lib::A3] field self::A3 aa3 = new self::A3::•();
+ synthetic constructor •() → void
+ : super core::Object::•()
+ ;
+}
+class T4 extends core::Object {
+ synthetic constructor •() → void
+ : super core::Object::•()
+ ;
+ method doTest4() → void {
+ self::ok = true;
+ }
+}
+class A4 extends core::Object {
+[@vm.inferred-type.metadata=#lib::T4?] field dynamic foo = null;
+ synthetic constructor •() → void
+ : super core::Object::•()
+ ;
+ method call([dynamic a1 = null, dynamic a2 = null, dynamic a3 = null, dynamic a4 = null, dynamic a5 = null, dynamic a6 = null, dynamic a7 = null, [@vm.inferred-type.metadata=#lib::T4?] dynamic a8 = null]) → void {
+ [@vm.direct-call.metadata=#lib::A4::foo] this.{self::A4::foo} = a8;
+ }
+}
+class B4 extends core::Object {
+[@vm.inferred-type.metadata=#lib::A4] field dynamic _aa = new self::A4::•();
+ synthetic constructor •() → void
+ : super core::Object::•()
+ ;
+ get aa4() → dynamic
+ return [@vm.direct-call.metadata=#lib::B4::_aa] [@vm.inferred-type.metadata=#lib::A4] this.{self::B4::_aa};
+}
+[@vm.inferred-type.metadata=dart.core::bool?]static field core::bool ok;
+[@vm.inferred-type.metadata=#lib::B3?]static field dynamic bb3 = new self::B3::•();
+[@vm.inferred-type.metadata=dart.core::_Closure?]static field core::Function unknown3 = () → dynamic => self::bb3;
+[@vm.inferred-type.metadata=#lib::B4?]static field dynamic bb4 = new self::B4::•();
+[@vm.inferred-type.metadata=dart.core::_Closure?]static field core::Function unknown4 = () → dynamic => self::bb4;
+static method test1() → void {
+ self::B1 bb = new self::B1::•();
+ [@vm.inferred-type.metadata=#lib::A1] bb.{self::B1::aa1}(1, 2, 3, 4, new self::T1::•());
+ self::ok = false;
+ [@vm.direct-call.metadata=#lib::T1::doTest1??] [@vm.direct-call.metadata=#lib::A1::foo] [@vm.inferred-type.metadata=#lib::T1?] [@vm.direct-call.metadata=#lib::B1::aa1] [@vm.inferred-type.metadata=#lib::A1] bb.{self::B1::aa1}.{self::A1::foo}.{self::T1::doTest1}();
+ exp::Expect::isTrue([@vm.inferred-type.metadata=dart.core::bool?] self::ok);
+}
+static method test2() → void {
+ self::B2 bb = new self::B2::•();
+ [@vm.direct-call.metadata=#lib::B2::doSuperCall] bb.{self::B2::doSuperCall}();
+ self::ok = false;
+ [@vm.inferred-type.metadata=#lib::T2?] [@vm.direct-call.metadata=#lib::B2Base::aa2] [@vm.inferred-type.metadata=#lib::A2] bb.{self::B2Base::aa2}.foo.doTest2();
+ exp::Expect::isTrue([@vm.inferred-type.metadata=dart.core::bool?] self::ok);
+}
+static method getDynamic3() → dynamic
+ return self::unknown3.call();
+static method test3() → void {
+ self::getDynamic3().aa3(1, 2, 3, 4, 5, 6, new self::T3::•());
+ self::ok = false;
+ [@vm.inferred-type.metadata=#lib::T3?] [@vm.inferred-type.metadata=#lib::A3] [@vm.inferred-type.metadata=#lib::B3?] self::bb3.aa3.foo.doTest3();
+ exp::Expect::isTrue([@vm.inferred-type.metadata=dart.core::bool?] self::ok);
+}
+static method getDynamic4() → dynamic
+ return self::unknown4.call();
+static method test4() → void {
+ self::getDynamic4().aa4(1, 2, 3, 4, 5, 6, 7, new self::T4::•());
+ self::ok = false;
+ [@vm.inferred-type.metadata=#lib::T4?] [@vm.inferred-type.metadata=#lib::A4] self::getDynamic4().aa4.foo.doTest4();
+ exp::Expect::isTrue([@vm.inferred-type.metadata=dart.core::bool?] self::ok);
+}
+static method main() → void {
+ self::test1();
+ self::test2();
+ self::test3();
+ self::test4();
+}
diff --git a/runtime/bin/BUILD.gn b/runtime/bin/BUILD.gn
index 4c8d954..a735862 100644
--- a/runtime/bin/BUILD.gn
+++ b/runtime/bin/BUILD.gn
@@ -860,7 +860,11 @@
if (defined(invoker.extra_sources)) {
extra_sources += invoker.extra_sources
}
- executable(target_name) {
+ target_type = "executable"
+ if (defined(invoker.target_type)) {
+ target_type = invoker.target_type
+ }
+ target(target_type, target_name) {
configs += [
"..:dart_arch_config",
"..:dart_config",
@@ -984,6 +988,27 @@
}
}
+dart_executable("dart_precompiled_runtime_for_linking") {
+ extra_configs = [ "..:dart_precompiled_runtime_config" ]
+ extra_deps = [ "..:libdart_precompiled_runtime" ]
+ if (dart_runtime_mode != "release") {
+ extra_deps += [ "../observatory:standalone_observatory_archive" ]
+ }
+ extra_sources = [
+ "builtin_nolib.cc",
+ "snapshot_empty.cc",
+ "loader.cc",
+ "loader.h",
+ "gzip.cc",
+ "gzip.h",
+ ]
+ if (dart_runtime_mode == "release") {
+ extra_sources += [ "observatory_assets_empty.cc" ]
+ }
+ extra_defines = [ "DART_LINK_APP_SNAPSHOT" ]
+ target_type = "static_library"
+}
+
dart_executable("dart_bootstrap") {
extra_configs = [
"..:dart_precompiler_config",
diff --git a/runtime/bin/main.cc b/runtime/bin/main.cc
index 99597f7..4e330cf 100644
--- a/runtime/bin/main.cc
+++ b/runtime/bin/main.cc
@@ -44,6 +44,15 @@
extern const uint8_t kDartCoreIsolateSnapshotInstructions[];
}
+#if defined(DART_LINK_APP_SNAPSHOT)
+extern "C" {
+extern const uint8_t _kDartVmSnapshotData[];
+extern const uint8_t _kDartVmSnapshotInstructions[];
+extern const uint8_t _kDartIsolateSnapshotData[];
+extern const uint8_t _kDartIsolateSnapshotInstructions[];
+}
+#endif
+
namespace dart {
namespace bin {
@@ -1059,6 +1068,13 @@
Platform::Exit(kErrorExitCode);
}
+#if defined(DART_LINK_APP_SNAPSHOT)
+ vm_run_app_snapshot = true;
+ vm_snapshot_data = _kDartVmSnapshotData;
+ vm_snapshot_instructions = _kDartVmSnapshotInstructions;
+ app_isolate_snapshot_data = _kDartIsolateSnapshotData;
+ app_isolate_snapshot_instructions = _kDartIsolateSnapshotInstructions;
+#else
AppSnapshot* app_snapshot = Snapshot::TryReadAppSnapshot(script_name);
if (app_snapshot != NULL) {
vm_run_app_snapshot = true;
@@ -1066,6 +1082,7 @@
&app_isolate_snapshot_data,
&app_isolate_snapshot_instructions);
}
+#endif
#if !defined(PRODUCT) && !defined(DART_PRECOMPILED_RUNTIME)
// Constant true if PRODUCT or DART_PRECOMPILED_RUNTIME.
@@ -1161,7 +1178,9 @@
Process::ClearAllSignalHandlers();
EventHandler::Stop();
+#if !defined(DART_LINK_APP_SNAPSHOT)
delete app_snapshot;
+#endif
free(app_script_uri);
// Free copied argument strings if converted.
diff --git a/runtime/bin/main_options.cc b/runtime/bin/main_options.cc
index 2a79347..a002959 100644
--- a/runtime/bin/main_options.cc
+++ b/runtime/bin/main_options.cc
@@ -406,6 +406,9 @@
// The arguments to the VM are at positions 1 through i-1 in argv.
Platform::SetExecutableArguments(i, argv);
+#if defined(DART_LINK_APP_SNAPSHOT)
+ *script_name = argv[0];
+#else
// Get the script name.
if (i < argc) {
*script_name = argv[i];
@@ -413,6 +416,7 @@
} else {
return -1;
}
+#endif
// Parse out options to be passed to dart main.
while (i < argc) {
diff --git a/runtime/lib/bigint_patch.dart b/runtime/lib/bigint_patch.dart
index 331dd25..5fc7a32 100644
--- a/runtime/lib/bigint_patch.dart
+++ b/runtime/lib/bigint_patch.dart
@@ -54,6 +54,10 @@
_BigIntImpl.parse(source, radix: radix);
@patch
+ static BigInt tryParse(String source, {int radix}) =>
+ _BigIntImpl._tryParse(source, radix: radix);
+
+ @patch
factory BigInt.from(num value) => new _BigIntImpl.from(value);
}
@@ -1352,11 +1356,11 @@
Uint32List yDigits;
int yUsed;
if (nsh > 0) {
- // Extra digits for normalization.
- yDigits = _newDigits(other._used + (nsh % _digitBits) + 1);
- yUsed = _lShiftDigits(other._digits, other._used, nsh, yDigits);
// Extra digits for normalization, also used for possible _mulAdd carry.
- resultDigits = _newDigits(_used + (nsh % _digitBits) + 1);
+ var numExtraDigits = (nsh + _digitBits - 1) ~/ _digitBits + 1;
+ yDigits = _newDigits(other._used + numExtraDigits);
+ yUsed = _lShiftDigits(other._digits, other._used, nsh, yDigits);
+ resultDigits = _newDigits(_used + numExtraDigits);
resultUsed = _lShiftDigits(_digits, _used, nsh, resultDigits);
} else {
yDigits = other._digits;
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/double_patch.dart b/runtime/lib/double_patch.dart
index 221bc93..a621e66 100644
--- a/runtime/lib/double_patch.dart
+++ b/runtime/lib/double_patch.dart
@@ -103,7 +103,8 @@
}
@patch
- static double parse(String source, [double onError(String source)]) {
+ static double parse(String source,
+ [@deprecated double onError(String source)]) {
var result = _parse(source);
if (result == null) {
if (onError == null) throw new FormatException("Invalid double", source);
@@ -111,4 +112,7 @@
}
return result;
}
+
+ @patch
+ static double tryParse(String source) => _parse(source);
}
diff --git a/runtime/lib/integers_patch.dart b/runtime/lib/integers_patch.dart
index ef98727..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.
}
@@ -107,6 +107,22 @@
return result;
}
+ @patch
+ static int tryParse(String source, {int radix}) {
+ if (source == null) throw new ArgumentError("The source must not be null");
+ if (source.isEmpty) return null;
+ if (radix == null || radix == 10) {
+ // Try parsing immediately, without trimming whitespace.
+ int result = _tryParseSmi(source, 0, source.length - 1);
+ if (result != null) return result;
+ } else if (radix < 2 || radix > 36) {
+ throw new RangeError("Radix $radix not in range 2..36");
+ }
+ return _parse(source, radix, _kNull);
+ }
+
+ static Null _kNull(_) => null;
+
static int _throwFormatException(onError, source, index, radix) {
if (onError != null) return onError(source);
if (radix == null) {
@@ -117,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) {
@@ -143,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 =
@@ -159,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;
}
@@ -207,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
@@ -252,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/invocation_mirror_patch.dart b/runtime/lib/invocation_mirror_patch.dart
index 30c3e74d6..06ceeb4 100644
--- a/runtime/lib/invocation_mirror_patch.dart
+++ b/runtime/lib/invocation_mirror_patch.dart
@@ -81,8 +81,7 @@
List<Type> get typeArguments {
if (_typeArguments == null) {
- int typeArgsLen =
- _decodeTypeArgsLenEntry(_argumentsDescriptor[_TYPE_ARGS_LEN]);
+ int typeArgsLen = _argumentsDescriptor[_TYPE_ARGS_LEN];
if (typeArgsLen == 0) {
return _typeArguments = const <Type>[];
}
@@ -98,62 +97,37 @@
static List<Type> _unpackTypeArguments(typeArguments)
native "InvocationMirror_unpackTypeArguments";
- // Extract the compressed representation of the number of positional arguments
- // from the corresponding entry in the 'ArgumentsDescriptor'.
- static int _decodePositionalCountEntry(positionalCountEntry)
- native "InvocationMirror_decodePositionalCountEntry";
-
- // Extract the compressed representation of the number of type arguments
- // from the corresponding entry in the 'ArgumentsDescriptor'.
- static int _decodeTypeArgsLenEntry(typeArgsLenEntry)
- native "InvocationMirror_decodeTypeArgsLenEntry";
-
List get positionalArguments {
if (_positionalArguments == null) {
// The argument descriptor counts the receiver, but not the type arguments
// as positional arguments.
- int numPositionalArguments =
- _decodePositionalCountEntry(_argumentsDescriptor[_POSITIONAL_COUNT]) -
- 1;
+ int numPositionalArguments = _argumentsDescriptor[_POSITIONAL_COUNT] - 1;
if (numPositionalArguments == 0) {
return _positionalArguments = const [];
}
// Exclude receiver and type args in the returned list.
- int receiverIndex =
- _decodeTypeArgsLenEntry(_argumentsDescriptor[_TYPE_ARGS_LEN]) > 0
- ? 1
- : 0;
+ int receiverIndex = _argumentsDescriptor[_TYPE_ARGS_LEN] > 0 ? 1 : 0;
_positionalArguments = new _ImmutableList._from(
_arguments, receiverIndex + 1, numPositionalArguments);
}
return _positionalArguments;
}
- // Extract the position of a named argument from the corresponding entry in
- // the 'ArgumentsDescriptor'.
- static int _decodePositionEntry(positionEntry)
- native "InvocationMirror_decodePositionEntry";
-
Map<Symbol, dynamic> get namedArguments {
if (_namedArguments == null) {
int numArguments = _argumentsDescriptor[_COUNT] - 1; // Exclude receiver.
- int numPositionalArguments =
- _decodePositionalCountEntry(_argumentsDescriptor[_POSITIONAL_COUNT]) -
- 1;
+ int numPositionalArguments = _argumentsDescriptor[_POSITIONAL_COUNT] - 1;
int numNamedArguments = numArguments - numPositionalArguments;
if (numNamedArguments == 0) {
return _namedArguments = const {};
}
- int receiverIndex =
- _decodeTypeArgsLenEntry(_argumentsDescriptor[_TYPE_ARGS_LEN]) > 0
- ? 1
- : 0;
+ int receiverIndex = _argumentsDescriptor[_TYPE_ARGS_LEN] > 0 ? 1 : 0;
_namedArguments = new Map<Symbol, dynamic>();
for (int i = 0; i < numNamedArguments; i++) {
int namedEntryIndex = _FIRST_NAMED_ENTRY + 2 * i;
String arg_name = _argumentsDescriptor[namedEntryIndex];
- var arg_value = _arguments[receiverIndex +
- _decodePositionEntry(_argumentsDescriptor[namedEntryIndex + 1])];
+ var arg_value = _arguments[
+ receiverIndex + _argumentsDescriptor[namedEntryIndex + 1]];
_namedArguments[new internal.Symbol.unvalidated(arg_name)] = arg_value;
}
_namedArguments = new Map.unmodifiable(_namedArguments);
diff --git a/runtime/lib/object.cc b/runtime/lib/object.cc
index a7c256b..d586dc0 100644
--- a/runtime/lib/object.cc
+++ b/runtime/lib/object.cc
@@ -502,23 +502,6 @@
return type_list.raw();
}
-DEFINE_NATIVE_ENTRY(InvocationMirror_decodePositionalCountEntry, 1) {
- const Smi& entry = Smi::CheckedHandle(zone, arguments->NativeArgAt(0));
- return Smi::New(
- ArgumentsDescriptor::PositionalCountField::decode(entry.Value()));
-}
-
-DEFINE_NATIVE_ENTRY(InvocationMirror_decodePositionEntry, 1) {
- const Smi& entry = Smi::CheckedHandle(zone, arguments->NativeArgAt(0));
- return Smi::New(
- ArgumentsDescriptor::NamedPositionField::decode(entry.Value()));
-}
-
-DEFINE_NATIVE_ENTRY(InvocationMirror_decodeTypeArgsLenEntry, 1) {
- const Smi& entry = Smi::CheckedHandle(zone, arguments->NativeArgAt(0));
- return Smi::New(ArgumentsDescriptor::TypeArgsLenField::decode(entry.Value()));
-}
-
DEFINE_NATIVE_ENTRY(NoSuchMethodError_existingMethodSignature, 3) {
const Instance& receiver = Instance::CheckedHandle(arguments->NativeArgAt(0));
GET_NON_NULL_NATIVE_ARGUMENT(String, method_name, arguments->NativeArgAt(1));
diff --git a/runtime/observatory/tests/observatory_ui/observatory_ui.status b/runtime/observatory/tests/observatory_ui/observatory_ui.status
index 5f0849e..793f0ac 100644
--- a/runtime/observatory/tests/observatory_ui/observatory_ui.status
+++ b/runtime/observatory/tests/observatory_ui/observatory_ui.status
@@ -13,4 +13,3 @@
# skipping.
[ $runtime == ff || $runtime == ie10 || $runtime == ie11 || $runtime == safari ]
*: SkipByDesign
-
diff --git a/runtime/observatory/tests/service/service.status b/runtime/observatory/tests/service/service.status
index 57e024d..55035cd 100644
--- a/runtime/observatory/tests/service/service.status
+++ b/runtime/observatory/tests/service/service.status
@@ -98,4 +98,3 @@
# Skip all service tests because random reloads interfere.
[ $hot_reload || $hot_reload_rollback ]
*: SkipByDesign # The service tests should run without being reloaded.
-
diff --git a/runtime/observatory/tests/service/service_kernel.status b/runtime/observatory/tests/service/service_kernel.status
index 0c37c31..c60f70c 100644
--- a/runtime/observatory/tests/service/service_kernel.status
+++ b/runtime/observatory/tests/service/service_kernel.status
@@ -126,4 +126,3 @@
[ $compiler == fasta && $strong ]
add_breakpoint_rpc_test: CompileTimeError
-
diff --git a/runtime/tests/vm/dart/regress_flutter16182_test.dart b/runtime/tests/vm/dart/regress_flutter16182_test.dart
new file mode 100644
index 0000000..81c386e
--- /dev/null
+++ b/runtime/tests/vm/dart/regress_flutter16182_test.dart
@@ -0,0 +1,143 @@
+// Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+// Regression test for https://github.com/flutter/flutter/issues/16182
+// Verifies that TFA correctly handles calls via fields/getters.
+
+import "package:expect/expect.dart";
+
+bool ok;
+
+class T1 {
+ // Should be reachable.
+ void doTest1() {
+ ok = true;
+ }
+}
+
+class A1 {
+ T1 foo;
+
+ void call([a1, a2, a3, a4, a5]) {
+ foo = a5;
+ }
+}
+
+class B1 {
+ A1 aa1 = new A1();
+}
+
+void test1() {
+ B1 bb = new B1();
+ bb.aa1(1, 2, 3, 4, new T1());
+
+ ok = false;
+ bb.aa1.foo.doTest1();
+ Expect.isTrue(ok);
+}
+
+class T2 {
+ // Should be reachable.
+ void doTest2() {
+ ok = true;
+ }
+}
+
+class A2 {
+ dynamic foo;
+
+ void call([a1, a2, a3, a4, a5, a6]) {
+ foo = a6;
+ }
+}
+
+class B2Base {
+ dynamic _aa = new A2();
+ dynamic get aa2 => _aa;
+}
+
+class B2 extends B2Base {
+ void doSuperCall() {
+ super.aa2(1, 2, 3, 4, 5, new T2());
+ }
+}
+
+void test2() {
+ var bb = new B2();
+ bb.doSuperCall();
+
+ ok = false;
+ bb.aa2.foo.doTest2();
+ Expect.isTrue(ok);
+}
+
+class T3 {
+ // Should be reachable.
+ void doTest3() {
+ ok = true;
+ }
+}
+
+class A3 {
+ dynamic foo;
+
+ void call([a1, a2, a3, a4, a5, a6, a7]) {
+ foo = a7;
+ }
+}
+
+class B3 {
+ A3 aa3 = new A3();
+}
+
+dynamic bb3 = new B3();
+Function unknown3 = () => bb3;
+getDynamic3() => unknown3.call();
+
+void test3() {
+ getDynamic3().aa3(1, 2, 3, 4, 5, 6, new T3());
+
+ ok = false;
+ bb3.aa3.foo.doTest3();
+ Expect.isTrue(ok);
+}
+
+class T4 {
+ // Should be reachable.
+ void doTest4() {
+ ok = true;
+ }
+}
+
+class A4 {
+ dynamic foo;
+
+ void call([a1, a2, a3, a4, a5, a6, a7, a8]) {
+ foo = a8;
+ }
+}
+
+class B4 {
+ dynamic _aa = new A4();
+ dynamic get aa4 => _aa;
+}
+
+dynamic bb4 = new B4();
+Function unknown4 = () => bb4;
+getDynamic4() => unknown4.call();
+
+void test4() {
+ getDynamic4().aa4(1, 2, 3, 4, 5, 6, 7, new T4());
+
+ ok = false;
+ getDynamic4().aa4.foo.doTest4();
+ Expect.isTrue(ok);
+}
+
+void main() {
+ test1();
+ test2();
+ test3();
+ test4();
+}
diff --git a/runtime/tests/vm/vm.status b/runtime/tests/vm/vm.status
index f83553e..35c3305 100644
--- a/runtime/tests/vm/vm.status
+++ b/runtime/tests/vm/vm.status
@@ -143,7 +143,6 @@
[ $compiler == dartk && $runtime == vm ]
cc/Class_ComputeEndTokenPos: Crash
-cc/DartAPI_InvokeNoSuchMethod: Fail
cc/DartAPI_IsolateShutdownRunDartCode: Skip # Flaky
cc/DartAPI_LazyLoadDeoptimizes: Fail
cc/DartAPI_LoadLibrary: Crash
@@ -329,4 +328,3 @@
[ $hot_reload || $hot_reload_rollback ]
dart/spawn_infinite_loop_test: Skip # We can shutdown an isolate before it reloads.
dart/spawn_shutdown_test: Skip # We can shutdown an isolate before it reloads.
-
diff --git a/runtime/vm/bootstrap_natives.h b/runtime/vm/bootstrap_natives.h
index f3eeafe..753fbd4 100644
--- a/runtime/vm/bootstrap_natives.h
+++ b/runtime/vm/bootstrap_natives.h
@@ -316,9 +316,6 @@
V(Internal_inquireIs64Bit, 0) \
V(Internal_extractTypeArguments, 2) \
V(Internal_prependTypeArguments, 3) \
- V(InvocationMirror_decodePositionalCountEntry, 1) \
- V(InvocationMirror_decodeTypeArgsLenEntry, 1) \
- V(InvocationMirror_decodePositionEntry, 1) \
V(InvocationMirror_unpackTypeArguments, 1) \
V(NoSuchMethodError_existingMethodSignature, 3) \
V(LinkedHashMap_getIndex, 1) \
diff --git a/runtime/vm/clustered_snapshot.cc b/runtime/vm/clustered_snapshot.cc
index dcf5f7b..c41dede 100644
--- a/runtime/vm/clustered_snapshot.cc
+++ b/runtime/vm/clustered_snapshot.cc
@@ -6,6 +6,7 @@
#include "platform/assert.h"
#include "vm/bootstrap.h"
+#include "vm/compiler/backend/code_statistics.h"
#include "vm/dart.h"
#include "vm/heap.h"
#include "vm/image_snapshot.h"
@@ -5760,6 +5761,10 @@
if (Snapshot::IncludesCode(kind_)) {
isolate_image_writer_->Write(serializer.stream(), false);
+#if defined(DART_PRECOMPILER)
+ isolate_image_writer_->DumpStatistics();
+#endif
+
mapped_data_size_ += isolate_image_writer_->data_size();
mapped_text_size_ += isolate_image_writer_->text_size();
isolate_image_writer_->ResetOffsets();
diff --git a/runtime/vm/clustered_snapshot.h b/runtime/vm/clustered_snapshot.h
index 4900da6..dd0eb7c 100644
--- a/runtime/vm/clustered_snapshot.h
+++ b/runtime/vm/clustered_snapshot.h
@@ -261,6 +261,8 @@
Snapshot::Kind kind() const { return kind_; }
intptr_t next_ref_index() const { return next_ref_index_; }
+ void DumpCombinedCodeStatistics();
+
private:
Heap* heap_;
Zone* zone_;
diff --git a/runtime/vm/compiler/aot/precompiler.cc b/runtime/vm/compiler/aot/precompiler.cc
index d70ef75..f84ed2e 100644
--- a/runtime/vm/compiler/aot/precompiler.cc
+++ b/runtime/vm/compiler/aot/precompiler.cc
@@ -81,6 +81,7 @@
DECLARE_FLAG(int, inlining_caller_size_threshold);
DECLARE_FLAG(int, inlining_constant_arguments_max_size_threshold);
DECLARE_FLAG(int, inlining_constant_arguments_min_size_threshold);
+DECLARE_FLAG(bool, print_instruction_stats);
#ifdef DART_PRECOMPILER
@@ -181,7 +182,8 @@
void FinalizeCompilation(Assembler* assembler,
FlowGraphCompiler* graph_compiler,
- FlowGraph* flow_graph);
+ FlowGraph* flow_graph,
+ CodeStatistics* stats);
Precompiler* precompiler_;
ParsedFunction* parsed_function_;
@@ -2600,7 +2602,8 @@
void PrecompileParsedFunctionHelper::FinalizeCompilation(
Assembler* assembler,
FlowGraphCompiler* graph_compiler,
- FlowGraph* flow_graph) {
+ FlowGraph* flow_graph,
+ CodeStatistics* stats) {
const Function& function = parsed_function()->function();
Zone* const zone = thread()->zone();
@@ -2614,7 +2617,7 @@
// Allocates instruction object. Since this occurs only at safepoint,
// there can be no concurrent access to the instruction page.
const Code& code =
- Code::Handle(Code::FinalizeCode(function, assembler, optimized()));
+ Code::Handle(Code::FinalizeCode(function, assembler, optimized(), stats));
code.set_is_optimized(optimized());
code.set_owner(function);
if (!function.IsOptimizable()) {
@@ -2747,10 +2750,19 @@
ASSERT(pass_state.inline_id_to_function.length() ==
pass_state.caller_inline_id.length());
Assembler assembler(use_far_branches);
+
+ CodeStatistics* function_stats = NULL;
+ if (FLAG_print_instruction_stats) {
+ // At the moment we are leaking CodeStatistics objects for
+ // simplicity because this is just a development mode flag.
+ function_stats = new CodeStatistics(&assembler);
+ }
+
FlowGraphCompiler graph_compiler(
&assembler, flow_graph, *parsed_function(), optimized(),
&speculative_policy, pass_state.inline_id_to_function,
- pass_state.inline_id_to_token_pos, pass_state.caller_inline_id);
+ pass_state.inline_id_to_token_pos, pass_state.caller_inline_id,
+ function_stats);
{
CSTAT_TIMER_SCOPE(thread(), graphcompiler_timer);
#ifndef PRODUCT
@@ -2765,7 +2777,8 @@
"FinalizeCompilation");
#endif // !PRODUCT
ASSERT(thread()->IsMutatorThread());
- FinalizeCompilation(&assembler, &graph_compiler, flow_graph);
+ FinalizeCompilation(&assembler, &graph_compiler, flow_graph,
+ function_stats);
}
// Exit the loop and the function with the correct result value.
is_compiled = true;
diff --git a/runtime/vm/compiler/assembler/assembler_arm64.h b/runtime/vm/compiler/assembler/assembler_arm64.h
index 2356a6e..cfe69b9 100644
--- a/runtime/vm/compiler/assembler/assembler_arm64.h
+++ b/runtime/vm/compiler/assembler/assembler_arm64.h
@@ -1062,18 +1062,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); }
@@ -1364,17 +1358,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,
@@ -1458,11 +1444,6 @@
kValueCanBeSmi,
};
- enum CanBeHeapPointer {
- kValueIsNotHeapPointer,
- kValueCanBeHeapPointer,
- };
-
// Storing into an object.
void StoreIntoObject(Register object,
const Address& dest,
@@ -1602,22 +1583,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 eb5b532..83a80ff 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);
@@ -712,11 +709,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.
@@ -940,26 +932,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/code_statistics.cc b/runtime/vm/compiler/backend/code_statistics.cc
new file mode 100644
index 0000000..7e5cdc5
--- /dev/null
+++ b/runtime/vm/compiler/backend/code_statistics.cc
@@ -0,0 +1,210 @@
+// Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+#include "vm/compiler/backend/code_statistics.h"
+
+namespace dart {
+
+CombinedCodeStatistics::CombinedCodeStatistics() {
+ unaccounted_bytes_ = 0;
+ alignment_bytes_ = 0;
+ object_header_bytes_ = 0;
+ return_const_count_ = 0;
+ return_const_with_load_field_count_ = 0;
+ intptr_t i = 0;
+
+#define DO(type) \
+ entries_[i].name = #type; \
+ entries_[i].bytes = 0; \
+ entries_[i++].count = 0;
+
+ FOR_EACH_INSTRUCTION(DO)
+
+#undef DO
+
+#define DO(type) \
+ entries_[i].name = "SlowPath:" #type; \
+ entries_[i].bytes = 0; \
+ entries_[i++].count = 0;
+
+ FOR_EACH_INSTRUCTION(DO)
+
+#undef DO
+
+#define INIT_SPECIAL_ENTRY(tag, str) \
+ entries_[tag].name = str; \
+ entries_[tag].bytes = 0; \
+ entries_[tag].count = 0;
+
+ INIT_SPECIAL_ENTRY(kTagAssertAssignableParameterCheck,
+ "AssertAssignable:ParameterCheck");
+ INIT_SPECIAL_ENTRY(kTagAssertAssignableInsertedByFrontend,
+ "AssertAssignable:InsertedByFrontend");
+ INIT_SPECIAL_ENTRY(kTagAssertAssignableFromSource,
+ "AssertAssignable:FromSource");
+
+ INIT_SPECIAL_ENTRY(kTagCheckedEntry, "<checked-entry-prologue>");
+ INIT_SPECIAL_ENTRY(kTagIntrinsics, "<intrinsics>");
+#undef INIT_SPECIAL_ENTRY
+}
+
+void CombinedCodeStatistics::DumpStatistics() {
+ ASSERT(unaccounted_bytes_ >= 0);
+
+ Entry* sorted[kNumEntries];
+ for (intptr_t i = 0; i < kNumEntries; i++) {
+ sorted[i] = &entries_[i];
+ }
+ qsort(sorted, kNumEntries, sizeof(Entry*), &CompareEntries);
+
+ intptr_t instruction_bytes = 0;
+ for (intptr_t i = 0; i < kNumEntries; i++) {
+ instruction_bytes += entries_[i].bytes;
+ }
+ intptr_t total = object_header_bytes_ + instruction_bytes +
+ unaccounted_bytes_ + alignment_bytes_;
+ float ftotal = static_cast<float>(total) / 100.0;
+
+ OS::PrintErr("--------------------\n");
+
+ for (intptr_t i = 0; i < kNumEntries; i++) {
+ Entry* entry = sorted[i];
+ const char* name = entry->name;
+ intptr_t bytes = entry->bytes;
+ intptr_t count = entry->count;
+ float percent = bytes / ftotal;
+ float avg = static_cast<float>(bytes) / count;
+ if (bytes > 0) {
+ OS::PrintErr(
+ "%5.2f %% "
+ "% 8" Pd
+ " bytes "
+ "% 8" Pd
+ " count "
+ "%8.2f avg bytes/entry "
+ "- %s\n",
+ percent, bytes, count, avg, name);
+ }
+ }
+
+ OS::PrintErr("--------------------\n");
+
+ OS::PrintErr("%5.2f %% % 8" Pd " bytes unaccounted\n",
+ unaccounted_bytes_ / ftotal, unaccounted_bytes_);
+ OS::PrintErr("%5.2f %% % 8" Pd " bytes alignment\n",
+ alignment_bytes_ / ftotal, alignment_bytes_);
+ OS::PrintErr("%5.2f %% % 8" Pd " bytes instruction object header\n",
+ object_header_bytes_ / ftotal, object_header_bytes_);
+ OS::PrintErr("%5.2f %% % 8" Pd " bytes instructions\n",
+ instruction_bytes / ftotal, instruction_bytes);
+ OS::PrintErr("--------------------\n");
+ OS::PrintErr("%5.2f %% % 8" Pd " bytes in total\n", total / ftotal, total);
+ OS::PrintErr("--------------------\n");
+ OS::PrintErr("% 8" Pd " return-constant functions\n", return_const_count_);
+ OS::PrintErr("% 8" Pd " return-constant-with-load-field functions\n",
+ return_const_with_load_field_count_);
+ OS::PrintErr("--------------------\n");
+}
+
+int CombinedCodeStatistics::CompareEntries(const void* a, const void* b) {
+ const intptr_t a_size = static_cast<const Entry*>(a)->bytes;
+ const intptr_t b_size = static_cast<const Entry*>(b)->bytes;
+ if (a_size < b_size) {
+ return -1;
+ } else if (a_size > b_size) {
+ return 1;
+ } else {
+ return 0;
+ }
+}
+
+CodeStatistics::CodeStatistics(Assembler* assembler) : assembler_(assembler) {
+ memset(entries_, 0, CombinedCodeStatistics::kNumEntries * sizeof(Entry));
+ instruction_bytes_ = 0;
+ unaccounted_bytes_ = 0;
+ alignment_bytes_ = 0;
+
+ stack_index_ = -1;
+ for (intptr_t i = 0; i < kStackSize; i++)
+ stack_[i] = -1;
+}
+
+void CodeStatistics::Begin(Instruction* instruction) {
+ SpecialBegin(static_cast<intptr_t>(instruction->statistics_tag()));
+}
+
+void CodeStatistics::End(Instruction* instruction) {
+ SpecialEnd(static_cast<intptr_t>(instruction->statistics_tag()));
+}
+
+void CodeStatistics::SpecialBegin(intptr_t tag) {
+ stack_index_++;
+ RELEASE_ASSERT(stack_index_ < kStackSize);
+ RELEASE_ASSERT(stack_[stack_index_] == -1);
+ RELEASE_ASSERT(tag < CombinedCodeStatistics::kNumEntries);
+ stack_[stack_index_] = assembler_->CodeSize();
+ RELEASE_ASSERT(stack_[stack_index_] >= 0);
+}
+
+void CodeStatistics::SpecialEnd(intptr_t tag) {
+ RELEASE_ASSERT(stack_index_ > 0 || stack_[stack_index_] >= 0);
+ RELEASE_ASSERT(tag < CombinedCodeStatistics::kNumEntries);
+
+ intptr_t diff = assembler_->CodeSize() - stack_[stack_index_];
+ RELEASE_ASSERT(diff >= 0);
+ RELEASE_ASSERT(entries_[tag].bytes >= 0);
+ RELEASE_ASSERT(entries_[tag].count >= 0);
+ entries_[tag].bytes += diff;
+ entries_[tag].count++;
+ instruction_bytes_ += diff;
+ stack_[stack_index_] = -1;
+ stack_index_--;
+}
+
+void CodeStatistics::Finalize() {
+ intptr_t function_size = assembler_->CodeSize();
+ unaccounted_bytes_ = function_size - instruction_bytes_;
+ ASSERT(unaccounted_bytes_ >= 0);
+ alignment_bytes_ =
+ Utils::RoundUp(function_size, OS::PreferredCodeAlignment()) -
+ function_size;
+ assembler_ = NULL;
+}
+
+void CodeStatistics::AppendTo(CombinedCodeStatistics* stat) {
+ intptr_t sum = 0;
+ bool returns_constant = true;
+ bool returns_const_with_load_field_ = true;
+
+ for (intptr_t i = 0; i < CombinedCodeStatistics::kNumEntries; i++) {
+ intptr_t bytes = entries_[i].bytes;
+ stat->entries_[i].count += entries_[i].count;
+ if (bytes > 0) {
+ sum += bytes;
+ stat->entries_[i].bytes += bytes;
+ if (i != CombinedCodeStatistics::kTagParallelMove &&
+ i != CombinedCodeStatistics::kTagReturn &&
+ i != CombinedCodeStatistics::kTagCheckStackOverflow &&
+ i != CombinedCodeStatistics::kTagCheckStackOverflowSlowPath) {
+ returns_constant = false;
+ if (i != CombinedCodeStatistics::kTagLoadField &&
+ i != CombinedCodeStatistics::kTagTargetEntry &&
+ i != CombinedCodeStatistics::kTagJoinEntry) {
+ returns_const_with_load_field_ = false;
+ }
+ }
+ }
+ }
+ stat->unaccounted_bytes_ += unaccounted_bytes_;
+ ASSERT(stat->unaccounted_bytes_ >= 0);
+ stat->alignment_bytes_ += alignment_bytes_;
+ stat->object_header_bytes_ += Instructions::HeaderSize();
+
+ if (returns_constant) stat->return_const_count_++;
+ if (returns_const_with_load_field_) {
+ stat->return_const_with_load_field_count_++;
+ }
+}
+
+} // namespace dart
diff --git a/runtime/vm/compiler/backend/code_statistics.h b/runtime/vm/compiler/backend/code_statistics.h
new file mode 100644
index 0000000..d60f4eb
--- /dev/null
+++ b/runtime/vm/compiler/backend/code_statistics.h
@@ -0,0 +1,103 @@
+// Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+#ifndef RUNTIME_VM_COMPILER_BACKEND_CODE_STATISTICS_H_
+#define RUNTIME_VM_COMPILER_BACKEND_CODE_STATISTICS_H_
+
+#include "vm/compiler/assembler/assembler.h"
+#include "vm/compiler/backend/il.h"
+#include "vm/object.h"
+
+namespace dart {
+
+class CombinedCodeStatistics {
+ public:
+ // clang-format off
+ enum EntryCounter {
+#define DO(type) kTag##type,
+ FOR_EACH_INSTRUCTION(DO)
+#undef DO
+
+#define DO(type) kTag##type##SlowPath,
+ FOR_EACH_INSTRUCTION(DO)
+#undef DO
+
+ kTagAssertAssignableParameterCheck,
+ kTagAssertAssignableInsertedByFrontend,
+ kTagAssertAssignableFromSource,
+
+ kTagCheckedEntry,
+ kTagIntrinsics,
+
+ kNumEntries,
+ };
+ // clang-format on
+
+ CombinedCodeStatistics();
+
+ void Begin(Instruction* instruction);
+ void End(Instruction* instruction);
+
+ void DumpStatistics();
+
+ static EntryCounter SlowPathCounterFor(Instruction::Tag tag) {
+ return static_cast<CombinedCodeStatistics::EntryCounter>(
+ CombinedCodeStatistics::kTagGraphEntrySlowPath + tag);
+ }
+
+ private:
+ friend class CodeStatistics;
+
+ static int CompareEntries(const void* a, const void* b);
+
+ typedef struct {
+ const char* name;
+ intptr_t bytes;
+ intptr_t count;
+ } Entry;
+
+ Entry entries_[kNumEntries];
+ intptr_t unaccounted_bytes_;
+ intptr_t alignment_bytes_;
+ intptr_t object_header_bytes_;
+ intptr_t return_const_count_;
+ intptr_t return_const_with_load_field_count_;
+};
+
+class CodeStatistics {
+ public:
+ explicit CodeStatistics(Assembler* assembler);
+
+ void Begin(Instruction* instruction);
+ void End(Instruction* instruction);
+
+ void SpecialBegin(intptr_t tag);
+ void SpecialEnd(intptr_t tag);
+
+ void AppendTo(CombinedCodeStatistics* stat);
+
+ void Finalize();
+
+ private:
+ static const int kStackSize = 8;
+
+ Assembler* assembler_;
+
+ typedef struct {
+ intptr_t bytes;
+ intptr_t count;
+ } Entry;
+
+ Entry entries_[CombinedCodeStatistics::kNumEntries];
+ intptr_t instruction_bytes_;
+ intptr_t unaccounted_bytes_;
+ intptr_t alignment_bytes_;
+
+ intptr_t stack_[kStackSize];
+ intptr_t stack_index_;
+};
+
+} // namespace dart
+
+#endif // RUNTIME_VM_COMPILER_BACKEND_CODE_STATISTICS_H_
diff --git a/runtime/vm/compiler/backend/constant_propagator.cc b/runtime/vm/compiler/backend/constant_propagator.cc
index 5d30eda..0de93d5 100644
--- a/runtime/vm/compiler/backend/constant_propagator.cc
+++ b/runtime/vm/compiler/backend/constant_propagator.cc
@@ -26,6 +26,7 @@
// Quick access to the current zone and isolate.
#define I (isolate())
#define Z (graph_->zone())
+#define T (graph_->thread())
ConstantPropagator::ConstantPropagator(
FlowGraph* graph,
@@ -1110,7 +1111,8 @@
default:
UNREACHABLE();
}
- const Double& result = Double::ZoneHandle(Double::NewCanonical(result_val));
+ const Double& result =
+ Double::ZoneHandle(Double::New(result_val, Heap::kOld));
SetValue(instr, result);
}
}
@@ -1321,6 +1323,7 @@
// instructions, previous pointers, predecessors, etc. after eliminating
// unreachable code. We do not maintain those properties during the
// transformation.
+ auto& value = Object::Handle(Z);
for (BlockIterator b = graph_->reverse_postorder_iterator(); !b.Done();
b.Advance()) {
BlockEntryInstr* block = b.Current();
@@ -1398,7 +1401,14 @@
THR_Print("Constant v%" Pd " = %s\n", defn->ssa_temp_index(),
defn->constant_value().ToCString());
}
- ConstantInstr* constant = graph_->GetConstant(defn->constant_value());
+ value = defn->constant_value().raw();
+ if ((value.IsString() || value.IsMint() || value.IsDouble()) &&
+ !value.IsCanonical()) {
+ const char* error_str = nullptr;
+ value = Instance::Cast(value).CheckAndCanonicalize(T, &error_str);
+ ASSERT(!value.IsNull() && (error_str == nullptr));
+ }
+ ConstantInstr* constant = graph_->GetConstant(value);
defn->ReplaceUsesWith(constant);
i.RemoveCurrentFromGraph();
}
diff --git a/runtime/vm/compiler/backend/flow_graph_compiler.cc b/runtime/vm/compiler/backend/flow_graph_compiler.cc
index 074df75..793a26f 100644
--- a/runtime/vm/compiler/backend/flow_graph_compiler.cc
+++ b/runtime/vm/compiler/backend/flow_graph_compiler.cc
@@ -7,6 +7,7 @@
#include "vm/compiler/backend/flow_graph_compiler.h"
#include "vm/bit_vector.h"
+#include "vm/compiler/backend/code_statistics.h"
#include "vm/compiler/backend/il_printer.h"
#include "vm/compiler/backend/inliner.h"
#include "vm/compiler/backend/linearscan.h"
@@ -100,7 +101,8 @@
SpeculativeInliningPolicy* speculative_policy,
const GrowableArray<const Function*>& inline_id_to_function,
const GrowableArray<TokenPosition>& inline_id_to_token_pos,
- const GrowableArray<intptr_t>& caller_inline_id)
+ const GrowableArray<intptr_t>& caller_inline_id,
+ CodeStatistics* stats /* = NULL */)
: thread_(Thread::Current()),
zone_(Thread::Current()->zone()),
assembler_(assembler),
@@ -120,6 +122,7 @@
speculative_policy_(speculative_policy),
may_reoptimize_(false),
intrinsic_mode_(false),
+ stats_(stats),
double_class_(
Class::ZoneHandle(isolate()->object_store()->double_class())),
mint_class_(Class::ZoneHandle(isolate()->object_store()->mint_class())),
@@ -492,12 +495,15 @@
BeginCodeSourceRange();
ASSERT(pending_deoptimization_env_ == NULL);
pending_deoptimization_env_ = entry->env();
+ StatsBegin(entry);
entry->EmitNativeCode(this);
+ StatsEnd(entry);
pending_deoptimization_env_ = NULL;
EndCodeSourceRange(entry->token_pos());
// Compile all successors until an exit, branch, or a block entry.
for (ForwardInstructionIterator it(entry); !it.Done(); it.Advance()) {
Instruction* instr = it.Current();
+ StatsBegin(instr);
// Compose intervals.
code_source_map_builder_->StartInliningInterval(assembler()->CodeSize(),
instr->inlining_id());
@@ -526,6 +532,7 @@
FrameStateUpdateWith(instr);
}
#endif
+ StatsEnd(instr);
}
#if defined(DEBUG) && !defined(TARGET_ARCH_DBC)
@@ -581,9 +588,14 @@
void FlowGraphCompiler::GenerateDeferredCode() {
for (intptr_t i = 0; i < slow_path_code_.length(); i++) {
+ const CombinedCodeStatistics::EntryCounter stats_tag =
+ CombinedCodeStatistics::SlowPathCounterFor(
+ slow_path_code_[i]->instruction()->tag());
+ SpecialStatsBegin(stats_tag);
BeginCodeSourceRange();
slow_path_code_[i]->GenerateCode(this);
EndCodeSourceRange(TokenPosition::kDeferredSlowPath);
+ SpecialStatsEnd(stats_tag);
}
for (intptr_t i = 0; i < deopt_infos_.length(); i++) {
BeginCodeSourceRange();
@@ -1004,7 +1016,9 @@
// Reading from a mutable double box requires allocating a fresh double.
if (field.is_instance() &&
(FLAG_precompiled_mode || !IsPotentialUnboxedField(field))) {
+ SpecialStatsBegin(CombinedCodeStatistics::kTagIntrinsics);
GenerateInlinedGetter(field.Offset());
+ SpecialStatsEnd(CombinedCodeStatistics::kTagIntrinsics);
return !isolate()->use_field_guards();
}
return false;
@@ -1018,7 +1032,9 @@
if (field.is_instance() &&
(FLAG_precompiled_mode || field.guarded_cid() == kDynamicCid)) {
+ SpecialStatsBegin(CombinedCodeStatistics::kTagIntrinsics);
GenerateInlinedSetter(field.Offset());
+ SpecialStatsEnd(CombinedCodeStatistics::kTagIntrinsics);
return !isolate()->use_field_guards();
}
return false;
@@ -1028,7 +1044,9 @@
EnterIntrinsicMode();
+ SpecialStatsBegin(CombinedCodeStatistics::kTagIntrinsics);
bool complete = Intrinsifier::Intrinsify(parsed_function(), this);
+ SpecialStatsEnd(CombinedCodeStatistics::kTagIntrinsics);
ExitIntrinsicMode();
diff --git a/runtime/vm/compiler/backend/flow_graph_compiler.h b/runtime/vm/compiler/backend/flow_graph_compiler.h
index b6daea0..9a7948f 100644
--- a/runtime/vm/compiler/backend/flow_graph_compiler.h
+++ b/runtime/vm/compiler/backend/flow_graph_compiler.h
@@ -8,6 +8,7 @@
#include "vm/allocation.h"
#include "vm/code_descriptors.h"
#include "vm/compiler/assembler/assembler.h"
+#include "vm/compiler/backend/code_statistics.h"
#include "vm/compiler/backend/il.h"
#include "vm/runtime_entry.h"
@@ -206,9 +207,11 @@
class SlowPathCode : public ZoneAllocated {
public:
- SlowPathCode() : entry_label_(), exit_label_() {}
+ explicit SlowPathCode(Instruction* instruction)
+ : instruction_(instruction), entry_label_(), exit_label_() {}
virtual ~SlowPathCode() {}
+ Instruction* instruction() const { return instruction_; }
Label* entry_label() { return &entry_label_; }
Label* exit_label() { return &exit_label_; }
@@ -220,12 +223,23 @@
private:
virtual void EmitNativeCode(FlowGraphCompiler* compiler) = 0;
+ Instruction* instruction_;
Label entry_label_;
Label exit_label_;
DISALLOW_COPY_AND_ASSIGN(SlowPathCode);
};
+template <typename T>
+class TemplateSlowPathCode : public SlowPathCode {
+ public:
+ explicit TemplateSlowPathCode(T* instruction) : SlowPathCode(instruction) {}
+
+ T* instruction() const {
+ return static_cast<T*>(SlowPathCode::instruction());
+ }
+};
+
class FlowGraphCompiler : public ValueObject {
private:
class BlockInfo : public ZoneAllocated {
@@ -271,7 +285,8 @@
SpeculativeInliningPolicy* speculative_policy,
const GrowableArray<const Function*>& inline_id_to_function,
const GrowableArray<TokenPosition>& inline_id_to_token_pos,
- const GrowableArray<intptr_t>& caller_inline_id);
+ const GrowableArray<intptr_t>& caller_inline_id,
+ CodeStatistics* stats = NULL);
~FlowGraphCompiler();
@@ -313,6 +328,22 @@
return ¶llel_move_resolver_;
}
+ void StatsBegin(Instruction* instr) {
+ if (stats_ != NULL) stats_->Begin(instr);
+ }
+
+ void StatsEnd(Instruction* instr) {
+ if (stats_ != NULL) stats_->End(instr);
+ }
+
+ void SpecialStatsBegin(intptr_t tag) {
+ if (stats_ != NULL) stats_->SpecialBegin(tag);
+ }
+
+ void SpecialStatsEnd(intptr_t tag) {
+ if (stats_ != NULL) stats_->SpecialEnd(tag);
+ }
+
// Constructor is lighweight, major initialization work should occur here.
// This makes it easier to measure time spent in the compiler.
void InitCompiler();
@@ -827,6 +858,7 @@
// True while emitting intrinsic code.
bool intrinsic_mode_;
Label intrinsic_slow_path_label_;
+ CodeStatistics* stats_;
const Class& double_class_;
const Class& mint_class_;
diff --git a/runtime/vm/compiler/backend/flow_graph_compiler_arm.cc b/runtime/vm/compiler/backend/flow_graph_compiler_arm.cc
index bdbf67e..1917cf9 100644
--- a/runtime/vm/compiler/backend/flow_graph_compiler_arm.cc
+++ b/runtime/vm/compiler/backend/flow_graph_compiler_arm.cc
@@ -774,7 +774,9 @@
#ifdef DART_PRECOMPILER
const Function& function = parsed_function().function();
if (function.IsDynamicFunction()) {
+ SpecialStatsBegin(CombinedCodeStatistics::kTagCheckedEntry);
__ MonomorphicCheckedEntry();
+ SpecialStatsEnd(CombinedCodeStatistics::kTagCheckedEntry);
}
#endif // DART_PRECOMPILER
diff --git a/runtime/vm/compiler/backend/il.cc b/runtime/vm/compiler/backend/il.cc
index 00e1ecf..4967657 100644
--- a/runtime/vm/compiler/backend/il.cc
+++ b/runtime/vm/compiler/backend/il.cc
@@ -8,6 +8,7 @@
#include "vm/bit_vector.h"
#include "vm/bootstrap.h"
+#include "vm/compiler/backend/code_statistics.h"
#include "vm/compiler/backend/constant_propagator.h"
#include "vm/compiler/backend/flow_graph_compiler.h"
#include "vm/compiler/backend/linearscan.h"
@@ -1552,10 +1553,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;
@@ -1569,7 +1570,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) {
@@ -2130,8 +2131,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)) {
@@ -3792,6 +3792,21 @@
#endif // !defined(TARGET_ARCH_DBC)
}
+intptr_t AssertAssignableInstr::statistics_tag() const {
+ switch (kind_) {
+ case kParameterCheck:
+ return CombinedCodeStatistics::kTagAssertAssignableParameterCheck;
+ case kInsertedByFrontend:
+ return CombinedCodeStatistics::kTagAssertAssignableInsertedByFrontend;
+ case kFromSource:
+ return CombinedCodeStatistics::kTagAssertAssignableFromSource;
+ case kUnknown:
+ break;
+ }
+
+ return tag();
+}
+
void AssertAssignableInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
compiler->GenerateAssertAssignable(token_pos(), deopt_id(), dst_type(),
dst_name(), locs());
@@ -3902,13 +3917,13 @@
return locs;
}
-class ThrowErrorSlowPathCode : public SlowPathCode {
+class ThrowErrorSlowPathCode : public TemplateSlowPathCode<Instruction> {
public:
ThrowErrorSlowPathCode(Instruction* instruction,
const RuntimeEntry& runtime_entry,
intptr_t num_args,
intptr_t try_index)
- : instruction_(instruction),
+ : TemplateSlowPathCode(instruction),
runtime_entry_(runtime_entry),
num_args_(num_args),
try_index_(try_index) {}
@@ -3920,7 +3935,7 @@
__ Comment("slow path %s operation", name());
}
__ Bind(entry_label());
- LocationSummary* locs = instruction_->locs();
+ LocationSummary* locs = instruction()->locs();
// Save registers as they are needed for lazy deopt / exception handling.
compiler->SaveLiveRegisters(locs);
for (intptr_t i = 0; i < num_args_; ++i) {
@@ -3929,15 +3944,14 @@
__ CallRuntime(runtime_entry_, num_args_);
compiler->AddDescriptor(
RawPcDescriptors::kOther, compiler->assembler()->CodeSize(),
- instruction_->deopt_id(), instruction_->token_pos(), try_index_);
+ instruction()->deopt_id(), instruction()->token_pos(), try_index_);
compiler->RecordSafepoint(locs, num_args_);
- Environment* env = compiler->SlowPathEnvironmentFor(instruction_);
+ Environment* env = compiler->SlowPathEnvironmentFor(instruction());
compiler->EmitCatchEntryState(env, try_index_);
__ Breakpoint();
}
private:
- Instruction* instruction_;
const RuntimeEntry& runtime_entry_;
const intptr_t num_args_;
const intptr_t try_index_;
diff --git a/runtime/vm/compiler/backend/il.h b/runtime/vm/compiler/backend/il.h
index 3d404b1..aaed3e0 100644
--- a/runtime/vm/compiler/backend/il.h
+++ b/runtime/vm/compiler/backend/il.h
@@ -749,6 +749,8 @@
virtual Tag tag() const = 0;
+ virtual intptr_t statistics_tag() const { return tag(); }
+
intptr_t deopt_id() const {
ASSERT(ComputeCanDeoptimize() || CanBecomeDeoptimizationTarget());
return GetDeoptId();
@@ -2895,17 +2897,21 @@
class AssertAssignableInstr : public TemplateDefinition<3, Throws, Pure> {
public:
+ enum Kind { kParameterCheck, kInsertedByFrontend, kFromSource, kUnknown };
+
AssertAssignableInstr(TokenPosition token_pos,
Value* value,
Value* instantiator_type_arguments,
Value* function_type_arguments,
const AbstractType& dst_type,
const String& dst_name,
- intptr_t deopt_id)
+ intptr_t deopt_id,
+ Kind kind = kUnknown)
: TemplateDefinition(deopt_id),
token_pos_(token_pos),
dst_type_(AbstractType::ZoneHandle(dst_type.raw())),
- dst_name_(dst_name) {
+ dst_name_(dst_name),
+ kind_(kind) {
ASSERT(!dst_type.IsNull());
ASSERT(!dst_type.IsTypeRef());
ASSERT(!dst_name.IsNull());
@@ -2914,6 +2920,8 @@
SetInputAt(2, function_type_arguments);
}
+ virtual intptr_t statistics_tag() const;
+
DECLARE_INSTRUCTION(AssertAssignable)
virtual CompileType ComputeType() const;
virtual bool RecomputeType();
@@ -2948,6 +2956,7 @@
const TokenPosition token_pos_;
AbstractType& dst_type_;
const String& dst_name_;
+ const Kind kind_;
DISALLOW_COPY_AND_ASSIGN(AssertAssignableInstr);
};
diff --git a/runtime/vm/compiler/backend/il_arm.cc b/runtime/vm/compiler/backend/il_arm.cc
index 380601f..01bf389 100644
--- a/runtime/vm/compiler/backend/il_arm.cc
+++ b/runtime/vm/compiler/backend/il_arm.cc
@@ -1884,16 +1884,16 @@
}
}
-class BoxAllocationSlowPath : public SlowPathCode {
+class BoxAllocationSlowPath : public TemplateSlowPathCode<Instruction> {
public:
BoxAllocationSlowPath(Instruction* instruction,
const Class& cls,
Register result)
- : instruction_(instruction), cls_(cls), result_(result) {}
+ : TemplateSlowPathCode(instruction), cls_(cls), result_(result) {}
virtual void EmitNativeCode(FlowGraphCompiler* compiler) {
if (Assembler::EmittingComments()) {
- __ Comment("%s slow path allocation of %s", instruction_->DebugName(),
+ __ Comment("%s slow path allocation of %s", instruction()->DebugName(),
String::Handle(cls_.ScrubbedName()).ToCString());
}
__ Bind(entry_label());
@@ -1901,7 +1901,7 @@
compiler->zone(), StubCode::GetAllocationStubForClass(cls_));
const StubEntry stub_entry(stub);
- LocationSummary* locs = instruction_->locs();
+ LocationSummary* locs = instruction()->locs();
locs->live_registers()->Remove(Location::RegisterLocation(result_));
@@ -1932,7 +1932,6 @@
}
private:
- Instruction* instruction_;
const Class& cls_;
const Register result_;
};
@@ -2681,35 +2680,33 @@
return locs;
}
-class AllocateContextSlowPath : public SlowPathCode {
+class AllocateContextSlowPath
+ : public TemplateSlowPathCode<AllocateUninitializedContextInstr> {
public:
explicit AllocateContextSlowPath(
AllocateUninitializedContextInstr* instruction)
- : instruction_(instruction) {}
+ : TemplateSlowPathCode(instruction) {}
virtual void EmitNativeCode(FlowGraphCompiler* compiler) {
__ Comment("AllocateContextSlowPath");
__ Bind(entry_label());
- LocationSummary* locs = instruction_->locs();
+ LocationSummary* locs = instruction()->locs();
locs->live_registers()->Remove(locs->out(0));
compiler->SaveLiveRegisters(locs);
- __ LoadImmediate(R1, instruction_->num_context_variables());
+ __ LoadImmediate(R1, instruction()->num_context_variables());
const Code& stub = Code::ZoneHandle(
compiler->zone(), StubCode::AllocateContext_entry()->code());
compiler->AddStubCallTarget(stub);
- compiler->GenerateCall(instruction_->token_pos(),
+ compiler->GenerateCall(instruction()->token_pos(),
*StubCode::AllocateContext_entry(),
RawPcDescriptors::kOther, locs);
- ASSERT(instruction_->locs()->out(0).reg() == R0);
- compiler->RestoreLiveRegisters(instruction_->locs());
+ ASSERT(instruction()->locs()->out(0).reg() == R0);
+ compiler->RestoreLiveRegisters(instruction()->locs());
__ b(exit_label());
}
-
- private:
- AllocateUninitializedContextInstr* instruction_;
};
void AllocateUninitializedContextInstr::EmitNativeCode(
@@ -2886,14 +2883,15 @@
return summary;
}
-class CheckStackOverflowSlowPath : public SlowPathCode {
+class CheckStackOverflowSlowPath
+ : public TemplateSlowPathCode<CheckStackOverflowInstr> {
public:
explicit CheckStackOverflowSlowPath(CheckStackOverflowInstr* instruction)
- : instruction_(instruction) {}
+ : TemplateSlowPathCode(instruction) {}
virtual void EmitNativeCode(FlowGraphCompiler* compiler) {
if (compiler->isolate()->use_osr() && osr_entry_label()->IsLinked()) {
- const Register value = instruction_->locs()->temp(0).reg();
+ const Register value = instruction()->locs()->temp(0).reg();
__ Comment("CheckStackOverflowSlowPathOsr");
__ Bind(osr_entry_label());
__ LoadImmediate(value, Thread::kOsrRequest);
@@ -2901,25 +2899,25 @@
}
__ Comment("CheckStackOverflowSlowPath");
__ Bind(entry_label());
- compiler->SaveLiveRegisters(instruction_->locs());
+ compiler->SaveLiveRegisters(instruction()->locs());
// pending_deoptimization_env_ is needed to generate a runtime call that
// may throw an exception.
ASSERT(compiler->pending_deoptimization_env_ == NULL);
- Environment* env = compiler->SlowPathEnvironmentFor(instruction_);
+ Environment* env = compiler->SlowPathEnvironmentFor(instruction());
compiler->pending_deoptimization_env_ = env;
compiler->GenerateRuntimeCall(
- instruction_->token_pos(), instruction_->deopt_id(),
- kStackOverflowRuntimeEntry, 0, instruction_->locs());
+ instruction()->token_pos(), instruction()->deopt_id(),
+ kStackOverflowRuntimeEntry, 0, instruction()->locs());
if (compiler->isolate()->use_osr() && !compiler->is_optimizing() &&
- instruction_->in_loop()) {
+ instruction()->in_loop()) {
// In unoptimized code, record loop stack checks as possible OSR entries.
compiler->AddCurrentDescriptor(RawPcDescriptors::kOsrEntry,
- instruction_->deopt_id(),
+ instruction()->deopt_id(),
TokenPosition::kNoSource);
}
compiler->pending_deoptimization_env_ = NULL;
- compiler->RestoreLiveRegisters(instruction_->locs());
+ compiler->RestoreLiveRegisters(instruction()->locs());
__ b(exit_label());
}
@@ -2929,7 +2927,6 @@
}
private:
- CheckStackOverflowInstr* instruction_;
Label osr_entry_label_;
};
@@ -3050,34 +3047,34 @@
}
}
-class CheckedSmiSlowPath : public SlowPathCode {
+class CheckedSmiSlowPath : public TemplateSlowPathCode<CheckedSmiOpInstr> {
public:
CheckedSmiSlowPath(CheckedSmiOpInstr* instruction, intptr_t try_index)
- : instruction_(instruction), try_index_(try_index) {}
+ : TemplateSlowPathCode(instruction), try_index_(try_index) {}
virtual void EmitNativeCode(FlowGraphCompiler* compiler) {
if (Assembler::EmittingComments()) {
__ Comment("slow path smi operation");
}
__ Bind(entry_label());
- LocationSummary* locs = instruction_->locs();
+ LocationSummary* locs = instruction()->locs();
Register result = locs->out(0).reg();
locs->live_registers()->Remove(Location::RegisterLocation(result));
compiler->SaveLiveRegisters(locs);
- if (instruction_->env() != NULL) {
- Environment* env = compiler->SlowPathEnvironmentFor(instruction_);
+ if (instruction()->env() != NULL) {
+ Environment* env = compiler->SlowPathEnvironmentFor(instruction());
compiler->pending_deoptimization_env_ = env;
}
__ Push(locs->in(0).reg());
__ Push(locs->in(1).reg());
const String& selector =
- String::Handle(instruction_->call()->ic_data()->target_name());
+ String::Handle(instruction()->call()->ic_data()->target_name());
const Array& arguments_descriptor =
- Array::Handle(instruction_->call()->ic_data()->arguments_descriptor());
+ Array::Handle(instruction()->call()->ic_data()->arguments_descriptor());
compiler->EmitMegamorphicInstanceCall(
- selector, arguments_descriptor, instruction_->call()->deopt_id(),
- instruction_->call()->token_pos(), locs, try_index_,
+ selector, arguments_descriptor, instruction()->call()->deopt_id(),
+ instruction()->call()->token_pos(), locs, try_index_,
/* slow_path_argument_count = */ 2);
__ mov(result, Operand(R0));
compiler->RestoreLiveRegisters(locs);
@@ -3086,7 +3083,6 @@
}
private:
- CheckedSmiOpInstr* instruction_;
intptr_t try_index_;
};
@@ -3183,13 +3179,14 @@
__ Bind(slow_path->exit_label());
}
-class CheckedSmiComparisonSlowPath : public SlowPathCode {
+class CheckedSmiComparisonSlowPath
+ : public TemplateSlowPathCode<CheckedSmiComparisonInstr> {
public:
CheckedSmiComparisonSlowPath(CheckedSmiComparisonInstr* instruction,
intptr_t try_index,
BranchLabels labels,
bool merged)
- : instruction_(instruction),
+ : TemplateSlowPathCode(instruction),
try_index_(try_index),
labels_(labels),
merged_(merged) {}
@@ -3199,42 +3196,41 @@
__ Comment("slow path smi operation");
}
__ Bind(entry_label());
- LocationSummary* locs = instruction_->locs();
+ LocationSummary* locs = instruction()->locs();
Register result = merged_ ? locs->temp(0).reg() : locs->out(0).reg();
locs->live_registers()->Remove(Location::RegisterLocation(result));
compiler->SaveLiveRegisters(locs);
- if (instruction_->env() != NULL) {
- Environment* env = compiler->SlowPathEnvironmentFor(instruction_);
+ if (instruction()->env() != NULL) {
+ Environment* env = compiler->SlowPathEnvironmentFor(instruction());
compiler->pending_deoptimization_env_ = env;
}
__ Push(locs->in(0).reg());
__ Push(locs->in(1).reg());
String& selector =
- String::Handle(instruction_->call()->ic_data()->target_name());
+ String::Handle(instruction()->call()->ic_data()->target_name());
const Array& arguments_descriptor =
- Array::Handle(instruction_->call()->ic_data()->arguments_descriptor());
+ Array::Handle(instruction()->call()->ic_data()->arguments_descriptor());
compiler->EmitMegamorphicInstanceCall(
- selector, arguments_descriptor, instruction_->call()->deopt_id(),
- instruction_->call()->token_pos(), locs, try_index_,
+ selector, arguments_descriptor, instruction()->call()->deopt_id(),
+ instruction()->call()->token_pos(), locs, try_index_,
/* slow_path_argument_count = */ 2);
__ mov(result, Operand(R0));
compiler->RestoreLiveRegisters(locs);
compiler->pending_deoptimization_env_ = NULL;
if (merged_) {
__ CompareObject(result, Bool::True());
- __ b(
- instruction_->is_negated() ? labels_.false_label : labels_.true_label,
- EQ);
- __ b(instruction_->is_negated() ? labels_.true_label
- : labels_.false_label);
+ __ b(instruction()->is_negated() ? labels_.false_label
+ : labels_.true_label,
+ EQ);
+ __ b(instruction()->is_negated() ? labels_.true_label
+ : labels_.false_label);
} else {
__ b(exit_label());
}
}
private:
- CheckedSmiComparisonInstr* instruction_;
intptr_t try_index_;
BranchLabels labels_;
bool merged_;
diff --git a/runtime/vm/compiler/backend/il_arm64.cc b/runtime/vm/compiler/backend/il_arm64.cc
index 3bd1061..b2e0a9d 100644
--- a/runtime/vm/compiler/backend/il_arm64.cc
+++ b/runtime/vm/compiler/backend/il_arm64.cc
@@ -955,13 +955,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();
@@ -1235,6 +1231,7 @@
default:
UNREACHABLE();
}
+ __ SmiTag(result);
break;
case kTwoByteStringCid:
case kExternalTwoByteStringCid:
@@ -1248,15 +1245,12 @@
default:
UNREACHABLE();
}
+ __ SmiTag(result);
break;
default:
UNREACHABLE();
break;
}
- if (representation_ == kTagged) {
- ASSERT(can_pack_into_smi());
- __ SmiTag(result);
- }
}
Representation StoreIndexedInstr::RequiredInputRepresentation(
@@ -1766,16 +1760,16 @@
}
}
-class BoxAllocationSlowPath : public SlowPathCode {
+class BoxAllocationSlowPath : public TemplateSlowPathCode<Instruction> {
public:
BoxAllocationSlowPath(Instruction* instruction,
const Class& cls,
Register result)
- : instruction_(instruction), cls_(cls), result_(result) {}
+ : TemplateSlowPathCode(instruction), cls_(cls), result_(result) {}
virtual void EmitNativeCode(FlowGraphCompiler* compiler) {
if (Assembler::EmittingComments()) {
- __ Comment("%s slow path allocation of %s", instruction_->DebugName(),
+ __ Comment("%s slow path allocation of %s", instruction()->DebugName(),
String::Handle(cls_.ScrubbedName()).ToCString());
}
__ Bind(entry_label());
@@ -1783,7 +1777,7 @@
compiler->zone(), StubCode::GetAllocationStubForClass(cls_));
const StubEntry stub_entry(stub);
- LocationSummary* locs = instruction_->locs();
+ LocationSummary* locs = instruction()->locs();
locs->live_registers()->Remove(Location::RegisterLocation(result_));
@@ -1814,7 +1808,6 @@
}
private:
- Instruction* instruction_;
const Class& cls_;
const Register result_;
};
@@ -2436,35 +2429,33 @@
return locs;
}
-class AllocateContextSlowPath : public SlowPathCode {
+class AllocateContextSlowPath
+ : public TemplateSlowPathCode<AllocateUninitializedContextInstr> {
public:
explicit AllocateContextSlowPath(
AllocateUninitializedContextInstr* instruction)
- : instruction_(instruction) {}
+ : TemplateSlowPathCode(instruction) {}
virtual void EmitNativeCode(FlowGraphCompiler* compiler) {
__ Comment("AllocateContextSlowPath");
__ Bind(entry_label());
- LocationSummary* locs = instruction_->locs();
+ LocationSummary* locs = instruction()->locs();
locs->live_registers()->Remove(locs->out(0));
compiler->SaveLiveRegisters(locs);
- __ LoadImmediate(R1, instruction_->num_context_variables());
+ __ LoadImmediate(R1, instruction()->num_context_variables());
const Code& stub = Code::ZoneHandle(
compiler->zone(), StubCode::AllocateContext_entry()->code());
compiler->AddStubCallTarget(stub);
- compiler->GenerateCall(instruction_->token_pos(),
+ compiler->GenerateCall(instruction()->token_pos(),
*StubCode::AllocateContext_entry(),
RawPcDescriptors::kOther, locs);
- ASSERT(instruction_->locs()->out(0).reg() == R0);
- compiler->RestoreLiveRegisters(instruction_->locs());
+ ASSERT(instruction()->locs()->out(0).reg() == R0);
+ compiler->RestoreLiveRegisters(instruction()->locs());
__ b(exit_label());
}
-
- private:
- AllocateUninitializedContextInstr* instruction_;
};
void AllocateUninitializedContextInstr::EmitNativeCode(
@@ -2643,14 +2634,15 @@
return summary;
}
-class CheckStackOverflowSlowPath : public SlowPathCode {
+class CheckStackOverflowSlowPath
+ : public TemplateSlowPathCode<CheckStackOverflowInstr> {
public:
explicit CheckStackOverflowSlowPath(CheckStackOverflowInstr* instruction)
- : instruction_(instruction) {}
+ : TemplateSlowPathCode(instruction) {}
virtual void EmitNativeCode(FlowGraphCompiler* compiler) {
if (compiler->isolate()->use_osr() && osr_entry_label()->IsLinked()) {
- const Register value = instruction_->locs()->temp(0).reg();
+ const Register value = instruction()->locs()->temp(0).reg();
__ Comment("CheckStackOverflowSlowPathOsr");
__ Bind(osr_entry_label());
__ LoadImmediate(value, Thread::kOsrRequest);
@@ -2658,25 +2650,25 @@
}
__ Comment("CheckStackOverflowSlowPath");
__ Bind(entry_label());
- compiler->SaveLiveRegisters(instruction_->locs());
+ compiler->SaveLiveRegisters(instruction()->locs());
// pending_deoptimization_env_ is needed to generate a runtime call that
// may throw an exception.
ASSERT(compiler->pending_deoptimization_env_ == NULL);
- Environment* env = compiler->SlowPathEnvironmentFor(instruction_);
+ Environment* env = compiler->SlowPathEnvironmentFor(instruction());
compiler->pending_deoptimization_env_ = env;
compiler->GenerateRuntimeCall(
- instruction_->token_pos(), instruction_->deopt_id(),
- kStackOverflowRuntimeEntry, 0, instruction_->locs());
+ instruction()->token_pos(), instruction()->deopt_id(),
+ kStackOverflowRuntimeEntry, 0, instruction()->locs());
if (compiler->isolate()->use_osr() && !compiler->is_optimizing() &&
- instruction_->in_loop()) {
+ instruction()->in_loop()) {
// In unoptimized code, record loop stack checks as possible OSR entries.
compiler->AddCurrentDescriptor(RawPcDescriptors::kOsrEntry,
- instruction_->deopt_id(),
+ instruction()->deopt_id(),
TokenPosition::kNoSource);
}
compiler->pending_deoptimization_env_ = NULL;
- compiler->RestoreLiveRegisters(instruction_->locs());
+ compiler->RestoreLiveRegisters(instruction()->locs());
__ b(exit_label());
}
@@ -2686,7 +2678,6 @@
}
private:
- CheckStackOverflowInstr* instruction_;
Label osr_entry_label_;
};
@@ -2729,27 +2720,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;
}
@@ -2757,33 +2739,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;
}
@@ -2807,11 +2784,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,
@@ -2819,48 +2792,47 @@
__ 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);
}
}
-class CheckedSmiSlowPath : public SlowPathCode {
+class CheckedSmiSlowPath : public TemplateSlowPathCode<CheckedSmiOpInstr> {
public:
CheckedSmiSlowPath(CheckedSmiOpInstr* instruction, intptr_t try_index)
- : instruction_(instruction), try_index_(try_index) {}
+ : TemplateSlowPathCode(instruction), try_index_(try_index) {}
virtual void EmitNativeCode(FlowGraphCompiler* compiler) {
if (Assembler::EmittingComments()) {
__ Comment("slow path smi operation");
}
__ Bind(entry_label());
- LocationSummary* locs = instruction_->locs();
+ LocationSummary* locs = instruction()->locs();
Register result = locs->out(0).reg();
locs->live_registers()->Remove(Location::RegisterLocation(result));
compiler->SaveLiveRegisters(locs);
- if (instruction_->env() != NULL) {
- Environment* env = compiler->SlowPathEnvironmentFor(instruction_);
+ if (instruction()->env() != NULL) {
+ Environment* env = compiler->SlowPathEnvironmentFor(instruction());
compiler->pending_deoptimization_env_ = env;
}
__ Push(locs->in(0).reg());
__ Push(locs->in(1).reg());
const String& selector =
- String::Handle(instruction_->call()->ic_data()->target_name());
+ String::Handle(instruction()->call()->ic_data()->target_name());
const Array& arguments_descriptor =
- Array::Handle(instruction_->call()->ic_data()->arguments_descriptor());
+ Array::Handle(instruction()->call()->ic_data()->arguments_descriptor());
compiler->EmitMegamorphicInstanceCall(
- selector, arguments_descriptor, instruction_->call()->deopt_id(),
- instruction_->call()->token_pos(), locs, try_index_,
+ selector, arguments_descriptor, instruction()->call()->deopt_id(),
+ instruction()->call()->token_pos(), locs, try_index_,
/* slow_path_argument_count = */ 2);
__ mov(result, R0);
compiler->RestoreLiveRegisters(locs);
@@ -2869,7 +2841,6 @@
}
private:
- CheckedSmiOpInstr* instruction_;
intptr_t try_index_;
};
@@ -2910,20 +2881,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;
@@ -2948,8 +2917,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:
@@ -2959,8 +2928,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);
@@ -2970,16 +2937,16 @@
UNIMPLEMENTED();
}
__ Bind(slow_path->exit_label());
- __ AssertSmiInRange(result, Assembler::kValueCanBeHeapPointer);
}
-class CheckedSmiComparisonSlowPath : public SlowPathCode {
+class CheckedSmiComparisonSlowPath
+ : public TemplateSlowPathCode<CheckedSmiComparisonInstr> {
public:
CheckedSmiComparisonSlowPath(CheckedSmiComparisonInstr* instruction,
intptr_t try_index,
BranchLabels labels,
bool merged)
- : instruction_(instruction),
+ : TemplateSlowPathCode(instruction),
try_index_(try_index),
labels_(labels),
merged_(merged) {}
@@ -2989,42 +2956,41 @@
__ Comment("slow path smi operation");
}
__ Bind(entry_label());
- LocationSummary* locs = instruction_->locs();
+ LocationSummary* locs = instruction()->locs();
Register result = merged_ ? locs->temp(0).reg() : locs->out(0).reg();
locs->live_registers()->Remove(Location::RegisterLocation(result));
compiler->SaveLiveRegisters(locs);
- if (instruction_->env() != NULL) {
- Environment* env = compiler->SlowPathEnvironmentFor(instruction_);
+ if (instruction()->env() != NULL) {
+ Environment* env = compiler->SlowPathEnvironmentFor(instruction());
compiler->pending_deoptimization_env_ = env;
}
__ Push(locs->in(0).reg());
__ Push(locs->in(1).reg());
String& selector =
- String::Handle(instruction_->call()->ic_data()->target_name());
+ String::Handle(instruction()->call()->ic_data()->target_name());
const Array& arguments_descriptor =
- Array::Handle(instruction_->call()->ic_data()->arguments_descriptor());
+ Array::Handle(instruction()->call()->ic_data()->arguments_descriptor());
compiler->EmitMegamorphicInstanceCall(
- selector, arguments_descriptor, instruction_->call()->deopt_id(),
- instruction_->call()->token_pos(), locs, try_index_,
+ selector, arguments_descriptor, instruction()->call()->deopt_id(),
+ instruction()->call()->token_pos(), locs, try_index_,
/* slow_path_argument_count = */ 2);
__ mov(result, R0);
compiler->RestoreLiveRegisters(locs);
compiler->pending_deoptimization_env_ = NULL;
if (merged_) {
__ CompareObject(result, Bool::True());
- __ b(
- instruction_->is_negated() ? labels_.false_label : labels_.true_label,
- EQ);
- __ b(instruction_->is_negated() ? labels_.true_label
- : labels_.false_label);
+ __ b(instruction()->is_negated() ? labels_.false_label
+ : labels_.true_label,
+ EQ);
+ __ b(instruction()->is_negated() ? labels_.true_label
+ : labels_.false_label);
} else {
__ b(exit_label());
}
}
private:
- CheckedSmiComparisonInstr* instruction_;
intptr_t try_index_;
BranchLabels labels_;
bool merged_;
@@ -3161,28 +3127,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;
}
@@ -3190,14 +3148,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;
}
@@ -3208,10 +3164,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);
@@ -3246,7 +3201,6 @@
UNREACHABLE();
break;
}
- __ AssertSmiInRange(result);
return;
}
@@ -3255,26 +3209,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;
}
@@ -3282,13 +3228,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);
}
@@ -3323,7 +3266,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;
@@ -3368,10 +3311,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);
@@ -3400,7 +3341,6 @@
UNREACHABLE();
break;
}
- __ AssertSmiInRange(result);
}
LocationSummary* CheckEitherNonSmiInstr::MakeLocationSummary(Zone* zone,
@@ -3553,17 +3493,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;
}
@@ -3572,51 +3505,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,
@@ -3644,8 +3542,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);
@@ -4386,9 +4283,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:
@@ -4399,7 +4295,6 @@
default:
UNREACHABLE();
}
- __ AssertSmiInRange(result);
}
LocationSummary* UnaryDoubleOpInstr::MakeLocationSummary(Zone* zone,
@@ -4451,7 +4346,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,
@@ -4495,13 +4390,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);
@@ -4518,7 +4412,6 @@
args_info, locs(), ICData::Handle(),
ICData::kStatic);
__ Bind(&done);
- __ AssertSmiInRange(result, Assembler::kValueCanBeHeapPointer);
}
LocationSummary* DoubleToSmiInstr::MakeLocationSummary(Zone* zone,
@@ -4542,13 +4435,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,
@@ -4817,7 +4708,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);
@@ -5346,10 +5237,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.
@@ -5369,7 +5256,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_ia32.cc b/runtime/vm/compiler/backend/il_ia32.cc
index 86a74e8..68ba62f 100644
--- a/runtime/vm/compiler/backend/il_ia32.cc
+++ b/runtime/vm/compiler/backend/il_ia32.cc
@@ -1650,16 +1650,16 @@
}
}
-class BoxAllocationSlowPath : public SlowPathCode {
+class BoxAllocationSlowPath : public TemplateSlowPathCode<Instruction> {
public:
BoxAllocationSlowPath(Instruction* instruction,
const Class& cls,
Register result)
- : instruction_(instruction), cls_(cls), result_(result) {}
+ : TemplateSlowPathCode(instruction), cls_(cls), result_(result) {}
virtual void EmitNativeCode(FlowGraphCompiler* compiler) {
if (Assembler::EmittingComments()) {
- __ Comment("%s slow path allocation of %s", instruction_->DebugName(),
+ __ Comment("%s slow path allocation of %s", instruction()->DebugName(),
String::Handle(cls_.ScrubbedName()).ToCString());
}
__ Bind(entry_label());
@@ -1667,7 +1667,7 @@
compiler->zone(), StubCode::GetAllocationStubForClass(cls_));
const StubEntry stub_entry(stub);
- LocationSummary* locs = instruction_->locs();
+ LocationSummary* locs = instruction()->locs();
locs->live_registers()->Remove(Location::RegisterLocation(result_));
@@ -1700,7 +1700,6 @@
}
private:
- Instruction* instruction_;
const Class& cls_;
const Register result_;
};
@@ -2336,35 +2335,33 @@
return locs;
}
-class AllocateContextSlowPath : public SlowPathCode {
+class AllocateContextSlowPath
+ : public TemplateSlowPathCode<AllocateUninitializedContextInstr> {
public:
explicit AllocateContextSlowPath(
AllocateUninitializedContextInstr* instruction)
- : instruction_(instruction) {}
+ : TemplateSlowPathCode(instruction) {}
virtual void EmitNativeCode(FlowGraphCompiler* compiler) {
__ Comment("AllocateContextSlowPath");
__ Bind(entry_label());
- LocationSummary* locs = instruction_->locs();
+ LocationSummary* locs = instruction()->locs();
ASSERT(!locs->live_registers()->Contains(locs->out(0)));
compiler->SaveLiveRegisters(locs);
- __ movl(EDX, Immediate(instruction_->num_context_variables()));
+ __ movl(EDX, Immediate(instruction()->num_context_variables()));
const Code& stub = Code::ZoneHandle(
compiler->zone(), StubCode::AllocateContext_entry()->code());
compiler->AddStubCallTarget(stub);
- compiler->GenerateCall(instruction_->token_pos(),
+ compiler->GenerateCall(instruction()->token_pos(),
*StubCode::AllocateContext_entry(),
RawPcDescriptors::kOther, locs);
- ASSERT(instruction_->locs()->out(0).reg() == EAX);
- compiler->RestoreLiveRegisters(instruction_->locs());
+ ASSERT(instruction()->locs()->out(0).reg() == EAX);
+ compiler->RestoreLiveRegisters(instruction()->locs());
__ jmp(exit_label());
}
-
- private:
- AllocateUninitializedContextInstr* instruction_;
};
void AllocateUninitializedContextInstr::EmitNativeCode(
@@ -2559,10 +2556,11 @@
return summary;
}
-class CheckStackOverflowSlowPath : public SlowPathCode {
+class CheckStackOverflowSlowPath
+ : public TemplateSlowPathCode<CheckStackOverflowInstr> {
public:
explicit CheckStackOverflowSlowPath(CheckStackOverflowInstr* instruction)
- : instruction_(instruction) {}
+ : TemplateSlowPathCode(instruction) {}
virtual void EmitNativeCode(FlowGraphCompiler* compiler) {
if (compiler->isolate()->use_osr() && osr_entry_label()->IsLinked()) {
@@ -2573,25 +2571,25 @@
}
__ Comment("CheckStackOverflowSlowPath");
__ Bind(entry_label());
- compiler->SaveLiveRegisters(instruction_->locs());
+ compiler->SaveLiveRegisters(instruction()->locs());
// pending_deoptimization_env_ is needed to generate a runtime call that
// may throw an exception.
ASSERT(compiler->pending_deoptimization_env_ == NULL);
- Environment* env = compiler->SlowPathEnvironmentFor(instruction_);
+ Environment* env = compiler->SlowPathEnvironmentFor(instruction());
compiler->pending_deoptimization_env_ = env;
compiler->GenerateRuntimeCall(
- instruction_->token_pos(), instruction_->deopt_id(),
- kStackOverflowRuntimeEntry, 0, instruction_->locs());
+ instruction()->token_pos(), instruction()->deopt_id(),
+ kStackOverflowRuntimeEntry, 0, instruction()->locs());
if (compiler->isolate()->use_osr() && !compiler->is_optimizing() &&
- instruction_->in_loop()) {
+ instruction()->in_loop()) {
// In unoptimized code, record loop stack checks as possible OSR entries.
compiler->AddCurrentDescriptor(RawPcDescriptors::kOsrEntry,
- instruction_->deopt_id(),
+ instruction()->deopt_id(),
TokenPosition::kNoSource);
}
compiler->pending_deoptimization_env_ = NULL;
- compiler->RestoreLiveRegisters(instruction_->locs());
+ compiler->RestoreLiveRegisters(instruction()->locs());
__ jmp(exit_label());
}
@@ -2601,7 +2599,6 @@
}
private:
- CheckStackOverflowInstr* instruction_;
Label osr_entry_label_;
};
diff --git a/runtime/vm/compiler/backend/il_x64.cc b/runtime/vm/compiler/backend/il_x64.cc
index 1e292ce..f3109b6 100644
--- a/runtime/vm/compiler/backend/il_x64.cc
+++ b/runtime/vm/compiler/backend/il_x64.cc
@@ -951,16 +951,16 @@
}
}
-class BoxAllocationSlowPath : public SlowPathCode {
+class BoxAllocationSlowPath : public TemplateSlowPathCode<Instruction> {
public:
BoxAllocationSlowPath(Instruction* instruction,
const Class& cls,
Register result)
- : instruction_(instruction), cls_(cls), result_(result) {}
+ : TemplateSlowPathCode(instruction), cls_(cls), result_(result) {}
virtual void EmitNativeCode(FlowGraphCompiler* compiler) {
if (Assembler::EmittingComments()) {
- __ Comment("%s slow path allocation of %s", instruction_->DebugName(),
+ __ Comment("%s slow path allocation of %s", instruction()->DebugName(),
String::Handle(cls_.ScrubbedName()).ToCString());
}
__ Bind(entry_label());
@@ -968,7 +968,7 @@
compiler->zone(), StubCode::GetAllocationStubForClass(cls_));
const StubEntry stub_entry(stub);
- LocationSummary* locs = instruction_->locs();
+ LocationSummary* locs = instruction()->locs();
locs->live_registers()->Remove(Location::RegisterLocation(result_));
@@ -1001,7 +1001,6 @@
}
private:
- Instruction* instruction_;
const Class& cls_;
const Register result_;
};
@@ -1033,13 +1032,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:
@@ -1222,24 +1219,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;
}
@@ -1271,6 +1260,7 @@
default:
UNREACHABLE();
}
+ __ SmiTag(result);
break;
case kTwoByteStringCid:
case kExternalTwoByteStringCid:
@@ -1284,34 +1274,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(
@@ -2393,35 +2361,33 @@
return locs;
}
-class AllocateContextSlowPath : public SlowPathCode {
+class AllocateContextSlowPath
+ : public TemplateSlowPathCode<AllocateUninitializedContextInstr> {
public:
explicit AllocateContextSlowPath(
AllocateUninitializedContextInstr* instruction)
- : instruction_(instruction) {}
+ : TemplateSlowPathCode(instruction) {}
virtual void EmitNativeCode(FlowGraphCompiler* compiler) {
__ Comment("AllocateContextSlowPath");
__ Bind(entry_label());
- LocationSummary* locs = instruction_->locs();
+ LocationSummary* locs = instruction()->locs();
locs->live_registers()->Remove(locs->out(0));
compiler->SaveLiveRegisters(locs);
- __ LoadImmediate(R10, Immediate(instruction_->num_context_variables()));
+ __ LoadImmediate(R10, Immediate(instruction()->num_context_variables()));
const Code& stub = Code::ZoneHandle(
compiler->zone(), StubCode::AllocateContext_entry()->code());
compiler->AddStubCallTarget(stub);
- compiler->GenerateCall(instruction_->token_pos(),
+ compiler->GenerateCall(instruction()->token_pos(),
*StubCode::AllocateContext_entry(),
RawPcDescriptors::kOther, locs);
- ASSERT(instruction_->locs()->out(0).reg() == RAX);
- compiler->RestoreLiveRegisters(instruction_->locs());
+ ASSERT(instruction()->locs()->out(0).reg() == RAX);
+ compiler->RestoreLiveRegisters(instruction()->locs());
__ jmp(exit_label());
}
-
- private:
- AllocateUninitializedContextInstr* instruction_;
};
void AllocateUninitializedContextInstr::EmitNativeCode(
@@ -2611,10 +2577,11 @@
return summary;
}
-class CheckStackOverflowSlowPath : public SlowPathCode {
+class CheckStackOverflowSlowPath
+ : public TemplateSlowPathCode<CheckStackOverflowInstr> {
public:
explicit CheckStackOverflowSlowPath(CheckStackOverflowInstr* instruction)
- : instruction_(instruction) {}
+ : TemplateSlowPathCode(instruction) {}
virtual void EmitNativeCode(FlowGraphCompiler* compiler) {
if (compiler->isolate()->use_osr() && osr_entry_label()->IsLinked()) {
@@ -2625,25 +2592,25 @@
}
__ Comment("CheckStackOverflowSlowPath");
__ Bind(entry_label());
- compiler->SaveLiveRegisters(instruction_->locs());
+ compiler->SaveLiveRegisters(instruction()->locs());
// pending_deoptimization_env_ is needed to generate a runtime call that
// may throw an exception.
ASSERT(compiler->pending_deoptimization_env_ == NULL);
- Environment* env = compiler->SlowPathEnvironmentFor(instruction_);
+ Environment* env = compiler->SlowPathEnvironmentFor(instruction());
compiler->pending_deoptimization_env_ = env;
compiler->GenerateRuntimeCall(
- instruction_->token_pos(), instruction_->deopt_id(),
- kStackOverflowRuntimeEntry, 0, instruction_->locs());
+ instruction()->token_pos(), instruction()->deopt_id(),
+ kStackOverflowRuntimeEntry, 0, instruction()->locs());
if (compiler->isolate()->use_osr() && !compiler->is_optimizing() &&
- instruction_->in_loop()) {
+ instruction()->in_loop()) {
// In unoptimized code, record loop stack checks as possible OSR entries.
compiler->AddCurrentDescriptor(RawPcDescriptors::kOsrEntry,
- instruction_->deopt_id(),
+ instruction()->deopt_id(),
TokenPosition::kNoSource);
}
compiler->pending_deoptimization_env_ = NULL;
- compiler->RestoreLiveRegisters(instruction_->locs());
+ compiler->RestoreLiveRegisters(instruction()->locs());
__ jmp(exit_label());
}
@@ -2653,7 +2620,6 @@
}
private:
- CheckStackOverflowInstr* instruction_;
Label osr_entry_label_;
};
@@ -2695,32 +2661,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;
}
@@ -2731,32 +2692,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;
}
@@ -2780,18 +2732,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());
@@ -2801,49 +2748,47 @@
}
// 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());
}
}
-class CheckedSmiSlowPath : public SlowPathCode {
+class CheckedSmiSlowPath : public TemplateSlowPathCode<CheckedSmiOpInstr> {
public:
CheckedSmiSlowPath(CheckedSmiOpInstr* instruction, intptr_t try_index)
- : instruction_(instruction), try_index_(try_index) {}
+ : TemplateSlowPathCode(instruction), try_index_(try_index) {}
virtual void EmitNativeCode(FlowGraphCompiler* compiler) {
if (Assembler::EmittingComments()) {
__ Comment("slow path smi operation");
}
__ Bind(entry_label());
- LocationSummary* locs = instruction_->locs();
+ LocationSummary* locs = instruction()->locs();
Register result = locs->out(0).reg();
locs->live_registers()->Remove(Location::RegisterLocation(result));
compiler->SaveLiveRegisters(locs);
- if (instruction_->env() != NULL) {
- Environment* env = compiler->SlowPathEnvironmentFor(instruction_);
+ if (instruction()->env() != NULL) {
+ Environment* env = compiler->SlowPathEnvironmentFor(instruction());
compiler->pending_deoptimization_env_ = env;
}
__ pushq(locs->in(0).reg());
__ pushq(locs->in(1).reg());
const String& selector =
- String::Handle(instruction_->call()->ic_data()->target_name());
+ String::Handle(instruction()->call()->ic_data()->target_name());
const Array& arguments_descriptor =
- Array::Handle(instruction_->call()->ic_data()->arguments_descriptor());
+ Array::Handle(instruction()->call()->ic_data()->arguments_descriptor());
compiler->EmitMegamorphicInstanceCall(
- selector, arguments_descriptor, instruction_->call()->deopt_id(),
- instruction_->call()->token_pos(), locs, try_index_,
+ selector, arguments_descriptor, instruction()->call()->deopt_id(),
+ instruction()->call()->token_pos(), locs, try_index_,
/* slow_path_argument_count = */ 2);
__ MoveRegister(result, RAX);
compiler->RestoreLiveRegisters(locs);
@@ -2852,7 +2797,6 @@
}
private:
- CheckedSmiOpInstr* instruction_;
intptr_t try_index_;
};
@@ -2913,23 +2857,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);
@@ -2950,15 +2890,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;
@@ -2967,8 +2905,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);
@@ -2983,13 +2919,14 @@
__ Bind(slow_path->exit_label());
}
-class CheckedSmiComparisonSlowPath : public SlowPathCode {
+class CheckedSmiComparisonSlowPath
+ : public TemplateSlowPathCode<CheckedSmiComparisonInstr> {
public:
CheckedSmiComparisonSlowPath(CheckedSmiComparisonInstr* instruction,
intptr_t try_index,
BranchLabels labels,
bool merged = false)
- : instruction_(instruction),
+ : TemplateSlowPathCode(instruction),
try_index_(try_index),
labels_(labels),
merged_(merged) {}
@@ -2999,41 +2936,40 @@
__ Comment("slow path smi comparison");
}
__ Bind(entry_label());
- LocationSummary* locs = instruction_->locs();
+ LocationSummary* locs = instruction()->locs();
Register result = merged_ ? locs->temp(0).reg() : locs->out(0).reg();
locs->live_registers()->Remove(Location::RegisterLocation(result));
compiler->SaveLiveRegisters(locs);
- if (instruction_->env() != NULL) {
- Environment* env = compiler->SlowPathEnvironmentFor(instruction_);
+ if (instruction()->env() != NULL) {
+ Environment* env = compiler->SlowPathEnvironmentFor(instruction());
compiler->pending_deoptimization_env_ = env;
}
__ pushq(locs->in(0).reg());
__ pushq(locs->in(1).reg());
String& selector =
- String::Handle(instruction_->call()->ic_data()->target_name());
+ String::Handle(instruction()->call()->ic_data()->target_name());
const Array& arguments_descriptor =
- Array::Handle(instruction_->call()->ic_data()->arguments_descriptor());
+ Array::Handle(instruction()->call()->ic_data()->arguments_descriptor());
compiler->EmitMegamorphicInstanceCall(
- selector, arguments_descriptor, instruction_->call()->deopt_id(),
- instruction_->call()->token_pos(), locs, try_index_,
+ selector, arguments_descriptor, instruction()->call()->deopt_id(),
+ instruction()->call()->token_pos(), locs, try_index_,
/* slow_path_argument_count = */ 2);
__ MoveRegister(result, RAX);
compiler->RestoreLiveRegisters(locs);
compiler->pending_deoptimization_env_ = NULL;
if (merged_) {
__ CompareObject(result, Bool::True());
- __ j(EQUAL, instruction_->is_negated() ? labels_.false_label
- : labels_.true_label);
- __ jmp(instruction_->is_negated() ? labels_.true_label
- : labels_.false_label);
+ __ j(EQUAL, instruction()->is_negated() ? labels_.false_label
+ : labels_.true_label);
+ __ jmp(instruction()->is_negated() ? labels_.true_label
+ : labels_.false_label);
} else {
__ jmp(exit_label());
}
}
private:
- CheckedSmiComparisonInstr* instruction_;
intptr_t try_index_;
BranchLabels labels_;
bool merged_;
@@ -3226,41 +3162,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: {
@@ -3272,9 +3187,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);
@@ -3303,10 +3216,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)));
@@ -3318,7 +3229,6 @@
UNREACHABLE();
break;
}
- __ AssertSmiInRange(left);
return;
} // locs()->in(1).IsConstant().
@@ -3326,40 +3236,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: {
@@ -3388,40 +3277,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: {
@@ -3440,6 +3308,8 @@
break;
}
case Token::kTRUNCDIV: {
+ Label not_32bit, done;
+
Register temp = locs()->temp(0).reg();
ASSERT(left == RAX);
ASSERT((right != RDX) && (right != RAX));
@@ -3450,20 +3320,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));
@@ -3474,6 +3367,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);
@@ -3481,7 +3385,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) {
@@ -3519,10 +3432,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));
@@ -3735,52 +3645,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,
@@ -3788,61 +3687,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,
@@ -3864,20 +3729,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);
}
}
@@ -4439,9 +4299,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:
@@ -4590,7 +4449,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);
}
@@ -4620,15 +4478,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);
@@ -4664,15 +4521,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,
@@ -4971,7 +4827,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;
@@ -4986,26 +4841,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) {
@@ -5015,16 +4894,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()) {
@@ -5034,7 +4913,7 @@
// Right is negative.
__ subq(RDX, right);
}
- __ Bind(&done);
+ __ Bind(&all_done);
__ SmiTag(RAX);
__ SmiTag(RDX);
@@ -5376,7 +5255,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));
@@ -5409,15 +5287,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,
@@ -5532,7 +5410,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.
@@ -5557,7 +5434,7 @@
__ Bind(&zero);
// Shift was greater than 31 bits, just return zero.
- __ xorl(left, left);
+ __ xorq(left, left);
// Exit path.
__ Bind(&done);
@@ -5598,8 +5475,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.cc b/runtime/vm/compiler/backend/range_analysis.cc
index 689b89c..c7e0628 100644
--- a/runtime/vm/compiler/backend/range_analysis.cc
+++ b/runtime/vm/compiler/backend/range_analysis.cc
@@ -2741,13 +2741,22 @@
void LoadCodeUnitsInstr::InferRange(RangeAnalysis* analysis, Range* range) {
ASSERT(RawObject::IsStringClassId(class_id()));
+ RangeBoundary zero = RangeBoundary::FromConstant(0);
+ // Take the number of loaded characters into account when determining the
+ // range of the result.
+ ASSERT(element_count_ > 0);
switch (class_id()) {
case kOneByteStringCid:
- case kTwoByteStringCid:
case kExternalOneByteStringCid:
+ ASSERT(element_count_ <= 4);
+ *range = Range(zero, RangeBoundary::FromConstant(
+ Utils::NBitMask(kBitsPerByte * element_count_)));
+ break;
+ case kTwoByteStringCid:
case kExternalTwoByteStringCid:
- *range = Range(RangeBoundary::FromConstant(0),
- RangeBoundary::FromConstant(kMaxUint32));
+ ASSERT(element_count_ <= 2);
+ *range = Range(zero, RangeBoundary::FromConstant(Utils::NBitMask(
+ 2 * kBitsPerByte * element_count_)));
break;
default:
UNREACHABLE();
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 faae4bd..30e0407 100644
--- a/runtime/vm/compiler/call_specializer.cc
+++ b/runtime/vm/compiler/call_specializer.cc
@@ -1558,10 +1558,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/compiler_pass.cc b/runtime/vm/compiler/compiler_pass.cc
index 6750314..008ce2b 100644
--- a/runtime/vm/compiler/compiler_pass.cc
+++ b/runtime/vm/compiler/compiler_pass.cc
@@ -52,6 +52,8 @@
"List of comma separated compilation passes flags. "
"Use -Name to disable a pass, Name to print IL after it. "
"Do --compiler-passes=help for more information.");
+DECLARE_FLAG(bool, print_flow_graph);
+DECLARE_FLAG(bool, print_flow_graph_optimized);
static const char* kCompilerPassesUsage =
"=== How to use --compiler-passes flag\n"
@@ -87,6 +89,13 @@
return;
}
+ // Clear all flags.
+ for (intptr_t i = 0; i < kNumPasses; i++) {
+ if (passes_[i] != NULL) {
+ passes_[i]->flags_ = 0;
+ }
+ }
+
for (const char *start = filter, *end = filter; *end != 0;
start = (end + 1)) {
// Search forward until the separator ',' or the end of filter is reached.
@@ -180,7 +189,8 @@
const intptr_t current_flags = flags() | state->sticky_flags;
FlowGraph* flow_graph = state->flow_graph;
- if (flow_graph->should_print() && ((current_flags & mask) != 0)) {
+ if ((FLAG_print_flow_graph || FLAG_print_flow_graph_optimized) &&
+ flow_graph->should_print() && ((current_flags & mask) != 0)) {
Zone* zone = state->thread->zone();
const char* when = mask == kTraceBefore ? "Before" : "After";
const char* phase =
diff --git a/runtime/vm/compiler/compiler_pass.h b/runtime/vm/compiler/compiler_pass.h
index 4c31527..39d6077 100644
--- a/runtime/vm/compiler/compiler_pass.h
+++ b/runtime/vm/compiler/compiler_pass.h
@@ -113,6 +113,11 @@
CompilerPass(Id id, const char* name) : name_(name), flags_(0) {
ASSERT(passes_[id] == NULL);
passes_[id] = this;
+
+ // By default print the final flow-graph after the register allocation.
+ if (id == kAllocateRegisters) {
+ flags_ = kTraceAfter;
+ }
}
virtual ~CompilerPass() {}
diff --git a/runtime/vm/compiler/compiler_sources.gni b/runtime/vm/compiler/compiler_sources.gni
index 4b5a3ec..af0ec3f 100644
--- a/runtime/vm/compiler/compiler_sources.gni
+++ b/runtime/vm/compiler/compiler_sources.gni
@@ -31,6 +31,8 @@
"backend/block_scheduler.h",
"backend/branch_optimizer.cc",
"backend/branch_optimizer.h",
+ "backend/code_statistics.cc",
+ "backend/code_statistics.h",
"backend/constant_propagator.cc",
"backend/constant_propagator.h",
"backend/flow_graph.cc",
diff --git a/runtime/vm/compiler/frontend/kernel_binary_flowgraph.cc b/runtime/vm/compiler/frontend/kernel_binary_flowgraph.cc
index 2776ee8..684a6c3 100644
--- a/runtime/vm/compiler/frontend/kernel_binary_flowgraph.cc
+++ b/runtime/vm/compiler/frontend/kernel_binary_flowgraph.cc
@@ -1361,7 +1361,6 @@
}
case kPropertyGet:
builder_->ReadPosition(); // read position.
- builder_->ReadFlags(); // read flags.
VisitExpression(); // read receiver.
builder_->SkipName(); // read name.
// read interface_target_reference.
@@ -1369,7 +1368,6 @@
return;
case kPropertySet:
builder_->ReadPosition(); // read position.
- builder_->ReadFlags(); // read flags
VisitExpression(); // read receiver.
builder_->SkipName(); // read name.
VisitExpression(); // read value.
@@ -1378,13 +1376,11 @@
return;
case kDirectPropertyGet:
builder_->ReadPosition(); // read position.
- builder_->ReadFlags(); // read flags.
VisitExpression(); // read receiver.
builder_->SkipCanonicalNameReference(); // read target_reference.
return;
case kDirectPropertySet:
builder_->ReadPosition(); // read position.
- builder_->ReadFlags(); // read flags.
VisitExpression(); // read receiver.
builder_->SkipCanonicalNameReference(); // read target_reference.
VisitExpression(); // read value·
@@ -1413,7 +1409,6 @@
return;
case kMethodInvocation:
builder_->ReadPosition(); // read position.
- builder_->ReadFlags(); // read flags.
VisitExpression(); // read receiver.
builder_->SkipName(); // read name.
VisitArguments(); // read arguments.
@@ -1422,7 +1417,6 @@
return;
case kDirectMethodInvocation:
builder_->ReadPosition(); // read position.
- builder_->ReadFlags(); // read flags.
VisitExpression(); // read receiver.
builder_->SkipCanonicalNameReference(); // read target_reference.
VisitArguments(); // read arguments.
@@ -3027,7 +3021,6 @@
void StreamingConstantEvaluator::EvaluatePropertyGet() {
const TokenPosition position = builder_->ReadPosition(); // read position.
- builder_->ReadFlags(); // read flags.
intptr_t expression_offset = builder_->ReaderOffset();
builder_->SkipExpression(); // read receiver.
StringIndex name = builder_->ReadNameAsStringIndex(); // read name.
@@ -3044,7 +3037,6 @@
void StreamingConstantEvaluator::EvaluateDirectPropertyGet() {
TokenPosition position = builder_->ReadPosition(); // read position.
- builder_->ReadFlags(); // read flags.
intptr_t expression_offset = builder_->ReaderOffset();
builder_->SkipExpression(); // read receiver.
NameIndex kernel_name =
@@ -3125,7 +3117,6 @@
void StreamingConstantEvaluator::EvaluateMethodInvocation() {
builder_->ReadPosition(); // read position.
- builder_->ReadFlags(); // read flags.
// This method call wasn't cached, so receiver et al. isn't cached either.
const Instance& receiver =
EvaluateExpression(builder_->ReaderOffset(), false); // read receiver.
@@ -3152,7 +3143,6 @@
void StreamingConstantEvaluator::EvaluateDirectMethodInvocation() {
builder_->ReadPosition(); // read position.
- builder_->ReadFlags(); // read flags.
const Instance& receiver =
EvaluateExpression(builder_->ReaderOffset(), false); // read receiver.
@@ -3624,8 +3614,7 @@
// We do not support generic methods yet.
const int kTypeArgsLen = 0;
const Array& args_descriptor = Array::Handle(
- Z, ArgumentsDescriptor::New(kTypeArgsLen, arguments.Length(), names,
- H.allocation_space()));
+ Z, ArgumentsDescriptor::New(kTypeArgsLen, arguments.Length(), names));
const Object& result = Object::Handle(
Z, DartEntry::InvokeFunction(function, arguments, args_descriptor));
if (result.IsError()) {
@@ -4211,10 +4200,9 @@
const Class& owner = Class::ZoneHandle(Z, parent.Owner());
Function& target = Function::ZoneHandle(Z, owner.LookupFunction(func_name));
- if (target.raw() != parent.raw()) {
+ if (!target.IsNull() && (target.raw() != parent.raw())) {
DEBUG_ASSERT(Isolate::Current()->HasAttemptedReload());
- if (target.IsNull() || (target.is_static() != parent.is_static()) ||
- (target.kind() != parent.kind())) {
+ if ((target.is_static() != parent.is_static()) || (target.kind() != parent.kind())) {
target = Function::null();
}
}
@@ -5665,14 +5653,12 @@
return;
case kPropertyGet:
ReadPosition(); // read position.
- SkipFlags(); // read flags.
SkipExpression(); // read receiver.
SkipName(); // read name.
SkipCanonicalNameReference(); // read interface_target_reference.
return;
case kPropertySet:
ReadPosition(); // read position.
- SkipFlags(); // read flags
SkipExpression(); // read receiver.
SkipName(); // read name.
SkipExpression(); // read value.
@@ -5691,13 +5677,11 @@
return;
case kDirectPropertyGet:
ReadPosition(); // read position.
- SkipFlags(); // read flags.
SkipExpression(); // read receiver.
SkipCanonicalNameReference(); // read target_reference.
return;
case kDirectPropertySet:
ReadPosition(); // read position.
- SkipFlags(); // read flags.
SkipExpression(); // read receiver.
SkipCanonicalNameReference(); // read target_reference.
SkipExpression(); // read value·
@@ -5713,7 +5697,6 @@
return;
case kMethodInvocation:
ReadPosition(); // read position.
- SkipFlags(); // read flags.
SkipExpression(); // read receiver.
SkipName(); // read name.
SkipArguments(); // read arguments.
@@ -5727,7 +5710,6 @@
return;
case kDirectMethodInvocation:
ReadPosition(); // read position.
- SkipFlags(); // read flags.
SkipExpression(); // read receiver.
SkipCanonicalNameReference(); // read target_reference.
SkipArguments(); // read arguments.
@@ -6582,7 +6564,8 @@
Fragment StreamingFlowGraphBuilder::CheckArgumentType(
LocalVariable* variable,
const AbstractType& type) {
- return flow_graph_builder_->CheckAssignable(type, variable->name());
+ return flow_graph_builder_->CheckAssignable(
+ type, variable->name(), AssertAssignableInstr::kParameterCheck);
}
Fragment StreamingFlowGraphBuilder::CheckTypeArgumentBound(
@@ -6762,8 +6745,6 @@
const InferredTypeMetadata result_type =
inferred_type_metadata_helper_.GetInferredType(offset);
- ReadFlags(); // read flags
-
Fragment instructions = BuildExpression(); // read receiver.
LocalVariable* receiver = NULL;
@@ -6823,8 +6804,6 @@
const TokenPosition position = ReadPosition(); // read position.
if (p != NULL) *p = position;
- ReadFlags(); // skip flags
-
instructions += BuildExpression(); // read receiver.
LocalVariable* receiver = NULL;
@@ -7098,8 +7077,6 @@
const InferredTypeMetadata result_type =
inferred_type_metadata_helper_.GetInferredType(offset);
- ReadFlags(); // read flags.
-
const Tag receiver_tag = PeekTag(); // peek tag for receiver.
Fragment instructions = BuildExpression(); // read receiver.
const NameIndex kernel_name =
@@ -7149,8 +7126,6 @@
const TokenPosition position = ReadPosition(); // read position.
if (p != NULL) *p = position;
- ReadFlags(); // skip flags.
-
Fragment instructions(NullConstant());
LocalVariable* value = MakeTemporary();
@@ -7282,8 +7257,6 @@
const InferredTypeMetadata result_type =
inferred_type_metadata_helper_.GetInferredType(offset);
- ReadFlags(); // skip flags.
-
const Tag receiver_tag = PeekTag(); // peek tag for receiver.
if (IsNumberLiteral(receiver_tag) &&
(!optimizing() || constant_evaluator_.IsCached(offset))) {
@@ -7458,8 +7431,6 @@
const InferredTypeMetadata result_type =
inferred_type_metadata_helper_.GetInferredType(offset);
- ReadFlags(); // skip flags.
-
Tag receiver_tag = PeekTag(); // peek tag for receiver.
Fragment instructions;
@@ -8067,8 +8038,9 @@
// the result of the `obj as dynamic` expression.
} else if (is_type_error) {
instructions += LoadLocal(MakeTemporary());
- instructions += flow_graph_builder_->AssertAssignable(value_position, type,
- Symbols::Empty());
+ instructions += flow_graph_builder_->AssertAssignable(
+ value_position, type, Symbols::Empty(),
+ AssertAssignableInstr::kInsertedByFrontend);
instructions += Drop();
} else {
instructions += PushArgument();
@@ -8355,9 +8327,9 @@
TokenPosition* position) {
if (position != NULL) *position = TokenPosition::kNoSource;
- Double& constant =
- Double::ZoneHandle(Z, Double::New(H.DartString(ReadStringReference()),
- Heap::kOld)); // read string reference.
+ Double& constant = Double::ZoneHandle(
+ Z, Double::NewCanonical(
+ H.DartString(ReadStringReference()))); // read string reference.
return Constant(constant);
}
diff --git a/runtime/vm/compiler/frontend/kernel_binary_flowgraph.h b/runtime/vm/compiler/frontend/kernel_binary_flowgraph.h
index 6881cc6..722e9ab 100644
--- a/runtime/vm/compiler/frontend/kernel_binary_flowgraph.h
+++ b/runtime/vm/compiler/frontend/kernel_binary_flowgraph.h
@@ -1093,8 +1093,6 @@
void ReadUntilFunctionNode(ParsedFunction* set_forwarding_stub = NULL);
intptr_t ReadListLength();
- enum DispatchCategory { Interface, ViaThis, Closure, DynamicDispatch };
-
void ReportUnexpectedTag(const char* variant, Tag tag);
private:
diff --git a/runtime/vm/compiler/frontend/kernel_to_il.cc b/runtime/vm/compiler/frontend/kernel_to_il.cc
index 35ec95c..5cb1b88 100644
--- a/runtime/vm/compiler/frontend/kernel_to_il.cc
+++ b/runtime/vm/compiler/frontend/kernel_to_il.cc
@@ -2235,7 +2235,8 @@
}
Fragment FlowGraphBuilder::CheckAssignable(const AbstractType& dst_type,
- const String& dst_name) {
+ const String& dst_name,
+ AssertAssignableInstr::Kind kind) {
Fragment instructions;
if (dst_type.IsMalformed()) {
return ThrowTypeError();
@@ -2245,7 +2246,7 @@
LocalVariable* top_of_stack = MakeTemporary();
instructions += LoadLocal(top_of_stack);
instructions +=
- AssertAssignable(TokenPosition::kNoSource, dst_type, dst_name);
+ AssertAssignable(TokenPosition::kNoSource, dst_type, dst_name, kind);
instructions += Drop();
}
return instructions;
@@ -2261,7 +2262,8 @@
Fragment FlowGraphBuilder::AssertAssignable(TokenPosition position,
const AbstractType& dst_type,
- const String& dst_name) {
+ const String& dst_name,
+ AssertAssignableInstr::Kind kind) {
Fragment instructions;
Value* value = Pop();
@@ -2281,7 +2283,7 @@
AssertAssignableInstr* instr = new (Z) AssertAssignableInstr(
position, value, instantiator_type_args, function_type_args, dst_type,
- dst_name, GetNextDeoptId());
+ dst_name, GetNextDeoptId(), kind);
Push(instr);
instructions += Fragment(instr);
diff --git a/runtime/vm/compiler/frontend/kernel_to_il.h b/runtime/vm/compiler/frontend/kernel_to_il.h
index 2dca058..eacb8c0 100644
--- a/runtime/vm/compiler/frontend/kernel_to_il.h
+++ b/runtime/vm/compiler/frontend/kernel_to_il.h
@@ -784,13 +784,17 @@
Fragment CheckVariableTypeInCheckedMode(const AbstractType& dst_type,
const String& name_symbol);
Fragment CheckBoolean();
- Fragment CheckAssignable(const AbstractType& dst_type,
- const String& dst_name);
+ Fragment CheckAssignable(
+ const AbstractType& dst_type,
+ const String& dst_name,
+ AssertAssignableInstr::Kind kind = AssertAssignableInstr::kUnknown);
Fragment AssertBool();
- Fragment AssertAssignable(TokenPosition position,
- const AbstractType& dst_type,
- const String& dst_name);
+ Fragment AssertAssignable(
+ TokenPosition position,
+ const AbstractType& dst_type,
+ const String& dst_name,
+ AssertAssignableInstr::Kind kind = AssertAssignableInstr::kUnknown);
Fragment AssertSubtype(TokenPosition position,
const AbstractType& sub_type,
const AbstractType& super_type,
diff --git a/runtime/vm/compiler/frontend/prologue_builder.cc b/runtime/vm/compiler/frontend/prologue_builder.cc
index 3fa4854..66a82c9 100644
--- a/runtime/vm/compiler/frontend/prologue_builder.cc
+++ b/runtime/vm/compiler/frontend/prologue_builder.cc
@@ -89,11 +89,6 @@
TargetEntryInstr *then, *fail;
check_type_args += LoadArgDescriptor();
check_type_args += LoadField(ArgumentsDescriptor::type_args_len_offset());
- if (strong) {
- check_type_args +=
- IntConstant(ArgumentsDescriptor::TypeArgsLenField::mask());
- check_type_args += SmiBinaryOp(Token::kBIT_AND, /* truncate= */ true);
- }
if (expect_type_args) {
JoinEntryInstr* join2 = BuildJoinEntry();
@@ -143,12 +138,6 @@
copy_args_prologue += LoadArgDescriptor();
copy_args_prologue +=
LoadField(ArgumentsDescriptor::positional_count_offset());
- if (strong) {
- copy_args_prologue +=
- IntConstant(ArgumentsDescriptor::PositionalCountField::mask());
- copy_args_prologue += SmiBinaryOp(Token::kBIT_AND, /* truncate= */ true);
- }
-
LocalVariable* positional_count_var = MakeTemporary();
copy_args_prologue += LoadArgDescriptor();
@@ -298,12 +287,6 @@
good += LoadLocal(tuple_diff);
good += SmiBinaryOp(Token::kADD, /* truncate= */ true);
good += LoadIndexed(/* index_scale = */ kWordSize);
- if (strong) {
- ASSERT(ArgumentsDescriptor::NamedPositionField::shift() == 0);
- good +=
- IntConstant(ArgumentsDescriptor::NamedPositionField::mask());
- good += SmiBinaryOp(Token::kBIT_AND, /* truncate= */ true);
- }
}
good += SmiBinaryOp(Token::kSUB, /* truncate= */ true);
good += LoadFpRelativeSlot(kWordSize * kParamEndSlotFromFp);
@@ -383,10 +366,6 @@
Fragment check_len(then);
check_len += LoadArgDescriptor();
check_len += LoadField(ArgumentsDescriptor::positional_count_offset());
- if (strong) {
- check_len += IntConstant(ArgumentsDescriptor::PositionalCountField::mask());
- check_len += SmiBinaryOp(Token::kBIT_AND, /* truncate= */ true);
- }
check_len += BranchIfEqual(&then2, &fail2);
Fragment(fail) + Goto(nsm);
@@ -420,11 +399,6 @@
TargetEntryInstr *passed, *not_passed;
populate_args_desc += LoadArgDescriptor();
populate_args_desc += LoadField(ArgumentsDescriptor::type_args_len_offset());
- if (strong) {
- populate_args_desc +=
- IntConstant(ArgumentsDescriptor::TypeArgsLenField::mask());
- populate_args_desc += SmiBinaryOp(Token::kBIT_AND, /* truncate= */ true);
- }
populate_args_desc += IntConstant(0);
populate_args_desc += BranchIfEqual(¬_passed, &passed);
diff --git a/runtime/vm/compiler/intrinsifier_arm64.cc b/runtime/vm/compiler/intrinsifier_arm64.cc
index 3625729..4da90f0 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/constants_arm64.h b/runtime/vm/constants_arm64.h
index a34d996..829e3d9 100644
--- a/runtime/vm/constants_arm64.h
+++ b/runtime/vm/constants_arm64.h
@@ -707,14 +707,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_entry.cc b/runtime/vm/dart_entry.cc
index 47c52c0..860f672 100644
--- a/runtime/vm/dart_entry.cc
+++ b/runtime/vm/dart_entry.cc
@@ -272,18 +272,15 @@
ArgumentsDescriptor::ArgumentsDescriptor(const Array& array) : array_(array) {}
intptr_t ArgumentsDescriptor::TypeArgsLen() const {
- return TypeArgsLenField::decode(
- Smi::Cast(Object::Handle(array_.At(kTypeArgsLenIndex))).Value());
+ return Smi::Value(Smi::RawCast(array_.At(kTypeArgsLenIndex)));
}
intptr_t ArgumentsDescriptor::Count() const {
- return Smi::Cast(Object::Handle(array_.At(kCountIndex))).Value();
+ return Smi::Value(Smi::RawCast(array_.At(kCountIndex)));
}
intptr_t ArgumentsDescriptor::PositionalCount() const {
- intptr_t entry =
- Smi::Cast(Object::Handle(array_.At(kPositionalCountIndex))).Value();
- return PositionalCountField::decode(entry);
+ return Smi::Value(Smi::RawCast(array_.At(kPositionalCountIndex)));
}
RawString* ArgumentsDescriptor::NameAt(intptr_t index) const {
@@ -297,8 +294,7 @@
intptr_t ArgumentsDescriptor::PositionAt(intptr_t index) const {
const intptr_t offset =
kFirstNamedEntryIndex + (index * kNamedEntrySize) + kPositionOffset;
- return NamedPositionField::decode(
- Smi::Value(Smi::RawCast(array_.At(offset))));
+ return Smi::Value(Smi::RawCast(array_.At(offset)));
}
bool ArgumentsDescriptor::MatchesNameAt(intptr_t index,
@@ -324,9 +320,7 @@
RawArray* ArgumentsDescriptor::New(intptr_t type_args_len,
intptr_t num_arguments,
- const Array& optional_arguments_names,
- intptr_t arg_bits,
- intptr_t type_arg_bits) {
+ const Array& optional_arguments_names) {
const intptr_t num_named_args =
optional_arguments_names.IsNull() ? 0 : optional_arguments_names.Length();
if (num_named_args == 0) {
@@ -336,16 +330,6 @@
ASSERT(num_arguments >= 0);
const intptr_t num_pos_args = num_arguments - num_named_args;
- intptr_t pos_arg_bits = arg_bits;
- pos_arg_bits &= Utils::SignedNBitMask(Utils::Minimum<intptr_t>(
- num_pos_args,
- ArgumentsDescriptor::PositionalArgumentsChecksField::bitsize()));
-
- type_arg_bits &= Utils::SignedNBitMask(Utils::Minimum<intptr_t>(
- type_args_len, ArgumentsDescriptor::TypeArgsChecksField::bitsize()));
-
- const intptr_t named_arg_bits = arg_bits >> num_pos_args;
-
// Build the arguments descriptor array, which consists of the the type
// argument vector length (0 if none); total argument count; the positional
// argument count; a sequence of (name, position) pairs, sorted by name, for
@@ -358,18 +342,12 @@
Array::Handle(zone, Array::New(descriptor_len, Heap::kOld));
// Set length of type argument vector.
- descriptor.SetAt(kTypeArgsLenIndex,
- Smi::Handle(PackBitFieldsToSmi(
- TypeArgsChecksField::encode(type_arg_bits) |
- TypeArgsLenField::encode(type_args_len))));
+ descriptor.SetAt(kTypeArgsLenIndex, Smi::Handle(Smi::New(type_args_len)));
// Set total number of passed arguments.
descriptor.SetAt(kCountIndex, Smi::Handle(Smi::New(num_arguments)));
// Set number of positional arguments.
- descriptor.SetAt(kPositionalCountIndex,
- Smi::Handle(PackBitFieldsToSmi(
- PositionalCountField::encode(num_pos_args) |
- PositionalArgumentsChecksField::encode(pos_arg_bits))));
+ descriptor.SetAt(kPositionalCountIndex, Smi::Handle(Smi::New(num_pos_args)));
// Set alphabetically sorted entries for named arguments.
String& name = String::Handle(zone);
@@ -378,9 +356,7 @@
Smi& previous_pos = Smi::Handle(zone);
for (intptr_t i = 0; i < num_named_args; i++) {
name ^= optional_arguments_names.At(i);
- pos =
- PackBitFieldsToSmi(NamedCheckField::encode((named_arg_bits >> i) & 1) |
- NamedPositionField::encode(num_pos_args + i));
+ pos = Smi::New(num_pos_args + i);
intptr_t insert_index = kFirstNamedEntryIndex + (kNamedEntrySize * i);
// Shift already inserted pairs with "larger" names.
while (insert_index > kFirstNamedEntryIndex) {
@@ -409,31 +385,18 @@
}
RawArray* ArgumentsDescriptor::New(intptr_t type_args_len,
- intptr_t num_arguments,
- intptr_t arg_bits,
- intptr_t type_arg_bits) {
+ intptr_t num_arguments) {
ASSERT(type_args_len >= 0);
ASSERT(num_arguments >= 0);
- arg_bits &= Utils::NBitMask(Utils::Minimum<intptr_t>(
- num_arguments, PositionalArgumentsChecksField::bitsize()));
- type_arg_bits &= Utils::NBitMask(
- Utils::Minimum<intptr_t>(type_args_len, TypeArgsChecksField::bitsize()));
-
- // TODO(sjindel): Support caching of argument descriptors for calls with
- // strong-mode annotations.
- if ((type_args_len == 0) && (num_arguments < kCachedDescriptorCount) &&
- (arg_bits == 0) && (type_arg_bits == 0)) {
+ if ((type_args_len == 0) && (num_arguments < kCachedDescriptorCount)) {
return cached_args_descriptors_[num_arguments];
}
- return NewNonCached(type_args_len, num_arguments, arg_bits, type_arg_bits,
- false);
+ return NewNonCached(type_args_len, num_arguments, true);
}
RawArray* ArgumentsDescriptor::NewNonCached(intptr_t type_args_len,
intptr_t num_arguments,
- intptr_t pos_arg_bits,
- intptr_t type_arg_bits,
bool canonicalize) {
// Build the arguments descriptor array, which consists of the length of the
// type argument vector, total argument count; the positional argument count;
@@ -446,20 +409,14 @@
const Smi& arg_count = Smi::Handle(zone, Smi::New(num_arguments));
// Set type argument vector length.
- descriptor.SetAt(
- kTypeArgsLenIndex,
- Smi::Handle(zone, PackBitFieldsToSmi(
- TypeArgsLenField::encode(type_args_len) |
- TypeArgsChecksField::encode(type_arg_bits))));
+ descriptor.SetAt(kTypeArgsLenIndex,
+ Smi::Handle(zone, Smi::New(type_args_len)));
// Set total number of passed arguments.
descriptor.SetAt(kCountIndex, arg_count);
// Set number of positional arguments.
- descriptor.SetAt(kPositionalCountIndex,
- Smi::Handle(PackBitFieldsToSmi(
- PositionalCountField::encode(num_arguments) |
- PositionalArgumentsChecksField::encode(pos_arg_bits))));
+ descriptor.SetAt(kPositionalCountIndex, Smi::Handle(Smi::New(num_arguments)));
// Set terminating null.
descriptor.SetAt((descriptor_len - 1), Object::null_object());
@@ -475,8 +432,7 @@
void ArgumentsDescriptor::InitOnce() {
for (int i = 0; i < kCachedDescriptorCount; i++) {
- cached_args_descriptors_[i] =
- NewNonCached(/*type_args_len=*/0, i, 0, 0, false);
+ cached_args_descriptors_[i] = NewNonCached(/*type_args_len=*/0, i, false);
}
}
diff --git a/runtime/vm/dart_entry.h b/runtime/vm/dart_entry.h
index d28a5cd..b518523 100644
--- a/runtime/vm/dart_entry.h
+++ b/runtime/vm/dart_entry.h
@@ -31,20 +31,6 @@
// positional argument count; a sequence of (name, position) pairs, sorted
// by name, for each named optional argument; and a terminating null to
// simplify iterating in generated code.
-//
-// To efficiently implement strong-mode argument checks, the arguments
-// descriptor also holds a bitvector with up to <word size>/2 bits for arguments
-// of the invocation, including positional and named arguments, in order from
-// least to most significant position. The first bit, which corresponds to the
-// receiver in the arguments descriptor, is treated specially and controls how
-// the other bits are interpreted.
-//
-// When the first bit is false, the other bits are interpreted as indicating
-// whether their corresponding argument needs to checked (although checks are
-// always performed for parameters defined with the 'covariant' keyword). When
-// the first bit is true, the other bits are set to true if their corresponding
-// arguments need to be checked if their parameters are marked
-// 'isGenericCovariantImpl' in the callee.
class ArgumentsDescriptor : public ValueObject {
public:
explicit ArgumentsDescriptor(const Array& array);
@@ -74,28 +60,15 @@
// positional and the remaining ones are named optional arguments.
// The presence of a type argument vector as first argument (not counted in
// num_arguments) is indicated by a non-zero type_args_len.
- //
- // 'arg_bits' is a bitvector holding the strong-mode argument checking bits
- // for all arguments from least to most significant position. The bit for the
- // receiver is interpreted as the dispatch bit.
static RawArray* New(intptr_t type_args_len,
intptr_t num_arguments,
- const Array& optional_arguments_names,
- intptr_t arg_check_bits = 0,
- intptr_t type_arg_check_bits = 0);
+ const Array& optional_arguments_names);
// Allocate and return an arguments descriptor that has no optional
// arguments. All arguments are positional. The presence of a type argument
// vector as first argument (not counted in num_arguments) is indicated
// by a non-zero type_args_len.
- //
- // 'arg_bits' is a bitvector holding the strong-mode argument checking bits
- // for all arguments from least to most significant position. The bit for the
- // receiver is interpreted as the dispatch bit.
- static RawArray* New(intptr_t type_args_len,
- intptr_t num_arguments,
- intptr_t arg_check_bits = 0,
- intptr_t type_arg_check_bits = 0);
+ static RawArray* New(intptr_t type_args_len, intptr_t num_arguments);
// Initialize the preallocated fixed length arguments descriptors cache.
static void InitOnce();
@@ -109,46 +82,10 @@
kTypeArgsLenIndex,
kCountIndex,
- // To implement the argument checks associated with strong mode each call
- // has an "argument bit" associated with each argument. The argument bits of
- // positional arguments are packed into the positional count entry as
- // follows. `S` is the information in an `Smi` (`kSmiBits + 1` bits), which
- // is odd on all platforms.
- //
- // most significant least significant
- // ----------------------------------------------------
- // <ceil(S / 2) bits> <floor(S / 2)>
- // argument bits | number of positional arguments
- //
- // The positional argument bits are arranged so that bits for lower index
- // parameters are in less significant positions. All the bits for strong
- // mode are stored in more significant bits than the actual argument count
- // so that when strong mode is disabled, all the strong-mode associated bits
- // will happen to be 0 and the entry won't require any extra interpretation
- // in generated code.
- //
- // The bits for type arguments are packed in the same way into
- // 'kTypeArgsLenIndex'. The named argument bits are attached to the
- // corresponding entry in the array (see below).
- //
- // Ideally we would use a struct with bitfields, but the order of bitfields
- // is implementation-dependent and we need to manipulate them in generated
- // code.
kPositionalCountIndex,
kFirstNamedEntryIndex,
};
- public:
- // The Smi at kPositionalCountIndex holds these two bitfields.
- typedef BitField<intptr_t, intptr_t, 0, kSmiBits / 2> PositionalCountField;
- typedef BitField<intptr_t, intptr_t, kSmiBits / 2, kSmiBits / 2 + 1>
- PositionalArgumentsChecksField;
-
- // The Smi at kTypeArgsLenIndex holds these two bitfields.
- typedef BitField<intptr_t, intptr_t, 0, kSmiBits / 2> TypeArgsLenField;
- typedef BitField<intptr_t, intptr_t, kSmiBits / 2, kSmiBits / 2 + 1>
- TypeArgsChecksField;
-
private:
// Relative indexes into each named argument entry.
enum {
@@ -160,17 +97,7 @@
kNamedEntrySize,
};
- static RawSmi* PackBitFieldsToSmi(intptr_t value) {
- ASSERT(((value >> (kSmiBits + 1)) & 1) == 0);
- // Sign extend the value.
- return Smi::New((value << kSmiTagShift) >> kSmiTagShift);
- }
-
public:
- // The Smis at kPositionOffset hold these two bitfields.
- typedef BitField<intptr_t, intptr_t, 0, kSmiBits> NamedPositionField;
- typedef BitField<intptr_t, intptr_t, kSmiBits, 1> NamedCheckField;
-
static intptr_t LengthFor(intptr_t num_named_arguments) {
// Add 1 for the terminating null.
return kFirstNamedEntryIndex + (kNamedEntrySize * num_named_arguments) + 1;
@@ -178,8 +105,6 @@
static RawArray* NewNonCached(intptr_t type_args_len,
intptr_t num_arguments,
- intptr_t pos_arg_bits,
- intptr_t type_arg_bits,
bool canonicalize);
// Used by Simulator to parse argument descriptors.
diff --git a/runtime/vm/exceptions.cc b/runtime/vm/exceptions.cc
index 667e819..3f577f6 100644
--- a/runtime/vm/exceptions.cc
+++ b/runtime/vm/exceptions.cc
@@ -619,9 +619,10 @@
// object. The C++ code which invoked this dart sequence can check
// and do the appropriate thing (rethrow the exception to the
// dart invocation sequence above it, print diagnostics and terminate
- // the isolate etc.).
+ // the isolate etc.). This can happen in the compiler, which is not
+ // allowed to allocate in new space, so we pass the kOld argument.
const UnhandledException& unhandled_exception = UnhandledException::Handle(
- zone, UnhandledException::New(exception, stacktrace));
+ zone, UnhandledException::New(exception, stacktrace, Heap::kOld));
stacktrace = StackTrace::null();
JumpToExceptionHandler(thread, handler_pc, handler_sp, handler_fp,
unhandled_exception, stacktrace);
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/image_snapshot.cc b/runtime/vm/image_snapshot.cc
index 9900a7c..95a7da0 100644
--- a/runtime/vm/image_snapshot.cc
+++ b/runtime/vm/image_snapshot.cc
@@ -5,14 +5,28 @@
#include "vm/image_snapshot.h"
#include "platform/assert.h"
+#include "vm/compiler/backend/code_statistics.h"
#include "vm/dwarf.h"
#include "vm/heap.h"
+#include "vm/json_writer.h"
#include "vm/object.h"
#include "vm/stub_code.h"
#include "vm/timeline.h"
namespace dart {
+#if defined(DART_PRECOMPILER)
+DEFINE_FLAG(bool,
+ print_instruction_stats,
+ false,
+ "Print instruction statistics");
+
+DEFINE_FLAG(charp,
+ print_instructions_sizes_to,
+ NULL,
+ "Print sizes of all instruction objects to the given file");
+#endif
+
int32_t ImageWriter::GetTextOffsetFor(RawInstructions* instructions,
RawCode* code) {
intptr_t heap_size = instructions->Size();
@@ -30,6 +44,82 @@
return offset;
}
+#if defined(DART_PRECOMPILER)
+void ImageWriter::DumpInstructionStats() {
+ CombinedCodeStatistics instruction_stats;
+ for (intptr_t i = 0; i < instructions_.length(); i++) {
+ auto& data = instructions_[i];
+ CodeStatistics* stats = data.insns_->stats();
+ if (stats != nullptr) {
+ stats->AppendTo(&instruction_stats);
+ }
+ }
+ instruction_stats.DumpStatistics();
+}
+
+void ImageWriter::DumpInstructionsSizes() {
+ auto thread = Thread::Current();
+ auto zone = thread->zone();
+
+ auto& cls = Class::Handle(zone);
+ auto& lib = Library::Handle(zone);
+ auto& owner = Object::Handle(zone);
+ auto& url = String::Handle(zone);
+ auto& name = String::Handle(zone);
+
+ JSONWriter js;
+ js.OpenArray();
+ for (intptr_t i = 0; i < instructions_.length(); i++) {
+ auto& data = instructions_[i];
+ owner = data.code_->owner();
+ js.OpenObject();
+ if (owner.IsFunction()) {
+ cls = Function::Cast(owner).Owner();
+ name = cls.ScrubbedName();
+ lib = cls.library();
+ url = lib.url();
+ js.PrintPropertyStr("l", url);
+ js.PrintPropertyStr("c", name);
+ }
+ js.PrintProperty("n", data.code_->QualifiedName());
+ js.PrintProperty("s", data.insns_->Size());
+ js.CloseObject();
+ }
+ js.CloseArray();
+
+ auto file_open = Dart::file_open_callback();
+ auto file_write = Dart::file_write_callback();
+ auto file_close = Dart::file_close_callback();
+ if ((file_open == nullptr) || (file_write == nullptr) ||
+ (file_close == nullptr)) {
+ return;
+ }
+
+ auto file = file_open(FLAG_print_instructions_sizes_to, /*write=*/true);
+ if (file == nullptr) {
+ OS::PrintErr("Failed to open file %s\n", FLAG_print_instructions_sizes_to);
+ return;
+ }
+
+ char* output = nullptr;
+ intptr_t output_length = 0;
+ js.Steal(&output, &output_length);
+ file_write(output, output_length, file);
+ free(output);
+ file_close(file);
+}
+
+void ImageWriter::DumpStatistics() {
+ if (FLAG_print_instruction_stats) {
+ DumpInstructionStats();
+ }
+
+ if (FLAG_print_instructions_sizes_to != nullptr) {
+ DumpInstructionsSizes();
+ }
+}
+#endif
+
void ImageWriter::Write(WriteStream* clustered_stream, bool vm) {
Thread* thread = Thread::Current();
Zone* zone = thread->zone();
diff --git a/runtime/vm/image_snapshot.h b/runtime/vm/image_snapshot.h
index f43bc1a..ece57a3 100644
--- a/runtime/vm/image_snapshot.h
+++ b/runtime/vm/image_snapshot.h
@@ -85,10 +85,15 @@
intptr_t text_size() const { return next_text_offset_; }
intptr_t data_size() const { return next_data_offset_; }
+ void DumpStatistics();
+
protected:
void WriteROData(WriteStream* stream);
virtual void WriteText(WriteStream* clustered_stream, bool vm) = 0;
+ void DumpInstructionStats();
+ void DumpInstructionsSizes();
+
struct InstructionsData {
explicit InstructionsData(RawInstructions* insns,
RawCode* code,
diff --git a/runtime/vm/kernel_isolate.cc b/runtime/vm/kernel_isolate.cc
index a8a9a1f..4445773 100644
--- a/runtime/vm/kernel_isolate.cc
+++ b/runtime/vm/kernel_isolate.cc
@@ -48,10 +48,12 @@
// 1 - Update in-memory file system with in-memory sources (used by tests).
// 2 - Accept last compilation result.
// 3 - APP JIT snapshot training run for kernel_service.
+// 4 - Allows for `dart:_internal` to be imported (used by tests).
const int KernelIsolate::kCompileTag = 0;
const int KernelIsolate::kUpdateSourcesTag = 1;
const int KernelIsolate::kAcceptTag = 2;
const int KernelIsolate::kTrainTag = 3;
+const int KernelIsolate::kAllowDartInternalImportTag = 4;
Dart_IsolateCreateCallback KernelIsolate::create_callback_ = NULL;
Monitor* KernelIsolate::monitor_ = new Monitor();
@@ -609,6 +611,23 @@
NULL, 0, source_files_count,
source_files, true);
}
+
+Dart_KernelCompilationResult KernelIsolate::AllowDartInternalImport() {
+ // This must be the main script to be loaded. Wait for Kernel isolate
+ // to finish initialization.
+ Dart_Port kernel_port = WaitForKernelPort();
+ if (kernel_port == ILLEGAL_PORT) {
+ Dart_KernelCompilationResult result;
+ result.status = Dart_KernelCompilationStatus_Unknown;
+ result.error = strdup("Error while initializing Kernel isolate");
+ return result;
+ }
+
+ KernelCompilationRequest request;
+ return request.SendAndWaitForResponse(
+ kAllowDartInternalImportTag, kernel_port, NULL, NULL, 0, 0, NULL, true);
+}
+
#endif // DART_PRECOMPILED_RUNTIME
} // namespace dart
diff --git a/runtime/vm/kernel_isolate.h b/runtime/vm/kernel_isolate.h
index 001aa41..913b5c6 100644
--- a/runtime/vm/kernel_isolate.h
+++ b/runtime/vm/kernel_isolate.h
@@ -22,6 +22,7 @@
static const int kUpdateSourcesTag;
static const int kAcceptTag;
static const int kTrainTag;
+ static const int kAllowDartInternalImportTag;
static void Run();
@@ -44,6 +45,7 @@
static Dart_KernelCompilationResult UpdateInMemorySources(
int source_files_count,
Dart_SourceFile source_files[]);
+ static Dart_KernelCompilationResult AllowDartInternalImport();
protected:
static Monitor* monitor_;
diff --git a/runtime/vm/object.cc b/runtime/vm/object.cc
index 7c1f494..10a99dc 100644
--- a/runtime/vm/object.cc
+++ b/runtime/vm/object.cc
@@ -12486,6 +12486,7 @@
result ^= raw;
result.SetSize(size);
result.SetHasSingleEntryPoint(has_single_entry_point);
+ result.set_stats(nullptr);
}
return result.raw();
}
@@ -14596,7 +14597,8 @@
#if !defined(DART_PRECOMPILED_RUNTIME)
RawCode* Code::FinalizeCode(const char* name,
Assembler* assembler,
- bool optimized) {
+ bool optimized,
+ CodeStatistics* stats /* = nullptr */) {
Isolate* isolate = Isolate::Current();
if (!isolate->compilation_allowed()) {
FATAL1("Precompilation missed code %s\n", name);
@@ -14626,6 +14628,13 @@
assembler->FinalizeInstructions(region);
CPU::FlushICache(instrs.PayloadStart(), instrs.Size());
+#if defined(DART_PRECOMPILER)
+ if (stats != nullptr) {
+ stats->Finalize();
+ instrs.set_stats(stats);
+ }
+#endif
+
code.set_compile_timestamp(OS::GetCurrentMonotonicMicros());
#ifndef PRODUCT
CodeObservers::NotifyAll(name, instrs.PayloadStart(),
@@ -14681,16 +14690,17 @@
RawCode* Code::FinalizeCode(const Function& function,
Assembler* assembler,
- bool optimized) {
+ bool optimized /* = false */,
+ CodeStatistics* stats /* = nullptr */) {
// Calling ToLibNamePrefixedQualifiedCString is very expensive,
// try to avoid it.
#ifndef PRODUCT
if (CodeObservers::AreActive()) {
return FinalizeCode(function.ToLibNamePrefixedQualifiedCString(), assembler,
- optimized);
+ optimized, stats);
}
#endif // !PRODUCT
- return FinalizeCode("", assembler, optimized);
+ return FinalizeCode("", assembler, optimized, stats);
}
#endif // !defined(DART_PRECOMPILED_RUNTIME)
diff --git a/runtime/vm/object.h b/runtime/vm/object.h
index 68574b2..0323ff6 100644
--- a/runtime/vm/object.h
+++ b/runtime/vm/object.h
@@ -46,6 +46,7 @@
class DeoptInstr;
class FinalizablePersistentHandle;
class LocalScope;
+class CodeStatistics;
#define REUSABLE_FORWARD_DECLARATION(name) class Reusable##name##HandleScope;
REUSABLE_HANDLE_LIST(REUSABLE_FORWARD_DECLARATION)
@@ -4252,7 +4253,9 @@
static intptr_t HeaderSize() {
intptr_t alignment = OS::PreferredCodeAlignment();
- return Utils::RoundUp(sizeof(RawInstructions), alignment);
+ intptr_t aligned_size = Utils::RoundUp(sizeof(RawInstructions), alignment);
+ ASSERT(aligned_size == alignment);
+ return aligned_size;
}
static RawInstructions* FromPayloadStart(uword payload_start) {
@@ -4268,6 +4271,20 @@
return memcmp(raw_ptr(), other.raw_ptr(), InstanceSize(Size())) == 0;
}
+ CodeStatistics* stats() const {
+#if defined(DART_PRECOMPILER)
+ return raw_ptr()->stats_;
+#else
+ return nullptr;
+#endif
+ }
+
+ void set_stats(CodeStatistics* stats) const {
+#if defined(DART_PRECOMPILER)
+ StoreNonPointer(&raw_ptr()->stats_, stats);
+#endif
+ }
+
private:
void SetSize(intptr_t value) const {
ASSERT(value >= 0);
@@ -4896,10 +4913,12 @@
#if !defined(DART_PRECOMPILED_RUNTIME)
static RawCode* FinalizeCode(const Function& function,
Assembler* assembler,
- bool optimized = false);
+ bool optimized = false,
+ CodeStatistics* stats = nullptr);
static RawCode* FinalizeCode(const char* name,
Assembler* assembler,
- bool optimized);
+ bool optimized,
+ CodeStatistics* stats = nullptr);
#endif
static RawCode* LookupCode(uword pc);
static RawCode* LookupCodeInVmIsolate(uword pc);
@@ -7827,16 +7846,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..f7ffc17 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;
diff --git a/runtime/vm/os_fuchsia.cc b/runtime/vm/os_fuchsia.cc
index bd21b78..2424836 100644
--- a/runtime/vm/os_fuchsia.cc
+++ b/runtime/vm/os_fuchsia.cc
@@ -40,40 +40,29 @@
return static_cast<intptr_t>(getpid());
}
-static zx_status_t GetTimeServicePtr(
- time_zone::TimezoneSyncPtr* time_svc) {
- zx::channel service_root = app::subtle::CreateStaticServiceRootHandle();
- zx::channel time_svc_channel = time_svc->NewRequest().TakeChannel();
- return fdio_service_connect_at(service_root.get(),
- time_zone::Timezone::Name_,
- time_svc_channel.release());
-}
-
static zx_status_t GetLocalAndDstOffsetInSeconds(int64_t seconds_since_epoch,
int32_t* local_offset,
int32_t* dst_offset) {
time_zone::TimezoneSyncPtr time_svc;
- zx_status_t status = GetTimeServicePtr(&time_svc);
- if (status == ZX_OK) {
- time_svc->GetTimezoneOffsetMinutes(seconds_since_epoch * 1000, local_offset,
- dst_offset);
- *local_offset *= 60;
- *dst_offset *= 60;
- }
- return status;
+ component::ConnectToEnvironmentService(time_svc.NewRequest());
+ if (!time_svc->GetTimezoneOffsetMinutes(seconds_since_epoch * 1000,
+ local_offset, dst_offset))
+ return ZX_ERR_UNAVAILABLE;
+ *local_offset *= 60;
+ *dst_offset *= 60;
+ return ZX_OK;
}
const char* OS::GetTimeZoneName(int64_t seconds_since_epoch) {
- time_zone::TimezoneSyncPtr time_svc;
- if (GetTimeServicePtr(&time_svc) == ZX_OK) {
- fidl::StringPtr res;
- time_svc->GetTimezoneId(&res);
- char* tz_name = Thread::Current()->zone()->Alloc<char>(res->size() + 1);
- memmove(tz_name, res->data(), res->size());
- tz_name[res->size()] = '\0';
- return tz_name;
- }
- return "";
+ // TODO(abarth): Handle time zone changes.
+ static const auto* tz_name = new std::string([] {
+ time_zone::TimezoneSyncPtr time_svc;
+ component::ConnectToEnvironmentService(time_svc.NewRequest());
+ fidl::StringPtr result;
+ time_svc->GetTimezoneId(&result);
+ return *result;
+ }());
+ return tz_name->c_str();
}
int OS::GetTimeZoneOffsetInSeconds(int64_t seconds_since_epoch) {
diff --git a/runtime/vm/raw_object.h b/runtime/vm/raw_object.h
index a987790..c82c8cd 100644
--- a/runtime/vm/raw_object.h
+++ b/runtime/vm/raw_object.h
@@ -149,6 +149,7 @@
#define DEFINE_FORWARD_DECLARATION(clazz) class Raw##clazz;
CLASS_LIST(DEFINE_FORWARD_DECLARATION)
#undef DEFINE_FORWARD_DECLARATION
+class CodeStatistics;
enum ClassId {
// Illegal class id.
@@ -1325,6 +1326,16 @@
// Currently, only flag indicates 1 or 2 entry points.
uint32_t size_and_flags_;
+#if defined(DART_PRECOMPILER)
+ // There is a gap between size_and_flags_ and the entry point
+ // because we align entry point by 4 words on all platforms.
+ // This allows us to have a free field here without affecting
+ // the aligned size of the Instructions object header.
+ // This also means that entry point offset is the same
+ // whether this field is included or excluded.
+ CodeStatistics* stats_;
+#endif
+
// Variable length data follows here.
uint8_t* data() { OPEN_ARRAY_START(uint8_t, uint8_t); }
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/simulator_arm64.cc b/runtime/vm/simulator_arm64.cc
index 9318cfd..c115b7c 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 a4c6ea9..bd7be22 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,25 +650,12 @@
: "+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) || defined(HOST_ARCH_ARM64)
asm volatile(
- "adds %w1, %w1, %w2;\n"
+ "adds %1, %1, %2;\n"
"bvs 1f;\n"
- "sxtw %x1, %w1;\n"
"mov %0, #0;\n"
- "str %x1, [%3, #0]\n"
+ "str %1, [%3, #0]\n"
"1:"
: "+r"(res), "+r"(lhs)
: "r"(rhs), "r"(out)
@@ -679,11 +666,11 @@
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"
@@ -693,25 +680,12 @@
: "+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) || defined(HOST_ARCH_ARM64)
asm volatile(
- "subs %w1, %w1, %w2;\n"
+ "subs %1, %1, %2;\n"
"bvs 1f;\n"
- "sxtw %x1, %w1;\n"
"mov %0, #0;\n"
- "str %x1, [%3, #0]\n"
+ "str %1, [%3, #0]\n"
"1:"
: "+r"(res), "+r"(lhs)
: "r"(rhs), "r"(out)
@@ -722,11 +696,11 @@
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"
@@ -736,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"
@@ -762,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)
@@ -2009,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++;
@@ -2035,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++;
}
}
@@ -2051,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 c7241ba..cff0584 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 f56ed03..e23bb90 100644
--- a/runtime/vm/stub_code_arm64.cc
+++ b/runtime/vm/stub_code_arm64.cc
@@ -1333,18 +1333,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;
}
@@ -1386,8 +1382,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 a160513..5183d28 100644
--- a/runtime/vm/stub_code_x64.cc
+++ b/runtime/vm/stub_code_x64.cc
@@ -1270,15 +1270,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/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/unit_test.cc b/runtime/vm/unit_test.cc
index 84b4dbb..b107412 100644
--- a/runtime/vm/unit_test.cc
+++ b/runtime/vm/unit_test.cc
@@ -594,6 +594,11 @@
Dart_Handle TestCase::LoadCoreTestScript(const char* script,
Dart_NativeEntryResolver resolver) {
+ if (FLAG_use_dart_frontend) {
+ // Sets a flag in the CFE to not throw an error if `dart:_internal` is
+ // imported from a non-internal library.
+ KernelIsolate::AllowDartInternalImport();
+ }
return LoadTestScript(script, resolver, CORELIB_TEST_URI);
}
diff --git a/samples-dev/samples-dev.status b/samples-dev/samples-dev.status
index dc5b6d7..1753b57 100644
--- a/samples-dev/samples-dev.status
+++ b/samples-dev/samples-dev.status
@@ -2,29 +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.
-[ $compiler == dart2js && $runtime == drt ]
-swarm/test/swarm_test: Pass, Crash, Fail # Issue 10950
-
-[ $runtime == safari ]
-swarm/test/swarm_test: Pass, Fail # Issue 14523
-
-[ $runtime == vm ]
-swarm: Skip
-
-[ $compiler == dart2js && $runtime == chromeOnAndroid ]
-swarm/test/swarm_test: Fail # TODO(kasperl): Please triage.
-swarm/test/swarm_ui_lib/layout/layout_test: Fail # TODO(kasperl): Please triage.
-
-[ $browser ]
-# This may be related to issue 157
-swarm/test/swarm_ui_lib/touch/touch_test: Fail # Expectation: Solver. Expect.approxEquals(expected:9, actual:8.990625000000001, tolerance:0.0009) fails
-
- [ $compiler == dart2js && $runtime == ff ]
-swarm/test/swarm_test: Fail # Issue 5633
-
-[ $compiler == dart2js && $runtime == drt && $system == windows ]
-swarm/test/swarm_test: Fail # Issue 4517
-
[ $compiler == dart2analyzer ]
swarm/test/swarm_test: StaticWarning
swarm/test/swarm_ui_lib/layout/layout_test: StaticWarning
@@ -32,3 +9,25 @@
swarm/test/swarm_ui_lib/touch/touch_test: StaticWarning
swarm/test/swarm_ui_lib/util/util_test: StaticWarning
swarm/test/swarm_ui_lib/view/view_test: StaticWarning
+
+[ $runtime == safari ]
+swarm/test/swarm_test: Pass, Fail # Issue 14523
+
+[ $runtime == vm ]
+swarm: Skip
+
+[ $browser ]
+swarm/test/swarm_ui_lib/touch/touch_test: Fail # This may be related to issue 157, Expectation: Solver. Expect.approxEquals(expected:9, actual:8.990625000000001, tolerance:0.0009) fails
+
+[ $compiler == dart2js && $runtime == chromeOnAndroid ]
+swarm/test/swarm_test: Fail # TODO(kasperl): Please triage.
+swarm/test/swarm_ui_lib/layout/layout_test: Fail # TODO(kasperl): Please triage.
+
+[ $compiler == dart2js && $runtime == drt ]
+swarm/test/swarm_test: Pass, Crash, Fail # Issue 10950
+
+[ $compiler == dart2js && $runtime == drt && $system == windows ]
+swarm/test/swarm_test: Fail # Issue 4517
+
+[ $compiler == dart2js && $runtime == ff ]
+swarm/test/swarm_test: Fail # Issue 5633
diff --git a/samples/samples.status b/samples/samples.status
index 2f353c2..c45d91c 100644
--- a/samples/samples.status
+++ b/samples/samples.status
@@ -33,4 +33,3 @@
build_dart/*: Skip
build_dart_simple/*: Skip
sample_extension/*: Skip
-
diff --git a/sdk/lib/_internal/js_runtime/lib/core_patch.dart b/sdk/lib/_internal/js_runtime/lib/core_patch.dart
index d0f53c3..1e306bc 100644
--- a/sdk/lib/_internal/js_runtime/lib/core_patch.dart
+++ b/sdk/lib/_internal/js_runtime/lib/core_patch.dart
@@ -166,20 +166,34 @@
}
}
+Null _kNull(_) => null;
+
@patch
class int {
@patch
- static int parse(String source, {int radix, int onError(String source)}) {
+ static int parse(String source,
+ {int radix, @deprecated int onError(String source)}) {
return Primitives.parseInt(source, radix, onError);
}
+
+ @patch
+ static int tryParse(String source, {int radix}) {
+ return Primitives.parseInt(source, radix, _kNull);
+ }
}
@patch
class double {
@patch
- static double parse(String source, [double onError(String source)]) {
+ static double parse(String source,
+ [@deprecated double onError(String source)]) {
return Primitives.parseDouble(source, onError);
}
+
+ @patch
+ static double tryParse(String source) {
+ return Primitives.parseDouble(source, _kNull);
+ }
}
@patch
@@ -196,6 +210,10 @@
_BigIntImpl.parse(source, radix: radix);
@patch
+ static BigInt tryParse(String source, {int radix}) =>
+ _BigIntImpl._tryParse(source, radix: radix);
+
+ @patch
factory BigInt.from(num value) = _BigIntImpl.from;
}
diff --git a/sdk/lib/_internal/js_runtime/lib/js_array.dart b/sdk/lib/_internal/js_runtime/lib/js_array.dart
index 563297a..79d4c94 100644
--- a/sdk/lib/_internal/js_runtime/lib/js_array.dart
+++ b/sdk/lib/_internal/js_runtime/lib/js_array.dart
@@ -137,7 +137,7 @@
if (index < 0 || index >= length) {
throw new RangeError.value(index);
}
- return JS('var', r'#.splice(#, 1)[0]', this, index);
+ return JS('', r'#.splice(#, 1)[0]', this, index);
}
void insert(int index, E value) {
@@ -173,14 +173,14 @@
E removeLast() {
checkGrowable('removeLast');
if (length == 0) throw diagnoseIndexError(this, -1);
- return JS('var', r'#.pop()', this);
+ return JS('', r'#.pop()', this);
}
bool remove(Object element) {
checkGrowable('remove');
for (int i = 0; i < this.length; i++) {
if (this[i] == element) {
- JS('var', r'#.splice(#, 1)', this, i);
+ JS('', r'#.splice(#, 1)', this, i);
return true;
}
}
@@ -213,7 +213,7 @@
for (int i = 0; i < end; i++) {
// TODO(22407): Improve bounds check elimination to allow this JS code to
// be replaced by indexing.
- var element = JS('', '#[#]', this, i);
+ var element = JS<E>('', '#[#]', this, i);
// !test() ensures bool conversion in checked mode.
if (!test(element) == removeMatching) {
retained.add(element);
@@ -255,7 +255,7 @@
for (int i = 0; i < end; i++) {
// TODO(22407): Improve bounds check elimination to allow this JS code to
// be replaced by indexing.
- var element = JS('', '#[#]', this, i);
+ var element = JS<E>('', '#[#]', this, i);
f(element);
if (this.length != end) throw new ConcurrentModificationError(this);
}
@@ -296,7 +296,7 @@
for (int i = 1; i < length; i++) {
// TODO(22407): Improve bounds check elimination to allow this JS code to
// be replaced by indexing.
- var element = JS('', '#[#]', this, i);
+ var element = JS<E>('', '#[#]', this, i);
value = combine(value, element);
if (length != this.length) throw new ConcurrentModificationError(this);
}
@@ -309,7 +309,7 @@
for (int i = 0; i < length; i++) {
// TODO(22407): Improve bounds check elimination to allow this JS code to
// be replaced by indexing.
- var element = JS('', '#[#]', this, i);
+ var element = JS<E>('', '#[#]', this, i);
value = combine(value, element);
if (this.length != length) throw new ConcurrentModificationError(this);
}
@@ -321,7 +321,7 @@
for (int i = 0; i < end; ++i) {
// TODO(22407): Improve bounds check elimination to allow this JS code to
// be replaced by indexing.
- var element = JS('', '#[#]', this, i);
+ var element = JS<E>('', '#[#]', this, i);
if (test(element)) return element;
if (this.length != end) throw new ConcurrentModificationError(this);
}
@@ -334,7 +334,7 @@
for (int i = length - 1; i >= 0; i--) {
// TODO(22407): Improve bounds check elimination to allow this JS code to
// be replaced by indexing.
- var element = JS('', '#[#]', this, i);
+ var element = JS<E>('', '#[#]', this, i);
if (test(element)) return element;
if (length != this.length) {
throw new ConcurrentModificationError(this);
@@ -351,7 +351,7 @@
for (int i = 0; i < length; i++) {
// TODO(22407): Improve bounds check elimination to allow this JS code to
// be replaced by indexing.
- var element = JS('', '#[#]', this, i);
+ var element = JS<E>('', '#[#]', this, i);
if (test(element)) {
if (matchFound) {
throw IterableElementError.tooMany();
@@ -500,7 +500,7 @@
for (int i = 0; i < end; i++) {
// TODO(22407): Improve bounds check elimination to allow this JS code to
// be replaced by indexing.
- var element = JS('', '#[#]', this, i);
+ var element = JS<E>('', '#[#]', this, i);
if (test(element)) return true;
if (this.length != end) throw new ConcurrentModificationError(this);
}
@@ -512,7 +512,7 @@
for (int i = 0; i < end; i++) {
// TODO(22407): Improve bounds check elimination to allow this JS code to
// be replaced by indexing.
- var element = JS('', '#[#]', this, i);
+ var element = JS<E>('', '#[#]', this, i);
if (!test(element)) return false;
if (this.length != end) throw new ConcurrentModificationError(this);
}
@@ -621,7 +621,7 @@
E operator [](int index) {
if (index is! int) throw diagnoseIndexError(this, index);
if (index >= length || index < 0) throw diagnoseIndexError(this, index);
- return JS('var', '#[#]', this, index);
+ return JS('', '#[#]', this, index);
}
void operator []=(int index, E value) {
diff --git a/sdk/lib/_internal/js_runtime/lib/js_helper.dart b/sdk/lib/_internal/js_runtime/lib/js_helper.dart
index 80a3910..d1eae5a 100644
--- a/sdk/lib/_internal/js_runtime/lib/js_helper.dart
+++ b/sdk/lib/_internal/js_runtime/lib/js_helper.dart
@@ -262,16 +262,19 @@
return res;
}
+// Called from generated code.
createInvocationMirror(
- String name, internalName, kind, arguments, argumentNames) {
+ String name, internalName, kind, arguments, argumentNames, types) {
+ // TODO(sra): [types] (the number of type arguments) could be omitted in the
+ // generated stub code to save an argument. Then we would use `types ?? 0`.
return new JSInvocationMirror(
- name, internalName, kind, arguments, argumentNames);
+ name, internalName, kind, arguments, argumentNames, types);
}
createUnmangledInvocationMirror(
Symbol symbol, internalName, kind, arguments, argumentNames) {
return new JSInvocationMirror(
- symbol, internalName, kind, arguments, argumentNames);
+ symbol, internalName, kind, arguments, argumentNames, 0);
}
void throwInvalidReflectionError(String memberName) {
@@ -333,11 +336,12 @@
final List<Type> _typeArguments;
final List _arguments;
final List _namedArgumentNames;
+ final int _typeArgumentCount;
/** Map from argument name to index in _arguments. */
Map<String, dynamic> _namedIndices = null;
JSInvocationMirror(this._memberName, this._internalName, this._kind,
- this._arguments, this._namedArgumentNames);
+ this._arguments, this._namedArgumentNames, this._typeArgumentCount);
Symbol get memberName {
if (_memberName is Symbol) return _memberName;
@@ -361,13 +365,20 @@
bool get isAccessor => _kind != METHOD;
List<Type> get typeArguments {
- // UNIMPLEMENTED
- return const <Type>[];
+ if (_typeArgumentCount == 0) return const <Type>[];
+ int start = _arguments.length - _typeArgumentCount;
+ var list = <Type>[];
+ for (int index = 0; index < _typeArgumentCount; index++) {
+ list.add(
+ createRuntimeType(runtimeTypeToString(_arguments[start + index])));
+ }
+ return list;
}
List get positionalArguments {
if (isGetter) return const [];
- var argumentCount = _arguments.length - _namedArgumentNames.length;
+ var argumentCount =
+ _arguments.length - _namedArgumentNames.length - _typeArgumentCount;
if (argumentCount == 0) return const [];
var list = [];
for (var index = 0; index < argumentCount; index++) {
@@ -379,7 +390,8 @@
Map<Symbol, dynamic> get namedArguments {
if (isAccessor) return const <Symbol, dynamic>{};
int namedArgumentCount = _namedArgumentNames.length;
- int namedArgumentsStartIndex = _arguments.length - namedArgumentCount;
+ int namedArgumentsStartIndex =
+ _arguments.length - namedArgumentCount - _typeArgumentCount;
if (namedArgumentCount == 0) return const <Symbol, dynamic>{};
var map = new Map<Symbol, dynamic>();
for (int i = 0; i < namedArgumentCount; i++) {
diff --git a/sdk/lib/_internal/js_runtime/lib/js_rti.dart b/sdk/lib/_internal/js_runtime/lib/js_rti.dart
index ae3fac4..5a18016 100644
--- a/sdk/lib/_internal/js_runtime/lib/js_rti.dart
+++ b/sdk/lib/_internal/js_runtime/lib/js_rti.dart
@@ -114,13 +114,25 @@
return JS('var', r'#[#]', target, rtiName);
}
-/**
- * Returns the type arguments of [target] as an instance of [substitutionName].
- */
-getRuntimeTypeArguments(target, substitutionName) {
- var substitution = getField(
- target, '${JS_GET_NAME(JsGetName.OPERATOR_AS_PREFIX)}$substitutionName');
- return substitute(substitution, getRuntimeTypeInfo(target));
+/// Returns the type arguments of [object] as an instance of [substitutionName].
+getRuntimeTypeArguments(interceptor, object, substitutionName) {
+ var substitution = getField(interceptor,
+ '${JS_GET_NAME(JsGetName.OPERATOR_AS_PREFIX)}$substitutionName');
+ return substitute(substitution, getRuntimeTypeInfo(object));
+}
+
+/// Returns the [index]th type argument of [target] as an instance of
+/// [substitutionName].
+///
+/// Called from generated code.
+@NoThrows()
+@NoSideEffects()
+@NoInline()
+getRuntimeTypeArgumentIntercepted(
+ interceptor, Object target, String substitutionName, int index) {
+ var arguments =
+ getRuntimeTypeArguments(interceptor, target, substitutionName);
+ return arguments == null ? null : getIndex(arguments, index);
}
/// Returns the [index]th type argument of [target] as an instance of
@@ -131,7 +143,7 @@
@NoSideEffects()
@NoInline()
getRuntimeTypeArgument(Object target, String substitutionName, int index) {
- var arguments = getRuntimeTypeArguments(target, substitutionName);
+ var arguments = getRuntimeTypeArguments(target, target, substitutionName);
return arguments == null ? null : getIndex(arguments, index);
}
@@ -705,7 +717,9 @@
* instance of [contextName] to the signature function [signature].
*/
computeSignature(var signature, var context, var contextName) {
- var typeArguments = getRuntimeTypeArguments(context, contextName);
+ var interceptor = getInterceptor(context);
+ var typeArguments =
+ getRuntimeTypeArguments(interceptor, context, contextName);
return invokeOn(signature, context, typeArguments);
}
diff --git a/sdk/lib/core/bigint.dart b/sdk/lib/core/bigint.dart
index 00bff76..b495a9e 100644
--- a/sdk/lib/core/bigint.dart
+++ b/sdk/lib/core/bigint.dart
@@ -37,6 +37,15 @@
*/
external static BigInt parse(String source, {int radix});
+ /**
+ * Parses [source] as a, possibly signed, integer literal and returns its
+ * value.
+ *
+ * As [parse] except that this method returns `null` if the input is not
+ * valid
+ */
+ external static BigInt tryParse(String source, {int radix});
+
/// Allocates a big integer from the provided [value] number.
external factory BigInt.from(num value);
diff --git a/sdk/lib/core/date_time.dart b/sdk/lib/core/date_time.dart
index ccc850b..793b7e3 100644
--- a/sdk/lib/core/date_time.dart
+++ b/sdk/lib/core/date_time.dart
@@ -317,28 +317,7 @@
// TODO(lrn): restrict incorrect values like 2003-02-29T50:70:80.
// Or not, that may be a breaking change.
static DateTime parse(String formattedString) {
- /*
- * date ::= yeardate time_opt timezone_opt
- * yeardate ::= year colon_opt month colon_opt day
- * year ::= sign_opt digit{4,6}
- * colon_opt :: <empty> | ':'
- * sign ::= '+' | '-'
- * sign_opt ::= <empty> | sign
- * month ::= digit{2}
- * day ::= digit{2}
- * time_opt ::= <empty> | (' ' | 'T') hour minutes_opt
- * minutes_opt ::= <empty> | colon_opt digit{2} seconds_opt
- * seconds_opt ::= <empty> | colon_opt digit{2} millis_opt
- * micros_opt ::= <empty> | '.' digit{1,6}
- * timezone_opt ::= <empty> | space_opt timezone
- * space_opt :: ' ' | <empty>
- * timezone ::= 'z' | 'Z' | sign digit{2} timezonemins_opt
- * timezonemins_opt ::= <empty> | colon_opt digit{2}
- */
- final RegExp re = new RegExp(r'^([+-]?\d{4,6})-?(\d\d)-?(\d\d)' // Day part.
- r'(?:[ T](\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d{1,6}))?)?)?' // Time part.
- r'( ?[zZ]| ?([-+])(\d\d)(?::?(\d\d))?)?)?$'); // Timezone part.
-
+ var re = _parseFormat;
Match match = re.firstMatch(formattedString);
if (match != null) {
int parseIntOrZero(String matched) {
@@ -400,6 +379,15 @@
}
}
+ static DateTime tryParse(String formattedString) {
+ // TODO: Optimize to avoid throwing.
+ try {
+ return parse(formattedString);
+ } on FormatException {
+ return null;
+ }
+ }
+
static const int _maxMillisecondsSinceEpoch = 8640000000000000;
/**
@@ -904,4 +892,27 @@
* ```
*/
external int get weekday;
+
+ /*
+ * date ::= yeardate time_opt timezone_opt
+ * yeardate ::= year colon_opt month colon_opt day
+ * year ::= sign_opt digit{4,6}
+ * colon_opt :: <empty> | ':'
+ * sign ::= '+' | '-'
+ * sign_opt ::= <empty> | sign
+ * month ::= digit{2}
+ * day ::= digit{2}
+ * time_opt ::= <empty> | (' ' | 'T') hour minutes_opt
+ * minutes_opt ::= <empty> | colon_opt digit{2} seconds_opt
+ * seconds_opt ::= <empty> | colon_opt digit{2} millis_opt
+ * micros_opt ::= <empty> | '.' digit{1,6}
+ * timezone_opt ::= <empty> | space_opt timezone
+ * space_opt :: ' ' | <empty>
+ * timezone ::= 'z' | 'Z' | sign digit{2} timezonemins_opt
+ * timezonemins_opt ::= <empty> | colon_opt digit{2}
+ */
+ static final RegExp _parseFormat = new RegExp(
+ r'^([+-]?\d{4,6})-?(\d\d)-?(\d\d)' // Day part.
+ r'(?:[ T](\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d{1,6}))?)?)?' // Time part.
+ r'( ?[zZ]| ?([-+])(\d\d)(?::?(\d\d))?)?)?$'); // Timezone part.
}
diff --git a/sdk/lib/core/double.dart b/sdk/lib/core/double.dart
index e10a99b..89dd83b 100644
--- a/sdk/lib/core/double.dart
+++ b/sdk/lib/core/double.dart
@@ -210,6 +210,19 @@
* "1234E+7"
* "+.12e-9"
* "-NaN"
+ *
+ * The [onError] parameter is deprecated and will be removed.
+ * Instead of `double.parse(string, (string) { ... })`,
+ * you should use `double.tryParse(string) ?? (...)`.
*/
- external static double parse(String source, [double onError(String source)]);
+ external static double parse(String source,
+ [@deprecated double onError(String source)]);
+
+ /**
+ * Parse [source] as an double literal and return its value.
+ *
+ * Like [parse] except that this function returns `null` for invalid inputs
+ * instead of throwing.
+ */
+ external static double tryParse(String source);
}
diff --git a/sdk/lib/core/int.dart b/sdk/lib/core/int.dart
index c28679e..02bca23 100644
--- a/sdk/lib/core/int.dart
+++ b/sdk/lib/core/int.dart
@@ -319,7 +319,19 @@
*
* The [onError] function is only invoked if [source] is a [String]. It is
* not invoked if the [source] is, for example, `null`.
+ *
+ * The [onError] parameter is deprecated and will be removed.
+ * Instead of `int.parse(string, onError: (string) { ... })`,
+ * you should use `int.tryParse(string) ?? (...)`.
*/
external static int parse(String source,
- {int radix, int onError(String source)});
+ {int radix, @deprecated int onError(String source)});
+
+ /**
+ * Parse [source] as a, possibly signed, integer literal and return its value.
+ *
+ * Like [parse] except that this function returns `null` for invalid inputs
+ * instead of throwing.
+ */
+ external static int tryParse(String source, {int radix});
}
diff --git a/sdk/lib/core/num.dart b/sdk/lib/core/num.dart
index b282bf25..86247d3 100644
--- a/sdk/lib/core/num.dart
+++ b/sdk/lib/core/num.dart
@@ -462,18 +462,30 @@
* For any number `n`, this function satisfies
* `identical(n, num.parse(n.toString()))` (except when `n` is a NaN `double`
* with a payload).
+ *
+ * The [onError] parameter is deprecated and will be removed.
+ * Instead of `num.parse(string, (string) { ... })`,
+ * you should use `num.tryParse(string) ?? (...)`.
*/
- static num parse(String input, [num onError(String input)]) {
- String source = input.trim();
- // TODO(lrn): Optimize to detect format and result type in one check.
- num result = int.parse(source, onError: _returnIntNull);
- if (result != null) return result;
- result = double.parse(source, _returnDoubleNull);
+ static num parse(String input, [@deprecated num onError(String input)]) {
+ num result = tryParse(input);
if (result != null) return result;
if (onError == null) throw new FormatException(input);
return onError(input);
}
+ /**
+ * Parses a string containing a number literal into a number.
+ *
+ * Like [parse] except that this function returns `null` for invalid inputs
+ * instead of throwing.
+ */
+ static num tryParse(String input) {
+ String source = input.trim();
+ // TODO(lrn): Optimize to detect format and result type in one check.
+ return int.tryParse(source) ?? double.tryParse(source);
+ }
+
/** Helper functions for [parse]. */
static int _returnIntNull(String _) => null;
static double _returnDoubleNull(String _) => null;
diff --git a/sdk/lib/core/string.dart b/sdk/lib/core/string.dart
index f81fdf6..5c19917 100644
--- a/sdk/lib/core/string.dart
+++ b/sdk/lib/core/string.dart
@@ -309,20 +309,20 @@
*
* If the string contains leading or trailing whitespace, a new string with no
* leading and no trailing whitespace is returned:
- *
- * '\tDart is fun\n'.trim(); // 'Dart is fun'
- *
+ * ```dart
+ * '\tDart is fun\n'.trim(); // 'Dart is fun'
+ * ```
* Otherwise, the original string itself is returned:
- *
- * var str1 = 'Dart';
- * var str2 = str1.trim();
- * identical(str1, str2); // true
- *
+ * ```dart
+ * var str1 = 'Dart';
+ * var str2 = str1.trim();
+ * identical(str1, str2); // true
+ * ```
* Whitespace is defined by the Unicode White_Space property (as defined in
* version 6.2 or later) and the BOM character, 0xFEFF.
*
- * Here is the list of trimmed characters (following version 6.3):
- *
+ * Here is the list of trimmed characters according to Unicode version 6.3:
+ * ```
* 0009..000D ; White_Space # Cc <control-0009>..<control-000D>
* 0020 ; White_Space # Zs SPACE
* 0085 ; White_Space # Cc <control-0085>
@@ -336,6 +336,10 @@
* 3000 ; White_Space # Zs IDEOGRAPHIC SPACE
*
* FEFF ; BOM ZERO WIDTH NO_BREAK SPACE
+ * ```
+ * Some later versions of Unicode do not include U+0085 as a whitespace
+ * character. Whether it is trimmed depends on the Unicode version
+ * used by the system.
*/
String trim();
diff --git a/sdk/lib/core/uri.dart b/sdk/lib/core/uri.dart
index dce9ac3..895c0c0 100644
--- a/sdk/lib/core/uri.dart
+++ b/sdk/lib/core/uri.dart
@@ -1014,6 +1014,23 @@
}
/**
+ * Creates a new `Uri` object by parsing a URI string.
+ *
+ * If [start] and [end] are provided, only the substring from `start`
+ * to `end` is parsed as a URI.
+ *
+ * Returns `null` if the string is not valid as a URI or URI reference.
+ */
+ static Uri tryParse(String uri, [int start = 0, int end]) {
+ // TODO: Optimize to avoid throwing-and-recatching.
+ try {
+ return parse(uri, start, end);
+ } on FormatException {
+ return null;
+ }
+ }
+
+ /**
* Encode the string [component] using percent-encoding to make it
* safe for literal use as a URI component.
*
diff --git a/sdk/lib/html/dart2js/html_dart2js.dart b/sdk/lib/html/dart2js/html_dart2js.dart
index 19dc744..acf0390 100644
--- a/sdk/lib/html/dart2js/html_dart2js.dart
+++ b/sdk/lib/html/dart2js/html_dart2js.dart
@@ -44997,7 +44997,7 @@
@DocsEditable()
@DomName('DOMRect')
@Experimental() // untriaged
-@Native("DOMRect")
+@Native("ClientRect,DOMRect")
class _DomRect extends DomRectReadOnly implements Rectangle {
// NOTE! All code below should be common with RectangleBase.
String toString() {
@@ -45145,28 +45145,6 @@
set y(num value) {
JS("void", "#.y = #", this, value);
}
-
- @DomName('DOMRect.fromRect')
- @DocsEditable()
- @Experimental() // untriaged
- static Rectangle fromRect([Map other]) {
- if (other != null) {
- var other_1 = convertDartToNative_Dictionary(other);
- return _fromRect_1(other_1);
- }
- return _fromRect_2();
- }
-
- @JSName('fromRect')
- @DomName('DOMRect.fromRect')
- @DocsEditable()
- @Experimental() // untriaged
- static Rectangle _fromRect_1(other) native;
- @JSName('fromRect')
- @DomName('DOMRect.fromRect')
- @DocsEditable()
- @Experimental() // untriaged
- static Rectangle _fromRect_2() native;
}
/**
diff --git a/sdk/lib/internal/cast.dart b/sdk/lib/internal/cast.dart
index c91dff7..9765253 100644
--- a/sdk/lib/internal/cast.dart
+++ b/sdk/lib/internal/cast.dart
@@ -115,7 +115,8 @@
}
void sort([int compare(T v1, T v2)]) {
- _source.sort((S v1, S v2) => compare(v1 as T, v2 as T));
+ _source.sort(
+ compare == null ? null : (S v1, S v2) => compare(v1 as T, v2 as T));
}
void shuffle([Random random]) {
diff --git a/tests/co19/co19-co19.status b/tests/co19/co19-co19.status
index a598e54..40e41df 100644
--- a/tests/co19/co19-co19.status
+++ b/tests/co19/co19-co19.status
@@ -123,4 +123,3 @@
[ $runtime != none && !$strong ]
LibTest/typed_data/Float32x4List/first_A01_t02: RuntimeError # co19 issue 130
LibTest/typed_data/Float32x4List/last_A01_t02: RuntimeError # co19 issue 130
-
diff --git a/tests/co19/co19-dart2js.status b/tests/co19/co19-dart2js.status
index 08eb54c..012e9ed 100644
--- a/tests/co19/co19-dart2js.status
+++ b/tests/co19/co19-dart2js.status
@@ -4940,7 +4940,6 @@
LayoutTests/fast/table/td-bordercolor-attribute_t01: RuntimeError # Please triage this failure
LayoutTests/fast/text-autosizing/vertical-writing-mode_t01: RuntimeError # Please triage this failure
LayoutTests/fast/text/container-align-with-inlines_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/text/decomposed-after-stacked-diacritics_t01: RuntimeError # Issue 32578
LayoutTests/fast/text/find-backwards_t01: RuntimeError # Please triage this failure
LayoutTests/fast/text/find-case-folding_t01: RuntimeError # Please triage this failure
LayoutTests/fast/text/find-hidden-text_t01: RuntimeError # Please triage this failure
@@ -4953,16 +4952,11 @@
LayoutTests/fast/text/font-ligatures-linebreak-word_t01: Pass, RuntimeError # Please triage this failure
LayoutTests/fast/text/font-ligatures-linebreak_t01: Pass, RuntimeError # Please triage this failure
LayoutTests/fast/text/international/cjk-segmentation_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/text/international/complex-text-rectangle_t01: RuntimeError # Issue 32578
LayoutTests/fast/text/international/iso-8859-8_t01: RuntimeError # Please triage this failure
LayoutTests/fast/text/international/listbox-width-rtl_t01: RuntimeError # Please triage this failure
LayoutTests/fast/text/international/rtl-text-wrapping_t01: RuntimeError # Please triage this failure
LayoutTests/fast/text/international/thai-offsetForPosition-inside-character_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/text/justification-padding-mid-word_t01: RuntimeError # Issue 32578
-LayoutTests/fast/text/line-break-after-inline-latin1_t01: RuntimeError # Issue 32578
LayoutTests/fast/text/line-break-after-question-mark_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/text/line-breaks-after-ideographic-comma-or-full-stop_t02: RuntimeError # Issue 32578
-LayoutTests/fast/text/multiglyph-characters_t01: RuntimeError # Issue 32578
LayoutTests/fast/text/offsetForPosition-cluster-at-zero_t01: RuntimeError # Please triage this failure
LayoutTests/fast/text/pre-wrap-trailing-tab_t01: RuntimeError # Please triage this failure
LayoutTests/fast/text/remove-zero-length-run_t01: RuntimeError # Please triage this failure
@@ -5129,8 +5123,6 @@
LibTest/html/Element/getAttributeNS_A01_t01: RuntimeError # Please triage this failure
LibTest/html/Element/getAttributeNS_A02_t01: RuntimeError # Please triage this failure
LibTest/html/Element/getAttribute_A01_t01: Skip # Times out. Please triage this failure
-LibTest/html/Element/getBoundingClientRect_A01_t02: RuntimeError # Issue 32578
-LibTest/html/Element/getClientRects_A01_t02: RuntimeError # Issue 32579
LibTest/html/Element/getNamespacedAttributes_A01_t01: RuntimeError # Please triage this failure
LibTest/html/Element/isTagSupported_A01_t01: RuntimeError # Please triage this failure
LibTest/html/Element/isTagSupported_A01_t02: RuntimeError # Please triage this failure
@@ -5179,7 +5171,6 @@
LibTest/html/IFrameElement/createFragment_A01_t03: RuntimeError # Please triage this failure
LibTest/html/IFrameElement/createShadowRoot_A01_t01: RuntimeError # Please triage this failure
LibTest/html/IFrameElement/focus_A01_t01: Pass, RuntimeError # Please triage this failure
-LibTest/html/IFrameElement/getClientRects_A01_t02: RuntimeError # Issue 32578
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/leftView_A01_t01: RuntimeError # Please triage this failure
@@ -5785,7 +5776,6 @@
LayoutTests/fast/css/css3-nth-tokens-style_t01: RuntimeError # Please triage this failure
LayoutTests/fast/css/cssText-shorthand_t01: RuntimeError # Please triage this failure
LayoutTests/fast/css/csstext-of-content-string_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/css/deprecated-flex-box-zero-width-intrinsic-max-width_t01: RuntimeError # Issue 32568
LayoutTests/fast/css/deprecated-flexbox-auto-min-size_t01: Pass, RuntimeError # Please triage this failure
LayoutTests/fast/css/draggable-region-parser_t01: RuntimeError # Please triage this failure
LayoutTests/fast/css/dynamic-class-backdrop-pseudo_t01: RuntimeError # Please triage this failure
@@ -5940,7 +5930,6 @@
LayoutTests/fast/dom/Node/initial-values_t01: RuntimeError # Please triage this failure
LayoutTests/fast/dom/NodeIterator/NodeIterator-basic_t01: RuntimeError # Please triage this failure
LayoutTests/fast/dom/Range/bug-19527_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/dom/Range/getClientRects-character_t01: RuntimeError # Issue 32573
LayoutTests/fast/dom/Range/insertNode-empty-fragment-crash_t01: RuntimeError # Please triage this failure
LayoutTests/fast/dom/Range/mutation_t01: RuntimeError # Please triage this failure
LayoutTests/fast/dom/Range/range-comparePoint_t01: RuntimeError # Please triage this failure
@@ -6353,7 +6342,6 @@
LayoutTests/fast/table/table-rowspan-height-distribution-in-rows_t02: RuntimeError # Please triage this failure
LayoutTests/fast/table/table-with-content-width-exceeding-max-width_t01: RuntimeError # Please triage this failure
LayoutTests/fast/text-autosizing/vertical-writing-mode_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/text/decomposed-after-stacked-diacritics_t01: RuntimeError # See issue 32574
LayoutTests/fast/text/find-case-folding_t01: RuntimeError # Please triage this failure
LayoutTests/fast/text/find-russian_t01: RuntimeError # Please triage this failure
LayoutTests/fast/text/find-soft-hyphen_t01: RuntimeError # Please triage this failure
@@ -6363,16 +6351,11 @@
LayoutTests/fast/text/font-ligatures-linebreak_t01: Pass, RuntimeError # Please triage this failure
LayoutTests/fast/text/glyph-reordering_t01: Pass, RuntimeError # Fails on 7.1. Please triage this failure
LayoutTests/fast/text/international/cjk-segmentation_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/text/international/complex-text-rectangle_t01: RuntimeError # See issue 32575
LayoutTests/fast/text/international/iso-8859-8_t01: RuntimeError # Please triage this failure
LayoutTests/fast/text/international/listbox-width-rtl_t01: RuntimeError # Please triage this failure
LayoutTests/fast/text/international/rtl-text-wrapping_t01: RuntimeError # Please triage this failure
LayoutTests/fast/text/international/thai-offsetForPosition-inside-character_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/text/justification-padding-mid-word_t01: RuntimeError # Issue 32577
-LayoutTests/fast/text/line-break-after-inline-latin1_t01: RuntimeError # Issue 32569
LayoutTests/fast/text/line-break-after-question-mark_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/text/line-breaks-after-ideographic-comma-or-full-stop_t02: RuntimeError # Issue 32570
-LayoutTests/fast/text/multiglyph-characters_t01: RuntimeError # Issue 32577
LayoutTests/fast/text/offsetForPosition-cluster-at-zero_t01: RuntimeError # Please triage this failure
LayoutTests/fast/text/remove-zero-length-run_t01: RuntimeError # Please triage this failure
LayoutTests/fast/text/sub-pixel/text-scaling-ltr_t01: RuntimeError # Please triage this failure
@@ -6433,6 +6416,7 @@
LayoutTests/fast/xpath/py-dom-xpath/paths_t01: RuntimeError # Please triage this failure
LayoutTests/fast/xpath/reverse-axes_t01: RuntimeError # Please triage this failure
LayoutTests/fast/xsl/default-html_t01: RuntimeError # Please triage this failure
+LibTest/collection/ListMixin/ListMixin_class_A01_t02: Pass, Slow # Issue 32862.
LibTest/core/RegExp/Pattern_semantics/firstMatch_CharacterClassEscape_A03_t01: RuntimeError # Safari is not on Unicode 6.3 yet.
LibTest/core/RegExp/Pattern_semantics/firstMatch_NonEmptyClassRanges_A01_t01: RuntimeError # Issue 22200
LibTest/core/RegExp/Pattern_semantics/firstMatch_NonEmptyClassRanges_A01_t05: RuntimeError # Issue 22200
@@ -7319,4 +7303,3 @@
[ $compiler == dart2js && !$strong ]
LibTest/typed_data/Float32x4List/first_A01_t02: Pass # co19 issue 130 + type error
LibTest/typed_data/Float32x4List/last_A01_t02: Pass # co19 issue 130 + type error
-
diff --git a/tests/co19/co19-kernel.status b/tests/co19/co19-kernel.status
index 9973899..582da56 100644
--- a/tests/co19/co19-kernel.status
+++ b/tests/co19/co19-kernel.status
@@ -708,7 +708,7 @@
Language/Expressions/Property_Extraction/Super_Getter_Access_and_Method_Closurization/no_such_method_t02: CompileTimeError
Language/Expressions/Property_Extraction/Super_Getter_Access_and_Method_Closurization/static_type_t03: CompileTimeError
Language/Expressions/Property_Extraction/Super_Getter_Access_and_Method_Closurization/static_type_warning_t01: CompileTimeError
-Language/Expressions/Property_Extraction/conditional_t06: Crash
+Language/Expressions/Property_Extraction/conditional_t06: CompileTimeError
Language/Expressions/Property_Extraction/static_type_warning_t01/01: CompileTimeError
Language/Expressions/Relational_Expressions/syntax_t01/01: CompileTimeError
Language/Expressions/Relational_Expressions/syntax_t01/02: CompileTimeError
@@ -1744,4 +1744,3 @@
[ $compiler == dartk || $compiler == dartkp ]
*: SkipByDesign
-
diff --git a/tests/co19/co19-runtime.status b/tests/co19/co19-runtime.status
index a4449ec..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
@@ -420,4 +420,3 @@
LibTest/core/Uri/encodeQueryComponent_A01_t02: Pass, Timeout
LibTest/isolate/Isolate/spawn_A01_t04: Pass, Timeout
LibTest/isolate/ReceivePort/take_A01_t02: Skip # Issue 27773
-
diff --git a/tests/compiler/dart2js/dart2js.status b/tests/compiler/dart2js/dart2js.status
index 7a97fd3..d090da2 100644
--- a/tests/compiler/dart2js/dart2js.status
+++ b/tests/compiler/dart2js/dart2js.status
@@ -115,4 +115,3 @@
[ $runtime == chrome || $runtime == ff || $runtime == firefox || $runtime == safari || $jscl ]
*: Skip # dart2js uses #import('dart:io'); and it is not self-hosted (yet).
-
diff --git a/tests/compiler/dart2js/mirrors/mirrors_used_test.dart b/tests/compiler/dart2js/mirrors/mirrors_used_test.dart
index 377ddff..63c6915 100644
--- a/tests/compiler/dart2js/mirrors/mirrors_used_test.dart
+++ b/tests/compiler/dart2js/mirrors/mirrors_used_test.dart
@@ -71,7 +71,7 @@
// 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 = 486;
+ int expectedMethodCount = 490;
Expect.isTrue(
generatedCode.length <= expectedMethodCount,
'Too many compiled methods: '
diff --git a/tests/compiler/dart2js/old_frontend/mock_libraries.dart b/tests/compiler/dart2js/old_frontend/mock_libraries.dart
index 6e8a3ee..a4e4158 100644
--- a/tests/compiler/dart2js/old_frontend/mock_libraries.dart
+++ b/tests/compiler/dart2js/old_frontend/mock_libraries.dart
@@ -212,6 +212,8 @@
'futureOrCheck': r'futureOrCheck(f, t) { return f; }',
'getFallThroughError': 'getFallThroughError() {}',
'getIsolateAffinityTag': 'getIsolateAffinityTag(_) {}',
+ 'getRuntimeTypeArgumentIntercepted':
+ 'getRuntimeTypeArgumentIntercepted(interceptor, target, substitutionName, index) {}',
'getRuntimeTypeArgument':
'getRuntimeTypeArgument(target, substitutionName, index) {}',
'getRuntimeTypeArguments':
diff --git a/tests/compiler/dart2js_extra/32828_test.dart b/tests/compiler/dart2js_extra/32828_test.dart
new file mode 100644
index 0000000..c56a904
--- /dev/null
+++ b/tests/compiler/dart2js_extra/32828_test.dart
@@ -0,0 +1,11 @@
+// Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+// dart2jsOptions=--strong
+
+class A {
+ void m2<T>(void Function(T) f, [a]) {}
+}
+
+main() => new A().m2<String>(null);
diff --git a/tests/compiler/dart2js_extra/dart2js_extra.status b/tests/compiler/dart2js_extra/dart2js_extra.status
index 8ef249e..bb4d673 100644
--- a/tests/compiler/dart2js_extra/dart2js_extra.status
+++ b/tests/compiler/dart2js_extra/dart2js_extra.status
@@ -232,4 +232,3 @@
invalid_annotation_test/01: MissingCompileTimeError, OK # vm is lazy
new_from_env_test: SkipByDesign # dart2js only test
unconditional_dartio_import_test: SkipByDesign # dart2js only test
-
diff --git a/tests/compiler/dart2js_native/dart2js_native.status b/tests/compiler/dart2js_native/dart2js_native.status
index 573d775..d3f454e 100644
--- a/tests/compiler/dart2js_native/dart2js_native.status
+++ b/tests/compiler/dart2js_native/dart2js_native.status
@@ -29,4 +29,3 @@
[ $compiler == dart2js && $minified ]
optimization_hints_test: RuntimeError, OK # Test relies on unminified names.
-
diff --git a/tests/corelib/corelib.status b/tests/corelib/corelib.status
index 858757d..99a89af 100644
--- a/tests/corelib/corelib.status
+++ b/tests/corelib/corelib.status
@@ -156,9 +156,7 @@
int_parse_radix_test/02: RuntimeError
integer_to_radix_string_test: RuntimeError
integer_to_string_test/01: RuntimeError
-iterable_return_type_test/01: RuntimeError
iterable_return_type_test/02: RuntimeError
-iterable_to_list_test/01: RuntimeError
nan_infinity_test/01: RuntimeError
regress_r21715_test: RuntimeError
string_base_vm_test: RuntimeError
@@ -184,9 +182,7 @@
int_parse_radix_test/02: Fail # No bigints.
integer_to_radix_string_test: RuntimeError # issue 22045
integer_to_string_test/01: RuntimeError # Issue 1533
-iterable_return_type_test/01: RuntimeError # Issue 20085
iterable_return_type_test/02: RuntimeError # Dart2js does not support Uint64*.
-iterable_to_list_test/01: RuntimeError # Issue 26501
list_unmodifiable_test: Pass, RuntimeError # Issue 28712
nan_infinity_test/01: Fail # Issue 11551
regress_r21715_test: RuntimeError # Requires bigint support.
@@ -336,4 +332,3 @@
[ $hot_reload || $hot_reload_rollback ]
big_integer_huge_mul_vm_test: Pass, Slow # Slow
big_integer_parsed_mul_div_vm_test: Pass, Slow # Slow.
-
diff --git a/tests/corelib_2/bigint_test.dart b/tests/corelib_2/bigint_test.dart
index ed526b4..e6845d0 100644
--- a/tests/corelib_2/bigint_test.dart
+++ b/tests/corelib_2/bigint_test.dart
@@ -396,6 +396,10 @@
b = BigInt.parse("10000000000000000000");
Expect.equals(BigInt.one, a % b);
Expect.equals(BigInt.parse("10000000000000000000"), b % a);
+ a = BigInt.parse("2432363650");
+ b = BigInt.parse("2201792050");
+ Expect.equals(BigInt.parse("230571600"), a % b);
+ Expect.equals(BigInt.parse("2201792050"), b % a);
}
testBigintModPow() {
diff --git a/tests/corelib_2/cast_test.dart b/tests/corelib_2/cast_test.dart
index feee4e2..552032d 100644
--- a/tests/corelib_2/cast_test.dart
+++ b/tests/corelib_2/cast_test.dart
@@ -87,6 +87,12 @@
Expect.listEquals(elements, dList2);
Expect.throws(() => dList2[2] = new Object()); // Cannot set non-C.
Expect.listEquals(elements, dList2);
+
+ // Regression test.
+ var list3 = <num>[4, 3, 2, 1];
+ var dList3 = list3.retype<int>();
+ dList3.sort(null);
+ Expect.listEquals([1, 2, 3, 4], list3);
}
void testSet() {
diff --git a/tests/corelib_2/corelib_2.status b/tests/corelib_2/corelib_2.status
index b35abb8..4b626c0 100644
--- a/tests/corelib_2/corelib_2.status
+++ b/tests/corelib_2/corelib_2.status
@@ -26,7 +26,6 @@
bool_from_environment2_test/03: Crash
int_modulo_arith_test/modPow: RuntimeError
int_modulo_arith_test/none: RuntimeError
-null_nosuchmethod_test/01: RuntimeError # Issue 32088
null_test: RuntimeError # Issue 32194
string_from_environment3_test/03: Crash
@@ -223,13 +222,8 @@
integer_to_radix_string_test/02: RuntimeError
integer_to_radix_string_test/none: RuntimeError
integer_to_string_test/01: RuntimeError
-iterable_followed_by_test: RuntimeError
-iterable_return_type_test/01: RuntimeError # Issue 20085
iterable_return_type_test/02: RuntimeError # Dart2js does not support Uint64*.
-iterable_to_list_test/01: RuntimeError # Issue 26501
list_concurrent_modify_test: RuntimeError # dart2js does not fully implement these
-list_test/01: RuntimeError
-list_test/none: RuntimeError
list_unmodifiable_test: RuntimeError
main_test: RuntimeError
nan_infinity_test/01: RuntimeError
@@ -253,13 +247,8 @@
integer_to_radix_string_test/02: RuntimeError
integer_to_radix_string_test/none: RuntimeError
integer_to_string_test/01: RuntimeError
-iterable_followed_by_test: RuntimeError
-iterable_return_type_test/01: RuntimeError # Issue 20085
iterable_return_type_test/02: RuntimeError # Dart2js does not support Uint64*.
-iterable_to_list_test/01: RuntimeError # Issue 26501
list_concurrent_modify_test: RuntimeError # dart2js does not fully implement these
-list_test/01: RuntimeError
-list_test/none: RuntimeError
list_unmodifiable_test: RuntimeError
main_test: RuntimeError
nan_infinity_test/01: RuntimeError
@@ -298,7 +287,6 @@
[ $compiler == dartdevc && $runtime != none ]
bigint_from_test: CompileTimeError # Issue 32585
compare_to2_test: CompileTimeError # invalid test
-null_nosuchmethod_test/01: RuntimeError # Issue 32088
symbol_operator_test: RuntimeError # Issue 29921
[ $compiler != dartdevc && $compiler != dartdevk && $checked && !$strong ]
@@ -417,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) ]
-apply2_test: RuntimeError # Issue 29921
apply3_test: RuntimeError # Issue 29921
bigint_test: Pass, Slow
compare_to2_test: RuntimeError # Issue 30170
@@ -599,13 +586,6 @@
from_environment_const_type_undefined_test/16: MissingCompileTimeError
iterable_to_set_test: RuntimeError # is-checks do not implement strong mode type system
-[ $compiler == dartdevc || $compiler == dart2analyzer && $strong ]
-double_parse_test/01: Skip # Temporarily disable the following tests until we figure out why they started failing.
-double_parse_test/02: Skip # Temporarily disable the following tests until we figure out why they started failing.
-double_parse_test/03: Skip # Temporarily disable the following tests until we figure out why they started failing.
-double_parse_test/04: Skip # Temporarily disable the following tests until we figure out why they started failing.
-double_parse_test/none: Skip # Temporarily disable the following tests until we figure out why they started failing.
-
[ $compiler == dartkp || $compiler == precompiler ]
apply3_test: SkipByDesign
dynamic_nosuchmethod_test: SkipByDesign
@@ -626,6 +606,5 @@
[ $hot_reload || $hot_reload_rollback ]
bigint_parse_radix_test: Pass, Timeout # Issue 31659
-bigint_test: Pass, Slow, Crash # Issue 31660
+bigint_test: Pass, Crash # Issue 31660
integer_parsed_mul_div_vm_test: Pass, Slow # Slow
-
diff --git a/tests/corelib_2/double_parse_test.dart b/tests/corelib_2/double_parse_test.dart
index 25a72ec..7dc70e7 100644
--- a/tests/corelib_2/double_parse_test.dart
+++ b/tests/corelib_2/double_parse_test.dart
@@ -15,9 +15,7 @@
"\x0c",
"\x0d",
// JS implementations disagree on U+0085 being whitespace.
- // U+0085 does not work well with testParseWhiteSpace, so place
- // in its own multitest.
- "\x85", //# 01: ok
+ // U+0085 does not work well with testParseWhiteSpace, so omit it.
"\xa0",
"\u1680",
"\u2000",
@@ -232,27 +230,27 @@
"4555072551893136908362547791869486679949683240497058210285131854"
"51396213837722826145437693412532098591327667236328125",
0.0);
- testParse( //# 03: ok
- "0.00000000000000000000000000000000000000000000000000000000000000" //# 03: ok
- "0000000000000000000000000000000000000000000000000000000000000000" //# 03: ok
- "0000000000000000000000000000000000000000000000000000000000000000" //# 03: ok
- "0000000000000000000000000000000000000000000000000000000000000000" //# 03: ok
- "0000000000000000000000000000000000000000000000000000000000000000" //# 03: ok
- "0000024703282292062327208828439643411068627545332140664243314532" //# 03: ok
- "8041234170109088178685677591650492652607243027730579814636067699" //# 03: ok
- "1112238669661707327453443265068702897439863329200619332642599205" //# 03: ok
- "1806252781222000513169502627641523911022607448403553068808609405" //# 03: ok
- "1727798181294290864842608522062097649849550765341204993205100587" //# 03: ok
- "2127469658709242016690593998242808606978027857019419997429604579" //# 03: ok
- "7572623273334010723772922131119806567715298322567005234345331218" //# 03: ok
- "5169920860031716486480793611343761679481328431956040281530986197" //# 03: ok
- "8304604971452253283193290744072288902141724247846767401941767720" //# 03: ok
- "8561650585989659548591956327689896895290365125294085321852619688" //# 03: ok
- "9863888974446146846024033780172178553364579041996676675092137151" //# 03: ok
- "9705456298034409473812692774776868254618683783877327369245051207" //# 03: ok
- "5931578479504396230612962142122846982018227555473696607567828620" //# 03: ok
- "5497859173707553281928994692862033843994140625", //# 03: ok
- 5e-324); //# 03: ok
+ testParse(
+ "0.00000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000024703282292062327208828439643411068627545332140664243314532"
+ "8041234170109088178685677591650492652607243027730579814636067699"
+ "1112238669661707327453443265068702897439863329200619332642599205"
+ "1806252781222000513169502627641523911022607448403553068808609405"
+ "1727798181294290864842608522062097649849550765341204993205100587"
+ "2127469658709242016690593998242808606978027857019419997429604579"
+ "7572623273334010723772922131119806567715298322567005234345331218"
+ "5169920860031716486480793611343761679481328431956040281530986197"
+ "8304604971452253283193290744072288902141724247846767401941767720"
+ "8561650585989659548591956327689896895290365125294085321852619688"
+ "9863888974446146846024033780172178553364579041996676675092137151"
+ "9705456298034409473812692774776868254618683783877327369245051207"
+ "5931578479504396230612962142122846982018227555473696607567828620"
+ "5497859173707553281928994692862033843994140625",
+ 5e-324);
testParse(
"0.00000000000000000000000000000000000000000000000000000000000000"
"0000000000000000000000000000000000000000000000000000000000000000"
@@ -375,46 +373,46 @@
"8136843040991207538774075715754306035963544889052606784864342758"
"900428165258489343614201061427593231201171875",
5e-324);
- testParse( //# 02: ok
- "0.00000000000000000000000000000000000000000000000000000000000000" //# 02: ok
- "0000000000000000000000000000000000000000000000000000000000000000" //# 02: ok
- "0000000000000000000000000000000000000000000000000000000000000000" //# 02: ok
- "0000000000000000000000000000000000000000000000000000000000000000" //# 02: ok
- "0000000000000000000000000000000000000000000000000000000000000000" //# 02: ok
- "0000074109846876186981626485318930233205854758970392148714663837" //# 02: ok
- "8523751013260905313127797949754542453988569694847043168576596389" //# 02: ok
- "9850655339096945981621940161728171894510697854671067917687257517" //# 02: ok
- "7347315553307795408549809608457500958111373034747658096871009590" //# 02: ok
- "9754422710047573078097111189357848386756539987835030152280559340" //# 02: ok
- "4659373979179073872386829939581848166016912201945649993128979841" //# 02: ok
- "1362062484498678713572180352209017023903285791732520220528974020" //# 02: ok
- "8029068540216066123755499834026713000358124864790413857434018755" //# 02: ok
- "2090159017259254714629617513415977493871857473787096164563890871" //# 02: ok
- "8119841271673056017045493004705269590165763776884908267986972573" //# 02: ok
- "3665217655679410725087643375608460039849049721491174630855395563" //# 02: ok
- "54188641513168478436313080237596295773983001708984375", //# 02: ok
- 1e-323); //# 02: ok
- testParse( //# 03: ok
- "0.00000000000000000000000000000000000000000000000000000000000000" //# 03: ok
- "0000000000000000000000000000000000000000000000000000000000000000" //# 03: ok
- "0000000000000000000000000000000000000000000000000000000000000000" //# 03: ok
- "0000000000000000000000000000000000000000000000000000000000000000" //# 03: ok
- "0000000000000000000000000000000000000000000000000000000000000000" //# 03: ok
- "0000074109846876186981626485318930233205873343654412044724850344" //# 03: ok
- "8923718677971811461747287833219166123210675953743507352131000861" //# 03: ok
- "5508029119022396648780866584046796426383292609958261304514284249" //# 03: ok
- "6061610746879932829188941791435548141415672575056325503240888674" //# 03: ok
- "0040403932604439422384254107243478095284614859960753370503720954" //# 03: ok
- "5808063977144841990843464643012899935961693114687389992568869106" //# 03: ok
- "5599267374834247685403237712975952143398358575711517208866987110" //# 03: ok
- "6349531233468788347546753834029761025748698485508885182206645314" //# 03: ok
- "0639262948657591471263120659283236968907400986955900192071499065" //# 03: ok
- "6496581595870337769532410323614883653969318176216473399700896902" //# 03: ok
- "4282850500785430600410615352213843786678841324490411560469406158" //# 03: ok
- "4550533979841101562169154890806946368370134291387467238490102415" //# 03: ok
- "1863156959008792461225924284245693964036455110947393215135657241" //# 03: ok
- "099571834741510656385798938572406768798828125", //# 03: ok
- 1e-323); //# 03: ok
+ testParse(
+ "0.00000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000074109846876186981626485318930233205854758970392148714663837"
+ "8523751013260905313127797949754542453988569694847043168576596389"
+ "9850655339096945981621940161728171894510697854671067917687257517"
+ "7347315553307795408549809608457500958111373034747658096871009590"
+ "9754422710047573078097111189357848386756539987835030152280559340"
+ "4659373979179073872386829939581848166016912201945649993128979841"
+ "1362062484498678713572180352209017023903285791732520220528974020"
+ "8029068540216066123755499834026713000358124864790413857434018755"
+ "2090159017259254714629617513415977493871857473787096164563890871"
+ "8119841271673056017045493004705269590165763776884908267986972573"
+ "3665217655679410725087643375608460039849049721491174630855395563"
+ "54188641513168478436313080237596295773983001708984375",
+ 1e-323);
+ testParse(
+ "0.00000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000074109846876186981626485318930233205873343654412044724850344"
+ "8923718677971811461747287833219166123210675953743507352131000861"
+ "5508029119022396648780866584046796426383292609958261304514284249"
+ "6061610746879932829188941791435548141415672575056325503240888674"
+ "0040403932604439422384254107243478095284614859960753370503720954"
+ "5808063977144841990843464643012899935961693114687389992568869106"
+ "5599267374834247685403237712975952143398358575711517208866987110"
+ "6349531233468788347546753834029761025748698485508885182206645314"
+ "0639262948657591471263120659283236968907400986955900192071499065"
+ "6496581595870337769532410323614883653969318176216473399700896902"
+ "4282850500785430600410615352213843786678841324490411560469406158"
+ "4550533979841101562169154890806946368370134291387467238490102415"
+ "1863156959008792461225924284245693964036455110947393215135657241"
+ "099571834741510656385798938572406768798828125",
+ 1e-323);
testParse(
"0.00000000000000000000000000000000000000000000000000000000000000"
"0000000000000000000000000000000000000000000000000000000000000000"
@@ -495,27 +493,27 @@
"0239620254961370692713747131027132020441991845959370908649389667"
"01396213837722826145437693412532098591327667236328125",
1.1125369292536007e-308);
- testParse( //# 03: ok
- "0.00000000000000000000000000000000000000000000000000000000000000" //# 03: ok
- "0000000000000000000000000000000000000000000000000000000000000000" //# 03: ok
- "0000000000000000000000000000000000000000000000000000000000000000" //# 03: ok
- "0000000000000000000000000000000000000000000000000000000000000000" //# 03: ok
- "0000000000000000000000000000000000000000000000000000011125369292" //# 03: ok
- "5360093857793927928947412039400442434185228365340521456608629527" //# 03: ok
- "0200315929606120759250932815416474352736201659755028987189999989" //# 03: ok
- "3220987486513026766686796443888026815774211444057134206415720396" //# 03: ok
- "3510525564718487986029401249963455450110781777556316353975973978" //# 03: ok
- "4825173851725161436876623857879887229903814003929524302244972629" //# 03: ok
- "6795040225381805100879491255387164751912585073962051947893527710" //# 03: ok
- "5170790163081944841764003984818943810636714040207972316616704045" //# 03: ok
- "0220895038833513659790739432367709097880422198053807344762226099" //# 03: ok
- "3129277744388529754345873069706690065083079768940685222309466301" //# 03: ok
- "4235389404255004774284573740536646273496781023858510820692328908" //# 03: ok
- "0857253100067390568036719107632515767271783448958607838263400261" //# 03: ok
- "9271291212296536333081616208300526650104600844121842238490102415" //# 03: ok
- "1863156959008792461225924284245693964036455110947393215135657241" //# 03: ok
- "099571834741510656385798938572406768798828125", //# 03: ok
- 1.112536929253601e-308); //# 03: ok
+ testParse(
+ "0.00000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000011125369292"
+ "5360093857793927928947412039400442434185228365340521456608629527"
+ "0200315929606120759250932815416474352736201659755028987189999989"
+ "3220987486513026766686796443888026815774211444057134206415720396"
+ "3510525564718487986029401249963455450110781777556316353975973978"
+ "4825173851725161436876623857879887229903814003929524302244972629"
+ "6795040225381805100879491255387164751912585073962051947893527710"
+ "5170790163081944841764003984818943810636714040207972316616704045"
+ "0220895038833513659790739432367709097880422198053807344762226099"
+ "3129277744388529754345873069706690065083079768940685222309466301"
+ "4235389404255004774284573740536646273496781023858510820692328908"
+ "0857253100067390568036719107632515767271783448958607838263400261"
+ "9271291212296536333081616208300526650104600844121842238490102415"
+ "1863156959008792461225924284245693964036455110947393215135657241"
+ "099571834741510656385798938572406768798828125",
+ 1.112536929253601e-308);
testParse(
"0.00000000000000000000000000000000000000000000000000000000000000"
"0000000000000000000000000000000000000000000000000000000000000000"
@@ -577,46 +575,46 @@
"8136843040991207538774075715754306035963544889052606784864342758"
"900428165258489343614201061427593231201171875",
1.112536929253601e-308);
- testParse( //# 02: ok
- "0.00000000000000000000000000000000000000000000000000000000000000" //# 02: ok
- "0000000000000000000000000000000000000000000000000000000000000000" //# 02: ok
- "0000000000000000000000000000000000000000000000000000000000000000" //# 02: ok
- "0000000000000000000000000000000000000000000000000000000000000000" //# 02: ok
- "0000000000000000000000000000000000000000000000000000011125369292" //# 02: ok
- "5360143264358512053601829696279729256322446286636762993074885578" //# 02: ok
- "5482848940402484819383308231788212319506475197423260249353326444" //# 02: ok
- "4130717265985540087275830129388183546908748591883986098046865342" //# 02: ok
- "9694440740018214171090142139290408905547397593746087678853434622" //# 02: ok
- "7708807769200010477987555066232823112546765790360487852208850575" //# 02: ok
- "8752599546868752897347409845010678425979078962517411943872958339" //# 02: ok
- "1841626929078828345647733525524686707077165117383988808631340302" //# 02: ok
- "3919811372391502185169818655049136406061931820528945258278945377" //# 02: ok
- "2640279824496362807465448266116748919295441238296611971177785355" //# 02: ok
- "4605209927839760366494651758097211936470402475783551200969719627" //# 02: ok
- "9349765358747644509438842714766105380341358326953487329219653376" //# 02: ok
- "04188641513168478436313080237596295773983001708984375", //# 02: ok
- 1.1125369292536017e-308); //# 02: ok
- testParse( //# 03: ok
- "0.00000000000000000000000000000000000000000000000000000000000000" //# 03: ok
- "0000000000000000000000000000000000000000000000000000000000000000" //# 03: ok
- "0000000000000000000000000000000000000000000000000000000000000000" //# 03: ok
- "0000000000000000000000000000000000000000000000000000000000000000" //# 03: ok
- "0000000000000000000000000000000000000000000000000000011125369292" //# 03: ok
- "5360143264358512053601829696279729256322464871320782889085072085" //# 03: ok
- "5882816605113390968002798115252835988728581456319724432907730915" //# 03: ok
- "9788091045910990754434756551706808078781343347171179484873892074" //# 03: ok
- "8408735933590351591729274322268456088851697134054755085223313705" //# 03: ok
- "7994788991756876822274697984118452821074840662486211070432012189" //# 03: ok
- "9901289544834521015804044548441730195923859875259151943312847604" //# 03: ok
- "6078831819414397317478790886291621826572237901362985796969353392" //# 03: ok
- "2240274065644224408961072655052184431452505441247416583051571936" //# 03: ok
- "1189383755894699564098951411984008394330984751465415998685393549" //# 03: ok
- "2981950252037042118981569077006826000273956875115116332683643956" //# 03: ok
- "9967398203853664384761814691371489127171149929952724258833663970" //# 03: ok
- "9550533979841101562169154890806946368370134291387467238490102415" //# 03: ok
- "1863156959008792461225924284245693964036455110947393215135657241" //# 03: ok
- "099571834741510656385798938572406768798828125", //# 03: ok
- 1.1125369292536017e-308); //# 03: ok
+ testParse(
+ "0.00000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000011125369292"
+ "5360143264358512053601829696279729256322446286636762993074885578"
+ "5482848940402484819383308231788212319506475197423260249353326444"
+ "4130717265985540087275830129388183546908748591883986098046865342"
+ "9694440740018214171090142139290408905547397593746087678853434622"
+ "7708807769200010477987555066232823112546765790360487852208850575"
+ "8752599546868752897347409845010678425979078962517411943872958339"
+ "1841626929078828345647733525524686707077165117383988808631340302"
+ "3919811372391502185169818655049136406061931820528945258278945377"
+ "2640279824496362807465448266116748919295441238296611971177785355"
+ "4605209927839760366494651758097211936470402475783551200969719627"
+ "9349765358747644509438842714766105380341358326953487329219653376"
+ "04188641513168478436313080237596295773983001708984375",
+ 1.1125369292536017e-308);
+ testParse(
+ "0.00000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000011125369292"
+ "5360143264358512053601829696279729256322464871320782889085072085"
+ "5882816605113390968002798115252835988728581456319724432907730915"
+ "9788091045910990754434756551706808078781343347171179484873892074"
+ "8408735933590351591729274322268456088851697134054755085223313705"
+ "7994788991756876822274697984118452821074840662486211070432012189"
+ "9901289544834521015804044548441730195923859875259151943312847604"
+ "6078831819414397317478790886291621826572237901362985796969353392"
+ "2240274065644224408961072655052184431452505441247416583051571936"
+ "1189383755894699564098951411984008394330984751465415998685393549"
+ "2981950252037042118981569077006826000273956875115116332683643956"
+ "9967398203853664384761814691371489127171149929952724258833663970"
+ "9550533979841101562169154890806946368370134291387467238490102415"
+ "1863156959008792461225924284245693964036455110947393215135657241"
+ "099571834741510656385798938572406768798828125",
+ 1.1125369292536017e-308);
testParse(
"0.00000000000000000000000000000000000000000000000000000000000000"
"0000000000000000000000000000000000000000000000000000000000000000"
@@ -696,27 +694,27 @@
"5924167958029604477064946470184777360934300451421683607013647479"
"51396213837722826145437693412532098591327667236328125",
2.2250738585072014e-308);
- testParse( //# 03: ok
- "0.00000000000000000000000000000000000000000000000000000000000000" //# 03: ok
- "0000000000000000000000000000000000000000000000000000000000000000" //# 03: ok
- "0000000000000000000000000000000000000000000000000000000000000000" //# 03: ok
- "0000000000000000000000000000000000000000000000000000000000000000" //# 03: ok
- "0000000000000000000000000000000000000000000000000000022250738585" //# 03: ok
- "0720163012305563795567615250361241457301819893006892300968851267" //# 03: ok
- "7159413856747700265506443097450144218254107162331246067966730043" //# 03: ok
- "7501049413401620872340686411548038468172262181270052386775328221" //# 03: ok
- "5857650751428906748569733780796363397546806336554745935958399010" //# 03: ok
- "2779558910877598836767067734754861955694039806454982002173263865" //# 03: ok
- "0888265793071484125840071160815995011874751834533813898637506208" //# 03: ok
- "5650354607662094473839557158134613493810593365859440904719070326" //# 03: ok
- "6111637871008949721205058253390132503584229153792338745607152721" //# 03: ok
- "3679398551625637847181703822407461490506663533450201028923360785" //# 03: ok
- "0720758060421709123733732493928588619801419722757153753675075962" //# 03: ok
- "6541800803135624352387918446790161107764092054420920536627658074" //# 03: ok
- "4271291212296536333081616208300526650104600844121842238490102415" //# 03: ok
- "1863156959008792461225924284245693964036455110947393215135657241" //# 03: ok
- "099571834741510656385798938572406768798828125", //# 03: ok
- 2.225073858507202e-308); //# 03: ok
+ testParse(
+ "0.00000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000022250738585"
+ "0720163012305563795567615250361241457301819893006892300968851267"
+ "7159413856747700265506443097450144218254107162331246067966730043"
+ "7501049413401620872340686411548038468172262181270052386775328221"
+ "5857650751428906748569733780796363397546806336554745935958399010"
+ "2779558910877598836767067734754861955694039806454982002173263865"
+ "0888265793071484125840071160815995011874751834533813898637506208"
+ "5650354607662094473839557158134613493810593365859440904719070326"
+ "6111637871008949721205058253390132503584229153792338745607152721"
+ "3679398551625637847181703822407461490506663533450201028923360785"
+ "0720758060421709123733732493928588619801419722757153753675075962"
+ "6541800803135624352387918446790161107764092054420920536627658074"
+ "4271291212296536333081616208300526650104600844121842238490102415"
+ "1863156959008792461225924284245693964036455110947393215135657241"
+ "099571834741510656385798938572406768798828125",
+ 2.225073858507202e-308);
testParse(
"0.00000000000000000000000000000000000000000000000000000000000000"
"0000000000000000000000000000000000000000000000000000000000000000"
@@ -778,46 +776,46 @@
"8136843040991207538774075715754306035963544889052606784864342758"
"900428165258489343614201061427593231201171875",
2.225073858507202e-308);
- testParse( //# 03: ok
- "0.00000000000000000000000000000000000000000000000000000000000000" //# 03: ok
- "0000000000000000000000000000000000000000000000000000000000000000" //# 03: ok
- "0000000000000000000000000000000000000000000000000000000000000000" //# 03: ok
- "0000000000000000000000000000000000000000000000000000000000000000" //# 03: ok
- "0000000000000000000000000000000000000000000000000000022250738585" //# 03: ok
- "0720212418870147920222032907240528279439037814303133837435107319" //# 03: ok
- "2441946867544064325638818513821882185024380699999477330130056498" //# 03: ok
- "8410779192874134192929720097048195199306799329096904278406473168" //# 03: ok
- "2041565926728632933630474670123316852983422152744517260835859654" //# 03: ok
- "5663192828352447877877998943107797838336991592885945552137141811" //# 03: ok
- "2845825114558431922307989750439508685941245723089173894616936837" //# 03: ok
- "2321191373658977977723286698840356390251044443035457396733706583" //# 03: ok
- "9810554204566938246584137476071559811765738776267476659123871999" //# 03: ok
- "3190400631733470900301279018817520344719025002806127777791679839" //# 03: ok
- "1090578584006464715943810511489154282775041174682194133952466682" //# 03: ok
- "5034313061815878293790042053923750720833666932415800027583911188" //# 03: ok
- "54188641513168478436313080237596295773983001708984375", //# 03: ok
- 2.2250738585072024e-308); //# 03: ok
- testParse( //# 03: ok
- "0.00000000000000000000000000000000000000000000000000000000000000" //# 03: ok
- "0000000000000000000000000000000000000000000000000000000000000000" //# 03: ok
- "0000000000000000000000000000000000000000000000000000000000000000" //# 03: ok
- "0000000000000000000000000000000000000000000000000000000000000000" //# 03: ok
- "0000000000000000000000000000000000000000000000000000022250738585" //# 03: ok
- "0720212418870147920222032907240528279439056398987153733445293826" //# 03: ok
- "2841914532254970474258308397286505854246486958895941513684460970" //# 03: ok
- "4068152972799584860088646519366819731179394084384097665233499900" //# 03: ok
- "0755861120300770354269606853101364036287721693053184667205738737" //# 03: ok
- "5949174050909314222165141860993427546865066465011668770360303425" //# 03: ok
- "3994515112524200040764624453870560455886026635830913894056826102" //# 03: ok
- "6558396263994546949554344059607291509746117227014454385071719673" //# 03: ok
- "8131016897819660470375391476074607837156312396985947983896498558" //# 03: ok
- "1739504563131807656934782164684779819754568515974931805299288032" //# 03: ok
- "9467318908203746468430727830398768346578595574013759265666391011" //# 03: ok
- "5651945906921898169113014030529134467663458535415036957197921783" //# 03: ok
- "4550533979841101562169154890806946368370134291387467238490102415" //# 03: ok
- "1863156959008792461225924284245693964036455110947393215135657241" //# 03: ok
- "099571834741510656385798938572406768798828125", //# 03: ok
- 2.2250738585072024e-308); //# 03: ok
+ testParse(
+ "0.00000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000022250738585"
+ "0720212418870147920222032907240528279439037814303133837435107319"
+ "2441946867544064325638818513821882185024380699999477330130056498"
+ "8410779192874134192929720097048195199306799329096904278406473168"
+ "2041565926728632933630474670123316852983422152744517260835859654"
+ "5663192828352447877877998943107797838336991592885945552137141811"
+ "2845825114558431922307989750439508685941245723089173894616936837"
+ "2321191373658977977723286698840356390251044443035457396733706583"
+ "9810554204566938246584137476071559811765738776267476659123871999"
+ "3190400631733470900301279018817520344719025002806127777791679839"
+ "1090578584006464715943810511489154282775041174682194133952466682"
+ "5034313061815878293790042053923750720833666932415800027583911188"
+ "54188641513168478436313080237596295773983001708984375",
+ 2.2250738585072024e-308);
+ testParse(
+ "0.00000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000022250738585"
+ "0720212418870147920222032907240528279439056398987153733445293826"
+ "2841914532254970474258308397286505854246486958895941513684460970"
+ "4068152972799584860088646519366819731179394084384097665233499900"
+ "0755861120300770354269606853101364036287721693053184667205738737"
+ "5949174050909314222165141860993427546865066465011668770360303425"
+ "3994515112524200040764624453870560455886026635830913894056826102"
+ "6558396263994546949554344059607291509746117227014454385071719673"
+ "8131016897819660470375391476074607837156312396985947983896498558"
+ "1739504563131807656934782164684779819754568515974931805299288032"
+ "9467318908203746468430727830398768346578595574013759265666391011"
+ "5651945906921898169113014030529134467663458535415036957197921783"
+ "4550533979841101562169154890806946368370134291387467238490102415"
+ "1863156959008792461225924284245693964036455110947393215135657241"
+ "099571834741510656385798938572406768798828125",
+ 2.2250738585072024e-308);
testParse(
"0.00000000000000000000000000000000000000000000000000000000000000"
"0000000000000000000000000000000000000000000000000000000000000000"
@@ -895,26 +893,26 @@
"8909645359318233784351199339157645340492308605462312698364257812"
"5",
1.0020841800044864e-292);
- testParse( //# 03: ok
- "0.00000000000000000000000000000000000000000000000000000000000000" //# 03: ok
- "0000000000000000000000000000000000000000000000000000000000000000" //# 03: ok
- "0000000000000000000000000000000000000000000000000000000000000000" //# 03: ok
- "0000000000000000000000000000000000000000000000000000000000000000" //# 03: ok
- "0000000000000000000000000000000000000100208418000448650025174695" //# 03: ok
- "1035150178458809017822159251011531515138151971877843746285762442" //# 03: ok
- "8545112214057342269294258292239779301929355259416640067909319649" //# 03: ok
- "7365336576866690449490575153391617964764463657240626936945707789" //# 03: ok
- "0322677840073401894046998179185686691822730198820493814317137229" //# 03: ok
- "5822164306994752582767555905533610628109411569344063803273395309" //# 03: ok
- "4016739578124191615155910675820643598048478728683293279406596985" //# 03: ok
- "3795142966229399885915374796852136102192598807080147602085351627" //# 03: ok
- "7462738186176388661491270541112149644974737467220377156516124492" //# 03: ok
- "5297987696655648150350049348782647584189423429523649017245633309" //# 03: ok
- "0650703736050481424426844685046761507858235356421727632283550512" //# 03: ok
- "9294184882356332903145058239310065886479547694117011957754993659" //# 03: ok
- "5152049332041520812604025151794328168042160636342216519487980314" //# 03: ok
- "421878240614097350935640662328296457417309284210205078125", //# 03: ok
- 1.0020841800044866e-292); //# 03: ok
+ testParse(
+ "0.00000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000100208418000448650025174695"
+ "1035150178458809017822159251011531515138151971877843746285762442"
+ "8545112214057342269294258292239779301929355259416640067909319649"
+ "7365336576866690449490575153391617964764463657240626936945707789"
+ "0322677840073401894046998179185686691822730198820493814317137229"
+ "5822164306994752582767555905533610628109411569344063803273395309"
+ "4016739578124191615155910675820643598048478728683293279406596985"
+ "3795142966229399885915374796852136102192598807080147602085351627"
+ "7462738186176388661491270541112149644974737467220377156516124492"
+ "5297987696655648150350049348782647584189423429523649017245633309"
+ "0650703736050481424426844685046761507858235356421727632283550512"
+ "9294184882356332903145058239310065886479547694117011957754993659"
+ "5152049332041520812604025151794328168042160636342216519487980314"
+ "421878240614097350935640662328296457417309284210205078125",
+ 1.0020841800044866e-292);
testParse(
"0.00000000000000000000000000000000000000000000000000000000000000"
"0000000000000000000000000000000000000000000000000000000000000000"
@@ -973,45 +971,45 @@
"4847950667958479187395974848205671831957839363657783480512019685"
"578121759385902649064359337671703542582690715789794921875",
2.0041683600089726e-292);
- testParse( //# 03: ok
- "0.00000000000000000000000000000000000000000000000000000000000000" //# 03: ok
- "0000000000000000000000000000000000000000000000000000000000000000" //# 03: ok
- "0000000000000000000000000000000000000000000000000000000000000000" //# 03: ok
- "0000000000000000000000000000000000000000000000000000000000000000" //# 03: ok
- "0000000000000000000000000000000000000200416836000897266674241512" //# 03: ok
- "5990092893382710435783708701744713907322363070003179054747514262" //# 03: ok
- "7385611700512865061525449421701203817286652851291627374287240329" //# 03: ok
- "3753705169156289950978164746871212513772283206234057202629821353" //# 03: ok
- "8809538439162226010550634208659737749820025430842192660178060615" //# 03: ok
- "3474267718174236120090795958487048484027109406716660005865875254" //# 03: ok
- "7540730218997620056025234843183240653494745917236268600971966054" //# 03: ok
- "2572750817920844689872038240532666937066187074066929436725783508" //# 03: ok
- "0513647350599865639683590212819431367049178252060735656411044144" //# 03: ok
- "5314088186163138416702979387974756763836546863081940712096908853" //# 03: ok
- "9929165937080868658779320353585122361868059050079309936626251244" //# 03: ok
- "0765647609431766215648800660842354659507691394537687301635742187" //# 03: ok
- "5", //# 03: ok
- 2.004168360008973e-292); //# 03: ok
- testParse( //# 03: ok
- "0.00000000000000000000000000000000000000000000000000000000000000" //# 03: ok
- "0000000000000000000000000000000000000000000000000000000000000000" //# 03: ok
- "0000000000000000000000000000000000000000000000000000000000000000" //# 03: ok
- "0000000000000000000000000000000000000000000000000000000000000000" //# 03: ok
- "0000000000000000000000000000000000000200416836000897266674241512" //# 03: ok
- "5990092893382710435783708785442689934124446215379877007119186963" //# 03: ok
- "1799271173601405540673717580039876412295823431198128133887844732" //# 03: ok
- "7822096271111944266498822575337206743053529154538278267721206728" //# 03: ok
- "1206759279588886755511816487266193645578706075743945771432529989" //# 03: ok
- "5627720577353214542977288069464672781437627568914207256313896083" //# 03: ok
- "6647266336088483105727658239269018534852601546443784653776612265" //# 03: ok
- "4362171708319597782738064157144965045964873355636409438294693959" //# 03: ok
- "3883447613213167389211587415988230219943616159642947883454256631" //# 03: ok
- "7129850578881555219447792913718868827972321214300345663373246010" //# 03: ok
- "5887233720340859229642766731751409169335306833113418201122555553" //# 03: ok
- "1150187132469865334442659560994775205494930483192386561026478034" //# 03: ok
- "5152049332041520812604025151794328168042160636342216519487980314" //# 03: ok
- "421878240614097350935640662328296457417309284210205078125", //# 03: ok
- 2.004168360008973e-292); //# 03: ok
+ testParse(
+ "0.00000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000200416836000897266674241512"
+ "5990092893382710435783708701744713907322363070003179054747514262"
+ "7385611700512865061525449421701203817286652851291627374287240329"
+ "3753705169156289950978164746871212513772283206234057202629821353"
+ "8809538439162226010550634208659737749820025430842192660178060615"
+ "3474267718174236120090795958487048484027109406716660005865875254"
+ "7540730218997620056025234843183240653494745917236268600971966054"
+ "2572750817920844689872038240532666937066187074066929436725783508"
+ "0513647350599865639683590212819431367049178252060735656411044144"
+ "5314088186163138416702979387974756763836546863081940712096908853"
+ "9929165937080868658779320353585122361868059050079309936626251244"
+ "0765647609431766215648800660842354659507691394537687301635742187"
+ "5",
+ 2.004168360008973e-292);
+ testParse(
+ "0.00000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000200416836000897266674241512"
+ "5990092893382710435783708785442689934124446215379877007119186963"
+ "1799271173601405540673717580039876412295823431198128133887844732"
+ "7822096271111944266498822575337206743053529154538278267721206728"
+ "1206759279588886755511816487266193645578706075743945771432529989"
+ "5627720577353214542977288069464672781437627568914207256313896083"
+ "6647266336088483105727658239269018534852601546443784653776612265"
+ "4362171708319597782738064157144965045964873355636409438294693959"
+ "3883447613213167389211587415988230219943616159642947883454256631"
+ "7129850578881555219447792913718868827972321214300345663373246010"
+ "5887233720340859229642766731751409169335306833113418201122555553"
+ "1150187132469865334442659560994775205494930483192386561026478034"
+ "5152049332041520812604025151794328168042160636342216519487980314"
+ "421878240614097350935640662328296457417309284210205078125",
+ 2.004168360008973e-292);
testParse("0.99999999999999988897769753748434595763683319091796875",
0.9999999999999999);
testParse(
@@ -1024,14 +1022,14 @@
"4809443029054117700758095643512548748358614094344726684993771234"
"576088145773464788135242997668683528900146484375",
0.9999999999999999);
- testParse( //# 03: ok
- "0.999999999999999944488848768742172978818416595458984375", //# 03: ok
- 1.0); //# 03: ok
- testParse( //# 03: ok
- "0.99999999999999994448884876874217297881841659545898441676194859" //# 03: ok
- "5190556970945882299241904356487451251641385905655273315006228765" //# 03: ok
- "423911854226535211864757002331316471099853515625", //# 03: ok
- 1.0); //# 03: ok
+ testParse(
+ "0.999999999999999944488848768742172978818416595458984375",
+ 1.0);
+ testParse(
+ "0.99999999999999994448884876874217297881841659545898441676194859"
+ "5190556970945882299241904356487451251641385905655273315006228765"
+ "423911854226535211864757002331316471099853515625",
+ 1.0);
testParse("0.499999999999999944488848768742172978818416595458984375",
0.49999999999999994);
testParse(
@@ -1044,14 +1042,14 @@
"2404721514527058850379047821756274374179307047172363342496885617"
"2880440728867323940676214988343417644500732421875",
0.49999999999999994);
- testParse( //# 03: ok
- "0.4999999999999999722444243843710864894092082977294921875", //# 03: ok
- 0.5); //# 03: ok
- testParse( //# 03: ok
- "0.49999999999999997224442438437108648940920829772949220838097429" //# 03: ok
- "7595278485472941149620952178243725625820692952827636657503114382" //# 03: ok
- "7119559271132676059323785011656582355499267578125", //# 03: ok
- 0.5); //# 03: ok
+ testParse(
+ "0.4999999999999999722444243843710864894092082977294921875",
+ 0.5);
+ testParse(
+ "0.49999999999999997224442438437108648940920829772949220838097429"
+ "7595278485472941149620952178243725625820692952827636657503114382"
+ "7119559271132676059323785011656582355499267578125",
+ 0.5);
testParse("1.9999999999999997779553950749686919152736663818359375",
1.9999999999999998);
testParse(
@@ -1064,14 +1062,14 @@
"9618886058108235401516191287025097496717228188689453369987542469"
"15217629154692957627048599533736705780029296875",
1.9999999999999998);
- testParse( //# 03: ok
- "1.99999999999999988897769753748434595763683319091796875", //# 03: ok
- 2.0); //# 03: ok
- testParse( //# 03: ok
- "1.99999999999999988897769753748434595763683319091796883352389719" //# 03: ok
- "0381113941891764598483808712974902503282771811310546630012457530" //# 03: ok
- "84782370845307042372951400466263294219970703125", //# 03: ok
- 2.0); //# 03: ok
+ testParse(
+ "1.99999999999999988897769753748434595763683319091796875",
+ 2.0);
+ testParse(
+ "1.99999999999999988897769753748434595763683319091796883352389719"
+ "0381113941891764598483808712974902503282771811310546630012457530"
+ "84782370845307042372951400466263294219970703125",
+ 2.0);
testParse("4503599627370495.5", 4503599627370495.5);
testParse(
"4503599627370495.50000000000000000000000000000000000018807909613"
@@ -1165,13 +1163,13 @@
testParse("1e-22", 1e-22);
testParse("1e-23", 1e-23);
- testParseWhitespace("1", 1.0); //# 04: ok
- testParseWhitespace("1.0", 1.0); //# 04: ok
- testParseWhitespace("1e1", 10.0); //# 04: ok
- testParseWhitespace(".1e1", 1.0); //# 04: ok
- testParseWhitespace("1.e1", 10.0); //# 04: ok
- testParseWhitespace("1e+1", 10.0); //# 04: ok
- testParseWhitespace("1e-1", 0.1); //# 04: ok
+ testParseWhitespace("1", 1.0);
+ testParseWhitespace("1.0", 1.0);
+ testParseWhitespace("1e1", 10.0);
+ testParseWhitespace(".1e1", 1.0);
+ testParseWhitespace("1.e1", 10.0);
+ testParseWhitespace("1e+1", 10.0);
+ testParseWhitespace("1e-1", 0.1);
// Negative tests - things not to allow.
diff --git a/tests/corelib_2/double_try_parse_test.dart b/tests/corelib_2/double_try_parse_test.dart
new file mode 100644
index 0000000..6ca51a3
--- /dev/null
+++ b/tests/corelib_2/double_try_parse_test.dart
@@ -0,0 +1,1209 @@
+// 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.
+// VMOptions=--no-use-field-guards
+// VMOptions=
+
+import "dart:math" show pow;
+import "package:expect/expect.dart";
+
+// U+0085 has been whitespace, isn't any more in all browsers.
+const whiteSpace = const [
+ "",
+ "\x09",
+ "\x0a",
+ "\x0b",
+ "\x0c",
+ "\x0d",
+ "\xa0",
+ "\u1680",
+ "\u2000",
+ "\u2001",
+ "\u2002",
+ "\u2003",
+ "\u2004",
+ "\u2005",
+ "\u2006",
+ "\u2007",
+ "\u2008",
+ "\u2009",
+ "\u200a",
+ "\u2028",
+ "\u2029",
+ "\u202f",
+ "\u205f",
+ "\u3000",
+ "\uFEFF"
+];
+
+void expectNumEquals(double expected, var actual, String message) {
+ if (expected.isNaN) {
+ Expect.isTrue(actual is double && actual.isNaN, "isNaN: $message");
+ } else {
+ Expect.identical(expected, actual, message);
+ }
+}
+
+// Test source surrounded by any combination of whitespace.
+void testParseAllWhitespace(String source, double result) {
+ for (String ws1 in whiteSpace) {
+ for (String ws2 in whiteSpace) {
+ String padded = "$ws1$source$ws2";
+ // Use Expect.identical because it also handles NaN and 0.0/-0.0.
+ // Except on dart2js: http://dartbug.com/11551
+ expectNumEquals(result, double.tryParse(padded), "parse '$padded'");
+ padded = "$ws1$ws2$source";
+ expectNumEquals(result, double.tryParse(padded), "parse '$padded'");
+ padded = "$source$ws1$ws2";
+ expectNumEquals(result, double.tryParse(padded), "parse '$padded'");
+ }
+ }
+}
+
+// Test source and -source surrounded by any combination of whitespace.
+void testParseWhitespace(String source, double result) {
+ assert(result >= 0);
+ testParseAllWhitespace(source, result);
+ testParseAllWhitespace("-$source", -result);
+}
+
+// Test parsing source, optionally preceeded and/or followed by whitespace.
+void testParse(String source, double result, [name = ""]) {
+ expectNumEquals(result, double.tryParse(source), "parse '$source:$name");
+ expectNumEquals(
+ result, double.tryParse(" $source"), "parse ' $source':$name");
+ expectNumEquals(
+ result, double.tryParse("$source "), "parse '$source ':$name");
+ expectNumEquals(
+ result, double.tryParse(" $source "), "parse ' $source ':$name");
+
+ expectNumEquals(result, double.tryParse("+$source"), "parse '+$source:$name");
+ expectNumEquals(
+ result, double.tryParse(" +$source"), "parse ' +$source':$name");
+ expectNumEquals(
+ result, double.tryParse("+$source "), "parse '+$source ':$name");
+ expectNumEquals(
+ result, double.tryParse(" +$source "), "parse ' +$source ':$name");
+
+ expectNumEquals(
+ -result, double.tryParse("-$source"), "parse '-$source:$name");
+ expectNumEquals(
+ -result, double.tryParse(" -$source"), "parse ' -$source':$name");
+ expectNumEquals(
+ -result, double.tryParse("-$source "), "parse '-$source ':$name");
+ expectNumEquals(
+ -result, double.tryParse(" -$source "), "parse ' -$source ':$name");
+}
+
+void testDouble(double value) {
+ testParse("$value", value);
+ if (value.isFinite) {
+ String exp = value.toStringAsExponential();
+ String lcexp = exp.toLowerCase();
+ testParse(lcexp, value);
+ String ucexp = exp.toUpperCase();
+ testParse(ucexp, value);
+ }
+}
+
+void testFail(String source) {
+ var object = new Object();
+ Expect.isNull(double.tryParse(source), "Fail: '$source'");
+}
+
+void main() {
+ testDouble(0.0);
+ testDouble(5e-324);
+ testDouble(2.225073858507201e-308);
+ testDouble(2.2250738585072014e-308);
+ testDouble(0.49999999999999994);
+ testDouble(0.5);
+ testDouble(0.50000000000000006);
+ testDouble(0.9999999999999999);
+ testDouble(1.0);
+ testDouble(1.0000000000000002);
+ testDouble(4294967295.0);
+ testDouble(4294967296.0);
+ testDouble(4503599627370495.5);
+ testDouble(4503599627370497.0);
+ testDouble(9007199254740991.0);
+ testDouble(9007199254740992.0);
+ testDouble(1.7976931348623157e+308);
+ testDouble(double.INFINITY);
+ testDouble(double.NAN);
+
+ // Strings that cannot occur from toString of a number.
+ testParse("000000000000", 0.0);
+ testParse("000000000001", 1.0);
+ testParse("000000000000.0000000000000", 0.0);
+ testParse("000000000001.0000000000000", 1.0);
+ testParse("0e0", 0.0);
+ testParse("0e+0", 0.0);
+ testParse("0e-0", 0.0);
+ testParse("1e0", 1.0);
+ testParse("1e+0", 1.0);
+ testParse("1e-0", 1.0);
+ testParse("1.", 1.0);
+ testParse(".1", 0.1);
+ testParse("1.e1", 10.0);
+ testParse(".1e1", 1.0);
+ testParse("Infinity", double.INFINITY);
+ testParse("NaN", double.NAN);
+
+ // Cases where mantissa and 10^exponent are representable as a double.
+ for (int i = -22; i <= 22; i++) {
+ for (double j in [1.0, 9007199254740991.0, 9007199254740992.0]) {
+ var value = (i >= 0) ? j * pow(10.0, i) : j / pow(10.0, -i);
+ testParse("${j}e$i", value, "$i/$j");
+ testParse("${j}E$i", value, "$i/$j");
+ if (i >= 0) {
+ testParse("${j}e+$i", value, "$i/$j");
+ testParse("${j}E+$i", value, "$i/$j");
+ }
+ }
+ }
+ for (int i = 0; i <= 22; i++) {
+ var digits = "9007199254740991";
+ for (int i = 0; i < digits.length; i++) {
+ int dotIndex = digits.length - i;
+ var string = "${digits.substring(0, dotIndex)}."
+ "${digits.substring(dotIndex)}e$i";
+ testParse(string, 9007199254740991.0);
+ }
+ }
+
+ testParse(
+ "0.00000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000012351641146031163604414219821705534309126495065358119110639"
+ "6420625168876817552187966324959090408998094949141173861429432731"
+ "6641775889849490996936990026954695315751782975778511319614542919"
+ "6224552592217965901424968268076250159685228839124609682811834931"
+ "8292403785007928846349518531559641397792756664639171692046759890"
+ "0776562329863178978731138323263641361002818700324274998854829973"
+ "5227010414083113118928696725368169503983880965288753370088162336"
+ "8004844756702677687292583305671118833393020810798402309572336459"
+ "2015026502876542452438269585569329582311976245631182694093981811"
+ "9686640211945509336174248834117544931694293962814151377997828762"
+ "2277536275946568454181273895934743339974841620248529105142565927"
+ "256981069188614130727188467062660492956638336181640625",
+ 0.0);
+ testParse(
+ "0.00000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000024703282292062327208828439643411068618252990130716238221279"
+ "2841250337753635104375932649918180817996189898282347722858865463"
+ "3283551779698981993873980053909390631503565951557022639229085839"
+ "2449105184435931802849936536152500319370457678249219365623669863"
+ "6584807570015857692699037063119282795585513329278343384093519780"
+ "1553124659726357957462276646527282722005637400648549997709659947"
+ "0454020828166226237857393450736339007967761930577506740176324673"
+ "6009689513405355374585166611342237666786041621596804619144672918"
+ "4030053005753084904876539171138659164623952491262365388187963623"
+ "9373280423891018672348497668235089863388587925628302755995657524"
+ "4555072551893136908362547791869486679949683240497058210285131854"
+ "51396213837722826145437693412532098591327667236328125",
+ 0.0);
+ testParse(
+ "0.00000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000024703282292062327208828439643411068618252990130716238221279"
+ "2841250337753635104375932649918180817996189898282347722858865463"
+ "3283551779698981993873980053909390631503565951557022639229085839"
+ "2449105184435931802849936536152500319370457678249219365623669863"
+ "6584807570015857692699037063119282795585513329278343384093519780"
+ "1553124659726357957462276646527282722005637400648549997709659947"
+ "0454020828166226237857393450736339007967761930577506740176324673"
+ "6009689513405355374585166611342237666786041621596804619144672918"
+ "4030053005753084904876539171138659164623952491262365388187963623"
+ "9373280423891018672348497668235089863388587925628302755995657524"
+ "4555072551893136908362547791869486679949683240497058210285131854"
+ "51396213837722826145437693412532098591327667236328125",
+ 0.0);
+ testParse(
+ "0.00000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000024703282292062327208828439643411068627545332140664243314532"
+ "8041234170109088178685677591650492652607243027730579814636067699"
+ "1112238669661707327453443265068702897439863329200619332642599205"
+ "1806252781222000513169502627641523911022607448403553068808609405"
+ "1727798181294290864842608522062097649849550765341204993205100587"
+ "2127469658709242016690593998242808606978027857019419997429604579"
+ "7572623273334010723772922131119806567715298322567005234345331218"
+ "5169920860031716486480793611343761679481328431956040281530986197"
+ "8304604971452253283193290744072288902141724247846767401941767720"
+ "8561650585989659548591956327689896895290365125294085321852619688"
+ "9863888974446146846024033780172178553364579041996676675092137151"
+ "9705456298034409473812692774776868254618683783877327369245051207"
+ "5931578479504396230612962142122846982018227555473696607567828620"
+ "5497859173707553281928994692862033843994140625", //
+ 5e-324); //
+ testParse(
+ "0.00000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000037054923438093490813242659465116602918087143186126352238665"
+ "4061891674274999582254154033144959392383231717975289492511095959"
+ "2096640779585747657231506869704773681319051549691937265430115392"
+ "9316510179867828993955338712739726887403536747219495345250565253"
+ "9734220743745353366904984135736109339114232557854653467028698863"
+ "1755341990606652876965097618075398198036065644601954996844545287"
+ "8562428797081554870870561495721040952204106503876761616095480465"
+ "4854302923481671949982122917011832487483775622035971266330696098"
+ "1770527542930458978998057183774359009418156980309146068528141338"
+ "9871550473737887132279287842897827763181104688776671568136524122"
+ "1523792405286695424882335699501538146509629059245968850620692484"
+ "3143597161396297062546730578356156393213233025204703880754948792"
+ "4068421520495603769387037857877153017981772444526303392432171379"
+ "4502140826292446718071005307137966156005859375",
+ 5e-324);
+ testParse(
+ "0.00000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000037054923438093490813242659465116602927379485196074357331918"
+ "9261875506630452656563898974877271226994284847423521584288298194"
+ "9925327669548472990810970080864085947255348927335533958843628758"
+ "8673657776653897704274904804228750479055686517373829048435504795"
+ "4877211355023786539048555594678924193378269993917515076140279670"
+ "2329686989589536936193414969790924083008456100972824996564489920"
+ "5681031242249339356786090176104508511951642895866260110264487010"
+ "4014534270108033061877749917013356500179062432395206928717009377"
+ "6045079508629627357314808756707988746935928736893548082281945435"
+ "9059920635836528008522746502352634795082881888442454133993486286"
+ "6832608827839705362543821687804230019924524860745587315427697781"
+ "770943207565842392181565401187981478869915008544921875",
+ 5e-324);
+ testParse(
+ "0.00000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000037054923438093490813242659465116602936671827206022362425172"
+ "4461859338985905730873643916609583061605337976871753676065500430"
+ "7754014559511198324390433292023398213191646304979130652257142124"
+ "8030805373439966414594470895717774070707836287528162751620444337"
+ "0020201966302219711192127053621739047642307429980376685251860477"
+ "2904031988572420995421732321506449967980846557343694996284434553"
+ "2799633687417123842701618856487976071699179287855758604433493555"
+ "3174765616734394173773376917014880512874349242754442591103322657"
+ "0319631474328795735631560329641618484453700493477950096035749532"
+ "8248290797935168884766205161807441826984659088108236699850448451"
+ "2141425250392715300205307676106921893339420662245205780234703079"
+ "2275266989920550781084577445403473184185067145693733619245051207"
+ "5931578479504396230612962142122846982018227555473696607567828620"
+ "5497859173707553281928994692862033843994140625",
+ 5e-324);
+ testParse(
+ "0.00000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000049406564584124654417656879286822137236505980261432476442558"
+ "5682500675507270208751865299836361635992379796564695445717730926"
+ "6567103559397963987747960107818781263007131903114045278458171678"
+ "4898210368871863605699873072305000638740915356498438731247339727"
+ "3169615140031715385398074126238565591171026658556686768187039560"
+ "3106249319452715914924553293054565444011274801297099995419319894"
+ "0908041656332452475714786901472678015935523861155013480352649347"
+ "2019379026810710749170333222684475333572083243193609238289345836"
+ "8060106011506169809753078342277318329247904982524730776375927247"
+ "8746560847782037344696995336470179726777175851256605511991315048"
+ "9110145103786273816725095583738973359899366480994116420570263709"
+ "0279242767544565229087538682506419718265533447265625",
+ 5e-324);
+ testParse(
+ "0.00000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000049406564584124654417656879286822137255090664281328486629065"
+ "6082468340218176357371355183300985305214486055461159629272135398"
+ "2224477339323414654906886530137405794879726658401238665285198410"
+ "3612505562444001026339005255283047822045214896807106137617218810"
+ "3455596362588581729685217044124195299699101530682409986410201174"
+ "4254939317418484033381187996485617213956055714038839994859209159"
+ "5145246546668021447545844262239613135430596645134010468690662437"
+ "0339841720063432972961587222687523358962656863912080563061972395"
+ "6609209942904506566386581488144577804283448495693534803883535441"
+ "7123301171979319097183912655379793790580730250588170643705239377"
+ "9727777948892293692048067560344357106729158083993353350184274303"
+ "9410912596068818947625385549553736509237367567754654738490102415"
+ "1863156959008792461225924284245693964036455110947393215135657241"
+ "099571834741510656385798938572406768798828125",
+ 5e-324);
+ testParse(
+ "0.00000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000074109846876186981626485318930233205836174286372252704477330"
+ "8123783348549999164508308066289918784766463435950578985022191918"
+ "4193281559171495314463013739409547362638103099383874530860230785"
+ "8633020359735657987910677425479453774807073494438990690501130507"
+ "9468441487490706733809968271472218678228465115709306934057397726"
+ "3510683981213305753930195236150796396072131289203909993689090575"
+ "7124857594163109741741122991442081904408213007753523232190960930"
+ "9708605846963343899964245834023664974967551244071942532661392196"
+ "3541055085860917957996114367548718018836313960618292137056282677"
+ "9743100947475774264558575685795655526362209377553343136273048244"
+ "3047584810573390849764671399003076293019258118491937701241384968"
+ "6287194322792594125093461156712312786426466050409407761509897584"
+ "8136843040991207538774075715754306035963544889052606784864342758"
+ "900428165258489343614201061427593231201171875",
+ 5e-324);
+ testParse(
+ "0.00000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000074109846876186981626485318930233205854758970392148714663837"
+ "8523751013260905313127797949754542453988569694847043168576596389"
+ "9850655339096945981621940161728171894510697854671067917687257517"
+ "7347315553307795408549809608457500958111373034747658096871009590"
+ "9754422710047573078097111189357848386756539987835030152280559340"
+ "4659373979179073872386829939581848166016912201945649993128979841"
+ "1362062484498678713572180352209017023903285791732520220528974020"
+ "8029068540216066123755499834026713000358124864790413857434018755"
+ "2090159017259254714629617513415977493871857473787096164563890871"
+ "8119841271673056017045493004705269590165763776884908267986972573"
+ "3665217655679410725087643375608460039849049721491174630855395563"
+ "54188641513168478436313080237596295773983001708984375", //
+ 1e-323); //
+ testParse(
+ "0.00000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000074109846876186981626485318930233205873343654412044724850344"
+ "8923718677971811461747287833219166123210675953743507352131000861"
+ "5508029119022396648780866584046796426383292609958261304514284249"
+ "6061610746879932829188941791435548141415672575056325503240888674"
+ "0040403932604439422384254107243478095284614859960753370503720954"
+ "5808063977144841990843464643012899935961693114687389992568869106"
+ "5599267374834247685403237712975952143398358575711517208866987110"
+ "6349531233468788347546753834029761025748698485508885182206645314"
+ "0639262948657591471263120659283236968907400986955900192071499065"
+ "6496581595870337769532410323614883653969318176216473399700896902"
+ "4282850500785430600410615352213843786678841324490411560469406158"
+ "4550533979841101562169154890806946368370134291387467238490102415"
+ "1863156959008792461225924284245693964036455110947393215135657241"
+ "099571834741510656385798938572406768798828125", //
+ 1e-323); //
+ testParse(
+ "0.00000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000011125369292"
+ "5360069154511635866620203210960799023116591527666370844360221740"
+ "6959097927141579506255510282033669865517905502576217080776730054"
+ "4280061926888594105653889967660011652398050737212918180359607825"
+ "2347125186710418762540332530832907947436024558998429581982425031"
+ "7954385059152437399890443876874974725790225802525457699928291235"
+ "4093225567689679024960579905428830259962166760571761950743978498"
+ "0479564444580149632075553173315669683173879325651468588102366281"
+ "5890742832175436061414318821022423405703806955738531400844926622"
+ "0550120807237108092835830752700771425423583764509515806613894483"
+ "6485368656166704349449158753391942346304638698898642932982747054"
+ "5684547703068233784351199339157645340492308605462312698364257812"
+ "5",
+ 1.1125369292536007e-308);
+ testParse(
+ "0.00000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000011125369292"
+ "5360069154511635866620203210960799023116610112350390740370408247"
+ "7359065591852485654875000165498293534740011761472681264331134525"
+ "9937435706814044772812816389978636184270645492500111567186634557"
+ "1061420380282556183179464713810955130740324099307096988352304114"
+ "8240366281709303744177586794760604434318300674651180918151452849"
+ "5241915565655447143417214608859882029906947673313501950183867763"
+ "4716769334915718603906610534082604802668952109630465576440379371"
+ "4211205525428158285205572821025471431094380576457002725617553180"
+ "9099224738635444849469333898568030900459127277678319834121502677"
+ "4862108980363986101936076072301556410108193098230208064696671383"
+ "6302180548174253659674171315763029087322100208461549627978268407"
+ "4131669828524253718537846867047316790971834120489029738490102415"
+ "1863156959008792461225924284245693964036455110947393215135657241"
+ "099571834741510656385798938572406768798828125",
+ 1.1125369292536007e-308);
+ testParse(
+ "0.00000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000011125369292"
+ "5360093857793927928947412039400442434185191195972481664588256512"
+ "9400380600184308462011953048487227014291989141962100620081191046"
+ "1906239926662125432368943599250777752029021933482747432761666932"
+ "6081935177574213144751136884007361083502182696938981541236215812"
+ "4253211406611428748302338022108627812847664259678077865798649401"
+ "4497660229450268863966221848525061212023023248478571949013749179"
+ "6696380382410806898101889263285073571646568472249978339940677865"
+ "3579969652328069212208231432361613047099274956616864695216972981"
+ "6031069881591856241078866777972171115011992742603077167294249913"
+ "7481908755860441269310739102717418145889672225195380557264480249"
+ "9621987409855350817390775154421748273612200242960133979035379072"
+ "1007951555248028896005922474205893068160932603143782761509897584"
+ "8136843040991207538774075715754306035963544889052606784864342758"
+ "900428165258489343614201061427593231201171875",
+ 1.1125369292536007e-308);
+ testParse(
+ "0.00000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000011125369292"
+ "5360093857793927928947412039400442434185209780656501560598443019"
+ "9800348264895214610631442931951850683514095400858564803635595517"
+ "7563613706587576099527870021569402283901616688769940819588693664"
+ "4796230371146350565390269066985408266806482237247648947606094895"
+ "4539192629168295092589480939994257521375739131803801084021811015"
+ "5646350227416036982422856551956112981967804161220311948453638445"
+ "0933585272746375869932946624052008691141641256228975328278690955"
+ "1900432345580791435999485432364661072489848577335336019989599540"
+ "4580173812990192997712369923839430590047536255771881194801858107"
+ "5858649080057723021797656421627032209693226624526945688978404579"
+ "0239620254961370692713747131027132020441991845959370908649389667"
+ "01396213837722826145437693412532098591327667236328125",
+ 1.1125369292536007e-308);
+ testParse(
+ "0.00000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000011125369292"
+ "5360093857793927928947412039400442434185228365340521456608629527"
+ "0200315929606120759250932815416474352736201659755028987189999989"
+ "3220987486513026766686796443888026815774211444057134206415720396"
+ "3510525564718487986029401249963455450110781777556316353975973978"
+ "4825173851725161436876623857879887229903814003929524302244972629"
+ "6795040225381805100879491255387164751912585073962051947893527710"
+ "5170790163081944841764003984818943810636714040207972316616704045"
+ "0220895038833513659790739432367709097880422198053807344762226099"
+ "3129277744388529754345873069706690065083079768940685222309466301"
+ "4235389404255004774284573740536646273496781023858510820692328908"
+ "0857253100067390568036719107632515767271783448958607838263400261"
+ "9271291212296536333081616208300526650104600844121842238490102415"
+ "1863156959008792461225924284245693964036455110947393215135657241"
+ "099571834741510656385798938572406768798828125", //
+ 1.112536929253601e-308); //
+ testParse(
+ "0.00000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000011125369292"
+ "5360118561076219991274620867840085845253828033646632276836664299"
+ "2641598602648849715007375581870031501510285299140912526494460981"
+ "0847165486286558093401850075478792915405182640326963458817779503"
+ "7245335555582282368240205603137908586176939915496868313229764759"
+ "1124000199184152785288518003113540316961252461082144468115330795"
+ "7199474887142394939885133198483395703973441561868861946163298392"
+ "1387606100912602107790340074788347699109403186806482068455015628"
+ "7910121858986146810584652043706898739275890198932140639134272458"
+ "8610226818743277902588909094978089754671488747034246582989821731"
+ "5231929503948741694146154089862122073081814550155248444974062103"
+ "4794692806854507601076294922896618700391675086456429118934521521"
+ "5279242767544565229087538682506419718265533447265625",
+ 1.112536929253601e-308);
+ testParse(
+ "0.00000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000011125369292"
+ "5360118561076219991274620867840085845253846618330652172846850806"
+ "3041566267359755863626865465334655170732391558037376710048865452"
+ "6504539266212008760560776497797417447277777395614156845644806235"
+ "5959630749154419788879337786115955769481239455805535719599643842"
+ "1409981421741019129575660920999170025489327333207867686338492409"
+ "8348164885108163058341767901914447473918222474610601945603187657"
+ "5624810991248171079621397435555282818604475970785479056793028718"
+ "6230584552238869034375906043709946764666463819650611963906899017"
+ "7159330750141614659222412240845349229707032260203050610497429925"
+ "3608669828146023446633071408771736136885368949486813576687986432"
+ "5412325651960527476399266899502002447221466689455666048548532116"
+ "4410912596068818947625385549553736509237367567754654738490102415"
+ "1863156959008792461225924284245693964036455110947393215135657241"
+ "099571834741510656385798938572406768798828125",
+ 1.112536929253601e-308);
+ testParse(
+ "0.00000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000011125369292"
+ "5360143264358512053601829696279729256322427701952743097064699071"
+ "5082881275691578670763818348323588650284368938526796065798921972"
+ "8473343486060089420116903707069559015036153836596792711219838611"
+ "0980145546446076750451009956312361722243098053437420272483555539"
+ "7422826546643144133700412148347193404018690918234764633985688961"
+ "7603909548902984778890775141579626656034298049775671944433069073"
+ "7604422038743259373816676164757751587582092333404991820293327212"
+ "5599348679138779961378564655046088380671358199810473933506318818"
+ "4091175893098026050831945120249489444259897725127807943670177161"
+ "6228469603642478614007734439187597872666848076451986069255795298"
+ "8732132513641624634115870738160721633511566723954250399605642781"
+ "1287194322792594125093461156712312786426466050409407761509897584"
+ "8136843040991207538774075715754306035963544889052606784864342758"
+ "900428165258489343614201061427593231201171875",
+ 1.112536929253601e-308);
+ testParse(
+ "0.00000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000011125369292"
+ "5360143264358512053601829696279729256322446286636762993074885578"
+ "5482848940402484819383308231788212319506475197423260249353326444"
+ "4130717265985540087275830129388183546908748591883986098046865342"
+ "9694440740018214171090142139290408905547397593746087678853434622"
+ "7708807769200010477987555066232823112546765790360487852208850575"
+ "8752599546868752897347409845010678425979078962517411943872958339"
+ "1841626929078828345647733525524686707077165117383988808631340302"
+ "3919811372391502185169818655049136406061931820528945258278945377"
+ "2640279824496362807465448266116748919295441238296611971177785355"
+ "4605209927839760366494651758097211936470402475783551200969719627"
+ "9349765358747644509438842714766105380341358326953487329219653376"
+ "04188641513168478436313080237596295773983001708984375", //
+ 1.1125369292536017e-308); //
+ testParse(
+ "0.00000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000011125369292"
+ "5360143264358512053601829696279729256322464871320782889085072085"
+ "5882816605113390968002798115252835988728581456319724432907730915"
+ "9788091045910990754434756551706808078781343347171179484873892074"
+ "8408735933590351591729274322268456088851697134054755085223313705"
+ "7994788991756876822274697984118452821074840662486211070432012189"
+ "9901289544834521015804044548441730195923859875259151943312847604"
+ "6078831819414397317478790886291621826572237901362985796969353392"
+ "2240274065644224408961072655052184431452505441247416583051571936"
+ "1189383755894699564098951411984008394330984751465415998685393549"
+ "2981950252037042118981569077006826000273956875115116332683643956"
+ "9967398203853664384761814691371489127171149929952724258833663970"
+ "9550533979841101562169154890806946368370134291387467238490102415"
+ "1863156959008792461225924284245693964036455110947393215135657241"
+ "099571834741510656385798938572406768798828125", //
+ 1.1125369292536017e-308); //
+ testParse(
+ "0.00000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000022250738585"
+ "0720138309023271733240406421921598046233183055332741688720443481"
+ "3918195854283159012511020564067339731035811005152434161553460108"
+ "8560123853777188211307779935320023304796101474425836360719215650"
+ "4694250373420837525080665061665815894872049117996859163964850063"
+ "5908770118304874799780887753749949451580451605050915399856582470"
+ "8186451135379358049921159810857660519924333521143523901487956996"
+ "0959128889160299264151106346631339366347758651302937176204732563"
+ "1781485664350872122828637642044846811407613911477062801689853244"
+ "1100241614474216185671661505401542850847167529019031613227788967"
+ "2970737312333408698898317506783884692609277397797285865965494109"
+ "1369095406136467568702398678315290680984617210924625396728515625",
+ 2.2250738585072014e-308);
+ testParse(
+ "0.00000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000022250738585"
+ "0720138309023271733240406421921598046233201640016761584730629988"
+ "4318163518994065161130510447531963400257917264048898345107864580"
+ "4217497633702638878466706357638647836668696229713029747546242382"
+ "3408545566992974945719797244643863078176348658305526570334729146"
+ "6194751340861741144068030671635579160108526477176638618079744084"
+ "9335141133345126168377794514288712289869114433885263900927846261"
+ "5196333779495868235982163707398274485842831435281934164542745653"
+ "0101948357603594346619891642047894836798187532195534126462479802"
+ "9649345545872552942305164651268802325882711042187835640735397161"
+ "1347477636530690451385234825693498756412831797128850997679418438"
+ "1986728251242487444025370654920674427814408813923862326342526219"
+ "9131669828524253718537846867047316790971834120489029738490102415"
+ "1863156959008792461225924284245693964036455110947393215135657241"
+ "099571834741510656385798938572406768798828125",
+ 2.2250738585072014e-308);
+ testParse(
+ "0.00000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000022250738585"
+ "0720163012305563795567615250361241457301782723638852508948478253"
+ "6359478527325887968267463330520896879809894644538317700857921100"
+ "6186301853550719538022833566910789404427072670695665613121274757"
+ "8429060364284631907291469414840269030938207255937411123218640844"
+ "2207596465763866148192781898983602538637890062203535565726940636"
+ "8590885797139947888926801753953891471985190009050333899757727677"
+ "7175944826990956530177442436600743254820447797901446928043044146"
+ "9470712484503505273622550253384036452803081912355396096061899603"
+ "6581190688828964333914697530672942540435576507112592973908144397"
+ "3967277412027145618759897856109360492194310924094023490247227304"
+ "5306535112923584601741974493579393614104508848422446677399636884"
+ "6007951555248028896005922474205893068160932603143782761509897584"
+ "8136843040991207538774075715754306035963544889052606784864342758"
+ "900428165258489343614201061427593231201171875",
+ 2.2250738585072014e-308);
+ testParse(
+ "0.00000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000022250738585"
+ "0720163012305563795567615250361241457301801308322872404958664760"
+ "6759446192036794116886953213985520549032000903434781884412325572"
+ "1843675633476170205181759989229413936299667425982858999948301489"
+ "7143355557856769327930601597818316214242506796246078529588519927"
+ "2493577688320732492479924816869232247165964934329258783950102250"
+ "9739575795105716007383436457384943241929970921792073899197616943"
+ "1413149717326525502008499797367678374315520581880443916381057236"
+ "7791175177756227497413804253387084478193655533073867420834526162"
+ "5130294620227301090548200676540202015471120020281397001415752591"
+ "2344017736224427371246815175018974555997865323425588621961151633"
+ "5924167958029604477064946470184777360934300451421683607013647479"
+ "51396213837722826145437693412532098591327667236328125",
+ 2.2250738585072014e-308);
+ testParse(
+ "0.00000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000022250738585"
+ "0720163012305563795567615250361241457301819893006892300968851267"
+ "7159413856747700265506443097450144218254107162331246067966730043"
+ "7501049413401620872340686411548038468172262181270052386775328221"
+ "5857650751428906748569733780796363397546806336554745935958399010"
+ "2779558910877598836767067734754861955694039806454982002173263865"
+ "0888265793071484125840071160815995011874751834533813898637506208"
+ "5650354607662094473839557158134613493810593365859440904719070326"
+ "6111637871008949721205058253390132503584229153792338745607152721"
+ "3679398551625637847181703822407461490506663533450201028923360785"
+ "0720758060421709123733732493928588619801419722757153753675075962"
+ "6541800803135624352387918446790161107764092054420920536627658074"
+ "4271291212296536333081616208300526650104600844121842238490102415"
+ "1863156959008792461225924284245693964036455110947393215135657241"
+ "099571834741510656385798938572406768798828125", //
+ 2.225073858507202e-308); //
+ testParse(
+ "0.00000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000022250738585"
+ "0720187715587855857894824078800884868370419561313003121196886039"
+ "9600696529790429221262885863903701367028190801717129607271191035"
+ "5127227413175152199055740043138804567803233377539881639177387328"
+ "9592460742292701130780538133970816533612964474495297895212189790"
+ "9078385258336590185178961879988515042751478263607602168043622031"
+ "1292700454832073964845713103912225963935608322440623896907276890"
+ "1867170545492751739865893248104017382283282512457950656557381910"
+ "3800864691161582871998970864729322144979697154670672039979199080"
+ "9160347625980385995424739847678861180095072511543762389603716215"
+ "1717298160115446043595312843254064419386453249053891377956809158"
+ "0479240509922741385427494262054264040883983691918741817298779334"
+ "0279242767544565229087538682506419718265533447265625",
+ 2.225073858507202e-308);
+ testParse(
+ "0.00000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000022250738585"
+ "0720187715587855857894824078800884868370438145997023017207072547"
+ "0000664194501335369882375747368325036250297060613593790825595507"
+ "0784601193100602866214666465457429099675828132827075026004414060"
+ "8306755935864838551419670316948863716917264014803965301582068873"
+ "9364366480893456529466104797874144751279553135733325386266783645"
+ "2441390452797842083302347807343277733880389235182363896347166155"
+ "6104375435828320711696950608870952501778355296436947644895395000"
+ "2121327384414305095790224864732370170370270775389143364751825639"
+ "7709451557378722752058242993546120655130616024712566417111324409"
+ "0094038484312727796082230162163678483190007648385456509670733487"
+ "1096873355028761260750466238659647787713775294917978746912789928"
+ "9410912596068818947625385549553736509237367567754654738490102415"
+ "1863156959008792461225924284245693964036455110947393215135657241"
+ "099571834741510656385798938572406768798828125",
+ 2.225073858507202e-308);
+ testParse(
+ "0.00000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000022250738585"
+ "0720212418870147920222032907240528279439019229619113941424920812"
+ "2041979202833158177019328630357258515802274441103013146575652027"
+ "2753405412948683525770793674729570667434204573809710891579446436"
+ "3327270733156495512991342487145269669679122612435849854465980571"
+ "5377211605795581533590856025222168129808916720760222333913980197"
+ "1697135116592663803851355047008456915996464810347433895177047571"
+ "8083986483323409005892229338073421270755971659056460408395693494"
+ "1490091511314216022792883476068511786375165155549005334351245440"
+ "4641296700335134143667775872950260869683481489637323750284071645"
+ "2713838259809182963456893192579540218971486775350629002238542353"
+ "4416680216709858418467070077318366974003875329416563097969900593"
+ "6287194322792594125093461156712312786426466050409407761509897584"
+ "8136843040991207538774075715754306035963544889052606784864342758"
+ "900428165258489343614201061427593231201171875",
+ 2.225073858507202e-308);
+ testParse(
+ "0.00000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000022250738585"
+ "0720212418870147920222032907240528279439037814303133837435107319"
+ "2441946867544064325638818513821882185024380699999477330130056498"
+ "8410779192874134192929720097048195199306799329096904278406473168"
+ "2041565926728632933630474670123316852983422152744517260835859654"
+ "5663192828352447877877998943107797838336991592885945552137141811"
+ "2845825114558431922307989750439508685941245723089173894616936837"
+ "2321191373658977977723286698840356390251044443035457396733706583"
+ "9810554204566938246584137476071559811765738776267476659123871999"
+ "3190400631733470900301279018817520344719025002806127777791679839"
+ "1090578584006464715943810511489154282775041174682194133952466682"
+ "5034313061815878293790042053923750720833666932415800027583911188"
+ "54188641513168478436313080237596295773983001708984375", //
+ 2.2250738585072024e-308); //
+ testParse(
+ "0.00000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000022250738585"
+ "0720212418870147920222032907240528279439056398987153733445293826"
+ "2841914532254970474258308397286505854246486958895941513684460970"
+ "4068152972799584860088646519366819731179394084384097665233499900"
+ "0755861120300770354269606853101364036287721693053184667205738737"
+ "5949174050909314222165141860993427546865066465011668770360303425"
+ "3994515112524200040764624453870560455886026635830913894056826102"
+ "6558396263994546949554344059607291509746117227014454385071719673"
+ "8131016897819660470375391476074607837156312396985947983896498558"
+ "1739504563131807656934782164684779819754568515974931805299288032"
+ "9467318908203746468430727830398768346578595574013759265666391011"
+ "5651945906921898169113014030529134467663458535415036957197921783"
+ "4550533979841101562169154890806946368370134291387467238490102415"
+ "1863156959008792461225924284245693964036455110947393215135657241"
+ "099571834741510656385798938572406768798828125", //
+ 2.2250738585072024e-308); //
+ testParse(
+ "0.00000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000100208418000448638899805402"
+ "5675081023947173151201955956352756465219477298834774949553868001"
+ "7172354813827222283890479851867436841402279176933922227531985191"
+ "9016883548022442028316027357265612083085166971723487691494714589"
+ "5578331812936322386545483369746322848628024994920311121080242823"
+ "5714326388663336759990619917681011604908667604621058852897083245"
+ "0816977893343649540492907374306035456728456338904015275857972276"
+ "1526157631250497160973795706924168310120033199859199012414074894"
+ "8202195091387650850548954516920927386376492603899633528627985383"
+ "2932104496700123254769405070337764094630065313795728259355401668"
+ "8207267296623786504114239553488532354086348874488976434804499149"
+ "322509765625",
+ 1.0020841800044864e-292);
+ testParse(
+ "0.00000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000100208418000448638899805402"
+ "5675081023947173151201956040050732492021560444211472901925540702"
+ "1586014286915762763038748010206109436411449756840422987132589595"
+ "3085274649978096343836685185731606312366412920027708756586099963"
+ "7975552653362983131506665648352778744386705639822064232334712197"
+ "7867779247842315182877112028658635902319185766818606103345104073"
+ "9923514010434512590195330770391813338086311968111531328662618487"
+ "3315578521649250253839821623536466419018719481428679013982985346"
+ "1571995354000952600076951720089726239270930511481845755671197870"
+ "4747866889418540057514218596081876158765839665014133210631738825"
+ "4165335079883777074977685931654819161553596657523084699300803458"
+ "3609637179288099118793858900152420545987239088654699259390735847"
+ "0152049332041520812604025151794328168042160636342216519487980314"
+ "421878240614097350935640662328296457417309284210205078125",
+ 1.0020841800044864e-292);
+ testParse(
+ "0.00000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000100208418000448650025174695"
+ "1035150178458809017822159083615579461533985681124447841542417041"
+ "9717793267880261310997721975562434111911014099603638548708110842"
+ "9228554372955381818449259496459629506201971760632184806762937040"
+ "5528236159220080404124633621972774900305368909016987591808198481"
+ "1515258588636795736994571683578362033288375244948969302377353651"
+ "5803667343942465515751063883649087835332767470268261173797304563"
+ "0216301185431893700183322963627539884395226243941187598947530725"
+ "0723137660949785162435276134774551939185861652055952702429699518"
+ "1666462911218814544860422297294423455917874727086839114692958995"
+ "8734568169530500282699951928714187892923739790353511103290941894"
+ "8525105836280134665557340439005224794505069516807613438973521965"
+ "4847950667958479187395974848205671831957839363657783480512019685"
+ "578121759385902649064359337671703542582690715789794921875",
+ 1.0020841800044864e-292);
+ testParse(
+ "0.00000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000100208418000448650025174695"
+ "1035150178458809017822159167313555488336068826501145793914089742"
+ "4131452740968801790145990133901106706920184679510139308308715246"
+ "3296945474911036133969917324925623735483217708936405871854322414"
+ "7925456999646741149085815900579230796064049553918740703062667855"
+ "3668711447815774159881063794555986330698893407146516552825374480"
+ "4910203461033328565453487279734865716690623099475777226601950774"
+ "2005722075830646793049348880239837993293912525510667600516441176"
+ "4092937923563086911963273337943350792080299559638164929472912005"
+ "3482225303937231347605235823038535520053649078305244065969296152"
+ "4692635952790490853563398306880474700390987573387619367787246203"
+ "8909645359318233784351199339157645340492308605462312698364257812"
+ "5",
+ 1.0020841800044864e-292);
+ testParse(
+ "0.00000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000100208418000448650025174695"
+ "1035150178458809017822159251011531515138151971877843746285762442"
+ "8545112214057342269294258292239779301929355259416640067909319649"
+ "7365336576866690449490575153391617964764463657240626936945707789"
+ "0322677840073401894046998179185686691822730198820493814317137229"
+ "5822164306994752582767555905533610628109411569344063803273395309"
+ "4016739578124191615155910675820643598048478728683293279406596985"
+ "3795142966229399885915374796852136102192598807080147602085351627"
+ "7462738186176388661491270541112149644974737467220377156516124492"
+ "5297987696655648150350049348782647584189423429523649017245633309"
+ "0650703736050481424426844685046761507858235356421727632283550512"
+ "9294184882356332903145058239310065886479547694117011957754993659"
+ "5152049332041520812604025151794328168042160636342216519487980314"
+ "421878240614097350935640662328296457417309284210205078125", //
+ 1.0020841800044866e-292); //
+ testParse(
+ "0.00000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000200416836000897255548872220"
+ "0630023738871074569163505490783914884205771542336808210387292522"
+ "0426513773371285555269939139667533951768747348715410293510510274"
+ "9473643242267695845324274779211200861374232469021139022270213528"
+ "6462413252451807248010301677826829802384000871843763078195635583"
+ "5519882659021798720200352081612073758236883604191202305937584019"
+ "3447504651307941031064654937754410393532579156664506650227987556"
+ "2093186373340695057796485067216997253892307748415460848623417226"
+ "4622904518424429578269271391797007961345371296322204255566117522"
+ "4763967378926030323867148635273985338412963098572424905483014370"
+ "3443797280914164309330161600193180015563420351180667003643504189"
+ "5081099906363532431297601321684709319015382789075374603271484375",
+ 2.0041683600089726e-292);
+ testParse(
+ "0.00000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000200416836000897255548872220"
+ "0630023738871074569163505574481890911007854687713506162758965222"
+ "4840173246459826034418207298006206546777917928621911053111114678"
+ "3542034344223350160844932607677195090655478417325360087361598902"
+ "8859634092878467992971483956433285698142681516745516189450104957"
+ "7673335518200777143086844192589698055647401766388749556385604848"
+ "2554040768398804080767078333840188274890434785872022703032633767"
+ "3882607263739448150662510983829295362790994029984940850192327677"
+ "7992704781037731327797268594965806814239809203904416482609330009"
+ "6579729771644447126611962161018097402548737449790829856759351526"
+ "9401865064174154880193607978359466823030668134214775268139808498"
+ "5465639429401631550091460221837129865002621877730073862662220222"
+ "0152049332041520812604025151794328168042160636342216519487980314"
+ "421878240614097350935640662328296457417309284210205078125",
+ 2.0041683600089726e-292);
+ testParse(
+ "0.00000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000200416836000897266674241512"
+ "5990092893382710435783708618046737880520279924626481102375841562"
+ "2971952227424324582377181263362531222277482271385126614686635925"
+ "9685314067200635635457506918405218284491037257929836137538435979"
+ "6412317598735565265589451930053281854061344785940439548923591241"
+ "1320814858995257697204303847509424186616591244519112755417854425"
+ "8434194101906757006322811447097462772136890288028752548167319843"
+ "0783329927522091597006012323920368828167500792497449435156873056"
+ "7143847087986563890155593009650632514154740344478523429367831657"
+ "3498325793444721613958165862230644699700772511863535760820571697"
+ "3971098153820878087915873975418835554400811267045201672129946935"
+ "0381108086393667096854941760689934113520452305882988042245006340"
+ "4847950667958479187395974848205671831957839363657783480512019685"
+ "578121759385902649064359337671703542582690715789794921875",
+ 2.0041683600089726e-292);
+ testParse(
+ "0.00000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000200416836000897266674241512"
+ "5990092893382710435783708701744713907322363070003179054747514262"
+ "7385611700512865061525449421701203817286652851291627374287240329"
+ "3753705169156289950978164746871212513772283206234057202629821353"
+ "8809538439162226010550634208659737749820025430842192660178060615"
+ "3474267718174236120090795958487048484027109406716660005865875254"
+ "7540730218997620056025234843183240653494745917236268600971966054"
+ "2572750817920844689872038240532666937066187074066929436725783508"
+ "0513647350599865639683590212819431367049178252060735656411044144"
+ "5314088186163138416702979387974756763836546863081940712096908853"
+ "9929165937080868658779320353585122361868059050079309936626251244"
+ "0765647609431766215648800660842354659507691394537687301635742187"
+ "5", //
+ 2.004168360008973e-292); //
+ testParse(
+ "0.00000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000000000000000000000000000000"
+ "0000000000000000000000000000000000000200416836000897266674241512"
+ "5990092893382710435783708785442689934124446215379877007119186963"
+ "1799271173601405540673717580039876412295823431198128133887844732"
+ "7822096271111944266498822575337206743053529154538278267721206728"
+ "1206759279588886755511816487266193645578706075743945771432529989"
+ "5627720577353214542977288069464672781437627568914207256313896083"
+ "6647266336088483105727658239269018534852601546443784653776612265"
+ "4362171708319597782738064157144965045964873355636409438294693959"
+ "3883447613213167389211587415988230219943616159642947883454256631"
+ "7129850578881555219447792913718868827972321214300345663373246010"
+ "5887233720340859229642766731751409169335306833113418201122555553"
+ "1150187132469865334442659560994775205494930483192386561026478034"
+ "5152049332041520812604025151794328168042160636342216519487980314"
+ "421878240614097350935640662328296457417309284210205078125", //
+ 2.004168360008973e-292); //
+ testParse("0.99999999999999988897769753748434595763683319091796875",
+ 0.9999999999999999);
+ testParse(
+ "0.99999999999999988897769753748434595763683319091796879176194859"
+ "5190556970945882299241904356487451251641385905655273315006228765"
+ "423911854226535211864757002331316471099853515625",
+ 0.9999999999999999);
+ testParse(
+ "0.99999999999999994448884876874217297881841659545898433323805140"
+ "4809443029054117700758095643512548748358614094344726684993771234"
+ "576088145773464788135242997668683528900146484375",
+ 0.9999999999999999);
+ testParse("0.999999999999999944488848768742172978818416595458984375", 1.0); //
+ testParse(
+ "0.99999999999999994448884876874217297881841659545898441676194859"
+ "5190556970945882299241904356487451251641385905655273315006228765"
+ "423911854226535211864757002331316471099853515625", //
+ 1.0); //
+ testParse("0.499999999999999944488848768742172978818416595458984375",
+ 0.49999999999999994);
+ testParse(
+ "0.49999999999999994448884876874217297881841659545898439588097429"
+ "7595278485472941149620952178243725625820692952827636657503114382"
+ "7119559271132676059323785011656582355499267578125",
+ 0.49999999999999994);
+ testParse(
+ "0.49999999999999997224442438437108648940920829772949216661902570"
+ "2404721514527058850379047821756274374179307047172363342496885617"
+ "2880440728867323940676214988343417644500732421875",
+ 0.49999999999999994);
+ testParse(
+ "0.4999999999999999722444243843710864894092082977294921875", 0.5); //
+ testParse(
+ "0.49999999999999997224442438437108648940920829772949220838097429"
+ "7595278485472941149620952178243725625820692952827636657503114382"
+ "7119559271132676059323785011656582355499267578125", //
+ 0.5); //
+ testParse("1.9999999999999997779553950749686919152736663818359375",
+ 1.9999999999999998);
+ testParse(
+ "1.99999999999999977795539507496869191527366638183593758352389719"
+ "0381113941891764598483808712974902503282771811310546630012457530"
+ "84782370845307042372951400466263294219970703125",
+ 1.9999999999999998);
+ testParse(
+ "1.99999999999999988897769753748434595763683319091796866647610280"
+ "9618886058108235401516191287025097496717228188689453369987542469"
+ "15217629154692957627048599533736705780029296875",
+ 1.9999999999999998);
+ testParse("1.99999999999999988897769753748434595763683319091796875", 2.0); //
+ testParse(
+ "1.99999999999999988897769753748434595763683319091796883352389719"
+ "0381113941891764598483808712974902503282771811310546630012457530"
+ "84782370845307042372951400466263294219970703125", //
+ 2.0); //
+ testParse("4503599627370495.5", 4503599627370495.5);
+ testParse(
+ "4503599627370495.50000000000000000000000000000000000018807909613"
+ "1566001274997845955559308450986489083534003441400273004546761512"
+ "75634765625",
+ 4503599627370495.5);
+ testParse(
+ "4503599627370495.74999999999999999999999999999999999981192090386"
+ "8433998725002154044440691549013510916465996558599726995453238487"
+ "24365234375",
+ 4503599627370495.5);
+ testParse("4503599627370495.75", 4503599627370496.0);
+ testParse(
+ "4503599627370495.75000000000000000000000000000000000018807909613"
+ "1566001274997845955559308450986489083534003441400273004546761512"
+ "75634765625",
+ 4503599627370496.0);
+ testParse("4503599627370496", 4503599627370496.0);
+ testParse(
+ "4503599627370496.00000000000000000000000000000000000037615819226"
+ "3132002549995691911118616901972978167068006882800546009093523025"
+ "5126953125",
+ 4503599627370496.0);
+ testParse(
+ "4503599627370496.49999999999999999999999999999999999962384180773"
+ "6867997450004308088881383098027021832931993117199453990906476974"
+ "4873046875",
+ 4503599627370496.0);
+ testParse("4503599627370496.5", 4503599627370496.0);
+ testParse(
+ "4503599627370496.50000000000000000000000000000000000037615819226"
+ "3132002549995691911118616901972978167068006882800546009093523025"
+ "5126953125",
+ 4503599627370497.0);
+ testParse("9007199254740991", 9007199254740991.0);
+ testParse(
+ "9007199254740991.00000000000000000000000000000000000037615819226"
+ "3132002549995691911118616901972978167068006882800546009093523025"
+ "5126953125",
+ 9007199254740991.0);
+ testParse(
+ "9007199254740991.49999999999999999999999999999999999962384180773"
+ "6867997450004308088881383098027021832931993117199453990906476974"
+ "4873046875",
+ 9007199254740991.0);
+ testParse("9007199254740991.5", 9007199254740992.0);
+ testParse(
+ "9007199254740991.50000000000000000000000000000000000037615819226"
+ "3132002549995691911118616901972978167068006882800546009093523025"
+ "5126953125",
+ 9007199254740992.0);
+ testParse(
+ "1797693134862315708145274237317043567980705675258449965989174768"
+ "0315726078002853876058955863276687817154045895351438246423432132"
+ "6889464182768467546703537516986049910576551282076245490090389328"
+ "9440758685084551339423045832369032229481658085593321233482747978"
+ "26204144723168738177180919299881250404026184124858368",
+ 1.7976931348623157e+308);
+ testParse(
+ "1797693134862315708145274237317043567980705675258450041064343056"
+ "0785749075118623426984641994452647172104399563141377322686588394"
+ "6121172130178666127034918365540069095282013901258936156392632590"
+ "7055367751483602939820315058278058002847941584484775356682545657"
+ "44106770877499077221865536419145864291265781790932992",
+ 1.7976931348623157e+308);
+ testParse(
+ "1797693134862315807937289714053034150799341327100378194286569501"
+ "7574473832160705543739215666582761354682674973879349714831499292"
+ "8620232455220458908340124972127889717295245764493583188543574449"
+ "7703035690903649098158444443687202655781915109457910629727393062"
+ "50541739356374003666875082388828428992938306508423168",
+ 1.7976931348623157e+308);
+ testParse(
+ "1797693134862315807937289714053034150799341327100378269361737789"
+ "8044496829276475094664901797758720709633028641669288791094655554"
+ "7851940402630657488671505820681908902000708383676273854845817711"
+ "5317644757302700698555713669596228429148198608349364752927190741"
+ "68444365510704342711559699508093042880177904174497792",
+ double.INFINITY);
+ testParse(
+ "1797693134862315807937289714053034150799341327100378344436906077"
+ "8514519826392244645590587928934680064583382309459227867357811816"
+ "7083648350040856069002886669235928086706171002858964521148060973"
+ "2932253823701752298952982895505254202514482107240818876126988420"
+ "86346991665034681756244316627357656767417501840572416",
+ double.INFINITY);
+
+ // Edge cases of algorithm (e+-22/23).
+ testParse("1e22", 1e22);
+ testParse("1e23", 1e23);
+ testParse("1e-22", 1e-22);
+ testParse("1e-23", 1e-23);
+
+ testParseWhitespace("1", 1.0);
+ testParseWhitespace("1.0", 1.0);
+ testParseWhitespace("1e1", 10.0);
+ testParseWhitespace(".1e1", 1.0);
+ testParseWhitespace("1.e1", 10.0);
+ testParseWhitespace("1e+1", 10.0);
+ testParseWhitespace("1e-1", 0.1);
+
+ // Negative tests - things not to allow.
+
+ // Spaces inside the numeral.
+ testFail("- 1");
+ testFail("+ 1");
+ testFail("2 2");
+ testFail("1 .");
+ testFail(". 1");
+ testFail("1e 2");
+ testFail("1 e2");
+ // Invalid characters.
+ testFail("0x0");
+ testFail("0x1H");
+ testFail("12H");
+ testFail("1x2");
+ testFail("00x2");
+ testFail("0x2.2");
+ // Double exponent without value.
+ testFail(".e1");
+ testFail("e1");
+ testFail("e+1");
+ testFail("e-1");
+ testFail("-e1");
+ testFail("-e+1");
+ testFail("-e-1");
+ // Too many signs.
+ testFail("--1");
+ testFail("-+1");
+ testFail("+-1");
+ testFail("++1");
+ // Incorrect ways to write NaN/Infinity.
+ testFail("infinity");
+ testFail("INFINITY");
+ testFail("1.#INF");
+ testFail("inf");
+ testFail("nan");
+ testFail("NAN");
+ testFail("1.#IND");
+ testFail("indef");
+ testFail("qnan");
+ testFail("snan");
+}
diff --git a/tests/corelib_2/dynamic_nosuchmethod_test.dart b/tests/corelib_2/dynamic_nosuchmethod_test.dart
index b84c9d6..730cdbb 100644
--- a/tests/corelib_2/dynamic_nosuchmethod_test.dart
+++ b/tests/corelib_2/dynamic_nosuchmethod_test.dart
@@ -76,4 +76,10 @@
Expect.throwsNoSuchMethodError(() => f.toLocaleString);
Expect.throwsNoSuchMethodError(() => f.hasOwnProperty);
+
+ f = (int x) {};
+ // Calls with the wrong number of arguments should be NoSuchMethodErrors.
+ Expect.throwsNoSuchMethodError(() => f());
+ Expect.throwsNoSuchMethodError(() => f('hi', '!'));
+ Expect.throwsNoSuchMethodError(() => f(x: 42));
}
diff --git a/tests/corelib_2/int_try_parse_test.dart b/tests/corelib_2/int_try_parse_test.dart
new file mode 100644
index 0000000..eb1fc86
--- /dev/null
+++ b/tests/corelib_2/int_try_parse_test.dart
@@ -0,0 +1,129 @@
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import "package:expect/expect.dart";
+import "dart:math" show pow, log;
+
+void main() {
+ const String oneByteWhiteSpace = "\x09\x0a\x0b\x0c\x0d\x20\xa0";
+ const String whiteSpace = "$oneByteWhiteSpace\u1680"
+ "\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a"
+ "\u2028\u2029\u202f\u205f\u3000\ufeff";
+
+ var digits = "0123456789abcdefghijklmnopqrstuvwxyz";
+ var zeros = "0" * 64;
+
+ for (int i = 0; i < whiteSpace.length; i++) {
+ var ws = whiteSpace[i];
+ Expect.equals(0, int.parse("${ws}0${ws}", radix: 2));
+ }
+
+ void testParse(int result, String radixString, int radix) {
+ var m = "$radixString/$radix->$result";
+ Expect.equals(
+ result, int.tryParse(radixString.toLowerCase(), radix: radix), m);
+ Expect.equals(
+ result, int.tryParse(radixString.toUpperCase(), radix: radix), m);
+ Expect.equals(result, int.tryParse(" $radixString", radix: radix), m);
+ Expect.equals(result, int.tryParse("$radixString ", radix: radix), m);
+ Expect.equals(result, int.tryParse(" $radixString ", radix: radix), m);
+ Expect.equals(result, int.tryParse("+$radixString", radix: radix), m);
+ Expect.equals(result, int.tryParse(" +$radixString", radix: radix), m);
+ Expect.equals(result, int.tryParse("+$radixString ", radix: radix), m);
+ Expect.equals(result, int.tryParse(" +$radixString ", radix: radix), m);
+ Expect.equals(-result, int.tryParse("-$radixString", radix: radix), m);
+ Expect.equals(-result, int.tryParse(" -$radixString", radix: radix), m);
+ Expect.equals(-result, int.tryParse("-$radixString ", radix: radix), m);
+ Expect.equals(-result, int.tryParse(" -$radixString ", radix: radix), m);
+ Expect.equals(
+ result,
+ int.tryParse("$oneByteWhiteSpace$radixString$oneByteWhiteSpace",
+ radix: radix),
+ m);
+ Expect.equals(
+ -result,
+ int.tryParse("$oneByteWhiteSpace-$radixString$oneByteWhiteSpace",
+ radix: radix),
+ m);
+ Expect.equals(result,
+ int.tryParse("$whiteSpace$radixString$whiteSpace", radix: radix), m);
+ Expect.equals(-result,
+ int.tryParse("$whiteSpace-$radixString$whiteSpace", radix: radix), m);
+
+ Expect.equals(result, int.tryParse("$zeros$radixString", radix: radix), m);
+ Expect.equals(result, int.tryParse("+$zeros$radixString", radix: radix), m);
+ Expect.equals(
+ -result, int.tryParse("-$zeros$radixString", radix: radix), m);
+ }
+
+ for (int r = 2; r <= 36; r++) {
+ for (int i = 0; i <= r * r; i++) {
+ String radixString = i.toRadixString(r);
+ testParse(i, radixString, r);
+ }
+ for (var v in [
+ 0,
+ 0x10000,
+ 0x7FFFFFFF,
+ 0x80000000,
+ 0xFFFFFFFF,
+ 0x100000000,
+ 0x7FFFFFFFFFFFF8,
+ ]) {
+ var string = v.toRadixString(r);
+ Expect.equals(v, int.tryParse(string, radix: r));
+ if (v > 0) {
+ Expect.equals(-v, int.tryParse("-$string", radix: r));
+ if (r == 16) {
+ Expect.equals(v, int.tryParse("0x$string"));
+ Expect.equals(v, int.tryParse("0X$string"));
+ }
+ }
+ }
+ }
+
+ // Allow both upper- and lower-case letters.
+ Expect.equals(0xABCD, int.tryParse("ABCD", radix: 16));
+ Expect.equals(0xABCD, int.tryParse("abcd", radix: 16));
+ Expect.equals(15628859, int.tryParse("09azAZ", radix: 36));
+ // Big numbers (representable as both Int64 and double).
+ Expect.equals(9223372036854774784, int.tryParse("9223372036854774784"));
+ Expect.equals(-9223372036854775808, int.tryParse("-9223372036854775808"));
+ // Allow whitespace before and after the number.
+ Expect.equals(1, int.tryParse(" 1", radix: 2));
+ Expect.equals(1, int.tryParse("1 ", radix: 2));
+ Expect.equals(1, int.tryParse(" 1 ", radix: 2));
+ Expect.equals(1, int.tryParse("\n1", radix: 2));
+ Expect.equals(1, int.tryParse("1\n", radix: 2));
+ Expect.equals(1, int.tryParse("\n1\n", radix: 2));
+ Expect.equals(1, int.tryParse("+1", radix: 2));
+
+ void testFails(String source, int radix) {
+ Expect.isNull(int.tryParse(source, radix: radix));
+ }
+
+ for (int i = 2; i < 36; i++) {
+ var char = i.toRadixString(36);
+ testFails(char.toLowerCase(), i);
+ testFails(char.toUpperCase(), i);
+ }
+ testFails("", 2);
+ testFails("+ 1", 2); // No space between sign and digits.
+ testFails("- 1", 2); // No space between sign and digits.
+ testFails("0x", null);
+ for (int i = 2; i <= 33; i++) {
+ // No 0x specially allowed.
+ // At radix 34 and above, "x" is a valid digit.
+ testFails("0x10", i);
+ }
+ int digitX = 33;
+ Expect.equals(((digitX * 34) + 1) * 34, int.tryParse("0x10", radix: 34));
+ Expect.equals(((digitX * 35) + 1) * 35, int.tryParse("0x10", radix: 35));
+
+ // Radix must be in the range 2 .. 36.
+ Expect.throwsArgumentError(() => int.tryParse("0", radix: -1));
+ Expect.throwsArgumentError(() => int.tryParse("0", radix: 0));
+ Expect.throwsArgumentError(() => int.tryParse("0", radix: -1));
+ Expect.throwsArgumentError(() => int.tryParse("0", radix: 37));
+}
diff --git a/tests/corelib_2/num_try_parse_test.dart b/tests/corelib_2/num_try_parse_test.dart
new file mode 100644
index 0000000..edf2a5b
--- /dev/null
+++ b/tests/corelib_2/num_try_parse_test.dart
@@ -0,0 +1,222 @@
+// 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";
+
+const whiteSpace = const [
+ "",
+ "\x09",
+ "\x0a",
+ "\x0b",
+ "\x0c",
+ "\x0d",
+ "\xa0",
+ "\u1680",
+ "\u2000",
+ "\u2001",
+ "\u2002",
+ "\u2003",
+ "\u2004",
+ "\u2005",
+ "\u2006",
+ "\u2007",
+ "\u2008",
+ "\u2009",
+ "\u200a",
+ "\u2028",
+ "\u2029",
+ "\u202f",
+ "\u205f",
+ "\u3000",
+ "\uFEFF"
+];
+
+void expectNumEquals(num expect, num actual, String message) {
+ if (expect is double && expect.isNaN) {
+ Expect.isTrue(actual is double && actual.isNaN, "isNaN: $message");
+ } else {
+ Expect.identical(expect, actual, message);
+ }
+}
+
+// Test source surrounded by any combination of whitespace.
+void testParseAllWhitespace(String source, num result) {
+ for (String ws1 in whiteSpace) {
+ for (String ws2 in whiteSpace) {
+ String padded = "$ws1$source$ws2";
+ // Use Expect.identical because it also handles NaN and 0.0/-0.0.
+ // Except on dart2js: http://dartbug.com/11551
+ expectNumEquals(result, num.parse(padded), "parse '$padded'");
+ padded = "$ws1$ws2$source";
+ expectNumEquals(result, num.parse(padded), "parse '$padded'");
+ padded = "$source$ws1$ws2";
+ expectNumEquals(result, num.parse(padded), "parse '$padded'");
+ }
+ }
+}
+
+// Test source and -source surrounded by any combination of whitespace.
+void testParseWhitespace(String source, num result) {
+ assert(result >= 0);
+ testParseAllWhitespace(source, result);
+ testParseAllWhitespace("-$source", -result);
+}
+
+void testParse(String source, num result) {
+ expectNumEquals(result, num.tryParse(source), "parse '$source'");
+ expectNumEquals(result, num.tryParse(" $source"), "parse ' $source'");
+ expectNumEquals(result, num.tryParse("$source "), "parse '$source '");
+ expectNumEquals(result, num.tryParse(" $source "), "parse ' $source '");
+}
+
+// Test parsing an integer in decimal or hex format, with or without signs.
+void testInt(int value) {
+ testParse("$value", value);
+ testParse("+$value", value);
+ testParse("-$value", -value);
+ var hex = "0x${value.toRadixString(16)}";
+ var lchex = hex.toLowerCase();
+ testParse(lchex, value);
+ testParse("+$lchex", value);
+ testParse("-$lchex", -value);
+ var uchex = hex.toUpperCase();
+ testParse(uchex, value);
+ testParse("+$uchex", value);
+ testParse("-$uchex", -value);
+}
+
+// Test parsing an integer, and the integers just around it.
+void testIntAround(int value) {
+ testInt(value - 1);
+ testInt(value);
+ testInt(value + 1);
+}
+
+void testDouble(double value) {
+ testParse("$value", value);
+ testParse("+$value", value);
+ testParse("-$value", -value);
+ if (value.isFinite) {
+ String exp = value.toStringAsExponential();
+ String lcexp = exp.toLowerCase();
+ testParse(lcexp, value);
+ testParse("+$lcexp", value);
+ testParse("-$lcexp", -value);
+ String ucexp = exp.toUpperCase();
+ testParse(ucexp, value);
+ testParse("+$ucexp", value);
+ testParse("-$ucexp", -value);
+ }
+}
+
+void testFail(String source) {
+ Expect.isNull(num.tryParse(source));
+}
+
+void main() {
+ testInt(0);
+ testInt(1);
+ testInt(9);
+ testInt(10);
+ testInt(99);
+ testInt(100);
+ testIntAround(256);
+ testIntAround(0x80000000); // 2^31
+ testIntAround(0x100000000); // 2^32
+ testIntAround(0x10000000000000); // 2^52
+ testIntAround(0x1FFFFFFFFFFFFF); // 2^53 - 1
+
+ testDouble(0.0);
+ testDouble(5e-324);
+ testDouble(2.225073858507201e-308);
+ testDouble(2.2250738585072014e-308);
+ testDouble(0.49999999999999994);
+ testDouble(0.5);
+ testDouble(0.50000000000000006);
+ testDouble(0.9999999999999999);
+ testDouble(1.0);
+ testDouble(1.0000000000000002);
+ testDouble(4294967295.0);
+ testDouble(4294967296.0);
+ testDouble(4503599627370495.5);
+ testDouble(4503599627370497.0);
+ testDouble(9007199254740991.0);
+ testDouble(9007199254740992.0);
+ testDouble(1.7976931348623157e+308);
+ testDouble(double.infinity);
+ testDouble(double.nan);
+
+ // Strings that cannot occur from toString of a number.
+ testParse("000000000000", 0);
+ testParse("000000000001", 1);
+ testParse("000000000000.0000000000000", 0.0);
+ testParse("000000000001.0000000000000", 1.0);
+ testParse("0x0000000000", 0);
+ testParse("0e0", 0.0);
+ testParse("0e+0", 0.0);
+ testParse("0e-0", 0.0);
+ testParse("-0e0", -0.0);
+ testParse("-0e+0", -0.0);
+ testParse("-0e-0", -0.0);
+ testParse("1e0", 1.0);
+ testParse("1e+0", 1.0);
+ testParse("1e-0", 1.0);
+ testParse("-1e0", -1.0);
+ testParse("-1e+0", -1.0);
+ testParse("-1e-0", -1.0);
+ testParse("1.", 1.0);
+ testParse(".1", 0.1);
+ testParse("1.e1", 10.0);
+ testParse(".1e1", 1.0);
+
+ testParseWhitespace("0x1", 1);
+ testParseWhitespace("1", 1);
+ testParseWhitespace("1.0", 1.0);
+ testParseWhitespace("1e1", 10.0);
+ testParseWhitespace(".1e1", 1.0);
+ testParseWhitespace("1.e1", 10.0);
+ testParseWhitespace("1e+1", 10.0);
+ testParseWhitespace("1e-1", 0.1);
+
+ // Negative tests - things not to allow.
+
+ // Spaces inside the numeral.
+ testFail("- 1");
+ testFail("+ 1");
+ testFail("2 2");
+ testFail("0x 42");
+ testFail("1 .");
+ testFail(". 1");
+ testFail("1e 2");
+ testFail("1 e2");
+ // Invalid characters.
+ testFail("0x1H");
+ testFail("12H");
+ testFail("1x2");
+ testFail("00x2");
+ testFail("0x2.2");
+ // Empty hex number.
+ testFail("0x");
+ testFail("-0x");
+ testFail("+0x");
+ // Double exponent without value.
+ testFail(".e1");
+ testFail("e1");
+ testFail("e+1");
+ testFail("e-1");
+ testFail("-e1");
+ testFail("-e+1");
+ testFail("-e-1");
+ // Incorrect ways to write NaN/Infinity.
+ testFail("infinity");
+ testFail("INFINITY");
+ testFail("1.#INF");
+ testFail("inf");
+ testFail("nan");
+ testFail("NAN");
+ testFail("1.#IND");
+ testFail("indef");
+ testFail("qnan");
+ testFail("snan");
+}
diff --git a/tests/html/html.status b/tests/html/html.status
index 2b26a61..632145d 100644
--- a/tests/html/html.status
+++ b/tests/html/html.status
@@ -65,7 +65,6 @@
deferred_multi_app_htmltest: Skip # Times out on IE. Issue 21537
element_animate_test: Fail # Element.animate not supported on these browsers.
element_test/click: Fail # IE does not support firing this event.
-element_test/position: RuntimeError # Issue 32578
element_types_test/supported_content: Fail # IE11 Feature support statuses - These results not yet noted in platform support annotations. All changes should be accompanied by platform support annotation changes.
element_types_test/supported_details: Fail # IE11 Feature support statuses - These results not yet noted in platform support annotations. All changes should be accompanied by platform support annotation changes.
element_types_test/supported_keygen: Fail # IE11 Feature support statuses - These results not yet noted in platform support annotations. All changes should be accompanied by platform support annotation changes.
@@ -101,7 +100,6 @@
shadow_dom_test/supported: Fail # IE11 Feature support statuses - These results not yet noted in platform support annotations. All changes should be accompanied by platform support annotation changes.
speechrecognition_test/supported: Fail # IE11 Feature support statuses - These results not yet noted in platform support annotations. All changes should be accompanied by platform support annotation changes.
storage_test: Pass, RuntimeError # Issue 22166
-svgelement_test/getBoundingClientRect: RuntimeError # Isue 32580
svgelement_test/supported_altGlyph: Fail # IE11 Feature support statuses - These results not yet noted in platform support annotations. All changes should be accompanied by platform support annotation changes.
svgelement_test/supported_animate: Fail # IE11 Feature support statuses - These results not yet noted in platform support annotations. All changes should be accompanied by platform support annotation changes.
svgelement_test/supported_animateMotion: Fail # IE11 Feature support statuses - These results not yet noted in platform support annotations. All changes should be accompanied by platform support annotation changes.
@@ -125,7 +123,6 @@
audiobuffersourcenode_test/functional: RuntimeError
canvasrenderingcontext2d_test/drawImage_video_element: Fail # Safari does not support drawImage w/ video element
canvasrenderingcontext2d_test/drawImage_video_element_dataUrl: Fail # Safari does not support drawImage w/ video element
-css_test/functional: RuntimeError # Issue 32576
element_animate_test: Fail # Element.animate not supported on these browsers.
element_test: Pass, Fail # Issue 21434
element_types_test/supported_content: Fail # Safari Feature support statuses - All changes should be accompanied by platform support annotation changes.
@@ -151,7 +148,6 @@
rtc_test/supported: Fail # Safari Feature support statuses - All changes should be accompanied by platform support annotation changes.
shadow_dom_test/supported: Fail # Safari Feature support statuses - All changes should be accompanied by platform support annotation changes.
speechrecognition_test/supported: Fail # Safari Feature support statuses - All changes should be accompanied by platform support annotation changes.
-svgelement_test/getBoundingClientRect: RuntimeError # Issue 32572
touchevent_test/supported: Fail # Safari does not support TouchEvents
webgl_1_test: Pass, Fail # Issue 8219
worker_api_test: Skip # Issue 13221
@@ -551,4 +547,3 @@
[ $system == windows || $runtime == drt && $system == macos ]
xhr_test/xhr: Skip # Times out. Issue 21527
-
diff --git a/tests/isolate/isolate.status b/tests/isolate/isolate.status
index d22d01b..753bf0c 100644
--- a/tests/isolate/isolate.status
+++ b/tests/isolate/isolate.status
@@ -238,4 +238,3 @@
issue_21398_parent_isolate2_test: Crash # Requires deferred libraries
message3_test/fun: Pass, Fail # Closure identity
spawn_uri_nested_vm_test: Pass, Crash # Issue 28192
-
diff --git a/tests/kernel/kernel.status b/tests/kernel/kernel.status
index 807e76c..37322af 100644
--- a/tests/kernel/kernel.status
+++ b/tests/kernel/kernel.status
@@ -35,4 +35,3 @@
[ $runtime == dart_precompiled && $minified ]
unsorted/symbol_literal_test: Skip # Expects unobfuscated Symbol.toString.
-
diff --git a/tests/language/language.status b/tests/language/language.status
index 523475a..0916858 100644
--- a/tests/language/language.status
+++ b/tests/language/language.status
@@ -524,4 +524,3 @@
[ $compiler != dartk && $compiler != dartkp && $compiler != none || $compiler != dartk && $compiler != dartkp && $runtime != vm ]
assert_initializer_test/*: Skip # not implemented yet, experiment is VM only.
-
diff --git a/tests/language/language_dart2js.status b/tests/language/language_dart2js.status
index 31043ca..fe9e13b 100644
--- a/tests/language/language_dart2js.status
+++ b/tests/language/language_dart2js.status
@@ -796,4 +796,3 @@
mixin_mixin_type_arguments_test: RuntimeError, OK # Issue 31054: runtimeType.toString not preserved in minified code.
regress_21795_test: RuntimeError, OK # Issue 31054: runtimeType.toString not preserved in minified code.
stack_trace_test: RuntimeError, OK # Stack trace not preserved in minified code.
-
diff --git a/tests/language/language_kernel.status b/tests/language/language_kernel.status
index 89fe0d9..c9903f0 100644
--- a/tests/language/language_kernel.status
+++ b/tests/language/language_kernel.status
@@ -188,7 +188,6 @@
private_member2_negative_test: Fail
private_member3_negative_test: Fail
static_call_wrong_argument_count_negative_test: Fail
-switch4_negative_test: Crash
type_variable_static_context_negative_test: Fail
unresolved_in_factory_negative_test: Fail
unresolved_top_level_method_negative_test: Fail
@@ -198,4 +197,3 @@
# modes are intended only for Dart 2.0 with strong mode enabled.
[ $compiler == dartk || $compiler == dartkp ]
*: Skip
-
diff --git a/tests/language/language_spec_parser.status b/tests/language/language_spec_parser.status
index f9d31ec..16dec52 100644
--- a/tests/language/language_spec_parser.status
+++ b/tests/language/language_spec_parser.status
@@ -36,4 +36,3 @@
unary_plus_negative_test: Fail # Negative, uses non-existing unary plus.
unhandled_exception_negative_test: Fail # Negative, defaults required parameter.
vm/debug_break_enabled_vm_test: Fail # Uses debug break.
-
diff --git a/tests/language_2/implicit_creation/implicit_new_or_const_composite_test.dart b/tests/language_2/implicit_creation/implicit_new_or_const_composite_test.dart
index 1a7debe..3b9af6d 100644
--- a/tests/language_2/implicit_creation/implicit_new_or_const_composite_test.dart
+++ b/tests/language_2/implicit_creation/implicit_new_or_const_composite_test.dart
@@ -4,12 +4,9 @@
import "package:expect/expect.dart";
-// Tests that const/new-insertion does the right thing for
-// composite object creations.
-//
-// The right thing is that map and list literals are only constant
-// if in a constant context.
-// Object creation is const if constructor is const and all arguments are const.
+// Tests that new-insertion always inserts `new` when not in const context,
+// no matter what the arguments are.
+// There is (currently) no automatic const insertion in non-const context.
//
// Not testing inference, so all type arguments are explicit.
@@ -34,8 +31,7 @@
var cd5 = C(d42); // Non-constant context, so `new`.
Expect.identical(cd1, cd2);
- Expect.allDistinct([cd1, cd3]);
- Expect.allDistinct([cd1, cd4, cd5]);
+ Expect.allDistinct([cd1, cd3, cd4, cd5]);
}
{
@@ -43,18 +39,14 @@
const cl1 = const C(const <int>[37]);
const cl2 = C(clist); // Constant context.
const cl3 = C(const <int>[37]); // Constant context.
- const cl4 = C(<int>[37]);
+ const cl4 = C(<int>[37]); // Constant context.
var cl5 = C(clist); // Non-constant context, so `new`.
var cl6 = C(const <int>[37]); // Non-constant context, so `new`.
var cl7 = C(list); // Non-constant context, so `new`.
var cl8 = C(<int>[37]); // Non-constant context, so `new`.
- Expect.identical(cl1, cl2);
- Expect.identical(cl1, cl3);
- Expect.identical(cl1, cl4);
- Expect.allDistinct([cl1, cl5]);
- Expect.allDistinct([cl1, cl6]);
- Expect.allDistinct([cl1, cl7, cl8]);
+ Expect.allIdentical([cl1, cl2, cl3, cl4]);
+ Expect.allDistinct([cl1, cl5, cl6, cl7, cl8]);
}
{
@@ -69,9 +61,7 @@
Expect.identical(cm1, cm2);
Expect.identical(cm1, cm3);
- Expect.allDistinct([cm1, cm4]);
- Expect.allDistinct([cm1, cm5]);
- Expect.allDistinct([cm1, cm6, cm7]);
+ Expect.allDistinct([cm1, cm4, cm5, cm6, cm7]);
}
{
@@ -93,22 +83,14 @@
Expect.identical(n1, n2);
Expect.identical(n1, n3);
- Expect.allDistinct([n1, n4]);
- Expect.allDistinct([n1, n8]);
- Expect.allDistinct([n1, n5, n6, n7, n9, n10, n11, n12, n13, n14]);
+ Expect.allDistinct([n1, n4, n5, n6, n7, n8, n9, n10, n11, n12, n13, n14]);
- Expect.identical(clist, n6.left);
- Expect.identical(clist, n10.left);
- Expect.identical(clist, n12.left);
- Expect.identical(clist, n13.left);
- Expect.identical(clist, n14.left);
+ Expect
+ .allIdentical([clist, n6.left, n10.left, n12.left, n13.left, n14.left]);
Expect.allDistinct([n5.left, n7.left, n9.left, n11.left]);
- Expect.identical(cmap, n5.right);
- Expect.identical(cmap, n9.right);
- Expect.identical(cmap, n12.right);
- Expect.identical(cmap, n13.right);
- Expect.identical(cmap, n14.right);
+ Expect.allIdentical(
+ [cmap, n5.right, n9.right, n12.right, n13.right, n14.right]);
Expect.allDistinct([n6.right, n7.right, n10.right, n11.right]);
const n20 = const N(const C(42), const <int>[37]);
@@ -124,21 +106,13 @@
var n30 = N(c42, clist);
var n31 = N(cc42, list);
- Expect.identical(n20, n21);
- Expect.identical(n20, n22);
- Expect.identical(n20, n23);
- Expect.identical(n20, n24);
- Expect.allDistinct([n20, n25]);
- Expect.allDistinct([n20, n26]);
- Expect.allDistinct([n20, n27]);
- Expect.allDistinct([n28, n29, n30, n31]);
- Expect.allDistinct([cc42, n28.left]);
- Expect.allDistinct([cc42, n29.left]);
+ Expect.allIdentical([n20, n21, n22, n23, n24]);
+ Expect.allDistinct([n20, n25, n26, n27, n28, n29, n30, n31]);
+
+ Expect.allDistinct([cc42, n28.left, n29.left]);
Expect.identical(cc42, n30.left);
Expect.identical(cc42, n31.left);
- Expect.identical(clist, n29.right);
- Expect.identical(clist, n30.right);
- Expect.identical(clist, n31.right);
+ Expect.allIdentical([clist, n29.right, n30.right, n31.right]);
Expect.notIdentical(clist, n28.right);
}
@@ -178,25 +152,13 @@
var l30 = [c42, clist];
var l31 = [cc42, list];
- Expect.identical(l20, l21);
- Expect.identical(l20, l22);
- Expect.identical(l20, l23);
- Expect.identical(l20, l24);
+ Expect.allIdentical([l20, l21, l22, l23, l24]);
// List literals are never const unless in const context.
Expect.allDistinct([l20, l25, l26, l27, l28, l29, l30, l31]);
- Expect.identical(cc42, l25[0]);
- Expect.allDistinct([cc42, l26[0]]);
- Expect.allDistinct([cc42, l27[0]]);
- Expect.allDistinct([cc42, l28[0]]);
- Expect.allDistinct([cc42, l29[0]]);
- Expect.identical(cc42, l30[0]);
- Expect.identical(cc42, l31[0]);
- Expect.identical(clist, l25[1]);
- Expect.identical(clist, l26[1]);
- Expect.identical(clist, l27[1]);
- Expect.identical(clist, l29[1]);
- Expect.identical(clist, l30[1]);
- Expect.identical(clist, l31[1]);
+ Expect.allIdentical([cc42, l25[0], l30[0], l31[0]]);
+ Expect.allDistinct([cc42, l26[0], l27[0], l28[0], l29[0]]);
+ Expect
+ .allIdentical([clist, l25[1], l26[1], l27[1], l29[1], l30[1], l31[1]]);
Expect.notIdentical(clist, l28[1]);
}
@@ -229,25 +191,23 @@
var m30 = {c42: clist};
var m31 = {cc42: list};
- Expect.identical(m20, m21);
- Expect.identical(m20, m22);
- Expect.identical(m20, m23);
- Expect.identical(m20, m24);
+ Expect.allIdentical([m20, m21, m22, m23, m24]);
// Map literals are never const unless in const context.
Expect.allDistinct([m20, m25, m26, m27, m28, m29, m30, m31]);
Expect.identical(cc42, m25.keys.first);
- Expect.allDistinct([cc42, m26.keys.first]);
- Expect.allDistinct([cc42, m27.keys.first]);
- Expect.allDistinct([cc42, m28.keys.first]);
- Expect.allDistinct([cc42, m29.keys.first]);
+ Expect.allDistinct(
+ [cc42, m26.keys.first, m27.keys.first, m28.keys.first, m29.keys.first]);
Expect.identical(cc42, m30.keys.first);
Expect.identical(cc42, m31.keys.first);
- Expect.identical(clist, m25.values.first);
- Expect.identical(clist, m26.values.first);
- Expect.identical(clist, m27.values.first);
- Expect.identical(clist, m29.values.first);
- Expect.identical(clist, m30.values.first);
- Expect.identical(clist, m31.values.first);
+ Expect.allIdentical([
+ clist,
+ m25.values.first,
+ m26.values.first,
+ m27.values.first,
+ m29.values.first,
+ m30.values.first,
+ m31.values.first
+ ]);
Expect.notIdentical(clist, m28.values.first);
}
}
diff --git a/tests/language_2/implicit_creation/implicit_new_or_const_generic_test.dart b/tests/language_2/implicit_creation/implicit_new_or_const_generic_test.dart
index ab9f148..9afaba7 100644
--- a/tests/language_2/implicit_creation/implicit_new_or_const_generic_test.dart
+++ b/tests/language_2/implicit_creation/implicit_new_or_const_generic_test.dart
@@ -6,15 +6,15 @@
import "implicit_new_or_const_generic_test.dart" as prefix;
-// Test that const constructors with const arguments become const,
-// and non-const constructors or const-constructors with non-const arguments
-// do not (except in a const context, which is tested elsewhere).
+// Test that const constructors with const arguments do not become const
+// if not in a const context.
-// This test uses a generic class, which requires new syntax.
+// This test uses a generic class cosntructor with no prefix,
+// which requires new Dart 2 syntax.
main() {
// Various valid object creation expressions.
- var x = 42; // non constant variable.
+ var x = 42; // non constant variable.
// Various valid object creation expressions of a generic constructor.
// (Requires inference to infer `<int>` for the invocations of `D`.)
@@ -24,43 +24,36 @@
const D(42),
D(x),
D(42),
-
new D.named(x),
new D.named(42),
const D.named(42),
D.named(x),
D.named(42),
-
new prefix.D(x),
new prefix.D(42),
const prefix.D(42),
prefix.D(x),
prefix.D(42),
-
new prefix.D.named(x),
new prefix.D.named(42),
const prefix.D.named(42),
prefix.D.named(x),
prefix.D.named(42),
-
new D<int>(x),
new D<int>(42),
const D<int>(42),
D<int>(x),
D<int>(42),
-
new D<int>.named(x),
new D<int>.named(42),
const D<int>.named(42),
D<int>.named(x),
D<int>.named(42),
-
new prefix.D<int>(x),
new prefix.D<int>(42),
const prefix.D<int>(42),
prefix.D<int>(x),
prefix.D<int>(42),
-
new prefix.D<int>.named(x),
new prefix.D<int>.named(42),
const prefix.D<int>.named(42),
@@ -92,7 +85,7 @@
const D.named(this.x);
int get hashCode => x.hashCode;
- bool operator==(Object other) => other is D<Object> && x == other.x;
+ bool operator ==(Object other) => other is D<Object> && x == other.x;
}
class G<T> {
@@ -102,13 +95,10 @@
var instances = [
new D<T>(null),
D<T>(null),
-
new D<T>.named(null),
D<T>.named(null),
-
new prefix.D<T>(null),
prefix.D<T>(null),
-
new prefix.D<T>.named(null),
prefix.D<T>.named(null),
];
diff --git a/tests/language_2/implicit_creation/implicit_new_or_const_test.dart b/tests/language_2/implicit_creation/implicit_new_or_const_test.dart
index 00c8ae3..1d217a6 100644
--- a/tests/language_2/implicit_creation/implicit_new_or_const_test.dart
+++ b/tests/language_2/implicit_creation/implicit_new_or_const_test.dart
@@ -6,9 +6,8 @@
import "implicit_new_or_const_test.dart" as prefix;
-// Test that const constructors with const arguments become const,
-// and non-const constructors or const-constructors with non-const arguments
-// do not (except in a const context, which is tested elsewhere).
+// Test that const constructors with const arguments do not become const
+// if not in a const context.
main() {
// Various valid object creation expressions.
diff --git a/tests/language_2/language_2.status b/tests/language_2/language_2.status
index c746cd0..e4180aa 100644
--- a/tests/language_2/language_2.status
+++ b/tests/language_2/language_2.status
@@ -2,6 +2,11 @@
# 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.
+mixin_constructor_forwarding/const_constructor_test/none: CompileTimeError # Issue 32223
+mixin_constructor_forwarding/const_constructor_with_field_test/none: CompileTimeError # Issue 32223
+mixin_constructor_forwarding/optional_named_parameters_test/none: CompileTimeError # Issue 31543
+mixin_constructor_forwarding/optional_positional_parameters_test/none: CompileTimeError # Issue 31543
+
[ $compiler == app_jit ]
deferred_inheritance_constraints_test/redirecting_constructor: Crash
@@ -319,4 +324,3 @@
static_closure_identical_test: Pass, Fail # Closure identity
vm/optimized_stacktrace_test: Pass, Slow
vm/regress_27201_test: Pass, Crash # Requires deferred libraries
-
diff --git a/tests/language_2/language_2_analyzer.status b/tests/language_2/language_2_analyzer.status
index 78aa5bd..aaf47f0 100644
--- a/tests/language_2/language_2_analyzer.status
+++ b/tests/language_2/language_2_analyzer.status
@@ -1800,4 +1800,3 @@
unresolved_top_level_method_test: MissingCompileTimeError
unresolved_top_level_var_test: MissingCompileTimeError
vm/type_vm_test: StaticWarning
-
diff --git a/tests/language_2/language_2_dart2js.status b/tests/language_2/language_2_dart2js.status
index 716c75e..b53060d 100644
--- a/tests/language_2/language_2_dart2js.status
+++ b/tests/language_2/language_2_dart2js.status
@@ -1003,7 +1003,6 @@
call_method_is_check_test/06: RuntimeError
call_method_must_not_be_field_test/03: RuntimeError # Issue 32155
call_method_must_not_be_getter_test/03: RuntimeError # Issue 32155
-call_with_no_such_method_test: RuntimeError
checked_setter2_test: RuntimeError # Issue 31128
checked_setter_test: RuntimeError # Issue 31128
const_dynamic_type_literal_test/03: Pass # but it shouldn't until we fix issue 17207
@@ -1760,6 +1759,7 @@
call_method_implicit_tear_off_test/04: RuntimeError
call_non_method_field_test/01: MissingCompileTimeError
call_non_method_field_test/02: MissingCompileTimeError
+call_with_no_such_method_test: RuntimeError
canonical_const2_test: RuntimeError, OK # non JS number semantics
cha_deopt1_test: RuntimeError
cha_deopt2_test: RuntimeError
@@ -2343,4 +2343,3 @@
mixin_mixin_bound2_test: RuntimeError # Issue 31054
mixin_mixin_bound_test: RuntimeError # Issue 31054
mixin_mixin_type_arguments_test: RuntimeError # Issue 31054
-
diff --git a/tests/language_2/language_2_dartdevc.status b/tests/language_2/language_2_dartdevc.status
index f1d8960..97c9e8d 100644
--- a/tests/language_2/language_2_dartdevc.status
+++ b/tests/language_2/language_2_dartdevc.status
@@ -401,7 +401,6 @@
field_override_test/01: MissingCompileTimeError
function_call_generic_test: RuntimeError # Issue 32756. Crashes on dsend
function_propagation_test: RuntimeError
-function_subtype_closure0_test: RuntimeError # Expect.throws(TypeError) fails: Did not throw
function_type_parameter2_negative_test: Fail
function_type_parameter_negative_test: Fail
generic_function_bounds_test: RuntimeError
@@ -621,7 +620,6 @@
regress_29949_test: RuntimeError # Issue 32429
regress_30339_test: CompileTimeError
regress_30339_test: RuntimeError # Uncaught Expect.isTrue(false) fails.
-runtime_type_function_test: RuntimeError # Expect.fail('Type print string does not match expectation
setter4_test: MissingCompileTimeError
setter_no_getter_test/01: CompileTimeError
setter_override_test/00: MissingCompileTimeError
@@ -708,8 +706,6 @@
bit_operations_test/02: MissingCompileTimeError
branch_canonicalization_test: RuntimeError # Issue 29920; Expect.equals(expected: <0>, actual: <1>) fails.
built_in_identifier_prefix_test: CompileTimeError
-call_closurization_test: RuntimeError # Issue 29920; TypeError: Cannot read property '0' of undefined
-call_test: RuntimeError # Expect.throws(NoSuchMethodError) fails: Did not throw
canonical_const2_test: RuntimeError # Ints and doubles are unified.; Expect.isFalse(true) fails.
closure_call_wrong_argument_count_negative_test: Fail
compile_time_constant_d_test: RuntimeError # Issue 30876; Expect.isTrue(false) fails.
@@ -791,7 +787,6 @@
multiline_newline_test/04r: MissingCompileTimeError
multiline_newline_test/05: MissingCompileTimeError
multiline_newline_test/05r: MissingCompileTimeError
-named_parameter_clash_test: RuntimeError # Issue 29920; Expect.throws(NoSuchMethodError) fails: Did not throw
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;
@@ -838,4 +833,3 @@
switch_try_catch_test: RuntimeError # Issue 29920; Expect.throws: Unexpected 'UnimplementedError: node <ShadowContinueSwitchStatement> see https://github.com/dart-lang/sdk/issues/29352 `continue #L1;
truncdiv_test: RuntimeError # Issue 29920; Expect.throws fails: Did not throw
vm/*: SkipByDesign # VM only tests.; VM only tests.
-
diff --git a/tests/language_2/language_2_flutter.status b/tests/language_2/language_2_flutter.status
index 896791b..852a610 100644
--- a/tests/language_2/language_2_flutter.status
+++ b/tests/language_2/language_2_flutter.status
@@ -233,4 +233,3 @@
[ $compiler == none && $runtime == flutter && $checked ]
assert_initializer_test/4*: MissingCompileTimeError # Issue 392. The VM doesn't enforce that potentially const expressions are actually const expressions when the constructor is called with `const`.
-
diff --git a/tests/language_2/language_2_kernel.status b/tests/language_2/language_2_kernel.status
index 73d5031..3c1f1a3 100644
--- a/tests/language_2/language_2_kernel.status
+++ b/tests/language_2/language_2_kernel.status
@@ -1202,8 +1202,6 @@
compile_time_constant_static5_test/23: CompileTimeError
conditional_import_string_test: CompileTimeError
conditional_import_test: CompileTimeError
-conditional_property_access_test/05: Crash
-conditional_property_access_test/06: Crash
config_import_corelib_test: CompileTimeError
config_import_test: Crash
const_constructor3_test/04: MissingCompileTimeError
@@ -1330,7 +1328,6 @@
super_operator_index6_test: CompileTimeError
super_operator_index7_test: CompileTimeError
super_operator_index8_test: CompileTimeError
-switch4_negative_test: Crash
try_catch_test/01: MissingCompileTimeError
type_promotion_functions_test/02: CompileTimeError
type_promotion_functions_test/03: CompileTimeError
@@ -2062,7 +2059,6 @@
super_operator_index_test/05: MissingCompileTimeError
super_operator_index_test/06: MissingCompileTimeError
super_operator_index_test/07: MissingCompileTimeError
-switch4_negative_test: Crash
switch_fallthru_test/01: MissingCompileTimeError
symbol_literal_test/01: MissingCompileTimeError
sync_generator1_test/01: MissingCompileTimeError
@@ -2175,4 +2171,3 @@
[ $compiler == dartk || $compiler == dartkp ]
generic_function_bounds_test: RuntimeError # Issue 32076
generic_test/01: MissingCompileTimeError
-
diff --git a/tests/language_2/language_2_precompiled.status b/tests/language_2/language_2_precompiled.status
index aa44ee3..c188ce8 100644
--- a/tests/language_2/language_2_precompiled.status
+++ b/tests/language_2/language_2_precompiled.status
@@ -1188,4 +1188,3 @@
vm/no_such_method_error_message_callable_vm_test: Skip
vm/no_such_method_error_message_vm_test: Skip
vm/regress_28325_test: Skip
-
diff --git a/tests/language_2/language_2_spec_parser.status b/tests/language_2/language_2_spec_parser.status
index 9976a28..e223c59 100644
--- a/tests/language_2/language_2_spec_parser.status
+++ b/tests/language_2/language_2_spec_parser.status
@@ -93,4 +93,3 @@
vm/debug_break_enabled_vm_test/01: Fail # Uses debug break.
vm/debug_break_enabled_vm_test/none: Fail # Uses debug break.
void_type_function_types_test: Skip # Not yet supported.
-
diff --git a/tests/language_2/language_2_vm.status b/tests/language_2/language_2_vm.status
index cfbf354..3c012b6 100644
--- a/tests/language_2/language_2_vm.status
+++ b/tests/language_2/language_2_vm.status
@@ -1300,8 +1300,8 @@
dynamic_prefix_core_test/01: RuntimeError # Issue 12478
example_constructor_test: Fail, OK
export_ambiguous_main_negative_test: Fail # Issue 14763
-field_initialization_order_test: Fail, OK
f_bounded_quantification4_test: RuntimeError, OK # Not running in strong mode.
+field_initialization_order_test: Fail, OK
generic_methods_bounds_test/02: MissingRuntimeError
library_env_test/has_html_support: RuntimeError, OK
library_env_test/has_no_io_support: RuntimeError, OK
@@ -1336,9 +1336,9 @@
generic_methods_generic_function_parameter_test: Pass # Issue 25869
generic_methods_new_test: Pass # Issue 25869
generic_methods_test: Pass # Issue 25869
+nosuchmethod_forwarding/nosuchmethod_forwarding_arguments_test: RuntimeError
nosuchmethod_forwarding/nosuchmethod_forwarding_test/05: RuntimeError
nosuchmethod_forwarding/nosuchmethod_forwarding_test/06: RuntimeError
-nosuchmethod_forwarding/nosuchmethod_forwarding_arguments_test: RuntimeError
nsm5_test: MissingCompileTimeError
override_inheritance_no_such_method_test/05: MissingCompileTimeError
type_alias_equality_test/01: RuntimeError # Issue 32783
diff --git a/tests/language_2/mixin_constructor_forwarding/const_constructor_test.dart b/tests/language_2/mixin_constructor_forwarding/const_constructor_test.dart
new file mode 100644
index 0000000..aa59e5e
--- /dev/null
+++ b/tests/language_2/mixin_constructor_forwarding/const_constructor_test.dart
@@ -0,0 +1,111 @@
+// 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:expect/expect.dart";
+
+abstract class Mixin {
+ // Declares no instance variable.
+ int get x;
+ int get m => x;
+}
+
+class Base {
+ final int x;
+
+ // Non-const constructors.
+ Base.c1(this.x);
+ Base.c2([this.x = 37]);
+ Base.c3({this.x = 37});
+
+ // Non-forwarding generative const constructors.
+ const Base.c4(this.x);
+ const Base.c5([this.x = 37]);
+ const Base.c6({this.x = 37});
+
+ // Forwarding generative const constructors.
+ const Base.c7(int x) : this.c4(x);
+ const Base.c8([int x = 87]) : this.c4(x);
+ const Base.c9({int x = 87}) : this.c4(x);
+ const Base.c10(int x) : this.c5(x);
+ const Base.c11([int x = 87]) : this.c5(x);
+ const Base.c12({int x = 87}) : this.c5(x);
+ const Base.c13(int x) : this.c6(x: x);
+ const Base.c14([int x = 87]) : this.c6(x: x);
+ const Base.c15({int x = 87}) : this.c6(x: x);
+
+ // Non-generative constructor.
+ const factory Base() = Base.c5;
+}
+
+class Application = Base with Mixin;
+
+class Application2 extends Base with Mixin {}
+
+main() {
+ Expect.equals(42, new Application.c1(42).m);
+ Expect.equals(42, new Application.c2(42).m);
+ Expect.equals(42, new Application.c3(x: 42).m);
+ Expect.equals(42, const Application.c4(42).m);
+ Expect.equals(42, const Application.c5(42).m);
+ Expect.equals(42, const Application.c6(x: 42).m);
+ Expect.equals(42, const Application.c7(42).m);
+ Expect.equals(42, const Application.c8(42).m);
+ Expect.equals(42, const Application.c9(x: 42).m);
+ Expect.equals(42, const Application.c10(42).m);
+ Expect.equals(42, const Application.c11(42).m);
+ Expect.equals(42, const Application.c12(x: 42).m);
+ Expect.equals(42, const Application.c13(42).m);
+ Expect.equals(42, const Application.c14(42).m);
+ Expect.equals(42, const Application.c15(x: 42).m);
+
+ Expect.equals(37, new Application.c2().m);
+ Expect.equals(37, new Application.c3().m);
+ Expect.equals(37, const Application.c5().m);
+ Expect.equals(37, const Application.c6().m);
+ Expect.equals(87, const Application.c8().m);
+ Expect.equals(87, const Application.c9().m);
+ Expect.equals(87, const Application.c11().m);
+ Expect.equals(87, const Application.c12().m);
+ Expect.equals(87, const Application.c14().m);
+ Expect.equals(87, const Application.c15().m);
+
+ Expect.equals(42, new Application2.c1(42).m);
+ Expect.equals(42, new Application2.c2(42).m);
+ Expect.equals(42, new Application2.c3(x: 42).m);
+ Expect.equals(42, const Application2.c4(42).m);
+ Expect.equals(42, const Application2.c5(42).m);
+ Expect.equals(42, const Application2.c6(x: 42).m);
+ Expect.equals(42, const Application2.c7(42).m);
+ Expect.equals(42, const Application2.c8(42).m);
+ Expect.equals(42, const Application2.c9(x: 42).m);
+ Expect.equals(42, const Application2.c10(42).m);
+ Expect.equals(42, const Application2.c11(42).m);
+ Expect.equals(42, const Application2.c12(x: 42).m);
+ Expect.equals(42, const Application2.c13(42).m);
+ Expect.equals(42, const Application2.c14(42).m);
+ Expect.equals(42, const Application2.c15(x: 42).m);
+
+ Expect.equals(37, new Application2.c2().m);
+ Expect.equals(37, new Application2.c3().m);
+ Expect.equals(37, const Application2.c5().m);
+ Expect.equals(37, const Application2.c6().m);
+ Expect.equals(87, const Application2.c8().m);
+ Expect.equals(87, const Application2.c9().m);
+ Expect.equals(87, const Application2.c11().m);
+ Expect.equals(87, const Application2.c12().m);
+ Expect.equals(87, const Application2.c14().m);
+ Expect.equals(87, const Application2.c15().m);
+
+ // Only make forwarders const if original constructor is const.
+ const Application.c1(0); //# 01: compile-time error
+ const Application.c2(0); //# 02: compile-time error
+ const Application.c3(x: 0); //# 03: compile-time error
+ const Application2.c1(0); //# 04: compile-time error
+ const Application2.c2(0); //# 05: compile-time error
+ const Application2.c3(x: 0); //# 06: compile-time error
+
+ // Only insert forwarders for generative constructors.
+ new Application(); //# 07: compile-time error
+ new Application2(); //# 08: compile-time error
+}
diff --git a/tests/language_2/mixin_constructor_forwarding/const_constructor_with_field_test.dart b/tests/language_2/mixin_constructor_forwarding/const_constructor_with_field_test.dart
new file mode 100644
index 0000000..ee9bad7
--- /dev/null
+++ b/tests/language_2/mixin_constructor_forwarding/const_constructor_with_field_test.dart
@@ -0,0 +1,134 @@
+// 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:expect/expect.dart";
+
+abstract class Mixin {
+ // Declares an instance variable.
+ // Declaration would be valid in a "const class", but mixin application
+ // won't get const constructor forwarders.
+ final int y = 0;
+
+ int get x;
+ int get m => x;
+}
+
+class Base {
+ final int x;
+
+ // Non-const constructors.
+ Base.c1(this.x);
+ Base.c2([this.x = 37]);
+ Base.c3({this.x = 37});
+
+ // Non-forwarding generative const constructors.
+ const Base.c4(this.x);
+ const Base.c5([this.x = 37]);
+ const Base.c6({this.x = 37});
+
+ // Forwarding generative const constructors.
+ const Base.c7(int x) : this.c4(x);
+ const Base.c8([int x = 87]) : this.c4(x);
+ const Base.c9({int x = 87}) : this.c4(x);
+ const Base.c10(int x) : this.c5(x);
+ const Base.c11([int x = 87]) : this.c5(x);
+ const Base.c12({int x = 87}) : this.c5(x);
+ const Base.c13(int x) : this.c6(x: x);
+ const Base.c14([int x = 87]) : this.c6(x: x);
+ const Base.c15({int x = 87}) : this.c6(x: x);
+
+ // Non-generative constructor.
+ const factory Base() = Base.c5;
+}
+
+class Application = Base with Mixin;
+
+class Application2 extends Base with Mixin {}
+
+main() {
+ Expect.equals(42, new Application.c1(42).m);
+ Expect.equals(42, new Application.c2(42).m);
+ Expect.equals(42, new Application.c3(x: 42).m);
+ Expect.equals(42, new Application.c4(42).m);
+ Expect.equals(42, new Application.c5(42).m);
+ Expect.equals(42, new Application.c6(x: 42).m);
+ Expect.equals(42, new Application.c7(42).m);
+ Expect.equals(42, new Application.c8(42).m);
+ Expect.equals(42, new Application.c9(x: 42).m);
+ Expect.equals(42, new Application.c10(42).m);
+ Expect.equals(42, new Application.c11(42).m);
+ Expect.equals(42, new Application.c12(x: 42).m);
+ Expect.equals(42, new Application.c13(42).m);
+ Expect.equals(42, new Application.c14(42).m);
+ Expect.equals(42, new Application.c15(x: 42).m);
+
+ Expect.equals(37, new Application.c2().m);
+ Expect.equals(37, new Application.c3().m);
+ Expect.equals(37, new Application.c5().m);
+ Expect.equals(37, new Application.c6().m);
+ Expect.equals(87, new Application.c8().m);
+ Expect.equals(87, new Application.c9().m);
+ Expect.equals(87, new Application.c11().m);
+ Expect.equals(87, new Application.c12().m);
+ Expect.equals(87, new Application.c14().m);
+ Expect.equals(87, new Application.c15().m);
+
+ Expect.equals(42, new Application2.c1(42).m);
+ Expect.equals(42, new Application2.c2(42).m);
+ Expect.equals(42, new Application2.c3(x: 42).m);
+ Expect.equals(42, new Application2.c4(42).m);
+ Expect.equals(42, new Application2.c5(42).m);
+ Expect.equals(42, new Application2.c6(x: 42).m);
+ Expect.equals(42, new Application2.c7(42).m);
+ Expect.equals(42, new Application2.c8(42).m);
+ Expect.equals(42, new Application2.c9(x: 42).m);
+ Expect.equals(42, new Application2.c10(42).m);
+ Expect.equals(42, new Application2.c11(42).m);
+ Expect.equals(42, new Application2.c12(x: 42).m);
+ Expect.equals(42, new Application2.c13(42).m);
+ Expect.equals(42, new Application2.c14(42).m);
+ Expect.equals(42, new Application2.c15(x: 42).m);
+
+ Expect.equals(37, new Application2.c2().m);
+ Expect.equals(37, new Application2.c3().m);
+ Expect.equals(37, new Application2.c5().m);
+ Expect.equals(37, new Application2.c6().m);
+ Expect.equals(87, new Application2.c8().m);
+ Expect.equals(87, new Application2.c9().m);
+ Expect.equals(87, new Application2.c11().m);
+ Expect.equals(87, new Application2.c12().m);
+ Expect.equals(87, new Application2.c14().m);
+ Expect.equals(87, new Application2.c15().m);
+
+ // Don't make constructors const if mixin declares instance variable.
+ const Application.c4(42); //# 00: compile-time error
+ const Application.c5(42); //# 01: compile-time error
+ const Application.c6(x: 42); //# 02: compile-time error
+ const Application.c7(42); //# 03: compile-time error
+ const Application.c8(42); //# 04: compile-time error
+ const Application.c9(x: 42); //# 05: compile-time error
+ const Application.c10(42); //# 06: compile-time error
+ const Application.c11(42); //# 07: compile-time error
+ const Application.c12(x: 42); //# 08: compile-time error
+ const Application.c13(42); //# 09: compile-time error
+ const Application.c14(42); //# 10: compile-time error
+ const Application.c15(x: 42); //# 11: compile-time error
+
+ const Application2.c4(42); //# 12: compile-time error
+ const Application2.c5(42); //# 13: compile-time error
+ const Application2.c6(x: 42); //# 14: compile-time error
+ const Application2.c7(42); //# 15: compile-time error
+ const Application2.c8(42); //# 16: compile-time error
+ const Application2.c9(x: 42); //# 17: compile-time error
+ const Application2.c10(42); //# 18: compile-time error
+ const Application2.c11(42); //# 19: compile-time error
+ const Application2.c12(x: 42); //# 20: compile-time error
+ const Application2.c13(42); //# 21: compile-time error
+ const Application2.c14(42); //# 22: compile-time error
+ const Application2.c15(x: 42); //# 23: compile-time error
+
+ // Only insert forwarders for generative constructors.
+ new Application(); //# 24: compile-time error
+ new Application2(); //# 25: compile-time error
+}
diff --git a/tests/language_2/mixin_constructor_forwarding/optional_named_parameters_test.dart b/tests/language_2/mixin_constructor_forwarding/optional_named_parameters_test.dart
new file mode 100644
index 0000000..e4b7c58
--- /dev/null
+++ b/tests/language_2/mixin_constructor_forwarding/optional_named_parameters_test.dart
@@ -0,0 +1,51 @@
+// 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:expect/expect.dart";
+
+abstract class Mixin {
+ int get x;
+ int get m => x;
+}
+
+class Base {
+ final int x;
+ Base.c1(this.x);
+ Base.c2({this.x = 37});
+ Base.c3(int x) : this.c1(x);
+ Base.c4({int x = 37}) : this.c1(x);
+ Base.c5(int x) : this.c2(x: x);
+ Base.c6({int x = 37}) : this.c2(x: x);
+ factory Base() = Base.c2;
+}
+
+class Application = Base with Mixin;
+
+class Application2 extends Base with Mixin {}
+
+main() {
+ Expect.equals(42, new Application.c1(42).m);
+ Expect.equals(42, new Application.c2(x: 42).m);
+ Expect.equals(42, new Application.c3(42).m);
+ Expect.equals(42, new Application.c4(x: 42).m);
+ Expect.equals(42, new Application.c5(42).m);
+ Expect.equals(42, new Application.c6(x: 42).m);
+ Expect.equals(37, new Application.c2().m);
+ Expect.equals(37, new Application.c4().m);
+ Expect.equals(37, new Application.c6().m);
+
+ Expect.equals(42, new Application2.c1(42).m);
+ Expect.equals(42, new Application2.c2(x: 42).m);
+ Expect.equals(42, new Application2.c3(42).m);
+ Expect.equals(42, new Application2.c4(x: 42).m);
+ Expect.equals(42, new Application2.c5(42).m);
+ Expect.equals(42, new Application2.c6(x: 42).m);
+ Expect.equals(37, new Application2.c2().m);
+ Expect.equals(37, new Application2.c4().m);
+ Expect.equals(37, new Application2.c6().m);
+
+ // Only insert forwarders for generative constructors.
+ new Application(); //# 01: compile-time error
+ new Application2(); //# 02: compile-time error
+}
diff --git a/tests/language_2/mixin_constructor_forwarding/optional_positional_parameters_test.dart b/tests/language_2/mixin_constructor_forwarding/optional_positional_parameters_test.dart
new file mode 100644
index 0000000..cf84a97
--- /dev/null
+++ b/tests/language_2/mixin_constructor_forwarding/optional_positional_parameters_test.dart
@@ -0,0 +1,51 @@
+// 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:expect/expect.dart";
+
+abstract class Mixin {
+ int get x;
+ int get m => x;
+}
+
+class Base {
+ final int x;
+ Base.c1(this.x);
+ Base.c2([this.x = 37]);
+ Base.c3(int x) : this.c1(x);
+ Base.c4([int x = 37]) : this.c1(x);
+ Base.c5(int x) : this.c2(x);
+ Base.c6([int x = 37]) : this.c2(x);
+ factory Base() = Base.c2;
+}
+
+class Application = Base with Mixin;
+
+class Application2 extends Base with Mixin {}
+
+main() {
+ Expect.equals(42, new Application.c1(42).m);
+ Expect.equals(42, new Application.c2(42).m);
+ Expect.equals(42, new Application.c3(42).m);
+ Expect.equals(42, new Application.c4(42).m);
+ Expect.equals(42, new Application.c5(42).m);
+ Expect.equals(42, new Application.c6(42).m);
+ Expect.equals(37, new Application.c2().m);
+ Expect.equals(37, new Application.c4().m);
+ Expect.equals(37, new Application.c6().m);
+
+ Expect.equals(42, new Application2.c1(42).m);
+ Expect.equals(42, new Application2.c2(42).m);
+ Expect.equals(42, new Application2.c3(42).m);
+ Expect.equals(42, new Application2.c4(42).m);
+ Expect.equals(42, new Application2.c5(42).m);
+ Expect.equals(42, new Application2.c6(42).m);
+ Expect.equals(37, new Application2.c2().m);
+ Expect.equals(37, new Application2.c4().m);
+ Expect.equals(37, new Application2.c6().m);
+
+ // Only insert forwarders for generative constructors.
+ new Application(); //# 01: compile-time error
+ new Application2(); //# 02: compile-time error
+}
diff --git a/tests/language_2/no_such_method_simple_type_arguments_test.dart b/tests/language_2/no_such_method_simple_type_arguments_test.dart
new file mode 100644
index 0000000..7375f4a
--- /dev/null
+++ b/tests/language_2/no_such_method_simple_type_arguments_test.dart
@@ -0,0 +1,23 @@
+// 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=--disable-rti-optimization
+
+// Dart test program testing that type arguments are captured by the Invocation
+// passed to noSuchMethod from a dynamic call.
+
+import "package:expect/expect.dart";
+
+class Mock {
+ noSuchMethod(i) => i.typeArguments;
+}
+
+void main() {
+ var g = new Mock();
+
+ Expect.listEquals(
+ [String, int], (g as dynamic).hurrah<String, int>(moose: 42, duck: 12));
+
+ // map has interceptor calling convention in dart2js.
+ Expect.listEquals([String, int], (g as dynamic).map<String, int>());
+}
diff --git a/tests/lib/lib.status b/tests/lib/lib.status
index 280687c..220eb6c 100644
--- a/tests/lib/lib.status
+++ b/tests/lib/lib.status
@@ -399,4 +399,3 @@
mirrors/library_imports_deferred_test: Crash # Deferred loading
mirrors/load_library_test: Crash # Deferred loading
mirrors/typedef_deferred_library_test: Crash # Deferred loading
-
diff --git a/tests/lib_2/lib_2.status b/tests/lib_2/lib_2.status
index 52ea01c..879596b 100644
--- a/tests/lib_2/lib_2.status
+++ b/tests/lib_2/lib_2.status
@@ -124,14 +124,14 @@
async/stream_last_where_test/badType: MissingCompileTimeError
mirrors/redirecting_factory_different_type_test/02: MissingCompileTimeError
-[ !$strong && $compiler != fasta && $compiler != dart2analyzer ]
-async/future_or_type_test: Fail # Strong mode implements FutureOr, non-strong treats it as dynamic.
-
[ $builder_tag == mac10_7 && $runtime == safari ]
typed_data/setRange_2_test: Fail # Safari doesn't fully implement spec for TypedArray.set
typed_data/setRange_3_test: Fail # Safari doesn't fully implement spec for TypedArray.set
typed_data/setRange_4_test: Fail # Safari doesn't fully implement spec for TypedArray.set
+[ $compiler != dart2analyzer && $compiler != fasta && !$strong ]
+async/future_or_type_test: Fail # Strong mode implements FutureOr, non-strong treats it as dynamic.
+
[ $compiler != dartdevc && $checked && !$strong ]
async/future_or_only_in_async_test/00: MissingCompileTimeError
@@ -258,4 +258,3 @@
mirrors/library_imports_deferred_test: Crash # Deferred loading
mirrors/load_library_test: Crash # Deferred loading
mirrors/typedef_deferred_library_test: Crash # Deferred loading
-
diff --git a/tests/lib_2/lib_2_analyzer.status b/tests/lib_2/lib_2_analyzer.status
index 96499ee..f79c3c3 100644
--- a/tests/lib_2/lib_2_analyzer.status
+++ b/tests/lib_2/lib_2_analyzer.status
@@ -47,4 +47,3 @@
mirrors/reflected_type_test/02: MissingCompileTimeError
mirrors/reflected_type_test/03: MissingCompileTimeError
mirrors/regress_16321_test/01: MissingCompileTimeError
-
diff --git a/tests/lib_2/lib_2_dart2js.status b/tests/lib_2/lib_2_dart2js.status
index 2025fa0..6277cb5 100644
--- a/tests/lib_2/lib_2_dart2js.status
+++ b/tests/lib_2/lib_2_dart2js.status
@@ -484,7 +484,6 @@
[ $compiler == dart2js && $runtime == safari ]
html/audiobuffersourcenode_test: RuntimeError
-html/client_rect_test: RuntimeError # Issue 32572
html/css_test/functional/functional: RuntimeError # Issue 32576
html/custom/attribute_changed_callback_test: RuntimeError, Timeout
html/custom/constructor_calls_created_synchronously_test: Pass, Timeout
@@ -496,8 +495,6 @@
html/file_sample_test: Skip # FileSystem not supported on Safari.
html/fileapi_supported_throws_test: Skip # FileSystem not supported on Safari
html/js_mock_test: RuntimeError # Issue 32286
-html/svgelement_test: RuntimeError # Issue 32571
-html/svgelement_test/getBoundingClientRect/getBoundingClientRect: RuntimeError # Issue 32571
html/xhr_test: RuntimeError
isolate/cross_isolate_message_test: Skip # Issue 12627
isolate/message_test: Skip # Issue 12627
@@ -883,4 +880,3 @@
html/custom/attribute_changed_callback_test/unsupported_on_polyfill: Fail # Polyfill does not support
html/custom/entered_left_view_test/viewless_document: Fail # Polyfill does not handle this
html/fontface_test: Fail # Fontface not supported on these.
-
diff --git a/tests/lib_2/lib_2_kernel.status b/tests/lib_2/lib_2_kernel.status
index 9ea3c4e..d51d869 100644
--- a/tests/lib_2/lib_2_kernel.status
+++ b/tests/lib_2/lib_2_kernel.status
@@ -368,4 +368,3 @@
html/*: SkipByDesign
isolate/browser/*: SkipByDesign
js/*: SkipByDesign
-
diff --git a/tests/lib_2/lib_2_precompiled.status b/tests/lib_2/lib_2_precompiled.status
index c3b6dec..27e575f 100644
--- a/tests/lib_2/lib_2_precompiled.status
+++ b/tests/lib_2/lib_2_precompiled.status
@@ -39,4 +39,3 @@
js/datetime_roundtrip_test: CompileTimeError
js/null_test: CompileTimeError
js/prototype_access_test: CompileTimeError
-
diff --git a/tests/lib_2/lib_2_vm.status b/tests/lib_2/lib_2_vm.status
index f12416d..cd8570e 100644
--- a/tests/lib_2/lib_2_vm.status
+++ b/tests/lib_2/lib_2_vm.status
@@ -92,4 +92,3 @@
[ $arch == simarmv5te || $arch == simarmv6 || $arch == simarm && $runtime == vm ]
convert/chunked_conversion_utf88_test: Skip # Pass, Slow Issue 12644.
-
diff --git a/tests/standalone/standalone.status b/tests/standalone/standalone.status
index 15e2c69..05c6d9c 100644
--- a/tests/standalone/standalone.status
+++ b/tests/standalone/standalone.status
@@ -93,4 +93,3 @@
[ $hot_reload || $hot_reload_rollback ]
script_snapshot_depfile_test: RuntimeError, OK # Child VM doesn't execute Dart.
script_snapshot_not_executed_test: RuntimeError, OK # Child VM doesn't execute Dart.
-
diff --git a/tests/standalone_2/standalone_2.status b/tests/standalone_2/standalone_2.status
index 5e56ee3..6c02786 100644
--- a/tests/standalone_2/standalone_2.status
+++ b/tests/standalone_2/standalone_2.status
@@ -141,7 +141,7 @@
io/web_socket_error_test: Skip # Flaky
io/web_socket_ping_test: Skip # Flaky.
io/web_socket_test: Skip # Flaky.
-map_insert_remove_oom_test: Skip # Crashes
+map_insert_remove_oom_test: Skip # Heap limit too low.
no_support_debugger_test: Skip # kernel-service snapshot not compatible with flag disabled
package/package1_test: CompileTimeError
package/package_test: CompileTimeError
@@ -176,4 +176,3 @@
io/skipping_dart2js_compilations_test: Pass, Slow # Slow.
io/test_runner_test: Pass, Slow # Slow.
package/*: SkipByDesign # Launches VMs in interesting ways.
-
diff --git a/tests/standalone_2/standalone_2_analyzer.status b/tests/standalone_2/standalone_2_analyzer.status
index c0ec279..65c0150 100644
--- a/tests/standalone_2/standalone_2_analyzer.status
+++ b/tests/standalone_2/standalone_2_analyzer.status
@@ -45,4 +45,3 @@
io/raw_secure_server_socket_argument_test: StaticWarning
io/secure_socket_argument_test: StaticWarning
io/stdout_bad_argument_test: StaticWarning
-
diff --git a/tests/standalone_2/standalone_2_flutter.status b/tests/standalone_2/standalone_2_flutter.status
index 2851328..6eddf96 100644
--- a/tests/standalone_2/standalone_2_flutter.status
+++ b/tests/standalone_2/standalone_2_flutter.status
@@ -85,4 +85,3 @@
package/scenarios/packages_file_in_parent/sub/packages_file_in_parent_test: Fail # Unable to parse package files Flutter Issue 9115
package/scenarios/packages_file_only/packages_file_only_test: Fail # Unable to parse package files Flutter Issue 9115
package/scenarios/packages_option_only/packages_option_only_test: Fail # Unable to parse package files Flutter Issue 9115
-
diff --git a/tests/standalone_2/standalone_2_kernel.status b/tests/standalone_2/standalone_2_kernel.status
index 3ee3c80..24ec65b 100644
--- a/tests/standalone_2/standalone_2_kernel.status
+++ b/tests/standalone_2/standalone_2_kernel.status
@@ -22,7 +22,7 @@
package/scenarios/invalid/non_existent_packages_file_test: CompileTimeError # Issue 32085
[ $builder_tag == optimization_counter_threshold && $compiler == dartk ]
-map_insert_remove_oom_test: Pass, Crash, Timeout # Flaky on vm-kernel-optcounter-threshold-linux-release-x64, bug #31838. Sometimes times out, see issue 32786.
+map_insert_remove_oom_test: Skip # Heap limit too low.
[ $compiler == dartk && $mode == debug && $runtime == vm && $strong ]
io/file_lock_test: Slow, Pass
@@ -57,7 +57,7 @@
io/platform_test: RuntimeError # Issue 31904
io/process_non_ascii_test: RuntimeError # Issue 31904
io/regress_7679_test: RuntimeError # Issue 31904
-map_insert_remove_oom_test: Skip # Timeout
+map_insert_remove_oom_test: Skip # Heap limit too low.
# 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
@@ -70,7 +70,7 @@
io/platform_test: RuntimeError # Please triage.
io/test_extension_fail_test: RuntimeError # Please traige.
io/test_extension_test: RuntimeError # Please traige.
-map_insert_remove_oom_test: Crash # Please triage.
+map_insert_remove_oom_test: Skip # Heap limit too low.
package/scenarios/packages_file_strange_formatting/empty_lines_test: CompileTimeError # Please triage.
package/scenarios/packages_file_strange_formatting/mixed_line_ends_test: CompileTimeError # Please triage.
package/scenarios/packages_option_only/packages_option_only_test: CompileTimeError # Please triage.
@@ -122,7 +122,7 @@
io/web_socket_error_test: Skip # Flaky
io/web_socket_ping_test: Skip # Flaky.
io/web_socket_test: Skip # Flaky.
-map_insert_remove_oom_test: Crash
+map_insert_remove_oom_test: Skip # Heap limit too low.
no_support_debugger_test: Skip # kernel-service snapshot not compatible with flag disabled
regress_29350_test: MissingCompileTimeError
regress_29350_test/none: Pass # Issue 31537
@@ -143,4 +143,3 @@
[ $fasta && !$strong ]
regress_29350_test/none: MissingCompileTimeError
-
diff --git a/tests/standalone_2/standalone_2_precompiled.status b/tests/standalone_2/standalone_2_precompiled.status
index d0a9a54..99e6eb8 100644
--- a/tests/standalone_2/standalone_2_precompiled.status
+++ b/tests/standalone_2/standalone_2_precompiled.status
@@ -76,4 +76,3 @@
[ $mode == product || $runtime == dart_precompiled ]
io/code_collection_test: Skip # Incompatible flags
no_assert_test: SkipByDesign # Requires checked mode.
-
diff --git a/tests/standalone_2/standalone_2_vm.status b/tests/standalone_2/standalone_2_vm.status
index 583b0e2..4b95f11 100644
--- a/tests/standalone_2/standalone_2_vm.status
+++ b/tests/standalone_2/standalone_2_vm.status
@@ -84,4 +84,3 @@
full_coverage_test: Skip # TODO(vegorov) SIMDBC interpreter doesn't support coverage yet.
link_natives_lazily_test: SkipByDesign # SIMDBC interpreter doesn't support lazy linking of natives.
no_lazy_dispatchers_test: SkipByDesign # SIMDBC interpreter doesn't support --no_lazy_dispatchers
-
diff --git a/third_party/pkg_tested/pkg_tested.status b/third_party/pkg_tested/pkg_tested.status
index a19ff8d..18998fa 100644
--- a/third_party/pkg_tested/pkg_tested.status
+++ b/third_party/pkg_tested/pkg_tested.status
@@ -5,12 +5,11 @@
# Don't run any test-like files that show up in packages directories. It
# shouldn't be necessary to run "pub install" in these packages, but if you do
# it shouldn't break the tests.
-*/packages/*/*: Skip
-*/*/packages/*/*: Skip
-*/*/*/packages/*/*: Skip
-*/*/*/*/packages/*/*: Skip
*/*/*/*/*/packages/*/*: Skip
-
+*/*/*/*/packages/*/*: Skip
+*/*/*/packages/*/*: Skip
+*/*/packages/*/*: Skip
+*/packages/*/*: Skip
pub/test/dart2js/compiles_generated_file_from_dependency_test: Pass, Slow
pub/test/serve/web_socket/url_to_asset_id_test: Pass, Slow
pub/test/transformer/loads_a_diamond_transformer_dependency_graph_test: Pass, Slow
@@ -23,7 +22,7 @@
pub/test/run/app_can_read_from_stdin_test: Fail # Issue 19448
pub/test/run/forwards_signal_posix_test: SkipByDesign
-[ $runtime == vm && ($mode == debug || $arch == simarm || $arch == simarmv6 || $arch == simarmv5te || $arch == simarm64 || $builder_tag == asan) ]
+[ $runtime == vm && ($arch == simarm || $arch == simarm64 || $arch == simarmv5te || $arch == simarmv6 || $builder_tag == asan || $mode == debug) ]
dart_style/test/command_line_test: Skip # The test controller does not take into account that tests take much longer in debug mode or on simulators.
dart_style/test/formatter_test: Skip # The test controller does not take into account that tests take much longer in debug mode or on simulators.
diff --git a/tools/VERSION b/tools/VERSION
index 5eab473..7f55251 100644
--- a/tools/VERSION
+++ b/tools/VERSION
@@ -27,5 +27,5 @@
MAJOR 2
MINOR 0
PATCH 0
-PRERELEASE 47
+PRERELEASE 48
PRERELEASE_PATCH 0
diff --git a/tools/dom/idl/dart/dart.idl b/tools/dom/idl/dart/dart.idl
index 0bab867..6773b11 100644
--- a/tools/dom/idl/dart/dart.idl
+++ b/tools/dom/idl/dart/dart.idl
@@ -473,6 +473,11 @@
};
[DartSupplemental]
+interface DOMRect {
+ [DartSuppress] static DOMRect fromRect(optional DOMRectInit other);
+};
+
+[DartSupplemental]
interface SVGSVGElement {
[DartSuppress] attribute DOMString contentStyleType;
[DartSuppress] attribute DOMString contentScriptType;
diff --git a/tools/dom/scripts/generator.py b/tools/dom/scripts/generator.py
index 4c7ae18..7a14fd1 100644
--- a/tools/dom/scripts/generator.py
+++ b/tools/dom/scripts/generator.py
@@ -275,6 +275,8 @@
'ChannelMergerNode': 'ChannelMergerNode,AudioChannelMerger',
'ChannelSplitterNode': 'ChannelSplitterNode,AudioChannelSplitter',
+ 'DOMRect': 'ClientRect,DOMRect',
+
'DOMRectList': 'ClientRectList,DOMRectList',
'CSSStyleDeclaration':
diff --git a/tools/gardening/bin/compare_failures.dart b/tools/gardening/bin/compare_failures.dart
index d747515..0102534 100644
--- a/tools/gardening/bin/compare_failures.dart
+++ b/tools/gardening/bin/compare_failures.dart
@@ -32,6 +32,8 @@
ArgParser argParser = createArgParser();
argParser.addOption("run-count",
defaultsTo: "10", help: "How many previous runs should be fetched");
+ argParser.addFlag("force",
+ abbr: "f", defaultsTo: false, help: "Force analysis of past results");
argParser.addOption(Flags.commit,
help: "Fetch result start from a given commit hash.");
ArgResults argResults = argParser.parse(args);
@@ -50,6 +52,7 @@
runCount: runCount,
commit: argResults[Flags.commit],
verbose: argResults[Flags.verbose],
- noCache: argResults[Flags.noCache]);
+ noCache: argResults[Flags.noCache],
+ forcePastResults: argResults["force"]);
bot.close();
}
diff --git a/tools/gardening/bin/results_list.dart b/tools/gardening/bin/results_list.dart
index b90bb6f..ea19914 100644
--- a/tools/gardening/bin/results_list.dart
+++ b/tools/gardening/bin/results_list.dart
@@ -27,11 +27,12 @@
argParser.addFlag("hot-reload-rollback", negatable: false);
argParser.addFlag("minified", negatable: false);
argParser.addOption("mode", allowed: Mode.names);
+ argParser.addFlag("no-preview-dart-2", negatable: false);
+ argParser.addFlag("preview-dart-2", negatable: false);
argParser.addOption("runtime", allowed: Runtime.names);
argParser.addFlag("strong", negatable: false);
argParser.addOption("system", allowed: System.names);
argParser.addFlag("use-sdk", negatable: false);
- argParser.addFlag("preview-dart-2", negatable: false);
}
/// Helper function to get a configuration from [argResults].
@@ -58,6 +59,7 @@
argResults["enable-asserts"],
argResults["hot-reload"],
argResults["hot-reload-rollback"],
+ argResults["no-preview-dart-2"],
argResults["preview-dart-2"],
argResults.rest);
}
diff --git a/tools/gardening/lib/src/compare_failures_impl.dart b/tools/gardening/lib/src/compare_failures_impl.dart
index bc4c895..b24968b 100644
--- a/tools/gardening/lib/src/compare_failures_impl.dart
+++ b/tools/gardening/lib/src/compare_failures_impl.dart
@@ -21,13 +21,15 @@
{int runCount: 10,
String commit,
bool verbose: false,
- bool noCache: false}) async {
+ bool noCache: false,
+ bool forcePastResults: false}) async {
printBuildResultsSummary(
await loadBuildResults(bot, args,
runCount: runCount,
commit: commit,
verbose: verbose,
- noCache: noCache),
+ noCache: noCache,
+ forcePastResults: forcePastResults),
args);
}
@@ -40,7 +42,8 @@
{int runCount: 10,
String commit,
bool verbose: false,
- bool noCache: false}) async {
+ bool noCache: false,
+ bool forcePastResults: false}) async {
List<BuildUri> buildUriList = <BuildUri>[];
List<BuildDetail> buildDetails;
if (commit != null) {
@@ -110,8 +113,9 @@
for (int index = 0; index < buildResults.length; index++) {
BuildUri buildUri = buildUriList[index];
BuildResult buildResult = buildResults[index];
- List<BuildResult> results =
- await readPastResults(bot, buildUri, buildResult, runCount);
+ List<BuildResult> results = await readPastResults(
+ bot, buildUri, buildResult, runCount,
+ forcePastResults: forcePastResults);
pastResultsMap[buildUri] = results;
}
return pastResultsMap;
@@ -172,14 +176,15 @@
/// Creates a [BuildResult] for [buildUri] and, if it contains failures, the
/// [BuildResult]s for the previous [runCount] builds.
Future<List<BuildResult>> readPastResults(
- Bot bot, BuildUri buildUri, BuildResult summary, int runCount) async {
+ Bot bot, BuildUri buildUri, BuildResult summary, int runCount,
+ {bool forcePastResults: false}) async {
List<BuildResult> summaries = <BuildResult>[];
if (summary == null) {
print('No result found for $buildUri');
return summaries;
}
summaries.add(summary);
- if (summary.hasFailures) {
+ if (summary.hasFailures || forcePastResults) {
summaries.addAll(await bot.readHistoricResults(summary.buildUri.prev(),
previousCount: runCount - 1));
}
diff --git a/tools/gardening/lib/src/logdog_rpc.dart b/tools/gardening/lib/src/logdog_rpc.dart
index cc60d77..06e7766 100644
--- a/tools/gardening/lib/src/logdog_rpc.dart
+++ b/tools/gardening/lib/src/logdog_rpc.dart
@@ -27,7 +27,7 @@
StringBuffer buffer = new StringBuffer();
json["logs"].forEach((log) {
log["text"]["lines"].forEach((line) {
- buffer.write(line["value"]);
+ buffer.writeln(line["value"]);
});
});
return buffer.toString();
diff --git a/tools/gardening/lib/src/results/configuration_environment.dart b/tools/gardening/lib/src/results/configuration_environment.dart
index 667a772..2e27e60 100644
--- a/tools/gardening/lib/src/results/configuration_environment.dart
+++ b/tools/gardening/lib/src/results/configuration_environment.dart
@@ -46,6 +46,7 @@
}),
"minified": new _Variable.bool((c) => c.minified),
"mode": new _Variable((c) => c.mode, Mode.names),
+ "no_preview_dart_2": new _Variable.bool((c) => c.noPreviewDart2),
"preview_dart_2": new _Variable.bool((c) => c.previewDart2),
"runtime": new _Variable(_runtimeName, Runtime.names),
"spec_parser": new _Variable.bool((c) => c.compiler == Compiler.specParser),
diff --git a/tools/gardening/lib/src/results/result_json_models.dart b/tools/gardening/lib/src/results/result_json_models.dart
index 9f96d48..020859d 100644
--- a/tools/gardening/lib/src/results/result_json_models.dart
+++ b/tools/gardening/lib/src/results/result_json_models.dart
@@ -28,6 +28,7 @@
final bool enableAsserts;
final bool hotReload;
final bool hotReloadRollback;
+ final bool noPreviewDart2;
final bool previewDart2;
final List<String> selectors;
@@ -53,6 +54,7 @@
this.enableAsserts,
this.hotReload,
this.hotReloadRollback,
+ this.noPreviewDart2,
this.previewDart2,
this.selectors);
@@ -79,6 +81,7 @@
json["enable_asserts"] ?? false,
json["hot_reload"] ?? false,
json["hot_reload_rollback"] ?? false,
+ json["no_preview_dart_2"] ?? false,
json["preview_dart_2"] ?? false,
json["selectors"] ?? []);
}
@@ -107,6 +110,7 @@
_boolToArg("enable-asserts", enableAsserts),
_boolToArg("hot-reload", hotReload),
_boolToArg("hot-reload-rollback", hotReloadRollback),
+ _boolToArg("no-preview-dart-2", noPreviewDart2),
_boolToArg("preview-dart-2", previewDart2)
].where((x) => x != null).toList();
if (includeSelectors && selectors != null && selectors.length > 0) {
@@ -119,7 +123,7 @@
return "$mode;$arch;$compiler;$runtime;$checked;$strong;$hostChecked;"
"$minified;$csp;$fasta;$system;$vmOptions;$useSdk;$builderTag;$fastStartup;"
"$dart2JsWithKernel;$dart2JsOldFrontend;$enableAsserts;$hotReload;"
- "$hotReloadRollback;$previewDart2;$selectors";
+ "$hotReloadRollback;$noPreviewDart2;$previewDart2;$selectors";
}
String _stringToArg(String name, String value) {
diff --git a/tools/gardening/lib/src/results_workflow/fix_failing_test.dart b/tools/gardening/lib/src/results_workflow/fix_failing_test.dart
index cb075ba..6e50760 100644
--- a/tools/gardening/lib/src/results_workflow/fix_failing_test.dart
+++ b/tools/gardening/lib/src/results_workflow/fix_failing_test.dart
@@ -193,7 +193,7 @@
.contains(currentSection.section)) {
currentSection.statusFile.sections.add(currentSection.section);
}
- currentSection.section.entries.add(statusEntry);
+ currentSection.section.entries.insert(0, statusEntry);
changedFiles.add(currentSection.statusFile);
}
// Save the modified status files.
@@ -218,7 +218,8 @@
section.condition != null &&
section.condition.normalize().compareTo(expression) == 0,
orElse: () => null);
- sectionToAdd ??= new StatusSection(expression, 0, []);
+ sectionToAdd ??= new StatusSection(expression, 0, [])
+ ..entries.add(new EmptyEntry(0));
var section = new StatusSectionWithFile(statusFile, sectionToAdd);
_customSections.add(new _CustomSection(section));
_currentWorkingItem.currentSections.add(section);
@@ -321,7 +322,8 @@
var file = customSection._findStatusFile(files);
if (file != null) {
var section = customSection._findSectionInFile(file);
- section ??= new StatusSection(customSection.condition, 0, []);
+ section ??= new StatusSection(customSection.condition, 0, [])
+ ..entries.add(new EmptyEntry(0));
return [new StatusSectionWithFile(file, section)];
}
return [];
diff --git a/tools/gardening/lib/src/results_workflow/present_failures.dart b/tools/gardening/lib/src/results_workflow/present_failures.dart
index db5f033..8fc562a 100644
--- a/tools/gardening/lib/src/results_workflow/present_failures.dart
+++ b/tools/gardening/lib/src/results_workflow/present_failures.dart
@@ -39,10 +39,11 @@
}
@override
- Future<WorkflowAction> input(String input) {
+ Future<WorkflowAction> input(String input) async {
if (input == "y") {
- return new Future.value(new BackWorkflowAction());
+ return new BackWorkflowAction();
}
+ return null;
}
@override
diff --git a/tools/sdks/README b/tools/sdks/README
index 480627f..9bfd810 100644
--- a/tools/sdks/README
+++ b/tools/sdks/README
@@ -11,10 +11,8 @@
The linux SDK has two extra dart executables added to the bin directory.
'dart-arm' and 'dart-arm64' are executables compiled to run on
arm and arm64 (aarch64) processors, respectively. We are currently
-using the 32-bit ia32 build as the default on linux, windows, and macos.
-If we switch to the 64-bit build on linux, the snapshots will no longer be
-portable to arm and arm64, and we will need to upload complete SDKs for each
-processor architecture.
+using the 32-bit ia32 build as the default on windows, and the 64-bit x64
+build as the default on linux and macos.
To upload new versions of these tar files, use the "upload_to_google_storage"
tool in depot_tools, and download the new stable SDKs from the dartlang.org
diff --git a/tools/sdks/linux/dart-sdk.tar.gz.sha1 b/tools/sdks/linux/dart-sdk.tar.gz.sha1
index b8078c6..0e891a6 100644
--- a/tools/sdks/linux/dart-sdk.tar.gz.sha1
+++ b/tools/sdks/linux/dart-sdk.tar.gz.sha1
@@ -1 +1 @@
-d603d2f9fe59281e37a250cb3105ab54d1c25e64
\ No newline at end of file
+2bb209191a1e2928b322636727c681cc0c3cf825
\ No newline at end of file
diff --git a/tools/sdks/mac/dart-sdk.tar.gz.sha1 b/tools/sdks/mac/dart-sdk.tar.gz.sha1
index e7dd518..d5aa942 100644
--- a/tools/sdks/mac/dart-sdk.tar.gz.sha1
+++ b/tools/sdks/mac/dart-sdk.tar.gz.sha1
@@ -1 +1 @@
-7b5adc71c75dc07815ccd8f233c4ccf50d11e11f
\ No newline at end of file
+32908822cad77ec2ea148440cc6f99d172f477dc
\ No newline at end of file
diff --git a/tools/sdks/win/dart-sdk.tar.gz.sha1 b/tools/sdks/win/dart-sdk.tar.gz.sha1
index 5ade4b8..7d2efd4 100644
--- a/tools/sdks/win/dart-sdk.tar.gz.sha1
+++ b/tools/sdks/win/dart-sdk.tar.gz.sha1
@@ -1 +1 @@
-520e55c06f22a50938c1682e6e0a56161fc43a65
\ No newline at end of file
+e8959966bba1424ac2573d15caff499281cb7d87
\ No newline at end of file
diff --git a/tools/testing/dart/configuration.dart b/tools/testing/dart/configuration.dart
index a98de9e..769e0b7 100644
--- a/tools/testing/dart/configuration.dart
+++ b/tools/testing/dart/configuration.dart
@@ -40,6 +40,7 @@
this.isVerbose,
this.listTests,
this.listStatusFiles,
+ this.noPreviewDart2,
this.previewDart2,
this.printTiming,
this.printReport,
@@ -114,6 +115,7 @@
final bool isVerbose;
final bool listTests;
final bool listStatusFiles;
+ final bool noPreviewDart2;
final bool previewDart2;
final bool printTiming;
final bool printReport;
@@ -474,6 +476,7 @@
'builder_tag': builderTag,
'fast_startup': useFastStartup,
'timeout': timeout,
+ 'no_preview_dart_2': noPreviewDart2,
'preview_dart_2': previewDart2,
'dart2js_with_kernel': useDart2JSWithKernel,
'dart2js_old_frontend': useDart2JSOldFrontend,
diff --git a/tools/testing/dart/environment.dart b/tools/testing/dart/environment.dart
index 1e4114e..01da811 100644
--- a/tools/testing/dart/environment.dart
+++ b/tools/testing/dart/environment.dart
@@ -32,6 +32,7 @@
"jscl": new _Variable.bool((c) => c.runtime.isJSCommandLine),
"minified": new _Variable.bool((c) => c.isMinified),
"mode": new _Variable((c) => c.mode.name, Mode.names),
+ "no_preview_dart_2": new _Variable.bool((c) => c.noPreviewDart2),
"preview_dart_2": new _Variable.bool((c) => c.previewDart2),
"runtime": new _Variable(_runtimeName, Runtime.names),
"spec_parser": new _Variable.bool((c) => c.compiler == Compiler.specParser),
diff --git a/tools/testing/dart/options.dart b/tools/testing/dart/options.dart
index 4b3eac5..93f6d44 100644
--- a/tools/testing/dart/options.dart
+++ b/tools/testing/dart/options.dart
@@ -167,6 +167,9 @@
new _Option.bool('enable_asserts',
'Pass the --enable-asserts flag to dart2js or to the vm.'),
new _Option.bool(
+ 'no-preview_dart_2', 'Pass the --no-preview-dart-2 flag to analyzer.',
+ hide: true),
+ new _Option.bool(
'preview_dart_2', 'Pass the --preview-dart-2 flag to analyzer.',
hide: true),
// TODO(sigmund): replace dart2js_with_kernel with preview-dart-2.
@@ -641,6 +644,7 @@
isVerbose: data["verbose"] as bool,
listTests: data["list"] as bool,
listStatusFiles: data["list_status_files"] as bool,
+ noPreviewDart2: data["no-preview_dart_2"] as bool,
previewDart2: data["preview_dart_2"] as bool,
printTiming: data["time"] as bool,
printReport: data["report"] as bool,
diff --git a/tools/testing/dart/test_suite.dart b/tools/testing/dart/test_suite.dart
index 5bffb8b..25e8a79 100644
--- a/tools/testing/dart/test_suite.dart
+++ b/tools/testing/dart/test_suite.dart
@@ -1325,6 +1325,7 @@
args.add('--format=machine');
args.add('--no-hints');
if (configuration.previewDart2) args.add("--preview-dart-2");
+ if (configuration.noPreviewDart2) args.add("--no-preview-dart-2");
if (filePath.filename.contains("dart2js") ||
filePath.directoryPath.segments().last.contains('html_common')) {
diff --git a/utils/application_snapshot.gni b/utils/application_snapshot.gni
index 3441c84..d078775 100644
--- a/utils/application_snapshot.gni
+++ b/utils/application_snapshot.gni
@@ -84,3 +84,57 @@
}
}
}
+
+template("aot_assembly") {
+ assert(defined(invoker.main_dart), "Must specify 'main_dart'")
+ vm_args = []
+ if (defined(invoker.vm_args)) {
+ vm_args = invoker.vm_args
+ }
+ main_dart = invoker.main_dart
+ name = target_name
+ if (defined(invoker.name)) {
+ name = invoker.name
+ }
+ extra_deps = []
+ if (defined(invoker.deps)) {
+ extra_deps += invoker.deps
+ }
+ extra_inputs = [ main_dart ]
+ if (defined(invoker.inputs)) {
+ extra_inputs += invoker.inputs
+ }
+ if (defined(invoker.dot_packages)) {
+ dot_packages = invoker.dot_packages
+ } else {
+ dot_packages = rebase_path("$_dart_root/.packages")
+ }
+ output = "$root_gen_dir/$name.dart.S"
+ if (defined(invoker.output)) {
+ output = invoker.output
+ }
+ compiled_action(target_name) {
+ tool = "$_dart_root/runtime/bin:dart_bootstrap"
+ deps = extra_deps
+ depfile = "$output.d"
+
+ main_file = rebase_path(main_dart)
+
+ inputs = extra_inputs + [ main_file ]
+
+ outputs = [
+ output,
+ ]
+
+ abs_depfile = rebase_path(depfile)
+ abs_output = rebase_path(output, root_build_dir)
+
+ args = [
+ "--deterministic",
+ "--packages=$dot_packages",
+ "--snapshot-kind=app-aot",
+ "--snapshot=$abs_output",
+ "--snapshot-depfile=$abs_depfile",
+ ] + vm_args + [ main_file ]
+ }
+}
diff --git a/utils/dartanalyzer/BUILD.gn b/utils/dartanalyzer/BUILD.gn
index a07aca1..67415d5 100644
--- a/utils/dartanalyzer/BUILD.gn
+++ b/utils/dartanalyzer/BUILD.gn
@@ -36,6 +36,29 @@
inputs = cli_files + analyzer_files
}
+aot_assembly("dartanalyzer_aot_assembly") {
+ main_dart = "../../pkg/analyzer_cli/bin/analyzer.dart"
+ name = "dartanalyzer"
+ cli_files = exec_script("../../tools/list_dart_files.py",
+ [
+ "absolute",
+ rebase_path("../../pkg/analyzer_cli"),
+ ],
+ "list lines")
+ inputs = cli_files + analyzer_files
+}
+
+# This target is for Goma. It should not be used in the SDK.
+executable("dartanalyzer_aot") {
+ deps = [
+ "../../runtime/bin:dart_precompiled_runtime_for_linking",
+ ":dartanalyzer_aot_assembly",
+ ]
+ sources = [
+ "$root_gen_dir/dartanalyzer.dart.S"
+ ]
+}
+
sdk_lib_files = exec_script("../../tools/list_dart_files.py",
[
"absolute",
diff --git a/utils/tests/peg/peg.status b/utils/tests/peg/peg.status
index 0dbf2da..c53547d 100644
--- a/utils/tests/peg/peg.status
+++ b/utils/tests/peg/peg.status
@@ -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.
-[ $arch == x64 ]
-*: Skip
-
[ $arch == arm ]
*: Skip
@@ -13,3 +10,6 @@
[ $arch == simarm64 ]
*: Skip
+
+[ $arch == x64 ]
+*: Skip