Skip to content

Commit 3539a03

Browse files
committed
Name resolve any specified types in TypeParams
Type parameters can have defaults these need to be name resolved. Addresses: #307
1 parent 6647bc6 commit 3539a03

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

gcc/rust/resolve/rust-ast-resolve-type.h

+6
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,12 @@ class ResolveGenericParam : public ResolverBase
265265
"generic param redefined multiple times");
266266
rust_error_at (locus, "was defined here");
267267
});
268+
269+
// if it has a type lets resolve it
270+
if (param.has_type ())
271+
{
272+
ResolveType::go (param.get_type ().get (), param.get_node_id ());
273+
}
268274
}
269275

270276
private:
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// { dg-error "unresolved type" "" { target { *-*-* } } 0 }
2+
3+
struct Foo<A = i321>(A);
4+
// { dg-error "failed to resolve TypePath: i321" "" { target *-*-* } .-1 }
5+
6+
fn main() {
7+
let a;
8+
a = Foo(123);
9+
}

0 commit comments

Comments
 (0)