Critical - Case expressions in a function that has return type array

Please select what you are reporting on:

Verse

What Type of Bug are you experiencing?

Verse

Summary

A case expression that doesn’t have all it’s cases will crash your Verse language server in VSCode. Building the script with this case expression will then break your game/crash your game on open until the script is fixed/removed.

Steps to Reproduce

Did the following tests and it looks like it happens in a function that has the return type array, these were my results:

Gives error as expected:

Test(): void =
    Integer : int = 0
    case(Integer):
        0 =>
            Print("")

Gives no error (probably due to decides) but doesnt crash:

Test()<decides> : void =
    Integer : int = 0
    case(Integer):
        0 =>
            Print("")

Gives no error (probably due to decides) but doesnt crash:

Test()<decides> : int =
    Integer : int = 0
    case(Integer):
        0 =>
            return Integer

Gives error as expected:

Test() : int =
    Integer : int = 0
    case(Integer):
       0 =>
           return Integer

Gives error as expected:

Test() : []int =
    Integer : int = 0
    case(Integer):
        0 =>
            return array{}

No error and doesnt crash.

Test()<decides> : []int =
    Integer : int = 0
    case(Integer):
        0 =>
            return array{5}

Crashes your Verse language server in VSCode and will crash your game when not fixed:

Test()<decides> : []int =
   Integer : int = 0
   case(Integer):
        0 =>
           return array{}

Expected Result

Should not crash the Verse language server since the programmer has no clue that this is causing an issue.

Observed Result

Crashes your Verse language server in VSCode and will crash your game on start when the Verse code is build. Oddly enough this only happens when we return an empty array/array with a generic type (let’s say it returns the result from a Slice expression).

Platform(s)

UEFN