sycamore-rs / sycamore

A library for creating reactive web apps in Rust and WebAssembly
https://sycamore-rs.netlify.app
MIT License
2.79k stars 148 forks source link

Use fully qualified method calls in macro for bound signals #499

Closed danielalvsaaker closed 1 year ago

danielalvsaaker commented 1 year ago

These changes effectively improve compiler suggestions to suggest meaningful types when an invalid type is bound.

The following snippet shows the resulting compiler suggestion:

error[E0308]: mismatched types
   --> examples/hello-world/src/main.rs:5:5
    |
5   | /     view! { cx,
6   | |         p {
7   | |             input(bind:checked=false)
8   | |             "Hello World!"
9   | |         }
10  | |     }
    | |     ^
    | |     |
    | |_____expected struct `Signal`, found `bool`
    |       arguments to this function are incorrect
    |
    = note: expected reference `&Signal<bool>`
               found reference `&bool`

Closes #498 .

codecov[bot] commented 1 year ago

Codecov Report

Base: 64.63% // Head: 64.65% // Increases project coverage by +0.02% :tada:

Coverage data is based on head (e780ae2) compared to base (8326aa6). Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #499 +/- ## ========================================== + Coverage 64.63% 64.65% +0.02% ========================================== Files 52 52 Lines 8519 8525 +6 ========================================== + Hits 5506 5512 +6 Misses 3013 3013 ``` | [Impacted Files](https://codecov.io/gh/sycamore-rs/sycamore/pull/499?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=sycamore-rs) | Coverage Δ | | |---|---|---| | [packages/sycamore-macro/src/view/codegen.rs](https://codecov.io/gh/sycamore-rs/sycamore/pull/499/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=sycamore-rs#diff-cGFja2FnZXMvc3ljYW1vcmUtbWFjcm8vc3JjL3ZpZXcvY29kZWdlbi5ycw==) | `97.43% <100.00%> (+0.03%)` | :arrow_up: | Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=sycamore-rs). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=sycamore-rs)

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

lukechu10 commented 1 year ago

Thanks!