aboutsummaryrefslogtreecommitdiff
path: root/examples/42-generic-struct-methods/src/HelloWorld.shed
blob: a4e808e1f0c19a3460514927c1767bdabd6da9b4 (plain)
1
2
3
4
5
6
7
8
9
10
11
pub fun main() ! Io -> Unit {
    val messageBox = Box("hello, world");

    print!(messageBox.get());
}

struct Box[T](value: T) {
    fun get(this) -> T {
        this.value
    }
}