4b7d256a06
This reverts commite9ca6a5335andd3e00fd35e. Change-Id: I346d6156be19c4fceffa202a7ce9bfa931c7c14b Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99560 Reviewed-by: Sigmund Cherem <sigmund@google.com> Reviewed-by: Vijay Menon <vsm@google.com> Reviewed-by: Siva Annamalai <asiva@google.com>
35 lines
1.3 KiB
Plaintext
35 lines
1.3 KiB
Plaintext
library;
|
|
//
|
|
// Problems in library:
|
|
//
|
|
// pkg/front_end/testcases/rasta/parser_error.dart:10:7: Error: Expected an identifier, but got '?'.
|
|
// if (?b) return b; /// 01: compile-time error
|
|
// ^
|
|
//
|
|
// pkg/front_end/testcases/rasta/parser_error.dart:10:9: Error: Expected ':' before this.
|
|
// if (?b) return b; /// 01: compile-time error
|
|
// ^
|
|
//
|
|
// pkg/front_end/testcases/rasta/parser_error.dart:10:9: Error: Expected an identifier, but got ')'.
|
|
// if (?b) return b; /// 01: compile-time error
|
|
// ^
|
|
//
|
|
import self as self;
|
|
import "dart:core" as core;
|
|
import "package:expect/expect.dart" as exp;
|
|
|
|
import "package:expect/expect.dart";
|
|
|
|
static method test(dynamic a, {dynamic b = null, dynamic c = null}) → core::int {
|
|
if((invalid-expression "pkg/front_end/testcases/rasta/parser_error.dart:10:7: Error: This couldn't be parsed.
|
|
if (?b) return b; /// 01: compile-time error
|
|
^" as{TypeError} core::bool ?{dynamic} b : invalid-expression "pkg/front_end/testcases/rasta/parser_error.dart:10:9: Error: This couldn't be parsed.
|
|
if (?b) return b; /// 01: compile-time error
|
|
^") as{TypeError} core::bool)
|
|
return b as{TypeError} core::int;
|
|
return a.+(b).+(c) as{TypeError} core::int;
|
|
}
|
|
static method main() → dynamic {
|
|
exp::Expect::equals(6, self::test(1, b: 2, c: 3));
|
|
}
|