mirror of
https://github.com/nim-lang/Nim.git
synced 2026-02-12 06:18:51 +00:00
@@ -1310,13 +1310,15 @@ proc semProcTypeNode(c: PContext, n, genericParams: PNode,
|
||||
if hasDefault:
|
||||
def = a[^1]
|
||||
block determineType:
|
||||
var defTyp = typ
|
||||
if genericParams != nil and genericParams.len > 0:
|
||||
defTyp = nil
|
||||
def = semGenericStmt(c, def)
|
||||
if hasUnresolvedArgs(c, def):
|
||||
def.typ = makeTypeFromExpr(c, def.copyTree)
|
||||
break determineType
|
||||
|
||||
def = semExprWithType(c, def, {efDetermineType})
|
||||
def = semExprWithType(c, def, {efDetermineType}, defTyp)
|
||||
if def.referencesAnotherParam(getCurrOwner(c)):
|
||||
def.flags.incl nfDefaultRefsParam
|
||||
|
||||
|
||||
20
tests/errmsgs/t21257.nim
Normal file
20
tests/errmsgs/t21257.nim
Normal file
@@ -0,0 +1,20 @@
|
||||
discard """
|
||||
action: compile
|
||||
cmd: "nim check $file"
|
||||
"""
|
||||
|
||||
type AC_WINCTRL_Fields* = distinct uint8
|
||||
|
||||
type AC_STATUSA_WSTATE0* {.pure.} = enum
|
||||
ABOVE = 0x0,
|
||||
INSIDE = 0x1,
|
||||
BELOW = 0x2,
|
||||
|
||||
type AC_WINCTRL_WINTSEL0* {.pure.} = enum
|
||||
ABOVE = 0x0,
|
||||
INSIDE = 0x1,
|
||||
BELOW = 0x2,
|
||||
OUTSIDE = 0x3,
|
||||
|
||||
proc write*(WINTSEL0: AC_WINCTRL_WINTSEL0 = ABOVE) =
|
||||
discard
|
||||
Reference in New Issue
Block a user