Merge branch 'devel' into araq
This commit is contained in:
commit
bfaa329680
4 changed files with 22 additions and 5 deletions
|
|
@ -155,7 +155,7 @@ proc presentFailedCandidates(c: PContext, n: PNode, errors: CandidateErrors):
|
||||||
renderTree(n[err.unmatchedVarParam]) & "' is immutable\n")
|
renderTree(n[err.unmatchedVarParam]) & "' is immutable\n")
|
||||||
for diag in err.diagnostics:
|
for diag in err.diagnostics:
|
||||||
add(candidates, diag & "\n")
|
add(candidates, diag & "\n")
|
||||||
|
|
||||||
result = (prefer, candidates)
|
result = (prefer, candidates)
|
||||||
|
|
||||||
proc notFoundError*(c: PContext, n: PNode, errors: CandidateErrors) =
|
proc notFoundError*(c: PContext, n: PNode, errors: CandidateErrors) =
|
||||||
|
|
@ -250,13 +250,11 @@ proc resolveOverloads(c: PContext, n, orig: PNode,
|
||||||
if result.state in {csEmpty, csNoMatch}:
|
if result.state in {csEmpty, csNoMatch}:
|
||||||
tryOp "."
|
tryOp "."
|
||||||
|
|
||||||
elif nfDotSetter in n.flags:
|
elif nfDotSetter in n.flags and f.kind == nkIdent and n.len == 3:
|
||||||
internalAssert f.kind == nkIdent and n.sonsLen == 3
|
|
||||||
let calleeName = newStrNode(nkStrLit,
|
let calleeName = newStrNode(nkStrLit,
|
||||||
f.ident.s[0..f.ident.s.len-2]).withInfo(n.info)
|
f.ident.s[0..f.ident.s.len-2]).withInfo(n.info)
|
||||||
let callOp = newIdentNode(getIdent".=", n.info)
|
let callOp = newIdentNode(getIdent".=", n.info)
|
||||||
n.sons[0..1] = [callOp, n[1], calleeName]
|
n.sons[0..1] = [callOp, n[1], calleeName]
|
||||||
excl(n.flags, nfDotSetter)
|
|
||||||
orig.sons[0..1] = [callOp, orig[1], calleeName]
|
orig.sons[0..1] = [callOp, orig[1], calleeName]
|
||||||
pickBest(callOp)
|
pickBest(callOp)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,6 @@
|
||||||
#define _GENODE_CPP__THREAD_H_
|
#define _GENODE_CPP__THREAD_H_
|
||||||
|
|
||||||
#include <base/thread.h>
|
#include <base/thread.h>
|
||||||
#include <util/avl_tree.h>
|
|
||||||
#include <util/reconstructible.h>
|
#include <util/reconstructible.h>
|
||||||
|
|
||||||
namespace Nim { struct SysThread; }
|
namespace Nim { struct SysThread; }
|
||||||
|
|
|
||||||
|
|
@ -593,6 +593,8 @@ elif defined(genode):
|
||||||
proc createThread*[TArg](t: var Thread[TArg],
|
proc createThread*[TArg](t: var Thread[TArg],
|
||||||
tp: proc (arg: TArg) {.thread, nimcall.},
|
tp: proc (arg: TArg) {.thread, nimcall.},
|
||||||
param: TArg) =
|
param: TArg) =
|
||||||
|
t.core = cast[PGcThread](allocShared0(sizeof(GcThread)))
|
||||||
|
|
||||||
when TArg isnot void: t.data = param
|
when TArg isnot void: t.data = param
|
||||||
t.dataFn = tp
|
t.dataFn = tp
|
||||||
when hasSharedHeap: t.stackSize = ThreadStackSize
|
when hasSharedHeap: t.stackSize = ThreadStackSize
|
||||||
|
|
|
||||||
18
tests/metatype/tcompilesregression.nim
Normal file
18
tests/metatype/tcompilesregression.nim
Normal file
|
|
@ -0,0 +1,18 @@
|
||||||
|
discard """
|
||||||
|
output: '''ok'''
|
||||||
|
"""
|
||||||
|
|
||||||
|
# bug #5638
|
||||||
|
|
||||||
|
type X = object
|
||||||
|
a_impl: int
|
||||||
|
|
||||||
|
proc a(x: X): int =
|
||||||
|
x.a_impl
|
||||||
|
|
||||||
|
var x: X
|
||||||
|
assert(not compiles((block:
|
||||||
|
x.a = 1
|
||||||
|
)))
|
||||||
|
|
||||||
|
echo "ok"
|
||||||
Loading…
Add table
Add a link
Reference in a new issue