mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-19 05:50:30 +00:00
overloading of dot and parenthesis operators should now be done in .experimental
This commit is contained in:
@@ -1252,6 +1252,9 @@ proc semProcAux(c: PContext, n: PNode, kind: TSymKind,
|
||||
pushOwner(s)
|
||||
s.options = gOptions
|
||||
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 not experimentalMode(c):
|
||||
message(n.info, warnDeprecated, "overloaded '.' and '()' operators are now .experimental; " & s.name.s)
|
||||
if n.sons[bodyPos].kind != nkEmpty:
|
||||
# for DLL generation it is annoying to check for sfImportc!
|
||||
if sfBorrow in s.flags:
|
||||
|
||||
@@ -4,6 +4,9 @@ Special Operators
|
||||
dot operators
|
||||
-------------
|
||||
|
||||
**Note**: Dot operators are still experimental and so need to be enabled
|
||||
via ``{.experimental.}``.
|
||||
|
||||
Nim offers a special family of dot operators that can be used to
|
||||
intercept and rewrite proc call and field access attempts, referring
|
||||
to previously undeclared symbol names. They can be used to provide a
|
||||
|
||||
3
todo.txt
3
todo.txt
@@ -1,8 +1,6 @@
|
||||
version 1.0 battle plan
|
||||
=======================
|
||||
|
||||
- overloading of `()` and ``.`` needs to be in .experimental
|
||||
- implement ``.delegate`` for .experimental
|
||||
- Deprecate ``immediate`` for templates and macros
|
||||
- fix generic multi-methods
|
||||
- fix "high priority" bugs
|
||||
@@ -15,6 +13,7 @@ Not critical for 1.0
|
||||
- get GC:v2 stable: nim c --gc:v2 -r -d:useSysAssert -d:useGcAssert -d:smokeCycles -d:useRealtimeGc tests/gc/gctest
|
||||
|
||||
- find a solution for the x.f[T](y) gotcha
|
||||
- implement ``.delegate`` for .experimental
|
||||
|
||||
- Destructors need to be refined.
|
||||
- annotation support for getType()
|
||||
|
||||
@@ -28,6 +28,8 @@ Changes affecting backwards compatibility
|
||||
|
||||
See `https://github.com/nim-lang/Nim/issues/3898`_ for the relevant
|
||||
discussion.
|
||||
- Overloading the special operators ``.``, ``.()``, ``.=``, ``()`` now
|
||||
should be enabled via ``{.experimental.}``.
|
||||
|
||||
|
||||
Library Additions
|
||||
|
||||
Reference in New Issue
Block a user