Skip to content

[lldb] Skip generic expression wrapping when no generics are in scope#13224

Open
kastiglione wants to merge 2 commits into
swift/release/6.4.xfrom
dl/lldb-Skip-generic-expression-wrapping-when-no-generics-are-in-scope
Open

[lldb] Skip generic expression wrapping when no generics are in scope#13224
kastiglione wants to merge 2 commits into
swift/release/6.4.xfrom
dl/lldb-Skip-generic-expression-wrapping-when-no-generics-are-in-scope

Conversation

@kastiglione

@kastiglione kastiglione commented Jun 16, 2026

Copy link
Copy Markdown

Prior to this change, MakeGenericSignaturesAndCalls would be called unconditionally when BindGenericTypes is set to auto (the default). For context-free po, there are no metadata variables (generic parameters) in scope. This call sequence results in malformed Swift that contains empty generics (func $__lldb_user_expr<>). This fails to parse, and causes an unnecessary expression evaluation retry.

The fix is to gate this code path on metadata_variables being non-empty. Now, the generic wrapper is only used when generic parameters are present.

Assisted-by: claude

`MakeGenericSignaturesAndCalls` has been called unconditionally when `BindGenericTypes`
is set to auto (the default), even when there are no metadata variables (generic
parameters) in scope. This results in malformed Swift (empty generics ex `func
$__lldb_user_expr<>`). This fails to parse, and causes an unnecessary retry.

The fix is to gate this code path on `metadata_variables` being non-empty. Now, the
generic wrapper is only used when generic parameters are present.
@kastiglione kastiglione requested a review from a team as a code owner June 16, 2026 22:47
@kastiglione

Copy link
Copy Markdown
Author

@swift-ci test

@kastiglione kastiglione requested a review from augusto2112 June 16, 2026 22:47
@kastiglione kastiglione requested a review from JDevlieghere June 19, 2026 18:33
@kastiglione

Copy link
Copy Markdown
Author

@swift-ci test

@kastiglione

Copy link
Copy Markdown
Author

@swift-ci test macOS

1 similar comment
@kastiglione

Copy link
Copy Markdown
Author

@swift-ci test macOS

@kastiglione

Copy link
Copy Markdown
Author

@swift-ci test windows

5 similar comments
@kastiglione

Copy link
Copy Markdown
Author

@swift-ci test windows

@kastiglione

Copy link
Copy Markdown
Author

@swift-ci test windows

@kastiglione

Copy link
Copy Markdown
Author

@swift-ci test windows

@kastiglione

Copy link
Copy Markdown
Author

@swift-ci test windows

@kastiglione

Copy link
Copy Markdown
Author

@swift-ci test windows

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.

2 participants