fixes #1774
This commit is contained in:
parent
a93585e47f
commit
2ee2401336
5 changed files with 10 additions and 7 deletions
|
|
@ -1,7 +1,5 @@
|
|||
# Special configuration file for the Nim project
|
||||
|
||||
# gc:markAndSweep
|
||||
|
||||
hint[XDeclaredButNotUsed]:off
|
||||
path:"llvm"
|
||||
path:"$projectPath/.."
|
||||
|
|
|
|||
|
|
@ -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])
|
||||
|
|
|
|||
|
|
@ -654,6 +654,7 @@ proc checkForMetaFields(n: PNode) =
|
|||
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)
|
||||
|
|
|
|||
|
|
@ -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):
|
||||
|
|
|
|||
7
tests/typerel/typedescs.nim
Normal file
7
tests/typerel/typedescs.nim
Normal 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.)
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue