multi-methods need to be explicitly enabled (#10856)
* multi-methods need to be explicitly enabled * update changelog, manual and tutorial
This commit is contained in:
parent
9e28d52c2f
commit
afeca3d9fe
8 changed files with 36 additions and 7 deletions
|
|
@ -290,6 +290,9 @@ proc generateMethodDispatchers*(g: ModuleGraph): PNode =
|
|||
var relevantCols = initIntSet()
|
||||
for col in countup(1, sonsLen(g.methods[bucket].methods[0].typ) - 1):
|
||||
if relevantCol(g.methods[bucket].methods, col): incl(relevantCols, col)
|
||||
if optMultiMethods notin g.config.globalOptions:
|
||||
# if multi-methods are not enabled, we are interested only in the first field
|
||||
break
|
||||
sortBucket(g.methods[bucket].methods, relevantCols)
|
||||
addSon(result,
|
||||
newSymNode(genDispatcher(g, g.methods[bucket].methods, relevantCols)))
|
||||
|
|
|
|||
|
|
@ -758,6 +758,8 @@ proc processSwitch*(switch, arg: string, pass: TCmdLinePass, info: TLineInfo;
|
|||
defineSymbol(conf.symbols, "cppCompileToNamespace", conf.cppCustomNamespace)
|
||||
of "docinternal":
|
||||
processOnOffSwitchG(conf, {optDocInternal}, arg, pass, info)
|
||||
of "multimethods":
|
||||
processOnOffSwitchG(conf, {optMultiMethods}, arg, pass, info)
|
||||
else:
|
||||
if strutils.find(switch, '.') >= 0: options.setConfigVar(conf, switch, arg)
|
||||
else: invalidCmdLineOption(conf, pass, switch, info)
|
||||
|
|
|
|||
|
|
@ -83,6 +83,7 @@ type # please make sure we have under 32 options
|
|||
optHotCodeReloading
|
||||
optDynlibOverrideAll
|
||||
optNimV2
|
||||
optMultiMethods
|
||||
|
||||
TGlobalOptions* = set[TGlobalOption]
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue