-
Notifications
You must be signed in to change notification settings - Fork 62
Open
Labels
A-frameworkAffects the framework crates and the translator for themAffects the framework crates and the translator for thembugSomething isn't workingSomething isn't working
Milestone
Description
found an issue in the generated binding for -[NSAppleScript executeAndReturnError:].
The current Rust signature is:
/// # Safety
///
/// `error_info` generic should be of the correct type.
#[unsafe(method(executeAndReturnError:))]
#[unsafe(method_family = none)]
pub unsafe fn executeAndReturnError(
&self,
error_info: Option<&mut Option<Retained<NSDictionary<NSString, AnyObject>>>>,
) -> Retained<NSAppleEventDescriptor>;However, according to Apple’s documentation, the Objective-C method is:
- (NSAppleEventDescriptor *)executeAndReturnError:(NSDictionary<NSString *, id> **)errorInfo;
// Return Value: The result of executing the event, or nil if an error occurs.The return value is nullable. But the generated Rust binding uses Retained<NSAppleEventDescriptor> instead of an Option<Retained<…>>. As a result, when the AppleScript execution fails, the Rust code panics:
thread '<unnamed>' panicked at .cargo/registry/src/index.crates.io-1949cf8c6b5b557f/objc2-foundation-0.3.2/src/generated/NSAppleScript.rs:60:5:
unexpected NULL returned from -[NSAppleScript executeAndReturnError:]
Metadata
Metadata
Assignees
Labels
A-frameworkAffects the framework crates and the translator for themAffects the framework crates and the translator for thembugSomething isn't workingSomething isn't working