I would like to start using named tuples in my codebase, but I am tired of it requiring a special experimental import at the top of every file, like an infection. It discourages me (in a way that feels intentional) from using the feature alltogether because of how cumbersome it is to constantly write imports. My codebase is a private project, so I would like to enable whichever experimental features I want easily.
is there a flag I can set in build.sbt that will enable it codebase wide once and forall?
NamedTuples are now in the preview in 3.6, so is there an option to enable only preview features?
In 3.6 these were still experimental, not a preview, so that’s still the only way.
In 3.7 (which would be released in first weeks of May, 3.7.0-RC3 is available) these are stable and enabled by default.
The preview features is a new concept introduced in 3.7, the first preview feature would be SIP-62 - Better Fors, all preview features would be enabled using single -preview flag. More on that would be available in the 3.7 release blogpost.