Skip to content

Enable upcoming feature 'MemberImportVisibility' and fix issues it reveals #1020

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

Merged
Merged
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
2 changes: 2 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,8 @@ extension Array where Element == PackageDescription.SwiftSetting {
.enableExperimentalFeature("AccessLevelOnImport"),
.enableUpcomingFeature("InternalImportsByDefault"),

.enableUpcomingFeature("MemberImportVisibility"),

// This setting is enabled in the package, but not in the toolchain build
// (via CMake). Enabling it is dependent on acceptance of the @section
// proposal via Swift Evolution.
Expand Down
2 changes: 2 additions & 0 deletions Sources/Testing/ABI/ABI.Record+Streaming.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
//

#if canImport(Foundation) && (!SWT_NO_FILE_IO || !SWT_NO_ABI_ENTRY_POINT)
private import Foundation

extension ABI.Version {
/// Post-process encoded JSON and write it to a file.
///
Expand Down
1 change: 1 addition & 0 deletions Sources/TestingMacros/ConditionMacro.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
//

public import SwiftSyntax
import SwiftSyntaxBuilder
public import SwiftSyntaxMacros

#if !hasFeature(SymbolLinkageMarkers) && SWT_NO_LEGACY_TEST_DISCOVERY
Expand Down
2 changes: 2 additions & 0 deletions Sources/TestingMacros/PragmaMacro.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
// See https://swift.org/CONTRIBUTORS.txt for Swift project authors
//

import SwiftDiagnostics
import SwiftParser
public import SwiftSyntax
public import SwiftSyntaxMacros

Expand Down
2 changes: 2 additions & 0 deletions Sources/TestingMacros/SuiteDeclarationMacro.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
// See https://swift.org/CONTRIBUTORS.txt for Swift project authors
//

import SwiftDiagnostics
public import SwiftSyntax
import SwiftSyntaxBuilder
public import SwiftSyntaxMacros

#if !hasFeature(SymbolLinkageMarkers) && SWT_NO_LEGACY_TEST_DISCOVERY
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
//

import SwiftSyntax
import SwiftSyntaxBuilder
import SwiftSyntaxMacros
import SwiftDiagnostics

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
// See https://swift.org/CONTRIBUTORS.txt for Swift project authors
//

import SwiftParser
import SwiftSyntax

extension TokenSyntax {
Expand Down
1 change: 1 addition & 0 deletions Sources/TestingMacros/Support/Argument.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
//

import SwiftSyntax
import SwiftSyntaxBuilder

/// A type describing an argument to a function, closure, etc.
///
Expand Down
1 change: 1 addition & 0 deletions Sources/TestingMacros/Support/AttributeDiscovery.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
//

import SwiftSyntax
import SwiftSyntaxBuilder
import SwiftSyntaxMacros

/// A syntax rewriter that removes leading `Self.` tokens from member access
Expand Down
1 change: 1 addition & 0 deletions Sources/TestingMacros/Support/AvailabilityGuards.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
//

import SwiftSyntax
import SwiftSyntaxBuilder
import SwiftSyntaxMacros

/// A structure describing a single platform/version pair from an `@available()`
Expand Down
1 change: 1 addition & 0 deletions Sources/TestingMacros/Support/CommentParsing.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
//

import SwiftSyntax
import SwiftSyntaxBuilder

/// Find a common whitespace prefix among all lines in a string and trim it.
///
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
//

import SwiftSyntax
import SwiftSyntaxBuilder
import SwiftSyntaxMacros

/// The result of parsing the condition argument passed to `#expect()` or
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
//

import SwiftDiagnostics
import SwiftParser
import SwiftSyntax
import SwiftSyntaxBuilder
import SwiftSyntaxMacros

extension AttributeInfo {
Expand Down
2 changes: 2 additions & 0 deletions Sources/TestingMacros/Support/DiagnosticMessage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
//

import SwiftDiagnostics
import SwiftParser
import SwiftSyntax
import SwiftSyntaxBuilder
import SwiftSyntaxMacros
import SwiftSyntaxMacroExpansion

Expand Down
2 changes: 2 additions & 0 deletions Sources/TestingMacros/Support/SourceCodeCapturing.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
// See https://swift.org/CONTRIBUTORS.txt for Swift project authors
//

import SwiftParser
import SwiftSyntax
import SwiftSyntaxBuilder

/// Get a swift-syntax expression initializing an instance of `__Expression`
/// from an arbitrary syntax node.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
//

import SwiftSyntax
import SwiftSyntaxBuilder
import SwiftSyntaxMacros

/// Get an expression initializing an instance of ``SourceLocation`` from an
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
//

import SwiftSyntax
import SwiftSyntaxBuilder
import SwiftSyntaxMacros

/// An enumeration representing the different kinds of test content known to the
Expand Down
1 change: 1 addition & 0 deletions Sources/TestingMacros/TagMacro.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
//

public import SwiftSyntax
import SwiftSyntaxBuilder
public import SwiftSyntaxMacros

/// A type describing the expansion of the `@Tag` attribute macro.
Expand Down
2 changes: 2 additions & 0 deletions Sources/TestingMacros/TestDeclarationMacro.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
// See https://swift.org/CONTRIBUTORS.txt for Swift project authors
//

import SwiftDiagnostics
public import SwiftSyntax
import SwiftSyntaxBuilder
public import SwiftSyntaxMacros

#if !hasFeature(SymbolLinkageMarkers) && SWT_NO_LEGACY_TEST_DISCOVERY
Expand Down
2 changes: 2 additions & 0 deletions Tests/TestingMacrosTests/PragmaMacroTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@
import Testing
@testable import TestingMacros

import SwiftDiagnostics
import SwiftParser
import SwiftSyntax
import SwiftSyntaxBuilder

@Suite("PragmaMacro Tests")
struct PragmaMacroTests {
Expand Down
1 change: 1 addition & 0 deletions Tests/TestingMacrosTests/TestDeclarationMacroTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import Testing
@testable import TestingMacros

import SwiftBasicFormat
import SwiftDiagnostics
import SwiftParser
import SwiftSyntax
Expand Down
1 change: 1 addition & 0 deletions Tests/TestingMacrosTests/TestSupport/Parse.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

@testable import TestingMacros

import SwiftBasicFormat
import SwiftDiagnostics
import SwiftOperators
import SwiftParser
Expand Down
6 changes: 4 additions & 2 deletions Tests/TestingTests/AttachmentTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@ struct AttachmentTests {
// Write the attachment to disk, then read it back.
let filePath = try attachment.write(toFileInDirectoryAtPath: temporaryDirectory(), appending: suffixes.next()!)
createdFilePaths.append(filePath)
let fileName = try #require(filePath.split { $0 == "/" || $0 == #"\"# }.last)
let filePathComponents = filePath.split { $0 == "/" || $0 == #"\"# }
let fileName = try #require(filePathComponents.last)
if i == 0 {
#expect(fileName == baseFileName)
} else {
Expand All @@ -118,7 +119,8 @@ struct AttachmentTests {
defer {
remove(filePath)
}
let fileName = try #require(filePath.split { $0 == "/" || $0 == #"\"# }.last)
let filePathComponents = filePath.split { $0 == "/" || $0 == #"\"# }
let fileName = try #require(filePathComponents.last)
#expect(fileName == "loremipsum-\(suffix).tgz.gif.jpeg.html")
try compare(attachableValue, toContentsOfFileAtPath: filePath)
}
Expand Down