Skip to content

Commit 6abfea9

Browse files
committed
[CS] NFC: Remove CTP_CalleeResult
This has been unused since the removal of CSDiag.
1 parent 8748213 commit 6abfea9

File tree

8 files changed

+3
-12
lines changed

8 files changed

+3
-12
lines changed

include/swift/Sema/ConstraintLocator.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ enum ContextualTypePurpose : uint8_t {
6161
/// 'foo(a : @autoclosure () -> Int = 42)'.
6262
CTP_AutoclosureDefaultParameter,
6363

64-
CTP_CalleeResult, ///< Constraint is placed on the result of a callee.
6564
CTP_CallArgument, ///< Call to function or operator requires type.
6665
CTP_ClosureResult, ///< Closure result expects a specific type.
6766
CTP_ArrayElement, ///< ArrayExpr wants elements to have a specific type.

lib/Sema/CSApply.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9606,7 +9606,6 @@ ExprWalker::rewriteTarget(SyntacticElementTarget target) {
96069606
case CTP_EnumCaseRawValue:
96079607
case CTP_DefaultParameter:
96089608
case CTP_AutoclosureDefaultParameter:
9609-
case CTP_CalleeResult:
96109609
case CTP_CallArgument:
96119610
case CTP_ClosureResult:
96129611
case CTP_ArrayElement:

lib/Sema/CSDiagnostics.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -867,7 +867,6 @@ GenericArgumentsMismatchFailure::getDiagnosticFor(
867867
case CTP_Unused:
868868
case CTP_CannotFail:
869869
case CTP_YieldByReference:
870-
case CTP_CalleeResult:
871870
case CTP_EnumCaseRawValue:
872871
case CTP_ExprPattern:
873872
case CTP_SingleValueStmtBranch:
@@ -2954,9 +2953,6 @@ getContextualNilDiagnostic(ContextualTypePurpose CTP) {
29542953
case CTP_CannotFail:
29552954
llvm_unreachable("These contextual type purposes cannot fail with a "
29562955
"conversion type specified!");
2957-
case CTP_CalleeResult:
2958-
llvm_unreachable("CTP_CalleeResult does not actually install a "
2959-
"contextual type");
29602956
case CTP_Initialization:
29612957
return diag::cannot_convert_initializer_value_nil;
29622958

@@ -3758,7 +3754,6 @@ ContextualFailure::getDiagnosticFor(ContextualTypePurpose context,
37583754
case CTP_Unused:
37593755
case CTP_CannotFail:
37603756
case CTP_YieldByReference:
3761-
case CTP_CalleeResult:
37623757
case CTP_ExprPattern:
37633758
break;
37643759
}

lib/Sema/CSSimplify.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16696,7 +16696,6 @@ void ConstraintSystem::addContextualConversionConstraint(
1669616696

1669716697
case CTP_ArrayElement:
1669816698
case CTP_AssignSource:
16699-
case CTP_CalleeResult:
1670016699
case CTP_CannotFail:
1670116700
case CTP_Condition:
1670216701
case CTP_Unused:

lib/Sema/SyntacticElementTarget.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,6 @@ bool SyntacticElementTarget::contextualTypeIsOnlyAHint() const {
263263
case CTP_EnumCaseRawValue:
264264
case CTP_DefaultParameter:
265265
case CTP_AutoclosureDefaultParameter:
266-
case CTP_CalleeResult:
267266
case CTP_CallArgument:
268267
case CTP_ClosureResult:
269268
case CTP_ArrayElement:

test/Migrator/Inputs/substring_to_string_conversion.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ do {
2828
func foo(x: String = ss) {}
2929
}
3030

31-
// CTP_CalleeResult
31+
// CTP_Initialization
3232
do {
3333
func getSubstring() -> Substring { return ss }
3434
let gottenString : String = getSubstring()

test/Migrator/substring_to_string_conversion.swift.expected

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ do {
2828
func foo(x: String = String(ss)) {}
2929
}
3030

31-
// CTP_CalleeResult
31+
// CTP_Initialization
3232
do {
3333
func getSubstring() -> Substring { return ss }
3434
let gottenString : String = String(getSubstring())

test/Sema/substring_to_string_conversion_swift4.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ do {
3030
func foo(x: String = ss) {} // expected-error {{default argument value of type 'Substring' cannot be converted to type 'String'}} {{24-24=String(}} {{26-26=)}}
3131
}
3232

33-
// CTP_CalleeResult
33+
// CTP_Initialization
3434
do {
3535
func getSubstring() -> Substring { return ss }
3636
let gottenString : String = getSubstring() // expected-error {{cannot convert value of type 'Substring' to specified type 'String'}} {{31-31=String(}} {{45-45=)}}

0 commit comments

Comments
 (0)