mirror of
https://github.com/llvm/llvm-project.git
synced 2025-05-09 20:16:05 +00:00

Introduce context-sensitive, non-underscored nullability specifiers (nonnull, nullable, null_unspecified) for Objective-C method return types, method parameter types, and properties. Introduce Objective-C-specific semantics, including computation of the nullability of the result of a message send, merging of nullability information from the @interface of a class into its @implementation, etc . This is the Objective-C part of rdar://problem/18868820. llvm-svn: 240154
16 lines
687 B
Objective-C
16 lines
687 B
Objective-C
// RUN: %clang_cc1 -fobjc-arc -fobjc-runtime-has-weak -Wnonnull %s -verify
|
|
//rdar://19211059
|
|
|
|
@interface NSObject @end
|
|
|
|
@interface Base : NSObject
|
|
- (nonnull id)bad:(nullable id)obj; // expected-note 2 {{previous declaration is here}}
|
|
- (nullable id)notAsBad:(nonnull id)obj;
|
|
@end
|
|
|
|
@interface Sub : Base
|
|
- (nullable id)bad:(nonnull id)obj; // expected-warning {{conflicting nullability specifier on return types, 'nullable' conflicts with existing specifier 'nonnull'}} \
|
|
// expected-warning {{conflicting nullability specifier on parameter types, 'nonnull' conflicts with existing specifier 'nullable'}}
|
|
- (nonnull id)notAsBad:(nullable id)obj;
|
|
@end
|