This code is not supposed to produce a warning, it does not on a few 1.6.x I checked, but it does on 2.x.x.
type
e = enum
a = 0
b = 2
var i: int
{.push warning[HoleEnumConv]:off.}
echo i.e
{.pop.}
# /usercode/in.nim(8, 7) Warning: conversion to enum with holes is unsafe: e(i) [HoleEnumConv]
https://play.nim-lang.org/#pasty=jtgwoVUF
The usecase a code that does value sanitization before the conversion. The warning need to be disabled only on the specific line of the conversion.
Maybe you already know, but a workaround is:
type
e = enum
a = 0
b = 2
var i: int
{.warning[HoleEnumConv]:off.}:
echo i.e
which seems to work on both versions.
I appreciate the workarounds and immediate solutions, but that does not fix the issue.
There is a regression. It is minor, there are many ways around it, but still an issue and it should be addressed. It could be fixed, or the feature be deprecated/removed, or acknowledged and deferred etc.
I did not. I am communicating here (or on irc, or mailinglist if available, or other git platforms) because I left github years ago and I am not going back.
If anyone wants to create a github bug and copy/paste this or reference it, please do and thank you.
Sorry for the unconvenience.