blob: 3cd9b8fcf032f66c77a7fd7673d5046b86ba608d [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.
// SharedOptions=--enable-experiment=non-nullable
import 'dart:core';
import 'dart:core' as core;
void f() {}
main() {
// The grammar for types does not allow multiple successive ? operators on a
// type. Note: we test both with and without a space between `?`s because the
// scanner treats `??` as a single token.
int?? x1 = 0; //# 01: compile-time error
core.int?? x2 = 0; //# 02: compile-time error
List<int>?? x3 = <int>[]; //# 03: compile-time error
void Function()?? x4 = f; //# 04: compile-time error
int? ? x5 = 0; //# 05: compile-time error
core.int? ? x6 = 0; //# 06: compile-time error
List<int>? ? x7 = <int>[]; //# 07: compile-time error
void Function()? ? x4 = f; //# 08: compile-time error
}