mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Instead of the simple "expected identifier in declaration", the error will now read "keyword '%' cannot be used as an identifier here", and will be accompanied by a note suggesting escaping the keyword with backticks, as well as a fixit. https://bugs.swift.org/browse/SR-3167
26 lines
322 B
Swift
26 lines
322 B
Swift
// RUN: %target-typecheck-verify-swift
|
|
|
|
func `protocol`() {}
|
|
|
|
`protocol`()
|
|
|
|
class `Type` {}
|
|
|
|
var `class` = `Type`.self
|
|
|
|
func foo() {}
|
|
|
|
`foo`()
|
|
|
|
// Escaping suppresses identifier contextualization.
|
|
var get: (() -> ()) -> () = { $0() }
|
|
|
|
var applyGet: Int {
|
|
`get` { }
|
|
return 0
|
|
}
|
|
|
|
enum `switch` {}
|
|
|
|
typealias `Self` = Int
|