Skip to content

Is var x: T an ExistentialContainer? #27

Answered by Azoy
Azoy asked this question in Q&A
Discussion options

You must be logged in to vote

Cross posting: https://github.com/Azoy/Echo/discussions/24#discussioncomment-625549

Azoy answers:

var y: T is simply whatever type it is at runtime, so if its an Int it will literally be Int.

ExistentialContainers store whatever thing conforms to some protocol, so classes, structs, enums, etc.

I think for the future it would be beneficial for new discussion threads because it allows for Github's answering feature to properly work on a question vs. a massive FAQ thread.

Replies: 1 comment 3 replies

Comment options

Azoy
Apr 18, 2021
Maintainer Author

You must be logged in to vote
3 replies
@Azoy
Comment options

Azoy Apr 18, 2021
Maintainer Author

@Azoy
Comment options

Azoy Apr 18, 2021
Maintainer Author

@Azoy
Comment options

Azoy Apr 18, 2021
Maintainer Author

Answer selected by Azoy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant