Do we need to enhance @static?


We know that @static was proposed in SIP 25, and it has been implemented in Dotty.
Currently, when an object member is all annotated with @static, the compiler still generates a corresponding class file for it.These objects have no practical use in most cases, and I think we should allow users to somehow prevent the compiler from generating them.For example, we can add new usage for @static:

class Test 

object Test {
  def f: Int = 100

Or we can go one step further. When an object is annotated with @static , all its members are treated as being annotated with @static , which may help us reduce a lot of duplicate work.
Preventing the compiler from generating useless objects can help us reduce the output file size, make Dotty-generated bytecode more controllable, and be more friendly to other JVM languages.


No one is interested in this proposal?
Allowing annotation of objects as @static has the additional advantage of being able to avoid object inheritance from the Any to redundant methods,.


emmm that’s a good idea.