Commit Graph

2317 Commits

Author SHA1 Message Date
Dmitry Stefantsov aa6fb2d3a4 [fasta] Report errors for bounds violations
Fixes #33308.

Bug: http://dartbug.com/33308
Change-Id: Iae087928468ed6883c438db95644135dc7ef0a6a
Reviewed-on: https://dart-review.googlesource.com/c/57621
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Samir Jindel <sjindel@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
2018-10-10 12:03:36 +00:00
Paul Berry b3af151325 Rework detection of uninstantiated bound errors.
We now determine whether a type is simply bounded in the summary
linker, so that we can take advantage of the linker's circularity
detection logic.

Fixes #34635.
Fixes #34636.

Change-Id: I6c5040dbaeb79957d8a84e3f76e6a51834b57f05
Reviewed-on: https://dart-review.googlesource.com/c/78867
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2018-10-09 22:07:02 +00:00
Brian Wilkerson 2cf6ba2996 Generate the right error message for type arguments on a named constructor
Change-Id: If6e9e943b71b00429c8fc5618f1337e8b7ac46b6
Reviewed-on: https://dart-review.googlesource.com/c/78560
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2018-10-09 18:38:39 +00:00
Martin Kustermann 6c0b854477 [VM] Fix canonicalization of doubles: Two doubles are canonicalized to the same value if they are idencial()
Fixes https://github.com/dart-lang/sdk/issues/34730

Change-Id: I9f60c5f81ceb9bd31794efe20012a343dab748bb
Reviewed-on: https://dart-review.googlesource.com/c/78747
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2018-10-09 12:33:57 +00:00
Kevin Millikin 1f916eb4e6 Mark a failing test
In the VM's ahead-of-time compiler, a constant -0.0 is not identical
to a literal -0.0.

Change-Id: I93599bbe62bcbc3d891f959af18d2fc1f49fe0f6
Reviewed-on: https://dart-review.googlesource.com/c/78743
Reviewed-by: Kevin Millikin <kmillikin@google.com>
Auto-Submit: Kevin Millikin <kmillikin@google.com>
2018-10-09 11:30:18 +00:00
Peter von der Ahé 6cd25af684 Configure defines correctly in config_import_test.dart
Change-Id: I5ad46c03c92fa55249e35e83d9f78dabdfcc69f2
Reviewed-on: https://dart-review.googlesource.com/c/78521
Commit-Queue: Peter von der Ahé <ahe@google.com>
Auto-Submit: Peter von der Ahé <ahe@google.com>
Reviewed-by: William Hesse <whesse@google.com>
2018-10-09 11:06:29 +00:00
Kevin Millikin 4e4e9ec74a Implement int-to-double literal conversion.
The implementation strategy is to replace int literals with double
literals during type inference, provided they occur in a double
context and can be represented exactly as a double.  This requires us
to keep integer literals larger than the 64-bit range until after type
inference and to keep the source text of 64-bit integers until after
type inference for error reporting.

We postpone the check for web int literals as well because the
expression generator that was performing it isn't otherwise needed.

Fixes https://github.com/dart-lang/sdk/issues/34357.

Change-Id: Ia78c031565cad83961675fc4fb1cc871eaed01d3
Reviewed-on: https://dart-review.googlesource.com/c/78122
Commit-Queue: Kevin Millikin <kmillikin@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
2018-10-09 09:15:28 +00:00
Mike Fairhurst 7f531b5112 Analyzer: Fix missing errors during (a)sync(*) yield of void.
Change-Id: Iff1d87862b2f684c0ce36b0f07620f62f2e49a85
Reviewed-on: https://dart-review.googlesource.com/c/78323
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-10-08 22:27:59 +00:00
Alexander Markov f939503b50 [vm/aot] Make mixin deduplication transformation more robust wrt new mixins
Previously, mixin deduplication transformation expected that isAnonymousMixin
classes could occur only in a superclass position. After this change,
deduplication also handles (canonicalizes) isAnonymousMixin classes in
implementedTypes, as CFE uses isAnonymousMixin classes in implementedTypes
to represent superclass constraints for mixin declarations.
No other uses of isAnonymousMixin classes supported.

