# Verse compiler mistreats ToString(:logic) as ToString(:\[\]char)

**URL:** <https://forums.unrealengine.com/t/verse-compiler-mistreats-tostring-logic-as-tostring-char/2013450>\
**Category:** Issues and Bug Reporting\
**Tags:** unreal-editor-for-fortnite, Status-ReadyForQA, fortnite-creative, Code, fortnite\
**Created:** [September 9, 2024, 4:14pm UTC](https://forums.unrealengine.com/t/verse-compiler-mistreats-tostring-logic-as-tostring-char/2013450 "2024-09-09T16:14:17Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mephistia](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/mephistia/32/1032782_2.png) [@Mephistia](https://forums.unrealengine.com/u/Mephistia)\
**Post date:** [September 9, 2024, 4:14pm UTC](https://forums.unrealengine.com/t/verse-compiler-mistreats-tostring-logic-as-tostring-char/2013450/1 "2024-09-09T16:14:18Z")

</div>

### Summary

I have a simple function `ToString(Val:logic) : string = if (Val?). "true" else "false"` that I’d like to use to cast a logic value to a string (since Verse doesn’t do it by itself), but the compiler throws the following error:

“The function (/theuser@fortnite.com/TheProject:)ToString(:logic) in package TheProject is ambiguous with this definition:  
function (/Verse.org/Verse:)ToString(:char) in package Verse(3532)”

I was able to make a similar function that received an enum and it didn’t complain.

I didn’t find a `ToString(:[]char)` function in the Verse.digest file, although I found the same named function for a single char, string, int or float value.

The reason I want this to work is that I want to be able to write `Print("Value is {LogicVar}")`, as it did work with the enum value, and because writing `Print("Value is {LogicVar.ToString()}")` seems out of pattern and unnecessary long (if we account that the autocomplete for Verse in VSCode doesn’t work at all)

### Please select what you are reporting on:

Verse

### What Type of Bug are you experiencing?

Verse

### Steps to Reproduce

1. Create a global function like this: `ToString(Val:logic) : string = if (Val?). "true" else "false"`
2. Wait for the compiler to evaluate the code, or go to UEFN and hit Verse \> Build Verse Code (Ctrl+Shift+B)

### Expected Result

The compiler will identify that the type of the parameter is `logic` and not `[]char`, and will not throw any errors.

### Observed Result

The compiler throws an error.

### Platform(s)

PC

---

<div class="post-metadata">

**Author:** ![Mephistia](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/mephistia/32/1032782_2.png) [@Mephistia](https://forums.unrealengine.com/u/Mephistia)\
**Post date:** [September 9, 2024, 6:38pm UTC](https://forums.unrealengine.com/t/verse-compiler-mistreats-tostring-logic-as-tostring-char/2013450/3 "2024-09-09T18:38:17Z")

</div>

Hey @Jimbohalo10,

In my function, `logic` is used as the type:

```auto
ToString(Val:logic) : string = if (Val?). "true" else "false"

```

---

<div class="post-metadata">

**Author:** ![smack](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/smack/32/1219598_2.png) [@smack](https://forums.unrealengine.com/u/smack)\
**Post date:** [November 19, 2026, 12:22pm UTC](https://forums.unrealengine.com/t/verse-compiler-mistreats-tostring-logic-as-tostring-char/2013450/5 "2026-11-19T12:22:06Z")

</div>

2 years later, bug created 🤨

---

<div class="post-metadata">

**Author:** ![Sprintermax](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/sprintermax/32/1037175_2.png) [@Sprintermax](https://forums.unrealengine.com/u/Sprintermax)\
**Post date:** [November 19, 2026, 1:47pm UTC](https://forums.unrealengine.com/t/verse-compiler-mistreats-tostring-logic-as-tostring-char/2013450/6 "2026-11-19T13:47:31Z")

</div>

That’s normal, it has no way to know if when you give `false` is a logic value or if is an empty array, so it is ambiguous and that’s correct

---

<div class="post-metadata">

**Author:** ![Ep8Script](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/ep8script/32/1170494_2.png) [@Ep8Script](https://forums.unrealengine.com/u/Ep8Script)\
**Post date:** [November 19, 2026, 1:54pm UTC](https://forums.unrealengine.com/t/verse-compiler-mistreats-tostring-logic-as-tostring-char/2013450/7 "2026-11-19T13:54:56Z")

</div>

Even with the change to `false`being `:true` by default, you can still make a `ToString(:logic)` that works with either qualification or optional params, the only case it has an error is passing `false` in directly to `"{false}"` (which is a regression)

---

<div class="post-metadata">

**Author:** ![saamyjoon](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/saamyjoon/32/924320_2.png) [@saamyjoon](https://forums.unrealengine.com/u/saamyjoon)\
**Post date:** [November 19, 2026, 7:54pm UTC](https://forums.unrealengine.com/t/verse-compiler-mistreats-tostring-logic-as-tostring-char/2013450/9 "2026-11-19T19:54:44Z")

</div>

This is by design because `false` is the same as `array{}`, and Verse doesn’t allow ambiguity in overloads.

---

<div class="post-metadata">

**Author:** ![Bug-Reporter](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/bug-reporter/32/1223650_2.png) [@Bug-Reporter](https://forums.unrealengine.com/u/Bug-Reporter)\
**Post date:** [November 19, 2026, 8:00pm UTC](https://forums.unrealengine.com/t/verse-compiler-mistreats-tostring-logic-as-tostring-char/2013450/10 "2026-11-19T20:00:21Z")

</div>

FORT-1199963’s status has changed to ‘Ready for QA’. A member of the QA department is investigating the issue.
