[TODO] fix issue #8303 map
overly restrictive
#8325
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
/cc @dom96 @Araq this workaround for #8303 doesn't work yet: I just hit the limitation of #7435 (type inference with lambdas doesn't work) again. Help would be appreciated:
in #8272 adding this innocent looking code:
results in travis/appveyor failure (see bug) because
sequtils.map
cannot handlecdecl
procs andquoteShell
becomes acdecl
in the--define:createNimRtl
test of travis/appveyor:but trying to make
map
less restrictive as in this PR results in exactly the type inference bug I had mentioned here (#7435), see where below in [1]How do I solve this (without the workaround of using an explicit for-loop in
quoteShellCommand
or similar, which is just hiding the problem under a rug, waiting to re-occur?is there at least a way to be generic on the pragma type, to allow both decl and cdecl?
The following DOES work but is really ugly, it's not DRY:
I also tried:
but gives: Error: A nested proc can have generic parameters only when it is used as an operand to another routine and the types of the generic paramers can be inferred from the expected signature.
(x) => x.changeFileExt("").toLowerAscii()
[1] with this PR, travis/appveyor (or running
./koch nimble
locally) complains about this:at dist/nimble/src/nimblepkg/packageparser.nim(103):