This didn't get much traction on SO so xposting: ...
# squarelibraries
e
This didn't get much traction on SO so xposting: If I have the following inline class:
Copy code
interface StringId {
  val raw: String
}

@JvmInline
value class MyId(override val raw: String) : StringId
is it safe to pass it to a Retrofit function?
Copy code
interface MyApiEndpoints {
  @GET("/fetch/{id}")
  suspend fun fetch(@Path("id") id: MyId): Response<JsonObject>
}
https://stackoverflow.com/questions/68232128/is-it-safe-to-pass-a-kotlin-inline-class-to-a-retrofit-function
b
You could have the answer within 5 minutes were you to write a test, no ?
e
I'm more worried about edge cases that I'm not aware of.
Also looking for a canonical answer in case anyone else has this question in the future.
e
for now Retrofit is only looking at Java reflection, so it should see just a strangely mangled function name but otherwise work
I imagine https://github.com/square/retrofit/issues/3075 could complicate things here though