Skip to content
Discussion options

You must be logged in to vote

Thanks for giving it a spin! You're looking for the as operator, documented here.

let contents = io.ReadAll(file)?
let s = contents as string

I might add a diagnostic to surface this more clearly.

Replies: 1 comment 1 reply

Comment options

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

Answer selected by ivov
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