Fix type errors

This commit is contained in:
2021-04-24 21:26:26 -06:00
parent 665e4a3ca7
commit 821c1188c0
3 changed files with 15 additions and 11 deletions

View File

@@ -521,6 +521,8 @@ class Macros {
var bindingList = exps[1].bindingList("defnew");
var bindingPairs = Prelude.groups(bindingList, 2);
// TODO allow &prop in the arg list to bind it directly to a same-named variable
var b = wholeExp.expBuilder();
var propertyDefs = [for (bindingPair in bindingPairs) b.call(b.symbol("defprop"), [bindingPair[0]])];
var propertySetExps = [for (bindingPair in bindingPairs)

View File

@@ -1,13 +1,15 @@
(defnew [:String title
:Int width
:Int height
:Int letterWidth
:Int letterHeight
:GameLogic gameLogic
:GraphicsBackend _graphicsBackend]
[graphics (new Graphics width height)
logic gameLogic
graphicsBackend _graphicsBackend]
(defnew [title
width
height
letterWidth
letterHeight
_gameLogic
_graphicsBackend]
// TODO the type annotation on this line feels like a bit much, but is necessary:
[:Graphics graphics (new Graphics width height)
:GameLogic gameLogic _gameLogic
:GraphicsBackend graphicsBackend _graphicsBackend]
(graphicsBackend.initialize title width height letterWidth letterHeight))

View File

@@ -1,2 +1,2 @@
(defnew [width height]
[surface (new Surface width height)])
[:Surface surface (new Surface width height)])