Skip to content

[Cherry-pick into next] [lldb] Add missing return type annotations #10844

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

adrian-prantl
Copy link

commit 2e2508c4df4f89ae1583c91206666d465f7de2e6
Author: Adrian Prantl <[email protected]>
Date:   Fri Jun 13 08:39:34 2025 -0700

    [lldb] Add missing return type annotations
    
    In a thorny corner of the language C++ doesn't actually type check the
    return type of a function passed into a std::function argument. Here
    the type inference in the lambda resulted in a ChildInfo being
    returned where an llvm::Expected<ChildInfo> was expected, which
    through coincidence works very often, but not always, leading to a
    crash.
    
    rdar://153137542

In a thorny corner of the language C++ doesn't actually type check the
return type of a function passed into a std::function argument. Here
the type inference in the lambda resulted in a ChildInfo being
returned where an llvm::Expected<ChildInfo> was expected, which
through coincidence works very often, but not always, leading to a
crash.

rdar://153137542
(cherry picked from commit 2e2508c)
@adrian-prantl adrian-prantl merged commit 07104d3 into swiftlang:next Jun 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant