fix regression in align (#12680)
* fix regression in align * add test typesym without type
This commit is contained in:
parent
5278cf80eb
commit
03fa9a9041
4 changed files with 20 additions and 5 deletions
|
|
@ -550,7 +550,7 @@ proc genRecordFieldsAux(m: BModule, n: PNode,
|
|||
let sname = mangleRecFieldName(m, field)
|
||||
fillLoc(field.loc, locField, n, sname, OnUnknown)
|
||||
if field.alignment > 0:
|
||||
result.addf "alignas($1) ", [rope(field.alignment)]
|
||||
result.addf "NIM_ALIGN($1) ", [rope(field.alignment)]
|
||||
# for importcpp'ed objects, we only need to set field.loc, but don't
|
||||
# have to recurse via 'getTypeDescAux'. And not doing so prevents problems
|
||||
# with heavily templatized C++ code:
|
||||
|
|
|
|||
|
|
@ -1766,8 +1766,11 @@ proc semTypeNode(c: PContext, n: PNode, prev: PType): PType =
|
|||
onUse(n.info, n.sym)
|
||||
else:
|
||||
if s.kind != skError:
|
||||
localError(c.config, n.info, "type expected, but got symbol '$1' of kind '$2'" %
|
||||
[s.name.s, substr($s.kind, 2)])
|
||||
if s.typ == nil:
|
||||
localError(c.config, n.info, "type expected, but symbol '$1' has no type." % [s.name.s])
|
||||
else:
|
||||
localError(c.config, n.info, "type expected, but got symbol '$1' of kind '$2'" %
|
||||
[s.name.s, substr($s.kind, 2)])
|
||||
result = newOrPrevType(tyError, prev, c)
|
||||
of nkObjectTy: result = semObjectNode(c, n, prev, isInheritable=false)
|
||||
of nkTupleTy: result = semTuple(c, n, prev)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue