A user-defined converter does implicit conversions (only) on code following the its declaration. After that the corresponding implicit conversions apply to all of the remaining lines of code.
Is there a pragma to disable those implicit conversions from the point on where this pragma is stated?
Use a template for scoping the converter
template converterScope(scope: untyped): untyped =
block:
converter foo(x: int): float =
float(x)
scope
converterScope:
myAutoConvertedStmt(123)
myStayAsIsStmt(123)
@mratsim I doubt this works with today's compiler.
@HJarausch: You can make the converter modulce specific, but in general converters are worse than a custom operator (or a short proc name).
Nothing "changed". It never worked.