Version 0.5.20.2
svn merge -r 24148:24149 https://dart.googlecode.com/svn/branches/bleeding_edge trunk
git-svn-id: http://dart.googlecode.com/svn/trunk@24160 260f80e4-7a28-3924-810f-c04153c831b5
diff --git a/lib/compiler/implementation/lib/web.dart b/lib/compiler/implementation/lib/web.dart
new file mode 100644
index 0000000..a75db7b
--- /dev/null
+++ b/lib/compiler/implementation/lib/web.dart
@@ -0,0 +1,9 @@
+// Copyright (c) 2012, 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.
+
+#library("web");
+
+String htmlEscape(String text) {
+ throw "Unimplemented: web::htmlEscape(String).";
+}
diff --git a/lib/compiler/implementation/lib/web.dartp b/lib/compiler/implementation/lib/web.dartp
new file mode 100644
index 0000000..c3ba2ad
--- /dev/null
+++ b/lib/compiler/implementation/lib/web.dartp
@@ -0,0 +1,13 @@
+// Copyright (c) 2012, 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.
+
+// Patch file for dart:web
+
+/*patch*/ String htmlEscape(String text) {
+ return text.replaceAll("&", "&")
+ .replaceAll("<", "<")
+ .replaceAll(">", ">")
+ .replaceAll('"', """)
+ .replaceAll("'", "'"); // Different from original.
+}
diff --git a/lib/dom/templates/html/dartium/factoryprovider__Elements.darttemplate b/lib/dom/templates/html/dartium/factoryprovider__Elements.darttemplate
new file mode 100644
index 0000000..8fe27e5
--- /dev/null
+++ b/lib/dom/templates/html/dartium/factoryprovider__Elements.darttemplate
@@ -0,0 +1,7 @@
+// Copyright (c) 2012, 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.
+
+class _Elements {
+
+$!FACTORY_METHODS}
diff --git a/lib/dom/templates/html/dartium/impl_EventTarget.darttemplate b/lib/dom/templates/html/dartium/impl_EventTarget.darttemplate
new file mode 100644
index 0000000..1b4a00d
--- /dev/null
+++ b/lib/dom/templates/html/dartium/impl_EventTarget.darttemplate
@@ -0,0 +1,106 @@
+// Copyright (c) 2012, 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.
+
+class _EventsImpl implements Events {
+ // TODO(podivilov): add type.
+ final _ptr;
+
+ final Map<String, EventListenerList> _listenerMap;
+
+ _EventsImpl(this._ptr) : _listenerMap = <EventListenerList>{};
+
+ EventListenerList operator [](String type) {
+ return _listenerMap.putIfAbsent(type,
+ () => new _EventListenerListImpl(_ptr, type));
+ }
+}
+
+class _EventListenerWrapper {
+ final EventListener raw;
+ final Function wrapped;
+ final bool useCapture;
+ _EventListenerWrapper(this.raw, this.wrapped, this.useCapture);
+}
+
+class _EventListenerListImpl implements EventListenerList {
+ // TODO(podivilov): add type.
+ final _ptr;
+ final String _type;
+ List<_EventListenerWrapper> _wrappers;
+
+ _EventListenerListImpl(this._ptr, this._type) :
+ // TODO(jacobr): switch to <_EventListenerWrapper>[] when the VM allow it.
+ _wrappers = new List<_EventListenerWrapper>();
+
+ EventListenerList add(EventListener listener, [bool useCapture = false]) {
+ _add(listener, useCapture);
+ return this;
+ }
+
+ EventListenerList remove(EventListener listener, [bool useCapture = false]) {
+ _remove(listener, useCapture);
+ return this;
+ }
+
+ bool dispatch(Event evt) {
+ // TODO(jacobr): what is the correct behavior here. We could alternately
+ // force the event to have the expected type.
+ assert(evt.type == _type);
+ return _ptr.$dom_dispatchEvent(evt);
+ }
+
+ void _add(EventListener listener, bool useCapture) {
+ _ptr.$dom_addEventListener(_type,
+ _findOrAddWrapper(listener, useCapture),
+ useCapture);
+ }
+
+ void _remove(EventListener listener, bool useCapture) {
+ Function wrapper = _removeWrapper(listener, useCapture);
+ if (wrapper !== null) {
+ _ptr.$dom_removeEventListener(_type, wrapper, useCapture);
+ }
+ }
+
+ Function _removeWrapper(EventListener listener, bool useCapture) {
+ if (_wrappers === null) {
+ return null;
+ }
+ for (int i = 0; i < _wrappers.length; i++) {
+ _EventListenerWrapper wrapper = _wrappers[i];
+ if (wrapper.raw === listener && wrapper.useCapture == useCapture) {
+ // Order doesn't matter so we swap with the last element instead of
+ // performing a more expensive remove from the middle of the list.
+ if (i + 1 != _wrappers.length) {
+ _wrappers[i] = _wrappers.removeLast();
+ } else {
+ _wrappers.removeLast();
+ }
+ return wrapper.wrapped;
+ }
+ }
+ return null;
+ }
+
+ Function _findOrAddWrapper(EventListener listener, bool useCapture) {
+ if (_wrappers === null) {
+ _wrappers = <_EventListenerWrapper>[];
+ } else {
+ for (_EventListenerWrapper wrapper in _wrappers) {
+ if (wrapper.raw === listener && wrapper.useCapture == useCapture) {
+ return wrapper.wrapped;
+ }
+ }
+ }
+ final wrapped = (e) { listener(e); };
+ _wrappers.add(new _EventListenerWrapper(listener, wrapped, useCapture));
+ return wrapped;
+ }
+}
+
+class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC {
+/*
+$!MEMBERS
+*/
+}
diff --git a/lib/dom/templates/html/frog/factoryprovider__Elements.darttemplate b/lib/dom/templates/html/frog/factoryprovider__Elements.darttemplate
new file mode 100644
index 0000000..8fe27e5
--- /dev/null
+++ b/lib/dom/templates/html/frog/factoryprovider__Elements.darttemplate
@@ -0,0 +1,7 @@
+// Copyright (c) 2012, 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.
+
+class _Elements {
+
+$!FACTORY_METHODS}
diff --git a/lib/dom/templates/html/frog/impl_EventTarget.darttemplate b/lib/dom/templates/html/frog/impl_EventTarget.darttemplate
new file mode 100644
index 0000000..893f3d2
--- /dev/null
+++ b/lib/dom/templates/html/frog/impl_EventTarget.darttemplate
@@ -0,0 +1,61 @@
+// Copyright (c) 2012, 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.
+
+class _EventsImpl implements Events {
+ /* Raw event target. */
+ // TODO(jacobr): it would be nice if we could specify this as
+ // _EventTargetImpl or EventTarget
+ final Dynamic _ptr;
+
+ _EventsImpl(this._ptr);
+
+ _EventListenerListImpl operator [](String type) {
+ return new _EventListenerListImpl(_ptr, type);
+ }
+}
+
+class _EventListenerListImpl implements EventListenerList {
+
+ // TODO(jacobr): make this _EventTargetImpl
+ final Dynamic _ptr;
+ final String _type;
+
+ _EventListenerListImpl(this._ptr, this._type);
+
+ // TODO(jacobr): implement equals.
+
+ _EventListenerListImpl add(EventListener listener,
+ [bool useCapture = false]) {
+ _add(listener, useCapture);
+ return this;
+ }
+
+ _EventListenerListImpl remove(EventListener listener,
+ [bool useCapture = false]) {
+ _remove(listener, useCapture);
+ return this;
+ }
+
+ bool dispatch(Event evt) {
+ // TODO(jacobr): what is the correct behavior here. We could alternately
+ // force the event to have the expected type.
+ assert(evt.type == _type);
+ return _ptr.$dom_dispatchEvent(evt);
+ }
+
+ void _add(EventListener listener, bool useCapture) {
+ _ptr.$dom_addEventListener(_type, listener, useCapture);
+ }
+
+ void _remove(EventListener listener, bool useCapture) {
+ _ptr.$dom_removeEventListener(_type, listener, useCapture);
+ }
+}
+
+
+class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC {
+
+ Events get on() => new _EventsImpl(this);
+$!MEMBERS
+}
diff --git a/pkg/analyzer_experimental/bin/coverage.dart b/pkg/analyzer_experimental/bin/coverage.dart
index 1db17e2..87be02e 100644
--- a/pkg/analyzer_experimental/bin/coverage.dart
+++ b/pkg/analyzer_experimental/bin/coverage.dart
@@ -4,89 +4,19 @@
library runtime.coverage;
-import 'dart:io';
+import "package:logging/logging.dart" as log;
-import 'package:args/args.dart' show ArgParser, ArgResults;
-
-import 'package:analyzer_experimental/src/services/runtime/log.dart' as log;
-import 'package:analyzer_experimental/src/services/runtime/coverage/coverage_impl.dart';
+import 'package:analyzer_experimental/src/services/runtime/coverage_impl.dart';
main() {
- ArgResults options;
- try {
- options = _argParser.parse(new Options().arguments);
- } on FormatException catch (e) {
- print(e.message);
- print('Run "coverage --help" to see available options.');
- exit(ERROR);
- }
-
- if (options['help']) {
- printUsage();
- return;
- }
-
- // No script to run.
- if (options.rest.isEmpty) {
- printUsage('<No script to run specified>');
- exit(ERROR);
- }
-
- // More than one script specified.
- if (options.rest.length != 1) {
- print('<Only one script should be specified>');
- exit(ERROR);
- }
-
- var scriptPath = options.rest[0];
-
- // Validate that script file exists.
- if (!new File(scriptPath).existsSync()) {
- print('<File "$scriptPath" does not exist>');
- exit(ERROR);
- }
-
- // Prepare output file path.
- var outPath = options['out'];
- if (outPath == null) {
- printUsage('No --out specified.');
- exit(ERROR);
- }
-
- // Configure logigng.
- log.everything();
- log.toConsole();
-
- // Run script.
- runServerApplication(scriptPath, outPath);
-}
-
-
-final ArgParser _argParser = new ArgParser()
- ..addFlag('help', negatable: false, help: 'Print this usage information.')
- ..addOption(
- 'level',
- help: 'The level of the coverage.',
- allowed: ['method', 'block', 'statement'],
- defaultsTo: 'statement')
- ..addOption('out', help: 'The output file with statistics.')
- ..addOption(
- 'port',
- help: 'The port to run server on, if 0 select any.',
- defaultsTo: '0');
-
-
-printUsage([var description = 'Code coverage tool for Dart.']) {
- var buffer = new StringBuffer();
- var usage = _argParser.getUsage();
- buffer.write(
- '$description\n\n'
- 'Usage: coverage [options] <script>\n\n'
- '$usage\n\n');
- print(buffer.toString());
-}
-
-
-/// General error code.
-const ERROR = 1;
+ var logger = log.Logger.root;
+ logger.level = log.Level.ALL;
+ logger.onRecord.listen((log.LogRecord record) {
+ String levelString = record.level.toString();
+ while (levelString.length < 6) levelString += ' ';
+ print('${record.time}: ${levelString} ${record.message}');
+ });
+ // TODO(scheglov) get script from options
+ new CoverageServer('/Users/scheglov/dart/Test/bin').start();
+}
\ No newline at end of file
diff --git a/pkg/analyzer_experimental/lib/options.dart b/pkg/analyzer_experimental/lib/options.dart
index cb63502..83d5585 100644
--- a/pkg/analyzer_experimental/lib/options.dart
+++ b/pkg/analyzer_experimental/lib/options.dart
@@ -251,6 +251,7 @@
}
}
+ print(filtered);
return filtered;
}
diff --git a/pkg/analyzer_experimental/lib/src/analyzer_impl.dart b/pkg/analyzer_experimental/lib/src/analyzer_impl.dart
index 4e46d61..5d8fc4c 100644
--- a/pkg/analyzer_experimental/lib/src/analyzer_impl.dart
+++ b/pkg/analyzer_experimental/lib/src/analyzer_impl.dart
@@ -81,6 +81,7 @@
} else {
packageDirectory = getPackageDirectoryFor(sourceFile);
}
+ print('packageDirectory: ${packageDirectory.getPath()}');
if (packageDirectory != null) {
resolvers.add(new PackageUriResolver([packageDirectory]));
}
diff --git a/pkg/analyzer_experimental/lib/src/generated/ast.dart b/pkg/analyzer_experimental/lib/src/generated/ast.dart
index 6b7d525..0adebba 100644
--- a/pkg/analyzer_experimental/lib/src/generated/ast.dart
+++ b/pkg/analyzer_experimental/lib/src/generated/ast.dart
@@ -11,25 +11,25 @@
import 'utilities_dart.dart';
import 'element.dart';
/**
- * The abstract class `ASTNode` defines the behavior common to all nodes in the AST structure
+ * The abstract class {@code ASTNode} defines the behavior common to all nodes in the AST structure
* for a Dart program.
* @coverage dart.engine.ast
*/
abstract class ASTNode {
/**
- * The parent of the node, or `null` if the node is the root of an AST structure.
+ * The parent of the node, or {@code null} if the node is the root of an AST structure.
*/
ASTNode _parent;
/**
- * A table mapping the names of properties to their values, or `null` if this node does not
+ * A table mapping the names of properties to their values, or {@code null} if this node does not
* have any properties associated with it.
*/
Map<String, Object> _propertyMap;
/**
- * A comparator that can be used to sort AST nodes in lexical order. In other words,`compare` will return a negative value if the offset of the first node is less than the
+ * A comparator that can be used to sort AST nodes in lexical order. In other words,{@code compare} will return a negative value if the offset of the first node is less than the
* offset of the second node, zero (0) if the nodes have the same offset, and a positive value if
* if the offset of the first node is greater than the offset of the second node.
*/
@@ -43,7 +43,7 @@
accept(ASTVisitor visitor);
/**
- * @return the [ASTNode] of given [Class] which is [ASTNode] itself, or one of
+ * @return the {@link ASTNode} of given {@link Class} which is {@link ASTNode} itself, or one of
* its parents.
*/
ASTNode getAncestor(Type enclosingClass) {
@@ -63,7 +63,7 @@
/**
* Return the offset of the character immediately following the last character of this node's
- * source range. This is equivalent to `node.getOffset() + node.getLength()`. For a
+ * source range. This is equivalent to {@code node.getOffset() + node.getLength()}. For a
* compilation unit this will be equal to the length of the unit's source. For synthetic nodes
* this will be equivalent to the node's offset (because the length is zero (0) by definition).
* @return the offset of the character just past the node's source range
@@ -104,16 +104,16 @@
}
/**
- * Return this node's parent node, or `null` if this node is the root of an AST structure.
- *
+ * Return this node's parent node, or {@code null} if this node is the root of an AST structure.
+ * <p>
* Note that the relationship between an AST node and its parent node may change over the lifetime
* of a node.
- * @return the parent of this node, or `null` if none
+ * @return the parent of this node, or {@code null} if none
*/
ASTNode get parent => _parent;
/**
- * Return the value of the property with the given name, or `null` if this node does not
+ * Return the value of the property with the given name, or {@code null} if this node does not
* have a property with the given name.
* @return the value of the property with the given name
*/
@@ -140,15 +140,15 @@
}
/**
- * Return `true` if this node is a synthetic node. A synthetic node is a node that was
+ * Return {@code true} if this node is a synthetic node. A synthetic node is a node that was
* introduced by the parser in order to recover from an error in the code. Synthetic nodes always
- * have a length of zero (`0`).
- * @return `true` if this node is a synthetic node
+ * have a length of zero ({@code 0}).
+ * @return {@code true} if this node is a synthetic node
*/
- bool get isSynthetic => false;
+ bool isSynthetic() => false;
/**
- * Set the value of the property with the given name to the given value. If the value is`null`, the property will effectively be removed.
+ * Set the value of the property with the given name to the given value. If the value is{@code null}, the property will effectively be removed.
* @param propertyName the name of the property whose value is to be set
* @param propertyValue the new value of the property
*/
@@ -201,7 +201,7 @@
}
/**
- * If the given child is not `null`, use the given visitor to visit it.
+ * If the given child is not {@code null}, use the given visitor to visit it.
* @param child the child to be visited
* @param visitor the visitor that will be used to visit the child
*/
@@ -222,7 +222,7 @@
final int hashCode = ++_hashCodeGenerator;
}
/**
- * The interface `ASTVisitor` defines the behavior of objects that can be used to visit an AST
+ * The interface {@code ASTVisitor} defines the behavior of objects that can be used to visit an AST
* structure.
* @coverage dart.engine.ast
*/
@@ -330,13 +330,13 @@
R visitWithClause(WithClause node);
}
/**
- * Instances of the class `AdjacentStrings` represents two or more string literals that are
+ * Instances of the class {@code AdjacentStrings} represents two or more string literals that are
* implicitly concatenated because of being adjacent (separated only by whitespace).
- *
+ * <p>
* While the grammar only allows adjacent strings when all of the strings are of the same kind
* (single line or multi-line), this class doesn't enforce that restriction.
* <pre>
- * adjacentStrings ::=[StringLiteral string] [StringLiteral string]+
+ * adjacentStrings ::={@link StringLiteral string} {@link StringLiteral string}+
* </pre>
* @coverage dart.engine.ast
*/
@@ -380,14 +380,14 @@
}
}
/**
- * The abstract class `AnnotatedNode` defines the behavior of nodes that can be annotated with
+ * The abstract class {@code AnnotatedNode} defines the behavior of nodes that can be annotated with
* both a comment and metadata.
* @coverage dart.engine.ast
*/
abstract class AnnotatedNode extends ASTNode {
/**
- * The documentation comment associated with this node, or `null` if this node does not have
+ * The documentation comment associated with this node, or {@code null} if this node does not have
* a documentation comment associated with it.
*/
Comment _comment;
@@ -433,7 +433,7 @@
}
/**
- * Return the documentation comment associated with this node, or `null` if this node does
+ * Return the documentation comment associated with this node, or {@code null} if this node does
* not have a documentation comment associated with it.
* @return the documentation comment associated with this node
*/
@@ -479,8 +479,8 @@
Token get firstTokenAfterCommentAndMetadata;
/**
- * Return `true` if the comment is lexically before any annotations.
- * @return `true` if the comment is lexically before any annotations
+ * Return {@code true} if the comment is lexically before any annotations.
+ * @return {@code true} if the comment is lexically before any annotations
*/
bool commentIsBeforeAnnotations() {
if (_comment == null || _metadata.isEmpty) {
@@ -506,13 +506,13 @@
}
}
/**
- * Instances of the class `Annotation` represent an annotation that can be associated with an
+ * Instances of the class {@code Annotation} represent an annotation that can be associated with an
* AST node.
* <pre>
* metadata ::=
* annotation
* annotation ::=
- * '@' [Identifier qualified] ('.' [SimpleIdentifier identifier])? [ArgumentList arguments]?
+ * '@' {@link Identifier qualified} ('.' {@link SimpleIdentifier identifier})? {@link ArgumentList arguments}?
* </pre>
* @coverage dart.engine.ast
*/
@@ -530,19 +530,19 @@
Identifier _name;
/**
- * The period before the constructor name, or `null` if this annotation is not the
+ * The period before the constructor name, or {@code null} if this annotation is not the
* invocation of a named constructor.
*/
Token _period;
/**
- * The name of the constructor being invoked, or `null` if this annotation is not the
+ * The name of the constructor being invoked, or {@code null} if this annotation is not the
* invocation of a named constructor.
*/
SimpleIdentifier _constructorName;
/**
- * The arguments to the constructor being invoked, or `null` if this annotation is not the
+ * The arguments to the constructor being invoked, or {@code null} if this annotation is not the
* invocation of a constructor.
*/
ArgumentList _arguments;
@@ -552,11 +552,11 @@
* @param atSign the at sign that introduced the annotation
* @param name the name of the class defining the constructor that is being invoked or the name of
* the field that is being referenced
- * @param period the period before the constructor name, or `null` if this annotation is not
+ * @param period the period before the constructor name, or {@code null} if this annotation is not
* the invocation of a named constructor
- * @param constructorName the name of the constructor being invoked, or `null` if this
+ * @param constructorName the name of the constructor being invoked, or {@code null} if this
* annotation is not the invocation of a named constructor
- * @param arguments the arguments to the constructor being invoked, or `null` if this
+ * @param arguments the arguments to the constructor being invoked, or {@code null} if this
* annotation is not the invocation of a constructor
*/
Annotation.full(Token atSign, Identifier name, Token period, SimpleIdentifier constructorName, ArgumentList arguments) {
@@ -572,18 +572,18 @@
* @param atSign the at sign that introduced the annotation
* @param name the name of the class defining the constructor that is being invoked or the name of
* the field that is being referenced
- * @param period the period before the constructor name, or `null` if this annotation is not
+ * @param period the period before the constructor name, or {@code null} if this annotation is not
* the invocation of a named constructor
- * @param constructorName the name of the constructor being invoked, or `null` if this
+ * @param constructorName the name of the constructor being invoked, or {@code null} if this
* annotation is not the invocation of a named constructor
- * @param arguments the arguments to the constructor being invoked, or `null` if this
+ * @param arguments the arguments to the constructor being invoked, or {@code null} if this
* annotation is not the invocation of a constructor
*/
Annotation({Token atSign, Identifier name, Token period, SimpleIdentifier constructorName, ArgumentList arguments}) : this.full(atSign, name, period, constructorName, arguments);
accept(ASTVisitor visitor) => visitor.visitAnnotation(this);
/**
- * Return the arguments to the constructor being invoked, or `null` if this annotation is
+ * Return the arguments to the constructor being invoked, or {@code null} if this annotation is
* not the invocation of a constructor.
* @return the arguments to the constructor being invoked
*/
@@ -597,14 +597,14 @@
Token get beginToken => _atSign;
/**
- * Return the name of the constructor being invoked, or `null` if this annotation is not the
+ * Return the name of the constructor being invoked, or {@code null} if this annotation is not the
* invocation of a named constructor.
* @return the name of the constructor being invoked
*/
SimpleIdentifier get constructorName => _constructorName;
/**
- * Return the element associated with this annotation, or `null` if the AST structure has
+ * Return the element associated with this annotation, or {@code null} if the AST structure has
* not been resolved or if this annotation could not be resolved.
* @return the element associated with this annotation
*/
@@ -633,7 +633,7 @@
Identifier get name => _name;
/**
- * Return the period before the constructor name, or `null` if this annotation is not the
+ * Return the period before the constructor name, or {@code null} if this annotation is not the
* invocation of a named constructor.
* @return the period before the constructor name
*/
@@ -686,10 +686,10 @@
}
}
/**
- * Instances of the class `ArgumentDefinitionTest` represent an argument definition test.
+ * Instances of the class {@code ArgumentDefinitionTest} represent an argument definition test.
* <pre>
* argumentDefinitionTest ::=
- * '?' [SimpleIdentifier identifier]</pre>
+ * '?' {@link SimpleIdentifier identifier}</pre>
* @coverage dart.engine.ast
*/
class ArgumentDefinitionTest extends Expression {
@@ -756,13 +756,13 @@
}
}
/**
- * Instances of the class `ArgumentList` represent a list of arguments in the invocation of a
+ * Instances of the class {@code ArgumentList} represent a list of arguments in the invocation of a
* executable element: a function, method, or constructor.
* <pre>
* argumentList ::=
* '(' arguments? ')'
- * arguments ::=[NamedExpression namedArgument] (',' [NamedExpression namedArgument])
- * | [Expression expressionList] (',' [NamedExpression namedArgument])
+ * arguments ::={@link NamedExpression namedArgument} (',' {@link NamedExpression namedArgument})
+ * | {@link Expression expressionList} (',' {@link NamedExpression namedArgument})
* </pre>
* @coverage dart.engine.ast
*/
@@ -785,18 +785,18 @@
/**
* An array containing the elements representing the parameters corresponding to each of the
- * arguments in this list, or `null` if the AST has not been resolved or if the function or
+ * arguments in this list, or {@code null} if the AST has not been resolved or if the function or
* method being invoked could not be determined based on static type information. The array must
- * be the same length as the number of arguments, but can contain `null` entries if a given
+ * be the same length as the number of arguments, but can contain {@code null} entries if a given
* argument does not correspond to a formal parameter.
*/
List<ParameterElement> _correspondingStaticParameters;
/**
* An array containing the elements representing the parameters corresponding to each of the
- * arguments in this list, or `null` if the AST has not been resolved or if the function or
+ * arguments in this list, or {@code null} if the AST has not been resolved or if the function or
* method being invoked could not be determined based on propagated type information. The array
- * must be the same length as the number of arguments, but can contain `null` entries if a
+ * must be the same length as the number of arguments, but can contain {@code null} entries if a
* given argument does not correspond to a formal parameter.
*/
List<ParameterElement> _correspondingPropagatedParameters;
@@ -848,7 +848,7 @@
/**
* Set the parameter elements corresponding to each of the arguments in this list to the given
* array of parameters. The array of parameters must be the same length as the number of
- * arguments, but can contain `null` entries if a given argument does not correspond to a
+ * arguments, but can contain {@code null} entries if a given argument does not correspond to a
* formal parameter.
* @param parameters the parameter elements corresponding to the arguments
*/
@@ -862,7 +862,7 @@
/**
* Set the parameter elements corresponding to each of the arguments in this list to the given
* array of parameters. The array of parameters must be the same length as the number of
- * arguments, but can contain `null` entries if a given argument does not correspond to a
+ * arguments, but can contain {@code null} entries if a given argument does not correspond to a
* formal parameter.
* @param parameters the parameter elements corresponding to the arguments
*/
@@ -897,9 +897,9 @@
* the function being invoked is known based on propagated type information, and the expression
* corresponds to one of the parameters of the function being invoked, then return the parameter
* element representing the parameter to which the value of the given expression will be bound.
- * Otherwise, return `null`.
- *
- * This method is only intended to be used by [Expression#getParameterElement].
+ * Otherwise, return {@code null}.
+ * <p>
+ * This method is only intended to be used by {@link Expression#getParameterElement()}.
* @param expression the expression corresponding to the parameter to be returned
* @return the parameter element representing the parameter to which the value of the expression
* will be bound
@@ -920,9 +920,9 @@
* the function being invoked is known based on static type information, and the expression
* corresponds to one of the parameters of the function being invoked, then return the parameter
* element representing the parameter to which the value of the given expression will be bound.
- * Otherwise, return `null`.
- *
- * This method is only intended to be used by [Expression#getStaticParameterElement].
+ * Otherwise, return {@code null}.
+ * <p>
+ * This method is only intended to be used by {@link Expression#getStaticParameterElement()}.
* @param expression the expression corresponding to the parameter to be returned
* @return the parameter element representing the parameter to which the value of the expression
* will be bound
@@ -939,9 +939,9 @@
}
}
/**
- * Instances of the class `AsExpression` represent an 'as' expression.
+ * Instances of the class {@code AsExpression} represent an 'as' expression.
* <pre>
- * asExpression ::=[Expression expression] 'as' [TypeName type]</pre>
+ * asExpression ::={@link Expression expression} 'as' {@link TypeName type}</pre>
* @coverage dart.engine.ast
*/
class AsExpression extends Expression {
@@ -1031,10 +1031,10 @@
}
}
/**
- * Instances of the class `AssertStatement` represent an assert statement.
+ * Instances of the class {@code AssertStatement} represent an assert statement.
* <pre>
* assertStatement ::=
- * 'assert' '(' [Expression conditionalExpression] ')' ';'
+ * 'assert' '(' {@link Expression conditionalExpression} ')' ';'
* </pre>
* @coverage dart.engine.ast
*/
@@ -1051,7 +1051,7 @@
Token _leftParenthesis;
/**
- * The condition that is being asserted to be `true`.
+ * The condition that is being asserted to be {@code true}.
*/
Expression _condition;
@@ -1069,7 +1069,7 @@
* Initialize a newly created assert statement.
* @param keyword the token representing the 'assert' keyword
* @param leftParenthesis the left parenthesis
- * @param condition the condition that is being asserted to be `true`
+ * @param condition the condition that is being asserted to be {@code true}
* @param rightParenthesis the right parenthesis
* @param semicolon the semicolon terminating the statement
*/
@@ -1085,7 +1085,7 @@
* Initialize a newly created assert statement.
* @param keyword the token representing the 'assert' keyword
* @param leftParenthesis the left parenthesis
- * @param condition the condition that is being asserted to be `true`
+ * @param condition the condition that is being asserted to be {@code true}
* @param rightParenthesis the right parenthesis
* @param semicolon the semicolon terminating the statement
*/
@@ -1094,8 +1094,8 @@
Token get beginToken => _keyword;
/**
- * Return the condition that is being asserted to be `true`.
- * @return the condition that is being asserted to be `true`
+ * Return the condition that is being asserted to be {@code true}.
+ * @return the condition that is being asserted to be {@code true}
*/
Expression get condition => _condition;
Token get endToken => _semicolon;
@@ -1125,8 +1125,8 @@
Token get semicolon => _semicolon;
/**
- * Set the condition that is being asserted to be `true` to the given expression.
- * @param the condition that is being asserted to be `true`
+ * Set the condition that is being asserted to be {@code true} to the given expression.
+ * @param the condition that is being asserted to be {@code true}
*/
void set condition(Expression condition2) {
this._condition = becomeParentOf(condition2);
@@ -1168,9 +1168,9 @@
}
}
/**
- * Instances of the class `AssignmentExpression` represent an assignment expression.
+ * Instances of the class {@code AssignmentExpression} represent an assignment expression.
* <pre>
- * assignmentExpression ::=[Expression leftHandSide] [Token operator] [Expression rightHandSide]</pre>
+ * assignmentExpression ::={@link Expression leftHandSide} {@link Token operator} {@link Expression rightHandSide}</pre>
* @coverage dart.engine.ast
*/
class AssignmentExpression extends Expression {
@@ -1191,13 +1191,13 @@
Expression _rightHandSide;
/**
- * The element associated with the operator based on the static type of the left-hand-side, or`null` if the AST structure has not been resolved, if the operator is not a compound
+ * The element associated with the operator based on the static type of the left-hand-side, or{@code null} if the AST structure has not been resolved, if the operator is not a compound
* operator, or if the operator could not be resolved.
*/
MethodElement _staticElement;
/**
- * The element associated with the operator based on the propagated type of the left-hand-side, or`null` if the AST structure has not been resolved, if the operator is not a compound
+ * The element associated with the operator based on the propagated type of the left-hand-side, or{@code null} if the AST structure has not been resolved, if the operator is not a compound
* operator, or if the operator could not be resolved.
*/
MethodElement _propagatedElement;
@@ -1226,7 +1226,7 @@
/**
* Return the element associated with the operator based on the propagated type of the
- * left-hand-side, or `null` if the AST structure has not been resolved, if the operator is
+ * left-hand-side, or {@code null} if the AST structure has not been resolved, if the operator is
* not a compound operator, or if the operator could not be resolved. One example of the latter
* case is an operator that is not defined for the type of the left-hand operand.
* @return the element associated with the operator
@@ -1254,7 +1254,7 @@
/**
* Return the element associated with the operator based on the static type of the left-hand-side,
- * or `null` if the AST structure has not been resolved, if the operator is not a compound
+ * or {@code null} if the AST structure has not been resolved, if the operator is not a compound
* operator, or if the operator could not be resolved. One example of the latter case is an
* operator that is not defined for the type of the left-hand operand.
* @return the element associated with the operator
@@ -1308,9 +1308,9 @@
}
}
/**
- * Instances of the class `BinaryExpression` represent a binary (infix) expression.
+ * Instances of the class {@code BinaryExpression} represent a binary (infix) expression.
* <pre>
- * binaryExpression ::=[Expression leftOperand] [Token operator] [Expression rightOperand]</pre>
+ * binaryExpression ::={@link Expression leftOperand} {@link Token operator} {@link Expression rightOperand}</pre>
* @coverage dart.engine.ast
*/
class BinaryExpression extends Expression {
@@ -1331,13 +1331,13 @@
Expression _rightOperand;
/**
- * The element associated with the operator based on the static type of the left operand, or`null` if the AST structure has not been resolved, if the operator is not user definable,
+ * The element associated with the operator based on the static type of the left operand, or{@code null} if the AST structure has not been resolved, if the operator is not user definable,
* or if the operator could not be resolved.
*/
MethodElement _staticElement;
/**
- * The element associated with the operator based on the propagated type of the left operand, or`null` if the AST structure has not been resolved, if the operator is not user definable,
+ * The element associated with the operator based on the propagated type of the left operand, or{@code null} if the AST structure has not been resolved, if the operator is not user definable,
* or if the operator could not be resolved.
*/
MethodElement _propagatedElement;
@@ -1366,7 +1366,7 @@
/**
* Return the element associated with the operator based on the propagated type of the left
- * operand, or `null` if the AST structure has not been resolved, if the operator is not
+ * operand, or {@code null} if the AST structure has not been resolved, if the operator is not
* user definable, or if the operator could not be resolved. One example of the latter case is an
* operator that is not defined for the type of the left-hand operand.
* @return the element associated with the operator
@@ -1394,7 +1394,7 @@
/**
* Return the element associated with the operator based on the static type of the left operand,
- * or `null` if the AST structure has not been resolved, if the operator is not user
+ * or {@code null} if the AST structure has not been resolved, if the operator is not user
* definable, or if the operator could not be resolved. One example of the latter case is an
* operator that is not defined for the type of the left operand.
* @return the element associated with the operator
@@ -1450,9 +1450,9 @@
/**
* If the AST structure has been resolved, and the function being invoked is known based on
* propagated type information, then return the parameter element representing the parameter to
- * which the value of the right operand will be bound. Otherwise, return `null`.
- *
- * This method is only intended to be used by [Expression#getParameterElement].
+ * which the value of the right operand will be bound. Otherwise, return {@code null}.
+ * <p>
+ * This method is only intended to be used by {@link Expression#getParameterElement()}.
* @return the parameter element representing the parameter to which the value of the right
* operand will be bound
*/
@@ -1470,9 +1470,9 @@
/**
* If the AST structure has been resolved, and the function being invoked is known based on static
* type information, then return the parameter element representing the parameter to which the
- * value of the right operand will be bound. Otherwise, return `null`.
- *
- * This method is only intended to be used by [Expression#getStaticParameterElement].
+ * value of the right operand will be bound. Otherwise, return {@code null}.
+ * <p>
+ * This method is only intended to be used by {@link Expression#getStaticParameterElement()}.
* @return the parameter element representing the parameter to which the value of the right
* operand will be bound
*/
@@ -1488,7 +1488,7 @@
}
}
/**
- * Instances of the class `Block` represent a sequence of statements.
+ * Instances of the class {@code Block} represent a sequence of statements.
* <pre>
* block ::=
* '{' statement* '}'
@@ -1574,10 +1574,10 @@
}
}
/**
- * Instances of the class `BlockFunctionBody` represent a function body that consists of a
+ * Instances of the class {@code BlockFunctionBody} represent a function body that consists of a
* block of statements.
* <pre>
- * blockFunctionBody ::=[Block block]</pre>
+ * blockFunctionBody ::={@link Block block}</pre>
* @coverage dart.engine.ast
*/
class BlockFunctionBody extends FunctionBody {
@@ -1622,7 +1622,7 @@
}
}
/**
- * Instances of the class `BooleanLiteral` represent a boolean literal expression.
+ * Instances of the class {@code BooleanLiteral} represent a boolean literal expression.
* <pre>
* booleanLiteral ::=
* 'false' | 'true'
@@ -1672,7 +1672,7 @@
* @return the value of the literal
*/
bool get value => _value;
- bool get isSynthetic => _literal.isSynthetic;
+ bool isSynthetic() => _literal.isSynthetic();
/**
* Set the token representing the literal to the given token.
@@ -1693,10 +1693,10 @@
}
}
/**
- * Instances of the class `BreakStatement` represent a break statement.
+ * Instances of the class {@code BreakStatement} represent a break statement.
* <pre>
* breakStatement ::=
- * 'break' [SimpleIdentifier label]? ';'
+ * 'break' {@link SimpleIdentifier label}? ';'
* </pre>
* @coverage dart.engine.ast
*/
@@ -1708,7 +1708,7 @@
Token _keyword;
/**
- * The label associated with the statement, or `null` if there is no label.
+ * The label associated with the statement, or {@code null} if there is no label.
*/
SimpleIdentifier _label;
@@ -1747,7 +1747,7 @@
Token get keyword => _keyword;
/**
- * Return the label associated with the statement, or `null` if there is no label.
+ * Return the label associated with the statement, or {@code null} if there is no label.
* @return the label associated with the statement
*/
SimpleIdentifier get label => _label;
@@ -1786,11 +1786,11 @@
}
}
/**
- * Instances of the class `CascadeExpression` represent a sequence of cascaded expressions:
+ * Instances of the class {@code CascadeExpression} represent a sequence of cascaded expressions:
* expressions that share a common target. There are three kinds of expressions that can be used in
- * a cascade expression: [IndexExpression], [MethodInvocation] and[PropertyAccess].
+ * a cascade expression: {@link IndexExpression}, {@link MethodInvocation} and{@link PropertyAccess}.
* <pre>
- * cascadeExpression ::=[Expression conditionalExpression] cascadeSection
+ * cascadeExpression ::={@link Expression conditionalExpression} cascadeSection
* cascadeSection ::=
* '..' (cascadeSelector arguments*) (assignableSelector arguments*)* (assignmentOperator expressionWithoutCascade)?
* cascadeSelector ::=
@@ -1857,29 +1857,29 @@
}
}
/**
- * Instances of the class `CatchClause` represent a catch clause within a try statement.
+ * Instances of the class {@code CatchClause} represent a catch clause within a try statement.
* <pre>
* onPart ::=
- * catchPart [Block block]| 'on' type catchPart? [Block block]catchPart ::=
- * 'catch' '(' [SimpleIdentifier exceptionParameter] (',' [SimpleIdentifier stackTraceParameter])? ')'
+ * catchPart {@link Block block}| 'on' type catchPart? {@link Block block}catchPart ::=
+ * 'catch' '(' {@link SimpleIdentifier exceptionParameter} (',' {@link SimpleIdentifier stackTraceParameter})? ')'
* </pre>
* @coverage dart.engine.ast
*/
class CatchClause extends ASTNode {
/**
- * The token representing the 'on' keyword, or `null` if there is no 'on' keyword.
+ * The token representing the 'on' keyword, or {@code null} if there is no 'on' keyword.
*/
Token _onKeyword;
/**
- * The type of exceptions caught by this catch clause, or `null` if this catch clause
+ * The type of exceptions caught by this catch clause, or {@code null} if this catch clause
* catches every type of exception.
*/
TypeName _exceptionType;
/**
- * The token representing the 'catch' keyword, or `null` if there is no 'catch' keyword.
+ * The token representing the 'catch' keyword, or {@code null} if there is no 'catch' keyword.
*/
Token _catchKeyword;
@@ -1965,7 +1965,7 @@
Block get body => _body;
/**
- * Return the token representing the 'catch' keyword, or `null` if there is no 'catch'
+ * Return the token representing the 'catch' keyword, or {@code null} if there is no 'catch'
* keyword.
* @return the token representing the 'catch' keyword
*/
@@ -1985,7 +1985,7 @@
SimpleIdentifier get exceptionParameter => _exceptionParameter;
/**
- * Return the type of exceptions caught by this catch clause, or `null` if this catch clause
+ * Return the type of exceptions caught by this catch clause, or {@code null} if this catch clause
* catches every type of exception.
* @return the type of exceptions caught by this catch clause
*/
@@ -1998,7 +1998,7 @@
Token get leftParenthesis => _leftParenthesis;
/**
- * Return the token representing the 'on' keyword, or `null` if there is no 'on' keyword.
+ * Return the token representing the 'on' keyword, or {@code null} if there is no 'on' keyword.
* @return the token representing the 'on' keyword
*/
Token get onKeyword => _onKeyword;
@@ -2096,19 +2096,19 @@
}
}
/**
- * Instances of the class `ClassDeclaration` represent the declaration of a class.
+ * Instances of the class {@code ClassDeclaration} represent the declaration of a class.
* <pre>
* classDeclaration ::=
- * 'abstract'? 'class' [SimpleIdentifier name] [TypeParameterList typeParameterList]?
- * ([ExtendsClause extendsClause] [WithClause withClause]?)?[ImplementsClause implementsClause]?
- * '{' [ClassMember classMember]* '}'
+ * 'abstract'? 'class' {@link SimpleIdentifier name} {@link TypeParameterList typeParameterList}?
+ * ({@link ExtendsClause extendsClause} {@link WithClause withClause}?)?{@link ImplementsClause implementsClause}?
+ * '{' {@link ClassMember classMember}* '}'
* </pre>
* @coverage dart.engine.ast
*/
class ClassDeclaration extends CompilationUnitMember {
/**
- * The 'abstract' keyword, or `null` if the keyword was absent.
+ * The 'abstract' keyword, or {@code null} if the keyword was absent.
*/
Token _abstractKeyword;
@@ -2123,23 +2123,23 @@
SimpleIdentifier _name;
/**
- * The type parameters for the class, or `null` if the class does not have any type
+ * The type parameters for the class, or {@code null} if the class does not have any type
* parameters.
*/
TypeParameterList _typeParameters;
/**
- * The extends clause for the class, or `null` if the class does not extend any other class.
+ * The extends clause for the class, or {@code null} if the class does not extend any other class.
*/
ExtendsClause _extendsClause;
/**
- * The with clause for the class, or `null` if the class does not have a with clause.
+ * The with clause for the class, or {@code null} if the class does not have a with clause.
*/
WithClause _withClause;
/**
- * The implements clause for the class, or `null` if the class does not implement any
+ * The implements clause for the class, or {@code null} if the class does not implement any
* interfaces.
*/
ImplementsClause _implementsClause;
@@ -2163,7 +2163,7 @@
* Initialize a newly created class declaration.
* @param comment the documentation comment associated with this class
* @param metadata the annotations associated with this class
- * @param abstractKeyword the 'abstract' keyword, or `null` if the keyword was absent
+ * @param abstractKeyword the 'abstract' keyword, or {@code null} if the keyword was absent
* @param classKeyword the token representing the 'class' keyword
* @param name the name of the class being declared
* @param typeParameters the type parameters for the class
@@ -2192,7 +2192,7 @@
* Initialize a newly created class declaration.
* @param comment the documentation comment associated with this class
* @param metadata the annotations associated with this class
- * @param abstractKeyword the 'abstract' keyword, or `null` if the keyword was absent
+ * @param abstractKeyword the 'abstract' keyword, or {@code null} if the keyword was absent
* @param classKeyword the token representing the 'class' keyword
* @param name the name of the class being declared
* @param typeParameters the type parameters for the class
@@ -2207,7 +2207,7 @@
accept(ASTVisitor visitor) => visitor.visitClassDeclaration(this);
/**
- * Return the 'abstract' keyword, or `null` if the keyword was absent.
+ * Return the 'abstract' keyword, or {@code null} if the keyword was absent.
* @return the 'abstract' keyword
*/
Token get abstractKeyword => _abstractKeyword;
@@ -2221,14 +2221,14 @@
Token get endToken => _rightBracket;
/**
- * Return the extends clause for this class, or `null` if the class does not extend any
+ * Return the extends clause for this class, or {@code null} if the class does not extend any
* other class.
* @return the extends clause for this class
*/
ExtendsClause get extendsClause => _extendsClause;
/**
- * Return the implements clause for the class, or `null` if the class does not implement any
+ * Return the implements clause for the class, or {@code null} if the class does not implement any
* interfaces.
* @return the implements clause for the class
*/
@@ -2259,14 +2259,14 @@
Token get rightBracket => _rightBracket;
/**
- * Return the type parameters for the class, or `null` if the class does not have any type
+ * Return the type parameters for the class, or {@code null} if the class does not have any type
* parameters.
* @return the type parameters for the class
*/
TypeParameterList get typeParameters => _typeParameters;
/**
- * Return the with clause for the class, or `null` if the class does not have a with clause.
+ * Return the with clause for the class, or {@code null} if the class does not have a with clause.
* @return the with clause for the class
*/
WithClause get withClause => _withClause;
@@ -2359,7 +2359,7 @@
}
}
/**
- * The abstract class `ClassMember` defines the behavior common to nodes that declare a name
+ * The abstract class {@code ClassMember} defines the behavior common to nodes that declare a name
* within the scope of a class.
* @coverage dart.engine.ast
*/
@@ -2381,10 +2381,10 @@
ClassMember({Comment comment, List<Annotation> metadata}) : this.full(comment, metadata);
}
/**
- * Instances of the class `ClassTypeAlias` represent a class type alias.
+ * Instances of the class {@code ClassTypeAlias} represent a class type alias.
* <pre>
- * classTypeAlias ::=[SimpleIdentifier identifier] [TypeParameterList typeParameters]? '=' 'abstract'? mixinApplication
- * mixinApplication ::=[TypeName superclass] [WithClause withClause] [ImplementsClause implementsClause]? ';'
+ * classTypeAlias ::={@link SimpleIdentifier identifier} {@link TypeParameterList typeParameters}? '=' 'abstract'? mixinApplication
+ * mixinApplication ::={@link TypeName superclass} {@link WithClause withClause} {@link ImplementsClause implementsClause}? ';'
* </pre>
* @coverage dart.engine.ast
*/
@@ -2396,7 +2396,7 @@
SimpleIdentifier _name;
/**
- * The type parameters for the class, or `null` if the class does not have any type
+ * The type parameters for the class, or {@code null} if the class does not have any type
* parameters.
*/
TypeParameterList _typeParameters;
@@ -2407,7 +2407,7 @@
Token _equals;
/**
- * The token for the 'abstract' keyword, or `null` if this is not defining an abstract
+ * The token for the 'abstract' keyword, or {@code null} if this is not defining an abstract
* class.
*/
Token _abstractKeyword;
@@ -2423,7 +2423,7 @@
WithClause _withClause;
/**
- * The implements clause for this class, or `null` if there is no implements clause.
+ * The implements clause for this class, or {@code null} if there is no implements clause.
*/
ImplementsClause _implementsClause;
@@ -2469,7 +2469,7 @@
accept(ASTVisitor visitor) => visitor.visitClassTypeAlias(this);
/**
- * Return the token for the 'abstract' keyword, or `null` if this is not defining an
+ * Return the token for the 'abstract' keyword, or {@code null} if this is not defining an
* abstract class.
* @return the token for the 'abstract' keyword
*/
@@ -2483,7 +2483,7 @@
Token get equals => _equals;
/**
- * Return the implements clause for this class, or `null` if there is no implements clause.
+ * Return the implements clause for this class, or {@code null} if there is no implements clause.
* @return the implements clause for this class
*/
ImplementsClause get implementsClause => _implementsClause;
@@ -2501,7 +2501,7 @@
TypeName get superclass => _superclass;
/**
- * Return the type parameters for the class, or `null` if the class does not have any type
+ * Return the type parameters for the class, or {@code null} if the class does not have any type
* parameters.
* @return the type parameters for the class
*/
@@ -2578,10 +2578,10 @@
}
}
/**
- * Instances of the class `Combinator` represent the combinator associated with an import
+ * Instances of the class {@code Combinator} represent the combinator associated with an import
* directive.
* <pre>
- * combinator ::=[HideCombinator hideCombinator]| [ShowCombinator showCombinator]</pre>
+ * combinator ::={@link HideCombinator hideCombinator}| {@link ShowCombinator showCombinator}</pre>
* @coverage dart.engine.ast
*/
abstract class Combinator extends ASTNode {
@@ -2625,7 +2625,7 @@
}
}
/**
- * Instances of the class `Comment` represent a comment within the source code.
+ * Instances of the class {@code Comment} represent a comment within the source code.
* <pre>
* comment ::=
* endOfLineComment
@@ -2636,7 +2636,7 @@
* blockComment ::=
* '/ *' CHARACTER* '*/'
* documentationComment ::=
- * '/ **' (CHARACTER | [CommentReference commentReference])* '*/'
+ * '/ **' (CHARACTER | {@link CommentReference commentReference})* '*/'
* | ('///' (CHARACTER - EOL)* EOL)+
* </pre>
* @coverage dart.engine.ast
@@ -2725,28 +2725,28 @@
List<Token> get tokens => _tokens;
/**
- * Return `true` if this is a block comment.
- * @return `true` if this is a block comment
+ * Return {@code true} if this is a block comment.
+ * @return {@code true} if this is a block comment
*/
- bool get isBlock => identical(_type, CommentType.BLOCK);
+ bool isBlock() => identical(_type, CommentType.BLOCK);
/**
- * Return `true` if this is a documentation comment.
- * @return `true` if this is a documentation comment
+ * Return {@code true} if this is a documentation comment.
+ * @return {@code true} if this is a documentation comment
*/
- bool get isDocumentation => identical(_type, CommentType.DOCUMENTATION);
+ bool isDocumentation() => identical(_type, CommentType.DOCUMENTATION);
/**
- * Return `true` if this is an end-of-line comment.
- * @return `true` if this is an end-of-line comment
+ * Return {@code true} if this is an end-of-line comment.
+ * @return {@code true} if this is an end-of-line comment
*/
- bool get isEndOfLine => identical(_type, CommentType.END_OF_LINE);
+ bool isEndOfLine() => identical(_type, CommentType.END_OF_LINE);
void visitChildren(ASTVisitor<Object> visitor) {
_references.accept(visitor);
}
}
/**
- * The enumeration `CommentType` encodes all the different types of comments that are
+ * The enumeration {@code CommentType} encodes all the different types of comments that are
* recognized by the parser.
*/
class CommentType implements Comparable<CommentType> {
@@ -2779,18 +2779,18 @@
String toString() => name;
}
/**
- * Instances of the class `CommentReference` represent a reference to a Dart element that is
+ * Instances of the class {@code CommentReference} represent a reference to a Dart element that is
* found within a documentation comment.
* <pre>
* commentReference ::=
- * '\[' 'new'? [Identifier identifier] '\]'
+ * '\[' 'new'? {@link Identifier identifier} '\]'
* </pre>
* @coverage dart.engine.ast
*/
class CommentReference extends ASTNode {
/**
- * The token representing the 'new' keyword, or `null` if there was no 'new' keyword.
+ * The token representing the 'new' keyword, or {@code null} if there was no 'new' keyword.
*/
Token _newKeyword;
@@ -2826,7 +2826,7 @@
Identifier get identifier => _identifier;
/**
- * Return the token representing the 'new' keyword, or `null` if there was no 'new' keyword.
+ * Return the token representing the 'new' keyword, or {@code null} if there was no 'new' keyword.
* @return the token representing the 'new' keyword
*/
Token get newKeyword => _newKeyword;
@@ -2851,8 +2851,8 @@
}
}
/**
- * Instances of the class `CompilationUnit` represent a compilation unit.
- *
+ * Instances of the class {@code CompilationUnit} represent a compilation unit.
+ * <p>
* While the grammar restricts the order of the directives and declarations within a compilation
* unit, this class does not enforce those restrictions. In particular, the children of a
* compilation unit will be visited in lexical order even if lexical order does not conform to the
@@ -2860,7 +2860,7 @@
* <pre>
* compilationUnit ::=
* directives declarations
- * directives ::=[ScriptTag scriptTag]? [LibraryDirective libraryDirective]? namespaceDirective* [PartDirective partDirective]| [PartOfDirective partOfDirective]namespaceDirective ::=[ImportDirective importDirective]| [ExportDirective exportDirective]declarations ::=[CompilationUnitMember compilationUnitMember]</pre>
+ * directives ::={@link ScriptTag scriptTag}? {@link LibraryDirective libraryDirective}? namespaceDirective* {@link PartDirective partDirective}| {@link PartOfDirective partOfDirective}namespaceDirective ::={@link ImportDirective importDirective}| {@link ExportDirective exportDirective}declarations ::={@link CompilationUnitMember compilationUnitMember}</pre>
* @coverage dart.engine.ast
*/
class CompilationUnit extends ASTNode {
@@ -2871,7 +2871,7 @@
Token _beginToken;
/**
- * The script tag at the beginning of the compilation unit, or `null` if there is no script
+ * The script tag at the beginning of the compilation unit, or {@code null} if there is no script
* tag in this compilation unit.
*/
ScriptTag _scriptTag;
@@ -2888,18 +2888,18 @@
/**
* The last token in the token stream that was parsed to form this compilation unit. This token
- * should always have a type of [TokenType.EOF].
+ * should always have a type of {@link TokenType.EOF}.
*/
Token _endToken;
/**
- * The element associated with this compilation unit, or `null` if the AST structure has not
+ * The element associated with this compilation unit, or {@code null} if the AST structure has not
* been resolved.
*/
CompilationUnitElement _element;
/**
- * The [LineInfo] for this [CompilationUnit].
+ * The {@link LineInfo} for this {@link CompilationUnit}.
*/
LineInfo _lineInfo;
@@ -2956,7 +2956,7 @@
NodeList<Directive> get directives => _directives;
/**
- * Return the element associated with this compilation unit, or `null` if the AST structure
+ * Return the element associated with this compilation unit, or {@code null} if the AST structure
* has not been resolved.
* @return the element associated with this compilation unit
*/
@@ -2965,8 +2965,8 @@
/**
* Return an array containing all of the errors associated with the receiver. If the receiver has
- * not been resolved, then return `null`.
- * @return an array of errors (contains no `null`s) or `null` if the receiver has not
+ * not been resolved, then return {@code null}.
+ * @return an array of errors (contains no {@code null}s) or {@code null} if the receiver has not
* been resolved
*/
List<AnalysisError> get errors {
@@ -2992,28 +2992,28 @@
}
/**
- * Get the [LineInfo] object for this compilation unit.
- * @return the associated [LineInfo]
+ * Get the {@link LineInfo} object for this compilation unit.
+ * @return the associated {@link LineInfo}
*/
LineInfo get lineInfo => _lineInfo;
int get offset => 0;
/**
* Return an array containing all of the parsing errors associated with the receiver.
- * @return an array of errors (not `null`, contains no `null`s).
+ * @return an array of errors (not {@code null}, contains no {@code null}s).
*/
List<AnalysisError> get parsingErrors => _parsingErrors;
/**
* Return an array containing all of the resolution errors associated with the receiver. If the
- * receiver has not been resolved, then return `null`.
- * @return an array of errors (contains no `null`s) or `null` if the receiver has not
+ * receiver has not been resolved, then return {@code null}.
+ * @return an array of errors (contains no {@code null}s) or {@code null} if the receiver has not
* been resolved
*/
List<AnalysisError> get resolutionErrors => _resolutionErrors;
/**
- * Return the script tag at the beginning of the compilation unit, or `null` if there is no
+ * Return the script tag at the beginning of the compilation unit, or {@code null} if there is no
* script tag in this compilation unit.
* @return the script tag at the beginning of the compilation unit
*/
@@ -3028,7 +3028,7 @@
}
/**
- * Set the [LineInfo] object for this compilation unit.
+ * Set the {@link LineInfo} object for this compilation unit.
* @param errors LineInfo to associate with this compilation unit
*/
void set lineInfo(LineInfo lineInfo2) {
@@ -3037,8 +3037,8 @@
/**
* Called to cache the parsing errors when the unit is parsed.
- * @param errors an array of parsing errors, if `null` is passed, the error array is set to
- * an empty array, [AnalysisError#NO_ERRORS]
+ * @param errors an array of parsing errors, if {@code null} is passed, the error array is set to
+ * an empty array, {@link AnalysisError#NO_ERRORS}
*/
void set parsingErrors(List<AnalysisError> errors) {
_parsingErrors = errors == null ? AnalysisError.NO_ERRORS : errors;
@@ -3046,8 +3046,8 @@
/**
* Called to cache the resolution errors when the unit is resolved.
- * @param errors an array of resolution errors, if `null` is passed, the error array is set
- * to an empty array, [AnalysisError#NO_ERRORS]
+ * @param errors an array of resolution errors, if {@code null} is passed, the error array is set
+ * to an empty array, {@link AnalysisError#NO_ERRORS}
*/
void set resolutionErrors(List<AnalysisError> errors) {
_resolutionErrors = errors == null ? AnalysisError.NO_ERRORS : errors;
@@ -3073,8 +3073,8 @@
}
/**
- * Return `true` if all of the directives are lexically before any declarations.
- * @return `true` if all of the directives are lexically before any declarations
+ * Return {@code true} if all of the directives are lexically before any declarations.
+ * @return {@code true} if all of the directives are lexically before any declarations
*/
bool directivesAreBeforeDeclarations() {
if (_directives.isEmpty || _declarations.isEmpty) {
@@ -3101,10 +3101,10 @@
}
}
/**
- * Instances of the class `CompilationUnitMember` defines the behavior common to nodes that
+ * Instances of the class {@code CompilationUnitMember} defines the behavior common to nodes that
* declare a name within the scope of a compilation unit.
* <pre>
- * compilationUnitMember ::=[ClassDeclaration classDeclaration]| [TypeAlias typeAlias]| [FunctionDeclaration functionDeclaration]| [MethodDeclaration getOrSetDeclaration]| [VariableDeclaration constantsDeclaration]| [VariableDeclaration variablesDeclaration]</pre>
+ * compilationUnitMember ::={@link ClassDeclaration classDeclaration}| {@link TypeAlias typeAlias}| {@link FunctionDeclaration functionDeclaration}| {@link MethodDeclaration getOrSetDeclaration}| {@link VariableDeclaration constantsDeclaration}| {@link VariableDeclaration variablesDeclaration}</pre>
* @coverage dart.engine.ast
*/
abstract class CompilationUnitMember extends Declaration {
@@ -3125,9 +3125,9 @@
CompilationUnitMember({Comment comment, List<Annotation> metadata}) : this.full(comment, metadata);
}
/**
- * Instances of the class `ConditionalExpression` represent a conditional expression.
+ * Instances of the class {@code ConditionalExpression} represent a conditional expression.
* <pre>
- * conditionalExpression ::=[Expression condition] '?' [Expression thenExpression] ':' [Expression elseExpression]</pre>
+ * conditionalExpression ::={@link Expression condition} '?' {@link Expression thenExpression} ':' {@link Expression elseExpression}</pre>
* @coverage dart.engine.ast
*/
class ConditionalExpression extends Expression {
@@ -3143,7 +3143,7 @@
Token _question;
/**
- * The expression that is executed if the condition evaluates to `true`.
+ * The expression that is executed if the condition evaluates to {@code true}.
*/
Expression _thenExpression;
@@ -3153,7 +3153,7 @@
Token _colon;
/**
- * The expression that is executed if the condition evaluates to `false`.
+ * The expression that is executed if the condition evaluates to {@code false}.
*/
Expression _elseExpression;
@@ -3161,9 +3161,9 @@
* Initialize a newly created conditional expression.
* @param condition the condition used to determine which expression is executed next
* @param question the token used to separate the condition from the then expression
- * @param thenExpression the expression that is executed if the condition evaluates to`true`
+ * @param thenExpression the expression that is executed if the condition evaluates to{@code true}
* @param colon the token used to separate the then expression from the else expression
- * @param elseExpression the expression that is executed if the condition evaluates to`false`
+ * @param elseExpression the expression that is executed if the condition evaluates to{@code false}
*/
ConditionalExpression.full(Expression condition, Token question, Expression thenExpression, Token colon, Expression elseExpression) {
this._condition = becomeParentOf(condition);
@@ -3177,9 +3177,9 @@
* Initialize a newly created conditional expression.
* @param condition the condition used to determine which expression is executed next
* @param question the token used to separate the condition from the then expression
- * @param thenExpression the expression that is executed if the condition evaluates to`true`
+ * @param thenExpression the expression that is executed if the condition evaluates to{@code true}
* @param colon the token used to separate the then expression from the else expression
- * @param elseExpression the expression that is executed if the condition evaluates to`false`
+ * @param elseExpression the expression that is executed if the condition evaluates to{@code false}
*/
ConditionalExpression({Expression condition, Token question, Expression thenExpression, Token colon, Expression elseExpression}) : this.full(condition, question, thenExpression, colon, elseExpression);
accept(ASTVisitor visitor) => visitor.visitConditionalExpression(this);
@@ -3198,8 +3198,8 @@
Expression get condition => _condition;
/**
- * Return the expression that is executed if the condition evaluates to `false`.
- * @return the expression that is executed if the condition evaluates to `false`
+ * Return the expression that is executed if the condition evaluates to {@code false}.
+ * @return the expression that is executed if the condition evaluates to {@code false}
*/
Expression get elseExpression => _elseExpression;
Token get endToken => _elseExpression.endToken;
@@ -3211,8 +3211,8 @@
Token get question => _question;
/**
- * Return the expression that is executed if the condition evaluates to `true`.
- * @return the expression that is executed if the condition evaluates to `true`
+ * Return the expression that is executed if the condition evaluates to {@code true}.
+ * @return the expression that is executed if the condition evaluates to {@code true}
*/
Expression get thenExpression => _thenExpression;
@@ -3234,9 +3234,9 @@
}
/**
- * Set the expression that is executed if the condition evaluates to `false` to the given
+ * Set the expression that is executed if the condition evaluates to {@code false} to the given
* expression.
- * @param expression the expression that is executed if the condition evaluates to `false`
+ * @param expression the expression that is executed if the condition evaluates to {@code false}
*/
void set elseExpression(Expression expression) {
_elseExpression = becomeParentOf(expression);
@@ -3251,9 +3251,9 @@
}
/**
- * Set the expression that is executed if the condition evaluates to `true` to the given
+ * Set the expression that is executed if the condition evaluates to {@code true} to the given
* expression.
- * @param expression the expression that is executed if the condition evaluates to `true`
+ * @param expression the expression that is executed if the condition evaluates to {@code true}
*/
void set thenExpression(Expression expression) {
_thenExpression = becomeParentOf(expression);
@@ -3265,37 +3265,37 @@
}
}
/**
- * Instances of the class `ConstructorDeclaration` represent a constructor declaration.
+ * Instances of the class {@code ConstructorDeclaration} represent a constructor declaration.
* <pre>
* constructorDeclaration ::=
- * constructorSignature [FunctionBody body]?
- * | constructorName formalParameterList ':' 'this' ('.' [SimpleIdentifier name])? arguments
+ * constructorSignature {@link FunctionBody body}?
+ * | constructorName formalParameterList ':' 'this' ('.' {@link SimpleIdentifier name})? arguments
* constructorSignature ::=
* 'external'? constructorName formalParameterList initializerList?
* | 'external'? 'factory' factoryName formalParameterList initializerList?
* | 'external'? 'const' constructorName formalParameterList initializerList?
- * constructorName ::=[SimpleIdentifier returnType] ('.' [SimpleIdentifier name])?
- * factoryName ::=[Identifier returnType] ('.' [SimpleIdentifier name])?
+ * constructorName ::={@link SimpleIdentifier returnType} ('.' {@link SimpleIdentifier name})?
+ * factoryName ::={@link Identifier returnType} ('.' {@link SimpleIdentifier name})?
* initializerList ::=
- * ':' [ConstructorInitializer initializer] (',' [ConstructorInitializer initializer])
+ * ':' {@link ConstructorInitializer initializer} (',' {@link ConstructorInitializer initializer})
* </pre>
* @coverage dart.engine.ast
*/
class ConstructorDeclaration extends ClassMember {
/**
- * The token for the 'external' keyword, or `null` if the constructor is not external.
+ * The token for the 'external' keyword, or {@code null} if the constructor is not external.
*/
Token _externalKeyword;
/**
- * The token for the 'const' keyword, or `null` if the constructor is not a const
+ * The token for the 'const' keyword, or {@code null} if the constructor is not a const
* constructor.
*/
Token _constKeyword;
/**
- * The token for the 'factory' keyword, or `null` if the constructor is not a factory
+ * The token for the 'factory' keyword, or {@code null} if the constructor is not a factory
* constructor.
*/
Token _factoryKeyword;
@@ -3307,18 +3307,18 @@
Identifier _returnType;
/**
- * The token for the period before the constructor name, or `null` if the constructor being
+ * The token for the period before the constructor name, or {@code null} if the constructor being
* declared is unnamed.
*/
Token _period;
/**
- * The name of the constructor, or `null` if the constructor being declared is unnamed.
+ * The name of the constructor, or {@code null} if the constructor being declared is unnamed.
*/
SimpleIdentifier _name;
/**
- * The element associated with this constructor, or `null` if the AST structure has not been
+ * The element associated with this constructor, or {@code null} if the AST structure has not been
* resolved or if this constructor could not be resolved.
*/
ConstructorElement _element;
@@ -3329,7 +3329,7 @@
FormalParameterList _parameters;
/**
- * The token for the separator (colon or equals) before the initializers, or `null` if there
+ * The token for the separator (colon or equals) before the initializers, or {@code null} if there
* are no initializers.
*/
Token _separator;
@@ -3340,13 +3340,13 @@
NodeList<ConstructorInitializer> _initializers;
/**
- * The name of the constructor to which this constructor will be redirected, or `null` if
+ * The name of the constructor to which this constructor will be redirected, or {@code null} if
* this is not a redirecting factory constructor.
*/
ConstructorName _redirectedConstructor;
/**
- * The body of the constructor, or `null` if the constructor does not have a body.
+ * The body of the constructor, or {@code null} if the constructor does not have a body.
*/
FunctionBody _body;
@@ -3403,7 +3403,7 @@
accept(ASTVisitor visitor) => visitor.visitConstructorDeclaration(this);
/**
- * Return the body of the constructor, or `null` if the constructor does not have a body.
+ * Return the body of the constructor, or {@code null} if the constructor does not have a body.
* @return the body of the constructor
*/
FunctionBody get body => _body;
@@ -3424,7 +3424,7 @@
}
/**
- * Return the token for the 'external' keyword, or `null` if the constructor is not
+ * Return the token for the 'external' keyword, or {@code null} if the constructor is not
* external.
* @return the token for the 'external' keyword
*/
@@ -3443,7 +3443,7 @@
NodeList<ConstructorInitializer> get initializers => _initializers;
/**
- * Return the name of the constructor, or `null` if the constructor being declared is
+ * Return the name of the constructor, or {@code null} if the constructor being declared is
* unnamed.
* @return the name of the constructor
*/
@@ -3456,14 +3456,14 @@
FormalParameterList get parameters => _parameters;
/**
- * Return the token for the period before the constructor name, or `null` if the constructor
+ * Return the token for the period before the constructor name, or {@code null} if the constructor
* being declared is unnamed.
* @return the token for the period before the constructor name
*/
Token get period => _period;
/**
- * Return the name of the constructor to which this constructor will be redirected, or`null` if this is not a redirecting factory constructor.
+ * Return the name of the constructor to which this constructor will be redirected, or{@code null} if this is not a redirecting factory constructor.
* @return the name of the constructor to which this constructor will be redirected
*/
ConstructorName get redirectedConstructor => _redirectedConstructor;
@@ -3477,7 +3477,7 @@
Identifier get returnType => _returnType;
/**
- * Return the token for the separator (colon or equals) before the initializers, or `null`if there are no initializers.
+ * Return the token for the separator (colon or equals) before the initializers, or {@code null}if there are no initializers.
* @return the token for the separator (colon or equals) before the initializers
*/
Token get separator => _separator;
@@ -3589,8 +3589,8 @@
}
/**
- * Return the left-most of the given tokens, or `null` if there are no tokens given or if
- * all of the given tokens are `null`.
+ * Return the left-most of the given tokens, or {@code null} if there are no tokens given or if
+ * all of the given tokens are {@code null}.
* @param tokens the tokens being compared to find the left-most token
* @return the left-most of the given tokens
*/
@@ -3606,22 +3606,22 @@
}
}
/**
- * Instances of the class `ConstructorFieldInitializer` represent the initialization of a
+ * Instances of the class {@code ConstructorFieldInitializer} represent the initialization of a
* field within a constructor's initialization list.
* <pre>
* fieldInitializer ::=
- * ('this' '.')? [SimpleIdentifier fieldName] '=' [Expression conditionalExpression cascadeSection*]</pre>
+ * ('this' '.')? {@link SimpleIdentifier fieldName} '=' {@link Expression conditionalExpression cascadeSection*}</pre>
* @coverage dart.engine.ast
*/
class ConstructorFieldInitializer extends ConstructorInitializer {
/**
- * The token for the 'this' keyword, or `null` if there is no 'this' keyword.
+ * The token for the 'this' keyword, or {@code null} if there is no 'this' keyword.
*/
Token _keyword;
/**
- * The token for the period after the 'this' keyword, or `null` if there is no 'this'
+ * The token for the period after the 'this' keyword, or {@code null} if there is no 'this'
* keyword.
*/
Token _period;
@@ -3696,13 +3696,13 @@
SimpleIdentifier get fieldName => _fieldName;
/**
- * Return the token for the 'this' keyword, or `null` if there is no 'this' keyword.
+ * Return the token for the 'this' keyword, or {@code null} if there is no 'this' keyword.
* @return the token for the 'this' keyword
*/
Token get keyword => _keyword;
/**
- * Return the token for the period after the 'this' keyword, or `null` if there is no 'this'
+ * Return the token for the period after the 'this' keyword, or {@code null} if there is no 'this'
* keyword.
* @return the token for the period after the 'this' keyword
*/
@@ -3754,16 +3754,16 @@
}
}
/**
- * Instances of the class `ConstructorInitializer` defines the behavior of nodes that can
+ * Instances of the class {@code ConstructorInitializer} defines the behavior of nodes that can
* occur in the initializer list of a constructor declaration.
* <pre>
- * constructorInitializer ::=[SuperConstructorInvocation superInvocation]| [ConstructorFieldInitializer fieldInitializer]</pre>
+ * constructorInitializer ::={@link SuperConstructorInvocation superInvocation}| {@link ConstructorFieldInitializer fieldInitializer}</pre>
* @coverage dart.engine.ast
*/
abstract class ConstructorInitializer extends ASTNode {
}
/**
- * Instances of the class `ConstructorName` represent the name of the constructor.
+ * Instances of the class {@code ConstructorName} represent the name of the constructor.
* <pre>
* constructorName:
* type ('.' identifier)?
@@ -3778,25 +3778,25 @@
TypeName _type;
/**
- * The token for the period before the constructor name, or `null` if the specified
+ * The token for the period before the constructor name, or {@code null} if the specified
* constructor is the unnamed constructor.
*/
Token _period;
/**
- * The name of the constructor, or `null` if the specified constructor is the unnamed
+ * The name of the constructor, or {@code null} if the specified constructor is the unnamed
* constructor.
*/
SimpleIdentifier _name;
/**
- * The element associated with this constructor name based on static type information, or`null` if the AST structure has not been resolved or if this constructor name could not
+ * The element associated with this constructor name based on static type information, or{@code null} if the AST structure has not been resolved or if this constructor name could not
* be resolved.
*/
ConstructorElement _staticElement;
/**
- * The element associated with this constructor name based on propagated type information, or`null` if the AST structure has not been resolved or if this constructor name could not
+ * The element associated with this constructor name based on propagated type information, or{@code null} if the AST structure has not been resolved or if this constructor name could not
* be resolved.
*/
ConstructorElement _propagatedElement;
@@ -3825,7 +3825,7 @@
/**
* Return the element associated with this constructor name based on propagated type information,
- * or `null` if the AST structure has not been resolved or if this constructor name could
+ * or {@code null} if the AST structure has not been resolved or if this constructor name could
* not be resolved.
* @return the element associated with this constructor name
*/
@@ -3838,21 +3838,21 @@
}
/**
- * Return the name of the constructor, or `null` if the specified constructor is the unnamed
+ * Return the name of the constructor, or {@code null} if the specified constructor is the unnamed
* constructor.
* @return the name of the constructor
*/
SimpleIdentifier get name => _name;
/**
- * Return the token for the period before the constructor name, or `null` if the specified
+ * Return the token for the period before the constructor name, or {@code null} if the specified
* constructor is the unnamed constructor.
* @return the token for the period before the constructor name
*/
Token get period => _period;
/**
- * Return the element associated with this constructor name based on static type information, or`null` if the AST structure has not been resolved or if this constructor name could not
+ * Return the element associated with this constructor name based on static type information, or{@code null} if the AST structure has not been resolved or if this constructor name could not
* be resolved.
* @return the element associated with this constructor name
*/
@@ -3911,10 +3911,10 @@
}
}
/**
- * Instances of the class `ContinueStatement` represent a continue statement.
+ * Instances of the class {@code ContinueStatement} represent a continue statement.
* <pre>
* continueStatement ::=
- * 'continue' [SimpleIdentifier label]? ';'
+ * 'continue' {@link SimpleIdentifier label}? ';'
* </pre>
* @coverage dart.engine.ast
*/
@@ -3926,7 +3926,7 @@
Token _keyword;
/**
- * The label associated with the statement, or `null` if there is no label.
+ * The label associated with the statement, or {@code null} if there is no label.
*/
SimpleIdentifier _label;
@@ -3965,7 +3965,7 @@
Token get keyword => _keyword;
/**
- * Return the label associated with the statement, or `null` if there is no label.
+ * Return the label associated with the statement, or {@code null} if there is no label.
* @return the label associated with the statement
*/
SimpleIdentifier get label => _label;
@@ -4004,7 +4004,7 @@
}
}
/**
- * The abstract class `Declaration` defines the behavior common to nodes that represent the
+ * The abstract class {@code Declaration} defines the behavior common to nodes that represent the
* declaration of a name. Each declared name is visible within a name scope.
* @coverage dart.engine.ast
*/
@@ -4026,30 +4026,30 @@
Declaration({Comment comment, List<Annotation> metadata}) : this.full(comment, metadata);
/**
- * Return the element associated with this declaration, or `null` if either this node
+ * Return the element associated with this declaration, or {@code null} if either this node
* corresponds to a list of declarations or if the AST structure has not been resolved.
* @return the element associated with this declaration
*/
Element get element;
}
/**
- * Instances of the class `DeclaredIdentifier` represent the declaration of a single
+ * Instances of the class {@code DeclaredIdentifier} represent the declaration of a single
* identifier.
* <pre>
* declaredIdentifier ::=
- * ([Annotation metadata] finalConstVarOrType [SimpleIdentifier identifier]</pre>
+ * ({@link Annotation metadata} finalConstVarOrType {@link SimpleIdentifier identifier}</pre>
* @coverage dart.engine.ast
*/
class DeclaredIdentifier extends Declaration {
/**
- * The token representing either the 'final', 'const' or 'var' keyword, or `null` if no
+ * The token representing either the 'final', 'const' or 'var' keyword, or {@code null} if no
* keyword was used.
*/
Token _keyword;
/**
- * The name of the declared type of the parameter, or `null` if the parameter does not have
+ * The name of the declared type of the parameter, or {@code null} if the parameter does not have
* a declared type.
*/
TypeName _type;
@@ -4105,25 +4105,25 @@
Token get keyword => _keyword;
/**
- * Return the name of the declared type of the parameter, or `null` if the parameter does
+ * Return the name of the declared type of the parameter, or {@code null} if the parameter does
* not have a declared type.
* @return the name of the declared type of the parameter
*/
TypeName get type => _type;
/**
- * Return `true` if this variable was declared with the 'const' modifier.
- * @return `true` if this variable was declared with the 'const' modifier
+ * Return {@code true} if this variable was declared with the 'const' modifier.
+ * @return {@code true} if this variable was declared with the 'const' modifier
*/
- bool get isConst => (_keyword is KeywordToken) && identical(((_keyword as KeywordToken)).keyword, Keyword.CONST);
+ bool isConst() => (_keyword is KeywordToken) && identical(((_keyword as KeywordToken)).keyword, Keyword.CONST);
/**
- * Return `true` if this variable was declared with the 'final' modifier. Variables that are
- * declared with the 'const' modifier will return `false` even though they are implicitly
+ * Return {@code true} if this variable was declared with the 'final' modifier. Variables that are
+ * declared with the 'const' modifier will return {@code false} even though they are implicitly
* final.
- * @return `true` if this variable was declared with the 'final' modifier
+ * @return {@code true} if this variable was declared with the 'final' modifier
*/
- bool get isFinal => (_keyword is KeywordToken) && identical(((_keyword as KeywordToken)).keyword, Keyword.FINAL);
+ bool isFinal() => (_keyword is KeywordToken) && identical(((_keyword as KeywordToken)).keyword, Keyword.FINAL);
/**
* Set the token representing either the 'final', 'const' or 'var' keyword to the given token.
@@ -4155,12 +4155,12 @@
}
}
/**
- * Instances of the class `DefaultFormalParameter` represent a formal parameter with a default
+ * Instances of the class {@code DefaultFormalParameter} represent a formal parameter with a default
* value. There are two kinds of parameters that are both represented by this class: named formal
* parameters and positional formal parameters.
* <pre>
- * defaultFormalParameter ::=[NormalFormalParameter normalFormalParameter] ('=' [Expression defaultValue])?
- * defaultNamedParameter ::=[NormalFormalParameter normalFormalParameter] (':' [Expression defaultValue])?
+ * defaultFormalParameter ::={@link NormalFormalParameter normalFormalParameter} ('=' {@link Expression defaultValue})?
+ * defaultNamedParameter ::={@link NormalFormalParameter normalFormalParameter} (':' {@link Expression defaultValue})?
* </pre>
* @coverage dart.engine.ast
*/
@@ -4177,13 +4177,13 @@
ParameterKind _kind;
/**
- * The token separating the parameter from the default value, or `null` if there is no
+ * The token separating the parameter from the default value, or {@code null} if there is no
* default value.
*/
Token _separator;
/**
- * The expression computing the default value for the parameter, or `null` if there is no
+ * The expression computing the default value for the parameter, or {@code null} if there is no
* default value.
*/
Expression _defaultValue;
@@ -4214,7 +4214,7 @@
Token get beginToken => _parameter.beginToken;
/**
- * Return the expression computing the default value for the parameter, or `null` if there
+ * Return the expression computing the default value for the parameter, or {@code null} if there
* is no default value.
* @return the expression computing the default value for the parameter
*/
@@ -4235,25 +4235,25 @@
NormalFormalParameter get parameter => _parameter;
/**
- * Return the token separating the parameter from the default value, or `null` if there is
+ * Return the token separating the parameter from the default value, or {@code null} if there is
* no default value.
* @return the token separating the parameter from the default value
*/
Token get separator => _separator;
/**
- * Return `true` if this parameter was declared with the 'const' modifier.
- * @return `true` if this parameter was declared with the 'const' modifier
+ * Return {@code true} if this parameter was declared with the 'const' modifier.
+ * @return {@code true} if this parameter was declared with the 'const' modifier
*/
- bool get isConst => _parameter != null && _parameter.isConst;
+ bool isConst() => _parameter != null && _parameter.isConst();
/**
- * Return `true` if this parameter was declared with the 'final' modifier. Parameters that
- * are declared with the 'const' modifier will return `false` even though they are
+ * Return {@code true} if this parameter was declared with the 'final' modifier. Parameters that
+ * are declared with the 'const' modifier will return {@code false} even though they are
* implicitly final.
- * @return `true` if this parameter was declared with the 'final' modifier
+ * @return {@code true} if this parameter was declared with the 'final' modifier
*/
- bool get isFinal => _parameter != null && _parameter.isFinal;
+ bool isFinal() => _parameter != null && _parameter.isFinal();
/**
* Set the expression computing the default value for the parameter to the given expression.
@@ -4292,16 +4292,16 @@
}
}
/**
- * The abstract class `Directive` defines the behavior common to nodes that represent a
+ * The abstract class {@code Directive} defines the behavior common to nodes that represent a
* directive.
* <pre>
- * directive ::=[ExportDirective exportDirective]| [ImportDirective importDirective]| [LibraryDirective libraryDirective]| [PartDirective partDirective]| [PartOfDirective partOfDirective]</pre>
+ * directive ::={@link ExportDirective exportDirective}| {@link ImportDirective importDirective}| {@link LibraryDirective libraryDirective}| {@link PartDirective partDirective}| {@link PartOfDirective partOfDirective}</pre>
* @coverage dart.engine.ast
*/
abstract class Directive extends AnnotatedNode {
/**
- * The element associated with this directive, or `null` if the AST structure has not been
+ * The element associated with this directive, or {@code null} if the AST structure has not been
* resolved or if this directive could not be resolved.
*/
Element _element;
@@ -4322,7 +4322,7 @@
Directive({Comment comment, List<Annotation> metadata}) : this.full(comment, metadata);
/**
- * Return the element associated with this directive, or `null` if the AST structure has not
+ * Return the element associated with this directive, or {@code null} if the AST structure has not
* been resolved or if this directive could not be resolved. Examples of the latter case include a
* directive that contains an invalid URL or a URL that does not exist.
* @return the element associated with this directive
@@ -4345,10 +4345,10 @@
}
}
/**
- * Instances of the class `DoStatement` represent a do statement.
+ * Instances of the class {@code DoStatement} represent a do statement.
* <pre>
* doStatement ::=
- * 'do' [Statement body] 'while' '(' [Expression condition] ')' ';'
+ * 'do' {@link Statement body} 'while' '(' {@link Expression condition} ')' ';'
* </pre>
* @coverage dart.engine.ast
*/
@@ -4527,7 +4527,7 @@
}
}
/**
- * Instances of the class `DoubleLiteral` represent a floating point literal expression.
+ * Instances of the class {@code DoubleLiteral} represent a floating point literal expression.
* <pre>
* doubleLiteral ::=
* decimalDigit+ ('.' decimalDigit*)? exponent?
@@ -4600,7 +4600,7 @@
}
}
/**
- * Instances of the class `EmptyFunctionBody` represent an empty function body, which can only
+ * Instances of the class {@code EmptyFunctionBody} represent an empty function body, which can only
* appear in constructors or abstract methods.
* <pre>
* emptyFunctionBody ::=
@@ -4650,7 +4650,7 @@
}
}
/**
- * Instances of the class `EmptyStatement` represent an empty statement.
+ * Instances of the class {@code EmptyStatement} represent an empty statement.
* <pre>
* emptyStatement ::=
* ';'
@@ -4708,9 +4708,9 @@
EphemeralIdentifier({ASTNode parent, int location}) : this.full(parent, location);
}
/**
- * Instances of the class `ExportDirective` represent an export directive.
+ * Instances of the class {@code ExportDirective} represent an export directive.
* <pre>
- * exportDirective ::=[Annotation metadata] 'export' [StringLiteral libraryUri] [Combinator combinator]* ';'
+ * exportDirective ::={@link Annotation metadata} 'export' {@link StringLiteral libraryUri} {@link Combinator combinator}* ';'
* </pre>
* @coverage dart.engine.ast
*/
@@ -4752,22 +4752,22 @@
}
}
/**
- * Instances of the class `Expression` defines the behavior common to nodes that represent an
+ * Instances of the class {@code Expression} defines the behavior common to nodes that represent an
* expression.
* <pre>
- * expression ::=[AssignmentExpression assignmentExpression]| [ConditionalExpression conditionalExpression] cascadeSection
- * | [ThrowExpression throwExpression]</pre>
+ * expression ::={@link AssignmentExpression assignmentExpression}| {@link ConditionalExpression conditionalExpression} cascadeSection
+ * | {@link ThrowExpression throwExpression}</pre>
* @coverage dart.engine.ast
*/
abstract class Expression extends ASTNode {
/**
- * The static type of this expression, or `null` if the AST structure has not been resolved.
+ * The static type of this expression, or {@code null} if the AST structure has not been resolved.
*/
Type2 _staticType;
/**
- * The propagated type of this expression, or `null` if type propagation has not been
+ * The propagated type of this expression, or {@code null} if type propagation has not been
* performed on the AST structure.
*/
Type2 _propagatedType;
@@ -4777,7 +4777,7 @@
* and the function being invoked is known based on propagated type information, and this
* expression corresponds to one of the parameters of the function being invoked, then return the
* parameter element representing the parameter to which the value of this expression will be
- * bound. Otherwise, return `null`.
+ * bound. Otherwise, return {@code null}.
* @return the parameter element representing the parameter to which the value of this expression
* will be bound
*/
@@ -4804,7 +4804,7 @@
}
/**
- * Return the propagated type of this expression, or `null` if type propagation has not been
+ * Return the propagated type of this expression, or {@code null} if type propagation has not been
* performed on the AST structure.
* @return the propagated type of this expression
*/
@@ -4815,7 +4815,7 @@
* and the function being invoked is known based on static type information, and this expression
* corresponds to one of the parameters of the function being invoked, then return the parameter
* element representing the parameter to which the value of this expression will be bound.
- * Otherwise, return `null`.
+ * Otherwise, return {@code null}.
* @return the parameter element representing the parameter to which the value of this expression
* will be bound
*/
@@ -4842,17 +4842,17 @@
}
/**
- * Return the static type of this expression, or `null` if the AST structure has not been
+ * Return the static type of this expression, or {@code null} if the AST structure has not been
* resolved.
* @return the static type of this expression
*/
Type2 get staticType => _staticType;
/**
- * Return `true` if this expression is syntactically valid for the LHS of an[AssignmentExpression assignment expression].
- * @return `true` if this expression matches the `assignableExpression` production
+ * Return {@code true} if this expression is syntactically valid for the LHS of an{@link AssignmentExpression assignment expression}.
+ * @return {@code true} if this expression matches the {@code assignableExpression} production
*/
- bool get isAssignable => false;
+ bool isAssignable() => false;
/**
* Set the propagated type of this expression to the given type.
@@ -4871,11 +4871,11 @@
}
}
/**
- * Instances of the class `ExpressionFunctionBody` represent a function body consisting of a
+ * Instances of the class {@code ExpressionFunctionBody} represent a function body consisting of a
* single expression.
* <pre>
* expressionFunctionBody ::=
- * '=>' [Expression expression] ';'
+ * '=>' {@link Expression expression} ';'
* </pre>
* @coverage dart.engine.ast
*/
@@ -4973,9 +4973,9 @@
}
}
/**
- * Instances of the class `ExpressionStatement` wrap an expression as a statement.
+ * Instances of the class {@code ExpressionStatement} wrap an expression as a statement.
* <pre>
- * expressionStatement ::=[Expression expression]? ';'
+ * expressionStatement ::={@link Expression expression}? ';'
* </pre>
* @coverage dart.engine.ast
*/
@@ -4987,7 +4987,7 @@
Expression _expression;
/**
- * The semicolon terminating the statement, or `null` if the expression is a function
+ * The semicolon terminating the statement, or {@code null} if the expression is a function
* expression and isn't followed by a semicolon.
*/
Token _semicolon;
@@ -5028,7 +5028,7 @@
* @return the semicolon terminating the statement
*/
Token get semicolon => _semicolon;
- bool get isSynthetic => _expression.isSynthetic && _semicolon.isSynthetic;
+ bool isSynthetic() => _expression.isSynthetic() && _semicolon.isSynthetic();
/**
* Set the expression that comprises the statement to the given expression.
@@ -5050,11 +5050,11 @@
}
}
/**
- * Instances of the class `ExtendsClause` represent the "extends" clause in a class
+ * Instances of the class {@code ExtendsClause} represent the "extends" clause in a class
* declaration.
* <pre>
* extendsClause ::=
- * 'extends' [TypeName superclass]</pre>
+ * 'extends' {@link TypeName superclass}</pre>
* @coverage dart.engine.ast
*/
class ExtendsClause extends ASTNode {
@@ -5121,18 +5121,18 @@
}
}
/**
- * Instances of the class `FieldDeclaration` represent the declaration of one or more fields
+ * Instances of the class {@code FieldDeclaration} represent the declaration of one or more fields
* of the same type.
* <pre>
* fieldDeclaration ::=
- * 'static'? [VariableDeclarationList fieldList] ';'
+ * 'static'? {@link VariableDeclarationList fieldList} ';'
* </pre>
* @coverage dart.engine.ast
*/
class FieldDeclaration extends ClassMember {
/**
- * The token representing the 'static' keyword, or `null` if the fields are not static.
+ * The token representing the 'static' keyword, or {@code null} if the fields are not static.
*/
Token _keyword;
@@ -5180,7 +5180,7 @@
VariableDeclarationList get fields => _fieldList;
/**
- * Return the token representing the 'static' keyword, or `null` if the fields are not
+ * Return the token representing the 'static' keyword, or {@code null} if the fields are not
* static.
* @return the token representing the 'static' keyword
*/
@@ -5193,10 +5193,10 @@
Token get semicolon => _semicolon;
/**
- * Return `true` if the fields are static.
- * @return `true` if the fields are declared to be static
+ * Return {@code true} if the fields are static.
+ * @return {@code true} if the fields are declared to be static
*/
- bool get isStatic => _keyword != null;
+ bool isStatic() => _keyword != null;
/**
* Set the fields being declared to the given list of variables.
@@ -5233,22 +5233,22 @@
}
}
/**
- * Instances of the class `FieldFormalParameter` represent a field formal parameter.
+ * Instances of the class {@code FieldFormalParameter} represent a field formal parameter.
* <pre>
* fieldFormalParameter ::=
- * ('final' [TypeName type] | 'const' [TypeName type] | 'var' | [TypeName type])? 'this' '.' [SimpleIdentifier identifier]</pre>
+ * ('final' {@link TypeName type} | 'const' {@link TypeName type} | 'var' | {@link TypeName type})? 'this' '.' {@link SimpleIdentifier identifier}</pre>
* @coverage dart.engine.ast
*/
class FieldFormalParameter extends NormalFormalParameter {
/**
- * The token representing either the 'final', 'const' or 'var' keyword, or `null` if no
+ * The token representing either the 'final', 'const' or 'var' keyword, or {@code null} if no
* keyword was used.
*/
Token _keyword;
/**
- * The name of the declared type of the parameter, or `null` if the parameter does not have
+ * The name of the declared type of the parameter, or {@code null} if the parameter does not have
* a declared type.
*/
TypeName _type;
@@ -5321,13 +5321,13 @@
Token get thisToken => _thisToken;
/**
- * Return the name of the declared type of the parameter, or `null` if the parameter does
+ * Return the name of the declared type of the parameter, or {@code null} if the parameter does
* not have a declared type.
* @return the name of the declared type of the parameter
*/
TypeName get type => _type;
- bool get isConst => (_keyword is KeywordToken) && identical(((_keyword as KeywordToken)).keyword, Keyword.CONST);
- bool get isFinal => (_keyword is KeywordToken) && identical(((_keyword as KeywordToken)).keyword, Keyword.FINAL);
+ bool isConst() => (_keyword is KeywordToken) && identical(((_keyword as KeywordToken)).keyword, Keyword.CONST);
+ bool isFinal() => (_keyword is KeywordToken) && identical(((_keyword as KeywordToken)).keyword, Keyword.FINAL);
/**
* Set the token representing either the 'final', 'const' or 'var' keyword to the given token.
@@ -5367,10 +5367,10 @@
}
}
/**
- * Instances of the class `ForEachStatement` represent a for-each statement.
+ * Instances of the class {@code ForEachStatement} represent a for-each statement.
* <pre>
* forEachStatement ::=
- * 'for' '(' [SimpleFormalParameter loopParameter] 'in' [Expression iterator] ')' [Block body]</pre>
+ * 'for' '(' {@link SimpleFormalParameter loopParameter} 'in' {@link Expression iterator} ')' {@link Block body}</pre>
* @coverage dart.engine.ast
*/
class ForEachStatement extends Statement {
@@ -5547,12 +5547,12 @@
}
}
/**
- * Instances of the class `ForStatement` represent a for statement.
+ * Instances of the class {@code ForStatement} represent a for statement.
* <pre>
* forStatement ::=
- * 'for' '(' forLoopParts ')' [Statement statement]forLoopParts ::=
- * forInitializerStatement ';' [Expression expression]? ';' [Expression expressionList]?
- * forInitializerStatement ::=[DefaultFormalParameter initializedVariableDeclaration]| [Expression expression]?
+ * 'for' '(' forLoopParts ')' {@link Statement statement}forLoopParts ::=
+ * forInitializerStatement ';' {@link Expression expression}? ';' {@link Expression expressionList}?
+ * forInitializerStatement ::={@link DefaultFormalParameter initializedVariableDeclaration}| {@link Expression expression}?
* </pre>
* @coverage dart.engine.ast
*/
@@ -5569,14 +5569,14 @@
Token _leftParenthesis;
/**
- * The declaration of the loop variables, or `null` if there are no variables. Note that a
+ * The declaration of the loop variables, or {@code null} if there are no variables. Note that a
* for statement cannot have both a variable list and an initialization expression, but can
* validly have neither.
*/
VariableDeclarationList _variableList;
/**
- * The initialization expression, or `null` if there is no initialization expression. Note
+ * The initialization expression, or {@code null} if there is no initialization expression. Note
* that a for statement cannot have both a variable list and an initialization expression, but can
* validly have neither.
*/
@@ -5676,7 +5676,7 @@
Token get forKeyword => _forKeyword;
/**
- * Return the initialization expression, or `null` if there is no initialization expression.
+ * Return the initialization expression, or {@code null} if there is no initialization expression.
* @return the initialization expression
*/
Expression get initialization => _initialization;
@@ -5712,8 +5712,8 @@
NodeList<Expression> get updaters => _updaters;
/**
- * Return the declaration of the loop variables, or `null` if there are no variables.
- * @return the declaration of the loop variables, or `null` if there are no variables
+ * Return the declaration of the loop variables, or {@code null} if there are no variables.
+ * @return the declaration of the loop variables, or {@code null} if there are no variables
*/
VariableDeclarationList get variables => _variableList;
@@ -5797,16 +5797,16 @@
}
}
/**
- * The abstract class `FormalParameter` defines the behavior of objects representing a
+ * The abstract class {@code FormalParameter} defines the behavior of objects representing a
* parameter to a function.
* <pre>
- * formalParameter ::=[NormalFormalParameter normalFormalParameter]| [DefaultFormalParameter namedFormalParameter]| [DefaultFormalParameter optionalFormalParameter]</pre>
+ * formalParameter ::={@link NormalFormalParameter normalFormalParameter}| {@link DefaultFormalParameter namedFormalParameter}| {@link DefaultFormalParameter optionalFormalParameter}</pre>
* @coverage dart.engine.ast
*/
abstract class FormalParameter extends ASTNode {
/**
- * Return the element representing this parameter, or `null` if this parameter has not been
+ * Return the element representing this parameter, or {@code null} if this parameter has not been
* resolved.
* @return the element representing this parameter
*/
@@ -5831,9 +5831,9 @@
ParameterKind get kind;
}
/**
- * Instances of the class `FormalParameterList` represent the formal parameter list of a
+ * Instances of the class {@code FormalParameterList} represent the formal parameter list of a
* method declaration, function declaration, or function type alias.
- *
+ * <p>
* While the grammar requires all optional formal parameters to follow all of the normal formal
* parameters and at most one grouping of optional formal parameters, this class does not enforce
* those constraints. All parameters are flattened into a single list, which can have any or all
@@ -5843,14 +5843,14 @@
* '(' ')'
* | '(' normalFormalParameters (',' optionalFormalParameters)? ')'
* | '(' optionalFormalParameters ')'
- * normalFormalParameters ::=[NormalFormalParameter normalFormalParameter] (',' [NormalFormalParameter normalFormalParameter])
+ * normalFormalParameters ::={@link NormalFormalParameter normalFormalParameter} (',' {@link NormalFormalParameter normalFormalParameter})
* optionalFormalParameters ::=
* optionalPositionalFormalParameters
* | namedFormalParameters
* optionalPositionalFormalParameters ::=
- * '\[' [DefaultFormalParameter positionalFormalParameter] (',' [DefaultFormalParameter positionalFormalParameter])* '\]'
+ * '\[' {@link DefaultFormalParameter positionalFormalParameter} (',' {@link DefaultFormalParameter positionalFormalParameter})* '\]'
* namedFormalParameters ::=
- * '{' [DefaultFormalParameter namedFormalParameter] (',' [DefaultFormalParameter namedFormalParameter])* '}'
+ * '{' {@link DefaultFormalParameter namedFormalParameter} (',' {@link DefaultFormalParameter namedFormalParameter})* '}'
* </pre>
* @coverage dart.engine.ast
*/
@@ -5912,7 +5912,7 @@
/**
* Return an array containing the elements representing the parameters in this list. The array
- * will contain `null`s if the parameters in this list have not been resolved.
+ * will contain {@code null}s if the parameters in this list have not been resolved.
* @return the elements representing the parameters in this list
*/
List<ParameterElement> get elements {
@@ -5997,44 +5997,44 @@
}
}
/**
- * The abstract class `FunctionBody` defines the behavior common to objects representing the
+ * The abstract class {@code FunctionBody} defines the behavior common to objects representing the
* body of a function or method.
* <pre>
- * functionBody ::=[BlockFunctionBody blockFunctionBody]| [EmptyFunctionBody emptyFunctionBody]| [ExpressionFunctionBody expressionFunctionBody]</pre>
+ * functionBody ::={@link BlockFunctionBody blockFunctionBody}| {@link EmptyFunctionBody emptyFunctionBody}| {@link ExpressionFunctionBody expressionFunctionBody}</pre>
* @coverage dart.engine.ast
*/
abstract class FunctionBody extends ASTNode {
}
/**
- * Instances of the class `FunctionDeclaration` wrap a [FunctionExpression function
- * expression] as a top-level declaration.
+ * Instances of the class {@code FunctionDeclaration} wrap a {@link FunctionExpression function
+ * expression} as a top-level declaration.
* <pre>
* functionDeclaration ::=
* 'external' functionSignature
- * | functionSignature [FunctionBody functionBody]functionSignature ::=[Type returnType]? ('get' | 'set')? [SimpleIdentifier functionName] [FormalParameterList formalParameterList]</pre>
+ * | functionSignature {@link FunctionBody functionBody}functionSignature ::={@link Type returnType}? ('get' | 'set')? {@link SimpleIdentifier functionName} {@link FormalParameterList formalParameterList}</pre>
* @coverage dart.engine.ast
*/
class FunctionDeclaration extends CompilationUnitMember {
/**
- * The token representing the 'external' keyword, or `null` if this is not an external
+ * The token representing the 'external' keyword, or {@code null} if this is not an external
* function.
*/
Token _externalKeyword;
/**
- * The return type of the function, or `null` if no return type was declared.
+ * The return type of the function, or {@code null} if no return type was declared.
*/
TypeName _returnType;
/**
- * The token representing the 'get' or 'set' keyword, or `null` if this is a function
+ * The token representing the 'get' or 'set' keyword, or {@code null} if this is a function
* declaration rather than a property declaration.
*/
Token _propertyKeyword;
/**
- * The name of the function, or `null` if the function is not named.
+ * The name of the function, or {@code null} if the function is not named.
*/
SimpleIdentifier _name;
@@ -6077,7 +6077,7 @@
Token get endToken => _functionExpression.endToken;
/**
- * Return the token representing the 'external' keyword, or `null` if this is not an
+ * Return the token representing the 'external' keyword, or {@code null} if this is not an
* external function.
* @return the token representing the 'external' keyword
*/
@@ -6090,35 +6090,35 @@
FunctionExpression get functionExpression => _functionExpression;
/**
- * Return the name of the function, or `null` if the function is not named.
+ * Return the name of the function, or {@code null} if the function is not named.
* @return the name of the function
*/
SimpleIdentifier get name => _name;
/**
- * Return the token representing the 'get' or 'set' keyword, or `null` if this is a function
+ * Return the token representing the 'get' or 'set' keyword, or {@code null} if this is a function
* declaration rather than a property declaration.
* @return the token representing the 'get' or 'set' keyword
*/
Token get propertyKeyword => _propertyKeyword;
/**
- * Return the return type of the function, or `null` if no return type was declared.
+ * Return the return type of the function, or {@code null} if no return type was declared.
* @return the return type of the function
*/
TypeName get returnType => _returnType;
/**
- * Return `true` if this function declares a getter.
- * @return `true` if this function declares a getter
+ * Return {@code true} if this function declares a getter.
+ * @return {@code true} if this function declares a getter
*/
- bool get isGetter => _propertyKeyword != null && identical(((_propertyKeyword as KeywordToken)).keyword, Keyword.GET);
+ bool isGetter() => _propertyKeyword != null && identical(((_propertyKeyword as KeywordToken)).keyword, Keyword.GET);
/**
- * Return `true` if this function declares a setter.
- * @return `true` if this function declares a setter
+ * Return {@code true} if this function declares a setter.
+ * @return {@code true} if this function declares a setter
*/
- bool get isSetter => _propertyKeyword != null && identical(((_propertyKeyword as KeywordToken)).keyword, Keyword.SET);
+ bool isSetter() => _propertyKeyword != null && identical(((_propertyKeyword as KeywordToken)).keyword, Keyword.SET);
/**
* Set the token representing the 'external' keyword to the given token.
@@ -6180,7 +6180,7 @@
}
}
/**
- * Instances of the class `FunctionDeclarationStatement` wrap a [FunctionDeclarationfunction declaration] as a statement.
+ * Instances of the class {@code FunctionDeclarationStatement} wrap a {@link FunctionDeclarationfunction declaration} as a statement.
* @coverage dart.engine.ast
*/
class FunctionDeclarationStatement extends Statement {
@@ -6225,9 +6225,9 @@
}
}
/**
- * Instances of the class `FunctionExpression` represent a function expression.
+ * Instances of the class {@code FunctionExpression} represent a function expression.
* <pre>
- * functionExpression ::=[FormalParameterList formalParameterList] [FunctionBody functionBody]</pre>
+ * functionExpression ::={@link FormalParameterList formalParameterList} {@link FunctionBody functionBody}</pre>
* @coverage dart.engine.ast
*/
class FunctionExpression extends Expression {
@@ -6238,12 +6238,12 @@
FormalParameterList _parameters;
/**
- * The body of the function, or `null` if this is an external function.
+ * The body of the function, or {@code null} if this is an external function.
*/
FunctionBody _body;
/**
- * The element associated with the function, or `null` if the AST structure has not been
+ * The element associated with the function, or {@code null} if the AST structure has not been
* resolved.
*/
ExecutableElement _element;
@@ -6275,13 +6275,13 @@
}
/**
- * Return the body of the function, or `null` if this is an external function.
+ * Return the body of the function, or {@code null} if this is an external function.
* @return the body of the function
*/
FunctionBody get body => _body;
/**
- * Return the element associated with this function, or `null` if the AST structure has not
+ * Return the element associated with this function, or {@code null} if the AST structure has not
* been resolved.
* @return the element associated with this function
*/
@@ -6330,12 +6330,12 @@
}
}
/**
- * Instances of the class `FunctionExpressionInvocation` represent the invocation of a
+ * Instances of the class {@code FunctionExpressionInvocation} represent the invocation of a
* function resulting from evaluating an expression. Invocations of methods and other forms of
- * functions are represented by [MethodInvocation method invocation] nodes. Invocations of
- * getters and setters are represented by either [PrefixedIdentifier prefixed identifier] or[PropertyAccess property access] nodes.
+ * functions are represented by {@link MethodInvocation method invocation} nodes. Invocations of
+ * getters and setters are represented by either {@link PrefixedIdentifier prefixed identifier} or{@link PropertyAccess property access} nodes.
* <pre>
- * functionExpressionInvoction ::=[Expression function] [ArgumentList argumentList]</pre>
+ * functionExpressionInvoction ::={@link Expression function} {@link ArgumentList argumentList}</pre>
* @coverage dart.engine.ast
*/
class FunctionExpressionInvocation extends Expression {
@@ -6351,12 +6351,12 @@
ArgumentList _argumentList;
/**
- * The element associated with the function being invoked based on static type information, or`null` if the AST structure has not been resolved or the function could not be resolved.
+ * The element associated with the function being invoked based on static type information, or{@code null} if the AST structure has not been resolved or the function could not be resolved.
*/
ExecutableElement _staticElement;
/**
- * The element associated with the function being invoked based on propagated type information, or`null` if the AST structure has not been resolved or the function could not be resolved.
+ * The element associated with the function being invoked based on propagated type information, or{@code null} if the AST structure has not been resolved or the function could not be resolved.
*/
ExecutableElement _propagatedElement;
@@ -6387,7 +6387,7 @@
/**
* Return the element associated with the function being invoked based on propagated type
- * information, or `null` if the AST structure has not been resolved or the function could
+ * information, or {@code null} if the AST structure has not been resolved or the function could
* not be resolved. One common example of the latter case is an expression whose value can change
* over time.
* @return the element associated with the function being invoked
@@ -6403,7 +6403,7 @@
/**
* Return the element associated with the function being invoked based on static type information,
- * or `null` if the AST structure has not been resolved or the function could not be
+ * or {@code null} if the AST structure has not been resolved or the function could not be
* resolved. One common example of the latter case is an expression whose value can change over
* time.
* @return the element associated with the function
@@ -6449,17 +6449,17 @@
}
}
/**
- * Instances of the class `FunctionTypeAlias` represent a function type alias.
+ * Instances of the class {@code FunctionTypeAlias} represent a function type alias.
* <pre>
* functionTypeAlias ::=
- * functionPrefix [TypeParameterList typeParameterList]? [FormalParameterList formalParameterList] ';'
- * functionPrefix ::=[TypeName returnType]? [SimpleIdentifier name]</pre>
+ * functionPrefix {@link TypeParameterList typeParameterList}? {@link FormalParameterList formalParameterList} ';'
+ * functionPrefix ::={@link TypeName returnType}? {@link SimpleIdentifier name}</pre>
* @coverage dart.engine.ast
*/
class FunctionTypeAlias extends TypeAlias {
/**
- * The name of the return type of the function type being defined, or `null` if no return
+ * The name of the return type of the function type being defined, or {@code null} if no return
* type was given.
*/
TypeName _returnType;
@@ -6470,7 +6470,7 @@
SimpleIdentifier _name;
/**
- * The type parameters for the function type, or `null` if the function type does not have
+ * The type parameters for the function type, or {@code null} if the function type does not have
* any type parameters.
*/
TypeParameterList _typeParameters;
@@ -6526,14 +6526,14 @@
FormalParameterList get parameters => _parameters;
/**
- * Return the name of the return type of the function type being defined, or `null` if no
+ * Return the name of the return type of the function type being defined, or {@code null} if no
* return type was given.
* @return the name of the return type of the function type being defined
*/
TypeName get returnType => _returnType;
/**
- * Return the type parameters for the function type, or `null` if the function type does not
+ * Return the type parameters for the function type, or {@code null} if the function type does not
* have any type parameters.
* @return the type parameters for the function type
*/
@@ -6579,16 +6579,16 @@
}
}
/**
- * Instances of the class `FunctionTypedFormalParameter` represent a function-typed formal
+ * Instances of the class {@code FunctionTypedFormalParameter} represent a function-typed formal
* parameter.
* <pre>
- * functionSignature ::=[TypeName returnType]? [SimpleIdentifier identifier] [FormalParameterList formalParameterList]</pre>
+ * functionSignature ::={@link TypeName returnType}? {@link SimpleIdentifier identifier} {@link FormalParameterList formalParameterList}</pre>
* @coverage dart.engine.ast
*/
class FunctionTypedFormalParameter extends NormalFormalParameter {
/**
- * The return type of the function, or `null` if the function does not have a return type.
+ * The return type of the function, or {@code null} if the function does not have a return type.
*/
TypeName _returnType;
@@ -6601,7 +6601,7 @@
* Initialize a newly created formal parameter.
* @param comment the documentation comment associated with this parameter
* @param metadata the annotations associated with this parameter
- * @param returnType the return type of the function, or `null` if the function does not
+ * @param returnType the return type of the function, or {@code null} if the function does not
* have a return type
* @param identifier the name of the function-typed parameter
* @param parameters the parameters of the function-typed parameter
@@ -6615,7 +6615,7 @@
* Initialize a newly created formal parameter.
* @param comment the documentation comment associated with this parameter
* @param metadata the annotations associated with this parameter
- * @param returnType the return type of the function, or `null` if the function does not
+ * @param returnType the return type of the function, or {@code null} if the function does not
* have a return type
* @param identifier the name of the function-typed parameter
* @param parameters the parameters of the function-typed parameter
@@ -6637,13 +6637,13 @@
FormalParameterList get parameters => _parameters;
/**
- * Return the return type of the function, or `null` if the function does not have a return
+ * Return the return type of the function, or {@code null} if the function does not have a return
* type.
* @return the return type of the function
*/
TypeName get returnType => _returnType;
- bool get isConst => false;
- bool get isFinal => false;
+ bool isConst() => false;
+ bool isFinal() => false;
/**
* Set the parameters of the function-typed parameter to the given parameters.
@@ -6668,11 +6668,11 @@
}
}
/**
- * Instances of the class `HideCombinator` represent a combinator that restricts the names
+ * Instances of the class {@code HideCombinator} represent a combinator that restricts the names
* being imported to those that are not in a given list.
* <pre>
* hideCombinator ::=
- * 'hide' [SimpleIdentifier identifier] (',' [SimpleIdentifier identifier])
+ * 'hide' {@link SimpleIdentifier identifier} (',' {@link SimpleIdentifier identifier})
* </pre>
* @coverage dart.engine.ast
*/
@@ -6712,24 +6712,24 @@
}
}
/**
- * The abstract class `Identifier` defines the behavior common to nodes that represent an
+ * The abstract class {@code Identifier} defines the behavior common to nodes that represent an
* identifier.
* <pre>
- * identifier ::=[SimpleIdentifier simpleIdentifier]| [PrefixedIdentifier prefixedIdentifier]</pre>
+ * identifier ::={@link SimpleIdentifier simpleIdentifier}| {@link PrefixedIdentifier prefixedIdentifier}</pre>
* @coverage dart.engine.ast
*/
abstract class Identifier extends Expression {
/**
- * Return `true` if the given name is visible only within the library in which it is
+ * Return {@code true} if the given name is visible only within the library in which it is
* declared.
* @param name the name being tested
- * @return `true` if the given name is private
+ * @return {@code true} if the given name is private
*/
static bool isPrivateName(String name) => name.startsWith("_");
/**
- * Return the element associated with this identifier based on propagated type information, or`null` if the AST structure has not been resolved or if this identifier could not be
+ * Return the element associated with this identifier based on propagated type information, or{@code null} if the AST structure has not been resolved or if this identifier could not be
* resolved. One example of the latter case is an identifier that is not defined within the scope
* in which it appears.
* @return the element associated with this identifier
@@ -6743,19 +6743,19 @@
String get name;
/**
- * Return the element associated with this identifier based on static type information, or`null` if the AST structure has not been resolved or if this identifier could not be
+ * Return the element associated with this identifier based on static type information, or{@code null} if the AST structure has not been resolved or if this identifier could not be
* resolved. One example of the latter case is an identifier that is not defined within the scope
* in which it appears
* @return the element associated with the operator
*/
Element get staticElement;
- bool get isAssignable => true;
+ bool isAssignable() => true;
}
/**
- * Instances of the class `IfStatement` represent an if statement.
+ * Instances of the class {@code IfStatement} represent an if statement.
* <pre>
* ifStatement ::=
- * 'if' '(' [Expression expression] ')' [Statement thenStatement] ('else' [Statement elseStatement])?
+ * 'if' '(' {@link Expression expression} ')' {@link Statement thenStatement} ('else' {@link Statement elseStatement})?
* </pre>
* @coverage dart.engine.ast
*/
@@ -6782,7 +6782,7 @@
Token _rightParenthesis;
/**
- * The statement that is executed if the condition evaluates to `true`.
+ * The statement that is executed if the condition evaluates to {@code true}.
*/
Statement _thenStatement;
@@ -6792,7 +6792,7 @@
Token _elseKeyword;
/**
- * The statement that is executed if the condition evaluates to `false`, or `null` if
+ * The statement that is executed if the condition evaluates to {@code false}, or {@code null} if
* there is no else statement.
*/
Statement _elseStatement;
@@ -6803,9 +6803,9 @@
* @param leftParenthesis the left parenthesis
* @param condition the condition used to determine which of the statements is executed next
* @param rightParenthesis the right parenthesis
- * @param thenStatement the statement that is executed if the condition evaluates to `true`
+ * @param thenStatement the statement that is executed if the condition evaluates to {@code true}
* @param elseKeyword the token representing the 'else' keyword
- * @param elseStatement the statement that is executed if the condition evaluates to `false`
+ * @param elseStatement the statement that is executed if the condition evaluates to {@code false}
*/
IfStatement.full(Token ifKeyword, Token leftParenthesis, Expression condition, Token rightParenthesis, Statement thenStatement, Token elseKeyword, Statement elseStatement) {
this._ifKeyword = ifKeyword;
@@ -6823,9 +6823,9 @@
* @param leftParenthesis the left parenthesis
* @param condition the condition used to determine which of the statements is executed next
* @param rightParenthesis the right parenthesis
- * @param thenStatement the statement that is executed if the condition evaluates to `true`
+ * @param thenStatement the statement that is executed if the condition evaluates to {@code true}
* @param elseKeyword the token representing the 'else' keyword
- * @param elseStatement the statement that is executed if the condition evaluates to `false`
+ * @param elseStatement the statement that is executed if the condition evaluates to {@code false}
*/
IfStatement({Token ifKeyword, Token leftParenthesis, Expression condition, Token rightParenthesis, Statement thenStatement, Token elseKeyword, Statement elseStatement}) : this.full(ifKeyword, leftParenthesis, condition, rightParenthesis, thenStatement, elseKeyword, elseStatement);
accept(ASTVisitor visitor) => visitor.visitIfStatement(this);
@@ -6844,8 +6844,8 @@
Token get elseKeyword => _elseKeyword;
/**
- * Return the statement that is executed if the condition evaluates to `false`, or`null` if there is no else statement.
- * @return the statement that is executed if the condition evaluates to `false`
+ * Return the statement that is executed if the condition evaluates to {@code false}, or{@code null} if there is no else statement.
+ * @return the statement that is executed if the condition evaluates to {@code false}
*/
Statement get elseStatement => _elseStatement;
Token get endToken {
@@ -6874,8 +6874,8 @@
Token get rightParenthesis => _rightParenthesis;
/**
- * Return the statement that is executed if the condition evaluates to `true`.
- * @return the statement that is executed if the condition evaluates to `true`
+ * Return the statement that is executed if the condition evaluates to {@code true}.
+ * @return the statement that is executed if the condition evaluates to {@code true}
*/
Statement get thenStatement => _thenStatement;
@@ -6897,9 +6897,9 @@
}
/**
- * Set the statement that is executed if the condition evaluates to `false` to the given
+ * Set the statement that is executed if the condition evaluates to {@code false} to the given
* statement.
- * @param statement the statement that is executed if the condition evaluates to `false`
+ * @param statement the statement that is executed if the condition evaluates to {@code false}
*/
void set elseStatement(Statement statement) {
_elseStatement = becomeParentOf(statement);
@@ -6930,9 +6930,9 @@
}
/**
- * Set the statement that is executed if the condition evaluates to `true` to the given
+ * Set the statement that is executed if the condition evaluates to {@code true} to the given
* statement.
- * @param statement the statement that is executed if the condition evaluates to `true`
+ * @param statement the statement that is executed if the condition evaluates to {@code true}
*/
void set thenStatement(Statement statement) {
_thenStatement = becomeParentOf(statement);
@@ -6944,11 +6944,11 @@
}
}
/**
- * Instances of the class `ImplementsClause` represent the "implements" clause in an class
+ * Instances of the class {@code ImplementsClause} represent the "implements" clause in an class
* declaration.
* <pre>
* implementsClause ::=
- * 'implements' [TypeName superclass] (',' [TypeName superclass])
+ * 'implements' {@link TypeName superclass} (',' {@link TypeName superclass})
* </pre>
* @coverage dart.engine.ast
*/
@@ -7009,21 +7009,21 @@
}
}
/**
- * Instances of the class `ImportDirective` represent an import directive.
+ * Instances of the class {@code ImportDirective} represent an import directive.
* <pre>
- * importDirective ::=[Annotation metadata] 'import' [StringLiteral libraryUri] ('as' identifier)? [Combinator combinator]* ';'
+ * importDirective ::={@link Annotation metadata} 'import' {@link StringLiteral libraryUri} ('as' identifier)? {@link Combinator combinator}* ';'
* </pre>
* @coverage dart.engine.ast
*/
class ImportDirective extends NamespaceDirective {
/**
- * The token representing the 'as' token, or `null` if the imported names are not prefixed.
+ * The token representing the 'as' token, or {@code null} if the imported names are not prefixed.
*/
Token _asToken;
/**
- * The prefix to be used with the imported names, or `null` if the imported names are not
+ * The prefix to be used with the imported names, or {@code null} if the imported names are not
* prefixed.
*/
SimpleIdentifier _prefix;
@@ -7059,14 +7059,14 @@
accept(ASTVisitor visitor) => visitor.visitImportDirective(this);
/**
- * Return the token representing the 'as' token, or `null` if the imported names are not
+ * Return the token representing the 'as' token, or {@code null} if the imported names are not
* prefixed.
* @return the token representing the 'as' token
*/
Token get asToken => _asToken;
/**
- * Return the prefix to be used with the imported names, or `null` if the imported names are
+ * Return the prefix to be used with the imported names, or {@code null} if the imported names are
* not prefixed.
* @return the prefix to be used with the imported names
*/
@@ -7101,22 +7101,22 @@
}
}
/**
- * Instances of the class `IndexExpression` represent an index expression.
+ * Instances of the class {@code IndexExpression} represent an index expression.
* <pre>
- * indexExpression ::=[Expression target] '\[' [Expression index] '\]'
+ * indexExpression ::={@link Expression target} '\[' {@link Expression index} '\]'
* </pre>
* @coverage dart.engine.ast
*/
class IndexExpression extends Expression {
/**
- * The expression used to compute the object being indexed, or `null` if this index
+ * The expression used to compute the object being indexed, or {@code null} if this index
* expression is part of a cascade expression.
*/
Expression _target;
/**
- * The period ("..") before a cascaded index expression, or `null` if this index expression
+ * The period ("..") before a cascaded index expression, or {@code null} if this index expression
* is not part of a cascade expression.
*/
Token _period;
@@ -7137,13 +7137,13 @@
Token _rightBracket;
/**
- * The element associated with the operator based on the static type of the target, or`null` if the AST structure has not been resolved or if the operator could not be
+ * The element associated with the operator based on the static type of the target, or{@code null} if the AST structure has not been resolved or if the operator could not be
* resolved.
*/
MethodElement _staticElement;
/**
- * The element associated with the operator based on the propagated type of the target, or`null` if the AST structure has not been resolved or if the operator could not be
+ * The element associated with the operator based on the propagated type of the target, or{@code null} if the AST structure has not been resolved or if the operator could not be
* resolved.
*/
MethodElement _propagatedElement;
@@ -7202,7 +7202,7 @@
accept(ASTVisitor visitor) => visitor.visitIndexExpression(this);
/**
- * Return the expression used to compute the object being indexed, or `null` if this index
+ * Return the expression used to compute the object being indexed, or {@code null} if this index
* expression is part of a cascade expression.
* @return the expression used to compute the object being indexed
* @see #getRealTarget()
@@ -7216,7 +7216,7 @@
}
/**
- * Return the element associated with the operator based on the propagated type of the target, or`null` if the AST structure has not been resolved or if the operator could not be
+ * Return the element associated with the operator based on the propagated type of the target, or{@code null} if the AST structure has not been resolved or if the operator could not be
* resolved. One example of the latter case is an operator that is not defined for the type of the
* target.
* @return the element associated with this operator
@@ -7237,7 +7237,7 @@
Token get leftBracket => _leftBracket;
/**
- * Return the period ("..") before a cascaded index expression, or `null` if this index
+ * Return the period ("..") before a cascaded index expression, or {@code null} if this index
* expression is not part of a cascade expression.
* @return the period ("..") before a cascaded index expression
*/
@@ -7245,14 +7245,14 @@
/**
* Return the expression used to compute the object being indexed. If this index expression is not
- * part of a cascade expression, then this is the same as [getArray]. If this index
+ * part of a cascade expression, then this is the same as {@link #getArray()}. If this index
* expression is part of a cascade expression, then the target expression stored with the cascade
* expression is returned.
* @return the expression used to compute the object being indexed
* @see #getArray()
*/
Expression get realTarget {
- if (isCascaded) {
+ if (isCascaded()) {
ASTNode ancestor = parent;
while (ancestor is! CascadeExpression) {
if (ancestor == null) {
@@ -7272,7 +7272,7 @@
Token get rightBracket => _rightBracket;
/**
- * Return the element associated with the operator based on the static type of the target, or`null` if the AST structure has not been resolved or if the operator could not be
+ * Return the element associated with the operator based on the static type of the target, or{@code null} if the AST structure has not been resolved or if the operator could not be
* resolved. One example of the latter case is an operator that is not defined for the type of the
* target.
* @return the element associated with the operator
@@ -7280,11 +7280,11 @@
MethodElement get staticElement => _staticElement;
/**
- * Return `true` if this expression is computing a right-hand value.
- *
- * Note that [inGetterContext] and [inSetterContext] are not opposites, nor are
- * they mutually exclusive. In other words, it is possible for both methods to return `true`when invoked on the same node.
- * @return `true` if this expression is in a context where the operator '\[\]' will be invoked
+ * Return {@code true} if this expression is computing a right-hand value.
+ * <p>
+ * Note that {@link #inGetterContext()} and {@link #inSetterContext()} are not opposites, nor are
+ * they mutually exclusive. In other words, it is possible for both methods to return {@code true}when invoked on the same node.
+ * @return {@code true} if this expression is in a context where the operator '\[\]' will be invoked
*/
bool inGetterContext() {
ASTNode parent = this.parent;
@@ -7298,17 +7298,17 @@
}
/**
- * Return `true` if this expression is computing a left-hand value.
- *
- * Note that [inGetterContext] and [inSetterContext] are not opposites, nor are
- * they mutually exclusive. In other words, it is possible for both methods to return `true`when invoked on the same node.
- * @return `true` if this expression is in a context where the operator '\[\]=' will be
+ * Return {@code true} if this expression is computing a left-hand value.
+ * <p>
+ * Note that {@link #inGetterContext()} and {@link #inSetterContext()} are not opposites, nor are
+ * they mutually exclusive. In other words, it is possible for both methods to return {@code true}when invoked on the same node.
+ * @return {@code true} if this expression is in a context where the operator '\[\]=' will be
* invoked
*/
bool inSetterContext() {
ASTNode parent = this.parent;
if (parent is PrefixExpression) {
- return ((parent as PrefixExpression)).operator.type.isIncrementOperator;
+ return ((parent as PrefixExpression)).operator.type.isIncrementOperator();
} else if (parent is PostfixExpression) {
return true;
} else if (parent is AssignmentExpression) {
@@ -7316,14 +7316,14 @@
}
return false;
}
- bool get isAssignable => true;
+ bool isAssignable() => true;
/**
- * Return `true` if this expression is cascaded. If it is, then the target of this
- * expression is not stored locally but is stored in the nearest ancestor that is a[CascadeExpression].
- * @return `true` if this expression is cascaded
+ * Return {@code true} if this expression is cascaded. If it is, then the target of this
+ * expression is not stored locally but is stored in the nearest ancestor that is a{@link CascadeExpression}.
+ * @return {@code true} if this expression is cascaded
*/
- bool get isCascaded => _period != null;
+ bool isCascaded() => _period != null;
/**
* Set the expression used to compute the object being indexed to the given expression.
@@ -7390,9 +7390,9 @@
/**
* If the AST structure has been resolved, and the function being invoked is known based on
* propagated type information, then return the parameter element representing the parameter to
- * which the value of the index expression will be bound. Otherwise, return `null`.
- *
- * This method is only intended to be used by [Expression#getParameterElement].
+ * which the value of the index expression will be bound. Otherwise, return {@code null}.
+ * <p>
+ * This method is only intended to be used by {@link Expression#getParameterElement()}.
* @return the parameter element representing the parameter to which the value of the index
* expression will be bound
*/
@@ -7410,9 +7410,9 @@
/**
* If the AST structure has been resolved, and the function being invoked is known based on static
* type information, then return the parameter element representing the parameter to which the
- * value of the index expression will be bound. Otherwise, return `null`.
- *
- * This method is only intended to be used by [Expression#getStaticParameterElement].
+ * value of the index expression will be bound. Otherwise, return {@code null}.
+ * <p>
+ * This method is only intended to be used by {@link Expression#getStaticParameterElement()}.
* @return the parameter element representing the parameter to which the value of the index
* expression will be bound
*/
@@ -7428,11 +7428,11 @@
}
}
/**
- * Instances of the class `InstanceCreationExpression` represent an instance creation
+ * Instances of the class {@code InstanceCreationExpression} represent an instance creation
* expression.
* <pre>
* newExpression ::=
- * ('new' | 'const') [TypeName type] ('.' [SimpleIdentifier identifier])? [ArgumentList argumentList]</pre>
+ * ('new' | 'const') {@link TypeName type} ('.' {@link SimpleIdentifier identifier})? {@link ArgumentList argumentList}</pre>
* @coverage dart.engine.ast
*/
class InstanceCreationExpression extends Expression {
@@ -7453,12 +7453,12 @@
ArgumentList _argumentList;
/**
- * The element associated with the constructor based on static type information, or `null`if the AST structure has not been resolved or if the constructor could not be resolved.
+ * The element associated with the constructor based on static type information, or {@code null}if the AST structure has not been resolved or if the constructor could not be resolved.
*/
ConstructorElement _staticElement;
/**
- * The element associated with the constructor based on propagated type information, or`null` if the AST structure has not been resolved or if the constructor could not be
+ * The element associated with the constructor based on propagated type information, or{@code null} if the AST structure has not been resolved or if the constructor could not be
* resolved.
*/
ConstructorElement _propagatedElement;
@@ -7498,7 +7498,7 @@
ConstructorName get constructorName => _constructorName;
/**
- * Return the element associated with the constructor based on propagated type information, or`null` if the AST structure has not been resolved or if the constructor could not be
+ * Return the element associated with the constructor based on propagated type information, or{@code null} if the AST structure has not been resolved or if the constructor could not be
* resolved.
* @return the element associated with the constructor
*/
@@ -7512,17 +7512,17 @@
Token get keyword => _keyword;
/**
- * Return the element associated with the constructor based on static type information, or`null` if the AST structure has not been resolved or if the constructor could not be
+ * Return the element associated with the constructor based on static type information, or{@code null} if the AST structure has not been resolved or if the constructor could not be
* resolved.
* @return the element associated with the constructor
*/
ConstructorElement get staticElement => _staticElement;
/**
- * Return `true` if this creation expression is used to invoke a constant constructor.
- * @return `true` if this creation expression is used to invoke a constant constructor
+ * Return {@code true} if this creation expression is used to invoke a constant constructor.
+ * @return {@code true} if this creation expression is used to invoke a constant constructor
*/
- bool get isConst => _keyword is KeywordToken && identical(((_keyword as KeywordToken)).keyword, Keyword.CONST);
+ bool isConst() => _keyword is KeywordToken && identical(((_keyword as KeywordToken)).keyword, Keyword.CONST);
/**
* Set the list of arguments to the constructor to the given list.
@@ -7571,7 +7571,7 @@
}
}
/**
- * Instances of the class `IntegerLiteral` represent an integer literal expression.
+ * Instances of the class {@code IntegerLiteral} represent an integer literal expression.
* <pre>
* integerLiteral ::=
* decimalIntegerLiteral
@@ -7647,19 +7647,19 @@
}
}
/**
- * The abstract class `InterpolationElement` defines the behavior common to elements within a[StringInterpolation string interpolation].
+ * The abstract class {@code InterpolationElement} defines the behavior common to elements within a{@link StringInterpolation string interpolation}.
* <pre>
- * interpolationElement ::=[InterpolationExpression interpolationExpression]| [InterpolationString interpolationString]</pre>
+ * interpolationElement ::={@link InterpolationExpression interpolationExpression}| {@link InterpolationString interpolationString}</pre>
* @coverage dart.engine.ast
*/
abstract class InterpolationElement extends ASTNode {
}
/**
- * Instances of the class `InterpolationExpression` represent an expression embedded in a
+ * Instances of the class {@code InterpolationExpression} represent an expression embedded in a
* string interpolation.
* <pre>
* interpolationExpression ::=
- * '$' [SimpleIdentifier identifier]| '$' '{' [Expression expression] '}'
+ * '$' {@link SimpleIdentifier identifier}| '$' '{' {@link Expression expression} '}'
* </pre>
* @coverage dart.engine.ast
*/
@@ -7677,7 +7677,7 @@
Expression _expression;
/**
- * The right curly bracket, or `null` if the expression is an identifier without brackets.
+ * The right curly bracket, or {@code null} if the expression is an identifier without brackets.
*/
Token _rightBracket;
@@ -7756,7 +7756,7 @@
}
}
/**
- * Instances of the class `InterpolationString` represent a non-empty substring of an
+ * Instances of the class {@code InterpolationString} represent a non-empty substring of an
* interpolated string.
* <pre>
* interpolationString ::=
@@ -7827,9 +7827,9 @@
}
}
/**
- * Instances of the class `IsExpression` represent an is expression.
+ * Instances of the class {@code IsExpression} represent an is expression.
* <pre>
- * isExpression ::=[Expression expression] 'is' '!'? [TypeName type]</pre>
+ * isExpression ::={@link Expression expression} 'is' '!'? {@link TypeName type}</pre>
* @coverage dart.engine.ast
*/
class IsExpression extends Expression {
@@ -7845,7 +7845,7 @@
Token _isOperator;
/**
- * The not operator, or `null` if the sense of the test is not negated.
+ * The not operator, or {@code null} if the sense of the test is not negated.
*/
Token _notOperator;
@@ -7858,7 +7858,7 @@
* Initialize a newly created is expression.
* @param expression the expression used to compute the value whose type is being tested
* @param isOperator the is operator
- * @param notOperator the not operator, or `null` if the sense of the test is not negated
+ * @param notOperator the not operator, or {@code null} if the sense of the test is not negated
* @param type the name of the type being tested for
*/
IsExpression.full(Expression expression, Token isOperator, Token notOperator, TypeName type) {
@@ -7872,7 +7872,7 @@
* Initialize a newly created is expression.
* @param expression the expression used to compute the value whose type is being tested
* @param isOperator the is operator
- * @param notOperator the not operator, or `null` if the sense of the test is not negated
+ * @param notOperator the not operator, or {@code null} if the sense of the test is not negated
* @param type the name of the type being tested for
*/
IsExpression({Expression expression, Token isOperator, Token notOperator, TypeName type}) : this.full(expression, isOperator, notOperator, type);
@@ -7942,9 +7942,9 @@
}
}
/**
- * Instances of the class `Label` represent a label.
+ * Instances of the class {@code Label} represent a label.
* <pre>
- * label ::=[SimpleIdentifier label] ':'
+ * label ::={@link SimpleIdentifier label} ':'
* </pre>
* @coverage dart.engine.ast
*/
@@ -8012,10 +8012,10 @@
}
}
/**
- * Instances of the class `LabeledStatement` represent a statement that has a label associated
+ * Instances of the class {@code LabeledStatement} represent a statement that has a label associated
* with them.
* <pre>
- * labeledStatement ::=[Label label]+ [Statement statement]</pre>
+ * labeledStatement ::={@link Label label}+ {@link Statement statement}</pre>
* @coverage dart.engine.ast
*/
class LabeledStatement extends Statement {
@@ -8081,9 +8081,9 @@
}
}
/**
- * Instances of the class `LibraryDirective` represent a library directive.
+ * Instances of the class {@code LibraryDirective} represent a library directive.
* <pre>
- * libraryDirective ::=[Annotation metadata] 'library' [Identifier name] ';'
+ * libraryDirective ::={@link Annotation metadata} 'library' {@link Identifier name} ';'
* </pre>
* @coverage dart.engine.ast
*/
@@ -8179,9 +8179,9 @@
Token get firstTokenAfterCommentAndMetadata => _libraryToken;
}
/**
- * Instances of the class `LibraryIdentifier` represent the identifier for a library.
+ * Instances of the class {@code LibraryIdentifier} represent the identifier for a library.
* <pre>
- * libraryIdentifier ::=[SimpleIdentifier component] ('.' [SimpleIdentifier component])
+ * libraryIdentifier ::={@link SimpleIdentifier component} ('.' {@link SimpleIdentifier component})
* </pre>
* @coverage dart.engine.ast
*/
@@ -8235,10 +8235,10 @@
}
}
/**
- * Instances of the class `ListLiteral` represent a list literal.
+ * Instances of the class {@code ListLiteral} represent a list literal.
* <pre>
* listLiteral ::=
- * 'const'? ('<' [TypeName type] '>')? '\[' ([Expression expressionList] ','?)? '\]'
+ * 'const'? ('<' {@link TypeName type} '>')? '\[' ({@link Expression expressionList} ','?)? '\]'
* </pre>
* @coverage dart.engine.ast
*/
@@ -8262,7 +8262,7 @@
/**
* Initialize a newly created list literal.
* @param modifier the const modifier associated with this literal
- * @param typeArguments the type argument associated with this literal, or `null` if no type
+ * @param typeArguments the type argument associated with this literal, or {@code null} if no type
* arguments were declared
* @param leftBracket the left square bracket
* @param elements the expressions used to compute the elements of the list
@@ -8278,7 +8278,7 @@
/**
* Initialize a newly created list literal.
* @param modifier the const modifier associated with this literal
- * @param typeArguments the type argument associated with this literal, or `null` if no type
+ * @param typeArguments the type argument associated with this literal, or {@code null} if no type
* arguments were declared
* @param leftBracket the left square bracket
* @param elements the expressions used to compute the elements of the list
@@ -8338,19 +8338,19 @@
}
}
/**
- * The abstract class `Literal` defines the behavior common to nodes that represent a literal
+ * The abstract class {@code Literal} defines the behavior common to nodes that represent a literal
* expression.
* <pre>
- * literal ::=[BooleanLiteral booleanLiteral]| [DoubleLiteral doubleLiteral]| [IntegerLiteral integerLiteral]| [ListLiteral listLiteral]| [MapLiteral mapLiteral]| [NullLiteral nullLiteral]| [StringLiteral stringLiteral]</pre>
+ * literal ::={@link BooleanLiteral booleanLiteral}| {@link DoubleLiteral doubleLiteral}| {@link IntegerLiteral integerLiteral}| {@link ListLiteral listLiteral}| {@link MapLiteral mapLiteral}| {@link NullLiteral nullLiteral}| {@link StringLiteral stringLiteral}</pre>
* @coverage dart.engine.ast
*/
abstract class Literal extends Expression {
}
/**
- * Instances of the class `MapLiteral` represent a literal map.
+ * Instances of the class {@code MapLiteral} represent a literal map.
* <pre>
* mapLiteral ::=
- * 'const'? ('<' [TypeName type] (',' [TypeName type])* '>')? '{' ([MapLiteralEntry entry] (',' [MapLiteralEntry entry])* ','?)? '}'
+ * 'const'? ('<' {@link TypeName type} (',' {@link TypeName type})* '>')? '{' ({@link MapLiteralEntry entry} (',' {@link MapLiteralEntry entry})* ','?)? '}'
* </pre>
* @coverage dart.engine.ast
*/
@@ -8374,7 +8374,7 @@
/**
* Initialize a newly created map literal.
* @param modifier the const modifier associated with this literal
- * @param typeArguments the type argument associated with this literal, or `null` if no type
+ * @param typeArguments the type argument associated with this literal, or {@code null} if no type
* arguments were declared
* @param leftBracket the left curly bracket
* @param entries the entries in the map
@@ -8390,7 +8390,7 @@
/**
* Initialize a newly created map literal.
* @param modifier the const modifier associated with this literal
- * @param typeArguments the type argument associated with this literal, or `null` if no type
+ * @param typeArguments the type argument associated with this literal, or {@code null} if no type
* arguments were declared
* @param leftBracket the left curly bracket
* @param entries the entries in the map
@@ -8450,10 +8450,10 @@
}
}
/**
- * Instances of the class `MapLiteralEntry` represent a single key/value pair in a map
+ * Instances of the class {@code MapLiteralEntry} represent a single key/value pair in a map
* literal.
* <pre>
- * mapLiteralEntry ::=[Expression key] ':' [Expression value]</pre>
+ * mapLiteralEntry ::={@link Expression key} ':' {@link Expression value}</pre>
* @coverage dart.engine.ast
*/
class MapLiteralEntry extends ASTNode {
@@ -8545,39 +8545,39 @@
}
}
/**
- * Instances of the class `MethodDeclaration` represent a method declaration.
+ * Instances of the class {@code MethodDeclaration} represent a method declaration.
* <pre>
* methodDeclaration ::=
- * methodSignature [FunctionBody body]methodSignature ::=
- * 'external'? ('abstract' | 'static')? [Type returnType]? ('get' | 'set')? methodName[FormalParameterList formalParameterList]methodName ::=[SimpleIdentifier name]| 'operator' [SimpleIdentifier operator]</pre>
+ * methodSignature {@link FunctionBody body}methodSignature ::=
+ * 'external'? ('abstract' | 'static')? {@link Type returnType}? ('get' | 'set')? methodName{@link FormalParameterList formalParameterList}methodName ::={@link SimpleIdentifier name}| 'operator' {@link SimpleIdentifier operator}</pre>
* @coverage dart.engine.ast
*/
class MethodDeclaration extends ClassMember {
/**
- * The token for the 'external' keyword, or `null` if the constructor is not external.
+ * The token for the 'external' keyword, or {@code null} if the constructor is not external.
*/
Token _externalKeyword;
/**
- * The token representing the 'abstract' or 'static' keyword, or `null` if neither modifier
+ * The token representing the 'abstract' or 'static' keyword, or {@code null} if neither modifier
* was specified.
*/
Token _modifierKeyword;
/**
- * The return type of the method, or `null` if no return type was declared.
+ * The return type of the method, or {@code null} if no return type was declared.
*/
TypeName _returnType;
/**
- * The token representing the 'get' or 'set' keyword, or `null` if this is a method
+ * The token representing the 'get' or 'set' keyword, or {@code null} if this is a method
* declaration rather than a property declaration.
*/
Token _propertyKeyword;
/**
- * The token representing the 'operator' keyword, or `null` if this method does not declare
+ * The token representing the 'operator' keyword, or {@code null} if this method does not declare
* an operator.
*/
Token _operatorKeyword;
@@ -8588,7 +8588,7 @@
SimpleIdentifier _name;
/**
- * The parameters associated with the method, or `null` if this method declares a getter.
+ * The parameters associated with the method, or {@code null} if this method declares a getter.
*/
FormalParameterList _parameters;
@@ -8607,7 +8607,7 @@
* @param propertyKeyword the token representing the 'get' or 'set' keyword
* @param operatorKeyword the token representing the 'operator' keyword
* @param name the name of the method
- * @param parameters the parameters associated with the method, or `null` if this method
+ * @param parameters the parameters associated with the method, or {@code null} if this method
* declares a getter
* @param body the body of the method
*/
@@ -8632,7 +8632,7 @@
* @param propertyKeyword the token representing the 'get' or 'set' keyword
* @param operatorKeyword the token representing the 'operator' keyword
* @param name the name of the method
- * @param parameters the parameters associated with the method, or `null` if this method
+ * @param parameters the parameters associated with the method, or {@code null} if this method
* declares a getter
* @param body the body of the method
*/
@@ -8646,9 +8646,9 @@
FunctionBody get body => _body;
/**
- * Return the element associated with this method, or `null` if the AST structure has not
- * been resolved. The element can either be a [MethodElement], if this represents the
- * declaration of a normal method, or a [PropertyAccessorElement] if this represents the
+ * Return the element associated with this method, or {@code null} if the AST structure has not
+ * been resolved. The element can either be a {@link MethodElement}, if this represents the
+ * declaration of a normal method, or a {@link PropertyAccessorElement} if this represents the
* declaration of either a getter or a setter.
* @return the element associated with this method
*/
@@ -8656,14 +8656,14 @@
Token get endToken => _body.endToken;
/**
- * Return the token for the 'external' keyword, or `null` if the constructor is not
+ * Return the token for the 'external' keyword, or {@code null} if the constructor is not
* external.
* @return the token for the 'external' keyword
*/
Token get externalKeyword => _externalKeyword;
/**
- * Return the token representing the 'abstract' or 'static' keyword, or `null` if neither
+ * Return the token representing the 'abstract' or 'static' keyword, or {@code null} if neither
* modifier was specified.
* @return the token representing the 'abstract' or 'static' keyword
*/
@@ -8676,61 +8676,61 @@
SimpleIdentifier get name => _name;
/**
- * Return the token representing the 'operator' keyword, or `null` if this method does not
+ * Return the token representing the 'operator' keyword, or {@code null} if this method does not
* declare an operator.
* @return the token representing the 'operator' keyword
*/
Token get operatorKeyword => _operatorKeyword;
/**
- * Return the parameters associated with the method, or `null` if this method declares a
+ * Return the parameters associated with the method, or {@code null} if this method declares a
* getter.
* @return the parameters associated with the method
*/
FormalParameterList get parameters => _parameters;
/**
- * Return the token representing the 'get' or 'set' keyword, or `null` if this is a method
+ * Return the token representing the 'get' or 'set' keyword, or {@code null} if this is a method
* declaration rather than a property declaration.
* @return the token representing the 'get' or 'set' keyword
*/
Token get propertyKeyword => _propertyKeyword;
/**
- * Return the return type of the method, or `null` if no return type was declared.
+ * Return the return type of the method, or {@code null} if no return type was declared.
* @return the return type of the method
*/
TypeName get returnType => _returnType;
/**
- * Return `true` if this method is declared to be an abstract method.
- * @return `true` if this method is declared to be an abstract method
+ * Return {@code true} if this method is declared to be an abstract method.
+ * @return {@code true} if this method is declared to be an abstract method
*/
- bool get isAbstract => _externalKeyword == null && (_body is EmptyFunctionBody);
+ bool isAbstract() => _externalKeyword == null && (_body is EmptyFunctionBody);
/**
- * Return `true` if this method declares a getter.
- * @return `true` if this method declares a getter
+ * Return {@code true} if this method declares a getter.
+ * @return {@code true} if this method declares a getter
*/
- bool get isGetter => _propertyKeyword != null && identical(((_propertyKeyword as KeywordToken)).keyword, Keyword.GET);
+ bool isGetter() => _propertyKeyword != null && identical(((_propertyKeyword as KeywordToken)).keyword, Keyword.GET);
/**
- * Return `true` if this method declares an operator.
- * @return `true` if this method declares an operator
+ * Return {@code true} if this method declares an operator.
+ * @return {@code true} if this method declares an operator
*/
- bool get isOperator => _operatorKeyword != null;
+ bool isOperator() => _operatorKeyword != null;
/**
- * Return `true` if this method declares a setter.
- * @return `true` if this method declares a setter
+ * Return {@code true} if this method declares a setter.
+ * @return {@code true} if this method declares a setter
*/
- bool get isSetter => _propertyKeyword != null && identical(((_propertyKeyword as KeywordToken)).keyword, Keyword.SET);
+ bool isSetter() => _propertyKeyword != null && identical(((_propertyKeyword as KeywordToken)).keyword, Keyword.SET);
/**
- * Return `true` if this method is declared to be a static method.
- * @return `true` if this method is declared to be a static method
+ * Return {@code true} if this method is declared to be a static method.
+ * @return {@code true} if this method is declared to be a static method
*/
- bool get isStatic => _modifierKeyword != null && identical(((_modifierKeyword as KeywordToken)).keyword, Keyword.STATIC);
+ bool isStatic() => _modifierKeyword != null && identical(((_modifierKeyword as KeywordToken)).keyword, Keyword.STATIC);
/**
* Set the body of the method to the given function body.
@@ -8816,24 +8816,24 @@
}
}
/**
- * Instances of the class `MethodInvocation` represent the invocation of either a function or
- * a method. Invocations of functions resulting from evaluating an expression are represented by[FunctionExpressionInvocation function expression invocation] nodes. Invocations of getters
- * and setters are represented by either [PrefixedIdentifier prefixed identifier] or[PropertyAccess property access] nodes.
+ * Instances of the class {@code MethodInvocation} represent the invocation of either a function or
+ * a method. Invocations of functions resulting from evaluating an expression are represented by{@link FunctionExpressionInvocation function expression invocation} nodes. Invocations of getters
+ * and setters are represented by either {@link PrefixedIdentifier prefixed identifier} or{@link PropertyAccess property access} nodes.
* <pre>
* methodInvoction ::=
- * ([Expression target] '.')? [SimpleIdentifier methodName] [ArgumentList argumentList]</pre>
+ * ({@link Expression target} '.')? {@link SimpleIdentifier methodName} {@link ArgumentList argumentList}</pre>
* @coverage dart.engine.ast
*/
class MethodInvocation extends Expression {
/**
- * The expression producing the object on which the method is defined, or `null` if there is
- * no target (that is, the target is implicitly `this`).
+ * The expression producing the object on which the method is defined, or {@code null} if there is
+ * no target (that is, the target is implicitly {@code this}).
*/
Expression _target;
/**
- * The period that separates the target from the method name, or `null` if there is no
+ * The period that separates the target from the method name, or {@code null} if there is no
* target.
*/
Token _period;
@@ -8894,7 +8894,7 @@
SimpleIdentifier get methodName => _methodName;
/**
- * Return the period that separates the target from the method name, or `null` if there is
+ * Return the period that separates the target from the method name, or {@code null} if there is
* no target.
* @return the period that separates the target from the method name
*/
@@ -8902,14 +8902,14 @@
/**
* Return the expression used to compute the receiver of the invocation. If this invocation is not
- * part of a cascade expression, then this is the same as [getTarget]. If this invocation
+ * part of a cascade expression, then this is the same as {@link #getTarget()}. If this invocation
* is part of a cascade expression, then the target stored with the cascade expression is
* returned.
* @return the expression used to compute the receiver of the invocation
* @see #getTarget()
*/
Expression get realTarget {
- if (isCascaded) {
+ if (isCascaded()) {
ASTNode ancestor = parent;
while (ancestor is! CascadeExpression) {
if (ancestor == null) {
@@ -8923,8 +8923,8 @@
}
/**
- * Return the expression producing the object on which the method is defined, or `null` if
- * there is no target (that is, the target is implicitly `this`) or if this method
+ * Return the expression producing the object on which the method is defined, or {@code null} if
+ * there is no target (that is, the target is implicitly {@code this}) or if this method
* invocation is part of a cascade expression.
* @return the expression producing the object on which the method is defined
* @see #getRealTarget()
@@ -8932,11 +8932,11 @@
Expression get target => _target;
/**
- * Return `true` if this expression is cascaded. If it is, then the target of this
- * expression is not stored locally but is stored in the nearest ancestor that is a[CascadeExpression].
- * @return `true` if this expression is cascaded
+ * Return {@code true} if this expression is cascaded. If it is, then the target of this
+ * expression is not stored locally but is stored in the nearest ancestor that is a{@link CascadeExpression}.
+ * @return {@code true} if this expression is cascaded
*/
- bool get isCascaded => _period != null && identical(_period.type, TokenType.PERIOD_PERIOD);
+ bool isCascaded() => _period != null && identical(_period.type, TokenType.PERIOD_PERIOD);
/**
* Set the list of arguments to the method to the given list.
@@ -8976,10 +8976,10 @@
}
}
/**
- * Instances of the class `NamedExpression` represent an expression that has a name associated
+ * Instances of the class {@code NamedExpression} represent an expression that has a name associated
* with it. They are used in method invocations when there are named parameters.
* <pre>
- * namedExpression ::=[Label name] [Expression expression]</pre>
+ * namedExpression ::={@link Label name} {@link Expression expression}</pre>
* @coverage dart.engine.ast
*/
class NamedExpression extends Expression {
@@ -9014,7 +9014,7 @@
Token get beginToken => _name.beginToken;
/**
- * Return the element representing the parameter being named by this expression, or `null`if the AST structure has not been resolved or if there is no parameter with the same name as
+ * Return the element representing the parameter being named by this expression, or {@code null}if the AST structure has not been resolved or if there is no parameter with the same name as
* this expression.
* @return the element representing the parameter being named by this expression
*/
@@ -9060,10 +9060,10 @@
}
}
/**
- * The abstract class `NamespaceDirective` defines the behavior common to nodes that represent
+ * The abstract class {@code NamespaceDirective} defines the behavior common to nodes that represent
* a directive that impacts the namespace of a library.
* <pre>
- * directive ::=[ExportDirective exportDirective]| [ImportDirective importDirective]</pre>
+ * directive ::={@link ExportDirective exportDirective}| {@link ImportDirective importDirective}</pre>
* @coverage dart.engine.ast
*/
abstract class NamespaceDirective extends UriBasedDirective {
@@ -9143,11 +9143,11 @@
Token get firstTokenAfterCommentAndMetadata => _keyword;
}
/**
- * Instances of the class `NativeFunctionBody` represent a function body that consists of a
+ * Instances of the class {@code NativeFunctionBody} represent a function body that consists of a
* native keyword followed by a string literal.
* <pre>
* nativeFunctionBody ::=
- * 'native' [SimpleStringLiteral simpleStringLiteral] ';'
+ * 'native' {@link SimpleStringLiteral simpleStringLiteral} ';'
* </pre>
* @coverage dart.engine.ast
*/
@@ -9215,16 +9215,16 @@
}
}
/**
- * The abstract class `NormalFormalParameter` defines the behavior common to formal parameters
+ * The abstract class {@code NormalFormalParameter} defines the behavior common to formal parameters
* that are required (are not optional).
* <pre>
- * normalFormalParameter ::=[FunctionTypedFormalParameter functionSignature]| [FieldFormalParameter fieldFormalParameter]| [SimpleFormalParameter simpleFormalParameter]</pre>
+ * normalFormalParameter ::={@link FunctionTypedFormalParameter functionSignature}| {@link FieldFormalParameter fieldFormalParameter}| {@link SimpleFormalParameter simpleFormalParameter}</pre>
* @coverage dart.engine.ast
*/
abstract class NormalFormalParameter extends FormalParameter {
/**
- * The documentation comment associated with this parameter, or `null` if this parameter
+ * The documentation comment associated with this parameter, or {@code null} if this parameter
* does not have a documentation comment associated with it.
*/
Comment _comment;
@@ -9261,7 +9261,7 @@
NormalFormalParameter({Comment comment, List<Annotation> metadata, SimpleIdentifier identifier}) : this.full(comment, metadata, identifier);
/**
- * Return the documentation comment associated with this parameter, or `null` if this
+ * Return the documentation comment associated with this parameter, or {@code null} if this
* parameter does not have a documentation comment associated with it.
* @return the documentation comment associated with this parameter
*/
@@ -9282,18 +9282,18 @@
NodeList<Annotation> get metadata => _metadata;
/**
- * Return `true` if this parameter was declared with the 'const' modifier.
- * @return `true` if this parameter was declared with the 'const' modifier
+ * Return {@code true} if this parameter was declared with the 'const' modifier.
+ * @return {@code true} if this parameter was declared with the 'const' modifier
*/
- bool get isConst;
+ bool isConst();
/**
- * Return `true` if this parameter was declared with the 'final' modifier. Parameters that
- * are declared with the 'const' modifier will return `false` even though they are
+ * Return {@code true} if this parameter was declared with the 'final' modifier. Parameters that
+ * are declared with the 'const' modifier will return {@code false} even though they are
* implicitly final.
- * @return `true` if this parameter was declared with the 'final' modifier
+ * @return {@code true} if this parameter was declared with the 'final' modifier
*/
- bool get isFinal;
+ bool isFinal();
/**
* Set the documentation comment associated with this parameter to the given comment
@@ -9322,8 +9322,8 @@
}
/**
- * Return `true` if the comment is lexically before any annotations.
- * @return `true` if the comment is lexically before any annotations
+ * Return {@code true} if the comment is lexically before any annotations.
+ * @return {@code true} if the comment is lexically before any annotations
*/
bool commentIsBeforeAnnotations() {
if (_comment == null || _metadata.isEmpty) {
@@ -9349,7 +9349,7 @@
}
}
/**
- * Instances of the class `NullLiteral` represent a null literal expression.
+ * Instances of the class {@code NullLiteral} represent a null literal expression.
* <pre>
* nullLiteral ::=
* 'null'
@@ -9397,10 +9397,10 @@
}
}
/**
- * Instances of the class `ParenthesizedExpression` represent a parenthesized expression.
+ * Instances of the class {@code ParenthesizedExpression} represent a parenthesized expression.
* <pre>
* parenthesizedExpression ::=
- * '(' [Expression expression] ')'
+ * '(' {@link Expression expression} ')'
* </pre>
* @coverage dart.engine.ast
*/
@@ -9490,9 +9490,9 @@
}
}
/**
- * Instances of the class `PartDirective` represent a part directive.
+ * Instances of the class {@code PartDirective} represent a part directive.
* <pre>
- * partDirective ::=[Annotation metadata] 'part' [StringLiteral partUri] ';'
+ * partDirective ::={@link Annotation metadata} 'part' {@link StringLiteral partUri} ';'
* </pre>
* @coverage dart.engine.ast
*/
@@ -9565,9 +9565,9 @@
Token get firstTokenAfterCommentAndMetadata => _partToken;
}
/**
- * Instances of the class `PartOfDirective` represent a part-of directive.
+ * Instances of the class {@code PartOfDirective} represent a part-of directive.
* <pre>
- * partOfDirective ::=[Annotation metadata] 'part' 'of' [Identifier libraryName] ';'
+ * partOfDirective ::={@link Annotation metadata} 'part' 'of' {@link Identifier libraryName} ';'
* </pre>
* @coverage dart.engine.ast
*/
@@ -9685,9 +9685,9 @@
Token get firstTokenAfterCommentAndMetadata => _partToken;
}
/**
- * Instances of the class `PostfixExpression` represent a postfix unary expression.
+ * Instances of the class {@code PostfixExpression} represent a postfix unary expression.
* <pre>
- * postfixExpression ::=[Expression operand] [Token operator]</pre>
+ * postfixExpression ::={@link Expression operand} {@link Token operator}</pre>
* @coverage dart.engine.ast
*/
class PostfixExpression extends Expression {
@@ -9703,13 +9703,13 @@
Token _operator;
/**
- * The element associated with this the operator based on the propagated type of the operand, or`null` if the AST structure has not been resolved, if the operator is not user definable,
+ * The element associated with this the operator based on the propagated type of the operand, or{@code null} if the AST structure has not been resolved, if the operator is not user definable,
* or if the operator could not be resolved.
*/
MethodElement _propagatedElement;
/**
- * The element associated with the operator based on the static type of the operand, or`null` if the AST structure has not been resolved, if the operator is not user definable,
+ * The element associated with the operator based on the static type of the operand, or{@code null} if the AST structure has not been resolved, if the operator is not user definable,
* or if the operator could not be resolved.
*/
MethodElement _staticElement;
@@ -9734,7 +9734,7 @@
Token get beginToken => _operand.beginToken;
/**
- * Return the element associated with the operator based on the propagated type of the operand, or`null` if the AST structure has not been resolved, if the operator is not user definable,
+ * Return the element associated with the operator based on the propagated type of the operand, or{@code null} if the AST structure has not been resolved, if the operator is not user definable,
* or if the operator could not be resolved. One example of the latter case is an operator that is
* not defined for the type of the operand.
* @return the element associated with the operator
@@ -9755,7 +9755,7 @@
Token get operator => _operator;
/**
- * Return the element associated with the operator based on the static type of the operand, or`null` if the AST structure has not been resolved, if the operator is not user definable,
+ * Return the element associated with the operator based on the static type of the operand, or{@code null} if the AST structure has not been resolved, if the operator is not user definable,
* or if the operator could not be resolved. One example of the latter case is an operator that is
* not defined for the type of the operand.
* @return the element associated with the operator
@@ -9802,9 +9802,9 @@
/**
* If the AST structure has been resolved, and the function being invoked is known based on
* propagated type information, then return the parameter element representing the parameter to
- * which the value of the operand will be bound. Otherwise, return `null`.
- *
- * This method is only intended to be used by [Expression#getParameterElement].
+ * which the value of the operand will be bound. Otherwise, return {@code null}.
+ * <p>
+ * This method is only intended to be used by {@link Expression#getParameterElement()}.
* @return the parameter element representing the parameter to which the value of the right
* operand will be bound
*/
@@ -9822,9 +9822,9 @@
/**
* If the AST structure has been resolved, and the function being invoked is known based on static
* type information, then return the parameter element representing the parameter to which the
- * value of the operand will be bound. Otherwise, return `null`.
- *
- * This method is only intended to be used by [Expression#getStaticParameterElement].
+ * value of the operand will be bound. Otherwise, return {@code null}.
+ * <p>
+ * This method is only intended to be used by {@link Expression#getStaticParameterElement()}.
* @return the parameter element representing the parameter to which the value of the right
* operand will be bound
*/
@@ -9840,9 +9840,9 @@
}
}
/**
- * Instances of the class `PrefixExpression` represent a prefix unary expression.
+ * Instances of the class {@code PrefixExpression} represent a prefix unary expression.
* <pre>
- * prefixExpression ::=[Token operator] [Expression operand]</pre>
+ * prefixExpression ::={@link Token operator} {@link Expression operand}</pre>
* @coverage dart.engine.ast
*/
class PrefixExpression extends Expression {
@@ -9858,13 +9858,13 @@
Expression _operand;
/**
- * The element associated with the operator based on the static type of the operand, or`null` if the AST structure has not been resolved, if the operator is not user definable,
+ * The element associated with the operator based on the static type of the operand, or{@code null} if the AST structure has not been resolved, if the operator is not user definable,
* or if the operator could not be resolved.
*/
MethodElement _staticElement;
/**
- * The element associated with the operator based on the propagated type of the operand, or`null` if the AST structure has not been resolved, if the operator is not user definable,
+ * The element associated with the operator based on the propagated type of the operand, or{@code null} if the AST structure has not been resolved, if the operator is not user definable,
* or if the operator could not be resolved.
*/
MethodElement _propagatedElement;
@@ -9889,7 +9889,7 @@
Token get beginToken => _operator;
/**
- * Return the element associated with the operator based on the propagated type of the operand, or`null` if the AST structure has not been resolved, if the operator is not user definable,
+ * Return the element associated with the operator based on the propagated type of the operand, or{@code null} if the AST structure has not been resolved, if the operator is not user definable,
* or if the operator could not be resolved. One example of the latter case is an operator that is
* not defined for the type of the operand.
* @return the element associated with the operator
@@ -9910,7 +9910,7 @@
Token get operator => _operator;
/**
- * Return the element associated with the operator based on the static type of the operand, or`null` if the AST structure has not been resolved, if the operator is not user definable,
+ * Return the element associated with the operator based on the static type of the operand, or{@code null} if the AST structure has not been resolved, if the operator is not user definable,
* or if the operator could not be resolved. One example of the latter case is an operator that is
* not defined for the type of the operand.
* @return the element associated with the operator
@@ -9957,9 +9957,9 @@
/**
* If the AST structure has been resolved, and the function being invoked is known based on
* propagated type information, then return the parameter element representing the parameter to
- * which the value of the operand will be bound. Otherwise, return `null`.
- *
- * This method is only intended to be used by [Expression#getParameterElement].
+ * which the value of the operand will be bound. Otherwise, return {@code null}.
+ * <p>
+ * This method is only intended to be used by {@link Expression#getParameterElement()}.
* @return the parameter element representing the parameter to which the value of the right
* operand will be bound
*/
@@ -9977,9 +9977,9 @@
/**
* If the AST structure has been resolved, and the function being invoked is known based on static
* type information, then return the parameter element representing the parameter to which the
- * value of the operand will be bound. Otherwise, return `null`.
- *
- * This method is only intended to be used by [Expression#getStaticParameterElement].
+ * value of the operand will be bound. Otherwise, return {@code null}.
+ * <p>
+ * This method is only intended to be used by {@link Expression#getStaticParameterElement()}.
* @return the parameter element representing the parameter to which the value of the right
* operand will be bound
*/
@@ -9995,11 +9995,11 @@
}
}
/**
- * Instances of the class `PrefixedIdentifier` represent either an identifier that is prefixed
+ * Instances of the class {@code PrefixedIdentifier} represent either an identifier that is prefixed
* or an access to an object property where the target of the property access is a simple
* identifier.
* <pre>
- * prefixedIdentifier ::=[SimpleIdentifier prefix] '.' [SimpleIdentifier identifier]</pre>
+ * prefixedIdentifier ::={@link SimpleIdentifier prefix} '.' {@link SimpleIdentifier identifier}</pre>
* @coverage dart.engine.ast
*/
class PrefixedIdentifier extends Identifier {
@@ -10103,12 +10103,12 @@
}
}
/**
- * Instances of the class `PropertyAccess` represent the access of a property of an object.
- *
- * Note, however, that accesses to properties of objects can also be represented as[PrefixedIdentifier prefixed identifier] nodes in cases where the target is also a simple
+ * Instances of the class {@code PropertyAccess} represent the access of a property of an object.
+ * <p>
+ * Note, however, that accesses to properties of objects can also be represented as{@link PrefixedIdentifier prefixed identifier} nodes in cases where the target is also a simple
* identifier.
* <pre>
- * propertyAccess ::=[Expression target] '.' [SimpleIdentifier propertyName]</pre>
+ * propertyAccess ::={@link Expression target} '.' {@link SimpleIdentifier propertyName}</pre>
* @coverage dart.engine.ast
*/
class PropertyAccess extends Expression {
@@ -10170,14 +10170,14 @@
/**
* Return the expression used to compute the receiver of the invocation. If this invocation is not
- * part of a cascade expression, then this is the same as [getTarget]. If this invocation
+ * part of a cascade expression, then this is the same as {@link #getTarget()}. If this invocation
* is part of a cascade expression, then the target stored with the cascade expression is
* returned.
* @return the expression used to compute the receiver of the invocation
* @see #getTarget()
*/
Expression get realTarget {
- if (isCascaded) {
+ if (isCascaded()) {
ASTNode ancestor = parent;
while (ancestor is! CascadeExpression) {
if (ancestor == null) {
@@ -10191,19 +10191,19 @@
}
/**
- * Return the expression computing the object defining the property being accessed, or`null` if this property access is part of a cascade expression.
+ * Return the expression computing the object defining the property being accessed, or{@code null} if this property access is part of a cascade expression.
* @return the expression computing the object defining the property being accessed
* @see #getRealTarget()
*/
Expression get target => _target;
- bool get isAssignable => true;
+ bool isAssignable() => true;
/**
- * Return `true` if this expression is cascaded. If it is, then the target of this
- * expression is not stored locally but is stored in the nearest ancestor that is a[CascadeExpression].
- * @return `true` if this expression is cascaded
+ * Return {@code true} if this expression is cascaded. If it is, then the target of this
+ * expression is not stored locally but is stored in the nearest ancestor that is a{@link CascadeExpression}.
+ * @return {@code true} if this expression is cascaded
*/
- bool get isCascaded => _operator != null && identical(_operator.type, TokenType.PERIOD_PERIOD);
+ bool isCascaded() => _operator != null && identical(_operator.type, TokenType.PERIOD_PERIOD);
/**
* Set the property access operator to the given token.
@@ -10235,7 +10235,7 @@
}
}
/**
- * Instances of the class `RedirectingConstructorInvocation` represent the invocation of a
+ * Instances of the class {@code RedirectingConstructorInvocation} represent the invocation of a
* another constructor in the same class from within a constructor's initialization list.
* <pre>
* redirectingConstructorInvocation ::=
@@ -10251,12 +10251,12 @@
Token _keyword;
/**
- * The token for the period before the name of the constructor that is being invoked, or`null` if the unnamed constructor is being invoked.
+ * The token for the period before the name of the constructor that is being invoked, or{@code null} if the unnamed constructor is being invoked.
*/
Token _period;
/**
- * The name of the constructor that is being invoked, or `null` if the unnamed constructor
+ * The name of the constructor that is being invoked, or {@code null} if the unnamed constructor
* is being invoked.
*/
SimpleIdentifier _constructorName;
@@ -10267,12 +10267,12 @@
ArgumentList _argumentList;
/**
- * The element associated with the constructor based on static type information, or `null`if the AST structure has not been resolved or if the constructor could not be resolved.
+ * The element associated with the constructor based on static type information, or {@code null}if the AST structure has not been resolved or if the constructor could not be resolved.
*/
ConstructorElement _staticElement;
/**
- * The element associated with the constructor based on propagated type information, or`null` if the AST structure has not been resolved or if the constructor could not be
+ * The element associated with the constructor based on propagated type information, or{@code null} if the AST structure has not been resolved or if the constructor could not be
* resolved.
*/
ConstructorElement _propagatedElement;
@@ -10311,14 +10311,14 @@
Token get beginToken => _keyword;
/**
- * Return the name of the constructor that is being invoked, or `null` if the unnamed
+ * Return the name of the constructor that is being invoked, or {@code null} if the unnamed
* constructor is being invoked.
* @return the name of the constructor that is being invoked
*/
SimpleIdentifier get constructorName => _constructorName;
/**
- * Return the element associated with the constructor based on propagated type information, or`null` if the AST structure has not been resolved or if the constructor could not be
+ * Return the element associated with the constructor based on propagated type information, or{@code null} if the AST structure has not been resolved or if the constructor could not be
* resolved.
* @return the element associated with the super constructor
*/
@@ -10332,13 +10332,13 @@
Token get keyword => _keyword;
/**
- * Return the token for the period before the name of the constructor that is being invoked, or`null` if the unnamed constructor is being invoked.
+ * Return the token for the period before the name of the constructor that is being invoked, or{@code null} if the unnamed constructor is being invoked.
* @return the token for the period before the name of the constructor that is being invoked
*/
Token get period => _period;
/**
- * Return the element associated with the constructor based on static type information, or`null` if the AST structure has not been resolved or if the constructor could not be
+ * Return the element associated with the constructor based on static type information, or{@code null} if the AST structure has not been resolved or if the constructor could not be
* resolved.
* @return the element associated with the constructor
*/
@@ -10400,7 +10400,7 @@
}
}
/**
- * Instances of the class `RethrowExpression` represent a rethrow expression.
+ * Instances of the class {@code RethrowExpression} represent a rethrow expression.
* <pre>
* rethrowExpression ::=
* 'rethrow'
@@ -10448,10 +10448,10 @@
}
}
/**
- * Instances of the class `ReturnStatement` represent a return statement.
+ * Instances of the class {@code ReturnStatement} represent a return statement.
* <pre>
* returnStatement ::=
- * 'return' [Expression expression]? ';'
+ * 'return' {@link Expression expression}? ';'
* </pre>
* @coverage dart.engine.ast
*/
@@ -10463,7 +10463,7 @@
Token _keyword;
/**
- * The expression computing the value to be returned, or `null` if no explicit value was
+ * The expression computing the value to be returned, or {@code null} if no explicit value was
* provided.
*/
Expression _expression;
@@ -10497,7 +10497,7 @@
Token get endToken => _semicolon;
/**
- * Return the expression computing the value to be returned, or `null` if no explicit value
+ * Return the expression computing the value to be returned, or {@code null} if no explicit value
* was provided.
* @return the expression computing the value to be returned
*/
@@ -10543,7 +10543,7 @@
}
}
/**
- * Instances of the class `ScriptTag` represent the script tag that can optionally occur at
+ * Instances of the class {@code ScriptTag} represent the script tag that can optionally occur at
* the beginning of a compilation unit.
* <pre>
* scriptTag ::=
@@ -10592,11 +10592,11 @@
}
}
/**
- * Instances of the class `ShowCombinator` represent a combinator that restricts the names
+ * Instances of the class {@code ShowCombinator} represent a combinator that restricts the names
* being imported to those in a given list.
* <pre>
* showCombinator ::=
- * 'show' [SimpleIdentifier identifier] (',' [SimpleIdentifier identifier])
+ * 'show' {@link SimpleIdentifier identifier} (',' {@link SimpleIdentifier identifier})
* </pre>
* @coverage dart.engine.ast
*/
@@ -10636,22 +10636,22 @@
}
}
/**
- * Instances of the class `SimpleFormalParameter` represent a simple formal parameter.
+ * Instances of the class {@code SimpleFormalParameter} represent a simple formal parameter.
* <pre>
* simpleFormalParameter ::=
- * ('final' [TypeName type] | 'var' | [TypeName type])? [SimpleIdentifier identifier]</pre>
+ * ('final' {@link TypeName type} | 'var' | {@link TypeName type})? {@link SimpleIdentifier identifier}</pre>
* @coverage dart.engine.ast
*/
class SimpleFormalParameter extends NormalFormalParameter {
/**
- * The token representing either the 'final', 'const' or 'var' keyword, or `null` if no
+ * The token representing either the 'final', 'const' or 'var' keyword, or {@code null} if no
* keyword was used.
*/
Token _keyword;
/**
- * The name of the declared type of the parameter, or `null` if the parameter does not have
+ * The name of the declared type of the parameter, or {@code null} if the parameter does not have
* a declared type.
*/
TypeName _type;
@@ -10696,13 +10696,13 @@
Token get keyword => _keyword;
/**
- * Return the name of the declared type of the parameter, or `null` if the parameter does
+ * Return the name of the declared type of the parameter, or {@code null} if the parameter does
* not have a declared type.
* @return the name of the declared type of the parameter
*/
TypeName get type => _type;
- bool get isConst => (_keyword is KeywordToken) && identical(((_keyword as KeywordToken)).keyword, Keyword.CONST);
- bool get isFinal => (_keyword is KeywordToken) && identical(((_keyword as KeywordToken)).keyword, Keyword.FINAL);
+ bool isConst() => (_keyword is KeywordToken) && identical(((_keyword as KeywordToken)).keyword, Keyword.CONST);
+ bool isFinal() => (_keyword is KeywordToken) && identical(((_keyword as KeywordToken)).keyword, Keyword.FINAL);
/**
* Set the token representing either the 'final', 'const' or 'var' keyword to the given token.
@@ -10726,7 +10726,7 @@
}
}
/**
- * Instances of the class `SimpleIdentifier` represent a simple identifier.
+ * Instances of the class {@code SimpleIdentifier} represent a simple identifier.
* <pre>
* simpleIdentifier ::=
* initialCharacter internalCharacter
@@ -10743,12 +10743,12 @@
Token _token;
/**
- * The element associated with this identifier based on static type information, or `null`if the AST structure has not been resolved or if this identifier could not be resolved.
+ * The element associated with this identifier based on static type information, or {@code null}if the AST structure has not been resolved or if this identifier could not be resolved.
*/
Element _staticElement;
/**
- * The element associated with this identifier based on propagated type information, or`null` if the AST structure has not been resolved or if this identifier could not be
+ * The element associated with this identifier based on propagated type information, or{@code null} if the AST structure has not been resolved or if this identifier could not be
* resolved.
*/
Element _propagatedElement;
@@ -10780,8 +10780,8 @@
Token get token => _token;
/**
- * Return `true` if this identifier is the name being declared in a declaration.
- * @return `true` if this identifier is the name being declared in a declaration
+ * Return {@code true} if this identifier is the name being declared in a declaration.
+ * @return {@code true} if this identifier is the name being declared in a declaration
*/
bool inDeclarationContext() {
ASTNode parent = this.parent;
@@ -10813,11 +10813,11 @@
}
/**
- * Return `true` if this expression is computing a right-hand value.
- *
- * Note that [inGetterContext] and [inSetterContext] are not opposites, nor are
- * they mutually exclusive. In other words, it is possible for both methods to return `true`when invoked on the same node.
- * @return `true` if this expression is in a context where a getter will be invoked
+ * Return {@code true} if this expression is computing a right-hand value.
+ * <p>
+ * Note that {@link #inGetterContext()} and {@link #inSetterContext()} are not opposites, nor are
+ * they mutually exclusive. In other words, it is possible for both methods to return {@code true}when invoked on the same node.
+ * @return {@code true} if this expression is in a context where a getter will be invoked
*/
bool inGetterContext() {
ASTNode parent = this.parent;
@@ -10850,11 +10850,11 @@
}
/**
- * Return `true` if this expression is computing a left-hand value.
- *
- * Note that [inGetterContext] and [inSetterContext] are not opposites, nor are
- * they mutually exclusive. In other words, it is possible for both methods to return `true`when invoked on the same node.
- * @return `true` if this expression is in a context where a setter will be invoked
+ * Return {@code true} if this expression is computing a left-hand value.
+ * <p>
+ * Note that {@link #inGetterContext()} and {@link #inSetterContext()} are not opposites, nor are
+ * they mutually exclusive. In other words, it is possible for both methods to return {@code true}when invoked on the same node.
+ * @return {@code true} if this expression is in a context where a setter will be invoked
*/
bool inSetterContext() {
ASTNode parent = this.parent;
@@ -10875,7 +10875,7 @@
target = access;
}
if (parent is PrefixExpression) {
- return ((parent as PrefixExpression)).operator.type.isIncrementOperator;
+ return ((parent as PrefixExpression)).operator.type.isIncrementOperator();
} else if (parent is PostfixExpression) {
return true;
} else if (parent is AssignmentExpression) {
@@ -10883,7 +10883,7 @@
}
return false;
}
- bool get isSynthetic => _token.isSynthetic;
+ bool isSynthetic() => _token.isSynthetic();
/**
* Set the element associated with this identifier based on propagated type information to the
@@ -10914,7 +10914,7 @@
}
}
/**
- * Instances of the class `SimpleStringLiteral` represent a string literal expression that
+ * Instances of the class {@code SimpleStringLiteral} represent a string literal expression that
* does not contain any interpolations.
* <pre>
* simpleStringLiteral ::=
@@ -10979,10 +10979,10 @@
String get value => _value;
/**
- * Return `true` if this string literal is a multi-line string.
- * @return `true` if this string literal is a multi-line string
+ * Return {@code true} if this string literal is a multi-line string.
+ * @return {@code true} if this string literal is a multi-line string
*/
- bool get isMultiline {
+ bool isMultiline() {
if (_value.length < 6) {
return false;
}
@@ -10990,11 +10990,11 @@
}
/**
- * Return `true` if this string literal is a raw string.
- * @return `true` if this string literal is a raw string
+ * Return {@code true} if this string literal is a raw string.
+ * @return {@code true} if this string literal is a raw string
*/
- bool get isRaw => _value.codeUnitAt(0) == 0x40;
- bool get isSynthetic => _literal.isSynthetic;
+ bool isRaw() => _value.codeUnitAt(0) == 0x40;
+ bool isSynthetic() => _literal.isSynthetic();
/**
* Set the token representing the literal to the given token.
@@ -11018,20 +11018,20 @@
}
}
/**
- * Instances of the class `Statement` defines the behavior common to nodes that represent a
+ * Instances of the class {@code Statement} defines the behavior common to nodes that represent a
* statement.
* <pre>
- * statement ::=[Block block]| [VariableDeclarationStatement initializedVariableDeclaration ';']| [ForStatement forStatement]| [ForEachStatement forEachStatement]| [WhileStatement whileStatement]| [DoStatement doStatement]| [SwitchStatement switchStatement]| [IfStatement ifStatement]| [TryStatement tryStatement]| [BreakStatement breakStatement]| [ContinueStatement continueStatement]| [ReturnStatement returnStatement]| [ExpressionStatement expressionStatement]| [FunctionDeclarationStatement functionSignature functionBody]</pre>
+ * statement ::={@link Block block}| {@link VariableDeclarationStatement initializedVariableDeclaration ';'}| {@link ForStatement forStatement}| {@link ForEachStatement forEachStatement}| {@link WhileStatement whileStatement}| {@link DoStatement doStatement}| {@link SwitchStatement switchStatement}| {@link IfStatement ifStatement}| {@link TryStatement tryStatement}| {@link BreakStatement breakStatement}| {@link ContinueStatement continueStatement}| {@link ReturnStatement returnStatement}| {@link ExpressionStatement expressionStatement}| {@link FunctionDeclarationStatement functionSignature functionBody}</pre>
* @coverage dart.engine.ast
*/
abstract class Statement extends ASTNode {
}
/**
- * Instances of the class `StringInterpolation` represent a string interpolation literal.
+ * Instances of the class {@code StringInterpolation} represent a string interpolation literal.
* <pre>
* stringInterpolation ::=
- * ''' [InterpolationElement interpolationElement]* '''
- * | '"' [InterpolationElement interpolationElement]* '"'
+ * ''' {@link InterpolationElement interpolationElement}* '''
+ * | '"' {@link InterpolationElement interpolationElement}* '"'
* </pre>
* @coverage dart.engine.ast
*/
@@ -11073,15 +11073,15 @@
}
}
/**
- * Instances of the class `StringLiteral` represent a string literal expression.
+ * Instances of the class {@code StringLiteral} represent a string literal expression.
* <pre>
- * stringLiteral ::=[SimpleStringLiteral simpleStringLiteral]| [AdjacentStrings adjacentStrings]| [StringInterpolation stringInterpolation]</pre>
+ * stringLiteral ::={@link SimpleStringLiteral simpleStringLiteral}| {@link AdjacentStrings adjacentStrings}| {@link StringInterpolation stringInterpolation}</pre>
* @coverage dart.engine.ast
*/
abstract class StringLiteral extends Literal {
/**
- * Return the value of the string literal, or `null` if the string is not a constant string
+ * Return the value of the string literal, or {@code null} if the string is not a constant string
* without any string interpolation.
* @return the value of the string literal
*/
@@ -11104,11 +11104,11 @@
void appendStringValue(JavaStringBuilder builder);
}
/**
- * Instances of the class `SuperConstructorInvocation` represent the invocation of a
+ * Instances of the class {@code SuperConstructorInvocation} represent the invocation of a
* superclass' constructor from within a constructor's initialization list.
* <pre>
* superInvocation ::=
- * 'super' ('.' [SimpleIdentifier name])? [ArgumentList argumentList]</pre>
+ * 'super' ('.' {@link SimpleIdentifier name})? {@link ArgumentList argumentList}</pre>
* @coverage dart.engine.ast
*/
class SuperConstructorInvocation extends ConstructorInitializer {
@@ -11119,12 +11119,12 @@
Token _keyword;
/**
- * The token for the period before the name of the constructor that is being invoked, or`null` if the unnamed constructor is being invoked.
+ * The token for the period before the name of the constructor that is being invoked, or{@code null} if the unnamed constructor is being invoked.
*/
Token _period;
/**
- * The name of the constructor that is being invoked, or `null` if the unnamed constructor
+ * The name of the constructor that is being invoked, or {@code null} if the unnamed constructor
* is being invoked.
*/
SimpleIdentifier _constructorName;
@@ -11135,12 +11135,12 @@
ArgumentList _argumentList;
/**
- * The element associated with the constructor based on static type information, or `null`if the AST structure has not been resolved or if the constructor could not be resolved.
+ * The element associated with the constructor based on static type information, or {@code null}if the AST structure has not been resolved or if the constructor could not be resolved.
*/
ConstructorElement _staticElement;
/**
- * The element associated with the constructor based on propagated type information, or `null` if the AST structure has not been
+ * The element associated with the constructor based on propagated type information, or {@code null} if the AST structure has not been
* resolved or if the constructor could not be resolved.
*/
ConstructorElement _propagatedElement;
@@ -11179,14 +11179,14 @@
Token get beginToken => _keyword;
/**
- * Return the name of the constructor that is being invoked, or `null` if the unnamed
+ * Return the name of the constructor that is being invoked, or {@code null} if the unnamed
* constructor is being invoked.
* @return the name of the constructor that is being invoked
*/
SimpleIdentifier get constructorName => _constructorName;
/**
- * Return the element associated with the constructor based on propagated type information, or`null` if the AST structure has not been resolved or if the constructor could not be
+ * Return the element associated with the constructor based on propagated type information, or{@code null} if the AST structure has not been resolved or if the constructor could not be
* resolved.
* @return the element associated with the super constructor
*/
@@ -11200,13 +11200,13 @@
Token get keyword => _keyword;
/**
- * Return the token for the period before the name of the constructor that is being invoked, or`null` if the unnamed constructor is being invoked.
+ * Return the token for the period before the name of the constructor that is being invoked, or{@code null} if the unnamed constructor is being invoked.
* @return the token for the period before the name of the constructor that is being invoked
*/
Token get period => _period;
/**
- * Return the element associated with the constructor based on static type information, or`null` if the AST structure has not been resolved or if the constructor could not be
+ * Return the element associated with the constructor based on static type information, or{@code null} if the AST structure has not been resolved or if the constructor could not be
* resolved.
* @return the element associated with the constructor
*/
@@ -11268,7 +11268,7 @@
}
}
/**
- * Instances of the class `SuperExpression` represent a super expression.
+ * Instances of the class {@code SuperExpression} represent a super expression.
* <pre>
* superExpression ::=
* 'super'
@@ -11316,9 +11316,9 @@
}
}
/**
- * Instances of the class `SwitchCase` represent the case in a switch statement.
+ * Instances of the class {@code SwitchCase} represent the case in a switch statement.
* <pre>
- * switchCase ::=[SimpleIdentifier label]* 'case' [Expression expression] ':' [Statement statement]</pre>
+ * switchCase ::={@link SimpleIdentifier label}* 'case' {@link Expression expression} ':' {@link Statement statement}</pre>
* @coverage dart.engine.ast
*/
class SwitchCase extends SwitchMember {
@@ -11371,9 +11371,9 @@
}
}
/**
- * Instances of the class `SwitchDefault` represent the default case in a switch statement.
+ * Instances of the class {@code SwitchDefault} represent the default case in a switch statement.
* <pre>
- * switchDefault ::=[SimpleIdentifier label]* 'default' ':' [Statement statement]</pre>
+ * switchDefault ::={@link SimpleIdentifier label}* 'default' ':' {@link Statement statement}</pre>
* @coverage dart.engine.ast
*/
class SwitchDefault extends SwitchMember {
@@ -11403,7 +11403,7 @@
}
}
/**
- * The abstract class `SwitchMember` defines the behavior common to objects representing
+ * The abstract class {@code SwitchMember} defines the behavior common to objects representing
* elements within a switch statement.
* <pre>
* switchMember ::=
@@ -11512,10 +11512,10 @@
}
}
/**
- * Instances of the class `SwitchStatement` represent a switch statement.
+ * Instances of the class {@code SwitchStatement} represent a switch statement.
* <pre>
* switchStatement ::=
- * 'switch' '(' [Expression expression] ')' '{' [SwitchCase switchCase]* [SwitchDefault defaultCase]? '}'
+ * 'switch' '(' {@link Expression expression} ')' '{' {@link SwitchCase switchCase}* {@link SwitchDefault defaultCase}? '}'
* </pre>
* @coverage dart.engine.ast
*/
@@ -11688,7 +11688,7 @@
}
}
/**
- * Instances of the class `ThisExpression` represent a this expression.
+ * Instances of the class {@code ThisExpression} represent a this expression.
* <pre>
* thisExpression ::=
* 'this'
@@ -11736,10 +11736,10 @@
}
}
/**
- * Instances of the class `ThrowExpression` represent a throw expression.
+ * Instances of the class {@code ThrowExpression} represent a throw expression.
* <pre>
* throwExpression ::=
- * 'throw' [Expression expression]</pre>
+ * 'throw' {@link Expression expression}</pre>
* @coverage dart.engine.ast
*/
class ThrowExpression extends Expression {
@@ -11811,7 +11811,7 @@
}
}
/**
- * Instances of the class `TopLevelVariableDeclaration` represent the declaration of one or
+ * Instances of the class {@code TopLevelVariableDeclaration} represent the declaration of one or
* more top-level variables of the same type.
* <pre>
* topLevelVariableDeclaration ::=
@@ -11890,12 +11890,12 @@
Token get firstTokenAfterCommentAndMetadata => _variableList.beginToken;
}
/**
- * Instances of the class `TryStatement` represent a try statement.
+ * Instances of the class {@code TryStatement} represent a try statement.
* <pre>
* tryStatement ::=
- * 'try' [Block block] ([CatchClause catchClause]+ finallyClause? | finallyClause)
+ * 'try' {@link Block block} ({@link CatchClause catchClause}+ finallyClause? | finallyClause)
* finallyClause ::=
- * 'finally' [Block block]</pre>
+ * 'finally' {@link Block block}</pre>
* @coverage dart.engine.ast
*/
class TryStatement extends Statement {
@@ -11916,13 +11916,13 @@
NodeList<CatchClause> _catchClauses;
/**
- * The token representing the 'finally' keyword, or `null` if the statement does not contain
+ * The token representing the 'finally' keyword, or {@code null} if the statement does not contain
* a finally clause.
*/
Token _finallyKeyword;
/**
- * The finally clause contained in the try statement, or `null` if the statement does not
+ * The finally clause contained in the try statement, or {@code null} if the statement does not
* contain a finally clause.
*/
Block _finallyClause;
@@ -11979,14 +11979,14 @@
}
/**
- * Return the finally clause contained in the try statement, or `null` if the statement does
+ * Return the finally clause contained in the try statement, or {@code null} if the statement does
* not contain a finally clause.
* @return the finally clause contained in the try statement
*/
Block get finallyClause => _finallyClause;
/**
- * Return the token representing the 'finally' keyword, or `null` if the statement does not
+ * Return the token representing the 'finally' keyword, or {@code null} if the statement does not
* contain a finally clause.
* @return the token representing the 'finally' keyword
*/
@@ -12036,7 +12036,7 @@
}
}
/**
- * The abstract class `TypeAlias` defines the behavior common to declarations of type aliases.
+ * The abstract class {@code TypeAlias} defines the behavior common to declarations of type aliases.
* <pre>
* typeAlias ::=
* 'typedef' typeAliasBody
@@ -12110,7 +12110,7 @@
Token get firstTokenAfterCommentAndMetadata => _keyword;
}
/**
- * Instances of the class `TypeArgumentList` represent a list of type arguments.
+ * Instances of the class {@code TypeArgumentList} represent a list of type arguments.
* <pre>
* typeArguments ::=
* '<' typeName (',' typeName)* '>'
@@ -12196,10 +12196,10 @@
}
}
/**
- * Instances of the class `TypeName` represent the name of a type, which can optionally
+ * Instances of the class {@code TypeName} represent the name of a type, which can optionally
* include type arguments.
* <pre>
- * typeName ::=[Identifier identifier] typeArguments?
+ * typeName ::={@link Identifier identifier} typeArguments?
* </pre>
* @coverage dart.engine.ast
*/
@@ -12211,19 +12211,19 @@
Identifier _name;
/**
- * The type arguments associated with the type, or `null` if there are no type arguments.
+ * The type arguments associated with the type, or {@code null} if there are no type arguments.
*/
TypeArgumentList _typeArguments;
/**
- * The type being named, or `null` if the AST structure has not been resolved.
+ * The type being named, or {@code null} if the AST structure has not been resolved.
*/
Type2 _type;
/**
* Initialize a newly created type name.
* @param name the name of the type
- * @param typeArguments the type arguments associated with the type, or `null` if there are
+ * @param typeArguments the type arguments associated with the type, or {@code null} if there are
* no type arguments
*/
TypeName.full(Identifier name, TypeArgumentList typeArguments) {
@@ -12234,7 +12234,7 @@
/**
* Initialize a newly created type name.
* @param name the name of the type
- * @param typeArguments the type arguments associated with the type, or `null` if there are
+ * @param typeArguments the type arguments associated with the type, or {@code null} if there are
* no type arguments
*/
TypeName({Identifier name, TypeArgumentList typeArguments}) : this.full(name, typeArguments);
@@ -12254,18 +12254,18 @@
Identifier get name => _name;
/**
- * Return the type being named, or `null` if the AST structure has not been resolved.
+ * Return the type being named, or {@code null} if the AST structure has not been resolved.
* @return the type being named
*/
Type2 get type => _type;
/**
- * Return the type arguments associated with the type, or `null` if there are no type
+ * Return the type arguments associated with the type, or {@code null} if there are no type
* arguments.
* @return the type arguments associated with the type
*/
TypeArgumentList get typeArguments => _typeArguments;
- bool get isSynthetic => _name.isSynthetic && _typeArguments == null;
+ bool isSynthetic() => _name.isSynthetic() && _typeArguments == null;
/**
* Set the name of the type to the given identifier.
@@ -12296,9 +12296,9 @@
}
}
/**
- * Instances of the class `TypeParameter` represent a type parameter.
+ * Instances of the class {@code TypeParameter} represent a type parameter.
* <pre>
- * typeParameter ::=[SimpleIdentifier name] ('extends' [TypeName bound])?
+ * typeParameter ::={@link SimpleIdentifier name} ('extends' {@link TypeName bound})?
* </pre>
* @coverage dart.engine.ast
*/
@@ -12310,13 +12310,13 @@
SimpleIdentifier _name;
/**
- * The token representing the 'extends' keyword, or `null` if there was no explicit upper
+ * The token representing the 'extends' keyword, or {@code null} if there was no explicit upper
* bound.
*/
Token _keyword;
/**
- * The name of the upper bound for legal arguments, or `null` if there was no explicit upper
+ * The name of the upper bound for legal arguments, or {@code null} if there was no explicit upper
* bound.
*/
TypeName _bound;
@@ -12347,7 +12347,7 @@
accept(ASTVisitor visitor) => visitor.visitTypeParameter(this);
/**
- * Return the name of the upper bound for legal arguments, or `null` if there was no
+ * Return the name of the upper bound for legal arguments, or {@code null} if there was no
* explicit upper bound.
* @return the name of the upper bound for legal arguments
*/
@@ -12403,10 +12403,10 @@
Token get firstTokenAfterCommentAndMetadata => _name.beginToken;
}
/**
- * Instances of the class `TypeParameterList` represent type parameters within a declaration.
+ * Instances of the class {@code TypeParameterList} represent type parameters within a declaration.
* <pre>
* typeParameterList ::=
- * '<' [TypeParameter typeParameter] (',' [TypeParameter typeParameter])* '>'
+ * '<' {@link TypeParameter typeParameter} (',' {@link TypeParameter typeParameter})* '>'
* </pre>
* @coverage dart.engine.ast
*/
@@ -12473,22 +12473,22 @@
}
}
/**
- * The abstract class `TypedLiteral` defines the behavior common to literals that have a type
+ * The abstract class {@code TypedLiteral} defines the behavior common to literals that have a type
* associated with them.
* <pre>
- * listLiteral ::=[ListLiteral listLiteral]| [MapLiteral mapLiteral]</pre>
+ * listLiteral ::={@link ListLiteral listLiteral}| {@link MapLiteral mapLiteral}</pre>
* @coverage dart.engine.ast
*/
abstract class TypedLiteral extends Literal {
/**
- * The const modifier associated with this literal, or `null` if the literal is not a
+ * The const modifier associated with this literal, or {@code null} if the literal is not a
* constant.
*/
Token _modifier;
/**
- * The type argument associated with this literal, or `null` if no type arguments were
+ * The type argument associated with this literal, or {@code null} if no type arguments were
* declared.
*/
TypeArgumentList _typeArguments;
@@ -12496,7 +12496,7 @@
/**
* Initialize a newly created typed literal.
* @param modifier the const modifier associated with this literal
- * @param typeArguments the type argument associated with this literal, or `null` if no type
+ * @param typeArguments the type argument associated with this literal, or {@code null} if no type
* arguments were declared
*/
TypedLiteral.full(Token modifier, TypeArgumentList typeArguments) {
@@ -12507,7 +12507,7 @@
/**
* Initialize a newly created typed literal.
* @param modifier the const modifier associated with this literal
- * @param typeArguments the type argument associated with this literal, or `null` if no type
+ * @param typeArguments the type argument associated with this literal, or {@code null} if no type
* arguments were declared
*/
TypedLiteral({Token modifier, TypeArgumentList typeArguments}) : this.full(modifier, typeArguments);
@@ -12519,7 +12519,7 @@
Token get modifier => _modifier;
/**
- * Return the type argument associated with this literal, or `null` if no type arguments
+ * Return the type argument associated with this literal, or {@code null} if no type arguments
* were declared.
* @return the type argument associated with this literal
*/
@@ -12545,10 +12545,10 @@
}
}
/**
- * The abstract class `UriBasedDirective` defines the behavior common to nodes that represent
+ * The abstract class {@code UriBasedDirective} defines the behavior common to nodes that represent
* a directive that references a URI.
* <pre>
- * uriBasedDirective ::=[ExportDirective exportDirective]| [ImportDirective importDirective]| [PartDirective partDirective]</pre>
+ * uriBasedDirective ::={@link ExportDirective exportDirective}| {@link ImportDirective importDirective}| {@link PartDirective partDirective}</pre>
* @coverage dart.engine.ast
*/
abstract class UriBasedDirective extends Directive {
@@ -12583,7 +12583,7 @@
StringLiteral get uri => _uri;
/**
- * Return the element associated with the URI of this directive, or `null` if the AST
+ * Return the element associated with the URI of this directive, or {@code null} if the AST
* structure has not been resolved or if this URI could not be resolved. Examples of the latter
* case include a directive that contains an invalid URL or a URL that does not exist.
* @return the element associated with this directive
@@ -12603,10 +12603,10 @@
}
}
/**
- * Instances of the class `VariableDeclaration` represent an identifier that has an initial
- * value associated with it. Instances of this class are always children of the class[VariableDeclarationList].
+ * Instances of the class {@code VariableDeclaration} represent an identifier that has an initial
+ * value associated with it. Instances of this class are always children of the class{@link VariableDeclarationList}.
* <pre>
- * variableDeclaration ::=[SimpleIdentifier identifier] ('=' [Expression initialValue])?
+ * variableDeclaration ::={@link SimpleIdentifier identifier} ('=' {@link Expression initialValue})?
* </pre>
* @coverage dart.engine.ast
*/
@@ -12618,13 +12618,13 @@
SimpleIdentifier _name;
/**
- * The equal sign separating the variable name from the initial value, or `null` if the
+ * The equal sign separating the variable name from the initial value, or {@code null} if the
* initial value was not specified.
*/
Token _equals;
/**
- * The expression used to compute the initial value for the variable, or `null` if the
+ * The expression used to compute the initial value for the variable, or {@code null} if the
* initial value was not specified.
*/
Expression _initializer;
@@ -12679,14 +12679,14 @@
}
/**
- * Return the equal sign separating the variable name from the initial value, or `null` if
+ * Return the equal sign separating the variable name from the initial value, or {@code null} if
* the initial value was not specified.
* @return the equal sign separating the variable name from the initial value
*/
Token get equals => _equals;
/**
- * Return the expression used to compute the initial value for the variable, or `null` if
+ * Return the expression used to compute the initial value for the variable, or {@code null} if
* the initial value was not specified.
* @return the expression used to compute the initial value for the variable
*/
@@ -12699,23 +12699,23 @@
SimpleIdentifier get name => _name;
/**
- * Return `true` if this variable was declared with the 'const' modifier.
- * @return `true` if this variable was declared with the 'const' modifier
+ * Return {@code true} if this variable was declared with the 'const' modifier.
+ * @return {@code true} if this variable was declared with the 'const' modifier
*/
- bool get isConst {
+ bool isConst() {
ASTNode parent = this.parent;
- return parent is VariableDeclarationList && ((parent as VariableDeclarationList)).isConst;
+ return parent is VariableDeclarationList && ((parent as VariableDeclarationList)).isConst();
}
/**
- * Return `true` if this variable was declared with the 'final' modifier. Variables that are
- * declared with the 'const' modifier will return `false` even though they are implicitly
+ * Return {@code true} if this variable was declared with the 'final' modifier. Variables that are
+ * declared with the 'const' modifier will return {@code false} even though they are implicitly
* final.
- * @return `true` if this variable was declared with the 'final' modifier
+ * @return {@code true} if this variable was declared with the 'final' modifier
*/
- bool get isFinal {
+ bool isFinal() {
ASTNode parent = this.parent;
- return parent is VariableDeclarationList && ((parent as VariableDeclarationList)).isFinal;
+ return parent is VariableDeclarationList && ((parent as VariableDeclarationList)).isFinal();
}
/**
@@ -12749,28 +12749,28 @@
Token get firstTokenAfterCommentAndMetadata => _name.beginToken;
}
/**
- * Instances of the class `VariableDeclarationList` represent the declaration of one or more
+ * Instances of the class {@code VariableDeclarationList} represent the declaration of one or more
* variables of the same type.
* <pre>
* variableDeclarationList ::=
- * finalConstVarOrType [VariableDeclaration variableDeclaration] (',' [VariableDeclaration variableDeclaration])
+ * finalConstVarOrType {@link VariableDeclaration variableDeclaration} (',' {@link VariableDeclaration variableDeclaration})
* finalConstVarOrType ::=
- * | 'final' [TypeName type]?
- * | 'const' [TypeName type]?
+ * | 'final' {@link TypeName type}?
+ * | 'const' {@link TypeName type}?
* | 'var'
- * | [TypeName type]</pre>
+ * | {@link TypeName type}</pre>
* @coverage dart.engine.ast
*/
class VariableDeclarationList extends AnnotatedNode {
/**
- * The token representing the 'final', 'const' or 'var' keyword, or `null` if no keyword was
+ * The token representing the 'final', 'const' or 'var' keyword, or {@code null} if no keyword was
* included.
*/
Token _keyword;
/**
- * The type of the variables being declared, or `null` if no type was provided.
+ * The type of the variables being declared, or {@code null} if no type was provided.
*/
TypeName _type;
@@ -12807,14 +12807,14 @@
Token get endToken => _variables.endToken;
/**
- * Return the token representing the 'final', 'const' or 'var' keyword, or `null` if no
+ * Return the token representing the 'final', 'const' or 'var' keyword, or {@code null} if no
* keyword was included.
* @return the token representing the 'final', 'const' or 'var' keyword
*/
Token get keyword => _keyword;
/**
- * Return the type of the variables being declared, or `null` if no type was provided.
+ * Return the type of the variables being declared, or {@code null} if no type was provided.
* @return the type of the variables being declared
*/
TypeName get type => _type;
@@ -12826,18 +12826,18 @@
NodeList<VariableDeclaration> get variables => _variables;
/**
- * Return `true` if the variables in this list were declared with the 'const' modifier.
- * @return `true` if the variables in this list were declared with the 'const' modifier
+ * Return {@code true} if the variables in this list were declared with the 'const' modifier.
+ * @return {@code true} if the variables in this list were declared with the 'const' modifier
*/
- bool get isConst => _keyword is KeywordToken && identical(((_keyword as KeywordToken)).keyword, Keyword.CONST);
+ bool isConst() => _keyword is KeywordToken && identical(((_keyword as KeywordToken)).keyword, Keyword.CONST);
/**
- * Return `true` if the variables in this list were declared with the 'final' modifier.
- * Variables that are declared with the 'const' modifier will return `false` even though
+ * Return {@code true} if the variables in this list were declared with the 'final' modifier.
+ * Variables that are declared with the 'const' modifier will return {@code false} even though
* they are implicitly final.
- * @return `true` if the variables in this list were declared with the 'final' modifier
+ * @return {@code true} if the variables in this list were declared with the 'final' modifier
*/
- bool get isFinal => _keyword is KeywordToken && identical(((_keyword as KeywordToken)).keyword, Keyword.FINAL);
+ bool isFinal() => _keyword is KeywordToken && identical(((_keyword as KeywordToken)).keyword, Keyword.FINAL);
/**
* Set the token representing the 'final', 'const' or 'var' keyword to the given token.
@@ -12868,10 +12868,10 @@
}
}
/**
- * Instances of the class `VariableDeclarationStatement` represent a list of variables that
+ * Instances of the class {@code VariableDeclarationStatement} represent a list of variables that
* are being declared in a context where a statement is required.
* <pre>
- * variableDeclarationStatement ::=[VariableDeclarationList variableList] ';'
+ * variableDeclarationStatement ::={@link VariableDeclarationList variableList} ';'
* </pre>
* @coverage dart.engine.ast
*/
@@ -12939,10 +12939,10 @@
}
}
/**
- * Instances of the class `WhileStatement` represent a while statement.
+ * Instances of the class {@code WhileStatement} represent a while statement.
* <pre>
* whileStatement ::=
- * 'while' '(' [Expression condition] ')' [Statement body]</pre>
+ * 'while' '(' {@link Expression condition} ')' {@link Statement body}</pre>
* @coverage dart.engine.ast
*/
class WhileStatement extends Statement {
@@ -13077,10 +13077,10 @@
}
}
/**
- * Instances of the class `WithClause` represent the with clause in a class declaration.
+ * Instances of the class {@code WithClause} represent the with clause in a class declaration.
* <pre>
* withClause ::=
- * 'with' [TypeName mixin] (',' [TypeName mixin])
+ * 'with' {@link TypeName mixin} (',' {@link TypeName mixin})
* </pre>
* @coverage dart.engine.ast
*/
@@ -13141,9 +13141,9 @@
}
}
/**
- * Instances of the class `BreadthFirstVisitor` implement an AST visitor that will recursively
- * visit all of the nodes in an AST structure, similar to [GeneralizingASTVisitor]. This
- * visitor uses a breadth-first ordering rather than the depth-first ordering of[GeneralizingASTVisitor].
+ * Instances of the class {@code BreadthFirstVisitor} implement an AST visitor that will recursively
+ * visit all of the nodes in an AST structure, similar to {@link GeneralizingASTVisitor}. This
+ * visitor uses a breadth-first ordering rather than the depth-first ordering of{@link GeneralizingASTVisitor}.
* @coverage dart.engine.ast
*/
class BreadthFirstVisitor<R> extends GeneralizingASTVisitor<R> {
@@ -13151,7 +13151,7 @@
GeneralizingASTVisitor<Object> _childVisitor;
/**
- * Visit all nodes in the tree starting at the given `root` node, in depth-first order.
+ * Visit all nodes in the tree starting at the given {@code root} node, in depth-first order.
* @param root the root of the ASTNode tree
*/
void visitAllNodes(ASTNode root) {
@@ -13178,32 +13178,32 @@
}
}
/**
- * Instances of the class `ConstantEvaluator` evaluate constant expressions to produce their
+ * Instances of the class {@code ConstantEvaluator} evaluate constant expressions to produce their
* compile-time value. According to the Dart Language Specification: <blockquote> A constant
* expression is one of the following:
- *
- * * A literal number.
- * * A literal boolean.
- * * A literal string where any interpolated expression is a compile-time constant that evaluates
- * to a numeric, string or boolean value or to `null`.
- * * `null`.
- * * A reference to a static constant variable.
- * * An identifier expression that denotes a constant variable, a class or a type variable.
- * * A constant constructor invocation.
- * * A constant list literal.
- * * A constant map literal.
- * * A simple or qualified identifier denoting a top-level function or a static method.
- * * A parenthesized expression `(e)` where `e` is a constant expression.
- * * An expression of one of the forms `identical(e1, e2)`, `e1 == e2`,`e1 != e2` where `e1` and `e2` are constant expressions that evaluate to a
- * numeric, string or boolean value or to `null`.
- * * An expression of one of the forms `!e`, `e1 && e2` or `e1 || e2`, where`e`, `e1` and `e2` are constant expressions that evaluate to a boolean value or
- * to `null`.
- * * An expression of one of the forms `~e`, `e1 ^ e2`, `e1 & e2`,`e1 | e2`, `e1 >> e2` or `e1 << e2`, where `e`, `e1` and `e2`are constant expressions that evaluate to an integer value or to `null`.
- * * An expression of one of the forms `-e`, `e1 + e2`, `e1 - e2`,`e1 * e2`, `e1 / e2`, `e1 ~/ e2`, `e1 > e2`, `e1 < e2`,`e1 >= e2`, `e1 <= e2` or `e1 % e2`, where `e`, `e1` and `e2`are constant expressions that evaluate to a numeric value or to `null`.
- *
- * </blockquote> The values returned by instances of this class are therefore `null` and
- * instances of the classes `Boolean`, `BigInteger`, `Double`, `String`, and`DartObject`.
- *
+ * <ul>
+ * <li>A literal number.</li>
+ * <li>A literal boolean.</li>
+ * <li>A literal string where any interpolated expression is a compile-time constant that evaluates
+ * to a numeric, string or boolean value or to {@code null}.</li>
+ * <li>{@code null}.</li>
+ * <li>A reference to a static constant variable.</li>
+ * <li>An identifier expression that denotes a constant variable, a class or a type variable.</li>
+ * <li>A constant constructor invocation.</li>
+ * <li>A constant list literal.</li>
+ * <li>A constant map literal.</li>
+ * <li>A simple or qualified identifier denoting a top-level function or a static method.</li>
+ * <li>A parenthesized expression {@code (e)} where {@code e} is a constant expression.</li>
+ * <li>An expression of one of the forms {@code identical(e1, e2)}, {@code e1 == e2},{@code e1 != e2} where {@code e1} and {@code e2} are constant expressions that evaluate to a
+ * numeric, string or boolean value or to {@code null}.</li>
+ * <li>An expression of one of the forms {@code !e}, {@code e1 && e2} or {@code e1 || e2}, where{@code e}, {@code e1} and {@code e2} are constant expressions that evaluate to a boolean value or
+ * to {@code null}.</li>
+ * <li>An expression of one of the forms {@code ~e}, {@code e1 ^ e2}, {@code e1 & e2},{@code e1 | e2}, {@code e1 >> e2} or {@code e1 << e2}, where {@code e}, {@code e1} and {@code e2}are constant expressions that evaluate to an integer value or to {@code null}.</li>
+ * <li>An expression of one of the forms {@code -e}, {@code e1 + e2}, {@code e1 - e2},{@code e1 * e2}, {@code e1 / e2}, {@code e1 ~/ e2}, {@code e1 > e2}, {@code e1 < e2},{@code e1 >= e2}, {@code e1 <= e2} or {@code e1 % e2}, where {@code e}, {@code e1} and {@code e2}are constant expressions that evaluate to a numeric value or to {@code null}.</li>
+ * </ul>
+ * </blockquote> The values returned by instances of this class are therefore {@code null} and
+ * instances of the classes {@code Boolean}, {@code BigInteger}, {@code Double}, {@code String}, and{@code DartObject}.
+ * <p>
* In addition, this class defines several values that can be returned to indicate various
* conditions encountered during evaluation. These are documented with the static field that define
* those values.
@@ -13449,23 +13449,23 @@
Object getConstantValue(Element element) {
if (element is FieldElement) {
FieldElement field = element as FieldElement;
- if (field.isStatic && field.isConst) {
+ if (field.isStatic() && field.isConst()) {
}
}
return NOT_A_CONSTANT;
}
}
/**
- * Instances of the class `ElementLocator` locate the [Element Dart model element]associated with a given [ASTNode AST node].
+ * Instances of the class {@code ElementLocator} locate the {@link Element Dart model element}associated with a given {@link ASTNode AST node}.
* @coverage dart.engine.ast
*/
class ElementLocator {
/**
- * Locate the [Element Dart model element] associated with the given [ASTNode AST
- * node].
- * @param node the node (not `null`)
- * @return the associated element, or `null` if none is found
+ * Locate the {@link Element Dart model element} associated with the given {@link ASTNode AST
+ * node}.
+ * @param node the node (not {@code null})
+ * @return the associated element, or {@code null} if none is found
*/
static Element locate(ASTNode node) {
ElementLocator_ElementMapper mapper = new ElementLocator_ElementMapper();
@@ -13527,15 +13527,15 @@
Element visitVariableDeclaration(VariableDeclaration node) => node.element;
}
/**
- * Instances of the class `GeneralizingASTVisitor` implement an AST visitor that will
- * recursively visit all of the nodes in an AST structure (like instances of the class[RecursiveASTVisitor]). In addition, when a node of a specific type is visited not only
+ * Instances of the class {@code GeneralizingASTVisitor} implement an AST visitor that will
+ * recursively visit all of the nodes in an AST structure (like instances of the class{@link RecursiveASTVisitor}). In addition, when a node of a specific type is visited not only
* will the visit method for that specific type of node be invoked, but additional methods for the
* superclasses of that node will also be invoked. For example, using an instance of this class to
- * visit a [Block] will cause the method [visitBlock] to be invoked but will
- * also cause the methods [visitStatement] and [visitNode] to be
+ * visit a {@link Block} will cause the method {@link #visitBlock(Block)} to be invoked but will
+ * also cause the methods {@link #visitStatement(Statement)} and {@link #visitNode(ASTNode)} to be
* subsequently invoked. This allows visitors to be written that visit all statements without
- * needing to override the visit method for each of the specific subclasses of [Statement].
- *
+ * needing to override the visit method for each of the specific subclasses of {@link Statement}.
+ * <p>
* Subclasses that override a visit method must either invoke the overridden visit method or
* explicitly invoke the more general visit method. Failure to do so will cause the visit methods
* for superclasses of the node to not be invoked and will cause the children of the visited node to
@@ -13671,9 +13671,9 @@
R visitWithClause(WithClause node) => visitNode(node);
}
/**
- * Instances of the class `NodeLocator` locate the [ASTNode AST node] associated with a
+ * Instances of the class {@code NodeLocator} locate the {@link ASTNode AST node} associated with a
* source range, given the AST structure built from the source. More specifically, they will return
- * the [ASTNode AST node] with the shortest length whose source range completely encompasses
+ * the {@link ASTNode AST node} with the shortest length whose source range completely encompasses
* the specified range.
* @coverage dart.engine.ast
*/
@@ -13690,13 +13690,13 @@
int _endOffset = 0;
/**
- * The element that was found that corresponds to the given source range, or `null` if there
+ * The element that was found that corresponds to the given source range, or {@code null} if there
* is no such element.
*/
ASTNode _foundNode;
/**
- * Initialize a newly created locator to locate one or more [ASTNode AST nodes] by locating
+ * Initialize a newly created locator to locate one or more {@link ASTNode AST nodes} by locating
* the node within an AST structure that corresponds to the given offset in the source.
* @param offset the offset used to identify the node
*/
@@ -13708,7 +13708,7 @@
}
/**
- * Initialize a newly created locator to locate one or more [ASTNode AST nodes] by locating
+ * Initialize a newly created locator to locate one or more {@link ASTNode AST nodes} by locating
* the node within an AST structure that corresponds to the given range of characters in the
* source.
* @param start the start offset of the range used to identify the node
@@ -13723,15 +13723,15 @@
}
/**
- * Return the node that was found that corresponds to the given source range, or `null` if
+ * Return the node that was found that corresponds to the given source range, or {@code null} if
* there is no such node.
* @return the node that was found
*/
ASTNode get foundNode => _foundNode;
/**
- * Search within the given AST node for an identifier representing a [DartElement Dart
- * element] in the specified source range. Return the element that was found, or `null` if
+ * Search within the given AST node for an identifier representing a {@link DartElement Dart
+ * element} in the specified source range. Return the element that was found, or {@code null} if
* no element was found.
* @param node the AST node within which to search
* @return the element that was found
@@ -13770,17 +13770,17 @@
}
}
/**
- * Instances of the class `NodeFoundException` are used to cancel visiting after a node has
+ * Instances of the class {@code NodeFoundException} are used to cancel visiting after a node has
* been found.
*/
class NodeLocator_NodeFoundException extends RuntimeException {
static int _serialVersionUID = 1;
}
/**
- * Instances of the class `RecursiveASTVisitor` implement an AST visitor that will recursively
+ * Instances of the class {@code RecursiveASTVisitor} implement an AST visitor that will recursively
* visit all of the nodes in an AST structure. For example, using an instance of this class to visit
- * a [Block] will also cause all of the statements in the block to be visited.
- *
+ * a {@link Block} will also cause all of the statements in the block to be visited.
+ * <p>
* Subclasses that override a visit method must either invoke the overridden visit method or must
* explicitly ask the visited node to visit its children. Failure to do so will cause the children
* of the visited node to not be visited.
@@ -14193,7 +14193,7 @@
}
}
/**
- * Instances of the class `SimpleASTVisitor` implement an AST visitor that will do nothing
+ * Instances of the class {@code SimpleASTVisitor} implement an AST visitor that will do nothing
* when visiting an AST node. It is intended to be a superclass for classes that use the visitor
* pattern primarily as a dispatch mechanism (and hence don't need to recursively visit a whole
* structure) and that only need to visit a small number of node types.
@@ -14303,7 +14303,7 @@
R visitWithClause(WithClause node) => null;
}
/**
- * Instances of the class `ToSourceVisitor` write a source representation of a visited AST
+ * Instances of the class {@code ToSourceVisitor} write a source representation of a visited AST
* node (and all of it's children) to a writer.
* @coverage dart.engine.ast
*/
@@ -14680,7 +14680,7 @@
return null;
}
Object visitIndexExpression(IndexExpression node) {
- if (node.isCascaded) {
+ if (node.isCascaded()) {
_writer.print("..");
} else {
visit(node.array);
@@ -14780,14 +14780,14 @@
visit5(node.propertyKeyword, " ");
visit5(node.operatorKeyword, " ");
visit(node.name);
- if (!node.isGetter) {
+ if (!node.isGetter()) {
visit(node.parameters);
}
visit4(" ", node.body);
return null;
}
Object visitMethodInvocation(MethodInvocation node) {
- if (node.isCascaded) {
+ if (node.isCascaded()) {
_writer.print("..");
} else {
visit2(node.target, ".");
@@ -14846,7 +14846,7 @@
return null;
}
Object visitPropertyAccess(PropertyAccess node) {
- if (node.isCascaded) {
+ if (node.isCascaded()) {
_writer.print("..");
} else {
visit(node.target);
@@ -15017,7 +15017,7 @@
}
/**
- * Safely visit the given node, printing the suffix after the node if it is non-`null`.
+ * Safely visit the given node, printing the suffix after the node if it is non-{@code null}.
* @param suffix the suffix to be printed if there is a node to visit
* @param node the node to be visited
*/
@@ -15029,7 +15029,7 @@
}
/**
- * Safely visit the given node, printing the prefix before the node if it is non-`null`.
+ * Safely visit the given node, printing the prefix before the node if it is non-{@code null}.
* @param prefix the prefix to be printed if there is a node to visit
* @param node the node to be visited
*/
@@ -15053,7 +15053,7 @@
}
/**
- * Safely visit the given node, printing the suffix after the node if it is non-`null`.
+ * Safely visit the given node, printing the suffix after the node if it is non-{@code null}.
* @param suffix the suffix to be printed if there is a node to visit
* @param node the node to be visited
*/
@@ -15133,7 +15133,7 @@
}
}
/**
- * Instances of the class `ASTCloner` implement an object that will clone any AST structure
+ * Instances of the class {@code ASTCloner} implement an object that will clone any AST structure
* that it visits. The cloner will only clone the structure, it will not preserve any resolution
* results or properties associated with the nodes.
*/
@@ -15155,9 +15155,9 @@
ClassDeclaration visitClassDeclaration(ClassDeclaration node) => new ClassDeclaration.full(clone2(node.documentationComment), clone3(node.metadata), node.abstractKeyword, node.classKeyword, clone2(node.name), clone2(node.typeParameters), clone2(node.extendsClause), clone2(node.withClause), clone2(node.implementsClause), node.leftBracket, clone3(node.members), node.rightBracket);
ClassTypeAlias visitClassTypeAlias(ClassTypeAlias node) => new ClassTypeAlias.full(clone2(node.documentationComment), clone3(node.metadata), node.keyword, clone2(node.name), clone2(node.typeParameters), node.equals, node.abstractKeyword, clone2(node.superclass), clone2(node.withClause), clone2(node.implementsClause), node.semicolon);
Comment visitComment(Comment node) {
- if (node.isDocumentation) {
+ if (node.isDocumentation()) {
return Comment.createDocumentationComment2(node.tokens, clone3(node.references));
- } else if (node.isBlock) {
+ } else if (node.isBlock()) {
return Comment.createBlockComment(node.tokens);
}
return Comment.createEndOfLineComment(node.tokens);
@@ -15277,7 +15277,7 @@
* Traverse the AST from initial child node to successive parents, building a collection of local
* variable and parameter names visible to the initial child node. In case of name shadowing, the
* first name seen is the most specific one so names are not redefined.
- *
+ * <p>
* Completion test code coverage is 95%. The two basic blocks that are not executed cannot be
* executed. They are included for future reference.
* @coverage com.google.dart.engine.services.completion
diff --git a/pkg/analyzer_experimental/lib/src/generated/constant.dart b/pkg/analyzer_experimental/lib/src/generated/constant.dart
index 294d22c..2b39d59 100644
--- a/pkg/analyzer_experimental/lib/src/generated/constant.dart
+++ b/pkg/analyzer_experimental/lib/src/generated/constant.dart
@@ -9,32 +9,32 @@
import 'element.dart';
import 'engine.dart' show AnalysisEngine;
/**
- * Instances of the class `ConstantEvaluator` evaluate constant expressions to produce their
+ * Instances of the class {@code ConstantEvaluator} evaluate constant expressions to produce their
* compile-time value. According to the Dart Language Specification: <blockquote> A constant
* expression is one of the following:
- *
- * * A literal number.
- * * A literal boolean.
- * * A literal string where any interpolated expression is a compile-time constant that evaluates
- * to a numeric, string or boolean value or to `null`.
- * * `null`.
- * * A reference to a static constant variable.
- * * An identifier expression that denotes a constant variable, a class or a type variable.
- * * A constant constructor invocation.
- * * A constant list literal.
- * * A constant map literal.
- * * A simple or qualified identifier denoting a top-level function or a static method.
- * * A parenthesized expression `(e)` where `e` is a constant expression.
- * * An expression of one of the forms `identical(e1, e2)`, `e1 == e2`,`e1 != e2` where `e1` and `e2` are constant expressions that evaluate to a
- * numeric, string or boolean value or to `null`.
- * * An expression of one of the forms `!e`, `e1 && e2` or `e1 || e2`, where`e`, `e1` and `e2` are constant expressions that evaluate to a boolean value or
- * to `null`.
- * * An expression of one of the forms `~e`, `e1 ^ e2`, `e1 & e2`,`e1 | e2`, `e1 >> e2` or `e1 << e2`, where `e`, `e1` and `e2`are constant expressions that evaluate to an integer value or to `null`.
- * * An expression of one of the forms `-e`, `e1 + e2`, `e1 - e2`,`e1 * e2`, `e1 / e2`, `e1 ~/ e2`, `e1 > e2`, `e1 < e2`,`e1 >= e2`, `e1 <= e2` or `e1 % e2`, where `e`, `e1` and `e2`are constant expressions that evaluate to a numeric value or to `null`.
- *
- * </blockquote> The values returned by instances of this class are therefore `null` and
- * instances of the classes `Boolean`, `BigInteger`, `Double`, `String`, and`DartObject`.
- *
+ * <ul>
+ * <li>A literal number.</li>
+ * <li>A literal boolean.</li>
+ * <li>A literal string where any interpolated expression is a compile-time constant that evaluates
+ * to a numeric, string or boolean value or to {@code null}.</li>
+ * <li>{@code null}.</li>
+ * <li>A reference to a static constant variable.</li>
+ * <li>An identifier expression that denotes a constant variable, a class or a type variable.</li>
+ * <li>A constant constructor invocation.</li>
+ * <li>A constant list literal.</li>
+ * <li>A constant map literal.</li>
+ * <li>A simple or qualified identifier denoting a top-level function or a static method.</li>
+ * <li>A parenthesized expression {@code (e)} where {@code e} is a constant expression.</li>
+ * <li>An expression of one of the forms {@code identical(e1, e2)}, {@code e1 == e2},{@code e1 != e2} where {@code e1} and {@code e2} are constant expressions that evaluate to a
+ * numeric, string or boolean value or to {@code null}.</li>
+ * <li>An expression of one of the forms {@code !e}, {@code e1 && e2} or {@code e1 || e2}, where{@code e}, {@code e1} and {@code e2} are constant expressions that evaluate to a boolean value or
+ * to {@code null}.</li>
+ * <li>An expression of one of the forms {@code ~e}, {@code e1 ^ e2}, {@code e1 & e2},{@code e1 | e2}, {@code e1 >> e2} or {@code e1 << e2}, where {@code e}, {@code e1} and {@code e2}are constant expressions that evaluate to an integer value or to {@code null}.</li>
+ * <li>An expression of one of the forms {@code -e}, {@code e1 + e2}, {@code e1 - e2},{@code e1 * e2}, {@code e1 / e2}, {@code e1 ~/ e2}, {@code e1 > e2}, {@code e1 < e2},{@code e1 >= e2}, {@code e1 <= e2} or {@code e1 % e2}, where {@code e}, {@code e1} and {@code e2}are constant expressions that evaluate to a numeric value or to {@code null}.</li>
+ * </ul>
+ * </blockquote> The values returned by instances of this class are therefore {@code null} and
+ * instances of the classes {@code Boolean}, {@code BigInteger}, {@code Double}, {@code String}, and{@code DartObject}.
+ * <p>
* In addition, this class defines several values that can be returned to indicate various
* conditions encountered during evaluation. These are documented with the static field that define
* those values.
@@ -67,7 +67,7 @@
}
}
/**
- * Instances of the class `EvaluationResult` represent the result of attempting to evaluate an
+ * Instances of the class {@code EvaluationResult} represent the result of attempting to evaluate an
* expression.
*/
class EvaluationResult {
@@ -100,7 +100,7 @@
/**
* Initialize a newly created result object with the given state. Clients should use one of the
- * factory methods: [forErrors] and [forValue].
+ * factory methods: {@link #forErrors(AnalysisError\[\])} and {@link #forValue(Object)}.
* @param value the value of the expression
* @param errors the errors that should be reported for the expression(s) that were evaluated
*/
@@ -118,21 +118,21 @@
List<AnalysisError> get errors => _errors == null ? AnalysisError.NO_ERRORS : _errors;
/**
- * Return the value of the expression, or `null` if the expression evaluated to `null`or if the expression could not be evaluated, either because it was not a compile-time constant
+ * Return the value of the expression, or {@code null} if the expression evaluated to {@code null}or if the expression could not be evaluated, either because it was not a compile-time constant
* expression or because it would throw an exception when evaluated.
* @return the value of the expression
*/
Object get value => _value;
/**
- * Return `true` if the expression is a compile-time constant expression that would not
+ * Return {@code true} if the expression is a compile-time constant expression that would not
* throw an exception when evaluated.
- * @return `true` if the expression is a valid compile-time constant expression
+ * @return {@code true} if the expression is a valid compile-time constant expression
*/
- bool get isValid => _errors == null;
+ bool isValid() => _errors == null;
}
/**
- * Instances of the class `ConstantFinder` are used to traverse the AST structures of all of
+ * Instances of the class {@code ConstantFinder} are used to traverse the AST structures of all of
* the compilation units being resolved and build a table mapping constant variable elements to the
* declarations of those variables.
*/
@@ -151,7 +151,7 @@
Object visitVariableDeclaration(VariableDeclaration node) {
super.visitVariableDeclaration(node);
Expression initializer = node.initializer;
- if (initializer != null && node.isConst) {
+ if (initializer != null && node.isConst()) {
VariableElement element = node.element;
if (element != null) {
_variableMap[element] = node;
@@ -161,10 +161,10 @@
}
}
/**
- * Instances of the class `ConstantValueComputer` compute the values of constant variables in
+ * Instances of the class {@code ConstantValueComputer} compute the values of constant variables in
* one or more compilation units. The expected usage pattern is for the compilation units to be
- * added to this computer using the method [add] and then for the method[computeValues] to invoked exactly once. Any use of an instance after invoking the
- * method [computeValues] will result in unpredictable behavior.
+ * added to this computer using the method {@link #add(CompilationUnit)} and then for the method{@link #computeValues()} to invoked exactly once. Any use of an instance after invoking the
+ * method {@link #computeValues()} will result in unpredictable behavior.
*/
class ConstantValueComputer {
@@ -204,13 +204,13 @@
_referenceGraph.addNode(element);
entry.getValue().initializer.accept(referenceFinder);
}
- while (!_referenceGraph.isEmpty) {
+ while (!_referenceGraph.isEmpty()) {
VariableElement element = _referenceGraph.removeSink();
while (element != null) {
computeValueFor(element);
element = _referenceGraph.removeSink();
}
- if (!_referenceGraph.isEmpty) {
+ if (!_referenceGraph.isEmpty()) {
List<VariableElement> variablesInCycle = _referenceGraph.findCycle();
if (variablesInCycle == null) {
AnalysisEngine.instance.logger.logError("Exiting constant value computer with ${_referenceGraph.nodeCount} variables that are neither sinks no in a cycle");
@@ -256,29 +256,29 @@
}
}
/**
- * Instances of the class `ConstantVisitor` evaluate constant expressions to produce their
+ * Instances of the class {@code ConstantVisitor} evaluate constant expressions to produce their
* compile-time value. According to the Dart Language Specification: <blockquote> A constant
* expression is one of the following:
- *
- * * A literal number.
- * * A literal boolean.
- * * A literal string where any interpolated expression is a compile-time constant that evaluates
- * to a numeric, string or boolean value or to `null`.
- * * `null`.
- * * A reference to a static constant variable.
- * * An identifier expression that denotes a constant variable, a class or a type variable.
- * * A constant constructor invocation.
- * * A constant list literal.
- * * A constant map literal.
- * * A simple or qualified identifier denoting a top-level function or a static method.
- * * A parenthesized expression `(e)` where `e` is a constant expression.
- * * An expression of one of the forms `identical(e1, e2)`, `e1 == e2`,`e1 != e2` where `e1` and `e2` are constant expressions that evaluate to a
- * numeric, string or boolean value or to `null`.
- * * An expression of one of the forms `!e`, `e1 && e2` or `e1 || e2`, where`e`, `e1` and `e2` are constant expressions that evaluate to a boolean value or
- * to `null`.
- * * An expression of one of the forms `~e`, `e1 ^ e2`, `e1 & e2`,`e1 | e2`, `e1 >> e2` or `e1 << e2`, where `e`, `e1` and `e2`are constant expressions that evaluate to an integer value or to `null`.
- * * An expression of one of the forms `-e`, `e1 + e2`, `e1 - e2`,`e1 * e2`, `e1 / e2`, `e1 ~/ e2`, `e1 > e2`, `e1 < e2`,`e1 >= e2`, `e1 <= e2` or `e1 % e2`, where `e`, `e1` and `e2`are constant expressions that evaluate to a numeric value or to `null`.
- *
+ * <ul>
+ * <li>A literal number.</li>
+ * <li>A literal boolean.</li>
+ * <li>A literal string where any interpolated expression is a compile-time constant that evaluates
+ * to a numeric, string or boolean value or to {@code null}.</li>
+ * <li>{@code null}.</li>
+ * <li>A reference to a static constant variable.</li>
+ * <li>An identifier expression that denotes a constant variable, a class or a type variable.</li>
+ * <li>A constant constructor invocation.</li>
+ * <li>A constant list literal.</li>
+ * <li>A constant map literal.</li>
+ * <li>A simple or qualified identifier denoting a top-level function or a static method.</li>
+ * <li>A parenthesized expression {@code (e)} where {@code e} is a constant expression.</li>
+ * <li>An expression of one of the forms {@code identical(e1, e2)}, {@code e1 == e2},{@code e1 != e2} where {@code e1} and {@code e2} are constant expressions that evaluate to a
+ * numeric, string or boolean value or to {@code null}.</li>
+ * <li>An expression of one of the forms {@code !e}, {@code e1 && e2} or {@code e1 || e2}, where{@code e}, {@code e1} and {@code e2} are constant expressions that evaluate to a boolean value or
+ * to {@code null}.</li>
+ * <li>An expression of one of the forms {@code ~e}, {@code e1 ^ e2}, {@code e1 & e2},{@code e1 | e2}, {@code e1 >> e2} or {@code e1 << e2}, where {@code e}, {@code e1} and {@code e2}are constant expressions that evaluate to an integer value or to {@code null}.</li>
+ * <li>An expression of one of the forms {@code -e}, {@code e1 + e2}, {@code e1 - e2},{@code e1 * e2}, {@code e1 / e2}, {@code e1 ~/ e2}, {@code e1 > e2}, {@code e1 < e2},{@code e1 >= e2}, {@code e1 <= e2} or {@code e1 % e2}, where {@code e}, {@code e1} and {@code e2}are constant expressions that evaluate to a numeric value or to {@code null}.</li>
+ * </ul>
* </blockquote>
*/
class ConstantVisitor extends GeneralizingASTVisitor<EvaluationResultImpl> {
@@ -298,7 +298,7 @@
EvaluationResultImpl rightResult = node.rightOperand.accept(this);
TokenType operatorType = node.operator.type;
if (operatorType != TokenType.BANG_EQ && operatorType != TokenType.EQ_EQ) {
- if (leftResult is ValidResult && ((leftResult as ValidResult)).isNull || rightResult is ValidResult && ((rightResult as ValidResult)).isNull) {
+ if (leftResult is ValidResult && ((leftResult as ValidResult)).isNull() || rightResult is ValidResult && ((rightResult as ValidResult)).isNull()) {
return error(node, CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION);
}
}
@@ -350,7 +350,7 @@
EvaluationResultImpl visitDoubleLiteral(DoubleLiteral node) => new ValidResult(node.value);
EvaluationResultImpl visitInstanceCreationExpression(InstanceCreationExpression node) {
ConstructorElement constructor = node.element;
- if (constructor != null && constructor.isConst) {
+ if (constructor != null && constructor.isConst()) {
node.argumentList.accept(this);
return ValidResult.RESULT_OBJECT;
}
@@ -399,7 +399,7 @@
Element enclosingElement = function.enclosingElement;
if (enclosingElement is CompilationUnitElement) {
LibraryElement library = ((enclosingElement as CompilationUnitElement)).library;
- if (library.isDartCore) {
+ if (library.isDartCore()) {
EvaluationResultImpl leftArgument = arguments[0].accept(this);
EvaluationResultImpl rightArgument = arguments[1].accept(this);
return leftArgument.equalEqual(node, rightArgument);
@@ -416,7 +416,7 @@
EvaluationResultImpl visitPrefixedIdentifier(PrefixedIdentifier node) => getConstantValue(node, node.element);
EvaluationResultImpl visitPrefixExpression(PrefixExpression node) {
EvaluationResultImpl operand = node.operand.accept(this);
- if (operand is ValidResult && ((operand as ValidResult)).isNull) {
+ if (operand is ValidResult && ((operand as ValidResult)).isNull()) {
return error(node, CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION);
}
while (true) {
@@ -479,7 +479,7 @@
/**
* Return the union of the errors encoded in the given results.
- * @param leftResult the first set of errors, or `null` if there was no previous collection
+ * @param leftResult the first set of errors, or {@code null} if there was no previous collection
* of errors
* @param rightResult the errors to be added to the collection, or a valid result if there are no
* errors to be added
@@ -497,7 +497,7 @@
}
}
/**
- * Instances of the class `DirectedGraph` implement a directed graph in which the nodes are
+ * Instances of the class {@code DirectedGraph} implement a directed graph in which the nodes are
* arbitrary (client provided) objects and edges are represented implicitly. The graph will allow an
* edge from any node to any other node, including itself, but will not represent multiple edges
* between the same pair of nodes.
@@ -543,7 +543,7 @@
}
/**
- * Return a list of nodes that form a cycle, or `null` if there are no cycles in this graph.
+ * Return a list of nodes that form a cycle, or {@code null} if there are no cycles in this graph.
* @return a list of nodes that form a cycle
*/
List<N> findCycle() => null;
@@ -570,10 +570,10 @@
}
/**
- * Return `true` if this graph is empty.
- * @return `true` if this graph is empty
+ * Return {@code true} if this graph is empty.
+ * @return {@code true} if this graph is empty
*/
- bool get isEmpty => _edges.isEmpty;
+ bool isEmpty() => _edges.isEmpty;
/**
* Remove all of the given nodes from this graph. As a consequence, any edges for which those
@@ -592,7 +592,7 @@
* the same (neither node will either be added or removed).
* @param head the node at the head of the edge
* @param tail the node at the tail of the edge
- * @return `true` if the graph was modified as a result of this operation
+ * @return {@code true} if the graph was modified as a result of this operation
*/
void removeEdge(N head, N tail) {
Set<N> tails = _edges[head];
@@ -616,7 +616,7 @@
/**
* Find one node (referred to as a sink node) that has no outgoing edges (that is, for which there
* are no edges that have that node as the head of the edge) and remove it from this graph. Return
- * the node that was removed, or `null` if there are no such nodes either because the graph
+ * the node that was removed, or {@code null} if there are no such nodes either because the graph
* is empty or because every node in the graph has at least one outgoing edge. As a consequence of
* removing the node from the graph any edges for which that node was a tail will also be removed.
* @return the sink node that was removed
@@ -632,7 +632,7 @@
/**
* Return one node that has no outgoing edges (that is, for which there are no edges that have
- * that node as the head of the edge), or `null` if there are no such nodes.
+ * that node as the head of the edge), or {@code null} if there are no such nodes.
* @return a sink node
*/
N findSink() {
@@ -643,7 +643,7 @@
}
}
/**
- * Instances of the class `ErrorResult` represent the result of evaluating an expression that
+ * Instances of the class {@code ErrorResult} represent the result of evaluating an expression that
* is not a valid compile time constant.
*/
class ErrorResult extends EvaluationResultImpl {
@@ -687,7 +687,6 @@
EvaluationResultImpl concatenate(Expression node, EvaluationResultImpl rightOperand) => rightOperand.concatenateError(node, this);
EvaluationResultImpl divide(BinaryExpression node, EvaluationResultImpl rightOperand) => rightOperand.divideError(node, this);
EvaluationResultImpl equalEqual(Expression node, EvaluationResultImpl rightOperand) => rightOperand.equalEqualError(node, this);
- bool equalValues(EvaluationResultImpl result) => false;
List<ErrorResult_ErrorData> get errorData => _errors;
EvaluationResultImpl greaterThan(BinaryExpression node, EvaluationResultImpl rightOperand) => rightOperand.greaterThanError(node, this);
EvaluationResultImpl greaterThanOrEqual(BinaryExpression node, EvaluationResultImpl rightOperand) => rightOperand.greaterThanOrEqualError(node, this);
@@ -782,7 +781,7 @@
ASTNode get node => _node;
}
/**
- * Instances of the class `InternalResult` represent the result of attempting to evaluate a
+ * Instances of the class {@code InternalResult} represent the result of attempting to evaluate a
* expression.
*/
abstract class EvaluationResultImpl {
@@ -794,7 +793,6 @@
EvaluationResultImpl concatenate(Expression node, EvaluationResultImpl rightOperand);
EvaluationResultImpl divide(BinaryExpression node, EvaluationResultImpl rightOperand);
EvaluationResultImpl equalEqual(Expression node, EvaluationResultImpl rightOperand);
- bool equalValues(EvaluationResultImpl result);
EvaluationResultImpl greaterThan(BinaryExpression node, EvaluationResultImpl rightOperand);
EvaluationResultImpl greaterThanOrEqual(BinaryExpression node, EvaluationResultImpl rightOperand);
EvaluationResultImpl integerDivide(BinaryExpression node, EvaluationResultImpl rightOperand);
@@ -853,7 +851,7 @@
EvaluationResultImpl timesValid(BinaryExpression node, ValidResult leftOperand);
}
/**
- * Instances of the class `ReferenceFinder` add reference information for a given variable to
+ * Instances of the class {@code ReferenceFinder} add reference information for a given variable to
* the bi-directional mapping used to order the evaluation of constants.
*/
class ReferenceFinder extends RecursiveASTVisitor<Object> {
@@ -887,7 +885,7 @@
}
if (element is VariableElement) {
VariableElement variable = element as VariableElement;
- if (variable.isConst) {
+ if (variable.isConst()) {
_referenceGraph.addEdge(_source, variable);
}
}
@@ -895,7 +893,7 @@
}
}
/**
- * Instances of the class `ValidResult` represent the result of attempting to evaluate a valid
+ * Instances of the class {@code ValidResult} represent the result of attempting to evaluate a valid
* compile time constant expression.
*/
class ValidResult extends EvaluationResultImpl {
@@ -918,7 +916,7 @@
static ValidResult RESULT_INT = new ValidResult(null);
/**
- * A result object representing the `null` value.
+ * A result object representing the {@code null} value.
*/
static ValidResult RESULT_NULL = new ValidResult(null);
@@ -966,7 +964,7 @@
EvaluationResultImpl add(BinaryExpression node, EvaluationResultImpl rightOperand) => rightOperand.addToValid(node, this);
EvaluationResultImpl bitAnd(BinaryExpression node, EvaluationResultImpl rightOperand) => rightOperand.bitAndValid(node, this);
EvaluationResultImpl bitNot(Expression node) {
- if (isSomeInt) {
+ if (isSomeInt()) {
return RESULT_INT;
}
if (_value == null) {
@@ -981,7 +979,6 @@
EvaluationResultImpl concatenate(Expression node, EvaluationResultImpl rightOperand) => rightOperand.concatenateValid(node, this);
EvaluationResultImpl divide(BinaryExpression node, EvaluationResultImpl rightOperand) => rightOperand.divideValid(node, this);
EvaluationResultImpl equalEqual(Expression node, EvaluationResultImpl rightOperand) => rightOperand.equalEqualValid(node, this);
- bool equalValues(EvaluationResultImpl result) => identical(equalEqual(null, result), RESULT_TRUE);
Object get value => _value;
EvaluationResultImpl greaterThan(BinaryExpression node, EvaluationResultImpl rightOperand) => rightOperand.greaterThanValid(node, this);
EvaluationResultImpl greaterThanOrEqual(BinaryExpression node, EvaluationResultImpl rightOperand) => rightOperand.greaterThanOrEqualValid(node, this);
@@ -990,7 +987,7 @@
EvaluationResultImpl lessThanOrEqual(BinaryExpression node, EvaluationResultImpl rightOperand) => rightOperand.lessThanOrEqualValid(node, this);
EvaluationResultImpl logicalAnd(BinaryExpression node, EvaluationResultImpl rightOperand) => rightOperand.logicalAndValid(node, this);
EvaluationResultImpl logicalNot(Expression node) {
- if (isSomeBool) {
+ if (isSomeBool()) {
return RESULT_BOOL;
}
if (_value == null) {
@@ -1003,7 +1000,7 @@
EvaluationResultImpl logicalOr(BinaryExpression node, EvaluationResultImpl rightOperand) => rightOperand.logicalOrValid(node, this);
EvaluationResultImpl minus(BinaryExpression node, EvaluationResultImpl rightOperand) => rightOperand.minusValid(node, this);
EvaluationResultImpl negated(Expression node) {
- if (isSomeNum) {
+ if (isSomeNum()) {
return RESULT_INT;
}
if (_value == null) {
@@ -1042,8 +1039,8 @@
}
EvaluationResultImpl addToError(BinaryExpression node, ErrorResult leftOperand) => leftOperand;
EvaluationResultImpl addToValid(BinaryExpression node, ValidResult leftOperand2) {
- if (isSomeNum || leftOperand2.isSomeNum) {
- if (isAnyNum && leftOperand2.isAnyNum) {
+ if (isSomeNum() || leftOperand2.isSomeNum()) {
+ if (isAnyNum() && leftOperand2.isAnyNum()) {
return RESULT_NUM;
}
return error2(node, CompileTimeErrorCode.CONST_EVAL_TYPE_NUM);
@@ -1074,8 +1071,8 @@
}
EvaluationResultImpl bitAndError(BinaryExpression node, ErrorResult leftOperand) => leftOperand;
EvaluationResultImpl bitAndValid(BinaryExpression node, ValidResult leftOperand2) {
- if (isSomeInt || leftOperand2.isSomeInt) {
- if (isAnyInt && leftOperand2.isAnyInt) {
+ if (isSomeInt() || leftOperand2.isSomeInt()) {
+ if (isAnyInt() && leftOperand2.isAnyInt()) {
return RESULT_INT;
}
return error2(node, CompileTimeErrorCode.CONST_EVAL_TYPE_INT);
@@ -1098,8 +1095,8 @@
}
EvaluationResultImpl bitOrError(BinaryExpression node, ErrorResult leftOperand) => leftOperand;
EvaluationResultImpl bitOrValid(BinaryExpression node, ValidResult leftOperand2) {
- if (isSomeInt || leftOperand2.isSomeInt) {
- if (isAnyInt && leftOperand2.isAnyInt) {
+ if (isSomeInt() || leftOperand2.isSomeInt()) {
+ if (isAnyInt() && leftOperand2.isAnyInt()) {
return RESULT_INT;
}
return error2(node, CompileTimeErrorCode.CONST_EVAL_TYPE_INT);
@@ -1122,8 +1119,8 @@
}
EvaluationResultImpl bitXorError(BinaryExpression node, ErrorResult leftOperand) => leftOperand;
EvaluationResultImpl bitXorValid(BinaryExpression node, ValidResult leftOperand2) {
- if (isSomeInt || leftOperand2.isSomeInt) {
- if (isAnyInt && leftOperand2.isAnyInt) {
+ if (isSomeInt() || leftOperand2.isSomeInt()) {
+ if (isAnyInt() && leftOperand2.isAnyInt()) {
return RESULT_INT;
}
return error2(node, CompileTimeErrorCode.CONST_EVAL_TYPE_INT);
@@ -1154,8 +1151,8 @@
}
EvaluationResultImpl divideError(BinaryExpression node, ErrorResult leftOperand) => leftOperand;
EvaluationResultImpl divideValid(BinaryExpression node, ValidResult leftOperand2) {
- if (isSomeNum || leftOperand2.isSomeNum) {
- if (isAnyNum && leftOperand2.isAnyNum) {
+ if (isSomeNum() || leftOperand2.isSomeNum()) {
+ if (isAnyNum() && leftOperand2.isAnyNum()) {
return RESULT_NUM;
}
return error2(node, CompileTimeErrorCode.CONST_EVAL_TYPE_NUM);
@@ -1186,7 +1183,7 @@
EvaluationResultImpl equalEqualError(Expression node, ErrorResult leftOperand) => leftOperand;
EvaluationResultImpl equalEqualValid(Expression node, ValidResult leftOperand) {
if (node is BinaryExpression) {
- if (!isAnyNullBoolNumString || !leftOperand.isAnyNullBoolNumString) {
+ if (!isAnyNullBoolNumString() || !leftOperand.isAnyNullBoolNumString()) {
return error2(node, CompileTimeErrorCode.CONST_EVAL_TYPE_BOOL_NUM_STRING);
}
}
@@ -1223,8 +1220,8 @@
EvaluationResultImpl greaterThanError(BinaryExpression node, ErrorResult leftOperand) => leftOperand;
EvaluationResultImpl greaterThanOrEqualError(BinaryExpression node, ErrorResult leftOperand) => leftOperand;
EvaluationResultImpl greaterThanOrEqualValid(BinaryExpression node, ValidResult leftOperand2) {
- if (isSomeNum || leftOperand2.isSomeNum) {
- if (isAnyNum && leftOperand2.isAnyNum) {
+ if (isSomeNum() || leftOperand2.isSomeNum()) {
+ if (isAnyNum() && leftOperand2.isAnyNum()) {
return RESULT_BOOL;
}
return error2(node, CompileTimeErrorCode.CONST_EVAL_TYPE_NUM);
@@ -1250,8 +1247,8 @@
return error(node);
}
EvaluationResultImpl greaterThanValid(BinaryExpression node, ValidResult leftOperand2) {
- if (isSomeNum || leftOperand2.isSomeNum) {
- if (isAnyNum && leftOperand2.isAnyNum) {
+ if (isSomeNum() || leftOperand2.isSomeNum()) {
+ if (isAnyNum() && leftOperand2.isAnyNum()) {
return RESULT_BOOL;
}
return error2(node, CompileTimeErrorCode.CONST_EVAL_TYPE_NUM);
@@ -1278,8 +1275,8 @@
}
EvaluationResultImpl integerDivideError(BinaryExpression node, ErrorResult leftOperand) => leftOperand;
EvaluationResultImpl integerDivideValid(BinaryExpression node, ValidResult leftOperand2) {
- if (isSomeNum || leftOperand2.isSomeNum) {
- if (isAnyNum && leftOperand2.isAnyNum) {
+ if (isSomeNum() || leftOperand2.isSomeNum()) {
+ if (isAnyNum() && leftOperand2.isAnyNum()) {
return RESULT_INT;
}
return error2(node, CompileTimeErrorCode.CONST_EVAL_TYPE_NUM);
@@ -1313,8 +1310,8 @@
EvaluationResultImpl lessThanError(BinaryExpression node, ErrorResult leftOperand) => leftOperand;
EvaluationResultImpl lessThanOrEqualError(BinaryExpression node, ErrorResult leftOperand) => leftOperand;
EvaluationResultImpl lessThanOrEqualValid(BinaryExpression node, ValidResult leftOperand2) {
- if (isSomeNum || leftOperand2.isSomeNum) {
- if (isAnyNum && leftOperand2.isAnyNum) {
+ if (isSomeNum() || leftOperand2.isSomeNum()) {
+ if (isAnyNum() && leftOperand2.isAnyNum()) {
return RESULT_BOOL;
}
return error2(node, CompileTimeErrorCode.CONST_EVAL_TYPE_NUM);
@@ -1340,8 +1337,8 @@
return error(node);
}
EvaluationResultImpl lessThanValid(BinaryExpression node, ValidResult leftOperand2) {
- if (isSomeNum || leftOperand2.isSomeNum) {
- if (isAnyNum && leftOperand2.isAnyNum) {
+ if (isSomeNum() || leftOperand2.isSomeNum()) {
+ if (isAnyNum() && leftOperand2.isAnyNum()) {
return RESULT_BOOL;
}
return error2(node, CompileTimeErrorCode.CONST_EVAL_TYPE_NUM);
@@ -1368,8 +1365,8 @@
}
EvaluationResultImpl logicalAndError(BinaryExpression node, ErrorResult leftOperand) => leftOperand;
EvaluationResultImpl logicalAndValid(BinaryExpression node, ValidResult leftOperand) {
- if (isSomeBool || leftOperand.isSomeBool) {
- if (isAnyBool && leftOperand.isAnyBool) {
+ if (isSomeBool() || leftOperand.isSomeBool()) {
+ if (isAnyBool() && leftOperand.isAnyBool()) {
return RESULT_BOOL;
}
return error2(node, CompileTimeErrorCode.CONST_EVAL_TYPE_BOOL);
@@ -1385,8 +1382,8 @@
}
EvaluationResultImpl logicalOrError(BinaryExpression node, ErrorResult leftOperand) => leftOperand;
EvaluationResultImpl logicalOrValid(BinaryExpression node, ValidResult leftOperand) {
- if (isSomeBool || leftOperand.isSomeBool) {
- if (isAnyBool && leftOperand.isAnyBool) {
+ if (isSomeBool() || leftOperand.isSomeBool()) {
+ if (isAnyBool() && leftOperand.isAnyBool()) {
return RESULT_BOOL;
}
return error2(node, CompileTimeErrorCode.CONST_EVAL_TYPE_BOOL);
@@ -1399,8 +1396,8 @@
}
EvaluationResultImpl minusError(BinaryExpression node, ErrorResult leftOperand) => leftOperand;
EvaluationResultImpl minusValid(BinaryExpression node, ValidResult leftOperand2) {
- if (isSomeNum || leftOperand2.isSomeNum) {
- if (isAnyNum && leftOperand2.isAnyNum) {
+ if (isSomeNum() || leftOperand2.isSomeNum()) {
+ if (isAnyNum() && leftOperand2.isAnyNum()) {
return RESULT_NUM;
}
return error2(node, CompileTimeErrorCode.CONST_EVAL_TYPE_NUM);
@@ -1427,7 +1424,7 @@
}
EvaluationResultImpl notEqualError(BinaryExpression node, ErrorResult leftOperand) => leftOperand;
EvaluationResultImpl notEqualValid(BinaryExpression node, ValidResult leftOperand) {
- if (!isAnyNullBoolNumString || !leftOperand.isAnyNullBoolNumString) {
+ if (!isAnyNullBoolNumString() || !leftOperand.isAnyNullBoolNumString()) {
return error2(node, CompileTimeErrorCode.CONST_EVAL_TYPE_BOOL_NUM_STRING);
}
Object leftValue = leftOperand.value;
@@ -1462,8 +1459,8 @@
}
EvaluationResultImpl remainderError(BinaryExpression node, ErrorResult leftOperand) => leftOperand;
EvaluationResultImpl remainderValid(BinaryExpression node, ValidResult leftOperand2) {
- if (isSomeNum || leftOperand2.isSomeNum) {
- if (isAnyNum && leftOperand2.isAnyNum) {
+ if (isSomeNum() || leftOperand2.isSomeNum()) {
+ if (isAnyNum() && leftOperand2.isAnyNum()) {
return RESULT_NUM;
}
return error2(node, CompileTimeErrorCode.CONST_EVAL_TYPE_NUM);
@@ -1493,8 +1490,8 @@
}
EvaluationResultImpl shiftLeftError(BinaryExpression node, ErrorResult leftOperand) => leftOperand;
EvaluationResultImpl shiftLeftValid(BinaryExpression node, ValidResult leftOperand2) {
- if (isSomeInt || leftOperand2.isSomeInt) {
- if (isAnyInt && leftOperand2.isAnyInt) {
+ if (isSomeInt() || leftOperand2.isSomeInt()) {
+ if (isAnyInt() && leftOperand2.isAnyInt()) {
return RESULT_INT;
}
return error2(node, CompileTimeErrorCode.CONST_EVAL_TYPE_INT);
@@ -1517,8 +1514,8 @@
}
EvaluationResultImpl shiftRightError(BinaryExpression node, ErrorResult leftOperand) => leftOperand;
EvaluationResultImpl shiftRightValid(BinaryExpression node, ValidResult leftOperand2) {
- if (isSomeInt || leftOperand2.isSomeInt) {
- if (isAnyInt && leftOperand2.isAnyInt) {
+ if (isSomeInt() || leftOperand2.isSomeInt()) {
+ if (isAnyInt() && leftOperand2.isAnyInt()) {
return RESULT_INT;
}
return error2(node, CompileTimeErrorCode.CONST_EVAL_TYPE_INT);
@@ -1541,8 +1538,8 @@
}
EvaluationResultImpl timesError(BinaryExpression node, ErrorResult leftOperand) => leftOperand;
EvaluationResultImpl timesValid(BinaryExpression node, ValidResult leftOperand2) {
- if (isSomeNum || leftOperand2.isSomeNum) {
- if (isAnyNum && leftOperand2.isAnyNum) {
+ if (isSomeNum() || leftOperand2.isSomeNum()) {
+ if (isAnyNum() && leftOperand2.isAnyNum()) {
return RESULT_NUM;
}
return error2(node, CompileTimeErrorCode.CONST_EVAL_TYPE_NUM);
@@ -1567,7 +1564,7 @@
}
return error(node);
}
- bool get isNull => identical(this, RESULT_NULL);
+ bool isNull() => identical(this, RESULT_NULL);
/**
* Return the result of applying boolean conversion to the given value.
@@ -1598,37 +1595,37 @@
/**
* Checks if this result has type "bool", with known or unknown value.
*/
- bool get isAnyBool => isSomeBool || identical(this, RESULT_TRUE) || identical(this, RESULT_FALSE);
+ bool isAnyBool() => isSomeBool() || identical(this, RESULT_TRUE) || identical(this, RESULT_FALSE);
/**
* Checks if this result has type "int", with known or unknown value.
*/
- bool get isAnyInt => identical(this, RESULT_INT) || _value is int;
+ bool isAnyInt() => identical(this, RESULT_INT) || _value is int;
/**
- * Checks if this result has one of the types - "bool", "num" or "string"; or may be `null`.
+ * Checks if this result has one of the types - "bool", "num" or "string"; or may be {@code null}.
*/
- bool get isAnyNullBoolNumString => isNull || isAnyBool || isAnyNum || _value is String;
+ bool isAnyNullBoolNumString() => isNull() || isAnyBool() || isAnyNum() || _value is String;
/**
* Checks if this result has type "num", with known or unknown value.
*/
- bool get isAnyNum => isSomeNum || _value is num;
+ bool isAnyNum() => isSomeNum() || _value is num;
/**
* Checks if this result has type "bool", exact value of which we don't know.
*/
- bool get isSomeBool => identical(this, RESULT_BOOL);
+ bool isSomeBool() => identical(this, RESULT_BOOL);
/**
* Checks if this result has type "int", exact value of which we don't know.
*/
- bool get isSomeInt => identical(this, RESULT_INT);
+ bool isSomeInt() => identical(this, RESULT_INT);
/**
* Checks if this result has type "num" (or "int"), exact value of which we don't know.
*/
- bool get isSomeNum => identical(this, RESULT_DYNAMIC) || identical(this, RESULT_INT) || identical(this, RESULT_NUM);
+ bool isSomeNum() => identical(this, RESULT_DYNAMIC) || identical(this, RESULT_INT) || identical(this, RESULT_NUM);
double toDouble(int value) => value.toDouble();
/**
diff --git a/pkg/analyzer_experimental/lib/src/generated/element.dart b/pkg/analyzer_experimental/lib/src/generated/element.dart
index af56601..5cc4a23 100644
--- a/pkg/analyzer_experimental/lib/src/generated/element.dart
+++ b/pkg/analyzer_experimental/lib/src/generated/element.dart
@@ -13,7 +13,7 @@
import 'constant.dart' show EvaluationResultImpl;
import 'utilities_dart.dart';
/**
- * The interface `ClassElement` defines the behavior of elements that represent a class.
+ * The interface {@code ClassElement} defines the behavior of elements that represent a class.
* @coverage dart.engine.element
*/
abstract class ClassElement implements Element {
@@ -45,7 +45,7 @@
/**
* Return the element representing the getter with the given name that is declared in this class,
- * or `null` if this class does not declare a getter with the given name.
+ * or {@code null} if this class does not declare a getter with the given name.
* @param getterName the name of the getter to be returned
* @return the getter declared in this class with the given name
*/
@@ -53,7 +53,7 @@
/**
* Return an array containing all of the interfaces that are implemented by this class.
- *
+ * <p>
* <b>Note:</b> Because the element model represents the state of the code, it is possible for it
* to be semantically invalid. In particular, it is not safe to assume that the inheritance
* structure of a class does not contain a cycle. Clients that traverse the inheritance structure
@@ -64,7 +64,7 @@
/**
* Return the element representing the method with the given name that is declared in this class,
- * or `null` if this class does not declare a method with the given name.
+ * or {@code null} if this class does not declare a method with the given name.
* @param methodName the name of the method to be returned
* @return the method declared in this class with the given name
*/
@@ -79,7 +79,7 @@
/**
* Return an array containing all of the mixins that are applied to the class being extended in
* order to derive the superclass of this class.
- *
+ * <p>
* <b>Note:</b> Because the element model represents the state of the code, it is possible for it
* to be semantically invalid. In particular, it is not safe to assume that the inheritance
* structure of a class does not contain a cycle. Clients that traverse the inheritance structure
@@ -89,7 +89,7 @@
List<InterfaceType> get mixins;
/**
- * Return the named constructor declared in this class with the given name, or `null` if
+ * Return the named constructor declared in this class with the given name, or {@code null} if
* this class does not declare a named constructor with the given name.
* @param name the name of the constructor to be returned
* @return the element representing the specified constructor
@@ -98,17 +98,17 @@
/**
* Return the element representing the setter with the given name that is declared in this class,
- * or `null` if this class does not declare a setter with the given name.
+ * or {@code null} if this class does not declare a setter with the given name.
* @param setterName the name of the getter to be returned
* @return the setter declared in this class with the given name
*/
PropertyAccessorElement getSetter(String setterName);
/**
- * Return the superclass of this class, or `null` if the class represents the class
- * 'Object'. All other classes will have a non-`null` superclass. If the superclass was not
+ * Return the superclass of this class, or {@code null} if the class represents the class
+ * 'Object'. All other classes will have a non-{@code null} superclass. If the superclass was not
* explicitly declared then the implicit superclass 'Object' will be returned.
- *
+ * <p>
* <b>Note:</b> Because the element model represents the state of the code, it is possible for it
* to be semantically invalid. In particular, it is not safe to assume that the inheritance
* structure of a class does not contain a cycle. Clients that traverse the inheritance structure
@@ -130,7 +130,7 @@
List<TypeVariableElement> get typeVariables;
/**
- * Return the unnamed constructor declared in this class, or `null` if this class does not
+ * Return the unnamed constructor declared in this class, or {@code null} if this class does not
* declare an unnamed constructor but does declare named constructors. The returned constructor
* will be synthetic if this class does not declare any constructors, in which case it will
* represent the default constructor for the class.
@@ -139,61 +139,55 @@
ConstructorElement get unnamedConstructor;
/**
- * Return `true` if this class has (implicit or explicit) default constructor.
- * @return `true` if this class has (implicit or explicit) default constructor
- */
- bool hasDefaultConstructor();
-
- /**
- * Return `true` if this class or its superclass declares a non-final instance field.
- * @return `true` if this class or its superclass declares a non-final instance field
+ * Return {@code true} if this class or its superclass declares a non-final instance field.
+ * @return {@code true} if this class or its superclass declares a non-final instance field
*/
bool hasNonFinalField();
/**
- * Return `true` if this class has reference to super (so, for example, cannot be used as a
+ * Return {@code true} if this class has reference to super (so, for example, cannot be used as a
* mixin).
- * @return `true` if this class has reference to super
+ * @return {@code true} if this class has reference to super
*/
bool hasReferenceToSuper();
/**
- * Return `true` if this class is abstract. A class is abstract if it has an explicit`abstract` modifier. Note, that this definition of <i>abstract</i> is different from
+ * Return {@code true} if this class is abstract. A class is abstract if it has an explicit{@code abstract} modifier. Note, that this definition of <i>abstract</i> is different from
* <i>has unimplemented members</i>.
- * @return `true` if this class is abstract
+ * @return {@code true} if this class is abstract
*/
- bool get isAbstract;
+ bool isAbstract();
/**
- * Return `true` if this class is defined by a typedef construct.
- * @return `true` if this class is defined by a typedef construct
+ * Return {@code true} if this class is defined by a typedef construct.
+ * @return {@code true} if this class is defined by a typedef construct
*/
- bool get isTypedef;
+ bool isTypedef();
/**
- * Return `true` if this class can validly be used as a mixin when defining another class.
+ * Return {@code true} if this class can validly be used as a mixin when defining another class.
* The behavior of this method is defined by the Dart Language Specification in section 9:
* <blockquote>It is a compile-time error if a declared or derived mixin refers to super. It is a
* compile-time error if a declared or derived mixin explicitly declares a constructor. It is a
* compile-time error if a mixin is derived from a class whose superclass is not
* Object.</blockquote>
- * @return `true` if this class can validly be used as a mixin
+ * @return {@code true} if this class can validly be used as a mixin
*/
- bool get isValidMixin;
+ bool isValidMixin();
/**
* Return the element representing the getter that results from looking up the given getter in
- * this class with respect to the given library, or `null` if the look up fails. The
+ * this class with respect to the given library, or {@code null} if the look up fails. The
* behavior of this method is defined by the Dart Language Specification in section 12.15.1:
* <blockquote>The result of looking up getter (respectively setter) <i>m</i> in class <i>C</i>
* with respect to library <i>L</i> is:
- *
- * * If <i>C</i> declares an instance getter (respectively setter) named <i>m</i> that is
+ * <ul>
+ * <li>If <i>C</i> declares an instance getter (respectively setter) named <i>m</i> that is
* accessible to <i>L</i>, then that getter (respectively setter) is the result of the lookup.
* Otherwise, if <i>C</i> has a superclass <i>S</i>, then the result of the lookup is the result
* of looking up getter (respectively setter) <i>m</i> in <i>S</i> with respect to <i>L</i>.
- * Otherwise, we say that the lookup has failed.
- *
+ * Otherwise, we say that the lookup has failed.</li>
+ * </ul>
* </blockquote>
* @param getterName the name of the getter being looked up
* @param library the library with respect to which the lookup is being performed
@@ -204,16 +198,16 @@
/**
* Return the element representing the method that results from looking up the given method in
- * this class with respect to the given library, or `null` if the look up fails. The
+ * this class with respect to the given library, or {@code null} if the look up fails. The
* behavior of this method is defined by the Dart Language Specification in section 12.15.1:
* <blockquote> The result of looking up method <i>m</i> in class <i>C</i> with respect to library
* <i>L</i> is:
- *
- * * If <i>C</i> declares an instance method named <i>m</i> that is accessible to <i>L</i>, then
+ * <ul>
+ * <li>If <i>C</i> declares an instance method named <i>m</i> that is accessible to <i>L</i>, then
* that method is the result of the lookup. Otherwise, if <i>C</i> has a superclass <i>S</i>, then
* the result of the lookup is the result of looking up method <i>m</i> in <i>S</i> with respect
- * to <i>L</i>. Otherwise, we say that the lookup has failed.
- *
+ * to <i>L</i>. Otherwise, we say that the lookup has failed.</li>
+ * </ul>
* </blockquote>
* @param methodName the name of the method being looked up
* @param library the library with respect to which the lookup is being performed
@@ -224,17 +218,17 @@
/**
* Return the element representing the setter that results from looking up the given setter in
- * this class with respect to the given library, or `null` if the look up fails. The
+ * this class with respect to the given library, or {@code null} if the look up fails. The
* behavior of this method is defined by the Dart Language Specification in section 12.16:
* <blockquote> The result of looking up getter (respectively setter) <i>m</i> in class <i>C</i>
* with respect to library <i>L</i> is:
- *
- * * If <i>C</i> declares an instance getter (respectively setter) named <i>m</i> that is
+ * <ul>
+ * <li>If <i>C</i> declares an instance getter (respectively setter) named <i>m</i> that is
* accessible to <i>L</i>, then that getter (respectively setter) is the result of the lookup.
* Otherwise, if <i>C</i> has a superclass <i>S</i>, then the result of the lookup is the result
* of looking up getter (respectively setter) <i>m</i> in <i>S</i> with respect to <i>L</i>.
- * Otherwise, we say that the lookup has failed.
- *
+ * Otherwise, we say that the lookup has failed.</li>
+ * </ul>
* </blockquote>
* @param setterName the name of the setter being looked up
* @param library the library with respect to which the lookup is being performed
@@ -244,8 +238,8 @@
PropertyAccessorElement lookUpSetter(String setterName, LibraryElement library);
}
/**
- * The interface `ClassMemberElement` defines the behavior of elements that are contained
- * within a [ClassElement].
+ * The interface {@code ClassMemberElement} defines the behavior of elements that are contained
+ * within a {@link ClassElement}.
*/
abstract class ClassMemberElement implements Element {
@@ -256,7 +250,7 @@
ClassElement get enclosingElement;
}
/**
- * The interface `CompilationUnitElement` defines the behavior of elements representing a
+ * The interface {@code CompilationUnitElement} defines the behavior of elements representing a
* compilation unit.
* @coverage dart.engine.element
*/
@@ -294,7 +288,7 @@
List<TopLevelVariableElement> get topLevelVariables;
/**
- * Return the class defined in this compilation unit that has the given name, or `null` if
+ * Return the class defined in this compilation unit that has the given name, or {@code null} if
* this compilation unit does not define a class with the given name.
* @param className the name of the class to be returned
* @return the class with the given name that is defined in this compilation unit
@@ -308,7 +302,7 @@
List<ClassElement> get types;
}
/**
- * The interface `ConstructorElement` defines the behavior of elements representing a
+ * The interface {@code ConstructorElement} defines the behavior of elements representing a
* constructor or a factory method defined within a type.
* @coverage dart.engine.element
*/
@@ -321,40 +315,33 @@
ConstructorElement get redirectedConstructor;
/**
- * Return `true` if this constructor is a const constructor.
- * @return `true` if this constructor is a const constructor
+ * Return {@code true} if this constructor is a const constructor.
+ * @return {@code true} if this constructor is a const constructor
*/
- bool get isConst;
+ bool isConst();
/**
- * Return `true` if this constructor can be used as a default constructor - unnamed and has
- * no required parameters.
- * @return `true` if this constructor can be used as a default constructor.
+ * Return {@code true} if this constructor represents a factory constructor.
+ * @return {@code true} if this constructor represents a factory constructor
*/
- bool get isDefaultConstructor;
-
- /**
- * Return `true` if this constructor represents a factory constructor.
- * @return `true` if this constructor represents a factory constructor
- */
- bool get isFactory;
+ bool isFactory();
}
/**
- * The interface `Element` defines the behavior common to all of the elements in the element
+ * The interface {@code Element} defines the behavior common to all of the elements in the element
* model. Generally speaking, the element model is a semantic model of the program that represents
* things that are declared with a name and hence can be referenced elsewhere in the code.
- *
+ * <p>
* There are two exceptions to the general case. First, there are elements in the element model that
* are created for the convenience of various kinds of analysis but that do not have any
* corresponding declaration within the source code. Such elements are marked as being
* <i>synthetic</i>. Examples of synthetic elements include
- *
- * * default constructors in classes that do not define any explicit constructors,
- * * getters and setters that are induced by explicit field declarations,
- * * fields that are induced by explicit declarations of getters and setters, and
- * * functions representing the initialization expression for a variable.
- *
- *
+ * <ul>
+ * <li>default constructors in classes that do not define any explicit constructors,
+ * <li>getters and setters that are induced by explicit field declarations,
+ * <li>fields that are induced by explicit declarations of getters and setters, and
+ * <li>functions representing the initialization expression for a variable.
+ * </ul>
+ * <p>
* Second, there are elements in the element model that do not have a name. These correspond to
* unnamed functions and exist in order to more accurately represent the semantic structure of the
* program.
@@ -377,7 +364,7 @@
/**
* Return the documentation comment for this element as it appears in the original source
- * (complete with the beginning and ending delimiters), or `null` if this element does not
+ * (complete with the beginning and ending delimiters), or {@code null} if this element does not
* have a documentation comment associated with it. This can be a long-running operation if the
* information needed to access the comment is not cached.
* @return this element's documentation comment
@@ -387,7 +374,7 @@
String computeDocumentationComment();
/**
- * Return the element of the given class that most immediately encloses this element, or`null` if there is no enclosing element of the given class.
+ * Return the element of the given class that most immediately encloses this element, or{@code null} if there is no enclosing element of the given class.
* @param elementClass the class of the element to be returned
* @return the element that encloses this element
*/
@@ -400,16 +387,16 @@
AnalysisContext get context;
/**
- * Return the display name of this element, or `null` if this element does not have a name.
- *
+ * Return the display name of this element, or {@code null} if this element does not have a name.
+ * <p>
* In most cases the name and the display name are the same. Differences though are cases such as
- * setters where the name of some setter `set f(x)` is `f=`, instead of `f`.
+ * setters where the name of some setter {@code set f(x)} is {@code f=}, instead of {@code f}.
* @return the display name of this element
*/
String get displayName;
/**
- * Return the element that either physically or logically encloses this element. This will be`null` if this element is a library because libraries are the top-level elements in the
+ * Return the element that either physically or logically encloses this element. This will be{@code null} if this element is a library because libraries are the top-level elements in the
* model.
* @return the element that encloses this element
*/
@@ -423,7 +410,7 @@
/**
* Return the library that contains this element. This will be the element itself if it is a
- * library element. This will be `null` if this element is an HTML file because HTML files
+ * library element. This will be {@code null} if this element is an HTML file because HTML files
* are not contained in libraries.
* @return the library that contains this element
*/
@@ -443,43 +430,43 @@
List<ElementAnnotation> get metadata;
/**
- * Return the name of this element, or `null` if this element does not have a name.
+ * Return the name of this element, or {@code null} if this element does not have a name.
* @return the name of this element
*/
String get name;
/**
* Return the offset of the name of this element in the file that contains the declaration of this
- * element, or `-1` if this element is synthetic, does not have a name, or otherwise does
+ * element, or {@code -1} if this element is synthetic, does not have a name, or otherwise does
* not have an offset.
* @return the offset of the name of this element
*/
int get nameOffset;
/**
- * Return the source that contains this element, or `null` if this element is not contained
+ * Return the source that contains this element, or {@code null} if this element is not contained
* in a source.
* @return the source that contains this element
*/
Source get source;
/**
- * Return `true` if this element, assuming that it is within scope, is accessible to code in
+ * Return {@code true} if this element, assuming that it is within scope, is accessible to code in
* the given library. This is defined by the Dart Language Specification in section 3.2:
* <blockquote> A declaration <i>m</i> is accessible to library <i>L</i> if <i>m</i> is declared
* in <i>L</i> or if <i>m</i> is public. </blockquote>
* @param library the library in which a possible reference to this element would occur
- * @return `true` if this element is accessible to code in the given library
+ * @return {@code true} if this element is accessible to code in the given library
*/
bool isAccessibleIn(LibraryElement library);
/**
- * Return `true` if this element is synthetic. A synthetic element is an element that is not
+ * Return {@code true} if this element is synthetic. A synthetic element is an element that is not
* represented in the source code explicitly, but is implied by the source code, such as the
* default constructor for a class that does not explicitly define any constructors.
- * @return `true` if this element is synthetic
+ * @return {@code true} if this element is synthetic
*/
- bool get isSynthetic;
+ bool isSynthetic();
/**
* Use the given visitor to visit all of the children of this element. There is no guarantee of
@@ -489,7 +476,7 @@
void visitChildren(ElementVisitor<Object> visitor);
}
/**
- * The interface `ElementAnnotation` defines the behavior of objects representing a single
+ * The interface {@code ElementAnnotation} defines the behavior of objects representing a single
* annotation associated with an element.
* @coverage dart.engine.element
*/
@@ -503,7 +490,7 @@
Element get element;
}
/**
- * The enumeration `ElementKind` defines the various kinds of elements in the element model.
+ * The enumeration {@code ElementKind} defines the various kinds of elements in the element model.
* @coverage dart.engine.element
*/
class ElementKind implements Comparable<ElementKind> {
@@ -541,7 +528,7 @@
final int ordinal;
/**
- * Return the kind of the given element, or [ERROR] if the element is `null`. This is
+ * Return the kind of the given element, or {@link #ERROR} if the element is {@code null}. This is
* a utility method that can reduce the need for null checks in other places.
* @param element the element whose kind is to be returned
* @return the kind of the given element
@@ -568,7 +555,7 @@
/**
* Return the name displayed in the UI for this kind of element.
- * @return the name of this [ElementKind] to display in UI.
+ * @return the name of this {@link ElementKind} to display in UI.
*/
String get displayName => _displayName;
int compareTo(ElementKind other) => ordinal - other.ordinal;
@@ -576,7 +563,7 @@
String toString() => name;
}
/**
- * The interface `ElementLocation` defines the behavior of objects that represent the location
+ * The interface {@code ElementLocation} defines the behavior of objects that represent the location
* of an element within the element model.
* @coverage dart.engine.element
*/
@@ -590,7 +577,7 @@
String get encoding;
}
/**
- * The interface `ElementVisitor` defines the behavior of objects that can be used to visit an
+ * The interface {@code ElementVisitor} defines the behavior of objects that can be used to visit an
* element structure.
* @coverage dart.engine.element
*/
@@ -619,7 +606,7 @@
R visitTypeVariableElement(TypeVariableElement element);
}
/**
- * The interface `EmbeddedHtmlScriptElement` defines the behavior of elements representing a
+ * The interface {@code EmbeddedHtmlScriptElement} defines the behavior of elements representing a
* script tag in an HTML file having content that defines a Dart library.
* @coverage dart.engine.element
*/
@@ -627,12 +614,12 @@
/**
* Return the library element defined by the content of the script tag.
- * @return the library element (not `null`)
+ * @return the library element (not {@code null})
*/
LibraryElement get scriptLibrary;
}
/**
- * The interface `ExecutableElement` defines the behavior of elements representing an
+ * The interface {@code ExecutableElement} defines the behavior of elements representing an
* executable object, including functions, methods, constructors, getters, and setters.
* @coverage dart.engine.element
*/
@@ -663,34 +650,28 @@
List<ParameterElement> get parameters;
/**
- * Return the return type defined by this executable element.
- * @return the return type defined by this executable element
- */
- Type2 get returnType;
-
- /**
* Return the type of function defined by this executable element.
* @return the type of function defined by this executable element
*/
FunctionType get type;
/**
- * Return `true` if this executable element is an operator. The test may be based on the
+ * Return {@code true} if this executable element is an operator. The test may be based on the
* name of the executable element, in which case the result will be correct when the name is
* legal.
- * @return `true` if this executable element is an operator
+ * @return {@code true} if this executable element is an operator
*/
- bool get isOperator;
+ bool isOperator();
/**
- * Return `true` if this element is a static element. A static element is an element that is
+ * Return {@code true} if this element is a static element. A static element is an element that is
* not associated with a particular instance, but rather with an entire library or class.
- * @return `true` if this executable element is a static element
+ * @return {@code true} if this executable element is a static element
*/
- bool get isStatic;
+ bool isStatic();
}
/**
- * The interface `ExportElement` defines the behavior of objects representing information
+ * The interface {@code ExportElement} defines the behavior of objects representing information
* about a single export directive within a library.
* @coverage dart.engine.element
*/
@@ -715,49 +696,49 @@
LibraryElement get exportedLibrary;
}
/**
- * The interface `ExternalHtmlScriptElement` defines the behavior of elements representing a
- * script tag in an HTML file having a `source` attribute that references a Dart library
+ * The interface {@code ExternalHtmlScriptElement} defines the behavior of elements representing a
+ * script tag in an HTML file having a {@code source} attribute that references a Dart library
* source file.
* @coverage dart.engine.element
*/
abstract class ExternalHtmlScriptElement implements HtmlScriptElement {
/**
- * Return the source referenced by this element, or `null` if this element does not
+ * Return the source referenced by this element, or {@code null} if this element does not
* reference a Dart library source file.
* @return the source for the external Dart library
*/
Source get scriptSource;
}
/**
- * The interface `FieldElement` defines the behavior of elements representing a field defined
+ * The interface {@code FieldElement} defines the behavior of elements representing a field defined
* within a type.
* @coverage dart.engine.element
*/
abstract class FieldElement implements ClassMemberElement, PropertyInducingElement {
}
/**
- * The interface `FieldFormalParameterElement` defines the behavior of elements representing a
+ * The interface {@code FieldFormalParameterElement} defines the behavior of elements representing a
* field formal parameter defined within a constructor element.
*/
abstract class FieldFormalParameterElement implements ParameterElement {
/**
- * Return the field element associated with this field formal parameter, or `null` if the
+ * Return the field element associated with this field formal parameter, or {@code null} if the
* parameter references a field that doesn't exist.
* @return the field element associated with this field formal parameter
*/
FieldElement get field;
}
/**
- * The interface `FunctionElement` defines the behavior of elements representing a function.
+ * The interface {@code FunctionElement} defines the behavior of elements representing a function.
* @coverage dart.engine.element
*/
abstract class FunctionElement implements ExecutableElement, LocalElement {
}
/**
- * The interface `FunctionTypeAliasElement` defines the behavior of elements representing a
- * function type alias (`typedef`).
+ * The interface {@code FunctionTypeAliasElement} defines the behavior of elements representing a
+ * function type alias ({@code typedef}).
* @coverage dart.engine.element
*/
abstract class FunctionTypeAliasElement implements Element {
@@ -775,12 +756,6 @@
List<ParameterElement> get parameters;
/**
- * Return the return type defined by this type alias.
- * @return the return type defined by this type alias
- */
- Type2 get returnType;
-
- /**
* Return the type of function defined by this type alias.
* @return the type of function defined by this type alias
*/
@@ -793,7 +768,7 @@
List<TypeVariableElement> get typeVariables;
}
/**
- * The interface `HideElementCombinator` defines the behavior of combinators that cause some
+ * The interface {@code HideElementCombinator} defines the behavior of combinators that cause some
* of the names in a namespace to be hidden when being imported.
* @coverage dart.engine.element
*/
@@ -807,7 +782,7 @@
List<String> get hiddenNames;
}
/**
- * The interface `HtmlElement` defines the behavior of elements representing an HTML file.
+ * The interface {@code HtmlElement} defines the behavior of elements representing an HTML file.
* @coverage dart.engine.element
*/
abstract class HtmlElement implements Element {
@@ -816,12 +791,12 @@
* Return an array containing all of the script elements contained in the HTML file. This includes
* scripts with libraries that are defined by the content of a script tag as well as libraries
* that are referenced in the {@core source} attribute of a script tag.
- * @return the script elements in the HTML file (not `null`, contains no `null`s)
+ * @return the script elements in the HTML file (not {@code null}, contains no {@code null}s)
*/
List<HtmlScriptElement> get scripts;
}
/**
- * The interface `HtmlScriptElement` defines the behavior of elements representing a script
+ * The interface {@code HtmlScriptElement} defines the behavior of elements representing a script
* tag in an HTML file.
* @see EmbeddedHtmlScriptElement
* @see ExternalHtmlScriptElement
@@ -830,7 +805,7 @@
abstract class HtmlScriptElement implements Element {
}
/**
- * The interface `ImportElement` defines the behavior of objects representing information
+ * The interface {@code ImportElement} defines the behavior of objects representing information
* about a single import directive within a library.
* @coverage dart.engine.element
*/
@@ -855,14 +830,14 @@
LibraryElement get importedLibrary;
/**
- * Return the prefix that was specified as part of the import directive, or `null` if there
+ * Return the prefix that was specified as part of the import directive, or {@code null} if there
* was no prefix specified.
* @return the prefix that was specified as part of the import directive
*/
PrefixElement get prefix;
}
/**
- * The interface `LabelElement` defines the behavior of elements representing a label
+ * The interface {@code LabelElement} defines the behavior of elements representing a label
* associated with a statement.
* @coverage dart.engine.element
*/
@@ -875,7 +850,7 @@
ExecutableElement get enclosingElement;
}
/**
- * The interface `LibraryElement` defines the behavior of elements representing a library.
+ * The interface {@code LibraryElement} defines the behavior of elements representing a library.
* @coverage dart.engine.element
*/
abstract class LibraryElement implements Element {
@@ -887,8 +862,8 @@
CompilationUnitElement get definingCompilationUnit;
/**
- * Return the entry point for this library, or `null` if this library does not have an entry
- * point. The entry point is defined to be a zero argument top-level function whose name is`main`.
+ * Return the entry point for this library, or {@code null} if this library does not have an entry
+ * point. The entry point is defined to be a zero argument top-level function whose name is{@code main}.
* @return the entry point for this library
*/
FunctionElement get entryPoint;
@@ -908,7 +883,7 @@
/**
* Return an array containing all of the libraries that are imported into this library. This
* includes all of the libraries that are imported using a prefix (also available through the
- * prefixes returned by [getPrefixes]) and those that are imported without a prefix.
+ * prefixes returned by {@link #getPrefixes()}) and those that are imported without a prefix.
* @return an array containing all of the libraries that are imported into this library
*/
List<LibraryElement> get importedLibraries;
@@ -921,20 +896,20 @@
/**
* Return an array containing all of the compilation units that are included in this library using
- * a `part` directive. This does not include the defining compilation unit that contains the`part` directives.
+ * a {@code part} directive. This does not include the defining compilation unit that contains the{@code part} directives.
* @return the compilation units that are included in this library
*/
List<CompilationUnitElement> get parts;
/**
- * Return an array containing elements for each of the prefixes used to `import` libraries
- * into this library. Each prefix can be used in more than one `import` directive.
- * @return the prefixes used to `import` libraries into this library
+ * Return an array containing elements for each of the prefixes used to {@code import} libraries
+ * into this library. Each prefix can be used in more than one {@code import} directive.
+ * @return the prefixes used to {@code import} libraries into this library
*/
List<PrefixElement> get prefixes;
/**
- * Return the class defined in this library that has the given name, or `null` if this
+ * Return the class defined in this library that has the given name, or {@code null} if this
* library does not define a class with the given name.
* @param className the name of the class to be returned
* @return the class with the given name that is defined in this library
@@ -942,73 +917,73 @@
ClassElement getType(String className);
/**
- * Answer `true` if this library is an application that can be run in the browser.
- * @return `true` if this library is an application that can be run in the browser
+ * Answer {@code true} if this library is an application that can be run in the browser.
+ * @return {@code true} if this library is an application that can be run in the browser
*/
- bool get isBrowserApplication;
+ bool isBrowserApplication();
/**
- * Return `true` if this library is the dart:core library.
- * @return `true` if this library is the dart:core library
+ * Return {@code true} if this library is the dart:core library.
+ * @return {@code true} if this library is the dart:core library
*/
- bool get isDartCore;
+ bool isDartCore();
/**
- * Return `true` if this library is up to date with respect to the given time stamp. If any
+ * Return {@code true} if this library is up to date with respect to the given time stamp. If any
* transitively referenced Source is newer than the time stamp, this method returns false.
* @param timeStamp the time stamp to compare against
- * @return `true` if this library is up to date with respect to the given time stamp
+ * @return {@code true} if this library is up to date with respect to the given time stamp
*/
bool isUpToDate2(int timeStamp);
}
/**
- * The interface `LocalElement` defines the behavior of elements that can be (but are not
- * required to be) defined within a method or function (an [ExecutableElement]).
+ * The interface {@code LocalElement} defines the behavior of elements that can be (but are not
+ * required to be) defined within a method or function (an {@link ExecutableElement}).
* @coverage dart.engine.element
*/
abstract class LocalElement implements Element {
/**
* Return a source range that covers the approximate portion of the source in which the name of
- * this element is visible, or `null` if there is no single range of characters within which
+ * this element is visible, or {@code null} if there is no single range of characters within which
* the element name is visible.
- *
- * * For a local variable, this includes everything from the end of the variable's initializer
- * to the end of the block that encloses the variable declaration.
- * * For a parameter, this includes the body of the method or function that declares the
- * parameter.
- * * For a local function, this includes everything from the beginning of the function's body to
- * the end of the block that encloses the function declaration.
- * * For top-level functions, `null` will be returned because they are potentially visible
- * in multiple sources.
- *
+ * <ul>
+ * <li>For a local variable, this includes everything from the end of the variable's initializer
+ * to the end of the block that encloses the variable declaration.</li>
+ * <li>For a parameter, this includes the body of the method or function that declares the
+ * parameter.</li>
+ * <li>For a local function, this includes everything from the beginning of the function's body to
+ * the end of the block that encloses the function declaration.</li>
+ * <li>For top-level functions, {@code null} will be returned because they are potentially visible
+ * in multiple sources.</li>
+ * </ul>
* @return the range of characters in which the name of this element is visible
*/
SourceRange get visibleRange;
}
/**
- * The interface `LocalVariableElement` defines the behavior common to elements that represent
+ * The interface {@code LocalVariableElement} defines the behavior common to elements that represent
* a local variable.
* @coverage dart.engine.element
*/
abstract class LocalVariableElement implements LocalElement, VariableElement {
}
/**
- * The interface `MethodElement` defines the behavior of elements that represent a method
+ * The interface {@code MethodElement} defines the behavior of elements that represent a method
* defined within a type.
* @coverage dart.engine.element
*/
abstract class MethodElement implements ClassMemberElement, ExecutableElement {
/**
- * Return `true` if this method is abstract. Methods are abstract if they are not external
+ * Return {@code true} if this method is abstract. Methods are abstract if they are not external
* and have no body.
- * @return `true` if this method is abstract
+ * @return {@code true} if this method is abstract
*/
- bool get isAbstract;
+ bool isAbstract();
}
/**
- * The interface `MultiplyDefinedElement` defines the behavior of pseudo-elements that
+ * The interface {@code MultiplyDefinedElement} defines the behavior of pseudo-elements that
* represent multiple elements defined within a single scope that have the same name. This situation
* is not allowed by the language, so objects implementing this interface always represent an error.
* As a result, most of the normal operations on elements do not make sense and will return useless
@@ -1025,7 +1000,7 @@
List<Element> get conflictingElements;
}
/**
- * The interface `NamespaceCombinator` defines the behavior common to objects that control how
+ * The interface {@code NamespaceCombinator} defines the behavior common to objects that control how
* namespaces are combined.
* @coverage dart.engine.element
*/
@@ -1037,7 +1012,7 @@
static final List<NamespaceCombinator> EMPTY_ARRAY = new List<NamespaceCombinator>(0);
}
/**
- * The interface `ParameterElement` defines the behavior of elements representing a parameter
+ * The interface {@code ParameterElement} defines the behavior of elements representing a parameter
* defined within an executable element.
* @coverage dart.engine.element
*/
@@ -1045,7 +1020,7 @@
/**
* Return a source range that covers the portion of the source in which the default value for this
- * parameter is specified, or `null` if there is no default value.
+ * parameter is specified, or {@code null} if there is no default value.
* @return the range of characters in which the default value of this parameter is specified
*/
SourceRange get defaultValueRange;
@@ -1064,13 +1039,13 @@
List<ParameterElement> get parameters;
/**
- * Return `true` if this parameter is an initializing formal parameter.
- * @return `true` if this parameter is an initializing formal parameter
+ * Return {@code true} if this parameter is an initializing formal parameter.
+ * @return {@code true} if this parameter is an initializing formal parameter
*/
- bool get isInitializingFormal;
+ bool isInitializingFormal();
}
/**
- * The interface `PrefixElement` defines the behavior common to elements that represent a
+ * The interface {@code PrefixElement} defines the behavior common to elements that represent a
* prefix used to import one or more libraries into another library.
* @coverage dart.engine.element
*/
@@ -1089,25 +1064,25 @@
List<LibraryElement> get importedLibraries;
}
/**
- * The interface `PropertyAccessorElement` defines the behavior of elements representing a
+ * The interface {@code PropertyAccessorElement} defines the behavior of elements representing a
* getter or a setter. Note that explicitly defined property accessors implicitly define a synthetic
* field. Symmetrically, synthetic accessors are implicitly created for explicitly defined fields.
* The following rules apply:
- *
- * * Every explicit field is represented by a non-synthetic [FieldElement].
- * * Every explicit field induces a getter and possibly a setter, both of which are represented by
- * synthetic [PropertyAccessorElement]s.
- * * Every explicit getter or setter is represented by a non-synthetic[PropertyAccessorElement].
- * * Every explicit getter or setter (or pair thereof if they have the same name) induces a field
- * that is represented by a synthetic [FieldElement].
- *
+ * <ul>
+ * <li>Every explicit field is represented by a non-synthetic {@link FieldElement}.
+ * <li>Every explicit field induces a getter and possibly a setter, both of which are represented by
+ * synthetic {@link PropertyAccessorElement}s.
+ * <li>Every explicit getter or setter is represented by a non-synthetic{@link PropertyAccessorElement}.
+ * <li>Every explicit getter or setter (or pair thereof if they have the same name) induces a field
+ * that is represented by a synthetic {@link FieldElement}.
+ * </ul>
* @coverage dart.engine.element
*/
abstract class PropertyAccessorElement implements ExecutableElement {
/**
* Return the accessor representing the getter that corresponds to (has the same name as) this
- * setter, or `null` if this accessor is not a setter or if there is no corresponding
+ * setter, or {@code null} if this accessor is not a setter or if there is no corresponding
* getter.
* @return the getter that corresponds to this setter
*/
@@ -1115,7 +1090,7 @@
/**
* Return the accessor representing the setter that corresponds to (has the same name as) this
- * getter, or `null` if this accessor is not a getter or if there is no corresponding
+ * getter, or {@code null} if this accessor is not a getter or if there is no corresponding
* setter.
* @return the setter that corresponds to this getter
*/
@@ -1129,38 +1104,38 @@
PropertyInducingElement get variable;
/**
- * Return `true` if this accessor is abstract. Accessors are abstract if they are not
+ * Return {@code true} if this accessor is abstract. Accessors are abstract if they are not
* external and have no body.
- * @return `true` if this accessor is abstract
+ * @return {@code true} if this accessor is abstract
*/
- bool get isAbstract;
+ bool isAbstract();
/**
- * Return `true` if this accessor represents a getter.
- * @return `true` if this accessor represents a getter
+ * Return {@code true} if this accessor represents a getter.
+ * @return {@code true} if this accessor represents a getter
*/
- bool get isGetter;
+ bool isGetter();
/**
- * Return `true` if this accessor represents a setter.
- * @return `true` if this accessor represents a setter
+ * Return {@code true} if this accessor represents a setter.
+ * @return {@code true} if this accessor represents a setter
*/
- bool get isSetter;
+ bool isSetter();
}
/**
- * The interface `PropertyInducingElement` defines the behavior of elements representing a
+ * The interface {@code PropertyInducingElement} defines the behavior of elements representing a
* variable that has an associated getter and possibly a setter. Note that explicitly defined
- * variables implicitly define a synthetic getter and that non-`final` explicitly defined
+ * variables implicitly define a synthetic getter and that non-{@code final} explicitly defined
* variables implicitly define a synthetic setter. Symmetrically, synthetic fields are implicitly
* created for explicitly defined getters and setters. The following rules apply:
- *
- * * Every explicit variable is represented by a non-synthetic [PropertyInducingElement].
- * * Every explicit variable induces a getter and possibly a setter, both of which are represented
- * by synthetic [PropertyAccessorElement]s.
- * * Every explicit getter or setter is represented by a non-synthetic[PropertyAccessorElement].
- * * Every explicit getter or setter (or pair thereof if they have the same name) induces a
- * variable that is represented by a synthetic [PropertyInducingElement].
- *
+ * <ul>
+ * <li>Every explicit variable is represented by a non-synthetic {@link PropertyInducingElement}.
+ * <li>Every explicit variable induces a getter and possibly a setter, both of which are represented
+ * by synthetic {@link PropertyAccessorElement}s.
+ * <li>Every explicit getter or setter is represented by a non-synthetic{@link PropertyAccessorElement}.
+ * <li>Every explicit getter or setter (or pair thereof if they have the same name) induces a
+ * variable that is represented by a synthetic {@link PropertyInducingElement}.
+ * </ul>
* @coverage dart.engine.element
*/
abstract class PropertyInducingElement implements VariableElement {
@@ -1173,8 +1148,8 @@
PropertyAccessorElement get getter;
/**
- * Return the setter associated with this variable, or `null` if the variable is effectively`final` and therefore does not have a setter associated with it. (This can happen either
- * because the variable is explicitly defined as being `final` or because the variable is
+ * Return the setter associated with this variable, or {@code null} if the variable is effectively{@code final} and therefore does not have a setter associated with it. (This can happen either
+ * because the variable is explicitly defined as being {@code final} or because the variable is
* induced by an explicit getter that does not have a corresponding setter.) If this variable was
* explicitly defined (is not synthetic) then the setter associated with it will be synthetic.
* @return the setter associated with this variable
@@ -1182,14 +1157,14 @@
PropertyAccessorElement get setter;
/**
- * Return `true` if this element is a static element. A static element is an element that is
+ * Return {@code true} if this element is a static element. A static element is an element that is
* not associated with a particular instance, but rather with an entire library or class.
- * @return `true` if this executable element is a static element
+ * @return {@code true} if this executable element is a static element
*/
- bool get isStatic;
+ bool isStatic();
}
/**
- * The interface `ShowElementCombinator` defines the behavior of combinators that cause some
+ * The interface {@code ShowElementCombinator} defines the behavior of combinators that cause some
* of the names in a namespace to be visible (and the rest hidden) when being imported.
* @coverage dart.engine.element
*/
@@ -1203,21 +1178,21 @@
List<String> get shownNames;
}
/**
- * The interface `TopLevelVariableElement` defines the behavior of elements representing a
+ * The interface {@code TopLevelVariableElement} defines the behavior of elements representing a
* top-level variable.
* @coverage dart.engine.element
*/
abstract class TopLevelVariableElement implements PropertyInducingElement {
}
/**
- * The interface `TypeVariableElement` defines the behavior of elements representing a type
+ * The interface {@code TypeVariableElement} defines the behavior of elements representing a type
* variable.
* @coverage dart.engine.element
*/
abstract class TypeVariableElement implements Element {
/**
- * Return the type representing the bound associated with this variable, or `null` if this
+ * Return the type representing the bound associated with this variable, or {@code null} if this
* variable does not have an explicit bound.
* @return the type representing the bound associated with this variable
*/
@@ -1230,7 +1205,7 @@
TypeVariableType get type;
}
/**
- * The interface `UndefinedElement` defines the behavior of pseudo-elements that represent
+ * The interface {@code UndefinedElement} defines the behavior of pseudo-elements that represent
* names that are undefined. This situation is not allowed by the language, so objects implementing
* this interface always represent an error. As a result, most of the normal operations on elements
* do not make sense and will return useless results.
@@ -1239,27 +1214,27 @@
abstract class UndefinedElement implements Element {
}
/**
- * The interface `UriReferencedElement` defines the behavior of objects included into a
+ * The interface {@code UriReferencedElement} defines the behavior of objects included into a
* library using some URI.
* @coverage dart.engine.element
*/
abstract class UriReferencedElement implements Element {
/**
- * Return the URI that is used to include this element into the enclosing library, or `null`if this is the defining compilation unit of a library.
+ * Return the URI that is used to include this element into the enclosing library, or {@code null}if this is the defining compilation unit of a library.
* @return the URI that is used to include this element into the enclosing library
*/
String get uri;
}
/**
- * The interface `VariableElement` defines the behavior common to elements that represent a
+ * The interface {@code VariableElement} defines the behavior common to elements that represent a
* variable.
* @coverage dart.engine.element
*/
abstract class VariableElement implements Element {
/**
- * Return a synthetic function representing this variable's initializer, or `null` if this
+ * Return a synthetic function representing this variable's initializer, or {@code null} if this
* variable does not have an initializer. The function will have no parameters. The return type of
* the function will be the compile-time type of the initialization expression.
* @return a synthetic function representing this variable's initializer
@@ -1267,41 +1242,41 @@
FunctionElement get initializer;
/**
- * Return the declared type of this variable, or `null` if the variable did not have a
+ * Return the declared type of this variable, or {@code null} if the variable did not have a
* declared type (such as if it was declared using the keyword 'var').
* @return the declared type of this variable
*/
Type2 get type;
/**
- * Return `true` if this variable was declared with the 'const' modifier.
- * @return `true` if this variable was declared with the 'const' modifier
+ * Return {@code true} if this variable was declared with the 'const' modifier.
+ * @return {@code true} if this variable was declared with the 'const' modifier
*/
- bool get isConst;
+ bool isConst();
/**
- * Return `true` if this variable was declared with the 'final' modifier. Variables that are
- * declared with the 'const' modifier will return `false` even though they are implicitly
+ * Return {@code true} if this variable was declared with the 'final' modifier. Variables that are
+ * declared with the 'const' modifier will return {@code false} even though they are implicitly
* final.
- * @return `true` if this variable was declared with the 'final' modifier
+ * @return {@code true} if this variable was declared with the 'final' modifier
*/
- bool get isFinal;
+ bool isFinal();
}
/**
- * Instances of the class `GeneralizingElementVisitor` implement an element visitor that will
- * recursively visit all of the elements in an element model (like instances of the class[RecursiveElementVisitor]). In addition, when an element of a specific type is visited not
+ * Instances of the class {@code GeneralizingElementVisitor} implement an element visitor that will
+ * recursively visit all of the elements in an element model (like instances of the class{@link RecursiveElementVisitor}). In addition, when an element of a specific type is visited not
* only will the visit method for that specific type of element be invoked, but additional methods
* for the supertypes of that element will also be invoked. For example, using an instance of this
- * class to visit a [MethodElement] will cause the method[visitMethodElement] to be invoked but will also cause the methods[visitExecutableElement] and [visitElement] to be
+ * class to visit a {@link MethodElement} will cause the method{@link #visitMethodElement(MethodElement)} to be invoked but will also cause the methods{@link #visitExecutableElement(ExecutableElement)} and {@link #visitElement(Element)} to be
* subsequently invoked. This allows visitors to be written that visit all executable elements
- * without needing to override the visit method for each of the specific subclasses of[ExecutableElement].
- *
+ * without needing to override the visit method for each of the specific subclasses of{@link ExecutableElement}.
+ * <p>
* Note, however, that unlike many visitors, element visitors visit objects based on the interfaces
* implemented by those elements. Because interfaces form a graph structure rather than a tree
* structure the way classes do, and because it is generally undesirable for an object to be visited
* more than once, this class flattens the interface graph into a pseudo-tree. In particular, this
* class treats elements as if the element types were structured in the following way:
- *
+ * <p>
* <pre>
* Element
* ClassElement
@@ -1331,7 +1306,7 @@
* ParameterElement
* FieldFormalParameterElement
* </pre>
- *
+ * <p>
* Subclasses that override a visit method must either invoke the overridden visit method or
* explicitly invoke the more general visit method. Failure to do so will cause the visit methods
* for superclasses of the element to not be invoked and will cause the children of the visited node
@@ -1381,11 +1356,11 @@
R visitVariableElement(VariableElement element) => visitElement(element);
}
/**
- * Instances of the class `RecursiveElementVisitor` implement an element visitor that will
+ * Instances of the class {@code RecursiveElementVisitor} implement an element visitor that will
* recursively visit all of the element in an element model. For example, using an instance of this
- * class to visit a [CompilationUnitElement] will also cause all of the types in the
+ * class to visit a {@link CompilationUnitElement} will also cause all of the types in the
* compilation unit to be visited.
- *
+ * <p>
* Subclasses that override a visit method must either invoke the overridden visit method or must
* explicitly ask the visited element to visit its children. Failure to do so will cause the
* children of the visited element to not be visited.
@@ -1482,7 +1457,7 @@
}
}
/**
- * Instances of the class `SimpleElementVisitor` implement an element visitor that will do
+ * Instances of the class {@code SimpleElementVisitor} implement an element visitor that will do
* nothing when visiting an element. It is intended to be a superclass for classes that use the
* visitor pattern primarily as a dispatch mechanism (and hence don't need to recursively visit a
* whole structure) and that only need to visit a small number of element types.
@@ -1513,7 +1488,7 @@
R visitTypeVariableElement(TypeVariableElement element) => null;
}
/**
- * Instances of the class `ClassElementImpl` implement a `ClassElement`.
+ * Instances of the class {@code ClassElementImpl} implement a {@code ClassElement}.
* @coverage dart.engine.element
*/
class ClassElementImpl extends ElementImpl implements ClassElement {
@@ -1550,7 +1525,7 @@
List<MethodElement> _methods = MethodElementImpl.EMPTY_ARRAY;
/**
- * The superclass of the class, or `null` if the class does not have an explicit superclass.
+ * The superclass of the class, or {@code null} if the class does not have an explicit superclass.
*/
InterfaceType _supertype;
@@ -1613,10 +1588,10 @@
List<ConstructorElement> get constructors => _constructors;
/**
- * Given some name, this returns the [FieldElement] with the matching name, if there is no
- * such field, then `null` is returned.
+ * Given some name, this returns the {@link FieldElement} with the matching name, if there is no
+ * such field, then {@code null} is returned.
* @param name some name to lookup a field element with
- * @return the matching field element, or `null` if no such element was found
+ * @return the matching field element, or {@code null} if no such element was found
*/
FieldElement getField(String name2) {
for (FieldElement fieldElement in _fields) {
@@ -1629,7 +1604,7 @@
List<FieldElement> get fields => _fields;
PropertyAccessorElement getGetter(String getterName) {
for (PropertyAccessorElement accessor in _accessors) {
- if (accessor.isGetter && accessor.name == getterName) {
+ if (accessor.isGetter() && accessor.name == getterName) {
return accessor;
}
}
@@ -1661,7 +1636,7 @@
setterName += '=';
}
for (PropertyAccessorElement accessor in _accessors) {
- if (accessor.isSetter && accessor.name == setterName) {
+ if (accessor.isSetter() && accessor.name == setterName) {
return accessor;
}
}
@@ -1679,14 +1654,6 @@
}
return null;
}
- bool hasDefaultConstructor() {
- for (ConstructorElement constructor in constructors) {
- if (constructor.isDefaultConstructor) {
- return true;
- }
- }
- return false;
- }
bool hasNonFinalField() {
List<ClassElement> classesToVisit = new List<ClassElement>();
Set<ClassElement> visitedClasses = new Set<ClassElement>();
@@ -1695,7 +1662,7 @@
ClassElement currentElement = classesToVisit.removeAt(0);
if (javaSetAdd(visitedClasses, currentElement)) {
for (FieldElement field in currentElement.fields) {
- if (!field.isFinal && !field.isConst && !field.isStatic && !field.isSynthetic) {
+ if (!field.isFinal() && !field.isConst() && !field.isStatic() && !field.isSynthetic()) {
return true;
}
}
@@ -1715,9 +1682,9 @@
return false;
}
bool hasReferenceToSuper() => hasModifier(Modifier.REFERENCES_SUPER);
- bool get isAbstract => hasModifier(Modifier.ABSTRACT);
- bool get isTypedef => hasModifier(Modifier.TYPEDEF);
- bool get isValidMixin => hasModifier(Modifier.MIXIN);
+ bool isAbstract() => hasModifier(Modifier.ABSTRACT);
+ bool isTypedef() => hasModifier(Modifier.TYPEDEF);
+ bool isValidMixin() => hasModifier(Modifier.MIXIN);
PropertyAccessorElement lookUpGetter(String getterName, LibraryElement library) {
Set<ClassElement> visitedClasses = new Set<ClassElement>();
ClassElement currentElement = this;
@@ -1799,7 +1766,7 @@
/**
* Set whether this class is abstract to correspond to the given value.
- * @param isAbstract `true` if the class is abstract
+ * @param isAbstract {@code true} if the class is abstract
*/
void set abstract(bool isAbstract) {
setModifier(Modifier.ABSTRACT, isAbstract);
@@ -1840,7 +1807,7 @@
/**
* Set whether this class references 'super' to the given value.
- * @param isReferencedSuper `true` references 'super'
+ * @param isReferencedSuper {@code true} references 'super'
*/
void set hasReferenceToSuper2(bool isReferencedSuper) {
setModifier(Modifier.REFERENCES_SUPER, isReferencedSuper);
@@ -1892,7 +1859,7 @@
/**
* Set whether this class is defined by a typedef construct to correspond to the given value.
- * @param isTypedef `true` if the class is defined by a typedef construct
+ * @param isTypedef {@code true} if the class is defined by a typedef construct
*/
void set typedef(bool isTypedef) {
setModifier(Modifier.TYPEDEF, isTypedef);
@@ -1911,7 +1878,7 @@
/**
* Set whether this class is a valid mixin to correspond to the given value.
- * @param isValidMixin `true` if this class can be used as a mixin
+ * @param isValidMixin {@code true} if this class can be used as a mixin
*/
void set validMixin(bool isValidMixin) {
setModifier(Modifier.MIXIN, isValidMixin);
@@ -1973,7 +1940,7 @@
}
}
/**
- * Instances of the class `CompilationUnitElementImpl` implement a[CompilationUnitElement].
+ * Instances of the class {@code CompilationUnitElementImpl} implement a{@link CompilationUnitElement}.
* @coverage dart.engine.element
*/
class CompilationUnitElementImpl extends ElementImpl implements CompilationUnitElement {
@@ -2015,7 +1982,7 @@
List<ClassElement> _types = ClassElementImpl.EMPTY_ARRAY;
/**
- * The URI that is specified by the "part" directive in the enclosing library, or `null` if
+ * The URI that is specified by the "part" directive in the enclosing library, or {@code null} if
* this is the defining compilation unit of a library.
*/
String _uri;
@@ -2164,7 +2131,7 @@
}
}
/**
- * Instances of the class `ConstFieldElementImpl` implement a `FieldElement` for a
+ * Instances of the class {@code ConstFieldElementImpl} implement a {@code FieldElement} for a
* 'const' field that has an initializer.
*/
class ConstFieldElementImpl extends FieldElementImpl {
@@ -2186,7 +2153,7 @@
}
}
/**
- * Instances of the class `ConstLocalVariableElementImpl` implement a`LocalVariableElement` for a local 'const' variable that has an initializer.
+ * Instances of the class {@code ConstLocalVariableElementImpl} implement a{@code LocalVariableElement} for a local 'const' variable that has an initializer.
* @coverage dart.engine.element
*/
class ConstLocalVariableElementImpl extends LocalVariableElementImpl {
@@ -2208,7 +2175,30 @@
}
}
/**
- * Instances of the class `ConstTopLevelVariableElementImpl` implement a`TopLevelVariableElement` for a top-level 'const' variable that has an initializer.
+ * Instances of the class {@code ConstParameterElementImpl} implement a {@code ParameterElement} for
+ * a 'const' parameter that has an initializer.
+ * @coverage dart.engine.element
+ */
+class ConstParameterElementImpl extends ParameterElementImpl {
+
+ /**
+ * The result of evaluating this variable's initializer.
+ */
+ EvaluationResultImpl _result;
+
+ /**
+ * Initialize a newly created parameter element to have the given name.
+ * @param name the name of this element
+ */
+ ConstParameterElementImpl(Identifier name) : super(name) {
+ }
+ EvaluationResultImpl get evaluationResult => _result;
+ void set evaluationResult(EvaluationResultImpl result2) {
+ this._result = result2;
+ }
+}
+/**
+ * Instances of the class {@code ConstTopLevelVariableElementImpl} implement a{@code TopLevelVariableElement} for a top-level 'const' variable that has an initializer.
*/
class ConstTopLevelVariableElementImpl extends TopLevelVariableElementImpl {
@@ -2229,7 +2219,7 @@
}
}
/**
- * Instances of the class `ConstructorElementImpl` implement a `ConstructorElement`.
+ * Instances of the class {@code ConstructorElementImpl} implement a {@code ConstructorElement}.
* @coverage dart.engine.element
*/
class ConstructorElementImpl extends ExecutableElementImpl implements ConstructorElement {
@@ -2254,25 +2244,13 @@
ClassElement get enclosingElement => super.enclosingElement as ClassElement;
ElementKind get kind => ElementKind.CONSTRUCTOR;
ConstructorElement get redirectedConstructor => _redirectedConstructor;
- bool get isConst => hasModifier(Modifier.CONST);
- bool get isDefaultConstructor {
- String name = this.name;
- if (name != null && name.length != 0) {
- return false;
- }
- for (ParameterElement parameter in parameters) {
- if (identical(parameter.parameterKind, ParameterKind.REQUIRED)) {
- return false;
- }
- }
- return true;
- }
- bool get isFactory => hasModifier(Modifier.FACTORY);
- bool get isStatic => false;
+ bool isConst() => hasModifier(Modifier.CONST);
+ bool isFactory() => hasModifier(Modifier.FACTORY);
+ bool isStatic() => false;
/**
* Set whether this constructor represents a 'const' constructor to the given value.
- * @param isConst `true` if this constructor represents a 'const' constructor
+ * @param isConst {@code true} if this constructor represents a 'const' constructor
*/
void set const2(bool isConst) {
setModifier(Modifier.CONST, isConst);
@@ -2280,7 +2258,7 @@
/**
* Set whether this constructor represents a factory method to the given value.
- * @param isFactory `true` if this constructor represents a factory method
+ * @param isFactory {@code true} if this constructor represents a factory method
*/
void set factory(bool isFactory) {
setModifier(Modifier.FACTORY, isFactory);
@@ -2304,52 +2282,8 @@
}
}
/**
- * Instances of the class `DefaultFieldFormalParameterElementImpl` implement a`FieldFormalParameterElementImpl` for parameters that have an initializer.
- * @coverage dart.engine.element
- */
-class DefaultFieldFormalParameterElementImpl extends FieldFormalParameterElementImpl {
-
- /**
- * The result of evaluating this variable's initializer.
- */
- EvaluationResultImpl _result;
-
- /**
- * Initialize a newly created parameter element to have the given name.
- * @param name the name of this element
- */
- DefaultFieldFormalParameterElementImpl(Identifier name) : super(name) {
- }
- EvaluationResultImpl get evaluationResult => _result;
- void set evaluationResult(EvaluationResultImpl result2) {
- this._result = result2;
- }
-}
-/**
- * Instances of the class `DefaultParameterElementImpl` implement a `ParameterElement`for parameters that have an initializer.
- * @coverage dart.engine.element
- */
-class DefaultParameterElementImpl extends ParameterElementImpl {
-
- /**
- * The result of evaluating this variable's initializer.
- */
- EvaluationResultImpl _result;
-
- /**
- * Initialize a newly created parameter element to have the given name.
- * @param name the name of this element
- */
- DefaultParameterElementImpl(Identifier name) : super(name) {
- }
- EvaluationResultImpl get evaluationResult => _result;
- void set evaluationResult(EvaluationResultImpl result2) {
- this._result = result2;
- }
-}
-/**
- * Instances of the class `DynamicElementImpl` represent the synthetic element representing
- * the declaration of the type `dynamic`.
+ * Instances of the class {@code DynamicElementImpl} represent the synthetic element representing
+ * the declaration of the type {@code dynamic}.
* @coverage dart.engine.element
*/
class DynamicElementImpl extends ElementImpl {
@@ -2368,7 +2302,7 @@
/**
* Initialize a newly created instance of this class. Instances of this class should <b>not</b> be
* created except as part of creating the type associated with this element. The single instance
- * of this class should be accessed through the method [getInstance].
+ * of this class should be accessed through the method {@link #getInstance()}.
*/
DynamicElementImpl() : super.con2(Keyword.DYNAMIC.syntax, -1) {
setModifier(Modifier.SYNTHETIC, true);
@@ -2391,7 +2325,7 @@
}
}
/**
- * Instances of the class `ElementAnnotationImpl` implement an [ElementAnnotation].
+ * Instances of the class {@code ElementAnnotationImpl} implement an {@link ElementAnnotation}.
* @coverage dart.engine.element
*/
class ElementAnnotationImpl implements ElementAnnotation {
@@ -2418,14 +2352,14 @@
String toString() => "@${_element.toString()}";
}
/**
- * The abstract class `ElementImpl` implements the behavior common to objects that implement
- * an [Element].
+ * The abstract class {@code ElementImpl} implements the behavior common to objects that implement
+ * an {@link Element}.
* @coverage dart.engine.element
*/
abstract class ElementImpl implements Element {
/**
- * The enclosing element of this element, or `null` if this element is at the root of the
+ * The enclosing element of this element, or {@code null} if this element is at the root of the
* element structure.
*/
ElementImpl _enclosingElement;
@@ -2461,10 +2395,10 @@
* @param name the name of this element
*/
ElementImpl.con1(Identifier name2) {
- _jtd_constructor_195_impl(name2);
+ _jtd_constructor_194_impl(name2);
}
- _jtd_constructor_195_impl(Identifier name2) {
- _jtd_constructor_196_impl(name2 == null ? "" : name2.name, name2 == null ? -1 : name2.offset);
+ _jtd_constructor_194_impl(Identifier name2) {
+ _jtd_constructor_195_impl(name2 == null ? "" : name2.name, name2 == null ? -1 : name2.offset);
}
/**
@@ -2474,9 +2408,9 @@
* declaration of this element
*/
ElementImpl.con2(String name2, int nameOffset2) {
- _jtd_constructor_196_impl(name2, nameOffset2);
+ _jtd_constructor_195_impl(name2, nameOffset2);
}
- _jtd_constructor_196_impl(String name2, int nameOffset2) {
+ _jtd_constructor_195_impl(String name2, int nameOffset2) {
this._name = StringUtilities.intern(name2);
this._nameOffset = nameOffset2;
}
@@ -2497,7 +2431,7 @@
}
/**
- * Return the child of this element that is uniquely identified by the given identifier, or`null` if there is no such child.
+ * Return the child of this element that is uniquely identified by the given identifier, or{@code null} if there is no such child.
* @param identifier the identifier used to select a child
* @return the child of this element with the given identifier
*/
@@ -2533,7 +2467,7 @@
}
return true;
}
- bool get isSynthetic => hasModifier(Modifier.SYNTHETIC);
+ bool isSynthetic() => hasModifier(Modifier.SYNTHETIC);
/**
* Set the metadata associate with this element to the given array of annotations.
@@ -2555,7 +2489,7 @@
/**
* Set whether this element is synthetic to correspond to the given value.
- * @param isSynthetic `true` if the element is synthetic
+ * @param isSynthetic {@code true} if the element is synthetic
*/
void set synthetic(bool isSynthetic) {
setModifier(Modifier.SYNTHETIC, isSynthetic);
@@ -2590,14 +2524,14 @@
String get identifier => name;
/**
- * Return `true` if this element has the given modifier associated with it.
+ * Return {@code true} if this element has the given modifier associated with it.
* @param modifier the modifier being tested for
- * @return `true` if this element has the given modifier associated with it
+ * @return {@code true} if this element has the given modifier associated with it
*/
bool hasModifier(Modifier modifier) => _modifiers != null && _modifiers.contains(modifier);
/**
- * If the given child is not `null`, use the given visitor to visit it.
+ * If the given child is not {@code null}, use the given visitor to visit it.
* @param child the child to be visited
* @param visitor the visitor to be used to visit the child
*/
@@ -2632,7 +2566,7 @@
* Set whether the given modifier is associated with this element to correspond to the given
* value.
* @param modifier the modifier to be set
- * @param value `true` if the modifier is to be associated with this element
+ * @param value {@code true} if the modifier is to be associated with this element
*/
void setModifier(Modifier modifier, bool value) {
if (value) {
@@ -2651,7 +2585,7 @@
}
}
/**
- * Instances of the class `ElementLocationImpl` implement an [ElementLocation].
+ * Instances of the class {@code ElementLocationImpl} implement an {@link ElementLocation}.
* @coverage dart.engine.element
*/
class ElementLocationImpl implements ElementLocation {
@@ -2671,9 +2605,9 @@
* @param element the element whose location is being represented
*/
ElementLocationImpl.con1(Element element) {
- _jtd_constructor_197_impl(element);
+ _jtd_constructor_196_impl(element);
}
- _jtd_constructor_197_impl(Element element) {
+ _jtd_constructor_196_impl(Element element) {
List<String> components = new List<String>();
Element ancestor = element;
while (ancestor != null) {
@@ -2688,9 +2622,9 @@
* @param encoding the encoded form of a location
*/
ElementLocationImpl.con2(String encoding) {
- _jtd_constructor_198_impl(encoding);
+ _jtd_constructor_197_impl(encoding);
}
- _jtd_constructor_198_impl(String encoding) {
+ _jtd_constructor_197_impl(String encoding) {
this._components = decode(encoding);
}
bool operator ==(Object object) {
@@ -2785,11 +2719,11 @@
}
/**
- * Return `true` if the given components, when interpreted to be encoded sources with a
+ * Return {@code true} if the given components, when interpreted to be encoded sources with a
* leading source type indicator, are equal when the source type's are ignored.
* @param left the left component being compared
* @param right the right component being compared
- * @return `true` if the given components are equal when the source type's are ignored
+ * @return {@code true} if the given components are equal when the source type's are ignored
*/
bool equalSourceComponents(String left, String right) {
if (left == null) {
@@ -2804,7 +2738,7 @@
}
}
/**
- * Instances of the class `EmbeddedHtmlScriptElementImpl` implement an[EmbeddedHtmlScriptElement].
+ * Instances of the class {@code EmbeddedHtmlScriptElementImpl} implement an{@link EmbeddedHtmlScriptElement}.
* @coverage dart.engine.element
*/
class EmbeddedHtmlScriptElementImpl extends HtmlScriptElementImpl implements EmbeddedHtmlScriptElement {
@@ -2816,7 +2750,7 @@
/**
* Initialize a newly created script element to have the specified tag name and offset.
- * @param node the XML node from which this element is derived (not `null`)
+ * @param node the XML node from which this element is derived (not {@code null})
*/
EmbeddedHtmlScriptElementImpl(XmlTagNode node) : super(node) {
}
@@ -2826,7 +2760,7 @@
/**
* Set the script library defined by the script tag's content.
- * @param scriptLibrary the library or `null` if none
+ * @param scriptLibrary the library or {@code null} if none
*/
void set scriptLibrary(LibraryElementImpl scriptLibrary2) {
scriptLibrary2.enclosingElement = this;
@@ -2837,7 +2771,7 @@
}
}
/**
- * The abstract class `ExecutableElementImpl` implements the behavior common to`ExecutableElement`s.
+ * The abstract class {@code ExecutableElementImpl} implements the behavior common to{@code ExecutableElement}s.
* @coverage dart.engine.element
*/
abstract class ExecutableElementImpl extends ElementImpl implements ExecutableElement {
@@ -2863,11 +2797,6 @@
List<ParameterElement> _parameters = ParameterElementImpl.EMPTY_ARRAY;
/**
- * The return type defined by this executable element.
- */
- Type2 _returnType;
-
- /**
* The type of function defined by this executable element.
*/
FunctionType _type;
@@ -2882,9 +2811,9 @@
* @param name the name of this element
*/
ExecutableElementImpl.con1(Identifier name) : super.con1(name) {
- _jtd_constructor_200_impl(name);
+ _jtd_constructor_199_impl(name);
}
- _jtd_constructor_200_impl(Identifier name) {
+ _jtd_constructor_199_impl(Identifier name) {
}
/**
@@ -2894,9 +2823,9 @@
* declaration of this element
*/
ExecutableElementImpl.con2(String name, int nameOffset) : super.con2(name, nameOffset) {
- _jtd_constructor_201_impl(name, nameOffset);
+ _jtd_constructor_200_impl(name, nameOffset);
}
- _jtd_constructor_201_impl(String name, int nameOffset) {
+ _jtd_constructor_200_impl(String name, int nameOffset) {
}
ElementImpl getChild(String identifier2) {
for (ExecutableElement function in _functions) {
@@ -2925,9 +2854,8 @@
List<LabelElement> get labels => _labels;
List<LocalVariableElement> get localVariables => _localVariables;
List<ParameterElement> get parameters => _parameters;
- Type2 get returnType => _returnType;
FunctionType get type => _type;
- bool get isOperator => false;
+ bool isOperator() => false;
/**
* Set the functions defined within this executable element to the given functions.
@@ -2974,14 +2902,6 @@
}
/**
- * Set the return type defined by this executable element.
- * @param returnType the return type defined by this executable element
- */
- void set returnType(Type2 returnType2) {
- this._returnType = returnType2;
- }
-
- /**
* Set the type of function defined by this executable element to the given type.
* @param type the type of function defined by this executable element
*/
@@ -3012,7 +2932,7 @@
}
}
/**
- * Instances of the class `ExportElementImpl` implement an [ExportElement].
+ * Instances of the class {@code ExportElementImpl} implement an {@link ExportElement}.
* @coverage dart.engine.element
*/
class ExportElementImpl extends ElementImpl implements ExportElement {
@@ -3076,19 +2996,19 @@
String get identifier => _exportedLibrary.name;
}
/**
- * Instances of the class `ExternalHtmlScriptElementImpl` implement an[ExternalHtmlScriptElement].
+ * Instances of the class {@code ExternalHtmlScriptElementImpl} implement an{@link ExternalHtmlScriptElement}.
* @coverage dart.engine.element
*/
class ExternalHtmlScriptElementImpl extends HtmlScriptElementImpl implements ExternalHtmlScriptElement {
/**
- * The source specified in the `source` attribute or `null` if unspecified.
+ * The source specified in the {@code source} attribute or {@code null} if unspecified.
*/
Source _scriptSource;
/**
* Initialize a newly created script element to have the specified tag name and offset.
- * @param node the XML node from which this element is derived (not `null`)
+ * @param node the XML node from which this element is derived (not {@code null})
*/
ExternalHtmlScriptElementImpl(XmlTagNode node) : super(node) {
}
@@ -3097,15 +3017,15 @@
Source get scriptSource => _scriptSource;
/**
- * Set the source specified in the `source` attribute.
- * @param scriptSource the script source or `null` if unspecified
+ * Set the source specified in the {@code source} attribute.
+ * @param scriptSource the script source or {@code null} if unspecified
*/
void set scriptSource(Source scriptSource2) {
this._scriptSource = scriptSource2;
}
}
/**
- * Instances of the class `FieldElementImpl` implement a `FieldElement`.
+ * Instances of the class {@code FieldElementImpl} implement a {@code FieldElement}.
* @coverage dart.engine.element
*/
class FieldElementImpl extends PropertyInducingElementImpl implements FieldElement {
@@ -3120,9 +3040,9 @@
* @param name the name of this element
*/
FieldElementImpl.con1(Identifier name) : super.con1(name) {
- _jtd_constructor_204_impl(name);
+ _jtd_constructor_203_impl(name);
}
- _jtd_constructor_204_impl(Identifier name) {
+ _jtd_constructor_203_impl(Identifier name) {
}
/**
@@ -3130,25 +3050,25 @@
* @param name the name of this element
*/
FieldElementImpl.con2(String name) : super.con2(name) {
- _jtd_constructor_205_impl(name);
+ _jtd_constructor_204_impl(name);
}
- _jtd_constructor_205_impl(String name) {
+ _jtd_constructor_204_impl(String name) {
}
accept(ElementVisitor visitor) => visitor.visitFieldElement(this);
ClassElement get enclosingElement => super.enclosingElement as ClassElement;
ElementKind get kind => ElementKind.FIELD;
- bool get isStatic => hasModifier(Modifier.STATIC);
+ bool isStatic() => hasModifier(Modifier.STATIC);
/**
* Set whether this field is static to correspond to the given value.
- * @param isStatic `true` if the field is static
+ * @param isStatic {@code true} if the field is static
*/
void set static(bool isStatic) {
setModifier(Modifier.STATIC, isStatic);
}
}
/**
- * Instances of the class `FieldFormalParameterElementImpl` extend[ParameterElementImpl] to provide the additional information of the [FieldElement]associated with the parameter.
+ * Instances of the class {@code FieldFormalParameterElementImpl} extend{@link ParameterElementImpl} to provide the additional information of the {@link FieldElement}associated with the parameter.
* @coverage dart.engine.element
*/
class FieldFormalParameterElementImpl extends ParameterElementImpl implements FieldFormalParameterElement {
@@ -3166,7 +3086,7 @@
}
accept(ElementVisitor visitor) => visitor.visitFieldFormalParameterElement(this);
FieldElement get field => _field;
- bool get isInitializingFormal => true;
+ bool isInitializingFormal() => true;
/**
* Set the field element associated with this field formal parameter to the given element.
@@ -3177,7 +3097,7 @@
}
}
/**
- * Instances of the class `FunctionElementImpl` implement a `FunctionElement`.
+ * Instances of the class {@code FunctionElementImpl} implement a {@code FunctionElement}.
* @coverage dart.engine.element
*/
class FunctionElementImpl extends ExecutableElementImpl implements FunctionElement {
@@ -3188,7 +3108,7 @@
int _visibleRangeOffset = 0;
/**
- * The length of the visible range for this element, or `-1` if this element does not have a
+ * The length of the visible range for this element, or {@code -1} if this element does not have a
* visible range.
*/
int _visibleRangeLength = -1;
@@ -3202,9 +3122,9 @@
* Initialize a newly created synthetic function element.
*/
FunctionElementImpl() : super.con2("", -1) {
- _jtd_constructor_207_impl();
+ _jtd_constructor_206_impl();
}
- _jtd_constructor_207_impl() {
+ _jtd_constructor_206_impl() {
synthetic = true;
}
@@ -3213,9 +3133,9 @@
* @param name the name of this element
*/
FunctionElementImpl.con1(Identifier name) : super.con1(name) {
- _jtd_constructor_208_impl(name);
+ _jtd_constructor_207_impl(name);
}
- _jtd_constructor_208_impl(Identifier name) {
+ _jtd_constructor_207_impl(Identifier name) {
}
/**
@@ -3225,9 +3145,9 @@
* declaration of this element
*/
FunctionElementImpl.con2(int nameOffset) : super.con2("", nameOffset) {
- _jtd_constructor_209_impl(nameOffset);
+ _jtd_constructor_208_impl(nameOffset);
}
- _jtd_constructor_209_impl(int nameOffset) {
+ _jtd_constructor_208_impl(int nameOffset) {
}
accept(ElementVisitor visitor) => visitor.visitFunctionElement(this);
String get identifier => "${name}@${nameOffset}";
@@ -3238,13 +3158,13 @@
}
return new SourceRange(_visibleRangeOffset, _visibleRangeLength);
}
- bool get isStatic => enclosingElement is CompilationUnitElement;
+ bool isStatic() => enclosingElement is CompilationUnitElement;
/**
* Set the visible range for this element to the range starting at the given offset with the given
* length.
* @param offset the offset to the beginning of the visible range for this element
- * @param length the length of the visible range for this element, or `-1` if this element
+ * @param length the length of the visible range for this element, or {@code -1} if this element
* does not have a visible range
*/
void setVisibleRange(int offset, int length) {
@@ -3260,7 +3180,7 @@
}
}
/**
- * Instances of the class `FunctionTypeAliasElementImpl` implement a`FunctionTypeAliasElement`.
+ * Instances of the class {@code FunctionTypeAliasElementImpl} implement a{@code FunctionTypeAliasElement}.
* @coverage dart.engine.element
*/
class FunctionTypeAliasElementImpl extends ElementImpl implements FunctionTypeAliasElement {
@@ -3271,11 +3191,6 @@
List<ParameterElement> _parameters = ParameterElementImpl.EMPTY_ARRAY;
/**
- * The return type defined by this type alias.
- */
- Type2 _returnType;
-
- /**
* The type of function defined by this type alias.
*/
FunctionType _type;
@@ -3313,7 +3228,6 @@
CompilationUnitElement get enclosingElement => super.enclosingElement as CompilationUnitElement;
ElementKind get kind => ElementKind.FUNCTION_TYPE_ALIAS;
List<ParameterElement> get parameters => _parameters;
- Type2 get returnType => _returnType;
FunctionType get type => _type;
List<TypeVariableElement> get typeVariables => _typeVariables;
@@ -3331,14 +3245,6 @@
}
/**
- * Set the return type defined by this type alias.
- * @param returnType the return type defined by this type alias
- */
- void set returnType(Type2 returnType2) {
- this._returnType = returnType2;
- }
-
- /**
* Set the type of function defined by this type alias to the given type.
* @param type the type of function defined by this type alias
*/
@@ -3391,7 +3297,7 @@
}
}
/**
- * Instances of the class `HideElementCombinatorImpl` implement a[HideElementCombinator].
+ * Instances of the class {@code HideElementCombinatorImpl} implement a{@link HideElementCombinator}.
* @coverage dart.engine.element
*/
class HideElementCombinatorImpl implements HideElementCombinator {
@@ -3425,7 +3331,7 @@
}
}
/**
- * Instances of the class `HtmlElementImpl` implement an [HtmlElement].
+ * Instances of the class {@code HtmlElementImpl} implement an {@link HtmlElement}.
* @coverage dart.engine.element
*/
class HtmlElementImpl extends ElementImpl implements HtmlElement {
@@ -3500,7 +3406,7 @@
}
}
/**
- * Instances of the class `HtmlScriptElementImpl` implement an [HtmlScriptElement].
+ * Instances of the class {@code HtmlScriptElementImpl} implement an {@link HtmlScriptElement}.
* @coverage dart.engine.element
*/
abstract class HtmlScriptElementImpl extends ElementImpl implements HtmlScriptElement {
@@ -3512,13 +3418,13 @@
/**
* Initialize a newly created script element to have the specified tag name and offset.
- * @param node the XML node from which this element is derived (not `null`)
+ * @param node the XML node from which this element is derived (not {@code null})
*/
HtmlScriptElementImpl(XmlTagNode node) : super.con2(node.tag.lexeme, node.tag.offset) {
}
}
/**
- * Instances of the class `ImportElementImpl` implement an [ImportElement].
+ * Instances of the class {@code ImportElementImpl} implement an {@link ImportElement}.
* @coverage dart.engine.element
*/
class ImportElementImpl extends ElementImpl implements ImportElement {
@@ -3540,7 +3446,7 @@
List<NamespaceCombinator> _combinators = NamespaceCombinator.EMPTY_ARRAY;
/**
- * The prefix that was specified as part of the import directive, or `null` if there was no
+ * The prefix that was specified as part of the import directive, or {@code null} if there was no
* prefix specified.
*/
PrefixElement _prefix;
@@ -3601,18 +3507,18 @@
String get identifier => ((_importedLibrary as LibraryElementImpl)).identifier;
}
/**
- * Instances of the class `LabelElementImpl` implement a `LabelElement`.
+ * Instances of the class {@code LabelElementImpl} implement a {@code LabelElement}.
* @coverage dart.engine.element
*/
class LabelElementImpl extends ElementImpl implements LabelElement {
/**
- * A flag indicating whether this label is associated with a `switch` statement.
+ * A flag indicating whether this label is associated with a {@code switch} statement.
*/
bool _onSwitchStatement = false;
/**
- * A flag indicating whether this label is associated with a `switch` member (`case`or `default`).
+ * A flag indicating whether this label is associated with a {@code switch} member ({@code case}or {@code default}).
*/
bool _onSwitchMember = false;
@@ -3624,8 +3530,8 @@
/**
* Initialize a newly created label element to have the given name.
* @param name the name of this element
- * @param onSwitchStatement `true` if this label is associated with a `switch`statement
- * @param onSwitchMember `true` if this label is associated with a `switch` member
+ * @param onSwitchStatement {@code true} if this label is associated with a {@code switch}statement
+ * @param onSwitchMember {@code true} if this label is associated with a {@code switch} member
*/
LabelElementImpl(Identifier name, bool onSwitchStatement, bool onSwitchMember) : super.con1(name) {
this._onSwitchStatement = onSwitchStatement;
@@ -3636,19 +3542,19 @@
ElementKind get kind => ElementKind.LABEL;
/**
- * Return `true` if this label is associated with a `switch` member (`case` or`default`).
- * @return `true` if this label is associated with a `switch` member
+ * Return {@code true} if this label is associated with a {@code switch} member ({@code case} or{@code default}).
+ * @return {@code true} if this label is associated with a {@code switch} member
*/
- bool get isOnSwitchMember => _onSwitchMember;
+ bool isOnSwitchMember() => _onSwitchMember;
/**
- * Return `true` if this label is associated with a `switch` statement.
- * @return `true` if this label is associated with a `switch` statement
+ * Return {@code true} if this label is associated with a {@code switch} statement.
+ * @return {@code true} if this label is associated with a {@code switch} statement
*/
- bool get isOnSwitchStatement => _onSwitchStatement;
+ bool isOnSwitchStatement() => _onSwitchStatement;
}
/**
- * Instances of the class `LibraryElementImpl` implement a `LibraryElement`.
+ * Instances of the class {@code LibraryElementImpl} implement a {@code LibraryElement}.
* @coverage dart.engine.element
*/
class LibraryElementImpl extends ElementImpl implements LibraryElement {
@@ -3700,7 +3606,7 @@
CompilationUnitElement _definingCompilationUnit;
/**
- * The entry point for this library, or `null` if this library does not have an entry point.
+ * The entry point for this library, or {@code null} if this library does not have an entry point.
*/
FunctionElement _entryPoint;
@@ -3715,7 +3621,7 @@
List<ExportElement> _exports = ExportElement.EMPTY_ARRAY;
/**
- * An array containing all of the compilation units that are included in this library using a`part` directive.
+ * An array containing all of the compilation units that are included in this library using a{@code part} directive.
*/
List<CompilationUnitElement> _parts = CompilationUnitElementImpl.EMPTY_ARRAY;
@@ -3809,8 +3715,8 @@
return null;
}
int get hashCode => _definingCompilationUnit.hashCode;
- bool get isBrowserApplication => _entryPoint != null && isOrImportsBrowserLibrary;
- bool get isDartCore => name == "dart.core";
+ bool isBrowserApplication() => _entryPoint != null && isOrImportsBrowserLibrary();
+ bool isDartCore() => name == "dart.core";
bool isUpToDate2(int timeStamp) {
Set<LibraryElement> visitedLibraries = new Set();
return isUpToDate(this, timeStamp, visitedLibraries);
@@ -3860,8 +3766,8 @@
}
/**
- * Set the compilation units that are included in this library using a `part` directive.
- * @param parts the compilation units that are included in this library using a `part`directive
+ * Set the compilation units that are included in this library using a {@code part} directive.
+ * @param parts the compilation units that are included in this library using a {@code part}directive
*/
void set parts(List<CompilationUnitElement> parts2) {
for (CompilationUnitElement compilationUnit in parts2) {
@@ -3878,10 +3784,10 @@
}
/**
- * Answer `true` if the receiver directly or indirectly imports the dart:html libraries.
- * @return `true` if the receiver directly or indirectly imports the dart:html libraries
+ * Answer {@code true} if the receiver directly or indirectly imports the dart:html libraries.
+ * @return {@code true} if the receiver directly or indirectly imports the dart:html libraries
*/
- bool get isOrImportsBrowserLibrary {
+ bool isOrImportsBrowserLibrary() {
List<LibraryElement> visited = new List<LibraryElement>();
Source htmlLibSource = _context.sourceFactory.forUri(DartSdk.DART_HTML);
visited.add(this);
@@ -3906,7 +3812,7 @@
}
}
/**
- * Instances of the class `LocalVariableElementImpl` implement a `LocalVariableElement`.
+ * Instances of the class {@code LocalVariableElementImpl} implement a {@code LocalVariableElement}.
* @coverage dart.engine.element
*/
class LocalVariableElementImpl extends VariableElementImpl implements LocalVariableElement {
@@ -3917,7 +3823,7 @@
int _visibleRangeOffset = 0;
/**
- * The length of the visible range for this element, or `-1` if this element does not have a
+ * The length of the visible range for this element, or {@code -1} if this element does not have a
* visible range.
*/
int _visibleRangeLength = -1;
@@ -3946,7 +3852,7 @@
* Set the visible range for this element to the range starting at the given offset with the given
* length.
* @param offset the offset to the beginning of the visible range for this element
- * @param length the length of the visible range for this element, or `-1` if this element
+ * @param length the length of the visible range for this element, or {@code -1} if this element
* does not have a visible range
*/
void setVisibleRange(int offset, int length) {
@@ -3961,7 +3867,7 @@
String get identifier => "${super.identifier}@${nameOffset}";
}
/**
- * Instances of the class `MethodElementImpl` implement a `MethodElement`.
+ * Instances of the class {@code MethodElementImpl} implement a {@code MethodElement}.
* @coverage dart.engine.element
*/
class MethodElementImpl extends ExecutableElementImpl implements MethodElement {
@@ -3976,9 +3882,9 @@
* @param name the name of this element
*/
MethodElementImpl.con1(Identifier name) : super.con1(name) {
- _jtd_constructor_218_impl(name);
+ _jtd_constructor_217_impl(name);
}
- _jtd_constructor_218_impl(Identifier name) {
+ _jtd_constructor_217_impl(Identifier name) {
}
/**
@@ -3988,24 +3894,24 @@
* declaration of this element
*/
MethodElementImpl.con2(String name, int nameOffset) : super.con2(name, nameOffset) {
- _jtd_constructor_219_impl(name, nameOffset);
+ _jtd_constructor_218_impl(name, nameOffset);
}
- _jtd_constructor_219_impl(String name, int nameOffset) {
+ _jtd_constructor_218_impl(String name, int nameOffset) {
}
accept(ElementVisitor visitor) => visitor.visitMethodElement(this);
ClassElement get enclosingElement => super.enclosingElement as ClassElement;
ElementKind get kind => ElementKind.METHOD;
String get name {
String name = super.name;
- if (isOperator && name == "-") {
+ if (isOperator() && name == "-") {
if (parameters.length == 0) {
return "unary-";
}
}
return super.name;
}
- bool get isAbstract => hasModifier(Modifier.ABSTRACT);
- bool get isOperator {
+ bool isAbstract() => hasModifier(Modifier.ABSTRACT);
+ bool isOperator() {
String name = displayName;
if (name.isEmpty) {
return false;
@@ -4013,11 +3919,11 @@
int first = name.codeUnitAt(0);
return !((0x61 <= first && first <= 0x7A) || (0x41 <= first && first <= 0x5A) || first == 0x5F || first == 0x24);
}
- bool get isStatic => hasModifier(Modifier.STATIC);
+ bool isStatic() => hasModifier(Modifier.STATIC);
/**
* Set whether this method is abstract to correspond to the given value.
- * @param isAbstract `true` if the method is abstract
+ * @param isAbstract {@code true} if the method is abstract
*/
void set abstract(bool isAbstract) {
setModifier(Modifier.ABSTRACT, isAbstract);
@@ -4025,7 +3931,7 @@
/**
* Set whether this method is static to correspond to the given value.
- * @param isStatic `true` if the method is static
+ * @param isStatic {@code true} if the method is static
*/
void set static(bool isStatic) {
setModifier(Modifier.STATIC, isStatic);
@@ -4038,7 +3944,7 @@
}
}
/**
- * The enumeration `Modifier` defines constants for all of the modifiers defined by the Dart
+ * The enumeration {@code Modifier} defines constants for all of the modifiers defined by the Dart
* language and for a few additional flags that are useful.
* @coverage dart.engine.element
*/
@@ -4068,7 +3974,7 @@
String toString() => name;
}
/**
- * Instances of the class `MultiplyDefinedElementImpl` represent a collection of elements that
+ * Instances of the class {@code MultiplyDefinedElementImpl} represent a collection of elements that
* have the same name within the same scope.
* @coverage dart.engine.element
*/
@@ -4121,7 +4027,7 @@
}
return false;
}
- bool get isSynthetic => true;
+ bool isSynthetic() => true;
String toString() {
JavaStringBuilder builder = new JavaStringBuilder();
builder.append("[");
@@ -4170,7 +4076,7 @@
}
}
/**
- * Instances of the class `ParameterElementImpl` implement a `ParameterElement`.
+ * Instances of the class {@code ParameterElementImpl} implement a {@code ParameterElement}.
* @coverage dart.engine.element
*/
class ParameterElementImpl extends VariableElementImpl implements ParameterElement {
@@ -4192,7 +4098,7 @@
int _defaultValueRangeOffset = 0;
/**
- * The length of the default value range for this element, or `-1` if this element does not
+ * The length of the default value range for this element, or {@code -1} if this element does not
* have a default value.
*/
int _defaultValueRangeLength = -1;
@@ -4203,7 +4109,7 @@
int _visibleRangeOffset = 0;
/**
- * The length of the visible range for this element, or `-1` if this element does not have a
+ * The length of the visible range for this element, or {@code -1} if this element does not have a
* visible range.
*/
int _visibleRangeLength = -1;
@@ -4235,13 +4141,13 @@
}
return new SourceRange(_visibleRangeOffset, _visibleRangeLength);
}
- bool get isInitializingFormal => false;
+ bool isInitializingFormal() => false;
/**
* Set the range of the default value for this parameter to the range starting at the given offset
* with the given length.
* @param offset the offset to the beginning of the default value range for this element
- * @param length the length of the default value range for this element, or `-1` if this
+ * @param length the length of the default value range for this element, or {@code -1} if this
* element does not have a default value
*/
void setDefaultValueRange(int offset, int length) {
@@ -4272,7 +4178,7 @@
* Set the visible range for this element to the range starting at the given offset with the given
* length.
* @param offset the offset to the beginning of the visible range for this element
- * @param length the length of the visible range for this element, or `-1` if this element
+ * @param length the length of the visible range for this element, or {@code -1} if this element
* does not have a visible range
*/
void setVisibleRange(int offset, int length) {
@@ -4304,7 +4210,7 @@
}
}
/**
- * Instances of the class `PrefixElementImpl` implement a `PrefixElement`.
+ * Instances of the class {@code PrefixElementImpl} implement a {@code PrefixElement}.
* @coverage dart.engine.element
*/
class PrefixElementImpl extends ElementImpl implements PrefixElement {
@@ -4346,7 +4252,7 @@
}
}
/**
- * Instances of the class `PropertyAccessorElementImpl` implement a`PropertyAccessorElement`.
+ * Instances of the class {@code PropertyAccessorElementImpl} implement a{@code PropertyAccessorElement}.
* @coverage dart.engine.element
*/
class PropertyAccessorElementImpl extends ExecutableElementImpl implements PropertyAccessorElement {
@@ -4366,9 +4272,9 @@
* @param name the name of this element
*/
PropertyAccessorElementImpl.con1(Identifier name) : super.con1(name) {
- _jtd_constructor_224_impl(name);
+ _jtd_constructor_223_impl(name);
}
- _jtd_constructor_224_impl(Identifier name) {
+ _jtd_constructor_223_impl(Identifier name) {
}
/**
@@ -4377,47 +4283,47 @@
* @param variable the variable with which this access is associated
*/
PropertyAccessorElementImpl.con2(PropertyInducingElementImpl variable2) : super.con2(variable2.name, variable2.nameOffset) {
- _jtd_constructor_225_impl(variable2);
+ _jtd_constructor_224_impl(variable2);
}
- _jtd_constructor_225_impl(PropertyInducingElementImpl variable2) {
+ _jtd_constructor_224_impl(PropertyInducingElementImpl variable2) {
this._variable = variable2;
synthetic = true;
}
accept(ElementVisitor visitor) => visitor.visitPropertyAccessorElement(this);
- bool operator ==(Object object) => super == object && identical(isGetter, ((object as PropertyAccessorElement)).isGetter);
+ bool operator ==(Object object) => super == object && identical(isGetter(), ((object as PropertyAccessorElement)).isGetter());
PropertyAccessorElement get correspondingGetter {
- if (isGetter || _variable == null) {
+ if (isGetter() || _variable == null) {
return null;
}
return _variable.getter;
}
PropertyAccessorElement get correspondingSetter {
- if (isSetter || _variable == null) {
+ if (isSetter() || _variable == null) {
return null;
}
return _variable.setter;
}
ElementKind get kind {
- if (isGetter) {
+ if (isGetter()) {
return ElementKind.GETTER;
}
return ElementKind.SETTER;
}
String get name {
- if (isSetter) {
+ if (isSetter()) {
return "${super.name}=";
}
return super.name;
}
PropertyInducingElement get variable => _variable;
- bool get isAbstract => hasModifier(Modifier.ABSTRACT);
- bool get isGetter => hasModifier(Modifier.GETTER);
- bool get isSetter => hasModifier(Modifier.SETTER);
- bool get isStatic => hasModifier(Modifier.STATIC);
+ bool isAbstract() => hasModifier(Modifier.ABSTRACT);
+ bool isGetter() => hasModifier(Modifier.GETTER);
+ bool isSetter() => hasModifier(Modifier.SETTER);
+ bool isStatic() => hasModifier(Modifier.STATIC);
/**
* Set whether this accessor is abstract to correspond to the given value.
- * @param isAbstract `true` if the accessor is abstract
+ * @param isAbstract {@code true} if the accessor is abstract
*/
void set abstract(bool isAbstract) {
setModifier(Modifier.ABSTRACT, isAbstract);
@@ -4425,7 +4331,7 @@
/**
* Set whether this accessor is a getter to correspond to the given value.
- * @param isGetter `true` if the accessor is a getter
+ * @param isGetter {@code true} if the accessor is a getter
*/
void set getter(bool isGetter) {
setModifier(Modifier.GETTER, isGetter);
@@ -4433,7 +4339,7 @@
/**
* Set whether this accessor is a setter to correspond to the given value.
- * @param isSetter `true` if the accessor is a setter
+ * @param isSetter {@code true} if the accessor is a setter
*/
void set setter(bool isSetter) {
setModifier(Modifier.SETTER, isSetter);
@@ -4441,7 +4347,7 @@
/**
* Set whether this accessor is static to correspond to the given value.
- * @param isStatic `true` if the accessor is static
+ * @param isStatic {@code true} if the accessor is static
*/
void set static(bool isStatic) {
setModifier(Modifier.STATIC, isStatic);
@@ -4455,13 +4361,13 @@
this._variable = variable2;
}
void appendTo(JavaStringBuilder builder) {
- builder.append(isGetter ? "get " : "set ");
+ builder.append(isGetter() ? "get " : "set ");
builder.append(variable.displayName);
super.appendTo(builder);
}
}
/**
- * Instances of the class `PropertyInducingElementImpl` implement a`PropertyInducingElement`.
+ * Instances of the class {@code PropertyInducingElementImpl} implement a{@code PropertyInducingElement}.
* @coverage dart.engine.element
*/
abstract class PropertyInducingElementImpl extends VariableElementImpl implements PropertyInducingElement {
@@ -4472,7 +4378,7 @@
PropertyAccessorElement _getter;
/**
- * The setter associated with this element, or `null` if the element is effectively`final` and therefore does not have a setter associated with it.
+ * The setter associated with this element, or {@code null} if the element is effectively{@code final} and therefore does not have a setter associated with it.
*/
PropertyAccessorElement _setter;
@@ -4486,9 +4392,9 @@
* @param name the name of this element
*/
PropertyInducingElementImpl.con1(Identifier name) : super.con1(name) {
- _jtd_constructor_226_impl(name);
+ _jtd_constructor_225_impl(name);
}
- _jtd_constructor_226_impl(Identifier name) {
+ _jtd_constructor_225_impl(Identifier name) {
}
/**
@@ -4496,9 +4402,9 @@
* @param name the name of this element
*/
PropertyInducingElementImpl.con2(String name) : super.con2(name, -1) {
- _jtd_constructor_227_impl(name);
+ _jtd_constructor_226_impl(name);
}
- _jtd_constructor_227_impl(String name) {
+ _jtd_constructor_226_impl(String name) {
synthetic = true;
}
PropertyAccessorElement get getter => _getter;
@@ -4521,7 +4427,7 @@
}
}
/**
- * Instances of the class `ShowElementCombinatorImpl` implement a[ShowElementCombinator].
+ * Instances of the class {@code ShowElementCombinatorImpl} implement a{@link ShowElementCombinator}.
* @coverage dart.engine.element
*/
class ShowElementCombinatorImpl implements ShowElementCombinator {
@@ -4555,7 +4461,7 @@
}
}
/**
- * Instances of the class `TopLevelVariableElementImpl` implement a`TopLevelVariableElement`.
+ * Instances of the class {@code TopLevelVariableElementImpl} implement a{@code TopLevelVariableElement}.
* @coverage dart.engine.element
*/
class TopLevelVariableElementImpl extends PropertyInducingElementImpl implements TopLevelVariableElement {
@@ -4570,9 +4476,9 @@
* @param name the name of this element
*/
TopLevelVariableElementImpl.con1(Identifier name) : super.con1(name) {
- _jtd_constructor_229_impl(name);
+ _jtd_constructor_228_impl(name);
}
- _jtd_constructor_229_impl(Identifier name) {
+ _jtd_constructor_228_impl(Identifier name) {
}
/**
@@ -4580,16 +4486,16 @@
* @param name the name of this element
*/
TopLevelVariableElementImpl.con2(String name) : super.con2(name) {
- _jtd_constructor_230_impl(name);
+ _jtd_constructor_229_impl(name);
}
- _jtd_constructor_230_impl(String name) {
+ _jtd_constructor_229_impl(String name) {
}
accept(ElementVisitor visitor) => visitor.visitTopLevelVariableElement(this);
ElementKind get kind => ElementKind.TOP_LEVEL_VARIABLE;
- bool get isStatic => true;
+ bool isStatic() => true;
}
/**
- * Instances of the class `TypeVariableElementImpl` implement a `TypeVariableElement`.
+ * Instances of the class {@code TypeVariableElementImpl} implement a {@code TypeVariableElement}.
* @coverage dart.engine.element
*/
class TypeVariableElementImpl extends ElementImpl implements TypeVariableElement {
@@ -4600,7 +4506,7 @@
TypeVariableType _type;
/**
- * The type representing the bound associated with this variable, or `null` if this variable
+ * The type representing the bound associated with this variable, or {@code null} if this variable
* does not have an explicit bound.
*/
Type2 _bound;
@@ -4645,7 +4551,7 @@
}
}
/**
- * Instances of the class `VariableElementImpl` implement a `VariableElement`.
+ * Instances of the class {@code VariableElementImpl} implement a {@code VariableElement}.
* @coverage dart.engine.element
*/
abstract class VariableElementImpl extends ElementImpl implements VariableElement {
@@ -4656,7 +4562,7 @@
Type2 _type;
/**
- * A synthetic function representing this variable's initializer, or `null` if this variable
+ * A synthetic function representing this variable's initializer, or {@code null} if this variable
* does not have an initializer.
*/
FunctionElement _initializer;
@@ -4671,9 +4577,9 @@
* @param name the name of this element
*/
VariableElementImpl.con1(Identifier name) : super.con1(name) {
- _jtd_constructor_232_impl(name);
+ _jtd_constructor_231_impl(name);
}
- _jtd_constructor_232_impl(Identifier name) {
+ _jtd_constructor_231_impl(Identifier name) {
}
/**
@@ -4683,26 +4589,26 @@
* declaration of this element
*/
VariableElementImpl.con2(String name, int nameOffset) : super.con2(name, nameOffset) {
- _jtd_constructor_233_impl(name, nameOffset);
+ _jtd_constructor_232_impl(name, nameOffset);
}
- _jtd_constructor_233_impl(String name, int nameOffset) {
+ _jtd_constructor_232_impl(String name, int nameOffset) {
}
/**
* Return the result of evaluating this variable's initializer as a compile-time constant
- * expression, or `null` if this variable is not a 'const' variable or does not have an
+ * expression, or {@code null} if this variable is not a 'const' variable or does not have an
* initializer.
* @return the result of evaluating this variable's initializer
*/
EvaluationResultImpl get evaluationResult => null;
FunctionElement get initializer => _initializer;
Type2 get type => _type;
- bool get isConst => hasModifier(Modifier.CONST);
- bool get isFinal => hasModifier(Modifier.FINAL);
+ bool isConst() => hasModifier(Modifier.CONST);
+ bool isFinal() => hasModifier(Modifier.FINAL);
/**
* Set whether this variable is const to correspond to the given value.
- * @param isConst `true` if the variable is const
+ * @param isConst {@code true} if the variable is const
*/
void set const3(bool isConst) {
setModifier(Modifier.CONST, isConst);
@@ -4719,7 +4625,7 @@
/**
* Set whether this variable is final to correspond to the given value.
- * @param isFinal `true` if the variable is final
+ * @param isFinal {@code true} if the variable is final
*/
void set final2(bool isFinal) {
setModifier(Modifier.FINAL, isFinal);
@@ -4754,7 +4660,7 @@
}
}
/**
- * Instances of the class `ConstructorMember` represent a constructor element defined in a
+ * Instances of the class {@code ConstructorMember} represent a constructor element defined in a
* parameterized type where the values of the type parameters are known.
*/
class ConstructorMember extends ExecutableMember implements ConstructorElement {
@@ -4775,7 +4681,7 @@
}
FunctionType baseType = baseConstructor.type;
List<Type2> argumentTypes = definingType.typeArguments;
- List<Type2> parameterTypes = definingType.element.type.typeArguments;
+ List<Type2> parameterTypes = TypeVariableTypeImpl.getTypes(definingType.element.typeVariables);
FunctionType substitutedType = baseType.substitute2(argumentTypes, parameterTypes);
if (baseType == substitutedType) {
return baseConstructor;
@@ -4794,9 +4700,8 @@
ConstructorElement get baseElement => super.baseElement as ConstructorElement;
ClassElement get enclosingElement => baseElement.enclosingElement;
ConstructorElement get redirectedConstructor => from(baseElement.redirectedConstructor, definingType);
- bool get isConst => baseElement.isConst;
- bool get isDefaultConstructor => baseElement.isDefaultConstructor;
- bool get isFactory => baseElement.isFactory;
+ bool isConst() => baseElement.isConst();
+ bool isFactory() => baseElement.isFactory();
String toString() {
ConstructorElement baseElement = this.baseElement;
List<ParameterElement> parameters = this.parameters;
@@ -4826,7 +4731,7 @@
InterfaceType get definingType => super.definingType as InterfaceType;
}
/**
- * The abstract class `ExecutableMember` defines the behavior common to members that represent
+ * The abstract class {@code ExecutableMember} defines the behavior common to members that represent
* an executable element defined in a parameterized type where the values of the type parameters are
* known.
*/
@@ -4860,10 +4765,9 @@
}
return parameterizedParameters;
}
- Type2 get returnType => substituteFor(baseElement.returnType);
FunctionType get type => substituteFor(baseElement.type);
- bool get isOperator => baseElement.isOperator;
- bool get isStatic => baseElement.isStatic;
+ bool isOperator() => baseElement.isOperator();
+ bool isStatic() => baseElement.isStatic();
void visitChildren(ElementVisitor<Object> visitor) {
super.visitChildren(visitor);
safelyVisitChildren(baseElement.functions, visitor);
@@ -4873,7 +4777,7 @@
}
}
/**
- * Instances of the class `FieldMember` represent a field element defined in a parameterized
+ * Instances of the class {@code FieldMember} represent a field element defined in a parameterized
* type where the values of the type parameters are known.
*/
class FieldMember extends VariableMember implements FieldElement {
@@ -4897,7 +4801,7 @@
return baseField;
}
List<Type2> argumentTypes = definingType.typeArguments;
- List<Type2> parameterTypes = definingType.element.type.typeArguments;
+ List<Type2> parameterTypes = TypeVariableTypeImpl.getTypes(definingType.element.typeVariables);
Type2 substitutedType = baseType.substitute2(argumentTypes, parameterTypes);
if (baseType == substitutedType) {
return baseField;
@@ -4917,11 +4821,11 @@
ClassElement get enclosingElement => baseElement.enclosingElement;
PropertyAccessorElement get getter => PropertyAccessorMember.from(baseElement.getter, definingType);
PropertyAccessorElement get setter => PropertyAccessorMember.from(baseElement.setter, definingType);
- bool get isStatic => baseElement.isStatic;
+ bool isStatic() => baseElement.isStatic();
InterfaceType get definingType => super.definingType as InterfaceType;
}
/**
- * The abstract class `Member` defines the behavior common to elements that represent members
+ * The abstract class {@code Member} defines the behavior common to elements that represent members
* of parameterized types.
*/
abstract class Member implements Element {
@@ -4963,7 +4867,7 @@
int get nameOffset => _baseElement.nameOffset;
Source get source => _baseElement.source;
bool isAccessibleIn(LibraryElement library) => _baseElement.isAccessibleIn(library);
- bool get isSynthetic => _baseElement.isSynthetic;
+ bool isSynthetic() => _baseElement.isSynthetic();
void visitChildren(ElementVisitor<Object> visitor) {
}
@@ -4974,7 +4878,7 @@
ParameterizedType get definingType => _definingType;
/**
- * If the given child is not `null`, use the given visitor to visit it.
+ * If the given child is not {@code null}, use the given visitor to visit it.
* @param child the child to be visited
* @param visitor the visitor to be used to visit the child
*/
@@ -5025,7 +4929,7 @@
}
}
/**
- * Instances of the class `MethodMember` represent a method element defined in a parameterized
+ * Instances of the class {@code MethodMember} represent a method element defined in a parameterized
* type where the values of the type parameters are known.
*/
class MethodMember extends ExecutableMember implements MethodElement {
@@ -5046,7 +4950,7 @@
}
FunctionType baseType = baseMethod.type;
List<Type2> argumentTypes = definingType.typeArguments;
- List<Type2> parameterTypes = definingType.element.type.typeArguments;
+ List<Type2> parameterTypes = TypeVariableTypeImpl.getTypes(definingType.element.typeVariables);
FunctionType substitutedType = baseType.substitute2(argumentTypes, parameterTypes);
if (baseType == substitutedType) {
return baseMethod;
@@ -5064,7 +4968,7 @@
accept(ElementVisitor visitor) => visitor.visitMethodElement(this);
MethodElement get baseElement => super.baseElement as MethodElement;
ClassElement get enclosingElement => baseElement.enclosingElement;
- bool get isAbstract => baseElement.isAbstract;
+ bool isAbstract() => baseElement.isAbstract();
String toString() {
MethodElement baseElement = this.baseElement;
List<ParameterElement> parameters = this.parameters;
@@ -5090,7 +4994,7 @@
}
}
/**
- * Instances of the class `ParameterMember` represent a parameter element defined in a
+ * Instances of the class {@code ParameterMember} represent a parameter element defined in a
* parameterized type where the values of the type parameters are known.
*/
class ParameterMember extends VariableMember implements ParameterElement {
@@ -5159,7 +5063,7 @@
return parameterizedParameters;
}
SourceRange get visibleRange => baseElement.visibleRange;
- bool get isInitializingFormal => baseElement.isInitializingFormal;
+ bool isInitializingFormal() => baseElement.isInitializingFormal();
String toString() {
ParameterElement baseElement = this.baseElement;
String left = "";
@@ -5188,7 +5092,7 @@
}
}
/**
- * Instances of the class `PropertyAccessorMember` represent a property accessor element
+ * Instances of the class {@code PropertyAccessorMember} represent a property accessor element
* defined in a parameterized type where the values of the type parameters are known.
*/
class PropertyAccessorMember extends ExecutableMember implements PropertyAccessorElement {
@@ -5209,7 +5113,7 @@
}
FunctionType baseType = baseAccessor.type;
List<Type2> argumentTypes = definingType.typeArguments;
- List<Type2> parameterTypes = definingType.element.type.typeArguments;
+ List<Type2> parameterTypes = TypeVariableTypeImpl.getTypes(definingType.element.typeVariables);
FunctionType substitutedType = baseType.substitute2(argumentTypes, parameterTypes);
if (baseType == substitutedType) {
return baseAccessor;
@@ -5237,13 +5141,13 @@
}
return variable;
}
- bool get isAbstract => baseElement.isAbstract;
- bool get isGetter => baseElement.isGetter;
- bool get isSetter => baseElement.isSetter;
+ bool isAbstract() => baseElement.isAbstract();
+ bool isGetter() => baseElement.isGetter();
+ bool isSetter() => baseElement.isSetter();
InterfaceType get definingType => super.definingType as InterfaceType;
}
/**
- * The abstract class `VariableMember` defines the behavior common to members that represent a
+ * The abstract class {@code VariableMember} defines the behavior common to members that represent a
* variable element defined in a parameterized type where the values of the type parameters are
* known.
*/
@@ -5262,15 +5166,38 @@
throw new UnsupportedOperationException();
}
Type2 get type => substituteFor(baseElement.type);
- bool get isConst => baseElement.isConst;
- bool get isFinal => baseElement.isFinal;
+ bool isConst() => baseElement.isConst();
+ bool isFinal() => baseElement.isFinal();
void visitChildren(ElementVisitor<Object> visitor) {
super.visitChildren(visitor);
safelyVisitChild(baseElement.initializer, visitor);
}
}
/**
- * The unique instance of the class `BottomTypeImpl` implements the type `bottom`.
+ * Instances of the class {@code AnonymousFunctionTypeImpl} extend the behavior of{@link FunctionTypeImpl} to support anonymous function types created for function typed
+ * parameters.
+ * @coverage dart.engine.type
+ */
+class AnonymousFunctionTypeImpl extends FunctionTypeImpl {
+
+ /**
+ * An array of parameters elements of this type of function.
+ */
+ List<ParameterElement> _baseParameters = ParameterElementImpl.EMPTY_ARRAY;
+ AnonymousFunctionTypeImpl() : super.con2((null as FunctionTypeAliasElement)) {
+ }
+
+ /**
+ * Sets the parameters elements of this type of function.
+ * @param parameters the parameters elements of this type of function
+ */
+ void set baseParameters(List<ParameterElement> parameters) {
+ this._baseParameters = parameters;
+ }
+ List<ParameterElement> get baseParameters => _baseParameters;
+}
+/**
+ * The unique instance of the class {@code BottomTypeImpl} implements the type {@code bottom}.
* @coverage dart.engine.type
*/
class BottomTypeImpl extends TypeImpl {
@@ -5298,7 +5225,7 @@
BottomTypeImpl substitute2(List<Type2> argumentTypes, List<Type2> parameterTypes) => this;
}
/**
- * The unique instance of the class `DynamicTypeImpl` implements the type `dynamic`.
+ * The unique instance of the class {@code DynamicTypeImpl} implements the type {@code dynamic}.
* @coverage dart.engine.type
*/
class DynamicTypeImpl extends TypeImpl {
@@ -5321,26 +5248,26 @@
((element as DynamicElementImpl)).type = this;
}
bool operator ==(Object object) => object is DynamicTypeImpl;
- bool get isDynamic => true;
+ bool isDynamic() => true;
bool isMoreSpecificThan(Type2 type) => false;
bool isSubtypeOf(Type2 type) => identical(this, type);
bool isSupertypeOf(Type2 type) => true;
DynamicTypeImpl substitute2(List<Type2> argumentTypes, List<Type2> parameterTypes) => this;
}
/**
- * Instances of the class `FunctionTypeImpl` defines the behavior common to objects
+ * Instances of the class {@code FunctionTypeImpl} defines the behavior common to objects
* representing the type of a function, method, constructor, getter, or setter.
* @coverage dart.engine.type
*/
class FunctionTypeImpl extends TypeImpl implements FunctionType {
/**
- * Return `true` if all of the name/type pairs in the first map are equal to the
+ * Return {@code true} if all of the name/type pairs in the first map are equal to the
* corresponding name/type pairs in the second map. The maps are expected to iterate over their
* entries in the same order in which those entries were added to the map.
* @param firstTypes the first map of name/type pairs being compared
* @param secondTypes the second map of name/type pairs being compared
- * @return `true` if all of the name/type pairs in the first map are equal to the
+ * @return {@code true} if all of the name/type pairs in the first map are equal to the
* corresponding name/type pairs in the second map
*/
static bool equals2(Map<String, Type2> firstTypes, Map<String, Type2> secondTypes) {
@@ -5404,6 +5331,11 @@
Map<String, Type2> _namedParameterTypes = new Map();
/**
+ * The type of object returned by this type of function.
+ */
+ Type2 _returnType = VoidTypeImpl.instance;
+
+ /**
* Initialize a newly created function type to be declared by the given element and to have the
* given name.
* @param element the element representing the declaration of the function type
@@ -5429,12 +5361,11 @@
return false;
}
FunctionTypeImpl otherType = object as FunctionTypeImpl;
- return element == otherType.element && JavaArrays.equals(_normalParameterTypes, otherType._normalParameterTypes) && JavaArrays.equals(_optionalParameterTypes, otherType._optionalParameterTypes) && equals2(_namedParameterTypes, otherType._namedParameterTypes) && returnType == otherType.returnType;
+ return element == otherType.element && JavaArrays.equals(_normalParameterTypes, otherType._normalParameterTypes) && JavaArrays.equals(_optionalParameterTypes, otherType._optionalParameterTypes) && equals2(_namedParameterTypes, otherType._namedParameterTypes) && _returnType == otherType._returnType;
}
String get displayName {
String name = this.name;
if (name == null) {
- Type2 returnType = this.returnType;
JavaStringBuilder builder = new JavaStringBuilder();
builder.append("(");
bool needsComma = false;
@@ -5485,10 +5416,10 @@
needsComma = true;
}
builder.append(") -> ");
- if (returnType == null) {
+ if (_returnType == null) {
builder.append("null");
} else {
- builder.append(returnType.displayName);
+ builder.append(_returnType.displayName);
}
name = builder.toString();
}
@@ -5509,20 +5440,13 @@
}
return specializedParameters;
}
- Type2 get returnType {
- Type2 baseReturnType = this.baseReturnType;
- return baseReturnType.substitute2(_typeArguments, TypeVariableTypeImpl.getTypes(typeVariables));
- }
+ Type2 get returnType => _returnType;
List<Type2> get typeArguments => _typeArguments;
List<TypeVariableElement> get typeVariables {
Element element = this.element;
if (element is FunctionTypeAliasElement) {
return ((element as FunctionTypeAliasElement)).typeVariables;
}
- ClassElement definingClass = element.getAncestor(ClassElement);
- if (definingClass != null) {
- return definingClass.typeVariables;
- }
return TypeVariableElementImpl.EMPTY_ARRAY;
}
int get hashCode {
@@ -5535,7 +5459,7 @@
bool isSubtypeOf(Type2 type) {
if (type == null) {
return false;
- } else if (identical(this, type) || type.isDynamic || type.isDartCoreFunction || type.isObject) {
+ } else if (identical(this, type) || type.isDynamic() || type.isDartCoreFunction() || type.isObject()) {
return true;
} else if (type is! FunctionType) {
return false;
@@ -5637,6 +5561,14 @@
}
/**
+ * Set the type of object returned by this type of function to the given type.
+ * @param returnType the type of object returned by this type of function
+ */
+ void set returnType(Type2 returnType2) {
+ this._returnType = returnType2;
+ }
+
+ /**
* Set the actual types of the type arguments to the given types.
* @param typeArguments the actual types of the type arguments
*/
@@ -5653,14 +5585,14 @@
}
Element element = this.element;
FunctionTypeImpl newType = (element is ExecutableElement) ? new FunctionTypeImpl.con1((element as ExecutableElement)) : new FunctionTypeImpl.con2((element as FunctionTypeAliasElement));
+ newType.returnType = _returnType.substitute2(argumentTypes, parameterTypes);
newType.normalParameterTypes = TypeImpl.substitute(_normalParameterTypes, argumentTypes, parameterTypes);
newType.optionalParameterTypes = TypeImpl.substitute(_optionalParameterTypes, argumentTypes, parameterTypes);
newType._namedParameterTypes = substitute3(_namedParameterTypes, argumentTypes, parameterTypes);
- newType.typeArguments = TypeImpl.substitute(_typeArguments, argumentTypes, parameterTypes);
+ newType.typeArguments = argumentTypes;
return newType;
}
void appendTo(JavaStringBuilder builder) {
- Type2 returnType = this.returnType;
builder.append("(");
bool needsComma = false;
if (_normalParameterTypes.length > 0) {
@@ -5710,15 +5642,15 @@
needsComma = true;
}
builder.append(") -> ");
- if (returnType == null) {
+ if (_returnType == null) {
builder.append("null");
} else {
- ((returnType as TypeImpl)).appendTo(builder);
+ ((_returnType as TypeImpl)).appendTo(builder);
}
}
/**
- * @return the base parameter elements of this function element, not `null`.
+ * @return the base parameter elements of this function element, not {@code null}.
*/
List<ParameterElement> get baseParameters {
Element element = this.element;
@@ -5728,22 +5660,9 @@
return ((element as FunctionTypeAliasElement)).parameters;
}
}
-
- /**
- * Return the return type defined by this function's element.
- * @return the return type defined by this function's element
- */
- Type2 get baseReturnType {
- Element element = this.element;
- if (element is ExecutableElement) {
- return ((element as ExecutableElement)).returnType;
- } else {
- return ((element as FunctionTypeAliasElement)).returnType;
- }
- }
}
/**
- * Instances of the class `InterfaceTypeImpl` defines the behavior common to objects
+ * Instances of the class {@code InterfaceTypeImpl} defines the behavior common to objects
* representing the type introduced by either a class or an interface, or a reference to such a
* type.
* @coverage dart.engine.type
@@ -5756,25 +5675,25 @@
static List<InterfaceType> EMPTY_ARRAY = new List<InterfaceType>(0);
/**
- * This method computes the longest inheritance path from some passed [Type] to Object.
- * @param type the [Type] to compute the longest inheritance path of from the passed[Type] to Object
+ * This method computes the longest inheritance path from some passed {@link Type} to Object.
+ * @param type the {@link Type} to compute the longest inheritance path of from the passed{@link Type} to Object
* @return the computed longest inheritance path to Object
* @see InterfaceType#getLeastUpperBound(Type)
*/
static int computeLongestInheritancePathToObject(InterfaceType type) => computeLongestInheritancePathToObject2(type, 0, new Set<ClassElement>());
/**
- * Returns the set of all superinterfaces of the passed [Type].
- * @param type the [Type] to compute the set of superinterfaces of
- * @return the [Set] of superinterfaces of the passed [Type]
+ * Returns the set of all superinterfaces of the passed {@link Type}.
+ * @param type the {@link Type} to compute the set of superinterfaces of
+ * @return the {@link Set} of superinterfaces of the passed {@link Type}
* @see #getLeastUpperBound(Type)
*/
static Set<InterfaceType> computeSuperinterfaceSet(InterfaceType type) => computeSuperinterfaceSet2(type, new Set<InterfaceType>());
/**
- * This method computes the longest inheritance path from some passed [Type] to Object. This
- * method calls itself recursively, callers should use the public method[computeLongestInheritancePathToObject].
- * @param type the [Type] to compute the longest inheritance path of from the passed[Type] to Object
+ * This method computes the longest inheritance path from some passed {@link Type} to Object. This
+ * method calls itself recursively, callers should use the public method{@link #computeLongestInheritancePathToObject(Type)}.
+ * @param type the {@link Type} to compute the longest inheritance path of from the passed{@link Type} to Object
* @param depth a field used recursively
* @param visitedClasses the classes that have already been visited
* @return the computed longest inheritance path to Object
@@ -5811,11 +5730,11 @@
}
/**
- * Returns the set of all superinterfaces of the passed [Type]. This is a recursive method,
- * callers should call the public [computeSuperinterfaceSet].
- * @param type the [Type] to compute the set of superinterfaces of
- * @param set a [HashSet] used recursively by this method
- * @return the [Set] of superinterfaces of the passed [Type]
+ * Returns the set of all superinterfaces of the passed {@link Type}. This is a recursive method,
+ * callers should call the public {@link #computeSuperinterfaceSet(Type)}.
+ * @param type the {@link Type} to compute the set of superinterfaces of
+ * @param set a {@link HashSet} used recursively by this method
+ * @return the {@link Set} of superinterfaces of the passed {@link Type}
* @see #computeSuperinterfaceSet(Type)
* @see #getLeastUpperBound(Type)
*/
@@ -5929,28 +5848,19 @@
InterfaceTypeImpl otherType = object as InterfaceTypeImpl;
return element == otherType.element && JavaArrays.equals(_typeArguments, otherType._typeArguments);
}
- List<PropertyAccessorElement> get accessors {
- List<PropertyAccessorElement> accessors = element.accessors;
- List<PropertyAccessorElement> members = new List<PropertyAccessorElement>(accessors.length);
- for (int i = 0; i < accessors.length; i++) {
- members[i] = PropertyAccessorMember.from(accessors[i], this);
- }
- return members;
- }
ClassElement get element => super.element as ClassElement;
PropertyAccessorElement getGetter(String getterName) => PropertyAccessorMember.from(((element as ClassElementImpl)).getGetter(getterName), this);
List<InterfaceType> get interfaces {
ClassElement classElement = element;
List<InterfaceType> interfaces = classElement.interfaces;
List<TypeVariableElement> typeVariables = classElement.typeVariables;
- List<Type2> parameterTypes = classElement.type.typeArguments;
if (typeVariables.length == 0) {
return interfaces;
}
int count = interfaces.length;
List<InterfaceType> typedInterfaces = new List<InterfaceType>(count);
for (int i = 0; i < count; i++) {
- typedInterfaces[i] = interfaces[i].substitute2(_typeArguments, parameterTypes);
+ typedInterfaces[i] = interfaces[i].substitute2(_typeArguments, TypeVariableTypeImpl.getTypes(typeVariables));
}
return typedInterfaces;
}
@@ -5996,26 +5906,17 @@
return null;
}
MethodElement getMethod(String methodName) => MethodMember.from(((element as ClassElementImpl)).getMethod(methodName), this);
- List<MethodElement> get methods {
- List<MethodElement> methods = element.methods;
- List<MethodElement> members = new List<MethodElement>(methods.length);
- for (int i = 0; i < methods.length; i++) {
- members[i] = MethodMember.from(methods[i], this);
- }
- return members;
- }
List<InterfaceType> get mixins {
ClassElement classElement = element;
List<InterfaceType> mixins = classElement.mixins;
List<TypeVariableElement> typeVariables = classElement.typeVariables;
- List<Type2> parameterTypes = classElement.type.typeArguments;
if (typeVariables.length == 0) {
return mixins;
}
int count = mixins.length;
List<InterfaceType> typedMixins = new List<InterfaceType>(count);
for (int i = 0; i < count; i++) {
- typedMixins[i] = mixins[i].substitute2(_typeArguments, parameterTypes);
+ typedMixins[i] = mixins[i].substitute2(_typeArguments, TypeVariableTypeImpl.getTypes(typeVariables));
}
return typedMixins;
}
@@ -6026,7 +5927,7 @@
if (supertype == null) {
return null;
}
- return supertype.substitute2(_typeArguments, classElement.type.typeArguments);
+ return supertype.substitute2(_typeArguments, TypeVariableTypeImpl.getTypes(classElement.typeVariables));
}
List<Type2> get typeArguments => _typeArguments;
List<TypeVariableElement> get typeVariables => element.typeVariables;
@@ -6037,12 +5938,12 @@
}
return element.hashCode;
}
- bool get isDartCoreFunction {
+ bool isDartCoreFunction() {
ClassElement element = this.element;
if (element == null) {
return false;
}
- return element.name == "Function" && element.library.isDartCore;
+ return element.name == "Function" && element.library.isDartCore();
}
bool isDirectSupertypeOf(InterfaceType type) {
ClassElement i = element;
@@ -6075,7 +5976,7 @@
}
return isMoreSpecificThan2((type as InterfaceType), new Set<ClassElement>());
}
- bool get isObject => element.supertype == null;
+ bool isObject() => element.supertype == null;
bool isSubtypeOf(Type2 type2) {
if (identical(type2, DynamicTypeImpl.instance)) {
return true;
@@ -6286,15 +6187,15 @@
}
return false;
}
- bool isSubtypeOf2(InterfaceType type2, Set<ClassElement> visitedClasses) {
+ bool isSubtypeOf2(InterfaceType type, Set<ClassElement> visitedClasses) {
InterfaceType typeT = this;
- InterfaceType typeS = type2;
+ InterfaceType typeS = type;
ClassElement elementT = element;
if (elementT == null || visitedClasses.contains(elementT)) {
return false;
}
javaSetAdd(visitedClasses, elementT);
- typeT = substitute2(_typeArguments, elementT.type.typeArguments);
+ typeT = substitute2(_typeArguments, TypeVariableTypeImpl.getTypes(elementT.typeVariables));
if (typeT == typeS) {
return true;
} else if (elementT == typeS.element) {
@@ -6309,7 +6210,7 @@
}
}
return true;
- } else if (typeS.isDartCoreFunction && elementT.getMethod("call") != null) {
+ } else if (typeS.isDartCoreFunction() && elementT.getMethod("call") != null) {
return true;
}
InterfaceType supertype = elementT.supertype;
@@ -6332,7 +6233,7 @@
}
}
/**
- * The abstract class `TypeImpl` implements the behavior common to objects representing the
+ * The abstract class {@code TypeImpl} implements the behavior common to objects representing the
* declared type of elements in the element model.
* @coverage dart.engine.type
*/
@@ -6359,13 +6260,13 @@
}
/**
- * The element representing the declaration of this type, or `null` if the type has not, or
+ * The element representing the declaration of this type, or {@code null} if the type has not, or
* cannot, be associated with an element.
*/
Element _element;
/**
- * The name of this type, or `null` if the type does not have a name.
+ * The name of this type, or {@code null} if the type does not have a name.
*/
String _name;
@@ -6388,12 +6289,12 @@
Type2 getLeastUpperBound(Type2 type) => null;
String get name => _name;
bool isAssignableTo(Type2 type) => this.isSubtypeOf(type) || type.isSubtypeOf(this);
- bool get isDartCoreFunction => false;
- bool get isDynamic => false;
+ bool isDartCoreFunction() => false;
+ bool isDynamic() => false;
bool isMoreSpecificThan(Type2 type) => false;
- bool get isObject => false;
+ bool isObject() => false;
bool isSupertypeOf(Type2 type) => type.isSubtypeOf(this);
- bool get isVoid => false;
+ bool isVoid() => false;
String toString() {
JavaStringBuilder builder = new JavaStringBuilder();
appendTo(builder);
@@ -6413,18 +6314,13 @@
}
}
/**
- * Instances of the class `TypeVariableTypeImpl` defines the behavior of objects representing
+ * Instances of the class {@code TypeVariableTypeImpl} defines the behavior of objects representing
* the type introduced by a type variable.
* @coverage dart.engine.type
*/
class TypeVariableTypeImpl extends TypeImpl implements TypeVariableType {
/**
- * An empty array of type variable types.
- */
- static List<TypeVariableType> EMPTY_ARRAY = new List<TypeVariableType>(0);
-
- /**
* Return an array containing the type variable types defined by the given array of type variable
* elements.
* @param typeVariables the type variable elements defining the type variable types to be returned
@@ -6432,9 +6328,6 @@
*/
static List<TypeVariableType> getTypes(List<TypeVariableElement> typeVariables) {
int count = typeVariables.length;
- if (count == 0) {
- return EMPTY_ARRAY;
- }
List<TypeVariableType> types = new List<TypeVariableType>(count);
for (int i = 0; i < count; i++) {
types[i] = typeVariables[i].type;
@@ -6468,7 +6361,7 @@
}
}
/**
- * The unique instance of the class `VoidTypeImpl` implements the type `void`.
+ * The unique instance of the class {@code VoidTypeImpl} implements the type {@code void}.
* @coverage dart.engine.type
*/
class VoidTypeImpl extends TypeImpl implements VoidType {
@@ -6491,20 +6384,20 @@
}
bool operator ==(Object object) => identical(object, this);
bool isSubtypeOf(Type2 type) => identical(type, this) || identical(type, DynamicTypeImpl.instance);
- bool get isVoid => true;
+ bool isVoid() => true;
VoidTypeImpl substitute2(List<Type2> argumentTypes, List<Type2> parameterTypes) => this;
}
/**
- * The interface `FunctionType` defines the behavior common to objects representing the type
+ * The interface {@code FunctionType} defines the behavior common to objects representing the type
* of a function, method, constructor, getter, or setter. Function types come in three variations:
* <ol>
- * * The types of functions that only have required parameters. These have the general form
- * <i>(T<sub>1</sub>, …, T<sub>n</sub>) → T</i>.
- * * The types of functions with optional positional parameters. These have the general form
+ * <li>The types of functions that only have required parameters. These have the general form
+ * <i>(T<sub>1</sub>, …, T<sub>n</sub>) → T</i>.</li>
+ * <li>The types of functions with optional positional parameters. These have the general form
* <i>(T<sub>1</sub>, …, T<sub>n</sub>, \[T<sub>n+1</sub>, …, T<sub>n+k</sub>\]) →
- * T</i>.
- * * The types of functions with named parameters. These have the general form <i>(T<sub>1</sub>,
- * …, T<sub>n</sub>, {T<sub>x1</sub> x1, …, T<sub>xk</sub> xk}) → T</i>.
+ * T</i>.</li>
+ * <li>The types of functions with named parameters. These have the general form <i>(T<sub>1</sub>,
+ * …, T<sub>n</sub>, {T<sub>x1</sub> x1, …, T<sub>xk</sub> xk}) → T</i>.</li>
* </ol>
* @coverage dart.engine.type
*/
@@ -6549,53 +6442,53 @@
Type2 get returnType;
/**
- * Return `true` if this type is a subtype of the given type.
- *
+ * Return {@code true} if this type is a subtype of the given type.
+ * <p>
* A function type <i>(T<sub>1</sub>, …, T<sub>n</sub>) → T</i> is a subtype of the
* function type <i>(S<sub>1</sub>, …, S<sub>n</sub>) → S</i>, if all of the following
* conditions are met:
- *
- * * Either
- *
- * * <i>S</i> is void, or
- * * <i>T ⇔ S</i>.
- *
- *
- * * For all <i>i</i>, 1 <= <i>i</i> <= <i>n</i>, <i>T<sub>i</sub> ⇔ S<sub>i</sub></i>.
- *
+ * <ul>
+ * <li>Either
+ * <ul>
+ * <li><i>S</i> is void, or</li>
+ * <li><i>T ⇔ S</i>.</li>
+ * </ul>
+ * </li>
+ * <li>For all <i>i</i>, 1 <= <i>i</i> <= <i>n</i>, <i>T<sub>i</sub> ⇔ S<sub>i</sub></i>.</li>
+ * </ul>
* A function type <i>(T<sub>1</sub>, …, T<sub>n</sub>, \[T<sub>n+1</sub>, …,
* T<sub>n+k</sub>\]) → T</i> is a subtype of the function type <i>(S<sub>1</sub>, …,
* S<sub>n</sub>, \[S<sub>n+1</sub>, …, S<sub>n+m</sub>\]) → S</i>, if all of the
* following conditions are met:
- *
- * * Either
- *
- * * <i>S</i> is void, or
- * * <i>T ⇔ S</i>.
- *
- *
- * * <i>k</i> >= <i>m</i> and for all <i>i</i>, 1 <= <i>i</i> <= <i>n+m</i>, <i>T<sub>i</sub>
- * ⇔ S<sub>i</sub></i>.
- *
+ * <ul>
+ * <li>Either
+ * <ul>
+ * <li><i>S</i> is void, or</li>
+ * <li><i>T ⇔ S</i>.</li>
+ * </ul>
+ * </li>
+ * <li><i>k</i> >= <i>m</i> and for all <i>i</i>, 1 <= <i>i</i> <= <i>n+m</i>, <i>T<sub>i</sub>
+ * ⇔ S<sub>i</sub></i>.</li>
+ * </ul>
* A function type <i>(T<sub>1</sub>, …, T<sub>n</sub>, {T<sub>x1</sub> x1, …,
* T<sub>xk</sub> xk}) → T</i> is a subtype of the function type <i>(S<sub>1</sub>, …,
* S<sub>n</sub>, {S<sub>y1</sub> y1, …, S<sub>ym</sub> ym}) → S</i>, if all of the
* following conditions are met:
- *
- * * Either
- *
- * * <i>S</i> is void,
- * * or <i>T ⇔ S</i>.
- *
- *
- * * For all <i>i</i>, 1 <= <i>i</i> <= <i>n</i>, <i>T<sub>i</sub> ⇔ S<sub>i</sub></i>.
- * * <i>k</i> >= <i>m</i> and <i>y<sub>i</sub></i> in <i>{x<sub>1</sub>, …,
- * x<sub>k</sub>}</i>, 1 <= <i>i</i> <= <i>m</i>.
- * * For all <i>y<sub>i</sub></i> in <i>{y<sub>1</sub>, …, y<sub>m</sub>}</i>,
- * <i>y<sub>i</sub> = x<sub>j</sub> => Tj ⇔ Si</i>.
- *
+ * <ul>
+ * <li>Either
+ * <ul>
+ * <li><i>S</i> is void,</li>
+ * <li>or <i>T ⇔ S</i>.</li>
+ * </ul>
+ * </li>
+ * <li>For all <i>i</i>, 1 <= <i>i</i> <= <i>n</i>, <i>T<sub>i</sub> ⇔ S<sub>i</sub></i>.</li>
+ * <li><i>k</i> >= <i>m</i> and <i>y<sub>i</sub></i> in <i>{x<sub>1</sub>, …,
+ * x<sub>k</sub>}</i>, 1 <= <i>i</i> <= <i>m</i>.</li>
+ * <li>For all <i>y<sub>i</sub></i> in <i>{y<sub>1</sub>, …, y<sub>m</sub>}</i>,
+ * <i>y<sub>i</sub> = x<sub>j</sub> => Tj ⇔ Si</i>.</li>
+ * </ul>
* In addition, the following subtype rules apply:
- *
+ * <p>
* <i>(T<sub>1</sub>, …, T<sub>n</sub>, \[\]) → T <: (T<sub>1</sub>, …,
* T<sub>n</sub>) → T.</i><br>
* <i>(T<sub>1</sub>, …, T<sub>n</sub>) → T <: (T<sub>1</sub>, …,
@@ -6604,18 +6497,18 @@
* T<sub>n</sub>) → T.</i><br>
* <i>(T<sub>1</sub>, …, T<sub>n</sub>) → T <: (T<sub>1</sub>, …,
* T<sub>n</sub>, \[\]) → T.</i>
- *
- * All functions implement the class `Function`. However not all function types are a
- * subtype of `Function`. If an interface type <i>I</i> includes a method named`call()`, and the type of `call()` is the function type <i>F</i>, then <i>I</i> is
+ * <p>
+ * All functions implement the class {@code Function}. However not all function types are a
+ * subtype of {@code Function}. If an interface type <i>I</i> includes a method named{@code call()}, and the type of {@code call()} is the function type <i>F</i>, then <i>I</i> is
* considered to be a subtype of <i>F</i>.
* @param type the type being compared with this type
- * @return `true` if this type is a subtype of the given type
+ * @return {@code true} if this type is a subtype of the given type
*/
bool isSubtypeOf(Type2 type);
/**
* Return the type resulting from substituting the given arguments for this type's parameters.
- * This is fully equivalent to `substitute(argumentTypes, getTypeArguments())`.
+ * This is fully equivalent to {@code substitute(argumentTypes, getTypeArguments())}.
* @param argumentTypes the actual type arguments being substituted for the type parameters
* @return the result of performing the substitution
*/
@@ -6623,22 +6516,16 @@
FunctionType substitute2(List<Type2> argumentTypes, List<Type2> parameterTypes);
}
/**
- * The interface `InterfaceType` defines the behavior common to objects representing the type
+ * The interface {@code InterfaceType} defines the behavior common to objects representing the type
* introduced by either a class or an interface, or a reference to such a type.
* @coverage dart.engine.type
*/
abstract class InterfaceType implements ParameterizedType {
-
- /**
- * Return an array containing all of the accessors (getters and setters) declared in this type.
- * @return the accessors declared in this type
- */
- List<PropertyAccessorElement> get accessors;
ClassElement get element;
/**
* Return the element representing the getter with the given name that is declared in this class,
- * or `null` if this class does not declare a getter with the given name.
+ * or {@code null} if this class does not declare a getter with the given name.
* @param getterName the name of the getter to be returned
* @return the getter declared in this class with the given name
*/
@@ -6653,9 +6540,9 @@
List<InterfaceType> get interfaces;
/**
- * Return the least upper bound of this type and the given type, or `null` if there is no
+ * Return the least upper bound of this type and the given type, or {@code null} if there is no
* least upper bound.
- *
+ * <p>
* Given two interfaces <i>I</i> and <i>J</i>, let <i>S<sub>I</sub></i> be the set of
* superinterfaces of <i>I<i>, let <i>S<sub>J</sub></i> be the set of superinterfaces of <i>J</i>
* and let <i>S = (I ∪ S<sub>I</sub>) ∩ (J ∪ S<sub>J</sub>)</i>. Furthermore, we
@@ -6671,19 +6558,13 @@
/**
* Return the element representing the method with the given name that is declared in this class,
- * or `null` if this class does not declare a method with the given name.
+ * or {@code null} if this class does not declare a method with the given name.
* @param methodName the name of the method to be returned
* @return the method declared in this class with the given name
*/
MethodElement getMethod(String methodName);
/**
- * Return an array containing all of the methods declared in this type.
- * @return the methods declared in this type
- */
- List<MethodElement> get methods;
-
- /**
* Return an array containing all of the mixins that are applied to the class being extended in
* order to derive the superclass of this class. Note that this is <b>not</b>, in general,
* equivalent to getting the mixins from this type's element because the types returned by this
@@ -6694,7 +6575,7 @@
/**
* Return the element representing the setter with the given name that is declared in this class,
- * or `null` if this class does not declare a setter with the given name.
+ * or {@code null} if this class does not declare a setter with the given name.
* @param setterName the name of the setter to be returned
* @return the setter declared in this class with the given name
*/
@@ -6710,55 +6591,55 @@
InterfaceType get superclass;
/**
- * Return `true` if this type is a direct supertype of the given type. The implicit
+ * Return {@code true} if this type is a direct supertype of the given type. The implicit
* interface of class <i>I</i> is a direct supertype of the implicit interface of class <i>J</i>
* iff:
- *
- * * <i>I</i> is Object, and <i>J</i> has no extends clause.
- * * <i>I</i> is listed in the extends clause of <i>J</i>.
- * * <i>I</i> is listed in the implements clause of <i>J</i>.
- * * <i>I</i> is listed in the with clause of <i>J</i>.
- * * <i>J</i> is a mixin application of the mixin of <i>I</i>.
- *
+ * <ul>
+ * <li><i>I</i> is Object, and <i>J</i> has no extends clause.</li>
+ * <li><i>I</i> is listed in the extends clause of <i>J</i>.</li>
+ * <li><i>I</i> is listed in the implements clause of <i>J</i>.</li>
+ * <li><i>I</i> is listed in the with clause of <i>J</i>.</li>
+ * <li><i>J</i> is a mixin application of the mixin of <i>I</i>.</li>
+ * </ul>
* @param type the type being compared with this type
- * @return `true` if this type is a direct supertype of the given type
+ * @return {@code true} if this type is a direct supertype of the given type
*/
bool isDirectSupertypeOf(InterfaceType type);
/**
- * Return `true` if this type is more specific than the given type. An interface type
+ * Return {@code true} if this type is more specific than the given type. An interface type
* <i>T</i> is more specific than an interface type <i>S</i>, written <i>T « S</i>, if one
* of the following conditions is met:
- *
- * * Reflexivity: <i>T</i> is <i>S</i>.
- * * <i>T</i> is bottom.
- * * <i>S</i> is dynamic.
- * * Direct supertype: <i>S</i> is a direct supertype of <i>T</i>.
- * * <i>T</i> is a type variable and <i>S</i> is the upper bound of <i>T</i>.
- * * Covariance: <i>T</i> is of the form <i>I<T<sub>1</sub>, …, T<sub>n</sub>></i>
+ * <ul>
+ * <li>Reflexivity: <i>T</i> is <i>S</i>.
+ * <li><i>T</i> is bottom.
+ * <li><i>S</i> is dynamic.
+ * <li>Direct supertype: <i>S</i> is a direct supertype of <i>T</i>.
+ * <li><i>T</i> is a type variable and <i>S</i> is the upper bound of <i>T</i>.
+ * <li>Covariance: <i>T</i> is of the form <i>I<T<sub>1</sub>, …, T<sub>n</sub>></i>
* and S</i> is of the form <i>I<S<sub>1</sub>, …, S<sub>n</sub>></i> and
* <i>T<sub>i</sub> « S<sub>i</sub></i>, <i>1 <= i <= n</i>.
- * * Transitivity: <i>T « U</i> and <i>U « S</i>.
- *
+ * <li>Transitivity: <i>T « U</i> and <i>U « S</i>.
+ * </ul>
* @param type the type being compared with this type
- * @return `true` if this type is more specific than the given type
+ * @return {@code true} if this type is more specific than the given type
*/
bool isMoreSpecificThan(Type2 type);
/**
- * Return `true` if this type is a subtype of the given type. An interface type <i>T</i> is
+ * Return {@code true} if this type is a subtype of the given type. An interface type <i>T</i> is
* a subtype of an interface type <i>S</i>, written <i>T</i> <: <i>S</i>, iff
* <i>\[bottom/dynamic\]T</i> « <i>S</i> (<i>T</i> is more specific than <i>S</i>). If an
* interface type <i>I</i> includes a method named <i>call()</i>, and the type of <i>call()</i> is
* the function type <i>F</i>, then <i>I</i> is considered to be a subtype of <i>F</i>.
* @param type the type being compared with this type
- * @return `true` if this type is a subtype of the given type
+ * @return {@code true} if this type is a subtype of the given type
*/
bool isSubtypeOf(Type2 type);
/**
* Return the element representing the constructor that results from looking up the given
- * constructor in this class with respect to the given library, or `null` if the look up
+ * constructor in this class with respect to the given library, or {@code null} if the look up
* fails. The behavior of this method is defined by the Dart Language Specification in section
* 12.11.1: <blockquote>If <i>e</i> is of the form <b>new</b> <i>T.id()</i> then let <i>q<i> be
* the constructor <i>T.id</i>, otherwise let <i>q<i> be the constructor <i>T<i>. Otherwise, if
@@ -6772,17 +6653,17 @@
/**
* Return the element representing the getter that results from looking up the given getter in
- * this class with respect to the given library, or `null` if the look up fails. The
+ * this class with respect to the given library, or {@code null} if the look up fails. The
* behavior of this method is defined by the Dart Language Specification in section 12.15.1:
* <blockquote>The result of looking up getter (respectively setter) <i>m</i> in class <i>C</i>
* with respect to library <i>L</i> is:
- *
- * * If <i>C</i> declares an instance getter (respectively setter) named <i>m</i> that is
+ * <ul>
+ * <li>If <i>C</i> declares an instance getter (respectively setter) named <i>m</i> that is
* accessible to <i>L</i>, then that getter (respectively setter) is the result of the lookup.
* Otherwise, if <i>C</i> has a superclass <i>S</i>, then the result of the lookup is the result
* of looking up getter (respectively setter) <i>m</i> in <i>S</i> with respect to <i>L</i>.
- * Otherwise, we say that the lookup has failed.
- *
+ * Otherwise, we say that the lookup has failed.</li>
+ * </ul>
* </blockquote>
* @param getterName the name of the getter being looked up
* @param library the library with respect to which the lookup is being performed
@@ -6793,17 +6674,17 @@
/**
* Return the element representing the getter that results from looking up the given getter in the
- * superclass of this class with respect to the given library, or `null` if the look up
+ * superclass of this class with respect to the given library, or {@code null} if the look up
* fails. The behavior of this method is defined by the Dart Language Specification in section
* 12.15.1: <blockquote>The result of looking up getter (respectively setter) <i>m</i> in class
* <i>C</i> with respect to library <i>L</i> is:
- *
- * * If <i>C</i> declares an instance getter (respectively setter) named <i>m</i> that is
+ * <ul>
+ * <li>If <i>C</i> declares an instance getter (respectively setter) named <i>m</i> that is
* accessible to <i>L</i>, then that getter (respectively setter) is the result of the lookup.
* Otherwise, if <i>C</i> has a superclass <i>S</i>, then the result of the lookup is the result
* of looking up getter (respectively setter) <i>m</i> in <i>S</i> with respect to <i>L</i>.
- * Otherwise, we say that the lookup has failed.
- *
+ * Otherwise, we say that the lookup has failed.</li>
+ * </ul>
* </blockquote>
* @param getterName the name of the getter being looked up
* @param library the library with respect to which the lookup is being performed
@@ -6814,16 +6695,16 @@
/**
* Return the element representing the method that results from looking up the given method in
- * this class with respect to the given library, or `null` if the look up fails. The
+ * this class with respect to the given library, or {@code null} if the look up fails. The
* behavior of this method is defined by the Dart Language Specification in section 12.15.1:
* <blockquote> The result of looking up method <i>m</i> in class <i>C</i> with respect to library
* <i>L</i> is:
- *
- * * If <i>C</i> declares an instance method named <i>m</i> that is accessible to <i>L</i>, then
+ * <ul>
+ * <li>If <i>C</i> declares an instance method named <i>m</i> that is accessible to <i>L</i>, then
* that method is the result of the lookup. Otherwise, if <i>C</i> has a superclass <i>S</i>, then
* the result of the lookup is the result of looking up method <i>m</i> in <i>S</i> with respect
- * to <i>L</i>. Otherwise, we say that the lookup has failed.
- *
+ * to <i>L</i>. Otherwise, we say that the lookup has failed.</li>
+ * </ul>
* </blockquote>
* @param methodName the name of the method being looked up
* @param library the library with respect to which the lookup is being performed
@@ -6834,16 +6715,16 @@
/**
* Return the element representing the method that results from looking up the given method in the
- * superclass of this class with respect to the given library, or `null` if the look up
+ * superclass of this class with respect to the given library, or {@code null} if the look up
* fails. The behavior of this method is defined by the Dart Language Specification in section
* 12.15.1: <blockquote> The result of looking up method <i>m</i> in class <i>C</i> with respect
* to library <i>L</i> is:
- *
- * * If <i>C</i> declares an instance method named <i>m</i> that is accessible to <i>L</i>, then
+ * <ul>
+ * <li>If <i>C</i> declares an instance method named <i>m</i> that is accessible to <i>L</i>, then
* that method is the result of the lookup. Otherwise, if <i>C</i> has a superclass <i>S</i>, then
* the result of the lookup is the result of looking up method <i>m</i> in <i>S</i> with respect
- * to <i>L</i>. Otherwise, we say that the lookup has failed.
- *
+ * to <i>L</i>. Otherwise, we say that the lookup has failed.</li>
+ * </ul>
* </blockquote>
* @param methodName the name of the method being looked up
* @param library the library with respect to which the lookup is being performed
@@ -6854,17 +6735,17 @@
/**
* Return the element representing the setter that results from looking up the given setter in
- * this class with respect to the given library, or `null` if the look up fails. The
+ * this class with respect to the given library, or {@code null} if the look up fails. The
* behavior of this method is defined by the Dart Language Specification in section 12.16:
* <blockquote> The result of looking up getter (respectively setter) <i>m</i> in class <i>C</i>
* with respect to library <i>L</i> is:
- *
- * * If <i>C</i> declares an instance getter (respectively setter) named <i>m</i> that is
+ * <ul>
+ * <li>If <i>C</i> declares an instance getter (respectively setter) named <i>m</i> that is
* accessible to <i>L</i>, then that getter (respectively setter) is the result of the lookup.
* Otherwise, if <i>C</i> has a superclass <i>S</i>, then the result of the lookup is the result
* of looking up getter (respectively setter) <i>m</i> in <i>S</i> with respect to <i>L</i>.
- * Otherwise, we say that the lookup has failed.
- *
+ * Otherwise, we say that the lookup has failed.</li>
+ * </ul>
* </blockquote>
* @param setterName the name of the setter being looked up
* @param library the library with respect to which the lookup is being performed
@@ -6875,17 +6756,17 @@
/**
* Return the element representing the setter that results from looking up the given setter in the
- * superclass of this class with respect to the given library, or `null` if the look up
+ * superclass of this class with respect to the given library, or {@code null} if the look up
* fails. The behavior of this method is defined by the Dart Language Specification in section
* 12.16: <blockquote> The result of looking up getter (respectively setter) <i>m</i> in class
* <i>C</i> with respect to library <i>L</i> is:
- *
- * * If <i>C</i> declares an instance getter (respectively setter) named <i>m</i> that is
+ * <ul>
+ * <li>If <i>C</i> declares an instance getter (respectively setter) named <i>m</i> that is
* accessible to <i>L</i>, then that getter (respectively setter) is the result of the lookup.
* Otherwise, if <i>C</i> has a superclass <i>S</i>, then the result of the lookup is the result
* of looking up getter (respectively setter) <i>m</i> in <i>S</i> with respect to <i>L</i>.
- * Otherwise, we say that the lookup has failed.
- *
+ * Otherwise, we say that the lookup has failed.</li>
+ * </ul>
* </blockquote>
* @param setterName the name of the setter being looked up
* @param library the library with respect to which the lookup is being performed
@@ -6896,7 +6777,7 @@
/**
* Return the type resulting from substituting the given arguments for this type's parameters.
- * This is fully equivalent to `substitute(argumentTypes, getTypeArguments())`.
+ * This is fully equivalent to {@code substitute(argumentTypes, getTypeArguments())}.
* @param argumentTypes the actual type arguments being substituted for the type parameters
* @return the result of performing the substitution
*/
@@ -6904,7 +6785,7 @@
InterfaceType substitute2(List<Type2> argumentTypes, List<Type2> parameterTypes);
}
/**
- * The interface `ParameterizedType` defines the behavior common to objects representing the
+ * The interface {@code ParameterizedType} defines the behavior common to objects representing the
* type with type parameters, such as class and function type alias.
* @coverage dart.engine.type
*/
@@ -6927,7 +6808,7 @@
List<TypeVariableElement> get typeVariables;
}
/**
- * The interface `Type` defines the behavior of objects representing the declared type of
+ * The interface {@code Type} defines the behavior of objects representing the declared type of
* elements in the element model.
* @coverage dart.engine.type
*/
@@ -6941,7 +6822,7 @@
String get displayName;
/**
- * Return the element representing the declaration of this type, or `null` if the type has
+ * Return the element representing the declaration of this type, or {@code null} if the type has
* not, or cannot, be associated with an element. The former case will occur if the element model
* is not yet complete; the latter case will occur if this object represents an undefined type.
* @return the element representing the declaration of this type
@@ -6949,7 +6830,7 @@
Element get element;
/**
- * Return the least upper bound of this type and the given type, or `null` if there is no
+ * Return the least upper bound of this type and the given type, or {@code null} if there is no
* least upper bound.
* @param type the other type used to compute the least upper bound
* @return the least upper bound of this type and the given type
@@ -6957,68 +6838,68 @@
Type2 getLeastUpperBound(Type2 type);
/**
- * Return the name of this type, or `null` if the type does not have a name, such as when
+ * Return the name of this type, or {@code null} if the type does not have a name, such as when
* the type represents the type of an unnamed function.
* @return the name of this type
*/
String get name;
/**
- * Return `true` if this type is assignable to the given type. A type <i>T</i> may be
+ * Return {@code true} if this type is assignable to the given type. A type <i>T</i> may be
* assigned to a type <i>S</i>, written <i>T</i> ⇔ <i>S</i>, iff either <i>T</i> <: <i>S</i>
* or <i>S</i> <: <i>T</i>.
* @param type the type being compared with this type
- * @return `true` if this type is assignable to the given type
+ * @return {@code true} if this type is assignable to the given type
*/
bool isAssignableTo(Type2 type);
/**
- * Return `true` if this type represents the type 'Function' defined in the dart:core
+ * Return {@code true} if this type represents the type 'Function' defined in the dart:core
* library.
- * @return `true` if this type represents the type 'Function' defined in the dart:core
+ * @return {@code true} if this type represents the type 'Function' defined in the dart:core
* library
*/
- bool get isDartCoreFunction;
+ bool isDartCoreFunction();
/**
- * Return `true` if this type represents the type 'dynamic'.
- * @return `true` if this type represents the type 'dynamic'
+ * Return {@code true} if this type represents the type 'dynamic'.
+ * @return {@code true} if this type represents the type 'dynamic'
*/
- bool get isDynamic;
+ bool isDynamic();
/**
- * Return `true` if this type is more specific than the given type.
+ * Return {@code true} if this type is more specific than the given type.
* @param type the type being compared with this type
- * @return `true` if this type is more specific than the given type
+ * @return {@code true} if this type is more specific than the given type
*/
bool isMoreSpecificThan(Type2 type);
/**
- * Return `true` if this type represents the type 'Object'.
- * @return `true` if this type represents the type 'Object'
+ * Return {@code true} if this type represents the type 'Object'.
+ * @return {@code true} if this type represents the type 'Object'
*/
- bool get isObject;
+ bool isObject();
/**
- * Return `true` if this type is a subtype of the given type.
+ * Return {@code true} if this type is a subtype of the given type.
* @param type the type being compared with this type
- * @return `true` if this type is a subtype of the given type
+ * @return {@code true} if this type is a subtype of the given type
*/
bool isSubtypeOf(Type2 type);
/**
- * Return `true` if this type is a supertype of the given type. A type <i>S</i> is a
+ * Return {@code true} if this type is a supertype of the given type. A type <i>S</i> is a
* supertype of <i>T</i>, written <i>S</i> :> <i>T</i>, iff <i>T</i> is a subtype of <i>S</i>.
* @param type the type being compared with this type
- * @return `true` if this type is a supertype of the given type
+ * @return {@code true} if this type is a supertype of the given type
*/
bool isSupertypeOf(Type2 type);
/**
- * Return `true` if this type represents the type 'void'.
- * @return `true` if this type represents the type 'void'
+ * Return {@code true} if this type represents the type 'void'.
+ * @return {@code true} if this type represents the type 'void'
*/
- bool get isVoid;
+ bool isVoid();
/**
* Return the type resulting from substituting the given arguments for the given parameters in
@@ -7035,7 +6916,7 @@
Type2 substitute2(List<Type2> argumentTypes, List<Type2> parameterTypes);
}
/**
- * The interface `TypeVariableType` defines the behavior of objects representing the type
+ * The interface {@code TypeVariableType} defines the behavior of objects representing the type
* introduced by a type variable.
* @coverage dart.engine.type
*/
@@ -7043,7 +6924,7 @@
TypeVariableElement get element;
}
/**
- * The interface `VoidType` defines the behavior of the unique object representing the type`void`.
+ * The interface {@code VoidType} defines the behavior of the unique object representing the type{@code void}.
* @coverage dart.engine.type
*/
abstract class VoidType implements Type2 {
diff --git a/pkg/analyzer_experimental/lib/src/generated/engine.dart b/pkg/analyzer_experimental/lib/src/generated/engine.dart
index 42407bf..fd4a2e5 100644
--- a/pkg/analyzer_experimental/lib/src/generated/engine.dart
+++ b/pkg/analyzer_experimental/lib/src/generated/engine.dart
@@ -15,7 +15,7 @@
import 'resolver.dart';
import 'html.dart' show XmlTagNode, XmlAttributeNode, RecursiveXmlVisitor, HtmlScanner, HtmlScanResult, HtmlParser, HtmlParseResult, HtmlUnit;
/**
- * The unique instance of the class `AnalysisEngine` serves as the entry point for the
+ * The unique instance of the class {@code AnalysisEngine} serves as the entry point for the
* functionality provided by the analysis engine.
* @coverage dart.engine
*/
@@ -48,9 +48,9 @@
static AnalysisEngine get instance => _UniqueInstance;
/**
- * Return `true` if the given file name is assumed to contain Dart source code.
+ * Return {@code true} if the given file name is assumed to contain Dart source code.
* @param fileName the name of the file being tested
- * @return `true` if the given file name is assumed to contain Dart source code
+ * @return {@code true} if the given file name is assumed to contain Dart source code
*/
static bool isDartFileName(String fileName) {
if (fileName == null) {
@@ -60,9 +60,9 @@
}
/**
- * Return `true` if the given file name is assumed to contain HTML.
+ * Return {@code true} if the given file name is assumed to contain HTML.
* @param fileName the name of the file being tested
- * @return `true` if the given file name is assumed to contain HTML
+ * @return {@code true} if the given file name is assumed to contain HTML
*/
static bool isHtmlFileName(String fileName) {
if (fileName == null) {
@@ -82,7 +82,7 @@
* @return the analysis context that was created
*/
AnalysisContext createAnalysisContext() {
- if (Instrumentation.isNullLogger) {
+ if (Instrumentation.isNullLogger()) {
return new DelegatingAnalysisContextImpl();
} else {
return new InstrumentedAnalysisContextImpl.con1(new DelegatingAnalysisContextImpl());
@@ -106,32 +106,32 @@
}
}
/**
- * The interface `AnalysisContext` defines the behavior of objects that represent a context in
+ * The interface {@code AnalysisContext} defines the behavior of objects that represent a context in
* which a single analysis can be performed and incrementally maintained. The context includes such
* information as the version of the SDK being analyzed against as well as the package-root used to
- * resolve 'package:' URI's. (Both of which are known indirectly through the [SourceFactorysource factory].)
- *
+ * resolve 'package:' URI's. (Both of which are known indirectly through the {@link SourceFactorysource factory}.)
+ * <p>
* An analysis context also represents the state of the analysis, which includes knowing which
* sources have been included in the analysis (either directly or indirectly) and the results of the
- * analysis. Sources must be added and removed from the context using the method[applyChanges], which is also used to notify the context when sources have been
+ * analysis. Sources must be added and removed from the context using the method{@link #applyChanges(ChangeSet)}, which is also used to notify the context when sources have been
* modified and, consequently, previously known results might have been invalidated.
- *
+ * <p>
* There are two ways to access the results of the analysis. The most common is to use one of the
* 'get' methods to access the results. The 'get' methods have the advantage that they will always
* return quickly, but have the disadvantage that if the results are not currently available they
* will return either nothing or in some cases an incomplete result. The second way to access
* results is by using one of the 'compute' methods. The 'compute' methods will always attempt to
* compute the requested results but might block the caller for a significant period of time.
- *
+ * <p>
* When results have been invalidated, have never been computed (as is the case for newly added
* sources), or have been removed from the cache, they are <b>not</b> automatically recreated. They
* will only be recreated if one of the 'compute' methods is invoked.
- *
+ * <p>
* However, this is not always acceptable. Some clients need to keep the analysis results
* up-to-date. For such clients there is a mechanism that allows them to incrementally perform
* needed analysis and get notified of the consequent changes to the analysis results. This
- * mechanism is realized by the method [performAnalysisTask].
- *
+ * mechanism is realized by the method {@link #performAnalysisTask()}.
+ * <p>
* Analysis engine allows for having more than one context. This can be used, for example, to
* perform one analysis based on the state of files on disk and a separate analysis based on the
* state of those files in open editors. It can also be used to perform an analysis based on a
@@ -148,7 +148,7 @@
/**
* Return the documentation comment for the given element as it appears in the original source
- * (complete with the beginning and ending delimiters), or `null` if the element does not
+ * (complete with the beginning and ending delimiters), or {@code null} if the element does not
* have a documentation comment associated with it. This can be a long-running operation if the
* information needed to access the comment is not cached.
* @param element the element whose documentation comment is to be returned
@@ -185,7 +185,7 @@
HtmlElement computeHtmlElement(Source source);
/**
- * Return the kind of the given source, computing it's kind if it is not already known. Return[SourceKind#UNKNOWN] if the source is not contained in this context.
+ * Return the kind of the given source, computing it's kind if it is not already known. Return{@link SourceKind#UNKNOWN} if the source is not contained in this context.
* @param source the source whose kind is to be returned
* @return the kind of the given source
* @see #getKindOf(Source)
@@ -206,7 +206,7 @@
LibraryElement computeLibraryElement(Source source);
/**
- * Return the line information for the given source, or `null` if the source is not of a
+ * Return the line information for the given source, or {@code null} if the source is not of a
* recognized kind (neither a Dart nor HTML file). If the line information was not previously
* known it will be created. The line information is used to map offsets from the beginning of the
* source to line and column pairs.
@@ -234,7 +234,7 @@
AnalysisOptions get analysisOptions;
/**
- * Return the element referenced by the given location, or `null` if the element is not
+ * Return the element referenced by the given location, or {@code null} if the element is not
* immediately available or if there is no element with the given location. The latter condition
* can occur, for example, if the location describes an element from a different context or if the
* element has been removed from this context as a result of some change since it was originally
@@ -256,7 +256,7 @@
AnalysisErrorInfo getErrors(Source source);
/**
- * Return the element model corresponding to the HTML file defined by the given source, or`null` if the source does not represent an HTML file, the element representing the file
+ * Return the element model corresponding to the HTML file defined by the given source, or{@code null} if the source does not represent an HTML file, the element representing the file
* has not yet been created, or the analysis of the HTML file failed for some reason.
* @param source the source defining the HTML file whose element model is to be returned
* @return the element model corresponding to the HTML file defined by the given source
@@ -281,7 +281,7 @@
List<Source> get htmlSources;
/**
- * Return the kind of the given source, or `null` if the kind is not known to this context.
+ * Return the kind of the given source, or {@code null} if the kind is not known to this context.
* @param source the source whose kind is to be returned
* @return the kind of the given source
* @see #computeKindOf(Source)
@@ -331,7 +331,7 @@
List<Source> getLibrariesDependingOn(Source librarySource);
/**
- * Return the element model corresponding to the library defined by the given source, or`null` if the element model does not currently exist or if the library cannot be analyzed
+ * Return the element model corresponding to the library defined by the given source, or{@code null} if the element model does not currently exist or if the library cannot be analyzed
* for some reason.
* @param source the source defining the library whose element model is to be returned
* @return the element model corresponding to the library defined by the given source
@@ -347,7 +347,7 @@
List<Source> get librarySources;
/**
- * Return the line information for the given source, or `null` if the line information is
+ * Return the line information for the given source, or {@code null} if the line information is
* not known. The line information is used to map offsets from the beginning of the source to line
* and column pairs.
* @param source the source whose line information is to be returned
@@ -357,7 +357,7 @@
LineInfo getLineInfo(Source source);
/**
- * Return a fully resolved AST for a single compilation unit within the given library, or`null` if the resolved AST is not already computed.
+ * Return a fully resolved AST for a single compilation unit within the given library, or{@code null} if the resolved AST is not already computed.
* @param unitSource the source of the compilation unit
* @param library the library containing the compilation unit
* @return a fully resolved AST for the compilation unit
@@ -366,7 +366,7 @@
CompilationUnit getResolvedCompilationUnit(Source unitSource, LibraryElement library);
/**
- * Return a fully resolved AST for a single compilation unit within the given library, or`null` if the resolved AST is not already computed.
+ * Return a fully resolved AST for a single compilation unit within the given library, or{@code null} if the resolved AST is not already computed.
* @param unitSource the source of the compilation unit
* @param librarySource the source of the defining compilation unit of the library containing the
* compilation unit
@@ -382,28 +382,28 @@
SourceFactory get sourceFactory;
/**
- * Return `true` if the given source is known to be the defining compilation unit of a
+ * Return {@code true} if the given source is known to be the defining compilation unit of a
* library that can be run on a client (references 'dart:html', either directly or indirectly).
- *
- * <b>Note:</b> In addition to the expected case of returning `false` if the source is known
- * to be a library that cannot be run on a client, this method will also return `false` if
+ * <p>
+ * <b>Note:</b> In addition to the expected case of returning {@code false} if the source is known
+ * to be a library that cannot be run on a client, this method will also return {@code false} if
* the source is not known to be a library or if we do not know whether it can be run on a client.
* @param librarySource the source being tested
- * @return `true` if the given source is known to be a library that can be run on a client
+ * @return {@code true} if the given source is known to be a library that can be run on a client
*/
bool isClientLibrary(Source librarySource);
/**
- * Return `true` if the given source is known to be the defining compilation unit of a
+ * Return {@code true} if the given source is known to be the defining compilation unit of a
* library that can be run on the server (does not reference 'dart:html', either directly or
* indirectly).
- *
- * <b>Note:</b> In addition to the expected case of returning `false` if the source is known
- * to be a library that cannot be run on the server, this method will also return `false` if
+ * <p>
+ * <b>Note:</b> In addition to the expected case of returning {@code false} if the source is known
+ * to be a library that cannot be run on the server, this method will also return {@code false} if
* the source is not known to be a library or if we do not know whether it can be run on the
* server.
* @param librarySource the source being tested
- * @return `true` if the given source is known to be a library that can be run on the server
+ * @return {@code true} if the given source is known to be a library that can be run on the server
*/
bool isServerLibrary(Source librarySource);
@@ -429,7 +429,7 @@
* may not be resolved, and may have a slightly different structure depending upon whether it is
* resolved.
* @param source the HTML source to be parsed
- * @return the parse result (not `null`)
+ * @return the parse result (not {@code null})
* @throws AnalysisException if the analysis could not be performed
*/
HtmlUnit parseHtmlUnit(Source source);
@@ -438,7 +438,7 @@
* Perform the next unit of work required to keep the analysis results up-to-date and return
* information about the consequent changes to the analysis results. If there were no results the
* returned array will be empty. If there are no more units of work required, then this method
- * returns `null`. This method can be long running.
+ * returns {@code null}. This method can be long running.
* @return an array containing notices of changes to the analysis results
*/
List<ChangeNotice> performAnalysisTask();
@@ -484,7 +484,7 @@
/**
* Set the contents of the given source to the given contents and mark the source as having
* changed. This has the effect of overriding the default contents of the source. If the contents
- * are `null` the override is removed so that the default contents will be returned.
+ * are {@code null} the override is removed so that the default contents will be returned.
* @param source the source whose contents are being overridden
* @param contents the new contents of the source
*/
@@ -500,33 +500,33 @@
void set sourceFactory(SourceFactory factory);
/**
- * Given a collection of sources with content that has changed, return an [Iterable]identifying the sources that need to be resolved.
- * @param changedSources an array of sources (not `null`, contains no `null`s)
+ * Given a collection of sources with content that has changed, return an {@link Iterable}identifying the sources that need to be resolved.
+ * @param changedSources an array of sources (not {@code null}, contains no {@code null}s)
* @return An iterable returning the sources to be resolved
*/
Iterable<Source> sourcesToResolve(List<Source> changedSources);
}
/**
- * The interface `AnalysisErrorInfo` contains the analysis errors and line information for the
+ * The interface {@code AnalysisErrorInfo} contains the analysis errors and line information for the
* errors.
*/
abstract class AnalysisErrorInfo {
/**
- * Return the errors that as a result of the analysis, or `null` if there were no errors.
+ * Return the errors that as a result of the analysis, or {@code null} if there were no errors.
* @return the errors as a result of the analysis
*/
List<AnalysisError> get errors;
/**
- * Return the line information associated with the errors, or `null` if there were no
+ * Return the line information associated with the errors, or {@code null} if there were no
* errors.
* @return the line information associated with the errors
*/
LineInfo get lineInfo;
}
/**
- * Instances of the class `AnalysisException` represent an exception that occurred during the
+ * Instances of the class {@code AnalysisException} represent an exception that occurred during the
* analysis of one or more sources.
* @coverage dart.engine
*/
@@ -573,27 +573,27 @@
}
}
/**
- * The interface `AnalysisOptions` defines the behavior of objects that provide access to a
+ * The interface {@code AnalysisOptions} defines the behavior of objects that provide access to a
* set of analysis options used to control the behavior of an analysis context.
*/
abstract class AnalysisOptions {
/**
- * Return `true` if analysis is to use strict mode. In strict mode, error reporting is based
+ * Return {@code true} if analysis is to use strict mode. In strict mode, error reporting is based
* exclusively on the static type information.
- * @return `true` if analysis is to use strict mode
+ * @return {@code true} if analysis is to use strict mode
*/
bool get strictMode;
}
/**
- * The interface `ChangeNotice` defines the behavior of objects that represent a change to the
+ * The interface {@code ChangeNotice} defines the behavior of objects that represent a change to the
* analysis results associated with a given source.
* @coverage dart.engine
*/
abstract class ChangeNotice implements AnalysisErrorInfo {
/**
- * Return the fully resolved AST that changed as a result of the analysis, or `null` if the
+ * Return the fully resolved AST that changed as a result of the analysis, or {@code null} if the
* AST was not changed.
* @return the fully resolved AST that changed as a result of the analysis
*/
@@ -606,7 +606,7 @@
Source get source;
}
/**
- * Instances of the class `ChangeSet` indicate what sources have been added, changed, or
+ * Instances of the class {@code ChangeSet} indicate what sources have been added, changed, or
* removed.
* @coverage dart.engine
*/
@@ -675,10 +675,10 @@
List<SourceContainer> get removedContainers => _removedContainers;
/**
- * Return `true` if this change set does not contain any changes.
- * @return `true` if this change set does not contain any changes
+ * Return {@code true} if this change set does not contain any changes.
+ * @return {@code true} if this change set does not contain any changes
*/
- bool get isEmpty => _added2.isEmpty && _changed2.isEmpty && _removed2.isEmpty && _removedContainers.isEmpty;
+ bool isEmpty() => _added2.isEmpty && _changed2.isEmpty && _removed2.isEmpty && _removedContainers.isEmpty;
/**
* Record that the specified source has been removed.
@@ -701,7 +701,7 @@
}
}
/**
- * The interface `DartEntry` defines the behavior of objects that maintain the information
+ * The interface {@code DartEntry} defines the behavior of objects that maintain the information
* cached by an analysis context about an individual Dart file.
* @coverage dart.engine
*/
@@ -776,14 +776,14 @@
/**
* Return a valid parsed compilation unit, either an unresolved AST structure or the result of
- * resolving the AST structure in the context of some library, or `null` if there is no
+ * resolving the AST structure in the context of some library, or {@code null} if there is no
* parsed compilation unit available.
* @return a valid parsed compilation unit
*/
CompilationUnit get anyParsedCompilationUnit;
/**
- * Return the result of resolving the compilation unit as part of any library, or `null` if
+ * Return the result of resolving the compilation unit as part of any library, or {@code null} if
* there is no cached resolved compilation unit.
* @return any resolved compilation unit
*/
@@ -801,7 +801,7 @@
/**
* Return the value of the data represented by the given descriptor in the context of the given
- * library, or `null` if the data represented by the descriptor is not in the cache.
+ * library, or {@code null} if the data represented by the descriptor is not in the cache.
* @param descriptor the descriptor representing which data is to be returned
* @param librarySource the source of the defining compilation unit of the library that is the
* context for the data
@@ -811,7 +811,7 @@
DartEntryImpl get writableCopy;
}
/**
- * Instances of the class `DartEntryImpl` implement a [DartEntry].
+ * Instances of the class {@code DartEntryImpl} implement a {@link DartEntry}.
* @coverage dart.engine
*/
class DartEntryImpl extends SourceEntryImpl implements DartEntry {
@@ -832,7 +832,7 @@
CacheState _parsedUnitState = CacheState.INVALID;
/**
- * The parsed compilation unit, or `null` if the parsed compilation unit is not currently
+ * The parsed compilation unit, or {@code null} if the parsed compilation unit is not currently
* cached.
*/
CompilationUnit _parsedUnit;
@@ -843,7 +843,7 @@
CacheState _parseErrorsState = CacheState.INVALID;
/**
- * The errors produced while scanning and parsing the compilation unit, or `null` if the
+ * The errors produced while scanning and parsing the compilation unit, or {@code null} if the
* errors are not currently cached.
*/
List<AnalysisError> _parseErrors = AnalysisError.NO_ERRORS;
@@ -873,7 +873,7 @@
/**
* The information known as a result of resolving this compilation unit as part of the library
- * that contains this unit. This field will never be `null`.
+ * that contains this unit. This field will never be {@code null}.
*/
DartEntryImpl_ResolutionState _resolutionState = new DartEntryImpl_ResolutionState();
@@ -883,7 +883,7 @@
CacheState _elementState = CacheState.INVALID;
/**
- * The element representing the library, or `null` if the element is not currently cached.
+ * The element representing the library, or {@code null} if the element is not currently cached.
*/
LibraryElement _element;
@@ -893,7 +893,7 @@
CacheState _publicNamespaceState = CacheState.INVALID;
/**
- * The public namespace of the library, or `null` if the namespace is not currently cached.
+ * The public namespace of the library, or {@code null} if the namespace is not currently cached.
*/
Namespace _publicNamespace;
@@ -908,7 +908,7 @@
CacheState _launchableState = CacheState.INVALID;
/**
- * An integer holding bit masks such as [LAUNCHABLE] and [CLIENT_CODE].
+ * An integer holding bit masks such as {@link #LAUNCHABLE} and {@link #CLIENT_CODE}.
*/
int _bitmask = 0;
@@ -1280,7 +1280,7 @@
/**
* Set the value of the data represented by the given descriptor in the context of the given
- * library to the given value, and set the state of that data to [CacheState#VALID].
+ * library to the given value, and set the state of that data to {@link CacheState#VALID}.
* @param descriptor the descriptor representing which data is to have its value set
* @param librarySource the source of the defining compilation unit of the library that is the
* context for the data
@@ -1321,8 +1321,8 @@
/**
* Return a resolution state for the specified library, creating one as necessary.
- * @param librarySource the library source (not `null`)
- * @return the resolution state (not `null`)
+ * @param librarySource the library source (not {@code null})
+ * @return the resolution state (not {@code null})
*/
DartEntryImpl_ResolutionState getOrCreateResolutionState(Source librarySource2) {
DartEntryImpl_ResolutionState state = _resolutionState;
@@ -1360,13 +1360,13 @@
}
}
/**
- * Instances of the class `ResolutionState` represent the information produced by resolving
+ * Instances of the class {@code ResolutionState} represent the information produced by resolving
* a compilation unit as part of a specific library.
*/
class DartEntryImpl_ResolutionState {
/**
- * The next resolution state or `null` if none.
+ * The next resolution state or {@code null} if none.
*/
DartEntryImpl_ResolutionState _nextState;
@@ -1383,7 +1383,7 @@
CacheState _resolvedUnitState = CacheState.INVALID;
/**
- * The resolved compilation unit, or `null` if the resolved compilation unit is not
+ * The resolved compilation unit, or {@code null} if the resolved compilation unit is not
* currently cached.
*/
CompilationUnit _resolvedUnit;
@@ -1394,7 +1394,7 @@
CacheState _resolutionErrorsState = CacheState.INVALID;
/**
- * The errors produced while resolving the compilation unit, or `null` if the errors are
+ * The errors produced while resolving the compilation unit, or {@code null} if the errors are
* not currently cached.
*/
List<AnalysisError> _resolutionErrors = AnalysisError.NO_ERRORS;
@@ -1443,7 +1443,7 @@
}
}
/**
- * Instances of the class `DataDescriptor` are immutable constants representing data that can
+ * Instances of the class {@code DataDescriptor} are immutable constants representing data that can
* be stored in the cache.
*/
class DataDescriptor<E> {
@@ -1463,7 +1463,7 @@
String toString() => _name;
}
/**
- * The interface `HtmlEntry` defines the behavior of objects that maintain the information
+ * The interface {@code HtmlEntry} defines the behavior of objects that maintain the information
* cached by an analysis context about an individual HTML file.
* @coverage dart.engine
*/
@@ -1502,7 +1502,7 @@
HtmlEntryImpl get writableCopy;
}
/**
- * Instances of the class `HtmlEntryImpl` implement an [HtmlEntry].
+ * Instances of the class {@code HtmlEntryImpl} implement an {@link HtmlEntry}.
* @coverage dart.engine
*/
class HtmlEntryImpl extends SourceEntryImpl implements HtmlEntry {
@@ -1513,7 +1513,7 @@
CacheState _parsedUnitState = CacheState.INVALID;
/**
- * The parsed HTML unit, or `null` if the parsed HTML unit is not currently cached.
+ * The parsed HTML unit, or {@code null} if the parsed HTML unit is not currently cached.
*/
HtmlUnit _parsedUnit;
@@ -1523,7 +1523,7 @@
CacheState _resolutionErrorsState = CacheState.INVALID;
/**
- * The errors produced while resolving the compilation unit, or `null` if the errors are not
+ * The errors produced while resolving the compilation unit, or {@code null} if the errors are not
* currently cached.
*/
List<AnalysisError> _resolutionErrors = AnalysisError.NO_ERRORS;
@@ -1534,7 +1534,7 @@
CacheState _resolvedUnitState = CacheState.INVALID;
/**
- * The resolved HTML unit, or `null` if the resolved HTML unit is not currently cached.
+ * The resolved HTML unit, or {@code null} if the resolved HTML unit is not currently cached.
*/
HtmlUnit _resolvedUnit;
@@ -1544,7 +1544,7 @@
CacheState _referencedLibrariesState = CacheState.INVALID;
/**
- * The list of libraries referenced in the HTML, or `null` if the list is not currently
+ * The list of libraries referenced in the HTML, or {@code null} if the list is not currently
* cached. Note that this list does not include libraries defined directly within the HTML file.
*/
List<Source> _referencedLibraries = Source.EMPTY_ARRAY;
@@ -1555,7 +1555,7 @@
CacheState _elementState = CacheState.INVALID;
/**
- * The element representing the HTML file, or `null` if the element is not currently cached.
+ * The element representing the HTML file, or {@code null} if the element is not currently cached.
*/
HtmlElement _element;
List<AnalysisError> get allErrors {
@@ -1658,9 +1658,9 @@
}
}
/**
- * The interface `SourceEntry` defines the behavior of objects that maintain the information
+ * The interface {@code SourceEntry} defines the behavior of objects that maintain the information
* cached by an analysis context about an individual source, no matter what kind of source it is.
- *
+ * <p>
* Source entries should be treated as if they were immutable unless a writable copy of the entry
* has been obtained and has not yet been made visible to other threads.
* @coverage dart.engine
@@ -1673,7 +1673,7 @@
static final DataDescriptor<LineInfo> LINE_INFO = new DataDescriptor<LineInfo>("SourceEntry.LINE_INFO");
/**
- * Return the kind of the source, or `null` if the kind is not currently cached.
+ * Return the kind of the source, or {@code null} if the kind is not currently cached.
* @return the kind of the source
*/
SourceKind get kind;
@@ -1693,7 +1693,7 @@
CacheState getState(DataDescriptor<Object> descriptor);
/**
- * Return the value of the data represented by the given descriptor, or `null` if the data
+ * Return the value of the data represented by the given descriptor, or {@code null} if the data
* represented by the descriptor is not in the cache.
* @param descriptor the descriptor representing which data is to be returned
* @return the value of the data represented by the given descriptor
@@ -1708,7 +1708,7 @@
SourceEntryImpl get writableCopy;
}
/**
- * Instances of the abstract class `SourceEntryImpl` implement the behavior common to all[SourceEntry source entries].
+ * Instances of the abstract class {@code SourceEntryImpl} implement the behavior common to all{@link SourceEntry source entries}.
* @coverage dart.engine
*/
abstract class SourceEntryImpl implements SourceEntry {
@@ -1725,7 +1725,7 @@
CacheState _lineInfoState = CacheState.INVALID;
/**
- * The line information computed for the source, or `null` if the line information is not
+ * The line information computed for the source, or {@code null} if the line information is not
* currently cached.
*/
LineInfo _lineInfo;
@@ -1810,8 +1810,8 @@
}
}
/**
- * Instances of the class `AnalysisContextImpl` implement an [AnalysisContext analysis
- * context].
+ * Instances of the class {@code AnalysisContextImpl} implement an {@link AnalysisContext analysis
+ * context}.
* @coverage dart.engine
*/
class AnalysisContextImpl implements InternalAnalysisContext {
@@ -1884,7 +1884,7 @@
_sourceMap[source] = info;
}
void applyChanges(ChangeSet changeSet) {
- if (changeSet.isEmpty) {
+ if (changeSet.isEmpty()) {
return;
}
{
@@ -1906,7 +1906,7 @@
}
if (addedDartSource) {
for (MapEntry<Source, SourceEntry> mapEntry in getMapEntrySet(_sourceMap)) {
- if (!mapEntry.getKey().isInSystemLibrary && mapEntry.getValue() is DartEntry) {
+ if (!mapEntry.getKey().isInSystemLibrary() && mapEntry.getValue() is DartEntry) {
DartEntryImpl dartCopy = ((mapEntry.getValue() as DartEntry)).writableCopy;
dartCopy.invalidateAllResolutionInformation();
mapEntry.setValue(dartCopy);
@@ -2172,7 +2172,7 @@
for (MapEntry<Source, SourceEntry> entry in getMapEntrySet(_sourceMap)) {
Source source = entry.getKey();
SourceEntry sourceEntry = entry.getValue();
- if (identical(sourceEntry.kind, SourceKind.LIBRARY) && !source.isInSystemLibrary) {
+ if (identical(sourceEntry.kind, SourceKind.LIBRARY) && !source.isInSystemLibrary()) {
sources.add(source);
}
}
@@ -2185,7 +2185,7 @@
for (MapEntry<Source, SourceEntry> entry in getMapEntrySet(_sourceMap)) {
Source source = entry.getKey();
SourceEntry sourceEntry = entry.getValue();
- if (identical(sourceEntry.kind, SourceKind.LIBRARY) && !source.isInSystemLibrary) {
+ if (identical(sourceEntry.kind, SourceKind.LIBRARY) && !source.isInSystemLibrary()) {
sources.add(source);
}
}
@@ -2496,9 +2496,9 @@
}
/**
- * Return a list of the sources that would be processed by [performAnalysisTask]. This
+ * Return a list of the sources that would be processed by {@link #performAnalysisTask()}. This
* method is intended to be used for testing purposes only.
- * @return a list of the sources that would be processed by [performAnalysisTask]
+ * @return a list of the sources that would be processed by {@link #performAnalysisTask()}
*/
List<Source> get sourcesNeedingProcessing {
List<Source> sources = new List<Source>();
@@ -2527,8 +2527,8 @@
/**
* Record that the given source was just accessed for some unspecified purpose.
- *
- * Note: This method must only be invoked while we are synchronized on [cacheLock].
+ * <p>
+ * Note: This method must only be invoked while we are synchronized on {@link #cacheLock}.
* @param source the source that was accessed
*/
void accessed(Source source) {
@@ -2559,8 +2559,8 @@
/**
* Add all of the sources contained in the given source container to the given list of sources.
- *
- * Note: This method must only be invoked while we are synchronized on [cacheLock].
+ * <p>
+ * Note: This method must only be invoked while we are synchronized on {@link #cacheLock}.
* @param sources the list to which sources are to be added
* @param container the source container containing the sources to be added to the list
*/
@@ -2573,10 +2573,10 @@
}
/**
- * Return `true` if the given array of sources contains the given source.
+ * Return {@code true} if the given array of sources contains the given source.
* @param sources the sources being searched
* @param targetSource the source being searched for
- * @return `true` if the given source is in the array
+ * @return {@code true} if the given source is in the array
*/
bool contains(List<Source> sources, Source targetSource) {
for (Source source in sources) {
@@ -2588,10 +2588,10 @@
}
/**
- * Return `true` if the given array of sources contains any of the given target sources.
+ * Return {@code true} if the given array of sources contains any of the given target sources.
* @param sources the sources being searched
* @param targetSources the sources being searched for
- * @return `true` if any of the given target sources are in the array
+ * @return {@code true} if any of the given target sources are in the array
*/
bool containsAny(List<Source> sources, List<Source> targetSources) {
for (Source targetSource in targetSources) {
@@ -2604,7 +2604,7 @@
/**
* Create a source information object suitable for the given source. Return the source information
- * object that was created, or `null` if the source should not be tracked by this context.
+ * object that was created, or {@code null} if the source should not be tracked by this context.
* @param source the source for which an information object is being created
* @return the source information object that was created
*/
@@ -2622,7 +2622,7 @@
}
/**
- * Disable flushing information from the cache until [enableCacheRemoval] has been
+ * Disable flushing information from the cache until {@link #enableCacheRemoval()} has been
* called.
*/
void disableCacheRemoval() {
@@ -2659,7 +2659,7 @@
/**
* Search the compilation units that are part of the given library and return the element
- * representing the compilation unit with the given source. Return `null` if there is no
+ * representing the compilation unit with the given source. Return {@code null} if there is no
* such compilation unit.
* @param libraryElement the element representing the library being searched through
* @param unitSource the source for the compilation unit whose element is to be returned
@@ -2679,13 +2679,13 @@
}
/**
- * Return the compilation unit information associated with the given source, or `null` if
+ * Return the compilation unit information associated with the given source, or {@code null} if
* the source is not known to this context. This method should be used to access the compilation
* unit information rather than accessing the compilation unit map directly because sources in the
* SDK are implicitly part of every analysis context and are therefore only added to the map when
* first accessed.
- *
- * <b>Note:</b> This method must only be invoked while we are synchronized on [cacheLock].
+ * <p>
+ * <b>Note:</b> This method must only be invoked while we are synchronized on {@link #cacheLock}.
* @param source the source for which information is being sought
* @return the compilation unit information associated with the given source
*/
@@ -2702,13 +2702,13 @@
}
/**
- * Return the HTML unit information associated with the given source, or `null` if the
+ * Return the HTML unit information associated with the given source, or {@code null} if the
* source is not known to this context. This method should be used to access the HTML unit
* information rather than accessing the HTML unit map directly because sources in the SDK are
* implicitly part of every analysis context and are therefore only added to the map when first
* accessed.
- *
- * <b>Note:</b> This method must only be invoked while we are synchronized on [cacheLock].
+ * <p>
+ * <b>Note:</b> This method must only be invoked while we are synchronized on {@link #cacheLock}.
* @param source the source for which information is being sought
* @return the HTML unit information associated with the given source
*/
@@ -2754,7 +2754,7 @@
}
/**
- * Return the cache entry associated with the given source, or `null` if there is no entry
+ * Return the cache entry associated with the given source, or {@code null} if there is no entry
* associated with the source.
* @param source the source for which a cache entry is being sought
* @return the source cache entry associated with the given source
@@ -2766,12 +2766,12 @@
}
/**
- * Return the source information associated with the given source, or `null` if the source
+ * Return the source information associated with the given source, or {@code null} if the source
* is not known to this context. This method should be used to access the source information
* rather than accessing the source map directly because sources in the SDK are implicitly part of
* every analysis context and are therefore only added to the map when first accessed.
- *
- * <b>Note:</b> This method must only be invoked while we are synchronized on [cacheLock].
+ * <p>
+ * <b>Note:</b> This method must only be invoked while we are synchronized on {@link #cacheLock}.
* @param source the source for which information is being sought
* @return the source information associated with the given source
*/
@@ -2801,10 +2801,10 @@
}
/**
- * Return `true` if the given compilation unit has a part-of directive but no library
+ * Return {@code true} if the given compilation unit has a part-of directive but no library
* directive.
* @param unit the compilation unit being tested
- * @return `true` if the compilation unit has a part-of directive
+ * @return {@code true} if the compilation unit has a part-of directive
*/
bool hasPartOfDirective(CompilationUnit unit) {
bool hasPartOf = false;
@@ -2898,8 +2898,8 @@
/**
* Invalidate all of the results computed by this context.
- *
- * <b>Note:</b> This method must only be invoked while we are synchronized on [cacheLock].
+ * <p>
+ * <b>Note:</b> This method must only be invoked while we are synchronized on {@link #cacheLock}.
*/
void invalidateAllResults() {
for (MapEntry<Source, SourceEntry> mapEntry in getMapEntrySet(_sourceMap)) {
@@ -2941,11 +2941,11 @@
}
/**
- * Return `true` if this library is, or depends on, dart:html.
+ * Return {@code true} if this library is, or depends on, dart:html.
* @param library the library being tested
* @param visitedLibraries a collection of the libraries that have been visited, used to prevent
* infinite recursion
- * @return `true` if this library is, or depends on, dart:html
+ * @return {@code true} if this library is, or depends on, dart:html
*/
bool isClient(LibraryElement library, Source htmlSource, Set<LibraryElement> visitedLibraries) {
if (visitedLibraries.contains(library)) {
@@ -2970,9 +2970,9 @@
/**
* Perform a single analysis task.
- *
- * <b>Note:</b> This method must only be invoked while we are synchronized on [cacheLock].
- * @return `true` if work was done, implying that there might be more work to be done
+ * <p>
+ * <b>Note:</b> This method must only be invoked while we are synchronized on {@link #cacheLock}.
+ * @return {@code true} if work was done, implying that there might be more work to be done
*/
bool performSingleAnalysisTask() {
for (MapEntry<Source, SourceEntry> entry in getMapEntrySet(_sourceMap)) {
@@ -3122,12 +3122,12 @@
}
/**
- * Create an entry for the newly added source. Return `true` if the new source is a Dart
+ * Create an entry for the newly added source. Return {@code true} if the new source is a Dart
* file.
- *
- * <b>Note:</b> This method must only be invoked while we are synchronized on [cacheLock].
+ * <p>
+ * <b>Note:</b> This method must only be invoked while we are synchronized on {@link #cacheLock}.
* @param source the source that has been added
- * @return `true` if the new source is a Dart file
+ * @return {@code true} if the new source is a Dart file
*/
bool sourceAvailable(Source source) {
SourceEntry sourceEntry = _sourceMap[source];
@@ -3138,7 +3138,7 @@
}
/**
- * <b>Note:</b> This method must only be invoked while we are synchronized on [cacheLock].
+ * <b>Note:</b> This method must only be invoked while we are synchronized on {@link #cacheLock}.
* @param source the source that has been changed
*/
void sourceChanged(Source source) {
@@ -3152,21 +3152,28 @@
htmlCopy.setState(HtmlEntry.RESOLVED_UNIT, CacheState.INVALID);
_sourceMap[source] = htmlCopy;
} else if (sourceEntry is DartEntry) {
+ Set<Source> librariesToInvalidate = new Set<Source>();
List<Source> containingLibraries = getLibrariesContaining(source);
+ for (Source containingLibrary in containingLibraries) {
+ javaSetAdd(librariesToInvalidate, containingLibrary);
+ for (Source dependentLibrary in getLibrariesDependingOn(containingLibrary)) {
+ javaSetAdd(librariesToInvalidate, dependentLibrary);
+ }
+ }
DartEntryImpl dartCopy = ((sourceEntry as DartEntry)).writableCopy;
dartCopy.setState(SourceEntry.LINE_INFO, CacheState.INVALID);
dartCopy.setState(DartEntry.PARSE_ERRORS, CacheState.INVALID);
dartCopy.setState(DartEntry.PARSED_UNIT, CacheState.INVALID);
dartCopy.setState(DartEntry.SOURCE_KIND, CacheState.INVALID);
_sourceMap[source] = dartCopy;
- for (Source library in containingLibraries) {
+ for (Source library in librariesToInvalidate) {
invalidateLibraryResolution(library);
}
}
}
/**
- * <b>Note:</b> This method must only be invoked while we are synchronized on [cacheLock].
+ * <b>Note:</b> This method must only be invoked while we are synchronized on {@link #cacheLock}.
* @param source the source that has been deleted
*/
void sourceRemoved(Source source) {
@@ -3187,7 +3194,7 @@
}
}
/**
- * Instances of the class `ScanResult` represent the results of scanning a source.
+ * Instances of the class {@code ScanResult} represent the results of scanning a source.
*/
class AnalysisContextImpl_ScanResult {
@@ -3259,18 +3266,18 @@
}
}
/**
- * Instances of the class `AnalysisErrorInfoImpl` represent the analysis errors and line info
+ * Instances of the class {@code AnalysisErrorInfoImpl} represent the analysis errors and line info
* associated with a source.
*/
class AnalysisErrorInfoImpl implements AnalysisErrorInfo {
/**
- * The analysis errors associated with a source, or `null` if there are no errors.
+ * The analysis errors associated with a source, or {@code null} if there are no errors.
*/
List<AnalysisError> _errors;
/**
- * The line information associated with the errors, or `null` if there are no errors.
+ * The line information associated with the errors, or {@code null} if there are no errors.
*/
LineInfo _lineInfo;
@@ -3285,20 +3292,20 @@
}
/**
- * Return the errors of analysis, or `null` if there were no errors.
+ * Return the errors of analysis, or {@code null} if there were no errors.
* @return the errors as a result of the analysis
*/
List<AnalysisError> get errors => _errors;
/**
- * Return the line information associated with the errors, or `null` if there were no
+ * Return the line information associated with the errors, or {@code null} if there were no
* errors.
* @return the line information associated with the errors
*/
LineInfo get lineInfo => _lineInfo;
}
/**
- * Instances of the class `AnalysisOptions` represent a set of analysis options used to
+ * Instances of the class {@code AnalysisOptions} represent a set of analysis options used to
* control the behavior of an analysis context.
*/
class AnalysisOptionsImpl implements AnalysisOptions {
@@ -3310,78 +3317,78 @@
bool _strictMode = false;
/**
- * Return `true` if analysis is to use strict mode. In strict mode, error reporting is based
+ * Return {@code true} if analysis is to use strict mode. In strict mode, error reporting is based
* exclusively on the static type information.
- * @return `true` if analysis is to use strict mode
+ * @return {@code true} if analysis is to use strict mode
*/
bool get strictMode => _strictMode;
/**
* Set whether analysis is to use strict mode to the given value. In strict mode, error reporting
* is based exclusively on the static type information.
- * @param isStrict `true` if analysis is to use strict mode
+ * @param isStrict {@code true} if analysis is to use strict mode
*/
void set strictMode(bool isStrict) {
_strictMode = isStrict;
}
}
/**
- * The enumeration `CacheState` defines the possible states of cached data.
+ * The enumeration {@code CacheState} defines the possible states of cached data.
*/
class CacheState implements Comparable<CacheState> {
/**
* The data is not in the cache and the last time an attempt was made to compute the data an
* exception occurred, making it pointless to attempt.
- *
+ * <p>
* Valid Transitions:
- *
- * * [INVALID] if a source was modified that might cause the data to be computable
- *
+ * <ul>
+ * <li>{@link #INVALID} if a source was modified that might cause the data to be computable</li>
+ * </ul>
*/
static final CacheState ERROR = new CacheState('ERROR', 0);
/**
* The data is not in the cache because it was flushed from the cache in order to control memory
* usage. If the data is recomputed, results do not need to be reported.
- *
+ * <p>
* Valid Transitions:
- *
- * * [IN_PROCESS] if the data is being recomputed
- * * [INVALID] if a source was modified that causes the data to need to be recomputed
- *
+ * <ul>
+ * <li>{@link #IN_PROCESS} if the data is being recomputed</li>
+ * <li>{@link #INVALID} if a source was modified that causes the data to need to be recomputed</li>
+ * </ul>
*/
static final CacheState FLUSHED = new CacheState('FLUSHED', 1);
/**
* The data might or might not be in the cache but is in the process of being recomputed.
- *
+ * <p>
* Valid Transitions:
- *
- * * [ERROR] if an exception occurred while trying to compute the data
- * * [VALID] if the data was successfully computed and stored in the cache
- *
+ * <ul>
+ * <li>{@link #ERROR} if an exception occurred while trying to compute the data</li>
+ * <li>{@link #VALID} if the data was successfully computed and stored in the cache</li>
+ * </ul>
*/
static final CacheState IN_PROCESS = new CacheState('IN_PROCESS', 2);
/**
* The data is not in the cache and needs to be recomputed so that results can be reported.
- *
+ * <p>
* Valid Transitions:
- *
- * * [IN_PROCESS] if an attempt is being made to recompute the data
- *
+ * <ul>
+ * <li>{@link #IN_PROCESS} if an attempt is being made to recompute the data</li>
+ * </ul>
*/
static final CacheState INVALID = new CacheState('INVALID', 3);
/**
* The data is in the cache and up-to-date.
- *
+ * <p>
* Valid Transitions:
- *
- * * [FLUSHED] if the data is removed in order to manage memory usage
- * * [INVALID] if a source was modified in such a way as to invalidate the previous data
- *
+ * <ul>
+ * <li>{@link #FLUSHED} if the data is removed in order to manage memory usage</li>
+ * <li>{@link #INVALID} if a source was modified in such a way as to invalidate the previous data</li>
+ * </ul>
*/
static final CacheState VALID = new CacheState('VALID', 4);
static final List<CacheState> values = [ERROR, FLUSHED, IN_PROCESS, INVALID, VALID];
@@ -3398,7 +3405,7 @@
String toString() => name;
}
/**
- * Instances of the class `ChangeNoticeImpl` represent a change to the analysis results
+ * Instances of the class {@code ChangeNoticeImpl} represent a change to the analysis results
* associated with a given source.
* @coverage dart.engine
*/
@@ -3410,19 +3417,19 @@
Source _source;
/**
- * The fully resolved AST that changed as a result of the analysis, or `null` if the AST was
+ * The fully resolved AST that changed as a result of the analysis, or {@code null} if the AST was
* not changed.
*/
CompilationUnit _compilationUnit;
/**
- * The errors that changed as a result of the analysis, or `null` if errors were not
+ * The errors that changed as a result of the analysis, or {@code null} if errors were not
* changed.
*/
List<AnalysisError> _errors;
/**
- * The line information associated with the source, or `null` if errors were not changed.
+ * The line information associated with the source, or {@code null} if errors were not changed.
*/
LineInfo _lineInfo;
@@ -3440,21 +3447,21 @@
}
/**
- * Return the fully resolved AST that changed as a result of the analysis, or `null` if the
+ * Return the fully resolved AST that changed as a result of the analysis, or {@code null} if the
* AST was not changed.
* @return the fully resolved AST that changed as a result of the analysis
*/
CompilationUnit get compilationUnit => _compilationUnit;
/**
- * Return the errors that changed as a result of the analysis, or `null` if errors were not
+ * Return the errors that changed as a result of the analysis, or {@code null} if errors were not
* changed.
* @return the errors that changed as a result of the analysis
*/
List<AnalysisError> get errors => _errors;
/**
- * Return the line information associated with the source, or `null` if errors were not
+ * Return the line information associated with the source, or {@code null} if errors were not
* changed.
* @return the line information associated with the source
*/
@@ -3486,112 +3493,112 @@
}
}
/**
- * Instances of the class `DelegatingAnalysisContextImpl` extend [AnalysisContextImplanalysis context] to delegate sources to the appropriate analysis context. For instance, if the
- * source is in a system library then the analysis context from the [DartSdk] is used.
+ * Instances of the class {@code DelegatingAnalysisContextImpl} extend {@link AnalysisContextImplanalysis context} to delegate sources to the appropriate analysis context. For instance, if the
+ * source is in a system library then the analysis context from the {@link DartSdk} is used.
* @coverage dart.engine
*/
class DelegatingAnalysisContextImpl extends AnalysisContextImpl {
/**
- * This references the [InternalAnalysisContext] held onto by the [DartSdk] which is
- * used (instead of this [AnalysisContext]) for SDK sources. This field is set when
- * #setSourceFactory(SourceFactory) is called, and references the analysis context in the[DartUriResolver] in the [SourceFactory], this analysis context assumes that there
+ * This references the {@link InternalAnalysisContext} held onto by the {@link DartSdk} which is
+ * used (instead of this {@link AnalysisContext}) for SDK sources. This field is set when
+ * #setSourceFactory(SourceFactory) is called, and references the analysis context in the{@link DartUriResolver} in the {@link SourceFactory}, this analysis context assumes that there
* will be such a resolver.
*/
InternalAnalysisContext _sdkAnalysisContext;
void addSourceInfo(Source source, SourceEntry info) {
- if (source.isInSystemLibrary) {
+ if (source.isInSystemLibrary()) {
_sdkAnalysisContext.addSourceInfo(source, info);
} else {
super.addSourceInfo(source, info);
}
}
List<AnalysisError> computeErrors(Source source) {
- if (source.isInSystemLibrary) {
+ if (source.isInSystemLibrary()) {
return _sdkAnalysisContext.computeErrors(source);
} else {
return super.computeErrors(source);
}
}
HtmlElement computeHtmlElement(Source source) {
- if (source.isInSystemLibrary) {
+ if (source.isInSystemLibrary()) {
return _sdkAnalysisContext.computeHtmlElement(source);
} else {
return super.computeHtmlElement(source);
}
}
SourceKind computeKindOf(Source source) {
- if (source.isInSystemLibrary) {
+ if (source.isInSystemLibrary()) {
return _sdkAnalysisContext.computeKindOf(source);
} else {
return super.computeKindOf(source);
}
}
LibraryElement computeLibraryElement(Source source) {
- if (source.isInSystemLibrary) {
+ if (source.isInSystemLibrary()) {
return _sdkAnalysisContext.computeLibraryElement(source);
} else {
return super.computeLibraryElement(source);
}
}
LineInfo computeLineInfo(Source source) {
- if (source.isInSystemLibrary) {
+ if (source.isInSystemLibrary()) {
return _sdkAnalysisContext.computeLineInfo(source);
} else {
return super.computeLineInfo(source);
}
}
CompilationUnit computeResolvableCompilationUnit(Source source) {
- if (source.isInSystemLibrary) {
+ if (source.isInSystemLibrary()) {
return _sdkAnalysisContext.computeResolvableCompilationUnit(source);
} else {
return super.computeResolvableCompilationUnit(source);
}
}
AnalysisErrorInfo getErrors(Source source) {
- if (source.isInSystemLibrary) {
+ if (source.isInSystemLibrary()) {
return _sdkAnalysisContext.getErrors(source);
} else {
return super.getErrors(source);
}
}
HtmlElement getHtmlElement(Source source) {
- if (source.isInSystemLibrary) {
+ if (source.isInSystemLibrary()) {
return _sdkAnalysisContext.getHtmlElement(source);
} else {
return super.getHtmlElement(source);
}
}
List<Source> getHtmlFilesReferencing(Source source) {
- if (source.isInSystemLibrary) {
+ if (source.isInSystemLibrary()) {
return _sdkAnalysisContext.getHtmlFilesReferencing(source);
} else {
return super.getHtmlFilesReferencing(source);
}
}
SourceKind getKindOf(Source source) {
- if (source.isInSystemLibrary) {
+ if (source.isInSystemLibrary()) {
return _sdkAnalysisContext.getKindOf(source);
} else {
return super.getKindOf(source);
}
}
List<Source> getLibrariesContaining(Source source) {
- if (source.isInSystemLibrary) {
+ if (source.isInSystemLibrary()) {
return _sdkAnalysisContext.getLibrariesContaining(source);
} else {
return super.getLibrariesContaining(source);
}
}
List<Source> getLibrariesDependingOn(Source librarySource) {
- if (librarySource.isInSystemLibrary) {
+ if (librarySource.isInSystemLibrary()) {
return _sdkAnalysisContext.getLibrariesDependingOn(librarySource);
} else {
return super.getLibrariesDependingOn(librarySource);
}
}
LibraryElement getLibraryElement(Source source) {
- if (source.isInSystemLibrary) {
+ if (source.isInSystemLibrary()) {
return _sdkAnalysisContext.getLibraryElement(source);
} else {
return super.getLibraryElement(source);
@@ -3599,7 +3606,7 @@
}
List<Source> get librarySources => ArrayUtils.addAll(super.librarySources, _sdkAnalysisContext.librarySources);
LineInfo getLineInfo(Source source) {
- if (source.isInSystemLibrary) {
+ if (source.isInSystemLibrary()) {
return _sdkAnalysisContext.getLineInfo(source);
} else {
return super.getLineInfo(source);
@@ -3607,56 +3614,56 @@
}
Namespace getPublicNamespace(LibraryElement library) {
Source source = library.source;
- if (source.isInSystemLibrary) {
+ if (source.isInSystemLibrary()) {
return _sdkAnalysisContext.getPublicNamespace(library);
} else {
return super.getPublicNamespace(library);
}
}
Namespace getPublicNamespace2(Source source) {
- if (source.isInSystemLibrary) {
+ if (source.isInSystemLibrary()) {
return _sdkAnalysisContext.getPublicNamespace2(source);
} else {
return super.getPublicNamespace2(source);
}
}
CompilationUnit getResolvedCompilationUnit(Source unitSource, LibraryElement library) {
- if (unitSource.isInSystemLibrary) {
+ if (unitSource.isInSystemLibrary()) {
return _sdkAnalysisContext.getResolvedCompilationUnit(unitSource, library);
} else {
return super.getResolvedCompilationUnit(unitSource, library);
}
}
CompilationUnit getResolvedCompilationUnit2(Source unitSource, Source librarySource) {
- if (unitSource.isInSystemLibrary) {
+ if (unitSource.isInSystemLibrary()) {
return _sdkAnalysisContext.getResolvedCompilationUnit2(unitSource, librarySource);
} else {
return super.getResolvedCompilationUnit2(unitSource, librarySource);
}
}
bool isClientLibrary(Source librarySource) {
- if (librarySource.isInSystemLibrary) {
+ if (librarySource.isInSystemLibrary()) {
return _sdkAnalysisContext.isClientLibrary(librarySource);
} else {
return super.isClientLibrary(librarySource);
}
}
bool isServerLibrary(Source librarySource) {
- if (librarySource.isInSystemLibrary) {
+ if (librarySource.isInSystemLibrary()) {
return _sdkAnalysisContext.isServerLibrary(librarySource);
} else {
return super.isServerLibrary(librarySource);
}
}
CompilationUnit parseCompilationUnit(Source source) {
- if (source.isInSystemLibrary) {
+ if (source.isInSystemLibrary()) {
return _sdkAnalysisContext.parseCompilationUnit(source);
} else {
return super.parseCompilationUnit(source);
}
}
HtmlUnit parseHtmlUnit(Source source) {
- if (source.isInSystemLibrary) {
+ if (source.isInSystemLibrary()) {
return _sdkAnalysisContext.parseHtmlUnit(source);
} else {
return super.parseHtmlUnit(source);
@@ -3667,35 +3674,35 @@
return;
}
Source source = new JavaIterator(elementMap.keys.toSet()).next();
- if (source.isInSystemLibrary) {
+ if (source.isInSystemLibrary()) {
_sdkAnalysisContext.recordLibraryElements(elementMap);
} else {
super.recordLibraryElements(elementMap);
}
}
CompilationUnit resolveCompilationUnit(Source source, LibraryElement library) {
- if (source.isInSystemLibrary) {
+ if (source.isInSystemLibrary()) {
return _sdkAnalysisContext.resolveCompilationUnit(source, library);
} else {
return super.resolveCompilationUnit(source, library);
}
}
CompilationUnit resolveCompilationUnit2(Source unitSource, Source librarySource) {
- if (unitSource.isInSystemLibrary) {
+ if (unitSource.isInSystemLibrary()) {
return _sdkAnalysisContext.resolveCompilationUnit2(unitSource, librarySource);
} else {
return super.resolveCompilationUnit2(unitSource, librarySource);
}
}
HtmlUnit resolveHtmlUnit(Source unitSource) {
- if (unitSource.isInSystemLibrary) {
+ if (unitSource.isInSystemLibrary()) {
return _sdkAnalysisContext.resolveHtmlUnit(unitSource);
} else {
return super.resolveHtmlUnit(unitSource);
}
}
void setContents(Source source, String contents) {
- if (source.isInSystemLibrary) {
+ if (source.isInSystemLibrary()) {
_sdkAnalysisContext.setContents(source, contents);
} else {
super.setContents(source, contents);
@@ -3716,7 +3723,7 @@
}
}
/**
- * Instances of the class `InstrumentedAnalysisContextImpl` implement an[AnalysisContext analysis context] by recording instrumentation data and delegating to
+ * Instances of the class {@code InstrumentedAnalysisContextImpl} implement an{@link AnalysisContext analysis context} by recording instrumentation data and delegating to
* another analysis context to do the non-instrumentation work.
* @coverage dart.engine
*/
@@ -3742,7 +3749,7 @@
InternalAnalysisContext _basis;
/**
- * Create a new [InstrumentedAnalysisContextImpl] which wraps a new[AnalysisContextImpl] as the basis context.
+ * Create a new {@link InstrumentedAnalysisContextImpl} which wraps a new{@link AnalysisContextImpl} as the basis context.
*/
InstrumentedAnalysisContextImpl() {
_jtd_constructor_183_impl();
@@ -3752,9 +3759,9 @@
}
/**
- * Create a new [InstrumentedAnalysisContextImpl] with a specified basis context, aka the
+ * Create a new {@link InstrumentedAnalysisContextImpl} with a specified basis context, aka the
* context to wrap and instrument.
- * @param context some [InstrumentedAnalysisContext] to wrap and instrument
+ * @param context some {@link InstrumentedAnalysisContext} to wrap and instrument
*/
InstrumentedAnalysisContextImpl.con1(InternalAnalysisContext context) {
_jtd_constructor_184_impl(context);
@@ -3863,7 +3870,7 @@
}
/**
- * @return the underlying [AnalysisContext].
+ * @return the underlying {@link AnalysisContext}.
*/
AnalysisContext get basis => _basis;
Element getElement(ElementLocation location) {
@@ -4188,7 +4195,7 @@
}
}
/**
- * The interface `InternalAnalysisContext` defines additional behavior for an analysis context
+ * The interface {@code InternalAnalysisContext} defines additional behavior for an analysis context
* that is required by internal users of the context.
*/
abstract class InternalAnalysisContext implements AnalysisContext {
@@ -4246,7 +4253,7 @@
void recordLibraryElements(Map<Source, LibraryElement> elementMap);
}
/**
- * Instances of the class `RecordingErrorListener` implement an error listener that will
+ * Instances of the class {@code RecordingErrorListener} implement an error listener that will
* record the errors that are reported to it in a way that is appropriate for caching those errors
* within an analysis context.
* @coverage dart.engine
@@ -4254,7 +4261,7 @@
class RecordingErrorListener implements AnalysisErrorListener {
/**
- * A HashMap of lists containing the errors that were collected, keyed by each [Source].
+ * A HashMap of lists containing the errors that were collected, keyed by each {@link Source}.
*/
Map<Source, List<AnalysisError>> _errors = new Map<Source, List<AnalysisError>>();
@@ -4270,7 +4277,7 @@
/**
* Answer the errors collected by the listener.
- * @return an array of errors (not `null`, contains no `null`s)
+ * @return an array of errors (not {@code null}, contains no {@code null}s)
*/
List<AnalysisError> get errors {
Iterable<MapEntry<Source, List<AnalysisError>>> entrySet = getMapEntrySet(_errors);
@@ -4286,10 +4293,10 @@
}
/**
- * Answer the errors collected by the listener for some passed [Source].
- * @param source some [Source] for which the caller wants the set of [AnalysisError]s
+ * Answer the errors collected by the listener for some passed {@link Source}.
+ * @param source some {@link Source} for which the caller wants the set of {@link AnalysisError}s
* collected by this listener
- * @return the errors collected by the listener for the passed [Source]
+ * @return the errors collected by the listener for the passed {@link Source}
*/
List<AnalysisError> getErrors2(Source source) {
List<AnalysisError> errorsForSource = _errors[source];
@@ -4310,7 +4317,7 @@
}
}
/**
- * Instances of the class `ResolutionEraser` remove any resolution information from an AST
+ * Instances of the class {@code ResolutionEraser} remove any resolution information from an AST
* structure when used to visit that structure.
*/
class ResolutionEraser extends GeneralizingASTVisitor<Object> {
@@ -4381,7 +4388,7 @@
}
}
/**
- * The interface `Logger` defines the behavior of objects that can be used to receive
+ * The interface {@code Logger} defines the behavior of objects that can be used to receive
* information about errors within the analysis engine. Implementations usually write this
* information to a file, but can also record the information for later use (such as during testing)
* or even ignore the information.
@@ -4424,7 +4431,7 @@
void logInformation2(String message, Exception exception);
}
/**
- * Implementation of [Logger] that does nothing.
+ * Implementation of {@link Logger} that does nothing.
*/
class Logger_NullLogger implements Logger {
void logError(String message) {
diff --git a/pkg/analyzer_experimental/lib/src/generated/error.dart b/pkg/analyzer_experimental/lib/src/generated/error.dart
index a330e1e..6061cb0 100644
--- a/pkg/analyzer_experimental/lib/src/generated/error.dart
+++ b/pkg/analyzer_experimental/lib/src/generated/error.dart
@@ -6,7 +6,7 @@
import 'ast.dart' show ASTNode;
import 'scanner.dart' show Token;
/**
- * Instances of the enumeration `ErrorSeverity` represent the severity of an [ErrorCode].
+ * Instances of the enumeration {@code ErrorSeverity} represent the severity of an {@link ErrorCode}.
* @coverage dart.engine.error
*/
class ErrorSeverity implements Comparable<ErrorSeverity> {
@@ -24,7 +24,7 @@
static final ErrorSeverity SUGGESTION = new ErrorSeverity('SUGGESTION', 1, "S", "suggestion");
/**
- * The severity representing a warning. Warnings can become errors if the `-Werror` command
+ * The severity representing a warning. Warnings can become errors if the {@code -Werror} command
* line flag is specified.
*/
static final ErrorSeverity WARNING = new ErrorSeverity('WARNING', 2, "W", "warning");
@@ -84,7 +84,7 @@
String toString() => name;
}
/**
- * Instances of the class `AnalysisErrorWithProperties`
+ * Instances of the class {@code AnalysisErrorWithProperties}
*/
class AnalysisErrorWithProperties extends AnalysisError {
@@ -122,7 +122,7 @@
Object getProperty(ErrorProperty property) => _propertyMap[property];
/**
- * Set the value of the given property to the given value. Using a value of `null` will
+ * Set the value of the given property to the given value. Using a value of {@code null} will
* effectively remove the property from this error.
* @param property the property whose value is to be returned
* @param value the new value of the given property
@@ -132,7 +132,7 @@
}
}
/**
- * Instances of the class `ErrorReporter` wrap an error listener with utility methods used to
+ * Instances of the class {@code ErrorReporter} wrap an error listener with utility methods used to
* create the errors being reported.
* @coverage dart.engine.error
*/
@@ -217,7 +217,7 @@
}
/**
- * Set the source to be used when reporting errors. Setting the source to `null` will cause
+ * Set the source to be used when reporting errors. Setting the source to {@code null} will cause
* the default source to be used.
* @param source the source to be used when reporting errors
*/
@@ -226,7 +226,7 @@
}
}
/**
- * Instances of the class `AnalysisError` represent an error discovered during the analysis of
+ * Instances of the class {@code AnalysisError} represent an error discovered during the analysis of
* some Dart code.
* @see AnalysisErrorListener
* @coverage dart.engine.error
@@ -239,13 +239,13 @@
static List<AnalysisError> NO_ERRORS = new List<AnalysisError>(0);
/**
- * A [Comparator] that sorts by the name of the file that the [AnalysisError] was
+ * A {@link Comparator} that sorts by the name of the file that the {@link AnalysisError} was
* found.
*/
static Comparator<AnalysisError> FILE_COMPARATOR = (AnalysisError o1, AnalysisError o2) => o1.source.shortName.compareTo(o2.source.shortName);
/**
- * A [Comparator] that sorts error codes first by their severity (errors first, warnings
+ * A {@link Comparator} that sorts error codes first by their severity (errors first, warnings
* second), and then by the the error code type.
*/
static Comparator<AnalysisError> ERROR_CODE_COMPARATOR = (AnalysisError o1, AnalysisError o2) {
@@ -273,7 +273,7 @@
String _message;
/**
- * The source in which the error occurred, or `null` if unknown.
+ * The source in which the error occurred, or {@code null} if unknown.
*/
Source _source;
@@ -350,7 +350,7 @@
int get offset => _offset;
/**
- * Return the value of the given property, or `null` if the given property is not defined
+ * Return the value of the given property, or {@code null} if the given property is not defined
* for this error.
* @param property the property whose value is to be returned
* @return the value of the given property
@@ -358,7 +358,7 @@
Object getProperty(ErrorProperty property) => null;
/**
- * Return the source in which the error occurred, or `null` if unknown.
+ * Return the source in which the error occurred, or {@code null} if unknown.
* @return the source in which the error occurred
*/
Source get source => _source;
@@ -389,12 +389,12 @@
}
}
/**
- * The enumeration `ErrorProperty` defines the properties that can be associated with an[AnalysisError].
+ * The enumeration {@code ErrorProperty} defines the properties that can be associated with an{@link AnalysisError}.
*/
class ErrorProperty implements Comparable<ErrorProperty> {
/**
- * A property whose value is an array of [ExecutableElement executable elements] that should
+ * A property whose value is an array of {@link ExecutableElement executable elements} that should
* be but are not implemented by a concrete class.
*/
static final ErrorProperty UNIMPLEMENTED_METHODS = new ErrorProperty('UNIMPLEMENTED_METHODS', 0);
@@ -412,8 +412,8 @@
String toString() => name;
}
/**
- * The interface `ErrorCode` defines the behavior common to objects representing error codes
- * associated with [AnalysisError analysis errors].
+ * The interface {@code ErrorCode} defines the behavior common to objects representing error codes
+ * associated with {@link AnalysisError analysis errors}.
* @coverage dart.engine.error
*/
abstract class ErrorCode {
@@ -437,7 +437,7 @@
ErrorType get type;
}
/**
- * Instances of the enumeration `ErrorType` represent the type of an [ErrorCode].
+ * Instances of the enumeration {@code ErrorType} represent the type of an {@link ErrorCode}.
* @coverage dart.engine.error
*/
class ErrorType implements Comparable<ErrorType> {
@@ -501,7 +501,7 @@
String toString() => name;
}
/**
- * The enumeration `CompileTimeErrorCode` defines the error codes used for compile time
+ * The enumeration {@code CompileTimeErrorCode} defines the error codes used for compile time
* errors. The convention for this class is for the name of the error code to indicate the problem
* that caused the error to be generated and for the error message to explain what is wrong and,
* when appropriate, how the problem can be corrected.
@@ -523,10 +523,10 @@
* 14.1 Imports: If a name <i>N</i> is referenced by a library <i>L</i> and <i>N</i> is introduced
* into the top level scope <i>L</i> by more than one import then:
* <ol>
- * * It is a static warning if <i>N</i> is used as a type annotation.
- * * In checked mode, it is a dynamic error if <i>N</i> is used as a type annotation and
+ * <li>It is a static warning if <i>N</i> is used as a type annotation.
+ * <li>In checked mode, it is a dynamic error if <i>N</i> is used as a type annotation and
* referenced during a subtype test.
- * * Otherwise, it is a compile-time error.
+ * <li>Otherwise, it is a compile-time error.
* </ol>
* @param ambiguousElementName the name of the ambiguous element
* @param firstLibraryName the name of the first library that the type is found
@@ -602,7 +602,7 @@
/**
* 7.6.3 Constant Constructors: It is a compile-time error if a constant constructor is declared
* by a class that has a non-final instance variable.
- *
+ * <p>
* The above refers to both locally declared and inherited instance variables.
*/
static final CompileTimeErrorCode CONST_CONSTRUCTOR_WITH_NON_FINAL_FIELD = new CompileTimeErrorCode('CONST_CONSTRUCTOR_WITH_NON_FINAL_FIELD', 12, "Cannot define the 'const' constructor for a class with non-final fields");
@@ -611,7 +611,7 @@
* 7.6.1 Generative Constructors: In checked mode, it is a dynamic type error if o is not
* <b>null</b> and the interface of the class of <i>o</i> is not a subtype of the static type of
* the field <i>v</i>.
- *
+ * <p>
* 12.11.2 Const: It is a compile-time error if evaluation of a constant object results in an
* uncaught exception being thrown.
* @param initializerType the name of the type of the initializer expression
@@ -696,7 +696,7 @@
/**
* 12.11.2 Const: It is a compile-time error if <i>T</i> is not a class accessible in the current
* scope, optionally followed by type arguments.
- *
+ * <p>
* 12.11.2 Const: If <i>e</i> is of the form <i>const T.id(a<sub>1</sub>, …, a<sub>n</sub>,
* x<sub>n+1</sub>: a<sub>n+1</sub>, … x<sub>n+k</sub>: a<sub>n+k</sub>)</i> it is a
* compile-time error if <i>T</i> is not a class accessible in the current scope, optionally
@@ -791,16 +791,16 @@
/**
* 12.2 Null: It is a compile-time error for a class to attempt to extend or implement Null.
- *
+ * <p>
* 12.3 Numbers: It is a compile-time error for a class to attempt to extend or implement int.
- *
+ * <p>
* 12.3 Numbers: It is a compile-time error for a class to attempt to extend or implement double.
- *
+ * <p>
* 12.3 Numbers: It is a compile-time error for any type other than the types int and double to
* attempt to extend or implement num.
- *
+ * <p>
* 12.4 Booleans: It is a compile-time error for a class to attempt to extend or implement bool.
- *
+ * <p>
* 12.5 Strings: It is a compile-time error for a class to attempt to extend or implement String.
* @param typeName the name of the type that cannot be extended
* @see #IMPLEMENTS_DISALLOWED_CLASS
@@ -809,7 +809,7 @@
/**
* 12.14.2 Binding Actuals to Formals: It is a static warning if <i>m < h</i> or if <i>m > n</i>.
- *
+ * <p>
* 12.11.2 Const: It is a compile-time error if evaluation of a constant object results in an
* uncaught exception being thrown.
* @param requiredCount the maximum number of positional arguments
@@ -819,16 +819,16 @@
/**
* 12.2 Null: It is a compile-time error for a class to attempt to extend or implement Null.
- *
+ * <p>
* 12.3 Numbers: It is a compile-time error for a class to attempt to extend or implement int.
- *
+ * <p>
* 12.3 Numbers: It is a compile-time error for a class to attempt to extend or implement double.
- *
+ * <p>
* 12.3 Numbers: It is a compile-time error for any type other than the types int and double to
* attempt to extend or implement num.
- *
+ * <p>
* 12.4 Booleans: It is a compile-time error for a class to attempt to extend or implement bool.
- *
+ * <p>
* 12.5 Strings: It is a compile-time error for a class to attempt to extend or implement String.
* @param typeName the name of the type that cannot be implemented
* @see #EXTENDS_DISALLOWED_CLASS
@@ -886,7 +886,7 @@
/**
* 7.6.1 Generative Constructors: A generative constructor may be redirecting, in which case its
* only action is to invoke another generative constructor.
- *
+ * <p>
* 7.6.1 Generative Constructors: It is a compile-time error if an initializing formal is used by
* a function other than a non-redirecting generative constructor.
*/
@@ -923,7 +923,7 @@
/**
* 7.6.1 Generative Constructors: Note that this is not in scope on the right hand side of an
* initializer.
- *
+ * <p>
* 12.10 This: It is a compile-time error if this appears in a top-level function or variable
* initializer, in a factory constructor, or in a static method or variable initializer, or in the
* initializer of an instance variable.
@@ -1076,10 +1076,10 @@
/**
* 14.2 Exports: It is a compile-time error if the compilation unit found at the specified URI is
* not a library declaration.
- *
+ * <p>
* 14.1 Imports: It is a compile-time error if the compilation unit found at the specified URI is
* not a library declaration.
- *
+ * <p>
* 14.3 Parts: It is a compile time error if the contents of the URI are not a valid part
* declaration.
* @param uri the URI that is invalid
@@ -1090,7 +1090,7 @@
/**
* 13.13 Break: It is a compile-time error if no such statement <i>s<sub>E</sub></i> exists within
* the innermost function in which <i>s<sub>b</sub></i> occurs.
- *
+ * <p>
* 13.14 Continue: It is a compile-time error if no such statement or case clause
* <i>s<sub>E</sub></i> exists within the innermost function in which <i>s<sub>c</sub></i> occurs.
* @param labelName the name of the unresolvable label
@@ -1100,7 +1100,7 @@
/**
* 13.13 Break: It is a compile-time error if no such statement <i>s<sub>E</sub></i> exists within
* the innermost function in which <i>s<sub>b</sub></i> occurs.
- *
+ * <p>
* 13.14 Continue: It is a compile-time error if no such statement or case clause
* <i>s<sub>E</sub></i> exists within the innermost function in which <i>s<sub>c</sub></i> occurs.
* @param labelName the name of the unresolvable label
@@ -1231,7 +1231,7 @@
/**
* 12.14.2 Binding Actuals to Formals: It is a static warning if <i>m < h</i> or if <i>m > n</i>.
- *
+ * <p>
* 12.11.2 Const: It is a compile-time error if evaluation of a constant object results in an
* uncaught exception being thrown.
* @param requiredCount the expected number of required arguments
@@ -1285,10 +1285,10 @@
/**
* 7.6.1 Generative Constructors: A generative constructor may be redirecting, in which case its
* only action is to invoke another generative constructor.
- *
+ * <p>
* TODO(scheglov) review this later, there are no explicit "it is a compile-time error" in
* specification. But it was added to the co19 and there is same error for factories.
- *
+ * <p>
* https://code.google.com/p/dart/issues/detail?id=954
*/
static final CompileTimeErrorCode RECURSIVE_CONSTRUCTOR_REDIRECT = new CompileTimeErrorCode('RECURSIVE_CONSTRUCTOR_REDIRECT', 103, "Cycle in redirecting generative constructors");
@@ -1308,9 +1308,9 @@
/**
* 7.10 Superinterfaces: It is a compile-time error if the interface of a class <i>C</i> is a
* superinterface of itself.
- *
+ * <p>
* 8.1 Superinterfaces: It is a compile-time error if an interface is a superinterface of itself.
- *
+ * <p>
* 7.9 Superclasses: It is a compile-time error if a class <i>C</i> is a superclass of itself.
* @param className the name of the class that implements itself recursively
* @param strImplementsPath a string representation of the implements loop
@@ -1320,9 +1320,9 @@
/**
* 7.10 Superinterfaces: It is a compile-time error if the interface of a class <i>C</i> is a
* superinterface of itself.
- *
+ * <p>
* 8.1 Superinterfaces: It is a compile-time error if an interface is a superinterface of itself.
- *
+ * <p>
* 7.9 Superclasses: It is a compile-time error if a class <i>C</i> is a superclass of itself.
* @param className the name of the class that implements itself recursively
*/
@@ -1331,9 +1331,9 @@
/**
* 7.10 Superinterfaces: It is a compile-time error if the interface of a class <i>C</i> is a
* superinterface of itself.
- *
+ * <p>
* 8.1 Superinterfaces: It is a compile-time error if an interface is a superinterface of itself.
- *
+ * <p>
* 7.9 Superclasses: It is a compile-time error if a class <i>C</i> is a superclass of itself.
* @param className the name of the class that implements itself recursively
*/
@@ -1404,10 +1404,20 @@
static final CompileTimeErrorCode SUPER_INITIALIZER_IN_OBJECT = new CompileTimeErrorCode('SUPER_INITIALIZER_IN_OBJECT', 118, "");
/**
+ * 12.11 Instance Creation: It is a compile-time error if a constructor of a non-generic type
+ * invoked by a new expression or a constant object expression is passed any type arguments.
+ * <p>
+ * 12.32 Type Cast: It is a compile-time error if <i>T</i> is a parameterized type of the form
+ * <i>G<T<sub>1</sub>, …, T<sub>n</sub>></i> and <i>G</i> is not a generic type with
+ * <i>n</i> type parameters.
+ */
+ static final CompileTimeErrorCode TYPE_ARGUMENTS_FOR_NON_GENERIC_CLASS = new CompileTimeErrorCode('TYPE_ARGUMENTS_FOR_NON_GENERIC_CLASS', 119, "");
+
+ /**
* 12.11.2 Const: It is a compile-time error if <i>T</i> is not a class accessible in the current
* scope, optionally followed by type arguments.
*/
- static final CompileTimeErrorCode UNDEFINED_CLASS = new CompileTimeErrorCode('UNDEFINED_CLASS', 119, "Undefined class '%s'");
+ static final CompileTimeErrorCode UNDEFINED_CLASS = new CompileTimeErrorCode('UNDEFINED_CLASS', 120, "Undefined class '%s'");
/**
* 7.6.1 Generative Constructors: Let <i>C</i> be the class in which the superinitializer appears
@@ -1415,7 +1425,7 @@
* a compile-time error if class <i>S</i> does not declare a generative constructor named <i>S</i>
* (respectively <i>S.id</i>)
*/
- static final CompileTimeErrorCode UNDEFINED_CONSTRUCTOR_IN_INITIALIZER = new CompileTimeErrorCode('UNDEFINED_CONSTRUCTOR_IN_INITIALIZER', 120, "The class '%s' does not have a generative constructor '%s'");
+ static final CompileTimeErrorCode UNDEFINED_CONSTRUCTOR_IN_INITIALIZER = new CompileTimeErrorCode('UNDEFINED_CONSTRUCTOR_IN_INITIALIZER', 121, "The class '%s' does not have a generative constructor '%s'");
/**
* 7.6.1 Generative Constructors: Let <i>C</i> be the class in which the superinitializer appears
@@ -1423,7 +1433,7 @@
* a compile-time error if class <i>S</i> does not declare a generative constructor named <i>S</i>
* (respectively <i>S.id</i>)
*/
- static final CompileTimeErrorCode UNDEFINED_CONSTRUCTOR_IN_INITIALIZER_DEFAULT = new CompileTimeErrorCode('UNDEFINED_CONSTRUCTOR_IN_INITIALIZER_DEFAULT', 121, "The class '%s' does not have a default generative constructor");
+ static final CompileTimeErrorCode UNDEFINED_CONSTRUCTOR_IN_INITIALIZER_DEFAULT = new CompileTimeErrorCode('UNDEFINED_CONSTRUCTOR_IN_INITIALIZER_DEFAULT', 122, "The class '%s' does not have a default generative constructor");
/**
* 7.6.1 Generative Constructors: Let <i>k</i> be a generative constructor. Each final instance
@@ -1431,49 +1441,49 @@
* <i>k</i>'s initializer list unless it has already been initialized by one of the following
* means:
* <ol>
- * * Initialization at the declaration of <i>f</i>.
- * * Initialization by means of an initializing formal of <i>k</i>.
+ * <li>Initialization at the declaration of <i>f</i>.
+ * <li>Initialization by means of an initializing formal of <i>k</i>.
* </ol>
* or a compile-time error occurs.
*/
- static final CompileTimeErrorCode UNINITIALIZED_FINAL_FIELD = new CompileTimeErrorCode('UNINITIALIZED_FINAL_FIELD', 122, "");
+ static final CompileTimeErrorCode UNINITIALIZED_FINAL_FIELD = new CompileTimeErrorCode('UNINITIALIZED_FINAL_FIELD', 123, "");
/**
* 12.14.2 Binding Actuals to Formals: Furthermore, each <i>q<sub>i</sub></i>, <i>1<=i<=l</i>,
* must have a corresponding named parameter in the set {<i>p<sub>n+1</sub></i> ...
* <i>p<sub>n+k</sub></i>} or a static warning occurs.
- *
+ * <p>
* 12.11.2 Const: It is a compile-time error if evaluation of a constant object results in an
* uncaught exception being thrown.
* @param name the name of the requested named parameter
*/
- static final CompileTimeErrorCode UNDEFINED_NAMED_PARAMETER = new CompileTimeErrorCode('UNDEFINED_NAMED_PARAMETER', 123, "The named parameter '%s' is not defined");
+ static final CompileTimeErrorCode UNDEFINED_NAMED_PARAMETER = new CompileTimeErrorCode('UNDEFINED_NAMED_PARAMETER', 124, "The named parameter '%s' is not defined");
/**
* 14.2 Exports: It is a compile-time error if the compilation unit found at the specified URI is
* not a library declaration.
- *
+ * <p>
* 14.1 Imports: It is a compile-time error if the compilation unit found at the specified URI is
* not a library declaration.
- *
+ * <p>
* 14.3 Parts: It is a compile time error if the contents of the URI are not a valid part
* declaration.
* @param uri the URI pointing to a non-existent file
* @see #INVALID_URI
*/
- static final CompileTimeErrorCode URI_DOES_NOT_EXIST = new CompileTimeErrorCode('URI_DOES_NOT_EXIST', 124, "Target of URI does not exist: '%s'");
+ static final CompileTimeErrorCode URI_DOES_NOT_EXIST = new CompileTimeErrorCode('URI_DOES_NOT_EXIST', 125, "Target of URI does not exist: '%s'");
/**
* 14.1 Imports: It is a compile-time error if <i>x</i> is not a compile-time constant, or if
* <i>x</i> involves string interpolation.
- *
+ * <p>
* 14.3 Parts: It is a compile-time error if <i>s</i> is not a compile-time constant, or if
* <i>s</i> involves string interpolation.
- *
+ * <p>
* 14.5 URIs: It is a compile-time error if the string literal <i>x</i> that describes a URI is
* not a compile-time constant, or if <i>x</i> involves string interpolation.
*/
- static final CompileTimeErrorCode URI_WITH_INTERPOLATION = new CompileTimeErrorCode('URI_WITH_INTERPOLATION', 125, "URIs cannot use string interpolation");
+ static final CompileTimeErrorCode URI_WITH_INTERPOLATION = new CompileTimeErrorCode('URI_WITH_INTERPOLATION', 126, "URIs cannot use string interpolation");
/**
* 7.1.1 Operators: It is a compile-time error if the arity of the user-declared operator \[\]= is
@@ -1485,33 +1495,33 @@
* @param expectedNumberOfParameters the number of parameters expected
* @param actualNumberOfParameters the number of parameters found in the operator declaration
*/
- static final CompileTimeErrorCode WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR = new CompileTimeErrorCode('WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR', 126, "Operator '%s' should declare exactly %d parameter(s), but %d found");
+ static final CompileTimeErrorCode WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR = new CompileTimeErrorCode('WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR', 127, "Operator '%s' should declare exactly %d parameter(s), but %d found");
/**
* 7.1.1 Operators: It is a compile time error if the arity of the user-declared operator - is not
* 0 or 1.
* @param actualNumberOfParameters the number of parameters found in the operator declaration
*/
- static final CompileTimeErrorCode WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR_MINUS = new CompileTimeErrorCode('WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR_MINUS', 127, "Operator '-' should declare 0 or 1 parameter, but %d found");
+ static final CompileTimeErrorCode WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR_MINUS = new CompileTimeErrorCode('WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR_MINUS', 128, "Operator '-' should declare 0 or 1 parameter, but %d found");
/**
* 7.3 Setters: It is a compile-time error if a setter's formal parameter list does not include
* exactly one required formal parameter <i>p</i>.
* @param numberOfParameters the number of parameters found in the setter
*/
- static final CompileTimeErrorCode WRONG_NUMBER_OF_PARAMETERS_FOR_SETTER = new CompileTimeErrorCode('WRONG_NUMBER_OF_PARAMETERS_FOR_SETTER', 128, "Setters should declare exactly one parameter, %d found");
+ static final CompileTimeErrorCode WRONG_NUMBER_OF_PARAMETERS_FOR_SETTER = new CompileTimeErrorCode('WRONG_NUMBER_OF_PARAMETERS_FOR_SETTER', 129, "Setters should declare exactly one parameter, %d found");
/**
* 12.11 Instance Creation: It is a compile-time error if a constructor of a generic type with
* <i>n</i> type parameters invoked by a new expression or a constant object expression is passed
* <i>m</i> type arguments where <i>m != n</i>.
- *
+ * <p>
* 12.31 Type Test: It is a compile-time error if <i>T</i> is a parameterized type of the form
* <i>G<T<sub>1</sub>, …, T<sub>n</sub>></i> and <i>G</i> is not a generic type with
* <i>n</i> type parameters.
*/
- static final CompileTimeErrorCode WRONG_NUMBER_OF_TYPE_ARGUMENTS = new CompileTimeErrorCode('WRONG_NUMBER_OF_TYPE_ARGUMENTS', 129, "");
- static final List<CompileTimeErrorCode> values = [AMBIGUOUS_EXPORT, AMBIGUOUS_IMPORT, ARGUMENT_DEFINITION_TEST_NON_PARAMETER, BUILT_IN_IDENTIFIER_AS_TYPE, BUILT_IN_IDENTIFIER_AS_TYPE_NAME, BUILT_IN_IDENTIFIER_AS_TYPEDEF_NAME, BUILT_IN_IDENTIFIER_AS_TYPE_VARIABLE_NAME, CASE_EXPRESSION_TYPE_IMPLEMENTS_EQUALS, COMPILE_TIME_CONSTANT_RAISES_EXCEPTION, CONFLICTING_CONSTRUCTOR_NAME_AND_FIELD, CONFLICTING_CONSTRUCTOR_NAME_AND_METHOD, CONST_CONSTRUCTOR_THROWS_EXCEPTION, CONST_CONSTRUCTOR_WITH_NON_FINAL_FIELD, CONST_FIELD_INITIALIZER_NOT_ASSIGNABLE, CONST_FORMAL_PARAMETER, CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE, CONST_INSTANCE_FIELD, CONST_EVAL_TYPE_BOOL, CONST_EVAL_TYPE_BOOL_NUM_STRING, CONST_EVAL_TYPE_INT, CONST_EVAL_TYPE_NUM, CONST_EVAL_THROWS_EXCEPTION, CONST_WITH_INVALID_TYPE_PARAMETERS, CONST_WITH_NON_CONST, CONST_WITH_NON_CONSTANT_ARGUMENT, CONST_WITH_NON_TYPE, CONST_WITH_TYPE_PARAMETERS, CONST_WITH_UNDEFINED_CONSTRUCTOR, CONST_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT, DEFAULT_VALUE_IN_FUNCTION_TYPE_ALIAS, DUPLICATE_CONSTRUCTOR_DEFAULT, DUPLICATE_CONSTRUCTOR_NAME, DUPLICATE_DEFINITION, DUPLICATE_MEMBER_NAME, DUPLICATE_MEMBER_NAME_INSTANCE_STATIC, DUPLICATE_NAMED_ARGUMENT, EXPORT_INTERNAL_LIBRARY, EXPORT_OF_NON_LIBRARY, EXTENDS_NON_CLASS, EXTENDS_DISALLOWED_CLASS, EXTRA_POSITIONAL_ARGUMENTS, IMPLEMENTS_DISALLOWED_CLASS, FIELD_INITIALIZED_BY_MULTIPLE_INITIALIZERS, FIELD_INITIALIZED_IN_INITIALIZER_AND_DECLARATION, FIELD_INITIALIZED_IN_PARAMETER_AND_INITIALIZER, FINAL_INITIALIZED_IN_DECLARATION_AND_CONSTRUCTOR, FINAL_INITIALIZED_MULTIPLE_TIMES, FIELD_INITIALIZER_FACTORY_CONSTRUCTOR, FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR, FIELD_INITIALIZER_REDIRECTING_CONSTRUCTOR, GETTER_AND_METHOD_WITH_SAME_NAME, IMPLEMENTS_DYNAMIC, IMPLEMENTS_NON_CLASS, IMPLEMENTS_REPEATED, IMPLICIT_THIS_REFERENCE_IN_INITIALIZER, IMPORT_INTERNAL_LIBRARY, IMPORT_OF_NON_LIBRARY, INCONSISTENT_CASE_EXPRESSION_TYPES, INITIALIZER_FOR_NON_EXISTANT_FIELD, INITIALIZER_FOR_STATIC_FIELD, INITIALIZING_FORMAL_FOR_NON_EXISTANT_FIELD, INITIALIZING_FORMAL_FOR_STATIC_FIELD, INVALID_CONSTANT, INVALID_CONSTRUCTOR_NAME, INVALID_FACTORY_NAME_NOT_A_CLASS, INVALID_OVERRIDE_DEFAULT_VALUE, INVALID_OVERRIDE_NAMED, INVALID_OVERRIDE_POSITIONAL, INVALID_OVERRIDE_REQUIRED, INVALID_REFERENCE_TO_THIS, INVALID_TYPE_ARGUMENT_FOR_KEY, INVALID_TYPE_ARGUMENT_IN_CONST_LIST, INVALID_TYPE_ARGUMENT_IN_CONST_MAP, INVALID_URI, LABEL_IN_OUTER_SCOPE, LABEL_UNDEFINED, MEMBER_WITH_CLASS_NAME, METHOD_AND_GETTER_WITH_SAME_NAME, MISSING_CONST_IN_LIST_LITERAL, MISSING_CONST_IN_MAP_LITERAL, MIXIN_DECLARES_CONSTRUCTOR, MIXIN_INHERITS_FROM_NOT_OBJECT, MIXIN_OF_NON_CLASS, MIXIN_REFERENCES_SUPER, MIXIN_WITH_NON_CLASS_SUPERCLASS, MULTIPLE_REDIRECTING_CONSTRUCTOR_INVOCATIONS, MULTIPLE_SUPER_INITIALIZERS, NEW_WITH_INVALID_TYPE_PARAMETERS, NON_CONST_MAP_AS_EXPRESSION_STATEMENT, NON_CONSTANT_CASE_EXPRESSION, NON_CONSTANT_DEFAULT_VALUE, NON_CONSTANT_LIST_ELEMENT, NON_CONSTANT_MAP_KEY, NON_CONSTANT_MAP_VALUE, NON_CONSTANT_VALUE_IN_INITIALIZER, NOT_ENOUGH_REQUIRED_ARGUMENTS, NON_GENERATIVE_CONSTRUCTOR, OBJECT_CANNOT_EXTEND_ANOTHER_CLASS, OPTIONAL_PARAMETER_IN_OPERATOR, PART_OF_NON_PART, PREFIX_COLLIDES_WITH_TOP_LEVEL_MEMBER, PRIVATE_OPTIONAL_PARAMETER, RECURSIVE_COMPILE_TIME_CONSTANT, RECURSIVE_CONSTRUCTOR_REDIRECT, RECURSIVE_FACTORY_REDIRECT, RECURSIVE_FUNCTION_TYPE_ALIAS, RECURSIVE_INTERFACE_INHERITANCE, RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_EXTENDS, RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_IMPLEMENTS, REDIRECT_TO_NON_CONST_CONSTRUCTOR, REFERENCE_TO_DECLARED_VARIABLE_IN_INITIALIZER, RESERVED_WORD_AS_IDENTIFIER, RETHROW_OUTSIDE_CATCH, RETURN_IN_GENERATIVE_CONSTRUCTOR, STATIC_TOP_LEVEL_FUNCTION, STATIC_TOP_LEVEL_VARIABLE, SUPER_IN_INVALID_CONTEXT, SUPER_IN_REDIRECTING_CONSTRUCTOR, SUPER_INITIALIZER_IN_OBJECT, UNDEFINED_CLASS, UNDEFINED_CONSTRUCTOR_IN_INITIALIZER, UNDEFINED_CONSTRUCTOR_IN_INITIALIZER_DEFAULT, UNINITIALIZED_FINAL_FIELD, UNDEFINED_NAMED_PARAMETER, URI_DOES_NOT_EXIST, URI_WITH_INTERPOLATION, WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR, WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR_MINUS, WRONG_NUMBER_OF_PARAMETERS_FOR_SETTER, WRONG_NUMBER_OF_TYPE_ARGUMENTS];
+ static final CompileTimeErrorCode WRONG_NUMBER_OF_TYPE_ARGUMENTS = new CompileTimeErrorCode('WRONG_NUMBER_OF_TYPE_ARGUMENTS', 130, "");
+ static final List<CompileTimeErrorCode> values = [AMBIGUOUS_EXPORT, AMBIGUOUS_IMPORT, ARGUMENT_DEFINITION_TEST_NON_PARAMETER, BUILT_IN_IDENTIFIER_AS_TYPE, BUILT_IN_IDENTIFIER_AS_TYPE_NAME, BUILT_IN_IDENTIFIER_AS_TYPEDEF_NAME, BUILT_IN_IDENTIFIER_AS_TYPE_VARIABLE_NAME, CASE_EXPRESSION_TYPE_IMPLEMENTS_EQUALS, COMPILE_TIME_CONSTANT_RAISES_EXCEPTION, CONFLICTING_CONSTRUCTOR_NAME_AND_FIELD, CONFLICTING_CONSTRUCTOR_NAME_AND_METHOD, CONST_CONSTRUCTOR_THROWS_EXCEPTION, CONST_CONSTRUCTOR_WITH_NON_FINAL_FIELD, CONST_FIELD_INITIALIZER_NOT_ASSIGNABLE, CONST_FORMAL_PARAMETER, CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE, CONST_INSTANCE_FIELD, CONST_EVAL_TYPE_BOOL, CONST_EVAL_TYPE_BOOL_NUM_STRING, CONST_EVAL_TYPE_INT, CONST_EVAL_TYPE_NUM, CONST_EVAL_THROWS_EXCEPTION, CONST_WITH_INVALID_TYPE_PARAMETERS, CONST_WITH_NON_CONST, CONST_WITH_NON_CONSTANT_ARGUMENT, CONST_WITH_NON_TYPE, CONST_WITH_TYPE_PARAMETERS, CONST_WITH_UNDEFINED_CONSTRUCTOR, CONST_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT, DEFAULT_VALUE_IN_FUNCTION_TYPE_ALIAS, DUPLICATE_CONSTRUCTOR_DEFAULT, DUPLICATE_CONSTRUCTOR_NAME, DUPLICATE_DEFINITION, DUPLICATE_MEMBER_NAME, DUPLICATE_MEMBER_NAME_INSTANCE_STATIC, DUPLICATE_NAMED_ARGUMENT, EXPORT_INTERNAL_LIBRARY, EXPORT_OF_NON_LIBRARY, EXTENDS_NON_CLASS, EXTENDS_DISALLOWED_CLASS, EXTRA_POSITIONAL_ARGUMENTS, IMPLEMENTS_DISALLOWED_CLASS, FIELD_INITIALIZED_BY_MULTIPLE_INITIALIZERS, FIELD_INITIALIZED_IN_INITIALIZER_AND_DECLARATION, FIELD_INITIALIZED_IN_PARAMETER_AND_INITIALIZER, FINAL_INITIALIZED_IN_DECLARATION_AND_CONSTRUCTOR, FINAL_INITIALIZED_MULTIPLE_TIMES, FIELD_INITIALIZER_FACTORY_CONSTRUCTOR, FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR, FIELD_INITIALIZER_REDIRECTING_CONSTRUCTOR, GETTER_AND_METHOD_WITH_SAME_NAME, IMPLEMENTS_DYNAMIC, IMPLEMENTS_NON_CLASS, IMPLEMENTS_REPEATED, IMPLICIT_THIS_REFERENCE_IN_INITIALIZER, IMPORT_INTERNAL_LIBRARY, IMPORT_OF_NON_LIBRARY, INCONSISTENT_CASE_EXPRESSION_TYPES, INITIALIZER_FOR_NON_EXISTANT_FIELD, INITIALIZER_FOR_STATIC_FIELD, INITIALIZING_FORMAL_FOR_NON_EXISTANT_FIELD, INITIALIZING_FORMAL_FOR_STATIC_FIELD, INVALID_CONSTANT, INVALID_CONSTRUCTOR_NAME, INVALID_FACTORY_NAME_NOT_A_CLASS, INVALID_OVERRIDE_DEFAULT_VALUE, INVALID_OVERRIDE_NAMED, INVALID_OVERRIDE_POSITIONAL, INVALID_OVERRIDE_REQUIRED, INVALID_REFERENCE_TO_THIS, INVALID_TYPE_ARGUMENT_FOR_KEY, INVALID_TYPE_ARGUMENT_IN_CONST_LIST, INVALID_TYPE_ARGUMENT_IN_CONST_MAP, INVALID_URI, LABEL_IN_OUTER_SCOPE, LABEL_UNDEFINED, MEMBER_WITH_CLASS_NAME, METHOD_AND_GETTER_WITH_SAME_NAME, MISSING_CONST_IN_LIST_LITERAL, MISSING_CONST_IN_MAP_LITERAL, MIXIN_DECLARES_CONSTRUCTOR, MIXIN_INHERITS_FROM_NOT_OBJECT, MIXIN_OF_NON_CLASS, MIXIN_REFERENCES_SUPER, MIXIN_WITH_NON_CLASS_SUPERCLASS, MULTIPLE_REDIRECTING_CONSTRUCTOR_INVOCATIONS, MULTIPLE_SUPER_INITIALIZERS, NEW_WITH_INVALID_TYPE_PARAMETERS, NON_CONST_MAP_AS_EXPRESSION_STATEMENT, NON_CONSTANT_CASE_EXPRESSION, NON_CONSTANT_DEFAULT_VALUE, NON_CONSTANT_LIST_ELEMENT, NON_CONSTANT_MAP_KEY, NON_CONSTANT_MAP_VALUE, NON_CONSTANT_VALUE_IN_INITIALIZER, NOT_ENOUGH_REQUIRED_ARGUMENTS, NON_GENERATIVE_CONSTRUCTOR, OBJECT_CANNOT_EXTEND_ANOTHER_CLASS, OPTIONAL_PARAMETER_IN_OPERATOR, PART_OF_NON_PART, PREFIX_COLLIDES_WITH_TOP_LEVEL_MEMBER, PRIVATE_OPTIONAL_PARAMETER, RECURSIVE_COMPILE_TIME_CONSTANT, RECURSIVE_CONSTRUCTOR_REDIRECT, RECURSIVE_FACTORY_REDIRECT, RECURSIVE_FUNCTION_TYPE_ALIAS, RECURSIVE_INTERFACE_INHERITANCE, RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_EXTENDS, RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_IMPLEMENTS, REDIRECT_TO_NON_CONST_CONSTRUCTOR, REFERENCE_TO_DECLARED_VARIABLE_IN_INITIALIZER, RESERVED_WORD_AS_IDENTIFIER, RETHROW_OUTSIDE_CATCH, RETURN_IN_GENERATIVE_CONSTRUCTOR, STATIC_TOP_LEVEL_FUNCTION, STATIC_TOP_LEVEL_VARIABLE, SUPER_IN_INVALID_CONTEXT, SUPER_IN_REDIRECTING_CONSTRUCTOR, SUPER_INITIALIZER_IN_OBJECT, TYPE_ARGUMENTS_FOR_NON_GENERIC_CLASS, UNDEFINED_CLASS, UNDEFINED_CONSTRUCTOR_IN_INITIALIZER, UNDEFINED_CONSTRUCTOR_IN_INITIALIZER_DEFAULT, UNINITIALIZED_FINAL_FIELD, UNDEFINED_NAMED_PARAMETER, URI_DOES_NOT_EXIST, URI_WITH_INTERPOLATION, WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR, WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR_MINUS, WRONG_NUMBER_OF_PARAMETERS_FOR_SETTER, WRONG_NUMBER_OF_TYPE_ARGUMENTS];
/// The name of this enum constant, as declared in the enum declaration.
final String name;
@@ -1539,7 +1549,7 @@
String toString() => name;
}
/**
- * The enumeration `PubSuggestionCode` defines the suggestions used for reporting deviations
+ * The enumeration {@code PubSuggestionCode} defines the suggestions used for reporting deviations
* from pub best practices. The convention for this class is for the name of the bad practice to
* indicate the problem that caused the suggestion to be generated and for the message to explain
* what is wrong and, when appropriate, how the situation can be corrected.
@@ -1549,7 +1559,7 @@
/**
* It is a bad practice for a source file in a package "lib" directory hierarchy to traverse
* outside that directory hierarchy. For example, a source file in the "lib" directory should not
- * contain a directive such as `import '../web/some.dart'` which references a file outside
+ * contain a directive such as {@code import '../web/some.dart'} which references a file outside
* the lib directory.
*/
static final PubSuggestionCode FILE_IMPORT_INSIDE_LIB_REFERENCES_FILE_OUTSIDE = new PubSuggestionCode('FILE_IMPORT_INSIDE_LIB_REFERENCES_FILE_OUTSIDE', 0, "A file in the 'lib' directory hierarchy should not reference a file outside that hierarchy");
@@ -1557,7 +1567,7 @@
/**
* It is a bad practice for a source file ouside a package "lib" directory hierarchy to traverse
* into that directory hierarchy. For example, a source file in the "web" directory should not
- * contain a directive such as `import '../lib/some.dart'` which references a file inside
+ * contain a directive such as {@code import '../lib/some.dart'} which references a file inside
* the lib directory.
*/
static final PubSuggestionCode FILE_IMPORT_OUTSIDE_LIB_REFERENCES_FILE_INSIDE = new PubSuggestionCode('FILE_IMPORT_OUTSIDE_LIB_REFERENCES_FILE_INSIDE', 1, "A file outside the 'lib' directory hierarchy should not reference a file inside that hierarchy. Use a package: reference instead.");
@@ -1565,7 +1575,7 @@
/**
* It is a bad practice for a package import to reference anything outside the given package, or
* more generally, it is bad practice for a package import to contain a "..". For example, a
- * source file should not contain a directive such as `import 'package:foo/../some.dart'`.
+ * source file should not contain a directive such as {@code import 'package:foo/../some.dart'}.
*/
static final PubSuggestionCode PACKAGE_IMPORT_CONTAINS_DOT_DOT = new PubSuggestionCode('PACKAGE_IMPORT_CONTAINS_DOT_DOT', 2, "A package import should not contain '..'");
static final List<PubSuggestionCode> values = [FILE_IMPORT_INSIDE_LIB_REFERENCES_FILE_OUTSIDE, FILE_IMPORT_OUTSIDE_LIB_REFERENCES_FILE_INSIDE, PACKAGE_IMPORT_CONTAINS_DOT_DOT];
@@ -1596,7 +1606,7 @@
String toString() => name;
}
/**
- * The enumeration `StaticWarningCode` defines the error codes used for static warnings. The
+ * The enumeration {@code StaticWarningCode} defines the error codes used for static warnings. The
* convention for this class is for the name of the error code to indicate the problem that caused
* the error to be generated and for the error message to explain what is wrong and, when
* appropriate, how the problem can be corrected.
@@ -1608,10 +1618,10 @@
* 14.1 Imports: If a name <i>N</i> is referenced by a library <i>L</i> and <i>N</i> is introduced
* into the top level scope <i>L</i> by more than one import then:
* <ol>
- * * It is a static warning if <i>N</i> is used as a type annotation.
- * * In checked mode, it is a dynamic error if <i>N</i> is used as a type annotation and
+ * <li>It is a static warning if <i>N</i> is used as a type annotation.
+ * <li>In checked mode, it is a dynamic error if <i>N</i> is used as a type annotation and
* referenced during a subtype test.
- * * Otherwise, it is a compile-time error.
+ * <li>Otherwise, it is a compile-time error.
* </ol>
* @param ambiguousTypeName the name of the ambiguous type
* @param firstLibraryName the name of the first library that the type is found
@@ -1623,17 +1633,17 @@
* 12.11.1 New: It is a static warning if the static type of <i>a<sub>i</sub>, 1 <= i <= n+
* k</i> may not be assigned to the type of the corresponding formal parameter of the constructor
* <i>T.id</i> (respectively <i>T</i>).
- *
+ * <p>
* 12.11.2 Const: It is a static warning if the static type of <i>a<sub>i</sub>, 1 <= i <=
* n+ k</i> may not be assigned to the type of the corresponding formal parameter of the
* constructor <i>T.id</i> (respectively <i>T</i>).
- *
+ * <p>
* 12.14.2 Binding Actuals to Formals: Let <i>T<sub>i</sub></i> be the static type of
* <i>a<sub>i</sub></i>, let <i>S<sub>i</sub></i> be the type of <i>p<sub>i</sub>, 1 <= i <=
* n+k</i> and let <i>S<sub>q</sub></i> be the type of the named parameter <i>q</i> of <i>f</i>.
* It is a static warning if <i>T<sub>j</sub></i> may not be assigned to <i>S<sub>j</sub>, 1 <=
* j <= m</i>.
- *
+ * <p>
* 12.14.2 Binding Actuals to Formals: Furthermore, each <i>q<sub>i</sub>, 1 <= i <= l</i>,
* must have a corresponding named parameter in the set <i>{p<sub>n+1</sub>, …
* p<sub>n+k</sub>}</i> or a static warning occurs. It is a static warning if
@@ -1764,7 +1774,7 @@
* <i>e</i> proceeds as follows: First, the expression <i>e</i> is evaluated to an object
* <i>o</i>. Then, the instance variable <i>v</i> of the object denoted by this is bound to
* <i>o</i>.
- *
+ * <p>
* 12.14.2 Binding Actuals to Formals: Let <i>T<sub>i</sub></i> be the static type of
* <i>a<sub>i</sub></i>, let <i>S<sub>i</sub></i> be the type of <i>p<sub>i</sub>, 1 <= i <=
* n+k</i> and let <i>S<sub>q</sub></i> be the type of the named parameter <i>q</i> of <i>f</i>.
@@ -1803,7 +1813,7 @@
* … m<sub>k</sub></i> with the same name <i>n</i> that would be inherited (because
* identically named members existed in several superinterfaces) then at most one member is
* inherited.
- *
+ * <p>
* If some but not all of the <i>m<sub>i</sub>, 1 <= i <= k</i>, are getters, or if some but
* not all of the <i>m<sub>i</sub></i> are setters, none of the <i>m<sub>i</sub></i> are
* inherited, and a static warning is issued.
@@ -1889,15 +1899,7 @@
* a formal parameter <i>p</i> and the signature of <i>m1</i> specifies a different default value
* for <i>p</i>.
*/
- static final StaticWarningCode INVALID_OVERRIDE_DIFFERENT_DEFAULT_VALUES_NAMED = new StaticWarningCode('INVALID_OVERRIDE_DIFFERENT_DEFAULT_VALUES_NAMED', 32, "Parameters cannot override default values, this method overrides '%s.%s' where '%s' has a different value");
-
- /**
- * 7.1 Instance Methods: It is a static warning if an instance method <i>m1</i> overrides an
- * instance member <i>m2</i>, the signature of <i>m2</i> explicitly specifies a default value for
- * a formal parameter <i>p</i> and the signature of <i>m1</i> specifies a different default value
- * for <i>p</i>.
- */
- static final StaticWarningCode INVALID_OVERRIDE_DIFFERENT_DEFAULT_VALUES_POSITIONAL = new StaticWarningCode('INVALID_OVERRIDE_DIFFERENT_DEFAULT_VALUES_POSITIONAL', 33, "Parameters cannot override default values, this method overrides '%s.%s' where this positional parameter has a different value");
+ static final StaticWarningCode INVALID_OVERRIDE_DIFFERENT_DEFAULT_VALUES = new StaticWarningCode('INVALID_OVERRIDE_DIFFERENT_DEFAULT_VALUES', 32, "");
/**
* 7.3 Setters: It is a static warning if a setter <i>m1</i> overrides a setter <i>m2</i> and the
@@ -1908,7 +1910,7 @@
* @param className the name of the class where the overridden setter is declared
* @see #INVALID_METHOD_OVERRIDE_NORMAL_PARAM_TYPE
*/
- static final StaticWarningCode INVALID_SETTER_OVERRIDE_NORMAL_PARAM_TYPE = new StaticWarningCode('INVALID_SETTER_OVERRIDE_NORMAL_PARAM_TYPE', 34, "The parameter type '%s' is not assignable to '%s' as required by the setter it is overriding from '%s'");
+ static final StaticWarningCode INVALID_SETTER_OVERRIDE_NORMAL_PARAM_TYPE = new StaticWarningCode('INVALID_SETTER_OVERRIDE_NORMAL_PARAM_TYPE', 33, "The parameter type '%s' is not assignable to '%s' as required by the setter it is overriding from '%s'");
/**
* 12.15.4 Super Invocation: A super method invocation <i>i</i> has the form
@@ -1916,27 +1918,27 @@
* x<sub>n+k</sub>: a<sub>n+k</sub>)</i>. If <i>S.m</i> exists, it is a static warning if the type
* <i>F</i> of <i>S.m</i> may not be assigned to a function type.
*/
- static final StaticWarningCode INVOCATION_OF_NON_FUNCTION = new StaticWarningCode('INVOCATION_OF_NON_FUNCTION', 35, "");
+ static final StaticWarningCode INVOCATION_OF_NON_FUNCTION = new StaticWarningCode('INVOCATION_OF_NON_FUNCTION', 34, "");
/**
* 7.3 Setters: It is a static warning if a class has a setter named <i>v=</i> with argument type
* <i>T</i> and a getter named <i>v</i> with return type <i>S</i>, and <i>T</i> may not be
* assigned to <i>S</i>.
*/
- static final StaticWarningCode MISMATCHED_GETTER_AND_SETTER_TYPES = new StaticWarningCode('MISMATCHED_GETTER_AND_SETTER_TYPES', 36, "The parameter type for setter '%s' is %s which is not assignable to its getter (of type %s)");
+ static final StaticWarningCode MISMATCHED_GETTER_AND_SETTER_TYPES = new StaticWarningCode('MISMATCHED_GETTER_AND_SETTER_TYPES', 35, "The parameter type for setter '%s' is %s which is not assignable to its getter (of type %s)");
/**
* 12.11.1 New: It is a static warning if <i>q</i> is a constructor of an abstract class and
* <i>q</i> is not a factory constructor.
*/
- static final StaticWarningCode NEW_WITH_ABSTRACT_CLASS = new StaticWarningCode('NEW_WITH_ABSTRACT_CLASS', 37, "Abstract classes cannot be created with a 'new' expression");
+ static final StaticWarningCode NEW_WITH_ABSTRACT_CLASS = new StaticWarningCode('NEW_WITH_ABSTRACT_CLASS', 36, "Abstract classes cannot be created with a 'new' expression");
/**
* 12.11.1 New: It is a static warning if <i>T</i> is not a class accessible in the current scope,
* optionally followed by type arguments.
* @param name the name of the non-type element
*/
- static final StaticWarningCode NEW_WITH_NON_TYPE = new StaticWarningCode('NEW_WITH_NON_TYPE', 38, "The name '%s' is not a class");
+ static final StaticWarningCode NEW_WITH_NON_TYPE = new StaticWarningCode('NEW_WITH_NON_TYPE', 37, "The name '%s' is not a class");
/**
* 12.11.1 New: If <i>T</i> is a class or parameterized type accessible in the current scope then:
@@ -1947,7 +1949,7 @@
* a<sub>n+1</sub>, … x<sub>n+k</sub>: a<sub>n+kM/sub>)</i> it is a static warning if the
* type <i>T</i> does not declare a constructor with the same name as the declaration of <i>T</i>.
*/
- static final StaticWarningCode NEW_WITH_UNDEFINED_CONSTRUCTOR = new StaticWarningCode('NEW_WITH_UNDEFINED_CONSTRUCTOR', 39, "The class '%s' does not have a constructor '%s'");
+ static final StaticWarningCode NEW_WITH_UNDEFINED_CONSTRUCTOR = new StaticWarningCode('NEW_WITH_UNDEFINED_CONSTRUCTOR', 38, "The class '%s' does not have a constructor '%s'");
/**
* 12.11.1 New: If <i>T</i> is a class or parameterized type accessible in the current scope then:
@@ -1958,25 +1960,12 @@
* a<sub>n+1</sub>, … x<sub>n+k</sub>: a<sub>n+kM/sub>)</i> it is a static warning if the
* type <i>T</i> does not declare a constructor with the same name as the declaration of <i>T</i>.
*/
- static final StaticWarningCode NEW_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT = new StaticWarningCode('NEW_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT', 40, "The class '%s' does not have a default constructor");
-
- /**
- * 7.6.1 Generative Constructors: If no superinitializer is provided, an implicit superinitializer
- * of the form <b>super</b>() is added at the end of <i>k</i>'s initializer list, unless the
- * enclosing class is class <i>Object</i>.
- */
- static final StaticWarningCode NO_DEFAULT_SUPER_CONSTRUCTOR_EXPLICIT = new StaticWarningCode('NO_DEFAULT_SUPER_CONSTRUCTOR_EXPLICIT', 41, "The class '%s' does not have a default constructor");
-
- /**
- * 7.6 Constructors: Iff no constructor is specified for a class <i>C</i>, it implicitly has a
- * default constructor C() : <b>super<b>() {}, unless <i>C</i> is class <i>Object</i>.
- */
- static final StaticWarningCode NO_DEFAULT_SUPER_CONSTRUCTOR_IMPLICIT = new StaticWarningCode('NO_DEFAULT_SUPER_CONSTRUCTOR_IMPLICIT', 42, "The class '%s' does not have a default constructor");
+ static final StaticWarningCode NEW_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT = new StaticWarningCode('NEW_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT', 39, "The class '%s' does not have a default constructor");
/**
* 7.9.1 Inheritance and Overriding: It is a static warning if a non-abstract class inherits an
* abstract method.
- *
+ * <p>
* 7.10 Superinterfaces: It is a static warning if the implicit interface of a non-abstract class
* <i>C</i> includes an instance member <i>m</i> and <i>C</i> does not declare or inherit a
* corresponding instance member <i>m</i>.
@@ -1998,12 +1987,12 @@
* @param name fourth member name
* @param additionalCount the number of additional missing members that aren't listed
*/
- static final StaticWarningCode NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_FIVE_PLUS = new StaticWarningCode('NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_FIVE_PLUS', 43, "Missing inherited members: %s'%s.%s', %s'%s.%s', %s'%s.%s', %s'%s.%s' and %d more");
+ static final StaticWarningCode NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_FIVE_PLUS = new StaticWarningCode('NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_FIVE_PLUS', 40, "Missing inherited members: %s'%s.%s', %s'%s.%s', %s'%s.%s', %s'%s.%s' and %d more");
/**
* 7.9.1 Inheritance and Overriding: It is a static warning if a non-abstract class inherits an
* abstract method.
- *
+ * <p>
* 7.10 Superinterfaces: It is a static warning if the implicit interface of a non-abstract class
* <i>C</i> includes an instance member <i>m</i> and <i>C</i> does not declare or inherit a
* corresponding instance member <i>m</i>.
@@ -2024,12 +2013,12 @@
* @param enclosingClass enclosing class of the fourth missing member
* @param name fourth member name
*/
- static final StaticWarningCode NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_FOUR = new StaticWarningCode('NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_FOUR', 44, "Missing inherited members: %s'%s.%s', %s'%s.%s', %s'%s.%s' and %s'%s.%s'");
+ static final StaticWarningCode NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_FOUR = new StaticWarningCode('NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_FOUR', 41, "Missing inherited members: %s'%s.%s', %s'%s.%s', %s'%s.%s' and %s'%s.%s'");
/**
* 7.9.1 Inheritance and Overriding: It is a static warning if a non-abstract class inherits an
* abstract method.
- *
+ * <p>
* 7.10 Superinterfaces: It is a static warning if the implicit interface of a non-abstract class
* <i>C</i> includes an instance member <i>m</i> and <i>C</i> does not declare or inherit a
* corresponding instance member <i>m</i>.
@@ -2037,12 +2026,12 @@
* @param enclosingClass enclosing class of the missing member
* @param name member name
*/
- static final StaticWarningCode NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE = new StaticWarningCode('NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE', 45, "Missing inherited member %s'%s.%s'");
+ static final StaticWarningCode NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE = new StaticWarningCode('NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE', 42, "Missing inherited member %s'%s.%s'");
/**
* 7.9.1 Inheritance and Overriding: It is a static warning if a non-abstract class inherits an
* abstract method.
- *
+ * <p>
* 7.10 Superinterfaces: It is a static warning if the implicit interface of a non-abstract class
* <i>C</i> includes an instance member <i>m</i> and <i>C</i> does not declare or inherit a
* corresponding instance member <i>m</i>.
@@ -2059,12 +2048,12 @@
* @param enclosingClass enclosing class of the third missing member
* @param name third member name
*/
- static final StaticWarningCode NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_THREE = new StaticWarningCode('NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_THREE', 46, "Missing inherited members: %s'%s.%s', %s'%s.%s' and %s'%s.%s'");
+ static final StaticWarningCode NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_THREE = new StaticWarningCode('NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_THREE', 43, "Missing inherited members: %s'%s.%s', %s'%s.%s' and %s'%s.%s'");
/**
* 7.9.1 Inheritance and Overriding: It is a static warning if a non-abstract class inherits an
* abstract method.
- *
+ * <p>
* 7.10 Superinterfaces: It is a static warning if the implicit interface of a non-abstract class
* <i>C</i> includes an instance member <i>m</i> and <i>C</i> does not declare or inherit a
* corresponding instance member <i>m</i>.
@@ -2077,7 +2066,7 @@
* @param enclosingClass enclosing class of the second missing member
* @param name second member name
*/
- static final StaticWarningCode NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_TWO = new StaticWarningCode('NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_TWO', 47, "Missing inherited members: %s'%s.%s' and %s'%s.%s'");
+ static final StaticWarningCode NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_TWO = new StaticWarningCode('NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_TWO', 44, "Missing inherited members: %s'%s.%s' and %s'%s.%s'");
/**
* 13.11 Try: An on-catch clause of the form <i>on T catch (p<sub>1</sub>, p<sub>2</sub>) s</i> or
@@ -2086,38 +2075,38 @@
* catch clause.
* @param name the name of the non-type element
*/
- static final StaticWarningCode NON_TYPE_IN_CATCH_CLAUSE = new StaticWarningCode('NON_TYPE_IN_CATCH_CLAUSE', 48, "The name '%s' is not a type and cannot be used in an on-catch clause");
+ static final StaticWarningCode NON_TYPE_IN_CATCH_CLAUSE = new StaticWarningCode('NON_TYPE_IN_CATCH_CLAUSE', 45, "The name '%s' is not a type and cannot be used in an on-catch clause");
/**
* 7.1.1 Operators: It is a static warning if the return type of the user-declared operator \[\]= is
* explicitly declared and not void.
*/
- static final StaticWarningCode NON_VOID_RETURN_FOR_OPERATOR = new StaticWarningCode('NON_VOID_RETURN_FOR_OPERATOR', 49, "The return type of the operator []= must be 'void'");
+ static final StaticWarningCode NON_VOID_RETURN_FOR_OPERATOR = new StaticWarningCode('NON_VOID_RETURN_FOR_OPERATOR', 46, "The return type of the operator []= must be 'void'");
/**
* 7.3 Setters: It is a static warning if a setter declares a return type other than void.
*/
- static final StaticWarningCode NON_VOID_RETURN_FOR_SETTER = new StaticWarningCode('NON_VOID_RETURN_FOR_SETTER', 50, "The return type of the setter must be 'void'");
+ static final StaticWarningCode NON_VOID_RETURN_FOR_SETTER = new StaticWarningCode('NON_VOID_RETURN_FOR_SETTER', 47, "The return type of the setter must be 'void'");
/**
- * 15.1 Static Types: A type <i>T</i> is malformed iff: * <i>T</i> has the form <i>id</i> or the
+ * 15.1 Static Types: A type <i>T</i> is malformed iff: <li><i>T</i> has the form <i>id</i> or the
* form <i>prefix.id</i>, and in the enclosing lexical scope, the name <i>id</i> (respectively
- * <i>prefix.id</i>) does not denote a type. * <i>T</i> denotes a type variable in the
- * enclosing lexical scope, but occurs in the signature or body of a static member. *
+ * <i>prefix.id</i>) does not denote a type.</li> <li><i>T</i> denotes a type variable in the
+ * enclosing lexical scope, but occurs in the signature or body of a static member.</li> <li>
* <i>T</i> is a parameterized type of the form <i>G<S<sub>1</sub>, .., S<sub>n</sub>></i>,
- * and <i>G</i> is malformed.
- *
+ * and <i>G</i> is malformed.</li></ul>
+ * <p>
* Any use of a malformed type gives rise to a static warning.
* @param nonTypeName the name that is not a type
*/
- static final StaticWarningCode NOT_A_TYPE = new StaticWarningCode('NOT_A_TYPE', 51, "%s is not a type");
+ static final StaticWarningCode NOT_A_TYPE = new StaticWarningCode('NOT_A_TYPE', 48, "%s is not a type");
/**
* 12.14.2 Binding Actuals to Formals: It is a static warning if <i>m < h</i> or if <i>m > n</i>.
* @param requiredCount the expected number of required arguments
* @param argumentCount the actual number of positional arguments given
*/
- static final StaticWarningCode NOT_ENOUGH_REQUIRED_ARGUMENTS = new StaticWarningCode('NOT_ENOUGH_REQUIRED_ARGUMENTS', 52, "%d required argument(s) expected, but %d found");
+ static final StaticWarningCode NOT_ENOUGH_REQUIRED_ARGUMENTS = new StaticWarningCode('NOT_ENOUGH_REQUIRED_ARGUMENTS', 49, "%d required argument(s) expected, but %d found");
/**
* 14.3 Parts: It is a static warning if the referenced part declaration <i>p</i> names a library
@@ -2125,7 +2114,7 @@
* @param expectedLibraryName the name of expected library name
* @param actualLibraryName the non-matching actual library name from the "part of" declaration
*/
- static final StaticWarningCode PART_OF_DIFFERENT_LIBRARY = new StaticWarningCode('PART_OF_DIFFERENT_LIBRARY', 53, "Expected this library to be part of '%s', not '%s'");
+ static final StaticWarningCode PART_OF_DIFFERENT_LIBRARY = new StaticWarningCode('PART_OF_DIFFERENT_LIBRARY', 50, "Expected this library to be part of '%s', not '%s'");
/**
* 7.6.2 Factories: It is a static warning if the function type of <i>k'</i> is not a subtype of
@@ -2133,7 +2122,7 @@
* @param redirectedName the name of the redirected constructor
* @param redirectingName the name of the redirecting constructor
*/
- static final StaticWarningCode REDIRECT_TO_INVALID_FUNCTION_TYPE = new StaticWarningCode('REDIRECT_TO_INVALID_FUNCTION_TYPE', 54, "The redirected constructor '%s' has incompatible parameters with '%s'");
+ static final StaticWarningCode REDIRECT_TO_INVALID_FUNCTION_TYPE = new StaticWarningCode('REDIRECT_TO_INVALID_FUNCTION_TYPE', 51, "The redirected constructor '%s' has incompatible parameters with '%s'");
/**
* 7.6.2 Factories: It is a static warning if the function type of <i>k'</i> is not a subtype of
@@ -2141,62 +2130,62 @@
* @param redirectedName the name of the redirected constructor return type
* @param redirectingName the name of the redirecting constructor return type
*/
- static final StaticWarningCode REDIRECT_TO_INVALID_RETURN_TYPE = new StaticWarningCode('REDIRECT_TO_INVALID_RETURN_TYPE', 55, "The return type '%s' of the redirected constructor is not a subclass of '%s'");
+ static final StaticWarningCode REDIRECT_TO_INVALID_RETURN_TYPE = new StaticWarningCode('REDIRECT_TO_INVALID_RETURN_TYPE', 52, "The return type '%s' of the redirected constructor is not a subclass of '%s'");
/**
* 7.6.2 Factories: It is a static warning if type does not denote a class accessible in the
* current scope; if type does denote such a class <i>C</i> it is a static warning if the
* referenced constructor (be it <i>type</i> or <i>type.id</i>) is not a constructor of <i>C</i>.
*/
- static final StaticWarningCode REDIRECT_TO_MISSING_CONSTRUCTOR = new StaticWarningCode('REDIRECT_TO_MISSING_CONSTRUCTOR', 56, "The constructor '%s' could not be found in '%s'");
+ static final StaticWarningCode REDIRECT_TO_MISSING_CONSTRUCTOR = new StaticWarningCode('REDIRECT_TO_MISSING_CONSTRUCTOR', 53, "The constructor '%s' could not be found in '%s'");
/**
* 7.6.2 Factories: It is a static warning if type does not denote a class accessible in the
* current scope; if type does denote such a class <i>C</i> it is a static warning if the
* referenced constructor (be it <i>type</i> or <i>type.id</i>) is not a constructor of <i>C</i>.
*/
- static final StaticWarningCode REDIRECT_TO_NON_CLASS = new StaticWarningCode('REDIRECT_TO_NON_CLASS', 57, "The name '%s' is not a type and cannot be used in a redirected constructor");
+ static final StaticWarningCode REDIRECT_TO_NON_CLASS = new StaticWarningCode('REDIRECT_TO_NON_CLASS', 54, "The name '%s' is not a type and cannot be used in a redirected constructor");
/**
* 13.11 Return: Let <i>f</i> be the function immediately enclosing a return statement of the form
* <i>return;</i> It is a static warning if both of the following conditions hold:
* <ol>
- * * <i>f</i> is not a generative constructor.
- * * The return type of <i>f</i> may not be assigned to void.
+ * <li><i>f</i> is not a generative constructor.
+ * <li>The return type of <i>f</i> may not be assigned to void.
* </ol>
*/
- static final StaticWarningCode RETURN_WITHOUT_VALUE = new StaticWarningCode('RETURN_WITHOUT_VALUE', 58, "Missing return value after 'return'");
+ static final StaticWarningCode RETURN_WITHOUT_VALUE = new StaticWarningCode('RETURN_WITHOUT_VALUE', 55, "Missing return value after 'return'");
/**
* 12.15.3 Static Invocation: It is a static warning if <i>C</i> does not declare a static method
* or getter <i>m</i>.
* @param memberName the name of the instance member
*/
- static final StaticWarningCode STATIC_ACCESS_TO_INSTANCE_MEMBER = new StaticWarningCode('STATIC_ACCESS_TO_INSTANCE_MEMBER', 59, "Instance member '%s' cannot be accessed using static access");
+ static final StaticWarningCode STATIC_ACCESS_TO_INSTANCE_MEMBER = new StaticWarningCode('STATIC_ACCESS_TO_INSTANCE_MEMBER', 56, "Instance member '%s' cannot be accessed using static access");
/**
* 13.9 Switch: It is a static warning if the type of <i>e</i> may not be assigned to the type of
* <i>e<sub>k</sub></i>.
*/
- static final StaticWarningCode SWITCH_EXPRESSION_NOT_ASSIGNABLE = new StaticWarningCode('SWITCH_EXPRESSION_NOT_ASSIGNABLE', 60, "Type '%s' of the switch expression is not assignable to the type '%s' of case expressions");
+ static final StaticWarningCode SWITCH_EXPRESSION_NOT_ASSIGNABLE = new StaticWarningCode('SWITCH_EXPRESSION_NOT_ASSIGNABLE', 57, "Type '%s' of the switch expression is not assignable to the type '%s' of case expressions");
/**
* 12.31 Type Test: It is a static warning if <i>T</i> does not denote a type available in the
* current lexical scope.
*/
- static final StaticWarningCode TYPE_TEST_NON_TYPE = new StaticWarningCode('TYPE_TEST_NON_TYPE', 61, "The name '%s' is not a type and cannot be used in an 'is' expression");
+ static final StaticWarningCode TYPE_TEST_NON_TYPE = new StaticWarningCode('TYPE_TEST_NON_TYPE', 58, "The name '%s' is not a type and cannot be used in an 'is' expression");
/**
- * 15.1 Static Types: A type <i>T</i> is malformed iff: * <i>T</i> has the form <i>id</i> or the
+ * 15.1 Static Types: A type <i>T</i> is malformed iff: <li><i>T</i> has the form <i>id</i> or the
* form <i>prefix.id</i>, and in the enclosing lexical scope, the name <i>id</i> (respectively
- * <i>prefix.id</i>) does not denote a type. * <i>T</i> denotes a type variable in the
- * enclosing lexical scope, but occurs in the signature or body of a static member. *
+ * <i>prefix.id</i>) does not denote a type.</li> <li><i>T</i> denotes a type variable in the
+ * enclosing lexical scope, but occurs in the signature or body of a static member.</li> <li>
* <i>T</i> is a parameterized type of the form <i>G<S<sub>1</sub>, .., S<sub>n</sub>></i>,
- * and <i>G</i> is malformed.
- *
+ * and <i>G</i> is malformed.</li></ul>
+ * <p>
* Any use of a malformed type gives rise to a static warning.
*/
- static final StaticWarningCode TYPE_VARIABLE_IN_STATIC_SCOPE = new StaticWarningCode('TYPE_VARIABLE_IN_STATIC_SCOPE', 62, "");
+ static final StaticWarningCode TYPE_VARIABLE_IN_STATIC_SCOPE = new StaticWarningCode('TYPE_VARIABLE_IN_STATIC_SCOPE', 59, "");
/**
* 12.15.3 Static Invocation: A static method invocation <i>i</i> has the form
@@ -2204,12 +2193,12 @@
* x<sub>n+k</sub>: a<sub>n+k</sub>)</i>. It is a static warning if <i>C</i> does not denote a
* class in the current scope.
*/
- static final StaticWarningCode UNDEFINED_CLASS = new StaticWarningCode('UNDEFINED_CLASS', 63, "Undefined class '%s'");
+ static final StaticWarningCode UNDEFINED_CLASS = new StaticWarningCode('UNDEFINED_CLASS', 60, "Undefined class '%s'");
/**
- * Same as [UNDEFINED_CLASS], but to catch using "boolean" instead of "bool".
+ * Same as {@link #UNDEFINED_CLASS}, but to catch using "boolean" instead of "bool".
*/
- static final StaticWarningCode UNDEFINED_CLASS_BOOLEAN = new StaticWarningCode('UNDEFINED_CLASS_BOOLEAN', 64, "Undefined class 'boolean'; did you mean 'bool'?");
+ static final StaticWarningCode UNDEFINED_CLASS_BOOLEAN = new StaticWarningCode('UNDEFINED_CLASS_BOOLEAN', 61, "Undefined class 'boolean'; did you mean 'bool'?");
/**
* 12.17 Getter Invocation: It is a static warning if there is no class <i>C</i> in the enclosing
@@ -2218,7 +2207,7 @@
* @param getterName the name of the getter
* @param enclosingType the name of the enclosing type where the getter is being looked for
*/
- static final StaticWarningCode UNDEFINED_GETTER = new StaticWarningCode('UNDEFINED_GETTER', 65, "There is no such getter '%s' in '%s'");
+ static final StaticWarningCode UNDEFINED_GETTER = new StaticWarningCode('UNDEFINED_GETTER', 62, "There is no such getter '%s' in '%s'");
/**
* 12.30 Identifier Reference: It is as static warning if an identifier expression of the form
@@ -2226,7 +2215,7 @@
* setter) or variable initializer and there is no declaration <i>d</i> with name <i>id</i> in the
* lexical scope enclosing the expression.
*/
- static final StaticWarningCode UNDEFINED_IDENTIFIER = new StaticWarningCode('UNDEFINED_IDENTIFIER', 66, "Undefined name '%s'");
+ static final StaticWarningCode UNDEFINED_IDENTIFIER = new StaticWarningCode('UNDEFINED_IDENTIFIER', 63, "Undefined name '%s'");
/**
* 12.14.2 Binding Actuals to Formals: Furthermore, each <i>q<sub>i</sub></i>, <i>1<=i<=l</i>,
@@ -2234,21 +2223,21 @@
* <i>p<sub>n+k</sub></i>} or a static warning occurs.
* @param name the name of the requested named parameter
*/
- static final StaticWarningCode UNDEFINED_NAMED_PARAMETER = new StaticWarningCode('UNDEFINED_NAMED_PARAMETER', 67, "The named parameter '%s' is not defined");
+ static final StaticWarningCode UNDEFINED_NAMED_PARAMETER = new StaticWarningCode('UNDEFINED_NAMED_PARAMETER', 64, "The named parameter '%s' is not defined");
/**
* 12.18 Assignment: It is as static warning if an assignment of the form <i>v = e</i> occurs
* inside a top level or static function (be it function, method, getter, or setter) or variable
* initializer and there is no declaration <i>d</i> with name <i>v=</i> in the lexical scope
* enclosing the assignment.
- *
+ * <p>
* 12.18 Assignment: It is a static warning if there is no class <i>C</i> in the enclosing lexical
* scope of the assignment, or if <i>C</i> does not declare, implicitly or explicitly, a setter
* <i>v=</i>.
* @param setterName the name of the getter
* @param enclosingType the name of the enclosing type where the setter is being looked for
*/
- static final StaticWarningCode UNDEFINED_SETTER = new StaticWarningCode('UNDEFINED_SETTER', 68, "There is no such setter '%s' in '%s'");
+ static final StaticWarningCode UNDEFINED_SETTER = new StaticWarningCode('UNDEFINED_SETTER', 65, "There is no such setter '%s' in '%s'");
/**
* 12.15.3 Static Invocation: It is a static warning if <i>C</i> does not declare a static method
@@ -2256,8 +2245,8 @@
* @param methodName the name of the method
* @param enclosingType the name of the enclosing type where the method is being looked for
*/
- static final StaticWarningCode UNDEFINED_STATIC_METHOD_OR_GETTER = new StaticWarningCode('UNDEFINED_STATIC_METHOD_OR_GETTER', 69, "There is no such static method '%s' in '%s'");
- static final List<StaticWarningCode> values = [AMBIGUOUS_IMPORT, ARGUMENT_TYPE_NOT_ASSIGNABLE, ASSIGNMENT_TO_FINAL, CASE_BLOCK_NOT_TERMINATED, CAST_TO_NON_TYPE, COMMENT_REFERENCE_CONSTRUCTOR_NOT_VISIBLE, COMMENT_REFERENCE_IDENTIFIER_NOT_VISIBLE, COMMENT_REFERENCE_UNDECLARED_CONSTRUCTOR, COMMENT_REFERENCE_UNDECLARED_IDENTIFIER, COMMENT_REFERENCE_URI_NOT_LIBRARY, CONCRETE_CLASS_WITH_ABSTRACT_MEMBER, CONFLICTING_INSTANCE_GETTER_AND_SUPERCLASS_MEMBER, CONFLICTING_INSTANCE_SETTER_AND_SUPERCLASS_MEMBER, CONFLICTING_STATIC_GETTER_AND_INSTANCE_SETTER, CONFLICTING_STATIC_SETTER_AND_INSTANCE_MEMBER, CONST_WITH_ABSTRACT_CLASS, EQUAL_KEYS_IN_MAP, EXPORT_DUPLICATED_LIBRARY_NAME, EXTRA_POSITIONAL_ARGUMENTS, FIELD_INITIALIZER_NOT_ASSIGNABLE, FIELD_INITIALIZING_FORMAL_NOT_ASSIGNABLE, FINAL_NOT_INITIALIZED, IMPORT_DUPLICATED_LIBRARY_NAME, INCONSISTENT_METHOD_INHERITANCE_GETTER_AND_METHOD, INCORRECT_NUMBER_OF_ARGUMENTS, INSTANCE_METHOD_NAME_COLLIDES_WITH_SUPERCLASS_STATIC, INVALID_FACTORY_NAME, INVALID_GETTER_OVERRIDE_RETURN_TYPE, INVALID_METHOD_OVERRIDE_NAMED_PARAM_TYPE, INVALID_METHOD_OVERRIDE_NORMAL_PARAM_TYPE, INVALID_METHOD_OVERRIDE_OPTIONAL_PARAM_TYPE, INVALID_METHOD_OVERRIDE_RETURN_TYPE, INVALID_OVERRIDE_DIFFERENT_DEFAULT_VALUES_NAMED, INVALID_OVERRIDE_DIFFERENT_DEFAULT_VALUES_POSITIONAL, INVALID_SETTER_OVERRIDE_NORMAL_PARAM_TYPE, INVOCATION_OF_NON_FUNCTION, MISMATCHED_GETTER_AND_SETTER_TYPES, NEW_WITH_ABSTRACT_CLASS, NEW_WITH_NON_TYPE, NEW_WITH_UNDEFINED_CONSTRUCTOR, NEW_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT, NO_DEFAULT_SUPER_CONSTRUCTOR_EXPLICIT, NO_DEFAULT_SUPER_CONSTRUCTOR_IMPLICIT, NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_FIVE_PLUS, NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_FOUR, NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE, NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_THREE, NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_TWO, NON_TYPE_IN_CATCH_CLAUSE, NON_VOID_RETURN_FOR_OPERATOR, NON_VOID_RETURN_FOR_SETTER, NOT_A_TYPE, NOT_ENOUGH_REQUIRED_ARGUMENTS, PART_OF_DIFFERENT_LIBRARY, REDIRECT_TO_INVALID_FUNCTION_TYPE, REDIRECT_TO_INVALID_RETURN_TYPE, REDIRECT_TO_MISSING_CONSTRUCTOR, REDIRECT_TO_NON_CLASS, RETURN_WITHOUT_VALUE, STATIC_ACCESS_TO_INSTANCE_MEMBER, SWITCH_EXPRESSION_NOT_ASSIGNABLE, TYPE_TEST_NON_TYPE, TYPE_VARIABLE_IN_STATIC_SCOPE, UNDEFINED_CLASS, UNDEFINED_CLASS_BOOLEAN, UNDEFINED_GETTER, UNDEFINED_IDENTIFIER, UNDEFINED_NAMED_PARAMETER, UNDEFINED_SETTER, UNDEFINED_STATIC_METHOD_OR_GETTER];
+ static final StaticWarningCode UNDEFINED_STATIC_METHOD_OR_GETTER = new StaticWarningCode('UNDEFINED_STATIC_METHOD_OR_GETTER', 66, "There is no such static method '%s' in '%s'");
+ static final List<StaticWarningCode> values = [AMBIGUOUS_IMPORT, ARGUMENT_TYPE_NOT_ASSIGNABLE, ASSIGNMENT_TO_FINAL, CASE_BLOCK_NOT_TERMINATED, CAST_TO_NON_TYPE, COMMENT_REFERENCE_CONSTRUCTOR_NOT_VISIBLE, COMMENT_REFERENCE_IDENTIFIER_NOT_VISIBLE, COMMENT_REFERENCE_UNDECLARED_CONSTRUCTOR, COMMENT_REFERENCE_UNDECLARED_IDENTIFIER, COMMENT_REFERENCE_URI_NOT_LIBRARY, CONCRETE_CLASS_WITH_ABSTRACT_MEMBER, CONFLICTING_INSTANCE_GETTER_AND_SUPERCLASS_MEMBER, CONFLICTING_INSTANCE_SETTER_AND_SUPERCLASS_MEMBER, CONFLICTING_STATIC_GETTER_AND_INSTANCE_SETTER, CONFLICTING_STATIC_SETTER_AND_INSTANCE_MEMBER, CONST_WITH_ABSTRACT_CLASS, EQUAL_KEYS_IN_MAP, EXPORT_DUPLICATED_LIBRARY_NAME, EXTRA_POSITIONAL_ARGUMENTS, FIELD_INITIALIZER_NOT_ASSIGNABLE, FIELD_INITIALIZING_FORMAL_NOT_ASSIGNABLE, FINAL_NOT_INITIALIZED, IMPORT_DUPLICATED_LIBRARY_NAME, INCONSISTENT_METHOD_INHERITANCE_GETTER_AND_METHOD, INCORRECT_NUMBER_OF_ARGUMENTS, INSTANCE_METHOD_NAME_COLLIDES_WITH_SUPERCLASS_STATIC, INVALID_FACTORY_NAME, INVALID_GETTER_OVERRIDE_RETURN_TYPE, INVALID_METHOD_OVERRIDE_NAMED_PARAM_TYPE, INVALID_METHOD_OVERRIDE_NORMAL_PARAM_TYPE, INVALID_METHOD_OVERRIDE_OPTIONAL_PARAM_TYPE, INVALID_METHOD_OVERRIDE_RETURN_TYPE, INVALID_OVERRIDE_DIFFERENT_DEFAULT_VALUES, INVALID_SETTER_OVERRIDE_NORMAL_PARAM_TYPE, INVOCATION_OF_NON_FUNCTION, MISMATCHED_GETTER_AND_SETTER_TYPES, NEW_WITH_ABSTRACT_CLASS, NEW_WITH_NON_TYPE, NEW_WITH_UNDEFINED_CONSTRUCTOR, NEW_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT, NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_FIVE_PLUS, NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_FOUR, NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE, NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_THREE, NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_TWO, NON_TYPE_IN_CATCH_CLAUSE, NON_VOID_RETURN_FOR_OPERATOR, NON_VOID_RETURN_FOR_SETTER, NOT_A_TYPE, NOT_ENOUGH_REQUIRED_ARGUMENTS, PART_OF_DIFFERENT_LIBRARY, REDIRECT_TO_INVALID_FUNCTION_TYPE, REDIRECT_TO_INVALID_RETURN_TYPE, REDIRECT_TO_MISSING_CONSTRUCTOR, REDIRECT_TO_NON_CLASS, RETURN_WITHOUT_VALUE, STATIC_ACCESS_TO_INSTANCE_MEMBER, SWITCH_EXPRESSION_NOT_ASSIGNABLE, TYPE_TEST_NON_TYPE, TYPE_VARIABLE_IN_STATIC_SCOPE, UNDEFINED_CLASS, UNDEFINED_CLASS_BOOLEAN, UNDEFINED_GETTER, UNDEFINED_IDENTIFIER, UNDEFINED_NAMED_PARAMETER, UNDEFINED_SETTER, UNDEFINED_STATIC_METHOD_OR_GETTER];
/// The name of this enum constant, as declared in the enum declaration.
final String name;
@@ -2285,7 +2274,7 @@
String toString() => name;
}
/**
- * The interface `AnalysisErrorListener` defines the behavior of objects that listen for[AnalysisError analysis errors] being produced by the analysis engine.
+ * The interface {@code AnalysisErrorListener} defines the behavior of objects that listen for{@link AnalysisError analysis errors} being produced by the analysis engine.
* @coverage dart.engine.error
*/
abstract class AnalysisErrorListener {
@@ -2297,7 +2286,7 @@
/**
* This method is invoked when an error has been found by the analysis engine.
- * @param error the error that was just found (not `null`)
+ * @param error the error that was just found (not {@code null})
*/
void onError(AnalysisError error);
}
@@ -2306,7 +2295,7 @@
}
}
/**
- * The enumeration `HtmlWarningCode` defines the error codes used for warnings in HTML files.
+ * The enumeration {@code HtmlWarningCode} defines the error codes used for warnings in HTML files.
* The convention for this class is for the name of the error code to indicate the problem that
* caused the error to be generated and for the error message to explain what is wrong and, when
* appropriate, how the problem can be corrected.
@@ -2355,7 +2344,7 @@
String toString() => name;
}
/**
- * The enumeration `StaticTypeWarningCode` defines the error codes used for static type
+ * The enumeration {@code StaticTypeWarningCode} defines the error codes used for static type
* warnings. The convention for this class is for the name of the error code to indicate the problem
* that caused the error to be generated and for the error message to explain what is wrong and,
* when appropriate, how the problem can be corrected.
@@ -2375,19 +2364,19 @@
* … m<sub>k</sub></i> with the same name <i>n</i> that would be inherited (because
* identically named members existed in several superinterfaces) then at most one member is
* inherited.
- *
+ * <p>
* If the static types <i>T<sub>1</sub>, …, T<sub>k</sub></i> of the members
* <i>m<sub>1</sub>, …, m<sub>k</sub></i> are not identical, then there must be a member
* <i>m<sub>x</sub></i> such that <i>T<sub>x</sub> < T<sub>i</sub>, 1 <= x <= k</i> for
* all <i>i, 1 <= i < k</i>, or a static type warning occurs. The member that is inherited
* is <i>m<sub>x</sub></i>, if it exists; otherwise:
* <ol>
- * * If all of <i>m<sub>1</sub>, … m<sub>k</sub></i> have the same number <i>r</i> of
+ * <li>If all of <i>m<sub>1</sub>, … m<sub>k</sub></i> have the same number <i>r</i> of
* required parameters and the same set of named parameters <i>s</i>, then let <i>h = max(
* numberOfOptionalPositionals( m<sub>i</sub> ) ), 1 <= i <= k</i>. <i>I</i> has a method
* named <i>n</i>, with <i>r</i> required parameters of type dynamic, <i>h</i> optional positional
* parameters of type dynamic, named parameters <i>s</i> of type dynamic and return type dynamic.
- * * Otherwise none of the members <i>m<sub>1</sub>, …, m<sub>k</sub></i> is inherited.
+ * <li>Otherwise none of the members <i>m<sub>1</sub>, …, m<sub>k</sub></i> is inherited.
* </ol>
*/
static final StaticTypeWarningCode INCONSISTENT_METHOD_INHERITANCE = new StaticTypeWarningCode('INCONSISTENT_METHOD_INHERITANCE', 1, "'%s' is inherited by at least two interfaces inconsistently");
@@ -2396,11 +2385,11 @@
* 12.18 Assignment: It is a static type warning if the static type of <i>e</i> may not be
* assigned to the static type of <i>v</i>. The static type of the expression <i>v = e</i> is the
* static type of <i>e</i>.
- *
+ * <p>
* 12.18 Assignment: It is a static type warning if the static type of <i>e</i> may not be
* assigned to the static type of <i>C.v</i>. The static type of the expression <i>C.v = e</i> is
* the static type of <i>e</i>.
- *
+ * <p>
* 12.18 Assignment: Let <i>T</i> be the static type of <i>e<sub>1</sub></i>. It is a static type
* warning if the static type of <i>e<sub>2</sub></i> may not be assigned to <i>T</i>.
* @param rhsTypeName the name of the right hand side type
@@ -2412,19 +2401,19 @@
* 12.14.4 Function Expression Invocation: A function expression invocation <i>i</i> has the form
* <i>e<sub>f</sub>(a<sub>1</sub>, … a<sub>n</sub>, x<sub>n+1</sub>: a<sub>n+1</sub>,
* …, x<sub>n+k</sub>: a<sub>n+k</sub>)</i>, where <i>e<sub>f</sub></i> is an expression.
- *
+ * <p>
* It is a static type warning if the static type <i>F</i> of <i>e<sub>f</sub></i> may not be
* assigned to a function type.
- *
+ * <p>
* 12.15.1 Ordinary Invocation: An ordinary method invocation <i>i</i> has the form
* <i>o.m(a<sub>1</sub>, …, a<sub>n</sub>, x<sub>n+1</sub>: a<sub>n+1</sub>, …
* x<sub>n+k</sub>: a<sub>n+k</sub>)</i>.
- *
+ * <p>
* Let <i>T</i> be the static type of <i>o</i>. It is a static type warning if <i>T</i> does not
* have an accessible instance member named <i>m</i>. If <i>T.m</i> exists, it is a static warning
* if the type <i>F</i> of <i>T.m</i> may not be assigned to a function type. If <i>T.m</i> does
* not exist, or if <i>F</i> is not a function type, the static type of <i>i</i> is dynamic.
- *
+ * <p>
* 12.15.3 Static Invocation: It is a static type warning if the type <i>F</i> of <i>C.m</i> may
* not be assigned to a function type.
* @param nonFunctionIdentifier the name of the identifier that is not a function type
@@ -2434,12 +2423,12 @@
/**
* 12.19 Conditional: It is a static type warning if the type of <i>e<sub>1</sub></i> may not be
* assigned to bool.
- *
+ * <p>
* 13.5 If: It is a static type warning if the type of the expression <i>b</i> may not be assigned
* to bool.
- *
+ * <p>
* 13.7 While: It is a static type warning if the type of <i>e</i> may not be assigned to bool.
- *
+ * <p>
* 13.8 Do: It is a static type warning if the type of <i>e</i> cannot be assigned to bool.
*/
static final StaticTypeWarningCode NON_BOOL_CONDITION = new StaticTypeWarningCode('NON_BOOL_CONDITION', 4, "Conditions must have a static type of 'bool'");
@@ -2484,7 +2473,7 @@
/**
* 10 Generics: It is a static type warning if a type parameter is a supertype of its upper bound.
- *
+ * <p>
* 15.8 Parameterized Types: If <i>S</i> is the static type of a member <i>m</i> of <i>G</i>, then
* the static type of the member <i>m</i> of <i>G<A<sub>1</sub>, … A<sub>n</sub>></i>
* is <i>\[A<sub>1</sub>, …, A<sub>n</sub>/T<sub>1</sub>, …, T<sub>n</sub>\]S</i>
@@ -2496,7 +2485,7 @@
static final StaticTypeWarningCode TYPE_ARGUMENT_VIOLATES_BOUNDS = new StaticTypeWarningCode('TYPE_ARGUMENT_VIOLATES_BOUNDS', 10, "");
/**
- * Specification reference needed. This is equivalent to [UNDEFINED_METHOD], but for
+ * Specification reference needed. This is equivalent to {@link #UNDEFINED_METHOD}, but for
* top-level functions.
* @param methodName the name of the method that is undefined
*/
@@ -2523,11 +2512,11 @@
* <i>e<sub>1</sub></i>\[<i>e<sub>2</sub></i>\] = <i>e<sub>3</sub></i> is equivalent to the
* evaluation of the expression (a, i, e){a.\[\]=(i, e); return e;} (<i>e<sub>1</sub></i>,
* <i>e<sub>2</sub></i>, <i>e<sub>2</sub></i>).
- *
+ * <p>
* 12.29 Assignable Expressions: An assignable expression of the form
* <i>e<sub>1</sub></i>\[<i>e<sub>2</sub></i>\] is evaluated as a method invocation of the operator
* method \[\] on <i>e<sub>1</sub></i> with argument <i>e<sub>2</sub></i>.
- *
+ * <p>
* 12.15.1 Ordinary Invocation: Let <i>T</i> be the static type of <i>o</i>. It is a static type
* warning if <i>T</i> does not have an accessible instance member named <i>m</i>.
* @param operator the name of the operator
diff --git a/pkg/analyzer_experimental/lib/src/generated/html.dart b/pkg/analyzer_experimental/lib/src/generated/html.dart
index c667f7b..02ca349 100644
--- a/pkg/analyzer_experimental/lib/src/generated/html.dart
+++ b/pkg/analyzer_experimental/lib/src/generated/html.dart
@@ -10,7 +10,7 @@
import 'element.dart' show HtmlElementImpl;
import 'engine.dart' show AnalysisEngine;
/**
- * Instances of the class `Token` represent a token that was scanned from the input. Each
+ * Instances of the class {@code Token} represent a token that was scanned from the input. Each
* token knows which token follows it, acting as the head of a linked list of tokens.
* @coverage dart.engine.html
*/
@@ -43,7 +43,7 @@
/**
* Initialize a newly created token.
- * @param type the token type (not `null`)
+ * @param type the token type (not {@code null})
* @param offset the offset from the beginning of the file to the first character in the token
*/
Token.con1(TokenType type, int offset) {
@@ -55,9 +55,9 @@
/**
* Initialize a newly created token.
- * @param type the token type (not `null`)
+ * @param type the token type (not {@code null})
* @param offset the offset from the beginning of the file to the first character in the token
- * @param value the lexeme represented by this token (not `null`)
+ * @param value the lexeme represented by this token (not {@code null})
*/
Token.con2(TokenType type2, int offset2, String value2) {
_jtd_constructor_156_impl(type2, offset2, value2);
@@ -84,7 +84,7 @@
/**
* Return the lexeme that represents this token.
- * @return the lexeme (not `null`)
+ * @return the lexeme (not {@code null})
*/
String get lexeme => _value;
@@ -108,17 +108,17 @@
/**
* Answer the token type for the receiver.
- * @return the token type (not `null`)
+ * @return the token type (not {@code null})
*/
TokenType get type => _type;
/**
- * Return `true` if this token is a synthetic token. A synthetic token is a token that was
+ * Return {@code true} if this token is a synthetic token. A synthetic token is a token that was
* introduced by the parser in order to recover from an error in the code. Synthetic tokens always
- * have a length of zero (`0`).
- * @return `true` if this token is a synthetic token
+ * have a length of zero ({@code 0}).
+ * @return {@code true} if this token is a synthetic token
*/
- bool get isSynthetic => length == 0;
+ bool isSynthetic() => length == 0;
/**
* Set the next token in the token stream to the given token. This has the side-effect of setting
@@ -142,13 +142,13 @@
}
}
/**
- * Instances of `HtmlParseResult` hold the result of parsing an HTML file.
+ * Instances of {@code HtmlParseResult} hold the result of parsing an HTML file.
* @coverage dart.engine.html
*/
class HtmlParseResult extends HtmlScanResult {
/**
- * The unit containing the parsed information (not `null`).
+ * The unit containing the parsed information (not {@code null}).
*/
HtmlUnit _unit;
HtmlParseResult(int modificationTime, Token token, List<int> lineStarts, HtmlUnit unit) : super(modificationTime, token, lineStarts) {
@@ -157,15 +157,15 @@
/**
* Answer the unit generated by parsing the source
- * @return the unit (not `null`)
+ * @return the unit (not {@code null})
*/
HtmlUnit get htmlUnit => _unit;
}
/**
- * Instances of the class `RecursiveXmlVisitor` implement an XML visitor that will recursively
+ * Instances of the class {@code RecursiveXmlVisitor} implement an XML visitor that will recursively
* visit all of the nodes in an XML structure. For example, using an instance of this class to visit
- * a [XmlTagNode] will also cause all of the contained [XmlAttributeNode]s and[XmlTagNode]s to be visited.
- *
+ * a {@link XmlTagNode} will also cause all of the contained {@link XmlAttributeNode}s and{@link XmlTagNode}s to be visited.
+ * <p>
* Subclasses that override a visit method must either invoke the overridden visit method or must
* explicitly ask the visited node to visit its children. Failure to do so will cause the children
* of the visited node to not be visited.
@@ -186,13 +186,13 @@
}
}
/**
- * The abstract class `XmlNode` defines behavior common to all XML/HTML nodes.
+ * The abstract class {@code XmlNode} defines behavior common to all XML/HTML nodes.
* @coverage dart.engine.html
*/
abstract class XmlNode {
/**
- * The parent of the node, or `null` if the node is the root of an AST structure.
+ * The parent of the node, or {@code null} if the node is the root of an AST structure.
*/
XmlNode _parent;
@@ -205,13 +205,13 @@
/**
* Return the first token included in this node's source range.
- * @return the first token or `null` if none
+ * @return the first token or {@code null} if none
*/
Token get beginToken;
/**
* Return the offset of the character immediately following the last character of this node's
- * source range. This is equivalent to `node.getOffset() + node.getLength()`. For an html
+ * source range. This is equivalent to {@code node.getOffset() + node.getLength()}. For an html
* unit this will be equal to the length of the unit's source.
* @return the offset of the character just past the node's source range
*/
@@ -219,7 +219,7 @@
/**
* Return the last token included in this node's source range.
- * @return the last token or `null` if none
+ * @return the last token or {@code null} if none
*/
Token get endToken;
@@ -251,11 +251,11 @@
}
/**
- * Return this node's parent node, or `null` if this node is the root of an AST structure.
- *
+ * Return this node's parent node, or {@code null} if this node is the root of an AST structure.
+ * <p>
* Note that the relationship between an AST node and its parent node may change over the lifetime
* of a node.
- * @return the parent of this node, or `null` if none
+ * @return the parent of this node, or {@code null} if none
*/
XmlNode get parent => _parent;
String toString() {
@@ -353,7 +353,7 @@
}
}
/**
- * Instances of the class `SimpleXmlVisitor` implement an AST visitor that will do nothing
+ * Instances of the class {@code SimpleXmlVisitor} implement an AST visitor that will do nothing
* when visiting an AST node. It is intended to be a superclass for classes that use the visitor
* pattern primarily as a dispatch mechanism (and hence don't need to recursively visit a whole
* structure) and that only need to visit a small number of node types.
@@ -364,7 +364,7 @@
R visitXmlTagNode(XmlTagNode xmlTagNode) => null;
}
/**
- * The abstract class `AbstractScanner` implements a scanner for HTML code. Subclasses are
+ * The abstract class {@code AbstractScanner} implements a scanner for HTML code. Subclasses are
* required to implement the interface used to access the characters being scanned.
* @coverage dart.engine.html
*/
@@ -424,7 +424,7 @@
/**
* Answer the source being scanned.
- * @return the source or `null` if undefined
+ * @return the source or {@code null} if undefined
*/
Source get source => _source;
@@ -638,7 +638,7 @@
}
}
/**
- * Instances of `HtmlScanResult` hold the result of scanning an HTML file.
+ * Instances of {@code HtmlScanResult} hold the result of scanning an HTML file.
* @coverage dart.engine.html
*/
class HtmlScanResult {
@@ -649,7 +649,7 @@
int _modificationTime = 0;
/**
- * The first token in the token stream (not `null`).
+ * The first token in the token stream (not {@code null}).
*/
Token _token;
@@ -665,7 +665,7 @@
/**
* Answer the line start information that was produced.
- * @return an array of line starts (not `null`)
+ * @return an array of line starts (not {@code null})
*/
List<int> get lineStarts => _lineStarts;
@@ -677,12 +677,12 @@
/**
* Answer the first token in the token stream.
- * @return the token (not `null`)
+ * @return the token (not {@code null})
*/
Token get token => _token;
}
/**
- * Instances of the class `StringScanner` implement a scanner that reads from a string. The
+ * Instances of the class {@code StringScanner} implement a scanner that reads from a string. The
* scanning logic is in the superclass.
* @coverage dart.engine.html
*/
@@ -733,7 +733,7 @@
}
}
/**
- * Instances of the class `CharBufferScanner` implement a scanner that reads from a character
+ * Instances of the class {@code CharBufferScanner} implement a scanner that reads from a character
* buffer. The scanning logic is in the superclass.
* @coverage dart.engine.html
*/
@@ -781,7 +781,7 @@
}
}
/**
- * Instances of the class `ToSourceVisitor` write a source representation of a visited XML
+ * Instances of the class {@code ToSourceVisitor} write a source representation of a visited XML
* node (and all of it's children) to a writer.
* @coverage dart.engine.html
*/
@@ -853,7 +853,7 @@
}
}
/**
- * The enumeration `TokenType` defines the types of tokens that can be returned by the
+ * The enumeration {@code TokenType} defines the types of tokens that can be returned by the
* scanner.
* @coverage dart.engine.html
*/
@@ -883,7 +883,7 @@
final int ordinal;
/**
- * The lexeme that defines this type of token, or `null` if there is more than one possible
+ * The lexeme that defines this type of token, or {@code null} if there is more than one possible
* lexeme for this type of token.
*/
String _lexeme;
@@ -892,7 +892,7 @@
}
/**
- * Return the lexeme that defines this type of token, or `null` if there is more than one
+ * Return the lexeme that defines this type of token, or {@code null} if there is more than one
* possible lexeme for this type of token.
* @return the lexeme that defines this type of token
*/
@@ -906,7 +906,7 @@
String toString() => "-eof-";
}
/**
- * Instances of `XmlAttributeNode` represent name/value pairs owned by an [XmlTagNode].
+ * Instances of {@code XmlAttributeNode} represent name/value pairs owned by an {@link XmlTagNode}.
* @coverage dart.engine.html
*/
class XmlAttributeNode extends XmlNode {
@@ -916,10 +916,10 @@
/**
* Construct a new instance representing an XML attribute.
- * @param name the name token (not `null`). This may be a zero length token if the attribute
+ * @param name the name token (not {@code null}). This may be a zero length token if the attribute
* is badly formed.
- * @param equals the equals sign or `null` if none
- * @param value the value token (not `null`)
+ * @param equals the equals sign or {@code null} if none
+ * @param value the value token (not {@code null})
*/
XmlAttributeNode(Token name, Token equals, Token value) {
this._name = name;
@@ -931,20 +931,20 @@
Token get endToken => _value;
/**
- * Answer the equals sign token that appears between the name and value tokens. This may be`null` if the attribute is badly formed.
- * @return the token or `null` if there is no equals sign between the name and value
+ * Answer the equals sign token that appears between the name and value tokens. This may be{@code null} if the attribute is badly formed.
+ * @return the token or {@code null} if there is no equals sign between the name and value
*/
Token get equals => _equals;
/**
* Answer the attribute name. This may be a zero length token if the attribute is badly formed.
- * @return the name (not `null`)
+ * @return the name (not {@code null})
*/
Token get name => _name;
/**
* Answer the lexeme for the value token without the leading and trailing quotes.
- * @return the text or `null` if the value is not specified
+ * @return the text or {@code null} if the value is not specified
*/
String get text {
if (_value == null) {
@@ -973,14 +973,14 @@
/**
* Answer the attribute value. A properly formed value will start and end with matching quote
* characters, but the value returned may not be properly formed.
- * @return the value or `null` if this represents a badly formed attribute
+ * @return the value or {@code null} if this represents a badly formed attribute
*/
Token get value => _value;
void visitChildren(XmlVisitor<Object> visitor) {
}
}
/**
- * The interface `XmlVisitor` defines the behavior of objects that can be used to visit an[XmlNode] structure.
+ * The interface {@code XmlVisitor} defines the behavior of objects that can be used to visit an{@link XmlNode} structure.
* @coverage dart.engine.html
*/
abstract class XmlVisitor<R> {
@@ -989,7 +989,7 @@
R visitXmlTagNode(XmlTagNode xmlTagNode);
}
/**
- * Instances of `HtmlScanner` receive and scan HTML content from a [Source].<br/>
+ * Instances of {@code HtmlScanner} receive and scan HTML content from a {@link Source}.<br/>
* For example, the following code scans HTML source and returns the result:
* <pre>
* HtmlScanner scanner = new HtmlScanner(source);
@@ -1002,7 +1002,7 @@
List<String> _SCRIPT_TAG = <String> ["script"];
/**
- * The source being scanned (not `null`)
+ * The source being scanned (not {@code null})
*/
Source _source;
@@ -1023,7 +1023,7 @@
/**
* Construct a new instance to scan the specified source.
- * @param source the source to be scanned (not `null`)
+ * @param source the source to be scanned (not {@code null})
*/
HtmlScanner(Source source) {
this._source = source;
@@ -1043,13 +1043,13 @@
/**
* Answer the result of scanning the source
- * @return the result (not `null`)
+ * @return the result (not {@code null})
*/
HtmlScanResult get result => new HtmlScanResult(_modificationTime, _token, _scanner.lineStarts);
}
/**
- * Instances of the class `XmlParser` are used to parse tokens into a AST structure comprised
- * of [XmlNode]s.
+ * Instances of the class {@code XmlParser} are used to parse tokens into a AST structure comprised
+ * of {@link XmlNode}s.
* @coverage dart.engine.html
*/
class XmlParser {
@@ -1079,17 +1079,17 @@
Source get source => _source;
/**
- * Answer `true` if the specified tag is self closing and thus should never have content or
+ * Answer {@code true} if the specified tag is self closing and thus should never have content or
* child tag nodes.
- * @param tag the tag (not `null`)
- * @return `true` if self closing
+ * @param tag the tag (not {@code null})
+ * @return {@code true} if self closing
*/
bool isSelfClosing(Token tag) => false;
/**
* Parse the entire token stream and in the process, advance the current token to the end of the
* token stream.
- * @return the list of tag nodes found (not `null`, contains no `null`)
+ * @return the list of tag nodes found (not {@code null}, contains no {@code null})
*/
List<XmlTagNode> parseTopTagNodes(Token firstToken) {
_currentToken = firstToken;
@@ -1119,8 +1119,8 @@
/**
* Insert a synthetic token of the specified type before the current token
- * @param type the type of token to be inserted (not `null`)
- * @return the synthetic token that was inserted (not `null`)
+ * @param type the type of token to be inserted (not {@code null})
+ * @return the synthetic token that was inserted (not {@code null})
*/
Token insertSyntheticToken(TokenType type) {
Token token = new Token.con2(type, _currentToken.offset, "");
@@ -1131,8 +1131,8 @@
/**
* Parse the token stream for an attribute. This method advances the current token over the
- * attribute, but should not be called if the [currentToken] is not [TokenType#TAG].
- * @return the attribute (not `null`)
+ * attribute, but should not be called if the {@link #currentToken} is not {@link TokenType#TAG}.
+ * @return the attribute (not {@code null})
*/
XmlAttributeNode parseAttribute() {
Token name = _currentToken;
@@ -1158,8 +1158,8 @@
/**
* Parse the stream for a sequence of attributes. This method advances the current token to the
- * next [TokenType#GT], [TokenType#SLASH_GT], or [TokenType#EOF].
- * @return a collection of zero or more attributes (not `null`, contains no `null`s)
+ * next {@link TokenType#GT}, {@link TokenType#SLASH_GT}, or {@link TokenType#EOF}.
+ * @return a collection of zero or more attributes (not {@code null}, contains no {@code null}s)
*/
List<XmlAttributeNode> parseAttributes() {
TokenType type = _currentToken.type;
@@ -1184,8 +1184,8 @@
/**
* Parse the stream for a sequence of tag nodes existing within a parent tag node. This method
- * advances the current token to the next [TokenType#LT_SLASH] or [TokenType#EOF].
- * @return a list of nodes (not `null`, contains no `null`s)
+ * advances the current token to the next {@link TokenType#LT_SLASH} or {@link TokenType#EOF}.
+ * @return a list of nodes (not {@code null}, contains no {@code null}s)
*/
List<XmlTagNode> parseChildTagNodes() {
TokenType type = _currentToken.type;
@@ -1212,8 +1212,8 @@
/**
* Parse the token stream for the next tag node. This method advances current token over the
- * parsed tag node, but should only be called if the current token is [TokenType#LT]
- * @return the tag node or `null` if none found
+ * parsed tag node, but should only be called if the current token is {@link TokenType#LT}
+ * @return the tag node or {@code null} if none found
*/
XmlTagNode parseTagNode() {
Token nodeStart = _currentToken;
@@ -1273,7 +1273,7 @@
}
}
/**
- * Instances of `XmlTagNode` represent XML or HTML elements such as `` and`<body foo="bar"> ... </body>`.
+ * Instances of {@code XmlTagNode} represent XML or HTML elements such as {@code <p>} and{@code <body foo="bar"> ... </body>}.
* @coverage dart.engine.html
*/
class XmlTagNode extends XmlNode {
@@ -1289,75 +1289,75 @@
static List<XmlTagNode> NO_TAG_NODES = new UnmodifiableListView(new List<XmlTagNode>());
/**
- * The starting [TokenType#LT] token (not `null`).
+ * The starting {@link TokenType#LT} token (not {@code null}).
*/
Token _nodeStart;
/**
- * The [TokenType#TAG] token after the starting '<' (not `null`).
+ * The {@link TokenType#TAG} token after the starting '<' (not {@code null}).
*/
Token _tag;
/**
- * The attributes contained by the receiver (not `null`, contains no `null`s).
+ * The attributes contained by the receiver (not {@code null}, contains no {@code null}s).
*/
List<XmlAttributeNode> _attributes;
/**
- * The [TokenType#GT] or [TokenType#SLASH_GT] token after the attributes (not`null`). The token may be the same token as [nodeEnd] if there are no child[tagNodes].
+ * The {@link TokenType#GT} or {@link TokenType#SLASH_GT} token after the attributes (not{@code null}). The token may be the same token as {@link #nodeEnd} if there are no child{@link #tagNodes}.
*/
Token _attributeEnd;
/**
- * The tag nodes contained in the receiver (not `null`, contains no `null`s).
+ * The tag nodes contained in the receiver (not {@code null}, contains no {@code null}s).
*/
List<XmlTagNode> _tagNodes;
/**
- * The token (not `null`) after the content, which may be
- *
- * * (1) [TokenType#LT_SLASH] for nodes with open and close tags, or
- * * (2) the [TokenType#LT] nodeStart of the next sibling node if this node is self
- * closing or the attributeEnd is [TokenType#SLASH_GT], or
- * * (3) [TokenType#EOF] if the node does not have a closing tag and is the last node in
- * the stream [TokenType#LT_SLASH] token after the content, or `null` if there is no
- * content and the attributes ended with [TokenType#SLASH_GT].
- *
+ * The token (not {@code null}) after the content, which may be
+ * <ul>
+ * <li>(1) {@link TokenType#LT_SLASH} for nodes with open and close tags, or</li>
+ * <li>(2) the {@link TokenType#LT} nodeStart of the next sibling node if this node is self
+ * closing or the attributeEnd is {@link TokenType#SLASH_GT}, or</li>
+ * <li>(3) {@link TokenType#EOF} if the node does not have a closing tag and is the last node in
+ * the stream {@link TokenType#LT_SLASH} token after the content, or {@code null} if there is no
+ * content and the attributes ended with {@link TokenType#SLASH_GT}.</li>
+ * </ul>
*/
Token _contentEnd;
/**
- * The closing [TokenType#TAG] after the child elements or `null` if there is no
- * content and the attributes ended with [TokenType#SLASH_GT]
+ * The closing {@link TokenType#TAG} after the child elements or {@code null} if there is no
+ * content and the attributes ended with {@link TokenType#SLASH_GT}
*/
Token _closingTag;
/**
- * The ending [TokenType#GT] or [TokenType#SLASH_GT] token (not `null`).
+ * The ending {@link TokenType#GT} or {@link TokenType#SLASH_GT} token (not {@code null}).
*/
Token _nodeEnd;
/**
* Construct a new instance representing an XML or HTML element
- * @param nodeStart the starting [TokenType#LT] token (not `null`)
- * @param tag the [TokenType#TAG] token after the starting '<' (not `null`).
- * @param attributes the attributes associated with this element or [NO_ATTRIBUTES] (not`null`, contains no `null`s)
- * @param attributeEnd The [TokenType#GT] or [TokenType#SLASH_GT] token after the
- * attributes (not `null`). The token may be the same token as [nodeEnd] if
- * there are no child [tagNodes].
- * @param tagNodes child tag nodes of the receiver or [NO_TAG_NODES] (not `null`,
- * contains no `null`s)
- * @param contentEnd the token (not `null`) after the content, which may be
- *
- * * (1) [TokenType#LT_SLASH] for nodes with open and close tags, or
- * * (2) the [TokenType#LT] nodeStart of the next sibling node if this node is
- * self closing or the attributeEnd is [TokenType#SLASH_GT], or
- * * (3) [TokenType#EOF] if the node does not have a closing tag and is the last
- * node in the stream [TokenType#LT_SLASH] token after the content, or `null`if there is no content and the attributes ended with [TokenType#SLASH_GT].
- *
- * @param closingTag the closing [TokenType#TAG] after the child elements or `null` if
- * there is no content and the attributes ended with [TokenType#SLASH_GT]
- * @param nodeEnd the ending [TokenType#GT] or [TokenType#SLASH_GT] token (not`null`)
+ * @param nodeStart the starting {@link TokenType#LT} token (not {@code null})
+ * @param tag the {@link TokenType#TAG} token after the starting '<' (not {@code null}).
+ * @param attributes the attributes associated with this element or {@link #NO_ATTRIBUTES} (not{@code null}, contains no {@code null}s)
+ * @param attributeEnd The {@link TokenType#GT} or {@link TokenType#SLASH_GT} token after the
+ * attributes (not {@code null}). The token may be the same token as {@link #nodeEnd} if
+ * there are no child {@link #tagNodes}.
+ * @param tagNodes child tag nodes of the receiver or {@link #NO_TAG_NODES} (not {@code null},
+ * contains no {@code null}s)
+ * @param contentEnd the token (not {@code null}) after the content, which may be
+ * <ul>
+ * <li>(1) {@link TokenType#LT_SLASH} for nodes with open and close tags, or</li>
+ * <li>(2) the {@link TokenType#LT} nodeStart of the next sibling node if this node is
+ * self closing or the attributeEnd is {@link TokenType#SLASH_GT}, or</li>
+ * <li>(3) {@link TokenType#EOF} if the node does not have a closing tag and is the last
+ * node in the stream {@link TokenType#LT_SLASH} token after the content, or {@code null}if there is no content and the attributes ended with {@link TokenType#SLASH_GT}.</li>
+ * </ul>
+ * @param closingTag the closing {@link TokenType#TAG} after the child elements or {@code null} if
+ * there is no content and the attributes ended with {@link TokenType#SLASH_GT}
+ * @param nodeEnd the ending {@link TokenType#GT} or {@link TokenType#SLASH_GT} token (not{@code null})
*/
XmlTagNode(Token nodeStart, Token tag, List<XmlAttributeNode> attributes, Token attributeEnd, List<XmlTagNode> tagNodes, Token contentEnd, Token closingTag, Token nodeEnd) {
this._nodeStart = nodeStart;
@@ -1374,7 +1374,7 @@
/**
* Answer the attribute with the specified name.
* @param name the attribute name
- * @return the attribute or `null` if no matching attribute is found
+ * @return the attribute or {@code null} if no matching attribute is found
*/
XmlAttributeNode getAttribute(String name2) {
for (XmlAttributeNode attribute in _attributes) {
@@ -1386,23 +1386,23 @@
}
/**
- * The [TokenType#GT] or [TokenType#SLASH_GT] token after the attributes (not`null`). The token may be the same token as [nodeEnd] if there are no child[tagNodes].
- * @return the token (not `null`)
+ * The {@link TokenType#GT} or {@link TokenType#SLASH_GT} token after the attributes (not{@code null}). The token may be the same token as {@link #nodeEnd} if there are no child{@link #tagNodes}.
+ * @return the token (not {@code null})
*/
Token get attributeEnd => _attributeEnd;
/**
* Answer the receiver's attributes. Callers should not manipulate the returned list to edit the
* AST structure.
- * @return the attributes (not `null`, contains no `null`s)
+ * @return the attributes (not {@code null}, contains no {@code null}s)
*/
List<XmlAttributeNode> get attributes => _attributes;
/**
- * Find the attribute with the given name (see [getAttribute] and answer the lexeme
- * for the attribute's value token without the leading and trailing quotes (see[XmlAttributeNode#getText]).
+ * Find the attribute with the given name (see {@link #getAttribute(String)} and answer the lexeme
+ * for the attribute's value token without the leading and trailing quotes (see{@link XmlAttributeNode#getText()}).
* @param name the attribute name
- * @return the attribute text or `null` if no matching attribute is found
+ * @return the attribute text or {@code null} if no matching attribute is found
*/
String getAttributeText(String name) {
XmlAttributeNode attribute = getAttribute(name);
@@ -1411,17 +1411,17 @@
Token get beginToken => _nodeStart;
/**
- * The the closing [TokenType#TAG] after the child elements or `null` if there is no
- * content and the attributes ended with [TokenType#SLASH_GT]
- * @return the closing tag or `null`
+ * The the closing {@link TokenType#TAG} after the child elements or {@code null} if there is no
+ * content and the attributes ended with {@link TokenType#SLASH_GT}
+ * @return the closing tag or {@code null}
*/
Token get closingTag => _closingTag;
/**
* Answer a string representing the content contained in the receiver. This includes the textual
- * representation of any child tag nodes ([getTagNodes]). Whitespace between '<',
+ * representation of any child tag nodes ({@link #getTagNodes()}). Whitespace between '<',
* '</', and '>', '/>' is discarded, but all other whitespace is preserved.
- * @return the content (not `null`)
+ * @return the content (not {@code null})
*/
String get content {
Token token = _attributeEnd.next;
@@ -1442,16 +1442,16 @@
}
/**
- * Answer the token (not `null`) after the content, which may be
- *
- * * (1) [TokenType#LT_SLASH] for nodes with open and close tags, or
- * * (2) the [TokenType#LT] nodeStart of the next sibling node if this node is self
- * closing or the attributeEnd is [TokenType#SLASH_GT], or
- * * (3) [TokenType#EOF] if the node does not have a closing tag and is the last node in
- * the stream [TokenType#LT_SLASH] token after the content, or `null` if there is no
- * content and the attributes ended with [TokenType#SLASH_GT].
- *
- * @return the token (not `null`)
+ * Answer the token (not {@code null}) after the content, which may be
+ * <ul>
+ * <li>(1) {@link TokenType#LT_SLASH} for nodes with open and close tags, or</li>
+ * <li>(2) the {@link TokenType#LT} nodeStart of the next sibling node if this node is self
+ * closing or the attributeEnd is {@link TokenType#SLASH_GT}, or</li>
+ * <li>(3) {@link TokenType#EOF} if the node does not have a closing tag and is the last node in
+ * the stream {@link TokenType#LT_SLASH} token after the content, or {@code null} if there is no
+ * content and the attributes ended with {@link TokenType#SLASH_GT}.</li>
+ * </ul>
+ * @return the token (not {@code null})
*/
Token get contentEnd => _contentEnd;
Token get endToken {
@@ -1477,27 +1477,27 @@
}
/**
- * Answer the ending [TokenType#GT] or [TokenType#SLASH_GT] token.
- * @return the token (not `null`)
+ * Answer the ending {@link TokenType#GT} or {@link TokenType#SLASH_GT} token.
+ * @return the token (not {@code null})
*/
Token get nodeEnd => _nodeEnd;
/**
- * Answer the starting [TokenType#LT] token.
- * @return the token (not `null`)
+ * Answer the starting {@link TokenType#LT} token.
+ * @return the token (not {@code null})
*/
Token get nodeStart => _nodeStart;
/**
- * Answer the [TokenType#TAG] token after the starting '<'.
- * @return the token (not `null`)
+ * Answer the {@link TokenType#TAG} token after the starting '<'.
+ * @return the token (not {@code null})
*/
Token get tag => _tag;
/**
* Answer the tag nodes contained in the receiver. Callers should not manipulate the returned list
* to edit the AST structure.
- * @return the children (not `null`, contains no `null`s)
+ * @return the children (not {@code null}, contains no {@code null}s)
*/
List<XmlTagNode> get tagNodes => _tagNodes;
void visitChildren(XmlVisitor<Object> visitor) {
@@ -1510,7 +1510,7 @@
}
/**
- * Same as [becomeParentOf], but returns given "ifEmpty" if "children" is empty
+ * Same as {@link #becomeParentOf(List)}, but returns given "ifEmpty" if "children" is empty
*/
List becomeParentOfEmpty(List children, List ifEmpty) {
if (children != null && children.isEmpty) {
@@ -1520,8 +1520,8 @@
}
}
/**
- * Instances of the class `HtmlParser` are used to parse tokens into a AST structure comprised
- * of [XmlNode]s.
+ * Instances of the class {@code HtmlParser} are used to parse tokens into a AST structure comprised
+ * of {@link XmlNode}s.
* @coverage dart.engine.html
*/
class HtmlParser extends XmlParser {
@@ -1536,8 +1536,8 @@
/**
* Parse the tokens specified by the given scan result.
- * @param scanResult the result of scanning an HTML source (not `null`)
- * @return the parse result (not `null`)
+ * @param scanResult the result of scanning an HTML source (not {@code null})
+ * @return the parse result (not {@code null})
*/
HtmlParseResult parse(HtmlScanResult scanResult) {
Token firstToken = scanResult.token;
@@ -1548,8 +1548,8 @@
/**
* Scan then parse the specified source.
- * @param source the source to be scanned and parsed (not `null`)
- * @return the parse result (not `null`)
+ * @param source the source to be scanned and parsed (not {@code null})
+ * @return the parse result (not {@code null})
*/
HtmlParseResult parse2(Source source) {
HtmlScanner scanner = new HtmlScanner(source);
@@ -1559,7 +1559,7 @@
bool isSelfClosing(Token tag) => SELF_CLOSING.contains(tag.lexeme);
}
/**
- * Instances of the class `HtmlUnit` represent the contents of an HTML file.
+ * Instances of the class {@code HtmlUnit} represent the contents of an HTML file.
* @coverage dart.engine.html
*/
class HtmlUnit extends XmlNode {
@@ -1571,25 +1571,25 @@
/**
* The last token in the token stream that was parsed to form this compilation unit. This token
- * should always have a type of [TokenType.EOF].
+ * should always have a type of {@link TokenType.EOF}.
*/
Token _endToken;
/**
- * The tag nodes contained in the receiver (not `null`, contains no `null`s).
+ * The tag nodes contained in the receiver (not {@code null}, contains no {@code null}s).
*/
List<XmlTagNode> _tagNodes;
/**
- * The element associated with this HTML unit or `null` if the receiver is not resolved.
+ * The element associated with this HTML unit or {@code null} if the receiver is not resolved.
*/
HtmlElementImpl _element;
/**
* Construct a new instance representing the content of an HTML file.
- * @param beginToken the first token in the file (not `null`)
- * @param tagNodes child tag nodes of the receiver (not `null`, contains no `null`s)
- * @param endToken the last token in the token stream which should be of type[TokenType.EOF]
+ * @param beginToken the first token in the file (not {@code null})
+ * @param tagNodes child tag nodes of the receiver (not {@code null}, contains no {@code null}s)
+ * @param endToken the last token in the token stream which should be of type{@link TokenType.EOF}
*/
HtmlUnit(Token beginToken, List<XmlTagNode> tagNodes, Token endToken) {
this._beginToken = beginToken;
@@ -1601,7 +1601,7 @@
/**
* Return the element associated with this HTML unit.
- * @return the element or `null` if the receiver is not resolved
+ * @return the element or {@code null} if the receiver is not resolved
*/
HtmlElementImpl get element => _element;
Token get endToken => _endToken;
@@ -1609,7 +1609,7 @@
/**
* Answer the tag nodes contained in the receiver. Callers should not manipulate the returned list
* to edit the AST structure.
- * @return the children (not `null`, contains no `null`s)
+ * @return the children (not {@code null}, contains no {@code null}s)
*/
List<XmlTagNode> get tagNodes => _tagNodes;
diff --git a/pkg/analyzer_experimental/lib/src/generated/instrumentation.dart b/pkg/analyzer_experimental/lib/src/generated/instrumentation.dart
index 7da792e..0f62806 100644
--- a/pkg/analyzer_experimental/lib/src/generated/instrumentation.dart
+++ b/pkg/analyzer_experimental/lib/src/generated/instrumentation.dart
@@ -3,17 +3,17 @@
library engine.instrumentation;
import 'java_core.dart';
/**
- * The class `Instrumentation` implements support for logging instrumentation information.
- *
+ * The class {@code Instrumentation} implements support for logging instrumentation information.
+ * <p>
* Instrumentation information consists of information about specific operations. Those operations
* can range from user-facing operations, such as saving the changes to a file, to internal
- * operations, such as tokenizing source code. The information to be logged is gathered by[InstrumentationBuilder instrumentation builder], created by one of the static methods on
- * this class such as [builder] or [builder].
- *
- * Note, however, that until an instrumentation logger is installed using the method[setLogger], all instrumentation data will be lost.
- *
+ * operations, such as tokenizing source code. The information to be logged is gathered by{@link InstrumentationBuilder instrumentation builder}, created by one of the static methods on
+ * this class such as {@link #builder(Class)} or {@link #builder(String)}.
+ * <p>
+ * Note, however, that until an instrumentation logger is installed using the method{@link #setLogger(InstrumentationLogger)}, all instrumentation data will be lost.
+ * <p>
* <b>Example</b>
- *
+ * <p>
* To collect metrics about how long it took to save a file, you would write something like the
* following:
* <pre>
@@ -21,9 +21,9 @@
* // save the file
* instrumentation.metric("chars", fileLength).log();
* </pre>
- * The `Instrumentation.builder` method creates a new [InstrumentationBuilderinstrumentation builder] and records the time at which it was created. The[InstrumentationBuilder#metric] appends the information specified by the
+ * The {@code Instrumentation.builder} method creates a new {@link InstrumentationBuilderinstrumentation builder} and records the time at which it was created. The{@link InstrumentationBuilder#metric(String,long)} appends the information specified by the
* arguments and records the time at which the method is called so that the time to complete the
- * save operation can be calculated. The `log` method tells the builder that all of the data
+ * save operation can be calculated. The {@code log} method tells the builder that all of the data
* has been collected and that the resulting information should be logged.
* @coverage dart.engine.utilities
*/
@@ -47,15 +47,15 @@
/**
* Create a builder that can collect the data associated with an operation.
- * @param clazz the class performing the operation (not `null`)
- * @return the builder that was created (not `null`)
+ * @param clazz the class performing the operation (not {@code null})
+ * @return the builder that was created (not {@code null})
*/
static InstrumentationBuilder builder(Type clazz) => _CURRENT_LOGGER.createBuilder(clazz.toString());
/**
* Create a builder that can collect the data associated with an operation.
- * @param name the name used to uniquely identify the operation (not `null`)
- * @return the builder that was created (not `null`)
+ * @param name the name used to uniquely identify the operation (not {@code null})
+ * @return the builder that was created (not {@code null})
*/
static InstrumentationBuilder builder2(String name) => _CURRENT_LOGGER.createBuilder(name);
@@ -66,7 +66,7 @@
/**
* Return a builder that will silently ignore all data and logging requests.
- * @return the builder (not `null`)
+ * @return the builder (not {@code null})
*/
static InstrumentationBuilder get nullBuilder => _NULL_INSTRUMENTATION_BUILDER;
@@ -75,7 +75,7 @@
* it?
* @return
*/
- static bool get isNullLogger => identical(_CURRENT_LOGGER, _NULL_LOGGER);
+ static bool isNullLogger() => identical(_CURRENT_LOGGER, _NULL_LOGGER);
/**
* Set the logger that should receive instrumentation information to the given logger.
@@ -103,10 +103,10 @@
InstrumentationBuilder createBuilder(String name) => Instrumentation._NULL_INSTRUMENTATION_BUILDER;
}
/**
- * The interface `InstrumentationBuilder` defines the behavior of objects used to collect data
+ * The interface {@code InstrumentationBuilder} defines the behavior of objects used to collect data
* about an operation that has occurred and record that data through an instrumentation logger.
- *
- * For an example of using objects that implement this interface, see [Instrumentation].
+ * <p>
+ * For an example of using objects that implement this interface, see {@link Instrumentation}.
* @coverage dart.engine.utilities
*/
abstract class InstrumentationBuilder {
@@ -152,8 +152,8 @@
InstrumentationBuilder data4(String name, List<String> value);
/**
- * Answer the [InstrumentationLevel] of this `InstrumentationBuilder`.
- * @return one of [InstrumentationLevel#EVERYTHING], [InstrumentationLevel#METRICS],[InstrumentationLevel#OFF]
+ * Answer the {@link InstrumentationLevel} of this {@code InstrumentationBuilder}.
+ * @return one of {@link InstrumentationLevel#EVERYTHING}, {@link InstrumentationLevel#METRICS},{@link InstrumentationLevel#OFF}
*/
InstrumentationLevel get instrumentationLevel;
@@ -206,17 +206,17 @@
/**
* Append the given exception to the information being collected by this builder. The exception's
- * class name is captured using [metric]. Other aspects of the exception
+ * class name is captured using {@link #metric(String,String)}. Other aspects of the exception
* may contain either user identifiable or contains user intellectual property (but is not
- * guaranteed to contain either) and thus are captured using the various data methods such as[data].
- * @param exception the exception (may be `null`)
+ * guaranteed to contain either) and thus are captured using the various data methods such as{@link #data(String,String)}.
+ * @param exception the exception (may be {@code null})
*/
InstrumentationBuilder record(Exception exception);
}
/**
- * The instrumentation recording level representing (1) recording [EVERYTHING] recording of
- * all instrumentation data, (2) recording only [METRICS] information, or (3) recording
- * turned [OFF] in which case nothing is recorded.
+ * The instrumentation recording level representing (1) recording {@link #EVERYTHING} recording of
+ * all instrumentation data, (2) recording only {@link #METRICS} information, or (3) recording
+ * turned {@link #OFF} in which case nothing is recorded.
* @coverage dart.engine.utilities
*/
class InstrumentationLevel implements Comparable<InstrumentationLevel> {
@@ -261,10 +261,10 @@
String toString() => name;
}
/**
- * The interface `InstrumentationLogger` defines the behavior of objects that are used to log
+ * The interface {@code InstrumentationLogger} defines the behavior of objects that are used to log
* instrumentation data.
- *
- * For an example of using objects that implement this interface, see [Instrumentation].
+ * <p>
+ * For an example of using objects that implement this interface, see {@link Instrumentation}.
* @coverage dart.engine.utilities
*/
abstract class InstrumentationLogger {
diff --git a/pkg/analyzer_experimental/lib/src/generated/java_core.dart b/pkg/analyzer_experimental/lib/src/generated/java_core.dart
index 01ffd5d..7e90245 100644
--- a/pkg/analyzer_experimental/lib/src/generated/java_core.dart
+++ b/pkg/analyzer_experimental/lib/src/generated/java_core.dart
@@ -154,16 +154,6 @@
}
});
}
- static int indexOf(String target, String str, int fromIndex) {
- if (fromIndex > target.length) return -1;
- if (fromIndex < 0) fromIndex = 0;
- return target.indexOf(str, fromIndex);
- }
- static int lastIndexOf(String target, String str, int fromIndex) {
- if (fromIndex > target.length) return -1;
- if (fromIndex < 0) fromIndex = 0;
- return target.lastIndexOf(str, fromIndex);
- }
static bool startsWithBefore(String s, String other, int start) {
return s.indexOf(other, start) != -1;
}
diff --git a/pkg/analyzer_experimental/lib/src/generated/parser.dart b/pkg/analyzer_experimental/lib/src/generated/parser.dart
index 32c04c8..bd5a1dc 100644
--- a/pkg/analyzer_experimental/lib/src/generated/parser.dart
+++ b/pkg/analyzer_experimental/lib/src/generated/parser.dart
@@ -11,14 +11,14 @@
import 'ast.dart';
import 'utilities_dart.dart';
/**
- * Instances of the class `CommentAndMetadata` implement a simple data-holder for a method
+ * Instances of the class {@code CommentAndMetadata} implement a simple data-holder for a method
* that needs to return multiple values.
* @coverage dart.engine.parser
*/
class CommentAndMetadata {
/**
- * The documentation comment that was parsed, or `null` if none was given.
+ * The documentation comment that was parsed, or {@code null} if none was given.
*/
Comment _comment;
@@ -38,7 +38,7 @@
}
/**
- * Return the documentation comment that was parsed, or `null` if none was given.
+ * Return the documentation comment that was parsed, or {@code null} if none was given.
* @return the documentation comment that was parsed
*/
Comment get comment => _comment;
@@ -50,19 +50,19 @@
List<Annotation> get metadata => _metadata;
}
/**
- * Instances of the class `FinalConstVarOrType` implement a simple data-holder for a method
+ * Instances of the class {@code FinalConstVarOrType} implement a simple data-holder for a method
* that needs to return multiple values.
* @coverage dart.engine.parser
*/
class FinalConstVarOrType {
/**
- * The 'final', 'const' or 'var' keyword, or `null` if none was given.
+ * The 'final', 'const' or 'var' keyword, or {@code null} if none was given.
*/
Token _keyword;
/**
- * The type, of `null` if no type was specified.
+ * The type, of {@code null} if no type was specified.
*/
TypeName _type;
@@ -77,103 +77,103 @@
}
/**
- * Return the 'final', 'const' or 'var' keyword, or `null` if none was given.
+ * Return the 'final', 'const' or 'var' keyword, or {@code null} if none was given.
* @return the 'final', 'const' or 'var' keyword
*/
Token get keyword => _keyword;
/**
- * Return the type, of `null` if no type was specified.
+ * Return the type, of {@code null} if no type was specified.
* @return the type
*/
TypeName get type => _type;
}
/**
- * Instances of the class `Modifiers` implement a simple data-holder for a method that needs
+ * Instances of the class {@code Modifiers} implement a simple data-holder for a method that needs
* to return multiple values.
* @coverage dart.engine.parser
*/
class Modifiers {
/**
- * The token representing the keyword 'abstract', or `null` if the keyword was not found.
+ * The token representing the keyword 'abstract', or {@code null} if the keyword was not found.
*/
Token _abstractKeyword;
/**
- * The token representing the keyword 'const', or `null` if the keyword was not found.
+ * The token representing the keyword 'const', or {@code null} if the keyword was not found.
*/
Token _constKeyword;
/**
- * The token representing the keyword 'external', or `null` if the keyword was not found.
+ * The token representing the keyword 'external', or {@code null} if the keyword was not found.
*/
Token _externalKeyword;
/**
- * The token representing the keyword 'factory', or `null` if the keyword was not found.
+ * The token representing the keyword 'factory', or {@code null} if the keyword was not found.
*/
Token _factoryKeyword;
/**
- * The token representing the keyword 'final', or `null` if the keyword was not found.
+ * The token representing the keyword 'final', or {@code null} if the keyword was not found.
*/
Token _finalKeyword;
/**
- * The token representing the keyword 'static', or `null` if the keyword was not found.
+ * The token representing the keyword 'static', or {@code null} if the keyword was not found.
*/
Token _staticKeyword;
/**
- * The token representing the keyword 'var', or `null` if the keyword was not found.
+ * The token representing the keyword 'var', or {@code null} if the keyword was not found.
*/
Token _varKeyword;
/**
- * Return the token representing the keyword 'abstract', or `null` if the keyword was not
+ * Return the token representing the keyword 'abstract', or {@code null} if the keyword was not
* found.
* @return the token representing the keyword 'abstract'
*/
Token get abstractKeyword => _abstractKeyword;
/**
- * Return the token representing the keyword 'const', or `null` if the keyword was not
+ * Return the token representing the keyword 'const', or {@code null} if the keyword was not
* found.
* @return the token representing the keyword 'const'
*/
Token get constKeyword => _constKeyword;
/**
- * Return the token representing the keyword 'external', or `null` if the keyword was not
+ * Return the token representing the keyword 'external', or {@code null} if the keyword was not
* found.
* @return the token representing the keyword 'external'
*/
Token get externalKeyword => _externalKeyword;
/**
- * Return the token representing the keyword 'factory', or `null` if the keyword was not
+ * Return the token representing the keyword 'factory', or {@code null} if the keyword was not
* found.
* @return the token representing the keyword 'factory'
*/
Token get factoryKeyword => _factoryKeyword;
/**
- * Return the token representing the keyword 'final', or `null` if the keyword was not
+ * Return the token representing the keyword 'final', or {@code null} if the keyword was not
* found.
* @return the token representing the keyword 'final'
*/
Token get finalKeyword => _finalKeyword;
/**
- * Return the token representing the keyword 'static', or `null` if the keyword was not
+ * Return the token representing the keyword 'static', or {@code null} if the keyword was not
* found.
* @return the token representing the keyword 'static'
*/
Token get staticKeyword => _staticKeyword;
/**
- * Return the token representing the keyword 'var', or `null` if the keyword was not found.
+ * Return the token representing the keyword 'var', or {@code null} if the keyword was not found.
* @return the token representing the keyword 'var'
*/
Token get varKeyword => _varKeyword;
@@ -246,12 +246,12 @@
}
/**
- * If the given keyword is not `null`, append it to the given builder, prefixing it with a
+ * If the given keyword is not {@code null}, append it to the given builder, prefixing it with a
* space if needed.
* @param builder the builder to which the keyword will be appended
- * @param needsSpace `true` if the keyword needs to be prefixed with a space
+ * @param needsSpace {@code true} if the keyword needs to be prefixed with a space
* @param keyword the keyword to be appended
- * @return `true` if subsequent keywords need to be prefixed with a space
+ * @return {@code true} if subsequent keywords need to be prefixed with a space
*/
bool appendKeyword(JavaStringBuilder builder, bool needsSpace, Token keyword) {
if (keyword != null) {
@@ -265,7 +265,7 @@
}
}
/**
- * Instances of the class `Parser` are used to parse tokens into an AST structure.
+ * Instances of the class {@code Parser} are used to parse tokens into an AST structure.
* @coverage dart.engine.parser
*/
class Parser {
@@ -329,7 +329,7 @@
/**
* Parse an expression, starting with the given token.
* @param token the first token of the expression
- * @return the expression that was parsed, or `null` if the tokens do not represent a
+ * @return the expression that was parsed, or {@code null} if the tokens do not represent a
* recognizable expression
*/
Expression parseExpression(Token token) {
@@ -345,7 +345,7 @@
/**
* Parse a statement, starting with the given token.
* @param token the first token of the statement
- * @return the statement that was parsed, or `null` if the tokens do not represent a
+ * @return the statement that was parsed, or {@code null} if the tokens do not represent a
* recognizable statement
*/
Statement parseStatement(Token token) {
@@ -361,7 +361,7 @@
/**
* Parse a sequence of statements, starting with the given token.
* @param token the first token of the sequence of statement
- * @return the statements that were parsed, or `null` if the tokens do not represent a
+ * @return the statements that were parsed, or {@code null} if the tokens do not represent a
* recognizable sequence of statements
*/
List<Statement> parseStatements(Token token) {
@@ -450,10 +450,10 @@
FunctionDeclaration convertToFunctionDeclaration(MethodDeclaration method) => new FunctionDeclaration.full(method.documentationComment, method.metadata, method.externalKeyword, method.returnType, method.propertyKeyword, method.name, new FunctionExpression.full(method.parameters, method.body));
/**
- * Return `true` if the current token could be the start of a compilation unit member. This
+ * Return {@code true} if the current token could be the start of a compilation unit member. This
* method is used for recovery purposes to decide when to stop skipping tokens after finding an
* error while parsing a compilation unit member.
- * @return `true` if the current token could be the start of a compilation unit member
+ * @return {@code true} if the current token could be the start of a compilation unit member
*/
bool couldBeStartOfCompilationUnitMember() {
if ((matches(Keyword.IMPORT) || matches(Keyword.EXPORT) || matches(Keyword.LIBRARY) || matches(Keyword.PART)) && !matches4(peek(), TokenType.PERIOD) && !matches4(peek(), TokenType.LT)) {
@@ -517,7 +517,7 @@
* @param expression the expression being checked
*/
void ensureAssignable(Expression expression) {
- if (expression != null && !expression.isAssignable) {
+ if (expression != null && !expression.isAssignable()) {
reportError7(ParserErrorCode.ILLEGAL_ASSIGNMENT_TO_NON_ASSIGNABLE, []);
}
}
@@ -556,7 +556,7 @@
/**
* Search the given list of ranges for a range that contains the given index. Return the range
- * that was found, or `null` if none of the ranges contain the index.
+ * that was found, or {@code null} if none of the ranges contain the index.
* @param ranges the ranges to be searched
* @param index the index contained in the returned range
* @return the range that was found
@@ -611,7 +611,7 @@
index = end;
}
} else if (JavaString.startsWithBefore(comment, "[:", index)) {
- int end = JavaString.indexOf(comment, ":]", index + 2);
+ int end = comment.indexOf(":]", index + 2);
if (end < 0) {
end = length;
}
@@ -625,7 +625,7 @@
}
/**
- * Return the end token associated with the given begin token, or `null` if either the given
+ * Return the end token associated with the given begin token, or {@code null} if either the given
* token is not a begin token or it does not have an end token associated with it.
* @param beginToken the token that is expected to have an end token associated with it
* @return the end token associated with the begin token
@@ -638,11 +638,11 @@
}
/**
- * Return `true` if the current token is the first token of a return type that is followed
+ * Return {@code true} if the current token is the first token of a return type that is followed
* by an identifier, possibly followed by a list of type parameters, followed by a
* left-parenthesis. This is used by parseTypeAlias to determine whether or not to parse a return
* type.
- * @return `true` if we can successfully parse the rest of a type alias if we first parse a
+ * @return {@code true} if we can successfully parse the rest of a type alias if we first parse a
* return type.
*/
bool hasReturnTypeInTypeAlias() {
@@ -654,8 +654,8 @@
}
/**
- * Return `true` if the current token appears to be the beginning of a function declaration.
- * @return `true` if the current token appears to be the beginning of a function declaration
+ * Return {@code true} if the current token appears to be the beginning of a function declaration.
+ * @return {@code true} if the current token appears to be the beginning of a function declaration
*/
bool isFunctionDeclaration() {
if (matches(Keyword.VOID)) {
@@ -676,9 +676,9 @@
}
/**
- * Return `true` if the given token appears to be the beginning of a function expression.
+ * Return {@code true} if the given token appears to be the beginning of a function expression.
* @param startToken the token that might be the start of a function expression
- * @return `true` if the given token appears to be the beginning of a function expression
+ * @return {@code true} if the given token appears to be the beginning of a function expression
*/
bool isFunctionExpression(Token startToken) {
Token afterParameters = skipFormalParameterList(startToken);
@@ -689,14 +689,14 @@
}
/**
- * Return `true` if the given character is a valid hexadecimal digit.
+ * Return {@code true} if the given character is a valid hexadecimal digit.
* @param character the character being tested
- * @return `true` if the character is a valid hexadecimal digit
+ * @return {@code true} if the character is a valid hexadecimal digit
*/
bool isHexDigit(int character) => (0x30 <= character && character <= 0x39) || (0x41 <= character && character <= 0x46) || (0x61 <= character && character <= 0x66);
/**
- * Return `true` if the current token is the first token in an initialized variable
+ * Return {@code true} if the current token is the first token in an initialized variable
* declaration rather than an expression. This method assumes that we have already skipped past
* any metadata that might be associated with the declaration.
* <pre>
@@ -714,7 +714,7 @@
* initializedIdentifier ::=
* identifier ('=' expression)?
* </pre>
- * @return `true` if the current token is the first token in an initialized variable
+ * @return {@code true} if the current token is the first token in an initialized variable
* declaration
*/
bool isInitializedVariableDeclaration() {
@@ -740,12 +740,12 @@
* Given that we have just found bracketed text within a comment, look to see whether that text is
* (a) followed by a parenthesized link address, (b) followed by a colon, or (c) followed by
* optional whitespace and another square bracket.
- *
+ * <p>
* This method uses the syntax described by the <a
* href="http://daringfireball.net/projects/markdown/syntax">markdown</a> project.
* @param comment the comment text in which the bracketed text was found
* @param rightIndex the index of the right bracket
- * @return `true` if the bracketed text is followed by a link address
+ * @return {@code true} if the bracketed text is followed by a link address
*/
bool isLinkText(String comment, int rightIndex) {
int length = comment.length;
@@ -768,14 +768,14 @@
}
/**
- * Return `true` if the given token appears to be the beginning of an operator declaration.
+ * Return {@code true} if the given token appears to be the beginning of an operator declaration.
* @param startToken the token that might be the start of an operator declaration
- * @return `true` if the given token appears to be the beginning of an operator declaration
+ * @return {@code true} if the given token appears to be the beginning of an operator declaration
*/
bool isOperator(Token startToken) {
- if (startToken.isOperator) {
+ if (startToken.isOperator()) {
Token token = startToken.next;
- while (token.isOperator) {
+ while (token.isOperator()) {
token = token.next;
}
return matches4(token, TokenType.OPEN_PAREN);
@@ -784,8 +784,8 @@
}
/**
- * Return `true` if the current token appears to be the beginning of a switch member.
- * @return `true` if the current token appears to be the beginning of a switch member
+ * Return {@code true} if the current token appears to be the beginning of a switch member.
+ * @return {@code true} if the current token appears to be the beginning of a switch member
*/
bool isSwitchMember() {
Token token = _currentToken;
@@ -801,9 +801,9 @@
/**
* Compare the given tokens to find the token that appears first in the source being parsed. That
- * is, return the left-most of all of the tokens. The arguments are allowed to be `null`.
- * Return the token with the smallest offset, or `null` if there are no arguments or if all
- * of the arguments are `null`.
+ * is, return the left-most of all of the tokens. The arguments are allowed to be {@code null}.
+ * Return the token with the smallest offset, or {@code null} if there are no arguments or if all
+ * of the arguments are {@code null}.
* @param tokens the tokens being compared
* @return the token with the smallest offset
*/
@@ -823,42 +823,42 @@
}
/**
- * Return `true` if the current token matches the given keyword.
+ * Return {@code true} if the current token matches the given keyword.
* @param keyword the keyword that can optionally appear in the current location
- * @return `true` if the current token matches the given keyword
+ * @return {@code true} if the current token matches the given keyword
*/
bool matches(Keyword keyword) => matches3(_currentToken, keyword);
/**
- * Return `true` if the current token matches the given identifier.
+ * Return {@code true} if the current token matches the given identifier.
* @param identifier the identifier that can optionally appear in the current location
- * @return `true` if the current token matches the given identifier
+ * @return {@code true} if the current token matches the given identifier
*/
bool matches2(String identifier) => identical(_currentToken.type, TokenType.IDENTIFIER) && _currentToken.lexeme == identifier;
/**
- * Return `true` if the given token matches the given keyword.
+ * Return {@code true} if the given token matches the given keyword.
* @param token the token being tested
* @param keyword the keyword that is being tested for
- * @return `true` if the given token matches the given keyword
+ * @return {@code true} if the given token matches the given keyword
*/
bool matches3(Token token, Keyword keyword2) => identical(token.type, TokenType.KEYWORD) && identical(((token as KeywordToken)).keyword, keyword2);
/**
- * Return `true` if the given token has the given type.
+ * Return {@code true} if the given token has the given type.
* @param token the token being tested
* @param type the type of token that is being tested for
- * @return `true` if the given token has the given type
+ * @return {@code true} if the given token has the given type
*/
bool matches4(Token token, TokenType type2) => identical(token.type, type2);
/**
- * Return `true` if the current token has the given type. Note that this method, unlike
+ * Return {@code true} if the current token has the given type. Note that this method, unlike
* other variants, will modify the token stream if possible to match a wider range of tokens. In
* particular, if we are attempting to match a '>' and the next token is either a '>>' or '>>>',
- * the token stream will be re-written and `true` will be returned.
+ * the token stream will be re-written and {@code true} will be returned.
* @param type the type of token that can optionally appear in the current location
- * @return `true` if the current token has the given type
+ * @return {@code true} if the current token has the given type
*/
bool matches5(TokenType type2) {
TokenType currentType = _currentToken.type;
@@ -901,10 +901,10 @@
}
/**
- * Return `true` if the given token has any one of the given types.
+ * Return {@code true} if the given token has any one of the given types.
* @param token the token being tested
* @param types the types of token that are being tested for
- * @return `true` if the given token has any of the given types
+ * @return {@code true} if the given token has any of the given types
*/
bool matchesAny(Token token, List<TokenType> types) {
TokenType actualType = token.type;
@@ -917,23 +917,23 @@
}
/**
- * Return `true` if the current token is a valid identifier. Valid identifiers include
+ * Return {@code true} if the current token is a valid identifier. Valid identifiers include
* built-in identifiers (pseudo-keywords).
- * @return `true` if the current token is a valid identifier
+ * @return {@code true} if the current token is a valid identifier
*/
bool matchesIdentifier() => matchesIdentifier2(_currentToken);
/**
- * Return `true` if the given token is a valid identifier. Valid identifiers include
+ * Return {@code true} if the given token is a valid identifier. Valid identifiers include
* built-in identifiers (pseudo-keywords).
- * @return `true` if the given token is a valid identifier
+ * @return {@code true} if the given token is a valid identifier
*/
- bool matchesIdentifier2(Token token) => matches4(token, TokenType.IDENTIFIER) || (matches4(token, TokenType.KEYWORD) && ((token as KeywordToken)).keyword.isPseudoKeyword);
+ bool matchesIdentifier2(Token token) => matches4(token, TokenType.IDENTIFIER) || (matches4(token, TokenType.KEYWORD) && ((token as KeywordToken)).keyword.isPseudoKeyword());
/**
- * If the current token has the given type, then advance to the next token and return `true`. Otherwise, return `false` without advancing.
+ * If the current token has the given type, then advance to the next token and return {@code true}. Otherwise, return {@code false} without advancing.
* @param type the type of token that can optionally appear in the current location
- * @return `true` if the current token has the given type
+ * @return {@code true} if the current token has the given type
*/
bool optional(TokenType type) {
if (matches5(type)) {
@@ -954,12 +954,12 @@
*/
Expression parseAdditiveExpression() {
Expression expression;
- if (matches(Keyword.SUPER) && _currentToken.next.type.isAdditiveOperator) {
+ if (matches(Keyword.SUPER) && _currentToken.next.type.isAdditiveOperator()) {
expression = new SuperExpression.full(andAdvance);
} else {
expression = parseMultiplicativeExpression();
}
- while (_currentToken.type.isAdditiveOperator) {
+ while (_currentToken.type.isAdditiveOperator()) {
Token operator = andAdvance;
expression = new BinaryExpression.full(expression, operator, parseMultiplicativeExpression());
}
@@ -1087,7 +1087,7 @@
* | 'super' assignableSelector
* | identifier
* </pre>
- * @param primaryAllowed `true` if the expression is allowed to be a primary without any
+ * @param primaryAllowed {@code true} if the expression is allowed to be a primary without any
* assignable selector
* @return the assignable expression that was parsed
*/
@@ -1136,7 +1136,7 @@
* | '.' identifier
* </pre>
* @param prefix the expression preceding the selector
- * @param optional `true` if the selector is optional
+ * @param optional {@code true} if the selector is optional
* @return the assignable selector that was parsed
*/
Expression parseAssignableSelector(Expression prefix, bool optional) {
@@ -1330,7 +1330,7 @@
}
}
}
- if (_currentToken.type.isAssignmentOperator) {
+ if (_currentToken.type.isAssignmentOperator()) {
Token operator = andAdvance;
ensureAssignable(expression);
expression = new AssignmentExpression.full(expression, operator, parseExpressionWithoutCascade());
@@ -1345,7 +1345,7 @@
* metadata 'abstract'? 'class' name typeParameterList? (extendsClause withClause?)? implementsClause? '{' classMembers '}'
* </pre>
* @param commentAndMetadata the metadata to be associated with the member
- * @param abstractKeyword the token for the keyword 'abstract', or `null` if the keyword was
+ * @param abstractKeyword the token for the keyword 'abstract', or {@code null} if the keyword was
* not given
* @return the class declaration that was parsed
*/
@@ -1425,7 +1425,7 @@
* | methodSignature functionBody
* </pre>
* @param className the name of the class containing the member being parsed
- * @return the class member that was parsed, or `null` if what was found was not a valid
+ * @return the class member that was parsed, or {@code null} if what was found was not a valid
* class member
*/
ClassMember parseClassMember(String className) {
@@ -1533,7 +1533,7 @@
* (metadata memberDefinition)
* </pre>
* @param className the name of the class whose members are being parsed
- * @param closingBracket the closing bracket for the class, or `null` if the closing bracket
+ * @param closingBracket the closing bracket for the class, or {@code null} if the closing bracket
* is missing
* @return the list of class members that were parsed
*/
@@ -1664,7 +1664,7 @@
* @param referenceSource the source occurring between the square brackets within a documentation
* comment
* @param sourceOffset the offset of the first character of the reference source
- * @return the comment reference that was parsed, or `null` if no reference could be found
+ * @return the comment reference that was parsed, or {@code null} if no reference could be found
*/
CommentReference parseCommentReference(String referenceSource, int sourceOffset) {
if (referenceSource.length == 0) {
@@ -1729,7 +1729,7 @@
while (leftIndex >= 0 && leftIndex + 1 < length) {
List<int> range = findRange(codeBlockRanges, leftIndex);
if (range == null) {
- int rightIndex = JavaString.indexOf(comment, ']', leftIndex);
+ int rightIndex = comment.indexOf(']', leftIndex);
if (rightIndex >= 0) {
int firstChar = comment.codeUnitAt(leftIndex + 1);
if (firstChar != 0x27 && firstChar != 0x22) {
@@ -1744,9 +1744,9 @@
} else {
rightIndex = leftIndex + 1;
}
- leftIndex = JavaString.indexOf(comment, '[', rightIndex);
+ leftIndex = comment.indexOf('[', rightIndex);
} else {
- leftIndex = JavaString.indexOf(comment, '[', range[1] + 1);
+ leftIndex = comment.indexOf('[', range[1] + 1);
}
}
}
@@ -1755,7 +1755,7 @@
/**
* Parse a compilation unit.
- *
+ * <p>
* Specified:
* <pre>
* compilationUnit ::=
@@ -1861,7 +1861,7 @@
* | variableDeclaration ';'
* </pre>
* @param commentAndMetadata the metadata to be associated with the member
- * @return the compilation unit member that was parsed, or `null` if what was parsed could
+ * @return the compilation unit member that was parsed, or {@code null} if what was parsed could
* not be represented as a compilation unit member
*/
CompilationUnitMember parseCompilationUnitMember(CommentAndMetadata commentAndMetadata) {
@@ -2129,7 +2129,7 @@
* multiLineComment?
* | singleLineComment
* </pre>
- * @return the documentation comment that was parsed, or `null` if there was no comment
+ * @return the documentation comment that was parsed, or {@code null} if there was no comment
*/
Comment parseDocumentationComment() {
List<Token> commentTokens = new List<Token>();
@@ -2204,12 +2204,12 @@
*/
Expression parseEqualityExpression() {
Expression expression;
- if (matches(Keyword.SUPER) && _currentToken.next.type.isEqualityOperator) {
+ if (matches(Keyword.SUPER) && _currentToken.next.type.isEqualityOperator()) {
expression = new SuperExpression.full(andAdvance);
} else {
expression = parseRelationalExpression();
}
- while (_currentToken.type.isEqualityOperator) {
+ while (_currentToken.type.isEqualityOperator()) {
Token operator = andAdvance;
expression = new BinaryExpression.full(expression, operator, parseRelationalExpression());
}
@@ -2261,7 +2261,7 @@
tokenType = _currentToken.type;
}
return new CascadeExpression.full(expression, cascadeSections);
- } else if (tokenType.isAssignmentOperator) {
+ } else if (tokenType.isAssignmentOperator()) {
Token operator = andAdvance;
ensureAssignable(expression);
return new AssignmentExpression.full(expression, operator, parseExpression2());
@@ -2303,7 +2303,7 @@
return parseRethrowExpression();
}
Expression expression = parseConditionalExpression();
- if (_currentToken.type.isAssignmentOperator) {
+ if (_currentToken.type.isAssignmentOperator()) {
Token operator = andAdvance;
ensureAssignable(expression);
expression = new AssignmentExpression.full(expression, operator, parseExpressionWithoutCascade());
@@ -2334,7 +2334,7 @@
* | 'var'
* | type
* </pre>
- * @param optional `true` if the keyword and type are optional
+ * @param optional {@code true} if the keyword and type are optional
* @return the 'final', 'const', 'var' or type that was parsed
*/
FinalConstVarOrType parseFinalConstVarOrType(bool optional) {
@@ -2358,7 +2358,7 @@
}
/**
- * Parse a formal parameter. At most one of `isOptional` and `isNamed` can be`true`.
+ * Parse a formal parameter. At most one of {@code isOptional} and {@code isNamed} can be{@code true}.
* <pre>
* defaultFormalParameter ::=
* normalFormalParameter ('=' expression)?
@@ -2603,9 +2603,9 @@
* '=>' expression
* | block
* </pre>
- * @param mayBeEmpty `true` if the function body is allowed to be empty
+ * @param mayBeEmpty {@code true} if the function body is allowed to be empty
* @param emptyErrorCode the error code to report if function body expecte, but not found
- * @param inExpression `true` if the function body is being parsed as part of an expression
+ * @param inExpression {@code true} if the function body is being parsed as part of an expression
* and therefore does not have a terminating semicolon
* @return the function body that was parsed
*/
@@ -2656,9 +2656,9 @@
* </pre>
* @param commentAndMetadata the documentation comment and metadata to be associated with the
* declaration
- * @param externalKeyword the 'external' keyword, or `null` if the function is not external
- * @param returnType the return type, or `null` if there is no return type
- * @param isStatement `true` if the function declaration is being parsed as a statement
+ * @param externalKeyword the 'external' keyword, or {@code null} if the function is not external
+ * @param returnType the return type, or {@code null} if there is no return type
+ * @param isStatement {@code true} if the function declaration is being parsed as a statement
* @return the function declaration that was parsed
*/
FunctionDeclaration parseFunctionDeclaration(CommentAndMetadata commentAndMetadata, Token externalKeyword, TypeName returnType) {
@@ -2710,7 +2710,7 @@
* </pre>
* @param commentAndMetadata the documentation comment and metadata to be associated with the
* declaration
- * @param returnType the return type, or `null` if there is no return type
+ * @param returnType the return type, or {@code null} if there is no return type
* @return the function declaration statement that was parsed
*/
Statement parseFunctionDeclarationStatement2(CommentAndMetadata commentAndMetadata, TypeName returnType) => new FunctionDeclarationStatement.full(parseFunctionDeclaration(commentAndMetadata, null, returnType));
@@ -2778,8 +2778,8 @@
* @param commentAndMetadata the documentation comment and metadata to be associated with the
* declaration
* @param externalKeyword the 'external' token
- * @param staticKeyword the static keyword, or `null` if the getter is not static
- * @param the return type that has already been parsed, or `null` if there was no return
+ * @param staticKeyword the static keyword, or {@code null} if the getter is not static
+ * @param the return type that has already been parsed, or {@code null} if there was no return
* type
* @return the getter that was parsed
*/
@@ -2893,10 +2893,10 @@
* </pre>
* @param commentAndMetadata the documentation comment and metadata to be associated with the
* declaration
- * @param staticKeyword the static keyword, or `null` if the getter is not static
- * @param keyword the token representing the 'final', 'const' or 'var' keyword, or `null` if
+ * @param staticKeyword the static keyword, or {@code null} if the getter is not static
+ * @param keyword the token representing the 'final', 'const' or 'var' keyword, or {@code null} if
* there is no keyword
- * @param type the type that has already been parsed, or `null` if 'var' was provided
+ * @param type the type that has already been parsed, or {@code null} if 'var' was provided
* @return the getter that was parsed
*/
FieldDeclaration parseInitializedIdentifierList(CommentAndMetadata commentAndMetadata, Token staticKeyword, Token keyword, TypeName type) {
@@ -2984,9 +2984,9 @@
* listLiteral ::=
* 'const'? typeArguments? '\[' (expressionList ','?)? '\]'
* </pre>
- * @param modifier the 'const' modifier appearing before the literal, or `null` if there is
+ * @param modifier the 'const' modifier appearing before the literal, or {@code null} if there is
* no modifier
- * @param typeArguments the type arguments appearing before the literal, or `null` if there
+ * @param typeArguments the type arguments appearing before the literal, or {@code null} if there
* are no type arguments
* @return the list literal that was parsed
*/
@@ -3024,7 +3024,7 @@
* listLiteral
* | mapLiteral
* </pre>
- * @param modifier the 'const' modifier appearing before the literal, or `null` if there is
+ * @param modifier the 'const' modifier appearing before the literal, or {@code null} if there is
* no modifier
* @return the list or map literal that was parsed
*/
@@ -3082,9 +3082,9 @@
* mapLiteral ::=
* 'const'? typeArguments? '{' (mapLiteralEntry (',' mapLiteralEntry)* ','?)? '}'
* </pre>
- * @param modifier the 'const' modifier appearing before the literal, or `null` if there is
+ * @param modifier the 'const' modifier appearing before the literal, or {@code null} if there is
* no modifier
- * @param typeArguments the type arguments that were declared, or `null` if there are no
+ * @param typeArguments the type arguments that were declared, or {@code null} if there are no
* type arguments
* @return the map literal that was parsed
*/
@@ -3136,7 +3136,7 @@
* @param commentAndMetadata the documentation comment and metadata to be associated with the
* declaration
* @param externalKeyword the 'external' token
- * @param staticKeyword the static keyword, or `null` if the getter is not static
+ * @param staticKeyword the static keyword, or {@code null} if the getter is not static
* @param returnType the return type of the method
* @return the method declaration that was parsed
*/
@@ -3157,7 +3157,7 @@
* @param commentAndMetadata the documentation comment and metadata to be associated with the
* declaration
* @param externalKeyword the 'external' token
- * @param staticKeyword the static keyword, or `null` if the getter is not static
+ * @param staticKeyword the static keyword, or {@code null} if the getter is not static
* @param returnType the return type of the method
* @param name the name of the method
* @param parameters the parameters to the method
@@ -3181,7 +3181,7 @@
* Parse the modifiers preceding a declaration. This method allows the modifiers to appear in any
* order but does generate errors for duplicated modifiers. Checks for other problems, such as
* having the modifiers appear in the wrong order or specifying both 'const' and 'final', are
- * reported in one of the methods whose name is prefixed with `validateModifiersFor`.
+ * reported in one of the methods whose name is prefixed with {@code validateModifiersFor}.
* <pre>
* modifiers ::=
* ('abstract' | 'const' | 'external' | 'factory' | 'final' | 'static' | 'var')
@@ -3259,12 +3259,12 @@
*/
Expression parseMultiplicativeExpression() {
Expression expression;
- if (matches(Keyword.SUPER) && _currentToken.next.type.isMultiplicativeOperator) {
+ if (matches(Keyword.SUPER) && _currentToken.next.type.isMultiplicativeOperator()) {
expression = new SuperExpression.full(andAdvance);
} else {
expression = parseUnaryExpression();
}
- while (_currentToken.type.isMultiplicativeOperator) {
+ while (_currentToken.type.isMultiplicativeOperator()) {
Token operator = andAdvance;
expression = new BinaryExpression.full(expression, operator, parseUnaryExpression());
}
@@ -3312,7 +3312,7 @@
}
}
return parseBlock();
- } else if (matches5(TokenType.KEYWORD) && !((_currentToken as KeywordToken)).keyword.isPseudoKeyword) {
+ } else if (matches5(TokenType.KEYWORD) && !((_currentToken as KeywordToken)).keyword.isPseudoKeyword()) {
Keyword keyword = ((_currentToken as KeywordToken)).keyword;
if (identical(keyword, Keyword.ASSERT)) {
return parseAssertStatement();
@@ -3442,7 +3442,7 @@
* @param commentAndMetadata the documentation comment and metadata to be associated with the
* declaration
* @param externalKeyword the 'external' token
- * @param the return type that has already been parsed, or `null` if there was no return
+ * @param the return type that has already been parsed, or {@code null} if there was no return
* type
* @return the operator declaration that was parsed
*/
@@ -3454,7 +3454,7 @@
reportError8(ParserErrorCode.MISSING_KEYWORD_OPERATOR, _currentToken, []);
operatorKeyword = createSyntheticToken(Keyword.OPERATOR);
}
- if (!_currentToken.isUserDefinableOperator) {
+ if (!_currentToken.isUserDefinableOperator()) {
reportError7(ParserErrorCode.NON_USER_DEFINABLE_OPERATOR, [_currentToken.lexeme]);
}
SimpleIdentifier name = new SimpleIdentifier.full(andAdvance);
@@ -3475,7 +3475,7 @@
}
/**
- * Parse a return type if one is given, otherwise return `null` without advancing.
+ * Parse a return type if one is given, otherwise return {@code null} without advancing.
* @return the return type that was parsed
*/
TypeName parseOptionalReturnType() {
@@ -3543,7 +3543,7 @@
} while (matches5(TokenType.OPEN_SQUARE_BRACKET) || matches5(TokenType.PERIOD) || matches5(TokenType.OPEN_PAREN));
return operand;
}
- if (!_currentToken.type.isIncrementOperator) {
+ if (!_currentToken.type.isIncrementOperator()) {
return operand;
}
if (operand is FunctionExpressionInvocation) {
@@ -3693,7 +3693,7 @@
* @return the relational expression that was parsed
*/
Expression parseRelationalExpression() {
- if (matches(Keyword.SUPER) && _currentToken.next.type.isRelationalOperator) {
+ if (matches(Keyword.SUPER) && _currentToken.next.type.isRelationalOperator()) {
Expression expression = new SuperExpression.full(andAdvance);
Token operator = andAdvance;
expression = new BinaryExpression.full(expression, operator, parseShiftExpression());
@@ -3710,7 +3710,7 @@
notOperator = andAdvance;
}
expression = new IsExpression.full(expression, isOperator, notOperator, parseTypeName());
- } else if (_currentToken.type.isRelationalOperator) {
+ } else if (_currentToken.type.isRelationalOperator()) {
Token operator = andAdvance;
expression = new BinaryExpression.full(expression, operator, parseShiftExpression());
}
@@ -3773,8 +3773,8 @@
* @param commentAndMetadata the documentation comment and metadata to be associated with the
* declaration
* @param externalKeyword the 'external' token
- * @param staticKeyword the static keyword, or `null` if the setter is not static
- * @param the return type that has already been parsed, or `null` if there was no return
+ * @param staticKeyword the static keyword, or {@code null} if the setter is not static
+ * @param the return type that has already been parsed, or {@code null} if there was no return
* type
* @return the setter that was parsed
*/
@@ -3801,12 +3801,12 @@
*/
Expression parseShiftExpression() {
Expression expression;
- if (matches(Keyword.SUPER) && _currentToken.next.type.isShiftOperator) {
+ if (matches(Keyword.SUPER) && _currentToken.next.type.isShiftOperator()) {
expression = new SuperExpression.full(andAdvance);
} else {
expression = parseAdditiveExpression();
}
- while (_currentToken.type.isShiftOperator) {
+ while (_currentToken.type.isShiftOperator()) {
Token operator = andAdvance;
expression = new BinaryExpression.full(expression, operator, parseAdditiveExpression());
}
@@ -4256,7 +4256,7 @@
return new PrefixExpression.full(operator, new SuperExpression.full(andAdvance));
}
return new PrefixExpression.full(operator, parseUnaryExpression());
- } else if (_currentToken.type.isIncrementOperator) {
+ } else if (_currentToken.type.isIncrementOperator()) {
Token operator = andAdvance;
if (matches(Keyword.SUPER)) {
if (matches4(peek(), TokenType.OPEN_SQUARE_BRACKET) || matches4(peek(), TokenType.PERIOD)) {
@@ -4323,8 +4323,8 @@
* variableDeclarationList ::=
* finalConstVarOrType variableDeclaration (',' variableDeclaration)
* </pre>
- * @param commentAndMetadata the metadata to be associated with the variable declaration list, or`null` if there is no attempt at parsing the comment and metadata
- * @param keyword the token representing the 'final', 'const' or 'var' keyword, or `null` if
+ * @param commentAndMetadata the metadata to be associated with the variable declaration list, or{@code null} if there is no attempt at parsing the comment and metadata
+ * @param keyword the token representing the 'final', 'const' or 'var' keyword, or {@code null} if
* there is no keyword
* @param type the type of the variables in the list
* @return the variable declaration list that was parsed
@@ -4346,7 +4346,7 @@
* variableDeclarationList ';'
* </pre>
* @param commentAndMetadata the metadata to be associated with the variable declaration
- * statement, or `null` if there is no attempt at parsing the comment and metadata
+ * statement, or {@code null} if there is no attempt at parsing the comment and metadata
* @return the variable declaration statement that was parsed
*/
VariableDeclarationStatement parseVariableDeclarationStatement(CommentAndMetadata commentAndMetadata) {
@@ -4362,8 +4362,8 @@
* variableDeclarationList ';'
* </pre>
* @param commentAndMetadata the metadata to be associated with the variable declaration
- * statement, or `null` if there is no attempt at parsing the comment and metadata
- * @param keyword the token representing the 'final', 'const' or 'var' keyword, or `null` if
+ * statement, or {@code null} if there is no attempt at parsing the comment and metadata
+ * @param keyword the token representing the 'final', 'const' or 'var' keyword, or {@code null} if
* there is no keyword
* @param type the type of the variables in the list
* @return the variable declaration statement that was parsed
@@ -4416,14 +4416,14 @@
}
/**
- * Return the token that is immediately after the current token. This is equivalent to[peek].
+ * Return the token that is immediately after the current token. This is equivalent to{@link #peek(int) peek(1)}.
* @return the token that is immediately after the current token
*/
Token peek() => _currentToken.next;
/**
* Return the token that is the given distance after the current token.
- * @param distance the number of tokens to look ahead, where `0` is the current token,`1` is the next token, etc.
+ * @param distance the number of tokens to look ahead, where {@code 0} is the current token,{@code 1} is the next token, etc.
* @return the token that is the given distance after the current token
*/
Token peek2(int distance) {
@@ -4466,7 +4466,7 @@
/**
* Parse the 'final', 'const', 'var' or type preceding a variable declaration, starting at the
* given token, without actually creating a type or changing the current token. Return the token
- * following the type that was parsed, or `null` if the given token is not the first token
+ * following the type that was parsed, or {@code null} if the given token is not the first token
* in a valid type.
* <pre>
* finalConstVarOrType ::=
@@ -4498,16 +4498,16 @@
/**
* Parse a list of formal parameters, starting at the given token, without actually creating a
* formal parameter list or changing the current token. Return the token following the formal
- * parameter list that was parsed, or `null` if the given token is not the first token in a
+ * parameter list that was parsed, or {@code null} if the given token is not the first token in a
* valid list of formal parameter.
- *
+ * <p>
* Note that unlike other skip methods, this method uses a heuristic. In the worst case, the
* parameters could be prefixed by metadata, which would require us to be able to skip arbitrary
* expressions. Rather than duplicate the logic of most of the parse methods we simply look for
* something that is likely to be a list of parameters and then skip to returning the token after
* the closing parenthesis.
- *
- * This method must be kept in sync with [parseFormalParameterList].
+ * <p>
+ * This method must be kept in sync with {@link #parseFormalParameterList()}.
* <pre>
* formalParameterList ::=
* '(' ')'
@@ -4555,7 +4555,7 @@
/**
* If the given token is a begin token with an associated end token, then return the token
- * following the end token. Otherwise, return `null`.
+ * following the end token. Otherwise, return {@code null}.
* @param startToken the token that is assumed to be a being token
* @return the token following the matching end token
*/
@@ -4573,10 +4573,10 @@
/**
* Parse a prefixed identifier, starting at the given token, without actually creating a prefixed
* identifier or changing the current token. Return the token following the prefixed identifier
- * that was parsed, or `null` if the given token is not the first token in a valid prefixed
+ * that was parsed, or {@code null} if the given token is not the first token in a valid prefixed
* identifier.
- *
- * This method must be kept in sync with [parsePrefixedIdentifier].
+ * <p>
+ * This method must be kept in sync with {@link #parsePrefixedIdentifier()}.
* <pre>
* prefixedIdentifier ::=
* identifier ('.' identifier)?
@@ -4596,9 +4596,9 @@
/**
* Parse a return type, starting at the given token, without actually creating a return type or
- * changing the current token. Return the token following the return type that was parsed, or`null` if the given token is not the first token in a valid return type.
- *
- * This method must be kept in sync with [parseReturnType].
+ * changing the current token. Return the token following the return type that was parsed, or{@code null} if the given token is not the first token in a valid return type.
+ * <p>
+ * This method must be kept in sync with {@link #parseReturnType()}.
* <pre>
* returnType ::=
* 'void'
@@ -4618,10 +4618,10 @@
/**
* Parse a simple identifier, starting at the given token, without actually creating a simple
* identifier or changing the current token. Return the token following the simple identifier that
- * was parsed, or `null` if the given token is not the first token in a valid simple
+ * was parsed, or {@code null} if the given token is not the first token in a valid simple
* identifier.
- *
- * This method must be kept in sync with [parseSimpleIdentifier].
+ * <p>
+ * This method must be kept in sync with {@link #parseSimpleIdentifier()}.
* <pre>
* identifier ::=
* IDENTIFIER
@@ -4630,7 +4630,7 @@
* @return the token following the simple identifier that was parsed
*/
Token skipSimpleIdentifier(Token startToken) {
- if (matches4(startToken, TokenType.IDENTIFIER) || (matches4(startToken, TokenType.KEYWORD) && ((startToken as KeywordToken)).keyword.isPseudoKeyword)) {
+ if (matches4(startToken, TokenType.IDENTIFIER) || (matches4(startToken, TokenType.KEYWORD) && ((startToken as KeywordToken)).keyword.isPseudoKeyword())) {
return startToken.next;
}
return null;
@@ -4639,10 +4639,10 @@
/**
* Parse a string literal that contains interpolations, starting at the given token, without
* actually creating a string literal or changing the current token. Return the token following
- * the string literal that was parsed, or `null` if the given token is not the first token
+ * the string literal that was parsed, or {@code null} if the given token is not the first token
* in a valid string literal.
- *
- * This method must be kept in sync with [parseStringInterpolation].
+ * <p>
+ * This method must be kept in sync with {@link #parseStringInterpolation(Token)}.
* @param startToken the token at which parsing is to begin
* @return the string literal that was parsed
*/
@@ -4692,9 +4692,9 @@
/**
* Parse a string literal, starting at the given token, without actually creating a string literal
* or changing the current token. Return the token following the string literal that was parsed,
- * or `null` if the given token is not the first token in a valid string literal.
- *
- * This method must be kept in sync with [parseStringLiteral].
+ * or {@code null} if the given token is not the first token in a valid string literal.
+ * <p>
+ * This method must be kept in sync with {@link #parseStringLiteral()}.
* <pre>
* stringLiteral ::=
* MULTI_LINE_STRING+
@@ -4721,9 +4721,9 @@
/**
* Parse a list of type arguments, starting at the given token, without actually creating a type argument list
* or changing the current token. Return the token following the type argument list that was parsed,
- * or `null` if the given token is not the first token in a valid type argument list.
- *
- * This method must be kept in sync with [parseTypeArgumentList].
+ * or {@code null} if the given token is not the first token in a valid type argument list.
+ * <p>
+ * This method must be kept in sync with {@link #parseTypeArgumentList()}.
* <pre>
* typeArguments ::=
* '<' typeList '>'
@@ -4760,9 +4760,9 @@
/**
* Parse a type name, starting at the given token, without actually creating a type name or
- * changing the current token. Return the token following the type name that was parsed, or`null` if the given token is not the first token in a valid type name.
- *
- * This method must be kept in sync with [parseTypeName].
+ * changing the current token. Return the token following the type name that was parsed, or{@code null} if the given token is not the first token in a valid type name.
+ * <p>
+ * This method must be kept in sync with {@link #parseTypeName()}.
* <pre>
* type ::=
* qualified typeArguments?
@@ -4784,10 +4784,10 @@
/**
* Parse a list of type parameters, starting at the given token, without actually creating a type
* parameter list or changing the current token. Return the token following the type parameter
- * list that was parsed, or `null` if the given token is not the first token in a valid type
+ * list that was parsed, or {@code null} if the given token is not the first token in a valid type
* parameter list.
- *
- * This method must be kept in sync with [parseTypeParameterList].
+ * <p>
+ * This method must be kept in sync with {@link #parseTypeParameterList()}.
* <pre>
* typeParameterList ::=
* '<' typeParameter (',' typeParameter)* '>'
@@ -5199,7 +5199,7 @@
}
}
/**
- * The enumeration `ParserErrorCode` defines the error codes used for errors detected by the
+ * The enumeration {@code ParserErrorCode} defines the error codes used for errors detected by the
* parser. The convention for this class is for the name of the error code to indicate the problem
* that caused the error to be generated and for the error message to explain what is wrong and,
* when appropriate, how the problem can be corrected.
@@ -5530,7 +5530,7 @@
for (String line in StringUtils.split(token.lexeme, "\n")) {
if (firstLine) {
firstLine = false;
- if (node.isDocumentation) {
+ if (node.isDocumentation()) {
nl2();
}
} else {
@@ -5790,7 +5790,7 @@
return null;
}
Object visitIndexExpression(IndexExpression node) {
- if (node.isCascaded) {
+ if (node.isCascaded()) {
_writer.print("..");
} else {
visit(node.array);
@@ -5892,7 +5892,7 @@
visit8(node.propertyKeyword, " ");
visit8(node.operatorKeyword, " ");
visit(node.name);
- if (!node.isGetter) {
+ if (!node.isGetter()) {
visit(node.parameters);
}
if (node.body is! EmptyFunctionBody) {
@@ -5902,7 +5902,7 @@
return null;
}
Object visitMethodInvocation(MethodInvocation node) {
- if (node.isCascaded) {
+ if (node.isCascaded()) {
_writer.print("..");
} else {
visit6(node.target, ".");
@@ -5961,7 +5961,7 @@
return null;
}
Object visitPropertyAccess(PropertyAccess node) {
- if (node.isCascaded) {
+ if (node.isCascaded()) {
_writer.print("..");
} else {
visit6(node.target, ".");
diff --git a/pkg/analyzer_experimental/lib/src/generated/resolver.dart b/pkg/analyzer_experimental/lib/src/generated/resolver.dart
index dc5fb59..3a052ac 100644
--- a/pkg/analyzer_experimental/lib/src/generated/resolver.dart
+++ b/pkg/analyzer_experimental/lib/src/generated/resolver.dart
@@ -17,7 +17,7 @@
import 'engine.dart';
import 'constant.dart';
/**
- * Instances of the class `CompilationUnitBuilder` build an element model for a single
+ * Instances of the class {@code CompilationUnitBuilder} build an element model for a single
* compilation unit.
* @coverage dart.engine.resolver
*/
@@ -49,7 +49,7 @@
}
}
/**
- * Instances of the class `ElementBuilder` traverse an AST structure and build the element
+ * Instances of the class {@code ElementBuilder} traverse an AST structure and build the element
* model representing the AST structure.
* @coverage dart.engine.resolver
*/
@@ -76,13 +76,6 @@
bool _isValidMixin = false;
/**
- * A collection holding the function types defined in a class that need to have their type
- * arguments set to the types of the type parameters for the class, or `null` if we are not
- * currently processing nodes within a class.
- */
- List<FunctionTypeImpl> _functionTypesToFix = null;
-
- /**
* Initialize a newly created element builder to build the elements for a compilation unit.
* @param initialHolder the element holder associated with the compilation unit being built
*/
@@ -117,14 +110,12 @@
Object visitClassDeclaration(ClassDeclaration node) {
ElementHolder holder = new ElementHolder();
_isValidMixin = true;
- _functionTypesToFix = new List<FunctionTypeImpl>();
visitChildren(holder, node);
SimpleIdentifier className = node.name;
ClassElementImpl element = new ClassElementImpl(className);
List<TypeVariableElement> typeVariables = holder.typeVariables;
- List<Type2> typeArguments = createTypeVariableTypes(typeVariables);
InterfaceTypeImpl interfaceType = new InterfaceTypeImpl.con1(element);
- interfaceType.typeArguments = typeArguments;
+ interfaceType.typeArguments = createTypeVariableTypes(typeVariables);
element.type = interfaceType;
List<ConstructorElement> constructors = holder.constructors;
if (constructors.length == 0) {
@@ -137,18 +128,12 @@
element.methods = holder.methods;
element.typeVariables = typeVariables;
element.validMixin = _isValidMixin;
- for (FunctionTypeImpl functionType in _functionTypesToFix) {
- functionType.typeArguments = typeArguments;
- }
- _functionTypesToFix = null;
_currentHolder.addType(element);
className.element = element;
- holder.validate();
return null;
}
Object visitClassTypeAlias(ClassTypeAlias node) {
ElementHolder holder = new ElementHolder();
- _functionTypesToFix = new List<FunctionTypeImpl>();
visitChildren(holder, node);
SimpleIdentifier className = node.name;
ClassElementImpl element = new ClassElementImpl(className);
@@ -156,18 +141,12 @@
element.typedef = true;
List<TypeVariableElement> typeVariables = holder.typeVariables;
element.typeVariables = typeVariables;
- List<Type2> typeArguments = createTypeVariableTypes(typeVariables);
InterfaceTypeImpl interfaceType = new InterfaceTypeImpl.con1(element);
- interfaceType.typeArguments = typeArguments;
+ interfaceType.typeArguments = createTypeVariableTypes(typeVariables);
element.type = interfaceType;
element.constructors = createDefaultConstructors(interfaceType);
- for (FunctionTypeImpl functionType in _functionTypesToFix) {
- functionType.typeArguments = typeArguments;
- }
- _functionTypesToFix = null;
_currentHolder.addType(element);
className.element = element;
- holder.validate();
return null;
}
Object visitConstructorDeclaration(ConstructorDeclaration node) {
@@ -200,7 +179,6 @@
} else {
constructorName.element = element;
}
- holder.validate();
return null;
}
Object visitDeclaredIdentifier(DeclaredIdentifier node) {
@@ -227,13 +205,15 @@
initializer.parameters = holder.parameters;
SimpleIdentifier parameterName = node.parameter.identifier;
ParameterElementImpl parameter;
- if (node.parameter is FieldFormalParameter) {
- parameter = new DefaultFieldFormalParameterElementImpl(parameterName);
+ if (node.isConst()) {
+ parameter = new ConstParameterElementImpl(parameterName);
+ parameter.const3 = true;
+ } else if (node.parameter is FieldFormalParameter) {
+ parameter = new FieldFormalParameterElementImpl(parameterName);
} else {
- parameter = new DefaultParameterElementImpl(parameterName);
+ parameter = new ParameterElementImpl(parameterName);
}
- parameter.const3 = node.isConst;
- parameter.final2 = node.isFinal;
+ parameter.final2 = node.isFinal();
parameter.initializer = initializer;
parameter.parameterKind = node.kind;
Expression defaultValue = node.defaultValue;
@@ -247,7 +227,6 @@
_currentHolder.addParameter(parameter);
parameterName.element = parameter;
node.parameter.accept(this);
- holder.validate();
return null;
}
Object visitFieldDeclaration(FieldDeclaration node) {
@@ -264,8 +243,8 @@
if (node.parent is! DefaultFormalParameter) {
SimpleIdentifier parameterName = node.identifier;
FieldFormalParameterElementImpl parameter = new FieldFormalParameterElementImpl(parameterName);
- parameter.const3 = node.isConst;
- parameter.final2 = node.isFinal;
+ parameter.const3 = node.isConst();
+ parameter.final2 = node.isFinal();
parameter.parameterKind = node.kind;
_currentHolder.addParameter(parameter);
parameterName.element = parameter;
@@ -291,6 +270,8 @@
element.labels = holder.labels;
element.localVariables = holder.localVariables;
element.parameters = holder.parameters;
+ FunctionTypeImpl type = new FunctionTypeImpl.con1(element);
+ element.type = type;
_currentHolder.addFunction(element);
expression.element = element;
functionName.element = element;
@@ -333,7 +314,6 @@
propertyNameNode.element = setter;
}
}
- holder.validate();
}
return null;
}
@@ -360,13 +340,9 @@
}
}
FunctionTypeImpl type = new FunctionTypeImpl.con1(element);
- if (_functionTypesToFix != null) {
- _functionTypesToFix.add(type);
- }
element.type = type;
_currentHolder.addFunction(element);
node.element = element;
- holder.validate();
return null;
}
Object visitFunctionTypeAlias(FunctionTypeAlias node) {
@@ -383,7 +359,6 @@
element.type = type;
_currentHolder.addTypeAlias(element);
aliasName.element = element;
- holder.validate();
return null;
}
Object visitFunctionTypedFormalParameter(FunctionTypedFormalParameter node) {
@@ -397,7 +372,6 @@
ElementHolder holder = new ElementHolder();
visitChildren(holder, node);
((node.element as ParameterElementImpl)).parameters = holder.parameters;
- holder.validate();
return null;
}
Object visitLabeledStatement(LabeledStatement node) {
@@ -419,7 +393,7 @@
} finally {
_inFunction = wasInFunction;
}
- bool isStatic = node.isStatic;
+ bool isStatic = node.isStatic();
sc.Token property = node.propertyKeyword;
if (property == null) {
SimpleIdentifier methodName = node.name;
@@ -428,7 +402,7 @@
nameOfMethod = "unary-";
}
MethodElementImpl element = new MethodElementImpl.con2(nameOfMethod, methodName.offset);
- element.abstract = node.isAbstract;
+ element.abstract = node.isAbstract();
element.functions = holder.functions;
element.labels = holder.labels;
element.localVariables = holder.localVariables;
@@ -474,15 +448,14 @@
propertyNameNode.element = setter;
}
}
- holder.validate();
return null;
}
Object visitSimpleFormalParameter(SimpleFormalParameter node) {
if (node.parent is! DefaultFormalParameter) {
SimpleIdentifier parameterName = node.identifier;
ParameterElementImpl parameter = new ParameterElementImpl(parameterName);
- parameter.const3 = node.isConst;
- parameter.final2 = node.isFinal;
+ parameter.const3 = node.isConst();
+ parameter.final2 = node.isFinal();
parameter.parameterKind = node.kind;
_currentHolder.addParameter(parameter);
parameterName.element = parameter;
@@ -581,7 +554,6 @@
initializer.localVariables = holder.localVariables;
initializer.synthetic = true;
element.initializer = initializer;
- holder.validate();
}
if (element is PropertyInducingElementImpl) {
PropertyInducingElementImpl variable = element as PropertyInducingElementImpl;
@@ -590,13 +562,13 @@
}
PropertyAccessorElementImpl getter = new PropertyAccessorElementImpl.con2(variable);
getter.getter = true;
- getter.static = variable.isStatic;
+ getter.static = variable.isStatic();
_currentHolder.addAccessor(getter);
variable.getter = getter;
if (!isFinal) {
PropertyAccessorElementImpl setter = new PropertyAccessorElementImpl.con2(variable);
setter.setter = true;
- setter.static = variable.isStatic;
+ setter.static = variable.isStatic();
_currentHolder.addAccessor(setter);
variable.setter = setter;
}
@@ -605,26 +577,18 @@
}
/**
- * Creates the [ConstructorElement]s array with the single default constructor element.
+ * Creates the {@link ConstructorElement}s array with the single default constructor element.
* @param interfaceType the interface type for which to create a default constructor
- * @return the [ConstructorElement]s array with the single default constructor element
+ * @return the {@link ConstructorElement}s array with the single default constructor element
*/
List<ConstructorElement> createDefaultConstructors(InterfaceTypeImpl interfaceType) {
ConstructorElementImpl constructor = new ConstructorElementImpl(null);
constructor.synthetic = true;
- constructor.returnType = interfaceType;
FunctionTypeImpl type = new FunctionTypeImpl.con1(constructor);
- _functionTypesToFix.add(type);
+ type.returnType = interfaceType;
constructor.type = type;
return <ConstructorElement> [constructor];
}
-
- /**
- * Create the types associated with the given type variables, setting the type of each type
- * variable, and return an array of types corresponding to the given variables.
- * @param typeVariables the type variables for which types are to be created
- * @return
- */
List<Type2> createTypeVariableTypes(List<TypeVariableElement> typeVariables) {
int typeVariableCount = typeVariables.length;
List<Type2> typeArguments = new List<Type2>(typeVariableCount);
@@ -638,7 +602,7 @@
}
/**
- * Return the body of the function that contains the given parameter, or `null` if no
+ * Return the body of the function that contains the given parameter, or {@code null} if no
* function body could be found.
* @param node the parameter contained in the function whose body is to be returned
* @return the body of the function that contains the given parameter
@@ -657,10 +621,10 @@
}
/**
- * Return `true` if the given token is a token for the given keyword.
+ * Return {@code true} if the given token is a token for the given keyword.
* @param token the token being tested
* @param keyword the keyword being tested for
- * @return `true` if the given token is a token for the given keyword
+ * @return {@code true} if the given token is a token for the given keyword
*/
bool matches(sc.Token token, sc.Keyword keyword2) => token != null && identical(token.type, sc.TokenType.KEYWORD) && identical(((token as sc.KeywordToken)).keyword, keyword2);
@@ -699,115 +663,72 @@
}
}
/**
- * Instances of the class `ElementHolder` hold on to elements created while traversing an AST
+ * Instances of the class {@code ElementHolder} hold on to elements created while traversing an AST
* structure so that they can be accessed when creating their enclosing element.
* @coverage dart.engine.resolver
*/
class ElementHolder {
- List<PropertyAccessorElement> _accessors;
- List<ConstructorElement> _constructors;
- List<FieldElement> _fields;
- List<FunctionElement> _functions;
- List<LabelElement> _labels;
- List<VariableElement> _localVariables;
- List<MethodElement> _methods;
- List<ParameterElement> _parameters;
- List<VariableElement> _topLevelVariables;
- List<ClassElement> _types;
- List<FunctionTypeAliasElement> _typeAliases;
- List<TypeVariableElement> _typeVariables;
+ List<PropertyAccessorElement> _accessors = new List<PropertyAccessorElement>();
+ List<ConstructorElement> _constructors = new List<ConstructorElement>();
+ List<FieldElement> _fields = new List<FieldElement>();
+ List<FunctionElement> _functions = new List<FunctionElement>();
+ List<LabelElement> _labels = new List<LabelElement>();
+ List<VariableElement> _localVariables = new List<VariableElement>();
+ List<MethodElement> _methods = new List<MethodElement>();
+ List<FunctionTypeAliasElement> _typeAliases = new List<FunctionTypeAliasElement>();
+ List<ParameterElement> _parameters = new List<ParameterElement>();
+ List<VariableElement> _topLevelVariables = new List<VariableElement>();
+ List<ClassElement> _types = new List<ClassElement>();
+ List<TypeVariableElement> _typeVariables = new List<TypeVariableElement>();
void addAccessor(PropertyAccessorElement element) {
- if (_accessors == null) {
- _accessors = new List<PropertyAccessorElement>();
- }
_accessors.add(element);
}
void addConstructor(ConstructorElement element) {
- if (_constructors == null) {
- _constructors = new List<ConstructorElement>();
- }
_constructors.add(element);
}
void addField(FieldElement element) {
- if (_fields == null) {
- _fields = new List<FieldElement>();
- }
_fields.add(element);
}
void addFunction(FunctionElement element) {
- if (_functions == null) {
- _functions = new List<FunctionElement>();
- }
_functions.add(element);
}
void addLabel(LabelElement element) {
- if (_labels == null) {
- _labels = new List<LabelElement>();
- }
_labels.add(element);
}
void addLocalVariable(LocalVariableElement element) {
- if (_localVariables == null) {
- _localVariables = new List<VariableElement>();
- }
_localVariables.add(element);
}
void addMethod(MethodElement element) {
- if (_methods == null) {
- _methods = new List<MethodElement>();
- }
_methods.add(element);
}
void addParameter(ParameterElement element) {
- if (_parameters == null) {
- _parameters = new List<ParameterElement>();
- }
_parameters.add(element);
}
void addTopLevelVariable(TopLevelVariableElement element) {
- if (_topLevelVariables == null) {
- _topLevelVariables = new List<VariableElement>();
- }
_topLevelVariables.add(element);
}
void addType(ClassElement element) {
- if (_types == null) {
- _types = new List<ClassElement>();
- }
_types.add(element);
}
void addTypeAlias(FunctionTypeAliasElement element) {
- if (_typeAliases == null) {
- _typeAliases = new List<FunctionTypeAliasElement>();
- }
_typeAliases.add(element);
}
void addTypeVariable(TypeVariableElement element) {
- if (_typeVariables == null) {
- _typeVariables = new List<TypeVariableElement>();
- }
_typeVariables.add(element);
}
List<PropertyAccessorElement> get accessors {
- if (_accessors == null) {
+ if (_accessors.isEmpty) {
return PropertyAccessorElementImpl.EMPTY_ARRAY;
}
- List<PropertyAccessorElement> result = new List.from(_accessors);
- _accessors = null;
- return result;
+ return new List.from(_accessors);
}
List<ConstructorElement> get constructors {
- if (_constructors == null) {
+ if (_constructors.isEmpty) {
return ConstructorElementImpl.EMPTY_ARRAY;
}
- List<ConstructorElement> result = new List.from(_constructors);
- _constructors = null;
- return result;
+ return new List.from(_constructors);
}
FieldElement getField(String fieldName) {
- if (_fields == null) {
- return null;
- }
for (FieldElement field in _fields) {
if (field.name == fieldName) {
return field;
@@ -816,175 +737,68 @@
return null;
}
List<FieldElement> get fields {
- if (_fields == null) {
+ if (_fields.isEmpty) {
return FieldElementImpl.EMPTY_ARRAY;
}
- List<FieldElement> result = new List.from(_fields);
- _fields = null;
- return result;
+ return new List.from(_fields);
}
List<FunctionElement> get functions {
- if (_functions == null) {
+ if (_functions.isEmpty) {
return FunctionElementImpl.EMPTY_ARRAY;
}
- List<FunctionElement> result = new List.from(_functions);
- _functions = null;
- return result;
+ return new List.from(_functions);
}
List<LabelElement> get labels {
- if (_labels == null) {
+ if (_labels.isEmpty) {
return LabelElementImpl.EMPTY_ARRAY;
}
- List<LabelElement> result = new List.from(_labels);
- _labels = null;
- return result;
+ return new List.from(_labels);
}
List<LocalVariableElement> get localVariables {
- if (_localVariables == null) {
+ if (_localVariables.isEmpty) {
return LocalVariableElementImpl.EMPTY_ARRAY;
}
- List<LocalVariableElement> result = new List.from(_localVariables);
- _localVariables = null;
- return result;
+ return new List.from(_localVariables);
}
List<MethodElement> get methods {
- if (_methods == null) {
+ if (_methods.isEmpty) {
return MethodElementImpl.EMPTY_ARRAY;
}
- List<MethodElement> result = new List.from(_methods);
- _methods = null;
- return result;
+ return new List.from(_methods);
}
List<ParameterElement> get parameters {
- if (_parameters == null) {
+ if (_parameters.isEmpty) {
return ParameterElementImpl.EMPTY_ARRAY;
}
- List<ParameterElement> result = new List.from(_parameters);
- _parameters = null;
- return result;
+ return new List.from(_parameters);
}
List<TopLevelVariableElement> get topLevelVariables {
- if (_topLevelVariables == null) {
+ if (_topLevelVariables.isEmpty) {
return TopLevelVariableElementImpl.EMPTY_ARRAY;
}
- List<TopLevelVariableElement> result = new List.from(_topLevelVariables);
- _topLevelVariables = null;
- return result;
+ return new List.from(_topLevelVariables);
}
List<FunctionTypeAliasElement> get typeAliases {
- if (_typeAliases == null) {
+ if (_typeAliases.isEmpty) {
return FunctionTypeAliasElementImpl.EMPTY_ARRAY;
}
- List<FunctionTypeAliasElement> result = new List.from(_typeAliases);
- _typeAliases = null;
- return result;
+ return new List.from(_typeAliases);
}
List<ClassElement> get types {
- if (_types == null) {
+ if (_types.isEmpty) {
return ClassElementImpl.EMPTY_ARRAY;
}
- List<ClassElement> result = new List.from(_types);
- _types = null;
- return result;
+ return new List.from(_types);
}
List<TypeVariableElement> get typeVariables {
- if (_typeVariables == null) {
+ if (_typeVariables.isEmpty) {
return TypeVariableElementImpl.EMPTY_ARRAY;
}
- List<TypeVariableElement> result = new List.from(_typeVariables);
- _typeVariables = null;
- return result;
- }
- void validate() {
- JavaStringBuilder builder = new JavaStringBuilder();
- if (_accessors != null) {
- builder.append(_accessors.length);
- builder.append(" accessors");
- }
- if (_constructors != null) {
- if (builder.length > 0) {
- builder.append("; ");
- }
- builder.append(_constructors.length);
- builder.append(" constructors");
- }
- if (_fields != null) {
- if (builder.length > 0) {
- builder.append("; ");
- }
- builder.append(_fields.length);
- builder.append(" fields");
- }
- if (_functions != null) {
- if (builder.length > 0) {
- builder.append("; ");
- }
- builder.append(_functions.length);
- builder.append(" functions");
- }
- if (_labels != null) {
- if (builder.length > 0) {
- builder.append("; ");
- }
- builder.append(_labels.length);
- builder.append(" labels");
- }
- if (_localVariables != null) {
- if (builder.length > 0) {
- builder.append("; ");
- }
- builder.append(_localVariables.length);
- builder.append(" local variables");
- }
- if (_methods != null) {
- if (builder.length > 0) {
- builder.append("; ");
- }
- builder.append(_methods.length);
- builder.append(" methods");
- }
- if (_parameters != null) {
- if (builder.length > 0) {
- builder.append("; ");
- }
- builder.append(_parameters.length);
- builder.append(" parameters");
- }
- if (_topLevelVariables != null) {
- if (builder.length > 0) {
- builder.append("; ");
- }
- builder.append(_topLevelVariables.length);
- builder.append(" top-level variables");
- }
- if (_types != null) {
- if (builder.length > 0) {
- builder.append("; ");
- }
- builder.append(_types.length);
- builder.append(" types");
- }
- if (_typeAliases != null) {
- if (builder.length > 0) {
- builder.append("; ");
- }
- builder.append(_typeAliases.length);
- builder.append(" type aliases");
- }
- if (_typeVariables != null) {
- if (builder.length > 0) {
- builder.append("; ");
- }
- builder.append(_typeVariables.length);
- builder.append(" type variables");
- }
- if (builder.length > 0) {
- AnalysisEngine.instance.logger.logError("Failed to capture elements: ${builder.toString()}");
- }
+ return new List.from(_typeVariables);
}
}
/**
- * Instances of the class `HtmlUnitBuilder` build an element model for a single HTML unit.
+ * Instances of the class {@code HtmlUnitBuilder} build an element model for a single HTML unit.
*/
class HtmlUnitBuilder implements ht.XmlVisitor<Object> {
static String _APPLICATION_DART_IN_DOUBLE_QUOTES = "\"application/dart\"";
@@ -1004,7 +818,7 @@
RecordingErrorListener _errorListener;
/**
- * The line information associated with the source for which an element is being built, or`null` if we are not building an element.
+ * The line information associated with the source for which an element is being built, or{@code null} if we are not building an element.
*/
LineInfo _lineInfo;
@@ -1163,7 +977,7 @@
}
/**
- * Return the first source attribute for the given tag node, or `null` if it does not exist.
+ * Return the first source attribute for the given tag node, or {@code null} if it does not exist.
* @param node the node containing attributes
* @return the source attribute contained in the given tag
*/
@@ -1178,8 +992,8 @@
/**
* Determine if the specified node is a Dart script.
- * @param node the node to be tested (not `null`)
- * @return `true` if the node is a Dart script
+ * @param node the node to be tested (not {@code null})
+ * @return {@code true} if the node is a Dart script
*/
bool isScriptNode(ht.XmlTagNode node) {
if (node.tagNodes.length != 0 || node.tag.lexeme != _SCRIPT) {
@@ -1212,7 +1026,7 @@
}
}
/**
- * Instances of the class `DeclarationResolver` are used to resolve declarations in an AST
+ * Instances of the class {@code DeclarationResolver} are used to resolve declarations in an AST
* structure to already built elements.
*/
class DeclarationResolver extends RecursiveASTVisitor<Object> {
@@ -1223,25 +1037,25 @@
CompilationUnitElement _enclosingUnit;
/**
- * The function type alias containing the AST nodes being visited, or `null` if we are not
+ * The function type alias containing the AST nodes being visited, or {@code null} if we are not
* in the scope of a function type alias.
*/
FunctionTypeAliasElement _enclosingAlias;
/**
- * The class containing the AST nodes being visited, or `null` if we are not in the scope of
+ * The class containing the AST nodes being visited, or {@code null} if we are not in the scope of
* a class.
*/
ClassElement _enclosingClass;
/**
- * The method or function containing the AST nodes being visited, or `null` if we are not in
+ * The method or function containing the AST nodes being visited, or {@code null} if we are not in
* the scope of a method or function.
*/
ExecutableElement _enclosingExecutable;
/**
- * The parameter containing the AST nodes being visited, or `null` if we are not in the
+ * The parameter containing the AST nodes being visited, or {@code null} if we are not in the
* scope of a parameter.
*/
ParameterElement _enclosingParameter;
@@ -1587,7 +1401,7 @@
}
/**
- * Return the element for the part with the given source, or `null` if there is no element
+ * Return the element for the part with the given source, or {@code null} if there is no element
* for the given source.
* @param parts the elements for the parts
* @param partSource the source for the part whose element is to be returned
@@ -1642,7 +1456,7 @@
}
/**
- * Return the export element from the given array whose library has the given source, or`null` if there is no such export.
+ * Return the export element from the given array whose library has the given source, or{@code null} if there is no such export.
* @param exports the export elements being searched
* @param source the source of the library associated with the export element to being searched
* for
@@ -1659,7 +1473,7 @@
/**
* Return the import element from the given array whose library has the given source and that has
- * the given prefix, or `null` if there is no such import.
+ * the given prefix, or {@code null} if there is no such import.
* @param imports the import elements being searched
* @param source the source of the library associated with the import element to being searched
* for
@@ -1685,7 +1499,7 @@
}
/**
- * Return the value of the given string literal, or `null` if the string is not a constant
+ * Return the value of the given string literal, or {@code null} if the string is not a constant
* string without any string interpolation.
* @param literal the string literal whose value is to be returned
* @return the value of the given string literal
@@ -1704,45 +1518,45 @@
}
}
/**
- * Instances of the class `ElementResolver` are used by instances of [ResolverVisitor]to resolve references within the AST structure to the elements being referenced. The requirements
+ * Instances of the class {@code ElementResolver} are used by instances of {@link ResolverVisitor}to resolve references within the AST structure to the elements being referenced. The requirements
* for the element resolver are:
* <ol>
- * * Every [SimpleIdentifier] should be resolved to the element to which it refers.
+ * <li>Every {@link SimpleIdentifier} should be resolved to the element to which it refers.
* Specifically:
- *
- * * An identifier within the declaration of that name should resolve to the element being
- * declared.
- * * An identifier denoting a prefix should resolve to the element representing the import that
- * defines the prefix (an [ImportElement]).
- * * An identifier denoting a variable should resolve to the element representing the variable (a[VariableElement]).
- * * An identifier denoting a parameter should resolve to the element representing the parameter
- * (a [ParameterElement]).
- * * An identifier denoting a field should resolve to the element representing the getter or
- * setter being invoked (a [PropertyAccessorElement]).
- * * An identifier denoting the name of a method or function being invoked should resolve to the
- * element representing the method or function (a [ExecutableElement]).
- * * An identifier denoting a label should resolve to the element representing the label (a[LabelElement]).
- *
- * The identifiers within directives are exceptions to this rule and are covered below.
- * * Every node containing a token representing an operator that can be overridden ([BinaryExpression], [PrefixExpression], [PostfixExpression]) should resolve to
- * the element representing the method invoked by that operator (a [MethodElement]).
- * * Every [FunctionExpressionInvocation] should resolve to the element representing the
- * function being invoked (a [FunctionElement]). This will be the same element as that to
+ * <ul>
+ * <li>An identifier within the declaration of that name should resolve to the element being
+ * declared.</li>
+ * <li>An identifier denoting a prefix should resolve to the element representing the import that
+ * defines the prefix (an {@link ImportElement}).</li>
+ * <li>An identifier denoting a variable should resolve to the element representing the variable (a{@link VariableElement}).</li>
+ * <li>An identifier denoting a parameter should resolve to the element representing the parameter
+ * (a {@link ParameterElement}).</li>
+ * <li>An identifier denoting a field should resolve to the element representing the getter or
+ * setter being invoked (a {@link PropertyAccessorElement}).</li>
+ * <li>An identifier denoting the name of a method or function being invoked should resolve to the
+ * element representing the method or function (a {@link ExecutableElement}).</li>
+ * <li>An identifier denoting a label should resolve to the element representing the label (a{@link LabelElement}).</li>
+ * </ul>
+ * The identifiers within directives are exceptions to this rule and are covered below.</li>
+ * <li>Every node containing a token representing an operator that can be overridden ({@link BinaryExpression}, {@link PrefixExpression}, {@link PostfixExpression}) should resolve to
+ * the element representing the method invoked by that operator (a {@link MethodElement}).</li>
+ * <li>Every {@link FunctionExpressionInvocation} should resolve to the element representing the
+ * function being invoked (a {@link FunctionElement}). This will be the same element as that to
* which the name is resolved if the function has a name, but is provided for those cases where an
- * unnamed function is being invoked.
- * * Every [LibraryDirective] and [PartOfDirective] should resolve to the element
- * representing the library being specified by the directive (a [LibraryElement]) unless, in
- * the case of a part-of directive, the specified library does not exist.
- * * Every [ImportDirective] and [ExportDirective] should resolve to the element
+ * unnamed function is being invoked.</li>
+ * <li>Every {@link LibraryDirective} and {@link PartOfDirective} should resolve to the element
+ * representing the library being specified by the directive (a {@link LibraryElement}) unless, in
+ * the case of a part-of directive, the specified library does not exist.</li>
+ * <li>Every {@link ImportDirective} and {@link ExportDirective} should resolve to the element
* representing the library being specified by the directive unless the specified library does not
- * exist (an [ImportElement] or [ExportElement]).
- * * The identifier representing the prefix in an [ImportDirective] should resolve to the
- * element representing the prefix (a [PrefixElement]).
- * * The identifiers in the hide and show combinators in [ImportDirective]s and[ExportDirective]s should resolve to the elements that are being hidden or shown,
+ * exist (an {@link ImportElement} or {@link ExportElement}).</li>
+ * <li>The identifier representing the prefix in an {@link ImportDirective} should resolve to the
+ * element representing the prefix (a {@link PrefixElement}).</li>
+ * <li>The identifiers in the hide and show combinators in {@link ImportDirective}s and{@link ExportDirective}s should resolve to the elements that are being hidden or shown,
* respectively, unless those names are not defined in the specified library (or the specified
- * library does not exist).
- * * Every [PartDirective] should resolve to the element representing the compilation unit
- * being specified by the string unless the specified compilation unit does not exist (a[CompilationUnitElement]).
+ * library does not exist).</li>
+ * <li>Every {@link PartDirective} should resolve to the element representing the compilation unit
+ * being specified by the string unless the specified compilation unit does not exist (a{@link CompilationUnitElement}).</li>
* </ol>
* Note that AST nodes that would represent elements that are not defined are not resolved to
* anything. This includes such things as references to undeclared variables (which is an error) and
@@ -1753,7 +1567,7 @@
class ElementResolver extends SimpleASTVisitor<Object> {
/**
- * @return `true` if the given identifier is the return type of a constructor declaration.
+ * @return {@code true} if the given identifier is the return type of a constructor declaration.
*/
static bool isConstructorReturnType(SimpleIdentifier node) {
ASTNode parent = node.parent;
@@ -1765,7 +1579,7 @@
}
/**
- * @return `true` if the given identifier is the return type of a factory constructor
+ * @return {@code true} if the given identifier is the return type of a factory constructor
* declaration.
*/
static bool isFactoryConstructorReturnType(SimpleIdentifier node) {
@@ -1780,7 +1594,7 @@
/**
* Checks if the given 'super' expression is used in the valid context.
* @param node the 'super' expression to analyze
- * @return `true` if the given 'super' expression is in the valid context
+ * @return {@code true} if the given 'super' expression is in the valid context
*/
static bool isSuperInValidContext(SuperExpression node) {
for (ASTNode n = node; n != null; n = n.parent) {
@@ -1796,7 +1610,7 @@
}
if (n is MethodDeclaration) {
MethodDeclaration method = n as MethodDeclaration;
- return !method.isStatic;
+ return !method.isStatic();
}
}
return false;
@@ -1846,7 +1660,7 @@
node.staticElement = staticMethod;
Type2 propagatedType = getPropagatedType(leftHandSide);
MethodElement propagatedMethod = lookUpMethod(leftHandSide, propagatedType, methodName);
- node.element = select2(staticMethod, propagatedMethod);
+ node.element = select3(staticMethod, propagatedMethod);
if (shouldReportMissingMember(staticType, staticMethod) && (_strictMode || propagatedType == null || shouldReportMissingMember(propagatedType, propagatedMethod))) {
_resolver.reportError6(StaticTypeWarningCode.UNDEFINED_METHOD, operator, [methodName, staticType.displayName]);
}
@@ -1856,7 +1670,7 @@
}
Object visitBinaryExpression(BinaryExpression node) {
sc.Token operator = node.operator;
- if (operator.isUserDefinableOperator) {
+ if (operator.isUserDefinableOperator()) {
Expression leftOperand = node.leftOperand;
if (leftOperand != null) {
String methodName = operator.lexeme;
@@ -1865,7 +1679,7 @@
node.staticElement = staticMethod;
Type2 propagatedType = getPropagatedType(leftOperand);
MethodElement propagatedMethod = lookUpMethod(leftOperand, propagatedType, methodName);
- node.element = select2(staticMethod, propagatedMethod);
+ node.element = select3(staticMethod, propagatedMethod);
if (shouldReportMissingMember(staticType, staticMethod) && (_strictMode || propagatedType == null || shouldReportMissingMember(propagatedType, propagatedMethod))) {
_resolver.reportError6(StaticTypeWarningCode.UNDEFINED_OPERATOR, operator, [methodName, staticType.displayName]);
}
@@ -1876,7 +1690,7 @@
Object visitBreakStatement(BreakStatement node) {
SimpleIdentifier labelNode = node.label;
LabelElementImpl labelElement = lookupLabel(node, labelNode);
- if (labelElement != null && labelElement.isOnSwitchMember) {
+ if (labelElement != null && labelElement.isOnSwitchMember()) {
_resolver.reportError(ResolverErrorCode.BREAK_LABEL_ON_SWITCH_MEMBER, labelNode, []);
}
return null;
@@ -1902,7 +1716,7 @@
}
if (element == null) {
} else {
- if (element.library == null || element.library != _resolver.definingLibrary) {
+ if (element.library != _resolver.definingLibrary) {
}
recordResolution(simpleIdentifier, element);
if (node.newKeyword != null) {
@@ -1989,21 +1803,21 @@
ClassElement enclosingClass = _resolver.enclosingClass;
FieldElement fieldElement = ((enclosingClass as ClassElementImpl)).getField(fieldName.name);
recordResolution(fieldName, fieldElement);
- if (fieldElement == null || fieldElement.isSynthetic) {
+ if (fieldElement == null || fieldElement.isSynthetic()) {
_resolver.reportError(CompileTimeErrorCode.INITIALIZER_FOR_NON_EXISTANT_FIELD, node, [fieldName]);
- } else if (fieldElement.isStatic) {
+ } else if (fieldElement.isStatic()) {
_resolver.reportError(CompileTimeErrorCode.INITIALIZER_FOR_STATIC_FIELD, node, [fieldName]);
}
return null;
}
Object visitConstructorName(ConstructorName node) {
Type2 type = node.type.type;
- if (type != null && type.isDynamic) {
+ if (type != null && type.isDynamic()) {
return null;
} else if (type is! InterfaceType) {
ASTNode parent = node.parent;
if (parent is InstanceCreationExpression) {
- if (((parent as InstanceCreationExpression)).isConst) {
+ if (((parent as InstanceCreationExpression)).isConst()) {
} else {
}
} else {
@@ -2028,7 +1842,7 @@
Object visitContinueStatement(ContinueStatement node) {
SimpleIdentifier labelNode = node.label;
LabelElementImpl labelElement = lookupLabel(node, labelNode);
- if (labelElement != null && labelElement.isOnSwitchStatement) {
+ if (labelElement != null && labelElement.isOnSwitchStatement()) {
_resolver.reportError(ResolverErrorCode.CONTINUE_LABEL_ON_SWITCH, labelNode, []);
}
return null;
@@ -2062,17 +1876,17 @@
if (node.type == null) {
fieldFormal.type = fieldType;
}
- if (fieldElement.isSynthetic) {
+ if (fieldElement.isSynthetic()) {
_resolver.reportError(CompileTimeErrorCode.INITIALIZING_FORMAL_FOR_NON_EXISTANT_FIELD, node, [fieldName]);
- } else if (fieldElement.isStatic) {
+ } else if (fieldElement.isStatic()) {
_resolver.reportError(CompileTimeErrorCode.INITIALIZING_FORMAL_FOR_STATIC_FIELD, node, [fieldName]);
} else if (declaredType != null && fieldType != null && !declaredType.isAssignableTo(fieldType)) {
_resolver.reportError(StaticWarningCode.FIELD_INITIALIZING_FORMAL_NOT_ASSIGNABLE, node, [declaredType.displayName, fieldType.displayName]);
}
} else {
- if (fieldElement.isSynthetic) {
+ if (fieldElement.isSynthetic()) {
_resolver.reportError(CompileTimeErrorCode.INITIALIZING_FORMAL_FOR_NON_EXISTANT_FIELD, node, [fieldName]);
- } else if (fieldElement.isStatic) {
+ } else if (fieldElement.isStatic()) {
_resolver.reportError(CompileTimeErrorCode.INITIALIZING_FORMAL_FOR_STATIC_FIELD, node, [fieldName]);
}
}
@@ -2133,7 +1947,7 @@
node.staticElement = invokedConstructor;
node.element = invokedConstructor;
ArgumentList argumentList = node.argumentList;
- List<ParameterElement> parameters = resolveArgumentsToParameters(node.isConst, argumentList, invokedConstructor);
+ List<ParameterElement> parameters = resolveArgumentsToParameters(node.isConst(), argumentList, invokedConstructor);
if (parameters != null) {
argumentList.correspondingStaticParameters = parameters;
}
@@ -2179,7 +1993,20 @@
argumentList.correspondingParameters = parameters;
}
}
- ErrorCode errorCode = checkForInvocationError(target, staticElement);
+ ErrorCode errorCode;
+ if (staticElement == null) {
+ if (propagatedElement == null) {
+ errorCode = checkForInvocationError(target, staticElement);
+ } else {
+ errorCode = checkForInvocationError(target, propagatedElement);
+ }
+ } else {
+ errorCode = checkForInvocationError(target, staticElement);
+ if (propagatedElement != null) {
+ ErrorCode propagatedError = checkForInvocationError(target, propagatedElement);
+ errorCode = select(errorCode, propagatedError);
+ }
+ }
if (identical(errorCode, StaticTypeWarningCode.INVOCATION_OF_NON_FUNCTION)) {
_resolver.reportError(StaticTypeWarningCode.INVOCATION_OF_NON_FUNCTION, methodName, [methodName.name]);
} else if (identical(errorCode, StaticTypeWarningCode.UNDEFINED_FUNCTION)) {
@@ -2223,7 +2050,7 @@
node.staticElement = staticMethod;
Type2 propagatedType = getPropagatedType(operand);
MethodElement propagatedMethod = lookUpMethod(operand, propagatedType, methodName);
- node.element = select2(staticMethod, propagatedMethod);
+ node.element = select3(staticMethod, propagatedMethod);
if (shouldReportMissingMember(staticType, staticMethod) && (_strictMode || propagatedType == null || shouldReportMissingMember(propagatedType, propagatedMethod))) {
_resolver.reportError6(StaticTypeWarningCode.UNDEFINED_OPERATOR, node.operator, [methodName, staticType.displayName]);
}
@@ -2256,7 +2083,7 @@
Object visitPrefixExpression(PrefixExpression node) {
sc.Token operator = node.operator;
sc.TokenType operatorType = operator.type;
- if (operatorType.isUserDefinableOperator || identical(operatorType, sc.TokenType.PLUS_PLUS) || identical(operatorType, sc.TokenType.MINUS_MINUS)) {
+ if (operatorType.isUserDefinableOperator() || identical(operatorType, sc.TokenType.PLUS_PLUS) || identical(operatorType, sc.TokenType.MINUS_MINUS)) {
Expression operand = node.operand;
String methodName = getPrefixOperator(node);
Type2 staticType = getStaticType(operand);
@@ -2264,7 +2091,7 @@
node.staticElement = staticMethod;
Type2 propagatedType = getPropagatedType(operand);
MethodElement propagatedMethod = lookUpMethod(operand, propagatedType, methodName);
- node.element = select2(staticMethod, propagatedMethod);
+ node.element = select3(staticMethod, propagatedMethod);
if (shouldReportMissingMember(staticType, staticMethod) && (_strictMode || propagatedType == null || shouldReportMissingMember(propagatedType, propagatedMethod))) {
_resolver.reportError6(StaticTypeWarningCode.UNDEFINED_OPERATOR, operator, [methodName, staticType.displayName]);
}
@@ -2348,7 +2175,7 @@
}
return null;
} else {
- if (element.isFactory) {
+ if (element.isFactory()) {
_resolver.reportError(CompileTimeErrorCode.NON_GENERATIVE_CONSTRUCTOR, node, [element]);
}
}
@@ -2403,8 +2230,8 @@
/**
* Given that we have found code to invoke the given element, return the error code that should be
- * reported, or `null` if no error should be reported.
- * @param target the target of the invocation, or `null` if there was no target
+ * reported, or {@code null} if no error should be reported.
+ * @param target the target of the invocation, or {@code null} if there was no target
* @param element the element to be invoked
* @return the error code that should be reported
*/
@@ -2455,7 +2282,7 @@
Type2 targetType = getStaticType(target);
if (targetType == null) {
return StaticTypeWarningCode.UNDEFINED_FUNCTION;
- } else if (!targetType.isDynamic && !classDeclaresNoSuchMethod2(targetType.element)) {
+ } else if (!targetType.isDynamic() && !classDeclaresNoSuchMethod2(targetType.element)) {
return StaticTypeWarningCode.UNDEFINED_METHOD;
}
}
@@ -2465,10 +2292,10 @@
}
/**
- * Return `true` if the given class declares a method named "noSuchMethod" and is not the
+ * Return {@code true} if the given class declares a method named "noSuchMethod" and is not the
* class 'Object'.
* @param element the class being tested
- * @return `true` if the given class declares a method named "noSuchMethod"
+ * @return {@code true} if the given class declares a method named "noSuchMethod"
*/
bool classDeclaresNoSuchMethod(ClassElement classElement) {
if (classElement == null) {
@@ -2479,10 +2306,10 @@
}
/**
- * Return `true` if the given element represents a class that declares a method named
+ * Return {@code true} if the given element represents a class that declares a method named
* "noSuchMethod" and is not the class 'Object'.
* @param element the element being tested
- * @return `true` if the given element represents a class that declares a method named
+ * @return {@code true} if the given element represents a class that declares a method named
* "noSuchMethod"
*/
bool classDeclaresNoSuchMethod2(Element element) {
@@ -2495,7 +2322,7 @@
/**
* Given a list of arguments and the element that will be invoked using those argument, compute
* the list of parameters that correspond to the list of arguments. Return the parameters that
- * correspond to the arguments, or `null` if no correspondence could be computed.
+ * correspond to the arguments, or {@code null} if no correspondence could be computed.
* @param argumentList the list of arguments being passed to the element
* @param executableElement the element that will be invoked with the arguments
* @return the parameters that correspond to the arguments
@@ -2552,7 +2379,7 @@
/**
* Look for any declarations of the given identifier that are imported using a prefix. Return the
- * element that was found, or `null` if the name is not imported using a prefix.
+ * element that was found, or {@code null} if the name is not imported using a prefix.
* @param identifier the identifier that might have been imported using a prefix
* @return the element that was found
*/
@@ -2646,13 +2473,13 @@
}
/**
- * Return `true` if the given type represents an object that could be invoked using the call
+ * Return {@code true} if the given type represents an object that could be invoked using the call
* operator '()'.
* @param type the type being tested
- * @return `true` if the given type represents an object that could be invoked
+ * @return {@code true} if the given type represents an object that could be invoked
*/
bool isExecutableType(Type2 type) {
- if (type.isDynamic || (type is FunctionType) || type.isDartCoreFunction) {
+ if (type.isDynamic() || (type is FunctionType) || type.isDartCoreFunction()) {
return true;
} else if (type is InterfaceType) {
ClassElement classElement = ((type as InterfaceType)).element;
@@ -2663,32 +2490,32 @@
}
/**
- * Return `true` if the given element is a static element.
+ * Return {@code true} if the given element is a static element.
* @param element the element being tested
- * @return `true` if the given element is a static element
+ * @return {@code true} if the given element is a static element
*/
bool isStatic(Element element) {
if (element is ExecutableElement) {
- return ((element as ExecutableElement)).isStatic;
+ return ((element as ExecutableElement)).isStatic();
} else if (element is PropertyInducingElement) {
- return ((element as PropertyInducingElement)).isStatic;
+ return ((element as PropertyInducingElement)).isStatic();
}
return false;
}
/**
- * Looks up the method element with the given name for index expression, reports[StaticWarningCode#UNDEFINED_OPERATOR] if not found.
+ * Looks up the method element with the given name for index expression, reports{@link StaticWarningCode#UNDEFINED_OPERATOR} if not found.
* @param node the index expression to resolve
* @param target the target of the expression
* @param methodName the name of the operator associated with the context of using of the given
* index expression
- * @return `true` if and only if an error code is generated on the passed node
+ * @return {@code true} if and only if an error code is generated on the passed node
*/
bool lookUpCheckIndexOperator(IndexExpression node, Expression target, String methodName, Type2 staticType, Type2 propagatedType) {
MethodElement staticMethod = lookUpMethod(target, staticType, methodName);
MethodElement propagatedMethod = lookUpMethod(target, propagatedType, methodName);
node.staticElement = staticMethod;
- node.element = select2(staticMethod, propagatedMethod);
+ node.element = select3(staticMethod, propagatedMethod);
if (shouldReportMissingMember(staticType, staticMethod) && (_strictMode || propagatedType == null || shouldReportMissingMember(propagatedType, propagatedMethod))) {
sc.Token leftBracket = node.leftBracket;
sc.Token rightBracket = node.rightBracket;
@@ -2707,8 +2534,8 @@
/**
* Look up the getter with the given name in the given type. Return the element representing the
- * getter that was found, or `null` if there is no getter with the given name.
- * @param target the target of the invocation, or `null` if there is no target
+ * getter that was found, or {@code null} if there is no getter with the given name.
+ * @param target the target of the invocation, or {@code null} if there is no target
* @param type the type in which the getter is defined
* @param getterName the name of the getter being looked up
* @return the element representing the getter that was found
@@ -2733,9 +2560,9 @@
/**
* Look up the getter with the given name in the interfaces implemented by the given type, either
- * directly or indirectly. Return the element representing the getter that was found, or`null` if there is no getter with the given name.
+ * directly or indirectly. Return the element representing the getter that was found, or{@code null} if there is no getter with the given name.
* @param targetType the type in which the getter might be defined
- * @param includeTargetType `true` if the search should include the target type
+ * @param includeTargetType {@code true} if the search should include the target type
* @param getterName the name of the getter being looked up
* @param visitedInterfaces a set containing all of the interfaces that have been examined, used
* to prevent infinite recursion and to optimize the search
@@ -2774,7 +2601,7 @@
/**
* Look up the method or getter with the given name in the given type. Return the element
- * representing the method or getter that was found, or `null` if there is no method or
+ * representing the method or getter that was found, or {@code null} if there is no method or
* getter with the given name.
* @param type the type in which the method or getter is defined
* @param memberName the name of the method or getter being looked up
@@ -2800,9 +2627,9 @@
/**
* Look up the method or getter with the given name in the interfaces implemented by the given
* type, either directly or indirectly. Return the element representing the method or getter that
- * was found, or `null` if there is no method or getter with the given name.
+ * was found, or {@code null} if there is no method or getter with the given name.
* @param targetType the type in which the method or getter might be defined
- * @param includeTargetType `true` if the search should include the target type
+ * @param includeTargetType {@code true} if the search should include the target type
* @param memberName the name of the method or getter being looked up
* @param visitedInterfaces a set containing all of the interfaces that have been examined, used
* to prevent infinite recursion and to optimize the search
@@ -2884,8 +2711,8 @@
/**
* Look up the method with the given name in the given type. Return the element representing the
- * method that was found, or `null` if there is no method with the given name.
- * @param target the target of the invocation, or `null` if there is no target
+ * method that was found, or {@code null} if there is no method with the given name.
+ * @param target the target of the invocation, or {@code null} if there is no target
* @param type the type in which the method is defined
* @param methodName the name of the method being looked up
* @return the element representing the method that was found
@@ -2910,9 +2737,9 @@
/**
* Look up the method with the given name in the interfaces implemented by the given type, either
- * directly or indirectly. Return the element representing the method that was found, or`null` if there is no method with the given name.
+ * directly or indirectly. Return the element representing the method that was found, or{@code null} if there is no method with the given name.
* @param targetType the type in which the member might be defined
- * @param includeTargetType `true` if the search should include the target type
+ * @param includeTargetType {@code true} if the search should include the target type
* @param methodName the name of the method being looked up
* @param visitedInterfaces a set containing all of the interfaces that have been examined, used
* to prevent infinite recursion and to optimize the search
@@ -2951,8 +2778,8 @@
/**
* Look up the setter with the given name in the given type. Return the element representing the
- * setter that was found, or `null` if there is no setter with the given name.
- * @param target the target of the invocation, or `null` if there is no target
+ * setter that was found, or {@code null} if there is no setter with the given name.
+ * @param target the target of the invocation, or {@code null} if there is no target
* @param type the type in which the setter is defined
* @param setterName the name of the setter being looked up
* @return the element representing the setter that was found
@@ -2977,9 +2804,9 @@
/**
* Look up the setter with the given name in the interfaces implemented by the given type, either
- * directly or indirectly. Return the element representing the setter that was found, or`null` if there is no setter with the given name.
+ * directly or indirectly. Return the element representing the setter that was found, or{@code null} if there is no setter with the given name.
* @param targetType the type in which the setter might be defined
- * @param includeTargetType `true` if the search should include the target type
+ * @param includeTargetType {@code true} if the search should include the target type
* @param setterName the name of the setter being looked up
* @param visitedInterfaces a set containing all of the interfaces that have been examined, used
* to prevent infinite recursion and to optimize the search
@@ -3079,8 +2906,8 @@
/**
* Given a list of arguments and the element that will be invoked using those argument, compute
* the list of parameters that correspond to the list of arguments. Return the parameters that
- * correspond to the arguments, or `null` if no correspondence could be computed.
- * @param reportError if `true` then compile-time error should be reported; if `false`then compile-time warning
+ * correspond to the arguments, or {@code null} if no correspondence could be computed.
+ * @param reportError if {@code true} then compile-time error should be reported; if {@code false}then compile-time warning
* @param argumentList the list of arguments being passed to the element
* @param executableElement the element that will be invoked with the arguments
* @return the parameters that correspond to the arguments
@@ -3097,7 +2924,7 @@
* Given a list of arguments and the parameters related to the element that will be invoked using
* those argument, compute the list of parameters that correspond to the list of arguments. Return
* the parameters that correspond to the arguments.
- * @param reportError if `true` then compile-time error should be reported; if `false`then compile-time warning
+ * @param reportError if {@code true} then compile-time error should be reported; if {@code false}then compile-time warning
* @param argumentList the list of arguments being passed to the element
* @param parameters the of the function that will be invoked with the arguments
* @return the parameters that correspond to the arguments
@@ -3266,7 +3093,7 @@
propertyName.staticElement = staticElement;
Type2 propagatedType = getPropagatedType(target);
ExecutableElement propagatedElement = resolveProperty(target, propagatedType, propertyName);
- Element selectedElement = select(staticElement, propagatedElement);
+ Element selectedElement = select2(staticElement, propagatedElement);
propertyName.element = selectedElement;
if (shouldReportMissingMember(staticType, staticElement) && (_strictMode || propagatedType == null || shouldReportMissingMember(propagatedType, propagatedElement))) {
bool staticNoSuchMethod = staticType != null && classDeclaresNoSuchMethod2(staticType.element);
@@ -3294,7 +3121,7 @@
/**
* Resolve the given simple identifier if possible. Return the element to which it could be
- * resolved, or `null` if it could not be resolved. This does not record the results of the
+ * resolved, or {@code null} if it could not be resolved. This does not record the results of the
* resolution.
* @param node the identifier to be resolved
* @return the element to which the identifier could be resolved
@@ -3353,20 +3180,35 @@
}
/**
- * Return the propagated element if it is not `null`, or the static element if it is.
+ * Given two possible error codes for the same piece of code, one computed using static type
+ * information and the other using propagated type information, return the error code that should
+ * be reported, or {@code null} if no error should be reported.
+ * @param staticError the error code computed using static type information
+ * @param propagatedError the error code computed using propagated type information
+ * @return the error code that should be reported
+ */
+ ErrorCode select(ErrorCode staticError, ErrorCode propagatedError) {
+ if (staticError == null || propagatedError == null) {
+ return null;
+ }
+ return propagatedError;
+ }
+
+ /**
+ * Return the propagated element if it is not {@code null}, or the static element if it is.
* @param staticElement the element computed using static type information
* @param propagatedElement the element computed using propagated type information
* @return the more specific of the two elements
*/
- ExecutableElement select(ExecutableElement staticElement, ExecutableElement propagatedElement) => propagatedElement != null ? propagatedElement : staticElement;
+ ExecutableElement select2(ExecutableElement staticElement, ExecutableElement propagatedElement) => propagatedElement != null ? propagatedElement : staticElement;
/**
- * Return the propagated method if it is not `null`, or the static method if it is.
+ * Return the propagated method if it is not {@code null}, or the static method if it is.
* @param staticMethod the method computed using static type information
* @param propagatedMethod the method computed using propagated type information
* @return the more specific of the two methods
*/
- MethodElement select2(MethodElement staticMethod, MethodElement propagatedMethod) => propagatedMethod != null ? propagatedMethod : staticMethod;
+ MethodElement select3(MethodElement staticMethod, MethodElement propagatedMethod) => propagatedMethod != null ? propagatedMethod : staticMethod;
/**
* Given a node that can have annotations associated with it and the element to which that node
@@ -3398,14 +3240,14 @@
}
/**
- * Return `true` if we should report an error as a result of looking up a member in the
+ * Return {@code true} if we should report an error as a result of looking up a member in the
* given type and not finding any member.
* @param type the type in which we attempted to perform the look-up
* @param member the result of the look-up
- * @return `true` if we should report an error
+ * @return {@code true} if we should report an error
*/
bool shouldReportMissingMember(Type2 type, ExecutableElement member) {
- if (member != null || type == null || type.isDynamic) {
+ if (member != null || type == null || type.isDynamic()) {
return false;
}
if (type is InterfaceType) {
@@ -3415,7 +3257,7 @@
}
}
/**
- * Instances of the class `SyntheticIdentifier` implement an identifier that can be used to
+ * Instances of the class {@code SyntheticIdentifier} implement an identifier that can be used to
* look up names in the lexical scope when there is no identifier in the AST structure. There is
* no identifier in the AST when the parser could not distinguish between a method invocation and
* an invocation of a top-level function imported with a prefix.
@@ -3444,31 +3286,31 @@
}
}
/**
- * Instances of the class `InheritanceManager` manage the knowledge of where class members
+ * Instances of the class {@code InheritanceManager} manage the knowledge of where class members
* (methods, getters & setters) are inherited from.
* @coverage dart.engine.resolver
*/
class InheritanceManager {
/**
- * The [LibraryElement] that is managed by this manager.
+ * The {@link LibraryElement} that is managed by this manager.
*/
LibraryElement _library;
/**
- * This is a mapping between each [ClassElement] and a map between the [String] member
- * names and the associated [ExecutableElement] in the mixin and superclass chain.
+ * This is a mapping between each {@link ClassElement} and a map between the {@link String} member
+ * names and the associated {@link ExecutableElement} in the mixin and superclass chain.
*/
Map<ClassElement, Map<String, ExecutableElement>> _classLookup;
/**
- * This is a mapping between each [ClassElement] and a map between the [String] member
- * names and the associated [ExecutableElement] in the interface set.
+ * This is a mapping between each {@link ClassElement} and a map between the {@link String} member
+ * names and the associated {@link ExecutableElement} in the interface set.
*/
Map<ClassElement, Map<String, ExecutableElement>> _interfaceLookup;
/**
- * A map between each visited [ClassElement] and the set of [AnalysisError]s found on
+ * A map between each visited {@link ClassElement} and the set of {@link AnalysisError}s found on
* the class element.
*/
Map<ClassElement, Set<AnalysisError>> _errorsInClassElement = new Map<ClassElement, Set<AnalysisError>>();
@@ -3484,35 +3326,35 @@
}
/**
- * Return the set of [AnalysisError]s found on the passed [ClassElement], or`null` if there are none.
+ * Return the set of {@link AnalysisError}s found on the passed {@link ClassElement}, or{@code null} if there are none.
* @param classElt the class element to query
- * @return the set of [AnalysisError]s found on the passed [ClassElement], or`null` if there are none
+ * @return the set of {@link AnalysisError}s found on the passed {@link ClassElement}, or{@code null} if there are none
*/
Set<AnalysisError> getErrors(ClassElement classElt) => _errorsInClassElement[classElt];
/**
* Get and return a mapping between the set of all string names of the members inherited from the
- * passed [ClassElement] superclass hierarchy, and the associated [ExecutableElement].
+ * passed {@link ClassElement} superclass hierarchy, and the associated {@link ExecutableElement}.
* @param classElt the class element to query
- * @return a mapping between the set of all members inherited from the passed [ClassElement]superclass hierarchy, and the associated [ExecutableElement]
+ * @return a mapping between the set of all members inherited from the passed {@link ClassElement}superclass hierarchy, and the associated {@link ExecutableElement}
*/
Map<String, ExecutableElement> getMapOfMembersInheritedFromClasses(ClassElement classElt) => computeClassChainLookupMap(classElt, new Set<ClassElement>());
/**
* Get and return a mapping between the set of all string names of the members inherited from the
- * passed [ClassElement] interface hierarchy, and the associated [ExecutableElement].
+ * passed {@link ClassElement} interface hierarchy, and the associated {@link ExecutableElement}.
* @param classElt the class element to query
- * @return a mapping between the set of all string names of the members inherited from the passed[ClassElement] interface hierarchy, and the associated [ExecutableElement].
+ * @return a mapping between the set of all string names of the members inherited from the passed{@link ClassElement} interface hierarchy, and the associated {@link ExecutableElement}.
*/
Map<String, ExecutableElement> getMapOfMembersInheritedFromInterfaces(ClassElement classElt) => computeInterfaceLookupMap(classElt, new Set<ClassElement>());
/**
- * Given some [ClassElement class element] and some member name, this returns the[ExecutableElement executable element] that the class inherits from the mixins,
- * superclasses or interfaces, that has the member name, if no member is inherited `null` is
+ * Given some {@link ClassElement class element} and some member name, this returns the{@link ExecutableElement executable element} that the class inherits from the mixins,
+ * superclasses or interfaces, that has the member name, if no member is inherited {@code null} is
* returned.
* @param classElt the class element to query
* @param memberName the name of the executable element to find and return
- * @return the inherited executable element with the member name, or `null` if no such
+ * @return the inherited executable element with the member name, or {@code null} if no such
* member exists
*/
ExecutableElement lookupInheritance(ClassElement classElt, String memberName) {
@@ -3527,11 +3369,11 @@
}
/**
- * Given some [ClassElement class element] and some member name, this returns the[ExecutableElement executable element] that the class either declares itself, or
- * inherits, that has the member name, if no member is inherited `null` is returned.
+ * Given some {@link ClassElement class element} and some member name, this returns the{@link ExecutableElement executable element} that the class either declares itself, or
+ * inherits, that has the member name, if no member is inherited {@code null} is returned.
* @param classElt the class element to query
* @param memberName the name of the executable element to find and return
- * @return the inherited executable element with the member name, or `null` if no such
+ * @return the inherited executable element with the member name, or {@code null} if no such
* member exists
*/
ExecutableElement lookupMember(ClassElement classElt, String memberName) {
@@ -3551,7 +3393,7 @@
}
/**
- * This method takes some inherited [FunctionType], and resolves all the parameterized types
+ * This method takes some inherited {@link FunctionType}, and resolves all the parameterized types
* in the function type, dependent on the class in which it is being overridden.
* @param baseFunctionType the function type that is being overridden
* @param memberName the name of the member, this is used to lookup the inheritance path of the
@@ -3571,9 +3413,9 @@
FunctionType functionTypeToReturn = baseFunctionType;
InterfaceType lastType = inheritancePath.removeLast();
while (inheritancePath.length > 0) {
- List<Type2> parameterTypes = lastType.element.type.typeArguments;
- List<Type2> argumentTypes = lastType.typeArguments;
- functionTypeToReturn = functionTypeToReturn.substitute2(argumentTypes, parameterTypes);
+ List<Type2> paramTypes = TypeVariableTypeImpl.getTypes(lastType.element.typeVariables);
+ List<Type2> argTypes = lastType.typeArguments;
+ functionTypeToReturn = functionTypeToReturn.substitute2(argTypes, paramTypes);
lastType = inheritancePath.removeLast();
}
return functionTypeToReturn;
@@ -3581,11 +3423,11 @@
/**
* Compute and return a mapping between the set of all string names of the members inherited from
- * the passed [ClassElement] superclass hierarchy, and the associated[ExecutableElement].
+ * the passed {@link ClassElement} superclass hierarchy, and the associated{@link ExecutableElement}.
* @param classElt the class element to query
* @param visitedClasses a set of visited classes passed back into this method when it calls
* itself recursively
- * @return a mapping between the set of all string names of the members inherited from the passed[ClassElement] superclass hierarchy, and the associated [ExecutableElement]
+ * @return a mapping between the set of all string names of the members inherited from the passed{@link ClassElement} superclass hierarchy, and the associated {@link ExecutableElement}
*/
Map<String, ExecutableElement> computeClassChainLookupMap(ClassElement classElt, Set<ClassElement> visitedClasses) {
Map<String, ExecutableElement> resultMap = _classLookup[classElt];
@@ -3627,7 +3469,7 @@
* Compute and return the inheritance path given the context of a type and a member that is
* overridden in the inheritance path (for which the type is in the path).
* @param chain the inheritance path that is built up as this method calls itself recursively,
- * when this method is called an empty [LinkedList] should be provided
+ * when this method is called an empty {@link LinkedList} should be provided
* @param currentType the current type in the inheritance path
* @param memberName the name of the member that is being looked up the inheritance path
*/
@@ -3671,11 +3513,11 @@
/**
* Compute and return a mapping between the set of all string names of the members inherited from
- * the passed [ClassElement] interface hierarchy, and the associated[ExecutableElement].
+ * the passed {@link ClassElement} interface hierarchy, and the associated{@link ExecutableElement}.
* @param classElt the class element to query
* @param visitedInterfaces a set of visited classes passed back into this method when it calls
* itself recursively
- * @return a mapping between the set of all string names of the members inherited from the passed[ClassElement] interface hierarchy, and the associated [ExecutableElement]
+ * @return a mapping between the set of all string names of the members inherited from the passed{@link ClassElement} interface hierarchy, and the associated {@link ExecutableElement}
*/
Map<String, ExecutableElement> computeInterfaceLookupMap(ClassElement classElt, Set<ClassElement> visitedInterfaces) {
Map<String, ExecutableElement> resultMap = _interfaceLookup[classElt];
@@ -3687,7 +3529,7 @@
InterfaceType supertype = classElt.supertype;
ClassElement superclassElement = supertype != null ? supertype.element : null;
List<InterfaceType> interfaces = classElt.interfaces;
- if ((superclassElement == null || supertype.isObject) && interfaces.length == 0) {
+ if (superclassElement == null || interfaces.length == 0) {
_interfaceLookup[classElt] = resultMap;
return resultMap;
}
@@ -3751,7 +3593,7 @@
if (superclassElement != null) {
List<MethodElement> methods = superclassElement.methods;
for (MethodElement method in methods) {
- if (method.isAccessibleIn(_library) && !method.isStatic) {
+ if (method.isAccessibleIn(_library) && !method.isStatic()) {
String key = method.name;
if (!unionMap.containsKey(key)) {
Set<ExecutableElement> set = new Set<ExecutableElement>();
@@ -3764,7 +3606,7 @@
}
List<PropertyAccessorElement> accessors = superclassElement.accessors;
for (PropertyAccessorElement accessor in accessors) {
- if (accessor.isAccessibleIn(_library) && !accessor.isStatic) {
+ if (accessor.isAccessibleIn(_library) && !accessor.isStatic()) {
String key = accessor.name;
if (!unionMap.containsKey(key)) {
Set<ExecutableElement> set = new Set<ExecutableElement>();
@@ -3781,7 +3623,7 @@
if (interfaceElement != null) {
List<MethodElement> methods = interfaceElement.methods;
for (MethodElement method in methods) {
- if (method.isAccessibleIn(_library) && !method.isStatic) {
+ if (method.isAccessibleIn(_library) && !method.isStatic()) {
String key = method.name;
if (!unionMap.containsKey(key)) {
Set<ExecutableElement> set = new Set<ExecutableElement>();
@@ -3794,7 +3636,7 @@
}
List<PropertyAccessorElement> accessors = interfaceElement.accessors;
for (PropertyAccessorElement accessor in accessors) {
- if (accessor.isAccessibleIn(_library) && !accessor.isStatic) {
+ if (accessor.isAccessibleIn(_library) && !accessor.isStatic()) {
String key = accessor.name;
if (!unionMap.containsKey(key)) {
Set<ExecutableElement> set = new Set<ExecutableElement>();
@@ -3820,7 +3662,7 @@
for (ExecutableElement executableElement in set) {
if (executableElement is PropertyAccessorElement) {
allMethods = false;
- if (((executableElement as PropertyAccessorElement)).isSetter) {
+ if (((executableElement as PropertyAccessorElement)).isSetter()) {
allGetters = false;
} else {
allSetters = false;
@@ -3873,23 +3715,23 @@
}
/**
- * Given some [ClassElement], this method finds and returns the [ExecutableElement] of
+ * Given some {@link ClassElement}, this method finds and returns the {@link ExecutableElement} of
* the passed name in the class element. Static members, members in super types and members not
* accessible from the current library are not considered.
* @param classElt the class element to query
* @param memberName the name of the member to lookup in the class
- * @return the found [ExecutableElement], or `null` if no such member was found
+ * @return the found {@link ExecutableElement}, or {@code null} if no such member was found
*/
ExecutableElement lookupMemberInClass(ClassElement classElt, String memberName) {
List<MethodElement> methods = classElt.methods;
for (MethodElement method in methods) {
- if (memberName == method.name && method.isAccessibleIn(_library) && !method.isStatic) {
+ if (memberName == method.name && method.isAccessibleIn(_library) && !method.isStatic()) {
return method;
}
}
List<PropertyAccessorElement> accessors = classElt.accessors;
for (PropertyAccessorElement accessor in accessors) {
- if (memberName == accessor.name && accessor.isAccessibleIn(_library) && !accessor.isStatic) {
+ if (memberName == accessor.name && accessor.isAccessibleIn(_library) && !accessor.isStatic()) {
return accessor;
}
}
@@ -3899,19 +3741,19 @@
/**
* Record the passed map with the set of all members (methods, getters and setters) in the class
* into the passed map.
- * @param map some non-`null`
+ * @param map some non-{@code null}
* @param classElt the class element that will be recorded into the passed map
*/
void recordMapWithClassMembers(Map<String, ExecutableElement> map, ClassElement classElt) {
List<MethodElement> methods = classElt.methods;
for (MethodElement method in methods) {
- if (method.isAccessibleIn(_library) && !method.isStatic) {
+ if (method.isAccessibleIn(_library) && !method.isStatic()) {
map[method.name] = method;
}
}
List<PropertyAccessorElement> accessors = classElt.accessors;
for (PropertyAccessorElement accessor in accessors) {
- if (accessor.isAccessibleIn(_library) && !accessor.isStatic) {
+ if (accessor.isAccessibleIn(_library) && !accessor.isStatic()) {
map[accessor.name] = accessor;
}
}
@@ -3919,7 +3761,7 @@
/**
* This method is used to report errors on when they are found computing inheritance information.
- * See [ErrorVerifier#checkForInconsistentMethodInheritance] to see where these generated
+ * See {@link ErrorVerifier#checkForInconsistentMethodInheritance()} to see where these generated
* error codes are reported back into the analysis engine.
* @param classElt the location of the source for which the exception occurred
* @param offset the offset of the location of the error
@@ -3937,7 +3779,7 @@
}
}
/**
- * Instances of the class `Library` represent the data about a single library during the
+ * Instances of the class {@code Library} represent the data about a single library during the
* resolution of some (possibly different) library. They are not intended to be used except during
* the resolution process.
* @coverage dart.engine.resolver
@@ -4060,8 +3902,8 @@
CompilationUnit get definingCompilationUnit => getAST(librarySource);
/**
- * Return `true` if this library explicitly imports core.
- * @return `true` if this library explicitly imports core
+ * Return {@code true} if this library explicitly imports core.
+ * @return {@code true} if this library explicitly imports core
*/
bool get explicitlyImportsCore => _explicitlyImportsCore;
@@ -4156,7 +3998,7 @@
/**
* Return the result of resolving the URI of the given URI-based directive against the URI of the
- * library, or `null` if the URI is not valid. If the URI is not valid, report the error.
+ * library, or {@code null} if the URI is not valid. If the URI is not valid, report the error.
* @param directive the directive which URI should be resolved
* @return the result of resolving the URI against the URI of the library
*/
@@ -4197,7 +4039,7 @@
/**
* Set whether this library explicitly imports core to match the given value.
- * @param explicitlyImportsCore `true` if this library explicitly imports core
+ * @param explicitlyImportsCore {@code true} if this library explicitly imports core
*/
void set explicitlyImportsCore(bool explicitlyImportsCore2) {
this._explicitlyImportsCore = explicitlyImportsCore2;
@@ -4216,7 +4058,7 @@
String toString() => _librarySource.shortName;
/**
- * Return the result of resolving the given URI against the URI of the library, or `null` if
+ * Return the result of resolving the given URI against the URI of the library, or {@code null} if
* the URI is not valid.
* @param uri the URI to be resolved
* @return the result of resolving the given URI against the URI of the library
@@ -4229,7 +4071,7 @@
}
}
/**
- * Instances of the class `LibraryElementBuilder` build an element model for a single library.
+ * Instances of the class {@code LibraryElementBuilder} build an element model for a single library.
* @coverage dart.engine.resolver
*/
class LibraryElementBuilder {
@@ -4333,12 +4175,12 @@
*/
void collectAccessors(Map<String, PropertyAccessorElement> getters, List<PropertyAccessorElement> setters, CompilationUnitElement unit) {
for (PropertyAccessorElement accessor in unit.accessors) {
- if (accessor.isGetter) {
- if (!accessor.isSynthetic && accessor.correspondingSetter == null) {
+ if (accessor.isGetter()) {
+ if (!accessor.isSynthetic() && accessor.correspondingSetter == null) {
getters[accessor.displayName] = accessor;
}
} else {
- if (!accessor.isSynthetic && accessor.correspondingGetter == null) {
+ if (!accessor.isSynthetic() && accessor.correspondingGetter == null) {
setters.add(accessor);
}
}
@@ -4348,7 +4190,7 @@
/**
* Search the top-level functions defined in the given compilation unit for the entry point.
* @param element the compilation unit to be searched
- * @return the entry point that was found, or `null` if the compilation unit does not define
+ * @return the entry point that was found, or {@code null} if the compilation unit does not define
* an entry point
*/
FunctionElement findEntryPoint(CompilationUnitElementImpl element) {
@@ -4361,7 +4203,7 @@
}
/**
- * Return the name of the library that the given part is declared to be a part of, or `null`if the part does not contain a part-of directive.
+ * Return the name of the library that the given part is declared to be a part of, or {@code null}if the part does not contain a part-of directive.
* @param library the library containing the part
* @param partSource the source representing the part
* @param directivesToResolve a list of directives that should be resolved to the library being
@@ -4409,7 +4251,7 @@
}
}
/**
- * Instances of the class `LibraryResolver` are used to resolve one or more mutually dependent
+ * Instances of the class {@code LibraryResolver} are used to resolve one or more mutually dependent
* libraries within a single context.
* @coverage dart.engine.resolver
*/
@@ -4422,7 +4264,7 @@
/**
* The listener to which analysis errors will be reported, this error listener is either
- * references [recordingErrorListener], or it unions the passed[AnalysisErrorListener] with the [recordingErrorListener].
+ * references {@link #recordingErrorListener}, or it unions the passed{@link AnalysisErrorListener} with the {@link #recordingErrorListener}.
*/
RecordingErrorListener _errorListener;
@@ -4485,7 +4327,7 @@
* @param librarySource the source specifying the defining compilation unit of the library to be
* resolved
* @param unit the compilation unit representing the embedded library
- * @param fullAnalysis `true` if a full analysis should be performed
+ * @param fullAnalysis {@code true} if a full analysis should be performed
* @return the element representing the resolved library
* @throws AnalysisException if the library could not be resolved for some reason
*/
@@ -4529,13 +4371,13 @@
/**
* Resolve the library specified by the given source in the given context.
- *
+ * <p>
* Note that because Dart allows circular imports between libraries, it is possible that more than
* one library will need to be resolved. In such cases the error listener can receive errors from
* multiple libraries.
* @param librarySource the source specifying the defining compilation unit of the library to be
* resolved
- * @param fullAnalysis `true` if a full analysis should be performed
+ * @param fullAnalysis {@code true} if a full analysis should be performed
* @return the element representing the resolved library
* @throws AnalysisException if the library could not be resolved for some reason
*/
@@ -4658,7 +4500,7 @@
}
/**
- * Every library now has a corresponding [LibraryElement], so it is now possible to resolve
+ * Every library now has a corresponding {@link LibraryElement}, so it is now possible to resolve
* the import and export directives.
* @throws AnalysisException if the defining compilation unit for any of the libraries could not
* be accessed
@@ -4752,7 +4594,7 @@
* Compute a dependency map of libraries reachable from the given library. A dependency map is a
* table that maps individual libraries to a list of the libraries that either import or export
* those libraries.
- *
+ * <p>
* This map is used to compute all of the libraries involved in a cycle that include the root
* library. Given that we only add libraries that are reachable from the root library, when we
* work backward we are guaranteed to only get libraries in the cycle.
@@ -4780,7 +4622,7 @@
/**
* Recursively traverse the libraries reachable from the given library, creating instances of the
- * class [Library] to represent them, and record the references in the library objects.
+ * class {@link Library} to represent them, and record the references in the library objects.
* @param library the library to be processed to find libraries that have not yet been traversed
* @throws AnalysisException if some portion of the library graph could not be traversed
*/
@@ -4873,7 +4715,7 @@
/**
* Create an object to represent the information about the library defined by the compilation unit
- * with the given source. Return the library object that was created, or `null` if the
+ * with the given source. Return the library object that was created, or {@code null} if the
* source is not valid.
* @param librarySource the source of the library's defining compilation unit
* @return the library object that was created
@@ -4893,9 +4735,9 @@
}
/**
- * Return `true` if and only if the passed [CompilationUnit] has a part-of directive.
- * @param node the [CompilationUnit] to test
- * @return `true` if and only if the passed [CompilationUnit] has a part-of directive
+ * Return {@code true} if and only if the passed {@link CompilationUnit} has a part-of directive.
+ * @param node the {@link CompilationUnit} to test
+ * @return {@code true} if and only if the passed {@link CompilationUnit} has a part-of directive
*/
bool doesCompilationUnitHavePartOfDirective(CompilationUnit node) {
NodeList<Directive> directives = node.directives;
@@ -4966,7 +4808,7 @@
}
/**
- * Run additional analyses, such as the [ConstantVerifier] and [ErrorVerifier]analysis in the current cycle.
+ * Run additional analyses, such as the {@link ConstantVerifier} and {@link ErrorVerifier}analysis in the current cycle.
* @throws AnalysisException if any of the identifiers could not be resolved or if the types in
* the library cannot be analyzed
*/
@@ -4977,7 +4819,7 @@
}
/**
- * Run additional analyses, such as the [ConstantVerifier] and [ErrorVerifier]analysis in the given library.
+ * Run additional analyses, such as the {@link ConstantVerifier} and {@link ErrorVerifier}analysis in the given library.
* @param library the library to have the extra analyses processes run
* @throws AnalysisException if any of the identifiers could not be resolved or if the types in
* the library cannot be analyzed
@@ -4986,15 +4828,16 @@
for (Source source in library.compilationUnitSources) {
ErrorReporter errorReporter = new ErrorReporter(_errorListener, source);
CompilationUnit unit = library.getAST(source);
- ConstantVerifier constantVerifier = new ConstantVerifier(errorReporter, _typeProvider);
- unit.accept(constantVerifier);
ErrorVerifier errorVerifier = new ErrorVerifier(errorReporter, library.libraryElement, _typeProvider, library.inheritanceManager);
unit.accept(errorVerifier);
+ unit.accept(new PubVerifier(_analysisContext, errorReporter));
+ ConstantVerifier constantVerifier = new ConstantVerifier(errorReporter, _typeProvider);
+ unit.accept(constantVerifier);
}
}
}
/**
- * Instances of the class `ResolverVisitor` are used to resolve the nodes within a single
+ * Instances of the class {@code ResolverVisitor} are used to resolve the nodes within a single
* compilation unit.
* @coverage dart.engine.resolver
*/
@@ -5011,13 +4854,13 @@
StaticTypeAnalyzer _typeAnalyzer;
/**
- * The class element representing the class containing the current node, or `null` if the
+ * The class element representing the class containing the current node, or {@code null} if the
* current node is not contained in a class.
*/
ClassElement _enclosingClass = null;
/**
- * The element representing the function containing the current node, or `null` if the
+ * The element representing the function containing the current node, or {@code null} if the
* current node is not contained in a function.
*/
ExecutableElement _enclosingFunction = null;
@@ -5034,9 +4877,9 @@
* @param typeProvider the object used to access the types from the core library
*/
ResolverVisitor.con1(Library library, Source source, TypeProvider typeProvider) : super.con1(library, source, typeProvider) {
- _jtd_constructor_274_impl(library, source, typeProvider);
+ _jtd_constructor_273_impl(library, source, typeProvider);
}
- _jtd_constructor_274_impl(Library library, Source source, TypeProvider typeProvider) {
+ _jtd_constructor_273_impl(Library library, Source source, TypeProvider typeProvider) {
this._elementResolver = new ElementResolver(this);
this._typeAnalyzer = new StaticTypeAnalyzer(this);
}
@@ -5051,9 +4894,9 @@
* during resolution
*/
ResolverVisitor.con2(LibraryElement definingLibrary, Source source, TypeProvider typeProvider, AnalysisErrorListener errorListener) : super.con2(definingLibrary, source, typeProvider, errorListener) {
- _jtd_constructor_275_impl(definingLibrary, source, typeProvider, errorListener);
+ _jtd_constructor_274_impl(definingLibrary, source, typeProvider, errorListener);
}
- _jtd_constructor_275_impl(LibraryElement definingLibrary, Source source, TypeProvider typeProvider, AnalysisErrorListener errorListener) {
+ _jtd_constructor_274_impl(LibraryElement definingLibrary, Source source, TypeProvider typeProvider, AnalysisErrorListener errorListener) {
this._elementResolver = new ElementResolver(this);
this._typeAnalyzer = new StaticTypeAnalyzer(this);
}
@@ -5432,21 +5275,21 @@
}
/**
- * Return the class element representing the class containing the current node, or `null` if
+ * Return the class element representing the class containing the current node, or {@code null} if
* the current node is not contained in a class.
* @return the class element representing the class containing the current node
*/
ClassElement get enclosingClass => _enclosingClass;
/**
- * Return the element representing the function containing the current node, or `null` if
+ * Return the element representing the function containing the current node, or {@code null} if
* the current node is not contained in a function.
* @return the element representing the function containing the current node
*/
ExecutableElement get enclosingFunction => _enclosingFunction;
/**
- * Return the element associated with the given expression whose type can be overridden, or`null` if there is no element whose type can be overridden.
+ * Return the element associated with the given expression whose type can be overridden, or{@code null} if there is no element whose type can be overridden.
* @param expression the expression with which the element is associated
* @return the element associated with the given expression
*/
@@ -5478,7 +5321,7 @@
}
if (element is PropertyInducingElement) {
PropertyInducingElement variable = element as PropertyInducingElement;
- if (!variable.isConst && !variable.isFinal) {
+ if (!variable.isConst() && !variable.isFinal()) {
return;
}
}
@@ -5545,7 +5388,7 @@
/**
* The given expression is the expression used to compute the iterator for a for-each statement.
* Attempt to compute the type of objects that will be assigned to the loop variable and return
- * that type. Return `null` if the type could not be determined.
+ * that type. Return {@code null} if the type could not be determined.
* @param iterator the iterator for a for-each statement
* @return the type of objects that will be assigned to the loop variable
*/
@@ -5569,10 +5412,10 @@
}
/**
- * Return `true` if the given expression terminates abruptly (that is, if any expression
+ * Return {@code true} if the given expression terminates abruptly (that is, if any expression
* following the given expression will not be reached).
* @param expression the expression being tested
- * @return `true` if the given expression terminates abruptly
+ * @return {@code true} if the given expression terminates abruptly
*/
bool isAbruptTermination(Expression expression2) {
while (expression2 is ParenthesizedExpression) {
@@ -5582,10 +5425,10 @@
}
/**
- * Return `true` if the given statement terminates abruptly (that is, if any statement
+ * Return {@code true} if the given statement terminates abruptly (that is, if any statement
* following the given statement will not be reached).
* @param statement the statement being tested
- * @return `true` if the given statement terminates abruptly
+ * @return {@code true} if the given statement terminates abruptly
*/
bool isAbruptTermination2(Statement statement) {
if (statement is ReturnStatement || statement is BreakStatement || statement is ContinueStatement) {
@@ -5682,7 +5525,7 @@
set enclosingClass_J2DAccessor(__v) => _enclosingClass = __v;
}
/**
- * The abstract class `ScopedVisitor` maintains name and label scopes as an AST structure is
+ * The abstract class {@code ScopedVisitor} maintains name and label scopes as an AST structure is
* being visited.
* @coverage dart.engine.resolver
*/
@@ -5714,7 +5557,7 @@
TypeProvider _typeProvider;
/**
- * The scope used to resolve labels for `break` and `continue` statements, or`null` if no labels have been defined in the current context.
+ * The scope used to resolve labels for {@code break} and {@code continue} statements, or{@code null} if no labels have been defined in the current context.
*/
LabelScope _labelScope;
@@ -5725,9 +5568,9 @@
* @param typeProvider the object used to access the types from the core library
*/
ScopedVisitor.con1(Library library, Source source2, TypeProvider typeProvider2) {
- _jtd_constructor_276_impl(library, source2, typeProvider2);
+ _jtd_constructor_275_impl(library, source2, typeProvider2);
}
- _jtd_constructor_276_impl(Library library, Source source2, TypeProvider typeProvider2) {
+ _jtd_constructor_275_impl(Library library, Source source2, TypeProvider typeProvider2) {
this._definingLibrary = library.libraryElement;
this._source = source2;
LibraryScope libraryScope = library.libraryScope;
@@ -5746,9 +5589,9 @@
* during resolution
*/
ScopedVisitor.con2(LibraryElement definingLibrary2, Source source2, TypeProvider typeProvider2, AnalysisErrorListener errorListener2) {
- _jtd_constructor_277_impl(definingLibrary2, source2, typeProvider2, errorListener2);
+ _jtd_constructor_276_impl(definingLibrary2, source2, typeProvider2, errorListener2);
}
- _jtd_constructor_277_impl(LibraryElement definingLibrary2, Source source2, TypeProvider typeProvider2, AnalysisErrorListener errorListener2) {
+ _jtd_constructor_276_impl(LibraryElement definingLibrary2, Source source2, TypeProvider typeProvider2, AnalysisErrorListener errorListener2) {
this._definingLibrary = definingLibrary2;
this._source = source2;
this._errorListener = errorListener2;
@@ -6081,12 +5924,12 @@
}
}
/**
- * Instances of the class `StaticTypeAnalyzer` perform two type-related tasks. First, they
+ * Instances of the class {@code StaticTypeAnalyzer} perform two type-related tasks. First, they
* compute the static type of every expression. Second, they look for any static type errors or
* warnings that might need to be generated. The requirements for the type analyzer are:
* <ol>
- * * Every element that refers to types should be fully populated.
- * * Every node representing an expression should be resolved to the Type of the expression.
+ * <li>Every element that refers to types should be fully populated.
+ * <li>Every node representing an expression should be resolved to the Type of the expression.</li>
* </ol>
* @coverage dart.engine.resolver
*/
@@ -6176,7 +6019,7 @@
Type2 _dynamicType;
/**
- * The type representing the class containing the nodes being analyzed, or `null` if the
+ * The type representing the class containing the nodes being analyzed, or {@code null} if the
* nodes are not within a class.
*/
InterfaceType _thisType;
@@ -6212,7 +6055,7 @@
}
/**
- * The Dart Language Specification, 12.5: <blockquote>The static type of a string literal is`String`.</blockquote>
+ * The Dart Language Specification, 12.5: <blockquote>The static type of a string literal is{@code String}.</blockquote>
*/
Object visitAdjacentStrings(AdjacentStrings node) {
recordStaticType(node, _typeProvider.stringType);
@@ -6221,7 +6064,7 @@
/**
* The Dart Language Specification, 12.33: <blockquote>The static type of an argument definition
- * test is `bool`.</blockquote>
+ * test is {@code bool}.</blockquote>
*/
Object visitArgumentDefinitionTest(ArgumentDefinitionTest node) {
recordStaticType(node, _typeProvider.boolType);
@@ -6230,10 +6073,10 @@
/**
* The Dart Language Specification, 12.32: <blockquote>... the cast expression <i>e as T</i> ...
- *
+ * <p>
* It is a static warning if <i>T</i> does not denote a type available in the current lexical
* scope.
- *
+ * <p>
* The static type of a cast expression <i>e as T</i> is <i>T</i>.</blockquote>
*/
Object visitAsExpression(AsExpression node) {
@@ -6244,33 +6087,33 @@
/**
* The Dart Language Specification, 12.18: <blockquote>... an assignment <i>a</i> of the form <i>v
* = e</i> ...
- *
+ * <p>
* It is a static type warning if the static type of <i>e</i> may not be assigned to the static
* type of <i>v</i>.
- *
+ * <p>
* The static type of the expression <i>v = e</i> is the static type of <i>e</i>.
- *
+ * <p>
* ... an assignment of the form <i>C.v = e</i> ...
- *
+ * <p>
* It is a static type warning if the static type of <i>e</i> may not be assigned to the static
* type of <i>C.v</i>.
- *
+ * <p>
* The static type of the expression <i>C.v = e</i> is the static type of <i>e</i>.
- *
+ * <p>
* ... an assignment of the form <i>e<sub>1</sub>.v = e<sub>2</sub></i> ...
- *
+ * <p>
* Let <i>T</i> be the static type of <i>e<sub>1</sub></i>. It is a static type warning if
* <i>T</i> does not have an accessible instance setter named <i>v=</i>. It is a static type
* warning if the static type of <i>e<sub>2</sub></i> may not be assigned to <i>T</i>.
- *
+ * <p>
* The static type of the expression <i>e<sub>1</sub>.v = e<sub>2</sub></i> is the static type of
* <i>e<sub>2</sub></i>.
- *
+ * <p>
* ... an assignment of the form <i>e<sub>1</sub>\[e<sub>2</sub>\] = e<sub>3</sub></i> ...
- *
+ * <p>
* The static type of the expression <i>e<sub>1</sub>\[e<sub>2</sub>\] = e<sub>3</sub></i> is the
* static type of <i>e<sub>3</sub></i>.
- *
+ * <p>
* A compound assignment of the form <i>v op= e</i> is equivalent to <i>v = v op e</i>. A compound
* assignment of the form <i>C.v op= e</i> is equivalent to <i>C.v = C.v op e</i>. A compound
* assignment of the form <i>e<sub>1</sub>.v op= e<sub>2</sub></i> is equivalent to <i>((x) => x.v
@@ -6315,35 +6158,35 @@
/**
* The Dart Language Specification, 12.20: <blockquote>The static type of a logical boolean
- * expression is `bool`.</blockquote>
- *
+ * expression is {@code bool}.</blockquote>
+ * <p>
* The Dart Language Specification, 12.21:<blockquote>A bitwise expression of the form
* <i>e<sub>1</sub> op e<sub>2</sub></i> is equivalent to the method invocation
* <i>e<sub>1</sub>.op(e<sub>2</sub>)</i>. A bitwise expression of the form <i>super op
* e<sub>2</sub></i> is equivalent to the method invocation
* <i>super.op(e<sub>2</sub>)</i>.</blockquote>
- *
+ * <p>
* The Dart Language Specification, 12.22: <blockquote>The static type of an equality expression
- * is `bool`.</blockquote>
- *
+ * is {@code bool}.</blockquote>
+ * <p>
* The Dart Language Specification, 12.23: <blockquote>A relational expression of the form
* <i>e<sub>1</sub> op e<sub>2</sub></i> is equivalent to the method invocation
* <i>e<sub>1</sub>.op(e<sub>2</sub>)</i>. A relational expression of the form <i>super op
* e<sub>2</sub></i> is equivalent to the method invocation
* <i>super.op(e<sub>2</sub>)</i>.</blockquote>
- *
+ * <p>
* The Dart Language Specification, 12.24: <blockquote>A shift expression of the form
* <i>e<sub>1</sub> op e<sub>2</sub></i> is equivalent to the method invocation
* <i>e<sub>1</sub>.op(e<sub>2</sub>)</i>. A shift expression of the form <i>super op
* e<sub>2</sub></i> is equivalent to the method invocation
* <i>super.op(e<sub>2</sub>)</i>.</blockquote>
- *
+ * <p>
* The Dart Language Specification, 12.25: <blockquote>An additive expression of the form
* <i>e<sub>1</sub> op e<sub>2</sub></i> is equivalent to the method invocation
* <i>e<sub>1</sub>.op(e<sub>2</sub>)</i>. An additive expression of the form <i>super op
* e<sub>2</sub></i> is equivalent to the method invocation
* <i>super.op(e<sub>2</sub>)</i>.</blockquote>
- *
+ * <p>
* The Dart Language Specification, 12.26: <blockquote>A multiplicative expression of the form
* <i>e<sub>1</sub> op e<sub>2</sub></i> is equivalent to the method invocation
* <i>e<sub>1</sub>.op(e<sub>2</sub>)</i>. A multiplicative expression of the form <i>super op
@@ -6388,9 +6231,9 @@
/**
* The Dart Language Specification, 12.19: <blockquote> ... a conditional expression <i>c</i> of
* the form <i>e<sub>1</sub> ? e<sub>2</sub> : e<sub>3</sub></i> ...
- *
- * It is a static type warning if the type of e<sub>1</sub> may not be assigned to `bool`.
- *
+ * <p>
+ * It is a static type warning if the type of e<sub>1</sub> may not be assigned to {@code bool}.
+ * <p>
* The static type of <i>c</i> is the least upper bound of the static type of <i>e<sub>2</sub></i>
* and the static type of <i>e<sub>3</sub></i>.</blockquote>
*/
@@ -6435,10 +6278,8 @@
}
Object visitFunctionDeclaration(FunctionDeclaration node) {
FunctionExpression function = node.functionExpression;
- ExecutableElementImpl functionElement = node.element as ExecutableElementImpl;
- functionElement.returnType = computeReturnType2(node);
- FunctionTypeImpl functionType = functionElement.type as FunctionTypeImpl;
- setTypeInformation(functionType, function.parameters);
+ FunctionTypeImpl functionType = node.element.type as FunctionTypeImpl;
+ setTypeInformation(functionType, computeReturnType2(node), function.parameters);
recordStaticType(function, functionType);
return null;
}
@@ -6451,21 +6292,21 @@
* x<sub>n+k</sub>\]) → T<sub>0</sub></i>, where <i>T<sub>0</sub></i> is the static type of
* <i>e</i>. In any case where <i>T<sub>i</sub>, 1 <= i <= n</i>, is not specified, it is
* considered to have been specified as dynamic.
- *
+ * <p>
* The static type of a function literal of the form <i>(T<sub>1</sub> a<sub>1</sub>, …,
* T<sub>n</sub> a<sub>n</sub>, {T<sub>n+1</sub> x<sub>n+1</sub> : d1, …, T<sub>n+k</sub>
* x<sub>n+k</sub> : dk}) => e</i> is <i>(T<sub>1</sub>, …, T<sub>n</sub>, {T<sub>n+1</sub>
* x<sub>n+1</sub>, …, T<sub>n+k</sub> x<sub>n+k</sub>}) → T<sub>0</sub></i>, where
* <i>T<sub>0</sub></i> is the static type of <i>e</i>. In any case where <i>T<sub>i</sub>, 1
* <= i <= n</i>, is not specified, it is considered to have been specified as dynamic.
- *
+ * <p>
* The static type of a function literal of the form <i>(T<sub>1</sub> a<sub>1</sub>, …,
* T<sub>n</sub> a<sub>n</sub>, \[T<sub>n+1</sub> x<sub>n+1</sub> = d1, …, T<sub>n+k</sub>
* x<sub>n+k</sub> = dk\]) {s}</i> is <i>(T<sub>1</sub>, …, T<sub>n</sub>, \[T<sub>n+1</sub>
* x<sub>n+1</sub>, …, T<sub>n+k</sub> x<sub>n+k</sub>\]) → dynamic</i>. In any case
* where <i>T<sub>i</sub>, 1 <= i <= n</i>, is not specified, it is considered to have been
* specified as dynamic.
- *
+ * <p>
* The static type of a function literal of the form <i>(T<sub>1</sub> a<sub>1</sub>, …,
* T<sub>n</sub> a<sub>n</sub>, {T<sub>n+1</sub> x<sub>n+1</sub> : d1, …, T<sub>n+k</sub>
* x<sub>n+k</sub> : dk}) {s}</i> is <i>(T<sub>1</sub>, …, T<sub>n</sub>, {T<sub>n+1</sub>
@@ -6477,10 +6318,8 @@
if (node.parent is FunctionDeclaration) {
return null;
}
- ExecutableElementImpl functionElement = node.element as ExecutableElementImpl;
- functionElement.returnType = computeReturnType3(node);
FunctionTypeImpl functionType = node.element.type as FunctionTypeImpl;
- setTypeInformation(functionType, node.parameters);
+ setTypeInformation(functionType, computeReturnType3(node), node.parameters);
recordStaticType(node, functionType);
return null;
}
@@ -6490,10 +6329,10 @@
* has the form <i>e<sub>f</sub>(a<sub>1</sub>, …, a<sub>n</sub>, x<sub>n+1</sub>:
* a<sub>n+1</sub>, …, x<sub>n+k</sub>: a<sub>n+k</sub>)</i>, where <i>e<sub>f</sub></i> is
* an expression.
- *
+ * <p>
* It is a static type warning if the static type <i>F</i> of <i>e<sub>f</sub></i> may not be
* assigned to a function type.
- *
+ * <p>
* If <i>F</i> is not a function type, the static type of <i>i</i> is dynamic. Otherwise the
* static type of <i>i</i> is the declared return type of <i>F</i>.</blockquote>
*/
@@ -6547,7 +6386,7 @@
* The Dart Language Specification, 12.11.1: <blockquote>The static type of a new expression of
* either the form <i>new T.id(a<sub>1</sub>, …, a<sub>n</sub>)</i> or the form <i>new
* T(a<sub>1</sub>, …, a<sub>n</sub>)</i> is <i>T</i>.</blockquote>
- *
+ * <p>
* The Dart Language Specification, 12.11.2: <blockquote>The static type of a constant object
* expression of either the form <i>const T.id(a<sub>1</sub>, …, a<sub>n</sub>)</i> or the
* form <i>const T(a<sub>1</sub>, …, a<sub>n</sub>)</i> is <i>T</i>. </blockquote>
@@ -6568,7 +6407,7 @@
}
/**
- * The Dart Language Specification, 12.3: <blockquote>The static type of an integer literal is`int`.</blockquote>
+ * The Dart Language Specification, 12.3: <blockquote>The static type of an integer literal is{@code int}.</blockquote>
*/
Object visitIntegerLiteral(IntegerLiteral node) {
recordStaticType(node, _typeProvider.intType);
@@ -6578,8 +6417,8 @@
/**
* The Dart Language Specification, 12.31: <blockquote>It is a static warning if <i>T</i> does not
* denote a type available in the current lexical scope.
- *
- * The static type of an is-expression is `bool`.</blockquote>
+ * <p>
+ * The static type of an is-expression is {@code bool}.</blockquote>
*/
Object visitIsExpression(IsExpression node) {
recordStaticType(node, _typeProvider.boolType);
@@ -6589,9 +6428,9 @@
/**
* The Dart Language Specification, 12.6: <blockquote>The static type of a list literal of the
* form <i><b>const</b> <E>\[e<sub>1</sub>, …, e<sub>n</sub>\]</i> or the form
- * <i><E>\[e<sub>1</sub>, …, e<sub>n</sub>\]</i> is `List<E>`. The static
+ * <i><E>\[e<sub>1</sub>, …, e<sub>n</sub>\]</i> is {@code List<E>}. The static
* type a list literal of the form <i><b>const</b> \[e<sub>1</sub>, …, e<sub>n</sub>\]</i> or
- * the form <i>\[e<sub>1</sub>, …, e<sub>n</sub>\]</i> is `List<dynamic>`.</blockquote>
+ * the form <i>\[e<sub>1</sub>, …, e<sub>n</sub>\]</i> is {@code List<dynamic>}.</blockquote>
*/
Object visitListLiteral(ListLiteral node) {
Type2 staticType = _dynamicType;
@@ -6633,11 +6472,11 @@
* The Dart Language Specification, 12.7: <blockquote>The static type of a map literal of the form
* <i><b>const</b> <String, V> {k<sub>1</sub>:e<sub>1</sub>, …,
* k<sub>n</sub>:e<sub>n</sub>}</i> or the form <i><String, V> {k<sub>1</sub>:e<sub>1</sub>,
- * …, k<sub>n</sub>:e<sub>n</sub>}</i> is `Map<String, V>`. The static type a
+ * …, k<sub>n</sub>:e<sub>n</sub>}</i> is {@code Map<String, V>}. The static type a
* map literal of the form <i><b>const</b> {k<sub>1</sub>:e<sub>1</sub>, …,
* k<sub>n</sub>:e<sub>n</sub>}</i> or the form <i>{k<sub>1</sub>:e<sub>1</sub>, …,
- * k<sub>n</sub>:e<sub>n</sub>}</i> is `Map<String, dynamic>`.
- *
+ * k<sub>n</sub>:e<sub>n</sub>}</i> is {@code Map<String, dynamic>}.
+ * <p>
* It is a compile-time error if the first type argument to a map literal is not
* <i>String</i>.</blockquote>
*/
@@ -6707,34 +6546,34 @@
* The Dart Language Specification, 12.15.1: <blockquote>An ordinary method invocation <i>i</i>
* has the form <i>o.m(a<sub>1</sub>, …, a<sub>n</sub>, x<sub>n+1</sub>: a<sub>n+1</sub>,
* …, x<sub>n+k</sub>: a<sub>n+k</sub>)</i>.
- *
+ * <p>
* Let <i>T</i> be the static type of <i>o</i>. It is a static type warning if <i>T</i> does not
* have an accessible instance member named <i>m</i>. If <i>T.m</i> exists, it is a static warning
* if the type <i>F</i> of <i>T.m</i> may not be assigned to a function type.
- *
+ * <p>
* If <i>T.m</i> does not exist, or if <i>F</i> is not a function type, the static type of
* <i>i</i> is dynamic. Otherwise the static type of <i>i</i> is the declared return type of
* <i>F</i>.</blockquote>
- *
+ * <p>
* The Dart Language Specification, 11.15.3: <blockquote>A static method invocation <i>i</i> has
* the form <i>C.m(a<sub>1</sub>, …, a<sub>n</sub>, x<sub>n+1</sub>: a<sub>n+1</sub>,
* …, x<sub>n+k</sub>: a<sub>n+k</sub>)</i>.
- *
+ * <p>
* It is a static type warning if the type <i>F</i> of <i>C.m</i> may not be assigned to a
* function type.
- *
+ * <p>
* If <i>F</i> is not a function type, or if <i>C.m</i> does not exist, the static type of i is
* dynamic. Otherwise the static type of <i>i</i> is the declared return type of
* <i>F</i>.</blockquote>
- *
+ * <p>
* The Dart Language Specification, 11.15.4: <blockquote>A super method invocation <i>i</i> has
* the form <i>super.m(a<sub>1</sub>, …, a<sub>n</sub>, x<sub>n+1</sub>: a<sub>n+1</sub>,
* …, x<sub>n+k</sub>: a<sub>n+k</sub>)</i>.
- *
+ * <p>
* It is a static type warning if <i>S</i> does not have an accessible instance member named m. If
* <i>S.m</i> exists, it is a static warning if the type <i>F</i> of <i>S.m</i> may not be
* assigned to a function type.
- *
+ * <p>
* If <i>S.m</i> does not exist, or if <i>F</i> is not a function type, the static type of
* <i>i</i> is dynamic. Otherwise the static type of <i>i</i> is the declared return type of
* <i>F</i>.</blockquote>
@@ -6823,7 +6662,7 @@
}
/**
- * The Dart Language Specification, 12.2: <blockquote>The static type of `null` is bottom.
+ * The Dart Language Specification, 12.2: <blockquote>The static type of {@code null} is bottom.
* </blockquote>
*/
Object visitNullLiteral(NullLiteral node) {
@@ -6841,25 +6680,25 @@
* The Dart Language Specification, 12.28: <blockquote>A postfix expression of the form
* <i>v++</i>, where <i>v</i> is an identifier, is equivalent to <i>(){var r = v; v = r + 1;
* return r}()</i>.
- *
+ * <p>
* A postfix expression of the form <i>C.v++</i> is equivalent to <i>(){var r = C.v; C.v = r + 1;
* return r}()</i>.
- *
+ * <p>
* A postfix expression of the form <i>e1.v++</i> is equivalent to <i>(x){var r = x.v; x.v = r +
* 1; return r}(e1)</i>.
- *
+ * <p>
* A postfix expression of the form <i>e1\[e2\]++</i> is equivalent to <i>(a, i){var r = a\[i\]; a\[i\]
* = r + 1; return r}(e1, e2)</i>
- *
+ * <p>
* A postfix expression of the form <i>v--</i>, where <i>v</i> is an identifier, is equivalent to
* <i>(){var r = v; v = r - 1; return r}()</i>.
- *
+ * <p>
* A postfix expression of the form <i>C.v--</i> is equivalent to <i>(){var r = C.v; C.v = r - 1;
* return r}()</i>.
- *
+ * <p>
* A postfix expression of the form <i>e1.v--</i> is equivalent to <i>(x){var r = x.v; x.v = r -
* 1; return r}(e1)</i>.
- *
+ * <p>
* A postfix expression of the form <i>e1\[e2\]--</i> is equivalent to <i>(a, i){var r = a\[i\]; a\[i\]
* = r - 1; return r}(e1, e2)</i></blockquote>
*/
@@ -6879,7 +6718,7 @@
}
/**
- * See [visitSimpleIdentifier].
+ * See {@link #visitSimpleIdentifier(SimpleIdentifier)}.
*/
Object visitPrefixedIdentifier(PrefixedIdentifier node) {
SimpleIdentifier prefixedIdentifier = node.identifier;
@@ -6948,43 +6787,43 @@
* The Dart Language Specification, 12.13: <blockquote> Property extraction allows for a member of
* an object to be concisely extracted from the object. If <i>o</i> is an object, and if <i>m</i>
* is the name of a method member of <i>o</i>, then
- *
- * * <i>o.m</i> is defined to be equivalent to: <i>(r<sub>1</sub>, …, r<sub>n</sub>,
+ * <ul>
+ * <li><i>o.m</i> is defined to be equivalent to: <i>(r<sub>1</sub>, …, r<sub>n</sub>,
* {p<sub>1</sub> : d<sub>1</sub>, …, p<sub>k</sub> : d<sub>k</sub>}){return
* o.m(r<sub>1</sub>, …, r<sub>n</sub>, p<sub>1</sub>: p<sub>1</sub>, …,
* p<sub>k</sub>: p<sub>k</sub>);}</i> if <i>m</i> has required parameters <i>r<sub>1</sub>,
* …, r<sub>n</sub></i>, and named parameters <i>p<sub>1</sub> … p<sub>k</sub></i>
- * with defaults <i>d<sub>1</sub>, …, d<sub>k</sub></i>.
- * * <i>(r<sub>1</sub>, …, r<sub>n</sub>, \[p<sub>1</sub> = d<sub>1</sub>, …,
+ * with defaults <i>d<sub>1</sub>, …, d<sub>k</sub></i>.</li>
+ * <li><i>(r<sub>1</sub>, …, r<sub>n</sub>, \[p<sub>1</sub> = d<sub>1</sub>, …,
* p<sub>k</sub> = d<sub>k</sub>\]){return o.m(r<sub>1</sub>, …, r<sub>n</sub>,
* p<sub>1</sub>, …, p<sub>k</sub>);}</i> if <i>m</i> has required parameters
* <i>r<sub>1</sub>, …, r<sub>n</sub></i>, and optional positional parameters
* <i>p<sub>1</sub> … p<sub>k</sub></i> with defaults <i>d<sub>1</sub>, …,
- * d<sub>k</sub></i>.
- *
+ * d<sub>k</sub></i>.</li>
+ * </ul>
* Otherwise, if <i>m</i> is the name of a getter member of <i>o</i> (declared implicitly or
* explicitly) then <i>o.m</i> evaluates to the result of invoking the getter. </blockquote>
- *
+ * <p>
* The Dart Language Specification, 12.17: <blockquote> ... a getter invocation <i>i</i> of the
* form <i>e.m</i> ...
- *
+ * <p>
* Let <i>T</i> be the static type of <i>e</i>. It is a static type warning if <i>T</i> does not
* have a getter named <i>m</i>.
- *
+ * <p>
* The static type of <i>i</i> is the declared return type of <i>T.m</i>, if <i>T.m</i> exists;
* otherwise the static type of <i>i</i> is dynamic.
- *
+ * <p>
* ... a getter invocation <i>i</i> of the form <i>C.m</i> ...
- *
+ * <p>
* It is a static warning if there is no class <i>C</i> in the enclosing lexical scope of
* <i>i</i>, or if <i>C</i> does not declare, implicitly or explicitly, a getter named <i>m</i>.
- *
+ * <p>
* The static type of <i>i</i> is the declared return type of <i>C.m</i> if it exists or dynamic
* otherwise.
- *
+ * <p>
* ... a top-level getter invocation <i>i</i> of the form <i>m</i>, where <i>m</i> is an
* identifier ...
- *
+ * <p>
* The static type of <i>i</i> is the declared return type of <i>m</i>.</blockquote>
*/
Object visitPropertyAccess(PropertyAccess node) {
@@ -7018,43 +6857,43 @@
/**
* The Dart Language Specification, 12.30: <blockquote>Evaluation of an identifier expression
* <i>e</i> of the form <i>id</i> proceeds as follows:
- *
+ * <p>
* Let <i>d</i> be the innermost declaration in the enclosing lexical scope whose name is
* <i>id</i>. If no such declaration exists in the lexical scope, let <i>d</i> be the declaration
* of the inherited member named <i>id</i> if it exists.
- *
- * * If <i>d</i> is a class or type alias <i>T</i>, the value of <i>e</i> is the unique instance
- * of class `Type` reifying <i>T</i>.
- * * If <i>d</i> is a type parameter <i>T</i>, then the value of <i>e</i> is the value of the
+ * <ul>
+ * <li>If <i>d</i> is a class or type alias <i>T</i>, the value of <i>e</i> is the unique instance
+ * of class {@code Type} reifying <i>T</i>.
+ * <li>If <i>d</i> is a type parameter <i>T</i>, then the value of <i>e</i> is the value of the
* actual type argument corresponding to <i>T</i> that was passed to the generative constructor
* that created the current binding of this. We are assured that this is well defined, because if
* we were in a static member the reference to <i>T</i> would be a compile-time error.
- * * If <i>d</i> is a library variable then:
- *
- * * If <i>d</i> is of one of the forms <i>var v = e<sub>i</sub>;</i>, <i>T v =
+ * <li>If <i>d</i> is a library variable then:
+ * <ul>
+ * <li>If <i>d</i> is of one of the forms <i>var v = e<sub>i</sub>;</i>, <i>T v =
* e<sub>i</sub>;</i>, <i>final v = e<sub>i</sub>;</i>, <i>final T v = e<sub>i</sub>;</i>, and no
* value has yet been stored into <i>v</i> then the initializer expression <i>e<sub>i</sub></i> is
* evaluated. If, during the evaluation of <i>e<sub>i</sub></i>, the getter for <i>v</i> is
* referenced, a CyclicInitializationError is thrown. If the evaluation succeeded yielding an
* object <i>o</i>, let <i>r = o</i>, otherwise let <i>r = null</i>. In any case, <i>r</i> is
* stored into <i>v</i>. The value of <i>e</i> is <i>r</i>.
- * * If <i>d</i> is of one of the forms <i>const v = e;</i> or <i>const T v = e;</i> the result
+ * <li>If <i>d</i> is of one of the forms <i>const v = e;</i> or <i>const T v = e;</i> the result
* of the getter is the value of the compile time constant <i>e</i>. Otherwise
- * * <i>e</i> evaluates to the current binding of <i>id</i>.
- *
- * * If <i>d</i> is a local variable or formal parameter then <i>e</i> evaluates to the current
+ * <li><i>e</i> evaluates to the current binding of <i>id</i>.
+ * </ul>
+ * <li>If <i>d</i> is a local variable or formal parameter then <i>e</i> evaluates to the current
* binding of <i>id</i>.
- * * If <i>d</i> is a static method, top level function or local function then <i>e</i>
+ * <li>If <i>d</i> is a static method, top level function or local function then <i>e</i>
* evaluates to the function defined by <i>d</i>.
- * * If <i>d</i> is the declaration of a static variable or static getter declared in class
+ * <li>If <i>d</i> is the declaration of a static variable or static getter declared in class
* <i>C</i>, then <i>e</i> is equivalent to the getter invocation <i>C.id</i>.
- * * If <i>d</i> is the declaration of a top level getter, then <i>e</i> is equivalent to the
+ * <li>If <i>d</i> is the declaration of a top level getter, then <i>e</i> is equivalent to the
* getter invocation <i>id</i>.
- * * Otherwise, if <i>e</i> occurs inside a top level or static function (be it function,
+ * <li>Otherwise, if <i>e</i> occurs inside a top level or static function (be it function,
* method, getter, or setter) or variable initializer, evaluation of e causes a NoSuchMethodError
* to be thrown.
- * * Otherwise <i>e</i> is equivalent to the property extraction <i>this.id</i>.
- *
+ * <li>Otherwise <i>e</i> is equivalent to the property extraction <i>this.id</i>.
+ * </ul>
* </blockquote>
*/
Object visitSimpleIdentifier(SimpleIdentifier node) {
@@ -7092,7 +6931,7 @@
}
/**
- * The Dart Language Specification, 12.5: <blockquote>The static type of a string literal is`String`.</blockquote>
+ * The Dart Language Specification, 12.5: <blockquote>The static type of a string literal is{@code String}.</blockquote>
*/
Object visitSimpleStringLiteral(SimpleStringLiteral node) {
recordStaticType(node, _typeProvider.stringType);
@@ -7100,7 +6939,7 @@
}
/**
- * The Dart Language Specification, 12.5: <blockquote>The static type of a string literal is`String`.</blockquote>
+ * The Dart Language Specification, 12.5: <blockquote>The static type of a string literal is{@code String}.</blockquote>
*/
Object visitStringInterpolation(StringInterpolation node) {
recordStaticType(node, _typeProvider.stringType);
@@ -7116,7 +6955,7 @@
}
/**
- * The Dart Language Specification, 12.10: <blockquote>The static type of `this` is the
+ * The Dart Language Specification, 12.10: <blockquote>The static type of {@code this} is the
* interface of the immediately enclosing class.</blockquote>
*/
Object visitThisExpression(ThisExpression node) {
@@ -7186,7 +7025,7 @@
if (innerReturnType != null) {
return innerReturnType;
}
- } else if (returnType.isDartCoreFunction) {
+ } else if (returnType.isDartCoreFunction()) {
return _dynamicType;
}
if (returnType != null) {
@@ -7209,7 +7048,7 @@
/**
* Given a function declaration, compute the return type of the function. The return type of
- * functions with a block body is `dynamicType`, with an expression body it is the type of
+ * functions with a block body is {@code dynamicType}, with an expression body it is the type of
* the expression.
* @param node the function expression whose return type is to be computed
* @return the return type that was computed
@@ -7224,7 +7063,7 @@
/**
* Given a function expression, compute the return type of the function. The return type of
- * functions with a block body is `dynamicType`, with an expression body it is the type of
+ * functions with a block body is {@code dynamicType}, with an expression body it is the type of
* the expression.
* @param node the function expression whose return type is to be computed
* @return the return type that was computed
@@ -7357,7 +7196,7 @@
/**
* Return the type that should be recorded for a node that resolved to the given accessor.
* @param accessor the accessor that the node resolved to
- * @param context if the accessor element has context \[by being the RHS of a[PrefixedIdentifier] or [PropertyAccess]\], and the return type of the
+ * @param context if the accessor element has context \[by being the RHS of a{@link PrefixedIdentifier} or {@link PropertyAccess}\], and the return type of the
* accessor is a parameter type, then the type of the LHS can be used to get more
* specific type information
* @return the type that should be recorded for a node that resolved to the given accessor
@@ -7367,7 +7206,7 @@
if (functionType == null) {
return _dynamicType;
}
- if (accessor.isSetter) {
+ if (accessor.isSetter()) {
List<Type2> parameterTypes = functionType.normalParameterTypes;
if (parameterTypes != null && parameterTypes.length > 0) {
return parameterTypes[0];
@@ -7411,16 +7250,16 @@
}
/**
- * Return `true` if the given library is the 'dart:html' library.
+ * Return {@code true} if the given library is the 'dart:html' library.
* @param library the library being tested
- * @return `true` if the library is 'dart:html'
+ * @return {@code true} if the library is 'dart:html'
*/
bool isHtmlLibrary(LibraryElement library) => library.name == "dart.dom.html";
/**
- * Return `true` if the given node is not a type literal.
+ * Return {@code true} if the given node is not a type literal.
* @param node the node being tested
- * @return `true` if the given node is not a type literal
+ * @return {@code true} if the given node is not a type literal
*/
bool isNotTypeLiteral(Identifier node) {
ASTNode parent = node.parent;
@@ -7433,7 +7272,7 @@
* @param type the propagated type of the node
*/
void recordPropagatedType(Expression expression, Type2 type) {
- if (type != null && !type.isDynamic) {
+ if (type != null && !type.isDynamic()) {
expression.propagatedType = type;
}
}
@@ -7481,9 +7320,10 @@
* Set the return type and parameter type information for the given function type based on the
* given return type and parameter elements.
* @param functionType the function type to be filled in
+ * @param returnType the return type of the function, or {@code null} if no type was declared
* @param parameters the elements representing the parameters to the function
*/
- void setTypeInformation(FunctionTypeImpl functionType, FormalParameterList parameterList) {
+ void setTypeInformation(FunctionTypeImpl functionType, Type2 returnType2, FormalParameterList parameterList) {
List<Type2> normalParameterTypes = new List<Type2>();
List<Type2> optionalParameterTypes = new List<Type2>();
LinkedHashMap<String, Type2> namedParameterTypes = new LinkedHashMap<String, Type2>();
@@ -7504,18 +7344,19 @@
functionType.normalParameterTypes = new List.from(normalParameterTypes);
functionType.optionalParameterTypes = new List.from(optionalParameterTypes);
functionType.namedParameterTypes = namedParameterTypes;
+ functionType.returnType = returnType2;
}
get thisType_J2DAccessor => _thisType;
set thisType_J2DAccessor(__v) => _thisType = __v;
}
/**
- * Instances of the class `TypeOverrideManager` manage the ability to override the type of an
+ * Instances of the class {@code TypeOverrideManager} manage the ability to override the type of an
* element within a given context.
*/
class TypeOverrideManager {
/**
- * The current override scope, or `null` if no scope has been entered.
+ * The current override scope, or {@code null} if no scope has been entered.
*/
TypeOverrideManager_TypeOverrideScope _currentScope;
@@ -7573,7 +7414,7 @@
}
/**
- * Return the overridden type of the given element, or `null` if the type of the element has
+ * Return the overridden type of the given element, or {@code null} if the type of the element has
* not been overridden.
* @param element the element whose type might have been overridden
* @return the overridden type of the given element
@@ -7598,7 +7439,7 @@
}
}
/**
- * Instances of the class `TypeOverrideScope` represent a scope in which the types of
+ * Instances of the class {@code TypeOverrideScope} represent a scope in which the types of
* elements can be overridden.
*/
class TypeOverrideManager_TypeOverrideScope {
@@ -7646,7 +7487,7 @@
*/
Map<Element, Type2> captureOverrides(VariableDeclarationList variableList) {
Map<Element, Type2> overrides = new Map<Element, Type2>();
- if (variableList.isConst || variableList.isFinal) {
+ if (variableList.isConst() || variableList.isFinal()) {
for (VariableDeclaration variable in variableList.variables) {
Element element = variable.element;
if (element != null) {
@@ -7661,7 +7502,7 @@
}
/**
- * Return the overridden type of the given element, or `null` if the type of the element
+ * Return the overridden type of the given element, or {@code null} if the type of the element
* has not been overridden.
* @param element the element whose type might have been overridden
* @return the overridden type of the given element
@@ -7689,7 +7530,7 @@
}
}
/**
- * The interface `TypeProvider` defines the behavior of objects that provide access to types
+ * The interface {@code TypeProvider} defines the behavior of objects that provide access to types
* defined by the language.
* @coverage dart.engine.resolver
*/
@@ -7774,7 +7615,7 @@
InterfaceType get typeType;
}
/**
- * Instances of the class `TypeProviderImpl` provide access to types defined by the language
+ * Instances of the class {@code TypeProviderImpl} provide access to types defined by the language
* by looking for those types in the element model for the core library.
* @coverage dart.engine.resolver
*/
@@ -7867,7 +7708,7 @@
InterfaceType get typeType => _typeType;
/**
- * Return the type with the given name from the given namespace, or `null` if there is no
+ * Return the type with the given name from the given namespace, or {@code null} if there is no
* class with the given name.
* @param namespace the namespace in which to search for the given name
* @param typeName the name of the type being searched for
@@ -7904,7 +7745,7 @@
}
}
/**
- * Instances of the class `TypeResolverVisitor` are used to resolve the types associated with
+ * Instances of the class {@code TypeResolverVisitor} are used to resolve the types associated with
* the elements in the element model. This includes the types of superclasses, mixins, interfaces,
* fields, methods, parameters, and local variables. As a side-effect, this also finishes building
* the type hierarchy.
@@ -7929,9 +7770,9 @@
* @param typeProvider the object used to access the types from the core library
*/
TypeResolverVisitor.con1(Library library, Source source, TypeProvider typeProvider) : super.con1(library, source, typeProvider) {
- _jtd_constructor_282_impl(library, source, typeProvider);
+ _jtd_constructor_281_impl(library, source, typeProvider);
}
- _jtd_constructor_282_impl(Library library, Source source, TypeProvider typeProvider) {
+ _jtd_constructor_281_impl(Library library, Source source, TypeProvider typeProvider) {
_dynamicType = typeProvider.dynamicType;
}
@@ -7945,9 +7786,9 @@
* during resolution
*/
TypeResolverVisitor.con2(LibraryElement definingLibrary, Source source, TypeProvider typeProvider, AnalysisErrorListener errorListener) : super.con2(definingLibrary, source, typeProvider, errorListener) {
- _jtd_constructor_283_impl(definingLibrary, source, typeProvider, errorListener);
+ _jtd_constructor_282_impl(definingLibrary, source, typeProvider, errorListener);
}
- _jtd_constructor_283_impl(LibraryElement definingLibrary, Source source, TypeProvider typeProvider, AnalysisErrorListener errorListener) {
+ _jtd_constructor_282_impl(LibraryElement definingLibrary, Source source, TypeProvider typeProvider, AnalysisErrorListener errorListener) {
_dynamicType = typeProvider.dynamicType;
}
Object visitCatchClause(CatchClause node) {
@@ -8016,11 +7857,9 @@
Object visitConstructorDeclaration(ConstructorDeclaration node) {
super.visitConstructorDeclaration(node);
ExecutableElementImpl element = node.element as ExecutableElementImpl;
- ClassElement definingClass = element.enclosingElement as ClassElement;
- element.returnType = definingClass.type;
FunctionTypeImpl type = new FunctionTypeImpl.con1(element);
- type.typeArguments = definingClass.type.typeArguments;
- setTypeInformation(type, element.parameters);
+ setTypeInformation(type, null, element.parameters);
+ type.returnType = ((element.enclosingElement as ClassElement)).type;
element.type = type;
return null;
}
@@ -8061,65 +7900,38 @@
Object visitFunctionDeclaration(FunctionDeclaration node) {
super.visitFunctionDeclaration(node);
ExecutableElementImpl element = node.element as ExecutableElementImpl;
- element.returnType = computeReturnType(node.returnType);
FunctionTypeImpl type = new FunctionTypeImpl.con1(element);
- ClassElement definingClass = element.getAncestor(ClassElement);
- if (definingClass != null) {
- type.typeArguments = definingClass.type.typeArguments;
- }
- setTypeInformation(type, element.parameters);
+ setTypeInformation(type, node.returnType, element.parameters);
element.type = type;
return null;
}
Object visitFunctionTypeAlias(FunctionTypeAlias node) {
super.visitFunctionTypeAlias(node);
FunctionTypeAliasElementImpl element = node.element as FunctionTypeAliasElementImpl;
- element.returnType = computeReturnType(node.returnType);
FunctionTypeImpl type = element.type as FunctionTypeImpl;
- setTypeInformation(type, element.parameters);
+ setTypeInformation(type, node.returnType, element.parameters);
return null;
}
Object visitFunctionTypedFormalParameter(FunctionTypedFormalParameter node) {
super.visitFunctionTypedFormalParameter(node);
ParameterElementImpl element = node.identifier.element as ParameterElementImpl;
+ AnonymousFunctionTypeImpl type = new AnonymousFunctionTypeImpl();
List<ParameterElement> parameters = getElements(node.parameters);
- FunctionTypeAliasElementImpl aliasElement = new FunctionTypeAliasElementImpl(null);
- aliasElement.synthetic = true;
- aliasElement.parameters = parameters;
- aliasElement.returnType = computeReturnType(node.returnType);
- FunctionTypeImpl type = new FunctionTypeImpl.con2(aliasElement);
- ClassElement definingClass = element.getAncestor(ClassElement);
- if (definingClass != null) {
- aliasElement.typeVariables = definingClass.typeVariables;
- type.typeArguments = definingClass.type.typeArguments;
- } else {
- FunctionTypeAliasElement alias = element.getAncestor(FunctionTypeAliasElement);
- if (alias != null) {
- aliasElement.typeVariables = alias.typeVariables;
- type.typeArguments = alias.type.typeArguments;
- } else {
- type.typeArguments = TypeVariableTypeImpl.EMPTY_ARRAY;
- }
- }
- setTypeInformation(type, parameters);
+ setTypeInformation(type, node.returnType, parameters);
+ type.baseParameters = parameters;
element.type = type;
return null;
}
Object visitMethodDeclaration(MethodDeclaration node) {
super.visitMethodDeclaration(node);
ExecutableElementImpl element = node.element as ExecutableElementImpl;
- element.returnType = computeReturnType(node.returnType);
FunctionTypeImpl type = new FunctionTypeImpl.con1(element);
- ClassElement definingClass = element.getAncestor(ClassElement);
- if (definingClass != null) {
- type.typeArguments = definingClass.type.typeArguments;
- }
- setTypeInformation(type, element.parameters);
+ setTypeInformation(type, node.returnType, element.parameters);
element.type = type;
if (element is PropertyAccessorElement) {
PropertyAccessorElement accessor = element as PropertyAccessorElement;
PropertyInducingElementImpl variable = accessor.variable as PropertyInducingElementImpl;
- if (accessor.isGetter) {
+ if (accessor.isGetter()) {
variable.type = type.returnType;
} else if (variable.type == null) {
List<Type2> parameterTypes = type.normalParameterTypes;
@@ -8193,7 +8005,7 @@
if (elementValid && element is! ClassElement && isTypeNameInInstanceCreationExpression(node)) {
SimpleIdentifier typeNameSimple = getTypeSimpleIdentifier(typeName);
InstanceCreationExpression creation = node.parent.parent as InstanceCreationExpression;
- if (creation.isConst) {
+ if (creation.isConst()) {
if (element == null) {
reportError(CompileTimeErrorCode.UNDEFINED_CLASS, typeNameSimple, [typeName]);
} else {
@@ -8331,20 +8143,13 @@
if (element is PropertyInducingElement) {
PropertyInducingElement variableElement = element as PropertyInducingElement;
PropertyAccessorElementImpl getter = variableElement.getter as PropertyAccessorElementImpl;
- getter.returnType = declaredType;
FunctionTypeImpl getterType = new FunctionTypeImpl.con1(getter);
- ClassElement definingClass = element.getAncestor(ClassElement);
- if (definingClass != null) {
- getterType.typeArguments = definingClass.type.typeArguments;
- }
+ getterType.returnType = declaredType;
getter.type = getterType;
PropertyAccessorElementImpl setter = variableElement.setter as PropertyAccessorElementImpl;
if (setter != null) {
- setter.returnType = VoidTypeImpl.instance;
FunctionTypeImpl setterType = new FunctionTypeImpl.con1(setter);
- if (definingClass != null) {
- setterType.typeArguments = definingClass.type.typeArguments;
- }
+ setterType.returnType = VoidTypeImpl.instance;
setterType.normalParameterTypes = <Type2> [declaredType];
setter.type = setterType;
}
@@ -8355,20 +8160,6 @@
}
/**
- * Given a type name representing the return type of a function, compute the return type of the
- * function.
- * @param returnType the type name representing the return type of the function
- * @return the return type that was computed
- */
- Type2 computeReturnType(TypeName returnType) {
- if (returnType == null) {
- return _dynamicType;
- } else {
- return returnType.type;
- }
- }
-
- /**
* Return the class element that represents the class whose name was provided.
* @param identifier the name from the declaration of a class
* @return the class element that represents the class
@@ -8414,7 +8205,7 @@
if (parent is ConstructorName) {
parent = parent.parent;
if (parent is InstanceCreationExpression) {
- if (((parent as InstanceCreationExpression)).isConst) {
+ if (((parent as InstanceCreationExpression)).isConst()) {
return CompileTimeErrorCode.CONST_WITH_INVALID_TYPE_PARAMETERS;
} else {
return CompileTimeErrorCode.NEW_WITH_INVALID_TYPE_PARAMETERS;
@@ -8426,7 +8217,7 @@
/**
* Given the multiple elements to which a single name could potentially be resolved, return the
- * single interface type that should be used, or `null` if there is no clear choice.
+ * single interface type that should be used, or {@code null} if there is no clear choice.
* @param elements the elements to which a single name could potentially be resolved
* @return the single interface type that should be used for the type name
*/
@@ -8486,7 +8277,7 @@
/**
* Checks if the given type name is used as the type in an as expression.
* @param typeName the type name to analyzer
- * @return `true` if the given type name is used as the type in an as expression
+ * @return {@code true} if the given type name is used as the type in an as expression
*/
bool isTypeNameInAsExpression(TypeName typeName) {
ASTNode parent = typeName.parent;
@@ -8500,7 +8291,7 @@
/**
* Checks if the given type name is used as the exception type in a catch clause.
* @param typeName the type name to analyzer
- * @return `true` if the given type name is used as the exception type in a catch clause
+ * @return {@code true} if the given type name is used as the exception type in a catch clause
*/
bool isTypeNameInCatchClause(TypeName typeName) {
ASTNode parent = typeName.parent;
@@ -8514,7 +8305,7 @@
/**
* Checks if the given type name is used as the type in an instance creation expression.
* @param typeName the type name to analyzer
- * @return `true` if the given type name is used as the type in an instance creation
+ * @return {@code true} if the given type name is used as the type in an instance creation
* expression
*/
bool isTypeNameInInstanceCreationExpression(TypeName typeName) {
@@ -8529,7 +8320,7 @@
/**
* Checks if the given type name is used as the type in an is expression.
* @param typeName the type name to analyzer
- * @return `true` if the given type name is used as the type in an is expression
+ * @return {@code true} if the given type name is used as the type in an is expression
*/
bool isTypeNameInIsExpression(TypeName typeName) {
ASTNode parent = typeName.parent;
@@ -8543,7 +8334,7 @@
/**
* Checks if the given type name is the target in a redirected constructor.
* @param typeName the type name to analyzer
- * @return `true` if the given type name is used as the type in a redirected constructor
+ * @return {@code true} if the given type name is used as the type in a redirected constructor
*/
bool isTypeNameTargetInRedirectedConstructor(TypeName typeName) {
ASTNode parent = typeName.parent;
@@ -8681,9 +8472,10 @@
* Set the return type and parameter type information for the given function type based on the
* given return type and parameter elements.
* @param functionType the function type to be filled in
+ * @param returnType the return type of the function, or {@code null} if no type was declared
* @param parameters the elements representing the parameters to the function
*/
- void setTypeInformation(FunctionTypeImpl functionType, List<ParameterElement> parameters) {
+ void setTypeInformation(FunctionTypeImpl functionType, TypeName returnType2, List<ParameterElement> parameters) {
List<Type2> normalParameterTypes = new List<Type2>();
List<Type2> optionalParameterTypes = new List<Type2>();
LinkedHashMap<String, Type2> namedParameterTypes = new LinkedHashMap<String, Type2>();
@@ -8708,10 +8500,15 @@
if (!namedParameterTypes.isEmpty) {
functionType.namedParameterTypes = namedParameterTypes;
}
+ if (returnType2 == null) {
+ functionType.returnType = _dynamicType;
+ } else {
+ functionType.returnType = returnType2.type;
+ }
}
}
/**
- * Instances of the class `ClassScope` implement the scope defined by a class.
+ * Instances of the class {@code ClassScope} implement the scope defined by a class.
* @coverage dart.engine.resolver
*/
class ClassScope extends EnclosedScope {
@@ -8761,7 +8558,7 @@
}
}
/**
- * Instances of the class `EnclosedScope` implement a scope that is lexically enclosed in
+ * Instances of the class {@code EnclosedScope} implement a scope that is lexically enclosed in
* another scope.
* @coverage dart.engine.resolver
*/
@@ -8796,7 +8593,7 @@
}
}
/**
- * Instances of the class `FunctionScope` implement the scope defined by a function.
+ * Instances of the class {@code FunctionScope} implement the scope defined by a function.
* @coverage dart.engine.resolver
*/
class FunctionScope extends EnclosedScope {
@@ -8823,14 +8620,14 @@
}
}
for (ParameterElement parameter in functionElement.parameters) {
- if (!parameter.isInitializingFormal) {
+ if (!parameter.isInitializingFormal()) {
parameterScope.define(parameter);
}
}
}
}
/**
- * Instances of the class `FunctionTypeScope` implement the scope defined by a function type
+ * Instances of the class {@code FunctionTypeScope} implement the scope defined by a function type
* alias.
* @coverage dart.engine.resolver
*/
@@ -8868,7 +8665,7 @@
}
}
/**
- * Instances of the class `LabelScope` represent a scope in which a single label is defined.
+ * Instances of the class {@code LabelScope} represent a scope in which a single label is defined.
* @coverage dart.engine.resolver
*/
class LabelScope {
@@ -8889,26 +8686,26 @@
LabelElement _element;
/**
- * The marker used to look up a label element for an unlabeled `break` or `continue`.
+ * The marker used to look up a label element for an unlabeled {@code break} or {@code continue}.
*/
static String EMPTY_LABEL = "";
/**
- * The label element returned for scopes that can be the target of an unlabeled `break` or`continue`.
+ * The label element returned for scopes that can be the target of an unlabeled {@code break} or{@code continue}.
*/
static SimpleIdentifier _EMPTY_LABEL_IDENTIFIER = new SimpleIdentifier.full(new sc.StringToken(sc.TokenType.IDENTIFIER, "", 0));
/**
- * Initialize a newly created scope to represent the potential target of an unlabeled`break` or `continue`.
+ * Initialize a newly created scope to represent the potential target of an unlabeled{@code break} or {@code continue}.
* @param outerScope the label scope enclosing the new label scope
- * @param onSwitchStatement `true` if this label is associated with a `switch`statement
- * @param onSwitchMember `true` if this label is associated with a `switch` member
+ * @param onSwitchStatement {@code true} if this label is associated with a {@code switch}statement
+ * @param onSwitchMember {@code true} if this label is associated with a {@code switch} member
*/
LabelScope.con1(LabelScope outerScope, bool onSwitchStatement, bool onSwitchMember) {
- _jtd_constructor_288_impl(outerScope, onSwitchStatement, onSwitchMember);
+ _jtd_constructor_287_impl(outerScope, onSwitchStatement, onSwitchMember);
}
- _jtd_constructor_288_impl(LabelScope outerScope, bool onSwitchStatement, bool onSwitchMember) {
- _jtd_constructor_289_impl(outerScope, EMPTY_LABEL, new LabelElementImpl(_EMPTY_LABEL_IDENTIFIER, onSwitchStatement, onSwitchMember));
+ _jtd_constructor_287_impl(LabelScope outerScope, bool onSwitchStatement, bool onSwitchMember) {
+ _jtd_constructor_288_impl(outerScope, EMPTY_LABEL, new LabelElementImpl(_EMPTY_LABEL_IDENTIFIER, onSwitchStatement, onSwitchMember));
}
/**
@@ -8918,16 +8715,16 @@
* @param element the element to which the label resolves
*/
LabelScope.con2(LabelScope outerScope2, String label2, LabelElement element2) {
- _jtd_constructor_289_impl(outerScope2, label2, element2);
+ _jtd_constructor_288_impl(outerScope2, label2, element2);
}
- _jtd_constructor_289_impl(LabelScope outerScope2, String label2, LabelElement element2) {
+ _jtd_constructor_288_impl(LabelScope outerScope2, String label2, LabelElement element2) {
this._outerScope = outerScope2;
this._label = label2;
this._element = element2;
}
/**
- * Return the label element corresponding to the given label, or `null` if the given label
+ * Return the label element corresponding to the given label, or {@code null} if the given label
* is not defined in this scope.
* @param targetLabel the label being looked up
* @return the label element corresponding to the given label
@@ -8935,7 +8732,7 @@
LabelElement lookup(SimpleIdentifier targetLabel) => lookup2(targetLabel.name);
/**
- * Return the label element corresponding to the given label, or `null` if the given label
+ * Return the label element corresponding to the given label, or {@code null} if the given label
* is not defined in this scope.
* @param targetLabel the label being looked up
* @return the label element corresponding to the given label
@@ -8951,14 +8748,14 @@
}
}
/**
- * Instances of the class `LibraryImportScope` represent the scope containing all of the names
+ * Instances of the class {@code LibraryImportScope} represent the scope containing all of the names
* available from imported libraries.
* @coverage dart.engine.resolver
*/
class LibraryImportScope extends Scope {
/**
- * @return `true` if the given [Identifier] is the part of type annotation.
+ * @return {@code true} if the given {@link Identifier} is the part of type annotation.
*/
static bool isTypeAnnotation(Identifier identifier) {
ASTNode parent = identifier.parent;
@@ -9087,7 +8884,7 @@
}
}
/**
- * Instances of the class `LibraryScope` implement a scope containing all of the names defined
+ * Instances of the class {@code LibraryScope} implement a scope containing all of the names defined
* in a given library.
* @coverage dart.engine.resolver
*/
@@ -9106,7 +8903,7 @@
int offset = duplicate.nameOffset;
if (duplicate is PropertyAccessorElement) {
PropertyAccessorElement accessor = duplicate as PropertyAccessorElement;
- if (accessor.isSynthetic) {
+ if (accessor.isSynthetic()) {
offset = accessor.variable.nameOffset;
}
}
@@ -9152,7 +8949,7 @@
}
}
/**
- * Instances of the class `Namespace` implement a mapping of identifiers to the elements
+ * Instances of the class {@code Namespace} implement a mapping of identifiers to the elements
* represented by those identifiers. Namespaces are the building blocks for scopes.
* @coverage dart.engine.resolver
*/
@@ -9193,14 +8990,14 @@
Map<String, Element> get definedNames => new Map<String, Element>.from(_definedNames);
}
/**
- * Instances of the class `NamespaceBuilder` are used to build a `Namespace`. Namespace
+ * Instances of the class {@code NamespaceBuilder} are used to build a {@code Namespace}. Namespace
* builders are thread-safe and re-usable.
* @coverage dart.engine.resolver
*/
class NamespaceBuilder {
/**
- * Create a namespace representing the export namespace of the given [ExportElement].
+ * Create a namespace representing the export namespace of the given {@link ExportElement}.
* @param element the export element whose export namespace is to be created
* @return the export namespace that was created
*/
@@ -9405,7 +9202,7 @@
}
}
/**
- * The abstract class `Scope` defines the behavior common to name scopes used by the resolver
+ * The abstract class {@code Scope} defines the behavior common to name scopes used by the resolver
* to determine which names are visible at any given point in the code.
* @coverage dart.engine.resolver
*/
@@ -9429,9 +9226,9 @@
static String UNARY_MINUS = "unary-";
/**
- * Return `true` if the given name is a library-private name.
+ * Return {@code true} if the given name is a library-private name.
* @param name the name being tested
- * @return `true` if the given name is a library-private name
+ * @return {@code true} if the given name is a library-private name
*/
static bool isPrivateName(String name) => name != null && name.startsWith(PRIVATE_NAME_PREFIX);
@@ -9460,7 +9257,7 @@
}
/**
- * Return the element with which the given identifier is associated, or `null` if the name
+ * Return the element with which the given identifier is associated, or {@code null} if the name
* is not defined within this scope.
* @param identifier the identifier associated with the element to be returned
* @param referencingLibrary the library that contains the reference to the name, used to
@@ -9521,7 +9318,7 @@
Source get source => definingLibrary.definingCompilationUnit.source;
/**
- * Return the element with which the given name is associated, or `null` if the name is not
+ * Return the element with which the given name is associated, or {@code null} if the name is not
* defined within this scope. This method only returns elements that are directly defined within
* this scope, not elements that are defined in an enclosing scope.
* @param name the name associated with the element to be returned
@@ -9532,7 +9329,7 @@
Element localLookup(String name, LibraryElement referencingLibrary) => _definedNames[name];
/**
- * Return the element with which the given name is associated, or `null` if the name is not
+ * Return the element with which the given name is associated, or {@code null} if the name is not
* defined within this scope.
* @param identifier the identifier node to lookup element for, used to report correct kind of a
* problem and associate problem with
@@ -9559,7 +9356,7 @@
}
}
/**
- * Instances of the class `ConstantVerifier` traverse an AST structure looking for additional
+ * Instances of the class {@code ConstantVerifier} traverse an AST structure looking for additional
* errors and warnings not covered by the parser and resolver. In particular, it looks for errors
* and warnings related to constant expressions.
* @coverage dart.engine.resolver
@@ -9606,7 +9403,6 @@
if (node.constKeyword != null) {
validateInitializers(node);
}
- validateDefaultValues(node.parameters);
return super.visitConstructorDeclaration(node);
}
Object visitFunctionExpression(FunctionExpression node) {
@@ -9680,7 +9476,7 @@
Object visitVariableDeclaration(VariableDeclaration node) {
super.visitVariableDeclaration(node);
Expression initializer = node.initializer;
- if (initializer != null && node.isConst) {
+ if (initializer != null && node.isConst()) {
VariableElementImpl element = node.element as VariableElementImpl;
EvaluationResultImpl result = element.evaluationResult;
if (result == null) {
@@ -9694,11 +9490,11 @@
}
/**
- * Return `true` if the given value is the result of evaluating an expression whose value is
+ * Return {@code true} if the given value is the result of evaluating an expression whose value is
* a valid key in a const map literal. Keys in const map literals must be either a string, number,
* boolean, list, map, or null.
* @param value
- * @return `true` if the given value is a valid key in a const map literal
+ * @return {@code true} if the given value is a valid key in a const map literal
*/
bool isValidConstMapKey(Object value) => true;
@@ -9723,7 +9519,7 @@
/**
* Validate that the given expression is a compile time constant. Return the value of the compile
- * time constant, or `null` if the expression is not a compile time constant.
+ * time constant, or {@code null} if the expression is not a compile time constant.
* @param expression the expression to be validated
* @param errorCode the error code to be used if the expression is not a compile time constant
* @return the value of the compile time constant
@@ -9740,7 +9536,7 @@
* @param node the instance creation evaluate
*/
void validateConstantArguments(InstanceCreationExpression node) {
- if (!node.isConst) {
+ if (!node.isConst()) {
return;
}
ArgumentList argumentList = node.argumentList;
@@ -9770,8 +9566,10 @@
Expression defaultValue = defaultParameter.defaultValue;
if (defaultValue != null) {
EvaluationResultImpl result = validate(defaultValue, CompileTimeErrorCode.NON_CONSTANT_DEFAULT_VALUE);
- VariableElementImpl element = parameter.element as VariableElementImpl;
- element.evaluationResult = result;
+ if (defaultParameter.isConst()) {
+ VariableElementImpl element = parameter.element as VariableElementImpl;
+ element.evaluationResult = result;
+ }
}
}
}
@@ -9837,7 +9635,7 @@
if (identical(parameterElement, element) && parameterElement != null) {
Type2 type = parameterElement.type;
if (type != null) {
- if (type.isDynamic) {
+ if (type.isDynamic()) {
return ValidResult.RESULT_DYNAMIC;
}
if (type.isSubtypeOf(ConstantVerifier_this._boolType)) {
@@ -9860,7 +9658,7 @@
}
}
/**
- * Instances of the class `ErrorVerifier` traverse an AST structure looking for additional
+ * Instances of the class {@code ErrorVerifier} traverse an AST structure looking for additional
* errors and warnings not covered by the parser and resolver.
* @coverage dart.engine.resolver
*/
@@ -9869,7 +9667,7 @@
/**
* Checks if the given expression is the reference to the type.
* @param expr the expression to evaluate
- * @return `true` if the given expression is the reference to the type
+ * @return {@code true} if the given expression is the reference to the type
*/
static bool isTypeReference(Expression expr) {
if (expr is Identifier) {
@@ -9911,47 +9709,47 @@
bool _strictMode = false;
/**
- * This is set to `true` iff the visitor is currently visiting children nodes of a[ConstructorDeclaration] and the constructor is 'const'.
+ * This is set to {@code true} iff the visitor is currently visiting children nodes of a{@link ConstructorDeclaration} and the constructor is 'const'.
* @see #visitConstructorDeclaration(ConstructorDeclaration)
*/
bool _isEnclosingConstructorConst = false;
/**
- * This is set to `true` iff the visitor is currently visiting children nodes of a[CatchClause].
+ * This is set to {@code true} iff the visitor is currently visiting children nodes of a{@link CatchClause}.
* @see #visitCatchClause(CatchClause)
*/
bool _isInCatchClause = false;
/**
- * This is set to `true` iff the visitor is currently visiting a[ConstructorInitializer].
+ * This is set to {@code true} iff the visitor is currently visiting a{@link ConstructorInitializer}.
*/
bool _isInConstructorInitializer = false;
/**
- * This is set to `true` iff the visitor is currently visiting code in the SDK.
+ * This is set to {@code true} iff the visitor is currently visiting code in the SDK.
*/
bool _isInSystemLibrary = false;
/**
- * The class containing the AST nodes being visited, or `null` if we are not in the scope of
+ * The class containing the AST nodes being visited, or {@code null} if we are not in the scope of
* a class.
*/
ClassElement _enclosingClass;
/**
- * The method or function that we are currently visiting, or `null` if we are not inside a
+ * The method or function that we are currently visiting, or {@code null} if we are not inside a
* method or function.
*/
ExecutableElement _enclosingFunction;
/**
* This map is initialized when visiting the contents of a class declaration. If the visitor is
- * not in an enclosing class declaration, then the map is set to `null`.
- *
- * When set the map maps the set of [FieldElement]s in the class to an[INIT_STATE#NOT_INIT] or [INIT_STATE#INIT_IN_DECLARATION]. <code>checkFor*</code>
- * methods, specifically [checkForAllFinalInitializedErrorCodes],
+ * not in an enclosing class declaration, then the map is set to {@code null}.
+ * <p>
+ * When set the map maps the set of {@link FieldElement}s in the class to an{@link INIT_STATE#NOT_INIT} or {@link INIT_STATE#INIT_IN_DECLARATION}. <code>checkFor*</code>
+ * methods, specifically {@link #checkForAllFinalInitializedErrorCodes(ConstructorDeclaration)},
* can make a copy of the map to compute error code states. <code>checkFor*</code> methods should
- * only ever make a copy, or read from this map after it has been set in[visitClassDeclaration].
+ * only ever make a copy, or read from this map after it has been set in{@link #visitClassDeclaration(ClassDeclaration)}.
* @see #visitClassDeclaration(ClassDeclaration)
* @see #checkForAllFinalInitializedErrorCodes(ConstructorDeclaration)
*/
@@ -9978,13 +9776,13 @@
Set<String> _namesForReferenceToDeclaredVariableInInitializer = new Set<String>();
/**
- * A list of types used by the [CompileTimeErrorCode#EXTENDS_DISALLOWED_CLASS] and[CompileTimeErrorCode#IMPLEMENTS_DISALLOWED_CLASS] error codes.
+ * A list of types used by the {@link CompileTimeErrorCode#EXTENDS_DISALLOWED_CLASS} and{@link CompileTimeErrorCode#IMPLEMENTS_DISALLOWED_CLASS} error codes.
*/
List<InterfaceType> _DISALLOWED_TYPES_TO_EXTEND_OR_IMPLEMENT;
ErrorVerifier(ErrorReporter errorReporter, LibraryElement currentLibrary, TypeProvider typeProvider, InheritanceManager inheritanceManager) {
this._errorReporter = errorReporter;
this._currentLibrary = currentLibrary;
- this._isInSystemLibrary = currentLibrary.source.isInSystemLibrary;
+ this._isInSystemLibrary = currentLibrary.source.isInSystemLibrary();
this._typeProvider = typeProvider;
this._inheritanceManager = inheritanceManager;
_strictMode = currentLibrary.context.analysisOptions.strictMode;
@@ -10038,7 +9836,6 @@
ExtendsClause extendsClause = node.extendsClause;
checkForBuiltInIdentifierAsName(node.name, CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_TYPE_NAME);
checkForMemberWithClassName();
- checkForNoDefaultSuperConstructorImplicit(node);
checkForAllMixinErrorCodes(withClause);
if (implementsClause != null || extendsClause != null) {
if (!checkForImplementsDisallowedClass(implementsClause) && !checkForExtendsDisallowedClass(extendsClause)) {
@@ -10052,7 +9849,7 @@
List<FieldElement> fieldElements = classElement.fields;
_initialFieldElementsMap = new Map<FieldElement, INIT_STATE>();
for (FieldElement fieldElement in fieldElements) {
- if (!fieldElement.isSynthetic) {
+ if (!fieldElement.isSynthetic()) {
_initialFieldElementsMap[fieldElement] = fieldElement.initializer == null ? INIT_STATE.NOT_INIT : INIT_STATE.INIT_IN_DECLARATION;
}
}
@@ -10124,16 +9921,10 @@
checkForExportInternalLibrary(node);
return super.visitExportDirective(node);
}
- Object visitExpressionFunctionBody(ExpressionFunctionBody node) {
- FunctionType functionType = _enclosingFunction == null ? null : _enclosingFunction.type;
- Type2 expectedReturnType = functionType == null ? DynamicTypeImpl.instance : functionType.returnType;
- checkForReturnOfInvalidType(node.expression, expectedReturnType);
- return super.visitExpressionFunctionBody(node);
- }
Object visitFieldDeclaration(FieldDeclaration node) {
- if (!node.isStatic) {
+ if (!node.isStatic()) {
VariableDeclarationList variables = node.fields;
- if (variables.isConst) {
+ if (variables.isConst()) {
_errorReporter.reportError4(CompileTimeErrorCode.CONST_INSTANCE_FIELD, variables.keyword, []);
}
}
@@ -10148,14 +9939,14 @@
ExecutableElement outerFunction = _enclosingFunction;
try {
SimpleIdentifier identifier = node.name;
- String methodName = "";
+ String methoName = "";
if (identifier != null) {
- methodName = identifier.name;
+ methoName = identifier.name;
}
_enclosingFunction = node.element;
- if (node.isSetter || node.isGetter) {
- checkForMismatchedAccessorTypes(node, methodName);
- if (node.isSetter) {
+ if (node.isSetter() || node.isGetter()) {
+ checkForMismatchedAccessorTypes(node, methoName);
+ if (node.isSetter()) {
FunctionExpression functionExpression = node.functionExpression;
if (functionExpression != null) {
checkForWrongNumberOfParametersForSetter(node.name, functionExpression.parameters);
@@ -10170,16 +9961,12 @@
}
}
Object visitFunctionExpression(FunctionExpression node) {
- if (node.parent is! FunctionDeclaration) {
- ExecutableElement outerFunction = _enclosingFunction;
- try {
- _enclosingFunction = node.element;
- return super.visitFunctionExpression(node);
- } finally {
- _enclosingFunction = outerFunction;
- }
- } else {
+ ExecutableElement outerFunction = _enclosingFunction;
+ try {
+ _enclosingFunction = node.element;
return super.visitFunctionExpression(node);
+ } finally {
+ _enclosingFunction = outerFunction;
}
}
Object visitFunctionTypeAlias(FunctionTypeAlias node) {
@@ -10207,7 +9994,7 @@
if (type is InterfaceType) {
InterfaceType interfaceType = type as InterfaceType;
checkForConstOrNewWithAbstractClass(node, typeName, interfaceType);
- if (node.isConst) {
+ if (node.isConst()) {
checkForConstWithNonConst(node);
checkForConstWithUndefinedConstructor(node);
checkForConstWithTypeParameters(node);
@@ -10253,17 +10040,17 @@
if (identifier != null) {
methoName = identifier.name;
}
- if (node.isSetter || node.isGetter) {
+ if (node.isSetter() || node.isGetter()) {
checkForMismatchedAccessorTypes(node, methoName);
checkForConflictingInstanceGetterAndSuperclassMember(node);
}
- if (node.isGetter) {
+ if (node.isGetter()) {
checkForConflictingStaticGetterAndInstanceSetter(node);
- } else if (node.isSetter) {
+ } else if (node.isSetter()) {
checkForWrongNumberOfParametersForSetter(node.name, node.parameters);
checkForNonVoidReturnTypeForSetter(node.returnType);
checkForConflictingStaticSetterAndInstanceMember(node);
- } else if (node.isOperator) {
+ } else if (node.isOperator()) {
checkForOptionalParameterInOperator(node);
checkForWrongNumberOfParametersForOperator(node);
checkForNonVoidReturnTypeForOperator(node);
@@ -10292,7 +10079,7 @@
return super.visitPrefixedIdentifier(node);
}
Object visitPrefixExpression(PrefixExpression node) {
- if (node.operator.type.isIncrementOperator) {
+ if (node.operator.type.isIncrementOperator()) {
checkForAssignmentToFinal2(node.operand);
}
return super.visitPrefixExpression(node);
@@ -10389,8 +10176,8 @@
/**
* This verifies that the passed constructor declaration does not violate any of the error codes
* relating to the initialization of fields in the enclosing class.
- * @param node the [ConstructorDeclaration] to evaluate
- * @return `true` if and only if an error code is generated on the passed node
+ * @param node the {@link ConstructorDeclaration} to evaluate
+ * @return {@code true} if and only if an error code is generated on the passed node
* @see #initialFieldElementsMap
* @see CompileTimeErrorCode#FINAL_INITIALIZED_IN_DECLARATION_AND_CONSTRUCTOR
* @see CompileTimeErrorCode#FINAL_INITIALIZED_MULTIPLE_TIMES
@@ -10413,12 +10200,12 @@
if (identical(state, INIT_STATE.NOT_INIT)) {
fieldElementsMap[fieldElement] = INIT_STATE.INIT_IN_FIELD_FORMAL;
} else if (identical(state, INIT_STATE.INIT_IN_DECLARATION)) {
- if (fieldElement.isFinal || fieldElement.isConst) {
+ if (fieldElement.isFinal() || fieldElement.isConst()) {
_errorReporter.reportError2(CompileTimeErrorCode.FINAL_INITIALIZED_IN_DECLARATION_AND_CONSTRUCTOR, formalParameter.identifier, [fieldElement.displayName]);
foundError = true;
}
} else if (identical(state, INIT_STATE.INIT_IN_FIELD_FORMAL)) {
- if (fieldElement.isFinal || fieldElement.isConst) {
+ if (fieldElement.isFinal() || fieldElement.isConst()) {
_errorReporter.reportError2(CompileTimeErrorCode.FINAL_INITIALIZED_MULTIPLE_TIMES, formalParameter.identifier, [fieldElement.displayName]);
foundError = true;
}
@@ -10437,7 +10224,7 @@
if (identical(state, INIT_STATE.NOT_INIT)) {
fieldElementsMap[fieldElement] = INIT_STATE.INIT_IN_INITIALIZERS;
} else if (identical(state, INIT_STATE.INIT_IN_DECLARATION)) {
- if (fieldElement.isFinal || fieldElement.isConst) {
+ if (fieldElement.isFinal() || fieldElement.isConst()) {
_errorReporter.reportError2(CompileTimeErrorCode.FIELD_INITIALIZED_IN_INITIALIZER_AND_DECLARATION, fieldName, []);
foundError = true;
}
@@ -10456,8 +10243,8 @@
/**
* This checks the passed method declaration against override-error codes.
- * @param node the [MethodDeclaration] to evaluate
- * @return `true` if and only if an error code is generated on the passed node
+ * @param node the {@link MethodDeclaration} to evaluate
+ * @return {@code true} if and only if an error code is generated on the passed node
* @see StaticWarningCode#INSTANCE_METHOD_NAME_COLLIDES_WITH_SUPERCLASS_STATIC
* @see CompileTimeErrorCode#INVALID_OVERRIDE_REQUIRED
* @see CompileTimeErrorCode#INVALID_OVERRIDE_POSITIONAL
@@ -10468,10 +10255,9 @@
* @see StaticWarningCode#INVALID_SETTER_OVERRIDE_NORMAL_PARAM_TYPE
* @see StaticWarningCode#INVALID_METHOD_OVERRIDE_OPTIONAL_PARAM_TYPE
* @see StaticWarningCode#INVALID_METHOD_OVERRIDE_NAMED_PARAM_TYPE
- * @see StaticWarningCode#INVALID_OVERRIDE_DIFFERENT_DEFAULT_VALUES
*/
bool checkForAllInvalidOverrideErrorCodes(MethodDeclaration node) {
- if (_enclosingClass == null || node.isStatic || node.body is NativeFunctionBody) {
+ if (_enclosingClass == null || node.isStatic() || node.body is NativeFunctionBody) {
return false;
}
ExecutableElement executableElement = node.element;
@@ -10479,13 +10265,13 @@
return false;
}
SimpleIdentifier methodName = node.name;
- if (methodName.isSynthetic) {
+ if (methodName.isSynthetic()) {
return false;
}
String methodNameStr = methodName.name;
ExecutableElement overriddenExecutable = _inheritanceManager.lookupInheritance(_enclosingClass, executableElement.name);
if (overriddenExecutable == null) {
- if (!node.isGetter && !node.isSetter && !node.isOperator) {
+ if (!node.isGetter() && !node.isSetter() && !node.isOperator()) {
Set<ClassElement> visitedClasses = new Set<ClassElement>();
InterfaceType superclassType = _enclosingClass.supertype;
ClassElement superclassElement = superclassType == null ? null : superclassType.element;
@@ -10493,21 +10279,21 @@
javaSetAdd(visitedClasses, superclassElement);
List<FieldElement> fieldElts = superclassElement.fields;
for (FieldElement fieldElt in fieldElts) {
- if (fieldElt.name == methodNameStr && fieldElt.isStatic) {
+ if (fieldElt.name == methodNameStr && fieldElt.isStatic()) {
_errorReporter.reportError2(StaticWarningCode.INSTANCE_METHOD_NAME_COLLIDES_WITH_SUPERCLASS_STATIC, methodName, [methodNameStr, fieldElt.enclosingElement.displayName]);
return true;
}
}
List<PropertyAccessorElement> propertyAccessorElts = superclassElement.accessors;
for (PropertyAccessorElement accessorElt in propertyAccessorElts) {
- if (accessorElt.name == methodNameStr && accessorElt.isStatic) {
+ if (accessorElt.name == methodNameStr && accessorElt.isStatic()) {
_errorReporter.reportError2(StaticWarningCode.INSTANCE_METHOD_NAME_COLLIDES_WITH_SUPERCLASS_STATIC, methodName, [methodNameStr, accessorElt.enclosingElement.displayName]);
return true;
}
}
List<MethodElement> methodElements = superclassElement.methods;
for (MethodElement methodElement in methodElements) {
- if (methodElement.name == methodNameStr && methodElement.isStatic) {
+ if (methodElement.name == methodNameStr && methodElement.isStatic()) {
_errorReporter.reportError2(StaticWarningCode.INSTANCE_METHOD_NAME_COLLIDES_WITH_SUPERCLASS_STATIC, methodName, [methodNameStr, methodElement.enclosingElement.displayName]);
return true;
}
@@ -10551,7 +10337,7 @@
}
}
if (overriddenFTReturnType != VoidTypeImpl.instance && !overridingFTReturnType.isAssignableTo(overriddenFTReturnType)) {
- _errorReporter.reportError2(!node.isGetter ? StaticWarningCode.INVALID_METHOD_OVERRIDE_RETURN_TYPE : StaticWarningCode.INVALID_GETTER_OVERRIDE_RETURN_TYPE, methodName, [overridingFTReturnType.displayName, overriddenFTReturnType.displayName, overriddenExecutable.enclosingElement.displayName]);
+ _errorReporter.reportError2(!node.isGetter() ? StaticWarningCode.INVALID_METHOD_OVERRIDE_RETURN_TYPE : StaticWarningCode.INVALID_GETTER_OVERRIDE_RETURN_TYPE, methodName, [overridingFTReturnType.displayName, overriddenFTReturnType.displayName, overriddenExecutable.enclosingElement.displayName]);
return true;
}
FormalParameterList formalParameterList = node.parameters;
@@ -10562,7 +10348,7 @@
int parameterIndex = 0;
for (int i = 0; i < overridingNormalPT.length; i++) {
if (!overridingNormalPT[i].isAssignableTo(overriddenNormalPT[i])) {
- _errorReporter.reportError2(!node.isSetter ? StaticWarningCode.INVALID_METHOD_OVERRIDE_NORMAL_PARAM_TYPE : StaticWarningCode.INVALID_SETTER_OVERRIDE_NORMAL_PARAM_TYPE, parameterNodeList[parameterIndex], [overridingNormalPT[i].displayName, overriddenNormalPT[i].displayName, overriddenExecutable.enclosingElement.displayName]);
+ _errorReporter.reportError2(!node.isSetter() ? StaticWarningCode.INVALID_METHOD_OVERRIDE_NORMAL_PARAM_TYPE : StaticWarningCode.INVALID_SETTER_OVERRIDE_NORMAL_PARAM_TYPE, parameterNodeList[parameterIndex], [overridingNormalPT[i].displayName, overriddenNormalPT[i].displayName, overriddenExecutable.enclosingElement.displayName]);
return true;
}
parameterIndex++;
@@ -10599,72 +10385,13 @@
}
}
}
- bool foundError = false;
- List<FormalParameter> formalParameters = new List<FormalParameter>();
- List<ParameterElementImpl> parameterElts = new List<ParameterElementImpl>();
- List<ParameterElementImpl> overriddenParameterElts = new List<ParameterElementImpl>();
- List<ParameterElement> overriddenPEs = overriddenExecutable.parameters;
- for (FormalParameter formalParameter in parameterNodeList) {
- if (formalParameter.kind.isOptional) {
- formalParameters.add(formalParameter);
- parameterElts.add((formalParameter.element as ParameterElementImpl));
- }
- }
- for (ParameterElement parameterElt in overriddenPEs) {
- if (parameterElt.parameterKind.isOptional) {
- overriddenParameterElts.add((parameterElt as ParameterElementImpl));
- }
- }
- if (parameterElts.length > 0) {
- if (identical(parameterElts[0].parameterKind, ParameterKind.NAMED)) {
- for (int i = 0; i < parameterElts.length; i++) {
- ParameterElementImpl parameterElt = parameterElts[i];
- EvaluationResultImpl result = parameterElt.evaluationResult;
- if (result == null || identical(result, ValidResult.RESULT_OBJECT)) {
- continue;
- }
- String parameterName = parameterElt.name;
- for (int j = 0; j < overriddenParameterElts.length; j++) {
- ParameterElementImpl overriddenParameterElt = overriddenParameterElts[j];
- String overriddenParameterName = overriddenParameterElt.name;
- if (parameterName != null && parameterName == overriddenParameterName) {
- EvaluationResultImpl overriddenResult = overriddenParameterElt.evaluationResult;
- if (overriddenResult == null || identical(result, ValidResult.RESULT_OBJECT)) {
- break;
- }
- if (!result.equalValues(overriddenResult)) {
- _errorReporter.reportError2(StaticWarningCode.INVALID_OVERRIDE_DIFFERENT_DEFAULT_VALUES_NAMED, formalParameters[i], [overriddenExecutable.enclosingElement.displayName, overriddenExecutable.displayName, parameterName]);
- foundError = true;
- }
- }
- }
- }
- } else {
- for (int i = 0; i < parameterElts.length && i < overriddenParameterElts.length; i++) {
- ParameterElementImpl parameterElt = parameterElts[i];
- EvaluationResultImpl result = parameterElt.evaluationResult;
- if (result == null || identical(result, ValidResult.RESULT_OBJECT)) {
- continue;
- }
- ParameterElementImpl overriddenParameterElt = overriddenParameterElts[i];
- EvaluationResultImpl overriddenResult = overriddenParameterElt.evaluationResult;
- if (overriddenResult == null || identical(result, ValidResult.RESULT_OBJECT)) {
- continue;
- }
- if (!result.equalValues(overriddenResult)) {
- _errorReporter.reportError2(StaticWarningCode.INVALID_OVERRIDE_DIFFERENT_DEFAULT_VALUES_POSITIONAL, formalParameters[i], [overriddenExecutable.enclosingElement.displayName, overriddenExecutable.displayName]);
- foundError = true;
- }
- }
- }
- }
- return foundError;
+ return false;
}
/**
* This verifies that all classes of the passed 'with' clause are valid.
* @param node the 'with' clause to evaluate
- * @return `true` if and only if an error code is generated on the passed node
+ * @return {@code true} if and only if an error code is generated on the passed node
* @see CompileTimeErrorCode#MIXIN_DECLARES_CONSTRUCTOR
* @see CompileTimeErrorCode#MIXIN_INHERITS_FROM_NOT_OBJECT
* @see CompileTimeErrorCode#MIXIN_REFERENCES_SUPER
@@ -10690,7 +10417,7 @@
/**
* This checks error related to the redirected constructors.
* @param node the constructor declaration to evaluate
- * @return `true` if and only if an error code is generated on the passed node
+ * @return {@code true} if and only if an error code is generated on the passed node
* @see StaticWarningCode#REDIRECT_TO_INVALID_RETURN_TYPE
* @see StaticWarningCode#REDIRECT_TO_INVALID_FUNCTION_TYPE
* @see StaticWarningCode#REDIRECT_TO_MISSING_CONSTRUCTOR
@@ -10732,15 +10459,15 @@
/**
* This checks that the return statement of the form <i>return e;</i> is not in a generative
* constructor.
- *
+ * <p>
* This checks that return statements without expressions are not in a generative constructor and
- * the return type is not assignable to `null`; that is, we don't have `return;` if
+ * the return type is not assignable to {@code null}; that is, we don't have {@code return;} if
* the enclosing method has a return type.
- *
+ * <p>
* This checks that the return type matches the type of the declared return type in the enclosing
* method or function.
* @param node the return statement to evaluate
- * @return `true` if and only if an error code is generated on the passed node
+ * @return {@code true} if and only if an error code is generated on the passed node
* @see CompileTimeErrorCode#RETURN_IN_GENERATIVE_CONSTRUCTOR
* @see StaticWarningCode#RETURN_WITHOUT_VALUE
* @see StaticTypeWarningCode#RETURN_OF_INVALID_TYPE
@@ -10749,7 +10476,7 @@
FunctionType functionType = _enclosingFunction == null ? null : _enclosingFunction.type;
Type2 expectedReturnType = functionType == null ? DynamicTypeImpl.instance : functionType.returnType;
Expression returnExpression = node.expression;
- bool isGenerativeConstructor = _enclosingFunction is ConstructorElement && !((_enclosingFunction as ConstructorElement)).isFactory;
+ bool isGenerativeConstructor = _enclosingFunction is ConstructorElement && !((_enclosingFunction as ConstructorElement)).isFactory();
if (isGenerativeConstructor) {
if (returnExpression == null) {
return false;
@@ -10764,14 +10491,37 @@
_errorReporter.reportError2(StaticWarningCode.RETURN_WITHOUT_VALUE, node, []);
return true;
}
- return checkForReturnOfInvalidType(returnExpression, expectedReturnType);
+ Type2 staticReturnType = getStaticType(returnExpression);
+ if (expectedReturnType.isVoid()) {
+ if (staticReturnType.isVoid() || staticReturnType.isDynamic() || identical(staticReturnType, BottomTypeImpl.instance)) {
+ return false;
+ }
+ _errorReporter.reportError2(StaticTypeWarningCode.RETURN_OF_INVALID_TYPE, returnExpression, [staticReturnType.displayName, expectedReturnType.displayName, _enclosingFunction.displayName]);
+ return true;
+ }
+ bool isStaticAssignable = staticReturnType.isAssignableTo(expectedReturnType);
+ Type2 propagatedReturnType = getPropagatedType(returnExpression);
+ if (_strictMode || propagatedReturnType == null) {
+ if (isStaticAssignable) {
+ return false;
+ }
+ _errorReporter.reportError2(StaticTypeWarningCode.RETURN_OF_INVALID_TYPE, returnExpression, [staticReturnType.displayName, expectedReturnType.displayName, _enclosingFunction.displayName]);
+ return true;
+ } else {
+ bool isPropagatedAssignable = propagatedReturnType.isAssignableTo(expectedReturnType);
+ if (isStaticAssignable || isPropagatedAssignable) {
+ return false;
+ }
+ _errorReporter.reportError2(StaticTypeWarningCode.RETURN_OF_INVALID_TYPE, returnExpression, [staticReturnType.displayName, expectedReturnType.displayName, _enclosingFunction.displayName]);
+ return true;
+ }
}
/**
* This verifies that the export namespace of the passed export directive does not export any name
* already exported by other export directive.
* @param node the export directive node to report problem on
- * @return `true` if and only if an error code is generated on the passed node
+ * @return {@code true} if and only if an error code is generated on the passed node
* @see CompileTimeErrorCode#AMBIGUOUS_EXPORT
*/
bool checkForAmbiguousExport(ExportDirective node) {
@@ -10799,8 +10549,8 @@
/**
* This verifies that the passed argument definition test identifier is a parameter.
- * @param node the [ArgumentDefinitionTest] to evaluate
- * @return `true` if and only if an error code is generated on the passed node
+ * @param node the {@link ArgumentDefinitionTest} to evaluate
+ * @return {@code true} if and only if an error code is generated on the passed node
* @see CompileTimeErrorCode#ARGUMENT_DEFINITION_TEST_NON_PARAMETER
*/
bool checkForArgumentDefinitionTestNonParameter(ArgumentDefinitionTest node) {
@@ -10816,7 +10566,7 @@
/**
* This verifies that the passed arguments can be assigned to their corresponding parameters.
* @param node the arguments to evaluate
- * @return `true` if and only if an error code is generated on the passed node
+ * @return {@code true} if and only if an error code is generated on the passed node
* @see StaticWarningCode#ARGUMENT_TYPE_NOT_ASSIGNABLE
*/
bool checkForArgumentTypeNotAssignable(ArgumentList argumentList) {
@@ -10833,7 +10583,7 @@
/**
* This verifies that the passed argument can be assigned to their corresponding parameters.
* @param node the argument to evaluate
- * @return `true` if and only if an error code is generated on the passed node
+ * @return {@code true} if and only if an error code is generated on the passed node
* @see StaticWarningCode#ARGUMENT_TYPE_NOT_ASSIGNABLE
*/
bool checkForArgumentTypeNotAssignable2(Expression argument) {
@@ -10873,7 +10623,7 @@
/**
* This verifies that left hand side of the passed assignment expression is not final.
* @param node the assignment expression to evaluate
- * @return `true` if and only if an error code is generated on the passed node
+ * @return {@code true} if and only if an error code is generated on the passed node
* @see StaticWarningCode#ASSIGNMENT_TO_FINAL
*/
bool checkForAssignmentToFinal(AssignmentExpression node) {
@@ -10884,7 +10634,7 @@
/**
* This verifies that the passed expression is not final.
* @param node the expression to evaluate
- * @return `true` if and only if an error code is generated on the passed node
+ * @return {@code true} if and only if an error code is generated on the passed node
* @see StaticWarningCode#ASSIGNMENT_TO_FINAL
*/
bool checkForAssignmentToFinal2(Expression expression) {
@@ -10897,7 +10647,7 @@
}
if (element is VariableElement) {
VariableElement leftVar = element as VariableElement;
- if (leftVar.isFinal) {
+ if (leftVar.isFinal()) {
_errorReporter.reportError2(StaticWarningCode.ASSIGNMENT_TO_FINAL, expression, []);
return true;
}
@@ -10905,7 +10655,7 @@
}
if (element is PropertyAccessorElement) {
PropertyAccessorElement leftAccessor = element as PropertyAccessorElement;
- if (!leftAccessor.isSetter) {
+ if (!leftAccessor.isSetter()) {
_errorReporter.reportError2(StaticWarningCode.ASSIGNMENT_TO_FINAL, expression, []);
return true;
}
@@ -10919,8 +10669,8 @@
* on the identifier if it is a keyword.
* @param identifier the identifier to check to ensure that it is not a keyword
* @param errorCode if the passed identifier is a keyword then this error code is created on the
- * identifier, the error code will be one of[CompileTimeErrorCode#BUILT_IN_IDENTIFIER_AS_TYPE_NAME],[CompileTimeErrorCode#BUILT_IN_IDENTIFIER_AS_TYPE_VARIABLE_NAME] or[CompileTimeErrorCode#BUILT_IN_IDENTIFIER_AS_TYPEDEF_NAME]
- * @return `true` if and only if an error code is generated on the passed node
+ * identifier, the error code will be one of{@link CompileTimeErrorCode#BUILT_IN_IDENTIFIER_AS_TYPE_NAME},{@link CompileTimeErrorCode#BUILT_IN_IDENTIFIER_AS_TYPE_VARIABLE_NAME} or{@link CompileTimeErrorCode#BUILT_IN_IDENTIFIER_AS_TYPEDEF_NAME}
+ * @return {@code true} if and only if an error code is generated on the passed node
* @see CompileTimeErrorCode#BUILT_IN_IDENTIFIER_AS_TYPE_NAME
* @see CompileTimeErrorCode#BUILT_IN_IDENTIFIER_AS_TYPE_VARIABLE_NAME
* @see CompileTimeErrorCode#BUILT_IN_IDENTIFIER_AS_TYPEDEF_NAME
@@ -10937,7 +10687,7 @@
/**
* This verifies that the passed variable declaration list does not have a built-in identifier.
* @param node the variable declaration list to check
- * @return `true` if and only if an error code is generated on the passed node
+ * @return {@code true} if and only if an error code is generated on the passed node
* @see CompileTimeErrorCode#BUILT_IN_IDENTIFIER_AS_TYPE
*/
bool checkForBuiltInIdentifierAsName2(VariableDeclarationList node) {
@@ -10962,7 +10712,7 @@
* This verifies that the given switch case is terminated with 'break', 'continue', 'return' or
* 'throw'.
* @param node the switch case to evaluate
- * @return `true` if and only if an error code is generated on the passed node
+ * @return {@code true} if and only if an error code is generated on the passed node
* @see StaticWarningCode#CASE_BLOCK_NOT_TERMINATED
*/
bool checkForCaseBlockNotTerminated(SwitchCase node) {
@@ -10997,7 +10747,7 @@
* This verifies that the switch cases in the given switch statement is terminated with 'break',
* 'continue', 'return' or 'throw'.
* @param node the switch statement containing the cases to be checked
- * @return `true` if and only if an error code is generated on the passed node
+ * @return {@code true} if and only if an error code is generated on the passed node
* @see StaticWarningCode#CASE_BLOCK_NOT_TERMINATED
*/
bool checkForCaseBlocksNotTerminated(SwitchStatement node) {
@@ -11017,7 +10767,7 @@
* This verifies that the passed switch statement does not have a case expression with the
* operator '==' overridden.
* @param node the switch statement to evaluate
- * @return `true` if and only if an error code is generated on the passed node
+ * @return {@code true} if and only if an error code is generated on the passed node
* @see CompileTimeErrorCode#CASE_EXPRESSION_TYPE_IMPLEMENTS_EQUALS
*/
bool checkForCaseExpressionTypeImplementsEquals(SwitchStatement node) {
@@ -11041,11 +10791,11 @@
* This verifies that the passed method declaration is abstract only if the enclosing class is
* also abstract.
* @param node the method declaration to evaluate
- * @return `true` if and only if an error code is generated on the passed node
+ * @return {@code true} if and only if an error code is generated on the passed node
* @see StaticWarningCode#CONCRETE_CLASS_WITH_ABSTRACT_MEMBER
*/
bool checkForConcreteClassWithAbstractMember(MethodDeclaration node) {
- if (node.isAbstract && _enclosingClass != null && !_enclosingClass.isAbstract) {
+ if (node.isAbstract() && _enclosingClass != null && !_enclosingClass.isAbstract()) {
SimpleIdentifier methodName = node.name;
_errorReporter.reportError2(StaticWarningCode.CONCRETE_CLASS_WITH_ABSTRACT_MEMBER, methodName, [methodName.name, _enclosingClass.displayName]);
return true;
@@ -11057,7 +10807,7 @@
* This verifies all possible conflicts of the constructor name with other constructors and
* members of the same class.
* @param node the constructor declaration to evaluate
- * @return `true` if and only if an error code is generated on the passed node
+ * @return {@code true} if and only if an error code is generated on the passed node
* @see CompileTimeErrorCode#DUPLICATE_CONSTRUCTOR_DEFAULT
* @see CompileTimeErrorCode#DUPLICATE_CONSTRUCTOR_NAME
* @see CompileTimeErrorCode#CONFLICTING_CONSTRUCTOR_NAME_AND_FIELD
@@ -11082,7 +10832,7 @@
return true;
}
}
- if (constructorName != null && constructorElement != null && !constructorName.isSynthetic) {
+ if (constructorName != null && constructorElement != null && !constructorName.isSynthetic()) {
List<FieldElement> fields = classElement.fields;
for (FieldElement field in fields) {
if (field.name == name) {
@@ -11105,12 +10855,12 @@
* This verifies that the superclass of the enclosing class does not declare accessible static
* member with the same name as the passed instance getter/setter method declaration.
* @param node the method declaration to evaluate
- * @return `true` if and only if an error code is generated on the passed node
+ * @return {@code true} if and only if an error code is generated on the passed node
* @see StaticWarningCode#CONFLICTING_INSTANCE_GETTER_AND_SUPERCLASS_MEMBER
* @see StaticWarningCode#CONFLICTING_INSTANCE_SETTER_AND_SUPERCLASS_MEMBER
*/
bool checkForConflictingInstanceGetterAndSuperclassMember(MethodDeclaration node) {
- if (node.isStatic) {
+ if (node.isStatic()) {
return false;
}
SimpleIdentifier nameNode = node.name;
@@ -11133,12 +10883,12 @@
if (superElement == null) {
return false;
}
- if (!superElement.isStatic) {
+ if (!superElement.isStatic()) {
return false;
}
ClassElement superElementClass = superElement.enclosingElement as ClassElement;
InterfaceType superElementType = superElementClass.type;
- if (node.isGetter) {
+ if (node.isGetter()) {
_errorReporter.reportError2(StaticWarningCode.CONFLICTING_INSTANCE_GETTER_AND_SUPERCLASS_MEMBER, nameNode, [superElementType.displayName]);
} else {
_errorReporter.reportError2(StaticWarningCode.CONFLICTING_INSTANCE_SETTER_AND_SUPERCLASS_MEMBER, nameNode, [superElementType.displayName]);
@@ -11150,11 +10900,11 @@
* This verifies that the enclosing class does not have an instance member with the same name as
* the passed static getter method declaration.
* @param node the method declaration to evaluate
- * @return `true` if and only if an error code is generated on the passed node
+ * @return {@code true} if and only if an error code is generated on the passed node
* @see StaticWarningCode#CONFLICTING_STATIC_GETTER_AND_INSTANCE_SETTER
*/
bool checkForConflictingStaticGetterAndInstanceSetter(MethodDeclaration node) {
- if (!node.isStatic) {
+ if (!node.isStatic()) {
return false;
}
SimpleIdentifier nameNode = node.name;
@@ -11170,7 +10920,7 @@
if (setter == null) {
return false;
}
- if (setter.isStatic) {
+ if (setter.isStatic()) {
return false;
}
ClassElement setterClass = setter.enclosingElement as ClassElement;
@@ -11183,11 +10933,11 @@
* This verifies that the enclosing class does not have an instance member with the same name as
* the passed static getter method declaration.
* @param node the method declaration to evaluate
- * @return `true` if and only if an error code is generated on the passed node
+ * @return {@code true} if and only if an error code is generated on the passed node
* @see StaticWarningCode#CONFLICTING_STATIC_SETTER_AND_INSTANCE_MEMBER
*/
bool checkForConflictingStaticSetterAndInstanceMember(MethodDeclaration node) {
- if (!node.isStatic) {
+ if (!node.isStatic()) {
return false;
}
SimpleIdentifier nameNode = node.name;
@@ -11210,7 +10960,7 @@
if (member == null) {
return false;
}
- if (member.isStatic) {
+ if (member.isStatic()) {
return false;
}
ClassElement memberClass = member.enclosingElement as ClassElement;
@@ -11223,7 +10973,7 @@
* This verifies that the passed constructor declaration is 'const' then there are no non-final
* instance variable.
* @param node the constructor declaration to evaluate
- * @return `true` if and only if an error code is generated on the passed node
+ * @return {@code true} if and only if an error code is generated on the passed node
* @see CompileTimeErrorCode#CONST_CONSTRUCTOR_WITH_NON_FINAL_FIELD
*/
bool checkForConstConstructorWithNonFinalField(ConstructorDeclaration node) {
@@ -11243,7 +10993,7 @@
* This verifies that the passed throw expression is not enclosed in a 'const' constructor
* declaration.
* @param node the throw expression expression to evaluate
- * @return `true` if and only if an error code is generated on the passed node
+ * @return {@code true} if and only if an error code is generated on the passed node
* @see CompileTimeErrorCode#CONST_CONSTRUCTOR_THROWS_EXCEPTION
*/
bool checkForConstEvalThrowsException(ThrowExpression node) {
@@ -11257,11 +11007,11 @@
/**
* This verifies that the passed normal formal parameter is not 'const'.
* @param node the normal formal parameter to evaluate
- * @return `true` if and only if an error code is generated on the passed node
+ * @return {@code true} if and only if an error code is generated on the passed node
* @see CompileTimeErrorCode#CONST_FORMAL_PARAMETER
*/
bool checkForConstFormalParameter(NormalFormalParameter node) {
- if (node.isConst) {
+ if (node.isConst()) {
_errorReporter.reportError2(CompileTimeErrorCode.CONST_FORMAL_PARAMETER, node, []);
return true;
}
@@ -11272,16 +11022,16 @@
* This verifies that the passed instance creation expression is not being invoked on an abstract
* class.
* @param node the instance creation expression to evaluate
- * @param typeName the [TypeName] of the [ConstructorName] from the[InstanceCreationExpression], this is the AST node that the error is attached to
- * @param type the type being constructed with this [InstanceCreationExpression]
- * @return `true` if and only if an error code is generated on the passed node
+ * @param typeName the {@link TypeName} of the {@link ConstructorName} from the{@link InstanceCreationExpression}, this is the AST node that the error is attached to
+ * @param type the type being constructed with this {@link InstanceCreationExpression}
+ * @return {@code true} if and only if an error code is generated on the passed node
* @see StaticWarningCode#CONST_WITH_ABSTRACT_CLASS
* @see StaticWarningCode#NEW_WITH_ABSTRACT_CLASS
*/
bool checkForConstOrNewWithAbstractClass(InstanceCreationExpression node, TypeName typeName, InterfaceType type) {
- if (type.element.isAbstract) {
+ if (type.element.isAbstract()) {
ConstructorElement element = node.element;
- if (element != null && !element.isFactory) {
+ if (element != null && !element.isFactory()) {
if (identical(((node.keyword as sc.KeywordToken)).keyword, sc.Keyword.CONST)) {
_errorReporter.reportError2(StaticWarningCode.CONST_WITH_ABSTRACT_CLASS, typeName, []);
} else {
@@ -11296,15 +11046,15 @@
/**
* This verifies that the passed 'const' instance creation expression is not being invoked on a
* constructor that is not 'const'.
- *
+ * <p>
* This method assumes that the instance creation was tested to be 'const' before being called.
* @param node the instance creation expression to evaluate
- * @return `true` if and only if an error code is generated on the passed node
+ * @return {@code true} if and only if an error code is generated on the passed node
* @see CompileTimeErrorCode#CONST_WITH_NON_CONST
*/
bool checkForConstWithNonConst(InstanceCreationExpression node) {
ConstructorElement constructorElement = node.element;
- if (constructorElement != null && !constructorElement.isConst) {
+ if (constructorElement != null && !constructorElement.isConst()) {
_errorReporter.reportError2(CompileTimeErrorCode.CONST_WITH_NON_CONST, node, []);
return true;
}
@@ -11314,10 +11064,10 @@
/**
* This verifies that the passed 'const' instance creation expression does not reference any type
* parameters.
- *
+ * <p>
* This method assumes that the instance creation was tested to be 'const' before being called.
* @param node the instance creation expression to evaluate
- * @return `true` if and only if an error code is generated on the passed node
+ * @return {@code true} if and only if an error code is generated on the passed node
* @see CompileTimeErrorCode#CONST_WITH_TYPE_PARAMETERS
*/
bool checkForConstWithTypeParameters(InstanceCreationExpression node) {
@@ -11332,7 +11082,7 @@
/**
* This verifies that the passed type name does not reference any type parameters.
* @param typeName the type name to evaluate
- * @return `true` if and only if an error code is generated on the passed node
+ * @return {@code true} if and only if an error code is generated on the passed node
* @see CompileTimeErrorCode#CONST_WITH_TYPE_PARAMETERS
*/
bool checkForConstWithTypeParameters2(TypeName typeName) {
@@ -11360,10 +11110,10 @@
/**
* This verifies that if the passed 'const' instance creation expression is being invoked on the
* resolved constructor.
- *
+ * <p>
* This method assumes that the instance creation was tested to be 'const' before being called.
* @param node the instance creation expression to evaluate
- * @return `true` if and only if an error code is generated on the passed node
+ * @return {@code true} if and only if an error code is generated on the passed node
* @see CompileTimeErrorCode#CONST_WITH_UNDEFINED_CONSTRUCTOR
* @see CompileTimeErrorCode#CONST_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT
*/
@@ -11392,7 +11142,7 @@
/**
* This verifies that there are no default parameters in the passed function type alias.
* @param node the function type alias to evaluate
- * @return `true` if and only if an error code is generated on the passed node
+ * @return {@code true} if and only if an error code is generated on the passed node
* @see CompileTimeErrorCode#DEFAULT_VALUE_IN_FUNCTION_TYPE_ALIAS
*/
bool checkForDefaultValueInFunctionTypeAlias(FunctionTypeAlias node) {
@@ -11414,7 +11164,7 @@
/**
* This verifies the passed import has unique name among other exported libraries.
* @param node the export directive to evaluate
- * @return `true` if and only if an error code is generated on the passed node
+ * @return {@code true} if and only if an error code is generated on the passed node
* @see CompileTimeErrorCode#EXPORT_DUPLICATED_LIBRARY_NAME
*/
bool checkForExportDuplicateLibraryName(ExportDirective node) {
@@ -11444,7 +11194,7 @@
* Check that if the visiting library is not system, then any passed library should not be SDK
* internal library.
* @param node the export directive to evaluate
- * @return `true` if and only if an error code is generated on the passed node
+ * @return {@code true} if and only if an error code is generated on the passed node
* @see CompileTimeErrorCode#EXPORT_INTERNAL_LIBRARY
*/
bool checkForExportInternalLibrary(ExportDirective node) {
@@ -11462,7 +11212,7 @@
if (sdkLibrary == null) {
return false;
}
- if (!sdkLibrary.isInternal) {
+ if (!sdkLibrary.isInternal()) {
return false;
}
_errorReporter.reportError2(CompileTimeErrorCode.EXPORT_INTERNAL_LIBRARY, node, [node.uri]);
@@ -11472,7 +11222,7 @@
/**
* This verifies that the passed extends clause does not extend classes such as num or String.
* @param node the extends clause to test
- * @return `true` if and only if an error code is generated on the passed node
+ * @return {@code true} if and only if an error code is generated on the passed node
* @see CompileTimeErrorCode#EXTENDS_DISALLOWED_CLASS
*/
bool checkForExtendsDisallowedClass(ExtendsClause extendsClause) {
@@ -11486,14 +11236,14 @@
* This verifies that the passed type name does not extend or implement classes such as 'num' or
* 'String'.
* @param node the type name to test
- * @return `true` if and only if an error code is generated on the passed node
+ * @return {@code true} if and only if an error code is generated on the passed node
* @see #checkForExtendsDisallowedClass(ExtendsClause)
* @see #checkForImplementsDisallowedClass(ImplementsClause)
* @see CompileTimeErrorCode#EXTENDS_DISALLOWED_CLASS
* @see CompileTimeErrorCode#IMPLEMENTS_DISALLOWED_CLASS
*/
bool checkForExtendsOrImplementsDisallowedClass(TypeName typeName, ErrorCode errorCode) {
- if (typeName.isSynthetic) {
+ if (typeName.isSynthetic()) {
return false;
}
Type2 superType = typeName.type;
@@ -11520,7 +11270,7 @@
* This verifies that the passed constructor field initializer has compatible field and
* initializer expression types.
* @param node the constructor field initializer to test
- * @return `true` if and only if an error code is generated on the passed node
+ * @return {@code true} if and only if an error code is generated on the passed node
* @see CompileTimeErrorCode#CONST_FIELD_INITIALIZER_NOT_ASSIGNABLE
* @see StaticWarningCode#FIELD_INITIALIZER_NOT_ASSIGNABLE
*/
@@ -11564,7 +11314,7 @@
/**
* This verifies that the passed field formal parameter is in a constructor declaration.
* @param node the field formal parameter to test
- * @return `true` if and only if an error code is generated on the passed node
+ * @return {@code true} if and only if an error code is generated on the passed node
* @see CompileTimeErrorCode#FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR
*/
bool checkForFieldInitializingFormalRedirectingConstructor(FieldFormalParameter node) {
@@ -11589,9 +11339,9 @@
/**
* This verifies that final fields that are declared, without any constructors in the enclosing
* class, are initialized. Cases in which there is at least one constructor are handled at the end
- * of [checkForAllFinalInitializedErrorCodes].
+ * of {@link #checkForAllFinalInitializedErrorCodes(ConstructorDeclaration)}.
* @param node the class declaration to test
- * @return `true` if and only if an error code is generated on the passed node
+ * @return {@code true} if and only if an error code is generated on the passed node
* @see CompileTimeErrorCode#FINAL_NOT_INITIALIZED
*/
bool checkForFinalNotInitialized(ClassDeclaration node) {
@@ -11613,14 +11363,14 @@
/**
* This verifies that the passed variable declaration list has only initialized variables if the
- * list is final or const. This method is called by[checkForFinalNotInitialized],[visitTopLevelVariableDeclaration] and[visitVariableDeclarationStatement].
+ * list is final or const. This method is called by{@link #checkForFinalNotInitialized(ClassDeclaration)},{@link #visitTopLevelVariableDeclaration(TopLevelVariableDeclaration)} and{@link #visitVariableDeclarationStatement(VariableDeclarationStatement)}.
* @param node the class declaration to test
- * @return `true` if and only if an error code is generated on the passed node
+ * @return {@code true} if and only if an error code is generated on the passed node
* @see CompileTimeErrorCode#FINAL_NOT_INITIALIZED
*/
bool checkForFinalNotInitialized2(VariableDeclarationList node) {
bool foundError = false;
- if (!node.isSynthetic && (node.isConst || node.isFinal)) {
+ if (!node.isSynthetic() && (node.isConst() || node.isFinal())) {
NodeList<VariableDeclaration> variables = node.variables;
for (VariableDeclaration variable in variables) {
if (variable.initializer == null) {
@@ -11636,7 +11386,7 @@
* This verifies that the passed implements clause does not implement classes such as 'num' or
* 'String'.
* @param node the implements clause to test
- * @return `true` if and only if an error code is generated on the passed node
+ * @return {@code true} if and only if an error code is generated on the passed node
* @see CompileTimeErrorCode#IMPLEMENTS_DISALLOWED_CLASS
*/
bool checkForImplementsDisallowedClass(ImplementsClause implementsClause) {
@@ -11654,7 +11404,7 @@
* This verifies that if the passed identifier is part of constructor initializer, then it does
* not reference implicitly 'this' expression.
* @param node the simple identifier to test
- * @return `true` if and only if an error code is generated on the passed node
+ * @return {@code true} if and only if an error code is generated on the passed node
* @see CompileTimeErrorCode#IMPLICIT_THIS_REFERENCE_IN_INITIALIZER
*/
bool checkForImplicitThisReferenceInInitializer(SimpleIdentifier node) {
@@ -11666,7 +11416,7 @@
return false;
}
ExecutableElement executableElement = element as ExecutableElement;
- if (executableElement.isStatic) {
+ if (executableElement.isStatic()) {
return false;
}
Element enclosingElement = element.enclosingElement;
@@ -11701,7 +11451,7 @@
/**
* This verifies the passed import has unique name among other imported libraries.
* @param node the import directive to evaluate
- * @return `true` if and only if an error code is generated on the passed node
+ * @return {@code true} if and only if an error code is generated on the passed node
* @see CompileTimeErrorCode#IMPORT_DUPLICATED_LIBRARY_NAME
*/
bool checkForImportDuplicateLibraryName(ImportDirective node) {
@@ -11731,7 +11481,7 @@
* Check that if the visiting library is not system, then any passed library should not be SDK
* internal library.
* @param node the import directive to evaluate
- * @return `true` if and only if an error code is generated on the passed node
+ * @return {@code true} if and only if an error code is generated on the passed node
* @see CompileTimeErrorCode#IMPORT_INTERNAL_LIBRARY
*/
bool checkForImportInternalLibrary(ImportDirective node) {
@@ -11749,7 +11499,7 @@
if (sdkLibrary == null) {
return false;
}
- if (!sdkLibrary.isInternal) {
+ if (!sdkLibrary.isInternal()) {
return false;
}
_errorReporter.reportError2(CompileTimeErrorCode.IMPORT_INTERNAL_LIBRARY, node, [node.uri]);
@@ -11759,7 +11509,7 @@
/**
* This verifies that the passed switch statement case expressions all have the same type.
* @param node the switch statement to evaluate
- * @return `true` if and only if an error code is generated on the passed node
+ * @return {@code true} if and only if an error code is generated on the passed node
* @see CompileTimeErrorCode#INCONSISTENT_CASE_EXPRESSION_TYPES
*/
bool checkForInconsistentCaseExpressionTypes(SwitchStatement node) {
@@ -11787,7 +11537,7 @@
/**
* For each class declaration, this method is called which verifies that all inherited members are
* inherited consistently.
- * @return `true` if and only if an error code is generated on the passed node
+ * @return {@code true} if and only if an error code is generated on the passed node
* @see StaticTypeWarningCode#INCONSISTENT_METHOD_INHERITANCE
*/
bool checkForInconsistentMethodInheritance() {
@@ -11806,7 +11556,7 @@
* Given an assignment using a compound assignment operator, this verifies that the given
* assignment is valid.
* @param node the assignment expression being tested
- * @return `true` if and only if an error code is generated on the passed node
+ * @return {@code true} if and only if an error code is generated on the passed node
* @see StaticTypeWarningCode#INVALID_ASSIGNMENT
*/
bool checkForInvalidAssignment(AssignmentExpression node) {
@@ -11835,7 +11585,7 @@
* This verifies that the passed left hand side and right hand side represent a valid assignment.
* @param lhs the left hand side expression
* @param rhs the right hand side expression
- * @return `true` if and only if an error code is generated on the passed node
+ * @return {@code true} if and only if an error code is generated on the passed node
* @see StaticTypeWarningCode#INVALID_ASSIGNMENT
*/
bool checkForInvalidAssignment2(Expression lhs, Expression rhs) {
@@ -11865,7 +11615,7 @@
/**
* This verifies that the usage of the passed 'this' is valid.
* @param node the 'this' expression to evaluate
- * @return `true` if and only if an error code is generated on the passed node
+ * @return {@code true} if and only if an error code is generated on the passed node
* @see CompileTimeErrorCode#INVALID_REFERENCE_TO_THIS
*/
bool checkForInvalidReferenceToThis(ThisExpression node) {
@@ -11878,8 +11628,8 @@
/**
* Checks to ensure that first type argument to a map literal must be the 'String' type.
- * @param arguments a non-`null`, non-empty [TypeName] node list from the respective[MapLiteral]
- * @return `true` if and only if an error code is generated on the passed node
+ * @param arguments a non-{@code null}, non-empty {@link TypeName} node list from the respective{@link MapLiteral}
+ * @return {@code true} if and only if an error code is generated on the passed node
* @see CompileTimeErrorCode#INVALID_TYPE_ARGUMENT_FOR_KEY
*/
bool checkForInvalidTypeArgumentForKey(NodeList<TypeName> arguments) {
@@ -11893,11 +11643,11 @@
}
/**
- * Checks to ensure that the passed [ListLiteral] or [MapLiteral] does not have a type
+ * Checks to ensure that the passed {@link ListLiteral} or {@link MapLiteral} does not have a type
* parameter as a type argument.
- * @param arguments a non-`null`, non-empty [TypeName] node list from the respective[ListLiteral] or [MapLiteral]
- * @param errorCode either [CompileTimeErrorCode#INVALID_TYPE_ARGUMENT_IN_CONST_LIST] or[CompileTimeErrorCode#INVALID_TYPE_ARGUMENT_IN_CONST_MAP]
- * @return `true` if and only if an error code is generated on the passed node
+ * @param arguments a non-{@code null}, non-empty {@link TypeName} node list from the respective{@link ListLiteral} or {@link MapLiteral}
+ * @param errorCode either {@link CompileTimeErrorCode#INVALID_TYPE_ARGUMENT_IN_CONST_LIST} or{@link CompileTimeErrorCode#INVALID_TYPE_ARGUMENT_IN_CONST_MAP}
+ * @return {@code true} if and only if an error code is generated on the passed node
*/
bool checkForInvalidTypeArgumentInConstTypedLiteral(NodeList<TypeName> arguments, ErrorCode errorCode) {
bool foundError = false;
@@ -11911,9 +11661,9 @@
}
/**
- * This verifies that the [enclosingClass] does not define members with the same name as
+ * This verifies that the {@link #enclosingClass} does not define members with the same name as
* the enclosing class.
- * @return `true` if and only if an error code is generated on the passed node
+ * @return {@code true} if and only if an error code is generated on the passed node
* @see CompileTimeErrorCode#MEMBER_WITH_CLASS_NAME
*/
bool checkForMemberWithClassName() {
@@ -11952,10 +11702,10 @@
}
Type2 getterType = null;
Type2 setterType = null;
- if (propertyAccessorElement.isGetter) {
+ if (propertyAccessorElement.isGetter()) {
getterType = getGetterType(propertyAccessorElement);
setterType = getSetterType(counterpartAccessor);
- } else if (propertyAccessorElement.isSetter) {
+ } else if (propertyAccessorElement.isSetter()) {
setterType = getSetterType(propertyAccessorElement);
counterpartAccessor = propertyAccessorElement.correspondingGetter;
getterType = getGetterType(counterpartAccessor);
@@ -11969,12 +11719,12 @@
* This verifies that the passed mixin does not have an explicitly declared constructor.
* @param mixinName the node to report problem on
* @param mixinElement the mixing to evaluate
- * @return `true` if and only if an error code is generated on the passed node
+ * @return {@code true} if and only if an error code is generated on the passed node
* @see CompileTimeErrorCode#MIXIN_DECLARES_CONSTRUCTOR
*/
bool checkForMixinDeclaresConstructor(TypeName mixinName, ClassElement mixinElement) {
for (ConstructorElement constructor in mixinElement.constructors) {
- if (!constructor.isSynthetic && !constructor.isFactory) {
+ if (!constructor.isSynthetic() && !constructor.isFactory()) {
_errorReporter.reportError2(CompileTimeErrorCode.MIXIN_DECLARES_CONSTRUCTOR, mixinName, [mixinElement.name]);
return true;
}
@@ -11986,13 +11736,13 @@
* This verifies that the passed mixin has the 'Object' superclass.
* @param mixinName the node to report problem on
* @param mixinElement the mixing to evaluate
- * @return `true` if and only if an error code is generated on the passed node
+ * @return {@code true} if and only if an error code is generated on the passed node
* @see CompileTimeErrorCode#MIXIN_INHERITS_FROM_NOT_OBJECT
*/
bool checkForMixinInheritsNotFromObject(TypeName mixinName, ClassElement mixinElement) {
InterfaceType mixinSupertype = mixinElement.supertype;
if (mixinSupertype != null) {
- if (!mixinSupertype.isObject || !mixinElement.isTypedef && mixinElement.mixins.length != 0) {
+ if (!mixinSupertype.isObject() || !mixinElement.isTypedef() && mixinElement.mixins.length != 0) {
_errorReporter.reportError2(CompileTimeErrorCode.MIXIN_INHERITS_FROM_NOT_OBJECT, mixinName, [mixinElement.name]);
return true;
}
@@ -12004,7 +11754,7 @@
* This verifies that the passed mixin does not reference 'super'.
* @param mixinName the node to report problem on
* @param mixinElement the mixing to evaluate
- * @return `true` if and only if an error code is generated on the passed node
+ * @return {@code true} if and only if an error code is generated on the passed node
* @see CompileTimeErrorCode#MIXIN_REFERENCES_SUPER
*/
bool checkForMixinReferencesSuper(TypeName mixinName, ClassElement mixinElement) {
@@ -12017,7 +11767,7 @@
/**
* This verifies that the passed constructor has at most one 'super' initializer.
* @param node the constructor declaration to evaluate
- * @return `true` if and only if an error code is generated on the passed node
+ * @return {@code true} if and only if an error code is generated on the passed node
* @see CompileTimeErrorCode#MULTIPLE_SUPER_INITIALIZERS
*/
bool checkForMultipleSuperInitializers(ConstructorDeclaration node) {
@@ -12036,7 +11786,7 @@
/**
* Checks to ensure that native function bodies can only in SDK code.
* @param node the native function body to test
- * @return `true` if and only if an error code is generated on the passed node
+ * @return {@code true} if and only if an error code is generated on the passed node
* @see ParserErrorCode#NATIVE_FUNCTION_BODY_IN_NON_SDK_CODE
*/
bool checkForNativeFunctionBodyInNonSDKCode(NativeFunctionBody node) {
@@ -12049,10 +11799,10 @@
/**
* This verifies that the passed 'new' instance creation expression invokes existing constructor.
- *
+ * <p>
* This method assumes that the instance creation was tested to be 'new' before being called.
* @param node the instance creation expression to evaluate
- * @return `true` if and only if an error code is generated on the passed node
+ * @return {@code true} if and only if an error code is generated on the passed node
* @see StaticWarningCode#NEW_WITH_UNDEFINED_CONSTRUCTOR
*/
bool checkForNewWithUndefinedConstructor(InstanceCreationExpression node) {
@@ -12078,34 +11828,10 @@
}
/**
- * This checks that passed if the passed class declaration implicitly calls default constructor of
- * its superclass, there should be such default constructor - implicit or explicit.
- * @param node the [ClassDeclaration] to evaluate
- * @return `true` if and only if an error code is generated on the passed node
- * @see StaticWarningCode#NO_DEFAULT_SUPER_CONSTRUCTOR_IMPLICIT
- */
- bool checkForNoDefaultSuperConstructorImplicit(ClassDeclaration node) {
- List<ConstructorElement> constructors = _enclosingClass.constructors;
- if (!constructors[0].isSynthetic) {
- return false;
- }
- InterfaceType superType = _enclosingClass.supertype;
- if (superType == null) {
- return false;
- }
- ClassElement superClass = superType.element;
- if (superClass.hasDefaultConstructor()) {
- return false;
- }
- _errorReporter.reportError2(StaticWarningCode.NO_DEFAULT_SUPER_CONSTRUCTOR_IMPLICIT, node.name, [superType.displayName]);
- return true;
- }
-
- /**
* This checks that passed class declaration overrides all members required by its superclasses
* and interfaces.
- * @param node the [ClassDeclaration] to evaluate
- * @return `true` if and only if an error code is generated on the passed node
+ * @param node the {@link ClassDeclaration} to evaluate
+ * @return {@code true} if and only if an error code is generated on the passed node
* @see StaticWarningCode#NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE
* @see StaticWarningCode#NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_TWO
* @see StaticWarningCode#NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_THREE
@@ -12113,7 +11839,7 @@
* @see StaticWarningCode#NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_FIVE_PLUS
*/
bool checkForNonAbstractClassInheritsAbstractMember(ClassDeclaration node) {
- if (_enclosingClass.isAbstract) {
+ if (_enclosingClass.isAbstract()) {
return false;
}
Set<ExecutableElement> missingOverrides = new Set<ExecutableElement>();
@@ -12132,7 +11858,7 @@
ExecutableElement executableElt = entry.getValue();
if (executableElt is MethodElement) {
MethodElement methodElt = executableElt as MethodElement;
- if (methodElt.isAbstract) {
+ if (methodElt.isAbstract()) {
String methodName = entry.getKey();
if (!methodsInEnclosingClass.contains(methodName)) {
javaSetAdd(missingOverrides, executableElt);
@@ -12140,7 +11866,7 @@
}
} else if (executableElt is PropertyAccessorElement) {
PropertyAccessorElement propertyAccessorElt = executableElt as PropertyAccessorElement;
- if (propertyAccessorElt.isAbstract) {
+ if (propertyAccessorElt.isAbstract()) {
String accessorName = entry.getKey();
if (!accessorsInEnclosingClass.contains(accessorName)) {
javaSetAdd(missingOverrides, executableElt);
@@ -12153,9 +11879,9 @@
ExecutableElement executableElt = entry.getValue();
ExecutableElement elt = membersInheritedFromSuperclasses[executableElt.name];
if (elt != null) {
- if (elt is MethodElement && !((elt as MethodElement)).isAbstract) {
+ if (elt is MethodElement && !((elt as MethodElement)).isAbstract()) {
continue;
- } else if (elt is PropertyAccessorElement && !((elt as PropertyAccessorElement)).isAbstract) {
+ } else if (elt is PropertyAccessorElement && !((elt as PropertyAccessorElement)).isAbstract()) {
continue;
}
}
@@ -12182,7 +11908,7 @@
for (int i = 0; i < stringTypeArray.length; i++) {
stringTypeArray[i] = StringUtilities.EMPTY;
if (missingOverridesArray[i] is PropertyAccessorElement) {
- stringTypeArray[i] = ((missingOverridesArray[i] as PropertyAccessorElement)).isGetter ? GET : SET;
+ stringTypeArray[i] = ((missingOverridesArray[i] as PropertyAccessorElement)).isGetter() ? GET : SET;
}
}
AnalysisErrorWithProperties analysisError;
@@ -12206,7 +11932,7 @@
* Checks to ensure that the expressions that need to be of type bool, are. Otherwise an error is
* reported on the expression.
* @param condition the conditional expression to test
- * @return `true` if and only if an error code is generated on the passed node
+ * @return {@code true} if and only if an error code is generated on the passed node
* @see StaticTypeWarningCode#NON_BOOL_CONDITION
*/
bool checkForNonBoolCondition(Expression condition) {
@@ -12221,7 +11947,7 @@
/**
* This verifies that the passed assert statement has either a 'bool' or '() -> bool' input.
* @param node the assert statement to evaluate
- * @return `true` if and only if an error code is generated on the passed node
+ * @return {@code true} if and only if an error code is generated on the passed node
* @see StaticTypeWarningCode#NON_BOOL_EXPRESSION
*/
bool checkForNonBoolExpression(AssertStatement node) {
@@ -12244,13 +11970,13 @@
/**
* This verifies the passed map literal either:
- *
- * * has `const modifier`
- * * has explicit type arguments
- * * is not start of the statement
- *
+ * <ul>
+ * <li>has {@code const modifier}</li>
+ * <li>has explicit type arguments</li>
+ * <li>is not start of the statement</li>
+ * <ul>
* @param node the map literal to evaluate
- * @return `true` if and only if an error code is generated on the passed node
+ * @return {@code true} if and only if an error code is generated on the passed node
* @see CompileTimeErrorCode#NON_CONST_MAP_AS_EXPRESSION_STATEMENT
*/
bool checkForNonConstMapAsExpressionStatement(MapLiteral node) {
@@ -12272,10 +11998,10 @@
}
/**
- * This verifies the passed method declaration of operator `\[\]=`, has `void` return
+ * This verifies the passed method declaration of operator {@code \[\]=}, has {@code void} return
* type.
* @param node the method declaration to evaluate
- * @return `true` if and only if an error code is generated on the passed node
+ * @return {@code true} if and only if an error code is generated on the passed node
* @see StaticWarningCode#NON_VOID_RETURN_FOR_OPERATOR
*/
bool checkForNonVoidReturnTypeForOperator(MethodDeclaration node) {
@@ -12286,7 +12012,7 @@
TypeName typeName = node.returnType;
if (typeName != null) {
Type2 type = typeName.type;
- if (type != null && !type.isVoid) {
+ if (type != null && !type.isVoid()) {
_errorReporter.reportError2(StaticWarningCode.NON_VOID_RETURN_FOR_OPERATOR, typeName, []);
}
}
@@ -12294,15 +12020,15 @@
}
/**
- * This verifies the passed setter has no return type or the `void` return type.
+ * This verifies the passed setter has no return type or the {@code void} return type.
* @param typeName the type name to evaluate
- * @return `true` if and only if an error code is generated on the passed node
+ * @return {@code true} if and only if an error code is generated on the passed node
* @see StaticWarningCode#NON_VOID_RETURN_FOR_SETTER
*/
bool checkForNonVoidReturnTypeForSetter(TypeName typeName) {
if (typeName != null) {
Type2 type = typeName.type;
- if (type != null && !type.isVoid) {
+ if (type != null && !type.isVoid()) {
_errorReporter.reportError2(StaticWarningCode.NON_VOID_RETURN_FOR_SETTER, typeName, []);
}
}
@@ -12311,11 +12037,11 @@
/**
* This verifies the passed operator-method declaration, does not have an optional parameter.
- *
+ * <p>
* This method assumes that the method declaration was tested to be an operator declaration before
* being called.
* @param node the method declaration to evaluate
- * @return `true` if and only if an error code is generated on the passed node
+ * @return {@code true} if and only if an error code is generated on the passed node
* @see CompileTimeErrorCode#OPTIONAL_PARAMETER_IN_OPERATOR
*/
bool checkForOptionalParameterInOperator(MethodDeclaration node) {
@@ -12326,7 +12052,7 @@
bool foundError = false;
NodeList<FormalParameter> formalParameters = parameterList.parameters;
for (FormalParameter formalParameter in formalParameters) {
- if (formalParameter.kind.isOptional) {
+ if (formalParameter.kind.isOptional()) {
_errorReporter.reportError2(CompileTimeErrorCode.OPTIONAL_PARAMETER_IN_OPERATOR, formalParameter, []);
foundError = true;
}
@@ -12337,7 +12063,7 @@
/**
* This checks for named optional parameters that begin with '_'.
* @param node the default formal parameter to evaluate
- * @return `true` if and only if an error code is generated on the passed node
+ * @return {@code true} if and only if an error code is generated on the passed node
* @see CompileTimeErrorCode#PRIVATE_OPTIONAL_PARAMETER
*/
bool checkForPrivateOptionalParameter(DefaultFormalParameter node) {
@@ -12345,7 +12071,7 @@
if (separator != null && separator.lexeme == ":") {
NormalFormalParameter parameter = node.parameter;
SimpleIdentifier name = parameter.identifier;
- if (!name.isSynthetic && name.name.startsWith("_")) {
+ if (!name.isSynthetic() && name.name.startsWith("_")) {
_errorReporter.reportError2(CompileTimeErrorCode.PRIVATE_OPTIONAL_PARAMETER, node, []);
return true;
}
@@ -12357,7 +12083,7 @@
* This checks if the passed constructor declaration is the redirecting generative constructor and
* references itself directly or indirectly.
* @param node the constructor declaration to evaluate
- * @return `true` if and only if an error code is generated on the passed node
+ * @return {@code true} if and only if an error code is generated on the passed node
* @see CompileTimeErrorCode#RECURSIVE_CONSTRUCTOR_REDIRECT
*/
bool checkForRecursiveConstructorRedirect(ConstructorDeclaration node) {
@@ -12381,7 +12107,7 @@
* This checks if the passed constructor declaration has redirected constructor and references
* itself directly or indirectly.
* @param node the constructor declaration to evaluate
- * @return `true` if and only if an error code is generated on the passed node
+ * @return {@code true} if and only if an error code is generated on the passed node
* @see CompileTimeErrorCode#RECURSIVE_FACTORY_REDIRECT
*/
bool checkForRecursiveFactoryRedirect(ConstructorDeclaration node) {
@@ -12401,7 +12127,7 @@
* This checks the class declaration is not a superinterface to itself.
* @param classElt the class element to test
* @param list a list containing the potentially cyclic implements path
- * @return `true` if and only if an error code is generated on the passed element
+ * @return {@code true} if and only if an error code is generated on the passed element
* @see CompileTimeErrorCode#RECURSIVE_INTERFACE_INHERITANCE
* @see CompileTimeErrorCode#RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_EXTENDS
* @see CompileTimeErrorCode#RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_IMPLEMENTS
@@ -12440,7 +12166,7 @@
}
List<ClassElement> interfaceElements;
List<InterfaceType> interfaceTypes = classElt.interfaces;
- if (supertype != null && !supertype.isObject) {
+ if (supertype != null && !supertype.isObject()) {
interfaceElements = new List<ClassElement>(interfaceTypes.length + 1);
interfaceElements[0] = supertype.element;
for (int i = 0; i < interfaceTypes.length; i++) {
@@ -12465,7 +12191,7 @@
* This checks the passed constructor declaration has a valid combination of redirected
* constructor invocation(s), super constructor invocations and field initializers.
* @param node the constructor declaration to evaluate
- * @return `true` if and only if an error code is generated on the passed node
+ * @return {@code true} if and only if an error code is generated on the passed node
* @see CompileTimeErrorCode#MULTIPLE_REDIRECTING_CONSTRUCTOR_INVOCATIONS
* @see CompileTimeErrorCode#SUPER_IN_REDIRECTING_CONSTRUCTOR
* @see CompileTimeErrorCode#FIELD_INITIALIZER_REDIRECTING_CONSTRUCTOR
@@ -12501,7 +12227,7 @@
* This checks if the passed constructor declaration has redirected constructor and references
* itself directly or indirectly. TODO(scheglov)
* @param node the constructor declaration to evaluate
- * @return `true` if and only if an error code is generated on the passed node
+ * @return {@code true} if and only if an error code is generated on the passed node
* @see CompileTimeErrorCode#REDIRECT_TO_NON_CONST_CONSTRUCTOR
*/
bool checkForRedirectToNonConstConstructor(ConstructorDeclaration node) {
@@ -12513,14 +12239,14 @@
if (element == null) {
return false;
}
- if (!element.isConst) {
+ if (!element.isConst()) {
return false;
}
ConstructorElement redirectedConstructor = element.redirectedConstructor;
if (redirectedConstructor == null) {
return false;
}
- if (redirectedConstructor.isConst) {
+ if (redirectedConstructor.isConst()) {
return false;
}
_errorReporter.reportError2(CompileTimeErrorCode.REDIRECT_TO_NON_CONST_CONSTRUCTOR, redirectedConstructorNode, []);
@@ -12531,7 +12257,7 @@
* This checks if the passed identifier is banned because it is part of the variable declaration
* with the same name.
* @param node the identifier to evaluate
- * @return `true` if and only if an error code is generated on the passed node
+ * @return {@code true} if and only if an error code is generated on the passed node
* @see CompileTimeErrorCode#REFERENCE_TO_DECLARED_VARIABLE_IN_INITIALIZER
*/
bool checkForReferenceToDeclaredVariableInInitializer(SimpleIdentifier node) {
@@ -12577,7 +12303,7 @@
/**
* This checks that the rethrow is inside of a catch clause.
* @param node the rethrow expression to evaluate
- * @return `true` if and only if an error code is generated on the passed node
+ * @return {@code true} if and only if an error code is generated on the passed node
* @see CompileTimeErrorCode#RETHROW_OUTSIDE_CATCH
*/
bool checkForRethrowOutsideCatch(RethrowExpression node) {
@@ -12589,48 +12315,11 @@
}
/**
- * This checks that a type mis-match between the return type and the expressed return type by the
- * enclosing method or function.
- *
- * This method is called both by [checkForAllReturnStatementErrorCodes]and [visitExpressionFunctionBody].
- * @param returnExpression the returned expression to evaluate
- * @param expectedReturnType the expressed return type by the enclosing method or function
- * @return `true` if and only if an error code is generated on the passed node
- * @see StaticTypeWarningCode#RETURN_OF_INVALID_TYPE
- */
- bool checkForReturnOfInvalidType(Expression returnExpression, Type2 expectedReturnType) {
- Type2 staticReturnType = getStaticType(returnExpression);
- if (expectedReturnType.isVoid) {
- if (staticReturnType.isVoid || staticReturnType.isDynamic || identical(staticReturnType, BottomTypeImpl.instance)) {
- return false;
- }
- _errorReporter.reportError2(StaticTypeWarningCode.RETURN_OF_INVALID_TYPE, returnExpression, [staticReturnType.displayName, expectedReturnType.displayName, _enclosingFunction.displayName]);
- return true;
- }
- bool isStaticAssignable = staticReturnType.isAssignableTo(expectedReturnType);
- Type2 propagatedReturnType = getPropagatedType(returnExpression);
- if (_strictMode || propagatedReturnType == null) {
- if (isStaticAssignable) {
- return false;
- }
- _errorReporter.reportError2(StaticTypeWarningCode.RETURN_OF_INVALID_TYPE, returnExpression, [staticReturnType.displayName, expectedReturnType.displayName, _enclosingFunction.displayName]);
- return true;
- } else {
- bool isPropagatedAssignable = propagatedReturnType.isAssignableTo(expectedReturnType);
- if (isStaticAssignable || isPropagatedAssignable) {
- return false;
- }
- _errorReporter.reportError2(StaticTypeWarningCode.RETURN_OF_INVALID_TYPE, returnExpression, [staticReturnType.displayName, expectedReturnType.displayName, _enclosingFunction.displayName]);
- return true;
- }
- }
-
- /**
* This checks that if the given "target" is the type reference then the "name" is not the
* reference to a instance member.
* @param target the target of the name access to evaluate
* @param name the accessed name to evaluate
- * @return `true` if and only if an error code is generated on the passed node
+ * @return {@code true} if and only if an error code is generated on the passed node
* @see StaticWarningCode#STATIC_ACCESS_TO_INSTANCE_MEMBER
*/
bool checkForStaticAccessToInstanceMember(Expression target, SimpleIdentifier name2) {
@@ -12639,7 +12328,7 @@
return false;
}
ExecutableElement memberElement = element as ExecutableElement;
- if (memberElement.isStatic) {
+ if (memberElement.isStatic()) {
return false;
}
if (!isTypeReference(target)) {
@@ -12653,7 +12342,7 @@
* This checks that the type of the passed 'switch' expression is assignable to the type of the
* 'case' members.
* @param node the 'switch' statement to evaluate
- * @return `true` if and only if an error code is generated on the passed node
+ * @return {@code true} if and only if an error code is generated on the passed node
* @see StaticWarningCode#SWITCH_EXPRESSION_NOT_ASSIGNABLE
*/
bool checkForSwitchExpressionNotAssignable(SwitchStatement node) {
@@ -12684,9 +12373,9 @@
* their bounds as specified by the class element where the constructor \[that is being invoked\] is
* declared.
* @param node the instance creation expression to evaluate
- * @param typeName the [TypeName] of the [ConstructorName] from the[InstanceCreationExpression], this is the AST node that the error is attached to
- * @param constructorElement the [ConstructorElement] from the instance creation expression
- * @return `true` if and only if an error code is generated on the passed node
+ * @param typeName the {@link TypeName} of the {@link ConstructorName} from the{@link InstanceCreationExpression}, this is the AST node that the error is attached to
+ * @param constructorElement the {@link ConstructorElement} from the instance creation expression
+ * @return {@code true} if and only if an error code is generated on the passed node
* @see StaticTypeWarningCode#TYPE_ARGUMENT_NOT_MATCHING_BOUNDS
*/
bool checkForTypeArgumentNotMatchingBounds(InstanceCreationExpression node, ConstructorElement constructorElement, TypeName typeName) {
@@ -12714,10 +12403,9 @@
* invocation nor a redirecting constructor invocation, that the superclass has a default
* generative constructor.
* @param node the constructor declaration to evaluate
- * @return `true` if and only if an error code is generated on the passed node
+ * @return {@code true} if and only if an error code is generated on the passed node
* @see CompileTimeErrorCode#UNDEFINED_CONSTRUCTOR_IN_INITIALIZER_DEFAULT
* @see CompileTimeErrorCode#NON_GENERATIVE_CONSTRUCTOR
- * @see StaticWarningCode#NO_DEFAULT_SUPER_CONSTRUCTOR_EXPLICIT
*/
bool checkForUndefinedConstructorInInitializerImplicit(ConstructorDeclaration node) {
if (node.factoryKeyword != null) {
@@ -12736,23 +12424,12 @@
return false;
}
ClassElement superElement = superType.element;
- ConstructorElement superUnnamedConstructor = superElement.unnamedConstructor;
- if (superUnnamedConstructor != null) {
- if (superUnnamedConstructor.isFactory) {
- _errorReporter.reportError2(CompileTimeErrorCode.NON_GENERATIVE_CONSTRUCTOR, node.returnType, [superUnnamedConstructor]);
+ ConstructorElement superDefaultConstructor = superElement.unnamedConstructor;
+ if (superDefaultConstructor != null) {
+ if (superDefaultConstructor.isFactory()) {
+ _errorReporter.reportError2(CompileTimeErrorCode.NON_GENERATIVE_CONSTRUCTOR, node.returnType, [superDefaultConstructor]);
return true;
}
- if (!superUnnamedConstructor.isDefaultConstructor) {
- int offset;
- int length;
- {
- Identifier returnType = node.returnType;
- SimpleIdentifier name = node.name;
- offset = returnType.offset;
- length = (name != null ? name.end : returnType.end) - offset;
- }
- _errorReporter.reportError3(StaticWarningCode.NO_DEFAULT_SUPER_CONSTRUCTOR_EXPLICIT, offset, length, [superType.displayName]);
- }
return false;
}
_errorReporter.reportError2(CompileTimeErrorCode.UNDEFINED_CONSTRUCTOR_IN_INITIALIZER_DEFAULT, node.returnType, [superElement.name]);
@@ -12761,11 +12438,11 @@
/**
* This verifies the passed operator-method declaration, has correct number of parameters.
- *
+ * <p>
* This method assumes that the method declaration was tested to be an operator declaration before
* being called.
* @param node the method declaration to evaluate
- * @return `true` if and only if an error code is generated on the passed node
+ * @return {@code true} if and only if an error code is generated on the passed node
* @see CompileTimeErrorCode#WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR
*/
bool checkForWrongNumberOfParametersForOperator(MethodDeclaration node) {
@@ -12800,11 +12477,11 @@
/**
* This verifies if the passed setter parameter list have only one parameter.
- *
+ * <p>
* This method assumes that the method declaration was tested to be a setter before being called.
* @param setterName the name of the setter to report problems on
* @param parameterList the parameter list to evaluate
- * @return `true` if and only if an error code is generated on the passed node
+ * @return {@code true} if and only if an error code is generated on the passed node
* @see CompileTimeErrorCode#WRONG_NUMBER_OF_PARAMETERS_FOR_SETTER
*/
bool checkForWrongNumberOfParametersForSetter(SimpleIdentifier setterName, FormalParameterList parameterList) {
@@ -12884,7 +12561,7 @@
}
/**
- * Return the variable element represented by the given expression, or `null` if there is no
+ * Return the variable element represented by the given expression, or {@code null} if there is no
* such element.
* @param expression the expression whose element is to be returned
* @return the variable element represented by the expression
@@ -12900,7 +12577,7 @@
}
/**
- * @return `true` if the given constructor redirects to itself, directly or indirectly
+ * @return {@code true} if the given constructor redirects to itself, directly or indirectly
*/
bool hasRedirectingFactoryConstructorCycle(ConstructorElement element) {
Set<ConstructorElement> constructors = new Set<ConstructorElement>();
@@ -12920,7 +12597,7 @@
/**
* @param node the 'this' expression to analyze
- * @return `true` if the given 'this' expression is in the valid context
+ * @return {@code true} if the given 'this' expression is in the valid context
*/
bool isThisInValidContext(ThisExpression node) {
for (ASTNode n = node; n != null; n = n.parent) {
@@ -12936,7 +12613,7 @@
}
if (n is MethodDeclaration) {
MethodDeclaration method = n as MethodDeclaration;
- return !method.isStatic;
+ return !method.isStatic();
}
}
return false;
@@ -12967,7 +12644,7 @@
String toString() => name;
}
/**
- * Instances of the class `PubVerifier` traverse an AST structure looking for deviations from
+ * Instances of the class {@code PubVerifier} traverse an AST structure looking for deviations from
* pub best practices.
*/
class PubVerifier extends RecursiveASTVisitor<Object> {
@@ -12994,9 +12671,9 @@
* This verifies that the passed file import directive is not contained in a source inside a
* package "lib" directory hierarchy referencing a source outside that package "lib" directory
* hierarchy.
- * @param uriLiteral the import URL (not `null`)
- * @param path the file path being verified (not `null`)
- * @return `true` if and only if an error code is generated on the passed node
+ * @param uriLiteral the import URL (not {@code null})
+ * @param path the file path being verified (not {@code null})
+ * @return {@code true} if and only if an error code is generated on the passed node
* @see PubSuggestionCode.FILE_IMPORT_INSIDE_LIB_REFERENCES_FILE_OUTSIDE
*/
bool checkForFileImportInsideLibReferencesFileOutside(StringLiteral uriLiteral, String path) {
@@ -13006,7 +12683,7 @@
int pathIndex = 0;
int fullNameIndex = fullName.length;
while (pathIndex < path.length && JavaString.startsWithBefore(path, "../", pathIndex)) {
- fullNameIndex = JavaString.lastIndexOf(fullName, '/', fullNameIndex);
+ fullNameIndex = fullName.lastIndexOf('/', fullNameIndex);
if (fullNameIndex < 4) {
return false;
}
@@ -13028,9 +12705,9 @@
* This verifies that the passed file import directive is not contained in a source outside a
* package "lib" directory hierarchy referencing a source inside that package "lib" directory
* hierarchy.
- * @param uriLiteral the import URL (not `null`)
- * @param path the file path being verified (not `null`)
- * @return `true` if and only if an error code is generated on the passed node
+ * @param uriLiteral the import URL (not {@code null})
+ * @param path the file path being verified (not {@code null})
+ * @return {@code true} if and only if an error code is generated on the passed node
* @see PubSuggestionCode.FILE_IMPORT_OUTSIDE_LIB_REFERENCES_FILE_INSIDE
*/
bool checkForFileImportOutsideLibReferencesFileInside(StringLiteral uriLiteral, String path) {
@@ -13044,7 +12721,7 @@
if (checkForFileImportOutsideLibReferencesFileInside2(uriLiteral, path, pathIndex + 1)) {
return true;
}
- pathIndex = JavaString.indexOf(path, "/lib/", pathIndex + 4);
+ pathIndex = path.indexOf("/lib/", pathIndex + 4);
}
return false;
}
@@ -13067,9 +12744,9 @@
/**
* This verifies that the passed package import directive does not contain ".."
- * @param uriLiteral the import URL (not `null`)
- * @param path the path to be validated (not `null`)
- * @return `true` if and only if an error code is generated on the passed node
+ * @param uriLiteral the import URL (not {@code null})
+ * @param path the path to be validated (not {@code null})
+ * @return {@code true} if and only if an error code is generated on the passed node
* @see PubSuggestionCode.PACKAGE_IMPORT_CONTAINS_DOT_DOT
*/
bool checkForPackageImportContainsDotDot(StringLiteral uriLiteral, String path) {
@@ -13082,8 +12759,8 @@
/**
* Answer the source associated with the compilation unit containing the given AST node.
- * @param node the node (not `null`)
- * @return the source or `null` if it could not be determined
+ * @param node the node (not {@code null})
+ * @return the source or {@code null} if it could not be determined
*/
Source getSource(ASTNode node) {
Source source = null;
@@ -13098,9 +12775,9 @@
}
/**
- * Answer the full name of the given source. The returned value will have all[File#separatorChar] replace by '/'.
+ * Answer the full name of the given source. The returned value will have all{@link File#separatorChar} replace by '/'.
* @param source the source
- * @return the full name or `null` if it could not be determined
+ * @return the full name or {@code null} if it could not be determined
*/
String getSourceFullName(Source source) {
if (source != null) {
@@ -13113,7 +12790,7 @@
}
}
/**
- * The enumeration `ResolverErrorCode` defines the error codes used for errors detected by the
+ * The enumeration {@code ResolverErrorCode} defines the error codes used for errors detected by the
* resolver. The convention for this class is for the name of the error code to indicate the problem
* that caused the error to be generated and for the error message to explain what is wrong and,
* when appropriate, how the problem can be corrected.
diff --git a/pkg/analyzer_experimental/lib/src/generated/scanner.dart b/pkg/analyzer_experimental/lib/src/generated/scanner.dart
index 24464e6..7c3c523 100644
--- a/pkg/analyzer_experimental/lib/src/generated/scanner.dart
+++ b/pkg/analyzer_experimental/lib/src/generated/scanner.dart
@@ -8,7 +8,7 @@
import 'error.dart';
import 'instrumentation.dart';
/**
- * Instances of the abstract class `KeywordState` represent a state in a state machine used to
+ * Instances of the abstract class {@code KeywordState} represent a state in a state machine used to
* scan keywords.
* @coverage dart.engine.parser
*/
@@ -87,12 +87,12 @@
/**
* A table mapping characters to the states to which those characters will transition. (The index
- * into the array is the offset from the character `'a'` to the transitioning character.)
+ * into the array is the offset from the character {@code 'a'} to the transitioning character.)
*/
List<KeywordState> _table;
/**
- * The keyword that is recognized by this state, or `null` if this state is not a terminal
+ * The keyword that is recognized by this state, or {@code null} if this state is not a terminal
* state.
*/
Keyword _keyword2;
@@ -109,21 +109,21 @@
}
/**
- * Return the keyword that was recognized by this state, or `null` if this state does not
+ * Return the keyword that was recognized by this state, or {@code null} if this state does not
* recognized a keyword.
* @return the keyword that was matched by reaching this state
*/
Keyword keyword() => _keyword2;
/**
- * Return the state that follows this state on a transition of the given character, or`null` if there is no valid state reachable from this state with such a transition.
+ * Return the state that follows this state on a transition of the given character, or{@code null} if there is no valid state reachable from this state with such a transition.
* @param c the character used to transition from this state to another state
* @return the state that follows this state on a transition of the given character
*/
KeywordState next(int c) => _table[c - 0x61];
}
/**
- * The enumeration `ScannerErrorCode` defines the error codes used for errors detected by the
+ * The enumeration {@code ScannerErrorCode} defines the error codes used for errors detected by the
* scanner.
* @coverage dart.engine.parser
*/
@@ -162,7 +162,7 @@
String toString() => name;
}
/**
- * Instances of the class `TokenWithComment` represent a string token that is preceded by
+ * Instances of the class {@code TokenWithComment} represent a string token that is preceded by
* comments.
* @coverage dart.engine.parser
*/
@@ -186,7 +186,7 @@
Token get precedingComments => _precedingComment;
}
/**
- * The enumeration `Keyword` defines the keywords in the Dart programming language.
+ * The enumeration {@code Keyword} defines the keywords in the Dart programming language.
* @coverage dart.engine.parser
*/
class Keyword implements Comparable<Keyword> {
@@ -288,9 +288,9 @@
/**
* Initialize a newly created keyword to have the given syntax. The keyword is a pseudo-keyword if
- * the given flag is `true`.
+ * the given flag is {@code true}.
* @param syntax the lexeme for the keyword
- * @param isPseudoKeyword `true` if this keyword is a pseudo-keyword
+ * @param isPseudoKeyword {@code true} if this keyword is a pseudo-keyword
*/
Keyword.con2(this.name, this.ordinal, String syntax2, bool isPseudoKeyword) {
_jtd_constructor_319_impl(syntax2, isPseudoKeyword);
@@ -307,19 +307,19 @@
String get syntax => _syntax;
/**
- * Return `true` if this keyword is a pseudo-keyword. Pseudo keywords can be used as
+ * Return {@code true} if this keyword is a pseudo-keyword. Pseudo keywords can be used as
* identifiers.
- * @return `true` if this keyword is a pseudo-keyword
+ * @return {@code true} if this keyword is a pseudo-keyword
*/
- bool get isPseudoKeyword => _isPseudoKeyword2;
+ bool isPseudoKeyword() => _isPseudoKeyword2;
int compareTo(Keyword other) => ordinal - other.ordinal;
int get hashCode => ordinal;
String toString() => name;
}
/**
- * The abstract class `AbstractScanner` implements a scanner for Dart code. Subclasses are
+ * The abstract class {@code AbstractScanner} implements a scanner for Dart code. Subclasses are
* required to implement the interface used to access the characters being scanned.
- *
+ * <p>
* The lexical structure of Dart is ambiguous without knowledge of the context in which a token is
* being scanned. For example, without context we cannot determine whether source of the form "<<"
* should be scanned as a single left-shift operator or as two left angle brackets. This scanner
@@ -415,8 +415,8 @@
int get offset;
/**
- * Return `true` if any unmatched groups were found during the parse.
- * @return `true` if any unmatched groups were found during the parse
+ * Return {@code true} if any unmatched groups were found during the parse.
+ * @return {@code true} if any unmatched groups were found during the parse
*/
bool hasUnmatchedGroups() => _hasUnmatchedGroups2;
@@ -764,7 +764,7 @@
return next;
}
}
- int select3(int choice, TokenType yesType, TokenType noType, int offset) {
+ int select4(int choice, TokenType yesType, TokenType noType, int offset) {
int next = advance();
if (next == choice) {
appendToken2(yesType, offset);
@@ -871,7 +871,7 @@
if (!hasDigit) {
appendStringToken(TokenType.INT, getString(start, -2));
if (0x2E == next) {
- return select3(0x2E, TokenType.PERIOD_PERIOD_PERIOD, TokenType.PERIOD_PERIOD, offset - 1);
+ return select4(0x2E, TokenType.PERIOD_PERIOD_PERIOD, TokenType.PERIOD_PERIOD, offset - 1);
}
appendToken2(TokenType.PERIOD, offset - 1);
return bigSwitch(next);
@@ -1272,7 +1272,7 @@
}
}
/**
- * Instances of the class `StringToken` represent a token whose value is independent of it's
+ * Instances of the class {@code StringToken} represent a token whose value is independent of it's
* type.
* @coverage dart.engine.parser
*/
@@ -1296,7 +1296,7 @@
String value() => _value2;
}
/**
- * Instances of the class `CharBufferScanner` implement a scanner that reads from a character
+ * Instances of the class {@code CharBufferScanner} implement a scanner that reads from a character
* buffer. The scanning logic is in the superclass.
* @coverage dart.engine.parser
*/
@@ -1344,7 +1344,7 @@
}
}
/**
- * Instances of the class `TokenWithComment` represent a normal token that is preceded by
+ * Instances of the class {@code TokenWithComment} represent a normal token that is preceded by
* comments.
* @coverage dart.engine.parser
*/
@@ -1368,7 +1368,7 @@
Token get precedingComments => _precedingComment;
}
/**
- * Instances of the class `Token` represent a token that was scanned from the input. Each
+ * Instances of the class {@code Token} represent a token that was scanned from the input. Each
* token knows which token follows it, acting as the head of a linked list of tokens.
* @coverage dart.engine.parser
*/
@@ -1437,9 +1437,9 @@
int get offset => _offset;
/**
- * Return the first comment in the list of comments that precede this token, or `null` if
+ * Return the first comment in the list of comments that precede this token, or {@code null} if
* there are no comments preceding this token. Additional comments can be reached by following the
- * token stream using [getNext] until `null` is returned.
+ * token stream using {@link #getNext()} until {@code null} is returned.
* @return the first comment in the list of comments that precede this token
*/
Token get precedingComments => null;
@@ -1457,24 +1457,24 @@
TokenType get type => _type;
/**
- * Return `true` if this token represents an operator.
- * @return `true` if this token represents an operator
+ * Return {@code true} if this token represents an operator.
+ * @return {@code true} if this token represents an operator
*/
- bool get isOperator => _type.isOperator;
+ bool isOperator() => _type.isOperator();
/**
- * Return `true` if this token is a synthetic token. A synthetic token is a token that was
+ * Return {@code true} if this token is a synthetic token. A synthetic token is a token that was
* introduced by the parser in order to recover from an error in the code. Synthetic tokens always
- * have a length of zero (`0`).
- * @return `true` if this token is a synthetic token
+ * have a length of zero ({@code 0}).
+ * @return {@code true} if this token is a synthetic token
*/
- bool get isSynthetic => length == 0;
+ bool isSynthetic() => length == 0;
/**
- * Return `true` if this token represents an operator that can be defined by users.
- * @return `true` if this token represents an operator that can be defined by users
+ * Return {@code true} if this token represents an operator that can be defined by users.
+ * @return {@code true} if this token represents an operator that can be defined by users
*/
- bool get isUserDefinableOperator => _type.isUserDefinableOperator;
+ bool isUserDefinableOperator() => _type.isUserDefinableOperator();
/**
* Set the next token in the token stream to the given token. This has the side-effect of setting
@@ -1525,7 +1525,7 @@
}
}
/**
- * Instances of the class `StringScanner` implement a scanner that reads from a string. The
+ * Instances of the class {@code StringScanner} implement a scanner that reads from a string. The
* scanning logic is in the superclass.
* @coverage dart.engine.parser
*/
@@ -1568,7 +1568,7 @@
/**
* Record that the source begins on the given line and column at the given offset. The line starts
* for lines before the given line will not be correct.
- *
+ * <p>
* This method must be invoked at most one time and must be invoked before scanning begins. The
* values provided must be sensible. The results are undefined if these conditions are violated.
* @param line the one-based index of the line containing the first character of the source
@@ -1604,7 +1604,7 @@
}
}
/**
- * Instances of the class `BeginTokenWithComment` represent a begin token that is preceded by
+ * Instances of the class {@code BeginTokenWithComment} represent a begin token that is preceded by
* comments.
* @coverage dart.engine.parser
*/
@@ -1628,7 +1628,7 @@
Token get precedingComments => _precedingComment;
}
/**
- * Instances of the class `KeywordToken` represent a keyword in the language.
+ * Instances of the class {@code KeywordToken} represent a keyword in the language.
* @coverage dart.engine.parser
*/
class KeywordToken extends Token {
@@ -1656,7 +1656,7 @@
Keyword value() => _keyword;
}
/**
- * Instances of the class `BeginToken` represent the opening half of a grouping pair of
+ * Instances of the class {@code BeginToken} represent the opening half of a grouping pair of
* tokens. This is used for curly brackets ('{'), parentheses ('('), and square brackets ('\[').
* @coverage dart.engine.parser
*/
@@ -1691,7 +1691,7 @@
}
}
/**
- * The enumeration `TokenClass` represents classes (or groups) of tokens with a similar use.
+ * The enumeration {@code TokenClass} represents classes (or groups) of tokens with a similar use.
* @coverage dart.engine.parser
*/
class TokenClass implements Comparable<TokenClass> {
@@ -1784,7 +1784,7 @@
final int ordinal;
/**
- * The precedence of tokens of this class, or `0` if the such tokens do not represent an
+ * The precedence of tokens of this class, or {@code 0} if the such tokens do not represent an
* operator.
*/
int _precedence = 0;
@@ -1802,7 +1802,7 @@
}
/**
- * Return the precedence of tokens of this class, or `0` if the such tokens do not represent
+ * Return the precedence of tokens of this class, or {@code 0} if the such tokens do not represent
* an operator.
* @return the precedence of tokens of this class
*/
@@ -1812,7 +1812,7 @@
String toString() => name;
}
/**
- * Instances of the class `KeywordTokenWithComment` implement a keyword token that is preceded
+ * Instances of the class {@code KeywordTokenWithComment} implement a keyword token that is preceded
* by comments.
* @coverage dart.engine.parser
*/
@@ -1836,7 +1836,7 @@
Token get precedingComments => _precedingComment;
}
/**
- * The enumeration `TokenType` defines the types of tokens that can be returned by the
+ * The enumeration {@code TokenType} defines the types of tokens that can be returned by the
* scanner.
* @coverage dart.engine.parser
*/
@@ -1927,7 +1927,7 @@
TokenClass _tokenClass;
/**
- * The lexeme that defines this type of token, or `null` if there is more than one possible
+ * The lexeme that defines this type of token, or {@code null} if there is more than one possible
* lexeme for this type of token.
*/
String _lexeme;
@@ -1946,95 +1946,95 @@
}
/**
- * Return the lexeme that defines this type of token, or `null` if there is more than one
+ * Return the lexeme that defines this type of token, or {@code null} if there is more than one
* possible lexeme for this type of token.
* @return the lexeme that defines this type of token
*/
String get lexeme => _lexeme;
/**
- * Return the precedence of the token, or `0` if the token does not represent an operator.
+ * Return the precedence of the token, or {@code 0} if the token does not represent an operator.
* @return the precedence of the token
*/
int get precedence => _tokenClass.precedence;
/**
- * Return `true` if this type of token represents an additive operator.
- * @return `true` if this type of token represents an additive operator
+ * Return {@code true} if this type of token represents an additive operator.
+ * @return {@code true} if this type of token represents an additive operator
*/
- bool get isAdditiveOperator => identical(_tokenClass, TokenClass.ADDITIVE_OPERATOR);
+ bool isAdditiveOperator() => identical(_tokenClass, TokenClass.ADDITIVE_OPERATOR);
/**
- * Return `true` if this type of token represents an assignment operator.
- * @return `true` if this type of token represents an assignment operator
+ * Return {@code true} if this type of token represents an assignment operator.
+ * @return {@code true} if this type of token represents an assignment operator
*/
- bool get isAssignmentOperator => identical(_tokenClass, TokenClass.ASSIGNMENT_OPERATOR);
+ bool isAssignmentOperator() => identical(_tokenClass, TokenClass.ASSIGNMENT_OPERATOR);
/**
- * Return `true` if this type of token represents an associative operator. An associative
- * operator is an operator for which the following equality is true:`(a * b) * c == a * (b * c)`. In other words, if the result of applying the operator to
+ * Return {@code true} if this type of token represents an associative operator. An associative
+ * operator is an operator for which the following equality is true:{@code (a * b) * c == a * (b * c)}. In other words, if the result of applying the operator to
* multiple operands does not depend on the order in which those applications occur.
- *
+ * <p>
* Note: This method considers the logical-and and logical-or operators to be associative, even
* though the order in which the application of those operators can have an effect because
* evaluation of the right-hand operand is conditional.
- * @return `true` if this type of token represents an associative operator
+ * @return {@code true} if this type of token represents an associative operator
*/
- bool get isAssociativeOperator => identical(this, AMPERSAND) || identical(this, AMPERSAND_AMPERSAND) || identical(this, BAR) || identical(this, BAR_BAR) || identical(this, CARET) || identical(this, PLUS) || identical(this, STAR);
+ bool isAssociativeOperator() => identical(this, AMPERSAND) || identical(this, AMPERSAND_AMPERSAND) || identical(this, BAR) || identical(this, BAR_BAR) || identical(this, CARET) || identical(this, PLUS) || identical(this, STAR);
/**
- * Return `true` if this type of token represents an equality operator.
- * @return `true` if this type of token represents an equality operator
+ * Return {@code true} if this type of token represents an equality operator.
+ * @return {@code true} if this type of token represents an equality operator
*/
- bool get isEqualityOperator => identical(_tokenClass, TokenClass.EQUALITY_OPERATOR);
+ bool isEqualityOperator() => identical(_tokenClass, TokenClass.EQUALITY_OPERATOR);
/**
- * Return `true` if this type of token represents an increment operator.
- * @return `true` if this type of token represents an increment operator
+ * Return {@code true} if this type of token represents an increment operator.
+ * @return {@code true} if this type of token represents an increment operator
*/
- bool get isIncrementOperator => identical(_lexeme, "++") || identical(_lexeme, "--");
+ bool isIncrementOperator() => identical(_lexeme, "++") || identical(_lexeme, "--");
/**
- * Return `true` if this type of token represents a multiplicative operator.
- * @return `true` if this type of token represents a multiplicative operator
+ * Return {@code true} if this type of token represents a multiplicative operator.
+ * @return {@code true} if this type of token represents a multiplicative operator
*/
- bool get isMultiplicativeOperator => identical(_tokenClass, TokenClass.MULTIPLICATIVE_OPERATOR);
+ bool isMultiplicativeOperator() => identical(_tokenClass, TokenClass.MULTIPLICATIVE_OPERATOR);
/**
- * Return `true` if this token type represents an operator.
- * @return `true` if this token type represents an operator
+ * Return {@code true} if this token type represents an operator.
+ * @return {@code true} if this token type represents an operator
*/
- bool get isOperator => _tokenClass != TokenClass.NO_CLASS && this != OPEN_PAREN && this != OPEN_SQUARE_BRACKET && this != PERIOD;
+ bool isOperator() => _tokenClass != TokenClass.NO_CLASS && this != OPEN_PAREN && this != OPEN_SQUARE_BRACKET && this != PERIOD;
/**
- * Return `true` if this type of token represents a relational operator.
- * @return `true` if this type of token represents a relational operator
+ * Return {@code true} if this type of token represents a relational operator.
+ * @return {@code true} if this type of token represents a relational operator
*/
- bool get isRelationalOperator => identical(_tokenClass, TokenClass.RELATIONAL_OPERATOR);
+ bool isRelationalOperator() => identical(_tokenClass, TokenClass.RELATIONAL_OPERATOR);
/**
- * Return `true` if this type of token represents a shift operator.
- * @return `true` if this type of token represents a shift operator
+ * Return {@code true} if this type of token represents a shift operator.
+ * @return {@code true} if this type of token represents a shift operator
*/
- bool get isShiftOperator => identical(_tokenClass, TokenClass.SHIFT_OPERATOR);
+ bool isShiftOperator() => identical(_tokenClass, TokenClass.SHIFT_OPERATOR);
/**
- * Return `true` if this type of token represents a unary postfix operator.
- * @return `true` if this type of token represents a unary postfix operator
+ * Return {@code true} if this type of token represents a unary postfix operator.
+ * @return {@code true} if this type of token represents a unary postfix operator
*/
- bool get isUnaryPostfixOperator => identical(_tokenClass, TokenClass.UNARY_POSTFIX_OPERATOR);
+ bool isUnaryPostfixOperator() => identical(_tokenClass, TokenClass.UNARY_POSTFIX_OPERATOR);
/**
- * Return `true` if this type of token represents a unary prefix operator.
- * @return `true` if this type of token represents a unary prefix operator
+ * Return {@code true} if this type of token represents a unary prefix operator.
+ * @return {@code true} if this type of token represents a unary prefix operator
*/
- bool get isUnaryPrefixOperator => identical(_tokenClass, TokenClass.UNARY_PREFIX_OPERATOR);
+ bool isUnaryPrefixOperator() => identical(_tokenClass, TokenClass.UNARY_PREFIX_OPERATOR);
/**
- * Return `true` if this token type represents an operator that can be defined by users.
- * @return `true` if this token type represents an operator that can be defined by users
+ * Return {@code true} if this token type represents an operator that can be defined by users.
+ * @return {@code true} if this token type represents an operator that can be defined by users
*/
- bool get isUserDefinableOperator => identical(_lexeme, "==") || identical(_lexeme, "~") || identical(_lexeme, "[]") || identical(_lexeme, "[]=") || identical(_lexeme, "*") || identical(_lexeme, "/") || identical(_lexeme, "%") || identical(_lexeme, "~/") || identical(_lexeme, "+") || identical(_lexeme, "-") || identical(_lexeme, "<<") || identical(_lexeme, ">>") || identical(_lexeme, ">=") || identical(_lexeme, ">") || identical(_lexeme, "<=") || identical(_lexeme, "<") || identical(_lexeme, "&") || identical(_lexeme, "^") || identical(_lexeme, "|");
+ bool isUserDefinableOperator() => identical(_lexeme, "==") || identical(_lexeme, "~") || identical(_lexeme, "[]") || identical(_lexeme, "[]=") || identical(_lexeme, "*") || identical(_lexeme, "/") || identical(_lexeme, "%") || identical(_lexeme, "~/") || identical(_lexeme, "+") || identical(_lexeme, "-") || identical(_lexeme, "<<") || identical(_lexeme, ">>") || identical(_lexeme, ">=") || identical(_lexeme, ">") || identical(_lexeme, "<=") || identical(_lexeme, "<") || identical(_lexeme, "&") || identical(_lexeme, "^") || identical(_lexeme, "|");
int compareTo(TokenType other) => ordinal - other.ordinal;
int get hashCode => ordinal;
String toString() => name;
diff --git a/pkg/analyzer_experimental/lib/src/generated/sdk.dart b/pkg/analyzer_experimental/lib/src/generated/sdk.dart
index 4f1cc08..ca85cf4 100644
--- a/pkg/analyzer_experimental/lib/src/generated/sdk.dart
+++ b/pkg/analyzer_experimental/lib/src/generated/sdk.dart
@@ -17,67 +17,67 @@
String get category;
/**
- * Return the path to the file defining the library. The path is relative to the `lib`directory within the SDK.
+ * Return the path to the file defining the library. The path is relative to the {@code lib}directory within the SDK.
* @return the path to the file defining the library
*/
String get path;
/**
- * Return the short name of the library. This is the name used after `dart:` in a URI.
+ * Return the short name of the library. This is the name used after {@code dart:} in a URI.
* @return the short name of the library
*/
String get shortName;
/**
- * Return `true` if this library can be compiled to JavaScript by dart2js.
- * @return `true` if this library can be compiled to JavaScript by dart2js
+ * Return {@code true} if this library can be compiled to JavaScript by dart2js.
+ * @return {@code true} if this library can be compiled to JavaScript by dart2js
*/
- bool get isDart2JsLibrary;
+ bool isDart2JsLibrary();
/**
- * Return `true` if the library is documented.
- * @return `true` if the library is documented
+ * Return {@code true} if the library is documented.
+ * @return {@code true} if the library is documented
*/
- bool get isDocumented;
+ bool isDocumented();
/**
- * Return `true` if the library is an implementation library.
- * @return `true` if the library is an implementation library
+ * Return {@code true} if the library is an implementation library.
+ * @return {@code true} if the library is an implementation library
*/
- bool get isImplementation;
+ bool isImplementation();
/**
- * Return `true` if library is internal can be used only by other SDK libraries.
- * @return `true` if library is internal can be used only by other SDK libraries
+ * Return {@code true} if library is internal can be used only by other SDK libraries.
+ * @return {@code true} if library is internal can be used only by other SDK libraries
*/
- bool get isInternal;
+ bool isInternal();
/**
- * Return `true` if library can be used for both client and server.
- * @return `true` if this library can be used for both client and server.
+ * Return {@code true} if library can be used for both client and server.
+ * @return {@code true} if this library can be used for both client and server.
*/
- bool get isShared;
+ bool isShared();
/**
- * Return `true` if this library can be run on the VM.
- * @return `true` if this library can be run on the VM
+ * Return {@code true} if this library can be run on the VM.
+ * @return {@code true} if this library can be run on the VM
*/
- bool get isVmLibrary;
+ bool isVmLibrary();
}
/**
- * Instances of the class `SdkLibrary` represent the information known about a single library
+ * Instances of the class {@code SdkLibrary} represent the information known about a single library
* within the SDK.
* @coverage dart.engine.sdk
*/
class SdkLibraryImpl implements SdkLibrary {
/**
- * The short name of the library. This is the name used after `dart:` in a URI.
+ * The short name of the library. This is the name used after {@code dart:} in a URI.
*/
String _shortName = null;
/**
- * The path to the file defining the library. The path is relative to the `lib` directory
+ * The path to the file defining the library. The path is relative to the {@code lib} directory
* within the SDK.
*/
String _path = null;
@@ -125,21 +125,21 @@
String get category => _category;
String get path => _path;
String get shortName => _shortName;
- bool get isDart2JsLibrary => (_platforms & DART2JS_PLATFORM) != 0;
- bool get isDocumented => _documented;
- bool get isImplementation => _implementation;
- bool get isInternal => "Internal" == _category;
+ bool isDart2JsLibrary() => (_platforms & DART2JS_PLATFORM) != 0;
+ bool isDocumented() => _documented;
+ bool isImplementation() => _implementation;
+ bool isInternal() => "Internal" == _category;
/**
- * Return `true` if library can be used for both client and server
+ * Return {@code true} if library can be used for both client and server
*/
- bool get isShared => _category == "Shared";
+ bool isShared() => _category == "Shared";
/**
- * Return `true` if this library can be run on the VM.
- * @return `true` if this library can be run on the VM
+ * Return {@code true} if this library can be run on the VM.
+ * @return {@code true} if this library can be run on the VM
*/
- bool get isVmLibrary => (_platforms & VM_PLATFORM) != 0;
+ bool isVmLibrary() => (_platforms & VM_PLATFORM) != 0;
/**
* Set the name of the category containing the library to the given name.
@@ -158,7 +158,7 @@
/**
* Set whether the library is documented to match the given value.
- * @param documented `true` if the library is documented
+ * @param documented {@code true} if the library is documented
*/
void set documented(bool documented2) {
this._documented = documented2;
@@ -166,14 +166,14 @@
/**
* Set whether the library is an implementation library to match the given value.
- * @param implementation `true` if the library is an implementation library
+ * @param implementation {@code true} if the library is an implementation library
*/
void set implementation(bool implementation2) {
this._implementation = implementation2;
}
/**
- * Set the path to the file defining the library to the given path. The path is relative to the`lib` directory within the SDK.
+ * Set the path to the file defining the library to the given path. The path is relative to the{@code lib} directory within the SDK.
* @param path the path to the file defining the library
*/
void set path(String path2) {
@@ -188,7 +188,7 @@
}
}
/**
- * Instances of the class `LibraryMap` map Dart library URI's to the [SdkLibraryImpllibrary].
+ * Instances of the class {@code LibraryMap} map Dart library URI's to the {@link SdkLibraryImpllibrary}.
* @coverage dart.engine.sdk
*/
class LibraryMap {
@@ -199,14 +199,14 @@
Map<String, SdkLibraryImpl> _libraryMap = new Map<String, SdkLibraryImpl>();
/**
- * Return the library with the given URI, or `null` if the URI does not map to a library.
+ * Return the library with the given URI, or {@code null} if the URI does not map to a library.
* @param dartUri the URI of the library to be returned
* @return the library with the given URI
*/
SdkLibrary getLibrary(String dartUri) => _libraryMap[dartUri];
/**
- * Return an array containing all the sdk libraries [SdkLibraryImpl] in the mapping
+ * Return an array containing all the sdk libraries {@link SdkLibraryImpl} in the mapping
* @return the sdk libraries in the mapping
*/
List<SdkLibrary> get sdkLibraries => new List.from(_libraryMap.values);
@@ -218,7 +218,7 @@
List<String> get uris => new List.from(_libraryMap.keys.toSet());
/**
- * Return the library with the given URI, or `null` if the URI does not map to a library.
+ * Return the library with the given URI, or {@code null} if the URI does not map to a library.
* @param dartUri the URI of the library to be returned
* @param library the library with the given URI
*/
@@ -233,7 +233,7 @@
int size() => _libraryMap.length;
}
/**
- * Instances of the class `DartSdk` represent a Dart SDK installed in a specified location.
+ * Instances of the class {@code DartSdk} represent a Dart SDK installed in a specified location.
* @coverage dart.engine.sdk
*/
abstract class DartSdk {
@@ -264,8 +264,8 @@
Source fromEncoding(ContentCache contentCache, UriKind kind, Uri uri);
/**
- * Return the [AnalysisContext] used for all of the sources in this [DartSdk].
- * @return the [AnalysisContext] used for all of the sources in this [DartSdk]
+ * Return the {@link AnalysisContext} used for all of the sources in this {@link DartSdk}.
+ * @return the {@link AnalysisContext} used for all of the sources in this {@link DartSdk}
*/
AnalysisContext get context;
@@ -276,14 +276,14 @@
List<SdkLibrary> get sdkLibraries;
/**
- * Return the library representing the library with the given `dart:` URI, or `null`if the given URI does not denote a library in this SDK.
+ * Return the library representing the library with the given {@code dart:} URI, or {@code null}if the given URI does not denote a library in this SDK.
* @param dartUri the URI of the library to be returned
* @return the SDK library object
*/
SdkLibrary getSdkLibrary(String dartUri);
/**
- * Return the revision number of this SDK, or `"0"` if the revision number cannot be
+ * Return the revision number of this SDK, or {@code "0"} if the revision number cannot be
* discovered.
* @return the revision number of this SDK
*/
@@ -296,7 +296,7 @@
List<String> get uris;
/**
- * Return the source representing the library with the given `dart:` URI, or `null` if
+ * Return the source representing the library with the given {@code dart:} URI, or {@code null} if
* the given URI does not denote a library in this SDK.
* @param contentCache the content cache used to access the contents of the mapped source
* @param dartUri the URI of the library to be returned
diff --git a/pkg/analyzer_experimental/lib/src/generated/sdk_io.dart b/pkg/analyzer_experimental/lib/src/generated/sdk_io.dart
index 5bcead2..baf26d7 100644
--- a/pkg/analyzer_experimental/lib/src/generated/sdk_io.dart
+++ b/pkg/analyzer_experimental/lib/src/generated/sdk_io.dart
@@ -14,14 +14,14 @@
import 'sdk.dart';
import 'engine.dart';
/**
- * Instances of the class `DirectoryBasedDartSdk` represent a Dart SDK installed in a
+ * Instances of the class {@code DirectoryBasedDartSdk} represent a Dart SDK installed in a
* specified directory.
* @coverage dart.engine.sdk
*/
class DirectoryBasedDartSdk implements DartSdk {
/**
- * The [AnalysisContext] which is used for all of the sources in this [DartSdk].
+ * The {@link AnalysisContext} which is used for all of the sources in this {@link DartSdk}.
*/
InternalAnalysisContext _analysisContext;
@@ -31,7 +31,7 @@
JavaFile _sdkDirectory;
/**
- * The revision number of this SDK, or `"0"` if the revision number cannot be discovered.
+ * The revision number of this SDK, or {@code "0"} if the revision number cannot be discovered.
*/
String _sdkVersion;
@@ -81,7 +81,7 @@
static String _DARTIUM_EXECUTABLE_NAME_WIN = "Chrome.exe";
/**
- * The name of the [System] property whose value is the path to the default Dart SDK
+ * The name of the {@link System} property whose value is the path to the default Dart SDK
* directory.
*/
static String _DEFAULT_DIRECTORY_PROPERTY_NAME = "com.google.dart.sdk";
@@ -129,7 +129,7 @@
static String _VM_EXECUTABLE_NAME = "dart";
/**
- * Return the default Dart SDK, or `null` if the directory containing the default SDK cannot
+ * Return the default Dart SDK, or {@code null} if the directory containing the default SDK cannot
* be determined (or does not exist).
* @return the default Dart SDK
*/
@@ -142,10 +142,10 @@
}
/**
- * Return the default directory for the Dart SDK, or `null` if the directory cannot be
- * determined (or does not exist). The default directory is provided by a [System] property
- * named `com.google.dart.sdk`, or, if the property is not defined, an environment variable
- * named `DART_SDK`.
+ * Return the default directory for the Dart SDK, or {@code null} if the directory cannot be
+ * determined (or does not exist). The default directory is provided by a {@link System} property
+ * named {@code com.google.dart.sdk}, or, if the property is not defined, an environment variable
+ * named {@code DART_SDK}.
* @return the default directory for the Dart SDK
*/
static JavaFile get defaultSdkDirectory {
@@ -184,7 +184,7 @@
AnalysisContext get context => _analysisContext;
/**
- * Return the file containing the Dartium executable, or `null` if it does not exist.
+ * Return the file containing the Dartium executable, or {@code null} if it does not exist.
* @return the file containing the Dartium executable
*/
JavaFile get dartiumExecutable {
@@ -219,7 +219,7 @@
JavaFile get docDirectory => new JavaFile.relative(_sdkDirectory, _DOCS_DIRECTORY_NAME);
/**
- * Return the auxiliary documentation file for the given library, or `null` if no such file
+ * Return the auxiliary documentation file for the given library, or {@code null} if no such file
* exists.
* @param libraryName the name of the library associated with the documentation file to be
* returned
@@ -247,7 +247,7 @@
SdkLibrary getSdkLibrary(String dartUri) => _libraryMap.getLibrary(dartUri);
/**
- * Return the revision number of this SDK, or `"0"` if the revision number cannot be
+ * Return the revision number of this SDK, or {@code "0"} if the revision number cannot be
* discovered.
* @return the revision number of this SDK
*/
@@ -275,7 +275,7 @@
List<String> get uris => _libraryMap.uris;
/**
- * Return the file containing the VM executable, or `null` if it does not exist.
+ * Return the file containing the VM executable, or {@code null} if it does not exist.
* @return the file containing the VM executable
*/
JavaFile get vmExecutable {
@@ -291,16 +291,16 @@
}
/**
- * Return `true` if this SDK includes documentation.
- * @return `true` if this installation of the SDK has documentation
+ * Return {@code true} if this SDK includes documentation.
+ * @return {@code true} if this installation of the SDK has documentation
*/
bool hasDocumentation() => docDirectory.exists();
/**
- * Return `true` if the Dartium binary is available.
- * @return `true` if the Dartium binary is available
+ * Return {@code true} if the Dartium binary is available.
+ * @return {@code true} if the Dartium binary is available
*/
- bool get isDartiumInstalled => dartiumExecutable != null;
+ bool isDartiumInstalled() => dartiumExecutable != null;
Source mapDartUri(ContentCache contentCache, String dartUri) {
SdkLibrary library = getSdkLibrary(dartUri);
if (library == null) {
@@ -366,7 +366,7 @@
}
}
/**
- * Instances of the class `SdkLibrariesReader` read and parse the libraries file
+ * Instances of the class {@code SdkLibrariesReader} read and parse the libraries file
* (dart-sdk/lib/_internal/libraries.dart) for information about the libraries in an SDK. The
* library information is represented as a Dart file containing a single top-level variable whose
* value is a const map. The keys of the map are the names of libraries defined in the SDK and the
@@ -438,7 +438,7 @@
static String _PLATFORMS = "platforms";
/**
- * The value of the [PLATFORMS platforms] parameter used to specify that the library can
+ * The value of the {@link #PLATFORMS platforms} parameter used to specify that the library can
* be used on the VM.
*/
static String _VM_PLATFORM = "VM_PLATFORM";
diff --git a/pkg/analyzer_experimental/lib/src/generated/source.dart b/pkg/analyzer_experimental/lib/src/generated/source.dart
index d149b4b..da272e9 100644
--- a/pkg/analyzer_experimental/lib/src/generated/source.dart
+++ b/pkg/analyzer_experimental/lib/src/generated/source.dart
@@ -5,7 +5,7 @@
import 'sdk.dart' show DartSdk;
import 'engine.dart' show AnalysisContext;
/**
- * Instances of the class `SourceFactory` resolve possibly relative URI's against an existing[Source source].
+ * Instances of the class {@code SourceFactory} resolve possibly relative URI's against an existing{@link Source source}.
* @coverage dart.engine.source
*/
class SourceFactory {
@@ -50,7 +50,7 @@
}
/**
- * Return a source object representing the given absolute URI, or `null` if the URI is not a
+ * Return a source object representing the given absolute URI, or {@code null} if the URI is not a
* valid URI or if it is not an absolute URI.
* @param absoluteUri the absolute URI to be resolved
* @return a source object representing the absolute URI
@@ -108,9 +108,9 @@
AnalysisContext get context => _context;
/**
- * Return the [DartSdk] associated with this [SourceFactory], or `null` if there
+ * Return the {@link DartSdk} associated with this {@link SourceFactory}, or {@code null} if there
* is no such SDK.
- * @return the [DartSdk] associated with this [SourceFactory], or `null` if
+ * @return the {@link DartSdk} associated with this {@link SourceFactory}, or {@code null} if
* there is no such SDK
*/
DartSdk get dartSdk {
@@ -125,7 +125,7 @@
/**
* Return a source object representing the URI that results from resolving the given (possibly
- * relative) contained URI against the URI associated with an existing source object, or`null` if either the contained URI is invalid or if it cannot be resolved against the
+ * relative) contained URI against the URI associated with an existing source object, or{@code null} if either the contained URI is invalid or if it cannot be resolved against the
* source object's URI.
* @param containingSource the source containing the given URI
* @param containedUri the (possibly relative) URI to be resolved against the containing source
@@ -142,7 +142,7 @@
/**
* Return an absolute URI that represents the given source.
* @param source the source to get URI for
- * @return the absolute URI representing the given source, may be `null`
+ * @return the absolute URI representing the given source, may be {@code null}
*/
Uri restoreUri(Source source) {
for (UriResolver resolver in _resolvers) {
@@ -156,7 +156,7 @@
/**
* Set the contents of the given source to the given contents. This has the effect of overriding
- * the default contents of the source. If the contents are `null` the override is removed so
+ * the default contents of the source. If the contents are {@code null} the override is removed so
* that the default contents will be returned.
* @param source the source whose contents are being overridden
* @param contents the new contents of the source
@@ -167,8 +167,8 @@
/**
* Set the analysis context that this source factory is associated with to the given context.
- *
- * <b>Note:</b> This method should only be invoked by[AnalysisContextImpl#setSourceFactory] and is only public out of
+ * <p>
+ * <b>Note:</b> This method should only be invoked by{@link AnalysisContextImpl#setSourceFactory(SourceFactory)} and is only public out of
* necessity.
* @param context the analysis context that this source factory is associated with
*/
@@ -177,20 +177,20 @@
}
/**
- * Return the contents of the given source, or `null` if this factory does not override the
+ * Return the contents of the given source, or {@code null} if this factory does not override the
* contents of the source.
- *
- * <b>Note:</b> This method is not intended to be used except by[FileBasedSource#getContents].
+ * <p>
+ * <b>Note:</b> This method is not intended to be used except by{@link FileBasedSource#getContents(com.google.dart.engine.source.Source.ContentReceiver)}.
* @param source the source whose content is to be returned
* @return the contents of the given source
*/
String getContents(Source source) => _contentCache.getContents(source);
/**
- * Return the modification stamp of the given source, or `null` if this factory does not
+ * Return the modification stamp of the given source, or {@code null} if this factory does not
* override the contents of the source.
- *
- * <b>Note:</b> This method is not intended to be used except by[FileBasedSource#getModificationStamp].
+ * <p>
+ * <b>Note:</b> This method is not intended to be used except by{@link FileBasedSource#getModificationStamp()}.
* @param source the source whose modification stamp is to be returned
* @return the modification stamp of the given source
*/
@@ -198,7 +198,7 @@
/**
* Return a source object representing the URI that results from resolving the given (possibly
- * relative) contained URI against the URI associated with an existing source object, or`null` if either the contained URI is invalid or if it cannot be resolved against the
+ * relative) contained URI against the URI associated with an existing source object, or{@code null} if either the contained URI is invalid or if it cannot be resolved against the
* source object's URI.
* @param containingSource the source containing the given URI
* @param containedUri the (possibly relative) URI to be resolved against the containing source
@@ -219,7 +219,7 @@
}
}
/**
- * The abstract class `UriResolver` defines the behavior of objects that are used to resolve
+ * The abstract class {@code UriResolver} defines the behavior of objects that are used to resolve
* URI's for a source factory. Subclasses of this class are expected to resolve a single scheme of
* absolute URI.
* @coverage dart.engine.source
@@ -228,34 +228,34 @@
/**
* If this resolver should be used for URI's of the given kind, resolve the given absolute URI.
- * The URI does not need to have the scheme handled by this resolver if the kind matches. Return a[Source source] representing the file to which it was resolved, or `null` if it
+ * The URI does not need to have the scheme handled by this resolver if the kind matches. Return a{@link Source source} representing the file to which it was resolved, or {@code null} if it
* could not be resolved.
* @param contentCache the content cache used to access the contents of the returned source
* @param kind the kind of URI that was originally resolved in order to produce an encoding with
* the given URI
* @param uri the URI to be resolved
- * @return a [Source source] representing the file to which given URI was resolved
+ * @return a {@link Source source} representing the file to which given URI was resolved
*/
Source fromEncoding(ContentCache contentCache, UriKind kind, Uri uri);
/**
- * Resolve the given absolute URI. Return a [Source source] representing the file to which
- * it was resolved, or `null` if it could not be resolved.
+ * Resolve the given absolute URI. Return a {@link Source source} representing the file to which
+ * it was resolved, or {@code null} if it could not be resolved.
* @param contentCache the content cache used to access the contents of the returned source
* @param uri the URI to be resolved
- * @return a [Source source] representing the file to which given URI was resolved
+ * @return a {@link Source source} representing the file to which given URI was resolved
*/
Source resolveAbsolute(ContentCache contentCache, Uri uri);
/**
* Return an absolute URI that represents the given source.
* @param source the source to get URI for
- * @return the absolute URI representing the given source, may be `null`
+ * @return the absolute URI representing the given source, may be {@code null}
*/
Uri restoreAbsolute(Source source) => null;
}
/**
- * The interface `Source` defines the behavior of objects representing source code that can be
+ * The interface {@code Source} defines the behavior of objects representing source code that can be
* compiled.
* @coverage dart.engine.source
*/
@@ -267,18 +267,18 @@
static final List<Source> EMPTY_ARRAY = new List<Source>(0);
/**
- * Return `true` if the given object is a source that represents the same source code as
+ * Return {@code true} if the given object is a source that represents the same source code as
* this source.
* @param object the object to be compared with this object
- * @return `true` if the given object is a source that represents the same source code as
+ * @return {@code true} if the given object is a source that represents the same source code as
* this source
* @see Object#equals(Object)
*/
bool operator ==(Object object);
/**
- * Return `true` if this source exists.
- * @return `true` if this source exists
+ * Return {@code true} if this source exists.
+ * @return {@code true} if this source exists
*/
bool exists();
@@ -342,27 +342,27 @@
int get hashCode;
/**
- * Return `true` if this source is in one of the system libraries.
- * @return `true` if this is in a system library
+ * Return {@code true} if this source is in one of the system libraries.
+ * @return {@code true} if this is in a system library
*/
- bool get isInSystemLibrary;
+ bool isInSystemLibrary();
/**
- * Resolve the relative URI against the URI associated with this source object. Return a[Source source] representing the URI to which it was resolved, or `null` if it
+ * Resolve the relative URI against the URI associated with this source object. Return a{@link Source source} representing the URI to which it was resolved, or {@code null} if it
* could not be resolved.
- *
+ * <p>
* Note: This method is not intended for public use, it is only visible out of necessity. It is
- * only intended to be invoked by a [SourceFactory source factory]. Source factories will
+ * only intended to be invoked by a {@link SourceFactory source factory}. Source factories will
* only invoke this method if the URI is relative, so implementations of this method are not
* required to, and generally do not, verify the argument. The result of invoking this method with
* an absolute URI is intentionally left unspecified.
* @param relativeUri the relative URI to be resolved against the containing source
- * @return a [Source source] representing the URI to which given URI was resolved
+ * @return a {@link Source source} representing the URI to which given URI was resolved
*/
Source resolveRelative(Uri relativeUri);
}
/**
- * The interface `ContentReceiver` defines the behavior of objects that can receive the
+ * The interface {@code ContentReceiver} defines the behavior of objects that can receive the
* content of a source.
*/
abstract class Source_ContentReceiver {
@@ -382,7 +382,7 @@
void accept2(String contents, int modificationTime);
}
/**
- * The enumeration `SourceKind` defines the different kinds of sources that are known to the
+ * The enumeration {@code SourceKind} defines the different kinds of sources that are known to the
* analysis engine.
* @coverage dart.engine.source
*/
@@ -424,7 +424,7 @@
String toString() => name;
}
/**
- * The enumeration `UriKind` defines the different kinds of URI's that are known to the
+ * The enumeration {@code UriKind} defines the different kinds of URI's that are known to the
* analysis engine. These are used to keep track of the kind of URI associated with a given source.
* @coverage dart.engine.source
*/
@@ -466,7 +466,7 @@
}
/**
- * Return the URI kind represented by the given encoding, or `null` if there is no kind with
+ * Return the URI kind represented by the given encoding, or {@code null} if there is no kind with
* the given encoding.
* @param encoding the single character encoding used to identify the URI kind to be returned
* @return the URI kind represented by the given encoding
@@ -495,7 +495,7 @@
String toString() => name;
}
/**
- * A source range defines an [Element]'s source coordinates relative to its [Source].
+ * A source range defines an {@link Element}'s source coordinates relative to its {@link Source}.
* @coverage dart.engine.utilities
*/
class SourceRange {
@@ -523,27 +523,27 @@
}
/**
- * @return `true` if <code>x</code> is in \[offset, offset + length) interval.
+ * @return {@code true} if <code>x</code> is in \[offset, offset + length) interval.
*/
bool contains(int x) => _offset <= x && x < _offset + _length;
/**
- * @return `true` if <code>x</code> is in (offset, offset + length) interval.
+ * @return {@code true} if <code>x</code> is in (offset, offset + length) interval.
*/
bool containsExclusive(int x) => _offset < x && x < _offset + _length;
/**
- * @return `true` if <code>otherRange</code> covers this [SourceRange].
+ * @return {@code true} if <code>otherRange</code> covers this {@link SourceRange}.
*/
bool coveredBy(SourceRange otherRange) => otherRange.covers(this);
/**
- * @return `true` if this [SourceRange] covers <code>otherRange</code>.
+ * @return {@code true} if this {@link SourceRange} covers <code>otherRange</code>.
*/
bool covers(SourceRange otherRange) => offset <= otherRange.offset && otherRange.end <= end;
/**
- * @return `true` if this [SourceRange] ends in <code>otherRange</code>.
+ * @return {@code true} if this {@link SourceRange} ends in <code>otherRange</code>.
*/
bool endsIn(SourceRange otherRange) {
int thisEnd = end;
@@ -564,7 +564,7 @@
int get end => _offset + _length;
/**
- * @return the expanded instance of [SourceRange], which has the same center.
+ * @return the expanded instance of {@link SourceRange}, which has the same center.
*/
SourceRange getExpanded(int delta) => new SourceRange(_offset - delta, delta + _length + delta);
@@ -577,7 +577,7 @@
int get length => _length;
/**
- * @return the instance of [SourceRange] with end moved on "delta".
+ * @return the instance of {@link SourceRange} with end moved on "delta".
*/
SourceRange getMoveEnd(int delta) => new SourceRange(_offset, _length + delta);
@@ -590,13 +590,13 @@
int get offset => _offset;
/**
- * @return the expanded translated of [SourceRange], with moved start and the same length.
+ * @return the expanded translated of {@link SourceRange}, with moved start and the same length.
*/
SourceRange getTranslated(int delta) => new SourceRange(_offset + delta, _length);
int get hashCode => 31 * _offset + _length;
/**
- * @return `true` if this [SourceRange] intersects with given.
+ * @return {@code true} if this {@link SourceRange} intersects with given.
*/
bool intersects(SourceRange other) {
if (other == null) {
@@ -612,7 +612,7 @@
}
/**
- * @return `true` if this [SourceRange] starts in <code>otherRange</code>.
+ * @return {@code true} if this {@link SourceRange} starts in <code>otherRange</code>.
*/
bool startsIn(SourceRange otherRange) => otherRange.contains(_offset);
String toString() {
@@ -626,8 +626,8 @@
}
}
/**
- * The interface `SourceContainer` is used by clients to define a collection of sources
- *
+ * The interface {@code SourceContainer} is used by clients to define a collection of sources
+ * <p>
* Source containers are not used within analysis engine, but can be used by clients to group
* sources for the purposes of accessing composite dependency information. For example, the Eclipse
* client uses source containers to represent Eclipse projects, which allows it to easily compute
@@ -639,12 +639,12 @@
/**
* Determine if the specified source is part of the receiver's collection of sources.
* @param source the source in question
- * @return `true` if the receiver contains the source, else `false`
+ * @return {@code true} if the receiver contains the source, else {@code false}
*/
bool contains(Source source);
}
/**
- * Instances of the class `DartUriResolver` resolve `dart` URI's.
+ * Instances of the class {@code DartUriResolver} resolve {@code dart} URI's.
* @coverage dart.engine.source
*/
class DartUriResolver extends UriResolver {
@@ -655,14 +655,14 @@
DartSdk _sdk;
/**
- * The name of the `dart` scheme.
+ * The name of the {@code dart} scheme.
*/
static String _DART_SCHEME = "dart";
/**
- * Return `true` if the given URI is a `dart:` URI.
+ * Return {@code true} if the given URI is a {@code dart:} URI.
* @param uri the URI being tested
- * @return `true` if the given URI is a `dart:` URI
+ * @return {@code true} if the given URI is a {@code dart:} URI
*/
static bool isDartUri(Uri uri) => _DART_SCHEME == uri.scheme;
@@ -682,8 +682,8 @@
}
/**
- * Return the [DartSdk] against which URIs are to be resolved.
- * @return the [DartSdk] against which URIs are to be resolved.
+ * Return the {@link DartSdk} against which URIs are to be resolved.
+ * @return the {@link DartSdk} against which URIs are to be resolved.
*/
DartSdk get dartSdk => _sdk;
Source resolveAbsolute(ContentCache contentCache, Uri uri) {
@@ -694,7 +694,7 @@
}
}
/**
- * Instances of the class `LineInfo` encapsulate information about line and column information
+ * Instances of the class {@code LineInfo} encapsulate information about line and column information
* within a source file.
* @coverage dart.engine.utilities
*/
@@ -735,7 +735,7 @@
}
}
/**
- * Instances of the class `Location` represent the location of a character as a line and
+ * Instances of the class {@code Location} represent the location of a character as a line and
* column pair.
*/
class LineInfo_Location {
@@ -774,7 +774,7 @@
int get lineNumber => _lineNumber;
}
/**
- * Instances of class `ContentCache` hold content used to override the default content of a[Source].
+ * Instances of class {@code ContentCache} hold content used to override the default content of a{@link Source}.
* @coverage dart.engine.source
*/
class ContentCache {
@@ -792,20 +792,20 @@
Map<Source, int> _stampMap = new Map<Source, int>();
/**
- * Return the contents of the given source, or `null` if this cache does not override the
+ * Return the contents of the given source, or {@code null} if this cache does not override the
* contents of the source.
- *
- * <b>Note:</b> This method is not intended to be used except by[SourceFactory#getContents].
+ * <p>
+ * <b>Note:</b> This method is not intended to be used except by{@link SourceFactory#getContents(com.google.dart.engine.source.Source.ContentReceiver)}.
* @param source the source whose content is to be returned
* @return the contents of the given source
*/
String getContents(Source source) => _contentMap[source];
/**
- * Return the modification stamp of the given source, or `null` if this cache does not
+ * Return the modification stamp of the given source, or {@code null} if this cache does not
* override the contents of the source.
- *
- * <b>Note:</b> This method is not intended to be used except by[SourceFactory#getModificationStamp].
+ * <p>
+ * <b>Note:</b> This method is not intended to be used except by{@link SourceFactory#getModificationStamp(com.google.dart.engine.source.Source)}.
* @param source the source whose modification stamp is to be returned
* @return the modification stamp of the given source
*/
@@ -813,7 +813,7 @@
/**
* Set the contents of the given source to the given contents. This has the effect of overriding
- * the default contents of the source. If the contents are `null` the override is removed so
+ * the default contents of the source. If the contents are {@code null} the override is removed so
* that the default contents will be returned.
* @param source the source whose contents are being overridden
* @param contents the new contents of the source
diff --git a/pkg/analyzer_experimental/lib/src/generated/source_io.dart b/pkg/analyzer_experimental/lib/src/generated/source_io.dart
index 513f77f..98d8fc0 100644
--- a/pkg/analyzer_experimental/lib/src/generated/source_io.dart
+++ b/pkg/analyzer_experimental/lib/src/generated/source_io.dart
@@ -9,7 +9,7 @@
import 'engine.dart' show AnalysisContext, AnalysisEngine;
export 'source.dart';
/**
- * Instances of the class `FileBasedSource` implement a source that represents a file.
+ * Instances of the class {@code FileBasedSource} implement a source that represents a file.
* @coverage dart.engine.source
*/
class FileBasedSource implements Source {
@@ -52,7 +52,7 @@
* Initialize a newly created source object.
* @param contentCache the content cache used to access the contents of this source
* @param file the file represented by this source
- * @param flags `true` if this source is in one of the system libraries
+ * @param flags {@code true} if this source is in one of the system libraries
*/
FileBasedSource.con2(ContentCache contentCache2, JavaFile file2, UriKind uriKind2) {
_jtd_constructor_339_impl(contentCache2, file2, uriKind2);
@@ -87,7 +87,7 @@
String get shortName => _file.getName();
UriKind get uriKind => _uriKind;
int get hashCode => _file.hashCode;
- bool get isInSystemLibrary => identical(_uriKind, UriKind.DART_URI);
+ bool isInSystemLibrary() => identical(_uriKind, UriKind.DART_URI);
Source resolveRelative(Uri containedUri) {
try {
Uri resolvedUri = file.toURI().resolveUri(containedUri);
@@ -105,15 +105,15 @@
/**
* Return the file represented by this source. This is an internal method that is only intended to
- * be used by [UriResolver].
+ * be used by {@link UriResolver}.
* @return the file represented by this source
*/
JavaFile get file => _file;
}
/**
- * Instances of the class `PackageUriResolver` resolve `package` URI's in the context of
+ * Instances of the class {@code PackageUriResolver} resolve {@code package} URI's in the context of
* an application.
- *
+ * <p>
* For the purposes of sharing analysis, the path to each package under the "packages" directory
* should be canonicalized, but to preserve relative links within a package, the remainder of the
* path from the package directory to the leaf should not.
@@ -122,12 +122,12 @@
class PackageUriResolver extends UriResolver {
/**
- * The package directories that `package` URI's are assumed to be relative to.
+ * The package directories that {@code package} URI's are assumed to be relative to.
*/
List<JavaFile> _packagesDirectories;
/**
- * The name of the `package` scheme.
+ * The name of the {@code package} scheme.
*/
static String PACKAGE_SCHEME = "package";
@@ -137,16 +137,16 @@
static bool _CanLogRequiredKeyIoException = true;
/**
- * Return `true` if the given URI is a `package` URI.
+ * Return {@code true} if the given URI is a {@code package} URI.
* @param uri the URI being tested
- * @return `true` if the given URI is a `package` URI
+ * @return {@code true} if the given URI is a {@code package} URI
*/
static bool isPackageUri(Uri uri) => PACKAGE_SCHEME == uri.scheme;
/**
- * Initialize a newly created resolver to resolve `package` URI's relative to the given
+ * Initialize a newly created resolver to resolve {@code package} URI's relative to the given
* package directories.
- * @param packagesDirectories the package directories that `package` URI's are assumed to be
+ * @param packagesDirectories the package directories that {@code package} URI's are assumed to be
* relative to
*/
PackageUriResolver(List<JavaFile> packagesDirectories) {
@@ -216,11 +216,11 @@
/**
* Answer the canonical file for the specified package.
- * @param packagesDirectory the "packages" directory (not `null`)
- * @param pkgName the package name (not `null`, not empty)
- * @param relPath the path relative to the package directory (not `null`, no leading slash,
+ * @param packagesDirectory the "packages" directory (not {@code null})
+ * @param pkgName the package name (not {@code null}, not empty)
+ * @param relPath the path relative to the package directory (not {@code null}, no leading slash,
* but may be empty string)
- * @return the file (not `null`)
+ * @return the file (not {@code null})
*/
JavaFile getCanonicalFile(JavaFile packagesDirectory, String pkgName, String relPath) {
JavaFile pkgDir = new JavaFile.relative(packagesDirectory, pkgName);
@@ -238,7 +238,7 @@
}
}
/**
- * Instances of the class [DirectoryBasedSourceContainer] represent a source container that
+ * Instances of the class {@link DirectoryBasedSourceContainer} represent a source container that
* contains all sources within a given directory.
* @coverage dart.engine.source
*/
@@ -258,14 +258,14 @@
}
/**
- * The container's path (not `null`).
+ * The container's path (not {@code null}).
*/
String _path;
/**
- * Construct a container representing the specified directory and containing any sources whose[Source#getFullName] starts with the directory's path. This is a convenience method,
- * fully equivalent to [DirectoryBasedSourceContainer#DirectoryBasedSourceContainer].
- * @param directory the directory (not `null`)
+ * Construct a container representing the specified directory and containing any sources whose{@link Source#getFullName()} starts with the directory's path. This is a convenience method,
+ * fully equivalent to {@link DirectoryBasedSourceContainer#DirectoryBasedSourceContainer(String)}.
+ * @param directory the directory (not {@code null})
*/
DirectoryBasedSourceContainer.con1(JavaFile directory) {
_jtd_constructor_336_impl(directory);
@@ -275,8 +275,8 @@
}
/**
- * Construct a container representing the specified path and containing any sources whose[Source#getFullName] starts with the specified path.
- * @param path the path (not `null` and not empty)
+ * Construct a container representing the specified path and containing any sources whose{@link Source#getFullName()} starts with the specified path.
+ * @param path the path (not {@code null} and not empty)
*/
DirectoryBasedSourceContainer.con2(String path2) {
_jtd_constructor_337_impl(path2);
@@ -289,27 +289,27 @@
/**
* Answer the receiver's path, used to determine if a source is contained in the receiver.
- * @return the path (not `null`, not empty)
+ * @return the path (not {@code null}, not empty)
*/
String get path => _path;
int get hashCode => _path.hashCode;
String toString() => "SourceContainer[${_path}]";
}
/**
- * Instances of the class `FileUriResolver` resolve `file` URI's.
+ * Instances of the class {@code FileUriResolver} resolve {@code file} URI's.
* @coverage dart.engine.source
*/
class FileUriResolver extends UriResolver {
/**
- * The name of the `file` scheme.
+ * The name of the {@code file} scheme.
*/
static String FILE_SCHEME = "file";
/**
- * Return `true` if the given URI is a `file` URI.
+ * Return {@code true} if the given URI is a {@code file} URI.
* @param uri the URI being tested
- * @return `true` if the given URI is a `file` URI
+ * @return {@code true} if the given URI is a {@code file} URI
*/
static bool isFileUri(Uri uri) => uri.scheme == FILE_SCHEME;
Source fromEncoding(ContentCache contentCache, UriKind kind, Uri uri) {
diff --git a/pkg/analyzer_experimental/lib/src/generated/utilities_dart.dart b/pkg/analyzer_experimental/lib/src/generated/utilities_dart.dart
index 0a331cb..80804cd 100644
--- a/pkg/analyzer_experimental/lib/src/generated/utilities_dart.dart
+++ b/pkg/analyzer_experimental/lib/src/generated/utilities_dart.dart
@@ -2,7 +2,7 @@
// significant change. Please see the README file for more information.
library engine.utilities.dart;
/**
- * The enumeration `ParameterKind` defines the different kinds of parameters. There are two
+ * The enumeration {@code ParameterKind} defines the different kinds of parameters. There are two
* basic kinds of parameters: required and optional. Optional parameters are further divided into
* two kinds: positional optional and named optional.
* @coverage dart.engine.utilities
@@ -26,17 +26,17 @@
/**
* Initialize a newly created kind with the given state.
- * @param isOptional `true` if this is an optional parameter
+ * @param isOptional {@code true} if this is an optional parameter
*/
ParameterKind(this.name, this.ordinal, bool isOptional) {
this._isOptional2 = isOptional;
}
/**
- * Return `true` if this is an optional parameter.
- * @return `true` if this is an optional parameter
+ * Return {@code true} if this is an optional parameter.
+ * @return {@code true} if this is an optional parameter
*/
- bool get isOptional => _isOptional2;
+ bool isOptional() => _isOptional2;
int compareTo(ParameterKind other) => ordinal - other.ordinal;
int get hashCode => ordinal;
String toString() => name;
diff --git a/pkg/analyzer_experimental/lib/src/services/runtime/coverage_impl.dart b/pkg/analyzer_experimental/lib/src/services/runtime/coverage_impl.dart
new file mode 100644
index 0000000..df37f7b
--- /dev/null
+++ b/pkg/analyzer_experimental/lib/src/services/runtime/coverage_impl.dart
@@ -0,0 +1,157 @@
+// Copyright (c) 2013, 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.
+
+/// A library for code coverage support for Dart.
+library runtime.coverage_impl;
+
+import "dart:io";
+
+import "package:logging/logging.dart" as log;
+import "package:pathos/path.dart" as po;
+
+import 'package:analyzer_experimental/src/generated/source.dart' show Source;
+import 'package:analyzer_experimental/src/generated/scanner.dart' show StringScanner;
+import 'package:analyzer_experimental/src/generated/parser.dart' show Parser;
+import 'package:analyzer_experimental/src/generated/ast.dart';
+import 'package:analyzer_experimental/src/generated/engine.dart' show RecordingErrorListener;
+
+
+log.Logger logger = log.Logger.root;
+
+/// Abstract server that listens requests and serves files, may be rewriting them.
+abstract class RewriteServer {
+ String _basePath;
+ RewriteServer(this._basePath);
+ void start() {
+ HttpServer.bind("127.0.0.1", 3445).then((HttpServer server) {
+ logger.info('RewriteServer is listening at: ${server.port}.');
+ server.listen((HttpRequest request) {
+ var response = request.response;
+ // Prepare path.
+ var path = _basePath + '/' + request.uri.path;
+ path = po.normalize(path);
+ logger.info('[$path] Requested.');
+ // May be serve using just path.
+ {
+ String content = rewritePathContent(path);
+ if (content != null) {
+ logger.info('[$path] Request served by path.');
+ response.write(content);
+ response.close();
+ return;
+ }
+ }
+ // Serve from file.
+ logger.info('[$path] Serving file.');
+ var file = new File(path);
+ file.exists().then((bool found) {
+ if (found) {
+ logger.finest('[$path] Found file.');
+ file.readAsString().then((String content) {
+ logger.finest('[$path] Got file content.');
+ var sw = new Stopwatch();
+ sw.start();
+ try {
+ content = rewriteFileContent(path, content);
+ } finally {
+ sw.stop();
+ logger.fine('[$path] Rewritten in ${sw.elapsedMilliseconds} ms.');
+ }
+ response.write(content);
+ response.close();
+ });
+ } else {
+ logger.severe('[$path] File not found.');
+ response.statusCode = HttpStatus.NOT_FOUND;
+ response.close();
+ }
+ });
+ });
+ });
+ }
+
+ /// Subclasses implement this method to rewrite the provided [code] of the file with [path].
+ /// Returns some content or `null` if file content should be requested.
+ String rewritePathContent(String path);
+
+ /// Subclasses implement this method to rewrite the provided [code] of the file with [path].
+ String rewriteFileContent(String path, String code);
+}
+
+/// Server that rewrites Dart code so that it reports execution of statements and other nodes.
+class CoverageServer extends RewriteServer {
+ CoverageServer(String basePath) : super(basePath);
+
+ String rewritePathContent(String path) {
+ if (path.endsWith('__coverage_impl.dart')) {
+ String implPath = po.joinAll([
+ po.dirname(new Options().script),
+ '..', 'lib', 'src', 'services', 'runtime', 'coverage_lib.dart']);
+ return new File(implPath).readAsStringSync();
+ }
+ return null;
+ }
+
+ String rewriteFileContent(String path, String code) {
+ if (po.extension(path).toLowerCase() != '.dart') return code;
+ if (path.contains('packages')) return code;
+ var unit = _parseCode(code);
+ var injector = new StringInjector(code);
+ // Inject coverage library import.
+ var directives = unit.directives;
+ if (directives.isNotEmpty && directives[0] is LibraryDirective) {
+ injector.inject(directives[0].end, 'import "__coverage_impl.dart" as __cc;');
+ } else {
+ throw new Exception('Only single library coverage is implemented.');
+ }
+ // Insert touch() invocations.
+ unit.accept(new InsertTouchInvocationsVisitor(injector));
+ // Done.
+ code = injector.code;
+ logger.finest('[$path] Rewritten content\n$code');
+ return code;
+ }
+
+ CompilationUnit _parseCode(String code) {
+ var source = null;
+ var errorListener = new RecordingErrorListener();
+ var parser = new Parser(source, errorListener);
+ var scanner = new StringScanner(source, code, errorListener);
+ var token = scanner.tokenize();
+ return parser.parseCompilationUnit(token);
+ }
+}
+
+/// The visitor that inserts `touch` method invocations.
+class InsertTouchInvocationsVisitor extends GeneralizingASTVisitor {
+ StringInjector injector;
+ InsertTouchInvocationsVisitor(this.injector);
+ visitStatement(Statement node) {
+ super.visitStatement(node);
+ var offset = node.end;
+ if (node is Block) {
+ offset--;
+ }
+ if (node is Block && node.parent is BlockFunctionBody) return null;
+ injector.inject(offset, '__cc.touch(${node.offset});');
+ return null;
+ }
+}
+
+/// Helper for injecting fragments into some existing [String].
+class StringInjector {
+ String code;
+ int _lastOffset = -1;
+ int _delta = 0;
+ StringInjector(this.code);
+ void inject(int offset, String fragment) {
+ if (offset < _lastOffset) {
+ throw new ArgumentError('Only forward inserts are supported, was $_lastOffset given $offset');
+ }
+ _lastOffset = offset;
+ offset += _delta;
+ code = code.substring(0, offset) + fragment + code.substring(offset);
+ _delta += fragment.length;
+ }
+}
\ No newline at end of file
diff --git a/pkg/analyzer_experimental/lib/src/services/runtime/coverage_lib.dart b/pkg/analyzer_experimental/lib/src/services/runtime/coverage_lib.dart
new file mode 100644
index 0000000..945b38f
--- /dev/null
+++ b/pkg/analyzer_experimental/lib/src/services/runtime/coverage_lib.dart
@@ -0,0 +1,11 @@
+// Copyright (c) 2013, 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.
+
+/// This library is injected into the applications under coverage.
+library coverage_lib;
+
+/// Notifies that the object with the given [id] - statement, token, etc was executed.
+touch(int id) {
+ print('touch: $id');
+}
diff --git a/pkg/analyzer_experimental/test/generated/ast_test.dart b/pkg/analyzer_experimental/test/generated/ast_test.dart
index bd06fba..ae71ad1b 100644
--- a/pkg/analyzer_experimental/test/generated/ast_test.dart
+++ b/pkg/analyzer_experimental/test/generated/ast_test.dart
@@ -212,11 +212,11 @@
}
}
/**
- * The class `ASTFactory` defines utility methods that can be used to create AST nodes. The
+ * The class {@code ASTFactory} defines utility methods that can be used to create AST nodes. The
* nodes that are created are complete in the sense that all of the tokens that would have been
* associated with the nodes by a parser are also created, but the token stream is not constructed.
* None of the nodes are resolved.
- *
+ * <p>
* The general pattern is for the name of the factory method to be the same as the name of the class
* of AST node being created. There are two notable exceptions. The first is for methods creating
* nodes that are part of a cascade expression. These methods are all prefixed with 'cascaded'. The
@@ -402,7 +402,7 @@
/**
* Create a type name whose name has been resolved to the given element and whose type has been
* resolved to the type of the given element.
- *
+ * <p>
* <b>Note:</b> This method does not correctly handle class elements that have type parameters.
* @param element the element defining the type represented by the type name
* @return the type name that was created
@@ -1950,7 +1950,7 @@
}
/**
- * Assert that a `ToSourceVisitor` will produce the expected source when visiting the given
+ * Assert that a {@code ToSourceVisitor} will produce the expected source when visiting the given
* node.
* @param expectedSource the source string that the visitor is expected to produce
* @param node the AST node being visited to produce the actual source
diff --git a/pkg/analyzer_experimental/test/generated/element_test.dart b/pkg/analyzer_experimental/test/generated/element_test.dart
index 4625b78..a89b723 100644
--- a/pkg/analyzer_experimental/test/generated/element_test.dart
+++ b/pkg/analyzer_experimental/test/generated/element_test.dart
@@ -347,7 +347,6 @@
String getterName = "g";
PropertyAccessorElement getterG = ElementFactory.getterElement(getterName, false, typeE);
classA.accessors = <PropertyAccessorElement> [getterG];
- ((getterG.type as FunctionTypeImpl)).typeArguments = classA.type.typeArguments;
InterfaceType typeI = ElementFactory.classElement2("I", []).type;
InterfaceTypeImpl typeAI = new InterfaceTypeImpl.con1(classA);
typeAI.typeArguments = <Type2> [typeI];
@@ -589,7 +588,6 @@
String methodName = "m";
MethodElementImpl methodM = ElementFactory.methodElement(methodName, typeE, [typeE]);
classA.methods = <MethodElement> [methodM];
- ((methodM.type as FunctionTypeImpl)).typeArguments = classA.type.typeArguments;
InterfaceType typeI = ElementFactory.classElement2("I", []).type;
InterfaceTypeImpl typeAI = new InterfaceTypeImpl.con1(classA);
typeAI.typeArguments = <Type2> [typeI];
@@ -652,7 +650,6 @@
String setterName = "s";
PropertyAccessorElement setterS = ElementFactory.setterElement(setterName, false, typeE);
classA.accessors = <PropertyAccessorElement> [setterS];
- ((setterS.type as FunctionTypeImpl)).typeArguments = classA.type.typeArguments;
InterfaceType typeI = ElementFactory.classElement2("I", []).type;
InterfaceTypeImpl typeAI = new InterfaceTypeImpl.con1(classA);
typeAI.typeArguments = <Type2> [typeI];
@@ -1026,7 +1023,6 @@
String methodName = "m";
MethodElementImpl methodM = ElementFactory.methodElement(methodName, typeE, [typeE]);
classA.methods = <MethodElement> [methodM];
- ((methodM.type as FunctionTypeImpl)).typeArguments = classA.type.typeArguments;
ClassElementImpl classB = ElementFactory.classElement2("B", ["F"]);
InterfaceType typeB = classB.type;
InterfaceTypeImpl typeAF = new InterfaceTypeImpl.con1(classA);
@@ -1559,7 +1555,7 @@
}
}
/**
- * The class `ElementFactory` defines utility methods used to create elements for testing
+ * The class {@code ElementFactory} defines utility methods used to create elements for testing
* purposes. The elements that are created are complete in the sense that as much of the element
* model as can be created, given the provided information, has been created.
*/
@@ -1590,11 +1586,12 @@
return element;
}
static ClassElementImpl classElement2(String typeName, List<String> parameterNames) => classElement(typeName, object.type, parameterNames);
- static ConstructorElementImpl constructorElement(ClassElement definingClass, String name) {
- Type2 type = definingClass.type;
+ static ConstructorElementImpl constructorElement(ClassElement clazz, String name) {
+ Type2 type = clazz.type;
ConstructorElementImpl constructor = new ConstructorElementImpl(name == null ? null : ASTFactory.identifier3(name));
- constructor.returnType = type;
FunctionTypeImpl constructorType = new FunctionTypeImpl.con1(constructor);
+ constructorType.normalParameterTypes = <Type2> [type];
+ constructorType.returnType = type;
constructor.type = constructorType;
return constructor;
}
@@ -1615,9 +1612,9 @@
getter.static = isStatic;
getter.synthetic = true;
getter.variable = field;
- getter.returnType = type2;
field.getter = getter;
FunctionTypeImpl getterType = new FunctionTypeImpl.con1(getter);
+ getterType.returnType = type2;
getter.type = getterType;
if (!isConst && !isFinal) {
PropertyAccessorElementImpl setter = new PropertyAccessorElementImpl.con2(field);
@@ -1625,10 +1622,10 @@
setter.static = isStatic;
setter.synthetic = true;
setter.variable = field;
- setter.returnType = VoidTypeImpl.instance;
field.setter = setter;
FunctionTypeImpl setterType = new FunctionTypeImpl.con1(getter);
setterType.normalParameterTypes = <Type2> [type2];
+ setterType.returnType = VoidTypeImpl.instance;
setter.type = setterType;
}
return field;
@@ -1640,10 +1637,8 @@
FunctionElementImpl functionElement = new FunctionElementImpl.con1(ASTFactory.identifier3(functionName));
FunctionTypeImpl functionType = new FunctionTypeImpl.con1(functionElement);
functionElement.type = functionType;
- if (returnElement == null) {
- functionElement.returnType = VoidTypeImpl.instance;
- } else {
- functionElement.returnType = returnElement.type;
+ if (returnElement != null) {
+ functionType.returnType = returnElement.type;
}
int normalCount = normalParameters == null ? 0 : normalParameters.length;
if (normalCount > 0) {
@@ -1681,10 +1676,8 @@
FunctionElementImpl functionElement = new FunctionElementImpl.con1(ASTFactory.identifier3(functionName));
FunctionTypeImpl functionType = new FunctionTypeImpl.con1(functionElement);
functionElement.type = functionType;
- if (returnElement == null) {
- functionElement.returnType = VoidTypeImpl.instance;
- } else {
- functionElement.returnType = returnElement.type;
+ if (returnElement != null) {
+ functionType.returnType = returnElement.type;
}
int count = normalParameters == null ? 0 : normalParameters.length;
if (count > 0) {
@@ -1723,9 +1716,9 @@
getter.getter = true;
getter.static = isStatic;
getter.variable = field;
- getter.returnType = type2;
field.getter = getter;
FunctionTypeImpl getterType = new FunctionTypeImpl.con1(getter);
+ getterType.returnType = type2;
getter.type = getterType;
return getter;
}
@@ -1758,9 +1751,9 @@
parameters[i] = parameter;
}
method.parameters = parameters;
- method.returnType = returnType2;
FunctionTypeImpl methodType = new FunctionTypeImpl.con1(method);
methodType.normalParameterTypes = argumentTypes;
+ methodType.returnType = returnType2;
method.type = methodType;
return method;
}
@@ -1789,19 +1782,19 @@
getter.getter = true;
getter.static = isStatic;
getter.variable = field;
- getter.returnType = type2;
field.getter = getter;
FunctionTypeImpl getterType = new FunctionTypeImpl.con1(getter);
+ getterType.returnType = type2;
getter.type = getterType;
PropertyAccessorElementImpl setter = new PropertyAccessorElementImpl.con2(field);
setter.setter = true;
setter.static = isStatic;
setter.synthetic = true;
setter.variable = field;
- setter.returnType = VoidTypeImpl.instance;
field.setter = setter;
- FunctionTypeImpl setterType = new FunctionTypeImpl.con1(setter);
+ FunctionTypeImpl setterType = new FunctionTypeImpl.con1(getter);
setterType.normalParameterTypes = <Type2> [type2];
+ setterType.returnType = VoidTypeImpl.instance;
setter.type = setterType;
return setter;
}
@@ -1815,9 +1808,9 @@
getter.static = true;
getter.synthetic = true;
getter.variable = variable;
- getter.returnType = type2;
variable.getter = getter;
FunctionTypeImpl getterType = new FunctionTypeImpl.con1(getter);
+ getterType.returnType = type2;
getter.type = getterType;
if (!isFinal) {
PropertyAccessorElementImpl setter = new PropertyAccessorElementImpl.con2(variable);
@@ -1825,10 +1818,10 @@
setter.static = true;
setter.synthetic = true;
setter.variable = variable;
- setter.returnType = VoidTypeImpl.instance;
variable.setter = setter;
FunctionTypeImpl setterType = new FunctionTypeImpl.con1(getter);
setterType.normalParameterTypes = <Type2> [type2];
+ setterType.returnType = VoidTypeImpl.instance;
setter.type = setterType;
}
return variable;
@@ -2214,12 +2207,9 @@
EngineTestCase.assertLength(0, types);
}
void test_getReturnType() {
- Type2 expectedReturnType = VoidTypeImpl.instance;
- FunctionElementImpl functionElement = new FunctionElementImpl.con1(ASTFactory.identifier3("f"));
- functionElement.returnType = expectedReturnType;
- FunctionTypeImpl type = new FunctionTypeImpl.con1(functionElement);
+ FunctionTypeImpl type = new FunctionTypeImpl.con1(new FunctionElementImpl.con1(ASTFactory.identifier3("f")));
Type2 returnType = type.returnType;
- JUnitTestCase.assertEquals(expectedReturnType, returnType);
+ JUnitTestCase.assertEquals(VoidTypeImpl.instance, returnType);
}
void test_getTypeArguments() {
FunctionTypeImpl type = new FunctionTypeImpl.con1(new FunctionElementImpl.con1(ASTFactory.identifier3("f")));
@@ -2430,15 +2420,15 @@
variableS.bound = stringType;
TypeVariableTypeImpl typeS = new TypeVariableTypeImpl(variableS);
FunctionElementImpl functionAliasElement = new FunctionElementImpl.con1(ASTFactory.identifier3("func"));
- functionAliasElement.returnType = stringType;
FunctionTypeImpl functionAliasType = new FunctionTypeImpl.con1(functionAliasElement);
functionAliasElement.type = functionAliasType;
+ functionAliasType.returnType = stringType;
functionAliasType.normalParameterTypes = <Type2> [typeB];
functionAliasType.optionalParameterTypes = <Type2> [typeS];
FunctionElementImpl functionElement = new FunctionElementImpl.con1(ASTFactory.identifier3("f"));
- functionElement.returnType = provider.dynamicType;
FunctionTypeImpl functionType = new FunctionTypeImpl.con1(functionElement);
functionElement.type = functionType;
+ functionType.returnType = provider.dynamicType;
functionType.normalParameterTypes = <Type2> [boolType];
functionType.optionalParameterTypes = <Type2> [stringType];
JUnitTestCase.assertTrue(functionType.isAssignableTo(functionAliasType));
@@ -2473,33 +2463,26 @@
JUnitTestCase.assertEquals(expectedTypes, types);
}
void test_setReturnType() {
+ FunctionTypeImpl type = new FunctionTypeImpl.con1(new FunctionElementImpl.con1(ASTFactory.identifier3("f")));
Type2 expectedType = new InterfaceTypeImpl.con1(new ClassElementImpl(ASTFactory.identifier3("C")));
- FunctionElementImpl functionElement = new FunctionElementImpl.con1(ASTFactory.identifier3("f"));
- functionElement.returnType = expectedType;
- FunctionTypeImpl type = new FunctionTypeImpl.con1(functionElement);
- JUnitTestCase.assertEquals(expectedType, type.returnType);
+ type.returnType = expectedType;
+ Type2 returnType = type.returnType;
+ JUnitTestCase.assertEquals(expectedType, returnType);
}
void test_setTypeArguments() {
- ClassElementImpl enclosingClass = ElementFactory.classElement2("C", ["E"]);
- MethodElementImpl methodElement = new MethodElementImpl.con1(ASTFactory.identifier3("m"));
- enclosingClass.methods = <MethodElement> [methodElement];
- FunctionTypeImpl type = new FunctionTypeImpl.con1(methodElement);
- Type2 expectedType = enclosingClass.typeVariables[0].type;
+ FunctionTypeImpl type = new FunctionTypeImpl.con1(new FunctionElementImpl.con1(ASTFactory.identifier3("f")));
+ Type2 expectedType = new TypeVariableTypeImpl(new TypeVariableElementImpl(ASTFactory.identifier3("C")));
type.typeArguments = <Type2> [expectedType];
List<Type2> arguments = type.typeArguments;
EngineTestCase.assertLength(1, arguments);
JUnitTestCase.assertEquals(expectedType, arguments[0]);
}
void test_substitute2_equal() {
- ClassElementImpl definingClass = ElementFactory.classElement2("C", ["E"]);
- TypeVariableType parameterType = definingClass.typeVariables[0].type;
- MethodElementImpl functionElement = new MethodElementImpl.con1(ASTFactory.identifier3("m"));
- functionElement.returnType = parameterType;
- definingClass.methods = <MethodElement> [functionElement];
- FunctionTypeImpl functionType = new FunctionTypeImpl.con1(functionElement);
+ FunctionTypeImpl functionType = new FunctionTypeImpl.con1(new FunctionElementImpl.con1(ASTFactory.identifier3("f")));
+ TypeVariableTypeImpl parameterType = new TypeVariableTypeImpl(new TypeVariableElementImpl(ASTFactory.identifier3("E")));
+ functionType.returnType = parameterType;
functionType.normalParameterTypes = <Type2> [parameterType];
functionType.optionalParameterTypes = <Type2> [parameterType];
- functionType.typeArguments = <Type2> [parameterType];
LinkedHashMap<String, Type2> namedParameterTypes = new LinkedHashMap<String, Type2>();
String namedParameterName = "c";
namedParameterTypes[namedParameterName] = parameterType;
@@ -2518,13 +2501,12 @@
JUnitTestCase.assertEquals(argumentType, namedParameters[namedParameterName]);
}
void test_substitute2_notEqual() {
+ FunctionTypeImpl functionType = new FunctionTypeImpl.con1(new FunctionElementImpl.con1(ASTFactory.identifier3("f")));
Type2 returnType = new InterfaceTypeImpl.con1(new ClassElementImpl(ASTFactory.identifier3("R")));
Type2 normalParameterType = new InterfaceTypeImpl.con1(new ClassElementImpl(ASTFactory.identifier3("A")));
Type2 optionalParameterType = new InterfaceTypeImpl.con1(new ClassElementImpl(ASTFactory.identifier3("B")));
Type2 namedParameterType = new InterfaceTypeImpl.con1(new ClassElementImpl(ASTFactory.identifier3("C")));
- FunctionElementImpl functionElement = new FunctionElementImpl.con1(ASTFactory.identifier3("f"));
- functionElement.returnType = returnType;
- FunctionTypeImpl functionType = new FunctionTypeImpl.con1(functionElement);
+ functionType.returnType = returnType;
functionType.normalParameterTypes = <Type2> [normalParameterType];
functionType.optionalParameterTypes = <Type2> [optionalParameterType];
LinkedHashMap<String, Type2> namedParameterTypes = new LinkedHashMap<String, Type2>();
@@ -2732,7 +2714,7 @@
}
class InterfaceTypeImpl_18 extends InterfaceTypeImpl {
InterfaceTypeImpl_18(ClassElement arg0) : super.con1(arg0);
- bool get isDartCoreFunction => true;
+ bool isDartCoreFunction() => true;
}
main() {
ElementKindTest.dartSuite();
diff --git a/pkg/analyzer_experimental/test/generated/parser_test.dart b/pkg/analyzer_experimental/test/generated/parser_test.dart
index 41f6646..9c5f3d8 100644
--- a/pkg/analyzer_experimental/test/generated/parser_test.dart
+++ b/pkg/analyzer_experimental/test/generated/parser_test.dart
@@ -16,11 +16,11 @@
import 'scanner_test.dart' show TokenFactory;
import 'ast_test.dart' show ASTFactory;
/**
- * The class `SimpleParserTest` defines parser tests that test individual parsing method. The
+ * The class {@code SimpleParserTest} defines parser tests that test individual parsing method. The
* code fragments should be as minimal as possible in order to test the method, but should not test
* the interactions between the method under test and other methods.
- *
- * More complex tests should be defined in the class [ComplexParserTest].
+ * <p>
+ * More complex tests should be defined in the class {@link ComplexParserTest}.
*/
class SimpleParserTest extends ParserTestCase {
void fail_parseCommentReference_this() {
@@ -83,11 +83,11 @@
}
void test_createSyntheticIdentifier() {
SimpleIdentifier identifier = createSyntheticIdentifier();
- JUnitTestCase.assertTrue(identifier.isSynthetic);
+ JUnitTestCase.assertTrue(identifier.isSynthetic());
}
void test_createSyntheticStringLiteral() {
SimpleStringLiteral literal = createSyntheticStringLiteral();
- JUnitTestCase.assertTrue(literal.isSynthetic);
+ JUnitTestCase.assertTrue(literal.isSynthetic());
}
void test_isFunctionDeclaration_nameButNoReturn_block() {
JUnitTestCase.assertTrue(isFunctionDeclaration("f() {}"));
@@ -1508,15 +1508,15 @@
}
void test_parseDocumentationComment_block() {
Comment comment = ParserTestCase.parse5("parseDocumentationComment", "/** */ class", []);
- JUnitTestCase.assertFalse(comment.isBlock);
- JUnitTestCase.assertTrue(comment.isDocumentation);
- JUnitTestCase.assertFalse(comment.isEndOfLine);
+ JUnitTestCase.assertFalse(comment.isBlock());
+ JUnitTestCase.assertTrue(comment.isDocumentation());
+ JUnitTestCase.assertFalse(comment.isEndOfLine());
}
void test_parseDocumentationComment_block_withReference() {
Comment comment = ParserTestCase.parse5("parseDocumentationComment", "/** [a] */ class", []);
- JUnitTestCase.assertFalse(comment.isBlock);
- JUnitTestCase.assertTrue(comment.isDocumentation);
- JUnitTestCase.assertFalse(comment.isEndOfLine);
+ JUnitTestCase.assertFalse(comment.isBlock());
+ JUnitTestCase.assertTrue(comment.isDocumentation());
+ JUnitTestCase.assertFalse(comment.isEndOfLine());
NodeList<CommentReference> references = comment.references;
EngineTestCase.assertSize(1, references);
CommentReference reference = references[0];
@@ -1525,9 +1525,9 @@
}
void test_parseDocumentationComment_endOfLine() {
Comment comment = ParserTestCase.parse5("parseDocumentationComment", "/// \n/// \n class", []);
- JUnitTestCase.assertFalse(comment.isBlock);
- JUnitTestCase.assertTrue(comment.isDocumentation);
- JUnitTestCase.assertFalse(comment.isEndOfLine);
+ JUnitTestCase.assertFalse(comment.isBlock());
+ JUnitTestCase.assertTrue(comment.isDocumentation());
+ JUnitTestCase.assertFalse(comment.isEndOfLine());
}
void test_parseDoStatement() {
DoStatement statement = ParserTestCase.parse5("parseDoStatement", "do {} while (x);", []);
@@ -2870,7 +2870,7 @@
}
void test_parsePrimaryExpression_string() {
SimpleStringLiteral literal = ParserTestCase.parse5("parsePrimaryExpression", "\"string\"", []);
- JUnitTestCase.assertFalse(literal.isMultiline);
+ JUnitTestCase.assertFalse(literal.isMultiline());
JUnitTestCase.assertEquals("string", literal.value);
}
void test_parsePrimaryExpression_super() {
@@ -3668,7 +3668,7 @@
}
/**
- * Invoke the method [Parser#computeStringValue] with the given argument.
+ * Invoke the method {@link Parser#computeStringValue(String)} with the given argument.
* @param lexeme the argument to the method
* @return the result of invoking the method
* @throws Exception if the method could not be invoked or throws an exception
@@ -3680,7 +3680,7 @@
}
/**
- * Invoke the method [Parser#createSyntheticIdentifier] with the parser set to the token
+ * Invoke the method {@link Parser#createSyntheticIdentifier()} with the parser set to the token
* stream produced by scanning the given source.
* @param source the source to be scanned to produce the token stream being tested
* @return the result of invoking the method
@@ -3692,7 +3692,7 @@
}
/**
- * Invoke the method [Parser#createSyntheticIdentifier] with the parser set to the token
+ * Invoke the method {@link Parser#createSyntheticIdentifier()} with the parser set to the token
* stream produced by scanning the given source.
* @param source the source to be scanned to produce the token stream being tested
* @return the result of invoking the method
@@ -3704,7 +3704,7 @@
}
/**
- * Invoke the method [Parser#isFunctionDeclaration] with the parser set to the token
+ * Invoke the method {@link Parser#isFunctionDeclaration()} with the parser set to the token
* stream produced by scanning the given source.
* @param source the source to be scanned to produce the token stream being tested
* @return the result of invoking the method
@@ -3716,7 +3716,7 @@
}
/**
- * Invoke the method [Parser#isFunctionExpression] with the parser set to the token stream
+ * Invoke the method {@link Parser#isFunctionExpression()} with the parser set to the token stream
* produced by scanning the given source.
* @param source the source to be scanned to produce the token stream being tested
* @return the result of invoking the method
@@ -3731,7 +3731,7 @@
}
/**
- * Invoke the method [Parser#isInitializedVariableDeclaration] with the parser set to the
+ * Invoke the method {@link Parser#isInitializedVariableDeclaration()} with the parser set to the
* token stream produced by scanning the given source.
* @param source the source to be scanned to produce the token stream being tested
* @return the result of invoking the method
@@ -3743,7 +3743,7 @@
}
/**
- * Invoke the method [Parser#isSwitchMember] with the parser set to the token stream
+ * Invoke the method {@link Parser#isSwitchMember()} with the parser set to the token stream
* produced by scanning the given source.
* @param source the source to be scanned to produce the token stream being tested
* @return the result of invoking the method
@@ -3755,13 +3755,13 @@
}
/**
- * Invoke a "skip" method in [Parser]. The method is assumed to take a token as it's
+ * Invoke a "skip" method in {@link Parser}. The method is assumed to take a token as it's
* parameter and is given the first token in the scanned source.
* @param methodName the name of the method that should be invoked
* @param source the source to be processed by the method
* @return the result of invoking the method
* @throws Exception if the method could not be invoked or throws an exception
- * @throws AssertionFailedError if the result is `null`
+ * @throws AssertionFailedError if the result is {@code null}
*/
Token skip(String methodName, String source) {
GatheringErrorListener listener = new GatheringErrorListener();
@@ -5853,11 +5853,11 @@
}
}
/**
- * The class `ComplexParserTest` defines parser tests that test the parsing of more complex
+ * The class {@code ComplexParserTest} defines parser tests that test the parsing of more complex
* code fragments or the interactions between multiple parsing methods. For example, tests to ensure
* that the precedence of operations is being handled correctly should be defined in this class.
- *
- * Simpler tests should be defined in the class [SimpleParserTest].
+ * <p>
+ * Simpler tests should be defined in the class {@link SimpleParserTest}.
*/
class ComplexParserTest extends ParserTestCase {
void test_additiveExpression_normal() {
@@ -5979,7 +5979,7 @@
Expression lhs = ((section as AssignmentExpression)).leftHandSide;
EngineTestCase.assertInstanceOf(IndexExpression, lhs);
IndexExpression index = lhs as IndexExpression;
- JUnitTestCase.assertTrue(index.isCascaded);
+ JUnitTestCase.assertTrue(index.isCascaded());
JUnitTestCase.assertSame(target, index.realTarget);
}
}
@@ -6263,7 +6263,7 @@
}
}
/**
- * Instances of the class `ASTValidator` are used to validate the correct construction of an
+ * Instances of the class {@code ASTValidator} are used to validate the correct construction of an
* AST structure.
*/
class ASTValidator extends GeneralizingASTVisitor<Object> {
@@ -6340,9 +6340,9 @@
static List<Object> _EMPTY_ARGUMENTS = new List<Object>(0);
/**
- * Invoke a parse method in [Parser]. The method is assumed to have the given number and
+ * Invoke a parse method in {@link Parser}. The method is assumed to have the given number and
* type of parameters and will be invoked with the given arguments.
- *
+ * <p>
* The given source is scanned and the parser is initialized to start with the first token in the
* source before the parse method is invoked.
* @param methodName the name of the parse method that should be invoked to parse the source
@@ -6350,14 +6350,14 @@
* @param source the source to be parsed by the parse method
* @return the result of invoking the method
* @throws Exception if the method could not be invoked or throws an exception
- * @throws AssertionFailedError if the result is `null` or if any errors are produced
+ * @throws AssertionFailedError if the result is {@code null} or if any errors are produced
*/
static Object parse(String methodName, List<Object> objects, String source) => parse3(methodName, objects, source, new List<AnalysisError>(0));
/**
- * Invoke a parse method in [Parser]. The method is assumed to have the given number and
+ * Invoke a parse method in {@link Parser}. The method is assumed to have the given number and
* type of parameters and will be invoked with the given arguments.
- *
+ * <p>
* The given source is scanned and the parser is initialized to start with the first token in the
* source before the parse method is invoked.
* @param methodName the name of the parse method that should be invoked to parse the source
@@ -6366,7 +6366,7 @@
* @param errorCodes the error codes of the errors that should be generated
* @return the result of invoking the method
* @throws Exception if the method could not be invoked or throws an exception
- * @throws AssertionFailedError if the result is `null` or the errors produced while
+ * @throws AssertionFailedError if the result is {@code null} or the errors produced while
* scanning and parsing the source do not match the expected errors
*/
static Object parse3(String methodName, List<Object> objects, String source, List<AnalysisError> errors) {
@@ -6377,9 +6377,9 @@
}
/**
- * Invoke a parse method in [Parser]. The method is assumed to have the given number and
+ * Invoke a parse method in {@link Parser}. The method is assumed to have the given number and
* type of parameters and will be invoked with the given arguments.
- *
+ * <p>
* The given source is scanned and the parser is initialized to start with the first token in the
* source before the parse method is invoked.
* @param methodName the name of the parse method that should be invoked to parse the source
@@ -6388,7 +6388,7 @@
* @param errorCodes the error codes of the errors that should be generated
* @return the result of invoking the method
* @throws Exception if the method could not be invoked or throws an exception
- * @throws AssertionFailedError if the result is `null` or the errors produced while
+ * @throws AssertionFailedError if the result is {@code null} or the errors produced while
* scanning and parsing the source do not match the expected errors
*/
static Object parse4(String methodName, List<Object> objects, String source, List<ErrorCode> errorCodes) {
@@ -6399,8 +6399,8 @@
}
/**
- * Invoke a parse method in [Parser]. The method is assumed to have no arguments.
- *
+ * Invoke a parse method in {@link Parser}. The method is assumed to have no arguments.
+ * <p>
* The given source is scanned and the parser is initialized to start with the first token in the
* source before the parse method is invoked.
* @param methodName the name of the parse method that should be invoked to parse the source
@@ -6408,7 +6408,7 @@
* @param errorCodes the error codes of the errors that should be generated
* @return the result of invoking the method
* @throws Exception if the method could not be invoked or throws an exception
- * @throws AssertionFailedError if the result is `null` or the errors produced while
+ * @throws AssertionFailedError if the result is {@code null} or the errors produced while
* scanning and parsing the source do not match the expected errors
*/
static Object parse5(String methodName, String source, List<ErrorCode> errorCodes) => parse4(methodName, _EMPTY_ARGUMENTS, source, errorCodes);
@@ -6419,7 +6419,7 @@
* @param errorCodes the error codes of the errors that are expected to be found
* @return the compilation unit that was parsed
* @throws Exception if the source could not be parsed, if the compilation errors in the source do
- * not match those that are expected, or if the result would have been `null`
+ * not match those that are expected, or if the result would have been {@code null}
*/
static CompilationUnit parseCompilationUnit(String source, List<ErrorCode> errorCodes) {
GatheringErrorListener listener = new GatheringErrorListener();
@@ -6439,7 +6439,7 @@
* @param errorCodes the error codes of the errors that are expected to be found
* @return the expression that was parsed
* @throws Exception if the source could not be parsed, if the compilation errors in the source do
- * not match those that are expected, or if the result would have been `null`
+ * not match those that are expected, or if the result would have been {@code null}
*/
static Expression parseExpression(String source, List<ErrorCode> errorCodes) {
GatheringErrorListener listener = new GatheringErrorListener();
@@ -6459,7 +6459,7 @@
* @param errorCodes the error codes of the errors that are expected to be found
* @return the statement that was parsed
* @throws Exception if the source could not be parsed, if the compilation errors in the source do
- * not match those that are expected, or if the result would have been `null`
+ * not match those that are expected, or if the result would have been {@code null}
*/
static Statement parseStatement(String source, List<ErrorCode> errorCodes) {
GatheringErrorListener listener = new GatheringErrorListener();
@@ -6481,7 +6481,7 @@
* @return the statements that were parsed
* @throws Exception if the source could not be parsed, if the number of statements does not match
* the expected count, if the compilation errors in the source do not match those that
- * are expected, or if the result would have been `null`
+ * are expected, or if the result would have been {@code null}
*/
static List<Statement> parseStatements(String source, int expectedCount, List<ErrorCode> errorCodes) {
GatheringErrorListener listener = new GatheringErrorListener();
@@ -6496,9 +6496,9 @@
}
/**
- * Invoke a method in [Parser]. The method is assumed to have the given number and type of
+ * Invoke a method in {@link Parser}. The method is assumed to have the given number and type of
* parameters and will be invoked with the given arguments.
- *
+ * <p>
* The given source is scanned and the parser is initialized to start with the first token in the
* source before the method is invoked.
* @param methodName the name of the method that should be invoked
@@ -6507,7 +6507,7 @@
* @param listener the error listener that will be used for both scanning and parsing
* @return the result of invoking the method
* @throws Exception if the method could not be invoked or throws an exception
- * @throws AssertionFailedError if the result is `null` or the errors produced while
+ * @throws AssertionFailedError if the result is {@code null} or the errors produced while
* scanning and parsing the source do not match the expected errors
*/
static Object invokeParserMethod(String methodName, List<Object> objects, String source, GatheringErrorListener listener) {
@@ -6523,8 +6523,8 @@
}
/**
- * Invoke a method in [Parser]. The method is assumed to have no arguments.
- *
+ * Invoke a method in {@link Parser}. The method is assumed to have no arguments.
+ * <p>
* The given source is scanned and the parser is initialized to start with the first token in the
* source before the method is invoked.
* @param methodName the name of the method that should be invoked
@@ -6532,7 +6532,7 @@
* @param listener the error listener that will be used for both scanning and parsing
* @return the result of invoking the method
* @throws Exception if the method could not be invoked or throws an exception
- * @throws AssertionFailedError if the result is `null` or the errors produced while
+ * @throws AssertionFailedError if the result is {@code null} or the errors produced while
* scanning and parsing the source do not match the expected errors
*/
static Object invokeParserMethod2(String methodName, String source, GatheringErrorListener listener) => invokeParserMethod(methodName, _EMPTY_ARGUMENTS, source, listener);
@@ -6562,7 +6562,7 @@
}
}
/**
- * The class `RecoveryParserTest` defines parser tests that test the parsing of invalid code
+ * The class {@code RecoveryParserTest} defines parser tests that test the parsing of invalid code
* sequences to ensure that the correct recovery steps are taken in the parser.
*/
class RecoveryParserTest extends ParserTestCase {
@@ -6572,24 +6572,24 @@
void test_additiveExpression_missing_LHS() {
BinaryExpression expression = ParserTestCase.parseExpression("+ y", [ParserErrorCode.MISSING_IDENTIFIER]);
EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftOperand);
- JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic);
+ JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic());
}
void test_additiveExpression_missing_LHS_RHS() {
BinaryExpression expression = ParserTestCase.parseExpression("+", [ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCode.MISSING_IDENTIFIER]);
EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftOperand);
- JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic);
+ JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic());
EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand);
- JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic);
+ JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic());
}
void test_additiveExpression_missing_RHS() {
BinaryExpression expression = ParserTestCase.parseExpression("x +", [ParserErrorCode.MISSING_IDENTIFIER]);
EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand);
- JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic);
+ JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic());
}
void test_additiveExpression_missing_RHS_super() {
BinaryExpression expression = ParserTestCase.parseExpression("super +", [ParserErrorCode.MISSING_IDENTIFIER]);
EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand);
- JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic);
+ JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic());
}
void test_additiveExpression_precedence_multiplicative_left() {
BinaryExpression expression = ParserTestCase.parseExpression("* +", [ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCode.MISSING_IDENTIFIER]);
@@ -6607,51 +6607,51 @@
AssignmentExpression expression = ParserTestCase.parseExpression("= y = 0", [ParserErrorCode.MISSING_IDENTIFIER]);
Expression syntheticExpression = expression.leftHandSide;
EngineTestCase.assertInstanceOf(SimpleIdentifier, syntheticExpression);
- JUnitTestCase.assertTrue(syntheticExpression.isSynthetic);
+ JUnitTestCase.assertTrue(syntheticExpression.isSynthetic());
}
void test_assignmentExpression_missing_compound2() {
AssignmentExpression expression = ParserTestCase.parseExpression("x = = 0", [ParserErrorCode.MISSING_IDENTIFIER]);
Expression syntheticExpression = ((expression.rightHandSide as AssignmentExpression)).leftHandSide;
EngineTestCase.assertInstanceOf(SimpleIdentifier, syntheticExpression);
- JUnitTestCase.assertTrue(syntheticExpression.isSynthetic);
+ JUnitTestCase.assertTrue(syntheticExpression.isSynthetic());
}
void test_assignmentExpression_missing_compound3() {
AssignmentExpression expression = ParserTestCase.parseExpression("x = y =", [ParserErrorCode.MISSING_IDENTIFIER]);
Expression syntheticExpression = ((expression.rightHandSide as AssignmentExpression)).rightHandSide;
EngineTestCase.assertInstanceOf(SimpleIdentifier, syntheticExpression);
- JUnitTestCase.assertTrue(syntheticExpression.isSynthetic);
+ JUnitTestCase.assertTrue(syntheticExpression.isSynthetic());
}
void test_assignmentExpression_missing_LHS() {
AssignmentExpression expression = ParserTestCase.parseExpression("= 0", [ParserErrorCode.MISSING_IDENTIFIER]);
EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftHandSide);
- JUnitTestCase.assertTrue(expression.leftHandSide.isSynthetic);
+ JUnitTestCase.assertTrue(expression.leftHandSide.isSynthetic());
}
void test_assignmentExpression_missing_RHS() {
AssignmentExpression expression = ParserTestCase.parseExpression("x =", [ParserErrorCode.MISSING_IDENTIFIER]);
EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftHandSide);
- JUnitTestCase.assertTrue(expression.rightHandSide.isSynthetic);
+ JUnitTestCase.assertTrue(expression.rightHandSide.isSynthetic());
}
void test_bitwiseAndExpression_missing_LHS() {
BinaryExpression expression = ParserTestCase.parseExpression("& y", [ParserErrorCode.MISSING_IDENTIFIER]);
EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftOperand);
- JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic);
+ JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic());
}
void test_bitwiseAndExpression_missing_LHS_RHS() {
BinaryExpression expression = ParserTestCase.parseExpression("&", [ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCode.MISSING_IDENTIFIER]);
EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftOperand);
- JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic);
+ JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic());
EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand);
- JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic);
+ JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic());
}
void test_bitwiseAndExpression_missing_RHS() {
BinaryExpression expression = ParserTestCase.parseExpression("x &", [ParserErrorCode.MISSING_IDENTIFIER]);
EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand);
- JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic);
+ JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic());
}
void test_bitwiseAndExpression_missing_RHS_super() {
BinaryExpression expression = ParserTestCase.parseExpression("super &", [ParserErrorCode.MISSING_IDENTIFIER]);
EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand);
- JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic);
+ JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic());
}
void test_bitwiseAndExpression_precedence_equality_left() {
BinaryExpression expression = ParserTestCase.parseExpression("== &", [ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCode.MISSING_IDENTIFIER]);
@@ -6668,24 +6668,24 @@
void test_bitwiseOrExpression_missing_LHS() {
BinaryExpression expression = ParserTestCase.parseExpression("| y", [ParserErrorCode.MISSING_IDENTIFIER]);
EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftOperand);
- JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic);
+ JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic());
}
void test_bitwiseOrExpression_missing_LHS_RHS() {
BinaryExpression expression = ParserTestCase.parseExpression("|", [ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCode.MISSING_IDENTIFIER]);
EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftOperand);
- JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic);
+ JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic());
EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand);
- JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic);
+ JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic());
}
void test_bitwiseOrExpression_missing_RHS() {
BinaryExpression expression = ParserTestCase.parseExpression("x |", [ParserErrorCode.MISSING_IDENTIFIER]);
EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand);
- JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic);
+ JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic());
}
void test_bitwiseOrExpression_missing_RHS_super() {
BinaryExpression expression = ParserTestCase.parseExpression("super |", [ParserErrorCode.MISSING_IDENTIFIER]);
EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand);
- JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic);
+ JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic());
}
void test_bitwiseOrExpression_precedence_xor_left() {
BinaryExpression expression = ParserTestCase.parseExpression("^ |", [ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCode.MISSING_IDENTIFIER]);
@@ -6702,24 +6702,24 @@
void test_bitwiseXorExpression_missing_LHS() {
BinaryExpression expression = ParserTestCase.parseExpression("^ y", [ParserErrorCode.MISSING_IDENTIFIER]);
EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftOperand);
- JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic);
+ JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic());
}
void test_bitwiseXorExpression_missing_LHS_RHS() {
BinaryExpression expression = ParserTestCase.parseExpression("^", [ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCode.MISSING_IDENTIFIER]);
EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftOperand);
- JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic);
+ JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic());
EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand);
- JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic);
+ JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic());
}
void test_bitwiseXorExpression_missing_RHS() {
BinaryExpression expression = ParserTestCase.parseExpression("x ^", [ParserErrorCode.MISSING_IDENTIFIER]);
EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand);
- JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic);
+ JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic());
}
void test_bitwiseXorExpression_missing_RHS_super() {
BinaryExpression expression = ParserTestCase.parseExpression("super ^", [ParserErrorCode.MISSING_IDENTIFIER]);
EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand);
- JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic);
+ JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic());
}
void test_bitwiseXorExpression_precedence_and_left() {
BinaryExpression expression = ParserTestCase.parseExpression("& ^", [ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCode.MISSING_IDENTIFIER]);
@@ -6739,34 +6739,34 @@
void test_conditionalExpression_missingElse() {
ConditionalExpression expression = ParserTestCase.parse5("parseConditionalExpression", "x ? y :", [ParserErrorCode.MISSING_IDENTIFIER]);
EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.elseExpression);
- JUnitTestCase.assertTrue(expression.elseExpression.isSynthetic);
+ JUnitTestCase.assertTrue(expression.elseExpression.isSynthetic());
}
void test_conditionalExpression_missingThen() {
ConditionalExpression expression = ParserTestCase.parse5("parseConditionalExpression", "x ? : z", [ParserErrorCode.MISSING_IDENTIFIER]);
EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.thenExpression);
- JUnitTestCase.assertTrue(expression.thenExpression.isSynthetic);
+ JUnitTestCase.assertTrue(expression.thenExpression.isSynthetic());
}
void test_equalityExpression_missing_LHS() {
BinaryExpression expression = ParserTestCase.parseExpression("== y", [ParserErrorCode.MISSING_IDENTIFIER]);
EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftOperand);
- JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic);
+ JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic());
}
void test_equalityExpression_missing_LHS_RHS() {
BinaryExpression expression = ParserTestCase.parseExpression("==", [ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCode.MISSING_IDENTIFIER]);
EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftOperand);
- JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic);
+ JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic());
EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand);
- JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic);
+ JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic());
}
void test_equalityExpression_missing_RHS() {
BinaryExpression expression = ParserTestCase.parseExpression("x ==", [ParserErrorCode.MISSING_IDENTIFIER]);
EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand);
- JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic);
+ JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic());
}
void test_equalityExpression_missing_RHS_super() {
BinaryExpression expression = ParserTestCase.parseExpression("super ==", [ParserErrorCode.MISSING_IDENTIFIER]);
EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand);
- JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic);
+ JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic());
}
void test_equalityExpression_precedence_relational_left() {
BinaryExpression expression = ParserTestCase.parseExpression("is ==", [ParserErrorCode.EXPECTED_TYPE_NAME, ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCode.MISSING_IDENTIFIER]);
@@ -6785,21 +6785,21 @@
EngineTestCase.assertSize(4, result);
Expression syntheticExpression = result[0];
EngineTestCase.assertInstanceOf(SimpleIdentifier, syntheticExpression);
- JUnitTestCase.assertTrue(syntheticExpression.isSynthetic);
+ JUnitTestCase.assertTrue(syntheticExpression.isSynthetic());
}
void test_expressionList_multiple_middle() {
List<Expression> result = ParserTestCase.parse5("parseExpressionList", "1, 2, , 4", [ParserErrorCode.MISSING_IDENTIFIER]);
EngineTestCase.assertSize(4, result);
Expression syntheticExpression = result[2];
EngineTestCase.assertInstanceOf(SimpleIdentifier, syntheticExpression);
- JUnitTestCase.assertTrue(syntheticExpression.isSynthetic);
+ JUnitTestCase.assertTrue(syntheticExpression.isSynthetic());
}
void test_expressionList_multiple_start() {
List<Expression> result = ParserTestCase.parse5("parseExpressionList", "1, 2, 3,", [ParserErrorCode.MISSING_IDENTIFIER]);
EngineTestCase.assertSize(4, result);
Expression syntheticExpression = result[3];
EngineTestCase.assertInstanceOf(SimpleIdentifier, syntheticExpression);
- JUnitTestCase.assertTrue(syntheticExpression.isSynthetic);
+ JUnitTestCase.assertTrue(syntheticExpression.isSynthetic());
}
void test_isExpression_noType() {
CompilationUnit unit = ParserTestCase.parseCompilationUnit("class Bar<T extends Foo> {m(x){if (x is ) return;if (x is !)}}", [ParserErrorCode.EXPECTED_TYPE_NAME, ParserErrorCode.EXPECTED_TYPE_NAME, ParserErrorCode.MISSING_STATEMENT]);
@@ -6813,25 +6813,25 @@
JUnitTestCase.assertNotNull(expression.notOperator);
TypeName type = expression.type;
JUnitTestCase.assertNotNull(type);
- JUnitTestCase.assertTrue(type.name.isSynthetic);
+ JUnitTestCase.assertTrue(type.name.isSynthetic());
EngineTestCase.assertInstanceOf(EmptyStatement, ifStatement.thenStatement);
}
void test_logicalAndExpression_missing_LHS() {
BinaryExpression expression = ParserTestCase.parseExpression("&& y", [ParserErrorCode.MISSING_IDENTIFIER]);
EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftOperand);
- JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic);
+ JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic());
}
void test_logicalAndExpression_missing_LHS_RHS() {
BinaryExpression expression = ParserTestCase.parseExpression("&&", [ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCode.MISSING_IDENTIFIER]);
EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftOperand);
- JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic);
+ JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic());
EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand);
- JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic);
+ JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic());
}
void test_logicalAndExpression_missing_RHS() {
BinaryExpression expression = ParserTestCase.parseExpression("x &&", [ParserErrorCode.MISSING_IDENTIFIER]);
EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand);
- JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic);
+ JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic());
}
void test_logicalAndExpression_precedence_bitwiseOr_left() {
BinaryExpression expression = ParserTestCase.parseExpression("| &&", [ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCode.MISSING_IDENTIFIER]);
@@ -6844,19 +6844,19 @@
void test_logicalOrExpression_missing_LHS() {
BinaryExpression expression = ParserTestCase.parseExpression("|| y", [ParserErrorCode.MISSING_IDENTIFIER]);
EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftOperand);
- JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic);
+ JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic());
}
void test_logicalOrExpression_missing_LHS_RHS() {
BinaryExpression expression = ParserTestCase.parseExpression("||", [ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCode.MISSING_IDENTIFIER]);
EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftOperand);
- JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic);
+ JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic());
EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand);
- JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic);
+ JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic());
}
void test_logicalOrExpression_missing_RHS() {
BinaryExpression expression = ParserTestCase.parseExpression("x ||", [ParserErrorCode.MISSING_IDENTIFIER]);
EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand);
- JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic);
+ JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic());
}
void test_logicalOrExpression_precedence_logicalAnd_left() {
BinaryExpression expression = ParserTestCase.parseExpression("&& ||", [ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCode.MISSING_IDENTIFIER]);
@@ -6869,24 +6869,24 @@
void test_multiplicativeExpression_missing_LHS() {
BinaryExpression expression = ParserTestCase.parseExpression("* y", [ParserErrorCode.MISSING_IDENTIFIER]);
EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftOperand);
- JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic);
+ JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic());
}
void test_multiplicativeExpression_missing_LHS_RHS() {
BinaryExpression expression = ParserTestCase.parseExpression("*", [ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCode.MISSING_IDENTIFIER]);
EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftOperand);
- JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic);
+ JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic());
EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand);
- JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic);
+ JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic());
}
void test_multiplicativeExpression_missing_RHS() {
BinaryExpression expression = ParserTestCase.parseExpression("x *", [ParserErrorCode.MISSING_IDENTIFIER]);
EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand);
- JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic);
+ JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic());
}
void test_multiplicativeExpression_missing_RHS_super() {
BinaryExpression expression = ParserTestCase.parseExpression("super *", [ParserErrorCode.MISSING_IDENTIFIER]);
EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand);
- JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic);
+ JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic());
}
void test_multiplicativeExpression_precedence_unary_left() {
BinaryExpression expression = ParserTestCase.parseExpression("-x *", [ParserErrorCode.MISSING_IDENTIFIER]);
@@ -6903,25 +6903,25 @@
void test_prefixExpression_missing_operand_minus() {
PrefixExpression expression = ParserTestCase.parseExpression("-", [ParserErrorCode.MISSING_IDENTIFIER]);
EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.operand);
- JUnitTestCase.assertTrue(expression.operand.isSynthetic);
+ JUnitTestCase.assertTrue(expression.operand.isSynthetic());
JUnitTestCase.assertEquals(TokenType.MINUS, expression.operator.type);
}
void test_relationalExpression_missing_LHS() {
IsExpression expression = ParserTestCase.parseExpression("is y", [ParserErrorCode.MISSING_IDENTIFIER]);
EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.expression);
- JUnitTestCase.assertTrue(expression.expression.isSynthetic);
+ JUnitTestCase.assertTrue(expression.expression.isSynthetic());
}
void test_relationalExpression_missing_LHS_RHS() {
IsExpression expression = ParserTestCase.parseExpression("is", [ParserErrorCode.EXPECTED_TYPE_NAME, ParserErrorCode.MISSING_IDENTIFIER]);
EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.expression);
- JUnitTestCase.assertTrue(expression.expression.isSynthetic);
+ JUnitTestCase.assertTrue(expression.expression.isSynthetic());
EngineTestCase.assertInstanceOf(TypeName, expression.type);
- JUnitTestCase.assertTrue(expression.type.isSynthetic);
+ JUnitTestCase.assertTrue(expression.type.isSynthetic());
}
void test_relationalExpression_missing_RHS() {
IsExpression expression = ParserTestCase.parseExpression("x is", [ParserErrorCode.EXPECTED_TYPE_NAME]);
EngineTestCase.assertInstanceOf(TypeName, expression.type);
- JUnitTestCase.assertTrue(expression.type.isSynthetic);
+ JUnitTestCase.assertTrue(expression.type.isSynthetic());
}
void test_relationalExpression_precedence_shift_right() {
IsExpression expression = ParserTestCase.parseExpression("<< is", [ParserErrorCode.EXPECTED_TYPE_NAME, ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCode.MISSING_IDENTIFIER]);
@@ -6930,24 +6930,24 @@
void test_shiftExpression_missing_LHS() {
BinaryExpression expression = ParserTestCase.parseExpression("<< y", [ParserErrorCode.MISSING_IDENTIFIER]);
EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftOperand);
- JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic);
+ JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic());
}
void test_shiftExpression_missing_LHS_RHS() {
BinaryExpression expression = ParserTestCase.parseExpression("<<", [ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCode.MISSING_IDENTIFIER]);
EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftOperand);
- JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic);
+ JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic());
EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand);
- JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic);
+ JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic());
}
void test_shiftExpression_missing_RHS() {
BinaryExpression expression = ParserTestCase.parseExpression("x <<", [ParserErrorCode.MISSING_IDENTIFIER]);
EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand);
- JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic);
+ JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic());
}
void test_shiftExpression_missing_RHS_super() {
BinaryExpression expression = ParserTestCase.parseExpression("super <<", [ParserErrorCode.MISSING_IDENTIFIER]);
EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand);
- JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic);
+ JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic());
}
void test_shiftExpression_precedence_unary_left() {
BinaryExpression expression = ParserTestCase.parseExpression("+ <<", [ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCode.MISSING_IDENTIFIER]);
@@ -7282,13 +7282,13 @@
}
}
/**
- * The class `ErrorParserTest` defines parser tests that test the parsing of code to ensure
+ * The class {@code ErrorParserTest} defines parser tests that test the parsing of code to ensure
* that errors are correctly reported, and in some cases, not reported.
*/
class ErrorParserTest extends ParserTestCase {
void fail_expectedListOrMapLiteral() {
TypedLiteral literal = ParserTestCase.parse4("parseListOrMapLiteral", <Object> [null], "1", [ParserErrorCode.EXPECTED_LIST_OR_MAP_LITERAL]);
- JUnitTestCase.assertTrue(literal.isSynthetic);
+ JUnitTestCase.assertTrue(literal.isSynthetic());
}
void fail_illegalAssignmentToNonAssignable_superAssigned() {
ParserTestCase.parseExpression("super = x;", [ParserErrorCode.ILLEGAL_ASSIGNMENT_TO_NON_ASSIGNABLE]);
@@ -7490,7 +7490,7 @@
}
void test_expectedStringLiteral() {
StringLiteral expression = ParserTestCase.parse5("parseStringLiteral", "1", [ParserErrorCode.EXPECTED_STRING_LITERAL]);
- JUnitTestCase.assertTrue(expression.isSynthetic);
+ JUnitTestCase.assertTrue(expression.isSynthetic());
}
void test_expectedToken_commaMissingInArgumentList() {
ParserTestCase.parse5("parseArgumentList", "(x, y z)", [ParserErrorCode.EXPECTED_TOKEN]);
@@ -7718,7 +7718,7 @@
}
void test_missingIdentifier_number() {
SimpleIdentifier expression = ParserTestCase.parse5("parseSimpleIdentifier", "1", [ParserErrorCode.MISSING_IDENTIFIER]);
- JUnitTestCase.assertTrue(expression.isSynthetic);
+ JUnitTestCase.assertTrue(expression.isSynthetic());
}
void test_missingKeywordOperator() {
ParserTestCase.parse4("parseOperator", <Object> [emptyCommentAndMetadata(), null, null], "+(x) {}", [ParserErrorCode.MISSING_KEYWORD_OPERATOR]);
@@ -7871,7 +7871,7 @@
void test_useOfUnaryPlusOperator() {
SimpleIdentifier expression = ParserTestCase.parse5("parseUnaryExpression", "+x", [ParserErrorCode.MISSING_IDENTIFIER]);
EngineTestCase.assertInstanceOf(SimpleIdentifier, expression);
- JUnitTestCase.assertTrue(expression.isSynthetic);
+ JUnitTestCase.assertTrue(expression.isSynthetic());
}
void test_varAsTypeName_as() {
ParserTestCase.parseExpression("x as var", [ParserErrorCode.VAR_AS_TYPE_NAME]);
diff --git a/pkg/analyzer_experimental/test/generated/resolver_test.dart b/pkg/analyzer_experimental/test/generated/resolver_test.dart
index 81a1c44..c365a79 100644
--- a/pkg/analyzer_experimental/test/generated/resolver_test.dart
+++ b/pkg/analyzer_experimental/test/generated/resolver_test.dart
@@ -201,7 +201,7 @@
void test_is_subclass() {
Source source = addSource(EngineTestCase.createSource(["class A {}", "class B extends A {", " B m() => this;", "}", "A f(A p) {", " if (p is B) {", " return p.m();", " }", "}"]));
LibraryElement library = resolve(source);
- assertErrors([StaticTypeWarningCode.UNDEFINED_METHOD]);
+ assertNoErrors();
verify([source]);
CompilationUnit unit = resolveCompilationUnit(source, library);
FunctionDeclaration function = unit.declarations[2] as FunctionDeclaration;
@@ -953,30 +953,6 @@
assertNoErrors();
verify([source]);
}
- void test_invalidMethodOverrideNamedParamType() {
- Source source = addSource(EngineTestCase.createSource(["class A {", " m({int a}) {}", "}", "class B implements A {", " m({int a, int b}) {}", "}"]));
- resolve(source);
- assertNoErrors();
- verify([source]);
- }
- void test_invalidOverrideDifferentDefaultValues_named() {
- Source source = addSource(EngineTestCase.createSource(["class A {", " m({int p : 0}) {}", "}", "class B extends A {", " m({int p : 0}) {}", "}"]));
- resolve(source);
- assertNoErrors();
- verify([source]);
- }
- void test_invalidOverrideDifferentDefaultValues_positional() {
- Source source = addSource(EngineTestCase.createSource(["class A {", " m([int p = 0]) {}", "}", "class B extends A {", " m([int p = 0]) {}", "}"]));
- resolve(source);
- assertNoErrors();
- verify([source]);
- }
- void test_invalidOverrideDifferentDefaultValues_positional_changedOrder() {
- Source source = addSource(EngineTestCase.createSource(["class A {", " m([int a = 0, String b = '0']) {}", "}", "class B extends A {", " m([int b = 0, String a = '0']) {}", "}"]));
- resolve(source);
- assertNoErrors();
- verify([source]);
- }
void test_invalidOverrideNamed_unorderedNamedParameter() {
Source source = addSource(EngineTestCase.createSource(["class A {", " m({a, b}) {}", "}", "class B extends A {", " m({b, a}) {}", "}"]));
resolve(source);
@@ -1181,42 +1157,6 @@
assertNoErrors();
verify([source]);
}
- void test_nonConstantDefaultValue_function_named() {
- Source source = addSource(EngineTestCase.createSource(["f({x : 2 + 3}) {}"]));
- resolve(source);
- assertNoErrors();
- verify([source]);
- }
- void test_nonConstantDefaultValue_function_positional() {
- Source source = addSource(EngineTestCase.createSource(["f([x = 2 + 3]) {}"]));
- resolve(source);
- assertNoErrors();
- verify([source]);
- }
- void test_nonConstantDefaultValue_inConstructor_named() {
- Source source = addSource(EngineTestCase.createSource(["class A {", " A({x : 2 + 3}) {}", "}"]));
- resolve(source);
- assertNoErrors();
- verify([source]);
- }
- void test_nonConstantDefaultValue_inConstructor_positional() {
- Source source = addSource(EngineTestCase.createSource(["class A {", " A([x = 2 + 3]) {}", "}"]));
- resolve(source);
- assertNoErrors();
- verify([source]);
- }
- void test_nonConstantDefaultValue_method_named() {
- Source source = addSource(EngineTestCase.createSource(["class A {", " m({x : 2 + 3}) {}", "}"]));
- resolve(source);
- assertNoErrors();
- verify([source]);
- }
- void test_nonConstantDefaultValue_method_positional() {
- Source source = addSource(EngineTestCase.createSource(["class A {", " m([x = 2 + 3]) {}", "}"]));
- resolve(source);
- assertNoErrors();
- verify([source]);
- }
void test_nonConstCaseExpression() {
Source source = addSource(EngineTestCase.createSource(["f(Type t) {", " switch (t) {", " case bool:", " case int:", " return true;", " default:", " return false;", " }", "}"]));
resolve(source);
@@ -1505,12 +1445,6 @@
assertNoErrors();
verify([source]);
}
- void test_undefinedConstructorInInitializer_hasOptionalParameters() {
- Source source = addSource(EngineTestCase.createSource(["class A {", " A([p]) {}", "}", "class B extends A {", " B();", "}"]));
- resolve(source);
- assertNoErrors();
- verify([source]);
- }
void test_undefinedConstructorInInitializer_implicit() {
Source source = addSource(EngineTestCase.createSource(["class A {", " A() {}", "}", "class B extends A {", " B();", "}"]));
resolve(source);
@@ -1935,22 +1869,6 @@
final __test = new NonErrorResolverTest();
runJUnitTest(__test, __test.test_invalidFactoryNameNotAClass);
});
- _ut.test('test_invalidMethodOverrideNamedParamType', () {
- final __test = new NonErrorResolverTest();
- runJUnitTest(__test, __test.test_invalidMethodOverrideNamedParamType);
- });
- _ut.test('test_invalidOverrideDifferentDefaultValues_named', () {
- final __test = new NonErrorResolverTest();
- runJUnitTest(__test, __test.test_invalidOverrideDifferentDefaultValues_named);
- });
- _ut.test('test_invalidOverrideDifferentDefaultValues_positional', () {
- final __test = new NonErrorResolverTest();
- runJUnitTest(__test, __test.test_invalidOverrideDifferentDefaultValues_positional);
- });
- _ut.test('test_invalidOverrideDifferentDefaultValues_positional_changedOrder', () {
- final __test = new NonErrorResolverTest();
- runJUnitTest(__test, __test.test_invalidOverrideDifferentDefaultValues_positional_changedOrder);
- });
_ut.test('test_invalidOverrideNamed_unorderedNamedParameter', () {
final __test = new NonErrorResolverTest();
runJUnitTest(__test, __test.test_invalidOverrideNamed_unorderedNamedParameter);
@@ -2135,30 +2053,6 @@
final __test = new NonErrorResolverTest();
runJUnitTest(__test, __test.test_nonConstValueInInitializer_unary);
});
- _ut.test('test_nonConstantDefaultValue_function_named', () {
- final __test = new NonErrorResolverTest();
- runJUnitTest(__test, __test.test_nonConstantDefaultValue_function_named);
- });
- _ut.test('test_nonConstantDefaultValue_function_positional', () {
- final __test = new NonErrorResolverTest();
- runJUnitTest(__test, __test.test_nonConstantDefaultValue_function_positional);
- });
- _ut.test('test_nonConstantDefaultValue_inConstructor_named', () {
- final __test = new NonErrorResolverTest();
- runJUnitTest(__test, __test.test_nonConstantDefaultValue_inConstructor_named);
- });
- _ut.test('test_nonConstantDefaultValue_inConstructor_positional', () {
- final __test = new NonErrorResolverTest();
- runJUnitTest(__test, __test.test_nonConstantDefaultValue_inConstructor_positional);
- });
- _ut.test('test_nonConstantDefaultValue_method_named', () {
- final __test = new NonErrorResolverTest();
- runJUnitTest(__test, __test.test_nonConstantDefaultValue_method_named);
- });
- _ut.test('test_nonConstantDefaultValue_method_positional', () {
- final __test = new NonErrorResolverTest();
- runJUnitTest(__test, __test.test_nonConstantDefaultValue_method_positional);
- });
_ut.test('test_nonGenerativeConstructor', () {
final __test = new NonErrorResolverTest();
runJUnitTest(__test, __test.test_nonGenerativeConstructor);
@@ -2303,10 +2197,6 @@
final __test = new NonErrorResolverTest();
runJUnitTest(__test, __test.test_undefinedConstructorInInitializer_explicit_unnamed);
});
- _ut.test('test_undefinedConstructorInInitializer_hasOptionalParameters', () {
- final __test = new NonErrorResolverTest();
- runJUnitTest(__test, __test.test_undefinedConstructorInInitializer_hasOptionalParameters);
- });
_ut.test('test_undefinedConstructorInInitializer_implicit', () {
final __test = new NonErrorResolverTest();
runJUnitTest(__test, __test.test_undefinedConstructorInInitializer_implicit);
@@ -2658,48 +2548,12 @@
assertErrors([StaticTypeWarningCode.NON_BOOL_EXPRESSION]);
verify([source]);
}
- void test_returnOfInvalidType_expressionFunctionBody_function() {
- Source source = addSource(EngineTestCase.createSource(["int f() => '0';"]));
- resolve(source);
- assertErrors([StaticTypeWarningCode.RETURN_OF_INVALID_TYPE]);
- verify([source]);
- }
- void test_returnOfInvalidType_expressionFunctionBody_getter() {
- Source source = addSource(EngineTestCase.createSource(["int get g => '0';"]));
- resolve(source);
- assertErrors([StaticTypeWarningCode.RETURN_OF_INVALID_TYPE]);
- verify([source]);
- }
- void test_returnOfInvalidType_expressionFunctionBody_localFunction() {
- Source source = addSource(EngineTestCase.createSource(["class A {", " String m() {", " int f() => '0';", " }", "}"]));
- resolve(source);
- assertErrors([StaticTypeWarningCode.RETURN_OF_INVALID_TYPE]);
- verify([source]);
- }
- void test_returnOfInvalidType_expressionFunctionBody_method() {
- Source source = addSource(EngineTestCase.createSource(["class A {", " int f() => '0';", "}"]));
- resolve(source);
- assertErrors([StaticTypeWarningCode.RETURN_OF_INVALID_TYPE]);
- verify([source]);
- }
- void test_returnOfInvalidType_expressionFunctionBody_void() {
- Source source = addSource(EngineTestCase.createSource(["void f() => 42;"]));
- resolve(source);
- assertErrors([StaticTypeWarningCode.RETURN_OF_INVALID_TYPE]);
- verify([source]);
- }
void test_returnOfInvalidType_function() {
Source source = addSource(EngineTestCase.createSource(["int f() { return '0'; }"]));
resolve(source);
assertErrors([StaticTypeWarningCode.RETURN_OF_INVALID_TYPE]);
verify([source]);
}
- void test_returnOfInvalidType_getter() {
- Source source = addSource(EngineTestCase.createSource(["int get g { return '0'; }"]));
- resolve(source);
- assertErrors([StaticTypeWarningCode.RETURN_OF_INVALID_TYPE]);
- verify([source]);
- }
void test_returnOfInvalidType_localFunction() {
Source source = addSource(EngineTestCase.createSource(["class A {", " String m() {", " int f() { return '0'; }", " }", "}"]));
resolve(source);
@@ -2750,11 +2604,6 @@
resolve(source);
assertErrors([StaticTypeWarningCode.UNDEFINED_METHOD]);
}
- void test_undefinedMethod_ignoreTypePropagation() {
- Source source = addSource(EngineTestCase.createSource(["class A {}", "class B extends A {", " m() {}", "}", "class C {", "f() {", " A a = new B();", " a.m();", " }", "}"]));
- resolve(source);
- assertErrors([StaticTypeWarningCode.UNDEFINED_METHOD]);
- }
void test_undefinedOperator_indexBoth() {
Source source = addSource(EngineTestCase.createSource(["class A {}", "f(A a) {", " a[0]++;", "}"]));
resolve(source);
@@ -2876,34 +2725,10 @@
final __test = new StaticTypeWarningCodeTest();
runJUnitTest(__test, __test.test_nonBoolExpression);
});
- _ut.test('test_returnOfInvalidType_expressionFunctionBody_function', () {
- final __test = new StaticTypeWarningCodeTest();
- runJUnitTest(__test, __test.test_returnOfInvalidType_expressionFunctionBody_function);
- });
- _ut.test('test_returnOfInvalidType_expressionFunctionBody_getter', () {
- final __test = new StaticTypeWarningCodeTest();
- runJUnitTest(__test, __test.test_returnOfInvalidType_expressionFunctionBody_getter);
- });
- _ut.test('test_returnOfInvalidType_expressionFunctionBody_localFunction', () {
- final __test = new StaticTypeWarningCodeTest();
- runJUnitTest(__test, __test.test_returnOfInvalidType_expressionFunctionBody_localFunction);
- });
- _ut.test('test_returnOfInvalidType_expressionFunctionBody_method', () {
- final __test = new StaticTypeWarningCodeTest();
- runJUnitTest(__test, __test.test_returnOfInvalidType_expressionFunctionBody_method);
- });
- _ut.test('test_returnOfInvalidType_expressionFunctionBody_void', () {
- final __test = new StaticTypeWarningCodeTest();
- runJUnitTest(__test, __test.test_returnOfInvalidType_expressionFunctionBody_void);
- });
_ut.test('test_returnOfInvalidType_function', () {
final __test = new StaticTypeWarningCodeTest();
runJUnitTest(__test, __test.test_returnOfInvalidType_function);
});
- _ut.test('test_returnOfInvalidType_getter', () {
- final __test = new StaticTypeWarningCodeTest();
- runJUnitTest(__test, __test.test_returnOfInvalidType_getter);
- });
_ut.test('test_returnOfInvalidType_localFunction', () {
final __test = new StaticTypeWarningCodeTest();
runJUnitTest(__test, __test.test_returnOfInvalidType_localFunction);
@@ -2940,10 +2765,6 @@
final __test = new StaticTypeWarningCodeTest();
runJUnitTest(__test, __test.test_undefinedMethod);
});
- _ut.test('test_undefinedMethod_ignoreTypePropagation', () {
- final __test = new StaticTypeWarningCodeTest();
- runJUnitTest(__test, __test.test_undefinedMethod_ignoreTypePropagation);
- });
_ut.test('test_undefinedOperator_indexBoth', () {
final __test = new StaticTypeWarningCodeTest();
runJUnitTest(__test, __test.test_undefinedOperator_indexBoth);
@@ -3294,7 +3115,7 @@
class ResolverTestCase extends EngineTestCase {
/**
- * The source factory used to create [Source sources].
+ * The source factory used to create {@link Source sources}.
*/
SourceFactory _sourceFactory;
@@ -3373,7 +3194,7 @@
}
/**
- * Create a library element that represents a library named `"test"` containing a single
+ * Create a library element that represents a library named {@code "test"} containing a single
* empty compilation unit.
* @return the library element that was created
*/
@@ -3430,7 +3251,7 @@
/**
* Given a library and all of its parts, resolve the contents of the library and the contents of
* the parts. This assumes that the sources for the library and its parts have already been added
- * to the content provider using the method [addSource].
+ * to the content provider using the method {@link #addSource(String,String)}.
* @param librarySource the source for the compilation unit that defines the library
* @return the element representing the resolved library
* @throws AnalysisException if the analysis could not be performed
@@ -4059,6 +3880,18 @@
assertErrors([CompileTimeErrorCode.MIXIN_OF_NON_CLASS]);
verify([source]);
}
+ void fail_nonConstantDefaultValue_named() {
+ Source source = addSource(EngineTestCase.createSource(["f({x : 2 + 3}) {}"]));
+ resolve(source);
+ assertErrors([CompileTimeErrorCode.NON_CONSTANT_DEFAULT_VALUE]);
+ verify([source]);
+ }
+ void fail_nonConstantDefaultValue_positional() {
+ Source source = addSource(EngineTestCase.createSource(["f([x = 2 + 3]) {}"]));
+ resolve(source);
+ assertErrors([CompileTimeErrorCode.NON_CONSTANT_DEFAULT_VALUE]);
+ verify([source]);
+ }
void fail_objectCannotExtendAnotherClass() {
Source source = addSource(EngineTestCase.createSource([]));
resolve(source);
@@ -4107,6 +3940,24 @@
assertErrors([CompileTimeErrorCode.SUPER_INITIALIZER_IN_OBJECT]);
verify([source]);
}
+ void fail_typeArgumentsForNonGenericClass_creation_const() {
+ Source source = addSource(EngineTestCase.createSource(["class A {}", "f(p) {", " return const A<int>();", "}"]));
+ resolve(source);
+ assertErrors([CompileTimeErrorCode.TYPE_ARGUMENTS_FOR_NON_GENERIC_CLASS]);
+ verify([source]);
+ }
+ void fail_typeArgumentsForNonGenericClass_creation_new() {
+ Source source = addSource(EngineTestCase.createSource(["class A {}", "f(p) {", " return new A<int>();", "}"]));
+ resolve(source);
+ assertErrors([CompileTimeErrorCode.TYPE_ARGUMENTS_FOR_NON_GENERIC_CLASS]);
+ verify([source]);
+ }
+ void fail_typeArgumentsForNonGenericClass_typeCast() {
+ Source source = addSource(EngineTestCase.createSource(["class A {}", "f(p) {", " return p as A<int>;", "}"]));
+ resolve(source);
+ assertErrors([CompileTimeErrorCode.TYPE_ARGUMENTS_FOR_NON_GENERIC_CLASS]);
+ verify([source]);
+ }
void fail_uninitializedFinalField() {
Source source = addSource(EngineTestCase.createSource(["class A {", " final int i;", "}"]));
resolve(source);
@@ -4513,31 +4364,31 @@
void test_extendsOrImplementsDisallowedClass_extends_bool() {
Source source = addSource(EngineTestCase.createSource(["class A extends bool {}"]));
resolve(source);
- assertErrors([CompileTimeErrorCode.EXTENDS_DISALLOWED_CLASS, StaticWarningCode.NO_DEFAULT_SUPER_CONSTRUCTOR_IMPLICIT]);
+ assertErrors([CompileTimeErrorCode.EXTENDS_DISALLOWED_CLASS]);
verify([source]);
}
void test_extendsOrImplementsDisallowedClass_extends_double() {
Source source = addSource(EngineTestCase.createSource(["class A extends double {}"]));
resolve(source);
- assertErrors([CompileTimeErrorCode.EXTENDS_DISALLOWED_CLASS, StaticWarningCode.NO_DEFAULT_SUPER_CONSTRUCTOR_IMPLICIT]);
+ assertErrors([CompileTimeErrorCode.EXTENDS_DISALLOWED_CLASS]);
verify([source]);
}
void test_extendsOrImplementsDisallowedClass_extends_int() {
Source source = addSource(EngineTestCase.createSource(["class A extends int {}"]));
resolve(source);
- assertErrors([CompileTimeErrorCode.EXTENDS_DISALLOWED_CLASS, StaticWarningCode.NO_DEFAULT_SUPER_CONSTRUCTOR_IMPLICIT]);
+ assertErrors([CompileTimeErrorCode.EXTENDS_DISALLOWED_CLASS]);
verify([source]);
}
void test_extendsOrImplementsDisallowedClass_extends_num() {
Source source = addSource(EngineTestCase.createSource(["class A extends num {}"]));
resolve(source);
- assertErrors([CompileTimeErrorCode.EXTENDS_DISALLOWED_CLASS, StaticWarningCode.NO_DEFAULT_SUPER_CONSTRUCTOR_IMPLICIT]);
+ assertErrors([CompileTimeErrorCode.EXTENDS_DISALLOWED_CLASS]);
verify([source]);
}
void test_extendsOrImplementsDisallowedClass_extends_String() {
Source source = addSource(EngineTestCase.createSource(["class A extends String {}"]));
resolve(source);
- assertErrors([CompileTimeErrorCode.EXTENDS_DISALLOWED_CLASS, StaticWarningCode.NO_DEFAULT_SUPER_CONSTRUCTOR_IMPLICIT]);
+ assertErrors([CompileTimeErrorCode.EXTENDS_DISALLOWED_CLASS]);
verify([source]);
}
void test_extendsOrImplementsDisallowedClass_implements_bool() {
@@ -4653,7 +4504,7 @@
* This test doesn't test the FINAL_INITIALIZED_IN_DECLARATION_AND_CONSTRUCTOR code, but tests the
* FIELD_INITIALIZED_IN_INITIALIZER_AND_DECLARATION code instead. It is provided here to show
* coverage over all of the permutations of initializers in constructor declarations.
- *
+ * <p>
* Note: FIELD_INITIALIZED_IN_INITIALIZER_AND_DECLARATION covers a subset of
* FINAL_INITIALIZED_IN_DECLARATION_AND_CONSTRUCTOR, since it more specific, we use it instead of
* the broader code
@@ -4681,7 +4532,7 @@
* This test doesn't test the FINAL_INITIALIZED_MULTIPLE_TIMES code, but tests the
* FIELD_INITIALIZED_IN_PARAMETER_AND_INITIALIZER code instead. It is provided here to show
* coverage over all of the permutations of initializers in constructor declarations.
- *
+ * <p>
* Note: FIELD_INITIALIZED_IN_PARAMETER_AND_INITIALIZER covers a subset of
* FINAL_INITIALIZED_MULTIPLE_TIMES, since it more specific, we use it instead of the broader code
*/
@@ -5075,42 +4926,6 @@
assertErrors([CompileTimeErrorCode.NEW_WITH_INVALID_TYPE_PARAMETERS]);
verify([source]);
}
- void test_nonConstantDefaultValue_function_named() {
- Source source = addSource(EngineTestCase.createSource(["int y;", "f({x : y}) {}"]));
- resolve(source);
- assertErrors([CompileTimeErrorCode.NON_CONSTANT_DEFAULT_VALUE]);
- verify([source]);
- }
- void test_nonConstantDefaultValue_function_positional() {
- Source source = addSource(EngineTestCase.createSource(["int y;", "f([x = y]) {}"]));
- resolve(source);
- assertErrors([CompileTimeErrorCode.NON_CONSTANT_DEFAULT_VALUE]);
- verify([source]);
- }
- void test_nonConstantDefaultValue_inConstructor_named() {
- Source source = addSource(EngineTestCase.createSource(["class A {", " int y;", " A({x : y}) {}", "}"]));
- resolve(source);
- assertErrors([CompileTimeErrorCode.NON_CONSTANT_DEFAULT_VALUE]);
- verify([source]);
- }
- void test_nonConstantDefaultValue_inConstructor_positional() {
- Source source = addSource(EngineTestCase.createSource(["class A {", " int y;", " A([x = y]) {}", "}"]));
- resolve(source);
- assertErrors([CompileTimeErrorCode.NON_CONSTANT_DEFAULT_VALUE]);
- verify([source]);
- }
- void test_nonConstantDefaultValue_method_named() {
- Source source = addSource(EngineTestCase.createSource(["class A {", " int y;", " m({x : y}) {}", "}"]));
- resolve(source);
- assertErrors([CompileTimeErrorCode.NON_CONSTANT_DEFAULT_VALUE]);
- verify([source]);
- }
- void test_nonConstantDefaultValue_method_positional() {
- Source source = addSource(EngineTestCase.createSource(["class A {", " int y;", " m([x = y]) {}", "}"]));
- resolve(source);
- assertErrors([CompileTimeErrorCode.NON_CONSTANT_DEFAULT_VALUE]);
- verify([source]);
- }
void test_nonConstCaseExpression() {
Source source = addSource(EngineTestCase.createSource(["f(int p, int q) {", " switch (p) {", " case 3 + q:", " break;", " }", "}"]));
resolve(source);
@@ -6261,30 +6076,6 @@
final __test = new CompileTimeErrorCodeTest();
runJUnitTest(__test, __test.test_nonConstValueInInitializer_super);
});
- _ut.test('test_nonConstantDefaultValue_function_named', () {
- final __test = new CompileTimeErrorCodeTest();
- runJUnitTest(__test, __test.test_nonConstantDefaultValue_function_named);
- });
- _ut.test('test_nonConstantDefaultValue_function_positional', () {
- final __test = new CompileTimeErrorCodeTest();
- runJUnitTest(__test, __test.test_nonConstantDefaultValue_function_positional);
- });
- _ut.test('test_nonConstantDefaultValue_inConstructor_named', () {
- final __test = new CompileTimeErrorCodeTest();
- runJUnitTest(__test, __test.test_nonConstantDefaultValue_inConstructor_named);
- });
- _ut.test('test_nonConstantDefaultValue_inConstructor_positional', () {
- final __test = new CompileTimeErrorCodeTest();
- runJUnitTest(__test, __test.test_nonConstantDefaultValue_inConstructor_positional);
- });
- _ut.test('test_nonConstantDefaultValue_method_named', () {
- final __test = new CompileTimeErrorCodeTest();
- runJUnitTest(__test, __test.test_nonConstantDefaultValue_method_named);
- });
- _ut.test('test_nonConstantDefaultValue_method_positional', () {
- final __test = new CompileTimeErrorCodeTest();
- runJUnitTest(__test, __test.test_nonConstantDefaultValue_method_positional);
- });
_ut.test('test_nonGenerativeConstructor_explicit', () {
final __test = new CompileTimeErrorCodeTest();
runJUnitTest(__test, __test.test_nonGenerativeConstructor_explicit);
@@ -6533,7 +6324,7 @@
}
}
/**
- * Instances of the class `StaticTypeVerifier` verify that all of the nodes in an AST
+ * Instances of the class {@code StaticTypeVerifier} verify that all of the nodes in an AST
* structure that should have a static type associated with them do have a static type.
*/
class StaticTypeVerifier extends GeneralizingASTVisitor<Object> {
@@ -6667,7 +6458,7 @@
}
}
/**
- * The class `StrictModeTest` contains tests to ensure that the correct errors and warnings
+ * The class {@code StrictModeTest} contains tests to ensure that the correct errors and warnings
* are reported when the analysis engine is run in strict mode.
*/
class StrictModeTest extends ResolverTestCase {
@@ -7169,7 +6960,7 @@
resolveInClass(node, classA);
Element element = node.element;
EngineTestCase.assertInstanceOf(PropertyAccessorElement, element);
- JUnitTestCase.assertTrue(((element as PropertyAccessorElement)).isSetter);
+ JUnitTestCase.assertTrue(((element as PropertyAccessorElement)).isSetter());
_listener.assertNoErrors();
}
void test_visitSuperConstructorInvocation() {
@@ -7747,6 +7538,12 @@
assertErrors([StaticWarningCode.INVALID_FACTORY_NAME]);
verify([source]);
}
+ void fail_invalidOverrideDifferentDefaultValues() {
+ Source source = addSource(EngineTestCase.createSource(["class A {", " m([int p = 0]) {}", "}", "class B extends A {", " m([int p = 1]) {}", "}"]));
+ resolve(source);
+ assertErrors([StaticWarningCode.INVALID_OVERRIDE_DIFFERENT_DEFAULT_VALUES]);
+ verify([source]);
+ }
void fail_invocationOfNonFunction() {
Source source = addSource(EngineTestCase.createSource([]));
resolve(source);
@@ -8244,18 +8041,6 @@
assertErrors([StaticWarningCode.INVALID_METHOD_OVERRIDE_RETURN_TYPE]);
verify([source]);
}
- void test_invalidOverrideDifferentDefaultValues_named() {
- Source source = addSource(EngineTestCase.createSource(["class A {", " m({int p : 0}) {}", "}", "class B extends A {", " m({int p : 1}) {}", "}"]));
- resolve(source);
- assertErrors([StaticWarningCode.INVALID_OVERRIDE_DIFFERENT_DEFAULT_VALUES_NAMED]);
- verify([source]);
- }
- void test_invalidOverrideDifferentDefaultValues_positional() {
- Source source = addSource(EngineTestCase.createSource(["class A {", " m([int p = 0]) {}", "}", "class B extends A {", " m([int p = 1]) {}", "}"]));
- resolve(source);
- assertErrors([StaticWarningCode.INVALID_OVERRIDE_DIFFERENT_DEFAULT_VALUES_POSITIONAL]);
- verify([source]);
- }
void test_invalidSetterOverrideNormalParamType() {
Source source = addSource(EngineTestCase.createSource(["class A {", " void set s(int v) {}", "}", "class B extends A {", " void set s(String v) {}", "}"]));
resolve(source);
@@ -8297,24 +8082,6 @@
assertErrors([StaticWarningCode.NEW_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT]);
verify([source]);
}
- void test_noDefaultSuperConstructorExplicit() {
- Source source = addSource(EngineTestCase.createSource(["class A {", " A(p);", "}", "class B extends A {", " B() {}", "}"]));
- resolve(source);
- assertErrors([StaticWarningCode.NO_DEFAULT_SUPER_CONSTRUCTOR_EXPLICIT]);
- verify([source]);
- }
- void test_noDefaultSuperConstructorImplicit_superHasParameters() {
- Source source = addSource(EngineTestCase.createSource(["class A {", " A(p);", "}", "class B extends A {", "}"]));
- resolve(source);
- assertErrors([StaticWarningCode.NO_DEFAULT_SUPER_CONSTRUCTOR_IMPLICIT]);
- verify([source]);
- }
- void test_noDefaultSuperConstructorImplicit_superOnlyNamed() {
- Source source = addSource(EngineTestCase.createSource(["class A { A.named() {} }", "class B extends A {}"]));
- resolve(source);
- assertErrors([StaticWarningCode.NO_DEFAULT_SUPER_CONSTRUCTOR_IMPLICIT]);
- verify([source]);
- }
void test_nonAbstractClassInheritsAbstractMemberFivePlus() {
Source source = addSource(EngineTestCase.createSource(["abstract class A {", " m();", " n();", " o();", " p();", " q();", "}", "class C extends A {", "}"]));
resolve(source);
@@ -8369,12 +8136,6 @@
assertErrors([StaticWarningCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE]);
verify([source]);
}
- void test_nonAbstractClassInheritsAbstractMemberOne_superclasses_interface() {
- Source source = addSource(EngineTestCase.createSource(["class A {", " get a => 'a';", "}", "abstract class B implements A {", " get b => 'b';", "}", "class C extends B {", "}"]));
- resolve(source);
- assertErrors([StaticWarningCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE]);
- verify([source]);
- }
void test_nonAbstractClassInheritsAbstractMemberThree() {
Source source = addSource(EngineTestCase.createSource(["abstract class A {", " m();", " n();", " o();", "}", "class C extends A {", "}"]));
resolve(source);
@@ -8841,14 +8602,6 @@
final __test = new StaticWarningCodeTest();
runJUnitTest(__test, __test.test_invalidMethodOverrideReturnType_void);
});
- _ut.test('test_invalidOverrideDifferentDefaultValues_named', () {
- final __test = new StaticWarningCodeTest();
- runJUnitTest(__test, __test.test_invalidOverrideDifferentDefaultValues_named);
- });
- _ut.test('test_invalidOverrideDifferentDefaultValues_positional', () {
- final __test = new StaticWarningCodeTest();
- runJUnitTest(__test, __test.test_invalidOverrideDifferentDefaultValues_positional);
- });
_ut.test('test_invalidSetterOverrideNormalParamType', () {
final __test = new StaticWarningCodeTest();
runJUnitTest(__test, __test.test_invalidSetterOverrideNormalParamType);
@@ -8877,18 +8630,6 @@
final __test = new StaticWarningCodeTest();
runJUnitTest(__test, __test.test_newWithUndefinedConstructorDefault);
});
- _ut.test('test_noDefaultSuperConstructorExplicit', () {
- final __test = new StaticWarningCodeTest();
- runJUnitTest(__test, __test.test_noDefaultSuperConstructorExplicit);
- });
- _ut.test('test_noDefaultSuperConstructorImplicit_superHasParameters', () {
- final __test = new StaticWarningCodeTest();
- runJUnitTest(__test, __test.test_noDefaultSuperConstructorImplicit_superHasParameters);
- });
- _ut.test('test_noDefaultSuperConstructorImplicit_superOnlyNamed', () {
- final __test = new StaticWarningCodeTest();
- runJUnitTest(__test, __test.test_noDefaultSuperConstructorImplicit_superOnlyNamed);
- });
_ut.test('test_nonAbstractClassInheritsAbstractMemberFivePlus', () {
final __test = new StaticWarningCodeTest();
runJUnitTest(__test, __test.test_nonAbstractClassInheritsAbstractMemberFivePlus);
@@ -8925,10 +8666,6 @@
final __test = new StaticWarningCodeTest();
runJUnitTest(__test, __test.test_nonAbstractClassInheritsAbstractMemberOne_setter_fromSuperclass);
});
- _ut.test('test_nonAbstractClassInheritsAbstractMemberOne_superclasses_interface', () {
- final __test = new StaticWarningCodeTest();
- runJUnitTest(__test, __test.test_nonAbstractClassInheritsAbstractMemberOne_superclasses_interface);
- });
_ut.test('test_nonAbstractClassInheritsAbstractMemberThree', () {
final __test = new StaticWarningCodeTest();
runJUnitTest(__test, __test.test_nonAbstractClassInheritsAbstractMemberThree);
@@ -9079,7 +8816,7 @@
}
}
/**
- * Instances of the class `TestTypeProvider` implement a type provider that can be used by
+ * Instances of the class {@code TestTypeProvider} implement a type provider that can be used by
* tests without creating the element model for the core library.
*/
class TestTypeProvider implements TypeProvider {
@@ -9200,7 +8937,6 @@
_iterableType = iterableElement.type;
Type2 eType = iterableElement.typeVariables[0].type;
iterableElement.accessors = <PropertyAccessorElement> [ElementFactory.getterElement("iterator", false, iteratorType.substitute5(<Type2> [eType])), ElementFactory.getterElement("last", false, eType)];
- propagateTypeArguments(iterableElement);
}
return _iterableType;
}
@@ -9210,7 +8946,6 @@
_iteratorType = iteratorElement.type;
Type2 eType = iteratorElement.typeVariables[0].type;
iteratorElement.accessors = <PropertyAccessorElement> [ElementFactory.getterElement("current", false, eType)];
- propagateTypeArguments(iteratorElement);
}
return _iteratorType;
}
@@ -9223,8 +8958,7 @@
InterfaceType supertype = iterableType.substitute5(<Type2> [eType]);
listElement.supertype = supertype;
listElement.accessors = <PropertyAccessorElement> [ElementFactory.getterElement("length", false, intType)];
- listElement.methods = <MethodElement> [ElementFactory.methodElement("[]", eType, [intType]), ElementFactory.methodElement("[]=", VoidTypeImpl.instance, [intType, eType]), ElementFactory.methodElement("add", VoidTypeImpl.instance, [eType])];
- propagateTypeArguments(listElement);
+ listElement.methods = <MethodElement> [ElementFactory.methodElement("[]", eType, [intType]), ElementFactory.methodElement("[]=", VoidTypeImpl.instance, [intType, eType])];
}
return _listType;
}
@@ -9233,7 +8967,6 @@
ClassElementImpl mapElement = ElementFactory.classElement2("Map", ["K", "V"]);
_mapType = mapElement.type;
mapElement.accessors = <PropertyAccessorElement> [ElementFactory.getterElement("length", false, intType)];
- propagateTypeArguments(mapElement);
}
return _mapType;
}
@@ -9302,30 +9035,9 @@
doubleElement.accessors = accessors;
doubleElement.methods = <MethodElement> [ElementFactory.methodElement("remainder", _doubleType, [_numType]), ElementFactory.methodElement("+", _doubleType, [_numType]), ElementFactory.methodElement("-", _doubleType, [_numType]), ElementFactory.methodElement("*", _doubleType, [_numType]), ElementFactory.methodElement("%", _doubleType, [_numType]), ElementFactory.methodElement("/", _doubleType, [_numType]), ElementFactory.methodElement("~/", _doubleType, [_numType]), ElementFactory.methodElement("-", _doubleType, []), ElementFactory.methodElement("abs", _doubleType, []), ElementFactory.methodElement("round", _doubleType, []), ElementFactory.methodElement("floor", _doubleType, []), ElementFactory.methodElement("ceil", _doubleType, []), ElementFactory.methodElement("truncate", _doubleType, []), ElementFactory.methodElement("toString", _stringType, [])];
}
-
- /**
- * Given a class element representing a class with type parameters, propagate those type
- * parameters to all of the accessors, methods and constructors defined for the class.
- * @param classElement the element representing the class with type parameters
- */
- void propagateTypeArguments(ClassElementImpl classElement) {
- List<Type2> typeArguments = TypeVariableTypeImpl.getTypes(classElement.typeVariables);
- for (PropertyAccessorElement accessor in classElement.accessors) {
- FunctionTypeImpl functionType = accessor.type as FunctionTypeImpl;
- functionType.typeArguments = typeArguments;
- }
- for (MethodElement method in classElement.methods) {
- FunctionTypeImpl functionType = method.type as FunctionTypeImpl;
- functionType.typeArguments = typeArguments;
- }
- for (ConstructorElement constructor in classElement.constructors) {
- FunctionTypeImpl functionType = constructor.type as FunctionTypeImpl;
- functionType.typeArguments = typeArguments;
- }
- }
}
/**
- * The class `AnalysisContextFactory` defines utility methods used to create analysis contexts
+ * The class {@code AnalysisContextFactory} defines utility methods used to create analysis contexts
* for testing purposes.
*/
class AnalysisContextFactory {
@@ -9498,7 +9210,7 @@
}
}
/**
- * Instances of the class `ResolutionVerifier` verify that all of the nodes in an AST
+ * Instances of the class {@code ResolutionVerifier} verify that all of the nodes in an AST
* structure that should have been resolved were resolved.
*/
class ResolutionVerifier extends RecursiveASTVisitor<Object> {
@@ -9568,7 +9280,7 @@
}
Object visitBinaryExpression(BinaryExpression node) {
node.visitChildren(this);
- if (!node.operator.isUserDefinableOperator) {
+ if (!node.operator.isUserDefinableOperator()) {
return null;
}
return checkResolved2(node, node.element, MethodElement);
@@ -9606,14 +9318,14 @@
Object visitPartOfDirective(PartOfDirective node) => checkResolved2(node, node.element, LibraryElement);
Object visitPostfixExpression(PostfixExpression node) {
node.visitChildren(this);
- if (!node.operator.isUserDefinableOperator) {
+ if (!node.operator.isUserDefinableOperator()) {
return null;
}
return checkResolved2(node, node.element, MethodElement);
}
Object visitPrefixExpression(PrefixExpression node) {
node.visitChildren(this);
- if (!node.operator.isUserDefinableOperator) {
+ if (!node.operator.isUserDefinableOperator()) {
return null;
}
return checkResolved2(node, node.element, MethodElement);
@@ -10059,8 +9771,8 @@
ClassElementImpl classElement = ElementFactory.classElement2("C", []);
String constructorName = "m";
ConstructorElementImpl constructor = ElementFactory.constructorElement(classElement, constructorName);
- constructor.returnType = classElement.type;
FunctionTypeImpl constructorType = new FunctionTypeImpl.con1(constructor);
+ constructorType.returnType = classElement.type;
constructor.type = constructorType;
classElement.constructors = <ConstructorElement> [constructor];
InstanceCreationExpression node = ASTFactory.instanceCreationExpression2(null, ASTFactory.typeName(classElement, []), [ASTFactory.identifier3(constructorName)]);
@@ -10073,8 +9785,8 @@
ClassElementImpl elementI = ElementFactory.classElement2("I", []);
ConstructorElementImpl constructor = ElementFactory.constructorElement(elementC, null);
elementC.constructors = <ConstructorElement> [constructor];
- constructor.returnType = elementC.type;
FunctionTypeImpl constructorType = new FunctionTypeImpl.con1(constructor);
+ constructorType.returnType = elementC.type;
constructor.type = constructorType;
TypeName typeName = ASTFactory.typeName(elementC, [ASTFactory.typeName(elementI, [])]);
typeName.type = elementC.type.substitute5(<Type2> [elementI.type]);
@@ -10089,8 +9801,8 @@
void test_visitInstanceCreationExpression_unnamed() {
ClassElementImpl classElement = ElementFactory.classElement2("C", []);
ConstructorElementImpl constructor = ElementFactory.constructorElement(classElement, null);
- constructor.returnType = classElement.type;
FunctionTypeImpl constructorType = new FunctionTypeImpl.con1(constructor);
+ constructorType.returnType = classElement.type;
constructor.type = constructorType;
classElement.constructors = <ConstructorElement> [constructor];
InstanceCreationExpression node = ASTFactory.instanceCreationExpression2(null, ASTFactory.typeName(classElement, []), []);
@@ -10413,7 +10125,7 @@
/**
* Create a function expression that has an element associated with it, where the element has an
- * incomplete type associated with it (just like the one[ElementBuilder#visitFunctionExpression] would have built if we had
+ * incomplete type associated with it (just like the one{@link ElementBuilder#visitFunctionExpression(FunctionExpression)} would have built if we had
* run it).
* @param parameters the parameters to the function
* @param body the body of the function
@@ -10817,7 +10529,7 @@
class LibraryElementBuilderTest extends EngineTestCase {
/**
- * The source factory used to create [Source sources].
+ * The source factory used to create {@link Source sources}.
*/
SourceFactory _sourceFactory;
void setUp() {
@@ -11252,7 +10964,7 @@
JUnitTestCase.assertNotNull(unit);
List<ClassElement> classes = unit.types;
EngineTestCase.assertLength(2, classes);
- JUnitTestCase.assertFalse(classes[0].isValidMixin);
+ JUnitTestCase.assertFalse(classes[0].isValidMixin());
assertNoErrors();
verify([source]);
}
@@ -11264,7 +10976,7 @@
JUnitTestCase.assertNotNull(unit);
List<ClassElement> classes = unit.types;
EngineTestCase.assertLength(1, classes);
- JUnitTestCase.assertFalse(classes[0].isValidMixin);
+ JUnitTestCase.assertFalse(classes[0].isValidMixin());
assertNoErrors();
verify([source]);
}
@@ -11276,7 +10988,7 @@
JUnitTestCase.assertNotNull(unit);
List<ClassElement> classes = unit.types;
EngineTestCase.assertLength(1, classes);
- JUnitTestCase.assertFalse(classes[0].isValidMixin);
+ JUnitTestCase.assertFalse(classes[0].isValidMixin());
assertNoErrors();
verify([source]);
}
@@ -11288,7 +11000,7 @@
JUnitTestCase.assertNotNull(unit);
List<ClassElement> classes = unit.types;
EngineTestCase.assertLength(1, classes);
- JUnitTestCase.assertTrue(classes[0].isValidMixin);
+ JUnitTestCase.assertTrue(classes[0].isValidMixin());
assertNoErrors();
verify([source]);
}
@@ -11380,7 +11092,7 @@
verify([source]);
}
void test_setter_inherited() {
- Source source = addSource(EngineTestCase.createSource(["class A {", " int get x => 0;", " set x(int p) {}", "}", "class B extends A {", " int get x => super.x == null ? 0 : super.x;", " int f() => x = 1;", "}"]));
+ Source source = addSource(EngineTestCase.createSource(["class A {", " int get x => 0;", " set x(int p) {}", "}", "class B extends A {", " int get x => super.x == null ? 0 : super.x;", " void f() => x = 1;", "}"]));
resolve(source);
assertNoErrors();
verify([source]);
@@ -11395,13 +11107,13 @@
/**
* Resolve the given source and verify that the arguments in a specific method invocation were
* correctly resolved.
- *
+ * <p>
* The source is expected to be source for a compilation unit, the first declaration is expected
* to be a class, the first member of which is expected to be a method with a block body, and the
* first statement in the body is expected to be an expression statement whose expression is a
* method invocation. It is the arguments to that method invocation that are tested. The method
* invocation can contain errors.
- *
+ * <p>
* The arguments were resolved correctly if the number of expressions in the list matches the
* length of the array of indices and if, for each index in the array of indices, the parameter to
* which the argument expression was resolved is the parameter in the invoked method's list of
@@ -11635,6 +11347,7 @@
// CompileTimeErrorCodeTest.dartSuite();
// ErrorResolverTest.dartSuite();
// NonErrorResolverTest.dartSuite();
+// PubSuggestionCodeTest.dartSuite();
// SimpleResolverTest.dartSuite();
// StaticTypeWarningCodeTest.dartSuite();
// StaticWarningCodeTest.dartSuite();
diff --git a/pkg/analyzer_experimental/test/generated/scanner_test.dart b/pkg/analyzer_experimental/test/generated/scanner_test.dart
index b48df5f..e9ff970 100644
--- a/pkg/analyzer_experimental/test/generated/scanner_test.dart
+++ b/pkg/analyzer_experimental/test/generated/scanner_test.dart
@@ -53,67 +53,67 @@
}
class TokenTypeTest extends EngineTestCase {
void test_isOperator() {
- JUnitTestCase.assertTrue(TokenType.AMPERSAND.isOperator);
- JUnitTestCase.assertTrue(TokenType.AMPERSAND_AMPERSAND.isOperator);
- JUnitTestCase.assertTrue(TokenType.AMPERSAND_EQ.isOperator);
- JUnitTestCase.assertTrue(TokenType.BANG.isOperator);
- JUnitTestCase.assertTrue(TokenType.BANG_EQ.isOperator);
- JUnitTestCase.assertTrue(TokenType.BAR.isOperator);
- JUnitTestCase.assertTrue(TokenType.BAR_BAR.isOperator);
- JUnitTestCase.assertTrue(TokenType.BAR_EQ.isOperator);
- JUnitTestCase.assertTrue(TokenType.CARET.isOperator);
- JUnitTestCase.assertTrue(TokenType.CARET_EQ.isOperator);
- JUnitTestCase.assertTrue(TokenType.EQ.isOperator);
- JUnitTestCase.assertTrue(TokenType.EQ_EQ.isOperator);
- JUnitTestCase.assertTrue(TokenType.GT.isOperator);
- JUnitTestCase.assertTrue(TokenType.GT_EQ.isOperator);
- JUnitTestCase.assertTrue(TokenType.GT_GT.isOperator);
- JUnitTestCase.assertTrue(TokenType.GT_GT_EQ.isOperator);
- JUnitTestCase.assertTrue(TokenType.INDEX.isOperator);
- JUnitTestCase.assertTrue(TokenType.INDEX_EQ.isOperator);
- JUnitTestCase.assertTrue(TokenType.IS.isOperator);
- JUnitTestCase.assertTrue(TokenType.LT.isOperator);
- JUnitTestCase.assertTrue(TokenType.LT_EQ.isOperator);
- JUnitTestCase.assertTrue(TokenType.LT_LT.isOperator);
- JUnitTestCase.assertTrue(TokenType.LT_LT_EQ.isOperator);
- JUnitTestCase.assertTrue(TokenType.MINUS.isOperator);
- JUnitTestCase.assertTrue(TokenType.MINUS_EQ.isOperator);
- JUnitTestCase.assertTrue(TokenType.MINUS_MINUS.isOperator);
- JUnitTestCase.assertTrue(TokenType.PERCENT.isOperator);
- JUnitTestCase.assertTrue(TokenType.PERCENT_EQ.isOperator);
- JUnitTestCase.assertTrue(TokenType.PERIOD_PERIOD.isOperator);
- JUnitTestCase.assertTrue(TokenType.PLUS.isOperator);
- JUnitTestCase.assertTrue(TokenType.PLUS_EQ.isOperator);
- JUnitTestCase.assertTrue(TokenType.PLUS_PLUS.isOperator);
- JUnitTestCase.assertTrue(TokenType.QUESTION.isOperator);
- JUnitTestCase.assertTrue(TokenType.SLASH.isOperator);
- JUnitTestCase.assertTrue(TokenType.SLASH_EQ.isOperator);
- JUnitTestCase.assertTrue(TokenType.STAR.isOperator);
- JUnitTestCase.assertTrue(TokenType.STAR_EQ.isOperator);
- JUnitTestCase.assertTrue(TokenType.TILDE.isOperator);
- JUnitTestCase.assertTrue(TokenType.TILDE_SLASH.isOperator);
- JUnitTestCase.assertTrue(TokenType.TILDE_SLASH_EQ.isOperator);
+ JUnitTestCase.assertTrue(TokenType.AMPERSAND.isOperator());
+ JUnitTestCase.assertTrue(TokenType.AMPERSAND_AMPERSAND.isOperator());
+ JUnitTestCase.assertTrue(TokenType.AMPERSAND_EQ.isOperator());
+ JUnitTestCase.assertTrue(TokenType.BANG.isOperator());
+ JUnitTestCase.assertTrue(TokenType.BANG_EQ.isOperator());
+ JUnitTestCase.assertTrue(TokenType.BAR.isOperator());
+ JUnitTestCase.assertTrue(TokenType.BAR_BAR.isOperator());
+ JUnitTestCase.assertTrue(TokenType.BAR_EQ.isOperator());
+ JUnitTestCase.assertTrue(TokenType.CARET.isOperator());
+ JUnitTestCase.assertTrue(TokenType.CARET_EQ.isOperator());
+ JUnitTestCase.assertTrue(TokenType.EQ.isOperator());
+ JUnitTestCase.assertTrue(TokenType.EQ_EQ.isOperator());
+ JUnitTestCase.assertTrue(TokenType.GT.isOperator());
+ JUnitTestCase.assertTrue(TokenType.GT_EQ.isOperator());
+ JUnitTestCase.assertTrue(TokenType.GT_GT.isOperator());
+ JUnitTestCase.assertTrue(TokenType.GT_GT_EQ.isOperator());
+ JUnitTestCase.assertTrue(TokenType.INDEX.isOperator());
+ JUnitTestCase.assertTrue(TokenType.INDEX_EQ.isOperator());
+ JUnitTestCase.assertTrue(TokenType.IS.isOperator());
+ JUnitTestCase.assertTrue(TokenType.LT.isOperator());
+ JUnitTestCase.assertTrue(TokenType.LT_EQ.isOperator());
+ JUnitTestCase.assertTrue(TokenType.LT_LT.isOperator());
+ JUnitTestCase.assertTrue(TokenType.LT_LT_EQ.isOperator());
+ JUnitTestCase.assertTrue(TokenType.MINUS.isOperator());
+ JUnitTestCase.assertTrue(TokenType.MINUS_EQ.isOperator());
+ JUnitTestCase.assertTrue(TokenType.MINUS_MINUS.isOperator());
+ JUnitTestCase.assertTrue(TokenType.PERCENT.isOperator());
+ JUnitTestCase.assertTrue(TokenType.PERCENT_EQ.isOperator());
+ JUnitTestCase.assertTrue(TokenType.PERIOD_PERIOD.isOperator());
+ JUnitTestCase.assertTrue(TokenType.PLUS.isOperator());
+ JUnitTestCase.assertTrue(TokenType.PLUS_EQ.isOperator());
+ JUnitTestCase.assertTrue(TokenType.PLUS_PLUS.isOperator());
+ JUnitTestCase.assertTrue(TokenType.QUESTION.isOperator());
+ JUnitTestCase.assertTrue(TokenType.SLASH.isOperator());
+ JUnitTestCase.assertTrue(TokenType.SLASH_EQ.isOperator());
+ JUnitTestCase.assertTrue(TokenType.STAR.isOperator());
+ JUnitTestCase.assertTrue(TokenType.STAR_EQ.isOperator());
+ JUnitTestCase.assertTrue(TokenType.TILDE.isOperator());
+ JUnitTestCase.assertTrue(TokenType.TILDE_SLASH.isOperator());
+ JUnitTestCase.assertTrue(TokenType.TILDE_SLASH_EQ.isOperator());
}
void test_isUserDefinableOperator() {
- JUnitTestCase.assertTrue(TokenType.AMPERSAND.isUserDefinableOperator);
- JUnitTestCase.assertTrue(TokenType.BAR.isUserDefinableOperator);
- JUnitTestCase.assertTrue(TokenType.CARET.isUserDefinableOperator);
- JUnitTestCase.assertTrue(TokenType.EQ_EQ.isUserDefinableOperator);
- JUnitTestCase.assertTrue(TokenType.GT.isUserDefinableOperator);
- JUnitTestCase.assertTrue(TokenType.GT_EQ.isUserDefinableOperator);
- JUnitTestCase.assertTrue(TokenType.GT_GT.isUserDefinableOperator);
- JUnitTestCase.assertTrue(TokenType.INDEX.isUserDefinableOperator);
- JUnitTestCase.assertTrue(TokenType.INDEX_EQ.isUserDefinableOperator);
- JUnitTestCase.assertTrue(TokenType.LT.isUserDefinableOperator);
- JUnitTestCase.assertTrue(TokenType.LT_EQ.isUserDefinableOperator);
- JUnitTestCase.assertTrue(TokenType.LT_LT.isUserDefinableOperator);
- JUnitTestCase.assertTrue(TokenType.MINUS.isUserDefinableOperator);
- JUnitTestCase.assertTrue(TokenType.PERCENT.isUserDefinableOperator);
- JUnitTestCase.assertTrue(TokenType.PLUS.isUserDefinableOperator);
- JUnitTestCase.assertTrue(TokenType.SLASH.isUserDefinableOperator);
- JUnitTestCase.assertTrue(TokenType.STAR.isUserDefinableOperator);
- JUnitTestCase.assertTrue(TokenType.TILDE.isUserDefinableOperator);
- JUnitTestCase.assertTrue(TokenType.TILDE_SLASH.isUserDefinableOperator);
+ JUnitTestCase.assertTrue(TokenType.AMPERSAND.isUserDefinableOperator());
+ JUnitTestCase.assertTrue(TokenType.BAR.isUserDefinableOperator());
+ JUnitTestCase.assertTrue(TokenType.CARET.isUserDefinableOperator());
+ JUnitTestCase.assertTrue(TokenType.EQ_EQ.isUserDefinableOperator());
+ JUnitTestCase.assertTrue(TokenType.GT.isUserDefinableOperator());
+ JUnitTestCase.assertTrue(TokenType.GT_EQ.isUserDefinableOperator());
+ JUnitTestCase.assertTrue(TokenType.GT_GT.isUserDefinableOperator());
+ JUnitTestCase.assertTrue(TokenType.INDEX.isUserDefinableOperator());
+ JUnitTestCase.assertTrue(TokenType.INDEX_EQ.isUserDefinableOperator());
+ JUnitTestCase.assertTrue(TokenType.LT.isUserDefinableOperator());
+ JUnitTestCase.assertTrue(TokenType.LT_EQ.isUserDefinableOperator());
+ JUnitTestCase.assertTrue(TokenType.LT_LT.isUserDefinableOperator());
+ JUnitTestCase.assertTrue(TokenType.MINUS.isUserDefinableOperator());
+ JUnitTestCase.assertTrue(TokenType.PERCENT.isUserDefinableOperator());
+ JUnitTestCase.assertTrue(TokenType.PLUS.isUserDefinableOperator());
+ JUnitTestCase.assertTrue(TokenType.SLASH.isUserDefinableOperator());
+ JUnitTestCase.assertTrue(TokenType.STAR.isUserDefinableOperator());
+ JUnitTestCase.assertTrue(TokenType.TILDE.isUserDefinableOperator());
+ JUnitTestCase.assertTrue(TokenType.TILDE_SLASH.isUserDefinableOperator());
}
static dartSuite() {
_ut.group('TokenTypeTest', () {
@@ -129,7 +129,7 @@
}
}
/**
- * The class `TokenFactory` defines utility methods that can be used to create tokens.
+ * The class {@code TokenFactory} defines utility methods that can be used to create tokens.
*/
class TokenFactory {
static Token token(Keyword keyword) => new KeywordToken(keyword, 0);
@@ -1474,7 +1474,7 @@
}
}
/**
- * Instances of the class `TokenStreamValidator` are used to validate the correct construction
+ * Instances of the class {@code TokenStreamValidator} are used to validate the correct construction
* of a stream of tokens.
*/
class TokenStreamValidator {
@@ -2156,7 +2156,7 @@
}
}
/**
- * Instances of the class `ExpectedLocation` encode information about the expected location
+ * Instances of the class {@code ExpectedLocation} encode information about the expected location
* of a given offset in source code.
*/
class AbstractScannerTest_ExpectedLocation {
diff --git a/pkg/analyzer_experimental/test/generated/test_support.dart b/pkg/analyzer_experimental/test/generated/test_support.dart
index 6b39ac8..ea44668 100644
--- a/pkg/analyzer_experimental/test/generated/test_support.dart
+++ b/pkg/analyzer_experimental/test/generated/test_support.dart
@@ -12,7 +12,7 @@
import 'package:analyzer_experimental/src/generated/engine.dart' show AnalysisContext, AnalysisContextImpl, RecordingErrorListener;
import 'package:unittest/unittest.dart' as _ut;
/**
- * Instances of the class `GatheringErrorListener` implement an error listener that collects
+ * Instances of the class {@code GatheringErrorListener} implement an error listener that collects
* all of the errors passed to it for later examination.
*/
class GatheringErrorListener implements AnalysisErrorListener {
@@ -227,7 +227,7 @@
List<AnalysisError> get errors => _errors;
/**
- * Return the line information associated with the given source, or `null` if no line
+ * Return the line information associated with the given source, or {@code null} if no line
* information has been associated with the source.
* @param source the source with which the line information is associated
* @return the line information associated with the source
@@ -235,9 +235,9 @@
LineInfo getLineInfo(Source source) => _lineInfoMap[source];
/**
- * Return `true` if an error with the given error code has been gathered.
+ * Return {@code true} if an error with the given error code has been gathered.
* @param errorCode the error code being searched for
- * @return `true` if an error with the given error code has been gathered
+ * @return {@code true} if an error with the given error code has been gathered
*/
bool hasError(ErrorCode errorCode2) {
for (AnalysisError error in _errors) {
@@ -249,8 +249,8 @@
}
/**
- * Return `true` if at least one error has been gathered.
- * @return `true` if at least one error has been gathered
+ * Return {@code true} if at least one error has been gathered.
+ * @return {@code true} if at least one error has been gathered
*/
bool hasErrors() => _errors.length > 0;
void onError(AnalysisError error) {
@@ -281,18 +281,18 @@
}
/**
- * Return `true` if the two errors are equivalent.
+ * Return {@code true} if the two errors are equivalent.
* @param firstError the first error being compared
* @param secondError the second error being compared
- * @return `true` if the two errors are equivalent
+ * @return {@code true} if the two errors are equivalent
*/
bool equals3(AnalysisError firstError, AnalysisError secondError) => identical(firstError.errorCode, secondError.errorCode) && firstError.offset == secondError.offset && firstError.length == secondError.length && equals4(firstError.source, secondError.source);
/**
- * Return `true` if the two sources are equivalent.
+ * Return {@code true} if the two sources are equivalent.
* @param firstSource the first source being compared
* @param secondSource the second source being compared
- * @return `true` if the two sources are equivalent
+ * @return {@code true} if the two sources are equivalent
*/
bool equals4(Source firstSource, Source secondSource) {
if (firstSource == null) {
@@ -348,10 +348,10 @@
/**
* Search through the given list of errors for an error that is equal to the target error. If one
- * is found, remove it from the list and return `true`, otherwise return `false`without modifying the list.
+ * is found, remove it from the list and return {@code true}, otherwise return {@code false}without modifying the list.
* @param errors the errors through which we are searching
* @param targetError the error being searched for
- * @return `true` if the error is found and removed from the list
+ * @return {@code true} if the error is found and removed from the list
*/
bool foundAndRemoved(List<AnalysisError> errors, AnalysisError targetError) {
for (AnalysisError error in errors) {
@@ -364,7 +364,7 @@
}
}
/**
- * The class `EngineTestCase` defines utility methods for making assertions.
+ * The class {@code EngineTestCase} defines utility methods for making assertions.
*/
class EngineTestCase extends JUnitTestCase {
static int _PRINT_RANGE = 6;
@@ -388,11 +388,11 @@
}
/**
- * Assert that the given array is non-`null` and contains the expected elements. The
+ * Assert that the given array is non-{@code null} and contains the expected elements. The
* elements can appear in any order.
* @param array the array being tested
* @param expectedElements the expected elements
- * @throws AssertionFailedError if the array is `null` or does not contain the expected
+ * @throws AssertionFailedError if the array is {@code null} or does not contain the expected
* elements
*/
static void assertContains(List<Object> array, List<Object> expectedElements) {
@@ -466,10 +466,10 @@
}
/**
- * Assert that the given list is non-`null` and has exactly expected elements.
+ * Assert that the given list is non-{@code null} and has exactly expected elements.
* @param list the list being tested
* @param expectedElements the expected elements
- * @throws AssertionFailedError if the list is `null` or does not have the expected elements
+ * @throws AssertionFailedError if the list is {@code null} or does not have the expected elements
*/
static void assertExactElements(List<Object> list, List<Object> expectedElements) {
int expectedSize = expectedElements.length;
@@ -489,10 +489,10 @@
}
/**
- * Assert that the given array is non-`null` and has exactly expected elements.
+ * Assert that the given array is non-{@code null} and has exactly expected elements.
* @param array the array being tested
* @param expectedElements the expected elements
- * @throws AssertionFailedError if the array is `null` or does not have the expected
+ * @throws AssertionFailedError if the array is {@code null} or does not have the expected
* elements
*/
static void assertExactElements2(List<Object> array, List<Object> expectedElements) {
@@ -513,10 +513,10 @@
}
/**
- * Assert that the given list is non-`null` and has exactly expected elements.
+ * Assert that the given list is non-{@code null} and has exactly expected elements.
* @param set the list being tested
* @param expectedElements the expected elements
- * @throws AssertionFailedError if the list is `null` or does not have the expected elements
+ * @throws AssertionFailedError if the list is {@code null} or does not have the expected elements
*/
static void assertExactElements3(Set<Object> set, List<Object> expectedElements) {
int expectedSize = expectedElements.length;
@@ -549,10 +549,10 @@
}
/**
- * Assert that the given array is non-`null` and has the expected number of elements.
+ * Assert that the given array is non-{@code null} and has the expected number of elements.
* @param expectedLength the expected number of elements
* @param array the array being tested
- * @throws AssertionFailedError if the array is `null` or does not have the expected number
+ * @throws AssertionFailedError if the array is {@code null} or does not have the expected number
* of elements
*/
static void assertLength(int expectedLength, List<Object> array) {
@@ -582,10 +582,10 @@
}
/**
- * Assert that the given list is non-`null` and has the expected number of elements.
+ * Assert that the given list is non-{@code null} and has the expected number of elements.
* @param expectedSize the expected number of elements
* @param list the list being tested
- * @throws AssertionFailedError if the list is `null` or does not have the expected number
+ * @throws AssertionFailedError if the list is {@code null} or does not have the expected number
* of elements
*/
static void assertSize(int expectedSize, List<Object> list) {
@@ -597,10 +597,10 @@
}
/**
- * Assert that the given map is non-`null` and has the expected number of elements.
+ * Assert that the given map is non-{@code null} and has the expected number of elements.
* @param expectedSize the expected number of elements
* @param map the map being tested
- * @throws AssertionFailedError if the map is `null` or does not have the expected number of
+ * @throws AssertionFailedError if the map is {@code null} or does not have the expected number of
* elements
*/
static void assertSize2(int expectedSize, Map<Object, Object> map) {
@@ -612,10 +612,10 @@
}
/**
- * Assert that the given set is non-`null` and has the expected number of elements.
+ * Assert that the given set is non-{@code null} and has the expected number of elements.
* @param expectedSize the expected number of elements
* @param set the set being tested
- * @throws AssertionFailedError if the set is `null` or does not have the expected number of
+ * @throws AssertionFailedError if the set is {@code null} or does not have the expected number of
* elements
*/
static void assertSize3(int expectedSize, Set<Object> set) {
@@ -696,7 +696,7 @@
*/
PropertyAccessorElement getGetter(InterfaceType type, String getterName) {
for (PropertyAccessorElement accessor in type.element.accessors) {
- if (accessor.isGetter && accessor.name == getterName) {
+ if (accessor.isGetter() && accessor.name == getterName) {
return accessor;
}
}
@@ -751,7 +751,7 @@
throw new UnsupportedOperationException();
}
bool exists() => true;
- bool get isInSystemLibrary {
+ bool isInSystemLibrary() {
throw new UnsupportedOperationException();
}
Source resolve(String uri) {
diff --git a/pkg/analyzer_experimental/test/services/test_utils.dart b/pkg/analyzer_experimental/test/services/test_utils.dart
index e8757a4..2128aaa 100644
--- a/pkg/analyzer_experimental/test/services/test_utils.dart
+++ b/pkg/analyzer_experimental/test/services/test_utils.dart
@@ -178,7 +178,7 @@
bool exists() => true;
- bool get isInSystemLibrary => _unsupported();
+ bool isInSystemLibrary() => _unsupported();
Source resolve(String uri) => _unsupported();
diff --git a/pkg/args/lib/args.dart b/pkg/args/lib/args.dart
index 9e6252a..3898b9f 100644
--- a/pkg/args/lib/args.dart
+++ b/pkg/args/lib/args.dart
@@ -257,8 +257,6 @@
import 'src/parser.dart';
import 'src/usage.dart';
-import 'src/options.dart';
-export 'src/options.dart';
/**
* A class for taking a list of raw command line arguments and parsing out
@@ -379,6 +377,52 @@
}
/**
+ * A command-line option. Includes both flags and options which take a value.
+ */
+class Option {
+ final String name;
+ final String abbreviation;
+ final List<String> allowed;
+ final defaultValue;
+ final Function callback;
+ final String help;
+ final Map<String, String> allowedHelp;
+ final bool isFlag;
+ final bool negatable;
+ final bool allowMultiple;
+
+ Option(this.name, this.abbreviation, this.help, this.allowed,
+ this.allowedHelp, this.defaultValue, this.callback, {this.isFlag,
+ this.negatable, this.allowMultiple: false}) {
+
+ if (name.isEmpty) {
+ throw new ArgumentError('Name cannot be empty.');
+ } else if (name.startsWith('-')) {
+ throw new ArgumentError('Name $name cannot start with "-".');
+ }
+
+ // Ensure name does not contain any invalid characters.
+ if (_invalidChars.hasMatch(name)) {
+ throw new ArgumentError('Name "$name" contains invalid characters.');
+ }
+
+ if (abbreviation != null) {
+ if (abbreviation.length != 1) {
+ throw new ArgumentError('Abbreviation must be null or have length 1.');
+ } else if(abbreviation == '-') {
+ throw new ArgumentError('Abbreviation cannot be "-".');
+ }
+
+ if (_invalidChars.hasMatch(abbreviation)) {
+ throw new ArgumentError('Abbreviation is an invalid character.');
+ }
+ }
+ }
+
+ static final _invalidChars = new RegExp(r'''[ \t\r\n"'\\/]''');
+}
+
+/**
* The results of parsing a series of command line arguments using
* [ArgParser.parse()]. Includes the parsed options and any remaining unparsed
* command line arguments.
diff --git a/runtime/bin/directory_win.cc b/runtime/bin/directory_win.cc
index e8dc694..22c7a3a 100644
--- a/runtime/bin/directory_win.cc
+++ b/runtime/bin/directory_win.cc
@@ -20,7 +20,7 @@
namespace bin {
PathBuffer::PathBuffer() : length_(0) {
- data_ = calloc(PATH_MAX + 1, sizeof(wchar_t)); // NOLINT
+ data_ = calloc(MAX_PATH + 1, sizeof(wchar_t)); // NOLINT
}
char* PathBuffer::AsString() const {
diff --git a/runtime/lib/string_patch.dart b/runtime/lib/string_patch.dart
index 2d40f2d..80b369c 100644
--- a/runtime/lib/string_patch.dart
+++ b/runtime/lib/string_patch.dart
@@ -129,14 +129,11 @@
return _substringMatches(this.length - other.length, other);
}
- bool startsWith(Pattern pattern, [int index = 0]) {
- if (index < 0 || index > this.length) {
- throw new RangeError.range(index, 0, this.length);
- }
+ bool startsWith(Pattern pattern) {
if (pattern is String) {
- return _substringMatches(index, pattern);
+ return _substringMatches(0, pattern);
}
- return pattern.matchAsPrefix(this, index) != null;
+ return pattern.matchAsPrefix(this, 0) != null;
}
int indexOf(Pattern pattern, [int start = 0]) {
diff --git a/runtime/vm/code_generator.cc b/runtime/vm/code_generator.cc
index 912bb86..6eec38d 100644
--- a/runtime/vm/code_generator.cc
+++ b/runtime/vm/code_generator.cc
@@ -38,7 +38,7 @@
"Trace IC miss in optimized code");
DEFINE_FLAG(bool, trace_patching, false, "Trace patching of code.");
DEFINE_FLAG(bool, trace_runtime_calls, false, "Trace runtime calls");
-DEFINE_FLAG(int, optimization_counter_threshold, 15000,
+DEFINE_FLAG(int, optimization_counter_threshold, 3000,
"Function's usage-counter value before it is optimized, -1 means never");
DECLARE_FLAG(bool, enable_type_checks);
DECLARE_FLAG(bool, trace_type_checks);
@@ -871,12 +871,12 @@
static RawFunction* InlineCacheMissHandler(
const GrowableArray<const Instance*>& args,
const ICData& ic_data,
- const Array& args_descriptor_array) {
+ const Array& arg_descriptor_array) {
const Instance& receiver = *args[0];
const Code& target_code =
Code::Handle(ResolveCompileInstanceCallTarget(receiver,
ic_data,
- args_descriptor_array));
+ arg_descriptor_array));
if (target_code.IsNull()) {
// Let the megamorphic stub handle special cases: NoSuchMethod,
// closure calls.
@@ -1226,42 +1226,6 @@
}
-static bool CanOptimizeFunction(const Function& function, Isolate* isolate) {
- const intptr_t kLowInvocationCount = -100000000;
- if (isolate->debugger()->HasBreakpoint(function)) {
- // We cannot set breakpoints in optimized code, so do not optimize
- // the function.
- function.set_usage_counter(0);
- return false;
- }
- if (function.deoptimization_counter() >=
- FLAG_deoptimization_counter_threshold) {
- if (FLAG_trace_failed_optimization_attempts) {
- OS::PrintErr("Too Many Deoptimizations: %s\n",
- function.ToFullyQualifiedCString());
- }
- // TODO(srdjan): Investigate excessive deoptimization.
- function.set_usage_counter(kLowInvocationCount);
- return false;
- }
- if ((FLAG_optimization_filter != NULL) &&
- (strstr(function.ToFullyQualifiedCString(),
- FLAG_optimization_filter) == NULL)) {
- function.set_usage_counter(kLowInvocationCount);
- return false;
- }
- if (!function.is_optimizable()) {
- if (FLAG_trace_failed_optimization_attempts) {
- OS::PrintErr("Not Optimizable: %s\n", function.ToFullyQualifiedCString());
- }
- // TODO(5442338): Abort as this should not happen.
- function.set_usage_counter(kLowInvocationCount);
- return false;
- }
- return true;
-}
-
-
DEFINE_RUNTIME_ENTRY(StackOverflow, 0) {
ASSERT(arguments.ArgCount() ==
kStackOverflowRuntimeEntry.argument_count());
@@ -1314,7 +1278,7 @@
StackFrame* frame = iterator.NextFrame();
const Function& function = Function::Handle(frame->LookupDartFunction());
ASSERT(!function.IsNull());
- if (!CanOptimizeFunction(function, isolate)) return;
+ if (!function.is_optimizable()) return;
intptr_t osr_id =
Code::Handle(function.unoptimized_code()).GetDeoptIdForOsr(frame->pc());
if (FLAG_trace_osr) {
@@ -1368,10 +1332,35 @@
DEFINE_RUNTIME_ENTRY(OptimizeInvokedFunction, 1) {
ASSERT(arguments.ArgCount() ==
kOptimizeInvokedFunctionRuntimeEntry.argument_count());
+ const intptr_t kLowInvocationCount = -100000000;
const Function& function = Function::CheckedHandle(arguments.ArgAt(0));
ASSERT(!function.IsNull());
-
- if (CanOptimizeFunction(function, isolate)) {
+ if (isolate->debugger()->HasBreakpoint(function)) {
+ // We cannot set breakpoints in optimized code, so do not optimize
+ // the function.
+ function.set_usage_counter(0);
+ arguments.SetReturn(Code::Handle(function.CurrentCode()));
+ return;
+ }
+ if (function.deoptimization_counter() >=
+ FLAG_deoptimization_counter_threshold) {
+ if (FLAG_trace_failed_optimization_attempts) {
+ OS::PrintErr("Too Many Deoptimizations: %s\n",
+ function.ToFullyQualifiedCString());
+ }
+ // TODO(srdjan): Investigate excessive deoptimization.
+ function.set_usage_counter(kLowInvocationCount);
+ arguments.SetReturn(Code::Handle(function.CurrentCode()));
+ return;
+ }
+ if ((FLAG_optimization_filter != NULL) &&
+ (strstr(function.ToFullyQualifiedCString(),
+ FLAG_optimization_filter) == NULL)) {
+ function.set_usage_counter(kLowInvocationCount);
+ arguments.SetReturn(Code::Handle(function.CurrentCode()));
+ return;
+ }
+ if (function.is_optimizable()) {
const Error& error =
Error::Handle(Compiler::CompileOptimizedFunction(function));
if (!error.IsNull()) {
@@ -1381,6 +1370,12 @@
ASSERT(!optimized_code.IsNull());
// Reset usage counter for reoptimization.
function.set_usage_counter(0);
+ } else {
+ if (FLAG_trace_failed_optimization_attempts) {
+ OS::PrintErr("Not Optimizable: %s\n", function.ToFullyQualifiedCString());
+ }
+ // TODO(5442338): Abort as this should not happen.
+ function.set_usage_counter(kLowInvocationCount);
}
arguments.SetReturn(Code::Handle(function.CurrentCode()));
}
diff --git a/runtime/vm/code_patcher_arm_test.cc b/runtime/vm/code_patcher_arm_test.cc
index 0f1e513..6fbd1a3 100644
--- a/runtime/vm/code_patcher_arm_test.cc
+++ b/runtime/vm/code_patcher_arm_test.cc
@@ -58,10 +58,10 @@
const String& target_name = String::Handle(String::New("targetFunction"));
const ICData& ic_data =
ICData::ZoneHandle(ICData::New(function, target_name, 15, 1));
- const Array& args_descriptor =
+ const Array& arg_descriptor =
Array::ZoneHandle(ArgumentsDescriptor::New(1, Array::Handle()));
- __ LoadObject(R4, args_descriptor);
+ __ LoadObject(R4, arg_descriptor);
__ LoadObject(R5, ic_data);
ExternalLabel target_label(
"InlineCache", StubCode::OneArgCheckInlineCacheEntryPoint());
diff --git a/runtime/vm/code_patcher_ia32_test.cc b/runtime/vm/code_patcher_ia32_test.cc
index 87cb8f6..2bb6601 100644
--- a/runtime/vm/code_patcher_ia32_test.cc
+++ b/runtime/vm/code_patcher_ia32_test.cc
@@ -58,11 +58,11 @@
const String& target_name = String::Handle(String::New("targetFunction"));
const ICData& ic_data =
ICData::ZoneHandle(ICData::New(function, target_name, 15, 1));
- const Array& args_descriptor =
+ const Array& arg_descriptor =
Array::ZoneHandle(ArgumentsDescriptor::New(1, Array::Handle()));
__ LoadObject(ECX, ic_data);
- __ LoadObject(EDX, args_descriptor);
+ __ LoadObject(EDX, arg_descriptor);
ExternalLabel target_label(
"InlineCache", StubCode::OneArgCheckInlineCacheEntryPoint());
__ call(&target_label);
diff --git a/runtime/vm/code_patcher_mips_test.cc b/runtime/vm/code_patcher_mips_test.cc
index 1194289..9d0a681 100644
--- a/runtime/vm/code_patcher_mips_test.cc
+++ b/runtime/vm/code_patcher_mips_test.cc
@@ -58,10 +58,10 @@
const String& target_name = String::Handle(String::New("targetFunction"));
const ICData& ic_data =
ICData::ZoneHandle(ICData::New(function, target_name, 15, 1));
- const Array& args_descriptor =
+ const Array& arg_descriptor =
Array::ZoneHandle(ArgumentsDescriptor::New(1, Array::Handle()));
- __ LoadObject(S4, args_descriptor);
+ __ LoadObject(S4, arg_descriptor);
__ LoadObject(S5, ic_data);
ExternalLabel target_label(
"InlineCache", StubCode::OneArgCheckInlineCacheEntryPoint());
diff --git a/runtime/vm/code_patcher_x64_test.cc b/runtime/vm/code_patcher_x64_test.cc
index 1da28a5..61807b3 100644
--- a/runtime/vm/code_patcher_x64_test.cc
+++ b/runtime/vm/code_patcher_x64_test.cc
@@ -58,11 +58,11 @@
const String& target_name = String::Handle(String::New("targetFunction"));
const ICData& ic_data =
ICData::ZoneHandle(ICData::New(function, target_name, 15, 1));
- const Array& args_descriptor =
+ const Array& arg_descriptor =
Array::ZoneHandle(ArgumentsDescriptor::New(1, Array::Handle()));
__ LoadObject(RBX, ic_data);
- __ LoadObject(R10, args_descriptor);
+ __ LoadObject(R10, arg_descriptor);
ExternalLabel target_label(
"InlineCache", StubCode::OneArgCheckInlineCacheEntryPoint());
__ call(&target_label);
diff --git a/runtime/vm/compiler.cc b/runtime/vm/compiler.cc
index 1b1ef1d..0fba07c 100644
--- a/runtime/vm/compiler.cc
+++ b/runtime/vm/compiler.cc
@@ -268,11 +268,14 @@
ASSERT(function.HasCode());
// Extract type feedback before the graph is built, as the graph
// builder uses it to attach it to nodes.
- ASSERT(function.deoptimization_counter() <
- FLAG_deoptimization_counter_threshold);
- const Code& unoptimized_code =
- Code::Handle(function.unoptimized_code());
- ic_data_array = unoptimized_code.ExtractTypeFeedbackArray();
+ // Do not use type feedback to optimize a function that was
+ // deoptimized too often.
+ if (function.deoptimization_counter() <
+ FLAG_deoptimization_counter_threshold) {
+ const Code& unoptimized_code =
+ Code::Handle(function.unoptimized_code());
+ ic_data_array = unoptimized_code.ExtractTypeFeedbackArray();
+ }
}
// Build the flow graph.
diff --git a/runtime/vm/debugger.cc b/runtime/vm/debugger.cc
index f8d48be..8b82f4c 100644
--- a/runtime/vm/debugger.cc
+++ b/runtime/vm/debugger.cc
@@ -1568,9 +1568,9 @@
const Code& code =
Code::Handle(Function::Handle(bpt->function_).unoptimized_code());
CodePatcher::GetInstanceCallAt(bpt->pc_, code, &ic_data, &descriptor);
- ArgumentsDescriptor args_descriptor(descriptor);
+ ArgumentsDescriptor arg_descriptor(descriptor);
ActivationFrame* top_frame = stack_trace->ActivationFrameAt(0);
- intptr_t num_args = args_descriptor.Count();
+ intptr_t num_args = arg_descriptor.Count();
Instance& receiver =
Instance::Handle(top_frame->GetInstanceCallReceiver(num_args));
Code& target_code =
diff --git a/runtime/vm/flow_graph_allocator.cc b/runtime/vm/flow_graph_allocator.cc
index c63b362..d878f8d 100644
--- a/runtime/vm/flow_graph_allocator.cc
+++ b/runtime/vm/flow_graph_allocator.cc
@@ -60,12 +60,6 @@
}
-static intptr_t NextInstructionPos(intptr_t pos) {
- ASSERT(IsInstructionStartPosition(pos));
- return pos + 2;
-}
-
-
FlowGraphAllocator::FlowGraphAllocator(const FlowGraph& flow_graph)
: flow_graph_(flow_graph),
reaching_defs_(flow_graph),
@@ -518,16 +512,6 @@
range->DefineAt(catch_entry->start_pos()); // Defined at block entry.
ProcessInitialDefinition(defn, range, catch_entry);
}
- // Block the two registers used by CatchEntryInstr from the block start to
- // until the end of the instruction so that they are preserved.
- ASSERT(catch_entry->next()->IsCatchEntry());
- intptr_t start = catch_entry->start_pos();
- BlockLocation(Location::RegisterLocation(kExceptionObjectReg),
- start,
- ToInstructionEnd(NextInstructionPos(start)));
- BlockLocation(Location::RegisterLocation(kStackTraceObjectReg),
- start,
- ToInstructionEnd(NextInstructionPos(start)));
}
}
diff --git a/runtime/vm/flow_graph_compiler.cc b/runtime/vm/flow_graph_compiler.cc
index 295073b..07cc65a 100644
--- a/runtime/vm/flow_graph_compiler.cc
+++ b/runtime/vm/flow_graph_compiler.cc
@@ -30,7 +30,6 @@
DECLARE_FLAG(bool, report_usage_count);
DECLARE_FLAG(int, optimization_counter_threshold);
DECLARE_FLAG(bool, use_cha);
-DECLARE_FLAG(bool, use_osr);
// Assign locations to incoming arguments, i.e., values pushed above spill slots
@@ -165,11 +164,6 @@
}
-bool FlowGraphCompiler::CanOSRFunction() const {
- return FLAG_use_osr & CanOptimizeFunction() && !is_optimizing();
-}
-
-
static bool IsEmptyBlock(BlockEntryInstr* block) {
return !block->HasParallelMove() &&
block->next()->IsGoto() &&
diff --git a/runtime/vm/flow_graph_compiler.h b/runtime/vm/flow_graph_compiler.h
index 0af785d..6dbcaa4 100644
--- a/runtime/vm/flow_graph_compiler.h
+++ b/runtime/vm/flow_graph_compiler.h
@@ -258,7 +258,6 @@
}
static bool CanOptimize();
bool CanOptimizeFunction() const;
- bool CanOSRFunction() const;
bool is_optimizing() const { return is_optimizing_; }
const GrowableArray<BlockInfo*>& block_info() const { return block_info_; }
diff --git a/runtime/vm/intermediate_language_arm.cc b/runtime/vm/intermediate_language_arm.cc
index ba68855..eacd243 100644
--- a/runtime/vm/intermediate_language_arm.cc
+++ b/runtime/vm/intermediate_language_arm.cc
@@ -1714,11 +1714,6 @@
}
-// When the parser is building an implicit static getter for optimization,
-// it can generate a function body where deoptimization ids do not line up
-// with the unoptimized code.
-//
-// This is safe only so long as LoadStaticFieldInstr cannot deoptimize.
void LoadStaticFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
Register field = locs()->in(0).reg();
Register result = locs()->out().reg();
diff --git a/runtime/vm/intermediate_language_ia32.cc b/runtime/vm/intermediate_language_ia32.cc
index 03d011b..444cd5c 100644
--- a/runtime/vm/intermediate_language_ia32.cc
+++ b/runtime/vm/intermediate_language_ia32.cc
@@ -1772,11 +1772,6 @@
}
-// When the parser is building an implicit static getter for optimization,
-// it can generate a function body where deoptimization ids do not line up
-// with the unoptimized code.
-//
-// This is safe only so long as LoadStaticFieldInstr cannot deoptimize.
void LoadStaticFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
Register field = locs()->in(0).reg();
Register result = locs()->out().reg();
@@ -2152,7 +2147,7 @@
__ cmpl(ESP,
Address::Absolute(Isolate::Current()->stack_limit_address()));
__ j(BELOW_EQUAL, slow_path->entry_label());
- if (compiler->CanOSRFunction() && in_loop()) {
+ if (FLAG_use_osr && !compiler->is_optimizing() && in_loop()) {
// In unoptimized code check the usage counter to trigger OSR at loop
// stack checks.
__ LoadObject(EDI, compiler->parsed_function().function());
diff --git a/runtime/vm/intermediate_language_mips.cc b/runtime/vm/intermediate_language_mips.cc
index 8f4db82..813378d 100644
--- a/runtime/vm/intermediate_language_mips.cc
+++ b/runtime/vm/intermediate_language_mips.cc
@@ -1773,11 +1773,6 @@
}
-// When the parser is building an implicit static getter for optimization,
-// it can generate a function body where deoptimization ids do not line up
-// with the unoptimized code.
-//
-// This is safe only so long as LoadStaticFieldInstr cannot deoptimize.
void LoadStaticFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
__ TraceSimMsg("LoadStaticFieldInstr");
Register field = locs()->in(0).reg();
@@ -2416,7 +2411,7 @@
ASSERT(kSmiTagSize == 1);
__ sra(TMP, left, 31);
ASSERT(shift_count > 1); // 1, -1 case handled above.
- __ srl(TMP, TMP, 32 - shift_count);
+ __ sll(TMP, TMP, 32 - shift_count);
__ addu(left, left, TMP);
ASSERT(shift_count > 0);
__ sra(result, left, shift_count);
diff --git a/runtime/vm/intermediate_language_x64.cc b/runtime/vm/intermediate_language_x64.cc
index ce0e778..a55f175 100644
--- a/runtime/vm/intermediate_language_x64.cc
+++ b/runtime/vm/intermediate_language_x64.cc
@@ -1754,11 +1754,6 @@
}
-// When the parser is building an implicit static getter for optimization,
-// it can generate a function body where deoptimization ids do not line up
-// with the unoptimized code.
-//
-// This is safe only so long as LoadStaticFieldInstr cannot deoptimize.
void LoadStaticFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
Register field = locs()->in(0).reg();
Register result = locs()->out().reg();
@@ -2137,7 +2132,7 @@
__ movq(temp, Immediate(Isolate::Current()->stack_limit_address()));
__ cmpq(RSP, Address(temp, 0));
__ j(BELOW_EQUAL, slow_path->entry_label());
- if (compiler->CanOSRFunction() && in_loop()) {
+ if (FLAG_use_osr && !compiler->is_optimizing() && in_loop()) {
// In unoptimized code check the usage counter to trigger OSR at loop
// stack checks.
__ LoadObject(temp, compiler->parsed_function().function());
diff --git a/runtime/vm/parser.cc b/runtime/vm/parser.cc
index ac0a972..0aec272 100644
--- a/runtime/vm/parser.cc
+++ b/runtime/vm/parser.cc
@@ -920,21 +920,6 @@
const Field& field =
Field::ZoneHandle(field_class.LookupStaticField(field_name));
- if (!field.is_const() &&
- (field.value() != Object::transition_sentinel().raw()) &&
- (field.value() != Object::sentinel().raw())) {
- // The field has already been initialized at compile time (this can
- // happen, e.g., if we are recompiling for optimization). There is no
- // need to check for initialization and compile the potentially very
- // large initialization code. By skipping this code, the deoptimization
- // ids will not line up with the original code, but this is safe because
- // LoadStaticField does not deoptimize.
- LoadStaticFieldNode* load_node = new LoadStaticFieldNode(ident_pos, field);
- ReturnNode* return_node = new ReturnNode(ident_pos, load_node);
- current_block_->statements->Add(return_node);
- return CloseBlock();
- }
-
// Static const fields must have an initializer.
ExpectToken(Token::kASSIGN);
@@ -8287,13 +8272,13 @@
ASSERT(arg->IsLiteralNode());
arg_values.SetAt((i + kNumExtraArgs), arg->AsLiteralNode()->literal());
}
- const Array& args_descriptor =
+ const Array& arg_descriptor =
Array::Handle(ArgumentsDescriptor::New(num_arguments,
arguments->names()));
const Object& result =
Object::Handle(DartEntry::InvokeFunction(constructor,
arg_values,
- args_descriptor));
+ arg_descriptor));
if (result.IsError()) {
// An exception may not occur in every parse attempt, i.e., the
// generated AST is not deterministic. Therefore mark the function as
diff --git a/sdk/lib/_internal/compiler/implementation/js_backend/backend.dart b/sdk/lib/_internal/compiler/implementation/js_backend/backend.dart
index 8567adb..5afa2a0 100644
--- a/sdk/lib/_internal/compiler/implementation/js_backend/backend.dart
+++ b/sdk/lib/_internal/compiler/implementation/js_backend/backend.dart
@@ -98,6 +98,13 @@
ClassElement jsIndexingBehaviorInterface;
/**
+ * A collection of selectors of intercepted method calls. The
+ * emitter uses this set to generate the [:ObjectInterceptor:] class
+ * whose members just forward the call to the intercepted receiver.
+ */
+ final Set<Selector> usedInterceptors;
+
+ /**
* A collection of selectors that must have a one shot interceptor
* generated.
*/
@@ -158,6 +165,7 @@
JavaScriptBackend(Compiler compiler, bool generateSourceMap, bool disableEval)
: namer = determineNamer(compiler),
+ usedInterceptors = new Set<Selector>(),
oneShotInterceptors = new Map<String, Selector>(),
interceptedElements = new Map<SourceString, Set<Element>>(),
rti = new RuntimeTypes(compiler),
@@ -185,6 +193,10 @@
return false;
}
+ void addInterceptedSelector(Selector selector) {
+ usedInterceptors.add(selector);
+ }
+
String registerOneShotInterceptor(Selector selector) {
Set<ClassElement> classes = getInterceptedClassesOn(selector.name);
String name = namer.getOneShotInterceptorName(selector, classes);
diff --git a/sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart b/sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart
index 06e1f99b..7721152 100644
--- a/sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart
+++ b/sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart
@@ -75,7 +75,6 @@
final List<ClassElement> nativeClasses = <ClassElement>[];
final List<Selector> trivialNsmHandlers = <Selector>[];
final Map<String, String> mangledFieldNames = <String, String>{};
- final Set<String> interceptorInvocationNames = new Set<String>();
// TODO(ngeoffray): remove this field.
Set<ClassElement> instantiatedClasses;
@@ -959,7 +958,6 @@
count++;
parametersBuffer[0] = new jsAst.Parameter(receiverArgumentName);
argumentsBuffer[0] = js(receiverArgumentName);
- interceptorInvocationNames.add(invocationName);
}
int optionalParameterStart = positionalArgumentCount + extraArgumentCount;
@@ -1177,9 +1175,6 @@
jsAst.Expression code = backend.generatedCode[member];
if (code == null) return;
String name = namer.getName(member);
- if (backend.isInterceptedMethod(member)) {
- interceptorInvocationNames.add(name);
- }
builder.addProperty(name, code);
var metadata = buildMetadataFunction(member);
if (metadata != null) {
@@ -2982,21 +2977,18 @@
* method with an extra parameter.
*/
void emitInterceptedNames(CodeBuffer buffer) {
- // TODO(ahe): We should not generate the list of intercepted names at
- // compile time, it can be generated automatically at runtime given
- // subclasses of Interceptor (which can easily be identified).
if (!compiler.enabledInvokeOn) return;
String name = backend.namer.getName(backend.interceptedNames);
int index = 0;
- var invocationNames = interceptorInvocationNames.toList()..sort();
- List<jsAst.ArrayElement> elements = invocationNames.map(
- (String invocationName) {
- jsAst.Literal str = js.string(invocationName);
+ List<jsAst.ArrayElement> elements = backend.usedInterceptors.map(
+ (Selector selector) {
+ jsAst.Literal str = js.string(namer.invocationName(selector));
return new jsAst.ArrayElement(index++, str);
}).toList();
- jsAst.ArrayInitializer array =
- new jsAst.ArrayInitializer(invocationNames.length, elements);
+ jsAst.ArrayInitializer array = new jsAst.ArrayInitializer(
+ backend.usedInterceptors.length,
+ elements);
jsAst.Expression assignment = js('$isolateProperties.$name = #', array);
diff --git a/sdk/lib/_internal/compiler/implementation/ssa/builder.dart b/sdk/lib/_internal/compiler/implementation/ssa/builder.dart
index 13b2ebf..75d6443 100644
--- a/sdk/lib/_internal/compiler/implementation/ssa/builder.dart
+++ b/sdk/lib/_internal/compiler/implementation/ssa/builder.dart
@@ -1242,15 +1242,6 @@
}
}
- // Don't inline if the return type was inferred to be non-null empty. This
- // means that the function always throws an exception.
- TypeMask returnType =
- compiler.typesTask.getGuaranteedReturnTypeOfElement(element);
- if (returnType != null && returnType.isEmpty && !returnType.isNullable) {
- isReachable = false;
- return false;
- }
-
FunctionExpression functionExpression = function.parseNode(compiler);
TreeElements newElements =
compiler.enqueuer.resolution.getCachedElements(function);
diff --git a/sdk/lib/_internal/compiler/implementation/ssa/codegen.dart b/sdk/lib/_internal/compiler/implementation/ssa/codegen.dart
index dd45355..b4f0d92 100644
--- a/sdk/lib/_internal/compiler/implementation/ssa/codegen.dart
+++ b/sdk/lib/_internal/compiler/implementation/ssa/codegen.dart
@@ -1550,6 +1550,12 @@
return receiverType.refine(selector, compiler);
}
+ void registerInvoke(HInvokeDynamic node, Selector selector) {
+ if (node.isInterceptedCall) {
+ backend.addInterceptedSelector(selector);
+ }
+ }
+
void registerMethodInvoke(HInvokeDynamic node) {
Selector selector = getOptimizedSelectorFor(node, node.selector);
@@ -1573,6 +1579,7 @@
SourceString name = node.selector.name;
world.registerDynamicInvocation(name, selector);
}
+ registerInvoke(node, selector);
}
void registerSetter(HInvokeDynamic node) {
@@ -1581,6 +1588,7 @@
HType valueType = node.isInterceptedCall
? node.inputs[2].instructionType
: node.inputs[1].instructionType;
+ registerInvoke(node, selector);
}
void registerGetter(HInvokeDynamic node) {
@@ -1588,6 +1596,7 @@
world.registerDynamicGetter(selector.name, selector);
world.registerInstantiatedClass(
compiler.functionClass, work.resolutionTree);
+ registerInvoke(node, selector);
}
visitInvokeDynamicSetter(HInvokeDynamicSetter node) {
diff --git a/sdk/lib/_internal/compiler/implementation/ssa/types_propagation.dart b/sdk/lib/_internal/compiler/implementation/ssa/types_propagation.dart
index 146ffdb..9ff7a6c 100644
--- a/sdk/lib/_internal/compiler/implementation/ssa/types_propagation.dart
+++ b/sdk/lib/_internal/compiler/implementation/ssa/types_propagation.dart
@@ -331,6 +331,10 @@
instruction, input, compiler);
}
+ HType visitNot(HNot instruction) {
+ return HType.BOOLEAN;
+ }
+
HType visitPhi(HPhi phi) {
// Best case scenario for a phi is, when all inputs have the same type. If
// there is no desired outgoing type we therefore try to unify the input
@@ -451,9 +455,6 @@
// TODO(ngeoffray): Allow speculative optimizations on
// non-primitive types?
if (!desiredType.isPrimitive(compiler)) return newType;
- // It's not worth having a bailout method just because we want a
- // boolean. Comparing to true is enough.
- if (desiredType.isBooleanOrNull()) return newType;
desiredType = newType.intersection(desiredType, compiler);
if (desiredType != newType && !hasBeenSpeculativelyOptimized(instruction)) {
savedTypes[instruction] = oldType;
diff --git a/sdk/lib/_internal/compiler/implementation/types/concrete_types_inferrer.dart b/sdk/lib/_internal/compiler/implementation/types/concrete_types_inferrer.dart
index 24634c3..ee5ccd5 100644
--- a/sdk/lib/_internal/compiler/implementation/types/concrete_types_inferrer.dart
+++ b/sdk/lib/_internal/compiler/implementation/types/concrete_types_inferrer.dart
@@ -470,10 +470,6 @@
throw new UnsupportedError("");
}
- bool get isContainer {
- throw new UnsupportedError("");
- }
-
bool containsOnlyInt(Compiler compiler) {
throw new UnsupportedError("");
}
diff --git a/sdk/lib/_internal/compiler/implementation/types/container_tracer.dart b/sdk/lib/_internal/compiler/implementation/types/container_tracer.dart
index 14bd037..04c9923 100644
--- a/sdk/lib/_internal/compiler/implementation/types/container_tracer.dart
+++ b/sdk/lib/_internal/compiler/implementation/types/container_tracer.dart
@@ -95,8 +95,6 @@
var internal = inferrer.internal;
// Walk over all created [ContainerTypeMask].
internal.concreteTypes.values.forEach((ContainerTypeMask mask) {
- // The element type has already been set for const containers.
- if (mask.elementType != null) return;
mask.elementType = new TracerForConcreteContainer(
mask, this, compiler, inferrer).run();
});
diff --git a/sdk/lib/_internal/compiler/implementation/types/inferrer_visitor.dart b/sdk/lib/_internal/compiler/implementation/types/inferrer_visitor.dart
index 8d5894b..75e35e1 100644
--- a/sdk/lib/_internal/compiler/implementation/types/inferrer_visitor.dart
+++ b/sdk/lib/_internal/compiler/implementation/types/inferrer_visitor.dart
@@ -60,11 +60,11 @@
final Map<Element, TypeMask> fieldsInitializedInConstructor;
final bool inTryBlock;
bool isThisExposed;
- bool seenReturnOrThrow = false;
+ bool seenReturn = false;
bool seenBreakOrContinue = false;
bool get aborts {
- return seenReturnOrThrow || seenBreakOrContinue;
+ return seenReturn || seenBreakOrContinue;
}
LocalsHandler(this.inferrer, this.compiler)
@@ -183,7 +183,7 @@
fieldsInitializedInConstructor.remove(element);
});
isThisExposed = isThisExposed || other.isThisExposed;
- seenReturnOrThrow = seenReturnOrThrow && other.seenReturnOrThrow;
+ seenReturn = seenReturn && other.seenReturn;
seenBreakOrContinue = seenBreakOrContinue && other.seenBreakOrContinue;
return changed;
@@ -591,7 +591,7 @@
TypeMask visitThrow(Throw node) {
node.visitChildren(this);
- locals.seenReturnOrThrow = true;
+ locals.seenReturn = true;
return inferrer.dynamicType;
}
diff --git a/sdk/lib/_internal/compiler/implementation/types/simple_types_inferrer.dart b/sdk/lib/_internal/compiler/implementation/types/simple_types_inferrer.dart
index 1d191c4..634a542 100644
--- a/sdk/lib/_internal/compiler/implementation/types/simple_types_inferrer.dart
+++ b/sdk/lib/_internal/compiler/implementation/types/simple_types_inferrer.dart
@@ -246,7 +246,7 @@
* returns that type.
*
*/
- final Map<Node, CallSite> setterConstraints = new Map<Node, CallSite>();
+ final Map<Node, Selector> setterConstraints = new Map<Node, Selector>();
/**
* The work list of the inferrer.
@@ -861,7 +861,7 @@
Element caller,
Element callee,
ArgumentsTypes arguments,
- CallSite constraint,
+ Selector constraint,
SideEffects sideEffects,
bool inLoop) {
updateSideEffects(sideEffects, selector, callee);
@@ -892,10 +892,7 @@
if (selector.isSetter() && callee.isField()) {
recordNonFinalFieldElementType(
- node,
- callee,
- arguments.positional[0],
- constraint);
+ node, callee, arguments.positional[0], constraint);
return;
} else if (selector.isGetter()) {
assert(arguments == null);
@@ -1030,7 +1027,7 @@
TypeMask receiverType,
Element caller,
ArgumentsTypes arguments,
- CallSite constraint,
+ Selector constraint,
SideEffects sideEffects,
bool inLoop) {
TypeMask result;
@@ -1079,7 +1076,7 @@
void recordNonFinalFieldElementType(Node node,
Element element,
TypeMask argumentType,
- CallSite constraint) {
+ Selector constraint) {
Map<Node, TypeMask> map =
typeOfFields.putIfAbsent(element, () => new Map<Node, TypeMask>());
map[node] = argumentType;
@@ -1096,10 +1093,10 @@
}
TypeMask computeFieldTypeWithConstraints(Element element, Map types) {
- List<CallSite> constraints = <CallSite>[];
+ Set<Selector> constraints = new Set<Selector>();
TypeMask fieldType;
types.forEach((Node node, TypeMask mask) {
- CallSite constraint = setterConstraints[node];
+ Selector constraint = setterConstraints[node];
if (constraint != null) {
// If this update has a constraint, we collect it and don't
// use its type.
@@ -1117,23 +1114,18 @@
TypeMask existing = typeOf[element];
typeOf[element] = fieldType;
- for (CallSite constraint in constraints) {
- Selector selector = constraint.selector;
- TypeMask type;
- if (selector.isOperator()) {
+ for (Selector constraint in constraints) {
+ if (constraint.isOperator()) {
// If the constraint is on an operator, we type the receiver
// to be the field.
if (fieldType != null) {
- selector = new TypedSelector(fieldType, selector);
+ constraint = new TypedSelector(fieldType, constraint);
}
- type = handleIntrisifiedSelector(selector, constraint.arguments);
- if (type == null) type = typeOfSelector(selector);
} else {
// Otherwise the constraint is on the form [: field = other.field :].
- assert(selector.isGetter());
- type = typeOfSelector(selector);
+ assert(constraint.isGetter());
}
- fieldType = computeLUB(fieldType, type, compiler);
+ fieldType = computeLUB(fieldType, typeOfSelector(constraint), compiler);
}
if (existing == null) {
typeOf.remove(element);
@@ -1175,7 +1167,7 @@
Element constructor,
Element field,
TypeMask type,
- CallSite constraint) {
+ Selector constraint) {
if (constraint != null) {
setterConstraints[node] = constraint;
}
@@ -1219,14 +1211,6 @@
}
}
-class CallSite {
- final Selector selector;
- final ArgumentsTypes arguments;
- CallSite(this.selector, this.arguments) {
- assert(selector != null);
- }
-}
-
/**
* Placeholder for inferred arguments types on sends.
*/
@@ -1378,11 +1362,8 @@
visit(node.body);
if (returnType == null) {
// No return in the body.
- returnType = locals.seenReturnOrThrow
- ? new TypeMask.nonNullEmpty() // Body always throws.
- : inferrer.nullType;
- } else if (!locals.seenReturnOrThrow &&
- !inferrer.isDynamicType(returnType)) {
+ returnType = inferrer.nullType;
+ } else if (!locals.seenReturn && !inferrer.isDynamicType(returnType)) {
// We haven't seen returns on all branches. So the method may
// also return null.
returnType = returnType.nullable();
@@ -1409,7 +1390,7 @@
});
// TODO(ngeoffray): Re-analyze method if [changed]?
}
- compiler.world.registerSideEffects(analyzedElement, sideEffects);
+ compiler.world.registerSideEffects(analyzedElement, sideEffects);
assert(breaksFor.isEmpty);
assert(continuesFor.isEmpty);
return returnType;
@@ -1446,25 +1427,11 @@
}
TypeMask visitLiteralList(LiteralList node) {
- if (node.isConst()) {
- // We only set the type once. We don't need to re-visit the children
- // when re-analyzing the node.
- return inferrer.concreteTypes.putIfAbsent(node, () {
- ContainerTypeMask container = new ContainerTypeMask(
- inferrer.constListType, node, outermostElement);
- TypeMask elementType = new TypeMask.nonNullEmpty();
- for (Node element in node.elements.nodes) {
- elementType = computeLUB(elementType, visit(element), compiler);
- }
- container.elementType = elementType;
- return container;
- });
- } else {
- node.visitChildren(this);
- return inferrer.concreteTypes.putIfAbsent(
- node, () => new ContainerTypeMask(
- inferrer.growableListType, node, outermostElement));
- }
+ node.visitChildren(this);
+ if (node.isConst()) return inferrer.constListType;
+ return inferrer.concreteTypes.putIfAbsent(
+ node, () => new ContainerTypeMask(
+ inferrer.growableListType, node, outermostElement));
}
bool isThisOrSuper(Node node) => node.isThis() || node.isSuper();
@@ -1588,14 +1555,14 @@
node.arguments.head);
} else {
// [: foo++ :] or [: foo += 1 :].
- ArgumentsTypes operatorArguments = new ArgumentsTypes([rhsType], null);
- CallSite constraint;
+ Selector constraint;
if (!Elements.isLocal(element)) {
// Record a constraint of the form [: field++ :], or [: field += 42 :].
- constraint = new CallSite(operatorSelector, operatorArguments);
+ constraint = operatorSelector;
}
TypeMask getterType;
TypeMask newType;
+ ArgumentsTypes operatorArguments = new ArgumentsTypes([rhsType], null);
if (Elements.isStaticOrTopLevelField(element)) {
Element getterElement = elements[node.selector];
getterType =
@@ -1642,7 +1609,7 @@
TypeMask receiverType,
TypeMask rhsType,
Node rhs) {
- CallSite constraint;
+ Selector constraint;
if (node.asSend() != null && !Elements.isLocal(element)) {
// Recognize a constraint of the form [: field = other.field :].
// Note that we check if the right hand side is a local to
@@ -1655,7 +1622,7 @@
&& !Elements.isLocal(elements[rhs])
&& send.selector.asIdentifier().source
== node.asSend().selector.asIdentifier().source) {
- constraint = new CallSite(elements.getSelector(rhs), null);
+ constraint = elements.getSelector(rhs);
}
}
ArgumentsTypes arguments = new ArgumentsTypes([rhsType], null);
@@ -1854,7 +1821,7 @@
Selector selector,
TypeMask receiver,
ArgumentsTypes arguments,
- [CallSite constraint]) {
+ [Selector constraint]) {
if (selector.mask != receiver) {
selector = inferrer.isDynamicType(receiver)
? selector.asUntyped
@@ -1930,7 +1897,7 @@
? inferrer.nullType
: expression.accept(this));
}
- locals.seenReturnOrThrow = true;
+ locals.seenReturn = true;
return inferrer.dynamicType;
}
diff --git a/sdk/lib/_internal/lib/js_helper.dart b/sdk/lib/_internal/lib/js_helper.dart
index 29715d1a..cd4e627 100644
--- a/sdk/lib/_internal/lib/js_helper.dart
+++ b/sdk/lib/_internal/lib/js_helper.dart
@@ -566,7 +566,7 @@
return JS('var', '#.apply(#, #)', jsFunction, function, arguments);
}
- static getConstructorOrInterceptor(String className) {
+ static getConstructor(String className) {
// TODO(ahe): Generalize this and improve test coverage of
// reflecting on intercepted classes.
if (JS('bool', '# == "String"', className)) return const JSString();
diff --git a/sdk/lib/_internal/lib/js_mirrors.dart b/sdk/lib/_internal/lib/js_mirrors.dart
index 3e99fe9..59b8355 100644
--- a/sdk/lib/_internal/lib/js_mirrors.dart
+++ b/sdk/lib/_internal/lib/js_mirrors.dart
@@ -242,16 +242,12 @@
ClassMirror reflectClassByName(Symbol symbol) {
disableTreeShaking();
String className = n(symbol);
- var constructorOrInterceptor =
- Primitives.getConstructorOrInterceptor(className);
- if (constructorOrInterceptor == null) {
+ var constructor = Primitives.getConstructor(className);
+ if (constructor == null) {
// Probably an intercepted class.
// TODO(ahe): How to handle intercepted classes?
throw new UnsupportedError('Cannot find class for: $className');
}
- var constructor = (constructorOrInterceptor is Interceptor)
- ? JS('', '#.constructor', constructorOrInterceptor)
- : constructorOrInterceptor;
var descriptor = JS('', '#["@"]', constructor);
var fields;
var fieldsMetadata;
@@ -270,11 +266,10 @@
fields = '';
}
}
- var mirror = classMirrors[constructorOrInterceptor];
+ var mirror = classMirrors[constructor];
if (mirror == null) {
- mirror = new JsClassMirror(
- symbol, constructorOrInterceptor, fields, fieldsMetadata);
- classMirrors[constructorOrInterceptor] = mirror;
+ mirror = new JsClassMirror(symbol, constructor, fields, fieldsMetadata);
+ classMirrors[constructor] = mirror;
}
return mirror;
}
@@ -357,7 +352,7 @@
class JsClassMirror extends JsTypeMirror with JsObjectMirror
implements ClassMirror {
- final _jsConstructorOrInterceptor;
+ final _jsConstructor;
final String _fields;
final List _fieldsMetadata;
List _metadata;
@@ -368,7 +363,7 @@
JsLibraryMirror _owner;
JsClassMirror(Symbol simpleName,
- this._jsConstructorOrInterceptor,
+ this._jsConstructor,
this._fields,
this._fieldsMetadata)
: super(simpleName);
@@ -377,14 +372,6 @@
Symbol get qualifiedName => computeQualifiedName(owner, simpleName);
- get _jsConstructor {
- if (_jsConstructorOrInterceptor is Interceptor) {
- return JS('', '#.constructor', _jsConstructorOrInterceptor);
- } else {
- return _jsConstructorOrInterceptor;
- }
- }
-
List<JsMethodMirror> get _methods {
if (_cachedMethods != null) return _cachedMethods;
var prototype = JS('', '#.prototype', _jsConstructor);
@@ -523,7 +510,7 @@
DeclarationMirror get owner {
if (_owner == null) {
- if (_jsConstructorOrInterceptor is Interceptor) {
+ if (_jsConstructor is Interceptor) {
_owner = reflectType(Object).owner;
} else {
for (var list in JsMirrorSystem.librariesByName.values) {
@@ -598,7 +585,6 @@
String get _prettyName => 'VariableMirror';
- // TODO(ahe): Improve this information and test it.
TypeMirror get type => JsMirrorSystem._dynamicType;
DeclarationMirror get owner => _owner;
@@ -721,9 +707,6 @@
Symbol get qualifiedName => computeQualifiedName(owner, simpleName);
- // TODO(ahe): Improve this information and test it.
- TypeMirror get returnType => JsMirrorSystem._dynamicType;
-
List<InstanceMirror> get metadata {
if (_metadata == null) {
_metadata = extractMetadata(_jsFunction);
diff --git a/sdk/lib/_internal/lib/js_rti.dart b/sdk/lib/_internal/lib/js_rti.dart
index f47c841..0cd37e1 100644
--- a/sdk/lib/_internal/lib/js_rti.dart
+++ b/sdk/lib/_internal/lib/js_rti.dart
@@ -2,54 +2,30 @@
// 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.
-/**
- * This part contains helpers for supporting runtime type information.
- *
- * The helper use a mixture of Dart and JavaScript objects. To indicate which is
- * used where we adopt the scheme of using explicit type annotation for Dart
- * objects and 'var' or omitted return type for JavaScript objects.
- *
- * Since bool, int, and String values are represented by the same JavaScript
- * primitives, type annotations are used for these types in all cases.
- *
- * Several methods use a common JavaScript encoding of runtime type information.
- * This encoding is referred to as the type representation which is one of
- * these:
- * 1) a JavaScript constructor for a class C: the represented type is the raw
- * type C.
- * 2) a Dart object: this is the interceptor instance for a native type.
- * 3) a JavaScript object: this represents a class for which there is no
- * JavaScript constructor, because it is only used in type arguments or it
- * is native. The represented type is the raw type of this class.
- * 4) a JavaScript array: the first entry is of type 1, 2 or 3 and contains the
- * subtyping flags and the substitution of the type and the rest of the
- * array are the type arguments.
- * 5) `null`: the dynamic type.
- *
- *
- * To check subtype relations between generic classes we use a JavaScript
- * expression that describes the necessary substitution for type arguments.
- * Such a substitution expresssion can be:
- * 1) `null`, if no substituted check is necessary, because the
- * type variables are the same or there are no type variables in the class
- * that is checked for.
- * 2) A list expression describing the type arguments to be used in the
- * subtype check, if the type arguments to be used in the check do not
- * depend on the type arguments of the object.
- * 3) A function mapping the type variables of the object to be checked to
- * a list expression.
- */
-
part of _js_helper;
-Type createRuntimeType(String name) => new TypeImpl(name);
+setRuntimeTypeInfo(target, typeInfo) {
+ assert(typeInfo == null || typeInfo is JSArray);
+ // We have to check for null because factories may return null.
+ if (target != null) JS('var', r'#.$builtinTypeInfo = #', target, typeInfo);
+}
+
+getRuntimeTypeInfo(target) {
+ if (target == null) return null;
+ return JS('var', r'#.$builtinTypeInfo', target);
+}
+
+getRuntimeTypeArgument(target, substitution, index) {
+ var arguments = substitute(substitution, getRuntimeTypeInfo(target));
+ return (arguments == null) ? null : getField(arguments, index);
+}
class TypeImpl implements Type {
final String _typeName;
TypeImpl(this._typeName);
- String toString() => _typeName;
+ toString() => _typeName;
// TODO(ahe): This is a poor hashCode as it collides with its name.
int get hashCode => _typeName.hashCode;
@@ -59,73 +35,21 @@
}
}
-/**
- * Sets the runtime type information on [target]. [typeInfo] is a type
- * representation of type 4 or 5, that is, either a JavaScript array or
- * [:null:].
- */
-void setRuntimeTypeInfo(Object target, var typeInfo) {
- assert(isNull(typeInfo) || isJsArray(typeInfo));
- // We have to check for null because factories may return null.
- if (target != null) JS('var', r'#.$builtinTypeInfo = #', target, typeInfo);
-}
-
-/**
- * Returns the runtime type information of [target]. The returned value is a
- * list of type representations for the type arguments.
- */
-getRuntimeTypeInfo(Object target) {
- if (target == null) return null;
- return JS('var', r'#.$builtinTypeInfo', target);
-}
-
-/**
- * Returns the [index]th type argument of [target] converted using
- * [substitution].
- *
- * See the comment in the beginning of this file for a description of the
- * possible values for [substitution].
- */
-getRuntimeTypeArgument(Object target, var substitution, int index) {
- assert(isNull(substitution) ||
- isJsArray(substitution) ||
- isJsFunction(substitution));
- var arguments = substitute(substitution, getRuntimeTypeInfo(target));
- return isNull(arguments) ? null : getIndex(arguments, index);
-}
-
-/**
- * Retrieves the class name from type information stored on the constructor
- * of [object].
- */
String getClassName(var object) {
return JS('String', r'#.constructor.builtin$cls', getInterceptor(object));
}
-/**
- * Creates the string representation for the type representation [runtimeType]
- * of type 4, the JavaScript array, where the first element represents the class
- * and the remaining elements represent the type arguments.
- */
-String getRuntimeTypeAsString(var runtimeType) {
- assert(isJsArray(runtimeType));
- String className = getConstructorName(getIndex(runtimeType, 0));
+String getRuntimeTypeAsString(List runtimeType) {
+ String className = getConstructorName(runtimeType[0]);
return '$className${joinArguments(runtimeType, 1)}';
}
-/**
- * Retrieves the class name from type information stored on the constructor
- * [type].
- */
-String getConstructorName(var type) => JS('String', r'#.builtin$cls', type);
+String getConstructorName(type) => JS('String', r'#.builtin$cls', type);
-/**
- * Returns a human-readable representation of the type representation [type].
- */
-String runtimeTypeToString(var type) {
- if (isNull(type)) {
+String runtimeTypeToString(type) {
+ if (type == null) {
return 'dynamic';
- } else if (isJsArray(type)) {
+ } else if (type is JSArray) {
// A list representing a type with arguments.
return getRuntimeTypeAsString(type);
} else {
@@ -134,24 +58,18 @@
}
}
-/**
- * Creates a comma-separated string of human-readable representations of the
- * type representations in the JavaScript array [types] starting at index
- * [startIndex].
- */
String joinArguments(var types, int startIndex) {
- if (isNull(types)) return '';
- assert(isJsArray(types));
+ if (types == null) return '';
bool firstArgument = true;
bool allDynamic = true;
StringBuffer buffer = new StringBuffer();
- for (int index = startIndex; index < getLength(types); index++) {
+ for (int index = startIndex; index < types.length; index++) {
if (firstArgument) {
firstArgument = false;
} else {
buffer.write(', ');
}
- var argument = getIndex(types, index);
+ var argument = types[index];
if (argument != null) {
allDynamic = false;
}
@@ -160,11 +78,8 @@
return allDynamic ? '' : '<$buffer>';
}
-/**
- * Returns a human-readable representation of the type of [object].
- */
String getRuntimeTypeString(var object) {
- String className = isJsArray(object) ? 'List' : getClassName(object);
+ String className = object is JSArray ? 'List' : getClassName(object);
var typeInfo = JS('var', r'#.$builtinTypeInfo', object);
return "$className${joinArguments(typeInfo, 0)}";
}
@@ -174,18 +89,16 @@
return new TypeImpl(type);
}
-/**
- * Applies the [substitution] on the [arguments].
- *
- * See the comment in the beginning of this file for a description of the
- * possible values for [substitution].
- */
+bool isJsFunction(var o) => JS('bool', r'typeof # == "function"', o);
+
+Object invoke(function, arguments) {
+ return JS('var', r'#.apply(null, #)', function, arguments);
+}
+
+Object call(target, name) => JS('var', r'#[#]()', target, name);
+
substitute(var substitution, var arguments) {
- assert(isNull(substitution) ||
- isJsArray(substitution) ||
- isJsFunction(substitution));
- assert(isNull(arguments) || isJsArray(arguments));
- if (isJsArray(substitution)) {
+ if (substitution is JSArray) {
arguments = substitution;
} else if (isJsFunction(substitution)) {
arguments = invoke(substitution, arguments);
@@ -213,9 +126,9 @@
// `null` or a primitive.
// TODO(9586): Move type info for static functions onto an interceptor.
var interceptor = getInterceptor(object);
- var isSubclass = getField(interceptor, isField);
+ bool isSubclass = getField(interceptor, isField);
// When we read the field and it is not there, [isSubclass] will be [:null:].
- if (isNull(isSubclass)) return false;
+ if (isSubclass == null || !isSubclass) return false;
// Should the asField function be passed the receiver?
var substitution = getField(interceptor, asField);
return checkArguments(substitution, arguments, checks);
@@ -252,60 +165,49 @@
* list [checks] (at the respective positions), possibly applying [substitution]
* to the arguments before the check.
*
- * See the comment in the beginning of this file for a description of the
- * possible values for [substitution].
+ * See [:RuntimeTypes.getSubtypeSubstitution:] for a description of the possible
+ * values for [substitution].
*/
bool checkArguments(var substitution, var arguments, var checks) {
return areSubtypes(substitute(substitution, arguments), checks);
}
-/**
- * Checks whether the types of [s] are all subtypes of the types of [t].
- *
- * [s] and [t] are either [:null:] or JavaScript arrays of type representations,
- * A [:null:] argument is interpreted as the arguments of a raw type, that is a
- * list of [:dynamic:]. If [s] and [t] are JavaScript arrays they must be of the
- * same length.
- *
- * See the comment in the beginning of this file for a description of type
- * representations.
- */
-bool areSubtypes(var s, var t) {
+bool areSubtypes(List s, List t) {
// [:null:] means a raw type.
- if (isNull(s) || isNull(t)) return true;
+ if (s == null || t == null) return true;
- assert(isJsArray(s));
- assert(isJsArray(t));
- assert(getLength(s) == getLength(t));
+ assert(s is JSArray);
+ assert(t is JSArray);
+ assert(s.length == t.length);
- int len = getLength(s);
+ int len = s.length;
for (int i = 0; i < len; i++) {
- if (!isSubtype(getIndex(s, i), getIndex(t, i))) {
+ if (!isSubtype(s[i], t[i])) {
return false;
}
}
return true;
}
-/**
- * Returns [:true:] if the runtime type representation [type] is a supertype of
- * [:Null:].
- */
-bool isSupertypeOfNull(var type) {
+getArguments(var type) {
+ return type is JSArray ? JS('var', r'#.slice(1)', type) : null;
+}
+
+getField(var object, var name) => JS('var', r'#[#]', object, name);
+
+bool isSubtypeOfNull(type) {
// `null` means `dynamic`.
- return isNull(type) || getConstructorName(type) == JS_OBJECT_CLASS_NAME();
+ return type == null || getConstructorName(type) == JS_OBJECT_CLASS_NAME();
}
/**
* Tests whether the Dart object [o] is a subtype of the runtime type
- * representation [t].
- *
- * See the comment in the beginning of this file for a description of type
- * representations.
+ * representation [t], which is a type representation as described in the
+ * comment on [isSubtype].
*/
bool checkSubtypeOfRuntimeType(Object o, var t) {
- if (isNull(o)) return isSupertypeOfNull(t);
- if (isNull(t)) return true;
+ if (JS('bool', '# == null', o)) return isSubtypeOfNull(t);
+ if (JS('bool', '# == null', t)) return true;
// Get the runtime type information from the object here, because we may
// overwrite o with the interceptor below.
var rti = getRuntimeTypeInfo(o);
@@ -314,7 +216,7 @@
// the subtype flags and the substitution on the prototype, so they are
// properties of the object in JS.
var type;
- if (isNotNull(rti)) {
+ if (JS('bool', '# != null', rti)) {
// If the type has type variables (that is, [:rti != null:]), make a copy of
// the type arguments and insert [o] in the first position to create a
// compound type representation.
@@ -343,39 +245,40 @@
}
/**
- * Extracts the type arguments from a type representation. The result is a
- * JavaScript array or [:null:].
- */
-getArguments(var type) {
- return isJsArray(type) ? JS('var', r'#.slice(1)', type) : null;
-}
-
-/**
- * Checks whether the type represented by the type representation [s] is a
- * subtype of the type represented by the type representation [t].
+ * Check whether the type represented by [s] is a subtype of the type
+ * represented by [t].
*
- * See the comment in the beginning of this file for a description of type
- * representations.
+ * Type representations can be:
+ * 1) a JavaScript constructor for a class C: the represented type is the raw
+ * type C.
+ * 2) a Dart object: this is the interceptor instance for a native type.
+ * 3) a JavaScript object: this represents a class for which there is no
+ * JavaScript constructor, because it is only used in type arguments or it
+ * is native. The represented type is the raw type of this class.
+ * 4) a JavaScript array: the first entry is of type 1, 2 or 3 and contains the
+ * subtyping flags and the substitution of the type and the rest of the
+ * array are the type arguments.
+ * 5) [:null:]: the dynamic type.
*/
bool isSubtype(var s, var t) {
// If either type is dynamic, [s] is a subtype of [t].
- if (isNull(s) || isNull(t)) return true;
+ if (JS('bool', '# == null', s) || JS('bool', '# == null', t)) return true;
// Subtyping is reflexive.
- if (isIdentical(s, t)) return true;
+ if (JS('bool', '# === #', s, t)) return true;
// Get the object describing the class and check for the subtyping flag
// constructed from the type of [t].
- var typeOfS = isJsArray(s) ? getIndex(s, 0) : s;
- var typeOfT = isJsArray(t) ? getIndex(t, 0) : t;
+ var typeOfS = s is JSArray ? s[0] : s;
+ var typeOfT = t is JSArray ? t[0] : t;
// TODO(johnniwinther): replace this with the real function subtype test.
if (JS('bool', '#.func', s) == true || JS('bool', '#.func', t) == true ) {
return true;
}
// Check for a subtyping flag.
var test = '${JS_OPERATOR_IS_PREFIX()}${runtimeTypeToString(typeOfT)}';
- if (isNull(getField(typeOfS, test))) return false;
+ if (getField(typeOfS, test) == null) return false;
// Get the necessary substitution of the type arguments, if there is one.
var substitution;
- if (isNotIdentical(typeOfT, typeOfS)) {
+ if (JS('bool', '# !== #', typeOfT, typeOfS)) {
var field = '${JS_OPERATOR_AS_PREFIX()}${runtimeTypeToString(typeOfT)}';
substitution = getField(typeOfS, field);
}
@@ -383,68 +286,12 @@
// arguments and no substitution, it is used as raw type. If [t] has no
// type arguments, it used as a raw type. In both cases, [s] is a subtype
// of [t].
- if ((!isJsArray(s) && isNull(substitution)) || !isJsArray(t)) {
+ if ((s is! JSArray && JS('bool', '# == null', substitution)) ||
+ t is! JSArray) {
return true;
}
// Recursively check the type arguments.
return checkArguments(substitution, getArguments(s), getArguments(t));
}
-/**
- * Calls the JavaScript [function] with the [arguments] with the global scope
- * as the [:this:] context.
- */
-invoke(var function, var arguments) {
- assert(isJsFunction(function));
- assert(isNull(arguments) || isJsArray(arguments));
- return JS('var', r'#.apply(null, #)', function, arguments);
-}
-
-/// Calls the property [name] on the JavaScript [object].
-call(var object, String name) => JS('var', r'#[#]()', object, name);
-
-/// Returns the property [name] of the JavaScript object [object].
-getField(var object, String name) => JS('var', r'#[#]', object, name);
-
-/// Returns the property [index] of the JavaScript array [array].
-getIndex(var array, int index) {
- assert(isJsArray(array));
- return JS('var', r'#[#]', array, index);
-}
-
-/// Returns the length of the JavaScript array [array].
-int getLength(var array) {
- assert(isJsArray(array));
- return JS('int', r'#.length', array);
-}
-
-/// Returns [:true:] if [o] is a JavaScript function.
-bool isJsFunction(var o) => JS('bool', r'typeof # == "function"', o);
-
-/**
- * Returns [:true:] if [o] is equal to [:null:], that is either [:null:] or
- * [:undefined:]. We use this helper to avoid generating code under the invalid
- * assumption that [o] is a Dart value.
- */
-bool isNull(var o) => JS('bool', '# == null', o);
-
-/**
- * Returns [:true:] if [o] is not equal to [:null:], that is neither [:null:]
- * nor [:undefined:]. We use this helper to avoid generating code under the
- * invalid assumption that [o] is a Dart value.
- */
-bool isNotNull(var o) => JS('bool', '# != null', o);
-
-/**
- * Returns [:true:] if the JavaScript values [s] and [t] are identical. We use
- * this helper to avoid generating code under the invalid assumption that [s]
- * and [t] are Dart values.
- */
-bool isIdentical(var s, var t) => JS('bool', '# === #', s, t);
-
-/**
- * Returns [:true:] if the JavaScript values [s] and [t] are not identical. We
- * use this helper to avoid generating code under the invalid assumption that
- * [s] and [t] are Dart values.
- */
-bool isNotIdentical(var s, var t) => JS('bool', '# !== #', s, t);
+createRuntimeType(String name) => new TypeImpl(name);
diff --git a/sdk/lib/_internal/lib/js_string.dart b/sdk/lib/_internal/lib/js_string.dart
index be707c0..2da5ed4 100644
--- a/sdk/lib/_internal/lib/js_string.dart
+++ b/sdk/lib/_internal/lib/js_string.dart
@@ -85,19 +85,15 @@
}
}
- bool startsWith(Pattern pattern, [int index = 0]) {
- if (index < 0 || index > this.length) {
- throw new RangeError.range(index, 0, this.length);
- }
+ bool startsWith(Pattern pattern) {
if (pattern is String) {
String other = pattern;
int otherLength = other.length;
- int endIndex = index + otherLength;
- if (endIndex > length) return false;
+ if (otherLength > length) return false;
return JS('bool', r'# == #', other,
- JS('String', r'#.substring(#, #)', this, index, endIndex));
+ JS('String', r'#.substring(0, #)', this, otherLength));
}
- return pattern.matchAsPrefix(this, index) != null;
+ return pattern.matchAsPrefix(this, 0) != null;
}
String substring(int startIndex, [int endIndex]) {
diff --git a/sdk/lib/core/string.dart b/sdk/lib/core/string.dart
index e2ffc23..0d2503a 100644
--- a/sdk/lib/core/string.dart
+++ b/sdk/lib/core/string.dart
@@ -106,18 +106,8 @@
/**
* Returns whether this string starts with a match of [pattern].
- *
- * If [index] is provided, instead check if the substring starting
- * at that index starts with a match of [pattern].
- *
- * It is an error if [index] is negative or greater than [length].
- *
- * A [RegExp] containing "^" will not match if the [index] is greater than
- * zero. The pattern works on the string as a whole, and does not extract
- * a substring starting at [index] first. That is.
- * "abc".startsWith(new RegExp("^.", 1)) == false
*/
- bool startsWith(Pattern pattern, [int index = 0]);
+ bool startsWith(Pattern pattern);
/**
* Returns the first position of a match of [pattern] in this string,
diff --git a/sdk/lib/core/uri.dart b/sdk/lib/core/uri.dart
index ab8d86a..c0a7fdf 100644
--- a/sdk/lib/core/uri.dart
+++ b/sdk/lib/core/uri.dart
@@ -108,7 +108,7 @@
fragment: _emptyIfNull(m[_COMPONENT_FRAGMENT]));
/**
- * Creates a new URI from its components.
+ * Create a new URI from its components.
*
* Each component is set through a named argument. Any number of
* components can be provided. The default value for the components
@@ -178,91 +178,6 @@
}
/**
- * Creates a new `http` URI from authority, path and query.
- *
- * Examples:
- *
- * // Create the URI http://example.org/path?q=abc.
- * new Uri.http("google.com", "/search", { "q" : "dart" });http://example.org/path?q=abc.
- * new Uri.http("user:pass@localhost:8080, ""); // http://user:pass@localhost:8080/
- * new Uri.http("example.org, "a b"); // http://example.org/a%20b
- * new Uri.http("example.org, "/a%2F"); // http://example.org/a%25%2F
- *
- * The `scheme` is always set to `http`.
- *
- * The `userInfo`, `host` and `port` components are set from the
- * [authority] argument.
- *
- * The `path` component is set from the [unencodedPath]
- * argument. The path passed must not be encoded as this constructor
- * encodes the path.
- *
- * The `query` component is set from the optional [queryParameters]
- * argument.
- */
- factory Uri.http(String authority,
- String unencodedPath,
- [Map<String, String> queryParameters]) {
- return _makeHttpUri("http", authority, unencodedPath, queryParameters);
- }
-
- /**
- * Creates a new `https` URI from authority, path and query.
- *
- * This constructor is the same as [Uri.http] except for the scheme
- * which is set to `https`.
- */
- factory Uri.https(String authority,
- String unencodedPath,
- [Map<String, String> queryParameters]) {
- return _makeHttpUri("https", authority, unencodedPath, queryParameters);
- }
-
- static Uri _makeHttpUri(String scheme,
- String authority,
- String unencodedPath,
- Map<String, String> queryParameters) {
- var userInfo = "";
- var host = "";
- var port = 0;
-
- var hostStart = 0;
- // Split off the user info.
- bool hasUserInfo = false;
- for (int i = 0; i < authority.length; i++) {
- if (authority.codeUnitAt(i) == _AT_SIGN) {
- hasUserInfo = true;
- userInfo = authority.substring(0, i);
- hostStart = i + 1;
- break;
- }
- }
- // Split host and port.
- bool hasPort = false;
- for (int i = hostStart; i < authority.length; i++) {
- if (authority.codeUnitAt(i) == _COLON) {
- hasPort = true;
- host = authority.substring(hostStart, i);
- if (!host.isEmpty) {
- var portString = authority.substring(i + 1);
- if (portString.isNotEmpty) port = int.parse(portString);
- }
- break;
- }
- }
- if (!hasPort) {
- host = hasUserInfo ? authority.substring(hostStart) : authority;
- }
-
- return new Uri(scheme: scheme,
- userInfo: userInfo,
- host: host,
- port: port,
- pathSegments: unencodedPath.split("/"),
- queryParameters: queryParameters);
- }
-
- /**
* Returns the URI path split into its segments. Each of the
* segments in the returned list have been decoded. If the path is
* empty the empty list will be returned. A leading slash `/` does
@@ -831,7 +746,6 @@
static const int _ZERO = 0x30;
static const int _NINE = 0x39;
static const int _COLON = 0x3A;
- static const int _AT_SIGN = 0x40;
static const int _UPPER_CASE_A = 0x41;
static const int _UPPER_CASE_F = 0x46;
static const int _LOWER_CASE_A = 0x61;
diff --git a/sdk/lib/io/directory_impl.dart b/sdk/lib/io/directory_impl.dart
index 4472fcb..f47ef4f 100644
--- a/sdk/lib/io/directory_impl.dart
+++ b/sdk/lib/io/directory_impl.dart
@@ -237,35 +237,16 @@
return new Directory(newPath);
}
- static String _trimTrailingPathSeparators(String path) {
- // Don't handle argument errors here.
- if (path is! String) return path;
- if (Platform.operatingSystem == 'windows') {
- while (path.length > 1 &&
- (path.endsWith(Platform.pathSeparator) ||
- path.endsWith('/'))) {
- path = path.substring(0, path.length - 1);
- }
- } else {
- while (path.length > 1 && path.endsWith(Platform.pathSeparator)) {
- path = path.substring(0, path.length - 1);
- }
- }
- return path;
- }
-
Stream<FileSystemEntity> list({bool recursive: false,
bool followLinks: true}) {
- return new _AsyncDirectoryLister(_trimTrailingPathSeparators(path),
- recursive,
- followLinks).stream;
+ return new _AsyncDirectoryLister(path, recursive, followLinks).stream;
}
List listSync({bool recursive: false, bool followLinks: true}) {
- if (_path is! String || recursive is! bool || followLinks is! bool) {
+ if (_path is! String || recursive is! bool) {
throw new ArgumentError();
}
- return _list(_trimTrailingPathSeparators(path), recursive, followLinks);
+ return _list(_path, recursive, followLinks);
}
String get path => _path;
@@ -327,8 +308,7 @@
bool this.followLinks) {
controller = new StreamController(onListen: onListen,
onResume: onResume,
- onCancel: onCancel,
- sync: true);
+ onCancel: onCancel);
}
Stream get stream => controller.stream;
diff --git a/sdk/lib/io/http_parser.dart b/sdk/lib/io/http_parser.dart
index d885008..f863e4fc 100644
--- a/sdk/lib/io/http_parser.dart
+++ b/sdk/lib/io/http_parser.dart
@@ -660,7 +660,7 @@
_index--;
int dataAvailable = _buffer.length - _index;
List<int> data;
- if (_remainingContent == -1 ||
+ if (_remainingContent == null ||
dataAvailable <= _remainingContent) {
if (_index == 0) {
data = _buffer;
@@ -673,7 +673,7 @@
data.setRange(0, _remainingContent, _buffer, _index);
}
_bodyController.add(data);
- if (_remainingContent != -1) {
+ if (_remainingContent != null) {
_remainingContent -= data.length;
}
_index += data.length;
@@ -814,8 +814,6 @@
_method_or_status_code = new List();
_uri_or_reason_phrase = new List();
- _statusCode = 0;
-
_httpVersion = _HttpVersion.UNDETERMINED;
_transferLength = -1;
_persistentConnection = false;
@@ -824,7 +822,7 @@
_noMessageBody = false;
_responseToMethod = null;
- _remainingContent = -1;
+ _remainingContent = null;
_headers = null;
}
@@ -963,21 +961,21 @@
int _state;
int _httpVersionIndex;
int _messageType;
- int _statusCode = 0;
+ int _statusCode;
List _method_or_status_code;
List _uri_or_reason_phrase;
List _headerField;
List _headerValue;
int _httpVersion;
- int _transferLength = -1;
+ int _transferLength;
bool _persistentConnection;
bool _connectionUpgrade;
bool _chunked;
bool _noMessageBody;
String _responseToMethod; // Indicates the method used for the request.
- int _remainingContent = -1;
+ int _remainingContent;
_HttpHeaders _headers;
diff --git a/tests/co19/co19-dart2js.status b/tests/co19/co19-dart2js.status
index 2f99e82..fb5aa0d 100644
--- a/tests/co19/co19-dart2js.status
+++ b/tests/co19/co19-dart2js.status
@@ -618,13 +618,7 @@
Language/11_Expressions/30_Identifier_Reference_A02_t01: Fail # Pseudo keyword "abstract".
Language/12_Statements/06_For_A01_t11: Fail # http://dartbug.com/9824
-
-
-# BUG(11331): Renamed Date to DateTime (issue 373, 374) but this only has an
-# impact on V8, because of the way method calls are evaluated. Needs more
-# investigation.
-[ $compiler == dart2js && $runtime == d8 ]
-Language/14_Types/6_Type_dynamic_A03_t01: Fail
+Language/14_Types/6_Type_dynamic_A03_t01: Fail # Renamed Date to DateTime (issue 373, 374)
[ $compiler == dart2js && $jscl ]
diff --git a/tests/co19/co19-runtime.status b/tests/co19/co19-runtime.status
index 064bcfd..6a518b5 100644
--- a/tests/co19/co19-runtime.status
+++ b/tests/co19/co19-runtime.status
@@ -541,23 +541,6 @@
*: Skip
-[ $compiler == none && $runtime == vm && $arch == simmips && $mode == release ]
-LibTest/math/tan_A01_t01: Fail
-LibTest/math/cos_A01_t01: Pass, Fail # Fail on Mac
-LibTest/core/double/ceil_A01_t02: Fail
-LibTest/core/double/floor_A01_t02: Fail
-LibTest/core/double/truncate_A01_t01: Fail
-LibTest/core/int/operator_left_shift_A01_t02: Fail # co19 issue 129
+[ $compiler == none && $runtime == vm && $arch == simmips ]
+*: Skip
-[ $compiler == none && $runtime == vm && $arch == simmips && $mode == debug ]
-LibTest/math/tan_A01_t01: Fail
-LibTest/math/cos_A01_t01: Pass, Fail # Fail on Mac
-LibTest/core/Expect/throws_A01_t04: Crash
-LibTest/core/List/sort_A01_t04: Crash # Too far relative jump.
-LibTest/core/List/sort_A01_t05: Crash
-LibTest/core/List/sort_A01_t06: Crash
-LibTest/core/double/ceil_A01_t02: Fail
-LibTest/core/double/floor_A01_t02: Fail
-LibTest/core/double/truncate_A01_t01: Fail
-LibTest/math/Random/nextDouble_A01_t01: Crash
-LibTest/core/int/operator_left_shift_A01_t02: Fail # co19 issue 129
diff --git a/tests/compiler/dart2js/field_type_simple_inferer_test.dart b/tests/compiler/dart2js/field_type_simple_inferer_test.dart
index 1b5c87f..1e25741 100644
--- a/tests/compiler/dart2js/field_type_simple_inferer_test.dart
+++ b/tests/compiler/dart2js/field_type_simple_inferer_test.dart
@@ -522,8 +522,8 @@
'f3': (inferrer) => inferrer.intType.nullable(),
'f4': (inferrer) => inferrer.intType.nullable()});
- runTest(TEST_24, {'f1': (inferrer) => inferrer.intType,
- 'f2': (inferrer) => inferrer.intType,
+ runTest(TEST_24, {'f1': (inferrer) => inferrer.numType,
+ 'f2': (inferrer) => inferrer.numType,
'f3': (inferrer) => inferrer.intType,
'f4': (inferrer) => inferrer.intType,
'f5': (inferrer) => inferrer.numType.nullable(),
diff --git a/tests/compiler/dart2js/mock_compiler.dart b/tests/compiler/dart2js/mock_compiler.dart
index c632565..9fde6d6 100644
--- a/tests/compiler/dart2js/mock_compiler.dart
+++ b/tests/compiler/dart2js/mock_compiler.dart
@@ -92,7 +92,7 @@
abstract class JSMutableIndexable extends JSIndexable {}
class JSArray extends Interceptor implements List, JSIndexable {
var length;
- operator[](index) => this[index];
+ operator[](index) {}
operator[]=(index, value) {}
var add;
}
diff --git a/tests/compiler/dart2js/simple_inferrer_no_such_method_test.dart b/tests/compiler/dart2js/simple_inferrer_no_such_method_test.dart
index 0d01558..400c0f8 100644
--- a/tests/compiler/dart2js/simple_inferrer_no_such_method_test.dart
+++ b/tests/compiler/dart2js/simple_inferrer_no_such_method_test.dart
@@ -108,7 +108,7 @@
}
checkReturn('test1', typesInferrer.intType);
- checkReturn('test2', typesInferrer.dynamicType.nonNullable());
+ checkReturn('test2', typesInferrer.dynamicType);
checkReturn('test3', typesInferrer.intType);
checkReturn('test4', typesInferrer.mapType);
checkReturn('test5', typesInferrer.dynamicType.nonNullable());
@@ -118,13 +118,17 @@
compiler.runCompiler(uri);
typesInferrer = compiler.typesTask.typesInferrer;
- checkReturn('test1', typesInferrer.dynamicType.nonNullable());
+ checkReturn('test1', typesInferrer.dynamicType);
checkReturn('test2', typesInferrer.mapType);
checkReturn('test3', typesInferrer.mapType);
checkReturn('test4', typesInferrer.mapType);
checkReturn('test5', typesInferrer.mapType);
- checkReturn('test6', typesInferrer.numType);
+ // TODO(ngeoffray): The reason for nullablity is because the
+ // inferrer thinks Object.noSuchMethod return null. Once we track
+ // aborting control flow in the analysis, we won't get the nullable
+ // anymore.
+ checkReturn('test6', typesInferrer.numType.nullable());
checkReturn('test7', typesInferrer.intType);
checkReturn('test8', typesInferrer.intType);
checkReturn('test9', typesInferrer.intType);
diff --git a/tests/compiler/dart2js/simple_inferrer_test.dart b/tests/compiler/dart2js/simple_inferrer_test.dart
index 03ede88..19be754 100644
--- a/tests/compiler/dart2js/simple_inferrer_test.dart
+++ b/tests/compiler/dart2js/simple_inferrer_test.dart
@@ -351,16 +351,6 @@
return b;
}
-testReturnElementOfConstList1() {
- return const [42][0];
-}
-
-testReturnElementOfConstList2() {
- return topLevelConstList[0];
-}
-
-var topLevelConstList = const [42];
-
get topLevelGetter => 42;
returnDynamic() => topLevelGetter(42);
returnTopLevelGetter() => topLevelGetter;
@@ -465,8 +455,6 @@
..returnInt7()
..returnInt8()
..returnInt9();
- testReturnElementOfConstList1();
- testReturnElementOfConstList2();
}
""";
@@ -539,8 +527,6 @@
checkReturn('testBreak1', interceptorType.nullable());
checkReturn('testContinue2', interceptorType.nullable());
checkReturn('testBreak2', typesInferrer.intType.nullable());
- checkReturn('testReturnElementOfConstList1', typesInferrer.intType);
- checkReturn('testReturnElementOfConstList2', typesInferrer.intType);
checkReturnInClass(String className, String methodName, type) {
var cls = findElement(compiler, className);
diff --git a/tests/corelib/string_test.dart b/tests/corelib/string_test.dart
index aeb00c3..4519733 100644
--- a/tests/corelib/string_test.dart
+++ b/tests/corelib/string_test.dart
@@ -127,29 +127,6 @@
Expect.isTrue("".startsWith(""));
Expect.isFalse("".startsWith("s"));
- Expect.isFalse("strstr".startsWith("s", 1));
- Expect.isFalse("strstr".startsWith("s", 2));
- Expect.isTrue("strstr".startsWith("s", 3));
- Expect.isFalse("strstr".startsWith("s", 4));
-
- Expect.isFalse("strstr".startsWith("st", 1));
- Expect.isFalse("strstr".startsWith("st", 2));
- Expect.isTrue("strstr".startsWith("st", 3));
- Expect.isFalse("strstr".startsWith("st", 4));
-
- Expect.isFalse("strstr".startsWith("str", 1));
- Expect.isFalse("strstr".startsWith("str", 2));
- Expect.isTrue("strstr".startsWith("str", 3));
- Expect.isFalse("strstr".startsWith("str", 4));
-
- Expect.isTrue("str".startsWith("", 0));
- Expect.isTrue("str".startsWith("", 1));
- Expect.isTrue("str".startsWith("", 2));
- Expect.isTrue("str".startsWith("", 3));
-
- Expect.throws(() => "str".startsWith("", -1));
- Expect.throws(() => "str".startsWith("", 4));
-
var regexp = new RegExp("s(?:tr?)?");
Expect.isTrue("s".startsWith(regexp));
Expect.isTrue("st".startsWith(regexp));
@@ -163,30 +140,6 @@
Expect.isTrue("".startsWith(new RegExp("")));
Expect.isTrue("".startsWith(new RegExp("a?")));
-
- Expect.isFalse("strstr".startsWith(regexp, 1));
- Expect.isFalse("strstr".startsWith(regexp, 2));
- Expect.isTrue("strstr".startsWith(regexp, 3));
- Expect.isFalse("strstr".startsWith(regexp, 4));
-
- Expect.isTrue("str".startsWith(new RegExp(""), 0));
- Expect.isTrue("str".startsWith(new RegExp(""), 1));
- Expect.isTrue("str".startsWith(new RegExp(""), 2));
- Expect.isTrue("str".startsWith(new RegExp(""), 3));
- Expect.isTrue("str".startsWith(new RegExp("a?"), 0));
- Expect.isTrue("str".startsWith(new RegExp("a?"), 1));
- Expect.isTrue("str".startsWith(new RegExp("a?"), 2));
- Expect.isTrue("str".startsWith(new RegExp("a?"), 3));
-
- Expect.throws(() => "str".startsWith(regexp, -1));
- Expect.throws(() => "str".startsWith(regexp, 4));
-
- regexp = new RegExp("^str");
- Expect.isTrue("strstr".startsWith(regexp));
- Expect.isTrue("strstr".startsWith(regexp, 0));
- Expect.isFalse("strstr".startsWith(regexp, 1));
- Expect.isFalse("strstr".startsWith(regexp, 2));
- Expect.isFalse("strstr".startsWith(regexp, 3)); // Second "str" isn't at ^.
}
static testIndexOf() {
diff --git a/tests/language/language.status b/tests/language/language.status
index 21e4f57..e55fc34 100644
--- a/tests/language/language.status
+++ b/tests/language/language.status
@@ -537,6 +537,7 @@
left_shift_test: Pass, Fail # Fails on Mac
positive_bit_operations_test: Pass, Fail, Crash # Fails and crashes on Mac
+
# large_implicit_getter_test Passes on ReleaseARM, Crashes in SIMARM and
# DebugARM. Should crash on ReleaseARM, but there is no exception on an
# unaligned access. stack_overflow_test and _stacktrace_test have the same
@@ -556,6 +557,7 @@
bit_operations_test: Crash, Fail
char_escape_test: Pass, Crash
deopt_smi_op_test: Fail
+div_with_power_of_two_test: Fail
gc_test: Crash
invocation_mirror_test: Fail
load_to_load_forwarding_vm_test: Fail
diff --git a/tests/language/language_analyzer.status b/tests/language/language_analyzer.status
index ac2f1ad..27a984d 100644
--- a/tests/language/language_analyzer.status
+++ b/tests/language/language_analyzer.status
@@ -135,6 +135,7 @@
override_field_test/02: fail
override_field_test/03: fail
override_method_with_field_test/01: fail
+override_method_with_field_test/02: fail
prefix10_negative_test: fail
prefix11_negative_test: fail
prefix12_negative_test: fail
diff --git a/tests/language/language_analyzer2.status b/tests/language/language_analyzer2.status
index 4043be7..be8fb29 100644
--- a/tests/language/language_analyzer2.status
+++ b/tests/language/language_analyzer2.status
@@ -135,6 +135,7 @@
override_field_test/02: fail
override_field_test/03: fail
override_method_with_field_test/01: fail
+override_method_with_field_test/02: fail
prefix10_negative_test: fail
prefix11_negative_test: fail
prefix12_negative_test: fail
@@ -172,6 +173,7 @@
syntax_test/31: fail
syntax_test/32: fail
syntax_test/33: fail
+ternary_test: fail
throw7_negative_test: fail
type_error_test: fail
type_parameter_test/01: fail
@@ -194,6 +196,8 @@
type_variable_bounds_test/09: fail
type_variable_identifier_expression_negative_test: fail
type_variable_static_context_negative_test: fail
+unary2_test: fail
+unary_test: fail
unresolved_in_factory_negative_test: fail
unresolved_top_level_method_negative_test: fail
unresolved_top_level_var_negative_test: fail
diff --git a/tests/lib/lib.status b/tests/lib/lib.status
index 6682046..e26f707 100644
--- a/tests/lib/lib.status
+++ b/tests/lib/lib.status
@@ -28,8 +28,6 @@
mirrors/to_string_test: Fail # Issue 6490
[ $csp ]
-mirrors/intercepted_class_test: Fail # Issue 6490
-mirrors/intercepted_object_test: Fail # Issue 6490
mirrors/metadata_test: Fail # Issue 6490
mirrors/reflect_model_test: Fail # Issue 6490
mirrors/reflect_runtime_type_test: Fail # Issue 6490
diff --git a/tests/standalone/io/directory_list_pause_test.dart b/tests/standalone/io/directory_list_pause_test.dart
index 081b406..178f59f 100644
--- a/tests/standalone/io/directory_list_pause_test.dart
+++ b/tests/standalone/io/directory_list_pause_test.dart
@@ -10,34 +10,31 @@
void testPauseList() {
var keepAlive = new ReceivePort();
- // TOTAL should be bigger the our directory listing buffer.
- const int TOTAL = 128;
new Directory("").createTemp().then((d) {
- for (int i = 0; i < TOTAL; i++) {
- new Directory("${d.path}/$i").createSync();
- new File("${d.path}/$i/file").createSync();
+ // Linux reads 2K at a time, so be sure to be >>.
+ int total = 4 * 1024 + 1;
+ for (int i = 0; i < total; i++) {
+ new File("${d.path}/$i").createSync();
}
bool first = true;
var subscription;
int count = 0;
- subscription = d.list(recursive: true).listen((file) {
- if (file is File) {
- if (first) {
- first = false;
- subscription.pause();
- Timer.run(() {
- for (int i = 0; i < TOTAL; i++) {
- new File("${d.path}/$i/file").deleteSync();
- }
- subscription.resume();
- });
- }
- count++;
+ subscription = d.list().listen((file) {
+ if (first) {
+ first = false;
+ subscription.pause();
+ Timer.run(() {
+ for (int i = 0; i < total; i++) {
+ new File("${d.path}/$i").deleteSync();
+ }
+ subscription.resume();
+ });
}
+ count++;
}, onDone: () {
- Expect.notEquals(TOTAL, count);
- Expect.isTrue(count > 0);
- d.delete(recursive: true).then((ignore) => keepAlive.close());
+ Expect.notEquals(total, count);
+ keepAlive.close();
+ d.delete().then((ignore) => keepAlive.close());
});
});
}
diff --git a/tests/standalone/io/directory_test.dart b/tests/standalone/io/directory_test.dart
index f9927d3..6592281 100644
--- a/tests/standalone/io/directory_test.dart
+++ b/tests/standalone/io/directory_test.dart
@@ -85,24 +85,6 @@
Expect.isFalse(listedFile);
}
- static void testListingTailingPaths() {
- Directory directory = new Directory("").createTempSync();
- Directory subDirectory = new Directory("${directory.path}/subdir/");
- subDirectory.createSync();
- File f = new File('${subDirectory.path}/file.txt');
- f.createSync();
-
- void test(entry) {
- Expect.isFalse(entry.path.contains(new RegExp('[\\/][\\/]')));
- }
-
- subDirectory.listSync().forEach(test);
-
- subDirectory.list().listen(test, onDone: () {
- directory.deleteSync(recursive: true);
- });
- }
-
static void testListNonExistent() {
setupListerHandlers(Stream<FileSystemEntity> stream) {
stream.listen(
@@ -415,7 +397,6 @@
static void testMain() {
testListing();
- testListingTailingPaths();
testListNonExistent();
testListTooLongName();
testDeleteNonExistent();
diff --git a/tests/standalone/io/raw_socket_test.dart b/tests/standalone/io/raw_socket_test.dart
index 42d9c29..08ed693 100644
--- a/tests/standalone/io/raw_socket_test.dart
+++ b/tests/standalone/io/raw_socket_test.dart
@@ -241,7 +241,7 @@
// sockets.
subscription.pause();
var connectCount = 0;
- for (int i = 0; i < socketCount / 2; i++) {
+ for (int i = 0; i <= socketCount / 2; i++) {
RawSocket.connect("127.0.0.1", server.port).then((_) {
if (++connectCount == socketCount / 2) {
subscription.resume();
diff --git a/tests/standalone/standalone.status b/tests/standalone/standalone.status
index fab1994..e08da8e 100644
--- a/tests/standalone/standalone.status
+++ b/tests/standalone/standalone.status
@@ -159,8 +159,16 @@
*: Skip
[ $arch == arm || $arch == simarm ]
-*: Skip # Many of these tests are still flaky on arm, so skipping until we
- # actually start working on implementing the needed features.
+coverage_test: Crash # Issue: 11207
+debugger/basic_debugger_test: Crash # Issue: 11207
+debugger/closure_debugger_test: Crash # Issue: 11207
+http_launch_test: Fail, Crash # Issue: 11207
+left_shift_bit_and_op_test: Fail # Issue: 11207
+package/package_isolate_test: Pass, Crash # Issue: 11207
+out_of_memory_test: Pass, Crash # Issue: 11207 (Pass on Mac)
+typed_data_test: Timeout, Crash # Issue: 11207
+typed_data_isolate_test: Pass, Crash # Issue: 11207
+io/*: Skip # Skip IO tests for now as they are still quite flaky.
[ $arch == mips ]
*: Skip
diff --git a/tools/VERSION b/tools/VERSION
index 453bc99..c06980b 100644
--- a/tools/VERSION
+++ b/tools/VERSION
@@ -1,4 +1,4 @@
MAJOR 0
-MINOR 1
-BUILD 2
-PATCH 0
+MINOR 5
+BUILD 20
+PATCH 2
diff --git a/tools/gyp/configurations_make.gypi b/tools/gyp/configurations_make.gypi
index ba2445a..eec4dc5 100644
--- a/tools/gyp/configurations_make.gypi
+++ b/tools/gyp/configurations_make.gypi
@@ -90,7 +90,9 @@
},
'Dart_Release': {
- 'cflags': [ '-O3', ],
+ 'cflags': [ '-O3',
+ '-fno-omit-frame-pointer',
+ ],
},
},
},
diff --git a/tools/test.dart b/tools/test.dart
index da8f3ab..c2da69a 100755
--- a/tools/test.dart
+++ b/tools/test.dart
@@ -167,6 +167,7 @@
// FIXME(kustermann/ricow): Remove this once the new browser_controller is
// stable.
maxBrowserProcesses = math.max(maxProcesses - 3, 1);
+ maxProcesses = math.max(maxProcesses -1, 1);
}
for (String key in selectors.keys) {
diff --git a/utils/pub/pub.Makefile b/utils/pub/pub.Makefile
new file mode 100644
index 0000000..c1d628d
--- /dev/null
+++ b/utils/pub/pub.Makefile
@@ -0,0 +1,6 @@
+# This file is generated by gyp; do not edit.
+
+export builddir_name ?= dart/utils/pub/out
+.PHONY: all
+all:
+ $(MAKE) -C ../.. pub
diff --git a/utils/pub/pub.target.mk b/utils/pub/pub.target.mk
new file mode 100644
index 0000000..6362e21
--- /dev/null
+++ b/utils/pub/pub.target.mk
@@ -0,0 +1,38 @@
+# This file is generated by gyp; do not edit.
+
+TOOLSET := target
+TARGET := pub
+### Rules for action "generate_pub_snapshot":
+quiet_cmd_dart_utils_pub_pub_gyp_pub_target_generate_pub_snapshot = ACTION dart_utils_pub_pub_gyp_pub_target_generate_pub_snapshot $@
+cmd_dart_utils_pub_pub_gyp_pub_target_generate_pub_snapshot = LD_LIBRARY_PATH=$(builddir)/lib.host:$(builddir)/lib.target:$$LD_LIBRARY_PATH; export LD_LIBRARY_PATH; cd utils/pub; mkdir -p $(obj)/gen; "$(builddir)/dart" "--package-root=$(builddir)/packages/" "--generate-script-snapshot=$(obj)/gen/pub.dart.snapshot" ../../sdk/lib/_internal/pub/bin/pub.dart
+
+$(obj)/gen/pub.dart.snapshot: obj := $(abs_obj)
+$(obj)/gen/pub.dart.snapshot: builddir := $(abs_builddir)
+$(obj)/gen/pub.dart.snapshot: TOOLSET := $(TOOLSET)
+$(obj)/gen/pub.dart.snapshot: $(builddir)/dart sdk/lib/_internal/pub/bin/pub.dart sdk/lib/_internal/pub/lib/src/http.dart sdk/lib/_internal/pub/lib/src/utils.dart sdk/lib/_internal/pub/lib/src/command_deploy.dart sdk/lib/_internal/pub/lib/src/git_source.dart sdk/lib/_internal/pub/lib/src/command_install.dart sdk/lib/_internal/pub/lib/src/exit_codes.dart sdk/lib/_internal/pub/lib/src/command.dart sdk/lib/_internal/pub/lib/src/source_registry.dart sdk/lib/_internal/pub/lib/src/pubspec.dart sdk/lib/_internal/pub/lib/src/command_help.dart sdk/lib/_internal/pub/lib/src/oauth2.dart sdk/lib/_internal/pub/lib/src/command_uploader.dart sdk/lib/_internal/pub/lib/src/error_group.dart sdk/lib/_internal/pub/lib/src/directory_tree.dart sdk/lib/_internal/pub/lib/src/sdk.dart sdk/lib/_internal/pub/lib/src/dart.dart sdk/lib/_internal/pub/lib/src/hosted_source.dart sdk/lib/_internal/pub/lib/src/version.dart sdk/lib/_internal/pub/lib/src/git.dart sdk/lib/_internal/pub/lib/src/io.dart sdk/lib/_internal/pub/lib/src/system_cache.dart sdk/lib/_internal/pub/lib/src/safe_http_server.dart sdk/lib/_internal/pub/lib/src/command_update.dart sdk/lib/_internal/pub/lib/src/command_version.dart sdk/lib/_internal/pub/lib/src/validator.dart sdk/lib/_internal/pub/lib/src/command_cache.dart sdk/lib/_internal/pub/lib/src/source.dart sdk/lib/_internal/pub/lib/src/command_lish.dart sdk/lib/_internal/pub/lib/src/package.dart sdk/lib/_internal/pub/lib/src/log.dart sdk/lib/_internal/pub/lib/src/entrypoint.dart sdk/lib/_internal/pub/lib/src/lock_file.dart sdk/lib/_internal/pub/lib/src/path_source.dart sdk/lib/_internal/pub/lib/src/validator/name.dart sdk/lib/_internal/pub/lib/src/validator/size.dart sdk/lib/_internal/pub/lib/src/validator/pubspec_field.dart sdk/lib/_internal/pub/lib/src/validator/compiled_dartdoc.dart sdk/lib/_internal/pub/lib/src/validator/directory.dart sdk/lib/_internal/pub/lib/src/validator/utf8_readme.dart sdk/lib/_internal/pub/lib/src/validator/dependency.dart sdk/lib/_internal/pub/lib/src/validator/license.dart sdk/lib/_internal/pub/lib/src/validator/lib.dart sdk/lib/_internal/pub/lib/src/solver/version_solver.dart sdk/lib/_internal/pub/lib/src/solver/backtracking_solver.dart sdk/lib/_internal/pub/test/command_line_config.dart sdk/lib/_internal/pub/test/version_test.dart sdk/lib/_internal/pub/test/io_test.dart sdk/lib/_internal/pub/test/pub_cache_test.dart sdk/lib/_internal/pub/test/test_pub.dart sdk/lib/_internal/pub/test/lock_file_test.dart sdk/lib/_internal/pub/test/real_version_test.dart sdk/lib/_internal/pub/test/utils_test.dart sdk/lib/_internal/pub/test/directory_tree_test.dart sdk/lib/_internal/pub/test/unknown_source_test.dart sdk/lib/_internal/pub/test/dev_dependency_test.dart sdk/lib/_internal/pub/test/package_files_test.dart sdk/lib/_internal/pub/test/pubspec_test.dart sdk/lib/_internal/pub/test/pub_test.dart sdk/lib/_internal/pub/test/pub_install_and_update_test.dart sdk/lib/_internal/pub/test/version_solver_test.dart sdk/lib/_internal/pub/test/descriptor.dart sdk/lib/_internal/pub/test/error_group_test.dart sdk/lib/_internal/pub/test/pub_uploader_test.dart sdk/lib/_internal/pub/test/lish/cloud_storage_upload_doesnt_redirect_test.dart sdk/lib/_internal/pub/test/lish/cloud_storage_upload_provides_an_error_test.dart sdk/lib/_internal/pub/test/lish/upload_form_provides_an_error_test.dart sdk/lib/_internal/pub/test/lish/utils.dart sdk/lib/_internal/pub/test/lish/package_creation_provides_a_malformed_error_test.dart sdk/lib/_internal/pub/test/lish/package_validation_has_a_warning_and_is_canceled_test.dart sdk/lib/_internal/pub/test/lish/force_cannot_be_combined_with_dry_run_test.dart sdk/lib/_internal/pub/test/lish/upload_form_fields_is_not_a_map_test.dart sdk/lib/_internal/pub/test/lish/package_creation_provides_invalid_json_test.dart sdk/lib/_internal/pub/test/lish/package_creation_provides_a_malformed_success_test.dart sdk/lib/_internal/pub/test/lish/package_creation_provides_an_error_test.dart sdk/lib/_internal/pub/test/lish/upload_form_is_missing_url_test.dart sdk/lib/_internal/pub/test/lish/force_does_not_publish_if_there_are_errors_test.dart sdk/lib/_internal/pub/test/lish/upload_form_is_missing_fields_test.dart sdk/lib/_internal/pub/test/lish/package_validation_has_an_error_test.dart sdk/lib/_internal/pub/test/lish/preview_package_validation_has_a_warning_test.dart sdk/lib/_internal/pub/test/lish/package_validation_has_a_warning_and_continues_test.dart sdk/lib/_internal/pub/test/lish/force_publishes_if_tests_are_no_warnings_or_errors_test.dart sdk/lib/_internal/pub/test/lish/preview_package_validation_has_no_warnings_test.dart sdk/lib/_internal/pub/test/lish/archives_and_uploads_a_package_test.dart sdk/lib/_internal/pub/test/lish/upload_form_url_is_not_a_string_test.dart sdk/lib/_internal/pub/test/lish/force_publishes_if_there_are_warnings_test.dart sdk/lib/_internal/pub/test/lish/upload_form_fields_has_a_non_string_value_test.dart sdk/lib/_internal/pub/test/lish/upload_form_provides_invalid_json_test.dart sdk/lib/_internal/pub/test/update/git/do_not_update_if_unneeded_test.dart sdk/lib/_internal/pub/test/update/git/update_to_incompatible_pubspec_test.dart sdk/lib/_internal/pub/test/update/git/update_to_nonexistent_pubspec_test.dart sdk/lib/_internal/pub/test/update/git/update_locked_test.dart sdk/lib/_internal/pub/test/update/git/update_one_locked_test.dart sdk/lib/_internal/pub/test/update/hosted/unlock_dependers_test.dart sdk/lib/_internal/pub/test/update/hosted/unlock_if_necessary_test.dart sdk/lib/_internal/pub/test/update/hosted/update_removed_constraints_test.dart sdk/lib/_internal/pub/test/validator/license_test.dart sdk/lib/_internal/pub/test/validator/utils.dart sdk/lib/_internal/pub/test/validator/pubspec_field_test.dart sdk/lib/_internal/pub/test/validator/dependency_test.dart sdk/lib/_internal/pub/test/validator/directory_test.dart sdk/lib/_internal/pub/test/validator/name_test.dart sdk/lib/_internal/pub/test/validator/lib_test.dart sdk/lib/_internal/pub/test/validator/size_test.dart sdk/lib/_internal/pub/test/validator/utf8_readme_test.dart sdk/lib/_internal/pub/test/validator/compiled_dartdoc_test.dart sdk/lib/_internal/pub/test/oauth2/utils.dart sdk/lib/_internal/pub/test/oauth2/with_server_rejected_credentials_authenticates_again_test.dart sdk/lib/_internal/pub/test/oauth2/with_a_server_rejected_refresh_token_authenticates_again_test.dart sdk/lib/_internal/pub/test/oauth2/with_no_credentials_authenticates_and_saves_credentials_test.dart sdk/lib/_internal/pub/test/oauth2/with_an_expired_credentials_refreshes_and_saves_test.dart sdk/lib/_internal/pub/test/oauth2/with_a_pre_existing_credentials_does_not_authenticate_test.dart sdk/lib/_internal/pub/test/oauth2/with_an_expired_credentials_without_a_refresh_token_authenticates_again_test.dart sdk/lib/_internal/pub/test/oauth2/with_a_malformed_credentials_authenticates_again_test.dart sdk/lib/_internal/pub/test/descriptor/tar.dart sdk/lib/_internal/pub/test/descriptor/git.dart sdk/lib/_internal/pub/test/hosted/fail_gracefully_on_missing_package_test.dart sdk/lib/_internal/pub/test/hosted/offline_test.dart sdk/lib/_internal/pub/test/hosted/fail_gracefully_on_url_resolve_test.dart sdk/lib/_internal/pub/test/hosted/remove_removed_transitive_dependency_test.dart sdk/lib/_internal/pub/test/hosted/remove_removed_dependency_test.dart sdk/lib/_internal/pub/test/install/relative_symlink_test.dart sdk/lib/_internal/pub/test/install/broken_symlink_test.dart sdk/lib/_internal/pub/test/install/switch_source_test.dart sdk/lib/_internal/pub/test/install/git/check_out_transitive_test.dart sdk/lib/_internal/pub/test/install/git/unlock_if_incompatible_test.dart sdk/lib/_internal/pub/test/install/git/require_pubspec_test.dart sdk/lib/_internal/pub/test/install/git/check_out_with_trailing_slash_test.dart sdk/lib/_internal/pub/test/install/git/dependency_name_match_pubspec_test.dart sdk/lib/_internal/pub/test/install/git/check_out_branch_test.dart sdk/lib/_internal/pub/test/install/git/stay_locked_if_compatible_test.dart sdk/lib/_internal/pub/test/install/git/check_out_and_update_test.dart sdk/lib/_internal/pub/test/install/git/check_out_twice_test.dart sdk/lib/_internal/pub/test/install/git/check_out_test.dart sdk/lib/_internal/pub/test/install/git/lock_version_test.dart sdk/lib/_internal/pub/test/install/git/require_pubspec_name_test.dart sdk/lib/_internal/pub/test/install/git/check_out_revision_test.dart sdk/lib/_internal/pub/test/install/git/different_repo_name_test.dart sdk/lib/_internal/pub/test/install/hosted/unlock_if_incompatible_test.dart sdk/lib/_internal/pub/test/install/hosted/do_not_update_on_removed_constraints_test.dart sdk/lib/_internal/pub/test/install/hosted/stay_locked_test.dart sdk/lib/_internal/pub/test/install/hosted/install_test.dart sdk/lib/_internal/pub/test/install/hosted/stay_locked_if_compatible_test.dart sdk/lib/_internal/pub/test/install/hosted/install_transitive_test.dart sdk/lib/_internal/pub/test/install/hosted/unlock_if_new_is_unsatisfied_test.dart sdk/lib/_internal/pub/test/install/hosted/stay_locked_if_new_is_satisfied_test.dart sdk/lib/_internal/pub/test/install/hosted/cached_pubspec_test.dart sdk/lib/_internal/pub/test/install/hosted/resolve_constraints_test.dart sdk/lib/_internal/pub/test/install/hosted/repair_cache_test.dart sdk/lib/_internal/pub/test/install/path/nonexistent_dir_test.dart sdk/lib/_internal/pub/test/install/path/absolute_path_test.dart sdk/lib/_internal/pub/test/install/path/relative_symlink_test.dart sdk/lib/_internal/pub/test/install/path/shared_dependency_test.dart sdk/lib/_internal/pub/test/install/path/shared_dependency_symlink_test.dart sdk/lib/_internal/pub/test/install/path/absolute_symlink_test.dart sdk/lib/_internal/pub/test/install/path/no_pubspec_test.dart sdk/lib/_internal/pub/test/install/path/relative_path_test.dart sdk/lib/_internal/pub/test/install/path/path_is_file_test.dart sdk/lib/_internal/pub/test/deploy/copies_non_dart_files_to_deploy_test.dart sdk/lib/_internal/pub/test/deploy/ignores_non_entrypoint_dart_files_test.dart sdk/lib/_internal/pub/test/deploy/compiles_dart_entrypoints_to_dart_and_js_test.dart sdk/lib/_internal/pub/test/deploy/reports_dart_parse_errors_test.dart sdk/lib/_internal/pub/test/deploy/copies_dart_js_next_to_entrypoints_test.dart sdk/lib/_internal/pub/test/deploy/with_no_web_directory_test.dart sdk/lib/_internal/libraries.dart sdk/lib/_internal/compiler/compiler.dart sdk/lib/_internal/compiler/implementation/dart_types.dart sdk/lib/_internal/compiler/implementation/string_validator.dart sdk/lib/_internal/compiler/implementation/world.dart sdk/lib/_internal/compiler/implementation/typechecker.dart sdk/lib/_internal/compiler/implementation/filenames.dart sdk/lib/_internal/compiler/implementation/dart2js.dart sdk/lib/_internal/compiler/implementation/patch_parser.dart sdk/lib/_internal/compiler/implementation/constants.dart sdk/lib/_internal/compiler/implementation/script.dart sdk/lib/_internal/compiler/implementation/library_loader.dart sdk/lib/_internal/compiler/implementation/enqueue.dart sdk/lib/_internal/compiler/implementation/compiler.dart sdk/lib/_internal/compiler/implementation/diagnostic_listener.dart sdk/lib/_internal/compiler/implementation/warnings.dart sdk/lib/_internal/compiler/implementation/source_file_provider.dart sdk/lib/_internal/compiler/implementation/tree_validator.dart sdk/lib/_internal/compiler/implementation/apiimpl.dart sdk/lib/_internal/compiler/implementation/native_handler.dart sdk/lib/_internal/compiler/implementation/constant_system_dart.dart sdk/lib/_internal/compiler/implementation/dart2jslib.dart sdk/lib/_internal/compiler/implementation/compile_time_constants.dart sdk/lib/_internal/compiler/implementation/closure.dart sdk/lib/_internal/compiler/implementation/code_buffer.dart sdk/lib/_internal/compiler/implementation/source_file.dart sdk/lib/_internal/compiler/implementation/deferred_load.dart sdk/lib/_internal/compiler/implementation/resolved_visitor.dart sdk/lib/_internal/compiler/implementation/colors.dart sdk/lib/_internal/compiler/implementation/source_map_builder.dart sdk/lib/_internal/compiler/implementation/constant_system.dart sdk/lib/_internal/compiler/implementation/util/characters.dart sdk/lib/_internal/compiler/implementation/util/util.dart sdk/lib/_internal/compiler/implementation/util/uri_extras.dart sdk/lib/_internal/compiler/implementation/util/link_implementation.dart sdk/lib/_internal/compiler/implementation/util/link.dart sdk/lib/_internal/compiler/implementation/util/util_implementation.dart sdk/lib/_internal/compiler/implementation/tools/mini_parser.dart sdk/lib/_internal/compiler/implementation/dart_backend/utils.dart sdk/lib/_internal/compiler/implementation/dart_backend/dart_backend.dart sdk/lib/_internal/compiler/implementation/dart_backend/emitter.dart sdk/lib/_internal/compiler/implementation/dart_backend/backend.dart sdk/lib/_internal/compiler/implementation/dart_backend/placeholder_collector.dart sdk/lib/_internal/compiler/implementation/dart_backend/renamer.dart sdk/lib/_internal/compiler/implementation/js_backend/minify_namer.dart sdk/lib/_internal/compiler/implementation/js_backend/namer.dart sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart sdk/lib/_internal/compiler/implementation/js_backend/runtime_types.dart sdk/lib/_internal/compiler/implementation/js_backend/constant_system_javascript.dart sdk/lib/_internal/compiler/implementation/js_backend/emitter_no_eval.dart sdk/lib/_internal/compiler/implementation/js_backend/js_backend.dart sdk/lib/_internal/compiler/implementation/js_backend/backend.dart sdk/lib/_internal/compiler/implementation/js_backend/native_emitter.dart sdk/lib/_internal/compiler/implementation/js_backend/constant_emitter.dart sdk/lib/_internal/compiler/implementation/lib/string_helper.dart sdk/lib/_internal/compiler/implementation/lib/collection_patch.dart sdk/lib/_internal/compiler/implementation/lib/js_rti.dart sdk/lib/_internal/compiler/implementation/lib/core_patch.dart sdk/lib/_internal/compiler/implementation/lib/js_array.dart sdk/lib/_internal/compiler/implementation/lib/mirrors_patch.dart sdk/lib/_internal/compiler/implementation/lib/isolate_patch.dart sdk/lib/_internal/compiler/implementation/lib/async_patch.dart sdk/lib/_internal/compiler/implementation/lib/collection_dev_patch.dart sdk/lib/_internal/compiler/implementation/lib/js_helper.dart sdk/lib/_internal/compiler/implementation/lib/scalarlist_patch.dart sdk/lib/_internal/compiler/implementation/lib/native_helper.dart sdk/lib/_internal/compiler/implementation/lib/io_patch.dart sdk/lib/_internal/compiler/implementation/lib/js_number.dart sdk/lib/_internal/compiler/implementation/lib/regexp_helper.dart sdk/lib/_internal/compiler/implementation/lib/isolate_helper.dart sdk/lib/_internal/compiler/implementation/lib/js_mirrors.dart sdk/lib/_internal/compiler/implementation/lib/constant_map.dart sdk/lib/_internal/compiler/implementation/lib/typed_data_patch.dart sdk/lib/_internal/compiler/implementation/lib/math_patch.dart sdk/lib/_internal/compiler/implementation/lib/js_string.dart sdk/lib/_internal/compiler/implementation/lib/json_patch.dart sdk/lib/_internal/compiler/implementation/lib/foreign_helper.dart sdk/lib/_internal/compiler/implementation/lib/interceptors.dart sdk/lib/_internal/compiler/implementation/mirrors/mirrors.dart sdk/lib/_internal/compiler/implementation/mirrors/util.dart sdk/lib/_internal/compiler/implementation/mirrors/dart2js_mirror.dart sdk/lib/_internal/compiler/implementation/mirrors/mirrors_util.dart sdk/lib/_internal/compiler/implementation/resolution/scope.dart sdk/lib/_internal/compiler/implementation/resolution/resolution.dart sdk/lib/_internal/compiler/implementation/resolution/secret_tree_element.dart sdk/lib/_internal/compiler/implementation/resolution/members.dart sdk/lib/_internal/compiler/implementation/ssa/ssa.dart sdk/lib/_internal/compiler/implementation/ssa/bailout.dart sdk/lib/_internal/compiler/implementation/ssa/codegen.dart sdk/lib/_internal/compiler/implementation/ssa/types.dart sdk/lib/_internal/compiler/implementation/ssa/validate.dart sdk/lib/_internal/compiler/implementation/ssa/invoke_dynamic_specializers.dart sdk/lib/_internal/compiler/implementation/ssa/optimize.dart sdk/lib/_internal/compiler/implementation/ssa/types_propagation.dart sdk/lib/_internal/compiler/implementation/ssa/codegen_helpers.dart sdk/lib/_internal/compiler/implementation/ssa/nodes.dart sdk/lib/_internal/compiler/implementation/ssa/value_set.dart sdk/lib/_internal/compiler/implementation/ssa/builder.dart sdk/lib/_internal/compiler/implementation/ssa/interceptor_simplifier.dart sdk/lib/_internal/compiler/implementation/ssa/tracer.dart sdk/lib/_internal/compiler/implementation/ssa/variable_allocator.dart sdk/lib/_internal/compiler/implementation/ssa/value_range_analyzer.dart sdk/lib/_internal/compiler/implementation/js/precedence.dart sdk/lib/_internal/compiler/implementation/js/nodes.dart sdk/lib/_internal/compiler/implementation/js/builder.dart sdk/lib/_internal/compiler/implementation/js/printer.dart sdk/lib/_internal/compiler/implementation/js/js.dart sdk/lib/_internal/compiler/implementation/types/types.dart sdk/lib/_internal/compiler/implementation/types/union_type_mask.dart sdk/lib/_internal/compiler/implementation/types/type_mask.dart sdk/lib/_internal/compiler/implementation/types/concrete_types_inferrer.dart sdk/lib/_internal/compiler/implementation/types/simple_types_inferrer.dart sdk/lib/_internal/compiler/implementation/types/flat_type_mask.dart sdk/lib/_internal/compiler/implementation/elements/elements.dart sdk/lib/_internal/compiler/implementation/elements/modelx.dart sdk/lib/_internal/compiler/implementation/universe/side_effects.dart sdk/lib/_internal/compiler/implementation/universe/selector_map.dart sdk/lib/_internal/compiler/implementation/universe/universe.dart sdk/lib/_internal/compiler/implementation/universe/function_set.dart sdk/lib/_internal/compiler/implementation/scanner/byte_array_scanner.dart sdk/lib/_internal/compiler/implementation/scanner/byte_strings.dart sdk/lib/_internal/compiler/implementation/scanner/scannerlib.dart sdk/lib/_internal/compiler/implementation/scanner/scanner_implementation.dart sdk/lib/_internal/compiler/implementation/scanner/listener.dart sdk/lib/_internal/compiler/implementation/scanner/class_element_parser.dart sdk/lib/_internal/compiler/implementation/scanner/parser_task.dart sdk/lib/_internal/compiler/implementation/scanner/scanner.dart sdk/lib/_internal/compiler/implementation/scanner/keyword.dart sdk/lib/_internal/compiler/implementation/scanner/scanner_task.dart sdk/lib/_internal/compiler/implementation/scanner/partial_parser.dart sdk/lib/_internal/compiler/implementation/scanner/token.dart sdk/lib/_internal/compiler/implementation/scanner/parser.dart sdk/lib/_internal/compiler/implementation/scanner/array_based_scanner.dart sdk/lib/_internal/compiler/implementation/scanner/string_scanner.dart sdk/lib/_internal/compiler/implementation/tree/visitors.dart sdk/lib/_internal/compiler/implementation/tree/prettyprint.dart sdk/lib/_internal/compiler/implementation/tree/unparser.dart sdk/lib/_internal/compiler/implementation/tree/tree.dart sdk/lib/_internal/compiler/implementation/tree/nodes.dart sdk/lib/_internal/compiler/implementation/tree/dartstring.dart sdk/lib/_internal/compiler/samples/jsonify/jsonify.dart sdk/lib/_internal/compiler/samples/compile_loop/compile_loop.dart sdk/lib/_internal/compiler/samples/leap/leap_leg.dart sdk/lib/_internal/compiler/samples/leap/request_cache.dart sdk/lib/_internal/compiler/samples/leap/leap_script.dart sdk/lib/_internal/compiler/samples/leap/leap_server.dart sdk/lib/_internal/compiler/samples/leap/leap.dart sdk/lib/_internal/compiler/samples/darttags/darttags.dart pkg/intl/lib/number_symbols.dart pkg/intl/lib/intl.dart pkg/intl/lib/number_format.dart pkg/intl/lib/date_format.dart pkg/intl/lib/number_symbols_data.dart pkg/intl/lib/date_symbol_data_http_request.dart pkg/intl/lib/intl_browser.dart pkg/intl/lib/bidi_utils.dart pkg/intl/lib/date_symbol_data_local.dart pkg/intl/lib/date_time_patterns.dart pkg/intl/lib/message_lookup_by_library.dart pkg/intl/lib/date_symbol_data_file.dart pkg/intl/lib/extract_messages.dart pkg/intl/lib/generate_localized.dart pkg/intl/lib/bidi_formatter.dart pkg/intl/lib/date_symbols.dart pkg/intl/lib/intl_standalone.dart pkg/intl/lib/src/date_format_helpers.dart pkg/intl/lib/src/http_request_data_reader.dart pkg/intl/lib/src/file_data_reader.dart pkg/intl/lib/src/date_format_internal.dart pkg/intl/lib/src/intl_message.dart pkg/intl/lib/src/intl_helpers.dart pkg/intl/lib/src/date_format_field.dart pkg/intl/lib/src/lazy_locale_data.dart pkg/intl/lib/src/data/dates/localeList.dart pkg/intl/test/date_time_format_local_odd_test.dart pkg/intl/test/data_directory.dart pkg/intl/test/date_time_format_local_even_test.dart pkg/intl/test/intl_message_basic_example_test.dart pkg/intl/test/number_test_data.dart pkg/intl/test/bidi_utils_test.dart pkg/intl/test/date_time_format_test_data.dart pkg/intl/test/number_closure_test.dart pkg/intl/test/date_time_format_file_even_test.dart pkg/intl/test/number_format_test.dart pkg/intl/test/intl_test.dart pkg/intl/test/find_default_locale_standalone_test.dart pkg/intl/test/date_time_format_test_core.dart pkg/intl/test/date_time_format_http_request_test.dart pkg/intl/test/date_time_format_uninitialized_test.dart pkg/intl/test/date_time_format_test_stub.dart pkg/intl/test/find_default_locale_browser_test.dart pkg/intl/test/bidi_format_test.dart pkg/intl/test/date_time_format_file_odd_test.dart pkg/intl/test/message_extraction/generate_from_json.dart pkg/intl/test/message_extraction/sample_with_messages.dart pkg/intl/test/message_extraction/make_hardcoded_translation.dart pkg/intl/test/message_extraction/part_of_sample_with_messages.dart pkg/intl/test/message_extraction/extract_to_json.dart pkg/intl/test/message_extraction/message_extraction_test.dart pkg/intl/tool/generate_locale_data_files.dart pkg/intl/example/basic/basic_example_runner.dart pkg/intl/example/basic/basic_example.dart pkg/intl/example/basic/messages_de.dart pkg/intl/example/basic/messages_all.dart pkg/intl/example/basic/messages_th_th.dart pkg/serialization/lib/serialization.dart pkg/serialization/lib/src/format.dart pkg/serialization/lib/src/serialization_rule.dart pkg/serialization/lib/src/serialization_helpers.dart pkg/serialization/lib/src/mirrors_helpers.dart pkg/serialization/lib/src/basic_rule.dart pkg/serialization/lib/src/reader_writer.dart pkg/serialization/test/serialization_test.dart pkg/serialization/test/test_models.dart pkg/serialization/test/polyfill_identity_map_test.dart pkg/serialization/test/no_library_test.dart pkg/analyzer_experimental/bin/analyzer.dart pkg/analyzer_experimental/lib/options.dart pkg/analyzer_experimental/lib/analyzer.dart pkg/analyzer_experimental/lib/src/utils.dart pkg/analyzer_experimental/lib/src/error_formatter.dart pkg/analyzer_experimental/lib/src/analyzer_impl.dart pkg/analyzer_experimental/lib/src/error.dart pkg/analyzer_experimental/lib/src/generated/constant.dart pkg/analyzer_experimental/lib/src/generated/utilities_dart.dart pkg/analyzer_experimental/lib/src/generated/instrumentation.dart pkg/analyzer_experimental/lib/src/generated/source_io.dart pkg/analyzer_experimental/lib/src/generated/ast.dart pkg/analyzer_experimental/lib/src/generated/sdk.dart pkg/analyzer_experimental/lib/src/generated/element.dart pkg/analyzer_experimental/lib/src/generated/engine.dart pkg/analyzer_experimental/lib/src/generated/scanner.dart pkg/analyzer_experimental/lib/src/generated/java_core.dart pkg/analyzer_experimental/lib/src/generated/java_engine.dart pkg/analyzer_experimental/lib/src/generated/java_io.dart pkg/analyzer_experimental/lib/src/generated/parser.dart pkg/analyzer_experimental/lib/src/generated/java_junit.dart pkg/analyzer_experimental/lib/src/generated/sdk_io.dart pkg/analyzer_experimental/lib/src/generated/html.dart pkg/analyzer_experimental/lib/src/generated/java_engine_io.dart pkg/analyzer_experimental/lib/src/generated/error.dart pkg/analyzer_experimental/lib/src/generated/source.dart pkg/analyzer_experimental/lib/src/generated/resolver.dart pkg/analyzer_experimental/test/utils.dart pkg/analyzer_experimental/test/error_test.dart pkg/analyzer_experimental/test/options_test.dart pkg/analyzer_experimental/test/generated/resolver_test.dart pkg/analyzer_experimental/test/generated/scanner_test.dart pkg/analyzer_experimental/test/generated/element_test.dart pkg/analyzer_experimental/test/generated/ast_test.dart pkg/analyzer_experimental/test/generated/test_support.dart pkg/analyzer_experimental/test/generated/parser_test.dart pkg/analyzer_experimental/example/scanner_driver.dart pkg/analyzer_experimental/example/resolver_driver.dart pkg/analyzer_experimental/example/parser_driver.dart pkg/webdriver/lib/webdriver.dart pkg/webdriver/lib/src/base64decoder.dart pkg/webdriver/test/webdriver_test.dart pkg/fixnum/lib/fixnum.dart pkg/fixnum/lib/src/int64.dart pkg/fixnum/lib/src/intx.dart pkg/fixnum/lib/src/int32.dart pkg/fixnum/test/int_32_test.dart pkg/fixnum/test/int_64_vm_test.dart pkg/fixnum/test/int_64_test.dart pkg/pathos/lib/path.dart pkg/pathos/test/pathos_test.dart pkg/pathos/test/pathos_windows_test.dart pkg/pathos/test/pathos_posix_test.dart pkg/crypto/lib/crypto.dart pkg/crypto/lib/src/crypto_utils.dart pkg/crypto/lib/src/hmac.dart pkg/crypto/lib/src/sha1.dart pkg/crypto/lib/src/hash_utils.dart pkg/crypto/lib/src/md5.dart pkg/crypto/lib/src/sha256.dart pkg/meta/lib/meta.dart pkg/oauth2/lib/oauth2.dart pkg/oauth2/lib/src/utils.dart pkg/oauth2/lib/src/expiration_exception.dart pkg/oauth2/lib/src/credentials.dart pkg/oauth2/lib/src/authorization_exception.dart pkg/oauth2/lib/src/authorization_code_grant.dart pkg/oauth2/lib/src/handle_access_token_response.dart pkg/oauth2/lib/src/client.dart pkg/oauth2/test/utils.dart pkg/oauth2/test/handle_access_token_response_test.dart pkg/oauth2/test/authorization_code_grant_test.dart pkg/oauth2/test/client_test.dart pkg/oauth2/test/utils_test.dart pkg/oauth2/test/credentials_test.dart pkg/http/lib/http.dart pkg/http/lib/testing.dart pkg/http/lib/src/io_client.dart pkg/http/lib/src/utils.dart pkg/http/lib/src/base_request.dart pkg/http/lib/src/streamed_response.dart pkg/http/lib/src/byte_stream.dart pkg/http/lib/src/base_client.dart pkg/http/lib/src/streamed_request.dart pkg/http/lib/src/base_response.dart pkg/http/lib/src/mock_client.dart pkg/http/lib/src/response.dart pkg/http/lib/src/request.dart pkg/http/lib/src/client.dart pkg/http/lib/src/multipart_file.dart pkg/http/lib/src/multipart_request.dart pkg/http/test/mock_client_test.dart pkg/http/test/utils.dart pkg/http/test/streamed_request_test.dart pkg/http/test/multipart_test.dart pkg/http/test/client_test.dart pkg/http/test/http_test.dart pkg/http/test/request_test.dart pkg/http/test/response_test.dart pkg/http/test/safe_http_server.dart pkg/expect/lib/expect.dart pkg/mdv_observe/lib/mdv_observe.dart pkg/mdv_observe/lib/src/observable_list.dart pkg/mdv_observe/lib/src/observable_map.dart pkg/mdv_observe/lib/src/observable_box.dart pkg/mdv_observe/test/utils.dart pkg/mdv_observe/test/list_change_test.dart pkg/mdv_observe/test/observable_list_test.dart pkg/mdv_observe/test/observe_test.dart pkg/mdv_observe/test/observable_map_test.dart pkg/logging/lib/logging.dart pkg/logging/test/logging_test.dart pkg/stack_trace/lib/stack_trace.dart pkg/stack_trace/lib/src/utils.dart pkg/stack_trace/lib/src/lazy_trace.dart pkg/stack_trace/lib/src/trace.dart pkg/stack_trace/lib/src/frame.dart pkg/stack_trace/test/frame_test.dart pkg/stack_trace/test/trace_test.dart pkg/yaml/lib/yaml.dart pkg/yaml/lib/src/composer.dart pkg/yaml/lib/src/utils.dart pkg/yaml/lib/src/yaml_exception.dart pkg/yaml/lib/src/deep_equals.dart pkg/yaml/lib/src/visitor.dart pkg/yaml/lib/src/yaml_map.dart pkg/yaml/lib/src/parser.dart pkg/yaml/lib/src/model.dart pkg/yaml/lib/src/constructor.dart pkg/yaml/test/yaml_test.dart pkg/scheduled_test/lib/scheduled_test.dart pkg/scheduled_test/lib/scheduled_process.dart pkg/scheduled_test/lib/scheduled_server.dart pkg/scheduled_test/lib/descriptor.dart pkg/scheduled_test/lib/src/utils.dart pkg/scheduled_test/lib/src/schedule_error.dart pkg/scheduled_test/lib/src/task.dart pkg/scheduled_test/lib/src/substitute_future.dart pkg/scheduled_test/lib/src/scheduled_future_matchers.dart pkg/scheduled_test/lib/src/value_future.dart pkg/scheduled_test/lib/src/mock_clock.dart pkg/scheduled_test/lib/src/future_group.dart pkg/scheduled_test/lib/src/schedule.dart pkg/scheduled_test/lib/src/scheduled_server/handler.dart pkg/scheduled_test/lib/src/scheduled_server/safe_http_server.dart pkg/scheduled_test/lib/src/descriptor/directory_descriptor.dart pkg/scheduled_test/lib/src/descriptor/async_descriptor.dart pkg/scheduled_test/lib/src/descriptor/nothing_descriptor.dart pkg/scheduled_test/lib/src/descriptor/descriptor.dart pkg/scheduled_test/lib/src/descriptor/file_descriptor.dart pkg/scheduled_test/lib/src/descriptor/pattern_descriptor.dart pkg/scheduled_test/test/utils.dart pkg/scheduled_test/test/substitute_future_test.dart pkg/scheduled_test/test/scheduled_server_test.dart pkg/scheduled_test/test/scheduled_future_matchers_test.dart pkg/scheduled_test/test/metatest.dart pkg/scheduled_test/test/value_future_test.dart pkg/scheduled_test/test/scheduled_process_test.dart pkg/scheduled_test/test/descriptor/utils.dart pkg/scheduled_test/test/descriptor/file_test.dart pkg/scheduled_test/test/descriptor/nothing_test.dart pkg/scheduled_test/test/descriptor/pattern_test.dart pkg/scheduled_test/test/descriptor/directory_test.dart pkg/scheduled_test/test/descriptor/async_test.dart pkg/scheduled_test/test/scheduled_test/current_schedule_state_test.dart pkg/scheduled_test/test/scheduled_test/current_schedule_current_task_test.dart pkg/scheduled_test/test/scheduled_test/nested_task_test.dart pkg/scheduled_test/test/scheduled_test/on_exception_test.dart pkg/scheduled_test/test/scheduled_test/task_return_value_test.dart pkg/scheduled_test/test/scheduled_test/abort_test.dart pkg/scheduled_test/test/scheduled_test/timeout_test.dart pkg/scheduled_test/test/scheduled_test/out_of_band_task_test.dart pkg/scheduled_test/test/scheduled_test/wrap_async_test.dart pkg/scheduled_test/test/scheduled_test/wrap_future_test.dart pkg/scheduled_test/test/scheduled_test/signal_error_test.dart pkg/scheduled_test/test/scheduled_test/set_up_test.dart pkg/scheduled_test/test/scheduled_test/on_complete_test.dart pkg/scheduled_test/test/scheduled_test/simple_test.dart pkg/scheduled_test/test/scheduled_test/current_schedule_errors_test.dart pkg/unittest/lib/unittest.dart pkg/unittest/lib/html_individual_config.dart pkg/unittest/lib/vm_config.dart pkg/unittest/lib/html_enhanced_config.dart pkg/unittest/lib/matcher.dart pkg/unittest/lib/interactive_html_config.dart pkg/unittest/lib/mock.dart pkg/unittest/lib/html_config.dart pkg/unittest/lib/compact_vm_config.dart pkg/unittest/lib/src/expect.dart pkg/unittest/lib/src/basematcher.dart pkg/unittest/lib/src/utils.dart pkg/unittest/lib/src/string_matchers.dart pkg/unittest/lib/src/pretty_print.dart pkg/unittest/lib/src/core_matchers.dart pkg/unittest/lib/src/interfaces.dart pkg/unittest/lib/src/description.dart pkg/unittest/lib/src/future_matchers.dart pkg/unittest/lib/src/numeric_matchers.dart pkg/unittest/lib/src/iterable_matchers.dart pkg/unittest/lib/src/map_matchers.dart pkg/unittest/lib/src/config.dart pkg/unittest/lib/src/test_case.dart pkg/unittest/lib/src/operator_matchers.dart pkg/unittest/test/mock_regexp_negative_test.dart pkg/unittest/test/matchers_minified_test.dart pkg/unittest/test/matchers_test.dart pkg/unittest/test/unittest_test.dart pkg/unittest/test/matchers_unminified_test.dart pkg/unittest/test/test_common.dart pkg/unittest/test/test_utils.dart pkg/unittest/test/pretty_print_test.dart pkg/unittest/test/pretty_print_minified_test.dart pkg/unittest/test/instance_test.dart pkg/unittest/test/pretty_print_unminified_test.dart pkg/unittest/test/mock_test.dart pkg/unittest/test/mock_stepwise_negative_test.dart pkg/args/lib/args.dart pkg/args/lib/src/parser.dart pkg/args/lib/src/usage.dart pkg/args/test/args_test.dart pkg/args/test/usage_test.dart pkg/args/test/command_test.dart pkg/args/test/parse_test.dart pkg/args/example/test_runner.dart pkg/source_maps/lib/span.dart pkg/source_maps/lib/source_maps.dart pkg/source_maps/lib/parser.dart pkg/source_maps/lib/builder.dart pkg/source_maps/lib/printer.dart pkg/source_maps/lib/src/utils.dart pkg/source_maps/lib/src/vlq.dart pkg/source_maps/test/vlq_test.dart pkg/source_maps/test/run.dart pkg/source_maps/test/builder_test.dart pkg/source_maps/test/utils_test.dart pkg/source_maps/test/common.dart pkg/source_maps/test/parser_test.dart pkg/source_maps/test/printer_test.dart pkg/source_maps/test/span_test.dart pkg/source_maps/test/end2end_test.dart FORCE_DO_CMD
+ $(call do_cmd,dart_utils_pub_pub_gyp_pub_target_generate_pub_snapshot)
+
+all_deps += $(obj)/gen/pub.dart.snapshot
+action_dart_utils_pub_pub_gyp_pub_target_generate_pub_snapshot_outputs := $(obj)/gen/pub.dart.snapshot
+
+
+### Rules for final target.
+# Build our special outputs first.
+$(obj).target/utils/pub/pub.stamp: | $(action_dart_utils_pub_pub_gyp_pub_target_generate_pub_snapshot_outputs)
+
+# Preserve order dependency of special output on deps.
+$(action_dart_utils_pub_pub_gyp_pub_target_generate_pub_snapshot_outputs): | $(builddir)/dart $(obj).target/pkg/pkg_packages.stamp
+
+$(obj).target/utils/pub/pub.stamp: TOOLSET := $(TOOLSET)
+$(obj).target/utils/pub/pub.stamp: $(builddir)/dart $(obj).target/pkg/pkg_packages.stamp FORCE_DO_CMD
+ $(call do_cmd,touch)
+
+all_deps += $(obj).target/utils/pub/pub.stamp
+# Add target alias
+.PHONY: pub
+pub: $(obj).target/utils/pub/pub.stamp
+
+# Add target alias to "all" target.
+.PHONY: all
+all: pub
+
diff --git a/utils/pub/solver/greedy_solver.dart b/utils/pub/solver/greedy_solver.dart
new file mode 100644
index 0000000..e664ea2
--- /dev/null
+++ b/utils/pub/solver/greedy_solver.dart
@@ -0,0 +1,556 @@
+// Copyright (c) 2012, 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.
+
+/// Attempts to resolve a set of version constraints for a package dependency
+/// graph and select an appropriate set of best specific versions for all
+/// dependent packages. It works iteratively and tries to reach a stable
+/// solution where the constraints of all dependencies are met. If it fails to
+/// reach a solution after a certain number of iterations, it assumes the
+/// dependency graph is unstable and reports and error.
+///
+/// There are two fundamental operations in the process of iterating over the
+/// graph:
+///
+/// 1. Changing the selected concrete version of some package. (This includes
+/// adding and removing a package too, which is considering changing the
+/// version to or from "none".) In other words, a node has changed.
+/// 2. Changing the version constraint that one package places on another. In
+/// other words, and edge has changed.
+///
+/// Both of these events have a corresponding (potentional) async operation and
+/// roughly cycle back and forth between each other. When we change the version
+/// of package changes, we asynchronously load the pubspec for the new version.
+/// When that's done, we compare the dependencies of the new version versus the
+/// old one. For everything that differs, we change those constraints between
+/// this package and that dependency.
+///
+/// When a constraint on a package changes, we re-calculate the overall
+/// constraint on that package. I.e. with a shared dependency, we intersect all
+/// of the constraints that its depending packages place on it. If that overall
+/// constraint changes (say from "<3.0.0" to "<2.5.0"), then the currently
+/// picked version for that package may fall outside of the new constraint. If
+/// that happens, we find the new best version that meets the updated constraint
+/// and then the change the package to use that version. That cycles back up to
+/// the beginning again.
+library version_solver1;
+
+import 'dart:async';
+import 'dart:collection' show Queue;
+import 'dart:math' as math;
+
+import '../lock_file.dart';
+import '../log.dart' as log;
+import '../package.dart';
+import '../source.dart';
+import '../source_registry.dart';
+import '../version.dart';
+import 'version_solver.dart';
+
+class GreedyVersionSolver extends VersionSolver {
+ final _packages = <String, DependencyNode>{};
+ final _work = new Queue<WorkItem>();
+ int _numIterations = 0;
+
+ GreedyVersionSolver(SourceRegistry sources, Package root, LockFile lockFile,
+ List<String> useLatest)
+ : super(sources, root, lockFile, useLatest);
+
+ /// The non-backtracking solver always only tries one solution.
+ int get attemptedSolutions => 1;
+
+ void forceLatestVersion(String package) {
+ // TODO(nweiz): How do we want to detect and handle unknown dependencies
+ // here?
+ getDependency(package).useLatestVersion = true;
+ }
+
+ Future<List<PackageId>> runSolver() {
+ // Kick off the work by adding the root package at its concrete version to
+ // the dependency graph.
+ enqueue(new AddConstraint('(entrypoint)', new PackageRef.root(root)));
+
+ Future processNextWorkItem(_) {
+ while (true) {
+ // Stop if we are done.
+ if (_work.isEmpty) return new Future.value(buildResults());
+
+ // If we appear to be stuck in a loop, then we probably have an unstable
+ // graph, bail. We guess this based on a rough heuristic that it should
+ // only take a certain number of steps to solve a graph with a given
+ // number of connections.
+ // TODO(rnystrom): These numbers here are magic and arbitrary. Tune
+ // when we have a better picture of real-world package topologies.
+ _numIterations++;
+ if (_numIterations > math.max(50, _packages.length * 5)) {
+ throw new CouldNotSolveException();
+ }
+
+ // Run the first work item.
+ var future = _work.removeFirst().process(this);
+
+ // If we have an async operation to perform, chain the loop to resume
+ // when it's done. Otherwise, just loop synchronously.
+ if (future != null) {
+ return future.then(processNextWorkItem);
+ }
+ }
+ }
+
+ return processNextWorkItem(null);
+ }
+
+ void enqueue(WorkItem work) {
+ _work.add(work);
+ }
+
+ DependencyNode getDependency(String package) {
+ // There can be unused dependencies in the graph, so just create an empty
+ // one if needed.
+ _packages.putIfAbsent(package, () => new DependencyNode(package));
+ return _packages[package];
+ }
+
+ /// Sets the best selected version of [package] to [version].
+ void setVersion(String package, Version version) {
+ _packages[package].version = version;
+ }
+
+ /// Returns the most recent version of [dependency] that satisfies all of its
+ /// version constraints.
+ Future<Version> getBestVersion(DependencyNode dependency) {
+ return cache.getVersions(dependency.name,
+ dependency.source, dependency.description).then((versions) {
+ var best = null;
+ for (var ref in versions) {
+ if (dependency.useLatestVersion ||
+ dependency.constraint.allows(ref.version)) {
+ if (best == null || ref.version > best) best = ref.version;
+ }
+ }
+
+ // TODO(rnystrom): Better exception.
+ if (best == null) {
+ if (tryUnlockDepender(dependency)) return null;
+ throw new NoVersionException(dependency.name, dependency.constraint,
+ dependency.toList());
+ } else if (!dependency.constraint.allows(best)) {
+ if (tryUnlockDepender(dependency)) return null;
+ throw new CouldNotUpdateException(
+ dependency.name, dependency.constraint, best);
+ }
+
+ return best;
+ });
+ }
+
+ /// Looks for a package that depends (transitively) on [dependency] and has
+ /// its version locked in the lockfile. If one is found, enqueues an
+ /// [UnlockPackage] work item for it and returns true. Otherwise, returns
+ /// false.
+ ///
+ /// This does a breadth-first search; immediate dependers will be unlocked
+ /// first, followed by transitive dependers.
+ bool tryUnlockDepender(DependencyNode dependency, [Set<String> seen]) {
+ if (seen == null) seen = new Set();
+ // Avoid an infinite loop if there are circular dependencies.
+ if (seen.contains(dependency.name)) return false;
+ seen.add(dependency.name);
+
+ for (var dependerName in dependency.dependers) {
+ var depender = getDependency(dependerName);
+ var locked = lockFile.packages[dependerName];
+ if (locked != null && depender.version == locked.version &&
+ depender.source.name == locked.source.name) {
+ enqueue(new UnlockPackage(depender));
+ return true;
+ }
+ }
+
+ return dependency.dependers.map(getDependency).any((subdependency) =>
+ tryUnlockDepender(subdependency, seen));
+ }
+
+ List<PackageId> buildResults() {
+ return _packages.values
+ .where((dep) => dep.isDependedOn)
+ .map(_dependencyToPackageId)
+ .toList();
+ }
+
+ PackageId _dependencyToPackageId(DependencyNode dep) {
+ var description = dep.description;
+
+ // If the lockfile contains a fully-resolved description for the package,
+ // use that. This allows e.g. Git to ensure that the same commit is used.
+ var lockedPackage = lockFile.packages[dep.name];
+ if (lockedPackage != null && lockedPackage.version == dep.version &&
+ lockedPackage.source.name == dep.source.name &&
+ dep.source.descriptionsEqual(
+ description, lockedPackage.description)) {
+ description = lockedPackage.description;
+ }
+
+ return new PackageId(dep.name, dep.source, dep.version, description);
+ }
+}
+
+/// The constraint solver works by iteratively processing a queue of work items.
+/// Each item is a single atomic change to the dependency graph. Handling them
+/// in a queue lets us handle asynchrony (resolving versions requires
+/// information from servers) as well as avoid deeply nested recursion.
+abstract class WorkItem {
+ /// Processes this work item. Returns a future that completes when the work is
+ /// done. If `null` is returned, that means the work has completed
+ /// synchronously and the next item can be started immediately.
+ Future process(GreedyVersionSolver solver);
+}
+
+/// The best selected version for a package has changed to [version]. If the
+/// previous version of the package is `null`, that means the package is being
+/// added to the graph. If [version] is `null`, it is being removed.
+class ChangeVersion implements WorkItem {
+ /// The name of the package whose version is being changed.
+ final String package;
+
+ /// The source of the package whose version is changing.
+ final Source source;
+
+ /// The description identifying the package whose version is changing.
+ final description;
+
+ /// The new selected version.
+ final Version version;
+
+ ChangeVersion(this.package, this.source, this.description, this.version);
+
+ Future process(GreedyVersionSolver solver) {
+ log.fine("Changing $package to version $version.");
+
+ var dependency = solver.getDependency(package);
+ var oldVersion = dependency.version;
+ solver.setVersion(package, version);
+
+ // The dependencies between the old and new version may be different. Walk
+ // them both and update any constraints that differ between the two.
+ return Future.wait([
+ getDependencyRefs(solver, oldVersion),
+ getDependencyRefs(solver, version)]).then((list) {
+ var oldDependencyRefs = list[0];
+ var newDependencyRefs = list[1];
+
+ for (var oldRef in oldDependencyRefs.values) {
+ if (newDependencyRefs.containsKey(oldRef.name)) {
+ // The dependency is in both versions of this package, but its
+ // constraint may have changed.
+ var newRef = newDependencyRefs.remove(oldRef.name);
+ solver.enqueue(new AddConstraint(package, newRef));
+ } else {
+ // The dependency is not in the new version of the package, so just
+ // remove its constraint.
+ solver.enqueue(new RemoveConstraint(package, oldRef.name));
+ }
+ }
+
+ // Everything that's left is a depdendency that's only in the new
+ // version of the package.
+ for (var newRef in newDependencyRefs.values) {
+ solver.enqueue(new AddConstraint(package, newRef));
+ }
+ });
+ }
+
+ /// Get the dependencies at [version] of the package being changed.
+ Future<Map<String, PackageRef>> getDependencyRefs(VersionSolver solver,
+ Version version) {
+ // If there is no version, it means no package, so no dependencies.
+ if (version == null) {
+ return new Future<Map<String, PackageRef>>.value(<String, PackageRef>{});
+ }
+
+ var id = new PackageId(package, source, version, description);
+ return solver.cache.getPubspec(id).then((pubspec) {
+ var dependencies = <String, PackageRef>{};
+ for (var dependency in pubspec.dependencies) {
+ dependencies[dependency.name] = dependency;
+ }
+
+ // Include dev dependencies only from the root package.
+ if (id.isRoot) {
+ for (var dependency in pubspec.devDependencies) {
+ dependencies[dependency.name] = dependency;
+ }
+ }
+
+ return dependencies;
+ });
+ }
+}
+
+/// A constraint that a depending package places on a dependent package has
+/// changed.
+///
+/// This is an abstract class that contains logic for updating the dependency
+/// graph once a dependency has changed. Changing the dependency is the
+/// responsibility of subclasses.
+abstract class ChangeConstraint implements WorkItem {
+ Future process(GreedyVersionSolver solver);
+
+ void undo(GreedyVersionSolver solver);
+
+ Future _processChange(GreedyVersionSolver solver,
+ DependencyNode oldDependency,
+ DependencyNode newDependency) {
+ var name = newDependency.name;
+ var source = oldDependency.source != null ?
+ oldDependency.source : newDependency.source;
+ var description = oldDependency.description != null ?
+ oldDependency.description : newDependency.description;
+ var oldConstraint = oldDependency.constraint;
+ var newConstraint = newDependency.constraint;
+
+ // If the package is over-constrained, i.e. the packages depending have
+ // disjoint constraints, then try unlocking a depender that's locked by the
+ // lockfile. If there are no remaining locked dependencies, throw an error.
+ if (newConstraint != null && newConstraint.isEmpty) {
+ if (solver.tryUnlockDepender(newDependency)) {
+ undo(solver);
+ return null;
+ }
+
+ throw new DisjointConstraintException(name, newDependency.toList());
+ }
+
+ // If this constraint change didn't cause the overall constraint on the
+ // package to change, then we don't need to do any further work.
+ if (oldConstraint == newConstraint) return null;
+
+ // If the dependency has been cut free from the graph, just remove it.
+ if (!newDependency.isDependedOn) {
+ solver.enqueue(new ChangeVersion(name, source, description, null));
+ return null;
+ }
+
+ // If the dependency is on the root package, then we don't need to do
+ // anything since it's already at the best version.
+ if (name == solver.root.name) {
+ solver.enqueue(new ChangeVersion(
+ name, source, description, solver.root.version));
+ return null;
+ }
+
+ // If the dependency is on a package in the lockfile, use the lockfile's
+ // version for that package if it's valid given the other constraints.
+ var lockedPackage = solver.lockFile.packages[name];
+ if (lockedPackage != null && newDependency.source == lockedPackage.source) {
+ var lockedVersion = lockedPackage.version;
+ if (newConstraint.allows(lockedVersion)) {
+ solver.enqueue(
+ new ChangeVersion(name, source, description, lockedVersion));
+ return null;
+ }
+ }
+
+ // The constraint has changed, so see what the best version of the package
+ // that meets the new constraint is.
+ return solver.getBestVersion(newDependency).then((best) {
+ if (best == null) {
+ undo(solver);
+ } else if (newDependency.version != best) {
+ solver.enqueue(new ChangeVersion(name, source, description, best));
+ }
+ });
+ }
+}
+
+/// The constraint given by [ref] is being placed by [depender].
+class AddConstraint extends ChangeConstraint {
+ /// The package that has the dependency.
+ final String depender;
+
+ /// The package being depended on and the constraints being placed on it. The
+ /// source, version, and description in this ref are all considered
+ /// constraints on the dependent package.
+ final PackageRef ref;
+
+ AddConstraint(this.depender, this.ref);
+
+ Future process(GreedyVersionSolver solver) {
+ log.fine("Adding $depender's constraint $ref.");
+
+ var dependency = solver.getDependency(ref.name);
+ var oldDependency = dependency.clone();
+ dependency.placeConstraint(depender, ref);
+ return _processChange(solver, oldDependency, dependency);
+ }
+
+ void undo(GreedyVersionSolver solver) {
+ solver.getDependency(ref.name).removeConstraint(depender);
+ }
+}
+
+/// [depender] is no longer placing a constraint on [dependent].
+class RemoveConstraint extends ChangeConstraint {
+ /// The package that was placing a constraint on [dependent].
+ String depender;
+
+ /// The package that was being depended on.
+ String dependent;
+
+ /// The constraint that was removed.
+ PackageRef _removed;
+
+ RemoveConstraint(this.depender, this.dependent);
+
+ Future process(GreedyVersionSolver solver) {
+ log.fine("Removing $depender's constraint ($_removed) on $dependent.");
+
+ var dependency = solver.getDependency(dependent);
+ var oldDependency = dependency.clone();
+ _removed = dependency.removeConstraint(depender);
+ return _processChange(solver, oldDependency, dependency);
+ }
+
+ void undo(GreedyVersionSolver solver) {
+ solver.getDependency(dependent).placeConstraint(depender, _removed);
+ }
+}
+
+/// [package]'s version is no longer constrained by the lockfile.
+class UnlockPackage implements WorkItem {
+ /// The package being unlocked.
+ DependencyNode package;
+
+ UnlockPackage(this.package);
+
+ Future process(GreedyVersionSolver solver) {
+ log.fine("Unlocking ${package.name}.");
+
+ solver.lockFile.packages.remove(package.name);
+ return solver.getBestVersion(package).then((best) {
+ if (best == null) return null;
+ solver.enqueue(new ChangeVersion(
+ package.name, package.source, package.description, best));
+ });
+ }
+}
+
+/// Describes one [Package] in the [DependencyGraph] and keeps track of which
+/// packages depend on it and what constraints they place on it.
+class DependencyNode {
+ /// The name of the this dependency's package.
+ final String name;
+
+ /// The [PackageRefs] that represent constraints that depending packages have
+ /// placed on this one.
+ final Map<String, PackageRef> _refs;
+
+ /// The currently-selected best version for this dependency.
+ Version version;
+
+ /// Whether this dependency should always select the latest version.
+ bool useLatestVersion = false;
+
+ /// Gets whether or not any other packages are currently depending on this
+ /// one. If `false`, then it means this package is not part of the dependency
+ /// graph and should be omitted.
+ bool get isDependedOn => !_refs.isEmpty;
+
+ /// The names of all the packages that depend on this dependency.
+ Iterable<String> get dependers => _refs.keys;
+
+ /// Gets the overall constraint that all packages are placing on this one.
+ /// If no packages have a constraint on this one (which can happen when this
+ /// package is in the process of being added to the graph), returns `null`.
+ VersionConstraint get constraint {
+ if (_refs.isEmpty) return null;
+ return new VersionConstraint.intersection(
+ _refs.values.map((ref) => ref.constraint));
+ }
+
+ /// The source of this dependency's package.
+ Source get source {
+ var canonical = _canonicalRef();
+ if (canonical == null) return null;
+ return canonical.source;
+ }
+
+ /// The description of this dependency's package.
+ get description {
+ var canonical = _canonicalRef();
+ if (canonical == null) return null;
+ return canonical.description;
+ }
+
+ /// Return the PackageRef that has the canonical source and description for
+ /// this package. If any dependency is on the root package, that will be used;
+ /// otherwise, it will be the source and description that all dependencies
+ /// agree upon.
+ PackageRef _canonicalRef() {
+ if (_refs.isEmpty) return null;
+ var refs = _refs.values;
+ for (var ref in refs) {
+ if (ref.isRoot) return ref;
+ }
+ return refs.first;
+ }
+
+ DependencyNode(this.name)
+ : _refs = <String, PackageRef>{};
+
+ DependencyNode._clone(DependencyNode other)
+ : name = other.name,
+ version = other.version,
+ _refs = new Map<String, PackageRef>.from(other._refs);
+
+ /// Creates a copy of this dependency.
+ DependencyNode clone() => new DependencyNode._clone(this);
+
+ /// Places [ref] as a constraint from [package] onto this.
+ void placeConstraint(String package, PackageRef ref) {
+ var requiredDepender = _requiredDepender();
+ if (requiredDepender != null) {
+ var required = _refs[requiredDepender];
+ if (required.source.name != ref.source.name) {
+ throw new SourceMismatchException(name, [
+ new Dependency(requiredDepender, required),
+ new Dependency(package, ref)]);
+ } else if (!required.descriptionEquals(ref)) {
+ throw new DescriptionMismatchException(name, [
+ new Dependency(requiredDepender, required),
+ new Dependency(package, ref)]);
+ }
+ }
+
+ _refs[package] = ref;
+ }
+
+ /// Returns the name of a package whose constraint source and description
+ /// all other constraints must match. Returns null if there are no
+ /// requirements on new constraints.
+ String _requiredDepender() {
+ if (_refs.isEmpty) return null;
+
+ var dependers = _refs.keys.toList();
+ if (dependers.length == 1) {
+ var depender = dependers[0];
+ if (_refs[depender].isRoot) return null;
+ return depender;
+ }
+
+ return dependers[1];
+ }
+
+ /// Removes the constraint from [package] onto this.
+ PackageRef removeConstraint(String package) => _refs.remove(package);
+
+ /// Converts this to a list of [Dependency] objects like the error types
+ /// expect.
+ List<Dependency> toList() {
+ var result = <Dependency>[];
+ _refs.forEach((name, ref) {
+ result.add(new Dependency(name, ref));
+ });
+ return result;
+ }
+}