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

Unified Diff: pkg/kernel/lib/transformations/insert_covariance_checks.dart

Issue 2904203003: Don't recreate CoreTypes in transformers. Pass it in. (Closed)
Patch Set: Don't create CoreTypes in createOutlines() on InputError. Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: pkg/kernel/lib/transformations/insert_covariance_checks.dart
diff --git a/pkg/kernel/lib/transformations/insert_covariance_checks.dart b/pkg/kernel/lib/transformations/insert_covariance_checks.dart
index 050e6915a5db0519897a31d8b70fed827197ecc7..82f9682773a57ba63905776de387724c8c1a70fd 100644
--- a/pkg/kernel/lib/transformations/insert_covariance_checks.dart
+++ b/pkg/kernel/lib/transformations/insert_covariance_checks.dart
@@ -53,8 +53,8 @@ DartType substituteBounds(DartType type, Map<TypeParameter, DartType> upper,
/// Currently, we only deduce that the type arguments are exact when the
/// receiver is `this`.
class InsertCovarianceChecks {
+ final CoreTypes coreTypes;
ClassHierarchy hierarchy;
- CoreTypes coreTypes;
TypeEnvironment types;
/// Maps unsafe members to their checked entry point, to be used at call sites
@@ -70,11 +70,10 @@ class InsertCovarianceChecks {
/// in [unsafeMemberEntryPoint].
final Set<Member> membersWithCheckedEntryPoint = new Set<Member>();
- InsertCovarianceChecks({this.hierarchy, this.coreTypes});
+ InsertCovarianceChecks(this.coreTypes, {this.hierarchy});
void transformProgram(Program program) {
hierarchy ??= new ClassHierarchy(program);
- coreTypes ??= new CoreTypes(program);
types = new TypeEnvironment(coreTypes, hierarchy);
// We transform every class before their subtypes.
// This ensures that transitive overrides are taken into account.
« no previous file with comments | « pkg/kernel/lib/transformations/generic_types_reification.dart ('k') | pkg/kernel/lib/transformations/insert_type_checks.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698