Based on the checked cast behavior don't warn about unrelated
casts between tuples unless their sizes or labels differ.
Resolves: rdar://problem/56436235
* [Typechecker] resolveAttributedType() should invalidate the type repr after emitting a diagnostic, to prevent duplicate diagnostics later
* [Test] Update '@noescape' attribute diagnostics
* [Typechecker] Add a special diagnose method to TypeResolver that accepts a TypeRepr and invalidates it
* [Typechecker] Rename the special 'diagnose' method to 'diagnoseInvalid' for clarity
Enable qualified declaration names in `@derivative` attribute, just like
`@transpose` attribute.
`DerivativeAttr` now stores a base type `TypeRepr *`, which is non-null for
parsed attributes that reference a qualified original declaration.
Add `TypeResolutionFlags::AllowModule` flag to enable module lookup via
`TypeChecker::lookupMember` given a `ModuleType`.
Add tests for type-qualified and module-qualified declaration names.
Resolves TF-1058.
Curry thunks create AutoClosureExprs with parameters, and we can't just
fold those away.
Also, remove an older AutoClosureExpr cleanup that seems to be
redundant.
This commit adds a new ValueDecl::isLocalCapture() predicate and
uses it in the right places. The predicate is true if the
declaration is in local context, *or* if its at the top level of
the main source file and follows a 'guard' statement.
Fixes <rdar://problem/23051362> / <https://bugs.swift.org/browse/SR-3528>.
A TopLevelCodeDecl is a local context and any declarations inside
of one must be treated as captures. Furthermore, all the
TopLevelCodeDecl children of a source file are peers, and can
see each other's bindings, so don't perform an exact match on the
DeclContext.
Part of <rdar://problem/23051362> / <https://bugs.swift.org/browse/SR-3528>.
* WIP implementation
* Cleanup implementation
* Install backedge rather than storing array reference
* Add diagnostics
* Add missing parameter to ResultFinderForTypeContext constructor
* Fix tests for correct fix-it language
* Change to solution without backedge, change lookup behavior
* Improve diagnostics for weak captures and captures under different names
* Remove ghosts of implementations past
* Address review comments
* Reorder member variable initialization
* Fix typos
* Exclude value types from explicit self requirements
* Add tests
* Add implementation for AST lookup
* Add tests
* Begin addressing review comments
* Re-enable AST scope lookup
* Add fixme
* Pull fix-its into a separate function
* Remove capturedSelfContext tracking from type property initializers
* Add const specifiers to arguments
* Address review comments
* Fix string literals
* Refactor implicit self diagnostics
* Add comment
* Remove trailing whitespace
* Add tests for capture list across multiple lines
* Add additional test
* Fix typo
* Remove use of ?: to fix linux build
* Remove second use of ?:
* Rework logic for finding nested self contexts
Fixes rdar://problem/53678041 and rdar://problem/57676337; the former was
because we diagnosed unavailable wrappedValue at the null source location
originall, then started suppressing that diagnostic altogether. Produce a
proper diagnostic now.
Introduce a `ImplicitCallAsFunction` locator path
element to represent an implicit member reference
to `callAsFunction`. Then adjust CSApply a little
to check whether it's finishing an apply for a
callable type, and if so build the implicit member
access.