Skip to content

swift repl suppresses warnings #71542

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

Open
MahdiBM opened this issue Feb 11, 2024 · 3 comments
Open

swift repl suppresses warnings #71542

MahdiBM opened this issue Feb 11, 2024 · 3 comments
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. triage needed This issue needs more specific labels

Comments

@MahdiBM
Copy link

MahdiBM commented Feb 11, 2024

Description

~ swift repl
Welcome to Apple Swift version 5.9.2 (swiftlang-5.9.2.2.56 clang-1500.1.0.2.5).
Type :help for assistance.
  1> #warning("test")
  2> let a = "sdad""
error: error while processing module import: error: repl.swift:5:15: error: unterminated string literal
let a = "sdad""
              ^

#warning at line #1 is suppressed but the error at line #2 is not.

Reproduction

[Provided in the previous section]

Expected behavior

I expect warnings to be emitted as well.

Environment

Swift 5.9.2, current 5.10 nightly, current main toolchain, none work as expected as of writing this issue.

Additional information

No response

@MahdiBM MahdiBM added bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. triage needed This issue needs more specific labels labels Feb 11, 2024
@MahdiBM
Copy link
Author

MahdiBM commented Feb 16, 2024

Use-case: checking to see if a nightly image actually solves a warning (like the Sendable warnings).
I just use swift -e for that right now.

@rjmansfield
Copy link
Contributor

rjmansfield commented Jul 11, 2024

In swift repl mode, lldb will only output errors. One workaround is to use LLDB_SWIFT_DUMP_DIAGS=1 to see all diagnostics. e.g.

$ LLDB_SWIFT_DUMP_DIAGS=1 swift repl
Welcome to Apple Swift version 5.10 (swiftlang-5.10.0.6.3 clang-1500.3.3.3.999).
Type :help for assistance.
  1> #warning("warn")
repl.swift:1:10: warning: warn
#warning("warn")

@MahdiBM
Copy link
Author

MahdiBM commented Jul 11, 2024

Perhaps that should change?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. triage needed This issue needs more specific labels
Projects
None yet
Development

No branches or pull requests

2 participants