// Isolate: is Float field access broken, or is float_to_str broken?

struct Box {
    val_int: Int,
    val_float: Float,
    val_str: String,
}

fn main() {
    // First: does float_to_str work at all?
    let f = 3.14
    println("plain float = " + float_to_str(f))
    println("float + 1 = " + float_to_str(f + 1.0))

    // Create struct and access fields
    let b = Box { val_int: 10, val_float: 2.5, val_str: "test" }

    // Int field
    let i = b.val_int
    println("val_int = " + int_to_str(i))

    // Float field
    let fv = b.val_float
    println("val_float via float_to_str = " + float_to_str(fv))

    // Try arithmetic on the float field — if it's void, this will be void too
    let fv2 = fv + 1.0
    println("val_float + 1.0 = " + float_to_str(fv2))

    // Try using the float field as an int — does it convert?
    println("val_float as int_to_str = " + int_to_str(fv))

    // String field
    let sv = b.val_str
    println("val_str = " + sv)
}
