Skip to content

Commit 8426565

Browse files
committed
---
yaml --- r: 340476 b: refs/heads/rxwei-patch-1 c: 26d0324 h: refs/heads/master
1 parent 565bfaf commit 8426565

File tree

3 files changed

+25
-1
lines changed

3 files changed

+25
-1
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1015,7 +1015,7 @@ refs/tags/swift-DEVELOPMENT-SNAPSHOT-2018-08-18-a: b10b1fce14385faa6d44f6b933e95
10151015
refs/heads/rdar-43033749-fix-batch-mode-no-diags-swift-5.0-branch: a14e64eaad30de89f0f5f0b2a782eed7ecdcb255
10161016
refs/heads/revert-19006-error-bridging-integer-type: 8a9065a3696535305ea53fe9b71f91cbe6702019
10171017
refs/heads/revert-19050-revert-19006-error-bridging-integer-type: ecf752d54b05dd0a20f510f0bfa54a3fec3bcaca
1018-
refs/heads/rxwei-patch-1: 59bc60eb201e35a2cf90a5a286c78d97500f8111
1018+
refs/heads/rxwei-patch-1: 26d03243183ced04454667496eb2df37e2556670
10191019
refs/heads/shahmishal-patch-1: e58ec0f7488258d42bef51bc3e6d7b3dc74d7b2a
10201020
refs/heads/typelist-existential: 4046359efd541fb5c72d69a92eefc0a784df8f5e
10211021
refs/tags/swift-4.2-DEVELOPMENT-SNAPSHOT-2018-08-20-a: 4319ba09e4fb8650ee86061075c74a016b6baab9

branches/rxwei-patch-1/lib/Sema/CSApply.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3897,6 +3897,19 @@ namespace {
38973897
simplifyExprType(E);
38983898
auto valueType = cs.getType(E);
38993899

3900+
// TODO(diagnostics): Once all of the diagnostics are moved to
3901+
// new diagnostics framework this check could be eliminated.
3902+
//
3903+
// Only way for this to happen is CSDiag try to re-typecheck
3904+
// sub-expression which contains this placeholder with
3905+
// `AllowUnresolvedTypeVariables` flag set.
3906+
//
3907+
// A better solution could be to replace placeholders with this
3908+
// implicit call early on and type-check that call together with
3909+
// the rest of the constraint system.
3910+
if (valueType->hasUnresolvedType())
3911+
return nullptr;
3912+
39003913
auto &tc = cs.getTypeChecker();
39013914
auto &ctx = tc.Context;
39023915
// Synthesize a call to _undefined() of appropriate type.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// RUN: %target-typecheck-verify-swift
2+
3+
protocol P {}
4+
5+
func fn<T, U: P>(_ arg1: T, arg2: (T) -> U) {}
6+
7+
func test(str: String) {
8+
fn(str) { arg in
9+
<#FOO#> // expected-error {{editor placeholder in source file}}
10+
}
11+
}

0 commit comments

Comments
 (0)