This updates the analyzer parser compatibility tests to check for
error codes. Any test that was passing but failed as a result of these
changes was updated to continue passing and a duplicate test'2' added
in the subclass and marked as failing.
R=scheglov@google.com
Review-Url: https://codereview.chromium.org/2990003002 .
This looks at all the files in the batch being migrated. It goes through
the status files in the 1.0 and strong directories. If it sees an entry
that matches that file, it adds it to the resulting "_2" status file.
It handles adding entries to an existing section if already present in
the new status file. Otherwise, it adds a new section at the end with
the entries.
R=bkonyi@google.com
Review-Url: https://codereview.chromium.org/2989033002 .
We use need to verify that we have parameters for parameters, because
we use them when we match AST and element model. Unfortunately, kernel
does not include these parameters (at least at the moment), so we
need to make some more tests as failing.
R=brianwilkerson@google.com, paulberry@google.com
BUG=
Review-Url: https://codereview.chromium.org/2988013004 .
This will enable --use-kernel tests in the dart2js bots.
After this change, running our tests will change a little bit, either of these
would work:
Option A: --use-sdk (host-checked not allowed)
python tools/test.py -m release \
-c dart2js -r d8 --dart2js-batch --report \
--dart2js-with-kernel --use-sdk \
language corelib library_2 corelib_2 \
dart2js_native dart2js_extra
Option B: pass --library-root, --host-check works here.
python tools/test.py -m release \
-c dart2js -r d8 --dart2js-batch --report \
--dart2js-with-kernel --host-checked \
--dart2js_options="--library-root=out/ReleaseX64/dart-sdk/" \
language corelib library_2 corelib_2 \
dart2js_native dart2js_extra
In the future, when fasta supports compiling sdk with @patch files, we will
be able to remove the --library-root option and simply compile the SDK from
sources at that point.
BUG=
R=johnniwinther@google.com
Review-Url: https://codereview.chromium.org/2988063002 .
This CL is identical to the reverted CL 2990703002 which implements
syntactic support for generalized void in the analyzer, plus two bug
fixes in pkg/analyzer/test/generated/parser_test.dart and
pkg/analyzer_cli/test/error_test.dart. In the former, a test on parsing
`void,` was changed to expect an error: _isTypeIdentifier on a lone
`void` will no longer return true, which is necessary because `void`
can now be used as a type annotation alone. Another test on `void x`
was added, which produces the behavior previously seen for `void,`.
In error_test, the error which is used throughout was changed from
`void foo;` to `var int foo;` (because the former is no longer an
error).
Review-Url: https://codereview.chromium.org/2992623002 .
This script lets you dump as text a partial .dill file generated by the
incremental generator. To do so, it requires that you pass in other .dill files
that are needed (in order).
In the context of a hot-reload test, you should be able to run this as follows:
pkg/front_end/tool/fasta dump-ir newProgram.dill fullProgram.dill platform.dill
BUG=
R=scheglov@google.com
Review-Url: https://codereview.chromium.org/2985113002 .
Changed the analyzer parser to accept usages of `void` which were
previously rejected as syntax errors: `void` can now be the type
annotation for a variable or parameter, and it can be an actual type
argument.
Removed affected error codes like VOID_PARAMETER, VOID_VARIABLE,
VOID_RETURN_FOR_GETTER and associated declarations (like checking
functions), and adjusted test cases to expect success rather than
compile time errors.
Adjusted generalized_void_syntax_test.dart (it had real errors like
`final` variables with no initializer etc. that were not detected
when tools would just reject the file as syntactically wrong).
R=brianwilkerson@google.com
Review-Url: https://codereview.chromium.org/2990703002 .
Currently, fasta synthetically closes open braces until it finds
a match for the current closing brace. This works most of the time,
but provides less than optimal recovery in some common cases.
For example, given the following
class { foo()){print(a);} var a = 'hello'; }
the current brace recovery method fails to find any match for the
second closing parenthesis and synthetically closes the class
causing the rest of the file to be parsed as outside the class.
With this CL, fasta still synthetically closes open braces when it finds
a match for the current closing brace, but if there is no match, then
it just skips over the extra closer and continues. This approach dramatically
improves recovery in many cases where there is an extra closing parenthesis
or extra closing square bracket. In the example above, fasta parses
everything after the second closing parenthesis inside the class.
R=paulberry@google.com
Review-Url: https://codereview.chromium.org/2981343002 .
Summary:
Previously, we filled in all occurrences of captured type variables with either
"dynamic" or their bound, if they had one.
Now, we add extra type parameters to the top-level function corresponding to the
closure, and pass in the corresponding arguments as type arguments to the
"MakeClosure" operation.
Test Plan:
Updated [type_variables.dart] and added a new test case to it.
R=dmitryas@google.com
Review-Url: https://codereview.chromium.org/2989563002 .
This required munging a bit of test.dart code too to tease out some
dependencies, but the changes are minor. I considered moving all of
test.dart out into a package and making the status file library a
public one that other packages in the repo could import but this seemed
like the less intrusive change.
R=bkonyi@google.com
Review-Url: https://codereview.chromium.org/2984203002 .
With the new 'sendCachedToStream' option we can control that whether
cached analysis result is also reported into the 'results' stream when
it is desirable (when we do this to send analysis notifications from
the stream listener). Or not, when it is not desirable, e.g. when we
ask becaue we need the results unit for Quick Assists.
R=brianwilkerson@google.com
BUG= https://github.com/dart-lang/sdk/issues/30238
Review-Url: https://codereview.chromium.org/2989633002 .
A few more passes, but perhaps one regression:
Chrome 59.0.3071 (Mac OS X 10.12.5) corelib/date_time10_test FAILED
Error: Expect.equals(at index 1: Expected <0100-01-01 00:00:00.000Z...>, Found: <0099-01-01 00:00:00.000Z...>) fails.
at finish (test/browser/language_tests.js:807:59)
TBR=rnystrom@google.com,jmesserly@google.com
Review-Url: https://codereview.chromium.org/2983403003 .
This also:
- replaces --use-kernel with --use-kernel-in-ssa
- replaces --load-dill with --use-kernel
- makes --use-kernel support both: compiling from .dill or from .dart
- change the default of other options that are currently disabled when --use-kernel is on.
- adds .status lines for all tests in language/corelib/dart2js_extra/dart2js_native
R=efortuna@google.com
Note: this CL is built on top of another change
(https://codereview.chromium.org/2981403002/) that adds preview_dart_2 to
test.dart
Review-Url: https://codereview.chromium.org/2989453002 .
Together with Jen's fix for checking mixin, these are the remaining cases in
dart2js that we need to silence strong mode errors.
For modelz - the plan is to eventually delete this code, so ignoring makes sense
here. For the namer, Stephen believes we should get rid of the special
subclasses, for now I'm just supressing the error.
R=johhniwinther@google.com, sra@google.comCC=jmesserly@google.com
Review-Url: https://codereview.chromium.org/2987783002 .
Previously, the string set up by the embedder was eagerly passed to
Uri.parse during Isolate startup. This is expensive both in time and
memory footprint. This CL causes Uri.parse() to be called only
when needed. This change will allow reducing the memory footprint
of Fuchsia's Dart content handler on hello world by ~1MB.
fixes#25603R=asiva@google.com
Review-Url: https://codereview.chromium.org/2988613002 .
commit 4ed5f6f9d3
Merge: 075833bfb613c0
Author: Bob Nystrom <rnystrom@google.com>
Date: Fri Jul 21 16:08:11 2017 -0700
Merge branch 'master' into ddc-tests-2
commit 075833bbdb
Author: Bob Nystrom <rnystrom@google.com>
Date: Thu Jul 20 18:08:25 2017 -0700
Include migrated "_2" test directories in DDC's codegen_test.
This required a couple of other changes too:
- I renamed "not_yet_strong_tests.dart" to "compile_error_tests.dart"
because it includes some tests that have been made strong mode clean,
but still generate static errors due to bugs in analyzer or ddc.
- Reworded the test failure messages to take the above into account.
- I cleaned up the failure reporting code a bit. There was some
redundancy and unreachable code.
- Triaged the "_2" tests to mark the ones that are failing at compile
time or runtime appropriately. Good news! The big integers tests
compile now! Of course, they don't actually *run* correctly on the
web...
also fixes various bugs:
* setters now use the correct memberName symbol, fixes#30223
* object members work for callable classes, fixes#30213
* some test fixes to work in strong mode
* a few other small cleanups (e.g. obsolete `dart.list` is removed)
R=vsm@google.com
Review-Url: https://codereview.chromium.org/2979353002 .
This is tricky because there isn't a clean correspondence between
analyzer's AST (which reflects user syntax) and kernel representation.
For example:
f(args);
could be a call to a static function f, a method f in the current
class, or an invocation of a function-typed object stored in a
variable called f. ResolutionStorer operates on the kernel
representation, so it sees the difference, but ResolutionApplier
operates on the analyzer AST, so it does not. So we go to some extra
work to make sure a type is stored for f, regardless of whether f is a
function, method, or a variable. This requires some re-ordering logic
in ResolutionStorer, since the inferred type of f is not known until
after the args have been visited.
The implementation is not complete; currently the type that we store
in the first two cases is `dynamic` because the type inference
mechanism doesn't preserve enough information to allow us to determine
the correct type; this will be remidied in a future CL.
A similar situation occurs for:
x.m(args);
which could be a call to a method m in the object x, or an invocation
of a function-typed object returned by the getter m in the object x.
R=scheglov@google.com
Review-Url: https://codereview.chromium.org/2984013002 .
The closure-conversion transformation is not enabled yet. This commit
only adds the support for it to FlowGraphBuilder and
StreamingFlowGraphBuilder. More work should be done before enabling the
transformation; most mportantly, the 'platform.dill' file that is used
in the Kernel isolate and is loaded by VM for linking with executed
programs should be separated. The former should receive a file not
touched by the transformation, and the latter should receive a
transformed one.
BUG=
R=jensj@google.com, karlklose@google.com, kustermann@google.com
Review-Url: https://codereview.chromium.org/2891053003 .
The type inference engine doesn't even see parenthesized expressions
as a separate entity, since parentheses don't have any semantics. So
we just copy the static type from the enclosed expression.
R=scheglov@google.com
Review-Url: https://codereview.chromium.org/2982323003 .
Last time I submitted it I was unable to test my adjustments from sra's suggestions becuase of build permissions (and failed motherboard). It has been tested on my laptop now.
This reverts commit bff25c89fe.
BUG=
R=sra@google.com
Review-Url: https://codereview.chromium.org/2986583002 .
It is informative in the same way as documentation.
Yesterday I tried to make Analyzer and Analysis Server stop using
FieldFormalParameterElement(s) and found one important use case requested
by the Flutter team. We need to show documentation of a field when
user requests documentation on the corresponding field formal named
parameter. This happens outside of the file that declares the parameter
and the field, so we don't have AST available. Of course we could
resolve the unit, but it would cost us something. And if we decide
that it is OK, then maybe we don't need to have documenation comments
in elements at all.
This is of course more convenience, and we could store documentation
and parameter to field mappings outside, like we store index. Just a
compromise - convenience vs. purity.
R=ahe@google.com, kmillikin@google.com, paulberry@google.com, sigmund@google.com
BUG=
Review-Url: https://codereview.chromium.org/2983173002 .
This review scraps the (currently disabled) code for converting tearoffs in the
closure conversion pass.
The closure conversion pass can only ever do a partial job with tearoffs, due to
the possibility of an unconverted library tearing off a method from any object
it likes. Partially converting [PropertyGet]s makes the closure conversion pass
slower and introduces a new method for any field or method anywhere with a name
used in any [PropertyGet], inflating code size and potentially regressing
performance. As it provides no concrete value in return we've decided to scrap
this aspect of the transformation. Anyway, creating closures for tearoffs is
much easier for a backend than converting anonymous or nested functions, since
there is only one object ("this") captured. Thus ignoring tear-offs does not
undermine the value of the transformation.
BUG=
R=dmitryas@google.com
Review-Url: https://codereview.chromium.org/2986553002 .
This CL propagates types from top level variable declarations into
analyzer ASTs.
This required adding a finishFields method to parser listeners (and a
corresponding method DietListener.listenerFinishFields which calls
it); this allows AnalyzerDietListener to thread the types through from
the BodyBuilder to the AstBuilder. This is similar to what we were
already doing for methods.
R=scheglov@google.com
Review-Url: https://codereview.chromium.org/2987503003 .
This technically steals a few tests from the previous batch that spans
corelib and language, but I wanted to start from the top of the language
tests.
Removed application_test and application_negative_test because they are
useless and the latter has never actually worked correctly since the day
it was transliterated from the long-defunct application file syntax.
R=bkonyi@google.com, whesse@google.com
Review-Url: https://codereview.chromium.org/2984443003 .
This is to get the vm-kernel bots go green.
Test failing on the bot: pkg/front_end/test/fasta/analyze_test
This reverts commit dc99692b41.
TBR=efortuna
Review-Url: https://codereview.chromium.org/2983933002 .
My CL broke dartk/vm tests because I stopped reporting some errors accidentaly.
I thought I was duplicating all error messages, but turns out that recoverable
errors were only reported in the line fixed here.
This reverts to the old behavior so we can address the reporting issues
separately. Added details to: https://github.com/dart-lang/sdk/issues/30194
BUG=
Review-Url: https://codereview.chromium.org/2977423002 .
Changes in this CL:
- Updated CompilerContext:
- it now contains a ProcessedOptions object
- it no longer depends on CompilerCommandLine/CommandLine
- it delegates to ProcessedOptions.report so all error reporting
goes to one single place.
- use "withContext" term instead of "withGlobalOptions" to be
more clear about the intent
- Changes in public API
- added more options that correspond to flags in command-line
fasta tools
- default onError is different: we now use the
command_line_reporting report, which prints and throws
on fatal messages, but doesn't throw eagerly on all messages
as before.
- introduced "printMessages" option: make it easy to have
both onError + command_line_reporting (kernel-service.dart
is the main use case at this time, other ideas welcome!)
- renamed CompilationError to CompilationMessage
- Other changes
- set exit code is done on report, not on format
- fixed corner cases not covered in previous CL
- error reporting with missing-main needs to happen with
a context
- missing error cases when inferring .packages and input
URIs are not file:* URIs
Ideas for follow up after this CL:
- combine ProcessedOptions and CompilerContext into a single class
(or extend one from the other)
- switch onError to a stream
R=ahe@google.com
Review-Url: https://codereview.chromium.org/2982093003 .
Note, that we don't restore the original AST for StaticGet(s).
The original AST is not available in Kernel.
Instead we generate simple identifiers with correct elements.
It should be enough to compute constant values, although some clients
might have to adapt to the change.
R=paulberry@google.com
BUG=
Review-Url: https://codereview.chromium.org/2983773002 .