Diagnose redeclarations of Objective-C methods.

@objc methods, initializers, deinitializers, properties, and
subscripts all produce Objective-C methods. Diagnose cases where two
such entities (which may be of different kinds) produce the same
Objective-C method in the same class.

As a special exception, one can have an Objective-C method in an
extension that conflicts with an Objective-C method in the original
class definition, so long as the original class definition is from a
different model. This reflects the reality in Objective-C that the
category definition wins over the original definition, and is used in
at least one overlay (SpriteKit).

This is the first part of rdar://problem/18391046; the second part
involves checking that overrides are sane.

Swift SVN r23147
This commit is contained in:
Doug Gregor
2014-11-07 01:15:14 +00:00
parent e70ca2762d
commit 89e5e5b6fa
26 changed files with 671 additions and 179 deletions

View File

@@ -51,7 +51,7 @@ const uint16_t VERSION_MAJOR = 0;
/// To ensure that two separate changes don't silently get merged into one
/// in source control, you should also update the comment to briefly
/// describe what change you made.
const uint16_t VERSION_MINOR = 157; // Last change: support nil in witness method entry
const uint16_t VERSION_MINOR = 158; // Last change: objc decl attribute
using DeclID = Fixnum<31>;
using DeclIDField = BCFixed<31>;
@@ -1133,6 +1133,7 @@ namespace decls_block {
using ObjCDeclAttrLayout = BCRecordLayout<
ObjC_DECL_ATTR,
BCFixed<1>, // implicit flag
BCFixed<1>, // implicit name flag
BCVBR<4>, // # of arguments (+1) or zero if no name
BCArray<IdentifierIDField>
>;