Stepping into Objective-C constructor with parameters from Swift

I'm seeing issues with the debugger not being able to step into Objective-C constructors with parameters from Swift. It simply skips over the line rather than into the Objective-C implementation. The issue can be seen with the following trivial code (full sample project here)

# Foo.h

@interface Foo : NSObject
@property (nonnull) NSArray<NSString *> *values;
- (nonnull id)init;
- (nonnull id)initWithString:(nonnull NSString *)value;
- (nonnull id)initWithString:(nonnull NSString *)value andOtherString:(nonnull NSString *) otherValue;
@end

# SampleProjectApp.swift

init() {
  let noParams = Foo()                                            // Step in works
  let oneParam = Foo(string: "Bar")                               // Step in does not work
  let multipleParams = Foo(string: "Foo", andOtherString: "Bar")  // Step in does not work
}

The project builds and runs perfectly fine. Stepping into the constructor without any parameters works fine as does setting breakpoints directly in the constructors with parameters. Stepping into a constructor with parameters is the only problem.

I figure that this is probably due to the way that Swift and ObjC interop works and having parameters complicates the interop resulting in the debugger not being able to find the actual source file to jump to. I don't quite understand how that works so an explanation would be appreciated if you know but what I am mostly interested in is if this behavior is expected. Should I report a bug somewhere? Is there some configuration somewhere for more work to be done (e.g. compiler output more debug info, debugger perform more expensive searching) that can be set to enable the debugger to find the source file to jump to?

I was using Xcode 16.0 for the sample project and also tried Xcode 16.3 beta 2 which had the same issue.

2 Likes