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

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

Issue 2340463009: fix #27353, support `@checked` covariant parameters in DDC (Closed)
Patch Set: Created 4 years, 3 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
« no previous file with comments | « no previous file | pkg/dev_compiler/pubspec.lock » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/dev_compiler/lib/src/compiler/code_generator.dart
diff --git a/pkg/dev_compiler/lib/src/compiler/code_generator.dart b/pkg/dev_compiler/lib/src/compiler/code_generator.dart
index 783e7da39cf254546081c1448d3c88dbd217a656..9116b78aab410a285024a98f8064a8df3d73b532 100644
--- a/pkg/dev_compiler/lib/src/compiler/code_generator.dart
+++ b/pkg/dev_compiler/lib/src/compiler/code_generator.dart
@@ -2179,13 +2179,13 @@ class CodeGenerator extends GeneralizingAstVisitor
// TODO(jmesserly): various problems here, see:
// https://github.com/dart-lang/dev_compiler/issues/116
var paramType = param.element.type;
- if (node is MethodDeclaration && _unsoundCovariant(paramType, true)) {
+ if (node is MethodDeclaration &&
+ (param.element.isCovariant || _unsoundCovariant(paramType, true)) &&
+ !_inWhitelistCode(node)) {
var castType = _emitType(paramType,
nameType: options.nameTypeTests || options.hoistTypeTests,
hoistType: options.hoistTypeTests);
- if (!_inWhitelistCode(node)) {
- body.add(js.statement('#._check(#);', [castType, jsParam]));
- }
+ body.add(js.statement('#._check(#);', [castType, jsParam]));
}
}
return body.isEmpty ? null : _statement(body);
« no previous file with comments | « no previous file | pkg/dev_compiler/pubspec.lock » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698