Files
swift-mirror/test/ModuleInterface/moveonly_user.swift
Michael Gottesman d0938a906f [move-only] Ban resilient noncopyable types.
One can still in resilient frameworks have noncopyable frozen types.

This means that one cannot make a noncopyable:

1. Full resilient public type.
2. @usableFromInline type.

NOTE: One can still use a frozen noncopyable type as a usableFromInline class
field. I validated in the attached tests that we get the correct code
generation.

I also eliminated a small bug in TypeCheckDeclPrimary where we weren't using a
requestified attr check and instead were checking directly.

rdar://111125845
2023-06-21 16:57:44 -07:00

22 lines
960 B
Swift

// RUN: %empty-directory(%t)
// >> first try when no library evolution is specified
// RUN: %target-swift-frontend -DSYNTHESIZE_ACCESSORS -emit-module -o %t/Hello.swiftmodule %S/Inputs/moveonly_api.swift
// RUN: %target-swift-frontend -emit-sil -sil-verify-all -I %t %s > /dev/null
// >> now again with library evolution; we expect the same result.
// RUN: %target-swift-frontend -DSYNTHESIZE_ACCESSORS -enable-library-evolution -enable-experimental-feature MoveOnlyResilientTypes -emit-module -o %t/Hello.swiftmodule %S/Inputs/moveonly_api.swift
// RUN: %target-swift-frontend -enable-experimental-feature MoveOnlyResilientTypes -emit-sil -sil-verify-all -I %t %s > /dev/null
// FIXME: ideally this would also try executing the program rather than just generating SIL
// FIXME: make this test work when we're not synthesizing the accessors
import Hello
func simpleTest() {
let handle = FileHandle()
let msg = handle.file.fd.message()
print(msg)
}