Description
Usage of unicode char ² in type name is allowed by purs compiler but fails in node at runtime
A clear and concise description of what the bug is.
To Reproduce
-- Example.purs
module Example where
data ℝ² = V Number Number
derive instance Generic ℝ² _
instance Show ℝ² where
show = genericShow
v :: ℝ²
v = V 1.0 2.0
in spago repl
# spago repl
> import Example
> v
file:///{path_to_project}/.psci_modules/$PSCI/index.js:4
var $dollarmain = /* #__PURE__ */ PSCI_Support["eval"](/* #__PURE__ */ PSCI_Support.evalShow(Temp2.showℝ²))(it);
^^^^^
SyntaxError: missing ) after argument list
at compileSourceTextModule (node:internal/modules/esm/utils:338:16)
at ModuleLoader.moduleStrategy (node:internal/modules/esm/translators:102:18)
at #translate (node:internal/modules/esm/loader:468:12)
at ModuleLoader.loadAndTranslate (node:internal/modules/esm/loader:515:27)
at async ModuleJob._link (node:internal/modules/esm/module_job:115:19)
Node.js v22.14.0
Expected behavior
Either
- compiler to transform the name so that the runtime js error doesn't happen
- compiler to not allow that unicode char (but what a shame that would be!)
Additional context
spago version: 0.93.45 (not sure whether relevant)
PureScript version
0.15.15
Reactions are currently unavailable
Description
Usage of unicode char ² in type name is allowed by purs compiler but fails in node at runtime
A clear and concise description of what the bug is.
To Reproduce
in spago repl
Expected behavior
Either
Additional context
spago version: 0.93.45 (not sure whether relevant)
PureScript version
0.15.15