native icon indicating copy to clipboard operation
native copied to clipboard

[ffigen] [objc] getters/setters at different levels of class hierarchy have different names

Open brianquinlan opened this issue 3 weeks ago • 2 comments

For example:

extension NSURLRequest$Methods on NSURLRequest {
  NSURLRequestCachePolicy get cachePolicy { ...

extension type NSMutableURLRequest._(objc.ObjCObject object$)
    implements objc.ObjCObject, NSURLRequest {
  set cachePolicy$1(NSURLRequestCachePolicy value) {

This means that, for NSMutableURLRequest, you have to write:

request.cachePolicy$1 = ...
print(request.cachePolicy);

brianquinlan avatar Nov 07 '25 22:11 brianquinlan

I wonder if fixing this would be a minor enough breaking change that we can squeak it into ffigen 20.1.0, or if it needs to be punted to ffigen 21.0.0. Unlike the other bugs you've reported today, this one compiles, so it's a little different.

liamappelbe avatar Nov 09 '25 23:11 liamappelbe

I wonder if fixing this would be a minor enough breaking change that we can squeak it into ffigen 20.1.0, or if it needs to be punted to ffigen 21.0.0. Unlike the other bugs you've reported today, this one compiles, so it's a little different.

I'm not sure how semver should work with ffigen because upgrading the package does not cause the code to be regenerated. If the idea of semver is that the same major version of ffigen should generate compatible code then fixing this would have to be a major release.

brianquinlan avatar Nov 10 '25 17:11 brianquinlan