Files
swift-mirror/test/Sema/editor_placeholders.swift
Argyrios Kyrtzidis 68bd67fc12 [Parse/AST] Introduce an AST node for editor placeholders in expression contexts.
If the placeholder is a typed one, parse its type string into a TypeRepr,
resolve it during typechecking and set it as the type for the associated EditorPlaceholderExpr.

Swift SVN r26215
2015-03-17 01:53:02 +00:00

14 lines
471 B
Swift

// RUN: %target-parse-verify-swift
func foo(x: Int) -> Int {}
func foo(x: Float) -> Float {}
var v = foo(<#T##x: Float##Float#>) // expected-error {{editor placeholder}}
v = "" // expected-error {{cannot assign a value of type 'String' to a value of type '(Float)'}}
if (true) {
<#code#> // expected-error {{editor placeholder}}
}
foo(<#T##x: Undeclared##Undeclared#>) // expected-error {{editor placeholder}} expected-error {{use of undeclared type 'Undeclared'}}