-
-
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
fix #13790; ptr char (+friends) should not implicitly convert to cstring #20761
Conversation
might be a good idea to add a warning + a strict mode instead |
I agree I will hide it behind |
is the slim system scheduled to become enabled by default? |
I'm not sure whether it has been decided that It has been enabled for compiler, |
No. v2 is mostly about finally making mm:orc the default plus a couple of other things that we consider production ready enough for v2. These are features that exist at least in 1.6 already. There are new switches like slim system and "strictDefs" and "strictCaseObjects" which have seen their introduction with v2 and thus are feature previews. |
in that case, I believe this fix should go under a separate flag + that the warning should be available on 1.6 too (so that people can find the implicit conversions in their code starting now) - with the warning in place, it becomes trivial to fix before this becomes enforced |
also, it would be nice to be able to set the "explicitness" of any compiler message (ie silent/hint/warning/error), so that we can do |
done => #20814 |
8da6e03
to
c081b46
Compare
|
Done; I think this PR should be backported too. |
Compiler and stdlib fixes should be backported at least. |
Thanks for your hard work on this PR! Hint: mm: orc; opt: speed; options: -d:release |
… to cstring (nim-lang#20761) * fix =nim-lang#13790 ptr char (+friends) should not implicitly convert to cstring * Apply suggestions from code review * first round; compiles on windows * nimPreviewSlimSystem * conversion is unsafe, cast needed * fixes more tests * fixes asyncnet * another try another error * last one * true * one more * why bugs didn't show at once * add `nimPreviewCstringConversion` switch * typo Co-authored-by: xflywind <43030857+xflywind@users.noreply.github.com>
… to cstring (nim-lang#20761) * fix =nim-lang#13790 ptr char (+friends) should not implicitly convert to cstring * Apply suggestions from code review * first round; compiles on windows * nimPreviewSlimSystem * conversion is unsafe, cast needed * fixes more tests * fixes asyncnet * another try another error * last one * true * one more * why bugs didn't show at once * add `nimPreviewCstringConversion` switch * typo Co-authored-by: xflywind <43030857+xflywind@users.noreply.github.com>
… to cstring (nim-lang#20761) * fix =nim-lang#13790 ptr char (+friends) should not implicitly convert to cstring * Apply suggestions from code review * first round; compiles on windows * nimPreviewSlimSystem * conversion is unsafe, cast needed * fixes more tests * fixes asyncnet * another try another error * last one * true * one more * why bugs didn't show at once * add `nimPreviewCstringConversion` switch * typo Co-authored-by: xflywind <43030857+xflywind@users.noreply.github.com>
fix #13790
ref timotheecour@b9ecff1
Explicit conversion is disabled in this PR too, since the conversion is unsafe.
It breaks at compile time.