mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-28 17:04:41 +00:00
@@ -467,8 +467,11 @@ proc semAfterMacroCall(c: PContext, call, macroResult: PNode,
|
||||
retType = generateTypeInstance(c, paramTypes,
|
||||
macroResult.info, retType)
|
||||
|
||||
result = semExpr(c, result, flags, expectedType)
|
||||
result = fitNode(c, retType, result, result.info)
|
||||
if retType.kind == tyVoid:
|
||||
result = semStmt(c, result, flags)
|
||||
else:
|
||||
result = semExpr(c, result, flags, expectedType)
|
||||
result = fitNode(c, retType, result, result.info)
|
||||
#globalError(s.info, errInvalidParamKindX, typeToString(s.typ[0]))
|
||||
dec(c.config.evalTemplateCounter)
|
||||
discard c.friendModules.pop()
|
||||
|
||||
@@ -296,3 +296,9 @@ block: # bug #12595
|
||||
discard {i: ""}
|
||||
|
||||
test()
|
||||
|
||||
block: # bug #21920
|
||||
template t[T](): T =
|
||||
discard
|
||||
|
||||
t[void]() # Error: expression has no type: discard
|
||||
|
||||
Reference in New Issue
Block a user