@@ -152,12 +152,9 @@ impl<'source> Lowerer<'source, '_> {
152152
153153 let expr;
154154 match ( components, constructor) {
155- // Zero-value constructor with explicit type. Not everything this
156- // matches is constructible, but the non-constructible types not
157- // excluded by `!is_dynamically_sized` are rejected by the
158- // parser.
155+ // Zero-value constructor with explicit type.
159156 ( Components :: None , Constructor :: Type ( ( result_ty, inner) ) )
160- if ! inner. is_dynamically_sized ( & ctx. module . types ) =>
157+ if inner. is_constructible ( & ctx. module . types ) =>
161158 {
162159 expr = crate :: Expression :: ZeroValue ( result_ty) ;
163160 }
@@ -535,11 +532,11 @@ impl<'source> Lowerer<'source, '_> {
535532 expr = crate :: Expression :: Compose { ty, components } ;
536533 }
537534
538- // Array constructor, explicit type. Override- and runtime-sized arrays are not constructible.
535+ // Array constructor, explicit type.
539536 (
540537 components,
541538 Constructor :: Type ( ( ty, inner @ & crate :: TypeInner :: Array { base, .. } ) ) ,
542- ) if ! inner. is_dynamically_sized ( & ctx. module . types ) => {
539+ ) if inner. is_constructible ( & ctx. module . types ) => {
543540 let mut components = components. into_components_vec ( ) ;
544541 ctx. try_automatic_conversions_slice ( & mut components, & Tr :: Handle ( base) , ty_span) ?;
545542 expr = crate :: Expression :: Compose { ty, components } ;
@@ -549,7 +546,7 @@ impl<'source> Lowerer<'source, '_> {
549546 (
550547 components,
551548 Constructor :: Type ( ( ty, inner @ & crate :: TypeInner :: Struct { ref members, .. } ) ) ,
552- ) if ! inner. is_dynamically_sized ( & ctx. module . types ) => {
549+ ) if inner. is_constructible ( & ctx. module . types ) => {
553550 let mut components = components. into_components_vec ( ) ;
554551 let struct_ty_span = ctx. module . types . get_span ( ty) ;
555552
0 commit comments