Skip to content

Generic components with lower case type: "expected a valid html element" #1737

@lukechu10

Description

@lukechu10

Problem

When using a generic component with a type param in lower case, there is an "expected a valid html element" error.

Steps To Reproduce
The following code does not parse

html! {
    <Test<bool>>
        // something
    </Test<bool>>
}

Edit: it seems like there is only an error when the generic type is in lowercase (e.g. bool). PascalCased types don't seem to cause any problem.

Expected behavior
Should parse correctly.

Screenshots
image

Environment:

  • Yew version: master (b694865)
  • Rust version: 1.49 (stable)
  • Target, if relevant: wasm32-unknown-unknown
  • Build tool, if relevant: trunk
  • OS, if relevant: windows 10

Questionnaire

  • I'm interested in fixing this myself but don't know where to start
  • I would like to fix and I have a solution
  • I don't have time to fix this right now, but maybe later

I do have some experience with parsing but none with writing proc macros.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugmacroIssues relating to our procedural or declarative macros

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions