Files
swift-mirror/test/Interpreter/SDK/objc_nil.swift
Jordan Rose 3b35451bbe Add a test for auto-casting 'nil'.
Swift SVN r6137
2013-07-10 23:26:10 +00:00

17 lines
401 B
Swift

// RUN: rm -rf %t/clang-module-cache
// RUN: %swift -module-cache-path=%t/clang-module-cache -sdk=%sdk -i %s | FileCheck %s
// REQUIRES: sdk
import Foundation
var str : NSString = nil
var url : NSURL = nil
println("\(str == nil) \(nil == url) \(str == url)")
// CHECK: true true true
str = "abc"
url = NSURL(initWithString: "file:///")
println("\(str == nil) \(nil == url)")
// CHECK: false false