Files
swift-mirror/test/decl/var/property_wrappers_library_evolution.swift
Holly Borla bbfcb55e9e [Property Wrappers] Inject the opaque value placeholder for a property
wrapper original wrapped value expression inside of CSApply.

This prevents type checking the synthesized backing storage initializer
twice - once with the original expression and again with the placeholder.
2020-04-05 19:02:37 -07:00

21 lines
698 B
Swift

// RUN: %target-swift-frontend -typecheck %s -verify -enable-library-evolution
@propertyWrapper
public struct ResilientWrapper<T> {
public var wrappedValue: T
public init(wrappedValue: T, description: String) {
self.wrappedValue = wrappedValue
}
}
func getHello() -> String { return "hello" } // expected-note {{global function 'getHello()' is not '@usableFromInline' or public}}
@frozen
public struct StructUsesPublishedAsPrivate {
public var integer: Int = 17
@ResilientWrapper(description: getHello()) // expected-error {{global function 'getHello()' is internal and cannot be referenced from a property initializer in a '@frozen' type}}
var otherString: String = "World"
}