-
-
Couldn't load subscription status.
- Fork 155
Closed
Labels
Milestone
Description
I believe only String and Number are directly supported when using string interpolation (please correct me if I'm wrong)
It would be very convenient to support at least three other things:
- Bool
- Record
- Enum
If there are others that make sense they can be considered too.
record Point2D {
x : Number,
y : Number
}
component Main {
fun componentDidMount {
/* this works */
Debug.log("number: #{2}")
/*
This errors with errors with "The expected type is `String`"
Why does only Number have implicit coercion?
*/
Debug.log("bool: #{true}")
/*
Predictably this also errors with "The expected type is `String`".
It would be nice if we could pretty print a nice json object string somehow
*/
Debug.log("record: #{Point2D(0,0)}")
/* enums could be nice too */
Debug.log("enum: #{Maybe::Just(Point2D(0,0))}")
}
fun render : Html {
<div/>
}
}Sija