Skip to content

Switch fallthrough not supported #920

@jonathangjertsen

Description

@jonathangjertsen

Describe the bug

Fallthrough statements in switch statements do not exist in the generated go file, instead it just outputs the string "fallthrough".

To Reproduce

package main

templ example(x int) {
	switch x {
        case 0:
            fallthrough
        case 1:
            <p>hey</p>
    }
}

Expected behavior

@example(0) should generate the output <p>hey</p>

templ info output

(✓) os [ goos=windows goarch=amd64 ]
(✓) go [ location=C:\Program Files\Go\bin\go.exe version=go version go1.22.0 windows/amd64 ]
(✓) gopls [ location=C:\Users\jrg\go\bin\gopls.exe version=golang.org/x/tools/gopls v0.16.2 ]
(✓) templ [ location=C:\Users\jrg\go\bin\templ.exe version=v0.2.771 ]

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions