We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
create project:
moon new --lib project1 cd ./project1
edit ./sec/top.mbt :
./sec/top.mbt
///| pub(open) trait Abelian { proof() -> Unit } ///| pub impl[A : Abelian] Abelian for A? with proof() { }
run build command:
moon build
output:
failed: moonc build-package -error-format json D:\Code\moonbit\bug\project1\src\top.mbt -o D:\Code\moonbit\bug\project1\target\wasm-gc\release\build\hello.core -pkg username/hello -std-path C:\Users\FlyCloudC\.moon\lib\core\target\wasm-gc\release\bundle -i D:\Code\moonbit\bug\project1\target\wasm-gc\release\build\lib\lib.mi:lib -pkg-sources username/hello:D:\Code\moonbit\bug\project1\src -target wasm-gc -- -- / // / __--------_ / // /_/ \ --- - \ __ / X / ____ / ) *_________/__/_____/______/ `-- Oops, the compiler has encountered an unexpected situation. This is a bug in the compiler. A bug report containing the error description and relevant code would be greatly appreciated. You can submit the bug report here: https://github.com/moonbitlang/moonbit-docs/issues/new?labels=bug,ICE Error: Moonc.Hashed_type.Unresolved_type_variable Compiler args: moonc build-package -error-format json "D:\\Code\\moonbit\\bug\\project1\\src\\top.mbt" -o "D:\\Code\\moonbit\\bug\\project1\\target\\wasm-gc\\release\\build\\hello.core" -pkg username/hello -std-path "C:\\Users\\FlyCloudC\\.moon\\lib\\core\\target\\wasm-gc\\release\\bundle" -i "D:\\Code\\moonbit\\bug\\project1\\target\\wasm-gc\\release\\build\\lib\\lib.mi:lib" -pkg-sources "username/hello:D:\\Code\\moonbit\\bug\\project1\\src" -target wasm-gc moonc version: v0.1.20241218+f4a066f5f error: failed when building
The text was updated successfully, but these errors were encountered:
I found it is also reproducible in the open-sourced v0.1.20241202 version.
https://github.com/moonbitlang/moonbit-compiler/blob/main/src/poly_type.ml#L92 Here a fresh type variable is made for the type parameter A.
A
Because the type variable is unused, the unification of the method does not bound the type variable: https://github.com/moonbitlang/moonbit-compiler/blob/main/src/toplevel_typer.ml#L2031
Later when we solve the constraints, the unresolved type variable will raise the error because it cannot be hashed.
I think it is a case where the compiler should catch and print the compilation failure.
Sorry, something went wrong.
Guest0x0
No branches or pull requests
create project:
edit
./sec/top.mbt
:run build command:
output:
The text was updated successfully, but these errors were encountered: