mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
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
14 lines
471 B
Swift
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'}}
|