mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
24 lines
700 B
Swift
24 lines
700 B
Swift
// RUN: %empty-directory(%t)
|
|
// RUN: %build-clang-importer-objc-overlays
|
|
|
|
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk-nosource -I %t) -emit-silgen -I %S/Inputs/custom-modules %s | %FileCheck %s
|
|
|
|
// REQUIRES: objc_interop
|
|
|
|
import nullability
|
|
import Foundation
|
|
|
|
// null_resettable properties.
|
|
// CHECK-LABEL: sil hidden [ossa] @$s18nullability_silgen18testNullResettable{{[_0-9a-zA-Z]*}}F
|
|
func testNullResettable(_ sc: SomeClass) {
|
|
sc.defaultedProperty = nil
|
|
sc.defaultedProperty = "hello"
|
|
let str: String = sc.defaultedProperty
|
|
if sc.defaultedProperty == nil { }
|
|
}
|
|
|
|
func testFunnyProperty(_ sc: SomeClass) {
|
|
sc.funnyProperty = "hello"
|
|
var str: String = sc.funnyProperty
|
|
}
|