moonbit-docs icon indicating copy to clipboard operation
moonbit-docs copied to clipboard

[ICE] Using impossible trait objects in type definitions

Open FlyCloudC opened this issue 6 months ago • 2 comments

top.mbt:

struct X {
  a : &Eq
}

fn main {
  let _ : X = panic()
}

run moon build, output:

failed: moonc link-core C:\Users\flycloudc\.moon\lib\core\target\wasm-gc\release\bundle\core.core D:\Code\moonbit\bug\project1\target\wasm-gc\release\build\project1.core -main username/project1 -o D:\Code\moonbit\bug\project1\target\wasm-gc\release\build\project1.wasm -pkg-config-path D:\Code\moonbit\bug\project1\src\moon.pkg.json -pkg-sources username/project1:D:\Code\moonbit\bug\project1\src -pkg-sources moonbitlang/core:C:\Users\flycloudc\.moon\lib\core -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: File "moonc.ml", line 143945, characters 20-26: Assertion failed

Compiler args: moonc link-core "C:\\Users\\flycloudc\\.moon\\lib\\core\\target\\wasm-gc\\release\\bundle\\core.core" "D:\\Code\\moonbit\\bug\\project1\\target\\wasm-gc\\release\\build\\project1.core" -main username/project1 -o "D:\\Code\\moonbit\\bug\\project1\\target\\wasm-gc\\release\\build\\project1.wasm" -pkg-config-path "D:\\Code\\moonbit\\bug\\project1\\src\\moon.pkg.json" -pkg-sources "username/project1:D:\\Code\\moonbit\\bug\\project1\\src" -pkg-sources "moonbitlang/core:C:\\Users\\flycloudc\\.moon\\lib\\core" -target wasm-gc

moonc version: v0.1.20250410+15d580434
error: failed when building

moon version --all:

moon 0.1.20250407 (24afaca 2025-04-07) ~\.moon\bin\moon.exe
moonc v0.1.20250410+15d580434 ~\.moon\bin\moonc.exe
moonrun 0.1.20250407 (24afaca 2025-04-07) ~\.moon\bin\moonrun.exe

FlyCloudC avatar Apr 16 '25 13:04 FlyCloudC