Skip to content

Structs get assigned by reference #54

@monstermichl

Description

@monstermichl

Structs get assigned by reference but should be assigned by value.

type myStruct struct {
	a string
}

x := myStruct{a:"x"}
print(x.a)
y := x
print(y.a)
y.a = "y"
print(x.a)

Current behaviour

x
x
y

Correct behaviour

x
x
x

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions