mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-18 21:40:32 +00:00
(cherry picked from commit 4b377b07fc)
This commit is contained in:
@@ -1063,7 +1063,7 @@ proc genMagic(c: PCtx; n: PNode; dest: var TDest; m: TMagic) =
|
||||
of mLengthOpenArray, mLengthArray, mLengthSeq:
|
||||
genUnaryABI(c, n, dest, opcLenSeq)
|
||||
of mLengthStr:
|
||||
case n[1].typ.kind
|
||||
case n[1].typ.skipTypes(abstractVarRange).kind
|
||||
of tyString: genUnaryABI(c, n, dest, opcLenStr)
|
||||
of tyCstring: genUnaryABI(c, n, dest, opcLenCstring)
|
||||
else: doAssert false, $n[1].typ.kind
|
||||
|
||||
@@ -9,7 +9,7 @@ block:
|
||||
static:
|
||||
foo(int)
|
||||
|
||||
# #4412
|
||||
# bug #4412
|
||||
block:
|
||||
proc default[T](t: typedesc[T]): T {.inline.} = discard
|
||||
|
||||
@@ -595,3 +595,9 @@ proc main() = # bug #12994
|
||||
|
||||
static: main()
|
||||
main()
|
||||
|
||||
# bug #19201
|
||||
proc foo(s: sink string) = doAssert s.len == 3
|
||||
|
||||
static:
|
||||
foo("abc")
|
||||
|
||||
Reference in New Issue
Block a user