D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 19494 - [REG 2.080.0][objc] interface `main.NSObject.Class` conflicts with interface `main.NSObject.Class`
Summary: [REG 2.080.0][objc] interface `main.NSObject.Class` conflicts with interface ...
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: x86_64 Mac OS X
: P1 regression
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-12-15 16:25 UTC by Jacob Carlborg
Modified: 2018-12-16 09:43 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Jacob Carlborg 2018-12-15 16:25:36 UTC
The following code fails to compile using 2.080.0 or later:

extern (Objective-C) interface NSObject
{
    extern (Objective-C) interface Class {}
}

The error message is:

Error: interface `main.NSObject.Class` conflicts with interface `main.NSObject.Class`

The issue is that when Objective-C class methods were implemented the type of the metaclass was accidentally exposed as the "Class" member inside every Objective-C interface.
Comment 1 github-bugzilla 2018-12-16 09:43:03 UTC
Commits pushed to master at https://github.com/dlang/dmd

https://github.com/dlang/dmd/commit/c9bc1a68a41303e83e3df06bff7b9182755aceed
Fix issue 19494: Remove implicit `Class` member for Objective-C interfaces

The issue was that when support for Objective-C class methods was
added, the metaclass was accidentally exposed as the `.Class` member
for all Objective-C interfaces.

https://github.com/dlang/dmd/commit/09f2198b25024a8bde75f7ef58609c8218e62ca3
Merge pull request #9083 from jacob-carlborg/19494-class-conflict

Fix issue 19494: Remove implicit `Class` member for Objective-C interfaces