mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Make sure we don’t support @objc class subscripts
Obj-C subscripts don’t work on class objects, but you can declare class methods with the appropriate names. We don’t want to half-support this. Emit an error if you try to write “@objc class subscript” and test that we don’t import the methods as subscripts.
This commit is contained in:
committed by
Brent Royal-Gordon
parent
8b0e61aae0
commit
473fe7027e
@@ -3638,6 +3638,8 @@ ERROR(objc_invalid_on_var,none,
|
||||
ERROR(objc_invalid_on_subscript,none,
|
||||
"subscript cannot be %" OBJC_ATTR_SELECT "0 because its type "
|
||||
"cannot be represented in Objective-C", (unsigned))
|
||||
ERROR(objc_invalid_on_static_subscript,none,
|
||||
"%0 cannot be %" OBJC_ATTR_SELECT "1", (DescriptiveDeclKind, unsigned))
|
||||
ERROR(objc_invalid_with_generic_params,none,
|
||||
"method cannot be %" OBJC_ATTR_SELECT "0 because it has generic "
|
||||
"parameters", (unsigned))
|
||||
|
||||
Reference in New Issue
Block a user