Skip to content

Concatenating a String and a Boolean causes a fault in lua #40

@sispsp

Description

@sispsp

The following code writes a bool variable to the console which is concatenated with a string:

bool isActive = true;
System.Console.WriteLine("isActive: " + isActive);

It compiles to:

local isActive = true
System.Console.WriteLine("isActive: " .. isActive)

which causes an error in lua that the boolean value isActive cannot be concatenated. isActive should be wrapped with tostring() or System.toString(). Currently I am using boxing in C# as a workaround (Console.WriteLine("isActive: " + (object)isActive)) that compiles with System.toString() around isActive. I would prefer a solution without having to change the C# code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions