mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
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:
20
test/ModuleInterface/noncopyable_generics_feature_flag.swift
Normal file
20
test/ModuleInterface/noncopyable_generics_feature_flag.swift
Normal 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()
|
||||
Reference in New Issue
Block a user