# UEFN - editor crash when Verse script for a nested parametric type

**URL:** <https://forums.unrealengine.com/t/uefn-editor-crash-when-verse-script-for-a-nested-parametric-type/1148333>\
**Category:** Issues and Bug Reporting\
**Tags:** unreal-editor-for-fortnite, crash, fortnite-creative, fortnite\
**Created:** [April 29, 2023, 10:04am UTC](https://forums.unrealengine.com/t/uefn-editor-crash-when-verse-script-for-a-nested-parametric-type/1148333 "2023-04-29T10:04:03Z")\
**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:** [April 29, 2023, 10:04am UTC](https://forums.unrealengine.com/t/uefn-editor-crash-when-verse-script-for-a-nested-parametric-type/1148333/1 "2023-04-29T10:04:03Z")

</div>

when I build the following code and build on UEFN, so UEFN crashed.

```auto
using { /Fortnite.com/Devices }
using { /Verse.org/Simulation }
using { /UnrealEngine.com/Temporary/Diagnostics }

class4(t : type) := class:
    Property : ?t

    Flatten(X:?class4(t2) where t2:type):?t2 =
        if (Y := X):
            Y.Property
        else:
            false

hello_world_device := class(creative_device):
    OnBegin<override>()<suspends>:void=
        X := class4(int){Property := option{1}}
        Flatten(option{X}) = X.Property

```

This code is a modification of what was in the documentation so that it can be built.

> **[Parametric Types](https://dev.epicgames.com/documentation/en-us/uefn/parametric-types-in-verse)**
>
> Use parametric types as explicit type arguments to classes or functions, or as implicit type arguments to functions.

At the time I wrote the above code, I received an error message on VSCode as shown in the image  
 ![0429_2](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/e/2/1e298fa20d3c34f82e7dbd28584173bdb50d7db4.png)

---

<div class="post-metadata">

**Author:** ![AndrewScheidecker](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/andrewscheidecker/32/926976_2.png) [@AndrewScheidecker](https://forums.unrealengine.com/u/AndrewScheidecker)\
**Post date:** [May 8, 2023, 10:59am UTC](https://forums.unrealengine.com/t/uefn-editor-crash-when-verse-script-for-a-nested-parametric-type/1148333/2 "2023-05-08T10:59:36Z")

</div>

Thanks for the report; I’ve reproduced the crash and filed a bug.

The problem is due to the Flatten function being a member of class4. In the example in the docs, it is a module-scoped function, and the compiler doesn’t crash for that. I recommend doing that until we are able to fix the bug.

---

<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:** [May 8, 2023, 2:13pm UTC](https://forums.unrealengine.com/t/uefn-editor-crash-when-verse-script-for-a-nested-parametric-type/1148333/3 "2023-05-08T14:13:23Z")

</div>

I checked that code and understood it. Thank you very much.
