undo RFC #294, it breaks code for no good reason, the compiler can wa… (#18546)

* undo RFC #294, it breaks code for no good reason, the compiler can warn about the construct instead

* Update changelog.md

Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com>

* enable test case

Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com>
This commit is contained in:
Andreas Rumpf 2021-07-21 08:51:03 +02:00 • committed by GitHub
commit 70fb377e88
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 10 additions and 15 deletions

View file

@ -23,15 +23,14 @@
- `repr` now doesn't insert trailing newline; previous behavior was very inconsistent,
see #16034. Use `-d:nimLegacyReprWithNewline` for previous behavior.
- An enum now can't be converted to another enum directly, you must use `ord` (or `cast`, but
compiler won't help if you misuse it).
- A type conversion from one enum type to another now produces an `[EnumConv]` warning.
You should use `ord` (or `cast`, but the compiler won't help, if you misuse it) instead.
```
type A = enum a1, a2
type B = enum b1, b2
doAssert not compiles(a1.B)
doAssert compiles(a1.ord.B)
echo a1.B # produces a warning
echo a1.ord.B # produces no warning
```
for a transition period, use `-d:nimLegacyConvEnumEnum`.
- Type mismatch errors now show more context, use `-d:nimLegacyTypeMismatch` for previous
behavior.