Closed egaga closed 8 years ago
Yet another example of #873, which is common enough that I have that issue number memorized.
Thanks for reporting. You've correctly diagnosed the circular nature of the code. For now... just don't do that, m'kay?
Ah, that's good!
Would you mind closing the issue?
In browser's console log:
game.elm:2759 Uncaught TypeError: Cannot read property 'ctor' of undefined 6game.elm:1315 Uncaught Error: The notify function has been called synchronously! This can lead to frames being dropped. Definitely report this to <https://github.com/elm-lang/Elm/issues>
The translated javascript has this line referenced
while (xs.ctor !== '[]' && n > 0)
I added a new action (in SimpleApp terms) to the update function:
The problem seems to be that the arguments
deck
andplayer
in the callDomain.drawCardsToHand deck player
should actually be referencingmodel.player
andmodel.deck
. It seems that creating having a let with the needed variable (deck
andplayer
) are enough to satisfy the compiler. They are not defined globally elsewhere; though similar let constructions are defined on other action branches (case of ...).For reference:
If this is hard-to-reproduce for others, I'll perhaps take the time to make a simple test case.