Fixes https://github.com/dart-lang/sdk/issues/34704

Change-Id: I8558ce53c4fb1e5a06f839fa5ec8022958d9dafd
Reviewed-on: https://dart-review.googlesource.com/c/78383
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Auto-Submit: Alexander Markov <alexmarkov@google.com>
2018-10-08 19:05:54 +00:00
Mike Fairhurst 765b8e2d66 More void cleanup
Change-Id: I21e23ab6dec654242d049935e2665389e61dd3d7
Reviewed-on: https://dart-review.googlesource.com/c/78189
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Auto-Submit: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2018-10-05 15:34:31 +00:00
Alexander Markov 270fd8e4a8 [vm/aot] Handle annotations on parameters in tree shaker and constant evaluator
Fixes https://github.com/dart-lang/sdk/issues/34644
Issue https://github.com/flutter/flutter/issues/22355

Change-Id: Iaf1e5da9a2d33cf4cd8ea2510cf1faff1a20c886
Reviewed-on: https://dart-review.googlesource.com/c/77673
Auto-Submit: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2018-10-03 16:16:46 +00:00
Aske Simon Christensen bb2775b16a Only perform override check on declared members.
The code in class_hierarchy.dart that looped over override pairs
included implementations inherited from its superclass as potential
overriders, presumably in a broken attempt to include some interface
checks into the mix.

With this problem fixed, the special case in kernel_class_builder.dart
that excluded overriders not declared in the current class (i.e.
declared in a mixin) could be removed without incurring false
positives.

These override checks performed on members from a mixin produce an
extra context message indicating the class where the two members meet,
giving rise to the override relation (similarly to interface checks).

Since the same member can now override more than one member (or even
the same member more than once), the diagnostics message duplication
check has been extended to also include the context in the comparison.

Fixes https://github.com/dart-lang/sdk/issues/34235
Fixes https://github.com/dart-lang/sdk/issues/34285

Change-Id: I990e5719ae1749fd1aad1ad478aaa6e173cb170b
Reviewed-on: https://dart-review.googlesource.com/c/76900
Reviewed-by: Daniel Hillerström <hillerstrom@google.com>
2018-10-03 14:56:43 +00:00
Aske Simon Christensen d3bd06d4e8 Check class interface requirements using override check code.
When a member in the interface of a non-abstract class is found to
have an implementation with the correct name which does not override
the representative declaration of the member in the interface (and thus
has not been checked against that member for override validity), call
the override check to check interface validity.

Override relations thus checked produce an extra context message
explaining that the override relation must hold because both members
are inherited by a non-abstract class.

Fixes https://github.com/dart-lang/sdk/issues/32014

Change-Id: I955f057e35fa30f33c19da37c9cea1262042431c
Reviewed-on: https://dart-review.googlesource.com/c/74642
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2018-10-03 14:56:43 +00:00
Paul Berry 49f36b0b2d Reland "Test that the result of instantiate-to-bounds is appropriately checked for super-boundedness."
This is a reland of 7419667d67

I reverted this CL in
https://dart-review.googlesource.com/c/sdk/+/77520 because I thought
it had broken a bunch of bots.  It turns out that the bots weren't
broken; they were just erroneously reporting a breakage because some
change-detection code had noticed that there were new failing tests,
and there is not yet a way to tell the change-detection code that the
failures are expected.

