Swift does not generate an unused variable warning

In Objective-C, the following code generates an Unused variable warning:

- (void)viewDidLoad { [super viewDidLoad]; NSInteger unusedVariable; } 

But in Swift, the following code does not generate a warning:

 override func viewDidLoad() { super.viewDidLoad() var unusedVariable: Int } 

Xcode version 6.0.1.
Assembly Options> Unused Variables - YES in a Swift project.

Is this just for me?
How to get Swift or Xcode to generate an Unused variable warning in Swift?

+8
ios iphone xcode swift
source share
1 answer

According to Chris Lattner's post on the Apple Developer Forums, this is still a bug:

This is a known issue, we have a radar for this, thanks!

-Chris

Refresh . Not only do Swift now have unused variable warnings, but they also shout at you when you use var , where let enough.

+8
source share

All Articles