blob: 76bb4902611e44418669e0323c9dbec8a4eca30b [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.
import 'package:expect/expect.dart' show Expect;
import 'package:kernel/testing/type_parser.dart';
testParse(String text) {
Expect.stringEquals(text.trim(), "${parse(text).join('\n')}");
}
main() {
testParse("""
() ->* void
() ->? void
() -> void
(int) -> dynamic
([int]) -> int
({double parameter}) -> int
(num, [int]) -> int
(num, {double parameter}) -> int
(num, {required double parameter}) -> int
class Object;
class Comparable<T>;
class num implements Comparable<num>;
class int extends num;
class double extends num;
class Function;
class Iterable<E>;
class EfficientLength;
class List<E> implements Iterable<E>, EfficientLength;
class Intersection implements Comparable<int>, Comparable<double>;
typedef OtherObject Object;
typedef MyList<T> List<T>;
typedef StringList List<String>;
typedef VoidFunction () -> void;
typedef GenericFunction<T> () -> T;
List<List<Object>>
List<List<List<Object>>>
class A<T extends List<Object>>;
class B<T extends List<List<Object>>>;
<E>(E) -> int
S & T
class C;
<E>(E) -> int & <E>(E) -> void
C*
C?
C
A<C>*
A<C>?
A<C>
A<C*>
A<C?>
A<C>
<T extends bool>(T) -> void
""");
}