Swift 5.5 doesn't interpret the correct type of overridden method in ObjC

I have a CoreData entity let's call it YHEntity.

In YHEntity class (ObjC) that override fetchRequest to return NSFetchRequest<YHEntity *> *.

In Swift 5.4:
Swift code can see the fetchRequest method returning NSFetchRequest<YHEntity *> * :white_check_mark:

In Swift 5.5:
Swift code can see the fetchRequest method returning NSFetchRequest< NSFetchRequestResult> * :x:

Here's a sample project that simulates the problem, builds with Xcode 12 but fails with Xcode 13.

I suggest you file bug reports on bugs.swift.org and feedbackassistant.apple.com. Posts here don't necessarily go anywhere, unless you're just looking for discussion.

2 Likes
Terms of Service

Privacy Policy

Cookie Policy