diff options
author | metagn <metagngn@gmail.com> | 2022-09-06 00:38:38 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-05 23:38:38 +0200 |
commit | 5ebd1248dfe517fd932c401f71d1e5aeb023b0e4 (patch) | |
tree | 0413fef17dd80f5b888caae12d4aa69832408827 /compiler | |
parent | 8dcf367e5223ae26b57c9bbfaec6e70ac14bb820 (diff) | |
download | Nim-5ebd1248dfe517fd932c401f71d1e5aeb023b0e4.tar.gz |
overloadable enums no longer experimental (#20298)
depends on #20126
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/lookups.nim | 2 | ||||
-rw-r--r-- | compiler/options.nim | 2 | ||||
-rw-r--r-- | compiler/semexprs.nim | 5 | ||||
-rw-r--r-- | compiler/semgnrc.nim | 6 | ||||
-rw-r--r-- | compiler/semtempl.nim | 10 | ||||
-rw-r--r-- | compiler/semtypes.nim | 5 |
6 files changed, 7 insertions, 23 deletions
diff --git a/compiler/lookups.nim b/compiler/lookups.nim index d61e15915..63e4920f7 100644 --- a/compiler/lookups.nim +++ b/compiler/lookups.nim @@ -182,8 +182,6 @@ iterator allSyms*(c: PContext): (PSym, int, bool) = proc someSymFromImportTable*(c: PContext; name: PIdent; ambiguous: var bool): PSym = var marked = initIntSet() var symSet = OverloadableSyms - if overloadableEnums notin c.features: - symSet.excl skEnumField result = nil block outer: for im in c.imports.mitems: diff --git a/compiler/options.nim b/compiler/options.nim index 9031e86c1..afbfdc7cf 100644 --- a/compiler/options.nim +++ b/compiler/options.nim @@ -213,7 +213,7 @@ type strictFuncs, views, strictNotNil, - overloadableEnums, + overloadableEnums, # not experimental anymore strictEffects, unicodeOperators, flexibleOptionalParams diff --git a/compiler/semexprs.nim b/compiler/semexprs.nim index 42f720c48..29a5c787b 100644 --- a/compiler/semexprs.nim +++ b/compiler/semexprs.nim @@ -2882,10 +2882,7 @@ proc semExpr(c: PContext, n: PNode, flags: TExprFlags = {}, expectedType: PType if optOwnedRefs in c.config.globalOptions: result.typ = makeVarType(c, result.typ, tyOwned) of skEnumField: - if overloadableEnums in c.features: - result = enumFieldSymChoice(c, n, s) - else: - result = semSym(c, n, s, flags) + result = enumFieldSymChoice(c, n, s) else: result = semSym(c, n, s, flags) if expectedType != nil and isSymChoice(result): diff --git a/compiler/semgnrc.nim b/compiler/semgnrc.nim index ca0b05fa2..d1c4acef6 100644 --- a/compiler/semgnrc.nim +++ b/compiler/semgnrc.nim @@ -108,11 +108,7 @@ proc semGenericStmtSymbol(c: PContext, n: PNode, s: PSym, result = n onUse(n.info, s) of skEnumField: - if overloadableEnums in c.features: - result = symChoice(c, n, s, scOpen) - else: - result = newSymNode(s, n.info) - onUse(n.info, s) + result = symChoice(c, n, s, scOpen) else: result = newSymNode(s, n.info) onUse(n.info, s) diff --git a/compiler/semtempl.nim b/compiler/semtempl.nim index c72e9db05..6b71892a0 100644 --- a/compiler/semtempl.nim +++ b/compiler/semtempl.nim @@ -250,7 +250,7 @@ proc semTemplSymbol(c: PContext, n: PNode, s: PSym; isField: bool): PNode = of skUnknown: # Introduced in this pass! Leave it as an identifier. result = n - of OverloadableSyms-{skEnumField}: + of OverloadableSyms: result = symChoice(c, n, s, scOpen, isField) of skGenericParam: if isField and sfGenSym in s.flags: result = n @@ -261,12 +261,8 @@ proc semTemplSymbol(c: PContext, n: PNode, s: PSym; isField: bool): PNode = if isField and sfGenSym in s.flags: result = n else: result = newSymNodeTypeDesc(s, c.idgen, n.info) else: - if s.kind == skEnumField and overloadableEnums in c.features: - result = symChoice(c, n, s, scOpen, isField) - elif isField and sfGenSym in s.flags: - result = n - else: - result = newSymNode(s, n.info) + if isField and sfGenSym in s.flags: result = n + else: result = newSymNode(s, n.info) # Issue #12832 when defined(nimsuggest): suggestSym(c.graph, n.info, s, c.graph.usageSym, false) diff --git a/compiler/semtypes.nim b/compiler/semtypes.nim index e807e0870..eefcd3069 100644 --- a/compiler/semtypes.nim +++ b/compiler/semtypes.nim @@ -143,10 +143,7 @@ proc semEnum(c: PContext, n: PNode, prev: PType): PType = onDef(e.info, e) if sfGenSym notin e.flags: if not isPure: - if overloadableEnums in c.features: - addInterfaceOverloadableSymAt(c, c.currentScope, e) - else: - addInterfaceDecl(c, e) + addInterfaceOverloadableSymAt(c, c.currentScope, e) else: declarePureEnumField(c, e) if isPure and (let conflict = strTableInclReportConflict(symbols, e); conflict != nil): |