Files
swift-mirror/validation-test/IDE/crashers_2_fixed/rdar42098113.swift
Slava Pestov 1caf2c7544 Sema: Fix code completion crash when a ParamDecl hasn't had its type set yet
We set the type of ParamDecls when applying solutions in the normal path, but
sometimes code completion will type check an expression inside a closure without
checking the outer expression. In this case, we may have inferred a type for
the ParamDecl, but we don't write it back.

Instead, just look at the DeclRefExpr's type.

Fixes <rdar://problem/42098113>.
2019-04-02 00:25:24 -04:00

9 lines
173 B
Swift

// RUN: %target-swift-ide-test -code-completion -code-completion-token=A -source-filename %s
func test() {
let cl = { arg in
let name = arg as String
#^A^#
}
}