0271003c33
This is another step towards removing parseType and improving recovery. Change-Id: Ie2cb1999406bc603355015e8a3b9aaa854f785db Reviewed-on: https://dart-review.googlesource.com/56120 Commit-Queue: Dan Rubel <danrubel@google.com> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
103 lines
4.2 KiB
Plaintext
103 lines
4.2 KiB
Plaintext
library;
|
|
import self as self;
|
|
import "dart:core" as core;
|
|
|
|
class T extends core::Object {
|
|
synthetic constructor •() → void
|
|
: super core::Object::•()
|
|
;
|
|
}
|
|
class V extends core::Object {
|
|
synthetic constructor •() → void
|
|
: super core::Object::•()
|
|
;
|
|
}
|
|
static const field dynamic #errors = const <dynamic>["pkg/front_end/testcases/named_function_scope.dart:28:48: Error: A function expression can't have a name.
|
|
var x = /*@error=NamedFunctionExpression*/ T() {};
|
|
^", "pkg/front_end/testcases/named_function_scope.dart:48:9: Error: A function expression can't have a name.
|
|
T() {};
|
|
^", "pkg/front_end/testcases/named_function_scope.dart:62:9: Error: A function expression can't have a name.
|
|
T< /*@context=DuplicatedNameCause*/ T>() {};
|
|
^", "pkg/front_end/testcases/named_function_scope.dart:83:32: Error: 'T' isn't a type.
|
|
void T(/*@error=NotAType*/ T t) {}
|
|
^"]/* from null */;
|
|
static method test() → dynamic {
|
|
self::T t;
|
|
self::V v;
|
|
{
|
|
function T() → core::Null {}
|
|
}
|
|
{
|
|
dynamic v;
|
|
}
|
|
{
|
|
self::T t;
|
|
() → core::Null x = let final () → core::Null T = () → core::Null {} in T;
|
|
}
|
|
{
|
|
self::V v;
|
|
dynamic V = invalid-expression "pkg/front_end/testcases/named_function_scope.dart:33:49: Error: Can't declare 'V' because it was already used in this scope.
|
|
var /*@error=DuplicatedNamePreviouslyUsed*/ V;
|
|
^";
|
|
}
|
|
{
|
|
self::V v;
|
|
dynamic V = let final dynamic #t1 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/named_function_scope.dart:38:49: Error: Can't declare 'V' because it was already used in this scope.
|
|
var /*@error=DuplicatedNamePreviouslyUsed*/ V = null;
|
|
^" in let final<BottomType> #t2 = null in null;
|
|
}
|
|
{
|
|
dynamic x = let final dynamic #t3 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/named_function_scope.dart:48:9: Error: Can't declare 'T' because it was already used in this scope.
|
|
T() {};
|
|
^" in let final () → self::T T = () → self::T {} in T;
|
|
}
|
|
{
|
|
self::V V = invalid-expression "pkg/front_end/testcases/named_function_scope.dart:54:47: Error: Can't declare 'V' because it was already used in this scope.
|
|
V /*@error=DuplicatedNamePreviouslyUsed*/ V;
|
|
^" as{TypeError} self::V;
|
|
}
|
|
{
|
|
dynamic x = let final dynamic #t4 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/named_function_scope.dart:62:9: Error: 'T' is already declared in this scope.
|
|
T< /*@context=DuplicatedNameCause*/ T>() {};
|
|
^" in let final <T extends core::Object = dynamic>() → dynamic T = <T extends core::Object = dynamic>() → dynamic {} in T;
|
|
}
|
|
{
|
|
self::T t;
|
|
{
|
|
invalid-expression "pkg/front_end/testcases/named_function_scope.dart:67:47: Error: Can't declare 'T' because it was already used in this scope.
|
|
T /*@error=DuplicatedNamePreviouslyUsed*/ T() {}
|
|
^";
|
|
function T() → self::T {}
|
|
}
|
|
}
|
|
{
|
|
{
|
|
invalid-expression "pkg/front_end/testcases/named_function_scope.dart:71:47: Error: Can't declare 'T' because it was already used in this scope.
|
|
T /*@error=DuplicatedNamePreviouslyUsed*/ T() {}
|
|
^";
|
|
function T() → self::T {}
|
|
}
|
|
}
|
|
{
|
|
self::T t;
|
|
{
|
|
invalid-expression "pkg/front_end/testcases/named_function_scope.dart:76:47: Error: Can't declare 'T' because it was already used in this scope.
|
|
T /*@error=DuplicatedNamePreviouslyUsed*/ T(T t) {}
|
|
^";
|
|
function T(self::T t) → self::T {}
|
|
}
|
|
}
|
|
{
|
|
{
|
|
invalid-expression "pkg/front_end/testcases/named_function_scope.dart:80:47: Error: Can't declare 'T' because it was already used in this scope.
|
|
T /*@error=DuplicatedNamePreviouslyUsed*/ T(T t) {}
|
|
^";
|
|
function T(self::T t) → self::T {}
|
|
}
|
|
}
|
|
{
|
|
function T(invalid-type t) → void {}
|
|
}
|
|
}
|
|
static method main() → void {}
|