Files
swift-mirror/test/Sema/copyable_constraint.swift
Kavon Farvardin 31aa2f77e3 polish noncopyable types diagnostic wordings
- replaces "move-only" terminology with "noncopyable"
- replaces compiler jargon like "guaranteed parameters"
  and "lvalue" with corresponding language-level notions
- simplifies diagnostics about closures.

and probably more.

rdar://109281444
2023-05-24 20:56:36 -07:00

15 lines
577 B
Swift

// >> First verify that when building the stdlib, we do have the copyable constraint. Note the module-name!!
// RUN: %target-swift-frontend -typecheck -verify -parse-stdlib -module-name Swift %s
// FIXME: Now demonstrate that plain -parse-stdlib, such as in some arbitrary test, doesn't get the Copyable constraint :(
// RUN: not %target-swift-frontend -typecheck -verify -parse-stdlib %s
@_marker public protocol _Copyable {}
func nextTime<T>(_ t: T) {}
@_moveOnly struct MO {}
nextTime(MO()) // expected-error {{noncopyable type 'MO' cannot be used with generics yet}}