This becomes a utility that maps the requirement's types into the
generic environment if needed before calling out to the new
Requirement::isSatisfied().
Without this hack the call will leave a stack frame around (not tail
call optimized) and blow the stack if we call switch_task often enough.
Ideally, clang would emit this call as `musttail` but currently it does
not.
rdar://76652421
When compiling with allow errors, it's possible to have invalid
inherited types - both null and ErrorType.
Cleaned up the tests a little - moved the majority of
Frontend/allow-errors.swift into separate files in
Serialization/AllowErrors and use split_file.py instead of #defines.
Resolves rdar://78048470
If a base class initializer was not generic but had a contextual 'where'
clause, we would unconditionally inherit the 'where' clause in the override as
part of the fix for another issue (https://bugs.swift.org/browse/SR-14118).
However, it is possible that some of those requirements are satisfied by
the derived class itself. For example:
class Base<T> {
init() where T : AnyObject {}
}
class Derived : Base<AnyObject> {}
In this case, the implicit override Derived.init() has no generic requirements
at all. We used to assert because we would create a GSB with no generic
parameters.
It was also possible for a base class initializer to have generic
requirements that are not satisfied by the derived class. In this case,
we need to drop the initializer from consideration altogether.
While I'm here, I improved the comments in computeDesignatedInitOverrideSignature(),
which is the new name for configureGenericDesignatedInitOverride().
Fixes rdar://problem/77285618.
* First draft docs for iterator, sequence type.
Also drop(while:), to get a feel for the AsyncSequence->AsyncSequence cases.
* Source docs for contains and reduce.
* Docs for methods in AsyncSequence.
This covers all the methods that return a single value. Still working on the extension methods that return new sequences.
* Early source docs for dropFirst(_:) and its type
* Correct doc format for dropFirst(_:).
* Prefix, plus some fixes.
* Docs for prefix(while:).
* Apply Philippe's snippet fixes.
* First draft docs on the map sequences.
Plus miscellaneous fixes throughout.
* Show result of flatMap example.
* More explicit cancellation guidance.
* Convert snippets to trailing closures.
* Correct misplaced doc comments.
* Apply suggestions from code review
Co-authored-by: Philippe Hausler <phausler@apple.com>
* Apply editorial feedback.
* Apply additional editorial feedback.
* Apply suggestions from code review
Co-authored-by: bjlanier <blanier@apple.com>
* Apply further editorial feedback.
Co-authored-by: Chris Adamson <cadamson@apple.com>
Co-authored-by: Philippe Hausler <phausler@apple.com>
Co-authored-by: bjlanier <blanier@apple.com>
When adding an async alternative, add the @completionHandlerAsync
attribute to the sync function. Check for this attribute in addition to
the name check, ie. convert a call if the callee has either
@completionHandlerAsync or a name that is completion-handler-like name.
The addition of the attribute is currently gated behind the experimental
concurrency flag.
Resolves rdar://77486504
Previously we were unconditionally dropping a
return statement if it was the last node, which
could cause us to inadvertently drop the result
expression as well. Instead, only drop bare
'return' statements.
rdar://77789360
It's possible the user has already written an
explicit return for the call to the completion
handler. In that case, avoid adding another return.
rdar://77789360
- Add a missing return to the break statement
placeholder handling.
- Only turn the `return` token into a placeholder,
as we still want to apply the transformation to
the sub expression.
This stops us from crashing by attempting to walk
into the return sub-expression.
rdar://77789360
- Add `LocalizationProducerState` to manage the states of LocalizationProducers.
- Add `initializeImpl` and `initializeIfNeeded` to manage lazily initialization of `LocalizationProducer`s.
- Move constructing a localization producer from DiagEngine to `LocalizationProrducer` itself.