-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
implement RFCs/294 ; disallow enum <=> enum conversion #16351
Conversation
Should changelog recommend |
e8e0b29
to
c2dadeb
Compare
done
no, cast is overkill in this use case, and won't help catch bugs eg: |
f6e15ab
to
4df83a7
Compare
PTAL |
b523047
to
0c6e719
Compare
@Araq PTAL (fixed bitrot) |
24cd2f3
to
7e567dd
Compare
7e567dd
to
0d583d2
Compare
ping @Araq I had to rebase again to fix bitrot |
Can we have a migration error message for this? This will be extremely confusing for anyone not tracking devel and not having their code in I'm a bit worried how we keep on introducing tiny breaking changes in the language spec between versions. |
that's what The changelog clearly mentions this change. In any case, I've just sent out #17928 for this case, but in other cases, it may not always be practical to do this (see that section in the changelog). Users who upgrade should read that section. |
I'm not sure anymore wether this change is a good idea, the user is already explicit when writing |
(let's followup in nim-lang/RFCs#294 (comment) instead to avoid duplicating the discussion) |
* fix nim-lang/RFCs#294 ; disallow enum <=> enum conversion * fix the runnableExamples that was the instigator of this RFC * legacy -d:nimLegacyConvEnumEnum * use -d:nimLegacyConvEnumEnum in important_package nimgame2 * add test for enum cast * improve changelog * add changelog: Changes affecting backward compatibility * cleanup changelog * fix changelog
ord
) RFCs#294-d:nimLegacyConvEnumEnum
CI failures caused by this:
only those 2:
/Users/runner/work/Nim/Nim/pkgstemp/nimgame2/nimgame2/texturegraphic.nim(241, 41) Error: type mismatch: got but expected 'RendererFlip = enum'
/Users/runner/work/Nim/Nim/pkgstemp/nimquery/nimquery.nim(915, 68) Error: type mismatch: got but expected 'Combinator = enum'
these packages can be fixed upstream, or testament can add logic to pass flags (eg
-d:nimLegacyConvEnumEnum
or everytime such kind of issue shows up) to tests that need custom flags; this can be done by overridingXDG_CONFIG_HOME
for those tests, pointing to a custom config.nims, so that these flags apply recursively through nim invocations viaexec
. (EDIT: see nim-lang/RFCs#336)future work