@@ -17,26 +17,27 @@ pub fn lower_hir_struct_init(
1717 if let HIRNodeKind :: StructInitializerTyped { t, fields } = node. kind {
1818 let mut values = vec ! [ ] ;
1919
20- match t. get_generic ( & ctx . hir_ctx . type_storage ) {
20+ match t. get_generic ( ) {
2121 RawType :: Struct ( _, _) => {
2222 for field in fields {
2323 values. push ( lower_hir_value ( block, field, ctx) ?) ;
2424 }
2525 }
2626
2727 RawType :: EnumEntry ( container) => {
28- let parent = match & ctx. hir_ctx . type_storage . types . vals [ container. parent ] {
29- RawType :: Enum ( container) => container. clone ( ) ,
30- _ => panic ! ( "Enum parent not enum" ) ,
31- } ;
28+ let parent =
29+ match & ctx. hir_ctx . global_scope . entries [ container. parent ] . as_type_unsafe ( ) {
30+ RawType :: Enum ( container) => container. clone ( ) ,
31+ _ => panic ! ( "Enum parent not enum" ) ,
32+ } ;
3233
3334 let hint = build_unsigned_int_const (
3435 & mut ctx. mir_ctx ,
3536 container. child as u128 ,
3637 parent. get_hint_type ( ) . get_size (
3738 & Type :: GenericLowered ( parent. get_hint_type ( ) ) ,
3839 false ,
39- & ctx. hir_ctx . type_storage ,
40+ & ctx. hir_ctx . global_scope ,
4041 ) ,
4142 ) ?;
4243
@@ -50,7 +51,7 @@ pub fn lower_hir_struct_init(
5051 _ => panic ! ( "Invalid type for a StructInitializedTyped" ) ,
5152 }
5253
53- let lowered_type = lower_hir_type ( ctx, t) ?. get_generic ( & ctx . hir_ctx . type_storage ) ;
54+ let lowered_type = lower_hir_type ( ctx, t) ?. get_generic ( ) ;
5455
5556 return build_static_struct_const ( & mut ctx. mir_ctx , lowered_type, values) ;
5657 }
0 commit comments