Skip to content

Downcasting a Datum to a CustomClass Type #42

Answered by nielstron
while0x1 asked this question in Q&A
Discussion options

You must be logged in to vote

Use a Downcast by annotating the assigned variable with the desired type like this

winnerdatum: winnerList = unionDatum.datum

Here is a another code example with explanation: https://github.com/ImperatorLang/eopsin/blob/master/examples/datum_cast.py

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@while0x1
Comment options

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