Files
swift-mirror/test/Parse/issue-74561.swift
Hamish Knight a657f97c9b [Parse] Avoid skipping bodies with #sourceLocation
`#sourceLocation` requires setting and restoring
state in the parser, so we cannot skip any bodies
containing `#sourceLocation` tokens. Member skipping
was already doing this, extend it to function
body skipping too.
2024-07-30 16:56:00 +01:00

19 lines
552 B
Swift

// RUN: %empty-directory(%t)
// Make sure we can parse with and without skipping.
// RUN: %target-typecheck-verify-swift
// RUN: %target-swift-frontend -verify -emit-module -experimental-skip-non-inlinable-function-bodies -module-name Mod -emit-module-path %t/Mod.swiftmodule %s
// https://github.com/swiftlang/swift/issues/74561
// Make sure we can parse this.
#sourceLocation(file: "A", line: 3)
public func foo(_ param: Int) {
#sourceLocation()
}
#sourceLocation(file: "B", line: 3)
@inlinable
public func bar(_ param: Int) {
#sourceLocation()
}