mirror of
https://github.com/nim-lang/Nim.git
synced 2026-08-26 00:21:42 +00:00
Merge branch 'devel' into pr_mui
This commit is contained in:
@@ -130,3 +130,14 @@ block: # issue #22646
|
||||
var x: Vec[3, float]
|
||||
let y = Color(x)
|
||||
doAssert Vec3[float](y) == x
|
||||
|
||||
block: # bug #25697
|
||||
type MyList = distinct seq[int]
|
||||
|
||||
iterator items(x: MyList): lent int {.borrow.}
|
||||
|
||||
let s = MyList(@[1, 2, 3])
|
||||
var count = 0
|
||||
for item in s:
|
||||
count += 1
|
||||
doAssert count == 3, "Expected 3 items, got " & $count
|
||||
|
||||
22
tests/objects/t25627.nim
Normal file
22
tests/objects/t25627.nim
Normal file
@@ -0,0 +1,22 @@
|
||||
# issue #25627
|
||||
|
||||
import std/tables
|
||||
|
||||
type
|
||||
FsoKind = enum
|
||||
fsoFile
|
||||
fsoDir
|
||||
fsoLink
|
||||
|
||||
FakeFso = ref object
|
||||
kind: FsoKind
|
||||
dirName: string
|
||||
files: OrderedTable[string, FakeFso]
|
||||
|
||||
DirStruct = object
|
||||
root = FakeFso(kind: fsoDir, dirName: "/")
|
||||
|
||||
let dir = DirStruct()
|
||||
doAssert dir.root.kind == fsoDir
|
||||
doAssert dir.root.dirName == "/"
|
||||
doAssert dir.root.files.len == 0
|
||||
Reference in New Issue
Block a user