2 // Test that we correctly normalize the type of a struct field
3 // which has an associated type.
12 pub struct Node<K:UnifyKey> {
17 fn foo<K : UnifyKey<Value=Option<V>>,V : Clone>(node: &Node<K>) -> Option<V> {
21 impl UnifyKey for i32 {
22 type Value = Option<u32>;
25 impl UnifyKey for u32 {
26 type Value = Option<i32>;
30 let node: Node<i32> = Node { key: 1, value: Some(22) };
31 assert_eq!(foo(&node), Some(22));
33 let node: Node<u32> = Node { key: 1, value: Some(22) };
34 assert_eq!(foo(&node), Some(22));