Original change's description:
> Test that the result of instantiate-to-bounds is appropriately checked for super-boundedness.
>
> When I implemented super-boundedness for the analyzer in
> b1a54154f8, very little test status
> changed, indicating we didn't have much test coverage for verifying
> that the result of instantiate-to-bounds was appropriately checked for
> super-boundedness.  This CL fills in the coverage gap.
>
> Change-Id: I8f6fbb3aa4cae1e62861b5eddb113ee9b4bb085c
> Reviewed-on: https://dart-review.googlesource.com/77010
> Commit-Queue: Paul Berry <paulberry@google.com>
> Auto-Submit: Paul Berry <paulberry@google.com>
> Reviewed-by: Erik Ernst <eernst@google.com>

Change-Id: Ic84321e928aaf4c6533e6cf5b9d521a1da77dba7
Reviewed-on: https://dart-review.googlesource.com/c/77660
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-10-02 20:24:16 +00:00
Paul Berry d70b0fa3be Revert "Test that the result of instantiate-to-bounds is appropriately checked for super-boundedness."
This reverts commit 7419667d67.

Reason for revert: Broke a lot of bots.  Will investigate tomorrow.

Original change's description:
> Test that the result of instantiate-to-bounds is appropriately checked for super-boundedness.
> 
> When I implemented super-boundedness for the analyzer in
> b1a54154f8, very little test status
> changed, indicating we didn't have much test coverage for verifying
> that the result of instantiate-to-bounds was appropriately checked for
> super-boundedness.  This CL fills in the coverage gap.
> 
> Change-Id: I8f6fbb3aa4cae1e62861b5eddb113ee9b4bb085c
> Reviewed-on: https://dart-review.googlesource.com/77010
> Commit-Queue: Paul Berry <paulberry@google.com>
> Auto-Submit: Paul Berry <paulberry@google.com>
> Reviewed-by: Erik Ernst <eernst@google.com>

TBR=paulberry@google.com,lrn@google.com,leafp@google.com,eernst@google.com

Change-Id: I536c9721a1d79b98b2e3c2a6f7650b134b19f561
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/77520
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-10-01 23:54:48 +00:00
Paul Berry 7419667d67 Test that the result of instantiate-to-bounds is appropriately checked for super-boundedness.
When I implemented super-boundedness for the analyzer in
b1a54154f8, very little test status
changed, indicating we didn't have much test coverage for verifying
that the result of instantiate-to-bounds was appropriately checked for
super-boundedness.  This CL fills in the coverage gap.

Change-Id: I8f6fbb3aa4cae1e62861b5eddb113ee9b4bb085c
Reviewed-on: https://dart-review.googlesource.com/77010
Commit-Queue: Paul Berry <paulberry@google.com>
Auto-Submit: Paul Berry <paulberry@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
2018-10-01 22:40:05 +00:00
Paul Berry 32af1be0a4 Check type arguments against bounds when instantiating a typedef.
Change-Id: I38f390abd2c409694ad15cbc35654ba5dab9b9ce
Reviewed-on: https://dart-review.googlesource.com/77015
Commit-Queue: Paul Berry <paulberry@google.com>
Auto-Submit: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-10-01 20:43:19 +00:00
Johnni Winther 41a875f420 Fix (super)mixins issues
Change-Id: I5892f2fec7fc7b7449fb600c74e4d105dc0f4bbe
Reviewed-on: https://dart-review.googlesource.com/77180
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Auto-Submit: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-09-28 23:03:24 +00:00
Sigmund Cherem 775fab1d24 Triage mixin declaration tests
Other than tests already marked as failing under langauge_2_kernel.status in a [$fasta] section, only  2 tests present runtime failures, which might be a dart2js issue that we should
investigate.

TBR=johnniwinther@google.com

