Commit Graph

7 Commits

Author SHA1 Message Date
Anthony Latsis
9a414c4de4 AST: Quote attributes more consistently in DiagnosticsParse.def 2025-04-22 18:23:40 +01:00
Pavel Yaskevich
87beea3c40 [ConstraintSystem] Use binding as a source of type variable assignment
Since `binding` has all of the required information now it's possible
to use its `locator` as a source of type variable assignment
(`Bind` constraint) in `TypeVariableBinding::attempt` which helps
to improve diagnostics.
2019-12-12 12:42:30 -08:00
Mark Lacey
78d83e5703 Use %target-typecheck-verify-swift where possible. 2018-07-26 23:13:43 -07:00
Pavel Yaskevich
79b14c8916 [Sema] Improve diagnostics for non-escaping function types
Allow certain bindings and conversions involving non-escaping
function types to succeed in "diagnostic" mode to gather fixes
and diagnose such problems better, expecially related to
conversions to 'Any' and generic parameters.

Resolves: rdar://problem/38648760
2018-03-20 17:57:03 -07:00
Mark Lacey
cb674efaa4 Fixes for uses of noescape functions.
Disallow noescape functions from being inferred as escaping functions,
or passed as Any.

Fixes rdar://problem/24097075.
2018-03-18 22:01:55 -07:00
Luke Larson
e1f11d2275 Add a negative test for generic binding checks 2017-09-18 11:18:22 -07:00
Joe Groff
d0787fb6b5 Sema: Warn about some common classes of unsafeBitCast misuse.
- Most immediately, we now have `withoutActuallyEscaping` as a supported way to temporarily reference a nonescaping closure as if it were escapable, and we plan to break the ABI for escaping and nonescaping closures so that the old `unsafeBitCast` workaround no longer works.
- `unsafeBitCast` is also commonly used to kludge pointers into different types, but we have more semantically meaningful APIs for type punning now. Guide users towards those APIs.
- Suggest more specific and type-safe operations, like `bitPattern:` initializers or `unsafeDowncast`, for the situations where `unsafeBitCast` is being used to avoid dynamic type checks or reinterpret numerical bits.
2017-01-05 21:19:02 -08:00