doug.gregor added a comment.
Yes, I think it's reasonable to treat instancetype as an inherited requirement.
I guess the only exception would be if we had some notion of final classes or
methods in Objective-C, in which case they'd be able to return a concrete type.
Repository:
rL LLVM
http
arphaman added a comment.
@doug.gregor Ping
Repository:
rL LLVM
https://reviews.llvm.org/D36790
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
arphaman added a comment.
@doug.gregor Ping
Repository:
rL LLVM
https://reviews.llvm.org/D36790
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
rjmccall added a comment.
I think it's fair to treat instancetype as an inherited requirement — that is,
the rules of covariant override always apply, which essentially means that
overriders of instance-returning methods must also return instancetype whether
they say so explicitly or not. But
rjmccall added a reviewer: doug.gregor.
rjmccall added a comment.
Tagging Doug.
Repository:
rL LLVM
https://reviews.llvm.org/D36790
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
arphaman added a comment.
@rjmccall Do you think that the rules for the return types in overridden
methods that return `instancetype` should be strengthened first? For example,
if we have the following code:
@interface Unrelated
- (void)method:(int)x;
@end
@interface CallsSelfSuper:
arphaman added a comment.
Of course, right. I will change the approach.
Repository:
rL LLVM
https://reviews.llvm.org/D36790
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
rjmccall requested changes to this revision.
rjmccall added a comment.
This revision now requires changes to proceed.
Class methods can be inherited; this entire approach is bogus.
Repository:
rL LLVM
https://reviews.llvm.org/D36790
___
cfe-commi
arphaman created this revision.
Prior to this patch, messages to `self` in class methods were treated as
instance methods to a `Class` value. When these methods returned `instancetype`
the compiler only saw `id` through the `instancetype`, and not the `Interface
*`. This caused problems when th