def to-text-line x:_elem -> y:text [
local-scope
load-ingredients
y <- to-text x
]
def array-to-text-line x:&:@:_elem -> y:text [
local-scope
load-ingredients
y <- to-text *x
]
scenario to-text-line-early-warning-for-static-dispatch [
x:text <- to-text-line 34
]
scenario array-to-text-line-early-warning-for-static-dispatch [
n:&:@:num <- new number:type, 3
x:text <- array-to-text-line n
]
def to-text c:char -> y:text [
local-scope
load-ingredients
y <- new character:type, 1/capacity
*y <- put-index *y, 0, c
]
scenario character-to-text [
1:char <- copy 111/o
2:text <- to-text 1:char
3:@:char <- copy *2:text
memory-should-contain [
3:array:character <- [o]
]
]