The simple type unification algorithm suffered from some serious performance and memory problems when used with certain code bases. This adds some crucial optimizations that improve performance drastically.
11 lines
241 B
Plaintext
11 lines
241 B
Plaintext
import "fmt"
|
|
|
|
# note that the class can have two separate types for $b
|
|
include c1("t1", "hello") # len is 5
|
|
include c1("t2", [13, 42, 0, -37,]) # len is 4
|
|
class c1($a, $b) {
|
|
test $a {
|
|
anotherstr => fmt.printf("len is: %d", len($b)),
|
|
}
|
|
}
|