Files
swift-mirror/test/ModuleInterface/reparenting.swift
Becca Royal-Gordon 1f008fb0d0 [ModuleInterface] Enable module selectors by default
And update tests to use them.

This commit depends on fixes in swiftlang/swift PRs #86905, #87129, and #87130.

Fixes rdar://169749886.
2026-02-20 00:35:23 -08:00

30 lines
1002 B
Swift

// RUN: %empty-directory(%t)
// RUN: %target-swift-emit-module-interface(%t/Library.swiftinterface) %s -module-name Library -enable-experimental-feature Reparenting
// RUN: %target-swift-typecheck-module-from-interface(%t/Library.swiftinterface) -module-name Library
// RUN: %FileCheck %s --check-prefixes=CHECK < %t/Library.swiftinterface
// REQUIRES: swift_feature_Reparenting
// CHECK-LABEL: @reparentable public protocol Circle {
@reparentable
public protocol Circle {
associatedtype Color
func fill() -> Color
}
// CHECK-LABEL: public protocol Ball : Library::Circle {
// CHECK: associatedtype Color = Swift::Int
public protocol Ball: Circle {
associatedtype Color = Int
func roll()
}
// CHECK-LABEL: extension Library::Ball : @reparented Library::Circle where Self.Color == Swift::Int {
// CHECK: public func fill() -> Self.Color
// CHECK-NOT: typealias
extension Ball: @reparented Circle where Color == Int {
public func fill() -> Color { return 0xFFFD74 }
}