<@U4UGS5FC7> Some rough example: ``` class SomeDe...
# language-proposals
@raulraja Some rough example:
Copy code
class SomeDecoder<out SomeContext = Nothing>(
	val context: SomeContext
) {

	inline fun <reified T = Any?> decodeValue(): T {
		// …

fun main() {
	val decoder: SomeDecoder // aka SomeDecoder<Nothing>
	if (…)
		decoder = …
		decoder = …
	// …

fun decodeWith(decoder: SomeDecoder) { // aka : SomeDecoder<Nothing>
	val anyValue = decoder.decodeValue() // type inference succeeds because Any? is default
	val boolValue: Boolean = decoder.decodeValue() // type inference overrides default
	// …
My JSON library has several interfaces which take a
parameter but it’s just unnecessary work and clutter for the user having to write
(or however the base interface is called - just
in the example) on every type they use if they never use/care about the context and just want to use the simple parts of the API which is context-agnostic. I could split each interface up into two - one with and one without context, but’s quite a lot of work for such a simple task.