def test_computed_var_type_compatibility():
    """Test that different ComputedVar are compatible with Var annotations of their returned type."""

    class ComputedVarTypeState(BaseState):
        @computed_var
        def sync_plain(self) -> str:
            return "Hello"

        @computed_var(initial_value="Test")
        def sync_wrapper(self) -> str:
            return "World"

        @computed_var
        async def async_plain(self) -> str:
            return "Hello"

        @computed_var(initial_value="Test")
        async def async_wrapper(self) -> str:
            return "World"

    # All of these vars should be assignable to a str field statically.
    rx.input(placeholder=ComputedVarTypeState.sync_plain)
    rx.input(placeholder=ComputedVarTypeState.sync_wrapper)
    rx.input(placeholder=ComputedVarTypeState.async_plain)
    rx.input(placeholder=ComputedVarTypeState.async_wrapper)
Test that different ComputedVar are compatible with Var annotations of their returned type.
tests/units/test_var.py