Description of the bug:
Hello,
The following code doesn't work and I cannot initialize a variable of type choice:
choice VehicleType {
Bike,
Car,
Bus
}
var my_vehicle : VehicleType = VehicleType.Car;
What did you do, or what's a simple way to reproduce the bug?
Compile the following code with the latest toolchain:
import Core library "io";
import Core library "range";
fn Run() -> i32 {
choice VehicleType {
Bike,
Car,
Bus
}
var my_vehicle : VehicleType = VehicleType.Car;
return 0;
}
What did you expect to happen?
Initialize a variable of type choice / sum type.
What actually happened?
I get the following errors:
error: cannot copy value of type `VehicleType`
<09>var my_vehicle : VehicleType = VehicleType.Car;
^~~~~~~~~~~~~~~
note: type `VehicleType` does not implement interface `Core.Copy`
<09>var my_vehicle : VehicleType = VehicleType.Car;
Any other information, logs, or outputs that you want to share?
None
Description of the bug:
Hello,
The following code doesn't work and I cannot initialize a variable of type choice:
choice VehicleType { Bike, Car, Bus } var my_vehicle : VehicleType = VehicleType.Car;What did you do, or what's a simple way to reproduce the bug?
Compile the following code with the latest toolchain:
What did you expect to happen?
Initialize a variable of type
choice/ sum type.What actually happened?
I get the following errors:
Any other information, logs, or outputs that you want to share?
None