@@ -112,48 +112,6 @@ class LookupTypeResult {
112112 }
113113};
114114
115- // / This specifies the purpose of the contextual type, when specified to
116- // / typeCheckExpression. This is used for diagnostic generation to produce more
117- // / specified error messages when the conversion fails.
118- // /
119- enum ContextualTypePurpose {
120- CTP_Unused, // /< No contextual type is specified.
121- CTP_Initialization, // /< Pattern binding initialization.
122- CTP_ReturnStmt, // /< Value specified to a 'return' statement.
123- CTP_ReturnSingleExpr, // /< Value implicitly returned from a function.
124- CTP_YieldByValue, // /< By-value yield operand.
125- CTP_YieldByReference, // /< By-reference yield operand.
126- CTP_ThrowStmt, // /< Value specified to a 'throw' statement.
127- CTP_EnumCaseRawValue, // /< Raw value specified for "case X = 42" in enum.
128- CTP_DefaultParameter, // /< Default value in parameter 'foo(a : Int = 42)'.
129-
130- // / Default value in @autoclosure parameter
131- // / 'foo(a : @autoclosure () -> Int = 42)'.
132- CTP_AutoclosureDefaultParameter,
133-
134- CTP_CalleeResult, // /< Constraint is placed on the result of a callee.
135- CTP_CallArgument, // /< Call to function or operator requires type.
136- CTP_ClosureResult, // /< Closure result expects a specific type.
137- CTP_ArrayElement, // /< ArrayExpr wants elements to have a specific type.
138- CTP_DictionaryKey, // /< DictionaryExpr keys should have a specific type.
139- CTP_DictionaryValue, // /< DictionaryExpr values should have a specific type.
140- CTP_CoerceOperand, // /< CoerceExpr operand coerced to specific type.
141- CTP_AssignSource, // /< AssignExpr source operand coerced to result type.
142- CTP_SubscriptAssignSource, // /< AssignExpr source operand coerced to subscript
143- // /< result type.
144- CTP_Condition, // /< Condition expression of various statements e.g.
145- // /< `if`, `for`, `while` etc.
146- CTP_ForEachStmt, // /< "expression/sequence" associated with 'for-in' loop
147- // /< is expected to conform to 'Sequence' protocol.
148- CTP_WrappedProperty, // /< Property type expected to match 'wrappedValue' type
149- CTP_ComposedPropertyWrapper, // /< Composed wrapper type expected to match
150- // /< former 'wrappedValue' type
151-
152- CTP_CannotFail, // /< Conversion can never fail. abort() if it does.
153- };
154-
155-
156-
157115// / Flags that can be used to control type checking.
158116enum class TypeCheckExprFlags {
159117 // / Whether we know that the result of the expression is discarded. This
0 commit comments