Commit Graph

27 Commits

Author SHA1 Message Date
Dan Rubel a4b67bd6ce add regression test for issue 37285
Change-Id: Ieb2636ba8404c95a6b3027bd5fccf02876940933
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106501
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2019-06-20 21:04:37 +00:00
Dan Rubel 683ea6dc67 add fasta extension method test
Change-Id: I8de4f01463aa141ac4104d98b8ba42f970e32021
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103881
Commit-Queue: Dan Rubel <danrubel@google.com>
Auto-Submit: Dan Rubel <danrubel@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2019-06-20 20:55:07 +00:00
Jens Johansen e6647f0769 [cfe] Fixes to part with parts
Before this CL we could both crash and add wrong metadata to "part"
nodes when a part defined other parts.
This CL fixes it by
a) Not resetting a counter so *every* part in a part will be out of
   bounds when trying to reference it; and
b) Check if a part directive is in bounds and ignore it if it isn't
   (an error should already have been issued).

Change-Id: I3d31f2577b2120df6461c9cc1002131dbee9dbbc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106641
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2019-06-19 11:25:05 +00:00
Jens Johansen a878514cf5 Add frontend testcases for part with part(s) in it
Currently there's at least two issues:
* We can crash
* We can add metadata to things they weren't meant for

Change-Id: I4e277ea614ce9faa25b2bf1c5a16a5e877df225b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106640
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2019-06-19 10:56:55 +00:00
Jens Johansen dcc157633d Offset from class when reporting errors on synthetic constructors
Bug: 36669
Change-Id: I11b5312e4023cd7368a4a3e36cff66398dadd69c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100960
Reviewed-by: Kevin Millikin <kmillikin@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2019-05-02 06:57:43 +00:00
Jens Johansen 30e21f3dc0 Don't crash when additional exports contain duplicate names
Fixes #36647

Change-Id: I45019b2113fde5bcd1f5e4227f7a1d86c570001f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100645
Reviewed-by: Kevin Millikin <kmillikin@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2019-05-01 06:38:34 +00:00
Lasse R.H. Nielsen 1dd0f88c84 Don't allow null as argument to StreamIterator constructor.
Change-Id: I10c8de2cd12660876908f719ee562006cd3f2c07
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98001
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2019-04-30 13:27:48 +00:00
Jens Johansen 0325d50db2 [CFE] Add disambiguation for type parameters if needed
Change-Id: I440d8aabbc0eb3fe4242c769cca5ccef2dfe8948
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99150
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2019-04-30 11:00:58 +00:00
Sigmund Cherem 4b7d256a06 Revert "Enable constant-update-2018 by default." and "Update .expect files in pkg/front_end after e9ca6a53"
This reverts commit e9ca6a5335 and d3e00fd35e.

Change-Id: I346d6156be19c4fceffa202a7ce9bfa931c7c14b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99560
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2019-04-16 20:20:12 +00:00
Dmitry Stefantsov d3e00fd35e Update .expect files in pkg/front_end after e9ca6a53
TBR=askesc@google.com

Change-Id: I65e263c7ee627f94bc314346a322953f9e954899
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99174
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
2019-04-15 14:40:24 +00:00
danrubel 896f1c4bb9 CFE tests for issue 36400
Change-Id: I05139ce86177fe32cae857e410f759d365dc7bde
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98503
Commit-Queue: Dan Rubel <danrubel@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2019-04-04 15:48:30 +00:00
Jens Johansen 8ce2d7a4e1 [CFE] Better error messages on errors with user definable operators
Fixes #36383

Change-Id: I24fd51bdb3ead75973009fe515819f9c8354e1b0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98332
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2019-04-02 10:46:18 +00:00
Kevin Millikin 4daa9b94ea [cfe] Compile if elements in lists and sets
If elements are compiled to if statements.  The type inference rules
including insertion of runtime checks are not yet implemented.

Change-Id: Iaa7ab709a7acacf952887b17ac1081a9fecd7cef
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97200
Commit-Queue: Kevin Millikin <kmillikin@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2019-03-20 08:43:03 +00:00
Dan Rubel e033b676dd fix parser crash in unterminated string literal inside unterminated interpolation
Fix https://github.com/dart-lang/sdk/issues/35900

Change-Id: I96d83e0c93d9e9c22d5b30048dc210672b1c003c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/95043
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2019-03-05 15:35:58 +00:00
Peter von der Ahé f3cee0147c Fast versions of legacy and strong tests.
These versions don't run the VM on the generated .dill files.

These tests are still "Slow" in status-file lingo, as they run for
about 30 seconds on a fast machine.

