Better HN
topnewbestaskshowjobs
Log inSign up

stereotype441

4 karma · joined Feb 22, 2022 (4y ago) · 2 submissions

Submissions

comment 4y ago · link · parent

Thanks for the bug report! For anyone else who is following along, the issue is tracked here: https://github.com/dart-lang/sdk/issues/48460

comment 4y ago · link · parent

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. (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)