File tree Expand file tree Collapse file tree 3 files changed +37
-3
lines changed
tests/build_tests/super_errors Expand file tree Collapse file tree 3 files changed +37
-3
lines changed Original file line number Diff line number Diff line change @@ -1131,7 +1131,7 @@ let mk_record_from_props mapper (jsx_expr_loc : Location.t) (props : jsx_props)
11311131 {
11321132 loc_start = first_item.loc_start;
11331133 loc_end = last_item.loc_end;
1134- loc_ghost = true ;
1134+ loc_ghost = false ;
11351135 }
11361136 in
11371137 (* key should be filtered out *)
@@ -1156,7 +1156,7 @@ let mk_record_from_props mapper (jsx_expr_loc : Location.t) (props : jsx_props)
11561156 | JSXPropPunning (is_optional , name ) ->
11571157 {
11581158 lid = {txt = Lident name.txt; loc = name.loc};
1159- x = Exp. ident {txt = Lident name.txt; loc = name.loc};
1159+ x = Exp. ident ~loc: name.loc {txt = Lident name.txt; loc = name.loc};
11601160 opt = is_optional;
11611161 }
11621162 | JSXPropValue (name , is_optional , value ) ->
@@ -1303,7 +1303,6 @@ let expr ~(config : Jsx_common.jsx_config) mapper expression =
13031303 pexp_loc = loc;
13041304 pexp_attributes = attrs;
13051305 } -> (
1306- let loc = {loc with loc_ghost = true } in
13071306 match jsx_element with
13081307 | Jsx_fragment {jsx_fragment_children = children } ->
13091308 let fragment =
Original file line number Diff line number Diff line change 1+
2+ [1;31mWe've found a bug for you![0m
3+ [36m/.../fixtures/wrong_type_prop_punning.res[0m:[2m21:13-20[0m
4+
5+ 19 [2m│[0m @react.component
6+ 20 [2m│[0m let make = (~someProp: array<int>) => {
7+ [1;31m21[0m [2m│[0m <Level2 [1;31msomeProp[0m />
8+ 22 [2m│[0m }
9+ 23 [2m│[0m }
10+
11+ This has type: [1;31marray<int>[0m
12+ But it's expected to have type: [1;33mfloat[0m
Original file line number Diff line number Diff line change 1+ module React = {
2+ type element = Jsx .element
3+ @val external null : element = "null"
4+ type componentLike <'props , 'return > = Jsx .componentLike <'props , 'return >
5+ type component <'props > = Jsx .component <'props >
6+ external component : componentLike <'props , element > => component <'props > = "%identity"
7+ @module ("react/jsx-runtime" )
8+ external jsx : (component <'props >, 'props ) => element = "jsx"
9+ }
10+
11+ module Level2 = {
12+ @react.component
13+ let make = (~someProp : float ) => {
14+ React .null
15+ }
16+ }
17+
18+ module Level1 = {
19+ @react.component
20+ let make = (~someProp : array <int >) => {
21+ <Level2 someProp />
22+ }
23+ }
You can’t perform that action at this time.
0 commit comments