From 4a8257d99259ddf763bbcf3230545dec5380bbec Mon Sep 17 00:00:00 2001 From: Dominik Picheta Date: Tue, 14 Feb 2017 21:07:28 +0100 Subject: [PATCH 1/8] Update bountysource sponsors. --- web/bountysource.nim.cfg | 1 + web/inactive_sponsors.csv | 33 +++++++++++------- web/sponsors.csv | 72 +++++++++++++++++++++------------------ 3 files changed, 60 insertions(+), 46 deletions(-) create mode 100644 web/bountysource.nim.cfg diff --git a/web/bountysource.nim.cfg b/web/bountysource.nim.cfg new file mode 100644 index 0000000000..521e21de41 --- /dev/null +++ b/web/bountysource.nim.cfg @@ -0,0 +1 @@ +-d:ssl diff --git a/web/inactive_sponsors.csv b/web/inactive_sponsors.csv index d466f3f310..6352bc194e 100644 --- a/web/inactive_sponsors.csv +++ b/web/inactive_sponsors.csv @@ -1,26 +1,40 @@ logo, name, url, this_month, all_time, since, level ,bogen,,0,1010,"Jul 23, 2016",1 ,mikra,,0,400,"Apr 28, 2016",1 -,linkmonitor,,0,180,"Jan 28, 2016",1 +,shkolnick-kun,,0,375,"Jul 6, 2016",1 +,"Chris Heller",,0,350,"May 19, 2016",1 +,linkmonitor,,0,280,"Jan 28, 2016",1 ,avsej,,0,110,"Jun 10, 2016",1 ,WilRubin,,0,100,"Aug 11, 2015",1 ,"Benny Luypaert",,0,100,"Apr 10, 2016",1 -,"Chris Heller",,0,100,"May 19, 2016",1 ,PhilipWitte,,0,100,"Aug 5, 2016",1 +,skunkiferous,,0,100,"Oct 2, 2016",1 +,"Jonathan Arnett",,0,90,"May 20, 2016",1 ,Boxifier,,0,75,"Apr 12, 2016",1 ,iolloyd,,0,75,"Apr 29, 2016",1 +,btbytes,,0,70,"Apr 6, 2016",1 ,rb01,,0,50,"May 4, 2016",1 +,barcharcraz,,0,50,"Jun 2, 2016",1 +,zachaysan,,0,50,"Jun 7, 2016",1 +,kunev,,0,50,"Dec 26, 2016",1 +,iboB,,0,50,"Jan 28, 2017",1 ,TedSinger,,0,45,"Apr 9, 2016",1 +,johnnovak,,0,45,"Apr 30, 2016",1 +,"Matthew Baulch",,0,40,"Jun 7, 2016",1 +,"Matthew Newton",,0,35,"Apr 20, 2016",1 ,martinbbjerregaard,,0,35,"Jun 9, 2016",1 ,RationalG,,0,30,"Jun 17, 2016",1 ,benbve,,0,30,"Jul 12, 2016",1 -,barcharcraz,,0,25,"Jun 2, 2016",1 +,multikatt,,0,30,"Nov 2, 2016",1 ,"Landon Bass",,0,25,"Jun 7, 2016",1 ,jimrichards,,0,25,"Jun 8, 2016",1 ,jjzazuet,,0,25,"Jul 10, 2016",1 -,moigagoo,,0,20,"May 13, 2016",1 ,kteza1,,0,20,"Jun 10, 2016",1 ,tomkeus,,0,20,"Sep 4, 2016",1 +,csoriano89,,0,20,"Sep 7, 2016",1 +,juanjux,,0,20,"Oct 29, 2016",1 +,zagfai,,0,20,"Nov 3, 2016",1 +,hellcoderz,,0,20,"Jan 24, 2017",1 ,mirek,,0,15,"Apr 9, 2016",1 ,DateinAsia,,0,15,"Jul 30, 2016",1 ,rickc,,0,15,"Jul 31, 2016",1 @@ -38,13 +52,6 @@ logo, name, url, this_month, all_time, since, level ,Blumenversand,,0,10,"Jul 21, 2016",1 ,cinnabardk,,0,10,"Aug 6, 2016",1 ,reddec,,0,10,"Aug 31, 2016",1 +,cupen,,0,10,"Nov 21, 2016",1 +,yay,,0,10,"Jan 25, 2017",1 ,niv,,0,5,"Apr 6, 2016",1 -,goniz,,0,5,"Apr 7, 2016",1 -,genunix,,0,5,"Apr 12, 2016",1 -,CynepHy6,,0,5,"Apr 14, 2016",1 -,ivanflorentin,,0,5,"May 3, 2016",1 -,stevenyhw,,0,5,"May 20, 2016",1 -,"Sanjay Singh",,0,5,"Jun 6, 2016",1 -,yuttie,,0,5,"Jun 7, 2016",1 -,hron,,0,5,"Jun 11, 2016",1 -,laszlowaty,,0,5,"Jun 17, 2016",1 diff --git a/web/sponsors.csv b/web/sponsors.csv index 0701575d59..7136808c6a 100644 --- a/web/sponsors.csv +++ b/web/sponsors.csv @@ -1,34 +1,40 @@ logo, name, url, this_month, all_time, since, level -assets/bountysource/secondspectrum.png,Second Spectrum,http://www.secondspectrum.com/,250,1250,"May 5, 2016",250 -assets/bountysource/xored.svg,"Xored Software, Inc.",http://xored.com/,250,1000,"Jun 20, 2016",250 -,shkolnick-kun,https://github.com/shkolnick-kun,75,225,"Jul 6, 2016",75 -,flyx,http://flyx.org,35,210,"Apr 7, 2016",75 -,"Yuriy Glukhov",,25,150,"Apr 6, 2016",25 -,endragor,https://github.com/endragor,25,150,"Apr 7, 2016",25 -,FedericoCeratto,http://firelet.net,25,150,"Apr 7, 2016",25 -,"Adrian Veith",,25,150,"Apr 20, 2016",25 -,skunkiferous,https://github.com/skunkiferous,100,100,"Oct 2, 2016",150 -,euantorano,http://euantorano.co.uk,25,100,"Jun 7, 2016",25 -,xxlabaza,https://github.com/xxlabaza,25,95,"Jun 17, 2016",25 -,btbytes,https://www.btbytes.com/,10,60,"Apr 6, 2016",10 -,niebaopeng,https://github.com/niebaopeng,10,50,"Apr 15, 2016",10 -,"Jonathan Arnett",,10,50,"May 20, 2016",10 -,swalf,https://github.com/swalf,5,45,"May 9, 2016",5 -,zolern,https://github.com/zolern,10,40,"Apr 15, 2016",10 -,"pyloor ",https://schwarz-weiss.cc/,10,40,"May 16, 2016",10 -,zachaysan,http://venn.lc,10,40,"Jun 7, 2016",10 -,"Matthew Baulch",,10,40,"Jun 7, 2016",10 -,"Oskari Timperi",,10,40,"Jun 8, 2016",10 -,"Handojo Goenadi",,5,35,"Apr 19, 2016",5 -,"Matthew Newton",,5,30,"Apr 20, 2016",5 -,johnnovak,http://www.johnnovak.net/,5,30,"Apr 29, 2016",5 -,RyanMarcus,http://rmarcus.info,5,15,"Jul 19, 2016",5 -,lenzenmi,https://github.com/lenzenmi,5,15,"Jul 28, 2016",5 -,cpunion,https://github.com/cpunion,10,10,"Sep 9, 2016",10 -,pandada8,https://github.com/pandada8,5,10,"Aug 12, 2016",5 -,abeaumont,http://alfredobeaumont.org/blog,5,10,"Aug 12, 2016",5 -,"Svend Knudsen",,1,6,"Apr 11, 2016",1 -,"Michael D. Sklaroff",,1,6,"Apr 27, 2016",1 -,csoriano89,https://github.com/csoriano89,5,5,"Sep 7, 2016",5 -,nicck,,1,2,"Aug 9, 2016",1 -,campbellr,,1,1,"Sep 4, 2016",1 +assets/bountysource/secondspectrum.png,Second Spectrum,http://www.secondspectrum.com/,250,2250,"May 5, 2016",250 +assets/bountysource/xored.svg,"Xored Software, Inc.",http://xored.com/,250,1000,250,2000,"Jun 20, 2016",250 +,Varriount,https://github.com/Varriount,250,750,"Nov 18, 2016",250 +,flyx,http://flyx.org,35,350,"Apr 7, 2016",75 +,"Yuriy Glukhov",,25,250,"Apr 6, 2016",25 +,endragor,https://github.com/endragor,25,250,"Apr 7, 2016",25 +,FedericoCeratto,http://firelet.net,25,250,"Apr 7, 2016",25 +,"Adrian Veith",,25,250,"Apr 20, 2016",25 +,euantorano,http://euantorano.co.uk,25,200,"Jun 7, 2016",25 +,xxlabaza,https://github.com/xxlabaza,25,170,"Jun 17, 2016",25 +,devted,https://github.com/devted,25,100,"Oct 19, 2016",25 +,"pyloor ",https://schwarz-weiss.cc/,10,95,"May 16, 2016",10 +,niebaopeng,https://github.com/niebaopeng,10,90,"Apr 15, 2016",10 +,zolern,https://github.com/zolern,10,80,"Apr 15, 2016",10 +,"Oskari Timperi",,10,80,"Jun 8, 2016",10 +,jcosborn,https://github.com/jcosborn,25,75,"Nov 21, 2016",25 +,swalf,https://github.com/swalf,5,65,"May 9, 2016",5 +,"Handojo Goenadi",,5,55,"Apr 19, 2016",5 +,cpunion,https://github.com/cpunion,10,50,"Sep 9, 2016",10 +,D-L,https://github.com/D-L,5,50,"Apr 7, 2016",5 +,moigagoo,http://sloth-ci.com,10,40,"May 13, 2016",10 +,enthus1ast,http://code0.xyz/,10,40,"Oct 28, 2016",10 +,RyanMarcus,http://rmarcus.info,5,35,"Jul 19, 2016",5 +,lenzenmi,https://github.com/lenzenmi,5,35,"Jul 28, 2016",5 +,"Christian Bagley",,10,30,"Oct 11, 2016",10 +,pandada8,https://github.com/pandada8,5,30,"Aug 12, 2016",5 +,abeaumont,http://alfredobeaumont.org/blog,5,30,"Aug 12, 2016",5 +,opendragon,http://www.opendragon.com,25,25,"Jan 18, 2017",25 +,"Eric Raible",,10,20,"Dec 23, 2016",10 +,zefciu,http://pythonista.net,10,20,"Dec 29, 2016",10 +,"Andrey ",https://github.com/Andrey,5,20,"Oct 10, 2016",5 +,syrol,https://github.com/syrol,5,10,"Dec 12, 2016",5 +,"Svend Knudsen",,1,10,"Apr 11, 2016",1 +,"Michael D. Sklaroff",,1,10,"Apr 27, 2016",1 +,nicck,,1,6,"Aug 9, 2016",1 +,cnygaard,,5,5,"Jan 17, 2017",5 +,Aldrog,,5,5,"Feb 11, 2017",5 +,mpachecofaulk55,,5,5,"Feb 11, 2017",5 +,campbellr,,1,5,"Sep 4, 2016",1 From 4c683e90ece19e0f9b2833daf4d4f783ab186718 Mon Sep 17 00:00:00 2001 From: Dominik Picheta Date: Tue, 14 Feb 2017 21:09:49 +0100 Subject: [PATCH 2/8] Fix rst parse problem in version 0.16.2 news. --- web/news/e031_version_0_16_2.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web/news/e031_version_0_16_2.rst b/web/news/e031_version_0_16_2.rst index 2d725028e4..171e4cef12 100644 --- a/web/news/e031_version_0_16_2.rst +++ b/web/news/e031_version_0_16_2.rst @@ -21,8 +21,8 @@ Changes affecting backwards compatibility - A hash procedure has been added for ``cstring`` type in ``hashes`` module. Previously, hash of a ``cstring`` would be calculated as a hash of the pointer. Now the hash is calculated from the contents of the string, assuming - ``cstring`` is a null-terminated string. Equal ``string``s and ``cstring``s - produce equal hash value. + ``cstring`` is a null-terminated string. Equal ``string`` and ``cstring`` + values produce an equal hash value. Library Additions ----------------- From 55782205a4bcbe8584fbb96425ae530a302be15f Mon Sep 17 00:00:00 2001 From: Eugene Kabanov Date: Wed, 15 Feb 2017 14:18:45 +0200 Subject: [PATCH 3/8] Fix appveyor.yml shows green, when failed. (#5396) --- appveyor.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 87640b1923..ea98b8507e 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -7,10 +7,7 @@ cache: # - i686-4.9.2-release-win32-dwarf-rt_v4-rev4.7z matrix: - fast_finish: true # set this flag to immediately finish build once one of the jobs fails. - allow_failures: - - platform: x64 -# - platform: x86 + fast_finish: true environment: matrix: From 1811e51ff5dc0213a5abfd0f2bb32729f40c0344 Mon Sep 17 00:00:00 2001 From: araq Date: Wed, 15 Feb 2017 22:09:16 +0100 Subject: [PATCH 4/8] fixes #5392 --- lib/system/sysio.nim | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/system/sysio.nim b/lib/system/sysio.nim index fa1bdbb4e2..7444661e37 100644 --- a/lib/system/sysio.nim +++ b/lib/system/sysio.nim @@ -215,7 +215,10 @@ proc rawFileSize(file: File): int = discard c_fseek(file, clong(oldPos), 0) proc endOfFile(f: File): bool = - result = c_feof(f) != 0 + var c = c_fgetc(f) + discard c_ungetc(c, f) + return c < 0'i32 + #result = c_feof(f) != 0 proc readAllFile(file: File, len: int): string = # We acquire the filesize beforehand and hope it doesn't change. From 5b5bd3811b5f6e7841128527cb098b23b373e7a6 Mon Sep 17 00:00:00 2001 From: araq Date: Wed, 15 Feb 2017 22:10:31 +0100 Subject: [PATCH 5/8] koch: don't build downloader tool, it is not ready --- koch.nim | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/koch.nim b/koch.nim index 825b360a0a..109dcc3f1c 100644 --- a/koch.nim +++ b/koch.nim @@ -223,8 +223,9 @@ proc bundleWinTools() = copyExe("tools/finish".exe, "finish".exe) removeFile("tools/finish".exe) nimexec("c -o:bin/vccexe.exe tools/vccenv/vccexe") - nimexec(r"c --cc:vcc --app:gui -o:bin\downloader.exe -d:ssl --noNimblePath " & - r"--path:..\ui tools\downloader.nim") + when false: + nimexec(r"c --cc:vcc --app:gui -o:bin\downloader.exe -d:ssl --noNimblePath " & + r"--path:..\ui tools\downloader.nim") proc zip(args: string) = bundleNimbleSrc() From 8de6c39f87be3afa0b997a80b9124e42e4741d73 Mon Sep 17 00:00:00 2001 From: Araq Date: Wed, 15 Feb 2017 15:35:15 +0100 Subject: [PATCH 6/8] compiler debug proc: also output node flags --- compiler/astalgo.nim | 1 + 1 file changed, 1 insertion(+) diff --git a/compiler/astalgo.nim b/compiler/astalgo.nim index affbdffd96..226d5ee42c 100644 --- a/compiler/astalgo.nim +++ b/compiler/astalgo.nim @@ -388,6 +388,7 @@ proc debugTree(n: PNode, indent: int, maxRecDepth: int; [istr, makeYamlString($n.kind)] addf(result, ",$N$1\"info\": $2", [istr, lineInfoToStr(n.info)]) if maxRecDepth != 0: + addf(result, ",$N$1\"flags\": $2", [istr, rope($n.flags)]) case n.kind of nkCharLit..nkUInt64Lit: addf(result, ",$N$1\"intVal\": $2", [istr, rope(n.intVal)]) From 71026cec6e28d89677be0b5b3db4f8f79ee4bb3e Mon Sep 17 00:00:00 2001 From: Araq Date: Thu, 16 Feb 2017 00:43:14 +0100 Subject: [PATCH 7/8] fixes #5383 --- compiler/ast.nim | 3 +-- compiler/sem.nim | 15 +++++++++++++++ compiler/semdata.nim | 10 ++++++++++ compiler/semexprs.nim | 3 ++- compiler/seminst.nim | 7 ++++--- compiler/semstmts.nim | 1 + compiler/semtempl.nim | 2 +- compiler/semtypes.nim | 9 +++++---- compiler/transf.nim | 5 ++++- tests/template/tgensymregression.nim | 13 +++++++++++++ tests/template/tparams_gensymed.nim | 9 ++++----- 11 files changed, 60 insertions(+), 17 deletions(-) diff --git a/compiler/ast.nim b/compiler/ast.nim index 8fbec64cf1..4ea68dc996 100644 --- a/compiler/ast.nim +++ b/compiler/ast.nim @@ -1541,8 +1541,7 @@ proc skipGenericOwner*(s: PSym): PSym = ## Generic instantiations are owned by their originating generic ## symbol. This proc skips such owners and goes straight to the owner ## of the generic itself (the module or the enclosing proc). - result = if s.kind in skProcKinds and {sfGenSym, sfFromGeneric} * s.flags == - {sfFromGeneric}: + result = if s.kind in skProcKinds and sfFromGeneric in s.flags: s.owner.owner else: s.owner diff --git a/compiler/sem.nim b/compiler/sem.nim index dbf2376357..961d9fa75e 100644 --- a/compiler/sem.nim +++ b/compiler/sem.nim @@ -168,6 +168,16 @@ proc commonType*(x, y: PType): PType = proc newSymS(kind: TSymKind, n: PNode, c: PContext): PSym = result = newSym(kind, considerQuotedIdent(n), getCurrOwner(), n.info) +proc getGenSym(c: PContext; s: PSym): PSym = + var it = c.p + while it != nil: + result = get(it, s) + if result != nil: + #echo "got from table ", result.name.s, " ", result.info + return result + it = it.next + result = s + proc newSymG*(kind: TSymKind, n: PNode, c: PContext): PSym = proc `$`(kind: TSymKind): string = substr(system.`$`(kind), 2).toLowerAscii @@ -178,6 +188,11 @@ proc newSymG*(kind: TSymKind, n: PNode, c: PContext): PSym = if result.kind != kind: localError(n.info, "cannot use symbol of kind '" & $result.kind & "' as a '" & $kind & "'") + if sfGenSym in result.flags and result.kind notin {skTemplate, skMacro, skParam}: + # declarative context, so produce a fresh gensym: + result = copySym(result) + result.ast = n.sym.ast + put(c.p, n.sym, result) # when there is a nested proc inside a template, semtmpl # will assign a wrong owner during the first pass over the # template; we must fix it here: see #909 diff --git a/compiler/semdata.nim b/compiler/semdata.nim index 20fd1d9be5..845efd25a0 100644 --- a/compiler/semdata.nim +++ b/compiler/semdata.nim @@ -39,6 +39,7 @@ type next*: PProcCon # used for stacking procedure contexts wasForwarded*: bool # whether the current proc has a separate header bracketExpr*: PNode # current bracket expression (for ^ support) + mapping*: TIdTable TInstantiationPair* = object genericSym*: PSym @@ -147,6 +148,15 @@ proc lastOptionEntry*(c: PContext): POptionEntry = proc popProcCon*(c: PContext) {.inline.} = c.p = c.p.next +proc put*(p: PProcCon; key, val: PSym) = + if p.mapping.data == nil: initIdTable(p.mapping) + #echo "put into table ", key.info + p.mapping.idTablePut(key, val) + +proc get*(p: PProcCon; key: PSym): PSym = + if p.mapping.data == nil: return nil + result = PSym(p.mapping.idTableGet(key)) + proc newOptionEntry*(): POptionEntry = new(result) result.options = gOptions diff --git a/compiler/semexprs.nim b/compiler/semexprs.nim index 9972585c7b..542d7b4e39 100644 --- a/compiler/semexprs.nim +++ b/compiler/semexprs.nim @@ -922,7 +922,8 @@ proc readTypeParameter(c: PContext, typ: PType, return newSymNode(copySym(tParam.sym).linkTo(foundTyp), info) #echo "came here: returned nil" -proc semSym(c: PContext, n: PNode, s: PSym, flags: TExprFlags): PNode = +proc semSym(c: PContext, n: PNode, sym: PSym, flags: TExprFlags): PNode = + let s = getGenSym(c, sym) case s.kind of skConst: markUsed(n.info, s) diff --git a/compiler/seminst.nim b/compiler/seminst.nim index 9c57be0231..1a96b4bc60 100644 --- a/compiler/seminst.nim +++ b/compiler/seminst.nim @@ -106,15 +106,16 @@ proc freshGenSyms(n: PNode, owner, orig: PSym, symMap: var TIdTable) = #if n.kind == nkSym and sfGenSym in n.sym.flags: # if n.sym.owner != orig: # echo "symbol ", n.sym.name.s, " orig ", orig, " owner ", n.sym.owner - if n.kind == nkSym and {sfGenSym, sfFromGeneric} * n.sym.flags == {sfGenSym}: # and + if n.kind == nkSym and sfGenSym in n.sym.flags: # and # (n.sym.owner == orig or n.sym.owner.kind in {skPackage}): let s = n.sym var x = PSym(idTableGet(symMap, s)) - if x == nil: + if x != nil: + n.sym = x + when false: x = copySym(s, false) x.owner = owner idTablePut(symMap, s, x) - n.sym = x else: for i in 0 .. Date: Thu, 16 Feb 2017 11:15:27 +0100 Subject: [PATCH 8/8] fixes #5402 --- compiler/ccgexprs.nim | 9 ++++--- tests/ccgbugs/tgeneric_smallobj_asgn_opt.nim | 26 ++++++++++++++++++++ 2 files changed, 31 insertions(+), 4 deletions(-) create mode 100644 tests/ccgbugs/tgeneric_smallobj_asgn_opt.nim diff --git a/compiler/ccgexprs.nim b/compiler/ccgexprs.nim index 95a7beada5..6f7e83c186 100644 --- a/compiler/ccgexprs.nim +++ b/compiler/ccgexprs.nim @@ -220,7 +220,7 @@ proc genOptAsgnTuple(p: BProc, dest, src: TLoc, flags: TAssignmentFlags) = optAsgnLoc(src, t, field), newflags) proc genOptAsgnObject(p: BProc, dest, src: TLoc, flags: TAssignmentFlags, - t: PNode) = + t: PNode, typ: PType) = if t == nil: return let newflags = if src.s == OnStatic: @@ -232,10 +232,11 @@ proc genOptAsgnObject(p: BProc, dest, src: TLoc, flags: TAssignmentFlags, case t.kind of nkSym: let field = t.sym + if field.loc.r == nil: fillObjectFields(p.module, typ) genAssignment(p, optAsgnLoc(dest, field.typ, field.loc.r), optAsgnLoc(src, field.typ, field.loc.r), newflags) of nkRecList: - for child in items(t): genOptAsgnObject(p, dest, src, newflags, child) + for child in items(t): genOptAsgnObject(p, dest, src, newflags, child, typ) else: discard proc genGenericAsgn(p: BProc, dest, src: TLoc, flags: TAssignmentFlags) = @@ -315,9 +316,9 @@ proc genAssignment(p: BProc, dest, src: TLoc, flags: TAssignmentFlags) = genGenericAsgn(p, dest, src, flags) elif needsComplexAssignment(ty): if ty.sons[0].isNil and asgnComplexity(ty.n) <= 4: - discard getTypeDesc(p.module, dest.t) + discard getTypeDesc(p.module, ty) internalAssert ty.n != nil - genOptAsgnObject(p, dest, src, flags, ty.n) + genOptAsgnObject(p, dest, src, flags, ty.n, ty) else: genGenericAsgn(p, dest, src, flags) else: diff --git a/tests/ccgbugs/tgeneric_smallobj_asgn_opt.nim b/tests/ccgbugs/tgeneric_smallobj_asgn_opt.nim new file mode 100644 index 0000000000..919dc3fc19 --- /dev/null +++ b/tests/ccgbugs/tgeneric_smallobj_asgn_opt.nim @@ -0,0 +1,26 @@ +discard """ + output: '''false''' +""" + +# bug #5402 + +import lists + +type + Container[T] = ref object + obj: T + + ListOfContainers[T] = ref object + list: DoublyLinkedList[Container[T]] + +proc contains[T](this: ListOfContainers[T], obj: T): bool = + for item in this.list.items(): + if item.obj == obj: return true + return false + +proc newListOfContainers[T](): ListOfContainers[T] = + new(result) + result.list = initDoublyLinkedList[Container[T]]() + +let q = newListOfContainers[int64]() +echo q.contains(123)