ethereum / fe

Emerging smart contract language for the Ethereum blockchain.
https://fe-lang.org
Other
1.6k stars 178 forks source link

Panic due to result::unwrap() called on an `Err` value: TypeError(DiagnosticVoucher(PhantomData<()>)) at crates/analyzer/src/namespace/items.rs:1918:64 #967

Open bshastry opened 9 months ago

bshastry commented 9 months ago
use std::context::{Emittable}

struct Custom {}

impl Emittable for Custom {
  fn emit(self, _val: A) {}
}

panics here

https://github.com/ethereum/fe/blob/c1036e9e58d4e2930782f8e1f016d60e50439560/crates/analyzer/src/namespace/items.rs#L1918

Repro

fe build test.fe
bshastry commented 9 months ago

This test also panics on driver2 here

https://github.com/ethereum/fe/blob/4643ced30f21df645944b9d7713c66b62fe1ddb7/crates/hir-analysis/src/ty/def_analysis.rs#L596

Y-Nak commented 9 months ago

Thank you for reporting the error. Regarding v2, this error has been fixed in #942