Change-Id: I6a62ec77d0d44335315752208720ab9fe6e1e2bb
Reviewed-on: https://dart-review.googlesource.com/77012
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-09-27 23:43:50 +00:00
Paul Berry b237cf1037 Fix incorrect constructor name in const_native_factory_test
Change-Id: I981ee1f1bb466158ceea19d184b5943e31d78825
Reviewed-on: https://dart-review.googlesource.com/77000
Commit-Queue: Paul Berry <paulberry@google.com>
Auto-Submit: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-09-27 23:25:38 +00:00
Jenny Messerly 9ad59bada2 [dartdevc] fix #34358, int to double conversion for literals
Also fix #34360 by addressing a few remaining Analyzer issues.

Change-Id: Iac3d9ba72aa370846fced3654a376899b5938152
Reviewed-on: https://dart-review.googlesource.com/76343
Commit-Queue: Jenny Messerly <jmesserly@google.com>
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2018-09-27 20:15:20 +00:00
Alexander Markov 2742a5d558 [Gardening] Update test status
Issue: https://github.com/dart-lang/sdk/issues/34599
Issue: https://github.com/dart-lang/sdk/issues/34606
Change-Id: Ieba1080a23d72b5c05086ece2c1cb5ea2e0ad5be
Reviewed-on: https://dart-review.googlesource.com/77003
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2018-09-27 18:20:37 +00:00
Paul Berry d79f7493b3 Test that type parameters of typedefs are properly bounds checked.
I'm trying to fix an analyzer bug where typedef type parameters
weren't checked properly, and it appears that we have no language_2
test cases for it.

Change-Id: I216a337eeaae6ac2008c0c26139797e00099ffcb
Reviewed-on: https://dart-review.googlesource.com/76707
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-09-27 12:50:05 +00:00
Kevin Millikin c9b05d3f1f Allow super calls in mixin declarations
Allow super calls to occur in mixin declarations if they target a
method from any of the superclass constraint interfaces.

Instead of compiling the Dart mixin declaration
    mixin M on S0, S1 {...}
to Kernel:
    abstract class _M&S0&S1 = S0 with S1;
    abstract class M extends _M&S0&S1 { ... }
we compile it to Kernel:
    abstract class _M&S0&S1 implements S0, S1 {}
    abstract class M extends _M&S0&S1 { ... }
because the former is not symmetrical with respect to S0 and S1.  It
will prefer a method from the 'mixin' S1 over one from S0 which can
give a compile-time error if the method from S0 is more general.

Modify mixin inference to support the new compilation of mixin
declarations.  It still has to support old-style VM super mixins until
support for those is removed from the VM.

Change-Id: Ib945aa11cc19c457b07bc802beae10d1663ff6b7
Reviewed-on: https://dart-review.googlesource.com/76141
Reviewed-by: Jenny Messerly <jmesserly@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Kevin Millikin <kmillikin@google.com>
2018-09-27 10:19:30 +00:00
Alexander Markov 0f5968945c [vm/aot] Do not tree shake type arguments used in constant instances
Change-Id: I2a3c6f8ed8e31ebcbd1329fbf5997d1cad558daf
Reviewed-on: https://dart-review.googlesource.com/76744
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2018-09-26 21:42:36 +00:00
Paul Berry 99daccc0dd Handle FunctionExpressionInvocation when creating summaries.
Fixes #34514.

Change-Id: I46544a0a188b4cc0cb8061669ccbb0f7fa394995
Reviewed-on: https://dart-review.googlesource.com/76741
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-09-26 21:23:18 +00:00
Paul Berry c22b2efb48 Verify that mixin constraints can't be satisfied by the application (or named class) itself.
When I first began working on the feature I mistakenly thought that
these two test cases would be free from compile-time errors, so it
seemed like it would be worth adding a test case to make sure others
don't have the same misunderstanding.

Change-Id: I322991c818f9d136180de443090fa4e15f6f0e27
Reviewed-on: https://dart-review.googlesource.com/76680
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2018-09-26 13:07:04 +00:00
Alexander Aprelev e17a5965d1 [gardening] Update product dartk test status.
Change-Id: I556695f908fa3edf758e4041f88b6b04f9f18ea2
Reviewed-on: https://dart-review.googlesource.com/76589
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2018-09-26 06:10:53 +00:00
Jenny Messerly 1c8d65c49b fix #32785, implement typedef equality in dartdevc
This change expands typedefs into their underlying function type in the
compiler. Typedefs no longer exist at runtime in DDC, so they now have
similar equality and identity behavior as other function types.

