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

Unified Diff: pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/operations.dart

Issue 2869733006: Revert "Revert "fix #27256, track type bounds for generic functions"" (Closed)
Patch Set: 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/dev_compiler/tool/input_sdk/private/ddc_runtime/operations.dart
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 8e8a2cd130b78152f2ee78e6406ea2a16a3590eb..b2fd6c586fbbfa009403195d6980172b0e652856 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
@@ -246,9 +246,7 @@ _checkAndCall(f, ftype, obj, typeArgs, args, name) => JS(
let formalCount = $ftype.formalCount;
if ($typeArgs == null) {
- // TODO(jmesserly): this should use instantiate to bounds logic.
- // See https://github.com/dart-lang/sdk/issues/27256
- $typeArgs = Array(formalCount).fill($dynamic);
+ $typeArgs = $ftype.instantiateDefaultBounds();
} else if ($typeArgs.length != formalCount) {
// TODO(jmesserly): is this the right error?
$throwStrongModeError(
@@ -256,7 +254,6 @@ _checkAndCall(f, ftype, obj, typeArgs, args, name) => JS(
$typeName($ftype) + ', got <' + $typeArgs + '> expected ' +
formalCount + '.');
}
- // Instantiate the function type.
$ftype = $ftype.instantiate($typeArgs);
} else if ($typeArgs != null) {
$throwStrongModeError(

Powered by Google App Engine
This is Rietveld 408576698