Skip to content

Reproducer for rdar://143582881 #78999

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions test/Constraints/member_import_visibility.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
// RUN: %empty-directory(%t)
// RUN: %empty-directory(%t/src)
// RUN: split-file %s %t/src

/// Build the library A
// RUN: %target-swift-frontend -emit-module %t/src/A.swift \
// RUN: -module-name A \
// RUN: -emit-module-path %t/A.swiftmodule

/// Build the library B
// RUN: %target-swift-frontend -I %t -emit-module %t/src/B.swift \
// RUN: -module-name B \
// RUN: -emit-module-path %t/B.swiftmodule

// RUN: %target-swift-frontend -typecheck -I %t %t/src/Main.swift %t/src/Other.swift -enable-upcoming-feature MemberImportVisibility

// REQUIRES: swift_feature_MemberImportVisibility

//--- A.swift
public struct Test {
public init(a: Double) { }
}

//--- B.swift
import A

extension Test {
public init(a: Int) { fatalError() }
}

//--- Main.swift
import A

func test() {
_ = Test(a: 0) // Ok, selects the overload that takes Double.
}

//--- Other.swift
import B
16 changes: 16 additions & 0 deletions validation-test/Sema/rdar143582881.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// RUN: %empty-directory(%t)
// RUN: split-file %s %t

// RUN: %target-swift-frontend -typecheck %t/Main.swift %t/Other.swift -enable-upcoming-feature MemberImportVisibility

//--- Main.swift

import Foundation

func test() -> CGSize {
return CGSize(width: 60, height: 45)
}

//--- Other.swift

import CoreGraphics