We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
string
null
protected final function getSpecial(int special) -> string { string suffix = ""; switch special { case 1: let suffix = "alpha"; break; case 2: let suffix = "beta"; break; case 3: let suffix = "RC"; break; } return suffix; }
The above returns null when special is other than 1, 2 or 3. If a default clause is added to the switch it makes no difference.
special
1
2
3
default
switch
Also adding
let suffix = "";
has no effect.
If the variable is changed to var suffix then the code works (i.e. you get an empty string if special is 4)
var suffix
The text was updated successfully, but these errors were encountered:
Jeckerson
No branches or pull requests
The above returns
null
whenspecial
is other than1
,2
or3
. If adefault
clause is added to theswitch
it makes no difference.Also adding
has no effect.
If the variable is changed to
var suffix
then the code works (i.e. you get an empty string ifspecial
is 4)The text was updated successfully, but these errors were encountered: