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

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

Issue 2665723002: Implement canonical name scheme in kernel. (Closed)
Patch Set: Address Kevin's comments Created 3 years, 10 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 662dda968f71743ec587344ba3293aa1d5307cbd..081dbfaf7192635eda934ba1ab3434e73f1b9d6d 100644
--- a/pkg/kernel/lib/transformations/insert_covariance_checks.dart
+++ b/pkg/kernel/lib/transformations/insert_covariance_checks.dart
@@ -11,7 +11,6 @@ import '../log.dart';
import '../type_algebra.dart';
import '../type_environment.dart';
-// TODO: Should helper be removed?
DartType substituteBounds(DartType type, Map<TypeParameter, DartType> upper,
Map<TypeParameter, DartType> lower) {
return Substitution
@@ -117,8 +116,8 @@ class _ClassTransformer {
Map<TypeParameter, DartType> superUpperBounds;
/// Members for which a checked entry point must be created in this current
- /// class.
- Set<Member> membersNeedingCheckedEntryPoint = new Set<Member>();
+ /// class, indexed by name.
+ Map<Name, Member> membersNeedingCheckedEntryPoint = <Name, Member>{};
_ClassTransformer(this.host, InsertCovarianceChecks global)
: hierarchy = global.hierarchy,
@@ -158,9 +157,8 @@ class _ClassTransformer {
/// Ensures that a checked entry point for [member] will be emitted in the
/// current class.
void requireLocalCheckedEntryPoint(Member member) {
- if (membersNeedingCheckedEntryPoint.add(member)) {
- global.membersWithCheckedEntryPoint.add(member);
- }
+ membersNeedingCheckedEntryPoint[member.name] = member;
+ global.membersWithCheckedEntryPoint.add(member);
}
void transformClass() {
@@ -225,7 +223,7 @@ class _ClassTransformer {
}
});
- for (Member member in membersNeedingCheckedEntryPoint) {
+ for (Member member in membersNeedingCheckedEntryPoint.values) {
ownSubstitution = getSubstitutionMap(
hierarchy.getClassAsInstanceOf(host, member.enclosingClass));
ownSubstitution = ensureMutable(ownSubstitution);
« no previous file with comments | « pkg/kernel/lib/transformations/empty.dart ('k') | pkg/kernel/lib/transformations/mixin_full_resolution.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698