enforce dot and call operators are used with an explicit .experimental pragma
This commit is contained in:
parent
e50f69bc87
commit
c71c951a64
1 changed files with 4 additions and 2 deletions
|
|
@ -1588,9 +1588,11 @@ proc semProcAux(c: PContext, n: PNode, kind: TSymKind,
|
|||
if sfOverriden in s.flags or s.name.s[0] == '=': semOverride(c, s, n)
|
||||
if s.name.s[0] in {'.', '('}:
|
||||
if s.name.s in [".", ".()", ".="] and {destructor, dotOperators} * c.features == {}:
|
||||
message(n.info, warnDeprecated, "overloaded '.' and '()' operators are now .experimental; " & s.name.s)
|
||||
localError(n.info, "the overloaded " & s.name.s &
|
||||
" operator has to be enabled with {.experimental: \"dotOperators\".}")
|
||||
elif s.name.s == "()" and callOperator notin c.features:
|
||||
message(n.info, warnDeprecated, "overloaded '()' operators are now .experimental; " & s.name.s)
|
||||
localError(n.info, "the overloaded " & s.name.s &
|
||||
" operator has to be enabled with {.experimental: \"callOperator\".}")
|
||||
|
||||
if n.sons[bodyPos].kind != nkEmpty:
|
||||
# for DLL generation it is annoying to check for sfImportc!
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue