4 ms·
Hi! I'm one of the developers of Dart, and I just tried to reproduce your bug. Here's what I tried: int? f(bool b, Map<String, int> c, int d, int e) {
by stereotype441 5y ago
Hi!
I'm one of the developers of Dart, and I just tried to reproduce your bug. Here's what I tried:
int? f(bool b, Map<String, int> c, int d, int e) {
int? a;
a = b ? c["${d}"] : e;
return a;
}
main() {
print(f(true, {'1': 10}, 1, 20));
print(f(false, {'1': 10}, 1, 20));
}
This program analyzes and runs cleanly for me, with no need for extra parentheses.
Can you say more about what you were trying to do when you ran into this bug? Ideally file an issue at https://github.com/dart-lang/sdk/issues/new https://github.com/dart-lang/sdk/issues/new. (We really do read and respond to them, and if you find a bug in the grammar, there's a good chance I'll be the one to fix it!)
Paul (https://github.com/stereotype441 https://github.com/stereotype441)
- quadcore 5y agoPaul? clientTable?["seat${seat}Pot"] += clientTable?["seat${seat}Front"] + (clientTable?["bettingRound"] == 1 ? (clientTable?["seat${seat}Dead"]) : 0); compiles clientTable?["seat${seat}Pot"] += clientTable?["seat${seat}Front"] + (clientTable?["bettingRound"] == 1 ? clientTable?["seat${seat}Dead"] : 0); doesnt good luck fixing this :)
- stereotype441 5y agoThanks for the bug report! For anyone else who is following along, the issue is tracked here: https://github.com/dart-lang/sdk/issues/48460 https://github.com/dart-lang/sdk/issues/48460
- quadcore 5y agoInteresting. I ran into it on multiple occasions, I'll reproduce it on my end and file a bug tomorrow :)