-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add default field support for object in ARC/ORC #20220
Conversation
Why does the PR say "in ARC/ORC"? Shouldn't this be independent of the GC? Does this mean that the feature doesn't exist for other GCs or what's the deal? |
I haven't figured out seq support for refc. I will focus on ARC/ORC first. |
To expand a bit on the issue with seqs @ringabout is referring to: In the To @ringabout: a straightforward (though not necessarily the best) approach to make this work for the RTTI-based # the signature of the lifted init proc:
proc init(p: pointer)
proc setLengthSeqV2(s: PGenericSeq, typ: TNimType, newLen: int): PGenericSeq =
...
for i in oldLen..<newLen:
typ.base.init(dataPointer(result, elemAlign, elemSize, i))
...
# for `newSeq`, `cgen` adjustments would be required Lifting the To not create unused |
It's perfectly fine to combine default field support with ARC/ORC and only enable it for version 2. |
Please resolve conflicts. And it needs a grammar update as @metagn suggested. |
Succeeded by #20480 |
closes nim-lang/RFCs#126
closes nim-lang/RFCs#48
closes nim-lang/RFCs#233
closes nim-lang/RFCs#252
fixes #19763
fixes #16744
fixes #3608
ref nim-lang/RFCs#437
inspired by #12378
default fields for object
the addition compared to #12378
notes for me only
abstractInst vs {tyGenericInst, tyAlias, tySink}