The compiler used to preserve typedefs so they could have a better
toString. But over time that support has been almost entirely lost;
the caching for function/interface types eliminates typedefs, and
DDC+Kernel does not appear to get any TypedefTypes from the common
front end. So in practice typedef types were almost never present at
runtime. Because of this, we can remove the remaining support with very
little user visible effect. This also brings DDC's canonicalization
roughly in line with dart2js for compile-time typedefs, so frameworks
like Angular will be able to continue their use of `identical` for fast
type comparisons.

This CL also fixes DDC's type caching for generic function types
(typeHashCode was incorrect for them), and has some refactoring to
improve names/comments and make the SDK runtime code more clear.

Change-Id: I4e34c0c8f737a8535ba474a4683967ff41bcd3c8
Reviewed-on: https://dart-review.googlesource.com/74664
Commit-Queue: Jenny Messerly <jmesserly@google.com>
Reviewed-by: Alan Knight <alanknight@google.com>
2018-09-26 02:01:45 +00:00
Paul Berry b1a54154f8 Check that implicit type arguments satisfy bounds.
This required adding an implementation of super-bounded types to the
analyzer.

We really could use some more tests to verify that we disallow
super-bounded types in all the appropriate locations, but allow it in
other cases (it seems that there are no language_2 tests to verify
this).  To avoid churn, I'll wait until I have confirmation that my
reasoning is correct in #34583 before submitting test cases.

Fixes #34532.
Fixes #34560.

Change-Id: I3c5def60bcac0d31b56bead31cb1aab445f18e96
Reviewed-on: https://dart-review.googlesource.com/76280
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-09-26 01:12:28 +00:00
Alexander Markov f81709c3e3 [vm/aot] Use field types inferred in TFA and remove inference in precompiler.cc
Type inference for final fields in precompiler.cc is limited and
does not properly handle constant objects.

This change hooks up field types inferred by TFA and removes the
inference in precompiler.cc.

Fixes: https://github.com/flutter/flutter/issues/22131

Change-Id: Ida65cd211074623928bb2a7d48dc58d5e53511b8
Reviewed-on: https://dart-review.googlesource.com/76562
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2018-09-25 23:26:09 +00:00
Alexander Aprelev e7fc155457 [gardening] Adjust product kernel test status
Change-Id: I2c5126812675e3aef991969276f57b6e51939f1e
Reviewed-on: https://dart-review.googlesource.com/76580
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2018-09-25 23:23:29 +00:00
Konstantin Shcheglov 9185294e7a Reland: Implement inheritance/override checks from the spec.
Relands https://dart-review.googlesource.com/c/sdk/+/76061
Was reverted in https://dart-review.googlesource.com/c/sdk/+/76301

The difference with the original CL is that we don't look into
superclass and mixins of mixed-in for concrete members. This reduces
the number of errors in Flutter codebase to 1.


R=brianwilkerson@google.com

Bug: https://github.com/dart-lang/sdk/issues/34392
Change-Id: I86256b598d116439194cbaf4d09b4f72013d6563
Reviewed-on: https://dart-review.googlesource.com/76340
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-09-25 18:51:04 +00:00
Jens Johansen 8477dc2131 Update status after 570fd5a788
Test export_ambiguous_main_test doesn't crash. It gives a compile-time
error.

Change-Id: Ib097099c3f075a18d681b179b0ee6d46cd5d0b7a
Reviewed-on: https://dart-review.googlesource.com/76360
Reviewed-by: Samir Jindel <sjindel@google.com>
2018-09-25 10:55:00 +00:00
Jens Johansen 570fd5a788 Error on re-export, export and import of libraries with same name.
Fixes #12916.

