Closed shwestrick closed 1 year ago
Repo+commit: https://github.com/shwestrick/smlfmt/tree/a14cc23bca3dfd786cd2c7c4d9bdf9c1a14606cd
Added a millet.toml file at the project root:
millet.toml
version = 1 workspace.root = "src/smlfmt.mlb"
Go to src/parse-mlb/ParseAllSMLFromMLB.sml, ln 86: https://github.com/shwestrick/smlfmt/blob/a14cc23bca3dfd786cd2c7c4d9bdf9c1a14606cd/src/parse-mlb/ParseAllSMLFromMLB.sml#L86-L100
src/parse-mlb/ParseAllSMLFromMLB.sml
Selectors #dir ctx (line 88) and #parents ctx (line 93) should be individually marked with type errors.
#dir ctx
#parents ctx
(Note however that MLton does not consider this to be a type error at all, but that's a separate issue. See #18.)
Millet generates a 5023 error for the entire function.
The text of the error is cannot resolve record type containing `...`, which is a bit unfortunate in this situation, because it makes it seem like the error is at line 88, where it binds val {result = path, ...}. https://github.com/shwestrick/smlfmt/blob/a14cc23bca3dfd786cd2c7c4d9bdf9c1a14606cd/src/parse-mlb/ParseAllSMLFromMLB.sml#L88
cannot resolve record type containing `...`
val {result = path, ...}
However, the error is actually caused by the selectors #dir ctx and #parents ctx, because Millet is unable to determine the type of ctx. I confirmed that providing a type annotation for the variable ctx makes Millet happy.
ctx
Addressed in 69abb75527a9a3ebe3655633794ee05a97ee2e20
Environment
Steps to reproduce
Repo+commit: https://github.com/shwestrick/smlfmt/tree/a14cc23bca3dfd786cd2c7c4d9bdf9c1a14606cd
Added a
millet.toml
file at the project root:Go to
src/parse-mlb/ParseAllSMLFromMLB.sml
, ln 86: https://github.com/shwestrick/smlfmt/blob/a14cc23bca3dfd786cd2c7c4d9bdf9c1a14606cd/src/parse-mlb/ParseAllSMLFromMLB.sml#L86-L100Expected behavior
Selectors
#dir ctx
(line 88) and#parents ctx
(line 93) should be individually marked with type errors.(Note however that MLton does not consider this to be a type error at all, but that's a separate issue. See #18.)
Actual behavior
Millet generates a 5023 error for the entire function.
The text of the error is
cannot resolve record type containing `...`
, which is a bit unfortunate in this situation, because it makes it seem like the error is at line 88, where it bindsval {result = path, ...}
. https://github.com/shwestrick/smlfmt/blob/a14cc23bca3dfd786cd2c7c4d9bdf9c1a14606cd/src/parse-mlb/ParseAllSMLFromMLB.sml#L88However, the error is actually caused by the selectors
#dir ctx
and#parents ctx
, because Millet is unable to determine the type ofctx
. I confirmed that providing a type annotation for the variablectx
makes Millet happy.