@@ -230,10 +230,10 @@ impl<'ctx, 'mir, 'ink> Codegen<'ctx, 'mir, 'ink> {
230230 _ => {
231231 let ( function_ptr, function_ty) =
232232 self . resolve_operand ( & builder, function_id, * function) ;
233- let Type :: Function {
233+ let Type :: Composite ( CompositeType :: Function {
234234 parameters,
235235 return_ty,
236- } = & self . ctx . types [ function_ty]
236+ } ) = & self . ctx . types [ function_ty]
237237 else {
238238 panic ! ( ) ;
239239 } ;
@@ -337,15 +337,15 @@ impl<'ctx, 'mir, 'ink> Codegen<'ctx, 'mir, 'ink> {
337337
338338 for projection in & place. projection {
339339 ( ptr, ty) = match ( projection, & self . ctx . types [ ty] ) {
340- ( Projection :: Deref , Type :: Ref ( inner_ty) ) => (
340+ ( Projection :: Deref , Type :: Composite ( CompositeType :: Ref ( inner_ty) ) ) => (
341341 builder
342342 . build_load ( self . basic_ty ( ty) , ptr, "deref" )
343343 . unwrap ( )
344344 . into_pointer_value ( ) ,
345345 * inner_ty,
346346 ) ,
347347 ( Projection :: Deref , ty) => panic ! ( "cannot dereference {ty:?}" ) ,
348- ( Projection :: Field ( field) , Type :: Tuple ( fields) ) => {
348+ ( Projection :: Field ( field) , Type :: Composite ( CompositeType :: Tuple ( fields) ) ) => {
349349 let offset = self . ctx . types . offset_of ( ty, * field) . unwrap ( ) ;
350350 let offset = self . ink . i64_type ( ) . const_int ( offset as u64 , false ) ;
351351
@@ -717,7 +717,7 @@ impl<'ctx, 'mir, 'ink> Codegen<'ctx, 'mir, 'ink> {
717717 . collect :: < Vec < _ > > ( ) ;
718718
719719 match & self . ctx . types [ return_ty] {
720- Type :: Tuple ( tuple_items) if tuple_items. is_empty ( ) => {
720+ Type :: Composite ( CompositeType :: Tuple ( tuple_items) ) if tuple_items. is_empty ( ) => {
721721 self . ink . void_type ( ) . fn_type ( & parameters, false )
722722 }
723723 _ => self . basic_ty ( return_ty) . fn_type ( & parameters, false ) ,
@@ -730,10 +730,14 @@ impl<'ctx, 'mir, 'ink> Codegen<'ctx, 'mir, 'ink> {
730730 Type :: I8 => self . ink . i8_type ( ) . into ( ) ,
731731 Type :: U8 => self . ink . i8_type ( ) . into ( ) ,
732732 Type :: Boolean => self . ink . bool_type ( ) . into ( ) ,
733- Type :: Ref ( _) => self . ink . ptr_type ( AddressSpace :: default ( ) ) . into ( ) ,
734733 Type :: Never => unreachable ! ( ) ,
735- Type :: Function { .. } => self . ink . ptr_type ( AddressSpace :: default ( ) ) . into ( ) ,
736- Type :: Tuple ( _) => self
734+ Type :: Composite ( CompositeType :: Ref ( _) ) => {
735+ self . ink . ptr_type ( AddressSpace :: default ( ) ) . into ( )
736+ }
737+ Type :: Composite ( CompositeType :: Function { .. } ) => {
738+ self . ink . ptr_type ( AddressSpace :: default ( ) ) . into ( )
739+ }
740+ Type :: Composite ( CompositeType :: Tuple ( _) ) => self
737741 . ink
738742 . i8_type ( )
739743 . array_type ( self . ctx . types . size_of ( ty) as u32 )
0 commit comments