Change-Id: Icef0f04f1575c8dad5f1cd23a9363f06fa2a2b35
Reviewed-on: https://dart-review.googlesource.com/74161
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
2018-09-25 09:09:21 +00:00
Konstantin Shcheglov d34337aa2d Ignore noSuchMethod() for the purpose of searching concrete member implementations.
R=brianwilkerson@google.com

Bug: https://github.com/dart-lang/sdk/issues/33553
Change-Id: Ie597cb4d39ba16e4503503b59d1e5179c594bad5
Reviewed-on: https://dart-review.googlesource.com/76200
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-09-25 02:37:03 +00:00
Zach Anderson 95d37b0921 Revert "Implement inheritance/override checks from the spec."
This reverts commit 836a1d7a88.

Revert "Don't use ClassElementImpl for now in override checking."

This reverts commit 58e44c1400.

Revert "large_class_declaration_test is slow now."

This reverts commit 56f6c52d58.

Revert "Add regression test for issue 34392."

This reverts commit ef7d144bc7.

Revert "Mixin declarations don't have supertype, fix isMoreSpecificThan()."

This reverts commit 95b8a19a20.

Change-Id: Icda9cf9091ef35acc8fd61ac5dc135b3717eba0a
Reviewed-on: https://dart-review.googlesource.com/76301
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Zach Anderson <zra@google.com>
2018-09-24 21:27:34 +00:00
asiva 355c73d4ee [VM] Remove support for option --no-preview-dart-2
- option --no-preview-dart-2 will now result in an error
- change aot-assembly build rule to generate AOT snapshot using Dart 2
- generate coresnapshot using Dart 2 (this snapshot is not used yet, next CL which switch the isolate create code to use this snapshot)
- by pass all Dart1 test runs in the status file
- change the default compiler setting in test.py to use dartk
- have test.py not pick up any configuration for --no-preview-dart-2

Change-Id: Ia136943ebfd0fed0c52683b330745b3e2c7a7ce6
Reviewed-on: https://dart-review.googlesource.com/75820
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2018-09-24 20:38:08 +00:00
Konstantin Shcheglov ef7d144bc7 Add regression test for issue 34392.
Bug: https://github.com/dart-lang/sdk/issues/34392
Change-Id: Ia86264e8e752d7563b97657321f92eaa53f257bb
Reviewed-on: https://dart-review.googlesource.com/76180
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-09-24 20:02:16 +00:00
Konstantin Shcheglov 56f6c52d58 large_class_declaration_test is slow now.
Because of my https://dart-review.googlesource.com/c/sdk/+/76061

R=brianwilkerson@google.com

Change-Id: I2d8654faf247b333303d34d31bc4fef9288a2561
Reviewed-on: https://dart-review.googlesource.com/76261
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-09-24 19:51:34 +00:00
Alexander Markov 62d154f6a3 [vm/bytecode] Record null-initialized fields in bytecode
If a field is initialized with null (either explicitly or implicitly),
field store can be omitted in bytecode. In such case, bytecode should
still convey the information about this initialization to VM for
field guards to work correctly.

Change-Id: I1fd45b858c3c521b97fa5dbffe0e15b1ea75d92f
Reviewed-on: https://dart-review.googlesource.com/76060
Reviewed-by: Zach Anderson <zra@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
2018-09-24 17:56:35 +00:00
Konstantin Shcheglov 836a1d7a88 Implement inheritance/override checks from the spec.
This CL starts moving checks from strong-mode specific checker,
and old InheritanceManager into an implementation that is based
on the current spec, and avoids old baggage. It also fixes the issue
we were asked to fix for Dart 2.1.

