lang: unification: Improve type unification algorithm
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.
This commit is contained in:
10
lang/interpret_test/TestAstFunc1/polydoubleinclude/main.mcl
Normal file
10
lang/interpret_test/TestAstFunc1/polydoubleinclude/main.mcl
Normal file
@@ -0,0 +1,10 @@
|
||||
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)),
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user