The implementation for generating symbolic language markers only
handled language versions in the data but not in the code itself.
This fixes this by doing post processing on the whole file instead
of the individual annotations.
Change-Id: I451e39a40a6f1616cbd2ae70550091c19c85fa10
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/365220
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Use `hasScheme` in place of comparing against the empty string, and
`isScheme` to compare against all other schemes.
TEST=No behavior changes.
Change-Id: Ifc9fd13c6cf37933ebd4a754c4b500dedbcb291b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/231185
Reviewed-by: Kevin Moore <kevmoo@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
This CL enables the avoid_void_async lint in the CFE, makes the needed
changes and adds the missing `await` (because the lint
`unawaited_futures` doesn't react to void async methods).
Change-Id: Iffc1f173badd3c2d48356ee02e81a9aed492ce5d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213481
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
* Migrate to python3; drop python support.
* Update Windows toolchain support.
* Remove some unused methods.
* Python 2.7 is still needed on Windows.
* Update gsutil to a version that supports python3.
Fixes: https://github.com/dart-lang/sdk/issues/28793
TEST=Manually tested common user journeys.
Change-Id: I663a22b237a548bb82dc2e601e399e3bc3649211
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192182
Reviewed-by: William Hesse <whesse@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
This CL is a warm-up to a follow-up change that will make running the
CFE trybot faster.
This CL:
* Rename tests that require git (because when working with filesets
and shards in the test system, the "checkout" is not a git checkout
and git commands thus doesn't work properly.
* Filters the front-end unit test setup on the front-end bot the way
it was probably intended, i.e. run tests in pkg/kernel, pkg/front_end
and pkg/fasta (actually, the last one doesn't exist, but still)
instead of just in folders inside the "suite" 'pkg' that somewhere in
the path has something called 'kernel', 'front_end' or 'fasta'.
* Split unit_test_suites.dart into a "forwarding shell" and a impl.
In a follow-up CL the impl will be converted to nnbd to allow for
using 'required' on named parameters, but if the entry point was
nnbd it would run in sound nnbd mode and nothing would compile
because all imports are not nnbd.
Overall this CL should change very little, mostly just run a few less
tests, i.e. for instance skip tests that live inside a folder called
'fasta' somewhere inside the analyzer directory path.
Change-Id: I3226c7261cff8b68cc287cff07dc1715dfd85159
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/181381
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
This adds a language versioning test that shows that the language
version for a package defined in a `.packages` will have version 2.7
and whereas a package defined in a `.packages_config.json` will have
the current language version (2.8 in the test). Therefore the
former will not have the non-nullable experiment enabled even when
the package is in allowed_experiments.json.
Change-Id: Iabf5d6882e21538cfc1237d848bad03a37825dfb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/156000
Reviewed-by: Jens Johansen <jensj@google.com>
This CL adds a package uri to SourceLibraryBuilder based on the
package information computated by package:package_config. This uri is
used to determine whether experimental flags are enabled and thus using
allowed_experiments.json in bin/test folders as well as the lib folder.
Change-Id: I60e6e97139a4a24b8d4d27d314cfc0f7d7bfc816
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152151
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Use the version from tools/experimental_features.yaml as the current
language version (as specified in kernel).
Use the "enabledIn" from tools/experimental_features.yaml to write out
the major and minor version for enabling features. This replaces the
hard-coding of when nnbd is enabled (in front-end).
Change-Id: I5b5dd7c2bb0c1a412ef1e660dfbe61e227193e1b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/138284
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
* Max and default for language version controllable via language options
* Default (if not set) comes from kernel static fields
* Kernel static fields updated to 2.6
* (Also set version for debug expression library)
* Test added that checks that the kernel static fields aren't out-of-date
(checked against python script "tools/make_version.py").
Change-Id: I65f26053081e4c55c215b677128f37fa970693c6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114944
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
In the feature specification v1.2 libraries in a package with a default
version wasn't allowed to specify a language version higher than that.
In v1.3 thats allowed as long as its below the sdk limit.
Change-Id: I85f5c36a9c9c427da03fc540f9175195134ad47f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114604
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
Language versioning specifies that an empty-name-entry in .packages
specifies a sort of "default package" that a non-package file should
pretend to be a part of "for any purpose where that matters,
including choosing the default language level."
Change-Id: I16f4b2f5e4d3ca1e82d2189321e2be5c43e3b260
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112089
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Issue error when the .packages file specifies more than on 'dart=' entry.
Also add another test of the library and part mismatch being an error.
Change-Id: I0a894e6ef86eb9f976b9fbdce67f0c9adb03be9b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112881
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Users of the CFE often need the ClassHierarchy and may CoreTypes after
invoking the CFE. This CL extends the result of `kernelForProgram` and
`kernelForComponent` to a `CompilerResult` that includes these objects.
Change-Id: I08491198fe876b6514e49993ad794388d6662c9c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112259
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
From the feature spec: "Part files must be marked with the same version
as their library. They must always be treated the same way as the
library they belong to, so it is a compile-time error if a part file has
a different language level override than its library. It is also a
compile-time error if a part file has no language version marker,
and the importing library does".
Change-Id: I29805e261e63b89a7d8832770ed2b007fb6df37f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112247
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
From the feature specification: "If an entry contains an invalid dart
version value, #dart=arglebargle or #dart= or any other value which is
not a semantic versioning version, then tools which need the version
should report an error."
Change-Id: Ieb54dbbad6f2fecb341e27b468e3ffdf90717a7c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112245
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Specifying a language version higher than the highest supported version
(aka the default version) is an error.
Specifying a language verison in code that is higher than the one
specified in .packages is an error.
Change-Id: I44e1c8c45cef715038786dbf248925b73bd6cd7c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112240
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
If the .packages file specifies a fragment on a uri on the form
"dart=x.y", x.y becomes the default lanaguage version for libraries in
that package.
Change-Id: I69cb4157fdf5852184cc3519b033c3624792f783
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112082
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
A kernel library will say it has the newest language version if no
language version is set.
This basically preserves the current semantics of always being on the
newest version (if nothing is explicitly done), e.g. if creating a kernel
library by hand and not setting it.
The front_end also utilize this and just doesn't set it, if it isn't set.
Change-Id: I033fef13626ee034030ba8fc9d141b182ba1a5ba
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/111739
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
This CL sets up the bare minimum support for saving the language version
specified in a file on the kernel library, and adds simple support for
testing it.
The data is not serialized out, error checked or similar in this change.
Change-Id: I4b061ce617acae7964b85be105e0ad0e3e031aa4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/111640
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>