mirror of
https://github.com/dart-lang/sdk
synced 2024-09-16 00:09:49 +00:00
Revert "[fasta] Handle annotations on formals and variables"
This reverts commit 0289071afe
.
The reverted commit breaks precomp bots.
Change-Id: I3218d5a0779e1f30f4172ede2294be558ded2abd
Reviewed-on: https://dart-review.googlesource.com/52103
Reviewed-by: Jens Johansen <jensj@google.com>
This commit is contained in:
parent
f06118ef8f
commit
1f7fa3e1ad
|
@ -413,25 +413,27 @@ void main() {
|
|||
useAnnotations = false;
|
||||
});
|
||||
var imports = "import 'package:meta/meta.dart';";
|
||||
group('(previously known kernel annotation bug)', () {
|
||||
test('variable without initializer', () async {
|
||||
await expectNotNull(
|
||||
'$imports main() { @notNull var x; print(x); }', 'x');
|
||||
group('(kernel annotation bug)', () {
|
||||
test('variable wihout initializer', () async {
|
||||
await expectNotNull('$imports main() { @notNull var x; print(x); }',
|
||||
''); // should be: 'x'
|
||||
});
|
||||
test('variable with initializer', () async {
|
||||
// TODO(jmesserly): this does not work in the Analyzer backend.
|
||||
await expectNotNull(
|
||||
'$imports main() { @notNull var x = null; print(x); }', 'x');
|
||||
'$imports main() { @notNull var x = null; print(x); }',
|
||||
''); // should be: 'x'
|
||||
});
|
||||
test('parameters', () async {
|
||||
await expectNotNull(
|
||||
'$imports f(@notNull x, [@notNull y, @notNull z = 42]) '
|
||||
'{ x; y; z; }',
|
||||
'42, x, y, z');
|
||||
'42, z'); // should be: '42, x, y, z'
|
||||
});
|
||||
test('named parameters', () async {
|
||||
await expectNotNull(
|
||||
'$imports f({@notNull x, @notNull y: 42}) { x; y; }', '42, x, y');
|
||||
'$imports f({@notNull x, @notNull y: 42}) { x; y; }',
|
||||
'42, y'); // should be: '42, x, y'
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
@ -1664,14 +1664,7 @@ class BodyBuilder<Arguments> extends ScopeListener<JumpTarget>
|
|||
constantContext = pop();
|
||||
currentLocalVariableType = pop();
|
||||
currentLocalVariableModifiers = pop();
|
||||
List<Expression> annotations = pop();
|
||||
if (annotations != null) {
|
||||
for (VariableDeclaration variable in variables) {
|
||||
for (Expression annotation in annotations) {
|
||||
variable.addAnnotation(annotation);
|
||||
}
|
||||
}
|
||||
}
|
||||
pop(); // Metadata.
|
||||
if (variables.length != 1) {
|
||||
push(variables);
|
||||
} else {
|
||||
|
@ -2110,7 +2103,7 @@ class BodyBuilder<Arguments> extends ScopeListener<JumpTarget>
|
|||
}
|
||||
bool isConst = (modifiers & constMask) != 0;
|
||||
bool isFinal = (modifiers & finalMask) != 0;
|
||||
List annotations = pop();
|
||||
ignore(Unhandled.Metadata);
|
||||
VariableDeclaration variable;
|
||||
if (!inCatchClause &&
|
||||
functionNestingLevel == 0 &&
|
||||
|
@ -2138,14 +2131,6 @@ class BodyBuilder<Arguments> extends ScopeListener<JumpTarget>
|
|||
variable.fileOffset = offsetForToken(name.token);
|
||||
}
|
||||
}
|
||||
if (annotations != null) {
|
||||
if (functionNestingLevel == 0) {
|
||||
_typeInferrer.inferMetadata(this, annotations);
|
||||
}
|
||||
for (Expression annotation in annotations) {
|
||||
variable.addAnnotation(annotation);
|
||||
}
|
||||
}
|
||||
push(variable);
|
||||
}
|
||||
|
||||
|
@ -2928,9 +2913,8 @@ class BodyBuilder<Arguments> extends ScopeListener<JumpTarget>
|
|||
returnType ??= const DynamicType();
|
||||
exitFunction();
|
||||
List<TypeParameter> typeParameters = typeVariableBuildersToKernel(pop());
|
||||
List<Expression> annotations;
|
||||
if (!isFunctionExpression) {
|
||||
annotations = pop(); // Metadata.
|
||||
pop(); // Metadata.
|
||||
}
|
||||
FunctionNode function = formals.addToFunction(new FunctionNode(body,
|
||||
typeParameters: typeParameters,
|
||||
|
@ -2941,11 +2925,6 @@ class BodyBuilder<Arguments> extends ScopeListener<JumpTarget>
|
|||
|
||||
if (declaration is FunctionDeclaration) {
|
||||
VariableDeclaration variable = declaration.variable;
|
||||
if (annotations != null) {
|
||||
for (Expression annotation in annotations) {
|
||||
variable.addAnnotation(annotation);
|
||||
}
|
||||
}
|
||||
ShadowFunctionDeclaration.setHasImplicitReturnType(
|
||||
declaration, hasImplicitReturnType);
|
||||
|
||||
|
@ -3537,7 +3516,8 @@ class BodyBuilder<Arguments> extends ScopeListener<JumpTarget>
|
|||
debugEvent("TypeVariable");
|
||||
DartType bound = pop();
|
||||
Identifier name = pop();
|
||||
List<Expression> annotations = pop();
|
||||
// TODO(ahe): Do not discard metadata.
|
||||
pop(); // Metadata.
|
||||
KernelTypeVariableBuilder variable;
|
||||
Object inScope = scopeLookup(scope, name.name, token);
|
||||
if (inScope is TypeDeclarationAccessor) {
|
||||
|
@ -3549,12 +3529,6 @@ class BodyBuilder<Arguments> extends ScopeListener<JumpTarget>
|
|||
name.name, library, offsetForToken(name.token), null);
|
||||
}
|
||||
variable.parameter.bound = bound;
|
||||
if (annotations != null) {
|
||||
_typeInferrer.inferMetadata(this, annotations);
|
||||
for (Expression annotation in annotations) {
|
||||
variable.parameter.addAnnotation(annotation);
|
||||
}
|
||||
}
|
||||
push(variable..finish(library, library.loader.coreLibrary["Object"]));
|
||||
}
|
||||
|
||||
|
|
|
@ -877,7 +877,6 @@ class ShadowForInStatement extends ForInStatement implements ShadowStatement {
|
|||
}
|
||||
inferrer.inferStatement(body);
|
||||
if (_declaresVariable) {
|
||||
inferrer.inferMetadataKeepingHelper(variable.annotations);
|
||||
var tempVar =
|
||||
new VariableDeclaration(null, type: inferredType, isFinal: true);
|
||||
var variableGet = new VariableGet(tempVar)
|
||||
|
@ -940,7 +939,6 @@ class ShadowFunctionDeclaration extends FunctionDeclaration
|
|||
|
||||
@override
|
||||
void _inferStatement(ShadowTypeInferrer inferrer) {
|
||||
inferrer.inferMetadataKeepingHelper(variable.annotations);
|
||||
inferrer.inferLocalFunction(
|
||||
function,
|
||||
null,
|
||||
|
@ -2269,7 +2267,6 @@ class ShadowVariableDeclaration extends VariableDeclaration
|
|||
|
||||
@override
|
||||
void _inferStatement(ShadowTypeInferrer inferrer) {
|
||||
inferrer.inferMetadataKeepingHelper(annotations);
|
||||
var declaredType = _implicitlyTyped ? const UnknownType() : type;
|
||||
DartType inferredType;
|
||||
DartType initializerType;
|
||||
|
|
|
@ -336,10 +336,6 @@ abstract class TypeInferrer {
|
|||
/// Performs type inference on the given metadata annotations.
|
||||
void inferMetadata(BuilderHelper helper, List<Expression> annotations);
|
||||
|
||||
/// Performs type inference on the given metadata annotations keeping the
|
||||
/// existing helper if possible.
|
||||
void inferMetadataKeepingHelper(List<Expression> annotations);
|
||||
|
||||
/// Performs type inference on the given function parameter initializer
|
||||
/// expression.
|
||||
void inferParameterInitializer(
|
||||
|
@ -376,9 +372,6 @@ class TypeInferrerDisabled extends TypeInferrer {
|
|||
@override
|
||||
void inferMetadata(BuilderHelper helper, List<Expression> annotations) {}
|
||||
|
||||
@override
|
||||
void inferMetadataKeepingHelper(List<Expression> annotations) {}
|
||||
|
||||
@override
|
||||
void inferParameterInitializer(
|
||||
BuilderHelper helper, Expression initializer, DartType declaredType) {}
|
||||
|
@ -1103,7 +1096,6 @@ abstract class TypeInferrerImpl extends TypeInferrer {
|
|||
var positionalParameters = function.positionalParameters;
|
||||
for (var i = 0; i < positionalParameters.length; i++) {
|
||||
var parameter = positionalParameters[i];
|
||||
inferMetadataKeepingHelper(parameter.annotations);
|
||||
if (i >= function.requiredParameterCount &&
|
||||
parameter.initializer == null) {
|
||||
parameter.initializer = new ShadowNullLiteral()..parent = parameter;
|
||||
|
@ -1113,7 +1105,6 @@ abstract class TypeInferrerImpl extends TypeInferrer {
|
|||
}
|
||||
}
|
||||
for (var parameter in function.namedParameters) {
|
||||
inferMetadataKeepingHelper(parameter.annotations);
|
||||
if (parameter.initializer == null) {
|
||||
parameter.initializer = new ShadowNullLiteral()..parent = parameter;
|
||||
}
|
||||
|
@ -1244,14 +1235,6 @@ abstract class TypeInferrerImpl extends TypeInferrer {
|
|||
void inferMetadata(BuilderHelper helper, List<Expression> annotations) {
|
||||
if (annotations != null) {
|
||||
this.helper = helper;
|
||||
inferMetadataKeepingHelper(annotations);
|
||||
this.helper = null;
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
void inferMetadataKeepingHelper(List<Expression> annotations) {
|
||||
if (annotations != null) {
|
||||
// Place annotations in a temporary list literal so that they will have a
|
||||
// parent. This is necessary in case any of the annotations need to get
|
||||
// replaced during type inference.
|
||||
|
@ -1259,6 +1242,7 @@ abstract class TypeInferrerImpl extends TypeInferrer {
|
|||
for (var annotation in annotations) {
|
||||
inferExpression(annotation, const UnknownType(), false);
|
||||
}
|
||||
this.helper = null;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,50 +0,0 @@
|
|||
// Copyright (c) 2018, 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.
|
||||
|
||||
const int foo = 42;
|
||||
|
||||
class Bar {
|
||||
const Bar();
|
||||
const Bar.named(x);
|
||||
}
|
||||
|
||||
class Baz {
|
||||
Baz(@foo constructorFormal);
|
||||
|
||||
factory Baz.bazFactory(@foo factoryFormal) => null;
|
||||
|
||||
fisk(@foo formal1, @Bar() formal2, @Bar.named(foo) formal3,
|
||||
@foo @Bar.named(foo) formal4,
|
||||
[@foo optional]) {
|
||||
@foo
|
||||
var local1;
|
||||
|
||||
@Bar()
|
||||
var local2;
|
||||
|
||||
@Bar.named(foo)
|
||||
var local3;
|
||||
|
||||
@foo
|
||||
@Bar.named(foo)
|
||||
var local4;
|
||||
|
||||
@foo
|
||||
var localWithInitializer = "hello";
|
||||
|
||||
@foo
|
||||
@Bar.named(foo)
|
||||
var localGroupPart1, localGroupPart2;
|
||||
|
||||
naebdyr(@foo nestedFormal) => null;
|
||||
|
||||
var roedmus = (@foo closureFormal) => null;
|
||||
}
|
||||
|
||||
hest({@foo named}) => null;
|
||||
}
|
||||
|
||||
typedef hest_t({@foo named});
|
||||
|
||||
main() {}
|
|
@ -1,36 +0,0 @@
|
|||
library;
|
||||
import self as self;
|
||||
import "dart:core" as core;
|
||||
|
||||
typedef hest_t = ({named: dynamic}) → dynamic;
|
||||
class Bar extends core::Object {
|
||||
const constructor •() → void
|
||||
: super core::Object::•()
|
||||
;
|
||||
const constructor named(dynamic x) → void
|
||||
: super core::Object::•()
|
||||
;
|
||||
}
|
||||
class Baz extends core::Object {
|
||||
constructor •(@self::foo dynamic constructorFormal) → void
|
||||
: super core::Object::•()
|
||||
;
|
||||
static factory bazFactory(@self::foo dynamic factoryFormal) → self::Baz
|
||||
return null;
|
||||
method fisk(@self::foo dynamic formal1, @self::Bar::•() dynamic formal2, @self::Bar::named(self::foo) dynamic formal3, @self::foo @self::Bar::named(self::foo) dynamic formal4, [@self::foo dynamic optional = null]) → dynamic {
|
||||
@self::foo dynamic local1;
|
||||
@self::Bar::•() dynamic local2;
|
||||
@self::Bar::named(self::foo) dynamic local3;
|
||||
@self::foo @self::Bar::named(self::foo) dynamic local4;
|
||||
@self::foo dynamic localWithInitializer = "hello";
|
||||
@self::foo @self::Bar::named(self::foo) dynamic localGroupPart1;
|
||||
@self::foo @self::Bar::named(self::foo) dynamic localGroupPart2;
|
||||
function naebdyr(@self::foo dynamic nestedFormal) → dynamic
|
||||
return null;
|
||||
dynamic roedmus = (@self::foo dynamic closureFormal) → dynamic => null;
|
||||
}
|
||||
method hest({@self::foo dynamic named = null}) → dynamic
|
||||
return null;
|
||||
}
|
||||
static const field core::int foo = 42;
|
||||
static method main() → dynamic {}
|
|
@ -1,36 +0,0 @@
|
|||
library;
|
||||
import self as self;
|
||||
import "dart:core" as core;
|
||||
|
||||
typedef hest_t = ({named: dynamic}) → dynamic;
|
||||
class Bar extends core::Object {
|
||||
const constructor •() → void
|
||||
: super core::Object::•()
|
||||
;
|
||||
const constructor named(dynamic x) → void
|
||||
: super core::Object::•()
|
||||
;
|
||||
}
|
||||
class Baz extends core::Object {
|
||||
constructor •(@self::foo dynamic constructorFormal) → void
|
||||
: super core::Object::•()
|
||||
;
|
||||
static factory bazFactory(@self::foo dynamic factoryFormal) → self::Baz
|
||||
return null;
|
||||
method fisk(@self::foo dynamic formal1, @self::Bar::•() dynamic formal2, @self::Bar::named(self::foo) dynamic formal3, @self::foo @self::Bar::named(self::foo) dynamic formal4, [@self::foo dynamic optional = null]) → dynamic {
|
||||
@self::foo dynamic local1;
|
||||
@self::Bar::•() dynamic local2;
|
||||
@self::Bar::named(self::foo) dynamic local3;
|
||||
@self::foo @self::Bar::named(self::foo) dynamic local4;
|
||||
@self::foo dynamic localWithInitializer = "hello";
|
||||
@self::foo @self::Bar::named(self::foo) dynamic localGroupPart1;
|
||||
@self::foo @self::Bar::named(self::foo) dynamic localGroupPart2;
|
||||
function naebdyr(@self::foo dynamic nestedFormal) → dynamic
|
||||
return null;
|
||||
dynamic roedmus = (@self::foo dynamic closureFormal) → dynamic => null;
|
||||
}
|
||||
method hest({@self::foo dynamic named = null}) → dynamic
|
||||
return null;
|
||||
}
|
||||
static const field core::int foo = 42;
|
||||
static method main() → dynamic {}
|
|
@ -1,24 +0,0 @@
|
|||
library;
|
||||
import self as self;
|
||||
import "dart:core" as core;
|
||||
|
||||
typedef hest_t = ({named: dynamic}) → dynamic;
|
||||
class Bar extends core::Object {
|
||||
const constructor •() → void
|
||||
;
|
||||
const constructor named(dynamic x) → void
|
||||
;
|
||||
}
|
||||
class Baz extends core::Object {
|
||||
constructor •(dynamic constructorFormal) → void
|
||||
;
|
||||
static factory bazFactory(dynamic factoryFormal) → self::Baz
|
||||
;
|
||||
method fisk(dynamic formal1, dynamic formal2, dynamic formal3, dynamic formal4, [dynamic optional]) → dynamic
|
||||
;
|
||||
method hest({dynamic named}) → dynamic
|
||||
;
|
||||
}
|
||||
static const field core::int foo;
|
||||
static method main() → dynamic
|
||||
;
|
|
@ -1,36 +0,0 @@
|
|||
library;
|
||||
import self as self;
|
||||
import "dart:core" as core;
|
||||
|
||||
typedef hest_t = ({named: dynamic}) → dynamic;
|
||||
class Bar extends core::Object {
|
||||
const constructor •() → void
|
||||
: super core::Object::•()
|
||||
;
|
||||
const constructor named(dynamic x) → void
|
||||
: super core::Object::•()
|
||||
;
|
||||
}
|
||||
class Baz extends core::Object {
|
||||
constructor •(@self::foo dynamic constructorFormal) → void
|
||||
: super core::Object::•()
|
||||
;
|
||||
static factory bazFactory(@self::foo dynamic factoryFormal) → self::Baz
|
||||
return null;
|
||||
method fisk(@self::foo dynamic formal1, @self::Bar::•() dynamic formal2, @self::Bar::named(self::foo) dynamic formal3, @self::foo @self::Bar::named(self::foo) dynamic formal4, [@self::foo dynamic optional = null]) → dynamic {
|
||||
@self::foo dynamic local1;
|
||||
@self::Bar::•() dynamic local2;
|
||||
@self::Bar::named(self::foo) dynamic local3;
|
||||
@self::foo @self::Bar::named(self::foo) dynamic local4;
|
||||
@self::foo core::String localWithInitializer = "hello";
|
||||
@self::foo @self::Bar::named(self::foo) dynamic localGroupPart1;
|
||||
@self::foo @self::Bar::named(self::foo) dynamic localGroupPart2;
|
||||
function naebdyr(@self::foo dynamic nestedFormal) → core::Null
|
||||
return null;
|
||||
(dynamic) → core::Null roedmus = (@self::foo dynamic closureFormal) → core::Null => null;
|
||||
}
|
||||
method hest({@self::foo dynamic named = null}) → dynamic
|
||||
return null;
|
||||
}
|
||||
static const field core::int foo = 42;
|
||||
static method main() → dynamic {}
|
|
@ -1,36 +0,0 @@
|
|||
library;
|
||||
import self as self;
|
||||
import "dart:core" as core;
|
||||
|
||||
typedef hest_t = ({named: dynamic}) → dynamic;
|
||||
class Bar extends core::Object {
|
||||
const constructor •() → void
|
||||
: super core::Object::•()
|
||||
;
|
||||
const constructor named(dynamic x) → void
|
||||
: super core::Object::•()
|
||||
;
|
||||
}
|
||||
class Baz extends core::Object {
|
||||
constructor •(@self::foo dynamic constructorFormal) → void
|
||||
: super core::Object::•()
|
||||
;
|
||||
static factory bazFactory(@self::foo dynamic factoryFormal) → self::Baz
|
||||
return null;
|
||||
method fisk(@self::foo dynamic formal1, @self::Bar::•() dynamic formal2, @self::Bar::named(self::foo) dynamic formal3, @self::foo @self::Bar::named(self::foo) dynamic formal4, [@self::foo dynamic optional = null]) → dynamic {
|
||||
@self::foo dynamic local1;
|
||||
@self::Bar::•() dynamic local2;
|
||||
@self::Bar::named(self::foo) dynamic local3;
|
||||
@self::foo @self::Bar::named(self::foo) dynamic local4;
|
||||
@self::foo core::String localWithInitializer = "hello";
|
||||
@self::foo @self::Bar::named(self::foo) dynamic localGroupPart1;
|
||||
@self::foo @self::Bar::named(self::foo) dynamic localGroupPart2;
|
||||
function naebdyr(@self::foo dynamic nestedFormal) → core::Null
|
||||
return null;
|
||||
(dynamic) → core::Null roedmus = (@self::foo dynamic closureFormal) → core::Null => null;
|
||||
}
|
||||
method hest({@self::foo dynamic named = null}) → dynamic
|
||||
return null;
|
||||
}
|
||||
static const field core::int foo = 42;
|
||||
static method main() → dynamic {}
|
|
@ -11,7 +11,13 @@ dynamic_and_void: Fail
|
|||
inference/abstract_class_instantiation: Fail
|
||||
inference/constructors_too_many_positional_arguments: Fail
|
||||
inference/downwards_inference_annotations: Crash
|
||||
inference/downwards_inference_annotations_for_loop_variable: Fail
|
||||
inference/downwards_inference_annotations_locals: Fail
|
||||
inference/downwards_inference_annotations_locals_referring_to_locals: Fail
|
||||
inference/downwards_inference_annotations_parameter: Fail
|
||||
inference/downwards_inference_annotations_parameter_local: Fail
|
||||
inference/downwards_inference_annotations_type_variable: Fail
|
||||
inference/downwards_inference_annotations_type_variable_local: Fail
|
||||
inference/downwards_inference_annotations_typedef: Crash
|
||||
inference/downwards_inference_on_function_of_t_using_the_t: Fail
|
||||
inference/downwards_inference_yield_yield_star: Fail
|
||||
|
|
|
@ -8,9 +8,9 @@ class Foo extends core::Object {
|
|||
;
|
||||
}
|
||||
static method test() → void {
|
||||
for (@self::Foo::•(const <dynamic>[]) core::int i = 0; i.<(1); i = i.+(1)) {
|
||||
for (core::int i = 0; i.<(1); i = i.+(1)) {
|
||||
}
|
||||
for (@self::Foo::•(const <dynamic>[]) core::int i in <dynamic>[0]) {
|
||||
for (core::int i in <dynamic>[0]) {
|
||||
}
|
||||
}
|
||||
static method main() → dynamic {}
|
||||
|
|
|
@ -8,9 +8,9 @@ class Foo extends core::Object {
|
|||
;
|
||||
}
|
||||
static method test() → void {
|
||||
for (@self::Foo::•(const <dynamic>[]) core::int i = 0; i.<(1); i = i.+(1)) {
|
||||
for (core::int i = 0; i.<(1); i = i.+(1)) {
|
||||
}
|
||||
for (@self::Foo::•(const <dynamic>[]) core::int i in <dynamic>[0]) {
|
||||
for (core::int i in <dynamic>[0]) {
|
||||
}
|
||||
}
|
||||
static method main() → dynamic {}
|
||||
|
|
|
@ -1,16 +0,0 @@
|
|||
library test;
|
||||
import self as self;
|
||||
import "dart:core" as core;
|
||||
|
||||
class Foo extends core::Object {
|
||||
const constructor •(core::List<core::String> l) → void
|
||||
: super core::Object::•()
|
||||
;
|
||||
}
|
||||
static method test() → void {
|
||||
for (@self::Foo::•(const <core::String>[]) core::int i = 0; i.{core::num::<}(1); i = i.{core::num::+}(1)) {
|
||||
}
|
||||
for (@self::Foo::•(const <core::String>[]) core::int i in <core::int>[0]) {
|
||||
}
|
||||
}
|
||||
static method main() → dynamic {}
|
|
@ -1,16 +0,0 @@
|
|||
library test;
|
||||
import self as self;
|
||||
import "dart:core" as core;
|
||||
|
||||
class Foo extends core::Object {
|
||||
const constructor •(core::List<core::String> l) → void
|
||||
: super core::Object::•()
|
||||
;
|
||||
}
|
||||
static method test() → void {
|
||||
for (@self::Foo::•(const <core::String>[]) core::int i = 0; i.{core::num::<}(1); i = i.{core::num::+}(1)) {
|
||||
}
|
||||
for (@self::Foo::•(const <core::String>[]) core::int i in <core::int>[0]) {
|
||||
}
|
||||
}
|
||||
static method main() → dynamic {}
|
|
@ -1,15 +0,0 @@
|
|||
library test;
|
||||
import self as self;
|
||||
import "dart:core" as core;
|
||||
|
||||
class Foo extends core::Object {
|
||||
const constructor •(core::List<core::String> l) → void
|
||||
: super core::Object::•()
|
||||
;
|
||||
}
|
||||
static method test() → void {
|
||||
@self::Foo::•(const <core::String>[]) dynamic x;
|
||||
@self::Foo::•(const <core::String>[])
|
||||
function f() → void {}
|
||||
}
|
||||
static method main() → dynamic {}
|
|
@ -1,15 +0,0 @@
|
|||
library test;
|
||||
import self as self;
|
||||
import "dart:core" as core;
|
||||
|
||||
class Foo extends core::Object {
|
||||
const constructor •(core::List<core::String> l) → void
|
||||
: super core::Object::•()
|
||||
;
|
||||
}
|
||||
static method test() → void {
|
||||
@self::Foo::•(const <core::String>[]) dynamic x;
|
||||
@self::Foo::•(const <core::String>[])
|
||||
function f() → void {}
|
||||
}
|
||||
static method main() → dynamic {}
|
|
@ -14,11 +14,6 @@ void test() {
|
|||
|
||||
@Foo(/*@typeArgs=int*/ const [x])
|
||||
var /*@type=dynamic*/ y;
|
||||
|
||||
@Foo(/*@typeArgs=int*/ const [x])
|
||||
void bar() {}
|
||||
|
||||
void baz(@Foo(/*@typeArgs=int*/ const [x]) dynamic formal) {}
|
||||
}
|
||||
|
||||
main() {}
|
||||
|
|
|
@ -9,9 +9,6 @@ class Foo extends core::Object {
|
|||
}
|
||||
static method test() → void {
|
||||
const dynamic x = 0;
|
||||
@self::Foo::•(const <dynamic>[x]) dynamic y;
|
||||
@self::Foo::•(const <dynamic>[x])
|
||||
function bar() → void {}
|
||||
function baz(@self::Foo::•(const <dynamic>[x]) dynamic formal) → void {}
|
||||
dynamic y;
|
||||
}
|
||||
static method main() → dynamic {}
|
||||
|
|
|
@ -9,9 +9,6 @@ class Foo extends core::Object {
|
|||
}
|
||||
static method test() → void {
|
||||
const dynamic x = 0;
|
||||
@self::Foo::•(const <dynamic>[x]) dynamic y;
|
||||
@self::Foo::•(const <dynamic>[x])
|
||||
function bar() → void {}
|
||||
function baz(@self::Foo::•(const <dynamic>[x]) dynamic formal) → void {}
|
||||
dynamic y;
|
||||
}
|
||||
static method main() → dynamic {}
|
||||
|
|
|
@ -1,17 +0,0 @@
|
|||
library test;
|
||||
import self as self;
|
||||
import "dart:core" as core;
|
||||
|
||||
class Foo extends core::Object {
|
||||
const constructor •(dynamic l) → void
|
||||
: super core::Object::•()
|
||||
;
|
||||
}
|
||||
static method test() → void {
|
||||
const core::int x = 0;
|
||||
@self::Foo::•(const <core::int>[x]) dynamic y;
|
||||
@self::Foo::•(const <core::int>[x])
|
||||
function bar() → void {}
|
||||
function baz(@self::Foo::•(const <core::int>[x]) dynamic formal) → void {}
|
||||
}
|
||||
static method main() → dynamic {}
|
|
@ -1,17 +0,0 @@
|
|||
library test;
|
||||
import self as self;
|
||||
import "dart:core" as core;
|
||||
|
||||
class Foo extends core::Object {
|
||||
const constructor •(dynamic l) → void
|
||||
: super core::Object::•()
|
||||
;
|
||||
}
|
||||
static method test() → void {
|
||||
const core::int x = 0;
|
||||
@self::Foo::•(const <core::int>[x]) dynamic y;
|
||||
@self::Foo::•(const <core::int>[x])
|
||||
function bar() → void {}
|
||||
function baz(@self::Foo::•(const <core::int>[x]) dynamic formal) → void {}
|
||||
}
|
||||
static method main() → dynamic {}
|
|
@ -11,7 +11,7 @@ class C extends core::Object {
|
|||
synthetic constructor •() → void
|
||||
: super core::Object::•()
|
||||
;
|
||||
method m(@self::Foo::•(const <dynamic>[]) dynamic x) → void {}
|
||||
method m(dynamic x) → void {}
|
||||
}
|
||||
static method f(@self::Foo::•(const <dynamic>[]) dynamic x) → void {}
|
||||
static method f(dynamic x) → void {}
|
||||
static method main() → dynamic {}
|
||||
|
|
|
@ -11,7 +11,7 @@ class C extends core::Object {
|
|||
synthetic constructor •() → void
|
||||
: super core::Object::•()
|
||||
;
|
||||
method m(@self::Foo::•(const <dynamic>[]) dynamic x) → void {}
|
||||
method m(dynamic x) → void {}
|
||||
}
|
||||
static method f(@self::Foo::•(const <dynamic>[]) dynamic x) → void {}
|
||||
static method f(dynamic x) → void {}
|
||||
static method main() → dynamic {}
|
||||
|
|
|
@ -1,17 +0,0 @@
|
|||
library test;
|
||||
import self as self;
|
||||
import "dart:core" as core;
|
||||
|
||||
class Foo extends core::Object {
|
||||
const constructor •(core::List<core::String> l) → void
|
||||
: super core::Object::•()
|
||||
;
|
||||
}
|
||||
class C extends core::Object {
|
||||
synthetic constructor •() → void
|
||||
: super core::Object::•()
|
||||
;
|
||||
method m(@self::Foo::•(const <core::String>[]) dynamic x) → void {}
|
||||
}
|
||||
static method f(@self::Foo::•(const <core::String>[]) dynamic x) → void {}
|
||||
static method main() → dynamic {}
|
|
@ -1,17 +0,0 @@
|
|||
library test;
|
||||
import self as self;
|
||||
import "dart:core" as core;
|
||||
|
||||
class Foo extends core::Object {
|
||||
const constructor •(core::List<core::String> l) → void
|
||||
: super core::Object::•()
|
||||
;
|
||||
}
|
||||
class C extends core::Object {
|
||||
synthetic constructor •() → void
|
||||
: super core::Object::•()
|
||||
;
|
||||
method m(@self::Foo::•(const <core::String>[]) dynamic x) → void {}
|
||||
}
|
||||
static method f(@self::Foo::•(const <core::String>[]) dynamic x) → void {}
|
||||
static method main() → dynamic {}
|
|
@ -11,7 +11,7 @@ class Foo {
|
|||
|
||||
void test() {
|
||||
void f(@Foo(/*@typeArgs=String*/ const []) /*@type=dynamic*/ x) {}
|
||||
var /*@type=(dynamic) -> Null*/ x = /*@returnType=Null*/ (@Foo(/*@typeArgs=String*/ const []) /*@type=dynamic*/
|
||||
var /*@type=(dynamic) -> Null*/ x = /*@returnType=Null*/ (/*@type=dynamic*/ @Foo(/*@typeArgs=String*/ const [])
|
||||
x) {};
|
||||
}
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ class Foo extends core::Object {
|
|||
;
|
||||
}
|
||||
static method test() → void {
|
||||
function f(@self::Foo::•(const <dynamic>[]) dynamic x) → void {}
|
||||
dynamic x = (@self::Foo::•(const <dynamic>[]) dynamic x) → dynamic {};
|
||||
function f(dynamic x) → void {}
|
||||
dynamic x = (dynamic x) → dynamic {};
|
||||
}
|
||||
static method main() → dynamic {}
|
||||
|
|
|
@ -8,7 +8,7 @@ class Foo extends core::Object {
|
|||
;
|
||||
}
|
||||
static method test() → void {
|
||||
function f(@self::Foo::•(const <dynamic>[]) dynamic x) → void {}
|
||||
dynamic x = (@self::Foo::•(const <dynamic>[]) dynamic x) → dynamic {};
|
||||
function f(dynamic x) → void {}
|
||||
dynamic x = (dynamic x) → dynamic {};
|
||||
}
|
||||
static method main() → dynamic {}
|
||||
|
|
|
@ -1,14 +0,0 @@
|
|||
library test;
|
||||
import self as self;
|
||||
import "dart:core" as core;
|
||||
|
||||
class Foo extends core::Object {
|
||||
const constructor •(core::List<core::String> l) → void
|
||||
: super core::Object::•()
|
||||
;
|
||||
}
|
||||
static method test() → void {
|
||||
function f(@self::Foo::•(const <core::String>[]) dynamic x) → void {}
|
||||
(dynamic) → core::Null x = (@self::Foo::•(const <core::String>[]) dynamic x) → core::Null {};
|
||||
}
|
||||
static method main() → dynamic {}
|
|
@ -1,14 +0,0 @@
|
|||
library test;
|
||||
import self as self;
|
||||
import "dart:core" as core;
|
||||
|
||||
class Foo extends core::Object {
|
||||
const constructor •(core::List<core::String> l) → void
|
||||
: super core::Object::•()
|
||||
;
|
||||
}
|
||||
static method test() → void {
|
||||
function f(@self::Foo::•(const <core::String>[]) dynamic x) → void {}
|
||||
(dynamic) → core::Null x = (@self::Foo::•(const <core::String>[]) dynamic x) → core::Null {};
|
||||
}
|
||||
static method main() → dynamic {}
|
|
@ -11,7 +11,7 @@ class Foo {
|
|||
|
||||
void test() {
|
||||
void f<@Foo(/*@typeArgs=String*/ const []) T>() {}
|
||||
var /*@type=<@Foo::•(const <String>[]) T extends Object>() -> Null*/ x =
|
||||
var /*@type=<T extends Object>() -> Null*/ x =
|
||||
<@Foo(/*@typeArgs=String*/ const []) T> /*@returnType=Null*/ () {};
|
||||
}
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ class Foo extends core::Object {
|
|||
;
|
||||
}
|
||||
static method test() → void {
|
||||
function f<@self::Foo::•(const <dynamic>[]) T extends core::Object>() → void {}
|
||||
dynamic x = <@self::Foo::•(const <dynamic>[]) T extends core::Object>() → dynamic {};
|
||||
function f<T extends core::Object>() → void {}
|
||||
dynamic x = <T extends core::Object>() → dynamic {};
|
||||
}
|
||||
static method main() → dynamic {}
|
||||
|
|
|
@ -8,7 +8,7 @@ class Foo extends core::Object {
|
|||
;
|
||||
}
|
||||
static method test() → void {
|
||||
function f<@self::Foo::•(const <dynamic>[]) T extends core::Object>() → void {}
|
||||
dynamic x = <@self::Foo::•(const <dynamic>[]) T extends core::Object>() → dynamic {};
|
||||
function f<T extends core::Object>() → void {}
|
||||
dynamic x = <T extends core::Object>() → dynamic {};
|
||||
}
|
||||
static method main() → dynamic {}
|
||||
|
|
|
@ -1,14 +0,0 @@
|
|||
library test;
|
||||
import self as self;
|
||||
import "dart:core" as core;
|
||||
|
||||
class Foo extends core::Object {
|
||||
const constructor •(core::List<core::String> l) → void
|
||||
: super core::Object::•()
|
||||
;
|
||||
}
|
||||
static method test() → void {
|
||||
function f<@self::Foo::•(const <core::String>[]) T extends core::Object>() → void {}
|
||||
<@self::Foo::•(const <core::String>[]) T extends core::Object>() → core::Null x = <@self::Foo::•(const <core::String>[]) T extends core::Object>() → core::Null {};
|
||||
}
|
||||
static method main() → dynamic {}
|
|
@ -1,14 +0,0 @@
|
|||
library test;
|
||||
import self as self;
|
||||
import "dart:core" as core;
|
||||
|
||||
class Foo extends core::Object {
|
||||
const constructor •(core::List<core::String> l) → void
|
||||
: super core::Object::•()
|
||||
;
|
||||
}
|
||||
static method test() → void {
|
||||
function f<@self::Foo::•(const <core::String>[]) T extends core::Object>() → void {}
|
||||
<@self::Foo::•(const <core::String>[]) T extends core::Object>() → core::Null x = <@self::Foo::•(const <core::String>[]) T extends core::Object>() → core::Null {};
|
||||
}
|
||||
static method main() → dynamic {}
|
|
@ -77,7 +77,13 @@ inference/conflicts_can_happen2: TypeCheckError
|
|||
inference/constructors_infer_from_arguments_argument_not_assignable: TypeCheckError
|
||||
inference/constructors_too_many_positional_arguments: Fail # Issue #30040
|
||||
inference/do_not_infer_overridden_fields_that_explicitly_say_dynamic_infer: TypeCheckError
|
||||
inference/downwards_inference_annotations_type_variable: Fail # Issue 28981
|
||||
inference/downwards_inference_annotations_for_loop_variable: Fail # Issue #28434
|
||||
inference/downwards_inference_annotations_locals: Fail # Issue #30031 and Issue #28434
|
||||
inference/downwards_inference_annotations_locals_referring_to_locals: Fail # Issue #28434
|
||||
inference/downwards_inference_annotations_parameter: Fail # Issue #28434
|
||||
inference/downwards_inference_annotations_parameter_local: Fail # Issue #28434
|
||||
inference/downwards_inference_annotations_type_variable: Fail # Issue #28434
|
||||
inference/downwards_inference_annotations_type_variable_local: Fail # Issue #28434
|
||||
inference/downwards_inference_on_function_of_t_using_the_t: Fail # Issue #29798
|
||||
inference/downwards_inference_on_list_literals_infer_downwards: RuntimeError
|
||||
inference/downwards_inference_yield_yield_star: TypeCheckError
|
||||
|
|
|
@ -869,17 +869,11 @@ class Printer extends Visitor<Null> {
|
|||
}
|
||||
}
|
||||
|
||||
void writeAnnotationList(List<Expression> nodes, {bool separateLines: true}) {
|
||||
void writeAnnotationList(List<Expression> nodes) {
|
||||
for (Expression node in nodes) {
|
||||
if (separateLines) {
|
||||
writeIndentation();
|
||||
}
|
||||
writeIndentation();
|
||||
writeAnnotation(node);
|
||||
if (separateLines) {
|
||||
endLine();
|
||||
} else {
|
||||
writeSpace();
|
||||
}
|
||||
endLine();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1679,7 +1673,6 @@ class Printer extends Visitor<Null> {
|
|||
}
|
||||
|
||||
visitFunctionDeclaration(FunctionDeclaration node) {
|
||||
writeAnnotationList(node.variable.annotations);
|
||||
writeIndentation();
|
||||
writeWord('function');
|
||||
if (node.function != null) {
|
||||
|
@ -1694,7 +1687,7 @@ class Printer extends Visitor<Null> {
|
|||
{bool useVarKeyword: false}) {
|
||||
if (showOffsets) writeWord("[${node.fileOffset}]");
|
||||
if (showMetadata) writeMetadata(node);
|
||||
writeAnnotationList(node.annotations, separateLines: false);
|
||||
writeAnnotationList(node.annotations);
|
||||
writeModifier(node.isCovariant, 'covariant');
|
||||
writeModifier(node.isGenericCovariantImpl, 'generic-covariant-impl');
|
||||
writeModifier(
|
||||
|
@ -1845,7 +1838,7 @@ class Printer extends Visitor<Null> {
|
|||
writeModifier(node.isGenericCovariantImpl, 'generic-covariant-impl');
|
||||
writeModifier(
|
||||
node.isGenericCovariantInterface, 'generic-covariant-interface');
|
||||
writeAnnotationList(node.annotations, separateLines: false);
|
||||
writeAnnotationList(node.annotations);
|
||||
writeWord(getTypeParameterName(node));
|
||||
writeSpaced('extends');
|
||||
writeType(node.bound);
|
||||
|
|
Loading…
Reference in a new issue