re-enable rodfiles tests; fixes #91
This commit is contained in:
parent
c1ad05c4c5
commit
238202ccbc
7 changed files with 25 additions and 6 deletions
|
|
@ -53,7 +53,8 @@ proc genSingleVar(p: BProc, a: PNode) =
|
||||||
var targetProc = p
|
var targetProc = p
|
||||||
var immediateAsgn = a.sons[2].kind != nkEmpty
|
var immediateAsgn = a.sons[2].kind != nkEmpty
|
||||||
if sfGlobal in v.flags:
|
if sfGlobal in v.flags:
|
||||||
targetProc = p.module.preInitProc
|
if v.owner.kind != skModule:
|
||||||
|
targetProc = p.module.preInitProc
|
||||||
assignGlobalVar(targetProc, v)
|
assignGlobalVar(targetProc, v)
|
||||||
genObjectInit(targetProc, cpsInit, v.typ, v.loc, true)
|
genObjectInit(targetProc, cpsInit, v.typ, v.loc, true)
|
||||||
else:
|
else:
|
||||||
|
|
|
||||||
|
|
@ -181,7 +181,12 @@ proc semTypeIdent(c: PContext, n: PNode): PSym =
|
||||||
if result != nil:
|
if result != nil:
|
||||||
markUsed(n, result)
|
markUsed(n, result)
|
||||||
if result.kind == skParam and result.typ.kind == tyTypeDesc:
|
if result.kind == skParam and result.typ.kind == tyTypeDesc:
|
||||||
return result.typ.sons[0].sym
|
# This is a typedesc param. is it already bound?
|
||||||
|
# it's not bound when it's also used as return type for example
|
||||||
|
if result.typ.sonsLen > 0:
|
||||||
|
return result.typ.sons[0].sym
|
||||||
|
else:
|
||||||
|
return result.typ.sym
|
||||||
if result.kind != skType: GlobalError(n.info, errTypeExpected)
|
if result.kind != skType: GlobalError(n.info, errTypeExpected)
|
||||||
if result.typ.kind != tyGenericParam:
|
if result.typ.kind != tyGenericParam:
|
||||||
# XXX get rid of this hack!
|
# XXX get rid of this hack!
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
discard """
|
discard """
|
||||||
file: "ttypenoval.nim"
|
file: "ttypenoval.nim"
|
||||||
line: 38
|
line: 38
|
||||||
errormsg: "a type has no value"
|
errormsg: "type mismatch: got (typedesc{int}) but expected 'int'"
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# A min-heap.
|
# A min-heap.
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,4 @@
|
||||||
discard """
|
discard """
|
||||||
disabled: true
|
|
||||||
output: '''derived class
|
output: '''derived class
|
||||||
base class
|
base class
|
||||||
'''
|
'''
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,4 @@
|
||||||
discard """
|
discard """
|
||||||
disabled: true
|
|
||||||
output: '''derived class 2
|
output: '''derived class 2
|
||||||
base class
|
base class
|
||||||
'''
|
'''
|
||||||
|
|
|
||||||
14
tests/run/tenumitems.nim
Normal file
14
tests/run/tenumitems.nim
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
discard """
|
||||||
|
output: "A\nB\nC"
|
||||||
|
"""
|
||||||
|
|
||||||
|
type TAlphabet = enum
|
||||||
|
A, B, C
|
||||||
|
|
||||||
|
iterator items(E: typedesc): E =
|
||||||
|
for v in low(E)..high(E):
|
||||||
|
yield v
|
||||||
|
|
||||||
|
for c in TAlphabet:
|
||||||
|
echo($c)
|
||||||
|
|
||||||
|
|
@ -22,7 +22,8 @@ proc delNimCache() =
|
||||||
except EOS:
|
except EOS:
|
||||||
echo "[Warning] could not delete: ", dir
|
echo "[Warning] could not delete: ", dir
|
||||||
|
|
||||||
proc plusCache(options: string): string = return options & " --symbolFiles:on"
|
proc plusCache(options: string): string = return options &
|
||||||
|
" --symbolFiles:on --nimcache:./nimcache"
|
||||||
|
|
||||||
proc runRodFiles(r: var TResults, options: string) =
|
proc runRodFiles(r: var TResults, options: string) =
|
||||||
template test(filename: expr): stmt =
|
template test(filename: expr): stmt =
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue