Closed sophiajt closed 2 months ago
This adds the ability to have a method on a generic type.
For example:
struct Foo<T> { x: T fun get_value(self) [return == self] -> T { return self.x } } fun main() { let bar = new Foo(x: 100) println(bar.get_value()) }
You'll notice that the lifetime checker is strict about the lifetime requirements of T, as it can be any type, including pointers.
This adds the ability to have a method on a generic type.
For example:
You'll notice that the lifetime checker is strict about the lifetime requirements of T, as it can be any type, including pointers.