Skip to content
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
4 changes: 2 additions & 2 deletions Sources/SwiftDriver/Driver/Driver.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2092,8 +2092,8 @@ extension Driver {
case .indexFile:
compilerOutputType = .indexData

case .parse, .resolveImports, .typecheck, .dumpParse,
.printAst, .dumpTypeRefinementContexts, .dumpScopeMaps,
case .parse, .resolveImports, .typecheck, .experimentalLazyTypecheck,
.dumpParse, .printAst, .dumpTypeRefinementContexts, .dumpScopeMaps,
.dumpInterfaceHash, .dumpTypeInfo, .verifyDebugInfo:
compilerOutputType = nil

Expand Down
3 changes: 3 additions & 0 deletions Sources/SwiftDriver/Jobs/EmitModuleJob.swift
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,9 @@ extension Driver {
try commandLine.appendLast(.emitExtensionBlockSymbols, .omitExtensionBlockSymbols, from: &parsedOptions)
try commandLine.appendLast(.symbolGraphMinimumAccessLevel, from: &parsedOptions)
try commandLine.appendLast(.checkApiAvailabilityOnly, from: &parsedOptions)
if isFrontendArgSupported(.experimentalLazyTypecheck) {
try commandLine.appendLast(.experimentalLazyTypecheck, from: &parsedOptions)
}

if parsedOptions.hasArgument(.parseAsLibrary, .emitLibrary) {
commandLine.appendFlag(.parseAsLibrary)
Expand Down
2 changes: 1 addition & 1 deletion Sources/SwiftOptions/Option.swift
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public struct Option {
/// The spelling of the option, including any leading dashes.
public let spelling: String

///. The kind of option, which determines how it is parsed.
/// The kind of option, which determines how it is parsed.
public let kind: Kind

/// The option that this aliases, if any, as a closure that produces the
Expand Down
1 change: 1 addition & 0 deletions Sources/SwiftOptions/Options.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1239,6 +1239,7 @@ extension Option {
Option.ExperimentalPerformanceAnnotations,
Option.platformCCallingConventionEQ,
Option.platformCCallingConvention,
Option.experimentalLazyTypecheck,
Option.experimentalPrintFullConvention,
Option.experimentalSkipAllFunctionBodies,
Option.experimentalSkipNonInlinableFunctionBodiesWithoutTypes,
Expand Down
12 changes: 12 additions & 0 deletions Tests/SwiftDriverTests/SwiftDriverTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7227,6 +7227,18 @@ final class SwiftDriverTests: XCTestCase {
]))
}
}

func testEmitModuleExperimentalLazyTypecheck() throws {
var driver = try Driver(args: [
"swiftc", "test.swift", "-module-name", "Test", "-experimental-lazy-typecheck", "-emit-module-interface"
])
guard driver.isFrontendArgSupported(.experimentalLazyTypecheck) else {
throw XCTSkip("Skipping: compiler does not support '-experimental-lazy-typecheck'")
}
let jobs = try driver.planBuild().removingAutolinkExtractJobs()
let emitModuleJob = try XCTUnwrap(jobs.first(where: {$0.kind == .emitModule}))
XCTAssertTrue(emitModuleJob.commandLine.contains(.flag("-experimental-lazy-typecheck")))
}
}

func assertString(
Expand Down