glug icon indicating copy to clipboard operation
glug copied to clipboard

Enforce match branch uniqueness

Open pnorman opened this issue 5 months ago • 0 comments

Each branch of a match function must be distinct. This could be enforced by glug, which would avoid run-time errors with the style.

A trivial example is

layer(:test, :source=>:spirit, :source_layer=>:"water-lines") {
    line_width match(waterway,
        "foo", 1,
        "foo", 2,
        3
    )
}

This will cause an error like

Error: layers[9].paint.line-width[4]: Branch labels must be unique.

pnorman avatar Jul 08 '25 16:07 pnorman