Annotations that set a default function for overlo...
# language-proposals
h
Annotations that set a default function for overload ambiguity
Copy code
@AmbiguityDefault
operator fun Foo.plusAssign(other: Foo)
f
How do you invoke the non-default function?
d
Probably by just calling the function nominally instead of using the operator.
f
In that case it should use the one that is annotated by AmbiguityDefault though
h
only in cases where things are ambiguous
the ambiguity occurs in cases like
plus
and
set
vs
plusAssign
those are different operators, so you can always directly call them. one concern might be how best to set the
plus
and
set
behavior as the default operators over the
plusAssign