A transitional annotation for changing a DSL from ...
# language-evolution
y
A transitional annotation for changing a DSL from passing receivers to passing contexts may be really nice to have. @Alejandro Serrano.Mena ran into this issue where using
context
consistently, even for DSL builders that pass a single context, is superior for a nice experience. Maybe this annotation makes a receiver only appear as a context for users that have contexts enabled, thus preparing for when everyone has them enabled to then "flip the switch". It can then also warn users who refer to
this
explicitly for an annotated receiver and recommend changing to
contextOf
instead. Perhaps a similar thing can also be applied to methods that take in an extension receiver now but want to take a context in the future, but that feels less useful for DSLs you can simple
@Deprecate
the extension version and introduce the context version right away, but you can't do the same with block DSLs
plus1 1
d
I really like this idea.