Skip to content
  1. Jul 05, 2011
  2. Jul 04, 2011
  3. Jul 02, 2011
  4. Jun 29, 2011
  5. Jun 28, 2011
  6. Jun 24, 2011
  7. Jun 21, 2011
  8. Jun 17, 2011
  9. Jun 16, 2011
  10. Jun 15, 2011
  11. Jun 14, 2011
  12. Jun 13, 2011
  13. Jun 11, 2011
    • Douglas Gregor's avatar
      Implement Objective-C Related Result Type semantics. · 33823727
      Douglas Gregor authored
      Related result types apply Cocoa conventions to the type of message
      sends and property accesses to Objective-C methods that are known to
      always return objects whose type is the same as the type of the
      receiving class (or a subclass thereof), such as +alloc and
      -init. This tightens up static type safety for Objective-C, so that we
      now diagnose mistakes like this:
      
      t.m:4:10: warning: incompatible pointer types initializing 'NSSet *'
      with an
            expression of type 'NSArray *' [-Wincompatible-pointer-types]
        NSSet *array = [[NSArray alloc] init];
               ^       ~~~~~~~~~~~~~~~~~~~~~~
      /System/Library/Frameworks/Foundation.framework/Headers/NSObject.h:72:1:
      note: 
            instance method 'init' is assumed to return an instance of its
            receiver
            type ('NSArray *')
      - (id)init;
      ^
      
      It also means that we get decent type inference when writing code in
      Objective-C++0x:
      
        auto array = [[NSMutableArray alloc] initWithObjects:@"one",  @"two",nil];
        //    ^ now infers NSMutableArray* rather than id
      
      llvm-svn: 132868
      33823727
  14. Jun 08, 2011
  15. Jun 03, 2011
  16. Jun 02, 2011
  17. May 28, 2011
  18. May 25, 2011
  19. May 20, 2011
  20. May 18, 2011
  21. May 13, 2011
  22. May 09, 2011
  23. May 05, 2011
  24. May 03, 2011
  25. Apr 28, 2011
  26. Apr 27, 2011
Loading