Bug: https://github.com/dart-lang/sdk/issues/34392
Change-Id: Id5a23c5db7704b2b530bb894ae92628a08eaa70f
Reviewed-on: https://dart-review.googlesource.com/76061
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-09-24 16:28:50 +00:00
Daniel Hillerström 7ad1e5da99 Perform substitution on type argument/parameter bounds.
Fixes regression #34528. Introduces a new test to mitigate future
regressions.

Closes #34528.

Change-Id: Iaf0a8f44db2a8b4a8151c391ddb8dff69910fe3a
Reviewed-on: https://dart-review.googlesource.com/75840
Commit-Queue: Daniel Hillerström <hillerstrom@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
2018-09-24 14:02:01 +00:00
Aske Simon Christensen 8385c36d97 Move all int literal parsing and checking code together.
Report error for negated hex literals > 2^63.

Optimized common case of web int literal exactness check.

Fixes https://github.com/dart-lang/sdk/issues/33311

Change-Id: Ib72b2dbb21e42489ee2d06b17302daf83d560df1
Reviewed-on: https://dart-review.googlesource.com/72802
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
2018-09-24 11:17:36 +00:00
Leaf Petersen 33f6c8ef35 More super mixin tests.
Test mixin class definition syntax, and test that inference is not
performed in the on clause of a mixin.  Bug fixes.

Change-Id: I01679c4eb556d9c7bd9227b5d3a79293a027706c
Reviewed-on: https://dart-review.googlesource.com/75622
Reviewed-by: Paul Berry <paulberry@google.com>
2018-09-21 19:21:23 +00:00
Paul Berry ead158ab5d Fix gatherMixinSupertypeConstraints to handle named mixin applications.
In a named mixin application, the superclass doesn't include the last
type appearing in the "with" clause, so that class isn't considered a
superclass constraint.

Fixes some test cases broken by 46e5954b0a.

Change-Id: I2e824d38017fe2c7eaa23e8f185cea07fe2222b7
Reviewed-on: https://dart-review.googlesource.com/75940
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-09-21 16:37:55 +00:00
Régis Crelier 0c60a52bb2 [VM bytecode] Triage failures in interpreted mode.
Change-Id: I7c896386ef38b5ea5aceab5b6090363a34e960e6
Reviewed-on: https://dart-review.googlesource.com/75794
Commit-Queue: Régis Crelier <regis@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2018-09-21 02:37:44 +00:00
Leaf Petersen e75a48b7fe Add status entries for dartdevk on new super invocation tests
Change-Id: I4c070dd1a30af04890d8d7a70676a8c4da181b0c
Reviewed-on: https://dart-review.googlesource.com/75800
Reviewed-by: Leaf Petersen <leafp@google.com>
2018-09-21 01:58:37 +00:00
Paul Berry 46e5954b0a Turn on and fix mixin type inference checks when not in "supermixin" mode.
Now that we have an explicit syntax for mixins that is available all
the time, we have to do mixin inference error checking all the time,
not just when the "--supermixin" flag is supplied.

This required fixing several minor bugs:

- ErrorVerifier._checkForMixinSuperInvokedMembers did not properly
  handle a mixinElement argument that was a ClassElementHandle.

- ErrorVerifier._checkMixinInference wasn't using the actual
  substituted mixin types, causing errors to be wrongly reported when
  a class declaration had multiple inferred mixins (this was the root
  cause of #34404).

- Type names in "with" clauses in the resolved AST weren't properly
  reflecting the mixin type arguments that had been inferred.

Fixes #34404.

Change-Id: Ia773233c66f8d9ab778f207689c73922e9e3a880
Reviewed-on: https://dart-review.googlesource.com/75792
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2018-09-21 01:06:25 +00:00
Leaf Petersen b7f762923e Add tests for more super invocation edge cases
Change-Id: Ideee02c85bd2704419378dec01de452bc143d1b0
Reviewed-on: https://dart-review.googlesource.com/75785
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2018-09-21 00:52:13 +00:00