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

Unified Diff: pkg/dev_compiler/lib/src/compiler/type_utilities.dart

Issue 2954523002: fix #27259, implement covariance checking for strong mode and DDC (Closed)
Patch Set: merged and fix an analysis error Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: pkg/dev_compiler/lib/src/compiler/type_utilities.dart
diff --git a/pkg/dev_compiler/lib/src/compiler/type_utilities.dart b/pkg/dev_compiler/lib/src/compiler/type_utilities.dart
index 1f1afa7b1513ac0b0e7f02b43e5ce7ce5198dd87..c78f34eb3dff6f9d3c28e50863e7b1de69d2b8c4 100644
--- a/pkg/dev_compiler/lib/src/compiler/type_utilities.dart
+++ b/pkg/dev_compiler/lib/src/compiler/type_utilities.dart
@@ -150,12 +150,6 @@ class _GeneratorTable extends _CacheTable {
}
class TypeTable {
- /// Cache variable names for types emitted in place.
- final _cacheNames = new _CacheTable();
-
- /// Cache variable names for definite function types emitted in place.
- final _definiteCacheNames = new _CacheTable();
-
/// Generator variable names for hoisted types.
final _GeneratorTable _generators;
@@ -177,12 +171,9 @@ class TypeTable {
/// emit the definitions which depend on the formals.
List<JS.Statement> discharge([List<TypeParameterElement> formals]) {
var filter = formals?.expand((p) => _scopeDependencies[p] ?? <DartType>[]);
- var stmts = [
- _cacheNames,
- _definiteCacheNames,
- _generators,
- _definiteGenerators
- ].expand((c) => c.discharge(filter)).toList();
+ var stmts = [_generators, _definiteGenerators]
+ .expand((c) => c.discharge(filter))
+ .toList();
formals?.forEach(_scopeDependencies.remove);
return stmts;
}
@@ -231,11 +222,8 @@ class TypeTable {
/// types and other types (since the same DartType may have different
/// representations as definite and indefinite function types).
JS.Expression nameType(DartType type, JS.Expression typeRep,
- {bool hoistType, bool definite: false}) {
- assert(hoistType != null);
- var table = hoistType
- ? (definite ? _definiteGenerators : _generators)
- : (definite ? _definiteCacheNames : _cacheNames);
+ {bool definite: false}) {
+ var table = definite ? _definiteGenerators : _generators;
if (!table.isNamed(type)) {
if (recordScopeDependencies(type)) return typeRep;
}
« no previous file with comments | « pkg/dev_compiler/lib/src/compiler/reify_coercions.dart ('k') | pkg/dev_compiler/test/browser/language_tests.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698