I have this piece of code that returns an error
this pattern is never matched
There are two variables defined
let Get = "GET";
let Post = "POST";
I defined switch cases for both variables, but the first variable matches every text instead of the assigned text. This is an issue because it blocks the code from going to the other switch cases.
switch (method){
case (Get){
...
};
case (Post){ // this pattern is never matched
...
};
}
However, It works when I create switch cases with raw text instead of with variables.
switch (method){
case ("GET"){
...
};
case ("POST"){
...
};
}
Is this a bug, or was this the intended design choice for Motoko?