/ tests / tests / compiler / const_generics / unresolved_mismatch_fail.adl
unresolved_mismatch_fail.adl
 1  program foo.alpha {
 2      struct Foo::[N: u32] { x: u32 }
 3  
 4      transition main() {
 5          let f = foo::[0]();
 6      }
 7  
 8      // Here, `Foo::[2 * N]` can be resolved but `Foo::[2 * N * x]` can't.
 9      // Ensure we emit a monomorphization error (not a type check error).
10      inline foo::[N: u32]() -> Foo::[2 * N] {
11          let x: u32 = 1u32;
12          return Foo::[2 * N * x] { x: 0 };
13      }
14  }