Change-Id: I7bd326a14c8f1f1905d4c6b4d5f850a95b135325
Reviewed-on: https://dart-review.googlesource.com/c/88967
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2019-01-17 14:23:07 +00:00
Dan Rubel 1b0d93366d Add list literal spread collection fasta test cases
Change-Id: Ia17b7e1d4f97565a8ca7a93b1db35896d0f2f647
Reviewed-on: https://dart-review.googlesource.com/c/89700
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2019-01-17 01:32:15 +00:00
Aske Simon Christensen 6a756ac040 Add front-end test for set/map literal disambiguation.
The test exposes three problems:

- The disambiguation criterion in the type inference is incorrect, as
  it infers a map when the context is a LinkedHashSet. This will be
  fixed in an upcoming CL.

- Assigning a map literal to a LinkedHashMap produces a static error
  ("isn't of expected type") due to exact types. Rules for exact types
  are currently unspecified, and the language team has expressed some
  interest in allowing this case. See also
  https://github.com/dart-lang/sdk/issues/33307

- Type arguments for the map literal are not inferred from the context
  when the outer context type is a LinkedHashMap. This is consistent
  between the CFE and analyzer. If the LinkedHashMap case is to be
  supported, this must be fixed as well.

Change-Id: I1519c844dae1f599306446c992cfe4825e4f20d4
Reviewed-on: https://dart-review.googlesource.com/c/88726
Reviewed-by: Peter von der Ahé <ahe@google.com>
2019-01-11 15:14:05 +00:00
Peter von der Ahé f01449e082 Add main method to rasta/issue_000035{,a} test cases
Change-Id: Id8e93459937616bd7bd31890f4ce537a14fa0a08
Reviewed-on: https://dart-review.googlesource.com/c/87589
Commit-Queue: Peter von der Ahé <ahe@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2018-12-20 18:06:34 +00:00
Peter von der Ahé aa57aab82d Update expectations for legacy/statements
Change-Id: I85972635b14422bf2d6ae2cd3ae5f792e116b174
Reviewed-on: https://dart-review.googlesource.com/c/86351
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2018-12-19 17:21:51 +00:00
Régis Crelier cb8c0ab8f5 [vm] Remove MixinAppType VM class and VM code supporting type resolution.
In Dart2, mixin application classes are generated by kernel and type resolution
is performed by kernel. In Dart1, using the VM parser, these tasks were done
during class and type finalization.

Change-Id: I927b1446d906ffd76ed9591c96e0d974df09f3bf
Reviewed-on: https://dart-review.googlesource.com/c/87025
Commit-Queue: Régis Crelier <regis@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2018-12-13 20:18:36 +00:00
Peter von der Ahé abdd6ca0d1 Verify that we don't emit SyntheticExpressionJudgment
Change-Id: I4973d6731a8095cb3bc58f13f8db522fe3984af8
Reviewed-on: https://dart-review.googlesource.com/c/86020
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Auto-Submit: Peter von der Ahé <ahe@google.com>
2018-12-11 14:55:57 +00:00
Régis Crelier 5f36c5f9d8 [vm] Delete BoundedType class in VM.
In Dart2, type bounds checking is either performed by the common front-end or
by explicitly generated code, but not by type finalization or runtime anymore,
as it was done in Dart1.
Consequently, the class BoundedType is not needed anymore, and malbounded or
malformed types are not seen by the runtime either.

Change-Id: I5d6e4c68d153d6730fa7ff7f6d9dcfa611299c16
Reviewed-on: https://dart-review.googlesource.com/c/86687
Commit-Queue: Régis Crelier <regis@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Samir Jindel <sjindel@google.com>
2018-12-10 23:15:27 +00:00
Jens Johansen 17d322b62a Handle AmbiguousBuilder in computeRedirecteeType
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>
2018-11-30 12:58:07 +00:00
Jens Johansen 5410bc4098 Fix rare crash in type inference engine
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>
2018-11-30 12:57:17 +00:00
Jens Johansen ad62f21e5b Fix crash with multiple same-named redirecting constructors
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>
2018-11-30 08:53:10 +00:00
Dan Rubel 9677ec9a14 Fix parsing complex function expressions
Fix https://github.com/dart-lang/sdk/issues/35177

Change-Id: I378314741bbbe555f9cdc2b95dcfd5ce71a15efa
Reviewed-on: https://dart-review.googlesource.com/c/84660
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-11-16 21:49:30 +00:00
Peter von der Ahé 573a7c543f Rename strongMode to legacyMode in test suite
Change-Id: Id02e72dac031224c1c37cdde5a20fb19c0ebf6b5
Reviewed-on: https://dart-review.googlesource.com/c/84404
Auto-Submit: Peter von der Ahé <ahe@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2018-11-14 09:32:15 +00:00