Hey folks, shouldn't `fun Route.get(...): Route`, ...
# ktor
e
Hey folks, shouldn't
fun Route.get(...): Route
,
fun Route.post(...): Route
and many others be annotated with
@IgnorableReturnValue
? In version 3.6.0 they aren't, which seems weird to me
➕ 1
s
Yes, great point! Although I've not gotten any warnings about this myself in IDEA and I have
full
mode enabled in a couple projects. By accident not Ktor projects? 🤔 I'm gonna double check and raise it with the team ☺️
Could you share a snippet that is causing you to see a warning? I'm unsure why it's not giving me a warning though... (I'm continuing to investigate where what is needed).
e
I don't see warning either which is also weird, as I have this in my `module.yaml`:
Copy code
settings:
  ktor:
    enabled: true
    version: 3.6.0
  jvm:
    jdk:
      version: 25
  kotlin:
    freeCompilerArgs:
      - -Xreturn-value-checker=full
      - -Xwarning-level=RETURN_VALUE_NOT_USED:error
I even should see them as errors btw. IntelliJ 2026.2.2:
s
Okay, so at least we're seeing the same 😅 I'll let you know when I figure out why its not resulting in an error. With
-Xwarning-level=RETURN_VALUE_NOT_USED:error
it should indeed become an error.
👍 1
e
I didn't originally created my project as a ktor project if it matters. I just manually added ktor dependencies and put
settings.ktor.enabled: true
and that's all
s
Okay, sorry I got a bit confused myself.
full
doesn't mean 3rd party libraries are checked but only when 3rd party libraries ship with
-Xreturn-value-checker=full
to signal they properly support it. Similar to platform types Java annotations are supported and can be configured.
e
so, ktor 3.7 should be shipped with that
-Xreturn-value-checker=full
flag? And with those functions (Route.get and others) annotated with
@IgnorableReturnValue
?
s
It depends 🥁 We could also add
@MustUseReturnValue
in places that need it or depending on module.
e
yeah, I mean the team will put all necessary annotations (
MustUseReturnValue, IgnoreableReturnValue
) wherever needed to make ktor fully return-values-checker-feature compatible. Or this is not on the table?
s
It's absolutely on the table, and will happen asap but timeline is unclear so no guarantees on 3.7 but it should happen in timely fashion since it doesn't involve binary changes.
👍 2