This commit is contained in:
Araq
2014-12-31 16:07:56 +01:00
parent a93585e47f
commit 2ee2401336
5 changed files with 10 additions and 7 deletions

View File

@@ -1,7 +1,5 @@
# Special configuration file for the Nim project
# gc:markAndSweep
hint[XDeclaredButNotUsed]:off
path:"llvm"
path:"$projectPath/.."

View File

@@ -985,7 +985,7 @@ proc builtinFieldAccess(c: PContext, n: PNode, flags: TExprFlags): PNode =
of tyTypeParamsHolders:
return readTypeParameter(c, ty, i, n.info)
of tyObject, tyTuple:
if ty.n.kind == nkRecList:
if ty.n != nil and ty.n.kind == nkRecList:
for field in ty.n:
if field.sym.name == i:
n.typ = newTypeWithSons(c, tyFieldAccessor, @[ty, field.sym.typ])

View File

@@ -653,7 +653,8 @@ proc checkForMetaFields(n: PNode) =
template checkMeta(t) =
if t != nil and t.isMetaType and tfGenericTypeParam notin t.flags:
localError(n.info, errTIsNotAConcreteType, t.typeToString)
if n.isNil: return
case n.kind
of nkRecList, nkRecCase:
for s in n: checkForMetaFields(s)

View File

@@ -74,9 +74,6 @@ proc suggestField(c: PContext, s: PSym, outputs: var int) =
suggestWriteln(symToStr(s, isLocal=true, sectionSuggest))
inc outputs
when not defined(nimhygiene):
{.pragma: inject.}
template wholeSymTab(cond, section: expr) {.immediate.} =
var isLocal = true
for scope in walkScopes(c.currentScope):

View File

@@ -0,0 +1,7 @@
# bug #1774
proc p(T: typedesc) = discard
p(type((5, 6))) # Compiles
(type((5, 6))).p # Doesn't compile (SIGSEGV: Illegal storage access.)
type T = type((5, 6)) # Doesn't compile (SIGSEGV: Illegal storage access.)