Workaround for complexType parsing

This commit is contained in:
2020-12-07 20:54:04 -07:00
parent c2fa37fb28
commit 4e938ddeb0
3 changed files with 30 additions and 38 deletions

View File

@@ -254,6 +254,10 @@ class BasicTestCase extends Test {
function testRest() {
_testRest();
}
function testTypeParsing() {
_testTypeParsing();
}
}
class BasicObject {

View File

@@ -370,4 +370,16 @@
(Assert.equals 15 (last myList)))
(defun _testRest []
(Assert.equals (.toString [2 3 4]) (.toString (rest [1 2 3 4]))))
(Assert.equals (.toString [2 3 4]) (.toString (rest [1 2 3 4]))))
(defun doSomething [:Int->Int func]
(func 5))
(defun itsAMonster [:Null<Map<String,Map<String,Array<String>>>> monsterArg] "but it still compiles")
(defun _testTypeParsing []
// Do stuff with functions that take complex type parameters, mostly just to check if it compiles
(Assert.equals 5 (doSomething (lambda [i] i)))
(Assert.equals 7 (doSomething (lambda [i] (+ i 2))))
// Pass null to the really crazy one because I'm lazy:
(Assert.equals "but it still compiles" (itsAMonster null)))