* 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:
parent
f8519657c4
commit
70fb377e88
5 changed files with 10 additions and 15 deletions
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue