Skip to content

Commit d15888d

Browse files
committed
progress
1 parent 0693e02 commit d15888d

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

compiler/semtypes.nim

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -945,9 +945,6 @@ proc semRecordNodeAux(c: PContext, n: PNode, check: var IntSet, pos: var int,
945945
n[^1] = firstRange(c.config, typ)
946946
hasDefaultField = true
947947
propagateToOwner(rectype, typ)
948-
if typ != nil and typ.kind == tyVoid:
949-
localError(c.config, n.info, "'void' is not allowed as a field type")
950-
typ = errorType(c)
951948
var fieldOwner = if c.inGenericContext > 0: c.getCurrOwner
952949
else: rectype.sym
953950
for i in 0..<n.len-2:

tests/errmsgs/t25508.nim

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
discard """
2+
cmd: "nim check --hints:off $file"
3+
action: "reject"
4+
nimout: '''
5+
t25508.nim(10, 23) Error: 'void' is not allowed as a field type
6+
t25508.nim(11, 18) Error: 'void' is not allowed as a field type
7+
'''
8+
"""
9+
10+
discard default(tuple[b: void])
11+
discard default((void,))

0 commit comments

Comments
 (0)