agorapp-dao / agorapp-feedback

Place for users to report bugs, propose features, etc.
0 stars 0 forks source link

motoko-tutorial/variants - feedback #1

Open GeorgeKoller opened 11 months ago

GeorgeKoller commented 11 months ago

Problem:

Describe your problem and steps to reproduce it.

My code:

import D "mo:base/Debug";
import Text "mo:base/Text";
import Nat8 "mo:base/Nat8";
import Float"mo:base/Float";

type Day = {#Sun; #Mon; #Tue; #Wed; #Thu; #Fri; #Sat;};

let day : Day = #Wed;

type Result = {
  #ok : Nat;
  #err : Text;
};

var resultOk : Result = #ok(42);
resultOk := #err("Wrongo!");

D.print("resultOk = " # debug_show(resultOk));

let resultErr : Result = #err("Something went wrong");
romario333 commented 11 months ago

Hello, can you please add the description of the problem and what would be the expected behavior?