Skip to content
This repository has been archived by the owner on Apr 29, 2024. It is now read-only.

Commit

Permalink
Add correct cast to interface method invocation (#385)
Browse files Browse the repository at this point in the history
  • Loading branch information
brianquinlan authored Sep 10, 2023
1 parent b845ff1 commit 49d4ac0
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 6 deletions.
3 changes: 3 additions & 0 deletions jnigen/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## 0.6.1-wip
* Added an explicit cast in generated `<Interface>.implement` code to allow `dart analyze` to pass when `strict-casts` is set.

## 0.6.0
* **Breaking Change** ([#131](https://github.com/dart-lang/jnigen/issues/131)): Renamed `delete*` to `release*`.
* **Breaking Change** ([#354](https://github.com/dart-lang/jnigen/issues/354)): Renamed constructors from `ctor1`, `ctor2`, ... to `new1`, `new2`, ...
Expand Down
2 changes: 1 addition & 1 deletion jnigen/lib/src/bindings/dart_generator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,7 @@ class $name$typeParamsDef extends $superName {
\$p.close();
return;
}
final \$i = \$MethodInvocation.fromMessage(\$m);
final \$i = \$MethodInvocation.fromMessage(\$m as List<dynamic>);
final \$r = _\$invokeMethod(\$p.sendPort.nativePort, \$i);
$_protectedExtension.returnResult(\$i.result, \$r);
});
Expand Down
2 changes: 1 addition & 1 deletion jnigen/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

name: jnigen
description: A Dart bindings generator for Java and Kotlin that uses JNI under the hood to interop with Java virtual machine.
version: 0.6.0
version: 0.6.1-wip
repository: https://github.com/dart-lang/jnigen/tree/main/jnigen

environment:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3435,7 +3435,7 @@ class MyInterface<$T extends jni.JObject> extends jni.JObject {
$p.close();
return;
}
final $i = $MethodInvocation.fromMessage($m);
final $i = $MethodInvocation.fromMessage($m as List<dynamic>);
final $r = _$invokeMethod($p.sendPort.nativePort, $i);
ProtectedJniExtensions.returnResult($i.result, $r);
});
Expand Down Expand Up @@ -3733,7 +3733,7 @@ class MyRunnable extends jni.JObject {
$p.close();
return;
}
final $i = $MethodInvocation.fromMessage($m);
final $i = $MethodInvocation.fromMessage($m as List<dynamic>);
final $r = _$invokeMethod($p.sendPort.nativePort, $i);
ProtectedJniExtensions.returnResult($i.result, $r);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3244,7 +3244,7 @@ class MyInterface<$T extends jni.JObject> extends jni.JObject {
$p.close();
return;
}
final $i = $MethodInvocation.fromMessage($m);
final $i = $MethodInvocation.fromMessage($m as List<dynamic>);
final $r = _$invokeMethod($p.sendPort.nativePort, $i);
ProtectedJniExtensions.returnResult($i.result, $r);
});
Expand Down Expand Up @@ -3540,7 +3540,7 @@ class MyRunnable extends jni.JObject {
$p.close();
return;
}
final $i = $MethodInvocation.fromMessage($m);
final $i = $MethodInvocation.fromMessage($m as List<dynamic>);
final $r = _$invokeMethod($p.sendPort.nativePort, $i);
ProtectedJniExtensions.returnResult($i.result, $r);
});
Expand Down

0 comments on commit 49d4ac0

Please sign in to comment.