# A void call in For filter can't compile

**URL:** <https://forums.unrealengine.com/t/a-void-call-in-for-filter-cant-compile/1321177>\
**Category:** Issues and Bug Reporting\
**Tags:** unreal-editor-for-fortnite, fortnite-creative, fortnite\
**Created:** [October 3, 2023, 2:57pm UTC](https://forums.unrealengine.com/t/a-void-call-in-for-filter-cant-compile/1321177 "2023-10-03T14:57:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![t.tutiya](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/t.tutiya/32/924637_2.png) [@t.tutiya](https://forums.unrealengine.com/u/t.tutiya)\
**Post date:** [October 3, 2023, 2:57pm UTC](https://forums.unrealengine.com/t/a-void-call-in-for-filter-cant-compile/1321177/1 "2023-10-03T14:57:35Z")

</div>

### Reference ID

b584484a-4497-4e2b-5e8a-e89c4b6c5bae

### Please select what you are reporting on:

Creative

### What Type of Bug are you experiencing?

Verse

### Summary

In Verse, A void call in `For` filter can’t compile

### Steps to Reproduce

Code

```auto
test_device := class(creative_device):
    IncrementSomeVariable()<transacts>:int = 1

    OnBegin<override>()<suspends>:void=
        if:
            1=1
            S := IncrementSomeVariable() #OK
            IncrementSomeVariable() #OK
        then:
            
        for:
            X := 0..1
            S := IncrementSomeVariable() #OK
            IncrementSomeVariable() #Compile Error "Expected an expression that can fail in the 'for' filter expression"
        do:        

```

### Expected Result

All expressions can compile.

### Observed Result

Only void call in `For` filter can’t compile.

### Platform(s)

windows

---

<div class="post-metadata">

**Author:** ![t.tutiya](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/t.tutiya/32/924637_2.png) [@t.tutiya](https://forums.unrealengine.com/u/t.tutiya)\
**Post date:** [October 15, 2023, 8:00am UTC](https://forums.unrealengine.com/t/a-void-call-in-for-filter-cant-compile/1321177/2 "2023-10-15T08:00:44Z")

</div>

Additional Information.  
If `IncrementSomeVariable()` is changed to failable function, compiled successfully

```auto
    #Change to failable function
    IncrementSomeVariable()<transacts><decides>:int = 1

    OnBegin<override>()<suspends>:void=
        if:
            1=1
            S := IncrementSomeVariable[] #OK
            IncrementSomeVariable[] #OK
        then:
            
        for:
            X := 0..1
            S := IncrementSomeVariable[] #OK
            IncrementSomeVariable[] #OK!!!!!!!!!!!!!!!
        do:        

```

---

<div class="post-metadata">

**Author:** ![t.tutiya](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/t.tutiya/32/924637_2.png) [@t.tutiya](https://forums.unrealengine.com/u/t.tutiya)\
**Post date:** [April 17, 2024, 7:19am UTC](https://forums.unrealengine.com/t/a-void-call-in-for-filter-cant-compile/1321177/3 "2024-04-17T07:19:42Z")

</div>

From: Ask Epic : Verse

> [@Ask Epic: Verse - March 28 @ 10:00 AM ET](https://forums.unrealengine.com/t/ask-epic-verse-march-28-10-00-am-et/1765393/101):
>
> No good reason. This is a bug related to how for syntax is currently pattern-matched, rather than evaluated in the way MaxVerse describes.

> No good reason. This is a bug related to how `for` syntax is currently pattern-matched, rather than evaluated in the way MaxVerse describes.
