Comments (5)
It's a bit hard to see what even is the difference of your snippets, so here the diff:
-public convenience init(databaseUrl: String) {
- let pointer = throws try rustCallWithError(FfiConverterTypeClipError.lift) {
+public convenience init(databaseUrl: String) throws {
+ let pointer = try rustCallWithError(FfiConverterTypeClipError.lift) {
uniffi_device_kit_fn_constructor_devicemanager_new(
FfiConverterString.lower(databaseUrl), $0
)
}
self.init(unsafeFromRawPointer: pointer)
}
from uniffi-rs.
quick bisect shows that this broke in #2048
cc @mhammond
easy to reproduce with this patch:
--- fixtures/coverall/src/coverall.udl
+++ fixtures/coverall/src/coverall.udl
@@ -282,4 +282,9 @@ interface ISecond {
boolean compare(IFirst? other);
};
+interface DeviceManager {
+ [Throws=CoverallError]
+ constructor([ByRef] string database_url);
+};
+
dictionary EmptyStruct {};
diff --git fixtures/coverall/src/lib.rs fixtures/coverall/src/lib.rs
index d7ba23856..79edd4fc1 100644
--- fixtures/coverall/src/lib.rs
+++ fixtures/coverall/src/lib.rs
@@ -584,4 +584,13 @@ impl ISecond {
pub struct EmptyStruct;
+pub struct DeviceManager;
+
+impl DeviceManager {
+ pub fn new(url: &String) -> Result<DeviceManager, CoverallError> {
+ todo!()
+ }
+}
+
+
uniffi::include_scaffolding!("coverall");
Running this:
UNIFFI_TESTS_DISABLE_EXTENSIONS=kts,py,rb cargo test -p uniffi-fixture-coverall
fails with:
src/uniffi-rs/target/tmp/uniffi-fixture-coverall-6e842bdd9758c583/coverall.swift:1057:19: error: expected initial value after '='
let pointer = throws try rustCallWithError(FfiConverterTypeCoverallError.lift) {
^
src/uniffi-rs/target/tmp/uniffi-fixture-coverall-6e842bdd9758c583/coverall.swift:1057:18: error: consecutive statements on a line must be separated by ';'
let pointer = throws try rustCallWithError(FfiConverterTypeCoverallError.lift) {
^
;
src/uniffi-rs/target/tmp/uniffi-fixture-coverall-6e842bdd9758c583/coverall.swift:1057:19: error: expected expression
let pointer = throws try rustCallWithError(FfiConverterTypeCoverallError.lift) {
^
error: fatalError
test uniffi_foreign_language_testcase_test_coverall_swift ... FAILED
from uniffi-rs.
See #2062
from uniffi-rs.
I can easily reproduce that and a-s is hitting it too.
from uniffi-rs.
Are there plans for a 0.27.1 release? 27.0 is somewhat unusable with this issue.
from uniffi-rs.
Related Issues (20)
- Error type named `Error` emits invalid Swift code HOT 6
- Deriving `uniffi::Record` together with `ZeroizeOnDrop` does not compile. Solvable? HOT 5
- UDL2 HOT 5
- Expose panic line numbers in logcat
- Kotlin bug: enum with associated value being `Arc<Object>` generates non compiling Kotlin code (UniFFI 0.27.1) HOT 1
- Clarify `check_library_path` semantics HOT 2
- DISCUSS: Proc macro / UDL for Swift property wrappers and macro annotations HOT 6
- Issues while importing and using a created swiftmodule HOT 5
- Incorrect comments in RustBuffer about being limited to i32
- how to send Rust opaque type to Kotlin HOT 5
- Online docs have no language syntax highlighting HOT 1
- RustBuffer regression with nested Errors HOT 5
- Swift errors don't provide `localizedDescription` HOT 6
- Generating FFI bindings for dependent crates into one single Swift / Kotlin file? HOT 4
- External type fails for some corner cases HOT 1
- Config feature and Export macros don't get along HOT 1
- iOS Framework Expected in: /usr/lib/libc++.1.dylib HOT 2
- Remote interface types
- Updating from 0.25.3 to 0.26.x or 0.27.x fails for interface HOT 8
- Java 8 deprecation is unexpected
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from uniffi-rs.