Merge branch 'devel' into bugfix-2858-testament-sources-system-wide

This commit is contained in:
Oscar Campbell 2015-06-07 13:17:06 +02:00
commit f0b6c03b26
46 changed files with 344 additions and 1226 deletions

View file

@ -1,6 +1,6 @@
discard """
line: 7
errormsg: "undeclared identifier: 'items'"
errormsg: "attempting to call undeclared routine: 'items'"
"""
type a = enum b,c,d

View file

@ -1,10 +1,7 @@
discard """
disabled: "true"
output: '''[OK] >:)'''
"""
# Unittest uses lambdalifting at compile-time which we disable for the JS
# codegen! So this cannot and will not work for quite some time.
import unittest
suite "Bacon":

View file

@ -1,7 +1,7 @@
discard """
file: "tissue710.nim"
line: 8
errorMsg: "undeclared identifier: '||'"
errorMsg: "attempting to call undeclared routine: '||'"
"""
var sum = 0
for x in 3..1000:

View file

@ -1,7 +1,7 @@
discard """
file: "tnoop.nim"
line: 11
errormsg: "undeclared identifier: 'a'"
errormsg: "attempting to call undeclared routine: 'a'"
"""

View file

@ -1,16 +1,16 @@
discard """
file: "topaque.nim"
line: 16
errormsg: "undeclared identifier: \'buffer\'"
errormsg: "undeclared field: \'buffer\'"
"""
# Test the new opaque types
import
import
mopaque
var
L: TLexer
L.filename = "ha"
L.line = 34
L.buffer[0] = '\0' #ERROR_MSG undeclared field: 'buffer'

View file

@ -0,0 +1,26 @@
# bug #2854
import locks, threadpool, osproc
const MAX_WORKERS = 10
type
Killer = object
lock: Lock
bailed {.guard: lock.}: bool
processes {.guard: lock.}: array[0..MAX_WORKERS-1, foreign ptr Process]
template hold(lock: Lock, body: stmt) =
lock.acquire
defer: lock.release
{.locks: [lock].}:
body
proc initKiller*(): Killer =
initLock(result.lock)
result.lock.hold:
result.bailed = false
for i, _ in result.processes:
result.processes[i] = nil
var killer = initKiller()

View file

@ -1,7 +1,7 @@
discard """
file: "twrongtupleaccess.nim"
line: 9
errormsg: "undeclared identifier: \'setBLAH\'"
errormsg: "attempting to call undeclared routine: \'setBLAH\'"
"""
# Bugfix

14
tests/vm/tconstobj.nim Normal file
View file

@ -0,0 +1,14 @@
discard """
output: '''(name: hello)'''
"""
# bug #2774
type Foo = object
name: string
const fooArray = [
Foo(name: "hello")
]
echo fooArray[0]