Skip to content

Cannot concat assign null string. #566

@nickl-

Description

@nickl-

When trying to use += on a null string an error occurs.

bsh % String s;
--> $0 = null :null
bsh % s += "1";
// Error: Evaluation Error: Non primitive value in operator: class bsh.Primitive "+" class java.lang.String : at Line: 2 : in file: <unknown file> : s += "1"

Expected result:
The null string should be converted to a string value "null", as per Java, before concatenation.

bsh % String s;
--> $0 = null :null
bsh % s += "1";
--> $2 = "null1" :String

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions