mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[CSOptimizer] Infer argument candidates from calls to Double and CGFloat constructors
Helps situations like `1 + {Double, CGFloat}(...)` by inferring
a type for the second operand of `+` based on a type being constructed.
Currently limited to Double and CGFloat only since we need to
support implicit `Double<->CGFloat` conversion.
Helps situations like `1 + CGFloat(...)` by inferring a type for
the second operand of `+` based on a type being constructed.
Currently limited to known integer, floating-point and CGFloat types
since we know how they are structured.
This commit is contained in:
@@ -497,6 +497,10 @@ public:
|
||||
/// literal (represented by `ArrayExpr` and `DictionaryExpr` in AST).
|
||||
bool isCollectionLiteralType() const;
|
||||
|
||||
/// Determine whether this type variable represents a result type of a
|
||||
/// function call.
|
||||
bool isFunctionResult() const;
|
||||
|
||||
/// Retrieve the representative of the equivalence class to which this
|
||||
/// type variable belongs.
|
||||
///
|
||||
|
||||
Reference in New Issue
Block a user