Open tersec opened 1 year ago
Workaround: explicitly mark the iterator "closure"
proc y(n: ref int) = discard
proc w(n: ref int) =
iterator a(): int {.closure.} = y(n)
let x = a
w(nil)
According to https://nim-lang.github.io/Nim/manual.html#iterators-and-the-for-statement-firstminusclass-iterators
Iterators that are neither marked {.closure.} nor {.inline.} explicitly default to being inline, but this may change in future versions of the implementation.
It causes problems without marking.
It causes problems without marking.
"Problems" should not be "ICEs".
!nim c
proc y(n: ref int) = discard
proc w(n: ref int) =
iterator a(): int = y(n)
let x = a
w(nil)
@juancarlospaco (contributor)devel :-1: FAIL
Output
Error: Command failed: nim c --run -d:strip -d:ssl -d:nimDisableCertificateValidation --forceBuild:on --colors:off --threads:off --verbosity:0 --hints:off --warnings:off --lineTrace:off --nimcache:/home/runner/work/Nim/Nim --out:/home/runner/work/Nim/Nim/temp /home/runner/work/Nim/Nim/temp.nim
/home/runner/work/Nim/Nim/temp.nim(3, 12) Error: internal error: proc has no result symbol
No stack traceback available
To create a stacktrace, rerun compilation with './koch temp c <file>', see https://nim-lang.github.io/Nim/intern.html#debugging-the-compiler for details
2023-07-07T11:02:55Z
2023-07-07T11:03:26
2023-07-07T11:03:26
now
nim c --run -d:strip -d:ssl -d:nimDisableCertificateValidation --forceBuild:on --colors:off --threads:off --verbosity:0 --hints:off --warnings:off --lineTrace:off --nimcache:/home/runner/work/Nim/Nim --out:/home/runner/work/Nim/Nim/temp /home/runner/work/Nim/Nim/temp.nim
Error: Command failed: nim c --run -d:strip -d:ssl -d:nimDisableCertificateValidation --forceBuild:on --colors:off --threads:off --verbosity:0 --hints:off --warnings:off --lineTrace:off --nimcache:/home/runner/work/Nim/Nim --out:/home/runner/work/Nim/Nim/temp /home/runner/work/Nim/Nim/temp.nim
/home/runner/work/Nim/Nim/temp.nim(3, 12) Error: internal error: proc has no result symbol
No stack traceback available
To create a stacktrace, rerun compilation with './koch temp c <file>', see https://nim-lang.github.io/Nim/intern.html#debugging-the-compiler for details
2023-07-07T11:02:55Z
2023-07-07T11:03:27
2023-07-07T11:03:27
now
nim c --run -d:strip -d:ssl -d:nimDisableCertificateValidation --forceBuild:on --colors:off --threads:off --verbosity:0 --hints:off --warnings:off --lineTrace:off --nimcache:/home/runner/work/Nim/Nim --out:/home/runner/work/Nim/Nim/temp /home/runner/work/Nim/Nim/temp.nim
Error: Command failed: nim c --run -d:strip -d:ssl -d:nimDisableCertificateValidation --forceBuild:on --colors:off --threads:off --verbosity:0 --hints:off --warnings:off --lineTrace:off --nimcache:/home/runner/work/Nim/Nim --out:/home/runner/work/Nim/Nim/temp /home/runner/work/Nim/Nim/temp.nim
/home/runner/work/Nim/Nim/temp.nim(3, 12) Error: internal error: proc has no result symbol
No stack traceback available
To create a stacktrace, rerun compilation with './koch temp c <file>', see https://nim-lang.github.io/Nim/intern.html#debugging-the-compiler for details
2023-07-07T11:02:55Z
2023-07-07T11:03:30
2023-07-07T11:03:30
now
nim c --run -d:strip -d:ssl -d:nimDisableCertificateValidation --forceBuild:on --colors:off --threads:off --verbosity:0 --hints:off --warnings:off --lineTrace:off --nimcache:/home/runner/work/Nim/Nim --out:/home/runner/work/Nim/Nim/temp /home/runner/work/Nim/Nim/temp.nim
Error: Command failed: nim c --run -d:strip -d:ssl -d:nimDisableCertificateValidation --forceBuild:on --colors:off --threads:off --verbosity:0 --hints:off --warnings:off --lineTrace:off --nimcache:/home/runner/work/Nim/Nim --out:/home/runner/work/Nim/Nim/temp /home/runner/work/Nim/Nim/temp.nim
/home/runner/work/Nim/Nim/temp.nim(3, 12) Error: internal error: proc has no result symbol
No stack traceback available
To create a stacktrace, rerun compilation with './koch temp c <file>', see https://nim-lang.github.io/Nim/intern.html#debugging-the-compiler for details
2023-07-07T11:02:55Z
2023-07-07T11:03:32
2023-07-07T11:03:33
now
nim c --run -d:strip -d:ssl -d:nimDisableCertificateValidation --forceBuild:on --colors:off --threads:off --verbosity:0 --hints:off --warnings:off --lineTrace:off --nimcache:/home/runner/work/Nim/Nim --out:/home/runner/work/Nim/Nim/temp /home/runner/work/Nim/Nim/temp.nim
Error: Command failed: nim c --run -d:strip -d:ssl -d:nimDisableCertificateValidation --forceBuild:on --colors:off --threads:off --verbosity:0 --hints:off --warnings:off --lineTrace:off --nimcache:/home/runner/work/Nim/Nim --out:/home/runner/work/Nim/Nim/temp /home/runner/work/Nim/Nim/temp.nim
/home/runner/work/Nim/Nim/temp.nim(3, 12) Error: internal error: proc has no result symbol
No stack traceback available
To create a stacktrace, rerun compilation with ./koch temp c <file>
2023-07-07T11:02:55Z
2023-07-07T11:03:48
2023-07-07T11:03:48
now
nim c --run -d:strip -d:ssl -d:nimDisableCertificateValidation --forceBuild:on --colors:off --threads:off --verbosity:0 --hints:off --warnings:off --lineTrace:off --nimcache:/home/runner/work/Nim/Nim --out:/home/runner/work/Nim/Nim/temp /home/runner/work/Nim/Nim/temp.nim
Error: Command failed: nim c --run -d:strip -d:ssl -d:nimDisableCertificateValidation --forceBuild:on --colors:off --threads:off --verbosity:0 --hints:off --warnings:off --lineTrace:off --nimcache:/home/runner/work/Nim/Nim --out:/home/runner/work/Nim/Nim/temp /home/runner/work/Nim/Nim/temp.nim
/home/runner/work/Nim/Nim/temp.nim(3, 12) Error: internal error: proc has no result symbol
No stack traceback available
To create a stacktrace, rerun compilation with ./koch temp c <file>
2023-07-07T11:02:55Z
2023-07-07T11:04:01
2023-07-07T11:04:01
now
nim c --run -d:strip -d:ssl -d:nimDisableCertificateValidation --forceBuild:on --colors:off --threads:off --verbosity:0 --hints:off --warnings:off --lineTrace:off --nimcache:/home/runner/work/Nim/Nim --out:/home/runner/work/Nim/Nim/temp /home/runner/work/Nim/Nim/temp.nim
39 minutes
bisecting 6
commits at 0
commits per second. I'm having the same issue.
https://play.nim-lang.org/#pasty=wUGGuJiKqNEZ
type
Style* = ref object
type
WidthStyleProp* = distinct int
proc applyStyleProp*(self: WidthStyleProp, style: Style) =
echo 111
type
BaseStyleProp* = ref BaseStylePropObj
BaseStylePropObj* = object of RootObj
StyleProp*[T] = ref object of BaseStylePropObj
styleCtx: T
AsStyleProp* = concept
proc applyStyleProp(self: Self, style: Style)
static:
echo WidthStyleProp is AsStyleProp
# Error: internal error: proc has no result symbol
converter asStyleProp[T: AsStyleProp](styleCtx: T): BaseStyleProp =
result = BaseStyleProp(StyleProp[T](
styleCtx: styleCtx,
))
# to the common type
proc styles*(styleProps: varargs[BaseStyleProp]): seq[BaseStyleProp] =
result.add(styleProps)
discard styles(WidthStyleProp(1))
related: https://forum.nim-lang.org/t/11514
borrowing an iterator causes the same error message
type A = distinct array[4, uint8]
let a: A = cast[A]([uint8 0, 0, 1, 1])
iterator items(a: A): uint8 {.borrow.}
for b in a:
echo b
Description
Nim Version
Current Output
Possible Solution
No response
Additional Information
No response