mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
A parse-only option is needed for parse performance tracking and the current option also includes semantic analysis.
25 lines
541 B
Swift
25 lines
541 B
Swift
// RUN: %target-typecheck-verify-swift
|
|
|
|
// Test "context" literals, #file, #line, #column, etc.
|
|
|
|
func requireInt(_ x: Int) { }
|
|
func requireString(_ s: String) { }
|
|
|
|
func testContextLiterals() {
|
|
let file = #file
|
|
requireString(file)
|
|
let line = #line
|
|
requireInt(line)
|
|
let column = #column
|
|
requireInt(column)
|
|
let function = #function
|
|
requireString(function)
|
|
}
|
|
|
|
// Disambiguate between collection literals and object literals.
|
|
func collectionLiteralDisambiguation() {
|
|
_ = [#line]
|
|
_ = [#line, #column]
|
|
_ = [#line : #column]
|
|
}
|