1 // run-pass
2 #![feature(generic_associated_types)]
3 
4 // This test unsures that with_opt_const_param returns the
5 // def_id of the N param in the Foo::Assoc GAT.
6 
7 trait Foo {
8     type Assoc<const N: usize>;
foo(&self) -> Self::Assoc<3>9     fn foo(&self) -> Self::Assoc<3>;
10 }
11 
12 impl Foo for () {
13     type Assoc<const N: usize> = [(); N];
foo(&self) -> Self::Assoc<3>14     fn foo(&self) -> Self::Assoc<3> {
15         [(); 3]
16     }
17 }
18 
main()19 fn main() {
20     assert_eq!(().foo(), [(); 3]);
21 }
22