add comment about what code is triggering a compiler error
This commit is contained in:
@@ -75,6 +75,17 @@ struct
|
|||||||
(yAxis, xAxis, x, y, health, jumpPressed, tl, wallList, game)
|
(yAxis, xAxis, x, y, health, jumpPressed, tl, wallList, game)
|
||||||
| _ =>
|
| _ =>
|
||||||
let
|
let
|
||||||
|
(***
|
||||||
|
*** cause of compiler error is here
|
||||||
|
*** The specific error is an error with optimising record representations.
|
||||||
|
***
|
||||||
|
*** TO make the problem go away (at the cost of incorrectness),
|
||||||
|
*** one can:
|
||||||
|
*** 1. Delete the call to Vector.sub below
|
||||||
|
*** 2. Change the `platY` value below (in `platY - size`)
|
||||||
|
*** to any constant integer (like 300 or 555).
|
||||||
|
***)
|
||||||
|
|
||||||
val {platforms, ...} = game
|
val {platforms, ...} = game
|
||||||
val {y = platY, ...} = Vector.sub (platforms, platID - 1)
|
val {y = platY, ...} = Vector.sub (platforms, platID - 1)
|
||||||
|
|
||||||
@@ -87,15 +98,6 @@ struct
|
|||||||
checkWalls (yAxis, xAxis, x, y, health, jumpPressed, wallList, game)
|
checkWalls (yAxis, xAxis, x, y, health, jumpPressed, wallList, game)
|
||||||
end
|
end
|
||||||
|
|
||||||
(*** MLTON STRANGE TYPES ERROR:
|
|
||||||
*** Trigger by deleting the longer `checkPlatforms` function
|
|
||||||
*** and uncommenting the function of the same name that raises Match.
|
|
||||||
|
|
||||||
fun checkPlatforms (yAxis, xAxis, x, y, health, jumpPressed, game) =
|
|
||||||
raise Match
|
|
||||||
|
|
||||||
*** *)
|
|
||||||
|
|
||||||
fun checkPlatforms (yAxis, xAxis, x, y, health, jumpPressed, game) =
|
fun checkPlatforms (yAxis, xAxis, x, y, health, jumpPressed, game) =
|
||||||
let
|
let
|
||||||
val {wallTree, platformTree, ...} = game
|
val {wallTree, platformTree, ...} = game
|
||||||
|
|||||||
Reference in New Issue
Block a user