Poko icon indicating copy to clipboard operation
Poko copied to clipboard

Automatically make properties without visibility explicitly public in FIR

Open JakeWharton opened this issue 3 months ago • 2 comments

With a data class, you declare the type public and all the properties become public even in explicit API mode.

public data class Auth(
  val user: String,
  val token: String,
)

However, change to @Poko and such a thing does not compile.

@Poko
public class Auth(
  val user: String,
  val token: String,
)

You have to explicitly mark each property as public. 😢

Since @Poko competes directly with data, I think it makes sense to try and replicate the behavior of not needing an explicit public.

And unlike data, you can still narrow the visibility of a property and have everything work Just Fine™.

JakeWharton avatar Aug 26 '25 02:08 JakeWharton