Skip to content
New issue

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

Compiler doesn't calculate the value after match without braces. #13297

Open
NN--- opened this issue Aug 4, 2015 · 0 comments
Open

Compiler doesn't calculate the value after match without braces. #13297

NN--- opened this issue Aug 4, 2015 · 0 comments

Comments

@NN---
Copy link
Member

NN--- commented Aug 4, 2015

This one is dangerous , compilation succeeds but the result is incorrect.

using System.Console;

def t = match(true) { | true => 10 | _ => 0 } + 11111;
WriteLine(t);

def u = (match(true) { | true => 10 | _ => 0 } + 11111);
WriteLine(u);

WriteLine(match(true) { | true => 10 | _ => 0 } + 11111);

Output:

10
11121
11121
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant