Objective-C Generics-Safe Array/Dictionary Literal
<p>Are there warnings I can enable to stop assigning array and dictionary literals to variables with generic types that don't match?</p>

<pre><code>// I expect a warning here.
// I'm assigning an NSArray&lt;NSNumber *&gt; to an NSArray&lt;NSString *&gt;
NSArray&lt;NSString *&gt; *strings = @[@1,
                                 @2,
                                 @3,
                                 ];

// I expect a warning here.
// NSDictionary&lt;NSNumber *, NSNumber *&gt;  to an 
// NSDictionary&lt;NSString *, NSString *&gt; 
NSDictionary&lt;NSString *, NSString *&gt; *stringsByString = @{@1 : @1,
                                                          @2 : @2,
                                                          @3 : @3,
                                                          };
</code></pre>

<p>I created a new iOS project with Xcode Version 7.2 (7C68), and I got no warnings for the above assignments.</p>

<p>I know I could assign create mutable collections and manually assign each value, and get expected warnings:</p>

<pre><code>NSMutableArray&lt;NSString *&gt; *strings = [NSMutableArray new];
[strings addObject:@1]; 
</code></pre>

<blockquote>
  <p>Incompatible pointer types sending 'NSNumber *' to parameter of type
  'NSString * _Nonnull'</p>
</blockquote>

<pre><code>NSMutableDictionary&lt;NSString *, NSString *&gt; *stringsByString = [NSMutableDictionary new];
stringsByString[@"1"] = @1;
</code></pre>

<blockquote>
  <p>Incompatible pointer types sending 'NSNumber *' to parameter of type 'NSString * _Nullable'</p>
</blockquote>

<p>But I was hoping for something more succinct.</p>

<p>This whole question is more broad than simply calling <code>-\[NSMutableDictionary setObject:forKey:\</code> <a href="https://stackoverflow.com/q/34916217/9636">which doesn't work</a>.</p>

<pre><code>stringsByString[@2] = @"2";
</code></pre>