NCGenerics: add test for feature flag

Ensure that when using noncopyable generics when building a module,
the compiler can re-ingest it and will pick the part guarded by
$NoncopyableGenerics.

verifies the concern in rdar://127701059
This commit is contained in:
Kavon Farvardin
2024-05-08 13:59:23 -07:00
parent 0a611e8ded
commit ad1375ee7e

View File

@@ -0,0 +1,20 @@
// RUN: %empty-directory(%t)
// RUN: split-file %s %t
// RUN: %target-swift-emit-module-interface(%t/Library.swiftinterface) %t/Library.swift -module-name Library
// RUN: rm -f %t/Library.swiftmodule
// RUN: %target-swift-frontend -I %t -typecheck -verify %t/test.swift
//--- Library.swift
public struct Hello<T: ~Copyable> {
public init() {}
}
//--- test.swift
import Library
struct NC: ~Copyable {}
let x: Hello<NC> = .init()