Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

duplicate_definition for internal classes with throwing constructors #1547

Open
parzysty opened this issue Aug 18, 2023 · 0 comments
Open

duplicate_definition for internal classes with throwing constructors #1547

parzysty opened this issue Aug 18, 2023 · 0 comments
Assignees

Comments

@parzysty
Copy link
Contributor

For following lime file
`
package smoke

open class ExternalClass {
enum ErrorEnum {
NONE,
CRASHED
}

class InternalOne {
    @Dart(Default)
    constructor create() throws ConstructorExploded   
}

class InternalTwo {
    @Dart(Default)
    constructor create() throws ConstructorExploded   
}

exception ConstructorExploded(ErrorEnum)

}
`

generated dart code contains multiple declaration of

final _$initReturnReleaseHandle = __lib.catchArgumentError(() => __lib.nativeLibrary.lookupFunction<
    Void Function(Pointer<Void>),
    void Function(Pointer<Void>)
  >('library_smoke_ExternalClass_InternalOne_create_return_release_handle'));

final _$initReturnGetResult = __lib.catchArgumentError(() => __lib.nativeLibrary.lookupFunction<
    Pointer<Void> Function(Pointer<Void>),
    Pointer<Void> Function(Pointer<Void>)
  >('library_smoke_ExternalClass_InternalOne_create_return_get_result'));

final _$initReturnGetError = __lib.catchArgumentError(() => __lib.nativeLibrary.lookupFunction<
    Uint32 Function(Pointer<Void>),
    int Function(Pointer<Void>)
  >('library_smoke_ExternalClass_InternalOne_create_return_get_error'));

final _$initReturnHasError = __lib.catchArgumentError(() => __lib.nativeLibrary.lookupFunction<
    Uint8 Function(Pointer<Void>),
    int Function(Pointer<Void>)
  >('library_smoke_ExternalClass_InternalOne_create_return_has_error'));

and

final _$initReturnReleaseHandle = __lib.catchArgumentError(() => __lib.nativeLibrary.lookupFunction<
    Void Function(Pointer<Void>),
    void Function(Pointer<Void>)
  >('library_smoke_ExternalClass_InternalTwo_create_return_release_handle'));

final _$initReturnGetResult = __lib.catchArgumentError(() => __lib.nativeLibrary.lookupFunction<
    Pointer<Void> Function(Pointer<Void>),
    Pointer<Void> Function(Pointer<Void>)
  >('library_smoke_ExternalClass_InternalTwo_create_return_get_result'));

final _$initReturnGetError = __lib.catchArgumentError(() => __lib.nativeLibrary.lookupFunction<
    Uint32 Function(Pointer<Void>),
    int Function(Pointer<Void>)
  >('library_smoke_ExternalClass_InternalTwo_create_return_get_error'));

final _$initReturnHasError = __lib.catchArgumentError(() => __lib.nativeLibrary.lookupFunction<
    Uint8 Function(Pointer<Void>),
    int Function(Pointer<Void>)
  >('library_smoke_ExternalClass_InternalTwo_create_return_has_error'));

which fail to compile

@parzysty parzysty self-assigned this Aug 21, 2023
parzysty added a commit to parzysty/gluecodium that referenced this issue Aug 21, 2023
Added ffi prefix to name of functions handling error and return type
retrival from throwing functions. This prevent duplicate_definition
error if more than one class has those function inside one file, for
example in case of multiple internall classes.

Relates-To:  heremaps#1547
parzysty added a commit to parzysty/gluecodium that referenced this issue Aug 21, 2023
Added ffi prefix to name of functions handling error and return type
retrival from throwing functions. This prevent duplicate_definition
error if more than one class has those function inside one file, for
example in case of multiple internall classes.

Relates-To:  heremaps#1547
Signed-off-by: Rafal Parzych <[email protected]>
parzysty added a commit to parzysty/gluecodium that referenced this issue Aug 22, 2023
Added ffi prefix to name of functions handling error and return type
retrival from throwing functions. This prevent duplicate_definition
error if more than one class has those function inside one file, for
example in case of multiple internall classes.

Relates-To:  heremaps#1547
Signed-off-by: Rafal Parzych <[email protected]>
parzysty added a commit to parzysty/gluecodium that referenced this issue Aug 23, 2023
Added ffi prefix to name of functions handling error and return type
retrival from throwing functions. This prevent duplicate_definition
error if more than one class has those function inside one file, for
example in case of multiple internall classes.

Relates-To:  heremaps#1547
Signed-off-by: Rafal Parzych <[email protected]>
parzysty added a commit to parzysty/gluecodium that referenced this issue Aug 23, 2023
Added ffi prefix to name of functions handling error and return type
retrival from throwing functions. This prevent duplicate_definition
error if more than one class has those function inside one file, for
example in case of multiple internall classes.

Relates-To:  heremaps#1547
Signed-off-by: Rafal Parzych <[email protected]>
parzysty added a commit to parzysty/gluecodium that referenced this issue Aug 23, 2023
Added ffi prefix to name of functions handling error and return type
retrival from throwing functions. This prevent duplicate_definition
error if more than one class has those function inside one file, for
example in case of multiple internall classes.

Relates-To:  heremaps#1547
Signed-off-by: Rafal Parzych <[email protected]>
parzysty added a commit to parzysty/gluecodium that referenced this issue Aug 24, 2023
Added ffi prefix to name of functions handling error and return type
retrival from throwing functions. This prevent duplicate_definition
error if more than one class has those function inside one file, for
example in case of multiple internall classes.

Relates-To:  heremaps#1547
Signed-off-by: Rafal Parzych <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

1 participant