One of my biggest complaints about Go. At work, we have a test helper (built with reflection) that verifies that a particular value has no "zero" values. You can then write tests will fail automatically if a new field is added and a constructor (or similar) weren't updated.
-
-
-
But there's a lot of ceremony behind using it, so in practice, the fact that the compiler doesn't fail when a new field is added ends up pervasively influencing API design. There are upsides to it, but on balance, I'd rather do without automatic default values everywhere.
- 2 more replies
New conversation -
-
-
The only thing missing is leveraging rustc/rustfix for refactoring workflows. Think operations of "remove this field everywhere" driven by rustc suggestions applied by rustfix being representable and not just ad-hoc.
-
I wonder if this is something that could be addressed by
@rust_analyzer? I know it already has some ability to fill missing items... - 4 more replies
New conversation -
-
-
I would love to have this but without having to actually fix those cases before i can run the program; and to be able to make changes backwards compatible since sometimes structures are used outside of the codebase that defines them PLs seem to pick one or the other; I want both
-
Haskell can get a nice version of this behavior with -fdefer-type-errors :)
- 2 more replies
New conversation -
-
-
Having just written a streaming zero-copy pull parser built on a state machine implemented as a pile of enums: so much this
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
Why should any code have to be changed when adding a new field ?
-
Initialization, hash, comparison, serialization, etc.
End of conversation
New conversation -
-
-
Does there exist an equivalent to Java's Override annotation in rust? It's really useful when removing a function from an interface, the compiler tells you everywhere it needs to be removed.
-
Your code won’t compile if you remove a method from a trait definition and keep some of its implementations around, so there is no need for the Override attribute.
End of conversation
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.