More all-rounded implementation of the new objecty features, several bugfixes, and updates to the standard library to behave. Vector still needs a bit more work for some operations
This commit is contained in:
@@ -1,9 +1,10 @@
|
||||
import io:*
|
||||
|
||||
obj Traited(Traits) {}
|
||||
|
||||
fun funcID<T>(genFun: fun():T):T {
|
||||
return genFun()
|
||||
}
|
||||
|
||||
fun retInt():int {
|
||||
return 9
|
||||
}
|
||||
@@ -21,11 +22,22 @@ fun ptrFn<T>(ptr: T*):void {
|
||||
println(*ptr)
|
||||
}
|
||||
|
||||
fun traitAware<T>(it:T*):void {
|
||||
println("Does not have Traits")
|
||||
}
|
||||
|
||||
fun traitAware<T(Traits)>(it:T*):void {
|
||||
println("Does have Traits")
|
||||
}
|
||||
|
||||
fun main():int {
|
||||
var a = 8
|
||||
ptrFn(&a)
|
||||
println(funcID(retInt))
|
||||
doThePrint(printInt)
|
||||
var t:Traited
|
||||
traitAware(&t)
|
||||
traitAware(&a)
|
||||
return 0
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user