Does the runtime expose default values for properties? #53
Answered
by
Azoy
NSExceptional
asked this question in
Q&A
-
Would be a cool way for my JSON library to allow the user to supply default values, i.e. struct Post {
// Everyone
var participants: [User]
// Everyone except OP, computed later
var commentors: [User] = []
} |
Beta Was this translation helpful? Give feedback.
Answered by
Azoy
May 12, 2021
Replies: 1 comment 5 replies
-
The runtime does not expose said information, however there are functions emitted for these default values. So in theory it is possible to get those values, but it would require a bit of work. |
Beta Was this translation helpful? Give feedback.
5 replies
Answer selected by
NSExceptional
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The runtime does not expose said information, however there are functions emitted for these default values. So in theory it is possible to get those values, but it would require a bit of work.