This repository was archived by the owner on Jun 15, 2023. It is now read-only.
This repository was archived by the owner on Jun 15, 2023. It is now read-only.
Battle test with JSX PPX V4 #615
Closed
Description
- 1. You forgot to handle a possible case here, for example:
// original
@react.component
let make = (~height, ~width, ~fill, ~className=?) => body
// error message
You forgot to handle a possible case here, for example:
{height: _, width: _, fill: Some(_), className: None, _}
| {height: _, width: _, fill: None, className: Some(_), _}
- 2. The type variable name '_disabled is not allowed in programs
// original
@react.component
let make = (~_disabled=?, ()) => body
- 3. A type parameter occurs several times
- 4. Values do not match between intf and impl
let make: props<option<string>, 'a, 'b, 'c> => React.element
is not included in
let make: React.componentLike<
props<string, string, int, React.element>
- 5. At most one component definition per module or one gets an error of type
props
being defined multiple times "Multiple definition of the type name props". - 6. Explicit type annotation for optional arg in definition
This issue seems related to 4
let make = (~x: option<int>=?) => body
// generated
type props<'x> = {key?: string, x?: 'x}
let make = ({?x, _}: props<option<int>>) => body
// error type mismatch option<int> vs. option<option<int>>
- 7. Conversion for the alias
let make = (~x as y) => body
- 8. Backward compatibility for passing the optional expression to prop
This expression seems not working with V4, should work in different expression.
x=?{a->returnOption} ❌
x=?{
let _ = ()
a->returnOption
} ⭕
-
9. Raise error with loc
-
10. If a component is called
foo
notmake
the ppx tries to callmake
. -
11. Error without location when a required prop is not supplied.
Metadata
Metadata
Assignees
Labels
No labels