Skip to content

Fix the type signature of skip_log_prefix to preserve the decorated function's return type. - #420

Merged
copybara-service[bot] merged 1 commit into
mainfrom
test_947607875
Jul 21, 2026
Merged

Fix the type signature of skip_log_prefix to preserve the decorated function's return type.#420
copybara-service[bot] merged 1 commit into
mainfrom
test_947607875

Conversation

@copybara-service

@copybara-service copybara-service Bot commented Jul 14, 2026

Copy link
Copy Markdown

Fix the type signature of skip_log_prefix to preserve the decorated function's return type.

The type variable for the decorated function should be bounded so that the exact signature is captured, otherwise the argument and return types end up as Any. This not only weakens type checking, but when decorating a NoReturn function, it messes up the type checker's understanding of the control flow.

@copybara-service
copybara-service Bot force-pushed the test_947607875 branch 5 times, most recently from 19099c8 to cc72fec Compare July 21, 2026 08:55
…unction's return type.

The type variable for the decorated function should be bounded so that the exact signature is captured, otherwise the argument and return types end up as Any. This not only weakens type checking, but when decorating a NoReturn function, it messes up the type checker's understanding of the control flow.

PiperOrigin-RevId: 951340806
@copybara-service
copybara-service Bot merged commit d949076 into main Jul 21, 2026
16 checks passed
@copybara-service
copybara-service Bot deleted the test_947607875 branch July 21, 2026 09:00
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.

0 participants