mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
These are tests that fail in the next commit without this flag. This does not add -verify-ignore-unrelated to all tests with -verify, only the ones that would fail without it. This is NFC since this flag is currently a no-op.
60 lines
1.8 KiB
Swift
60 lines
1.8 KiB
Swift
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -I %S/Inputs/custom-modules -typecheck -parse-as-library -verify -verify-ignore-unrelated %s %S/Inputs/objc_nsmanaged_other.swift
|
|
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -I %S/Inputs/custom-modules -typecheck -parse-as-library -verify -verify-ignore-unrelated -primary-file %s %S/Inputs/objc_nsmanaged_other.swift
|
|
|
|
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -I %S/Inputs/custom-modules -emit-silgen -parse-as-library -o /dev/null -DNO_ERROR %s %S/Inputs/objc_nsmanaged_other.swift
|
|
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -I %S/Inputs/custom-modules -emit-silgen -parse-as-library -o /dev/null -DNO_ERROR -primary-file %s %S/Inputs/objc_nsmanaged_other.swift
|
|
|
|
// REQUIRES: objc_interop
|
|
|
|
import Foundation
|
|
import CoreData
|
|
|
|
func markUsed<T>(_ t: T) {}
|
|
|
|
// Inferred @requires_stored_property_inits.
|
|
class MyManagedObject : NSManagedObject {
|
|
#if !NO_ERROR
|
|
var foo: String // expected-error{{stored property 'foo' requires an initial value}}
|
|
var bar: String // expected-error{{stored property 'bar' requires an initial value}}
|
|
#endif
|
|
|
|
@NSManaged var managed: String
|
|
|
|
override init() {
|
|
#if !NO_ERROR
|
|
foo = "1"
|
|
bar = "2"
|
|
#endif
|
|
super.init()
|
|
}
|
|
|
|
var wibble: String {
|
|
return "hello"
|
|
}
|
|
|
|
#if !NO_ERROR
|
|
var wobble: String { // expected-error{{stored property 'wobble' requires an initial value}}
|
|
willSet(value) {
|
|
markUsed(value)
|
|
}
|
|
}
|
|
#endif
|
|
}
|
|
|
|
func getOtherManagedObject() -> OtherManagedObject {
|
|
return OtherManagedObject()
|
|
}
|
|
|
|
func accessOther(_ om: OtherManagedObject) -> String {
|
|
return om.managed
|
|
}
|
|
|
|
// rdar://problem/20821582
|
|
func accessMine(_ obj: MyManagedObject) -> String {
|
|
return obj.anotherManaged
|
|
}
|
|
|
|
func accessMyMethod(_ obj: MyManagedObject) {
|
|
obj.managedMethod()
|
|
}
|