Giter Site home page Giter Site logo

Comments (5)

badboy avatar badboy commented on June 13, 2024 1

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.

badboy avatar badboy commented on June 13, 2024 1

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.

mhammond avatar mhammond commented on June 13, 2024 1

See #2062

from uniffi-rs.

badboy avatar badboy commented on June 13, 2024

I can easily reproduce that and a-s is hitting it too.

from uniffi-rs.

CaioSym avatar CaioSym commented on June 13, 2024

Are there plans for a 0.27.1 release? 27.0 is somewhat unusable with this issue.

from uniffi-rs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.