Skip to content

ObjC: Overly general type generated for some methods/properties #281

Closed
dart-archive/ffigen
#412
@brianquinlan

Description

@brianquinlan

This declaration:

/*!
    @abstract Returns the HTTP request method of the receiver.
    @result the HTTP request method of the receiver.
*/
@property (nullable, readonly, copy) NSString *HTTPMethod;

Generates this code:

  /// !
  /// @abstract Returns the HTTP request method of the receiver.
  /// @result the HTTP request method of the receiver.
  NSObject? get HTTPMethod {
    final _ret = _lib._objc_msgSend_1(_id, _lib._sel_HTTPMethod1);
    return _ret.address == 0 ? null : NSObject._(_ret, _lib);
  }

Notice how the return type is NSObject? instead of NSString?

Metadata

Metadata

Assignees

No one assigned

    Labels

    lang-objective_cRelated to Objective C supportpackage:ffigentype-bugIncorrect behavior (everything from a crash to more subtle misbehavior)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions