parent
23c117a950
commit
d584dd5b99
4 changed files with 10 additions and 2 deletions
|
|
@ -11,6 +11,9 @@
|
||||||
or define your own `Math.trunc` polyfill using the [`emit` pragma](https://nim-lang.org/docs/manual.html#implementation-specific-pragmas-emit-pragma). Nim uses
|
or define your own `Math.trunc` polyfill using the [`emit` pragma](https://nim-lang.org/docs/manual.html#implementation-specific-pragmas-emit-pragma). Nim uses
|
||||||
`Math.trunc` for the division and modulo operators for integers.
|
`Math.trunc` for the division and modulo operators for integers.
|
||||||
|
|
||||||
|
- Optional parameters in combination with `: body` syntax (RFC #405) are now opt-in via
|
||||||
|
`experimental:flexibleOptionalParams`.
|
||||||
|
|
||||||
## Standard library additions and changes
|
## Standard library additions and changes
|
||||||
|
|
||||||
- `macros.parseExpr` and `macros.parseStmt` now accept an optional
|
- `macros.parseExpr` and `macros.parseStmt` now accept an optional
|
||||||
|
|
|
||||||
|
|
@ -207,7 +207,8 @@ type
|
||||||
strictNotNil,
|
strictNotNil,
|
||||||
overloadableEnums,
|
overloadableEnums,
|
||||||
strictEffects,
|
strictEffects,
|
||||||
unicodeOperators
|
unicodeOperators,
|
||||||
|
flexibleOptionalParams
|
||||||
|
|
||||||
LegacyFeature* = enum
|
LegacyFeature* = enum
|
||||||
allowSemcheckedAstModification,
|
allowSemcheckedAstModification,
|
||||||
|
|
|
||||||
|
|
@ -2461,7 +2461,8 @@ proc matchesAux(c: PContext, n, nOrig: PNode, m: var TCandidate, marker: var Int
|
||||||
if m.callee.n[f].kind != nkSym:
|
if m.callee.n[f].kind != nkSym:
|
||||||
internalError(c.config, n[a].info, "matches")
|
internalError(c.config, n[a].info, "matches")
|
||||||
noMatch()
|
noMatch()
|
||||||
if a >= firstArgBlock: f = max(f, m.callee.n.len - (n.len - a))
|
if flexibleOptionalParams in c.features and a >= firstArgBlock:
|
||||||
|
f = max(f, m.callee.n.len - (n.len - a))
|
||||||
formal = m.callee.n[f].sym
|
formal = m.callee.n[f].sym
|
||||||
m.firstMismatch.kind = kTypeMismatch
|
m.firstMismatch.kind = kTypeMismatch
|
||||||
if containsOrIncl(marker, formal.position) and container.isNil:
|
if containsOrIncl(marker, formal.position) and container.isNil:
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,6 @@
|
||||||
|
|
||||||
|
{.experimental: "flexibleOptionalParams".}
|
||||||
|
|
||||||
# https://github.com/nim-lang/RFCs/issues/405
|
# https://github.com/nim-lang/RFCs/issues/405
|
||||||
|
|
||||||
template main =
|
template main =
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue