https://kotlinlang.org logo
#announcements
Title
# announcements
p

pniederw

12/01/2020, 11:10 PM
How do I suppress the new compiler warning "Name contains characters which can cause problems on Windows"? It doesn't show in IntelliJ, only in the Gradle build.
a

Alexey Belkov [JB]

12/02/2020, 9:41 AM
You can suppress it with
@Suppress("DANGEROUS_CHARACTERS")
on the function declaration. By the way, can you please share why do you want to suppress it? As I understand, we will turn it into an error at some point. Corresponding issue: https://youtrack.jetbrains.com/issue/KT-17438
p

pniederw

12/02/2020, 3:51 PM
I'm a big fan of using sentences as (junit) test method names, and sometimes I want to have quotes in them. something like:
Copy code
@Test
fun `state should be "on"`() { ... }
a

Alexey Belkov [JB]

12/02/2020, 3:59 PM
I see. Maybe you can just avoid using the symbols ?*"|%, so the program won't crash on Windows.
p

pniederw

12/02/2020, 4:26 PM
I can if I have to. Is there no way to lift this requirement? I don't use Windows.
51 Views