blob: 9b37be58c5a525e438884f83c3cf162a6b3fbd6c [file] [log] [blame]
// Copyright (c) 2019, 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.
// @dart = 2.9
/// @assertion To infer the type of element:
/// ...
/// If element is a spreadElement with expression e1:
/// ...
/// If P is Map<Pk, Pv> then let S be the inferred type of e1 in context P:
/// ...
/// If S is Null and the spread operator is ...?, then the key and value element
/// types are Null.
///
/// @description Checks that if S is Null and the spread operator is ...?, then
/// the key and value element types are Null
/// @author sgrekhov@unipro.ru
import "../../Utils/expect.dart";
Map<K, V> foo<K, V>(Map<K, V> s) => s;
main() {
Null x = null;
var m = foo({...?x});
Expect.isTrue(m is Map<Null, Null>);
}