(Solved) Surface live component slot arg create weird dialyzer pattern_match error

While changing some live component to surface live component,
Dialyzer gave an error like below:

The pattern can never match the type.



As it shows no useful line number, and there was no error when compiling and running the code, I had to find it by commenting out binary search the source code.

Below is part of the index code where it used live component before changing to surface:

<live_component module={SomeModule} id="some-id" data={@some_data} :let={prop}>
  <button phx-click={prop.on_click} >button</button>

After changing to surface live component:

<SomeModule id="some-id" data={@some_data} :let={prop}>
  <button phx-click={prop.on_click} >button</button>

The problem was getting slot argument as whole prop variable.
I don’t know why it broke Dialyzer, and there was no error from Surface.
But after changing to the following, Dialyzer error disappeared:

<SomeModule id="some-id" data={@some_data} :let={on_click: on_click}>
  <button phx-click={on_click} >button</button>

I couldn’t make a reproducible example,
so I’m leaving this note just in case anyone stumbles upon a similar problem.