Files
swift-mirror/test/Sema/where_clause_across_module_boundaries.swift
Henrik G. Olsson cbc0ec3b88 Add -verify-ignore-unrelated where necessary (NFC)
These are tests that fail in the next commit without this flag. This
does not add -verify-ignore-unrelated to all tests with -verify, only
the ones that would fail without it. This is NFC since this flag is
currently a no-op.
2025-10-04 14:19:52 -07:00

23 lines
1013 B
Swift

// RUN: %empty-directory(%t)
// RUN: %target-swift-frontend -emit-module -o %t/ModuleA.swiftmodule %S/Inputs/where_clause_across_module_boundaries_module.swift
// RUN: %target-typecheck-verify-swift -verify-ignore-unrelated -I %t
// https://github.com/apple/swift/issues/58084
// Associated Type Inference fails across module boundaries
// Self bounds from where clause cannot be accessed across modules.
// This test is intended to test whether it can use generic signature to get self bounds.
import ModuleA
struct ModuleBFoo: Codable, DefaultsSerializable {
}
enum ModuleBBar: Int, Codable, DefaultsSerializable { // expected-error {{type 'ModuleBBar' does not conform to protocol 'DefaultsSerializable'}}
case foo, bar
}
func foo() {
_ = AliasTest<Int>.A.self // expected-error {{type 'Int' does not conform to protocol 'Collection'}}
_ = AliasTest<Int>.B.self // expected-error {{type 'Int' does not conform to protocol 'Collection'}}
_ = AliasTest<String>.A.self
_ = AliasTest<String>.B.self
}