Skip to content

Sharpie generates some classes with wrong casing #24892

@Cheesebaron

Description

@Cheesebaron

Apple platform

iOS

Framework version

net10.0-*

Affected platform version

Sharpie 26.3.0.11

Description

I am exposing some classes like URLResponse in NukeProxy and using the @objc macro.

When binding against the generated headers URLResponse becomes NSURLResponse. However, in .NET iOS it should be NSUrlResponse.

Example output:

// -(int64_t)loadDataWithUrl:(NSURL * _Nonnull)url onCompleted:(void (^ _Nonnull)(NSData * _Nullable, NSURLResponse * _Nullable))onCompleted __attribute__((warn_unused_result("")));
[Export ("loadDataWithUrl:onCompleted:")]
long LoadDataWithUrl (NSUrl url, Action<NSData, NSURLResponse> onCompleted);

Steps to Reproduce

Run sharpie against header or framework that uses URLSession in a swift project ala:

dotnet sharpie bind -o src/ImageCaching.Nuke/ -s iphoneos26.2 -n ImageCaching.Nuke -f Output/NukeProxy.xcframework/ios-arm64/NukeProxy.framework

Did you find any workaround?

No response

Build logs

Verbose output from sharpie:

Clang version: clang version 21.1.8 (https://github.com/llvm/llvm-project 2078da43e25a4623cab2d0d60decddf709aaea28) - loaded from /Users/tomaszcielecki/.nuget/packages/sharpie.bind.tool/26.3.0.11/tools/any/osx-arm64/libclang.dylib
ClangSharp version: clangsharp version 21.1.8 - loaded from /Users/tomaszcielecki/.nuget/packages/sharpie.bind.tool/26.3.0.11/tools/any/osx-arm64/libClangSharp.dylib
Parsing /var/folders/s9/3m9n8cmx5gqdfd60777_3wbm0000gn/T/sharpie/framework-NukeProxy.h with arguments:
    -F
    /Users/tomaszcielecki/git/NukeProxy/Output/NukeProxy.xcframework/ios-arm64
    -isysroot
    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS26.2.sdk
    -miphoneos-version-min=26.2
    -v
    -xobjective-c
    -fmodules
    -fmodules-cache-path=/var/folders/s9/3m9n8cmx5gqdfd60777_3wbm0000gn/T/sharpie/ModuleCache
    -I
    /Users/tomaszcielecki/.nuget/packages/sharpie.bind.tool/26.3.0.11/content/clang/include
    -resource-dir
    /Users/tomaszcielecki/.nuget/packages/sharpie.bind.tool/26.3.0.11/content/clang
clang version 21.1.8 (https://github.com/llvm/llvm-project 2078da43e25a4623cab2d0d60decddf709aaea28)
Target: arm64-apple-darwin24.6.0
Thread model: posix
InstalledDir: 
ignoring nonexistent directory "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS26.2.sdk/usr/local/include"
ignoring nonexistent directory "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS26.2.sdk/Library/Frameworks"
ignoring duplicate directory "/Users/tomaszcielecki/.nuget/packages/sharpie.bind.tool/26.3.0.11/content/clang/include"
  as it is a non-system directory that duplicates a system directory
#include "..." search starts here:
#include <...> search starts here:
 /Users/tomaszcielecki/git/NukeProxy/Output/NukeProxy.xcframework/ios-arm64 (framework directory)
 /Users/tomaszcielecki/.nuget/packages/sharpie.bind.tool/26.3.0.11/content/clang/include
 /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS26.2.sdk/usr/include
 /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS26.2.sdk/System/Library/Frameworks (framework directory)
 /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS26.2.sdk/System/Library/SubFrameworks (framework directory)
End of search list.
Processing '/var/folders/s9/3m9n8cmx5gqdfd60777_3wbm0000gn/T/sharpie/framework-NukeProxy.h'
Bindings generated successfully.

Metadata

Metadata

Assignees

No one assigned

    Labels

    binding-projectsIssue or PR that affects binding projectsbugIf an issue is a bug or a pull request a bug fixobjective-sharpieIssues or pull requests affecting Objective Sharpie.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions