Commit graph

2074 commits

Author SHA1 Message Date
danrubel 6f6689889c Update fasta parser to report ParserErrorCode.FUNCTION_TYPED_PARAMETER_VAR
In addition to adding missing errors, this CL inlines modifier parsing
as part of a multi step effort to parse modifiers once and provide
better error recovery for class member and top level declarations.

Change-Id: Ibea91a4a3e2073ed6079f0f44ff4bbbb4a98a614
Reviewed-on: https://dart-review.googlesource.com/35300
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-01-17 18:28:48 +00:00
Paul Berry 7339e1ffe7 Fix handling of forwarding semi-stubs in the front end.
See #31649 for more details about forwarding semi-stubs.

Change-Id: I2af7fb0c5de01d7732279a6ca8254985f396683a
Reviewed-on: https://dart-review.googlesource.com/35003
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samir Jindel <sjindel@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-01-17 17:47:58 +00:00
Peter von der Ahé e377e275ba Work around diff missing on Windows
Change-Id: I5b1e5ce7334d56ac93613a60b958e2a66fe6d602
Reviewed-on: https://dart-review.googlesource.com/35281
Reviewed-by: Peter von der Ahé <ahe@google.com>
Commit-Queue: Peter von der Ahé <ahe@google.com>
2018-01-17 14:17:54 +00:00
Peter von der Ahé 4e56b7a92b Handle file names correctly on Windows
Change-Id: Iec0b2df092cffbbf720065b910e3bbefc41eb03a
Reviewed-on: https://dart-review.googlesource.com/35240
Reviewed-by: Peter von der Ahé <ahe@google.com>
Commit-Queue: Peter von der Ahé <ahe@google.com>
2018-01-17 14:11:30 +00:00
Paul Berry 52c036c6f8 Always infer the return type of operator[]= as void.
Fixes #31779.

Change-Id: Ib7c2b79271ce7eca7ec8143ceb425c73e72f7cc1
Reviewed-on: https://dart-review.googlesource.com/35005
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-01-17 13:46:08 +00:00
Peter von der Ahé 4d1adf42d3 Deprecate IncrementalClassHierarchy
See https://github.com/dart-lang/sdk/issues/31842

Change-Id: I019909831a91a4e06138dc3a6bf32f766bca1ae6
Reviewed-on: https://dart-review.googlesource.com/34880
Commit-Queue: Peter von der Ahé <ahe@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2018-01-17 13:30:17 +00:00
Peter von der Ahé e7ac35dfc9 Make the fasta tool use Platform.resolvedExecutable when tested.
Change-Id: Ie83cd4692898c1b6e585ed5d47fc55be4d60c272
Reviewed-on: https://dart-review.googlesource.com/35162
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Peter von der Ahé <ahe@google.com>
2018-01-17 10:26:08 +00:00
Jens Johansen bfda4508a9 [fasta] Incremental compilation and parts
The incremental compiler calculates which libraries are reusable,
but previously forgot about parts when mapping for changed files to
libraries.

This CL fixes that, meaning that a changed part file will invalidate
the Library it's a part of, meaning we get the needed re-compilation.

Fixes #31908.

Change-Id: Ic30c97af3f1c8166a82774040a2bbcebf5686415
Reviewed-on: https://dart-review.googlesource.com/34821
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
2018-01-17 08:43:07 +00:00
Peter von der Ahé beda5c3e62 This CL supposedly broke the analyzer, but that isn't true. It broke a single front_end test, and if that was causing you trouble, you could have marked it as failing.
Revert "Revert "Don't skip front-end tests""

This reverts commit b4556e646e.

Reason for revert: <INSERT REASONING HERE>

Original change's description:
> Revert "Don't skip front-end tests"
> 
> This reverts commit 62d2255719.
> 
> Reason for revert: Broke analyzer bots
> 
> Original change's description:
> > Don't skip front-end tests
> > 
> > Change-Id: Ibbd0d63e8c23d045a898e52185fe55e5c53dd6b3
> > Reviewed-on: https://dart-review.googlesource.com/34621
> > Reviewed-by: Jens Johansen <jensj@google.com>
> 
> TBR=ahe@google.com,jensj@google.com
> 
> Change-Id: I6519e0c551dd79d3bd98345925c2db888e892123
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://dart-review.googlesource.com/35020
> Reviewed-by: Paul Berry <paulberry@google.com>
> Commit-Queue: Paul Berry <paulberry@google.com>

TBR=paulberry@google.com,ahe@google.com,jensj@google.com

Change-Id: I7ff6fd587912fd8a2aba113eb7c765c7b16c5eda
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/35120
Reviewed-by: Peter von der Ahé <ahe@google.com>
Commit-Queue: Peter von der Ahé <ahe@google.com>
2018-01-17 06:03:59 +00:00
danrubel 787d395389 Update code completion to suggest covariant
In addition to updating code completion, this also
addresses comments in https://dart-review.googlesource.com/c/sdk/+/34520
* Change expect to assert `}` where expect is unnecessary
* Extract skipToLastModifier utility method
* Fix spelling

Change-Id: I6a0446d77fac995da3e4d1d2f682f75d584b275f
Reviewed-on: https://dart-review.googlesource.com/34960
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-01-17 03:30:23 +00:00
Samir Jindel ce1294fe3d [kernel] Lookup import conditions against the core library's loader.
Change-Id: Ib16d9f33a40ee25aed2a86a29a74bbc2b301d2e4
Reviewed-on: https://dart-review.googlesource.com/34940
Reviewed-by: Samir Jindel <sjindel@google.com>
Commit-Queue: Samir Jindel <sjindel@google.com>
2018-01-16 23:21:42 +00:00
Paul Berry b4556e646e Revert "Don't skip front-end tests"
This reverts commit 62d2255719.

Reason for revert: Broke analyzer bots

Original change's description:
> Don't skip front-end tests
> 
> Change-Id: Ibbd0d63e8c23d045a898e52185fe55e5c53dd6b3
> Reviewed-on: https://dart-review.googlesource.com/34621
> Reviewed-by: Jens Johansen <jensj@google.com>

TBR=ahe@google.com,jensj@google.com

Change-Id: I6519e0c551dd79d3bd98345925c2db888e892123
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/35020
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-01-16 22:44:33 +00:00
Sigmund Cherem f1390f7660 Add missing return in loadLibrary tearoff
The code to represent a tearoff of loadLibrary looked like this:

  Future __loadLibrary__lib1 () {
    lib1.loadLibrary();
  }

but should have been like:

  Future __loadLibrary__lib1 () {
    return lib1.loadLibrary();
  }

Change-Id: I31efb5bee9f7e376660602c1b842a90a0a2659a4
Reviewed-on: https://dart-review.googlesource.com/34510
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Emily Fortuna <efortuna@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
2018-01-16 19:35:32 +00:00
Samir Jindel a2ff93da67 [kernel] Partial support for conditional imports in CFE.
In order to un-block Flutter integration, we introduce partial support for
conditional imports into the CFE. There are two incomplete parts:

- The condition strings are evaluated by the Target.
  They should be looked up in the environment, but this introduces
  complications with modular compilation.

- Type inference and other static checks are performed with reference to
  the implementation (conditionally-imported) library rather than the
  interface library.

See issue #30143 for more details.

Bug:
Change-Id: I740b45e9d32796644837de4caefd8d6e8015f229
Reviewed-on: https://dart-review.googlesource.com/34721
Reviewed-by: Peter von der Ahé <ahe@google.com>
2018-01-16 17:27:19 +00:00
Dan Rubel b79696982d Improve extraneous or out of position modifier recovery
In addition to improving modifier recovery, this CL
* Improves recovery when builtin keywords are used as types
* Updates ModifierContext to avoid parsing modifiers used as identifiers
* Addresses comment in https://dart-review.googlesource.com/c/sdk/+/34200
* Streamlines missing class body recovery
* Ensures the endMember event is sent during recovery

Change-Id: I87bda7c7da9d0e951427037087c7aa7e8e4da109
Reviewed-on: https://dart-review.googlesource.com/34520
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-01-16 17:24:12 +00:00
Jens Johansen beff8fdf23 [fasta] Fix bugs in incremental tests
This CL fixes errors in a few incremental tests.
The remaining (with a previous references to issue #31909) are not
related to incremental compilation, but also fail to fail on regular fasta.

Closes #31909.

Change-Id: I3c50a4cbfb926f8f74570523a10885e1bd28a94b
Reviewed-on: https://dart-review.googlesource.com/34801
Reviewed-by: Peter von der Ahé <ahe@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2018-01-16 14:47:32 +00:00
Peter von der Ahé 1bca76d012 Convert Platform.resolvedExecutable to URI correctly
Change-Id: I583b98277b1c62328885c775fcb712823c9ff405
Reviewed-on: https://dart-review.googlesource.com/34860
Reviewed-by: Alexander Thomas <athom@google.com>
2018-01-16 14:24:52 +00:00
Peter von der Ahé 62d2255719 Don't skip front-end tests
Change-Id: Ibbd0d63e8c23d045a898e52185fe55e5c53dd6b3
Reviewed-on: https://dart-review.googlesource.com/34621
Reviewed-by: Jens Johansen <jensj@google.com>
2018-01-16 12:00:28 +00:00
Peter von der Ahé 1b8953f256 Prevent async cross talk
Change-Id: I678cfa16a26e0f2bbda4480b0b21a53750346429
Reviewed-on: https://dart-review.googlesource.com/34664
Reviewed-by: Jens Johansen <jensj@google.com>
2018-01-16 11:33:01 +00:00
Peter von der Ahé e6683f0638 Don't crash when the delta is empty
Change-Id: I322261faad1431b7b597094048a9f904d70c33ff
Reviewed-on: https://dart-review.googlesource.com/34740
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2018-01-16 09:57:33 +00:00
Peter von der Ahé 2cc21f515e Remove original and minimal IKG
Change-Id: Id845a025ae9823fd3e53aaac7b5a95aa9e2ad767
Reviewed-on: https://dart-review.googlesource.com/34380
Commit-Queue: Peter von der Ahé <ahe@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2018-01-15 15:02:20 +00:00
Dmitry Stefantsov 3371183b24 Add tests of instantiate to bound in method bodies
Change-Id: Ife92207a5c58e7220a5607b2d798fe40bd779f4e
Reviewed-on: https://dart-review.googlesource.com/34041
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2018-01-15 14:56:41 +00:00
Dmitry Stefantsov 10058a3600 Use instantiate to bound in body builder of fasta
Change-Id: I6e3d9f60c43ccb34df0b58c635be51ea0aa2e789
Reviewed-on: https://dart-review.googlesource.com/32600
Reviewed-by: Peter von der Ahé <ahe@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2018-01-15 14:56:41 +00:00
Samir Jindel 42a639973d [kernel] Support for partial tearoff type application operator in the VM, take 3.
The original change is available in patchset 1.
The changes since then are just status file updates.

Change-Id: I0c45c4b09a187bdd60c6a38bf23f6b7a0cf80c97
Reviewed-on: https://dart-review.googlesource.com/34400
Reviewed-by: Jens Johansen <jensj@google.com>
2018-01-15 11:24:11 +00:00
Paul Berry 45b02f8216 Use the new spec for Future flattening for type inference
Change Fasta type inference and Kernel type checking to use the new
definition for Future flattening, which is really unwrapping (peeling
off one layer of Future or FutureOr).  Use this for inferring types of
`await` expressions and return types from `async` functions.

Ensure that we are using the same notion of flattening for inference
and checking.  (Maybe it was a red flag that we weren't.)

This fixes await_test so that it produces a runtime error rather than
a compile time error - see #31541.

A similar change will need to be made to the analyzer - see #31887.

Change-Id: I7d936e9788969a48fdc216628eaa793389fb5e30
Reviewed-on: https://dart-review.googlesource.com/34504
Commit-Queue: Kevin Millikin <kmillikin@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2018-01-15 07:09:36 +00:00
Paul Berry c567790306 Clean up closure return type handling during front end type inference
This CL fixes two minor flaws in the type inference of closure return types:

- inferReturnType needs to call _wrapAsyncOrGenerator prior to
  checking whether the inferred return type is a subtype of the
  context.  This is necessary because for async and generator
  functions, the context type is the "wrapped" type (FutureOr<>,
  Iterable<>, or Stream<>).

- _updateInferredReturnType needs to perform implicit downcasts before
  storing the inferred return type.  This is necessary because if in
  implicit downcast is added, the inferred type that should be stored
  is the type that was downcast to.  In order to make this work, the
  "unwrapping" logic needed to be moved from
  _updateInferredReturnType's two call sites into
  _updateInferredReturnType itself.

These flaws were benign because they were masked by the looseness of
the future flattening operation.  They need to be fixed so that future
flattening can be made more precise.

Change-Id: I2b5ea3f63632638b5fadbce7d52c5d028acda5ab
Reviewed-on: https://dart-review.googlesource.com/34480
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-01-12 22:07:20 +00:00
Konstantin Shcheglov f79596c0ff Switch from ForwardingStub to Procedure.forwardingStubInterfaceTarget.
Fixes #31519

R=paulberry@google.com

Bug: https://github.com/dart-lang/sdk/issues/31519
Change-Id: I0e9634ba6a1413a758ff3376c69d530d4215b512
Reviewed-on: https://dart-review.googlesource.com/34261
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samir Jindel <sjindel@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2018-01-12 17:54:30 +00:00
Paul Berry d57633ce71 Revert "Fix handling of forwarding semi-stubs in the front end."
This reverts commit 379801ed11.

Reason for revert: Broke buildbots

Original change's description:
> Fix handling of forwarding semi-stubs in the front end.
> 
> See #31649 for more details about forwarding semi-stubs.
> 
> Change-Id: Iaf1153be5ac7f66503b93a362b66ac9585462f6c
> Reviewed-on: https://dart-review.googlesource.com/33820
> Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
> Reviewed-by: Samir Jindel <sjindel@google.com>
> Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
> Commit-Queue: Paul Berry <paulberry@google.com>

TBR=paulberry@google.com,scheglov@google.com,dmitryas@google.com,sjindel@google.com,kmillikin@google.com

Change-Id: I6b37f1143183e889a5b52cb8b0a5427991b306c0
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/34280
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-01-11 22:05:09 +00:00
Dan Rubel 8a0a6b5a98 Update analyzer fasta parser test expectations
In addition to updating test expectations, this CL also
* Streamlines parsing modifiers in 2 places
* Addresses comment in https://dart-review.googlesource.com/c/sdk/+/33500

Change-Id: Ia3d4b7db8a908455b533c1360d107d3557fbb36f
Reviewed-on: https://dart-review.googlesource.com/34200
Reviewed-by: Peter von der Ahé <ahe@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-01-11 21:57:58 +00:00
Paul Berry 379801ed11 Fix handling of forwarding semi-stubs in the front end.
See #31649 for more details about forwarding semi-stubs.

Change-Id: Iaf1153be5ac7f66503b93a362b66ac9585462f6c
Reviewed-on: https://dart-review.googlesource.com/33820
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Samir Jindel <sjindel@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-01-11 16:20:58 +00:00
Samir Jindel e9daa98653 [fasta] Remove unnecessary unary negation for the minimum 64-bit integer.
Change-Id: I5ebf49427ac4ddd005c490d1f04880f005211d26
Reviewed-on: https://dart-review.googlesource.com/33943
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
2018-01-11 15:31:01 +00:00
Aske Simon Christensen 4553cdeeb6 Support data URIs in StandardFileSystem.
Closes https://github.com/dart-lang/sdk/issues/31594

Change-Id: I8dad1429d91cc5934b37cb0be60d1e4039293b71
Reviewed-on: https://dart-review.googlesource.com/33461
Reviewed-by: Peter von der Ahé <ahe@google.com>
2018-01-11 11:23:36 +00:00
Aske Simon Christensen 9bdcc40f69 Rename PhysicalFileSystem to StandardFileSystem.
Preparation for data URI support. For clarity, this is just a rename.

Change-Id: Ibbd8da05d1a7106b5ec7c0ea9c1e13a95a89d1bd
Reviewed-on: https://dart-review.googlesource.com/33460
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2018-01-11 11:23:25 +00:00
Konstantin Shcheglov 1514e3f276 Resolve labels while applying resolution.
R=brianwilkerson@google.com, paulberry@google.com

Bug:
Change-Id: I1d50d251e04a51a1ba0c6038592982988c3281b2
Reviewed-on: https://dart-review.googlesource.com/33666
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-01-10 16:53:09 +00:00
Dan Rubel 729e7b2920 Refactor fasta parser modifier recovery
This CL extracts parsing modifiers from parsing types so that
parseModifiers just parses modifiers and a separate call is made
to parseType.

* Discard the ModifierContext object sooner
* Remove some places where findMemberName output was being
   used to determine which modifiers are present.

Currently, modifiers are parsed once by findMemberName,
again by parseModifiers, and sometimes a third time
by isFactoryDeclaration. This CL sets the stage for
improved modifier recovery and parsing modifiers exactly once.

Change-Id: Ieb8cd1156ed090ca4653258bd40afbac843b9b7c
Reviewed-on: https://dart-review.googlesource.com/33500
Reviewed-by: Peter von der Ahé <ahe@google.com>
2018-01-10 14:30:38 +00:00
Dmitry Stefantsov 28757928b4 Run instantiate to bound on a per declaration basis, not per use basis
Change-Id: I59764334cb1befda9e0db0fd09fc83f6398f61da
Reviewed-on: https://dart-review.googlesource.com/32960
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
2018-01-10 11:34:59 +00:00
Samir Jindel 28a0706e91 [kernel] Implement correct semantics of forwarding stubs in VM
This revision has been factored out of Revision 29300.

Change-Id: Idf579f0e5ffeea5764e2a9654c6812d69f6977c7
Reviewed-on: https://dart-review.googlesource.com/31921
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2018-01-10 07:39:31 +00:00
Peter von der Ahé bb9af782a7 Correct type arguments for NSM
Change-Id: I28623bed9d5d203e82d50c4b057803a89e76757d
Reviewed-on: https://dart-review.googlesource.com/33380
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Peter von der Ahé <ahe@google.com>
2018-01-10 07:13:30 +00:00
Jens Johansen 11358378be [kernel] Change offset for IndexAccessor invocations
Add Observatory test to check debug positions for e.g. a[0]().
Non-kernel pipeline points to '(', whereas the (old) kernel behaviour
was to point to 'a'. This fixes the kernel behaviour to also point to '('.

Bug:
Change-Id: I9cd0a2f0cdd4428cd491d02ccc63c72caf285292
Reviewed-on: https://dart-review.googlesource.com/31982
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
2018-01-10 07:07:39 +00:00
Leaf Petersen 116ecdcf11 Hide new core lib MapEntry class where it conflicts in fasta, and
suppress hints about the undefined name for backwards compatibility.

Bug:
Change-Id: I381af6a8ae5be040e3c149e0cf4b9d45faa8c630
Reviewed-on: https://dart-review.googlesource.com/33663
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Leaf Petersen <leafp@google.com>
2018-01-10 01:20:21 +00:00
Konstantin Shcheglov 4e9e5d0569 Assign analyzer codes to several FrontEnd errors.
R=brianwilkerson@google.com, paulberry@google.com

Bug:
Change-Id: I2cf2a948048245e016f0f3d316dcf889c4bde31d
Reviewed-on: https://dart-review.googlesource.com/33583
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-01-09 21:25:48 +00:00
Konstantin Shcheglov a6792904bf Don't append ErrorToken.lexeme, this causes an exception.
R=brianwilkerson@google.com, paulberry@google.com

Bug:
Change-Id: I23a590761b07254a37d7dc64b55ff18580a4c767
Reviewed-on: https://dart-review.googlesource.com/33541
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-01-09 18:52:39 +00:00
Jens Johansen f72603ab45 [fasta] Allow --dump-ir to print error program
For instance, with the program snippet from issue #31409 one would not
get any other output than the errors, and one would have to explicitly
dump the dill file afterwards to see what was actually generated.

This CL changes this, so the error-library is also printed (in addition
to the, at least in the case of issue #31409, empty list) as in

```
$ pkg/front_end/tool/fasta compile tmp.dart --dump-ir

tmp.dart:2:4: Error: Expected a function body or '=>'.
Try adding {}.
V();
   ^
tmp.dart:3:5: Error: Duplicated definition of 'V'.
var V;
    ^
tmp.dart: Error: Duplicated name: 'V'.
tmp.dart:2:1: Error: Duplicated name: V
V();
^
library;
import self as self;

static method #main() → dynamic {
  throw "tmp.dart:2:1: Error: Duplicated name: V\nV();\n^";
}
```

Bug:
Change-Id: I8739be43137f098e6dc50df27f4d1d8628bea469
Reviewed-on: https://dart-review.googlesource.com/32602
Reviewed-by: Peter von der Ahé <ahe@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2018-01-09 13:11:58 +00:00
Konstantin Shcheglov dd8decb695 Fix for explicit 'call' invocation and property get.
R=brianwilkerson@google.com, paulberry@google.com

Bug:
Change-Id: I17b11d2cfe53ed69ce251d8a7363f9aaf278e89b
Reviewed-on: https://dart-review.googlesource.com/33145
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-01-09 00:18:56 +00:00
Paul Berry fa8f690071 Implement accessor type override checking rules in front_end.
Test failures introduced by this change have been marked with issue #31616.

Change-Id: Id82a2e850d2d7c3ebcb78b5acb2e59ea3d8da544
Reviewed-on: https://dart-review.googlesource.com/32682
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2018-01-08 14:46:42 +00:00
Aske Simon Christensen 0c03458717 Reland "Treat most warnings as errors in strong mode."
Reland of https://dart-review.googlesource.com/c/sdk/+/29160

Adds a 'severity' field to diagnostic messages and replaces all
addWarning and addNit functions by a generic addProblem, which uses
the intrinsic severity of the message. Eventually, errors should
also be reported this way.

A special severity value maps into either warning or error for Dart 1
and Dart 2, respectively. Most Dart 1 warnings are in this category.

Fixes some 320 failures of DDK test expecting a compile-time error.
These were previously masked by a workaround in the DDC error handler
which has now been removed.

Closes https://github.com/dart-lang/sdk/issues/31286

Change-Id: Id3b3b7f1fc6a101639fc908c90f3ec7d304a7b4b
Reviewed-on: https://dart-review.googlesource.com/32580
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2018-01-08 09:20:02 +00:00
Dmitry Stefantsov d9f7f81961 Add tests of instantiate to bound in fasta
Change-Id: Ie4940c9fda24abcfd038409e993f208a6ba0a94a
Reviewed-on: https://dart-review.googlesource.com/31940
Reviewed-by: Erik Ernst <eernst@google.com>
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
2018-01-08 08:35:22 +00:00
Paul Berry eeb903499d Test more for-each downward inference corner cases.
Note that the annotation "/*@target=C::aField*/" is duplicated in the
test due to #31790.

Change-Id: Ie3cf2dea7efb9ae46310ee069a588feb37855201
Reviewed-on: https://dart-review.googlesource.com/32862
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-01-08 02:52:33 +00:00
Dan Rubel cdd4268bc8 Revert "Improve fasta field recovery"
This reverts commit ab229b30ef.

Reason for revert: Failing co19 test

Original change's description:
> Improve fasta field recovery
> 
> In addition to improving field recovery, this CL
> fixes class field recovery to include an endMember event event
> and cleans up missing class body recovery.
> 
> Change-Id: I53afe5aef55452108803388de9245f7e14f97833
> Reviewed-on: https://dart-review.googlesource.com/32820
> Commit-Queue: Dan Rubel <danrubel@google.com>
> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>

TBR=brianwilkerson@google.com,danrubel@google.com

Change-Id: Id2976bfe67b410875a912bbfd6bfcbbe3d3c8c75
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/32840
Reviewed-by: Dan Rubel <danrubel@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-01-07 02:06:32 +00:00
Dan Rubel ab229b30ef Improve fasta field recovery
In addition to improving field recovery, this CL
fixes class field recovery to include an endMember event event
and cleans up missing class body recovery.

Change-Id: I53afe5aef55452108803388de9245f7e14f97833
Reviewed-on: https://dart-review.googlesource.com/32820
Commit-Queue: Dan Rubel <danrubel@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-01-06 21:51:50 +00:00