Skip to content

CSSStyleVariable APIs allow setting values of the wrong type #2763

@bitspittle

Description

@bitspittle

Simple example code to demonstrate the problem (here, setting a LineStyle variable with a DisplayStyle value):

val unexpectedVariableAssignment by variable<LineStyle>()

@Composable
fun demoUnexpectedVariableAssignment() {
    Div(attrs = {
        style { 
            unexpectedVariableAssignment(DisplayStyle.Flex)
        }
    })
}

Expected: The line unexpectedVariableAssignment(DisplayStyle.Flex) should not compile

Actual: The code compiles and runs fine.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions