Files
swift-mirror/test/expr/primary/literal/context.swift
David Farler b7d17b25ba Rename -parse flag to -typecheck
A parse-only option is needed for parse performance tracking and the
current option also includes semantic analysis.
2016-11-28 10:50:55 -08:00

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]
}