Index: pkg/compiler/lib/src/native/behavior.dart |
diff --git a/pkg/compiler/lib/src/native/behavior.dart b/pkg/compiler/lib/src/native/behavior.dart |
index daa6ddc920cee80e287765dc58fdc1b428087b71..a4e292274bed253b2b46795aa84e8debbd590537 100644 |
--- a/pkg/compiler/lib/src/native/behavior.dart |
+++ b/pkg/compiler/lib/src/native/behavior.dart |
@@ -705,13 +705,12 @@ class NativeBehavior { |
behavior._capture(type, compiler.resolution, |
isInterop: isInterop, compiler: compiler); |
- // TODO(sra): Optional arguments are currently missing from the |
- // DartType. This should be fixed so the following work-around can be |
- // removed. |
- method.functionSignature |
- .forEachOptionalParameter((ParameterElement parameter) { |
- behavior._escape(parameter.type, compiler.resolution); |
- }); |
+ for (DartType type in type.optionalParameterTypes) { |
+ behavior._escape(type, compiler.resolution); |
+ } |
+ for (DartType type in type.namedParameterTypes) { |
+ behavior._escape(type, compiler.resolution); |
+ } |
behavior._overrideWithAnnotations(method, compiler); |
return behavior; |