projects.
I don't know the exact situation that is being hit here and if something else
is going on, or continuing here is sane. It does appear to work though.
Change-Id: I7cbdf59f954ed80e0a9c71430b5661a335e21d9b
Reviewed-on: https://dart-review.googlesource.com/c/85402
Reviewed-by: Peter von der Ahé <ahe@google.com>
Commit-Queue: Jake Macdonald <jakemac@google.com>
This updates more analyzer error codes to be generated
from the corresponding CFE error code.
Several of these analyzer error codes had multiple CFE error
codes mapped to them. In these situations, new analyzer error
codes were added to match the existing CFE error codes:
* EXTERNAL_FACTORY_WITH_BODY
* EXTERNAL_FACTORY_REDIRECTION
* CATCH_SYNTAX_EXTRA_PARAMETERS
Change-Id: Ib1cbb9e04d2092e4859e2cfadbcc85e03093f808
Reviewed-on: https://dart-review.googlesource.com/c/85431
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
We get an AmbiguousBuilder if there are more than one redirecting
factory with the same name. We shouldn't crash though.
Fixes#35266.
Bug: 35266
Change-Id: I1ac0babdde49c4ca3966e6af5c580191baac0873
Reviewed-on: https://dart-review.googlesource.com/c/85390
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
Before this CL, running fasta compile on these 3 tests would make it
crash in type inference because the enclosingClass on a constrcutor
is null:
tests/language_2/const_error_multiply_initialized_test.dart
tests/language_2/constructor_duplicate_final_test.dart
tests/language_2/field3_test.dart
Note that these tests are all multi-tests and they are here run
unprocessed. The compiler crashes only after issuing errors.
The crash likely happens because of multiple definitions of
constructors with the same name.
This is a cut-down version that crashed prior to this CL:
```
class C {
final d;
C() {}
C(this.d) {}
}
```
Fixes#35258.
Change-Id: I350c55428932ef0ae76f78875177b08acf95cdfc
Reviewed-on: https://dart-review.googlesource.com/c/85363
Reviewed-by: Peter von der Ahé <ahe@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
Without this CL we end up putting a null-reference in the tree because
the parent is never set on the redirecting constructor we try pointing
to.
Fixes#35259, #35260.
Change-Id: I8ad520453742ff1de8dd9ca5e619f9edbff9971c
Reviewed-on: https://dart-review.googlesource.com/c/85384
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
Type variable bound violations on constructor/factory invocations
now mention just the class name (which is the one that has the type
variables) instead of the constructor/factory name.
Change-Id: I65330f1921451fef0157be01b4a5086855d80439
Reviewed-on: https://dart-review.googlesource.com/c/85291
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
This gets rid of the useless '#lib1::' prefixes on types in error
messages and instead adds a line to the error message for each
interface type appearing in the message stating where that type
originates.
Name clashes are disambiguated by appending markers like '/*1*/' and
'/*2*/' to the types whenever two interface types with the same name
appear in the same message.
The commonly used core types 'bool', 'num', 'int', 'double', 'String'
and 'Null' are excluded from the origin list unless they take part in a
name clash.
Change-Id: I017ea376d4f6ff2d4f3b36487774463f03bb3301
Reviewed-on: https://dart-review.googlesource.com/c/84604
Reviewed-by: Peter von der Ahé <ahe@google.com>
Adds labels to ambiguous types and generates a bullet list of the
origins of all raw types contained in printed types.
Change-Id: I9b8a46aa8b1f463c6cd02b9df042075fc1c46404
Reviewed-on: https://dart-review.googlesource.com/c/84602
Reviewed-by: Peter von der Ahé <ahe@google.com>
Original commit message:
Rework parseLiteralSetOrMapSuffix to remove expression lookahead
This reworks the set literal support to remove unnecessary lookahead
by removing the listener.beginLiteralMapEntry event
and renaming the listener.endLiteralMapEntry to handleLiteralMapEntry.
Change-Id: I608e94aadc2afb86c772fdc6ef24b0da32c5ddde
Reviewed-on: https://dart-review.googlesource.com/c/85410
Auto-Submit: Paul Berry <paulberry@google.com>
Reviewed-by: Dan Rubel <danrubel@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
Timing how long fasta spends on *reading* files when compiling dart2js
(when compiling via the VM) I get a good speedup:
Difference at 95.0% confidence
-84031.2 +/- 10333.7
-47.4004% +/- 5.82904%
(Student's t, pooled s = 7085.44)
Change-Id: I0bb1a1fe6f9d430b47515b9b319069bf810d0aeb
Reviewed-on: https://dart-review.googlesource.com/c/85442
Reviewed-by: Peter von der Ahé <ahe@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
Previously we had several places where different uriToSource was used.
This was both weird and led to errors when something refering to
some state was used to look up in another state.
This CL makes it so we only have one source of truth.
To not include sdk sources when serializing a component that only mixes
something from the sdk in, (or extends it or...), the serialization is
changed slightly to keep track of which uris come from actual
implementation. Before the sdk sources was explicitly removed in the
incremental compiler, but we want to limit those kinds of things,
which is why we're doing it differently here.
Fixes#35215.
Bug: 35215
Change-Id: Iaa5618fcb0ea42b13aba7720f34a87a85144e047
Reviewed-on: https://dart-review.googlesource.com/c/85175
Reviewed-by: Peter von der Ahé <ahe@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
In the incremental compiler, if asking to invalidate a file via a file
uri, where the corresponding file is a part that has been used via its
package uri (as in "part 'package:foo/whatever.dart'"), we should still
invalidate it.
Before we didn't because we 'translated' the part uri to a 'file uri'
except it was still a package uri.
Now we do.
Change-Id: I276c6e7c772d6167178fa8b6594417d37d1dd1c4
Reviewed-on: https://dart-review.googlesource.com/c/85344
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
This reworks the set literal support to remove unnecessary lookahead
by removing the listener.beginLiteralMapEntry event
and renaming the listener.endLiteralMapEntry to handleLiteralMapEntry.
Change-Id: Ia71fe69359b0447a60d729db34ec35ad25a54750
Reviewed-on: https://dart-review.googlesource.com/c/84661
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>