# Verse - Bug about "false type"

**URL:** <https://forums.unrealengine.com/t/verse-bug-about-false-type/1182988>\
**Category:** Verse\
**Tags:** fortnite-creative, unreal-editor-for-fortnite, compile-error, fortnite\
**Created:** [May 30, 2023, 2:59am UTC](https://forums.unrealengine.com/t/verse-bug-about-false-type/1182988 "2023-05-30T02:59:53Z")\
**Posts on this page:** 6\
**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:** [May 30, 2023, 2:59am UTC](https://forums.unrealengine.com/t/verse-bug-about-false-type/1182988/1 "2023-05-30T02:59:54Z")

</div>

The following code will result in a compile error

```auto
func(:any) : false = false

```

```auto
This function returns a value of type false, but the function body's result is an incompatible value of type logic.(3510)

```

 ![0529_1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/0/9/10946fbd29e6b5bfad22b7260383a78b4528f3a2.png)

Possible bugs are one of the following

1: It is not a compile error even if “false” is written as the type of the variable.  
2: “false” cannot be stored in a variable of type false.

---

<div class="post-metadata">

**Author:** ![Mapshot\_Agency](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/mapshot_agency/32/700660_2.png) [@Mapshot\_Agency](https://forums.unrealengine.com/u/Mapshot_Agency)\
**Post date:** [May 30, 2023, 7:18am UTC](https://forums.unrealengine.com/t/verse-bug-about-false-type/1182988/2 "2023-05-30T07:18:27Z")

</div>

Is " false" a type?  
I thought the type was “logic” which can be true/false. So if you change it to

```auto
func(:any) : logic = false

```

That shouldn’t return errors.

---

<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 30, 2023, 7:37am UTC](https://forums.unrealengine.com/t/verse-bug-about-false-type/1182988/3 "2023-05-30T07:37:42Z")

</div>

Thank you very much.  
Yes, you are right, the type of the variable should be “logic”.  
However, specifying “false” as the type of the variable does not cause a compile error. The error message also says “type false”.  
I wanted to know if this is a compiler bug or not.

See also.

> [@Ask Epic Anything: Programming & Scripting | May 24th, 2023 at 12:30PM EST](https://forums.unrealengine.com/t/ask-epic-anything-programming-scripting-may-24th-2023-at-12-30pm-est/1168968/89):
>
> Yes there is a Verse BNF - we probably just need to clean it up and remove the future plans from what is currently present before we can put it online in the Verse documentation. Technically yes - they are separate types in Verse. One of the hints is that true and false are both lowercase like other Verse type name conventions. They aren’t indicated that way in the docs currently though the typing in Verse is quite sophisticated and as this becomes more feature complete the docs will better r…

---

<div class="post-metadata">

**Author:** ![Mapshot\_Agency](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/mapshot_agency/32/700660_2.png) [@Mapshot\_Agency](https://forums.unrealengine.com/u/Mapshot_Agency)\
**Post date:** [May 30, 2023, 7:42am UTC](https://forums.unrealengine.com/t/verse-bug-about-false-type/1182988/4 "2023-05-30T07:42:24Z")

</div>

Thanks for the clarification! That’s interesting to check out indeed 😃

---

<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:** [June 2, 2023, 11:48am UTC](https://forums.unrealengine.com/t/verse-bug-about-false-type/1182988/5 "2023-06-02T11:48:58Z")

</div>

Apart from being a value of the type `logic`, `false` is also a type that has no possible values. As a return type, it indicates that the function doesn’t return a value. The only way to do this right now is using the `Err` function, which is defined as:

```auto
# Halts the Verse runtime with error `Message`.
Err(Message:string)<computes>:false

```

The reason why it’s valuable to have such a type with no possible values is that it’s a subtype of all other types, also known as the bottom type. You can use a value from `:false` without regard for what value is expected, and an expression like `or` or `if` that joins possible results from different branches into a single type can ignore unreachable branches. For example:

```auto
MaybeInt:?int=...
MyInt:int = MaybeInt? or Err("expected MaybeInt to be set")

```

The left-hand-side of the `or` yields a value from `:int`, and the right-hand-side of the `or` yields a value from `:false`. This means the combined expression will yield a value from the join `:int | :false`, but because `:false` has no possible values this simplifies to `:int`, and the compiler accepts binding the result to `MyInt:int`.

---

<div class="post-metadata">

**Author:** ![OB1\_canbeno](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@OB1\_canbeno](https://forums.unrealengine.com/u/OB1_canbeno)\
**Post date:** [June 2, 2023, 9:45pm UTC](https://forums.unrealengine.com/t/verse-bug-about-false-type/1182988/6 "2023-06-02T21:45:56Z")

</div>

I would think that someone in the Reasonable Names department would see that:

1. The bottom type could simply be “bottom”, and
2. Having a value and a type with the same name (false and false!) would lead to confusion and is unnecessary.

André
