mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
`#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.
19 lines
552 B
Swift
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()
|
|
}
|