swiftlang / swift

The Swift Programming Language
https://swift.org
Apache License 2.0
67.49k stars 10.35k forks source link

[SR-14851] Swift 5.5 doesn't interpret the correct type of overridden method in ObjC #57198

Open swift-ci opened 3 years ago

swift-ci commented 3 years ago
Previous ID SR-14851
Radar rdar://problem/79922196
Original Reporter yhamza (JIRA User)
Type Bug

Attachment: Download

Environment Swift 5.5 Xcode 13 beta 1
Additional Detail from JIRA | | | |------------------|-----------------| |Votes | 0 | |Component/s | | |Labels | Bug | |Assignee | None | |Priority | Medium | md5: 84c0efea674e75d8590f3d19348d67ea

Issue Description:

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 *> *` ✅

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


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

typesanitizer commented 3 years ago

@swift-ci create

typesanitizer commented 3 years ago

Thanks for reporting this issue with a small example. Confirming it's not an issue with 12.5 but is an issue with beta 2.

swift-ci commented 2 years ago

Comment by Yousef (JIRA)

This issue is fixed ✅