# Major - Switch device functions yielding the wrong types

**URL:** <https://forums.unrealengine.com/t/major-switch-device-functions-yielding-the-wrong-types/791175>\
**Category:** Verse\
**Tags:** unreal-editor-for-fortnite, fortnite\
**Created:** [March 15, 2023, 9:10am UTC](https://forums.unrealengine.com/t/major-switch-device-functions-yielding-the-wrong-types/791175 "2023-03-15T09:10:35Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![UltimateLambda](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/ultimatelambda/32/916183_2.png) [@UltimateLambda](https://forums.unrealengine.com/u/UltimateLambda)\
**Post date:** [March 15, 2023, 5:58pm UTC](https://forums.unrealengine.com/t/major-switch-device-functions-yielding-the-wrong-types/791175/2 "2023-03-15T17:58:57Z")

</div>

In the case of `GetCurrentState`, the `decides` effect is used, rather than returning `logic`. To have your code work, you would need to update it to

```auto
if (not Switch.GetCurrentState[Agent]):
    Print("meow")
else if (Switch.GetCurrentState[Agent]):
    Print("meow")

```

`GetCurrentState` will `fail` (rather than return `false`) or succeed (rather than return `true`).

Related to use of `tuple()` with `listenable`: this is to indicate `Await` (a method of the superinterface `awaitable`) produces value `()` - note `()` is a value with type `tuple()` - and to indicate `Subscribe` of superinterface `subscribable` must be passed a function matching `type{_():void}` (a callback with a `()` passed as argument). For its use on `IfOnWhenCheckedEvent` and `IfOffWhenCheckedEvent`: this means these events, when signaled, provide no information short of the fact they were signaled.

---

_[View the full topic](https://forums.unrealengine.com/t/major-switch-device-functions-yielding-the-wrong-types/791175)._
