2015-08-20 14:32:34 +00:00
|
|
|
// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
|
|
|
|
// for details. All rights reserved. Use of this source code is governed by a
|
|
|
|
// BSD-style license that can be found in the LICENSE file.
|
|
|
|
|
2020-03-21 16:12:36 +00:00
|
|
|
// @dart = 2.7
|
|
|
|
|
2015-08-20 14:32:34 +00:00
|
|
|
/// Regression for #24135: inference was not tracking `[]??=` correctly.
|
2021-02-04 23:11:32 +00:00
|
|
|
library web_2.if_null3_test;
|
2015-08-20 14:32:34 +00:00
|
|
|
|
|
|
|
import "package:expect/expect.dart";
|
|
|
|
|
|
|
|
void main() {
|
|
|
|
var map;
|
|
|
|
(((map ??= {})['key1'] ??= {})['key2'] ??= {})['key3'] = 'value';
|
|
|
|
Expect.equals('{key1: {key2: {key3: value}}}', '$map');
|
|
|
|
}
|