File tree Expand file tree Collapse file tree 2 files changed +13
-6
lines changed
inference/infer_type_impls Expand file tree Collapse file tree 2 files changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -436,18 +436,13 @@ impl<'ast> InferType<'ast, Expr> for TypeInferencer<'ast> {
436436 self . unify_node_with_type ( this_expr, elem_ty) ?;
437437 }
438438
439- Expr :: Array ( Array { elem, named : false } ) => {
439+ Expr :: Array ( Array { elem, named : _ } ) => {
440440 // Constrain all elements of the array to be the same type.
441441 let elem_ty = self . unify_all_with_type ( elem, self . fresh_tvar ( ) ) ?;
442442 let array_ty = Type :: array ( elem_ty) ;
443443 self . unify_node_with_type ( this_expr, array_ty) ?;
444444 }
445445
446- Expr :: Array ( Array {
447- elem : _,
448- named : true ,
449- } ) => Err ( TypeError :: UnsupportedSqlFeature ( "named arrays" . to_string ( ) ) ) ?,
450-
451446 // interval is unmapped, value is unmapped
452447 Expr :: Interval ( interval) => {
453448 self . unify_node_with_type ( this_expr, Type :: any_native ( ) ) ?;
Original file line number Diff line number Diff line change @@ -1351,4 +1351,16 @@ mod test {
13511351 Err ( err) => panic ! ( "type check failed: {err}" ) ,
13521352 }
13531353 }
1354+
1355+ #[ test]
1356+ fn supports_named_arrays ( ) {
1357+ let schema = resolver ( schema ! {
1358+ tables: {
1359+ }
1360+ } ) ;
1361+
1362+ let statement = parse ( "SELECT ARRAY[1, 2, 3]" ) ;
1363+
1364+ type_check ( schema, & statement) . expect ( "named arrays should be supported" ) ;
1365+ }
13541366}
You can’t perform that action at this time.
0 commit comments